From 95db61e97f69720d807329075196e89815890214 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Mon, 20 Jul 2015 18:44:35 +0100 Subject: [PATCH 1/3] Google Cloud Storage (gcs) dependencies (1) Add new dependencies to Godeps/Godeps.json Signed-off-by: Arthur Baars --- Godeps/Godeps.json | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index e24937a0b..3cc23d8d5 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -5,6 +5,42 @@ "./..." ], "Deps": [ + { + "ImportPath": "golang.org/x/oauth2", + "Rev": "8914e5017ca260f2a3a1575b1e6868874050d95e" + }, + { + "ImportPath": "golang.org/x/oauth2/google", + "Rev": "8914e5017ca260f2a3a1575b1e6868874050d95e" + }, + { + "ImportPath": "google.golang.org/api/storage/v1", + "Rev": "18450f4e95c7e76ce3a5dc3a8cb7178ab6d56121" + }, + { + "ImportPath": "google.golang.org/cloud", + "Rev": "2400193c85c3561d13880d34e0e10c4315bb02af" + }, + { + "ImportPath": "google.golang.org/api", + "Rev": "18450f4e95c7e76ce3a5dc3a8cb7178ab6d56121" + }, + { + "ImportPath": "google.golang.org/grpc", + "Rev": "91c8b79535eb6045d70ec671d302213f88a3ab95" + }, + { + "ImportPath": "github.com/bradfitz/http2", + "Rev": "f8202bc903bda493ebba4aa54922d78430c2c42f" + }, + { + "ImportPath": "github.com/golang/protobuf", + "Rev": "0f7a9caded1fb3c9cc5a9b4bcf2ff633cc8ae644" + }, + { + "ImportPath": "google.golang.org/cloud/storage", + "Rev": "2400193c85c3561d13880d34e0e10c4315bb02af" + }, { "ImportPath": "github.com/AdRoll/goamz/aws", "Rev": "aa6e716d710a0c7941cb2075cfbb9661f16d21f1" @@ -128,7 +164,11 @@ }, { "ImportPath": "golang.org/x/net/context", - "Rev": "1dfe7915deaf3f80b962c163b918868d8a6d8974" + "Rev": "2cba614e8ff920c60240d2677bc019af32ee04e5" + }, + { + "ImportPath": "golang.org/x/net/trace", + "Rev": "2cba614e8ff920c60240d2677bc019af32ee04e5" }, { "ImportPath": "gopkg.in/check.v1", From 41e71e9a461878a2cf0ff50428e8a5092dee3086 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Mon, 20 Jul 2015 18:44:35 +0100 Subject: [PATCH 2/3] Google Cloud Storage (gcs) dependencies (2) Add files of new dependencies to Godeps/_workspace Signed-off-by: Arthur Baars --- .../src/github.com/bradfitz/http2/.gitignore | 2 + .../src/github.com/bradfitz/http2/AUTHORS | 20 + .../github.com/bradfitz/http2/CONTRIBUTORS | 20 + .../src/github.com/bradfitz/http2/Dockerfile | 44 + .../src/github.com/bradfitz/http2/HACKING | 5 + .../src/github.com/bradfitz/http2/LICENSE | 7 + .../src/github.com/bradfitz/http2/Makefile | 3 + .../src/github.com/bradfitz/http2/README | 17 + .../src/github.com/bradfitz/http2/buffer.go | 76 + .../github.com/bradfitz/http2/buffer_test.go | 154 + .../src/github.com/bradfitz/http2/errors.go | 78 + .../github.com/bradfitz/http2/errors_test.go | 27 + .../src/github.com/bradfitz/http2/flow.go | 51 + .../github.com/bradfitz/http2/flow_test.go | 54 + .../src/github.com/bradfitz/http2/frame.go | 1113 + .../github.com/bradfitz/http2/frame_test.go | 597 + .../src/github.com/bradfitz/http2/gotrack.go | 173 + .../github.com/bradfitz/http2/gotrack_test.go | 33 + .../bradfitz/http2/h2demo/.gitignore | 5 + .../github.com/bradfitz/http2/h2demo/Makefile | 5 + .../github.com/bradfitz/http2/h2demo/README | 16 + .../bradfitz/http2/h2demo/h2demo.go | 426 + .../bradfitz/http2/h2demo/launch.go | 302 + .../bradfitz/http2/h2demo/rootCA.key | 27 + .../bradfitz/http2/h2demo/rootCA.srl | 1 + .../bradfitz/http2/h2demo/server.crt | 20 + .../bradfitz/http2/h2demo/server.key | 27 + .../github.com/bradfitz/http2/h2i/README.md | 97 + .../src/github.com/bradfitz/http2/h2i/h2i.go | 489 + .../github.com/bradfitz/http2/headermap.go | 80 + .../github.com/bradfitz/http2/hpack/encode.go | 252 + .../bradfitz/http2/hpack/encode_test.go | 331 + .../github.com/bradfitz/http2/hpack/hpack.go | 445 + .../bradfitz/http2/hpack/hpack_test.go | 648 + .../bradfitz/http2/hpack/huffman.go | 159 + .../github.com/bradfitz/http2/hpack/tables.go | 353 + .../src/github.com/bradfitz/http2/http2.go | 249 + .../github.com/bradfitz/http2/http2_test.go | 152 + .../src/github.com/bradfitz/http2/pipe.go | 43 + .../github.com/bradfitz/http2/pipe_test.go | 24 + .../bradfitz/http2/priority_test.go | 121 + .../src/github.com/bradfitz/http2/server.go | 1780 + .../github.com/bradfitz/http2/server_test.go | 2252 + .../testdata/draft-ietf-httpbis-http2.xml | 5021 ++ .../github.com/bradfitz/http2/transport.go | 553 + .../bradfitz/http2/transport_test.go | 168 + .../src/github.com/bradfitz/http2/write.go | 204 + .../github.com/bradfitz/http2/writesched.go | 286 + .../github.com/bradfitz/http2/z_spec_test.go | 357 + .../src/github.com/golang/protobuf/.gitignore | 17 + .../src/github.com/golang/protobuf/AUTHORS | 3 + .../github.com/golang/protobuf/CONTRIBUTORS | 3 + .../src/github.com/golang/protobuf/LICENSE | 31 + .../github.com/golang/protobuf/Make.protobuf | 40 + .../src/github.com/golang/protobuf/Makefile | 55 + .../src/github.com/golang/protobuf/README | 158 + .../golang/protobuf/jsonpb/jsonpb.go | 429 + .../golang/protobuf/jsonpb/jsonpb_test.go | 367 + .../jsonpb/jsonpb_test_proto/Makefile | 33 + .../jsonpb_test_proto/more_test_objects.proto | 46 + .../jsonpb_test_proto/test_objects.proto | 86 + .../github.com/golang/protobuf/proto/Makefile | 43 + .../golang/protobuf/proto/all_test.go | 2083 + .../github.com/golang/protobuf/proto/clone.go | 212 + .../golang/protobuf/proto/clone_test.go | 245 + .../golang/protobuf/proto/decode.go | 827 + .../golang/protobuf/proto/encode.go | 1293 + .../github.com/golang/protobuf/proto/equal.go | 256 + .../golang/protobuf/proto/equal_test.go | 191 + .../golang/protobuf/proto/extensions.go | 400 + .../golang/protobuf/proto/extensions_test.go | 292 + .../github.com/golang/protobuf/proto/lib.go | 813 + .../golang/protobuf/proto/message_set.go | 287 + .../golang/protobuf/proto/message_set_test.go | 66 + .../golang/protobuf/proto/pointer_reflect.go | 479 + .../golang/protobuf/proto/pointer_unsafe.go | 266 + .../golang/protobuf/proto/properties.go | 742 + .../protobuf/proto/proto3_proto/proto3.proto | 68 + .../golang/protobuf/proto/proto3_test.go | 125 + .../golang/protobuf/proto/size2_test.go | 63 + .../golang/protobuf/proto/size_test.go | 142 + .../golang/protobuf/proto/testdata/Makefile | 50 + .../protobuf/proto/testdata/golden_test.go | 86 + .../golang/protobuf/proto/testdata/test.proto | 480 + .../github.com/golang/protobuf/proto/text.go | 769 + .../golang/protobuf/proto/text_parser.go | 772 + .../golang/protobuf/proto/text_parser_test.go | 511 + .../golang/protobuf/proto/text_test.go | 441 + .../golang/protobuf/protoc-gen-go/Makefile | 33 + .../protoc-gen-go/descriptor/Makefile | 45 + .../descriptor/descriptor.pb.golden | 1024 + .../golang/protobuf/protoc-gen-go/doc.go | 51 + .../protobuf/protoc-gen-go/generator/Makefile | 40 + .../protoc-gen-go/generator/generator.go | 2089 + .../protoc-gen-go/generator/name_test.go | 56 + .../protoc-gen-go/internal/grpc/grpc.go | 436 + .../protobuf/protoc-gen-go/link_grpc.go | 34 + .../golang/protobuf/protoc-gen-go/main.go | 98 + .../protobuf/protoc-gen-go/plugin/Makefile | 46 + .../protoc-gen-go/plugin/plugin.pb.golden | 83 + .../protobuf/protoc-gen-go/testdata/Makefile | 66 + .../testdata/extension_base.proto | 46 + .../testdata/extension_extra.proto | 38 + .../protoc-gen-go/testdata/extension_test.go | 210 + .../testdata/extension_user.proto | 100 + .../protoc-gen-go/testdata/golden_test.go | 86 + .../protoc-gen-go/testdata/grpc.proto | 59 + .../protoc-gen-go/testdata/imp.pb.go.golden | 113 + .../protobuf/protoc-gen-go/testdata/imp.proto | 65 + .../protoc-gen-go/testdata/imp2.proto | 43 + .../protoc-gen-go/testdata/imp3.proto | 38 + .../protoc-gen-go/testdata/main_test.go | 46 + .../protoc-gen-go/testdata/multi/multi1.proto | 44 + .../protoc-gen-go/testdata/multi/multi2.proto | 46 + .../protoc-gen-go/testdata/multi/multi3.proto | 43 + .../testdata/my_test/test.pb.go.golden | 487 + .../protoc-gen-go/testdata/my_test/test.proto | 132 + .../protoc-gen-go/testdata/proto3.proto | 52 + .../src/golang.org/x/net/context/context.go | 69 +- .../golang.org/x/net/context/context_test.go | 26 +- .../x/net/context/ctxhttp/cancelreq.go | 18 + .../x/net/context/ctxhttp/cancelreq_go14.go | 23 + .../x/net/context/ctxhttp/ctxhttp.go | 79 + .../x/net/context/ctxhttp/ctxhttp_test.go | 72 + .../golang.org/x/net/internal/iana/const.go | 181 + .../src/golang.org/x/net/internal/iana/gen.go | 293 + .../x/net/internal/nettest/error_posix.go | 31 + .../x/net/internal/nettest/error_stub.go | 11 + .../x/net/internal/nettest/interface.go | 94 + .../x/net/internal/nettest/rlimit.go | 11 + .../x/net/internal/nettest/rlimit_stub.go | 9 + .../x/net/internal/nettest/rlimit_unix.go | 17 + .../x/net/internal/nettest/rlimit_windows.go | 7 + .../x/net/internal/nettest/stack.go | 36 + .../x/net/internal/nettest/stack_stub.go | 18 + .../x/net/internal/nettest/stack_unix.go | 22 + .../x/net/internal/nettest/stack_windows.go | 32 + .../x/net/internal/timeseries/timeseries.go | 525 + .../internal/timeseries/timeseries_test.go | 170 + .../src/golang.org/x/net/trace/events.go | 524 + .../src/golang.org/x/net/trace/histogram.go | 356 + .../golang.org/x/net/trace/histogram_test.go | 325 + .../src/golang.org/x/net/trace/trace.go | 1057 + .../src/golang.org/x/net/trace/trace_test.go | 46 + .../src/golang.org/x/oauth2/.travis.yml | 14 + .../src/golang.org/x/oauth2/AUTHORS | 3 + .../src/golang.org/x/oauth2/CONTRIBUTING.md | 31 + .../src/golang.org/x/oauth2/CONTRIBUTORS | 3 + .../src/golang.org/x/oauth2/LICENSE | 27 + .../src/golang.org/x/oauth2/README.md | 64 + .../golang.org/x/oauth2/client_appengine.go | 25 + .../clientcredentials/clientcredentials.go | 112 + .../clientcredentials_test.go | 96 + .../src/golang.org/x/oauth2/example_test.go | 45 + .../golang.org/x/oauth2/facebook/facebook.go | 16 + .../src/golang.org/x/oauth2/github/github.go | 16 + .../golang.org/x/oauth2/google/appengine.go | 83 + .../x/oauth2/google/appengine_hook.go | 13 + .../src/golang.org/x/oauth2/google/default.go | 154 + .../x/oauth2/google/example_test.go | 150 + .../src/golang.org/x/oauth2/google/google.go | 145 + .../golang.org/x/oauth2/google/google_test.go | 67 + .../src/golang.org/x/oauth2/google/sdk.go | 168 + .../golang.org/x/oauth2/google/sdk_test.go | 46 + .../oauth2/google/testdata/gcloud/credentials | 122 + .../oauth2/google/testdata/gcloud/properties | 2 + .../golang.org/x/oauth2/internal/oauth2.go | 76 + .../x/oauth2/internal/oauth2_test.go | 62 + .../src/golang.org/x/oauth2/internal/token.go | 214 + .../x/oauth2/internal/token_test.go | 28 + .../golang.org/x/oauth2/internal/transport.go | 67 + .../src/golang.org/x/oauth2/jws/jws.go | 160 + .../golang.org/x/oauth2/jwt/example_test.go | 31 + .../src/golang.org/x/oauth2/jwt/jwt.go | 147 + .../src/golang.org/x/oauth2/jwt/jwt_test.go | 134 + .../golang.org/x/oauth2/linkedin/linkedin.go | 16 + .../src/golang.org/x/oauth2/oauth2.go | 325 + .../src/golang.org/x/oauth2/oauth2_test.go | 422 + .../x/oauth2/odnoklassniki/odnoklassniki.go | 16 + .../src/golang.org/x/oauth2/paypal/paypal.go | 22 + .../src/golang.org/x/oauth2/token.go | 143 + .../src/golang.org/x/oauth2/token_test.go | 50 + .../src/golang.org/x/oauth2/transport.go | 132 + .../src/golang.org/x/oauth2/transport_test.go | 86 + .../src/golang.org/x/oauth2/vk/vk.go | 16 + .../src/google.golang.org/api/.hgignore | 11 + .../src/google.golang.org/api/.hgtags | 1 + .../src/google.golang.org/api/.travis.yml | 13 + .../src/google.golang.org/api/AUTHORS | 10 + .../src/google.golang.org/api/CONTRIBUTING.md | 484 + .../src/google.golang.org/api/CONTRIBUTORS | 51 + .../google.golang.org/api/GettingStarted.md | 122 + .../src/google.golang.org/api/LICENSE | 27 + .../src/google.golang.org/api/Makefile | 27 + .../src/google.golang.org/api/NOTES | 13 + .../src/google.golang.org/api/README.md | 92 + .../_workspace/src/google.golang.org/api/TODO | 2 + .../v1.2/adexchangebuyer-api.json | 596 + .../v1.2/adexchangebuyer-gen.go | 1367 + .../v1.3/adexchangebuyer-api.json | 1655 + .../v1.3/adexchangebuyer-gen.go | 3978 ++ .../v1.4/adexchangebuyer-api.json | 4193 ++ .../v1.4/adexchangebuyer-gen.go | 9299 ++++ .../v1.1/adexchangeseller-api.json | 1241 + .../v1.1/adexchangeseller-gen.go | 3576 ++ .../v1/adexchangeseller-api.json | 918 + .../v1/adexchangeseller-gen.go | 2531 + .../v2.0/adexchangeseller-api.json | 1164 + .../v2.0/adexchangeseller-gen.go | 3112 ++ .../api/admin/datatransfer/v1/admin-api.json | 411 + .../api/admin/datatransfer/v1/admin-gen.go | 1050 + .../api/admin/directory/v1/admin-api.json | 5311 ++ .../api/admin/directory/v1/admin-gen.go | 14810 ++++++ .../admin/email_migration/v2/admin-api.json | 173 + .../api/admin/email_migration/v2/admin-gen.go | 321 + .../api/admin/reports/v1/admin-api.json | 744 + .../api/admin/reports/v1/admin-gen.go | 1565 + .../api/adsense/v1.2/adsense-api.json | 1949 + .../api/adsense/v1.2/adsense-gen.go | 5950 +++ .../api/adsense/v1.3/adsense-api.json | 2250 + .../api/adsense/v1.3/adsense-gen.go | 6995 +++ .../api/adsense/v1.4/adsense-api.json | 2411 + .../api/adsense/v1.4/adsense-gen.go | 7521 +++ .../api/adsensehost/v4.1/adsensehost-api.json | 1569 + .../api/adsensehost/v4.1/adsensehost-gen.go | 4809 ++ .../api/analytics/v2.4/analytics-api.json | 366 + .../api/analytics/v2.4/analytics-gen.go | 1066 + .../api/analytics/v3/analytics-api.json | 6675 +++ .../api/analytics/v3/analytics-gen.go | 16243 ++++++ .../v1/androidenterprise-api.json | 2415 + .../v1/androidenterprise-gen.go | 7947 +++ .../v1.1/androidpublisher-api.json | 256 + .../v1.1/androidpublisher-gen.go | 581 + .../v1/androidpublisher-api.json | 184 + .../v1/androidpublisher-gen.go | 377 + .../v2/androidpublisher-api.json | 3071 ++ .../v2/androidpublisher-gen.go | 9050 ++++ .../src/google.golang.org/api/api-list.json | 2226 + .../api/appengine/v1beta4/appengine-api.json | 1423 + .../api/appengine/v1beta4/appengine-gen.go | 3083 ++ .../api/appsactivity/v1/appsactivity-api.json | 477 + .../api/appsactivity/v1/appsactivity-gen.go | 704 + .../api/appstate/v1/appstate-api.json | 307 + .../api/appstate/v1/appstate-gen.go | 845 + .../autoscaler/v1beta2/autoscaler-api.json | 891 + .../api/autoscaler/v1beta2/autoscaler-gen.go | 2111 + .../api/bigquery/v2/bigquery-api.json | 2348 + .../api/bigquery/v2/bigquery-gen.go | 5266 ++ .../api/blogger/v2/blogger-api.json | 923 + .../api/blogger/v2/blogger-gen.go | 2236 + .../api/blogger/v3/blogger-api.json | 2507 + .../api/blogger/v3/blogger-gen.go | 7012 +++ .../api/books/v1/books-api.json | 4293 ++ .../api/books/v1/books-gen.go | 11363 +++++ .../api/calendar/v3/calendar-api.json | 2666 + .../api/calendar/v3/calendar-gen.go | 7663 +++ .../api/civicinfo/v2/civicinfo-api.json | 1069 + .../api/civicinfo/v2/civicinfo-gen.go | 1868 + .../api/classroom/v1/classroom-api.json | 1109 + .../api/classroom/v1/classroom-gen.go | 3849 ++ .../api/cloudbilling/v1/cloudbilling-api.json | 343 + .../api/cloudbilling/v1/cloudbilling-gen.go | 982 + .../clouddebugger/v2/clouddebugger-api.json | 913 + .../api/clouddebugger/v2/clouddebugger-gen.go | 2126 + .../v2/cloudlatencytest-api.json | 212 + .../v2/cloudlatencytest-gen.go | 447 + .../v2beta2/cloudmonitoring-api.json | 839 + .../v2beta2/cloudmonitoring-gen.go | 1950 + .../v1beta1/cloudresourcemanager-api.json | 716 + .../v1beta1/cloudresourcemanager-gen.go | 2466 + .../api/cloudtrace/v1/cloudtrace-api.json | 385 + .../api/cloudtrace/v1/cloudtrace-gen.go | 919 + .../v0.alpha/clouduseraccounts-api.json | 1818 + .../v0.alpha/clouduseraccounts-gen.go | 4592 ++ .../v0.beta/clouduseraccounts-api.json | 1355 + .../v0.beta/clouduseraccounts-gen.go | 3451 ++ .../vm_alpha/clouduseraccounts-api.json | 1818 + .../vm_alpha/clouduseraccounts-gen.go | 4592 ++ .../vm_beta/clouduseraccounts-api.json | 1355 + .../vm_beta/clouduseraccounts-gen.go | 3451 ++ .../api/compute/v0.beta/compute-api.json | 14405 ++++++ .../api/compute/v0.beta/compute-gen.go | 39109 ++++++++++++++ .../api/compute/v1/compute-api.json | 13950 +++++ .../api/compute/v1/compute-gen.go | 37418 ++++++++++++++ .../api/container/v1/container-api.json | 690 + .../api/container/v1/container-gen.go | 1658 + .../api/container/v1beta1/container-api.json | 644 + .../api/container/v1beta1/container-gen.go | 1369 + .../api/content/v2/content-api.json | 6047 +++ .../api/content/v2/content-gen.go | 12832 +++++ .../api/content/v2sandbox/content-api.json | 2175 + .../api/content/v2sandbox/content-gen.go | 4013 ++ .../api/coordinate/v1/coordinate-api.json | 1196 + .../api/coordinate/v1/coordinate-gen.go | 3024 ++ .../api/customsearch/v1/customsearch-api.json | 814 + .../api/customsearch/v1/customsearch-gen.go | 1343 + .../api/dataflow/v1b3/dataflow-api.json | 2368 + .../api/dataflow/v1b3/dataflow-gen.go | 4050 ++ .../api/datastore/v1beta1/datastore-api.json | 988 + .../api/datastore/v1beta1/datastore-gen.go | 1990 + .../api/datastore/v1beta2/datastore-api.json | 1075 + .../api/datastore/v1beta2/datastore-gen.go | 1903 + .../v2/deploymentmanager-api.json | 1394 + .../v2/deploymentmanager-gen.go | 3610 ++ .../v2beta1/deploymentmanager-api.json | 883 + .../v2beta1/deploymentmanager-gen.go | 2323 + .../v2beta2/deploymentmanager-api.json | 1225 + .../v2beta2/deploymentmanager-gen.go | 3119 ++ .../dfareporting/v1.1/dfareporting-api.json | 1521 + .../api/dfareporting/v1.1/dfareporting-gen.go | 3197 ++ .../dfareporting/v1.2/dfareporting-api.json | 1589 + .../api/dfareporting/v1.2/dfareporting-gen.go | 3437 ++ .../dfareporting/v1.3/dfareporting-api.json | 1913 + .../api/dfareporting/v1.3/dfareporting-gen.go | 3875 ++ .../api/dfareporting/v1/dfareporting-api.json | 1172 + .../api/dfareporting/v1/dfareporting-gen.go | 2806 + .../dfareporting/v2.0/dfareporting-api.json | 15333 ++++++ .../api/dfareporting/v2.0/dfareporting-gen.go | 36804 +++++++++++++ .../dfareporting/v2.1/dfareporting-api.json | 17625 +++++++ .../api/dfareporting/v2.1/dfareporting-gen.go | 42419 +++++++++++++++ .../dfareporting/v2.2/dfareporting-api.json | 17672 +++++++ .../api/dfareporting/v2.2/dfareporting-gen.go | 42571 ++++++++++++++++ .../api/discovery/v1/discovery-api.json | 682 + .../api/discovery/v1/discovery-gen.go | 1040 + .../google.golang.org/api/dns/v1/dns-api.json | 708 + .../google.golang.org/api/dns/v1/dns-gen.go | 1841 + .../api/dns/v1beta1/dns-api.json | 700 + .../api/dns/v1beta1/dns-gen.go | 1837 + .../v1/doubleclickbidmanager-api.json | 1806 + .../v1/doubleclickbidmanager-gen.go | 2115 + .../v2/doubleclicksearch-api.json | 1109 + .../v2/doubleclicksearch-gen.go | 2244 + .../api/drive/v1/drive-api.json | 417 + .../api/drive/v1/drive-gen.go | 1113 + .../api/drive/v2/drive-api.json | 4277 ++ .../api/drive/v2/drive-gen.go | 11678 +++++ .../api/examples/bigquery.go | 368 + .../google.golang.org/api/examples/books.go | 77 + .../api/examples/calendar.go | 73 + .../google.golang.org/api/examples/compute.go | 93 + .../google.golang.org/api/examples/debug.go | 72 + .../google.golang.org/api/examples/drive.go | 35 + .../google.golang.org/api/examples/fitness.go | 109 + .../google.golang.org/api/examples/gmail.go | 140 + .../google.golang.org/api/examples/gopher.png | Bin 0 -> 23019 bytes .../google.golang.org/api/examples/main.go | 206 + .../api/examples/mapsengine.go | 93 + .../google.golang.org/api/examples/mirror.go | 97 + .../api/examples/prediction.go | 137 + .../google.golang.org/api/examples/pubsub.go | 319 + .../google.golang.org/api/examples/storage.go | 64 + .../google.golang.org/api/examples/tasks.go | 26 + .../api/examples/urlshortener.go | 50 + .../google.golang.org/api/examples/youtube.go | 65 + .../api/fitness/v1/fitness-api.json | 1321 + .../api/fitness/v1/fitness-gen.go | 2893 ++ .../api/freebase/v1/freebase-api.json | 412 + .../api/freebase/v1/freebase-gen.go | 972 + .../api/fusiontables/v1/fusiontables-api.json | 1824 + .../api/fusiontables/v1/fusiontables-gen.go | 5482 ++ .../api/fusiontables/v2/fusiontables-api.json | 1930 + .../api/fusiontables/v2/fusiontables-gen.go | 5846 +++ .../api/games/v1/games-api.json | 4806 ++ .../api/games/v1/games-gen.go | 11723 +++++ .../gamesconfiguration-api.json | 774 + .../v1configuration/gamesconfiguration-gen.go | 2256 + .../v1management/gamesmanagement-api.json | 881 + .../v1management/gamesmanagement-gen.go | 3044 ++ .../api/gan/v1beta1/gan-api.json | 1860 + .../api/gan/v1beta1/gan-gen.go | 3722 ++ .../api/genomics/v1/genomics-api.json | 2781 + .../api/genomics/v1/genomics-gen.go | 7958 +++ .../api/genomics/v1beta2/genomics-api.json | 3859 ++ .../api/genomics/v1beta2/genomics-gen.go | 10476 ++++ .../api/gmail/v1/gmail-api.json | 2009 + .../api/gmail/v1/gmail-gen.go | 6026 +++ .../api/google-api-go-generator/docurls.go | 156 + .../api/google-api-go-generator/gen.go | 2326 + .../api/google-api-go-generator/gen_test.go | 175 + .../google-api-go-generator/storage_test.go | 323 + .../google-api-go-generator/testdata/any.json | 1018 + .../google-api-go-generator/testdata/any.want | 2875 ++ .../testdata/arrayofarray-1.json | 49 + .../testdata/arrayofarray-1.want | 91 + .../testdata/arrayofenum.json | 191 + .../testdata/arrayofenum.want | 176 + .../testdata/arrayofmapofobjects.json | 32 + .../testdata/arrayofmapofobjects.want | 84 + .../testdata/arrayofmapofstrings.json | 32 + .../testdata/arrayofmapofstrings.want | 84 + .../testdata/blogger-3.json | 2199 + .../testdata/blogger-3.want | 6191 +++ .../testdata/getwithoutbody.json | 89 + .../testdata/getwithoutbody.want | 302 + .../testdata/mapofany.json | 51 + .../testdata/mapofany.want | 110 + .../testdata/mapofarrayofobjects.json | 72 + .../testdata/mapofarrayofobjects.want | 195 + .../testdata/mapofobjects.json | 30 + .../testdata/mapofobjects.want | 84 + .../testdata/mapofstrings-1.json | 72 + .../testdata/mapofstrings-1.want | 195 + .../testdata/quotednum.json | 94 + .../testdata/quotednum.want | 94 + .../testdata/resource-named-service.json | 2199 + .../testdata/resource-named-service.want | 6191 +++ .../testdata/unfortunatedefaults.json | 158 + .../testdata/unfortunatedefaults.want | 217 + .../testdata/variants.json | 418 + .../testdata/variants.want | 465 + .../testdata/wrapnewlines.json | 30 + .../testdata/wrapnewlines.want | 90 + .../api/googleapi/googleapi.go | 592 + .../api/googleapi/googleapi_test.go | 599 + .../googleapi/internal/uritemplates/LICENSE | 18 + .../internal/uritemplates/uritemplates.go | 359 + .../googleapi/internal/uritemplates/utils.go | 13 + .../api/googleapi/transport/apikey.go | 38 + .../google.golang.org/api/googleapi/types.go | 182 + .../api/googleapi/types_test.go | 44 + .../v1/groupsmigration-api.json | 143 + .../groupsmigration/v1/groupsmigration-gen.go | 323 + .../groupssettings/v1/groupssettings-api.json | 284 + .../groupssettings/v1/groupssettings-gen.go | 588 + .../v3/identitytoolkit-api.json | 1020 + .../identitytoolkit/v3/identitytoolkit-gen.go | 2291 + .../google.golang.org/api/internal/json.go | 173 + .../api/internal/json_test.go | 367 + .../api/lib/codereview/codereview.cfg | 1 + .../api/licensing/v1/licensing-api.json | 457 + .../api/licensing/v1/licensing-gen.go | 1212 + .../api/logging/v1beta3/logging-api.json | 1691 + .../api/logging/v1beta3/logging-gen.go | 4709 ++ .../api/logging/v2beta1/logging-api.json | 318 + .../api/logging/v2beta1/logging-gen.go | 304 + .../api/manager/v1beta2/manager-api.json | 1171 + .../api/manager/v1beta2/manager-gen.go | 2235 + .../api/mapsengine/exp2/mapsengine-api.json | 5375 ++ .../api/mapsengine/exp2/mapsengine-gen.go | 14615 ++++++ .../api/mapsengine/v1/mapsengine-api.json | 5352 ++ .../api/mapsengine/v1/mapsengine-gen.go | 14552 ++++++ .../api/mirror/v1/mirror-api.json | 1390 + .../api/mirror/v1/mirror-gen.go | 4282 ++ .../api/oauth2/v1/oauth2-api.json | 407 + .../api/oauth2/v1/oauth2-gen.go | 1229 + .../api/oauth2/v2/oauth2-api.json | 294 + .../api/oauth2/v2/oauth2-gen.go | 747 + .../v1/pagespeedonline-api.json | 415 + .../pagespeedonline/v1/pagespeedonline-gen.go | 509 + .../v2/pagespeedonline-api.json | 490 + .../pagespeedonline/v2/pagespeedonline-gen.go | 667 + .../api/partners/v2/partners-api.json | 1378 + .../api/partners/v2/partners-gen.go | 2653 + .../v1/playmoviespartner-api.json | 1131 + .../v1/playmoviespartner-gen.go | 2299 + .../api/plus/v1/plus-api.json | 2021 + .../google.golang.org/api/plus/v1/plus-gen.go | 4040 ++ .../api/plusdomains/v1/plusdomains-api.json | 2241 + .../api/plusdomains/v1/plusdomains-gen.go | 5263 ++ .../api/prediction/v1.2/prediction-api.json | 354 + .../api/prediction/v1.2/prediction-gen.go | 982 + .../api/prediction/v1.3/prediction-api.json | 412 + .../api/prediction/v1.3/prediction-gen.go | 1042 + .../api/prediction/v1.4/prediction-api.json | 437 + .../api/prediction/v1.4/prediction-gen.go | 1080 + .../v1beta1/proximitybeacon-api.json | 822 + .../v1beta1/proximitybeacon-gen.go | 2590 + .../api/pubsub/v1/pubsub-api.json | 1036 + .../api/pubsub/v1/pubsub-gen.go | 3382 ++ .../api/pubsub/v1beta1/pubsub-api.json | 699 + .../api/pubsub/v1beta1/pubsub-gen.go | 2301 + .../api/pubsub/v1beta1a/pubsub-api.json | 757 + .../api/pubsub/v1beta1a/pubsub-gen.go | 2469 + .../api/pubsub/v1beta2/pubsub-api.json | 1040 + .../api/pubsub/v1beta2/pubsub-gen.go | 3386 ++ .../api/qpxexpress/v1/qpxexpress-api.json | 895 + .../api/qpxexpress/v1/qpxexpress-gen.go | 1155 + .../replicapool/v1beta1/replicapool-api.json | 1116 + .../replicapool/v1beta1/replicapool-gen.go | 2383 + .../replicapool/v1beta2/replicapool-api.json | 1064 + .../replicapool/v1beta2/replicapool-gen.go | 2512 + .../v1beta1/replicapoolupdater-api.json | 932 + .../v1beta1/replicapoolupdater-gen.go | 2247 + .../api/reseller/v1/reseller-api.json | 828 + .../api/reseller/v1/reseller-gen.go | 2347 + .../api/reseller/v1sandbox/reseller-api.json | 828 + .../api/reseller/v1sandbox/reseller-gen.go | 2347 + .../v1beta1/resourceviews-api.json | 920 + .../v1beta1/resourceviews-gen.go | 2405 + .../v1beta2/resourceviews-api.json | 1052 + .../v1beta2/resourceviews-gen.go | 2457 + .../api/script/v1/script-api.json | 319 + .../api/script/v1/script-gen.go | 480 + .../v1/siteverification-api.json | 321 + .../v1/siteverification-gen.go | 1066 + .../api/spectrum/v1explorer/spectrum-api.json | 992 + .../api/spectrum/v1explorer/spectrum-gen.go | 2200 + .../api/sqladmin/v1beta3/sqladmin-api.json | 1966 + .../api/sqladmin/v1beta3/sqladmin-gen.go | 4894 ++ .../api/sqladmin/v1beta4/sqladmin-api.json | 2658 + .../api/sqladmin/v1beta4/sqladmin-gen.go | 7017 +++ .../api/storage/v1/storage-api.json | 2834 + .../api/storage/v1/storage-gen.go | 7977 +++ .../api/storage/v1beta1/storage-api.json | 1427 + .../api/storage/v1beta1/storage-gen.go | 4166 ++ .../api/storage/v1beta2/storage-api.json | 2345 + .../api/storage/v1beta2/storage-gen.go | 6887 +++ .../v1/storagetransfer-api.json | 1033 + .../storagetransfer/v1/storagetransfer-gen.go | 2604 + .../api/tagmanager/v1/tagmanager-api.json | 2876 ++ .../api/tagmanager/v1/tagmanager-gen.go | 7246 +++ .../api/taskqueue/v1beta1/taskqueue-api.json | 422 + .../api/taskqueue/v1beta1/taskqueue-gen.go | 982 + .../api/taskqueue/v1beta2/taskqueue-api.json | 569 + .../api/taskqueue/v1beta2/taskqueue-gen.go | 1465 + .../api/tasks/v1/tasks-api.json | 696 + .../api/tasks/v1/tasks-gen.go | 2216 + .../api/translate/v2/translate-api.json | 267 + .../api/translate/v2/translate-gen.go | 692 + .../api/urlshortener/v1/urlshortener-api.json | 319 + .../api/urlshortener/v1/urlshortener-gen.go | 681 + .../api/webfonts/v1/webfonts-api.json | 175 + .../api/webfonts/v1/webfonts-gen.go | 294 + .../api/webmasters/v3/webmasters-api.json | 956 + .../api/webmasters/v3/webmasters-gen.go | 2381 + .../api/youtube/v3/youtube-api.json | 9465 ++++ .../api/youtube/v3/youtube-gen.go | 19369 +++++++ .../v1/youtubeanalytics-api.json | 724 + .../v1/youtubeanalytics-gen.go | 2098 + .../v1beta1/youtubeanalytics-api.json | 727 + .../v1beta1/youtubeanalytics-gen.go | 2098 + .../v1/youtubereporting-api.json | 522 + .../v1/youtubereporting-gen.go | 1564 + .../src/google.golang.org/cloud/.travis.yml | 11 + .../src/google.golang.org/cloud/AUTHORS | 12 + .../google.golang.org/cloud/CONTRIBUTING.md | 114 + .../src/google.golang.org/cloud/CONTRIBUTORS | 24 + .../src/google.golang.org/cloud/LICENSE | 202 + .../src/google.golang.org/cloud/README.md | 135 + .../cloud/bigquery/bigquery.go | 147 + .../cloud/bigquery/copy_op.go | 47 + .../cloud/bigquery/copy_test.go | 104 + .../cloud/bigquery/create_table_test.go | 55 + .../cloud/bigquery/dataset.go | 41 + .../cloud/bigquery/dataset_test.go | 105 + .../google.golang.org/cloud/bigquery/doc.go | 18 + .../google.golang.org/cloud/bigquery/error.go | 42 + .../cloud/bigquery/extract_op.go | 59 + .../cloud/bigquery/extract_test.go | 97 + .../google.golang.org/cloud/bigquery/gcs.go | 112 + .../cloud/bigquery/iterator.go | 168 + .../cloud/bigquery/iterator_test.go | 415 + .../google.golang.org/cloud/bigquery/job.go | 124 + .../cloud/bigquery/load_op.go | 112 + .../cloud/bigquery/load_test.go | 198 + .../google.golang.org/cloud/bigquery/query.go | 42 + .../cloud/bigquery/query_op.go | 89 + .../cloud/bigquery/query_test.go | 118 + .../cloud/bigquery/read_op.go | 68 + .../cloud/bigquery/read_test.go | 308 + .../cloud/bigquery/schema.go | 106 + .../cloud/bigquery/schema_test.go | 168 + .../cloud/bigquery/service.go | 403 + .../google.golang.org/cloud/bigquery/table.go | 278 + .../cloud/bigquery/utils_test.go | 51 + .../google.golang.org/cloud/bigquery/value.go | 145 + .../cloud/bigquery/value_test.go | 325 + .../google.golang.org/cloud/bigtable/admin.go | 267 + .../cloud/bigtable/admin_test.go | 59 + .../cloud/bigtable/bigtable.go | 529 + .../cloud/bigtable/bigtable_test.go | 606 + .../cloud/bigtable/bttest/inmem.go | 839 + .../cloud/bigtable/cmd/cbt/cbt.go | 580 + .../cloud/bigtable/cmd/cbt/cbtdoc.go | 146 + .../cloud/bigtable/cmd/loadtest/loadtest.go | 159 + .../cloud/bigtable/cmd/loadtest/stats.go | 97 + .../google.golang.org/cloud/bigtable/doc.go | 108 + .../cloud/bigtable/filter.go | 156 + .../google.golang.org/cloud/bigtable/gc.go | 131 + .../cloud/bigtable/internal/cbtrc/cbtrc.go | 105 + .../bigtable_cluster_data.pb.go | 119 + .../bigtable_cluster_data.proto | 89 + .../bigtable_cluster_service.pb.go | 331 + .../bigtable_cluster_service.proto | 118 + .../bigtable_cluster_service_messages.pb.go | 205 + .../bigtable_cluster_service_messages.proto | 126 + .../internal/data_proto/bigtable_data.pb.go | 1462 + .../internal/data_proto/bigtable_data.proto | 500 + .../internal/duration_proto/duration.pb.go | 81 + .../internal/duration_proto/duration.proto | 78 + .../cloud/bigtable/internal/empty/empty.pb.go | 38 + .../cloud/bigtable/internal/empty/empty.proto | 34 + .../cloud/bigtable/internal/regen.sh | 76 + .../service_proto/bigtable_service.pb.go | 287 + .../service_proto/bigtable_service.proto | 60 + .../bigtable_service_messages.pb.go | 444 + .../bigtable_service_messages.proto | 177 + .../bigtable_table_data.pb.go | 308 + .../bigtable_table_data.proto | 123 + .../bigtable_table_service.pb.go | 293 + .../bigtable_table_service.proto | 65 + .../bigtable_table_service_messages.pb.go | 156 + .../bigtable_table_service_messages.proto | 101 + .../src/google.golang.org/cloud/cloud.go | 49 + .../src/google.golang.org/cloud/cloud_test.go | 36 + .../cloud/compute/metadata/metadata.go | 327 + .../cloud/container/container.go | 251 + .../cloud/datastore/datastore.go | 496 + .../cloud/datastore/datastore_test.go | 1359 + .../cloud/datastore/errors.go | 47 + .../cloud/datastore/example_test.go | 251 + .../cloud/datastore/integration_test.go | 569 + .../google.golang.org/cloud/datastore/key.go | 277 + .../cloud/datastore/key_test.go | 223 + .../google.golang.org/cloud/datastore/load.go | 275 + .../google.golang.org/cloud/datastore/prop.go | 300 + .../cloud/datastore/query.go | 755 + .../cloud/datastore/query_test.go | 482 + .../google.golang.org/cloud/datastore/save.go | 210 + .../cloud/datastore/testdata/index.yaml | 41 + .../google.golang.org/cloud/datastore/time.go | 36 + .../cloud/datastore/time_test.go | 75 + .../cloud/datastore/transaction.go | 241 + .../examples/bigquery/concat_table/main.go | 111 + .../cloud/examples/bigquery/load/main.go | 104 + .../cloud/examples/bigquery/query/main.go | 108 + .../cloud/examples/bigquery/read/main.go | 148 + .../bigtable/bigtable-hello/README.md | 30 + .../examples/bigtable/bigtable-hello/app.yaml | 11 + .../bigtable/bigtable-hello/helloworld.go | 169 + .../cloud/examples/bigtable/search/search.go | 439 + .../cloud/examples/pubsub/cmdline/main.go | 354 + .../cloud/examples/storage/appengine/app.go | 401 + .../cloud/examples/storage/appengine/app.yaml | 8 + .../cloud/examples/storage/appenginevm/app.go | 396 + .../examples/storage/appenginevm/app.yaml | 10 + .../google.golang.org/cloud/internal/cloud.go | 128 + .../internal/datastore/datastore_v1.pb.go | 1633 + .../internal/datastore/datastore_v1.proto | 606 + .../cloud/internal/opts/option.go | 24 + .../cloud/internal/testutil/context.go | 69 + .../cloud/internal/transport/cancelreq.go | 29 + .../internal/transport/cancelreq_legacy.go | 31 + .../cloud/internal/transport/dial.go | 134 + .../cloud/internal/transport/proto.go | 80 + .../src/google.golang.org/cloud/key.json.enc | Bin 0 -> 1248 bytes .../cloud/logging/logging.go | 468 + .../cloud/logging/logging_test.go | 319 + .../src/google.golang.org/cloud/option.go | 100 + .../cloud/pubsub/example_test.go | 80 + .../cloud/pubsub/integration_test.go | 144 + .../google.golang.org/cloud/pubsub/pubsub.go | 323 + .../cloud/pubsub/pubsub_test.go | 49 + .../google.golang.org/cloud/storage/acl.go | 176 + .../cloud/storage/example_test.go | 150 + .../cloud/storage/integration_test.go | 327 + .../cloud/storage/storage.go | 350 + .../cloud/storage/storage_test.go | 238 + .../cloud/storage/testdata/dummy_pem | 39 + .../cloud/storage/testdata/dummy_rsa | 27 + .../google.golang.org/cloud/storage/types.go | 417 + .../cloud/storage/types_test.go | 42 + .../src/google.golang.org/grpc/.travis.yml | 4 + .../google.golang.org/grpc/CONTRIBUTING.md | 27 + .../src/google.golang.org/grpc/LICENSE | 28 + .../src/google.golang.org/grpc/Makefile | 47 + .../src/google.golang.org/grpc/PATENTS | 22 + .../src/google.golang.org/grpc/README.md | 23 + .../grpc/benchmark/benchmark.go | 147 + .../grpc/benchmark/benchmark_test.go | 198 + .../grpc/benchmark/client/main.go | 161 + .../grpc/benchmark/grpc_testing/test.pb.go | 641 + .../grpc/benchmark/grpc_testing/test.proto | 148 + .../grpc/benchmark/server/main.go | 35 + .../grpc/benchmark/stats/counter.go | 135 + .../grpc/benchmark/stats/histogram.go | 255 + .../grpc/benchmark/stats/stats.go | 116 + .../grpc/benchmark/stats/timeseries.go | 154 + .../grpc/benchmark/stats/tracker.go | 159 + .../grpc/benchmark/stats/util.go | 191 + .../src/google.golang.org/grpc/call.go | 195 + .../src/google.golang.org/grpc/clientconn.go | 315 + .../src/google.golang.org/grpc/codegen.sh | 17 + .../grpc/codes/code_string.go | 16 + .../src/google.golang.org/grpc/codes/codes.go | 159 + .../grpc/credentials/credentials.go | 270 + .../src/google.golang.org/grpc/doc.go | 6 + .../grpc/examples/route_guide/README.md | 35 + .../examples/route_guide/client/client.go | 200 + .../route_guide/proto/route_guide.pb.go | 425 + .../route_guide/proto/route_guide.proto | 121 + .../examples/route_guide/server/server.go | 239 + .../route_guide/testdata/route_guide_db.json | 601 + .../examples/route_guide/testdata/server1.key | 15 + .../grpc/grpc-auth-support.md | 41 + .../grpc/grpclog/glogger/glogger.go | 72 + .../google.golang.org/grpc/grpclog/logger.go | 90 + .../grpc/health/grpc_health/health.pb.go | 103 + .../grpc/health/grpc_health/health.proto | 13 + .../google.golang.org/grpc/health/health.go | 28 + .../grpc/interop/client/client.go | 419 + .../grpc/interop/client/testdata/server1.key | 15 + .../grpc/interop/grpc_testing/test.pb.go | 702 + .../grpc/interop/grpc_testing/test.proto | 140 + .../grpc/interop/server/server.go | 209 + .../grpc/interop/server/testdata/server1.key | 15 + .../grpc/metadata/metadata.go | 144 + .../grpc/metadata/metadata_test.go | 82 + .../src/google.golang.org/grpc/rpc_util.go | 306 + .../google.golang.org/grpc/rpc_util_test.go | 211 + .../src/google.golang.org/grpc/server.go | 423 + .../src/google.golang.org/grpc/stream.go | 278 + .../grpc/test/codec_perf/perf.pb.go | 42 + .../grpc/test/codec_perf/perf.proto | 11 + .../grpc/test/end2end_test.go | 862 + .../grpc/test/grpc_testing/test.pb.go | 702 + .../grpc/test/grpc_testing/test.proto | 140 + .../grpc/test/testdata/server1.key | 15 + .../src/google.golang.org/grpc/trace.go | 111 + .../grpc/transport/control.go | 253 + .../grpc/transport/http2_client.go | 784 + .../grpc/transport/http2_server.go | 670 + .../grpc/transport/http_util.go | 437 + .../grpc/transport/http_util_test.go | 87 + .../grpc/transport/testdata/server1.key | 15 + .../grpc/transport/transport.go | 458 + .../grpc/transport/transport_test.go | 522 + 727 files changed, 1076955 insertions(+), 29 deletions(-) create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/.gitignore create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/AUTHORS create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/CONTRIBUTORS create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/Dockerfile create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/HACKING create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/LICENSE create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/Makefile create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/README create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/buffer.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/buffer_test.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/errors.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/errors_test.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/flow.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/flow_test.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/frame.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/frame_test.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/gotrack.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/gotrack_test.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/.gitignore create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/Makefile create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/README create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/h2demo.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/launch.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/rootCA.key create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/rootCA.srl create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/server.crt create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/server.key create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/h2i/README.md create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/h2i/h2i.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/headermap.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/hpack/encode.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/hpack/encode_test.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/hpack/hpack.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/hpack/hpack_test.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/hpack/huffman.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/hpack/tables.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/http2.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/http2_test.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/pipe.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/pipe_test.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/priority_test.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/server.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/server_test.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/testdata/draft-ietf-httpbis-http2.xml create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/transport.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/transport_test.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/write.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/writesched.go create mode 100644 Godeps/_workspace/src/github.com/bradfitz/http2/z_spec_test.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/.gitignore create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/AUTHORS create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/CONTRIBUTORS create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/LICENSE create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/Make.protobuf create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/Makefile create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/README create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/jsonpb/jsonpb.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/jsonpb/jsonpb_test.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/Makefile create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/more_test_objects.proto create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/test_objects.proto create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/Makefile create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/all_test.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/clone.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/clone_test.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/decode.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/encode.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/equal.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/equal_test.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/extensions.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/extensions_test.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/lib.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/message_set.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/message_set_test.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/pointer_reflect.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/pointer_unsafe.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/properties.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/proto3_proto/proto3.proto create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/proto3_test.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/size2_test.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/size_test.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/testdata/Makefile create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/testdata/golden_test.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/testdata/test.proto create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/text.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/text_parser.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/text_parser_test.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/proto/text_test.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/Makefile create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/descriptor/Makefile create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.golden create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/doc.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/generator/Makefile create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/generator/generator.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/generator/name_test.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/internal/grpc/grpc.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/link_grpc.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/main.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/plugin/Makefile create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.pb.golden create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/Makefile create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/extension_base.proto create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/extension_extra.proto create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/extension_test.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/extension_user.proto create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/golden_test.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/grpc.proto create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/imp.pb.go.golden create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/imp.proto create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/imp2.proto create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/imp3.proto create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/main_test.go create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi1.proto create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi2.proto create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi3.proto create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/my_test/test.pb.go.golden create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/my_test/test.proto create mode 100644 Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/proto3.proto create mode 100644 Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/cancelreq.go create mode 100644 Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/cancelreq_go14.go create mode 100644 Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/ctxhttp.go create mode 100644 Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/ctxhttp_test.go create mode 100644 Godeps/_workspace/src/golang.org/x/net/internal/iana/const.go create mode 100644 Godeps/_workspace/src/golang.org/x/net/internal/iana/gen.go create mode 100644 Godeps/_workspace/src/golang.org/x/net/internal/nettest/error_posix.go create mode 100644 Godeps/_workspace/src/golang.org/x/net/internal/nettest/error_stub.go create mode 100644 Godeps/_workspace/src/golang.org/x/net/internal/nettest/interface.go create mode 100644 Godeps/_workspace/src/golang.org/x/net/internal/nettest/rlimit.go create mode 100644 Godeps/_workspace/src/golang.org/x/net/internal/nettest/rlimit_stub.go create mode 100644 Godeps/_workspace/src/golang.org/x/net/internal/nettest/rlimit_unix.go create mode 100644 Godeps/_workspace/src/golang.org/x/net/internal/nettest/rlimit_windows.go create mode 100644 Godeps/_workspace/src/golang.org/x/net/internal/nettest/stack.go create mode 100644 Godeps/_workspace/src/golang.org/x/net/internal/nettest/stack_stub.go create mode 100644 Godeps/_workspace/src/golang.org/x/net/internal/nettest/stack_unix.go create mode 100644 Godeps/_workspace/src/golang.org/x/net/internal/nettest/stack_windows.go create mode 100644 Godeps/_workspace/src/golang.org/x/net/internal/timeseries/timeseries.go create mode 100644 Godeps/_workspace/src/golang.org/x/net/internal/timeseries/timeseries_test.go create mode 100644 Godeps/_workspace/src/golang.org/x/net/trace/events.go create mode 100644 Godeps/_workspace/src/golang.org/x/net/trace/histogram.go create mode 100644 Godeps/_workspace/src/golang.org/x/net/trace/histogram_test.go create mode 100644 Godeps/_workspace/src/golang.org/x/net/trace/trace.go create mode 100644 Godeps/_workspace/src/golang.org/x/net/trace/trace_test.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/.travis.yml create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/AUTHORS create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/CONTRIBUTING.md create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/CONTRIBUTORS create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/LICENSE create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/README.md create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/client_appengine.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/clientcredentials/clientcredentials.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/clientcredentials/clientcredentials_test.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/example_test.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/facebook/facebook.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/github/github.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/google/appengine.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/google/appengine_hook.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/google/default.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/google/example_test.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/google/google.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/google/google_test.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/google/sdk.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/google/sdk_test.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/google/testdata/gcloud/credentials create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/google/testdata/gcloud/properties create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/internal/oauth2.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/internal/oauth2_test.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/internal/token.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/internal/token_test.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/internal/transport.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/jws/jws.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/jwt/example_test.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/jwt/jwt.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/jwt/jwt_test.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/linkedin/linkedin.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/oauth2.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/oauth2_test.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/odnoklassniki/odnoklassniki.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/paypal/paypal.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/token.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/token_test.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/transport.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/transport_test.go create mode 100644 Godeps/_workspace/src/golang.org/x/oauth2/vk/vk.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/.hgignore create mode 100644 Godeps/_workspace/src/google.golang.org/api/.hgtags create mode 100644 Godeps/_workspace/src/google.golang.org/api/.travis.yml create mode 100644 Godeps/_workspace/src/google.golang.org/api/AUTHORS create mode 100644 Godeps/_workspace/src/google.golang.org/api/CONTRIBUTING.md create mode 100644 Godeps/_workspace/src/google.golang.org/api/CONTRIBUTORS create mode 100644 Godeps/_workspace/src/google.golang.org/api/GettingStarted.md create mode 100644 Godeps/_workspace/src/google.golang.org/api/LICENSE create mode 100644 Godeps/_workspace/src/google.golang.org/api/Makefile create mode 100644 Godeps/_workspace/src/google.golang.org/api/NOTES create mode 100644 Godeps/_workspace/src/google.golang.org/api/README.md create mode 100644 Godeps/_workspace/src/google.golang.org/api/TODO create mode 100644 Godeps/_workspace/src/google.golang.org/api/adexchangebuyer/v1.2/adexchangebuyer-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/adexchangebuyer/v1.2/adexchangebuyer-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/adexchangebuyer/v1.3/adexchangebuyer-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/adexchangebuyer/v1.3/adexchangebuyer-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/adexchangebuyer/v1.4/adexchangebuyer-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/adexchangebuyer/v1.4/adexchangebuyer-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/adexchangeseller/v1.1/adexchangeseller-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/adexchangeseller/v1.1/adexchangeseller-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/adexchangeseller/v1/adexchangeseller-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/adexchangeseller/v1/adexchangeseller-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/adexchangeseller/v2.0/adexchangeseller-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/adexchangeseller/v2.0/adexchangeseller-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/admin/datatransfer/v1/admin-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/admin/datatransfer/v1/admin-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/admin/directory/v1/admin-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/admin/directory/v1/admin-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/admin/email_migration/v2/admin-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/admin/email_migration/v2/admin-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/admin/reports/v1/admin-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/admin/reports/v1/admin-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/adsense/v1.2/adsense-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/adsense/v1.2/adsense-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/adsense/v1.3/adsense-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/adsense/v1.3/adsense-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/adsense/v1.4/adsense-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/adsense/v1.4/adsense-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/adsensehost/v4.1/adsensehost-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/adsensehost/v4.1/adsensehost-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/analytics/v2.4/analytics-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/analytics/v2.4/analytics-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/analytics/v3/analytics-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/analytics/v3/analytics-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/androidenterprise/v1/androidenterprise-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/androidenterprise/v1/androidenterprise-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/androidpublisher/v1.1/androidpublisher-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/androidpublisher/v1.1/androidpublisher-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/androidpublisher/v1/androidpublisher-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/androidpublisher/v1/androidpublisher-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/androidpublisher/v2/androidpublisher-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/androidpublisher/v2/androidpublisher-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/api-list.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/appengine/v1beta4/appengine-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/appengine/v1beta4/appengine-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/appsactivity/v1/appsactivity-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/appsactivity/v1/appsactivity-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/appstate/v1/appstate-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/appstate/v1/appstate-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/autoscaler/v1beta2/autoscaler-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/autoscaler/v1beta2/autoscaler-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/bigquery/v2/bigquery-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/bigquery/v2/bigquery-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/blogger/v2/blogger-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/blogger/v2/blogger-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/blogger/v3/blogger-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/blogger/v3/blogger-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/books/v1/books-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/books/v1/books-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/calendar/v3/calendar-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/calendar/v3/calendar-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/civicinfo/v2/civicinfo-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/civicinfo/v2/civicinfo-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/classroom/v1/classroom-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/classroom/v1/classroom-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/cloudbilling/v1/cloudbilling-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/cloudbilling/v1/cloudbilling-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/clouddebugger/v2/clouddebugger-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/clouddebugger/v2/clouddebugger-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/cloudlatencytest/v2/cloudlatencytest-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/cloudlatencytest/v2/cloudlatencytest-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/cloudmonitoring/v2beta2/cloudmonitoring-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/cloudmonitoring/v2beta2/cloudmonitoring-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/cloudresourcemanager/v1beta1/cloudresourcemanager-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/cloudresourcemanager/v1beta1/cloudresourcemanager-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/cloudtrace/v1/cloudtrace-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/cloudtrace/v1/cloudtrace-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/v0.alpha/clouduseraccounts-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/v0.alpha/clouduseraccounts-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/v0.beta/clouduseraccounts-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/v0.beta/clouduseraccounts-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/vm_alpha/clouduseraccounts-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/vm_alpha/clouduseraccounts-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/vm_beta/clouduseraccounts-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/vm_beta/clouduseraccounts-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/compute/v0.beta/compute-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/compute/v0.beta/compute-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/compute/v1/compute-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/compute/v1/compute-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/container/v1/container-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/container/v1/container-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/container/v1beta1/container-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/container/v1beta1/container-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/content/v2/content-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/content/v2/content-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/content/v2sandbox/content-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/content/v2sandbox/content-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/coordinate/v1/coordinate-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/coordinate/v1/coordinate-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/customsearch/v1/customsearch-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/customsearch/v1/customsearch-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/dataflow/v1b3/dataflow-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/dataflow/v1b3/dataflow-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/datastore/v1beta1/datastore-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/datastore/v1beta1/datastore-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/datastore/v1beta2/datastore-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/datastore/v1beta2/datastore-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/deploymentmanager/v2/deploymentmanager-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/deploymentmanager/v2/deploymentmanager-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/deploymentmanager/v2beta1/deploymentmanager-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/deploymentmanager/v2beta1/deploymentmanager-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/deploymentmanager/v2beta2/deploymentmanager-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/deploymentmanager/v2beta2/deploymentmanager-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/dfareporting/v1.1/dfareporting-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/dfareporting/v1.1/dfareporting-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/dfareporting/v1.2/dfareporting-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/dfareporting/v1.2/dfareporting-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/dfareporting/v1.3/dfareporting-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/dfareporting/v1.3/dfareporting-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/dfareporting/v1/dfareporting-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/dfareporting/v1/dfareporting-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/dfareporting/v2.0/dfareporting-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/dfareporting/v2.0/dfareporting-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/dfareporting/v2.1/dfareporting-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/dfareporting/v2.1/dfareporting-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/dfareporting/v2.2/dfareporting-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/dfareporting/v2.2/dfareporting-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/discovery/v1/discovery-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/discovery/v1/discovery-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/dns/v1/dns-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/dns/v1/dns-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/dns/v1beta1/dns-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/dns/v1beta1/dns-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/doubleclickbidmanager/v1/doubleclickbidmanager-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/doubleclickbidmanager/v1/doubleclickbidmanager-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/doubleclicksearch/v2/doubleclicksearch-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/doubleclicksearch/v2/doubleclicksearch-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/drive/v1/drive-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/drive/v1/drive-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/drive/v2/drive-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/drive/v2/drive-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/examples/bigquery.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/examples/books.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/examples/calendar.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/examples/compute.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/examples/debug.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/examples/drive.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/examples/fitness.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/examples/gmail.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/examples/gopher.png create mode 100644 Godeps/_workspace/src/google.golang.org/api/examples/main.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/examples/mapsengine.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/examples/mirror.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/examples/prediction.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/examples/pubsub.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/examples/storage.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/examples/tasks.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/examples/urlshortener.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/examples/youtube.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/fitness/v1/fitness-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/fitness/v1/fitness-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/freebase/v1/freebase-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/freebase/v1/freebase-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/fusiontables/v1/fusiontables-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/fusiontables/v1/fusiontables-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/fusiontables/v2/fusiontables-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/fusiontables/v2/fusiontables-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/games/v1/games-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/games/v1/games-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/gamesconfiguration/v1configuration/gamesconfiguration-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/gamesconfiguration/v1configuration/gamesconfiguration-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/gamesmanagement/v1management/gamesmanagement-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/gamesmanagement/v1management/gamesmanagement-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/gan/v1beta1/gan-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/gan/v1beta1/gan-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/genomics/v1/genomics-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/genomics/v1/genomics-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/genomics/v1beta2/genomics-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/genomics/v1beta2/genomics-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/gmail/v1/gmail-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/gmail/v1/gmail-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/docurls.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/gen_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/storage_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/any.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/any.want create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofarray-1.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofarray-1.want create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofenum.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofenum.want create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofmapofobjects.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofmapofobjects.want create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofmapofstrings.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofmapofstrings.want create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/blogger-3.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/blogger-3.want create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/getwithoutbody.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/getwithoutbody.want create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofany.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofany.want create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofarrayofobjects.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofarrayofobjects.want create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofobjects.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofobjects.want create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofstrings-1.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofstrings-1.want create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/quotednum.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/quotednum.want create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/resource-named-service.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/resource-named-service.want create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/unfortunatedefaults.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/unfortunatedefaults.want create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/variants.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/variants.want create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/wrapnewlines.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/wrapnewlines.want create mode 100644 Godeps/_workspace/src/google.golang.org/api/googleapi/googleapi.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/googleapi/googleapi_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/googleapi/internal/uritemplates/LICENSE create mode 100644 Godeps/_workspace/src/google.golang.org/api/googleapi/internal/uritemplates/uritemplates.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/googleapi/internal/uritemplates/utils.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/googleapi/transport/apikey.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/googleapi/types.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/googleapi/types_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/groupsmigration/v1/groupsmigration-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/groupsmigration/v1/groupsmigration-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/groupssettings/v1/groupssettings-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/groupssettings/v1/groupssettings-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/identitytoolkit/v3/identitytoolkit-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/identitytoolkit/v3/identitytoolkit-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/internal/json.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/internal/json_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/lib/codereview/codereview.cfg create mode 100644 Godeps/_workspace/src/google.golang.org/api/licensing/v1/licensing-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/licensing/v1/licensing-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/logging/v1beta3/logging-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/logging/v1beta3/logging-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/logging/v2beta1/logging-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/logging/v2beta1/logging-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/manager/v1beta2/manager-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/manager/v1beta2/manager-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/mapsengine/exp2/mapsengine-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/mapsengine/exp2/mapsengine-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/mapsengine/v1/mapsengine-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/mapsengine/v1/mapsengine-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/mirror/v1/mirror-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/mirror/v1/mirror-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/oauth2/v1/oauth2-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/oauth2/v1/oauth2-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/oauth2/v2/oauth2-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/oauth2/v2/oauth2-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/pagespeedonline/v1/pagespeedonline-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/pagespeedonline/v1/pagespeedonline-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/pagespeedonline/v2/pagespeedonline-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/pagespeedonline/v2/pagespeedonline-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/partners/v2/partners-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/partners/v2/partners-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/playmoviespartner/v1/playmoviespartner-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/playmoviespartner/v1/playmoviespartner-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/plus/v1/plus-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/plus/v1/plus-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/plusdomains/v1/plusdomains-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/plusdomains/v1/plusdomains-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/prediction/v1.2/prediction-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/prediction/v1.2/prediction-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/prediction/v1.3/prediction-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/prediction/v1.3/prediction-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/prediction/v1.4/prediction-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/prediction/v1.4/prediction-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/proximitybeacon/v1beta1/proximitybeacon-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/proximitybeacon/v1beta1/proximitybeacon-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/pubsub/v1/pubsub-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/pubsub/v1/pubsub-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/pubsub/v1beta1/pubsub-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/pubsub/v1beta1/pubsub-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/pubsub/v1beta1a/pubsub-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/pubsub/v1beta1a/pubsub-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/pubsub/v1beta2/pubsub-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/pubsub/v1beta2/pubsub-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/qpxexpress/v1/qpxexpress-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/qpxexpress/v1/qpxexpress-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/replicapool/v1beta1/replicapool-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/replicapool/v1beta1/replicapool-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/replicapool/v1beta2/replicapool-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/replicapool/v1beta2/replicapool-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/replicapoolupdater/v1beta1/replicapoolupdater-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/replicapoolupdater/v1beta1/replicapoolupdater-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/reseller/v1/reseller-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/reseller/v1/reseller-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/reseller/v1sandbox/reseller-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/reseller/v1sandbox/reseller-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/resourceviews/v1beta1/resourceviews-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/resourceviews/v1beta1/resourceviews-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/resourceviews/v1beta2/resourceviews-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/resourceviews/v1beta2/resourceviews-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/script/v1/script-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/script/v1/script-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/siteverification/v1/siteverification-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/siteverification/v1/siteverification-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/spectrum/v1explorer/spectrum-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/spectrum/v1explorer/spectrum-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/sqladmin/v1beta3/sqladmin-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/sqladmin/v1beta3/sqladmin-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/sqladmin/v1beta4/sqladmin-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/sqladmin/v1beta4/sqladmin-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/storage/v1/storage-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/storage/v1/storage-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/storage/v1beta1/storage-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/storage/v1beta1/storage-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/storage/v1beta2/storage-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/storage/v1beta2/storage-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/storagetransfer/v1/storagetransfer-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/storagetransfer/v1/storagetransfer-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/tagmanager/v1/tagmanager-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/tagmanager/v1/tagmanager-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/taskqueue/v1beta1/taskqueue-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/taskqueue/v1beta1/taskqueue-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/taskqueue/v1beta2/taskqueue-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/taskqueue/v1beta2/taskqueue-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/tasks/v1/tasks-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/tasks/v1/tasks-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/translate/v2/translate-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/translate/v2/translate-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/urlshortener/v1/urlshortener-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/urlshortener/v1/urlshortener-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/webfonts/v1/webfonts-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/webfonts/v1/webfonts-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/webmasters/v3/webmasters-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/webmasters/v3/webmasters-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/youtube/v3/youtube-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/youtube/v3/youtube-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/youtubeanalytics/v1/youtubeanalytics-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/youtubeanalytics/v1/youtubeanalytics-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/youtubeanalytics/v1beta1/youtubeanalytics-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/youtubeanalytics/v1beta1/youtubeanalytics-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/api/youtubereporting/v1/youtubereporting-api.json create mode 100644 Godeps/_workspace/src/google.golang.org/api/youtubereporting/v1/youtubereporting-gen.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/.travis.yml create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/AUTHORS create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/CONTRIBUTING.md create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/CONTRIBUTORS create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/LICENSE create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/README.md create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/bigquery.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/copy_op.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/copy_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/create_table_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/dataset.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/dataset_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/doc.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/error.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/extract_op.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/extract_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/gcs.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/iterator.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/iterator_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/job.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/load_op.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/load_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/query.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/query_op.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/query_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/read_op.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/read_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/schema.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/schema_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/service.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/table.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/utils_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/value.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigquery/value_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/admin.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/admin_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/bigtable.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/bigtable_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/bttest/inmem.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/cmd/cbt/cbt.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/cmd/cbt/cbtdoc.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/cmd/loadtest/loadtest.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/cmd/loadtest/stats.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/doc.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/filter.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/gc.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/internal/cbtrc/cbtrc.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/internal/cluster_data_proto/bigtable_cluster_data.pb.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/internal/cluster_data_proto/bigtable_cluster_data.proto create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/internal/cluster_service_proto/bigtable_cluster_service.pb.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/internal/cluster_service_proto/bigtable_cluster_service.proto create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/internal/cluster_service_proto/bigtable_cluster_service_messages.pb.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/internal/cluster_service_proto/bigtable_cluster_service_messages.proto create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/internal/data_proto/bigtable_data.pb.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/internal/data_proto/bigtable_data.proto create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/internal/duration_proto/duration.pb.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/internal/duration_proto/duration.proto create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/internal/empty/empty.pb.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/internal/empty/empty.proto create mode 100755 Godeps/_workspace/src/google.golang.org/cloud/bigtable/internal/regen.sh create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/internal/service_proto/bigtable_service.pb.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/internal/service_proto/bigtable_service.proto create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/internal/service_proto/bigtable_service_messages.pb.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/internal/service_proto/bigtable_service_messages.proto create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/internal/table_data_proto/bigtable_table_data.pb.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/internal/table_data_proto/bigtable_table_data.proto create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/internal/table_service_proto/bigtable_table_service.pb.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/internal/table_service_proto/bigtable_table_service.proto create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/internal/table_service_proto/bigtable_table_service_messages.pb.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/bigtable/internal/table_service_proto/bigtable_table_service_messages.proto create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/cloud.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/cloud_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/compute/metadata/metadata.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/container/container.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/datastore/datastore.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/datastore/datastore_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/datastore/errors.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/datastore/example_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/datastore/integration_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/datastore/key.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/datastore/key_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/datastore/load.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/datastore/prop.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/datastore/query.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/datastore/query_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/datastore/save.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/datastore/testdata/index.yaml create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/datastore/time.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/datastore/time_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/datastore/transaction.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/examples/bigquery/concat_table/main.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/examples/bigquery/load/main.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/examples/bigquery/query/main.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/examples/bigquery/read/main.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/examples/bigtable/bigtable-hello/README.md create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/examples/bigtable/bigtable-hello/app.yaml create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/examples/bigtable/bigtable-hello/helloworld.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/examples/bigtable/search/search.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/examples/pubsub/cmdline/main.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/examples/storage/appengine/app.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/examples/storage/appengine/app.yaml create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/examples/storage/appenginevm/app.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/examples/storage/appenginevm/app.yaml create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/internal/cloud.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/internal/datastore/datastore_v1.pb.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/internal/datastore/datastore_v1.proto create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/internal/opts/option.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/internal/testutil/context.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/internal/transport/cancelreq.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/internal/transport/cancelreq_legacy.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/internal/transport/dial.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/internal/transport/proto.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/key.json.enc create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/logging/logging.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/logging/logging_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/option.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/pubsub/example_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/pubsub/integration_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/pubsub/pubsub.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/pubsub/pubsub_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/storage/acl.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/storage/example_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/storage/integration_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/storage/storage.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/storage/storage_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/storage/testdata/dummy_pem create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/storage/testdata/dummy_rsa create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/storage/types.go create mode 100644 Godeps/_workspace/src/google.golang.org/cloud/storage/types_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/.travis.yml create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/CONTRIBUTING.md create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/LICENSE create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/Makefile create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/PATENTS create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/README.md create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/benchmark/benchmark.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/benchmark/benchmark_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/benchmark/client/main.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/benchmark/grpc_testing/test.pb.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/benchmark/grpc_testing/test.proto create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/benchmark/server/main.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/benchmark/stats/counter.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/benchmark/stats/histogram.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/benchmark/stats/stats.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/benchmark/stats/timeseries.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/benchmark/stats/tracker.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/benchmark/stats/util.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/call.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/clientconn.go create mode 100755 Godeps/_workspace/src/google.golang.org/grpc/codegen.sh create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/codes/code_string.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/codes/codes.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/credentials/credentials.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/doc.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/examples/route_guide/README.md create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/examples/route_guide/client/client.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/examples/route_guide/proto/route_guide.pb.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/examples/route_guide/proto/route_guide.proto create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/examples/route_guide/server/server.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/examples/route_guide/testdata/route_guide_db.json create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/examples/route_guide/testdata/server1.key create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/grpc-auth-support.md create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/grpclog/glogger/glogger.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/grpclog/logger.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/health/grpc_health/health.pb.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/health/grpc_health/health.proto create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/health/health.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/interop/client/client.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/interop/client/testdata/server1.key create mode 100755 Godeps/_workspace/src/google.golang.org/grpc/interop/grpc_testing/test.pb.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/interop/grpc_testing/test.proto create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/interop/server/server.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/interop/server/testdata/server1.key create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/metadata/metadata.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/metadata/metadata_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/rpc_util.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/rpc_util_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/server.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/stream.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/test/codec_perf/perf.pb.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/test/codec_perf/perf.proto create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/test/end2end_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/test/grpc_testing/test.pb.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/test/grpc_testing/test.proto create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/test/testdata/server1.key create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/trace.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/transport/control.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/transport/http2_client.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/transport/http2_server.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/transport/http_util.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/transport/http_util_test.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/transport/testdata/server1.key create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/transport/transport.go create mode 100644 Godeps/_workspace/src/google.golang.org/grpc/transport/transport_test.go diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/.gitignore b/Godeps/_workspace/src/github.com/bradfitz/http2/.gitignore new file mode 100644 index 000000000..190f12234 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/.gitignore @@ -0,0 +1,2 @@ +*~ +h2i/h2i diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/AUTHORS b/Godeps/_workspace/src/github.com/bradfitz/http2/AUTHORS new file mode 100644 index 000000000..973453e3f --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/AUTHORS @@ -0,0 +1,20 @@ +# This file is like Go's AUTHORS file: it lists Copyright holders. +# The list of humans who have contributd is in the CONTRIBUTORS file. +# +# To contribute to this project, because it will eventually be folded +# back in to Go itself, you need to submit a CLA: +# +# http://golang.org/doc/contribute.html#copyright +# +# Then you get added to CONTRIBUTORS and you or your company get added +# to the AUTHORS file. + +Blake Mizerany github=bmizerany +Daniel Morsing github=DanielMorsing +Gabriel Aszalos github=gbbr +Google, Inc. +Keith Rarick github=kr +Matthew Keenan github=mattkeenan +Matt Layher github=mdlayher +Perry Abbott github=pabbott0 +Tatsuhiro Tsujikawa github=tatsuhiro-t diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/CONTRIBUTORS b/Godeps/_workspace/src/github.com/bradfitz/http2/CONTRIBUTORS new file mode 100644 index 000000000..f0128c18c --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/CONTRIBUTORS @@ -0,0 +1,20 @@ +# This file is like Go's CONTRIBUTORS file: it lists humans. +# The list of copyright holders (which may be companies) are in the AUTHORS file. +# +# To contribute to this project, because it will eventually be folded +# back in to Go itself, you need to submit a CLA: +# +# http://golang.org/doc/contribute.html#copyright +# +# Then you get added to CONTRIBUTORS and you or your company get added +# to the AUTHORS file. + +Blake Mizerany github=bmizerany +Brad Fitzpatrick github=bradfitz +Daniel Morsing github=DanielMorsing +Gabriel Aszalos github=gbbr +Keith Rarick github=kr +Matthew Keenan github=mattkeenan +Matt Layher github=mdlayher +Perry Abbott github=pabbott0 +Tatsuhiro Tsujikawa github=tatsuhiro-t diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/Dockerfile b/Godeps/_workspace/src/github.com/bradfitz/http2/Dockerfile new file mode 100644 index 000000000..b4e14d55a --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/Dockerfile @@ -0,0 +1,44 @@ +# +# This Dockerfile builds a recent curl with HTTP/2 client support, using +# a recent nghttp2 build. +# +# See the Makefile for how to tag it. If Docker and that image is found, the +# Go tests use this curl binary for integration tests. +# + +FROM ubuntu:trusty + +RUN apt-get update && \ + apt-get upgrade -y && \ + apt-get install -y git-core build-essential wget + +RUN apt-get install -y --no-install-recommends \ + autotools-dev libtool pkg-config zlib1g-dev \ + libcunit1-dev libssl-dev libxml2-dev libevent-dev \ + automake autoconf + +# Note: setting NGHTTP2_VER before the git clone, so an old git clone isn't cached: +ENV NGHTTP2_VER af24f8394e43f4 +RUN cd /root && git clone https://github.com/tatsuhiro-t/nghttp2.git + +WORKDIR /root/nghttp2 +RUN git reset --hard $NGHTTP2_VER +RUN autoreconf -i +RUN automake +RUN autoconf +RUN ./configure +RUN make +RUN make install + +WORKDIR /root +RUN wget http://curl.haxx.se/download/curl-7.40.0.tar.gz +RUN tar -zxvf curl-7.40.0.tar.gz +WORKDIR /root/curl-7.40.0 +RUN ./configure --with-ssl --with-nghttp2=/usr/local +RUN make +RUN make install +RUN ldconfig + +CMD ["-h"] +ENTRYPOINT ["/usr/local/bin/curl"] + diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/HACKING b/Godeps/_workspace/src/github.com/bradfitz/http2/HACKING new file mode 100644 index 000000000..69aafe4d1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/HACKING @@ -0,0 +1,5 @@ +We only accept contributions from users who have gone through Go's +contribution process (signed a CLA). + +Please acknowledge whether you have (and use the same email) if +sending a pull request. diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/LICENSE b/Godeps/_workspace/src/github.com/bradfitz/http2/LICENSE new file mode 100644 index 000000000..2dc6853ca --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/LICENSE @@ -0,0 +1,7 @@ +Copyright 2014 Google & the Go AUTHORS + +Go AUTHORS are: +See https://code.google.com/p/go/source/browse/AUTHORS + +Licensed under the terms of Go itself: +https://code.google.com/p/go/source/browse/LICENSE diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/Makefile b/Godeps/_workspace/src/github.com/bradfitz/http2/Makefile new file mode 100644 index 000000000..55fd826f7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/Makefile @@ -0,0 +1,3 @@ +curlimage: + docker build -t gohttp2/curl . + diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/README b/Godeps/_workspace/src/github.com/bradfitz/http2/README new file mode 100644 index 000000000..16cb516a6 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/README @@ -0,0 +1,17 @@ +This is a work-in-progress HTTP/2 implementation for Go. + +It will eventually live in the Go standard library and won't require +any changes to your code to use. It will just be automatic. + +Status: + +* The server support is pretty good. A few things are missing + but are being worked on. +* The client work has just started but shares a lot of code + is coming along much quicker. + +Docs are at https://godoc.org/github.com/bradfitz/http2 + +Demo test server at https://http2.golang.org/ + +Help & bug reports welcome. diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/buffer.go b/Godeps/_workspace/src/github.com/bradfitz/http2/buffer.go new file mode 100644 index 000000000..c43954cf0 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/buffer.go @@ -0,0 +1,76 @@ +// Copyright 2014 The Go Authors. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +package http2 + +import ( + "errors" +) + +// buffer is an io.ReadWriteCloser backed by a fixed size buffer. +// It never allocates, but moves old data as new data is written. +type buffer struct { + buf []byte + r, w int + closed bool + err error // err to return to reader +} + +var ( + errReadEmpty = errors.New("read from empty buffer") + errWriteClosed = errors.New("write on closed buffer") + errWriteFull = errors.New("write on full buffer") +) + +// Read copies bytes from the buffer into p. +// It is an error to read when no data is available. +func (b *buffer) Read(p []byte) (n int, err error) { + n = copy(p, b.buf[b.r:b.w]) + b.r += n + if b.closed && b.r == b.w { + err = b.err + } else if b.r == b.w && n == 0 { + err = errReadEmpty + } + return n, err +} + +// Len returns the number of bytes of the unread portion of the buffer. +func (b *buffer) Len() int { + return b.w - b.r +} + +// Write copies bytes from p into the buffer. +// It is an error to write more data than the buffer can hold. +func (b *buffer) Write(p []byte) (n int, err error) { + if b.closed { + return 0, errWriteClosed + } + + // Slide existing data to beginning. + if b.r > 0 && len(p) > len(b.buf)-b.w { + copy(b.buf, b.buf[b.r:b.w]) + b.w -= b.r + b.r = 0 + } + + // Write new data. + n = copy(b.buf[b.w:], p) + b.w += n + if n < len(p) { + err = errWriteFull + } + return n, err +} + +// Close marks the buffer as closed. Future calls to Write will +// return an error. Future calls to Read, once the buffer is +// empty, will return err. +func (b *buffer) Close(err error) { + if !b.closed { + b.closed = true + b.err = err + } +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/buffer_test.go b/Godeps/_workspace/src/github.com/bradfitz/http2/buffer_test.go new file mode 100644 index 000000000..ea76905b8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/buffer_test.go @@ -0,0 +1,154 @@ +// Copyright 2014 The Go Authors. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +package http2 + +import ( + "io" + "reflect" + "testing" +) + +var bufferReadTests = []struct { + buf buffer + read, wn int + werr error + wp []byte + wbuf buffer +}{ + { + buffer{[]byte{'a', 0}, 0, 1, false, nil}, + 5, 1, nil, []byte{'a'}, + buffer{[]byte{'a', 0}, 1, 1, false, nil}, + }, + { + buffer{[]byte{'a', 0}, 0, 1, true, io.EOF}, + 5, 1, io.EOF, []byte{'a'}, + buffer{[]byte{'a', 0}, 1, 1, true, io.EOF}, + }, + { + buffer{[]byte{0, 'a'}, 1, 2, false, nil}, + 5, 1, nil, []byte{'a'}, + buffer{[]byte{0, 'a'}, 2, 2, false, nil}, + }, + { + buffer{[]byte{0, 'a'}, 1, 2, true, io.EOF}, + 5, 1, io.EOF, []byte{'a'}, + buffer{[]byte{0, 'a'}, 2, 2, true, io.EOF}, + }, + { + buffer{[]byte{}, 0, 0, false, nil}, + 5, 0, errReadEmpty, []byte{}, + buffer{[]byte{}, 0, 0, false, nil}, + }, + { + buffer{[]byte{}, 0, 0, true, io.EOF}, + 5, 0, io.EOF, []byte{}, + buffer{[]byte{}, 0, 0, true, io.EOF}, + }, +} + +func TestBufferRead(t *testing.T) { + for i, tt := range bufferReadTests { + read := make([]byte, tt.read) + n, err := tt.buf.Read(read) + if n != tt.wn { + t.Errorf("#%d: wn = %d want %d", i, n, tt.wn) + continue + } + if err != tt.werr { + t.Errorf("#%d: werr = %v want %v", i, err, tt.werr) + continue + } + read = read[:n] + if !reflect.DeepEqual(read, tt.wp) { + t.Errorf("#%d: read = %+v want %+v", i, read, tt.wp) + } + if !reflect.DeepEqual(tt.buf, tt.wbuf) { + t.Errorf("#%d: buf = %+v want %+v", i, tt.buf, tt.wbuf) + } + } +} + +var bufferWriteTests = []struct { + buf buffer + write, wn int + werr error + wbuf buffer +}{ + { + buf: buffer{ + buf: []byte{}, + }, + wbuf: buffer{ + buf: []byte{}, + }, + }, + { + buf: buffer{ + buf: []byte{1, 'a'}, + }, + write: 1, + wn: 1, + wbuf: buffer{ + buf: []byte{0, 'a'}, + w: 1, + }, + }, + { + buf: buffer{ + buf: []byte{'a', 1}, + r: 1, + w: 1, + }, + write: 2, + wn: 2, + wbuf: buffer{ + buf: []byte{0, 0}, + w: 2, + }, + }, + { + buf: buffer{ + buf: []byte{}, + r: 1, + closed: true, + }, + write: 5, + werr: errWriteClosed, + wbuf: buffer{ + buf: []byte{}, + r: 1, + closed: true, + }, + }, + { + buf: buffer{ + buf: []byte{}, + }, + write: 5, + werr: errWriteFull, + wbuf: buffer{ + buf: []byte{}, + }, + }, +} + +func TestBufferWrite(t *testing.T) { + for i, tt := range bufferWriteTests { + n, err := tt.buf.Write(make([]byte, tt.write)) + if n != tt.wn { + t.Errorf("#%d: wrote %d bytes; want %d", i, n, tt.wn) + continue + } + if err != tt.werr { + t.Errorf("#%d: error = %v; want %v", i, err, tt.werr) + continue + } + if !reflect.DeepEqual(tt.buf, tt.wbuf) { + t.Errorf("#%d: buf = %+v; want %+v", i, tt.buf, tt.wbuf) + } + } +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/errors.go b/Godeps/_workspace/src/github.com/bradfitz/http2/errors.go new file mode 100644 index 000000000..c885328a8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/errors.go @@ -0,0 +1,78 @@ +// Copyright 2014 The Go Authors. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +package http2 + +import "fmt" + +// An ErrCode is an unsigned 32-bit error code as defined in the HTTP/2 spec. +type ErrCode uint32 + +const ( + ErrCodeNo ErrCode = 0x0 + ErrCodeProtocol ErrCode = 0x1 + ErrCodeInternal ErrCode = 0x2 + ErrCodeFlowControl ErrCode = 0x3 + ErrCodeSettingsTimeout ErrCode = 0x4 + ErrCodeStreamClosed ErrCode = 0x5 + ErrCodeFrameSize ErrCode = 0x6 + ErrCodeRefusedStream ErrCode = 0x7 + ErrCodeCancel ErrCode = 0x8 + ErrCodeCompression ErrCode = 0x9 + ErrCodeConnect ErrCode = 0xa + ErrCodeEnhanceYourCalm ErrCode = 0xb + ErrCodeInadequateSecurity ErrCode = 0xc + ErrCodeHTTP11Required ErrCode = 0xd +) + +var errCodeName = map[ErrCode]string{ + ErrCodeNo: "NO_ERROR", + ErrCodeProtocol: "PROTOCOL_ERROR", + ErrCodeInternal: "INTERNAL_ERROR", + ErrCodeFlowControl: "FLOW_CONTROL_ERROR", + ErrCodeSettingsTimeout: "SETTINGS_TIMEOUT", + ErrCodeStreamClosed: "STREAM_CLOSED", + ErrCodeFrameSize: "FRAME_SIZE_ERROR", + ErrCodeRefusedStream: "REFUSED_STREAM", + ErrCodeCancel: "CANCEL", + ErrCodeCompression: "COMPRESSION_ERROR", + ErrCodeConnect: "CONNECT_ERROR", + ErrCodeEnhanceYourCalm: "ENHANCE_YOUR_CALM", + ErrCodeInadequateSecurity: "INADEQUATE_SECURITY", + ErrCodeHTTP11Required: "HTTP_1_1_REQUIRED", +} + +func (e ErrCode) String() string { + if s, ok := errCodeName[e]; ok { + return s + } + return fmt.Sprintf("unknown error code 0x%x", uint32(e)) +} + +// ConnectionError is an error that results in the termination of the +// entire connection. +type ConnectionError ErrCode + +func (e ConnectionError) Error() string { return fmt.Sprintf("connection error: %s", ErrCode(e)) } + +// StreamError is an error that only affects one stream within an +// HTTP/2 connection. +type StreamError struct { + StreamID uint32 + Code ErrCode +} + +func (e StreamError) Error() string { + return fmt.Sprintf("stream error: stream ID %d; %v", e.StreamID, e.Code) +} + +// 6.9.1 The Flow Control Window +// "If a sender receives a WINDOW_UPDATE that causes a flow control +// window to exceed this maximum it MUST terminate either the stream +// or the connection, as appropriate. For streams, [...]; for the +// connection, a GOAWAY frame with a FLOW_CONTROL_ERROR code." +type goAwayFlowError struct{} + +func (goAwayFlowError) Error() string { return "connection exceeded flow control window size" } diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/errors_test.go b/Godeps/_workspace/src/github.com/bradfitz/http2/errors_test.go new file mode 100644 index 000000000..86d52ee65 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/errors_test.go @@ -0,0 +1,27 @@ +// 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. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +package http2 + +import "testing" + +func TestErrCodeString(t *testing.T) { + tests := []struct { + err ErrCode + want string + }{ + {ErrCodeProtocol, "PROTOCOL_ERROR"}, + {0xd, "HTTP_1_1_REQUIRED"}, + {0xf, "unknown error code 0xf"}, + } + for i, tt := range tests { + got := tt.err.String() + if got != tt.want { + t.Errorf("%d. Error = %q; want %q", i, got, tt.want) + } + } +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/flow.go b/Godeps/_workspace/src/github.com/bradfitz/http2/flow.go new file mode 100644 index 000000000..540fc4283 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/flow.go @@ -0,0 +1,51 @@ +// Copyright 2014 The Go Authors. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +// Flow control + +package http2 + +// flow is the flow control window's size. +type flow struct { + // n is the number of DATA bytes we're allowed to send. + // A flow is kept both on a conn and a per-stream. + n int32 + + // conn points to the shared connection-level flow that is + // shared by all streams on that conn. It is nil for the flow + // that's on the conn directly. + conn *flow +} + +func (f *flow) setConnFlow(cf *flow) { f.conn = cf } + +func (f *flow) available() int32 { + n := f.n + if f.conn != nil && f.conn.n < n { + n = f.conn.n + } + return n +} + +func (f *flow) take(n int32) { + if n > f.available() { + panic("internal error: took too much") + } + f.n -= n + if f.conn != nil { + f.conn.n -= n + } +} + +// add adds n bytes (positive or negative) to the flow control window. +// It returns false if the sum would exceed 2^31-1. +func (f *flow) add(n int32) bool { + remain := (1<<31 - 1) - f.n + if n > remain { + return false + } + f.n += n + return true +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/flow_test.go b/Godeps/_workspace/src/github.com/bradfitz/http2/flow_test.go new file mode 100644 index 000000000..dbb656f8e --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/flow_test.go @@ -0,0 +1,54 @@ +// Copyright 2014 The Go Authors. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +package http2 + +import "testing" + +func TestFlow(t *testing.T) { + var st flow + var conn flow + st.add(3) + conn.add(2) + + if got, want := st.available(), int32(3); got != want { + t.Errorf("available = %d; want %d", got, want) + } + st.setConnFlow(&conn) + if got, want := st.available(), int32(2); got != want { + t.Errorf("after parent setup, available = %d; want %d", got, want) + } + + st.take(2) + if got, want := conn.available(), int32(0); got != want { + t.Errorf("after taking 2, conn = %d; want %d", got, want) + } + if got, want := st.available(), int32(0); got != want { + t.Errorf("after taking 2, stream = %d; want %d", got, want) + } +} + +func TestFlowAdd(t *testing.T) { + var f flow + if !f.add(1) { + t.Fatal("failed to add 1") + } + if !f.add(-1) { + t.Fatal("failed to add -1") + } + if got, want := f.available(), int32(0); got != want { + t.Fatalf("size = %d; want %d", got, want) + } + if !f.add(1<<31 - 1) { + t.Fatal("failed to add 2^31-1") + } + if got, want := f.available(), int32(1<<31-1); got != want { + t.Fatalf("size = %d; want %d", got, want) + } + if f.add(1) { + t.Fatal("adding 1 to max shouldn't be allowed") + } + +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/frame.go b/Godeps/_workspace/src/github.com/bradfitz/http2/frame.go new file mode 100644 index 000000000..e8b872a19 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/frame.go @@ -0,0 +1,1113 @@ +// Copyright 2014 The Go Authors. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +package http2 + +import ( + "bytes" + "encoding/binary" + "errors" + "fmt" + "io" + "sync" +) + +const frameHeaderLen = 9 + +var padZeros = make([]byte, 255) // zeros for padding + +// A FrameType is a registered frame type as defined in +// http://http2.github.io/http2-spec/#rfc.section.11.2 +type FrameType uint8 + +const ( + FrameData FrameType = 0x0 + FrameHeaders FrameType = 0x1 + FramePriority FrameType = 0x2 + FrameRSTStream FrameType = 0x3 + FrameSettings FrameType = 0x4 + FramePushPromise FrameType = 0x5 + FramePing FrameType = 0x6 + FrameGoAway FrameType = 0x7 + FrameWindowUpdate FrameType = 0x8 + FrameContinuation FrameType = 0x9 +) + +var frameName = map[FrameType]string{ + FrameData: "DATA", + FrameHeaders: "HEADERS", + FramePriority: "PRIORITY", + FrameRSTStream: "RST_STREAM", + FrameSettings: "SETTINGS", + FramePushPromise: "PUSH_PROMISE", + FramePing: "PING", + FrameGoAway: "GOAWAY", + FrameWindowUpdate: "WINDOW_UPDATE", + FrameContinuation: "CONTINUATION", +} + +func (t FrameType) String() string { + if s, ok := frameName[t]; ok { + return s + } + return fmt.Sprintf("UNKNOWN_FRAME_TYPE_%d", uint8(t)) +} + +// Flags is a bitmask of HTTP/2 flags. +// The meaning of flags varies depending on the frame type. +type Flags uint8 + +// Has reports whether f contains all (0 or more) flags in v. +func (f Flags) Has(v Flags) bool { + return (f & v) == v +} + +// Frame-specific FrameHeader flag bits. +const ( + // Data Frame + FlagDataEndStream Flags = 0x1 + FlagDataPadded Flags = 0x8 + + // Headers Frame + FlagHeadersEndStream Flags = 0x1 + FlagHeadersEndHeaders Flags = 0x4 + FlagHeadersPadded Flags = 0x8 + FlagHeadersPriority Flags = 0x20 + + // Settings Frame + FlagSettingsAck Flags = 0x1 + + // Ping Frame + FlagPingAck Flags = 0x1 + + // Continuation Frame + FlagContinuationEndHeaders Flags = 0x4 + + FlagPushPromiseEndHeaders Flags = 0x4 + FlagPushPromisePadded Flags = 0x8 +) + +var flagName = map[FrameType]map[Flags]string{ + FrameData: { + FlagDataEndStream: "END_STREAM", + FlagDataPadded: "PADDED", + }, + FrameHeaders: { + FlagHeadersEndStream: "END_STREAM", + FlagHeadersEndHeaders: "END_HEADERS", + FlagHeadersPadded: "PADDED", + FlagHeadersPriority: "PRIORITY", + }, + FrameSettings: { + FlagSettingsAck: "ACK", + }, + FramePing: { + FlagPingAck: "ACK", + }, + FrameContinuation: { + FlagContinuationEndHeaders: "END_HEADERS", + }, + FramePushPromise: { + FlagPushPromiseEndHeaders: "END_HEADERS", + FlagPushPromisePadded: "PADDED", + }, +} + +// a frameParser parses a frame given its FrameHeader and payload +// bytes. The length of payload will always equal fh.Length (which +// might be 0). +type frameParser func(fh FrameHeader, payload []byte) (Frame, error) + +var frameParsers = map[FrameType]frameParser{ + FrameData: parseDataFrame, + FrameHeaders: parseHeadersFrame, + FramePriority: parsePriorityFrame, + FrameRSTStream: parseRSTStreamFrame, + FrameSettings: parseSettingsFrame, + FramePushPromise: parsePushPromise, + FramePing: parsePingFrame, + FrameGoAway: parseGoAwayFrame, + FrameWindowUpdate: parseWindowUpdateFrame, + FrameContinuation: parseContinuationFrame, +} + +func typeFrameParser(t FrameType) frameParser { + if f := frameParsers[t]; f != nil { + return f + } + return parseUnknownFrame +} + +// A FrameHeader is the 9 byte header of all HTTP/2 frames. +// +// See http://http2.github.io/http2-spec/#FrameHeader +type FrameHeader struct { + valid bool // caller can access []byte fields in the Frame + + // Type is the 1 byte frame type. There are ten standard frame + // types, but extension frame types may be written by WriteRawFrame + // and will be returned by ReadFrame (as UnknownFrame). + Type FrameType + + // Flags are the 1 byte of 8 potential bit flags per frame. + // They are specific to the frame type. + Flags Flags + + // Length is the length of the frame, not including the 9 byte header. + // The maximum size is one byte less than 16MB (uint24), but only + // frames up to 16KB are allowed without peer agreement. + Length uint32 + + // StreamID is which stream this frame is for. Certain frames + // are not stream-specific, in which case this field is 0. + StreamID uint32 +} + +// Header returns h. It exists so FrameHeaders can be embedded in other +// specific frame types and implement the Frame interface. +func (h FrameHeader) Header() FrameHeader { return h } + +func (h FrameHeader) String() string { + var buf bytes.Buffer + buf.WriteString("[FrameHeader ") + buf.WriteString(h.Type.String()) + if h.Flags != 0 { + buf.WriteString(" flags=") + set := 0 + for i := uint8(0); i < 8; i++ { + if h.Flags&(1< 1 { + buf.WriteByte('|') + } + name := flagName[h.Type][Flags(1<>24), + byte(streamID>>16), + byte(streamID>>8), + byte(streamID)) +} + +func (f *Framer) endWrite() error { + // Now that we know the final size, fill in the FrameHeader in + // the space previously reserved for it. Abuse append. + length := len(f.wbuf) - frameHeaderLen + if length >= (1 << 24) { + return ErrFrameTooLarge + } + _ = append(f.wbuf[:0], + byte(length>>16), + byte(length>>8), + byte(length)) + n, err := f.w.Write(f.wbuf) + if err == nil && n != len(f.wbuf) { + err = io.ErrShortWrite + } + return err +} + +func (f *Framer) writeByte(v byte) { f.wbuf = append(f.wbuf, v) } +func (f *Framer) writeBytes(v []byte) { f.wbuf = append(f.wbuf, v...) } +func (f *Framer) writeUint16(v uint16) { f.wbuf = append(f.wbuf, byte(v>>8), byte(v)) } +func (f *Framer) writeUint32(v uint32) { + f.wbuf = append(f.wbuf, byte(v>>24), byte(v>>16), byte(v>>8), byte(v)) +} + +const ( + minMaxFrameSize = 1 << 14 + maxFrameSize = 1<<24 - 1 +) + +// NewFramer returns a Framer that writes frames to w and reads them from r. +func NewFramer(w io.Writer, r io.Reader) *Framer { + fr := &Framer{ + w: w, + r: r, + } + fr.getReadBuf = func(size uint32) []byte { + if cap(fr.readBuf) >= int(size) { + return fr.readBuf[:size] + } + fr.readBuf = make([]byte, size) + return fr.readBuf + } + fr.SetMaxReadFrameSize(maxFrameSize) + return fr +} + +// SetMaxReadFrameSize sets the maximum size of a frame +// that will be read by a subsequent call to ReadFrame. +// It is the caller's responsibility to advertise this +// limit with a SETTINGS frame. +func (fr *Framer) SetMaxReadFrameSize(v uint32) { + if v > maxFrameSize { + v = maxFrameSize + } + fr.maxReadSize = v +} + +// ErrFrameTooLarge is returned from Framer.ReadFrame when the peer +// sends a frame that is larger than declared with SetMaxReadFrameSize. +var ErrFrameTooLarge = errors.New("http2: frame too large") + +// ReadFrame reads a single frame. The returned Frame is only valid +// until the next call to ReadFrame. +// If the frame is larger than previously set with SetMaxReadFrameSize, +// the returned error is ErrFrameTooLarge. +func (fr *Framer) ReadFrame() (Frame, error) { + if fr.lastFrame != nil { + fr.lastFrame.invalidate() + } + fh, err := readFrameHeader(fr.headerBuf[:], fr.r) + if err != nil { + return nil, err + } + if fh.Length > fr.maxReadSize { + return nil, ErrFrameTooLarge + } + payload := fr.getReadBuf(fh.Length) + if _, err := io.ReadFull(fr.r, payload); err != nil { + return nil, err + } + f, err := typeFrameParser(fh.Type)(fh, payload) + if err != nil { + return nil, err + } + fr.lastFrame = f + return f, nil +} + +// A DataFrame conveys arbitrary, variable-length sequences of octets +// associated with a stream. +// See http://http2.github.io/http2-spec/#rfc.section.6.1 +type DataFrame struct { + FrameHeader + data []byte +} + +func (f *DataFrame) StreamEnded() bool { + return f.FrameHeader.Flags.Has(FlagDataEndStream) +} + +// Data returns the frame's data octets, not including any padding +// size byte or padding suffix bytes. +// The caller must not retain the returned memory past the next +// call to ReadFrame. +func (f *DataFrame) Data() []byte { + f.checkValid() + return f.data +} + +func parseDataFrame(fh FrameHeader, payload []byte) (Frame, error) { + if fh.StreamID == 0 { + // DATA frames MUST be associated with a stream. If a + // DATA frame is received whose stream identifier + // field is 0x0, the recipient MUST respond with a + // connection error (Section 5.4.1) of type + // PROTOCOL_ERROR. + return nil, ConnectionError(ErrCodeProtocol) + } + f := &DataFrame{ + FrameHeader: fh, + } + var padSize byte + if fh.Flags.Has(FlagDataPadded) { + var err error + payload, padSize, err = readByte(payload) + if err != nil { + return nil, err + } + } + if int(padSize) > len(payload) { + // If the length of the padding is greater than the + // length of the frame payload, the recipient MUST + // treat this as a connection error. + // Filed: https://github.com/http2/http2-spec/issues/610 + return nil, ConnectionError(ErrCodeProtocol) + } + f.data = payload[:len(payload)-int(padSize)] + return f, nil +} + +var errStreamID = errors.New("invalid streamid") + +func validStreamID(streamID uint32) bool { + return streamID != 0 && streamID&(1<<31) == 0 +} + +// WriteData writes a DATA frame. +// +// It will perform exactly one Write to the underlying Writer. +// It is the caller's responsibility to not call other Write methods concurrently. +func (f *Framer) WriteData(streamID uint32, endStream bool, data []byte) error { + // TODO: ignoring padding for now. will add when somebody cares. + if !validStreamID(streamID) && !f.AllowIllegalWrites { + return errStreamID + } + var flags Flags + if endStream { + flags |= FlagDataEndStream + } + f.startWrite(FrameData, flags, streamID) + f.wbuf = append(f.wbuf, data...) + return f.endWrite() +} + +// A SettingsFrame conveys configuration parameters that affect how +// endpoints communicate, such as preferences and constraints on peer +// behavior. +// +// See http://http2.github.io/http2-spec/#SETTINGS +type SettingsFrame struct { + FrameHeader + p []byte +} + +func parseSettingsFrame(fh FrameHeader, p []byte) (Frame, error) { + if fh.Flags.Has(FlagSettingsAck) && fh.Length > 0 { + // When this (ACK 0x1) bit is set, the payload of the + // SETTINGS frame MUST be empty. Receipt of a + // SETTINGS frame with the ACK flag set and a length + // field value other than 0 MUST be treated as a + // connection error (Section 5.4.1) of type + // FRAME_SIZE_ERROR. + return nil, ConnectionError(ErrCodeFrameSize) + } + if fh.StreamID != 0 { + // SETTINGS frames always apply to a connection, + // never a single stream. The stream identifier for a + // SETTINGS frame MUST be zero (0x0). If an endpoint + // receives a SETTINGS frame whose stream identifier + // field is anything other than 0x0, the endpoint MUST + // respond with a connection error (Section 5.4.1) of + // type PROTOCOL_ERROR. + return nil, ConnectionError(ErrCodeProtocol) + } + if len(p)%6 != 0 { + // Expecting even number of 6 byte settings. + return nil, ConnectionError(ErrCodeFrameSize) + } + f := &SettingsFrame{FrameHeader: fh, p: p} + if v, ok := f.Value(SettingInitialWindowSize); ok && v > (1<<31)-1 { + // Values above the maximum flow control window size of 2^31 - 1 MUST + // be treated as a connection error (Section 5.4.1) of type + // FLOW_CONTROL_ERROR. + return nil, ConnectionError(ErrCodeFlowControl) + } + return f, nil +} + +func (f *SettingsFrame) IsAck() bool { + return f.FrameHeader.Flags.Has(FlagSettingsAck) +} + +func (f *SettingsFrame) Value(s SettingID) (v uint32, ok bool) { + f.checkValid() + buf := f.p + for len(buf) > 0 { + settingID := SettingID(binary.BigEndian.Uint16(buf[:2])) + if settingID == s { + return binary.BigEndian.Uint32(buf[2:6]), true + } + buf = buf[6:] + } + return 0, false +} + +// ForeachSetting runs fn for each setting. +// It stops and returns the first error. +func (f *SettingsFrame) ForeachSetting(fn func(Setting) error) error { + f.checkValid() + buf := f.p + for len(buf) > 0 { + if err := fn(Setting{ + SettingID(binary.BigEndian.Uint16(buf[:2])), + binary.BigEndian.Uint32(buf[2:6]), + }); err != nil { + return err + } + buf = buf[6:] + } + return nil +} + +// WriteSettings writes a SETTINGS frame with zero or more settings +// specified and the ACK bit not set. +// +// It will perform exactly one Write to the underlying Writer. +// It is the caller's responsibility to not call other Write methods concurrently. +func (f *Framer) WriteSettings(settings ...Setting) error { + f.startWrite(FrameSettings, 0, 0) + for _, s := range settings { + f.writeUint16(uint16(s.ID)) + f.writeUint32(s.Val) + } + return f.endWrite() +} + +// WriteSettings writes an empty SETTINGS frame with the ACK bit set. +// +// It will perform exactly one Write to the underlying Writer. +// It is the caller's responsibility to not call other Write methods concurrently. +func (f *Framer) WriteSettingsAck() error { + f.startWrite(FrameSettings, FlagSettingsAck, 0) + return f.endWrite() +} + +// A PingFrame is a mechanism for measuring a minimal round trip time +// from the sender, as well as determining whether an idle connection +// is still functional. +// See http://http2.github.io/http2-spec/#rfc.section.6.7 +type PingFrame struct { + FrameHeader + Data [8]byte +} + +func parsePingFrame(fh FrameHeader, payload []byte) (Frame, error) { + if len(payload) != 8 { + return nil, ConnectionError(ErrCodeFrameSize) + } + if fh.StreamID != 0 { + return nil, ConnectionError(ErrCodeProtocol) + } + f := &PingFrame{FrameHeader: fh} + copy(f.Data[:], payload) + return f, nil +} + +func (f *Framer) WritePing(ack bool, data [8]byte) error { + var flags Flags + if ack { + flags = FlagPingAck + } + f.startWrite(FramePing, flags, 0) + f.writeBytes(data[:]) + return f.endWrite() +} + +// A GoAwayFrame informs the remote peer to stop creating streams on this connection. +// See http://http2.github.io/http2-spec/#rfc.section.6.8 +type GoAwayFrame struct { + FrameHeader + LastStreamID uint32 + ErrCode ErrCode + debugData []byte +} + +// DebugData returns any debug data in the GOAWAY frame. Its contents +// are not defined. +// The caller must not retain the returned memory past the next +// call to ReadFrame. +func (f *GoAwayFrame) DebugData() []byte { + f.checkValid() + return f.debugData +} + +func parseGoAwayFrame(fh FrameHeader, p []byte) (Frame, error) { + if fh.StreamID != 0 { + return nil, ConnectionError(ErrCodeProtocol) + } + if len(p) < 8 { + return nil, ConnectionError(ErrCodeFrameSize) + } + return &GoAwayFrame{ + FrameHeader: fh, + LastStreamID: binary.BigEndian.Uint32(p[:4]) & (1<<31 - 1), + ErrCode: ErrCode(binary.BigEndian.Uint32(p[4:8])), + debugData: p[8:], + }, nil +} + +func (f *Framer) WriteGoAway(maxStreamID uint32, code ErrCode, debugData []byte) error { + f.startWrite(FrameGoAway, 0, 0) + f.writeUint32(maxStreamID & (1<<31 - 1)) + f.writeUint32(uint32(code)) + f.writeBytes(debugData) + return f.endWrite() +} + +// An UnknownFrame is the frame type returned when the frame type is unknown +// or no specific frame type parser exists. +type UnknownFrame struct { + FrameHeader + p []byte +} + +// Payload returns the frame's payload (after the header). It is not +// valid to call this method after a subsequent call to +// Framer.ReadFrame, nor is it valid to retain the returned slice. +// The memory is owned by the Framer and is invalidated when the next +// frame is read. +func (f *UnknownFrame) Payload() []byte { + f.checkValid() + return f.p +} + +func parseUnknownFrame(fh FrameHeader, p []byte) (Frame, error) { + return &UnknownFrame{fh, p}, nil +} + +// A WindowUpdateFrame is used to implement flow control. +// See http://http2.github.io/http2-spec/#rfc.section.6.9 +type WindowUpdateFrame struct { + FrameHeader + Increment uint32 +} + +func parseWindowUpdateFrame(fh FrameHeader, p []byte) (Frame, error) { + if len(p) != 4 { + return nil, ConnectionError(ErrCodeFrameSize) + } + inc := binary.BigEndian.Uint32(p[:4]) & 0x7fffffff // mask off high reserved bit + if inc == 0 { + // A receiver MUST treat the receipt of a + // WINDOW_UPDATE frame with an flow control window + // increment of 0 as a stream error (Section 5.4.2) of + // type PROTOCOL_ERROR; errors on the connection flow + // control window MUST be treated as a connection + // error (Section 5.4.1). + if fh.StreamID == 0 { + return nil, ConnectionError(ErrCodeProtocol) + } + return nil, StreamError{fh.StreamID, ErrCodeProtocol} + } + return &WindowUpdateFrame{ + FrameHeader: fh, + Increment: inc, + }, nil +} + +// WriteWindowUpdate writes a WINDOW_UPDATE frame. +// The increment value must be between 1 and 2,147,483,647, inclusive. +// If the Stream ID is zero, the window update applies to the +// connection as a whole. +func (f *Framer) WriteWindowUpdate(streamID, incr uint32) error { + // "The legal range for the increment to the flow control window is 1 to 2^31-1 (2,147,483,647) octets." + if (incr < 1 || incr > 2147483647) && !f.AllowIllegalWrites { + return errors.New("illegal window increment value") + } + f.startWrite(FrameWindowUpdate, 0, streamID) + f.writeUint32(incr) + return f.endWrite() +} + +// A HeadersFrame is used to open a stream and additionally carries a +// header block fragment. +type HeadersFrame struct { + FrameHeader + + // Priority is set if FlagHeadersPriority is set in the FrameHeader. + Priority PriorityParam + + headerFragBuf []byte // not owned +} + +func (f *HeadersFrame) HeaderBlockFragment() []byte { + f.checkValid() + return f.headerFragBuf +} + +func (f *HeadersFrame) HeadersEnded() bool { + return f.FrameHeader.Flags.Has(FlagHeadersEndHeaders) +} + +func (f *HeadersFrame) StreamEnded() bool { + return f.FrameHeader.Flags.Has(FlagHeadersEndStream) +} + +func (f *HeadersFrame) HasPriority() bool { + return f.FrameHeader.Flags.Has(FlagHeadersPriority) +} + +func parseHeadersFrame(fh FrameHeader, p []byte) (_ Frame, err error) { + hf := &HeadersFrame{ + FrameHeader: fh, + } + if fh.StreamID == 0 { + // HEADERS frames MUST be associated with a stream. If a HEADERS frame + // is received whose stream identifier field is 0x0, the recipient MUST + // respond with a connection error (Section 5.4.1) of type + // PROTOCOL_ERROR. + return nil, ConnectionError(ErrCodeProtocol) + } + var padLength uint8 + if fh.Flags.Has(FlagHeadersPadded) { + if p, padLength, err = readByte(p); err != nil { + return + } + } + if fh.Flags.Has(FlagHeadersPriority) { + var v uint32 + p, v, err = readUint32(p) + if err != nil { + return nil, err + } + hf.Priority.StreamDep = v & 0x7fffffff + hf.Priority.Exclusive = (v != hf.Priority.StreamDep) // high bit was set + p, hf.Priority.Weight, err = readByte(p) + if err != nil { + return nil, err + } + } + if len(p)-int(padLength) <= 0 { + return nil, StreamError{fh.StreamID, ErrCodeProtocol} + } + hf.headerFragBuf = p[:len(p)-int(padLength)] + return hf, nil +} + +// HeadersFrameParam are the parameters for writing a HEADERS frame. +type HeadersFrameParam struct { + // StreamID is the required Stream ID to initiate. + StreamID uint32 + // BlockFragment is part (or all) of a Header Block. + BlockFragment []byte + + // EndStream indicates that the header block is the last that + // the endpoint will send for the identified stream. Setting + // this flag causes the stream to enter one of "half closed" + // states. + EndStream bool + + // EndHeaders indicates that this frame contains an entire + // header block and is not followed by any + // CONTINUATION frames. + EndHeaders bool + + // PadLength is the optional number of bytes of zeros to add + // to this frame. + PadLength uint8 + + // Priority, if non-zero, includes stream priority information + // in the HEADER frame. + Priority PriorityParam +} + +// WriteHeaders writes a single HEADERS frame. +// +// This is a low-level header writing method. Encoding headers and +// splitting them into any necessary CONTINUATION frames is handled +// elsewhere. +// +// It will perform exactly one Write to the underlying Writer. +// It is the caller's responsibility to not call other Write methods concurrently. +func (f *Framer) WriteHeaders(p HeadersFrameParam) error { + if !validStreamID(p.StreamID) && !f.AllowIllegalWrites { + return errStreamID + } + var flags Flags + if p.PadLength != 0 { + flags |= FlagHeadersPadded + } + if p.EndStream { + flags |= FlagHeadersEndStream + } + if p.EndHeaders { + flags |= FlagHeadersEndHeaders + } + if !p.Priority.IsZero() { + flags |= FlagHeadersPriority + } + f.startWrite(FrameHeaders, flags, p.StreamID) + if p.PadLength != 0 { + f.writeByte(p.PadLength) + } + if !p.Priority.IsZero() { + v := p.Priority.StreamDep + if !validStreamID(v) && !f.AllowIllegalWrites { + return errors.New("invalid dependent stream id") + } + if p.Priority.Exclusive { + v |= 1 << 31 + } + f.writeUint32(v) + f.writeByte(p.Priority.Weight) + } + f.wbuf = append(f.wbuf, p.BlockFragment...) + f.wbuf = append(f.wbuf, padZeros[:p.PadLength]...) + return f.endWrite() +} + +// A PriorityFrame specifies the sender-advised priority of a stream. +// See http://http2.github.io/http2-spec/#rfc.section.6.3 +type PriorityFrame struct { + FrameHeader + PriorityParam +} + +// PriorityParam are the stream prioritzation parameters. +type PriorityParam struct { + // StreamDep is a 31-bit stream identifier for the + // stream that this stream depends on. Zero means no + // dependency. + StreamDep uint32 + + // Exclusive is whether the dependency is exclusive. + Exclusive bool + + // Weight is the stream's zero-indexed weight. It should be + // set together with StreamDep, or neither should be set. Per + // the spec, "Add one to the value to obtain a weight between + // 1 and 256." + Weight uint8 +} + +func (p PriorityParam) IsZero() bool { + return p == PriorityParam{} +} + +func parsePriorityFrame(fh FrameHeader, payload []byte) (Frame, error) { + if fh.StreamID == 0 { + return nil, ConnectionError(ErrCodeProtocol) + } + if len(payload) != 5 { + return nil, ConnectionError(ErrCodeFrameSize) + } + v := binary.BigEndian.Uint32(payload[:4]) + streamID := v & 0x7fffffff // mask off high bit + return &PriorityFrame{ + FrameHeader: fh, + PriorityParam: PriorityParam{ + Weight: payload[4], + StreamDep: streamID, + Exclusive: streamID != v, // was high bit set? + }, + }, nil +} + +// WritePriority writes a PRIORITY frame. +// +// It will perform exactly one Write to the underlying Writer. +// It is the caller's responsibility to not call other Write methods concurrently. +func (f *Framer) WritePriority(streamID uint32, p PriorityParam) error { + if !validStreamID(streamID) && !f.AllowIllegalWrites { + return errStreamID + } + f.startWrite(FramePriority, 0, streamID) + v := p.StreamDep + if p.Exclusive { + v |= 1 << 31 + } + f.writeUint32(v) + f.writeByte(p.Weight) + return f.endWrite() +} + +// A RSTStreamFrame allows for abnormal termination of a stream. +// See http://http2.github.io/http2-spec/#rfc.section.6.4 +type RSTStreamFrame struct { + FrameHeader + ErrCode ErrCode +} + +func parseRSTStreamFrame(fh FrameHeader, p []byte) (Frame, error) { + if len(p) != 4 { + return nil, ConnectionError(ErrCodeFrameSize) + } + if fh.StreamID == 0 { + return nil, ConnectionError(ErrCodeProtocol) + } + return &RSTStreamFrame{fh, ErrCode(binary.BigEndian.Uint32(p[:4]))}, nil +} + +// WriteRSTStream writes a RST_STREAM frame. +// +// It will perform exactly one Write to the underlying Writer. +// It is the caller's responsibility to not call other Write methods concurrently. +func (f *Framer) WriteRSTStream(streamID uint32, code ErrCode) error { + if !validStreamID(streamID) && !f.AllowIllegalWrites { + return errStreamID + } + f.startWrite(FrameRSTStream, 0, streamID) + f.writeUint32(uint32(code)) + return f.endWrite() +} + +// A ContinuationFrame is used to continue a sequence of header block fragments. +// See http://http2.github.io/http2-spec/#rfc.section.6.10 +type ContinuationFrame struct { + FrameHeader + headerFragBuf []byte +} + +func parseContinuationFrame(fh FrameHeader, p []byte) (Frame, error) { + return &ContinuationFrame{fh, p}, nil +} + +func (f *ContinuationFrame) StreamEnded() bool { + return f.FrameHeader.Flags.Has(FlagDataEndStream) +} + +func (f *ContinuationFrame) HeaderBlockFragment() []byte { + f.checkValid() + return f.headerFragBuf +} + +func (f *ContinuationFrame) HeadersEnded() bool { + return f.FrameHeader.Flags.Has(FlagContinuationEndHeaders) +} + +// WriteContinuation writes a CONTINUATION frame. +// +// It will perform exactly one Write to the underlying Writer. +// It is the caller's responsibility to not call other Write methods concurrently. +func (f *Framer) WriteContinuation(streamID uint32, endHeaders bool, headerBlockFragment []byte) error { + if !validStreamID(streamID) && !f.AllowIllegalWrites { + return errStreamID + } + var flags Flags + if endHeaders { + flags |= FlagContinuationEndHeaders + } + f.startWrite(FrameContinuation, flags, streamID) + f.wbuf = append(f.wbuf, headerBlockFragment...) + return f.endWrite() +} + +// A PushPromiseFrame is used to initiate a server stream. +// See http://http2.github.io/http2-spec/#rfc.section.6.6 +type PushPromiseFrame struct { + FrameHeader + PromiseID uint32 + headerFragBuf []byte // not owned +} + +func (f *PushPromiseFrame) HeaderBlockFragment() []byte { + f.checkValid() + return f.headerFragBuf +} + +func (f *PushPromiseFrame) HeadersEnded() bool { + return f.FrameHeader.Flags.Has(FlagPushPromiseEndHeaders) +} + +func parsePushPromise(fh FrameHeader, p []byte) (_ Frame, err error) { + pp := &PushPromiseFrame{ + FrameHeader: fh, + } + if pp.StreamID == 0 { + // PUSH_PROMISE frames MUST be associated with an existing, + // peer-initiated stream. The stream identifier of a + // PUSH_PROMISE frame indicates the stream it is associated + // with. If the stream identifier field specifies the value + // 0x0, a recipient MUST respond with a connection error + // (Section 5.4.1) of type PROTOCOL_ERROR. + return nil, ConnectionError(ErrCodeProtocol) + } + // The PUSH_PROMISE frame includes optional padding. + // Padding fields and flags are identical to those defined for DATA frames + var padLength uint8 + if fh.Flags.Has(FlagPushPromisePadded) { + if p, padLength, err = readByte(p); err != nil { + return + } + } + + p, pp.PromiseID, err = readUint32(p) + if err != nil { + return + } + pp.PromiseID = pp.PromiseID & (1<<31 - 1) + + if int(padLength) > len(p) { + // like the DATA frame, error out if padding is longer than the body. + return nil, ConnectionError(ErrCodeProtocol) + } + pp.headerFragBuf = p[:len(p)-int(padLength)] + return pp, nil +} + +// PushPromiseParam are the parameters for writing a PUSH_PROMISE frame. +type PushPromiseParam struct { + // StreamID is the required Stream ID to initiate. + StreamID uint32 + + // PromiseID is the required Stream ID which this + // Push Promises + PromiseID uint32 + + // BlockFragment is part (or all) of a Header Block. + BlockFragment []byte + + // EndHeaders indicates that this frame contains an entire + // header block and is not followed by any + // CONTINUATION frames. + EndHeaders bool + + // PadLength is the optional number of bytes of zeros to add + // to this frame. + PadLength uint8 +} + +// WritePushPromise writes a single PushPromise Frame. +// +// As with Header Frames, This is the low level call for writing +// individual frames. Continuation frames are handled elsewhere. +// +// It will perform exactly one Write to the underlying Writer. +// It is the caller's responsibility to not call other Write methods concurrently. +func (f *Framer) WritePushPromise(p PushPromiseParam) error { + if !validStreamID(p.StreamID) && !f.AllowIllegalWrites { + return errStreamID + } + var flags Flags + if p.PadLength != 0 { + flags |= FlagPushPromisePadded + } + if p.EndHeaders { + flags |= FlagPushPromiseEndHeaders + } + f.startWrite(FramePushPromise, flags, p.StreamID) + if p.PadLength != 0 { + f.writeByte(p.PadLength) + } + if !validStreamID(p.PromiseID) && !f.AllowIllegalWrites { + return errStreamID + } + f.writeUint32(p.PromiseID) + f.wbuf = append(f.wbuf, p.BlockFragment...) + f.wbuf = append(f.wbuf, padZeros[:p.PadLength]...) + return f.endWrite() +} + +// WriteRawFrame writes a raw frame. This can be used to write +// extension frames unknown to this package. +func (f *Framer) WriteRawFrame(t FrameType, flags Flags, streamID uint32, payload []byte) error { + f.startWrite(t, flags, streamID) + f.writeBytes(payload) + return f.endWrite() +} + +func readByte(p []byte) (remain []byte, b byte, err error) { + if len(p) == 0 { + return nil, 0, io.ErrUnexpectedEOF + } + return p[1:], p[0], nil +} + +func readUint32(p []byte) (remain []byte, v uint32, err error) { + if len(p) < 4 { + return nil, 0, io.ErrUnexpectedEOF + } + return p[4:], binary.BigEndian.Uint32(p[:4]), nil +} + +type streamEnder interface { + StreamEnded() bool +} + +type headersEnder interface { + HeadersEnded() bool +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/frame_test.go b/Godeps/_workspace/src/github.com/bradfitz/http2/frame_test.go new file mode 100644 index 000000000..20027c5f1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/frame_test.go @@ -0,0 +1,597 @@ +// 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 http2 + +import ( + "bytes" + "reflect" + "strings" + "testing" + "unsafe" +) + +func testFramer() (*Framer, *bytes.Buffer) { + buf := new(bytes.Buffer) + return NewFramer(buf, buf), buf +} + +func TestFrameSizes(t *testing.T) { + // Catch people rearranging the FrameHeader fields. + if got, want := int(unsafe.Sizeof(FrameHeader{})), 12; got != want { + t.Errorf("FrameHeader size = %d; want %d", got, want) + } +} + +func TestFrameTypeString(t *testing.T) { + tests := []struct { + ft FrameType + want string + }{ + {FrameData, "DATA"}, + {FramePing, "PING"}, + {FrameGoAway, "GOAWAY"}, + {0xf, "UNKNOWN_FRAME_TYPE_15"}, + } + + for i, tt := range tests { + got := tt.ft.String() + if got != tt.want { + t.Errorf("%d. String(FrameType %d) = %q; want %q", i, int(tt.ft), got, tt.want) + } + } +} + +func TestWriteRST(t *testing.T) { + fr, buf := testFramer() + var streamID uint32 = 1<<24 + 2<<16 + 3<<8 + 4 + var errCode uint32 = 7<<24 + 6<<16 + 5<<8 + 4 + fr.WriteRSTStream(streamID, ErrCode(errCode)) + const wantEnc = "\x00\x00\x04\x03\x00\x01\x02\x03\x04\x07\x06\x05\x04" + if buf.String() != wantEnc { + t.Errorf("encoded as %q; want %q", buf.Bytes(), wantEnc) + } + f, err := fr.ReadFrame() + if err != nil { + t.Fatal(err) + } + want := &RSTStreamFrame{ + FrameHeader: FrameHeader{ + valid: true, + Type: 0x3, + Flags: 0x0, + Length: 0x4, + StreamID: 0x1020304, + }, + ErrCode: 0x7060504, + } + if !reflect.DeepEqual(f, want) { + t.Errorf("parsed back %#v; want %#v", f, want) + } +} + +func TestWriteData(t *testing.T) { + fr, buf := testFramer() + var streamID uint32 = 1<<24 + 2<<16 + 3<<8 + 4 + data := []byte("ABC") + fr.WriteData(streamID, true, data) + const wantEnc = "\x00\x00\x03\x00\x01\x01\x02\x03\x04ABC" + if buf.String() != wantEnc { + t.Errorf("encoded as %q; want %q", buf.Bytes(), wantEnc) + } + f, err := fr.ReadFrame() + if err != nil { + t.Fatal(err) + } + df, ok := f.(*DataFrame) + if !ok { + t.Fatalf("got %T; want *DataFrame", f) + } + if !bytes.Equal(df.Data(), data) { + t.Errorf("got %q; want %q", df.Data(), data) + } + if f.Header().Flags&1 == 0 { + t.Errorf("didn't see END_STREAM flag") + } +} + +func TestWriteHeaders(t *testing.T) { + tests := []struct { + name string + p HeadersFrameParam + wantEnc string + wantFrame *HeadersFrame + }{ + { + "basic", + HeadersFrameParam{ + StreamID: 42, + BlockFragment: []byte("abc"), + Priority: PriorityParam{}, + }, + "\x00\x00\x03\x01\x00\x00\x00\x00*abc", + &HeadersFrame{ + FrameHeader: FrameHeader{ + valid: true, + StreamID: 42, + Type: FrameHeaders, + Length: uint32(len("abc")), + }, + Priority: PriorityParam{}, + headerFragBuf: []byte("abc"), + }, + }, + { + "basic + end flags", + HeadersFrameParam{ + StreamID: 42, + BlockFragment: []byte("abc"), + EndStream: true, + EndHeaders: true, + Priority: PriorityParam{}, + }, + "\x00\x00\x03\x01\x05\x00\x00\x00*abc", + &HeadersFrame{ + FrameHeader: FrameHeader{ + valid: true, + StreamID: 42, + Type: FrameHeaders, + Flags: FlagHeadersEndStream | FlagHeadersEndHeaders, + Length: uint32(len("abc")), + }, + Priority: PriorityParam{}, + headerFragBuf: []byte("abc"), + }, + }, + { + "with padding", + HeadersFrameParam{ + StreamID: 42, + BlockFragment: []byte("abc"), + EndStream: true, + EndHeaders: true, + PadLength: 5, + Priority: PriorityParam{}, + }, + "\x00\x00\t\x01\r\x00\x00\x00*\x05abc\x00\x00\x00\x00\x00", + &HeadersFrame{ + FrameHeader: FrameHeader{ + valid: true, + StreamID: 42, + Type: FrameHeaders, + Flags: FlagHeadersEndStream | FlagHeadersEndHeaders | FlagHeadersPadded, + Length: uint32(1 + len("abc") + 5), // pad length + contents + padding + }, + Priority: PriorityParam{}, + headerFragBuf: []byte("abc"), + }, + }, + { + "with priority", + HeadersFrameParam{ + StreamID: 42, + BlockFragment: []byte("abc"), + EndStream: true, + EndHeaders: true, + PadLength: 2, + Priority: PriorityParam{ + StreamDep: 15, + Exclusive: true, + Weight: 127, + }, + }, + "\x00\x00\v\x01-\x00\x00\x00*\x02\x80\x00\x00\x0f\u007fabc\x00\x00", + &HeadersFrame{ + FrameHeader: FrameHeader{ + valid: true, + StreamID: 42, + Type: FrameHeaders, + Flags: FlagHeadersEndStream | FlagHeadersEndHeaders | FlagHeadersPadded | FlagHeadersPriority, + Length: uint32(1 + 5 + len("abc") + 2), // pad length + priority + contents + padding + }, + Priority: PriorityParam{ + StreamDep: 15, + Exclusive: true, + Weight: 127, + }, + headerFragBuf: []byte("abc"), + }, + }, + } + for _, tt := range tests { + fr, buf := testFramer() + if err := fr.WriteHeaders(tt.p); err != nil { + t.Errorf("test %q: %v", tt.name, err) + continue + } + if buf.String() != tt.wantEnc { + t.Errorf("test %q: encoded %q; want %q", tt.name, buf.Bytes(), tt.wantEnc) + } + f, err := fr.ReadFrame() + if err != nil { + t.Errorf("test %q: failed to read the frame back: %v", tt.name, err) + continue + } + if !reflect.DeepEqual(f, tt.wantFrame) { + t.Errorf("test %q: mismatch.\n got: %#v\nwant: %#v\n", tt.name, f, tt.wantFrame) + } + } +} + +func TestWriteContinuation(t *testing.T) { + const streamID = 42 + tests := []struct { + name string + end bool + frag []byte + + wantFrame *ContinuationFrame + }{ + { + "not end", + false, + []byte("abc"), + &ContinuationFrame{ + FrameHeader: FrameHeader{ + valid: true, + StreamID: streamID, + Type: FrameContinuation, + Length: uint32(len("abc")), + }, + headerFragBuf: []byte("abc"), + }, + }, + { + "end", + true, + []byte("def"), + &ContinuationFrame{ + FrameHeader: FrameHeader{ + valid: true, + StreamID: streamID, + Type: FrameContinuation, + Flags: FlagContinuationEndHeaders, + Length: uint32(len("def")), + }, + headerFragBuf: []byte("def"), + }, + }, + } + for _, tt := range tests { + fr, _ := testFramer() + if err := fr.WriteContinuation(streamID, tt.end, tt.frag); err != nil { + t.Errorf("test %q: %v", tt.name, err) + continue + } + f, err := fr.ReadFrame() + if err != nil { + t.Errorf("test %q: failed to read the frame back: %v", tt.name, err) + continue + } + if !reflect.DeepEqual(f, tt.wantFrame) { + t.Errorf("test %q: mismatch.\n got: %#v\nwant: %#v\n", tt.name, f, tt.wantFrame) + } + } +} + +func TestWritePriority(t *testing.T) { + const streamID = 42 + tests := []struct { + name string + priority PriorityParam + wantFrame *PriorityFrame + }{ + { + "not exclusive", + PriorityParam{ + StreamDep: 2, + Exclusive: false, + Weight: 127, + }, + &PriorityFrame{ + FrameHeader{ + valid: true, + StreamID: streamID, + Type: FramePriority, + Length: 5, + }, + PriorityParam{ + StreamDep: 2, + Exclusive: false, + Weight: 127, + }, + }, + }, + + { + "exclusive", + PriorityParam{ + StreamDep: 3, + Exclusive: true, + Weight: 77, + }, + &PriorityFrame{ + FrameHeader{ + valid: true, + StreamID: streamID, + Type: FramePriority, + Length: 5, + }, + PriorityParam{ + StreamDep: 3, + Exclusive: true, + Weight: 77, + }, + }, + }, + } + for _, tt := range tests { + fr, _ := testFramer() + if err := fr.WritePriority(streamID, tt.priority); err != nil { + t.Errorf("test %q: %v", tt.name, err) + continue + } + f, err := fr.ReadFrame() + if err != nil { + t.Errorf("test %q: failed to read the frame back: %v", tt.name, err) + continue + } + if !reflect.DeepEqual(f, tt.wantFrame) { + t.Errorf("test %q: mismatch.\n got: %#v\nwant: %#v\n", tt.name, f, tt.wantFrame) + } + } +} + +func TestWriteSettings(t *testing.T) { + fr, buf := testFramer() + settings := []Setting{{1, 2}, {3, 4}} + fr.WriteSettings(settings...) + const wantEnc = "\x00\x00\f\x04\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x03\x00\x00\x00\x04" + if buf.String() != wantEnc { + t.Errorf("encoded as %q; want %q", buf.Bytes(), wantEnc) + } + f, err := fr.ReadFrame() + if err != nil { + t.Fatal(err) + } + sf, ok := f.(*SettingsFrame) + if !ok { + t.Fatalf("Got a %T; want a SettingsFrame", f) + } + var got []Setting + sf.ForeachSetting(func(s Setting) error { + got = append(got, s) + valBack, ok := sf.Value(s.ID) + if !ok || valBack != s.Val { + t.Errorf("Value(%d) = %v, %v; want %v, true", s.ID, valBack, ok, s.Val) + } + return nil + }) + if !reflect.DeepEqual(settings, got) { + t.Errorf("Read settings %+v != written settings %+v", got, settings) + } +} + +func TestWriteSettingsAck(t *testing.T) { + fr, buf := testFramer() + fr.WriteSettingsAck() + const wantEnc = "\x00\x00\x00\x04\x01\x00\x00\x00\x00" + if buf.String() != wantEnc { + t.Errorf("encoded as %q; want %q", buf.Bytes(), wantEnc) + } +} + +func TestWriteWindowUpdate(t *testing.T) { + fr, buf := testFramer() + const streamID = 1<<24 + 2<<16 + 3<<8 + 4 + const incr = 7<<24 + 6<<16 + 5<<8 + 4 + if err := fr.WriteWindowUpdate(streamID, incr); err != nil { + t.Fatal(err) + } + const wantEnc = "\x00\x00\x04\x08\x00\x01\x02\x03\x04\x07\x06\x05\x04" + if buf.String() != wantEnc { + t.Errorf("encoded as %q; want %q", buf.Bytes(), wantEnc) + } + f, err := fr.ReadFrame() + if err != nil { + t.Fatal(err) + } + want := &WindowUpdateFrame{ + FrameHeader: FrameHeader{ + valid: true, + Type: 0x8, + Flags: 0x0, + Length: 0x4, + StreamID: 0x1020304, + }, + Increment: 0x7060504, + } + if !reflect.DeepEqual(f, want) { + t.Errorf("parsed back %#v; want %#v", f, want) + } +} + +func TestWritePing(t *testing.T) { testWritePing(t, false) } +func TestWritePingAck(t *testing.T) { testWritePing(t, true) } + +func testWritePing(t *testing.T, ack bool) { + fr, buf := testFramer() + if err := fr.WritePing(ack, [8]byte{1, 2, 3, 4, 5, 6, 7, 8}); err != nil { + t.Fatal(err) + } + var wantFlags Flags + if ack { + wantFlags = FlagPingAck + } + var wantEnc = "\x00\x00\x08\x06" + string(wantFlags) + "\x00\x00\x00\x00" + "\x01\x02\x03\x04\x05\x06\x07\x08" + if buf.String() != wantEnc { + t.Errorf("encoded as %q; want %q", buf.Bytes(), wantEnc) + } + + f, err := fr.ReadFrame() + if err != nil { + t.Fatal(err) + } + want := &PingFrame{ + FrameHeader: FrameHeader{ + valid: true, + Type: 0x6, + Flags: wantFlags, + Length: 0x8, + StreamID: 0, + }, + Data: [8]byte{1, 2, 3, 4, 5, 6, 7, 8}, + } + if !reflect.DeepEqual(f, want) { + t.Errorf("parsed back %#v; want %#v", f, want) + } +} + +func TestReadFrameHeader(t *testing.T) { + tests := []struct { + in string + want FrameHeader + }{ + {in: "\x00\x00\x00" + "\x00" + "\x00" + "\x00\x00\x00\x00", want: FrameHeader{}}, + {in: "\x01\x02\x03" + "\x04" + "\x05" + "\x06\x07\x08\x09", want: FrameHeader{ + Length: 66051, Type: 4, Flags: 5, StreamID: 101124105, + }}, + // Ignore high bit: + {in: "\xff\xff\xff" + "\xff" + "\xff" + "\xff\xff\xff\xff", want: FrameHeader{ + Length: 16777215, Type: 255, Flags: 255, StreamID: 2147483647}}, + {in: "\xff\xff\xff" + "\xff" + "\xff" + "\x7f\xff\xff\xff", want: FrameHeader{ + Length: 16777215, Type: 255, Flags: 255, StreamID: 2147483647}}, + } + for i, tt := range tests { + got, err := readFrameHeader(make([]byte, 9), strings.NewReader(tt.in)) + if err != nil { + t.Errorf("%d. readFrameHeader(%q) = %v", i, tt.in, err) + continue + } + tt.want.valid = true + if got != tt.want { + t.Errorf("%d. readFrameHeader(%q) = %+v; want %+v", i, tt.in, got, tt.want) + } + } +} + +func TestReadWriteFrameHeader(t *testing.T) { + tests := []struct { + len uint32 + typ FrameType + flags Flags + streamID uint32 + }{ + {len: 0, typ: 255, flags: 1, streamID: 0}, + {len: 0, typ: 255, flags: 1, streamID: 1}, + {len: 0, typ: 255, flags: 1, streamID: 255}, + {len: 0, typ: 255, flags: 1, streamID: 256}, + {len: 0, typ: 255, flags: 1, streamID: 65535}, + {len: 0, typ: 255, flags: 1, streamID: 65536}, + + {len: 0, typ: 1, flags: 255, streamID: 1}, + {len: 255, typ: 1, flags: 255, streamID: 1}, + {len: 256, typ: 1, flags: 255, streamID: 1}, + {len: 65535, typ: 1, flags: 255, streamID: 1}, + {len: 65536, typ: 1, flags: 255, streamID: 1}, + {len: 16777215, typ: 1, flags: 255, streamID: 1}, + } + for _, tt := range tests { + fr, buf := testFramer() + fr.startWrite(tt.typ, tt.flags, tt.streamID) + fr.writeBytes(make([]byte, tt.len)) + fr.endWrite() + fh, err := ReadFrameHeader(buf) + if err != nil { + t.Errorf("ReadFrameHeader(%+v) = %v", tt, err) + continue + } + if fh.Type != tt.typ || fh.Flags != tt.flags || fh.Length != tt.len || fh.StreamID != tt.streamID { + t.Errorf("ReadFrameHeader(%+v) = %+v; mismatch", tt, fh) + } + } + +} + +func TestWriteTooLargeFrame(t *testing.T) { + fr, _ := testFramer() + fr.startWrite(0, 1, 1) + fr.writeBytes(make([]byte, 1<<24)) + err := fr.endWrite() + if err != ErrFrameTooLarge { + t.Errorf("endWrite = %v; want errFrameTooLarge", err) + } +} + +func TestWriteGoAway(t *testing.T) { + const debug = "foo" + fr, buf := testFramer() + if err := fr.WriteGoAway(0x01020304, 0x05060708, []byte(debug)); err != nil { + t.Fatal(err) + } + const wantEnc = "\x00\x00\v\a\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08" + debug + if buf.String() != wantEnc { + t.Errorf("encoded as %q; want %q", buf.Bytes(), wantEnc) + } + f, err := fr.ReadFrame() + if err != nil { + t.Fatal(err) + } + want := &GoAwayFrame{ + FrameHeader: FrameHeader{ + valid: true, + Type: 0x7, + Flags: 0, + Length: uint32(4 + 4 + len(debug)), + StreamID: 0, + }, + LastStreamID: 0x01020304, + ErrCode: 0x05060708, + debugData: []byte(debug), + } + if !reflect.DeepEqual(f, want) { + t.Fatalf("parsed back:\n%#v\nwant:\n%#v", f, want) + } + if got := string(f.(*GoAwayFrame).DebugData()); got != debug { + t.Errorf("debug data = %q; want %q", got, debug) + } +} + +func TestWritePushPromise(t *testing.T) { + pp := PushPromiseParam{ + StreamID: 42, + PromiseID: 42, + BlockFragment: []byte("abc"), + } + fr, buf := testFramer() + if err := fr.WritePushPromise(pp); err != nil { + t.Fatal(err) + } + const wantEnc = "\x00\x00\x07\x05\x00\x00\x00\x00*\x00\x00\x00*abc" + if buf.String() != wantEnc { + t.Errorf("encoded as %q; want %q", buf.Bytes(), wantEnc) + } + f, err := fr.ReadFrame() + if err != nil { + t.Fatal(err) + } + _, ok := f.(*PushPromiseFrame) + if !ok { + t.Fatalf("got %T; want *PushPromiseFrame", f) + } + want := &PushPromiseFrame{ + FrameHeader: FrameHeader{ + valid: true, + Type: 0x5, + Flags: 0x0, + Length: 0x7, + StreamID: 42, + }, + PromiseID: 42, + headerFragBuf: []byte("abc"), + } + if !reflect.DeepEqual(f, want) { + t.Fatalf("parsed back:\n%#v\nwant:\n%#v", f, want) + } +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/gotrack.go b/Godeps/_workspace/src/github.com/bradfitz/http2/gotrack.go new file mode 100644 index 000000000..7dc2ef90d --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/gotrack.go @@ -0,0 +1,173 @@ +// 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. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +// Defensive debug-only utility to track that functions run on the +// goroutine that they're supposed to. + +package http2 + +import ( + "bytes" + "errors" + "fmt" + "os" + "runtime" + "strconv" + "sync" +) + +var DebugGoroutines = os.Getenv("DEBUG_HTTP2_GOROUTINES") == "1" + +type goroutineLock uint64 + +func newGoroutineLock() goroutineLock { + if !DebugGoroutines { + return 0 + } + return goroutineLock(curGoroutineID()) +} + +func (g goroutineLock) check() { + if !DebugGoroutines { + return + } + if curGoroutineID() != uint64(g) { + panic("running on the wrong goroutine") + } +} + +func (g goroutineLock) checkNotOn() { + if !DebugGoroutines { + return + } + if curGoroutineID() == uint64(g) { + panic("running on the wrong goroutine") + } +} + +var goroutineSpace = []byte("goroutine ") + +func curGoroutineID() uint64 { + bp := littleBuf.Get().(*[]byte) + defer littleBuf.Put(bp) + b := *bp + b = b[:runtime.Stack(b, false)] + // Parse the 4707 out of "goroutine 4707 [" + b = bytes.TrimPrefix(b, goroutineSpace) + i := bytes.IndexByte(b, ' ') + if i < 0 { + panic(fmt.Sprintf("No space found in %q", b)) + } + b = b[:i] + n, err := parseUintBytes(b, 10, 64) + if err != nil { + panic(fmt.Sprintf("Failed to parse goroutine ID out of %q: %v", b, err)) + } + return n +} + +var littleBuf = sync.Pool{ + New: func() interface{} { + buf := make([]byte, 64) + return &buf + }, +} + +// parseUintBytes is like strconv.ParseUint, but using a []byte. +func parseUintBytes(s []byte, base int, bitSize int) (n uint64, err error) { + var cutoff, maxVal uint64 + + if bitSize == 0 { + bitSize = int(strconv.IntSize) + } + + s0 := s + switch { + case len(s) < 1: + err = strconv.ErrSyntax + goto Error + + case 2 <= base && base <= 36: + // valid base; nothing to do + + case base == 0: + // Look for octal, hex prefix. + switch { + case s[0] == '0' && len(s) > 1 && (s[1] == 'x' || s[1] == 'X'): + base = 16 + s = s[2:] + if len(s) < 1 { + err = strconv.ErrSyntax + goto Error + } + case s[0] == '0': + base = 8 + default: + base = 10 + } + + default: + err = errors.New("invalid base " + strconv.Itoa(base)) + goto Error + } + + n = 0 + cutoff = cutoff64(base) + maxVal = 1<= base { + n = 0 + err = strconv.ErrSyntax + goto Error + } + + if n >= cutoff { + // n*base overflows + n = 1<<64 - 1 + err = strconv.ErrRange + goto Error + } + n *= uint64(base) + + n1 := n + uint64(v) + if n1 < n || n1 > maxVal { + // n+v overflows + n = 1<<64 - 1 + err = strconv.ErrRange + goto Error + } + n = n1 + } + + return n, nil + +Error: + return n, &strconv.NumError{Func: "ParseUint", Num: string(s0), Err: err} +} + +// Return the first number n such that n*base >= 1<<64. +func cutoff64(base int) uint64 { + if base < 2 { + return 0 + } + return (1<<64-1)/uint64(base) + 1 +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/gotrack_test.go b/Godeps/_workspace/src/github.com/bradfitz/http2/gotrack_test.go new file mode 100644 index 000000000..3ff4957e9 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/gotrack_test.go @@ -0,0 +1,33 @@ +// 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. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +package http2 + +import ( + "fmt" + "strings" + "testing" +) + +func TestGoroutineLock(t *testing.T) { + DebugGoroutines = true + g := newGoroutineLock() + g.check() + + sawPanic := make(chan interface{}) + go func() { + defer func() { sawPanic <- recover() }() + g.check() // should panic + }() + e := <-sawPanic + if e == nil { + t.Fatal("did not see panic from check in other goroutine") + } + if !strings.Contains(fmt.Sprint(e), "wrong goroutine") { + t.Errorf("expected on see panic about running on the wrong goroutine; got %v", e) + } +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/.gitignore b/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/.gitignore new file mode 100644 index 000000000..0de86ddbc --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/.gitignore @@ -0,0 +1,5 @@ +h2demo +h2demo.linux +client-id.dat +client-secret.dat +token.dat diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/Makefile b/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/Makefile new file mode 100644 index 000000000..3a77cf073 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/Makefile @@ -0,0 +1,5 @@ +h2demo.linux: h2demo.go + GOOS=linux go build --tags=h2demo -o h2demo.linux . + +upload: h2demo.linux + cat h2demo.linux | go run launch.go --write_object=http2-demo-server-tls/h2demo --write_object_is_public diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/README b/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/README new file mode 100644 index 000000000..212a96f38 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/README @@ -0,0 +1,16 @@ + +Client: + -- Firefox nightly with about:config network.http.spdy.enabled.http2draft set true + -- Chrome: go to chrome://flags/#enable-spdy4, save and restart (button at bottom) + +Make CA: +$ openssl genrsa -out rootCA.key 2048 +$ openssl req -x509 -new -nodes -key rootCA.key -days 1024 -out rootCA.pem +... install that to Firefox + +Make cert: +$ openssl genrsa -out server.key 2048 +$ openssl req -new -key server.key -out server.csr +$ openssl x509 -req -in server.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out server.crt -days 500 + + diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/h2demo.go b/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/h2demo.go new file mode 100644 index 000000000..de6caaa74 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/h2demo.go @@ -0,0 +1,426 @@ +// Copyright 2014 The Go Authors. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +// +build h2demo + +package main + +import ( + "bytes" + "crypto/tls" + "flag" + "fmt" + "hash/crc32" + "image" + "image/jpeg" + "io" + "io/ioutil" + "log" + "net" + "net/http" + "os/exec" + "path" + "regexp" + "runtime" + "strconv" + "strings" + "sync" + "time" + + "camlistore.org/pkg/googlestorage" + "camlistore.org/pkg/singleflight" + "github.com/bradfitz/http2" +) + +var ( + openFirefox = flag.Bool("openff", false, "Open Firefox") + addr = flag.String("addr", "localhost:4430", "TLS address to listen on") + httpAddr = flag.String("httpaddr", "", "If non-empty, address to listen for regular HTTP on") + prod = flag.Bool("prod", false, "Whether to configure itself to be the production http2.golang.org server.") +) + +func homeOldHTTP(w http.ResponseWriter, r *http.Request) { + io.WriteString(w, ` + +

Go + HTTP/2

+

Welcome to the Go language's HTTP/2 demo & interop server.

+

Unfortunately, you're not using HTTP/2 right now. To do so:

+
    +
  • Use Firefox Nightly or go to about:config and enable "network.http.spdy.enabled.http2draft"
  • +
  • Use Google Chrome Canary and/or go to chrome://flags/#enable-spdy4 to Enable SPDY/4 (Chrome's name for HTTP/2)
  • +
+

See code & instructions for connecting at https://github.com/bradfitz/http2.

+ +`) +} + +func home(w http.ResponseWriter, r *http.Request) { + if r.URL.Path != "/" { + http.NotFound(w, r) + return + } + io.WriteString(w, ` + +

Go + HTTP/2

+ +

Welcome to the Go language's HTTP/2 demo & interop server.

+ +

Congratulations, you're using HTTP/2 right now.

+ +

This server exists for others in the HTTP/2 community to test their HTTP/2 client implementations and point out flaws in our server.

+ +

The code is currently at github.com/bradfitz/http2 +but will move to the Go standard library at some point in the future +(enabled by default, without users needing to change their code).

+ +

Contact info: bradfitz@golang.org, or file a bug.

+ +

Handlers for testing

+
    +
  • GET /reqinfo to dump the request + headers received
  • +
  • GET /clockstream streams the current time every second
  • +
  • GET /gophertiles to see a page with a bunch of images
  • +
  • GET /file/gopher.png for a small file (does If-Modified-Since, Content-Range, etc)
  • +
  • GET /file/go.src.tar.gz for a larger file (~10 MB)
  • +
  • GET /redirect to redirect back to / (this page)
  • +
  • GET /goroutines to see all active goroutines in this server
  • +
  • PUT something to /crc32 to get a count of number of bytes and its CRC-32
  • +
+ +`) +} + +func reqInfoHandler(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "text/plain") + fmt.Fprintf(w, "Method: %s\n", r.Method) + fmt.Fprintf(w, "Protocol: %s\n", r.Proto) + fmt.Fprintf(w, "Host: %s\n", r.Host) + fmt.Fprintf(w, "RemoteAddr: %s\n", r.RemoteAddr) + fmt.Fprintf(w, "RequestURI: %q\n", r.RequestURI) + fmt.Fprintf(w, "URL: %#v\n", r.URL) + fmt.Fprintf(w, "Body.ContentLength: %d (-1 means unknown)\n", r.ContentLength) + fmt.Fprintf(w, "Close: %v (relevant for HTTP/1 only)\n", r.Close) + fmt.Fprintf(w, "TLS: %#v\n", r.TLS) + fmt.Fprintf(w, "\nHeaders:\n") + r.Header.Write(w) +} + +func crcHandler(w http.ResponseWriter, r *http.Request) { + if r.Method != "PUT" { + http.Error(w, "PUT required.", 400) + return + } + crc := crc32.NewIEEE() + n, err := io.Copy(crc, r.Body) + if err == nil { + w.Header().Set("Content-Type", "text/plain") + fmt.Fprintf(w, "bytes=%d, CRC32=%x", n, crc.Sum(nil)) + } +} + +var ( + fsGrp singleflight.Group + fsMu sync.Mutex // guards fsCache + fsCache = map[string]http.Handler{} +) + +// fileServer returns a file-serving handler that proxies URL. +// It lazily fetches URL on the first access and caches its contents forever. +func fileServer(url string) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + hi, err := fsGrp.Do(url, func() (interface{}, error) { + fsMu.Lock() + if h, ok := fsCache[url]; ok { + fsMu.Unlock() + return h, nil + } + fsMu.Unlock() + + res, err := http.Get(url) + if err != nil { + return nil, err + } + defer res.Body.Close() + slurp, err := ioutil.ReadAll(res.Body) + if err != nil { + return nil, err + } + + modTime := time.Now() + var h http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + http.ServeContent(w, r, path.Base(url), modTime, bytes.NewReader(slurp)) + }) + fsMu.Lock() + fsCache[url] = h + fsMu.Unlock() + return h, nil + }) + if err != nil { + http.Error(w, err.Error(), 500) + return + } + hi.(http.Handler).ServeHTTP(w, r) + }) +} + +func clockStreamHandler(w http.ResponseWriter, r *http.Request) { + clientGone := w.(http.CloseNotifier).CloseNotify() + w.Header().Set("Content-Type", "text/plain") + ticker := time.NewTicker(1 * time.Second) + defer ticker.Stop() + fmt.Fprintf(w, "# ~1KB of junk to force browsers to start rendering immediately: \n") + io.WriteString(w, strings.Repeat("# xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n", 13)) + + for { + fmt.Fprintf(w, "%v\n", time.Now()) + w.(http.Flusher).Flush() + select { + case <-ticker.C: + case <-clientGone: + log.Printf("Client %v disconnected from the clock", r.RemoteAddr) + return + } + } +} + +func registerHandlers() { + tiles := newGopherTilesHandler() + + mux2 := http.NewServeMux() + http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + if r.TLS == nil { + if r.URL.Path == "/gophertiles" { + tiles.ServeHTTP(w, r) + return + } + http.Redirect(w, r, "https://http2.golang.org/", http.StatusFound) + return + } + if r.ProtoMajor == 1 { + if r.URL.Path == "/reqinfo" { + reqInfoHandler(w, r) + return + } + homeOldHTTP(w, r) + return + } + mux2.ServeHTTP(w, r) + }) + mux2.HandleFunc("/", home) + mux2.Handle("/file/gopher.png", fileServer("https://golang.org/doc/gopher/frontpage.png")) + mux2.Handle("/file/go.src.tar.gz", fileServer("https://storage.googleapis.com/golang/go1.4.1.src.tar.gz")) + mux2.HandleFunc("/reqinfo", reqInfoHandler) + mux2.HandleFunc("/crc32", crcHandler) + mux2.HandleFunc("/clockstream", clockStreamHandler) + mux2.Handle("/gophertiles", tiles) + mux2.HandleFunc("/redirect", func(w http.ResponseWriter, r *http.Request) { + http.Redirect(w, r, "/", http.StatusFound) + }) + stripHomedir := regexp.MustCompile(`/(Users|home)/\w+`) + mux2.HandleFunc("/goroutines", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "text/plain; charset=utf-8") + buf := make([]byte, 2<<20) + w.Write(stripHomedir.ReplaceAll(buf[:runtime.Stack(buf, true)], nil)) + }) +} + +func newGopherTilesHandler() http.Handler { + const gopherURL = "https://blog.golang.org/go-programming-language-turns-two_gophers.jpg" + res, err := http.Get(gopherURL) + if err != nil { + log.Fatal(err) + } + if res.StatusCode != 200 { + log.Fatalf("Error fetching %s: %v", gopherURL, res.Status) + } + slurp, err := ioutil.ReadAll(res.Body) + res.Body.Close() + if err != nil { + log.Fatal(err) + } + im, err := jpeg.Decode(bytes.NewReader(slurp)) + if err != nil { + if len(slurp) > 1024 { + slurp = slurp[:1024] + } + log.Fatalf("Failed to decode gopher image: %v (got %q)", err, slurp) + } + + type subImager interface { + SubImage(image.Rectangle) image.Image + } + const tileSize = 32 + xt := im.Bounds().Max.X / tileSize + yt := im.Bounds().Max.Y / tileSize + var tile [][][]byte // y -> x -> jpeg bytes + for yi := 0; yi < yt; yi++ { + var row [][]byte + for xi := 0; xi < xt; xi++ { + si := im.(subImager).SubImage(image.Rectangle{ + Min: image.Point{xi * tileSize, yi * tileSize}, + Max: image.Point{(xi + 1) * tileSize, (yi + 1) * tileSize}, + }) + buf := new(bytes.Buffer) + if err := jpeg.Encode(buf, si, &jpeg.Options{Quality: 90}); err != nil { + log.Fatal(err) + } + row = append(row, buf.Bytes()) + } + tile = append(tile, row) + } + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + ms, _ := strconv.Atoi(r.FormValue("latency")) + const nanosPerMilli = 1e6 + if r.FormValue("x") != "" { + x, _ := strconv.Atoi(r.FormValue("x")) + y, _ := strconv.Atoi(r.FormValue("y")) + if ms <= 1000 { + time.Sleep(time.Duration(ms) * nanosPerMilli) + } + if x >= 0 && x < xt && y >= 0 && y < yt { + http.ServeContent(w, r, "", time.Time{}, bytes.NewReader(tile[y][x])) + return + } + } + io.WriteString(w, "") + fmt.Fprintf(w, "A grid of %d tiled images is below. Compare:

", xt*yt) + for _, ms := range []int{0, 30, 200, 1000} { + d := time.Duration(ms) * nanosPerMilli + fmt.Fprintf(w, "[HTTP/2, %v latency] [HTTP/1, %v latency]
\n", + httpsHost(), ms, d, + httpHost(), ms, d, + ) + } + io.WriteString(w, "

\n") + cacheBust := time.Now().UnixNano() + for y := 0; y < yt; y++ { + for x := 0; x < xt; x++ { + fmt.Fprintf(w, "", + tileSize, tileSize, x, y, cacheBust, ms) + } + io.WriteString(w, "
\n") + } + io.WriteString(w, "


<< Back to Go HTTP/2 demo server") + }) +} + +func httpsHost() string { + if *prod { + return "http2.golang.org" + } + if v := *addr; strings.HasPrefix(v, ":") { + return "localhost" + v + } else { + return v + } +} + +func httpHost() string { + if *prod { + return "http2.golang.org" + } + if v := *httpAddr; strings.HasPrefix(v, ":") { + return "localhost" + v + } else { + return v + } +} + +func serveProdTLS() error { + c, err := googlestorage.NewServiceClient() + if err != nil { + return err + } + slurp := func(key string) ([]byte, error) { + const bucket = "http2-demo-server-tls" + rc, _, err := c.GetObject(&googlestorage.Object{ + Bucket: bucket, + Key: key, + }) + if err != nil { + return nil, fmt.Errorf("Error fetching GCS object %q in bucket %q: %v", key, bucket, err) + } + defer rc.Close() + return ioutil.ReadAll(rc) + } + certPem, err := slurp("http2.golang.org.chained.pem") + if err != nil { + return err + } + keyPem, err := slurp("http2.golang.org.key") + if err != nil { + return err + } + cert, err := tls.X509KeyPair(certPem, keyPem) + if err != nil { + return err + } + srv := &http.Server{ + TLSConfig: &tls.Config{ + Certificates: []tls.Certificate{cert}, + }, + } + http2.ConfigureServer(srv, &http2.Server{}) + ln, err := net.Listen("tcp", ":443") + if err != nil { + return err + } + return srv.Serve(tls.NewListener(tcpKeepAliveListener{ln.(*net.TCPListener)}, srv.TLSConfig)) +} + +type tcpKeepAliveListener struct { + *net.TCPListener +} + +func (ln tcpKeepAliveListener) Accept() (c net.Conn, err error) { + tc, err := ln.AcceptTCP() + if err != nil { + return + } + tc.SetKeepAlive(true) + tc.SetKeepAlivePeriod(3 * time.Minute) + return tc, nil +} + +func serveProd() error { + errc := make(chan error, 2) + go func() { errc <- http.ListenAndServe(":80", nil) }() + go func() { errc <- serveProdTLS() }() + return <-errc +} + +func main() { + var srv http.Server + flag.BoolVar(&http2.VerboseLogs, "verbose", false, "Verbose HTTP/2 debugging.") + flag.Parse() + srv.Addr = *addr + + registerHandlers() + + if *prod { + *httpAddr = "http2.golang.org" + log.Fatal(serveProd()) + } + + url := "https://" + *addr + "/" + log.Printf("Listening on " + url) + http2.ConfigureServer(&srv, &http2.Server{}) + + if *httpAddr != "" { + go func() { log.Fatal(http.ListenAndServe(*httpAddr, nil)) }() + } + + go func() { + log.Fatal(srv.ListenAndServeTLS("server.crt", "server.key")) + }() + if *openFirefox && runtime.GOOS == "darwin" { + time.Sleep(250 * time.Millisecond) + exec.Command("open", "-b", "org.mozilla.nightly", "https://localhost:4430/").Run() + } + select {} +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/launch.go b/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/launch.go new file mode 100644 index 000000000..746661543 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/launch.go @@ -0,0 +1,302 @@ +// 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. + +// +build ignore + +package main + +import ( + "bufio" + "bytes" + "encoding/json" + "flag" + "fmt" + "io" + "io/ioutil" + "log" + "net/http" + "os" + "strings" + "time" + + "golang.org/x/oauth2" + "golang.org/x/oauth2/google" + compute "google.golang.org/api/compute/v1" +) + +var ( + proj = flag.String("project", "symbolic-datum-552", "name of Project") + zone = flag.String("zone", "us-central1-a", "GCE zone") + mach = flag.String("machinetype", "n1-standard-1", "Machine type") + instName = flag.String("instance_name", "http2-demo", "Name of VM instance.") + sshPub = flag.String("ssh_public_key", "", "ssh public key file to authorize. Can modify later in Google's web UI anyway.") + staticIP = flag.String("static_ip", "130.211.116.44", "Static IP to use. If empty, automatic.") + + writeObject = flag.String("write_object", "", "If non-empty, a VM isn't created and the flag value is Google Cloud Storage bucket/object to write. The contents from stdin.") + publicObject = flag.Bool("write_object_is_public", false, "Whether the object created by --write_object should be public.") +) + +func readFile(v string) string { + slurp, err := ioutil.ReadFile(v) + if err != nil { + log.Fatalf("Error reading %s: %v", v, err) + } + return strings.TrimSpace(string(slurp)) +} + +var config = &oauth2.Config{ + // The client-id and secret should be for an "Installed Application" when using + // the CLI. Later we'll use a web application with a callback. + ClientID: readFile("client-id.dat"), + ClientSecret: readFile("client-secret.dat"), + Endpoint: google.Endpoint, + Scopes: []string{ + compute.DevstorageFull_controlScope, + compute.ComputeScope, + "https://www.googleapis.com/auth/sqlservice", + "https://www.googleapis.com/auth/sqlservice.admin", + }, + RedirectURL: "urn:ietf:wg:oauth:2.0:oob", +} + +const baseConfig = `#cloud-config +coreos: + units: + - name: h2demo.service + command: start + content: | + [Unit] + Description=HTTP2 Demo + + [Service] + ExecStartPre=/bin/bash -c 'mkdir -p /opt/bin && curl -s -o /opt/bin/h2demo http://storage.googleapis.com/http2-demo-server-tls/h2demo && chmod +x /opt/bin/h2demo' + ExecStart=/opt/bin/h2demo --prod + RestartSec=5s + Restart=always + Type=simple + + [Install] + WantedBy=multi-user.target +` + +func main() { + flag.Parse() + if *proj == "" { + log.Fatalf("Missing --project flag") + } + prefix := "https://www.googleapis.com/compute/v1/projects/" + *proj + machType := prefix + "/zones/" + *zone + "/machineTypes/" + *mach + + const tokenFileName = "token.dat" + tokenFile := tokenCacheFile(tokenFileName) + tokenSource := oauth2.ReuseTokenSource(nil, tokenFile) + token, err := tokenSource.Token() + if err != nil { + if *writeObject != "" { + log.Fatalf("Can't use --write_object without a valid token.dat file already cached.") + } + log.Printf("Error getting token from %s: %v", tokenFileName, err) + log.Printf("Get auth code from %v", config.AuthCodeURL("my-state")) + fmt.Print("\nEnter auth code: ") + sc := bufio.NewScanner(os.Stdin) + sc.Scan() + authCode := strings.TrimSpace(sc.Text()) + token, err = config.Exchange(oauth2.NoContext, authCode) + if err != nil { + log.Fatalf("Error exchanging auth code for a token: %v", err) + } + if err := tokenFile.WriteToken(token); err != nil { + log.Fatalf("Error writing to %s: %v", tokenFileName, err) + } + tokenSource = oauth2.ReuseTokenSource(token, nil) + } + + oauthClient := oauth2.NewClient(oauth2.NoContext, tokenSource) + + if *writeObject != "" { + writeCloudStorageObject(oauthClient) + return + } + + computeService, _ := compute.New(oauthClient) + + natIP := *staticIP + if natIP == "" { + // Try to find it by name. + aggAddrList, err := computeService.Addresses.AggregatedList(*proj).Do() + if err != nil { + log.Fatal(err) + } + // http://godoc.org/code.google.com/p/google-api-go-client/compute/v1#AddressAggregatedList + IPLoop: + for _, asl := range aggAddrList.Items { + for _, addr := range asl.Addresses { + if addr.Name == *instName+"-ip" && addr.Status == "RESERVED" { + natIP = addr.Address + break IPLoop + } + } + } + } + + cloudConfig := baseConfig + if *sshPub != "" { + key := strings.TrimSpace(readFile(*sshPub)) + cloudConfig += fmt.Sprintf("\nssh_authorized_keys:\n - %s\n", key) + } + if os.Getenv("USER") == "bradfitz" { + cloudConfig += fmt.Sprintf("\nssh_authorized_keys:\n - %s\n", "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAwks9dwWKlRC+73gRbvYtVg0vdCwDSuIlyt4z6xa/YU/jTDynM4R4W10hm2tPjy8iR1k8XhDv4/qdxe6m07NjG/By1tkmGpm1mGwho4Pr5kbAAy/Qg+NLCSdAYnnE00FQEcFOC15GFVMOW2AzDGKisReohwH9eIzHPzdYQNPRWXE= bradfitz@papag.bradfitz.com") + } + const maxCloudConfig = 32 << 10 // per compute API docs + if len(cloudConfig) > maxCloudConfig { + log.Fatalf("cloud config length of %d bytes is over %d byte limit", len(cloudConfig), maxCloudConfig) + } + + instance := &compute.Instance{ + Name: *instName, + Description: "Go Builder", + MachineType: machType, + Disks: []*compute.AttachedDisk{instanceDisk(computeService)}, + Tags: &compute.Tags{ + Items: []string{"http-server", "https-server"}, + }, + Metadata: &compute.Metadata{ + Items: []*compute.MetadataItems{ + { + Key: "user-data", + Value: cloudConfig, + }, + }, + }, + NetworkInterfaces: []*compute.NetworkInterface{ + &compute.NetworkInterface{ + AccessConfigs: []*compute.AccessConfig{ + &compute.AccessConfig{ + Type: "ONE_TO_ONE_NAT", + Name: "External NAT", + NatIP: natIP, + }, + }, + Network: prefix + "/global/networks/default", + }, + }, + ServiceAccounts: []*compute.ServiceAccount{ + { + Email: "default", + Scopes: []string{ + compute.DevstorageFull_controlScope, + compute.ComputeScope, + }, + }, + }, + } + + log.Printf("Creating instance...") + op, err := computeService.Instances.Insert(*proj, *zone, instance).Do() + if err != nil { + log.Fatalf("Failed to create instance: %v", err) + } + opName := op.Name + log.Printf("Created. Waiting on operation %v", opName) +OpLoop: + for { + time.Sleep(2 * time.Second) + op, err := computeService.ZoneOperations.Get(*proj, *zone, opName).Do() + if err != nil { + log.Fatalf("Failed to get op %s: %v", opName, err) + } + switch op.Status { + case "PENDING", "RUNNING": + log.Printf("Waiting on operation %v", opName) + continue + case "DONE": + if op.Error != nil { + for _, operr := range op.Error.Errors { + log.Printf("Error: %+v", operr) + } + log.Fatalf("Failed to start.") + } + log.Printf("Success. %+v", op) + break OpLoop + default: + log.Fatalf("Unknown status %q: %+v", op.Status, op) + } + } + + inst, err := computeService.Instances.Get(*proj, *zone, *instName).Do() + if err != nil { + log.Fatalf("Error getting instance after creation: %v", err) + } + ij, _ := json.MarshalIndent(inst, "", " ") + log.Printf("Instance: %s", ij) +} + +func instanceDisk(svc *compute.Service) *compute.AttachedDisk { + const imageURL = "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-stable-444-5-0-v20141016" + diskName := *instName + "-disk" + + return &compute.AttachedDisk{ + AutoDelete: true, + Boot: true, + Type: "PERSISTENT", + InitializeParams: &compute.AttachedDiskInitializeParams{ + DiskName: diskName, + SourceImage: imageURL, + DiskSizeGb: 50, + }, + } +} + +func writeCloudStorageObject(httpClient *http.Client) { + content := os.Stdin + const maxSlurp = 1 << 20 + var buf bytes.Buffer + n, err := io.CopyN(&buf, content, maxSlurp) + if err != nil && err != io.EOF { + log.Fatalf("Error reading from stdin: %v, %v", n, err) + } + contentType := http.DetectContentType(buf.Bytes()) + + req, err := http.NewRequest("PUT", "https://storage.googleapis.com/"+*writeObject, io.MultiReader(&buf, content)) + if err != nil { + log.Fatal(err) + } + req.Header.Set("x-goog-api-version", "2") + if *publicObject { + req.Header.Set("x-goog-acl", "public-read") + } + req.Header.Set("Content-Type", contentType) + res, err := httpClient.Do(req) + if err != nil { + log.Fatal(err) + } + if res.StatusCode != 200 { + res.Write(os.Stderr) + log.Fatalf("Failed.") + } + log.Printf("Success.") + os.Exit(0) +} + +type tokenCacheFile string + +func (f tokenCacheFile) Token() (*oauth2.Token, error) { + slurp, err := ioutil.ReadFile(string(f)) + if err != nil { + return nil, err + } + t := new(oauth2.Token) + if err := json.Unmarshal(slurp, t); err != nil { + return nil, err + } + return t, nil +} + +func (f tokenCacheFile) WriteToken(t *oauth2.Token) error { + jt, err := json.Marshal(t) + if err != nil { + return err + } + return ioutil.WriteFile(string(f), jt, 0600) +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/rootCA.key b/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/rootCA.key new file mode 100644 index 000000000..a15a6abaf --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/rootCA.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEAt5fAjp4fTcekWUTfzsp0kyih1OYbsGL0KX1eRbSSR8Od0+9Q +62Hyny+GFwMTb4A/KU8mssoHvcceSAAbwfbxFK/+s51TobqUnORZrOoTZjkUygby +XDSK99YBbcR1Pip8vwMTm4XKuLtCigeBBdjjAQdgUO28LENGlsMnmeYkJfODVGnV +mr5Ltb9ANA8IKyTfsnHJ4iOCS/PlPbUj2q7YnoVLposUBMlgUb/CykX3mOoLb4yJ +JQyA/iST6ZxiIEj36D4yWZ5lg7YJl+UiiBQHGCnPdGyipqV06ex0heYWcaiW8LWZ +SUQ93jQ+WVCH8hT7DQO1dmsvUmXlq/JeAlwQ/QIDAQABAoIBAFFHV7JMAqPWnMYA +nezY6J81v9+XN+7xABNWM2Q8uv4WdksbigGLTXR3/680Z2hXqJ7LMeC5XJACFT/e +/Gr0vmpgOCygnCPfjGehGKpavtfksXV3edikUlnCXsOP1C//c1bFL+sMYmFCVgTx +qYdDK8yKzXNGrKYT6q5YG7IglyRNV1rsQa8lM/5taFYiD1Ck/3tQi3YIq8Lcuser +hrxsMABcQ6mi+EIvG6Xr4mfJug0dGJMHG4RG1UGFQn6RXrQq2+q53fC8ZbVUSi0j +NQ918aKFzktwv+DouKU0ME4I9toks03gM860bAL7zCbKGmwR3hfgX/TqzVCWpG9E +LDVfvekCgYEA8fk9N53jbBRmULUGEf4qWypcLGiZnNU0OeXWpbPV9aa3H0VDytA7 +8fCN2dPAVDPqlthMDdVe983NCNwp2Yo8ZimDgowyIAKhdC25s1kejuaiH9OAPj3c +0f8KbriYX4n8zNHxFwK6Ae3pQ6EqOLJVCUsziUaZX9nyKY5aZlyX6xcCgYEAwjws +K62PjC64U5wYddNLp+kNdJ4edx+a7qBb3mEgPvSFT2RO3/xafJyG8kQB30Mfstjd +bRxyUV6N0vtX1zA7VQtRUAvfGCecpMo+VQZzcHXKzoRTnQ7eZg4Lmj5fQ9tOAKAo +QCVBoSW/DI4PZL26CAMDcAba4Pa22ooLapoRIQsCgYA6pIfkkbxLNkpxpt2YwLtt +Kr/590O7UaR9n6k8sW/aQBRDXNsILR1KDl2ifAIxpf9lnXgZJiwE7HiTfCAcW7c1 +nzwDCI0hWuHcMTS/NYsFYPnLsstyyjVZI3FY0h4DkYKV9Q9z3zJLQ2hz/nwoD3gy +b2pHC7giFcTts1VPV4Nt8wKBgHeFn4ihHJweg76vZz3Z78w7VNRWGFklUalVdDK7 +gaQ7w2y/ROn/146mo0OhJaXFIFRlrpvdzVrU3GDf2YXJYDlM5ZRkObwbZADjksev +WInzcgDy3KDg7WnPasRXbTfMU4t/AkW2p1QKbi3DnSVYuokDkbH2Beo45vxDxhKr +C69RAoGBAIyo3+OJenoZmoNzNJl2WPW5MeBUzSh8T/bgyjFTdqFHF5WiYRD/lfHj +x9Glyw2nutuT4hlOqHvKhgTYdDMsF2oQ72fe3v8Q5FU7FuKndNPEAyvKNXZaShVA +hnlhv5DjXKb0wFWnt5PCCiQLtzG0yyHaITrrEme7FikkIcTxaX/Y +-----END RSA PRIVATE KEY----- diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/rootCA.srl b/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/rootCA.srl new file mode 100644 index 000000000..6db389188 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/rootCA.srl @@ -0,0 +1 @@ +E2CE26BF3285059C diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/server.crt b/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/server.crt new file mode 100644 index 000000000..c59059bd6 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/server.crt @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDPjCCAiYCCQDizia/MoUFnDANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJV +UzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28xFDASBgNVBAoT +C0JyYWRmaXR6aW5jMRIwEAYDVQQDEwlsb2NhbGhvc3QxHTAbBgkqhkiG9w0BCQEW +DmJyYWRAZGFuZ2EuY29tMB4XDTE0MDcxNTIwNTAyN1oXDTE1MTEyNzIwNTAyN1ow +RzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMQswCQYDVQQHEwJTRjEeMBwGA1UE +ChMVYnJhZGZpdHogaHR0cDIgc2VydmVyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAs1Y9CyLFrdL8VQWN1WaifDqaZFnoqjHhCMlc1TfG2zA+InDifx2l +gZD3o8FeNnAcfM2sPlk3+ZleOYw9P/CklFVDlvqmpCv9ss/BEp/dDaWvy1LmJ4c2 +dbQJfmTxn7CV1H3TsVJvKdwFmdoABb41NoBp6+NNO7OtDyhbIMiCI0pL3Nefb3HL +A7hIMo3DYbORTtJLTIH9W8YKrEWL0lwHLrYFx/UdutZnv+HjdmO6vCN4na55mjws +/vjKQUmc7xeY7Xe20xDEG2oDKVkL2eD7FfyrYMS3rO1ExP2KSqlXYG/1S9I/fz88 +F0GK7HX55b5WjZCl2J3ERVdnv/0MQv+sYQIDAQABMA0GCSqGSIb3DQEBBQUAA4IB +AQC0zL+n/YpRZOdulSu9tS8FxrstXqGWoxfe+vIUgqfMZ5+0MkjJ/vW0FqlLDl2R +rn4XaR3e7FmWkwdDVbq/UB6lPmoAaFkCgh9/5oapMaclNVNnfF3fjCJfRr+qj/iD +EmJStTIN0ZuUjAlpiACmfnpEU55PafT5Zx+i1yE4FGjw8bJpFoyD4Hnm54nGjX19 +KeCuvcYFUPnBm3lcL0FalF2AjqV02WTHYNQk7YF/oeO7NKBoEgvGvKG3x+xaOeBI +dwvdq175ZsGul30h+QjrRlXhH/twcuaT3GSdoysDl9cCYE8f1Mk8PD6gan3uBCJU +90p6/CbU71bGbfpM2PHot2fm +-----END CERTIFICATE----- diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/server.key b/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/server.key new file mode 100644 index 000000000..f329c1421 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/h2demo/server.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEAs1Y9CyLFrdL8VQWN1WaifDqaZFnoqjHhCMlc1TfG2zA+InDi +fx2lgZD3o8FeNnAcfM2sPlk3+ZleOYw9P/CklFVDlvqmpCv9ss/BEp/dDaWvy1Lm +J4c2dbQJfmTxn7CV1H3TsVJvKdwFmdoABb41NoBp6+NNO7OtDyhbIMiCI0pL3Nef +b3HLA7hIMo3DYbORTtJLTIH9W8YKrEWL0lwHLrYFx/UdutZnv+HjdmO6vCN4na55 +mjws/vjKQUmc7xeY7Xe20xDEG2oDKVkL2eD7FfyrYMS3rO1ExP2KSqlXYG/1S9I/ +fz88F0GK7HX55b5WjZCl2J3ERVdnv/0MQv+sYQIDAQABAoIBADQ2spUwbY+bcz4p +3M66ECrNQTBggP40gYl2XyHxGGOu2xhZ94f9ELf1hjRWU2DUKWco1rJcdZClV6q3 +qwmXvcM2Q/SMS8JW0ImkNVl/0/NqPxGatEnj8zY30d/L8hGFb0orzFu/XYA5gCP4 +NbN2WrXgk3ZLeqwcNxHHtSiJWGJ/fPyeDWAu/apy75u9Xf2GlzBZmV6HYD9EfK80 +LTlI60f5FO487CrJnboL7ovPJrIHn+k05xRQqwma4orpz932rTXnTjs9Lg6KtbQN +a7PrqfAntIISgr11a66Mng3IYH1lYqJsWJJwX/xHT4WLEy0EH4/0+PfYemJekz2+ +Co62drECgYEA6O9zVJZXrLSDsIi54cfxA7nEZWm5CAtkYWeAHa4EJ+IlZ7gIf9sL +W8oFcEfFGpvwVqWZ+AsQ70dsjXAv3zXaG0tmg9FtqWp7pzRSMPidifZcQwWkKeTO +gJnFmnVyed8h6GfjTEu4gxo1/S5U0V+mYSha01z5NTnN6ltKx1Or3b0CgYEAxRgm +S30nZxnyg/V7ys61AZhst1DG2tkZXEMcA7dYhabMoXPJAP/EfhlWwpWYYUs/u0gS +Wwmf5IivX5TlYScgmkvb/NYz0u4ZmOXkLTnLPtdKKFXhjXJcHjUP67jYmOxNlJLp +V4vLRnFxTpffAV+OszzRxsXX6fvruwZBANYJeXUCgYBVouLFsFgfWGYp2rpr9XP4 +KK25kvrBqF6JKOIDB1zjxNJ3pUMKrl8oqccCFoCyXa4oTM2kUX0yWxHfleUjrMq4 +yimwQKiOZmV7fVLSSjSw6e/VfBd0h3gb82ygcplZkN0IclkwTY5SNKqwn/3y07V5 +drqdhkrgdJXtmQ6O5YYECQKBgATERcDToQ1USlI4sKrB/wyv1AlG8dg/IebiVJ4e +ZAyvcQmClFzq0qS+FiQUnB/WQw9TeeYrwGs1hxBHuJh16srwhLyDrbMvQP06qh8R +48F8UXXSRec22dV9MQphaROhu2qZdv1AC0WD3tqov6L33aqmEOi+xi8JgbT/PLk5 +c/c1AoGBAI1A/02ryksW6/wc7/6SP2M2rTy4m1sD/GnrTc67EHnRcVBdKO6qH2RY +nqC8YcveC2ZghgPTDsA3VGuzuBXpwY6wTyV99q6jxQJ6/xcrD9/NUG6Uwv/xfCxl +IJLeBYEqQundSSny3VtaAUK8Ul1nxpTvVRNwtcyWTo8RHAAyNPWd +-----END RSA PRIVATE KEY----- diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/h2i/README.md b/Godeps/_workspace/src/github.com/bradfitz/http2/h2i/README.md new file mode 100644 index 000000000..3ceecb7d1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/h2i/README.md @@ -0,0 +1,97 @@ +# h2i + +**h2i** is an interactive HTTP/2 ("h2") console debugger. Miss the good ol' +days of telnetting to your HTTP/1.n servers? We're bringing you +back. + +Features: +- send raw HTTP/2 frames + - PING + - SETTINGS + - HEADERS + - etc +- type in HTTP/1.n and have it auto-HPACK/frame-ify it for HTTP/2 +- pretty print all received HTTP/2 frames from the peer (including HPACK decoding) +- tab completion of commands, options + +Not yet features, but soon: +- unnecessary CONTINUATION frames on short boundaries, to test peer implementations +- request bodies (DATA frames) +- send invalid frames for testing server implementations (supported by underlying Framer) + +Later: +- act like a server + +## Installation + +``` +$ go get github.com/bradfitz/http2/h2i +$ h2i +``` + +## Demo + +``` +$ h2i +Usage: h2i + + -insecure + Whether to skip TLS cert validation + -nextproto string + Comma-separated list of NPN/ALPN protocol names to negotiate. (default "h2,h2-14") + +$ h2i google.com +Connecting to google.com:443 ... +Connected to 74.125.224.41:443 +Negotiated protocol "h2-14" +[FrameHeader SETTINGS len=18] + [MAX_CONCURRENT_STREAMS = 100] + [INITIAL_WINDOW_SIZE = 1048576] + [MAX_FRAME_SIZE = 16384] +[FrameHeader WINDOW_UPDATE len=4] + Window-Increment = 983041 + +h2i> PING h2iSayHI +[FrameHeader PING flags=ACK len=8] + Data = "h2iSayHI" +h2i> headers +(as HTTP/1.1)> GET / HTTP/1.1 +(as HTTP/1.1)> Host: ip.appspot.com +(as HTTP/1.1)> User-Agent: h2i/brad-n-blake +(as HTTP/1.1)> +Opening Stream-ID 1: + :authority = ip.appspot.com + :method = GET + :path = / + :scheme = https + user-agent = h2i/brad-n-blake +[FrameHeader HEADERS flags=END_HEADERS stream=1 len=77] + :status = "200" + alternate-protocol = "443:quic,p=1" + content-length = "15" + content-type = "text/html" + date = "Fri, 01 May 2015 23:06:56 GMT" + server = "Google Frontend" +[FrameHeader DATA flags=END_STREAM stream=1 len=15] + "173.164.155.78\n" +[FrameHeader PING len=8] + Data = "\x00\x00\x00\x00\x00\x00\x00\x00" +h2i> ping +[FrameHeader PING flags=ACK len=8] + Data = "h2i_ping" +h2i> ping +[FrameHeader PING flags=ACK len=8] + Data = "h2i_ping" +h2i> ping +[FrameHeader GOAWAY len=22] + Last-Stream-ID = 1; Error-Code = PROTOCOL_ERROR (1) + +ReadFrame: EOF +``` + +## Status + +Quick few hour hack. So much yet to do. Feel free to file issues for +bugs or wishlist items, but [@bmizerany](https://github.com/bmizerany/) +and I aren't yet accepting pull requests until things settle down. + diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/h2i/h2i.go b/Godeps/_workspace/src/github.com/bradfitz/http2/h2i/h2i.go new file mode 100644 index 000000000..67b874d6b --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/h2i/h2i.go @@ -0,0 +1,489 @@ +// Copyright 2015 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. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +/* +The h2i command is an interactive HTTP/2 console. + +Usage: + $ h2i [flags] + +Interactive commands in the console: (all parts case-insensitive) + + ping [data] + settings ack + settings FOO=n BAR=z + headers (open a new stream by typing HTTP/1.1) +*/ +package main + +import ( + "bufio" + "bytes" + "crypto/tls" + "errors" + "flag" + "fmt" + "io" + "log" + "net" + "net/http" + "os" + "regexp" + "strconv" + "strings" + + "github.com/bradfitz/http2" + "github.com/bradfitz/http2/hpack" + "golang.org/x/crypto/ssh/terminal" +) + +// Flags +var ( + flagNextProto = flag.String("nextproto", "h2,h2-14", "Comma-separated list of NPN/ALPN protocol names to negotiate.") + flagInsecure = flag.Bool("insecure", false, "Whether to skip TLS cert validation") +) + +type command struct { + run func(*h2i, []string) error // required + + // complete optionally specifies tokens (case-insensitive) which are + // valid for this subcommand. + complete func() []string +} + +var commands = map[string]command{ + "ping": command{run: (*h2i).cmdPing}, + "settings": command{ + run: (*h2i).cmdSettings, + complete: func() []string { + return []string{ + "ACK", + http2.SettingHeaderTableSize.String(), + http2.SettingEnablePush.String(), + http2.SettingMaxConcurrentStreams.String(), + http2.SettingInitialWindowSize.String(), + http2.SettingMaxFrameSize.String(), + http2.SettingMaxHeaderListSize.String(), + } + }, + }, + "quit": command{run: (*h2i).cmdQuit}, + "headers": command{run: (*h2i).cmdHeaders}, +} + +func usage() { + fmt.Fprintf(os.Stderr, "Usage: h2i \n\n") + flag.PrintDefaults() + os.Exit(1) +} + +// withPort adds ":443" if another port isn't already present. +func withPort(host string) string { + if _, _, err := net.SplitHostPort(host); err != nil { + return net.JoinHostPort(host, "443") + } + return host +} + +// h2i is the app's state. +type h2i struct { + host string + tc *tls.Conn + framer *http2.Framer + term *terminal.Terminal + + // owned by the command loop: + streamID uint32 + hbuf bytes.Buffer + henc *hpack.Encoder + + // owned by the readFrames loop: + peerSetting map[http2.SettingID]uint32 + hdec *hpack.Decoder +} + +func main() { + flag.Usage = usage + flag.Parse() + if flag.NArg() != 1 { + usage() + } + log.SetFlags(0) + + host := flag.Arg(0) + app := &h2i{ + host: host, + peerSetting: make(map[http2.SettingID]uint32), + } + app.henc = hpack.NewEncoder(&app.hbuf) + + if err := app.Main(); err != nil { + if app.term != nil { + app.logf("%v\n", err) + } else { + fmt.Fprintf(os.Stderr, "%v\n", err) + } + os.Exit(1) + } + fmt.Fprintf(os.Stdout, "\n") +} + +func (app *h2i) Main() error { + cfg := &tls.Config{ + ServerName: app.host, + NextProtos: strings.Split(*flagNextProto, ","), + InsecureSkipVerify: *flagInsecure, + } + + hostAndPort := withPort(app.host) + log.Printf("Connecting to %s ...", hostAndPort) + tc, err := tls.Dial("tcp", hostAndPort, cfg) + if err != nil { + return fmt.Errorf("Error dialing %s: %v", withPort(app.host), err) + } + log.Printf("Connected to %v", tc.RemoteAddr()) + defer tc.Close() + + if err := tc.Handshake(); err != nil { + return fmt.Errorf("TLS handshake: %v", err) + } + if !*flagInsecure { + if err := tc.VerifyHostname(app.host); err != nil { + return fmt.Errorf("VerifyHostname: %v", err) + } + } + state := tc.ConnectionState() + log.Printf("Negotiated protocol %q", state.NegotiatedProtocol) + if !state.NegotiatedProtocolIsMutual || state.NegotiatedProtocol == "" { + return fmt.Errorf("Could not negotiate protocol mutually") + } + + if _, err := io.WriteString(tc, http2.ClientPreface); err != nil { + return err + } + + app.framer = http2.NewFramer(tc, tc) + + oldState, err := terminal.MakeRaw(0) + if err != nil { + return err + } + defer terminal.Restore(0, oldState) + + var screen = struct { + io.Reader + io.Writer + }{os.Stdin, os.Stdout} + + app.term = terminal.NewTerminal(screen, "h2i> ") + lastWord := regexp.MustCompile(`.+\W(\w+)$`) + app.term.AutoCompleteCallback = func(line string, pos int, key rune) (newLine string, newPos int, ok bool) { + if key != '\t' { + return + } + if pos != len(line) { + // TODO: we're being lazy for now, only supporting tab completion at the end. + return + } + // Auto-complete for the command itself. + if !strings.Contains(line, " ") { + var name string + name, _, ok = lookupCommand(line) + if !ok { + return + } + return name, len(name), true + } + _, c, ok := lookupCommand(line[:strings.IndexByte(line, ' ')]) + if !ok || c.complete == nil { + return + } + if strings.HasSuffix(line, " ") { + app.logf("%s", strings.Join(c.complete(), " ")) + return line, pos, true + } + m := lastWord.FindStringSubmatch(line) + if m == nil { + return line, len(line), true + } + soFar := m[1] + var match []string + for _, cand := range c.complete() { + if len(soFar) > len(cand) || !strings.EqualFold(cand[:len(soFar)], soFar) { + continue + } + match = append(match, cand) + } + if len(match) == 0 { + return + } + if len(match) > 1 { + // TODO: auto-complete any common prefix + app.logf("%s", strings.Join(match, " ")) + return line, pos, true + } + newLine = line[:len(line)-len(soFar)] + match[0] + return newLine, len(newLine), true + + } + + errc := make(chan error, 2) + go func() { errc <- app.readFrames() }() + go func() { errc <- app.readConsole() }() + return <-errc +} + +func (app *h2i) logf(format string, args ...interface{}) { + fmt.Fprintf(app.term, format+"\n", args...) +} + +func (app *h2i) readConsole() error { + for { + line, err := app.term.ReadLine() + if err == io.EOF { + return nil + } + if err != nil { + return fmt.Errorf("terminal.ReadLine: %v", err) + } + f := strings.Fields(line) + if len(f) == 0 { + continue + } + cmd, args := f[0], f[1:] + if _, c, ok := lookupCommand(cmd); ok { + err = c.run(app, args) + } else { + app.logf("Unknown command %q", line) + } + if err == errExitApp { + return nil + } + if err != nil { + return err + } + } +} + +func lookupCommand(prefix string) (name string, c command, ok bool) { + prefix = strings.ToLower(prefix) + if c, ok = commands[prefix]; ok { + return prefix, c, ok + } + + for full, candidate := range commands { + if strings.HasPrefix(full, prefix) { + if c.run != nil { + return "", command{}, false // ambiguous + } + c = candidate + name = full + } + } + return name, c, c.run != nil +} + +var errExitApp = errors.New("internal sentinel error value to quit the console reading loop") + +func (a *h2i) cmdQuit(args []string) error { + if len(args) > 0 { + a.logf("the QUIT command takes no argument") + return nil + } + return errExitApp +} + +func (a *h2i) cmdSettings(args []string) error { + if len(args) == 1 && strings.EqualFold(args[0], "ACK") { + return a.framer.WriteSettingsAck() + } + var settings []http2.Setting + for _, arg := range args { + if strings.EqualFold(arg, "ACK") { + a.logf("Error: ACK must be only argument with the SETTINGS command") + return nil + } + eq := strings.Index(arg, "=") + if eq == -1 { + a.logf("Error: invalid argument %q (expected SETTING_NAME=nnnn)", arg) + return nil + } + sid, ok := settingByName(arg[:eq]) + if !ok { + a.logf("Error: unknown setting name %q", arg[:eq]) + return nil + } + val, err := strconv.ParseUint(arg[eq+1:], 10, 32) + if err != nil { + a.logf("Error: invalid argument %q (expected SETTING_NAME=nnnn)", arg) + return nil + } + settings = append(settings, http2.Setting{ + ID: sid, + Val: uint32(val), + }) + } + a.logf("Sending: %v", settings) + return a.framer.WriteSettings(settings...) +} + +func settingByName(name string) (http2.SettingID, bool) { + for _, sid := range [...]http2.SettingID{ + http2.SettingHeaderTableSize, + http2.SettingEnablePush, + http2.SettingMaxConcurrentStreams, + http2.SettingInitialWindowSize, + http2.SettingMaxFrameSize, + http2.SettingMaxHeaderListSize, + } { + if strings.EqualFold(sid.String(), name) { + return sid, true + } + } + return 0, false +} + +func (app *h2i) cmdPing(args []string) error { + if len(args) > 1 { + app.logf("invalid PING usage: only accepts 0 or 1 args") + return nil // nil means don't end the program + } + var data [8]byte + if len(args) == 1 { + copy(data[:], args[0]) + } else { + copy(data[:], "h2i_ping") + } + return app.framer.WritePing(false, data) +} + +func (app *h2i) cmdHeaders(args []string) error { + if len(args) > 0 { + app.logf("Error: HEADERS doesn't yet take arguments.") + // TODO: flags for restricting window size, to force CONTINUATION + // frames. + return nil + } + var h1req bytes.Buffer + app.term.SetPrompt("(as HTTP/1.1)> ") + defer app.term.SetPrompt("h2i> ") + for { + line, err := app.term.ReadLine() + if err != nil { + return err + } + h1req.WriteString(line) + h1req.WriteString("\r\n") + if line == "" { + break + } + } + req, err := http.ReadRequest(bufio.NewReader(&h1req)) + if err != nil { + app.logf("Invalid HTTP/1.1 request: %v", err) + return nil + } + if app.streamID == 0 { + app.streamID = 1 + } else { + app.streamID += 2 + } + app.logf("Opening Stream-ID %d:", app.streamID) + hbf := app.encodeHeaders(req) + if len(hbf) > 16<<10 { + app.logf("TODO: h2i doesn't yet write CONTINUATION frames. Copy it from transport.go") + return nil + } + return app.framer.WriteHeaders(http2.HeadersFrameParam{ + StreamID: app.streamID, + BlockFragment: hbf, + EndStream: req.Method == "GET" || req.Method == "HEAD", // good enough for now + EndHeaders: true, // for now + }) +} + +func (app *h2i) readFrames() error { + for { + f, err := app.framer.ReadFrame() + if err != nil { + return fmt.Errorf("ReadFrame: %v", err) + } + app.logf("%v", f) + switch f := f.(type) { + case *http2.PingFrame: + app.logf(" Data = %q", f.Data) + case *http2.SettingsFrame: + f.ForeachSetting(func(s http2.Setting) error { + app.logf(" %v", s) + app.peerSetting[s.ID] = s.Val + return nil + }) + case *http2.WindowUpdateFrame: + app.logf(" Window-Increment = %v\n", f.Increment) + case *http2.GoAwayFrame: + app.logf(" Last-Stream-ID = %d; Error-Code = %v (%d)\n", f.LastStreamID, f.ErrCode, f.ErrCode) + case *http2.DataFrame: + app.logf(" %q", f.Data()) + case *http2.HeadersFrame: + if f.HasPriority() { + app.logf(" PRIORITY = %v", f.Priority) + } + if app.hdec == nil { + // TODO: if the user uses h2i to send a SETTINGS frame advertising + // something larger, we'll need to respect SETTINGS_HEADER_TABLE_SIZE + // and stuff here instead of using the 4k default. But for now: + tableSize := uint32(4 << 10) + app.hdec = hpack.NewDecoder(tableSize, app.onNewHeaderField) + } + app.hdec.Write(f.HeaderBlockFragment()) + } + } +} + +// called from readLoop +func (app *h2i) onNewHeaderField(f hpack.HeaderField) { + if f.Sensitive { + app.logf(" %s = %q (SENSITIVE)", f.Name, f.Value) + } + app.logf(" %s = %q", f.Name, f.Value) +} + +func (app *h2i) encodeHeaders(req *http.Request) []byte { + app.hbuf.Reset() + + // TODO(bradfitz): figure out :authority-vs-Host stuff between http2 and Go + host := req.Host + if host == "" { + host = req.URL.Host + } + + path := req.URL.Path + if path == "" { + path = "/" + } + + app.writeHeader(":authority", host) // probably not right for all sites + app.writeHeader(":method", req.Method) + app.writeHeader(":path", path) + app.writeHeader(":scheme", "https") + + for k, vv := range req.Header { + lowKey := strings.ToLower(k) + if lowKey == "host" { + continue + } + for _, v := range vv { + app.writeHeader(lowKey, v) + } + } + return app.hbuf.Bytes() +} + +func (app *h2i) writeHeader(name, value string) { + app.henc.WriteField(hpack.HeaderField{Name: name, Value: value}) + app.logf(" %s = %s", name, value) +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/headermap.go b/Godeps/_workspace/src/github.com/bradfitz/http2/headermap.go new file mode 100644 index 000000000..67c7c4835 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/headermap.go @@ -0,0 +1,80 @@ +// 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. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +package http2 + +import ( + "net/http" + "strings" +) + +var ( + commonLowerHeader = map[string]string{} // Go-Canonical-Case -> lower-case + commonCanonHeader = map[string]string{} // lower-case -> Go-Canonical-Case +) + +func init() { + for _, v := range []string{ + "accept", + "accept-charset", + "accept-encoding", + "accept-language", + "accept-ranges", + "age", + "access-control-allow-origin", + "allow", + "authorization", + "cache-control", + "content-disposition", + "content-encoding", + "content-language", + "content-length", + "content-location", + "content-range", + "content-type", + "cookie", + "date", + "etag", + "expect", + "expires", + "from", + "host", + "if-match", + "if-modified-since", + "if-none-match", + "if-unmodified-since", + "last-modified", + "link", + "location", + "max-forwards", + "proxy-authenticate", + "proxy-authorization", + "range", + "referer", + "refresh", + "retry-after", + "server", + "set-cookie", + "strict-transport-security", + "transfer-encoding", + "user-agent", + "vary", + "via", + "www-authenticate", + } { + chk := http.CanonicalHeaderKey(v) + commonLowerHeader[chk] = v + commonCanonHeader[v] = chk + } +} + +func lowerHeader(v string) string { + if s, ok := commonLowerHeader[v]; ok { + return s + } + return strings.ToLower(v) +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/hpack/encode.go b/Godeps/_workspace/src/github.com/bradfitz/http2/hpack/encode.go new file mode 100644 index 000000000..19bd9f4fc --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/hpack/encode.go @@ -0,0 +1,252 @@ +// Copyright 2014 The Go Authors. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +package hpack + +import ( + "io" +) + +const ( + uint32Max = ^uint32(0) + initialHeaderTableSize = 4096 +) + +type Encoder struct { + dynTab dynamicTable + // minSize is the minimum table size set by + // SetMaxDynamicTableSize after the previous Header Table Size + // Update. + minSize uint32 + // maxSizeLimit is the maximum table size this encoder + // supports. This will protect the encoder from too large + // size. + maxSizeLimit uint32 + // tableSizeUpdate indicates whether "Header Table Size + // Update" is required. + tableSizeUpdate bool + w io.Writer + buf []byte +} + +// NewEncoder returns a new Encoder which performs HPACK encoding. An +// encoded data is written to w. +func NewEncoder(w io.Writer) *Encoder { + e := &Encoder{ + minSize: uint32Max, + maxSizeLimit: initialHeaderTableSize, + tableSizeUpdate: false, + w: w, + } + e.dynTab.setMaxSize(initialHeaderTableSize) + return e +} + +// WriteField encodes f into a single Write to e's underlying Writer. +// This function may also produce bytes for "Header Table Size Update" +// if necessary. If produced, it is done before encoding f. +func (e *Encoder) WriteField(f HeaderField) error { + e.buf = e.buf[:0] + + if e.tableSizeUpdate { + e.tableSizeUpdate = false + if e.minSize < e.dynTab.maxSize { + e.buf = appendTableSize(e.buf, e.minSize) + } + e.minSize = uint32Max + e.buf = appendTableSize(e.buf, e.dynTab.maxSize) + } + + idx, nameValueMatch := e.searchTable(f) + if nameValueMatch { + e.buf = appendIndexed(e.buf, idx) + } else { + indexing := e.shouldIndex(f) + if indexing { + e.dynTab.add(f) + } + + if idx == 0 { + e.buf = appendNewName(e.buf, f, indexing) + } else { + e.buf = appendIndexedName(e.buf, f, idx, indexing) + } + } + n, err := e.w.Write(e.buf) + if err == nil && n != len(e.buf) { + err = io.ErrShortWrite + } + return err +} + +// searchTable searches f in both stable and dynamic header tables. +// The static header table is searched first. Only when there is no +// exact match for both name and value, the dynamic header table is +// then searched. If there is no match, i is 0. If both name and value +// match, i is the matched index and nameValueMatch becomes true. If +// only name matches, i points to that index and nameValueMatch +// becomes false. +func (e *Encoder) searchTable(f HeaderField) (i uint64, nameValueMatch bool) { + for idx, hf := range staticTable { + if !constantTimeStringCompare(hf.Name, f.Name) { + continue + } + if i == 0 { + i = uint64(idx + 1) + } + if f.Sensitive { + continue + } + if !constantTimeStringCompare(hf.Value, f.Value) { + continue + } + i = uint64(idx + 1) + nameValueMatch = true + return + } + + j, nameValueMatch := e.dynTab.search(f) + if nameValueMatch || (i == 0 && j != 0) { + i = j + uint64(len(staticTable)) + } + return +} + +// SetMaxDynamicTableSize changes the dynamic header table size to v. +// The actual size is bounded by the value passed to +// SetMaxDynamicTableSizeLimit. +func (e *Encoder) SetMaxDynamicTableSize(v uint32) { + if v > e.maxSizeLimit { + v = e.maxSizeLimit + } + if v < e.minSize { + e.minSize = v + } + e.tableSizeUpdate = true + e.dynTab.setMaxSize(v) +} + +// SetMaxDynamicTableSizeLimit changes the maximum value that can be +// specified in SetMaxDynamicTableSize to v. By default, it is set to +// 4096, which is the same size of the default dynamic header table +// size described in HPACK specification. If the current maximum +// dynamic header table size is strictly greater than v, "Header Table +// Size Update" will be done in the next WriteField call and the +// maximum dynamic header table size is truncated to v. +func (e *Encoder) SetMaxDynamicTableSizeLimit(v uint32) { + e.maxSizeLimit = v + if e.dynTab.maxSize > v { + e.tableSizeUpdate = true + e.dynTab.setMaxSize(v) + } +} + +// shouldIndex reports whether f should be indexed. +func (e *Encoder) shouldIndex(f HeaderField) bool { + return !f.Sensitive && f.size() <= e.dynTab.maxSize +} + +// appendIndexed appends index i, as encoded in "Indexed Header Field" +// representation, to dst and returns the extended buffer. +func appendIndexed(dst []byte, i uint64) []byte { + first := len(dst) + dst = appendVarInt(dst, 7, i) + dst[first] |= 0x80 + return dst +} + +// appendNewName appends f, as encoded in one of "Literal Header field +// - New Name" representation variants, to dst and returns the +// extended buffer. +// +// If f.Sensitive is true, "Never Indexed" representation is used. If +// f.Sensitive is false and indexing is true, "Inremental Indexing" +// representation is used. +func appendNewName(dst []byte, f HeaderField, indexing bool) []byte { + dst = append(dst, encodeTypeByte(indexing, f.Sensitive)) + dst = appendHpackString(dst, f.Name) + return appendHpackString(dst, f.Value) +} + +// appendIndexedName appends f and index i referring indexed name +// entry, as encoded in one of "Literal Header field - Indexed Name" +// representation variants, to dst and returns the extended buffer. +// +// If f.Sensitive is true, "Never Indexed" representation is used. If +// f.Sensitive is false and indexing is true, "Incremental Indexing" +// representation is used. +func appendIndexedName(dst []byte, f HeaderField, i uint64, indexing bool) []byte { + first := len(dst) + var n byte + if indexing { + n = 6 + } else { + n = 4 + } + dst = appendVarInt(dst, n, i) + dst[first] |= encodeTypeByte(indexing, f.Sensitive) + return appendHpackString(dst, f.Value) +} + +// appendTableSize appends v, as encoded in "Header Table Size Update" +// representation, to dst and returns the extended buffer. +func appendTableSize(dst []byte, v uint32) []byte { + first := len(dst) + dst = appendVarInt(dst, 5, uint64(v)) + dst[first] |= 0x20 + return dst +} + +// appendVarInt appends i, as encoded in variable integer form using n +// bit prefix, to dst and returns the extended buffer. +// +// See +// http://http2.github.io/http2-spec/compression.html#integer.representation +func appendVarInt(dst []byte, n byte, i uint64) []byte { + k := uint64((1 << n) - 1) + if i < k { + return append(dst, byte(i)) + } + dst = append(dst, byte(k)) + i -= k + for ; i >= 128; i >>= 7 { + dst = append(dst, byte(0x80|(i&0x7f))) + } + return append(dst, byte(i)) +} + +// appendHpackString appends s, as encoded in "String Literal" +// representation, to dst and returns the the extended buffer. +// +// s will be encoded in Huffman codes only when it produces strictly +// shorter byte string. +func appendHpackString(dst []byte, s string) []byte { + huffmanLength := HuffmanEncodeLength(s) + if huffmanLength < uint64(len(s)) { + first := len(dst) + dst = appendVarInt(dst, 7, huffmanLength) + dst = AppendHuffmanString(dst, s) + dst[first] |= 0x80 + } else { + dst = appendVarInt(dst, 7, uint64(len(s))) + dst = append(dst, s...) + } + return dst +} + +// encodeTypeByte returns type byte. If sensitive is true, type byte +// for "Never Indexed" representation is returned. If sensitive is +// false and indexing is true, type byte for "Incremental Indexing" +// representation is returned. Otherwise, type byte for "Without +// Indexing" is returned. +func encodeTypeByte(indexing, sensitive bool) byte { + if sensitive { + return 0x10 + } + if indexing { + return 0x40 + } + return 0 +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/hpack/encode_test.go b/Godeps/_workspace/src/github.com/bradfitz/http2/hpack/encode_test.go new file mode 100644 index 000000000..dce66c90f --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/hpack/encode_test.go @@ -0,0 +1,331 @@ +// Copyright 2014 The Go Authors. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +package hpack + +import ( + "bytes" + "encoding/hex" + "reflect" + "strings" + "testing" +) + +func TestEncoderTableSizeUpdate(t *testing.T) { + tests := []struct { + size1, size2 uint32 + wantHex string + }{ + // Should emit 2 table size updates (2048 and 4096) + {2048, 4096, "3fe10f 3fe11f 82"}, + + // Should emit 1 table size update (2048) + {16384, 2048, "3fe10f 82"}, + } + for _, tt := range tests { + var buf bytes.Buffer + e := NewEncoder(&buf) + e.SetMaxDynamicTableSize(tt.size1) + e.SetMaxDynamicTableSize(tt.size2) + if err := e.WriteField(pair(":method", "GET")); err != nil { + t.Fatal(err) + } + want := removeSpace(tt.wantHex) + if got := hex.EncodeToString(buf.Bytes()); got != want { + t.Errorf("e.SetDynamicTableSize %v, %v = %q; want %q", tt.size1, tt.size2, got, want) + } + } +} + +func TestEncoderWriteField(t *testing.T) { + var buf bytes.Buffer + e := NewEncoder(&buf) + var got []HeaderField + d := NewDecoder(4<<10, func(f HeaderField) { + got = append(got, f) + }) + + tests := []struct { + hdrs []HeaderField + }{ + {[]HeaderField{ + pair(":method", "GET"), + pair(":scheme", "http"), + pair(":path", "/"), + pair(":authority", "www.example.com"), + }}, + {[]HeaderField{ + pair(":method", "GET"), + pair(":scheme", "http"), + pair(":path", "/"), + pair(":authority", "www.example.com"), + pair("cache-control", "no-cache"), + }}, + {[]HeaderField{ + pair(":method", "GET"), + pair(":scheme", "https"), + pair(":path", "/index.html"), + pair(":authority", "www.example.com"), + pair("custom-key", "custom-value"), + }}, + } + for i, tt := range tests { + buf.Reset() + got = got[:0] + for _, hf := range tt.hdrs { + if err := e.WriteField(hf); err != nil { + t.Fatal(err) + } + } + _, err := d.Write(buf.Bytes()) + if err != nil { + t.Errorf("%d. Decoder Write = %v", i, err) + } + if !reflect.DeepEqual(got, tt.hdrs) { + t.Errorf("%d. Decoded %+v; want %+v", i, got, tt.hdrs) + } + } +} + +func TestEncoderSearchTable(t *testing.T) { + e := NewEncoder(nil) + + e.dynTab.add(pair("foo", "bar")) + e.dynTab.add(pair("blake", "miz")) + e.dynTab.add(pair(":method", "GET")) + + tests := []struct { + hf HeaderField + wantI uint64 + wantMatch bool + }{ + // Name and Value match + {pair("foo", "bar"), uint64(len(staticTable) + 3), true}, + {pair("blake", "miz"), uint64(len(staticTable) + 2), true}, + {pair(":method", "GET"), 2, true}, + + // Only name match because Sensitive == true + {HeaderField{":method", "GET", true}, 2, false}, + + // Only Name matches + {pair("foo", "..."), uint64(len(staticTable) + 3), false}, + {pair("blake", "..."), uint64(len(staticTable) + 2), false}, + {pair(":method", "..."), 2, false}, + + // None match + {pair("foo-", "bar"), 0, false}, + } + for _, tt := range tests { + if gotI, gotMatch := e.searchTable(tt.hf); gotI != tt.wantI || gotMatch != tt.wantMatch { + t.Errorf("d.search(%+v) = %v, %v; want %v, %v", tt.hf, gotI, gotMatch, tt.wantI, tt.wantMatch) + } + } +} + +func TestAppendVarInt(t *testing.T) { + tests := []struct { + n byte + i uint64 + want []byte + }{ + // Fits in a byte: + {1, 0, []byte{0}}, + {2, 2, []byte{2}}, + {3, 6, []byte{6}}, + {4, 14, []byte{14}}, + {5, 30, []byte{30}}, + {6, 62, []byte{62}}, + {7, 126, []byte{126}}, + {8, 254, []byte{254}}, + + // Multiple bytes: + {5, 1337, []byte{31, 154, 10}}, + } + for _, tt := range tests { + got := appendVarInt(nil, tt.n, tt.i) + if !bytes.Equal(got, tt.want) { + t.Errorf("appendVarInt(nil, %v, %v) = %v; want %v", tt.n, tt.i, got, tt.want) + } + } +} + +func TestAppendHpackString(t *testing.T) { + tests := []struct { + s, wantHex string + }{ + // Huffman encoded + {"www.example.com", "8c f1e3 c2e5 f23a 6ba0 ab90 f4ff"}, + + // Not Huffman encoded + {"a", "01 61"}, + + // zero length + {"", "00"}, + } + for _, tt := range tests { + want := removeSpace(tt.wantHex) + buf := appendHpackString(nil, tt.s) + if got := hex.EncodeToString(buf); want != got { + t.Errorf("appendHpackString(nil, %q) = %q; want %q", tt.s, got, want) + } + } +} + +func TestAppendIndexed(t *testing.T) { + tests := []struct { + i uint64 + wantHex string + }{ + // 1 byte + {1, "81"}, + {126, "fe"}, + + // 2 bytes + {127, "ff00"}, + {128, "ff01"}, + } + for _, tt := range tests { + want := removeSpace(tt.wantHex) + buf := appendIndexed(nil, tt.i) + if got := hex.EncodeToString(buf); want != got { + t.Errorf("appendIndex(nil, %v) = %q; want %q", tt.i, got, want) + } + } +} + +func TestAppendNewName(t *testing.T) { + tests := []struct { + f HeaderField + indexing bool + wantHex string + }{ + // Incremental indexing + {HeaderField{"custom-key", "custom-value", false}, true, "40 88 25a8 49e9 5ba9 7d7f 89 25a8 49e9 5bb8 e8b4 bf"}, + + // Without indexing + {HeaderField{"custom-key", "custom-value", false}, false, "00 88 25a8 49e9 5ba9 7d7f 89 25a8 49e9 5bb8 e8b4 bf"}, + + // Never indexed + {HeaderField{"custom-key", "custom-value", true}, true, "10 88 25a8 49e9 5ba9 7d7f 89 25a8 49e9 5bb8 e8b4 bf"}, + {HeaderField{"custom-key", "custom-value", true}, false, "10 88 25a8 49e9 5ba9 7d7f 89 25a8 49e9 5bb8 e8b4 bf"}, + } + for _, tt := range tests { + want := removeSpace(tt.wantHex) + buf := appendNewName(nil, tt.f, tt.indexing) + if got := hex.EncodeToString(buf); want != got { + t.Errorf("appendNewName(nil, %+v, %v) = %q; want %q", tt.f, tt.indexing, got, want) + } + } +} + +func TestAppendIndexedName(t *testing.T) { + tests := []struct { + f HeaderField + i uint64 + indexing bool + wantHex string + }{ + // Incremental indexing + {HeaderField{":status", "302", false}, 8, true, "48 82 6402"}, + + // Without indexing + {HeaderField{":status", "302", false}, 8, false, "08 82 6402"}, + + // Never indexed + {HeaderField{":status", "302", true}, 8, true, "18 82 6402"}, + {HeaderField{":status", "302", true}, 8, false, "18 82 6402"}, + } + for _, tt := range tests { + want := removeSpace(tt.wantHex) + buf := appendIndexedName(nil, tt.f, tt.i, tt.indexing) + if got := hex.EncodeToString(buf); want != got { + t.Errorf("appendIndexedName(nil, %+v, %v) = %q; want %q", tt.f, tt.indexing, got, want) + } + } +} + +func TestAppendTableSize(t *testing.T) { + tests := []struct { + i uint32 + wantHex string + }{ + // Fits into 1 byte + {30, "3e"}, + + // Extra byte + {31, "3f00"}, + {32, "3f01"}, + } + for _, tt := range tests { + want := removeSpace(tt.wantHex) + buf := appendTableSize(nil, tt.i) + if got := hex.EncodeToString(buf); want != got { + t.Errorf("appendTableSize(nil, %v) = %q; want %q", tt.i, got, want) + } + } +} + +func TestEncoderSetMaxDynamicTableSize(t *testing.T) { + var buf bytes.Buffer + e := NewEncoder(&buf) + tests := []struct { + v uint32 + wantUpdate bool + wantMinSize uint32 + wantMaxSize uint32 + }{ + // Set new table size to 2048 + {2048, true, 2048, 2048}, + + // Set new table size to 16384, but still limited to + // 4096 + {16384, true, 2048, 4096}, + } + for _, tt := range tests { + e.SetMaxDynamicTableSize(tt.v) + if got := e.tableSizeUpdate; tt.wantUpdate != got { + t.Errorf("e.tableSizeUpdate = %v; want %v", got, tt.wantUpdate) + } + if got := e.minSize; tt.wantMinSize != got { + t.Errorf("e.minSize = %v; want %v", got, tt.wantMinSize) + } + if got := e.dynTab.maxSize; tt.wantMaxSize != got { + t.Errorf("e.maxSize = %v; want %v", got, tt.wantMaxSize) + } + } +} + +func TestEncoderSetMaxDynamicTableSizeLimit(t *testing.T) { + e := NewEncoder(nil) + // 4095 < initialHeaderTableSize means maxSize is truncated to + // 4095. + e.SetMaxDynamicTableSizeLimit(4095) + if got, want := e.dynTab.maxSize, uint32(4095); got != want { + t.Errorf("e.dynTab.maxSize = %v; want %v", got, want) + } + if got, want := e.maxSizeLimit, uint32(4095); got != want { + t.Errorf("e.maxSizeLimit = %v; want %v", got, want) + } + if got, want := e.tableSizeUpdate, true; got != want { + t.Errorf("e.tableSizeUpdate = %v; want %v", got, want) + } + // maxSize will be truncated to maxSizeLimit + e.SetMaxDynamicTableSize(16384) + if got, want := e.dynTab.maxSize, uint32(4095); got != want { + t.Errorf("e.dynTab.maxSize = %v; want %v", got, want) + } + // 8192 > current maxSizeLimit, so maxSize does not change. + e.SetMaxDynamicTableSizeLimit(8192) + if got, want := e.dynTab.maxSize, uint32(4095); got != want { + t.Errorf("e.dynTab.maxSize = %v; want %v", got, want) + } + if got, want := e.maxSizeLimit, uint32(8192); got != want { + t.Errorf("e.maxSizeLimit = %v; want %v", got, want) + } +} + +func removeSpace(s string) string { + return strings.Replace(s, " ", "", -1) +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/hpack/hpack.go b/Godeps/_workspace/src/github.com/bradfitz/http2/hpack/hpack.go new file mode 100644 index 000000000..c9e36f742 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/hpack/hpack.go @@ -0,0 +1,445 @@ +// Copyright 2014 The Go Authors. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +// Package hpack implements HPACK, a compression format for +// efficiently representing HTTP header fields in the context of HTTP/2. +// +// See http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-09 +package hpack + +import ( + "bytes" + "errors" + "fmt" +) + +// A DecodingError is something the spec defines as a decoding error. +type DecodingError struct { + Err error +} + +func (de DecodingError) Error() string { + return fmt.Sprintf("decoding error: %v", de.Err) +} + +// An InvalidIndexError is returned when an encoder references a table +// entry before the static table or after the end of the dynamic table. +type InvalidIndexError int + +func (e InvalidIndexError) Error() string { + return fmt.Sprintf("invalid indexed representation index %d", int(e)) +} + +// A HeaderField is a name-value pair. Both the name and value are +// treated as opaque sequences of octets. +type HeaderField struct { + Name, Value string + + // Sensitive means that this header field should never be + // indexed. + Sensitive bool +} + +func (hf *HeaderField) size() uint32 { + // http://http2.github.io/http2-spec/compression.html#rfc.section.4.1 + // "The size of the dynamic table is the sum of the size of + // its entries. The size of an entry is the sum of its name's + // length in octets (as defined in Section 5.2), its value's + // length in octets (see Section 5.2), plus 32. The size of + // an entry is calculated using the length of the name and + // value without any Huffman encoding applied." + + // This can overflow if somebody makes a large HeaderField + // Name and/or Value by hand, but we don't care, because that + // won't happen on the wire because the encoding doesn't allow + // it. + return uint32(len(hf.Name) + len(hf.Value) + 32) +} + +// A Decoder is the decoding context for incremental processing of +// header blocks. +type Decoder struct { + dynTab dynamicTable + emit func(f HeaderField) + + // buf is the unparsed buffer. It's only written to + // saveBuf if it was truncated in the middle of a header + // block. Because it's usually not owned, we can only + // process it under Write. + buf []byte // usually not owned + saveBuf bytes.Buffer +} + +func NewDecoder(maxSize uint32, emitFunc func(f HeaderField)) *Decoder { + d := &Decoder{ + emit: emitFunc, + } + d.dynTab.allowedMaxSize = maxSize + d.dynTab.setMaxSize(maxSize) + return d +} + +// TODO: add method *Decoder.Reset(maxSize, emitFunc) to let callers re-use Decoders and their +// underlying buffers for garbage reasons. + +func (d *Decoder) SetMaxDynamicTableSize(v uint32) { + d.dynTab.setMaxSize(v) +} + +// SetAllowedMaxDynamicTableSize sets the upper bound that the encoded +// stream (via dynamic table size updates) may set the maximum size +// to. +func (d *Decoder) SetAllowedMaxDynamicTableSize(v uint32) { + d.dynTab.allowedMaxSize = v +} + +type dynamicTable struct { + // ents is the FIFO described at + // http://http2.github.io/http2-spec/compression.html#rfc.section.2.3.2 + // The newest (low index) is append at the end, and items are + // evicted from the front. + ents []HeaderField + size uint32 + maxSize uint32 // current maxSize + allowedMaxSize uint32 // maxSize may go up to this, inclusive +} + +func (dt *dynamicTable) setMaxSize(v uint32) { + dt.maxSize = v + dt.evict() +} + +// TODO: change dynamicTable to be a struct with a slice and a size int field, +// per http://http2.github.io/http2-spec/compression.html#rfc.section.4.1: +// +// +// Then make add increment the size. maybe the max size should move from Decoder to +// dynamicTable and add should return an ok bool if there was enough space. +// +// Later we'll need a remove operation on dynamicTable. + +func (dt *dynamicTable) add(f HeaderField) { + dt.ents = append(dt.ents, f) + dt.size += f.size() + dt.evict() +} + +// If we're too big, evict old stuff (front of the slice) +func (dt *dynamicTable) evict() { + base := dt.ents // keep base pointer of slice + for dt.size > dt.maxSize { + dt.size -= dt.ents[0].size() + dt.ents = dt.ents[1:] + } + + // Shift slice contents down if we evicted things. + if len(dt.ents) != len(base) { + copy(base, dt.ents) + dt.ents = base[:len(dt.ents)] + } +} + +// constantTimeStringCompare compares string a and b in a constant +// time manner. +func constantTimeStringCompare(a, b string) bool { + if len(a) != len(b) { + return false + } + + c := byte(0) + + for i := 0; i < len(a); i++ { + c |= a[i] ^ b[i] + } + + return c == 0 +} + +// Search searches f in the table. The return value i is 0 if there is +// no name match. If there is name match or name/value match, i is the +// index of that entry (1-based). If both name and value match, +// nameValueMatch becomes true. +func (dt *dynamicTable) search(f HeaderField) (i uint64, nameValueMatch bool) { + l := len(dt.ents) + for j := l - 1; j >= 0; j-- { + ent := dt.ents[j] + if !constantTimeStringCompare(ent.Name, f.Name) { + continue + } + if i == 0 { + i = uint64(l - j) + } + if f.Sensitive { + continue + } + if !constantTimeStringCompare(ent.Value, f.Value) { + continue + } + i = uint64(l - j) + nameValueMatch = true + return + } + return +} + +func (d *Decoder) maxTableIndex() int { + return len(d.dynTab.ents) + len(staticTable) +} + +func (d *Decoder) at(i uint64) (hf HeaderField, ok bool) { + if i < 1 { + return + } + if i > uint64(d.maxTableIndex()) { + return + } + if i <= uint64(len(staticTable)) { + return staticTable[i-1], true + } + dents := d.dynTab.ents + return dents[len(dents)-(int(i)-len(staticTable))], true +} + +// Decode decodes an entire block. +// +// TODO: remove this method and make it incremental later? This is +// easier for debugging now. +func (d *Decoder) DecodeFull(p []byte) ([]HeaderField, error) { + var hf []HeaderField + saveFunc := d.emit + defer func() { d.emit = saveFunc }() + d.emit = func(f HeaderField) { hf = append(hf, f) } + if _, err := d.Write(p); err != nil { + return nil, err + } + if err := d.Close(); err != nil { + return nil, err + } + return hf, nil +} + +func (d *Decoder) Close() error { + if d.saveBuf.Len() > 0 { + d.saveBuf.Reset() + return DecodingError{errors.New("truncated headers")} + } + return nil +} + +func (d *Decoder) Write(p []byte) (n int, err error) { + if len(p) == 0 { + // Prevent state machine CPU attacks (making us redo + // work up to the point of finding out we don't have + // enough data) + return + } + // Only copy the data if we have to. Optimistically assume + // that p will contain a complete header block. + if d.saveBuf.Len() == 0 { + d.buf = p + } else { + d.saveBuf.Write(p) + d.buf = d.saveBuf.Bytes() + d.saveBuf.Reset() + } + + for len(d.buf) > 0 { + err = d.parseHeaderFieldRepr() + if err != nil { + if err == errNeedMore { + err = nil + d.saveBuf.Write(d.buf) + } + break + } + } + + return len(p), err +} + +// errNeedMore is an internal sentinel error value that means the +// buffer is truncated and we need to read more data before we can +// continue parsing. +var errNeedMore = errors.New("need more data") + +type indexType int + +const ( + indexedTrue indexType = iota + indexedFalse + indexedNever +) + +func (v indexType) indexed() bool { return v == indexedTrue } +func (v indexType) sensitive() bool { return v == indexedNever } + +// returns errNeedMore if there isn't enough data available. +// any other error is fatal. +// consumes d.buf iff it returns nil. +// precondition: must be called with len(d.buf) > 0 +func (d *Decoder) parseHeaderFieldRepr() error { + b := d.buf[0] + switch { + case b&128 != 0: + // Indexed representation. + // High bit set? + // http://http2.github.io/http2-spec/compression.html#rfc.section.6.1 + return d.parseFieldIndexed() + case b&192 == 64: + // 6.2.1 Literal Header Field with Incremental Indexing + // 0b10xxxxxx: top two bits are 10 + // http://http2.github.io/http2-spec/compression.html#rfc.section.6.2.1 + return d.parseFieldLiteral(6, indexedTrue) + case b&240 == 0: + // 6.2.2 Literal Header Field without Indexing + // 0b0000xxxx: top four bits are 0000 + // http://http2.github.io/http2-spec/compression.html#rfc.section.6.2.2 + return d.parseFieldLiteral(4, indexedFalse) + case b&240 == 16: + // 6.2.3 Literal Header Field never Indexed + // 0b0001xxxx: top four bits are 0001 + // http://http2.github.io/http2-spec/compression.html#rfc.section.6.2.3 + return d.parseFieldLiteral(4, indexedNever) + case b&224 == 32: + // 6.3 Dynamic Table Size Update + // Top three bits are '001'. + // http://http2.github.io/http2-spec/compression.html#rfc.section.6.3 + return d.parseDynamicTableSizeUpdate() + } + + return DecodingError{errors.New("invalid encoding")} +} + +// (same invariants and behavior as parseHeaderFieldRepr) +func (d *Decoder) parseFieldIndexed() error { + buf := d.buf + idx, buf, err := readVarInt(7, buf) + if err != nil { + return err + } + hf, ok := d.at(idx) + if !ok { + return DecodingError{InvalidIndexError(idx)} + } + d.emit(HeaderField{Name: hf.Name, Value: hf.Value}) + d.buf = buf + return nil +} + +// (same invariants and behavior as parseHeaderFieldRepr) +func (d *Decoder) parseFieldLiteral(n uint8, it indexType) error { + buf := d.buf + nameIdx, buf, err := readVarInt(n, buf) + if err != nil { + return err + } + + var hf HeaderField + if nameIdx > 0 { + ihf, ok := d.at(nameIdx) + if !ok { + return DecodingError{InvalidIndexError(nameIdx)} + } + hf.Name = ihf.Name + } else { + hf.Name, buf, err = readString(buf) + if err != nil { + return err + } + } + hf.Value, buf, err = readString(buf) + if err != nil { + return err + } + d.buf = buf + if it.indexed() { + d.dynTab.add(hf) + } + hf.Sensitive = it.sensitive() + d.emit(hf) + return nil +} + +// (same invariants and behavior as parseHeaderFieldRepr) +func (d *Decoder) parseDynamicTableSizeUpdate() error { + buf := d.buf + size, buf, err := readVarInt(5, buf) + if err != nil { + return err + } + if size > uint64(d.dynTab.allowedMaxSize) { + return DecodingError{errors.New("dynamic table size update too large")} + } + d.dynTab.setMaxSize(uint32(size)) + d.buf = buf + return nil +} + +var errVarintOverflow = DecodingError{errors.New("varint integer overflow")} + +// readVarInt reads an unsigned variable length integer off the +// beginning of p. n is the parameter as described in +// http://http2.github.io/http2-spec/compression.html#rfc.section.5.1. +// +// n must always be between 1 and 8. +// +// The returned remain buffer is either a smaller suffix of p, or err != nil. +// The error is errNeedMore if p doesn't contain a complete integer. +func readVarInt(n byte, p []byte) (i uint64, remain []byte, err error) { + if n < 1 || n > 8 { + panic("bad n") + } + if len(p) == 0 { + return 0, p, errNeedMore + } + i = uint64(p[0]) + if n < 8 { + i &= (1 << uint64(n)) - 1 + } + if i < (1< 0 { + b := p[0] + p = p[1:] + i += uint64(b&127) << m + if b&128 == 0 { + return i, p, nil + } + m += 7 + if m >= 63 { // TODO: proper overflow check. making this up. + return 0, origP, errVarintOverflow + } + } + return 0, origP, errNeedMore +} + +func readString(p []byte) (s string, remain []byte, err error) { + if len(p) == 0 { + return "", p, errNeedMore + } + isHuff := p[0]&128 != 0 + strLen, p, err := readVarInt(7, p) + if err != nil { + return "", p, err + } + if uint64(len(p)) < strLen { + return "", p, errNeedMore + } + if !isHuff { + return string(p[:strLen]), p[strLen:], nil + } + + // TODO: optimize this garbage: + var buf bytes.Buffer + if _, err := HuffmanDecode(&buf, p[:strLen]); err != nil { + return "", nil, err + } + return buf.String(), p[strLen:], nil +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/hpack/hpack_test.go b/Godeps/_workspace/src/github.com/bradfitz/http2/hpack/hpack_test.go new file mode 100644 index 000000000..08bee414f --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/hpack/hpack_test.go @@ -0,0 +1,648 @@ +// Copyright 2014 The Go Authors. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +package hpack + +import ( + "bufio" + "bytes" + "encoding/hex" + "fmt" + "reflect" + "regexp" + "strconv" + "strings" + "testing" +) + +func TestStaticTable(t *testing.T) { + fromSpec := ` + +-------+-----------------------------+---------------+ + | 1 | :authority | | + | 2 | :method | GET | + | 3 | :method | POST | + | 4 | :path | / | + | 5 | :path | /index.html | + | 6 | :scheme | http | + | 7 | :scheme | https | + | 8 | :status | 200 | + | 9 | :status | 204 | + | 10 | :status | 206 | + | 11 | :status | 304 | + | 12 | :status | 400 | + | 13 | :status | 404 | + | 14 | :status | 500 | + | 15 | accept-charset | | + | 16 | accept-encoding | gzip, deflate | + | 17 | accept-language | | + | 18 | accept-ranges | | + | 19 | accept | | + | 20 | access-control-allow-origin | | + | 21 | age | | + | 22 | allow | | + | 23 | authorization | | + | 24 | cache-control | | + | 25 | content-disposition | | + | 26 | content-encoding | | + | 27 | content-language | | + | 28 | content-length | | + | 29 | content-location | | + | 30 | content-range | | + | 31 | content-type | | + | 32 | cookie | | + | 33 | date | | + | 34 | etag | | + | 35 | expect | | + | 36 | expires | | + | 37 | from | | + | 38 | host | | + | 39 | if-match | | + | 40 | if-modified-since | | + | 41 | if-none-match | | + | 42 | if-range | | + | 43 | if-unmodified-since | | + | 44 | last-modified | | + | 45 | link | | + | 46 | location | | + | 47 | max-forwards | | + | 48 | proxy-authenticate | | + | 49 | proxy-authorization | | + | 50 | range | | + | 51 | referer | | + | 52 | refresh | | + | 53 | retry-after | | + | 54 | server | | + | 55 | set-cookie | | + | 56 | strict-transport-security | | + | 57 | transfer-encoding | | + | 58 | user-agent | | + | 59 | vary | | + | 60 | via | | + | 61 | www-authenticate | | + +-------+-----------------------------+---------------+ +` + bs := bufio.NewScanner(strings.NewReader(fromSpec)) + re := regexp.MustCompile(`\| (\d+)\s+\| (\S+)\s*\| (\S(.*\S)?)?\s+\|`) + for bs.Scan() { + l := bs.Text() + if !strings.Contains(l, "|") { + continue + } + m := re.FindStringSubmatch(l) + if m == nil { + continue + } + i, err := strconv.Atoi(m[1]) + if err != nil { + t.Errorf("Bogus integer on line %q", l) + continue + } + if i < 1 || i > len(staticTable) { + t.Errorf("Bogus index %d on line %q", i, l) + continue + } + if got, want := staticTable[i-1].Name, m[2]; got != want { + t.Errorf("header index %d name = %q; want %q", i, got, want) + } + if got, want := staticTable[i-1].Value, m[3]; got != want { + t.Errorf("header index %d value = %q; want %q", i, got, want) + } + } + if err := bs.Err(); err != nil { + t.Error(err) + } +} + +func (d *Decoder) mustAt(idx int) HeaderField { + if hf, ok := d.at(uint64(idx)); !ok { + panic(fmt.Sprintf("bogus index %d", idx)) + } else { + return hf + } +} + +func TestDynamicTableAt(t *testing.T) { + d := NewDecoder(4096, nil) + at := d.mustAt + if got, want := at(2), (pair(":method", "GET")); got != want { + t.Errorf("at(2) = %v; want %v", got, want) + } + d.dynTab.add(pair("foo", "bar")) + d.dynTab.add(pair("blake", "miz")) + if got, want := at(len(staticTable)+1), (pair("blake", "miz")); got != want { + t.Errorf("at(dyn 1) = %v; want %v", got, want) + } + if got, want := at(len(staticTable)+2), (pair("foo", "bar")); got != want { + t.Errorf("at(dyn 2) = %v; want %v", got, want) + } + if got, want := at(3), (pair(":method", "POST")); got != want { + t.Errorf("at(3) = %v; want %v", got, want) + } +} + +func TestDynamicTableSearch(t *testing.T) { + dt := dynamicTable{} + dt.setMaxSize(4096) + + dt.add(pair("foo", "bar")) + dt.add(pair("blake", "miz")) + dt.add(pair(":method", "GET")) + + tests := []struct { + hf HeaderField + wantI uint64 + wantMatch bool + }{ + // Name and Value match + {pair("foo", "bar"), 3, true}, + {pair(":method", "GET"), 1, true}, + + // Only name match because of Sensitive == true + {HeaderField{"blake", "miz", true}, 2, false}, + + // Only Name matches + {pair("foo", "..."), 3, false}, + {pair("blake", "..."), 2, false}, + {pair(":method", "..."), 1, false}, + + // None match + {pair("foo-", "bar"), 0, false}, + } + for _, tt := range tests { + if gotI, gotMatch := dt.search(tt.hf); gotI != tt.wantI || gotMatch != tt.wantMatch { + t.Errorf("d.search(%+v) = %v, %v; want %v, %v", tt.hf, gotI, gotMatch, tt.wantI, tt.wantMatch) + } + } +} + +func TestDynamicTableSizeEvict(t *testing.T) { + d := NewDecoder(4096, nil) + if want := uint32(0); d.dynTab.size != want { + t.Fatalf("size = %d; want %d", d.dynTab.size, want) + } + add := d.dynTab.add + add(pair("blake", "eats pizza")) + if want := uint32(15 + 32); d.dynTab.size != want { + t.Fatalf("after pizza, size = %d; want %d", d.dynTab.size, want) + } + add(pair("foo", "bar")) + if want := uint32(15 + 32 + 6 + 32); d.dynTab.size != want { + t.Fatalf("after foo bar, size = %d; want %d", d.dynTab.size, want) + } + d.dynTab.setMaxSize(15 + 32 + 1 /* slop */) + if want := uint32(6 + 32); d.dynTab.size != want { + t.Fatalf("after setMaxSize, size = %d; want %d", d.dynTab.size, want) + } + if got, want := d.mustAt(len(staticTable)+1), (pair("foo", "bar")); got != want { + t.Errorf("at(dyn 1) = %v; want %v", got, want) + } + add(pair("long", strings.Repeat("x", 500))) + if want := uint32(0); d.dynTab.size != want { + t.Fatalf("after big one, size = %d; want %d", d.dynTab.size, want) + } +} + +func TestDecoderDecode(t *testing.T) { + tests := []struct { + name string + in []byte + want []HeaderField + wantDynTab []HeaderField // newest entry first + }{ + // C.2.1 Literal Header Field with Indexing + // http://http2.github.io/http2-spec/compression.html#rfc.section.C.2.1 + {"C.2.1", dehex("400a 6375 7374 6f6d 2d6b 6579 0d63 7573 746f 6d2d 6865 6164 6572"), + []HeaderField{pair("custom-key", "custom-header")}, + []HeaderField{pair("custom-key", "custom-header")}, + }, + + // C.2.2 Literal Header Field without Indexing + // http://http2.github.io/http2-spec/compression.html#rfc.section.C.2.2 + {"C.2.2", dehex("040c 2f73 616d 706c 652f 7061 7468"), + []HeaderField{pair(":path", "/sample/path")}, + []HeaderField{}}, + + // C.2.3 Literal Header Field never Indexed + // http://http2.github.io/http2-spec/compression.html#rfc.section.C.2.3 + {"C.2.3", dehex("1008 7061 7373 776f 7264 0673 6563 7265 74"), + []HeaderField{{"password", "secret", true}}, + []HeaderField{}}, + + // C.2.4 Indexed Header Field + // http://http2.github.io/http2-spec/compression.html#rfc.section.C.2.4 + {"C.2.4", []byte("\x82"), + []HeaderField{pair(":method", "GET")}, + []HeaderField{}}, + } + for _, tt := range tests { + d := NewDecoder(4096, nil) + hf, err := d.DecodeFull(tt.in) + if err != nil { + t.Errorf("%s: %v", tt.name, err) + continue + } + if !reflect.DeepEqual(hf, tt.want) { + t.Errorf("%s: Got %v; want %v", tt.name, hf, tt.want) + } + gotDynTab := d.dynTab.reverseCopy() + if !reflect.DeepEqual(gotDynTab, tt.wantDynTab) { + t.Errorf("%s: dynamic table after = %v; want %v", tt.name, gotDynTab, tt.wantDynTab) + } + } +} + +func (dt *dynamicTable) reverseCopy() (hf []HeaderField) { + hf = make([]HeaderField, len(dt.ents)) + for i := range hf { + hf[i] = dt.ents[len(dt.ents)-1-i] + } + return +} + +type encAndWant struct { + enc []byte + want []HeaderField + wantDynTab []HeaderField + wantDynSize uint32 +} + +// C.3 Request Examples without Huffman Coding +// http://http2.github.io/http2-spec/compression.html#rfc.section.C.3 +func TestDecodeC3_NoHuffman(t *testing.T) { + testDecodeSeries(t, 4096, []encAndWant{ + {dehex("8286 8441 0f77 7777 2e65 7861 6d70 6c65 2e63 6f6d"), + []HeaderField{ + pair(":method", "GET"), + pair(":scheme", "http"), + pair(":path", "/"), + pair(":authority", "www.example.com"), + }, + []HeaderField{ + pair(":authority", "www.example.com"), + }, + 57, + }, + {dehex("8286 84be 5808 6e6f 2d63 6163 6865"), + []HeaderField{ + pair(":method", "GET"), + pair(":scheme", "http"), + pair(":path", "/"), + pair(":authority", "www.example.com"), + pair("cache-control", "no-cache"), + }, + []HeaderField{ + pair("cache-control", "no-cache"), + pair(":authority", "www.example.com"), + }, + 110, + }, + {dehex("8287 85bf 400a 6375 7374 6f6d 2d6b 6579 0c63 7573 746f 6d2d 7661 6c75 65"), + []HeaderField{ + pair(":method", "GET"), + pair(":scheme", "https"), + pair(":path", "/index.html"), + pair(":authority", "www.example.com"), + pair("custom-key", "custom-value"), + }, + []HeaderField{ + pair("custom-key", "custom-value"), + pair("cache-control", "no-cache"), + pair(":authority", "www.example.com"), + }, + 164, + }, + }) +} + +// C.4 Request Examples with Huffman Coding +// http://http2.github.io/http2-spec/compression.html#rfc.section.C.4 +func TestDecodeC4_Huffman(t *testing.T) { + testDecodeSeries(t, 4096, []encAndWant{ + {dehex("8286 8441 8cf1 e3c2 e5f2 3a6b a0ab 90f4 ff"), + []HeaderField{ + pair(":method", "GET"), + pair(":scheme", "http"), + pair(":path", "/"), + pair(":authority", "www.example.com"), + }, + []HeaderField{ + pair(":authority", "www.example.com"), + }, + 57, + }, + {dehex("8286 84be 5886 a8eb 1064 9cbf"), + []HeaderField{ + pair(":method", "GET"), + pair(":scheme", "http"), + pair(":path", "/"), + pair(":authority", "www.example.com"), + pair("cache-control", "no-cache"), + }, + []HeaderField{ + pair("cache-control", "no-cache"), + pair(":authority", "www.example.com"), + }, + 110, + }, + {dehex("8287 85bf 4088 25a8 49e9 5ba9 7d7f 8925 a849 e95b b8e8 b4bf"), + []HeaderField{ + pair(":method", "GET"), + pair(":scheme", "https"), + pair(":path", "/index.html"), + pair(":authority", "www.example.com"), + pair("custom-key", "custom-value"), + }, + []HeaderField{ + pair("custom-key", "custom-value"), + pair("cache-control", "no-cache"), + pair(":authority", "www.example.com"), + }, + 164, + }, + }) +} + +// http://http2.github.io/http2-spec/compression.html#rfc.section.C.5 +// "This section shows several consecutive header lists, corresponding +// to HTTP responses, on the same connection. The HTTP/2 setting +// parameter SETTINGS_HEADER_TABLE_SIZE is set to the value of 256 +// octets, causing some evictions to occur." +func TestDecodeC5_ResponsesNoHuff(t *testing.T) { + testDecodeSeries(t, 256, []encAndWant{ + {dehex(` +4803 3330 3258 0770 7269 7661 7465 611d +4d6f 6e2c 2032 3120 4f63 7420 3230 3133 +2032 303a 3133 3a32 3120 474d 546e 1768 +7474 7073 3a2f 2f77 7777 2e65 7861 6d70 +6c65 2e63 6f6d +`), + []HeaderField{ + pair(":status", "302"), + pair("cache-control", "private"), + pair("date", "Mon, 21 Oct 2013 20:13:21 GMT"), + pair("location", "https://www.example.com"), + }, + []HeaderField{ + pair("location", "https://www.example.com"), + pair("date", "Mon, 21 Oct 2013 20:13:21 GMT"), + pair("cache-control", "private"), + pair(":status", "302"), + }, + 222, + }, + {dehex("4803 3330 37c1 c0bf"), + []HeaderField{ + pair(":status", "307"), + pair("cache-control", "private"), + pair("date", "Mon, 21 Oct 2013 20:13:21 GMT"), + pair("location", "https://www.example.com"), + }, + []HeaderField{ + pair(":status", "307"), + pair("location", "https://www.example.com"), + pair("date", "Mon, 21 Oct 2013 20:13:21 GMT"), + pair("cache-control", "private"), + }, + 222, + }, + {dehex(` +88c1 611d 4d6f 6e2c 2032 3120 4f63 7420 +3230 3133 2032 303a 3133 3a32 3220 474d +54c0 5a04 677a 6970 7738 666f 6f3d 4153 +444a 4b48 514b 425a 584f 5157 454f 5049 +5541 5851 5745 4f49 553b 206d 6178 2d61 +6765 3d33 3630 303b 2076 6572 7369 6f6e +3d31 +`), + []HeaderField{ + pair(":status", "200"), + pair("cache-control", "private"), + pair("date", "Mon, 21 Oct 2013 20:13:22 GMT"), + pair("location", "https://www.example.com"), + pair("content-encoding", "gzip"), + pair("set-cookie", "foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1"), + }, + []HeaderField{ + pair("set-cookie", "foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1"), + pair("content-encoding", "gzip"), + pair("date", "Mon, 21 Oct 2013 20:13:22 GMT"), + }, + 215, + }, + }) +} + +// http://http2.github.io/http2-spec/compression.html#rfc.section.C.6 +// "This section shows the same examples as the previous section, but +// using Huffman encoding for the literal values. The HTTP/2 setting +// parameter SETTINGS_HEADER_TABLE_SIZE is set to the value of 256 +// octets, causing some evictions to occur. The eviction mechanism +// uses the length of the decoded literal values, so the same +// evictions occurs as in the previous section." +func TestDecodeC6_ResponsesHuffman(t *testing.T) { + testDecodeSeries(t, 256, []encAndWant{ + {dehex(` +4882 6402 5885 aec3 771a 4b61 96d0 7abe +9410 54d4 44a8 2005 9504 0b81 66e0 82a6 +2d1b ff6e 919d 29ad 1718 63c7 8f0b 97c8 +e9ae 82ae 43d3 +`), + []HeaderField{ + pair(":status", "302"), + pair("cache-control", "private"), + pair("date", "Mon, 21 Oct 2013 20:13:21 GMT"), + pair("location", "https://www.example.com"), + }, + []HeaderField{ + pair("location", "https://www.example.com"), + pair("date", "Mon, 21 Oct 2013 20:13:21 GMT"), + pair("cache-control", "private"), + pair(":status", "302"), + }, + 222, + }, + {dehex("4883 640e ffc1 c0bf"), + []HeaderField{ + pair(":status", "307"), + pair("cache-control", "private"), + pair("date", "Mon, 21 Oct 2013 20:13:21 GMT"), + pair("location", "https://www.example.com"), + }, + []HeaderField{ + pair(":status", "307"), + pair("location", "https://www.example.com"), + pair("date", "Mon, 21 Oct 2013 20:13:21 GMT"), + pair("cache-control", "private"), + }, + 222, + }, + {dehex(` +88c1 6196 d07a be94 1054 d444 a820 0595 +040b 8166 e084 a62d 1bff c05a 839b d9ab +77ad 94e7 821d d7f2 e6c7 b335 dfdf cd5b +3960 d5af 2708 7f36 72c1 ab27 0fb5 291f +9587 3160 65c0 03ed 4ee5 b106 3d50 07 +`), + []HeaderField{ + pair(":status", "200"), + pair("cache-control", "private"), + pair("date", "Mon, 21 Oct 2013 20:13:22 GMT"), + pair("location", "https://www.example.com"), + pair("content-encoding", "gzip"), + pair("set-cookie", "foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1"), + }, + []HeaderField{ + pair("set-cookie", "foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1"), + pair("content-encoding", "gzip"), + pair("date", "Mon, 21 Oct 2013 20:13:22 GMT"), + }, + 215, + }, + }) +} + +func testDecodeSeries(t *testing.T, size uint32, steps []encAndWant) { + d := NewDecoder(size, nil) + for i, step := range steps { + hf, err := d.DecodeFull(step.enc) + if err != nil { + t.Fatalf("Error at step index %d: %v", i, err) + } + if !reflect.DeepEqual(hf, step.want) { + t.Fatalf("At step index %d: Got headers %v; want %v", i, hf, step.want) + } + gotDynTab := d.dynTab.reverseCopy() + if !reflect.DeepEqual(gotDynTab, step.wantDynTab) { + t.Errorf("After step index %d, dynamic table = %v; want %v", i, gotDynTab, step.wantDynTab) + } + if d.dynTab.size != step.wantDynSize { + t.Errorf("After step index %d, dynamic table size = %v; want %v", i, d.dynTab.size, step.wantDynSize) + } + } +} + +func TestHuffmanDecode(t *testing.T) { + tests := []struct { + inHex, want string + }{ + {"f1e3 c2e5 f23a 6ba0 ab90 f4ff", "www.example.com"}, + {"a8eb 1064 9cbf", "no-cache"}, + {"25a8 49e9 5ba9 7d7f", "custom-key"}, + {"25a8 49e9 5bb8 e8b4 bf", "custom-value"}, + {"6402", "302"}, + {"aec3 771a 4b", "private"}, + {"d07a be94 1054 d444 a820 0595 040b 8166 e082 a62d 1bff", "Mon, 21 Oct 2013 20:13:21 GMT"}, + {"9d29 ad17 1863 c78f 0b97 c8e9 ae82 ae43 d3", "https://www.example.com"}, + {"9bd9 ab", "gzip"}, + {"94e7 821d d7f2 e6c7 b335 dfdf cd5b 3960 d5af 2708 7f36 72c1 ab27 0fb5 291f 9587 3160 65c0 03ed 4ee5 b106 3d50 07", + "foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1"}, + } + for i, tt := range tests { + var buf bytes.Buffer + in, err := hex.DecodeString(strings.Replace(tt.inHex, " ", "", -1)) + if err != nil { + t.Errorf("%d. hex input error: %v", i, err) + continue + } + if _, err := HuffmanDecode(&buf, in); err != nil { + t.Errorf("%d. decode error: %v", i, err) + continue + } + if got := buf.String(); tt.want != got { + t.Errorf("%d. decode = %q; want %q", i, got, tt.want) + } + } +} + +func TestAppendHuffmanString(t *testing.T) { + tests := []struct { + in, want string + }{ + {"www.example.com", "f1e3 c2e5 f23a 6ba0 ab90 f4ff"}, + {"no-cache", "a8eb 1064 9cbf"}, + {"custom-key", "25a8 49e9 5ba9 7d7f"}, + {"custom-value", "25a8 49e9 5bb8 e8b4 bf"}, + {"302", "6402"}, + {"private", "aec3 771a 4b"}, + {"Mon, 21 Oct 2013 20:13:21 GMT", "d07a be94 1054 d444 a820 0595 040b 8166 e082 a62d 1bff"}, + {"https://www.example.com", "9d29 ad17 1863 c78f 0b97 c8e9 ae82 ae43 d3"}, + {"gzip", "9bd9 ab"}, + {"foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1", + "94e7 821d d7f2 e6c7 b335 dfdf cd5b 3960 d5af 2708 7f36 72c1 ab27 0fb5 291f 9587 3160 65c0 03ed 4ee5 b106 3d50 07"}, + } + for i, tt := range tests { + buf := []byte{} + want := strings.Replace(tt.want, " ", "", -1) + buf = AppendHuffmanString(buf, tt.in) + if got := hex.EncodeToString(buf); want != got { + t.Errorf("%d. encode = %q; want %q", i, got, want) + } + } +} + +func TestReadVarInt(t *testing.T) { + type res struct { + i uint64 + consumed int + err error + } + tests := []struct { + n byte + p []byte + want res + }{ + // Fits in a byte: + {1, []byte{0}, res{0, 1, nil}}, + {2, []byte{2}, res{2, 1, nil}}, + {3, []byte{6}, res{6, 1, nil}}, + {4, []byte{14}, res{14, 1, nil}}, + {5, []byte{30}, res{30, 1, nil}}, + {6, []byte{62}, res{62, 1, nil}}, + {7, []byte{126}, res{126, 1, nil}}, + {8, []byte{254}, res{254, 1, nil}}, + + // Doesn't fit in a byte: + {1, []byte{1}, res{0, 0, errNeedMore}}, + {2, []byte{3}, res{0, 0, errNeedMore}}, + {3, []byte{7}, res{0, 0, errNeedMore}}, + {4, []byte{15}, res{0, 0, errNeedMore}}, + {5, []byte{31}, res{0, 0, errNeedMore}}, + {6, []byte{63}, res{0, 0, errNeedMore}}, + {7, []byte{127}, res{0, 0, errNeedMore}}, + {8, []byte{255}, res{0, 0, errNeedMore}}, + + // Ignoring top bits: + {5, []byte{255, 154, 10}, res{1337, 3, nil}}, // high dummy three bits: 111 + {5, []byte{159, 154, 10}, res{1337, 3, nil}}, // high dummy three bits: 100 + {5, []byte{191, 154, 10}, res{1337, 3, nil}}, // high dummy three bits: 101 + + // Extra byte: + {5, []byte{191, 154, 10, 2}, res{1337, 3, nil}}, // extra byte + + // Short a byte: + {5, []byte{191, 154}, res{0, 0, errNeedMore}}, + + // integer overflow: + {1, []byte{255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}, res{0, 0, errVarintOverflow}}, + } + for _, tt := range tests { + i, remain, err := readVarInt(tt.n, tt.p) + consumed := len(tt.p) - len(remain) + got := res{i, consumed, err} + if got != tt.want { + t.Errorf("readVarInt(%d, %v ~ %x) = %+v; want %+v", tt.n, tt.p, tt.p, got, tt.want) + } + } +} + +func dehex(s string) []byte { + s = strings.Replace(s, " ", "", -1) + s = strings.Replace(s, "\n", "", -1) + b, err := hex.DecodeString(s) + if err != nil { + panic(err) + } + return b +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/hpack/huffman.go b/Godeps/_workspace/src/github.com/bradfitz/http2/hpack/huffman.go new file mode 100644 index 000000000..9fe76f68e --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/hpack/huffman.go @@ -0,0 +1,159 @@ +// Copyright 2014 The Go Authors. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +package hpack + +import ( + "bytes" + "io" + "sync" +) + +var bufPool = sync.Pool{ + New: func() interface{} { return new(bytes.Buffer) }, +} + +// HuffmanDecode decodes the string in v and writes the expanded +// result to w, returning the number of bytes written to w and the +// Write call's return value. At most one Write call is made. +func HuffmanDecode(w io.Writer, v []byte) (int, error) { + buf := bufPool.Get().(*bytes.Buffer) + buf.Reset() + defer bufPool.Put(buf) + + n := rootHuffmanNode + cur, nbits := uint(0), uint8(0) + for _, b := range v { + cur = cur<<8 | uint(b) + nbits += 8 + for nbits >= 8 { + n = n.children[byte(cur>>(nbits-8))] + if n.children == nil { + buf.WriteByte(n.sym) + nbits -= n.codeLen + n = rootHuffmanNode + } else { + nbits -= 8 + } + } + } + for nbits > 0 { + n = n.children[byte(cur<<(8-nbits))] + if n.children != nil || n.codeLen > nbits { + break + } + buf.WriteByte(n.sym) + nbits -= n.codeLen + n = rootHuffmanNode + } + return w.Write(buf.Bytes()) +} + +type node struct { + // children is non-nil for internal nodes + children []*node + + // The following are only valid if children is nil: + codeLen uint8 // number of bits that led to the output of sym + sym byte // output symbol +} + +func newInternalNode() *node { + return &node{children: make([]*node, 256)} +} + +var rootHuffmanNode = newInternalNode() + +func init() { + for i, code := range huffmanCodes { + if i > 255 { + panic("too many huffman codes") + } + addDecoderNode(byte(i), code, huffmanCodeLen[i]) + } +} + +func addDecoderNode(sym byte, code uint32, codeLen uint8) { + cur := rootHuffmanNode + for codeLen > 8 { + codeLen -= 8 + i := uint8(code >> codeLen) + if cur.children[i] == nil { + cur.children[i] = newInternalNode() + } + cur = cur.children[i] + } + shift := 8 - codeLen + start, end := int(uint8(code<> (nbits - rembits)) + dst[len(dst)-1] |= t + } + + return dst +} + +// HuffmanEncodeLength returns the number of bytes required to encode +// s in Huffman codes. The result is round up to byte boundary. +func HuffmanEncodeLength(s string) uint64 { + n := uint64(0) + for i := 0; i < len(s); i++ { + n += uint64(huffmanCodeLen[s[i]]) + } + return (n + 7) / 8 +} + +// appendByteToHuffmanCode appends Huffman code for c to dst and +// returns the extended buffer and the remaining bits in the last +// element. The appending is not byte aligned and the remaining bits +// in the last element of dst is given in rembits. +func appendByteToHuffmanCode(dst []byte, rembits uint8, c byte) ([]byte, uint8) { + code := huffmanCodes[c] + nbits := huffmanCodeLen[c] + + for { + if rembits > nbits { + t := uint8(code << (rembits - nbits)) + dst[len(dst)-1] |= t + rembits -= nbits + break + } + + t := uint8(code >> (nbits - rembits)) + dst[len(dst)-1] |= t + + nbits -= rembits + rembits = 8 + + if nbits == 0 { + break + } + + dst = append(dst, 0) + } + + return dst, rembits +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/hpack/tables.go b/Godeps/_workspace/src/github.com/bradfitz/http2/hpack/tables.go new file mode 100644 index 000000000..f898e2512 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/hpack/tables.go @@ -0,0 +1,353 @@ +// Copyright 2014 The Go Authors. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +package hpack + +func pair(name, value string) HeaderField { + return HeaderField{Name: name, Value: value} +} + +// http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-07#appendix-B +var staticTable = []HeaderField{ + pair(":authority", ""), // index 1 (1-based) + pair(":method", "GET"), + pair(":method", "POST"), + pair(":path", "/"), + pair(":path", "/index.html"), + pair(":scheme", "http"), + pair(":scheme", "https"), + pair(":status", "200"), + pair(":status", "204"), + pair(":status", "206"), + pair(":status", "304"), + pair(":status", "400"), + pair(":status", "404"), + pair(":status", "500"), + pair("accept-charset", ""), + pair("accept-encoding", "gzip, deflate"), + pair("accept-language", ""), + pair("accept-ranges", ""), + pair("accept", ""), + pair("access-control-allow-origin", ""), + pair("age", ""), + pair("allow", ""), + pair("authorization", ""), + pair("cache-control", ""), + pair("content-disposition", ""), + pair("content-encoding", ""), + pair("content-language", ""), + pair("content-length", ""), + pair("content-location", ""), + pair("content-range", ""), + pair("content-type", ""), + pair("cookie", ""), + pair("date", ""), + pair("etag", ""), + pair("expect", ""), + pair("expires", ""), + pair("from", ""), + pair("host", ""), + pair("if-match", ""), + pair("if-modified-since", ""), + pair("if-none-match", ""), + pair("if-range", ""), + pair("if-unmodified-since", ""), + pair("last-modified", ""), + pair("link", ""), + pair("location", ""), + pair("max-forwards", ""), + pair("proxy-authenticate", ""), + pair("proxy-authorization", ""), + pair("range", ""), + pair("referer", ""), + pair("refresh", ""), + pair("retry-after", ""), + pair("server", ""), + pair("set-cookie", ""), + pair("strict-transport-security", ""), + pair("transfer-encoding", ""), + pair("user-agent", ""), + pair("vary", ""), + pair("via", ""), + pair("www-authenticate", ""), +} + +var huffmanCodes = []uint32{ + 0x1ff8, + 0x7fffd8, + 0xfffffe2, + 0xfffffe3, + 0xfffffe4, + 0xfffffe5, + 0xfffffe6, + 0xfffffe7, + 0xfffffe8, + 0xffffea, + 0x3ffffffc, + 0xfffffe9, + 0xfffffea, + 0x3ffffffd, + 0xfffffeb, + 0xfffffec, + 0xfffffed, + 0xfffffee, + 0xfffffef, + 0xffffff0, + 0xffffff1, + 0xffffff2, + 0x3ffffffe, + 0xffffff3, + 0xffffff4, + 0xffffff5, + 0xffffff6, + 0xffffff7, + 0xffffff8, + 0xffffff9, + 0xffffffa, + 0xffffffb, + 0x14, + 0x3f8, + 0x3f9, + 0xffa, + 0x1ff9, + 0x15, + 0xf8, + 0x7fa, + 0x3fa, + 0x3fb, + 0xf9, + 0x7fb, + 0xfa, + 0x16, + 0x17, + 0x18, + 0x0, + 0x1, + 0x2, + 0x19, + 0x1a, + 0x1b, + 0x1c, + 0x1d, + 0x1e, + 0x1f, + 0x5c, + 0xfb, + 0x7ffc, + 0x20, + 0xffb, + 0x3fc, + 0x1ffa, + 0x21, + 0x5d, + 0x5e, + 0x5f, + 0x60, + 0x61, + 0x62, + 0x63, + 0x64, + 0x65, + 0x66, + 0x67, + 0x68, + 0x69, + 0x6a, + 0x6b, + 0x6c, + 0x6d, + 0x6e, + 0x6f, + 0x70, + 0x71, + 0x72, + 0xfc, + 0x73, + 0xfd, + 0x1ffb, + 0x7fff0, + 0x1ffc, + 0x3ffc, + 0x22, + 0x7ffd, + 0x3, + 0x23, + 0x4, + 0x24, + 0x5, + 0x25, + 0x26, + 0x27, + 0x6, + 0x74, + 0x75, + 0x28, + 0x29, + 0x2a, + 0x7, + 0x2b, + 0x76, + 0x2c, + 0x8, + 0x9, + 0x2d, + 0x77, + 0x78, + 0x79, + 0x7a, + 0x7b, + 0x7ffe, + 0x7fc, + 0x3ffd, + 0x1ffd, + 0xffffffc, + 0xfffe6, + 0x3fffd2, + 0xfffe7, + 0xfffe8, + 0x3fffd3, + 0x3fffd4, + 0x3fffd5, + 0x7fffd9, + 0x3fffd6, + 0x7fffda, + 0x7fffdb, + 0x7fffdc, + 0x7fffdd, + 0x7fffde, + 0xffffeb, + 0x7fffdf, + 0xffffec, + 0xffffed, + 0x3fffd7, + 0x7fffe0, + 0xffffee, + 0x7fffe1, + 0x7fffe2, + 0x7fffe3, + 0x7fffe4, + 0x1fffdc, + 0x3fffd8, + 0x7fffe5, + 0x3fffd9, + 0x7fffe6, + 0x7fffe7, + 0xffffef, + 0x3fffda, + 0x1fffdd, + 0xfffe9, + 0x3fffdb, + 0x3fffdc, + 0x7fffe8, + 0x7fffe9, + 0x1fffde, + 0x7fffea, + 0x3fffdd, + 0x3fffde, + 0xfffff0, + 0x1fffdf, + 0x3fffdf, + 0x7fffeb, + 0x7fffec, + 0x1fffe0, + 0x1fffe1, + 0x3fffe0, + 0x1fffe2, + 0x7fffed, + 0x3fffe1, + 0x7fffee, + 0x7fffef, + 0xfffea, + 0x3fffe2, + 0x3fffe3, + 0x3fffe4, + 0x7ffff0, + 0x3fffe5, + 0x3fffe6, + 0x7ffff1, + 0x3ffffe0, + 0x3ffffe1, + 0xfffeb, + 0x7fff1, + 0x3fffe7, + 0x7ffff2, + 0x3fffe8, + 0x1ffffec, + 0x3ffffe2, + 0x3ffffe3, + 0x3ffffe4, + 0x7ffffde, + 0x7ffffdf, + 0x3ffffe5, + 0xfffff1, + 0x1ffffed, + 0x7fff2, + 0x1fffe3, + 0x3ffffe6, + 0x7ffffe0, + 0x7ffffe1, + 0x3ffffe7, + 0x7ffffe2, + 0xfffff2, + 0x1fffe4, + 0x1fffe5, + 0x3ffffe8, + 0x3ffffe9, + 0xffffffd, + 0x7ffffe3, + 0x7ffffe4, + 0x7ffffe5, + 0xfffec, + 0xfffff3, + 0xfffed, + 0x1fffe6, + 0x3fffe9, + 0x1fffe7, + 0x1fffe8, + 0x7ffff3, + 0x3fffea, + 0x3fffeb, + 0x1ffffee, + 0x1ffffef, + 0xfffff4, + 0xfffff5, + 0x3ffffea, + 0x7ffff4, + 0x3ffffeb, + 0x7ffffe6, + 0x3ffffec, + 0x3ffffed, + 0x7ffffe7, + 0x7ffffe8, + 0x7ffffe9, + 0x7ffffea, + 0x7ffffeb, + 0xffffffe, + 0x7ffffec, + 0x7ffffed, + 0x7ffffee, + 0x7ffffef, + 0x7fffff0, + 0x3ffffee, +} + +var huffmanCodeLen = []uint8{ + 13, 23, 28, 28, 28, 28, 28, 28, 28, 24, 30, 28, 28, 30, 28, 28, + 28, 28, 28, 28, 28, 28, 30, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 6, 10, 10, 12, 13, 6, 8, 11, 10, 10, 8, 11, 8, 6, 6, 6, + 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 8, 15, 6, 12, 10, + 13, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 8, 7, 8, 13, 19, 13, 14, 6, + 15, 5, 6, 5, 6, 5, 6, 6, 6, 5, 7, 7, 6, 6, 6, 5, + 6, 7, 6, 5, 5, 6, 7, 7, 7, 7, 7, 15, 11, 14, 13, 28, + 20, 22, 20, 20, 22, 22, 22, 23, 22, 23, 23, 23, 23, 23, 24, 23, + 24, 24, 22, 23, 24, 23, 23, 23, 23, 21, 22, 23, 22, 23, 23, 24, + 22, 21, 20, 22, 22, 23, 23, 21, 23, 22, 22, 24, 21, 22, 23, 23, + 21, 21, 22, 21, 23, 22, 23, 23, 20, 22, 22, 22, 23, 22, 22, 23, + 26, 26, 20, 19, 22, 23, 22, 25, 26, 26, 26, 27, 27, 26, 24, 25, + 19, 21, 26, 27, 27, 26, 27, 24, 21, 21, 26, 26, 28, 27, 27, 27, + 20, 24, 20, 21, 22, 21, 21, 23, 22, 22, 25, 25, 24, 24, 26, 23, + 26, 27, 26, 26, 27, 27, 27, 27, 27, 28, 27, 27, 27, 27, 27, 26, +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/http2.go b/Godeps/_workspace/src/github.com/bradfitz/http2/http2.go new file mode 100644 index 000000000..35f9b26e2 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/http2.go @@ -0,0 +1,249 @@ +// 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. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +// Package http2 implements the HTTP/2 protocol. +// +// This is a work in progress. This package is low-level and intended +// to be used directly by very few people. Most users will use it +// indirectly through integration with the net/http package. See +// ConfigureServer. That ConfigureServer call will likely be automatic +// or available via an empty import in the future. +// +// See http://http2.github.io/ +package http2 + +import ( + "bufio" + "fmt" + "io" + "net/http" + "strconv" + "sync" +) + +var VerboseLogs = false + +const ( + // ClientPreface is the string that must be sent by new + // connections from clients. + ClientPreface = "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" + + // SETTINGS_MAX_FRAME_SIZE default + // http://http2.github.io/http2-spec/#rfc.section.6.5.2 + initialMaxFrameSize = 16384 + + // NextProtoTLS is the NPN/ALPN protocol negotiated during + // HTTP/2's TLS setup. + NextProtoTLS = "h2" + + // http://http2.github.io/http2-spec/#SettingValues + initialHeaderTableSize = 4096 + + initialWindowSize = 65535 // 6.9.2 Initial Flow Control Window Size + + defaultMaxReadFrameSize = 1 << 20 +) + +var ( + clientPreface = []byte(ClientPreface) +) + +type streamState int + +const ( + stateIdle streamState = iota + stateOpen + stateHalfClosedLocal + stateHalfClosedRemote + stateResvLocal + stateResvRemote + stateClosed +) + +var stateName = [...]string{ + stateIdle: "Idle", + stateOpen: "Open", + stateHalfClosedLocal: "HalfClosedLocal", + stateHalfClosedRemote: "HalfClosedRemote", + stateResvLocal: "ResvLocal", + stateResvRemote: "ResvRemote", + stateClosed: "Closed", +} + +func (st streamState) String() string { + return stateName[st] +} + +// Setting is a setting parameter: which setting it is, and its value. +type Setting struct { + // ID is which setting is being set. + // See http://http2.github.io/http2-spec/#SettingValues + ID SettingID + + // Val is the value. + Val uint32 +} + +func (s Setting) String() string { + return fmt.Sprintf("[%v = %d]", s.ID, s.Val) +} + +// Valid reports whether the setting is valid. +func (s Setting) Valid() error { + // Limits and error codes from 6.5.2 Defined SETTINGS Parameters + switch s.ID { + case SettingEnablePush: + if s.Val != 1 && s.Val != 0 { + return ConnectionError(ErrCodeProtocol) + } + case SettingInitialWindowSize: + if s.Val > 1<<31-1 { + return ConnectionError(ErrCodeFlowControl) + } + case SettingMaxFrameSize: + if s.Val < 16384 || s.Val > 1<<24-1 { + return ConnectionError(ErrCodeProtocol) + } + } + return nil +} + +// A SettingID is an HTTP/2 setting as defined in +// http://http2.github.io/http2-spec/#iana-settings +type SettingID uint16 + +const ( + SettingHeaderTableSize SettingID = 0x1 + SettingEnablePush SettingID = 0x2 + SettingMaxConcurrentStreams SettingID = 0x3 + SettingInitialWindowSize SettingID = 0x4 + SettingMaxFrameSize SettingID = 0x5 + SettingMaxHeaderListSize SettingID = 0x6 +) + +var settingName = map[SettingID]string{ + SettingHeaderTableSize: "HEADER_TABLE_SIZE", + SettingEnablePush: "ENABLE_PUSH", + SettingMaxConcurrentStreams: "MAX_CONCURRENT_STREAMS", + SettingInitialWindowSize: "INITIAL_WINDOW_SIZE", + SettingMaxFrameSize: "MAX_FRAME_SIZE", + SettingMaxHeaderListSize: "MAX_HEADER_LIST_SIZE", +} + +func (s SettingID) String() string { + if v, ok := settingName[s]; ok { + return v + } + return fmt.Sprintf("UNKNOWN_SETTING_%d", uint16(s)) +} + +func validHeader(v string) bool { + if len(v) == 0 { + return false + } + for _, r := range v { + // "Just as in HTTP/1.x, header field names are + // strings of ASCII characters that are compared in a + // case-insensitive fashion. However, header field + // names MUST be converted to lowercase prior to their + // encoding in HTTP/2. " + if r >= 127 || ('A' <= r && r <= 'Z') { + return false + } + } + return true +} + +var httpCodeStringCommon = map[int]string{} // n -> strconv.Itoa(n) + +func init() { + for i := 100; i <= 999; i++ { + if v := http.StatusText(i); v != "" { + httpCodeStringCommon[i] = strconv.Itoa(i) + } + } +} + +func httpCodeString(code int) string { + if s, ok := httpCodeStringCommon[code]; ok { + return s + } + return strconv.Itoa(code) +} + +// from pkg io +type stringWriter interface { + WriteString(s string) (n int, err error) +} + +// A gate lets two goroutines coordinate their activities. +type gate chan struct{} + +func (g gate) Done() { g <- struct{}{} } +func (g gate) Wait() { <-g } + +// A closeWaiter is like a sync.WaitGroup but only goes 1 to 0 (open to closed). +type closeWaiter chan struct{} + +// Init makes a closeWaiter usable. +// It exists because so a closeWaiter value can be placed inside a +// larger struct and have the Mutex and Cond's memory in the same +// allocation. +func (cw *closeWaiter) Init() { + *cw = make(chan struct{}) +} + +// Close marks the closeWaiter as closed and unblocks any waiters. +func (cw closeWaiter) Close() { + close(cw) +} + +// Wait waits for the closeWaiter to become closed. +func (cw closeWaiter) Wait() { + <-cw +} + +// bufferedWriter is a buffered writer that writes to w. +// Its buffered writer is lazily allocated as needed, to minimize +// idle memory usage with many connections. +type bufferedWriter struct { + w io.Writer // immutable + bw *bufio.Writer // non-nil when data is buffered +} + +func newBufferedWriter(w io.Writer) *bufferedWriter { + return &bufferedWriter{w: w} +} + +var bufWriterPool = sync.Pool{ + New: func() interface{} { + // TODO: pick something better? this is a bit under + // (3 x typical 1500 byte MTU) at least. + return bufio.NewWriterSize(nil, 4<<10) + }, +} + +func (w *bufferedWriter) Write(p []byte) (n int, err error) { + if w.bw == nil { + bw := bufWriterPool.Get().(*bufio.Writer) + bw.Reset(w.w) + w.bw = bw + } + return w.bw.Write(p) +} + +func (w *bufferedWriter) Flush() error { + bw := w.bw + if bw == nil { + return nil + } + err := bw.Flush() + bw.Reset(nil) + bufWriterPool.Put(bw) + w.bw = nil + return err +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/http2_test.go b/Godeps/_workspace/src/github.com/bradfitz/http2/http2_test.go new file mode 100644 index 000000000..6a1b7e836 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/http2_test.go @@ -0,0 +1,152 @@ +// 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. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +package http2 + +import ( + "bytes" + "errors" + "flag" + "fmt" + "net/http" + "os/exec" + "strconv" + "strings" + "testing" + + "github.com/bradfitz/http2/hpack" +) + +var knownFailing = flag.Bool("known_failing", false, "Run known-failing tests.") + +func condSkipFailingTest(t *testing.T) { + if !*knownFailing { + t.Skip("Skipping known-failing test without --known_failing") + } +} + +func init() { + DebugGoroutines = true + flag.BoolVar(&VerboseLogs, "verboseh2", false, "Verbose HTTP/2 debug logging") +} + +func TestSettingString(t *testing.T) { + tests := []struct { + s Setting + want string + }{ + {Setting{SettingMaxFrameSize, 123}, "[MAX_FRAME_SIZE = 123]"}, + {Setting{1<<16 - 1, 123}, "[UNKNOWN_SETTING_65535 = 123]"}, + } + for i, tt := range tests { + got := fmt.Sprint(tt.s) + if got != tt.want { + t.Errorf("%d. for %#v, string = %q; want %q", i, tt.s, got, tt.want) + } + } +} + +type twriter struct { + t testing.TB + st *serverTester // optional +} + +func (w twriter) Write(p []byte) (n int, err error) { + if w.st != nil { + ps := string(p) + for _, phrase := range w.st.logFilter { + if strings.Contains(ps, phrase) { + return len(p), nil // no logging + } + } + } + w.t.Logf("%s", p) + return len(p), nil +} + +// like encodeHeader, but don't add implicit psuedo headers. +func encodeHeaderNoImplicit(t *testing.T, headers ...string) []byte { + var buf bytes.Buffer + enc := hpack.NewEncoder(&buf) + for len(headers) > 0 { + k, v := headers[0], headers[1] + headers = headers[2:] + if err := enc.WriteField(hpack.HeaderField{Name: k, Value: v}); err != nil { + t.Fatalf("HPACK encoding error for %q/%q: %v", k, v, err) + } + } + return buf.Bytes() +} + +// Verify that curl has http2. +func requireCurl(t *testing.T) { + out, err := dockerLogs(curl(t, "--version")) + if err != nil { + t.Skipf("failed to determine curl features; skipping test") + } + if !strings.Contains(string(out), "HTTP2") { + t.Skip("curl doesn't support HTTP2; skipping test") + } +} + +func curl(t *testing.T, args ...string) (container string) { + out, err := exec.Command("docker", append([]string{"run", "-d", "--net=host", "gohttp2/curl"}, args...)...).CombinedOutput() + if err != nil { + t.Skipf("Failed to run curl in docker: %v, %s", err, out) + } + return strings.TrimSpace(string(out)) +} + +type puppetCommand struct { + fn func(w http.ResponseWriter, r *http.Request) + done chan<- bool +} + +type handlerPuppet struct { + ch chan puppetCommand +} + +func newHandlerPuppet() *handlerPuppet { + return &handlerPuppet{ + ch: make(chan puppetCommand), + } +} + +func (p *handlerPuppet) act(w http.ResponseWriter, r *http.Request) { + for cmd := range p.ch { + cmd.fn(w, r) + cmd.done <- true + } +} + +func (p *handlerPuppet) done() { close(p.ch) } +func (p *handlerPuppet) do(fn func(http.ResponseWriter, *http.Request)) { + done := make(chan bool) + p.ch <- puppetCommand{fn, done} + <-done +} +func dockerLogs(container string) ([]byte, error) { + out, err := exec.Command("docker", "wait", container).CombinedOutput() + if err != nil { + return out, err + } + exitStatus, err := strconv.Atoi(strings.TrimSpace(string(out))) + if err != nil { + return out, errors.New("unexpected exit status from docker wait") + } + out, err = exec.Command("docker", "logs", container).CombinedOutput() + exec.Command("docker", "rm", container).Run() + if err == nil && exitStatus != 0 { + err = fmt.Errorf("exit status %d: %s", exitStatus, out) + } + return out, err +} + +func kill(container string) { + exec.Command("docker", "kill", container).Run() + exec.Command("docker", "rm", container).Run() +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/pipe.go b/Godeps/_workspace/src/github.com/bradfitz/http2/pipe.go new file mode 100644 index 000000000..ce9aad533 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/pipe.go @@ -0,0 +1,43 @@ +// Copyright 2014 The Go Authors. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +package http2 + +import ( + "sync" +) + +type pipe struct { + b buffer + c sync.Cond + m sync.Mutex +} + +// Read waits until data is available and copies bytes +// from the buffer into p. +func (r *pipe) Read(p []byte) (n int, err error) { + r.c.L.Lock() + defer r.c.L.Unlock() + for r.b.Len() == 0 && !r.b.closed { + r.c.Wait() + } + return r.b.Read(p) +} + +// Write copies bytes from p into the buffer and wakes a reader. +// It is an error to write more data than the buffer can hold. +func (w *pipe) Write(p []byte) (n int, err error) { + w.c.L.Lock() + defer w.c.L.Unlock() + defer w.c.Signal() + return w.b.Write(p) +} + +func (c *pipe) Close(err error) { + c.c.L.Lock() + defer c.c.L.Unlock() + defer c.c.Signal() + c.b.Close(err) +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/pipe_test.go b/Godeps/_workspace/src/github.com/bradfitz/http2/pipe_test.go new file mode 100644 index 000000000..10c4c327c --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/pipe_test.go @@ -0,0 +1,24 @@ +// Copyright 2014 The Go Authors. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +package http2 + +import ( + "errors" + "testing" +) + +func TestPipeClose(t *testing.T) { + var p pipe + p.c.L = &p.m + a := errors.New("a") + b := errors.New("b") + p.Close(a) + p.Close(b) + _, err := p.Read(make([]byte, 1)) + if err != a { + t.Errorf("err = %v want %v", err, a) + } +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/priority_test.go b/Godeps/_workspace/src/github.com/bradfitz/http2/priority_test.go new file mode 100644 index 000000000..d9648fd32 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/priority_test.go @@ -0,0 +1,121 @@ +// 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. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +package http2 + +import ( + "testing" +) + +func TestPriority(t *testing.T) { + // A -> B + // move A's parent to B + streams := make(map[uint32]*stream) + a := &stream{ + parent: nil, + weight: 16, + } + streams[1] = a + b := &stream{ + parent: a, + weight: 16, + } + streams[2] = b + adjustStreamPriority(streams, 1, PriorityParam{ + Weight: 20, + StreamDep: 2, + }) + if a.parent != b { + t.Errorf("Expected A's parent to be B") + } + if a.weight != 20 { + t.Errorf("Expected A's weight to be 20; got %d", a.weight) + } + if b.parent != nil { + t.Errorf("Expected B to have no parent") + } + if b.weight != 16 { + t.Errorf("Expected B's weight to be 16; got %d", b.weight) + } +} + +func TestPriorityExclusiveZero(t *testing.T) { + // A B and C are all children of the 0 stream. + // Exclusive reprioritization to any of the streams + // should bring the rest of the streams under the + // reprioritized stream + streams := make(map[uint32]*stream) + a := &stream{ + parent: nil, + weight: 16, + } + streams[1] = a + b := &stream{ + parent: nil, + weight: 16, + } + streams[2] = b + c := &stream{ + parent: nil, + weight: 16, + } + streams[3] = c + adjustStreamPriority(streams, 3, PriorityParam{ + Weight: 20, + StreamDep: 0, + Exclusive: true, + }) + if a.parent != c { + t.Errorf("Expected A's parent to be C") + } + if a.weight != 16 { + t.Errorf("Expected A's weight to be 16; got %d", a.weight) + } + if b.parent != c { + t.Errorf("Expected B's parent to be C") + } + if b.weight != 16 { + t.Errorf("Expected B's weight to be 16; got %d", b.weight) + } + if c.parent != nil { + t.Errorf("Expected C to have no parent") + } + if c.weight != 20 { + t.Errorf("Expected C's weight to be 20; got %d", b.weight) + } +} + +func TestPriorityOwnParent(t *testing.T) { + streams := make(map[uint32]*stream) + a := &stream{ + parent: nil, + weight: 16, + } + streams[1] = a + b := &stream{ + parent: a, + weight: 16, + } + streams[2] = b + adjustStreamPriority(streams, 1, PriorityParam{ + Weight: 20, + StreamDep: 1, + }) + if a.parent != nil { + t.Errorf("Expected A's parent to be nil") + } + if a.weight != 20 { + t.Errorf("Expected A's weight to be 20; got %d", a.weight) + } + if b.parent != a { + t.Errorf("Expected B's parent to be A") + } + if b.weight != 16 { + t.Errorf("Expected B's weight to be 16; got %d", b.weight) + } + +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/server.go b/Godeps/_workspace/src/github.com/bradfitz/http2/server.go new file mode 100644 index 000000000..aa0e7bdc8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/server.go @@ -0,0 +1,1780 @@ +// 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. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +// TODO: replace all <-sc.doneServing with reads from the stream's cw +// instead, and make sure that on close we close all open +// streams. then remove doneServing? + +// TODO: finish GOAWAY support. Consider each incoming frame type and +// whether it should be ignored during a shutdown race. + +// TODO: disconnect idle clients. GFE seems to do 4 minutes. make +// configurable? or maximum number of idle clients and remove the +// oldest? + +// TODO: turn off the serve goroutine when idle, so +// an idle conn only has the readFrames goroutine active. (which could +// also be optimized probably to pin less memory in crypto/tls). This +// would involve tracking when the serve goroutine is active (atomic +// int32 read/CAS probably?) and starting it up when frames arrive, +// and shutting it down when all handlers exit. the occasional PING +// packets could use time.AfterFunc to call sc.wakeStartServeLoop() +// (which is a no-op if already running) and then queue the PING write +// as normal. The serve loop would then exit in most cases (if no +// Handlers running) and not be woken up again until the PING packet +// returns. + +// TODO (maybe): add a mechanism for Handlers to going into +// half-closed-local mode (rw.(io.Closer) test?) but not exit their +// handler, and continue to be able to read from the +// Request.Body. This would be a somewhat semantic change from HTTP/1 +// (or at least what we expose in net/http), so I'd probably want to +// add it there too. For now, this package says that returning from +// the Handler ServeHTTP function means you're both done reading and +// done writing, without a way to stop just one or the other. + +package http2 + +import ( + "bufio" + "bytes" + "crypto/tls" + "errors" + "fmt" + "io" + "log" + "net" + "net/http" + "net/url" + "strconv" + "strings" + "sync" + "time" + + "github.com/bradfitz/http2/hpack" +) + +const ( + prefaceTimeout = 10 * time.Second + firstSettingsTimeout = 2 * time.Second // should be in-flight with preface anyway + handlerChunkWriteSize = 4 << 10 + defaultMaxStreams = 250 // TODO: make this 100 as the GFE seems to? +) + +var ( + errClientDisconnected = errors.New("client disconnected") + errClosedBody = errors.New("body closed by handler") + errStreamBroken = errors.New("http2: stream broken") +) + +var responseWriterStatePool = sync.Pool{ + New: func() interface{} { + rws := &responseWriterState{} + rws.bw = bufio.NewWriterSize(chunkWriter{rws}, handlerChunkWriteSize) + return rws + }, +} + +// Test hooks. +var ( + testHookOnConn func() + testHookGetServerConn func(*serverConn) + testHookOnPanicMu *sync.Mutex // nil except in tests + testHookOnPanic func(sc *serverConn, panicVal interface{}) (rePanic bool) +) + +// Server is an HTTP/2 server. +type Server struct { + // MaxHandlers limits the number of http.Handler ServeHTTP goroutines + // which may run at a time over all connections. + // Negative or zero no limit. + // TODO: implement + MaxHandlers int + + // MaxConcurrentStreams optionally specifies the number of + // concurrent streams that each client may have open at a + // time. This is unrelated to the number of http.Handler goroutines + // which may be active globally, which is MaxHandlers. + // If zero, MaxConcurrentStreams defaults to at least 100, per + // the HTTP/2 spec's recommendations. + MaxConcurrentStreams uint32 + + // MaxReadFrameSize optionally specifies the largest frame + // this server is willing to read. A valid value is between + // 16k and 16M, inclusive. If zero or otherwise invalid, a + // default value is used. + MaxReadFrameSize uint32 + + // PermitProhibitedCipherSuites, if true, permits the use of + // cipher suites prohibited by the HTTP/2 spec. + PermitProhibitedCipherSuites bool +} + +func (s *Server) maxReadFrameSize() uint32 { + if v := s.MaxReadFrameSize; v >= minMaxFrameSize && v <= maxFrameSize { + return v + } + return defaultMaxReadFrameSize +} + +func (s *Server) maxConcurrentStreams() uint32 { + if v := s.MaxConcurrentStreams; v > 0 { + return v + } + return defaultMaxStreams +} + +// ConfigureServer adds HTTP/2 support to a net/http Server. +// +// The configuration conf may be nil. +// +// ConfigureServer must be called before s begins serving. +func ConfigureServer(s *http.Server, conf *Server) { + if conf == nil { + conf = new(Server) + } + if s.TLSConfig == nil { + s.TLSConfig = new(tls.Config) + } + + // Note: not setting MinVersion to tls.VersionTLS12, + // as we don't want to interfere with HTTP/1.1 traffic + // on the user's server. We enforce TLS 1.2 later once + // we accept a connection. Ideally this should be done + // during next-proto selection, but using TLS <1.2 with + // HTTP/2 is still the client's bug. + + // Be sure we advertise tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 + // at least. + // TODO: enable PreferServerCipherSuites? + if s.TLSConfig.CipherSuites != nil { + const requiredCipher = tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 + haveRequired := false + for _, v := range s.TLSConfig.CipherSuites { + if v == requiredCipher { + haveRequired = true + break + } + } + if !haveRequired { + s.TLSConfig.CipherSuites = append(s.TLSConfig.CipherSuites, requiredCipher) + } + } + + haveNPN := false + for _, p := range s.TLSConfig.NextProtos { + if p == NextProtoTLS { + haveNPN = true + break + } + } + if !haveNPN { + s.TLSConfig.NextProtos = append(s.TLSConfig.NextProtos, NextProtoTLS) + } + // h2-14 is temporary (as of 2015-03-05) while we wait for all browsers + // to switch to "h2". + s.TLSConfig.NextProtos = append(s.TLSConfig.NextProtos, "h2-14") + + if s.TLSNextProto == nil { + s.TLSNextProto = map[string]func(*http.Server, *tls.Conn, http.Handler){} + } + protoHandler := func(hs *http.Server, c *tls.Conn, h http.Handler) { + if testHookOnConn != nil { + testHookOnConn() + } + conf.handleConn(hs, c, h) + } + s.TLSNextProto[NextProtoTLS] = protoHandler + s.TLSNextProto["h2-14"] = protoHandler // temporary; see above. +} + +func (srv *Server) handleConn(hs *http.Server, c net.Conn, h http.Handler) { + sc := &serverConn{ + srv: srv, + hs: hs, + conn: c, + remoteAddrStr: c.RemoteAddr().String(), + bw: newBufferedWriter(c), + handler: h, + streams: make(map[uint32]*stream), + readFrameCh: make(chan frameAndGate), + readFrameErrCh: make(chan error, 1), // must be buffered for 1 + wantWriteFrameCh: make(chan frameWriteMsg, 8), + wroteFrameCh: make(chan struct{}, 1), // buffered; one send in reading goroutine + bodyReadCh: make(chan bodyReadMsg), // buffering doesn't matter either way + doneServing: make(chan struct{}), + advMaxStreams: srv.maxConcurrentStreams(), + writeSched: writeScheduler{ + maxFrameSize: initialMaxFrameSize, + }, + initialWindowSize: initialWindowSize, + headerTableSize: initialHeaderTableSize, + serveG: newGoroutineLock(), + pushEnabled: true, + } + sc.flow.add(initialWindowSize) + sc.inflow.add(initialWindowSize) + sc.hpackEncoder = hpack.NewEncoder(&sc.headerWriteBuf) + sc.hpackDecoder = hpack.NewDecoder(initialHeaderTableSize, sc.onNewHeaderField) + + fr := NewFramer(sc.bw, c) + fr.SetMaxReadFrameSize(srv.maxReadFrameSize()) + sc.framer = fr + + if tc, ok := c.(*tls.Conn); ok { + sc.tlsState = new(tls.ConnectionState) + *sc.tlsState = tc.ConnectionState() + // 9.2 Use of TLS Features + // An implementation of HTTP/2 over TLS MUST use TLS + // 1.2 or higher with the restrictions on feature set + // and cipher suite described in this section. Due to + // implementation limitations, it might not be + // possible to fail TLS negotiation. An endpoint MUST + // immediately terminate an HTTP/2 connection that + // does not meet the TLS requirements described in + // this section with a connection error (Section + // 5.4.1) of type INADEQUATE_SECURITY. + if sc.tlsState.Version < tls.VersionTLS12 { + sc.rejectConn(ErrCodeInadequateSecurity, "TLS version too low") + return + } + + if sc.tlsState.ServerName == "" { + // Client must use SNI, but we don't enforce that anymore, + // since it was causing problems when connecting to bare IP + // addresses during development. + // + // TODO: optionally enforce? Or enforce at the time we receive + // a new request, and verify the the ServerName matches the :authority? + // But that precludes proxy situations, perhaps. + // + // So for now, do nothing here again. + } + + if !srv.PermitProhibitedCipherSuites && isBadCipher(sc.tlsState.CipherSuite) { + // "Endpoints MAY choose to generate a connection error + // (Section 5.4.1) of type INADEQUATE_SECURITY if one of + // the prohibited cipher suites are negotiated." + // + // We choose that. In my opinion, the spec is weak + // here. It also says both parties must support at least + // TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 so there's no + // excuses here. If we really must, we could allow an + // "AllowInsecureWeakCiphers" option on the server later. + // Let's see how it plays out first. + sc.rejectConn(ErrCodeInadequateSecurity, fmt.Sprintf("Prohibited TLS 1.2 Cipher Suite: %x", sc.tlsState.CipherSuite)) + return + } + } + + if hook := testHookGetServerConn; hook != nil { + hook(sc) + } + sc.serve() +} + +// isBadCipher reports whether the cipher is blacklisted by the HTTP/2 spec. +func isBadCipher(cipher uint16) bool { + switch cipher { + case tls.TLS_RSA_WITH_RC4_128_SHA, + tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA, + tls.TLS_RSA_WITH_AES_128_CBC_SHA, + tls.TLS_RSA_WITH_AES_256_CBC_SHA, + tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, + tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, + tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, + tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA, + tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, + tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA: + // Reject cipher suites from Appendix A. + // "This list includes those cipher suites that do not + // offer an ephemeral key exchange and those that are + // based on the TLS null, stream or block cipher type" + return true + default: + return false + } +} + +func (sc *serverConn) rejectConn(err ErrCode, debug string) { + log.Printf("REJECTING conn: %v, %s", err, debug) + // ignoring errors. hanging up anyway. + sc.framer.WriteGoAway(0, err, []byte(debug)) + sc.bw.Flush() + sc.conn.Close() +} + +// frameAndGates coordinates the readFrames and serve +// goroutines. Because the Framer interface only permits the most +// recently-read Frame from being accessed, the readFrames goroutine +// blocks until it has a frame, passes it to serve, and then waits for +// serve to be done with it before reading the next one. +type frameAndGate struct { + f Frame + g gate +} + +type serverConn struct { + // Immutable: + srv *Server + hs *http.Server + conn net.Conn + bw *bufferedWriter // writing to conn + handler http.Handler + framer *Framer + hpackDecoder *hpack.Decoder + doneServing chan struct{} // closed when serverConn.serve ends + readFrameCh chan frameAndGate // written by serverConn.readFrames + readFrameErrCh chan error + wantWriteFrameCh chan frameWriteMsg // from handlers -> serve + wroteFrameCh chan struct{} // from writeFrameAsync -> serve, tickles more frame writes + bodyReadCh chan bodyReadMsg // from handlers -> serve + testHookCh chan func() // code to run on the serve loop + flow flow // conn-wide (not stream-specific) outbound flow control + inflow flow // conn-wide inbound flow control + tlsState *tls.ConnectionState // shared by all handlers, like net/http + remoteAddrStr string + + // Everything following is owned by the serve loop; use serveG.check(): + serveG goroutineLock // used to verify funcs are on serve() + pushEnabled bool + sawFirstSettings bool // got the initial SETTINGS frame after the preface + needToSendSettingsAck bool + unackedSettings int // how many SETTINGS have we sent without ACKs? + clientMaxStreams uint32 // SETTINGS_MAX_CONCURRENT_STREAMS from client (our PUSH_PROMISE limit) + advMaxStreams uint32 // our SETTINGS_MAX_CONCURRENT_STREAMS advertised the client + curOpenStreams uint32 // client's number of open streams + maxStreamID uint32 // max ever seen + streams map[uint32]*stream + initialWindowSize int32 + headerTableSize uint32 + maxHeaderListSize uint32 // zero means unknown (default) + canonHeader map[string]string // http2-lower-case -> Go-Canonical-Case + req requestParam // non-zero while reading request headers + writingFrame bool // started write goroutine but haven't heard back on wroteFrameCh + needsFrameFlush bool // last frame write wasn't a flush + writeSched writeScheduler + inGoAway bool // we've started to or sent GOAWAY + needToSendGoAway bool // we need to schedule a GOAWAY frame write + goAwayCode ErrCode + shutdownTimerCh <-chan time.Time // nil until used + shutdownTimer *time.Timer // nil until used + + // Owned by the writeFrameAsync goroutine: + headerWriteBuf bytes.Buffer + hpackEncoder *hpack.Encoder +} + +// requestParam is the state of the next request, initialized over +// potentially several frames HEADERS + zero or more CONTINUATION +// frames. +type requestParam struct { + // stream is non-nil if we're reading (HEADER or CONTINUATION) + // frames for a request (but not DATA). + stream *stream + header http.Header + method, path string + scheme, authority string + sawRegularHeader bool // saw a non-pseudo header already + invalidHeader bool // an invalid header was seen +} + +// stream represents a stream. This is the minimal metadata needed by +// the serve goroutine. Most of the actual stream state is owned by +// the http.Handler's goroutine in the responseWriter. Because the +// responseWriter's responseWriterState is recycled at the end of a +// handler, this struct intentionally has no pointer to the +// *responseWriter{,State} itself, as the Handler ending nils out the +// responseWriter's state field. +type stream struct { + // immutable: + id uint32 + body *pipe // non-nil if expecting DATA frames + cw closeWaiter // closed wait stream transitions to closed state + + // owned by serverConn's serve loop: + bodyBytes int64 // body bytes seen so far + declBodyBytes int64 // or -1 if undeclared + flow flow // limits writing from Handler to client + inflow flow // what the client is allowed to POST/etc to us + parent *stream // or nil + weight uint8 + state streamState + sentReset bool // only true once detached from streams map + gotReset bool // only true once detacted from streams map +} + +func (sc *serverConn) Framer() *Framer { return sc.framer } +func (sc *serverConn) CloseConn() error { return sc.conn.Close() } +func (sc *serverConn) Flush() error { return sc.bw.Flush() } +func (sc *serverConn) HeaderEncoder() (*hpack.Encoder, *bytes.Buffer) { + return sc.hpackEncoder, &sc.headerWriteBuf +} + +func (sc *serverConn) state(streamID uint32) (streamState, *stream) { + sc.serveG.check() + // http://http2.github.io/http2-spec/#rfc.section.5.1 + if st, ok := sc.streams[streamID]; ok { + return st.state, st + } + // "The first use of a new stream identifier implicitly closes all + // streams in the "idle" state that might have been initiated by + // that peer with a lower-valued stream identifier. For example, if + // a client sends a HEADERS frame on stream 7 without ever sending a + // frame on stream 5, then stream 5 transitions to the "closed" + // state when the first frame for stream 7 is sent or received." + if streamID <= sc.maxStreamID { + return stateClosed, nil + } + return stateIdle, nil +} + +func (sc *serverConn) vlogf(format string, args ...interface{}) { + if VerboseLogs { + sc.logf(format, args...) + } +} + +func (sc *serverConn) logf(format string, args ...interface{}) { + if lg := sc.hs.ErrorLog; lg != nil { + lg.Printf(format, args...) + } else { + log.Printf(format, args...) + } +} + +func (sc *serverConn) condlogf(err error, format string, args ...interface{}) { + if err == nil { + return + } + str := err.Error() + if err == io.EOF || strings.Contains(str, "use of closed network connection") { + // Boring, expected errors. + sc.vlogf(format, args...) + } else { + sc.logf(format, args...) + } +} + +func (sc *serverConn) onNewHeaderField(f hpack.HeaderField) { + sc.serveG.check() + sc.vlogf("got header field %+v", f) + switch { + case !validHeader(f.Name): + sc.req.invalidHeader = true + case strings.HasPrefix(f.Name, ":"): + if sc.req.sawRegularHeader { + sc.logf("pseudo-header after regular header") + sc.req.invalidHeader = true + return + } + var dst *string + switch f.Name { + case ":method": + dst = &sc.req.method + case ":path": + dst = &sc.req.path + case ":scheme": + dst = &sc.req.scheme + case ":authority": + dst = &sc.req.authority + default: + // 8.1.2.1 Pseudo-Header Fields + // "Endpoints MUST treat a request or response + // that contains undefined or invalid + // pseudo-header fields as malformed (Section + // 8.1.2.6)." + sc.logf("invalid pseudo-header %q", f.Name) + sc.req.invalidHeader = true + return + } + if *dst != "" { + sc.logf("duplicate pseudo-header %q sent", f.Name) + sc.req.invalidHeader = true + return + } + *dst = f.Value + case f.Name == "cookie": + sc.req.sawRegularHeader = true + if s, ok := sc.req.header["Cookie"]; ok && len(s) == 1 { + s[0] = s[0] + "; " + f.Value + } else { + sc.req.header.Add("Cookie", f.Value) + } + default: + sc.req.sawRegularHeader = true + sc.req.header.Add(sc.canonicalHeader(f.Name), f.Value) + } +} + +func (sc *serverConn) canonicalHeader(v string) string { + sc.serveG.check() + cv, ok := commonCanonHeader[v] + if ok { + return cv + } + cv, ok = sc.canonHeader[v] + if ok { + return cv + } + if sc.canonHeader == nil { + sc.canonHeader = make(map[string]string) + } + cv = http.CanonicalHeaderKey(v) + sc.canonHeader[v] = cv + return cv +} + +// readFrames is the loop that reads incoming frames. +// It's run on its own goroutine. +func (sc *serverConn) readFrames() { + g := make(gate, 1) + for { + f, err := sc.framer.ReadFrame() + if err != nil { + sc.readFrameErrCh <- err + close(sc.readFrameCh) + return + } + sc.readFrameCh <- frameAndGate{f, g} + // We can't read another frame until this one is + // processed, as the ReadFrame interface doesn't copy + // memory. The Frame accessor methods access the last + // frame's (shared) buffer. So we wait for the + // serve goroutine to tell us it's done: + g.Wait() + } +} + +// writeFrameAsync runs in its own goroutine and writes a single frame +// and then reports when it's done. +// At most one goroutine can be running writeFrameAsync at a time per +// serverConn. +func (sc *serverConn) writeFrameAsync(wm frameWriteMsg) { + err := wm.write.writeFrame(sc) + if ch := wm.done; ch != nil { + select { + case ch <- err: + default: + panic(fmt.Sprintf("unbuffered done channel passed in for type %T", wm.write)) + } + } + sc.wroteFrameCh <- struct{}{} // tickle frame selection scheduler +} + +func (sc *serverConn) closeAllStreamsOnConnClose() { + sc.serveG.check() + for _, st := range sc.streams { + sc.closeStream(st, errClientDisconnected) + } +} + +func (sc *serverConn) stopShutdownTimer() { + sc.serveG.check() + if t := sc.shutdownTimer; t != nil { + t.Stop() + } +} + +func (sc *serverConn) notePanic() { + if testHookOnPanicMu != nil { + testHookOnPanicMu.Lock() + defer testHookOnPanicMu.Unlock() + } + if testHookOnPanic != nil { + if e := recover(); e != nil { + if testHookOnPanic(sc, e) { + panic(e) + } + } + } +} + +func (sc *serverConn) serve() { + sc.serveG.check() + defer sc.notePanic() + defer sc.conn.Close() + defer sc.closeAllStreamsOnConnClose() + defer sc.stopShutdownTimer() + defer close(sc.doneServing) // unblocks handlers trying to send + + sc.vlogf("HTTP/2 connection from %v on %p", sc.conn.RemoteAddr(), sc.hs) + + sc.writeFrame(frameWriteMsg{ + write: writeSettings{ + {SettingMaxFrameSize, sc.srv.maxReadFrameSize()}, + {SettingMaxConcurrentStreams, sc.advMaxStreams}, + + // TODO: more actual settings, notably + // SettingInitialWindowSize, but then we also + // want to bump up the conn window size the + // same amount here right after the settings + }, + }) + sc.unackedSettings++ + + if err := sc.readPreface(); err != nil { + sc.condlogf(err, "error reading preface from client %v: %v", sc.conn.RemoteAddr(), err) + return + } + + go sc.readFrames() // closed by defer sc.conn.Close above + + settingsTimer := time.NewTimer(firstSettingsTimeout) + for { + select { + case wm := <-sc.wantWriteFrameCh: + sc.writeFrame(wm) + case <-sc.wroteFrameCh: + if sc.writingFrame != true { + panic("internal error: expected to be already writing a frame") + } + sc.writingFrame = false + sc.scheduleFrameWrite() + case fg, ok := <-sc.readFrameCh: + if !ok { + sc.readFrameCh = nil + } + if !sc.processFrameFromReader(fg, ok) { + return + } + if settingsTimer.C != nil { + settingsTimer.Stop() + settingsTimer.C = nil + } + case m := <-sc.bodyReadCh: + sc.noteBodyRead(m.st, m.n) + case <-settingsTimer.C: + sc.logf("timeout waiting for SETTINGS frames from %v", sc.conn.RemoteAddr()) + return + case <-sc.shutdownTimerCh: + sc.vlogf("GOAWAY close timer fired; closing conn from %v", sc.conn.RemoteAddr()) + return + case fn := <-sc.testHookCh: + fn() + } + } +} + +// readPreface reads the ClientPreface greeting from the peer +// or returns an error on timeout or an invalid greeting. +func (sc *serverConn) readPreface() error { + errc := make(chan error, 1) + go func() { + // Read the client preface + buf := make([]byte, len(ClientPreface)) + if _, err := io.ReadFull(sc.conn, buf); err != nil { + errc <- err + } else if !bytes.Equal(buf, clientPreface) { + errc <- fmt.Errorf("bogus greeting %q", buf) + } else { + errc <- nil + } + }() + timer := time.NewTimer(prefaceTimeout) // TODO: configurable on *Server? + defer timer.Stop() + select { + case <-timer.C: + return errors.New("timeout waiting for client preface") + case err := <-errc: + if err == nil { + sc.vlogf("client %v said hello", sc.conn.RemoteAddr()) + } + return err + } +} + +// writeDataFromHandler writes the data described in req to stream.id. +// +// The provided ch is used to avoid allocating new channels for each +// write operation. It's expected that the caller reuses writeData and ch +// over time. +// +// The flow control currently happens in the Handler where it waits +// for 1 or more bytes to be available to then write here. So at this +// point we know that we have flow control. But this might have to +// change when priority is implemented, so the serve goroutine knows +// the total amount of bytes waiting to be sent and can can have more +// scheduling decisions available. +func (sc *serverConn) writeDataFromHandler(stream *stream, writeData *writeData, ch chan error) error { + sc.writeFrameFromHandler(frameWriteMsg{ + write: writeData, + stream: stream, + done: ch, + }) + select { + case err := <-ch: + return err + case <-sc.doneServing: + return errClientDisconnected + case <-stream.cw: + return errStreamBroken + } +} + +// writeFrameFromHandler sends wm to sc.wantWriteFrameCh, but aborts +// if the connection has gone away. +// +// This must not be run from the serve goroutine itself, else it might +// deadlock writing to sc.wantWriteFrameCh (which is only mildly +// buffered and is read by serve itself). If you're on the serve +// goroutine, call writeFrame instead. +func (sc *serverConn) writeFrameFromHandler(wm frameWriteMsg) { + sc.serveG.checkNotOn() // NOT + select { + case sc.wantWriteFrameCh <- wm: + case <-sc.doneServing: + // Client has closed their connection to the server. + } +} + +// writeFrame schedules a frame to write and sends it if there's nothing +// already being written. +// +// There is no pushback here (the serve goroutine never blocks). It's +// the http.Handlers that block, waiting for their previous frames to +// make it onto the wire +// +// If you're not on the serve goroutine, use writeFrameFromHandler instead. +func (sc *serverConn) writeFrame(wm frameWriteMsg) { + sc.serveG.check() + sc.writeSched.add(wm) + sc.scheduleFrameWrite() +} + +// startFrameWrite starts a goroutine to write wm (in a separate +// goroutine since that might block on the network), and updates the +// serve goroutine's state about the world, updated from info in wm. +func (sc *serverConn) startFrameWrite(wm frameWriteMsg) { + sc.serveG.check() + if sc.writingFrame { + panic("internal error: can only be writing one frame at a time") + } + sc.writingFrame = true + + st := wm.stream + if st != nil { + switch st.state { + case stateHalfClosedLocal: + panic("internal error: attempt to send frame on half-closed-local stream") + case stateClosed: + if st.sentReset || st.gotReset { + // Skip this frame. But fake the frame write to reschedule: + sc.wroteFrameCh <- struct{}{} + return + } + panic(fmt.Sprintf("internal error: attempt to send a write %v on a closed stream", wm)) + } + } + + sc.needsFrameFlush = true + if endsStream(wm.write) { + if st == nil { + panic("internal error: expecting non-nil stream") + } + switch st.state { + case stateOpen: + // Here we would go to stateHalfClosedLocal in + // theory, but since our handler is done and + // the net/http package provides no mechanism + // for finishing writing to a ResponseWriter + // while still reading data (see possible TODO + // at top of this file), we go into closed + // state here anyway, after telling the peer + // we're hanging up on them. + st.state = stateHalfClosedLocal // won't last long, but necessary for closeStream via resetStream + errCancel := StreamError{st.id, ErrCodeCancel} + sc.resetStream(errCancel) + case stateHalfClosedRemote: + sc.closeStream(st, nil) + } + } + go sc.writeFrameAsync(wm) +} + +// scheduleFrameWrite tickles the frame writing scheduler. +// +// If a frame is already being written, nothing happens. This will be called again +// when the frame is done being written. +// +// If a frame isn't being written we need to send one, the best frame +// to send is selected, preferring first things that aren't +// stream-specific (e.g. ACKing settings), and then finding the +// highest priority stream. +// +// If a frame isn't being written and there's nothing else to send, we +// flush the write buffer. +func (sc *serverConn) scheduleFrameWrite() { + sc.serveG.check() + if sc.writingFrame { + return + } + if sc.needToSendGoAway { + sc.needToSendGoAway = false + sc.startFrameWrite(frameWriteMsg{ + write: &writeGoAway{ + maxStreamID: sc.maxStreamID, + code: sc.goAwayCode, + }, + }) + return + } + if sc.needToSendSettingsAck { + sc.needToSendSettingsAck = false + sc.startFrameWrite(frameWriteMsg{write: writeSettingsAck{}}) + return + } + if !sc.inGoAway { + if wm, ok := sc.writeSched.take(); ok { + sc.startFrameWrite(wm) + return + } + } + if sc.needsFrameFlush { + sc.startFrameWrite(frameWriteMsg{write: flushFrameWriter{}}) + sc.needsFrameFlush = false // after startFrameWrite, since it sets this true + return + } +} + +func (sc *serverConn) goAway(code ErrCode) { + sc.serveG.check() + if sc.inGoAway { + return + } + if code != ErrCodeNo { + sc.shutDownIn(250 * time.Millisecond) + } else { + // TODO: configurable + sc.shutDownIn(1 * time.Second) + } + sc.inGoAway = true + sc.needToSendGoAway = true + sc.goAwayCode = code + sc.scheduleFrameWrite() +} + +func (sc *serverConn) shutDownIn(d time.Duration) { + sc.serveG.check() + sc.shutdownTimer = time.NewTimer(d) + sc.shutdownTimerCh = sc.shutdownTimer.C +} + +func (sc *serverConn) resetStream(se StreamError) { + sc.serveG.check() + sc.writeFrame(frameWriteMsg{write: se}) + if st, ok := sc.streams[se.StreamID]; ok { + st.sentReset = true + sc.closeStream(st, se) + } +} + +// curHeaderStreamID returns the stream ID of the header block we're +// currently in the middle of reading. If this returns non-zero, the +// next frame must be a CONTINUATION with this stream id. +func (sc *serverConn) curHeaderStreamID() uint32 { + sc.serveG.check() + st := sc.req.stream + if st == nil { + return 0 + } + return st.id +} + +// processFrameFromReader processes the serve loop's read from readFrameCh from the +// frame-reading goroutine. +// processFrameFromReader returns whether the connection should be kept open. +func (sc *serverConn) processFrameFromReader(fg frameAndGate, fgValid bool) bool { + sc.serveG.check() + var clientGone bool + var err error + if !fgValid { + err = <-sc.readFrameErrCh + if err == ErrFrameTooLarge { + sc.goAway(ErrCodeFrameSize) + return true // goAway will close the loop + } + clientGone = err == io.EOF || strings.Contains(err.Error(), "use of closed network connection") + if clientGone { + // TODO: could we also get into this state if + // the peer does a half close + // (e.g. CloseWrite) because they're done + // sending frames but they're still wanting + // our open replies? Investigate. + // TODO: add CloseWrite to crypto/tls.Conn first + // so we have a way to test this? I suppose + // just for testing we could have a non-TLS mode. + return false + } + } + + if fgValid { + f := fg.f + sc.vlogf("got %v: %#v", f.Header(), f) + err = sc.processFrame(f) + fg.g.Done() // unblock the readFrames goroutine + if err == nil { + return true + } + } + + switch ev := err.(type) { + case StreamError: + sc.resetStream(ev) + return true + case goAwayFlowError: + sc.goAway(ErrCodeFlowControl) + return true + case ConnectionError: + sc.logf("%v: %v", sc.conn.RemoteAddr(), ev) + sc.goAway(ErrCode(ev)) + return true // goAway will handle shutdown + default: + if !fgValid { + sc.logf("disconnecting; error reading frame from client %s: %v", sc.conn.RemoteAddr(), err) + } else { + sc.logf("disconnection due to other error: %v", err) + } + } + return false +} + +func (sc *serverConn) processFrame(f Frame) error { + sc.serveG.check() + + // First frame received must be SETTINGS. + if !sc.sawFirstSettings { + if _, ok := f.(*SettingsFrame); !ok { + return ConnectionError(ErrCodeProtocol) + } + sc.sawFirstSettings = true + } + + if s := sc.curHeaderStreamID(); s != 0 { + if cf, ok := f.(*ContinuationFrame); !ok { + return ConnectionError(ErrCodeProtocol) + } else if cf.Header().StreamID != s { + return ConnectionError(ErrCodeProtocol) + } + } + + switch f := f.(type) { + case *SettingsFrame: + return sc.processSettings(f) + case *HeadersFrame: + return sc.processHeaders(f) + case *ContinuationFrame: + return sc.processContinuation(f) + case *WindowUpdateFrame: + return sc.processWindowUpdate(f) + case *PingFrame: + return sc.processPing(f) + case *DataFrame: + return sc.processData(f) + case *RSTStreamFrame: + return sc.processResetStream(f) + case *PriorityFrame: + return sc.processPriority(f) + case *PushPromiseFrame: + // A client cannot push. Thus, servers MUST treat the receipt of a PUSH_PROMISE + // frame as a connection error (Section 5.4.1) of type PROTOCOL_ERROR. + return ConnectionError(ErrCodeProtocol) + default: + log.Printf("Ignoring frame: %v", f.Header()) + return nil + } +} + +func (sc *serverConn) processPing(f *PingFrame) error { + sc.serveG.check() + if f.Flags.Has(FlagSettingsAck) { + // 6.7 PING: " An endpoint MUST NOT respond to PING frames + // containing this flag." + return nil + } + if f.StreamID != 0 { + // "PING frames are not associated with any individual + // stream. If a PING frame is received with a stream + // identifier field value other than 0x0, the recipient MUST + // respond with a connection error (Section 5.4.1) of type + // PROTOCOL_ERROR." + return ConnectionError(ErrCodeProtocol) + } + sc.writeFrame(frameWriteMsg{write: writePingAck{f}}) + return nil +} + +func (sc *serverConn) processWindowUpdate(f *WindowUpdateFrame) error { + sc.serveG.check() + switch { + case f.StreamID != 0: // stream-level flow control + st := sc.streams[f.StreamID] + if st == nil { + // "WINDOW_UPDATE can be sent by a peer that has sent a + // frame bearing the END_STREAM flag. This means that a + // receiver could receive a WINDOW_UPDATE frame on a "half + // closed (remote)" or "closed" stream. A receiver MUST + // NOT treat this as an error, see Section 5.1." + return nil + } + if !st.flow.add(int32(f.Increment)) { + return StreamError{f.StreamID, ErrCodeFlowControl} + } + default: // connection-level flow control + if !sc.flow.add(int32(f.Increment)) { + return goAwayFlowError{} + } + } + sc.scheduleFrameWrite() + return nil +} + +func (sc *serverConn) processResetStream(f *RSTStreamFrame) error { + sc.serveG.check() + + state, st := sc.state(f.StreamID) + if state == stateIdle { + // 6.4 "RST_STREAM frames MUST NOT be sent for a + // stream in the "idle" state. If a RST_STREAM frame + // identifying an idle stream is received, the + // recipient MUST treat this as a connection error + // (Section 5.4.1) of type PROTOCOL_ERROR. + return ConnectionError(ErrCodeProtocol) + } + if st != nil { + st.gotReset = true + sc.closeStream(st, StreamError{f.StreamID, f.ErrCode}) + } + return nil +} + +func (sc *serverConn) closeStream(st *stream, err error) { + sc.serveG.check() + if st.state == stateIdle || st.state == stateClosed { + panic(fmt.Sprintf("invariant; can't close stream in state %v", st.state)) + } + st.state = stateClosed + sc.curOpenStreams-- + delete(sc.streams, st.id) + if p := st.body; p != nil { + p.Close(err) + } + st.cw.Close() // signals Handler's CloseNotifier, unblocks writes, etc + sc.writeSched.forgetStream(st.id) +} + +func (sc *serverConn) processSettings(f *SettingsFrame) error { + sc.serveG.check() + if f.IsAck() { + sc.unackedSettings-- + if sc.unackedSettings < 0 { + // Why is the peer ACKing settings we never sent? + // The spec doesn't mention this case, but + // hang up on them anyway. + return ConnectionError(ErrCodeProtocol) + } + return nil + } + if err := f.ForeachSetting(sc.processSetting); err != nil { + return err + } + sc.needToSendSettingsAck = true + sc.scheduleFrameWrite() + return nil +} + +func (sc *serverConn) processSetting(s Setting) error { + sc.serveG.check() + if err := s.Valid(); err != nil { + return err + } + sc.vlogf("processing setting %v", s) + switch s.ID { + case SettingHeaderTableSize: + sc.headerTableSize = s.Val + sc.hpackEncoder.SetMaxDynamicTableSize(s.Val) + case SettingEnablePush: + sc.pushEnabled = s.Val != 0 + case SettingMaxConcurrentStreams: + sc.clientMaxStreams = s.Val + case SettingInitialWindowSize: + return sc.processSettingInitialWindowSize(s.Val) + case SettingMaxFrameSize: + sc.writeSched.maxFrameSize = s.Val + case SettingMaxHeaderListSize: + sc.maxHeaderListSize = s.Val + default: + // Unknown setting: "An endpoint that receives a SETTINGS + // frame with any unknown or unsupported identifier MUST + // ignore that setting." + } + return nil +} + +func (sc *serverConn) processSettingInitialWindowSize(val uint32) error { + sc.serveG.check() + // Note: val already validated to be within range by + // processSetting's Valid call. + + // "A SETTINGS frame can alter the initial flow control window + // size for all current streams. When the value of + // SETTINGS_INITIAL_WINDOW_SIZE changes, a receiver MUST + // adjust the size of all stream flow control windows that it + // maintains by the difference between the new value and the + // old value." + old := sc.initialWindowSize + sc.initialWindowSize = int32(val) + growth := sc.initialWindowSize - old // may be negative + for _, st := range sc.streams { + if !st.flow.add(growth) { + // 6.9.2 Initial Flow Control Window Size + // "An endpoint MUST treat a change to + // SETTINGS_INITIAL_WINDOW_SIZE that causes any flow + // control window to exceed the maximum size as a + // connection error (Section 5.4.1) of type + // FLOW_CONTROL_ERROR." + return ConnectionError(ErrCodeFlowControl) + } + } + return nil +} + +func (sc *serverConn) processData(f *DataFrame) error { + sc.serveG.check() + // "If a DATA frame is received whose stream is not in "open" + // or "half closed (local)" state, the recipient MUST respond + // with a stream error (Section 5.4.2) of type STREAM_CLOSED." + id := f.Header().StreamID + st, ok := sc.streams[id] + if !ok || st.state != stateOpen { + // This includes sending a RST_STREAM if the stream is + // in stateHalfClosedLocal (which currently means that + // the http.Handler returned, so it's done reading & + // done writing). Try to stop the client from sending + // more DATA. + return StreamError{id, ErrCodeStreamClosed} + } + if st.body == nil { + panic("internal error: should have a body in this state") + } + data := f.Data() + + // Sender sending more than they'd declared? + if st.declBodyBytes != -1 && st.bodyBytes+int64(len(data)) > st.declBodyBytes { + st.body.Close(fmt.Errorf("sender tried to send more than declared Content-Length of %d bytes", st.declBodyBytes)) + return StreamError{id, ErrCodeStreamClosed} + } + if len(data) > 0 { + // Check whether the client has flow control quota. + if int(st.inflow.available()) < len(data) { + return StreamError{id, ErrCodeFlowControl} + } + st.inflow.take(int32(len(data))) + wrote, err := st.body.Write(data) + if err != nil { + return StreamError{id, ErrCodeStreamClosed} + } + if wrote != len(data) { + panic("internal error: bad Writer") + } + st.bodyBytes += int64(len(data)) + } + if f.StreamEnded() { + if st.declBodyBytes != -1 && st.declBodyBytes != st.bodyBytes { + st.body.Close(fmt.Errorf("request declared a Content-Length of %d but only wrote %d bytes", + st.declBodyBytes, st.bodyBytes)) + } else { + st.body.Close(io.EOF) + } + st.state = stateHalfClosedRemote + } + return nil +} + +func (sc *serverConn) processHeaders(f *HeadersFrame) error { + sc.serveG.check() + id := f.Header().StreamID + if sc.inGoAway { + // Ignore. + return nil + } + // http://http2.github.io/http2-spec/#rfc.section.5.1.1 + if id%2 != 1 || id <= sc.maxStreamID || sc.req.stream != nil { + // Streams initiated by a client MUST use odd-numbered + // stream identifiers. [...] The identifier of a newly + // established stream MUST be numerically greater than all + // streams that the initiating endpoint has opened or + // reserved. [...] An endpoint that receives an unexpected + // stream identifier MUST respond with a connection error + // (Section 5.4.1) of type PROTOCOL_ERROR. + return ConnectionError(ErrCodeProtocol) + } + if id > sc.maxStreamID { + sc.maxStreamID = id + } + st := &stream{ + id: id, + state: stateOpen, + } + if f.StreamEnded() { + st.state = stateHalfClosedRemote + } + st.cw.Init() + + st.flow.conn = &sc.flow // link to conn-level counter + st.flow.add(sc.initialWindowSize) + st.inflow.conn = &sc.inflow // link to conn-level counter + st.inflow.add(initialWindowSize) // TODO: update this when we send a higher initial window size in the initial settings + + sc.streams[id] = st + if f.HasPriority() { + adjustStreamPriority(sc.streams, st.id, f.Priority) + } + sc.curOpenStreams++ + sc.req = requestParam{ + stream: st, + header: make(http.Header), + } + return sc.processHeaderBlockFragment(st, f.HeaderBlockFragment(), f.HeadersEnded()) +} + +func (sc *serverConn) processContinuation(f *ContinuationFrame) error { + sc.serveG.check() + st := sc.streams[f.Header().StreamID] + if st == nil || sc.curHeaderStreamID() != st.id { + return ConnectionError(ErrCodeProtocol) + } + return sc.processHeaderBlockFragment(st, f.HeaderBlockFragment(), f.HeadersEnded()) +} + +func (sc *serverConn) processHeaderBlockFragment(st *stream, frag []byte, end bool) error { + sc.serveG.check() + if _, err := sc.hpackDecoder.Write(frag); err != nil { + // TODO: convert to stream error I assume? + return err + } + if !end { + return nil + } + if err := sc.hpackDecoder.Close(); err != nil { + // TODO: convert to stream error I assume? + return err + } + defer sc.resetPendingRequest() + if sc.curOpenStreams > sc.advMaxStreams { + // "Endpoints MUST NOT exceed the limit set by their + // peer. An endpoint that receives a HEADERS frame + // that causes their advertised concurrent stream + // limit to be exceeded MUST treat this as a stream + // error (Section 5.4.2) of type PROTOCOL_ERROR or + // REFUSED_STREAM." + if sc.unackedSettings == 0 { + // They should know better. + return StreamError{st.id, ErrCodeProtocol} + } + // Assume it's a network race, where they just haven't + // received our last SETTINGS update. But actually + // this can't happen yet, because we don't yet provide + // a way for users to adjust server parameters at + // runtime. + return StreamError{st.id, ErrCodeRefusedStream} + } + + rw, req, err := sc.newWriterAndRequest() + if err != nil { + return err + } + st.body = req.Body.(*requestBody).pipe // may be nil + st.declBodyBytes = req.ContentLength + go sc.runHandler(rw, req) + return nil +} + +func (sc *serverConn) processPriority(f *PriorityFrame) error { + adjustStreamPriority(sc.streams, f.StreamID, f.PriorityParam) + return nil +} + +func adjustStreamPriority(streams map[uint32]*stream, streamID uint32, priority PriorityParam) { + st, ok := streams[streamID] + if !ok { + // TODO: not quite correct (this streamID might + // already exist in the dep tree, but be closed), but + // close enough for now. + return + } + st.weight = priority.Weight + parent := streams[priority.StreamDep] // might be nil + if parent == st { + // if client tries to set this stream to be the parent of itself + // ignore and keep going + return + } + + // section 5.3.3: If a stream is made dependent on one of its + // own dependencies, the formerly dependent stream is first + // moved to be dependent on the reprioritized stream's previous + // parent. The moved dependency retains its weight. + for piter := parent; piter != nil; piter = piter.parent { + if piter == st { + parent.parent = st.parent + break + } + } + st.parent = parent + if priority.Exclusive && (st.parent != nil || priority.StreamDep == 0) { + for _, openStream := range streams { + if openStream != st && openStream.parent == st.parent { + openStream.parent = st + } + } + } +} + +// resetPendingRequest zeros out all state related to a HEADERS frame +// and its zero or more CONTINUATION frames sent to start a new +// request. +func (sc *serverConn) resetPendingRequest() { + sc.serveG.check() + sc.req = requestParam{} +} + +func (sc *serverConn) newWriterAndRequest() (*responseWriter, *http.Request, error) { + sc.serveG.check() + rp := &sc.req + if rp.invalidHeader || rp.method == "" || rp.path == "" || + (rp.scheme != "https" && rp.scheme != "http") { + // See 8.1.2.6 Malformed Requests and Responses: + // + // Malformed requests or responses that are detected + // MUST be treated as a stream error (Section 5.4.2) + // of type PROTOCOL_ERROR." + // + // 8.1.2.3 Request Pseudo-Header Fields + // "All HTTP/2 requests MUST include exactly one valid + // value for the :method, :scheme, and :path + // pseudo-header fields" + return nil, nil, StreamError{rp.stream.id, ErrCodeProtocol} + } + var tlsState *tls.ConnectionState // nil if not scheme https + if rp.scheme == "https" { + tlsState = sc.tlsState + } + authority := rp.authority + if authority == "" { + authority = rp.header.Get("Host") + } + needsContinue := rp.header.Get("Expect") == "100-continue" + if needsContinue { + rp.header.Del("Expect") + } + bodyOpen := rp.stream.state == stateOpen + body := &requestBody{ + conn: sc, + stream: rp.stream, + needsContinue: needsContinue, + } + // TODO: handle asterisk '*' requests + test + url, err := url.ParseRequestURI(rp.path) + if err != nil { + // TODO: find the right error code? + return nil, nil, StreamError{rp.stream.id, ErrCodeProtocol} + } + req := &http.Request{ + Method: rp.method, + URL: url, + RemoteAddr: sc.remoteAddrStr, + Header: rp.header, + RequestURI: rp.path, + Proto: "HTTP/2.0", + ProtoMajor: 2, + ProtoMinor: 0, + TLS: tlsState, + Host: authority, + Body: body, + } + if bodyOpen { + body.pipe = &pipe{ + b: buffer{buf: make([]byte, initialWindowSize)}, // TODO: share/remove XXX + } + body.pipe.c.L = &body.pipe.m + + if vv, ok := rp.header["Content-Length"]; ok { + req.ContentLength, _ = strconv.ParseInt(vv[0], 10, 64) + } else { + req.ContentLength = -1 + } + } + + rws := responseWriterStatePool.Get().(*responseWriterState) + bwSave := rws.bw + *rws = responseWriterState{} // zero all the fields + rws.conn = sc + rws.bw = bwSave + rws.bw.Reset(chunkWriter{rws}) + rws.stream = rp.stream + rws.req = req + rws.body = body + rws.frameWriteCh = make(chan error, 1) + + rw := &responseWriter{rws: rws} + return rw, req, nil +} + +// Run on its own goroutine. +func (sc *serverConn) runHandler(rw *responseWriter, req *http.Request) { + defer rw.handlerDone() + // TODO: catch panics like net/http.Server + sc.handler.ServeHTTP(rw, req) +} + +// called from handler goroutines. +// h may be nil. +func (sc *serverConn) writeHeaders(st *stream, headerData *writeResHeaders, tempCh chan error) { + sc.serveG.checkNotOn() // NOT on + var errc chan error + if headerData.h != nil { + // If there's a header map (which we don't own), so we have to block on + // waiting for this frame to be written, so an http.Flush mid-handler + // writes out the correct value of keys, before a handler later potentially + // mutates it. + errc = tempCh + } + sc.writeFrameFromHandler(frameWriteMsg{ + write: headerData, + stream: st, + done: errc, + }) + if errc != nil { + select { + case <-errc: + // Ignore. Just for synchronization. + // Any error will be handled in the writing goroutine. + case <-sc.doneServing: + // Client has closed the connection. + } + } +} + +// called from handler goroutines. +func (sc *serverConn) write100ContinueHeaders(st *stream) { + sc.writeFrameFromHandler(frameWriteMsg{ + write: write100ContinueHeadersFrame{st.id}, + stream: st, + }) +} + +// A bodyReadMsg tells the server loop that the http.Handler read n +// bytes of the DATA from the client on the given stream. +type bodyReadMsg struct { + st *stream + n int +} + +// called from handler goroutines. +// Notes that the handler for the given stream ID read n bytes of its body +// and schedules flow control tokens to be sent. +func (sc *serverConn) noteBodyReadFromHandler(st *stream, n int) { + sc.serveG.checkNotOn() // NOT on + sc.bodyReadCh <- bodyReadMsg{st, n} +} + +func (sc *serverConn) noteBodyRead(st *stream, n int) { + sc.serveG.check() + sc.sendWindowUpdate(nil, n) // conn-level + if st.state != stateHalfClosedRemote && st.state != stateClosed { + // Don't send this WINDOW_UPDATE if the stream is closed + // remotely. + sc.sendWindowUpdate(st, n) + } +} + +// st may be nil for conn-level +func (sc *serverConn) sendWindowUpdate(st *stream, n int) { + sc.serveG.check() + // "The legal range for the increment to the flow control + // window is 1 to 2^31-1 (2,147,483,647) octets." + // A Go Read call on 64-bit machines could in theory read + // a larger Read than this. Very unlikely, but we handle it here + // rather than elsewhere for now. + const maxUint31 = 1<<31 - 1 + for n >= maxUint31 { + sc.sendWindowUpdate32(st, maxUint31) + n -= maxUint31 + } + sc.sendWindowUpdate32(st, int32(n)) +} + +// st may be nil for conn-level +func (sc *serverConn) sendWindowUpdate32(st *stream, n int32) { + sc.serveG.check() + if n == 0 { + return + } + if n < 0 { + panic("negative update") + } + var streamID uint32 + if st != nil { + streamID = st.id + } + sc.writeFrame(frameWriteMsg{ + write: writeWindowUpdate{streamID: streamID, n: uint32(n)}, + stream: st, + }) + var ok bool + if st == nil { + ok = sc.inflow.add(n) + } else { + ok = st.inflow.add(n) + } + if !ok { + panic("internal error; sent too many window updates without decrements?") + } +} + +type requestBody struct { + stream *stream + conn *serverConn + closed bool + pipe *pipe // non-nil if we have a HTTP entity message body + needsContinue bool // need to send a 100-continue +} + +func (b *requestBody) Close() error { + if b.pipe != nil { + b.pipe.Close(errClosedBody) + } + b.closed = true + return nil +} + +func (b *requestBody) Read(p []byte) (n int, err error) { + if b.needsContinue { + b.needsContinue = false + b.conn.write100ContinueHeaders(b.stream) + } + if b.pipe == nil { + return 0, io.EOF + } + n, err = b.pipe.Read(p) + if n > 0 { + b.conn.noteBodyReadFromHandler(b.stream, n) + } + return +} + +// responseWriter is the http.ResponseWriter implementation. It's +// intentionally small (1 pointer wide) to minimize garbage. The +// responseWriterState pointer inside is zeroed at the end of a +// request (in handlerDone) and calls on the responseWriter thereafter +// simply crash (caller's mistake), but the much larger responseWriterState +// and buffers are reused between multiple requests. +type responseWriter struct { + rws *responseWriterState +} + +// Optional http.ResponseWriter interfaces implemented. +var ( + _ http.CloseNotifier = (*responseWriter)(nil) + _ http.Flusher = (*responseWriter)(nil) + _ stringWriter = (*responseWriter)(nil) +) + +type responseWriterState struct { + // immutable within a request: + stream *stream + req *http.Request + body *requestBody // to close at end of request, if DATA frames didn't + conn *serverConn + + // TODO: adjust buffer writing sizes based on server config, frame size updates from peer, etc + bw *bufio.Writer // writing to a chunkWriter{this *responseWriterState} + + // mutated by http.Handler goroutine: + handlerHeader http.Header // nil until called + snapHeader http.Header // snapshot of handlerHeader at WriteHeader time + status int // status code passed to WriteHeader + wroteHeader bool // WriteHeader called (explicitly or implicitly). Not necessarily sent to user yet. + sentHeader bool // have we sent the header frame? + handlerDone bool // handler has finished + curWrite writeData + frameWriteCh chan error // re-used whenever we need to block on a frame being written + + closeNotifierMu sync.Mutex // guards closeNotifierCh + closeNotifierCh chan bool // nil until first used +} + +type chunkWriter struct{ rws *responseWriterState } + +func (cw chunkWriter) Write(p []byte) (n int, err error) { return cw.rws.writeChunk(p) } + +// writeChunk writes chunks from the bufio.Writer. But because +// bufio.Writer may bypass its chunking, sometimes p may be +// arbitrarily large. +// +// writeChunk is also responsible (on the first chunk) for sending the +// HEADER response. +func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) { + if !rws.wroteHeader { + rws.writeHeader(200) + } + if !rws.sentHeader { + rws.sentHeader = true + var ctype, clen string // implicit ones, if we can calculate it + if rws.handlerDone && rws.snapHeader.Get("Content-Length") == "" { + clen = strconv.Itoa(len(p)) + } + if rws.snapHeader.Get("Content-Type") == "" { + ctype = http.DetectContentType(p) + } + endStream := rws.handlerDone && len(p) == 0 + rws.conn.writeHeaders(rws.stream, &writeResHeaders{ + streamID: rws.stream.id, + httpResCode: rws.status, + h: rws.snapHeader, + endStream: endStream, + contentType: ctype, + contentLength: clen, + }, rws.frameWriteCh) + if endStream { + return 0, nil + } + } + if len(p) == 0 && !rws.handlerDone { + return 0, nil + } + curWrite := &rws.curWrite + curWrite.streamID = rws.stream.id + curWrite.p = p + curWrite.endStream = rws.handlerDone + if err := rws.conn.writeDataFromHandler(rws.stream, curWrite, rws.frameWriteCh); err != nil { + return 0, err + } + return len(p), nil +} + +func (w *responseWriter) Flush() { + rws := w.rws + if rws == nil { + panic("Header called after Handler finished") + } + if rws.bw.Buffered() > 0 { + if err := rws.bw.Flush(); err != nil { + // Ignore the error. The frame writer already knows. + return + } + } else { + // The bufio.Writer won't call chunkWriter.Write + // (writeChunk with zero bytes, so we have to do it + // ourselves to force the HTTP response header and/or + // final DATA frame (with END_STREAM) to be sent. + rws.writeChunk(nil) + } +} + +func (w *responseWriter) CloseNotify() <-chan bool { + rws := w.rws + if rws == nil { + panic("CloseNotify called after Handler finished") + } + rws.closeNotifierMu.Lock() + ch := rws.closeNotifierCh + if ch == nil { + ch = make(chan bool, 1) + rws.closeNotifierCh = ch + go func() { + rws.stream.cw.Wait() // wait for close + ch <- true + }() + } + rws.closeNotifierMu.Unlock() + return ch +} + +func (w *responseWriter) Header() http.Header { + rws := w.rws + if rws == nil { + panic("Header called after Handler finished") + } + if rws.handlerHeader == nil { + rws.handlerHeader = make(http.Header) + } + return rws.handlerHeader +} + +func (w *responseWriter) WriteHeader(code int) { + rws := w.rws + if rws == nil { + panic("WriteHeader called after Handler finished") + } + rws.writeHeader(code) +} + +func (rws *responseWriterState) writeHeader(code int) { + if !rws.wroteHeader { + rws.wroteHeader = true + rws.status = code + if len(rws.handlerHeader) > 0 { + rws.snapHeader = cloneHeader(rws.handlerHeader) + } + } +} + +func cloneHeader(h http.Header) http.Header { + h2 := make(http.Header, len(h)) + for k, vv := range h { + vv2 := make([]string, len(vv)) + copy(vv2, vv) + h2[k] = vv2 + } + return h2 +} + +// The Life Of A Write is like this: +// +// * Handler calls w.Write or w.WriteString -> +// * -> rws.bw (*bufio.Writer) -> +// * (Handler migth call Flush) +// * -> chunkWriter{rws} +// * -> responseWriterState.writeChunk(p []byte) +// * -> responseWriterState.writeChunk (most of the magic; see comment there) +func (w *responseWriter) Write(p []byte) (n int, err error) { + return w.write(len(p), p, "") +} + +func (w *responseWriter) WriteString(s string) (n int, err error) { + return w.write(len(s), nil, s) +} + +// either dataB or dataS is non-zero. +func (w *responseWriter) write(lenData int, dataB []byte, dataS string) (n int, err error) { + rws := w.rws + if rws == nil { + panic("Write called after Handler finished") + } + if !rws.wroteHeader { + w.WriteHeader(200) + } + if dataB != nil { + return rws.bw.Write(dataB) + } else { + return rws.bw.WriteString(dataS) + } +} + +func (w *responseWriter) handlerDone() { + rws := w.rws + if rws == nil { + panic("handlerDone called twice") + } + rws.handlerDone = true + w.Flush() + w.rws = nil + responseWriterStatePool.Put(rws) +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/server_test.go b/Godeps/_workspace/src/github.com/bradfitz/http2/server_test.go new file mode 100644 index 000000000..1133223b8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/server_test.go @@ -0,0 +1,2252 @@ +// 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. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +package http2 + +import ( + "bytes" + "crypto/tls" + "errors" + "flag" + "fmt" + "io" + "io/ioutil" + "log" + "net" + "net/http" + "net/http/httptest" + "os" + "reflect" + "runtime" + "strconv" + "strings" + "sync" + "sync/atomic" + "testing" + "time" + + "github.com/bradfitz/http2/hpack" +) + +var stderrVerbose = flag.Bool("stderr_verbose", false, "Mirror verbosity to stderr, unbuffered") + +type serverTester struct { + cc net.Conn // client conn + t testing.TB + ts *httptest.Server + fr *Framer + logBuf *bytes.Buffer + logFilter []string // substrings to filter out + scMu sync.Mutex // guards sc + sc *serverConn + + // writing headers: + headerBuf bytes.Buffer + hpackEnc *hpack.Encoder + + // reading frames: + frc chan Frame + frErrc chan error + readTimer *time.Timer +} + +func init() { + testHookOnPanicMu = new(sync.Mutex) +} + +func resetHooks() { + testHookOnPanicMu.Lock() + testHookOnPanic = nil + testHookOnPanicMu.Unlock() +} + +type serverTesterOpt string + +var optOnlyServer = serverTesterOpt("only_server") + +func newServerTester(t testing.TB, handler http.HandlerFunc, opts ...interface{}) *serverTester { + resetHooks() + + logBuf := new(bytes.Buffer) + ts := httptest.NewUnstartedServer(handler) + + tlsConfig := &tls.Config{ + InsecureSkipVerify: true, + // The h2-14 is temporary, until curl is updated. (as used by unit tests + // in Docker) + NextProtos: []string{NextProtoTLS, "h2-14"}, + } + + onlyServer := false + for _, opt := range opts { + switch v := opt.(type) { + case func(*tls.Config): + v(tlsConfig) + case func(*httptest.Server): + v(ts) + case serverTesterOpt: + onlyServer = (v == optOnlyServer) + default: + t.Fatalf("unknown newServerTester option type %T", v) + } + } + + ConfigureServer(ts.Config, &Server{}) + + st := &serverTester{ + t: t, + ts: ts, + logBuf: logBuf, + frc: make(chan Frame, 1), + frErrc: make(chan error, 1), + } + st.hpackEnc = hpack.NewEncoder(&st.headerBuf) + + var stderrv io.Writer = ioutil.Discard + if *stderrVerbose { + stderrv = os.Stderr + } + + ts.TLS = ts.Config.TLSConfig // the httptest.Server has its own copy of this TLS config + ts.Config.ErrorLog = log.New(io.MultiWriter(stderrv, twriter{t: t, st: st}, logBuf), "", log.LstdFlags) + ts.StartTLS() + + if VerboseLogs { + t.Logf("Running test server at: %s", ts.URL) + } + testHookGetServerConn = func(v *serverConn) { + st.scMu.Lock() + defer st.scMu.Unlock() + st.sc = v + st.sc.testHookCh = make(chan func()) + } + log.SetOutput(io.MultiWriter(stderrv, twriter{t: t, st: st})) + if !onlyServer { + cc, err := tls.Dial("tcp", ts.Listener.Addr().String(), tlsConfig) + if err != nil { + t.Fatal(err) + } + st.cc = cc + st.fr = NewFramer(cc, cc) + } + + return st +} + +func (st *serverTester) closeConn() { + st.scMu.Lock() + defer st.scMu.Unlock() + st.sc.conn.Close() +} + +func (st *serverTester) addLogFilter(phrase string) { + st.logFilter = append(st.logFilter, phrase) +} + +func (st *serverTester) stream(id uint32) *stream { + ch := make(chan *stream, 1) + st.sc.testHookCh <- func() { + ch <- st.sc.streams[id] + } + return <-ch +} + +func (st *serverTester) streamState(id uint32) streamState { + ch := make(chan streamState, 1) + st.sc.testHookCh <- func() { + state, _ := st.sc.state(id) + ch <- state + } + return <-ch +} + +func (st *serverTester) Close() { + st.ts.Close() + if st.cc != nil { + st.cc.Close() + } + log.SetOutput(os.Stderr) +} + +// greet initiates the client's HTTP/2 connection into a state where +// frames may be sent. +func (st *serverTester) greet() { + st.writePreface() + st.writeInitialSettings() + st.wantSettings() + st.writeSettingsAck() + st.wantSettingsAck() +} + +func (st *serverTester) writePreface() { + n, err := st.cc.Write(clientPreface) + if err != nil { + st.t.Fatalf("Error writing client preface: %v", err) + } + if n != len(clientPreface) { + st.t.Fatalf("Writing client preface, wrote %d bytes; want %d", n, len(clientPreface)) + } +} + +func (st *serverTester) writeInitialSettings() { + if err := st.fr.WriteSettings(); err != nil { + st.t.Fatalf("Error writing initial SETTINGS frame from client to server: %v", err) + } +} + +func (st *serverTester) writeSettingsAck() { + if err := st.fr.WriteSettingsAck(); err != nil { + st.t.Fatalf("Error writing ACK of server's SETTINGS: %v", err) + } +} + +func (st *serverTester) writeHeaders(p HeadersFrameParam) { + if err := st.fr.WriteHeaders(p); err != nil { + st.t.Fatalf("Error writing HEADERS: %v", err) + } +} + +func (st *serverTester) encodeHeaderField(k, v string) { + err := st.hpackEnc.WriteField(hpack.HeaderField{Name: k, Value: v}) + if err != nil { + st.t.Fatalf("HPACK encoding error for %q/%q: %v", k, v, err) + } +} + +// encodeHeader encodes headers and returns their HPACK bytes. headers +// must contain an even number of key/value pairs. There may be +// multiple pairs for keys (e.g. "cookie"). The :method, :path, and +// :scheme headers default to GET, / and https. +func (st *serverTester) encodeHeader(headers ...string) []byte { + if len(headers)%2 == 1 { + panic("odd number of kv args") + } + + st.headerBuf.Reset() + + if len(headers) == 0 { + // Fast path, mostly for benchmarks, so test code doesn't pollute + // profiles when we're looking to improve server allocations. + st.encodeHeaderField(":method", "GET") + st.encodeHeaderField(":path", "/") + st.encodeHeaderField(":scheme", "https") + return st.headerBuf.Bytes() + } + + if len(headers) == 2 && headers[0] == ":method" { + // Another fast path for benchmarks. + st.encodeHeaderField(":method", headers[1]) + st.encodeHeaderField(":path", "/") + st.encodeHeaderField(":scheme", "https") + return st.headerBuf.Bytes() + } + + pseudoCount := map[string]int{} + keys := []string{":method", ":path", ":scheme"} + vals := map[string][]string{ + ":method": {"GET"}, + ":path": {"/"}, + ":scheme": {"https"}, + } + for len(headers) > 0 { + k, v := headers[0], headers[1] + headers = headers[2:] + if _, ok := vals[k]; !ok { + keys = append(keys, k) + } + if strings.HasPrefix(k, ":") { + pseudoCount[k]++ + if pseudoCount[k] == 1 { + vals[k] = []string{v} + } else { + // Allows testing of invalid headers w/ dup pseudo fields. + vals[k] = append(vals[k], v) + } + } else { + vals[k] = append(vals[k], v) + } + } + st.headerBuf.Reset() + for _, k := range keys { + for _, v := range vals[k] { + st.encodeHeaderField(k, v) + } + } + return st.headerBuf.Bytes() +} + +// bodylessReq1 writes a HEADERS frames with StreamID 1 and EndStream and EndHeaders set. +func (st *serverTester) bodylessReq1(headers ...string) { + st.writeHeaders(HeadersFrameParam{ + StreamID: 1, // clients send odd numbers + BlockFragment: st.encodeHeader(headers...), + EndStream: true, + EndHeaders: true, + }) +} + +func (st *serverTester) writeData(streamID uint32, endStream bool, data []byte) { + if err := st.fr.WriteData(streamID, endStream, data); err != nil { + st.t.Fatalf("Error writing DATA: %v", err) + } +} + +func (st *serverTester) readFrame() (Frame, error) { + go func() { + fr, err := st.fr.ReadFrame() + if err != nil { + st.frErrc <- err + } else { + st.frc <- fr + } + }() + t := st.readTimer + if t == nil { + t = time.NewTimer(2 * time.Second) + st.readTimer = t + } + t.Reset(2 * time.Second) + defer t.Stop() + select { + case f := <-st.frc: + return f, nil + case err := <-st.frErrc: + return nil, err + case <-t.C: + return nil, errors.New("timeout waiting for frame") + } +} + +func (st *serverTester) wantHeaders() *HeadersFrame { + f, err := st.readFrame() + if err != nil { + st.t.Fatalf("Error while expecting a HEADERS frame: %v", err) + } + hf, ok := f.(*HeadersFrame) + if !ok { + st.t.Fatalf("got a %T; want *HeadersFrame", f) + } + return hf +} + +func (st *serverTester) wantContinuation() *ContinuationFrame { + f, err := st.readFrame() + if err != nil { + st.t.Fatalf("Error while expecting a CONTINUATION frame: %v", err) + } + cf, ok := f.(*ContinuationFrame) + if !ok { + st.t.Fatalf("got a %T; want *ContinuationFrame", f) + } + return cf +} + +func (st *serverTester) wantData() *DataFrame { + f, err := st.readFrame() + if err != nil { + st.t.Fatalf("Error while expecting a DATA frame: %v", err) + } + df, ok := f.(*DataFrame) + if !ok { + st.t.Fatalf("got a %T; want *DataFrame", f) + } + return df +} + +func (st *serverTester) wantSettings() *SettingsFrame { + f, err := st.readFrame() + if err != nil { + st.t.Fatalf("Error while expecting a SETTINGS frame: %v", err) + } + sf, ok := f.(*SettingsFrame) + if !ok { + st.t.Fatalf("got a %T; want *SettingsFrame", f) + } + return sf +} + +func (st *serverTester) wantPing() *PingFrame { + f, err := st.readFrame() + if err != nil { + st.t.Fatalf("Error while expecting a PING frame: %v", err) + } + pf, ok := f.(*PingFrame) + if !ok { + st.t.Fatalf("got a %T; want *PingFrame", f) + } + return pf +} + +func (st *serverTester) wantGoAway() *GoAwayFrame { + f, err := st.readFrame() + if err != nil { + st.t.Fatalf("Error while expecting a GOAWAY frame: %v", err) + } + gf, ok := f.(*GoAwayFrame) + if !ok { + st.t.Fatalf("got a %T; want *GoAwayFrame", f) + } + return gf +} + +func (st *serverTester) wantRSTStream(streamID uint32, errCode ErrCode) { + f, err := st.readFrame() + if err != nil { + st.t.Fatalf("Error while expecting an RSTStream frame: %v", err) + } + rs, ok := f.(*RSTStreamFrame) + if !ok { + st.t.Fatalf("got a %T; want *RSTStreamFrame", f) + } + if rs.FrameHeader.StreamID != streamID { + st.t.Fatalf("RSTStream StreamID = %d; want %d", rs.FrameHeader.StreamID, streamID) + } + if rs.ErrCode != errCode { + st.t.Fatalf("RSTStream ErrCode = %d (%s); want %d (%s)", rs.ErrCode, rs.ErrCode, errCode, errCode) + } +} + +func (st *serverTester) wantWindowUpdate(streamID, incr uint32) { + f, err := st.readFrame() + if err != nil { + st.t.Fatalf("Error while expecting a WINDOW_UPDATE frame: %v", err) + } + wu, ok := f.(*WindowUpdateFrame) + if !ok { + st.t.Fatalf("got a %T; want *WindowUpdateFrame", f) + } + if wu.FrameHeader.StreamID != streamID { + st.t.Fatalf("WindowUpdate StreamID = %d; want %d", wu.FrameHeader.StreamID, streamID) + } + if wu.Increment != incr { + st.t.Fatalf("WindowUpdate increment = %d; want %d", wu.Increment, incr) + } +} + +func (st *serverTester) wantSettingsAck() { + f, err := st.readFrame() + if err != nil { + st.t.Fatal(err) + } + sf, ok := f.(*SettingsFrame) + if !ok { + st.t.Fatalf("Wanting a settings ACK, received a %T", f) + } + if !sf.Header().Flags.Has(FlagSettingsAck) { + st.t.Fatal("Settings Frame didn't have ACK set") + } + +} + +func TestServer(t *testing.T) { + gotReq := make(chan bool, 1) + st := newServerTester(t, func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Foo", "Bar") + gotReq <- true + }) + defer st.Close() + + covers("3.5", ` + The server connection preface consists of a potentially empty + SETTINGS frame ([SETTINGS]) that MUST be the first frame the + server sends in the HTTP/2 connection. + `) + + st.writePreface() + st.writeInitialSettings() + st.wantSettings() + st.writeSettingsAck() + st.wantSettingsAck() + + st.writeHeaders(HeadersFrameParam{ + StreamID: 1, // clients send odd numbers + BlockFragment: st.encodeHeader(), + EndStream: true, // no DATA frames + EndHeaders: true, + }) + + select { + case <-gotReq: + case <-time.After(2 * time.Second): + t.Error("timeout waiting for request") + } +} + +func TestServer_Request_Get(t *testing.T) { + testServerRequest(t, func(st *serverTester) { + st.writeHeaders(HeadersFrameParam{ + StreamID: 1, // clients send odd numbers + BlockFragment: st.encodeHeader("foo-bar", "some-value"), + EndStream: true, // no DATA frames + EndHeaders: true, + }) + }, func(r *http.Request) { + if r.Method != "GET" { + t.Errorf("Method = %q; want GET", r.Method) + } + if r.URL.Path != "/" { + t.Errorf("URL.Path = %q; want /", r.URL.Path) + } + if r.ContentLength != 0 { + t.Errorf("ContentLength = %v; want 0", r.ContentLength) + } + if r.Close { + t.Error("Close = true; want false") + } + if !strings.Contains(r.RemoteAddr, ":") { + t.Errorf("RemoteAddr = %q; want something with a colon", r.RemoteAddr) + } + if r.Proto != "HTTP/2.0" || r.ProtoMajor != 2 || r.ProtoMinor != 0 { + t.Errorf("Proto = %q Major=%v,Minor=%v; want HTTP/2.0", r.Proto, r.ProtoMajor, r.ProtoMinor) + } + wantHeader := http.Header{ + "Foo-Bar": []string{"some-value"}, + } + if !reflect.DeepEqual(r.Header, wantHeader) { + t.Errorf("Header = %#v; want %#v", r.Header, wantHeader) + } + if n, err := r.Body.Read([]byte(" ")); err != io.EOF || n != 0 { + t.Errorf("Read = %d, %v; want 0, EOF", n, err) + } + }) +} + +func TestServer_Request_Get_PathSlashes(t *testing.T) { + testServerRequest(t, func(st *serverTester) { + st.writeHeaders(HeadersFrameParam{ + StreamID: 1, // clients send odd numbers + BlockFragment: st.encodeHeader(":path", "/%2f/"), + EndStream: true, // no DATA frames + EndHeaders: true, + }) + }, func(r *http.Request) { + if r.RequestURI != "/%2f/" { + t.Errorf("RequestURI = %q; want /%%2f/", r.RequestURI) + } + if r.URL.Path != "///" { + t.Errorf("URL.Path = %q; want ///", r.URL.Path) + } + }) +} + +// TODO: add a test with EndStream=true on the HEADERS but setting a +// Content-Length anyway. Should we just omit it and force it to +// zero? + +func TestServer_Request_Post_NoContentLength_EndStream(t *testing.T) { + testServerRequest(t, func(st *serverTester) { + st.writeHeaders(HeadersFrameParam{ + StreamID: 1, // clients send odd numbers + BlockFragment: st.encodeHeader(":method", "POST"), + EndStream: true, + EndHeaders: true, + }) + }, func(r *http.Request) { + if r.Method != "POST" { + t.Errorf("Method = %q; want POST", r.Method) + } + if r.ContentLength != 0 { + t.Errorf("ContentLength = %v; want 0", r.ContentLength) + } + if n, err := r.Body.Read([]byte(" ")); err != io.EOF || n != 0 { + t.Errorf("Read = %d, %v; want 0, EOF", n, err) + } + }) +} + +func TestServer_Request_Post_Body_ImmediateEOF(t *testing.T) { + testBodyContents(t, -1, "", func(st *serverTester) { + st.writeHeaders(HeadersFrameParam{ + StreamID: 1, // clients send odd numbers + BlockFragment: st.encodeHeader(":method", "POST"), + EndStream: false, // to say DATA frames are coming + EndHeaders: true, + }) + st.writeData(1, true, nil) // just kidding. empty body. + }) +} + +func TestServer_Request_Post_Body_OneData(t *testing.T) { + const content = "Some content" + testBodyContents(t, -1, content, func(st *serverTester) { + st.writeHeaders(HeadersFrameParam{ + StreamID: 1, // clients send odd numbers + BlockFragment: st.encodeHeader(":method", "POST"), + EndStream: false, // to say DATA frames are coming + EndHeaders: true, + }) + st.writeData(1, true, []byte(content)) + }) +} + +func TestServer_Request_Post_Body_TwoData(t *testing.T) { + const content = "Some content" + testBodyContents(t, -1, content, func(st *serverTester) { + st.writeHeaders(HeadersFrameParam{ + StreamID: 1, // clients send odd numbers + BlockFragment: st.encodeHeader(":method", "POST"), + EndStream: false, // to say DATA frames are coming + EndHeaders: true, + }) + st.writeData(1, false, []byte(content[:5])) + st.writeData(1, true, []byte(content[5:])) + }) +} + +func TestServer_Request_Post_Body_ContentLength_Correct(t *testing.T) { + const content = "Some content" + testBodyContents(t, int64(len(content)), content, func(st *serverTester) { + st.writeHeaders(HeadersFrameParam{ + StreamID: 1, // clients send odd numbers + BlockFragment: st.encodeHeader( + ":method", "POST", + "content-length", strconv.Itoa(len(content)), + ), + EndStream: false, // to say DATA frames are coming + EndHeaders: true, + }) + st.writeData(1, true, []byte(content)) + }) +} + +func TestServer_Request_Post_Body_ContentLength_TooLarge(t *testing.T) { + testBodyContentsFail(t, 3, "request declared a Content-Length of 3 but only wrote 2 bytes", + func(st *serverTester) { + st.writeHeaders(HeadersFrameParam{ + StreamID: 1, // clients send odd numbers + BlockFragment: st.encodeHeader( + ":method", "POST", + "content-length", "3", + ), + EndStream: false, // to say DATA frames are coming + EndHeaders: true, + }) + st.writeData(1, true, []byte("12")) + }) +} + +func TestServer_Request_Post_Body_ContentLength_TooSmall(t *testing.T) { + testBodyContentsFail(t, 4, "sender tried to send more than declared Content-Length of 4 bytes", + func(st *serverTester) { + st.writeHeaders(HeadersFrameParam{ + StreamID: 1, // clients send odd numbers + BlockFragment: st.encodeHeader( + ":method", "POST", + "content-length", "4", + ), + EndStream: false, // to say DATA frames are coming + EndHeaders: true, + }) + st.writeData(1, true, []byte("12345")) + }) +} + +func testBodyContents(t *testing.T, wantContentLength int64, wantBody string, write func(st *serverTester)) { + testServerRequest(t, write, func(r *http.Request) { + if r.Method != "POST" { + t.Errorf("Method = %q; want POST", r.Method) + } + if r.ContentLength != wantContentLength { + t.Errorf("ContentLength = %v; want %d", r.ContentLength, wantContentLength) + } + all, err := ioutil.ReadAll(r.Body) + if err != nil { + t.Fatal(err) + } + if string(all) != wantBody { + t.Errorf("Read = %q; want %q", all, wantBody) + } + if err := r.Body.Close(); err != nil { + t.Fatalf("Close: %v", err) + } + }) +} + +func testBodyContentsFail(t *testing.T, wantContentLength int64, wantReadError string, write func(st *serverTester)) { + testServerRequest(t, write, func(r *http.Request) { + if r.Method != "POST" { + t.Errorf("Method = %q; want POST", r.Method) + } + if r.ContentLength != wantContentLength { + t.Errorf("ContentLength = %v; want %d", r.ContentLength, wantContentLength) + } + all, err := ioutil.ReadAll(r.Body) + if err == nil { + t.Fatalf("expected an error (%q) reading from the body. Successfully read %q instead.", + wantReadError, all) + } + if !strings.Contains(err.Error(), wantReadError) { + t.Fatalf("Body.Read = %v; want substring %q", err, wantReadError) + } + if err := r.Body.Close(); err != nil { + t.Fatalf("Close: %v", err) + } + }) +} + +// Using a Host header, instead of :authority +func TestServer_Request_Get_Host(t *testing.T) { + const host = "example.com" + testServerRequest(t, func(st *serverTester) { + st.writeHeaders(HeadersFrameParam{ + StreamID: 1, // clients send odd numbers + BlockFragment: st.encodeHeader("host", host), + EndStream: true, + EndHeaders: true, + }) + }, func(r *http.Request) { + if r.Host != host { + t.Errorf("Host = %q; want %q", r.Host, host) + } + }) +} + +// Using an :authority pseudo-header, instead of Host +func TestServer_Request_Get_Authority(t *testing.T) { + const host = "example.com" + testServerRequest(t, func(st *serverTester) { + st.writeHeaders(HeadersFrameParam{ + StreamID: 1, // clients send odd numbers + BlockFragment: st.encodeHeader(":authority", host), + EndStream: true, + EndHeaders: true, + }) + }, func(r *http.Request) { + if r.Host != host { + t.Errorf("Host = %q; want %q", r.Host, host) + } + }) +} + +func TestServer_Request_WithContinuation(t *testing.T) { + wantHeader := http.Header{ + "Foo-One": []string{"value-one"}, + "Foo-Two": []string{"value-two"}, + "Foo-Three": []string{"value-three"}, + } + testServerRequest(t, func(st *serverTester) { + fullHeaders := st.encodeHeader( + "foo-one", "value-one", + "foo-two", "value-two", + "foo-three", "value-three", + ) + remain := fullHeaders + chunks := 0 + for len(remain) > 0 { + const maxChunkSize = 5 + chunk := remain + if len(chunk) > maxChunkSize { + chunk = chunk[:maxChunkSize] + } + remain = remain[len(chunk):] + + if chunks == 0 { + st.writeHeaders(HeadersFrameParam{ + StreamID: 1, // clients send odd numbers + BlockFragment: chunk, + EndStream: true, // no DATA frames + EndHeaders: false, // we'll have continuation frames + }) + } else { + err := st.fr.WriteContinuation(1, len(remain) == 0, chunk) + if err != nil { + t.Fatal(err) + } + } + chunks++ + } + if chunks < 2 { + t.Fatal("too few chunks") + } + }, func(r *http.Request) { + if !reflect.DeepEqual(r.Header, wantHeader) { + t.Errorf("Header = %#v; want %#v", r.Header, wantHeader) + } + }) +} + +// Concatenated cookie headers. ("8.1.2.5 Compressing the Cookie Header Field") +func TestServer_Request_CookieConcat(t *testing.T) { + const host = "example.com" + testServerRequest(t, func(st *serverTester) { + st.bodylessReq1( + ":authority", host, + "cookie", "a=b", + "cookie", "c=d", + "cookie", "e=f", + ) + }, func(r *http.Request) { + const want = "a=b; c=d; e=f" + if got := r.Header.Get("Cookie"); got != want { + t.Errorf("Cookie = %q; want %q", got, want) + } + }) +} + +func TestServer_Request_Reject_CapitalHeader(t *testing.T) { + testRejectRequest(t, func(st *serverTester) { st.bodylessReq1("UPPER", "v") }) +} + +func TestServer_Request_Reject_Pseudo_Missing_method(t *testing.T) { + testRejectRequest(t, func(st *serverTester) { st.bodylessReq1(":method", "") }) +} + +func TestServer_Request_Reject_Pseudo_ExactlyOne(t *testing.T) { + // 8.1.2.3 Request Pseudo-Header Fields + // "All HTTP/2 requests MUST include exactly one valid value" ... + testRejectRequest(t, func(st *serverTester) { + st.addLogFilter("duplicate pseudo-header") + st.bodylessReq1(":method", "GET", ":method", "POST") + }) +} + +func TestServer_Request_Reject_Pseudo_AfterRegular(t *testing.T) { + // 8.1.2.3 Request Pseudo-Header Fields + // "All pseudo-header fields MUST appear in the header block + // before regular header fields. Any request or response that + // contains a pseudo-header field that appears in a header + // block after a regular header field MUST be treated as + // malformed (Section 8.1.2.6)." + testRejectRequest(t, func(st *serverTester) { + st.addLogFilter("pseudo-header after regular header") + var buf bytes.Buffer + enc := hpack.NewEncoder(&buf) + enc.WriteField(hpack.HeaderField{Name: ":method", Value: "GET"}) + enc.WriteField(hpack.HeaderField{Name: "regular", Value: "foobar"}) + enc.WriteField(hpack.HeaderField{Name: ":path", Value: "/"}) + enc.WriteField(hpack.HeaderField{Name: ":scheme", Value: "https"}) + st.writeHeaders(HeadersFrameParam{ + StreamID: 1, // clients send odd numbers + BlockFragment: buf.Bytes(), + EndStream: true, + EndHeaders: true, + }) + }) +} + +func TestServer_Request_Reject_Pseudo_Missing_path(t *testing.T) { + testRejectRequest(t, func(st *serverTester) { st.bodylessReq1(":path", "") }) +} + +func TestServer_Request_Reject_Pseudo_Missing_scheme(t *testing.T) { + testRejectRequest(t, func(st *serverTester) { st.bodylessReq1(":scheme", "") }) +} + +func TestServer_Request_Reject_Pseudo_scheme_invalid(t *testing.T) { + testRejectRequest(t, func(st *serverTester) { st.bodylessReq1(":scheme", "bogus") }) +} + +func TestServer_Request_Reject_Pseudo_Unknown(t *testing.T) { + testRejectRequest(t, func(st *serverTester) { + st.addLogFilter(`invalid pseudo-header ":unknown_thing"`) + st.bodylessReq1(":unknown_thing", "") + }) +} + +func testRejectRequest(t *testing.T, send func(*serverTester)) { + st := newServerTester(t, func(w http.ResponseWriter, r *http.Request) { + t.Fatal("server request made it to handler; should've been rejected") + }) + defer st.Close() + + st.greet() + send(st) + st.wantRSTStream(1, ErrCodeProtocol) +} + +func TestServer_Ping(t *testing.T) { + st := newServerTester(t, nil) + defer st.Close() + st.greet() + + // Server should ignore this one, since it has ACK set. + ackPingData := [8]byte{1, 2, 4, 8, 16, 32, 64, 128} + if err := st.fr.WritePing(true, ackPingData); err != nil { + t.Fatal(err) + } + + // But the server should reply to this one, since ACK is false. + pingData := [8]byte{1, 2, 3, 4, 5, 6, 7, 8} + if err := st.fr.WritePing(false, pingData); err != nil { + t.Fatal(err) + } + + pf := st.wantPing() + if !pf.Flags.Has(FlagPingAck) { + t.Error("response ping doesn't have ACK set") + } + if pf.Data != pingData { + t.Errorf("response ping has data %q; want %q", pf.Data, pingData) + } +} + +func TestServer_RejectsLargeFrames(t *testing.T) { + st := newServerTester(t, nil) + defer st.Close() + st.greet() + + // Write too large of a frame (too large by one byte) + // We ignore the return value because it's expected that the server + // will only read the first 9 bytes (the headre) and then disconnect. + st.fr.WriteRawFrame(0xff, 0, 0, make([]byte, defaultMaxReadFrameSize+1)) + + gf := st.wantGoAway() + if gf.ErrCode != ErrCodeFrameSize { + t.Errorf("GOAWAY err = %v; want %v", gf.ErrCode, ErrCodeFrameSize) + } +} + +func TestServer_Handler_Sends_WindowUpdate(t *testing.T) { + puppet := newHandlerPuppet() + st := newServerTester(t, func(w http.ResponseWriter, r *http.Request) { + puppet.act(w, r) + }) + defer st.Close() + defer puppet.done() + + st.greet() + + st.writeHeaders(HeadersFrameParam{ + StreamID: 1, // clients send odd numbers + BlockFragment: st.encodeHeader(":method", "POST"), + EndStream: false, // data coming + EndHeaders: true, + }) + st.writeData(1, false, []byte("abcdef")) + puppet.do(readBodyHandler(t, "abc")) + st.wantWindowUpdate(0, 3) + st.wantWindowUpdate(1, 3) + + puppet.do(readBodyHandler(t, "def")) + st.wantWindowUpdate(0, 3) + st.wantWindowUpdate(1, 3) + + st.writeData(1, true, []byte("ghijkl")) // END_STREAM here + puppet.do(readBodyHandler(t, "ghi")) + puppet.do(readBodyHandler(t, "jkl")) + st.wantWindowUpdate(0, 3) + st.wantWindowUpdate(0, 3) // no more stream-level, since END_STREAM +} + +func TestServer_Send_GoAway_After_Bogus_WindowUpdate(t *testing.T) { + st := newServerTester(t, nil) + defer st.Close() + st.greet() + if err := st.fr.WriteWindowUpdate(0, 1<<31-1); err != nil { + t.Fatal(err) + } + gf := st.wantGoAway() + if gf.ErrCode != ErrCodeFlowControl { + t.Errorf("GOAWAY err = %v; want %v", gf.ErrCode, ErrCodeFlowControl) + } + if gf.LastStreamID != 0 { + t.Errorf("GOAWAY last stream ID = %v; want %v", gf.LastStreamID, 0) + } +} + +func TestServer_Send_RstStream_After_Bogus_WindowUpdate(t *testing.T) { + inHandler := make(chan bool) + blockHandler := make(chan bool) + st := newServerTester(t, func(w http.ResponseWriter, r *http.Request) { + inHandler <- true + <-blockHandler + }) + defer st.Close() + defer close(blockHandler) + st.greet() + st.writeHeaders(HeadersFrameParam{ + StreamID: 1, + BlockFragment: st.encodeHeader(":method", "POST"), + EndStream: false, // keep it open + EndHeaders: true, + }) + <-inHandler + // Send a bogus window update: + if err := st.fr.WriteWindowUpdate(1, 1<<31-1); err != nil { + t.Fatal(err) + } + st.wantRSTStream(1, ErrCodeFlowControl) +} + +// testServerPostUnblock sends a hanging POST with unsent data to handler, +// then runs fn once in the handler, and verifies that the error returned from +// handler is acceptable. It fails if takes over 5 seconds for handler to exit. +func testServerPostUnblock(t *testing.T, + handler func(http.ResponseWriter, *http.Request) error, + fn func(*serverTester), + checkErr func(error), + otherHeaders ...string) { + inHandler := make(chan bool) + errc := make(chan error, 1) + st := newServerTester(t, func(w http.ResponseWriter, r *http.Request) { + inHandler <- true + errc <- handler(w, r) + }) + st.greet() + st.writeHeaders(HeadersFrameParam{ + StreamID: 1, + BlockFragment: st.encodeHeader(append([]string{":method", "POST"}, otherHeaders...)...), + EndStream: false, // keep it open + EndHeaders: true, + }) + <-inHandler + fn(st) + select { + case err := <-errc: + if checkErr != nil { + checkErr(err) + } + case <-time.After(5 * time.Second): + t.Fatal("timeout waiting for Handler to return") + } + st.Close() +} + +func TestServer_RSTStream_Unblocks_Read(t *testing.T) { + testServerPostUnblock(t, + func(w http.ResponseWriter, r *http.Request) (err error) { + _, err = r.Body.Read(make([]byte, 1)) + return + }, + func(st *serverTester) { + if err := st.fr.WriteRSTStream(1, ErrCodeCancel); err != nil { + t.Fatal(err) + } + }, + func(err error) { + if err == nil { + t.Error("unexpected nil error from Request.Body.Read") + } + }, + ) +} + +func TestServer_DeadConn_Unblocks_Read(t *testing.T) { + testServerPostUnblock(t, + func(w http.ResponseWriter, r *http.Request) (err error) { + _, err = r.Body.Read(make([]byte, 1)) + return + }, + func(st *serverTester) { st.cc.Close() }, + func(err error) { + if err == nil { + t.Error("unexpected nil error from Request.Body.Read") + } + }, + ) +} + +var blockUntilClosed = func(w http.ResponseWriter, r *http.Request) error { + <-w.(http.CloseNotifier).CloseNotify() + return nil +} + +func TestServer_CloseNotify_After_RSTStream(t *testing.T) { + testServerPostUnblock(t, blockUntilClosed, func(st *serverTester) { + if err := st.fr.WriteRSTStream(1, ErrCodeCancel); err != nil { + t.Fatal(err) + } + }, nil) +} + +func TestServer_CloseNotify_After_ConnClose(t *testing.T) { + testServerPostUnblock(t, blockUntilClosed, func(st *serverTester) { st.cc.Close() }, nil) +} + +// that CloseNotify unblocks after a stream error due to the client's +// problem that's unrelated to them explicitly canceling it (which is +// TestServer_CloseNotify_After_RSTStream above) +func TestServer_CloseNotify_After_StreamError(t *testing.T) { + testServerPostUnblock(t, blockUntilClosed, func(st *serverTester) { + // data longer than declared Content-Length => stream error + st.writeData(1, true, []byte("1234")) + }, nil, "content-length", "3") +} + +func TestServer_StateTransitions(t *testing.T) { + var st *serverTester + inHandler := make(chan bool) + writeData := make(chan bool) + leaveHandler := make(chan bool) + st = newServerTester(t, func(w http.ResponseWriter, r *http.Request) { + inHandler <- true + if st.stream(1) == nil { + t.Errorf("nil stream 1 in handler") + } + if got, want := st.streamState(1), stateOpen; got != want { + t.Errorf("in handler, state is %v; want %v", got, want) + } + writeData <- true + if n, err := r.Body.Read(make([]byte, 1)); n != 0 || err != io.EOF { + t.Errorf("body read = %d, %v; want 0, EOF", n, err) + } + if got, want := st.streamState(1), stateHalfClosedRemote; got != want { + t.Errorf("in handler, state is %v; want %v", got, want) + } + + <-leaveHandler + }) + st.greet() + if st.stream(1) != nil { + t.Fatal("stream 1 should be empty") + } + if got := st.streamState(1); got != stateIdle { + t.Fatalf("stream 1 should be idle; got %v", got) + } + + st.writeHeaders(HeadersFrameParam{ + StreamID: 1, + BlockFragment: st.encodeHeader(":method", "POST"), + EndStream: false, // keep it open + EndHeaders: true, + }) + <-inHandler + <-writeData + st.writeData(1, true, nil) + + leaveHandler <- true + hf := st.wantHeaders() + if !hf.StreamEnded() { + t.Fatal("expected END_STREAM flag") + } + + if got, want := st.streamState(1), stateClosed; got != want { + t.Errorf("at end, state is %v; want %v", got, want) + } + if st.stream(1) != nil { + t.Fatal("at end, stream 1 should be gone") + } +} + +// test HEADERS w/o EndHeaders + another HEADERS (should get rejected) +func TestServer_Rejects_HeadersNoEnd_Then_Headers(t *testing.T) { + testServerRejects(t, func(st *serverTester) { + st.writeHeaders(HeadersFrameParam{ + StreamID: 1, + BlockFragment: st.encodeHeader(), + EndStream: true, + EndHeaders: false, + }) + st.writeHeaders(HeadersFrameParam{ // Not a continuation. + StreamID: 3, // different stream. + BlockFragment: st.encodeHeader(), + EndStream: true, + EndHeaders: true, + }) + }) +} + +// test HEADERS w/o EndHeaders + PING (should get rejected) +func TestServer_Rejects_HeadersNoEnd_Then_Ping(t *testing.T) { + testServerRejects(t, func(st *serverTester) { + st.writeHeaders(HeadersFrameParam{ + StreamID: 1, + BlockFragment: st.encodeHeader(), + EndStream: true, + EndHeaders: false, + }) + if err := st.fr.WritePing(false, [8]byte{}); err != nil { + t.Fatal(err) + } + }) +} + +// test HEADERS w/ EndHeaders + a continuation HEADERS (should get rejected) +func TestServer_Rejects_HeadersEnd_Then_Continuation(t *testing.T) { + testServerRejects(t, func(st *serverTester) { + st.writeHeaders(HeadersFrameParam{ + StreamID: 1, + BlockFragment: st.encodeHeader(), + EndStream: true, + EndHeaders: true, + }) + st.wantHeaders() + if err := st.fr.WriteContinuation(1, true, encodeHeaderNoImplicit(t, "foo", "bar")); err != nil { + t.Fatal(err) + } + }) +} + +// test HEADERS w/o EndHeaders + a continuation HEADERS on wrong stream ID +func TestServer_Rejects_HeadersNoEnd_Then_ContinuationWrongStream(t *testing.T) { + testServerRejects(t, func(st *serverTester) { + st.writeHeaders(HeadersFrameParam{ + StreamID: 1, + BlockFragment: st.encodeHeader(), + EndStream: true, + EndHeaders: false, + }) + if err := st.fr.WriteContinuation(3, true, encodeHeaderNoImplicit(t, "foo", "bar")); err != nil { + t.Fatal(err) + } + }) +} + +// No HEADERS on stream 0. +func TestServer_Rejects_Headers0(t *testing.T) { + testServerRejects(t, func(st *serverTester) { + st.fr.AllowIllegalWrites = true + st.writeHeaders(HeadersFrameParam{ + StreamID: 0, + BlockFragment: st.encodeHeader(), + EndStream: true, + EndHeaders: true, + }) + }) +} + +// No CONTINUATION on stream 0. +func TestServer_Rejects_Continuation0(t *testing.T) { + testServerRejects(t, func(st *serverTester) { + st.fr.AllowIllegalWrites = true + if err := st.fr.WriteContinuation(0, true, st.encodeHeader()); err != nil { + t.Fatal(err) + } + }) +} + +func TestServer_Rejects_PushPromise(t *testing.T) { + testServerRejects(t, func(st *serverTester) { + pp := PushPromiseParam{ + StreamID: 1, + PromiseID: 3, + } + if err := st.fr.WritePushPromise(pp); err != nil { + t.Fatal(err) + } + }) +} + +// testServerRejects tests that the server hangs up with a GOAWAY +// frame and a server close after the client does something +// deserving a CONNECTION_ERROR. +func testServerRejects(t *testing.T, writeReq func(*serverTester)) { + st := newServerTester(t, func(w http.ResponseWriter, r *http.Request) {}) + st.addLogFilter("connection error: PROTOCOL_ERROR") + defer st.Close() + st.greet() + writeReq(st) + + st.wantGoAway() + errc := make(chan error, 1) + go func() { + fr, err := st.fr.ReadFrame() + if err == nil { + err = fmt.Errorf("got frame of type %T", fr) + } + errc <- err + }() + select { + case err := <-errc: + if err != io.EOF { + t.Errorf("ReadFrame = %v; want io.EOF", err) + } + case <-time.After(2 * time.Second): + t.Error("timeout waiting for disconnect") + } +} + +// testServerRequest sets up an idle HTTP/2 connection and lets you +// write a single request with writeReq, and then verify that the +// *http.Request is built correctly in checkReq. +func testServerRequest(t *testing.T, writeReq func(*serverTester), checkReq func(*http.Request)) { + gotReq := make(chan bool, 1) + st := newServerTester(t, func(w http.ResponseWriter, r *http.Request) { + if r.Body == nil { + t.Fatal("nil Body") + } + checkReq(r) + gotReq <- true + }) + defer st.Close() + + st.greet() + writeReq(st) + + select { + case <-gotReq: + case <-time.After(2 * time.Second): + t.Error("timeout waiting for request") + } +} + +func getSlash(st *serverTester) { st.bodylessReq1() } + +func TestServer_Response_NoData(t *testing.T) { + testServerResponse(t, func(w http.ResponseWriter, r *http.Request) error { + // Nothing. + return nil + }, func(st *serverTester) { + getSlash(st) + hf := st.wantHeaders() + if !hf.StreamEnded() { + t.Fatal("want END_STREAM flag") + } + if !hf.HeadersEnded() { + t.Fatal("want END_HEADERS flag") + } + }) +} + +func TestServer_Response_NoData_Header_FooBar(t *testing.T) { + testServerResponse(t, func(w http.ResponseWriter, r *http.Request) error { + w.Header().Set("Foo-Bar", "some-value") + return nil + }, func(st *serverTester) { + getSlash(st) + hf := st.wantHeaders() + if !hf.StreamEnded() { + t.Fatal("want END_STREAM flag") + } + if !hf.HeadersEnded() { + t.Fatal("want END_HEADERS flag") + } + goth := decodeHeader(t, hf.HeaderBlockFragment()) + wanth := [][2]string{ + {":status", "200"}, + {"foo-bar", "some-value"}, + {"content-type", "text/plain; charset=utf-8"}, + {"content-length", "0"}, + } + if !reflect.DeepEqual(goth, wanth) { + t.Errorf("Got headers %v; want %v", goth, wanth) + } + }) +} + +func TestServer_Response_Data_Sniff_DoesntOverride(t *testing.T) { + const msg = "this is HTML." + testServerResponse(t, func(w http.ResponseWriter, r *http.Request) error { + w.Header().Set("Content-Type", "foo/bar") + io.WriteString(w, msg) + return nil + }, func(st *serverTester) { + getSlash(st) + hf := st.wantHeaders() + if hf.StreamEnded() { + t.Fatal("don't want END_STREAM, expecting data") + } + if !hf.HeadersEnded() { + t.Fatal("want END_HEADERS flag") + } + goth := decodeHeader(t, hf.HeaderBlockFragment()) + wanth := [][2]string{ + {":status", "200"}, + {"content-type", "foo/bar"}, + {"content-length", strconv.Itoa(len(msg))}, + } + if !reflect.DeepEqual(goth, wanth) { + t.Errorf("Got headers %v; want %v", goth, wanth) + } + df := st.wantData() + if !df.StreamEnded() { + t.Error("expected DATA to have END_STREAM flag") + } + if got := string(df.Data()); got != msg { + t.Errorf("got DATA %q; want %q", got, msg) + } + }) +} + +func TestServer_Response_TransferEncoding_chunked(t *testing.T) { + const msg = "hi" + testServerResponse(t, func(w http.ResponseWriter, r *http.Request) error { + w.Header().Set("Transfer-Encoding", "chunked") // should be stripped + io.WriteString(w, msg) + return nil + }, func(st *serverTester) { + getSlash(st) + hf := st.wantHeaders() + goth := decodeHeader(t, hf.HeaderBlockFragment()) + wanth := [][2]string{ + {":status", "200"}, + {"content-type", "text/plain; charset=utf-8"}, + {"content-length", strconv.Itoa(len(msg))}, + } + if !reflect.DeepEqual(goth, wanth) { + t.Errorf("Got headers %v; want %v", goth, wanth) + } + }) +} + +// Header accessed only after the initial write. +func TestServer_Response_Data_IgnoreHeaderAfterWrite_After(t *testing.T) { + const msg = "this is HTML." + testServerResponse(t, func(w http.ResponseWriter, r *http.Request) error { + io.WriteString(w, msg) + w.Header().Set("foo", "should be ignored") + return nil + }, func(st *serverTester) { + getSlash(st) + hf := st.wantHeaders() + if hf.StreamEnded() { + t.Fatal("unexpected END_STREAM") + } + if !hf.HeadersEnded() { + t.Fatal("want END_HEADERS flag") + } + goth := decodeHeader(t, hf.HeaderBlockFragment()) + wanth := [][2]string{ + {":status", "200"}, + {"content-type", "text/html; charset=utf-8"}, + {"content-length", strconv.Itoa(len(msg))}, + } + if !reflect.DeepEqual(goth, wanth) { + t.Errorf("Got headers %v; want %v", goth, wanth) + } + }) +} + +// Header accessed before the initial write and later mutated. +func TestServer_Response_Data_IgnoreHeaderAfterWrite_Overwrite(t *testing.T) { + const msg = "this is HTML." + testServerResponse(t, func(w http.ResponseWriter, r *http.Request) error { + w.Header().Set("foo", "proper value") + io.WriteString(w, msg) + w.Header().Set("foo", "should be ignored") + return nil + }, func(st *serverTester) { + getSlash(st) + hf := st.wantHeaders() + if hf.StreamEnded() { + t.Fatal("unexpected END_STREAM") + } + if !hf.HeadersEnded() { + t.Fatal("want END_HEADERS flag") + } + goth := decodeHeader(t, hf.HeaderBlockFragment()) + wanth := [][2]string{ + {":status", "200"}, + {"foo", "proper value"}, + {"content-type", "text/html; charset=utf-8"}, + {"content-length", strconv.Itoa(len(msg))}, + } + if !reflect.DeepEqual(goth, wanth) { + t.Errorf("Got headers %v; want %v", goth, wanth) + } + }) +} + +func TestServer_Response_Data_SniffLenType(t *testing.T) { + const msg = "this is HTML." + testServerResponse(t, func(w http.ResponseWriter, r *http.Request) error { + io.WriteString(w, msg) + return nil + }, func(st *serverTester) { + getSlash(st) + hf := st.wantHeaders() + if hf.StreamEnded() { + t.Fatal("don't want END_STREAM, expecting data") + } + if !hf.HeadersEnded() { + t.Fatal("want END_HEADERS flag") + } + goth := decodeHeader(t, hf.HeaderBlockFragment()) + wanth := [][2]string{ + {":status", "200"}, + {"content-type", "text/html; charset=utf-8"}, + {"content-length", strconv.Itoa(len(msg))}, + } + if !reflect.DeepEqual(goth, wanth) { + t.Errorf("Got headers %v; want %v", goth, wanth) + } + df := st.wantData() + if !df.StreamEnded() { + t.Error("expected DATA to have END_STREAM flag") + } + if got := string(df.Data()); got != msg { + t.Errorf("got DATA %q; want %q", got, msg) + } + }) +} + +func TestServer_Response_Header_Flush_MidWrite(t *testing.T) { + const msg = "this is HTML" + const msg2 = ", and this is the next chunk" + testServerResponse(t, func(w http.ResponseWriter, r *http.Request) error { + io.WriteString(w, msg) + w.(http.Flusher).Flush() + io.WriteString(w, msg2) + return nil + }, func(st *serverTester) { + getSlash(st) + hf := st.wantHeaders() + if hf.StreamEnded() { + t.Fatal("unexpected END_STREAM flag") + } + if !hf.HeadersEnded() { + t.Fatal("want END_HEADERS flag") + } + goth := decodeHeader(t, hf.HeaderBlockFragment()) + wanth := [][2]string{ + {":status", "200"}, + {"content-type", "text/html; charset=utf-8"}, // sniffed + // and no content-length + } + if !reflect.DeepEqual(goth, wanth) { + t.Errorf("Got headers %v; want %v", goth, wanth) + } + { + df := st.wantData() + if df.StreamEnded() { + t.Error("unexpected END_STREAM flag") + } + if got := string(df.Data()); got != msg { + t.Errorf("got DATA %q; want %q", got, msg) + } + } + { + df := st.wantData() + if !df.StreamEnded() { + t.Error("wanted END_STREAM flag on last data chunk") + } + if got := string(df.Data()); got != msg2 { + t.Errorf("got DATA %q; want %q", got, msg2) + } + } + }) +} + +func TestServer_Response_LargeWrite(t *testing.T) { + const size = 1 << 20 + const maxFrameSize = 16 << 10 + testServerResponse(t, func(w http.ResponseWriter, r *http.Request) error { + n, err := w.Write(bytes.Repeat([]byte("a"), size)) + if err != nil { + return fmt.Errorf("Write error: %v", err) + } + if n != size { + return fmt.Errorf("wrong size %d from Write", n) + } + return nil + }, func(st *serverTester) { + if err := st.fr.WriteSettings( + Setting{SettingInitialWindowSize, 0}, + Setting{SettingMaxFrameSize, maxFrameSize}, + ); err != nil { + t.Fatal(err) + } + st.wantSettingsAck() + + getSlash(st) // make the single request + + // Give the handler quota to write: + if err := st.fr.WriteWindowUpdate(1, size); err != nil { + t.Fatal(err) + } + // Give the handler quota to write to connection-level + // window as well + if err := st.fr.WriteWindowUpdate(0, size); err != nil { + t.Fatal(err) + } + hf := st.wantHeaders() + if hf.StreamEnded() { + t.Fatal("unexpected END_STREAM flag") + } + if !hf.HeadersEnded() { + t.Fatal("want END_HEADERS flag") + } + goth := decodeHeader(t, hf.HeaderBlockFragment()) + wanth := [][2]string{ + {":status", "200"}, + {"content-type", "text/plain; charset=utf-8"}, // sniffed + // and no content-length + } + if !reflect.DeepEqual(goth, wanth) { + t.Errorf("Got headers %v; want %v", goth, wanth) + } + var bytes, frames int + for { + df := st.wantData() + bytes += len(df.Data()) + frames++ + for _, b := range df.Data() { + if b != 'a' { + t.Fatal("non-'a' byte seen in DATA") + } + } + if df.StreamEnded() { + break + } + } + if bytes != size { + t.Errorf("Got %d bytes; want %d", bytes, size) + } + if want := int(size / maxFrameSize); frames < want || frames > want*2 { + t.Errorf("Got %d frames; want %d", frames, size) + } + }) +} + +// Test that the handler can't write more than the client allows +func TestServer_Response_LargeWrite_FlowControlled(t *testing.T) { + const size = 1 << 20 + const maxFrameSize = 16 << 10 + testServerResponse(t, func(w http.ResponseWriter, r *http.Request) error { + w.(http.Flusher).Flush() + n, err := w.Write(bytes.Repeat([]byte("a"), size)) + if err != nil { + return fmt.Errorf("Write error: %v", err) + } + if n != size { + return fmt.Errorf("wrong size %d from Write", n) + } + return nil + }, func(st *serverTester) { + // Set the window size to something explicit for this test. + // It's also how much initial data we expect. + const initWindowSize = 123 + if err := st.fr.WriteSettings( + Setting{SettingInitialWindowSize, initWindowSize}, + Setting{SettingMaxFrameSize, maxFrameSize}, + ); err != nil { + t.Fatal(err) + } + st.wantSettingsAck() + + getSlash(st) // make the single request + defer func() { st.fr.WriteRSTStream(1, ErrCodeCancel) }() + + hf := st.wantHeaders() + if hf.StreamEnded() { + t.Fatal("unexpected END_STREAM flag") + } + if !hf.HeadersEnded() { + t.Fatal("want END_HEADERS flag") + } + + df := st.wantData() + if got := len(df.Data()); got != initWindowSize { + t.Fatalf("Initial window size = %d but got DATA with %d bytes", initWindowSize, got) + } + + for _, quota := range []int{1, 13, 127} { + if err := st.fr.WriteWindowUpdate(1, uint32(quota)); err != nil { + t.Fatal(err) + } + df := st.wantData() + if int(quota) != len(df.Data()) { + t.Fatalf("read %d bytes after giving %d quota", len(df.Data()), quota) + } + } + + if err := st.fr.WriteRSTStream(1, ErrCodeCancel); err != nil { + t.Fatal(err) + } + }) +} + +// Test that the handler blocked in a Write is unblocked if the server sends a RST_STREAM. +func TestServer_Response_RST_Unblocks_LargeWrite(t *testing.T) { + const size = 1 << 20 + const maxFrameSize = 16 << 10 + testServerResponse(t, func(w http.ResponseWriter, r *http.Request) error { + w.(http.Flusher).Flush() + errc := make(chan error, 1) + go func() { + _, err := w.Write(bytes.Repeat([]byte("a"), size)) + errc <- err + }() + select { + case err := <-errc: + if err == nil { + return errors.New("unexpected nil error from Write in handler") + } + return nil + case <-time.After(2 * time.Second): + return errors.New("timeout waiting for Write in handler") + } + }, func(st *serverTester) { + if err := st.fr.WriteSettings( + Setting{SettingInitialWindowSize, 0}, + Setting{SettingMaxFrameSize, maxFrameSize}, + ); err != nil { + t.Fatal(err) + } + st.wantSettingsAck() + + getSlash(st) // make the single request + + hf := st.wantHeaders() + if hf.StreamEnded() { + t.Fatal("unexpected END_STREAM flag") + } + if !hf.HeadersEnded() { + t.Fatal("want END_HEADERS flag") + } + + if err := st.fr.WriteRSTStream(1, ErrCodeCancel); err != nil { + t.Fatal(err) + } + }) +} + +func TestServer_Response_Empty_Data_Not_FlowControlled(t *testing.T) { + testServerResponse(t, func(w http.ResponseWriter, r *http.Request) error { + w.(http.Flusher).Flush() + // Nothing; send empty DATA + return nil + }, func(st *serverTester) { + // Handler gets no data quota: + if err := st.fr.WriteSettings(Setting{SettingInitialWindowSize, 0}); err != nil { + t.Fatal(err) + } + st.wantSettingsAck() + + getSlash(st) // make the single request + + hf := st.wantHeaders() + if hf.StreamEnded() { + t.Fatal("unexpected END_STREAM flag") + } + if !hf.HeadersEnded() { + t.Fatal("want END_HEADERS flag") + } + + df := st.wantData() + if got := len(df.Data()); got != 0 { + t.Fatalf("unexpected %d DATA bytes; want 0", got) + } + if !df.StreamEnded() { + t.Fatal("DATA didn't have END_STREAM") + } + }) +} + +func TestServer_Response_Automatic100Continue(t *testing.T) { + const msg = "foo" + const reply = "bar" + testServerResponse(t, func(w http.ResponseWriter, r *http.Request) error { + if v := r.Header.Get("Expect"); v != "" { + t.Errorf("Expect header = %q; want empty", v) + } + buf := make([]byte, len(msg)) + // This read should trigger the 100-continue being sent. + if n, err := io.ReadFull(r.Body, buf); err != nil || n != len(msg) || string(buf) != msg { + return fmt.Errorf("ReadFull = %q, %v; want %q, nil", buf[:n], err, msg) + } + _, err := io.WriteString(w, reply) + return err + }, func(st *serverTester) { + st.writeHeaders(HeadersFrameParam{ + StreamID: 1, // clients send odd numbers + BlockFragment: st.encodeHeader(":method", "POST", "expect", "100-continue"), + EndStream: false, + EndHeaders: true, + }) + hf := st.wantHeaders() + if hf.StreamEnded() { + t.Fatal("unexpected END_STREAM flag") + } + if !hf.HeadersEnded() { + t.Fatal("want END_HEADERS flag") + } + goth := decodeHeader(t, hf.HeaderBlockFragment()) + wanth := [][2]string{ + {":status", "100"}, + } + if !reflect.DeepEqual(goth, wanth) { + t.Fatalf("Got headers %v; want %v", goth, wanth) + } + + // Okay, they sent status 100, so we can send our + // gigantic and/or sensitive "foo" payload now. + st.writeData(1, true, []byte(msg)) + + st.wantWindowUpdate(0, uint32(len(msg))) + + hf = st.wantHeaders() + if hf.StreamEnded() { + t.Fatal("expected data to follow") + } + if !hf.HeadersEnded() { + t.Fatal("want END_HEADERS flag") + } + goth = decodeHeader(t, hf.HeaderBlockFragment()) + wanth = [][2]string{ + {":status", "200"}, + {"content-type", "text/plain; charset=utf-8"}, + {"content-length", strconv.Itoa(len(reply))}, + } + if !reflect.DeepEqual(goth, wanth) { + t.Errorf("Got headers %v; want %v", goth, wanth) + } + + df := st.wantData() + if string(df.Data()) != reply { + t.Errorf("Client read %q; want %q", df.Data(), reply) + } + if !df.StreamEnded() { + t.Errorf("expect data stream end") + } + }) +} + +func TestServer_HandlerWriteErrorOnDisconnect(t *testing.T) { + errc := make(chan error, 1) + testServerResponse(t, func(w http.ResponseWriter, r *http.Request) error { + p := []byte("some data.\n") + for { + _, err := w.Write(p) + if err != nil { + errc <- err + return nil + } + } + }, func(st *serverTester) { + st.writeHeaders(HeadersFrameParam{ + StreamID: 1, + BlockFragment: st.encodeHeader(), + EndStream: false, + EndHeaders: true, + }) + hf := st.wantHeaders() + if hf.StreamEnded() { + t.Fatal("unexpected END_STREAM flag") + } + if !hf.HeadersEnded() { + t.Fatal("want END_HEADERS flag") + } + // Close the connection and wait for the handler to (hopefully) notice. + st.cc.Close() + select { + case <-errc: + case <-time.After(5 * time.Second): + t.Error("timeout") + } + }) +} + +func TestServer_Rejects_Too_Many_Streams(t *testing.T) { + const testPath = "/some/path" + + inHandler := make(chan uint32) + leaveHandler := make(chan bool) + st := newServerTester(t, func(w http.ResponseWriter, r *http.Request) { + id := w.(*responseWriter).rws.stream.id + inHandler <- id + if id == 1+(defaultMaxStreams+1)*2 && r.URL.Path != testPath { + t.Errorf("decoded final path as %q; want %q", r.URL.Path, testPath) + } + <-leaveHandler + }) + defer st.Close() + st.greet() + nextStreamID := uint32(1) + streamID := func() uint32 { + defer func() { nextStreamID += 2 }() + return nextStreamID + } + sendReq := func(id uint32, headers ...string) { + st.writeHeaders(HeadersFrameParam{ + StreamID: id, + BlockFragment: st.encodeHeader(headers...), + EndStream: true, + EndHeaders: true, + }) + } + for i := 0; i < defaultMaxStreams; i++ { + sendReq(streamID()) + <-inHandler + } + defer func() { + for i := 0; i < defaultMaxStreams; i++ { + leaveHandler <- true + } + }() + + // And this one should cross the limit: + // (It's also sent as a CONTINUATION, to verify we still track the decoder context, + // even if we're rejecting it) + rejectID := streamID() + headerBlock := st.encodeHeader(":path", testPath) + frag1, frag2 := headerBlock[:3], headerBlock[3:] + st.writeHeaders(HeadersFrameParam{ + StreamID: rejectID, + BlockFragment: frag1, + EndStream: true, + EndHeaders: false, // CONTINUATION coming + }) + if err := st.fr.WriteContinuation(rejectID, true, frag2); err != nil { + t.Fatal(err) + } + st.wantRSTStream(rejectID, ErrCodeProtocol) + + // But let a handler finish: + leaveHandler <- true + st.wantHeaders() + + // And now another stream should be able to start: + goodID := streamID() + sendReq(goodID, ":path", testPath) + select { + case got := <-inHandler: + if got != goodID { + t.Errorf("Got stream %d; want %d", got, goodID) + } + case <-time.After(3 * time.Second): + t.Error("timeout waiting for handler") + } +} + +// So many response headers that the server needs to use CONTINUATION frames: +func TestServer_Response_ManyHeaders_With_Continuation(t *testing.T) { + testServerResponse(t, func(w http.ResponseWriter, r *http.Request) error { + h := w.Header() + for i := 0; i < 5000; i++ { + h.Set(fmt.Sprintf("x-header-%d", i), fmt.Sprintf("x-value-%d", i)) + } + return nil + }, func(st *serverTester) { + getSlash(st) + hf := st.wantHeaders() + if hf.HeadersEnded() { + t.Fatal("got unwanted END_HEADERS flag") + } + n := 0 + for { + n++ + cf := st.wantContinuation() + if cf.HeadersEnded() { + break + } + } + if n < 5 { + t.Errorf("Only got %d CONTINUATION frames; expected 5+ (currently 6)", n) + } + }) +} + +// This previously crashed (reported by Mathieu Lonjaret as observed +// while using Camlistore) because we got a DATA frame from the client +// after the handler exited and our logic at the time was wrong, +// keeping a stream in the map in stateClosed, which tickled an +// invariant check later when we tried to remove that stream (via +// defer sc.closeAllStreamsOnConnClose) when the serverConn serve loop +// ended. +func TestServer_NoCrash_HandlerClose_Then_ClientClose(t *testing.T) { + testServerResponse(t, func(w http.ResponseWriter, r *http.Request) error { + // nothing + return nil + }, func(st *serverTester) { + st.writeHeaders(HeadersFrameParam{ + StreamID: 1, + BlockFragment: st.encodeHeader(), + EndStream: false, // DATA is coming + EndHeaders: true, + }) + hf := st.wantHeaders() + if !hf.HeadersEnded() || !hf.StreamEnded() { + t.Fatalf("want END_HEADERS+END_STREAM, got %v", hf) + } + + // Sent when the a Handler closes while a client has + // indicated it's still sending DATA: + st.wantRSTStream(1, ErrCodeCancel) + + // Now the handler has ended, so it's ended its + // stream, but the client hasn't closed its side + // (stateClosedLocal). So send more data and verify + // it doesn't crash with an internal invariant panic, like + // it did before. + st.writeData(1, true, []byte("foo")) + + // Sent after a peer sends data anyway (admittedly the + // previous RST_STREAM might've still been in-flight), + // but they'll get the more friendly 'cancel' code + // first. + st.wantRSTStream(1, ErrCodeStreamClosed) + + // Set up a bunch of machinery to record the panic we saw + // previously. + var ( + panMu sync.Mutex + panicVal interface{} + ) + + testHookOnPanicMu.Lock() + testHookOnPanic = func(sc *serverConn, pv interface{}) bool { + panMu.Lock() + panicVal = pv + panMu.Unlock() + return true + } + testHookOnPanicMu.Unlock() + + // Now force the serve loop to end, via closing the connection. + st.cc.Close() + select { + case <-st.sc.doneServing: + // Loop has exited. + panMu.Lock() + got := panicVal + panMu.Unlock() + if got != nil { + t.Errorf("Got panic: %v", got) + } + case <-time.After(5 * time.Second): + t.Error("timeout") + } + }) +} + +func TestServer_Rejects_TLS10(t *testing.T) { testRejectTLS(t, tls.VersionTLS10) } +func TestServer_Rejects_TLS11(t *testing.T) { testRejectTLS(t, tls.VersionTLS11) } + +func testRejectTLS(t *testing.T, max uint16) { + st := newServerTester(t, nil, func(c *tls.Config) { + c.MaxVersion = max + }) + defer st.Close() + gf := st.wantGoAway() + if got, want := gf.ErrCode, ErrCodeInadequateSecurity; got != want { + t.Errorf("Got error code %v; want %v", got, want) + } +} + +func TestServer_Rejects_TLSBadCipher(t *testing.T) { + st := newServerTester(t, nil, func(c *tls.Config) { + // Only list bad ones: + c.CipherSuites = []uint16{ + tls.TLS_RSA_WITH_RC4_128_SHA, + tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA, + tls.TLS_RSA_WITH_AES_128_CBC_SHA, + tls.TLS_RSA_WITH_AES_256_CBC_SHA, + tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, + tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, + tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, + tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA, + tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, + tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, + } + }) + defer st.Close() + gf := st.wantGoAway() + if got, want := gf.ErrCode, ErrCodeInadequateSecurity; got != want { + t.Errorf("Got error code %v; want %v", got, want) + } +} + +func TestServer_Advertises_Common_Cipher(t *testing.T) { + const requiredSuite = tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 + st := newServerTester(t, nil, func(c *tls.Config) { + // Have the client only support the one required by the spec. + c.CipherSuites = []uint16{requiredSuite} + }, func(ts *httptest.Server) { + var srv *http.Server = ts.Config + // Have the server configured with one specific cipher suite + // which is banned. This tests that ConfigureServer ends up + // adding the good one to this list. + srv.TLSConfig = &tls.Config{ + CipherSuites: []uint16{tls.TLS_RSA_WITH_AES_128_CBC_SHA}, // just a banned one + } + }) + defer st.Close() + st.greet() +} + +// TODO: move this onto *serverTester, and re-use the same hpack +// decoding context throughout. We're just getting lucky here with +// creating a new decoder each time. +func decodeHeader(t *testing.T, headerBlock []byte) (pairs [][2]string) { + d := hpack.NewDecoder(initialHeaderTableSize, func(f hpack.HeaderField) { + pairs = append(pairs, [2]string{f.Name, f.Value}) + }) + if _, err := d.Write(headerBlock); err != nil { + t.Fatalf("hpack decoding error: %v", err) + } + if err := d.Close(); err != nil { + t.Fatalf("hpack decoding error: %v", err) + } + return +} + +// testServerResponse sets up an idle HTTP/2 connection and lets you +// write a single request with writeReq, and then reply to it in some way with the provided handler, +// and then verify the output with the serverTester again (assuming the handler returns nil) +func testServerResponse(t testing.TB, + handler func(http.ResponseWriter, *http.Request) error, + client func(*serverTester), +) { + errc := make(chan error, 1) + st := newServerTester(t, func(w http.ResponseWriter, r *http.Request) { + if r.Body == nil { + t.Fatal("nil Body") + } + errc <- handler(w, r) + }) + defer st.Close() + + donec := make(chan bool) + go func() { + defer close(donec) + st.greet() + client(st) + }() + + select { + case <-donec: + return + case <-time.After(5 * time.Second): + t.Fatal("timeout") + } + + select { + case err := <-errc: + if err != nil { + t.Fatalf("Error in handler: %v", err) + } + case <-time.After(2 * time.Second): + t.Error("timeout waiting for handler to finish") + } +} + +// readBodyHandler returns an http Handler func that reads len(want) +// bytes from r.Body and fails t if the contents read were not +// the value of want. +func readBodyHandler(t *testing.T, want string) func(w http.ResponseWriter, r *http.Request) { + return func(w http.ResponseWriter, r *http.Request) { + buf := make([]byte, len(want)) + _, err := io.ReadFull(r.Body, buf) + if err != nil { + t.Error(err) + return + } + if string(buf) != want { + t.Errorf("read %q; want %q", buf, want) + } + } +} + +// TestServerWithCurl currently fails, hence the LenientCipherSuites test. See: +// https://github.com/tatsuhiro-t/nghttp2/issues/140 & +// http://sourceforge.net/p/curl/bugs/1472/ +func TestServerWithCurl(t *testing.T) { testServerWithCurl(t, false) } +func TestServerWithCurl_LenientCipherSuites(t *testing.T) { testServerWithCurl(t, true) } + +func testServerWithCurl(t *testing.T, permitProhibitedCipherSuites bool) { + if runtime.GOOS != "linux" { + t.Skip("skipping Docker test when not on Linux; requires --net which won't work with boot2docker anyway") + } + requireCurl(t) + const msg = "Hello from curl!\n" + ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Foo", "Bar") + w.Header().Set("Client-Proto", r.Proto) + io.WriteString(w, msg) + })) + ConfigureServer(ts.Config, &Server{ + PermitProhibitedCipherSuites: permitProhibitedCipherSuites, + }) + ts.TLS = ts.Config.TLSConfig // the httptest.Server has its own copy of this TLS config + ts.StartTLS() + defer ts.Close() + + var gotConn int32 + testHookOnConn = func() { atomic.StoreInt32(&gotConn, 1) } + + t.Logf("Running test server for curl to hit at: %s", ts.URL) + container := curl(t, "--silent", "--http2", "--insecure", "-v", ts.URL) + defer kill(container) + resc := make(chan interface{}, 1) + go func() { + res, err := dockerLogs(container) + if err != nil { + resc <- err + } else { + resc <- res + } + }() + select { + case res := <-resc: + if err, ok := res.(error); ok { + t.Fatal(err) + } + if !strings.Contains(string(res.([]byte)), "foo: Bar") { + t.Errorf("didn't see foo: Bar header") + t.Logf("Got: %s", res) + } + if !strings.Contains(string(res.([]byte)), "client-proto: HTTP/2") { + t.Errorf("didn't see client-proto: HTTP/2 header") + t.Logf("Got: %s", res) + } + if !strings.Contains(string(res.([]byte)), msg) { + t.Errorf("didn't see %q content", msg) + t.Logf("Got: %s", res) + } + case <-time.After(3 * time.Second): + t.Errorf("timeout waiting for curl") + } + + if atomic.LoadInt32(&gotConn) == 0 { + t.Error("never saw an http2 connection") + } +} + +func BenchmarkServerGets(b *testing.B) { + b.ReportAllocs() + + const msg = "Hello, world" + st := newServerTester(b, func(w http.ResponseWriter, r *http.Request) { + io.WriteString(w, msg) + }) + defer st.Close() + st.greet() + + // Give the server quota to reply. (plus it has the the 64KB) + if err := st.fr.WriteWindowUpdate(0, uint32(b.N*len(msg))); err != nil { + b.Fatal(err) + } + + for i := 0; i < b.N; i++ { + id := 1 + uint32(i)*2 + st.writeHeaders(HeadersFrameParam{ + StreamID: id, + BlockFragment: st.encodeHeader(), + EndStream: true, + EndHeaders: true, + }) + st.wantHeaders() + df := st.wantData() + if !df.StreamEnded() { + b.Fatalf("DATA didn't have END_STREAM; got %v", df) + } + } +} + +func BenchmarkServerPosts(b *testing.B) { + b.ReportAllocs() + + const msg = "Hello, world" + st := newServerTester(b, func(w http.ResponseWriter, r *http.Request) { + io.WriteString(w, msg) + }) + defer st.Close() + st.greet() + + // Give the server quota to reply. (plus it has the the 64KB) + if err := st.fr.WriteWindowUpdate(0, uint32(b.N*len(msg))); err != nil { + b.Fatal(err) + } + + for i := 0; i < b.N; i++ { + id := 1 + uint32(i)*2 + st.writeHeaders(HeadersFrameParam{ + StreamID: id, + BlockFragment: st.encodeHeader(":method", "POST"), + EndStream: false, + EndHeaders: true, + }) + st.writeData(id, true, nil) + st.wantHeaders() + df := st.wantData() + if !df.StreamEnded() { + b.Fatalf("DATA didn't have END_STREAM; got %v", df) + } + } +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/testdata/draft-ietf-httpbis-http2.xml b/Godeps/_workspace/src/github.com/bradfitz/http2/testdata/draft-ietf-httpbis-http2.xml new file mode 100644 index 000000000..31a84bed4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/testdata/draft-ietf-httpbis-http2.xml @@ -0,0 +1,5021 @@ + + + + + + + + + + + + + + + + + + + Hypertext Transfer Protocol version 2 + + + Twist +
+ mbelshe@chromium.org +
+
+ + + Google, Inc +
+ fenix@google.com +
+
+ + + Mozilla +
+ + 331 E Evelyn Street + Mountain View + CA + 94041 + US + + martin.thomson@gmail.com +
+
+ + + Applications + HTTPbis + HTTP + SPDY + Web + + + + This specification describes an optimized expression of the semantics of the Hypertext + Transfer Protocol (HTTP). HTTP/2 enables a more efficient use of network resources and a + reduced perception of latency by introducing header field compression and allowing multiple + concurrent messages on the same connection. It also introduces unsolicited push of + representations from servers to clients. + + + This specification is an alternative to, but does not obsolete, the HTTP/1.1 message syntax. + HTTP's existing semantics remain unchanged. + + + + + + Discussion of this draft takes place on the HTTPBIS working group mailing list + (ietf-http-wg@w3.org), which is archived at . + + + Working Group information can be found at ; that specific to HTTP/2 are at . + + + The changes in this draft are summarized in . + + + +
+ + +
+ + + The Hypertext Transfer Protocol (HTTP) is a wildly successful protocol. However, the + HTTP/1.1 message format () has + several characteristics that have a negative overall effect on application performance + today. + + + In particular, HTTP/1.0 allowed only one request to be outstanding at a time on a given + TCP connection. HTTP/1.1 added request pipelining, but this only partially addressed + request concurrency and still suffers from head-of-line blocking. Therefore, HTTP/1.1 + clients that need to make many requests typically use multiple connections to a server in + order to achieve concurrency and thereby reduce latency. + + + Furthermore, HTTP header fields are often repetitive and verbose, causing unnecessary + network traffic, as well as causing the initial TCP congestion + window to quickly fill. This can result in excessive latency when multiple requests are + made on a new TCP connection. + + + HTTP/2 addresses these issues by defining an optimized mapping of HTTP's semantics to an + underlying connection. Specifically, it allows interleaving of request and response + messages on the same connection and uses an efficient coding for HTTP header fields. It + also allows prioritization of requests, letting more important requests complete more + quickly, further improving performance. + + + The resulting protocol is more friendly to the network, because fewer TCP connections can + be used in comparison to HTTP/1.x. This means less competition with other flows, and + longer-lived connections, which in turn leads to better utilization of available network + capacity. + + + Finally, HTTP/2 also enables more efficient processing of messages through use of binary + message framing. + +
+ +
+ + HTTP/2 provides an optimized transport for HTTP semantics. HTTP/2 supports all of the core + features of HTTP/1.1, but aims to be more efficient in several ways. + + + The basic protocol unit in HTTP/2 is a frame. Each frame + type serves a different purpose. For example, HEADERS and + DATA frames form the basis of HTTP requests and + responses; other frame types like SETTINGS, + WINDOW_UPDATE, and PUSH_PROMISE are used in support of other + HTTP/2 features. + + + Multiplexing of requests is achieved by having each HTTP request-response exchange + associated with its own stream. Streams are largely + independent of each other, so a blocked or stalled request or response does not prevent + progress on other streams. + + + Flow control and prioritization ensure that it is possible to efficiently use multiplexed + streams. Flow control helps to ensure that only data that + can be used by a receiver is transmitted. Prioritization ensures that limited resources can be directed + to the most important streams first. + + + HTTP/2 adds a new interaction mode, whereby a server can push + responses to a client. Server push allows a server to speculatively send a client + data that the server anticipates the client will need, trading off some network usage + against a potential latency gain. The server does this by synthesizing a request, which it + sends as a PUSH_PROMISE frame. The server is then able to send a response to + the synthetic request on a separate stream. + + + Frames that contain HTTP header fields are compressed. + HTTP requests can be highly redundant, so compression can reduce the size of requests and + responses significantly. + + +
+ + The HTTP/2 specification is split into four parts: + + + Starting HTTP/2 covers how an HTTP/2 connection is + initiated. + + + The framing and streams layers describe the way HTTP/2 frames are + structured and formed into multiplexed streams. + + + Frame and error + definitions include details of the frame and error types used in HTTP/2. + + + HTTP mappings and additional + requirements describe how HTTP semantics are expressed using frames and + streams. + + + + + While some of the frame and stream layer concepts are isolated from HTTP, this + specification does not define a completely generic framing layer. The framing and streams + layers are tailored to the needs of the HTTP protocol and server push. + +
+ +
+ + The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD + NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as + described in RFC 2119. + + + All numeric values are in network byte order. Values are unsigned unless otherwise + indicated. Literal values are provided in decimal or hexadecimal as appropriate. + Hexadecimal literals are prefixed with 0x to distinguish them + from decimal literals. + + + The following terms are used: + + + The endpoint initiating the HTTP/2 connection. + + + A transport-layer connection between two endpoints. + + + An error that affects the entire HTTP/2 connection. + + + Either the client or server of the connection. + + + The smallest unit of communication within an HTTP/2 connection, consisting of a header + and a variable-length sequence of octets structured according to the frame type. + + + An endpoint. When discussing a particular endpoint, "peer" refers to the endpoint + that is remote to the primary subject of discussion. + + + An endpoint that is receiving frames. + + + An endpoint that is transmitting frames. + + + The endpoint which did not initiate the HTTP/2 connection. + + + A bi-directional flow of frames across a virtual channel within the HTTP/2 connection. + + + An error on the individual HTTP/2 stream. + + + + + Finally, the terms "gateway", "intermediary", "proxy", and "tunnel" are defined + in . + +
+
+ +
+ + An HTTP/2 connection is an application layer protocol running on top of a TCP connection + (). The client is the TCP connection initiator. + + + HTTP/2 uses the same "http" and "https" URI schemes used by HTTP/1.1. HTTP/2 shares the same + default port numbers: 80 for "http" URIs and 443 for "https" URIs. As a result, + implementations processing requests for target resource URIs like http://example.org/foo or https://example.com/bar are required to first discover whether the + upstream server (the immediate peer to which the client wishes to establish a connection) + supports HTTP/2. + + + + The means by which support for HTTP/2 is determined is different for "http" and "https" + URIs. Discovery for "http" URIs is described in . Discovery + for "https" URIs is described in . + + +
+ + The protocol defined in this document has two identifiers. + + + + The string "h2" identifies the protocol where HTTP/2 uses TLS. This identifier is used in the TLS application layer protocol negotiation extension (ALPN) + field and any place that HTTP/2 over TLS is identified. + + + The "h2" string is serialized into an ALPN protocol identifier as the two octet + sequence: 0x68, 0x32. + + + + + The string "h2c" identifies the protocol where HTTP/2 is run over cleartext TCP. + This identifier is used in the HTTP/1.1 Upgrade header field and any place that + HTTP/2 over TCP is identified. + + + + + + Negotiating "h2" or "h2c" implies the use of the transport, security, framing and message + semantics described in this document. + + + RFC Editor's Note: please remove the remainder of this section prior to the + publication of a final version of this document. + + + Only implementations of the final, published RFC can identify themselves as "h2" or "h2c". + Until such an RFC exists, implementations MUST NOT identify themselves using these + strings. + + + Examples and text throughout the rest of this document use "h2" as a matter of + editorial convenience only. Implementations of draft versions MUST NOT identify using + this string. + + + Implementations of draft versions of the protocol MUST add the string "-" and the + corresponding draft number to the identifier. For example, draft-ietf-httpbis-http2-11 + over TLS is identified using the string "h2-11". + + + Non-compatible experiments that are based on these draft versions MUST append the string + "-" and an experiment name to the identifier. For example, an experimental implementation + of packet mood-based encoding based on draft-ietf-httpbis-http2-09 might identify itself + as "h2-09-emo". Note that any label MUST conform to the "token" syntax defined in + . Experimenters are + encouraged to coordinate their experiments on the ietf-http-wg@w3.org mailing list. + +
+ +
+ + A client that makes a request for an "http" URI without prior knowledge about support for + HTTP/2 uses the HTTP Upgrade mechanism (). The client makes an HTTP/1.1 request that includes an Upgrade + header field identifying HTTP/2 with the "h2c" token. The HTTP/1.1 request MUST include + exactly one HTTP2-Settings header field. + +
+ For example: + + +]]> +
+ + Requests that contain an entity body MUST be sent in their entirety before the client can + send HTTP/2 frames. This means that a large request entity can block the use of the + connection until it is completely sent. + + + If concurrency of an initial request with subsequent requests is important, an OPTIONS + request can be used to perform the upgrade to HTTP/2, at the cost of an additional + round-trip. + + + A server that does not support HTTP/2 can respond to the request as though the Upgrade + header field were absent: + +
+ +HTTP/1.1 200 OK +Content-Length: 243 +Content-Type: text/html + +... + +
+ + A server MUST ignore a "h2" token in an Upgrade header field. Presence of a token with + "h2" implies HTTP/2 over TLS, which is instead negotiated as described in . + + + A server that supports HTTP/2 can accept the upgrade with a 101 (Switching Protocols) + response. After the empty line that terminates the 101 response, the server can begin + sending HTTP/2 frames. These frames MUST include a response to the request that initiated + the Upgrade. + + +
+ + For example: + + +HTTP/1.1 101 Switching Protocols +Connection: Upgrade +Upgrade: h2c + +[ HTTP/2 connection ... + +
+ + The first HTTP/2 frame sent by the server is a SETTINGS frame () as the server connection preface (). Upon receiving the 101 response, the client sends a connection preface, which includes a + SETTINGS frame. + + + The HTTP/1.1 request that is sent prior to upgrade is assigned stream identifier 1 and is + assigned default priority values. Stream 1 is + implicitly half closed from the client toward the server, since the request is completed + as an HTTP/1.1 request. After commencing the HTTP/2 connection, stream 1 is used for the + response. + + +
+ + A request that upgrades from HTTP/1.1 to HTTP/2 MUST include exactly one HTTP2-Settings header field. The HTTP2-Settings header field is a connection-specific header field + that includes parameters that govern the HTTP/2 connection, provided in anticipation of + the server accepting the request to upgrade. + +
+ +
+ + A server MUST NOT upgrade the connection to HTTP/2 if this header field is not present, + or if more than one is present. A server MUST NOT send this header field. + + + + The content of the HTTP2-Settings header field is the + payload of a SETTINGS frame (), encoded as a + base64url string (that is, the URL- and filename-safe Base64 encoding described in , with any trailing '=' characters omitted). The + ABNF production for token68 is + defined in . + + + Since the upgrade is only intended to apply to the immediate connection, a client + sending HTTP2-Settings MUST also send HTTP2-Settings as a connection option in the Connection header field to prevent it from being forwarded + downstream. + + + A server decodes and interprets these values as it would any other + SETTINGS frame. Acknowledgement of the + SETTINGS parameters is not necessary, since a 101 response serves as implicit + acknowledgment. Providing these values in the Upgrade request gives a client an + opportunity to provide parameters prior to receiving any frames from the server. + +
+
+ +
+ + A client that makes a request to an "https" URI uses TLS + with the application layer protocol negotiation extension. + + + HTTP/2 over TLS uses the "h2" application token. The "h2c" token MUST NOT be sent by a + client or selected by a server. + + + Once TLS negotiation is complete, both the client and the server send a connection preface. + +
+ +
+ + A client can learn that a particular server supports HTTP/2 by other means. For example, + describes a mechanism for advertising this capability. + + + A client MAY immediately send HTTP/2 frames to a server that is known to support HTTP/2, + after the connection preface; a server can + identify such a connection by the presence of the connection preface. This only affects + the establishment of HTTP/2 connections over cleartext TCP; implementations that support + HTTP/2 over TLS MUST use protocol negotiation in TLS. + + + Without additional information, prior support for HTTP/2 is not a strong signal that a + given server will support HTTP/2 for future connections. For example, it is possible for + server configurations to change, for configurations to differ between instances in + clustered servers, or for network conditions to change. + +
+ +
+ + Upon establishment of a TCP connection and determination that HTTP/2 will be used by both + peers, each endpoint MUST send a connection preface as a final confirmation and to + establish the initial SETTINGS parameters for the HTTP/2 connection. The client and + server each send a different connection preface. + + + The client connection preface starts with a sequence of 24 octets, which in hex notation + are: + +
+ +
+ + (the string PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n). This sequence + is followed by a SETTINGS frame (). The + SETTINGS frame MAY be empty. The client sends the client connection + preface immediately upon receipt of a 101 Switching Protocols response (indicating a + successful upgrade), or as the first application data octets of a TLS connection. If + starting an HTTP/2 connection with prior knowledge of server support for the protocol, the + client connection preface is sent upon connection establishment. + + + + + The client connection preface is selected so that a large proportion of HTTP/1.1 or + HTTP/1.0 servers and intermediaries do not attempt to process further frames. Note + that this does not address the concerns raised in . + + + + + The server connection preface consists of a potentially empty SETTINGS + frame () that MUST be the first frame the server sends in the + HTTP/2 connection. + + + The SETTINGS frames received from a peer as part of the connection preface + MUST be acknowledged (see ) after sending the connection + preface. + + + To avoid unnecessary latency, clients are permitted to send additional frames to the + server immediately after sending the client connection preface, without waiting to receive + the server connection preface. It is important to note, however, that the server + connection preface SETTINGS frame might include parameters that necessarily + alter how a client is expected to communicate with the server. Upon receiving the + SETTINGS frame, the client is expected to honor any parameters established. + In some configurations, it is possible for the server to transmit SETTINGS + before the client sends additional frames, providing an opportunity to avoid this issue. + + + Clients and servers MUST treat an invalid connection preface as a connection error of type + PROTOCOL_ERROR. A GOAWAY frame () + MAY be omitted in this case, since an invalid preface indicates that the peer is not using + HTTP/2. + +
+
+ +
+ + Once the HTTP/2 connection is established, endpoints can begin exchanging frames. + + +
+ + All frames begin with a fixed 9-octet header followed by a variable-length payload. + +
+ +
+ + The fields of the frame header are defined as: + + + + The length of the frame payload expressed as an unsigned 24-bit integer. Values + greater than 214 (16,384) MUST NOT be sent unless the receiver has + set a larger value for SETTINGS_MAX_FRAME_SIZE. + + + The 9 octets of the frame header are not included in this value. + + + + + The 8-bit type of the frame. The frame type determines the format and semantics of + the frame. Implementations MUST ignore and discard any frame that has a type that + is unknown. + + + + + An 8-bit field reserved for frame-type specific boolean flags. + + + Flags are assigned semantics specific to the indicated frame type. Flags that have + no defined semantics for a particular frame type MUST be ignored, and MUST be left + unset (0) when sending. + + + + + A reserved 1-bit field. The semantics of this bit are undefined and the bit MUST + remain unset (0) when sending and MUST be ignored when receiving. + + + + + A 31-bit stream identifier (see ). The value 0 is + reserved for frames that are associated with the connection as a whole as opposed to + an individual stream. + + + + + + The structure and content of the frame payload is dependent entirely on the frame type. + +
+ +
+ + The size of a frame payload is limited by the maximum size that a receiver advertises in + the SETTINGS_MAX_FRAME_SIZE setting. This setting can have any value + between 214 (16,384) and 224-1 (16,777,215) octets, + inclusive. + + + All implementations MUST be capable of receiving and minimally processing frames up to + 214 octets in length, plus the 9 octet frame + header. The size of the frame header is not included when describing frame sizes. + + + Certain frame types, such as PING, impose additional limits + on the amount of payload data allowed. + + + + + If a frame size exceeds any defined limit, or is too small to contain mandatory frame + data, the endpoint MUST send a FRAME_SIZE_ERROR error. A frame size error + in a frame that could alter the state of the entire connection MUST be treated as a connection error; this includes any frame carrying + a header block (that is, HEADERS, + PUSH_PROMISE, and CONTINUATION), SETTINGS, + and any WINDOW_UPDATE frame with a stream identifier of 0. + + + Endpoints are not obligated to use all available space in a frame. Responsiveness can be + improved by using frames that are smaller than the permitted maximum size. Sending large + frames can result in delays in sending time-sensitive frames (such + RST_STREAM, WINDOW_UPDATE, or PRIORITY) + which if blocked by the transmission of a large frame, could affect performance. + +
+ +
+ + Just as in HTTP/1, a header field in HTTP/2 is a name with one or more associated values. + They are used within HTTP request and response messages as well as server push operations + (see ). + + + Header lists are collections of zero or more header fields. When transmitted over a + connection, a header list is serialized into a header block using HTTP Header Compression. The serialized header block is then + divided into one or more octet sequences, called header block fragments, and transmitted + within the payload of HEADERS, PUSH_PROMISE or CONTINUATION frames. + + + The Cookie header field is treated specially by the HTTP + mapping (see ). + + + A receiving endpoint reassembles the header block by concatenating its fragments, then + decompresses the block to reconstruct the header list. + + + A complete header block consists of either: + + + a single HEADERS or PUSH_PROMISE frame, + with the END_HEADERS flag set, or + + + a HEADERS or PUSH_PROMISE frame with the END_HEADERS + flag cleared and one or more CONTINUATION frames, + where the last CONTINUATION frame has the END_HEADERS flag set. + + + + + Header compression is stateful. One compression context and one decompression context is + used for the entire connection. Each header block is processed as a discrete unit. + Header blocks MUST be transmitted as a contiguous sequence of frames, with no interleaved + frames of any other type or from any other stream. The last frame in a sequence of + HEADERS or CONTINUATION frames MUST have the END_HEADERS + flag set. The last frame in a sequence of PUSH_PROMISE or + CONTINUATION frames MUST have the END_HEADERS flag set. This allows a + header block to be logically equivalent to a single frame. + + + Header block fragments can only be sent as the payload of HEADERS, + PUSH_PROMISE or CONTINUATION frames, because these frames + carry data that can modify the compression context maintained by a receiver. An endpoint + receiving HEADERS, PUSH_PROMISE or + CONTINUATION frames MUST reassemble header blocks and perform decompression + even if the frames are to be discarded. A receiver MUST terminate the connection with a + connection error of type + COMPRESSION_ERROR if it does not decompress a header block. + +
+
+ +
+ + A "stream" is an independent, bi-directional sequence of frames exchanged between the client + and server within an HTTP/2 connection. Streams have several important characteristics: + + + A single HTTP/2 connection can contain multiple concurrently open streams, with either + endpoint interleaving frames from multiple streams. + + + Streams can be established and used unilaterally or shared by either the client or + server. + + + Streams can be closed by either endpoint. + + + The order in which frames are sent on a stream is significant. Recipients process frames + in the order they are received. In particular, the order of HEADERS, + and DATA frames is semantically significant. + + + Streams are identified by an integer. Stream identifiers are assigned to streams by the + endpoint initiating the stream. + + + + +
+ + The lifecycle of a stream is shown in . + + +
+ + | |<-----------' | + | R | closed | R | + `-------------------->| |<--------------------' + +--------+ + + H: HEADERS frame (with implied CONTINUATIONs) + PP: PUSH_PROMISE frame (with implied CONTINUATIONs) + ES: END_STREAM flag + R: RST_STREAM frame +]]> + +
+ + + Note that this diagram shows stream state transitions and the frames and flags that affect + those transitions only. In this regard, CONTINUATION frames do not result + in state transitions; they are effectively part of the HEADERS or + PUSH_PROMISE that they follow. For this purpose, the END_STREAM flag is + processed as a separate event to the frame that bears it; a HEADERS frame + with the END_STREAM flag set can cause two state transitions. + + + Both endpoints have a subjective view of the state of a stream that could be different + when frames are in transit. Endpoints do not coordinate the creation of streams; they are + created unilaterally by either endpoint. The negative consequences of a mismatch in + states are limited to the "closed" state after sending RST_STREAM, where + frames might be received for some time after closing. + + + Streams have the following states: + + + + + + All streams start in the "idle" state. In this state, no frames have been + exchanged. + + + The following transitions are valid from this state: + + + Sending or receiving a HEADERS frame causes the stream to become + "open". The stream identifier is selected as described in . The same HEADERS frame can also + cause a stream to immediately become "half closed". + + + Sending a PUSH_PROMISE frame marks the associated stream for + later use. The stream state for the reserved stream transitions to "reserved + (local)". + + + Receiving a PUSH_PROMISE frame marks the associated stream as + reserved by the remote peer. The state of the stream becomes "reserved + (remote)". + + + + + Receiving any frames other than HEADERS or + PUSH_PROMISE on a stream in this state MUST be treated as a connection error of type + PROTOCOL_ERROR. + + + + + + + A stream in the "reserved (local)" state is one that has been promised by sending a + PUSH_PROMISE frame. A PUSH_PROMISE frame reserves an + idle stream by associating the stream with an open stream that was initiated by the + remote peer (see ). + + + In this state, only the following transitions are possible: + + + The endpoint can send a HEADERS frame. This causes the stream to + open in a "half closed (remote)" state. + + + Either endpoint can send a RST_STREAM frame to cause the stream + to become "closed". This releases the stream reservation. + + + + + An endpoint MUST NOT send any type of frame other than HEADERS or + RST_STREAM in this state. + + + A PRIORITY frame MAY be received in this state. Receiving any type + of frame other than RST_STREAM or PRIORITY on a stream + in this state MUST be treated as a connection + error of type PROTOCOL_ERROR. + + + + + + + A stream in the "reserved (remote)" state has been reserved by a remote peer. + + + In this state, only the following transitions are possible: + + + Receiving a HEADERS frame causes the stream to transition to + "half closed (local)". + + + Either endpoint can send a RST_STREAM frame to cause the stream + to become "closed". This releases the stream reservation. + + + + + An endpoint MAY send a PRIORITY frame in this state to reprioritize + the reserved stream. An endpoint MUST NOT send any type of frame other than + RST_STREAM, WINDOW_UPDATE, or PRIORITY + in this state. + + + Receiving any type of frame other than HEADERS or + RST_STREAM on a stream in this state MUST be treated as a connection error of type + PROTOCOL_ERROR. + + + + + + + A stream in the "open" state may be used by both peers to send frames of any type. + In this state, sending peers observe advertised stream + level flow control limits. + + + From this state either endpoint can send a frame with an END_STREAM flag set, which + causes the stream to transition into one of the "half closed" states: an endpoint + sending an END_STREAM flag causes the stream state to become "half closed (local)"; + an endpoint receiving an END_STREAM flag causes the stream state to become "half + closed (remote)". + + + Either endpoint can send a RST_STREAM frame from this state, causing + it to transition immediately to "closed". + + + + + + + A stream that is in the "half closed (local)" state cannot be used for sending + frames. Only WINDOW_UPDATE, PRIORITY and + RST_STREAM frames can be sent in this state. + + + A stream transitions from this state to "closed" when a frame that contains an + END_STREAM flag is received, or when either peer sends a RST_STREAM + frame. + + + A receiver can ignore WINDOW_UPDATE frames in this state, which might + arrive for a short period after a frame bearing the END_STREAM flag is sent. + + + PRIORITY frames received in this state are used to reprioritize + streams that depend on the current stream. + + + + + + + A stream that is "half closed (remote)" is no longer being used by the peer to send + frames. In this state, an endpoint is no longer obligated to maintain a receiver + flow control window if it performs flow control. + + + If an endpoint receives additional frames for a stream that is in this state, other + than WINDOW_UPDATE, PRIORITY or + RST_STREAM, it MUST respond with a stream error of type + STREAM_CLOSED. + + + A stream that is "half closed (remote)" can be used by the endpoint to send frames + of any type. In this state, the endpoint continues to observe advertised stream level flow control limits. + + + A stream can transition from this state to "closed" by sending a frame that contains + an END_STREAM flag, or when either peer sends a RST_STREAM frame. + + + + + + + The "closed" state is the terminal state. + + + An endpoint MUST NOT send frames other than PRIORITY on a closed + stream. An endpoint that receives any frame other than PRIORITY + after receiving a RST_STREAM MUST treat that as a stream error of type + STREAM_CLOSED. Similarly, an endpoint that receives any frames after + receiving a frame with the END_STREAM flag set MUST treat that as a connection error of type + STREAM_CLOSED, unless the frame is permitted as described below. + + + WINDOW_UPDATE or RST_STREAM frames can be received in + this state for a short period after a DATA or HEADERS + frame containing an END_STREAM flag is sent. Until the remote peer receives and + processes RST_STREAM or the frame bearing the END_STREAM flag, it + might send frames of these types. Endpoints MUST ignore + WINDOW_UPDATE or RST_STREAM frames received in this + state, though endpoints MAY choose to treat frames that arrive a significant time + after sending END_STREAM as a connection + error of type PROTOCOL_ERROR. + + + PRIORITY frames can be sent on closed streams to prioritize streams + that are dependent on the closed stream. Endpoints SHOULD process + PRIORITY frame, though they can be ignored if the stream has been + removed from the dependency tree (see ). + + + If this state is reached as a result of sending a RST_STREAM frame, + the peer that receives the RST_STREAM might have already sent - or + enqueued for sending - frames on the stream that cannot be withdrawn. An endpoint + MUST ignore frames that it receives on closed streams after it has sent a + RST_STREAM frame. An endpoint MAY choose to limit the period over + which it ignores frames and treat frames that arrive after this time as being in + error. + + + Flow controlled frames (i.e., DATA) received after sending + RST_STREAM are counted toward the connection flow control window. + Even though these frames might be ignored, because they are sent before the sender + receives the RST_STREAM, the sender will consider the frames to count + against the flow control window. + + + An endpoint might receive a PUSH_PROMISE frame after it sends + RST_STREAM. PUSH_PROMISE causes a stream to become + "reserved" even if the associated stream has been reset. Therefore, a + RST_STREAM is needed to close an unwanted promised stream. + + + + + + In the absence of more specific guidance elsewhere in this document, implementations + SHOULD treat the receipt of a frame that is not expressly permitted in the description of + a state as a connection error of type + PROTOCOL_ERROR. Frame of unknown types are ignored. + + + An example of the state transitions for an HTTP request/response exchange can be found in + . An example of the state transitions for server push can be + found in and . + + +
+ + Streams are identified with an unsigned 31-bit integer. Streams initiated by a client + MUST use odd-numbered stream identifiers; those initiated by the server MUST use + even-numbered stream identifiers. A stream identifier of zero (0x0) is used for + connection control messages; the stream identifier zero cannot be used to establish a + new stream. + + + HTTP/1.1 requests that are upgraded to HTTP/2 (see ) are + responded to with a stream identifier of one (0x1). After the upgrade + completes, stream 0x1 is "half closed (local)" to the client. Therefore, stream 0x1 + cannot be selected as a new stream identifier by a client that upgrades from HTTP/1.1. + + + The identifier of a newly established stream MUST be numerically greater than all + streams that the initiating endpoint has opened or reserved. This governs streams that + are opened using a HEADERS frame and streams that are reserved using + PUSH_PROMISE. An endpoint that receives an unexpected stream identifier + MUST respond with a connection error of + type PROTOCOL_ERROR. + + + The first use of a new stream identifier implicitly closes all streams in the "idle" + state that might have been initiated by that peer with a lower-valued stream identifier. + For example, if a client sends a HEADERS frame on stream 7 without ever + sending a frame on stream 5, then stream 5 transitions to the "closed" state when the + first frame for stream 7 is sent or received. + + + Stream identifiers cannot be reused. Long-lived connections can result in an endpoint + exhausting the available range of stream identifiers. A client that is unable to + establish a new stream identifier can establish a new connection for new streams. A + server that is unable to establish a new stream identifier can send a + GOAWAY frame so that the client is forced to open a new connection for + new streams. + +
+ +
+ + A peer can limit the number of concurrently active streams using the + SETTINGS_MAX_CONCURRENT_STREAMS parameter (see ) within a SETTINGS frame. The maximum concurrent + streams setting is specific to each endpoint and applies only to the peer that receives + the setting. That is, clients specify the maximum number of concurrent streams the + server can initiate, and servers specify the maximum number of concurrent streams the + client can initiate. + + + Streams that are in the "open" state, or either of the "half closed" states count toward + the maximum number of streams that an endpoint is permitted to open. Streams in any of + these three states count toward the limit advertised in the + SETTINGS_MAX_CONCURRENT_STREAMS setting. Streams in either of the + "reserved" states do not count toward the stream limit. + + + Endpoints MUST NOT exceed the limit set by their peer. An endpoint that receives a + HEADERS frame that causes their advertised concurrent stream limit to be + exceeded MUST treat this as a stream error. An + endpoint that wishes to reduce the value of + SETTINGS_MAX_CONCURRENT_STREAMS to a value that is below the current + number of open streams can either close streams that exceed the new value or allow + streams to complete. + +
+
+ +
+ + Using streams for multiplexing introduces contention over use of the TCP connection, + resulting in blocked streams. A flow control scheme ensures that streams on the same + connection do not destructively interfere with each other. Flow control is used for both + individual streams and for the connection as a whole. + + + HTTP/2 provides for flow control through use of the WINDOW_UPDATE frame. + + +
+ + HTTP/2 stream flow control aims to allow a variety of flow control algorithms to be + used without requiring protocol changes. Flow control in HTTP/2 has the following + characteristics: + + + Flow control is specific to a connection; i.e., it is "hop-by-hop", not + "end-to-end". + + + Flow control is based on window update frames. Receivers advertise how many octets + they are prepared to receive on a stream and for the entire connection. This is a + credit-based scheme. + + + Flow control is directional with overall control provided by the receiver. A + receiver MAY choose to set any window size that it desires for each stream and for + the entire connection. A sender MUST respect flow control limits imposed by a + receiver. Clients, servers and intermediaries all independently advertise their + flow control window as a receiver and abide by the flow control limits set by + their peer when sending. + + + The initial value for the flow control window is 65,535 octets for both new streams + and the overall connection. + + + The frame type determines whether flow control applies to a frame. Of the frames + specified in this document, only DATA frames are subject to flow + control; all other frame types do not consume space in the advertised flow control + window. This ensures that important control frames are not blocked by flow control. + + + Flow control cannot be disabled. + + + HTTP/2 defines only the format and semantics of the WINDOW_UPDATE + frame (). This document does not stipulate how a + receiver decides when to send this frame or the value that it sends, nor does it + specify how a sender chooses to send packets. Implementations are able to select + any algorithm that suits their needs. + + + + + Implementations are also responsible for managing how requests and responses are sent + based on priority; choosing how to avoid head of line blocking for requests; and + managing the creation of new streams. Algorithm choices for these could interact with + any flow control algorithm. + +
+ +
+ + Flow control is defined to protect endpoints that are operating under resource + constraints. For example, a proxy needs to share memory between many connections, and + also might have a slow upstream connection and a fast downstream one. Flow control + addresses cases where the receiver is unable process data on one stream, yet wants to + continue to process other streams in the same connection. + + + Deployments that do not require this capability can advertise a flow control window of + the maximum size, incrementing the available space when new data is received. This + effectively disables flow control for that receiver. Conversely, a sender is always + subject to the flow control window advertised by the receiver. + + + Deployments with constrained resources (for example, memory) can employ flow control to + limit the amount of memory a peer can consume. Note, however, that this can lead to + suboptimal use of available network resources if flow control is enabled without + knowledge of the bandwidth-delay product (see ). + + + Even with full awareness of the current bandwidth-delay product, implementation of flow + control can be difficult. When using flow control, the receiver MUST read from the TCP + receive buffer in a timely fashion. Failure to do so could lead to a deadlock when + critical frames, such as WINDOW_UPDATE, are not read and acted upon. + +
+
+ +
+ + A client can assign a priority for a new stream by including prioritization information in + the HEADERS frame that opens the stream. For an existing + stream, the PRIORITY frame can be used to change the + priority. + + + The purpose of prioritization is to allow an endpoint to express how it would prefer its + peer allocate resources when managing concurrent streams. Most importantly, priority can + be used to select streams for transmitting frames when there is limited capacity for + sending. + + + Streams can be prioritized by marking them as dependent on the completion of other streams + (). Each dependency is assigned a relative weight, a number + that is used to determine the relative proportion of available resources that are assigned + to streams dependent on the same stream. + + + + Explicitly setting the priority for a stream is input to a prioritization process. It + does not guarantee any particular processing or transmission order for the stream relative + to any other stream. An endpoint cannot force a peer to process concurrent streams in a + particular order using priority. Expressing priority is therefore only ever a suggestion. + + + Providing prioritization information is optional, so default values are used if no + explicit indicator is provided (). + + +
+ + Each stream can be given an explicit dependency on another stream. Including a + dependency expresses a preference to allocate resources to the identified stream rather + than to the dependent stream. + + + A stream that is not dependent on any other stream is given a stream dependency of 0x0. + In other words, the non-existent stream 0 forms the root of the tree. + + + A stream that depends on another stream is a dependent stream. The stream upon which a + stream is dependent is a parent stream. A dependency on a stream that is not currently + in the tree - such as a stream in the "idle" state - results in that stream being given + a default priority. + + + When assigning a dependency on another stream, the stream is added as a new dependency + of the parent stream. Dependent streams that share the same parent are not ordered with + respect to each other. For example, if streams B and C are dependent on stream A, and + if stream D is created with a dependency on stream A, this results in a dependency order + of A followed by B, C, and D in any order. + +
+ /|\ + B C B D C +]]> +
+ + An exclusive flag allows for the insertion of a new level of dependencies. The + exclusive flag causes the stream to become the sole dependency of its parent stream, + causing other dependencies to become dependent on the exclusive stream. In the + previous example, if stream D is created with an exclusive dependency on stream A, this + results in D becoming the dependency parent of B and C. + +
+ D + B C / \ + B C +]]> +
+ + Inside the dependency tree, a dependent stream SHOULD only be allocated resources if all + of the streams that it depends on (the chain of parent streams up to 0x0) are either + closed, or it is not possible to make progress on them. + + + A stream cannot depend on itself. An endpoint MUST treat this as a stream error of type PROTOCOL_ERROR. + +
+ +
+ + All dependent streams are allocated an integer weight between 1 and 256 (inclusive). + + + Streams with the same parent SHOULD be allocated resources proportionally based on their + weight. Thus, if stream B depends on stream A with weight 4, and C depends on stream A + with weight 12, and if no progress can be made on A, stream B ideally receives one third + of the resources allocated to stream C. + +
+ +
+ + Stream priorities are changed using the PRIORITY frame. Setting a + dependency causes a stream to become dependent on the identified parent stream. + + + Dependent streams move with their parent stream if the parent is reprioritized. Setting + a dependency with the exclusive flag for a reprioritized stream moves all the + dependencies of the new parent stream to become dependent on the reprioritized stream. + + + If a stream is made dependent on one of its own dependencies, the formerly dependent + stream is first moved to be dependent on the reprioritized stream's previous parent. + The moved dependency retains its weight. + +
+ + For example, consider an original dependency tree where B and C depend on A, D and E + depend on C, and F depends on D. If A is made dependent on D, then D takes the place + of A. All other dependency relationships stay the same, except for F, which becomes + dependent on A if the reprioritization is exclusive. + + F B C ==> F A OR A + / \ | / \ /|\ + D E E B C B C F + | | | + F E E + (intermediate) (non-exclusive) (exclusive) +]]> +
+
+ +
+ + When a stream is removed from the dependency tree, its dependencies can be moved to + become dependent on the parent of the closed stream. The weights of new dependencies + are recalculated by distributing the weight of the dependency of the closed stream + proportionally based on the weights of its dependencies. + + + Streams that are removed from the dependency tree cause some prioritization information + to be lost. Resources are shared between streams with the same parent stream, which + means that if a stream in that set closes or becomes blocked, any spare capacity + allocated to a stream is distributed to the immediate neighbors of the stream. However, + if the common dependency is removed from the tree, those streams share resources with + streams at the next highest level. + + + For example, assume streams A and B share a parent, and streams C and D both depend on + stream A. Prior to the removal of stream A, if streams A and D are unable to proceed, + then stream C receives all the resources dedicated to stream A. If stream A is removed + from the tree, the weight of stream A is divided between streams C and D. If stream D + is still unable to proceed, this results in stream C receiving a reduced proportion of + resources. For equal starting weights, C receives one third, rather than one half, of + available resources. + + + It is possible for a stream to become closed while prioritization information that + creates a dependency on that stream is in transit. If a stream identified in a + dependency has no associated priority information, then the dependent stream is instead + assigned a default priority. This potentially creates + suboptimal prioritization, since the stream could be given a priority that is different + to what is intended. + + + To avoid these problems, an endpoint SHOULD retain stream prioritization state for a + period after streams become closed. The longer state is retained, the lower the chance + that streams are assigned incorrect or default priority values. + + + This could create a large state burden for an endpoint, so this state MAY be limited. + An endpoint MAY apply a fixed upper limit on the number of closed streams for which + prioritization state is tracked to limit state exposure. The amount of additional state + an endpoint maintains could be dependent on load; under high load, prioritization state + can be discarded to limit resource commitments. In extreme cases, an endpoint could + even discard prioritization state for active or reserved streams. If a fixed limit is + applied, endpoints SHOULD maintain state for at least as many streams as allowed by + their setting for SETTINGS_MAX_CONCURRENT_STREAMS. + + + An endpoint receiving a PRIORITY frame that changes the priority of a + closed stream SHOULD alter the dependencies of the streams that depend on it, if it has + retained enough state to do so. + +
+ +
+ + Providing priority information is optional. Streams are assigned a non-exclusive + dependency on stream 0x0 by default. Pushed streams + initially depend on their associated stream. In both cases, streams are assigned a + default weight of 16. + +
+
+ +
+ + HTTP/2 framing permits two classes of error: + + + An error condition that renders the entire connection unusable is a connection error. + + + An error in an individual stream is a stream error. + + + + + A list of error codes is included in . + + +
+ + A connection error is any error which prevents further processing of the framing layer, + or which corrupts any connection state. + + + An endpoint that encounters a connection error SHOULD first send a GOAWAY + frame () with the stream identifier of the last stream that it + successfully received from its peer. The GOAWAY frame includes an error + code that indicates why the connection is terminating. After sending the + GOAWAY frame, the endpoint MUST close the TCP connection. + + + It is possible that the GOAWAY will not be reliably received by the + receiving endpoint (see ). In the event of a connection error, + GOAWAY only provides a best effort attempt to communicate with the peer + about why the connection is being terminated. + + + An endpoint can end a connection at any time. In particular, an endpoint MAY choose to + treat a stream error as a connection error. Endpoints SHOULD send a + GOAWAY frame when ending a connection, providing that circumstances + permit it. + +
+ +
+ + A stream error is an error related to a specific stream that does not affect processing + of other streams. + + + An endpoint that detects a stream error sends a RST_STREAM frame () that contains the stream identifier of the stream where the error + occurred. The RST_STREAM frame includes an error code that indicates the + type of error. + + + A RST_STREAM is the last frame that an endpoint can send on a stream. + The peer that sends the RST_STREAM frame MUST be prepared to receive any + frames that were sent or enqueued for sending by the remote peer. These frames can be + ignored, except where they modify connection state (such as the state maintained for + header compression, or flow control). + + + Normally, an endpoint SHOULD NOT send more than one RST_STREAM frame for + any stream. However, an endpoint MAY send additional RST_STREAM frames if + it receives frames on a closed stream after more than a round-trip time. This behavior + is permitted to deal with misbehaving implementations. + + + An endpoint MUST NOT send a RST_STREAM in response to an + RST_STREAM frame, to avoid looping. + +
+ +
+ + If the TCP connection is closed or reset while streams remain in open or half closed + states, then the endpoint MUST assume that those streams were abnormally interrupted and + could be incomplete. + +
+
+ +
+ + HTTP/2 permits extension of the protocol. Protocol extensions can be used to provide + additional services or alter any aspect of the protocol, within the limitations described + in this section. Extensions are effective only within the scope of a single HTTP/2 + connection. + + + Extensions are permitted to use new frame types, new + settings, or new error + codes. Registries are established for managing these extension points: frame types, settings and + error codes. + + + Implementations MUST ignore unknown or unsupported values in all extensible protocol + elements. Implementations MUST discard frames that have unknown or unsupported types. + This means that any of these extension points can be safely used by extensions without + prior arrangement or negotiation. However, extension frames that appear in the middle of + a header block are not permitted; these MUST be treated + as a connection error of type + PROTOCOL_ERROR. + + + However, extensions that could change the semantics of existing protocol components MUST + be negotiated before being used. For example, an extension that changes the layout of the + HEADERS frame cannot be used until the peer has given a positive signal + that this is acceptable. In this case, it could also be necessary to coordinate when the + revised layout comes into effect. Note that treating any frame other than + DATA frames as flow controlled is such a change in semantics, and can only + be done through negotiation. + + + This document doesn't mandate a specific method for negotiating the use of an extension, + but notes that a setting could be used for that + purpose. If both peers set a value that indicates willingness to use the extension, then + the extension can be used. If a setting is used for extension negotiation, the initial + value MUST be defined so that the extension is initially disabled. + +
+
+ +
+ + This specification defines a number of frame types, each identified by a unique 8-bit type + code. Each frame type serves a distinct purpose either in the establishment and management + of the connection as a whole, or of individual streams. + + + The transmission of specific frame types can alter the state of a connection. If endpoints + fail to maintain a synchronized view of the connection state, successful communication + within the connection will no longer be possible. Therefore, it is important that endpoints + have a shared comprehension of how the state is affected by the use any given frame. + + +
+ + DATA frames (type=0x0) convey arbitrary, variable-length sequences of octets associated + with a stream. One or more DATA frames are used, for instance, to carry HTTP request or + response payloads. + + + DATA frames MAY also contain arbitrary padding. Padding can be added to DATA frames to + obscure the size of messages. + +
+ +
+ + The DATA frame contains the following fields: + + + An 8-bit field containing the length of the frame padding in units of octets. This + field is optional and is only present if the PADDED flag is set. + + + Application data. The amount of data is the remainder of the frame payload after + subtracting the length of the other fields that are present. + + + Padding octets that contain no application semantic value. Padding octets MUST be set + to zero when sending and ignored when receiving. + + + + + + The DATA frame defines the following flags: + + + Bit 1 being set indicates that this frame is the last that the endpoint will send for + the identified stream. Setting this flag causes the stream to enter one of the "half closed" states or the "closed" state. + + + Bit 4 being set indicates that the Pad Length field and any padding that it describes + is present. + + + + + DATA frames MUST be associated with a stream. If a DATA frame is received whose stream + identifier field is 0x0, the recipient MUST respond with a connection error of type + PROTOCOL_ERROR. + + + DATA frames are subject to flow control and can only be sent when a stream is in the + "open" or "half closed (remote)" states. The entire DATA frame payload is included in flow + control, including Pad Length and Padding fields if present. If a DATA frame is received + whose stream is not in "open" or "half closed (local)" state, the recipient MUST respond + with a stream error of type + STREAM_CLOSED. + + + The total number of padding octets is determined by the value of the Pad Length field. If + the length of the padding is greater than the length of the frame payload, the recipient + MUST treat this as a connection error of + type PROTOCOL_ERROR. + + + A frame can be increased in size by one octet by including a Pad Length field with a + value of zero. + + + + + Padding is a security feature; see . + +
+ +
+ + The HEADERS frame (type=0x1) is used to open a stream, + and additionally carries a header block fragment. HEADERS frames can be sent on a stream + in the "open" or "half closed (remote)" states. + +
+ +
+ + The HEADERS frame payload has the following fields: + + + An 8-bit field containing the length of the frame padding in units of octets. This + field is only present if the PADDED flag is set. + + + A single bit flag indicates that the stream dependency is exclusive, see . This field is only present if the PRIORITY flag is set. + + + A 31-bit stream identifier for the stream that this stream depends on, see . This field is only present if the PRIORITY flag is set. + + + An 8-bit weight for the stream, see . Add one to the + value to obtain a weight between 1 and 256. This field is only present if the + PRIORITY flag is set. + + + A header block fragment. + + + Padding octets that contain no application semantic value. Padding octets MUST be set + to zero when sending and ignored when receiving. + + + + + + The HEADERS frame defines the following flags: + + + + Bit 1 being set indicates that the header block is + the last that the endpoint will send for the identified stream. Setting this flag + causes the stream to enter one of "half closed" + states. + + + A HEADERS frame carries the END_STREAM flag that signals the end of a stream. + However, a HEADERS frame with the END_STREAM flag set can be followed by + CONTINUATION frames on the same stream. Logically, the + CONTINUATION frames are part of the HEADERS frame. + + + + + Bit 3 being set indicates that this frame contains an entire header block and is not followed by any + CONTINUATION frames. + + + A HEADERS frame without the END_HEADERS flag set MUST be followed by a + CONTINUATION frame for the same stream. A receiver MUST treat the + receipt of any other type of frame or a frame on a different stream as a connection error of type + PROTOCOL_ERROR. + + + + + Bit 4 being set indicates that the Pad Length field and any padding that it + describes is present. + + + + + Bit 6 being set indicates that the Exclusive Flag (E), Stream Dependency, and Weight + fields are present; see . + + + + + + + The payload of a HEADERS frame contains a header block + fragment. A header block that does not fit within a HEADERS frame is continued in + a CONTINUATION frame. + + + + HEADERS frames MUST be associated with a stream. If a HEADERS frame is received whose + stream identifier field is 0x0, the recipient MUST respond with a connection error of type + PROTOCOL_ERROR. + + + + The HEADERS frame changes the connection state as described in . + + + + The HEADERS frame includes optional padding. Padding fields and flags are identical to + those defined for DATA frames. + + + Prioritization information in a HEADERS frame is logically equivalent to a separate + PRIORITY frame, but inclusion in HEADERS avoids the potential for churn in + stream prioritization when new streams are created. Priorization fields in HEADERS frames + subsequent to the first on a stream reprioritize the + stream. + +
+ +
+ + The PRIORITY frame (type=0x2) specifies the sender-advised + priority of a stream. It can be sent at any time for an existing stream, including + closed streams. This enables reprioritization of existing streams. + +
+ +
+ + The payload of a PRIORITY frame contains the following fields: + + + A single bit flag indicates that the stream dependency is exclusive, see . + + + A 31-bit stream identifier for the stream that this stream depends on, see . + + + An 8-bit weight for the identified stream dependency, see . Add one to the value to obtain a weight between 1 and 256. + + + + + + The PRIORITY frame does not define any flags. + + + + The PRIORITY frame is associated with an existing stream. If a PRIORITY frame is received + with a stream identifier of 0x0, the recipient MUST respond with a connection error of type + PROTOCOL_ERROR. + + + The PRIORITY frame can be sent on a stream in any of the "reserved (remote)", "open", + "half closed (local)", "half closed (remote)", or "closed" states, though it cannot be + sent between consecutive frames that comprise a single header + block. Note that this frame could arrive after processing or frame sending has + completed, which would cause it to have no effect on the current stream. For a stream + that is in the "half closed (remote)" or "closed" - state, this frame can only affect + processing of the current stream and not frame transmission. + + + The PRIORITY frame is the only frame that can be sent for a stream in the "closed" state. + This allows for the reprioritization of a group of dependent streams by altering the + priority of a parent stream, which might be closed. However, a PRIORITY frame sent on a + closed stream risks being ignored due to the peer having discarded priority state + information for that stream. + +
+ +
+ + The RST_STREAM frame (type=0x3) allows for abnormal termination of a stream. When sent by + the initiator of a stream, it indicates that they wish to cancel the stream or that an + error condition has occurred. When sent by the receiver of a stream, it indicates that + either the receiver is rejecting the stream, requesting that the stream be cancelled, or + that an error condition has occurred. + +
+ +
+ + + The RST_STREAM frame contains a single unsigned, 32-bit integer identifying the error code. The error code indicates why the stream is being + terminated. + + + + The RST_STREAM frame does not define any flags. + + + + The RST_STREAM frame fully terminates the referenced stream and causes it to enter the + closed state. After receiving a RST_STREAM on a stream, the receiver MUST NOT send + additional frames for that stream, with the exception of PRIORITY. However, + after sending the RST_STREAM, the sending endpoint MUST be prepared to receive and process + additional frames sent on the stream that might have been sent by the peer prior to the + arrival of the RST_STREAM. + + + + RST_STREAM frames MUST be associated with a stream. If a RST_STREAM frame is received + with a stream identifier of 0x0, the recipient MUST treat this as a connection error of type + PROTOCOL_ERROR. + + + + RST_STREAM frames MUST NOT be sent for a stream in the "idle" state. If a RST_STREAM + frame identifying an idle stream is received, the recipient MUST treat this as a connection error of type + PROTOCOL_ERROR. + + +
+ +
+ + The SETTINGS frame (type=0x4) conveys configuration parameters that affect how endpoints + communicate, such as preferences and constraints on peer behavior. The SETTINGS frame is + also used to acknowledge the receipt of those parameters. Individually, a SETTINGS + parameter can also be referred to as a "setting". + + + SETTINGS parameters are not negotiated; they describe characteristics of the sending peer, + which are used by the receiving peer. Different values for the same parameter can be + advertised by each peer. For example, a client might set a high initial flow control + window, whereas a server might set a lower value to conserve resources. + + + + A SETTINGS frame MUST be sent by both endpoints at the start of a connection, and MAY be + sent at any other time by either endpoint over the lifetime of the connection. + Implementations MUST support all of the parameters defined by this specification. + + + + Each parameter in a SETTINGS frame replaces any existing value for that parameter. + Parameters are processed in the order in which they appear, and a receiver of a SETTINGS + frame does not need to maintain any state other than the current value of its + parameters. Therefore, the value of a SETTINGS parameter is the last value that is seen by + a receiver. + + + SETTINGS parameters are acknowledged by the receiving peer. To enable this, the SETTINGS + frame defines the following flag: + + + Bit 1 being set indicates that this frame acknowledges receipt and application of the + peer's SETTINGS frame. When this bit is set, the payload of the SETTINGS frame MUST + be empty. Receipt of a SETTINGS frame with the ACK flag set and a length field value + other than 0 MUST be treated as a connection + error of type FRAME_SIZE_ERROR. For more info, see Settings Synchronization. + + + + + SETTINGS frames always apply to a connection, never a single stream. The stream + identifier for a SETTINGS frame MUST be zero (0x0). If an endpoint receives a SETTINGS + frame whose stream identifier field is anything other than 0x0, the endpoint MUST respond + with a connection error of type + PROTOCOL_ERROR. + + + The SETTINGS frame affects connection state. A badly formed or incomplete SETTINGS frame + MUST be treated as a connection error of type + PROTOCOL_ERROR. + + +
+ + The payload of a SETTINGS frame consists of zero or more parameters, each consisting of + an unsigned 16-bit setting identifier and an unsigned 32-bit value. + + +
+ +
+
+ +
+ + The following parameters are defined: + + + + Allows the sender to inform the remote endpoint of the maximum size of the header + compression table used to decode header blocks, in octets. The encoder can select + any size equal to or less than this value by using signaling specific to the + header compression format inside a header block. The initial value is 4,096 + octets. + + + + + This setting can be use to disable server + push. An endpoint MUST NOT send a PUSH_PROMISE frame if it + receives this parameter set to a value of 0. An endpoint that has both set this + parameter to 0 and had it acknowledged MUST treat the receipt of a + PUSH_PROMISE frame as a connection error of type + PROTOCOL_ERROR. + + + The initial value is 1, which indicates that server push is permitted. Any value + other than 0 or 1 MUST be treated as a connection error of type + PROTOCOL_ERROR. + + + + + Indicates the maximum number of concurrent streams that the sender will allow. + This limit is directional: it applies to the number of streams that the sender + permits the receiver to create. Initially there is no limit to this value. It is + recommended that this value be no smaller than 100, so as to not unnecessarily + limit parallelism. + + + A value of 0 for SETTINGS_MAX_CONCURRENT_STREAMS SHOULD NOT be treated as special + by endpoints. A zero value does prevent the creation of new streams, however this + can also happen for any limit that is exhausted with active streams. Servers + SHOULD only set a zero value for short durations; if a server does not wish to + accept requests, closing the connection could be preferable. + + + + + Indicates the sender's initial window size (in octets) for stream level flow + control. The initial value is 216-1 (65,535) octets. + + + This setting affects the window size of all streams, including existing streams, + see . + + + Values above the maximum flow control window size of 231-1 MUST + be treated as a connection error of + type FLOW_CONTROL_ERROR. + + + + + Indicates the size of the largest frame payload that the sender is willing to + receive, in octets. + + + The initial value is 214 (16,384) octets. The value advertised by + an endpoint MUST be between this initial value and the maximum allowed frame size + (224-1 or 16,777,215 octets), inclusive. Values outside this range + MUST be treated as a connection error + of type PROTOCOL_ERROR. + + + + + This advisory setting informs a peer of the maximum size of header list that the + sender is prepared to accept, in octets. The value is based on the uncompressed + size of header fields, including the length of the name and value in octets plus + an overhead of 32 octets for each header field. + + + For any given request, a lower limit than what is advertised MAY be enforced. The + initial value of this setting is unlimited. + + + + + + An endpoint that receives a SETTINGS frame with any unknown or unsupported identifier + MUST ignore that setting. + +
+ +
+ + Most values in SETTINGS benefit from or require an understanding of when the peer has + received and applied the changed parameter values. In order to provide + such synchronization timepoints, the recipient of a SETTINGS frame in which the ACK flag + is not set MUST apply the updated parameters as soon as possible upon receipt. + + + The values in the SETTINGS frame MUST be processed in the order they appear, with no + other frame processing between values. Unsupported parameters MUST be ignored. Once + all values have been processed, the recipient MUST immediately emit a SETTINGS frame + with the ACK flag set. Upon receiving a SETTINGS frame with the ACK flag set, the sender + of the altered parameters can rely on the setting having been applied. + + + If the sender of a SETTINGS frame does not receive an acknowledgement within a + reasonable amount of time, it MAY issue a connection error of type + SETTINGS_TIMEOUT. + +
+
+ +
+ + The PUSH_PROMISE frame (type=0x5) is used to notify the peer endpoint in advance of + streams the sender intends to initiate. The PUSH_PROMISE frame includes the unsigned + 31-bit identifier of the stream the endpoint plans to create along with a set of headers + that provide additional context for the stream. contains a + thorough description of the use of PUSH_PROMISE frames. + + +
+ +
+ + The PUSH_PROMISE frame payload has the following fields: + + + An 8-bit field containing the length of the frame padding in units of octets. This + field is only present if the PADDED flag is set. + + + A single reserved bit. + + + An unsigned 31-bit integer that identifies the stream that is reserved by the + PUSH_PROMISE. The promised stream identifier MUST be a valid choice for the next + stream sent by the sender (see new stream + identifier). + + + A header block fragment containing request header + fields. + + + Padding octets. + + + + + + The PUSH_PROMISE frame defines the following flags: + + + + Bit 3 being set indicates that this frame contains an entire header block and is not followed by any + CONTINUATION frames. + + + A PUSH_PROMISE frame without the END_HEADERS flag set MUST be followed by a + CONTINUATION frame for the same stream. A receiver MUST treat the receipt of any + other type of frame or a frame on a different stream as a connection error of type + PROTOCOL_ERROR. + + + + + Bit 4 being set indicates that the Pad Length field and any padding that it + describes is present. + + + + + + + PUSH_PROMISE frames MUST be associated with an existing, peer-initiated stream. The stream + identifier of a PUSH_PROMISE frame indicates the stream it is associated with. If the + stream identifier field specifies the value 0x0, a recipient MUST respond with a connection error of type + PROTOCOL_ERROR. + + + + Promised streams are not required to be used in the order they are promised. The + PUSH_PROMISE only reserves stream identifiers for later use. + + + + PUSH_PROMISE MUST NOT be sent if the SETTINGS_ENABLE_PUSH setting of the + peer endpoint is set to 0. An endpoint that has set this setting and has received + acknowledgement MUST treat the receipt of a PUSH_PROMISE frame as a connection error of type + PROTOCOL_ERROR. + + + Recipients of PUSH_PROMISE frames can choose to reject promised streams by returning a + RST_STREAM referencing the promised stream identifier back to the sender of + the PUSH_PROMISE. + + + + A PUSH_PROMISE frame modifies the connection state in two ways. The inclusion of a header block potentially modifies the state maintained for + header compression. PUSH_PROMISE also reserves a stream for later use, causing the + promised stream to enter the "reserved" state. A sender MUST NOT send a PUSH_PROMISE on a + stream unless that stream is either "open" or "half closed (remote)"; the sender MUST + ensure that the promised stream is a valid choice for a new stream identifier (that is, the promised stream MUST + be in the "idle" state). + + + Since PUSH_PROMISE reserves a stream, ignoring a PUSH_PROMISE frame causes the stream + state to become indeterminate. A receiver MUST treat the receipt of a PUSH_PROMISE on a + stream that is neither "open" nor "half closed (local)" as a connection error of type + PROTOCOL_ERROR. However, an endpoint that has sent + RST_STREAM on the associated stream MUST handle PUSH_PROMISE frames that + might have been created before the RST_STREAM frame is received and + processed. + + + A receiver MUST treat the receipt of a PUSH_PROMISE that promises an illegal stream identifier (that is, an identifier for a + stream that is not currently in the "idle" state) as a connection error of type + PROTOCOL_ERROR. + + + + The PUSH_PROMISE frame includes optional padding. Padding fields and flags are identical + to those defined for DATA frames. + +
+ +
+ + The PING frame (type=0x6) is a mechanism for measuring a minimal round trip time from the + sender, as well as determining whether an idle connection is still functional. PING + frames can be sent from any endpoint. + +
+ +
+ + + In addition to the frame header, PING frames MUST contain 8 octets of data in the payload. + A sender can include any value it chooses and use those bytes in any fashion. + + + Receivers of a PING frame that does not include an ACK flag MUST send a PING frame with + the ACK flag set in response, with an identical payload. PING responses SHOULD be given + higher priority than any other frame. + + + + The PING frame defines the following flags: + + + Bit 1 being set indicates that this PING frame is a PING response. An endpoint MUST + set this flag in PING responses. An endpoint MUST NOT respond to PING frames + containing this flag. + + + + + PING frames are not associated with any individual stream. If a PING frame is received + with a stream identifier field value other than 0x0, the recipient MUST respond with a + connection error of type + PROTOCOL_ERROR. + + + Receipt of a PING frame with a length field value other than 8 MUST be treated as a connection error of type + FRAME_SIZE_ERROR. + + +
+ +
+ + The GOAWAY frame (type=0x7) informs the remote peer to stop creating streams on this + connection. GOAWAY can be sent by either the client or the server. Once sent, the sender + will ignore frames sent on any new streams with identifiers higher than the included last + stream identifier. Receivers of a GOAWAY frame MUST NOT open additional streams on the + connection, although a new connection can be established for new streams. + + + The purpose of this frame is to allow an endpoint to gracefully stop accepting new + streams, while still finishing processing of previously established streams. This enables + administrative actions, like server maintainance. + + + There is an inherent race condition between an endpoint starting new streams and the + remote sending a GOAWAY frame. To deal with this case, the GOAWAY contains the stream + identifier of the last peer-initiated stream which was or might be processed on the + sending endpoint in this connection. For instance, if the server sends a GOAWAY frame, + the identified stream is the highest numbered stream initiated by the client. + + + If the receiver of the GOAWAY has sent data on streams with a higher stream identifier + than what is indicated in the GOAWAY frame, those streams are not or will not be + processed. The receiver of the GOAWAY frame can treat the streams as though they had + never been created at all, thereby allowing those streams to be retried later on a new + connection. + + + Endpoints SHOULD always send a GOAWAY frame before closing a connection so that the remote + can know whether a stream has been partially processed or not. For example, if an HTTP + client sends a POST at the same time that a server closes a connection, the client cannot + know if the server started to process that POST request if the server does not send a + GOAWAY frame to indicate what streams it might have acted on. + + + An endpoint might choose to close a connection without sending GOAWAY for misbehaving + peers. + + +
+ +
+ + The GOAWAY frame does not define any flags. + + + The GOAWAY frame applies to the connection, not a specific stream. An endpoint MUST treat + a GOAWAY frame with a stream identifier other than 0x0 as a connection error of type + PROTOCOL_ERROR. + + + The last stream identifier in the GOAWAY frame contains the highest numbered stream + identifier for which the sender of the GOAWAY frame might have taken some action on, or + might yet take action on. All streams up to and including the identified stream might + have been processed in some way. The last stream identifier can be set to 0 if no streams + were processed. + + + In this context, "processed" means that some data from the stream was passed to some + higher layer of software that might have taken some action as a result. + + + If a connection terminates without a GOAWAY frame, the last stream identifier is + effectively the highest possible stream identifier. + + + On streams with lower or equal numbered identifiers that were not closed completely prior + to the connection being closed, re-attempting requests, transactions, or any protocol + activity is not possible, with the exception of idempotent actions like HTTP GET, PUT, or + DELETE. Any protocol activity that uses higher numbered streams can be safely retried + using a new connection. + + + Activity on streams numbered lower or equal to the last stream identifier might still + complete successfully. The sender of a GOAWAY frame might gracefully shut down a + connection by sending a GOAWAY frame, maintaining the connection in an open state until + all in-progress streams complete. + + + An endpoint MAY send multiple GOAWAY frames if circumstances change. For instance, an + endpoint that sends GOAWAY with NO_ERROR during graceful shutdown could + subsequently encounter an condition that requires immediate termination of the connection. + The last stream identifier from the last GOAWAY frame received indicates which streams + could have been acted upon. Endpoints MUST NOT increase the value they send in the last + stream identifier, since the peers might already have retried unprocessed requests on + another connection. + + + A client that is unable to retry requests loses all requests that are in flight when the + server closes the connection. This is especially true for intermediaries that might + not be serving clients using HTTP/2. A server that is attempting to gracefully shut down + a connection SHOULD send an initial GOAWAY frame with the last stream identifier set to + 231-1 and a NO_ERROR code. This signals to the client that + a shutdown is imminent and that no further requests can be initiated. After waiting at + least one round trip time, the server can send another GOAWAY frame with an updated last + stream identifier. This ensures that a connection can be cleanly shut down without losing + requests. + + + + After sending a GOAWAY frame, the sender can discard frames for streams with identifiers + higher than the identified last stream. However, any frames that alter connection state + cannot be completely ignored. For instance, HEADERS, + PUSH_PROMISE and CONTINUATION frames MUST be minimally + processed to ensure the state maintained for header compression is consistent (see ); similarly DATA frames MUST be counted toward the connection flow + control window. Failure to process these frames can cause flow control or header + compression state to become unsynchronized. + + + + The GOAWAY frame also contains a 32-bit error code that + contains the reason for closing the connection. + + + Endpoints MAY append opaque data to the payload of any GOAWAY frame. Additional debug + data is intended for diagnostic purposes only and carries no semantic value. Debug + information could contain security- or privacy-sensitive data. Logged or otherwise + persistently stored debug data MUST have adequate safeguards to prevent unauthorized + access. + +
+ +
+ + The WINDOW_UPDATE frame (type=0x8) is used to implement flow control; see for an overview. + + + Flow control operates at two levels: on each individual stream and on the entire + connection. + + + Both types of flow control are hop-by-hop; that is, only between the two endpoints. + Intermediaries do not forward WINDOW_UPDATE frames between dependent connections. + However, throttling of data transfer by any receiver can indirectly cause the propagation + of flow control information toward the original sender. + + + Flow control only applies to frames that are identified as being subject to flow control. + Of the frame types defined in this document, this includes only DATA frames. + Frames that are exempt from flow control MUST be accepted and processed, unless the + receiver is unable to assign resources to handling the frame. A receiver MAY respond with + a stream error or connection error of type + FLOW_CONTROL_ERROR if it is unable to accept a frame. + +
+ +
+ + The payload of a WINDOW_UPDATE frame is one reserved bit, plus an unsigned 31-bit integer + indicating the number of octets that the sender can transmit in addition to the existing + flow control window. The legal range for the increment to the flow control window is 1 to + 231-1 (0x7fffffff) octets. + + + The WINDOW_UPDATE frame does not define any flags. + + + The WINDOW_UPDATE frame can be specific to a stream or to the entire connection. In the + former case, the frame's stream identifier indicates the affected stream; in the latter, + the value "0" indicates that the entire connection is the subject of the frame. + + + A receiver MUST treat the receipt of a WINDOW_UPDATE frame with an flow control window + increment of 0 as a stream error of type + PROTOCOL_ERROR; errors on the connection flow control window MUST be + treated as a connection error. + + + WINDOW_UPDATE can be sent by a peer that has sent a frame bearing the END_STREAM flag. + This means that a receiver could receive a WINDOW_UPDATE frame on a "half closed (remote)" + or "closed" stream. A receiver MUST NOT treat this as an error, see . + + + A receiver that receives a flow controlled frame MUST always account for its contribution + against the connection flow control window, unless the receiver treats this as a connection error. This is necessary even if the + frame is in error. Since the sender counts the frame toward the flow control window, if + the receiver does not, the flow control window at sender and receiver can become + different. + + +
+ + Flow control in HTTP/2 is implemented using a window kept by each sender on every + stream. The flow control window is a simple integer value that indicates how many octets + of data the sender is permitted to transmit; as such, its size is a measure of the + buffering capacity of the receiver. + + + Two flow control windows are applicable: the stream flow control window and the + connection flow control window. The sender MUST NOT send a flow controlled frame with a + length that exceeds the space available in either of the flow control windows advertised + by the receiver. Frames with zero length with the END_STREAM flag set (that is, an + empty DATA frame) MAY be sent if there is no available space in either + flow control window. + + + For flow control calculations, the 9 octet frame header is not counted. + + + After sending a flow controlled frame, the sender reduces the space available in both + windows by the length of the transmitted frame. + + + The receiver of a frame sends a WINDOW_UPDATE frame as it consumes data and frees up + space in flow control windows. Separate WINDOW_UPDATE frames are sent for the stream + and connection level flow control windows. + + + A sender that receives a WINDOW_UPDATE frame updates the corresponding window by the + amount specified in the frame. + + + A sender MUST NOT allow a flow control window to exceed 231-1 octets. + If a sender receives a WINDOW_UPDATE that causes a flow control window to exceed this + maximum it MUST terminate either the stream or the connection, as appropriate. For + streams, the sender sends a RST_STREAM with the error code of + FLOW_CONTROL_ERROR code; for the connection, a GOAWAY + frame with a FLOW_CONTROL_ERROR code. + + + Flow controlled frames from the sender and WINDOW_UPDATE frames from the receiver are + completely asynchronous with respect to each other. This property allows a receiver to + aggressively update the window size kept by the sender to prevent streams from stalling. + +
+ +
+ + When an HTTP/2 connection is first established, new streams are created with an initial + flow control window size of 65,535 octets. The connection flow control window is 65,535 + octets. Both endpoints can adjust the initial window size for new streams by including + a value for SETTINGS_INITIAL_WINDOW_SIZE in the SETTINGS + frame that forms part of the connection preface. The connection flow control window can + only be changed using WINDOW_UPDATE frames. + + + Prior to receiving a SETTINGS frame that sets a value for + SETTINGS_INITIAL_WINDOW_SIZE, an endpoint can only use the default + initial window size when sending flow controlled frames. Similarly, the connection flow + control window is set to the default initial window size until a WINDOW_UPDATE frame is + received. + + + A SETTINGS frame can alter the initial flow control window size for all + current streams. When the value of SETTINGS_INITIAL_WINDOW_SIZE changes, + a receiver MUST adjust the size of all stream flow control windows that it maintains by + the difference between the new value and the old value. + + + A change to SETTINGS_INITIAL_WINDOW_SIZE can cause the available space in + a flow control window to become negative. A sender MUST track the negative flow control + window, and MUST NOT send new flow controlled frames until it receives WINDOW_UPDATE + frames that cause the flow control window to become positive. + + + For example, if the client sends 60KB immediately on connection establishment, and the + server sets the initial window size to be 16KB, the client will recalculate the + available flow control window to be -44KB on receipt of the SETTINGS + frame. The client retains a negative flow control window until WINDOW_UPDATE frames + restore the window to being positive, after which the client can resume sending. + + + A SETTINGS frame cannot alter the connection flow control window. + + + An endpoint MUST treat a change to SETTINGS_INITIAL_WINDOW_SIZE that + causes any flow control window to exceed the maximum size as a connection error of type + FLOW_CONTROL_ERROR. + +
+ +
+ + A receiver that wishes to use a smaller flow control window than the current size can + send a new SETTINGS frame. However, the receiver MUST be prepared to + receive data that exceeds this window size, since the sender might send data that + exceeds the lower limit prior to processing the SETTINGS frame. + + + After sending a SETTINGS frame that reduces the initial flow control window size, a + receiver has two options for handling streams that exceed flow control limits: + + + The receiver can immediately send RST_STREAM with + FLOW_CONTROL_ERROR error code for the affected streams. + + + The receiver can accept the streams and tolerate the resulting head of line + blocking, sending WINDOW_UPDATE frames as it consumes data. + + + +
+
+ +
+ + The CONTINUATION frame (type=0x9) is used to continue a sequence of header block fragments. Any number of CONTINUATION frames can + be sent on an existing stream, as long as the preceding frame is on the same stream and is + a HEADERS, PUSH_PROMISE or CONTINUATION frame without the + END_HEADERS flag set. + + +
+ +
+ + The CONTINUATION frame payload contains a header block + fragment. + + + + The CONTINUATION frame defines the following flag: + + + + Bit 3 being set indicates that this frame ends a header + block. + + + If the END_HEADERS bit is not set, this frame MUST be followed by another + CONTINUATION frame. A receiver MUST treat the receipt of any other type of frame or + a frame on a different stream as a connection + error of type PROTOCOL_ERROR. + + + + + + + The CONTINUATION frame changes the connection state as defined in . + + + + CONTINUATION frames MUST be associated with a stream. If a CONTINUATION frame is received + whose stream identifier field is 0x0, the recipient MUST respond with a connection error of type PROTOCOL_ERROR. + + + + A CONTINUATION frame MUST be preceded by a HEADERS, + PUSH_PROMISE or CONTINUATION frame without the END_HEADERS flag set. A + recipient that observes violation of this rule MUST respond with a connection error of type + PROTOCOL_ERROR. + +
+
+ +
+ + Error codes are 32-bit fields that are used in RST_STREAM and + GOAWAY frames to convey the reasons for the stream or connection error. + + + + Error codes share a common code space. Some error codes apply only to either streams or the + entire connection and have no defined semantics in the other context. + + + + The following error codes are defined: + + + The associated condition is not as a result of an error. For example, a + GOAWAY might include this code to indicate graceful shutdown of a + connection. + + + The endpoint detected an unspecific protocol error. This error is for use when a more + specific error code is not available. + + + The endpoint encountered an unexpected internal error. + + + The endpoint detected that its peer violated the flow control protocol. + + + The endpoint sent a SETTINGS frame, but did not receive a response in a + timely manner. See Settings Synchronization. + + + The endpoint received a frame after a stream was half closed. + + + The endpoint received a frame with an invalid size. + + + The endpoint refuses the stream prior to performing any application processing, see + for details. + + + Used by the endpoint to indicate that the stream is no longer needed. + + + The endpoint is unable to maintain the header compression context for the connection. + + + The connection established in response to a CONNECT + request was reset or abnormally closed. + + + The endpoint detected that its peer is exhibiting a behavior that might be generating + excessive load. + + + The underlying transport has properties that do not meet minimum security + requirements (see ). + + + + + Unknown or unsupported error codes MUST NOT trigger any special behavior. These MAY be + treated by an implementation as being equivalent to INTERNAL_ERROR. + +
+ +
+ + HTTP/2 is intended to be as compatible as possible with current uses of HTTP. This means + that, from the application perspective, the features of the protocol are largely + unchanged. To achieve this, all request and response semantics are preserved, although the + syntax of conveying those semantics has changed. + + + Thus, the specification and requirements of HTTP/1.1 Semantics and Content , Conditional Requests , Range Requests , Caching and Authentication are applicable to HTTP/2. Selected portions of HTTP/1.1 Message Syntax + and Routing , such as the HTTP and HTTPS URI schemes, are also + applicable in HTTP/2, but the expression of those semantics for this protocol are defined + in the sections below. + + +
+ + A client sends an HTTP request on a new stream, using a previously unused stream identifier. A server sends an HTTP response on + the same stream as the request. + + + An HTTP message (request or response) consists of: + + + for a response only, zero or more HEADERS frames (each followed by zero + or more CONTINUATION frames) containing the message headers of + informational (1xx) HTTP responses (see and ), + and + + + one HEADERS frame (followed by zero or more CONTINUATION + frames) containing the message headers (see ), and + + + zero or more DATA frames containing the message payload (see ), and + + + optionally, one HEADERS frame, followed by zero or more + CONTINUATION frames containing the trailer-part, if present (see ). + + + The last frame in the sequence bears an END_STREAM flag, noting that a + HEADERS frame bearing the END_STREAM flag can be followed by + CONTINUATION frames that carry any remaining portions of the header block. + + + Other frames (from any stream) MUST NOT occur between either HEADERS frame + and any CONTINUATION frames that might follow. + + + + Trailing header fields are carried in a header block that also terminates the stream. + That is, a sequence starting with a HEADERS frame, followed by zero or more + CONTINUATION frames, where the HEADERS frame bears an + END_STREAM flag. Header blocks after the first that do not terminate the stream are not + part of an HTTP request or response. + + + A HEADERS frame (and associated CONTINUATION frames) can + only appear at the start or end of a stream. An endpoint that receives a + HEADERS frame without the END_STREAM flag set after receiving a final + (non-informational) status code MUST treat the corresponding request or response as malformed. + + + + An HTTP request/response exchange fully consumes a single stream. A request starts with + the HEADERS frame that puts the stream into an "open" state. The request + ends with a frame bearing END_STREAM, which causes the stream to become "half closed + (local)" for the client and "half closed (remote)" for the server. A response starts with + a HEADERS frame and ends with a frame bearing END_STREAM, which places the + stream in the "closed" state. + + + +
+ + HTTP/2 removes support for the 101 (Switching Protocols) informational status code + (). + + + The semantics of 101 (Switching Protocols) aren't applicable to a multiplexed protocol. + Alternative protocols are able to use the same mechanisms that HTTP/2 uses to negotiate + their use (see ). + +
+ +
+ + HTTP header fields carry information as a series of key-value pairs. For a listing of + registered HTTP headers, see the Message Header Field Registry maintained at . + + +
+ + While HTTP/1.x used the message start-line (see ) to convey the target URI and method of the request, and the + status code for the response, HTTP/2 uses special pseudo-header fields beginning with + ':' character (ASCII 0x3a) for this purpose. + + + Pseudo-header fields are not HTTP header fields. Endpoints MUST NOT generate + pseudo-header fields other than those defined in this document. + + + Pseudo-header fields are only valid in the context in which they are defined. + Pseudo-header fields defined for requests MUST NOT appear in responses; pseudo-header + fields defined for responses MUST NOT appear in requests. Pseudo-header fields MUST + NOT appear in trailers. Endpoints MUST treat a request or response that contains + undefined or invalid pseudo-header fields as malformed. + + + Just as in HTTP/1.x, header field names are strings of ASCII characters that are + compared in a case-insensitive fashion. However, header field names MUST be converted + to lowercase prior to their encoding in HTTP/2. A request or response containing + uppercase header field names MUST be treated as malformed. + + + All pseudo-header fields MUST appear in the header block before regular header fields. + Any request or response that contains a pseudo-header field that appears in a header + block after a regular header field MUST be treated as malformed. + +
+ +
+ + HTTP/2 does not use the Connection header field to + indicate connection-specific header fields; in this protocol, connection-specific + metadata is conveyed by other means. An endpoint MUST NOT generate a HTTP/2 message + containing connection-specific header fields; any message containing + connection-specific header fields MUST be treated as malformed. + + + This means that an intermediary transforming an HTTP/1.x message to HTTP/2 will need + to remove any header fields nominated by the Connection header field, along with the + Connection header field itself. Such intermediaries SHOULD also remove other + connection-specific header fields, such as Keep-Alive, Proxy-Connection, + Transfer-Encoding and Upgrade, even if they are not nominated by Connection. + + + One exception to this is the TE header field, which MAY be present in an HTTP/2 + request, but when it is MUST NOT contain any value other than "trailers". + + + + + HTTP/2 purposefully does not support upgrade to another protocol. The handshake + methods described in are believed sufficient to + negotiate the use of alternative protocols. + + + +
+ +
+ + The following pseudo-header fields are defined for HTTP/2 requests: + + + + The :method pseudo-header field includes the HTTP + method (). + + + + + The :scheme pseudo-header field includes the scheme + portion of the target URI (). + + + :scheme is not restricted to http and https schemed URIs. A + proxy or gateway can translate requests for non-HTTP schemes, enabling the use + of HTTP to interact with non-HTTP services. + + + + + The :authority pseudo-header field includes the + authority portion of the target URI (). The authority MUST NOT include the deprecated userinfo subcomponent for http + or https schemed URIs. + + + To ensure that the HTTP/1.1 request line can be reproduced accurately, this + pseudo-header field MUST be omitted when translating from an HTTP/1.1 request + that has a request target in origin or asterisk form (see ). Clients that generate + HTTP/2 requests directly SHOULD use the :authority pseudo-header + field instead of the Host header field. An + intermediary that converts an HTTP/2 request to HTTP/1.1 MUST create a Host header field if one is not present in a request by + copying the value of the :authority pseudo-header + field. + + + + + The :path pseudo-header field includes the path and + query parts of the target URI (the path-absolute + production from and optionally a '?' character + followed by the query production, see and ). A request in asterisk form includes the value '*' for the + :path pseudo-header field. + + + This pseudo-header field MUST NOT be empty for http + or https URIs; http or + https URIs that do not contain a path component + MUST include a value of '/'. The exception to this rule is an OPTIONS request + for an http or https + URI that does not include a path component; these MUST include a :path pseudo-header field with a value of '*' (see ). + + + + + + All HTTP/2 requests MUST include exactly one valid value for the :method, :scheme, and :path pseudo-header fields, unless it is a CONNECT request. An HTTP request that omits mandatory + pseudo-header fields is malformed. + + + HTTP/2 does not define a way to carry the version identifier that is included in the + HTTP/1.1 request line. + +
+ +
+ + For HTTP/2 responses, a single :status pseudo-header + field is defined that carries the HTTP status code field (see ). This pseudo-header field MUST be included in all + responses, otherwise the response is malformed. + + + HTTP/2 does not define a way to carry the version or reason phrase that is included in + an HTTP/1.1 status line. + +
+ +
+ + The Cookie header field can carry a significant amount of + redundant data. + + + The Cookie header field uses a semi-colon (";") to delimit cookie-pairs (or "crumbs"). + This header field doesn't follow the list construction rules in HTTP (see ), which prevents cookie-pairs from + being separated into different name-value pairs. This can significantly reduce + compression efficiency as individual cookie-pairs are updated. + + + To allow for better compression efficiency, the Cookie header field MAY be split into + separate header fields, each with one or more cookie-pairs. If there are multiple + Cookie header fields after decompression, these MUST be concatenated into a single + octet string using the two octet delimiter of 0x3B, 0x20 (the ASCII string "; ") + before being passed into a non-HTTP/2 context, such as an HTTP/1.1 connection, or a + generic HTTP server application. + +
+ + Therefore, the following two lists of Cookie header fields are semantically + equivalent. + + +
+
+ +
+ + A malformed request or response is one that is an otherwise valid sequence of HTTP/2 + frames, but is otherwise invalid due to the presence of extraneous frames, prohibited + header fields, the absence of mandatory header fields, or the inclusion of uppercase + header field names. + + + A request or response that includes an entity body can include a content-length header field. A request or response is also + malformed if the value of a content-length header field + does not equal the sum of the DATA frame payload lengths that form the + body. A response that is defined to have no payload, as described in , can have a non-zero + content-length header field, even though no content is + included in DATA frames. + + + Intermediaries that process HTTP requests or responses (i.e., any intermediary not + acting as a tunnel) MUST NOT forward a malformed request or response. Malformed + requests or responses that are detected MUST be treated as a stream error of type PROTOCOL_ERROR. + + + For malformed requests, a server MAY send an HTTP response prior to closing or + resetting the stream. Clients MUST NOT accept a malformed response. Note that these + requirements are intended to protect against several types of common attacks against + HTTP; they are deliberately strict, because being permissive can expose + implementations to these vulnerabilities. + +
+
+ +
+ + This section shows HTTP/1.1 requests and responses, with illustrations of equivalent + HTTP/2 requests and responses. + + + An HTTP GET request includes request header fields and no body and is therefore + transmitted as a single HEADERS frame, followed by zero or more + CONTINUATION frames containing the serialized block of request header + fields. The HEADERS frame in the following has both the END_HEADERS and + END_STREAM flags set; no CONTINUATION frames are sent: + + +
+ + END_STREAM + Accept: image/jpeg + END_HEADERS + :method = GET + :scheme = https + :path = /resource + host = example.org + accept = image/jpeg +]]> +
+ + + Similarly, a response that includes only response header fields is transmitted as a + HEADERS frame (again, followed by zero or more + CONTINUATION frames) containing the serialized block of response header + fields. + + +
+ + END_STREAM + Expires: Thu, 23 Jan ... + END_HEADERS + :status = 304 + etag = "xyzzy" + expires = Thu, 23 Jan ... +]]> +
+ + + An HTTP POST request that includes request header fields and payload data is transmitted + as one HEADERS frame, followed by zero or more + CONTINUATION frames containing the request header fields, followed by one + or more DATA frames, with the last CONTINUATION (or + HEADERS) frame having the END_HEADERS flag set and the final + DATA frame having the END_STREAM flag set: + + +
+ - END_STREAM + Content-Type: image/jpeg - END_HEADERS + Content-Length: 123 :method = POST + :path = /resource + {binary data} :scheme = https + + CONTINUATION + + END_HEADERS + content-type = image/jpeg + host = example.org + content-length = 123 + + DATA + + END_STREAM + {binary data} +]]> + + Note that data contributing to any given header field could be spread between header + block fragments. The allocation of header fields to frames in this example is + illustrative only. + +
+ + + A response that includes header fields and payload data is transmitted as a + HEADERS frame, followed by zero or more CONTINUATION + frames, followed by one or more DATA frames, with the last + DATA frame in the sequence having the END_STREAM flag set: + + +
+ - END_STREAM + Content-Length: 123 + END_HEADERS + :status = 200 + {binary data} content-type = image/jpeg + content-length = 123 + + DATA + + END_STREAM + {binary data} +]]> +
+ + + Trailing header fields are sent as a header block after both the request or response + header block and all the DATA frames have been sent. The + HEADERS frame starting the trailers header block has the END_STREAM flag + set. + + +
+ - END_STREAM + Transfer-Encoding: chunked + END_HEADERS + Trailer: Foo :status = 200 + content-length = 123 + 123 content-type = image/jpeg + {binary data} trailer = Foo + 0 + Foo: bar DATA + - END_STREAM + {binary data} + + HEADERS + + END_STREAM + + END_HEADERS + foo = bar +]]> +
+ + +
+ + An informational response using a 1xx status code other than 101 is transmitted as a + HEADERS frame, followed by zero or more CONTINUATION + frames: + + - END_STREAM + + END_HEADERS + :status = 103 + extension-field = bar +]]> +
+
+ +
+ + In HTTP/1.1, an HTTP client is unable to retry a non-idempotent request when an error + occurs, because there is no means to determine the nature of the error. It is possible + that some server processing occurred prior to the error, which could result in + undesirable effects if the request were reattempted. + + + HTTP/2 provides two mechanisms for providing a guarantee to a client that a request has + not been processed: + + + The GOAWAY frame indicates the highest stream number that might have + been processed. Requests on streams with higher numbers are therefore guaranteed to + be safe to retry. + + + The REFUSED_STREAM error code can be included in a + RST_STREAM frame to indicate that the stream is being closed prior to + any processing having occurred. Any request that was sent on the reset stream can + be safely retried. + + + + + Requests that have not been processed have not failed; clients MAY automatically retry + them, even those with non-idempotent methods. + + + A server MUST NOT indicate that a stream has not been processed unless it can guarantee + that fact. If frames that are on a stream are passed to the application layer for any + stream, then REFUSED_STREAM MUST NOT be used for that stream, and a + GOAWAY frame MUST include a stream identifier that is greater than or + equal to the given stream identifier. + + + In addition to these mechanisms, the PING frame provides a way for a + client to easily test a connection. Connections that remain idle can become broken as + some middleboxes (for instance, network address translators, or load balancers) silently + discard connection bindings. The PING frame allows a client to safely + test whether a connection is still active without sending a request. + +
+
+ +
+ + HTTP/2 allows a server to pre-emptively send (or "push") responses (along with + corresponding "promised" requests) to a client in association with a previous + client-initiated request. This can be useful when the server knows the client will need + to have those responses available in order to fully process the response to the original + request. + + + + Pushing additional message exchanges in this fashion is optional, and is negotiated + between individual endpoints. The SETTINGS_ENABLE_PUSH setting can be set + to 0 to indicate that server push is disabled. + + + Promised requests MUST be cacheable (see ), MUST be safe (see ) and MUST NOT include a request body. Clients that receive a + promised request that is not cacheable, unsafe or that includes a request body MUST + reset the stream with a stream error of type + PROTOCOL_ERROR. + + + Pushed responses that are cacheable (see ) can be stored by the client, if it implements a HTTP + cache. Pushed responses are considered successfully validated on the origin server (e.g., + if the "no-cache" cache response directive is present) while the stream identified by the + promised stream ID is still open. + + + Pushed responses that are not cacheable MUST NOT be stored by any HTTP cache. They MAY + be made available to the application separately. + + + An intermediary can receive pushes from the server and choose not to forward them on to + the client. In other words, how to make use of the pushed information is up to that + intermediary. Equally, the intermediary might choose to make additional pushes to the + client, without any action taken by the server. + + + A client cannot push. Thus, servers MUST treat the receipt of a + PUSH_PROMISE frame as a connection + error of type PROTOCOL_ERROR. Clients MUST reject any attempt to + change the SETTINGS_ENABLE_PUSH setting to a value other than 0 by treating + the message as a connection error of type + PROTOCOL_ERROR. + + +
+ + Server push is semantically equivalent to a server responding to a request; however, in + this case that request is also sent by the server, as a PUSH_PROMISE + frame. + + + The PUSH_PROMISE frame includes a header block that contains a complete + set of request header fields that the server attributes to the request. It is not + possible to push a response to a request that includes a request body. + + + + Pushed responses are always associated with an explicit request from the client. The + PUSH_PROMISE frames sent by the server are sent on that explicit + request's stream. The PUSH_PROMISE frame also includes a promised stream + identifier, chosen from the stream identifiers available to the server (see ). + + + + The header fields in PUSH_PROMISE and any subsequent + CONTINUATION frames MUST be a valid and complete set of request header fields. The server MUST include a method in + the :method header field that is safe and cacheable. If a + client receives a PUSH_PROMISE that does not include a complete and valid + set of header fields, or the :method header field identifies + a method that is not safe, it MUST respond with a stream error of type PROTOCOL_ERROR. + + + + The server SHOULD send PUSH_PROMISE () + frames prior to sending any frames that reference the promised responses. This avoids a + race where clients issue requests prior to receiving any PUSH_PROMISE + frames. + + + For example, if the server receives a request for a document containing embedded links + to multiple image files, and the server chooses to push those additional images to the + client, sending push promises before the DATA frames that contain the + image links ensures that the client is able to see the promises before discovering + embedded links. Similarly, if the server pushes responses referenced by the header block + (for instance, in Link header fields), sending the push promises before sending the + header block ensures that clients do not request them. + + + + PUSH_PROMISE frames MUST NOT be sent by the client. + + + PUSH_PROMISE frames can be sent by the server in response to any + client-initiated stream, but the stream MUST be in either the "open" or "half closed + (remote)" state with respect to the server. PUSH_PROMISE frames are + interspersed with the frames that comprise a response, though they cannot be + interspersed with HEADERS and CONTINUATION frames that + comprise a single header block. + + + Sending a PUSH_PROMISE frame creates a new stream and puts the stream + into the “reserved (local)” state for the server and the “reserved (remote)” state for + the client. + +
+ +
+ + After sending the PUSH_PROMISE frame, the server can begin delivering the + pushed response as a response on a server-initiated + stream that uses the promised stream identifier. The server uses this stream to + transmit an HTTP response, using the same sequence of frames as defined in . This stream becomes "half closed" + to the client after the initial HEADERS frame is sent. + + + + Once a client receives a PUSH_PROMISE frame and chooses to accept the + pushed response, the client SHOULD NOT issue any requests for the promised response + until after the promised stream has closed. + + + + If the client determines, for any reason, that it does not wish to receive the pushed + response from the server, or if the server takes too long to begin sending the promised + response, the client can send an RST_STREAM frame, using either the + CANCEL or REFUSED_STREAM codes, and referencing the pushed + stream's identifier. + + + A client can use the SETTINGS_MAX_CONCURRENT_STREAMS setting to limit the + number of responses that can be concurrently pushed by a server. Advertising a + SETTINGS_MAX_CONCURRENT_STREAMS value of zero disables server push by + preventing the server from creating the necessary streams. This does not prohibit a + server from sending PUSH_PROMISE frames; clients need to reset any + promised streams that are not wanted. + + + + Clients receiving a pushed response MUST validate that either the server is + authoritative (see ), or the proxy that provided the pushed + response is configured for the corresponding request. For example, a server that offers + a certificate for only the example.com DNS-ID or Common Name + is not permitted to push a response for https://www.example.org/doc. + + + The response for a PUSH_PROMISE stream begins with a + HEADERS frame, which immediately puts the stream into the “half closed + (remote)” state for the server and “half closed (local)” state for the client, and ends + with a frame bearing END_STREAM, which places the stream in the "closed" state. + + + The client never sends a frame with the END_STREAM flag for a server push. + + + +
+ +
+ +
+ + In HTTP/1.x, the pseudo-method CONNECT () is used to convert an HTTP connection into a tunnel to a remote host. + CONNECT is primarily used with HTTP proxies to establish a TLS session with an origin + server for the purposes of interacting with https resources. + + + In HTTP/2, the CONNECT method is used to establish a tunnel over a single HTTP/2 stream to + a remote host, for similar purposes. The HTTP header field mapping works as defined in + Request Header Fields, with a few + differences. Specifically: + + + The :method header field is set to CONNECT. + + + The :scheme and :path header + fields MUST be omitted. + + + The :authority header field contains the host and port to + connect to (equivalent to the authority-form of the request-target of CONNECT + requests, see ). + + + + + A proxy that supports CONNECT establishes a TCP connection to + the server identified in the :authority header field. Once + this connection is successfully established, the proxy sends a HEADERS + frame containing a 2xx series status code to the client, as defined in . + + + After the initial HEADERS frame sent by each peer, all subsequent + DATA frames correspond to data sent on the TCP connection. The payload of + any DATA frames sent by the client is transmitted by the proxy to the TCP + server; data received from the TCP server is assembled into DATA frames by + the proxy. Frame types other than DATA or stream management frames + (RST_STREAM, WINDOW_UPDATE, and PRIORITY) + MUST NOT be sent on a connected stream, and MUST be treated as a stream error if received. + + + The TCP connection can be closed by either peer. The END_STREAM flag on a + DATA frame is treated as being equivalent to the TCP FIN bit. A client is + expected to send a DATA frame with the END_STREAM flag set after receiving + a frame bearing the END_STREAM flag. A proxy that receives a DATA frame + with the END_STREAM flag set sends the attached data with the FIN bit set on the last TCP + segment. A proxy that receives a TCP segment with the FIN bit set sends a + DATA frame with the END_STREAM flag set. Note that the final TCP segment + or DATA frame could be empty. + + + A TCP connection error is signaled with RST_STREAM. A proxy treats any + error in the TCP connection, which includes receiving a TCP segment with the RST bit set, + as a stream error of type + CONNECT_ERROR. Correspondingly, a proxy MUST send a TCP segment with the + RST bit set if it detects an error with the stream or the HTTP/2 connection. + +
+
+ +
+ + This section outlines attributes of the HTTP protocol that improve interoperability, reduce + exposure to known security vulnerabilities, or reduce the potential for implementation + variation. + + +
+ + HTTP/2 connections are persistent. For best performance, it is expected clients will not + close connections until it is determined that no further communication with a server is + necessary (for example, when a user navigates away from a particular web page), or until + the server closes the connection. + + + Clients SHOULD NOT open more than one HTTP/2 connection to a given host and port pair, + where host is derived from a URI, a selected alternative + service, or a configured proxy. + + + A client can create additional connections as replacements, either to replace connections + that are near to exhausting the available stream + identifier space, to refresh the keying material for a TLS connection, or to + replace connections that have encountered errors. + + + A client MAY open multiple connections to the same IP address and TCP port using different + Server Name Indication values or to provide different TLS + client certificates, but SHOULD avoid creating multiple connections with the same + configuration. + + + Servers are encouraged to maintain open connections for as long as possible, but are + permitted to terminate idle connections if necessary. When either endpoint chooses to + close the transport-layer TCP connection, the terminating endpoint SHOULD first send a + GOAWAY () frame so that both endpoints can reliably + determine whether previously sent frames have been processed and gracefully complete or + terminate any necessary remaining tasks. + + +
+ + Connections that are made to an origin servers, either directly or through a tunnel + created using the CONNECT method MAY be reused for + requests with multiple different URI authority components. A connection can be reused + as long as the origin server is authoritative. For + http resources, this depends on the host having resolved to + the same IP address. + + + For https resources, connection reuse additionally depends + on having a certificate that is valid for the host in the URI. An origin server might + offer a certificate with multiple subjectAltName attributes, + or names with wildcards, one of which is valid for the authority in the URI. For + example, a certificate with a subjectAltName of *.example.com might permit the use of the same connection for + requests to URIs starting with https://a.example.com/ and + https://b.example.com/. + + + In some deployments, reusing a connection for multiple origins can result in requests + being directed to the wrong origin server. For example, TLS termination might be + performed by a middlebox that uses the TLS Server Name Indication + (SNI) extension to select an origin server. This means that it is possible + for clients to send confidential information to servers that might not be the intended + target for the request, even though the server is otherwise authoritative. + + + A server that does not wish clients to reuse connections can indicate that it is not + authoritative for a request by sending a 421 (Misdirected Request) status code in response + to the request (see ). + + + A client that is configured to use a proxy over HTTP/2 directs requests to that proxy + through a single connection. That is, all requests sent via a proxy reuse the + connection to the proxy. + +
+ +
+ + The 421 (Misdirected Request) status code indicates that the request was directed at a + server that is not able to produce a response. This can be sent by a server that is not + configured to produce responses for the combination of scheme and authority that are + included in the request URI. + + + Clients receiving a 421 (Misdirected Request) response from a server MAY retry the + request - whether the request method is idempotent or not - over a different connection. + This is possible if a connection is reused () or if an alternative + service is selected (). + + + This status code MUST NOT be generated by proxies. + + + A 421 response is cacheable by default; i.e., unless otherwise indicated by the method + definition or explicit cache controls (see ). + +
+
+ +
+ + Implementations of HTTP/2 MUST support TLS 1.2 for HTTP/2 over + TLS. The general TLS usage guidance in SHOULD be followed, with + some additional restrictions that are specific to HTTP/2. + + + + An implementation of HTTP/2 over TLS MUST use TLS 1.2 or higher with the restrictions on + feature set and cipher suite described in this section. Due to implementation + limitations, it might not be possible to fail TLS negotiation. An endpoint MUST + immediately terminate an HTTP/2 connection that does not meet these minimum requirements + with a connection error of type + INADEQUATE_SECURITY. + + +
+ + The TLS implementation MUST support the Server Name Indication + (SNI) extension to TLS. HTTP/2 clients MUST indicate the target domain name when + negotiating TLS. + + + The TLS implementation MUST disable compression. TLS compression can lead to the + exposure of information that would not otherwise be revealed . + Generic compression is unnecessary since HTTP/2 provides compression features that are + more aware of context and therefore likely to be more appropriate for use for + performance, security or other reasons. + + + The TLS implementation MUST disable renegotiation. An endpoint MUST treat a TLS + renegotiation as a connection error of type + PROTOCOL_ERROR. Note that disabling renegotiation can result in + long-lived connections becoming unusable due to limits on the number of messages the + underlying cipher suite can encipher. + + + A client MAY use renegotiation to provide confidentiality protection for client + credentials offered in the handshake, but any renegotiation MUST occur prior to sending + the connection preface. A server SHOULD request a client certificate if it sees a + renegotiation request immediately after establishing a connection. + + + This effectively prevents the use of renegotiation in response to a request for a + specific protected resource. A future specification might provide a way to support this + use case. + +
+ +
+ + The set of TLS cipher suites that are permitted in HTTP/2 is restricted. HTTP/2 MUST + only be used with cipher suites that have ephemeral key exchange, such as the ephemeral Diffie-Hellman (DHE) or the elliptic curve variant (ECDHE). Ephemeral key exchange MUST + have a minimum size of 2048 bits for DHE or security level of 128 bits for ECDHE. + Clients MUST accept DHE sizes of up to 4096 bits. HTTP MUST NOT be used with cipher + suites that use stream or block ciphers. Authenticated Encryption with Additional Data + (AEAD) modes, such as the Galois Counter Model (GCM) mode for + AES are acceptable. + + + The effect of these restrictions is that TLS 1.2 implementations could have + non-intersecting sets of available cipher suites, since these prevent the use of the + cipher suite that TLS 1.2 makes mandatory. To avoid this problem, implementations of + HTTP/2 that use TLS 1.2 MUST support TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 with P256 . + + + Clients MAY advertise support of cipher suites that are prohibited by the above + restrictions in order to allow for connection to servers that do not support HTTP/2. + This enables a fallback to protocols without these constraints without the additional + latency imposed by using a separate connection for fallback. + +
+
+
+ +
+
+ + HTTP/2 relies on the HTTP/1.1 definition of authority for determining whether a server is + authoritative in providing a given response, see . This relies on local name resolution for the "http" + URI scheme, and the authenticated server identity for the "https" scheme (see ). + +
+ +
+ + In a cross-protocol attack, an attacker causes a client to initiate a transaction in one + protocol toward a server that understands a different protocol. An attacker might be able + to cause the transaction to appear as valid transaction in the second protocol. In + combination with the capabilities of the web context, this can be used to interact with + poorly protected servers in private networks. + + + Completing a TLS handshake with an ALPN identifier for HTTP/2 can be considered sufficient + protection against cross protocol attacks. ALPN provides a positive indication that a + server is willing to proceed with HTTP/2, which prevents attacks on other TLS-based + protocols. + + + The encryption in TLS makes it difficult for attackers to control the data which could be + used in a cross-protocol attack on a cleartext protocol. + + + The cleartext version of HTTP/2 has minimal protection against cross-protocol attacks. + The connection preface contains a string that is + designed to confuse HTTP/1.1 servers, but no special protection is offered for other + protocols. A server that is willing to ignore parts of an HTTP/1.1 request containing an + Upgrade header field in addition to the client connection preface could be exposed to a + cross-protocol attack. + +
+ +
+ + HTTP/2 header field names and values are encoded as sequences of octets with a length + prefix. This enables HTTP/2 to carry any string of octets as the name or value of a + header field. An intermediary that translates HTTP/2 requests or responses into HTTP/1.1 + directly could permit the creation of corrupted HTTP/1.1 messages. An attacker might + exploit this behavior to cause the intermediary to create HTTP/1.1 messages with illegal + header fields, extra header fields, or even new messages that are entirely falsified. + + + Header field names or values that contain characters not permitted by HTTP/1.1, including + carriage return (ASCII 0xd) or line feed (ASCII 0xa) MUST NOT be translated verbatim by an + intermediary, as stipulated in . + + + Translation from HTTP/1.x to HTTP/2 does not produce the same opportunity to an attacker. + Intermediaries that perform translation to HTTP/2 MUST remove any instances of the obs-fold production from header field values. + +
+ +
+ + Pushed responses do not have an explicit request from the client; the request + is provided by the server in the PUSH_PROMISE frame. + + + Caching responses that are pushed is possible based on the guidance provided by the origin + server in the Cache-Control header field. However, this can cause issues if a single + server hosts more than one tenant. For example, a server might offer multiple users each + a small portion of its URI space. + + + Where multiple tenants share space on the same server, that server MUST ensure that + tenants are not able to push representations of resources that they do not have authority + over. Failure to enforce this would allow a tenant to provide a representation that would + be served out of cache, overriding the actual representation that the authoritative tenant + provides. + + + Pushed responses for which an origin server is not authoritative (see + ) are never cached or used. + +
+ +
+ + An HTTP/2 connection can demand a greater commitment of resources to operate than a + HTTP/1.1 connection. The use of header compression and flow control depend on a + commitment of resources for storing a greater amount of state. Settings for these + features ensure that memory commitments for these features are strictly bounded. + + + The number of PUSH_PROMISE frames is not constrained in the same fashion. + A client that accepts server push SHOULD limit the number of streams it allows to be in + the "reserved (remote)" state. Excessive number of server push streams can be treated as + a stream error of type + ENHANCE_YOUR_CALM. + + + Processing capacity cannot be guarded as effectively as state capacity. + + + The SETTINGS frame can be abused to cause a peer to expend additional + processing time. This might be done by pointlessly changing SETTINGS parameters, setting + multiple undefined parameters, or changing the same setting multiple times in the same + frame. WINDOW_UPDATE or PRIORITY frames can be abused to + cause an unnecessary waste of resources. + + + Large numbers of small or empty frames can be abused to cause a peer to expend time + processing frame headers. Note however that some uses are entirely legitimate, such as + the sending of an empty DATA frame to end a stream. + + + Header compression also offers some opportunities to waste processing resources; see for more details on potential abuses. + + + Limits in SETTINGS parameters cannot be reduced instantaneously, which + leaves an endpoint exposed to behavior from a peer that could exceed the new limits. In + particular, immediately after establishing a connection, limits set by a server are not + known to clients and could be exceeded without being an obvious protocol violation. + + + All these features - i.e., SETTINGS changes, small frames, header + compression - have legitimate uses. These features become a burden only when they are + used unnecessarily or to excess. + + + An endpoint that doesn't monitor this behavior exposes itself to a risk of denial of + service attack. Implementations SHOULD track the use of these features and set limits on + their use. An endpoint MAY treat activity that is suspicious as a connection error of type + ENHANCE_YOUR_CALM. + + +
+ + A large header block can cause an implementation to + commit a large amount of state. Header fields that are critical for routing can appear + toward the end of a header block, which prevents streaming of header fields to their + ultimate destination. For this an other reasons, such as ensuring cache correctness, + means that an endpoint might need to buffer the entire header block. Since there is no + hard limit to the size of a header block, some endpoints could be forced commit a large + amount of available memory for header fields. + + + An endpoint can use the SETTINGS_MAX_HEADER_LIST_SIZE to advise peers of + limits that might apply on the size of header blocks. This setting is only advisory, so + endpoints MAY choose to send header blocks that exceed this limit and risk having the + request or response being treated as malformed. This setting specific to a connection, + so any request or response could encounter a hop with a lower, unknown limit. An + intermediary can attempt to avoid this problem by passing on values presented by + different peers, but they are not obligated to do so. + + + A server that receives a larger header block than it is willing to handle can send an + HTTP 431 (Request Header Fields Too Large) status code . A + client can discard responses that it cannot process. The header block MUST be processed + to ensure a consistent connection state, unless the connection is closed. + +
+
+ +
+ + HTTP/2 enables greater use of compression for both header fields () and entity bodies. Compression can allow an attacker to recover + secret data when it is compressed in the same context as data under attacker control. + + + There are demonstrable attacks on compression that exploit the characteristics of the web + (e.g., ). The attacker induces multiple requests containing + varying plaintext, observing the length of the resulting ciphertext in each, which + reveals a shorter length when a guess about the secret is correct. + + + Implementations communicating on a secure channel MUST NOT compress content that includes + both confidential and attacker-controlled data unless separate compression dictionaries + are used for each source of data. Compression MUST NOT be used if the source of data + cannot be reliably determined. Generic stream compression, such as that provided by TLS + MUST NOT be used with HTTP/2 (). + + + Further considerations regarding the compression of header fields are described in . + +
+ +
+ + Padding within HTTP/2 is not intended as a replacement for general purpose padding, such + as might be provided by TLS. Redundant padding could even be + counterproductive. Correct application can depend on having specific knowledge of the + data that is being padded. + + + To mitigate attacks that rely on compression, disabling or limiting compression might be + preferable to padding as a countermeasure. + + + Padding can be used to obscure the exact size of frame content, and is provided to + mitigate specific attacks within HTTP. For example, attacks where compressed content + includes both attacker-controlled plaintext and secret data (see for example, ). + + + Use of padding can result in less protection than might seem immediately obvious. At + best, padding only makes it more difficult for an attacker to infer length information by + increasing the number of frames an attacker has to observe. Incorrectly implemented + padding schemes can be easily defeated. In particular, randomized padding with a + predictable distribution provides very little protection; similarly, padding payloads to a + fixed size exposes information as payload sizes cross the fixed size boundary, which could + be possible if an attacker can control plaintext. + + + Intermediaries SHOULD retain padding for DATA frames, but MAY drop padding + for HEADERS and PUSH_PROMISE frames. A valid reason for an + intermediary to change the amount of padding of frames is to improve the protections that + padding provides. + +
+ +
+ + Several characteristics of HTTP/2 provide an observer an opportunity to correlate actions + of a single client or server over time. This includes the value of settings, the manner + in which flow control windows are managed, the way priorities are allocated to streams, + timing of reactions to stimulus, and handling of any optional features. + + + As far as this creates observable differences in behavior, they could be used as a basis + for fingerprinting a specific client, as defined in . + +
+
+ +
+ + A string for identifying HTTP/2 is entered into the "Application Layer Protocol Negotiation + (ALPN) Protocol IDs" registry established in . + + + This document establishes a registry for frame types, settings, and error codes. These new + registries are entered into a new "Hypertext Transfer Protocol (HTTP) 2 Parameters" section. + + + This document registers the HTTP2-Settings header field for + use in HTTP; and the 421 (Misdirected Request) status code. + + + This document registers the PRI method for use in HTTP, to avoid + collisions with the connection preface. + + +
+ + This document creates two registrations for the identification of HTTP/2 in the + "Application Layer Protocol Negotiation (ALPN) Protocol IDs" registry established in . + + + The "h2" string identifies HTTP/2 when used over TLS: + + HTTP/2 over TLS + 0x68 0x32 ("h2") + This document + + + + The "h2c" string identifies HTTP/2 when used over cleartext TCP: + + HTTP/2 over TCP + 0x68 0x32 0x63 ("h2c") + This document + + +
+ +
+ + This document establishes a registry for HTTP/2 frame type codes. The "HTTP/2 Frame + Type" registry manages an 8-bit space. The "HTTP/2 Frame Type" registry operates under + either of the "IETF Review" or "IESG Approval" policies for + values between 0x00 and 0xef, with values between 0xf0 and 0xff being reserved for + experimental use. + + + New entries in this registry require the following information: + + + A name or label for the frame type. + + + The 8-bit code assigned to the frame type. + + + A reference to a specification that includes a description of the frame layout, + it's semantics and flags that the frame type uses, including any parts of the frame + that are conditionally present based on the value of flags. + + + + + The entries in the following table are registered by this document. + + + Frame Type + Code + Section + DATA0x0 + HEADERS0x1 + PRIORITY0x2 + RST_STREAM0x3 + SETTINGS0x4 + PUSH_PROMISE0x5 + PING0x6 + GOAWAY0x7 + WINDOW_UPDATE0x8 + CONTINUATION0x9 + +
+ +
+ + This document establishes a registry for HTTP/2 settings. The "HTTP/2 Settings" registry + manages a 16-bit space. The "HTTP/2 Settings" registry operates under the "Expert Review" policy for values in the range from 0x0000 to + 0xefff, with values between and 0xf000 and 0xffff being reserved for experimental use. + + + New registrations are advised to provide the following information: + + + A symbolic name for the setting. Specifying a setting name is optional. + + + The 16-bit code assigned to the setting. + + + An initial value for the setting. + + + An optional reference to a specification that describes the use of the setting. + + + + + An initial set of setting registrations can be found in . + + + Name + Code + Initial Value + Specification + HEADER_TABLE_SIZE + 0x14096 + ENABLE_PUSH + 0x21 + MAX_CONCURRENT_STREAMS + 0x3(infinite) + INITIAL_WINDOW_SIZE + 0x465535 + MAX_FRAME_SIZE + 0x516384 + MAX_HEADER_LIST_SIZE + 0x6(infinite) + + +
+ +
+ + This document establishes a registry for HTTP/2 error codes. The "HTTP/2 Error Code" + registry manages a 32-bit space. The "HTTP/2 Error Code" registry operates under the + "Expert Review" policy. + + + Registrations for error codes are required to include a description of the error code. An + expert reviewer is advised to examine new registrations for possible duplication with + existing error codes. Use of existing registrations is to be encouraged, but not + mandated. + + + New registrations are advised to provide the following information: + + + A name for the error code. Specifying an error code name is optional. + + + The 32-bit error code value. + + + A brief description of the error code semantics, longer if no detailed specification + is provided. + + + An optional reference for a specification that defines the error code. + + + + + The entries in the following table are registered by this document. + + + Name + Code + Description + Specification + NO_ERROR0x0 + Graceful shutdown + + PROTOCOL_ERROR0x1 + Protocol error detected + + INTERNAL_ERROR0x2 + Implementation fault + + FLOW_CONTROL_ERROR0x3 + Flow control limits exceeded + + SETTINGS_TIMEOUT0x4 + Settings not acknowledged + + STREAM_CLOSED0x5 + Frame received for closed stream + + FRAME_SIZE_ERROR0x6 + Frame size incorrect + + REFUSED_STREAM0x7 + Stream not processed + + CANCEL0x8 + Stream cancelled + + COMPRESSION_ERROR0x9 + Compression state not updated + + CONNECT_ERROR0xa + TCP connection error for CONNECT method + + ENHANCE_YOUR_CALM0xb + Processing capacity exceeded + + INADEQUATE_SECURITY0xc + Negotiated TLS parameters not acceptable + + + +
+ +
+ + This section registers the HTTP2-Settings header field in the + Permanent Message Header Field Registry. + + + HTTP2-Settings + + + http + + + standard + + + IETF + + + of this document + + + This header field is only used by an HTTP/2 client for Upgrade-based negotiation. + + + +
+ +
+ + This section registers the PRI method in the HTTP Method + Registry (). + + + PRI + + + No + + + No + + + of this document + + + This method is never used by an actual client. This method will appear to be used + when an HTTP/1.1 server or intermediary attempts to parse an HTTP/2 connection + preface. + + + +
+ +
+ + This document registers the 421 (Misdirected Request) HTTP Status code in the Hypertext + Transfer Protocol (HTTP) Status Code Registry (). + + + + + 421 + + + Misdirected Request + + + of this document + + + +
+ +
+ +
+ + This document includes substantial input from the following individuals: + + + Adam Langley, Wan-Teh Chang, Jim Morrison, Mark Nottingham, Alyssa Wilk, Costin + Manolache, William Chan, Vitaliy Lvin, Joe Chan, Adam Barth, Ryan Hamilton, Gavin + Peters, Kent Alstad, Kevin Lindsay, Paul Amer, Fan Yang, Jonathan Leighton (SPDY + contributors). + + + Gabriel Montenegro and Willy Tarreau (Upgrade mechanism). + + + William Chan, Salvatore Loreto, Osama Mazahir, Gabriel Montenegro, Jitu Padhye, Roberto + Peon, Rob Trace (Flow control). + + + Mike Bishop (Extensibility). + + + Mark Nottingham, Julian Reschke, James Snell, Jeff Pinner, Mike Bishop, Herve Ruellan + (Substantial editorial contributions). + + + Kari Hurtta, Tatsuhiro Tsujikawa, Greg Wilkins, Poul-Henning Kamp. + + + Alexey Melnikov was an editor of this document during 2013. + + + A substantial proportion of Martin's contribution was supported by Microsoft during his + employment there. + + + +
+
+ + + + + + HPACK - Header Compression for HTTP/2 + + + + + + + + + + + + Transmission Control Protocol + + + University of Southern California (USC)/Information Sciences + Institute + + + + + + + + + + + Key words for use in RFCs to Indicate Requirement Levels + + + Harvard University +
sob@harvard.edu
+
+ +
+ + +
+ + + + + HTTP Over TLS + + + + + + + + + + Uniform Resource Identifier (URI): Generic + Syntax + + + + + + + + + + + + The Base16, Base32, and Base64 Data Encodings + + + + + + + + + Guidelines for Writing an IANA Considerations Section in RFCs + + + + + + + + + + + Augmented BNF for Syntax Specifications: ABNF + + + + + + + + + + + The Transport Layer Security (TLS) Protocol Version 1.2 + + + + + + + + + + + Transport Layer Security (TLS) Extensions: Extension Definitions + + + + + + + + + + Transport Layer Security (TLS) Application-Layer Protocol Negotiation Extension + + + + + + + + + + + + + TLS Elliptic Curve Cipher Suites with SHA-256/384 and AES Galois + Counter Mode (GCM) + + + + + + + + + + + Digital Signature Standard (DSS) + + NIST + + + + + + + + + Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing + + Adobe Systems Incorporated +
fielding@gbiv.com
+
+ + greenbytes GmbH +
julian.reschke@greenbytes.de
+
+ +
+ + +
+ + + + Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content + + Adobe Systems Incorporated +
fielding@gbiv.com
+
+ + greenbytes GmbH +
julian.reschke@greenbytes.de
+
+ +
+ + +
+ + + Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests + + Adobe Systems Incorporated +
fielding@gbiv.com
+
+ + greenbytes GmbH +
julian.reschke@greenbytes.de
+
+ +
+ +
+ + + Hypertext Transfer Protocol (HTTP/1.1): Range Requests + + Adobe Systems Incorporated +
fielding@gbiv.com
+
+ + World Wide Web Consortium +
ylafon@w3.org
+
+ + greenbytes GmbH +
julian.reschke@greenbytes.de
+
+ +
+ +
+ + + Hypertext Transfer Protocol (HTTP/1.1): Caching + + Adobe Systems Incorporated +
fielding@gbiv.com
+
+ + Akamai +
mnot@mnot.net
+
+ + greenbytes GmbH +
julian.reschke@greenbytes.de
+
+ +
+ + +
+ + + Hypertext Transfer Protocol (HTTP/1.1): Authentication + + Adobe Systems Incorporated +
fielding@gbiv.com
+
+ + greenbytes GmbH +
julian.reschke@greenbytes.de
+
+ +
+ + +
+ + + + HTTP State Management Mechanism + + + + + +
+ + + + + + TCP Extensions for High Performance + + + + + + + + + + + + Transport Layer Security Protocol Compression Methods + + + + + + + + + Additional HTTP Status Codes + + + + + + + + + + + Elliptic Curve Cryptography (ECC) Cipher Suites for Transport Layer Security (TLS) + + + + + + + + + + + + + + + AES Galois Counter Mode (GCM) Cipher Suites for TLS + + + + + + + + + + + + HTML5 + + + + + + + + + + + Latest version available at + . + + + + + + + Talking to Yourself for Fun and Profit + + + + + + + + + + + + + + BREACH: Reviving the CRIME Attack + + + + + + + + + + + Registration Procedures for Message Header Fields + + Nine by Nine +
GK-IETF@ninebynine.org
+
+ + BEA Systems +
mnot@pobox.com
+
+ + HP Labs +
JeffMogul@acm.org
+
+ +
+ + +
+ + + + Recommendations for Secure Use of TLS and DTLS + + + + + + + + + + + + + + + + + + HTTP Alternative Services + + + Akamai + + + Mozilla + + + greenbytes + + + + + + +
+ +
+ + This section is to be removed by RFC Editor before publication. + + +
+ + Renamed Not Authoritative status code to Misdirected Request. + +
+ +
+ + Pseudo-header fields are now required to appear strictly before regular ones. + + + Restored 1xx series status codes, except 101. + + + Changed frame length field 24-bits. Expanded frame header to 9 octets. Added a setting + to limit the damage. + + + Added a setting to advise peers of header set size limits. + + + Removed segments. + + + Made non-semantic-bearing HEADERS frames illegal in the HTTP mapping. + +
+ +
+ + Restored extensibility options. + + + Restricting TLS cipher suites to AEAD only. + + + Removing Content-Encoding requirements. + + + Permitting the use of PRIORITY after stream close. + + + Removed ALTSVC frame. + + + Removed BLOCKED frame. + + + Reducing the maximum padding size to 256 octets; removing padding from + CONTINUATION frames. + + + Removed per-frame GZIP compression. + +
+ +
+ + Added BLOCKED frame (at risk). + + + Simplified priority scheme. + + + Added DATA per-frame GZIP compression. + +
+ +
+ + Changed "connection header" to "connection preface" to avoid confusion. + + + Added dependency-based stream prioritization. + + + Added "h2c" identifier to distinguish between cleartext and secured HTTP/2. + + + Adding missing padding to PUSH_PROMISE. + + + Integrate ALTSVC frame and supporting text. + + + Dropping requirement on "deflate" Content-Encoding. + + + Improving security considerations around use of compression. + +
+ +
+ + Adding padding for data frames. + + + Renumbering frame types, error codes, and settings. + + + Adding INADEQUATE_SECURITY error code. + + + Updating TLS usage requirements to 1.2; forbidding TLS compression. + + + Removing extensibility for frames and settings. + + + Changing setting identifier size. + + + Removing the ability to disable flow control. + + + Changing the protocol identification token to "h2". + + + Changing the use of :authority to make it optional and to allow userinfo in non-HTTP + cases. + + + Allowing split on 0x0 for Cookie. + + + Reserved PRI method in HTTP/1.1 to avoid possible future collisions. + +
+ +
+ + Added cookie crumbling for more efficient header compression. + + + Added header field ordering with the value-concatenation mechanism. + +
+ +
+ + Marked draft for implementation. + +
+ +
+ + Adding definition for CONNECT method. + + + Constraining the use of push to safe, cacheable methods with no request body. + + + Changing from :host to :authority to remove any potential confusion. + + + Adding setting for header compression table size. + + + Adding settings acknowledgement. + + + Removing unnecessary and potentially problematic flags from CONTINUATION. + + + Added denial of service considerations. + +
+
+ + Marking the draft ready for implementation. + + + Renumbering END_PUSH_PROMISE flag. + + + Editorial clarifications and changes. + +
+ +
+ + Added CONTINUATION frame for HEADERS and PUSH_PROMISE. + + + PUSH_PROMISE is no longer implicitly prohibited if SETTINGS_MAX_CONCURRENT_STREAMS is + zero. + + + Push expanded to allow all safe methods without a request body. + + + Clarified the use of HTTP header fields in requests and responses. Prohibited HTTP/1.1 + hop-by-hop header fields. + + + Requiring that intermediaries not forward requests with missing or illegal routing + :-headers. + + + Clarified requirements around handling different frames after stream close, stream reset + and GOAWAY. + + + Added more specific prohibitions for sending of different frame types in various stream + states. + + + Making the last received setting value the effective value. + + + Clarified requirements on TLS version, extension and ciphers. + +
+ +
+ + Committed major restructuring atrocities. + + + Added reference to first header compression draft. + + + Added more formal description of frame lifecycle. + + + Moved END_STREAM (renamed from FINAL) back to HEADERS/DATA. + + + Removed HEADERS+PRIORITY, added optional priority to HEADERS frame. + + + Added PRIORITY frame. + +
+ +
+ + Added continuations to frames carrying header blocks. + + + Replaced use of "session" with "connection" to avoid confusion with other HTTP stateful + concepts, like cookies. + + + Removed "message". + + + Switched to TLS ALPN from NPN. + + + Editorial changes. + +
+ +
+ + Added IANA considerations section for frame types, error codes and settings. + + + Removed data frame compression. + + + Added PUSH_PROMISE. + + + Added globally applicable flags to framing. + + + Removed zlib-based header compression mechanism. + + + Updated references. + + + Clarified stream identifier reuse. + + + Removed CREDENTIALS frame and associated mechanisms. + + + Added advice against naive implementation of flow control. + + + Added session header section. + + + Restructured frame header. Removed distinction between data and control frames. + + + Altered flow control properties to include session-level limits. + + + Added note on cacheability of pushed resources and multiple tenant servers. + + + Changed protocol label form based on discussions. + +
+ +
+ + Changed title throughout. + + + Removed section on Incompatibilities with SPDY draft#2. + + + Changed INTERNAL_ERROR on GOAWAY to have a value of 2 . + + + Replaced abstract and introduction. + + + Added section on starting HTTP/2.0, including upgrade mechanism. + + + Removed unused references. + + + Added flow control principles based on . + +
+ +
+ + Adopted as base for draft-ietf-httpbis-http2. + + + Updated authors/editors list. + + + Added status note. + +
+
+ +
+
+ diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/transport.go b/Godeps/_workspace/src/github.com/bradfitz/http2/transport.go new file mode 100644 index 000000000..ea62188db --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/transport.go @@ -0,0 +1,553 @@ +// Copyright 2015 The Go Authors. +// See https://go.googlesource.com/go/+/master/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://go.googlesource.com/go/+/master/LICENSE + +package http2 + +import ( + "bufio" + "bytes" + "crypto/tls" + "errors" + "fmt" + "io" + "log" + "net" + "net/http" + "strconv" + "strings" + "sync" + + "github.com/bradfitz/http2/hpack" +) + +type Transport struct { + Fallback http.RoundTripper + + // TODO: remove this and make more general with a TLS dial hook, like http + InsecureTLSDial bool + + connMu sync.Mutex + conns map[string][]*clientConn // key is host:port +} + +type clientConn struct { + t *Transport + tconn *tls.Conn + tlsState *tls.ConnectionState + connKey []string // key(s) this connection is cached in, in t.conns + + readerDone chan struct{} // closed on error + readerErr error // set before readerDone is closed + hdec *hpack.Decoder + nextRes *http.Response + + mu sync.Mutex + closed bool + goAway *GoAwayFrame // if non-nil, the GoAwayFrame we received + streams map[uint32]*clientStream + nextStreamID uint32 + bw *bufio.Writer + werr error // first write error that has occurred + br *bufio.Reader + fr *Framer + // Settings from peer: + maxFrameSize uint32 + maxConcurrentStreams uint32 + initialWindowSize uint32 + hbuf bytes.Buffer // HPACK encoder writes into this + henc *hpack.Encoder +} + +type clientStream struct { + ID uint32 + resc chan resAndError + pw *io.PipeWriter + pr *io.PipeReader +} + +type stickyErrWriter struct { + w io.Writer + err *error +} + +func (sew stickyErrWriter) Write(p []byte) (n int, err error) { + if *sew.err != nil { + return 0, *sew.err + } + n, err = sew.w.Write(p) + *sew.err = err + return +} + +func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { + if req.URL.Scheme != "https" { + if t.Fallback == nil { + return nil, errors.New("http2: unsupported scheme and no Fallback") + } + return t.Fallback.RoundTrip(req) + } + + host, port, err := net.SplitHostPort(req.URL.Host) + if err != nil { + host = req.URL.Host + port = "443" + } + + for { + cc, err := t.getClientConn(host, port) + if err != nil { + return nil, err + } + res, err := cc.roundTrip(req) + if shouldRetryRequest(err) { // TODO: or clientconn is overloaded (too many outstanding requests)? + continue + } + if err != nil { + return nil, err + } + return res, nil + } +} + +// CloseIdleConnections closes any connections which were previously +// connected from previous requests but are now sitting idle. +// It does not interrupt any connections currently in use. +func (t *Transport) CloseIdleConnections() { + t.connMu.Lock() + defer t.connMu.Unlock() + for _, vv := range t.conns { + for _, cc := range vv { + cc.closeIfIdle() + } + } +} + +var errClientConnClosed = errors.New("http2: client conn is closed") + +func shouldRetryRequest(err error) bool { + // TODO: or GOAWAY graceful shutdown stuff + return err == errClientConnClosed +} + +func (t *Transport) removeClientConn(cc *clientConn) { + t.connMu.Lock() + defer t.connMu.Unlock() + for _, key := range cc.connKey { + vv, ok := t.conns[key] + if !ok { + continue + } + newList := filterOutClientConn(vv, cc) + if len(newList) > 0 { + t.conns[key] = newList + } else { + delete(t.conns, key) + } + } +} + +func filterOutClientConn(in []*clientConn, exclude *clientConn) []*clientConn { + out := in[:0] + for _, v := range in { + if v != exclude { + out = append(out, v) + } + } + return out +} + +func (t *Transport) getClientConn(host, port string) (*clientConn, error) { + t.connMu.Lock() + defer t.connMu.Unlock() + + key := net.JoinHostPort(host, port) + + for _, cc := range t.conns[key] { + if cc.canTakeNewRequest() { + return cc, nil + } + } + if t.conns == nil { + t.conns = make(map[string][]*clientConn) + } + cc, err := t.newClientConn(host, port, key) + if err != nil { + return nil, err + } + t.conns[key] = append(t.conns[key], cc) + return cc, nil +} + +func (t *Transport) newClientConn(host, port, key string) (*clientConn, error) { + cfg := &tls.Config{ + ServerName: host, + NextProtos: []string{NextProtoTLS}, + InsecureSkipVerify: t.InsecureTLSDial, + } + tconn, err := tls.Dial("tcp", host+":"+port, cfg) + if err != nil { + return nil, err + } + if err := tconn.Handshake(); err != nil { + return nil, err + } + if !t.InsecureTLSDial { + if err := tconn.VerifyHostname(cfg.ServerName); err != nil { + return nil, err + } + } + state := tconn.ConnectionState() + if p := state.NegotiatedProtocol; p != NextProtoTLS { + // TODO(bradfitz): fall back to Fallback + return nil, fmt.Errorf("bad protocol: %v", p) + } + if !state.NegotiatedProtocolIsMutual { + return nil, errors.New("could not negotiate protocol mutually") + } + if _, err := tconn.Write(clientPreface); err != nil { + return nil, err + } + + cc := &clientConn{ + t: t, + tconn: tconn, + connKey: []string{key}, // TODO: cert's validated hostnames too + tlsState: &state, + readerDone: make(chan struct{}), + nextStreamID: 1, + maxFrameSize: 16 << 10, // spec default + initialWindowSize: 65535, // spec default + maxConcurrentStreams: 1000, // "infinite", per spec. 1000 seems good enough. + streams: make(map[uint32]*clientStream), + } + cc.bw = bufio.NewWriter(stickyErrWriter{tconn, &cc.werr}) + cc.br = bufio.NewReader(tconn) + cc.fr = NewFramer(cc.bw, cc.br) + cc.henc = hpack.NewEncoder(&cc.hbuf) + + cc.fr.WriteSettings() + // TODO: re-send more conn-level flow control tokens when server uses all these. + cc.fr.WriteWindowUpdate(0, 1<<30) // um, 0x7fffffff doesn't work to Google? it hangs? + cc.bw.Flush() + if cc.werr != nil { + return nil, cc.werr + } + + // Read the obligatory SETTINGS frame + f, err := cc.fr.ReadFrame() + if err != nil { + return nil, err + } + sf, ok := f.(*SettingsFrame) + if !ok { + return nil, fmt.Errorf("expected settings frame, got: %T", f) + } + cc.fr.WriteSettingsAck() + cc.bw.Flush() + + sf.ForeachSetting(func(s Setting) error { + switch s.ID { + case SettingMaxFrameSize: + cc.maxFrameSize = s.Val + case SettingMaxConcurrentStreams: + cc.maxConcurrentStreams = s.Val + case SettingInitialWindowSize: + cc.initialWindowSize = s.Val + default: + // TODO(bradfitz): handle more + log.Printf("Unhandled Setting: %v", s) + } + return nil + }) + // TODO: figure out henc size + cc.hdec = hpack.NewDecoder(initialHeaderTableSize, cc.onNewHeaderField) + + go cc.readLoop() + return cc, nil +} + +func (cc *clientConn) setGoAway(f *GoAwayFrame) { + cc.mu.Lock() + defer cc.mu.Unlock() + cc.goAway = f +} + +func (cc *clientConn) canTakeNewRequest() bool { + cc.mu.Lock() + defer cc.mu.Unlock() + return cc.goAway == nil && + int64(len(cc.streams)+1) < int64(cc.maxConcurrentStreams) && + cc.nextStreamID < 2147483647 +} + +func (cc *clientConn) closeIfIdle() { + cc.mu.Lock() + if len(cc.streams) > 0 { + cc.mu.Unlock() + return + } + cc.closed = true + // TODO: do clients send GOAWAY too? maybe? Just Close: + cc.mu.Unlock() + + cc.tconn.Close() +} + +func (cc *clientConn) roundTrip(req *http.Request) (*http.Response, error) { + cc.mu.Lock() + + if cc.closed { + cc.mu.Unlock() + return nil, errClientConnClosed + } + + cs := cc.newStream() + hasBody := false // TODO + + // we send: HEADERS[+CONTINUATION] + (DATA?) + hdrs := cc.encodeHeaders(req) + first := true + for len(hdrs) > 0 { + chunk := hdrs + if len(chunk) > int(cc.maxFrameSize) { + chunk = chunk[:cc.maxFrameSize] + } + hdrs = hdrs[len(chunk):] + endHeaders := len(hdrs) == 0 + if first { + cc.fr.WriteHeaders(HeadersFrameParam{ + StreamID: cs.ID, + BlockFragment: chunk, + EndStream: !hasBody, + EndHeaders: endHeaders, + }) + first = false + } else { + cc.fr.WriteContinuation(cs.ID, endHeaders, chunk) + } + } + cc.bw.Flush() + werr := cc.werr + cc.mu.Unlock() + + if hasBody { + // TODO: write data. and it should probably be interleaved: + // go ... io.Copy(dataFrameWriter{cc, cs, ...}, req.Body) ... etc + } + + if werr != nil { + return nil, werr + } + + re := <-cs.resc + if re.err != nil { + return nil, re.err + } + res := re.res + res.Request = req + res.TLS = cc.tlsState + return res, nil +} + +// requires cc.mu be held. +func (cc *clientConn) encodeHeaders(req *http.Request) []byte { + cc.hbuf.Reset() + + // TODO(bradfitz): figure out :authority-vs-Host stuff between http2 and Go + host := req.Host + if host == "" { + host = req.URL.Host + } + + path := req.URL.Path + if path == "" { + path = "/" + } + + cc.writeHeader(":authority", host) // probably not right for all sites + cc.writeHeader(":method", req.Method) + cc.writeHeader(":path", path) + cc.writeHeader(":scheme", "https") + + for k, vv := range req.Header { + lowKey := strings.ToLower(k) + if lowKey == "host" { + continue + } + for _, v := range vv { + cc.writeHeader(lowKey, v) + } + } + return cc.hbuf.Bytes() +} + +func (cc *clientConn) writeHeader(name, value string) { + log.Printf("sending %q = %q", name, value) + cc.henc.WriteField(hpack.HeaderField{Name: name, Value: value}) +} + +type resAndError struct { + res *http.Response + err error +} + +// requires cc.mu be held. +func (cc *clientConn) newStream() *clientStream { + cs := &clientStream{ + ID: cc.nextStreamID, + resc: make(chan resAndError, 1), + } + cc.nextStreamID += 2 + cc.streams[cs.ID] = cs + return cs +} + +func (cc *clientConn) streamByID(id uint32, andRemove bool) *clientStream { + cc.mu.Lock() + defer cc.mu.Unlock() + cs := cc.streams[id] + if andRemove { + delete(cc.streams, id) + } + return cs +} + +// runs in its own goroutine. +func (cc *clientConn) readLoop() { + defer cc.t.removeClientConn(cc) + defer close(cc.readerDone) + + activeRes := map[uint32]*clientStream{} // keyed by streamID + // Close any response bodies if the server closes prematurely. + // TODO: also do this if we've written the headers but not + // gotten a response yet. + defer func() { + err := cc.readerErr + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + for _, cs := range activeRes { + cs.pw.CloseWithError(err) + } + }() + + // continueStreamID is the stream ID we're waiting for + // continuation frames for. + var continueStreamID uint32 + + for { + f, err := cc.fr.ReadFrame() + if err != nil { + cc.readerErr = err + return + } + log.Printf("Transport received %v: %#v", f.Header(), f) + + streamID := f.Header().StreamID + + _, isContinue := f.(*ContinuationFrame) + if isContinue { + if streamID != continueStreamID { + log.Printf("Protocol violation: got CONTINUATION with id %d; want %d", streamID, continueStreamID) + cc.readerErr = ConnectionError(ErrCodeProtocol) + return + } + } else if continueStreamID != 0 { + // Continue frames need to be adjacent in the stream + // and we were in the middle of headers. + log.Printf("Protocol violation: got %T for stream %d, want CONTINUATION for %d", f, streamID, continueStreamID) + cc.readerErr = ConnectionError(ErrCodeProtocol) + return + } + + if streamID%2 == 0 { + // Ignore streams pushed from the server for now. + // These always have an even stream id. + continue + } + streamEnded := false + if ff, ok := f.(streamEnder); ok { + streamEnded = ff.StreamEnded() + } + + cs := cc.streamByID(streamID, streamEnded) + if cs == nil { + log.Printf("Received frame for untracked stream ID %d", streamID) + continue + } + + switch f := f.(type) { + case *HeadersFrame: + cc.nextRes = &http.Response{ + Proto: "HTTP/2.0", + ProtoMajor: 2, + Header: make(http.Header), + } + cs.pr, cs.pw = io.Pipe() + cc.hdec.Write(f.HeaderBlockFragment()) + case *ContinuationFrame: + cc.hdec.Write(f.HeaderBlockFragment()) + case *DataFrame: + log.Printf("DATA: %q", f.Data()) + cs.pw.Write(f.Data()) + case *GoAwayFrame: + cc.t.removeClientConn(cc) + if f.ErrCode != 0 { + // TODO: deal with GOAWAY more. particularly the error code + log.Printf("transport got GOAWAY with error code = %v", f.ErrCode) + } + cc.setGoAway(f) + default: + log.Printf("Transport: unhandled response frame type %T", f) + } + headersEnded := false + if he, ok := f.(headersEnder); ok { + headersEnded = he.HeadersEnded() + if headersEnded { + continueStreamID = 0 + } else { + continueStreamID = streamID + } + } + + if streamEnded { + cs.pw.Close() + delete(activeRes, streamID) + } + if headersEnded { + if cs == nil { + panic("couldn't find stream") // TODO be graceful + } + // TODO: set the Body to one which notes the + // Close and also sends the server a + // RST_STREAM + cc.nextRes.Body = cs.pr + res := cc.nextRes + activeRes[streamID] = cs + cs.resc <- resAndError{res: res} + } + } +} + +func (cc *clientConn) onNewHeaderField(f hpack.HeaderField) { + // TODO: verifiy pseudo headers come before non-pseudo headers + // TODO: verifiy the status is set + log.Printf("Header field: %+v", f) + if f.Name == ":status" { + code, err := strconv.Atoi(f.Value) + if err != nil { + panic("TODO: be graceful") + } + cc.nextRes.Status = f.Value + " " + http.StatusText(code) + cc.nextRes.StatusCode = code + return + } + if strings.HasPrefix(f.Name, ":") { + // "Endpoints MUST NOT generate pseudo-header fields other than those defined in this document." + // TODO: treat as invalid? + return + } + cc.nextRes.Header.Add(http.CanonicalHeaderKey(f.Name), f.Value) +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/transport_test.go b/Godeps/_workspace/src/github.com/bradfitz/http2/transport_test.go new file mode 100644 index 000000000..d752da198 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/transport_test.go @@ -0,0 +1,168 @@ +// Copyright 2015 The Go Authors. +// See https://go.googlesource.com/go/+/master/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://go.googlesource.com/go/+/master/LICENSE + +package http2 + +import ( + "flag" + "io" + "io/ioutil" + "net/http" + "os" + "reflect" + "strings" + "testing" + "time" +) + +var ( + extNet = flag.Bool("extnet", false, "do external network tests") + transportHost = flag.String("transporthost", "http2.golang.org", "hostname to use for TestTransport") + insecure = flag.Bool("insecure", false, "insecure TLS dials") +) + +func TestTransportExternal(t *testing.T) { + if !*extNet { + t.Skip("skipping external network test") + } + req, _ := http.NewRequest("GET", "https://"+*transportHost+"/", nil) + rt := &Transport{ + InsecureTLSDial: *insecure, + } + res, err := rt.RoundTrip(req) + if err != nil { + t.Fatalf("%v", err) + } + res.Write(os.Stdout) +} + +func TestTransport(t *testing.T) { + const body = "sup" + st := newServerTester(t, func(w http.ResponseWriter, r *http.Request) { + io.WriteString(w, body) + }) + defer st.Close() + + tr := &Transport{InsecureTLSDial: true} + defer tr.CloseIdleConnections() + + req, err := http.NewRequest("GET", st.ts.URL, nil) + if err != nil { + t.Fatal(err) + } + res, err := tr.RoundTrip(req) + if err != nil { + t.Fatal(err) + } + defer res.Body.Close() + + t.Logf("Got res: %+v", res) + if g, w := res.StatusCode, 200; g != w { + t.Errorf("StatusCode = %v; want %v", g, w) + } + if g, w := res.Status, "200 OK"; g != w { + t.Errorf("Status = %q; want %q", g, w) + } + wantHeader := http.Header{ + "Content-Length": []string{"3"}, + "Content-Type": []string{"text/plain; charset=utf-8"}, + } + if !reflect.DeepEqual(res.Header, wantHeader) { + t.Errorf("res Header = %v; want %v", res.Header, wantHeader) + } + if res.Request != req { + t.Errorf("Response.Request = %p; want %p", res.Request, req) + } + if res.TLS == nil { + t.Error("Response.TLS = nil; want non-nil") + } + slurp, err := ioutil.ReadAll(res.Body) + if err != nil { + t.Errorf("Body read: %v", err) + } else if string(slurp) != body { + t.Errorf("Body = %q; want %q", slurp, body) + } + +} + +func TestTransportReusesConns(t *testing.T) { + st := newServerTester(t, func(w http.ResponseWriter, r *http.Request) { + io.WriteString(w, r.RemoteAddr) + }, optOnlyServer) + defer st.Close() + tr := &Transport{InsecureTLSDial: true} + defer tr.CloseIdleConnections() + get := func() string { + req, err := http.NewRequest("GET", st.ts.URL, nil) + if err != nil { + t.Fatal(err) + } + res, err := tr.RoundTrip(req) + if err != nil { + t.Fatal(err) + } + defer res.Body.Close() + slurp, err := ioutil.ReadAll(res.Body) + if err != nil { + t.Fatalf("Body read: %v", err) + } + addr := strings.TrimSpace(string(slurp)) + if addr == "" { + t.Fatalf("didn't get an addr in response") + } + return addr + } + first := get() + second := get() + if first != second { + t.Errorf("first and second responses were on different connections: %q vs %q", first, second) + } +} + +func TestTransportAbortClosesPipes(t *testing.T) { + shutdown := make(chan struct{}) + st := newServerTester(t, + func(w http.ResponseWriter, r *http.Request) { + w.(http.Flusher).Flush() + <-shutdown + }, + optOnlyServer, + ) + defer st.Close() + defer close(shutdown) // we must shutdown before st.Close() to avoid hanging + + done := make(chan struct{}) + requestMade := make(chan struct{}) + go func() { + defer close(done) + tr := &Transport{ + InsecureTLSDial: true, + } + req, err := http.NewRequest("GET", st.ts.URL, nil) + if err != nil { + t.Fatal(err) + } + res, err := tr.RoundTrip(req) + if err != nil { + t.Fatal(err) + } + defer res.Body.Close() + close(requestMade) + _, err = ioutil.ReadAll(res.Body) + if err == nil { + t.Error("expected error from res.Body.Read") + } + }() + + <-requestMade + // Now force the serve loop to end, via closing the connection. + st.closeConn() + // deadlock? that's a bug. + select { + case <-done: + case <-time.After(3 * time.Second): + t.Fatal("timeout") + } +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/write.go b/Godeps/_workspace/src/github.com/bradfitz/http2/write.go new file mode 100644 index 000000000..7b9bdd3a6 --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/write.go @@ -0,0 +1,204 @@ +// 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. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +package http2 + +import ( + "bytes" + "fmt" + "net/http" + "time" + + "github.com/bradfitz/http2/hpack" +) + +// writeFramer is implemented by any type that is used to write frames. +type writeFramer interface { + writeFrame(writeContext) error +} + +// writeContext is the interface needed by the various frame writer +// types below. All the writeFrame methods below are scheduled via the +// frame writing scheduler (see writeScheduler in writesched.go). +// +// This interface is implemented by *serverConn. +// TODO: use it from the client code too, once it exists. +type writeContext interface { + Framer() *Framer + Flush() error + CloseConn() error + // HeaderEncoder returns an HPACK encoder that writes to the + // returned buffer. + HeaderEncoder() (*hpack.Encoder, *bytes.Buffer) +} + +// endsStream reports whether the given frame writer w will locally +// close the stream. +func endsStream(w writeFramer) bool { + switch v := w.(type) { + case *writeData: + return v.endStream + case *writeResHeaders: + return v.endStream + } + return false +} + +type flushFrameWriter struct{} + +func (flushFrameWriter) writeFrame(ctx writeContext) error { + return ctx.Flush() +} + +type writeSettings []Setting + +func (s writeSettings) writeFrame(ctx writeContext) error { + return ctx.Framer().WriteSettings([]Setting(s)...) +} + +type writeGoAway struct { + maxStreamID uint32 + code ErrCode +} + +func (p *writeGoAway) writeFrame(ctx writeContext) error { + err := ctx.Framer().WriteGoAway(p.maxStreamID, p.code, nil) + if p.code != 0 { + ctx.Flush() // ignore error: we're hanging up on them anyway + time.Sleep(50 * time.Millisecond) + ctx.CloseConn() + } + return err +} + +type writeData struct { + streamID uint32 + p []byte + endStream bool +} + +func (w *writeData) String() string { + return fmt.Sprintf("writeData(stream=%d, p=%d, endStream=%v)", w.streamID, len(w.p), w.endStream) +} + +func (w *writeData) writeFrame(ctx writeContext) error { + return ctx.Framer().WriteData(w.streamID, w.endStream, w.p) +} + +func (se StreamError) writeFrame(ctx writeContext) error { + return ctx.Framer().WriteRSTStream(se.StreamID, se.Code) +} + +type writePingAck struct{ pf *PingFrame } + +func (w writePingAck) writeFrame(ctx writeContext) error { + return ctx.Framer().WritePing(true, w.pf.Data) +} + +type writeSettingsAck struct{} + +func (writeSettingsAck) writeFrame(ctx writeContext) error { + return ctx.Framer().WriteSettingsAck() +} + +// writeResHeaders is a request to write a HEADERS and 0+ CONTINUATION frames +// for HTTP response headers from a server handler. +type writeResHeaders struct { + streamID uint32 + httpResCode int + h http.Header // may be nil + endStream bool + + contentType string + contentLength string +} + +func (w *writeResHeaders) writeFrame(ctx writeContext) error { + enc, buf := ctx.HeaderEncoder() + buf.Reset() + enc.WriteField(hpack.HeaderField{Name: ":status", Value: httpCodeString(w.httpResCode)}) + for k, vv := range w.h { + k = lowerHeader(k) + for _, v := range vv { + // TODO: more of "8.1.2.2 Connection-Specific Header Fields" + if k == "transfer-encoding" && v != "trailers" { + continue + } + enc.WriteField(hpack.HeaderField{Name: k, Value: v}) + } + } + if w.contentType != "" { + enc.WriteField(hpack.HeaderField{Name: "content-type", Value: w.contentType}) + } + if w.contentLength != "" { + enc.WriteField(hpack.HeaderField{Name: "content-length", Value: w.contentLength}) + } + + headerBlock := buf.Bytes() + if len(headerBlock) == 0 { + panic("unexpected empty hpack") + } + + // For now we're lazy and just pick the minimum MAX_FRAME_SIZE + // that all peers must support (16KB). Later we could care + // more and send larger frames if the peer advertised it, but + // there's little point. Most headers are small anyway (so we + // generally won't have CONTINUATION frames), and extra frames + // only waste 9 bytes anyway. + const maxFrameSize = 16384 + + first := true + for len(headerBlock) > 0 { + frag := headerBlock + if len(frag) > maxFrameSize { + frag = frag[:maxFrameSize] + } + headerBlock = headerBlock[len(frag):] + endHeaders := len(headerBlock) == 0 + var err error + if first { + first = false + err = ctx.Framer().WriteHeaders(HeadersFrameParam{ + StreamID: w.streamID, + BlockFragment: frag, + EndStream: w.endStream, + EndHeaders: endHeaders, + }) + } else { + err = ctx.Framer().WriteContinuation(w.streamID, endHeaders, frag) + } + if err != nil { + return err + } + } + return nil +} + +type write100ContinueHeadersFrame struct { + streamID uint32 +} + +func (w write100ContinueHeadersFrame) writeFrame(ctx writeContext) error { + enc, buf := ctx.HeaderEncoder() + buf.Reset() + enc.WriteField(hpack.HeaderField{Name: ":status", Value: "100"}) + return ctx.Framer().WriteHeaders(HeadersFrameParam{ + StreamID: w.streamID, + BlockFragment: buf.Bytes(), + EndStream: false, + EndHeaders: true, + }) +} + +type writeWindowUpdate struct { + streamID uint32 // or 0 for conn-level + n uint32 +} + +func (wu writeWindowUpdate) writeFrame(ctx writeContext) error { + return ctx.Framer().WriteWindowUpdate(wu.streamID, wu.n) +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/writesched.go b/Godeps/_workspace/src/github.com/bradfitz/http2/writesched.go new file mode 100644 index 000000000..0e1b7486f --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/writesched.go @@ -0,0 +1,286 @@ +// 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. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +package http2 + +import "fmt" + +// frameWriteMsg is a request to write a frame. +type frameWriteMsg struct { + // write is the interface value that does the writing, once the + // writeScheduler (below) has decided to select this frame + // to write. The write functions are all defined in write.go. + write writeFramer + + stream *stream // used for prioritization. nil for non-stream frames. + + // done, if non-nil, must be a buffered channel with space for + // 1 message and is sent the return value from write (or an + // earlier error) when the frame has been written. + done chan error +} + +// for debugging only: +func (wm frameWriteMsg) String() string { + var streamID uint32 + if wm.stream != nil { + streamID = wm.stream.id + } + var des string + if s, ok := wm.write.(fmt.Stringer); ok { + des = s.String() + } else { + des = fmt.Sprintf("%T", wm.write) + } + return fmt.Sprintf("[frameWriteMsg stream=%d, ch=%v, type: %v]", streamID, wm.done != nil, des) +} + +// writeScheduler tracks pending frames to write, priorities, and decides +// the next one to use. It is not thread-safe. +type writeScheduler struct { + // zero are frames not associated with a specific stream. + // They're sent before any stream-specific freams. + zero writeQueue + + // maxFrameSize is the maximum size of a DATA frame + // we'll write. Must be non-zero and between 16K-16M. + maxFrameSize uint32 + + // sq contains the stream-specific queues, keyed by stream ID. + // when a stream is idle, it's deleted from the map. + sq map[uint32]*writeQueue + + // canSend is a slice of memory that's reused between frame + // scheduling decisions to hold the list of writeQueues (from sq) + // which have enough flow control data to send. After canSend is + // built, the best is selected. + canSend []*writeQueue + + // pool of empty queues for reuse. + queuePool []*writeQueue +} + +func (ws *writeScheduler) putEmptyQueue(q *writeQueue) { + if len(q.s) != 0 { + panic("queue must be empty") + } + ws.queuePool = append(ws.queuePool, q) +} + +func (ws *writeScheduler) getEmptyQueue() *writeQueue { + ln := len(ws.queuePool) + if ln == 0 { + return new(writeQueue) + } + q := ws.queuePool[ln-1] + ws.queuePool = ws.queuePool[:ln-1] + return q +} + +func (ws *writeScheduler) empty() bool { return ws.zero.empty() && len(ws.sq) == 0 } + +func (ws *writeScheduler) add(wm frameWriteMsg) { + st := wm.stream + if st == nil { + ws.zero.push(wm) + } else { + ws.streamQueue(st.id).push(wm) + } +} + +func (ws *writeScheduler) streamQueue(streamID uint32) *writeQueue { + if q, ok := ws.sq[streamID]; ok { + return q + } + if ws.sq == nil { + ws.sq = make(map[uint32]*writeQueue) + } + q := ws.getEmptyQueue() + ws.sq[streamID] = q + return q +} + +// take returns the most important frame to write and removes it from the scheduler. +// It is illegal to call this if the scheduler is empty or if there are no connection-level +// flow control bytes available. +func (ws *writeScheduler) take() (wm frameWriteMsg, ok bool) { + if ws.maxFrameSize == 0 { + panic("internal error: ws.maxFrameSize not initialized or invalid") + } + + // If there any frames not associated with streams, prefer those first. + // These are usually SETTINGS, etc. + if !ws.zero.empty() { + return ws.zero.shift(), true + } + if len(ws.sq) == 0 { + return + } + + // Next, prioritize frames on streams that aren't DATA frames (no cost). + for id, q := range ws.sq { + if q.firstIsNoCost() { + return ws.takeFrom(id, q) + } + } + + // Now, all that remains are DATA frames with non-zero bytes to + // send. So pick the best one. + if len(ws.canSend) != 0 { + panic("should be empty") + } + for _, q := range ws.sq { + if n := ws.streamWritableBytes(q); n > 0 { + ws.canSend = append(ws.canSend, q) + } + } + if len(ws.canSend) == 0 { + return + } + defer ws.zeroCanSend() + + // TODO: find the best queue + q := ws.canSend[0] + + return ws.takeFrom(q.streamID(), q) +} + +// zeroCanSend is defered from take. +func (ws *writeScheduler) zeroCanSend() { + for i := range ws.canSend { + ws.canSend[i] = nil + } + ws.canSend = ws.canSend[:0] +} + +// streamWritableBytes returns the number of DATA bytes we could write +// from the given queue's stream, if this stream/queue were +// selected. It is an error to call this if q's head isn't a +// *writeData. +func (ws *writeScheduler) streamWritableBytes(q *writeQueue) int32 { + wm := q.head() + ret := wm.stream.flow.available() // max we can write + if ret == 0 { + return 0 + } + if int32(ws.maxFrameSize) < ret { + ret = int32(ws.maxFrameSize) + } + if ret == 0 { + panic("internal error: ws.maxFrameSize not initialized or invalid") + } + wd := wm.write.(*writeData) + if len(wd.p) < int(ret) { + ret = int32(len(wd.p)) + } + return ret +} + +func (ws *writeScheduler) takeFrom(id uint32, q *writeQueue) (wm frameWriteMsg, ok bool) { + wm = q.head() + // If the first item in this queue costs flow control tokens + // and we don't have enough, write as much as we can. + if wd, ok := wm.write.(*writeData); ok && len(wd.p) > 0 { + allowed := wm.stream.flow.available() // max we can write + if allowed == 0 { + // No quota available. Caller can try the next stream. + return frameWriteMsg{}, false + } + if int32(ws.maxFrameSize) < allowed { + allowed = int32(ws.maxFrameSize) + } + // TODO: further restrict the allowed size, because even if + // the peer says it's okay to write 16MB data frames, we might + // want to write smaller ones to properly weight competing + // streams' priorities. + + if len(wd.p) > int(allowed) { + wm.stream.flow.take(allowed) + chunk := wd.p[:allowed] + wd.p = wd.p[allowed:] + // Make up a new write message of a valid size, rather + // than shifting one off the queue. + return frameWriteMsg{ + stream: wm.stream, + write: &writeData{ + streamID: wd.streamID, + p: chunk, + // even if the original had endStream set, there + // arebytes remaining because len(wd.p) > allowed, + // so we know endStream is false: + endStream: false, + }, + // our caller is blocking on the final DATA frame, not + // these intermediates, so no need to wait: + done: nil, + }, true + } + wm.stream.flow.take(int32(len(wd.p))) + } + + q.shift() + if q.empty() { + ws.putEmptyQueue(q) + delete(ws.sq, id) + } + return wm, true +} + +func (ws *writeScheduler) forgetStream(id uint32) { + q, ok := ws.sq[id] + if !ok { + return + } + delete(ws.sq, id) + + // But keep it for others later. + for i := range q.s { + q.s[i] = frameWriteMsg{} + } + q.s = q.s[:0] + ws.putEmptyQueue(q) +} + +type writeQueue struct { + s []frameWriteMsg +} + +// streamID returns the stream ID for a non-empty stream-specific queue. +func (q *writeQueue) streamID() uint32 { return q.s[0].stream.id } + +func (q *writeQueue) empty() bool { return len(q.s) == 0 } + +func (q *writeQueue) push(wm frameWriteMsg) { + q.s = append(q.s, wm) +} + +// head returns the next item that would be removed by shift. +func (q *writeQueue) head() frameWriteMsg { + if len(q.s) == 0 { + panic("invalid use of queue") + } + return q.s[0] +} + +func (q *writeQueue) shift() frameWriteMsg { + if len(q.s) == 0 { + panic("invalid use of queue") + } + wm := q.s[0] + // TODO: less copy-happy queue. + copy(q.s, q.s[1:]) + q.s[len(q.s)-1] = frameWriteMsg{} + q.s = q.s[:len(q.s)-1] + return wm +} + +func (q *writeQueue) firstIsNoCost() bool { + if df, ok := q.s[0].write.(*writeData); ok { + return len(df.p) == 0 + } + return true +} diff --git a/Godeps/_workspace/src/github.com/bradfitz/http2/z_spec_test.go b/Godeps/_workspace/src/github.com/bradfitz/http2/z_spec_test.go new file mode 100644 index 000000000..07b53e3ae --- /dev/null +++ b/Godeps/_workspace/src/github.com/bradfitz/http2/z_spec_test.go @@ -0,0 +1,357 @@ +// Copyright 2014 The Go Authors. +// See https://code.google.com/p/go/source/browse/CONTRIBUTORS +// Licensed under the same terms as Go itself: +// https://code.google.com/p/go/source/browse/LICENSE + +package http2 + +import ( + "bytes" + "encoding/xml" + "flag" + "fmt" + "io" + "os" + "reflect" + "regexp" + "sort" + "strconv" + "strings" + "sync" + "testing" +) + +var coverSpec = flag.Bool("coverspec", false, "Run spec coverage tests") + +// The global map of sentence coverage for the http2 spec. +var defaultSpecCoverage specCoverage + +var loadSpecOnce sync.Once + +func loadSpec() { + if f, err := os.Open("testdata/draft-ietf-httpbis-http2.xml"); err != nil { + panic(err) + } else { + defaultSpecCoverage = readSpecCov(f) + f.Close() + } +} + +// covers marks all sentences for section sec in defaultSpecCoverage. Sentences not +// "covered" will be included in report outputed by TestSpecCoverage. +func covers(sec, sentences string) { + loadSpecOnce.Do(loadSpec) + defaultSpecCoverage.cover(sec, sentences) +} + +type specPart struct { + section string + sentence string +} + +func (ss specPart) Less(oo specPart) bool { + atoi := func(s string) int { + n, err := strconv.Atoi(s) + if err != nil { + panic(err) + } + return n + } + a := strings.Split(ss.section, ".") + b := strings.Split(oo.section, ".") + for len(a) > 0 { + if len(b) == 0 { + return false + } + x, y := atoi(a[0]), atoi(b[0]) + if x == y { + a, b = a[1:], b[1:] + continue + } + return x < y + } + if len(b) > 0 { + return true + } + return false +} + +type bySpecSection []specPart + +func (a bySpecSection) Len() int { return len(a) } +func (a bySpecSection) Less(i, j int) bool { return a[i].Less(a[j]) } +func (a bySpecSection) Swap(i, j int) { a[i], a[j] = a[j], a[i] } + +type specCoverage struct { + coverage map[specPart]bool + d *xml.Decoder +} + +func joinSection(sec []int) string { + s := fmt.Sprintf("%d", sec[0]) + for _, n := range sec[1:] { + s = fmt.Sprintf("%s.%d", s, n) + } + return s +} + +func (sc specCoverage) readSection(sec []int) { + var ( + buf = new(bytes.Buffer) + sub = 0 + ) + for { + tk, err := sc.d.Token() + if err != nil { + if err == io.EOF { + return + } + panic(err) + } + switch v := tk.(type) { + case xml.StartElement: + if skipElement(v) { + if err := sc.d.Skip(); err != nil { + panic(err) + } + if v.Name.Local == "section" { + sub++ + } + break + } + switch v.Name.Local { + case "section": + sub++ + sc.readSection(append(sec, sub)) + case "xref": + buf.Write(sc.readXRef(v)) + } + case xml.CharData: + if len(sec) == 0 { + break + } + buf.Write(v) + case xml.EndElement: + if v.Name.Local == "section" { + sc.addSentences(joinSection(sec), buf.String()) + return + } + } + } +} + +func (sc specCoverage) readXRef(se xml.StartElement) []byte { + var b []byte + for { + tk, err := sc.d.Token() + if err != nil { + panic(err) + } + switch v := tk.(type) { + case xml.CharData: + if b != nil { + panic("unexpected CharData") + } + b = []byte(string(v)) + case xml.EndElement: + if v.Name.Local != "xref" { + panic("expected ") + } + if b != nil { + return b + } + sig := attrSig(se) + switch sig { + case "target": + return []byte(fmt.Sprintf("[%s]", attrValue(se, "target"))) + case "fmt-of,rel,target", "fmt-,,rel,target": + return []byte(fmt.Sprintf("[%s, %s]", attrValue(se, "target"), attrValue(se, "rel"))) + case "fmt-of,sec,target", "fmt-,,sec,target": + return []byte(fmt.Sprintf("[section %s of %s]", attrValue(se, "sec"), attrValue(se, "target"))) + case "fmt-of,rel,sec,target": + return []byte(fmt.Sprintf("[section %s of %s, %s]", attrValue(se, "sec"), attrValue(se, "target"), attrValue(se, "rel"))) + default: + panic(fmt.Sprintf("unknown attribute signature %q in %#v", sig, fmt.Sprintf("%#v", se))) + } + default: + panic(fmt.Sprintf("unexpected tag %q", v)) + } + } +} + +var skipAnchor = map[string]bool{ + "intro": true, + "Overview": true, +} + +var skipTitle = map[string]bool{ + "Acknowledgements": true, + "Change Log": true, + "Document Organization": true, + "Conventions and Terminology": true, +} + +func skipElement(s xml.StartElement) bool { + switch s.Name.Local { + case "artwork": + return true + case "section": + for _, attr := range s.Attr { + switch attr.Name.Local { + case "anchor": + if skipAnchor[attr.Value] || strings.HasPrefix(attr.Value, "changes.since.") { + return true + } + case "title": + if skipTitle[attr.Value] { + return true + } + } + } + } + return false +} + +func readSpecCov(r io.Reader) specCoverage { + sc := specCoverage{ + coverage: map[specPart]bool{}, + d: xml.NewDecoder(r)} + sc.readSection(nil) + return sc +} + +func (sc specCoverage) addSentences(sec string, sentence string) { + for _, s := range parseSentences(sentence) { + sc.coverage[specPart{sec, s}] = false + } +} + +func (sc specCoverage) cover(sec string, sentence string) { + for _, s := range parseSentences(sentence) { + p := specPart{sec, s} + if _, ok := sc.coverage[p]; !ok { + panic(fmt.Sprintf("Not found in spec: %q, %q", sec, s)) + } + sc.coverage[specPart{sec, s}] = true + } + +} + +var whitespaceRx = regexp.MustCompile(`\s+`) + +func parseSentences(sens string) []string { + sens = strings.TrimSpace(sens) + if sens == "" { + return nil + } + ss := strings.Split(whitespaceRx.ReplaceAllString(sens, " "), ". ") + for i, s := range ss { + s = strings.TrimSpace(s) + if !strings.HasSuffix(s, ".") { + s += "." + } + ss[i] = s + } + return ss +} + +func TestSpecParseSentences(t *testing.T) { + tests := []struct { + ss string + want []string + }{ + {"Sentence 1. Sentence 2.", + []string{ + "Sentence 1.", + "Sentence 2.", + }}, + {"Sentence 1. \nSentence 2.\tSentence 3.", + []string{ + "Sentence 1.", + "Sentence 2.", + "Sentence 3.", + }}, + } + + for i, tt := range tests { + got := parseSentences(tt.ss) + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("%d: got = %q, want %q", i, got, tt.want) + } + } +} + +func TestSpecCoverage(t *testing.T) { + if !*coverSpec { + t.Skip() + } + + loadSpecOnce.Do(loadSpec) + + var ( + list []specPart + cv = defaultSpecCoverage.coverage + total = len(cv) + complete = 0 + ) + + for sp, touched := range defaultSpecCoverage.coverage { + if touched { + complete++ + } else { + list = append(list, sp) + } + } + sort.Stable(bySpecSection(list)) + + if testing.Short() && len(list) > 5 { + list = list[:5] + } + + for _, p := range list { + t.Errorf("\tSECTION %s: %s", p.section, p.sentence) + } + + t.Logf("%d/%d (%d%%) sentances covered", complete, total, (complete/total)*100) +} + +func attrSig(se xml.StartElement) string { + var names []string + for _, attr := range se.Attr { + if attr.Name.Local == "fmt" { + names = append(names, "fmt-"+attr.Value) + } else { + names = append(names, attr.Name.Local) + } + } + sort.Strings(names) + return strings.Join(names, ",") +} + +func attrValue(se xml.StartElement, attr string) string { + for _, a := range se.Attr { + if a.Name.Local == attr { + return a.Value + } + } + panic("unknown attribute " + attr) +} + +func TestSpecPartLess(t *testing.T) { + tests := []struct { + sec1, sec2 string + want bool + }{ + {"6.2.1", "6.2", false}, + {"6.2", "6.2.1", true}, + {"6.10", "6.10.1", true}, + {"6.10", "6.1.1", false}, // 10, not 1 + {"6.1", "6.1", false}, // equal, so not less + } + for _, tt := range tests { + got := (specPart{tt.sec1, "foo"}).Less(specPart{tt.sec2, "foo"}) + if got != tt.want { + t.Errorf("Less(%q, %q) = %v; want %v", tt.sec1, tt.sec2, got, tt.want) + } + } +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/.gitignore b/Godeps/_workspace/src/github.com/golang/protobuf/.gitignore new file mode 100644 index 000000000..0bf694c97 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/.gitignore @@ -0,0 +1,17 @@ +.DS_Store +*.[568ao] +*.pb.go +*.ao +*.so +*.pyc +._* +.nfs.* +[568a].out +*~ +*.orig +core +_obj +_test +_testmain.go +compiler/protoc-gen-go +compiler/testdata/extension_test diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/AUTHORS b/Godeps/_workspace/src/github.com/golang/protobuf/AUTHORS new file mode 100644 index 000000000..15167cd74 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/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/Godeps/_workspace/src/github.com/golang/protobuf/CONTRIBUTORS b/Godeps/_workspace/src/github.com/golang/protobuf/CONTRIBUTORS new file mode 100644 index 000000000..1c4577e96 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/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/Godeps/_workspace/src/github.com/golang/protobuf/LICENSE b/Godeps/_workspace/src/github.com/golang/protobuf/LICENSE new file mode 100644 index 000000000..1b1b1921e --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/LICENSE @@ -0,0 +1,31 @@ +Go support for Protocol Buffers - Google's data interchange format + +Copyright 2010 The Go Authors. All rights reserved. +https://github.com/golang/protobuf + +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/Godeps/_workspace/src/github.com/golang/protobuf/Make.protobuf b/Godeps/_workspace/src/github.com/golang/protobuf/Make.protobuf new file mode 100644 index 000000000..15071de10 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/Make.protobuf @@ -0,0 +1,40 @@ +# Go support for Protocol Buffers - Google's data interchange format +# +# Copyright 2010 The Go Authors. All rights reserved. +# https://github.com/golang/protobuf +# +# 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. + +# Includable Makefile to add a rule for generating .pb.go files from .proto files +# (Google protocol buffer descriptions). +# Typical use if myproto.proto is a file in package mypackage in this directory: +# +# include $(GOROOT)/src/pkg/github.com/golang/protobuf/Make.protobuf + +%.pb.go: %.proto + protoc --go_out=. $< + diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/Makefile b/Godeps/_workspace/src/github.com/golang/protobuf/Makefile new file mode 100644 index 000000000..43b94999e --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/Makefile @@ -0,0 +1,55 @@ +# Go support for Protocol Buffers - Google's data interchange format +# +# Copyright 2010 The Go Authors. All rights reserved. +# https://github.com/golang/protobuf +# +# 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. + + +all: install + +install: + go install ./proto + go install ./jsonpb + go install ./protoc-gen-go + +test: + go test ./proto + go test ./jsonpb + make -C protoc-gen-go/testdata test + +clean: + go clean ./... + +nuke: + go clean -i ./... + +regenerate: + make -C protoc-gen-go/descriptor regenerate + make -C protoc-gen-go/plugin regenerate + make -C proto/testdata regenerate + make -C jsonpb/jsonpb_test_proto regenerate diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/README b/Godeps/_workspace/src/github.com/golang/protobuf/README new file mode 100644 index 000000000..6579bd08f --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/README @@ -0,0 +1,158 @@ +Go support for Protocol Buffers - Google's data interchange format +Copyright 2010 The Go Authors. +https://github.com/golang/protobuf + +This package and the code it generates requires at least Go 1.2. + +This software implements Go bindings for protocol buffers. For +information about protocol buffers themselves, see + https://developers.google.com/protocol-buffers/ +To use this software, you must first install the standard C++ +implementation of protocol buffers from + https://developers.google.com/protocol-buffers/ +And of course you must also install the Go compiler and tools from + https://golang.org/ +See + https://golang.org/doc/install +for details or, if you are using gccgo, follow the instructions at + https://golang.org/doc/install/gccgo + +This software has two parts: a 'protocol compiler plugin' that +generates Go source files that, once compiled, can access and manage +protocol buffers; and a library that implements run-time support for +encoding (marshaling), decoding (unmarshaling), and accessing protocol +buffers. + +There is support for gRPC in Go using protocol buffers. +See the note at the bottom of this file for details. + +There are no insertion points in the plugin. + +To install this code: + +The simplest way is to run go get. + + # Grab the code from the repository and install the proto package. + go get -u github.com/golang/protobuf/{proto,protoc-gen-go} + +The compiler plugin, protoc-gen-go, will be installed in $GOBIN, +defaulting to $GOPATH/bin. It must be in your $PATH for the protocol +compiler, protoc, to find it. + +Once the software is installed, there are two steps to using it. +First you must compile the protocol buffer definitions and then import +them, with the support library, into your program. + +To compile the protocol buffer definition, run protoc with the --go_out +parameter set to the directory you want to output the Go code to. + + protoc --go_out=. *.proto + +The generated files will be suffixed .pb.go. See the Test code below +for an example using such a file. + + +The package comment for the proto library contains text describing +the interface provided in Go for protocol buffers. Here is an edited +version. + +========== + +The proto package converts data structures to and from the +wire format of protocol buffers. It works in concert with the +Go source code generated for .proto files by the protocol compiler. + +A summary of the properties of the protocol buffer interface +for a protocol buffer variable v: + + - Names are turned from camel_case to CamelCase for export. + - There are no methods on v to set fields; just treat + them as structure fields. + - There are getters that return a field's value if set, + and return the field's default value if unset. + The getters work even if the receiver is a nil message. + - The zero value for a struct is its correct initialization state. + All desired fields must be set before marshaling. + - A Reset() method will restore a protobuf struct to its zero state. + - Non-repeated fields are pointers to the values; nil means unset. + That is, optional or required field int32 f becomes F *int32. + - Repeated fields are slices. + - Helper functions are available to aid the setting of fields. + Helpers for getting values are superseded by the + GetFoo methods and their use is deprecated. + msg.Foo = proto.String("hello") // set field + - Constants are defined to hold the default values of all fields that + have them. They have the form Default_StructName_FieldName. + Because the getter methods handle defaulted values, + direct use of these constants should be rare. + - Enums are given type names and maps from names to values. + Enum values are prefixed with the enum's type name. Enum types have + a String method, and a Enum method to assist in message construction. + - Nested groups and enums have type names prefixed with the name of + the surrounding message type. + - Extensions are given descriptor names that start with E_, + followed by an underscore-delimited list of the nested messages + that contain it (if any) followed by the CamelCased name of the + extension field itself. HasExtension, ClearExtension, GetExtension + and SetExtension are functions for manipulating extensions. + - Marshal and Unmarshal are functions to encode and decode the wire format. + +Consider file test.proto, containing + + package example; + + enum FOO { X = 17; }; + + message Test { + required string label = 1; + optional int32 type = 2 [default=77]; + repeated int64 reps = 3; + optional group OptionalGroup = 4 { + required string RequiredField = 5; + } + } + +To create and play with a Test object from the example package, + + package main + + import ( + "log" + + "github.com/golang/protobuf/proto" + "path/to/example" + ) + + func main() { + test := &example.Test { + Label: proto.String("hello"), + Type: proto.Int32(17), + Optionalgroup: &example.Test_OptionalGroup { + RequiredField: proto.String("good bye"), + }, + } + data, err := proto.Marshal(test) + if err != nil { + log.Fatal("marshaling error: ", err) + } + newTest := &example.Test{} + err = proto.Unmarshal(data, newTest) + if err != nil { + log.Fatal("unmarshaling error: ", err) + } + // Now test and newTest contain the same data. + if test.GetLabel() != newTest.GetLabel() { + log.Fatalf("data mismatch %q != %q", test.GetLabel(), newTest.GetLabel()) + } + // etc. + } + + +gRPC Support +============ +If a proto file specifies RPC services, protoc-gen-go can be instructed to +generate code compatible with gRPC (http://www.grpc.io/). To do this, pass +the `plugins` parameter to protoc-gen-go; the usual way is to insert it into +the --go_out argument to protoc: + + protoc --go_out=plugins=grpc:. *.proto diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/jsonpb/jsonpb.go b/Godeps/_workspace/src/github.com/golang/protobuf/jsonpb/jsonpb.go new file mode 100644 index 000000000..f3e53d4a6 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/jsonpb/jsonpb.go @@ -0,0 +1,429 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2015 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +/* +Package jsonpb provides marshalling/unmarshalling functionality between +protocol buffer and JSON objects. + +Compared to encoding/json, this library: + - encodes int64, uint64 as strings + - optionally encodes enums as strings +*/ +package jsonpb + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + "reflect" + "sort" + "strconv" + "strings" + + "github.com/golang/protobuf/proto" +) + +var ( + byteArrayType = reflect.TypeOf([]byte{}) +) + +// Marshaller is a configurable object for converting between +// protocol buffer objects and a JSON representation for them +type Marshaller struct { + // Use string values for enums (as opposed to integer values) + EnumsAsString bool + + // A string to indent each level by. The presence of this field will + // also cause a space to appear between the field separator and + // value, and for newlines to be appear between fields and array + // elements. + Indent string +} + +// Marshal marshals a protocol buffer into JSON. +func (m *Marshaller) Marshal(out io.Writer, pb proto.Message) error { + writer := &errWriter{writer: out} + return m.marshalObject(writer, pb, "") +} + +// MarshalToString converts a protocol buffer object to JSON string. +func (m *Marshaller) MarshalToString(pb proto.Message) (string, error) { + var buf bytes.Buffer + if err := m.Marshal(&buf, pb); err != nil { + return "", err + } + return buf.String(), nil +} + +// marshalObject writes a struct to the Writer. +func (m *Marshaller) marshalObject(out *errWriter, v proto.Message, indent string) error { + out.write("{") + if m.Indent != "" { + out.write("\n") + } + + s := reflect.ValueOf(v).Elem() + writeBeforeField := "" + for i := 0; i < s.NumField(); i++ { + value := s.Field(i) + valueField := s.Type().Field(i) + fieldName, omitFieldIfNil := parseFieldOptions(valueField) + + // Fields which should not be serialized will specify a json tag with '-' + // TODO: proto3 objects should have default values omitted. + if fieldName == "-" { + continue + } else if omitFieldIfNil { + // IsNil will panic on most value kinds. + skip := false + switch value.Kind() { + case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: + skip = value.IsNil() + } + if skip { + continue + } + } + + out.write(writeBeforeField) + if m.Indent != "" { + out.write(indent) + out.write(m.Indent) + } + out.write(`"`) + out.write(fieldName) + out.write(`":`) + if m.Indent != "" { + out.write(" ") + } + + if err := m.marshalValue(out, value, valueField, indent); err != nil { + return err + } + + if m.Indent != "" { + writeBeforeField = ",\n" + } else { + writeBeforeField = "," + } + } + + if m.Indent != "" { + out.write("\n") + out.write(indent) + } + out.write("}") + return out.err +} + +// marshalValue writes the value to the Writer. +func (m *Marshaller) marshalValue(out *errWriter, v reflect.Value, + structField reflect.StructField, indent string) error { + + var err error + v = reflect.Indirect(v) + + // Handle repeated elements. + if v.Type() != byteArrayType && v.Kind() == reflect.Slice { + out.write("[") + comma := "" + for i := 0; i < v.Len(); i++ { + sliceVal := v.Index(i) + out.write(comma) + if m.Indent != "" { + out.write("\n") + out.write(indent) + out.write(m.Indent) + out.write(m.Indent) + } + m.marshalValue(out, sliceVal, structField, indent+m.Indent) + comma = "," + } + if m.Indent != "" { + out.write("\n") + out.write(indent) + out.write(m.Indent) + } + out.write("]") + return out.err + } + + // Handle enumerations. + protoInfo := structField.Tag.Get("protobuf") + if m.EnumsAsString && strings.Contains(protoInfo, ",enum=") { + // Unknown enum values will are stringified by the proto library as their + // value. Such values should _not_ be quoted or they will be intrepreted + // as an enum string instead of their value. + enumStr := v.Interface().(fmt.Stringer).String() + var valStr string + if v.Kind() == reflect.Ptr { + valStr = strconv.Itoa(int(v.Elem().Int())) + } else { + valStr = strconv.Itoa(int(v.Int())) + } + isKnownEnum := enumStr != valStr + if isKnownEnum { + out.write(`"`) + } + out.write(enumStr) + if isKnownEnum { + out.write(`"`) + } + return out.err + } + + // Handle nested messages. + if v.Kind() == reflect.Struct { + return m.marshalObject(out, v.Addr().Interface().(proto.Message), indent+m.Indent) + } + + // Handle maps. + // NOTE: Since Go randomizes map iteration, we sort keys for stable output. + if v.Kind() == reflect.Map { + out.write(`{`) + keys := v.MapKeys() + sort.Sort(mapKeys(keys)) + for i, k := range keys { + if i > 0 { + out.write(`,`) + } + if m.Indent != "" { + out.write("\n") + out.write(indent) + out.write(m.Indent) + out.write(m.Indent) + } + + b, err := json.Marshal(k.Interface()) + if err != nil { + return err + } + s := string(b) + + // If the JSON is not a string value, encode it again to make it one. + if !strings.HasPrefix(s, `"`) { + b, err := json.Marshal(s) + if err != nil { + return err + } + s = string(b) + } + + out.write(s) + out.write(`:`) + if m.Indent != "" { + out.write(` `) + } + + if err := m.marshalValue(out, v.MapIndex(k), structField, indent+m.Indent); err != nil { + return err + } + } + if m.Indent != "" { + out.write("\n") + out.write(indent) + out.write(m.Indent) + } + out.write(`}`) + return out.err + } + + // Default handling defers to the encoding/json library. + b, err := json.Marshal(v.Interface()) + if err != nil { + return err + } + needToQuote := string(b[0]) != `"` && (v.Kind() == reflect.Int64 || v.Kind() == reflect.Uint64) + if needToQuote { + out.write(`"`) + } + out.write(string(b)) + if needToQuote { + out.write(`"`) + } + return out.err +} + +// Unmarshal unmarshals a JSON object stream into a protocol +// buffer. This function is lenient and will decode any options +// permutations of the related Marshaller. +func Unmarshal(r io.Reader, pb proto.Message) error { + inputValue := json.RawMessage{} + if err := json.NewDecoder(r).Decode(&inputValue); err != nil { + return err + } + return unmarshalValue(reflect.ValueOf(pb).Elem(), inputValue) +} + +// UnmarshalString will populate the fields of a protocol buffer based +// on a JSON string. This function is lenient and will decode any options +// permutations of the related Marshaller. +func UnmarshalString(str string, pb proto.Message) error { + return Unmarshal(bytes.NewReader([]byte(str)), pb) +} + +// unmarshalValue converts/copies a value into the target. +func unmarshalValue(target reflect.Value, inputValue json.RawMessage) error { + targetType := target.Type() + + // Allocate memory for pointer fields. + if targetType.Kind() == reflect.Ptr { + target.Set(reflect.New(targetType.Elem())) + return unmarshalValue(target.Elem(), inputValue) + } + + // Handle nested messages. + if targetType.Kind() == reflect.Struct { + var jsonFields map[string]json.RawMessage + if err := json.Unmarshal(inputValue, &jsonFields); err != nil { + return err + } + + for i := 0; i < target.NumField(); i++ { + fieldName, _ := parseFieldOptions(target.Type().Field(i)) + + // Fields which should not be serialized will specify a json tag with '-' + if fieldName == "-" { + continue + } + + if valueForField, ok := jsonFields[fieldName]; ok { + if err := unmarshalValue(target.Field(i), valueForField); err != nil { + return err + } + } + } + return nil + } + + // Handle arrays (which aren't encoded bytes) + if targetType != byteArrayType && targetType.Kind() == reflect.Slice { + var slc []json.RawMessage + if err := json.Unmarshal(inputValue, &slc); err != nil { + return err + } + len := len(slc) + target.Set(reflect.MakeSlice(targetType, len, len)) + for i := 0; i < len; i++ { + if err := unmarshalValue(target.Index(i), slc[i]); err != nil { + return err + } + } + return nil + } + + // Handle maps (whose keys are always strings) + if targetType.Kind() == reflect.Map { + var mp map[string]json.RawMessage + if err := json.Unmarshal(inputValue, &mp); err != nil { + return err + } + target.Set(reflect.MakeMap(targetType)) + for ks, raw := range mp { + // Unmarshal map key. The core json library already decoded the key into a + // string, so we handle that specially. Other types were quoted post-serialization. + var k reflect.Value + if targetType.Key().Kind() == reflect.String { + k = reflect.ValueOf(ks) + } else { + k = reflect.New(targetType.Key()).Elem() + if err := unmarshalValue(k, json.RawMessage(ks)); err != nil { + return err + } + } + + // Unmarshal map value. + v := reflect.New(targetType.Elem()).Elem() + if err := unmarshalValue(v, raw); err != nil { + return err + } + target.SetMapIndex(k, v) + } + return nil + } + + // 64-bit integers can be encoded as strings. In this case we drop + // the quotes and proceed as normal. + isNum := targetType.Kind() == reflect.Int64 || targetType.Kind() == reflect.Uint64 + if isNum && strings.HasPrefix(string(inputValue), `"`) { + inputValue = inputValue[1 : len(inputValue)-1] + } + + // Use the encoding/json for parsing other value types. + return json.Unmarshal(inputValue, target.Addr().Interface()) +} + +// hasUnmarshalJSON is a interface implemented by protocol buffer enums. +type hasUnmarshalJSON interface { + UnmarshalJSON(data []byte) error +} + +// parseFieldOptions returns the field name and if it should be omited. +func parseFieldOptions(f reflect.StructField) (string, bool) { + name := f.Name + omitEmpty := false + tag := f.Tag.Get("json") + tagParts := strings.Split(tag, ",") + for i := range tagParts { + if tagParts[i] == "omitempty" || tagParts[i] == "" { + omitEmpty = true + } else { + name = tagParts[i] + } + } + return name, omitEmpty +} + +// Writer wrapper inspired by https://blog.golang.org/errors-are-values +type errWriter struct { + writer io.Writer + err error +} + +func (w *errWriter) write(str string) { + if w.err != nil { + return + } + _, w.err = w.writer.Write([]byte(str)) +} + +// Map fields may have key types of non-float scalars, strings and enums. +// The easiest way to sort them in some deterministic order is to use fmt. +// If this turns out to be inefficient we can always consider other options, +// such as doing a Schwartzian transform. +type mapKeys []reflect.Value + +func (s mapKeys) Len() int { return len(s) } +func (s mapKeys) Swap(i, j int) { s[i], s[j] = s[j], s[i] } +func (s mapKeys) Less(i, j int) bool { + return fmt.Sprint(s[i].Interface()) < fmt.Sprint(s[j].Interface()) +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/jsonpb/jsonpb_test.go b/Godeps/_workspace/src/github.com/golang/protobuf/jsonpb/jsonpb_test.go new file mode 100644 index 000000000..fe8cd3f6f --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/jsonpb/jsonpb_test.go @@ -0,0 +1,367 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2015 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +package jsonpb + +import ( + "testing" + + pb "github.com/golang/protobuf/jsonpb/jsonpb_test_proto" + "github.com/golang/protobuf/proto" +) + +var ( + marshaller = Marshaller{} + + marshallerAllOptions = Marshaller{ + EnumsAsString: true, + Indent: " ", + } + + simpleObject = &pb.Simple{ + OInt32: proto.Int32(-32), + OInt64: proto.Int64(-6400000000), + OUint32: proto.Uint32(32), + OUint64: proto.Uint64(6400000000), + OSint32: proto.Int32(-13), + OSint64: proto.Int64(-2600000000), + OFloat: proto.Float32(3.14), + ODouble: proto.Float64(6.02214179e23), + OBool: proto.Bool(true), + OString: proto.String("hello \"there\""), + OBytes: []byte("beep boop"), + } + + simpleObjectJSON = `{` + + `"o_bool":true,` + + `"o_int32":-32,` + + `"o_int64":"-6400000000",` + + `"o_uint32":32,` + + `"o_uint64":"6400000000",` + + `"o_sint32":-13,` + + `"o_sint64":"-2600000000",` + + `"o_float":3.14,` + + `"o_double":6.02214179e+23,` + + `"o_string":"hello \"there\"",` + + `"o_bytes":"YmVlcCBib29w"` + + `}` + + simpleObjectPrettyJSON = `{ + "o_bool": true, + "o_int32": -32, + "o_int64": "-6400000000", + "o_uint32": 32, + "o_uint64": "6400000000", + "o_sint32": -13, + "o_sint64": "-2600000000", + "o_float": 3.14, + "o_double": 6.02214179e+23, + "o_string": "hello \"there\"", + "o_bytes": "YmVlcCBib29w" +}` + + repeatsObject = &pb.Repeats{ + RBool: []bool{true, false, true}, + RInt32: []int32{-3, -4, -5}, + RInt64: []int64{-123456789, -987654321}, + RUint32: []uint32{1, 2, 3}, + RUint64: []uint64{6789012345, 3456789012}, + RSint32: []int32{-1, -2, -3}, + RSint64: []int64{-6789012345, -3456789012}, + RFloat: []float32{3.14, 6.28}, + RDouble: []float64{299792458, 6.62606957e-34}, + RString: []string{"happy", "days"}, + RBytes: [][]byte{[]byte("skittles"), []byte("m&m's")}, + } + + repeatsObjectJSON = `{` + + `"r_bool":[true,false,true],` + + `"r_int32":[-3,-4,-5],` + + `"r_int64":["-123456789","-987654321"],` + + `"r_uint32":[1,2,3],` + + `"r_uint64":["6789012345","3456789012"],` + + `"r_sint32":[-1,-2,-3],` + + `"r_sint64":["-6789012345","-3456789012"],` + + `"r_float":[3.14,6.28],` + + `"r_double":[2.99792458e+08,6.62606957e-34],` + + `"r_string":["happy","days"],` + + `"r_bytes":["c2tpdHRsZXM=","bSZtJ3M="]` + + `}` + + repeatsObjectPrettyJSON = `{ + "r_bool": [ + true, + false, + true + ], + "r_int32": [ + -3, + -4, + -5 + ], + "r_int64": [ + "-123456789", + "-987654321" + ], + "r_uint32": [ + 1, + 2, + 3 + ], + "r_uint64": [ + "6789012345", + "3456789012" + ], + "r_sint32": [ + -1, + -2, + -3 + ], + "r_sint64": [ + "-6789012345", + "-3456789012" + ], + "r_float": [ + 3.14, + 6.28 + ], + "r_double": [ + 2.99792458e+08, + 6.62606957e-34 + ], + "r_string": [ + "happy", + "days" + ], + "r_bytes": [ + "c2tpdHRsZXM=", + "bSZtJ3M=" + ] +}` + + innerSimple = &pb.Simple{OInt32: proto.Int32(-32)} + innerSimple2 = &pb.Simple{OInt64: proto.Int64(25)} + innerRepeats = &pb.Repeats{RString: []string{"roses", "red"}} + innerRepeats2 = &pb.Repeats{RString: []string{"violets", "blue"}} + complexObject = &pb.Widget{ + Color: pb.Widget_GREEN.Enum(), + RColor: []pb.Widget_Color{pb.Widget_RED, pb.Widget_GREEN, pb.Widget_BLUE}, + Simple: innerSimple, + RSimple: []*pb.Simple{innerSimple, innerSimple2}, + Repeats: innerRepeats, + RRepeats: []*pb.Repeats{innerRepeats, innerRepeats2}, + } + + complexObjectJSON = `{"color":1,` + + `"r_color":[0,1,2],` + + `"simple":{"o_int32":-32},` + + `"r_simple":[{"o_int32":-32},{"o_int64":"25"}],` + + `"repeats":{"r_string":["roses","red"]},` + + `"r_repeats":[{"r_string":["roses","red"]},{"r_string":["violets","blue"]}]` + + `}` + + complexObjectPrettyJSON = `{ + "color": "GREEN", + "r_color": [ + "RED", + "GREEN", + "BLUE" + ], + "simple": { + "o_int32": -32 + }, + "r_simple": [ + { + "o_int32": -32 + }, + { + "o_int64": "25" + } + ], + "repeats": { + "r_string": [ + "roses", + "red" + ] + }, + "r_repeats": [ + { + "r_string": [ + "roses", + "red" + ] + }, + { + "r_string": [ + "violets", + "blue" + ] + } + ] +}` + + colorPrettyJSON = `{ + "color": 2 +}` + + colorListPrettyJSON = `{ + "color": 1000, + "r_color": [ + "RED" + ] +}` + + nummyPrettyJSON = `{ + "nummy": { + "1": 2, + "3": 4 + } +}` + + objjyPrettyJSON = `{ + "objjy": { + "1": { + "dub": 1 + } + } +}` +) + +var marshallingTests = []struct { + desc string + marshaller Marshaller + pb proto.Message + json string +}{ + {"simple flat object", marshaller, simpleObject, simpleObjectJSON}, + {"simple pretty object", marshallerAllOptions, simpleObject, simpleObjectPrettyJSON}, + {"repeated fields flat object", marshaller, repeatsObject, repeatsObjectJSON}, + {"repeated fields pretty object", marshallerAllOptions, repeatsObject, repeatsObjectPrettyJSON}, + {"nested message/enum flat object", marshaller, complexObject, complexObjectJSON}, + {"nested message/enum pretty object", marshallerAllOptions, complexObject, complexObjectPrettyJSON}, + {"enum-string flat object", Marshaller{EnumsAsString: true}, + &pb.Widget{Color: pb.Widget_BLUE.Enum()}, `{"color":"BLUE"}`}, + {"enum-value pretty object", Marshaller{Indent: " "}, + &pb.Widget{Color: pb.Widget_BLUE.Enum()}, colorPrettyJSON}, + {"unknown enum value object", marshallerAllOptions, + &pb.Widget{Color: pb.Widget_Color(1000).Enum(), RColor: []pb.Widget_Color{pb.Widget_RED}}, colorListPrettyJSON}, + {"proto3 object with empty value", marshaller, &pb.Simple3{}, `{"dub":0}`}, + {"map", marshaller, &pb.Mappy{Nummy: map[int64]int32{1: 2, 3: 4}}, `{"nummy":{"1":2,"3":4}}`}, + {"map", marshallerAllOptions, &pb.Mappy{Nummy: map[int64]int32{1: 2, 3: 4}}, nummyPrettyJSON}, + {"map", marshaller, + &pb.Mappy{Strry: map[string]string{`"one"`: "two", "three": "four"}}, + `{"strry":{"\"one\"":"two","three":"four"}}`}, + {"map", marshaller, + &pb.Mappy{Objjy: map[int32]*pb.Simple3{1: &pb.Simple3{Dub: 1}}}, `{"objjy":{"1":{"dub":1}}}`}, + {"map", marshallerAllOptions, + &pb.Mappy{Objjy: map[int32]*pb.Simple3{1: &pb.Simple3{Dub: 1}}}, objjyPrettyJSON}, + {"map", marshaller, &pb.Mappy{Buggy: map[int64]string{1234: "yup"}}, + `{"buggy":{"1234":"yup"}}`}, + {"map", marshaller, &pb.Mappy{Booly: map[bool]bool{false: true}}, `{"booly":{"false":true}}`}, + {"proto2 map", marshaller, &pb.Maps{MInt64Str: map[int64]string{213: "cat"}}, + `{"m_int64_str":{"213":"cat"}}`}, + {"proto2 map", marshaller, + &pb.Maps{MBoolSimple: map[bool]*pb.Simple{true: &pb.Simple{OInt32: proto.Int32(1)}}}, + `{"m_bool_simple":{"true":{"o_int32":1}}}`}, +} + +func TestMarshalling(t *testing.T) { + for _, tt := range marshallingTests { + json, err := tt.marshaller.MarshalToString(tt.pb) + if err != nil { + t.Errorf("%s: marshalling error: %v", tt.desc, err) + } else if tt.json != json { + t.Errorf("%s: got [%v] want [%v]", tt.desc, json, tt.json) + } + } +} + +var unmarshallingTests = []struct { + desc string + json string + pb proto.Message +}{ + {"simple flat object", simpleObjectJSON, simpleObject}, + {"simple pretty object", simpleObjectPrettyJSON, simpleObject}, + {"repeated fields flat object", repeatsObjectJSON, repeatsObject}, + {"repeated fields pretty object", repeatsObjectPrettyJSON, repeatsObject}, + {"nested message/enum flat object", complexObjectJSON, complexObject}, + {"nested message/enum pretty object", complexObjectPrettyJSON, complexObject}, + {"enum-string object", `{"color":"BLUE"}`, &pb.Widget{Color: pb.Widget_BLUE.Enum()}}, + {"enum-value object", "{\n \"color\": 2\n}", &pb.Widget{Color: pb.Widget_BLUE.Enum()}}, + {"unknown enum value object", + "{\n \"color\": 1000,\n \"r_color\": [\n \"RED\"\n ]\n}", + &pb.Widget{Color: pb.Widget_Color(1000).Enum(), RColor: []pb.Widget_Color{pb.Widget_RED}}}, + {"unquoted int64 object", `{"o_int64":-314}`, &pb.Simple{OInt64: proto.Int64(-314)}}, + {"unquoted uint64 object", `{"o_uint64":123}`, &pb.Simple{OUint64: proto.Uint64(123)}}, + {"map", `{"nummy":{"1":2,"3":4}}`, &pb.Mappy{Nummy: map[int64]int32{1: 2, 3: 4}}}, + {"map", `{"strry":{"\"one\"":"two","three":"four"}}`, &pb.Mappy{Strry: map[string]string{`"one"`: "two", "three": "four"}}}, + {"map", `{"objjy":{"1":{"dub":1}}}`, &pb.Mappy{Objjy: map[int32]*pb.Simple3{1: &pb.Simple3{Dub: 1}}}}, +} + +func TestUnmarshalling(t *testing.T) { + for _, tt := range unmarshallingTests { + // Make a new instance of the type of our expected object. + p := proto.Clone(tt.pb) + p.Reset() + + err := UnmarshalString(tt.json, p) + if err != nil { + t.Error(err) + continue + } + + // For easier diffs, compare text strings of the protos. + exp := proto.MarshalTextString(tt.pb) + act := proto.MarshalTextString(p) + if string(exp) != string(act) { + t.Errorf("%s: got [%s] want [%s]", tt.desc, act, exp) + } + } +} + +var unmarshallingShouldError = []struct { + desc string + in string +}{ + {"a value", "666"}, + {"gibberish", "{adskja123;l23=-="}, +} + +func TestUnmarshallingBadInput(t *testing.T) { + for _, tt := range unmarshallingShouldError { + obj := &pb.Simple{} + err := UnmarshalString(tt.in, obj) + if err == nil { + t.Errorf("an error was expected when parsing %q instead of an object", tt.desc) + } + } +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/Makefile b/Godeps/_workspace/src/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/Makefile new file mode 100644 index 000000000..e53e6a690 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/Makefile @@ -0,0 +1,33 @@ +# Go support for Protocol Buffers - Google's data interchange format +# +# Copyright 2015 The Go Authors. All rights reserved. +# https://github.com/golang/protobuf +# +# 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. + +regenerate: + protoc --go_out=. *.proto diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/more_test_objects.proto b/Godeps/_workspace/src/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/more_test_objects.proto new file mode 100644 index 000000000..653579163 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/more_test_objects.proto @@ -0,0 +1,46 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2015 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +syntax = "proto3"; + +package jsonpb; + +message Simple3 { + double dub = 1; +} + +message Mappy { + map nummy = 1; + map strry = 2; + map objjy = 3; + map buggy = 4; + map booly = 5; +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/test_objects.proto b/Godeps/_workspace/src/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/test_objects.proto new file mode 100644 index 000000000..e48a3e889 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/jsonpb/jsonpb_test_proto/test_objects.proto @@ -0,0 +1,86 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2015 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +syntax = "proto2"; + +package jsonpb; + +// Test message for holding primitive types. +message Simple { + optional bool o_bool = 1; + optional int32 o_int32 = 2; + optional int64 o_int64 = 3; + optional uint32 o_uint32 = 4; + optional uint64 o_uint64 = 5; + optional sint32 o_sint32 = 6; + optional sint64 o_sint64 = 7; + optional float o_float = 8; + optional double o_double = 9; + optional string o_string = 10; + optional bytes o_bytes = 11; +} + +// Test message for holding repeated primitives. +message Repeats { + repeated bool r_bool = 1; + repeated int32 r_int32 = 2; + repeated int64 r_int64 = 3; + repeated uint32 r_uint32 = 4; + repeated uint64 r_uint64 = 5; + repeated sint32 r_sint32 = 6; + repeated sint64 r_sint64 = 7; + repeated float r_float = 8; + repeated double r_double = 9; + repeated string r_string = 10; + repeated bytes r_bytes = 11; +} + +// Test message for holding enums and nested messages. +message Widget { + enum Color { + RED = 0; + GREEN = 1; + BLUE = 2; + }; + optional Color color = 1; + repeated Color r_color = 2; + + optional Simple simple = 10; + repeated Simple r_simple = 11; + + optional Repeats repeats = 20; + repeated Repeats r_repeats = 21; +} + +message Maps { + map m_int64_str = 1; + map m_bool_simple = 2; +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/Makefile b/Godeps/_workspace/src/github.com/golang/protobuf/proto/Makefile new file mode 100644 index 000000000..f1f06564a --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/Makefile @@ -0,0 +1,43 @@ +# Go support for Protocol Buffers - Google's data interchange format +# +# Copyright 2010 The Go Authors. All rights reserved. +# https://github.com/golang/protobuf +# +# 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. + +install: + go install + +test: install generate-test-pbs + go test + + +generate-test-pbs: + make install + make -C testdata + protoc --go_out=Mtestdata/test.proto=github.com/golang/protobuf/proto/testdata:. proto3_proto/proto3.proto + make diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/all_test.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/all_test.go new file mode 100644 index 000000000..5a9b6a47f --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/all_test.go @@ -0,0 +1,2083 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2010 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +package proto_test + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "math" + "math/rand" + "reflect" + "runtime/debug" + "strings" + "testing" + "time" + + . "github.com/golang/protobuf/proto" + . "github.com/golang/protobuf/proto/testdata" +) + +var globalO *Buffer + +func old() *Buffer { + if globalO == nil { + globalO = NewBuffer(nil) + } + globalO.Reset() + return globalO +} + +func equalbytes(b1, b2 []byte, t *testing.T) { + if len(b1) != len(b2) { + t.Errorf("wrong lengths: 2*%d != %d", len(b1), len(b2)) + return + } + for i := 0; i < len(b1); i++ { + if b1[i] != b2[i] { + t.Errorf("bad byte[%d]:%x %x: %s %s", i, b1[i], b2[i], b1, b2) + } + } +} + +func initGoTestField() *GoTestField { + f := new(GoTestField) + f.Label = String("label") + f.Type = String("type") + return f +} + +// These are all structurally equivalent but the tag numbers differ. +// (It's remarkable that required, optional, and repeated all have +// 8 letters.) +func initGoTest_RequiredGroup() *GoTest_RequiredGroup { + return &GoTest_RequiredGroup{ + RequiredField: String("required"), + } +} + +func initGoTest_OptionalGroup() *GoTest_OptionalGroup { + return &GoTest_OptionalGroup{ + RequiredField: String("optional"), + } +} + +func initGoTest_RepeatedGroup() *GoTest_RepeatedGroup { + return &GoTest_RepeatedGroup{ + RequiredField: String("repeated"), + } +} + +func initGoTest(setdefaults bool) *GoTest { + pb := new(GoTest) + if setdefaults { + pb.F_BoolDefaulted = Bool(Default_GoTest_F_BoolDefaulted) + pb.F_Int32Defaulted = Int32(Default_GoTest_F_Int32Defaulted) + pb.F_Int64Defaulted = Int64(Default_GoTest_F_Int64Defaulted) + pb.F_Fixed32Defaulted = Uint32(Default_GoTest_F_Fixed32Defaulted) + pb.F_Fixed64Defaulted = Uint64(Default_GoTest_F_Fixed64Defaulted) + pb.F_Uint32Defaulted = Uint32(Default_GoTest_F_Uint32Defaulted) + pb.F_Uint64Defaulted = Uint64(Default_GoTest_F_Uint64Defaulted) + pb.F_FloatDefaulted = Float32(Default_GoTest_F_FloatDefaulted) + pb.F_DoubleDefaulted = Float64(Default_GoTest_F_DoubleDefaulted) + pb.F_StringDefaulted = String(Default_GoTest_F_StringDefaulted) + pb.F_BytesDefaulted = Default_GoTest_F_BytesDefaulted + pb.F_Sint32Defaulted = Int32(Default_GoTest_F_Sint32Defaulted) + pb.F_Sint64Defaulted = Int64(Default_GoTest_F_Sint64Defaulted) + } + + pb.Kind = GoTest_TIME.Enum() + pb.RequiredField = initGoTestField() + pb.F_BoolRequired = Bool(true) + pb.F_Int32Required = Int32(3) + pb.F_Int64Required = Int64(6) + pb.F_Fixed32Required = Uint32(32) + pb.F_Fixed64Required = Uint64(64) + pb.F_Uint32Required = Uint32(3232) + pb.F_Uint64Required = Uint64(6464) + pb.F_FloatRequired = Float32(3232) + pb.F_DoubleRequired = Float64(6464) + pb.F_StringRequired = String("string") + pb.F_BytesRequired = []byte("bytes") + pb.F_Sint32Required = Int32(-32) + pb.F_Sint64Required = Int64(-64) + pb.Requiredgroup = initGoTest_RequiredGroup() + + return pb +} + +func fail(msg string, b *bytes.Buffer, s string, t *testing.T) { + data := b.Bytes() + ld := len(data) + ls := len(s) / 2 + + fmt.Printf("fail %s ld=%d ls=%d\n", msg, ld, ls) + + // find the interesting spot - n + n := ls + if ld < ls { + n = ld + } + j := 0 + for i := 0; i < n; i++ { + bs := hex(s[j])*16 + hex(s[j+1]) + j += 2 + if data[i] == bs { + continue + } + n = i + break + } + l := n - 10 + if l < 0 { + l = 0 + } + h := n + 10 + + // find the interesting spot - n + fmt.Printf("is[%d]:", l) + for i := l; i < h; i++ { + if i >= ld { + fmt.Printf(" --") + continue + } + fmt.Printf(" %.2x", data[i]) + } + fmt.Printf("\n") + + fmt.Printf("sb[%d]:", l) + for i := l; i < h; i++ { + if i >= ls { + fmt.Printf(" --") + continue + } + bs := hex(s[j])*16 + hex(s[j+1]) + j += 2 + fmt.Printf(" %.2x", bs) + } + fmt.Printf("\n") + + t.Fail() + + // t.Errorf("%s: \ngood: %s\nbad: %x", msg, s, b.Bytes()) + // Print the output in a partially-decoded format; can + // be helpful when updating the test. It produces the output + // that is pasted, with minor edits, into the argument to verify(). + // data := b.Bytes() + // nesting := 0 + // for b.Len() > 0 { + // start := len(data) - b.Len() + // var u uint64 + // u, err := DecodeVarint(b) + // if err != nil { + // fmt.Printf("decode error on varint:", err) + // return + // } + // wire := u & 0x7 + // tag := u >> 3 + // switch wire { + // case WireVarint: + // v, err := DecodeVarint(b) + // if err != nil { + // fmt.Printf("decode error on varint:", err) + // return + // } + // fmt.Printf("\t\t\"%x\" // field %d, encoding %d, value %d\n", + // data[start:len(data)-b.Len()], tag, wire, v) + // case WireFixed32: + // v, err := DecodeFixed32(b) + // if err != nil { + // fmt.Printf("decode error on fixed32:", err) + // return + // } + // fmt.Printf("\t\t\"%x\" // field %d, encoding %d, value %d\n", + // data[start:len(data)-b.Len()], tag, wire, v) + // case WireFixed64: + // v, err := DecodeFixed64(b) + // if err != nil { + // fmt.Printf("decode error on fixed64:", err) + // return + // } + // fmt.Printf("\t\t\"%x\" // field %d, encoding %d, value %d\n", + // data[start:len(data)-b.Len()], tag, wire, v) + // case WireBytes: + // nb, err := DecodeVarint(b) + // if err != nil { + // fmt.Printf("decode error on bytes:", err) + // return + // } + // after_tag := len(data) - b.Len() + // str := make([]byte, nb) + // _, err = b.Read(str) + // if err != nil { + // fmt.Printf("decode error on bytes:", err) + // return + // } + // fmt.Printf("\t\t\"%x\" \"%x\" // field %d, encoding %d (FIELD)\n", + // data[start:after_tag], str, tag, wire) + // case WireStartGroup: + // nesting++ + // fmt.Printf("\t\t\"%x\"\t\t// start group field %d level %d\n", + // data[start:len(data)-b.Len()], tag, nesting) + // case WireEndGroup: + // fmt.Printf("\t\t\"%x\"\t\t// end group field %d level %d\n", + // data[start:len(data)-b.Len()], tag, nesting) + // nesting-- + // default: + // fmt.Printf("unrecognized wire type %d\n", wire) + // return + // } + // } +} + +func hex(c uint8) uint8 { + if '0' <= c && c <= '9' { + return c - '0' + } + if 'a' <= c && c <= 'f' { + return 10 + c - 'a' + } + if 'A' <= c && c <= 'F' { + return 10 + c - 'A' + } + return 0 +} + +func equal(b []byte, s string, t *testing.T) bool { + if 2*len(b) != len(s) { + // fail(fmt.Sprintf("wrong lengths: 2*%d != %d", len(b), len(s)), b, s, t) + fmt.Printf("wrong lengths: 2*%d != %d\n", len(b), len(s)) + return false + } + for i, j := 0, 0; i < len(b); i, j = i+1, j+2 { + x := hex(s[j])*16 + hex(s[j+1]) + if b[i] != x { + // fail(fmt.Sprintf("bad byte[%d]:%x %x", i, b[i], x), b, s, t) + fmt.Printf("bad byte[%d]:%x %x", i, b[i], x) + return false + } + } + return true +} + +func overify(t *testing.T, pb *GoTest, expected string) { + o := old() + err := o.Marshal(pb) + if err != nil { + fmt.Printf("overify marshal-1 err = %v", err) + o.DebugPrint("", o.Bytes()) + t.Fatalf("expected = %s", expected) + } + if !equal(o.Bytes(), expected, t) { + o.DebugPrint("overify neq 1", o.Bytes()) + t.Fatalf("expected = %s", expected) + } + + // Now test Unmarshal by recreating the original buffer. + pbd := new(GoTest) + err = o.Unmarshal(pbd) + if err != nil { + t.Fatalf("overify unmarshal err = %v", err) + o.DebugPrint("", o.Bytes()) + t.Fatalf("string = %s", expected) + } + o.Reset() + err = o.Marshal(pbd) + if err != nil { + t.Errorf("overify marshal-2 err = %v", err) + o.DebugPrint("", o.Bytes()) + t.Fatalf("string = %s", expected) + } + if !equal(o.Bytes(), expected, t) { + o.DebugPrint("overify neq 2", o.Bytes()) + t.Fatalf("string = %s", expected) + } +} + +// Simple tests for numeric encode/decode primitives (varint, etc.) +func TestNumericPrimitives(t *testing.T) { + for i := uint64(0); i < 1e6; i += 111 { + o := old() + if o.EncodeVarint(i) != nil { + t.Error("EncodeVarint") + break + } + x, e := o.DecodeVarint() + if e != nil { + t.Fatal("DecodeVarint") + } + if x != i { + t.Fatal("varint decode fail:", i, x) + } + + o = old() + if o.EncodeFixed32(i) != nil { + t.Fatal("encFixed32") + } + x, e = o.DecodeFixed32() + if e != nil { + t.Fatal("decFixed32") + } + if x != i { + t.Fatal("fixed32 decode fail:", i, x) + } + + o = old() + if o.EncodeFixed64(i*1234567) != nil { + t.Error("encFixed64") + break + } + x, e = o.DecodeFixed64() + if e != nil { + t.Error("decFixed64") + break + } + if x != i*1234567 { + t.Error("fixed64 decode fail:", i*1234567, x) + break + } + + o = old() + i32 := int32(i - 12345) + if o.EncodeZigzag32(uint64(i32)) != nil { + t.Fatal("EncodeZigzag32") + } + x, e = o.DecodeZigzag32() + if e != nil { + t.Fatal("DecodeZigzag32") + } + if x != uint64(uint32(i32)) { + t.Fatal("zigzag32 decode fail:", i32, x) + } + + o = old() + i64 := int64(i - 12345) + if o.EncodeZigzag64(uint64(i64)) != nil { + t.Fatal("EncodeZigzag64") + } + x, e = o.DecodeZigzag64() + if e != nil { + t.Fatal("DecodeZigzag64") + } + if x != uint64(i64) { + t.Fatal("zigzag64 decode fail:", i64, x) + } + } +} + +// fakeMarshaler is a simple struct implementing Marshaler and Message interfaces. +type fakeMarshaler struct { + b []byte + err error +} + +func (f fakeMarshaler) Marshal() ([]byte, error) { + return f.b, f.err +} + +func (f fakeMarshaler) String() string { + return fmt.Sprintf("Bytes: %v Error: %v", f.b, f.err) +} + +func (f fakeMarshaler) ProtoMessage() {} + +func (f fakeMarshaler) Reset() {} + +// Simple tests for proto messages that implement the Marshaler interface. +func TestMarshalerEncoding(t *testing.T) { + tests := []struct { + name string + m Message + want []byte + wantErr error + }{ + { + name: "Marshaler that fails", + m: fakeMarshaler{ + err: errors.New("some marshal err"), + b: []byte{5, 6, 7}, + }, + // Since there's an error, nothing should be written to buffer. + want: nil, + wantErr: errors.New("some marshal err"), + }, + { + name: "Marshaler that succeeds", + m: fakeMarshaler{ + b: []byte{0, 1, 2, 3, 4, 127, 255}, + }, + want: []byte{0, 1, 2, 3, 4, 127, 255}, + wantErr: nil, + }, + } + for _, test := range tests { + b := NewBuffer(nil) + err := b.Marshal(test.m) + if !reflect.DeepEqual(test.wantErr, err) { + t.Errorf("%s: got err %v wanted %v", test.name, err, test.wantErr) + } + if !reflect.DeepEqual(test.want, b.Bytes()) { + t.Errorf("%s: got bytes %v wanted %v", test.name, b.Bytes(), test.want) + } + } +} + +// Simple tests for bytes +func TestBytesPrimitives(t *testing.T) { + o := old() + bytes := []byte{'n', 'o', 'w', ' ', 'i', 's', ' ', 't', 'h', 'e', ' ', 't', 'i', 'm', 'e'} + if o.EncodeRawBytes(bytes) != nil { + t.Error("EncodeRawBytes") + } + decb, e := o.DecodeRawBytes(false) + if e != nil { + t.Error("DecodeRawBytes") + } + equalbytes(bytes, decb, t) +} + +// Simple tests for strings +func TestStringPrimitives(t *testing.T) { + o := old() + s := "now is the time" + if o.EncodeStringBytes(s) != nil { + t.Error("enc_string") + } + decs, e := o.DecodeStringBytes() + if e != nil { + t.Error("dec_string") + } + if s != decs { + t.Error("string encode/decode fail:", s, decs) + } +} + +// Do we catch the "required bit not set" case? +func TestRequiredBit(t *testing.T) { + o := old() + pb := new(GoTest) + err := o.Marshal(pb) + if err == nil { + t.Error("did not catch missing required fields") + } else if strings.Index(err.Error(), "Kind") < 0 { + t.Error("wrong error type:", err) + } +} + +// Check that all fields are nil. +// Clearly silly, and a residue from a more interesting test with an earlier, +// different initialization property, but it once caught a compiler bug so +// it lives. +func checkInitialized(pb *GoTest, t *testing.T) { + if pb.F_BoolDefaulted != nil { + t.Error("New or Reset did not set boolean:", *pb.F_BoolDefaulted) + } + if pb.F_Int32Defaulted != nil { + t.Error("New or Reset did not set int32:", *pb.F_Int32Defaulted) + } + if pb.F_Int64Defaulted != nil { + t.Error("New or Reset did not set int64:", *pb.F_Int64Defaulted) + } + if pb.F_Fixed32Defaulted != nil { + t.Error("New or Reset did not set fixed32:", *pb.F_Fixed32Defaulted) + } + if pb.F_Fixed64Defaulted != nil { + t.Error("New or Reset did not set fixed64:", *pb.F_Fixed64Defaulted) + } + if pb.F_Uint32Defaulted != nil { + t.Error("New or Reset did not set uint32:", *pb.F_Uint32Defaulted) + } + if pb.F_Uint64Defaulted != nil { + t.Error("New or Reset did not set uint64:", *pb.F_Uint64Defaulted) + } + if pb.F_FloatDefaulted != nil { + t.Error("New or Reset did not set float:", *pb.F_FloatDefaulted) + } + if pb.F_DoubleDefaulted != nil { + t.Error("New or Reset did not set double:", *pb.F_DoubleDefaulted) + } + if pb.F_StringDefaulted != nil { + t.Error("New or Reset did not set string:", *pb.F_StringDefaulted) + } + if pb.F_BytesDefaulted != nil { + t.Error("New or Reset did not set bytes:", string(pb.F_BytesDefaulted)) + } + if pb.F_Sint32Defaulted != nil { + t.Error("New or Reset did not set int32:", *pb.F_Sint32Defaulted) + } + if pb.F_Sint64Defaulted != nil { + t.Error("New or Reset did not set int64:", *pb.F_Sint64Defaulted) + } +} + +// Does Reset() reset? +func TestReset(t *testing.T) { + pb := initGoTest(true) + // muck with some values + pb.F_BoolDefaulted = Bool(false) + pb.F_Int32Defaulted = Int32(237) + pb.F_Int64Defaulted = Int64(12346) + pb.F_Fixed32Defaulted = Uint32(32000) + pb.F_Fixed64Defaulted = Uint64(666) + pb.F_Uint32Defaulted = Uint32(323232) + pb.F_Uint64Defaulted = nil + pb.F_FloatDefaulted = nil + pb.F_DoubleDefaulted = Float64(0) + pb.F_StringDefaulted = String("gotcha") + pb.F_BytesDefaulted = []byte("asdfasdf") + pb.F_Sint32Defaulted = Int32(123) + pb.F_Sint64Defaulted = Int64(789) + pb.Reset() + checkInitialized(pb, t) +} + +// All required fields set, no defaults provided. +func TestEncodeDecode1(t *testing.T) { + pb := initGoTest(false) + overify(t, pb, + "0807"+ // field 1, encoding 0, value 7 + "220d"+"0a056c6162656c120474797065"+ // field 4, encoding 2 (GoTestField) + "5001"+ // field 10, encoding 0, value 1 + "5803"+ // field 11, encoding 0, value 3 + "6006"+ // field 12, encoding 0, value 6 + "6d20000000"+ // field 13, encoding 5, value 0x20 + "714000000000000000"+ // field 14, encoding 1, value 0x40 + "78a019"+ // field 15, encoding 0, value 0xca0 = 3232 + "8001c032"+ // field 16, encoding 0, value 0x1940 = 6464 + "8d0100004a45"+ // field 17, encoding 5, value 3232.0 + "9101000000000040b940"+ // field 18, encoding 1, value 6464.0 + "9a0106"+"737472696e67"+ // field 19, encoding 2, string "string" + "b304"+ // field 70, encoding 3, start group + "ba0408"+"7265717569726564"+ // field 71, encoding 2, string "required" + "b404"+ // field 70, encoding 4, end group + "aa0605"+"6279746573"+ // field 101, encoding 2, string "bytes" + "b0063f"+ // field 102, encoding 0, 0x3f zigzag32 + "b8067f") // field 103, encoding 0, 0x7f zigzag64 +} + +// All required fields set, defaults provided. +func TestEncodeDecode2(t *testing.T) { + pb := initGoTest(true) + overify(t, pb, + "0807"+ // field 1, encoding 0, value 7 + "220d"+"0a056c6162656c120474797065"+ // field 4, encoding 2 (GoTestField) + "5001"+ // field 10, encoding 0, value 1 + "5803"+ // field 11, encoding 0, value 3 + "6006"+ // field 12, encoding 0, value 6 + "6d20000000"+ // field 13, encoding 5, value 32 + "714000000000000000"+ // field 14, encoding 1, value 64 + "78a019"+ // field 15, encoding 0, value 3232 + "8001c032"+ // field 16, encoding 0, value 6464 + "8d0100004a45"+ // field 17, encoding 5, value 3232.0 + "9101000000000040b940"+ // field 18, encoding 1, value 6464.0 + "9a0106"+"737472696e67"+ // field 19, encoding 2 string "string" + "c00201"+ // field 40, encoding 0, value 1 + "c80220"+ // field 41, encoding 0, value 32 + "d00240"+ // field 42, encoding 0, value 64 + "dd0240010000"+ // field 43, encoding 5, value 320 + "e1028002000000000000"+ // field 44, encoding 1, value 640 + "e8028019"+ // field 45, encoding 0, value 3200 + "f0028032"+ // field 46, encoding 0, value 6400 + "fd02e0659948"+ // field 47, encoding 5, value 314159.0 + "81030000000050971041"+ // field 48, encoding 1, value 271828.0 + "8a0310"+"68656c6c6f2c2022776f726c6421220a"+ // field 49, encoding 2 string "hello, \"world!\"\n" + "b304"+ // start group field 70 level 1 + "ba0408"+"7265717569726564"+ // field 71, encoding 2, string "required" + "b404"+ // end group field 70 level 1 + "aa0605"+"6279746573"+ // field 101, encoding 2 string "bytes" + "b0063f"+ // field 102, encoding 0, 0x3f zigzag32 + "b8067f"+ // field 103, encoding 0, 0x7f zigzag64 + "8a1907"+"4269676e6f7365"+ // field 401, encoding 2, string "Bignose" + "90193f"+ // field 402, encoding 0, value 63 + "98197f") // field 403, encoding 0, value 127 + +} + +// All default fields set to their default value by hand +func TestEncodeDecode3(t *testing.T) { + pb := initGoTest(false) + pb.F_BoolDefaulted = Bool(true) + pb.F_Int32Defaulted = Int32(32) + pb.F_Int64Defaulted = Int64(64) + pb.F_Fixed32Defaulted = Uint32(320) + pb.F_Fixed64Defaulted = Uint64(640) + pb.F_Uint32Defaulted = Uint32(3200) + pb.F_Uint64Defaulted = Uint64(6400) + pb.F_FloatDefaulted = Float32(314159) + pb.F_DoubleDefaulted = Float64(271828) + pb.F_StringDefaulted = String("hello, \"world!\"\n") + pb.F_BytesDefaulted = []byte("Bignose") + pb.F_Sint32Defaulted = Int32(-32) + pb.F_Sint64Defaulted = Int64(-64) + + overify(t, pb, + "0807"+ // field 1, encoding 0, value 7 + "220d"+"0a056c6162656c120474797065"+ // field 4, encoding 2 (GoTestField) + "5001"+ // field 10, encoding 0, value 1 + "5803"+ // field 11, encoding 0, value 3 + "6006"+ // field 12, encoding 0, value 6 + "6d20000000"+ // field 13, encoding 5, value 32 + "714000000000000000"+ // field 14, encoding 1, value 64 + "78a019"+ // field 15, encoding 0, value 3232 + "8001c032"+ // field 16, encoding 0, value 6464 + "8d0100004a45"+ // field 17, encoding 5, value 3232.0 + "9101000000000040b940"+ // field 18, encoding 1, value 6464.0 + "9a0106"+"737472696e67"+ // field 19, encoding 2 string "string" + "c00201"+ // field 40, encoding 0, value 1 + "c80220"+ // field 41, encoding 0, value 32 + "d00240"+ // field 42, encoding 0, value 64 + "dd0240010000"+ // field 43, encoding 5, value 320 + "e1028002000000000000"+ // field 44, encoding 1, value 640 + "e8028019"+ // field 45, encoding 0, value 3200 + "f0028032"+ // field 46, encoding 0, value 6400 + "fd02e0659948"+ // field 47, encoding 5, value 314159.0 + "81030000000050971041"+ // field 48, encoding 1, value 271828.0 + "8a0310"+"68656c6c6f2c2022776f726c6421220a"+ // field 49, encoding 2 string "hello, \"world!\"\n" + "b304"+ // start group field 70 level 1 + "ba0408"+"7265717569726564"+ // field 71, encoding 2, string "required" + "b404"+ // end group field 70 level 1 + "aa0605"+"6279746573"+ // field 101, encoding 2 string "bytes" + "b0063f"+ // field 102, encoding 0, 0x3f zigzag32 + "b8067f"+ // field 103, encoding 0, 0x7f zigzag64 + "8a1907"+"4269676e6f7365"+ // field 401, encoding 2, string "Bignose" + "90193f"+ // field 402, encoding 0, value 63 + "98197f") // field 403, encoding 0, value 127 + +} + +// All required fields set, defaults provided, all non-defaulted optional fields have values. +func TestEncodeDecode4(t *testing.T) { + pb := initGoTest(true) + pb.Table = String("hello") + pb.Param = Int32(7) + pb.OptionalField = initGoTestField() + pb.F_BoolOptional = Bool(true) + pb.F_Int32Optional = Int32(32) + pb.F_Int64Optional = Int64(64) + pb.F_Fixed32Optional = Uint32(3232) + pb.F_Fixed64Optional = Uint64(6464) + pb.F_Uint32Optional = Uint32(323232) + pb.F_Uint64Optional = Uint64(646464) + pb.F_FloatOptional = Float32(32.) + pb.F_DoubleOptional = Float64(64.) + pb.F_StringOptional = String("hello") + pb.F_BytesOptional = []byte("Bignose") + pb.F_Sint32Optional = Int32(-32) + pb.F_Sint64Optional = Int64(-64) + pb.Optionalgroup = initGoTest_OptionalGroup() + + overify(t, pb, + "0807"+ // field 1, encoding 0, value 7 + "1205"+"68656c6c6f"+ // field 2, encoding 2, string "hello" + "1807"+ // field 3, encoding 0, value 7 + "220d"+"0a056c6162656c120474797065"+ // field 4, encoding 2 (GoTestField) + "320d"+"0a056c6162656c120474797065"+ // field 6, encoding 2 (GoTestField) + "5001"+ // field 10, encoding 0, value 1 + "5803"+ // field 11, encoding 0, value 3 + "6006"+ // field 12, encoding 0, value 6 + "6d20000000"+ // field 13, encoding 5, value 32 + "714000000000000000"+ // field 14, encoding 1, value 64 + "78a019"+ // field 15, encoding 0, value 3232 + "8001c032"+ // field 16, encoding 0, value 6464 + "8d0100004a45"+ // field 17, encoding 5, value 3232.0 + "9101000000000040b940"+ // field 18, encoding 1, value 6464.0 + "9a0106"+"737472696e67"+ // field 19, encoding 2 string "string" + "f00101"+ // field 30, encoding 0, value 1 + "f80120"+ // field 31, encoding 0, value 32 + "800240"+ // field 32, encoding 0, value 64 + "8d02a00c0000"+ // field 33, encoding 5, value 3232 + "91024019000000000000"+ // field 34, encoding 1, value 6464 + "9802a0dd13"+ // field 35, encoding 0, value 323232 + "a002c0ba27"+ // field 36, encoding 0, value 646464 + "ad0200000042"+ // field 37, encoding 5, value 32.0 + "b1020000000000005040"+ // field 38, encoding 1, value 64.0 + "ba0205"+"68656c6c6f"+ // field 39, encoding 2, string "hello" + "c00201"+ // field 40, encoding 0, value 1 + "c80220"+ // field 41, encoding 0, value 32 + "d00240"+ // field 42, encoding 0, value 64 + "dd0240010000"+ // field 43, encoding 5, value 320 + "e1028002000000000000"+ // field 44, encoding 1, value 640 + "e8028019"+ // field 45, encoding 0, value 3200 + "f0028032"+ // field 46, encoding 0, value 6400 + "fd02e0659948"+ // field 47, encoding 5, value 314159.0 + "81030000000050971041"+ // field 48, encoding 1, value 271828.0 + "8a0310"+"68656c6c6f2c2022776f726c6421220a"+ // field 49, encoding 2 string "hello, \"world!\"\n" + "b304"+ // start group field 70 level 1 + "ba0408"+"7265717569726564"+ // field 71, encoding 2, string "required" + "b404"+ // end group field 70 level 1 + "d305"+ // start group field 90 level 1 + "da0508"+"6f7074696f6e616c"+ // field 91, encoding 2, string "optional" + "d405"+ // end group field 90 level 1 + "aa0605"+"6279746573"+ // field 101, encoding 2 string "bytes" + "b0063f"+ // field 102, encoding 0, 0x3f zigzag32 + "b8067f"+ // field 103, encoding 0, 0x7f zigzag64 + "ea1207"+"4269676e6f7365"+ // field 301, encoding 2, string "Bignose" + "f0123f"+ // field 302, encoding 0, value 63 + "f8127f"+ // field 303, encoding 0, value 127 + "8a1907"+"4269676e6f7365"+ // field 401, encoding 2, string "Bignose" + "90193f"+ // field 402, encoding 0, value 63 + "98197f") // field 403, encoding 0, value 127 + +} + +// All required fields set, defaults provided, all repeated fields given two values. +func TestEncodeDecode5(t *testing.T) { + pb := initGoTest(true) + pb.RepeatedField = []*GoTestField{initGoTestField(), initGoTestField()} + pb.F_BoolRepeated = []bool{false, true} + pb.F_Int32Repeated = []int32{32, 33} + pb.F_Int64Repeated = []int64{64, 65} + pb.F_Fixed32Repeated = []uint32{3232, 3333} + pb.F_Fixed64Repeated = []uint64{6464, 6565} + pb.F_Uint32Repeated = []uint32{323232, 333333} + pb.F_Uint64Repeated = []uint64{646464, 656565} + pb.F_FloatRepeated = []float32{32., 33.} + pb.F_DoubleRepeated = []float64{64., 65.} + pb.F_StringRepeated = []string{"hello", "sailor"} + pb.F_BytesRepeated = [][]byte{[]byte("big"), []byte("nose")} + pb.F_Sint32Repeated = []int32{32, -32} + pb.F_Sint64Repeated = []int64{64, -64} + pb.Repeatedgroup = []*GoTest_RepeatedGroup{initGoTest_RepeatedGroup(), initGoTest_RepeatedGroup()} + + overify(t, pb, + "0807"+ // field 1, encoding 0, value 7 + "220d"+"0a056c6162656c120474797065"+ // field 4, encoding 2 (GoTestField) + "2a0d"+"0a056c6162656c120474797065"+ // field 5, encoding 2 (GoTestField) + "2a0d"+"0a056c6162656c120474797065"+ // field 5, encoding 2 (GoTestField) + "5001"+ // field 10, encoding 0, value 1 + "5803"+ // field 11, encoding 0, value 3 + "6006"+ // field 12, encoding 0, value 6 + "6d20000000"+ // field 13, encoding 5, value 32 + "714000000000000000"+ // field 14, encoding 1, value 64 + "78a019"+ // field 15, encoding 0, value 3232 + "8001c032"+ // field 16, encoding 0, value 6464 + "8d0100004a45"+ // field 17, encoding 5, value 3232.0 + "9101000000000040b940"+ // field 18, encoding 1, value 6464.0 + "9a0106"+"737472696e67"+ // field 19, encoding 2 string "string" + "a00100"+ // field 20, encoding 0, value 0 + "a00101"+ // field 20, encoding 0, value 1 + "a80120"+ // field 21, encoding 0, value 32 + "a80121"+ // field 21, encoding 0, value 33 + "b00140"+ // field 22, encoding 0, value 64 + "b00141"+ // field 22, encoding 0, value 65 + "bd01a00c0000"+ // field 23, encoding 5, value 3232 + "bd01050d0000"+ // field 23, encoding 5, value 3333 + "c1014019000000000000"+ // field 24, encoding 1, value 6464 + "c101a519000000000000"+ // field 24, encoding 1, value 6565 + "c801a0dd13"+ // field 25, encoding 0, value 323232 + "c80195ac14"+ // field 25, encoding 0, value 333333 + "d001c0ba27"+ // field 26, encoding 0, value 646464 + "d001b58928"+ // field 26, encoding 0, value 656565 + "dd0100000042"+ // field 27, encoding 5, value 32.0 + "dd0100000442"+ // field 27, encoding 5, value 33.0 + "e1010000000000005040"+ // field 28, encoding 1, value 64.0 + "e1010000000000405040"+ // field 28, encoding 1, value 65.0 + "ea0105"+"68656c6c6f"+ // field 29, encoding 2, string "hello" + "ea0106"+"7361696c6f72"+ // field 29, encoding 2, string "sailor" + "c00201"+ // field 40, encoding 0, value 1 + "c80220"+ // field 41, encoding 0, value 32 + "d00240"+ // field 42, encoding 0, value 64 + "dd0240010000"+ // field 43, encoding 5, value 320 + "e1028002000000000000"+ // field 44, encoding 1, value 640 + "e8028019"+ // field 45, encoding 0, value 3200 + "f0028032"+ // field 46, encoding 0, value 6400 + "fd02e0659948"+ // field 47, encoding 5, value 314159.0 + "81030000000050971041"+ // field 48, encoding 1, value 271828.0 + "8a0310"+"68656c6c6f2c2022776f726c6421220a"+ // field 49, encoding 2 string "hello, \"world!\"\n" + "b304"+ // start group field 70 level 1 + "ba0408"+"7265717569726564"+ // field 71, encoding 2, string "required" + "b404"+ // end group field 70 level 1 + "8305"+ // start group field 80 level 1 + "8a0508"+"7265706561746564"+ // field 81, encoding 2, string "repeated" + "8405"+ // end group field 80 level 1 + "8305"+ // start group field 80 level 1 + "8a0508"+"7265706561746564"+ // field 81, encoding 2, string "repeated" + "8405"+ // end group field 80 level 1 + "aa0605"+"6279746573"+ // field 101, encoding 2 string "bytes" + "b0063f"+ // field 102, encoding 0, 0x3f zigzag32 + "b8067f"+ // field 103, encoding 0, 0x7f zigzag64 + "ca0c03"+"626967"+ // field 201, encoding 2, string "big" + "ca0c04"+"6e6f7365"+ // field 201, encoding 2, string "nose" + "d00c40"+ // field 202, encoding 0, value 32 + "d00c3f"+ // field 202, encoding 0, value -32 + "d80c8001"+ // field 203, encoding 0, value 64 + "d80c7f"+ // field 203, encoding 0, value -64 + "8a1907"+"4269676e6f7365"+ // field 401, encoding 2, string "Bignose" + "90193f"+ // field 402, encoding 0, value 63 + "98197f") // field 403, encoding 0, value 127 + +} + +// All required fields set, all packed repeated fields given two values. +func TestEncodeDecode6(t *testing.T) { + pb := initGoTest(false) + pb.F_BoolRepeatedPacked = []bool{false, true} + pb.F_Int32RepeatedPacked = []int32{32, 33} + pb.F_Int64RepeatedPacked = []int64{64, 65} + pb.F_Fixed32RepeatedPacked = []uint32{3232, 3333} + pb.F_Fixed64RepeatedPacked = []uint64{6464, 6565} + pb.F_Uint32RepeatedPacked = []uint32{323232, 333333} + pb.F_Uint64RepeatedPacked = []uint64{646464, 656565} + pb.F_FloatRepeatedPacked = []float32{32., 33.} + pb.F_DoubleRepeatedPacked = []float64{64., 65.} + pb.F_Sint32RepeatedPacked = []int32{32, -32} + pb.F_Sint64RepeatedPacked = []int64{64, -64} + + overify(t, pb, + "0807"+ // field 1, encoding 0, value 7 + "220d"+"0a056c6162656c120474797065"+ // field 4, encoding 2 (GoTestField) + "5001"+ // field 10, encoding 0, value 1 + "5803"+ // field 11, encoding 0, value 3 + "6006"+ // field 12, encoding 0, value 6 + "6d20000000"+ // field 13, encoding 5, value 32 + "714000000000000000"+ // field 14, encoding 1, value 64 + "78a019"+ // field 15, encoding 0, value 3232 + "8001c032"+ // field 16, encoding 0, value 6464 + "8d0100004a45"+ // field 17, encoding 5, value 3232.0 + "9101000000000040b940"+ // field 18, encoding 1, value 6464.0 + "9a0106"+"737472696e67"+ // field 19, encoding 2 string "string" + "9203020001"+ // field 50, encoding 2, 2 bytes, value 0, value 1 + "9a03022021"+ // field 51, encoding 2, 2 bytes, value 32, value 33 + "a203024041"+ // field 52, encoding 2, 2 bytes, value 64, value 65 + "aa0308"+ // field 53, encoding 2, 8 bytes + "a00c0000050d0000"+ // value 3232, value 3333 + "b20310"+ // field 54, encoding 2, 16 bytes + "4019000000000000a519000000000000"+ // value 6464, value 6565 + "ba0306"+ // field 55, encoding 2, 6 bytes + "a0dd1395ac14"+ // value 323232, value 333333 + "c20306"+ // field 56, encoding 2, 6 bytes + "c0ba27b58928"+ // value 646464, value 656565 + "ca0308"+ // field 57, encoding 2, 8 bytes + "0000004200000442"+ // value 32.0, value 33.0 + "d20310"+ // field 58, encoding 2, 16 bytes + "00000000000050400000000000405040"+ // value 64.0, value 65.0 + "b304"+ // start group field 70 level 1 + "ba0408"+"7265717569726564"+ // field 71, encoding 2, string "required" + "b404"+ // end group field 70 level 1 + "aa0605"+"6279746573"+ // field 101, encoding 2 string "bytes" + "b0063f"+ // field 102, encoding 0, 0x3f zigzag32 + "b8067f"+ // field 103, encoding 0, 0x7f zigzag64 + "b21f02"+ // field 502, encoding 2, 2 bytes + "403f"+ // value 32, value -32 + "ba1f03"+ // field 503, encoding 2, 3 bytes + "80017f") // value 64, value -64 +} + +// Test that we can encode empty bytes fields. +func TestEncodeDecodeBytes1(t *testing.T) { + pb := initGoTest(false) + + // Create our bytes + pb.F_BytesRequired = []byte{} + pb.F_BytesRepeated = [][]byte{{}} + pb.F_BytesOptional = []byte{} + + d, err := Marshal(pb) + if err != nil { + t.Error(err) + } + + pbd := new(GoTest) + if err := Unmarshal(d, pbd); err != nil { + t.Error(err) + } + + if pbd.F_BytesRequired == nil || len(pbd.F_BytesRequired) != 0 { + t.Error("required empty bytes field is incorrect") + } + if pbd.F_BytesRepeated == nil || len(pbd.F_BytesRepeated) == 1 && pbd.F_BytesRepeated[0] == nil { + t.Error("repeated empty bytes field is incorrect") + } + if pbd.F_BytesOptional == nil || len(pbd.F_BytesOptional) != 0 { + t.Error("optional empty bytes field is incorrect") + } +} + +// Test that we encode nil-valued fields of a repeated bytes field correctly. +// Since entries in a repeated field cannot be nil, nil must mean empty value. +func TestEncodeDecodeBytes2(t *testing.T) { + pb := initGoTest(false) + + // Create our bytes + pb.F_BytesRepeated = [][]byte{nil} + + d, err := Marshal(pb) + if err != nil { + t.Error(err) + } + + pbd := new(GoTest) + if err := Unmarshal(d, pbd); err != nil { + t.Error(err) + } + + if len(pbd.F_BytesRepeated) != 1 || pbd.F_BytesRepeated[0] == nil { + t.Error("Unexpected value for repeated bytes field") + } +} + +// All required fields set, defaults provided, all repeated fields given two values. +func TestSkippingUnrecognizedFields(t *testing.T) { + o := old() + pb := initGoTestField() + + // Marshal it normally. + o.Marshal(pb) + + // Now new a GoSkipTest record. + skip := &GoSkipTest{ + SkipInt32: Int32(32), + SkipFixed32: Uint32(3232), + SkipFixed64: Uint64(6464), + SkipString: String("skipper"), + Skipgroup: &GoSkipTest_SkipGroup{ + GroupInt32: Int32(75), + GroupString: String("wxyz"), + }, + } + + // Marshal it into same buffer. + o.Marshal(skip) + + pbd := new(GoTestField) + o.Unmarshal(pbd) + + // The __unrecognized field should be a marshaling of GoSkipTest + skipd := new(GoSkipTest) + + o.SetBuf(pbd.XXX_unrecognized) + o.Unmarshal(skipd) + + if *skipd.SkipInt32 != *skip.SkipInt32 { + t.Error("skip int32", skipd.SkipInt32) + } + if *skipd.SkipFixed32 != *skip.SkipFixed32 { + t.Error("skip fixed32", skipd.SkipFixed32) + } + if *skipd.SkipFixed64 != *skip.SkipFixed64 { + t.Error("skip fixed64", skipd.SkipFixed64) + } + if *skipd.SkipString != *skip.SkipString { + t.Error("skip string", *skipd.SkipString) + } + if *skipd.Skipgroup.GroupInt32 != *skip.Skipgroup.GroupInt32 { + t.Error("skip group int32", skipd.Skipgroup.GroupInt32) + } + if *skipd.Skipgroup.GroupString != *skip.Skipgroup.GroupString { + t.Error("skip group string", *skipd.Skipgroup.GroupString) + } +} + +// Check that unrecognized fields of a submessage are preserved. +func TestSubmessageUnrecognizedFields(t *testing.T) { + nm := &NewMessage{ + Nested: &NewMessage_Nested{ + Name: String("Nigel"), + FoodGroup: String("carbs"), + }, + } + b, err := Marshal(nm) + if err != nil { + t.Fatalf("Marshal of NewMessage: %v", err) + } + + // Unmarshal into an OldMessage. + om := new(OldMessage) + if err := Unmarshal(b, om); err != nil { + t.Fatalf("Unmarshal to OldMessage: %v", err) + } + exp := &OldMessage{ + Nested: &OldMessage_Nested{ + Name: String("Nigel"), + // normal protocol buffer users should not do this + XXX_unrecognized: []byte("\x12\x05carbs"), + }, + } + if !Equal(om, exp) { + t.Errorf("om = %v, want %v", om, exp) + } + + // Clone the OldMessage. + om = Clone(om).(*OldMessage) + if !Equal(om, exp) { + t.Errorf("Clone(om) = %v, want %v", om, exp) + } + + // Marshal the OldMessage, then unmarshal it into an empty NewMessage. + if b, err = Marshal(om); err != nil { + t.Fatalf("Marshal of OldMessage: %v", err) + } + t.Logf("Marshal(%v) -> %q", om, b) + nm2 := new(NewMessage) + if err := Unmarshal(b, nm2); err != nil { + t.Fatalf("Unmarshal to NewMessage: %v", err) + } + if !Equal(nm, nm2) { + t.Errorf("NewMessage round-trip: %v => %v", nm, nm2) + } +} + +// Check that an int32 field can be upgraded to an int64 field. +func TestNegativeInt32(t *testing.T) { + om := &OldMessage{ + Num: Int32(-1), + } + b, err := Marshal(om) + if err != nil { + t.Fatalf("Marshal of OldMessage: %v", err) + } + + // Check the size. It should be 11 bytes; + // 1 for the field/wire type, and 10 for the negative number. + if len(b) != 11 { + t.Errorf("%v marshaled as %q, wanted 11 bytes", om, b) + } + + // Unmarshal into a NewMessage. + nm := new(NewMessage) + if err := Unmarshal(b, nm); err != nil { + t.Fatalf("Unmarshal to NewMessage: %v", err) + } + want := &NewMessage{ + Num: Int64(-1), + } + if !Equal(nm, want) { + t.Errorf("nm = %v, want %v", nm, want) + } +} + +// Check that we can grow an array (repeated field) to have many elements. +// This test doesn't depend only on our encoding; for variety, it makes sure +// we create, encode, and decode the correct contents explicitly. It's therefore +// a bit messier. +// This test also uses (and hence tests) the Marshal/Unmarshal functions +// instead of the methods. +func TestBigRepeated(t *testing.T) { + pb := initGoTest(true) + + // Create the arrays + const N = 50 // Internally the library starts much smaller. + pb.Repeatedgroup = make([]*GoTest_RepeatedGroup, N) + pb.F_Sint64Repeated = make([]int64, N) + pb.F_Sint32Repeated = make([]int32, N) + pb.F_BytesRepeated = make([][]byte, N) + pb.F_StringRepeated = make([]string, N) + pb.F_DoubleRepeated = make([]float64, N) + pb.F_FloatRepeated = make([]float32, N) + pb.F_Uint64Repeated = make([]uint64, N) + pb.F_Uint32Repeated = make([]uint32, N) + pb.F_Fixed64Repeated = make([]uint64, N) + pb.F_Fixed32Repeated = make([]uint32, N) + pb.F_Int64Repeated = make([]int64, N) + pb.F_Int32Repeated = make([]int32, N) + pb.F_BoolRepeated = make([]bool, N) + pb.RepeatedField = make([]*GoTestField, N) + + // Fill in the arrays with checkable values. + igtf := initGoTestField() + igtrg := initGoTest_RepeatedGroup() + for i := 0; i < N; i++ { + pb.Repeatedgroup[i] = igtrg + pb.F_Sint64Repeated[i] = int64(i) + pb.F_Sint32Repeated[i] = int32(i) + s := fmt.Sprint(i) + pb.F_BytesRepeated[i] = []byte(s) + pb.F_StringRepeated[i] = s + pb.F_DoubleRepeated[i] = float64(i) + pb.F_FloatRepeated[i] = float32(i) + pb.F_Uint64Repeated[i] = uint64(i) + pb.F_Uint32Repeated[i] = uint32(i) + pb.F_Fixed64Repeated[i] = uint64(i) + pb.F_Fixed32Repeated[i] = uint32(i) + pb.F_Int64Repeated[i] = int64(i) + pb.F_Int32Repeated[i] = int32(i) + pb.F_BoolRepeated[i] = i%2 == 0 + pb.RepeatedField[i] = igtf + } + + // Marshal. + buf, _ := Marshal(pb) + + // Now test Unmarshal by recreating the original buffer. + pbd := new(GoTest) + Unmarshal(buf, pbd) + + // Check the checkable values + for i := uint64(0); i < N; i++ { + if pbd.Repeatedgroup[i] == nil { // TODO: more checking? + t.Error("pbd.Repeatedgroup bad") + } + var x uint64 + x = uint64(pbd.F_Sint64Repeated[i]) + if x != i { + t.Error("pbd.F_Sint64Repeated bad", x, i) + } + x = uint64(pbd.F_Sint32Repeated[i]) + if x != i { + t.Error("pbd.F_Sint32Repeated bad", x, i) + } + s := fmt.Sprint(i) + equalbytes(pbd.F_BytesRepeated[i], []byte(s), t) + if pbd.F_StringRepeated[i] != s { + t.Error("pbd.F_Sint32Repeated bad", pbd.F_StringRepeated[i], i) + } + x = uint64(pbd.F_DoubleRepeated[i]) + if x != i { + t.Error("pbd.F_DoubleRepeated bad", x, i) + } + x = uint64(pbd.F_FloatRepeated[i]) + if x != i { + t.Error("pbd.F_FloatRepeated bad", x, i) + } + x = pbd.F_Uint64Repeated[i] + if x != i { + t.Error("pbd.F_Uint64Repeated bad", x, i) + } + x = uint64(pbd.F_Uint32Repeated[i]) + if x != i { + t.Error("pbd.F_Uint32Repeated bad", x, i) + } + x = pbd.F_Fixed64Repeated[i] + if x != i { + t.Error("pbd.F_Fixed64Repeated bad", x, i) + } + x = uint64(pbd.F_Fixed32Repeated[i]) + if x != i { + t.Error("pbd.F_Fixed32Repeated bad", x, i) + } + x = uint64(pbd.F_Int64Repeated[i]) + if x != i { + t.Error("pbd.F_Int64Repeated bad", x, i) + } + x = uint64(pbd.F_Int32Repeated[i]) + if x != i { + t.Error("pbd.F_Int32Repeated bad", x, i) + } + if pbd.F_BoolRepeated[i] != (i%2 == 0) { + t.Error("pbd.F_BoolRepeated bad", x, i) + } + if pbd.RepeatedField[i] == nil { // TODO: more checking? + t.Error("pbd.RepeatedField bad") + } + } +} + +// Verify we give a useful message when decoding to the wrong structure type. +func TestTypeMismatch(t *testing.T) { + pb1 := initGoTest(true) + + // Marshal + o := old() + o.Marshal(pb1) + + // Now Unmarshal it to the wrong type. + pb2 := initGoTestField() + err := o.Unmarshal(pb2) + if err == nil { + t.Error("expected error, got no error") + } else if !strings.Contains(err.Error(), "bad wiretype") { + t.Error("expected bad wiretype error, got", err) + } +} + +func encodeDecode(t *testing.T, in, out Message, msg string) { + buf, err := Marshal(in) + if err != nil { + t.Fatalf("failed marshaling %v: %v", msg, err) + } + if err := Unmarshal(buf, out); err != nil { + t.Fatalf("failed unmarshaling %v: %v", msg, err) + } +} + +func TestPackedNonPackedDecoderSwitching(t *testing.T) { + np, p := new(NonPackedTest), new(PackedTest) + + // non-packed -> packed + np.A = []int32{0, 1, 1, 2, 3, 5} + encodeDecode(t, np, p, "non-packed -> packed") + if !reflect.DeepEqual(np.A, p.B) { + t.Errorf("failed non-packed -> packed; np.A=%+v, p.B=%+v", np.A, p.B) + } + + // packed -> non-packed + np.Reset() + p.B = []int32{3, 1, 4, 1, 5, 9} + encodeDecode(t, p, np, "packed -> non-packed") + if !reflect.DeepEqual(p.B, np.A) { + t.Errorf("failed packed -> non-packed; p.B=%+v, np.A=%+v", p.B, np.A) + } +} + +func TestProto1RepeatedGroup(t *testing.T) { + pb := &MessageList{ + Message: []*MessageList_Message{ + { + Name: String("blah"), + Count: Int32(7), + }, + // NOTE: pb.Message[1] is a nil + nil, + }, + } + + o := old() + err := o.Marshal(pb) + if err == nil || !strings.Contains(err.Error(), "repeated field Message has nil") { + t.Fatalf("unexpected or no error when marshaling: %v", err) + } +} + +// Test that enums work. Checks for a bug introduced by making enums +// named types instead of int32: newInt32FromUint64 would crash with +// a type mismatch in reflect.PointTo. +func TestEnum(t *testing.T) { + pb := new(GoEnum) + pb.Foo = FOO_FOO1.Enum() + o := old() + if err := o.Marshal(pb); err != nil { + t.Fatal("error encoding enum:", err) + } + pb1 := new(GoEnum) + if err := o.Unmarshal(pb1); err != nil { + t.Fatal("error decoding enum:", err) + } + if *pb1.Foo != FOO_FOO1 { + t.Error("expected 7 but got ", *pb1.Foo) + } +} + +// Enum types have String methods. Check that enum fields can be printed. +// We don't care what the value actually is, just as long as it doesn't crash. +func TestPrintingNilEnumFields(t *testing.T) { + pb := new(GoEnum) + fmt.Sprintf("%+v", pb) +} + +// Verify that absent required fields cause Marshal/Unmarshal to return errors. +func TestRequiredFieldEnforcement(t *testing.T) { + pb := new(GoTestField) + _, err := Marshal(pb) + if err == nil { + t.Error("marshal: expected error, got nil") + } else if strings.Index(err.Error(), "Label") < 0 { + t.Errorf("marshal: bad error type: %v", err) + } + + // A slightly sneaky, yet valid, proto. It encodes the same required field twice, + // so simply counting the required fields is insufficient. + // field 1, encoding 2, value "hi" + buf := []byte("\x0A\x02hi\x0A\x02hi") + err = Unmarshal(buf, pb) + if err == nil { + t.Error("unmarshal: expected error, got nil") + } else if strings.Index(err.Error(), "{Unknown}") < 0 { + t.Errorf("unmarshal: bad error type: %v", err) + } +} + +func TestTypedNilMarshal(t *testing.T) { + // A typed nil should return ErrNil and not crash. + _, err := Marshal((*GoEnum)(nil)) + if err != ErrNil { + t.Errorf("Marshal: got err %v, want ErrNil", err) + } +} + +// A type that implements the Marshaler interface, but is not nillable. +type nonNillableInt uint64 + +func (nni nonNillableInt) Marshal() ([]byte, error) { + return EncodeVarint(uint64(nni)), nil +} + +type NNIMessage struct { + nni nonNillableInt +} + +func (*NNIMessage) Reset() {} +func (*NNIMessage) String() string { return "" } +func (*NNIMessage) ProtoMessage() {} + +// A type that implements the Marshaler interface and is nillable. +type nillableMessage struct { + x uint64 +} + +func (nm *nillableMessage) Marshal() ([]byte, error) { + return EncodeVarint(nm.x), nil +} + +type NMMessage struct { + nm *nillableMessage +} + +func (*NMMessage) Reset() {} +func (*NMMessage) String() string { return "" } +func (*NMMessage) ProtoMessage() {} + +// Verify a type that uses the Marshaler interface, but has a nil pointer. +func TestNilMarshaler(t *testing.T) { + // Try a struct with a Marshaler field that is nil. + // It should be directly marshable. + nmm := new(NMMessage) + if _, err := Marshal(nmm); err != nil { + t.Error("unexpected error marshaling nmm: ", err) + } + + // Try a struct with a Marshaler field that is not nillable. + nnim := new(NNIMessage) + nnim.nni = 7 + var _ Marshaler = nnim.nni // verify it is truly a Marshaler + if _, err := Marshal(nnim); err != nil { + t.Error("unexpected error marshaling nnim: ", err) + } +} + +func TestAllSetDefaults(t *testing.T) { + // Exercise SetDefaults with all scalar field types. + m := &Defaults{ + // NaN != NaN, so override that here. + F_Nan: Float32(1.7), + } + expected := &Defaults{ + F_Bool: Bool(true), + F_Int32: Int32(32), + F_Int64: Int64(64), + F_Fixed32: Uint32(320), + F_Fixed64: Uint64(640), + F_Uint32: Uint32(3200), + F_Uint64: Uint64(6400), + F_Float: Float32(314159), + F_Double: Float64(271828), + F_String: String(`hello, "world!"` + "\n"), + F_Bytes: []byte("Bignose"), + F_Sint32: Int32(-32), + F_Sint64: Int64(-64), + F_Enum: Defaults_GREEN.Enum(), + F_Pinf: Float32(float32(math.Inf(1))), + F_Ninf: Float32(float32(math.Inf(-1))), + F_Nan: Float32(1.7), + StrZero: String(""), + } + SetDefaults(m) + if !Equal(m, expected) { + t.Errorf("SetDefaults failed\n got %v\nwant %v", m, expected) + } +} + +func TestSetDefaultsWithSetField(t *testing.T) { + // Check that a set value is not overridden. + m := &Defaults{ + F_Int32: Int32(12), + } + SetDefaults(m) + if v := m.GetF_Int32(); v != 12 { + t.Errorf("m.FInt32 = %v, want 12", v) + } +} + +func TestSetDefaultsWithSubMessage(t *testing.T) { + m := &OtherMessage{ + Key: Int64(123), + Inner: &InnerMessage{ + Host: String("gopher"), + }, + } + expected := &OtherMessage{ + Key: Int64(123), + Inner: &InnerMessage{ + Host: String("gopher"), + Port: Int32(4000), + }, + } + SetDefaults(m) + if !Equal(m, expected) { + t.Errorf("\n got %v\nwant %v", m, expected) + } +} + +func TestSetDefaultsWithRepeatedSubMessage(t *testing.T) { + m := &MyMessage{ + RepInner: []*InnerMessage{{}}, + } + expected := &MyMessage{ + RepInner: []*InnerMessage{{ + Port: Int32(4000), + }}, + } + SetDefaults(m) + if !Equal(m, expected) { + t.Errorf("\n got %v\nwant %v", m, expected) + } +} + +func TestSetDefaultWithRepeatedNonMessage(t *testing.T) { + m := &MyMessage{ + Pet: []string{"turtle", "wombat"}, + } + expected := Clone(m) + SetDefaults(m) + if !Equal(m, expected) { + t.Errorf("\n got %v\nwant %v", m, expected) + } +} + +func TestMaximumTagNumber(t *testing.T) { + m := &MaxTag{ + LastField: String("natural goat essence"), + } + buf, err := Marshal(m) + if err != nil { + t.Fatalf("proto.Marshal failed: %v", err) + } + m2 := new(MaxTag) + if err := Unmarshal(buf, m2); err != nil { + t.Fatalf("proto.Unmarshal failed: %v", err) + } + if got, want := m2.GetLastField(), *m.LastField; got != want { + t.Errorf("got %q, want %q", got, want) + } +} + +func TestJSON(t *testing.T) { + m := &MyMessage{ + Count: Int32(4), + Pet: []string{"bunny", "kitty"}, + Inner: &InnerMessage{ + Host: String("cauchy"), + }, + Bikeshed: MyMessage_GREEN.Enum(), + } + const expected = `{"count":4,"pet":["bunny","kitty"],"inner":{"host":"cauchy"},"bikeshed":1}` + + b, err := json.Marshal(m) + if err != nil { + t.Fatalf("json.Marshal failed: %v", err) + } + s := string(b) + if s != expected { + t.Errorf("got %s\nwant %s", s, expected) + } + + received := new(MyMessage) + if err := json.Unmarshal(b, received); err != nil { + t.Fatalf("json.Unmarshal failed: %v", err) + } + if !Equal(received, m) { + t.Fatalf("got %s, want %s", received, m) + } + + // Test unmarshalling of JSON with symbolic enum name. + const old = `{"count":4,"pet":["bunny","kitty"],"inner":{"host":"cauchy"},"bikeshed":"GREEN"}` + received.Reset() + if err := json.Unmarshal([]byte(old), received); err != nil { + t.Fatalf("json.Unmarshal failed: %v", err) + } + if !Equal(received, m) { + t.Fatalf("got %s, want %s", received, m) + } +} + +func TestBadWireType(t *testing.T) { + b := []byte{7<<3 | 6} // field 7, wire type 6 + pb := new(OtherMessage) + if err := Unmarshal(b, pb); err == nil { + t.Errorf("Unmarshal did not fail") + } else if !strings.Contains(err.Error(), "unknown wire type") { + t.Errorf("wrong error: %v", err) + } +} + +func TestBytesWithInvalidLength(t *testing.T) { + // If a byte sequence has an invalid (negative) length, Unmarshal should not panic. + b := []byte{2<<3 | WireBytes, 0xff, 0xff, 0xff, 0xff, 0xff, 0} + Unmarshal(b, new(MyMessage)) +} + +func TestLengthOverflow(t *testing.T) { + // Overflowing a length should not panic. + b := []byte{2<<3 | WireBytes, 1, 1, 3<<3 | WireBytes, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x01} + Unmarshal(b, new(MyMessage)) +} + +func TestVarintOverflow(t *testing.T) { + // Overflowing a 64-bit length should not be allowed. + b := []byte{1<<3 | WireVarint, 0x01, 3<<3 | WireBytes, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x01} + if err := Unmarshal(b, new(MyMessage)); err == nil { + t.Fatalf("Overflowed uint64 length without error") + } +} + +func TestUnmarshalFuzz(t *testing.T) { + const N = 1000 + seed := time.Now().UnixNano() + t.Logf("RNG seed is %d", seed) + rng := rand.New(rand.NewSource(seed)) + buf := make([]byte, 20) + for i := 0; i < N; i++ { + for j := range buf { + buf[j] = byte(rng.Intn(256)) + } + fuzzUnmarshal(t, buf) + } +} + +func TestMergeMessages(t *testing.T) { + pb := &MessageList{Message: []*MessageList_Message{{Name: String("x"), Count: Int32(1)}}} + data, err := Marshal(pb) + if err != nil { + t.Fatalf("Marshal: %v", err) + } + + pb1 := new(MessageList) + if err := Unmarshal(data, pb1); err != nil { + t.Fatalf("first Unmarshal: %v", err) + } + if err := Unmarshal(data, pb1); err != nil { + t.Fatalf("second Unmarshal: %v", err) + } + if len(pb1.Message) != 1 { + t.Errorf("two Unmarshals produced %d Messages, want 1", len(pb1.Message)) + } + + pb2 := new(MessageList) + if err := UnmarshalMerge(data, pb2); err != nil { + t.Fatalf("first UnmarshalMerge: %v", err) + } + if err := UnmarshalMerge(data, pb2); err != nil { + t.Fatalf("second UnmarshalMerge: %v", err) + } + if len(pb2.Message) != 2 { + t.Errorf("two UnmarshalMerges produced %d Messages, want 2", len(pb2.Message)) + } +} + +func TestExtensionMarshalOrder(t *testing.T) { + m := &MyMessage{Count: Int(123)} + if err := SetExtension(m, E_Ext_More, &Ext{Data: String("alpha")}); err != nil { + t.Fatalf("SetExtension: %v", err) + } + if err := SetExtension(m, E_Ext_Text, String("aleph")); err != nil { + t.Fatalf("SetExtension: %v", err) + } + if err := SetExtension(m, E_Ext_Number, Int32(1)); err != nil { + t.Fatalf("SetExtension: %v", err) + } + + // Serialize m several times, and check we get the same bytes each time. + var orig []byte + for i := 0; i < 100; i++ { + b, err := Marshal(m) + if err != nil { + t.Fatalf("Marshal: %v", err) + } + if i == 0 { + orig = b + continue + } + if !bytes.Equal(b, orig) { + t.Errorf("Bytes differ on attempt #%d", i) + } + } +} + +// Many extensions, because small maps might not iterate differently on each iteration. +var exts = []*ExtensionDesc{ + E_X201, + E_X202, + E_X203, + E_X204, + E_X205, + E_X206, + E_X207, + E_X208, + E_X209, + E_X210, + E_X211, + E_X212, + E_X213, + E_X214, + E_X215, + E_X216, + E_X217, + E_X218, + E_X219, + E_X220, + E_X221, + E_X222, + E_X223, + E_X224, + E_X225, + E_X226, + E_X227, + E_X228, + E_X229, + E_X230, + E_X231, + E_X232, + E_X233, + E_X234, + E_X235, + E_X236, + E_X237, + E_X238, + E_X239, + E_X240, + E_X241, + E_X242, + E_X243, + E_X244, + E_X245, + E_X246, + E_X247, + E_X248, + E_X249, + E_X250, +} + +func TestMessageSetMarshalOrder(t *testing.T) { + m := &MyMessageSet{} + for _, x := range exts { + if err := SetExtension(m, x, &Empty{}); err != nil { + t.Fatalf("SetExtension: %v", err) + } + } + + buf, err := Marshal(m) + if err != nil { + t.Fatalf("Marshal: %v", err) + } + + // Serialize m several times, and check we get the same bytes each time. + for i := 0; i < 10; i++ { + b1, err := Marshal(m) + if err != nil { + t.Fatalf("Marshal: %v", err) + } + if !bytes.Equal(b1, buf) { + t.Errorf("Bytes differ on re-Marshal #%d", i) + } + + m2 := &MyMessageSet{} + if err := Unmarshal(buf, m2); err != nil { + t.Errorf("Unmarshal: %v", err) + } + b2, err := Marshal(m2) + if err != nil { + t.Errorf("re-Marshal: %v", err) + } + if !bytes.Equal(b2, buf) { + t.Errorf("Bytes differ on round-trip #%d", i) + } + } +} + +func TestUnmarshalMergesMessages(t *testing.T) { + // If a nested message occurs twice in the input, + // the fields should be merged when decoding. + a := &OtherMessage{ + Key: Int64(123), + Inner: &InnerMessage{ + Host: String("polhode"), + Port: Int32(1234), + }, + } + aData, err := Marshal(a) + if err != nil { + t.Fatalf("Marshal(a): %v", err) + } + b := &OtherMessage{ + Weight: Float32(1.2), + Inner: &InnerMessage{ + Host: String("herpolhode"), + Connected: Bool(true), + }, + } + bData, err := Marshal(b) + if err != nil { + t.Fatalf("Marshal(b): %v", err) + } + want := &OtherMessage{ + Key: Int64(123), + Weight: Float32(1.2), + Inner: &InnerMessage{ + Host: String("herpolhode"), + Port: Int32(1234), + Connected: Bool(true), + }, + } + got := new(OtherMessage) + if err := Unmarshal(append(aData, bData...), got); err != nil { + t.Fatalf("Unmarshal: %v", err) + } + if !Equal(got, want) { + t.Errorf("\n got %v\nwant %v", got, want) + } +} + +func TestEncodingSizes(t *testing.T) { + tests := []struct { + m Message + n int + }{ + {&Defaults{F_Int32: Int32(math.MaxInt32)}, 6}, + {&Defaults{F_Int32: Int32(math.MinInt32)}, 11}, + {&Defaults{F_Uint32: Uint32(uint32(math.MaxInt32) + 1)}, 6}, + {&Defaults{F_Uint32: Uint32(math.MaxUint32)}, 6}, + } + for _, test := range tests { + b, err := Marshal(test.m) + if err != nil { + t.Errorf("Marshal(%v): %v", test.m, err) + continue + } + if len(b) != test.n { + t.Errorf("Marshal(%v) yielded %d bytes, want %d bytes", test.m, len(b), test.n) + } + } +} + +func TestRequiredNotSetError(t *testing.T) { + pb := initGoTest(false) + pb.RequiredField.Label = nil + pb.F_Int32Required = nil + pb.F_Int64Required = nil + + expected := "0807" + // field 1, encoding 0, value 7 + "2206" + "120474797065" + // field 4, encoding 2 (GoTestField) + "5001" + // field 10, encoding 0, value 1 + "6d20000000" + // field 13, encoding 5, value 0x20 + "714000000000000000" + // field 14, encoding 1, value 0x40 + "78a019" + // field 15, encoding 0, value 0xca0 = 3232 + "8001c032" + // field 16, encoding 0, value 0x1940 = 6464 + "8d0100004a45" + // field 17, encoding 5, value 3232.0 + "9101000000000040b940" + // field 18, encoding 1, value 6464.0 + "9a0106" + "737472696e67" + // field 19, encoding 2, string "string" + "b304" + // field 70, encoding 3, start group + "ba0408" + "7265717569726564" + // field 71, encoding 2, string "required" + "b404" + // field 70, encoding 4, end group + "aa0605" + "6279746573" + // field 101, encoding 2, string "bytes" + "b0063f" + // field 102, encoding 0, 0x3f zigzag32 + "b8067f" // field 103, encoding 0, 0x7f zigzag64 + + o := old() + bytes, err := Marshal(pb) + if _, ok := err.(*RequiredNotSetError); !ok { + fmt.Printf("marshal-1 err = %v, want *RequiredNotSetError", err) + o.DebugPrint("", bytes) + t.Fatalf("expected = %s", expected) + } + if strings.Index(err.Error(), "RequiredField.Label") < 0 { + t.Errorf("marshal-1 wrong err msg: %v", err) + } + if !equal(bytes, expected, t) { + o.DebugPrint("neq 1", bytes) + t.Fatalf("expected = %s", expected) + } + + // Now test Unmarshal by recreating the original buffer. + pbd := new(GoTest) + err = Unmarshal(bytes, pbd) + if _, ok := err.(*RequiredNotSetError); !ok { + t.Fatalf("unmarshal err = %v, want *RequiredNotSetError", err) + o.DebugPrint("", bytes) + t.Fatalf("string = %s", expected) + } + if strings.Index(err.Error(), "RequiredField.{Unknown}") < 0 { + t.Errorf("unmarshal wrong err msg: %v", err) + } + bytes, err = Marshal(pbd) + if _, ok := err.(*RequiredNotSetError); !ok { + t.Errorf("marshal-2 err = %v, want *RequiredNotSetError", err) + o.DebugPrint("", bytes) + t.Fatalf("string = %s", expected) + } + if strings.Index(err.Error(), "RequiredField.Label") < 0 { + t.Errorf("marshal-2 wrong err msg: %v", err) + } + if !equal(bytes, expected, t) { + o.DebugPrint("neq 2", bytes) + t.Fatalf("string = %s", expected) + } +} + +func fuzzUnmarshal(t *testing.T, data []byte) { + defer func() { + if e := recover(); e != nil { + t.Errorf("These bytes caused a panic: %+v", data) + t.Logf("Stack:\n%s", debug.Stack()) + t.FailNow() + } + }() + + pb := new(MyMessage) + Unmarshal(data, pb) +} + +func TestMapFieldMarshal(t *testing.T) { + m := &MessageWithMap{ + NameMapping: map[int32]string{ + 1: "Rob", + 4: "Ian", + 8: "Dave", + }, + } + b, err := Marshal(m) + if err != nil { + t.Fatalf("Marshal: %v", err) + } + + // b should be the concatenation of these three byte sequences in some order. + parts := []string{ + "\n\a\b\x01\x12\x03Rob", + "\n\a\b\x04\x12\x03Ian", + "\n\b\b\x08\x12\x04Dave", + } + ok := false + for i := range parts { + for j := range parts { + if j == i { + continue + } + for k := range parts { + if k == i || k == j { + continue + } + try := parts[i] + parts[j] + parts[k] + if bytes.Equal(b, []byte(try)) { + ok = true + break + } + } + } + } + if !ok { + t.Fatalf("Incorrect Marshal output.\n got %q\nwant %q (or a permutation of that)", b, parts[0]+parts[1]+parts[2]) + } + t.Logf("FYI b: %q", b) + + (new(Buffer)).DebugPrint("Dump of b", b) +} + +func TestMapFieldRoundTrips(t *testing.T) { + m := &MessageWithMap{ + NameMapping: map[int32]string{ + 1: "Rob", + 4: "Ian", + 8: "Dave", + }, + MsgMapping: map[int64]*FloatingPoint{ + 0x7001: &FloatingPoint{F: Float64(2.0)}, + }, + ByteMapping: map[bool][]byte{ + false: []byte("that's not right!"), + true: []byte("aye, 'tis true!"), + }, + } + b, err := Marshal(m) + if err != nil { + t.Fatalf("Marshal: %v", err) + } + t.Logf("FYI b: %q", b) + m2 := new(MessageWithMap) + if err := Unmarshal(b, m2); err != nil { + t.Fatalf("Unmarshal: %v", err) + } + for _, pair := range [][2]interface{}{ + {m.NameMapping, m2.NameMapping}, + {m.MsgMapping, m2.MsgMapping}, + {m.ByteMapping, m2.ByteMapping}, + } { + if !reflect.DeepEqual(pair[0], pair[1]) { + t.Errorf("Map did not survive a round trip.\ninitial: %v\n final: %v", pair[0], pair[1]) + } + } +} + +func TestMapFieldWithNil(t *testing.T) { + m := &MessageWithMap{ + MsgMapping: map[int64]*FloatingPoint{ + 1: nil, + }, + } + b, err := Marshal(m) + if err == nil { + t.Fatalf("Marshal of bad map should have failed, got these bytes: %v", b) + } +} + +// Benchmarks + +func testMsg() *GoTest { + pb := initGoTest(true) + const N = 1000 // Internally the library starts much smaller. + pb.F_Int32Repeated = make([]int32, N) + pb.F_DoubleRepeated = make([]float64, N) + for i := 0; i < N; i++ { + pb.F_Int32Repeated[i] = int32(i) + pb.F_DoubleRepeated[i] = float64(i) + } + return pb +} + +func bytesMsg() *GoTest { + pb := initGoTest(true) + buf := make([]byte, 4000) + for i := range buf { + buf[i] = byte(i) + } + pb.F_BytesDefaulted = buf + return pb +} + +func benchmarkMarshal(b *testing.B, pb Message, marshal func(Message) ([]byte, error)) { + d, _ := marshal(pb) + b.SetBytes(int64(len(d))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + marshal(pb) + } +} + +func benchmarkBufferMarshal(b *testing.B, pb Message) { + p := NewBuffer(nil) + benchmarkMarshal(b, pb, func(pb0 Message) ([]byte, error) { + p.Reset() + err := p.Marshal(pb0) + return p.Bytes(), err + }) +} + +func benchmarkSize(b *testing.B, pb Message) { + benchmarkMarshal(b, pb, func(pb0 Message) ([]byte, error) { + Size(pb) + return nil, nil + }) +} + +func newOf(pb Message) Message { + in := reflect.ValueOf(pb) + if in.IsNil() { + return pb + } + return reflect.New(in.Type().Elem()).Interface().(Message) +} + +func benchmarkUnmarshal(b *testing.B, pb Message, unmarshal func([]byte, Message) error) { + d, _ := Marshal(pb) + b.SetBytes(int64(len(d))) + pbd := newOf(pb) + + b.ResetTimer() + for i := 0; i < b.N; i++ { + unmarshal(d, pbd) + } +} + +func benchmarkBufferUnmarshal(b *testing.B, pb Message) { + p := NewBuffer(nil) + benchmarkUnmarshal(b, pb, func(d []byte, pb0 Message) error { + p.SetBuf(d) + return p.Unmarshal(pb0) + }) +} + +// Benchmark{Marshal,BufferMarshal,Size,Unmarshal,BufferUnmarshal}{,Bytes} + +func BenchmarkMarshal(b *testing.B) { + benchmarkMarshal(b, testMsg(), Marshal) +} + +func BenchmarkBufferMarshal(b *testing.B) { + benchmarkBufferMarshal(b, testMsg()) +} + +func BenchmarkSize(b *testing.B) { + benchmarkSize(b, testMsg()) +} + +func BenchmarkUnmarshal(b *testing.B) { + benchmarkUnmarshal(b, testMsg(), Unmarshal) +} + +func BenchmarkBufferUnmarshal(b *testing.B) { + benchmarkBufferUnmarshal(b, testMsg()) +} + +func BenchmarkMarshalBytes(b *testing.B) { + benchmarkMarshal(b, bytesMsg(), Marshal) +} + +func BenchmarkBufferMarshalBytes(b *testing.B) { + benchmarkBufferMarshal(b, bytesMsg()) +} + +func BenchmarkSizeBytes(b *testing.B) { + benchmarkSize(b, bytesMsg()) +} + +func BenchmarkUnmarshalBytes(b *testing.B) { + benchmarkUnmarshal(b, bytesMsg(), Unmarshal) +} + +func BenchmarkBufferUnmarshalBytes(b *testing.B) { + benchmarkBufferUnmarshal(b, bytesMsg()) +} + +func BenchmarkUnmarshalUnrecognizedFields(b *testing.B) { + b.StopTimer() + pb := initGoTestField() + skip := &GoSkipTest{ + SkipInt32: Int32(32), + SkipFixed32: Uint32(3232), + SkipFixed64: Uint64(6464), + SkipString: String("skipper"), + Skipgroup: &GoSkipTest_SkipGroup{ + GroupInt32: Int32(75), + GroupString: String("wxyz"), + }, + } + + pbd := new(GoTestField) + p := NewBuffer(nil) + p.Marshal(pb) + p.Marshal(skip) + p2 := NewBuffer(nil) + + b.StartTimer() + for i := 0; i < b.N; i++ { + p2.SetBuf(p.Bytes()) + p2.Unmarshal(pbd) + } +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/clone.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/clone.go new file mode 100644 index 000000000..915a68b8e --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/clone.go @@ -0,0 +1,212 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2011 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +// Protocol buffer deep copy and merge. +// TODO: MessageSet and RawMessage. + +package proto + +import ( + "log" + "reflect" + "strings" +) + +// Clone returns a deep copy of a protocol buffer. +func Clone(pb Message) Message { + in := reflect.ValueOf(pb) + if in.IsNil() { + return pb + } + + out := reflect.New(in.Type().Elem()) + // out is empty so a merge is a deep copy. + mergeStruct(out.Elem(), in.Elem()) + return out.Interface().(Message) +} + +// Merge merges src into dst. +// Required and optional fields that are set in src will be set to that value in dst. +// Elements of repeated fields will be appended. +// Merge panics if src and dst are not the same type, or if dst is nil. +func Merge(dst, src Message) { + in := reflect.ValueOf(src) + out := reflect.ValueOf(dst) + if out.IsNil() { + panic("proto: nil destination") + } + if in.Type() != out.Type() { + // Explicit test prior to mergeStruct so that mistyped nils will fail + panic("proto: type mismatch") + } + if in.IsNil() { + // Merging nil into non-nil is a quiet no-op + return + } + mergeStruct(out.Elem(), in.Elem()) +} + +func mergeStruct(out, in reflect.Value) { + sprop := GetProperties(in.Type()) + for i := 0; i < in.NumField(); i++ { + f := in.Type().Field(i) + if strings.HasPrefix(f.Name, "XXX_") { + continue + } + mergeAny(out.Field(i), in.Field(i), false, sprop.Prop[i]) + } + + if emIn, ok := in.Addr().Interface().(extendableProto); ok { + emOut := out.Addr().Interface().(extendableProto) + mergeExtension(emOut.ExtensionMap(), emIn.ExtensionMap()) + } + + uf := in.FieldByName("XXX_unrecognized") + if !uf.IsValid() { + return + } + uin := uf.Bytes() + if len(uin) > 0 { + out.FieldByName("XXX_unrecognized").SetBytes(append([]byte(nil), uin...)) + } +} + +// mergeAny performs a merge between two values of the same type. +// viaPtr indicates whether the values were indirected through a pointer (implying proto2). +// prop is set if this is a struct field (it may be nil). +func mergeAny(out, in reflect.Value, viaPtr bool, prop *Properties) { + if in.Type() == protoMessageType { + if !in.IsNil() { + if out.IsNil() { + out.Set(reflect.ValueOf(Clone(in.Interface().(Message)))) + } else { + Merge(out.Interface().(Message), in.Interface().(Message)) + } + } + return + } + switch in.Kind() { + case reflect.Bool, reflect.Float32, reflect.Float64, reflect.Int32, reflect.Int64, + reflect.String, reflect.Uint32, reflect.Uint64: + if !viaPtr && isProto3Zero(in) { + return + } + out.Set(in) + case reflect.Map: + if in.Len() == 0 { + return + } + if out.IsNil() { + out.Set(reflect.MakeMap(in.Type())) + } + // For maps with value types of *T or []byte we need to deep copy each value. + elemKind := in.Type().Elem().Kind() + for _, key := range in.MapKeys() { + var val reflect.Value + switch elemKind { + case reflect.Ptr: + val = reflect.New(in.Type().Elem().Elem()) + mergeAny(val, in.MapIndex(key), false, nil) + case reflect.Slice: + val = in.MapIndex(key) + val = reflect.ValueOf(append([]byte{}, val.Bytes()...)) + default: + val = in.MapIndex(key) + } + out.SetMapIndex(key, val) + } + case reflect.Ptr: + if in.IsNil() { + return + } + if out.IsNil() { + out.Set(reflect.New(in.Elem().Type())) + } + mergeAny(out.Elem(), in.Elem(), true, nil) + case reflect.Slice: + if in.IsNil() { + return + } + if in.Type().Elem().Kind() == reflect.Uint8 { + // []byte is a scalar bytes field, not a repeated field. + + // Edge case: if this is in a proto3 message, a zero length + // bytes field is considered the zero value, and should not + // be merged. + if prop != nil && prop.proto3 && in.Len() == 0 { + return + } + + // Make a deep copy. + // Append to []byte{} instead of []byte(nil) so that we never end up + // with a nil result. + out.SetBytes(append([]byte{}, in.Bytes()...)) + return + } + n := in.Len() + if out.IsNil() { + out.Set(reflect.MakeSlice(in.Type(), 0, n)) + } + switch in.Type().Elem().Kind() { + case reflect.Bool, reflect.Float32, reflect.Float64, reflect.Int32, reflect.Int64, + reflect.String, reflect.Uint32, reflect.Uint64: + out.Set(reflect.AppendSlice(out, in)) + default: + for i := 0; i < n; i++ { + x := reflect.Indirect(reflect.New(in.Type().Elem())) + mergeAny(x, in.Index(i), false, nil) + out.Set(reflect.Append(out, x)) + } + } + case reflect.Struct: + mergeStruct(out, in) + default: + // unknown type, so not a protocol buffer + log.Printf("proto: don't know how to copy %v", in) + } +} + +func mergeExtension(out, in map[int32]Extension) { + for extNum, eIn := range in { + eOut := Extension{desc: eIn.desc} + if eIn.value != nil { + v := reflect.New(reflect.TypeOf(eIn.value)).Elem() + mergeAny(v, reflect.ValueOf(eIn.value), false, nil) + eOut.value = v.Interface() + } + if eIn.enc != nil { + eOut.enc = make([]byte, len(eIn.enc)) + copy(eOut.enc, eIn.enc) + } + + out[extNum] = eOut + } +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/clone_test.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/clone_test.go new file mode 100644 index 000000000..a1c697bc8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/clone_test.go @@ -0,0 +1,245 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2011 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +package proto_test + +import ( + "testing" + + "github.com/golang/protobuf/proto" + + proto3pb "github.com/golang/protobuf/proto/proto3_proto" + pb "github.com/golang/protobuf/proto/testdata" +) + +var cloneTestMessage = &pb.MyMessage{ + Count: proto.Int32(42), + Name: proto.String("Dave"), + Pet: []string{"bunny", "kitty", "horsey"}, + Inner: &pb.InnerMessage{ + Host: proto.String("niles"), + Port: proto.Int32(9099), + Connected: proto.Bool(true), + }, + Others: []*pb.OtherMessage{ + { + Value: []byte("some bytes"), + }, + }, + Somegroup: &pb.MyMessage_SomeGroup{ + GroupField: proto.Int32(6), + }, + RepBytes: [][]byte{[]byte("sham"), []byte("wow")}, +} + +func init() { + ext := &pb.Ext{ + Data: proto.String("extension"), + } + if err := proto.SetExtension(cloneTestMessage, pb.E_Ext_More, ext); err != nil { + panic("SetExtension: " + err.Error()) + } +} + +func TestClone(t *testing.T) { + m := proto.Clone(cloneTestMessage).(*pb.MyMessage) + if !proto.Equal(m, cloneTestMessage) { + t.Errorf("Clone(%v) = %v", cloneTestMessage, m) + } + + // Verify it was a deep copy. + *m.Inner.Port++ + if proto.Equal(m, cloneTestMessage) { + t.Error("Mutating clone changed the original") + } + // Byte fields and repeated fields should be copied. + if &m.Pet[0] == &cloneTestMessage.Pet[0] { + t.Error("Pet: repeated field not copied") + } + if &m.Others[0] == &cloneTestMessage.Others[0] { + t.Error("Others: repeated field not copied") + } + if &m.Others[0].Value[0] == &cloneTestMessage.Others[0].Value[0] { + t.Error("Others[0].Value: bytes field not copied") + } + if &m.RepBytes[0] == &cloneTestMessage.RepBytes[0] { + t.Error("RepBytes: repeated field not copied") + } + if &m.RepBytes[0][0] == &cloneTestMessage.RepBytes[0][0] { + t.Error("RepBytes[0]: bytes field not copied") + } +} + +func TestCloneNil(t *testing.T) { + var m *pb.MyMessage + if c := proto.Clone(m); !proto.Equal(m, c) { + t.Errorf("Clone(%v) = %v", m, c) + } +} + +var mergeTests = []struct { + src, dst, want proto.Message +}{ + { + src: &pb.MyMessage{ + Count: proto.Int32(42), + }, + dst: &pb.MyMessage{ + Name: proto.String("Dave"), + }, + want: &pb.MyMessage{ + Count: proto.Int32(42), + Name: proto.String("Dave"), + }, + }, + { + src: &pb.MyMessage{ + Inner: &pb.InnerMessage{ + Host: proto.String("hey"), + Connected: proto.Bool(true), + }, + Pet: []string{"horsey"}, + Others: []*pb.OtherMessage{ + { + Value: []byte("some bytes"), + }, + }, + }, + dst: &pb.MyMessage{ + Inner: &pb.InnerMessage{ + Host: proto.String("niles"), + Port: proto.Int32(9099), + }, + Pet: []string{"bunny", "kitty"}, + Others: []*pb.OtherMessage{ + { + Key: proto.Int64(31415926535), + }, + { + // Explicitly test a src=nil field + Inner: nil, + }, + }, + }, + want: &pb.MyMessage{ + Inner: &pb.InnerMessage{ + Host: proto.String("hey"), + Connected: proto.Bool(true), + Port: proto.Int32(9099), + }, + Pet: []string{"bunny", "kitty", "horsey"}, + Others: []*pb.OtherMessage{ + { + Key: proto.Int64(31415926535), + }, + {}, + { + Value: []byte("some bytes"), + }, + }, + }, + }, + { + src: &pb.MyMessage{ + RepBytes: [][]byte{[]byte("wow")}, + }, + dst: &pb.MyMessage{ + Somegroup: &pb.MyMessage_SomeGroup{ + GroupField: proto.Int32(6), + }, + RepBytes: [][]byte{[]byte("sham")}, + }, + want: &pb.MyMessage{ + Somegroup: &pb.MyMessage_SomeGroup{ + GroupField: proto.Int32(6), + }, + RepBytes: [][]byte{[]byte("sham"), []byte("wow")}, + }, + }, + // Check that a scalar bytes field replaces rather than appends. + { + src: &pb.OtherMessage{Value: []byte("foo")}, + dst: &pb.OtherMessage{Value: []byte("bar")}, + want: &pb.OtherMessage{Value: []byte("foo")}, + }, + { + src: &pb.MessageWithMap{ + NameMapping: map[int32]string{6: "Nigel"}, + MsgMapping: map[int64]*pb.FloatingPoint{ + 0x4001: &pb.FloatingPoint{F: proto.Float64(2.0)}, + }, + ByteMapping: map[bool][]byte{true: []byte("wowsa")}, + }, + dst: &pb.MessageWithMap{ + NameMapping: map[int32]string{ + 6: "Bruce", // should be overwritten + 7: "Andrew", + }, + }, + want: &pb.MessageWithMap{ + NameMapping: map[int32]string{ + 6: "Nigel", + 7: "Andrew", + }, + MsgMapping: map[int64]*pb.FloatingPoint{ + 0x4001: &pb.FloatingPoint{F: proto.Float64(2.0)}, + }, + ByteMapping: map[bool][]byte{true: []byte("wowsa")}, + }, + }, + // proto3 shouldn't merge zero values, + // in the same way that proto2 shouldn't merge nils. + { + src: &proto3pb.Message{ + Name: "Aaron", + Data: []byte(""), // zero value, but not nil + }, + dst: &proto3pb.Message{ + HeightInCm: 176, + Data: []byte("texas!"), + }, + want: &proto3pb.Message{ + Name: "Aaron", + HeightInCm: 176, + Data: []byte("texas!"), + }, + }, +} + +func TestMerge(t *testing.T) { + for _, m := range mergeTests { + got := proto.Clone(m.dst) + proto.Merge(got, m.src) + if !proto.Equal(got, m.want) { + t.Errorf("Merge(%v, %v)\n got %v\nwant %v\n", m.dst, m.src, got, m.want) + } + } +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/decode.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/decode.go new file mode 100644 index 000000000..bf71dcad1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/decode.go @@ -0,0 +1,827 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2010 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +package proto + +/* + * Routines for decoding protocol buffer data to construct in-memory representations. + */ + +import ( + "errors" + "fmt" + "io" + "os" + "reflect" +) + +// errOverflow is returned when an integer is too large to be represented. +var errOverflow = errors.New("proto: integer overflow") + +// The fundamental decoders that interpret bytes on the wire. +// Those that take integer types all return uint64 and are +// therefore of type valueDecoder. + +// DecodeVarint reads a varint-encoded integer from the slice. +// It returns the integer and the number of bytes consumed, or +// zero if there is not enough. +// This is the format for the +// int32, int64, uint32, uint64, bool, and enum +// protocol buffer types. +func DecodeVarint(buf []byte) (x uint64, n int) { + // x, n already 0 + for shift := uint(0); shift < 64; shift += 7 { + if n >= len(buf) { + return 0, 0 + } + b := uint64(buf[n]) + n++ + x |= (b & 0x7F) << shift + if (b & 0x80) == 0 { + return x, n + } + } + + // The number is too large to represent in a 64-bit value. + return 0, 0 +} + +// DecodeVarint reads a varint-encoded integer from the Buffer. +// This is the format for the +// int32, int64, uint32, uint64, bool, and enum +// protocol buffer types. +func (p *Buffer) DecodeVarint() (x uint64, err error) { + // x, err already 0 + + i := p.index + l := len(p.buf) + + for shift := uint(0); shift < 64; shift += 7 { + if i >= l { + err = io.ErrUnexpectedEOF + return + } + b := p.buf[i] + i++ + x |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + p.index = i + return + } + } + + // The number is too large to represent in a 64-bit value. + err = errOverflow + return +} + +// DecodeFixed64 reads a 64-bit integer from the Buffer. +// This is the format for the +// fixed64, sfixed64, and double protocol buffer types. +func (p *Buffer) DecodeFixed64() (x uint64, err error) { + // x, err already 0 + i := p.index + 8 + if i < 0 || i > len(p.buf) { + err = io.ErrUnexpectedEOF + return + } + p.index = i + + x = uint64(p.buf[i-8]) + x |= uint64(p.buf[i-7]) << 8 + x |= uint64(p.buf[i-6]) << 16 + x |= uint64(p.buf[i-5]) << 24 + x |= uint64(p.buf[i-4]) << 32 + x |= uint64(p.buf[i-3]) << 40 + x |= uint64(p.buf[i-2]) << 48 + x |= uint64(p.buf[i-1]) << 56 + return +} + +// DecodeFixed32 reads a 32-bit integer from the Buffer. +// This is the format for the +// fixed32, sfixed32, and float protocol buffer types. +func (p *Buffer) DecodeFixed32() (x uint64, err error) { + // x, err already 0 + i := p.index + 4 + if i < 0 || i > len(p.buf) { + err = io.ErrUnexpectedEOF + return + } + p.index = i + + x = uint64(p.buf[i-4]) + x |= uint64(p.buf[i-3]) << 8 + x |= uint64(p.buf[i-2]) << 16 + x |= uint64(p.buf[i-1]) << 24 + return +} + +// DecodeZigzag64 reads a zigzag-encoded 64-bit integer +// from the Buffer. +// This is the format used for the sint64 protocol buffer type. +func (p *Buffer) DecodeZigzag64() (x uint64, err error) { + x, err = p.DecodeVarint() + if err != nil { + return + } + x = (x >> 1) ^ uint64((int64(x&1)<<63)>>63) + return +} + +// DecodeZigzag32 reads a zigzag-encoded 32-bit integer +// from the Buffer. +// This is the format used for the sint32 protocol buffer type. +func (p *Buffer) DecodeZigzag32() (x uint64, err error) { + x, err = p.DecodeVarint() + if err != nil { + return + } + x = uint64((uint32(x) >> 1) ^ uint32((int32(x&1)<<31)>>31)) + return +} + +// These are not ValueDecoders: they produce an array of bytes or a string. +// bytes, embedded messages + +// DecodeRawBytes reads a count-delimited byte buffer from the Buffer. +// This is the format used for the bytes protocol buffer +// type and for embedded messages. +func (p *Buffer) DecodeRawBytes(alloc bool) (buf []byte, err error) { + n, err := p.DecodeVarint() + if err != nil { + return nil, err + } + + nb := int(n) + if nb < 0 { + return nil, fmt.Errorf("proto: bad byte length %d", nb) + } + end := p.index + nb + if end < p.index || end > len(p.buf) { + return nil, io.ErrUnexpectedEOF + } + + if !alloc { + // todo: check if can get more uses of alloc=false + buf = p.buf[p.index:end] + p.index += nb + return + } + + buf = make([]byte, nb) + copy(buf, p.buf[p.index:]) + p.index += nb + return +} + +// DecodeStringBytes reads an encoded string from the Buffer. +// This is the format used for the proto2 string type. +func (p *Buffer) DecodeStringBytes() (s string, err error) { + buf, err := p.DecodeRawBytes(false) + if err != nil { + return + } + return string(buf), nil +} + +// Skip the next item in the buffer. Its wire type is decoded and presented as an argument. +// If the protocol buffer has extensions, and the field matches, add it as an extension. +// Otherwise, if the XXX_unrecognized field exists, append the skipped data there. +func (o *Buffer) skipAndSave(t reflect.Type, tag, wire int, base structPointer, unrecField field) error { + oi := o.index + + err := o.skip(t, tag, wire) + if err != nil { + return err + } + + if !unrecField.IsValid() { + return nil + } + + ptr := structPointer_Bytes(base, unrecField) + + // Add the skipped field to struct field + obuf := o.buf + + o.buf = *ptr + o.EncodeVarint(uint64(tag<<3 | wire)) + *ptr = append(o.buf, obuf[oi:o.index]...) + + o.buf = obuf + + return nil +} + +// Skip the next item in the buffer. Its wire type is decoded and presented as an argument. +func (o *Buffer) skip(t reflect.Type, tag, wire int) error { + + var u uint64 + var err error + + switch wire { + case WireVarint: + _, err = o.DecodeVarint() + case WireFixed64: + _, err = o.DecodeFixed64() + case WireBytes: + _, err = o.DecodeRawBytes(false) + case WireFixed32: + _, err = o.DecodeFixed32() + case WireStartGroup: + for { + u, err = o.DecodeVarint() + if err != nil { + break + } + fwire := int(u & 0x7) + if fwire == WireEndGroup { + break + } + ftag := int(u >> 3) + err = o.skip(t, ftag, fwire) + if err != nil { + break + } + } + default: + err = fmt.Errorf("proto: can't skip unknown wire type %d for %s", wire, t) + } + return err +} + +// Unmarshaler is the interface representing objects that can +// unmarshal themselves. The method should reset the receiver before +// decoding starts. The argument points to data that may be +// overwritten, so implementations should not keep references to the +// buffer. +type Unmarshaler interface { + Unmarshal([]byte) error +} + +// Unmarshal parses the protocol buffer representation in buf and places the +// decoded result in pb. If the struct underlying pb does not match +// the data in buf, the results can be unpredictable. +// +// Unmarshal resets pb before starting to unmarshal, so any +// existing data in pb is always removed. Use UnmarshalMerge +// to preserve and append to existing data. +func Unmarshal(buf []byte, pb Message) error { + pb.Reset() + return UnmarshalMerge(buf, pb) +} + +// UnmarshalMerge parses the protocol buffer representation in buf and +// writes the decoded result to pb. If the struct underlying pb does not match +// the data in buf, the results can be unpredictable. +// +// UnmarshalMerge merges into existing data in pb. +// Most code should use Unmarshal instead. +func UnmarshalMerge(buf []byte, pb Message) error { + // If the object can unmarshal itself, let it. + if u, ok := pb.(Unmarshaler); ok { + return u.Unmarshal(buf) + } + return NewBuffer(buf).Unmarshal(pb) +} + +// Unmarshal parses the protocol buffer representation in the +// Buffer and places the decoded result in pb. If the struct +// underlying pb does not match the data in the buffer, the results can be +// unpredictable. +func (p *Buffer) Unmarshal(pb Message) error { + // If the object can unmarshal itself, let it. + if u, ok := pb.(Unmarshaler); ok { + err := u.Unmarshal(p.buf[p.index:]) + p.index = len(p.buf) + return err + } + + typ, base, err := getbase(pb) + if err != nil { + return err + } + + err = p.unmarshalType(typ.Elem(), GetProperties(typ.Elem()), false, base) + + if collectStats { + stats.Decode++ + } + + return err +} + +// unmarshalType does the work of unmarshaling a structure. +func (o *Buffer) unmarshalType(st reflect.Type, prop *StructProperties, is_group bool, base structPointer) error { + var state errorState + required, reqFields := prop.reqCount, uint64(0) + + var err error + for err == nil && o.index < len(o.buf) { + oi := o.index + var u uint64 + u, err = o.DecodeVarint() + if err != nil { + break + } + wire := int(u & 0x7) + if wire == WireEndGroup { + if is_group { + return nil // input is satisfied + } + return fmt.Errorf("proto: %s: wiretype end group for non-group", st) + } + tag := int(u >> 3) + if tag <= 0 { + return fmt.Errorf("proto: %s: illegal tag %d (wire type %d)", st, tag, wire) + } + fieldnum, ok := prop.decoderTags.get(tag) + if !ok { + // Maybe it's an extension? + if prop.extendable { + if e := structPointer_Interface(base, st).(extendableProto); isExtensionField(e, int32(tag)) { + if err = o.skip(st, tag, wire); err == nil { + ext := e.ExtensionMap()[int32(tag)] // may be missing + ext.enc = append(ext.enc, o.buf[oi:o.index]...) + e.ExtensionMap()[int32(tag)] = ext + } + continue + } + } + err = o.skipAndSave(st, tag, wire, base, prop.unrecField) + continue + } + p := prop.Prop[fieldnum] + + if p.dec == nil { + fmt.Fprintf(os.Stderr, "proto: no protobuf decoder for %s.%s\n", st, st.Field(fieldnum).Name) + continue + } + dec := p.dec + if wire != WireStartGroup && wire != p.WireType { + if wire == WireBytes && p.packedDec != nil { + // a packable field + dec = p.packedDec + } else { + err = fmt.Errorf("proto: bad wiretype for field %s.%s: got wiretype %d, want %d", st, st.Field(fieldnum).Name, wire, p.WireType) + continue + } + } + decErr := dec(o, p, base) + if decErr != nil && !state.shouldContinue(decErr, p) { + err = decErr + } + if err == nil && p.Required { + // Successfully decoded a required field. + if tag <= 64 { + // use bitmap for fields 1-64 to catch field reuse. + var mask uint64 = 1 << uint64(tag-1) + if reqFields&mask == 0 { + // new required field + reqFields |= mask + required-- + } + } else { + // This is imprecise. It can be fooled by a required field + // with a tag > 64 that is encoded twice; that's very rare. + // A fully correct implementation would require allocating + // a data structure, which we would like to avoid. + required-- + } + } + } + if err == nil { + if is_group { + return io.ErrUnexpectedEOF + } + if state.err != nil { + return state.err + } + if required > 0 { + // Not enough information to determine the exact field. If we use extra + // CPU, we could determine the field only if the missing required field + // has a tag <= 64 and we check reqFields. + return &RequiredNotSetError{"{Unknown}"} + } + } + return err +} + +// Individual type decoders +// For each, +// u is the decoded value, +// v is a pointer to the field (pointer) in the struct + +// Sizes of the pools to allocate inside the Buffer. +// The goal is modest amortization and allocation +// on at least 16-byte boundaries. +const ( + boolPoolSize = 16 + uint32PoolSize = 8 + uint64PoolSize = 4 +) + +// Decode a bool. +func (o *Buffer) dec_bool(p *Properties, base structPointer) error { + u, err := p.valDec(o) + if err != nil { + return err + } + if len(o.bools) == 0 { + o.bools = make([]bool, boolPoolSize) + } + o.bools[0] = u != 0 + *structPointer_Bool(base, p.field) = &o.bools[0] + o.bools = o.bools[1:] + return nil +} + +func (o *Buffer) dec_proto3_bool(p *Properties, base structPointer) error { + u, err := p.valDec(o) + if err != nil { + return err + } + *structPointer_BoolVal(base, p.field) = u != 0 + return nil +} + +// Decode an int32. +func (o *Buffer) dec_int32(p *Properties, base structPointer) error { + u, err := p.valDec(o) + if err != nil { + return err + } + word32_Set(structPointer_Word32(base, p.field), o, uint32(u)) + return nil +} + +func (o *Buffer) dec_proto3_int32(p *Properties, base structPointer) error { + u, err := p.valDec(o) + if err != nil { + return err + } + word32Val_Set(structPointer_Word32Val(base, p.field), uint32(u)) + return nil +} + +// Decode an int64. +func (o *Buffer) dec_int64(p *Properties, base structPointer) error { + u, err := p.valDec(o) + if err != nil { + return err + } + word64_Set(structPointer_Word64(base, p.field), o, u) + return nil +} + +func (o *Buffer) dec_proto3_int64(p *Properties, base structPointer) error { + u, err := p.valDec(o) + if err != nil { + return err + } + word64Val_Set(structPointer_Word64Val(base, p.field), o, u) + return nil +} + +// Decode a string. +func (o *Buffer) dec_string(p *Properties, base structPointer) error { + s, err := o.DecodeStringBytes() + if err != nil { + return err + } + *structPointer_String(base, p.field) = &s + return nil +} + +func (o *Buffer) dec_proto3_string(p *Properties, base structPointer) error { + s, err := o.DecodeStringBytes() + if err != nil { + return err + } + *structPointer_StringVal(base, p.field) = s + return nil +} + +// Decode a slice of bytes ([]byte). +func (o *Buffer) dec_slice_byte(p *Properties, base structPointer) error { + b, err := o.DecodeRawBytes(true) + if err != nil { + return err + } + *structPointer_Bytes(base, p.field) = b + return nil +} + +// Decode a slice of bools ([]bool). +func (o *Buffer) dec_slice_bool(p *Properties, base structPointer) error { + u, err := p.valDec(o) + if err != nil { + return err + } + v := structPointer_BoolSlice(base, p.field) + *v = append(*v, u != 0) + return nil +} + +// Decode a slice of bools ([]bool) in packed format. +func (o *Buffer) dec_slice_packed_bool(p *Properties, base structPointer) error { + v := structPointer_BoolSlice(base, p.field) + + nn, err := o.DecodeVarint() + if err != nil { + return err + } + nb := int(nn) // number of bytes of encoded bools + + y := *v + for i := 0; i < nb; i++ { + u, err := p.valDec(o) + if err != nil { + return err + } + y = append(y, u != 0) + } + + *v = y + return nil +} + +// Decode a slice of int32s ([]int32). +func (o *Buffer) dec_slice_int32(p *Properties, base structPointer) error { + u, err := p.valDec(o) + if err != nil { + return err + } + structPointer_Word32Slice(base, p.field).Append(uint32(u)) + return nil +} + +// Decode a slice of int32s ([]int32) in packed format. +func (o *Buffer) dec_slice_packed_int32(p *Properties, base structPointer) error { + v := structPointer_Word32Slice(base, p.field) + + nn, err := o.DecodeVarint() + if err != nil { + return err + } + nb := int(nn) // number of bytes of encoded int32s + + fin := o.index + nb + if fin < o.index { + return errOverflow + } + for o.index < fin { + u, err := p.valDec(o) + if err != nil { + return err + } + v.Append(uint32(u)) + } + return nil +} + +// Decode a slice of int64s ([]int64). +func (o *Buffer) dec_slice_int64(p *Properties, base structPointer) error { + u, err := p.valDec(o) + if err != nil { + return err + } + + structPointer_Word64Slice(base, p.field).Append(u) + return nil +} + +// Decode a slice of int64s ([]int64) in packed format. +func (o *Buffer) dec_slice_packed_int64(p *Properties, base structPointer) error { + v := structPointer_Word64Slice(base, p.field) + + nn, err := o.DecodeVarint() + if err != nil { + return err + } + nb := int(nn) // number of bytes of encoded int64s + + fin := o.index + nb + if fin < o.index { + return errOverflow + } + for o.index < fin { + u, err := p.valDec(o) + if err != nil { + return err + } + v.Append(u) + } + return nil +} + +// Decode a slice of strings ([]string). +func (o *Buffer) dec_slice_string(p *Properties, base structPointer) error { + s, err := o.DecodeStringBytes() + if err != nil { + return err + } + v := structPointer_StringSlice(base, p.field) + *v = append(*v, s) + return nil +} + +// Decode a slice of slice of bytes ([][]byte). +func (o *Buffer) dec_slice_slice_byte(p *Properties, base structPointer) error { + b, err := o.DecodeRawBytes(true) + if err != nil { + return err + } + v := structPointer_BytesSlice(base, p.field) + *v = append(*v, b) + return nil +} + +// Decode a map field. +func (o *Buffer) dec_new_map(p *Properties, base structPointer) error { + raw, err := o.DecodeRawBytes(false) + if err != nil { + return err + } + oi := o.index // index at the end of this map entry + o.index -= len(raw) // move buffer back to start of map entry + + mptr := structPointer_NewAt(base, p.field, p.mtype) // *map[K]V + if mptr.Elem().IsNil() { + mptr.Elem().Set(reflect.MakeMap(mptr.Type().Elem())) + } + v := mptr.Elem() // map[K]V + + // Prepare addressable doubly-indirect placeholders for the key and value types. + // See enc_new_map for why. + keyptr := reflect.New(reflect.PtrTo(p.mtype.Key())).Elem() // addressable *K + keybase := toStructPointer(keyptr.Addr()) // **K + + var valbase structPointer + var valptr reflect.Value + switch p.mtype.Elem().Kind() { + case reflect.Slice: + // []byte + var dummy []byte + valptr = reflect.ValueOf(&dummy) // *[]byte + valbase = toStructPointer(valptr) // *[]byte + case reflect.Ptr: + // message; valptr is **Msg; need to allocate the intermediate pointer + valptr = reflect.New(reflect.PtrTo(p.mtype.Elem())).Elem() // addressable *V + valptr.Set(reflect.New(valptr.Type().Elem())) + valbase = toStructPointer(valptr) + default: + // everything else + valptr = reflect.New(reflect.PtrTo(p.mtype.Elem())).Elem() // addressable *V + valbase = toStructPointer(valptr.Addr()) // **V + } + + // Decode. + // This parses a restricted wire format, namely the encoding of a message + // with two fields. See enc_new_map for the format. + for o.index < oi { + // tagcode for key and value properties are always a single byte + // because they have tags 1 and 2. + tagcode := o.buf[o.index] + o.index++ + switch tagcode { + case p.mkeyprop.tagcode[0]: + if err := p.mkeyprop.dec(o, p.mkeyprop, keybase); err != nil { + return err + } + case p.mvalprop.tagcode[0]: + if err := p.mvalprop.dec(o, p.mvalprop, valbase); err != nil { + return err + } + default: + // TODO: Should we silently skip this instead? + return fmt.Errorf("proto: bad map data tag %d", raw[0]) + } + } + keyelem, valelem := keyptr.Elem(), valptr.Elem() + if !keyelem.IsValid() || !valelem.IsValid() { + // We did not decode the key or the value in the map entry. + // Either way, it's an invalid map entry. + return fmt.Errorf("proto: bad map data: missing key/val") + } + + v.SetMapIndex(keyelem, valelem) + return nil +} + +// Decode a group. +func (o *Buffer) dec_struct_group(p *Properties, base structPointer) error { + bas := structPointer_GetStructPointer(base, p.field) + if structPointer_IsNil(bas) { + // allocate new nested message + bas = toStructPointer(reflect.New(p.stype)) + structPointer_SetStructPointer(base, p.field, bas) + } + return o.unmarshalType(p.stype, p.sprop, true, bas) +} + +// Decode an embedded message. +func (o *Buffer) dec_struct_message(p *Properties, base structPointer) (err error) { + raw, e := o.DecodeRawBytes(false) + if e != nil { + return e + } + + bas := structPointer_GetStructPointer(base, p.field) + if structPointer_IsNil(bas) { + // allocate new nested message + bas = toStructPointer(reflect.New(p.stype)) + structPointer_SetStructPointer(base, p.field, bas) + } + + // If the object can unmarshal itself, let it. + if p.isUnmarshaler { + iv := structPointer_Interface(bas, p.stype) + return iv.(Unmarshaler).Unmarshal(raw) + } + + obuf := o.buf + oi := o.index + o.buf = raw + o.index = 0 + + err = o.unmarshalType(p.stype, p.sprop, false, bas) + o.buf = obuf + o.index = oi + + return err +} + +// Decode a slice of embedded messages. +func (o *Buffer) dec_slice_struct_message(p *Properties, base structPointer) error { + return o.dec_slice_struct(p, false, base) +} + +// Decode a slice of embedded groups. +func (o *Buffer) dec_slice_struct_group(p *Properties, base structPointer) error { + return o.dec_slice_struct(p, true, base) +} + +// Decode a slice of structs ([]*struct). +func (o *Buffer) dec_slice_struct(p *Properties, is_group bool, base structPointer) error { + v := reflect.New(p.stype) + bas := toStructPointer(v) + structPointer_StructPointerSlice(base, p.field).Append(bas) + + if is_group { + err := o.unmarshalType(p.stype, p.sprop, is_group, bas) + return err + } + + raw, err := o.DecodeRawBytes(false) + if err != nil { + return err + } + + // If the object can unmarshal itself, let it. + if p.isUnmarshaler { + iv := v.Interface() + return iv.(Unmarshaler).Unmarshal(raw) + } + + obuf := o.buf + oi := o.index + o.buf = raw + o.index = 0 + + err = o.unmarshalType(p.stype, p.sprop, is_group, bas) + + o.buf = obuf + o.index = oi + + return err +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/encode.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/encode.go new file mode 100644 index 000000000..72c780b91 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/encode.go @@ -0,0 +1,1293 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2010 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +package proto + +/* + * Routines for encoding data into the wire format for protocol buffers. + */ + +import ( + "errors" + "fmt" + "reflect" + "sort" +) + +// RequiredNotSetError is the error returned if Marshal is called with +// a protocol buffer struct whose required fields have not +// all been initialized. It is also the error returned if Unmarshal is +// called with an encoded protocol buffer that does not include all the +// required fields. +// +// When printed, RequiredNotSetError reports the first unset required field in a +// message. If the field cannot be precisely determined, it is reported as +// "{Unknown}". +type RequiredNotSetError struct { + field string +} + +func (e *RequiredNotSetError) Error() string { + return fmt.Sprintf("proto: required field %q not set", e.field) +} + +var ( + // errRepeatedHasNil is the error returned if Marshal is called with + // a struct with a repeated field containing a nil element. + errRepeatedHasNil = errors.New("proto: repeated field has nil element") + + // ErrNil is the error returned if Marshal is called with nil. + ErrNil = errors.New("proto: Marshal called with nil") +) + +// The fundamental encoders that put bytes on the wire. +// Those that take integer types all accept uint64 and are +// therefore of type valueEncoder. + +const maxVarintBytes = 10 // maximum length of a varint + +// EncodeVarint returns the varint encoding of x. +// This is the format for the +// int32, int64, uint32, uint64, bool, and enum +// protocol buffer types. +// Not used by the package itself, but helpful to clients +// wishing to use the same encoding. +func EncodeVarint(x uint64) []byte { + var buf [maxVarintBytes]byte + var n int + for n = 0; x > 127; n++ { + buf[n] = 0x80 | uint8(x&0x7F) + x >>= 7 + } + buf[n] = uint8(x) + n++ + return buf[0:n] +} + +// EncodeVarint writes a varint-encoded integer to the Buffer. +// This is the format for the +// int32, int64, uint32, uint64, bool, and enum +// protocol buffer types. +func (p *Buffer) EncodeVarint(x uint64) error { + for x >= 1<<7 { + p.buf = append(p.buf, uint8(x&0x7f|0x80)) + x >>= 7 + } + p.buf = append(p.buf, uint8(x)) + return nil +} + +func sizeVarint(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} + +// EncodeFixed64 writes a 64-bit integer to the Buffer. +// This is the format for the +// fixed64, sfixed64, and double protocol buffer types. +func (p *Buffer) EncodeFixed64(x uint64) error { + p.buf = append(p.buf, + uint8(x), + uint8(x>>8), + uint8(x>>16), + uint8(x>>24), + uint8(x>>32), + uint8(x>>40), + uint8(x>>48), + uint8(x>>56)) + return nil +} + +func sizeFixed64(x uint64) int { + return 8 +} + +// EncodeFixed32 writes a 32-bit integer to the Buffer. +// This is the format for the +// fixed32, sfixed32, and float protocol buffer types. +func (p *Buffer) EncodeFixed32(x uint64) error { + p.buf = append(p.buf, + uint8(x), + uint8(x>>8), + uint8(x>>16), + uint8(x>>24)) + return nil +} + +func sizeFixed32(x uint64) int { + return 4 +} + +// EncodeZigzag64 writes a zigzag-encoded 64-bit integer +// to the Buffer. +// This is the format used for the sint64 protocol buffer type. +func (p *Buffer) EncodeZigzag64(x uint64) error { + // use signed number to get arithmetic right shift. + return p.EncodeVarint(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} + +func sizeZigzag64(x uint64) int { + return sizeVarint(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} + +// EncodeZigzag32 writes a zigzag-encoded 32-bit integer +// to the Buffer. +// This is the format used for the sint32 protocol buffer type. +func (p *Buffer) EncodeZigzag32(x uint64) error { + // use signed number to get arithmetic right shift. + return p.EncodeVarint(uint64((uint32(x) << 1) ^ uint32((int32(x) >> 31)))) +} + +func sizeZigzag32(x uint64) int { + return sizeVarint(uint64((uint32(x) << 1) ^ uint32((int32(x) >> 31)))) +} + +// EncodeRawBytes writes a count-delimited byte buffer to the Buffer. +// This is the format used for the bytes protocol buffer +// type and for embedded messages. +func (p *Buffer) EncodeRawBytes(b []byte) error { + p.EncodeVarint(uint64(len(b))) + p.buf = append(p.buf, b...) + return nil +} + +func sizeRawBytes(b []byte) int { + return sizeVarint(uint64(len(b))) + + len(b) +} + +// EncodeStringBytes writes an encoded string to the Buffer. +// This is the format used for the proto2 string type. +func (p *Buffer) EncodeStringBytes(s string) error { + p.EncodeVarint(uint64(len(s))) + p.buf = append(p.buf, s...) + return nil +} + +func sizeStringBytes(s string) int { + return sizeVarint(uint64(len(s))) + + len(s) +} + +// Marshaler is the interface representing objects that can marshal themselves. +type Marshaler interface { + Marshal() ([]byte, error) +} + +// Marshal takes the protocol buffer +// and encodes it into the wire format, returning the data. +func Marshal(pb Message) ([]byte, error) { + // Can the object marshal itself? + if m, ok := pb.(Marshaler); ok { + return m.Marshal() + } + p := NewBuffer(nil) + err := p.Marshal(pb) + var state errorState + if err != nil && !state.shouldContinue(err, nil) { + return nil, err + } + if p.buf == nil && err == nil { + // Return a non-nil slice on success. + return []byte{}, nil + } + return p.buf, err +} + +// Marshal takes the protocol buffer +// and encodes it into the wire format, writing the result to the +// Buffer. +func (p *Buffer) Marshal(pb Message) error { + // Can the object marshal itself? + if m, ok := pb.(Marshaler); ok { + data, err := m.Marshal() + if err != nil { + return err + } + p.buf = append(p.buf, data...) + return nil + } + + t, base, err := getbase(pb) + if structPointer_IsNil(base) { + return ErrNil + } + if err == nil { + err = p.enc_struct(GetProperties(t.Elem()), base) + } + + if collectStats { + stats.Encode++ + } + + return err +} + +// Size returns the encoded size of a protocol buffer. +func Size(pb Message) (n int) { + // Can the object marshal itself? If so, Size is slow. + // TODO: add Size to Marshaler, or add a Sizer interface. + if m, ok := pb.(Marshaler); ok { + b, _ := m.Marshal() + return len(b) + } + + t, base, err := getbase(pb) + if structPointer_IsNil(base) { + return 0 + } + if err == nil { + n = size_struct(GetProperties(t.Elem()), base) + } + + if collectStats { + stats.Size++ + } + + return +} + +// Individual type encoders. + +// Encode a bool. +func (o *Buffer) enc_bool(p *Properties, base structPointer) error { + v := *structPointer_Bool(base, p.field) + if v == nil { + return ErrNil + } + x := 0 + if *v { + x = 1 + } + o.buf = append(o.buf, p.tagcode...) + p.valEnc(o, uint64(x)) + return nil +} + +func (o *Buffer) enc_proto3_bool(p *Properties, base structPointer) error { + v := *structPointer_BoolVal(base, p.field) + if !v { + return ErrNil + } + o.buf = append(o.buf, p.tagcode...) + p.valEnc(o, 1) + return nil +} + +func size_bool(p *Properties, base structPointer) int { + v := *structPointer_Bool(base, p.field) + if v == nil { + return 0 + } + return len(p.tagcode) + 1 // each bool takes exactly one byte +} + +func size_proto3_bool(p *Properties, base structPointer) int { + v := *structPointer_BoolVal(base, p.field) + if !v { + return 0 + } + return len(p.tagcode) + 1 // each bool takes exactly one byte +} + +// Encode an int32. +func (o *Buffer) enc_int32(p *Properties, base structPointer) error { + v := structPointer_Word32(base, p.field) + if word32_IsNil(v) { + return ErrNil + } + x := int32(word32_Get(v)) // permit sign extension to use full 64-bit range + o.buf = append(o.buf, p.tagcode...) + p.valEnc(o, uint64(x)) + return nil +} + +func (o *Buffer) enc_proto3_int32(p *Properties, base structPointer) error { + v := structPointer_Word32Val(base, p.field) + x := int32(word32Val_Get(v)) // permit sign extension to use full 64-bit range + if x == 0 { + return ErrNil + } + o.buf = append(o.buf, p.tagcode...) + p.valEnc(o, uint64(x)) + return nil +} + +func size_int32(p *Properties, base structPointer) (n int) { + v := structPointer_Word32(base, p.field) + if word32_IsNil(v) { + return 0 + } + x := int32(word32_Get(v)) // permit sign extension to use full 64-bit range + n += len(p.tagcode) + n += p.valSize(uint64(x)) + return +} + +func size_proto3_int32(p *Properties, base structPointer) (n int) { + v := structPointer_Word32Val(base, p.field) + x := int32(word32Val_Get(v)) // permit sign extension to use full 64-bit range + if x == 0 { + return 0 + } + n += len(p.tagcode) + n += p.valSize(uint64(x)) + return +} + +// Encode a uint32. +// Exactly the same as int32, except for no sign extension. +func (o *Buffer) enc_uint32(p *Properties, base structPointer) error { + v := structPointer_Word32(base, p.field) + if word32_IsNil(v) { + return ErrNil + } + x := word32_Get(v) + o.buf = append(o.buf, p.tagcode...) + p.valEnc(o, uint64(x)) + return nil +} + +func (o *Buffer) enc_proto3_uint32(p *Properties, base structPointer) error { + v := structPointer_Word32Val(base, p.field) + x := word32Val_Get(v) + if x == 0 { + return ErrNil + } + o.buf = append(o.buf, p.tagcode...) + p.valEnc(o, uint64(x)) + return nil +} + +func size_uint32(p *Properties, base structPointer) (n int) { + v := structPointer_Word32(base, p.field) + if word32_IsNil(v) { + return 0 + } + x := word32_Get(v) + n += len(p.tagcode) + n += p.valSize(uint64(x)) + return +} + +func size_proto3_uint32(p *Properties, base structPointer) (n int) { + v := structPointer_Word32Val(base, p.field) + x := word32Val_Get(v) + if x == 0 { + return 0 + } + n += len(p.tagcode) + n += p.valSize(uint64(x)) + return +} + +// Encode an int64. +func (o *Buffer) enc_int64(p *Properties, base structPointer) error { + v := structPointer_Word64(base, p.field) + if word64_IsNil(v) { + return ErrNil + } + x := word64_Get(v) + o.buf = append(o.buf, p.tagcode...) + p.valEnc(o, x) + return nil +} + +func (o *Buffer) enc_proto3_int64(p *Properties, base structPointer) error { + v := structPointer_Word64Val(base, p.field) + x := word64Val_Get(v) + if x == 0 { + return ErrNil + } + o.buf = append(o.buf, p.tagcode...) + p.valEnc(o, x) + return nil +} + +func size_int64(p *Properties, base structPointer) (n int) { + v := structPointer_Word64(base, p.field) + if word64_IsNil(v) { + return 0 + } + x := word64_Get(v) + n += len(p.tagcode) + n += p.valSize(x) + return +} + +func size_proto3_int64(p *Properties, base structPointer) (n int) { + v := structPointer_Word64Val(base, p.field) + x := word64Val_Get(v) + if x == 0 { + return 0 + } + n += len(p.tagcode) + n += p.valSize(x) + return +} + +// Encode a string. +func (o *Buffer) enc_string(p *Properties, base structPointer) error { + v := *structPointer_String(base, p.field) + if v == nil { + return ErrNil + } + x := *v + o.buf = append(o.buf, p.tagcode...) + o.EncodeStringBytes(x) + return nil +} + +func (o *Buffer) enc_proto3_string(p *Properties, base structPointer) error { + v := *structPointer_StringVal(base, p.field) + if v == "" { + return ErrNil + } + o.buf = append(o.buf, p.tagcode...) + o.EncodeStringBytes(v) + return nil +} + +func size_string(p *Properties, base structPointer) (n int) { + v := *structPointer_String(base, p.field) + if v == nil { + return 0 + } + x := *v + n += len(p.tagcode) + n += sizeStringBytes(x) + return +} + +func size_proto3_string(p *Properties, base structPointer) (n int) { + v := *structPointer_StringVal(base, p.field) + if v == "" { + return 0 + } + n += len(p.tagcode) + n += sizeStringBytes(v) + return +} + +// All protocol buffer fields are nillable, but be careful. +func isNil(v reflect.Value) bool { + switch v.Kind() { + case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: + return v.IsNil() + } + return false +} + +// Encode a message struct. +func (o *Buffer) enc_struct_message(p *Properties, base structPointer) error { + var state errorState + structp := structPointer_GetStructPointer(base, p.field) + if structPointer_IsNil(structp) { + return ErrNil + } + + // Can the object marshal itself? + if p.isMarshaler { + m := structPointer_Interface(structp, p.stype).(Marshaler) + data, err := m.Marshal() + if err != nil && !state.shouldContinue(err, nil) { + return err + } + o.buf = append(o.buf, p.tagcode...) + o.EncodeRawBytes(data) + return nil + } + + o.buf = append(o.buf, p.tagcode...) + return o.enc_len_struct(p.sprop, structp, &state) +} + +func size_struct_message(p *Properties, base structPointer) int { + structp := structPointer_GetStructPointer(base, p.field) + if structPointer_IsNil(structp) { + return 0 + } + + // Can the object marshal itself? + if p.isMarshaler { + m := structPointer_Interface(structp, p.stype).(Marshaler) + data, _ := m.Marshal() + n0 := len(p.tagcode) + n1 := sizeRawBytes(data) + return n0 + n1 + } + + n0 := len(p.tagcode) + n1 := size_struct(p.sprop, structp) + n2 := sizeVarint(uint64(n1)) // size of encoded length + return n0 + n1 + n2 +} + +// Encode a group struct. +func (o *Buffer) enc_struct_group(p *Properties, base structPointer) error { + var state errorState + b := structPointer_GetStructPointer(base, p.field) + if structPointer_IsNil(b) { + return ErrNil + } + + o.EncodeVarint(uint64((p.Tag << 3) | WireStartGroup)) + err := o.enc_struct(p.sprop, b) + if err != nil && !state.shouldContinue(err, nil) { + return err + } + o.EncodeVarint(uint64((p.Tag << 3) | WireEndGroup)) + return state.err +} + +func size_struct_group(p *Properties, base structPointer) (n int) { + b := structPointer_GetStructPointer(base, p.field) + if structPointer_IsNil(b) { + return 0 + } + + n += sizeVarint(uint64((p.Tag << 3) | WireStartGroup)) + n += size_struct(p.sprop, b) + n += sizeVarint(uint64((p.Tag << 3) | WireEndGroup)) + return +} + +// Encode a slice of bools ([]bool). +func (o *Buffer) enc_slice_bool(p *Properties, base structPointer) error { + s := *structPointer_BoolSlice(base, p.field) + l := len(s) + if l == 0 { + return ErrNil + } + for _, x := range s { + o.buf = append(o.buf, p.tagcode...) + v := uint64(0) + if x { + v = 1 + } + p.valEnc(o, v) + } + return nil +} + +func size_slice_bool(p *Properties, base structPointer) int { + s := *structPointer_BoolSlice(base, p.field) + l := len(s) + if l == 0 { + return 0 + } + return l * (len(p.tagcode) + 1) // each bool takes exactly one byte +} + +// Encode a slice of bools ([]bool) in packed format. +func (o *Buffer) enc_slice_packed_bool(p *Properties, base structPointer) error { + s := *structPointer_BoolSlice(base, p.field) + l := len(s) + if l == 0 { + return ErrNil + } + o.buf = append(o.buf, p.tagcode...) + o.EncodeVarint(uint64(l)) // each bool takes exactly one byte + for _, x := range s { + v := uint64(0) + if x { + v = 1 + } + p.valEnc(o, v) + } + return nil +} + +func size_slice_packed_bool(p *Properties, base structPointer) (n int) { + s := *structPointer_BoolSlice(base, p.field) + l := len(s) + if l == 0 { + return 0 + } + n += len(p.tagcode) + n += sizeVarint(uint64(l)) + n += l // each bool takes exactly one byte + return +} + +// Encode a slice of bytes ([]byte). +func (o *Buffer) enc_slice_byte(p *Properties, base structPointer) error { + s := *structPointer_Bytes(base, p.field) + if s == nil { + return ErrNil + } + o.buf = append(o.buf, p.tagcode...) + o.EncodeRawBytes(s) + return nil +} + +func (o *Buffer) enc_proto3_slice_byte(p *Properties, base structPointer) error { + s := *structPointer_Bytes(base, p.field) + if len(s) == 0 { + return ErrNil + } + o.buf = append(o.buf, p.tagcode...) + o.EncodeRawBytes(s) + return nil +} + +func size_slice_byte(p *Properties, base structPointer) (n int) { + s := *structPointer_Bytes(base, p.field) + if s == nil { + return 0 + } + n += len(p.tagcode) + n += sizeRawBytes(s) + return +} + +func size_proto3_slice_byte(p *Properties, base structPointer) (n int) { + s := *structPointer_Bytes(base, p.field) + if len(s) == 0 { + return 0 + } + n += len(p.tagcode) + n += sizeRawBytes(s) + return +} + +// Encode a slice of int32s ([]int32). +func (o *Buffer) enc_slice_int32(p *Properties, base structPointer) error { + s := structPointer_Word32Slice(base, p.field) + l := s.Len() + if l == 0 { + return ErrNil + } + for i := 0; i < l; i++ { + o.buf = append(o.buf, p.tagcode...) + x := int32(s.Index(i)) // permit sign extension to use full 64-bit range + p.valEnc(o, uint64(x)) + } + return nil +} + +func size_slice_int32(p *Properties, base structPointer) (n int) { + s := structPointer_Word32Slice(base, p.field) + l := s.Len() + if l == 0 { + return 0 + } + for i := 0; i < l; i++ { + n += len(p.tagcode) + x := int32(s.Index(i)) // permit sign extension to use full 64-bit range + n += p.valSize(uint64(x)) + } + return +} + +// Encode a slice of int32s ([]int32) in packed format. +func (o *Buffer) enc_slice_packed_int32(p *Properties, base structPointer) error { + s := structPointer_Word32Slice(base, p.field) + l := s.Len() + if l == 0 { + return ErrNil + } + // TODO: Reuse a Buffer. + buf := NewBuffer(nil) + for i := 0; i < l; i++ { + x := int32(s.Index(i)) // permit sign extension to use full 64-bit range + p.valEnc(buf, uint64(x)) + } + + o.buf = append(o.buf, p.tagcode...) + o.EncodeVarint(uint64(len(buf.buf))) + o.buf = append(o.buf, buf.buf...) + return nil +} + +func size_slice_packed_int32(p *Properties, base structPointer) (n int) { + s := structPointer_Word32Slice(base, p.field) + l := s.Len() + if l == 0 { + return 0 + } + var bufSize int + for i := 0; i < l; i++ { + x := int32(s.Index(i)) // permit sign extension to use full 64-bit range + bufSize += p.valSize(uint64(x)) + } + + n += len(p.tagcode) + n += sizeVarint(uint64(bufSize)) + n += bufSize + return +} + +// Encode a slice of uint32s ([]uint32). +// Exactly the same as int32, except for no sign extension. +func (o *Buffer) enc_slice_uint32(p *Properties, base structPointer) error { + s := structPointer_Word32Slice(base, p.field) + l := s.Len() + if l == 0 { + return ErrNil + } + for i := 0; i < l; i++ { + o.buf = append(o.buf, p.tagcode...) + x := s.Index(i) + p.valEnc(o, uint64(x)) + } + return nil +} + +func size_slice_uint32(p *Properties, base structPointer) (n int) { + s := structPointer_Word32Slice(base, p.field) + l := s.Len() + if l == 0 { + return 0 + } + for i := 0; i < l; i++ { + n += len(p.tagcode) + x := s.Index(i) + n += p.valSize(uint64(x)) + } + return +} + +// Encode a slice of uint32s ([]uint32) in packed format. +// Exactly the same as int32, except for no sign extension. +func (o *Buffer) enc_slice_packed_uint32(p *Properties, base structPointer) error { + s := structPointer_Word32Slice(base, p.field) + l := s.Len() + if l == 0 { + return ErrNil + } + // TODO: Reuse a Buffer. + buf := NewBuffer(nil) + for i := 0; i < l; i++ { + p.valEnc(buf, uint64(s.Index(i))) + } + + o.buf = append(o.buf, p.tagcode...) + o.EncodeVarint(uint64(len(buf.buf))) + o.buf = append(o.buf, buf.buf...) + return nil +} + +func size_slice_packed_uint32(p *Properties, base structPointer) (n int) { + s := structPointer_Word32Slice(base, p.field) + l := s.Len() + if l == 0 { + return 0 + } + var bufSize int + for i := 0; i < l; i++ { + bufSize += p.valSize(uint64(s.Index(i))) + } + + n += len(p.tagcode) + n += sizeVarint(uint64(bufSize)) + n += bufSize + return +} + +// Encode a slice of int64s ([]int64). +func (o *Buffer) enc_slice_int64(p *Properties, base structPointer) error { + s := structPointer_Word64Slice(base, p.field) + l := s.Len() + if l == 0 { + return ErrNil + } + for i := 0; i < l; i++ { + o.buf = append(o.buf, p.tagcode...) + p.valEnc(o, s.Index(i)) + } + return nil +} + +func size_slice_int64(p *Properties, base structPointer) (n int) { + s := structPointer_Word64Slice(base, p.field) + l := s.Len() + if l == 0 { + return 0 + } + for i := 0; i < l; i++ { + n += len(p.tagcode) + n += p.valSize(s.Index(i)) + } + return +} + +// Encode a slice of int64s ([]int64) in packed format. +func (o *Buffer) enc_slice_packed_int64(p *Properties, base structPointer) error { + s := structPointer_Word64Slice(base, p.field) + l := s.Len() + if l == 0 { + return ErrNil + } + // TODO: Reuse a Buffer. + buf := NewBuffer(nil) + for i := 0; i < l; i++ { + p.valEnc(buf, s.Index(i)) + } + + o.buf = append(o.buf, p.tagcode...) + o.EncodeVarint(uint64(len(buf.buf))) + o.buf = append(o.buf, buf.buf...) + return nil +} + +func size_slice_packed_int64(p *Properties, base structPointer) (n int) { + s := structPointer_Word64Slice(base, p.field) + l := s.Len() + if l == 0 { + return 0 + } + var bufSize int + for i := 0; i < l; i++ { + bufSize += p.valSize(s.Index(i)) + } + + n += len(p.tagcode) + n += sizeVarint(uint64(bufSize)) + n += bufSize + return +} + +// Encode a slice of slice of bytes ([][]byte). +func (o *Buffer) enc_slice_slice_byte(p *Properties, base structPointer) error { + ss := *structPointer_BytesSlice(base, p.field) + l := len(ss) + if l == 0 { + return ErrNil + } + for i := 0; i < l; i++ { + o.buf = append(o.buf, p.tagcode...) + o.EncodeRawBytes(ss[i]) + } + return nil +} + +func size_slice_slice_byte(p *Properties, base structPointer) (n int) { + ss := *structPointer_BytesSlice(base, p.field) + l := len(ss) + if l == 0 { + return 0 + } + n += l * len(p.tagcode) + for i := 0; i < l; i++ { + n += sizeRawBytes(ss[i]) + } + return +} + +// Encode a slice of strings ([]string). +func (o *Buffer) enc_slice_string(p *Properties, base structPointer) error { + ss := *structPointer_StringSlice(base, p.field) + l := len(ss) + for i := 0; i < l; i++ { + o.buf = append(o.buf, p.tagcode...) + o.EncodeStringBytes(ss[i]) + } + return nil +} + +func size_slice_string(p *Properties, base structPointer) (n int) { + ss := *structPointer_StringSlice(base, p.field) + l := len(ss) + n += l * len(p.tagcode) + for i := 0; i < l; i++ { + n += sizeStringBytes(ss[i]) + } + return +} + +// Encode a slice of message structs ([]*struct). +func (o *Buffer) enc_slice_struct_message(p *Properties, base structPointer) error { + var state errorState + s := structPointer_StructPointerSlice(base, p.field) + l := s.Len() + + for i := 0; i < l; i++ { + structp := s.Index(i) + if structPointer_IsNil(structp) { + return errRepeatedHasNil + } + + // Can the object marshal itself? + if p.isMarshaler { + m := structPointer_Interface(structp, p.stype).(Marshaler) + data, err := m.Marshal() + if err != nil && !state.shouldContinue(err, nil) { + return err + } + o.buf = append(o.buf, p.tagcode...) + o.EncodeRawBytes(data) + continue + } + + o.buf = append(o.buf, p.tagcode...) + err := o.enc_len_struct(p.sprop, structp, &state) + if err != nil && !state.shouldContinue(err, nil) { + if err == ErrNil { + return errRepeatedHasNil + } + return err + } + } + return state.err +} + +func size_slice_struct_message(p *Properties, base structPointer) (n int) { + s := structPointer_StructPointerSlice(base, p.field) + l := s.Len() + n += l * len(p.tagcode) + for i := 0; i < l; i++ { + structp := s.Index(i) + if structPointer_IsNil(structp) { + return // return the size up to this point + } + + // Can the object marshal itself? + if p.isMarshaler { + m := structPointer_Interface(structp, p.stype).(Marshaler) + data, _ := m.Marshal() + n += len(p.tagcode) + n += sizeRawBytes(data) + continue + } + + n0 := size_struct(p.sprop, structp) + n1 := sizeVarint(uint64(n0)) // size of encoded length + n += n0 + n1 + } + return +} + +// Encode a slice of group structs ([]*struct). +func (o *Buffer) enc_slice_struct_group(p *Properties, base structPointer) error { + var state errorState + s := structPointer_StructPointerSlice(base, p.field) + l := s.Len() + + for i := 0; i < l; i++ { + b := s.Index(i) + if structPointer_IsNil(b) { + return errRepeatedHasNil + } + + o.EncodeVarint(uint64((p.Tag << 3) | WireStartGroup)) + + err := o.enc_struct(p.sprop, b) + + if err != nil && !state.shouldContinue(err, nil) { + if err == ErrNil { + return errRepeatedHasNil + } + return err + } + + o.EncodeVarint(uint64((p.Tag << 3) | WireEndGroup)) + } + return state.err +} + +func size_slice_struct_group(p *Properties, base structPointer) (n int) { + s := structPointer_StructPointerSlice(base, p.field) + l := s.Len() + + n += l * sizeVarint(uint64((p.Tag<<3)|WireStartGroup)) + n += l * sizeVarint(uint64((p.Tag<<3)|WireEndGroup)) + for i := 0; i < l; i++ { + b := s.Index(i) + if structPointer_IsNil(b) { + return // return size up to this point + } + + n += size_struct(p.sprop, b) + } + return +} + +// Encode an extension map. +func (o *Buffer) enc_map(p *Properties, base structPointer) error { + v := *structPointer_ExtMap(base, p.field) + if err := encodeExtensionMap(v); err != nil { + return err + } + // Fast-path for common cases: zero or one extensions. + if len(v) <= 1 { + for _, e := range v { + o.buf = append(o.buf, e.enc...) + } + return nil + } + + // Sort keys to provide a deterministic encoding. + keys := make([]int, 0, len(v)) + for k := range v { + keys = append(keys, int(k)) + } + sort.Ints(keys) + + for _, k := range keys { + o.buf = append(o.buf, v[int32(k)].enc...) + } + return nil +} + +func size_map(p *Properties, base structPointer) int { + v := *structPointer_ExtMap(base, p.field) + return sizeExtensionMap(v) +} + +// Encode a map field. +func (o *Buffer) enc_new_map(p *Properties, base structPointer) error { + var state errorState // XXX: or do we need to plumb this through? + + /* + A map defined as + map map_field = N; + is encoded in the same way as + message MapFieldEntry { + key_type key = 1; + value_type value = 2; + } + repeated MapFieldEntry map_field = N; + */ + + v := structPointer_NewAt(base, p.field, p.mtype).Elem() // map[K]V + if v.Len() == 0 { + return nil + } + + keycopy, valcopy, keybase, valbase := mapEncodeScratch(p.mtype) + + enc := func() error { + if err := p.mkeyprop.enc(o, p.mkeyprop, keybase); err != nil { + return err + } + if err := p.mvalprop.enc(o, p.mvalprop, valbase); err != nil { + return err + } + return nil + } + + keys := v.MapKeys() + sort.Sort(mapKeys(keys)) + for _, key := range keys { + val := v.MapIndex(key) + + // The only illegal map entry values are nil message pointers. + if val.Kind() == reflect.Ptr && val.IsNil() { + return errors.New("proto: map has nil element") + } + + keycopy.Set(key) + valcopy.Set(val) + + o.buf = append(o.buf, p.tagcode...) + if err := o.enc_len_thing(enc, &state); err != nil { + return err + } + } + return nil +} + +func size_new_map(p *Properties, base structPointer) int { + v := structPointer_NewAt(base, p.field, p.mtype).Elem() // map[K]V + + keycopy, valcopy, keybase, valbase := mapEncodeScratch(p.mtype) + + n := 0 + for _, key := range v.MapKeys() { + val := v.MapIndex(key) + keycopy.Set(key) + valcopy.Set(val) + + // Tag codes for key and val are the responsibility of the sub-sizer. + keysize := p.mkeyprop.size(p.mkeyprop, keybase) + valsize := p.mvalprop.size(p.mvalprop, valbase) + entry := keysize + valsize + // Add on tag code and length of map entry itself. + n += len(p.tagcode) + sizeVarint(uint64(entry)) + entry + } + return n +} + +// mapEncodeScratch returns a new reflect.Value matching the map's value type, +// and a structPointer suitable for passing to an encoder or sizer. +func mapEncodeScratch(mapType reflect.Type) (keycopy, valcopy reflect.Value, keybase, valbase structPointer) { + // Prepare addressable doubly-indirect placeholders for the key and value types. + // This is needed because the element-type encoders expect **T, but the map iteration produces T. + + keycopy = reflect.New(mapType.Key()).Elem() // addressable K + keyptr := reflect.New(reflect.PtrTo(keycopy.Type())).Elem() // addressable *K + keyptr.Set(keycopy.Addr()) // + keybase = toStructPointer(keyptr.Addr()) // **K + + // Value types are more varied and require special handling. + switch mapType.Elem().Kind() { + case reflect.Slice: + // []byte + var dummy []byte + valcopy = reflect.ValueOf(&dummy).Elem() // addressable []byte + valbase = toStructPointer(valcopy.Addr()) + case reflect.Ptr: + // message; the generated field type is map[K]*Msg (so V is *Msg), + // so we only need one level of indirection. + valcopy = reflect.New(mapType.Elem()).Elem() // addressable V + valbase = toStructPointer(valcopy.Addr()) + default: + // everything else + valcopy = reflect.New(mapType.Elem()).Elem() // addressable V + valptr := reflect.New(reflect.PtrTo(valcopy.Type())).Elem() // addressable *V + valptr.Set(valcopy.Addr()) // + valbase = toStructPointer(valptr.Addr()) // **V + } + return +} + +// Encode a struct. +func (o *Buffer) enc_struct(prop *StructProperties, base structPointer) error { + var state errorState + // Encode fields in tag order so that decoders may use optimizations + // that depend on the ordering. + // https://developers.google.com/protocol-buffers/docs/encoding#order + for _, i := range prop.order { + p := prop.Prop[i] + if p.enc != nil { + err := p.enc(o, p, base) + if err != nil { + if err == ErrNil { + if p.Required && state.err == nil { + state.err = &RequiredNotSetError{p.Name} + } + } else if err == errRepeatedHasNil { + // Give more context to nil values in repeated fields. + return errors.New("repeated field " + p.OrigName + " has nil element") + } else if !state.shouldContinue(err, p) { + return err + } + } + } + } + + // Add unrecognized fields at the end. + if prop.unrecField.IsValid() { + v := *structPointer_Bytes(base, prop.unrecField) + if len(v) > 0 { + o.buf = append(o.buf, v...) + } + } + + return state.err +} + +func size_struct(prop *StructProperties, base structPointer) (n int) { + for _, i := range prop.order { + p := prop.Prop[i] + if p.size != nil { + n += p.size(p, base) + } + } + + // Add unrecognized fields at the end. + if prop.unrecField.IsValid() { + v := *structPointer_Bytes(base, prop.unrecField) + n += len(v) + } + + return +} + +var zeroes [20]byte // longer than any conceivable sizeVarint + +// Encode a struct, preceded by its encoded length (as a varint). +func (o *Buffer) enc_len_struct(prop *StructProperties, base structPointer, state *errorState) error { + return o.enc_len_thing(func() error { return o.enc_struct(prop, base) }, state) +} + +// Encode something, preceded by its encoded length (as a varint). +func (o *Buffer) enc_len_thing(enc func() error, state *errorState) error { + iLen := len(o.buf) + o.buf = append(o.buf, 0, 0, 0, 0) // reserve four bytes for length + iMsg := len(o.buf) + err := enc() + if err != nil && !state.shouldContinue(err, nil) { + return err + } + lMsg := len(o.buf) - iMsg + lLen := sizeVarint(uint64(lMsg)) + switch x := lLen - (iMsg - iLen); { + case x > 0: // actual length is x bytes larger than the space we reserved + // Move msg x bytes right. + o.buf = append(o.buf, zeroes[:x]...) + copy(o.buf[iMsg+x:], o.buf[iMsg:iMsg+lMsg]) + case x < 0: // actual length is x bytes smaller than the space we reserved + // Move msg x bytes left. + copy(o.buf[iMsg+x:], o.buf[iMsg:iMsg+lMsg]) + o.buf = o.buf[:len(o.buf)+x] // x is negative + } + // Encode the length in the reserved space. + o.buf = o.buf[:iLen] + o.EncodeVarint(uint64(lMsg)) + o.buf = o.buf[:len(o.buf)+lMsg] + return state.err +} + +// errorState maintains the first error that occurs and updates that error +// with additional context. +type errorState struct { + err error +} + +// shouldContinue reports whether encoding should continue upon encountering the +// given error. If the error is RequiredNotSetError, shouldContinue returns true +// and, if this is the first appearance of that error, remembers it for future +// reporting. +// +// If prop is not nil, it may update any error with additional context about the +// field with the error. +func (s *errorState) shouldContinue(err error, prop *Properties) bool { + // Ignore unset required fields. + reqNotSet, ok := err.(*RequiredNotSetError) + if !ok { + return false + } + if s.err == nil { + if prop != nil { + err = &RequiredNotSetError{prop.Name + "." + reqNotSet.field} + } + s.err = err + } + return true +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/equal.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/equal.go new file mode 100644 index 000000000..d8673a3e9 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/equal.go @@ -0,0 +1,256 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2011 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +// Protocol buffer comparison. +// TODO: MessageSet. + +package proto + +import ( + "bytes" + "log" + "reflect" + "strings" +) + +/* +Equal returns true iff protocol buffers a and b are equal. +The arguments must both be pointers to protocol buffer structs. + +Equality is defined in this way: + - Two messages are equal iff they are the same type, + corresponding fields are equal, unknown field sets + are equal, and extensions sets are equal. + - Two set scalar fields are equal iff their values are equal. + If the fields are of a floating-point type, remember that + NaN != x for all x, including NaN. + - Two repeated fields are equal iff their lengths are the same, + and their corresponding elements are equal (a "bytes" field, + although represented by []byte, is not a repeated field) + - Two unset fields are equal. + - Two unknown field sets are equal if their current + encoded state is equal. + - Two extension sets are equal iff they have corresponding + elements that are pairwise equal. + - Every other combination of things are not equal. + +The return value is undefined if a and b are not protocol buffers. +*/ +func Equal(a, b Message) bool { + if a == nil || b == nil { + return a == b + } + v1, v2 := reflect.ValueOf(a), reflect.ValueOf(b) + if v1.Type() != v2.Type() { + return false + } + if v1.Kind() == reflect.Ptr { + if v1.IsNil() { + return v2.IsNil() + } + if v2.IsNil() { + return false + } + v1, v2 = v1.Elem(), v2.Elem() + } + if v1.Kind() != reflect.Struct { + return false + } + return equalStruct(v1, v2) +} + +// v1 and v2 are known to have the same type. +func equalStruct(v1, v2 reflect.Value) bool { + for i := 0; i < v1.NumField(); i++ { + f := v1.Type().Field(i) + if strings.HasPrefix(f.Name, "XXX_") { + continue + } + f1, f2 := v1.Field(i), v2.Field(i) + if f.Type.Kind() == reflect.Ptr { + if n1, n2 := f1.IsNil(), f2.IsNil(); n1 && n2 { + // both unset + continue + } else if n1 != n2 { + // set/unset mismatch + return false + } + b1, ok := f1.Interface().(raw) + if ok { + b2 := f2.Interface().(raw) + // RawMessage + if !bytes.Equal(b1.Bytes(), b2.Bytes()) { + return false + } + continue + } + f1, f2 = f1.Elem(), f2.Elem() + } + if !equalAny(f1, f2) { + return false + } + } + + if em1 := v1.FieldByName("XXX_extensions"); em1.IsValid() { + em2 := v2.FieldByName("XXX_extensions") + if !equalExtensions(v1.Type(), em1.Interface().(map[int32]Extension), em2.Interface().(map[int32]Extension)) { + return false + } + } + + uf := v1.FieldByName("XXX_unrecognized") + if !uf.IsValid() { + return true + } + + u1 := uf.Bytes() + u2 := v2.FieldByName("XXX_unrecognized").Bytes() + if !bytes.Equal(u1, u2) { + return false + } + + return true +} + +// v1 and v2 are known to have the same type. +func equalAny(v1, v2 reflect.Value) bool { + if v1.Type() == protoMessageType { + m1, _ := v1.Interface().(Message) + m2, _ := v2.Interface().(Message) + return Equal(m1, m2) + } + switch v1.Kind() { + case reflect.Bool: + return v1.Bool() == v2.Bool() + case reflect.Float32, reflect.Float64: + return v1.Float() == v2.Float() + case reflect.Int32, reflect.Int64: + return v1.Int() == v2.Int() + case reflect.Map: + if v1.Len() != v2.Len() { + return false + } + for _, key := range v1.MapKeys() { + val2 := v2.MapIndex(key) + if !val2.IsValid() { + // This key was not found in the second map. + return false + } + if !equalAny(v1.MapIndex(key), val2) { + return false + } + } + return true + case reflect.Ptr: + return equalAny(v1.Elem(), v2.Elem()) + case reflect.Slice: + if v1.Type().Elem().Kind() == reflect.Uint8 { + // short circuit: []byte + if v1.IsNil() != v2.IsNil() { + return false + } + return bytes.Equal(v1.Interface().([]byte), v2.Interface().([]byte)) + } + + if v1.Len() != v2.Len() { + return false + } + for i := 0; i < v1.Len(); i++ { + if !equalAny(v1.Index(i), v2.Index(i)) { + return false + } + } + return true + case reflect.String: + return v1.Interface().(string) == v2.Interface().(string) + case reflect.Struct: + return equalStruct(v1, v2) + case reflect.Uint32, reflect.Uint64: + return v1.Uint() == v2.Uint() + } + + // unknown type, so not a protocol buffer + log.Printf("proto: don't know how to compare %v", v1) + return false +} + +// base is the struct type that the extensions are based on. +// em1 and em2 are extension maps. +func equalExtensions(base reflect.Type, em1, em2 map[int32]Extension) bool { + if len(em1) != len(em2) { + return false + } + + for extNum, e1 := range em1 { + e2, ok := em2[extNum] + if !ok { + return false + } + + m1, m2 := e1.value, e2.value + + if m1 != nil && m2 != nil { + // Both are unencoded. + if !equalAny(reflect.ValueOf(m1), reflect.ValueOf(m2)) { + return false + } + continue + } + + // At least one is encoded. To do a semantically correct comparison + // we need to unmarshal them first. + var desc *ExtensionDesc + if m := extensionMaps[base]; m != nil { + desc = m[extNum] + } + if desc == nil { + log.Printf("proto: don't know how to compare extension %d of %v", extNum, base) + continue + } + var err error + if m1 == nil { + m1, err = decodeExtension(e1.enc, desc) + } + if m2 == nil && err == nil { + m2, err = decodeExtension(e2.enc, desc) + } + if err != nil { + // The encoded form is invalid. + log.Printf("proto: badly encoded extension %d of %v: %v", extNum, base, err) + return false + } + if !equalAny(reflect.ValueOf(m1), reflect.ValueOf(m2)) { + return false + } + } + + return true +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/equal_test.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/equal_test.go new file mode 100644 index 000000000..b322f65ab --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/equal_test.go @@ -0,0 +1,191 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2011 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +package proto_test + +import ( + "testing" + + . "github.com/golang/protobuf/proto" + pb "github.com/golang/protobuf/proto/testdata" +) + +// Four identical base messages. +// The init function adds extensions to some of them. +var messageWithoutExtension = &pb.MyMessage{Count: Int32(7)} +var messageWithExtension1a = &pb.MyMessage{Count: Int32(7)} +var messageWithExtension1b = &pb.MyMessage{Count: Int32(7)} +var messageWithExtension2 = &pb.MyMessage{Count: Int32(7)} + +// Two messages with non-message extensions. +var messageWithInt32Extension1 = &pb.MyMessage{Count: Int32(8)} +var messageWithInt32Extension2 = &pb.MyMessage{Count: Int32(8)} + +func init() { + ext1 := &pb.Ext{Data: String("Kirk")} + ext2 := &pb.Ext{Data: String("Picard")} + + // messageWithExtension1a has ext1, but never marshals it. + if err := SetExtension(messageWithExtension1a, pb.E_Ext_More, ext1); err != nil { + panic("SetExtension on 1a failed: " + err.Error()) + } + + // messageWithExtension1b is the unmarshaled form of messageWithExtension1a. + if err := SetExtension(messageWithExtension1b, pb.E_Ext_More, ext1); err != nil { + panic("SetExtension on 1b failed: " + err.Error()) + } + buf, err := Marshal(messageWithExtension1b) + if err != nil { + panic("Marshal of 1b failed: " + err.Error()) + } + messageWithExtension1b.Reset() + if err := Unmarshal(buf, messageWithExtension1b); err != nil { + panic("Unmarshal of 1b failed: " + err.Error()) + } + + // messageWithExtension2 has ext2. + if err := SetExtension(messageWithExtension2, pb.E_Ext_More, ext2); err != nil { + panic("SetExtension on 2 failed: " + err.Error()) + } + + if err := SetExtension(messageWithInt32Extension1, pb.E_Ext_Number, Int32(23)); err != nil { + panic("SetExtension on Int32-1 failed: " + err.Error()) + } + if err := SetExtension(messageWithInt32Extension1, pb.E_Ext_Number, Int32(24)); err != nil { + panic("SetExtension on Int32-2 failed: " + err.Error()) + } +} + +var EqualTests = []struct { + desc string + a, b Message + exp bool +}{ + {"different types", &pb.GoEnum{}, &pb.GoTestField{}, false}, + {"equal empty", &pb.GoEnum{}, &pb.GoEnum{}, true}, + {"nil vs nil", nil, nil, true}, + {"typed nil vs typed nil", (*pb.GoEnum)(nil), (*pb.GoEnum)(nil), true}, + {"typed nil vs empty", (*pb.GoEnum)(nil), &pb.GoEnum{}, false}, + {"different typed nil", (*pb.GoEnum)(nil), (*pb.GoTestField)(nil), false}, + + {"one set field, one unset field", &pb.GoTestField{Label: String("foo")}, &pb.GoTestField{}, false}, + {"one set field zero, one unset field", &pb.GoTest{Param: Int32(0)}, &pb.GoTest{}, false}, + {"different set fields", &pb.GoTestField{Label: String("foo")}, &pb.GoTestField{Label: String("bar")}, false}, + {"equal set", &pb.GoTestField{Label: String("foo")}, &pb.GoTestField{Label: String("foo")}, true}, + + {"repeated, one set", &pb.GoTest{F_Int32Repeated: []int32{2, 3}}, &pb.GoTest{}, false}, + {"repeated, different length", &pb.GoTest{F_Int32Repeated: []int32{2, 3}}, &pb.GoTest{F_Int32Repeated: []int32{2}}, false}, + {"repeated, different value", &pb.GoTest{F_Int32Repeated: []int32{2}}, &pb.GoTest{F_Int32Repeated: []int32{3}}, false}, + {"repeated, equal", &pb.GoTest{F_Int32Repeated: []int32{2, 4}}, &pb.GoTest{F_Int32Repeated: []int32{2, 4}}, true}, + {"repeated, nil equal nil", &pb.GoTest{F_Int32Repeated: nil}, &pb.GoTest{F_Int32Repeated: nil}, true}, + {"repeated, nil equal empty", &pb.GoTest{F_Int32Repeated: nil}, &pb.GoTest{F_Int32Repeated: []int32{}}, true}, + {"repeated, empty equal nil", &pb.GoTest{F_Int32Repeated: []int32{}}, &pb.GoTest{F_Int32Repeated: nil}, true}, + + { + "nested, different", + &pb.GoTest{RequiredField: &pb.GoTestField{Label: String("foo")}}, + &pb.GoTest{RequiredField: &pb.GoTestField{Label: String("bar")}}, + false, + }, + { + "nested, equal", + &pb.GoTest{RequiredField: &pb.GoTestField{Label: String("wow")}}, + &pb.GoTest{RequiredField: &pb.GoTestField{Label: String("wow")}}, + true, + }, + + {"bytes", &pb.OtherMessage{Value: []byte("foo")}, &pb.OtherMessage{Value: []byte("foo")}, true}, + {"bytes, empty", &pb.OtherMessage{Value: []byte{}}, &pb.OtherMessage{Value: []byte{}}, true}, + {"bytes, empty vs nil", &pb.OtherMessage{Value: []byte{}}, &pb.OtherMessage{Value: nil}, false}, + { + "repeated bytes", + &pb.MyMessage{RepBytes: [][]byte{[]byte("sham"), []byte("wow")}}, + &pb.MyMessage{RepBytes: [][]byte{[]byte("sham"), []byte("wow")}}, + true, + }, + + {"extension vs. no extension", messageWithoutExtension, messageWithExtension1a, false}, + {"extension vs. same extension", messageWithExtension1a, messageWithExtension1b, true}, + {"extension vs. different extension", messageWithExtension1a, messageWithExtension2, false}, + + {"int32 extension vs. itself", messageWithInt32Extension1, messageWithInt32Extension1, true}, + {"int32 extension vs. a different int32", messageWithInt32Extension1, messageWithInt32Extension2, false}, + + { + "message with group", + &pb.MyMessage{ + Count: Int32(1), + Somegroup: &pb.MyMessage_SomeGroup{ + GroupField: Int32(5), + }, + }, + &pb.MyMessage{ + Count: Int32(1), + Somegroup: &pb.MyMessage_SomeGroup{ + GroupField: Int32(5), + }, + }, + true, + }, + + { + "map same", + &pb.MessageWithMap{NameMapping: map[int32]string{1: "Ken"}}, + &pb.MessageWithMap{NameMapping: map[int32]string{1: "Ken"}}, + true, + }, + { + "map different entry", + &pb.MessageWithMap{NameMapping: map[int32]string{1: "Ken"}}, + &pb.MessageWithMap{NameMapping: map[int32]string{2: "Rob"}}, + false, + }, + { + "map different key only", + &pb.MessageWithMap{NameMapping: map[int32]string{1: "Ken"}}, + &pb.MessageWithMap{NameMapping: map[int32]string{2: "Ken"}}, + false, + }, + { + "map different value only", + &pb.MessageWithMap{NameMapping: map[int32]string{1: "Ken"}}, + &pb.MessageWithMap{NameMapping: map[int32]string{1: "Rob"}}, + false, + }, +} + +func TestEqual(t *testing.T) { + for _, tc := range EqualTests { + if res := Equal(tc.a, tc.b); res != tc.exp { + t.Errorf("%v: Equal(%v, %v) = %v, want %v", tc.desc, tc.a, tc.b, res, tc.exp) + } + } +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/extensions.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/extensions.go new file mode 100644 index 000000000..e591ccef7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/extensions.go @@ -0,0 +1,400 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2010 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +package proto + +/* + * Types and routines for supporting protocol buffer extensions. + */ + +import ( + "errors" + "fmt" + "reflect" + "strconv" + "sync" +) + +// ErrMissingExtension is the error returned by GetExtension if the named extension is not in the message. +var ErrMissingExtension = errors.New("proto: missing extension") + +// ExtensionRange represents a range of message extensions for a protocol buffer. +// Used in code generated by the protocol compiler. +type ExtensionRange struct { + Start, End int32 // both inclusive +} + +// extendableProto is an interface implemented by any protocol buffer that may be extended. +type extendableProto interface { + Message + ExtensionRangeArray() []ExtensionRange + ExtensionMap() map[int32]Extension +} + +var extendableProtoType = reflect.TypeOf((*extendableProto)(nil)).Elem() + +// ExtensionDesc represents an extension specification. +// Used in generated code from the protocol compiler. +type ExtensionDesc struct { + ExtendedType Message // nil pointer to the type that is being extended + ExtensionType interface{} // nil pointer to the extension type + Field int32 // field number + Name string // fully-qualified name of extension, for text formatting + Tag string // protobuf tag style +} + +func (ed *ExtensionDesc) repeated() bool { + t := reflect.TypeOf(ed.ExtensionType) + return t.Kind() == reflect.Slice && t.Elem().Kind() != reflect.Uint8 +} + +// Extension represents an extension in a message. +type Extension struct { + // When an extension is stored in a message using SetExtension + // only desc and value are set. When the message is marshaled + // enc will be set to the encoded form of the message. + // + // When a message is unmarshaled and contains extensions, each + // extension will have only enc set. When such an extension is + // accessed using GetExtension (or GetExtensions) desc and value + // will be set. + desc *ExtensionDesc + value interface{} + enc []byte +} + +// SetRawExtension is for testing only. +func SetRawExtension(base extendableProto, id int32, b []byte) { + base.ExtensionMap()[id] = Extension{enc: b} +} + +// isExtensionField returns true iff the given field number is in an extension range. +func isExtensionField(pb extendableProto, field int32) bool { + for _, er := range pb.ExtensionRangeArray() { + if er.Start <= field && field <= er.End { + return true + } + } + return false +} + +// checkExtensionTypes checks that the given extension is valid for pb. +func checkExtensionTypes(pb extendableProto, extension *ExtensionDesc) error { + // Check the extended type. + if a, b := reflect.TypeOf(pb), reflect.TypeOf(extension.ExtendedType); a != b { + return errors.New("proto: bad extended type; " + b.String() + " does not extend " + a.String()) + } + // Check the range. + if !isExtensionField(pb, extension.Field) { + return errors.New("proto: bad extension number; not in declared ranges") + } + return nil +} + +// extPropKey is sufficient to uniquely identify an extension. +type extPropKey struct { + base reflect.Type + field int32 +} + +var extProp = struct { + sync.RWMutex + m map[extPropKey]*Properties +}{ + m: make(map[extPropKey]*Properties), +} + +func extensionProperties(ed *ExtensionDesc) *Properties { + key := extPropKey{base: reflect.TypeOf(ed.ExtendedType), field: ed.Field} + + extProp.RLock() + if prop, ok := extProp.m[key]; ok { + extProp.RUnlock() + return prop + } + extProp.RUnlock() + + extProp.Lock() + defer extProp.Unlock() + // Check again. + if prop, ok := extProp.m[key]; ok { + return prop + } + + prop := new(Properties) + prop.Init(reflect.TypeOf(ed.ExtensionType), "unknown_name", ed.Tag, nil) + extProp.m[key] = prop + return prop +} + +// encodeExtensionMap encodes any unmarshaled (unencoded) extensions in m. +func encodeExtensionMap(m map[int32]Extension) error { + for k, e := range m { + if e.value == nil || e.desc == nil { + // Extension is only in its encoded form. + continue + } + + // We don't skip extensions that have an encoded form set, + // because the extension value may have been mutated after + // the last time this function was called. + + et := reflect.TypeOf(e.desc.ExtensionType) + props := extensionProperties(e.desc) + + p := NewBuffer(nil) + // If e.value has type T, the encoder expects a *struct{ X T }. + // Pass a *T with a zero field and hope it all works out. + x := reflect.New(et) + x.Elem().Set(reflect.ValueOf(e.value)) + if err := props.enc(p, props, toStructPointer(x)); err != nil { + return err + } + e.enc = p.buf + m[k] = e + } + return nil +} + +func sizeExtensionMap(m map[int32]Extension) (n int) { + for _, e := range m { + if e.value == nil || e.desc == nil { + // Extension is only in its encoded form. + n += len(e.enc) + continue + } + + // We don't skip extensions that have an encoded form set, + // because the extension value may have been mutated after + // the last time this function was called. + + et := reflect.TypeOf(e.desc.ExtensionType) + props := extensionProperties(e.desc) + + // If e.value has type T, the encoder expects a *struct{ X T }. + // Pass a *T with a zero field and hope it all works out. + x := reflect.New(et) + x.Elem().Set(reflect.ValueOf(e.value)) + n += props.size(props, toStructPointer(x)) + } + return +} + +// HasExtension returns whether the given extension is present in pb. +func HasExtension(pb extendableProto, extension *ExtensionDesc) bool { + // TODO: Check types, field numbers, etc.? + _, ok := pb.ExtensionMap()[extension.Field] + return ok +} + +// ClearExtension removes the given extension from pb. +func ClearExtension(pb extendableProto, extension *ExtensionDesc) { + // TODO: Check types, field numbers, etc.? + delete(pb.ExtensionMap(), extension.Field) +} + +// GetExtension parses and returns the given extension of pb. +// If the extension is not present and has no default value it returns ErrMissingExtension. +func GetExtension(pb extendableProto, extension *ExtensionDesc) (interface{}, error) { + if err := checkExtensionTypes(pb, extension); err != nil { + return nil, err + } + + emap := pb.ExtensionMap() + e, ok := emap[extension.Field] + if !ok { + // defaultExtensionValue returns the default value or + // ErrMissingExtension if there is no default. + return defaultExtensionValue(extension) + } + + if e.value != nil { + // Already decoded. Check the descriptor, though. + if e.desc != extension { + // This shouldn't happen. If it does, it means that + // GetExtension was called twice with two different + // descriptors with the same field number. + return nil, errors.New("proto: descriptor conflict") + } + return e.value, nil + } + + v, err := decodeExtension(e.enc, extension) + if err != nil { + return nil, err + } + + // Remember the decoded version and drop the encoded version. + // That way it is safe to mutate what we return. + e.value = v + e.desc = extension + e.enc = nil + emap[extension.Field] = e + return e.value, nil +} + +// defaultExtensionValue returns the default value for extension. +// If no default for an extension is defined ErrMissingExtension is returned. +func defaultExtensionValue(extension *ExtensionDesc) (interface{}, error) { + t := reflect.TypeOf(extension.ExtensionType) + props := extensionProperties(extension) + + sf, _, err := fieldDefault(t, props) + if err != nil { + return nil, err + } + + if sf == nil || sf.value == nil { + // There is no default value. + return nil, ErrMissingExtension + } + + if t.Kind() != reflect.Ptr { + // We do not need to return a Ptr, we can directly return sf.value. + return sf.value, nil + } + + // We need to return an interface{} that is a pointer to sf.value. + value := reflect.New(t).Elem() + value.Set(reflect.New(value.Type().Elem())) + if sf.kind == reflect.Int32 { + // We may have an int32 or an enum, but the underlying data is int32. + // Since we can't set an int32 into a non int32 reflect.value directly + // set it as a int32. + value.Elem().SetInt(int64(sf.value.(int32))) + } else { + value.Elem().Set(reflect.ValueOf(sf.value)) + } + return value.Interface(), nil +} + +// decodeExtension decodes an extension encoded in b. +func decodeExtension(b []byte, extension *ExtensionDesc) (interface{}, error) { + o := NewBuffer(b) + + t := reflect.TypeOf(extension.ExtensionType) + rep := extension.repeated() + + props := extensionProperties(extension) + + // t is a pointer to a struct, pointer to basic type or a slice. + // Allocate a "field" to store the pointer/slice itself; the + // pointer/slice will be stored here. We pass + // the address of this field to props.dec. + // This passes a zero field and a *t and lets props.dec + // interpret it as a *struct{ x t }. + value := reflect.New(t).Elem() + + for { + // Discard wire type and field number varint. It isn't needed. + if _, err := o.DecodeVarint(); err != nil { + return nil, err + } + + if err := props.dec(o, props, toStructPointer(value.Addr())); err != nil { + return nil, err + } + + if !rep || o.index >= len(o.buf) { + break + } + } + return value.Interface(), nil +} + +// GetExtensions returns a slice of the extensions present in pb that are also listed in es. +// The returned slice has the same length as es; missing extensions will appear as nil elements. +func GetExtensions(pb Message, es []*ExtensionDesc) (extensions []interface{}, err error) { + epb, ok := pb.(extendableProto) + if !ok { + err = errors.New("proto: not an extendable proto") + return + } + extensions = make([]interface{}, len(es)) + for i, e := range es { + extensions[i], err = GetExtension(epb, e) + if err == ErrMissingExtension { + err = nil + } + if err != nil { + return + } + } + return +} + +// SetExtension sets the specified extension of pb to the specified value. +func SetExtension(pb extendableProto, extension *ExtensionDesc, value interface{}) error { + if err := checkExtensionTypes(pb, extension); err != nil { + return err + } + typ := reflect.TypeOf(extension.ExtensionType) + if typ != reflect.TypeOf(value) { + return errors.New("proto: bad extension value type") + } + // nil extension values need to be caught early, because the + // encoder can't distinguish an ErrNil due to a nil extension + // from an ErrNil due to a missing field. Extensions are + // always optional, so the encoder would just swallow the error + // and drop all the extensions from the encoded message. + if reflect.ValueOf(value).IsNil() { + return fmt.Errorf("proto: SetExtension called with nil value of type %T", value) + } + + pb.ExtensionMap()[extension.Field] = Extension{desc: extension, value: value} + return nil +} + +// A global registry of extensions. +// The generated code will register the generated descriptors by calling RegisterExtension. + +var extensionMaps = make(map[reflect.Type]map[int32]*ExtensionDesc) + +// RegisterExtension is called from the generated code. +func RegisterExtension(desc *ExtensionDesc) { + st := reflect.TypeOf(desc.ExtendedType).Elem() + m := extensionMaps[st] + if m == nil { + m = make(map[int32]*ExtensionDesc) + extensionMaps[st] = m + } + if _, ok := m[desc.Field]; ok { + panic("proto: duplicate extension registered: " + st.String() + " " + strconv.Itoa(int(desc.Field))) + } + m[desc.Field] = desc +} + +// RegisteredExtensions returns a map of the registered extensions of a +// protocol buffer struct, indexed by the extension number. +// The argument pb should be a nil pointer to the struct type. +func RegisteredExtensions(pb Message) map[int32]*ExtensionDesc { + return extensionMaps[reflect.TypeOf(pb).Elem()] +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/extensions_test.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/extensions_test.go new file mode 100644 index 000000000..72552767d --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/extensions_test.go @@ -0,0 +1,292 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2014 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +package proto_test + +import ( + "fmt" + "reflect" + "testing" + + "github.com/golang/protobuf/proto" + pb "github.com/golang/protobuf/proto/testdata" +) + +func TestGetExtensionsWithMissingExtensions(t *testing.T) { + msg := &pb.MyMessage{} + ext1 := &pb.Ext{} + if err := proto.SetExtension(msg, pb.E_Ext_More, ext1); err != nil { + t.Fatalf("Could not set ext1: %s", ext1) + } + exts, err := proto.GetExtensions(msg, []*proto.ExtensionDesc{ + pb.E_Ext_More, + pb.E_Ext_Text, + }) + if err != nil { + t.Fatalf("GetExtensions() failed: %s", err) + } + if exts[0] != ext1 { + t.Errorf("ext1 not in returned extensions: %T %v", exts[0], exts[0]) + } + if exts[1] != nil { + t.Errorf("ext2 in returned extensions: %T %v", exts[1], exts[1]) + } +} + +func TestGetExtensionStability(t *testing.T) { + check := func(m *pb.MyMessage) bool { + ext1, err := proto.GetExtension(m, pb.E_Ext_More) + if err != nil { + t.Fatalf("GetExtension() failed: %s", err) + } + ext2, err := proto.GetExtension(m, pb.E_Ext_More) + if err != nil { + t.Fatalf("GetExtension() failed: %s", err) + } + return ext1 == ext2 + } + msg := &pb.MyMessage{Count: proto.Int32(4)} + ext0 := &pb.Ext{} + if err := proto.SetExtension(msg, pb.E_Ext_More, ext0); err != nil { + t.Fatalf("Could not set ext1: %s", ext0) + } + if !check(msg) { + t.Errorf("GetExtension() not stable before marshaling") + } + bb, err := proto.Marshal(msg) + if err != nil { + t.Fatalf("Marshal() failed: %s", err) + } + msg1 := &pb.MyMessage{} + err = proto.Unmarshal(bb, msg1) + if err != nil { + t.Fatalf("Unmarshal() failed: %s", err) + } + if !check(msg1) { + t.Errorf("GetExtension() not stable after unmarshaling") + } +} + +func TestGetExtensionDefaults(t *testing.T) { + var setFloat64 float64 = 1 + var setFloat32 float32 = 2 + var setInt32 int32 = 3 + var setInt64 int64 = 4 + var setUint32 uint32 = 5 + var setUint64 uint64 = 6 + var setBool = true + var setBool2 = false + var setString = "Goodnight string" + var setBytes = []byte("Goodnight bytes") + var setEnum = pb.DefaultsMessage_TWO + + type testcase struct { + ext *proto.ExtensionDesc // Extension we are testing. + want interface{} // Expected value of extension, or nil (meaning that GetExtension will fail). + def interface{} // Expected value of extension after ClearExtension(). + } + tests := []testcase{ + {pb.E_NoDefaultDouble, setFloat64, nil}, + {pb.E_NoDefaultFloat, setFloat32, nil}, + {pb.E_NoDefaultInt32, setInt32, nil}, + {pb.E_NoDefaultInt64, setInt64, nil}, + {pb.E_NoDefaultUint32, setUint32, nil}, + {pb.E_NoDefaultUint64, setUint64, nil}, + {pb.E_NoDefaultSint32, setInt32, nil}, + {pb.E_NoDefaultSint64, setInt64, nil}, + {pb.E_NoDefaultFixed32, setUint32, nil}, + {pb.E_NoDefaultFixed64, setUint64, nil}, + {pb.E_NoDefaultSfixed32, setInt32, nil}, + {pb.E_NoDefaultSfixed64, setInt64, nil}, + {pb.E_NoDefaultBool, setBool, nil}, + {pb.E_NoDefaultBool, setBool2, nil}, + {pb.E_NoDefaultString, setString, nil}, + {pb.E_NoDefaultBytes, setBytes, nil}, + {pb.E_NoDefaultEnum, setEnum, nil}, + {pb.E_DefaultDouble, setFloat64, float64(3.1415)}, + {pb.E_DefaultFloat, setFloat32, float32(3.14)}, + {pb.E_DefaultInt32, setInt32, int32(42)}, + {pb.E_DefaultInt64, setInt64, int64(43)}, + {pb.E_DefaultUint32, setUint32, uint32(44)}, + {pb.E_DefaultUint64, setUint64, uint64(45)}, + {pb.E_DefaultSint32, setInt32, int32(46)}, + {pb.E_DefaultSint64, setInt64, int64(47)}, + {pb.E_DefaultFixed32, setUint32, uint32(48)}, + {pb.E_DefaultFixed64, setUint64, uint64(49)}, + {pb.E_DefaultSfixed32, setInt32, int32(50)}, + {pb.E_DefaultSfixed64, setInt64, int64(51)}, + {pb.E_DefaultBool, setBool, true}, + {pb.E_DefaultBool, setBool2, true}, + {pb.E_DefaultString, setString, "Hello, string"}, + {pb.E_DefaultBytes, setBytes, []byte("Hello, bytes")}, + {pb.E_DefaultEnum, setEnum, pb.DefaultsMessage_ONE}, + } + + checkVal := func(test testcase, msg *pb.DefaultsMessage, valWant interface{}) error { + val, err := proto.GetExtension(msg, test.ext) + if err != nil { + if valWant != nil { + return fmt.Errorf("GetExtension(): %s", err) + } + if want := proto.ErrMissingExtension; err != want { + return fmt.Errorf("Unexpected error: got %v, want %v", err, want) + } + return nil + } + + // All proto2 extension values are either a pointer to a value or a slice of values. + ty := reflect.TypeOf(val) + tyWant := reflect.TypeOf(test.ext.ExtensionType) + if got, want := ty, tyWant; got != want { + return fmt.Errorf("unexpected reflect.TypeOf(): got %v want %v", got, want) + } + tye := ty.Elem() + tyeWant := tyWant.Elem() + if got, want := tye, tyeWant; got != want { + return fmt.Errorf("unexpected reflect.TypeOf().Elem(): got %v want %v", got, want) + } + + // Check the name of the type of the value. + // If it is an enum it will be type int32 with the name of the enum. + if got, want := tye.Name(), tye.Name(); got != want { + return fmt.Errorf("unexpected reflect.TypeOf().Elem().Name(): got %v want %v", got, want) + } + + // Check that value is what we expect. + // If we have a pointer in val, get the value it points to. + valExp := val + if ty.Kind() == reflect.Ptr { + valExp = reflect.ValueOf(val).Elem().Interface() + } + if got, want := valExp, valWant; !reflect.DeepEqual(got, want) { + return fmt.Errorf("unexpected reflect.DeepEqual(): got %v want %v", got, want) + } + + return nil + } + + setTo := func(test testcase) interface{} { + setTo := reflect.ValueOf(test.want) + if typ := reflect.TypeOf(test.ext.ExtensionType); typ.Kind() == reflect.Ptr { + setTo = reflect.New(typ).Elem() + setTo.Set(reflect.New(setTo.Type().Elem())) + setTo.Elem().Set(reflect.ValueOf(test.want)) + } + return setTo.Interface() + } + + for _, test := range tests { + msg := &pb.DefaultsMessage{} + name := test.ext.Name + + // Check the initial value. + if err := checkVal(test, msg, test.def); err != nil { + t.Errorf("%s: %v", name, err) + } + + // Set the per-type value and check value. + name = fmt.Sprintf("%s (set to %T %v)", name, test.want, test.want) + if err := proto.SetExtension(msg, test.ext, setTo(test)); err != nil { + t.Errorf("%s: SetExtension(): %v", name, err) + continue + } + if err := checkVal(test, msg, test.want); err != nil { + t.Errorf("%s: %v", name, err) + continue + } + + // Set and check the value. + name += " (cleared)" + proto.ClearExtension(msg, test.ext) + if err := checkVal(test, msg, test.def); err != nil { + t.Errorf("%s: %v", name, err) + } + } +} + +func TestExtensionsRoundTrip(t *testing.T) { + msg := &pb.MyMessage{} + ext1 := &pb.Ext{ + Data: proto.String("hi"), + } + ext2 := &pb.Ext{ + Data: proto.String("there"), + } + exists := proto.HasExtension(msg, pb.E_Ext_More) + if exists { + t.Error("Extension More present unexpectedly") + } + if err := proto.SetExtension(msg, pb.E_Ext_More, ext1); err != nil { + t.Error(err) + } + if err := proto.SetExtension(msg, pb.E_Ext_More, ext2); err != nil { + t.Error(err) + } + e, err := proto.GetExtension(msg, pb.E_Ext_More) + if err != nil { + t.Error(err) + } + x, ok := e.(*pb.Ext) + if !ok { + t.Errorf("e has type %T, expected testdata.Ext", e) + } else if *x.Data != "there" { + t.Errorf("SetExtension failed to overwrite, got %+v, not 'there'", x) + } + proto.ClearExtension(msg, pb.E_Ext_More) + if _, err = proto.GetExtension(msg, pb.E_Ext_More); err != proto.ErrMissingExtension { + t.Errorf("got %v, expected ErrMissingExtension", e) + } + if _, err := proto.GetExtension(msg, pb.E_X215); err == nil { + t.Error("expected bad extension error, got nil") + } + if err := proto.SetExtension(msg, pb.E_X215, 12); err == nil { + t.Error("expected extension err") + } + if err := proto.SetExtension(msg, pb.E_Ext_More, 12); err == nil { + t.Error("expected some sort of type mismatch error, got nil") + } +} + +func TestNilExtension(t *testing.T) { + msg := &pb.MyMessage{ + Count: proto.Int32(1), + } + if err := proto.SetExtension(msg, pb.E_Ext_Text, proto.String("hello")); err != nil { + t.Fatal(err) + } + if err := proto.SetExtension(msg, pb.E_Ext_More, (*pb.Ext)(nil)); err == nil { + t.Error("expected SetExtension to fail due to a nil extension") + } else if want := "proto: SetExtension called with nil value of type *testdata.Ext"; err.Error() != want { + t.Errorf("expected error %v, got %v", want, err) + } + // Note: if the behavior of Marshal is ever changed to ignore nil extensions, update + // this test to verify that E_Ext_Text is properly propagated through marshal->unmarshal. +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/lib.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/lib.go new file mode 100644 index 000000000..0b28b0864 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/lib.go @@ -0,0 +1,813 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2010 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +/* +Package proto converts data structures to and from the wire format of +protocol buffers. It works in concert with the Go source code generated +for .proto files by the protocol compiler. + +A summary of the properties of the protocol buffer interface +for a protocol buffer variable v: + + - Names are turned from camel_case to CamelCase for export. + - There are no methods on v to set fields; just treat + them as structure fields. + - There are getters that return a field's value if set, + and return the field's default value if unset. + The getters work even if the receiver is a nil message. + - The zero value for a struct is its correct initialization state. + All desired fields must be set before marshaling. + - A Reset() method will restore a protobuf struct to its zero state. + - Non-repeated fields are pointers to the values; nil means unset. + That is, optional or required field int32 f becomes F *int32. + - Repeated fields are slices. + - Helper functions are available to aid the setting of fields. + msg.Foo = proto.String("hello") // set field + - Constants are defined to hold the default values of all fields that + have them. They have the form Default_StructName_FieldName. + Because the getter methods handle defaulted values, + direct use of these constants should be rare. + - Enums are given type names and maps from names to values. + Enum values are prefixed by the enclosing message's name, or by the + enum's type name if it is a top-level enum. Enum types have a String + method, and a Enum method to assist in message construction. + - Nested messages, groups and enums have type names prefixed with the name of + the surrounding message type. + - Extensions are given descriptor names that start with E_, + followed by an underscore-delimited list of the nested messages + that contain it (if any) followed by the CamelCased name of the + extension field itself. HasExtension, ClearExtension, GetExtension + and SetExtension are functions for manipulating extensions. + - Marshal and Unmarshal are functions to encode and decode the wire format. + +The simplest way to describe this is to see an example. +Given file test.proto, containing + + package example; + + enum FOO { X = 17; } + + message Test { + required string label = 1; + optional int32 type = 2 [default=77]; + repeated int64 reps = 3; + optional group OptionalGroup = 4 { + required string RequiredField = 5; + } + } + +The resulting file, test.pb.go, is: + + package example + + import proto "github.com/golang/protobuf/proto" + import math "math" + + type FOO int32 + const ( + FOO_X FOO = 17 + ) + var FOO_name = map[int32]string{ + 17: "X", + } + var FOO_value = map[string]int32{ + "X": 17, + } + + func (x FOO) Enum() *FOO { + p := new(FOO) + *p = x + return p + } + func (x FOO) String() string { + return proto.EnumName(FOO_name, int32(x)) + } + func (x *FOO) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(FOO_value, data) + if err != nil { + return err + } + *x = FOO(value) + return nil + } + + type Test struct { + Label *string `protobuf:"bytes,1,req,name=label" json:"label,omitempty"` + Type *int32 `protobuf:"varint,2,opt,name=type,def=77" json:"type,omitempty"` + Reps []int64 `protobuf:"varint,3,rep,name=reps" json:"reps,omitempty"` + Optionalgroup *Test_OptionalGroup `protobuf:"group,4,opt,name=OptionalGroup" json:"optionalgroup,omitempty"` + XXX_unrecognized []byte `json:"-"` + } + func (m *Test) Reset() { *m = Test{} } + func (m *Test) String() string { return proto.CompactTextString(m) } + func (*Test) ProtoMessage() {} + const Default_Test_Type int32 = 77 + + func (m *Test) GetLabel() string { + if m != nil && m.Label != nil { + return *m.Label + } + return "" + } + + func (m *Test) GetType() int32 { + if m != nil && m.Type != nil { + return *m.Type + } + return Default_Test_Type + } + + func (m *Test) GetOptionalgroup() *Test_OptionalGroup { + if m != nil { + return m.Optionalgroup + } + return nil + } + + type Test_OptionalGroup struct { + RequiredField *string `protobuf:"bytes,5,req" json:"RequiredField,omitempty"` + } + func (m *Test_OptionalGroup) Reset() { *m = Test_OptionalGroup{} } + func (m *Test_OptionalGroup) String() string { return proto.CompactTextString(m) } + + func (m *Test_OptionalGroup) GetRequiredField() string { + if m != nil && m.RequiredField != nil { + return *m.RequiredField + } + return "" + } + + func init() { + proto.RegisterEnum("example.FOO", FOO_name, FOO_value) + } + +To create and play with a Test object: + +package main + + import ( + "log" + + "github.com/golang/protobuf/proto" + pb "./example.pb" + ) + + func main() { + test := &pb.Test{ + Label: proto.String("hello"), + Type: proto.Int32(17), + Optionalgroup: &pb.Test_OptionalGroup{ + RequiredField: proto.String("good bye"), + }, + } + data, err := proto.Marshal(test) + if err != nil { + log.Fatal("marshaling error: ", err) + } + newTest := &pb.Test{} + err = proto.Unmarshal(data, newTest) + if err != nil { + log.Fatal("unmarshaling error: ", err) + } + // Now test and newTest contain the same data. + if test.GetLabel() != newTest.GetLabel() { + log.Fatalf("data mismatch %q != %q", test.GetLabel(), newTest.GetLabel()) + } + // etc. + } +*/ +package proto + +import ( + "encoding/json" + "fmt" + "log" + "reflect" + "strconv" + "sync" +) + +// Message is implemented by generated protocol buffer messages. +type Message interface { + Reset() + String() string + ProtoMessage() +} + +// Stats records allocation details about the protocol buffer encoders +// and decoders. Useful for tuning the library itself. +type Stats struct { + Emalloc uint64 // mallocs in encode + Dmalloc uint64 // mallocs in decode + Encode uint64 // number of encodes + Decode uint64 // number of decodes + Chit uint64 // number of cache hits + Cmiss uint64 // number of cache misses + Size uint64 // number of sizes +} + +// Set to true to enable stats collection. +const collectStats = false + +var stats Stats + +// GetStats returns a copy of the global Stats structure. +func GetStats() Stats { return stats } + +// A Buffer is a buffer manager for marshaling and unmarshaling +// protocol buffers. It may be reused between invocations to +// reduce memory usage. It is not necessary to use a Buffer; +// the global functions Marshal and Unmarshal create a +// temporary Buffer and are fine for most applications. +type Buffer struct { + buf []byte // encode/decode byte stream + index int // write point + + // pools of basic types to amortize allocation. + bools []bool + uint32s []uint32 + uint64s []uint64 + + // extra pools, only used with pointer_reflect.go + int32s []int32 + int64s []int64 + float32s []float32 + float64s []float64 +} + +// NewBuffer allocates a new Buffer and initializes its internal data to +// the contents of the argument slice. +func NewBuffer(e []byte) *Buffer { + return &Buffer{buf: e} +} + +// Reset resets the Buffer, ready for marshaling a new protocol buffer. +func (p *Buffer) Reset() { + p.buf = p.buf[0:0] // for reading/writing + p.index = 0 // for reading +} + +// SetBuf replaces the internal buffer with the slice, +// ready for unmarshaling the contents of the slice. +func (p *Buffer) SetBuf(s []byte) { + p.buf = s + p.index = 0 +} + +// Bytes returns the contents of the Buffer. +func (p *Buffer) Bytes() []byte { return p.buf } + +/* + * Helper routines for simplifying the creation of optional fields of basic type. + */ + +// Bool is a helper routine that allocates a new bool value +// to store v and returns a pointer to it. +func Bool(v bool) *bool { + return &v +} + +// Int32 is a helper routine that allocates a new int32 value +// to store v and returns a pointer to it. +func Int32(v int32) *int32 { + return &v +} + +// Int is a helper routine that allocates a new int32 value +// to store v and returns a pointer to it, but unlike Int32 +// its argument value is an int. +func Int(v int) *int32 { + p := new(int32) + *p = int32(v) + return p +} + +// Int64 is a helper routine that allocates a new int64 value +// to store v and returns a pointer to it. +func Int64(v int64) *int64 { + return &v +} + +// Float32 is a helper routine that allocates a new float32 value +// to store v and returns a pointer to it. +func Float32(v float32) *float32 { + return &v +} + +// Float64 is a helper routine that allocates a new float64 value +// to store v and returns a pointer to it. +func Float64(v float64) *float64 { + return &v +} + +// Uint32 is a helper routine that allocates a new uint32 value +// to store v and returns a pointer to it. +func Uint32(v uint32) *uint32 { + return &v +} + +// Uint64 is a helper routine that allocates a new uint64 value +// to store v and returns a pointer to it. +func Uint64(v uint64) *uint64 { + return &v +} + +// String is a helper routine that allocates a new string value +// to store v and returns a pointer to it. +func String(v string) *string { + return &v +} + +// EnumName is a helper function to simplify printing protocol buffer enums +// by name. Given an enum map and a value, it returns a useful string. +func EnumName(m map[int32]string, v int32) string { + s, ok := m[v] + if ok { + return s + } + return strconv.Itoa(int(v)) +} + +// UnmarshalJSONEnum is a helper function to simplify recovering enum int values +// from their JSON-encoded representation. Given a map from the enum's symbolic +// names to its int values, and a byte buffer containing the JSON-encoded +// value, it returns an int32 that can be cast to the enum type by the caller. +// +// The function can deal with both JSON representations, numeric and symbolic. +func UnmarshalJSONEnum(m map[string]int32, data []byte, enumName string) (int32, error) { + if data[0] == '"' { + // New style: enums are strings. + var repr string + if err := json.Unmarshal(data, &repr); err != nil { + return -1, err + } + val, ok := m[repr] + if !ok { + return 0, fmt.Errorf("unrecognized enum %s value %q", enumName, repr) + } + return val, nil + } + // Old style: enums are ints. + var val int32 + if err := json.Unmarshal(data, &val); err != nil { + return 0, fmt.Errorf("cannot unmarshal %#q into enum %s", data, enumName) + } + return val, nil +} + +// DebugPrint dumps the encoded data in b in a debugging format with a header +// including the string s. Used in testing but made available for general debugging. +func (p *Buffer) DebugPrint(s string, b []byte) { + var u uint64 + + obuf := p.buf + index := p.index + p.buf = b + p.index = 0 + depth := 0 + + fmt.Printf("\n--- %s ---\n", s) + +out: + for { + for i := 0; i < depth; i++ { + fmt.Print(" ") + } + + index := p.index + if index == len(p.buf) { + break + } + + op, err := p.DecodeVarint() + if err != nil { + fmt.Printf("%3d: fetching op err %v\n", index, err) + break out + } + tag := op >> 3 + wire := op & 7 + + switch wire { + default: + fmt.Printf("%3d: t=%3d unknown wire=%d\n", + index, tag, wire) + break out + + case WireBytes: + var r []byte + + r, err = p.DecodeRawBytes(false) + if err != nil { + break out + } + fmt.Printf("%3d: t=%3d bytes [%d]", index, tag, len(r)) + if len(r) <= 6 { + for i := 0; i < len(r); i++ { + fmt.Printf(" %.2x", r[i]) + } + } else { + for i := 0; i < 3; i++ { + fmt.Printf(" %.2x", r[i]) + } + fmt.Printf(" ..") + for i := len(r) - 3; i < len(r); i++ { + fmt.Printf(" %.2x", r[i]) + } + } + fmt.Printf("\n") + + case WireFixed32: + u, err = p.DecodeFixed32() + if err != nil { + fmt.Printf("%3d: t=%3d fix32 err %v\n", index, tag, err) + break out + } + fmt.Printf("%3d: t=%3d fix32 %d\n", index, tag, u) + + case WireFixed64: + u, err = p.DecodeFixed64() + if err != nil { + fmt.Printf("%3d: t=%3d fix64 err %v\n", index, tag, err) + break out + } + fmt.Printf("%3d: t=%3d fix64 %d\n", index, tag, u) + break + + case WireVarint: + u, err = p.DecodeVarint() + if err != nil { + fmt.Printf("%3d: t=%3d varint err %v\n", index, tag, err) + break out + } + fmt.Printf("%3d: t=%3d varint %d\n", index, tag, u) + + case WireStartGroup: + if err != nil { + fmt.Printf("%3d: t=%3d start err %v\n", index, tag, err) + break out + } + fmt.Printf("%3d: t=%3d start\n", index, tag) + depth++ + + case WireEndGroup: + depth-- + if err != nil { + fmt.Printf("%3d: t=%3d end err %v\n", index, tag, err) + break out + } + fmt.Printf("%3d: t=%3d end\n", index, tag) + } + } + + if depth != 0 { + fmt.Printf("%3d: start-end not balanced %d\n", p.index, depth) + } + fmt.Printf("\n") + + p.buf = obuf + p.index = index +} + +// SetDefaults sets unset protocol buffer fields to their default values. +// It only modifies fields that are both unset and have defined defaults. +// It recursively sets default values in any non-nil sub-messages. +func SetDefaults(pb Message) { + setDefaults(reflect.ValueOf(pb), true, false) +} + +// v is a pointer to a struct. +func setDefaults(v reflect.Value, recur, zeros bool) { + v = v.Elem() + + defaultMu.RLock() + dm, ok := defaults[v.Type()] + defaultMu.RUnlock() + if !ok { + dm = buildDefaultMessage(v.Type()) + defaultMu.Lock() + defaults[v.Type()] = dm + defaultMu.Unlock() + } + + for _, sf := range dm.scalars { + f := v.Field(sf.index) + if !f.IsNil() { + // field already set + continue + } + dv := sf.value + if dv == nil && !zeros { + // no explicit default, and don't want to set zeros + continue + } + fptr := f.Addr().Interface() // **T + // TODO: Consider batching the allocations we do here. + switch sf.kind { + case reflect.Bool: + b := new(bool) + if dv != nil { + *b = dv.(bool) + } + *(fptr.(**bool)) = b + case reflect.Float32: + f := new(float32) + if dv != nil { + *f = dv.(float32) + } + *(fptr.(**float32)) = f + case reflect.Float64: + f := new(float64) + if dv != nil { + *f = dv.(float64) + } + *(fptr.(**float64)) = f + case reflect.Int32: + // might be an enum + if ft := f.Type(); ft != int32PtrType { + // enum + f.Set(reflect.New(ft.Elem())) + if dv != nil { + f.Elem().SetInt(int64(dv.(int32))) + } + } else { + // int32 field + i := new(int32) + if dv != nil { + *i = dv.(int32) + } + *(fptr.(**int32)) = i + } + case reflect.Int64: + i := new(int64) + if dv != nil { + *i = dv.(int64) + } + *(fptr.(**int64)) = i + case reflect.String: + s := new(string) + if dv != nil { + *s = dv.(string) + } + *(fptr.(**string)) = s + case reflect.Uint8: + // exceptional case: []byte + var b []byte + if dv != nil { + db := dv.([]byte) + b = make([]byte, len(db)) + copy(b, db) + } else { + b = []byte{} + } + *(fptr.(*[]byte)) = b + case reflect.Uint32: + u := new(uint32) + if dv != nil { + *u = dv.(uint32) + } + *(fptr.(**uint32)) = u + case reflect.Uint64: + u := new(uint64) + if dv != nil { + *u = dv.(uint64) + } + *(fptr.(**uint64)) = u + default: + log.Printf("proto: can't set default for field %v (sf.kind=%v)", f, sf.kind) + } + } + + for _, ni := range dm.nested { + f := v.Field(ni) + // f is *T or []*T or map[T]*T + switch f.Kind() { + case reflect.Ptr: + if f.IsNil() { + continue + } + setDefaults(f, recur, zeros) + + case reflect.Slice: + for i := 0; i < f.Len(); i++ { + e := f.Index(i) + if e.IsNil() { + continue + } + setDefaults(e, recur, zeros) + } + + case reflect.Map: + for _, k := range f.MapKeys() { + e := f.MapIndex(k) + if e.IsNil() { + continue + } + setDefaults(e, recur, zeros) + } + } + } +} + +var ( + // defaults maps a protocol buffer struct type to a slice of the fields, + // with its scalar fields set to their proto-declared non-zero default values. + defaultMu sync.RWMutex + defaults = make(map[reflect.Type]defaultMessage) + + int32PtrType = reflect.TypeOf((*int32)(nil)) +) + +// defaultMessage represents information about the default values of a message. +type defaultMessage struct { + scalars []scalarField + nested []int // struct field index of nested messages +} + +type scalarField struct { + index int // struct field index + kind reflect.Kind // element type (the T in *T or []T) + value interface{} // the proto-declared default value, or nil +} + +// t is a struct type. +func buildDefaultMessage(t reflect.Type) (dm defaultMessage) { + sprop := GetProperties(t) + for _, prop := range sprop.Prop { + fi, ok := sprop.decoderTags.get(prop.Tag) + if !ok { + // XXX_unrecognized + continue + } + ft := t.Field(fi).Type + + sf, nested, err := fieldDefault(ft, prop) + switch { + case err != nil: + log.Print(err) + case nested: + dm.nested = append(dm.nested, fi) + case sf != nil: + sf.index = fi + dm.scalars = append(dm.scalars, *sf) + } + } + + return dm +} + +// fieldDefault returns the scalarField for field type ft. +// sf will be nil if the field can not have a default. +// nestedMessage will be true if this is a nested message. +// Note that sf.index is not set on return. +func fieldDefault(ft reflect.Type, prop *Properties) (sf *scalarField, nestedMessage bool, err error) { + var canHaveDefault bool + switch ft.Kind() { + case reflect.Ptr: + if ft.Elem().Kind() == reflect.Struct { + nestedMessage = true + } else { + canHaveDefault = true // proto2 scalar field + } + + case reflect.Slice: + switch ft.Elem().Kind() { + case reflect.Ptr: + nestedMessage = true // repeated message + case reflect.Uint8: + canHaveDefault = true // bytes field + } + + case reflect.Map: + if ft.Elem().Kind() == reflect.Ptr { + nestedMessage = true // map with message values + } + } + + if !canHaveDefault { + if nestedMessage { + return nil, true, nil + } + return nil, false, nil + } + + // We now know that ft is a pointer or slice. + sf = &scalarField{kind: ft.Elem().Kind()} + + // scalar fields without defaults + if !prop.HasDefault { + return sf, false, nil + } + + // a scalar field: either *T or []byte + switch ft.Elem().Kind() { + case reflect.Bool: + x, err := strconv.ParseBool(prop.Default) + if err != nil { + return nil, false, fmt.Errorf("proto: bad default bool %q: %v", prop.Default, err) + } + sf.value = x + case reflect.Float32: + x, err := strconv.ParseFloat(prop.Default, 32) + if err != nil { + return nil, false, fmt.Errorf("proto: bad default float32 %q: %v", prop.Default, err) + } + sf.value = float32(x) + case reflect.Float64: + x, err := strconv.ParseFloat(prop.Default, 64) + if err != nil { + return nil, false, fmt.Errorf("proto: bad default float64 %q: %v", prop.Default, err) + } + sf.value = x + case reflect.Int32: + x, err := strconv.ParseInt(prop.Default, 10, 32) + if err != nil { + return nil, false, fmt.Errorf("proto: bad default int32 %q: %v", prop.Default, err) + } + sf.value = int32(x) + case reflect.Int64: + x, err := strconv.ParseInt(prop.Default, 10, 64) + if err != nil { + return nil, false, fmt.Errorf("proto: bad default int64 %q: %v", prop.Default, err) + } + sf.value = x + case reflect.String: + sf.value = prop.Default + case reflect.Uint8: + // []byte (not *uint8) + sf.value = []byte(prop.Default) + case reflect.Uint32: + x, err := strconv.ParseUint(prop.Default, 10, 32) + if err != nil { + return nil, false, fmt.Errorf("proto: bad default uint32 %q: %v", prop.Default, err) + } + sf.value = uint32(x) + case reflect.Uint64: + x, err := strconv.ParseUint(prop.Default, 10, 64) + if err != nil { + return nil, false, fmt.Errorf("proto: bad default uint64 %q: %v", prop.Default, err) + } + sf.value = x + default: + return nil, false, fmt.Errorf("proto: unhandled def kind %v", ft.Elem().Kind()) + } + + return sf, false, nil +} + +// Map fields may have key types of non-float scalars, strings and enums. +// The easiest way to sort them in some deterministic order is to use fmt. +// If this turns out to be inefficient we can always consider other options, +// such as doing a Schwartzian transform. + +type mapKeys []reflect.Value + +func (s mapKeys) Len() int { return len(s) } +func (s mapKeys) Swap(i, j int) { s[i], s[j] = s[j], s[i] } +func (s mapKeys) Less(i, j int) bool { + return fmt.Sprint(s[i].Interface()) < fmt.Sprint(s[j].Interface()) +} + +// isProto3Zero reports whether v is a zero proto3 value. +func isProto3Zero(v reflect.Value) bool { + switch v.Kind() { + case reflect.Bool: + return !v.Bool() + case reflect.Int32, reflect.Int64: + return v.Int() == 0 + case reflect.Uint32, reflect.Uint64: + return v.Uint() == 0 + case reflect.Float32, reflect.Float64: + return v.Float() == 0 + case reflect.String: + return v.String() == "" + } + return false +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/message_set.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/message_set.go new file mode 100644 index 000000000..9d912bce1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/message_set.go @@ -0,0 +1,287 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2010 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +package proto + +/* + * Support for message sets. + */ + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "reflect" + "sort" +) + +// ErrNoMessageTypeId occurs when a protocol buffer does not have a message type ID. +// A message type ID is required for storing a protocol buffer in a message set. +var ErrNoMessageTypeId = errors.New("proto does not have a message type ID") + +// The first two types (_MessageSet_Item and MessageSet) +// model what the protocol compiler produces for the following protocol message: +// message MessageSet { +// repeated group Item = 1 { +// required int32 type_id = 2; +// required string message = 3; +// }; +// } +// That is the MessageSet wire format. We can't use a proto to generate these +// because that would introduce a circular dependency between it and this package. +// +// When a proto1 proto has a field that looks like: +// optional message info = 3; +// the protocol compiler produces a field in the generated struct that looks like: +// Info *_proto_.MessageSet `protobuf:"bytes,3,opt,name=info"` +// The package is automatically inserted so there is no need for that proto file to +// import this package. + +type _MessageSet_Item struct { + TypeId *int32 `protobuf:"varint,2,req,name=type_id"` + Message []byte `protobuf:"bytes,3,req,name=message"` +} + +type MessageSet struct { + Item []*_MessageSet_Item `protobuf:"group,1,rep"` + XXX_unrecognized []byte + // TODO: caching? +} + +// Make sure MessageSet is a Message. +var _ Message = (*MessageSet)(nil) + +// messageTypeIder is an interface satisfied by a protocol buffer type +// that may be stored in a MessageSet. +type messageTypeIder interface { + MessageTypeId() int32 +} + +func (ms *MessageSet) find(pb Message) *_MessageSet_Item { + mti, ok := pb.(messageTypeIder) + if !ok { + return nil + } + id := mti.MessageTypeId() + for _, item := range ms.Item { + if *item.TypeId == id { + return item + } + } + return nil +} + +func (ms *MessageSet) Has(pb Message) bool { + if ms.find(pb) != nil { + return true + } + return false +} + +func (ms *MessageSet) Unmarshal(pb Message) error { + if item := ms.find(pb); item != nil { + return Unmarshal(item.Message, pb) + } + if _, ok := pb.(messageTypeIder); !ok { + return ErrNoMessageTypeId + } + return nil // TODO: return error instead? +} + +func (ms *MessageSet) Marshal(pb Message) error { + msg, err := Marshal(pb) + if err != nil { + return err + } + if item := ms.find(pb); item != nil { + // reuse existing item + item.Message = msg + return nil + } + + mti, ok := pb.(messageTypeIder) + if !ok { + return ErrNoMessageTypeId + } + + mtid := mti.MessageTypeId() + ms.Item = append(ms.Item, &_MessageSet_Item{ + TypeId: &mtid, + Message: msg, + }) + return nil +} + +func (ms *MessageSet) Reset() { *ms = MessageSet{} } +func (ms *MessageSet) String() string { return CompactTextString(ms) } +func (*MessageSet) ProtoMessage() {} + +// Support for the message_set_wire_format message option. + +func skipVarint(buf []byte) []byte { + i := 0 + for ; buf[i]&0x80 != 0; i++ { + } + return buf[i+1:] +} + +// MarshalMessageSet encodes the extension map represented by m in the message set wire format. +// It is called by generated Marshal methods on protocol buffer messages with the message_set_wire_format option. +func MarshalMessageSet(m map[int32]Extension) ([]byte, error) { + if err := encodeExtensionMap(m); err != nil { + return nil, err + } + + // Sort extension IDs to provide a deterministic encoding. + // See also enc_map in encode.go. + ids := make([]int, 0, len(m)) + for id := range m { + ids = append(ids, int(id)) + } + sort.Ints(ids) + + ms := &MessageSet{Item: make([]*_MessageSet_Item, 0, len(m))} + for _, id := range ids { + e := m[int32(id)] + // Remove the wire type and field number varint, as well as the length varint. + msg := skipVarint(skipVarint(e.enc)) + + ms.Item = append(ms.Item, &_MessageSet_Item{ + TypeId: Int32(int32(id)), + Message: msg, + }) + } + return Marshal(ms) +} + +// UnmarshalMessageSet decodes the extension map encoded in buf in the message set wire format. +// It is called by generated Unmarshal methods on protocol buffer messages with the message_set_wire_format option. +func UnmarshalMessageSet(buf []byte, m map[int32]Extension) error { + ms := new(MessageSet) + if err := Unmarshal(buf, ms); err != nil { + return err + } + for _, item := range ms.Item { + id := *item.TypeId + msg := item.Message + + // Restore wire type and field number varint, plus length varint. + // Be careful to preserve duplicate items. + b := EncodeVarint(uint64(id)<<3 | WireBytes) + if ext, ok := m[id]; ok { + // Existing data; rip off the tag and length varint + // so we join the new data correctly. + // We can assume that ext.enc is set because we are unmarshaling. + o := ext.enc[len(b):] // skip wire type and field number + _, n := DecodeVarint(o) // calculate length of length varint + o = o[n:] // skip length varint + msg = append(o, msg...) // join old data and new data + } + b = append(b, EncodeVarint(uint64(len(msg)))...) + b = append(b, msg...) + + m[id] = Extension{enc: b} + } + return nil +} + +// MarshalMessageSetJSON encodes the extension map represented by m in JSON format. +// It is called by generated MarshalJSON methods on protocol buffer messages with the message_set_wire_format option. +func MarshalMessageSetJSON(m map[int32]Extension) ([]byte, error) { + var b bytes.Buffer + b.WriteByte('{') + + // Process the map in key order for deterministic output. + ids := make([]int32, 0, len(m)) + for id := range m { + ids = append(ids, id) + } + sort.Sort(int32Slice(ids)) // int32Slice defined in text.go + + for i, id := range ids { + ext := m[id] + if i > 0 { + b.WriteByte(',') + } + + msd, ok := messageSetMap[id] + if !ok { + // Unknown type; we can't render it, so skip it. + continue + } + fmt.Fprintf(&b, `"[%s]":`, msd.name) + + x := ext.value + if x == nil { + x = reflect.New(msd.t.Elem()).Interface() + if err := Unmarshal(ext.enc, x.(Message)); err != nil { + return nil, err + } + } + d, err := json.Marshal(x) + if err != nil { + return nil, err + } + b.Write(d) + } + b.WriteByte('}') + return b.Bytes(), nil +} + +// UnmarshalMessageSetJSON decodes the extension map encoded in buf in JSON format. +// It is called by generated UnmarshalJSON methods on protocol buffer messages with the message_set_wire_format option. +func UnmarshalMessageSetJSON(buf []byte, m map[int32]Extension) error { + // Common-case fast path. + if len(buf) == 0 || bytes.Equal(buf, []byte("{}")) { + return nil + } + + // This is fairly tricky, and it's not clear that it is needed. + return errors.New("TODO: UnmarshalMessageSetJSON not yet implemented") +} + +// A global registry of types that can be used in a MessageSet. + +var messageSetMap = make(map[int32]messageSetDesc) + +type messageSetDesc struct { + t reflect.Type // pointer to struct + name string +} + +// RegisterMessageSetType is called from the generated code. +func RegisterMessageSetType(m Message, fieldNum int32, name string) { + messageSetMap[fieldNum] = messageSetDesc{ + t: reflect.TypeOf(m), + name: name, + } +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/message_set_test.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/message_set_test.go new file mode 100644 index 000000000..7c29bccf4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/message_set_test.go @@ -0,0 +1,66 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2014 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +package proto + +import ( + "bytes" + "testing" +) + +func TestUnmarshalMessageSetWithDuplicate(t *testing.T) { + // Check that a repeated message set entry will be concatenated. + in := &MessageSet{ + Item: []*_MessageSet_Item{ + {TypeId: Int32(12345), Message: []byte("hoo")}, + {TypeId: Int32(12345), Message: []byte("hah")}, + }, + } + b, err := Marshal(in) + if err != nil { + t.Fatalf("Marshal: %v", err) + } + t.Logf("Marshaled bytes: %q", b) + + m := make(map[int32]Extension) + if err := UnmarshalMessageSet(b, m); err != nil { + t.Fatalf("UnmarshalMessageSet: %v", err) + } + ext, ok := m[12345] + if !ok { + t.Fatalf("Didn't retrieve extension 12345; map is %v", m) + } + // Skip wire type/field number and length varints. + got := skipVarint(skipVarint(ext.enc)) + if want := []byte("hoohah"); !bytes.Equal(got, want) { + t.Errorf("Combined extension is %q, want %q", got, want) + } +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/pointer_reflect.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/pointer_reflect.go new file mode 100644 index 000000000..749919d25 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/pointer_reflect.go @@ -0,0 +1,479 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2012 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +// +build appengine + +// This file contains an implementation of proto field accesses using package reflect. +// It is slower than the code in pointer_unsafe.go but it avoids package unsafe and can +// be used on App Engine. + +package proto + +import ( + "math" + "reflect" +) + +// A structPointer is a pointer to a struct. +type structPointer struct { + v reflect.Value +} + +// toStructPointer returns a structPointer equivalent to the given reflect value. +// The reflect value must itself be a pointer to a struct. +func toStructPointer(v reflect.Value) structPointer { + return structPointer{v} +} + +// IsNil reports whether p is nil. +func structPointer_IsNil(p structPointer) bool { + return p.v.IsNil() +} + +// Interface returns the struct pointer as an interface value. +func structPointer_Interface(p structPointer, _ reflect.Type) interface{} { + return p.v.Interface() +} + +// A field identifies a field in a struct, accessible from a structPointer. +// In this implementation, a field is identified by the sequence of field indices +// passed to reflect's FieldByIndex. +type field []int + +// toField returns a field equivalent to the given reflect field. +func toField(f *reflect.StructField) field { + return f.Index +} + +// invalidField is an invalid field identifier. +var invalidField = field(nil) + +// IsValid reports whether the field identifier is valid. +func (f field) IsValid() bool { return f != nil } + +// field returns the given field in the struct as a reflect value. +func structPointer_field(p structPointer, f field) reflect.Value { + // Special case: an extension map entry with a value of type T + // passes a *T to the struct-handling code with a zero field, + // expecting that it will be treated as equivalent to *struct{ X T }, + // which has the same memory layout. We have to handle that case + // specially, because reflect will panic if we call FieldByIndex on a + // non-struct. + if f == nil { + return p.v.Elem() + } + + return p.v.Elem().FieldByIndex(f) +} + +// ifield returns the given field in the struct as an interface value. +func structPointer_ifield(p structPointer, f field) interface{} { + return structPointer_field(p, f).Addr().Interface() +} + +// Bytes returns the address of a []byte field in the struct. +func structPointer_Bytes(p structPointer, f field) *[]byte { + return structPointer_ifield(p, f).(*[]byte) +} + +// BytesSlice returns the address of a [][]byte field in the struct. +func structPointer_BytesSlice(p structPointer, f field) *[][]byte { + return structPointer_ifield(p, f).(*[][]byte) +} + +// Bool returns the address of a *bool field in the struct. +func structPointer_Bool(p structPointer, f field) **bool { + return structPointer_ifield(p, f).(**bool) +} + +// BoolVal returns the address of a bool field in the struct. +func structPointer_BoolVal(p structPointer, f field) *bool { + return structPointer_ifield(p, f).(*bool) +} + +// BoolSlice returns the address of a []bool field in the struct. +func structPointer_BoolSlice(p structPointer, f field) *[]bool { + return structPointer_ifield(p, f).(*[]bool) +} + +// String returns the address of a *string field in the struct. +func structPointer_String(p structPointer, f field) **string { + return structPointer_ifield(p, f).(**string) +} + +// StringVal returns the address of a string field in the struct. +func structPointer_StringVal(p structPointer, f field) *string { + return structPointer_ifield(p, f).(*string) +} + +// StringSlice returns the address of a []string field in the struct. +func structPointer_StringSlice(p structPointer, f field) *[]string { + return structPointer_ifield(p, f).(*[]string) +} + +// ExtMap returns the address of an extension map field in the struct. +func structPointer_ExtMap(p structPointer, f field) *map[int32]Extension { + return structPointer_ifield(p, f).(*map[int32]Extension) +} + +// NewAt returns the reflect.Value for a pointer to a field in the struct. +func structPointer_NewAt(p structPointer, f field, typ reflect.Type) reflect.Value { + return structPointer_field(p, f).Addr() +} + +// SetStructPointer writes a *struct field in the struct. +func structPointer_SetStructPointer(p structPointer, f field, q structPointer) { + structPointer_field(p, f).Set(q.v) +} + +// GetStructPointer reads a *struct field in the struct. +func structPointer_GetStructPointer(p structPointer, f field) structPointer { + return structPointer{structPointer_field(p, f)} +} + +// StructPointerSlice the address of a []*struct field in the struct. +func structPointer_StructPointerSlice(p structPointer, f field) structPointerSlice { + return structPointerSlice{structPointer_field(p, f)} +} + +// A structPointerSlice represents the address of a slice of pointers to structs +// (themselves messages or groups). That is, v.Type() is *[]*struct{...}. +type structPointerSlice struct { + v reflect.Value +} + +func (p structPointerSlice) Len() int { return p.v.Len() } +func (p structPointerSlice) Index(i int) structPointer { return structPointer{p.v.Index(i)} } +func (p structPointerSlice) Append(q structPointer) { + p.v.Set(reflect.Append(p.v, q.v)) +} + +var ( + int32Type = reflect.TypeOf(int32(0)) + uint32Type = reflect.TypeOf(uint32(0)) + float32Type = reflect.TypeOf(float32(0)) + int64Type = reflect.TypeOf(int64(0)) + uint64Type = reflect.TypeOf(uint64(0)) + float64Type = reflect.TypeOf(float64(0)) +) + +// A word32 represents a field of type *int32, *uint32, *float32, or *enum. +// That is, v.Type() is *int32, *uint32, *float32, or *enum and v is assignable. +type word32 struct { + v reflect.Value +} + +// IsNil reports whether p is nil. +func word32_IsNil(p word32) bool { + return p.v.IsNil() +} + +// Set sets p to point at a newly allocated word with bits set to x. +func word32_Set(p word32, o *Buffer, x uint32) { + t := p.v.Type().Elem() + switch t { + case int32Type: + if len(o.int32s) == 0 { + o.int32s = make([]int32, uint32PoolSize) + } + o.int32s[0] = int32(x) + p.v.Set(reflect.ValueOf(&o.int32s[0])) + o.int32s = o.int32s[1:] + return + case uint32Type: + if len(o.uint32s) == 0 { + o.uint32s = make([]uint32, uint32PoolSize) + } + o.uint32s[0] = x + p.v.Set(reflect.ValueOf(&o.uint32s[0])) + o.uint32s = o.uint32s[1:] + return + case float32Type: + if len(o.float32s) == 0 { + o.float32s = make([]float32, uint32PoolSize) + } + o.float32s[0] = math.Float32frombits(x) + p.v.Set(reflect.ValueOf(&o.float32s[0])) + o.float32s = o.float32s[1:] + return + } + + // must be enum + p.v.Set(reflect.New(t)) + p.v.Elem().SetInt(int64(int32(x))) +} + +// Get gets the bits pointed at by p, as a uint32. +func word32_Get(p word32) uint32 { + elem := p.v.Elem() + switch elem.Kind() { + case reflect.Int32: + return uint32(elem.Int()) + case reflect.Uint32: + return uint32(elem.Uint()) + case reflect.Float32: + return math.Float32bits(float32(elem.Float())) + } + panic("unreachable") +} + +// Word32 returns a reference to a *int32, *uint32, *float32, or *enum field in the struct. +func structPointer_Word32(p structPointer, f field) word32 { + return word32{structPointer_field(p, f)} +} + +// A word32Val represents a field of type int32, uint32, float32, or enum. +// That is, v.Type() is int32, uint32, float32, or enum and v is assignable. +type word32Val struct { + v reflect.Value +} + +// Set sets *p to x. +func word32Val_Set(p word32Val, x uint32) { + switch p.v.Type() { + case int32Type: + p.v.SetInt(int64(x)) + return + case uint32Type: + p.v.SetUint(uint64(x)) + return + case float32Type: + p.v.SetFloat(float64(math.Float32frombits(x))) + return + } + + // must be enum + p.v.SetInt(int64(int32(x))) +} + +// Get gets the bits pointed at by p, as a uint32. +func word32Val_Get(p word32Val) uint32 { + elem := p.v + switch elem.Kind() { + case reflect.Int32: + return uint32(elem.Int()) + case reflect.Uint32: + return uint32(elem.Uint()) + case reflect.Float32: + return math.Float32bits(float32(elem.Float())) + } + panic("unreachable") +} + +// Word32Val returns a reference to a int32, uint32, float32, or enum field in the struct. +func structPointer_Word32Val(p structPointer, f field) word32Val { + return word32Val{structPointer_field(p, f)} +} + +// A word32Slice is a slice of 32-bit values. +// That is, v.Type() is []int32, []uint32, []float32, or []enum. +type word32Slice struct { + v reflect.Value +} + +func (p word32Slice) Append(x uint32) { + n, m := p.v.Len(), p.v.Cap() + if n < m { + p.v.SetLen(n + 1) + } else { + t := p.v.Type().Elem() + p.v.Set(reflect.Append(p.v, reflect.Zero(t))) + } + elem := p.v.Index(n) + switch elem.Kind() { + case reflect.Int32: + elem.SetInt(int64(int32(x))) + case reflect.Uint32: + elem.SetUint(uint64(x)) + case reflect.Float32: + elem.SetFloat(float64(math.Float32frombits(x))) + } +} + +func (p word32Slice) Len() int { + return p.v.Len() +} + +func (p word32Slice) Index(i int) uint32 { + elem := p.v.Index(i) + switch elem.Kind() { + case reflect.Int32: + return uint32(elem.Int()) + case reflect.Uint32: + return uint32(elem.Uint()) + case reflect.Float32: + return math.Float32bits(float32(elem.Float())) + } + panic("unreachable") +} + +// Word32Slice returns a reference to a []int32, []uint32, []float32, or []enum field in the struct. +func structPointer_Word32Slice(p structPointer, f field) word32Slice { + return word32Slice{structPointer_field(p, f)} +} + +// word64 is like word32 but for 64-bit values. +type word64 struct { + v reflect.Value +} + +func word64_Set(p word64, o *Buffer, x uint64) { + t := p.v.Type().Elem() + switch t { + case int64Type: + if len(o.int64s) == 0 { + o.int64s = make([]int64, uint64PoolSize) + } + o.int64s[0] = int64(x) + p.v.Set(reflect.ValueOf(&o.int64s[0])) + o.int64s = o.int64s[1:] + return + case uint64Type: + if len(o.uint64s) == 0 { + o.uint64s = make([]uint64, uint64PoolSize) + } + o.uint64s[0] = x + p.v.Set(reflect.ValueOf(&o.uint64s[0])) + o.uint64s = o.uint64s[1:] + return + case float64Type: + if len(o.float64s) == 0 { + o.float64s = make([]float64, uint64PoolSize) + } + o.float64s[0] = math.Float64frombits(x) + p.v.Set(reflect.ValueOf(&o.float64s[0])) + o.float64s = o.float64s[1:] + return + } + panic("unreachable") +} + +func word64_IsNil(p word64) bool { + return p.v.IsNil() +} + +func word64_Get(p word64) uint64 { + elem := p.v.Elem() + switch elem.Kind() { + case reflect.Int64: + return uint64(elem.Int()) + case reflect.Uint64: + return elem.Uint() + case reflect.Float64: + return math.Float64bits(elem.Float()) + } + panic("unreachable") +} + +func structPointer_Word64(p structPointer, f field) word64 { + return word64{structPointer_field(p, f)} +} + +// word64Val is like word32Val but for 64-bit values. +type word64Val struct { + v reflect.Value +} + +func word64Val_Set(p word64Val, o *Buffer, x uint64) { + switch p.v.Type() { + case int64Type: + p.v.SetInt(int64(x)) + return + case uint64Type: + p.v.SetUint(x) + return + case float64Type: + p.v.SetFloat(math.Float64frombits(x)) + return + } + panic("unreachable") +} + +func word64Val_Get(p word64Val) uint64 { + elem := p.v + switch elem.Kind() { + case reflect.Int64: + return uint64(elem.Int()) + case reflect.Uint64: + return elem.Uint() + case reflect.Float64: + return math.Float64bits(elem.Float()) + } + panic("unreachable") +} + +func structPointer_Word64Val(p structPointer, f field) word64Val { + return word64Val{structPointer_field(p, f)} +} + +type word64Slice struct { + v reflect.Value +} + +func (p word64Slice) Append(x uint64) { + n, m := p.v.Len(), p.v.Cap() + if n < m { + p.v.SetLen(n + 1) + } else { + t := p.v.Type().Elem() + p.v.Set(reflect.Append(p.v, reflect.Zero(t))) + } + elem := p.v.Index(n) + switch elem.Kind() { + case reflect.Int64: + elem.SetInt(int64(int64(x))) + case reflect.Uint64: + elem.SetUint(uint64(x)) + case reflect.Float64: + elem.SetFloat(float64(math.Float64frombits(x))) + } +} + +func (p word64Slice) Len() int { + return p.v.Len() +} + +func (p word64Slice) Index(i int) uint64 { + elem := p.v.Index(i) + switch elem.Kind() { + case reflect.Int64: + return uint64(elem.Int()) + case reflect.Uint64: + return uint64(elem.Uint()) + case reflect.Float64: + return math.Float64bits(float64(elem.Float())) + } + panic("unreachable") +} + +func structPointer_Word64Slice(p structPointer, f field) word64Slice { + return word64Slice{structPointer_field(p, f)} +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/pointer_unsafe.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/pointer_unsafe.go new file mode 100644 index 000000000..e9be0fe92 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/pointer_unsafe.go @@ -0,0 +1,266 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2012 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +// +build !appengine + +// This file contains the implementation of the proto field accesses using package unsafe. + +package proto + +import ( + "reflect" + "unsafe" +) + +// NOTE: These type_Foo functions would more idiomatically be methods, +// but Go does not allow methods on pointer types, and we must preserve +// some pointer type for the garbage collector. We use these +// funcs with clunky names as our poor approximation to methods. +// +// An alternative would be +// type structPointer struct { p unsafe.Pointer } +// but that does not registerize as well. + +// A structPointer is a pointer to a struct. +type structPointer unsafe.Pointer + +// toStructPointer returns a structPointer equivalent to the given reflect value. +func toStructPointer(v reflect.Value) structPointer { + return structPointer(unsafe.Pointer(v.Pointer())) +} + +// IsNil reports whether p is nil. +func structPointer_IsNil(p structPointer) bool { + return p == nil +} + +// Interface returns the struct pointer, assumed to have element type t, +// as an interface value. +func structPointer_Interface(p structPointer, t reflect.Type) interface{} { + return reflect.NewAt(t, unsafe.Pointer(p)).Interface() +} + +// A field identifies a field in a struct, accessible from a structPointer. +// In this implementation, a field is identified by its byte offset from the start of the struct. +type field uintptr + +// toField returns a field equivalent to the given reflect field. +func toField(f *reflect.StructField) field { + return field(f.Offset) +} + +// invalidField is an invalid field identifier. +const invalidField = ^field(0) + +// IsValid reports whether the field identifier is valid. +func (f field) IsValid() bool { + return f != ^field(0) +} + +// Bytes returns the address of a []byte field in the struct. +func structPointer_Bytes(p structPointer, f field) *[]byte { + return (*[]byte)(unsafe.Pointer(uintptr(p) + uintptr(f))) +} + +// BytesSlice returns the address of a [][]byte field in the struct. +func structPointer_BytesSlice(p structPointer, f field) *[][]byte { + return (*[][]byte)(unsafe.Pointer(uintptr(p) + uintptr(f))) +} + +// Bool returns the address of a *bool field in the struct. +func structPointer_Bool(p structPointer, f field) **bool { + return (**bool)(unsafe.Pointer(uintptr(p) + uintptr(f))) +} + +// BoolVal returns the address of a bool field in the struct. +func structPointer_BoolVal(p structPointer, f field) *bool { + return (*bool)(unsafe.Pointer(uintptr(p) + uintptr(f))) +} + +// BoolSlice returns the address of a []bool field in the struct. +func structPointer_BoolSlice(p structPointer, f field) *[]bool { + return (*[]bool)(unsafe.Pointer(uintptr(p) + uintptr(f))) +} + +// String returns the address of a *string field in the struct. +func structPointer_String(p structPointer, f field) **string { + return (**string)(unsafe.Pointer(uintptr(p) + uintptr(f))) +} + +// StringVal returns the address of a string field in the struct. +func structPointer_StringVal(p structPointer, f field) *string { + return (*string)(unsafe.Pointer(uintptr(p) + uintptr(f))) +} + +// StringSlice returns the address of a []string field in the struct. +func structPointer_StringSlice(p structPointer, f field) *[]string { + return (*[]string)(unsafe.Pointer(uintptr(p) + uintptr(f))) +} + +// ExtMap returns the address of an extension map field in the struct. +func structPointer_ExtMap(p structPointer, f field) *map[int32]Extension { + return (*map[int32]Extension)(unsafe.Pointer(uintptr(p) + uintptr(f))) +} + +// NewAt returns the reflect.Value for a pointer to a field in the struct. +func structPointer_NewAt(p structPointer, f field, typ reflect.Type) reflect.Value { + return reflect.NewAt(typ, unsafe.Pointer(uintptr(p)+uintptr(f))) +} + +// SetStructPointer writes a *struct field in the struct. +func structPointer_SetStructPointer(p structPointer, f field, q structPointer) { + *(*structPointer)(unsafe.Pointer(uintptr(p) + uintptr(f))) = q +} + +// GetStructPointer reads a *struct field in the struct. +func structPointer_GetStructPointer(p structPointer, f field) structPointer { + return *(*structPointer)(unsafe.Pointer(uintptr(p) + uintptr(f))) +} + +// StructPointerSlice the address of a []*struct field in the struct. +func structPointer_StructPointerSlice(p structPointer, f field) *structPointerSlice { + return (*structPointerSlice)(unsafe.Pointer(uintptr(p) + uintptr(f))) +} + +// A structPointerSlice represents a slice of pointers to structs (themselves submessages or groups). +type structPointerSlice []structPointer + +func (v *structPointerSlice) Len() int { return len(*v) } +func (v *structPointerSlice) Index(i int) structPointer { return (*v)[i] } +func (v *structPointerSlice) Append(p structPointer) { *v = append(*v, p) } + +// A word32 is the address of a "pointer to 32-bit value" field. +type word32 **uint32 + +// IsNil reports whether *v is nil. +func word32_IsNil(p word32) bool { + return *p == nil +} + +// Set sets *v to point at a newly allocated word set to x. +func word32_Set(p word32, o *Buffer, x uint32) { + if len(o.uint32s) == 0 { + o.uint32s = make([]uint32, uint32PoolSize) + } + o.uint32s[0] = x + *p = &o.uint32s[0] + o.uint32s = o.uint32s[1:] +} + +// Get gets the value pointed at by *v. +func word32_Get(p word32) uint32 { + return **p +} + +// Word32 returns the address of a *int32, *uint32, *float32, or *enum field in the struct. +func structPointer_Word32(p structPointer, f field) word32 { + return word32((**uint32)(unsafe.Pointer(uintptr(p) + uintptr(f)))) +} + +// A word32Val is the address of a 32-bit value field. +type word32Val *uint32 + +// Set sets *p to x. +func word32Val_Set(p word32Val, x uint32) { + *p = x +} + +// Get gets the value pointed at by p. +func word32Val_Get(p word32Val) uint32 { + return *p +} + +// Word32Val returns the address of a *int32, *uint32, *float32, or *enum field in the struct. +func structPointer_Word32Val(p structPointer, f field) word32Val { + return word32Val((*uint32)(unsafe.Pointer(uintptr(p) + uintptr(f)))) +} + +// A word32Slice is a slice of 32-bit values. +type word32Slice []uint32 + +func (v *word32Slice) Append(x uint32) { *v = append(*v, x) } +func (v *word32Slice) Len() int { return len(*v) } +func (v *word32Slice) Index(i int) uint32 { return (*v)[i] } + +// Word32Slice returns the address of a []int32, []uint32, []float32, or []enum field in the struct. +func structPointer_Word32Slice(p structPointer, f field) *word32Slice { + return (*word32Slice)(unsafe.Pointer(uintptr(p) + uintptr(f))) +} + +// word64 is like word32 but for 64-bit values. +type word64 **uint64 + +func word64_Set(p word64, o *Buffer, x uint64) { + if len(o.uint64s) == 0 { + o.uint64s = make([]uint64, uint64PoolSize) + } + o.uint64s[0] = x + *p = &o.uint64s[0] + o.uint64s = o.uint64s[1:] +} + +func word64_IsNil(p word64) bool { + return *p == nil +} + +func word64_Get(p word64) uint64 { + return **p +} + +func structPointer_Word64(p structPointer, f field) word64 { + return word64((**uint64)(unsafe.Pointer(uintptr(p) + uintptr(f)))) +} + +// word64Val is like word32Val but for 64-bit values. +type word64Val *uint64 + +func word64Val_Set(p word64Val, o *Buffer, x uint64) { + *p = x +} + +func word64Val_Get(p word64Val) uint64 { + return *p +} + +func structPointer_Word64Val(p structPointer, f field) word64Val { + return word64Val((*uint64)(unsafe.Pointer(uintptr(p) + uintptr(f)))) +} + +// word64Slice is like word32Slice but for 64-bit values. +type word64Slice []uint64 + +func (v *word64Slice) Append(x uint64) { *v = append(*v, x) } +func (v *word64Slice) Len() int { return len(*v) } +func (v *word64Slice) Index(i int) uint64 { return (*v)[i] } + +func structPointer_Word64Slice(p structPointer, f field) *word64Slice { + return (*word64Slice)(unsafe.Pointer(uintptr(p) + uintptr(f))) +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/properties.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/properties.go new file mode 100644 index 000000000..d74844ab2 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/properties.go @@ -0,0 +1,742 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2010 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +package proto + +/* + * Routines for encoding data into the wire format for protocol buffers. + */ + +import ( + "fmt" + "os" + "reflect" + "sort" + "strconv" + "strings" + "sync" +) + +const debug bool = false + +// Constants that identify the encoding of a value on the wire. +const ( + WireVarint = 0 + WireFixed64 = 1 + WireBytes = 2 + WireStartGroup = 3 + WireEndGroup = 4 + WireFixed32 = 5 +) + +const startSize = 10 // initial slice/string sizes + +// Encoders are defined in encode.go +// An encoder outputs the full representation of a field, including its +// tag and encoder type. +type encoder func(p *Buffer, prop *Properties, base structPointer) error + +// A valueEncoder encodes a single integer in a particular encoding. +type valueEncoder func(o *Buffer, x uint64) error + +// Sizers are defined in encode.go +// A sizer returns the encoded size of a field, including its tag and encoder +// type. +type sizer func(prop *Properties, base structPointer) int + +// A valueSizer returns the encoded size of a single integer in a particular +// encoding. +type valueSizer func(x uint64) int + +// Decoders are defined in decode.go +// A decoder creates a value from its wire representation. +// Unrecognized subelements are saved in unrec. +type decoder func(p *Buffer, prop *Properties, base structPointer) error + +// A valueDecoder decodes a single integer in a particular encoding. +type valueDecoder func(o *Buffer) (x uint64, err error) + +// tagMap is an optimization over map[int]int for typical protocol buffer +// use-cases. Encoded protocol buffers are often in tag order with small tag +// numbers. +type tagMap struct { + fastTags []int + slowTags map[int]int +} + +// tagMapFastLimit is the upper bound on the tag number that will be stored in +// the tagMap slice rather than its map. +const tagMapFastLimit = 1024 + +func (p *tagMap) get(t int) (int, bool) { + if t > 0 && t < tagMapFastLimit { + if t >= len(p.fastTags) { + return 0, false + } + fi := p.fastTags[t] + return fi, fi >= 0 + } + fi, ok := p.slowTags[t] + return fi, ok +} + +func (p *tagMap) put(t int, fi int) { + if t > 0 && t < tagMapFastLimit { + for len(p.fastTags) < t+1 { + p.fastTags = append(p.fastTags, -1) + } + p.fastTags[t] = fi + return + } + if p.slowTags == nil { + p.slowTags = make(map[int]int) + } + p.slowTags[t] = fi +} + +// StructProperties represents properties for all the fields of a struct. +// decoderTags and decoderOrigNames should only be used by the decoder. +type StructProperties struct { + Prop []*Properties // properties for each field + reqCount int // required count + decoderTags tagMap // map from proto tag to struct field number + decoderOrigNames map[string]int // map from original name to struct field number + order []int // list of struct field numbers in tag order + unrecField field // field id of the XXX_unrecognized []byte field + extendable bool // is this an extendable proto +} + +// Implement the sorting interface so we can sort the fields in tag order, as recommended by the spec. +// See encode.go, (*Buffer).enc_struct. + +func (sp *StructProperties) Len() int { return len(sp.order) } +func (sp *StructProperties) Less(i, j int) bool { + return sp.Prop[sp.order[i]].Tag < sp.Prop[sp.order[j]].Tag +} +func (sp *StructProperties) Swap(i, j int) { sp.order[i], sp.order[j] = sp.order[j], sp.order[i] } + +// Properties represents the protocol-specific behavior of a single struct field. +type Properties struct { + Name string // name of the field, for error messages + OrigName string // original name before protocol compiler (always set) + Wire string + WireType int + Tag int + Required bool + Optional bool + Repeated bool + Packed bool // relevant for repeated primitives only + Enum string // set for enum types only + proto3 bool // whether this is known to be a proto3 field; set for []byte only + + Default string // default value + HasDefault bool // whether an explicit default was provided + def_uint64 uint64 + + enc encoder + valEnc valueEncoder // set for bool and numeric types only + field field + tagcode []byte // encoding of EncodeVarint((Tag<<3)|WireType) + tagbuf [8]byte + stype reflect.Type // set for struct types only + sprop *StructProperties // set for struct types only + isMarshaler bool + isUnmarshaler bool + + mtype reflect.Type // set for map types only + mkeyprop *Properties // set for map types only + mvalprop *Properties // set for map types only + + size sizer + valSize valueSizer // set for bool and numeric types only + + dec decoder + valDec valueDecoder // set for bool and numeric types only + + // If this is a packable field, this will be the decoder for the packed version of the field. + packedDec decoder +} + +// String formats the properties in the protobuf struct field tag style. +func (p *Properties) String() string { + s := p.Wire + s = "," + s += strconv.Itoa(p.Tag) + if p.Required { + s += ",req" + } + if p.Optional { + s += ",opt" + } + if p.Repeated { + s += ",rep" + } + if p.Packed { + s += ",packed" + } + if p.OrigName != p.Name { + s += ",name=" + p.OrigName + } + if p.proto3 { + s += ",proto3" + } + if len(p.Enum) > 0 { + s += ",enum=" + p.Enum + } + if p.HasDefault { + s += ",def=" + p.Default + } + return s +} + +// Parse populates p by parsing a string in the protobuf struct field tag style. +func (p *Properties) Parse(s string) { + // "bytes,49,opt,name=foo,def=hello!" + fields := strings.Split(s, ",") // breaks def=, but handled below. + if len(fields) < 2 { + fmt.Fprintf(os.Stderr, "proto: tag has too few fields: %q\n", s) + return + } + + p.Wire = fields[0] + switch p.Wire { + case "varint": + p.WireType = WireVarint + p.valEnc = (*Buffer).EncodeVarint + p.valDec = (*Buffer).DecodeVarint + p.valSize = sizeVarint + case "fixed32": + p.WireType = WireFixed32 + p.valEnc = (*Buffer).EncodeFixed32 + p.valDec = (*Buffer).DecodeFixed32 + p.valSize = sizeFixed32 + case "fixed64": + p.WireType = WireFixed64 + p.valEnc = (*Buffer).EncodeFixed64 + p.valDec = (*Buffer).DecodeFixed64 + p.valSize = sizeFixed64 + case "zigzag32": + p.WireType = WireVarint + p.valEnc = (*Buffer).EncodeZigzag32 + p.valDec = (*Buffer).DecodeZigzag32 + p.valSize = sizeZigzag32 + case "zigzag64": + p.WireType = WireVarint + p.valEnc = (*Buffer).EncodeZigzag64 + p.valDec = (*Buffer).DecodeZigzag64 + p.valSize = sizeZigzag64 + case "bytes", "group": + p.WireType = WireBytes + // no numeric converter for non-numeric types + default: + fmt.Fprintf(os.Stderr, "proto: tag has unknown wire type: %q\n", s) + return + } + + var err error + p.Tag, err = strconv.Atoi(fields[1]) + if err != nil { + return + } + + for i := 2; i < len(fields); i++ { + f := fields[i] + switch { + case f == "req": + p.Required = true + case f == "opt": + p.Optional = true + case f == "rep": + p.Repeated = true + case f == "packed": + p.Packed = true + case strings.HasPrefix(f, "name="): + p.OrigName = f[5:] + case strings.HasPrefix(f, "enum="): + p.Enum = f[5:] + case f == "proto3": + p.proto3 = true + case strings.HasPrefix(f, "def="): + p.HasDefault = true + p.Default = f[4:] // rest of string + if i+1 < len(fields) { + // Commas aren't escaped, and def is always last. + p.Default += "," + strings.Join(fields[i+1:], ",") + break + } + } + } +} + +func logNoSliceEnc(t1, t2 reflect.Type) { + fmt.Fprintf(os.Stderr, "proto: no slice oenc for %T = []%T\n", t1, t2) +} + +var protoMessageType = reflect.TypeOf((*Message)(nil)).Elem() + +// Initialize the fields for encoding and decoding. +func (p *Properties) setEncAndDec(typ reflect.Type, f *reflect.StructField, lockGetProp bool) { + p.enc = nil + p.dec = nil + p.size = nil + + switch t1 := typ; t1.Kind() { + default: + fmt.Fprintf(os.Stderr, "proto: no coders for %v\n", t1) + + // proto3 scalar types + + case reflect.Bool: + p.enc = (*Buffer).enc_proto3_bool + p.dec = (*Buffer).dec_proto3_bool + p.size = size_proto3_bool + case reflect.Int32: + p.enc = (*Buffer).enc_proto3_int32 + p.dec = (*Buffer).dec_proto3_int32 + p.size = size_proto3_int32 + case reflect.Uint32: + p.enc = (*Buffer).enc_proto3_uint32 + p.dec = (*Buffer).dec_proto3_int32 // can reuse + p.size = size_proto3_uint32 + case reflect.Int64, reflect.Uint64: + p.enc = (*Buffer).enc_proto3_int64 + p.dec = (*Buffer).dec_proto3_int64 + p.size = size_proto3_int64 + case reflect.Float32: + p.enc = (*Buffer).enc_proto3_uint32 // can just treat them as bits + p.dec = (*Buffer).dec_proto3_int32 + p.size = size_proto3_uint32 + case reflect.Float64: + p.enc = (*Buffer).enc_proto3_int64 // can just treat them as bits + p.dec = (*Buffer).dec_proto3_int64 + p.size = size_proto3_int64 + case reflect.String: + p.enc = (*Buffer).enc_proto3_string + p.dec = (*Buffer).dec_proto3_string + p.size = size_proto3_string + + case reflect.Ptr: + switch t2 := t1.Elem(); t2.Kind() { + default: + fmt.Fprintf(os.Stderr, "proto: no encoder function for %v -> %v\n", t1, t2) + break + case reflect.Bool: + p.enc = (*Buffer).enc_bool + p.dec = (*Buffer).dec_bool + p.size = size_bool + case reflect.Int32: + p.enc = (*Buffer).enc_int32 + p.dec = (*Buffer).dec_int32 + p.size = size_int32 + case reflect.Uint32: + p.enc = (*Buffer).enc_uint32 + p.dec = (*Buffer).dec_int32 // can reuse + p.size = size_uint32 + case reflect.Int64, reflect.Uint64: + p.enc = (*Buffer).enc_int64 + p.dec = (*Buffer).dec_int64 + p.size = size_int64 + case reflect.Float32: + p.enc = (*Buffer).enc_uint32 // can just treat them as bits + p.dec = (*Buffer).dec_int32 + p.size = size_uint32 + case reflect.Float64: + p.enc = (*Buffer).enc_int64 // can just treat them as bits + p.dec = (*Buffer).dec_int64 + p.size = size_int64 + case reflect.String: + p.enc = (*Buffer).enc_string + p.dec = (*Buffer).dec_string + p.size = size_string + case reflect.Struct: + p.stype = t1.Elem() + p.isMarshaler = isMarshaler(t1) + p.isUnmarshaler = isUnmarshaler(t1) + if p.Wire == "bytes" { + p.enc = (*Buffer).enc_struct_message + p.dec = (*Buffer).dec_struct_message + p.size = size_struct_message + } else { + p.enc = (*Buffer).enc_struct_group + p.dec = (*Buffer).dec_struct_group + p.size = size_struct_group + } + } + + case reflect.Slice: + switch t2 := t1.Elem(); t2.Kind() { + default: + logNoSliceEnc(t1, t2) + break + case reflect.Bool: + if p.Packed { + p.enc = (*Buffer).enc_slice_packed_bool + p.size = size_slice_packed_bool + } else { + p.enc = (*Buffer).enc_slice_bool + p.size = size_slice_bool + } + p.dec = (*Buffer).dec_slice_bool + p.packedDec = (*Buffer).dec_slice_packed_bool + case reflect.Int32: + if p.Packed { + p.enc = (*Buffer).enc_slice_packed_int32 + p.size = size_slice_packed_int32 + } else { + p.enc = (*Buffer).enc_slice_int32 + p.size = size_slice_int32 + } + p.dec = (*Buffer).dec_slice_int32 + p.packedDec = (*Buffer).dec_slice_packed_int32 + case reflect.Uint32: + if p.Packed { + p.enc = (*Buffer).enc_slice_packed_uint32 + p.size = size_slice_packed_uint32 + } else { + p.enc = (*Buffer).enc_slice_uint32 + p.size = size_slice_uint32 + } + p.dec = (*Buffer).dec_slice_int32 + p.packedDec = (*Buffer).dec_slice_packed_int32 + case reflect.Int64, reflect.Uint64: + if p.Packed { + p.enc = (*Buffer).enc_slice_packed_int64 + p.size = size_slice_packed_int64 + } else { + p.enc = (*Buffer).enc_slice_int64 + p.size = size_slice_int64 + } + p.dec = (*Buffer).dec_slice_int64 + p.packedDec = (*Buffer).dec_slice_packed_int64 + case reflect.Uint8: + p.enc = (*Buffer).enc_slice_byte + p.dec = (*Buffer).dec_slice_byte + p.size = size_slice_byte + // This is a []byte, which is either a bytes field, + // or the value of a map field. In the latter case, + // we always encode an empty []byte, so we should not + // use the proto3 enc/size funcs. + // f == nil iff this is the key/value of a map field. + if p.proto3 && f != nil { + p.enc = (*Buffer).enc_proto3_slice_byte + p.size = size_proto3_slice_byte + } + case reflect.Float32, reflect.Float64: + switch t2.Bits() { + case 32: + // can just treat them as bits + if p.Packed { + p.enc = (*Buffer).enc_slice_packed_uint32 + p.size = size_slice_packed_uint32 + } else { + p.enc = (*Buffer).enc_slice_uint32 + p.size = size_slice_uint32 + } + p.dec = (*Buffer).dec_slice_int32 + p.packedDec = (*Buffer).dec_slice_packed_int32 + case 64: + // can just treat them as bits + if p.Packed { + p.enc = (*Buffer).enc_slice_packed_int64 + p.size = size_slice_packed_int64 + } else { + p.enc = (*Buffer).enc_slice_int64 + p.size = size_slice_int64 + } + p.dec = (*Buffer).dec_slice_int64 + p.packedDec = (*Buffer).dec_slice_packed_int64 + default: + logNoSliceEnc(t1, t2) + break + } + case reflect.String: + p.enc = (*Buffer).enc_slice_string + p.dec = (*Buffer).dec_slice_string + p.size = size_slice_string + case reflect.Ptr: + switch t3 := t2.Elem(); t3.Kind() { + default: + fmt.Fprintf(os.Stderr, "proto: no ptr oenc for %T -> %T -> %T\n", t1, t2, t3) + break + case reflect.Struct: + p.stype = t2.Elem() + p.isMarshaler = isMarshaler(t2) + p.isUnmarshaler = isUnmarshaler(t2) + if p.Wire == "bytes" { + p.enc = (*Buffer).enc_slice_struct_message + p.dec = (*Buffer).dec_slice_struct_message + p.size = size_slice_struct_message + } else { + p.enc = (*Buffer).enc_slice_struct_group + p.dec = (*Buffer).dec_slice_struct_group + p.size = size_slice_struct_group + } + } + case reflect.Slice: + switch t2.Elem().Kind() { + default: + fmt.Fprintf(os.Stderr, "proto: no slice elem oenc for %T -> %T -> %T\n", t1, t2, t2.Elem()) + break + case reflect.Uint8: + p.enc = (*Buffer).enc_slice_slice_byte + p.dec = (*Buffer).dec_slice_slice_byte + p.size = size_slice_slice_byte + } + } + + case reflect.Map: + p.enc = (*Buffer).enc_new_map + p.dec = (*Buffer).dec_new_map + p.size = size_new_map + + p.mtype = t1 + p.mkeyprop = &Properties{} + p.mkeyprop.init(reflect.PtrTo(p.mtype.Key()), "Key", f.Tag.Get("protobuf_key"), nil, lockGetProp) + p.mvalprop = &Properties{} + vtype := p.mtype.Elem() + if vtype.Kind() != reflect.Ptr && vtype.Kind() != reflect.Slice { + // The value type is not a message (*T) or bytes ([]byte), + // so we need encoders for the pointer to this type. + vtype = reflect.PtrTo(vtype) + } + p.mvalprop.init(vtype, "Value", f.Tag.Get("protobuf_val"), nil, lockGetProp) + } + + // precalculate tag code + wire := p.WireType + if p.Packed { + wire = WireBytes + } + x := uint32(p.Tag)<<3 | uint32(wire) + i := 0 + for i = 0; x > 127; i++ { + p.tagbuf[i] = 0x80 | uint8(x&0x7F) + x >>= 7 + } + p.tagbuf[i] = uint8(x) + p.tagcode = p.tagbuf[0 : i+1] + + if p.stype != nil { + if lockGetProp { + p.sprop = GetProperties(p.stype) + } else { + p.sprop = getPropertiesLocked(p.stype) + } + } +} + +var ( + marshalerType = reflect.TypeOf((*Marshaler)(nil)).Elem() + unmarshalerType = reflect.TypeOf((*Unmarshaler)(nil)).Elem() +) + +// isMarshaler reports whether type t implements Marshaler. +func isMarshaler(t reflect.Type) bool { + // We're checking for (likely) pointer-receiver methods + // so if t is not a pointer, something is very wrong. + // The calls above only invoke isMarshaler on pointer types. + if t.Kind() != reflect.Ptr { + panic("proto: misuse of isMarshaler") + } + return t.Implements(marshalerType) +} + +// isUnmarshaler reports whether type t implements Unmarshaler. +func isUnmarshaler(t reflect.Type) bool { + // We're checking for (likely) pointer-receiver methods + // so if t is not a pointer, something is very wrong. + // The calls above only invoke isUnmarshaler on pointer types. + if t.Kind() != reflect.Ptr { + panic("proto: misuse of isUnmarshaler") + } + return t.Implements(unmarshalerType) +} + +// Init populates the properties from a protocol buffer struct tag. +func (p *Properties) Init(typ reflect.Type, name, tag string, f *reflect.StructField) { + p.init(typ, name, tag, f, true) +} + +func (p *Properties) init(typ reflect.Type, name, tag string, f *reflect.StructField, lockGetProp bool) { + // "bytes,49,opt,def=hello!" + p.Name = name + p.OrigName = name + if f != nil { + p.field = toField(f) + } + if tag == "" { + return + } + p.Parse(tag) + p.setEncAndDec(typ, f, lockGetProp) +} + +var ( + propertiesMu sync.RWMutex + propertiesMap = make(map[reflect.Type]*StructProperties) +) + +// GetProperties returns the list of properties for the type represented by t. +// t must represent a generated struct type of a protocol message. +func GetProperties(t reflect.Type) *StructProperties { + if t.Kind() != reflect.Struct { + panic("proto: type must have kind struct") + } + + // Most calls to GetProperties in a long-running program will be + // retrieving details for types we have seen before. + propertiesMu.RLock() + sprop, ok := propertiesMap[t] + propertiesMu.RUnlock() + if ok { + if collectStats { + stats.Chit++ + } + return sprop + } + + propertiesMu.Lock() + sprop = getPropertiesLocked(t) + propertiesMu.Unlock() + return sprop +} + +// getPropertiesLocked requires that propertiesMu is held. +func getPropertiesLocked(t reflect.Type) *StructProperties { + if prop, ok := propertiesMap[t]; ok { + if collectStats { + stats.Chit++ + } + return prop + } + if collectStats { + stats.Cmiss++ + } + + prop := new(StructProperties) + // in case of recursive protos, fill this in now. + propertiesMap[t] = prop + + // build properties + prop.extendable = reflect.PtrTo(t).Implements(extendableProtoType) + prop.unrecField = invalidField + prop.Prop = make([]*Properties, t.NumField()) + prop.order = make([]int, t.NumField()) + + for i := 0; i < t.NumField(); i++ { + f := t.Field(i) + p := new(Properties) + name := f.Name + p.init(f.Type, name, f.Tag.Get("protobuf"), &f, false) + + if f.Name == "XXX_extensions" { // special case + p.enc = (*Buffer).enc_map + p.dec = nil // not needed + p.size = size_map + } + if f.Name == "XXX_unrecognized" { // special case + prop.unrecField = toField(&f) + } + prop.Prop[i] = p + prop.order[i] = i + if debug { + print(i, " ", f.Name, " ", t.String(), " ") + if p.Tag > 0 { + print(p.String()) + } + print("\n") + } + if p.enc == nil && !strings.HasPrefix(f.Name, "XXX_") { + fmt.Fprintln(os.Stderr, "proto: no encoder for", f.Name, f.Type.String(), "[GetProperties]") + } + } + + // Re-order prop.order. + sort.Sort(prop) + + // build required counts + // build tags + reqCount := 0 + prop.decoderOrigNames = make(map[string]int) + for i, p := range prop.Prop { + if strings.HasPrefix(p.Name, "XXX_") { + // Internal fields should not appear in tags/origNames maps. + // They are handled specially when encoding and decoding. + continue + } + if p.Required { + reqCount++ + } + prop.decoderTags.put(p.Tag, i) + prop.decoderOrigNames[p.OrigName] = i + } + prop.reqCount = reqCount + + return prop +} + +// Return the Properties object for the x[0]'th field of the structure. +func propByIndex(t reflect.Type, x []int) *Properties { + if len(x) != 1 { + fmt.Fprintf(os.Stderr, "proto: field index dimension %d (not 1) for type %s\n", len(x), t) + return nil + } + prop := GetProperties(t) + return prop.Prop[x[0]] +} + +// Get the address and type of a pointer to a struct from an interface. +func getbase(pb Message) (t reflect.Type, b structPointer, err error) { + if pb == nil { + err = ErrNil + return + } + // get the reflect type of the pointer to the struct. + t = reflect.TypeOf(pb) + // get the address of the struct. + value := reflect.ValueOf(pb) + b = toStructPointer(value) + return +} + +// A global registry of enum types. +// The generated code will register the generated maps by calling RegisterEnum. + +var enumValueMaps = make(map[string]map[string]int32) + +// RegisterEnum is called from the generated code to install the enum descriptor +// maps into the global table to aid parsing text format protocol buffers. +func RegisterEnum(typeName string, unusedNameMap map[int32]string, valueMap map[string]int32) { + if _, ok := enumValueMaps[typeName]; ok { + panic("proto: duplicate enum registered: " + typeName) + } + enumValueMaps[typeName] = valueMap +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/proto3_proto/proto3.proto b/Godeps/_workspace/src/github.com/golang/protobuf/proto/proto3_proto/proto3.proto new file mode 100644 index 000000000..e2311d929 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/proto3_proto/proto3.proto @@ -0,0 +1,68 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2014 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +syntax = "proto3"; + +import "testdata/test.proto"; + +package proto3_proto; + +message Message { + enum Humour { + UNKNOWN = 0; + PUNS = 1; + SLAPSTICK = 2; + BILL_BAILEY = 3; + } + + string name = 1; + Humour hilarity = 2; + uint32 height_in_cm = 3; + bytes data = 4; + int64 result_count = 7; + bool true_scotsman = 8; + float score = 9; + + repeated uint64 key = 5; + Nested nested = 6; + + map terrain = 10; + testdata.SubDefaults proto2_field = 11; + map proto2_value = 13; +} + +message Nested { + string bunny = 1; +} + +message MessageWithMap { + map byte_mapping = 1; +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/proto3_test.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/proto3_test.go new file mode 100644 index 000000000..462f8055c --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/proto3_test.go @@ -0,0 +1,125 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2014 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +package proto_test + +import ( + "testing" + + "github.com/golang/protobuf/proto" + pb "github.com/golang/protobuf/proto/proto3_proto" + tpb "github.com/golang/protobuf/proto/testdata" +) + +func TestProto3ZeroValues(t *testing.T) { + tests := []struct { + desc string + m proto.Message + }{ + {"zero message", &pb.Message{}}, + {"empty bytes field", &pb.Message{Data: []byte{}}}, + } + for _, test := range tests { + b, err := proto.Marshal(test.m) + if err != nil { + t.Errorf("%s: proto.Marshal: %v", test.desc, err) + continue + } + if len(b) > 0 { + t.Errorf("%s: Encoding is non-empty: %q", test.desc, b) + } + } +} + +func TestRoundTripProto3(t *testing.T) { + m := &pb.Message{ + Name: "David", // (2 | 1<<3): 0x0a 0x05 "David" + Hilarity: pb.Message_PUNS, // (0 | 2<<3): 0x10 0x01 + HeightInCm: 178, // (0 | 3<<3): 0x18 0xb2 0x01 + Data: []byte("roboto"), // (2 | 4<<3): 0x20 0x06 "roboto" + ResultCount: 47, // (0 | 7<<3): 0x38 0x2f + TrueScotsman: true, // (0 | 8<<3): 0x40 0x01 + Score: 8.1, // (5 | 9<<3): 0x4d <8.1> + + Key: []uint64{1, 0xdeadbeef}, + Nested: &pb.Nested{ + Bunny: "Monty", + }, + } + t.Logf(" m: %v", m) + + b, err := proto.Marshal(m) + if err != nil { + t.Fatalf("proto.Marshal: %v", err) + } + t.Logf(" b: %q", b) + + m2 := new(pb.Message) + if err := proto.Unmarshal(b, m2); err != nil { + t.Fatalf("proto.Unmarshal: %v", err) + } + t.Logf("m2: %v", m2) + + if !proto.Equal(m, m2) { + t.Errorf("proto.Equal returned false:\n m: %v\nm2: %v", m, m2) + } +} + +func TestProto3SetDefaults(t *testing.T) { + in := &pb.Message{ + Terrain: map[string]*pb.Nested{ + "meadow": new(pb.Nested), + }, + Proto2Field: new(tpb.SubDefaults), + Proto2Value: map[string]*tpb.SubDefaults{ + "badlands": new(tpb.SubDefaults), + }, + } + + got := proto.Clone(in).(*pb.Message) + proto.SetDefaults(got) + + // There are no defaults in proto3. Everything should be the zero value, but + // we need to remember to set defaults for nested proto2 messages. + want := &pb.Message{ + Terrain: map[string]*pb.Nested{ + "meadow": new(pb.Nested), + }, + Proto2Field: &tpb.SubDefaults{N: proto.Int64(7)}, + Proto2Value: map[string]*tpb.SubDefaults{ + "badlands": &tpb.SubDefaults{N: proto.Int64(7)}, + }, + } + + if !proto.Equal(got, want) { + t.Errorf("with in = %v\nproto.SetDefaults(in) =>\ngot %v\nwant %v", in, got, want) + } +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/size2_test.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/size2_test.go new file mode 100644 index 000000000..a2729c39a --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/size2_test.go @@ -0,0 +1,63 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2012 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +package proto + +import ( + "testing" +) + +// This is a separate file and package from size_test.go because that one uses +// generated messages and thus may not be in package proto without having a circular +// dependency, whereas this file tests unexported details of size.go. + +func TestVarintSize(t *testing.T) { + // Check the edge cases carefully. + testCases := []struct { + n uint64 + size int + }{ + {0, 1}, + {1, 1}, + {127, 1}, + {128, 2}, + {16383, 2}, + {16384, 3}, + {1<<63 - 1, 9}, + {1 << 63, 10}, + } + for _, tc := range testCases { + size := sizeVarint(tc.n) + if size != tc.size { + t.Errorf("sizeVarint(%d) = %d, want %d", tc.n, size, tc.size) + } + } +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/size_test.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/size_test.go new file mode 100644 index 000000000..db5614fd1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/size_test.go @@ -0,0 +1,142 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2012 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +package proto_test + +import ( + "log" + "strings" + "testing" + + . "github.com/golang/protobuf/proto" + proto3pb "github.com/golang/protobuf/proto/proto3_proto" + pb "github.com/golang/protobuf/proto/testdata" +) + +var messageWithExtension1 = &pb.MyMessage{Count: Int32(7)} + +// messageWithExtension2 is in equal_test.go. +var messageWithExtension3 = &pb.MyMessage{Count: Int32(8)} + +func init() { + if err := SetExtension(messageWithExtension1, pb.E_Ext_More, &pb.Ext{Data: String("Abbott")}); err != nil { + log.Panicf("SetExtension: %v", err) + } + if err := SetExtension(messageWithExtension3, pb.E_Ext_More, &pb.Ext{Data: String("Costello")}); err != nil { + log.Panicf("SetExtension: %v", err) + } + + // Force messageWithExtension3 to have the extension encoded. + Marshal(messageWithExtension3) + +} + +var SizeTests = []struct { + desc string + pb Message +}{ + {"empty", &pb.OtherMessage{}}, + // Basic types. + {"bool", &pb.Defaults{F_Bool: Bool(true)}}, + {"int32", &pb.Defaults{F_Int32: Int32(12)}}, + {"negative int32", &pb.Defaults{F_Int32: Int32(-1)}}, + {"small int64", &pb.Defaults{F_Int64: Int64(1)}}, + {"big int64", &pb.Defaults{F_Int64: Int64(1 << 20)}}, + {"negative int64", &pb.Defaults{F_Int64: Int64(-1)}}, + {"fixed32", &pb.Defaults{F_Fixed32: Uint32(71)}}, + {"fixed64", &pb.Defaults{F_Fixed64: Uint64(72)}}, + {"uint32", &pb.Defaults{F_Uint32: Uint32(123)}}, + {"uint64", &pb.Defaults{F_Uint64: Uint64(124)}}, + {"float", &pb.Defaults{F_Float: Float32(12.6)}}, + {"double", &pb.Defaults{F_Double: Float64(13.9)}}, + {"string", &pb.Defaults{F_String: String("niles")}}, + {"bytes", &pb.Defaults{F_Bytes: []byte("wowsa")}}, + {"bytes, empty", &pb.Defaults{F_Bytes: []byte{}}}, + {"sint32", &pb.Defaults{F_Sint32: Int32(65)}}, + {"sint64", &pb.Defaults{F_Sint64: Int64(67)}}, + {"enum", &pb.Defaults{F_Enum: pb.Defaults_BLUE.Enum()}}, + // Repeated. + {"empty repeated bool", &pb.MoreRepeated{Bools: []bool{}}}, + {"repeated bool", &pb.MoreRepeated{Bools: []bool{false, true, true, false}}}, + {"packed repeated bool", &pb.MoreRepeated{BoolsPacked: []bool{false, true, true, false, true, true, true}}}, + {"repeated int32", &pb.MoreRepeated{Ints: []int32{1, 12203, 1729, -1}}}, + {"repeated int32 packed", &pb.MoreRepeated{IntsPacked: []int32{1, 12203, 1729}}}, + {"repeated int64 packed", &pb.MoreRepeated{Int64SPacked: []int64{ + // Need enough large numbers to verify that the header is counting the number of bytes + // for the field, not the number of elements. + 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, + 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, 1 << 62, + }}}, + {"repeated string", &pb.MoreRepeated{Strings: []string{"r", "ken", "gri"}}}, + {"repeated fixed", &pb.MoreRepeated{Fixeds: []uint32{1, 2, 3, 4}}}, + // Nested. + {"nested", &pb.OldMessage{Nested: &pb.OldMessage_Nested{Name: String("whatever")}}}, + {"group", &pb.GroupOld{G: &pb.GroupOld_G{X: Int32(12345)}}}, + // Other things. + {"unrecognized", &pb.MoreRepeated{XXX_unrecognized: []byte{13<<3 | 0, 4}}}, + {"extension (unencoded)", messageWithExtension1}, + {"extension (encoded)", messageWithExtension3}, + // proto3 message + {"proto3 empty", &proto3pb.Message{}}, + {"proto3 bool", &proto3pb.Message{TrueScotsman: true}}, + {"proto3 int64", &proto3pb.Message{ResultCount: 1}}, + {"proto3 uint32", &proto3pb.Message{HeightInCm: 123}}, + {"proto3 float", &proto3pb.Message{Score: 12.6}}, + {"proto3 string", &proto3pb.Message{Name: "Snezana"}}, + {"proto3 bytes", &proto3pb.Message{Data: []byte("wowsa")}}, + {"proto3 bytes, empty", &proto3pb.Message{Data: []byte{}}}, + {"proto3 enum", &proto3pb.Message{Hilarity: proto3pb.Message_PUNS}}, + {"proto3 map field with empty bytes", &proto3pb.MessageWithMap{ByteMapping: map[bool][]byte{false: []byte{}}}}, + + {"map field", &pb.MessageWithMap{NameMapping: map[int32]string{1: "Rob", 7: "Andrew"}}}, + {"map field with message", &pb.MessageWithMap{MsgMapping: map[int64]*pb.FloatingPoint{0x7001: &pb.FloatingPoint{F: Float64(2.0)}}}}, + {"map field with bytes", &pb.MessageWithMap{ByteMapping: map[bool][]byte{true: []byte("this time for sure")}}}, + {"map field with empty bytes", &pb.MessageWithMap{ByteMapping: map[bool][]byte{true: []byte{}}}}, + + {"map field with big entry", &pb.MessageWithMap{NameMapping: map[int32]string{8: strings.Repeat("x", 125)}}}, + {"map field with big key and val", &pb.MessageWithMap{StrToStr: map[string]string{strings.Repeat("x", 70): strings.Repeat("y", 70)}}}, + {"map field with big numeric key", &pb.MessageWithMap{NameMapping: map[int32]string{0xf00d: "om nom nom"}}}, +} + +func TestSize(t *testing.T) { + for _, tc := range SizeTests { + size := Size(tc.pb) + b, err := Marshal(tc.pb) + if err != nil { + t.Errorf("%v: Marshal failed: %v", tc.desc, err) + continue + } + if size != len(b) { + t.Errorf("%v: Size(%v) = %d, want %d", tc.desc, tc.pb, size, len(b)) + t.Logf("%v: bytes: %#v", tc.desc, b) + } + } +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/testdata/Makefile b/Godeps/_workspace/src/github.com/golang/protobuf/proto/testdata/Makefile new file mode 100644 index 000000000..fc288628a --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/testdata/Makefile @@ -0,0 +1,50 @@ +# Go support for Protocol Buffers - Google's data interchange format +# +# Copyright 2010 The Go Authors. All rights reserved. +# https://github.com/golang/protobuf +# +# 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. + + +include ../../Make.protobuf + +all: regenerate + +regenerate: + rm -f test.pb.go + make test.pb.go + +# The following rules are just aids to development. Not needed for typical testing. + +diff: regenerate + git diff test.pb.go + +restore: + cp test.pb.go.golden test.pb.go + +preserve: + cp test.pb.go test.pb.go.golden diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/testdata/golden_test.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/testdata/golden_test.go new file mode 100644 index 000000000..7172d0e96 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/testdata/golden_test.go @@ -0,0 +1,86 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2012 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +// Verify that the compiler output for test.proto is unchanged. + +package testdata + +import ( + "crypto/sha1" + "fmt" + "io/ioutil" + "os" + "os/exec" + "path/filepath" + "testing" +) + +// sum returns in string form (for easy comparison) the SHA-1 hash of the named file. +func sum(t *testing.T, name string) string { + data, err := ioutil.ReadFile(name) + if err != nil { + t.Fatal(err) + } + t.Logf("sum(%q): length is %d", name, len(data)) + hash := sha1.New() + _, err = hash.Write(data) + if err != nil { + t.Fatal(err) + } + return fmt.Sprintf("% x", hash.Sum(nil)) +} + +func run(t *testing.T, name string, args ...string) { + cmd := exec.Command(name, args...) + cmd.Stdin = os.Stdin + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + err := cmd.Run() + if err != nil { + t.Fatal(err) + } +} + +func TestGolden(t *testing.T) { + // Compute the original checksum. + goldenSum := sum(t, "test.pb.go") + // Run the proto compiler. + run(t, "protoc", "--go_out="+os.TempDir(), "test.proto") + newFile := filepath.Join(os.TempDir(), "test.pb.go") + defer os.Remove(newFile) + // Compute the new checksum. + newSum := sum(t, newFile) + // Verify + if newSum != goldenSum { + run(t, "diff", "-u", "test.pb.go", newFile) + t.Fatal("Code generated by protoc-gen-go has changed; update test.pb.go") + } +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/testdata/test.proto b/Godeps/_workspace/src/github.com/golang/protobuf/proto/testdata/test.proto new file mode 100644 index 000000000..440dba38d --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/testdata/test.proto @@ -0,0 +1,480 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2010 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +// A feature-rich test file for the protocol compiler and libraries. + +syntax = "proto2"; + +package testdata; + +enum FOO { FOO1 = 1; }; + +message GoEnum { + required FOO foo = 1; +} + +message GoTestField { + required string Label = 1; + required string Type = 2; +} + +message GoTest { + // An enum, for completeness. + enum KIND { + VOID = 0; + + // Basic types + BOOL = 1; + BYTES = 2; + FINGERPRINT = 3; + FLOAT = 4; + INT = 5; + STRING = 6; + TIME = 7; + + // Groupings + TUPLE = 8; + ARRAY = 9; + MAP = 10; + + // Table types + TABLE = 11; + + // Functions + FUNCTION = 12; // last tag + }; + + // Some typical parameters + required KIND Kind = 1; + optional string Table = 2; + optional int32 Param = 3; + + // Required, repeated and optional foreign fields. + required GoTestField RequiredField = 4; + repeated GoTestField RepeatedField = 5; + optional GoTestField OptionalField = 6; + + // Required fields of all basic types + required bool F_Bool_required = 10; + required int32 F_Int32_required = 11; + required int64 F_Int64_required = 12; + required fixed32 F_Fixed32_required = 13; + required fixed64 F_Fixed64_required = 14; + required uint32 F_Uint32_required = 15; + required uint64 F_Uint64_required = 16; + required float F_Float_required = 17; + required double F_Double_required = 18; + required string F_String_required = 19; + required bytes F_Bytes_required = 101; + required sint32 F_Sint32_required = 102; + required sint64 F_Sint64_required = 103; + + // Repeated fields of all basic types + repeated bool F_Bool_repeated = 20; + repeated int32 F_Int32_repeated = 21; + repeated int64 F_Int64_repeated = 22; + repeated fixed32 F_Fixed32_repeated = 23; + repeated fixed64 F_Fixed64_repeated = 24; + repeated uint32 F_Uint32_repeated = 25; + repeated uint64 F_Uint64_repeated = 26; + repeated float F_Float_repeated = 27; + repeated double F_Double_repeated = 28; + repeated string F_String_repeated = 29; + repeated bytes F_Bytes_repeated = 201; + repeated sint32 F_Sint32_repeated = 202; + repeated sint64 F_Sint64_repeated = 203; + + // Optional fields of all basic types + optional bool F_Bool_optional = 30; + optional int32 F_Int32_optional = 31; + optional int64 F_Int64_optional = 32; + optional fixed32 F_Fixed32_optional = 33; + optional fixed64 F_Fixed64_optional = 34; + optional uint32 F_Uint32_optional = 35; + optional uint64 F_Uint64_optional = 36; + optional float F_Float_optional = 37; + optional double F_Double_optional = 38; + optional string F_String_optional = 39; + optional bytes F_Bytes_optional = 301; + optional sint32 F_Sint32_optional = 302; + optional sint64 F_Sint64_optional = 303; + + // Default-valued fields of all basic types + optional bool F_Bool_defaulted = 40 [default=true]; + optional int32 F_Int32_defaulted = 41 [default=32]; + optional int64 F_Int64_defaulted = 42 [default=64]; + optional fixed32 F_Fixed32_defaulted = 43 [default=320]; + optional fixed64 F_Fixed64_defaulted = 44 [default=640]; + optional uint32 F_Uint32_defaulted = 45 [default=3200]; + optional uint64 F_Uint64_defaulted = 46 [default=6400]; + optional float F_Float_defaulted = 47 [default=314159.]; + optional double F_Double_defaulted = 48 [default=271828.]; + optional string F_String_defaulted = 49 [default="hello, \"world!\"\n"]; + optional bytes F_Bytes_defaulted = 401 [default="Bignose"]; + optional sint32 F_Sint32_defaulted = 402 [default = -32]; + optional sint64 F_Sint64_defaulted = 403 [default = -64]; + + // Packed repeated fields (no string or bytes). + repeated bool F_Bool_repeated_packed = 50 [packed=true]; + repeated int32 F_Int32_repeated_packed = 51 [packed=true]; + repeated int64 F_Int64_repeated_packed = 52 [packed=true]; + repeated fixed32 F_Fixed32_repeated_packed = 53 [packed=true]; + repeated fixed64 F_Fixed64_repeated_packed = 54 [packed=true]; + repeated uint32 F_Uint32_repeated_packed = 55 [packed=true]; + repeated uint64 F_Uint64_repeated_packed = 56 [packed=true]; + repeated float F_Float_repeated_packed = 57 [packed=true]; + repeated double F_Double_repeated_packed = 58 [packed=true]; + repeated sint32 F_Sint32_repeated_packed = 502 [packed=true]; + repeated sint64 F_Sint64_repeated_packed = 503 [packed=true]; + + // Required, repeated, and optional groups. + required group RequiredGroup = 70 { + required string RequiredField = 71; + }; + + repeated group RepeatedGroup = 80 { + required string RequiredField = 81; + }; + + optional group OptionalGroup = 90 { + required string RequiredField = 91; + }; +} + +// For testing skipping of unrecognized fields. +// Numbers are all big, larger than tag numbers in GoTestField, +// the message used in the corresponding test. +message GoSkipTest { + required int32 skip_int32 = 11; + required fixed32 skip_fixed32 = 12; + required fixed64 skip_fixed64 = 13; + required string skip_string = 14; + required group SkipGroup = 15 { + required int32 group_int32 = 16; + required string group_string = 17; + } +} + +// For testing packed/non-packed decoder switching. +// A serialized instance of one should be deserializable as the other. +message NonPackedTest { + repeated int32 a = 1; +} + +message PackedTest { + repeated int32 b = 1 [packed=true]; +} + +message MaxTag { + // Maximum possible tag number. + optional string last_field = 536870911; +} + +message OldMessage { + message Nested { + optional string name = 1; + } + optional Nested nested = 1; + + optional int32 num = 2; +} + +// NewMessage is wire compatible with OldMessage; +// imagine it as a future version. +message NewMessage { + message Nested { + optional string name = 1; + optional string food_group = 2; + } + optional Nested nested = 1; + + // This is an int32 in OldMessage. + optional int64 num = 2; +} + +// Smaller tests for ASCII formatting. + +message InnerMessage { + required string host = 1; + optional int32 port = 2 [default=4000]; + optional bool connected = 3; +} + +message OtherMessage { + optional int64 key = 1; + optional bytes value = 2; + optional float weight = 3; + optional InnerMessage inner = 4; +} + +message MyMessage { + required int32 count = 1; + optional string name = 2; + optional string quote = 3; + repeated string pet = 4; + optional InnerMessage inner = 5; + repeated OtherMessage others = 6; + repeated InnerMessage rep_inner = 12; + + enum Color { + RED = 0; + GREEN = 1; + BLUE = 2; + }; + optional Color bikeshed = 7; + + optional group SomeGroup = 8 { + optional int32 group_field = 9; + } + + // This field becomes [][]byte in the generated code. + repeated bytes rep_bytes = 10; + + optional double bigfloat = 11; + + extensions 100 to max; +} + +message Ext { + extend MyMessage { + optional Ext more = 103; + optional string text = 104; + optional int32 number = 105; + } + + optional string data = 1; +} + +extend MyMessage { + repeated string greeting = 106; +} + +message DefaultsMessage { + enum DefaultsEnum { + ZERO = 0; + ONE = 1; + TWO = 2; + }; + extensions 100 to max; +} + +extend DefaultsMessage { + optional double no_default_double = 101; + optional float no_default_float = 102; + optional int32 no_default_int32 = 103; + optional int64 no_default_int64 = 104; + optional uint32 no_default_uint32 = 105; + optional uint64 no_default_uint64 = 106; + optional sint32 no_default_sint32 = 107; + optional sint64 no_default_sint64 = 108; + optional fixed32 no_default_fixed32 = 109; + optional fixed64 no_default_fixed64 = 110; + optional sfixed32 no_default_sfixed32 = 111; + optional sfixed64 no_default_sfixed64 = 112; + optional bool no_default_bool = 113; + optional string no_default_string = 114; + optional bytes no_default_bytes = 115; + optional DefaultsMessage.DefaultsEnum no_default_enum = 116; + + optional double default_double = 201 [default = 3.1415]; + optional float default_float = 202 [default = 3.14]; + optional int32 default_int32 = 203 [default = 42]; + optional int64 default_int64 = 204 [default = 43]; + optional uint32 default_uint32 = 205 [default = 44]; + optional uint64 default_uint64 = 206 [default = 45]; + optional sint32 default_sint32 = 207 [default = 46]; + optional sint64 default_sint64 = 208 [default = 47]; + optional fixed32 default_fixed32 = 209 [default = 48]; + optional fixed64 default_fixed64 = 210 [default = 49]; + optional sfixed32 default_sfixed32 = 211 [default = 50]; + optional sfixed64 default_sfixed64 = 212 [default = 51]; + optional bool default_bool = 213 [default = true]; + optional string default_string = 214 [default = "Hello, string"]; + optional bytes default_bytes = 215 [default = "Hello, bytes"]; + optional DefaultsMessage.DefaultsEnum default_enum = 216 [default = ONE]; +} + +message MyMessageSet { + option message_set_wire_format = true; + extensions 100 to max; +} + +message Empty { +} + +extend MyMessageSet { + optional Empty x201 = 201; + optional Empty x202 = 202; + optional Empty x203 = 203; + optional Empty x204 = 204; + optional Empty x205 = 205; + optional Empty x206 = 206; + optional Empty x207 = 207; + optional Empty x208 = 208; + optional Empty x209 = 209; + optional Empty x210 = 210; + optional Empty x211 = 211; + optional Empty x212 = 212; + optional Empty x213 = 213; + optional Empty x214 = 214; + optional Empty x215 = 215; + optional Empty x216 = 216; + optional Empty x217 = 217; + optional Empty x218 = 218; + optional Empty x219 = 219; + optional Empty x220 = 220; + optional Empty x221 = 221; + optional Empty x222 = 222; + optional Empty x223 = 223; + optional Empty x224 = 224; + optional Empty x225 = 225; + optional Empty x226 = 226; + optional Empty x227 = 227; + optional Empty x228 = 228; + optional Empty x229 = 229; + optional Empty x230 = 230; + optional Empty x231 = 231; + optional Empty x232 = 232; + optional Empty x233 = 233; + optional Empty x234 = 234; + optional Empty x235 = 235; + optional Empty x236 = 236; + optional Empty x237 = 237; + optional Empty x238 = 238; + optional Empty x239 = 239; + optional Empty x240 = 240; + optional Empty x241 = 241; + optional Empty x242 = 242; + optional Empty x243 = 243; + optional Empty x244 = 244; + optional Empty x245 = 245; + optional Empty x246 = 246; + optional Empty x247 = 247; + optional Empty x248 = 248; + optional Empty x249 = 249; + optional Empty x250 = 250; +} + +message MessageList { + repeated group Message = 1 { + required string name = 2; + required int32 count = 3; + } +} + +message Strings { + optional string string_field = 1; + optional bytes bytes_field = 2; +} + +message Defaults { + enum Color { + RED = 0; + GREEN = 1; + BLUE = 2; + } + + // Default-valued fields of all basic types. + // Same as GoTest, but copied here to make testing easier. + optional bool F_Bool = 1 [default=true]; + optional int32 F_Int32 = 2 [default=32]; + optional int64 F_Int64 = 3 [default=64]; + optional fixed32 F_Fixed32 = 4 [default=320]; + optional fixed64 F_Fixed64 = 5 [default=640]; + optional uint32 F_Uint32 = 6 [default=3200]; + optional uint64 F_Uint64 = 7 [default=6400]; + optional float F_Float = 8 [default=314159.]; + optional double F_Double = 9 [default=271828.]; + optional string F_String = 10 [default="hello, \"world!\"\n"]; + optional bytes F_Bytes = 11 [default="Bignose"]; + optional sint32 F_Sint32 = 12 [default=-32]; + optional sint64 F_Sint64 = 13 [default=-64]; + optional Color F_Enum = 14 [default=GREEN]; + + // More fields with crazy defaults. + optional float F_Pinf = 15 [default=inf]; + optional float F_Ninf = 16 [default=-inf]; + optional float F_Nan = 17 [default=nan]; + + // Sub-message. + optional SubDefaults sub = 18; + + // Redundant but explicit defaults. + optional string str_zero = 19 [default=""]; +} + +message SubDefaults { + optional int64 n = 1 [default=7]; +} + +message RepeatedEnum { + enum Color { + RED = 1; + } + repeated Color color = 1; +} + +message MoreRepeated { + repeated bool bools = 1; + repeated bool bools_packed = 2 [packed=true]; + repeated int32 ints = 3; + repeated int32 ints_packed = 4 [packed=true]; + repeated int64 int64s_packed = 7 [packed=true]; + repeated string strings = 5; + repeated fixed32 fixeds = 6; +} + +// GroupOld and GroupNew have the same wire format. +// GroupNew has a new field inside a group. + +message GroupOld { + optional group G = 101 { + optional int32 x = 2; + } +} + +message GroupNew { + optional group G = 101 { + optional int32 x = 2; + optional int32 y = 3; + } +} + +message FloatingPoint { + required double f = 1; +} + +message MessageWithMap { + map name_mapping = 1; + map msg_mapping = 2; + map byte_mapping = 3; + map str_to_str = 4; +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/text.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/text.go new file mode 100644 index 000000000..f7dc58a3e --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/text.go @@ -0,0 +1,769 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2010 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +package proto + +// Functions for writing the text protocol buffer format. + +import ( + "bufio" + "bytes" + "encoding" + "fmt" + "io" + "log" + "math" + "reflect" + "sort" + "strings" +) + +var ( + newline = []byte("\n") + spaces = []byte(" ") + gtNewline = []byte(">\n") + endBraceNewline = []byte("}\n") + backslashN = []byte{'\\', 'n'} + backslashR = []byte{'\\', 'r'} + backslashT = []byte{'\\', 't'} + backslashDQ = []byte{'\\', '"'} + backslashBS = []byte{'\\', '\\'} + posInf = []byte("inf") + negInf = []byte("-inf") + nan = []byte("nan") +) + +type writer interface { + io.Writer + WriteByte(byte) error +} + +// textWriter is an io.Writer that tracks its indentation level. +type textWriter struct { + ind int + complete bool // if the current position is a complete line + compact bool // whether to write out as a one-liner + w writer +} + +func (w *textWriter) WriteString(s string) (n int, err error) { + if !strings.Contains(s, "\n") { + if !w.compact && w.complete { + w.writeIndent() + } + w.complete = false + return io.WriteString(w.w, s) + } + // WriteString is typically called without newlines, so this + // codepath and its copy are rare. We copy to avoid + // duplicating all of Write's logic here. + return w.Write([]byte(s)) +} + +func (w *textWriter) Write(p []byte) (n int, err error) { + newlines := bytes.Count(p, newline) + if newlines == 0 { + if !w.compact && w.complete { + w.writeIndent() + } + n, err = w.w.Write(p) + w.complete = false + return n, err + } + + frags := bytes.SplitN(p, newline, newlines+1) + if w.compact { + for i, frag := range frags { + if i > 0 { + if err := w.w.WriteByte(' '); err != nil { + return n, err + } + n++ + } + nn, err := w.w.Write(frag) + n += nn + if err != nil { + return n, err + } + } + return n, nil + } + + for i, frag := range frags { + if w.complete { + w.writeIndent() + } + nn, err := w.w.Write(frag) + n += nn + if err != nil { + return n, err + } + if i+1 < len(frags) { + if err := w.w.WriteByte('\n'); err != nil { + return n, err + } + n++ + } + } + w.complete = len(frags[len(frags)-1]) == 0 + return n, nil +} + +func (w *textWriter) WriteByte(c byte) error { + if w.compact && c == '\n' { + c = ' ' + } + if !w.compact && w.complete { + w.writeIndent() + } + err := w.w.WriteByte(c) + w.complete = c == '\n' + return err +} + +func (w *textWriter) indent() { w.ind++ } + +func (w *textWriter) unindent() { + if w.ind == 0 { + log.Printf("proto: textWriter unindented too far") + return + } + w.ind-- +} + +func writeName(w *textWriter, props *Properties) error { + if _, err := w.WriteString(props.OrigName); err != nil { + return err + } + if props.Wire != "group" { + return w.WriteByte(':') + } + return nil +} + +var ( + messageSetType = reflect.TypeOf((*MessageSet)(nil)).Elem() +) + +// raw is the interface satisfied by RawMessage. +type raw interface { + Bytes() []byte +} + +func writeStruct(w *textWriter, sv reflect.Value) error { + if sv.Type() == messageSetType { + return writeMessageSet(w, sv.Addr().Interface().(*MessageSet)) + } + + st := sv.Type() + sprops := GetProperties(st) + for i := 0; i < sv.NumField(); i++ { + fv := sv.Field(i) + props := sprops.Prop[i] + name := st.Field(i).Name + + if strings.HasPrefix(name, "XXX_") { + // There are two XXX_ fields: + // XXX_unrecognized []byte + // XXX_extensions map[int32]proto.Extension + // The first is handled here; + // the second is handled at the bottom of this function. + if name == "XXX_unrecognized" && !fv.IsNil() { + if err := writeUnknownStruct(w, fv.Interface().([]byte)); err != nil { + return err + } + } + continue + } + if fv.Kind() == reflect.Ptr && fv.IsNil() { + // Field not filled in. This could be an optional field or + // a required field that wasn't filled in. Either way, there + // isn't anything we can show for it. + continue + } + if fv.Kind() == reflect.Slice && fv.IsNil() { + // Repeated field that is empty, or a bytes field that is unused. + continue + } + + if props.Repeated && fv.Kind() == reflect.Slice { + // Repeated field. + for j := 0; j < fv.Len(); j++ { + if err := writeName(w, props); err != nil { + return err + } + if !w.compact { + if err := w.WriteByte(' '); err != nil { + return err + } + } + v := fv.Index(j) + if v.Kind() == reflect.Ptr && v.IsNil() { + // A nil message in a repeated field is not valid, + // but we can handle that more gracefully than panicking. + if _, err := w.Write([]byte("\n")); err != nil { + return err + } + continue + } + if err := writeAny(w, v, props); err != nil { + return err + } + if err := w.WriteByte('\n'); err != nil { + return err + } + } + continue + } + if fv.Kind() == reflect.Map { + // Map fields are rendered as a repeated struct with key/value fields. + keys := fv.MapKeys() // TODO: should we sort these for deterministic output? + sort.Sort(mapKeys(keys)) + for _, key := range keys { + val := fv.MapIndex(key) + if err := writeName(w, props); err != nil { + return err + } + if !w.compact { + if err := w.WriteByte(' '); err != nil { + return err + } + } + // open struct + if err := w.WriteByte('<'); err != nil { + return err + } + if !w.compact { + if err := w.WriteByte('\n'); err != nil { + return err + } + } + w.indent() + // key + if _, err := w.WriteString("key:"); err != nil { + return err + } + if !w.compact { + if err := w.WriteByte(' '); err != nil { + return err + } + } + if err := writeAny(w, key, props.mkeyprop); err != nil { + return err + } + if err := w.WriteByte('\n'); err != nil { + return err + } + // nil values aren't legal, but we can avoid panicking because of them. + if val.Kind() != reflect.Ptr || !val.IsNil() { + // value + if _, err := w.WriteString("value:"); err != nil { + return err + } + if !w.compact { + if err := w.WriteByte(' '); err != nil { + return err + } + } + if err := writeAny(w, val, props.mvalprop); err != nil { + return err + } + if err := w.WriteByte('\n'); err != nil { + return err + } + } + // close struct + w.unindent() + if err := w.WriteByte('>'); err != nil { + return err + } + if err := w.WriteByte('\n'); err != nil { + return err + } + } + continue + } + if props.proto3 && fv.Kind() == reflect.Slice && fv.Len() == 0 { + // empty bytes field + continue + } + if fv.Kind() != reflect.Ptr && fv.Kind() != reflect.Slice { + // proto3 non-repeated scalar field; skip if zero value + if isProto3Zero(fv) { + continue + } + } + + if err := writeName(w, props); err != nil { + return err + } + if !w.compact { + if err := w.WriteByte(' '); err != nil { + return err + } + } + if b, ok := fv.Interface().(raw); ok { + if err := writeRaw(w, b.Bytes()); err != nil { + return err + } + continue + } + + // Enums have a String method, so writeAny will work fine. + if err := writeAny(w, fv, props); err != nil { + return err + } + + if err := w.WriteByte('\n'); err != nil { + return err + } + } + + // Extensions (the XXX_extensions field). + pv := sv.Addr() + if pv.Type().Implements(extendableProtoType) { + if err := writeExtensions(w, pv); err != nil { + return err + } + } + + return nil +} + +// writeRaw writes an uninterpreted raw message. +func writeRaw(w *textWriter, b []byte) error { + if err := w.WriteByte('<'); err != nil { + return err + } + if !w.compact { + if err := w.WriteByte('\n'); err != nil { + return err + } + } + w.indent() + if err := writeUnknownStruct(w, b); err != nil { + return err + } + w.unindent() + if err := w.WriteByte('>'); err != nil { + return err + } + return nil +} + +// writeAny writes an arbitrary field. +func writeAny(w *textWriter, v reflect.Value, props *Properties) error { + v = reflect.Indirect(v) + + // Floats have special cases. + if v.Kind() == reflect.Float32 || v.Kind() == reflect.Float64 { + x := v.Float() + var b []byte + switch { + case math.IsInf(x, 1): + b = posInf + case math.IsInf(x, -1): + b = negInf + case math.IsNaN(x): + b = nan + } + if b != nil { + _, err := w.Write(b) + return err + } + // Other values are handled below. + } + + // We don't attempt to serialise every possible value type; only those + // that can occur in protocol buffers. + switch v.Kind() { + case reflect.Slice: + // Should only be a []byte; repeated fields are handled in writeStruct. + if err := writeString(w, string(v.Interface().([]byte))); err != nil { + return err + } + case reflect.String: + if err := writeString(w, v.String()); err != nil { + return err + } + case reflect.Struct: + // Required/optional group/message. + var bra, ket byte = '<', '>' + if props != nil && props.Wire == "group" { + bra, ket = '{', '}' + } + if err := w.WriteByte(bra); err != nil { + return err + } + if !w.compact { + if err := w.WriteByte('\n'); err != nil { + return err + } + } + w.indent() + if tm, ok := v.Interface().(encoding.TextMarshaler); ok { + text, err := tm.MarshalText() + if err != nil { + return err + } + if _, err = w.Write(text); err != nil { + return err + } + } else if err := writeStruct(w, v); err != nil { + return err + } + w.unindent() + if err := w.WriteByte(ket); err != nil { + return err + } + default: + _, err := fmt.Fprint(w, v.Interface()) + return err + } + return nil +} + +// equivalent to C's isprint. +func isprint(c byte) bool { + return c >= 0x20 && c < 0x7f +} + +// writeString writes a string in the protocol buffer text format. +// It is similar to strconv.Quote except we don't use Go escape sequences, +// we treat the string as a byte sequence, and we use octal escapes. +// These differences are to maintain interoperability with the other +// languages' implementations of the text format. +func writeString(w *textWriter, s string) error { + // use WriteByte here to get any needed indent + if err := w.WriteByte('"'); err != nil { + return err + } + // Loop over the bytes, not the runes. + for i := 0; i < len(s); i++ { + var err error + // Divergence from C++: we don't escape apostrophes. + // There's no need to escape them, and the C++ parser + // copes with a naked apostrophe. + switch c := s[i]; c { + case '\n': + _, err = w.w.Write(backslashN) + case '\r': + _, err = w.w.Write(backslashR) + case '\t': + _, err = w.w.Write(backslashT) + case '"': + _, err = w.w.Write(backslashDQ) + case '\\': + _, err = w.w.Write(backslashBS) + default: + if isprint(c) { + err = w.w.WriteByte(c) + } else { + _, err = fmt.Fprintf(w.w, "\\%03o", c) + } + } + if err != nil { + return err + } + } + return w.WriteByte('"') +} + +func writeMessageSet(w *textWriter, ms *MessageSet) error { + for _, item := range ms.Item { + id := *item.TypeId + if msd, ok := messageSetMap[id]; ok { + // Known message set type. + if _, err := fmt.Fprintf(w, "[%s]: <\n", msd.name); err != nil { + return err + } + w.indent() + + pb := reflect.New(msd.t.Elem()) + if err := Unmarshal(item.Message, pb.Interface().(Message)); err != nil { + if _, err := fmt.Fprintf(w, "/* bad message: %v */\n", err); err != nil { + return err + } + } else { + if err := writeStruct(w, pb.Elem()); err != nil { + return err + } + } + } else { + // Unknown type. + if _, err := fmt.Fprintf(w, "[%d]: <\n", id); err != nil { + return err + } + w.indent() + if err := writeUnknownStruct(w, item.Message); err != nil { + return err + } + } + w.unindent() + if _, err := w.Write(gtNewline); err != nil { + return err + } + } + return nil +} + +func writeUnknownStruct(w *textWriter, data []byte) (err error) { + if !w.compact { + if _, err := fmt.Fprintf(w, "/* %d unknown bytes */\n", len(data)); err != nil { + return err + } + } + b := NewBuffer(data) + for b.index < len(b.buf) { + x, err := b.DecodeVarint() + if err != nil { + _, err := fmt.Fprintf(w, "/* %v */\n", err) + return err + } + wire, tag := x&7, x>>3 + if wire == WireEndGroup { + w.unindent() + if _, err := w.Write(endBraceNewline); err != nil { + return err + } + continue + } + if _, err := fmt.Fprint(w, tag); err != nil { + return err + } + if wire != WireStartGroup { + if err := w.WriteByte(':'); err != nil { + return err + } + } + if !w.compact || wire == WireStartGroup { + if err := w.WriteByte(' '); err != nil { + return err + } + } + switch wire { + case WireBytes: + buf, e := b.DecodeRawBytes(false) + if e == nil { + _, err = fmt.Fprintf(w, "%q", buf) + } else { + _, err = fmt.Fprintf(w, "/* %v */", e) + } + case WireFixed32: + x, err = b.DecodeFixed32() + err = writeUnknownInt(w, x, err) + case WireFixed64: + x, err = b.DecodeFixed64() + err = writeUnknownInt(w, x, err) + case WireStartGroup: + err = w.WriteByte('{') + w.indent() + case WireVarint: + x, err = b.DecodeVarint() + err = writeUnknownInt(w, x, err) + default: + _, err = fmt.Fprintf(w, "/* unknown wire type %d */", wire) + } + if err != nil { + return err + } + if err = w.WriteByte('\n'); err != nil { + return err + } + } + return nil +} + +func writeUnknownInt(w *textWriter, x uint64, err error) error { + if err == nil { + _, err = fmt.Fprint(w, x) + } else { + _, err = fmt.Fprintf(w, "/* %v */", err) + } + return err +} + +type int32Slice []int32 + +func (s int32Slice) Len() int { return len(s) } +func (s int32Slice) Less(i, j int) bool { return s[i] < s[j] } +func (s int32Slice) Swap(i, j int) { s[i], s[j] = s[j], s[i] } + +// writeExtensions writes all the extensions in pv. +// pv is assumed to be a pointer to a protocol message struct that is extendable. +func writeExtensions(w *textWriter, pv reflect.Value) error { + emap := extensionMaps[pv.Type().Elem()] + ep := pv.Interface().(extendableProto) + + // Order the extensions by ID. + // This isn't strictly necessary, but it will give us + // canonical output, which will also make testing easier. + m := ep.ExtensionMap() + ids := make([]int32, 0, len(m)) + for id := range m { + ids = append(ids, id) + } + sort.Sort(int32Slice(ids)) + + for _, extNum := range ids { + ext := m[extNum] + var desc *ExtensionDesc + if emap != nil { + desc = emap[extNum] + } + if desc == nil { + // Unknown extension. + if err := writeUnknownStruct(w, ext.enc); err != nil { + return err + } + continue + } + + pb, err := GetExtension(ep, desc) + if err != nil { + return fmt.Errorf("failed getting extension: %v", err) + } + + // Repeated extensions will appear as a slice. + if !desc.repeated() { + if err := writeExtension(w, desc.Name, pb); err != nil { + return err + } + } else { + v := reflect.ValueOf(pb) + for i := 0; i < v.Len(); i++ { + if err := writeExtension(w, desc.Name, v.Index(i).Interface()); err != nil { + return err + } + } + } + } + return nil +} + +func writeExtension(w *textWriter, name string, pb interface{}) error { + if _, err := fmt.Fprintf(w, "[%s]:", name); err != nil { + return err + } + if !w.compact { + if err := w.WriteByte(' '); err != nil { + return err + } + } + if err := writeAny(w, reflect.ValueOf(pb), nil); err != nil { + return err + } + if err := w.WriteByte('\n'); err != nil { + return err + } + return nil +} + +func (w *textWriter) writeIndent() { + if !w.complete { + return + } + remain := w.ind * 2 + for remain > 0 { + n := remain + if n > len(spaces) { + n = len(spaces) + } + w.w.Write(spaces[:n]) + remain -= n + } + w.complete = false +} + +func marshalText(w io.Writer, pb Message, compact bool) error { + val := reflect.ValueOf(pb) + if pb == nil || val.IsNil() { + w.Write([]byte("")) + return nil + } + var bw *bufio.Writer + ww, ok := w.(writer) + if !ok { + bw = bufio.NewWriter(w) + ww = bw + } + aw := &textWriter{ + w: ww, + complete: true, + compact: compact, + } + + if tm, ok := pb.(encoding.TextMarshaler); ok { + text, err := tm.MarshalText() + if err != nil { + return err + } + if _, err = aw.Write(text); err != nil { + return err + } + if bw != nil { + return bw.Flush() + } + return nil + } + // Dereference the received pointer so we don't have outer < and >. + v := reflect.Indirect(val) + if err := writeStruct(aw, v); err != nil { + return err + } + if bw != nil { + return bw.Flush() + } + return nil +} + +// MarshalText writes a given protocol buffer in text format. +// The only errors returned are from w. +func MarshalText(w io.Writer, pb Message) error { + return marshalText(w, pb, false) +} + +// MarshalTextString is the same as MarshalText, but returns the string directly. +func MarshalTextString(pb Message) string { + var buf bytes.Buffer + marshalText(&buf, pb, false) + return buf.String() +} + +// CompactText writes a given protocol buffer in compact text format (one line). +func CompactText(w io.Writer, pb Message) error { return marshalText(w, pb, true) } + +// CompactTextString is the same as CompactText, but returns the string directly. +func CompactTextString(pb Message) string { + var buf bytes.Buffer + marshalText(&buf, pb, true) + return buf.String() +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/text_parser.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/text_parser.go new file mode 100644 index 000000000..7d0c75719 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/text_parser.go @@ -0,0 +1,772 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2010 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +package proto + +// Functions for parsing the Text protocol buffer format. +// TODO: message sets. + +import ( + "encoding" + "errors" + "fmt" + "reflect" + "strconv" + "strings" + "unicode/utf8" +) + +type ParseError struct { + Message string + Line int // 1-based line number + Offset int // 0-based byte offset from start of input +} + +func (p *ParseError) Error() string { + if p.Line == 1 { + // show offset only for first line + return fmt.Sprintf("line 1.%d: %v", p.Offset, p.Message) + } + return fmt.Sprintf("line %d: %v", p.Line, p.Message) +} + +type token struct { + value string + err *ParseError + line int // line number + offset int // byte number from start of input, not start of line + unquoted string // the unquoted version of value, if it was a quoted string +} + +func (t *token) String() string { + if t.err == nil { + return fmt.Sprintf("%q (line=%d, offset=%d)", t.value, t.line, t.offset) + } + return fmt.Sprintf("parse error: %v", t.err) +} + +type textParser struct { + s string // remaining input + done bool // whether the parsing is finished (success or error) + backed bool // whether back() was called + offset, line int + cur token +} + +func newTextParser(s string) *textParser { + p := new(textParser) + p.s = s + p.line = 1 + p.cur.line = 1 + return p +} + +func (p *textParser) errorf(format string, a ...interface{}) *ParseError { + pe := &ParseError{fmt.Sprintf(format, a...), p.cur.line, p.cur.offset} + p.cur.err = pe + p.done = true + return pe +} + +// Numbers and identifiers are matched by [-+._A-Za-z0-9] +func isIdentOrNumberChar(c byte) bool { + switch { + case 'A' <= c && c <= 'Z', 'a' <= c && c <= 'z': + return true + case '0' <= c && c <= '9': + return true + } + switch c { + case '-', '+', '.', '_': + return true + } + return false +} + +func isWhitespace(c byte) bool { + switch c { + case ' ', '\t', '\n', '\r': + return true + } + return false +} + +func (p *textParser) skipWhitespace() { + i := 0 + for i < len(p.s) && (isWhitespace(p.s[i]) || p.s[i] == '#') { + if p.s[i] == '#' { + // comment; skip to end of line or input + for i < len(p.s) && p.s[i] != '\n' { + i++ + } + if i == len(p.s) { + break + } + } + if p.s[i] == '\n' { + p.line++ + } + i++ + } + p.offset += i + p.s = p.s[i:len(p.s)] + if len(p.s) == 0 { + p.done = true + } +} + +func (p *textParser) advance() { + // Skip whitespace + p.skipWhitespace() + if p.done { + return + } + + // Start of non-whitespace + p.cur.err = nil + p.cur.offset, p.cur.line = p.offset, p.line + p.cur.unquoted = "" + switch p.s[0] { + case '<', '>', '{', '}', ':', '[', ']', ';', ',': + // Single symbol + p.cur.value, p.s = p.s[0:1], p.s[1:len(p.s)] + case '"', '\'': + // Quoted string + i := 1 + for i < len(p.s) && p.s[i] != p.s[0] && p.s[i] != '\n' { + if p.s[i] == '\\' && i+1 < len(p.s) { + // skip escaped char + i++ + } + i++ + } + if i >= len(p.s) || p.s[i] != p.s[0] { + p.errorf("unmatched quote") + return + } + unq, err := unquoteC(p.s[1:i], rune(p.s[0])) + if err != nil { + p.errorf("invalid quoted string %s: %v", p.s[0:i+1], err) + return + } + p.cur.value, p.s = p.s[0:i+1], p.s[i+1:len(p.s)] + p.cur.unquoted = unq + default: + i := 0 + for i < len(p.s) && isIdentOrNumberChar(p.s[i]) { + i++ + } + if i == 0 { + p.errorf("unexpected byte %#x", p.s[0]) + return + } + p.cur.value, p.s = p.s[0:i], p.s[i:len(p.s)] + } + p.offset += len(p.cur.value) +} + +var ( + errBadUTF8 = errors.New("proto: bad UTF-8") + errBadHex = errors.New("proto: bad hexadecimal") +) + +func unquoteC(s string, quote rune) (string, error) { + // This is based on C++'s tokenizer.cc. + // Despite its name, this is *not* parsing C syntax. + // For instance, "\0" is an invalid quoted string. + + // Avoid allocation in trivial cases. + simple := true + for _, r := range s { + if r == '\\' || r == quote { + simple = false + break + } + } + if simple { + return s, nil + } + + buf := make([]byte, 0, 3*len(s)/2) + for len(s) > 0 { + r, n := utf8.DecodeRuneInString(s) + if r == utf8.RuneError && n == 1 { + return "", errBadUTF8 + } + s = s[n:] + if r != '\\' { + if r < utf8.RuneSelf { + buf = append(buf, byte(r)) + } else { + buf = append(buf, string(r)...) + } + continue + } + + ch, tail, err := unescape(s) + if err != nil { + return "", err + } + buf = append(buf, ch...) + s = tail + } + return string(buf), nil +} + +func unescape(s string) (ch string, tail string, err error) { + r, n := utf8.DecodeRuneInString(s) + if r == utf8.RuneError && n == 1 { + return "", "", errBadUTF8 + } + s = s[n:] + switch r { + case 'a': + return "\a", s, nil + case 'b': + return "\b", s, nil + case 'f': + return "\f", s, nil + case 'n': + return "\n", s, nil + case 'r': + return "\r", s, nil + case 't': + return "\t", s, nil + case 'v': + return "\v", s, nil + case '?': + return "?", s, nil // trigraph workaround + case '\'', '"', '\\': + return string(r), s, nil + case '0', '1', '2', '3', '4', '5', '6', '7', 'x', 'X': + if len(s) < 2 { + return "", "", fmt.Errorf(`\%c requires 2 following digits`, r) + } + base := 8 + ss := s[:2] + s = s[2:] + if r == 'x' || r == 'X' { + base = 16 + } else { + ss = string(r) + ss + } + i, err := strconv.ParseUint(ss, base, 8) + if err != nil { + return "", "", err + } + return string([]byte{byte(i)}), s, nil + case 'u', 'U': + n := 4 + if r == 'U' { + n = 8 + } + if len(s) < n { + return "", "", fmt.Errorf(`\%c requires %d digits`, r, n) + } + + bs := make([]byte, n/2) + for i := 0; i < n; i += 2 { + a, ok1 := unhex(s[i]) + b, ok2 := unhex(s[i+1]) + if !ok1 || !ok2 { + return "", "", errBadHex + } + bs[i/2] = a<<4 | b + } + s = s[n:] + return string(bs), s, nil + } + return "", "", fmt.Errorf(`unknown escape \%c`, r) +} + +// Adapted from src/pkg/strconv/quote.go. +func unhex(b byte) (v byte, ok bool) { + switch { + case '0' <= b && b <= '9': + return b - '0', true + case 'a' <= b && b <= 'f': + return b - 'a' + 10, true + case 'A' <= b && b <= 'F': + return b - 'A' + 10, true + } + return 0, false +} + +// Back off the parser by one token. Can only be done between calls to next(). +// It makes the next advance() a no-op. +func (p *textParser) back() { p.backed = true } + +// Advances the parser and returns the new current token. +func (p *textParser) next() *token { + if p.backed || p.done { + p.backed = false + return &p.cur + } + p.advance() + if p.done { + p.cur.value = "" + } else if len(p.cur.value) > 0 && p.cur.value[0] == '"' { + // Look for multiple quoted strings separated by whitespace, + // and concatenate them. + cat := p.cur + for { + p.skipWhitespace() + if p.done || p.s[0] != '"' { + break + } + p.advance() + if p.cur.err != nil { + return &p.cur + } + cat.value += " " + p.cur.value + cat.unquoted += p.cur.unquoted + } + p.done = false // parser may have seen EOF, but we want to return cat + p.cur = cat + } + return &p.cur +} + +func (p *textParser) consumeToken(s string) error { + tok := p.next() + if tok.err != nil { + return tok.err + } + if tok.value != s { + p.back() + return p.errorf("expected %q, found %q", s, tok.value) + } + return nil +} + +// Return a RequiredNotSetError indicating which required field was not set. +func (p *textParser) missingRequiredFieldError(sv reflect.Value) *RequiredNotSetError { + st := sv.Type() + sprops := GetProperties(st) + for i := 0; i < st.NumField(); i++ { + if !isNil(sv.Field(i)) { + continue + } + + props := sprops.Prop[i] + if props.Required { + return &RequiredNotSetError{fmt.Sprintf("%v.%v", st, props.OrigName)} + } + } + return &RequiredNotSetError{fmt.Sprintf("%v.", st)} // should not happen +} + +// Returns the index in the struct for the named field, as well as the parsed tag properties. +func structFieldByName(st reflect.Type, name string) (int, *Properties, bool) { + sprops := GetProperties(st) + i, ok := sprops.decoderOrigNames[name] + if ok { + return i, sprops.Prop[i], true + } + return -1, nil, false +} + +// Consume a ':' from the input stream (if the next token is a colon), +// returning an error if a colon is needed but not present. +func (p *textParser) checkForColon(props *Properties, typ reflect.Type) *ParseError { + tok := p.next() + if tok.err != nil { + return tok.err + } + if tok.value != ":" { + // Colon is optional when the field is a group or message. + needColon := true + switch props.Wire { + case "group": + needColon = false + case "bytes": + // A "bytes" field is either a message, a string, or a repeated field; + // those three become *T, *string and []T respectively, so we can check for + // this field being a pointer to a non-string. + if typ.Kind() == reflect.Ptr { + // *T or *string + if typ.Elem().Kind() == reflect.String { + break + } + } else if typ.Kind() == reflect.Slice { + // []T or []*T + if typ.Elem().Kind() != reflect.Ptr { + break + } + } else if typ.Kind() == reflect.String { + // The proto3 exception is for a string field, + // which requires a colon. + break + } + needColon = false + } + if needColon { + return p.errorf("expected ':', found %q", tok.value) + } + p.back() + } + return nil +} + +func (p *textParser) readStruct(sv reflect.Value, terminator string) error { + st := sv.Type() + reqCount := GetProperties(st).reqCount + var reqFieldErr error + fieldSet := make(map[string]bool) + // A struct is a sequence of "name: value", terminated by one of + // '>' or '}', or the end of the input. A name may also be + // "[extension]". + for { + tok := p.next() + if tok.err != nil { + return tok.err + } + if tok.value == terminator { + break + } + if tok.value == "[" { + // Looks like an extension. + // + // TODO: Check whether we need to handle + // namespace rooted names (e.g. ".something.Foo"). + tok = p.next() + if tok.err != nil { + return tok.err + } + var desc *ExtensionDesc + // This could be faster, but it's functional. + // TODO: Do something smarter than a linear scan. + for _, d := range RegisteredExtensions(reflect.New(st).Interface().(Message)) { + if d.Name == tok.value { + desc = d + break + } + } + if desc == nil { + return p.errorf("unrecognized extension %q", tok.value) + } + // Check the extension terminator. + tok = p.next() + if tok.err != nil { + return tok.err + } + if tok.value != "]" { + return p.errorf("unrecognized extension terminator %q", tok.value) + } + + props := &Properties{} + props.Parse(desc.Tag) + + typ := reflect.TypeOf(desc.ExtensionType) + if err := p.checkForColon(props, typ); err != nil { + return err + } + + rep := desc.repeated() + + // Read the extension structure, and set it in + // the value we're constructing. + var ext reflect.Value + if !rep { + ext = reflect.New(typ).Elem() + } else { + ext = reflect.New(typ.Elem()).Elem() + } + if err := p.readAny(ext, props); err != nil { + if _, ok := err.(*RequiredNotSetError); !ok { + return err + } + reqFieldErr = err + } + ep := sv.Addr().Interface().(extendableProto) + if !rep { + SetExtension(ep, desc, ext.Interface()) + } else { + old, err := GetExtension(ep, desc) + var sl reflect.Value + if err == nil { + sl = reflect.ValueOf(old) // existing slice + } else { + sl = reflect.MakeSlice(typ, 0, 1) + } + sl = reflect.Append(sl, ext) + SetExtension(ep, desc, sl.Interface()) + } + } else { + // This is a normal, non-extension field. + name := tok.value + fi, props, ok := structFieldByName(st, name) + if !ok { + return p.errorf("unknown field name %q in %v", name, st) + } + + dst := sv.Field(fi) + + if dst.Kind() == reflect.Map { + // Consume any colon. + if err := p.checkForColon(props, dst.Type()); err != nil { + return err + } + + // Construct the map if it doesn't already exist. + if dst.IsNil() { + dst.Set(reflect.MakeMap(dst.Type())) + } + key := reflect.New(dst.Type().Key()).Elem() + val := reflect.New(dst.Type().Elem()).Elem() + + // The map entry should be this sequence of tokens: + // < key : KEY value : VALUE > + // Technically the "key" and "value" could come in any order, + // but in practice they won't. + + tok := p.next() + var terminator string + switch tok.value { + case "<": + terminator = ">" + case "{": + terminator = "}" + default: + return p.errorf("expected '{' or '<', found %q", tok.value) + } + if err := p.consumeToken("key"); err != nil { + return err + } + if err := p.consumeToken(":"); err != nil { + return err + } + if err := p.readAny(key, props.mkeyprop); err != nil { + return err + } + if err := p.consumeOptionalSeparator(); err != nil { + return err + } + if err := p.consumeToken("value"); err != nil { + return err + } + if err := p.checkForColon(props.mvalprop, dst.Type().Elem()); err != nil { + return err + } + if err := p.readAny(val, props.mvalprop); err != nil { + return err + } + if err := p.consumeOptionalSeparator(); err != nil { + return err + } + if err := p.consumeToken(terminator); err != nil { + return err + } + + dst.SetMapIndex(key, val) + continue + } + + // Check that it's not already set if it's not a repeated field. + if !props.Repeated && fieldSet[name] { + return p.errorf("non-repeated field %q was repeated", name) + } + + if err := p.checkForColon(props, st.Field(fi).Type); err != nil { + return err + } + + // Parse into the field. + fieldSet[name] = true + if err := p.readAny(dst, props); err != nil { + if _, ok := err.(*RequiredNotSetError); !ok { + return err + } + reqFieldErr = err + } else if props.Required { + reqCount-- + } + } + + if err := p.consumeOptionalSeparator(); err != nil { + return err + } + + } + + if reqCount > 0 { + return p.missingRequiredFieldError(sv) + } + return reqFieldErr +} + +// consumeOptionalSeparator consumes an optional semicolon or comma. +// It is used in readStruct to provide backward compatibility. +func (p *textParser) consumeOptionalSeparator() error { + tok := p.next() + if tok.err != nil { + return tok.err + } + if tok.value != ";" && tok.value != "," { + p.back() + } + return nil +} + +func (p *textParser) readAny(v reflect.Value, props *Properties) error { + tok := p.next() + if tok.err != nil { + return tok.err + } + if tok.value == "" { + return p.errorf("unexpected EOF") + } + + switch fv := v; fv.Kind() { + case reflect.Slice: + at := v.Type() + if at.Elem().Kind() == reflect.Uint8 { + // Special case for []byte + if tok.value[0] != '"' && tok.value[0] != '\'' { + // Deliberately written out here, as the error after + // this switch statement would write "invalid []byte: ...", + // which is not as user-friendly. + return p.errorf("invalid string: %v", tok.value) + } + bytes := []byte(tok.unquoted) + fv.Set(reflect.ValueOf(bytes)) + return nil + } + // Repeated field. May already exist. + flen := fv.Len() + if flen == fv.Cap() { + nav := reflect.MakeSlice(at, flen, 2*flen+1) + reflect.Copy(nav, fv) + fv.Set(nav) + } + fv.SetLen(flen + 1) + + // Read one. + p.back() + return p.readAny(fv.Index(flen), props) + case reflect.Bool: + // Either "true", "false", 1 or 0. + switch tok.value { + case "true", "1": + fv.SetBool(true) + return nil + case "false", "0": + fv.SetBool(false) + return nil + } + case reflect.Float32, reflect.Float64: + v := tok.value + // Ignore 'f' for compatibility with output generated by C++, but don't + // remove 'f' when the value is "-inf" or "inf". + if strings.HasSuffix(v, "f") && tok.value != "-inf" && tok.value != "inf" { + v = v[:len(v)-1] + } + if f, err := strconv.ParseFloat(v, fv.Type().Bits()); err == nil { + fv.SetFloat(f) + return nil + } + case reflect.Int32: + if x, err := strconv.ParseInt(tok.value, 0, 32); err == nil { + fv.SetInt(x) + return nil + } + + if len(props.Enum) == 0 { + break + } + m, ok := enumValueMaps[props.Enum] + if !ok { + break + } + x, ok := m[tok.value] + if !ok { + break + } + fv.SetInt(int64(x)) + return nil + case reflect.Int64: + if x, err := strconv.ParseInt(tok.value, 0, 64); err == nil { + fv.SetInt(x) + return nil + } + + case reflect.Ptr: + // A basic field (indirected through pointer), or a repeated message/group + p.back() + fv.Set(reflect.New(fv.Type().Elem())) + return p.readAny(fv.Elem(), props) + case reflect.String: + if tok.value[0] == '"' || tok.value[0] == '\'' { + fv.SetString(tok.unquoted) + return nil + } + case reflect.Struct: + var terminator string + switch tok.value { + case "{": + terminator = "}" + case "<": + terminator = ">" + default: + return p.errorf("expected '{' or '<', found %q", tok.value) + } + // TODO: Handle nested messages which implement encoding.TextUnmarshaler. + return p.readStruct(fv, terminator) + case reflect.Uint32: + if x, err := strconv.ParseUint(tok.value, 0, 32); err == nil { + fv.SetUint(uint64(x)) + return nil + } + case reflect.Uint64: + if x, err := strconv.ParseUint(tok.value, 0, 64); err == nil { + fv.SetUint(x) + return nil + } + } + return p.errorf("invalid %v: %v", v.Type(), tok.value) +} + +// UnmarshalText reads a protocol buffer in Text format. UnmarshalText resets pb +// before starting to unmarshal, so any existing data in pb is always removed. +// If a required field is not set and no other error occurs, +// UnmarshalText returns *RequiredNotSetError. +func UnmarshalText(s string, pb Message) error { + if um, ok := pb.(encoding.TextUnmarshaler); ok { + err := um.UnmarshalText([]byte(s)) + return err + } + pb.Reset() + v := reflect.ValueOf(pb) + if pe := newTextParser(s).readStruct(v.Elem(), ""); pe != nil { + return pe + } + return nil +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/text_parser_test.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/text_parser_test.go new file mode 100644 index 000000000..0754b2626 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/text_parser_test.go @@ -0,0 +1,511 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2010 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +package proto_test + +import ( + "math" + "reflect" + "testing" + + . "github.com/golang/protobuf/proto" + proto3pb "github.com/golang/protobuf/proto/proto3_proto" + . "github.com/golang/protobuf/proto/testdata" +) + +type UnmarshalTextTest struct { + in string + err string // if "", no error expected + out *MyMessage +} + +func buildExtStructTest(text string) UnmarshalTextTest { + msg := &MyMessage{ + Count: Int32(42), + } + SetExtension(msg, E_Ext_More, &Ext{ + Data: String("Hello, world!"), + }) + return UnmarshalTextTest{in: text, out: msg} +} + +func buildExtDataTest(text string) UnmarshalTextTest { + msg := &MyMessage{ + Count: Int32(42), + } + SetExtension(msg, E_Ext_Text, String("Hello, world!")) + SetExtension(msg, E_Ext_Number, Int32(1729)) + return UnmarshalTextTest{in: text, out: msg} +} + +func buildExtRepStringTest(text string) UnmarshalTextTest { + msg := &MyMessage{ + Count: Int32(42), + } + if err := SetExtension(msg, E_Greeting, []string{"bula", "hola"}); err != nil { + panic(err) + } + return UnmarshalTextTest{in: text, out: msg} +} + +var unMarshalTextTests = []UnmarshalTextTest{ + // Basic + { + in: " count:42\n name:\"Dave\" ", + out: &MyMessage{ + Count: Int32(42), + Name: String("Dave"), + }, + }, + + // Empty quoted string + { + in: `count:42 name:""`, + out: &MyMessage{ + Count: Int32(42), + Name: String(""), + }, + }, + + // Quoted string concatenation + { + in: `count:42 name: "My name is "` + "\n" + `"elsewhere"`, + out: &MyMessage{ + Count: Int32(42), + Name: String("My name is elsewhere"), + }, + }, + + // Quoted string with escaped apostrophe + { + in: `count:42 name: "HOLIDAY - New Year\'s Day"`, + out: &MyMessage{ + Count: Int32(42), + Name: String("HOLIDAY - New Year's Day"), + }, + }, + + // Quoted string with single quote + { + in: `count:42 name: 'Roger "The Ramster" Ramjet'`, + out: &MyMessage{ + Count: Int32(42), + Name: String(`Roger "The Ramster" Ramjet`), + }, + }, + + // Quoted string with all the accepted special characters from the C++ test + { + in: `count:42 name: ` + "\"\\\"A string with \\' characters \\n and \\r newlines and \\t tabs and \\001 slashes \\\\ and multiple spaces\"", + out: &MyMessage{ + Count: Int32(42), + Name: String("\"A string with ' characters \n and \r newlines and \t tabs and \001 slashes \\ and multiple spaces"), + }, + }, + + // Quoted string with quoted backslash + { + in: `count:42 name: "\\'xyz"`, + out: &MyMessage{ + Count: Int32(42), + Name: String(`\'xyz`), + }, + }, + + // Quoted string with UTF-8 bytes. + { + in: "count:42 name: '\303\277\302\201\xAB'", + out: &MyMessage{ + Count: Int32(42), + Name: String("\303\277\302\201\xAB"), + }, + }, + + // Bad quoted string + { + in: `inner: < host: "\0" >` + "\n", + err: `line 1.15: invalid quoted string "\0": \0 requires 2 following digits`, + }, + + // Number too large for int64 + { + in: "count: 1 others { key: 123456789012345678901 }", + err: "line 1.23: invalid int64: 123456789012345678901", + }, + + // Number too large for int32 + { + in: "count: 1234567890123", + err: "line 1.7: invalid int32: 1234567890123", + }, + + // Number in hexadecimal + { + in: "count: 0x2beef", + out: &MyMessage{ + Count: Int32(0x2beef), + }, + }, + + // Number in octal + { + in: "count: 024601", + out: &MyMessage{ + Count: Int32(024601), + }, + }, + + // Floating point number with "f" suffix + { + in: "count: 4 others:< weight: 17.0f >", + out: &MyMessage{ + Count: Int32(4), + Others: []*OtherMessage{ + { + Weight: Float32(17), + }, + }, + }, + }, + + // Floating point positive infinity + { + in: "count: 4 bigfloat: inf", + out: &MyMessage{ + Count: Int32(4), + Bigfloat: Float64(math.Inf(1)), + }, + }, + + // Floating point negative infinity + { + in: "count: 4 bigfloat: -inf", + out: &MyMessage{ + Count: Int32(4), + Bigfloat: Float64(math.Inf(-1)), + }, + }, + + // Number too large for float32 + { + in: "others:< weight: 12345678901234567890123456789012345678901234567890 >", + err: "line 1.17: invalid float32: 12345678901234567890123456789012345678901234567890", + }, + + // Number posing as a quoted string + { + in: `inner: < host: 12 >` + "\n", + err: `line 1.15: invalid string: 12`, + }, + + // Quoted string posing as int32 + { + in: `count: "12"`, + err: `line 1.7: invalid int32: "12"`, + }, + + // Quoted string posing a float32 + { + in: `others:< weight: "17.4" >`, + err: `line 1.17: invalid float32: "17.4"`, + }, + + // Enum + { + in: `count:42 bikeshed: BLUE`, + out: &MyMessage{ + Count: Int32(42), + Bikeshed: MyMessage_BLUE.Enum(), + }, + }, + + // Repeated field + { + in: `count:42 pet: "horsey" pet:"bunny"`, + out: &MyMessage{ + Count: Int32(42), + Pet: []string{"horsey", "bunny"}, + }, + }, + + // Repeated message with/without colon and <>/{} + { + in: `count:42 others:{} others{} others:<> others:{}`, + out: &MyMessage{ + Count: Int32(42), + Others: []*OtherMessage{ + {}, + {}, + {}, + {}, + }, + }, + }, + + // Missing colon for inner message + { + in: `count:42 inner < host: "cauchy.syd" >`, + out: &MyMessage{ + Count: Int32(42), + Inner: &InnerMessage{ + Host: String("cauchy.syd"), + }, + }, + }, + + // Missing colon for string field + { + in: `name "Dave"`, + err: `line 1.5: expected ':', found "\"Dave\""`, + }, + + // Missing colon for int32 field + { + in: `count 42`, + err: `line 1.6: expected ':', found "42"`, + }, + + // Missing required field + { + in: `name: "Pawel"`, + err: `proto: required field "testdata.MyMessage.count" not set`, + out: &MyMessage{ + Name: String("Pawel"), + }, + }, + + // Repeated non-repeated field + { + in: `name: "Rob" name: "Russ"`, + err: `line 1.12: non-repeated field "name" was repeated`, + }, + + // Group + { + in: `count: 17 SomeGroup { group_field: 12 }`, + out: &MyMessage{ + Count: Int32(17), + Somegroup: &MyMessage_SomeGroup{ + GroupField: Int32(12), + }, + }, + }, + + // Semicolon between fields + { + in: `count:3;name:"Calvin"`, + out: &MyMessage{ + Count: Int32(3), + Name: String("Calvin"), + }, + }, + // Comma between fields + { + in: `count:4,name:"Ezekiel"`, + out: &MyMessage{ + Count: Int32(4), + Name: String("Ezekiel"), + }, + }, + + // Extension + buildExtStructTest(`count: 42 [testdata.Ext.more]:`), + buildExtStructTest(`count: 42 [testdata.Ext.more] {data:"Hello, world!"}`), + buildExtDataTest(`count: 42 [testdata.Ext.text]:"Hello, world!" [testdata.Ext.number]:1729`), + buildExtRepStringTest(`count: 42 [testdata.greeting]:"bula" [testdata.greeting]:"hola"`), + + // Big all-in-one + { + in: "count:42 # Meaning\n" + + `name:"Dave" ` + + `quote:"\"I didn't want to go.\"" ` + + `pet:"bunny" ` + + `pet:"kitty" ` + + `pet:"horsey" ` + + `inner:<` + + ` host:"footrest.syd" ` + + ` port:7001 ` + + ` connected:true ` + + `> ` + + `others:<` + + ` key:3735928559 ` + + ` value:"\x01A\a\f" ` + + `> ` + + `others:<` + + " weight:58.9 # Atomic weight of Co\n" + + ` inner:<` + + ` host:"lesha.mtv" ` + + ` port:8002 ` + + ` >` + + `>`, + out: &MyMessage{ + Count: Int32(42), + Name: String("Dave"), + Quote: String(`"I didn't want to go."`), + Pet: []string{"bunny", "kitty", "horsey"}, + Inner: &InnerMessage{ + Host: String("footrest.syd"), + Port: Int32(7001), + Connected: Bool(true), + }, + Others: []*OtherMessage{ + { + Key: Int64(3735928559), + Value: []byte{0x1, 'A', '\a', '\f'}, + }, + { + Weight: Float32(58.9), + Inner: &InnerMessage{ + Host: String("lesha.mtv"), + Port: Int32(8002), + }, + }, + }, + }, + }, +} + +func TestUnmarshalText(t *testing.T) { + for i, test := range unMarshalTextTests { + pb := new(MyMessage) + err := UnmarshalText(test.in, pb) + if test.err == "" { + // We don't expect failure. + if err != nil { + t.Errorf("Test %d: Unexpected error: %v", i, err) + } else if !reflect.DeepEqual(pb, test.out) { + t.Errorf("Test %d: Incorrect populated \nHave: %v\nWant: %v", + i, pb, test.out) + } + } else { + // We do expect failure. + if err == nil { + t.Errorf("Test %d: Didn't get expected error: %v", i, test.err) + } else if err.Error() != test.err { + t.Errorf("Test %d: Incorrect error.\nHave: %v\nWant: %v", + i, err.Error(), test.err) + } else if _, ok := err.(*RequiredNotSetError); ok && test.out != nil && !reflect.DeepEqual(pb, test.out) { + t.Errorf("Test %d: Incorrect populated \nHave: %v\nWant: %v", + i, pb, test.out) + } + } + } +} + +func TestUnmarshalTextCustomMessage(t *testing.T) { + msg := &textMessage{} + if err := UnmarshalText("custom", msg); err != nil { + t.Errorf("Unexpected error from custom unmarshal: %v", err) + } + if UnmarshalText("not custom", msg) == nil { + t.Errorf("Didn't get expected error from custom unmarshal") + } +} + +// Regression test; this caused a panic. +func TestRepeatedEnum(t *testing.T) { + pb := new(RepeatedEnum) + if err := UnmarshalText("color: RED", pb); err != nil { + t.Fatal(err) + } + exp := &RepeatedEnum{ + Color: []RepeatedEnum_Color{RepeatedEnum_RED}, + } + if !Equal(pb, exp) { + t.Errorf("Incorrect populated \nHave: %v\nWant: %v", pb, exp) + } +} + +func TestProto3TextParsing(t *testing.T) { + m := new(proto3pb.Message) + const in = `name: "Wallace" true_scotsman: true` + want := &proto3pb.Message{ + Name: "Wallace", + TrueScotsman: true, + } + if err := UnmarshalText(in, m); err != nil { + t.Fatal(err) + } + if !Equal(m, want) { + t.Errorf("\n got %v\nwant %v", m, want) + } +} + +func TestMapParsing(t *testing.T) { + m := new(MessageWithMap) + const in = `name_mapping: name_mapping:` + + `msg_mapping:,>` + // separating commas are okay + `msg_mapping>` + // no colon after "value" + `byte_mapping:` + want := &MessageWithMap{ + NameMapping: map[int32]string{ + 1: "Beatles", + 1234: "Feist", + }, + MsgMapping: map[int64]*FloatingPoint{ + -4: {F: Float64(2.0)}, + -2: {F: Float64(4.0)}, + }, + ByteMapping: map[bool][]byte{ + true: []byte("so be it"), + }, + } + if err := UnmarshalText(in, m); err != nil { + t.Fatal(err) + } + if !Equal(m, want) { + t.Errorf("\n got %v\nwant %v", m, want) + } +} + +var benchInput string + +func init() { + benchInput = "count: 4\n" + for i := 0; i < 1000; i++ { + benchInput += "pet: \"fido\"\n" + } + + // Check it is valid input. + pb := new(MyMessage) + err := UnmarshalText(benchInput, pb) + if err != nil { + panic("Bad benchmark input: " + err.Error()) + } +} + +func BenchmarkUnmarshalText(b *testing.B) { + pb := new(MyMessage) + for i := 0; i < b.N; i++ { + UnmarshalText(benchInput, pb) + } + b.SetBytes(int64(len(benchInput))) +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/proto/text_test.go b/Godeps/_workspace/src/github.com/golang/protobuf/proto/text_test.go new file mode 100644 index 000000000..39861d1ca --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/proto/text_test.go @@ -0,0 +1,441 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2010 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +package proto_test + +import ( + "bytes" + "errors" + "io/ioutil" + "math" + "strings" + "testing" + + "github.com/golang/protobuf/proto" + + proto3pb "github.com/golang/protobuf/proto/proto3_proto" + pb "github.com/golang/protobuf/proto/testdata" +) + +// textMessage implements the methods that allow it to marshal and unmarshal +// itself as text. +type textMessage struct { +} + +func (*textMessage) MarshalText() ([]byte, error) { + return []byte("custom"), nil +} + +func (*textMessage) UnmarshalText(bytes []byte) error { + if string(bytes) != "custom" { + return errors.New("expected 'custom'") + } + return nil +} + +func (*textMessage) Reset() {} +func (*textMessage) String() string { return "" } +func (*textMessage) ProtoMessage() {} + +func newTestMessage() *pb.MyMessage { + msg := &pb.MyMessage{ + Count: proto.Int32(42), + Name: proto.String("Dave"), + Quote: proto.String(`"I didn't want to go."`), + Pet: []string{"bunny", "kitty", "horsey"}, + Inner: &pb.InnerMessage{ + Host: proto.String("footrest.syd"), + Port: proto.Int32(7001), + Connected: proto.Bool(true), + }, + Others: []*pb.OtherMessage{ + { + Key: proto.Int64(0xdeadbeef), + Value: []byte{1, 65, 7, 12}, + }, + { + Weight: proto.Float32(6.022), + Inner: &pb.InnerMessage{ + Host: proto.String("lesha.mtv"), + Port: proto.Int32(8002), + }, + }, + }, + Bikeshed: pb.MyMessage_BLUE.Enum(), + Somegroup: &pb.MyMessage_SomeGroup{ + GroupField: proto.Int32(8), + }, + // One normally wouldn't do this. + // This is an undeclared tag 13, as a varint (wire type 0) with value 4. + XXX_unrecognized: []byte{13<<3 | 0, 4}, + } + ext := &pb.Ext{ + Data: proto.String("Big gobs for big rats"), + } + if err := proto.SetExtension(msg, pb.E_Ext_More, ext); err != nil { + panic(err) + } + greetings := []string{"adg", "easy", "cow"} + if err := proto.SetExtension(msg, pb.E_Greeting, greetings); err != nil { + panic(err) + } + + // Add an unknown extension. We marshal a pb.Ext, and fake the ID. + b, err := proto.Marshal(&pb.Ext{Data: proto.String("3G skiing")}) + if err != nil { + panic(err) + } + b = append(proto.EncodeVarint(201<<3|proto.WireBytes), b...) + proto.SetRawExtension(msg, 201, b) + + // Extensions can be plain fields, too, so let's test that. + b = append(proto.EncodeVarint(202<<3|proto.WireVarint), 19) + proto.SetRawExtension(msg, 202, b) + + return msg +} + +const text = `count: 42 +name: "Dave" +quote: "\"I didn't want to go.\"" +pet: "bunny" +pet: "kitty" +pet: "horsey" +inner: < + host: "footrest.syd" + port: 7001 + connected: true +> +others: < + key: 3735928559 + value: "\001A\007\014" +> +others: < + weight: 6.022 + inner: < + host: "lesha.mtv" + port: 8002 + > +> +bikeshed: BLUE +SomeGroup { + group_field: 8 +} +/* 2 unknown bytes */ +13: 4 +[testdata.Ext.more]: < + data: "Big gobs for big rats" +> +[testdata.greeting]: "adg" +[testdata.greeting]: "easy" +[testdata.greeting]: "cow" +/* 13 unknown bytes */ +201: "\t3G skiing" +/* 3 unknown bytes */ +202: 19 +` + +func TestMarshalText(t *testing.T) { + buf := new(bytes.Buffer) + if err := proto.MarshalText(buf, newTestMessage()); err != nil { + t.Fatalf("proto.MarshalText: %v", err) + } + s := buf.String() + if s != text { + t.Errorf("Got:\n===\n%v===\nExpected:\n===\n%v===\n", s, text) + } +} + +func TestMarshalTextCustomMessage(t *testing.T) { + buf := new(bytes.Buffer) + if err := proto.MarshalText(buf, &textMessage{}); err != nil { + t.Fatalf("proto.MarshalText: %v", err) + } + s := buf.String() + if s != "custom" { + t.Errorf("Got %q, expected %q", s, "custom") + } +} +func TestMarshalTextNil(t *testing.T) { + want := "" + tests := []proto.Message{nil, (*pb.MyMessage)(nil)} + for i, test := range tests { + buf := new(bytes.Buffer) + if err := proto.MarshalText(buf, test); err != nil { + t.Fatal(err) + } + if got := buf.String(); got != want { + t.Errorf("%d: got %q want %q", i, got, want) + } + } +} + +func TestMarshalTextUnknownEnum(t *testing.T) { + // The Color enum only specifies values 0-2. + m := &pb.MyMessage{Bikeshed: pb.MyMessage_Color(3).Enum()} + got := m.String() + const want = `bikeshed:3 ` + if got != want { + t.Errorf("\n got %q\nwant %q", got, want) + } +} + +func BenchmarkMarshalTextBuffered(b *testing.B) { + buf := new(bytes.Buffer) + m := newTestMessage() + for i := 0; i < b.N; i++ { + buf.Reset() + proto.MarshalText(buf, m) + } +} + +func BenchmarkMarshalTextUnbuffered(b *testing.B) { + w := ioutil.Discard + m := newTestMessage() + for i := 0; i < b.N; i++ { + proto.MarshalText(w, m) + } +} + +func compact(src string) string { + // s/[ \n]+/ /g; s/ $//; + dst := make([]byte, len(src)) + space, comment := false, false + j := 0 + for i := 0; i < len(src); i++ { + if strings.HasPrefix(src[i:], "/*") { + comment = true + i++ + continue + } + if comment && strings.HasPrefix(src[i:], "*/") { + comment = false + i++ + continue + } + if comment { + continue + } + c := src[i] + if c == ' ' || c == '\n' { + space = true + continue + } + if j > 0 && (dst[j-1] == ':' || dst[j-1] == '<' || dst[j-1] == '{') { + space = false + } + if c == '{' { + space = false + } + if space { + dst[j] = ' ' + j++ + space = false + } + dst[j] = c + j++ + } + if space { + dst[j] = ' ' + j++ + } + return string(dst[0:j]) +} + +var compactText = compact(text) + +func TestCompactText(t *testing.T) { + s := proto.CompactTextString(newTestMessage()) + if s != compactText { + t.Errorf("Got:\n===\n%v===\nExpected:\n===\n%v\n===\n", s, compactText) + } +} + +func TestStringEscaping(t *testing.T) { + testCases := []struct { + in *pb.Strings + out string + }{ + { + // Test data from C++ test (TextFormatTest.StringEscape). + // Single divergence: we don't escape apostrophes. + &pb.Strings{StringField: proto.String("\"A string with ' characters \n and \r newlines and \t tabs and \001 slashes \\ and multiple spaces")}, + "string_field: \"\\\"A string with ' characters \\n and \\r newlines and \\t tabs and \\001 slashes \\\\ and multiple spaces\"\n", + }, + { + // Test data from the same C++ test. + &pb.Strings{StringField: proto.String("\350\260\267\346\255\214")}, + "string_field: \"\\350\\260\\267\\346\\255\\214\"\n", + }, + { + // Some UTF-8. + &pb.Strings{StringField: proto.String("\x00\x01\xff\x81")}, + `string_field: "\000\001\377\201"` + "\n", + }, + } + + for i, tc := range testCases { + var buf bytes.Buffer + if err := proto.MarshalText(&buf, tc.in); err != nil { + t.Errorf("proto.MarsalText: %v", err) + continue + } + s := buf.String() + if s != tc.out { + t.Errorf("#%d: Got:\n%s\nExpected:\n%s\n", i, s, tc.out) + continue + } + + // Check round-trip. + pb := new(pb.Strings) + if err := proto.UnmarshalText(s, pb); err != nil { + t.Errorf("#%d: UnmarshalText: %v", i, err) + continue + } + if !proto.Equal(pb, tc.in) { + t.Errorf("#%d: Round-trip failed:\nstart: %v\n end: %v", i, tc.in, pb) + } + } +} + +// A limitedWriter accepts some output before it fails. +// This is a proxy for something like a nearly-full or imminently-failing disk, +// or a network connection that is about to die. +type limitedWriter struct { + b bytes.Buffer + limit int +} + +var outOfSpace = errors.New("proto: insufficient space") + +func (w *limitedWriter) Write(p []byte) (n int, err error) { + var avail = w.limit - w.b.Len() + if avail <= 0 { + return 0, outOfSpace + } + if len(p) <= avail { + return w.b.Write(p) + } + n, _ = w.b.Write(p[:avail]) + return n, outOfSpace +} + +func TestMarshalTextFailing(t *testing.T) { + // Try lots of different sizes to exercise more error code-paths. + for lim := 0; lim < len(text); lim++ { + buf := new(limitedWriter) + buf.limit = lim + err := proto.MarshalText(buf, newTestMessage()) + // We expect a certain error, but also some partial results in the buffer. + if err != outOfSpace { + t.Errorf("Got:\n===\n%v===\nExpected:\n===\n%v===\n", err, outOfSpace) + } + s := buf.b.String() + x := text[:buf.limit] + if s != x { + t.Errorf("Got:\n===\n%v===\nExpected:\n===\n%v===\n", s, x) + } + } +} + +func TestFloats(t *testing.T) { + tests := []struct { + f float64 + want string + }{ + {0, "0"}, + {4.7, "4.7"}, + {math.Inf(1), "inf"}, + {math.Inf(-1), "-inf"}, + {math.NaN(), "nan"}, + } + for _, test := range tests { + msg := &pb.FloatingPoint{F: &test.f} + got := strings.TrimSpace(msg.String()) + want := `f:` + test.want + if got != want { + t.Errorf("f=%f: got %q, want %q", test.f, got, want) + } + } +} + +func TestRepeatedNilText(t *testing.T) { + m := &pb.MessageList{ + Message: []*pb.MessageList_Message{ + nil, + &pb.MessageList_Message{ + Name: proto.String("Horse"), + }, + nil, + }, + } + want := `Message +Message { + name: "Horse" +} +Message +` + if s := proto.MarshalTextString(m); s != want { + t.Errorf(" got: %s\nwant: %s", s, want) + } +} + +func TestProto3Text(t *testing.T) { + tests := []struct { + m proto.Message + want string + }{ + // zero message + {&proto3pb.Message{}, ``}, + // zero message except for an empty byte slice + {&proto3pb.Message{Data: []byte{}}, ``}, + // trivial case + {&proto3pb.Message{Name: "Rob", HeightInCm: 175}, `name:"Rob" height_in_cm:175`}, + // empty map + {&pb.MessageWithMap{}, ``}, + // non-empty map; current map format is the same as a repeated struct + { + &pb.MessageWithMap{NameMapping: map[int32]string{1234: "Feist"}}, + `name_mapping:`, + }, + // map with nil value; not well-defined, but we shouldn't crash + { + &pb.MessageWithMap{MsgMapping: map[int64]*pb.FloatingPoint{7: nil}}, + `msg_mapping:`, + }, + } + for _, test := range tests { + got := strings.TrimSpace(test.m.String()) + if got != test.want { + t.Errorf("\n got %s\nwant %s", got, test.want) + } + } +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/Makefile b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/Makefile new file mode 100644 index 000000000..a42cc3717 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/Makefile @@ -0,0 +1,33 @@ +# Go support for Protocol Buffers - Google's data interchange format +# +# Copyright 2010 The Go Authors. All rights reserved. +# https://github.com/golang/protobuf +# +# 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. + +test: + cd testdata && make test diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/descriptor/Makefile b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/descriptor/Makefile new file mode 100644 index 000000000..9faf80869 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/descriptor/Makefile @@ -0,0 +1,45 @@ +# Go support for Protocol Buffers - Google's data interchange format +# +# Copyright 2010 The Go Authors. All rights reserved. +# https://github.com/golang/protobuf +# +# 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. + +# Not stored here, but descriptor.proto is in https://github.com/google/protobuf/ +# at src/google/protobuf/descriptor.proto +regenerate: + echo WARNING! THIS RULE IS PROBABLY NOT RIGHT FOR YOUR INSTALLATION + cd $(HOME)/src/protobuf/src && \ + protoc --go_out=. ./google/protobuf/descriptor.proto && \ + sed -i 's,^package google_protobuf,package descriptor,' google/protobuf/descriptor.pb.go && \ + cp ./google/protobuf/descriptor.pb.go $(GOPATH)/src/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go + +restore: + cp descriptor.pb.golden descriptor.pb.go + +preserve: + cp descriptor.pb.go descriptor.pb.golden diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.golden b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.golden new file mode 100644 index 000000000..302c5686b --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.golden @@ -0,0 +1,1024 @@ +// Code generated by protoc-gen-go. +// source: google/protobuf/descriptor.proto +// DO NOT EDIT! + +package google_protobuf + +import proto "github.com/golang/protobuf/proto" +import "math" + +// Reference proto and math imports to suppress error if they are not otherwise used. +var _ = proto.GetString +var _ = math.Inf + +type FieldDescriptorProto_Type int32 + +const ( + FieldDescriptorProto_TYPE_DOUBLE FieldDescriptorProto_Type = 1 + FieldDescriptorProto_TYPE_FLOAT FieldDescriptorProto_Type = 2 + FieldDescriptorProto_TYPE_INT64 FieldDescriptorProto_Type = 3 + FieldDescriptorProto_TYPE_UINT64 FieldDescriptorProto_Type = 4 + FieldDescriptorProto_TYPE_INT32 FieldDescriptorProto_Type = 5 + FieldDescriptorProto_TYPE_FIXED64 FieldDescriptorProto_Type = 6 + FieldDescriptorProto_TYPE_FIXED32 FieldDescriptorProto_Type = 7 + FieldDescriptorProto_TYPE_BOOL FieldDescriptorProto_Type = 8 + FieldDescriptorProto_TYPE_STRING FieldDescriptorProto_Type = 9 + FieldDescriptorProto_TYPE_GROUP FieldDescriptorProto_Type = 10 + FieldDescriptorProto_TYPE_MESSAGE FieldDescriptorProto_Type = 11 + FieldDescriptorProto_TYPE_BYTES FieldDescriptorProto_Type = 12 + FieldDescriptorProto_TYPE_UINT32 FieldDescriptorProto_Type = 13 + FieldDescriptorProto_TYPE_ENUM FieldDescriptorProto_Type = 14 + FieldDescriptorProto_TYPE_SFIXED32 FieldDescriptorProto_Type = 15 + FieldDescriptorProto_TYPE_SFIXED64 FieldDescriptorProto_Type = 16 + FieldDescriptorProto_TYPE_SINT32 FieldDescriptorProto_Type = 17 + FieldDescriptorProto_TYPE_SINT64 FieldDescriptorProto_Type = 18 +) + +var FieldDescriptorProto_Type_name = map[int32]string{ + 1: "TYPE_DOUBLE", + 2: "TYPE_FLOAT", + 3: "TYPE_INT64", + 4: "TYPE_UINT64", + 5: "TYPE_INT32", + 6: "TYPE_FIXED64", + 7: "TYPE_FIXED32", + 8: "TYPE_BOOL", + 9: "TYPE_STRING", + 10: "TYPE_GROUP", + 11: "TYPE_MESSAGE", + 12: "TYPE_BYTES", + 13: "TYPE_UINT32", + 14: "TYPE_ENUM", + 15: "TYPE_SFIXED32", + 16: "TYPE_SFIXED64", + 17: "TYPE_SINT32", + 18: "TYPE_SINT64", +} +var FieldDescriptorProto_Type_value = map[string]int32{ + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18, +} + +// NewFieldDescriptorProto_Type is deprecated. Use x.Enum() instead. +func NewFieldDescriptorProto_Type(x FieldDescriptorProto_Type) *FieldDescriptorProto_Type { + e := FieldDescriptorProto_Type(x) + return &e +} +func (x FieldDescriptorProto_Type) Enum() *FieldDescriptorProto_Type { + p := new(FieldDescriptorProto_Type) + *p = x + return p +} +func (x FieldDescriptorProto_Type) String() string { + return proto.EnumName(FieldDescriptorProto_Type_name, int32(x)) +} + +type FieldDescriptorProto_Label int32 + +const ( + FieldDescriptorProto_LABEL_OPTIONAL FieldDescriptorProto_Label = 1 + FieldDescriptorProto_LABEL_REQUIRED FieldDescriptorProto_Label = 2 + FieldDescriptorProto_LABEL_REPEATED FieldDescriptorProto_Label = 3 +) + +var FieldDescriptorProto_Label_name = map[int32]string{ + 1: "LABEL_OPTIONAL", + 2: "LABEL_REQUIRED", + 3: "LABEL_REPEATED", +} +var FieldDescriptorProto_Label_value = map[string]int32{ + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3, +} + +// NewFieldDescriptorProto_Label is deprecated. Use x.Enum() instead. +func NewFieldDescriptorProto_Label(x FieldDescriptorProto_Label) *FieldDescriptorProto_Label { + e := FieldDescriptorProto_Label(x) + return &e +} +func (x FieldDescriptorProto_Label) Enum() *FieldDescriptorProto_Label { + p := new(FieldDescriptorProto_Label) + *p = x + return p +} +func (x FieldDescriptorProto_Label) String() string { + return proto.EnumName(FieldDescriptorProto_Label_name, int32(x)) +} + +type FileOptions_OptimizeMode int32 + +const ( + FileOptions_SPEED FileOptions_OptimizeMode = 1 + FileOptions_CODE_SIZE FileOptions_OptimizeMode = 2 + FileOptions_LITE_RUNTIME FileOptions_OptimizeMode = 3 +) + +var FileOptions_OptimizeMode_name = map[int32]string{ + 1: "SPEED", + 2: "CODE_SIZE", + 3: "LITE_RUNTIME", +} +var FileOptions_OptimizeMode_value = map[string]int32{ + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3, +} + +// NewFileOptions_OptimizeMode is deprecated. Use x.Enum() instead. +func NewFileOptions_OptimizeMode(x FileOptions_OptimizeMode) *FileOptions_OptimizeMode { + e := FileOptions_OptimizeMode(x) + return &e +} +func (x FileOptions_OptimizeMode) Enum() *FileOptions_OptimizeMode { + p := new(FileOptions_OptimizeMode) + *p = x + return p +} +func (x FileOptions_OptimizeMode) String() string { + return proto.EnumName(FileOptions_OptimizeMode_name, int32(x)) +} + +type FieldOptions_CType int32 + +const ( + FieldOptions_STRING FieldOptions_CType = 0 + FieldOptions_CORD FieldOptions_CType = 1 + FieldOptions_STRING_PIECE FieldOptions_CType = 2 +) + +var FieldOptions_CType_name = map[int32]string{ + 0: "STRING", + 1: "CORD", + 2: "STRING_PIECE", +} +var FieldOptions_CType_value = map[string]int32{ + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2, +} + +// NewFieldOptions_CType is deprecated. Use x.Enum() instead. +func NewFieldOptions_CType(x FieldOptions_CType) *FieldOptions_CType { + e := FieldOptions_CType(x) + return &e +} +func (x FieldOptions_CType) Enum() *FieldOptions_CType { + p := new(FieldOptions_CType) + *p = x + return p +} +func (x FieldOptions_CType) String() string { + return proto.EnumName(FieldOptions_CType_name, int32(x)) +} + +type StreamOptions_TokenUnit int32 + +const ( + StreamOptions_MESSAGE StreamOptions_TokenUnit = 0 + StreamOptions_BYTE StreamOptions_TokenUnit = 1 +) + +var StreamOptions_TokenUnit_name = map[int32]string{ + 0: "MESSAGE", + 1: "BYTE", +} +var StreamOptions_TokenUnit_value = map[string]int32{ + "MESSAGE": 0, + "BYTE": 1, +} + +// NewStreamOptions_TokenUnit is deprecated. Use x.Enum() instead. +func NewStreamOptions_TokenUnit(x StreamOptions_TokenUnit) *StreamOptions_TokenUnit { + e := StreamOptions_TokenUnit(x) + return &e +} +func (x StreamOptions_TokenUnit) Enum() *StreamOptions_TokenUnit { + p := new(StreamOptions_TokenUnit) + *p = x + return p +} +func (x StreamOptions_TokenUnit) String() string { + return proto.EnumName(StreamOptions_TokenUnit_name, int32(x)) +} + +type FileDescriptorSet struct { + File []*FileDescriptorProto `protobuf:"bytes,1,rep,name=file" json:"file,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (this *FileDescriptorSet) Reset() { *this = FileDescriptorSet{} } +func (this *FileDescriptorSet) String() string { return proto.CompactTextString(this) } +func (*FileDescriptorSet) ProtoMessage() {} + +type FileDescriptorProto struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + Package *string `protobuf:"bytes,2,opt,name=package" json:"package,omitempty"` + Dependency []string `protobuf:"bytes,3,rep,name=dependency" json:"dependency,omitempty"` + PublicDependency []int32 `protobuf:"varint,10,rep,name=public_dependency" json:"public_dependency,omitempty"` + WeakDependency []int32 `protobuf:"varint,11,rep,name=weak_dependency" json:"weak_dependency,omitempty"` + MessageType []*DescriptorProto `protobuf:"bytes,4,rep,name=message_type" json:"message_type,omitempty"` + EnumType []*EnumDescriptorProto `protobuf:"bytes,5,rep,name=enum_type" json:"enum_type,omitempty"` + Service []*ServiceDescriptorProto `protobuf:"bytes,6,rep,name=service" json:"service,omitempty"` + Extension []*FieldDescriptorProto `protobuf:"bytes,7,rep,name=extension" json:"extension,omitempty"` + Options *FileOptions `protobuf:"bytes,8,opt,name=options" json:"options,omitempty"` + SourceCodeInfo *SourceCodeInfo `protobuf:"bytes,9,opt,name=source_code_info" json:"source_code_info,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (this *FileDescriptorProto) Reset() { *this = FileDescriptorProto{} } +func (this *FileDescriptorProto) String() string { return proto.CompactTextString(this) } +func (*FileDescriptorProto) ProtoMessage() {} + +func (this *FileDescriptorProto) GetName() string { + if this != nil && this.Name != nil { + return *this.Name + } + return "" +} + +func (this *FileDescriptorProto) GetPackage() string { + if this != nil && this.Package != nil { + return *this.Package + } + return "" +} + +func (this *FileDescriptorProto) GetOptions() *FileOptions { + if this != nil { + return this.Options + } + return nil +} + +func (this *FileDescriptorProto) GetSourceCodeInfo() *SourceCodeInfo { + if this != nil { + return this.SourceCodeInfo + } + return nil +} + +type DescriptorProto struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + Field []*FieldDescriptorProto `protobuf:"bytes,2,rep,name=field" json:"field,omitempty"` + Extension []*FieldDescriptorProto `protobuf:"bytes,6,rep,name=extension" json:"extension,omitempty"` + NestedType []*DescriptorProto `protobuf:"bytes,3,rep,name=nested_type" json:"nested_type,omitempty"` + EnumType []*EnumDescriptorProto `protobuf:"bytes,4,rep,name=enum_type" json:"enum_type,omitempty"` + ExtensionRange []*DescriptorProto_ExtensionRange `protobuf:"bytes,5,rep,name=extension_range" json:"extension_range,omitempty"` + Options *MessageOptions `protobuf:"bytes,7,opt,name=options" json:"options,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (this *DescriptorProto) Reset() { *this = DescriptorProto{} } +func (this *DescriptorProto) String() string { return proto.CompactTextString(this) } +func (*DescriptorProto) ProtoMessage() {} + +func (this *DescriptorProto) GetName() string { + if this != nil && this.Name != nil { + return *this.Name + } + return "" +} + +func (this *DescriptorProto) GetOptions() *MessageOptions { + if this != nil { + return this.Options + } + return nil +} + +type DescriptorProto_ExtensionRange struct { + Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"` + End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (this *DescriptorProto_ExtensionRange) Reset() { *this = DescriptorProto_ExtensionRange{} } +func (this *DescriptorProto_ExtensionRange) String() string { return proto.CompactTextString(this) } +func (*DescriptorProto_ExtensionRange) ProtoMessage() {} + +func (this *DescriptorProto_ExtensionRange) GetStart() int32 { + if this != nil && this.Start != nil { + return *this.Start + } + return 0 +} + +func (this *DescriptorProto_ExtensionRange) GetEnd() int32 { + if this != nil && this.End != nil { + return *this.End + } + return 0 +} + +type FieldDescriptorProto struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + Number *int32 `protobuf:"varint,3,opt,name=number" json:"number,omitempty"` + Label *FieldDescriptorProto_Label `protobuf:"varint,4,opt,name=label,enum=proto2.FieldDescriptorProto_Label" json:"label,omitempty"` + Type *FieldDescriptorProto_Type `protobuf:"varint,5,opt,name=type,enum=proto2.FieldDescriptorProto_Type" json:"type,omitempty"` + TypeName *string `protobuf:"bytes,6,opt,name=type_name" json:"type_name,omitempty"` + Extendee *string `protobuf:"bytes,2,opt,name=extendee" json:"extendee,omitempty"` + DefaultValue *string `protobuf:"bytes,7,opt,name=default_value" json:"default_value,omitempty"` + Options *FieldOptions `protobuf:"bytes,8,opt,name=options" json:"options,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (this *FieldDescriptorProto) Reset() { *this = FieldDescriptorProto{} } +func (this *FieldDescriptorProto) String() string { return proto.CompactTextString(this) } +func (*FieldDescriptorProto) ProtoMessage() {} + +func (this *FieldDescriptorProto) GetName() string { + if this != nil && this.Name != nil { + return *this.Name + } + return "" +} + +func (this *FieldDescriptorProto) GetNumber() int32 { + if this != nil && this.Number != nil { + return *this.Number + } + return 0 +} + +func (this *FieldDescriptorProto) GetLabel() FieldDescriptorProto_Label { + if this != nil && this.Label != nil { + return *this.Label + } + return 0 +} + +func (this *FieldDescriptorProto) GetType() FieldDescriptorProto_Type { + if this != nil && this.Type != nil { + return *this.Type + } + return 0 +} + +func (this *FieldDescriptorProto) GetTypeName() string { + if this != nil && this.TypeName != nil { + return *this.TypeName + } + return "" +} + +func (this *FieldDescriptorProto) GetExtendee() string { + if this != nil && this.Extendee != nil { + return *this.Extendee + } + return "" +} + +func (this *FieldDescriptorProto) GetDefaultValue() string { + if this != nil && this.DefaultValue != nil { + return *this.DefaultValue + } + return "" +} + +func (this *FieldDescriptorProto) GetOptions() *FieldOptions { + if this != nil { + return this.Options + } + return nil +} + +type EnumDescriptorProto struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + Value []*EnumValueDescriptorProto `protobuf:"bytes,2,rep,name=value" json:"value,omitempty"` + Options *EnumOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (this *EnumDescriptorProto) Reset() { *this = EnumDescriptorProto{} } +func (this *EnumDescriptorProto) String() string { return proto.CompactTextString(this) } +func (*EnumDescriptorProto) ProtoMessage() {} + +func (this *EnumDescriptorProto) GetName() string { + if this != nil && this.Name != nil { + return *this.Name + } + return "" +} + +func (this *EnumDescriptorProto) GetOptions() *EnumOptions { + if this != nil { + return this.Options + } + return nil +} + +type EnumValueDescriptorProto struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + Number *int32 `protobuf:"varint,2,opt,name=number" json:"number,omitempty"` + Options *EnumValueOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (this *EnumValueDescriptorProto) Reset() { *this = EnumValueDescriptorProto{} } +func (this *EnumValueDescriptorProto) String() string { return proto.CompactTextString(this) } +func (*EnumValueDescriptorProto) ProtoMessage() {} + +func (this *EnumValueDescriptorProto) GetName() string { + if this != nil && this.Name != nil { + return *this.Name + } + return "" +} + +func (this *EnumValueDescriptorProto) GetNumber() int32 { + if this != nil && this.Number != nil { + return *this.Number + } + return 0 +} + +func (this *EnumValueDescriptorProto) GetOptions() *EnumValueOptions { + if this != nil { + return this.Options + } + return nil +} + +type ServiceDescriptorProto struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + Method []*MethodDescriptorProto `protobuf:"bytes,2,rep,name=method" json:"method,omitempty"` + Stream []*StreamDescriptorProto `protobuf:"bytes,4,rep,name=stream" json:"stream,omitempty"` + Options *ServiceOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (this *ServiceDescriptorProto) Reset() { *this = ServiceDescriptorProto{} } +func (this *ServiceDescriptorProto) String() string { return proto.CompactTextString(this) } +func (*ServiceDescriptorProto) ProtoMessage() {} + +func (this *ServiceDescriptorProto) GetName() string { + if this != nil && this.Name != nil { + return *this.Name + } + return "" +} + +func (this *ServiceDescriptorProto) GetOptions() *ServiceOptions { + if this != nil { + return this.Options + } + return nil +} + +type MethodDescriptorProto struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + InputType *string `protobuf:"bytes,2,opt,name=input_type" json:"input_type,omitempty"` + OutputType *string `protobuf:"bytes,3,opt,name=output_type" json:"output_type,omitempty"` + Options *MethodOptions `protobuf:"bytes,4,opt,name=options" json:"options,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (this *MethodDescriptorProto) Reset() { *this = MethodDescriptorProto{} } +func (this *MethodDescriptorProto) String() string { return proto.CompactTextString(this) } +func (*MethodDescriptorProto) ProtoMessage() {} + +func (this *MethodDescriptorProto) GetName() string { + if this != nil && this.Name != nil { + return *this.Name + } + return "" +} + +func (this *MethodDescriptorProto) GetInputType() string { + if this != nil && this.InputType != nil { + return *this.InputType + } + return "" +} + +func (this *MethodDescriptorProto) GetOutputType() string { + if this != nil && this.OutputType != nil { + return *this.OutputType + } + return "" +} + +func (this *MethodDescriptorProto) GetOptions() *MethodOptions { + if this != nil { + return this.Options + } + return nil +} + +type StreamDescriptorProto struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + ClientMessageType *string `protobuf:"bytes,2,opt,name=client_message_type" json:"client_message_type,omitempty"` + ServerMessageType *string `protobuf:"bytes,3,opt,name=server_message_type" json:"server_message_type,omitempty"` + Options *StreamOptions `protobuf:"bytes,4,opt,name=options" json:"options,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (this *StreamDescriptorProto) Reset() { *this = StreamDescriptorProto{} } +func (this *StreamDescriptorProto) String() string { return proto.CompactTextString(this) } +func (*StreamDescriptorProto) ProtoMessage() {} + +func (this *StreamDescriptorProto) GetName() string { + if this != nil && this.Name != nil { + return *this.Name + } + return "" +} + +func (this *StreamDescriptorProto) GetClientMessageType() string { + if this != nil && this.ClientMessageType != nil { + return *this.ClientMessageType + } + return "" +} + +func (this *StreamDescriptorProto) GetServerMessageType() string { + if this != nil && this.ServerMessageType != nil { + return *this.ServerMessageType + } + return "" +} + +func (this *StreamDescriptorProto) GetOptions() *StreamOptions { + if this != nil { + return this.Options + } + return nil +} + +type FileOptions struct { + JavaPackage *string `protobuf:"bytes,1,opt,name=java_package" json:"java_package,omitempty"` + JavaOuterClassname *string `protobuf:"bytes,8,opt,name=java_outer_classname" json:"java_outer_classname,omitempty"` + JavaMultipleFiles *bool `protobuf:"varint,10,opt,name=java_multiple_files,def=0" json:"java_multiple_files,omitempty"` + JavaGenerateEqualsAndHash *bool `protobuf:"varint,20,opt,name=java_generate_equals_and_hash,def=0" json:"java_generate_equals_and_hash,omitempty"` + OptimizeFor *FileOptions_OptimizeMode `protobuf:"varint,9,opt,name=optimize_for,enum=proto2.FileOptions_OptimizeMode,def=1" json:"optimize_for,omitempty"` + GoPackage *string `protobuf:"bytes,11,opt,name=go_package" json:"go_package,omitempty"` + CcGenericServices *bool `protobuf:"varint,16,opt,name=cc_generic_services,def=0" json:"cc_generic_services,omitempty"` + JavaGenericServices *bool `protobuf:"varint,17,opt,name=java_generic_services,def=0" json:"java_generic_services,omitempty"` + PyGenericServices *bool `protobuf:"varint,18,opt,name=py_generic_services,def=0" json:"py_generic_services,omitempty"` + UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option" json:"uninterpreted_option,omitempty"` + XXX_extensions map[int32]proto.Extension `json:"-"` + XXX_unrecognized []byte `json:"-"` +} + +func (this *FileOptions) Reset() { *this = FileOptions{} } +func (this *FileOptions) String() string { return proto.CompactTextString(this) } +func (*FileOptions) ProtoMessage() {} + +var extRange_FileOptions = []proto.ExtensionRange{ + {1000, 536870911}, +} + +func (*FileOptions) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_FileOptions +} +func (this *FileOptions) ExtensionMap() map[int32]proto.Extension { + if this.XXX_extensions == nil { + this.XXX_extensions = make(map[int32]proto.Extension) + } + return this.XXX_extensions +} + +const Default_FileOptions_JavaMultipleFiles bool = false +const Default_FileOptions_JavaGenerateEqualsAndHash bool = false +const Default_FileOptions_OptimizeFor FileOptions_OptimizeMode = FileOptions_SPEED +const Default_FileOptions_CcGenericServices bool = false +const Default_FileOptions_JavaGenericServices bool = false +const Default_FileOptions_PyGenericServices bool = false + +func (this *FileOptions) GetJavaPackage() string { + if this != nil && this.JavaPackage != nil { + return *this.JavaPackage + } + return "" +} + +func (this *FileOptions) GetJavaOuterClassname() string { + if this != nil && this.JavaOuterClassname != nil { + return *this.JavaOuterClassname + } + return "" +} + +func (this *FileOptions) GetJavaMultipleFiles() bool { + if this != nil && this.JavaMultipleFiles != nil { + return *this.JavaMultipleFiles + } + return Default_FileOptions_JavaMultipleFiles +} + +func (this *FileOptions) GetJavaGenerateEqualsAndHash() bool { + if this != nil && this.JavaGenerateEqualsAndHash != nil { + return *this.JavaGenerateEqualsAndHash + } + return Default_FileOptions_JavaGenerateEqualsAndHash +} + +func (this *FileOptions) GetOptimizeFor() FileOptions_OptimizeMode { + if this != nil && this.OptimizeFor != nil { + return *this.OptimizeFor + } + return Default_FileOptions_OptimizeFor +} + +func (this *FileOptions) GetGoPackage() string { + if this != nil && this.GoPackage != nil { + return *this.GoPackage + } + return "" +} + +func (this *FileOptions) GetCcGenericServices() bool { + if this != nil && this.CcGenericServices != nil { + return *this.CcGenericServices + } + return Default_FileOptions_CcGenericServices +} + +func (this *FileOptions) GetJavaGenericServices() bool { + if this != nil && this.JavaGenericServices != nil { + return *this.JavaGenericServices + } + return Default_FileOptions_JavaGenericServices +} + +func (this *FileOptions) GetPyGenericServices() bool { + if this != nil && this.PyGenericServices != nil { + return *this.PyGenericServices + } + return Default_FileOptions_PyGenericServices +} + +type MessageOptions struct { + MessageSetWireFormat *bool `protobuf:"varint,1,opt,name=message_set_wire_format,def=0" json:"message_set_wire_format,omitempty"` + NoStandardDescriptorAccessor *bool `protobuf:"varint,2,opt,name=no_standard_descriptor_accessor,def=0" json:"no_standard_descriptor_accessor,omitempty"` + UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option" json:"uninterpreted_option,omitempty"` + XXX_extensions map[int32]proto.Extension `json:"-"` + XXX_unrecognized []byte `json:"-"` +} + +func (this *MessageOptions) Reset() { *this = MessageOptions{} } +func (this *MessageOptions) String() string { return proto.CompactTextString(this) } +func (*MessageOptions) ProtoMessage() {} + +var extRange_MessageOptions = []proto.ExtensionRange{ + {1000, 536870911}, +} + +func (*MessageOptions) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_MessageOptions +} +func (this *MessageOptions) ExtensionMap() map[int32]proto.Extension { + if this.XXX_extensions == nil { + this.XXX_extensions = make(map[int32]proto.Extension) + } + return this.XXX_extensions +} + +const Default_MessageOptions_MessageSetWireFormat bool = false +const Default_MessageOptions_NoStandardDescriptorAccessor bool = false + +func (this *MessageOptions) GetMessageSetWireFormat() bool { + if this != nil && this.MessageSetWireFormat != nil { + return *this.MessageSetWireFormat + } + return Default_MessageOptions_MessageSetWireFormat +} + +func (this *MessageOptions) GetNoStandardDescriptorAccessor() bool { + if this != nil && this.NoStandardDescriptorAccessor != nil { + return *this.NoStandardDescriptorAccessor + } + return Default_MessageOptions_NoStandardDescriptorAccessor +} + +type FieldOptions struct { + Ctype *FieldOptions_CType `protobuf:"varint,1,opt,name=ctype,enum=proto2.FieldOptions_CType,def=0" json:"ctype,omitempty"` + Packed *bool `protobuf:"varint,2,opt,name=packed" json:"packed,omitempty"` + Lazy *bool `protobuf:"varint,5,opt,name=lazy,def=0" json:"lazy,omitempty"` + Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"` + ExperimentalMapKey *string `protobuf:"bytes,9,opt,name=experimental_map_key" json:"experimental_map_key,omitempty"` + Weak *bool `protobuf:"varint,10,opt,name=weak,def=0" json:"weak,omitempty"` + UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option" json:"uninterpreted_option,omitempty"` + XXX_extensions map[int32]proto.Extension `json:"-"` + XXX_unrecognized []byte `json:"-"` +} + +func (this *FieldOptions) Reset() { *this = FieldOptions{} } +func (this *FieldOptions) String() string { return proto.CompactTextString(this) } +func (*FieldOptions) ProtoMessage() {} + +var extRange_FieldOptions = []proto.ExtensionRange{ + {1000, 536870911}, +} + +func (*FieldOptions) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_FieldOptions +} +func (this *FieldOptions) ExtensionMap() map[int32]proto.Extension { + if this.XXX_extensions == nil { + this.XXX_extensions = make(map[int32]proto.Extension) + } + return this.XXX_extensions +} + +const Default_FieldOptions_Ctype FieldOptions_CType = FieldOptions_STRING +const Default_FieldOptions_Lazy bool = false +const Default_FieldOptions_Deprecated bool = false +const Default_FieldOptions_Weak bool = false + +func (this *FieldOptions) GetCtype() FieldOptions_CType { + if this != nil && this.Ctype != nil { + return *this.Ctype + } + return Default_FieldOptions_Ctype +} + +func (this *FieldOptions) GetPacked() bool { + if this != nil && this.Packed != nil { + return *this.Packed + } + return false +} + +func (this *FieldOptions) GetLazy() bool { + if this != nil && this.Lazy != nil { + return *this.Lazy + } + return Default_FieldOptions_Lazy +} + +func (this *FieldOptions) GetDeprecated() bool { + if this != nil && this.Deprecated != nil { + return *this.Deprecated + } + return Default_FieldOptions_Deprecated +} + +func (this *FieldOptions) GetExperimentalMapKey() string { + if this != nil && this.ExperimentalMapKey != nil { + return *this.ExperimentalMapKey + } + return "" +} + +func (this *FieldOptions) GetWeak() bool { + if this != nil && this.Weak != nil { + return *this.Weak + } + return Default_FieldOptions_Weak +} + +type EnumOptions struct { + AllowAlias *bool `protobuf:"varint,2,opt,name=allow_alias,def=1" json:"allow_alias,omitempty"` + UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option" json:"uninterpreted_option,omitempty"` + XXX_extensions map[int32]proto.Extension `json:"-"` + XXX_unrecognized []byte `json:"-"` +} + +func (this *EnumOptions) Reset() { *this = EnumOptions{} } +func (this *EnumOptions) String() string { return proto.CompactTextString(this) } +func (*EnumOptions) ProtoMessage() {} + +var extRange_EnumOptions = []proto.ExtensionRange{ + {1000, 536870911}, +} + +func (*EnumOptions) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_EnumOptions +} +func (this *EnumOptions) ExtensionMap() map[int32]proto.Extension { + if this.XXX_extensions == nil { + this.XXX_extensions = make(map[int32]proto.Extension) + } + return this.XXX_extensions +} + +const Default_EnumOptions_AllowAlias bool = true + +func (this *EnumOptions) GetAllowAlias() bool { + if this != nil && this.AllowAlias != nil { + return *this.AllowAlias + } + return Default_EnumOptions_AllowAlias +} + +type EnumValueOptions struct { + UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option" json:"uninterpreted_option,omitempty"` + XXX_extensions map[int32]proto.Extension `json:"-"` + XXX_unrecognized []byte `json:"-"` +} + +func (this *EnumValueOptions) Reset() { *this = EnumValueOptions{} } +func (this *EnumValueOptions) String() string { return proto.CompactTextString(this) } +func (*EnumValueOptions) ProtoMessage() {} + +var extRange_EnumValueOptions = []proto.ExtensionRange{ + {1000, 536870911}, +} + +func (*EnumValueOptions) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_EnumValueOptions +} +func (this *EnumValueOptions) ExtensionMap() map[int32]proto.Extension { + if this.XXX_extensions == nil { + this.XXX_extensions = make(map[int32]proto.Extension) + } + return this.XXX_extensions +} + +type ServiceOptions struct { + UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option" json:"uninterpreted_option,omitempty"` + XXX_extensions map[int32]proto.Extension `json:"-"` + XXX_unrecognized []byte `json:"-"` +} + +func (this *ServiceOptions) Reset() { *this = ServiceOptions{} } +func (this *ServiceOptions) String() string { return proto.CompactTextString(this) } +func (*ServiceOptions) ProtoMessage() {} + +var extRange_ServiceOptions = []proto.ExtensionRange{ + {1000, 536870911}, +} + +func (*ServiceOptions) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_ServiceOptions +} +func (this *ServiceOptions) ExtensionMap() map[int32]proto.Extension { + if this.XXX_extensions == nil { + this.XXX_extensions = make(map[int32]proto.Extension) + } + return this.XXX_extensions +} + +type MethodOptions struct { + UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option" json:"uninterpreted_option,omitempty"` + XXX_extensions map[int32]proto.Extension `json:"-"` + XXX_unrecognized []byte `json:"-"` +} + +func (this *MethodOptions) Reset() { *this = MethodOptions{} } +func (this *MethodOptions) String() string { return proto.CompactTextString(this) } +func (*MethodOptions) ProtoMessage() {} + +var extRange_MethodOptions = []proto.ExtensionRange{ + {1000, 536870911}, +} + +func (*MethodOptions) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_MethodOptions +} +func (this *MethodOptions) ExtensionMap() map[int32]proto.Extension { + if this.XXX_extensions == nil { + this.XXX_extensions = make(map[int32]proto.Extension) + } + return this.XXX_extensions +} + +type StreamOptions struct { + UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option" json:"uninterpreted_option,omitempty"` + XXX_extensions map[int32]proto.Extension `json:"-"` + XXX_unrecognized []byte `json:"-"` +} + +func (this *StreamOptions) Reset() { *this = StreamOptions{} } +func (this *StreamOptions) String() string { return proto.CompactTextString(this) } +func (*StreamOptions) ProtoMessage() {} + +var extRange_StreamOptions = []proto.ExtensionRange{ + {1000, 536870911}, +} + +func (*StreamOptions) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_StreamOptions +} +func (this *StreamOptions) ExtensionMap() map[int32]proto.Extension { + if this.XXX_extensions == nil { + this.XXX_extensions = make(map[int32]proto.Extension) + } + return this.XXX_extensions +} + +type UninterpretedOption struct { + Name []*UninterpretedOption_NamePart `protobuf:"bytes,2,rep,name=name" json:"name,omitempty"` + IdentifierValue *string `protobuf:"bytes,3,opt,name=identifier_value" json:"identifier_value,omitempty"` + PositiveIntValue *uint64 `protobuf:"varint,4,opt,name=positive_int_value" json:"positive_int_value,omitempty"` + NegativeIntValue *int64 `protobuf:"varint,5,opt,name=negative_int_value" json:"negative_int_value,omitempty"` + DoubleValue *float64 `protobuf:"fixed64,6,opt,name=double_value" json:"double_value,omitempty"` + StringValue []byte `protobuf:"bytes,7,opt,name=string_value" json:"string_value,omitempty"` + AggregateValue *string `protobuf:"bytes,8,opt,name=aggregate_value" json:"aggregate_value,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (this *UninterpretedOption) Reset() { *this = UninterpretedOption{} } +func (this *UninterpretedOption) String() string { return proto.CompactTextString(this) } +func (*UninterpretedOption) ProtoMessage() {} + +func (this *UninterpretedOption) GetIdentifierValue() string { + if this != nil && this.IdentifierValue != nil { + return *this.IdentifierValue + } + return "" +} + +func (this *UninterpretedOption) GetPositiveIntValue() uint64 { + if this != nil && this.PositiveIntValue != nil { + return *this.PositiveIntValue + } + return 0 +} + +func (this *UninterpretedOption) GetNegativeIntValue() int64 { + if this != nil && this.NegativeIntValue != nil { + return *this.NegativeIntValue + } + return 0 +} + +func (this *UninterpretedOption) GetDoubleValue() float64 { + if this != nil && this.DoubleValue != nil { + return *this.DoubleValue + } + return 0 +} + +func (this *UninterpretedOption) GetStringValue() []byte { + if this != nil { + return this.StringValue + } + return nil +} + +func (this *UninterpretedOption) GetAggregateValue() string { + if this != nil && this.AggregateValue != nil { + return *this.AggregateValue + } + return "" +} + +type UninterpretedOption_NamePart struct { + NamePart *string `protobuf:"bytes,1,req,name=name_part" json:"name_part,omitempty"` + IsExtension *bool `protobuf:"varint,2,req,name=is_extension" json:"is_extension,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (this *UninterpretedOption_NamePart) Reset() { *this = UninterpretedOption_NamePart{} } +func (this *UninterpretedOption_NamePart) String() string { return proto.CompactTextString(this) } +func (*UninterpretedOption_NamePart) ProtoMessage() {} + +func (this *UninterpretedOption_NamePart) GetNamePart() string { + if this != nil && this.NamePart != nil { + return *this.NamePart + } + return "" +} + +func (this *UninterpretedOption_NamePart) GetIsExtension() bool { + if this != nil && this.IsExtension != nil { + return *this.IsExtension + } + return false +} + +type SourceCodeInfo struct { + Location []*SourceCodeInfo_Location `protobuf:"bytes,1,rep,name=location" json:"location,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (this *SourceCodeInfo) Reset() { *this = SourceCodeInfo{} } +func (this *SourceCodeInfo) String() string { return proto.CompactTextString(this) } +func (*SourceCodeInfo) ProtoMessage() {} + +type SourceCodeInfo_Location struct { + Path []int32 `protobuf:"varint,1,rep,packed,name=path" json:"path,omitempty"` + Span []int32 `protobuf:"varint,2,rep,packed,name=span" json:"span,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (this *SourceCodeInfo_Location) Reset() { *this = SourceCodeInfo_Location{} } +func (this *SourceCodeInfo_Location) String() string { return proto.CompactTextString(this) } +func (*SourceCodeInfo_Location) ProtoMessage() {} + +func init() { + proto.RegisterEnum("google_protobuf.FieldDescriptorProto_Type", FieldDescriptorProto_Type_name, FieldDescriptorProto_Type_value) + proto.RegisterEnum("google_protobuf.FieldDescriptorProto_Label", FieldDescriptorProto_Label_name, FieldDescriptorProto_Label_value) + proto.RegisterEnum("google_protobuf.FileOptions_OptimizeMode", FileOptions_OptimizeMode_name, FileOptions_OptimizeMode_value) + proto.RegisterEnum("google_protobuf.FieldOptions_CType", FieldOptions_CType_name, FieldOptions_CType_value) + proto.RegisterEnum("google_protobuf.StreamOptions_TokenUnit", StreamOptions_TokenUnit_name, StreamOptions_TokenUnit_value) +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/doc.go b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/doc.go new file mode 100644 index 000000000..0d6055d61 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/doc.go @@ -0,0 +1,51 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2010 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +/* + A plugin for the Google protocol buffer compiler to generate Go code. + Run it by building this program and putting it in your path with the name + protoc-gen-go + That word 'go' at the end becomes part of the option string set for the + protocol compiler, so once the protocol compiler (protoc) is installed + you can run + protoc --go_out=output_directory input_directory/file.proto + to generate Go bindings for the protocol defined by file.proto. + With that input, the output will be written to + output_directory/file.pb.go + + The generated code is documented in the package comment for + the library. + + See the README and documentation for protocol buffers to learn more: + https://developers.google.com/protocol-buffers/ + +*/ +package documentation diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/generator/Makefile b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/generator/Makefile new file mode 100644 index 000000000..b5715c357 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/generator/Makefile @@ -0,0 +1,40 @@ +# Go support for Protocol Buffers - Google's data interchange format +# +# Copyright 2010 The Go Authors. All rights reserved. +# https://github.com/golang/protobuf +# +# 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. + +include $(GOROOT)/src/Make.inc + +TARG=github.com/golang/protobuf/compiler/generator +GOFILES=\ + generator.go\ + +DEPS=../descriptor ../plugin ../../proto + +include $(GOROOT)/src/Make.pkg diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/generator/generator.go b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/generator/generator.go new file mode 100644 index 000000000..11542166c --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/generator/generator.go @@ -0,0 +1,2089 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2010 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +/* + The code generator for the plugin for the Google protocol buffer compiler. + It generates Go code from the protocol buffer description files read by the + main routine. +*/ +package generator + +import ( + "bytes" + "fmt" + "go/parser" + "go/printer" + "go/token" + "log" + "os" + "path" + "strconv" + "strings" + "unicode" + "unicode/utf8" + + "github.com/golang/protobuf/proto" + + "github.com/golang/protobuf/protoc-gen-go/descriptor" + plugin "github.com/golang/protobuf/protoc-gen-go/plugin" +) + +// A Plugin provides functionality to add to the output during Go code generation, +// such as to produce RPC stubs. +type Plugin interface { + // Name identifies the plugin. + Name() string + // Init is called once after data structures are built but before + // code generation begins. + Init(g *Generator) + // Generate produces the code generated by the plugin for this file, + // except for the imports, by calling the generator's methods P, In, and Out. + Generate(file *FileDescriptor) + // GenerateImports produces the import declarations for this file. + // It is called after Generate. + GenerateImports(file *FileDescriptor) +} + +var plugins []Plugin + +// RegisterPlugin installs a (second-order) plugin to be run when the Go output is generated. +// It is typically called during initialization. +func RegisterPlugin(p Plugin) { + plugins = append(plugins, p) +} + +// Each type we import as a protocol buffer (other than FileDescriptorProto) needs +// a pointer to the FileDescriptorProto that represents it. These types achieve that +// wrapping by placing each Proto inside a struct with the pointer to its File. The +// structs have the same names as their contents, with "Proto" removed. +// FileDescriptor is used to store the things that it points to. + +// The file and package name method are common to messages and enums. +type common struct { + file *descriptor.FileDescriptorProto // File this object comes from. +} + +// PackageName is name in the package clause in the generated file. +func (c *common) PackageName() string { return uniquePackageOf(c.file) } + +func (c *common) File() *descriptor.FileDescriptorProto { return c.file } + +func fileIsProto3(file *descriptor.FileDescriptorProto) bool { + return file.GetSyntax() == "proto3" +} + +func (c *common) proto3() bool { return fileIsProto3(c.file) } + +// Descriptor represents a protocol buffer message. +type Descriptor struct { + common + *descriptor.DescriptorProto + parent *Descriptor // The containing message, if any. + nested []*Descriptor // Inner messages, if any. + ext []*ExtensionDescriptor // Extensions, if any. + typename []string // Cached typename vector. + index int // The index into the container, whether the file or another message. + path string // The SourceCodeInfo path as comma-separated integers. + group bool +} + +// TypeName returns the elements of the dotted type name. +// The package name is not part of this name. +func (d *Descriptor) TypeName() []string { + if d.typename != nil { + return d.typename + } + n := 0 + for parent := d; parent != nil; parent = parent.parent { + n++ + } + s := make([]string, n, n) + for parent := d; parent != nil; parent = parent.parent { + n-- + s[n] = parent.GetName() + } + d.typename = s + return s +} + +// EnumDescriptor describes an enum. If it's at top level, its parent will be nil. +// Otherwise it will be the descriptor of the message in which it is defined. +type EnumDescriptor struct { + common + *descriptor.EnumDescriptorProto + parent *Descriptor // The containing message, if any. + typename []string // Cached typename vector. + index int // The index into the container, whether the file or a message. + path string // The SourceCodeInfo path as comma-separated integers. +} + +// TypeName returns the elements of the dotted type name. +// The package name is not part of this name. +func (e *EnumDescriptor) TypeName() (s []string) { + if e.typename != nil { + return e.typename + } + name := e.GetName() + if e.parent == nil { + s = make([]string, 1) + } else { + pname := e.parent.TypeName() + s = make([]string, len(pname)+1) + copy(s, pname) + } + s[len(s)-1] = name + e.typename = s + return s +} + +// Everything but the last element of the full type name, CamelCased. +// The values of type Foo.Bar are call Foo_value1... not Foo_Bar_value1... . +func (e *EnumDescriptor) prefix() string { + if e.parent == nil { + // If the enum is not part of a message, the prefix is just the type name. + return CamelCase(*e.Name) + "_" + } + typeName := e.TypeName() + return CamelCaseSlice(typeName[0:len(typeName)-1]) + "_" +} + +// The integer value of the named constant in this enumerated type. +func (e *EnumDescriptor) integerValueAsString(name string) string { + for _, c := range e.Value { + if c.GetName() == name { + return fmt.Sprint(c.GetNumber()) + } + } + log.Fatal("cannot find value for enum constant") + return "" +} + +// ExtensionDescriptor describes an extension. If it's at top level, its parent will be nil. +// Otherwise it will be the descriptor of the message in which it is defined. +type ExtensionDescriptor struct { + common + *descriptor.FieldDescriptorProto + parent *Descriptor // The containing message, if any. +} + +// TypeName returns the elements of the dotted type name. +// The package name is not part of this name. +func (e *ExtensionDescriptor) TypeName() (s []string) { + name := e.GetName() + if e.parent == nil { + // top-level extension + s = make([]string, 1) + } else { + pname := e.parent.TypeName() + s = make([]string, len(pname)+1) + copy(s, pname) + } + s[len(s)-1] = name + return s +} + +// DescName returns the variable name used for the generated descriptor. +func (e *ExtensionDescriptor) DescName() string { + // The full type name. + typeName := e.TypeName() + // Each scope of the extension is individually CamelCased, and all are joined with "_" with an "E_" prefix. + for i, s := range typeName { + typeName[i] = CamelCase(s) + } + return "E_" + strings.Join(typeName, "_") +} + +// ImportedDescriptor describes a type that has been publicly imported from another file. +type ImportedDescriptor struct { + common + o Object +} + +func (id *ImportedDescriptor) TypeName() []string { return id.o.TypeName() } + +// FileDescriptor describes an protocol buffer descriptor file (.proto). +// It includes slices of all the messages and enums defined within it. +// Those slices are constructed by WrapTypes. +type FileDescriptor struct { + *descriptor.FileDescriptorProto + desc []*Descriptor // All the messages defined in this file. + enum []*EnumDescriptor // All the enums defined in this file. + ext []*ExtensionDescriptor // All the top-level extensions defined in this file. + imp []*ImportedDescriptor // All types defined in files publicly imported by this file. + + // Comments, stored as a map of path (comma-separated integers) to the comment. + comments map[string]*descriptor.SourceCodeInfo_Location + + // The full list of symbols that are exported, + // as a map from the exported object to its symbols. + // This is used for supporting public imports. + exported map[Object][]symbol + + index int // The index of this file in the list of files to generate code for + + proto3 bool // whether to generate proto3 code for this file +} + +// PackageName is the package name we'll use in the generated code to refer to this file. +func (d *FileDescriptor) PackageName() string { return uniquePackageOf(d.FileDescriptorProto) } + +// goPackageName returns the Go package name to use in the +// generated Go file. The result explicit reports whether the name +// came from an option go_package statement. If explicit is false, +// the name was derived from the protocol buffer's package statement +// or the input file name. +func (d *FileDescriptor) goPackageName() (name string, explicit bool) { + // Does the file have a "go_package" option? + if opts := d.Options; opts != nil { + if pkg := opts.GetGoPackage(); pkg != "" { + return pkg, true + } + } + + // Does the file have a package clause? + if pkg := d.GetPackage(); pkg != "" { + return pkg, false + } + // Use the file base name. + return baseName(d.GetName()), false +} + +func (d *FileDescriptor) addExport(obj Object, sym symbol) { + d.exported[obj] = append(d.exported[obj], sym) +} + +// symbol is an interface representing an exported Go symbol. +type symbol interface { + // GenerateAlias should generate an appropriate alias + // for the symbol from the named package. + GenerateAlias(g *Generator, pkg string) +} + +type messageSymbol struct { + sym string + hasExtensions, isMessageSet bool + getters []getterSymbol +} + +type getterSymbol struct { + name string + typ string + typeName string // canonical name in proto world; empty for proto.Message and similar + genType bool // whether typ is a generated type (message/group/enum) +} + +func (ms *messageSymbol) GenerateAlias(g *Generator, pkg string) { + remoteSym := pkg + "." + ms.sym + + g.P("type ", ms.sym, " ", remoteSym) + g.P("func (m *", ms.sym, ") Reset() { (*", remoteSym, ")(m).Reset() }") + g.P("func (m *", ms.sym, ") String() string { return (*", remoteSym, ")(m).String() }") + g.P("func (*", ms.sym, ") ProtoMessage() {}") + if ms.hasExtensions { + g.P("func (*", ms.sym, ") ExtensionRangeArray() []", g.Pkg["proto"], ".ExtensionRange ", + "{ return (*", remoteSym, ")(nil).ExtensionRangeArray() }") + g.P("func (m *", ms.sym, ") ExtensionMap() map[int32]", g.Pkg["proto"], ".Extension ", + "{ return (*", remoteSym, ")(m).ExtensionMap() }") + if ms.isMessageSet { + g.P("func (m *", ms.sym, ") Marshal() ([]byte, error) ", + "{ return (*", remoteSym, ")(m).Marshal() }") + g.P("func (m *", ms.sym, ") Unmarshal(buf []byte) error ", + "{ return (*", remoteSym, ")(m).Unmarshal(buf) }") + } + } + for _, get := range ms.getters { + + if get.typeName != "" { + g.RecordTypeUse(get.typeName) + } + typ := get.typ + val := "(*" + remoteSym + ")(m)." + get.name + "()" + if get.genType { + // typ will be "*pkg.T" (message/group) or "pkg.T" (enum). + // Either of those might have a "[]" prefix if it is repeated. + // Drop the package qualifier since we have hoisted the type into this package. + rep := strings.HasPrefix(typ, "[]") + if rep { + typ = typ[2:] + } + star := typ[0] == '*' + typ = typ[strings.Index(typ, ".")+1:] + if star { + typ = "*" + typ + } + if rep { + // Go does not permit conversion between slice types where both + // element types are named. That means we need to generate a bit + // of code in this situation. + // typ is the element type. + // val is the expression to get the slice from the imported type. + + ctyp := typ // conversion type expression; "Foo" or "(*Foo)" + if star { + ctyp = "(" + typ + ")" + } + + g.P("func (m *", ms.sym, ") ", get.name, "() []", typ, " {") + g.In() + g.P("o := ", val) + g.P("if o == nil {") + g.In() + g.P("return nil") + g.Out() + g.P("}") + g.P("s := make([]", typ, ", len(o))") + g.P("for i, x := range o {") + g.In() + g.P("s[i] = ", ctyp, "(x)") + g.Out() + g.P("}") + g.P("return s") + g.Out() + g.P("}") + continue + } + // Convert imported type into the forwarding type. + val = "(" + typ + ")(" + val + ")" + } + + g.P("func (m *", ms.sym, ") ", get.name, "() ", typ, " { return ", val, " }") + } + +} + +type enumSymbol struct { + name string + proto3 bool // Whether this came from a proto3 file. +} + +func (es enumSymbol) GenerateAlias(g *Generator, pkg string) { + s := es.name + g.P("type ", s, " ", pkg, ".", s) + g.P("var ", s, "_name = ", pkg, ".", s, "_name") + g.P("var ", s, "_value = ", pkg, ".", s, "_value") + g.P("func (x ", s, ") String() string { return (", pkg, ".", s, ")(x).String() }") + if !es.proto3 { + g.P("func (x ", s, ") Enum() *", s, "{ return (*", s, ")((", pkg, ".", s, ")(x).Enum()) }") + g.P("func (x *", s, ") UnmarshalJSON(data []byte) error { return (*", pkg, ".", s, ")(x).UnmarshalJSON(data) }") + } +} + +type constOrVarSymbol struct { + sym string + typ string // either "const" or "var" + cast string // if non-empty, a type cast is required (used for enums) +} + +func (cs constOrVarSymbol) GenerateAlias(g *Generator, pkg string) { + v := pkg + "." + cs.sym + if cs.cast != "" { + v = cs.cast + "(" + v + ")" + } + g.P(cs.typ, " ", cs.sym, " = ", v) +} + +// Object is an interface abstracting the abilities shared by enums, messages, extensions and imported objects. +type Object interface { + PackageName() string // The name we use in our output (a_b_c), possibly renamed for uniqueness. + TypeName() []string + File() *descriptor.FileDescriptorProto +} + +// Each package name we generate must be unique. The package we're generating +// gets its own name but every other package must have a unique name that does +// not conflict in the code we generate. These names are chosen globally (although +// they don't have to be, it simplifies things to do them globally). +func uniquePackageOf(fd *descriptor.FileDescriptorProto) string { + s, ok := uniquePackageName[fd] + if !ok { + log.Fatal("internal error: no package name defined for " + fd.GetName()) + } + return s +} + +// Generator is the type whose methods generate the output, stored in the associated response structure. +type Generator struct { + *bytes.Buffer + + Request *plugin.CodeGeneratorRequest // The input. + Response *plugin.CodeGeneratorResponse // The output. + + Param map[string]string // Command-line parameters. + PackageImportPath string // Go import path of the package we're generating code for + ImportPrefix string // String to prefix to imported package file names. + ImportMap map[string]string // Mapping from import name to generated name + + Pkg map[string]string // The names under which we import support packages + + packageName string // What we're calling ourselves. + allFiles []*FileDescriptor // All files in the tree + genFiles []*FileDescriptor // Those files we will generate output for. + file *FileDescriptor // The file we are compiling now. + usedPackages map[string]bool // Names of packages used in current file. + typeNameToObject map[string]Object // Key is a fully-qualified name in input syntax. + init []string // Lines to emit in the init function. + indent string +} + +// New creates a new generator and allocates the request and response protobufs. +func New() *Generator { + g := new(Generator) + g.Buffer = new(bytes.Buffer) + g.Request = new(plugin.CodeGeneratorRequest) + g.Response = new(plugin.CodeGeneratorResponse) + return g +} + +// Error reports a problem, including an error, and exits the program. +func (g *Generator) Error(err error, msgs ...string) { + s := strings.Join(msgs, " ") + ":" + err.Error() + log.Print("protoc-gen-go: error:", s) + os.Exit(1) +} + +// Fail reports a problem and exits the program. +func (g *Generator) Fail(msgs ...string) { + s := strings.Join(msgs, " ") + log.Print("protoc-gen-go: error:", s) + os.Exit(1) +} + +// CommandLineParameters breaks the comma-separated list of key=value pairs +// in the parameter (a member of the request protobuf) into a key/value map. +// It then sets file name mappings defined by those entries. +func (g *Generator) CommandLineParameters(parameter string) { + g.Param = make(map[string]string) + for _, p := range strings.Split(parameter, ",") { + if i := strings.Index(p, "="); i < 0 { + g.Param[p] = "" + } else { + g.Param[p[0:i]] = p[i+1:] + } + } + + g.ImportMap = make(map[string]string) + pluginList := "none" // Default list of plugin names to enable (empty means all). + for k, v := range g.Param { + switch k { + case "import_prefix": + g.ImportPrefix = v + case "import_path": + g.PackageImportPath = v + case "plugins": + pluginList = v + default: + if len(k) > 0 && k[0] == 'M' { + g.ImportMap[k[1:]] = v + } + } + } + + if pluginList != "" { + // Amend the set of plugins. + enabled := make(map[string]bool) + for _, name := range strings.Split(pluginList, "+") { + enabled[name] = true + } + var nplugins []Plugin + for _, p := range plugins { + if enabled[p.Name()] { + nplugins = append(nplugins, p) + } + } + plugins = nplugins + } +} + +// DefaultPackageName returns the package name printed for the object. +// If its file is in a different package, it returns the package name we're using for this file, plus ".". +// Otherwise it returns the empty string. +func (g *Generator) DefaultPackageName(obj Object) string { + pkg := obj.PackageName() + if pkg == g.packageName { + return "" + } + return pkg + "." +} + +// For each input file, the unique package name to use, underscored. +var uniquePackageName = make(map[*descriptor.FileDescriptorProto]string) + +// Package names already registered. Key is the name from the .proto file; +// value is the name that appears in the generated code. +var pkgNamesInUse = make(map[string]bool) + +// Create and remember a guaranteed unique package name for this file descriptor. +// Pkg is the candidate name. If f is nil, it's a builtin package like "proto" and +// has no file descriptor. +func RegisterUniquePackageName(pkg string, f *FileDescriptor) string { + // Convert dots to underscores before finding a unique alias. + pkg = strings.Map(badToUnderscore, pkg) + + for i, orig := 1, pkg; pkgNamesInUse[pkg]; i++ { + // It's a duplicate; must rename. + pkg = orig + strconv.Itoa(i) + } + // Install it. + pkgNamesInUse[pkg] = true + if f != nil { + uniquePackageName[f.FileDescriptorProto] = pkg + } + return pkg +} + +var isGoKeyword = map[string]bool{ + "break": true, + "case": true, + "chan": true, + "const": true, + "continue": true, + "default": true, + "else": true, + "defer": true, + "fallthrough": true, + "for": true, + "func": true, + "go": true, + "goto": true, + "if": true, + "import": true, + "interface": true, + "map": true, + "package": true, + "range": true, + "return": true, + "select": true, + "struct": true, + "switch": true, + "type": true, + "var": true, +} + +// defaultGoPackage returns the package name to use, +// derived from the import path of the package we're building code for. +func (g *Generator) defaultGoPackage() string { + p := g.PackageImportPath + if i := strings.LastIndex(p, "/"); i >= 0 { + p = p[i+1:] + } + if p == "" { + return "" + } + + p = strings.Map(badToUnderscore, p) + // Identifier must not be keyword: insert _. + if isGoKeyword[p] { + p = "_" + p + } + // Identifier must not begin with digit: insert _. + if r, _ := utf8.DecodeRuneInString(p); unicode.IsDigit(r) { + p = "_" + p + } + return p +} + +// SetPackageNames sets the package name for this run. +// The package name must agree across all files being generated. +// It also defines unique package names for all imported files. +func (g *Generator) SetPackageNames() { + // Register the name for this package. It will be the first name + // registered so is guaranteed to be unmodified. + pkg, explicit := g.genFiles[0].goPackageName() + + // Check all files for an explicit go_package option. + for _, f := range g.genFiles { + thisPkg, thisExplicit := f.goPackageName() + if thisExplicit { + if !explicit { + // Let this file's go_package option serve for all input files. + pkg, explicit = thisPkg, true + } else if thisPkg != pkg { + g.Fail("inconsistent package names:", thisPkg, pkg) + } + } + } + + // If we don't have an explicit go_package option but we have an + // import path, use that. + if !explicit { + p := g.defaultGoPackage() + if p != "" { + pkg, explicit = p, true + } + } + + // If there was no go_package and no import path to use, + // double-check that all the inputs have the same implicit + // Go package name. + if !explicit { + for _, f := range g.genFiles { + thisPkg, _ := f.goPackageName() + if thisPkg != pkg { + g.Fail("inconsistent package names:", thisPkg, pkg) + } + } + } + + g.packageName = RegisterUniquePackageName(pkg, g.genFiles[0]) + + // Register the support package names. They might collide with the + // name of a package we import. + g.Pkg = map[string]string{ + "math": RegisterUniquePackageName("math", nil), + "proto": RegisterUniquePackageName("proto", nil), + } + +AllFiles: + for _, f := range g.allFiles { + for _, genf := range g.genFiles { + if f == genf { + // In this package already. + uniquePackageName[f.FileDescriptorProto] = g.packageName + continue AllFiles + } + } + // The file is a dependency, so we want to ignore its go_package option + // because that is only relevant for its specific generated output. + pkg := f.GetPackage() + if pkg == "" { + pkg = baseName(*f.Name) + } + RegisterUniquePackageName(pkg, f) + } +} + +// WrapTypes walks the incoming data, wrapping DescriptorProtos, EnumDescriptorProtos +// and FileDescriptorProtos into file-referenced objects within the Generator. +// It also creates the list of files to generate and so should be called before GenerateAllFiles. +func (g *Generator) WrapTypes() { + g.allFiles = make([]*FileDescriptor, len(g.Request.ProtoFile)) + for i, f := range g.Request.ProtoFile { + // We must wrap the descriptors before we wrap the enums + descs := wrapDescriptors(f) + g.buildNestedDescriptors(descs) + enums := wrapEnumDescriptors(f, descs) + exts := wrapExtensions(f) + imps := wrapImported(f, g) + fd := &FileDescriptor{ + FileDescriptorProto: f, + desc: descs, + enum: enums, + ext: exts, + imp: imps, + exported: make(map[Object][]symbol), + proto3: fileIsProto3(f), + } + extractComments(fd) + g.allFiles[i] = fd + } + + g.genFiles = make([]*FileDescriptor, len(g.Request.FileToGenerate)) +FindFiles: + for i, fileName := range g.Request.FileToGenerate { + // Search the list. This algorithm is n^2 but n is tiny. + for _, file := range g.allFiles { + if fileName == file.GetName() { + g.genFiles[i] = file + file.index = i + continue FindFiles + } + } + g.Fail("could not find file named", fileName) + } + g.Response.File = make([]*plugin.CodeGeneratorResponse_File, len(g.genFiles)) +} + +// Scan the descriptors in this file. For each one, build the slice of nested descriptors +func (g *Generator) buildNestedDescriptors(descs []*Descriptor) { + for _, desc := range descs { + if len(desc.NestedType) != 0 { + desc.nested = make([]*Descriptor, len(desc.NestedType)) + n := 0 + for _, nest := range descs { + if nest.parent == desc { + desc.nested[n] = nest + n++ + } + } + if n != len(desc.NestedType) { + g.Fail("internal error: nesting failure for", desc.GetName()) + } + } + } +} + +// Construct the Descriptor +func newDescriptor(desc *descriptor.DescriptorProto, parent *Descriptor, file *descriptor.FileDescriptorProto, index int) *Descriptor { + d := &Descriptor{ + common: common{file}, + DescriptorProto: desc, + parent: parent, + index: index, + } + if parent == nil { + d.path = fmt.Sprintf("%d,%d", messagePath, index) + } else { + d.path = fmt.Sprintf("%s,%d,%d", parent.path, messageMessagePath, index) + } + + // The only way to distinguish a group from a message is whether + // the containing message has a TYPE_GROUP field that matches. + if parent != nil { + parts := d.TypeName() + if file.Package != nil { + parts = append([]string{*file.Package}, parts...) + } + exp := "." + strings.Join(parts, ".") + for _, field := range parent.Field { + if field.GetType() == descriptor.FieldDescriptorProto_TYPE_GROUP && field.GetTypeName() == exp { + d.group = true + break + } + } + } + + d.ext = make([]*ExtensionDescriptor, len(desc.Extension)) + for i, field := range desc.Extension { + d.ext[i] = &ExtensionDescriptor{common{file}, field, d} + } + + return d +} + +// Return a slice of all the Descriptors defined within this file +func wrapDescriptors(file *descriptor.FileDescriptorProto) []*Descriptor { + sl := make([]*Descriptor, 0, len(file.MessageType)+10) + for i, desc := range file.MessageType { + sl = wrapThisDescriptor(sl, desc, nil, file, i) + } + return sl +} + +// Wrap this Descriptor, recursively +func wrapThisDescriptor(sl []*Descriptor, desc *descriptor.DescriptorProto, parent *Descriptor, file *descriptor.FileDescriptorProto, index int) []*Descriptor { + sl = append(sl, newDescriptor(desc, parent, file, index)) + me := sl[len(sl)-1] + for i, nested := range desc.NestedType { + sl = wrapThisDescriptor(sl, nested, me, file, i) + } + return sl +} + +// Construct the EnumDescriptor +func newEnumDescriptor(desc *descriptor.EnumDescriptorProto, parent *Descriptor, file *descriptor.FileDescriptorProto, index int) *EnumDescriptor { + ed := &EnumDescriptor{ + common: common{file}, + EnumDescriptorProto: desc, + parent: parent, + index: index, + } + if parent == nil { + ed.path = fmt.Sprintf("%d,%d", enumPath, index) + } else { + ed.path = fmt.Sprintf("%s,%d,%d", parent.path, messageEnumPath, index) + } + return ed +} + +// Return a slice of all the EnumDescriptors defined within this file +func wrapEnumDescriptors(file *descriptor.FileDescriptorProto, descs []*Descriptor) []*EnumDescriptor { + sl := make([]*EnumDescriptor, 0, len(file.EnumType)+10) + // Top-level enums. + for i, enum := range file.EnumType { + sl = append(sl, newEnumDescriptor(enum, nil, file, i)) + } + // Enums within messages. Enums within embedded messages appear in the outer-most message. + for _, nested := range descs { + for i, enum := range nested.EnumType { + sl = append(sl, newEnumDescriptor(enum, nested, file, i)) + } + } + return sl +} + +// Return a slice of all the top-level ExtensionDescriptors defined within this file. +func wrapExtensions(file *descriptor.FileDescriptorProto) []*ExtensionDescriptor { + sl := make([]*ExtensionDescriptor, len(file.Extension)) + for i, field := range file.Extension { + sl[i] = &ExtensionDescriptor{common{file}, field, nil} + } + return sl +} + +// Return a slice of all the types that are publicly imported into this file. +func wrapImported(file *descriptor.FileDescriptorProto, g *Generator) (sl []*ImportedDescriptor) { + for _, index := range file.PublicDependency { + df := g.fileByName(file.Dependency[index]) + for _, d := range df.desc { + sl = append(sl, &ImportedDescriptor{common{file}, d}) + } + for _, e := range df.enum { + sl = append(sl, &ImportedDescriptor{common{file}, e}) + } + for _, ext := range df.ext { + sl = append(sl, &ImportedDescriptor{common{file}, ext}) + } + } + return +} + +func extractComments(file *FileDescriptor) { + file.comments = make(map[string]*descriptor.SourceCodeInfo_Location) + for _, loc := range file.GetSourceCodeInfo().GetLocation() { + if loc.LeadingComments == nil { + continue + } + var p []string + for _, n := range loc.Path { + p = append(p, strconv.Itoa(int(n))) + } + file.comments[strings.Join(p, ",")] = loc + } +} + +// BuildTypeNameMap builds the map from fully qualified type names to objects. +// The key names for the map come from the input data, which puts a period at the beginning. +// It should be called after SetPackageNames and before GenerateAllFiles. +func (g *Generator) BuildTypeNameMap() { + g.typeNameToObject = make(map[string]Object) + for _, f := range g.allFiles { + // The names in this loop are defined by the proto world, not us, so the + // package name may be empty. If so, the dotted package name of X will + // be ".X"; otherwise it will be ".pkg.X". + dottedPkg := "." + f.GetPackage() + if dottedPkg != "." { + dottedPkg += "." + } + for _, enum := range f.enum { + name := dottedPkg + dottedSlice(enum.TypeName()) + g.typeNameToObject[name] = enum + } + for _, desc := range f.desc { + name := dottedPkg + dottedSlice(desc.TypeName()) + g.typeNameToObject[name] = desc + } + } +} + +// ObjectNamed, given a fully-qualified input type name as it appears in the input data, +// returns the descriptor for the message or enum with that name. +func (g *Generator) ObjectNamed(typeName string) Object { + o, ok := g.typeNameToObject[typeName] + if !ok { + g.Fail("can't find object with type", typeName) + } + + // If the file of this object isn't a direct dependency of the current file, + // or in the current file, then this object has been publicly imported into + // a dependency of the current file. + // We should return the ImportedDescriptor object for it instead. + direct := *o.File().Name == *g.file.Name + if !direct { + for _, dep := range g.file.Dependency { + if *g.fileByName(dep).Name == *o.File().Name { + direct = true + break + } + } + } + if !direct { + found := false + Loop: + for _, dep := range g.file.Dependency { + df := g.fileByName(*g.fileByName(dep).Name) + for _, td := range df.imp { + if td.o == o { + // Found it! + o = td + found = true + break Loop + } + } + } + if !found { + log.Printf("protoc-gen-go: WARNING: failed finding publicly imported dependency for %v, used in %v", typeName, *g.file.Name) + } + } + + return o +} + +// P prints the arguments to the generated output. It handles strings and int32s, plus +// handling indirections because they may be *string, etc. +func (g *Generator) P(str ...interface{}) { + g.WriteString(g.indent) + for _, v := range str { + switch s := v.(type) { + case string: + g.WriteString(s) + case *string: + g.WriteString(*s) + case bool: + g.WriteString(fmt.Sprintf("%t", s)) + case *bool: + g.WriteString(fmt.Sprintf("%t", *s)) + case int: + g.WriteString(fmt.Sprintf("%d", s)) + case *int32: + g.WriteString(fmt.Sprintf("%d", *s)) + case *int64: + g.WriteString(fmt.Sprintf("%d", *s)) + case float64: + g.WriteString(fmt.Sprintf("%g", s)) + case *float64: + g.WriteString(fmt.Sprintf("%g", *s)) + default: + g.Fail(fmt.Sprintf("unknown type in printer: %T", v)) + } + } + g.WriteByte('\n') +} + +// addInitf stores the given statement to be printed inside the file's init function. +// The statement is given as a format specifier and arguments. +func (g *Generator) addInitf(stmt string, a ...interface{}) { + g.init = append(g.init, fmt.Sprintf(stmt, a...)) +} + +// In Indents the output one tab stop. +func (g *Generator) In() { g.indent += "\t" } + +// Out unindents the output one tab stop. +func (g *Generator) Out() { + if len(g.indent) > 0 { + g.indent = g.indent[1:] + } +} + +// GenerateAllFiles generates the output for all the files we're outputting. +func (g *Generator) GenerateAllFiles() { + // Initialize the plugins + for _, p := range plugins { + p.Init(g) + } + // Generate the output. The generator runs for every file, even the files + // that we don't generate output for, so that we can collate the full list + // of exported symbols to support public imports. + genFileMap := make(map[*FileDescriptor]bool, len(g.genFiles)) + for _, file := range g.genFiles { + genFileMap[file] = true + } + i := 0 + for _, file := range g.allFiles { + g.Reset() + g.generate(file) + if _, ok := genFileMap[file]; !ok { + continue + } + g.Response.File[i] = new(plugin.CodeGeneratorResponse_File) + g.Response.File[i].Name = proto.String(goFileName(*file.Name)) + g.Response.File[i].Content = proto.String(g.String()) + i++ + } +} + +// Run all the plugins associated with the file. +func (g *Generator) runPlugins(file *FileDescriptor) { + for _, p := range plugins { + p.Generate(file) + } +} + +// FileOf return the FileDescriptor for this FileDescriptorProto. +func (g *Generator) FileOf(fd *descriptor.FileDescriptorProto) *FileDescriptor { + for _, file := range g.allFiles { + if file.FileDescriptorProto == fd { + return file + } + } + g.Fail("could not find file in table:", fd.GetName()) + return nil +} + +// Fill the response protocol buffer with the generated output for all the files we're +// supposed to generate. +func (g *Generator) generate(file *FileDescriptor) { + g.file = g.FileOf(file.FileDescriptorProto) + g.usedPackages = make(map[string]bool) + + for _, td := range g.file.imp { + g.generateImported(td) + } + for _, enum := range g.file.enum { + g.generateEnum(enum) + } + for _, desc := range g.file.desc { + // Don't generate virtual messages for maps. + if desc.GetOptions().GetMapEntry() { + continue + } + g.generateMessage(desc) + } + for _, ext := range g.file.ext { + g.generateExtension(ext) + } + g.generateInitFunction() + + // Run the plugins before the imports so we know which imports are necessary. + g.runPlugins(file) + + // Generate header and imports last, though they appear first in the output. + rem := g.Buffer + g.Buffer = new(bytes.Buffer) + g.generateHeader() + g.generateImports() + g.Write(rem.Bytes()) + + // Reformat generated code. + fset := token.NewFileSet() + ast, err := parser.ParseFile(fset, "", g, parser.ParseComments) + if err != nil { + g.Fail("bad Go source code was generated:", err.Error()) + return + } + g.Reset() + err = (&printer.Config{Mode: printer.TabIndent | printer.UseSpaces, Tabwidth: 8}).Fprint(g, fset, ast) + if err != nil { + g.Fail("generated Go source code could not be reformatted:", err.Error()) + } +} + +// Generate the header, including package definition +func (g *Generator) generateHeader() { + g.P("// Code generated by protoc-gen-go.") + g.P("// source: ", g.file.Name) + g.P("// DO NOT EDIT!") + g.P() + + name := g.file.PackageName() + + if g.file.index == 0 { + // Generate package docs for the first file in the package. + g.P("/*") + g.P("Package ", name, " is a generated protocol buffer package.") + g.P() + if loc, ok := g.file.comments[strconv.Itoa(packagePath)]; ok { + // not using g.PrintComments because this is a /* */ comment block. + text := strings.TrimSuffix(loc.GetLeadingComments(), "\n") + for _, line := range strings.Split(text, "\n") { + line = strings.TrimPrefix(line, " ") + // ensure we don't escape from the block comment + line = strings.Replace(line, "*/", "* /", -1) + g.P(line) + } + g.P() + } + g.P("It is generated from these files:") + for _, f := range g.genFiles { + g.P("\t", f.Name) + } + g.P() + g.P("It has these top-level messages:") + for _, msg := range g.file.desc { + if msg.parent != nil { + continue + } + g.P("\t", CamelCaseSlice(msg.TypeName())) + } + g.P("*/") + } + + g.P("package ", name) + g.P() +} + +// PrintComments prints any comments from the source .proto file. +// The path is a comma-separated list of integers. +// See descriptor.proto for its format. +func (g *Generator) PrintComments(path string) { + if loc, ok := g.file.comments[path]; ok { + text := strings.TrimSuffix(loc.GetLeadingComments(), "\n") + for _, line := range strings.Split(text, "\n") { + g.P("// ", strings.TrimPrefix(line, " ")) + } + } +} + +func (g *Generator) fileByName(filename string) *FileDescriptor { + for _, fd := range g.allFiles { + if fd.GetName() == filename { + return fd + } + } + return nil +} + +// weak returns whether the ith import of the current file is a weak import. +func (g *Generator) weak(i int32) bool { + for _, j := range g.file.WeakDependency { + if j == i { + return true + } + } + return false +} + +// Generate the imports +func (g *Generator) generateImports() { + // We almost always need a proto import. Rather than computing when we + // do, which is tricky when there's a plugin, just import it and + // reference it later. The same argument applies to the math package, + // for handling bit patterns for floating-point numbers. + g.P("import " + g.Pkg["proto"] + " " + strconv.Quote(g.ImportPrefix+"github.com/golang/protobuf/proto")) + if !g.file.proto3 { + g.P("import " + g.Pkg["math"] + ` "math"`) + } + for i, s := range g.file.Dependency { + fd := g.fileByName(s) + // Do not import our own package. + if fd.PackageName() == g.packageName { + continue + } + filename := goFileName(s) + // By default, import path is the dirname of the Go filename. + importPath := path.Dir(filename) + if substitution, ok := g.ImportMap[s]; ok { + importPath = substitution + } + importPath = g.ImportPrefix + importPath + // Skip weak imports. + if g.weak(int32(i)) { + g.P("// skipping weak import ", fd.PackageName(), " ", strconv.Quote(importPath)) + continue + } + if _, ok := g.usedPackages[fd.PackageName()]; ok { + g.P("import ", fd.PackageName(), " ", strconv.Quote(importPath)) + } else { + // TODO: Re-enable this when we are more feature-complete. + // For instance, some protos use foreign field extensions, which we don't support. + // Until then, this is just annoying spam. + //log.Printf("protoc-gen-go: discarding unused import from %v: %v", *g.file.Name, s) + g.P("// discarding unused import ", fd.PackageName(), " ", strconv.Quote(importPath)) + } + } + g.P() + // TODO: may need to worry about uniqueness across plugins + for _, p := range plugins { + p.GenerateImports(g.file) + g.P() + } + g.P("// Reference imports to suppress errors if they are not otherwise used.") + g.P("var _ = ", g.Pkg["proto"], ".Marshal") + if !g.file.proto3 { + g.P("var _ = ", g.Pkg["math"], ".Inf") + } + g.P() +} + +func (g *Generator) generateImported(id *ImportedDescriptor) { + // Don't generate public import symbols for files that we are generating + // code for, since those symbols will already be in this package. + // We can't simply avoid creating the ImportedDescriptor objects, + // because g.genFiles isn't populated at that stage. + tn := id.TypeName() + sn := tn[len(tn)-1] + df := g.FileOf(id.o.File()) + filename := *df.Name + for _, fd := range g.genFiles { + if *fd.Name == filename { + g.P("// Ignoring public import of ", sn, " from ", filename) + g.P() + return + } + } + g.P("// ", sn, " from public import ", filename) + g.usedPackages[df.PackageName()] = true + + for _, sym := range df.exported[id.o] { + sym.GenerateAlias(g, df.PackageName()) + } + + g.P() +} + +// Generate the enum definitions for this EnumDescriptor. +func (g *Generator) generateEnum(enum *EnumDescriptor) { + // The full type name + typeName := enum.TypeName() + // The full type name, CamelCased. + ccTypeName := CamelCaseSlice(typeName) + ccPrefix := enum.prefix() + + g.PrintComments(enum.path) + g.P("type ", ccTypeName, " int32") + g.file.addExport(enum, enumSymbol{ccTypeName, enum.proto3()}) + g.P("const (") + g.In() + for i, e := range enum.Value { + g.PrintComments(fmt.Sprintf("%s,%d,%d", enum.path, enumValuePath, i)) + + name := ccPrefix + *e.Name + g.P(name, " ", ccTypeName, " = ", e.Number) + g.file.addExport(enum, constOrVarSymbol{name, "const", ccTypeName}) + } + g.Out() + g.P(")") + g.P("var ", ccTypeName, "_name = map[int32]string{") + g.In() + generated := make(map[int32]bool) // avoid duplicate values + for _, e := range enum.Value { + duplicate := "" + if _, present := generated[*e.Number]; present { + duplicate = "// Duplicate value: " + } + g.P(duplicate, e.Number, ": ", strconv.Quote(*e.Name), ",") + generated[*e.Number] = true + } + g.Out() + g.P("}") + g.P("var ", ccTypeName, "_value = map[string]int32{") + g.In() + for _, e := range enum.Value { + g.P(strconv.Quote(*e.Name), ": ", e.Number, ",") + } + g.Out() + g.P("}") + + if !enum.proto3() { + g.P("func (x ", ccTypeName, ") Enum() *", ccTypeName, " {") + g.In() + g.P("p := new(", ccTypeName, ")") + g.P("*p = x") + g.P("return p") + g.Out() + g.P("}") + } + + g.P("func (x ", ccTypeName, ") String() string {") + g.In() + g.P("return ", g.Pkg["proto"], ".EnumName(", ccTypeName, "_name, int32(x))") + g.Out() + g.P("}") + + if !enum.proto3() { + g.P("func (x *", ccTypeName, ") UnmarshalJSON(data []byte) error {") + g.In() + g.P("value, err := ", g.Pkg["proto"], ".UnmarshalJSONEnum(", ccTypeName, `_value, data, "`, ccTypeName, `")`) + g.P("if err != nil {") + g.In() + g.P("return err") + g.Out() + g.P("}") + g.P("*x = ", ccTypeName, "(value)") + g.P("return nil") + g.Out() + g.P("}") + } + + g.P() +} + +// The tag is a string like "varint,2,opt,name=fieldname,def=7" that +// identifies details of the field for the protocol buffer marshaling and unmarshaling +// code. The fields are: +// wire encoding +// protocol tag number +// opt,req,rep for optional, required, or repeated +// packed whether the encoding is "packed" (optional; repeated primitives only) +// name= the original declared name +// enum= the name of the enum type if it is an enum-typed field. +// proto3 if this field is in a proto3 message +// def= string representation of the default value, if any. +// The default value must be in a representation that can be used at run-time +// to generate the default value. Thus bools become 0 and 1, for instance. +func (g *Generator) goTag(message *Descriptor, field *descriptor.FieldDescriptorProto, wiretype string) string { + optrepreq := "" + switch { + case isOptional(field): + optrepreq = "opt" + case isRequired(field): + optrepreq = "req" + case isRepeated(field): + optrepreq = "rep" + } + var defaultValue string + if dv := field.DefaultValue; dv != nil { // set means an explicit default + defaultValue = *dv + // Some types need tweaking. + switch *field.Type { + case descriptor.FieldDescriptorProto_TYPE_BOOL: + if defaultValue == "true" { + defaultValue = "1" + } else { + defaultValue = "0" + } + case descriptor.FieldDescriptorProto_TYPE_STRING, + descriptor.FieldDescriptorProto_TYPE_BYTES: + // Nothing to do. Quoting is done for the whole tag. + case descriptor.FieldDescriptorProto_TYPE_ENUM: + // For enums we need to provide the integer constant. + obj := g.ObjectNamed(field.GetTypeName()) + if id, ok := obj.(*ImportedDescriptor); ok { + // It is an enum that was publicly imported. + // We need the underlying type. + obj = id.o + } + enum, ok := obj.(*EnumDescriptor) + if !ok { + log.Printf("obj is a %T", obj) + if id, ok := obj.(*ImportedDescriptor); ok { + log.Printf("id.o is a %T", id.o) + } + g.Fail("unknown enum type", CamelCaseSlice(obj.TypeName())) + } + defaultValue = enum.integerValueAsString(defaultValue) + } + defaultValue = ",def=" + defaultValue + } + enum := "" + if *field.Type == descriptor.FieldDescriptorProto_TYPE_ENUM { + // We avoid using obj.PackageName(), because we want to use the + // original (proto-world) package name. + obj := g.ObjectNamed(field.GetTypeName()) + if id, ok := obj.(*ImportedDescriptor); ok { + obj = id.o + } + enum = ",enum=" + if pkg := obj.File().GetPackage(); pkg != "" { + enum += pkg + "." + } + enum += CamelCaseSlice(obj.TypeName()) + } + packed := "" + if field.Options != nil && field.Options.GetPacked() { + packed = ",packed" + } + fieldName := field.GetName() + name := fieldName + if *field.Type == descriptor.FieldDescriptorProto_TYPE_GROUP { + // We must use the type name for groups instead of + // the field name to preserve capitalization. + // type_name in FieldDescriptorProto is fully-qualified, + // but we only want the local part. + name = *field.TypeName + if i := strings.LastIndex(name, "."); i >= 0 { + name = name[i+1:] + } + } + if name == CamelCase(fieldName) { + name = "" + } else { + name = ",name=" + name + } + if message.proto3() { + // We only need the extra tag for []byte fields; + // no need to add noise for the others. + if *field.Type == descriptor.FieldDescriptorProto_TYPE_BYTES { + name += ",proto3" + } + } + return strconv.Quote(fmt.Sprintf("%s,%d,%s%s%s%s%s", + wiretype, + field.GetNumber(), + optrepreq, + packed, + name, + enum, + defaultValue)) +} + +func needsStar(typ descriptor.FieldDescriptorProto_Type) bool { + switch typ { + case descriptor.FieldDescriptorProto_TYPE_GROUP: + return false + case descriptor.FieldDescriptorProto_TYPE_MESSAGE: + return false + case descriptor.FieldDescriptorProto_TYPE_BYTES: + return false + } + return true +} + +// TypeName is the printed name appropriate for an item. If the object is in the current file, +// TypeName drops the package name and underscores the rest. +// Otherwise the object is from another package; and the result is the underscored +// package name followed by the item name. +// The result always has an initial capital. +func (g *Generator) TypeName(obj Object) string { + return g.DefaultPackageName(obj) + CamelCaseSlice(obj.TypeName()) +} + +// TypeNameWithPackage is like TypeName, but always includes the package +// name even if the object is in our own package. +func (g *Generator) TypeNameWithPackage(obj Object) string { + return obj.PackageName() + CamelCaseSlice(obj.TypeName()) +} + +// GoType returns a string representing the type name, and the wire type +func (g *Generator) GoType(message *Descriptor, field *descriptor.FieldDescriptorProto) (typ string, wire string) { + // TODO: Options. + switch *field.Type { + case descriptor.FieldDescriptorProto_TYPE_DOUBLE: + typ, wire = "float64", "fixed64" + case descriptor.FieldDescriptorProto_TYPE_FLOAT: + typ, wire = "float32", "fixed32" + case descriptor.FieldDescriptorProto_TYPE_INT64: + typ, wire = "int64", "varint" + case descriptor.FieldDescriptorProto_TYPE_UINT64: + typ, wire = "uint64", "varint" + case descriptor.FieldDescriptorProto_TYPE_INT32: + typ, wire = "int32", "varint" + case descriptor.FieldDescriptorProto_TYPE_UINT32: + typ, wire = "uint32", "varint" + case descriptor.FieldDescriptorProto_TYPE_FIXED64: + typ, wire = "uint64", "fixed64" + case descriptor.FieldDescriptorProto_TYPE_FIXED32: + typ, wire = "uint32", "fixed32" + case descriptor.FieldDescriptorProto_TYPE_BOOL: + typ, wire = "bool", "varint" + case descriptor.FieldDescriptorProto_TYPE_STRING: + typ, wire = "string", "bytes" + case descriptor.FieldDescriptorProto_TYPE_GROUP: + desc := g.ObjectNamed(field.GetTypeName()) + typ, wire = "*"+g.TypeName(desc), "group" + case descriptor.FieldDescriptorProto_TYPE_MESSAGE: + desc := g.ObjectNamed(field.GetTypeName()) + typ, wire = "*"+g.TypeName(desc), "bytes" + case descriptor.FieldDescriptorProto_TYPE_BYTES: + typ, wire = "[]byte", "bytes" + case descriptor.FieldDescriptorProto_TYPE_ENUM: + desc := g.ObjectNamed(field.GetTypeName()) + typ, wire = g.TypeName(desc), "varint" + case descriptor.FieldDescriptorProto_TYPE_SFIXED32: + typ, wire = "int32", "fixed32" + case descriptor.FieldDescriptorProto_TYPE_SFIXED64: + typ, wire = "int64", "fixed64" + case descriptor.FieldDescriptorProto_TYPE_SINT32: + typ, wire = "int32", "zigzag32" + case descriptor.FieldDescriptorProto_TYPE_SINT64: + typ, wire = "int64", "zigzag64" + default: + g.Fail("unknown type for", field.GetName()) + } + if isRepeated(field) { + typ = "[]" + typ + } else if message != nil && message.proto3() { + return + } else if needsStar(*field.Type) { + typ = "*" + typ + } + return +} + +func (g *Generator) RecordTypeUse(t string) { + if obj, ok := g.typeNameToObject[t]; ok { + // Call ObjectNamed to get the true object to record the use. + obj = g.ObjectNamed(t) + g.usedPackages[obj.PackageName()] = true + } +} + +// Method names that may be generated. Fields with these names get an +// underscore appended. +var methodNames = [...]string{ + "Reset", + "String", + "ProtoMessage", + "Marshal", + "Unmarshal", + "ExtensionRangeArray", + "ExtensionMap", + "Descriptor", +} + +// Generate the type and default constant definitions for this Descriptor. +func (g *Generator) generateMessage(message *Descriptor) { + // The full type name + typeName := message.TypeName() + // The full type name, CamelCased. + ccTypeName := CamelCaseSlice(typeName) + + usedNames := make(map[string]bool) + for _, n := range methodNames { + usedNames[n] = true + } + fieldNames := make(map[*descriptor.FieldDescriptorProto]string) + fieldGetterNames := make(map[*descriptor.FieldDescriptorProto]string) + mapFieldTypes := make(map[*descriptor.FieldDescriptorProto]string) + + g.PrintComments(message.path) + g.P("type ", ccTypeName, " struct {") + g.In() + + for i, field := range message.Field { + g.PrintComments(fmt.Sprintf("%s,%d,%d", message.path, messageFieldPath, i)) + + fieldName := CamelCase(*field.Name) + for usedNames[fieldName] { + fieldName += "_" + } + fieldGetterName := fieldName + usedNames[fieldName] = true + typename, wiretype := g.GoType(message, field) + jsonName := *field.Name + tag := fmt.Sprintf("protobuf:%s json:%q", g.goTag(message, field, wiretype), jsonName+",omitempty") + + if *field.Type == descriptor.FieldDescriptorProto_TYPE_MESSAGE { + desc := g.ObjectNamed(field.GetTypeName()) + if d, ok := desc.(*Descriptor); ok && d.GetOptions().GetMapEntry() { + // Figure out the Go types and tags for the key and value types. + keyField, valField := d.Field[0], d.Field[1] + keyType, keyWire := g.GoType(d, keyField) + valType, valWire := g.GoType(d, valField) + keyTag, valTag := g.goTag(d, keyField, keyWire), g.goTag(d, valField, valWire) + + // We don't use stars, except for message-typed values. + // Message and enum types are the only two possibly foreign types used in maps, + // so record their use. They are not permitted as map keys. + keyType = strings.TrimPrefix(keyType, "*") + switch *valField.Type { + case descriptor.FieldDescriptorProto_TYPE_ENUM: + valType = strings.TrimPrefix(valType, "*") + g.RecordTypeUse(valField.GetTypeName()) + case descriptor.FieldDescriptorProto_TYPE_MESSAGE: + g.RecordTypeUse(valField.GetTypeName()) + default: + valType = strings.TrimPrefix(valType, "*") + } + + typename = fmt.Sprintf("map[%s]%s", keyType, valType) + mapFieldTypes[field] = typename // record for the getter generation + + tag += fmt.Sprintf(" protobuf_key:%s protobuf_val:%s", keyTag, valTag) + } + } + + fieldNames[field] = fieldName + fieldGetterNames[field] = fieldGetterName + g.P(fieldName, "\t", typename, "\t`", tag, "`") + g.RecordTypeUse(field.GetTypeName()) + } + if len(message.ExtensionRange) > 0 { + g.P("XXX_extensions\t\tmap[int32]", g.Pkg["proto"], ".Extension `json:\"-\"`") + } + if !message.proto3() { + g.P("XXX_unrecognized\t[]byte `json:\"-\"`") + } + g.Out() + g.P("}") + + // Reset, String and ProtoMessage methods. + g.P("func (m *", ccTypeName, ") Reset() { *m = ", ccTypeName, "{} }") + g.P("func (m *", ccTypeName, ") String() string { return ", g.Pkg["proto"], ".CompactTextString(m) }") + g.P("func (*", ccTypeName, ") ProtoMessage() {}") + + // Extension support methods + var hasExtensions, isMessageSet bool + if len(message.ExtensionRange) > 0 { + hasExtensions = true + // message_set_wire_format only makes sense when extensions are defined. + if opts := message.Options; opts != nil && opts.GetMessageSetWireFormat() { + isMessageSet = true + g.P() + g.P("func (m *", ccTypeName, ") Marshal() ([]byte, error) {") + g.In() + g.P("return ", g.Pkg["proto"], ".MarshalMessageSet(m.ExtensionMap())") + g.Out() + g.P("}") + g.P("func (m *", ccTypeName, ") Unmarshal(buf []byte) error {") + g.In() + g.P("return ", g.Pkg["proto"], ".UnmarshalMessageSet(buf, m.ExtensionMap())") + g.Out() + g.P("}") + g.P("func (m *", ccTypeName, ") MarshalJSON() ([]byte, error) {") + g.In() + g.P("return ", g.Pkg["proto"], ".MarshalMessageSetJSON(m.XXX_extensions)") + g.Out() + g.P("}") + g.P("func (m *", ccTypeName, ") UnmarshalJSON(buf []byte) error {") + g.In() + g.P("return ", g.Pkg["proto"], ".UnmarshalMessageSetJSON(buf, m.XXX_extensions)") + g.Out() + g.P("}") + g.P("// ensure ", ccTypeName, " satisfies proto.Marshaler and proto.Unmarshaler") + g.P("var _ ", g.Pkg["proto"], ".Marshaler = (*", ccTypeName, ")(nil)") + g.P("var _ ", g.Pkg["proto"], ".Unmarshaler = (*", ccTypeName, ")(nil)") + } + + g.P() + g.P("var extRange_", ccTypeName, " = []", g.Pkg["proto"], ".ExtensionRange{") + g.In() + for _, r := range message.ExtensionRange { + end := fmt.Sprint(*r.End - 1) // make range inclusive on both ends + g.P("{", r.Start, ", ", end, "},") + } + g.Out() + g.P("}") + g.P("func (*", ccTypeName, ") ExtensionRangeArray() []", g.Pkg["proto"], ".ExtensionRange {") + g.In() + g.P("return extRange_", ccTypeName) + g.Out() + g.P("}") + g.P("func (m *", ccTypeName, ") ExtensionMap() map[int32]", g.Pkg["proto"], ".Extension {") + g.In() + g.P("if m.XXX_extensions == nil {") + g.In() + g.P("m.XXX_extensions = make(map[int32]", g.Pkg["proto"], ".Extension)") + g.Out() + g.P("}") + g.P("return m.XXX_extensions") + g.Out() + g.P("}") + } + + // Default constants + defNames := make(map[*descriptor.FieldDescriptorProto]string) + for _, field := range message.Field { + def := field.GetDefaultValue() + if def == "" { + continue + } + fieldname := "Default_" + ccTypeName + "_" + CamelCase(*field.Name) + defNames[field] = fieldname + typename, _ := g.GoType(message, field) + if typename[0] == '*' { + typename = typename[1:] + } + kind := "const " + switch { + case typename == "bool": + case typename == "string": + def = strconv.Quote(def) + case typename == "[]byte": + def = "[]byte(" + strconv.Quote(def) + ")" + kind = "var " + case def == "inf", def == "-inf", def == "nan": + // These names are known to, and defined by, the protocol language. + switch def { + case "inf": + def = "math.Inf(1)" + case "-inf": + def = "math.Inf(-1)" + case "nan": + def = "math.NaN()" + } + if *field.Type == descriptor.FieldDescriptorProto_TYPE_FLOAT { + def = "float32(" + def + ")" + } + kind = "var " + case *field.Type == descriptor.FieldDescriptorProto_TYPE_ENUM: + // Must be an enum. Need to construct the prefixed name. + obj := g.ObjectNamed(field.GetTypeName()) + var enum *EnumDescriptor + if id, ok := obj.(*ImportedDescriptor); ok { + // The enum type has been publicly imported. + enum, _ = id.o.(*EnumDescriptor) + } else { + enum, _ = obj.(*EnumDescriptor) + } + if enum == nil { + log.Printf("don't know how to generate constant for %s", fieldname) + continue + } + def = g.DefaultPackageName(obj) + enum.prefix() + def + } + g.P(kind, fieldname, " ", typename, " = ", def) + g.file.addExport(message, constOrVarSymbol{fieldname, kind, ""}) + } + g.P() + + // Field getters + var getters []getterSymbol + for _, field := range message.Field { + fname := fieldNames[field] + typename, _ := g.GoType(message, field) + if t, ok := mapFieldTypes[field]; ok { + typename = t + } + mname := "Get" + fieldGetterNames[field] + star := "" + if needsStar(*field.Type) && typename[0] == '*' { + typename = typename[1:] + star = "*" + } + + // In proto3, only generate getters for message fields. + if message.proto3() && *field.Type != descriptor.FieldDescriptorProto_TYPE_MESSAGE { + continue + } + + // Only export getter symbols for basic types, + // and for messages and enums in the same package. + // Groups are not exported. + // Foreign types can't be hoisted through a public import because + // the importer may not already be importing the defining .proto. + // As an example, imagine we have an import tree like this: + // A.proto -> B.proto -> C.proto + // If A publicly imports B, we need to generate the getters from B in A's output, + // but if one such getter returns something from C then we cannot do that + // because A is not importing C already. + var getter, genType bool + switch *field.Type { + case descriptor.FieldDescriptorProto_TYPE_GROUP: + getter = false + case descriptor.FieldDescriptorProto_TYPE_MESSAGE, descriptor.FieldDescriptorProto_TYPE_ENUM: + // Only export getter if its return type is in this package. + getter = g.ObjectNamed(field.GetTypeName()).PackageName() == message.PackageName() + genType = true + default: + getter = true + } + if getter { + getters = append(getters, getterSymbol{ + name: mname, + typ: typename, + typeName: field.GetTypeName(), + genType: genType, + }) + } + + g.P("func (m *", ccTypeName, ") "+mname+"() "+typename+" {") + g.In() + def, hasDef := defNames[field] + typeDefaultIsNil := false // whether this field type's default value is a literal nil unless specified + switch *field.Type { + case descriptor.FieldDescriptorProto_TYPE_BYTES: + typeDefaultIsNil = !hasDef + case descriptor.FieldDescriptorProto_TYPE_GROUP, descriptor.FieldDescriptorProto_TYPE_MESSAGE: + typeDefaultIsNil = true + } + if isRepeated(field) { + typeDefaultIsNil = true + } + if typeDefaultIsNil { + // A bytes field with no explicit default needs less generated code, + // as does a message or group field, or a repeated field. + g.P("if m != nil {") + g.In() + g.P("return m." + fname) + g.Out() + g.P("}") + g.P("return nil") + g.Out() + g.P("}") + g.P() + continue + } + g.P("if m != nil && m." + fname + " != nil {") + g.In() + g.P("return " + star + "m." + fname) + g.Out() + g.P("}") + if hasDef { + if *field.Type != descriptor.FieldDescriptorProto_TYPE_BYTES { + g.P("return " + def) + } else { + // The default is a []byte var. + // Make a copy when returning it to be safe. + g.P("return append([]byte(nil), ", def, "...)") + } + } else { + switch *field.Type { + case descriptor.FieldDescriptorProto_TYPE_BOOL: + g.P("return false") + case descriptor.FieldDescriptorProto_TYPE_STRING: + g.P(`return ""`) + case descriptor.FieldDescriptorProto_TYPE_ENUM: + // The default default for an enum is the first value in the enum, + // not zero. + obj := g.ObjectNamed(field.GetTypeName()) + var enum *EnumDescriptor + if id, ok := obj.(*ImportedDescriptor); ok { + // The enum type has been publicly imported. + enum, _ = id.o.(*EnumDescriptor) + } else { + enum, _ = obj.(*EnumDescriptor) + } + if enum == nil { + log.Printf("don't know how to generate getter for %s", field.GetName()) + continue + } + if len(enum.Value) == 0 { + g.P("return 0 // empty enum") + } else { + first := enum.Value[0].GetName() + g.P("return ", g.DefaultPackageName(obj)+enum.prefix()+first) + } + default: + g.P("return 0") + } + } + g.Out() + g.P("}") + g.P() + } + + if !message.group { + ms := &messageSymbol{sym: ccTypeName, hasExtensions: hasExtensions, isMessageSet: isMessageSet, getters: getters} + g.file.addExport(message, ms) + } + + for _, ext := range message.ext { + g.generateExtension(ext) + } + +} + +func (g *Generator) generateExtension(ext *ExtensionDescriptor) { + ccTypeName := ext.DescName() + + extObj := g.ObjectNamed(*ext.Extendee) + var extDesc *Descriptor + if id, ok := extObj.(*ImportedDescriptor); ok { + // This is extending a publicly imported message. + // We need the underlying type for goTag. + extDesc = id.o.(*Descriptor) + } else { + extDesc = extObj.(*Descriptor) + } + extendedType := "*" + g.TypeName(extObj) // always use the original + field := ext.FieldDescriptorProto + fieldType, wireType := g.GoType(ext.parent, field) + tag := g.goTag(extDesc, field, wireType) + g.RecordTypeUse(*ext.Extendee) + if n := ext.FieldDescriptorProto.TypeName; n != nil { + // foreign extension type + g.RecordTypeUse(*n) + } + + typeName := ext.TypeName() + + // Special case for proto2 message sets: If this extension is extending + // proto2_bridge.MessageSet, and its final name component is "message_set_extension", + // then drop that last component. + mset := false + if extendedType == "*proto2_bridge.MessageSet" && typeName[len(typeName)-1] == "message_set_extension" { + typeName = typeName[:len(typeName)-1] + mset = true + } + + // For text formatting, the package must be exactly what the .proto file declares, + // ignoring overrides such as the go_package option, and with no dot/underscore mapping. + extName := strings.Join(typeName, ".") + if g.file.Package != nil { + extName = *g.file.Package + "." + extName + } + + g.P("var ", ccTypeName, " = &", g.Pkg["proto"], ".ExtensionDesc{") + g.In() + g.P("ExtendedType: (", extendedType, ")(nil),") + g.P("ExtensionType: (", fieldType, ")(nil),") + g.P("Field: ", field.Number, ",") + g.P(`Name: "`, extName, `",`) + g.P("Tag: ", tag, ",") + + g.Out() + g.P("}") + g.P() + + if mset { + // Generate a bit more code to register with message_set.go. + g.addInitf("%s.RegisterMessageSetType((%s)(nil), %d, %q)", g.Pkg["proto"], fieldType, *field.Number, extName) + } + + g.file.addExport(ext, constOrVarSymbol{ccTypeName, "var", ""}) +} + +func (g *Generator) generateInitFunction() { + for _, enum := range g.file.enum { + g.generateEnumRegistration(enum) + } + for _, d := range g.file.desc { + for _, ext := range d.ext { + g.generateExtensionRegistration(ext) + } + } + for _, ext := range g.file.ext { + g.generateExtensionRegistration(ext) + } + if len(g.init) == 0 { + return + } + g.P("func init() {") + g.In() + for _, l := range g.init { + g.P(l) + } + g.Out() + g.P("}") + g.init = nil +} + +func (g *Generator) generateEnumRegistration(enum *EnumDescriptor) { + // // We always print the full (proto-world) package name here. + pkg := enum.File().GetPackage() + if pkg != "" { + pkg += "." + } + // The full type name + typeName := enum.TypeName() + // The full type name, CamelCased. + ccTypeName := CamelCaseSlice(typeName) + g.addInitf("%s.RegisterEnum(%q, %[3]s_name, %[3]s_value)", g.Pkg["proto"], pkg+ccTypeName, ccTypeName) +} + +func (g *Generator) generateExtensionRegistration(ext *ExtensionDescriptor) { + g.addInitf("%s.RegisterExtension(%s)", g.Pkg["proto"], ext.DescName()) +} + +// And now lots of helper functions. + +// Is c an ASCII lower-case letter? +func isASCIILower(c byte) bool { + return 'a' <= c && c <= 'z' +} + +// Is c an ASCII digit? +func isASCIIDigit(c byte) bool { + return '0' <= c && c <= '9' +} + +// CamelCase returns the CamelCased name. +// If there is an interior underscore followed by a lower case letter, +// drop the underscore and convert the letter to upper case. +// There is a remote possibility of this rewrite causing a name collision, +// but it's so remote we're prepared to pretend it's nonexistent - since the +// C++ generator lowercases names, it's extremely unlikely to have two fields +// with different capitalizations. +// In short, _my_field_name_2 becomes XMyFieldName_2. +func CamelCase(s string) string { + if s == "" { + return "" + } + t := make([]byte, 0, 32) + i := 0 + if s[0] == '_' { + // Need a capital letter; drop the '_'. + t = append(t, 'X') + i++ + } + // Invariant: if the next letter is lower case, it must be converted + // to upper case. + // That is, we process a word at a time, where words are marked by _ or + // upper case letter. Digits are treated as words. + for ; i < len(s); i++ { + c := s[i] + if c == '_' && i+1 < len(s) && isASCIILower(s[i+1]) { + continue // Skip the underscore in s. + } + if isASCIIDigit(c) { + t = append(t, c) + continue + } + // Assume we have a letter now - if not, it's a bogus identifier. + // The next word is a sequence of characters that must start upper case. + if isASCIILower(c) { + c ^= ' ' // Make it a capital letter. + } + t = append(t, c) // Guaranteed not lower case. + // Accept lower case sequence that follows. + for i+1 < len(s) && isASCIILower(s[i+1]) { + i++ + t = append(t, s[i]) + } + } + return string(t) +} + +// CamelCaseSlice is like CamelCase, but the argument is a slice of strings to +// be joined with "_". +func CamelCaseSlice(elem []string) string { return CamelCase(strings.Join(elem, "_")) } + +// dottedSlice turns a sliced name into a dotted name. +func dottedSlice(elem []string) string { return strings.Join(elem, ".") } + +// Given a .proto file name, return the output name for the generated Go program. +func goFileName(name string) string { + ext := path.Ext(name) + if ext == ".proto" || ext == ".protodevel" { + name = name[0 : len(name)-len(ext)] + } + return name + ".pb.go" +} + +// Is this field optional? +func isOptional(field *descriptor.FieldDescriptorProto) bool { + return field.Label != nil && *field.Label == descriptor.FieldDescriptorProto_LABEL_OPTIONAL +} + +// Is this field required? +func isRequired(field *descriptor.FieldDescriptorProto) bool { + return field.Label != nil && *field.Label == descriptor.FieldDescriptorProto_LABEL_REQUIRED +} + +// Is this field repeated? +func isRepeated(field *descriptor.FieldDescriptorProto) bool { + return field.Label != nil && *field.Label == descriptor.FieldDescriptorProto_LABEL_REPEATED +} + +// badToUnderscore is the mapping function used to generate Go names from package names, +// which can be dotted in the input .proto file. It replaces non-identifier characters such as +// dot or dash with underscore. +func badToUnderscore(r rune) rune { + if unicode.IsLetter(r) || unicode.IsDigit(r) || r == '_' { + return r + } + return '_' +} + +// baseName returns the last path element of the name, with the last dotted suffix removed. +func baseName(name string) string { + // First, find the last element + if i := strings.LastIndex(name, "/"); i >= 0 { + name = name[i+1:] + } + // Now drop the suffix + if i := strings.LastIndex(name, "."); i >= 0 { + name = name[0:i] + } + return name +} + +// The SourceCodeInfo message describes the location of elements of a parsed +// .proto file by way of a "path", which is a sequence of integers that +// describe the route from a FileDescriptorProto to the relevant submessage. +// The path alternates between a field number of a repeated field, and an index +// into that repeated field. The constants below define the field numbers that +// are used. +// +// See descriptor.proto for more information about this. +const ( + // tag numbers in FileDescriptorProto + packagePath = 2 // package + messagePath = 4 // message_type + enumPath = 5 // enum_type + // tag numbers in DescriptorProto + messageFieldPath = 2 // field + messageMessagePath = 3 // nested_type + messageEnumPath = 4 // enum_type + // tag numbers in EnumDescriptorProto + enumValuePath = 2 // value +) diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/generator/name_test.go b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/generator/name_test.go new file mode 100644 index 000000000..f926918e4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/generator/name_test.go @@ -0,0 +1,56 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2013 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +package generator + +import ( + "testing" +) + +func TestCamelCase(t *testing.T) { + tests := []struct { + in, want string + }{ + {"one", "One"}, + {"one_two", "OneTwo"}, + {"_my_field_name_2", "XMyFieldName_2"}, + {"Something_Capped", "Something_Capped"}, + {"my_Name", "My_Name"}, + {"OneTwo", "OneTwo"}, + {"_", "X"}, + {"_a_", "XA_"}, + } + for _, tc := range tests { + if got := CamelCase(tc.in); got != tc.want { + t.Errorf("CamelCase(%q) = %q, want %q", tc.in, got, tc.want) + } + } +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/internal/grpc/grpc.go b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/internal/grpc/grpc.go new file mode 100644 index 000000000..3029bb397 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/internal/grpc/grpc.go @@ -0,0 +1,436 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2015 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +// Package grpc outputs gRPC service descriptions in Go code. +// It runs as a plugin for the Go protocol buffer compiler plugin. +// It is linked in to protoc-gen-go. +package grpc + +import ( + "fmt" + "path" + "strconv" + "strings" + + pb "github.com/golang/protobuf/protoc-gen-go/descriptor" + "github.com/golang/protobuf/protoc-gen-go/generator" +) + +// Paths for packages used by code generated in this file, +// relative to the import_prefix of the generator.Generator. +const ( + contextPkgPath = "golang.org/x/net/context" + grpcPkgPath = "google.golang.org/grpc" +) + +func init() { + generator.RegisterPlugin(new(grpc)) +} + +// grpc is an implementation of the Go protocol buffer compiler's +// plugin architecture. It generates bindings for gRPC support. +type grpc struct { + gen *generator.Generator +} + +// Name returns the name of this plugin, "grpc". +func (g *grpc) Name() string { + return "grpc" +} + +// The names for packages imported in the generated code. +// They may vary from the final path component of the import path +// if the name is used by other packages. +var ( + contextPkg string + grpcPkg string +) + +// Init initializes the plugin. +func (g *grpc) Init(gen *generator.Generator) { + g.gen = gen + contextPkg = generator.RegisterUniquePackageName("context", nil) + grpcPkg = generator.RegisterUniquePackageName("grpc", nil) +} + +// Given a type name defined in a .proto, return its object. +// Also record that we're using it, to guarantee the associated import. +func (g *grpc) objectNamed(name string) generator.Object { + g.gen.RecordTypeUse(name) + return g.gen.ObjectNamed(name) +} + +// Given a type name defined in a .proto, return its name as we will print it. +func (g *grpc) typeName(str string) string { + return g.gen.TypeName(g.objectNamed(str)) +} + +// P forwards to g.gen.P. +func (g *grpc) P(args ...interface{}) { g.gen.P(args...) } + +// Generate generates code for the services in the given file. +func (g *grpc) Generate(file *generator.FileDescriptor) { + for i, service := range file.FileDescriptorProto.Service { + g.generateService(file, service, i) + } +} + +// GenerateImports generates the import declaration for this file. +func (g *grpc) GenerateImports(file *generator.FileDescriptor) { + if len(file.FileDescriptorProto.Service) == 0 { + return + } + g.P("import (") + g.P(contextPkg, " ", strconv.Quote(path.Join(g.gen.ImportPrefix, contextPkgPath))) + g.P(grpcPkg, " ", strconv.Quote(path.Join(g.gen.ImportPrefix, grpcPkgPath))) + g.P(")") + g.P() + g.P("// Reference imports to suppress errors if they are not otherwise used.") + g.P("var _ ", contextPkg, ".Context") + g.P("var _ ", grpcPkg, ".ClientConn") + g.P() +} + +// reservedClientName records whether a client name is reserved on the client side. +var reservedClientName = map[string]bool{ +// TODO: do we need any in gRPC? +} + +func unexport(s string) string { return strings.ToLower(s[:1]) + s[1:] } + +// generateService generates all the code for the named service. +func (g *grpc) generateService(file *generator.FileDescriptor, service *pb.ServiceDescriptorProto, index int) { + path := fmt.Sprintf("6,%d", index) // 6 means service. + + origServName := service.GetName() + fullServName := file.GetPackage() + "." + origServName + servName := generator.CamelCase(origServName) + + g.P() + g.P("// Client API for ", servName, " service") + g.P() + + // Client interface. + g.P("type ", servName, "Client interface {") + for i, method := range service.Method { + g.gen.PrintComments(fmt.Sprintf("%s,2,%d", path, i)) // 2 means method in a service. + g.P(g.generateClientSignature(servName, method)) + } + g.P("}") + g.P() + + // Client structure. + g.P("type ", unexport(servName), "Client struct {") + g.P("cc *", grpcPkg, ".ClientConn") + g.P("}") + g.P() + + // NewClient factory. + g.P("func New", servName, "Client (cc *", grpcPkg, ".ClientConn) ", servName, "Client {") + g.P("return &", unexport(servName), "Client{cc}") + g.P("}") + g.P() + + var methodIndex, streamIndex int + serviceDescVar := "_" + servName + "_serviceDesc" + // Client method implementations. + for _, method := range service.Method { + var descExpr string + if !method.GetServerStreaming() && !method.GetClientStreaming() { + // Unary RPC method + descExpr = fmt.Sprintf("&%s.Methods[%d]", serviceDescVar, methodIndex) + methodIndex++ + } else { + // Streaming RPC method + descExpr = fmt.Sprintf("&%s.Streams[%d]", serviceDescVar, streamIndex) + streamIndex++ + } + g.generateClientMethod(servName, fullServName, serviceDescVar, method, descExpr) + } + + g.P("// Server API for ", servName, " service") + g.P() + + // Server interface. + serverType := servName + "Server" + g.P("type ", serverType, " interface {") + for i, method := range service.Method { + g.gen.PrintComments(fmt.Sprintf("%s,2,%d", path, i)) // 2 means method in a service. + g.P(g.generateServerSignature(servName, method)) + } + g.P("}") + g.P() + + // Server registration. + g.P("func Register", servName, "Server(s *", grpcPkg, ".Server, srv ", serverType, ") {") + g.P("s.RegisterService(&", serviceDescVar, `, srv)`) + g.P("}") + g.P() + + // Server handler implementations. + var handlerNames []string + for _, method := range service.Method { + hname := g.generateServerMethod(servName, method) + handlerNames = append(handlerNames, hname) + } + + // Service descriptor. + g.P("var ", serviceDescVar, " = ", grpcPkg, ".ServiceDesc {") + g.P("ServiceName: ", strconv.Quote(fullServName), ",") + g.P("HandlerType: (*", serverType, ")(nil),") + g.P("Methods: []", grpcPkg, ".MethodDesc{") + for i, method := range service.Method { + if method.GetServerStreaming() || method.GetClientStreaming() { + continue + } + g.P("{") + g.P("MethodName: ", strconv.Quote(method.GetName()), ",") + g.P("Handler: ", handlerNames[i], ",") + g.P("},") + } + g.P("},") + g.P("Streams: []", grpcPkg, ".StreamDesc{") + for i, method := range service.Method { + if !method.GetServerStreaming() && !method.GetClientStreaming() { + continue + } + g.P("{") + g.P("StreamName: ", strconv.Quote(method.GetName()), ",") + g.P("Handler: ", handlerNames[i], ",") + if method.GetServerStreaming() { + g.P("ServerStreams: true,") + } + if method.GetClientStreaming() { + g.P("ClientStreams: true,") + } + g.P("},") + } + g.P("},") + g.P("}") + g.P() +} + +// generateClientSignature returns the client-side signature for a method. +func (g *grpc) generateClientSignature(servName string, method *pb.MethodDescriptorProto) string { + origMethName := method.GetName() + methName := generator.CamelCase(origMethName) + if reservedClientName[methName] { + methName += "_" + } + reqArg := ", in *" + g.typeName(method.GetInputType()) + if method.GetClientStreaming() { + reqArg = "" + } + respName := "*" + g.typeName(method.GetOutputType()) + if method.GetServerStreaming() || method.GetClientStreaming() { + respName = servName + "_" + generator.CamelCase(origMethName) + "Client" + } + return fmt.Sprintf("%s(ctx %s.Context%s, opts ...%s.CallOption) (%s, error)", methName, contextPkg, reqArg, grpcPkg, respName) +} + +func (g *grpc) generateClientMethod(servName, fullServName, serviceDescVar string, method *pb.MethodDescriptorProto, descExpr string) { + sname := fmt.Sprintf("/%s/%s", fullServName, method.GetName()) + methName := generator.CamelCase(method.GetName()) + inType := g.typeName(method.GetInputType()) + outType := g.typeName(method.GetOutputType()) + + g.P("func (c *", unexport(servName), "Client) ", g.generateClientSignature(servName, method), "{") + if !method.GetServerStreaming() && !method.GetClientStreaming() { + g.P("out := new(", outType, ")") + // TODO: Pass descExpr to Invoke. + g.P("err := ", grpcPkg, `.Invoke(ctx, "`, sname, `", in, out, c.cc, opts...)`) + g.P("if err != nil { return nil, err }") + g.P("return out, nil") + g.P("}") + g.P() + return + } + streamType := unexport(servName) + methName + "Client" + g.P("stream, err := ", grpcPkg, ".NewClientStream(ctx, ", descExpr, `, c.cc, "`, sname, `", opts...)`) + g.P("if err != nil { return nil, err }") + g.P("x := &", streamType, "{stream}") + if !method.GetClientStreaming() { + g.P("if err := x.ClientStream.SendMsg(in); err != nil { return nil, err }") + g.P("if err := x.ClientStream.CloseSend(); err != nil { return nil, err }") + } + g.P("return x, nil") + g.P("}") + g.P() + + genSend := method.GetClientStreaming() + genRecv := method.GetServerStreaming() + genCloseAndRecv := !method.GetServerStreaming() + + // Stream auxiliary types and methods. + g.P("type ", servName, "_", methName, "Client interface {") + if genSend { + g.P("Send(*", inType, ") error") + } + if genRecv { + g.P("Recv() (*", outType, ", error)") + } + if genCloseAndRecv { + g.P("CloseAndRecv() (*", outType, ", error)") + } + g.P(grpcPkg, ".ClientStream") + g.P("}") + g.P() + + g.P("type ", streamType, " struct {") + g.P(grpcPkg, ".ClientStream") + g.P("}") + g.P() + + if genSend { + g.P("func (x *", streamType, ") Send(m *", inType, ") error {") + g.P("return x.ClientStream.SendMsg(m)") + g.P("}") + g.P() + } + if genRecv { + g.P("func (x *", streamType, ") Recv() (*", outType, ", error) {") + g.P("m := new(", outType, ")") + g.P("if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err }") + g.P("return m, nil") + g.P("}") + g.P() + } + if genCloseAndRecv { + g.P("func (x *", streamType, ") CloseAndRecv() (*", outType, ", error) {") + g.P("if err := x.ClientStream.CloseSend(); err != nil { return nil, err }") + g.P("m := new(", outType, ")") + g.P("if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err }") + g.P("return m, nil") + g.P("}") + g.P() + } +} + +// generateServerSignature returns the server-side signature for a method. +func (g *grpc) generateServerSignature(servName string, method *pb.MethodDescriptorProto) string { + origMethName := method.GetName() + methName := generator.CamelCase(origMethName) + if reservedClientName[methName] { + methName += "_" + } + + var reqArgs []string + ret := "error" + if !method.GetServerStreaming() && !method.GetClientStreaming() { + reqArgs = append(reqArgs, contextPkg+".Context") + ret = "(*" + g.typeName(method.GetOutputType()) + ", error)" + } + if !method.GetClientStreaming() { + reqArgs = append(reqArgs, "*"+g.typeName(method.GetInputType())) + } + if method.GetServerStreaming() || method.GetClientStreaming() { + reqArgs = append(reqArgs, servName+"_"+generator.CamelCase(origMethName)+"Server") + } + + return methName + "(" + strings.Join(reqArgs, ", ") + ") " + ret +} + +func (g *grpc) generateServerMethod(servName string, method *pb.MethodDescriptorProto) string { + methName := generator.CamelCase(method.GetName()) + hname := fmt.Sprintf("_%s_%s_Handler", servName, methName) + inType := g.typeName(method.GetInputType()) + outType := g.typeName(method.GetOutputType()) + + if !method.GetServerStreaming() && !method.GetClientStreaming() { + g.P("func ", hname, "(srv interface{}, ctx ", contextPkg, ".Context, codec ", grpcPkg, ".Codec, buf []byte) (interface{}, error) {") + g.P("in := new(", inType, ")") + g.P("if err := codec.Unmarshal(buf, in); err != nil { return nil, err }") + g.P("out, err := srv.(", servName, "Server).", methName, "(ctx, in)") + g.P("if err != nil { return nil, err }") + g.P("return out, nil") + g.P("}") + g.P() + return hname + } + streamType := unexport(servName) + methName + "Server" + g.P("func ", hname, "(srv interface{}, stream ", grpcPkg, ".ServerStream) error {") + if !method.GetClientStreaming() { + g.P("m := new(", inType, ")") + g.P("if err := stream.RecvMsg(m); err != nil { return err }") + g.P("return srv.(", servName, "Server).", methName, "(m, &", streamType, "{stream})") + } else { + g.P("return srv.(", servName, "Server).", methName, "(&", streamType, "{stream})") + } + g.P("}") + g.P() + + genSend := method.GetServerStreaming() + genSendAndClose := !method.GetServerStreaming() + genRecv := method.GetClientStreaming() + + // Stream auxiliary types and methods. + g.P("type ", servName, "_", methName, "Server interface {") + if genSend { + g.P("Send(*", outType, ") error") + } + if genSendAndClose { + g.P("SendAndClose(*", outType, ") error") + } + if genRecv { + g.P("Recv() (*", inType, ", error)") + } + g.P(grpcPkg, ".ServerStream") + g.P("}") + g.P() + + g.P("type ", streamType, " struct {") + g.P(grpcPkg, ".ServerStream") + g.P("}") + g.P() + + if genSend { + g.P("func (x *", streamType, ") Send(m *", outType, ") error {") + g.P("return x.ServerStream.SendMsg(m)") + g.P("}") + g.P() + } + if genSendAndClose { + g.P("func (x *", streamType, ") SendAndClose(m *", outType, ") error {") + g.P("return x.ServerStream.SendMsg(m)") + g.P("}") + g.P() + } + if genRecv { + g.P("func (x *", streamType, ") Recv() (*", inType, ", error) {") + g.P("m := new(", inType, ")") + g.P("if err := x.ServerStream.RecvMsg(m); err != nil { return nil, err }") + g.P("return m, nil") + g.P("}") + g.P() + } + + return hname +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/link_grpc.go b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/link_grpc.go new file mode 100644 index 000000000..24e490ec4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/link_grpc.go @@ -0,0 +1,34 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2015 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +package main + +import _ "github.com/golang/protobuf/protoc-gen-go/internal/grpc" diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/main.go b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/main.go new file mode 100644 index 000000000..8e2486de0 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/main.go @@ -0,0 +1,98 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2010 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +// protoc-gen-go is a plugin for the Google protocol buffer compiler to generate +// Go code. Run it by building this program and putting it in your path with +// the name +// protoc-gen-go +// That word 'go' at the end becomes part of the option string set for the +// protocol compiler, so once the protocol compiler (protoc) is installed +// you can run +// protoc --go_out=output_directory input_directory/file.proto +// to generate Go bindings for the protocol defined by file.proto. +// With that input, the output will be written to +// output_directory/file.pb.go +// +// The generated code is documented in the package comment for +// the library. +// +// See the README and documentation for protocol buffers to learn more: +// https://developers.google.com/protocol-buffers/ +package main + +import ( + "io/ioutil" + "os" + + "github.com/golang/protobuf/proto" + "github.com/golang/protobuf/protoc-gen-go/generator" +) + +func main() { + // Begin by allocating a generator. The request and response structures are stored there + // so we can do error handling easily - the response structure contains the field to + // report failure. + g := generator.New() + + data, err := ioutil.ReadAll(os.Stdin) + if err != nil { + g.Error(err, "reading input") + } + + if err := proto.Unmarshal(data, g.Request); err != nil { + g.Error(err, "parsing input proto") + } + + if len(g.Request.FileToGenerate) == 0 { + g.Fail("no files to generate") + } + + g.CommandLineParameters(g.Request.GetParameter()) + + // Create a wrapped version of the Descriptors and EnumDescriptors that + // point to the file that defines them. + g.WrapTypes() + + g.SetPackageNames() + g.BuildTypeNameMap() + + g.GenerateAllFiles() + + // Send back the results. + data, err = proto.Marshal(g.Response) + if err != nil { + g.Error(err, "failed to marshal output proto") + } + _, err = os.Stdout.Write(data) + if err != nil { + g.Error(err, "failed to write output proto") + } +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/plugin/Makefile b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/plugin/Makefile new file mode 100644 index 000000000..8a49a29d5 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/plugin/Makefile @@ -0,0 +1,46 @@ +# Go support for Protocol Buffers - Google's data interchange format +# +# Copyright 2010 The Go Authors. All rights reserved. +# https://github.com/golang/protobuf +# +# 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. + +# Not stored here, but plugin.proto is in https://github.com/google/protobuf/ +# at src/google/protobuf/compiler/plugin.proto +# Also we need to fix an import. +regenerate: + echo WARNING! THIS RULE IS PROBABLY NOT RIGHT FOR YOUR INSTALLATION + cd $(HOME)/src/protobuf/src && \ + protoc --go_out=Mgoogle/protobuf/descriptor.proto=github.com/golang/protobuf/protoc-gen-go/descriptor:. \ + ./google/protobuf/compiler/plugin.proto && \ + cat ./google/protobuf/compiler/plugin.pb.go > $(GOPATH)/src/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.pb.go + +restore: + cp plugin.pb.golden plugin.pb.go + +preserve: + cp plugin.pb.go plugin.pb.golden diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.pb.golden b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.pb.golden new file mode 100644 index 000000000..8953d0ff8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.pb.golden @@ -0,0 +1,83 @@ +// Code generated by protoc-gen-go. +// source: google/protobuf/compiler/plugin.proto +// DO NOT EDIT! + +package google_protobuf_compiler + +import proto "github.com/golang/protobuf/proto" +import "math" +import google_protobuf "github.com/golang/protobuf/protoc-gen-go/descriptor" + +// Reference proto and math imports to suppress error if they are not otherwise used. +var _ = proto.GetString +var _ = math.Inf + +type CodeGeneratorRequest struct { + FileToGenerate []string `protobuf:"bytes,1,rep,name=file_to_generate" json:"file_to_generate,omitempty"` + Parameter *string `protobuf:"bytes,2,opt,name=parameter" json:"parameter,omitempty"` + ProtoFile []*google_protobuf.FileDescriptorProto `protobuf:"bytes,15,rep,name=proto_file" json:"proto_file,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (this *CodeGeneratorRequest) Reset() { *this = CodeGeneratorRequest{} } +func (this *CodeGeneratorRequest) String() string { return proto.CompactTextString(this) } +func (*CodeGeneratorRequest) ProtoMessage() {} + +func (this *CodeGeneratorRequest) GetParameter() string { + if this != nil && this.Parameter != nil { + return *this.Parameter + } + return "" +} + +type CodeGeneratorResponse struct { + Error *string `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` + File []*CodeGeneratorResponse_File `protobuf:"bytes,15,rep,name=file" json:"file,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (this *CodeGeneratorResponse) Reset() { *this = CodeGeneratorResponse{} } +func (this *CodeGeneratorResponse) String() string { return proto.CompactTextString(this) } +func (*CodeGeneratorResponse) ProtoMessage() {} + +func (this *CodeGeneratorResponse) GetError() string { + if this != nil && this.Error != nil { + return *this.Error + } + return "" +} + +type CodeGeneratorResponse_File struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + InsertionPoint *string `protobuf:"bytes,2,opt,name=insertion_point" json:"insertion_point,omitempty"` + Content *string `protobuf:"bytes,15,opt,name=content" json:"content,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (this *CodeGeneratorResponse_File) Reset() { *this = CodeGeneratorResponse_File{} } +func (this *CodeGeneratorResponse_File) String() string { return proto.CompactTextString(this) } +func (*CodeGeneratorResponse_File) ProtoMessage() {} + +func (this *CodeGeneratorResponse_File) GetName() string { + if this != nil && this.Name != nil { + return *this.Name + } + return "" +} + +func (this *CodeGeneratorResponse_File) GetInsertionPoint() string { + if this != nil && this.InsertionPoint != nil { + return *this.InsertionPoint + } + return "" +} + +func (this *CodeGeneratorResponse_File) GetContent() string { + if this != nil && this.Content != nil { + return *this.Content + } + return "" +} + +func init() { +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/Makefile b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/Makefile new file mode 100644 index 000000000..3d084482f --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/Makefile @@ -0,0 +1,66 @@ +# Go support for Protocol Buffers - Google's data interchange format +# +# Copyright 2010 The Go Authors. All rights reserved. +# https://github.com/golang/protobuf +# +# 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. + +all: + @echo run make test + +include ../../Make.protobuf + +test: golden testbuild + +#test: golden testbuild extension_test +# ./extension_test +# @echo PASS + +golden: + make -B my_test/test.pb.go + diff -w my_test/test.pb.go my_test/test.pb.go.golden + +nuke: clean + +testbuild: buildprotos + go test + +buildprotos: + # Invoke protoc once to generate three independent .pb.go files in the same package. + protoc --go_out=. multi/multi{1,2,3}.proto + +#extension_test: extension_test.$O +# $(LD) -L. -o $@ $< + +#multi.a: multi3.pb.$O multi2.pb.$O multi1.pb.$O +# rm -f multi.a +# $(QUOTED_GOBIN)/gopack grc $@ $< + +#test.pb.go: imp.pb.go +#multi1.pb.go: multi2.pb.go multi3.pb.go +#main.$O: imp.pb.$O test.pb.$O multi.a +#extension_test.$O: extension_base.pb.$O extension_extra.pb.$O extension_user.pb.$O diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/extension_base.proto b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/extension_base.proto new file mode 100644 index 000000000..94acfc1bc --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/extension_base.proto @@ -0,0 +1,46 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2010 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +syntax = "proto2"; + +package extension_base; + +message BaseMessage { + optional int32 height = 1; + extensions 4 to 9; + extensions 16 to max; +} + +// Another message that may be extended, using message_set_wire_format. +message OldStyleMessage { + option message_set_wire_format = true; + extensions 100 to max; +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/extension_extra.proto b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/extension_extra.proto new file mode 100644 index 000000000..fca7f600c --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/extension_extra.proto @@ -0,0 +1,38 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2011 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +syntax = "proto2"; + +package extension_extra; + +message ExtraMessage { + optional int32 width = 1; +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/extension_test.go b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/extension_test.go new file mode 100644 index 000000000..86e9c118a --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/extension_test.go @@ -0,0 +1,210 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2010 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +// Test that we can use protocol buffers that use extensions. + +package testdata + +/* + +import ( + "bytes" + "regexp" + "testing" + + "github.com/golang/protobuf/proto" + base "extension_base.pb" + user "extension_user.pb" +) + +func TestSingleFieldExtension(t *testing.T) { + bm := &base.BaseMessage{ + Height: proto.Int32(178), + } + + // Use extension within scope of another type. + vol := proto.Uint32(11) + err := proto.SetExtension(bm, user.E_LoudMessage_Volume, vol) + if err != nil { + t.Fatal("Failed setting extension:", err) + } + buf, err := proto.Marshal(bm) + if err != nil { + t.Fatal("Failed encoding message with extension:", err) + } + bm_new := new(base.BaseMessage) + if err := proto.Unmarshal(buf, bm_new); err != nil { + t.Fatal("Failed decoding message with extension:", err) + } + if !proto.HasExtension(bm_new, user.E_LoudMessage_Volume) { + t.Fatal("Decoded message didn't contain extension.") + } + vol_out, err := proto.GetExtension(bm_new, user.E_LoudMessage_Volume) + if err != nil { + t.Fatal("Failed getting extension:", err) + } + if v := vol_out.(*uint32); *v != *vol { + t.Errorf("vol_out = %v, expected %v", *v, *vol) + } + proto.ClearExtension(bm_new, user.E_LoudMessage_Volume) + if proto.HasExtension(bm_new, user.E_LoudMessage_Volume) { + t.Fatal("Failed clearing extension.") + } +} + +func TestMessageExtension(t *testing.T) { + bm := &base.BaseMessage{ + Height: proto.Int32(179), + } + + // Use extension that is itself a message. + um := &user.UserMessage{ + Name: proto.String("Dave"), + Rank: proto.String("Major"), + } + err := proto.SetExtension(bm, user.E_LoginMessage_UserMessage, um) + if err != nil { + t.Fatal("Failed setting extension:", err) + } + buf, err := proto.Marshal(bm) + if err != nil { + t.Fatal("Failed encoding message with extension:", err) + } + bm_new := new(base.BaseMessage) + if err := proto.Unmarshal(buf, bm_new); err != nil { + t.Fatal("Failed decoding message with extension:", err) + } + if !proto.HasExtension(bm_new, user.E_LoginMessage_UserMessage) { + t.Fatal("Decoded message didn't contain extension.") + } + um_out, err := proto.GetExtension(bm_new, user.E_LoginMessage_UserMessage) + if err != nil { + t.Fatal("Failed getting extension:", err) + } + if n := um_out.(*user.UserMessage).Name; *n != *um.Name { + t.Errorf("um_out.Name = %q, expected %q", *n, *um.Name) + } + if r := um_out.(*user.UserMessage).Rank; *r != *um.Rank { + t.Errorf("um_out.Rank = %q, expected %q", *r, *um.Rank) + } + proto.ClearExtension(bm_new, user.E_LoginMessage_UserMessage) + if proto.HasExtension(bm_new, user.E_LoginMessage_UserMessage) { + t.Fatal("Failed clearing extension.") + } +} + +func TestTopLevelExtension(t *testing.T) { + bm := &base.BaseMessage{ + Height: proto.Int32(179), + } + + width := proto.Int32(17) + err := proto.SetExtension(bm, user.E_Width, width) + if err != nil { + t.Fatal("Failed setting extension:", err) + } + buf, err := proto.Marshal(bm) + if err != nil { + t.Fatal("Failed encoding message with extension:", err) + } + bm_new := new(base.BaseMessage) + if err := proto.Unmarshal(buf, bm_new); err != nil { + t.Fatal("Failed decoding message with extension:", err) + } + if !proto.HasExtension(bm_new, user.E_Width) { + t.Fatal("Decoded message didn't contain extension.") + } + width_out, err := proto.GetExtension(bm_new, user.E_Width) + if err != nil { + t.Fatal("Failed getting extension:", err) + } + if w := width_out.(*int32); *w != *width { + t.Errorf("width_out = %v, expected %v", *w, *width) + } + proto.ClearExtension(bm_new, user.E_Width) + if proto.HasExtension(bm_new, user.E_Width) { + t.Fatal("Failed clearing extension.") + } +} + +func TestMessageSetWireFormat(t *testing.T) { + osm := new(base.OldStyleMessage) + osp := &user.OldStyleParcel{ + Name: proto.String("Dave"), + Height: proto.Int32(178), + } + + err := proto.SetExtension(osm, user.E_OldStyleParcel_MessageSetExtension, osp) + if err != nil { + t.Fatal("Failed setting extension:", err) + } + + buf, err := proto.Marshal(osm) + if err != nil { + t.Fatal("Failed encoding message:", err) + } + + // Data generated from Python implementation. + expected := []byte{ + 11, 16, 209, 15, 26, 9, 10, 4, 68, 97, 118, 101, 16, 178, 1, 12, + } + + if !bytes.Equal(expected, buf) { + t.Errorf("Encoding mismatch.\nwant %+v\n got %+v", expected, buf) + } + + // Check that it is restored correctly. + osm = new(base.OldStyleMessage) + if err := proto.Unmarshal(buf, osm); err != nil { + t.Fatal("Failed decoding message:", err) + } + osp_out, err := proto.GetExtension(osm, user.E_OldStyleParcel_MessageSetExtension) + if err != nil { + t.Fatal("Failed getting extension:", err) + } + osp = osp_out.(*user.OldStyleParcel) + if *osp.Name != "Dave" || *osp.Height != 178 { + t.Errorf("Retrieved extension from decoded message is not correct: %+v", osp) + } +} + +func main() { + // simpler than rigging up gotest + testing.Main(regexp.MatchString, []testing.InternalTest{ + {"TestSingleFieldExtension", TestSingleFieldExtension}, + {"TestMessageExtension", TestMessageExtension}, + {"TestTopLevelExtension", TestTopLevelExtension}, + }, + []testing.InternalBenchmark{}, + []testing.InternalExample{}) +} + +*/ diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/extension_user.proto b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/extension_user.proto new file mode 100644 index 000000000..ff65873dd --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/extension_user.proto @@ -0,0 +1,100 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2010 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +syntax = "proto2"; + +import "extension_base.proto"; +import "extension_extra.proto"; + +package extension_user; + +message UserMessage { + optional string name = 1; + optional string rank = 2; +} + +// Extend with a message +extend extension_base.BaseMessage { + optional UserMessage user_message = 5; +} + +// Extend with a foreign message +extend extension_base.BaseMessage { + optional extension_extra.ExtraMessage extra_message = 9; +} + +// Extend with some primitive types +extend extension_base.BaseMessage { + optional int32 width = 6; + optional int64 area = 7; +} + +// Extend inside the scope of another type +message LoudMessage { + extend extension_base.BaseMessage { + optional uint32 volume = 8; + } + extensions 100 to max; +} + +// Extend inside the scope of another type, using a message. +message LoginMessage { + extend extension_base.BaseMessage { + optional UserMessage user_message = 16; + } +} + +// Extend with a repeated field +extend extension_base.BaseMessage { + repeated Detail detail = 17; +} + +message Detail { + optional string color = 1; +} + +// An extension of an extension +message Announcement { + optional string words = 1; + extend LoudMessage { + optional Announcement loud_ext = 100; + } +} + +// Something that can be put in a message set. +message OldStyleParcel { + extend extension_base.OldStyleMessage { + optional OldStyleParcel message_set_extension = 2001; + } + + required string name = 1; + optional int32 height = 2; +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/golden_test.go b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/golden_test.go new file mode 100644 index 000000000..95548d4ed --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/golden_test.go @@ -0,0 +1,86 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2012 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +// Verify that the compiler output for test.proto is unchanged. + +package testdata + +import ( + "crypto/sha1" + "fmt" + "io/ioutil" + "os" + "os/exec" + "path/filepath" + "testing" +) + +// sum returns in string form (for easy comparison) the SHA-1 hash of the named file. +func sum(t *testing.T, name string) string { + data, err := ioutil.ReadFile(name) + if err != nil { + t.Fatal(err) + } + t.Logf("sum(%q): length is %d", name, len(data)) + hash := sha1.New() + _, err = hash.Write(data) + if err != nil { + t.Fatal(err) + } + return fmt.Sprintf("% x", hash.Sum(nil)) +} + +func run(t *testing.T, name string, args ...string) { + cmd := exec.Command(name, args...) + cmd.Stdin = os.Stdin + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + err := cmd.Run() + if err != nil { + t.Fatal(err) + } +} + +func TestGolden(t *testing.T) { + // Compute the original checksum. + goldenSum := sum(t, "my_test/test.pb.go") + // Run the proto compiler. + run(t, "protoc", "--go_out="+os.TempDir(), "my_test/test.proto") + newFile := filepath.Join(os.TempDir(), "my_test/test.pb.go") + defer os.Remove(newFile) + // Compute the new checksum. + newSum := sum(t, newFile) + // Verify + if newSum != goldenSum { + run(t, "diff", "-u", "my_test/test.pb.go", newFile) + t.Fatal("Code generated by protoc-gen-go has changed; update test.pb.go") + } +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/grpc.proto b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/grpc.proto new file mode 100644 index 000000000..b8bc41acd --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/grpc.proto @@ -0,0 +1,59 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2015 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +syntax = "proto3"; + +package grpc.testing; + +message SimpleRequest { +} + +message SimpleResponse { +} + +message StreamMsg { +} + +message StreamMsg2 { +} + +service Test { + rpc UnaryCall(SimpleRequest) returns (SimpleResponse); + + // This RPC streams from the server only. + rpc Downstream(SimpleRequest) returns (stream StreamMsg); + + // This RPC streams from the client. + rpc Upstream(stream StreamMsg) returns (SimpleResponse); + + // This one streams in both directions. + rpc Bidi(stream StreamMsg) returns (stream StreamMsg2); +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/imp.pb.go.golden b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/imp.pb.go.golden new file mode 100644 index 000000000..784a4f865 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/imp.pb.go.golden @@ -0,0 +1,113 @@ +// Code generated by protoc-gen-go. +// source: imp.proto +// DO NOT EDIT! + +package imp + +import proto "github.com/golang/protobuf/proto" +import "math" +import "os" +import imp1 "imp2.pb" + +// Reference proto & math imports to suppress error if they are not otherwise used. +var _ = proto.GetString +var _ = math.Inf + +// Types from public import imp2.proto +type PubliclyImportedMessage imp1.PubliclyImportedMessage + +func (this *PubliclyImportedMessage) Reset() { (*imp1.PubliclyImportedMessage)(this).Reset() } +func (this *PubliclyImportedMessage) String() string { + return (*imp1.PubliclyImportedMessage)(this).String() +} + +// PubliclyImportedMessage from public import imp.proto + +type ImportedMessage_Owner int32 + +const ( + ImportedMessage_DAVE ImportedMessage_Owner = 1 + ImportedMessage_MIKE ImportedMessage_Owner = 2 +) + +var ImportedMessage_Owner_name = map[int32]string{ + 1: "DAVE", + 2: "MIKE", +} +var ImportedMessage_Owner_value = map[string]int32{ + "DAVE": 1, + "MIKE": 2, +} + +// NewImportedMessage_Owner is deprecated. Use x.Enum() instead. +func NewImportedMessage_Owner(x ImportedMessage_Owner) *ImportedMessage_Owner { + e := ImportedMessage_Owner(x) + return &e +} +func (x ImportedMessage_Owner) Enum() *ImportedMessage_Owner { + p := new(ImportedMessage_Owner) + *p = x + return p +} +func (x ImportedMessage_Owner) String() string { + return proto.EnumName(ImportedMessage_Owner_name, int32(x)) +} + +type ImportedMessage struct { + Field *int64 `protobuf:"varint,1,req,name=field" json:"field,omitempty"` + XXX_extensions map[int32][]byte `json:",omitempty"` + XXX_unrecognized []byte `json:",omitempty"` +} + +func (this *ImportedMessage) Reset() { *this = ImportedMessage{} } +func (this *ImportedMessage) String() string { return proto.CompactTextString(this) } + +var extRange_ImportedMessage = []proto.ExtensionRange{ + proto.ExtensionRange{90, 100}, +} + +func (*ImportedMessage) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_ImportedMessage +} +func (this *ImportedMessage) ExtensionMap() map[int32][]byte { + if this.XXX_extensions == nil { + this.XXX_extensions = make(map[int32][]byte) + } + return this.XXX_extensions +} + +type ImportedExtendable struct { + XXX_extensions map[int32][]byte `json:",omitempty"` + XXX_unrecognized []byte `json:",omitempty"` +} + +func (this *ImportedExtendable) Reset() { *this = ImportedExtendable{} } +func (this *ImportedExtendable) String() string { return proto.CompactTextString(this) } + +func (this *ImportedExtendable) Marshal() ([]byte, error) { + return proto.MarshalMessageSet(this.ExtensionMap()) +} +func (this *ImportedExtendable) Unmarshal(buf []byte) error { + return proto.UnmarshalMessageSet(buf, this.ExtensionMap()) +} +// ensure ImportedExtendable satisfies proto.Marshaler and proto.Unmarshaler +var _ proto.Marshaler = (*ImportedExtendable)(nil) +var _ proto.Unmarshaler = (*ImportedExtendable)(nil) + +var extRange_ImportedExtendable = []proto.ExtensionRange{ + proto.ExtensionRange{100, 536870911}, +} + +func (*ImportedExtendable) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_ImportedExtendable +} +func (this *ImportedExtendable) ExtensionMap() map[int32][]byte { + if this.XXX_extensions == nil { + this.XXX_extensions = make(map[int32][]byte) + } + return this.XXX_extensions +} + +func init() { + proto.RegisterEnum("imp.ImportedMessage_Owner", ImportedMessage_Owner_name, ImportedMessage_Owner_value) +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/imp.proto b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/imp.proto new file mode 100644 index 000000000..42f144e4d --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/imp.proto @@ -0,0 +1,65 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2010 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +syntax = "proto2"; + +package imp; + +import "imp2.proto"; +import "imp3.proto"; + +message ImportedMessage { + required int64 field = 1; + + // The forwarded getters for these fields are fiddly to get right. + optional ImportedMessage2 local_msg = 2; + optional ForeignImportedMessage foreign_msg = 3; // in imp3.proto + optional Owner enum_field = 4; + + repeated string name = 5; + repeated Owner boss = 6; + repeated ImportedMessage2 memo = 7; + + enum Owner { + DAVE = 1; + MIKE = 2; + } + + extensions 90 to 100; +} + +message ImportedMessage2 { +} + +message ImportedExtendable { + option message_set_wire_format = true; + extensions 100 to max; +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/imp2.proto b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/imp2.proto new file mode 100644 index 000000000..3bb0632b2 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/imp2.proto @@ -0,0 +1,43 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2011 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +syntax = "proto2"; + +package imp; + +message PubliclyImportedMessage { + optional int64 field = 1; +} + +enum PubliclyImportedEnum { + GLASSES = 1; + HAIR = 2; +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/imp3.proto b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/imp3.proto new file mode 100644 index 000000000..58fc7598b --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/imp3.proto @@ -0,0 +1,38 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2012 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +syntax = "proto2"; + +package imp; + +message ForeignImportedMessage { + optional string tuber = 1; +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/main_test.go b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/main_test.go new file mode 100644 index 000000000..2f1711c50 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/main_test.go @@ -0,0 +1,46 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2010 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +// A simple binary to link together the protocol buffers in this test. + +package testdata + +import ( + "testing" + + multipb "./multi" + mytestpb "./my_test" +) + +func TestLink(t *testing.T) { + _ = &multipb.Multi1{} + _ = &mytestpb.Request{} +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi1.proto b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi1.proto new file mode 100644 index 000000000..0da6e0af4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi1.proto @@ -0,0 +1,44 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2010 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +syntax = "proto2"; + +import "multi/multi2.proto"; +import "multi/multi3.proto"; + +package multitest; + +message Multi1 { + required Multi2 multi2 = 1; + optional Multi2.Color color = 2; + optional Multi3.HatType hat_type = 3; +} + diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi2.proto b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi2.proto new file mode 100644 index 000000000..e6bfc71b3 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi2.proto @@ -0,0 +1,46 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2010 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +syntax = "proto2"; + +package multitest; + +message Multi2 { + required int32 required_value = 1; + + enum Color { + BLUE = 1; + GREEN = 2; + RED = 3; + }; + optional Color color = 2; +} + diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi3.proto b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi3.proto new file mode 100644 index 000000000..146c255bd --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/multi/multi3.proto @@ -0,0 +1,43 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2010 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +syntax = "proto2"; + +package multitest; + +message Multi3 { + enum HatType { + FEDORA = 1; + FEZ = 2; + }; + optional HatType hat_type = 1; +} + diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/my_test/test.pb.go.golden b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/my_test/test.pb.go.golden new file mode 100644 index 000000000..450041493 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/my_test/test.pb.go.golden @@ -0,0 +1,487 @@ +// Code generated by protoc-gen-go. +// source: my_test/test.proto +// DO NOT EDIT! + +/* +Package my_test is a generated protocol buffer package. + +This package holds interesting messages. + +It is generated from these files: + my_test/test.proto + +It has these top-level messages: + Request + Reply + OtherBase + ReplyExtensions + OtherReplyExtensions + OldReply +*/ +package my_test + +import proto "github.com/golang/protobuf/proto" +import math "math" + +// discarding unused import multitest2 "multi" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = math.Inf + +type HatType int32 + +const ( + // deliberately skipping 0 + HatType_FEDORA HatType = 1 + HatType_FEZ HatType = 2 +) + +var HatType_name = map[int32]string{ + 1: "FEDORA", + 2: "FEZ", +} +var HatType_value = map[string]int32{ + "FEDORA": 1, + "FEZ": 2, +} + +func (x HatType) Enum() *HatType { + p := new(HatType) + *p = x + return p +} +func (x HatType) String() string { + return proto.EnumName(HatType_name, int32(x)) +} +func (x *HatType) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(HatType_value, data, "HatType") + if err != nil { + return err + } + *x = HatType(value) + return nil +} + +// This enum represents days of the week. +type Days int32 + +const ( + Days_MONDAY Days = 1 + Days_TUESDAY Days = 2 + Days_LUNDI Days = 1 +) + +var Days_name = map[int32]string{ + 1: "MONDAY", + 2: "TUESDAY", + // Duplicate value: 1: "LUNDI", +} +var Days_value = map[string]int32{ + "MONDAY": 1, + "TUESDAY": 2, + "LUNDI": 1, +} + +func (x Days) Enum() *Days { + p := new(Days) + *p = x + return p +} +func (x Days) String() string { + return proto.EnumName(Days_name, int32(x)) +} +func (x *Days) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Days_value, data, "Days") + if err != nil { + return err + } + *x = Days(value) + return nil +} + +type Request_Color int32 + +const ( + Request_RED Request_Color = 0 + Request_GREEN Request_Color = 1 + Request_BLUE Request_Color = 2 +) + +var Request_Color_name = map[int32]string{ + 0: "RED", + 1: "GREEN", + 2: "BLUE", +} +var Request_Color_value = map[string]int32{ + "RED": 0, + "GREEN": 1, + "BLUE": 2, +} + +func (x Request_Color) Enum() *Request_Color { + p := new(Request_Color) + *p = x + return p +} +func (x Request_Color) String() string { + return proto.EnumName(Request_Color_name, int32(x)) +} +func (x *Request_Color) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Request_Color_value, data, "Request_Color") + if err != nil { + return err + } + *x = Request_Color(value) + return nil +} + +type Reply_Entry_Game int32 + +const ( + Reply_Entry_FOOTBALL Reply_Entry_Game = 1 + Reply_Entry_TENNIS Reply_Entry_Game = 2 +) + +var Reply_Entry_Game_name = map[int32]string{ + 1: "FOOTBALL", + 2: "TENNIS", +} +var Reply_Entry_Game_value = map[string]int32{ + "FOOTBALL": 1, + "TENNIS": 2, +} + +func (x Reply_Entry_Game) Enum() *Reply_Entry_Game { + p := new(Reply_Entry_Game) + *p = x + return p +} +func (x Reply_Entry_Game) String() string { + return proto.EnumName(Reply_Entry_Game_name, int32(x)) +} +func (x *Reply_Entry_Game) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Reply_Entry_Game_value, data, "Reply_Entry_Game") + if err != nil { + return err + } + *x = Reply_Entry_Game(value) + return nil +} + +// This is a message that might be sent somewhere. +type Request struct { + Key []int64 `protobuf:"varint,1,rep,name=key" json:"key,omitempty"` + // optional imp.ImportedMessage imported_message = 2; + Hue *Request_Color `protobuf:"varint,3,opt,name=hue,enum=my.test.Request_Color" json:"hue,omitempty"` + Hat *HatType `protobuf:"varint,4,opt,name=hat,enum=my.test.HatType,def=1" json:"hat,omitempty"` + // optional imp.ImportedMessage.Owner owner = 6; + Deadline *float32 `protobuf:"fixed32,7,opt,name=deadline,def=inf" json:"deadline,omitempty"` + Somegroup *Request_SomeGroup `protobuf:"group,8,opt,name=SomeGroup" json:"somegroup,omitempty"` + // This is a map field. It will generate map[int32]string. + NameMapping map[int32]string `protobuf:"bytes,14,rep,name=name_mapping" json:"name_mapping,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // This is a map field whose value type is a message. + MsgMapping map[int64]*Reply `protobuf:"bytes,15,rep,name=msg_mapping" json:"msg_mapping,omitempty" protobuf_key:"zigzag64,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Reset_ *int32 `protobuf:"varint,12,opt,name=reset" json:"reset,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Request) Reset() { *m = Request{} } +func (m *Request) String() string { return proto.CompactTextString(m) } +func (*Request) ProtoMessage() {} + +const Default_Request_Hat HatType = HatType_FEDORA + +var Default_Request_Deadline float32 = float32(math.Inf(1)) + +func (m *Request) GetKey() []int64 { + if m != nil { + return m.Key + } + return nil +} + +func (m *Request) GetHue() Request_Color { + if m != nil && m.Hue != nil { + return *m.Hue + } + return Request_RED +} + +func (m *Request) GetHat() HatType { + if m != nil && m.Hat != nil { + return *m.Hat + } + return Default_Request_Hat +} + +func (m *Request) GetDeadline() float32 { + if m != nil && m.Deadline != nil { + return *m.Deadline + } + return Default_Request_Deadline +} + +func (m *Request) GetSomegroup() *Request_SomeGroup { + if m != nil { + return m.Somegroup + } + return nil +} + +func (m *Request) GetNameMapping() map[int32]string { + if m != nil { + return m.NameMapping + } + return nil +} + +func (m *Request) GetMsgMapping() map[int64]*Reply { + if m != nil { + return m.MsgMapping + } + return nil +} + +func (m *Request) GetReset_() int32 { + if m != nil && m.Reset_ != nil { + return *m.Reset_ + } + return 0 +} + +type Request_SomeGroup struct { + GroupField *int32 `protobuf:"varint,9,opt,name=group_field" json:"group_field,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Request_SomeGroup) Reset() { *m = Request_SomeGroup{} } +func (m *Request_SomeGroup) String() string { return proto.CompactTextString(m) } +func (*Request_SomeGroup) ProtoMessage() {} + +func (m *Request_SomeGroup) GetGroupField() int32 { + if m != nil && m.GroupField != nil { + return *m.GroupField + } + return 0 +} + +type Reply struct { + Found []*Reply_Entry `protobuf:"bytes,1,rep,name=found" json:"found,omitempty"` + CompactKeys []int32 `protobuf:"varint,2,rep,packed,name=compact_keys" json:"compact_keys,omitempty"` + XXX_extensions map[int32]proto.Extension `json:"-"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Reply) Reset() { *m = Reply{} } +func (m *Reply) String() string { return proto.CompactTextString(m) } +func (*Reply) ProtoMessage() {} + +var extRange_Reply = []proto.ExtensionRange{ + {100, 536870911}, +} + +func (*Reply) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_Reply +} +func (m *Reply) ExtensionMap() map[int32]proto.Extension { + if m.XXX_extensions == nil { + m.XXX_extensions = make(map[int32]proto.Extension) + } + return m.XXX_extensions +} + +func (m *Reply) GetFound() []*Reply_Entry { + if m != nil { + return m.Found + } + return nil +} + +func (m *Reply) GetCompactKeys() []int32 { + if m != nil { + return m.CompactKeys + } + return nil +} + +type Reply_Entry struct { + KeyThatNeeds_1234Camel_CasIng *int64 `protobuf:"varint,1,req,name=key_that_needs_1234camel_CasIng" json:"key_that_needs_1234camel_CasIng,omitempty"` + Value *int64 `protobuf:"varint,2,opt,name=value,def=7" json:"value,omitempty"` + XMyFieldName_2 *int64 `protobuf:"varint,3,opt,name=_my_field_name_2" json:"_my_field_name_2,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Reply_Entry) Reset() { *m = Reply_Entry{} } +func (m *Reply_Entry) String() string { return proto.CompactTextString(m) } +func (*Reply_Entry) ProtoMessage() {} + +const Default_Reply_Entry_Value int64 = 7 + +func (m *Reply_Entry) GetKeyThatNeeds_1234Camel_CasIng() int64 { + if m != nil && m.KeyThatNeeds_1234Camel_CasIng != nil { + return *m.KeyThatNeeds_1234Camel_CasIng + } + return 0 +} + +func (m *Reply_Entry) GetValue() int64 { + if m != nil && m.Value != nil { + return *m.Value + } + return Default_Reply_Entry_Value +} + +func (m *Reply_Entry) GetXMyFieldName_2() int64 { + if m != nil && m.XMyFieldName_2 != nil { + return *m.XMyFieldName_2 + } + return 0 +} + +type OtherBase struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + XXX_extensions map[int32]proto.Extension `json:"-"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *OtherBase) Reset() { *m = OtherBase{} } +func (m *OtherBase) String() string { return proto.CompactTextString(m) } +func (*OtherBase) ProtoMessage() {} + +var extRange_OtherBase = []proto.ExtensionRange{ + {100, 536870911}, +} + +func (*OtherBase) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_OtherBase +} +func (m *OtherBase) ExtensionMap() map[int32]proto.Extension { + if m.XXX_extensions == nil { + m.XXX_extensions = make(map[int32]proto.Extension) + } + return m.XXX_extensions +} + +func (m *OtherBase) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +type ReplyExtensions struct { + XXX_unrecognized []byte `json:"-"` +} + +func (m *ReplyExtensions) Reset() { *m = ReplyExtensions{} } +func (m *ReplyExtensions) String() string { return proto.CompactTextString(m) } +func (*ReplyExtensions) ProtoMessage() {} + +var E_ReplyExtensions_Time = &proto.ExtensionDesc{ + ExtendedType: (*Reply)(nil), + ExtensionType: (*float64)(nil), + Field: 101, + Name: "my.test.ReplyExtensions.time", + Tag: "fixed64,101,opt,name=time", +} + +var E_ReplyExtensions_Carrot = &proto.ExtensionDesc{ + ExtendedType: (*Reply)(nil), + ExtensionType: (*ReplyExtensions)(nil), + Field: 105, + Name: "my.test.ReplyExtensions.carrot", + Tag: "bytes,105,opt,name=carrot", +} + +var E_ReplyExtensions_Donut = &proto.ExtensionDesc{ + ExtendedType: (*OtherBase)(nil), + ExtensionType: (*ReplyExtensions)(nil), + Field: 101, + Name: "my.test.ReplyExtensions.donut", + Tag: "bytes,101,opt,name=donut", +} + +type OtherReplyExtensions struct { + Key *int32 `protobuf:"varint,1,opt,name=key" json:"key,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *OtherReplyExtensions) Reset() { *m = OtherReplyExtensions{} } +func (m *OtherReplyExtensions) String() string { return proto.CompactTextString(m) } +func (*OtherReplyExtensions) ProtoMessage() {} + +func (m *OtherReplyExtensions) GetKey() int32 { + if m != nil && m.Key != nil { + return *m.Key + } + return 0 +} + +type OldReply struct { + XXX_extensions map[int32]proto.Extension `json:"-"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *OldReply) Reset() { *m = OldReply{} } +func (m *OldReply) String() string { return proto.CompactTextString(m) } +func (*OldReply) ProtoMessage() {} + +func (m *OldReply) Marshal() ([]byte, error) { + return proto.MarshalMessageSet(m.ExtensionMap()) +} +func (m *OldReply) Unmarshal(buf []byte) error { + return proto.UnmarshalMessageSet(buf, m.ExtensionMap()) +} +func (m *OldReply) MarshalJSON() ([]byte, error) { + return proto.MarshalMessageSetJSON(m.XXX_extensions) +} +func (m *OldReply) UnmarshalJSON(buf []byte) error { + return proto.UnmarshalMessageSetJSON(buf, m.XXX_extensions) +} + +// ensure OldReply satisfies proto.Marshaler and proto.Unmarshaler +var _ proto.Marshaler = (*OldReply)(nil) +var _ proto.Unmarshaler = (*OldReply)(nil) + +var extRange_OldReply = []proto.ExtensionRange{ + {100, 2147483646}, +} + +func (*OldReply) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_OldReply +} +func (m *OldReply) ExtensionMap() map[int32]proto.Extension { + if m.XXX_extensions == nil { + m.XXX_extensions = make(map[int32]proto.Extension) + } + return m.XXX_extensions +} + +var E_Tag = &proto.ExtensionDesc{ + ExtendedType: (*Reply)(nil), + ExtensionType: (*string)(nil), + Field: 103, + Name: "my.test.tag", + Tag: "bytes,103,opt,name=tag", +} + +var E_Donut = &proto.ExtensionDesc{ + ExtendedType: (*Reply)(nil), + ExtensionType: (*OtherReplyExtensions)(nil), + Field: 106, + Name: "my.test.donut", + Tag: "bytes,106,opt,name=donut", +} + +func init() { + proto.RegisterEnum("my.test.HatType", HatType_name, HatType_value) + proto.RegisterEnum("my.test.Days", Days_name, Days_value) + proto.RegisterEnum("my.test.Request_Color", Request_Color_name, Request_Color_value) + proto.RegisterEnum("my.test.Reply_Entry_Game", Reply_Entry_Game_name, Reply_Entry_Game_value) + proto.RegisterExtension(E_ReplyExtensions_Time) + proto.RegisterExtension(E_ReplyExtensions_Carrot) + proto.RegisterExtension(E_ReplyExtensions_Donut) + proto.RegisterExtension(E_Tag) + proto.RegisterExtension(E_Donut) +} diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/my_test/test.proto b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/my_test/test.proto new file mode 100644 index 000000000..975520f2c --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/my_test/test.proto @@ -0,0 +1,132 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2010 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +syntax = "proto2"; + +// This package holds interesting messages. +package my.test; // dotted package name + +//import "imp.proto"; +import "multi/multi1.proto"; // unused import + +enum HatType { + // deliberately skipping 0 + FEDORA = 1; + FEZ = 2; +} + +// This enum represents days of the week. +enum Days { + option allow_alias = true; + + MONDAY = 1; + TUESDAY = 2; + LUNDI = 1; // same value as MONDAY +} + +// This is a message that might be sent somewhere. +message Request { + enum Color { + RED = 0; + GREEN = 1; + BLUE = 2; + } + repeated int64 key = 1; +// optional imp.ImportedMessage imported_message = 2; + optional Color hue = 3; // no default + optional HatType hat = 4 [default=FEDORA]; +// optional imp.ImportedMessage.Owner owner = 6; + optional float deadline = 7 [default=inf]; + optional group SomeGroup = 8 { + optional int32 group_field = 9; + } + + // These foreign types are in imp2.proto, + // which is publicly imported by imp.proto. +// optional imp.PubliclyImportedMessage pub = 10; +// optional imp.PubliclyImportedEnum pub_enum = 13 [default=HAIR]; + + + // This is a map field. It will generate map[int32]string. + map name_mapping = 14; + // This is a map field whose value type is a message. + map msg_mapping = 15; + + optional int32 reset = 12; +} + +message Reply { + message Entry { + required int64 key_that_needs_1234camel_CasIng = 1; + optional int64 value = 2 [default=7]; + optional int64 _my_field_name_2 = 3; + enum Game { + FOOTBALL = 1; + TENNIS = 2; + } + } + repeated Entry found = 1; + repeated int32 compact_keys = 2 [packed=true]; + extensions 100 to max; +} + +message OtherBase { + optional string name = 1; + extensions 100 to max; +} + +message ReplyExtensions { + extend Reply { + optional double time = 101; + optional ReplyExtensions carrot = 105; + } + extend OtherBase { + optional ReplyExtensions donut = 101; + } +} + +message OtherReplyExtensions { + optional int32 key = 1; +} + +// top-level extension +extend Reply { + optional string tag = 103; + optional OtherReplyExtensions donut = 106; +// optional imp.ImportedMessage elephant = 107; // extend with message from another file. +} + +message OldReply { + // Extensions will be encoded in MessageSet wire format. + option message_set_wire_format = true; + extensions 100 to max; +} + diff --git a/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/proto3.proto b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/proto3.proto new file mode 100644 index 000000000..c994914e4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/golang/protobuf/protoc-gen-go/testdata/proto3.proto @@ -0,0 +1,52 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2014 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// 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. + +syntax = "proto3"; + +package proto3; + +message Request { + enum Flavour { + SWEET = 0; + SOUR = 1; + UMAMI = 2; + GOPHERLICIOUS = 3; + } + string name = 1; + repeated int64 key = 2; + Flavour taste = 3; + Book book = 4; +} + +message Book { + string title = 1; + bytes raw_data = 2; +} diff --git a/Godeps/_workspace/src/golang.org/x/net/context/context.go b/Godeps/_workspace/src/golang.org/x/net/context/context.go index 66aff7cb4..e7ee376c4 100644 --- a/Godeps/_workspace/src/golang.org/x/net/context/context.go +++ b/Godeps/_workspace/src/golang.org/x/net/context/context.go @@ -34,7 +34,7 @@ // // See http://blog.golang.org/context for example code for a server that uses // Contexts. -package context +package context // import "golang.org/x/net/context" import ( "errors" @@ -64,18 +64,21 @@ type Context interface { // // Done is provided for use in select statements: // - // // DoSomething calls DoSomethingSlow and returns as soon as - // // it returns or ctx.Done is closed. - // func DoSomething(ctx context.Context) (Result, error) { - // c := make(chan Result, 1) - // go func() { c <- DoSomethingSlow(ctx) }() - // select { - // case res := <-c: - // return res, nil - // case <-ctx.Done(): - // return nil, ctx.Err() - // } - // } + // // Stream generates values with DoSomething and sends them to out + // // until DoSomething returns an error or ctx.Done is closed. + // func Stream(ctx context.Context, out <-chan Value) error { + // for { + // v, err := DoSomething(ctx) + // if err != nil { + // return err + // } + // select { + // case <-ctx.Done(): + // return ctx.Err() + // case out <- v: + // } + // } + // } // // See http://blog.golang.org/pipelines for more examples of how to use // a Done channel for cancelation. @@ -202,6 +205,9 @@ type CancelFunc func() // WithCancel returns a copy of parent with a new Done channel. The returned // context's Done channel is closed when the returned cancel function is called // or when the parent context's Done channel is closed, whichever happens first. +// +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this Context complete. func WithCancel(parent Context) (ctx Context, cancel CancelFunc) { c := newCancelCtx(parent) propagateCancel(parent, &c) @@ -262,6 +268,19 @@ func parentCancelCtx(parent Context) (*cancelCtx, bool) { } } +// removeChild removes a context from its parent. +func removeChild(parent Context, child canceler) { + p, ok := parentCancelCtx(parent) + if !ok { + return + } + p.mu.Lock() + if p.children != nil { + delete(p.children, child) + } + p.mu.Unlock() +} + // A canceler is a context type that can be canceled directly. The // implementations are *cancelCtx and *timerCtx. type canceler interface { @@ -316,13 +335,7 @@ func (c *cancelCtx) cancel(removeFromParent bool, err error) { c.mu.Unlock() if removeFromParent { - if p, ok := parentCancelCtx(c.Context); ok { - p.mu.Lock() - if p.children != nil { - delete(p.children, c) - } - p.mu.Unlock() - } + removeChild(c.Context, c) } } @@ -333,9 +346,8 @@ func (c *cancelCtx) cancel(removeFromParent bool, err error) { // cancel function is called, or when the parent context's Done channel is // closed, whichever happens first. // -// Canceling this context releases resources associated with the deadline -// timer, so code should call cancel as soon as the operations running in this -// Context complete. +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this Context complete. func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) { if cur, ok := parent.Deadline(); ok && cur.Before(deadline) { // The current deadline is already sooner than the new one. @@ -380,7 +392,11 @@ func (c *timerCtx) String() string { } func (c *timerCtx) cancel(removeFromParent bool, err error) { - c.cancelCtx.cancel(removeFromParent, err) + c.cancelCtx.cancel(false, err) + if removeFromParent { + // Remove this timerCtx from its parent cancelCtx's children. + removeChild(c.cancelCtx.Context, c) + } c.mu.Lock() if c.timer != nil { c.timer.Stop() @@ -391,9 +407,8 @@ func (c *timerCtx) cancel(removeFromParent bool, err error) { // WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)). // -// Canceling this context releases resources associated with the deadline -// timer, so code should call cancel as soon as the operations running in this -// Context complete: +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this Context complete: // // func slowOperationWithTimeout(ctx context.Context) (Result, error) { // ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) diff --git a/Godeps/_workspace/src/golang.org/x/net/context/context_test.go b/Godeps/_workspace/src/golang.org/x/net/context/context_test.go index 82d2494a4..05345fc5e 100644 --- a/Godeps/_workspace/src/golang.org/x/net/context/context_test.go +++ b/Godeps/_workspace/src/golang.org/x/net/context/context_test.go @@ -375,7 +375,7 @@ func TestAllocs(t *testing.T) { <-c.Done() }, limit: 8, - gccgoLimit: 13, + gccgoLimit: 15, }, { desc: "WithCancel(bg)", @@ -536,7 +536,7 @@ func testLayers(t *testing.T, seed int64, testTimeout bool) { if testTimeout { select { case <-ctx.Done(): - case <-time.After(timeout + timeout/10): + case <-time.After(timeout + 100*time.Millisecond): errorf("ctx should have timed out") } checkValues("after timeout") @@ -551,3 +551,25 @@ func testLayers(t *testing.T, seed int64, testTimeout bool) { checkValues("after cancel") } } + +func TestCancelRemoves(t *testing.T) { + checkChildren := func(when string, ctx Context, want int) { + if got := len(ctx.(*cancelCtx).children); got != want { + t.Errorf("%s: context has %d children, want %d", when, got, want) + } + } + + ctx, _ := WithCancel(Background()) + checkChildren("after creation", ctx, 0) + _, cancel := WithCancel(ctx) + checkChildren("with WithCancel child ", ctx, 1) + cancel() + checkChildren("after cancelling WithCancel child", ctx, 0) + + ctx, _ = WithCancel(Background()) + checkChildren("after creation", ctx, 0) + _, cancel = WithTimeout(ctx, 60*time.Minute) + checkChildren("with WithTimeout child ", ctx, 1) + cancel() + checkChildren("after cancelling WithTimeout child", ctx, 0) +} diff --git a/Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/cancelreq.go b/Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/cancelreq.go new file mode 100644 index 000000000..48610e362 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/cancelreq.go @@ -0,0 +1,18 @@ +// Copyright 2015 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. + +// +build go1.5 + +package ctxhttp + +import "net/http" + +func canceler(client *http.Client, req *http.Request) func() { + ch := make(chan struct{}) + req.Cancel = ch + + return func() { + close(ch) + } +} diff --git a/Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/cancelreq_go14.go b/Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/cancelreq_go14.go new file mode 100644 index 000000000..56bcbadb8 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/cancelreq_go14.go @@ -0,0 +1,23 @@ +// Copyright 2015 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. + +// +build !go1.5 + +package ctxhttp + +import "net/http" + +type requestCanceler interface { + CancelRequest(*http.Request) +} + +func canceler(client *http.Client, req *http.Request) func() { + rc, ok := client.Transport.(requestCanceler) + if !ok { + return func() {} + } + return func() { + rc.CancelRequest(req) + } +} diff --git a/Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/ctxhttp.go b/Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/ctxhttp.go new file mode 100644 index 000000000..504dd63ed --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/ctxhttp.go @@ -0,0 +1,79 @@ +// Copyright 2015 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 ctxhttp provides helper functions for performing context-aware HTTP requests. +package ctxhttp // import "golang.org/x/net/context/ctxhttp" + +import ( + "io" + "net/http" + "net/url" + "strings" + + "golang.org/x/net/context" +) + +// Do sends an HTTP request with the provided http.Client and returns an HTTP response. +// If the client is nil, http.DefaultClient is used. +// If the context is canceled or times out, ctx.Err() will be returned. +func Do(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) { + if client == nil { + client = http.DefaultClient + } + + // Request cancelation changed in Go 1.5, see cancelreq.go and cancelreq_go14.go. + cancel := canceler(client, req) + + type responseAndError struct { + resp *http.Response + err error + } + result := make(chan responseAndError, 1) + + go func() { + resp, err := client.Do(req) + result <- responseAndError{resp, err} + }() + + select { + case <-ctx.Done(): + cancel() + return nil, ctx.Err() + case r := <-result: + return r.resp, r.err + } +} + +// Get issues a GET request via the Do function. +func Get(ctx context.Context, client *http.Client, url string) (*http.Response, error) { + req, err := http.NewRequest("GET", url, nil) + if err != nil { + return nil, err + } + return Do(ctx, client, req) +} + +// Head issues a HEAD request via the Do function. +func Head(ctx context.Context, client *http.Client, url string) (*http.Response, error) { + req, err := http.NewRequest("HEAD", url, nil) + if err != nil { + return nil, err + } + return Do(ctx, client, req) +} + +// Post issues a POST request via the Do function. +func Post(ctx context.Context, client *http.Client, url string, bodyType string, body io.Reader) (*http.Response, error) { + req, err := http.NewRequest("POST", url, body) + if err != nil { + return nil, err + } + req.Header.Set("Content-Type", bodyType) + return Do(ctx, client, req) +} + +// PostForm issues a POST request via the Do function. +func PostForm(ctx context.Context, client *http.Client, url string, data url.Values) (*http.Response, error) { + return Post(ctx, client, url, "application/x-www-form-urlencoded", strings.NewReader(data.Encode())) +} diff --git a/Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/ctxhttp_test.go b/Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/ctxhttp_test.go new file mode 100644 index 000000000..47b53d7f1 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/ctxhttp_test.go @@ -0,0 +1,72 @@ +// Copyright 2015 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 ctxhttp + +import ( + "io/ioutil" + "net/http" + "net/http/httptest" + "testing" + "time" + + "golang.org/x/net/context" +) + +const ( + requestDuration = 100 * time.Millisecond + requestBody = "ok" +) + +func TestNoTimeout(t *testing.T) { + ctx := context.Background() + resp, err := doRequest(ctx) + + if resp == nil || err != nil { + t.Fatalf("error received from client: %v %v", err, resp) + } +} +func TestCancel(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + go func() { + time.Sleep(requestDuration / 2) + cancel() + }() + + resp, err := doRequest(ctx) + + if resp != nil || err == nil { + t.Fatalf("expected error, didn't get one. resp: %v", resp) + } + if err != ctx.Err() { + t.Fatalf("expected error from context but got: %v", err) + } +} + +func TestCancelAfterRequest(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + + resp, err := doRequest(ctx) + + // Cancel before reading the body. + // Request.Body should still be readable after the context is canceled. + cancel() + + b, err := ioutil.ReadAll(resp.Body) + if err != nil || string(b) != requestBody { + t.Fatalf("could not read body: %q %v", b, err) + } +} + +func doRequest(ctx context.Context) (*http.Response, error) { + var okHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + time.Sleep(requestDuration) + w.Write([]byte(requestBody)) + }) + + serv := httptest.NewServer(okHandler) + defer serv.Close() + + return Get(ctx, nil, serv.URL) +} diff --git a/Godeps/_workspace/src/golang.org/x/net/internal/iana/const.go b/Godeps/_workspace/src/golang.org/x/net/internal/iana/const.go new file mode 100644 index 000000000..7fe88225c --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/internal/iana/const.go @@ -0,0 +1,181 @@ +// go generate gen.go +// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT + +// Package iana provides protocol number resources managed by the Internet Assigned Numbers Authority (IANA). +package iana // import "golang.org/x/net/internal/iana" + +// Differentiated Services Field Codepoints (DSCP), Updated: 2013-06-25 +const ( + DiffServCS0 = 0x0 // CS0 + DiffServCS1 = 0x20 // CS1 + DiffServCS2 = 0x40 // CS2 + DiffServCS3 = 0x60 // CS3 + DiffServCS4 = 0x80 // CS4 + DiffServCS5 = 0xa0 // CS5 + DiffServCS6 = 0xc0 // CS6 + DiffServCS7 = 0xe0 // CS7 + DiffServAF11 = 0x28 // AF11 + DiffServAF12 = 0x30 // AF12 + DiffServAF13 = 0x38 // AF13 + DiffServAF21 = 0x48 // AF21 + DiffServAF22 = 0x50 // AF22 + DiffServAF23 = 0x58 // AF23 + DiffServAF31 = 0x68 // AF31 + DiffServAF32 = 0x70 // AF32 + DiffServAF33 = 0x78 // AF33 + DiffServAF41 = 0x88 // AF41 + DiffServAF42 = 0x90 // AF42 + DiffServAF43 = 0x98 // AF43 + DiffServEFPHB = 0xb8 // EF PHB + DiffServVOICEADMIT = 0xb0 // VOICE-ADMIT +) + +// IPv4 TOS Byte and IPv6 Traffic Class Octet, Updated: 2001-09-06 +const ( + NotECNTransport = 0x0 // Not-ECT (Not ECN-Capable Transport) + ECNTransport1 = 0x1 // ECT(1) (ECN-Capable Transport(1)) + ECNTransport0 = 0x2 // ECT(0) (ECN-Capable Transport(0)) + CongestionExperienced = 0x3 // CE (Congestion Experienced) +) + +// Protocol Numbers, Updated: 2015-06-23 +const ( + ProtocolIP = 0 // IPv4 encapsulation, pseudo protocol number + ProtocolHOPOPT = 0 // IPv6 Hop-by-Hop Option + ProtocolICMP = 1 // Internet Control Message + ProtocolIGMP = 2 // Internet Group Management + ProtocolGGP = 3 // Gateway-to-Gateway + ProtocolIPv4 = 4 // IPv4 encapsulation + ProtocolST = 5 // Stream + ProtocolTCP = 6 // Transmission Control + ProtocolCBT = 7 // CBT + ProtocolEGP = 8 // Exterior Gateway Protocol + ProtocolIGP = 9 // any private interior gateway (used by Cisco for their IGRP) + ProtocolBBNRCCMON = 10 // BBN RCC Monitoring + ProtocolNVPII = 11 // Network Voice Protocol + ProtocolPUP = 12 // PUP + ProtocolARGUS = 13 // ARGUS + ProtocolEMCON = 14 // EMCON + ProtocolXNET = 15 // Cross Net Debugger + ProtocolCHAOS = 16 // Chaos + ProtocolUDP = 17 // User Datagram + ProtocolMUX = 18 // Multiplexing + ProtocolDCNMEAS = 19 // DCN Measurement Subsystems + ProtocolHMP = 20 // Host Monitoring + ProtocolPRM = 21 // Packet Radio Measurement + ProtocolXNSIDP = 22 // XEROX NS IDP + ProtocolTRUNK1 = 23 // Trunk-1 + ProtocolTRUNK2 = 24 // Trunk-2 + ProtocolLEAF1 = 25 // Leaf-1 + ProtocolLEAF2 = 26 // Leaf-2 + ProtocolRDP = 27 // Reliable Data Protocol + ProtocolIRTP = 28 // Internet Reliable Transaction + ProtocolISOTP4 = 29 // ISO Transport Protocol Class 4 + ProtocolNETBLT = 30 // Bulk Data Transfer Protocol + ProtocolMFENSP = 31 // MFE Network Services Protocol + ProtocolMERITINP = 32 // MERIT Internodal Protocol + ProtocolDCCP = 33 // Datagram Congestion Control Protocol + Protocol3PC = 34 // Third Party Connect Protocol + ProtocolIDPR = 35 // Inter-Domain Policy Routing Protocol + ProtocolXTP = 36 // XTP + ProtocolDDP = 37 // Datagram Delivery Protocol + ProtocolIDPRCMTP = 38 // IDPR Control Message Transport Proto + ProtocolTPPP = 39 // TP++ Transport Protocol + ProtocolIL = 40 // IL Transport Protocol + ProtocolIPv6 = 41 // IPv6 encapsulation + ProtocolSDRP = 42 // Source Demand Routing Protocol + ProtocolIPv6Route = 43 // Routing Header for IPv6 + ProtocolIPv6Frag = 44 // Fragment Header for IPv6 + ProtocolIDRP = 45 // Inter-Domain Routing Protocol + ProtocolRSVP = 46 // Reservation Protocol + ProtocolGRE = 47 // Generic Routing Encapsulation + ProtocolDSR = 48 // Dynamic Source Routing Protocol + ProtocolBNA = 49 // BNA + ProtocolESP = 50 // Encap Security Payload + ProtocolAH = 51 // Authentication Header + ProtocolINLSP = 52 // Integrated Net Layer Security TUBA + ProtocolNARP = 54 // NBMA Address Resolution Protocol + ProtocolMOBILE = 55 // IP Mobility + ProtocolTLSP = 56 // Transport Layer Security Protocol using Kryptonet key management + ProtocolSKIP = 57 // SKIP + ProtocolIPv6ICMP = 58 // ICMP for IPv6 + ProtocolIPv6NoNxt = 59 // No Next Header for IPv6 + ProtocolIPv6Opts = 60 // Destination Options for IPv6 + ProtocolCFTP = 62 // CFTP + ProtocolSATEXPAK = 64 // SATNET and Backroom EXPAK + ProtocolKRYPTOLAN = 65 // Kryptolan + ProtocolRVD = 66 // MIT Remote Virtual Disk Protocol + ProtocolIPPC = 67 // Internet Pluribus Packet Core + ProtocolSATMON = 69 // SATNET Monitoring + ProtocolVISA = 70 // VISA Protocol + ProtocolIPCV = 71 // Internet Packet Core Utility + ProtocolCPNX = 72 // Computer Protocol Network Executive + ProtocolCPHB = 73 // Computer Protocol Heart Beat + ProtocolWSN = 74 // Wang Span Network + ProtocolPVP = 75 // Packet Video Protocol + ProtocolBRSATMON = 76 // Backroom SATNET Monitoring + ProtocolSUNND = 77 // SUN ND PROTOCOL-Temporary + ProtocolWBMON = 78 // WIDEBAND Monitoring + ProtocolWBEXPAK = 79 // WIDEBAND EXPAK + ProtocolISOIP = 80 // ISO Internet Protocol + ProtocolVMTP = 81 // VMTP + ProtocolSECUREVMTP = 82 // SECURE-VMTP + ProtocolVINES = 83 // VINES + ProtocolTTP = 84 // Transaction Transport Protocol + ProtocolIPTM = 84 // Internet Protocol Traffic Manager + ProtocolNSFNETIGP = 85 // NSFNET-IGP + ProtocolDGP = 86 // Dissimilar Gateway Protocol + ProtocolTCF = 87 // TCF + ProtocolEIGRP = 88 // EIGRP + ProtocolOSPFIGP = 89 // OSPFIGP + ProtocolSpriteRPC = 90 // Sprite RPC Protocol + ProtocolLARP = 91 // Locus Address Resolution Protocol + ProtocolMTP = 92 // Multicast Transport Protocol + ProtocolAX25 = 93 // AX.25 Frames + ProtocolIPIP = 94 // IP-within-IP Encapsulation Protocol + ProtocolSCCSP = 96 // Semaphore Communications Sec. Pro. + ProtocolETHERIP = 97 // Ethernet-within-IP Encapsulation + ProtocolENCAP = 98 // Encapsulation Header + ProtocolGMTP = 100 // GMTP + ProtocolIFMP = 101 // Ipsilon Flow Management Protocol + ProtocolPNNI = 102 // PNNI over IP + ProtocolPIM = 103 // Protocol Independent Multicast + ProtocolARIS = 104 // ARIS + ProtocolSCPS = 105 // SCPS + ProtocolQNX = 106 // QNX + ProtocolAN = 107 // Active Networks + ProtocolIPComp = 108 // IP Payload Compression Protocol + ProtocolSNP = 109 // Sitara Networks Protocol + ProtocolCompaqPeer = 110 // Compaq Peer Protocol + ProtocolIPXinIP = 111 // IPX in IP + ProtocolVRRP = 112 // Virtual Router Redundancy Protocol + ProtocolPGM = 113 // PGM Reliable Transport Protocol + ProtocolL2TP = 115 // Layer Two Tunneling Protocol + ProtocolDDX = 116 // D-II Data Exchange (DDX) + ProtocolIATP = 117 // Interactive Agent Transfer Protocol + ProtocolSTP = 118 // Schedule Transfer Protocol + ProtocolSRP = 119 // SpectraLink Radio Protocol + ProtocolUTI = 120 // UTI + ProtocolSMP = 121 // Simple Message Protocol + ProtocolPTP = 123 // Performance Transparency Protocol + ProtocolISIS = 124 // ISIS over IPv4 + ProtocolFIRE = 125 // FIRE + ProtocolCRTP = 126 // Combat Radio Transport Protocol + ProtocolCRUDP = 127 // Combat Radio User Datagram + ProtocolSSCOPMCE = 128 // SSCOPMCE + ProtocolIPLT = 129 // IPLT + ProtocolSPS = 130 // Secure Packet Shield + ProtocolPIPE = 131 // Private IP Encapsulation within IP + ProtocolSCTP = 132 // Stream Control Transmission Protocol + ProtocolFC = 133 // Fibre Channel + ProtocolRSVPE2EIGNORE = 134 // RSVP-E2E-IGNORE + ProtocolMobilityHeader = 135 // Mobility Header + ProtocolUDPLite = 136 // UDPLite + ProtocolMPLSinIP = 137 // MPLS-in-IP + ProtocolMANET = 138 // MANET Protocols + ProtocolHIP = 139 // Host Identity Protocol + ProtocolShim6 = 140 // Shim6 Protocol + ProtocolWESP = 141 // Wrapped Encapsulating Security Payload + ProtocolROHC = 142 // Robust Header Compression + ProtocolReserved = 255 // Reserved +) diff --git a/Godeps/_workspace/src/golang.org/x/net/internal/iana/gen.go b/Godeps/_workspace/src/golang.org/x/net/internal/iana/gen.go new file mode 100644 index 000000000..2d8c07ca1 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/internal/iana/gen.go @@ -0,0 +1,293 @@ +// 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. + +// +build ignore + +//go:generate go run gen.go + +// This program generates internet protocol constants and tables by +// reading IANA protocol registries. +package main + +import ( + "bytes" + "encoding/xml" + "fmt" + "go/format" + "io" + "io/ioutil" + "net/http" + "os" + "strconv" + "strings" +) + +var registries = []struct { + url string + parse func(io.Writer, io.Reader) error +}{ + { + "http://www.iana.org/assignments/dscp-registry/dscp-registry.xml", + parseDSCPRegistry, + }, + { + "http://www.iana.org/assignments/ipv4-tos-byte/ipv4-tos-byte.xml", + parseTOSTCByte, + }, + { + "http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml", + parseProtocolNumbers, + }, +} + +func main() { + var bb bytes.Buffer + fmt.Fprintf(&bb, "// go generate gen.go\n") + fmt.Fprintf(&bb, "// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n") + fmt.Fprintf(&bb, "// Package iana provides protocol number resources managed by the Internet Assigned Numbers Authority (IANA).\n") + fmt.Fprintf(&bb, `package iana // import "golang.org/x/net/internal/iana"`+"\n\n") + for _, r := range registries { + resp, err := http.Get(r.url) + if err != nil { + fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } + defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { + fmt.Fprintf(os.Stderr, "got HTTP status code %v for %v\n", resp.StatusCode, r.url) + os.Exit(1) + } + if err := r.parse(&bb, resp.Body); err != nil { + fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } + fmt.Fprintf(&bb, "\n") + } + b, err := format.Source(bb.Bytes()) + if err != nil { + fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } + if err := ioutil.WriteFile("const.go", b, 0644); err != nil { + fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } +} + +func parseDSCPRegistry(w io.Writer, r io.Reader) error { + dec := xml.NewDecoder(r) + var dr dscpRegistry + if err := dec.Decode(&dr); err != nil { + return err + } + drs := dr.escape() + fmt.Fprintf(w, "// %s, Updated: %s\n", dr.Title, dr.Updated) + fmt.Fprintf(w, "const (\n") + for _, dr := range drs { + fmt.Fprintf(w, "DiffServ%s = %#x", dr.Name, dr.Value) + fmt.Fprintf(w, "// %s\n", dr.OrigName) + } + fmt.Fprintf(w, ")\n") + return nil +} + +type dscpRegistry struct { + XMLName xml.Name `xml:"registry"` + Title string `xml:"title"` + Updated string `xml:"updated"` + Note string `xml:"note"` + RegTitle string `xml:"registry>title"` + PoolRecords []struct { + Name string `xml:"name"` + Space string `xml:"space"` + } `xml:"registry>record"` + Records []struct { + Name string `xml:"name"` + Space string `xml:"space"` + } `xml:"registry>registry>record"` +} + +type canonDSCPRecord struct { + OrigName string + Name string + Value int +} + +func (drr *dscpRegistry) escape() []canonDSCPRecord { + drs := make([]canonDSCPRecord, len(drr.Records)) + sr := strings.NewReplacer( + "+", "", + "-", "", + "/", "", + ".", "", + " ", "", + ) + for i, dr := range drr.Records { + s := strings.TrimSpace(dr.Name) + drs[i].OrigName = s + drs[i].Name = sr.Replace(s) + n, err := strconv.ParseUint(dr.Space, 2, 8) + if err != nil { + continue + } + drs[i].Value = int(n) << 2 + } + return drs +} + +func parseTOSTCByte(w io.Writer, r io.Reader) error { + dec := xml.NewDecoder(r) + var ttb tosTCByte + if err := dec.Decode(&ttb); err != nil { + return err + } + trs := ttb.escape() + fmt.Fprintf(w, "// %s, Updated: %s\n", ttb.Title, ttb.Updated) + fmt.Fprintf(w, "const (\n") + for _, tr := range trs { + fmt.Fprintf(w, "%s = %#x", tr.Keyword, tr.Value) + fmt.Fprintf(w, "// %s\n", tr.OrigKeyword) + } + fmt.Fprintf(w, ")\n") + return nil +} + +type tosTCByte struct { + XMLName xml.Name `xml:"registry"` + Title string `xml:"title"` + Updated string `xml:"updated"` + Note string `xml:"note"` + RegTitle string `xml:"registry>title"` + Records []struct { + Binary string `xml:"binary"` + Keyword string `xml:"keyword"` + } `xml:"registry>record"` +} + +type canonTOSTCByteRecord struct { + OrigKeyword string + Keyword string + Value int +} + +func (ttb *tosTCByte) escape() []canonTOSTCByteRecord { + trs := make([]canonTOSTCByteRecord, len(ttb.Records)) + sr := strings.NewReplacer( + "Capable", "", + "(", "", + ")", "", + "+", "", + "-", "", + "/", "", + ".", "", + " ", "", + ) + for i, tr := range ttb.Records { + s := strings.TrimSpace(tr.Keyword) + trs[i].OrigKeyword = s + ss := strings.Split(s, " ") + if len(ss) > 1 { + trs[i].Keyword = strings.Join(ss[1:], " ") + } else { + trs[i].Keyword = ss[0] + } + trs[i].Keyword = sr.Replace(trs[i].Keyword) + n, err := strconv.ParseUint(tr.Binary, 2, 8) + if err != nil { + continue + } + trs[i].Value = int(n) + } + return trs +} + +func parseProtocolNumbers(w io.Writer, r io.Reader) error { + dec := xml.NewDecoder(r) + var pn protocolNumbers + if err := dec.Decode(&pn); err != nil { + return err + } + prs := pn.escape() + prs = append([]canonProtocolRecord{{ + Name: "IP", + Descr: "IPv4 encapsulation, pseudo protocol number", + Value: 0, + }}, prs...) + fmt.Fprintf(w, "// %s, Updated: %s\n", pn.Title, pn.Updated) + fmt.Fprintf(w, "const (\n") + for _, pr := range prs { + if pr.Name == "" { + continue + } + fmt.Fprintf(w, "Protocol%s = %d", pr.Name, pr.Value) + s := pr.Descr + if s == "" { + s = pr.OrigName + } + fmt.Fprintf(w, "// %s\n", s) + } + fmt.Fprintf(w, ")\n") + return nil +} + +type protocolNumbers struct { + XMLName xml.Name `xml:"registry"` + Title string `xml:"title"` + Updated string `xml:"updated"` + RegTitle string `xml:"registry>title"` + Note string `xml:"registry>note"` + Records []struct { + Value string `xml:"value"` + Name string `xml:"name"` + Descr string `xml:"description"` + } `xml:"registry>record"` +} + +type canonProtocolRecord struct { + OrigName string + Name string + Descr string + Value int +} + +func (pn *protocolNumbers) escape() []canonProtocolRecord { + prs := make([]canonProtocolRecord, len(pn.Records)) + sr := strings.NewReplacer( + "-in-", "in", + "-within-", "within", + "-over-", "over", + "+", "P", + "-", "", + "/", "", + ".", "", + " ", "", + ) + for i, pr := range pn.Records { + if strings.Contains(pr.Name, "Deprecated") || + strings.Contains(pr.Name, "deprecated") { + continue + } + prs[i].OrigName = pr.Name + s := strings.TrimSpace(pr.Name) + switch pr.Name { + case "ISIS over IPv4": + prs[i].Name = "ISIS" + case "manet": + prs[i].Name = "MANET" + default: + prs[i].Name = sr.Replace(s) + } + ss := strings.Split(pr.Descr, "\n") + for i := range ss { + ss[i] = strings.TrimSpace(ss[i]) + } + if len(ss) > 1 { + prs[i].Descr = strings.Join(ss, " ") + } else { + prs[i].Descr = ss[0] + } + prs[i].Value, _ = strconv.Atoi(pr.Value) + } + return prs +} diff --git a/Godeps/_workspace/src/golang.org/x/net/internal/nettest/error_posix.go b/Godeps/_workspace/src/golang.org/x/net/internal/nettest/error_posix.go new file mode 100644 index 000000000..963ed9965 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/internal/nettest/error_posix.go @@ -0,0 +1,31 @@ +// 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. + +// +build darwin dragonfly freebsd linux netbsd openbsd solaris windows + +package nettest + +import ( + "os" + "syscall" +) + +func protocolNotSupported(err error) bool { + switch err := err.(type) { + case syscall.Errno: + switch err { + case syscall.EPROTONOSUPPORT, syscall.ENOPROTOOPT: + return true + } + case *os.SyscallError: + switch err := err.Err.(type) { + case syscall.Errno: + switch err { + case syscall.EPROTONOSUPPORT, syscall.ENOPROTOOPT: + return true + } + } + } + return false +} diff --git a/Godeps/_workspace/src/golang.org/x/net/internal/nettest/error_stub.go b/Godeps/_workspace/src/golang.org/x/net/internal/nettest/error_stub.go new file mode 100644 index 000000000..3c74d812f --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/internal/nettest/error_stub.go @@ -0,0 +1,11 @@ +// 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. + +// +build nacl plan9 + +package nettest + +func protocolNotSupported(err error) bool { + return false +} diff --git a/Godeps/_workspace/src/golang.org/x/net/internal/nettest/interface.go b/Godeps/_workspace/src/golang.org/x/net/internal/nettest/interface.go new file mode 100644 index 000000000..53ae13a98 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/internal/nettest/interface.go @@ -0,0 +1,94 @@ +// Copyright 2012 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 nettest + +import "net" + +// IsMulticastCapable reports whether ifi is an IP multicast-capable +// network interface. Network must be "ip", "ip4" or "ip6". +func IsMulticastCapable(network string, ifi *net.Interface) (net.IP, bool) { + switch network { + case "ip", "ip4", "ip6": + default: + return nil, false + } + if ifi == nil || ifi.Flags&net.FlagUp == 0 || ifi.Flags&net.FlagMulticast == 0 { + return nil, false + } + return hasRoutableIP(network, ifi) +} + +// RoutedInterface returns a network interface that can route IP +// traffic and satisfies flags. It returns nil when an appropriate +// network interface is not found. Network must be "ip", "ip4" or +// "ip6". +func RoutedInterface(network string, flags net.Flags) *net.Interface { + switch network { + case "ip", "ip4", "ip6": + default: + return nil + } + ift, err := net.Interfaces() + if err != nil { + return nil + } + for _, ifi := range ift { + if ifi.Flags&flags != flags { + continue + } + if _, ok := hasRoutableIP(network, &ifi); !ok { + continue + } + return &ifi + } + return nil +} + +func hasRoutableIP(network string, ifi *net.Interface) (net.IP, bool) { + ifat, err := ifi.Addrs() + if err != nil { + return nil, false + } + for _, ifa := range ifat { + switch ifa := ifa.(type) { + case *net.IPAddr: + if ip := routableIP(network, ifa.IP); ip != nil { + return ip, true + } + case *net.IPNet: + if ip := routableIP(network, ifa.IP); ip != nil { + return ip, true + } + } + } + return nil, false +} + +func routableIP(network string, ip net.IP) net.IP { + if !ip.IsLoopback() && !ip.IsLinkLocalUnicast() && !ip.IsGlobalUnicast() { + return nil + } + switch network { + case "ip4": + if ip := ip.To4(); ip != nil { + return ip + } + case "ip6": + if ip.IsLoopback() { // addressing scope of the loopback address depends on each implementation + return nil + } + if ip := ip.To16(); ip != nil && ip.To4() == nil { + return ip + } + default: + if ip := ip.To4(); ip != nil { + return ip + } + if ip := ip.To16(); ip != nil { + return ip + } + } + return nil +} diff --git a/Godeps/_workspace/src/golang.org/x/net/internal/nettest/rlimit.go b/Godeps/_workspace/src/golang.org/x/net/internal/nettest/rlimit.go new file mode 100644 index 000000000..bb34aec0b --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/internal/nettest/rlimit.go @@ -0,0 +1,11 @@ +// Copyright 2015 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 nettest + +const defaultMaxOpenFiles = 256 + +// MaxOpenFiles returns the maximum number of open files for the +// caller's process. +func MaxOpenFiles() int { return maxOpenFiles() } diff --git a/Godeps/_workspace/src/golang.org/x/net/internal/nettest/rlimit_stub.go b/Godeps/_workspace/src/golang.org/x/net/internal/nettest/rlimit_stub.go new file mode 100644 index 000000000..102bef930 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/internal/nettest/rlimit_stub.go @@ -0,0 +1,9 @@ +// Copyright 2015 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. + +// +build nacl plan9 + +package nettest + +func maxOpenFiles() int { return defaultMaxOpenFiles } diff --git a/Godeps/_workspace/src/golang.org/x/net/internal/nettest/rlimit_unix.go b/Godeps/_workspace/src/golang.org/x/net/internal/nettest/rlimit_unix.go new file mode 100644 index 000000000..eb4312ce3 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/internal/nettest/rlimit_unix.go @@ -0,0 +1,17 @@ +// Copyright 2015 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. + +// +build darwin dragonfly freebsd linux netbsd openbsd solaris + +package nettest + +import "syscall" + +func maxOpenFiles() int { + var rlim syscall.Rlimit + if err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rlim); err != nil { + return defaultMaxOpenFiles + } + return int(rlim.Cur) +} diff --git a/Godeps/_workspace/src/golang.org/x/net/internal/nettest/rlimit_windows.go b/Godeps/_workspace/src/golang.org/x/net/internal/nettest/rlimit_windows.go new file mode 100644 index 000000000..de927b56e --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/internal/nettest/rlimit_windows.go @@ -0,0 +1,7 @@ +// Copyright 2015 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 nettest + +func maxOpenFiles() int { return 4 * defaultMaxOpenFiles /* actually it's 16581375 */ } diff --git a/Godeps/_workspace/src/golang.org/x/net/internal/nettest/stack.go b/Godeps/_workspace/src/golang.org/x/net/internal/nettest/stack.go new file mode 100644 index 000000000..e07c015f3 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/internal/nettest/stack.go @@ -0,0 +1,36 @@ +// 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 nettest provides utilities for IP testing. +package nettest // import "golang.org/x/net/internal/nettest" + +import "net" + +// SupportsIPv4 reports whether the platform supports IPv4 networking +// functionality. +func SupportsIPv4() bool { + ln, err := net.Listen("tcp4", "127.0.0.1:0") + if err != nil { + return false + } + ln.Close() + return true +} + +// SupportsIPv6 reports whether the platform supports IPv6 networking +// functionality. +func SupportsIPv6() bool { + ln, err := net.Listen("tcp6", "[::1]:0") + if err != nil { + return false + } + ln.Close() + return true +} + +// ProtocolNotSupported reports whether err is a protocol not +// supported error. +func ProtocolNotSupported(err error) bool { + return protocolNotSupported(err) +} diff --git a/Godeps/_workspace/src/golang.org/x/net/internal/nettest/stack_stub.go b/Godeps/_workspace/src/golang.org/x/net/internal/nettest/stack_stub.go new file mode 100644 index 000000000..1b5fde1a3 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/internal/nettest/stack_stub.go @@ -0,0 +1,18 @@ +// Copyright 2015 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. + +// +build nacl plan9 + +package nettest + +import ( + "fmt" + "runtime" +) + +// SupportsRawIPSocket reports whether the platform supports raw IP +// sockets. +func SupportsRawIPSocket() (string, bool) { + return fmt.Sprintf("not supported on %s", runtime.GOOS), false +} diff --git a/Godeps/_workspace/src/golang.org/x/net/internal/nettest/stack_unix.go b/Godeps/_workspace/src/golang.org/x/net/internal/nettest/stack_unix.go new file mode 100644 index 000000000..af89229f4 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/internal/nettest/stack_unix.go @@ -0,0 +1,22 @@ +// Copyright 2015 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. + +// +build darwin dragonfly freebsd linux netbsd openbsd solaris + +package nettest + +import ( + "fmt" + "os" + "runtime" +) + +// SupportsRawIPSocket reports whether the platform supports raw IP +// sockets. +func SupportsRawIPSocket() (string, bool) { + if os.Getuid() != 0 { + return fmt.Sprintf("must be root on %s", runtime.GOOS), false + } + return "", true +} diff --git a/Godeps/_workspace/src/golang.org/x/net/internal/nettest/stack_windows.go b/Godeps/_workspace/src/golang.org/x/net/internal/nettest/stack_windows.go new file mode 100644 index 000000000..a21f4993e --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/internal/nettest/stack_windows.go @@ -0,0 +1,32 @@ +// Copyright 2015 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 nettest + +import ( + "fmt" + "runtime" + "syscall" +) + +// SupportsRawIPSocket reports whether the platform supports raw IP +// sockets. +func SupportsRawIPSocket() (string, bool) { + // From http://msdn.microsoft.com/en-us/library/windows/desktop/ms740548.aspx: + // Note: To use a socket of type SOCK_RAW requires administrative privileges. + // Users running Winsock applications that use raw sockets must be a member of + // the Administrators group on the local computer, otherwise raw socket calls + // will fail with an error code of WSAEACCES. On Windows Vista and later, access + // for raw sockets is enforced at socket creation. In earlier versions of Windows, + // access for raw sockets is enforced during other socket operations. + s, err := syscall.Socket(syscall.AF_INET, syscall.SOCK_RAW, 0) + if err == syscall.WSAEACCES { + return fmt.Sprintf("no access to raw socket allowed on %s", runtime.GOOS), false + } + if err != nil { + return err.Error(), false + } + syscall.Closesocket(s) + return "", true +} diff --git a/Godeps/_workspace/src/golang.org/x/net/internal/timeseries/timeseries.go b/Godeps/_workspace/src/golang.org/x/net/internal/timeseries/timeseries.go new file mode 100644 index 000000000..1119f3448 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/internal/timeseries/timeseries.go @@ -0,0 +1,525 @@ +// Copyright 2015 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 timeseries implements a time series structure for stats collection. +package timeseries // import "golang.org/x/net/internal/timeseries" + +import ( + "fmt" + "log" + "time" +) + +const ( + timeSeriesNumBuckets = 64 + minuteHourSeriesNumBuckets = 60 +) + +var timeSeriesResolutions = []time.Duration{ + 1 * time.Second, + 10 * time.Second, + 1 * time.Minute, + 10 * time.Minute, + 1 * time.Hour, + 6 * time.Hour, + 24 * time.Hour, // 1 day + 7 * 24 * time.Hour, // 1 week + 4 * 7 * 24 * time.Hour, // 4 weeks + 16 * 7 * 24 * time.Hour, // 16 weeks +} + +var minuteHourSeriesResolutions = []time.Duration{ + 1 * time.Second, + 1 * time.Minute, +} + +// An Observable is a kind of data that can be aggregated in a time series. +type Observable interface { + Multiply(ratio float64) // Multiplies the data in self by a given ratio + Add(other Observable) // Adds the data from a different observation to self + Clear() // Clears the observation so it can be reused. + CopyFrom(other Observable) // Copies the contents of a given observation to self +} + +// Float attaches the methods of Observable to a float64. +type Float float64 + +// NewFloat returns a Float. +func NewFloat() Observable { + f := Float(0) + return &f +} + +// String returns the float as a string. +func (f *Float) String() string { return fmt.Sprintf("%g", f.Value()) } + +// Value returns the float's value. +func (f *Float) Value() float64 { return float64(*f) } + +func (f *Float) Multiply(ratio float64) { *f *= Float(ratio) } + +func (f *Float) Add(other Observable) { + o := other.(*Float) + *f += *o +} + +func (f *Float) Clear() { *f = 0 } + +func (f *Float) CopyFrom(other Observable) { + o := other.(*Float) + *f = *o +} + +// A Clock tells the current time. +type Clock interface { + Time() time.Time +} + +type defaultClock int + +var defaultClockInstance defaultClock + +func (defaultClock) Time() time.Time { return time.Now() } + +// Information kept per level. Each level consists of a circular list of +// observations. The start of the level may be derived from end and the +// len(buckets) * sizeInMillis. +type tsLevel struct { + oldest int // index to oldest bucketed Observable + newest int // index to newest bucketed Observable + end time.Time // end timestamp for this level + size time.Duration // duration of the bucketed Observable + buckets []Observable // collections of observations + provider func() Observable // used for creating new Observable +} + +func (l *tsLevel) Clear() { + l.oldest = 0 + l.newest = len(l.buckets) - 1 + l.end = time.Time{} + for i := range l.buckets { + if l.buckets[i] != nil { + l.buckets[i].Clear() + l.buckets[i] = nil + } + } +} + +func (l *tsLevel) InitLevel(size time.Duration, numBuckets int, f func() Observable) { + l.size = size + l.provider = f + l.buckets = make([]Observable, numBuckets) +} + +// Keeps a sequence of levels. Each level is responsible for storing data at +// a given resolution. For example, the first level stores data at a one +// minute resolution while the second level stores data at a one hour +// resolution. + +// Each level is represented by a sequence of buckets. Each bucket spans an +// interval equal to the resolution of the level. New observations are added +// to the last bucket. +type timeSeries struct { + provider func() Observable // make more Observable + numBuckets int // number of buckets in each level + levels []*tsLevel // levels of bucketed Observable + lastAdd time.Time // time of last Observable tracked + total Observable // convenient aggregation of all Observable + clock Clock // Clock for getting current time + pending Observable // observations not yet bucketed + pendingTime time.Time // what time are we keeping in pending + dirty bool // if there are pending observations +} + +// init initializes a level according to the supplied criteria. +func (ts *timeSeries) init(resolutions []time.Duration, f func() Observable, numBuckets int, clock Clock) { + ts.provider = f + ts.numBuckets = numBuckets + ts.clock = clock + ts.levels = make([]*tsLevel, len(resolutions)) + + for i := range resolutions { + if i > 0 && resolutions[i-1] >= resolutions[i] { + log.Print("timeseries: resolutions must be monotonically increasing") + break + } + newLevel := new(tsLevel) + newLevel.InitLevel(resolutions[i], ts.numBuckets, ts.provider) + ts.levels[i] = newLevel + } + + ts.Clear() +} + +// Clear removes all observations from the time series. +func (ts *timeSeries) Clear() { + ts.lastAdd = time.Time{} + ts.total = ts.resetObservation(ts.total) + ts.pending = ts.resetObservation(ts.pending) + ts.pendingTime = time.Time{} + ts.dirty = false + + for i := range ts.levels { + ts.levels[i].Clear() + } +} + +// Add records an observation at the current time. +func (ts *timeSeries) Add(observation Observable) { + ts.AddWithTime(observation, ts.clock.Time()) +} + +// AddWithTime records an observation at the specified time. +func (ts *timeSeries) AddWithTime(observation Observable, t time.Time) { + + smallBucketDuration := ts.levels[0].size + + if t.After(ts.lastAdd) { + ts.lastAdd = t + } + + if t.After(ts.pendingTime) { + ts.advance(t) + ts.mergePendingUpdates() + ts.pendingTime = ts.levels[0].end + ts.pending.CopyFrom(observation) + ts.dirty = true + } else if t.After(ts.pendingTime.Add(-1 * smallBucketDuration)) { + // The observation is close enough to go into the pending bucket. + // This compensates for clock skewing and small scheduling delays + // by letting the update stay in the fast path. + ts.pending.Add(observation) + ts.dirty = true + } else { + ts.mergeValue(observation, t) + } +} + +// mergeValue inserts the observation at the specified time in the past into all levels. +func (ts *timeSeries) mergeValue(observation Observable, t time.Time) { + for _, level := range ts.levels { + index := (ts.numBuckets - 1) - int(level.end.Sub(t)/level.size) + if 0 <= index && index < ts.numBuckets { + bucketNumber := (level.oldest + index) % ts.numBuckets + if level.buckets[bucketNumber] == nil { + level.buckets[bucketNumber] = level.provider() + } + level.buckets[bucketNumber].Add(observation) + } + } + ts.total.Add(observation) +} + +// mergePendingUpdates applies the pending updates into all levels. +func (ts *timeSeries) mergePendingUpdates() { + if ts.dirty { + ts.mergeValue(ts.pending, ts.pendingTime) + ts.pending = ts.resetObservation(ts.pending) + ts.dirty = false + } +} + +// advance cycles the buckets at each level until the latest bucket in +// each level can hold the time specified. +func (ts *timeSeries) advance(t time.Time) { + if !t.After(ts.levels[0].end) { + return + } + for i := 0; i < len(ts.levels); i++ { + level := ts.levels[i] + if !level.end.Before(t) { + break + } + + // If the time is sufficiently far, just clear the level and advance + // directly. + if !t.Before(level.end.Add(level.size * time.Duration(ts.numBuckets))) { + for _, b := range level.buckets { + ts.resetObservation(b) + } + level.end = time.Unix(0, (t.UnixNano()/level.size.Nanoseconds())*level.size.Nanoseconds()) + } + + for t.After(level.end) { + level.end = level.end.Add(level.size) + level.newest = level.oldest + level.oldest = (level.oldest + 1) % ts.numBuckets + ts.resetObservation(level.buckets[level.newest]) + } + + t = level.end + } +} + +// Latest returns the sum of the num latest buckets from the level. +func (ts *timeSeries) Latest(level, num int) Observable { + now := ts.clock.Time() + if ts.levels[0].end.Before(now) { + ts.advance(now) + } + + ts.mergePendingUpdates() + + result := ts.provider() + l := ts.levels[level] + index := l.newest + + for i := 0; i < num; i++ { + if l.buckets[index] != nil { + result.Add(l.buckets[index]) + } + if index == 0 { + index = ts.numBuckets + } + index-- + } + + return result +} + +// LatestBuckets returns a copy of the num latest buckets from level. +func (ts *timeSeries) LatestBuckets(level, num int) []Observable { + if level < 0 || level > len(ts.levels) { + log.Print("timeseries: bad level argument: ", level) + return nil + } + if num < 0 || num >= ts.numBuckets { + log.Print("timeseries: bad num argument: ", num) + return nil + } + + results := make([]Observable, num) + now := ts.clock.Time() + if ts.levels[0].end.Before(now) { + ts.advance(now) + } + + ts.mergePendingUpdates() + + l := ts.levels[level] + index := l.newest + + for i := 0; i < num; i++ { + result := ts.provider() + results[i] = result + if l.buckets[index] != nil { + result.CopyFrom(l.buckets[index]) + } + + if index == 0 { + index = ts.numBuckets + } + index -= 1 + } + return results +} + +// ScaleBy updates observations by scaling by factor. +func (ts *timeSeries) ScaleBy(factor float64) { + for _, l := range ts.levels { + for i := 0; i < ts.numBuckets; i++ { + l.buckets[i].Multiply(factor) + } + } + + ts.total.Multiply(factor) + ts.pending.Multiply(factor) +} + +// Range returns the sum of observations added over the specified time range. +// If start or finish times don't fall on bucket boundaries of the same +// level, then return values are approximate answers. +func (ts *timeSeries) Range(start, finish time.Time) Observable { + return ts.ComputeRange(start, finish, 1)[0] +} + +// Recent returns the sum of observations from the last delta. +func (ts *timeSeries) Recent(delta time.Duration) Observable { + now := ts.clock.Time() + return ts.Range(now.Add(-delta), now) +} + +// Total returns the total of all observations. +func (ts *timeSeries) Total() Observable { + ts.mergePendingUpdates() + return ts.total +} + +// ComputeRange computes a specified number of values into a slice using +// the observations recorded over the specified time period. The return +// values are approximate if the start or finish times don't fall on the +// bucket boundaries at the same level or if the number of buckets spanning +// the range is not an integral multiple of num. +func (ts *timeSeries) ComputeRange(start, finish time.Time, num int) []Observable { + if start.After(finish) { + log.Printf("timeseries: start > finish, %v>%v", start, finish) + return nil + } + + if num < 0 { + log.Printf("timeseries: num < 0, %v", num) + return nil + } + + results := make([]Observable, num) + + for _, l := range ts.levels { + if !start.Before(l.end.Add(-l.size * time.Duration(ts.numBuckets))) { + ts.extract(l, start, finish, num, results) + return results + } + } + + // Failed to find a level that covers the desired range. So just + // extract from the last level, even if it doesn't cover the entire + // desired range. + ts.extract(ts.levels[len(ts.levels)-1], start, finish, num, results) + + return results +} + +// RecentList returns the specified number of values in slice over the most +// recent time period of the specified range. +func (ts *timeSeries) RecentList(delta time.Duration, num int) []Observable { + if delta < 0 { + return nil + } + now := ts.clock.Time() + return ts.ComputeRange(now.Add(-delta), now, num) +} + +// extract returns a slice of specified number of observations from a given +// level over a given range. +func (ts *timeSeries) extract(l *tsLevel, start, finish time.Time, num int, results []Observable) { + ts.mergePendingUpdates() + + srcInterval := l.size + dstInterval := finish.Sub(start) / time.Duration(num) + dstStart := start + srcStart := l.end.Add(-srcInterval * time.Duration(ts.numBuckets)) + + srcIndex := 0 + + // Where should scanning start? + if dstStart.After(srcStart) { + advance := dstStart.Sub(srcStart) / srcInterval + srcIndex += int(advance) + srcStart = srcStart.Add(advance * srcInterval) + } + + // The i'th value is computed as show below. + // interval = (finish/start)/num + // i'th value = sum of observation in range + // [ start + i * interval, + // start + (i + 1) * interval ) + for i := 0; i < num; i++ { + results[i] = ts.resetObservation(results[i]) + dstEnd := dstStart.Add(dstInterval) + for srcIndex < ts.numBuckets && srcStart.Before(dstEnd) { + srcEnd := srcStart.Add(srcInterval) + if srcEnd.After(ts.lastAdd) { + srcEnd = ts.lastAdd + } + + if !srcEnd.Before(dstStart) { + srcValue := l.buckets[(srcIndex+l.oldest)%ts.numBuckets] + if !srcStart.Before(dstStart) && !srcEnd.After(dstEnd) { + // dst completely contains src. + if srcValue != nil { + results[i].Add(srcValue) + } + } else { + // dst partially overlaps src. + overlapStart := maxTime(srcStart, dstStart) + overlapEnd := minTime(srcEnd, dstEnd) + base := srcEnd.Sub(srcStart) + fraction := overlapEnd.Sub(overlapStart).Seconds() / base.Seconds() + + used := ts.provider() + if srcValue != nil { + used.CopyFrom(srcValue) + } + used.Multiply(fraction) + results[i].Add(used) + } + + if srcEnd.After(dstEnd) { + break + } + } + srcIndex++ + srcStart = srcStart.Add(srcInterval) + } + dstStart = dstStart.Add(dstInterval) + } +} + +// resetObservation clears the content so the struct may be reused. +func (ts *timeSeries) resetObservation(observation Observable) Observable { + if observation == nil { + observation = ts.provider() + } else { + observation.Clear() + } + return observation +} + +// TimeSeries tracks data at granularities from 1 second to 16 weeks. +type TimeSeries struct { + timeSeries +} + +// NewTimeSeries creates a new TimeSeries using the function provided for creating new Observable. +func NewTimeSeries(f func() Observable) *TimeSeries { + return NewTimeSeriesWithClock(f, defaultClockInstance) +} + +// NewTimeSeriesWithClock creates a new TimeSeries using the function provided for creating new Observable and the clock for +// assigning timestamps. +func NewTimeSeriesWithClock(f func() Observable, clock Clock) *TimeSeries { + ts := new(TimeSeries) + ts.timeSeries.init(timeSeriesResolutions, f, timeSeriesNumBuckets, clock) + return ts +} + +// MinuteHourSeries tracks data at granularities of 1 minute and 1 hour. +type MinuteHourSeries struct { + timeSeries +} + +// NewMinuteHourSeries creates a new MinuteHourSeries using the function provided for creating new Observable. +func NewMinuteHourSeries(f func() Observable) *MinuteHourSeries { + return NewMinuteHourSeriesWithClock(f, defaultClockInstance) +} + +// NewMinuteHourSeriesWithClock creates a new MinuteHourSeries using the function provided for creating new Observable and the clock for +// assigning timestamps. +func NewMinuteHourSeriesWithClock(f func() Observable, clock Clock) *MinuteHourSeries { + ts := new(MinuteHourSeries) + ts.timeSeries.init(minuteHourSeriesResolutions, f, + minuteHourSeriesNumBuckets, clock) + return ts +} + +func (ts *MinuteHourSeries) Minute() Observable { + return ts.timeSeries.Latest(0, 60) +} + +func (ts *MinuteHourSeries) Hour() Observable { + return ts.timeSeries.Latest(1, 60) +} + +func minTime(a, b time.Time) time.Time { + if a.Before(b) { + return a + } + return b +} + +func maxTime(a, b time.Time) time.Time { + if a.After(b) { + return a + } + return b +} diff --git a/Godeps/_workspace/src/golang.org/x/net/internal/timeseries/timeseries_test.go b/Godeps/_workspace/src/golang.org/x/net/internal/timeseries/timeseries_test.go new file mode 100644 index 000000000..66325a912 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/internal/timeseries/timeseries_test.go @@ -0,0 +1,170 @@ +// Copyright 2015 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 timeseries + +import ( + "math" + "testing" + "time" +) + +func isNear(x *Float, y float64, tolerance float64) bool { + return math.Abs(x.Value()-y) < tolerance +} + +func isApproximate(x *Float, y float64) bool { + return isNear(x, y, 1e-2) +} + +func checkApproximate(t *testing.T, o Observable, y float64) { + x := o.(*Float) + if !isApproximate(x, y) { + t.Errorf("Wanted %g, got %g", y, x.Value()) + } +} + +func checkNear(t *testing.T, o Observable, y, tolerance float64) { + x := o.(*Float) + if !isNear(x, y, tolerance) { + t.Errorf("Wanted %g +- %g, got %g", y, tolerance, x.Value()) + } +} + +var baseTime = time.Date(2013, 1, 1, 0, 0, 0, 0, time.UTC) + +func tu(s int64) time.Time { + return baseTime.Add(time.Duration(s) * time.Second) +} + +func tu2(s int64, ns int64) time.Time { + return baseTime.Add(time.Duration(s)*time.Second + time.Duration(ns)*time.Nanosecond) +} + +func TestBasicTimeSeries(t *testing.T) { + ts := NewTimeSeries(NewFloat) + fo := new(Float) + *fo = Float(10) + ts.AddWithTime(fo, tu(1)) + ts.AddWithTime(fo, tu(1)) + ts.AddWithTime(fo, tu(1)) + ts.AddWithTime(fo, tu(1)) + checkApproximate(t, ts.Range(tu(0), tu(1)), 40) + checkApproximate(t, ts.Total(), 40) + ts.AddWithTime(fo, tu(3)) + ts.AddWithTime(fo, tu(3)) + ts.AddWithTime(fo, tu(3)) + checkApproximate(t, ts.Range(tu(0), tu(2)), 40) + checkApproximate(t, ts.Range(tu(2), tu(4)), 30) + checkApproximate(t, ts.Total(), 70) + ts.AddWithTime(fo, tu(1)) + ts.AddWithTime(fo, tu(1)) + checkApproximate(t, ts.Range(tu(0), tu(2)), 60) + checkApproximate(t, ts.Range(tu(2), tu(4)), 30) + checkApproximate(t, ts.Total(), 90) + *fo = Float(100) + ts.AddWithTime(fo, tu(100)) + checkApproximate(t, ts.Range(tu(99), tu(100)), 100) + checkApproximate(t, ts.Range(tu(0), tu(4)), 36) + checkApproximate(t, ts.Total(), 190) + *fo = Float(10) + ts.AddWithTime(fo, tu(1)) + ts.AddWithTime(fo, tu(1)) + checkApproximate(t, ts.Range(tu(0), tu(4)), 44) + checkApproximate(t, ts.Range(tu(37), tu2(100, 100e6)), 100) + checkApproximate(t, ts.Range(tu(50), tu2(100, 100e6)), 100) + checkApproximate(t, ts.Range(tu(99), tu2(100, 100e6)), 100) + checkApproximate(t, ts.Total(), 210) + + for i, l := range ts.ComputeRange(tu(36), tu(100), 64) { + if i == 63 { + checkApproximate(t, l, 100) + } else { + checkApproximate(t, l, 0) + } + } + + checkApproximate(t, ts.Range(tu(0), tu(100)), 210) + checkApproximate(t, ts.Range(tu(10), tu(100)), 100) + + for i, l := range ts.ComputeRange(tu(0), tu(100), 100) { + if i < 10 { + checkApproximate(t, l, 11) + } else if i >= 90 { + checkApproximate(t, l, 10) + } else { + checkApproximate(t, l, 0) + } + } +} + +func TestFloat(t *testing.T) { + f := Float(1) + if g, w := f.String(), "1"; g != w { + t.Errorf("Float(1).String = %q; want %q", g, w) + } + f2 := Float(2) + var o Observable = &f2 + f.Add(o) + if g, w := f.Value(), 3.0; g != w { + t.Errorf("Float post-add = %v; want %v", g, w) + } + f.Multiply(2) + if g, w := f.Value(), 6.0; g != w { + t.Errorf("Float post-multiply = %v; want %v", g, w) + } + f.Clear() + if g, w := f.Value(), 0.0; g != w { + t.Errorf("Float post-clear = %v; want %v", g, w) + } + f.CopyFrom(&f2) + if g, w := f.Value(), 2.0; g != w { + t.Errorf("Float post-CopyFrom = %v; want %v", g, w) + } +} + +type mockClock struct { + time time.Time +} + +func (m *mockClock) Time() time.Time { return m.time } +func (m *mockClock) Set(t time.Time) { m.time = t } + +const buckets = 6 + +var testResolutions = []time.Duration{ + 10 * time.Second, // level holds one minute of observations + 100 * time.Second, // level holds ten minutes of observations + 10 * time.Minute, // level holds one hour of observations +} + +// TestTimeSeries uses a small number of buckets to force a higher +// error rate on approximations from the timeseries. +type TestTimeSeries struct { + timeSeries +} + +func TestExpectedErrorRate(t *testing.T) { + ts := new(TestTimeSeries) + fake := new(mockClock) + fake.Set(time.Now()) + ts.timeSeries.init(testResolutions, NewFloat, buckets, fake) + for i := 1; i <= 61*61; i++ { + fake.Set(fake.Time().Add(1 * time.Second)) + ob := Float(1) + ts.AddWithTime(&ob, fake.Time()) + + // The results should be accurate within one missing bucket (1/6) of the observations recorded. + checkNear(t, ts.Latest(0, buckets), min(float64(i), 60), 10) + checkNear(t, ts.Latest(1, buckets), min(float64(i), 600), 100) + checkNear(t, ts.Latest(2, buckets), min(float64(i), 3600), 600) + } +} + +func min(a, b float64) float64 { + if a < b { + return a + } + return b +} diff --git a/Godeps/_workspace/src/golang.org/x/net/trace/events.go b/Godeps/_workspace/src/golang.org/x/net/trace/events.go new file mode 100644 index 000000000..e66c7e328 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/trace/events.go @@ -0,0 +1,524 @@ +// Copyright 2015 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 trace + +import ( + "bytes" + "fmt" + "html/template" + "io" + "log" + "net/http" + "runtime" + "sort" + "strconv" + "strings" + "sync" + "sync/atomic" + "text/tabwriter" + "time" +) + +var eventsTmpl = template.Must(template.New("events").Funcs(template.FuncMap{ + "elapsed": elapsed, + "trimSpace": strings.TrimSpace, +}).Parse(eventsHTML)) + +const maxEventsPerLog = 100 + +type bucket struct { + MaxErrAge time.Duration + String string +} + +var buckets = []bucket{ + {0, "total"}, + {10 * time.Second, "errs<10s"}, + {1 * time.Minute, "errs<1m"}, + {10 * time.Minute, "errs<10m"}, + {1 * time.Hour, "errs<1h"}, + {10 * time.Hour, "errs<10h"}, + {24000 * time.Hour, "errors"}, +} + +// RenderEvents renders the HTML page typically served at /debug/events. +// It does not do any auth checking; see AuthRequest for the default auth check +// used by the handler registered on http.DefaultServeMux. +// req may be nil. +func RenderEvents(w http.ResponseWriter, req *http.Request, sensitive bool) { + now := time.Now() + data := &struct { + Families []string // family names + Buckets []bucket + Counts [][]int // eventLog count per family/bucket + + // Set when a bucket has been selected. + Family string + Bucket int + EventLogs eventLogs + Expanded bool + }{ + Buckets: buckets, + } + + data.Families = make([]string, 0, len(families)) + famMu.RLock() + for name := range families { + data.Families = append(data.Families, name) + } + famMu.RUnlock() + sort.Strings(data.Families) + + // Count the number of eventLogs in each family for each error age. + data.Counts = make([][]int, len(data.Families)) + for i, name := range data.Families { + // TODO(sameer): move this loop under the family lock. + f := getEventFamily(name) + data.Counts[i] = make([]int, len(data.Buckets)) + for j, b := range data.Buckets { + data.Counts[i][j] = f.Count(now, b.MaxErrAge) + } + } + + if req != nil { + var ok bool + data.Family, data.Bucket, ok = parseEventsArgs(req) + if !ok { + // No-op + } else { + data.EventLogs = getEventFamily(data.Family).Copy(now, buckets[data.Bucket].MaxErrAge) + } + if data.EventLogs != nil { + defer data.EventLogs.Free() + sort.Sort(data.EventLogs) + } + if exp, err := strconv.ParseBool(req.FormValue("exp")); err == nil { + data.Expanded = exp + } + } + + famMu.RLock() + defer famMu.RUnlock() + if err := eventsTmpl.Execute(w, data); err != nil { + log.Printf("net/trace: Failed executing template: %v", err) + } +} + +func parseEventsArgs(req *http.Request) (fam string, b int, ok bool) { + fam, bStr := req.FormValue("fam"), req.FormValue("b") + if fam == "" || bStr == "" { + return "", 0, false + } + b, err := strconv.Atoi(bStr) + if err != nil || b < 0 || b >= len(buckets) { + return "", 0, false + } + return fam, b, true +} + +// An EventLog provides a log of events associated with a specific object. +type EventLog interface { + // Printf formats its arguments with fmt.Sprintf and adds the + // result to the event log. + Printf(format string, a ...interface{}) + + // Errorf is like Printf, but it marks this event as an error. + Errorf(format string, a ...interface{}) + + // Finish declares that this event log is complete. + // The event log should not be used after calling this method. + Finish() +} + +// NewEventLog returns a new EventLog with the specified family name +// and title. +func NewEventLog(family, title string) EventLog { + el := newEventLog() + el.ref() + el.Family, el.Title = family, title + el.Start = time.Now() + el.events = make([]logEntry, 0, maxEventsPerLog) + el.stack = make([]uintptr, 32) + n := runtime.Callers(2, el.stack) + el.stack = el.stack[:n] + + getEventFamily(family).add(el) + return el +} + +func (el *eventLog) Finish() { + getEventFamily(el.Family).remove(el) + el.unref() // matches ref in New +} + +var ( + famMu sync.RWMutex + families = make(map[string]*eventFamily) // family name => family +) + +func getEventFamily(fam string) *eventFamily { + famMu.Lock() + defer famMu.Unlock() + f := families[fam] + if f == nil { + f = &eventFamily{} + families[fam] = f + } + return f +} + +type eventFamily struct { + mu sync.RWMutex + eventLogs eventLogs +} + +func (f *eventFamily) add(el *eventLog) { + f.mu.Lock() + f.eventLogs = append(f.eventLogs, el) + f.mu.Unlock() +} + +func (f *eventFamily) remove(el *eventLog) { + f.mu.Lock() + defer f.mu.Unlock() + for i, el0 := range f.eventLogs { + if el == el0 { + copy(f.eventLogs[i:], f.eventLogs[i+1:]) + f.eventLogs = f.eventLogs[:len(f.eventLogs)-1] + return + } + } +} + +func (f *eventFamily) Count(now time.Time, maxErrAge time.Duration) (n int) { + f.mu.RLock() + defer f.mu.RUnlock() + for _, el := range f.eventLogs { + if el.hasRecentError(now, maxErrAge) { + n++ + } + } + return +} + +func (f *eventFamily) Copy(now time.Time, maxErrAge time.Duration) (els eventLogs) { + f.mu.RLock() + defer f.mu.RUnlock() + els = make(eventLogs, 0, len(f.eventLogs)) + for _, el := range f.eventLogs { + if el.hasRecentError(now, maxErrAge) { + el.ref() + els = append(els, el) + } + } + return +} + +type eventLogs []*eventLog + +// Free calls unref on each element of the list. +func (els eventLogs) Free() { + for _, el := range els { + el.unref() + } +} + +// eventLogs may be sorted in reverse chronological order. +func (els eventLogs) Len() int { return len(els) } +func (els eventLogs) Less(i, j int) bool { return els[i].Start.After(els[j].Start) } +func (els eventLogs) Swap(i, j int) { els[i], els[j] = els[j], els[i] } + +// A logEntry is a timestamped log entry in an event log. +type logEntry struct { + When time.Time + Elapsed time.Duration // since previous event in log + NewDay bool // whether this event is on a different day to the previous event + What string + IsErr bool +} + +// WhenString returns a string representation of the elapsed time of the event. +// It will include the date if midnight was crossed. +func (e logEntry) WhenString() string { + if e.NewDay { + return e.When.Format("2006/01/02 15:04:05.000000") + } + return e.When.Format("15:04:05.000000") +} + +// An eventLog represents an active event log. +type eventLog struct { + // Family is the top-level grouping of event logs to which this belongs. + Family string + + // Title is the title of this event log. + Title string + + // Timing information. + Start time.Time + + // Call stack where this event log was created. + stack []uintptr + + // Append-only sequence of events. + // + // TODO(sameer): change this to a ring buffer to avoid the array copy + // when we hit maxEventsPerLog. + mu sync.RWMutex + events []logEntry + LastErrorTime time.Time + discarded int + + refs int32 // how many buckets this is in +} + +func (el *eventLog) reset() { + // Clear all but the mutex. Mutexes may not be copied, even when unlocked. + el.Family = "" + el.Title = "" + el.Start = time.Time{} + el.stack = nil + el.events = nil + el.LastErrorTime = time.Time{} + el.discarded = 0 + el.refs = 0 +} + +func (el *eventLog) hasRecentError(now time.Time, maxErrAge time.Duration) bool { + if maxErrAge == 0 { + return true + } + el.mu.RLock() + defer el.mu.RUnlock() + return now.Sub(el.LastErrorTime) < maxErrAge +} + +// delta returns the elapsed time since the last event or the log start, +// and whether it spans midnight. +// L >= el.mu +func (el *eventLog) delta(t time.Time) (time.Duration, bool) { + if len(el.events) == 0 { + return t.Sub(el.Start), false + } + prev := el.events[len(el.events)-1].When + return t.Sub(prev), prev.Day() != t.Day() + +} + +func (el *eventLog) Printf(format string, a ...interface{}) { + el.printf(false, format, a...) +} + +func (el *eventLog) Errorf(format string, a ...interface{}) { + el.printf(true, format, a...) +} + +func (el *eventLog) printf(isErr bool, format string, a ...interface{}) { + e := logEntry{When: time.Now(), IsErr: isErr, What: fmt.Sprintf(format, a...)} + el.mu.Lock() + e.Elapsed, e.NewDay = el.delta(e.When) + if len(el.events) < maxEventsPerLog { + el.events = append(el.events, e) + } else { + // Discard the oldest event. + if el.discarded == 0 { + // el.discarded starts at two to count for the event it + // is replacing, plus the next one that we are about to + // drop. + el.discarded = 2 + } else { + el.discarded++ + } + // TODO(sameer): if this causes allocations on a critical path, + // change eventLog.What to be a fmt.Stringer, as in trace.go. + el.events[0].What = fmt.Sprintf("(%d events discarded)", el.discarded) + // The timestamp of the discarded meta-event should be + // the time of the last event it is representing. + el.events[0].When = el.events[1].When + copy(el.events[1:], el.events[2:]) + el.events[maxEventsPerLog-1] = e + } + if e.IsErr { + el.LastErrorTime = e.When + } + el.mu.Unlock() +} + +func (el *eventLog) ref() { + atomic.AddInt32(&el.refs, 1) +} + +func (el *eventLog) unref() { + if atomic.AddInt32(&el.refs, -1) == 0 { + freeEventLog(el) + } +} + +func (el *eventLog) When() string { + return el.Start.Format("2006/01/02 15:04:05.000000") +} + +func (el *eventLog) ElapsedTime() string { + elapsed := time.Since(el.Start) + return fmt.Sprintf("%.6f", elapsed.Seconds()) +} + +func (el *eventLog) Stack() string { + buf := new(bytes.Buffer) + tw := tabwriter.NewWriter(buf, 1, 8, 1, '\t', 0) + printStackRecord(tw, el.stack) + tw.Flush() + return buf.String() +} + +// printStackRecord prints the function + source line information +// for a single stack trace. +// Adapted from runtime/pprof/pprof.go. +func printStackRecord(w io.Writer, stk []uintptr) { + for _, pc := range stk { + f := runtime.FuncForPC(pc) + if f == nil { + continue + } + file, line := f.FileLine(pc) + name := f.Name() + // Hide runtime.goexit and any runtime functions at the beginning. + if strings.HasPrefix(name, "runtime.") { + continue + } + fmt.Fprintf(w, "# %s\t%s:%d\n", name, file, line) + } +} + +func (el *eventLog) Events() []logEntry { + el.mu.RLock() + defer el.mu.RUnlock() + return el.events +} + +// freeEventLogs is a freelist of *eventLog +var freeEventLogs = make(chan *eventLog, 1000) + +// newEventLog returns a event log ready to use. +func newEventLog() *eventLog { + select { + case el := <-freeEventLogs: + return el + default: + return new(eventLog) + } +} + +// freeEventLog adds el to freeEventLogs if there's room. +// This is non-blocking. +func freeEventLog(el *eventLog) { + el.reset() + select { + case freeEventLogs <- el: + default: + } +} + +const eventsHTML = ` + + + events + + + + +

/debug/events

+ + + {{range $i, $fam := .Families}} + + + + {{range $j, $bucket := $.Buckets}} + {{$n := index $.Counts $i $j}} + + {{end}} + + {{end}} +
{{$fam}} + {{if $n}}{{end}} + [{{$n}} {{$bucket.String}}] + {{if $n}}{{end}} +
+ +{{if $.EventLogs}} +
+

Family: {{$.Family}}

+ +{{if $.Expanded}}{{end}} +[Summary]{{if $.Expanded}}{{end}} + +{{if not $.Expanded}}{{end}} +[Expanded]{{if not $.Expanded}}{{end}} + + + + {{range $el := $.EventLogs}} + + + + + {{if $.Expanded}} + + + + + + {{range $el.Events}} + + + + + + {{end}} + {{end}} + {{end}} +
WhenElapsed
{{$el.When}}{{$el.ElapsedTime}}{{$el.Title}} +
{{$el.Stack|trimSpace}}
{{.WhenString}}{{elapsed .Elapsed}}.{{if .IsErr}}E{{else}}.{{end}}. {{.What}}
+{{end}} + + +` diff --git a/Godeps/_workspace/src/golang.org/x/net/trace/histogram.go b/Godeps/_workspace/src/golang.org/x/net/trace/histogram.go new file mode 100644 index 000000000..bb42aa532 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/trace/histogram.go @@ -0,0 +1,356 @@ +// Copyright 2015 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 trace + +// This file implements histogramming for RPC statistics collection. + +import ( + "bytes" + "fmt" + "html/template" + "log" + "math" + + "golang.org/x/net/internal/timeseries" +) + +const ( + bucketCount = 38 +) + +// histogram keeps counts of values in buckets that are spaced +// out in powers of 2: 0-1, 2-3, 4-7... +// histogram implements timeseries.Observable +type histogram struct { + sum int64 // running total of measurements + sumOfSquares float64 // square of running total + buckets []int64 // bucketed values for histogram + value int // holds a single value as an optimization + valueCount int64 // number of values recorded for single value +} + +// AddMeasurement records a value measurement observation to the histogram. +func (h *histogram) addMeasurement(value int64) { + // TODO: assert invariant + h.sum += value + h.sumOfSquares += float64(value) * float64(value) + + bucketIndex := getBucket(value) + + if h.valueCount == 0 || (h.valueCount > 0 && h.value == bucketIndex) { + h.value = bucketIndex + h.valueCount++ + } else { + h.allocateBuckets() + h.buckets[bucketIndex]++ + } +} + +func (h *histogram) allocateBuckets() { + if h.buckets == nil { + h.buckets = make([]int64, bucketCount) + h.buckets[h.value] = h.valueCount + h.value = 0 + h.valueCount = -1 + } +} + +func log2(i int64) int { + n := 0 + for ; i >= 0x100; i >>= 8 { + n += 8 + } + for ; i > 0; i >>= 1 { + n += 1 + } + return n +} + +func getBucket(i int64) (index int) { + index = log2(i) - 1 + if index < 0 { + index = 0 + } + if index >= bucketCount { + index = bucketCount - 1 + } + return +} + +// Total returns the number of recorded observations. +func (h *histogram) total() (total int64) { + if h.valueCount >= 0 { + total = h.valueCount + } + for _, val := range h.buckets { + total += int64(val) + } + return +} + +// Average returns the average value of recorded observations. +func (h *histogram) average() float64 { + t := h.total() + if t == 0 { + return 0 + } + return float64(h.sum) / float64(t) +} + +// Variance returns the variance of recorded observations. +func (h *histogram) variance() float64 { + t := float64(h.total()) + if t == 0 { + return 0 + } + s := float64(h.sum) / t + return h.sumOfSquares/t - s*s +} + +// StandardDeviation returns the standard deviation of recorded observations. +func (h *histogram) standardDeviation() float64 { + return math.Sqrt(h.variance()) +} + +// PercentileBoundary estimates the value that the given fraction of recorded +// observations are less than. +func (h *histogram) percentileBoundary(percentile float64) int64 { + total := h.total() + + // Corner cases (make sure result is strictly less than Total()) + if total == 0 { + return 0 + } else if total == 1 { + return int64(h.average()) + } + + percentOfTotal := round(float64(total) * percentile) + var runningTotal int64 + + for i := range h.buckets { + value := h.buckets[i] + runningTotal += value + if runningTotal == percentOfTotal { + // We hit an exact bucket boundary. If the next bucket has data, it is a + // good estimate of the value. If the bucket is empty, we interpolate the + // midpoint between the next bucket's boundary and the next non-zero + // bucket. If the remaining buckets are all empty, then we use the + // boundary for the next bucket as the estimate. + j := uint8(i + 1) + min := bucketBoundary(j) + if runningTotal < total { + for h.buckets[j] == 0 { + j++ + } + } + max := bucketBoundary(j) + return min + round(float64(max-min)/2) + } else if runningTotal > percentOfTotal { + // The value is in this bucket. Interpolate the value. + delta := runningTotal - percentOfTotal + percentBucket := float64(value-delta) / float64(value) + bucketMin := bucketBoundary(uint8(i)) + nextBucketMin := bucketBoundary(uint8(i + 1)) + bucketSize := nextBucketMin - bucketMin + return bucketMin + round(percentBucket*float64(bucketSize)) + } + } + return bucketBoundary(bucketCount - 1) +} + +// Median returns the estimated median of the observed values. +func (h *histogram) median() int64 { + return h.percentileBoundary(0.5) +} + +// Add adds other to h. +func (h *histogram) Add(other timeseries.Observable) { + o := other.(*histogram) + if o.valueCount == 0 { + // Other histogram is empty + } else if h.valueCount >= 0 && o.valueCount > 0 && h.value == o.value { + // Both have a single bucketed value, aggregate them + h.valueCount += o.valueCount + } else { + // Two different values necessitate buckets in this histogram + h.allocateBuckets() + if o.valueCount >= 0 { + h.buckets[o.value] += o.valueCount + } else { + for i := range h.buckets { + h.buckets[i] += o.buckets[i] + } + } + } + h.sumOfSquares += o.sumOfSquares + h.sum += o.sum +} + +// Clear resets the histogram to an empty state, removing all observed values. +func (h *histogram) Clear() { + h.buckets = nil + h.value = 0 + h.valueCount = 0 + h.sum = 0 + h.sumOfSquares = 0 +} + +// CopyFrom copies from other, which must be a *histogram, into h. +func (h *histogram) CopyFrom(other timeseries.Observable) { + o := other.(*histogram) + if o.valueCount == -1 { + h.allocateBuckets() + copy(h.buckets, o.buckets) + } + h.sum = o.sum + h.sumOfSquares = o.sumOfSquares + h.value = o.value + h.valueCount = o.valueCount +} + +// Multiply scales the histogram by the specified ratio. +func (h *histogram) Multiply(ratio float64) { + if h.valueCount == -1 { + for i := range h.buckets { + h.buckets[i] = int64(float64(h.buckets[i]) * ratio) + } + } else { + h.valueCount = int64(float64(h.valueCount) * ratio) + } + h.sum = int64(float64(h.sum) * ratio) + h.sumOfSquares = h.sumOfSquares * ratio +} + +// New creates a new histogram. +func (h *histogram) New() timeseries.Observable { + r := new(histogram) + r.Clear() + return r +} + +func (h *histogram) String() string { + return fmt.Sprintf("%d, %f, %d, %d, %v", + h.sum, h.sumOfSquares, h.value, h.valueCount, h.buckets) +} + +// round returns the closest int64 to the argument +func round(in float64) int64 { + return int64(math.Floor(in + 0.5)) +} + +// bucketBoundary returns the first value in the bucket. +func bucketBoundary(bucket uint8) int64 { + if bucket == 0 { + return 0 + } + return 1 << bucket +} + +// bucketData holds data about a specific bucket for use in distTmpl. +type bucketData struct { + Lower, Upper int64 + N int64 + Pct, CumulativePct float64 + GraphWidth int +} + +// data holds data about a Distribution for use in distTmpl. +type data struct { + Buckets []*bucketData + Count, Median int64 + Mean, StandardDeviation float64 +} + +// maxHTMLBarWidth is the maximum width of the HTML bar for visualizing buckets. +const maxHTMLBarWidth = 350.0 + +// newData returns data representing h for use in distTmpl. +func (h *histogram) newData() *data { + // Force the allocation of buckets to simplify the rendering implementation + h.allocateBuckets() + // We scale the bars on the right so that the largest bar is + // maxHTMLBarWidth pixels in width. + maxBucket := int64(0) + for _, n := range h.buckets { + if n > maxBucket { + maxBucket = n + } + } + total := h.total() + barsizeMult := maxHTMLBarWidth / float64(maxBucket) + var pctMult float64 + if total == 0 { + pctMult = 1.0 + } else { + pctMult = 100.0 / float64(total) + } + + buckets := make([]*bucketData, len(h.buckets)) + runningTotal := int64(0) + for i, n := range h.buckets { + if n == 0 { + continue + } + runningTotal += n + var upperBound int64 + if i < bucketCount-1 { + upperBound = bucketBoundary(uint8(i + 1)) + } else { + upperBound = math.MaxInt64 + } + buckets[i] = &bucketData{ + Lower: bucketBoundary(uint8(i)), + Upper: upperBound, + N: n, + Pct: float64(n) * pctMult, + CumulativePct: float64(runningTotal) * pctMult, + GraphWidth: int(float64(n) * barsizeMult), + } + } + return &data{ + Buckets: buckets, + Count: total, + Median: h.median(), + Mean: h.average(), + StandardDeviation: h.standardDeviation(), + } +} + +func (h *histogram) html() template.HTML { + buf := new(bytes.Buffer) + if err := distTmpl.Execute(buf, h.newData()); err != nil { + buf.Reset() + log.Printf("net/trace: couldn't execute template: %v", err) + } + return template.HTML(buf.String()) +} + +// Input: data +var distTmpl = template.Must(template.New("distTmpl").Parse(` + + + + + + + +
Count: {{.Count}}Mean: {{printf "%.0f" .Mean}}StdDev: {{printf "%.0f" .StandardDeviation}}Median: {{.Median}}
+
+ +{{range $b := .Buckets}} +{{if $b}} + + + + + + + + + +{{end}} +{{end}} +
[{{.Lower}},{{.Upper}}){{.N}}{{printf "%#.3f" .Pct}}%{{printf "%#.3f" .CumulativePct}}%
+`)) diff --git a/Godeps/_workspace/src/golang.org/x/net/trace/histogram_test.go b/Godeps/_workspace/src/golang.org/x/net/trace/histogram_test.go new file mode 100644 index 000000000..d384b9332 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/trace/histogram_test.go @@ -0,0 +1,325 @@ +// Copyright 2015 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 trace + +import ( + "math" + "testing" +) + +type sumTest struct { + value int64 + sum int64 + sumOfSquares float64 + total int64 +} + +var sumTests = []sumTest{ + {100, 100, 10000, 1}, + {50, 150, 12500, 2}, + {50, 200, 15000, 3}, + {50, 250, 17500, 4}, +} + +type bucketingTest struct { + in int64 + log int + bucket int +} + +var bucketingTests = []bucketingTest{ + {0, 0, 0}, + {1, 1, 0}, + {2, 2, 1}, + {3, 2, 1}, + {4, 3, 2}, + {1000, 10, 9}, + {1023, 10, 9}, + {1024, 11, 10}, + {1000000, 20, 19}, +} + +type multiplyTest struct { + in int64 + ratio float64 + expectedSum int64 + expectedTotal int64 + expectedSumOfSquares float64 +} + +var multiplyTests = []multiplyTest{ + {15, 2.5, 37, 2, 562.5}, + {128, 4.6, 758, 13, 77953.9}, +} + +type percentileTest struct { + fraction float64 + expected int64 +} + +var percentileTests = []percentileTest{ + {0.25, 48}, + {0.5, 96}, + {0.6, 109}, + {0.75, 128}, + {0.90, 205}, + {0.95, 230}, + {0.99, 256}, +} + +func TestSum(t *testing.T) { + var h histogram + + for _, test := range sumTests { + h.addMeasurement(test.value) + sum := h.sum + if sum != test.sum { + t.Errorf("h.Sum = %v WANT: %v", sum, test.sum) + } + + sumOfSquares := h.sumOfSquares + if sumOfSquares != test.sumOfSquares { + t.Errorf("h.SumOfSquares = %v WANT: %v", sumOfSquares, test.sumOfSquares) + } + + total := h.total() + if total != test.total { + t.Errorf("h.Total = %v WANT: %v", total, test.total) + } + } +} + +func TestMultiply(t *testing.T) { + var h histogram + for i, test := range multiplyTests { + h.addMeasurement(test.in) + h.Multiply(test.ratio) + if h.sum != test.expectedSum { + t.Errorf("#%v: h.sum = %v WANT: %v", i, h.sum, test.expectedSum) + } + if h.total() != test.expectedTotal { + t.Errorf("#%v: h.total = %v WANT: %v", i, h.total(), test.expectedTotal) + } + if h.sumOfSquares != test.expectedSumOfSquares { + t.Errorf("#%v: h.SumOfSquares = %v WANT: %v", i, test.expectedSumOfSquares, h.sumOfSquares) + } + } +} + +func TestBucketingFunctions(t *testing.T) { + for _, test := range bucketingTests { + log := log2(test.in) + if log != test.log { + t.Errorf("log2 = %v WANT: %v", log, test.log) + } + + bucket := getBucket(test.in) + if bucket != test.bucket { + t.Errorf("getBucket = %v WANT: %v", bucket, test.bucket) + } + } +} + +func TestAverage(t *testing.T) { + a := new(histogram) + average := a.average() + if average != 0 { + t.Errorf("Average of empty histogram was %v WANT: 0", average) + } + + a.addMeasurement(1) + a.addMeasurement(1) + a.addMeasurement(3) + const expected = float64(5) / float64(3) + average = a.average() + + if !isApproximate(average, expected) { + t.Errorf("Average = %g WANT: %v", average, expected) + } +} + +func TestStandardDeviation(t *testing.T) { + a := new(histogram) + add(a, 10, 1<<4) + add(a, 10, 1<<5) + add(a, 10, 1<<6) + stdDev := a.standardDeviation() + const expected = 19.95 + + if !isApproximate(stdDev, expected) { + t.Errorf("StandardDeviation = %v WANT: %v", stdDev, expected) + } + + // No values + a = new(histogram) + stdDev = a.standardDeviation() + + if !isApproximate(stdDev, 0) { + t.Errorf("StandardDeviation = %v WANT: 0", stdDev) + } + + add(a, 1, 1<<4) + if !isApproximate(stdDev, 0) { + t.Errorf("StandardDeviation = %v WANT: 0", stdDev) + } + + add(a, 10, 1<<4) + if !isApproximate(stdDev, 0) { + t.Errorf("StandardDeviation = %v WANT: 0", stdDev) + } +} + +func TestPercentileBoundary(t *testing.T) { + a := new(histogram) + add(a, 5, 1<<4) + add(a, 10, 1<<6) + add(a, 5, 1<<7) + + for _, test := range percentileTests { + percentile := a.percentileBoundary(test.fraction) + if percentile != test.expected { + t.Errorf("h.PercentileBoundary (fraction=%v) = %v WANT: %v", test.fraction, percentile, test.expected) + } + } +} + +func TestCopyFrom(t *testing.T) { + a := histogram{5, 25, []int64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38}, 4, -1} + b := histogram{6, 36, []int64{2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39}, 5, -1} + + a.CopyFrom(&b) + + if a.String() != b.String() { + t.Errorf("a.String = %s WANT: %s", a.String(), b.String()) + } +} + +func TestClear(t *testing.T) { + a := histogram{5, 25, []int64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38}, 4, -1} + + a.Clear() + + expected := "0, 0.000000, 0, 0, []" + if a.String() != expected { + t.Errorf("a.String = %s WANT %s", a.String(), expected) + } +} + +func TestNew(t *testing.T) { + a := histogram{5, 25, []int64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38}, 4, -1} + b := a.New() + + expected := "0, 0.000000, 0, 0, []" + if b.(*histogram).String() != expected { + t.Errorf("b.(*histogram).String = %s WANT: %s", b.(*histogram).String(), expected) + } +} + +func TestAdd(t *testing.T) { + // The tests here depend on the associativity of addMeasurement and Add. + // Add empty observation + a := histogram{5, 25, []int64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38}, 4, -1} + b := a.New() + + expected := a.String() + a.Add(b) + if a.String() != expected { + t.Errorf("a.String = %s WANT: %s", a.String(), expected) + } + + // Add same bucketed value, no new buckets + c := new(histogram) + d := new(histogram) + e := new(histogram) + c.addMeasurement(12) + d.addMeasurement(11) + e.addMeasurement(12) + e.addMeasurement(11) + c.Add(d) + if c.String() != e.String() { + t.Errorf("c.String = %s WANT: %s", c.String(), e.String()) + } + + // Add bucketed values + f := new(histogram) + g := new(histogram) + h := new(histogram) + f.addMeasurement(4) + f.addMeasurement(12) + f.addMeasurement(100) + g.addMeasurement(18) + g.addMeasurement(36) + g.addMeasurement(255) + h.addMeasurement(4) + h.addMeasurement(12) + h.addMeasurement(100) + h.addMeasurement(18) + h.addMeasurement(36) + h.addMeasurement(255) + f.Add(g) + if f.String() != h.String() { + t.Errorf("f.String = %q WANT: %q", f.String(), h.String()) + } + + // add buckets to no buckets + i := new(histogram) + j := new(histogram) + k := new(histogram) + j.addMeasurement(18) + j.addMeasurement(36) + j.addMeasurement(255) + k.addMeasurement(18) + k.addMeasurement(36) + k.addMeasurement(255) + i.Add(j) + if i.String() != k.String() { + t.Errorf("i.String = %q WANT: %q", i.String(), k.String()) + } + + // add buckets to single value (no overlap) + l := new(histogram) + m := new(histogram) + n := new(histogram) + l.addMeasurement(0) + m.addMeasurement(18) + m.addMeasurement(36) + m.addMeasurement(255) + n.addMeasurement(0) + n.addMeasurement(18) + n.addMeasurement(36) + n.addMeasurement(255) + l.Add(m) + if l.String() != n.String() { + t.Errorf("l.String = %q WANT: %q", l.String(), n.String()) + } + + // mixed order + o := new(histogram) + p := new(histogram) + o.addMeasurement(0) + o.addMeasurement(2) + o.addMeasurement(0) + p.addMeasurement(0) + p.addMeasurement(0) + p.addMeasurement(2) + if o.String() != p.String() { + t.Errorf("o.String = %q WANT: %q", o.String(), p.String()) + } +} + +func add(h *histogram, times int, val int64) { + for i := 0; i < times; i++ { + h.addMeasurement(val) + } +} + +func isApproximate(x, y float64) bool { + return math.Abs(x-y) < 1e-2 +} diff --git a/Godeps/_workspace/src/golang.org/x/net/trace/trace.go b/Godeps/_workspace/src/golang.org/x/net/trace/trace.go new file mode 100644 index 000000000..c44cb7ec9 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/trace/trace.go @@ -0,0 +1,1057 @@ +// Copyright 2015 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 trace implements tracing of requests and long-lived objects. +It exports HTTP interfaces on /debug/requests and /debug/events. + +A trace.Trace provides tracing for short-lived objects, usually requests. +A request handler might be implemented like this: + + func fooHandler(w http.ResponseWriter, req *http.Request) { + tr := trace.New("mypkg.Foo", req.URL.Path) + defer tr.Finish() + ... + tr.LazyPrintf("some event %q happened", str) + ... + if err := somethingImportant(); err != nil { + tr.LazyPrintf("somethingImportant failed: %v", err) + tr.SetError() + } + } + +The /debug/requests HTTP endpoint organizes the traces by family, +errors, and duration. It also provides histogram of request duration +for each family. + +A trace.EventLog provides tracing for long-lived objects, such as RPC +connections. + + // A Fetcher fetches URL paths for a single domain. + type Fetcher struct { + domain string + events trace.EventLog + } + + func NewFetcher(domain string) *Fetcher { + return &Fetcher{ + domain, + trace.NewEventLog("mypkg.Fetcher", domain), + } + } + + func (f *Fetcher) Fetch(path string) (string, error) { + resp, err := http.Get("http://" + f.domain + "/" + path) + if err != nil { + f.events.Errorf("Get(%q) = %v", path, err) + return "", err + } + f.events.Printf("Get(%q) = %s", path, resp.Status) + ... + } + + func (f *Fetcher) Close() error { + f.events.Finish() + return nil + } + +The /debug/events HTTP endpoint organizes the event logs by family and +by time since the last error. The expanded view displays recent log +entries and the log's call stack. +*/ +package trace // import "golang.org/x/net/trace" + +import ( + "bytes" + "fmt" + "html/template" + "io" + "log" + "net" + "net/http" + "runtime" + "sort" + "strconv" + "sync" + "sync/atomic" + "time" + + "golang.org/x/net/context" + "golang.org/x/net/internal/timeseries" +) + +// DebugUseAfterFinish controls whether to debug uses of Trace values after finishing. +// FOR DEBUGGING ONLY. This will slow down the program. +var DebugUseAfterFinish = false + +// AuthRequest determines whether a specific request is permitted to load the +// /debug/requests or /debug/events pages. +// +// It returns two bools; the first indicates whether the page may be viewed at all, +// and the second indicates whether sensitive events will be shown. +// +// AuthRequest may be replaced by a program to customise its authorisation requirements. +// +// The default AuthRequest function returns (true, true) iff the request comes from localhost/127.0.0.1/[::1]. +var AuthRequest = func(req *http.Request) (any, sensitive bool) { + host, _, err := net.SplitHostPort(req.RemoteAddr) + switch { + case err != nil: // Badly formed address; fail closed. + return false, false + case host == "localhost" || host == "127.0.0.1" || host == "::1": + return true, true + default: + return false, false + } +} + +func init() { + http.HandleFunc("/debug/requests", func(w http.ResponseWriter, req *http.Request) { + any, sensitive := AuthRequest(req) + if !any { + http.Error(w, "not allowed", http.StatusUnauthorized) + return + } + Render(w, req, sensitive) + }) + http.HandleFunc("/debug/events", func(w http.ResponseWriter, req *http.Request) { + any, sensitive := AuthRequest(req) + if !any { + http.Error(w, "not allowed", http.StatusUnauthorized) + return + } + RenderEvents(w, req, sensitive) + }) +} + +// Render renders the HTML page typically served at /debug/requests. +// It does not do any auth checking; see AuthRequest for the default auth check +// used by the handler registered on http.DefaultServeMux. +// req may be nil. +func Render(w io.Writer, req *http.Request, sensitive bool) { + data := &struct { + Families []string + ActiveTraceCount map[string]int + CompletedTraces map[string]*family + + // Set when a bucket has been selected. + Traces traceList + Family string + Bucket int + Expanded bool + Traced bool + Active bool + ShowSensitive bool // whether to show sensitive events + + Histogram template.HTML + HistogramWindow string // e.g. "last minute", "last hour", "all time" + + // If non-zero, the set of traces is a partial set, + // and this is the total number. + Total int + }{ + CompletedTraces: completedTraces, + } + + data.ShowSensitive = sensitive + if req != nil { + // Allow show_sensitive=0 to force hiding of sensitive data for testing. + // This only goes one way; you can't use show_sensitive=1 to see things. + if req.FormValue("show_sensitive") == "0" { + data.ShowSensitive = false + } + + if exp, err := strconv.ParseBool(req.FormValue("exp")); err == nil { + data.Expanded = exp + } + if exp, err := strconv.ParseBool(req.FormValue("rtraced")); err == nil { + data.Traced = exp + } + } + + completedMu.RLock() + data.Families = make([]string, 0, len(completedTraces)) + for fam, _ := range completedTraces { + data.Families = append(data.Families, fam) + } + completedMu.RUnlock() + sort.Strings(data.Families) + + // We are careful here to minimize the time spent locking activeMu, + // since that lock is required every time an RPC starts and finishes. + data.ActiveTraceCount = make(map[string]int, len(data.Families)) + activeMu.RLock() + for fam, s := range activeTraces { + data.ActiveTraceCount[fam] = s.Len() + } + activeMu.RUnlock() + + var ok bool + data.Family, data.Bucket, ok = parseArgs(req) + switch { + case !ok: + // No-op + case data.Bucket == -1: + data.Active = true + n := data.ActiveTraceCount[data.Family] + data.Traces = getActiveTraces(data.Family) + if len(data.Traces) < n { + data.Total = n + } + case data.Bucket < bucketsPerFamily: + if b := lookupBucket(data.Family, data.Bucket); b != nil { + data.Traces = b.Copy(data.Traced) + } + default: + if f := getFamily(data.Family, false); f != nil { + var obs timeseries.Observable + f.LatencyMu.RLock() + switch o := data.Bucket - bucketsPerFamily; o { + case 0: + obs = f.Latency.Minute() + data.HistogramWindow = "last minute" + case 1: + obs = f.Latency.Hour() + data.HistogramWindow = "last hour" + case 2: + obs = f.Latency.Total() + data.HistogramWindow = "all time" + } + f.LatencyMu.RUnlock() + if obs != nil { + data.Histogram = obs.(*histogram).html() + } + } + } + + if data.Traces != nil { + defer data.Traces.Free() + sort.Sort(data.Traces) + } + + completedMu.RLock() + defer completedMu.RUnlock() + if err := pageTmpl.ExecuteTemplate(w, "Page", data); err != nil { + log.Printf("net/trace: Failed executing template: %v", err) + } +} + +func parseArgs(req *http.Request) (fam string, b int, ok bool) { + if req == nil { + return "", 0, false + } + fam, bStr := req.FormValue("fam"), req.FormValue("b") + if fam == "" || bStr == "" { + return "", 0, false + } + b, err := strconv.Atoi(bStr) + if err != nil || b < -1 { + return "", 0, false + } + + return fam, b, true +} + +func lookupBucket(fam string, b int) *traceBucket { + f := getFamily(fam, false) + if f == nil || b < 0 || b >= len(f.Buckets) { + return nil + } + return f.Buckets[b] +} + +type contextKeyT string + +var contextKey = contextKeyT("golang.org/x/net/trace.Trace") + +// NewContext returns a copy of the parent context +// and associates it with a Trace. +func NewContext(ctx context.Context, tr Trace) context.Context { + return context.WithValue(ctx, contextKey, tr) +} + +// FromContext returns the Trace bound to the context, if any. +func FromContext(ctx context.Context) (tr Trace, ok bool) { + tr, ok = ctx.Value(contextKey).(Trace) + return +} + +// Trace represents an active request. +type Trace interface { + // LazyLog adds x to the event log. It will be evaluated each time the + // /debug/requests page is rendered. Any memory referenced by x will be + // pinned until the trace is finished and later discarded. + LazyLog(x fmt.Stringer, sensitive bool) + + // LazyPrintf evaluates its arguments with fmt.Sprintf each time the + // /debug/requests page is rendered. Any memory referenced by a will be + // pinned until the trace is finished and later discarded. + LazyPrintf(format string, a ...interface{}) + + // SetError declares that this trace resulted in an error. + SetError() + + // SetRecycler sets a recycler for the trace. + // f will be called for each event passed to LazyLog at a time when + // it is no longer required, whether while the trace is still active + // and the event is discarded, or when a completed trace is discarded. + SetRecycler(f func(interface{})) + + // SetTraceInfo sets the trace info for the trace. + // This is currently unused. + SetTraceInfo(traceID, spanID uint64) + + // SetMaxEvents sets the maximum number of events that will be stored + // in the trace. This has no effect if any events have already been + // added to the trace. + SetMaxEvents(m int) + + // Finish declares that this trace is complete. + // The trace should not be used after calling this method. + Finish() +} + +type lazySprintf struct { + format string + a []interface{} +} + +func (l *lazySprintf) String() string { + return fmt.Sprintf(l.format, l.a...) +} + +// New returns a new Trace with the specified family and title. +func New(family, title string) Trace { + tr := newTrace() + tr.ref() + tr.Family, tr.Title = family, title + tr.Start = time.Now() + tr.events = make([]event, 0, maxEventsPerTrace) + + activeMu.RLock() + s := activeTraces[tr.Family] + activeMu.RUnlock() + if s == nil { + activeMu.Lock() + s = activeTraces[tr.Family] // check again + if s == nil { + s = new(traceSet) + activeTraces[tr.Family] = s + } + activeMu.Unlock() + } + s.Add(tr) + + // Trigger allocation of the completed trace structure for this family. + // This will cause the family to be present in the request page during + // the first trace of this family. We don't care about the return value, + // nor is there any need for this to run inline, so we execute it in its + // own goroutine, but only if the family isn't allocated yet. + completedMu.RLock() + if _, ok := completedTraces[tr.Family]; !ok { + go allocFamily(tr.Family) + } + completedMu.RUnlock() + + return tr +} + +func (tr *trace) Finish() { + tr.Elapsed = time.Now().Sub(tr.Start) + if DebugUseAfterFinish { + buf := make([]byte, 4<<10) // 4 KB should be enough + n := runtime.Stack(buf, false) + tr.finishStack = buf[:n] + } + + activeMu.RLock() + m := activeTraces[tr.Family] + activeMu.RUnlock() + m.Remove(tr) + + f := getFamily(tr.Family, true) + for _, b := range f.Buckets { + if b.Cond.match(tr) { + b.Add(tr) + } + } + // Add a sample of elapsed time as microseconds to the family's timeseries + h := new(histogram) + h.addMeasurement(tr.Elapsed.Nanoseconds() / 1e3) + f.LatencyMu.Lock() + f.Latency.Add(h) + f.LatencyMu.Unlock() + + tr.unref() // matches ref in New +} + +const ( + bucketsPerFamily = 9 + tracesPerBucket = 10 + maxActiveTraces = 20 // Maximum number of active traces to show. + maxEventsPerTrace = 10 + numHistogramBuckets = 38 +) + +var ( + // The active traces. + activeMu sync.RWMutex + activeTraces = make(map[string]*traceSet) // family -> traces + + // Families of completed traces. + completedMu sync.RWMutex + completedTraces = make(map[string]*family) // family -> traces +) + +type traceSet struct { + mu sync.RWMutex + m map[*trace]bool + + // We could avoid the entire map scan in FirstN by having a slice of all the traces + // ordered by start time, and an index into that from the trace struct, with a periodic + // repack of the slice after enough traces finish; we could also use a skip list or similar. + // However, that would shift some of the expense from /debug/requests time to RPC time, + // which is probably the wrong trade-off. +} + +func (ts *traceSet) Len() int { + ts.mu.RLock() + defer ts.mu.RUnlock() + return len(ts.m) +} + +func (ts *traceSet) Add(tr *trace) { + ts.mu.Lock() + if ts.m == nil { + ts.m = make(map[*trace]bool) + } + ts.m[tr] = true + ts.mu.Unlock() +} + +func (ts *traceSet) Remove(tr *trace) { + ts.mu.Lock() + delete(ts.m, tr) + ts.mu.Unlock() +} + +// FirstN returns the first n traces ordered by time. +func (ts *traceSet) FirstN(n int) traceList { + ts.mu.RLock() + defer ts.mu.RUnlock() + + if n > len(ts.m) { + n = len(ts.m) + } + trl := make(traceList, 0, n) + + // Fast path for when no selectivity is needed. + if n == len(ts.m) { + for tr := range ts.m { + tr.ref() + trl = append(trl, tr) + } + sort.Sort(trl) + return trl + } + + // Pick the oldest n traces. + // This is inefficient. See the comment in the traceSet struct. + for tr := range ts.m { + // Put the first n traces into trl in the order they occur. + // When we have n, sort trl, and thereafter maintain its order. + if len(trl) < n { + tr.ref() + trl = append(trl, tr) + if len(trl) == n { + // This is guaranteed to happen exactly once during this loop. + sort.Sort(trl) + } + continue + } + if tr.Start.After(trl[n-1].Start) { + continue + } + + // Find where to insert this one. + tr.ref() + i := sort.Search(n, func(i int) bool { return trl[i].Start.After(tr.Start) }) + trl[n-1].unref() + copy(trl[i+1:], trl[i:]) + trl[i] = tr + } + + return trl +} + +func getActiveTraces(fam string) traceList { + activeMu.RLock() + s := activeTraces[fam] + activeMu.RUnlock() + if s == nil { + return nil + } + return s.FirstN(maxActiveTraces) +} + +func getFamily(fam string, allocNew bool) *family { + completedMu.RLock() + f := completedTraces[fam] + completedMu.RUnlock() + if f == nil && allocNew { + f = allocFamily(fam) + } + return f +} + +func allocFamily(fam string) *family { + completedMu.Lock() + defer completedMu.Unlock() + f := completedTraces[fam] + if f == nil { + f = newFamily() + completedTraces[fam] = f + } + return f +} + +// family represents a set of trace buckets and associated latency information. +type family struct { + // traces may occur in multiple buckets. + Buckets [bucketsPerFamily]*traceBucket + + // latency time series + LatencyMu sync.RWMutex + Latency *timeseries.MinuteHourSeries +} + +func newFamily() *family { + return &family{ + Buckets: [bucketsPerFamily]*traceBucket{ + {Cond: minCond(0)}, + {Cond: minCond(50 * time.Millisecond)}, + {Cond: minCond(100 * time.Millisecond)}, + {Cond: minCond(200 * time.Millisecond)}, + {Cond: minCond(500 * time.Millisecond)}, + {Cond: minCond(1 * time.Second)}, + {Cond: minCond(10 * time.Second)}, + {Cond: minCond(100 * time.Second)}, + {Cond: errorCond{}}, + }, + Latency: timeseries.NewMinuteHourSeries(func() timeseries.Observable { return new(histogram) }), + } +} + +// traceBucket represents a size-capped bucket of historic traces, +// along with a condition for a trace to belong to the bucket. +type traceBucket struct { + Cond cond + + // Ring buffer implementation of a fixed-size FIFO queue. + mu sync.RWMutex + buf [tracesPerBucket]*trace + start int // < tracesPerBucket + length int // <= tracesPerBucket +} + +func (b *traceBucket) Add(tr *trace) { + b.mu.Lock() + defer b.mu.Unlock() + + i := b.start + b.length + if i >= tracesPerBucket { + i -= tracesPerBucket + } + if b.length == tracesPerBucket { + // "Remove" an element from the bucket. + b.buf[i].unref() + b.start++ + if b.start == tracesPerBucket { + b.start = 0 + } + } + b.buf[i] = tr + if b.length < tracesPerBucket { + b.length++ + } + tr.ref() +} + +// Copy returns a copy of the traces in the bucket. +// If tracedOnly is true, only the traces with trace information will be returned. +// The logs will be ref'd before returning; the caller should call +// the Free method when it is done with them. +// TODO(dsymonds): keep track of traced requests in separate buckets. +func (b *traceBucket) Copy(tracedOnly bool) traceList { + b.mu.RLock() + defer b.mu.RUnlock() + + trl := make(traceList, 0, b.length) + for i, x := 0, b.start; i < b.length; i++ { + tr := b.buf[x] + if !tracedOnly || tr.spanID != 0 { + tr.ref() + trl = append(trl, tr) + } + x++ + if x == b.length { + x = 0 + } + } + return trl +} + +func (b *traceBucket) Empty() bool { + b.mu.RLock() + defer b.mu.RUnlock() + return b.length == 0 +} + +// cond represents a condition on a trace. +type cond interface { + match(t *trace) bool + String() string +} + +type minCond time.Duration + +func (m minCond) match(t *trace) bool { return t.Elapsed >= time.Duration(m) } +func (m minCond) String() string { return fmt.Sprintf("≥%gs", time.Duration(m).Seconds()) } + +type errorCond struct{} + +func (e errorCond) match(t *trace) bool { return t.IsError } +func (e errorCond) String() string { return "errors" } + +type traceList []*trace + +// Free calls unref on each element of the list. +func (trl traceList) Free() { + for _, t := range trl { + t.unref() + } +} + +// traceList may be sorted in reverse chronological order. +func (trl traceList) Len() int { return len(trl) } +func (trl traceList) Less(i, j int) bool { return trl[i].Start.After(trl[j].Start) } +func (trl traceList) Swap(i, j int) { trl[i], trl[j] = trl[j], trl[i] } + +// An event is a timestamped log entry in a trace. +type event struct { + When time.Time + Elapsed time.Duration // since previous event in trace + NewDay bool // whether this event is on a different day to the previous event + Recyclable bool // whether this event was passed via LazyLog + What interface{} // string or fmt.Stringer + Sensitive bool // whether this event contains sensitive information +} + +// WhenString returns a string representation of the elapsed time of the event. +// It will include the date if midnight was crossed. +func (e event) WhenString() string { + if e.NewDay { + return e.When.Format("2006/01/02 15:04:05.000000") + } + return e.When.Format("15:04:05.000000") +} + +// discarded represents a number of discarded events. +// It is stored as *discarded to make it easier to update in-place. +type discarded int + +func (d *discarded) String() string { + return fmt.Sprintf("(%d events discarded)", int(*d)) +} + +// trace represents an active or complete request, +// either sent or received by this program. +type trace struct { + // Family is the top-level grouping of traces to which this belongs. + Family string + + // Title is the title of this trace. + Title string + + // Timing information. + Start time.Time + Elapsed time.Duration // zero while active + + // Trace information if non-zero. + traceID uint64 + spanID uint64 + + // Whether this trace resulted in an error. + IsError bool + + // Append-only sequence of events (modulo discards). + mu sync.RWMutex + events []event + + refs int32 // how many buckets this is in + recycler func(interface{}) + disc discarded // scratch space to avoid allocation + + finishStack []byte // where finish was called, if DebugUseAfterFinish is set +} + +func (tr *trace) reset() { + // Clear all but the mutex. Mutexes may not be copied, even when unlocked. + tr.Family = "" + tr.Title = "" + tr.Start = time.Time{} + tr.Elapsed = 0 + tr.traceID = 0 + tr.spanID = 0 + tr.IsError = false + tr.events = nil + tr.refs = 0 + tr.recycler = nil + tr.disc = 0 + tr.finishStack = nil +} + +// delta returns the elapsed time since the last event or the trace start, +// and whether it spans midnight. +// L >= tr.mu +func (tr *trace) delta(t time.Time) (time.Duration, bool) { + if len(tr.events) == 0 { + return t.Sub(tr.Start), false + } + prev := tr.events[len(tr.events)-1].When + return t.Sub(prev), prev.Day() != t.Day() +} + +func (tr *trace) addEvent(x interface{}, recyclable, sensitive bool) { + if DebugUseAfterFinish && tr.finishStack != nil { + buf := make([]byte, 4<<10) // 4 KB should be enough + n := runtime.Stack(buf, false) + log.Printf("net/trace: trace used after finish:\nFinished at:\n%s\nUsed at:\n%s", tr.finishStack, buf[:n]) + } + + /* + NOTE TO DEBUGGERS + + If you are here because your program panicked in this code, + it is almost definitely the fault of code using this package, + and very unlikely to be the fault of this code. + + The most likely scenario is that some code elsewhere is using + a requestz.Trace after its Finish method is called. + You can temporarily set the DebugUseAfterFinish var + to help discover where that is; do not leave that var set, + since it makes this package much less efficient. + */ + + e := event{When: time.Now(), What: x, Recyclable: recyclable, Sensitive: sensitive} + tr.mu.Lock() + e.Elapsed, e.NewDay = tr.delta(e.When) + if len(tr.events) < cap(tr.events) { + tr.events = append(tr.events, e) + } else { + // Discard the middle events. + di := int((cap(tr.events) - 1) / 2) + if d, ok := tr.events[di].What.(*discarded); ok { + (*d)++ + } else { + // disc starts at two to count for the event it is replacing, + // plus the next one that we are about to drop. + tr.disc = 2 + if tr.recycler != nil && tr.events[di].Recyclable { + go tr.recycler(tr.events[di].What) + } + tr.events[di].What = &tr.disc + } + // The timestamp of the discarded meta-event should be + // the time of the last event it is representing. + tr.events[di].When = tr.events[di+1].When + + if tr.recycler != nil && tr.events[di+1].Recyclable { + go tr.recycler(tr.events[di+1].What) + } + copy(tr.events[di+1:], tr.events[di+2:]) + tr.events[cap(tr.events)-1] = e + } + tr.mu.Unlock() +} + +func (tr *trace) LazyLog(x fmt.Stringer, sensitive bool) { + tr.addEvent(x, true, sensitive) +} + +func (tr *trace) LazyPrintf(format string, a ...interface{}) { + tr.addEvent(&lazySprintf{format, a}, false, false) +} + +func (tr *trace) SetError() { tr.IsError = true } + +func (tr *trace) SetRecycler(f func(interface{})) { + tr.recycler = f +} + +func (tr *trace) SetTraceInfo(traceID, spanID uint64) { + tr.traceID, tr.spanID = traceID, spanID +} + +func (tr *trace) SetMaxEvents(m int) { + // Always keep at least three events: first, discarded count, last. + if len(tr.events) == 0 && m > 3 { + tr.events = make([]event, 0, m) + } +} + +func (tr *trace) ref() { + atomic.AddInt32(&tr.refs, 1) +} + +func (tr *trace) unref() { + if atomic.AddInt32(&tr.refs, -1) == 0 { + if tr.recycler != nil { + // freeTrace clears tr, so we hold tr.recycler and tr.events here. + go func(f func(interface{}), es []event) { + for _, e := range es { + if e.Recyclable { + f(e.What) + } + } + }(tr.recycler, tr.events) + } + + freeTrace(tr) + } +} + +func (tr *trace) When() string { + return tr.Start.Format("2006/01/02 15:04:05.000000") +} + +func (tr *trace) ElapsedTime() string { + t := tr.Elapsed + if t == 0 { + // Active trace. + t = time.Since(tr.Start) + } + return fmt.Sprintf("%.6f", t.Seconds()) +} + +func (tr *trace) Events() []event { + tr.mu.RLock() + defer tr.mu.RUnlock() + return tr.events +} + +var traceFreeList = make(chan *trace, 1000) // TODO(dsymonds): Use sync.Pool? + +// newTrace returns a trace ready to use. +func newTrace() *trace { + select { + case tr := <-traceFreeList: + return tr + default: + return new(trace) + } +} + +// freeTrace adds tr to traceFreeList if there's room. +// This is non-blocking. +func freeTrace(tr *trace) { + if DebugUseAfterFinish { + return // never reuse + } + tr.reset() + select { + case traceFreeList <- tr: + default: + } +} + +func elapsed(d time.Duration) string { + b := []byte(fmt.Sprintf("%.6f", d.Seconds())) + + // For subsecond durations, blank all zeros before decimal point, + // and all zeros between the decimal point and the first non-zero digit. + if d < time.Second { + dot := bytes.IndexByte(b, '.') + for i := 0; i < dot; i++ { + b[i] = ' ' + } + for i := dot + 1; i < len(b); i++ { + if b[i] == '0' { + b[i] = ' ' + } else { + break + } + } + } + + return string(b) +} + +var pageTmpl = template.Must(template.New("Page").Funcs(template.FuncMap{ + "elapsed": elapsed, + "add": func(a, b int) int { return a + b }, +}).Parse(pageHTML)) + +const pageHTML = ` +{{template "Prolog" .}} +{{template "StatusTable" .}} +{{template "Epilog" .}} + +{{define "Prolog"}} + + + /debug/requests + + + + +

/debug/requests

+{{end}} {{/* end of Prolog */}} + +{{define "StatusTable"}} + + {{range $fam := .Families}} + + + + {{$n := index $.ActiveTraceCount $fam}} + + + {{$f := index $.CompletedTraces $fam}} + {{range $i, $b := $f.Buckets}} + {{$empty := $b.Empty}} + + {{end}} + + {{$nb := len $f.Buckets}} + + + + + + {{end}} +
{{$fam}} + {{if $n}}{{end}} + [{{$n}} active] + {{if $n}}{{end}} + + {{if not $empty}}{{end}} + [{{.Cond}}] + {{if not $empty}}{{end}} + + [minute] + + [hour] + + [total] +
+{{end}} {{/* end of StatusTable */}} + +{{define "Epilog"}} +{{if $.Traces}} +
+

Family: {{$.Family}}

+ +{{if or $.Expanded $.Traced}} + [Normal/Summary] +{{else}} + [Normal/Summary] +{{end}} + +{{if or (not $.Expanded) $.Traced}} + [Normal/Expanded] +{{else}} + [Normal/Expanded] +{{end}} + +{{if not $.Active}} + {{if or $.Expanded (not $.Traced)}} + [Traced/Summary] + {{else}} + [Traced/Summary] + {{end}} + {{if or (not $.Expanded) (not $.Traced)}} + [Traced/Expanded] + {{else}} + [Traced/Expanded] + {{end}} +{{end}} + +{{if $.Total}} +

Showing {{len $.Traces}} of {{$.Total}} traces.

+{{end}} + + + + + {{range $tr := $.Traces}} + + + + + {{/* TODO: include traceID/spanID */}} + + {{if $.Expanded}} + {{range $tr.Events}} + + + + + + {{end}} + {{end}} + {{end}} +
+ {{if $.Active}}Active{{else}}Completed{{end}} Requests +
WhenElapsed (s)
{{$tr.When}}{{$tr.ElapsedTime}}{{$tr.Title}}
{{.WhenString}}{{elapsed .Elapsed}}{{if or $.ShowSensitive (not .Sensitive)}}... {{.What}}{{else}}[redacted]{{end}}
+{{end}} {{/* if $.Traces */}} + +{{if $.Histogram}} +

Latency (µs) of {{$.Family}} over {{$.HistogramWindow}}

+{{$.Histogram}} +{{end}} {{/* if $.Histogram */}} + + + +{{end}} {{/* end of Epilog */}} +` diff --git a/Godeps/_workspace/src/golang.org/x/net/trace/trace_test.go b/Godeps/_workspace/src/golang.org/x/net/trace/trace_test.go new file mode 100644 index 000000000..c2f5fcbaa --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/trace/trace_test.go @@ -0,0 +1,46 @@ +// Copyright 2015 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 trace + +import ( + "reflect" + "testing" +) + +type s struct{} + +func (s) String() string { return "lazy string" } + +// TestReset checks whether all the fields are zeroed after reset. +func TestReset(t *testing.T) { + tr := New("foo", "bar") + tr.LazyLog(s{}, false) + tr.LazyPrintf("%d", 1) + tr.SetRecycler(func(_ interface{}) {}) + tr.SetTraceInfo(3, 4) + tr.SetMaxEvents(100) + tr.SetError() + tr.Finish() + + tr.(*trace).reset() + + if !reflect.DeepEqual(tr, new(trace)) { + t.Errorf("reset didn't clear all fields: %+v", tr) + } +} + +// TestResetLog checks whether all the fields are zeroed after reset. +func TestResetLog(t *testing.T) { + el := NewEventLog("foo", "bar") + el.Printf("message") + el.Errorf("error") + el.Finish() + + el.(*eventLog).reset() + + if !reflect.DeepEqual(el, new(eventLog)) { + t.Errorf("reset didn't clear all fields: %+v", el) + } +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/.travis.yml b/Godeps/_workspace/src/golang.org/x/oauth2/.travis.yml new file mode 100644 index 000000000..a035125c3 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/.travis.yml @@ -0,0 +1,14 @@ +language: go + +go: + - 1.3 + - 1.4 + +install: + - export GOPATH="$HOME/gopath" + - mkdir -p "$GOPATH/src/golang.org/x" + - mv "$TRAVIS_BUILD_DIR" "$GOPATH/src/golang.org/x/oauth2" + - go get -v -t -d golang.org/x/oauth2/... + +script: + - go test -v golang.org/x/oauth2/... diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/AUTHORS b/Godeps/_workspace/src/golang.org/x/oauth2/AUTHORS new file mode 100644 index 000000000..15167cd74 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/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/Godeps/_workspace/src/golang.org/x/oauth2/CONTRIBUTING.md b/Godeps/_workspace/src/golang.org/x/oauth2/CONTRIBUTING.md new file mode 100644 index 000000000..46aa2b12d --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/CONTRIBUTING.md @@ -0,0 +1,31 @@ +# Contributing to Go + +Go is an open source project. + +It is the work of hundreds of contributors. We appreciate your help! + + +## Filing issues + +When [filing an issue](https://github.com/golang/oauth2/issues), make sure to answer these five questions: + +1. What version of Go are you using (`go version`)? +2. What operating system and processor architecture are you using? +3. What did you do? +4. What did you expect to see? +5. What did you see instead? + +General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. +The gophers there will answer or ask you to file an issue if you've tripped over a bug. + +## Contributing code + +Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) +before sending patches. + +**We do not accept GitHub pull requests** +(we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review). + +Unless otherwise noted, the Go source files are distributed under +the BSD-style license found in the LICENSE file. + diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/CONTRIBUTORS b/Godeps/_workspace/src/golang.org/x/oauth2/CONTRIBUTORS new file mode 100644 index 000000000..1c4577e96 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/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/Godeps/_workspace/src/golang.org/x/oauth2/LICENSE b/Godeps/_workspace/src/golang.org/x/oauth2/LICENSE new file mode 100644 index 000000000..d02f24fd5 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The oauth2 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/Godeps/_workspace/src/golang.org/x/oauth2/README.md b/Godeps/_workspace/src/golang.org/x/oauth2/README.md new file mode 100644 index 000000000..0d5141733 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/README.md @@ -0,0 +1,64 @@ +# OAuth2 for Go + +[![Build Status](https://travis-ci.org/golang/oauth2.svg?branch=master)](https://travis-ci.org/golang/oauth2) + +oauth2 package contains a client implementation for OAuth 2.0 spec. + +## Installation + +~~~~ +go get golang.org/x/oauth2 +~~~~ + +See godoc for further documentation and examples. + +* [godoc.org/golang.org/x/oauth2](http://godoc.org/golang.org/x/oauth2) +* [godoc.org/golang.org/x/oauth2/google](http://godoc.org/golang.org/x/oauth2/google) + + +## App Engine + +In change 96e89be (March 2015) we removed the `oauth2.Context2` type in favor +of the [`context.Context`](https://golang.org/x/net/context#Context) type from +the `golang.org/x/net/context` package + +This means its no longer possible to use the "Classic App Engine" +`appengine.Context` type with the `oauth2` package. (You're using +Classic App Engine if you import the package `"appengine"`.) + +To work around this, you may use the new `"google.golang.org/appengine"` +package. This package has almost the same API as the `"appengine"` package, +but it can be fetched with `go get` and used on "Managed VMs" and well as +Classic App Engine. + +See the [new `appengine` package's readme](https://github.com/golang/appengine#updating-a-go-app-engine-app) +for information on updating your app. + +If you don't want to update your entire app to use the new App Engine packages, +you may use both sets of packages in parallel, using only the new packages +with the `oauth2` package. + + import ( + "golang.org/x/net/context" + "golang.org/x/oauth2" + "golang.org/x/oauth2/google" + newappengine "google.golang.org/appengine" + newurlfetch "google.golang.org/appengine/urlfetch" + + "appengine" + ) + + func handler(w http.ResponseWriter, r *http.Request) { + var c appengine.Context = appengine.NewContext(r) + c.Infof("Logging a message with the old package") + + var ctx context.Context = newappengine.NewContext(r) + client := &http.Client{ + Transport: &oauth2.Transport{ + Source: google.AppEngineTokenSource(ctx, "scope"), + Base: &newurlfetch.Transport{Context: ctx}, + }, + } + client.Get("...") + } + diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/client_appengine.go b/Godeps/_workspace/src/golang.org/x/oauth2/client_appengine.go new file mode 100644 index 000000000..4a554cb9b --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/client_appengine.go @@ -0,0 +1,25 @@ +// Copyright 2014 The oauth2 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 appenginevm + +// App Engine hooks. + +package oauth2 + +import ( + "net/http" + + "golang.org/x/net/context" + "golang.org/x/oauth2/internal" + "google.golang.org/appengine/urlfetch" +) + +func init() { + internal.RegisterContextClientFunc(contextClientAppEngine) +} + +func contextClientAppEngine(ctx context.Context) (*http.Client, error) { + return urlfetch.Client(ctx), nil +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/clientcredentials/clientcredentials.go b/Godeps/_workspace/src/golang.org/x/oauth2/clientcredentials/clientcredentials.go new file mode 100644 index 000000000..baebced2a --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/clientcredentials/clientcredentials.go @@ -0,0 +1,112 @@ +// Copyright 2014 The oauth2 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 clientcredentials implements the OAuth2.0 "client credentials" token flow, +// also known as the "two-legged OAuth 2.0". +// +// This should be used when the client is acting on its own behalf or when the client +// is the resource owner. It may also be used when requesting access to protected +// resources based on an authorization previously arranged with the authorization +// server. +// +// See http://tools.ietf.org/html/draft-ietf-oauth-v2-31#section-4.4 +package clientcredentials // import "golang.org/x/oauth2/clientcredentials" + +import ( + "net/http" + "net/url" + "strings" + + "golang.org/x/net/context" + "golang.org/x/oauth2" + "golang.org/x/oauth2/internal" +) + +// tokenFromInternal maps an *internal.Token struct into +// an *oauth2.Token struct. +func tokenFromInternal(t *internal.Token) *oauth2.Token { + if t == nil { + return nil + } + tk := &oauth2.Token{ + AccessToken: t.AccessToken, + TokenType: t.TokenType, + RefreshToken: t.RefreshToken, + Expiry: t.Expiry, + } + return tk.WithExtra(t.Raw) +} + +// retrieveToken takes a *Config and uses that to retrieve an *internal.Token. +// This token is then mapped from *internal.Token into an *oauth2.Token which is +// returned along with an error. +func retrieveToken(ctx context.Context, c *Config, v url.Values) (*oauth2.Token, error) { + tk, err := internal.RetrieveToken(ctx, c.ClientID, c.ClientSecret, c.TokenURL, v) + if err != nil { + return nil, err + } + return tokenFromInternal(tk), nil +} + +// Client Credentials Config describes a 2-legged OAuth2 flow, with both the +// client application information and the server's endpoint URLs. +type Config struct { + // ClientID is the application's ID. + ClientID string + + // ClientSecret is the application's secret. + ClientSecret string + + // TokenURL is the resource server's token endpoint + // URL. This is a constant specific to each server. + TokenURL string + + // Scope specifies optional requested permissions. + Scopes []string +} + +// Token uses client credentials to retreive a token. +// The HTTP client to use is derived from the context. +// If nil, http.DefaultClient is used. +func (c *Config) Token(ctx context.Context) (*oauth2.Token, error) { + return retrieveToken(ctx, c, url.Values{ + "grant_type": {"client_credentials"}, + "scope": internal.CondVal(strings.Join(c.Scopes, " ")), + }) +} + +// Client returns an HTTP client using the provided token. +// The token will auto-refresh as necessary. The underlying +// HTTP transport will be obtained using the provided context. +// The returned client and its Transport should not be modified. +func (c *Config) Client(ctx context.Context) *http.Client { + return oauth2.NewClient(ctx, c.TokenSource(ctx)) +} + +// TokenSource returns a TokenSource that returns t until t expires, +// automatically refreshing it as necessary using the provided context and the +// client ID and client secret. +// +// Most users will use Config.Client instead. +func (c *Config) TokenSource(ctx context.Context) oauth2.TokenSource { + source := &tokenSource{ + ctx: ctx, + conf: c, + } + return oauth2.ReuseTokenSource(nil, source) +} + +type tokenSource struct { + ctx context.Context + conf *Config +} + +// Token refreshes the token by using a new client credentials request. +// tokens received this way do not include a refresh token +func (c *tokenSource) Token() (*oauth2.Token, error) { + return retrieveToken(c.ctx, c.conf, url.Values{ + "grant_type": {"client_credentials"}, + "scope": internal.CondVal(strings.Join(c.conf.Scopes, " ")), + }) +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/clientcredentials/clientcredentials_test.go b/Godeps/_workspace/src/golang.org/x/oauth2/clientcredentials/clientcredentials_test.go new file mode 100644 index 000000000..ab319e082 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/clientcredentials/clientcredentials_test.go @@ -0,0 +1,96 @@ +// Copyright 2014 The oauth2 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 clientcredentials + +import ( + "io/ioutil" + "net/http" + "net/http/httptest" + "testing" + + "golang.org/x/oauth2" +) + +func newConf(url string) *Config { + return &Config{ + ClientID: "CLIENT_ID", + ClientSecret: "CLIENT_SECRET", + Scopes: []string{"scope1", "scope2"}, + TokenURL: url + "/token", + } +} + +type mockTransport struct { + rt func(req *http.Request) (resp *http.Response, err error) +} + +func (t *mockTransport) RoundTrip(req *http.Request) (resp *http.Response, err error) { + return t.rt(req) +} + +func TestTokenRequest(t *testing.T) { + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.URL.String() != "/token" { + t.Errorf("authenticate client request URL = %q; want %q", r.URL, "/token") + } + headerAuth := r.Header.Get("Authorization") + if headerAuth != "Basic Q0xJRU5UX0lEOkNMSUVOVF9TRUNSRVQ=" { + t.Errorf("Unexpected authorization header, %v is found.", headerAuth) + } + if got, want := r.Header.Get("Content-Type"), "application/x-www-form-urlencoded"; got != want { + t.Errorf("Content-Type header = %q; want %q", got, want) + } + body, err := ioutil.ReadAll(r.Body) + if err != nil { + r.Body.Close() + } + if err != nil { + t.Errorf("failed reading request body: %s.", err) + } + if string(body) != "client_id=CLIENT_ID&grant_type=client_credentials&scope=scope1+scope2" { + t.Errorf("payload = %q; want %q", string(body), "client_id=CLIENT_ID&grant_type=client_credentials&scope=scope1+scope2") + } + w.Header().Set("Content-Type", "application/x-www-form-urlencoded") + w.Write([]byte("access_token=90d64460d14870c08c81352a05dedd3465940a7c&token_type=bearer")) + })) + defer ts.Close() + conf := newConf(ts.URL) + tok, err := conf.Token(oauth2.NoContext) + if err != nil { + t.Error(err) + } + if !tok.Valid() { + t.Fatalf("token invalid. got: %#v", tok) + } + if tok.AccessToken != "90d64460d14870c08c81352a05dedd3465940a7c" { + t.Errorf("Access token = %q; want %q", tok.AccessToken, "90d64460d14870c08c81352a05dedd3465940a7c") + } + if tok.TokenType != "bearer" { + t.Errorf("token type = %q; want %q", tok.TokenType, "bearer") + } +} + +func TestTokenRefreshRequest(t *testing.T) { + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.URL.String() == "/somethingelse" { + return + } + if r.URL.String() != "/token" { + t.Errorf("Unexpected token refresh request URL, %v is found.", r.URL) + } + headerContentType := r.Header.Get("Content-Type") + if headerContentType != "application/x-www-form-urlencoded" { + t.Errorf("Unexpected Content-Type header, %v is found.", headerContentType) + } + body, _ := ioutil.ReadAll(r.Body) + if string(body) != "client_id=CLIENT_ID&grant_type=client_credentials&scope=scope1+scope2" { + t.Errorf("Unexpected refresh token payload, %v is found.", string(body)) + } + })) + defer ts.Close() + conf := newConf(ts.URL) + c := conf.Client(oauth2.NoContext) + c.Get(ts.URL + "/somethingelse") +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/example_test.go b/Godeps/_workspace/src/golang.org/x/oauth2/example_test.go new file mode 100644 index 000000000..8be278855 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/example_test.go @@ -0,0 +1,45 @@ +// Copyright 2014 The oauth2 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 oauth2_test + +import ( + "fmt" + "log" + + "golang.org/x/oauth2" +) + +func ExampleConfig() { + conf := &oauth2.Config{ + ClientID: "YOUR_CLIENT_ID", + ClientSecret: "YOUR_CLIENT_SECRET", + Scopes: []string{"SCOPE1", "SCOPE2"}, + Endpoint: oauth2.Endpoint{ + AuthURL: "https://provider.com/o/oauth2/auth", + TokenURL: "https://provider.com/o/oauth2/token", + }, + } + + // Redirect user to consent page to ask for permission + // for the scopes specified above. + url := conf.AuthCodeURL("state", oauth2.AccessTypeOffline) + fmt.Printf("Visit the URL for the auth dialog: %v", url) + + // Use the authorization code that is pushed to the redirect URL. + // NewTransportWithCode will do the handshake to retrieve + // an access token and initiate a Transport that is + // authorized and authenticated by the retrieved token. + var code string + if _, err := fmt.Scan(&code); err != nil { + log.Fatal(err) + } + tok, err := conf.Exchange(oauth2.NoContext, code) + if err != nil { + log.Fatal(err) + } + + client := conf.Client(oauth2.NoContext, tok) + client.Get("...") +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/facebook/facebook.go b/Godeps/_workspace/src/golang.org/x/oauth2/facebook/facebook.go new file mode 100644 index 000000000..962e86b0e --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/facebook/facebook.go @@ -0,0 +1,16 @@ +// Copyright 2015 The oauth2 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 facebook provides constants for using OAuth2 to access Facebook. +package facebook // import "golang.org/x/oauth2/facebook" + +import ( + "golang.org/x/oauth2" +) + +// Endpoint is Facebook's OAuth 2.0 endpoint. +var Endpoint = oauth2.Endpoint{ + AuthURL: "https://www.facebook.com/dialog/oauth", + TokenURL: "https://graph.facebook.com/oauth/access_token", +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/github/github.go b/Godeps/_workspace/src/golang.org/x/oauth2/github/github.go new file mode 100644 index 000000000..1648cb58d --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/github/github.go @@ -0,0 +1,16 @@ +// Copyright 2014 The oauth2 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 github provides constants for using OAuth2 to access Github. +package github // import "golang.org/x/oauth2/github" + +import ( + "golang.org/x/oauth2" +) + +// Endpoint is Github's OAuth 2.0 endpoint. +var Endpoint = oauth2.Endpoint{ + AuthURL: "https://github.com/login/oauth/authorize", + TokenURL: "https://github.com/login/oauth/access_token", +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/google/appengine.go b/Godeps/_workspace/src/golang.org/x/oauth2/google/appengine.go new file mode 100644 index 000000000..65dc34731 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/google/appengine.go @@ -0,0 +1,83 @@ +// Copyright 2014 The oauth2 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 google + +import ( + "sort" + "strings" + "sync" + "time" + + "golang.org/x/net/context" + "golang.org/x/oauth2" +) + +// Set at init time by appengine_hook.go. If nil, we're not on App Engine. +var appengineTokenFunc func(c context.Context, scopes ...string) (token string, expiry time.Time, err error) + +// AppEngineTokenSource returns a token source that fetches tokens +// issued to the current App Engine application's service account. +// If you are implementing a 3-legged OAuth 2.0 flow on App Engine +// that involves user accounts, see oauth2.Config instead. +// +// The provided context must have come from appengine.NewContext. +func AppEngineTokenSource(ctx context.Context, scope ...string) oauth2.TokenSource { + if appengineTokenFunc == nil { + panic("google: AppEngineTokenSource can only be used on App Engine.") + } + scopes := append([]string{}, scope...) + sort.Strings(scopes) + return &appEngineTokenSource{ + ctx: ctx, + scopes: scopes, + key: strings.Join(scopes, " "), + } +} + +// aeTokens helps the fetched tokens to be reused until their expiration. +var ( + aeTokensMu sync.Mutex + aeTokens = make(map[string]*tokenLock) // key is space-separated scopes +) + +type tokenLock struct { + mu sync.Mutex // guards t; held while fetching or updating t + t *oauth2.Token +} + +type appEngineTokenSource struct { + ctx context.Context + scopes []string + key string // to aeTokens map; space-separated scopes +} + +func (ts *appEngineTokenSource) Token() (*oauth2.Token, error) { + if appengineTokenFunc == nil { + panic("google: AppEngineTokenSource can only be used on App Engine.") + } + + aeTokensMu.Lock() + tok, ok := aeTokens[ts.key] + if !ok { + tok = &tokenLock{} + aeTokens[ts.key] = tok + } + aeTokensMu.Unlock() + + tok.mu.Lock() + defer tok.mu.Unlock() + if tok.t.Valid() { + return tok.t, nil + } + access, exp, err := appengineTokenFunc(ts.ctx, ts.scopes...) + if err != nil { + return nil, err + } + tok.t = &oauth2.Token{ + AccessToken: access, + Expiry: exp, + } + return tok.t, nil +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/google/appengine_hook.go b/Godeps/_workspace/src/golang.org/x/oauth2/google/appengine_hook.go new file mode 100644 index 000000000..2f9b15432 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/google/appengine_hook.go @@ -0,0 +1,13 @@ +// Copyright 2015 The oauth2 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 appenginevm + +package google + +import "google.golang.org/appengine" + +func init() { + appengineTokenFunc = appengine.AccessToken +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/google/default.go b/Godeps/_workspace/src/golang.org/x/oauth2/google/default.go new file mode 100644 index 000000000..78f808985 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/google/default.go @@ -0,0 +1,154 @@ +// Copyright 2015 The oauth2 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 google + +import ( + "encoding/json" + "errors" + "fmt" + "io/ioutil" + "net/http" + "os" + "path/filepath" + "runtime" + + "golang.org/x/net/context" + "golang.org/x/oauth2" + "golang.org/x/oauth2/jwt" + "google.golang.org/cloud/compute/metadata" +) + +// DefaultClient returns an HTTP Client that uses the +// DefaultTokenSource to obtain authentication credentials. +// +// This client should be used when developing services +// that run on Google App Engine or Google Compute Engine +// and use "Application Default Credentials." +// +// For more details, see: +// https://developers.google.com/accounts/docs/application-default-credentials +// +func DefaultClient(ctx context.Context, scope ...string) (*http.Client, error) { + ts, err := DefaultTokenSource(ctx, scope...) + if err != nil { + return nil, err + } + return oauth2.NewClient(ctx, ts), nil +} + +// DefaultTokenSource is a token source that uses +// "Application Default Credentials". +// +// It looks for credentials in the following places, +// preferring the first location found: +// +// 1. A JSON file whose path is specified by the +// GOOGLE_APPLICATION_CREDENTIALS environment variable. +// 2. A JSON file in a location known to the gcloud command-line tool. +// On Windows, this is %APPDATA%/gcloud/application_default_credentials.json. +// On other systems, $HOME/.config/gcloud/application_default_credentials.json. +// 3. On Google App Engine it uses the appengine.AccessToken function. +// 4. On Google Compute Engine, it fetches credentials from the metadata server. +// (In this final case any provided scopes are ignored.) +// +// For more details, see: +// https://developers.google.com/accounts/docs/application-default-credentials +// +func DefaultTokenSource(ctx context.Context, scope ...string) (oauth2.TokenSource, error) { + // First, try the environment variable. + const envVar = "GOOGLE_APPLICATION_CREDENTIALS" + if filename := os.Getenv(envVar); filename != "" { + ts, err := tokenSourceFromFile(ctx, filename, scope) + if err != nil { + return nil, fmt.Errorf("google: error getting credentials using %v environment variable: %v", envVar, err) + } + return ts, nil + } + + // Second, try a well-known file. + filename := wellKnownFile() + _, err := os.Stat(filename) + if err == nil { + ts, err2 := tokenSourceFromFile(ctx, filename, scope) + if err2 == nil { + return ts, nil + } + err = err2 + } else if os.IsNotExist(err) { + err = nil // ignore this error + } + if err != nil { + return nil, fmt.Errorf("google: error getting credentials using well-known file (%v): %v", filename, err) + } + + // Third, if we're on Google App Engine use those credentials. + if appengineTokenFunc != nil { + return AppEngineTokenSource(ctx, scope...), nil + } + + // Fourth, if we're on Google Compute Engine use the metadata server. + if metadata.OnGCE() { + return ComputeTokenSource(""), nil + } + + // None are found; return helpful error. + const url = "https://developers.google.com/accounts/docs/application-default-credentials" + return nil, fmt.Errorf("google: could not find default credentials. See %v for more information.", url) +} + +func wellKnownFile() string { + const f = "application_default_credentials.json" + if runtime.GOOS == "windows" { + return filepath.Join(os.Getenv("APPDATA"), "gcloud", f) + } + return filepath.Join(guessUnixHomeDir(), ".config", "gcloud", f) +} + +func tokenSourceFromFile(ctx context.Context, filename string, scopes []string) (oauth2.TokenSource, error) { + b, err := ioutil.ReadFile(filename) + if err != nil { + return nil, err + } + var d struct { + // Common fields + Type string + ClientID string `json:"client_id"` + + // User Credential fields + ClientSecret string `json:"client_secret"` + RefreshToken string `json:"refresh_token"` + + // Service Account fields + ClientEmail string `json:"client_email"` + PrivateKeyID string `json:"private_key_id"` + PrivateKey string `json:"private_key"` + } + if err := json.Unmarshal(b, &d); err != nil { + return nil, err + } + switch d.Type { + case "authorized_user": + cfg := &oauth2.Config{ + ClientID: d.ClientID, + ClientSecret: d.ClientSecret, + Scopes: append([]string{}, scopes...), // copy + Endpoint: Endpoint, + } + tok := &oauth2.Token{RefreshToken: d.RefreshToken} + return cfg.TokenSource(ctx, tok), nil + case "service_account": + cfg := &jwt.Config{ + Email: d.ClientEmail, + PrivateKey: []byte(d.PrivateKey), + Scopes: append([]string{}, scopes...), // copy + TokenURL: JWTTokenURL, + } + return cfg.TokenSource(ctx), nil + case "": + return nil, errors.New("missing 'type' field in credentials") + default: + return nil, fmt.Errorf("unknown credential type: %q", d.Type) + } +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/google/example_test.go b/Godeps/_workspace/src/golang.org/x/oauth2/google/example_test.go new file mode 100644 index 000000000..17262802a --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/google/example_test.go @@ -0,0 +1,150 @@ +// Copyright 2014 The oauth2 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 appenginevm !appengine + +package google_test + +import ( + "fmt" + "io/ioutil" + "log" + "net/http" + + "golang.org/x/oauth2" + "golang.org/x/oauth2/google" + "golang.org/x/oauth2/jwt" + "google.golang.org/appengine" + "google.golang.org/appengine/urlfetch" +) + +func ExampleDefaultClient() { + client, err := google.DefaultClient(oauth2.NoContext, + "https://www.googleapis.com/auth/devstorage.full_control") + if err != nil { + log.Fatal(err) + } + client.Get("...") +} + +func Example_webServer() { + // Your credentials should be obtained from the Google + // Developer Console (https://console.developers.google.com). + conf := &oauth2.Config{ + ClientID: "YOUR_CLIENT_ID", + ClientSecret: "YOUR_CLIENT_SECRET", + RedirectURL: "YOUR_REDIRECT_URL", + Scopes: []string{ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/blogger", + }, + Endpoint: google.Endpoint, + } + // Redirect user to Google's consent page to ask for permission + // for the scopes specified above. + url := conf.AuthCodeURL("state") + fmt.Printf("Visit the URL for the auth dialog: %v", url) + + // Handle the exchange code to initiate a transport. + tok, err := conf.Exchange(oauth2.NoContext, "authorization-code") + if err != nil { + log.Fatal(err) + } + client := conf.Client(oauth2.NoContext, tok) + client.Get("...") +} + +func ExampleJWTConfigFromJSON() { + // Your credentials should be obtained from the Google + // Developer Console (https://console.developers.google.com). + // Navigate to your project, then see the "Credentials" page + // under "APIs & Auth". + // To create a service account client, click "Create new Client ID", + // select "Service Account", and click "Create Client ID". A JSON + // key file will then be downloaded to your computer. + data, err := ioutil.ReadFile("/path/to/your-project-key.json") + if err != nil { + log.Fatal(err) + } + conf, err := google.JWTConfigFromJSON(data, "https://www.googleapis.com/auth/bigquery") + if err != nil { + log.Fatal(err) + } + // Initiate an http.Client. The following GET request will be + // authorized and authenticated on the behalf of + // your service account. + client := conf.Client(oauth2.NoContext) + client.Get("...") +} + +func ExampleSDKConfig() { + // The credentials will be obtained from the first account that + // has been authorized with `gcloud auth login`. + conf, err := google.NewSDKConfig("") + if err != nil { + log.Fatal(err) + } + // Initiate an http.Client. The following GET request will be + // authorized and authenticated on the behalf of the SDK user. + client := conf.Client(oauth2.NoContext) + client.Get("...") +} + +func Example_serviceAccount() { + // Your credentials should be obtained from the Google + // Developer Console (https://console.developers.google.com). + conf := &jwt.Config{ + Email: "xxx@developer.gserviceaccount.com", + // The contents of your RSA private key or your PEM file + // that contains a private key. + // If you have a p12 file instead, you + // can use `openssl` to export the private key into a pem file. + // + // $ openssl pkcs12 -in key.p12 -passin pass:notasecret -out key.pem -nodes + // + // The field only supports PEM containers with no passphrase. + // The openssl command will convert p12 keys to passphrase-less PEM containers. + PrivateKey: []byte("-----BEGIN RSA PRIVATE KEY-----..."), + Scopes: []string{ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/blogger", + }, + TokenURL: google.JWTTokenURL, + // If you would like to impersonate a user, you can + // create a transport with a subject. The following GET + // request will be made on the behalf of user@example.com. + // Optional. + Subject: "user@example.com", + } + // Initiate an http.Client, the following GET request will be + // authorized and authenticated on the behalf of user@example.com. + client := conf.Client(oauth2.NoContext) + client.Get("...") +} + +func ExampleAppEngineTokenSource() { + var req *http.Request // from the ServeHTTP handler + ctx := appengine.NewContext(req) + client := &http.Client{ + Transport: &oauth2.Transport{ + Source: google.AppEngineTokenSource(ctx, "https://www.googleapis.com/auth/bigquery"), + Base: &urlfetch.Transport{ + Context: ctx, + }, + }, + } + client.Get("...") +} + +func ExampleComputeTokenSource() { + client := &http.Client{ + Transport: &oauth2.Transport{ + // Fetch from Google Compute Engine's metadata server to retrieve + // an access token for the provided account. + // If no account is specified, "default" is used. + Source: google.ComputeTokenSource(""), + }, + } + client.Get("...") +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/google/google.go b/Godeps/_workspace/src/golang.org/x/oauth2/google/google.go new file mode 100644 index 000000000..74aa7d911 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/google/google.go @@ -0,0 +1,145 @@ +// Copyright 2014 The oauth2 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 google provides support for making OAuth2 authorized and +// authenticated HTTP requests to Google APIs. +// It supports the Web server flow, client-side credentials, service accounts, +// Google Compute Engine service accounts, and Google App Engine service +// accounts. +// +// For more information, please read +// https://developers.google.com/accounts/docs/OAuth2 +// and +// https://developers.google.com/accounts/docs/application-default-credentials. +package google // import "golang.org/x/oauth2/google" + +import ( + "encoding/json" + "errors" + "fmt" + "strings" + "time" + + "golang.org/x/oauth2" + "golang.org/x/oauth2/jwt" + "google.golang.org/cloud/compute/metadata" +) + +// Endpoint is Google's OAuth 2.0 endpoint. +var Endpoint = oauth2.Endpoint{ + AuthURL: "https://accounts.google.com/o/oauth2/auth", + TokenURL: "https://accounts.google.com/o/oauth2/token", +} + +// JWTTokenURL is Google's OAuth 2.0 token URL to use with the JWT flow. +const JWTTokenURL = "https://accounts.google.com/o/oauth2/token" + +// ConfigFromJSON uses a Google Developers Console client_credentials.json +// file to construct a config. +// client_credentials.json can be downloadable from https://console.developers.google.com, +// under "APIs & Auth" > "Credentials". Download the Web application credentials in the +// JSON format and provide the contents of the file as jsonKey. +func ConfigFromJSON(jsonKey []byte, scope ...string) (*oauth2.Config, error) { + type cred struct { + ClientID string `json:"client_id"` + ClientSecret string `json:"client_secret"` + RedirectURIs []string `json:"redirect_uris"` + AuthURI string `json:"auth_uri"` + TokenURI string `json:"token_uri"` + } + var j struct { + Web *cred `json:"web"` + Installed *cred `json:"installed"` + } + if err := json.Unmarshal(jsonKey, &j); err != nil { + return nil, err + } + var c *cred + switch { + case j.Web != nil: + c = j.Web + case j.Installed != nil: + c = j.Installed + default: + return nil, fmt.Errorf("oauth2/google: no credentials found") + } + if len(c.RedirectURIs) < 1 { + return nil, errors.New("oauth2/google: missing redirect URL in the client_credentials.json") + } + return &oauth2.Config{ + ClientID: c.ClientID, + ClientSecret: c.ClientSecret, + RedirectURL: c.RedirectURIs[0], + Scopes: scope, + Endpoint: oauth2.Endpoint{ + AuthURL: c.AuthURI, + TokenURL: c.TokenURI, + }, + }, nil +} + +// JWTConfigFromJSON uses a Google Developers service account JSON key file to read +// the credentials that authorize and authenticate the requests. +// Create a service account on "Credentials" page under "APIs & Auth" for your +// project at https://console.developers.google.com to download a JSON key file. +func JWTConfigFromJSON(jsonKey []byte, scope ...string) (*jwt.Config, error) { + var key struct { + Email string `json:"client_email"` + PrivateKey string `json:"private_key"` + } + if err := json.Unmarshal(jsonKey, &key); err != nil { + return nil, err + } + return &jwt.Config{ + Email: key.Email, + PrivateKey: []byte(key.PrivateKey), + Scopes: scope, + TokenURL: JWTTokenURL, + }, nil +} + +// ComputeTokenSource returns a token source that fetches access tokens +// from Google Compute Engine (GCE)'s metadata server. It's only valid to use +// this token source if your program is running on a GCE instance. +// If no account is specified, "default" is used. +// Further information about retrieving access tokens from the GCE metadata +// server can be found at https://cloud.google.com/compute/docs/authentication. +func ComputeTokenSource(account string) oauth2.TokenSource { + return oauth2.ReuseTokenSource(nil, computeSource{account: account}) +} + +type computeSource struct { + account string +} + +func (cs computeSource) Token() (*oauth2.Token, error) { + if !metadata.OnGCE() { + return nil, errors.New("oauth2/google: can't get a token from the metadata service; not running on GCE") + } + acct := cs.account + if acct == "" { + acct = "default" + } + tokenJSON, err := metadata.Get("instance/service-accounts/" + acct + "/token") + if err != nil { + return nil, err + } + var res struct { + AccessToken string `json:"access_token"` + ExpiresInSec int `json:"expires_in"` + TokenType string `json:"token_type"` + } + err = json.NewDecoder(strings.NewReader(tokenJSON)).Decode(&res) + if err != nil { + return nil, fmt.Errorf("oauth2/google: invalid token JSON from metadata: %v", err) + } + if res.ExpiresInSec == 0 || res.AccessToken == "" { + return nil, fmt.Errorf("oauth2/google: incomplete token received from metadata") + } + return &oauth2.Token{ + AccessToken: res.AccessToken, + TokenType: res.TokenType, + Expiry: time.Now().Add(time.Duration(res.ExpiresInSec) * time.Second), + }, nil +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/google/google_test.go b/Godeps/_workspace/src/golang.org/x/oauth2/google/google_test.go new file mode 100644 index 000000000..4cc01884b --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/google/google_test.go @@ -0,0 +1,67 @@ +// Copyright 2015 The oauth2 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 google + +import ( + "strings" + "testing" +) + +var webJSONKey = []byte(` +{ + "web": { + "auth_uri": "https://google.com/o/oauth2/auth", + "client_secret": "3Oknc4jS_wA2r9i", + "token_uri": "https://google.com/o/oauth2/token", + "client_email": "222-nprqovg5k43uum874cs9osjt2koe97g8@developer.gserviceaccount.com", + "redirect_uris": ["https://www.example.com/oauth2callback"], + "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/222-nprqovg5k43uum874cs9osjt2koe97g8@developer.gserviceaccount.com", + "client_id": "222-nprqovg5k43uum874cs9osjt2koe97g8.apps.googleusercontent.com", + "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", + "javascript_origins": ["https://www.example.com"] + } +}`) + +var installedJSONKey = []byte(`{ + "installed": { + "client_id": "222-installed.apps.googleusercontent.com", + "redirect_uris": ["https://www.example.com/oauth2callback"] + } +}`) + +func TestConfigFromJSON(t *testing.T) { + conf, err := ConfigFromJSON(webJSONKey, "scope1", "scope2") + if err != nil { + t.Error(err) + } + if got, want := conf.ClientID, "222-nprqovg5k43uum874cs9osjt2koe97g8.apps.googleusercontent.com"; got != want { + t.Errorf("ClientID = %q; want %q", got, want) + } + if got, want := conf.ClientSecret, "3Oknc4jS_wA2r9i"; got != want { + t.Errorf("ClientSecret = %q; want %q", got, want) + } + if got, want := conf.RedirectURL, "https://www.example.com/oauth2callback"; got != want { + t.Errorf("RedictURL = %q; want %q", got, want) + } + if got, want := strings.Join(conf.Scopes, ","), "scope1,scope2"; got != want { + t.Errorf("Scopes = %q; want %q", got, want) + } + if got, want := conf.Endpoint.AuthURL, "https://google.com/o/oauth2/auth"; got != want { + t.Errorf("AuthURL = %q; want %q", got, want) + } + if got, want := conf.Endpoint.TokenURL, "https://google.com/o/oauth2/token"; got != want { + t.Errorf("TokenURL = %q; want %q", got, want) + } +} + +func TestConfigFromJSON_Installed(t *testing.T) { + conf, err := ConfigFromJSON(installedJSONKey) + if err != nil { + t.Error(err) + } + if got, want := conf.ClientID, "222-installed.apps.googleusercontent.com"; got != want { + t.Errorf("ClientID = %q; want %q", got, want) + } +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/google/sdk.go b/Godeps/_workspace/src/golang.org/x/oauth2/google/sdk.go new file mode 100644 index 000000000..01ba0ecb0 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/google/sdk.go @@ -0,0 +1,168 @@ +// Copyright 2015 The oauth2 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 google + +import ( + "encoding/json" + "errors" + "fmt" + "net/http" + "os" + "os/user" + "path/filepath" + "runtime" + "strings" + "time" + + "golang.org/x/net/context" + "golang.org/x/oauth2" + "golang.org/x/oauth2/internal" +) + +type sdkCredentials struct { + Data []struct { + Credential struct { + ClientID string `json:"client_id"` + ClientSecret string `json:"client_secret"` + AccessToken string `json:"access_token"` + RefreshToken string `json:"refresh_token"` + TokenExpiry *time.Time `json:"token_expiry"` + } `json:"credential"` + Key struct { + Account string `json:"account"` + Scope string `json:"scope"` + } `json:"key"` + } +} + +// An SDKConfig provides access to tokens from an account already +// authorized via the Google Cloud SDK. +type SDKConfig struct { + conf oauth2.Config + initialToken *oauth2.Token +} + +// NewSDKConfig creates an SDKConfig for the given Google Cloud SDK +// account. If account is empty, the account currently active in +// Google Cloud SDK properties is used. +// Google Cloud SDK credentials must be created by running `gcloud auth` +// before using this function. +// The Google Cloud SDK is available at https://cloud.google.com/sdk/. +func NewSDKConfig(account string) (*SDKConfig, error) { + configPath, err := sdkConfigPath() + if err != nil { + return nil, fmt.Errorf("oauth2/google: error getting SDK config path: %v", err) + } + credentialsPath := filepath.Join(configPath, "credentials") + f, err := os.Open(credentialsPath) + if err != nil { + return nil, fmt.Errorf("oauth2/google: failed to load SDK credentials: %v", err) + } + defer f.Close() + + var c sdkCredentials + if err := json.NewDecoder(f).Decode(&c); err != nil { + return nil, fmt.Errorf("oauth2/google: failed to decode SDK credentials from %q: %v", credentialsPath, err) + } + if len(c.Data) == 0 { + return nil, fmt.Errorf("oauth2/google: no credentials found in %q, run `gcloud auth login` to create one", credentialsPath) + } + if account == "" { + propertiesPath := filepath.Join(configPath, "properties") + f, err := os.Open(propertiesPath) + if err != nil { + return nil, fmt.Errorf("oauth2/google: failed to load SDK properties: %v", err) + } + defer f.Close() + ini, err := internal.ParseINI(f) + if err != nil { + return nil, fmt.Errorf("oauth2/google: failed to parse SDK properties %q: %v", propertiesPath, err) + } + core, ok := ini["core"] + if !ok { + return nil, fmt.Errorf("oauth2/google: failed to find [core] section in %v", ini) + } + active, ok := core["account"] + if !ok { + return nil, fmt.Errorf("oauth2/google: failed to find %q attribute in %v", "account", core) + } + account = active + } + + for _, d := range c.Data { + if account == "" || d.Key.Account == account { + if d.Credential.AccessToken == "" && d.Credential.RefreshToken == "" { + return nil, fmt.Errorf("oauth2/google: no token available for account %q", account) + } + var expiry time.Time + if d.Credential.TokenExpiry != nil { + expiry = *d.Credential.TokenExpiry + } + return &SDKConfig{ + conf: oauth2.Config{ + ClientID: d.Credential.ClientID, + ClientSecret: d.Credential.ClientSecret, + Scopes: strings.Split(d.Key.Scope, " "), + Endpoint: Endpoint, + RedirectURL: "oob", + }, + initialToken: &oauth2.Token{ + AccessToken: d.Credential.AccessToken, + RefreshToken: d.Credential.RefreshToken, + Expiry: expiry, + }, + }, nil + } + } + return nil, fmt.Errorf("oauth2/google: no such credentials for account %q", account) +} + +// Client returns an HTTP client using Google Cloud SDK credentials to +// authorize requests. The token will auto-refresh as necessary. The +// underlying http.RoundTripper will be obtained using the provided +// context. The returned client and its Transport should not be +// modified. +func (c *SDKConfig) Client(ctx context.Context) *http.Client { + return &http.Client{ + Transport: &oauth2.Transport{ + Source: c.TokenSource(ctx), + }, + } +} + +// TokenSource returns an oauth2.TokenSource that retrieve tokens from +// Google Cloud SDK credentials using the provided context. +// It will returns the current access token stored in the credentials, +// and refresh it when it expires, but it won't update the credentials +// with the new access token. +func (c *SDKConfig) TokenSource(ctx context.Context) oauth2.TokenSource { + return c.conf.TokenSource(ctx, c.initialToken) +} + +// Scopes are the OAuth 2.0 scopes the current account is authorized for. +func (c *SDKConfig) Scopes() []string { + return c.conf.Scopes +} + +// sdkConfigPath tries to guess where the gcloud config is located. +// It can be overridden during tests. +var sdkConfigPath = func() (string, error) { + if runtime.GOOS == "windows" { + return filepath.Join(os.Getenv("APPDATA"), "gcloud"), nil + } + homeDir := guessUnixHomeDir() + if homeDir == "" { + return "", errors.New("unable to get current user home directory: os/user lookup failed; $HOME is empty") + } + return filepath.Join(homeDir, ".config", "gcloud"), nil +} + +func guessUnixHomeDir() string { + usr, err := user.Current() + if err == nil { + return usr.HomeDir + } + return os.Getenv("HOME") +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/google/sdk_test.go b/Godeps/_workspace/src/golang.org/x/oauth2/google/sdk_test.go new file mode 100644 index 000000000..79df88964 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/google/sdk_test.go @@ -0,0 +1,46 @@ +// Copyright 2015 The oauth2 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 google + +import "testing" + +func TestSDKConfig(t *testing.T) { + sdkConfigPath = func() (string, error) { + return "testdata/gcloud", nil + } + + tests := []struct { + account string + accessToken string + err bool + }{ + {"", "bar_access_token", false}, + {"foo@example.com", "foo_access_token", false}, + {"bar@example.com", "bar_access_token", false}, + {"baz@serviceaccount.example.com", "", true}, + } + for _, tt := range tests { + c, err := NewSDKConfig(tt.account) + if got, want := err != nil, tt.err; got != want { + if !tt.err { + t.Errorf("expected no error, got error: %v", tt.err, err) + } else { + t.Errorf("expected error, got none") + } + continue + } + if err != nil { + continue + } + tok := c.initialToken + if tok == nil { + t.Errorf("expected token %q, got: nil", tt.accessToken) + continue + } + if tok.AccessToken != tt.accessToken { + t.Errorf("expected token %q, got: %q", tt.accessToken, tok.AccessToken) + } + } +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/google/testdata/gcloud/credentials b/Godeps/_workspace/src/golang.org/x/oauth2/google/testdata/gcloud/credentials new file mode 100644 index 000000000..ff5eefbd0 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/google/testdata/gcloud/credentials @@ -0,0 +1,122 @@ +{ + "data": [ + { + "credential": { + "_class": "OAuth2Credentials", + "_module": "oauth2client.client", + "access_token": "foo_access_token", + "client_id": "foo_client_id", + "client_secret": "foo_client_secret", + "id_token": { + "at_hash": "foo_at_hash", + "aud": "foo_aud", + "azp": "foo_azp", + "cid": "foo_cid", + "email": "foo@example.com", + "email_verified": true, + "exp": 1420573614, + "iat": 1420569714, + "id": "1337", + "iss": "accounts.google.com", + "sub": "1337", + "token_hash": "foo_token_hash", + "verified_email": true + }, + "invalid": false, + "refresh_token": "foo_refresh_token", + "revoke_uri": "https://accounts.google.com/o/oauth2/revoke", + "token_expiry": "2015-01-09T00:51:51Z", + "token_response": { + "access_token": "foo_access_token", + "expires_in": 3600, + "id_token": "foo_id_token", + "token_type": "Bearer" + }, + "token_uri": "https://accounts.google.com/o/oauth2/token", + "user_agent": "Cloud SDK Command Line Tool" + }, + "key": { + "account": "foo@example.com", + "clientId": "foo_client_id", + "scope": "https://www.googleapis.com/auth/appengine.admin https://www.googleapis.com/auth/bigquery https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/ndev.cloudman https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/sqlservice.admin https://www.googleapis.com/auth/prediction https://www.googleapis.com/auth/projecthosting", + "type": "google-cloud-sdk" + } + }, + { + "credential": { + "_class": "OAuth2Credentials", + "_module": "oauth2client.client", + "access_token": "bar_access_token", + "client_id": "bar_client_id", + "client_secret": "bar_client_secret", + "id_token": { + "at_hash": "bar_at_hash", + "aud": "bar_aud", + "azp": "bar_azp", + "cid": "bar_cid", + "email": "bar@example.com", + "email_verified": true, + "exp": 1420573614, + "iat": 1420569714, + "id": "1337", + "iss": "accounts.google.com", + "sub": "1337", + "token_hash": "bar_token_hash", + "verified_email": true + }, + "invalid": false, + "refresh_token": "bar_refresh_token", + "revoke_uri": "https://accounts.google.com/o/oauth2/revoke", + "token_expiry": "2015-01-09T00:51:51Z", + "token_response": { + "access_token": "bar_access_token", + "expires_in": 3600, + "id_token": "bar_id_token", + "token_type": "Bearer" + }, + "token_uri": "https://accounts.google.com/o/oauth2/token", + "user_agent": "Cloud SDK Command Line Tool" + }, + "key": { + "account": "bar@example.com", + "clientId": "bar_client_id", + "scope": "https://www.googleapis.com/auth/appengine.admin https://www.googleapis.com/auth/bigquery https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/ndev.cloudman https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/sqlservice.admin https://www.googleapis.com/auth/prediction https://www.googleapis.com/auth/projecthosting", + "type": "google-cloud-sdk" + } + }, + { + "credential": { + "_class": "ServiceAccountCredentials", + "_kwargs": {}, + "_module": "oauth2client.client", + "_private_key_id": "00000000000000000000000000000000", + "_private_key_pkcs8_text": "-----BEGIN RSA PRIVATE KEY-----\nMIICWwIBAAKBgQCt3fpiynPSaUhWSIKMGV331zudwJ6GkGmvQtwsoK2S2LbvnSwU\nNxgj4fp08kIDR5p26wF4+t/HrKydMwzftXBfZ9UmLVJgRdSswmS5SmChCrfDS5OE\nvFFcN5+6w1w8/Nu657PF/dse8T0bV95YrqyoR0Osy8WHrUOMSIIbC3hRuwIDAQAB\nAoGAJrGE/KFjn0sQ7yrZ6sXmdLawrM3mObo/2uI9T60+k7SpGbBX0/Pi6nFrJMWZ\nTVONG7P3Mu5aCPzzuVRYJB0j8aldSfzABTY3HKoWCczqw1OztJiEseXGiYz4QOyr\nYU3qDyEpdhS6q6wcoLKGH+hqRmz6pcSEsc8XzOOu7s4xW8kCQQDkc75HjhbarCnd\nJJGMe3U76+6UGmdK67ltZj6k6xoB5WbTNChY9TAyI2JC+ppYV89zv3ssj4L+02u3\nHIHFGxsHAkEAwtU1qYb1tScpchPobnYUFiVKJ7KA8EZaHVaJJODW/cghTCV7BxcJ\nbgVvlmk4lFKn3lPKAgWw7PdQsBTVBUcCrQJATPwoIirizrv3u5soJUQxZIkENAqV\nxmybZx9uetrzP7JTrVbFRf0SScMcyN90hdLJiQL8+i4+gaszgFht7sNMnwJAAbfj\nq0UXcauQwALQ7/h2oONfTg5S+MuGC/AxcXPSMZbMRGGoPh3D5YaCv27aIuS/ukQ+\n6dmm/9AGlCb64fsIWQJAPaokbjIifo+LwC5gyK73Mc4t8nAOSZDenzd/2f6TCq76\nS1dcnKiPxaED7W/y6LJiuBT2rbZiQ2L93NJpFZD/UA==\n-----END RSA PRIVATE KEY-----\n", + "_revoke_uri": "https://accounts.google.com/o/oauth2/revoke", + "_scopes": "https://www.googleapis.com/auth/appengine.admin https://www.googleapis.com/auth/bigquery https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/ndev.cloudman https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/sqlservice.admin https://www.googleapis.com/auth/prediction https://www.googleapis.com/auth/projecthosting", + "_service_account_email": "baz@serviceaccount.example.com", + "_service_account_id": "baz.serviceaccount.example.com", + "_token_uri": "https://accounts.google.com/o/oauth2/token", + "_user_agent": "Cloud SDK Command Line Tool", + "access_token": null, + "assertion_type": null, + "client_id": null, + "client_secret": null, + "id_token": null, + "invalid": false, + "refresh_token": null, + "revoke_uri": "https://accounts.google.com/o/oauth2/revoke", + "service_account_name": "baz@serviceaccount.example.com", + "token_expiry": null, + "token_response": null, + "user_agent": "Cloud SDK Command Line Tool" + }, + "key": { + "account": "baz@serviceaccount.example.com", + "clientId": "baz_client_id", + "scope": "https://www.googleapis.com/auth/appengine.admin https://www.googleapis.com/auth/bigquery https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/ndev.cloudman https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/sqlservice.admin https://www.googleapis.com/auth/prediction https://www.googleapis.com/auth/projecthosting", + "type": "google-cloud-sdk" + } + } + ], + "file_version": 1 +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/google/testdata/gcloud/properties b/Godeps/_workspace/src/golang.org/x/oauth2/google/testdata/gcloud/properties new file mode 100644 index 000000000..025de886c --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/google/testdata/gcloud/properties @@ -0,0 +1,2 @@ +[core] +account = bar@example.com \ No newline at end of file diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/internal/oauth2.go b/Godeps/_workspace/src/golang.org/x/oauth2/internal/oauth2.go new file mode 100644 index 000000000..dc8ebfc4f --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/internal/oauth2.go @@ -0,0 +1,76 @@ +// Copyright 2014 The oauth2 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 internal contains support packages for oauth2 package. +package internal + +import ( + "bufio" + "crypto/rsa" + "crypto/x509" + "encoding/pem" + "errors" + "fmt" + "io" + "strings" +) + +// ParseKey converts the binary contents of a private key file +// to an *rsa.PrivateKey. It detects whether the private key is in a +// PEM container or not. If so, it extracts the the private key +// from PEM container before conversion. It only supports PEM +// containers with no passphrase. +func ParseKey(key []byte) (*rsa.PrivateKey, error) { + block, _ := pem.Decode(key) + if block != nil { + key = block.Bytes + } + parsedKey, err := x509.ParsePKCS8PrivateKey(key) + if err != nil { + parsedKey, err = x509.ParsePKCS1PrivateKey(key) + if err != nil { + return nil, fmt.Errorf("private key should be a PEM or plain PKSC1 or PKCS8; parse error: %v", err) + } + } + parsed, ok := parsedKey.(*rsa.PrivateKey) + if !ok { + return nil, errors.New("private key is invalid") + } + return parsed, nil +} + +func ParseINI(ini io.Reader) (map[string]map[string]string, error) { + result := map[string]map[string]string{ + "": map[string]string{}, // root section + } + scanner := bufio.NewScanner(ini) + currentSection := "" + for scanner.Scan() { + line := strings.TrimSpace(scanner.Text()) + if strings.HasPrefix(line, ";") { + // comment. + continue + } + if strings.HasPrefix(line, "[") && strings.HasSuffix(line, "]") { + currentSection = strings.TrimSpace(line[1 : len(line)-1]) + result[currentSection] = map[string]string{} + continue + } + parts := strings.SplitN(line, "=", 2) + if len(parts) == 2 && parts[0] != "" { + result[currentSection][strings.TrimSpace(parts[0])] = strings.TrimSpace(parts[1]) + } + } + if err := scanner.Err(); err != nil { + return nil, fmt.Errorf("error scanning ini: %v", err) + } + return result, nil +} + +func CondVal(v string) []string { + if v == "" { + return nil + } + return []string{v} +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/internal/oauth2_test.go b/Godeps/_workspace/src/golang.org/x/oauth2/internal/oauth2_test.go new file mode 100644 index 000000000..014a351e0 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/internal/oauth2_test.go @@ -0,0 +1,62 @@ +// Copyright 2014 The oauth2 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 internal contains support packages for oauth2 package. +package internal + +import ( + "reflect" + "strings" + "testing" +) + +func TestParseINI(t *testing.T) { + tests := []struct { + ini string + want map[string]map[string]string + }{ + { + `root = toor +[foo] +bar = hop +ini = nin +`, + map[string]map[string]string{ + "": map[string]string{"root": "toor"}, + "foo": map[string]string{"bar": "hop", "ini": "nin"}, + }, + }, + { + `[empty] +[section] +empty= +`, + map[string]map[string]string{ + "": map[string]string{}, + "empty": map[string]string{}, + "section": map[string]string{"empty": ""}, + }, + }, + { + `ignore +[invalid +=stuff +;comment=true +`, + map[string]map[string]string{ + "": map[string]string{}, + }, + }, + } + for _, tt := range tests { + result, err := ParseINI(strings.NewReader(tt.ini)) + if err != nil { + t.Errorf("ParseINI(%q) error %v, want: no error", tt.ini, err) + continue + } + if !reflect.DeepEqual(result, tt.want) { + t.Errorf("ParseINI(%q) = %#v, want: %#v", tt.ini, result, tt.want) + } + } +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/internal/token.go b/Godeps/_workspace/src/golang.org/x/oauth2/internal/token.go new file mode 100644 index 000000000..a17d79dd9 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/internal/token.go @@ -0,0 +1,214 @@ +// Copyright 2014 The oauth2 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 internal contains support packages for oauth2 package. +package internal + +import ( + "encoding/json" + "fmt" + "io" + "io/ioutil" + "mime" + "net/http" + "net/url" + "strconv" + "strings" + "time" + + "golang.org/x/net/context" +) + +// Token represents the crendentials used to authorize +// the requests to access protected resources on the OAuth 2.0 +// provider's backend. +// +// This type is a mirror of oauth2.Token and exists to break +// an otherwise-circular dependency. Other internal packages +// should convert this Token into an oauth2.Token before use. +type Token struct { + // AccessToken is the token that authorizes and authenticates + // the requests. + AccessToken string + + // TokenType is the type of token. + // The Type method returns either this or "Bearer", the default. + TokenType string + + // RefreshToken is a token that's used by the application + // (as opposed to the user) to refresh the access token + // if it expires. + RefreshToken string + + // Expiry is the optional expiration time of the access token. + // + // If zero, TokenSource implementations will reuse the same + // token forever and RefreshToken or equivalent + // mechanisms for that TokenSource will not be used. + Expiry time.Time + + // Raw optionally contains extra metadata from the server + // when updating a token. + Raw interface{} +} + +// tokenJSON is the struct representing the HTTP response from OAuth2 +// providers returning a token in JSON form. +type tokenJSON struct { + AccessToken string `json:"access_token"` + TokenType string `json:"token_type"` + RefreshToken string `json:"refresh_token"` + ExpiresIn expirationTime `json:"expires_in"` // at least PayPal returns string, while most return number + Expires expirationTime `json:"expires"` // broken Facebook spelling of expires_in +} + +func (e *tokenJSON) expiry() (t time.Time) { + if v := e.ExpiresIn; v != 0 { + return time.Now().Add(time.Duration(v) * time.Second) + } + if v := e.Expires; v != 0 { + return time.Now().Add(time.Duration(v) * time.Second) + } + return +} + +type expirationTime int32 + +func (e *expirationTime) UnmarshalJSON(b []byte) error { + var n json.Number + err := json.Unmarshal(b, &n) + if err != nil { + return err + } + i, err := n.Int64() + if err != nil { + return err + } + *e = expirationTime(i) + return nil +} + +var brokenAuthHeaderProviders = []string{ + "https://accounts.google.com/", + "https://www.googleapis.com/", + "https://github.com/", + "https://api.instagram.com/", + "https://www.douban.com/", + "https://api.dropbox.com/", + "https://api.soundcloud.com/", + "https://www.linkedin.com/", + "https://api.twitch.tv/", + "https://oauth.vk.com/", + "https://api.odnoklassniki.ru/", + "https://connect.stripe.com/", + "https://api.pushbullet.com/", + "https://oauth.sandbox.trainingpeaks.com/", + "https://oauth.trainingpeaks.com/", + "https://www.strava.com/oauth/", + "https://app.box.com/", + "https://test-sandbox.auth.corp.google.com", + "https://user.gini.net/", + "https://api.netatmo.net/", +} + +// providerAuthHeaderWorks reports whether the OAuth2 server identified by the tokenURL +// implements the OAuth2 spec correctly +// See https://code.google.com/p/goauth2/issues/detail?id=31 for background. +// In summary: +// - Reddit only accepts client secret in the Authorization header +// - Dropbox accepts either it in URL param or Auth header, but not both. +// - Google only accepts URL param (not spec compliant?), not Auth header +// - Stripe only accepts client secret in Auth header with Bearer method, not Basic +func providerAuthHeaderWorks(tokenURL string) bool { + for _, s := range brokenAuthHeaderProviders { + if strings.HasPrefix(tokenURL, s) { + // Some sites fail to implement the OAuth2 spec fully. + return false + } + } + + // Assume the provider implements the spec properly + // otherwise. We can add more exceptions as they're + // discovered. We will _not_ be adding configurable hooks + // to this package to let users select server bugs. + return true +} + +func RetrieveToken(ctx context.Context, ClientID, ClientSecret, TokenURL string, v url.Values) (*Token, error) { + hc, err := ContextClient(ctx) + if err != nil { + return nil, err + } + v.Set("client_id", ClientID) + bustedAuth := !providerAuthHeaderWorks(TokenURL) + if bustedAuth && ClientSecret != "" { + v.Set("client_secret", ClientSecret) + } + req, err := http.NewRequest("POST", TokenURL, strings.NewReader(v.Encode())) + if err != nil { + return nil, err + } + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + if !bustedAuth { + req.SetBasicAuth(ClientID, ClientSecret) + } + r, err := hc.Do(req) + if err != nil { + return nil, err + } + defer r.Body.Close() + body, err := ioutil.ReadAll(io.LimitReader(r.Body, 1<<20)) + if err != nil { + return nil, fmt.Errorf("oauth2: cannot fetch token: %v", err) + } + if code := r.StatusCode; code < 200 || code > 299 { + return nil, fmt.Errorf("oauth2: cannot fetch token: %v\nResponse: %s", r.Status, body) + } + + var token *Token + content, _, _ := mime.ParseMediaType(r.Header.Get("Content-Type")) + switch content { + case "application/x-www-form-urlencoded", "text/plain": + vals, err := url.ParseQuery(string(body)) + if err != nil { + return nil, err + } + token = &Token{ + AccessToken: vals.Get("access_token"), + TokenType: vals.Get("token_type"), + RefreshToken: vals.Get("refresh_token"), + Raw: vals, + } + e := vals.Get("expires_in") + if e == "" { + // TODO(jbd): Facebook's OAuth2 implementation is broken and + // returns expires_in field in expires. Remove the fallback to expires, + // when Facebook fixes their implementation. + e = vals.Get("expires") + } + expires, _ := strconv.Atoi(e) + if expires != 0 { + token.Expiry = time.Now().Add(time.Duration(expires) * time.Second) + } + default: + var tj tokenJSON + if err = json.Unmarshal(body, &tj); err != nil { + return nil, err + } + token = &Token{ + AccessToken: tj.AccessToken, + TokenType: tj.TokenType, + RefreshToken: tj.RefreshToken, + Expiry: tj.expiry(), + Raw: make(map[string]interface{}), + } + json.Unmarshal(body, &token.Raw) // no error checks for optional fields + } + // Don't overwrite `RefreshToken` with an empty value + // if this was a token refreshing request. + if token.RefreshToken == "" { + token.RefreshToken = v.Get("refresh_token") + } + return token, nil +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/internal/token_test.go b/Godeps/_workspace/src/golang.org/x/oauth2/internal/token_test.go new file mode 100644 index 000000000..864f6fa07 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/internal/token_test.go @@ -0,0 +1,28 @@ +// Copyright 2014 The oauth2 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 internal contains support packages for oauth2 package. +package internal + +import ( + "fmt" + "testing" +) + +func Test_providerAuthHeaderWorks(t *testing.T) { + for _, p := range brokenAuthHeaderProviders { + if providerAuthHeaderWorks(p) { + t.Errorf("URL: %s not found in list", p) + } + p := fmt.Sprintf("%ssomesuffix", p) + if providerAuthHeaderWorks(p) { + t.Errorf("URL: %s not found in list", p) + } + } + p := "https://api.not-in-the-list-example.com/" + if !providerAuthHeaderWorks(p) { + t.Errorf("URL: %s found in list", p) + } + +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/internal/transport.go b/Godeps/_workspace/src/golang.org/x/oauth2/internal/transport.go new file mode 100644 index 000000000..521e7b49e --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/internal/transport.go @@ -0,0 +1,67 @@ +// Copyright 2014 The oauth2 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 internal contains support packages for oauth2 package. +package internal + +import ( + "net/http" + + "golang.org/x/net/context" +) + +// HTTPClient is the context key to use with golang.org/x/net/context's +// WithValue function to associate an *http.Client value with a context. +var HTTPClient ContextKey + +// ContextKey is just an empty struct. It exists so HTTPClient can be +// an immutable public variable with a unique type. It's immutable +// because nobody else can create a ContextKey, being unexported. +type ContextKey struct{} + +// ContextClientFunc is a func which tries to return an *http.Client +// given a Context value. If it returns an error, the search stops +// with that error. If it returns (nil, nil), the search continues +// down the list of registered funcs. +type ContextClientFunc func(context.Context) (*http.Client, error) + +var contextClientFuncs []ContextClientFunc + +func RegisterContextClientFunc(fn ContextClientFunc) { + contextClientFuncs = append(contextClientFuncs, fn) +} + +func ContextClient(ctx context.Context) (*http.Client, error) { + for _, fn := range contextClientFuncs { + c, err := fn(ctx) + if err != nil { + return nil, err + } + if c != nil { + return c, nil + } + } + if hc, ok := ctx.Value(HTTPClient).(*http.Client); ok { + return hc, nil + } + return http.DefaultClient, nil +} + +func ContextTransport(ctx context.Context) http.RoundTripper { + hc, err := ContextClient(ctx) + // This is a rare error case (somebody using nil on App Engine). + if err != nil { + return ErrorTransport{err} + } + return hc.Transport +} + +// ErrorTransport returns the specified error on RoundTrip. +// This RoundTripper should be used in rare error cases where +// error handling can be postponed to response handling time. +type ErrorTransport struct{ Err error } + +func (t ErrorTransport) RoundTrip(*http.Request) (*http.Response, error) { + return nil, t.Err +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/jws/jws.go b/Godeps/_workspace/src/golang.org/x/oauth2/jws/jws.go new file mode 100644 index 000000000..362323c4e --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/jws/jws.go @@ -0,0 +1,160 @@ +// Copyright 2014 The oauth2 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 jws provides encoding and decoding utilities for +// signed JWS messages. +package jws // import "golang.org/x/oauth2/jws" + +import ( + "bytes" + "crypto" + "crypto/rand" + "crypto/rsa" + "crypto/sha256" + "encoding/base64" + "encoding/json" + "errors" + "fmt" + "strings" + "time" +) + +// ClaimSet contains information about the JWT signature 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. +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). + Exp int64 `json:"exp"` // the expiration time of the assertion + Iat int64 `json:"iat"` // the time the assertion was issued. + Typ string `json:"typ,omitempty"` // token type (Optional). + + // Email for which the application is requesting delegated access (Optional). + Sub string `json:"sub,omitempty"` + + // The old name of Sub. Client keeps setting Prn to be + // complaint with legacy OAuth 2.0 providers. (Optional) + Prn string `json:"prn,omitempty"` + + // 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 +} + +func (c *ClaimSet) encode() (string, error) { + if c.exp.IsZero() || c.iat.IsZero() { + // Reverting time back for machines whose time is not perfectly in sync. + // If client machine's time is in the future according + // to Google servers, an access token will not be issued. + now := time.Now().Add(-10 * time.Second) + c.iat = now + c.exp = now.Add(time.Hour) + } + + c.Exp = c.exp.Unix() + c.Iat = c.iat.Unix() + + b, err := json.Marshal(c) + if err != nil { + return "", err + } + + if len(c.PrivateClaims) == 0 { + return base64Encode(b), nil + } + + // Marshal private claim set and then append it to b. + prv, err := json.Marshal(c.PrivateClaims) + if err != nil { + return "", fmt.Errorf("jws: invalid map of private claims %v", c.PrivateClaims) + } + + // Concatenate public and private claim JSON objects. + if !bytes.HasSuffix(b, []byte{'}'}) { + return "", fmt.Errorf("jws: invalid JSON %s", b) + } + if !bytes.HasPrefix(prv, []byte{'{'}) { + return "", fmt.Errorf("jws: 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), nil +} + +// Header represents the header for the signed JWS payloads. +type Header struct { + // The algorithm used for signature. + Algorithm string `json:"alg"` + + // Represents the token type. + Typ string `json:"typ"` +} + +func (h *Header) encode() (string, error) { + b, err := json.Marshal(h) + if err != nil { + return "", err + } + return base64Encode(b), nil +} + +// Decode decodes a claim set from a JWS payload. +func Decode(payload string) (*ClaimSet, error) { + // decode returned id token to get expiry + s := strings.Split(payload, ".") + if len(s) < 2 { + // TODO(jbd): Provide more context about the error. + return nil, errors.New("jws: invalid token received") + } + decoded, err := base64Decode(s[1]) + if err != nil { + return nil, err + } + c := &ClaimSet{} + err = json.NewDecoder(bytes.NewBuffer(decoded)).Decode(c) + return c, err +} + +// Encode encodes a signed JWS with provided header and claim set. +func Encode(header *Header, c *ClaimSet, signature *rsa.PrivateKey) (string, error) { + head, err := header.encode() + if err != nil { + return "", err + } + cs, err := c.encode() + if err != nil { + return "", err + } + ss := fmt.Sprintf("%s.%s", head, cs) + h := sha256.New() + h.Write([]byte(ss)) + b, err := rsa.SignPKCS1v15(rand.Reader, signature, crypto.SHA256, h.Sum(nil)) + if err != nil { + return "", err + } + sig := base64Encode(b) + return fmt.Sprintf("%s.%s", ss, sig), nil +} + +// 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) +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/jwt/example_test.go b/Godeps/_workspace/src/golang.org/x/oauth2/jwt/example_test.go new file mode 100644 index 000000000..6d618836e --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/jwt/example_test.go @@ -0,0 +1,31 @@ +// Copyright 2014 The oauth2 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 jwt_test + +import ( + "golang.org/x/oauth2" + "golang.org/x/oauth2/jwt" +) + +func ExampleJWTConfig() { + conf := &jwt.Config{ + Email: "xxx@developer.com", + // The contents of your RSA private key or your PEM file + // that contains a private key. + // If you have a p12 file instead, you + // can use `openssl` to export the private key into a pem file. + // + // $ openssl pkcs12 -in key.p12 -out key.pem -nodes + // + // It only supports PEM containers with no passphrase. + PrivateKey: []byte("-----BEGIN RSA PRIVATE KEY-----..."), + Subject: "user@example.com", + TokenURL: "https://provider.com/o/oauth2/token", + } + // Initiate an http.Client, the following GET request will be + // authorized and authenticated on the behalf of user@example.com. + client := conf.Client(oauth2.NoContext) + client.Get("...") +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/jwt/jwt.go b/Godeps/_workspace/src/golang.org/x/oauth2/jwt/jwt.go new file mode 100644 index 000000000..205d23ed4 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/jwt/jwt.go @@ -0,0 +1,147 @@ +// Copyright 2014 The oauth2 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 jwt implements the OAuth 2.0 JSON Web Token flow, commonly +// known as "two-legged OAuth 2.0". +// +// See: https://tools.ietf.org/html/draft-ietf-oauth-jwt-bearer-12 +package jwt + +import ( + "encoding/json" + "fmt" + "io" + "io/ioutil" + "net/http" + "net/url" + "strings" + "time" + + "golang.org/x/net/context" + "golang.org/x/oauth2" + "golang.org/x/oauth2/internal" + "golang.org/x/oauth2/jws" +) + +var ( + defaultGrantType = "urn:ietf:params:oauth:grant-type:jwt-bearer" + defaultHeader = &jws.Header{Algorithm: "RS256", Typ: "JWT"} +) + +// Config is the configuration for using JWT to fetch tokens, +// commonly known as "two-legged OAuth 2.0". +type Config struct { + // Email is the OAuth client identifier used when communicating with + // the configured OAuth provider. + Email string + + // PrivateKey contains the contents of an RSA private key or the + // contents of a PEM file that contains a private key. The provided + // private key is used to sign JWT payloads. + // PEM containers with a passphrase are not supported. + // Use the following command to convert a PKCS 12 file into a PEM. + // + // $ openssl pkcs12 -in key.p12 -out key.pem -nodes + // + PrivateKey []byte + + // Subject is the optional user to impersonate. + Subject string + + // Scopes optionally specifies a list of requested permission scopes. + Scopes []string + + // TokenURL is the endpoint required to complete the 2-legged JWT flow. + TokenURL string +} + +// TokenSource returns a JWT TokenSource using the configuration +// in c and the HTTP client from the provided context. +func (c *Config) TokenSource(ctx context.Context) oauth2.TokenSource { + return oauth2.ReuseTokenSource(nil, jwtSource{ctx, c}) +} + +// Client returns an HTTP client wrapping the context's +// HTTP transport and adding Authorization headers with tokens +// obtained from c. +// +// The returned client and its Transport should not be modified. +func (c *Config) Client(ctx context.Context) *http.Client { + return oauth2.NewClient(ctx, c.TokenSource(ctx)) +} + +// jwtSource is a source that always does a signed JWT request for a token. +// It should typically be wrapped with a reuseTokenSource. +type jwtSource struct { + ctx context.Context + conf *Config +} + +func (js jwtSource) Token() (*oauth2.Token, error) { + pk, err := internal.ParseKey(js.conf.PrivateKey) + if err != nil { + return nil, err + } + hc := oauth2.NewClient(js.ctx, nil) + claimSet := &jws.ClaimSet{ + Iss: js.conf.Email, + Scope: strings.Join(js.conf.Scopes, " "), + Aud: js.conf.TokenURL, + } + if subject := js.conf.Subject; subject != "" { + claimSet.Sub = subject + // prn is the old name of sub. Keep setting it + // to be compatible with legacy OAuth 2.0 providers. + claimSet.Prn = subject + } + payload, err := jws.Encode(defaultHeader, claimSet, pk) + if err != nil { + return nil, err + } + v := url.Values{} + v.Set("grant_type", defaultGrantType) + v.Set("assertion", payload) + resp, err := hc.PostForm(js.conf.TokenURL, v) + if err != nil { + return nil, fmt.Errorf("oauth2: cannot fetch token: %v", err) + } + defer resp.Body.Close() + body, err := ioutil.ReadAll(io.LimitReader(resp.Body, 1<<20)) + if err != nil { + return nil, fmt.Errorf("oauth2: cannot fetch token: %v", err) + } + if c := resp.StatusCode; c < 200 || c > 299 { + return nil, fmt.Errorf("oauth2: cannot fetch token: %v\nResponse: %s", resp.Status, body) + } + // tokenRes is the JSON response body. + var tokenRes struct { + AccessToken string `json:"access_token"` + TokenType string `json:"token_type"` + IDToken string `json:"id_token"` + ExpiresIn int64 `json:"expires_in"` // relative seconds from now + } + if err := json.Unmarshal(body, &tokenRes); err != nil { + return nil, fmt.Errorf("oauth2: cannot fetch token: %v", err) + } + token := &oauth2.Token{ + AccessToken: tokenRes.AccessToken, + TokenType: tokenRes.TokenType, + } + raw := make(map[string]interface{}) + json.Unmarshal(body, &raw) // no error checks for optional fields + token = token.WithExtra(raw) + + if secs := tokenRes.ExpiresIn; secs > 0 { + token.Expiry = time.Now().Add(time.Duration(secs) * time.Second) + } + if v := tokenRes.IDToken; v != "" { + // decode returned id token to get expiry + claimSet, err := jws.Decode(v) + if err != nil { + return nil, fmt.Errorf("oauth2: error decoding JWT token: %v", err) + } + token.Expiry = time.Unix(claimSet.Exp, 0) + } + return token, nil +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/jwt/jwt_test.go b/Godeps/_workspace/src/golang.org/x/oauth2/jwt/jwt_test.go new file mode 100644 index 000000000..da922c3d0 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/jwt/jwt_test.go @@ -0,0 +1,134 @@ +// Copyright 2014 The oauth2 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 jwt + +import ( + "net/http" + "net/http/httptest" + "testing" + + "golang.org/x/oauth2" +) + +var dummyPrivateKey = []byte(`-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAx4fm7dngEmOULNmAs1IGZ9Apfzh+BkaQ1dzkmbUgpcoghucE +DZRnAGd2aPyB6skGMXUytWQvNYav0WTR00wFtX1ohWTfv68HGXJ8QXCpyoSKSSFY +fuP9X36wBSkSX9J5DVgiuzD5VBdzUISSmapjKm+DcbRALjz6OUIPEWi1Tjl6p5RK +1w41qdbmt7E5/kGhKLDuT7+M83g4VWhgIvaAXtnhklDAggilPPa8ZJ1IFe31lNlr +k4DRk38nc6sEutdf3RL7QoH7FBusI7uXV03DC6dwN1kP4GE7bjJhcRb/7jYt7CQ9 +/E9Exz3c0yAp0yrTg0Fwh+qxfH9dKwN52S7SBwIDAQABAoIBAQCaCs26K07WY5Jt +3a2Cw3y2gPrIgTCqX6hJs7O5ByEhXZ8nBwsWANBUe4vrGaajQHdLj5OKfsIDrOvn +2NI1MqflqeAbu/kR32q3tq8/Rl+PPiwUsW3E6Pcf1orGMSNCXxeducF2iySySzh3 +nSIhCG5uwJDWI7a4+9KiieFgK1pt/Iv30q1SQS8IEntTfXYwANQrfKUVMmVF9aIK +6/WZE2yd5+q3wVVIJ6jsmTzoDCX6QQkkJICIYwCkglmVy5AeTckOVwcXL0jqw5Kf +5/soZJQwLEyBoQq7Kbpa26QHq+CJONetPP8Ssy8MJJXBT+u/bSseMb3Zsr5cr43e +DJOhwsThAoGBAPY6rPKl2NT/K7XfRCGm1sbWjUQyDShscwuWJ5+kD0yudnT/ZEJ1 +M3+KS/iOOAoHDdEDi9crRvMl0UfNa8MAcDKHflzxg2jg/QI+fTBjPP5GOX0lkZ9g +z6VePoVoQw2gpPFVNPPTxKfk27tEzbaffvOLGBEih0Kb7HTINkW8rIlzAoGBAM9y +1yr+jvfS1cGFtNU+Gotoihw2eMKtIqR03Yn3n0PK1nVCDKqwdUqCypz4+ml6cxRK +J8+Pfdh7D+ZJd4LEG6Y4QRDLuv5OA700tUoSHxMSNn3q9As4+T3MUyYxWKvTeu3U +f2NWP9ePU0lV8ttk7YlpVRaPQmc1qwooBA/z/8AdAoGAW9x0HWqmRICWTBnpjyxx +QGlW9rQ9mHEtUotIaRSJ6K/F3cxSGUEkX1a3FRnp6kPLcckC6NlqdNgNBd6rb2rA +cPl/uSkZP42Als+9YMoFPU/xrrDPbUhu72EDrj3Bllnyb168jKLa4VBOccUvggxr +Dm08I1hgYgdN5huzs7y6GeUCgYEAj+AZJSOJ6o1aXS6rfV3mMRve9bQ9yt8jcKXw +5HhOCEmMtaSKfnOF1Ziih34Sxsb7O2428DiX0mV/YHtBnPsAJidL0SdLWIapBzeg +KHArByIRkwE6IvJvwpGMdaex1PIGhx5i/3VZL9qiq/ElT05PhIb+UXgoWMabCp84 +OgxDK20CgYAeaFo8BdQ7FmVX2+EEejF+8xSge6WVLtkaon8bqcn6P0O8lLypoOhd +mJAYH8WU+UAy9pecUnDZj14LAGNVmYcse8HFX71MoshnvCTFEPVo4rZxIAGwMpeJ +5jgQ3slYLpqrGlcbLgUXBUgzEO684Wk/UV9DFPlHALVqCfXQ9dpJPg== +-----END RSA PRIVATE KEY-----`) + +func TestJWTFetch_JSONResponse(t *testing.T) { + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + w.Write([]byte(`{ + "access_token": "90d64460d14870c08c81352a05dedd3465940a7c", + "scope": "user", + "token_type": "bearer", + "expires_in": 3600 + }`)) + })) + defer ts.Close() + + conf := &Config{ + Email: "aaa@xxx.com", + PrivateKey: dummyPrivateKey, + TokenURL: ts.URL, + } + tok, err := conf.TokenSource(oauth2.NoContext).Token() + if err != nil { + t.Fatal(err) + } + if !tok.Valid() { + t.Errorf("Token invalid") + } + if tok.AccessToken != "90d64460d14870c08c81352a05dedd3465940a7c" { + t.Errorf("Unexpected access token, %#v", tok.AccessToken) + } + if tok.TokenType != "bearer" { + t.Errorf("Unexpected token type, %#v", tok.TokenType) + } + if tok.Expiry.IsZero() { + t.Errorf("Unexpected token expiry, %#v", tok.Expiry) + } + scope := tok.Extra("scope") + if scope != "user" { + t.Errorf("Unexpected value for scope: %v", scope) + } +} + +func TestJWTFetch_BadResponse(t *testing.T) { + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + w.Write([]byte(`{"scope": "user", "token_type": "bearer"}`)) + })) + defer ts.Close() + + conf := &Config{ + Email: "aaa@xxx.com", + PrivateKey: dummyPrivateKey, + TokenURL: ts.URL, + } + tok, err := conf.TokenSource(oauth2.NoContext).Token() + if err != nil { + t.Fatal(err) + } + if tok == nil { + t.Fatalf("token is nil") + } + if tok.Valid() { + t.Errorf("token is valid. want invalid.") + } + if tok.AccessToken != "" { + t.Errorf("Unexpected non-empty access token %q.", tok.AccessToken) + } + if want := "bearer"; tok.TokenType != want { + t.Errorf("TokenType = %q; want %q", tok.TokenType, want) + } + scope := tok.Extra("scope") + if want := "user"; scope != want { + t.Errorf("token scope = %q; want %q", scope, want) + } +} + +func TestJWTFetch_BadResponseType(t *testing.T) { + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + w.Write([]byte(`{"access_token":123, "scope": "user", "token_type": "bearer"}`)) + })) + defer ts.Close() + conf := &Config{ + Email: "aaa@xxx.com", + PrivateKey: dummyPrivateKey, + TokenURL: ts.URL, + } + tok, err := conf.TokenSource(oauth2.NoContext).Token() + if err == nil { + t.Error("got a token; expected error") + if tok.AccessToken != "" { + t.Errorf("Unexpected access token, %#v.", tok.AccessToken) + } + } +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/linkedin/linkedin.go b/Godeps/_workspace/src/golang.org/x/oauth2/linkedin/linkedin.go new file mode 100644 index 000000000..de91d5b94 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/linkedin/linkedin.go @@ -0,0 +1,16 @@ +// Copyright 2015 The oauth2 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 linkedin provides constants for using OAuth2 to access LinkedIn. +package linkedin // import "golang.org/x/oauth2/linkedin" + +import ( + "golang.org/x/oauth2" +) + +// Endpoint is LinkedIn's OAuth 2.0 endpoint. +var Endpoint = oauth2.Endpoint{ + AuthURL: "https://www.linkedin.com/uas/oauth2/authorization", + TokenURL: "https://www.linkedin.com/uas/oauth2/accessToken", +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/oauth2.go b/Godeps/_workspace/src/golang.org/x/oauth2/oauth2.go new file mode 100644 index 000000000..cca8b1803 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/oauth2.go @@ -0,0 +1,325 @@ +// Copyright 2014 The oauth2 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 oauth2 provides support for making +// OAuth2 authorized and authenticated HTTP requests. +// It can additionally grant authorization with Bearer JWT. +package oauth2 // import "golang.org/x/oauth2" + +import ( + "bytes" + "errors" + "net/http" + "net/url" + "strings" + "sync" + + "golang.org/x/net/context" + "golang.org/x/oauth2/internal" +) + +// NoContext is the default context you should supply if not using +// your own context.Context (see https://golang.org/x/net/context). +var NoContext = context.TODO() + +// Config describes a typical 3-legged OAuth2 flow, with both the +// client application information and the server's endpoint URLs. +type Config struct { + // ClientID is the application's ID. + ClientID string + + // ClientSecret is the application's secret. + ClientSecret string + + // Endpoint contains the resource server's token endpoint + // URLs. These are constants specific to each server and are + // often available via site-specific packages, such as + // google.Endpoint or github.Endpoint. + Endpoint Endpoint + + // RedirectURL is the URL to redirect users going through + // the OAuth flow, after the resource owner's URLs. + RedirectURL string + + // Scope specifies optional requested permissions. + Scopes []string +} + +// A TokenSource is anything that can return a token. +type TokenSource interface { + // Token returns a token or an error. + // Token must be safe for concurrent use by multiple goroutines. + // The returned Token must not be modified. + Token() (*Token, error) +} + +// Endpoint contains the OAuth 2.0 provider's authorization and token +// endpoint URLs. +type Endpoint struct { + AuthURL string + TokenURL string +} + +var ( + // AccessTypeOnline and AccessTypeOffline are options passed + // to the Options.AuthCodeURL method. They modify the + // "access_type" field that gets sent in the URL returned by + // AuthCodeURL. + // + // Online is the default if neither is specified. If your + // application needs to refresh access tokens when the user + // is not present at the browser, then use offline. This will + // result in your application obtaining a refresh token the + // first time your application exchanges an authorization + // code for a user. + AccessTypeOnline AuthCodeOption = SetAuthURLParam("access_type", "online") + AccessTypeOffline AuthCodeOption = SetAuthURLParam("access_type", "offline") + + // ApprovalForce forces the users to view the consent dialog + // and confirm the permissions request at the URL returned + // from AuthCodeURL, even if they've already done so. + ApprovalForce AuthCodeOption = SetAuthURLParam("approval_prompt", "force") +) + +// An AuthCodeOption is passed to Config.AuthCodeURL. +type AuthCodeOption interface { + setValue(url.Values) +} + +type setParam struct{ k, v string } + +func (p setParam) setValue(m url.Values) { m.Set(p.k, p.v) } + +// SetAuthURLParam builds an AuthCodeOption which passes key/value parameters +// to a provider's authorization endpoint. +func SetAuthURLParam(key, value string) AuthCodeOption { + return setParam{key, value} +} + +// AuthCodeURL returns a URL to OAuth 2.0 provider's consent page +// that asks for permissions for the required scopes explicitly. +// +// State is a token to protect the user from CSRF attacks. You must +// always provide a non-zero string and validate that it matches the +// the state query parameter on your redirect callback. +// See http://tools.ietf.org/html/rfc6749#section-10.12 for more info. +// +// Opts may include AccessTypeOnline or AccessTypeOffline, as well +// as ApprovalForce. +func (c *Config) AuthCodeURL(state string, opts ...AuthCodeOption) string { + var buf bytes.Buffer + buf.WriteString(c.Endpoint.AuthURL) + v := url.Values{ + "response_type": {"code"}, + "client_id": {c.ClientID}, + "redirect_uri": internal.CondVal(c.RedirectURL), + "scope": internal.CondVal(strings.Join(c.Scopes, " ")), + "state": internal.CondVal(state), + } + for _, opt := range opts { + opt.setValue(v) + } + if strings.Contains(c.Endpoint.AuthURL, "?") { + buf.WriteByte('&') + } else { + buf.WriteByte('?') + } + buf.WriteString(v.Encode()) + return buf.String() +} + +// PasswordCredentialsToken converts a resource owner username and password +// pair into a token. +// +// Per the RFC, this grant type should only be used "when there is a high +// degree of trust between the resource owner and the client (e.g., the client +// is part of the device operating system or a highly privileged application), +// and when other authorization grant types are not available." +// See https://tools.ietf.org/html/rfc6749#section-4.3 for more info. +// +// The HTTP client to use is derived from the context. +// If nil, http.DefaultClient is used. +func (c *Config) PasswordCredentialsToken(ctx context.Context, username, password string) (*Token, error) { + return retrieveToken(ctx, c, url.Values{ + "grant_type": {"password"}, + "username": {username}, + "password": {password}, + "scope": internal.CondVal(strings.Join(c.Scopes, " ")), + }) +} + +// Exchange converts an authorization code into a token. +// +// It is used after a resource provider redirects the user back +// to the Redirect URI (the URL obtained from AuthCodeURL). +// +// The HTTP client to use is derived from the context. +// If a client is not provided via the context, http.DefaultClient is used. +// +// The code will be in the *http.Request.FormValue("code"). Before +// calling Exchange, be sure to validate FormValue("state"). +func (c *Config) Exchange(ctx context.Context, code string) (*Token, error) { + return retrieveToken(ctx, c, url.Values{ + "grant_type": {"authorization_code"}, + "code": {code}, + "redirect_uri": internal.CondVal(c.RedirectURL), + "scope": internal.CondVal(strings.Join(c.Scopes, " ")), + }) +} + +// Client returns an HTTP client using the provided token. +// The token will auto-refresh as necessary. The underlying +// HTTP transport will be obtained using the provided context. +// The returned client and its Transport should not be modified. +func (c *Config) Client(ctx context.Context, t *Token) *http.Client { + return NewClient(ctx, c.TokenSource(ctx, t)) +} + +// TokenSource returns a TokenSource that returns t until t expires, +// automatically refreshing it as necessary using the provided context. +// +// Most users will use Config.Client instead. +func (c *Config) TokenSource(ctx context.Context, t *Token) TokenSource { + tkr := &tokenRefresher{ + ctx: ctx, + conf: c, + } + if t != nil { + tkr.refreshToken = t.RefreshToken + } + return &reuseTokenSource{ + t: t, + new: tkr, + } +} + +// tokenRefresher is a TokenSource that makes "grant_type"=="refresh_token" +// HTTP requests to renew a token using a RefreshToken. +type tokenRefresher struct { + ctx context.Context // used to get HTTP requests + conf *Config + refreshToken string +} + +// WARNING: Token is not safe for concurrent access, as it +// updates the tokenRefresher's refreshToken field. +// Within this package, it is used by reuseTokenSource which +// synchronizes calls to this method with its own mutex. +func (tf *tokenRefresher) Token() (*Token, error) { + if tf.refreshToken == "" { + return nil, errors.New("oauth2: token expired and refresh token is not set") + } + + tk, err := retrieveToken(tf.ctx, tf.conf, url.Values{ + "grant_type": {"refresh_token"}, + "refresh_token": {tf.refreshToken}, + }) + + if err != nil { + return nil, err + } + if tf.refreshToken != tk.RefreshToken { + tf.refreshToken = tk.RefreshToken + } + return tk, err +} + +// reuseTokenSource is a TokenSource that holds a single token in memory +// and validates its expiry before each call to retrieve it with +// Token. If it's expired, it will be auto-refreshed using the +// new TokenSource. +type reuseTokenSource struct { + new TokenSource // called when t is expired. + + mu sync.Mutex // guards t + t *Token +} + +// Token returns the current token if it's still valid, else will +// refresh the current token (using r.Context for HTTP client +// information) and return the new one. +func (s *reuseTokenSource) Token() (*Token, error) { + s.mu.Lock() + defer s.mu.Unlock() + if s.t.Valid() { + return s.t, nil + } + t, err := s.new.Token() + if err != nil { + return nil, err + } + s.t = t + return t, nil +} + +// StaticTokenSource returns a TokenSource that always returns the same token. +// Because the provided token t is never refreshed, StaticTokenSource is only +// useful for tokens that never expire. +func StaticTokenSource(t *Token) TokenSource { + return staticTokenSource{t} +} + +// staticTokenSource is a TokenSource that always returns the same Token. +type staticTokenSource struct { + t *Token +} + +func (s staticTokenSource) Token() (*Token, error) { + return s.t, nil +} + +// HTTPClient is the context key to use with golang.org/x/net/context's +// WithValue function to associate an *http.Client value with a context. +var HTTPClient internal.ContextKey + +// NewClient creates an *http.Client from a Context and TokenSource. +// The returned client is not valid beyond the lifetime of the context. +// +// As a special case, if src is nil, a non-OAuth2 client is returned +// using the provided context. This exists to support related OAuth2 +// packages. +func NewClient(ctx context.Context, src TokenSource) *http.Client { + if src == nil { + c, err := internal.ContextClient(ctx) + if err != nil { + return &http.Client{Transport: internal.ErrorTransport{err}} + } + return c + } + return &http.Client{ + Transport: &Transport{ + Base: internal.ContextTransport(ctx), + Source: ReuseTokenSource(nil, src), + }, + } +} + +// ReuseTokenSource returns a TokenSource which repeatedly returns the +// same token as long as it's valid, starting with t. +// When its cached token is invalid, a new token is obtained from src. +// +// ReuseTokenSource is typically used to reuse tokens from a cache +// (such as a file on disk) between runs of a program, rather than +// obtaining new tokens unnecessarily. +// +// The initial token t may be nil, in which case the TokenSource is +// wrapped in a caching version if it isn't one already. This also +// means it's always safe to wrap ReuseTokenSource around any other +// TokenSource without adverse effects. +func ReuseTokenSource(t *Token, src TokenSource) TokenSource { + // Don't wrap a reuseTokenSource in itself. That would work, + // but cause an unnecessary number of mutex operations. + // Just build the equivalent one. + if rt, ok := src.(*reuseTokenSource); ok { + if t == nil { + // Just use it directly. + return rt + } + src = rt.new + } + return &reuseTokenSource{ + t: t, + new: src, + } +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/oauth2_test.go b/Godeps/_workspace/src/golang.org/x/oauth2/oauth2_test.go new file mode 100644 index 000000000..2f7d731c1 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/oauth2_test.go @@ -0,0 +1,422 @@ +// Copyright 2014 The oauth2 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 oauth2 + +import ( + "encoding/json" + "errors" + "fmt" + "io/ioutil" + "net/http" + "net/http/httptest" + "reflect" + "strconv" + "testing" + "time" + + "golang.org/x/net/context" +) + +type mockTransport struct { + rt func(req *http.Request) (resp *http.Response, err error) +} + +func (t *mockTransport) RoundTrip(req *http.Request) (resp *http.Response, err error) { + return t.rt(req) +} + +type mockCache struct { + token *Token + readErr error +} + +func (c *mockCache) ReadToken() (*Token, error) { + return c.token, c.readErr +} + +func (c *mockCache) WriteToken(*Token) { + // do nothing +} + +func newConf(url string) *Config { + return &Config{ + ClientID: "CLIENT_ID", + ClientSecret: "CLIENT_SECRET", + RedirectURL: "REDIRECT_URL", + Scopes: []string{"scope1", "scope2"}, + Endpoint: Endpoint{ + AuthURL: url + "/auth", + TokenURL: url + "/token", + }, + } +} + +func TestAuthCodeURL(t *testing.T) { + conf := newConf("server") + url := conf.AuthCodeURL("foo", AccessTypeOffline, ApprovalForce) + if url != "server/auth?access_type=offline&approval_prompt=force&client_id=CLIENT_ID&redirect_uri=REDIRECT_URL&response_type=code&scope=scope1+scope2&state=foo" { + t.Errorf("Auth code URL doesn't match the expected, found: %v", url) + } +} + +func TestAuthCodeURL_CustomParam(t *testing.T) { + conf := newConf("server") + param := SetAuthURLParam("foo", "bar") + url := conf.AuthCodeURL("baz", param) + if url != "server/auth?client_id=CLIENT_ID&foo=bar&redirect_uri=REDIRECT_URL&response_type=code&scope=scope1+scope2&state=baz" { + t.Errorf("Auth code URL doesn't match the expected, found: %v", url) + } +} + +func TestAuthCodeURL_Optional(t *testing.T) { + conf := &Config{ + ClientID: "CLIENT_ID", + Endpoint: Endpoint{ + AuthURL: "/auth-url", + TokenURL: "/token-url", + }, + } + url := conf.AuthCodeURL("") + if url != "/auth-url?client_id=CLIENT_ID&response_type=code" { + t.Fatalf("Auth code URL doesn't match the expected, found: %v", url) + } +} + +func TestExchangeRequest(t *testing.T) { + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.URL.String() != "/token" { + t.Errorf("Unexpected exchange request URL, %v is found.", r.URL) + } + headerAuth := r.Header.Get("Authorization") + if headerAuth != "Basic Q0xJRU5UX0lEOkNMSUVOVF9TRUNSRVQ=" { + t.Errorf("Unexpected authorization header, %v is found.", headerAuth) + } + headerContentType := r.Header.Get("Content-Type") + if headerContentType != "application/x-www-form-urlencoded" { + t.Errorf("Unexpected Content-Type header, %v is found.", headerContentType) + } + body, err := ioutil.ReadAll(r.Body) + if err != nil { + t.Errorf("Failed reading request body: %s.", err) + } + if string(body) != "client_id=CLIENT_ID&code=exchange-code&grant_type=authorization_code&redirect_uri=REDIRECT_URL&scope=scope1+scope2" { + t.Errorf("Unexpected exchange payload, %v is found.", string(body)) + } + w.Header().Set("Content-Type", "application/x-www-form-urlencoded") + w.Write([]byte("access_token=90d64460d14870c08c81352a05dedd3465940a7c&scope=user&token_type=bearer")) + })) + defer ts.Close() + conf := newConf(ts.URL) + tok, err := conf.Exchange(NoContext, "exchange-code") + if err != nil { + t.Error(err) + } + if !tok.Valid() { + t.Fatalf("Token invalid. Got: %#v", tok) + } + if tok.AccessToken != "90d64460d14870c08c81352a05dedd3465940a7c" { + t.Errorf("Unexpected access token, %#v.", tok.AccessToken) + } + if tok.TokenType != "bearer" { + t.Errorf("Unexpected token type, %#v.", tok.TokenType) + } + scope := tok.Extra("scope") + if scope != "user" { + t.Errorf("Unexpected value for scope: %v", scope) + } +} + +func TestExchangeRequest_JSONResponse(t *testing.T) { + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.URL.String() != "/token" { + t.Errorf("Unexpected exchange request URL, %v is found.", r.URL) + } + headerAuth := r.Header.Get("Authorization") + if headerAuth != "Basic Q0xJRU5UX0lEOkNMSUVOVF9TRUNSRVQ=" { + t.Errorf("Unexpected authorization header, %v is found.", headerAuth) + } + headerContentType := r.Header.Get("Content-Type") + if headerContentType != "application/x-www-form-urlencoded" { + t.Errorf("Unexpected Content-Type header, %v is found.", headerContentType) + } + body, err := ioutil.ReadAll(r.Body) + if err != nil { + t.Errorf("Failed reading request body: %s.", err) + } + if string(body) != "client_id=CLIENT_ID&code=exchange-code&grant_type=authorization_code&redirect_uri=REDIRECT_URL&scope=scope1+scope2" { + t.Errorf("Unexpected exchange payload, %v is found.", string(body)) + } + w.Header().Set("Content-Type", "application/json") + w.Write([]byte(`{"access_token": "90d64460d14870c08c81352a05dedd3465940a7c", "scope": "user", "token_type": "bearer", "expires_in": 86400}`)) + })) + defer ts.Close() + conf := newConf(ts.URL) + tok, err := conf.Exchange(NoContext, "exchange-code") + if err != nil { + t.Error(err) + } + if !tok.Valid() { + t.Fatalf("Token invalid. Got: %#v", tok) + } + if tok.AccessToken != "90d64460d14870c08c81352a05dedd3465940a7c" { + t.Errorf("Unexpected access token, %#v.", tok.AccessToken) + } + if tok.TokenType != "bearer" { + t.Errorf("Unexpected token type, %#v.", tok.TokenType) + } + scope := tok.Extra("scope") + if scope != "user" { + t.Errorf("Unexpected value for scope: %v", scope) + } +} + +const day = 24 * time.Hour + +func TestExchangeRequest_JSONResponse_Expiry(t *testing.T) { + seconds := int32(day.Seconds()) + jsonNumberType := reflect.TypeOf(json.Number("0")) + for _, c := range []struct { + expires string + expect error + }{ + {fmt.Sprintf(`"expires_in": %d`, seconds), nil}, + {fmt.Sprintf(`"expires_in": "%d"`, seconds), nil}, // PayPal case + {fmt.Sprintf(`"expires": %d`, seconds), nil}, // Facebook case + {`"expires": false`, &json.UnmarshalTypeError{Value: "bool", Type: jsonNumberType}}, // wrong type + {`"expires": {}`, &json.UnmarshalTypeError{Value: "object", Type: jsonNumberType}}, // wrong type + {`"expires": "zzz"`, &strconv.NumError{Func: "ParseInt", Num: "zzz", Err: strconv.ErrSyntax}}, // wrong value + } { + testExchangeRequest_JSONResponse_expiry(t, c.expires, c.expect) + } +} + +func testExchangeRequest_JSONResponse_expiry(t *testing.T, exp string, expect error) { + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + w.Write([]byte(fmt.Sprintf(`{"access_token": "90d", "scope": "user", "token_type": "bearer", %s}`, exp))) + })) + defer ts.Close() + conf := newConf(ts.URL) + t1 := time.Now().Add(day) + tok, err := conf.Exchange(NoContext, "exchange-code") + t2 := time.Now().Add(day) + // Do a fmt.Sprint comparison so either side can be + // nil. fmt.Sprint just stringifies them to "", and no + // non-nil expected error ever stringifies as "", so this + // isn't terribly disgusting. We do this because Go 1.4 and + // Go 1.5 return a different deep value for + // json.UnmarshalTypeError. In Go 1.5, the + // json.UnmarshalTypeError contains a new field with a new + // non-zero value. Rather than ignore it here with reflect or + // add new files and +build tags, just look at the strings. + if fmt.Sprint(err) != fmt.Sprint(expect) { + t.Errorf("Error = %v; want %v", err, expect) + } + if err != nil { + return + } + if !tok.Valid() { + t.Fatalf("Token invalid. Got: %#v", tok) + } + expiry := tok.Expiry + if expiry.Before(t1) || expiry.After(t2) { + t.Errorf("Unexpected value for Expiry: %v (shold be between %v and %v)", expiry, t1, t2) + } +} + +func TestExchangeRequest_BadResponse(t *testing.T) { + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + w.Write([]byte(`{"scope": "user", "token_type": "bearer"}`)) + })) + defer ts.Close() + conf := newConf(ts.URL) + tok, err := conf.Exchange(NoContext, "code") + if err != nil { + t.Fatal(err) + } + if tok.AccessToken != "" { + t.Errorf("Unexpected access token, %#v.", tok.AccessToken) + } +} + +func TestExchangeRequest_BadResponseType(t *testing.T) { + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + w.Write([]byte(`{"access_token":123, "scope": "user", "token_type": "bearer"}`)) + })) + defer ts.Close() + conf := newConf(ts.URL) + _, err := conf.Exchange(NoContext, "exchange-code") + if err == nil { + t.Error("expected error from invalid access_token type") + } +} + +func TestExchangeRequest_NonBasicAuth(t *testing.T) { + tr := &mockTransport{ + rt: func(r *http.Request) (w *http.Response, err error) { + headerAuth := r.Header.Get("Authorization") + if headerAuth != "" { + t.Errorf("Unexpected authorization header, %v is found.", headerAuth) + } + return nil, errors.New("no response") + }, + } + c := &http.Client{Transport: tr} + conf := &Config{ + ClientID: "CLIENT_ID", + Endpoint: Endpoint{ + AuthURL: "https://accounts.google.com/auth", + TokenURL: "https://accounts.google.com/token", + }, + } + + ctx := context.WithValue(context.Background(), HTTPClient, c) + conf.Exchange(ctx, "code") +} + +func TestPasswordCredentialsTokenRequest(t *testing.T) { + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + defer r.Body.Close() + expected := "/token" + if r.URL.String() != expected { + t.Errorf("URL = %q; want %q", r.URL, expected) + } + headerAuth := r.Header.Get("Authorization") + expected = "Basic Q0xJRU5UX0lEOkNMSUVOVF9TRUNSRVQ=" + if headerAuth != expected { + t.Errorf("Authorization header = %q; want %q", headerAuth, expected) + } + headerContentType := r.Header.Get("Content-Type") + expected = "application/x-www-form-urlencoded" + if headerContentType != expected { + t.Errorf("Content-Type header = %q; want %q", headerContentType, expected) + } + body, err := ioutil.ReadAll(r.Body) + if err != nil { + t.Errorf("Failed reading request body: %s.", err) + } + expected = "client_id=CLIENT_ID&grant_type=password&password=password1&scope=scope1+scope2&username=user1" + if string(body) != expected { + t.Errorf("res.Body = %q; want %q", string(body), expected) + } + w.Header().Set("Content-Type", "application/x-www-form-urlencoded") + w.Write([]byte("access_token=90d64460d14870c08c81352a05dedd3465940a7c&scope=user&token_type=bearer")) + })) + defer ts.Close() + conf := newConf(ts.URL) + tok, err := conf.PasswordCredentialsToken(NoContext, "user1", "password1") + if err != nil { + t.Error(err) + } + if !tok.Valid() { + t.Fatalf("Token invalid. Got: %#v", tok) + } + expected := "90d64460d14870c08c81352a05dedd3465940a7c" + if tok.AccessToken != expected { + t.Errorf("AccessToken = %q; want %q", tok.AccessToken, expected) + } + expected = "bearer" + if tok.TokenType != expected { + t.Errorf("TokenType = %q; want %q", tok.TokenType, expected) + } +} + +func TestTokenRefreshRequest(t *testing.T) { + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.URL.String() == "/somethingelse" { + return + } + if r.URL.String() != "/token" { + t.Errorf("Unexpected token refresh request URL, %v is found.", r.URL) + } + headerContentType := r.Header.Get("Content-Type") + if headerContentType != "application/x-www-form-urlencoded" { + t.Errorf("Unexpected Content-Type header, %v is found.", headerContentType) + } + body, _ := ioutil.ReadAll(r.Body) + if string(body) != "client_id=CLIENT_ID&grant_type=refresh_token&refresh_token=REFRESH_TOKEN" { + t.Errorf("Unexpected refresh token payload, %v is found.", string(body)) + } + })) + defer ts.Close() + conf := newConf(ts.URL) + c := conf.Client(NoContext, &Token{RefreshToken: "REFRESH_TOKEN"}) + c.Get(ts.URL + "/somethingelse") +} + +func TestFetchWithNoRefreshToken(t *testing.T) { + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.URL.String() == "/somethingelse" { + return + } + if r.URL.String() != "/token" { + t.Errorf("Unexpected token refresh request URL, %v is found.", r.URL) + } + headerContentType := r.Header.Get("Content-Type") + if headerContentType != "application/x-www-form-urlencoded" { + t.Errorf("Unexpected Content-Type header, %v is found.", headerContentType) + } + body, _ := ioutil.ReadAll(r.Body) + if string(body) != "client_id=CLIENT_ID&grant_type=refresh_token&refresh_token=REFRESH_TOKEN" { + t.Errorf("Unexpected refresh token payload, %v is found.", string(body)) + } + })) + defer ts.Close() + conf := newConf(ts.URL) + c := conf.Client(NoContext, nil) + _, err := c.Get(ts.URL + "/somethingelse") + if err == nil { + t.Errorf("Fetch should return an error if no refresh token is set") + } +} + +func TestRefreshToken_RefreshTokenReplacement(t *testing.T) { + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + w.Write([]byte(`{"access_token":"ACCESS TOKEN", "scope": "user", "token_type": "bearer", "refresh_token": "NEW REFRESH TOKEN"}`)) + return + })) + defer ts.Close() + conf := newConf(ts.URL) + tkr := tokenRefresher{ + conf: conf, + ctx: NoContext, + refreshToken: "OLD REFRESH TOKEN", + } + tk, err := tkr.Token() + if err != nil { + t.Errorf("Unexpected refreshToken error returned: %v", err) + return + } + if tk.RefreshToken != tkr.refreshToken { + t.Errorf("tokenRefresher.refresh_token = %s; want %s", tkr.refreshToken, tk.RefreshToken) + } +} + +func TestConfigClientWithToken(t *testing.T) { + tok := &Token{ + AccessToken: "abc123", + } + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if got, want := r.Header.Get("Authorization"), fmt.Sprintf("Bearer %s", tok.AccessToken); got != want { + t.Errorf("Authorization header = %q; want %q", got, want) + } + return + })) + defer ts.Close() + conf := newConf(ts.URL) + + c := conf.Client(NoContext, tok) + req, err := http.NewRequest("GET", ts.URL, nil) + if err != nil { + t.Error(err) + } + _, err = c.Do(req) + if err != nil { + t.Error(err) + } +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/odnoklassniki/odnoklassniki.go b/Godeps/_workspace/src/golang.org/x/oauth2/odnoklassniki/odnoklassniki.go new file mode 100644 index 000000000..2f7a9621e --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/odnoklassniki/odnoklassniki.go @@ -0,0 +1,16 @@ +// Copyright 2015 The oauth2 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 odnoklassniki provides constants for using OAuth2 to access Odnoklassniki. +package odnoklassniki // import "golang.org/x/oauth2/odnoklassniki" + +import ( + "golang.org/x/oauth2" +) + +// Endpoint is Odnoklassniki's OAuth 2.0 endpoint. +var Endpoint = oauth2.Endpoint{ + AuthURL: "https://www.odnoklassniki.ru/oauth/authorize", + TokenURL: "https://api.odnoklassniki.ru/oauth/token.do", +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/paypal/paypal.go b/Godeps/_workspace/src/golang.org/x/oauth2/paypal/paypal.go new file mode 100644 index 000000000..baeaa2372 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/paypal/paypal.go @@ -0,0 +1,22 @@ +// Copyright 2015 The oauth2 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 paypal provides constants for using OAuth2 to access PayPal. +package paypal // import "golang.org/x/oauth2/paypal" + +import ( + "golang.org/x/oauth2" +) + +// Endpoint is PayPal's OAuth 2.0 endpoint in live (production) environment. +var Endpoint = oauth2.Endpoint{ + AuthURL: "https://www.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize", + TokenURL: "https://api.paypal.com/v1/identity/openidconnect/tokenservice", +} + +// SandboxEndpoint is PayPal's OAuth 2.0 endpoint in sandbox (testing) environment. +var SandboxEndpoint = oauth2.Endpoint{ + AuthURL: "https://www.sandbox.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize", + TokenURL: "https://api.sandbox.paypal.com/v1/identity/openidconnect/tokenservice", +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/token.go b/Godeps/_workspace/src/golang.org/x/oauth2/token.go new file mode 100644 index 000000000..ebbdddbdc --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/token.go @@ -0,0 +1,143 @@ +// Copyright 2014 The oauth2 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 oauth2 + +import ( + "net/http" + "net/url" + "strings" + "time" + + "golang.org/x/net/context" + "golang.org/x/oauth2/internal" +) + +// expiryDelta determines how earlier a token should be considered +// expired than its actual expiration time. It is used to avoid late +// expirations due to client-server time mismatches. +const expiryDelta = 10 * time.Second + +// Token represents the crendentials used to authorize +// the requests to access protected resources on the OAuth 2.0 +// provider's backend. +// +// Most users of this package should not access fields of Token +// directly. They're exported mostly for use by related packages +// implementing derivative OAuth2 flows. +type Token struct { + // AccessToken is the token that authorizes and authenticates + // the requests. + AccessToken string `json:"access_token"` + + // TokenType is the type of token. + // The Type method returns either this or "Bearer", the default. + TokenType string `json:"token_type,omitempty"` + + // RefreshToken is a token that's used by the application + // (as opposed to the user) to refresh the access token + // if it expires. + RefreshToken string `json:"refresh_token,omitempty"` + + // Expiry is the optional expiration time of the access token. + // + // If zero, TokenSource implementations will reuse the same + // token forever and RefreshToken or equivalent + // mechanisms for that TokenSource will not be used. + Expiry time.Time `json:"expiry,omitempty"` + + // raw optionally contains extra metadata from the server + // when updating a token. + raw interface{} +} + +// Type returns t.TokenType if non-empty, else "Bearer". +func (t *Token) Type() string { + if strings.EqualFold(t.TokenType, "bearer") { + return "Bearer" + } + if strings.EqualFold(t.TokenType, "mac") { + return "MAC" + } + if strings.EqualFold(t.TokenType, "basic") { + return "Basic" + } + if t.TokenType != "" { + return t.TokenType + } + return "Bearer" +} + +// SetAuthHeader sets the Authorization header to r using the access +// token in t. +// +// This method is unnecessary when using Transport or an HTTP Client +// returned by this package. +func (t *Token) SetAuthHeader(r *http.Request) { + r.Header.Set("Authorization", t.Type()+" "+t.AccessToken) +} + +// WithExtra returns a new Token that's a clone of t, but using the +// provided raw extra map. This is only intended for use by packages +// implementing derivative OAuth2 flows. +func (t *Token) WithExtra(extra interface{}) *Token { + t2 := new(Token) + *t2 = *t + t2.raw = extra + return t2 +} + +// Extra returns an extra field. +// Extra fields are key-value pairs returned by the server as a +// part of the token retrieval response. +func (t *Token) Extra(key string) interface{} { + if vals, ok := t.raw.(url.Values); ok { + // TODO(jbd): Cast numeric values to int64 or float64. + return vals.Get(key) + } + if raw, ok := t.raw.(map[string]interface{}); ok { + return raw[key] + } + return nil +} + +// expired reports whether the token is expired. +// t must be non-nil. +func (t *Token) expired() bool { + if t.Expiry.IsZero() { + return false + } + return t.Expiry.Add(-expiryDelta).Before(time.Now()) +} + +// Valid reports whether t is non-nil, has an AccessToken, and is not expired. +func (t *Token) Valid() bool { + return t != nil && t.AccessToken != "" && !t.expired() +} + +// tokenFromInternal maps an *internal.Token struct into +// a *Token struct. +func tokenFromInternal(t *internal.Token) *Token { + if t == nil { + return nil + } + return &Token{ + AccessToken: t.AccessToken, + TokenType: t.TokenType, + RefreshToken: t.RefreshToken, + Expiry: t.Expiry, + raw: t.Raw, + } +} + +// retrieveToken takes a *Config and uses that to retrieve an *internal.Token. +// This token is then mapped from *internal.Token into an *oauth2.Token which is returned along +// with an error.. +func retrieveToken(ctx context.Context, c *Config, v url.Values) (*Token, error) { + tk, err := internal.RetrieveToken(ctx, c.ClientID, c.ClientSecret, c.Endpoint.TokenURL, v) + if err != nil { + return nil, err + } + return tokenFromInternal(tk), nil +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/token_test.go b/Godeps/_workspace/src/golang.org/x/oauth2/token_test.go new file mode 100644 index 000000000..739eeb2a2 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/token_test.go @@ -0,0 +1,50 @@ +// Copyright 2014 The oauth2 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 oauth2 + +import ( + "testing" + "time" +) + +func TestTokenExtra(t *testing.T) { + type testCase struct { + key string + val interface{} + want interface{} + } + const key = "extra-key" + cases := []testCase{ + {key: key, val: "abc", want: "abc"}, + {key: key, val: 123, want: 123}, + {key: key, val: "", want: ""}, + {key: "other-key", val: "def", want: nil}, + } + for _, tc := range cases { + extra := make(map[string]interface{}) + extra[tc.key] = tc.val + tok := &Token{raw: extra} + if got, want := tok.Extra(key), tc.want; got != want { + t.Errorf("Extra(%q) = %q; want %q", key, got, want) + } + } +} + +func TestTokenExpiry(t *testing.T) { + now := time.Now() + cases := []struct { + name string + tok *Token + want bool + }{ + {name: "12 seconds", tok: &Token{Expiry: now.Add(12 * time.Second)}, want: false}, + {name: "10 seconds", tok: &Token{Expiry: now.Add(expiryDelta)}, want: true}, + } + for _, tc := range cases { + if got, want := tc.tok.expired(), tc.want; got != want { + t.Errorf("expired (%q) = %v; want %v", tc.name, got, want) + } + } +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/transport.go b/Godeps/_workspace/src/golang.org/x/oauth2/transport.go new file mode 100644 index 000000000..90db08833 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/transport.go @@ -0,0 +1,132 @@ +// Copyright 2014 The oauth2 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 oauth2 + +import ( + "errors" + "io" + "net/http" + "sync" +) + +// Transport is an http.RoundTripper that makes OAuth 2.0 HTTP requests, +// wrapping a base RoundTripper and adding an Authorization header +// with a token from the supplied Sources. +// +// Transport is a low-level mechanism. Most code will use the +// higher-level Config.Client method instead. +type Transport struct { + // Source supplies the token to add to outgoing requests' + // Authorization headers. + Source TokenSource + + // Base is the base RoundTripper used to make HTTP requests. + // If nil, http.DefaultTransport is used. + Base http.RoundTripper + + mu sync.Mutex // guards modReq + modReq map[*http.Request]*http.Request // original -> modified +} + +// RoundTrip authorizes and authenticates the request with an +// access token. If no token exists or token is expired, +// tries to refresh/fetch a new token. +func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { + if t.Source == nil { + return nil, errors.New("oauth2: Transport's Source is nil") + } + token, err := t.Source.Token() + if err != nil { + return nil, err + } + + req2 := cloneRequest(req) // per RoundTripper contract + token.SetAuthHeader(req2) + t.setModReq(req, req2) + res, err := t.base().RoundTrip(req2) + if err != nil { + t.setModReq(req, nil) + return nil, err + } + res.Body = &onEOFReader{ + rc: res.Body, + fn: func() { t.setModReq(req, nil) }, + } + return res, nil +} + +// CancelRequest cancels an in-flight request by closing its connection. +func (t *Transport) CancelRequest(req *http.Request) { + type canceler interface { + CancelRequest(*http.Request) + } + if cr, ok := t.base().(canceler); ok { + t.mu.Lock() + modReq := t.modReq[req] + delete(t.modReq, req) + t.mu.Unlock() + cr.CancelRequest(modReq) + } +} + +func (t *Transport) base() http.RoundTripper { + if t.Base != nil { + return t.Base + } + return http.DefaultTransport +} + +func (t *Transport) setModReq(orig, mod *http.Request) { + t.mu.Lock() + defer t.mu.Unlock() + if t.modReq == nil { + t.modReq = make(map[*http.Request]*http.Request) + } + if mod == nil { + delete(t.modReq, orig) + } else { + t.modReq[orig] = mod + } +} + +// 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, len(r.Header)) + for k, s := range r.Header { + r2.Header[k] = append([]string(nil), s...) + } + return r2 +} + +type onEOFReader struct { + rc io.ReadCloser + fn func() +} + +func (r *onEOFReader) Read(p []byte) (n int, err error) { + n, err = r.rc.Read(p) + if err == io.EOF { + r.runFunc() + } + return +} + +func (r *onEOFReader) Close() error { + err := r.rc.Close() + r.runFunc() + return err +} + +func (r *onEOFReader) runFunc() { + if fn := r.fn; fn != nil { + fn() + r.fn = nil + } +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/transport_test.go b/Godeps/_workspace/src/golang.org/x/oauth2/transport_test.go new file mode 100644 index 000000000..35cb25ed5 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/transport_test.go @@ -0,0 +1,86 @@ +package oauth2 + +import ( + "net/http" + "net/http/httptest" + "testing" + "time" +) + +type tokenSource struct{ token *Token } + +func (t *tokenSource) Token() (*Token, error) { + return t.token, nil +} + +func TestTransportTokenSource(t *testing.T) { + ts := &tokenSource{ + token: &Token{ + AccessToken: "abc", + }, + } + tr := &Transport{ + Source: ts, + } + server := newMockServer(func(w http.ResponseWriter, r *http.Request) { + if r.Header.Get("Authorization") != "Bearer abc" { + t.Errorf("Transport doesn't set the Authorization header from the fetched token") + } + }) + defer server.Close() + client := http.Client{Transport: tr} + client.Get(server.URL) +} + +// Test for case-sensitive token types, per https://github.com/golang/oauth2/issues/113 +func TestTransportTokenSourceTypes(t *testing.T) { + const val = "abc" + tests := []struct { + key string + val string + want string + }{ + {key: "bearer", val: val, want: "Bearer abc"}, + {key: "mac", val: val, want: "MAC abc"}, + {key: "basic", val: val, want: "Basic abc"}, + } + for _, tc := range tests { + ts := &tokenSource{ + token: &Token{ + AccessToken: tc.val, + TokenType: tc.key, + }, + } + tr := &Transport{ + Source: ts, + } + server := newMockServer(func(w http.ResponseWriter, r *http.Request) { + if got, want := r.Header.Get("Authorization"), tc.want; got != want { + t.Errorf("Authorization header (%q) = %q; want %q", val, got, want) + } + }) + defer server.Close() + client := http.Client{Transport: tr} + client.Get(server.URL) + } +} + +func TestTokenValidNoAccessToken(t *testing.T) { + token := &Token{} + if token.Valid() { + t.Errorf("Token should not be valid with no access token") + } +} + +func TestExpiredWithExpiry(t *testing.T) { + token := &Token{ + Expiry: time.Now().Add(-5 * time.Hour), + } + if token.Valid() { + t.Errorf("Token should not be valid if it expired in the past") + } +} + +func newMockServer(handler func(w http.ResponseWriter, r *http.Request)) *httptest.Server { + return httptest.NewServer(http.HandlerFunc(handler)) +} diff --git a/Godeps/_workspace/src/golang.org/x/oauth2/vk/vk.go b/Godeps/_workspace/src/golang.org/x/oauth2/vk/vk.go new file mode 100644 index 000000000..5acdeb18f --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/oauth2/vk/vk.go @@ -0,0 +1,16 @@ +// Copyright 2015 The oauth2 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 vk provides constants for using OAuth2 to access VK.com. +package vk // import "golang.org/x/oauth2/vk" + +import ( + "golang.org/x/oauth2" +) + +// Endpoint is VK's OAuth 2.0 endpoint. +var Endpoint = oauth2.Endpoint{ + AuthURL: "https://oauth.vk.com/authorize", + TokenURL: "https://oauth.vk.com/access_token", +} diff --git a/Godeps/_workspace/src/google.golang.org/api/.hgignore b/Godeps/_workspace/src/google.golang.org/api/.hgignore new file mode 100644 index 000000000..d31fc45fd --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/.hgignore @@ -0,0 +1,11 @@ +_obj +_testmain.go +clientid.dat +clientsecret.dat +google-api-go-generator/google-api-go-gen + +syntax:glob +*.6 +*.8 +*~ +*.out diff --git a/Godeps/_workspace/src/google.golang.org/api/.hgtags b/Godeps/_workspace/src/google.golang.org/api/.hgtags new file mode 100644 index 000000000..f1a735783 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/.hgtags @@ -0,0 +1 @@ +b571b553f8c057cb6952ce817dfb09b6e34a8c0b release diff --git a/Godeps/_workspace/src/google.golang.org/api/.travis.yml b/Godeps/_workspace/src/google.golang.org/api/.travis.yml new file mode 100644 index 000000000..59cb6735e --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/.travis.yml @@ -0,0 +1,13 @@ +sudo: false + +language: go + +go: + - 1.4 + - tip + +install: + - go get -v google.golang.org/api/... + +script: + - go test -v google.golang.org/api/... diff --git a/Godeps/_workspace/src/google.golang.org/api/AUTHORS b/Godeps/_workspace/src/google.golang.org/api/AUTHORS new file mode 100644 index 000000000..f73b72574 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/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/Godeps/_workspace/src/google.golang.org/api/CONTRIBUTING.md b/Godeps/_workspace/src/google.golang.org/api/CONTRIBUTING.md new file mode 100644 index 000000000..e4d36da35 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/CONTRIBUTING.md @@ -0,0 +1,484 @@ +# Contributing to the Google API Go Client + +## Master git repo + +Our master git repo is https://code.googlesource.com/google-api-go-client + +## Pull Requests + +We do **NOT** use Github pull requests. We use Gerrit instead +with the same workflow as Go. See below. + +## The source tree + +Most of this project is auto-generated. + +The notable directories which are not auto-generated: + +``` + google-api-go-generator/ -- the generator itself + googleapi/ -- shared common code, used by auto-generated code + examples/ -- sample code +``` + +# Contribution Guidelines + +## Introduction + +This document explains how to contribute changes to the google-api-go-client project. + +## Testing redux + +You've written and tested your code, but +before sending code out for review, run all the tests for the whole +tree to make sure the changes don't break other packages or programs: + +``` +$ make cached +$ go test ./... +... +ok google.golang.org/api/google-api-go-generator 0.226s +ok google.golang.org/api/googleapi 0.015s +... +``` + +Ideally, you will add unit tests to one of the above directories to +demonstrate the changes you are making and include the tests with your +code review. + +## Code review + +Changes to google-api-go-client must be reviewed before they are submitted, +no matter who makes the change. +A custom git command called `git-codereview`, +discussed below, helps manage the code review process through a Google-hosted +[instance](https://code-review.googlesource.com/) of the code review +system called [Gerrit](https://code.google.com/p/gerrit/). + +### Set up authentication for code review + +The Git code hosting server and Gerrit code review server both use a Google +Account to authenticate. You therefore need a Google Account to proceed. +(If you can use the account to +[sign in at google.com](https://www.google.com/accounts/Login), +you can use it to sign in to the code review server.) +The email address you use with the code review system +needs to be added to the [`CONTRIBUTORS`](/CONTRIBUTORS) file +with your first code review. +You can [create a Google Account](https://www.google.com/accounts/NewAccount) +associated with any address where you receive email. + +Visit the site [code.googlesource.com](https://code.googlesource.com) +and log in using your Google Account. +Click on the "Generate Password" link that appears at the top of the page. + +Click the radio button that says "Only `code.googlesource.com`" +to use this authentication token only for the google-api-go-client project. + +Further down the page is a box containing commands to install +the authentication cookie in file called `.gitcookies` in your home +directory. +Copy the text for the commands into a Unix shell window to execute it. +That will install the authentication token. + +(If you are on a Windows computer, you should instead follow the instructions +in the yellow box to run the command.) + +### Register with Gerrit + +Now that you have a Google account and the authentication token, +you need to register your account with Gerrit, the code review system. +To do this, visit [golang.org/cl](https://golang.org/cl) +and log in using the same Google Account you used above. +That is all that is required. + +### Install the git-codereview command + +Now install the `git-codereview` command by running, + +``` +go get -u golang.org/x/review/git-codereview +``` + +Make sure `git-codereview` is installed in your shell path, so that the +`git` command can find it. Check that + +``` +$ git codereview help +``` + +prints help text, not an error. + +Note to Git aficionados: The `git-codereview` command is not required to +upload and manage Gerrit code reviews. For those who prefer plain Git, the text +below gives the Git equivalent of each git-codereview command. If you do use plain +Git, note that you still need the commit hooks that the git-codereview command +configures; those hooks add a Gerrit `Change-Id` line to the commit +message and check that all Go source files have been formatted with gofmt. Even +if you intend to use plain Git for daily work, install the hooks in a new Git +checkout by running `git-codereview hooks`. + +### Set up git aliases + +The `git-codereview` command can be run directly from the shell +by typing, for instance, + +``` +$ git codereview sync +``` + +but it is more convenient to set up aliases for `git-codereview`'s own +subcommands, so that the above becomes, + +``` +$ git sync +``` + +The `git-codereview` subcommands have been chosen to be distinct from +Git's own, so it's safe to do so. + +The aliases are optional, but in the rest of this document we will assume +they are installed. +To install them, copy this text into your Git configuration file +(usually `.gitconfig` in your home directory): + +``` +[alias] + change = codereview change + gofmt = codereview gofmt + mail = codereview mail + pending = codereview pending + submit = codereview submit + sync = codereview sync +``` + +### Understanding the git-codereview command + +After installing the `git-codereview` command, you can run + +``` +$ git codereview help +``` + +to learn more about its commands. +You can also read the [command documentation](https://godoc.org/golang.org/x/review/git-codereview). + +### Switch to the master branch + +New changes should +only be made based on the master branch. +Before making a change, make sure you start on the master branch: + +``` +$ git checkout master +$ git sync +```` + +(In Git terms, `git sync` runs +`git pull -r`.) + +### Make a change + +The entire checked-out tree is writable. +Once you have edited files, you must tell Git that they have been modified. +You must also tell Git about any files that are added, removed, or renamed files. +These operations are done with the usual Git commands, +`git add`, +`git rm`, +and +`git mv`. + +If you wish to checkpoint your work, or are ready to send the code out for review, run + +``` +$ git change +``` + +from any directory in your google-api-go-client repository to commit the changes so far. +The name `` is an arbitrary one you choose to identify the +local branch containing your changes. + +(In Git terms, `git change ` +runs `git checkout -b branch`, +then `git branch --set-upstream-to origin/master`, +then `git commit`.) + +Git will open a change description file in your editor. +(It uses the editor named by the `$EDITOR` environment variable, +`vi` by default.) +The file will look like: + +``` +# Please enter the commit message for your changes. Lines starting +# with '#' will be ignored, and an empty message aborts the commit. +# On branch foo +# Changes not staged for commit: +# modified: editedfile.go +# +``` + +At the beginning of this file is a blank line; replace it +with a thorough description of your change. +The first line of the change description is conventionally a one-line +summary of the change, prefixed by `google-api-go-client:`, +and is used as the subject for code review mail. +The rest of the +description elaborates and should provide context for the +change and explain what it does. +If there is a helpful reference, mention it here. + +After editing, the template might now read: + +``` +math: improved Sin, Cos and Tan precision for very large arguments + +The existing implementation has poor numerical properties for +large arguments, so use the McGillicutty algorithm to improve +accuracy above 1e10. + +The algorithm is described at http://wikipedia.org/wiki/McGillicutty_Algorithm + +Fixes #54 + +# Please enter the commit message for your changes. Lines starting +# with '#' will be ignored, and an empty message aborts the commit. +# On branch foo +# Changes not staged for commit: +# modified: editedfile.go +# +``` + +The commented section of the file lists all the modified files in your client. +It is best to keep unrelated changes in different change lists, +so if you see a file listed that should not be included, abort +the command and move that file to a different branch. + +The special notation "Fixes #54" associates the change with issue 54 in the +[google-api-go-client issue tracker](https://github.com/google/google-api-go-client/issues/54). +When this change is eventually submitted, the issue +tracker will automatically mark the issue as fixed. +(There are several such conventions, described in detail in the +[GitHub Issue Tracker documentation](https://help.github.com/articles/closing-issues-via-commit-messages/).) + +Once you have finished writing the commit message, +save the file and exit the editor. + +If you wish to do more editing, re-stage your changes using +`git add`, and then run + +``` +$ git change +``` + +to update the change description and incorporate the staged changes. The +change description contains a `Change-Id` line near the bottom, +added by a Git commit hook during the initial +`git change`. +That line is used by Gerrit to match successive uploads of the same change. +Do not edit or delete it. + +(In Git terms, `git change` with no branch name +runs `git commit --amend`.) + +### Mail the change for review + +Once the change is ready, mail it out for review: + +``` +$ git mail +``` + +You can specify a reviewer or CC interested parties +using the `-r` or `-cc` options. +Both accept a comma-separated list of email addresses: + +``` +$ git mail -r joe@golang.org -cc mabel@example.com,math-nuts@swtch.com +``` + +Unless explicitly told otherwise, such as in the discussion leading +up to sending in the change list, please specify +`bradfitz@golang.org`, `gmlewis@google.com`, or +`mcgreevy@golang.org` as a reviewer. + +(In Git terms, `git mail` pushes the local committed +changes to Gerrit using `git push origin HEAD:refs/for/master`.) + +If your change relates to an open issue, please add a comment to the issue +announcing your proposed fix, including a link to your CL. + +The code review server assigns your change an issue number and URL, +which `git mail` will print, something like: + +``` +remote: New Changes: +remote: https://code-review.googlesource.com/99999 math: improved Sin, Cos and Tan precision for very large arguments +``` + +### Reviewing code + +Running `git mail` will send an email to you and the +reviewers asking them to visit the issue's URL and make comments on the change. +When done, the reviewer adds comments through the Gerrit user interface +and clicks "Reply" to send comments back. +You will receive a mail notification when this happens. +You must reply through the web interface. + +### Revise and upload + +You must respond to review comments through the web interface. + +When you have revised the code and are ready for another round of review, +stage those changes and use `git change` to update the +commit. +To send the update change list for another round of review, +run `git mail` again. + +The reviewer can comment on the new copy, and the process repeats. +The reviewer approves the change by giving it a positive score +(+1 or +2) and replying `LGTM`: looks good to me. + +You can see a list of your pending changes by running +`git pending`, and switch between change branches with +`git change `. + +### Synchronize your client + +While you were working, others might have submitted changes to the repository. +To update your local branch, run + +``` +$ git sync +``` + +(In git terms, `git sync` runs +`git pull -r`.) + +If files you were editing have changed, Git does its best to merge the +remote changes into your local changes. +It may leave some files to merge by hand. + +For example, suppose you have edited `sin.go` but +someone else has committed an independent change. +When you run `git sync`, +you will get the (scary-looking) output: + +``` +$ git sync +Failed to merge in the changes. +Patch failed at 0023 math: improved Sin, Cos and Tan precision for very large arguments +The copy of the patch that failed is found in: + /home/you/repo/.git/rebase-apply/patch + +When you have resolved this problem, run "git rebase --continue". +If you prefer to skip this patch, run "git rebase --skip" instead. +To check out the original branch and stop rebasing, run "git rebase --abort". +``` + + +If this happens, run + +``` +$ git status +``` + +to see which files failed to merge. +The output will look something like this: + +``` +rebase in progress; onto a24c3eb +You are currently rebasing branch 'mcgillicutty' on 'a24c3eb'. + (fix conflicts and then run "git rebase --continue") + (use "git rebase --skip" to skip this patch) + (use "git rebase --abort" to check out the original branch) + +Unmerged paths: + (use "git reset HEAD ..." to unstage) + (use "git add ..." to mark resolution) + + _both modified: sin.go_ +``` + + +The only important part in that transcript is the italicized "both modified" +line: Git failed to merge your changes with the conflicting change. +When this happens, Git leaves both sets of edits in the file, +with conflicts marked by `<<<<<<<` and +`>>>>>>>`. +It is now your job to edit the file to combine them. +Continuing the example, searching for those strings in `sin.go` +might turn up: + +``` + arg = scale(arg) +<<<<<<< HEAD + if arg > 1e9 { +======= + if arg > 1e10 { +>>>>>>> mcgillicutty + largeReduce(arg) +``` + +Git doesn't show it, but suppose the original text that both edits +started with was 1e8; you changed it to 1e10 and the other change to 1e9, +so the correct answer might now be 1e10. First, edit the section +to remove the markers and leave the correct code: + +``` + arg = scale(arg) + if arg > 1e10 { + largeReduce(arg) +``` + +Then tell Git that the conflict is resolved by running + +``` +$ git add sin.go +``` + +If you had been editing the file, say for debugging, but do not +care to preserve your changes, you can run +`git reset HEAD sin.go` +to abandon your changes. +Then run `git rebase --continue` to +restore the change commit. + +### Reviewing code by others + +You can import a change proposed by someone else into your local Git repository. +On the Gerrit review page, click the "Download ▼" link in the upper right +corner, copy the "Checkout" command and run it from your local Git repo. +It should look something like this: + +``` +$ git fetch https://code.googlesource.com/review refs/changes/21/1221/1 && git checkout FETCH_HEAD +``` + +To revert, change back to the branch you were working in. + +### Submit the change after the review + +After the code has been `LGTM`'ed, an approver may +submit it to the master branch using the Gerrit UI. +There is a "Submit" button on the web page for the change +that appears once the change is approved (marked +2). + +This checks the change into the repository. +The change description will include a link to the code review, +and the code review will be updated with a link to the change +in the repository. +Since the method used to integrate the changes is "Cherry Pick", +the commit hashes in the repository will be changed by +the submit operation. + +### More information + +In addition to the information here, the Go community maintains a [CodeReview](https://golang.org/wiki/CodeReview) wiki page. +Feel free to contribute to this page as you learn the review process. + +## Contributors + +Files in the google-api-go-client repository don't list author names, +both to avoid clutter and to avoid having to keep the lists up to date. +Instead, please add your name to the [`CONTRIBUTORS`](/CONTRIBUTORS) +file as your first code review, keeping the names in sorted order. diff --git a/Godeps/_workspace/src/google.golang.org/api/CONTRIBUTORS b/Godeps/_workspace/src/google.golang.org/api/CONTRIBUTORS new file mode 100644 index 000000000..d712ce1e5 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/CONTRIBUTORS @@ -0,0 +1,51 @@ +# This is the official list of people who can contribute +# (and typically have contributed) code to the repository. +# The AUTHORS file lists the copyright holders; this file +# lists people. For example, Google employees are listed here +# but not in AUTHORS, because Google holds the copyright. +# +# The submission process automatically checks to make sure +# that people submitting code are listed in this file (by email address). +# +# Names should be added to this file only after verifying that +# the individual or the individual's organization has agreed to +# the appropriate Contributor License Agreement, found here: +# +# https://cla.developers.google.com/about/google-individual +# https://cla.developers.google.com/about/google-corporate +# +# The CLA can be filled out on the web: +# +# https://cla.developers.google.com/ +# +# When adding J Random Contributor's name to this file, +# either J's name or J's organization's name should be +# added to the AUTHORS file, depending on whether the +# individual or corporate CLA was used. + +# Names should be added to this file like so: +# Name +# +# 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 +Dragoslav Mitrinovic +Eric Koleda +Francesc Campoy +Garrick Evans +Glenn Lewis +Ivan Krasin +Jason Hall +Johan Euphrosine +Kostik Shtoyk +Michael McGreevy +Nick Craig-Wood +Scott Van Woudenberg +Takashi Matsuo diff --git a/Godeps/_workspace/src/google.golang.org/api/GettingStarted.md b/Godeps/_workspace/src/google.golang.org/api/GettingStarted.md new file mode 100644 index 000000000..37f13aba2 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/GettingStarted.md @@ -0,0 +1,122 @@ +# Getting Started with the Google APIs for Go + +## Getting Started + +This is a quick walk-through of how to get started with the Google APIs for Go. + +## Background + +The first thing to understand is that the Google API libraries are auto-generated for +each language, including Go, so they may not feel like 100% natural for any language. +The Go versions are pretty natural, but please forgive any small non-idiomatic things. +(Suggestions welcome, though!) + +## Installing + +Pick an API and a version of that API to install. +You can find the complete list by looking at the +[directories here](https://github.com/google/google-api-go-client/tree/master/). + +For example, let's install the +[urlshortener's version 1 API](https://godoc.org/google.golang.org/api/urlshortener/v1): + +``` +$ go get google.golang.org/api/urlshortener/v1 +``` + +Now it's ready for use in your code. + +## Using + +Once you've installed a library, you import it like this: + +```go +package main + +import ( + "golang.org/x/net/context" + "golang.org/x/oauth2" + "golang.org/x/oauth2/google" + "google.golang.org/api/urlshortener/v1" +) +``` + +The package name, if you don't override it on your import line, is the name of the +API without the version number. In the case above, just `urlshortener`. + +## Instantiating + +Each API has a `New` function taking an `*http.Client` and returning an API-specific `*Service`. + +You create the service like: + +```go + svc, err := urlshortener.New(httpClient) +``` + +## OAuth HTTP Client + +The HTTP client you pass in to the service must be one that automatically adds +Google-supported Authorization information to the requests. + +The best option is to use "golang.org/x/oauth2", an OAuth2 library for Go. +You can see how to set up and use oauth2 with these APIs by checking out the +[example code](https://github.com/google/google-api-go-client/tree/master/examples). + +In summary, you need to create an OAuth config: + +```go + var config = &oauth2.Config{ + ClientID: "", // from https://console.developers.google.com/project//apiui/credential + ClientSecret: "", // from https://console.developers.google.com/project//apiui/credential + Endpoint: google.Endpoint, + Scopes: []string{urlshortener.UrlshortenerScope}, + } +``` + +Then you need to get an OAuth Token from the user. This involves sending the user +to a URL (at Google) to grant access to your application (either a web application +or a desktop application), and then the browser redirects to the website or local +application's webserver with the per-user token in the URL. + +Once you have that token, + +```go + httpClient := newOAuthClient(context.Background(), config) +``` + +Then you're good to pass that client to the API's `New` function. + +## Using API Keys + +Some APIs require passing API keys from your application. +To do this, you can use +[transport.APIKey](http://godoc.org/google.golang.org/api/googleapi/transport#APIKey): + +```go + ctx = context.WithValue(context.Background(), oauth2.HTTPClient, &http.Client{ + Transport: &transport.APIKey{Key: developerKey}, + }) + httpClient := newOAuthClient(ctx, config) +``` + +## Using the Service + +Each service contains zero or more methods and zero or more sub-services. +The sub-services related to a specific type of "Resource". + +Those sub-services then contain their own methods. + +For instance, the urlshortener API has just the "Url" sub-service: + +```go + url, err := svc.Url.Get(shortURL).Do() + if err != nil { + ... + } + fmt.Printf("The URL %s goes to %s\n", shortURL, url.LongUrl) +``` + +For a more complete example, see +[urlshortener.go](https://github.com/google/google-api-go-client/tree/master/examples/urlshortener.go) +in the [examples directory](https://github.com/google/google-api-go-client/tree/master/examples/). diff --git a/Godeps/_workspace/src/google.golang.org/api/LICENSE b/Godeps/_workspace/src/google.golang.org/api/LICENSE new file mode 100644 index 000000000..263aa7a0c --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/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/Godeps/_workspace/src/google.golang.org/api/Makefile b/Godeps/_workspace/src/google.golang.org/api/Makefile new file mode 100644 index 000000000..67ed10e25 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/Makefile @@ -0,0 +1,27 @@ +API_JSON = $(wildcard */*/*-api.json) + +# Download all API specifications and rebuild Go bindings. +# All downloaded files are cached in $TMPDIR for reuse with 'cached' below. +all: generator + $(GOPATH)/bin/google-api-go-generator -cache=false -install -api=* + +# Reuse cached API specifications in $TMPDIR and rebuild Go bindings. +cached: generator + $(GOPATH)/bin/google-api-go-generator -cache=true -install -api=* + +# Only rebuild Go bindings, do not modify API specifications. +# For every existing */*/*-api.json file, */*/*-gen.go will be built. +local: $(API_JSON:-api.json=-gen.go) + +# Pattern rule for the 'local' target. +# Translates otherwise unnamed targets with a -gen.go suffix into the +# matching input file with a -api.json suffix. $< is the input file. +%-gen.go: %-api.json generator + $(GOPATH)/bin/google-api-go-generator -api_json_file=$< + +# Rebuild and install $(GOPATH)/bin/google-api-go-generator +generator: + go install google.golang.org/api/googleapi + go install google.golang.org/api/google-api-go-generator + +.PHONY: all cached local generator diff --git a/Godeps/_workspace/src/google.golang.org/api/NOTES b/Godeps/_workspace/src/google.golang.org/api/NOTES new file mode 100644 index 000000000..571f6ec79 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/NOTES @@ -0,0 +1,13 @@ +Discovery Service: +https://developers.google.com/discovery/ +https://developers.google.com/discovery/v1/reference/ + +The "type" key: +http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1 + +The "format" key: +http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.23 +https://developers.google.com/discovery/v1/type-format + +Google JSON format docs: +http://google-styleguide.googlecode.com/svn/trunk/jsoncstyleguide.xml diff --git a/Godeps/_workspace/src/google.golang.org/api/README.md b/Godeps/_workspace/src/google.golang.org/api/README.md new file mode 100644 index 000000000..b562c2f40 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/README.md @@ -0,0 +1,92 @@ +# Google APIs Client Library for Go + +## Status +[![Build Status](https://travis-ci.org/google/google-api-go-client.png)](https://travis-ci.org/google/google-api-go-client) + +These are auto-generated Go libraries from the Google Discovery Service's JSON description files of the available "new style" Google APIs. + +Due to the auto-generated nature of this collection of libraries, complete APIs or specific versions can appear or go away without notice. +As a result, you should always locally vendor any API(s) that your code relies upon. + +Announcement email: + +* http://groups.google.com/group/golang-nuts/browse_thread/thread/6c7281450be9a21e + +Getting started documentation: + +* https://github.com/google/google-api-go-client/blob/master/GettingStarted.md + +In summary: + +``` +$ go get google.golang.org/api/storage/v1 +$ go get google.golang.org/api/tasks/v1 +$ go get google.golang.org/api/moderator/v1 +... etc ... +``` + +For docs, see e.g.: + +* https://godoc.org/google.golang.org/api/storage/v1 + +The package of a given import is the second-to-last component, before the version number. + +For examples, see: + +* https://github.com/google/google-api-go-client/tree/master/examples + +For support, use the golang-nuts@ mailing list: + +* https://groups.google.com/group/golang-nuts + +## Application Default Credentials Example + +Application Default Credentials provide a simplified way to obtain credentials +for authenticating with Google APIs. + +The Application Default Credentials authenticate as the application itself, +which make them great for working with Google Cloud APIs like Storage or +Datastore. They are the recommended form of authentication when building +applications that run on Google Compute Engine or Google App Engine. + +Default credentials are provided by the `golang.org/x/oauth2/google` package. To use them, add the following import: + +``` +import "golang.org/x/oauth2/google" +``` + +Some credentials types require you to specify scopes, and service entry points may not inject them. If you encounter this situation you may need to specify scopes as follows: + +``` +import ( + "golang.org/x/net/context" + "golang.org/x/oauth2/google" + "google.golang.org/api/compute/v1" +) + +func main() { + // Use oauth2.NoContext if there isn't a good context to pass in. + ctx := context.Background() + + client, err := google.DefaultClient(ctx, compute.ComputeScope) + if err != nil { + //... + } + computeService, err := compute.New(client) + if err != nil { + //... + } +} +``` + +If you need a `oauth2.TokenSource`, use the `DefaultTokenSource` function: + +``` +ts, err := google.DefaultTokenSource(ctx, scope1, scope2, ...) +if err != nil { + //... +} +client := oauth2.NewClient(ctx, ts) +``` + +See also: [golang.org/x/oauth2/google](https://godoc.org/golang.org/x/oauth2/google) package documentation. diff --git a/Godeps/_workspace/src/google.golang.org/api/TODO b/Godeps/_workspace/src/google.golang.org/api/TODO new file mode 100644 index 000000000..de2467c39 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/TODO @@ -0,0 +1,2 @@ +Moved to: +https://github.com/google/google-api-go-client/issues diff --git a/Godeps/_workspace/src/google.golang.org/api/adexchangebuyer/v1.2/adexchangebuyer-api.json b/Godeps/_workspace/src/google.golang.org/api/adexchangebuyer/v1.2/adexchangebuyer-api.json new file mode 100644 index 000000000..bbb72b260 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/adexchangebuyer/v1.2/adexchangebuyer-api.json @@ -0,0 +1,596 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/NUnz0H_oWow0qcTRC55iG-5RpbM\"", + "discoveryVersion": "v1", + "id": "adexchangebuyer:v1.2", + "name": "adexchangebuyer", + "canonicalName": "Ad Exchange Buyer", + "version": "v1.2", + "revision": "20150909", + "title": "Ad Exchange Buyer API", + "description": "Accesses your bidding-account information, submits creatives for validation, finds available direct deals, and retrieves performance reports.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/ad-exchange/buyer-rest", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/adexchangebuyer/v1.2/", + "basePath": "/adexchangebuyer/v1.2/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "adexchangebuyer/v1.2/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json" + ], + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.", + "location": "query" + }, + "userIp": { + "type": "string", + "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.", + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/adexchange.buyer": { + "description": "Manage your Ad Exchange buyer account configuration" + } + } + } + }, + "schemas": { + "Account": { + "id": "Account", + "type": "object", + "description": "Configuration data for an Ad Exchange buyer account.", + "properties": { + "bidderLocation": { + "type": "array", + "description": "Your bidder locations that have distinct URLs.", + "items": { + "type": "object", + "properties": { + "maximumQps": { + "type": "integer", + "description": "The maximum queries per second the Ad Exchange will send.", + "format": "int32" + }, + "region": { + "type": "string", + "description": "The geographical region the Ad Exchange should send requests from. Only used by some quota systems, but always setting the value is recommended. Allowed values: \n- ASIA \n- EUROPE \n- US_EAST \n- US_WEST" + }, + "url": { + "type": "string", + "description": "The URL to which the Ad Exchange will send bid requests." + } + } + } + }, + "cookieMatchingNid": { + "type": "string", + "description": "The nid parameter value used in cookie match requests. Please contact your technical account manager if you need to change this." + }, + "cookieMatchingUrl": { + "type": "string", + "description": "The base URL used in cookie match requests." + }, + "id": { + "type": "integer", + "description": "Account id.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#account" + }, + "maximumActiveCreatives": { + "type": "integer", + "description": "The maximum number of active creatives that an account can have, where a creative is active if it was inserted or bid with in the last 30 days. Please contact your technical account manager if you need to change this.", + "format": "int32" + }, + "maximumTotalQps": { + "type": "integer", + "description": "The sum of all bidderLocation.maximumQps values cannot exceed this. Please contact your technical account manager if you need to change this.", + "format": "int32" + }, + "numberActiveCreatives": { + "type": "integer", + "description": "The number of creatives that this account inserted or bid with in the last 30 days.", + "format": "int32" + } + } + }, + "AccountsList": { + "id": "AccountsList", + "type": "object", + "description": "An account feed lists Ad Exchange buyer accounts that the user has access to. Each entry in the feed corresponds to a single buyer account.", + "properties": { + "items": { + "type": "array", + "description": "A list of accounts.", + "items": { + "$ref": "Account" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#accountsList" + } + } + }, + "Creative": { + "id": "Creative", + "type": "object", + "description": "A creative and its classification data.", + "properties": { + "HTMLSnippet": { + "type": "string", + "description": "The HTML snippet that displays the ad when inserted in the web page. If set, videoURL should not be set." + }, + "accountId": { + "type": "integer", + "description": "Account id.", + "format": "int32", + "annotations": { + "required": [ + "adexchangebuyer.creatives.insert" + ] + } + }, + "advertiserId": { + "type": "array", + "description": "Detected advertiser id, if any. Read-only. This field should not be set in requests.", + "items": { + "type": "string", + "format": "int64" + } + }, + "advertiserName": { + "type": "string", + "description": "The name of the company being advertised in the creative.", + "annotations": { + "required": [ + "adexchangebuyer.creatives.insert" + ] + } + }, + "agencyId": { + "type": "string", + "description": "The agency id for this creative.", + "format": "int64" + }, + "api_upload_timestamp": { + "type": "string", + "description": "The last upload timestamp of this creative if it was uploaded via API. Read-only. The value of this field is generated, and will be ignored for uploads. (formatted RFC 3339 timestamp).", + "format": "date-time" + }, + "attribute": { + "type": "array", + "description": "All attributes for the ads that may be shown from this snippet.", + "items": { + "type": "integer", + "format": "int32" + } + }, + "buyerCreativeId": { + "type": "string", + "description": "A buyer-specific id identifying the creative in this ad.", + "annotations": { + "required": [ + "adexchangebuyer.creatives.insert" + ] + } + }, + "clickThroughUrl": { + "type": "array", + "description": "The set of destination urls for the snippet.", + "items": { + "type": "string" + }, + "annotations": { + "required": [ + "adexchangebuyer.creatives.insert" + ] + } + }, + "corrections": { + "type": "array", + "description": "Shows any corrections that were applied to this creative. Read-only. This field should not be set in requests.", + "items": { + "type": "object", + "properties": { + "details": { + "type": "array", + "description": "Additional details about the correction.", + "items": { + "type": "string" + } + }, + "reason": { + "type": "string", + "description": "The type of correction that was applied to the creative." + } + } + } + }, + "disapprovalReasons": { + "type": "array", + "description": "The reasons for disapproval, if any. Note that not all disapproval reasons may be categorized, so it is possible for the creative to have a status of DISAPPROVED with an empty list for disapproval_reasons. In this case, please reach out to your TAM to help debug the issue. Read-only. This field should not be set in requests.", + "items": { + "type": "object", + "properties": { + "details": { + "type": "array", + "description": "Additional details about the reason for disapproval.", + "items": { + "type": "string" + } + }, + "reason": { + "type": "string", + "description": "The categorized reason for disapproval." + } + } + } + }, + "filteringReasons": { + "type": "object", + "description": "The filtering reasons for the creative. Read-only. This field should not be set in requests.", + "properties": { + "date": { + "type": "string", + "description": "The date in ISO 8601 format for the data. The data is collected from 00:00:00 to 23:59:59 in PST." + }, + "reasons": { + "type": "array", + "description": "The filtering reasons.", + "items": { + "type": "object", + "properties": { + "filteringCount": { + "type": "string", + "description": "The number of times the creative was filtered for the status. The count is aggregated across all publishers on the exchange.", + "format": "int64" + }, + "filteringStatus": { + "type": "integer", + "description": "The filtering status code. Please refer to the creative-status-codes.txt file for different statuses.", + "format": "int32" + } + } + } + } + } + }, + "height": { + "type": "integer", + "description": "Ad height.", + "format": "int32", + "annotations": { + "required": [ + "adexchangebuyer.creatives.insert" + ] + } + }, + "impressionTrackingUrl": { + "type": "array", + "description": "The set of urls to be called to record an impression.", + "items": { + "type": "string" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#creative" + }, + "productCategories": { + "type": "array", + "description": "Detected product categories, if any. Read-only. This field should not be set in requests.", + "items": { + "type": "integer", + "format": "int32" + } + }, + "restrictedCategories": { + "type": "array", + "description": "All restricted categories for the ads that may be shown from this snippet.", + "items": { + "type": "integer", + "format": "int32" + } + }, + "sensitiveCategories": { + "type": "array", + "description": "Detected sensitive categories, if any. Read-only. This field should not be set in requests.", + "items": { + "type": "integer", + "format": "int32" + } + }, + "status": { + "type": "string", + "description": "Creative serving status. Read-only. This field should not be set in requests." + }, + "vendorType": { + "type": "array", + "description": "All vendor types for the ads that may be shown from this snippet.", + "items": { + "type": "integer", + "format": "int32" + } + }, + "version": { + "type": "integer", + "description": "The version for this creative. Read-only. This field should not be set in requests.", + "format": "int32" + }, + "videoURL": { + "type": "string", + "description": "The url to fetch a video ad. If set, HTMLSnippet should not be set." + }, + "width": { + "type": "integer", + "description": "Ad width.", + "format": "int32", + "annotations": { + "required": [ + "adexchangebuyer.creatives.insert" + ] + } + } + } + }, + "CreativesList": { + "id": "CreativesList", + "type": "object", + "description": "The creatives feed lists the active creatives for the Ad Exchange buyer accounts that the user has access to. Each entry in the feed corresponds to a single creative.", + "properties": { + "items": { + "type": "array", + "description": "A list of creatives.", + "items": { + "$ref": "Creative" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#creativesList" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through creatives. To retrieve the next page of results, set the next request's \"pageToken\" value to this." + } + } + } + }, + "resources": { + "accounts": { + "methods": { + "get": { + "id": "adexchangebuyer.accounts.get", + "path": "accounts/{id}", + "httpMethod": "GET", + "description": "Gets one account by ID.", + "parameters": { + "id": { + "type": "integer", + "description": "The account id", + "required": true, + "format": "int32", + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "list": { + "id": "adexchangebuyer.accounts.list", + "path": "accounts", + "httpMethod": "GET", + "description": "Retrieves the authenticated user's list of accounts.", + "response": { + "$ref": "AccountsList" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "patch": { + "id": "adexchangebuyer.accounts.patch", + "path": "accounts/{id}", + "httpMethod": "PATCH", + "description": "Updates an existing account. This method supports patch semantics.", + "parameters": { + "id": { + "type": "integer", + "description": "The account id", + "required": true, + "format": "int32", + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "Account" + }, + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "update": { + "id": "adexchangebuyer.accounts.update", + "path": "accounts/{id}", + "httpMethod": "PUT", + "description": "Updates an existing account.", + "parameters": { + "id": { + "type": "integer", + "description": "The account id", + "required": true, + "format": "int32", + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "Account" + }, + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + } + } + }, + "creatives": { + "methods": { + "get": { + "id": "adexchangebuyer.creatives.get", + "path": "creatives/{accountId}/{buyerCreativeId}", + "httpMethod": "GET", + "description": "Gets the status for a single creative. A creative will be available 30-40 minutes after submission.", + "parameters": { + "accountId": { + "type": "integer", + "description": "The id for the account that will serve this creative.", + "required": true, + "format": "int32", + "location": "path" + }, + "buyerCreativeId": { + "type": "string", + "description": "The buyer-specific id for this creative.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "buyerCreativeId" + ], + "response": { + "$ref": "Creative" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "insert": { + "id": "adexchangebuyer.creatives.insert", + "path": "creatives", + "httpMethod": "POST", + "description": "Submit a new creative.", + "request": { + "$ref": "Creative" + }, + "response": { + "$ref": "Creative" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "list": { + "id": "adexchangebuyer.creatives.list", + "path": "creatives", + "httpMethod": "GET", + "description": "Retrieves a list of the authenticated user's active creatives. A creative will be available 30-40 minutes after submission.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of entries returned on one result page. If not set, the default is 100. Optional.", + "format": "uint32", + "minimum": "1", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response. Optional.", + "location": "query" + }, + "statusFilter": { + "type": "string", + "description": "When specified, only creatives having the given status are returned.", + "enum": [ + "approved", + "disapproved", + "not_checked" + ], + "enumDescriptions": [ + "Creatives which have been approved.", + "Creatives which have been disapproved.", + "Creatives whose status is not yet checked." + ], + "location": "query" + } + }, + "response": { + "$ref": "CreativesList" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/adexchangebuyer/v1.2/adexchangebuyer-gen.go b/Godeps/_workspace/src/google.golang.org/api/adexchangebuyer/v1.2/adexchangebuyer-gen.go new file mode 100644 index 000000000..c4f977cd4 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/adexchangebuyer/v1.2/adexchangebuyer-gen.go @@ -0,0 +1,1367 @@ +// Package adexchangebuyer provides access to the Ad Exchange Buyer API. +// +// See https://developers.google.com/ad-exchange/buyer-rest +// +// Usage example: +// +// import "google.golang.org/api/adexchangebuyer/v1.2" +// ... +// adexchangebuyerService, err := adexchangebuyer.New(oauthHttpClient) +package adexchangebuyer // import "google.golang.org/api/adexchangebuyer/v1.2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Accounts *AccountsService + + Creatives *CreativesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 +} + +// Account: Configuration data for an Ad Exchange buyer account. +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"` + + // MaximumActiveCreatives: The maximum number of active creatives that + // an account can have, where a creative is active if it was inserted or + // bid with in the last 30 days. Please contact your technical account + // manager if you need to change this. + MaximumActiveCreatives int64 `json:"maximumActiveCreatives,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"` + + // NumberActiveCreatives: The number of creatives that this account + // inserted or bid with in the last 30 days. + NumberActiveCreatives int64 `json:"numberActiveCreatives,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BidderLocation") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Account) MarshalJSON() ([]byte, error) { + type noMethod Account + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "MaximumQps") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountBidderLocation) MarshalJSON() ([]byte, error) { + type noMethod AccountBidderLocation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountsList: 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. +type AccountsList struct { + // Items: A list of accounts. + Items []*Account `json:"items,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountsList) MarshalJSON() ([]byte, error) { + type noMethod AccountsList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Creative: A creative and its classification data. +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"` + + // ApiUploadTimestamp: The last upload timestamp of this creative if it + // was uploaded via API. Read-only. The value of this field is + // generated, and will be ignored for uploads. (formatted RFC 3339 + // timestamp). + ApiUploadTimestamp string `json:"api_upload_timestamp,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"` + + // 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"` + + // ImpressionTrackingUrl: The set of urls to be called to record an + // impression. + ImpressionTrackingUrl []string `json:"impressionTrackingUrl,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"` + + // Version: The version for this creative. Read-only. This field should + // not be set in requests. + Version int64 `json:"version,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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "HTMLSnippet") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Creative) MarshalJSON() ([]byte, error) { + type noMethod Creative + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Details") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeCorrections) MarshalJSON() ([]byte, error) { + type noMethod CreativeCorrections + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Details") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeDisapprovalReasons) MarshalJSON() ([]byte, error) { + type noMethod CreativeDisapprovalReasons + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeFilteringReasons: The filtering reasons for the creative. +// Read-only. This field should not be set in requests. +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"` + + // ForceSendFields is a list of field names (e.g. "Date") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeFilteringReasons) MarshalJSON() ([]byte, error) { + type noMethod CreativeFilteringReasons + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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 the + // creative-status-codes.txt file for different statuses. + FilteringStatus int64 `json:"filteringStatus,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FilteringCount") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeFilteringReasonsReasons) MarshalJSON() ([]byte, error) { + type noMethod CreativeFilteringReasonsReasons + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativesList: 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. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativesList) MarshalJSON() ([]byte, error) { + type noMethod CreativesList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "adexchangebuyer.accounts.get": + +type AccountsGetCall struct { + s *Service + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.accounts.get" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsGetCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.accounts.list" call. +// Exactly one of *AccountsList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AccountsList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsListCall) Do() (*AccountsList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountsList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsPatchCall) Fields(s ...googleapi.Field) *AccountsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsPatchCall) Context(ctx context.Context) *AccountsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.accounts.patch" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsPatchCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsUpdateCall) Fields(s ...googleapi.Field) *AccountsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsUpdateCall) Context(ctx context.Context) *AccountsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.accounts.update" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsUpdateCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativesGetCall) Fields(s ...googleapi.Field) *CreativesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativesGetCall) IfNoneMatch(entityTag string) *CreativesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativesGetCall) Context(ctx context.Context) *CreativesGetCall { + c.ctx_ = ctx + return c +} + +func (c *CreativesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "creatives/{accountId}/{buyerCreativeId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": strconv.FormatInt(c.accountId, 10), + "buyerCreativeId": c.buyerCreativeId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.creatives.get" call. +// Exactly one of *Creative or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Creative.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CreativesGetCall) Do() (*Creative, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Creative{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativesInsertCall) Fields(s ...googleapi.Field) *CreativesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativesInsertCall) Context(ctx context.Context) *CreativesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CreativesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "creatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.creatives.insert" call. +// Exactly one of *Creative or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Creative.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CreativesInsertCall) Do() (*Creative, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Creative{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "approved" - Creatives which have been approved. +// "disapproved" - Creatives which have been disapproved. +// "not_checked" - Creatives whose status is not yet checked. +func (c *CreativesListCall) StatusFilter(statusFilter string) *CreativesListCall { + c.opt_["statusFilter"] = statusFilter + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativesListCall) Fields(s ...googleapi.Field) *CreativesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativesListCall) IfNoneMatch(entityTag string) *CreativesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativesListCall) Context(ctx context.Context) *CreativesListCall { + c.ctx_ = ctx + return c +} + +func (c *CreativesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "creatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.creatives.list" call. +// Exactly one of *CreativesList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativesList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativesListCall) Do() (*CreativesList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativesList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/adexchangebuyer/v1.3/adexchangebuyer-api.json b/Godeps/_workspace/src/google.golang.org/api/adexchangebuyer/v1.3/adexchangebuyer-api.json new file mode 100644 index 000000000..068e18ce8 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/adexchangebuyer/v1.3/adexchangebuyer-api.json @@ -0,0 +1,1655 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/s43VGxh95gMJhn2XULgCPUEFl2w\"", + "discoveryVersion": "v1", + "id": "adexchangebuyer:v1.3", + "name": "adexchangebuyer", + "canonicalName": "Ad Exchange Buyer", + "version": "v1.3", + "revision": "20150909", + "title": "Ad Exchange Buyer API", + "description": "Accesses your bidding-account information, submits creatives for validation, finds available direct deals, and retrieves performance reports.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/ad-exchange/buyer-rest", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/adexchangebuyer/v1.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" + }, + "maximumActiveCreatives": { + "type": "integer", + "description": "The maximum number of active creatives that an account can have, where a creative is active if it was inserted or bid with in the last 30 days. Please contact your technical account manager if you need to change this.", + "format": "int32" + }, + "maximumTotalQps": { + "type": "integer", + "description": "The sum of all bidderLocation.maximumQps values cannot exceed this. Please contact your technical account manager if you need to change this.", + "format": "int32" + }, + "numberActiveCreatives": { + "type": "integer", + "description": "The number of creatives that this account inserted or bid with in the last 30 days.", + "format": "int32" + } + } + }, + "AccountsList": { + "id": "AccountsList", + "type": "object", + "description": "An account feed lists Ad Exchange buyer accounts that the user has access to. Each entry in the feed corresponds to a single buyer account.", + "properties": { + "items": { + "type": "array", + "description": "A list of accounts.", + "items": { + "$ref": "Account" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#accountsList" + } + } + }, + "BillingInfo": { + "id": "BillingInfo", + "type": "object", + "description": "The configuration data for an Ad Exchange billing info.", + "properties": { + "accountId": { + "type": "integer", + "description": "Account id.", + "format": "int32" + }, + "accountName": { + "type": "string", + "description": "Account name." + }, + "billingId": { + "type": "array", + "description": "A list of adgroup IDs associated with this particular account. These IDs may show up as part of a realtime bidding BidRequest, which indicates a bid request for this account.", + "items": { + "type": "string" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#billingInfo" + } + } + }, + "BillingInfoList": { + "id": "BillingInfoList", + "type": "object", + "description": "A billing info feed lists Billing Info the Ad Exchange buyer account has access to. Each entry in the feed corresponds to a single billing info.", + "properties": { + "items": { + "type": "array", + "description": "A list of billing info relevant for your account.", + "items": { + "$ref": "BillingInfo" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#billingInfoList" + } + } + }, + "Budget": { + "id": "Budget", + "type": "object", + "description": "The configuration data for Ad Exchange RTB - Budget API.", + "properties": { + "accountId": { + "type": "string", + "description": "The id of the account. This is required for get and update requests.", + "format": "int64" + }, + "billingId": { + "type": "string", + "description": "The billing id to determine which adgroup to provide budget information for. This is required for get and update requests.", + "format": "int64" + }, + "budgetAmount": { + "type": "string", + "description": "The budget amount to apply for the billingId provided. This is required for update requests.", + "format": "int64" + }, + "currencyCode": { + "type": "string", + "description": "The currency code for the buyer. This cannot be altered here." + }, + "id": { + "type": "string", + "description": "The unique id that describes this item." + }, + "kind": { + "type": "string", + "description": "The kind of the resource, i.e. \"adexchangebuyer#budget\".", + "default": "adexchangebuyer#budget" + } + } + }, + "Creative": { + "id": "Creative", + "type": "object", + "description": "A creative and its classification data.", + "properties": { + "HTMLSnippet": { + "type": "string", + "description": "The HTML snippet that displays the ad when inserted in the web page. If set, videoURL should not be set." + }, + "accountId": { + "type": "integer", + "description": "Account id.", + "format": "int32", + "annotations": { + "required": [ + "adexchangebuyer.creatives.insert" + ] + } + }, + "advertiserId": { + "type": "array", + "description": "Detected advertiser id, if any. Read-only. This field should not be set in requests.", + "items": { + "type": "string", + "format": "int64" + } + }, + "advertiserName": { + "type": "string", + "description": "The name of the company being advertised in the creative.", + "annotations": { + "required": [ + "adexchangebuyer.creatives.insert" + ] + } + }, + "agencyId": { + "type": "string", + "description": "The agency id for this creative.", + "format": "int64" + }, + "api_upload_timestamp": { + "type": "string", + "description": "The last upload timestamp of this creative if it was uploaded via API. Read-only. The value of this field is generated, and will be ignored for uploads. (formatted RFC 3339 timestamp).", + "format": "date-time" + }, + "attribute": { + "type": "array", + "description": "All attributes for the ads that may be shown from this snippet.", + "items": { + "type": "integer", + "format": "int32" + } + }, + "buyerCreativeId": { + "type": "string", + "description": "A buyer-specific id identifying the creative in this ad.", + "annotations": { + "required": [ + "adexchangebuyer.creatives.insert" + ] + } + }, + "clickThroughUrl": { + "type": "array", + "description": "The set of destination urls for the snippet.", + "items": { + "type": "string" + }, + "annotations": { + "required": [ + "adexchangebuyer.creatives.insert" + ] + } + }, + "corrections": { + "type": "array", + "description": "Shows any corrections that were applied to this creative. Read-only. This field should not be set in requests.", + "items": { + "type": "object", + "properties": { + "details": { + "type": "array", + "description": "Additional details about the correction.", + "items": { + "type": "string" + } + }, + "reason": { + "type": "string", + "description": "The type of correction that was applied to the creative." + } + } + } + }, + "disapprovalReasons": { + "type": "array", + "description": "The reasons for disapproval, if any. Note that not all disapproval reasons may be categorized, so it is possible for the creative to have a status of DISAPPROVED with an empty list for disapproval_reasons. In this case, please reach out to your TAM to help debug the issue. Read-only. This field should not be set in requests.", + "items": { + "type": "object", + "properties": { + "details": { + "type": "array", + "description": "Additional details about the reason for disapproval.", + "items": { + "type": "string" + } + }, + "reason": { + "type": "string", + "description": "The categorized reason for disapproval." + } + } + } + }, + "filteringReasons": { + "type": "object", + "description": "The filtering reasons for the creative. Read-only. This field should not be set in requests.", + "properties": { + "date": { + "type": "string", + "description": "The date in ISO 8601 format for the data. The data is collected from 00:00:00 to 23:59:59 in PST." + }, + "reasons": { + "type": "array", + "description": "The filtering reasons.", + "items": { + "type": "object", + "properties": { + "filteringCount": { + "type": "string", + "description": "The number of times the creative was filtered for the status. The count is aggregated across all publishers on the exchange.", + "format": "int64" + }, + "filteringStatus": { + "type": "integer", + "description": "The filtering status code. Please refer to the creative-status-codes.txt file for different statuses.", + "format": "int32" + } + } + } + } + } + }, + "height": { + "type": "integer", + "description": "Ad height.", + "format": "int32", + "annotations": { + "required": [ + "adexchangebuyer.creatives.insert" + ] + } + }, + "impressionTrackingUrl": { + "type": "array", + "description": "The set of urls to be called to record an impression.", + "items": { + "type": "string" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#creative" + }, + "nativeAd": { + "type": "object", + "description": "If nativeAd is set, HTMLSnippet and videoURL should not be set.", + "properties": { + "advertiser": { + "type": "string" + }, + "appIcon": { + "type": "object", + "description": "The app icon, for app download ads.", + "properties": { + "height": { + "type": "integer", + "format": "int32" + }, + "url": { + "type": "string" + }, + "width": { + "type": "integer", + "format": "int32" + } + } + }, + "body": { + "type": "string", + "description": "A long description of the ad." + }, + "callToAction": { + "type": "string", + "description": "A label for the button that the user is supposed to click." + }, + "clickTrackingUrl": { + "type": "string", + "description": "The URL to use for click tracking." + }, + "headline": { + "type": "string", + "description": "A short title for the ad." + }, + "image": { + "type": "object", + "description": "A large image.", + "properties": { + "height": { + "type": "integer", + "format": "int32" + }, + "url": { + "type": "string" + }, + "width": { + "type": "integer", + "format": "int32" + } + } + }, + "impressionTrackingUrl": { + "type": "array", + "description": "The URLs are called when the impression is rendered.", + "items": { + "type": "string" + } + }, + "logo": { + "type": "object", + "description": "A smaller image, for the advertiser logo.", + "properties": { + "height": { + "type": "integer", + "format": "int32" + }, + "url": { + "type": "string" + }, + "width": { + "type": "integer", + "format": "int32" + } + } + }, + "price": { + "type": "string", + "description": "The price of the promoted app including the currency info." + }, + "starRating": { + "type": "number", + "description": "The app rating in the app store. Must be in the range [0-5].", + "format": "double" + }, + "store": { + "type": "string", + "description": "The URL to the app store to purchase/download the promoted app." + } + } + }, + "productCategories": { + "type": "array", + "description": "Detected product categories, if any. Read-only. This field should not be set in requests.", + "items": { + "type": "integer", + "format": "int32" + } + }, + "restrictedCategories": { + "type": "array", + "description": "All restricted categories for the ads that may be shown from this snippet.", + "items": { + "type": "integer", + "format": "int32" + } + }, + "sensitiveCategories": { + "type": "array", + "description": "Detected sensitive categories, if any. Read-only. This field should not be set in requests.", + "items": { + "type": "integer", + "format": "int32" + } + }, + "status": { + "type": "string", + "description": "Creative serving status. Read-only. This field should not be set in requests." + }, + "vendorType": { + "type": "array", + "description": "All vendor types for the ads that may be shown from this snippet.", + "items": { + "type": "integer", + "format": "int32" + } + }, + "version": { + "type": "integer", + "description": "The version for this creative. Read-only. This field should not be set in requests.", + "format": "int32" + }, + "videoURL": { + "type": "string", + "description": "The url to fetch a video ad. If set, HTMLSnippet should not be set." + }, + "width": { + "type": "integer", + "description": "Ad width.", + "format": "int32", + "annotations": { + "required": [ + "adexchangebuyer.creatives.insert" + ] + } + } + } + }, + "CreativesList": { + "id": "CreativesList", + "type": "object", + "description": "The creatives feed lists the active creatives for the Ad Exchange buyer accounts that the user has access to. Each entry in the feed corresponds to a single creative.", + "properties": { + "items": { + "type": "array", + "description": "A list of creatives.", + "items": { + "$ref": "Creative" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#creativesList" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through creatives. To retrieve the next page of results, set the next request's \"pageToken\" value to this." + } + } + }, + "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" + }, + "publisherBlocksOverriden": { + "type": "boolean", + "description": "If true, the publisher has opted to have their blocks ignored when a creative is bid with for this deal." + }, + "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.", + "properties": { + "bidRate": { + "type": "number", + "description": "The number of bid responses with an ad.", + "format": "double" + }, + "bidRequestRate": { + "type": "number", + "description": "The number of bid requests sent to your bidder.", + "format": "double" + }, + "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" + } + }, + "filteredBidRate": { + "type": "number", + "description": "The number of bid responses that were filtered due to a policy violation or other errors.", + "format": "double" + }, + "hostedMatchStatusRate": { + "type": "array", + "description": "Average QPS for hosted match operations.", + "items": { + "type": "any" + } + }, + "inventoryMatchRate": { + "type": "number", + "description": "The number of potential queries based on your pretargeting settings.", + "format": "double" + }, + "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." + }, + "successfulRequestRate": { + "type": "number", + "description": "The number of properly formed bid responses received by our servers within the deadline.", + "format": "double" + }, + "timestamp": { + "type": "string", + "description": "The unix timestamp of the starting time of this performance data.", + "format": "int64" + }, + "unsuccessfulRequestRate": { + "type": "number", + "description": "The number of bid responses that were unsuccessful due to timeouts, incorrect formatting, etc.", + "format": "double" + } + } + }, + "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" + } + } + } + }, + "PretargetingConfig": { + "id": "PretargetingConfig", + "type": "object", + "properties": { + "billingId": { + "type": "string", + "description": "The id for billing purposes, provided for reference. Leave this field blank for insert requests; the id will be generated automatically.", + "format": "int64" + }, + "configId": { + "type": "string", + "description": "The config id; generated automatically. Leave this field blank for insert requests.", + "format": "int64" + }, + "configName": { + "type": "string", + "description": "The name of the config. Must be unique. Required for all requests." + }, + "creativeType": { + "type": "array", + "description": "List must contain exactly one of PRETARGETING_CREATIVE_TYPE_HTML or PRETARGETING_CREATIVE_TYPE_VIDEO.", + "items": { + "type": "string" + } + }, + "dimensions": { + "type": "array", + "description": "Requests which allow one of these (width, height) pairs will match. All pairs must be supported ad dimensions.", + "items": { + "type": "object", + "properties": { + "height": { + "type": "string", + "description": "Height in pixels.", + "format": "int64" + }, + "width": { + "type": "string", + "description": "Width in pixels.", + "format": "int64" + } + } + } + }, + "excludedContentLabels": { + "type": "array", + "description": "Requests with any of these content labels will not match. Values are from content-labels.txt in the downloadable files section.", + "items": { + "type": "string", + "format": "int64" + } + }, + "excludedGeoCriteriaIds": { + "type": "array", + "description": "Requests containing any of these geo criteria ids will not match.", + "items": { + "type": "string", + "format": "int64" + } + }, + "excludedPlacements": { + "type": "array", + "description": "Requests containing any of these placements will not match.", + "items": { + "type": "object", + "properties": { + "token": { + "type": "string", + "description": "The value of the placement. Interpretation depends on the placement type, e.g. URL for a site placement, channel name for a channel placement, app id for a mobile app placement." + }, + "type": { + "type": "string", + "description": "The type of the placement." + } + } + } + }, + "excludedUserLists": { + "type": "array", + "description": "Requests containing any of these users list ids will not match.", + "items": { + "type": "string", + "format": "int64" + } + }, + "excludedVerticals": { + "type": "array", + "description": "Requests containing any of these vertical ids will not match. Values are from the publisher-verticals.txt file in the downloadable files section.", + "items": { + "type": "string", + "format": "int64" + } + }, + "geoCriteriaIds": { + "type": "array", + "description": "Requests containing any of these geo criteria ids will match.", + "items": { + "type": "string", + "format": "int64" + } + }, + "isActive": { + "type": "boolean", + "description": "Whether this config is active. Required for all requests." + }, + "kind": { + "type": "string", + "description": "The kind of the resource, i.e. \"adexchangebuyer#pretargetingConfig\".", + "default": "adexchangebuyer#pretargetingConfig" + }, + "languages": { + "type": "array", + "description": "Request containing any of these language codes will match.", + "items": { + "type": "string" + } + }, + "mobileCarriers": { + "type": "array", + "description": "Requests containing any of these mobile carrier ids will match. Values are from mobile-carriers.csv in the downloadable files section.", + "items": { + "type": "string", + "format": "int64" + } + }, + "mobileDevices": { + "type": "array", + "description": "Requests containing any of these mobile device ids will match. Values are from mobile-devices.csv in the downloadable files section.", + "items": { + "type": "string", + "format": "int64" + } + }, + "mobileOperatingSystemVersions": { + "type": "array", + "description": "Requests containing any of these mobile operating system version ids will match. Values are from mobile-os.csv in the downloadable files section.", + "items": { + "type": "string", + "format": "int64" + } + }, + "placements": { + "type": "array", + "description": "Requests containing any of these placements will match.", + "items": { + "type": "object", + "properties": { + "token": { + "type": "string", + "description": "The value of the placement. Interpretation depends on the placement type, e.g. URL for a site placement, channel name for a channel placement, app id for a mobile app placement." + }, + "type": { + "type": "string", + "description": "The type of the placement." + } + } + } + }, + "platforms": { + "type": "array", + "description": "Requests matching any of these platforms will match. Possible values are PRETARGETING_PLATFORM_MOBILE, PRETARGETING_PLATFORM_DESKTOP, and PRETARGETING_PLATFORM_TABLET.", + "items": { + "type": "string" + } + }, + "supportedCreativeAttributes": { + "type": "array", + "description": "Creative attributes should be declared here if all creatives corresponding to this pretargeting configuration have that creative attribute. Values are from pretargetable-creative-attributes.txt in the downloadable files section.", + "items": { + "type": "string", + "format": "int64" + } + }, + "userLists": { + "type": "array", + "description": "Requests containing any of these user list ids will match.", + "items": { + "type": "string", + "format": "int64" + } + }, + "vendorTypes": { + "type": "array", + "description": "Requests that allow any of these vendor ids will match. Values are from vendors.txt in the downloadable files section.", + "items": { + "type": "string", + "format": "int64" + } + }, + "verticals": { + "type": "array", + "description": "Requests containing any of these vertical ids will match.", + "items": { + "type": "string", + "format": "int64" + } + } + } + }, + "PretargetingConfigList": { + "id": "PretargetingConfigList", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "A list of pretargeting configs", + "items": { + "$ref": "PretargetingConfig" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#pretargetingConfigList" + } + } + } + }, + "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" + ] + } + } + }, + "billingInfo": { + "methods": { + "get": { + "id": "adexchangebuyer.billingInfo.get", + "path": "billinginfo/{accountId}", + "httpMethod": "GET", + "description": "Returns the billing information for one account specified by account ID.", + "parameters": { + "accountId": { + "type": "integer", + "description": "The account id.", + "required": true, + "format": "int32", + "location": "path" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "BillingInfo" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "list": { + "id": "adexchangebuyer.billingInfo.list", + "path": "billinginfo", + "httpMethod": "GET", + "description": "Retrieves a list of billing information for all accounts of the authenticated user.", + "response": { + "$ref": "BillingInfoList" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + } + } + }, + "budget": { + "methods": { + "get": { + "id": "adexchangebuyer.budget.get", + "path": "billinginfo/{accountId}/{billingId}", + "httpMethod": "GET", + "description": "Returns the budget information for the adgroup specified by the accountId and billingId.", + "parameters": { + "accountId": { + "type": "string", + "description": "The account id to get the budget information for.", + "required": true, + "format": "int64", + "location": "path" + }, + "billingId": { + "type": "string", + "description": "The billing id to get the budget information for.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "billingId" + ], + "response": { + "$ref": "Budget" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "patch": { + "id": "adexchangebuyer.budget.patch", + "path": "billinginfo/{accountId}/{billingId}", + "httpMethod": "PATCH", + "description": "Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request. This method supports patch semantics.", + "parameters": { + "accountId": { + "type": "string", + "description": "The account id associated with the budget being updated.", + "required": true, + "format": "int64", + "location": "path" + }, + "billingId": { + "type": "string", + "description": "The billing id associated with the budget being updated.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "billingId" + ], + "request": { + "$ref": "Budget" + }, + "response": { + "$ref": "Budget" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "update": { + "id": "adexchangebuyer.budget.update", + "path": "billinginfo/{accountId}/{billingId}", + "httpMethod": "PUT", + "description": "Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request.", + "parameters": { + "accountId": { + "type": "string", + "description": "The account id associated with the budget being updated.", + "required": true, + "format": "int64", + "location": "path" + }, + "billingId": { + "type": "string", + "description": "The billing id associated with the budget being updated.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "billingId" + ], + "request": { + "$ref": "Budget" + }, + "response": { + "$ref": "Budget" + }, + "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": { + "accountId": { + "type": "integer", + "description": "When specified, only creatives for the given account ids are returned.", + "format": "int32", + "repeated": true, + "location": "query" + }, + "buyerCreativeId": { + "type": "string", + "description": "When specified, only creatives for the given buyer creative ids are returned.", + "repeated": 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 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" + ] + } + } + }, + "pretargetingConfig": { + "methods": { + "delete": { + "id": "adexchangebuyer.pretargetingConfig.delete", + "path": "pretargetingconfigs/{accountId}/{configId}", + "httpMethod": "DELETE", + "description": "Deletes an existing pretargeting config.", + "parameters": { + "accountId": { + "type": "string", + "description": "The account id to delete the pretargeting config for.", + "required": true, + "format": "int64", + "location": "path" + }, + "configId": { + "type": "string", + "description": "The specific id of the configuration to delete.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "configId" + ], + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "get": { + "id": "adexchangebuyer.pretargetingConfig.get", + "path": "pretargetingconfigs/{accountId}/{configId}", + "httpMethod": "GET", + "description": "Gets a specific pretargeting configuration", + "parameters": { + "accountId": { + "type": "string", + "description": "The account id to get the pretargeting config for.", + "required": true, + "format": "int64", + "location": "path" + }, + "configId": { + "type": "string", + "description": "The specific id of the configuration to retrieve.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "configId" + ], + "response": { + "$ref": "PretargetingConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "insert": { + "id": "adexchangebuyer.pretargetingConfig.insert", + "path": "pretargetingconfigs/{accountId}", + "httpMethod": "POST", + "description": "Inserts a new pretargeting configuration.", + "parameters": { + "accountId": { + "type": "string", + "description": "The account id to insert the pretargeting config for.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "accountId" + ], + "request": { + "$ref": "PretargetingConfig" + }, + "response": { + "$ref": "PretargetingConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "list": { + "id": "adexchangebuyer.pretargetingConfig.list", + "path": "pretargetingconfigs/{accountId}", + "httpMethod": "GET", + "description": "Retrieves a list of the authenticated user's pretargeting configurations.", + "parameters": { + "accountId": { + "type": "string", + "description": "The account id to get the pretargeting configs for.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "PretargetingConfigList" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "patch": { + "id": "adexchangebuyer.pretargetingConfig.patch", + "path": "pretargetingconfigs/{accountId}/{configId}", + "httpMethod": "PATCH", + "description": "Updates an existing pretargeting config. This method supports patch semantics.", + "parameters": { + "accountId": { + "type": "string", + "description": "The account id to update the pretargeting config for.", + "required": true, + "format": "int64", + "location": "path" + }, + "configId": { + "type": "string", + "description": "The specific id of the configuration to update.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "configId" + ], + "request": { + "$ref": "PretargetingConfig" + }, + "response": { + "$ref": "PretargetingConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "update": { + "id": "adexchangebuyer.pretargetingConfig.update", + "path": "pretargetingconfigs/{accountId}/{configId}", + "httpMethod": "PUT", + "description": "Updates an existing pretargeting config.", + "parameters": { + "accountId": { + "type": "string", + "description": "The account id to update the pretargeting config for.", + "required": true, + "format": "int64", + "location": "path" + }, + "configId": { + "type": "string", + "description": "The specific id of the configuration to update.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "configId" + ], + "request": { + "$ref": "PretargetingConfig" + }, + "response": { + "$ref": "PretargetingConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/adexchangebuyer/v1.3/adexchangebuyer-gen.go b/Godeps/_workspace/src/google.golang.org/api/adexchangebuyer/v1.3/adexchangebuyer-gen.go new file mode 100644 index 000000000..41dd75895 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/adexchangebuyer/v1.3/adexchangebuyer-gen.go @@ -0,0 +1,3978 @@ +// Package adexchangebuyer provides access to the Ad Exchange Buyer API. +// +// See https://developers.google.com/ad-exchange/buyer-rest +// +// Usage example: +// +// import "google.golang.org/api/adexchangebuyer/v1.3" +// ... +// adexchangebuyerService, err := adexchangebuyer.New(oauthHttpClient) +package adexchangebuyer // import "google.golang.org/api/adexchangebuyer/v1.3" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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.BillingInfo = NewBillingInfoService(s) + s.Budget = NewBudgetService(s) + s.Creatives = NewCreativesService(s) + s.DirectDeals = NewDirectDealsService(s) + s.PerformanceReport = NewPerformanceReportService(s) + s.PretargetingConfig = NewPretargetingConfigService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Accounts *AccountsService + + BillingInfo *BillingInfoService + + Budget *BudgetService + + Creatives *CreativesService + + DirectDeals *DirectDealsService + + PerformanceReport *PerformanceReportService + + PretargetingConfig *PretargetingConfigService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + return rs +} + +type AccountsService struct { + s *Service +} + +func NewBillingInfoService(s *Service) *BillingInfoService { + rs := &BillingInfoService{s: s} + return rs +} + +type BillingInfoService struct { + s *Service +} + +func NewBudgetService(s *Service) *BudgetService { + rs := &BudgetService{s: s} + return rs +} + +type BudgetService 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 +} + +func NewPretargetingConfigService(s *Service) *PretargetingConfigService { + rs := &PretargetingConfigService{s: s} + return rs +} + +type PretargetingConfigService struct { + s *Service +} + +// Account: Configuration data for an Ad Exchange buyer account. +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"` + + // MaximumActiveCreatives: The maximum number of active creatives that + // an account can have, where a creative is active if it was inserted or + // bid with in the last 30 days. Please contact your technical account + // manager if you need to change this. + MaximumActiveCreatives int64 `json:"maximumActiveCreatives,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"` + + // NumberActiveCreatives: The number of creatives that this account + // inserted or bid with in the last 30 days. + NumberActiveCreatives int64 `json:"numberActiveCreatives,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BidderLocation") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Account) MarshalJSON() ([]byte, error) { + type noMethod Account + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "MaximumQps") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountBidderLocation) MarshalJSON() ([]byte, error) { + type noMethod AccountBidderLocation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountsList: 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. +type AccountsList struct { + // Items: A list of accounts. + Items []*Account `json:"items,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountsList) MarshalJSON() ([]byte, error) { + type noMethod AccountsList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BillingInfo: The configuration data for an Ad Exchange billing info. +type BillingInfo struct { + // AccountId: Account id. + AccountId int64 `json:"accountId,omitempty"` + + // AccountName: Account name. + AccountName string `json:"accountName,omitempty"` + + // BillingId: A list of adgroup IDs associated with this particular + // account. These IDs may show up as part of a realtime bidding + // BidRequest, which indicates a bid request for this account. + BillingId []string `json:"billingId,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BillingInfo) MarshalJSON() ([]byte, error) { + type noMethod BillingInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BillingInfoList: A billing info feed lists Billing Info the Ad +// Exchange buyer account has access to. Each entry in the feed +// corresponds to a single billing info. +type BillingInfoList struct { + // Items: A list of billing info relevant for your account. + Items []*BillingInfo `json:"items,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BillingInfoList) MarshalJSON() ([]byte, error) { + type noMethod BillingInfoList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Budget: The configuration data for Ad Exchange RTB - Budget API. +type Budget struct { + // AccountId: The id of the account. This is required for get and update + // requests. + AccountId int64 `json:"accountId,omitempty,string"` + + // BillingId: The billing id to determine which adgroup to provide + // budget information for. This is required for get and update requests. + BillingId int64 `json:"billingId,omitempty,string"` + + // BudgetAmount: The budget amount to apply for the billingId provided. + // This is required for update requests. + BudgetAmount int64 `json:"budgetAmount,omitempty,string"` + + // CurrencyCode: The currency code for the buyer. This cannot be altered + // here. + CurrencyCode string `json:"currencyCode,omitempty"` + + // Id: The unique id that describes this item. + Id string `json:"id,omitempty"` + + // Kind: The kind of the resource, i.e. "adexchangebuyer#budget". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Budget) MarshalJSON() ([]byte, error) { + type noMethod Budget + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Creative: A creative and its classification data. +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"` + + // ApiUploadTimestamp: The last upload timestamp of this creative if it + // was uploaded via API. Read-only. The value of this field is + // generated, and will be ignored for uploads. (formatted RFC 3339 + // timestamp). + ApiUploadTimestamp string `json:"api_upload_timestamp,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"` + + // 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"` + + // ImpressionTrackingUrl: The set of urls to be called to record an + // impression. + ImpressionTrackingUrl []string `json:"impressionTrackingUrl,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // NativeAd: If nativeAd is set, HTMLSnippet and videoURL should not be + // set. + NativeAd *CreativeNativeAd `json:"nativeAd,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"` + + // Version: The version for this creative. Read-only. This field should + // not be set in requests. + Version int64 `json:"version,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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "HTMLSnippet") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Creative) MarshalJSON() ([]byte, error) { + type noMethod Creative + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Details") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeCorrections) MarshalJSON() ([]byte, error) { + type noMethod CreativeCorrections + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Details") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeDisapprovalReasons) MarshalJSON() ([]byte, error) { + type noMethod CreativeDisapprovalReasons + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeFilteringReasons: The filtering reasons for the creative. +// Read-only. This field should not be set in requests. +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"` + + // ForceSendFields is a list of field names (e.g. "Date") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeFilteringReasons) MarshalJSON() ([]byte, error) { + type noMethod CreativeFilteringReasons + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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 the + // creative-status-codes.txt file for different statuses. + FilteringStatus int64 `json:"filteringStatus,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FilteringCount") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeFilteringReasonsReasons) MarshalJSON() ([]byte, error) { + type noMethod CreativeFilteringReasonsReasons + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeNativeAd: If nativeAd is set, HTMLSnippet and videoURL should +// not be set. +type CreativeNativeAd struct { + Advertiser string `json:"advertiser,omitempty"` + + // AppIcon: The app icon, for app download ads. + AppIcon *CreativeNativeAdAppIcon `json:"appIcon,omitempty"` + + // Body: A long description of the ad. + Body string `json:"body,omitempty"` + + // CallToAction: A label for the button that the user is supposed to + // click. + CallToAction string `json:"callToAction,omitempty"` + + // ClickTrackingUrl: The URL to use for click tracking. + ClickTrackingUrl string `json:"clickTrackingUrl,omitempty"` + + // Headline: A short title for the ad. + Headline string `json:"headline,omitempty"` + + // Image: A large image. + Image *CreativeNativeAdImage `json:"image,omitempty"` + + // ImpressionTrackingUrl: The URLs are called when the impression is + // rendered. + ImpressionTrackingUrl []string `json:"impressionTrackingUrl,omitempty"` + + // Logo: A smaller image, for the advertiser logo. + Logo *CreativeNativeAdLogo `json:"logo,omitempty"` + + // Price: The price of the promoted app including the currency info. + Price string `json:"price,omitempty"` + + // StarRating: The app rating in the app store. Must be in the range + // [0-5]. + StarRating float64 `json:"starRating,omitempty"` + + // Store: The URL to the app store to purchase/download the promoted + // app. + Store string `json:"store,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Advertiser") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeNativeAd) MarshalJSON() ([]byte, error) { + type noMethod CreativeNativeAd + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeNativeAdAppIcon: The app icon, for app download ads. +type CreativeNativeAdAppIcon struct { + Height int64 `json:"height,omitempty"` + + Url string `json:"url,omitempty"` + + Width int64 `json:"width,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeNativeAdAppIcon) MarshalJSON() ([]byte, error) { + type noMethod CreativeNativeAdAppIcon + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeNativeAdImage: A large image. +type CreativeNativeAdImage struct { + Height int64 `json:"height,omitempty"` + + Url string `json:"url,omitempty"` + + Width int64 `json:"width,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeNativeAdImage) MarshalJSON() ([]byte, error) { + type noMethod CreativeNativeAdImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeNativeAdLogo: A smaller image, for the advertiser logo. +type CreativeNativeAdLogo struct { + Height int64 `json:"height,omitempty"` + + Url string `json:"url,omitempty"` + + Width int64 `json:"width,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeNativeAdLogo) MarshalJSON() ([]byte, error) { + type noMethod CreativeNativeAdLogo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativesList: 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. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativesList) MarshalJSON() ([]byte, error) { + type noMethod CreativesList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DirectDeal: The configuration data for an Ad Exchange direct deal. +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"` + + // PublisherBlocksOverriden: If true, the publisher has opted to have + // their blocks ignored when a creative is bid with for this deal. + PublisherBlocksOverriden bool `json:"publisherBlocksOverriden,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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DirectDeal) MarshalJSON() ([]byte, error) { + type noMethod DirectDeal + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DirectDealsList: 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. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DirectDeals") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DirectDealsList) MarshalJSON() ([]byte, error) { + type noMethod DirectDealsList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PerformanceReport: The configuration data for an Ad Exchange +// performance report list. +type PerformanceReport struct { + // BidRate: The number of bid responses with an ad. + BidRate float64 `json:"bidRate,omitempty"` + + // BidRequestRate: The number of bid requests sent to your bidder. + BidRequestRate float64 `json:"bidRequestRate,omitempty"` + + // 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"` + + // FilteredBidRate: The number of bid responses that were filtered due + // to a policy violation or other errors. + FilteredBidRate float64 `json:"filteredBidRate,omitempty"` + + // HostedMatchStatusRate: Average QPS for hosted match operations. + HostedMatchStatusRate []interface{} `json:"hostedMatchStatusRate,omitempty"` + + // InventoryMatchRate: The number of potential queries based on your + // pretargeting settings. + InventoryMatchRate float64 `json:"inventoryMatchRate,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"` + + // SuccessfulRequestRate: The number of properly formed bid responses + // received by our servers within the deadline. + SuccessfulRequestRate float64 `json:"successfulRequestRate,omitempty"` + + // Timestamp: The unix timestamp of the starting time of this + // performance data. + Timestamp int64 `json:"timestamp,omitempty,string"` + + // UnsuccessfulRequestRate: The number of bid responses that were + // unsuccessful due to timeouts, incorrect formatting, etc. + UnsuccessfulRequestRate float64 `json:"unsuccessfulRequestRate,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BidRate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PerformanceReport) MarshalJSON() ([]byte, error) { + type noMethod PerformanceReport + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PerformanceReportList: 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 +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PerformanceReportList) MarshalJSON() ([]byte, error) { + type noMethod PerformanceReportList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PretargetingConfig struct { + // BillingId: The id for billing purposes, provided for reference. Leave + // this field blank for insert requests; the id will be generated + // automatically. + BillingId int64 `json:"billingId,omitempty,string"` + + // ConfigId: The config id; generated automatically. Leave this field + // blank for insert requests. + ConfigId int64 `json:"configId,omitempty,string"` + + // ConfigName: The name of the config. Must be unique. Required for all + // requests. + ConfigName string `json:"configName,omitempty"` + + // CreativeType: List must contain exactly one of + // PRETARGETING_CREATIVE_TYPE_HTML or PRETARGETING_CREATIVE_TYPE_VIDEO. + CreativeType []string `json:"creativeType,omitempty"` + + // Dimensions: Requests which allow one of these (width, height) pairs + // will match. All pairs must be supported ad dimensions. + Dimensions []*PretargetingConfigDimensions `json:"dimensions,omitempty"` + + // ExcludedContentLabels: Requests with any of these content labels will + // not match. Values are from content-labels.txt in the downloadable + // files section. + ExcludedContentLabels googleapi.Int64s `json:"excludedContentLabels,omitempty"` + + // ExcludedGeoCriteriaIds: Requests containing any of these geo criteria + // ids will not match. + ExcludedGeoCriteriaIds googleapi.Int64s `json:"excludedGeoCriteriaIds,omitempty"` + + // ExcludedPlacements: Requests containing any of these placements will + // not match. + ExcludedPlacements []*PretargetingConfigExcludedPlacements `json:"excludedPlacements,omitempty"` + + // ExcludedUserLists: Requests containing any of these users list ids + // will not match. + ExcludedUserLists googleapi.Int64s `json:"excludedUserLists,omitempty"` + + // ExcludedVerticals: Requests containing any of these vertical ids will + // not match. Values are from the publisher-verticals.txt file in the + // downloadable files section. + ExcludedVerticals googleapi.Int64s `json:"excludedVerticals,omitempty"` + + // GeoCriteriaIds: Requests containing any of these geo criteria ids + // will match. + GeoCriteriaIds googleapi.Int64s `json:"geoCriteriaIds,omitempty"` + + // IsActive: Whether this config is active. Required for all requests. + IsActive bool `json:"isActive,omitempty"` + + // Kind: The kind of the resource, i.e. + // "adexchangebuyer#pretargetingConfig". + Kind string `json:"kind,omitempty"` + + // Languages: Request containing any of these language codes will match. + Languages []string `json:"languages,omitempty"` + + // MobileCarriers: Requests containing any of these mobile carrier ids + // will match. Values are from mobile-carriers.csv in the downloadable + // files section. + MobileCarriers googleapi.Int64s `json:"mobileCarriers,omitempty"` + + // MobileDevices: Requests containing any of these mobile device ids + // will match. Values are from mobile-devices.csv in the downloadable + // files section. + MobileDevices googleapi.Int64s `json:"mobileDevices,omitempty"` + + // MobileOperatingSystemVersions: Requests containing any of these + // mobile operating system version ids will match. Values are from + // mobile-os.csv in the downloadable files section. + MobileOperatingSystemVersions googleapi.Int64s `json:"mobileOperatingSystemVersions,omitempty"` + + // Placements: Requests containing any of these placements will match. + Placements []*PretargetingConfigPlacements `json:"placements,omitempty"` + + // Platforms: Requests matching any of these platforms will match. + // Possible values are PRETARGETING_PLATFORM_MOBILE, + // PRETARGETING_PLATFORM_DESKTOP, and PRETARGETING_PLATFORM_TABLET. + Platforms []string `json:"platforms,omitempty"` + + // SupportedCreativeAttributes: Creative attributes should be declared + // here if all creatives corresponding to this pretargeting + // configuration have that creative attribute. Values are from + // pretargetable-creative-attributes.txt in the downloadable files + // section. + SupportedCreativeAttributes googleapi.Int64s `json:"supportedCreativeAttributes,omitempty"` + + // UserLists: Requests containing any of these user list ids will match. + UserLists googleapi.Int64s `json:"userLists,omitempty"` + + // VendorTypes: Requests that allow any of these vendor ids will match. + // Values are from vendors.txt in the downloadable files section. + VendorTypes googleapi.Int64s `json:"vendorTypes,omitempty"` + + // Verticals: Requests containing any of these vertical ids will match. + Verticals googleapi.Int64s `json:"verticals,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BillingId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PretargetingConfig) MarshalJSON() ([]byte, error) { + type noMethod PretargetingConfig + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PretargetingConfigDimensions struct { + // Height: Height in pixels. + Height int64 `json:"height,omitempty,string"` + + // Width: Width in pixels. + Width int64 `json:"width,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PretargetingConfigDimensions) MarshalJSON() ([]byte, error) { + type noMethod PretargetingConfigDimensions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PretargetingConfigExcludedPlacements struct { + // Token: The value of the placement. Interpretation depends on the + // placement type, e.g. URL for a site placement, channel name for a + // channel placement, app id for a mobile app placement. + Token string `json:"token,omitempty"` + + // Type: The type of the placement. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Token") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PretargetingConfigExcludedPlacements) MarshalJSON() ([]byte, error) { + type noMethod PretargetingConfigExcludedPlacements + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PretargetingConfigPlacements struct { + // Token: The value of the placement. Interpretation depends on the + // placement type, e.g. URL for a site placement, channel name for a + // channel placement, app id for a mobile app placement. + Token string `json:"token,omitempty"` + + // Type: The type of the placement. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Token") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PretargetingConfigPlacements) MarshalJSON() ([]byte, error) { + type noMethod PretargetingConfigPlacements + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PretargetingConfigList struct { + // Items: A list of pretargeting configs + Items []*PretargetingConfig `json:"items,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PretargetingConfigList) MarshalJSON() ([]byte, error) { + type noMethod PretargetingConfigList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "adexchangebuyer.accounts.get": + +type AccountsGetCall struct { + s *Service + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.accounts.get" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsGetCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.accounts.list" call. +// Exactly one of *AccountsList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AccountsList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsListCall) Do() (*AccountsList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountsList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsPatchCall) Fields(s ...googleapi.Field) *AccountsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsPatchCall) Context(ctx context.Context) *AccountsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.accounts.patch" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsPatchCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsUpdateCall) Fields(s ...googleapi.Field) *AccountsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsUpdateCall) Context(ctx context.Context) *AccountsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.accounts.update" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsUpdateCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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.billingInfo.get": + +type BillingInfoGetCall struct { + s *Service + accountId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the billing information for one account specified by +// account ID. +func (r *BillingInfoService) Get(accountId int64) *BillingInfoGetCall { + c := &BillingInfoGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BillingInfoGetCall) Fields(s ...googleapi.Field) *BillingInfoGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BillingInfoGetCall) IfNoneMatch(entityTag string) *BillingInfoGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BillingInfoGetCall) Context(ctx context.Context) *BillingInfoGetCall { + c.ctx_ = ctx + return c +} + +func (c *BillingInfoGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": strconv.FormatInt(c.accountId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.billingInfo.get" call. +// Exactly one of *BillingInfo or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *BillingInfo.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *BillingInfoGetCall) Do() (*BillingInfo, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BillingInfo{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the billing information for one account specified by account ID.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.billingInfo.get", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "The account id.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "billinginfo/{accountId}", + // "response": { + // "$ref": "BillingInfo" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.billingInfo.list": + +type BillingInfoListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of billing information for all accounts of the +// authenticated user. +func (r *BillingInfoService) List() *BillingInfoListCall { + c := &BillingInfoListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BillingInfoListCall) Fields(s ...googleapi.Field) *BillingInfoListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BillingInfoListCall) IfNoneMatch(entityTag string) *BillingInfoListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BillingInfoListCall) Context(ctx context.Context) *BillingInfoListCall { + c.ctx_ = ctx + return c +} + +func (c *BillingInfoListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.billingInfo.list" call. +// Exactly one of *BillingInfoList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *BillingInfoList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BillingInfoListCall) Do() (*BillingInfoList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BillingInfoList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of billing information for all accounts of the authenticated user.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.billingInfo.list", + // "path": "billinginfo", + // "response": { + // "$ref": "BillingInfoList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.budget.get": + +type BudgetGetCall struct { + s *Service + accountId int64 + billingId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the budget information for the adgroup specified by the +// accountId and billingId. +func (r *BudgetService) Get(accountId int64, billingId int64) *BudgetGetCall { + c := &BudgetGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.billingId = billingId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BudgetGetCall) Fields(s ...googleapi.Field) *BudgetGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BudgetGetCall) IfNoneMatch(entityTag string) *BudgetGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BudgetGetCall) Context(ctx context.Context) *BudgetGetCall { + c.ctx_ = ctx + return c +} + +func (c *BudgetGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo/{accountId}/{billingId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": strconv.FormatInt(c.accountId, 10), + "billingId": strconv.FormatInt(c.billingId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.budget.get" call. +// Exactly one of *Budget or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Budget.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BudgetGetCall) Do() (*Budget, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Budget{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the budget information for the adgroup specified by the accountId and billingId.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.budget.get", + // "parameterOrder": [ + // "accountId", + // "billingId" + // ], + // "parameters": { + // "accountId": { + // "description": "The account id to get the budget information for.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "billingId": { + // "description": "The billing id to get the budget information for.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "billinginfo/{accountId}/{billingId}", + // "response": { + // "$ref": "Budget" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.budget.patch": + +type BudgetPatchCall struct { + s *Service + accountId int64 + billingId int64 + budget *Budget + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates the budget amount for the budget of the adgroup +// specified by the accountId and billingId, with the budget amount in +// the request. This method supports patch semantics. +func (r *BudgetService) Patch(accountId int64, billingId int64, budget *Budget) *BudgetPatchCall { + c := &BudgetPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.billingId = billingId + c.budget = budget + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BudgetPatchCall) Fields(s ...googleapi.Field) *BudgetPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BudgetPatchCall) Context(ctx context.Context) *BudgetPatchCall { + c.ctx_ = ctx + return c +} + +func (c *BudgetPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.budget) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo/{accountId}/{billingId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": strconv.FormatInt(c.accountId, 10), + "billingId": strconv.FormatInt(c.billingId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.budget.patch" call. +// Exactly one of *Budget or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Budget.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BudgetPatchCall) Do() (*Budget, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Budget{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "adexchangebuyer.budget.patch", + // "parameterOrder": [ + // "accountId", + // "billingId" + // ], + // "parameters": { + // "accountId": { + // "description": "The account id associated with the budget being updated.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "billingId": { + // "description": "The billing id associated with the budget being updated.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "billinginfo/{accountId}/{billingId}", + // "request": { + // "$ref": "Budget" + // }, + // "response": { + // "$ref": "Budget" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.budget.update": + +type BudgetUpdateCall struct { + s *Service + accountId int64 + billingId int64 + budget *Budget + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates the budget amount for the budget of the adgroup +// specified by the accountId and billingId, with the budget amount in +// the request. +func (r *BudgetService) Update(accountId int64, billingId int64, budget *Budget) *BudgetUpdateCall { + c := &BudgetUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.billingId = billingId + c.budget = budget + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BudgetUpdateCall) Fields(s ...googleapi.Field) *BudgetUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BudgetUpdateCall) Context(ctx context.Context) *BudgetUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *BudgetUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.budget) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo/{accountId}/{billingId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": strconv.FormatInt(c.accountId, 10), + "billingId": strconv.FormatInt(c.billingId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.budget.update" call. +// Exactly one of *Budget or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Budget.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BudgetUpdateCall) Do() (*Budget, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Budget{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request.", + // "httpMethod": "PUT", + // "id": "adexchangebuyer.budget.update", + // "parameterOrder": [ + // "accountId", + // "billingId" + // ], + // "parameters": { + // "accountId": { + // "description": "The account id associated with the budget being updated.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "billingId": { + // "description": "The billing id associated with the budget being updated.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "billinginfo/{accountId}/{billingId}", + // "request": { + // "$ref": "Budget" + // }, + // "response": { + // "$ref": "Budget" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativesGetCall) Fields(s ...googleapi.Field) *CreativesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativesGetCall) IfNoneMatch(entityTag string) *CreativesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativesGetCall) Context(ctx context.Context) *CreativesGetCall { + c.ctx_ = ctx + return c +} + +func (c *CreativesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "creatives/{accountId}/{buyerCreativeId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": strconv.FormatInt(c.accountId, 10), + "buyerCreativeId": c.buyerCreativeId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.creatives.get" call. +// Exactly one of *Creative or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Creative.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CreativesGetCall) Do() (*Creative, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Creative{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativesInsertCall) Fields(s ...googleapi.Field) *CreativesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativesInsertCall) Context(ctx context.Context) *CreativesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CreativesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "creatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.creatives.insert" call. +// Exactly one of *Creative or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Creative.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CreativesInsertCall) Do() (*Creative, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Creative{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// AccountId sets the optional parameter "accountId": When specified, +// only creatives for the given account ids are returned. +func (c *CreativesListCall) AccountId(accountId int64) *CreativesListCall { + c.opt_["accountId"] = accountId + return c +} + +// BuyerCreativeId sets the optional parameter "buyerCreativeId": When +// specified, only creatives for the given buyer creative ids are +// returned. +func (c *CreativesListCall) BuyerCreativeId(buyerCreativeId string) *CreativesListCall { + c.opt_["buyerCreativeId"] = buyerCreativeId + 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. +// +// Possible values: +// "approved" - Creatives which have been approved. +// "disapproved" - Creatives which have been disapproved. +// "not_checked" - Creatives whose status is not yet checked. +func (c *CreativesListCall) StatusFilter(statusFilter string) *CreativesListCall { + c.opt_["statusFilter"] = statusFilter + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativesListCall) Fields(s ...googleapi.Field) *CreativesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativesListCall) IfNoneMatch(entityTag string) *CreativesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativesListCall) Context(ctx context.Context) *CreativesListCall { + c.ctx_ = ctx + return c +} + +func (c *CreativesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["accountId"]; ok { + params.Set("accountId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["buyerCreativeId"]; ok { + params.Set("buyerCreativeId", 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_["statusFilter"]; ok { + params.Set("statusFilter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "creatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.creatives.list" call. +// Exactly one of *CreativesList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativesList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativesListCall) Do() (*CreativesList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativesList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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": { + // "accountId": { + // "description": "When specified, only creatives for the given account ids are returned.", + // "format": "int32", + // "location": "query", + // "repeated": true, + // "type": "integer" + // }, + // "buyerCreativeId": { + // "description": "When specified, only creatives for the given buyer creative ids are returned.", + // "location": "query", + // "repeated": 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 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DirectDealsGetCall) Fields(s ...googleapi.Field) *DirectDealsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DirectDealsGetCall) IfNoneMatch(entityTag string) *DirectDealsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DirectDealsGetCall) Context(ctx context.Context) *DirectDealsGetCall { + c.ctx_ = ctx + return c +} + +func (c *DirectDealsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "directdeals/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.directDeals.get" call. +// Exactly one of *DirectDeal or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DirectDeal.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DirectDealsGetCall) Do() (*DirectDeal, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DirectDeal{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DirectDealsListCall) Fields(s ...googleapi.Field) *DirectDealsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DirectDealsListCall) IfNoneMatch(entityTag string) *DirectDealsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DirectDealsListCall) Context(ctx context.Context) *DirectDealsListCall { + c.ctx_ = ctx + return c +} + +func (c *DirectDealsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "directdeals") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.directDeals.list" call. +// Exactly one of *DirectDealsList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DirectDealsList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DirectDealsListCall) Do() (*DirectDealsList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DirectDealsList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PerformanceReportListCall) Fields(s ...googleapi.Field) *PerformanceReportListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PerformanceReportListCall) IfNoneMatch(entityTag string) *PerformanceReportListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PerformanceReportListCall) Context(ctx context.Context) *PerformanceReportListCall { + c.ctx_ = ctx + return c +} + +func (c *PerformanceReportListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.performanceReport.list" call. +// Exactly one of *PerformanceReportList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PerformanceReportList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PerformanceReportListCall) Do() (*PerformanceReportList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PerformanceReportList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the 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" + // ] + // } + +} + +// method id "adexchangebuyer.pretargetingConfig.delete": + +type PretargetingConfigDeleteCall struct { + s *Service + accountId int64 + configId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing pretargeting config. +func (r *PretargetingConfigService) Delete(accountId int64, configId int64) *PretargetingConfigDeleteCall { + c := &PretargetingConfigDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.configId = configId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PretargetingConfigDeleteCall) Fields(s ...googleapi.Field) *PretargetingConfigDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PretargetingConfigDeleteCall) Context(ctx context.Context) *PretargetingConfigDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *PretargetingConfigDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}/{configId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": strconv.FormatInt(c.accountId, 10), + "configId": strconv.FormatInt(c.configId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.pretargetingConfig.delete" call. +func (c *PretargetingConfigDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing pretargeting config.", + // "httpMethod": "DELETE", + // "id": "adexchangebuyer.pretargetingConfig.delete", + // "parameterOrder": [ + // "accountId", + // "configId" + // ], + // "parameters": { + // "accountId": { + // "description": "The account id to delete the pretargeting config for.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "configId": { + // "description": "The specific id of the configuration to delete.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "pretargetingconfigs/{accountId}/{configId}", + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.pretargetingConfig.get": + +type PretargetingConfigGetCall struct { + s *Service + accountId int64 + configId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a specific pretargeting configuration +func (r *PretargetingConfigService) Get(accountId int64, configId int64) *PretargetingConfigGetCall { + c := &PretargetingConfigGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.configId = configId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PretargetingConfigGetCall) Fields(s ...googleapi.Field) *PretargetingConfigGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PretargetingConfigGetCall) IfNoneMatch(entityTag string) *PretargetingConfigGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PretargetingConfigGetCall) Context(ctx context.Context) *PretargetingConfigGetCall { + c.ctx_ = ctx + return c +} + +func (c *PretargetingConfigGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}/{configId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": strconv.FormatInt(c.accountId, 10), + "configId": strconv.FormatInt(c.configId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.pretargetingConfig.get" call. +// Exactly one of *PretargetingConfig or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PretargetingConfig.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PretargetingConfigGetCall) Do() (*PretargetingConfig, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PretargetingConfig{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a specific pretargeting configuration", + // "httpMethod": "GET", + // "id": "adexchangebuyer.pretargetingConfig.get", + // "parameterOrder": [ + // "accountId", + // "configId" + // ], + // "parameters": { + // "accountId": { + // "description": "The account id to get the pretargeting config for.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "configId": { + // "description": "The specific id of the configuration to retrieve.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "pretargetingconfigs/{accountId}/{configId}", + // "response": { + // "$ref": "PretargetingConfig" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.pretargetingConfig.insert": + +type PretargetingConfigInsertCall struct { + s *Service + accountId int64 + pretargetingconfig *PretargetingConfig + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new pretargeting configuration. +func (r *PretargetingConfigService) Insert(accountId int64, pretargetingconfig *PretargetingConfig) *PretargetingConfigInsertCall { + c := &PretargetingConfigInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.pretargetingconfig = pretargetingconfig + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PretargetingConfigInsertCall) Fields(s ...googleapi.Field) *PretargetingConfigInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PretargetingConfigInsertCall) Context(ctx context.Context) *PretargetingConfigInsertCall { + c.ctx_ = ctx + return c +} + +func (c *PretargetingConfigInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.pretargetingconfig) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": strconv.FormatInt(c.accountId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.pretargetingConfig.insert" call. +// Exactly one of *PretargetingConfig or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PretargetingConfig.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PretargetingConfigInsertCall) Do() (*PretargetingConfig, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PretargetingConfig{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new pretargeting configuration.", + // "httpMethod": "POST", + // "id": "adexchangebuyer.pretargetingConfig.insert", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "The account id to insert the pretargeting config for.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "pretargetingconfigs/{accountId}", + // "request": { + // "$ref": "PretargetingConfig" + // }, + // "response": { + // "$ref": "PretargetingConfig" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.pretargetingConfig.list": + +type PretargetingConfigListCall struct { + s *Service + accountId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of the authenticated user's pretargeting +// configurations. +func (r *PretargetingConfigService) List(accountId int64) *PretargetingConfigListCall { + c := &PretargetingConfigListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PretargetingConfigListCall) Fields(s ...googleapi.Field) *PretargetingConfigListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PretargetingConfigListCall) IfNoneMatch(entityTag string) *PretargetingConfigListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PretargetingConfigListCall) Context(ctx context.Context) *PretargetingConfigListCall { + c.ctx_ = ctx + return c +} + +func (c *PretargetingConfigListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": strconv.FormatInt(c.accountId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.pretargetingConfig.list" call. +// Exactly one of *PretargetingConfigList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PretargetingConfigList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PretargetingConfigListCall) Do() (*PretargetingConfigList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PretargetingConfigList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of the authenticated user's pretargeting configurations.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.pretargetingConfig.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "The account id to get the pretargeting configs for.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "pretargetingconfigs/{accountId}", + // "response": { + // "$ref": "PretargetingConfigList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.pretargetingConfig.patch": + +type PretargetingConfigPatchCall struct { + s *Service + accountId int64 + configId int64 + pretargetingconfig *PretargetingConfig + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing pretargeting config. This method supports +// patch semantics. +func (r *PretargetingConfigService) Patch(accountId int64, configId int64, pretargetingconfig *PretargetingConfig) *PretargetingConfigPatchCall { + c := &PretargetingConfigPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.configId = configId + c.pretargetingconfig = pretargetingconfig + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PretargetingConfigPatchCall) Fields(s ...googleapi.Field) *PretargetingConfigPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PretargetingConfigPatchCall) Context(ctx context.Context) *PretargetingConfigPatchCall { + c.ctx_ = ctx + return c +} + +func (c *PretargetingConfigPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.pretargetingconfig) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}/{configId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": strconv.FormatInt(c.accountId, 10), + "configId": strconv.FormatInt(c.configId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.pretargetingConfig.patch" call. +// Exactly one of *PretargetingConfig or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PretargetingConfig.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PretargetingConfigPatchCall) Do() (*PretargetingConfig, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PretargetingConfig{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing pretargeting config. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "adexchangebuyer.pretargetingConfig.patch", + // "parameterOrder": [ + // "accountId", + // "configId" + // ], + // "parameters": { + // "accountId": { + // "description": "The account id to update the pretargeting config for.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "configId": { + // "description": "The specific id of the configuration to update.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "pretargetingconfigs/{accountId}/{configId}", + // "request": { + // "$ref": "PretargetingConfig" + // }, + // "response": { + // "$ref": "PretargetingConfig" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.pretargetingConfig.update": + +type PretargetingConfigUpdateCall struct { + s *Service + accountId int64 + configId int64 + pretargetingconfig *PretargetingConfig + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing pretargeting config. +func (r *PretargetingConfigService) Update(accountId int64, configId int64, pretargetingconfig *PretargetingConfig) *PretargetingConfigUpdateCall { + c := &PretargetingConfigUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.configId = configId + c.pretargetingconfig = pretargetingconfig + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PretargetingConfigUpdateCall) Fields(s ...googleapi.Field) *PretargetingConfigUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PretargetingConfigUpdateCall) Context(ctx context.Context) *PretargetingConfigUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *PretargetingConfigUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.pretargetingconfig) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}/{configId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": strconv.FormatInt(c.accountId, 10), + "configId": strconv.FormatInt(c.configId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.pretargetingConfig.update" call. +// Exactly one of *PretargetingConfig or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PretargetingConfig.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PretargetingConfigUpdateCall) Do() (*PretargetingConfig, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PretargetingConfig{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing pretargeting config.", + // "httpMethod": "PUT", + // "id": "adexchangebuyer.pretargetingConfig.update", + // "parameterOrder": [ + // "accountId", + // "configId" + // ], + // "parameters": { + // "accountId": { + // "description": "The account id to update the pretargeting config for.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "configId": { + // "description": "The specific id of the configuration to update.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "pretargetingconfigs/{accountId}/{configId}", + // "request": { + // "$ref": "PretargetingConfig" + // }, + // "response": { + // "$ref": "PretargetingConfig" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/adexchangebuyer/v1.4/adexchangebuyer-api.json b/Godeps/_workspace/src/google.golang.org/api/adexchangebuyer/v1.4/adexchangebuyer-api.json new file mode 100644 index 000000000..cf0f14b6f --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/adexchangebuyer/v1.4/adexchangebuyer-api.json @@ -0,0 +1,4193 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/e2ZwVjK29RxJqz1-z8CpRPnLiKo\"", + "discoveryVersion": "v1", + "id": "adexchangebuyer:v1.4", + "name": "adexchangebuyer", + "canonicalName": "Ad Exchange Buyer", + "version": "v1.4", + "revision": "20150909", + "title": "Ad Exchange Buyer API", + "description": "Accesses your bidding-account information, submits creatives for validation, finds available direct deals, and retrieves performance reports.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/ad-exchange/buyer-rest", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/adexchangebuyer/v1.4/", + "basePath": "/adexchangebuyer/v1.4/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "adexchangebuyer/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/adexchange.buyer": { + "description": "Manage your Ad Exchange buyer account configuration" + } + } + } + }, + "schemas": { + "Account": { + "id": "Account", + "type": "object", + "description": "Configuration data for an Ad Exchange buyer account.", + "properties": { + "bidderLocation": { + "type": "array", + "description": "Your bidder locations that have distinct URLs.", + "items": { + "type": "object", + "properties": { + "maximumQps": { + "type": "integer", + "description": "The maximum queries per second the Ad Exchange will send.", + "format": "int32" + }, + "region": { + "type": "string", + "description": "The geographical region the Ad Exchange should send requests from. Only used by some quota systems, but always setting the value is recommended. Allowed values: \n- ASIA \n- EUROPE \n- US_EAST \n- US_WEST" + }, + "url": { + "type": "string", + "description": "The URL to which the Ad Exchange will send bid requests." + } + } + } + }, + "cookieMatchingNid": { + "type": "string", + "description": "The nid parameter value used in cookie match requests. Please contact your technical account manager if you need to change this." + }, + "cookieMatchingUrl": { + "type": "string", + "description": "The base URL used in cookie match requests." + }, + "id": { + "type": "integer", + "description": "Account id.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#account" + }, + "maximumActiveCreatives": { + "type": "integer", + "description": "The maximum number of active creatives that an account can have, where a creative is active if it was inserted or bid with in the last 30 days. Please contact your technical account manager if you need to change this.", + "format": "int32" + }, + "maximumTotalQps": { + "type": "integer", + "description": "The sum of all bidderLocation.maximumQps values cannot exceed this. Please contact your technical account manager if you need to change this.", + "format": "int32" + }, + "numberActiveCreatives": { + "type": "integer", + "description": "The number of creatives that this account inserted or bid with in the last 30 days.", + "format": "int32" + } + } + }, + "AccountsList": { + "id": "AccountsList", + "type": "object", + "description": "An account feed lists Ad Exchange buyer accounts that the user has access to. Each entry in the feed corresponds to a single buyer account.", + "properties": { + "items": { + "type": "array", + "description": "A list of accounts.", + "items": { + "$ref": "Account" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#accountsList" + } + } + }, + "AdSize": { + "id": "AdSize", + "type": "object", + "properties": { + "height": { + "type": "integer", + "format": "int32" + }, + "width": { + "type": "integer", + "format": "int32" + } + } + }, + "AdSlotDto": { + "id": "AdSlotDto", + "type": "object", + "properties": { + "channelCode": { + "type": "string" + }, + "channelId": { + "type": "integer", + "format": "int32" + }, + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "size": { + "type": "string" + }, + "webPropertyId": { + "type": "integer", + "format": "int32" + } + } + }, + "AddOrderDealsRequest": { + "id": "AddOrderDealsRequest", + "type": "object", + "properties": { + "deals": { + "type": "array", + "description": "The list of deals to add", + "items": { + "$ref": "MarketplaceDeal" + } + }, + "orderRevisionNumber": { + "type": "string", + "description": "The last known order revision number.", + "format": "int64" + }, + "updateAction": { + "type": "string", + "description": "Indicates an optional action to take on the order" + } + } + }, + "AddOrderDealsResponse": { + "id": "AddOrderDealsResponse", + "type": "object", + "properties": { + "deals": { + "type": "array", + "description": "List of deals added (in the same order as passed in the request)", + "items": { + "$ref": "MarketplaceDeal" + } + }, + "orderRevisionNumber": { + "type": "string", + "description": "The updated revision number for the order.", + "format": "int64" + } + } + }, + "AddOrderNotesRequest": { + "id": "AddOrderNotesRequest", + "type": "object", + "properties": { + "notes": { + "type": "array", + "description": "The list of notes to add.", + "items": { + "$ref": "MarketplaceNote" + } + } + } + }, + "AddOrderNotesResponse": { + "id": "AddOrderNotesResponse", + "type": "object", + "properties": { + "notes": { + "type": "array", + "items": { + "$ref": "MarketplaceNote" + } + } + } + }, + "AdvertiserDto": { + "id": "AdvertiserDto", + "type": "object", + "properties": { + "brands": { + "type": "array", + "items": { + "$ref": "BrandDto" + } + }, + "id": { + "type": "string", + "format": "int64" + }, + "name": { + "type": "string" + }, + "status": { + "type": "string" + } + } + }, + "AudienceSegment": { + "id": "AudienceSegment", + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "string", + "format": "int64" + }, + "name": { + "type": "string" + }, + "numCookies": { + "type": "string", + "format": "int64" + } + } + }, + "BillingInfo": { + "id": "BillingInfo", + "type": "object", + "description": "The configuration data for an Ad Exchange billing info.", + "properties": { + "accountId": { + "type": "integer", + "description": "Account id.", + "format": "int32" + }, + "accountName": { + "type": "string", + "description": "Account name." + }, + "billingId": { + "type": "array", + "description": "A list of adgroup IDs associated with this particular account. These IDs may show up as part of a realtime bidding BidRequest, which indicates a bid request for this account.", + "items": { + "type": "string" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#billingInfo" + } + } + }, + "BillingInfoList": { + "id": "BillingInfoList", + "type": "object", + "description": "A billing info feed lists Billing Info the Ad Exchange buyer account has access to. Each entry in the feed corresponds to a single billing info.", + "properties": { + "items": { + "type": "array", + "description": "A list of billing info relevant for your account.", + "items": { + "$ref": "BillingInfo" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#billingInfoList" + } + } + }, + "BrandDto": { + "id": "BrandDto", + "type": "object", + "properties": { + "advertiserId": { + "type": "string", + "format": "int64" + }, + "id": { + "type": "string", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Budget": { + "id": "Budget", + "type": "object", + "description": "The configuration data for Ad Exchange RTB - Budget API.", + "properties": { + "accountId": { + "type": "string", + "description": "The id of the account. This is required for get and update requests.", + "format": "int64" + }, + "billingId": { + "type": "string", + "description": "The billing id to determine which adgroup to provide budget information for. This is required for get and update requests.", + "format": "int64" + }, + "budgetAmount": { + "type": "string", + "description": "The budget amount to apply for the billingId provided. This is required for update requests.", + "format": "int64" + }, + "currencyCode": { + "type": "string", + "description": "The currency code for the buyer. This cannot be altered here." + }, + "id": { + "type": "string", + "description": "The unique id that describes this item." + }, + "kind": { + "type": "string", + "description": "The kind of the resource, i.e. \"adexchangebuyer#budget\".", + "default": "adexchangebuyer#budget" + } + } + }, + "Buyer": { + "id": "Buyer", + "type": "object", + "properties": { + "accountId": { + "type": "string", + "description": "Adx account id of the buyer." + } + } + }, + "BuyerDto": { + "id": "BuyerDto", + "type": "object", + "properties": { + "accountId": { + "type": "integer", + "format": "int32" + }, + "customerId": { + "type": "integer", + "format": "int32" + }, + "displayName": { + "type": "string" + }, + "enabledForInterestTargetingDeals": { + "type": "boolean" + }, + "enabledForPreferredDeals": { + "type": "boolean" + }, + "id": { + "type": "integer", + "format": "int32" + }, + "sponsorAccountId": { + "type": "integer", + "format": "int32" + } + } + }, + "ClientAccessCapabilities": { + "id": "ClientAccessCapabilities", + "type": "object", + "properties": { + "capabilities": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + }, + "clientAccountId": { + "type": "string", + "format": "int64" + } + } + }, + "ContactInformation": { + "id": "ContactInformation", + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email address of the contact." + }, + "name": { + "type": "string", + "description": "The name of the contact." + } + } + }, + "CreateOrdersRequest": { + "id": "CreateOrdersRequest", + "type": "object", + "properties": { + "orders": { + "type": "array", + "description": "The list of orders to create.", + "items": { + "$ref": "MarketplaceOrder" + } + }, + "webPropertyCode": { + "type": "string" + } + } + }, + "CreateOrdersResponse": { + "id": "CreateOrdersResponse", + "type": "object", + "properties": { + "orders": { + "type": "array", + "description": "The list of orders successfully created.", + "items": { + "$ref": "MarketplaceOrder" + } + } + } + }, + "Creative": { + "id": "Creative", + "type": "object", + "description": "A creative and its classification data.", + "properties": { + "HTMLSnippet": { + "type": "string", + "description": "The HTML snippet that displays the ad when inserted in the web page. If set, videoURL should not be set." + }, + "accountId": { + "type": "integer", + "description": "Account id.", + "format": "int32", + "annotations": { + "required": [ + "adexchangebuyer.creatives.insert" + ] + } + }, + "advertiserId": { + "type": "array", + "description": "Detected advertiser id, if any. Read-only. This field should not be set in requests.", + "items": { + "type": "string", + "format": "int64" + } + }, + "advertiserName": { + "type": "string", + "description": "The name of the company being advertised in the creative.", + "annotations": { + "required": [ + "adexchangebuyer.creatives.insert" + ] + } + }, + "agencyId": { + "type": "string", + "description": "The agency id for this creative.", + "format": "int64" + }, + "api_upload_timestamp": { + "type": "string", + "description": "The last upload timestamp of this creative if it was uploaded via API. Read-only. The value of this field is generated, and will be ignored for uploads. (formatted RFC 3339 timestamp).", + "format": "date-time" + }, + "attribute": { + "type": "array", + "description": "All attributes for the ads that may be shown from this snippet.", + "items": { + "type": "integer", + "format": "int32" + } + }, + "buyerCreativeId": { + "type": "string", + "description": "A buyer-specific id identifying the creative in this ad.", + "annotations": { + "required": [ + "adexchangebuyer.creatives.insert" + ] + } + }, + "clickThroughUrl": { + "type": "array", + "description": "The set of destination urls for the snippet.", + "items": { + "type": "string" + }, + "annotations": { + "required": [ + "adexchangebuyer.creatives.insert" + ] + } + }, + "corrections": { + "type": "array", + "description": "Shows any corrections that were applied to this creative. Read-only. This field should not be set in requests.", + "items": { + "type": "object", + "properties": { + "details": { + "type": "array", + "description": "Additional details about the correction.", + "items": { + "type": "string" + } + }, + "reason": { + "type": "string", + "description": "The type of correction that was applied to the creative." + } + } + } + }, + "dealsStatus": { + "type": "string", + "description": "Top-level deals status. Read-only. This field should not be set in requests. If disapproved, an entry for auctionType=DIRECT_DEALS (or ALL) in servingRestrictions will also exist. Note that this may be nuanced with other contextual restrictions, in which case it may be preferable to read from servingRestrictions directly." + }, + "filteringReasons": { + "type": "object", + "description": "The filtering reasons for the creative. Read-only. This field should not be set in requests.", + "properties": { + "date": { + "type": "string", + "description": "The date in ISO 8601 format for the data. The data is collected from 00:00:00 to 23:59:59 in PST." + }, + "reasons": { + "type": "array", + "description": "The filtering reasons.", + "items": { + "type": "object", + "properties": { + "filteringCount": { + "type": "string", + "description": "The number of times the creative was filtered for the status. The count is aggregated across all publishers on the exchange.", + "format": "int64" + }, + "filteringStatus": { + "type": "integer", + "description": "The filtering status code. Please refer to the creative-status-codes.txt file for different statuses.", + "format": "int32" + } + } + } + } + } + }, + "height": { + "type": "integer", + "description": "Ad height.", + "format": "int32", + "annotations": { + "required": [ + "adexchangebuyer.creatives.insert" + ] + } + }, + "impressionTrackingUrl": { + "type": "array", + "description": "The set of urls to be called to record an impression.", + "items": { + "type": "string" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#creative" + }, + "nativeAd": { + "type": "object", + "description": "If nativeAd is set, HTMLSnippet and videoURL should not be set.", + "properties": { + "advertiser": { + "type": "string" + }, + "appIcon": { + "type": "object", + "description": "The app icon, for app download ads.", + "properties": { + "height": { + "type": "integer", + "format": "int32" + }, + "url": { + "type": "string" + }, + "width": { + "type": "integer", + "format": "int32" + } + } + }, + "body": { + "type": "string", + "description": "A long description of the ad." + }, + "callToAction": { + "type": "string", + "description": "A label for the button that the user is supposed to click." + }, + "clickTrackingUrl": { + "type": "string", + "description": "The URL to use for click tracking." + }, + "headline": { + "type": "string", + "description": "A short title for the ad." + }, + "image": { + "type": "object", + "description": "A large image.", + "properties": { + "height": { + "type": "integer", + "format": "int32" + }, + "url": { + "type": "string" + }, + "width": { + "type": "integer", + "format": "int32" + } + } + }, + "impressionTrackingUrl": { + "type": "array", + "description": "The URLs are called when the impression is rendered.", + "items": { + "type": "string" + } + }, + "logo": { + "type": "object", + "description": "A smaller image, for the advertiser logo.", + "properties": { + "height": { + "type": "integer", + "format": "int32" + }, + "url": { + "type": "string" + }, + "width": { + "type": "integer", + "format": "int32" + } + } + }, + "price": { + "type": "string", + "description": "The price of the promoted app including the currency info." + }, + "starRating": { + "type": "number", + "description": "The app rating in the app store. Must be in the range [0-5].", + "format": "double" + }, + "store": { + "type": "string", + "description": "The URL to the app store to purchase/download the promoted app." + } + } + }, + "openAuctionStatus": { + "type": "string", + "description": "Top-level open auction status. Read-only. This field should not be set in requests. If disapproved, an entry for auctionType=OPEN_AUCTION (or ALL) in servingRestrictions will also exist. Note that this may be nuanced with other contextual restrictions, in which case it may be preferable to read from ServingRestrictions directly." + }, + "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" + } + }, + "servingRestrictions": { + "type": "array", + "description": "The granular status of this ad in specific contexts. A context here relates to where something ultimately serves (for example, a physical location, a platform, an HTTPS vs HTTP request, or the type of auction). Read-only. This field should not be set in requests.", + "items": { + "type": "object", + "properties": { + "contexts": { + "type": "array", + "description": "All known contexts/restrictions.", + "items": { + "type": "object", + "properties": { + "auctionType": { + "type": "array", + "description": "Only set when contextType=AUCTION_TYPE. Represents the auction types this restriction applies to.", + "items": { + "type": "string" + } + }, + "contextType": { + "type": "string", + "description": "The type of context (e.g., location, platform, auction type, SSL-ness)." + }, + "geoCriteriaId": { + "type": "array", + "description": "Only set when contextType=LOCATION. Represents the geo criterias this restriction applies to.", + "items": { + "type": "integer", + "format": "int32" + } + }, + "platform": { + "type": "array", + "description": "Only set when contextType=PLATFORM. Represents the platforms this restriction applies to.", + "items": { + "type": "string" + } + } + } + } + }, + "disapprovalReasons": { + "type": "array", + "description": "The reasons for disapproval within this restriction, if any. Note that not all disapproval reasons may be categorized, so it is possible for the creative to have a status of DISAPPROVED or CONDITIONALLY_APPROVED with an empty list for disapproval_reasons. In this case, please reach out to your TAM to help debug the issue.", + "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." + } + } + } + }, + "reason": { + "type": "string", + "description": "Why the creative is ineligible to serve in this context (e.g., it has been explicitly disapproved or is pending review)." + } + } + } + }, + "vendorType": { + "type": "array", + "description": "All vendor types for the ads that may be shown from this snippet.", + "items": { + "type": "integer", + "format": "int32" + } + }, + "version": { + "type": "integer", + "description": "The version for this creative. Read-only. This field should not be set in requests.", + "format": "int32" + }, + "videoURL": { + "type": "string", + "description": "The url to fetch a video ad. If set, HTMLSnippet should not be set." + }, + "width": { + "type": "integer", + "description": "Ad width.", + "format": "int32", + "annotations": { + "required": [ + "adexchangebuyer.creatives.insert" + ] + } + } + } + }, + "CreativesList": { + "id": "CreativesList", + "type": "object", + "description": "The creatives feed lists the active creatives for the Ad Exchange buyer accounts that the user has access to. Each entry in the feed corresponds to a single creative.", + "properties": { + "items": { + "type": "array", + "description": "A list of creatives.", + "items": { + "$ref": "Creative" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#creativesList" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through creatives. To retrieve the next page of results, set the next request's \"pageToken\" value to this." + } + } + }, + "DateTime": { + "id": "DateTime", + "type": "object", + "properties": { + "day": { + "type": "integer", + "format": "int32" + }, + "hour": { + "type": "integer", + "format": "int32" + }, + "minute": { + "type": "integer", + "format": "int32" + }, + "month": { + "type": "integer", + "format": "int32" + }, + "second": { + "type": "integer", + "format": "int32" + }, + "timeZoneId": { + "type": "string" + }, + "year": { + "type": "integer", + "format": "int32" + } + } + }, + "DealPartyDto": { + "id": "DealPartyDto", + "type": "object", + "properties": { + "buyer": { + "$ref": "BuyerDto" + }, + "buyerSellerRole": { + "type": "string" + }, + "customerId": { + "type": "integer", + "format": "int32" + }, + "name": { + "type": "string" + }, + "webProperty": { + "$ref": "WebPropertyDto" + } + } + }, + "DealTerms": { + "id": "DealTerms", + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "Description for the proposed terms of the deal." + }, + "guaranteedFixedPriceTerms": { + "$ref": "DealTermsGuaranteedFixedPriceTerms", + "description": "The terms for guaranteed fixed price deals." + }, + "nonGuaranteedAuctionTerms": { + "$ref": "DealTermsNonGuaranteedAuctionTerms", + "description": "The terms for non-guaranteed auction deals." + }, + "nonGuaranteedFixedPriceTerms": { + "$ref": "DealTermsNonGuaranteedFixedPriceTerms", + "description": "The terms for non-guaranteed fixed price deals." + } + } + }, + "DealTermsGuaranteedFixedPriceTerms": { + "id": "DealTermsGuaranteedFixedPriceTerms", + "type": "object", + "properties": { + "fixedPrices": { + "type": "array", + "description": "Fixed price for the specified buyer.", + "items": { + "$ref": "PricePerBuyer" + } + }, + "guaranteedImpressions": { + "type": "string", + "description": "Guaranteed impressions as a percentage. This is the percentage of guaranteed looks that the buyer is guaranteeing to buy.", + "format": "int64" + }, + "guaranteedLooks": { + "type": "string", + "description": "Count of guaranteed looks. Required for deal, optional for offer.", + "format": "int64" + } + } + }, + "DealTermsNonGuaranteedAuctionTerms": { + "id": "DealTermsNonGuaranteedAuctionTerms", + "type": "object", + "properties": { + "privateAuctionId": { + "type": "string", + "description": "Id of the corresponding private auction." + }, + "reservePricePerBuyers": { + "type": "array", + "description": "Reserve price for the specified buyer.", + "items": { + "$ref": "PricePerBuyer" + } + } + } + }, + "DealTermsNonGuaranteedFixedPriceTerms": { + "id": "DealTermsNonGuaranteedFixedPriceTerms", + "type": "object", + "properties": { + "fixedPrices": { + "type": "array", + "description": "Fixed price for the specified buyer.", + "items": { + "$ref": "PricePerBuyer" + } + } + } + }, + "DeleteOrderDealsRequest": { + "id": "DeleteOrderDealsRequest", + "type": "object", + "properties": { + "dealIds": { + "type": "array", + "description": "List of deals to delete for a given order", + "items": { + "type": "string" + } + }, + "orderRevisionNumber": { + "type": "string", + "description": "The last known order revision number.", + "format": "int64" + }, + "updateAction": { + "type": "string" + } + } + }, + "DeleteOrderDealsResponse": { + "id": "DeleteOrderDealsResponse", + "type": "object", + "properties": { + "deals": { + "type": "array", + "description": "List of deals deleted (in the same order as passed in the request)", + "items": { + "$ref": "MarketplaceDeal" + } + }, + "orderRevisionNumber": { + "type": "string", + "description": "The updated revision number for the order.", + "format": "int64" + } + } + }, + "DeliveryControl": { + "id": "DeliveryControl", + "type": "object", + "properties": { + "deliveryRateType": { + "type": "string" + }, + "frequencyCaps": { + "type": "array", + "items": { + "$ref": "DeliveryControlFrequencyCap" + } + } + } + }, + "DeliveryControlFrequencyCap": { + "id": "DeliveryControlFrequencyCap", + "type": "object", + "properties": { + "maxImpressions": { + "type": "integer", + "format": "int32" + }, + "numTimeUnits": { + "type": "integer", + "format": "int32" + }, + "timeUnitType": { + "type": "string" + } + } + }, + "EditAllOrderDealsRequest": { + "id": "EditAllOrderDealsRequest", + "type": "object", + "properties": { + "deals": { + "type": "array", + "description": "List of deals to edit. Service may perform 3 different operations based on comparison of deals in this list vs deals already persisted in database: 1. Add new deal to order If a deal in this list does not exist in the order, the service will create a new deal and add it to the order. Validation will follow AddOrderDealsRequest. 2. Update existing deal in the order If a deal in this list already exist in the order, the service will update that existing deal to this new deal in the request. Validation will follow UpdateOrderDealsRequest. 3. Delete deals from the order (just need the id) If a existing deal in the order is not present in this list, the service will delete that deal from the order. Validation will follow DeleteOrderDealsRequest.", + "items": { + "$ref": "MarketplaceDeal" + } + }, + "order": { + "$ref": "MarketplaceOrder", + "description": "If specified, also updates the order in the batch transaction. This is useful when the order and the deals need to be updated in one transaction." + }, + "orderRevisionNumber": { + "type": "string", + "description": "The last known revision number for the order.", + "format": "int64" + }, + "updateAction": { + "type": "string", + "description": "Indicates an optional action to take on the order" + } + } + }, + "EditAllOrderDealsResponse": { + "id": "EditAllOrderDealsResponse", + "type": "object", + "properties": { + "deals": { + "type": "array", + "description": "List of all deals in the order after edit.", + "items": { + "$ref": "MarketplaceDeal" + } + } + } + }, + "EditHistoryDto": { + "id": "EditHistoryDto", + "type": "object", + "properties": { + "createdByLoginName": { + "type": "string" + }, + "createdTimeStamp": { + "type": "string", + "format": "int64" + }, + "lastUpdateTimeStamp": { + "type": "string", + "format": "int64" + }, + "lastUpdatedByLoginName": { + "type": "string" + } + } + }, + "GetFinalizedNegotiationByExternalDealIdRequest": { + "id": "GetFinalizedNegotiationByExternalDealIdRequest", + "type": "object", + "properties": { + "includePrivateAuctions": { + "type": "boolean" + } + } + }, + "GetNegotiationByIdRequest": { + "id": "GetNegotiationByIdRequest", + "type": "object", + "properties": { + "includePrivateAuctions": { + "type": "boolean" + } + } + }, + "GetNegotiationsRequest": { + "id": "GetNegotiationsRequest", + "type": "object", + "properties": { + "finalized": { + "type": "boolean" + }, + "includePrivateAuctions": { + "type": "boolean" + }, + "sinceTimestampMillis": { + "type": "string", + "format": "int64" + } + } + }, + "GetNegotiationsResponse": { + "id": "GetNegotiationsResponse", + "type": "object", + "properties": { + "kind": { + "type": "string", + "default": "adexchangebuyer#negotiationsList" + }, + "negotiations": { + "type": "array", + "items": { + "$ref": "NegotiationDto" + } + } + } + }, + "GetOffersResponse": { + "id": "GetOffersResponse", + "type": "object", + "properties": { + "offers": { + "type": "array", + "description": "The returned list of offers.", + "items": { + "$ref": "MarketplaceOffer" + } + } + } + }, + "GetOrderDealsResponse": { + "id": "GetOrderDealsResponse", + "type": "object", + "properties": { + "deals": { + "type": "array", + "description": "List of deals for the order", + "items": { + "$ref": "MarketplaceDeal" + } + } + } + }, + "GetOrderNotesResponse": { + "id": "GetOrderNotesResponse", + "type": "object", + "properties": { + "notes": { + "type": "array", + "description": "The list of matching notes.", + "items": { + "$ref": "MarketplaceNote" + } + } + } + }, + "GetOrdersResponse": { + "id": "GetOrdersResponse", + "type": "object", + "properties": { + "orders": { + "type": "array", + "description": "The list of matching orders.", + "items": { + "$ref": "MarketplaceOrder" + } + } + } + }, + "InventorySegmentTargeting": { + "id": "InventorySegmentTargeting", + "type": "object", + "properties": { + "negativeAdSizes": { + "type": "array", + "items": { + "$ref": "AdSize" + } + }, + "negativeAdTypeSegments": { + "type": "array", + "items": { + "type": "string" + } + }, + "negativeAudienceSegments": { + "type": "array", + "items": { + "type": "string", + "format": "int64" + } + }, + "negativeDeviceCategories": { + "type": "array", + "items": { + "type": "string", + "format": "int64" + } + }, + "negativeIcmBrands": { + "type": "array", + "items": { + "type": "string", + "format": "int64" + } + }, + "negativeIcmInterests": { + "type": "array", + "items": { + "type": "string", + "format": "int64" + } + }, + "negativeInventorySlots": { + "type": "array", + "items": { + "type": "string" + } + }, + "negativeKeyValues": { + "type": "array", + "items": { + "$ref": "RuleKeyValuePair" + } + }, + "negativeLocations": { + "type": "array", + "items": { + "type": "string", + "format": "int64" + } + }, + "negativeMobileApps": { + "type": "array", + "items": { + "type": "string" + } + }, + "negativeOperatingSystemVersions": { + "type": "array", + "items": { + "type": "string", + "format": "int64" + } + }, + "negativeOperatingSystems": { + "type": "array", + "items": { + "type": "string", + "format": "int64" + } + }, + "negativeSiteUrls": { + "type": "array", + "items": { + "type": "string" + } + }, + "negativeSizes": { + "type": "array", + "items": { + "type": "string", + "format": "int64" + } + }, + "negativeVideoAdPositionSegments": { + "type": "array", + "items": { + "type": "string" + } + }, + "negativeVideoDurationSegments": { + "type": "array", + "items": { + "type": "string", + "format": "int64" + } + }, + "negativeXfpAdSlots": { + "type": "array", + "items": { + "type": "string", + "format": "int64" + } + }, + "negativeXfpPlacements": { + "type": "array", + "items": { + "type": "string", + "format": "int64" + } + }, + "positiveAdSizes": { + "type": "array", + "items": { + "$ref": "AdSize" + } + }, + "positiveAdTypeSegments": { + "type": "array", + "items": { + "type": "string" + } + }, + "positiveAudienceSegments": { + "type": "array", + "items": { + "type": "string", + "format": "int64" + } + }, + "positiveDeviceCategories": { + "type": "array", + "items": { + "type": "string", + "format": "int64" + } + }, + "positiveIcmBrands": { + "type": "array", + "items": { + "type": "string", + "format": "int64" + } + }, + "positiveIcmInterests": { + "type": "array", + "items": { + "type": "string", + "format": "int64" + } + }, + "positiveInventorySlots": { + "type": "array", + "items": { + "type": "string" + } + }, + "positiveKeyValues": { + "type": "array", + "items": { + "$ref": "RuleKeyValuePair" + } + }, + "positiveLocations": { + "type": "array", + "items": { + "type": "string", + "format": "int64" + } + }, + "positiveMobileApps": { + "type": "array", + "items": { + "type": "string" + } + }, + "positiveOperatingSystemVersions": { + "type": "array", + "items": { + "type": "string", + "format": "int64" + } + }, + "positiveOperatingSystems": { + "type": "array", + "items": { + "type": "string", + "format": "int64" + } + }, + "positiveSiteUrls": { + "type": "array", + "items": { + "type": "string" + } + }, + "positiveSizes": { + "type": "array", + "items": { + "type": "string", + "format": "int64" + } + }, + "positiveVideoAdPositionSegments": { + "type": "array", + "items": { + "type": "string" + } + }, + "positiveVideoDurationSegments": { + "type": "array", + "items": { + "type": "string", + "format": "int64" + } + }, + "positiveXfpAdSlots": { + "type": "array", + "items": { + "type": "string", + "format": "int64" + } + }, + "positiveXfpPlacements": { + "type": "array", + "items": { + "type": "string", + "format": "int64" + } + } + } + }, + "ListClientAccessCapabilitiesRequest": { + "id": "ListClientAccessCapabilitiesRequest", + "type": "object", + "properties": { + "sponsorAccountId": { + "type": "string", + "format": "int64" + } + } + }, + "ListClientAccessCapabilitiesResponse": { + "id": "ListClientAccessCapabilitiesResponse", + "type": "object", + "properties": { + "clientAccessPermissions": { + "type": "array", + "items": { + "$ref": "ClientAccessCapabilities" + } + } + } + }, + "ListOffersRequest": { + "id": "ListOffersRequest", + "type": "object", + "properties": { + "sinceTimestampMillis": { + "type": "string", + "format": "int64" + } + } + }, + "ListOffersResponse": { + "id": "ListOffersResponse", + "type": "object", + "properties": { + "kind": { + "type": "string", + "default": "adexchangebuyer#offersList" + }, + "offers": { + "type": "array", + "items": { + "$ref": "OfferDto" + } + } + } + }, + "MarketplaceDeal": { + "id": "MarketplaceDeal", + "type": "object", + "description": "An order can contain multiple deals. A deal contains the terms and targeting information that is used for serving.", + "properties": { + "buyerPrivateData": { + "$ref": "PrivateData", + "description": "Buyer private data (hidden from seller)." + }, + "creationTimeMs": { + "type": "string", + "description": "The time (ms since epoch) of the deal creation. (readonly)", + "format": "int64" + }, + "dealId": { + "type": "string", + "description": "A unique deal=id for the deal (readonly)." + }, + "deliveryControl": { + "$ref": "DeliveryControl", + "description": "The set of fields around delivery control that are interesting for a buyer to see but are non-negotiable. These are set by the publisher. This message is assigned an id of 100 since some day we would want to model this as a protobuf extension." + }, + "externalDealId": { + "type": "string", + "description": "The external deal id assigned to this deal once the deal is finalized. This is the deal-id that shows up in serving/reporting etc. (readonly)" + }, + "flightEndTimeMs": { + "type": "string", + "description": "Proposed flight end time of the deal (ms since epoch) This will generally be stored in a granularity of a second. (updatable)", + "format": "int64" + }, + "flightStartTimeMs": { + "type": "string", + "description": "Proposed flight start time of the deal (ms since epoch) This will generally be stored in a granularity of a second. (updatable)", + "format": "int64" + }, + "inventoryDescription": { + "type": "string", + "description": "Description for the deal terms. (updatable)" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"adexchangebuyer#marketplaceDeal\".", + "default": "adexchangebuyer#marketplaceDeal" + }, + "lastUpdateTimeMs": { + "type": "string", + "description": "The time (ms since epoch) when the deal was last updated. (readonly)", + "format": "int64" + }, + "name": { + "type": "string", + "description": "The name of the deal. (updatable)" + }, + "offerId": { + "type": "string", + "description": "The offer-id from which this deal was created. (readonly, except on create)" + }, + "offerRevisionNumber": { + "type": "string", + "description": "The revision number of the offer that the deal was created from (readonly, except on create)", + "format": "int64" + }, + "orderId": { + "type": "string" + }, + "sellerContacts": { + "type": "array", + "description": "Optional Seller contact information for the deal (buyer-readonly)", + "items": { + "$ref": "ContactInformation" + } + }, + "sharedTargetings": { + "type": "array", + "description": "The shared targeting visible to buyers and sellers. (updatable)", + "items": { + "$ref": "SharedTargeting" + } + }, + "syndicationProduct": { + "type": "string", + "description": "The syndication product associated with the deal. (readonly, except on create)" + }, + "terms": { + "$ref": "DealTerms", + "description": "The negotiable terms of the deal. (updatable)" + }, + "webPropertyCode": { + "type": "string" + } + } + }, + "MarketplaceDealParty": { + "id": "MarketplaceDealParty", + "type": "object", + "properties": { + "buyer": { + "$ref": "Buyer", + "description": "The buyer/seller associated with the deal. One of buyer/seller is specified for a deal-party." + }, + "seller": { + "$ref": "Seller", + "description": "The buyer/seller associated with the deal. One of buyer/seller is specified for a deal party." + } + } + }, + "MarketplaceLabel": { + "id": "MarketplaceLabel", + "type": "object", + "properties": { + "accountId": { + "type": "string", + "description": "The accountId of the party that created the label." + }, + "createTimeMs": { + "type": "string", + "description": "The creation time (in ms since epoch) for the label.", + "format": "int64" + }, + "deprecatedMarketplaceDealParty": { + "$ref": "MarketplaceDealParty", + "description": "Information about the party that created the label." + }, + "label": { + "type": "string", + "description": "The label to use." + } + } + }, + "MarketplaceNote": { + "id": "MarketplaceNote", + "type": "object", + "description": "An order is associated with a bunch of notes which may optionally be associated with a deal and/or revision number.", + "properties": { + "creatorRole": { + "type": "string", + "description": "The role of the person (buyer/seller) creating the note. (readonly)" + }, + "dealId": { + "type": "string", + "description": "Notes can optionally be associated with a deal. (readonly, except on create)" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"adexchangebuyer#marketplaceNote\".", + "default": "adexchangebuyer#marketplaceNote" + }, + "note": { + "type": "string", + "description": "The actual note to attach. (readonly, except on create)" + }, + "noteId": { + "type": "string", + "description": "The unique id for the note. (readonly)" + }, + "orderId": { + "type": "string", + "description": "The order_id that a note is attached to. (readonly)" + }, + "orderRevisionNumber": { + "type": "string", + "description": "If the note is associated with an order revision number, then store that here. (readonly, except on create)", + "format": "int64" + }, + "timestampMs": { + "type": "string", + "description": "The timestamp (ms since epoch) that this note was created. (readonly)", + "format": "int64" + } + } + }, + "MarketplaceOffer": { + "id": "MarketplaceOffer", + "type": "object", + "description": "An offer is segment of inventory that a seller wishes to sell. It is associated with certain terms and targeting information which helps buyer know more about the inventory. Each field in an order can have one of the following setting:\n\n(readonly) - It is an error to try and set this field. (buyer-readonly) - Only the seller can set this field. (seller-readonly) - Only the buyer can set this field. (updatable) - The field is updatable at all times by either buyer or the seller.", + "properties": { + "creationTimeMs": { + "type": "string", + "description": "Creation time in ms. since epoch (readonly)", + "format": "int64" + }, + "creatorContacts": { + "type": "array", + "description": "Optional contact information for the creator of this offer. (buyer-readonly)", + "items": { + "$ref": "ContactInformation" + } + }, + "flightEndTimeMs": { + "type": "string", + "description": "The proposed end time for the deal (ms since epoch) (buyer-readonly)", + "format": "int64" + }, + "flightStartTimeMs": { + "type": "string", + "description": "Inventory availability dates. (times are in ms since epoch) The granularity is generally in the order of seconds. (buyer-readonly)", + "format": "int64" + }, + "hasCreatorSignedOff": { + "type": "boolean", + "description": "If the creator has already signed off on the offer, then the buyer can finalize the deal by accepting the offer as is. When copying to an order, if any of the terms are changed, then auto_finalize is automatically set to false." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"adexchangebuyer#marketplaceOffer\".", + "default": "adexchangebuyer#marketplaceOffer" + }, + "labels": { + "type": "array", + "description": "Optional List of labels for the offer (optional, buyer-readonly).", + "items": { + "$ref": "MarketplaceLabel" + } + }, + "lastUpdateTimeMs": { + "type": "string", + "description": "Time of last update in ms. since epoch (readonly)", + "format": "int64" + }, + "name": { + "type": "string", + "description": "The name for this offer as set by the seller. (buyer-readonly)" + }, + "offerId": { + "type": "string", + "description": "The unique id for the offer (readonly)" + }, + "revisionNumber": { + "type": "string", + "description": "The revision number of the offer. (readonly)", + "format": "int64" + }, + "seller": { + "$ref": "Seller", + "description": "Information about the seller that created this offer (readonly, except on create)" + }, + "sharedTargetings": { + "type": "array", + "description": "Targeting that is shared between the buyer and the seller. Each targeting criteria has a specified key and for each key there is a list of inclusion value or exclusion values. (buyer-readonly)", + "items": { + "$ref": "SharedTargeting" + } + }, + "state": { + "type": "string", + "description": "The state of the offer. (buyer-readonly)" + }, + "syndicationProduct": { + "type": "string", + "description": "The syndication product associated with the deal. (readonly, except on create)" + }, + "terms": { + "$ref": "DealTerms", + "description": "The negotiable terms of the deal (buyer-readonly)" + }, + "webPropertyCode": { + "type": "string" + } + } + }, + "MarketplaceOrder": { + "id": "MarketplaceOrder", + "type": "object", + "description": "Represents an order in the marketplace. An order is the unit of negotiation between a seller and a buyer and contains deals which are served. Each field in an order can have one of the following setting:\n\n(readonly) - It is an error to try and set this field. (buyer-readonly) - Only the seller can set this field. (seller-readonly) - Only the buyer can set this field. (updatable) - The field is updatable at all times by either buyer or the seller.", + "properties": { + "billedBuyer": { + "$ref": "Buyer", + "description": "Reference to the buyer that will get billed for this order. (readonly)" + }, + "buyer": { + "$ref": "Buyer", + "description": "Reference to the buyer on the order. (readonly, except on create)" + }, + "buyerContacts": { + "type": "array", + "description": "Optional contact information fort the buyer. (seller-readonly)", + "items": { + "$ref": "ContactInformation" + } + }, + "buyerPrivateData": { + "$ref": "PrivateData", + "description": "Private data for buyer. (hidden from seller)." + }, + "hasBuyerSignedOff": { + "type": "boolean", + "description": "When an order is in an accepted state, indicates whether the buyer has signed off Once both sides have signed off on a deal, the order can be finalized by the seller. (seller-readonly)" + }, + "hasSellerSignedOff": { + "type": "boolean", + "description": "When an order is in an accepted state, indicates whether the buyer has signed off Once both sides have signed off on a deal, the order can be finalized by the seller. (buyer-readonly)" + }, + "isRenegotiating": { + "type": "boolean", + "description": "True if the order is being renegotiated (readonly)." + }, + "isSetupComplete": { + "type": "boolean", + "description": "True, if the buyside inventory setup is complete for this order. (readonly)" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"adexchangebuyer#marketplaceOrder\".", + "default": "adexchangebuyer#marketplaceOrder" + }, + "labels": { + "type": "array", + "description": "List of labels associated with the order. (readonly)", + "items": { + "$ref": "MarketplaceLabel" + } + }, + "lastUpdaterOrCommentorRole": { + "type": "string", + "description": "The role of the last user that either updated the order or left a comment. (readonly)" + }, + "lastUpdaterRole": { + "type": "string" + }, + "name": { + "type": "string", + "description": "The name for the order (updatable)" + }, + "orderId": { + "type": "string", + "description": "The unique id of the order. (readonly)." + }, + "orderState": { + "type": "string", + "description": "The current state of the order. (readonly)" + }, + "originatorRole": { + "type": "string", + "description": "Indicates whether the buyer/seller created the offer.(readonly)" + }, + "revisionNumber": { + "type": "string", + "description": "The revision number for the order (readonly).", + "format": "int64" + }, + "revisionTimeMs": { + "type": "string", + "description": "The time (ms since epoch) when the order was last revised (readonly).", + "format": "int64" + }, + "seller": { + "$ref": "Seller", + "description": "Reference to the seller on the order. (readonly, except on create)" + }, + "sellerContacts": { + "type": "array", + "description": "Optional contact information for the seller (buyer-readonly).", + "items": { + "$ref": "ContactInformation" + } + } + } + }, + "MoneyDto": { + "id": "MoneyDto", + "type": "object", + "properties": { + "currencyCode": { + "type": "string" + }, + "micros": { + "type": "string", + "format": "int64" + } + } + }, + "NegotiationDto": { + "id": "NegotiationDto", + "type": "object", + "properties": { + "billedBuyer": { + "$ref": "DealPartyDto", + "description": "The billed buyer; Specified by a buyer buying through an intermediary." + }, + "buyer": { + "$ref": "DealPartyDto", + "description": "Details of the buyer party in this negotiation." + }, + "buyerEmailContacts": { + "type": "array", + "description": "The buyer party's contact email.", + "items": { + "type": "string" + } + }, + "dealType": { + "type": "string", + "description": "The type of this deal." + }, + "externalDealId": { + "type": "string", + "description": "For finalized negotiations, the ID of the finalized deal.", + "format": "int64" + }, + "kind": { + "type": "string", + "default": "adexchangebuyer#negotiation" + }, + "labelNames": { + "type": "array", + "description": "A list of label names applicable to this negotiation.", + "items": { + "type": "string" + } + }, + "negotiationId": { + "type": "string", + "description": "The unique ID of this negotiation.", + "format": "int64" + }, + "negotiationRounds": { + "type": "array", + "description": "The series of negotiation rounds for this negotiation.", + "items": { + "$ref": "NegotiationRoundDto" + } + }, + "negotiationState": { + "type": "string", + "description": "The state of this negotiation." + }, + "offerId": { + "type": "string", + "description": "The ID of this negotiation's original offer.", + "format": "int64" + }, + "seller": { + "$ref": "DealPartyDto", + "description": "Details of the seller party in this negotiation." + }, + "sellerEmailContacts": { + "type": "array", + "description": "The seller party's contact email.", + "items": { + "type": "string" + } + }, + "stats": { + "$ref": "StatsDto", + "description": "The stats for this negotiation." + }, + "status": { + "type": "string", + "description": "The status of this negotiation." + } + } + }, + "NegotiationRoundDto": { + "id": "NegotiationRoundDto", + "type": "object", + "properties": { + "action": { + "type": "string", + "description": "The action performed by this negotiation round." + }, + "dbmPartnerId": { + "type": "string", + "description": "Stores DBM partner ID for use by DBM", + "format": "int64" + }, + "editHistory": { + "$ref": "EditHistoryDto", + "description": "The edit history of this negotiation round." + }, + "kind": { + "type": "string", + "default": "adexchangebuyer#negotiationRound" + }, + "negotiationId": { + "type": "string", + "description": "The ID of the negotiation to which this negotiation round applies.", + "format": "int64" + }, + "notes": { + "type": "string", + "description": "Notes regarding this negotiation round." + }, + "originatorRole": { + "type": "string", + "description": "The role, either buyer or seller, initiating this negotiation round." + }, + "roundNumber": { + "type": "string", + "description": "The number of this negotiation round, in sequence.", + "format": "int64" + }, + "terms": { + "$ref": "TermsDto", + "description": "The detailed terms proposed in this negotiation round." + } + } + }, + "OfferDto": { + "id": "OfferDto", + "type": "object", + "properties": { + "anonymous": { + "type": "boolean", + "description": "Whether this offer is anonymous." + }, + "billedBuyer": { + "$ref": "DealPartyDto", + "description": "The billed buyer; For buyer initiated offers, buying through an intermediary." + }, + "closedToDealParties": { + "type": "array", + "description": "The list of buyer or seller parties this offer is closed to.", + "items": { + "$ref": "DealPartyDto" + } + }, + "creator": { + "$ref": "DealPartyDto", + "description": "The creator of this offer." + }, + "emailContacts": { + "type": "array", + "description": "The list of email contacts for this offer.", + "items": { + "type": "string" + } + }, + "isOpen": { + "type": "boolean", + "description": "Whether this offer is open." + }, + "kind": { + "type": "string", + "default": "adexchangebuyer#offer" + }, + "labelNames": { + "type": "array", + "description": "The list of label names applicable to this offer.", + "items": { + "type": "string" + } + }, + "offerId": { + "type": "string", + "description": "The unique ID of this offer.", + "format": "int64" + }, + "offerState": { + "type": "string", + "description": "The state of this offer." + }, + "openToDealParties": { + "type": "array", + "description": "The list of buyer or seller parties this offer is open to.", + "items": { + "$ref": "DealPartyDto" + } + }, + "pointOfContact": { + "type": "string", + "description": "The point of contact for this offer." + }, + "status": { + "type": "string", + "description": "The status of this offer." + }, + "terms": { + "$ref": "TermsDto", + "description": "The terms of this offer." + } + } + }, + "PerformanceReport": { + "id": "PerformanceReport", + "type": "object", + "description": "The configuration data for an Ad Exchange performance report list.", + "properties": { + "bidRate": { + "type": "number", + "description": "The number of bid responses with an ad.", + "format": "double" + }, + "bidRequestRate": { + "type": "number", + "description": "The number of bid requests sent to your bidder.", + "format": "double" + }, + "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" + } + }, + "filteredBidRate": { + "type": "number", + "description": "The number of bid responses that were filtered due to a policy violation or other errors.", + "format": "double" + }, + "hostedMatchStatusRate": { + "type": "array", + "description": "Average QPS for hosted match operations.", + "items": { + "type": "any" + } + }, + "inventoryMatchRate": { + "type": "number", + "description": "The number of potential queries based on your pretargeting settings.", + "format": "double" + }, + "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." + }, + "successfulRequestRate": { + "type": "number", + "description": "The number of properly formed bid responses received by our servers within the deadline.", + "format": "double" + }, + "timestamp": { + "type": "string", + "description": "The unix timestamp of the starting time of this performance data.", + "format": "int64" + }, + "unsuccessfulRequestRate": { + "type": "number", + "description": "The number of bid responses that were unsuccessful due to timeouts, incorrect formatting, etc.", + "format": "double" + } + } + }, + "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" + } + } + } + }, + "PretargetingConfig": { + "id": "PretargetingConfig", + "type": "object", + "properties": { + "billingId": { + "type": "string", + "description": "The id for billing purposes, provided for reference. Leave this field blank for insert requests; the id will be generated automatically.", + "format": "int64" + }, + "configId": { + "type": "string", + "description": "The config id; generated automatically. Leave this field blank for insert requests.", + "format": "int64" + }, + "configName": { + "type": "string", + "description": "The name of the config. Must be unique. Required for all requests." + }, + "creativeType": { + "type": "array", + "description": "List must contain exactly one of PRETARGETING_CREATIVE_TYPE_HTML or PRETARGETING_CREATIVE_TYPE_VIDEO.", + "items": { + "type": "string" + } + }, + "dimensions": { + "type": "array", + "description": "Requests which allow one of these (width, height) pairs will match. All pairs must be supported ad dimensions.", + "items": { + "type": "object", + "properties": { + "height": { + "type": "string", + "description": "Height in pixels.", + "format": "int64" + }, + "width": { + "type": "string", + "description": "Width in pixels.", + "format": "int64" + } + } + } + }, + "excludedContentLabels": { + "type": "array", + "description": "Requests with any of these content labels will not match. Values are from content-labels.txt in the downloadable files section.", + "items": { + "type": "string", + "format": "int64" + } + }, + "excludedGeoCriteriaIds": { + "type": "array", + "description": "Requests containing any of these geo criteria ids will not match.", + "items": { + "type": "string", + "format": "int64" + } + }, + "excludedPlacements": { + "type": "array", + "description": "Requests containing any of these placements will not match.", + "items": { + "type": "object", + "properties": { + "token": { + "type": "string", + "description": "The value of the placement. Interpretation depends on the placement type, e.g. URL for a site placement, channel name for a channel placement, app id for a mobile app placement." + }, + "type": { + "type": "string", + "description": "The type of the placement." + } + } + } + }, + "excludedUserLists": { + "type": "array", + "description": "Requests containing any of these users list ids will not match.", + "items": { + "type": "string", + "format": "int64" + } + }, + "excludedVerticals": { + "type": "array", + "description": "Requests containing any of these vertical ids will not match. Values are from the publisher-verticals.txt file in the downloadable files section.", + "items": { + "type": "string", + "format": "int64" + } + }, + "geoCriteriaIds": { + "type": "array", + "description": "Requests containing any of these geo criteria ids will match.", + "items": { + "type": "string", + "format": "int64" + } + }, + "isActive": { + "type": "boolean", + "description": "Whether this config is active. Required for all requests." + }, + "kind": { + "type": "string", + "description": "The kind of the resource, i.e. \"adexchangebuyer#pretargetingConfig\".", + "default": "adexchangebuyer#pretargetingConfig" + }, + "languages": { + "type": "array", + "description": "Request containing any of these language codes will match.", + "items": { + "type": "string" + } + }, + "mobileCarriers": { + "type": "array", + "description": "Requests containing any of these mobile carrier ids will match. Values are from mobile-carriers.csv in the downloadable files section.", + "items": { + "type": "string", + "format": "int64" + } + }, + "mobileDevices": { + "type": "array", + "description": "Requests containing any of these mobile device ids will match. Values are from mobile-devices.csv in the downloadable files section.", + "items": { + "type": "string", + "format": "int64" + } + }, + "mobileOperatingSystemVersions": { + "type": "array", + "description": "Requests containing any of these mobile operating system version ids will match. Values are from mobile-os.csv in the downloadable files section.", + "items": { + "type": "string", + "format": "int64" + } + }, + "placements": { + "type": "array", + "description": "Requests containing any of these placements will match.", + "items": { + "type": "object", + "properties": { + "token": { + "type": "string", + "description": "The value of the placement. Interpretation depends on the placement type, e.g. URL for a site placement, channel name for a channel placement, app id for a mobile app placement." + }, + "type": { + "type": "string", + "description": "The type of the placement." + } + } + } + }, + "platforms": { + "type": "array", + "description": "Requests matching any of these platforms will match. Possible values are PRETARGETING_PLATFORM_MOBILE, PRETARGETING_PLATFORM_DESKTOP, and PRETARGETING_PLATFORM_TABLET.", + "items": { + "type": "string" + } + }, + "supportedCreativeAttributes": { + "type": "array", + "description": "Creative attributes should be declared here if all creatives corresponding to this pretargeting configuration have that creative attribute. Values are from pretargetable-creative-attributes.txt in the downloadable files section.", + "items": { + "type": "string", + "format": "int64" + } + }, + "userLists": { + "type": "array", + "description": "Requests containing any of these user list ids will match.", + "items": { + "type": "string", + "format": "int64" + } + }, + "vendorTypes": { + "type": "array", + "description": "Requests that allow any of these vendor ids will match. Values are from vendors.txt in the downloadable files section.", + "items": { + "type": "string", + "format": "int64" + } + }, + "verticals": { + "type": "array", + "description": "Requests containing any of these vertical ids will match.", + "items": { + "type": "string", + "format": "int64" + } + } + } + }, + "PretargetingConfigList": { + "id": "PretargetingConfigList", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "A list of pretargeting configs", + "items": { + "$ref": "PretargetingConfig" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "adexchangebuyer#pretargetingConfigList" + } + } + }, + "Price": { + "id": "Price", + "type": "object", + "properties": { + "amountMicros": { + "type": "number", + "description": "The CPM value in micros.", + "format": "double" + }, + "currencyCode": { + "type": "string", + "description": "The currency code for the price." + } + } + }, + "PricePerBuyer": { + "id": "PricePerBuyer", + "type": "object", + "description": "Used to specify pricing rules for buyers/advertisers. Each PricePerBuyer in an offer can become [0,1] deals. To check if there is a PricePerBuyer for a particular buyer or buyer/advertiser pair, we look for the most specific matching rule - we first look for a rule matching the buyer and advertiser, next a rule with the buyer but an empty advertiser list, and otherwise look for a matching rule where no buyer is set.", + "properties": { + "buyer": { + "$ref": "Buyer", + "description": "The buyer who will pay this price. If unset, all buyers can pay this price (if the advertisers match, and there's no more specific rule matching the buyer)." + }, + "price": { + "$ref": "Price", + "description": "The specified price" + } + } + }, + "PrivateData": { + "id": "PrivateData", + "type": "object", + "properties": { + "referenceId": { + "type": "string" + }, + "referencePayload": { + "type": "string", + "format": "byte" + } + } + }, + "RuleKeyValuePair": { + "id": "RuleKeyValuePair", + "type": "object", + "properties": { + "keyName": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "Seller": { + "id": "Seller", + "type": "object", + "properties": { + "accountId": { + "type": "string", + "description": "The unique id for the seller. The seller fills in this field. The seller account id is then available to buyer in the offer." + }, + "subAccountId": { + "type": "string", + "description": "Optional sub-account id for the seller." + } + } + }, + "SharedTargeting": { + "id": "SharedTargeting", + "type": "object", + "properties": { + "exclusions": { + "type": "array", + "description": "The list of values to exclude from targeting.", + "items": { + "$ref": "TargetingValue" + } + }, + "inclusions": { + "type": "array", + "description": "The list of value to include as part of the targeting.", + "items": { + "$ref": "TargetingValue" + } + }, + "key": { + "type": "string", + "description": "The key representing the shared targeting criterion." + } + } + }, + "StatsDto": { + "id": "StatsDto", + "type": "object", + "properties": { + "bids": { + "type": "string", + "format": "int64" + }, + "goodBids": { + "type": "string", + "format": "int64" + }, + "impressions": { + "type": "string", + "format": "int64" + }, + "requests": { + "type": "string", + "format": "int64" + }, + "revenue": { + "$ref": "MoneyDto" + }, + "spend": { + "$ref": "MoneyDto" + } + } + }, + "TargetingValue": { + "id": "TargetingValue", + "type": "object", + "properties": { + "creativeSizeValue": { + "$ref": "TargetingValueCreativeSize", + "description": "The creative size value to exclude/include." + }, + "dayPartTargetingValue": { + "$ref": "TargetingValueDayPartTargeting", + "description": "The daypart targeting to include / exclude. Filled in when the key is GOOG_DAYPART_TARGETING." + }, + "longValue": { + "type": "string", + "description": "The long value to exclude/include.", + "format": "int64" + }, + "stringValue": { + "type": "string", + "description": "The string value to exclude/include." + } + } + }, + "TargetingValueCreativeSize": { + "id": "TargetingValueCreativeSize", + "type": "object", + "properties": { + "companionSizes": { + "type": "array", + "description": "For video size type, the list of companion sizes.", + "items": { + "$ref": "TargetingValueSize" + } + }, + "creativeSizeType": { + "type": "string", + "description": "The Creative size type." + }, + "size": { + "$ref": "TargetingValueSize", + "description": "For regular creative size type, specifies the size of the creative." + } + } + }, + "TargetingValueDayPartTargeting": { + "id": "TargetingValueDayPartTargeting", + "type": "object", + "properties": { + "dayParts": { + "type": "array", + "items": { + "$ref": "TargetingValueDayPartTargetingDayPart" + } + }, + "timeZoneType": { + "type": "string" + } + } + }, + "TargetingValueDayPartTargetingDayPart": { + "id": "TargetingValueDayPartTargetingDayPart", + "type": "object", + "properties": { + "dayOfWeek": { + "type": "string" + }, + "endHour": { + "type": "integer", + "format": "int32" + }, + "endMinute": { + "type": "integer", + "format": "int32" + }, + "startHour": { + "type": "integer", + "format": "int32" + }, + "startMinute": { + "type": "integer", + "format": "int32" + } + } + }, + "TargetingValueSize": { + "id": "TargetingValueSize", + "type": "object", + "properties": { + "height": { + "type": "integer", + "description": "The height of the creative.", + "format": "int32" + }, + "width": { + "type": "integer", + "description": "The width of the creative.", + "format": "int32" + } + } + }, + "TermsDto": { + "id": "TermsDto", + "type": "object", + "properties": { + "adSlots": { + "type": "array", + "description": "The particular ad slots targeted by the offer.", + "items": { + "$ref": "AdSlotDto" + } + }, + "advertisers": { + "type": "array", + "description": "A list of advertisers for this offer.", + "items": { + "$ref": "AdvertiserDto" + } + }, + "audienceSegment": { + "$ref": "AudienceSegment", + "description": "The audience segment for the offer." + }, + "audienceSegmentDescription": { + "type": "string", + "description": "A description of the audience segment for the offer." + }, + "billingTerms": { + "type": "string", + "description": "The billing terms." + }, + "buyerBillingType": { + "type": "string", + "description": "The buyer billing type." + }, + "cpm": { + "$ref": "MoneyDto", + "description": "The cpm terms." + }, + "creativeBlockingLevel": { + "type": "string", + "description": "Whether to use or ignore publisher blocking rules." + }, + "creativeReviewPolicy": { + "type": "string", + "description": "Whether to use publisher review policy or AdX review policy." + }, + "dealPremium": { + "$ref": "MoneyDto", + "description": "The premium terms." + }, + "description": { + "type": "string", + "description": "A description for these terms." + }, + "descriptiveName": { + "type": "string", + "description": "A descriptive name for these terms." + }, + "endDate": { + "$ref": "DateTime", + "description": "The end date for the offer." + }, + "estimatedImpressionsPerDay": { + "type": "string", + "description": "The estimated daily impressions for the offer.", + "format": "int64" + }, + "estimatedSpend": { + "$ref": "MoneyDto", + "description": "The estimated spend for the offer." + }, + "finalizeAutomatically": { + "type": "boolean", + "description": "If true, the offer will finalize automatically when accepted." + }, + "inventorySegmentTargeting": { + "$ref": "InventorySegmentTargeting", + "description": "The inventory segment targeting for the offer." + }, + "isReservation": { + "type": "boolean", + "description": "Whether the offer is a reservation." + }, + "minimumSpendMicros": { + "type": "string", + "description": "The minimum spend for the offer.", + "format": "int64" + }, + "minimumTrueLooks": { + "type": "string", + "description": "The minimum true looks for the offer.", + "format": "int64" + }, + "monetizerType": { + "type": "string", + "description": "The monetizer type." + }, + "semiTransparent": { + "type": "boolean", + "description": "Whether this offer is semi-transparent." + }, + "startDate": { + "$ref": "DateTime", + "description": "The start date for the offer." + }, + "targetByDealId": { + "type": "boolean", + "description": "Whether to target by deal id." + }, + "targetingAllAdSlots": { + "type": "boolean", + "description": "If true, the offer targets all ad slots." + }, + "termsAttributes": { + "type": "array", + "description": "A list of terms attributes.", + "items": { + "type": "string" + } + }, + "urls": { + "type": "array", + "description": "The urls applicable to the offer.", + "items": { + "type": "string" + } + } + } + }, + "WebPropertyDto": { + "id": "WebPropertyDto", + "type": "object", + "properties": { + "allowInterestTargetedAds": { + "type": "boolean" + }, + "enabledForPreferredDeals": { + "type": "boolean" + }, + "id": { + "type": "integer", + "format": "int32" + }, + "name": { + "type": "string" + }, + "propertyCode": { + "type": "string" + }, + "siteUrls": { + "type": "array", + "items": { + "type": "string" + } + }, + "syndicationProduct": { + "type": "string" + } + } + } + }, + "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" + ] + } + } + }, + "billingInfo": { + "methods": { + "get": { + "id": "adexchangebuyer.billingInfo.get", + "path": "billinginfo/{accountId}", + "httpMethod": "GET", + "description": "Returns the billing information for one account specified by account ID.", + "parameters": { + "accountId": { + "type": "integer", + "description": "The account id.", + "required": true, + "format": "int32", + "location": "path" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "BillingInfo" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "list": { + "id": "adexchangebuyer.billingInfo.list", + "path": "billinginfo", + "httpMethod": "GET", + "description": "Retrieves a list of billing information for all accounts of the authenticated user.", + "response": { + "$ref": "BillingInfoList" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + } + } + }, + "budget": { + "methods": { + "get": { + "id": "adexchangebuyer.budget.get", + "path": "billinginfo/{accountId}/{billingId}", + "httpMethod": "GET", + "description": "Returns the budget information for the adgroup specified by the accountId and billingId.", + "parameters": { + "accountId": { + "type": "string", + "description": "The account id to get the budget information for.", + "required": true, + "format": "int64", + "location": "path" + }, + "billingId": { + "type": "string", + "description": "The billing id to get the budget information for.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "billingId" + ], + "response": { + "$ref": "Budget" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "patch": { + "id": "adexchangebuyer.budget.patch", + "path": "billinginfo/{accountId}/{billingId}", + "httpMethod": "PATCH", + "description": "Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request. This method supports patch semantics.", + "parameters": { + "accountId": { + "type": "string", + "description": "The account id associated with the budget being updated.", + "required": true, + "format": "int64", + "location": "path" + }, + "billingId": { + "type": "string", + "description": "The billing id associated with the budget being updated.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "billingId" + ], + "request": { + "$ref": "Budget" + }, + "response": { + "$ref": "Budget" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "update": { + "id": "adexchangebuyer.budget.update", + "path": "billinginfo/{accountId}/{billingId}", + "httpMethod": "PUT", + "description": "Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request.", + "parameters": { + "accountId": { + "type": "string", + "description": "The account id associated with the budget being updated.", + "required": true, + "format": "int64", + "location": "path" + }, + "billingId": { + "type": "string", + "description": "The billing id associated with the budget being updated.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "billingId" + ], + "request": { + "$ref": "Budget" + }, + "response": { + "$ref": "Budget" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + } + } + }, + "clientaccess": { + "methods": { + "delete": { + "id": "adexchangebuyer.clientaccess.delete", + "path": "clientAccess/{clientAccountId}", + "httpMethod": "DELETE", + "parameters": { + "clientAccountId": { + "type": "string", + "required": true, + "format": "int64", + "location": "path" + }, + "sponsorAccountId": { + "type": "integer", + "required": true, + "format": "int32", + "location": "query" + } + }, + "parameterOrder": [ + "clientAccountId", + "sponsorAccountId" + ], + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "get": { + "id": "adexchangebuyer.clientaccess.get", + "path": "clientAccess/{clientAccountId}", + "httpMethod": "GET", + "parameters": { + "clientAccountId": { + "type": "string", + "required": true, + "format": "int64", + "location": "path" + }, + "sponsorAccountId": { + "type": "integer", + "required": true, + "format": "int32", + "location": "query" + } + }, + "parameterOrder": [ + "clientAccountId", + "sponsorAccountId" + ], + "response": { + "$ref": "ClientAccessCapabilities" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "insert": { + "id": "adexchangebuyer.clientaccess.insert", + "path": "clientAccess", + "httpMethod": "POST", + "parameters": { + "clientAccountId": { + "type": "string", + "format": "int64", + "location": "query" + }, + "sponsorAccountId": { + "type": "integer", + "format": "int32", + "location": "query" + } + }, + "request": { + "$ref": "ClientAccessCapabilities" + }, + "response": { + "$ref": "ClientAccessCapabilities" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "list": { + "id": "adexchangebuyer.clientaccess.list", + "path": "clientAccess", + "httpMethod": "GET", + "request": { + "$ref": "ListClientAccessCapabilitiesRequest" + }, + "response": { + "$ref": "ListClientAccessCapabilitiesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "patch": { + "id": "adexchangebuyer.clientaccess.patch", + "path": "clientAccess/{clientAccountId}", + "httpMethod": "PATCH", + "parameters": { + "clientAccountId": { + "type": "string", + "required": true, + "format": "int64", + "location": "path" + }, + "sponsorAccountId": { + "type": "integer", + "required": true, + "format": "int32", + "location": "query" + } + }, + "parameterOrder": [ + "clientAccountId", + "sponsorAccountId" + ], + "request": { + "$ref": "ClientAccessCapabilities" + }, + "response": { + "$ref": "ClientAccessCapabilities" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "update": { + "id": "adexchangebuyer.clientaccess.update", + "path": "clientAccess/{clientAccountId}", + "httpMethod": "PUT", + "parameters": { + "clientAccountId": { + "type": "string", + "required": true, + "format": "int64", + "location": "path" + }, + "sponsorAccountId": { + "type": "integer", + "required": true, + "format": "int32", + "location": "query" + } + }, + "parameterOrder": [ + "clientAccountId", + "sponsorAccountId" + ], + "request": { + "$ref": "ClientAccessCapabilities" + }, + "response": { + "$ref": "ClientAccessCapabilities" + }, + "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": { + "accountId": { + "type": "integer", + "description": "When specified, only creatives for the given account ids are returned.", + "format": "int32", + "repeated": true, + "location": "query" + }, + "buyerCreativeId": { + "type": "string", + "description": "When specified, only creatives for the given buyer creative ids are returned.", + "repeated": true, + "location": "query" + }, + "dealsStatusFilter": { + "type": "string", + "description": "When specified, only creatives having the given direct deals status are returned.", + "enum": [ + "approved", + "conditionally_approved", + "disapproved", + "not_checked" + ], + "enumDescriptions": [ + "Creatives which have been approved for serving on direct deals.", + "Creatives which have been conditionally approved for serving on direct deals.", + "Creatives which have been disapproved for serving on direct deals.", + "Creatives whose direct deals status is not yet checked." + ], + "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" + }, + "openAuctionStatusFilter": { + "type": "string", + "description": "When specified, only creatives having the given open auction status are returned.", + "enum": [ + "approved", + "conditionally_approved", + "disapproved", + "not_checked" + ], + "enumDescriptions": [ + "Creatives which have been approved for serving on the open auction.", + "Creatives which have been conditionally approved for serving on the open auction.", + "Creatives which have been disapproved for serving on the open auction.", + "Creatives whose open auction status is not yet checked." + ], + "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" + ] + } + } + }, + "deals": { + "methods": { + "get": { + "id": "adexchangebuyer.deals.get", + "path": "deals/{dealId}", + "httpMethod": "GET", + "description": "Gets the requested deal.", + "parameters": { + "dealId": { + "type": "string", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "dealId" + ], + "request": { + "$ref": "GetFinalizedNegotiationByExternalDealIdRequest" + }, + "response": { + "$ref": "NegotiationDto" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + } + } + }, + "marketplacedeals": { + "methods": { + "delete": { + "id": "adexchangebuyer.marketplacedeals.delete", + "path": "marketplaceOrders/{orderId}/deals/delete", + "httpMethod": "POST", + "description": "Delete the specified deals from the order", + "parameters": { + "orderId": { + "type": "string", + "description": "The orderId to delete deals from.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "orderId" + ], + "request": { + "$ref": "DeleteOrderDealsRequest" + }, + "response": { + "$ref": "DeleteOrderDealsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "insert": { + "id": "adexchangebuyer.marketplacedeals.insert", + "path": "marketplaceOrders/{orderId}/deals/insert", + "httpMethod": "POST", + "description": "Add new deals for the specified order", + "parameters": { + "orderId": { + "type": "string", + "description": "OrderId for which deals need to be added.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "orderId" + ], + "request": { + "$ref": "AddOrderDealsRequest" + }, + "response": { + "$ref": "AddOrderDealsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "list": { + "id": "adexchangebuyer.marketplacedeals.list", + "path": "marketplaceOrders/{orderId}/deals", + "httpMethod": "GET", + "description": "List all the deals for a given order", + "parameters": { + "orderId": { + "type": "string", + "description": "The orderId to get deals for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "orderId" + ], + "response": { + "$ref": "GetOrderDealsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "update": { + "id": "adexchangebuyer.marketplacedeals.update", + "path": "marketplaceOrders/{orderId}/deals/update", + "httpMethod": "POST", + "description": "Replaces all the deals in the order with the passed in deals", + "parameters": { + "orderId": { + "type": "string", + "description": "The orderId to edit deals on.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "orderId" + ], + "request": { + "$ref": "EditAllOrderDealsRequest" + }, + "response": { + "$ref": "EditAllOrderDealsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + } + } + }, + "marketplacenotes": { + "methods": { + "insert": { + "id": "adexchangebuyer.marketplacenotes.insert", + "path": "marketplaceOrders/{orderId}/notes/insert", + "httpMethod": "POST", + "description": "Add notes to the order", + "parameters": { + "orderId": { + "type": "string", + "description": "The orderId to add notes for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "orderId" + ], + "request": { + "$ref": "AddOrderNotesRequest" + }, + "response": { + "$ref": "AddOrderNotesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "list": { + "id": "adexchangebuyer.marketplacenotes.list", + "path": "marketplaceOrders/{orderId}/notes", + "httpMethod": "GET", + "description": "Get all the notes associated with an order", + "parameters": { + "orderId": { + "type": "string", + "description": "The orderId to get notes for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "orderId" + ], + "response": { + "$ref": "GetOrderNotesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + } + } + }, + "marketplaceoffers": { + "methods": { + "get": { + "id": "adexchangebuyer.marketplaceoffers.get", + "path": "marketplaceOffers/{offerId}", + "httpMethod": "GET", + "description": "Gets the requested negotiation.", + "parameters": { + "offerId": { + "type": "string", + "description": "The offerId for the offer to get the head revision for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "offerId" + ], + "response": { + "$ref": "MarketplaceOffer" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "search": { + "id": "adexchangebuyer.marketplaceoffers.search", + "path": "marketplaceOffers/search", + "httpMethod": "GET", + "description": "Gets the requested negotiation.", + "parameters": { + "pqlQuery": { + "type": "string", + "description": "The pql query used to query for offers.", + "location": "query" + } + }, + "response": { + "$ref": "GetOffersResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + } + } + }, + "marketplaceorders": { + "methods": { + "get": { + "id": "adexchangebuyer.marketplaceorders.get", + "path": "marketplaceOrders/{orderId}", + "httpMethod": "GET", + "description": "Get an order given its id", + "parameters": { + "orderId": { + "type": "string", + "description": "Id of the order to retrieve.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "orderId" + ], + "response": { + "$ref": "MarketplaceOrder" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "insert": { + "id": "adexchangebuyer.marketplaceorders.insert", + "path": "marketplaceOrders/insert", + "httpMethod": "POST", + "description": "Create the given list of orders", + "request": { + "$ref": "CreateOrdersRequest" + }, + "response": { + "$ref": "CreateOrdersResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "patch": { + "id": "adexchangebuyer.marketplaceorders.patch", + "path": "marketplaceOrders/{orderId}/{revisionNumber}/{updateAction}", + "httpMethod": "PATCH", + "description": "Update the given order. This method supports patch semantics.", + "parameters": { + "orderId": { + "type": "string", + "description": "The order id to update.", + "required": true, + "location": "path" + }, + "revisionNumber": { + "type": "string", + "description": "The last known revision number to update. If the head revision in the marketplace database has since changed, an error will be thrown. The caller should then fetch the lastest order at head revision and retry the update at that revision.", + "required": true, + "format": "int64", + "location": "path" + }, + "updateAction": { + "type": "string", + "description": "The proposed action to take on the order.", + "required": true, + "enum": [ + "accept", + "cancel", + "propose", + "unknownAction", + "updateFinalized" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ], + "location": "path" + } + }, + "parameterOrder": [ + "orderId", + "revisionNumber", + "updateAction" + ], + "request": { + "$ref": "MarketplaceOrder" + }, + "response": { + "$ref": "MarketplaceOrder" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "search": { + "id": "adexchangebuyer.marketplaceorders.search", + "path": "marketplaceOrders/search", + "httpMethod": "GET", + "description": "Search for orders using pql query", + "parameters": { + "pqlQuery": { + "type": "string", + "description": "Query string to retrieve specific orders.", + "location": "query" + } + }, + "response": { + "$ref": "GetOrdersResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "update": { + "id": "adexchangebuyer.marketplaceorders.update", + "path": "marketplaceOrders/{orderId}/{revisionNumber}/{updateAction}", + "httpMethod": "PUT", + "description": "Update the given order", + "parameters": { + "orderId": { + "type": "string", + "description": "The order id to update.", + "required": true, + "location": "path" + }, + "revisionNumber": { + "type": "string", + "description": "The last known revision number to update. If the head revision in the marketplace database has since changed, an error will be thrown. The caller should then fetch the lastest order at head revision and retry the update at that revision.", + "required": true, + "format": "int64", + "location": "path" + }, + "updateAction": { + "type": "string", + "description": "The proposed action to take on the order.", + "required": true, + "enum": [ + "accept", + "cancel", + "propose", + "unknownAction", + "updateFinalized" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ], + "location": "path" + } + }, + "parameterOrder": [ + "orderId", + "revisionNumber", + "updateAction" + ], + "request": { + "$ref": "MarketplaceOrder" + }, + "response": { + "$ref": "MarketplaceOrder" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + } + } + }, + "negotiationrounds": { + "methods": { + "insert": { + "id": "adexchangebuyer.negotiationrounds.insert", + "path": "negotiations/{negotiationId}/negotiationrounds", + "httpMethod": "POST", + "description": "Adds the requested negotiationRound to the requested negotiation.", + "parameters": { + "negotiationId": { + "type": "string", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "negotiationId" + ], + "request": { + "$ref": "NegotiationRoundDto" + }, + "response": { + "$ref": "NegotiationRoundDto" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + } + } + }, + "negotiations": { + "methods": { + "get": { + "id": "adexchangebuyer.negotiations.get", + "path": "negotiations/{negotiationId}", + "httpMethod": "GET", + "description": "Gets the requested negotiation.", + "parameters": { + "negotiationId": { + "type": "string", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "negotiationId" + ], + "request": { + "$ref": "GetNegotiationByIdRequest" + }, + "response": { + "$ref": "NegotiationDto" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "insert": { + "id": "adexchangebuyer.negotiations.insert", + "path": "negotiations", + "httpMethod": "POST", + "description": "Creates or updates the requested negotiation.", + "request": { + "$ref": "NegotiationDto" + }, + "response": { + "$ref": "NegotiationDto" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "list": { + "id": "adexchangebuyer.negotiations.list", + "path": "negotiations", + "httpMethod": "GET", + "description": "Lists all negotiations the authenticated user has access to.", + "request": { + "$ref": "GetNegotiationsRequest" + }, + "response": { + "$ref": "GetNegotiationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + } + } + }, + "offers": { + "methods": { + "get": { + "id": "adexchangebuyer.offers.get", + "path": "offers/{offerId}", + "httpMethod": "GET", + "description": "Gets the requested offer.", + "parameters": { + "offerId": { + "type": "string", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "offerId" + ], + "response": { + "$ref": "OfferDto" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "insert": { + "id": "adexchangebuyer.offers.insert", + "path": "offers", + "httpMethod": "POST", + "description": "Creates or updates the requested offer.", + "request": { + "$ref": "OfferDto" + }, + "response": { + "$ref": "OfferDto" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "list": { + "id": "adexchangebuyer.offers.list", + "path": "offers", + "httpMethod": "GET", + "description": "Lists all offers the authenticated user has access to.", + "request": { + "$ref": "ListOffersRequest" + }, + "response": { + "$ref": "ListOffersResponse" + }, + "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" + ] + } + } + }, + "pretargetingConfig": { + "methods": { + "delete": { + "id": "adexchangebuyer.pretargetingConfig.delete", + "path": "pretargetingconfigs/{accountId}/{configId}", + "httpMethod": "DELETE", + "description": "Deletes an existing pretargeting config.", + "parameters": { + "accountId": { + "type": "string", + "description": "The account id to delete the pretargeting config for.", + "required": true, + "format": "int64", + "location": "path" + }, + "configId": { + "type": "string", + "description": "The specific id of the configuration to delete.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "configId" + ], + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "get": { + "id": "adexchangebuyer.pretargetingConfig.get", + "path": "pretargetingconfigs/{accountId}/{configId}", + "httpMethod": "GET", + "description": "Gets a specific pretargeting configuration", + "parameters": { + "accountId": { + "type": "string", + "description": "The account id to get the pretargeting config for.", + "required": true, + "format": "int64", + "location": "path" + }, + "configId": { + "type": "string", + "description": "The specific id of the configuration to retrieve.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "configId" + ], + "response": { + "$ref": "PretargetingConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "insert": { + "id": "adexchangebuyer.pretargetingConfig.insert", + "path": "pretargetingconfigs/{accountId}", + "httpMethod": "POST", + "description": "Inserts a new pretargeting configuration.", + "parameters": { + "accountId": { + "type": "string", + "description": "The account id to insert the pretargeting config for.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "accountId" + ], + "request": { + "$ref": "PretargetingConfig" + }, + "response": { + "$ref": "PretargetingConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "list": { + "id": "adexchangebuyer.pretargetingConfig.list", + "path": "pretargetingconfigs/{accountId}", + "httpMethod": "GET", + "description": "Retrieves a list of the authenticated user's pretargeting configurations.", + "parameters": { + "accountId": { + "type": "string", + "description": "The account id to get the pretargeting configs for.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "PretargetingConfigList" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "patch": { + "id": "adexchangebuyer.pretargetingConfig.patch", + "path": "pretargetingconfigs/{accountId}/{configId}", + "httpMethod": "PATCH", + "description": "Updates an existing pretargeting config. This method supports patch semantics.", + "parameters": { + "accountId": { + "type": "string", + "description": "The account id to update the pretargeting config for.", + "required": true, + "format": "int64", + "location": "path" + }, + "configId": { + "type": "string", + "description": "The specific id of the configuration to update.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "configId" + ], + "request": { + "$ref": "PretargetingConfig" + }, + "response": { + "$ref": "PretargetingConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + }, + "update": { + "id": "adexchangebuyer.pretargetingConfig.update", + "path": "pretargetingconfigs/{accountId}/{configId}", + "httpMethod": "PUT", + "description": "Updates an existing pretargeting config.", + "parameters": { + "accountId": { + "type": "string", + "description": "The account id to update the pretargeting config for.", + "required": true, + "format": "int64", + "location": "path" + }, + "configId": { + "type": "string", + "description": "The specific id of the configuration to update.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "configId" + ], + "request": { + "$ref": "PretargetingConfig" + }, + "response": { + "$ref": "PretargetingConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.buyer" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/adexchangebuyer/v1.4/adexchangebuyer-gen.go b/Godeps/_workspace/src/google.golang.org/api/adexchangebuyer/v1.4/adexchangebuyer-gen.go new file mode 100644 index 000000000..ab9f9034f --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/adexchangebuyer/v1.4/adexchangebuyer-gen.go @@ -0,0 +1,9299 @@ +// Package adexchangebuyer provides access to the Ad Exchange Buyer API. +// +// See https://developers.google.com/ad-exchange/buyer-rest +// +// Usage example: +// +// import "google.golang.org/api/adexchangebuyer/v1.4" +// ... +// adexchangebuyerService, err := adexchangebuyer.New(oauthHttpClient) +package adexchangebuyer // import "google.golang.org/api/adexchangebuyer/v1.4" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "adexchangebuyer:v1.4" +const apiName = "adexchangebuyer" +const apiVersion = "v1.4" +const basePath = "https://www.googleapis.com/adexchangebuyer/v1.4/" + +// 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.BillingInfo = NewBillingInfoService(s) + s.Budget = NewBudgetService(s) + s.Clientaccess = NewClientaccessService(s) + s.Creatives = NewCreativesService(s) + s.Deals = NewDealsService(s) + s.Marketplacedeals = NewMarketplacedealsService(s) + s.Marketplacenotes = NewMarketplacenotesService(s) + s.Marketplaceoffers = NewMarketplaceoffersService(s) + s.Marketplaceorders = NewMarketplaceordersService(s) + s.Negotiationrounds = NewNegotiationroundsService(s) + s.Negotiations = NewNegotiationsService(s) + s.Offers = NewOffersService(s) + s.PerformanceReport = NewPerformanceReportService(s) + s.PretargetingConfig = NewPretargetingConfigService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Accounts *AccountsService + + BillingInfo *BillingInfoService + + Budget *BudgetService + + Clientaccess *ClientaccessService + + Creatives *CreativesService + + Deals *DealsService + + Marketplacedeals *MarketplacedealsService + + Marketplacenotes *MarketplacenotesService + + Marketplaceoffers *MarketplaceoffersService + + Marketplaceorders *MarketplaceordersService + + Negotiationrounds *NegotiationroundsService + + Negotiations *NegotiationsService + + Offers *OffersService + + PerformanceReport *PerformanceReportService + + PretargetingConfig *PretargetingConfigService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + return rs +} + +type AccountsService struct { + s *Service +} + +func NewBillingInfoService(s *Service) *BillingInfoService { + rs := &BillingInfoService{s: s} + return rs +} + +type BillingInfoService struct { + s *Service +} + +func NewBudgetService(s *Service) *BudgetService { + rs := &BudgetService{s: s} + return rs +} + +type BudgetService struct { + s *Service +} + +func NewClientaccessService(s *Service) *ClientaccessService { + rs := &ClientaccessService{s: s} + return rs +} + +type ClientaccessService struct { + s *Service +} + +func NewCreativesService(s *Service) *CreativesService { + rs := &CreativesService{s: s} + return rs +} + +type CreativesService struct { + s *Service +} + +func NewDealsService(s *Service) *DealsService { + rs := &DealsService{s: s} + return rs +} + +type DealsService struct { + s *Service +} + +func NewMarketplacedealsService(s *Service) *MarketplacedealsService { + rs := &MarketplacedealsService{s: s} + return rs +} + +type MarketplacedealsService struct { + s *Service +} + +func NewMarketplacenotesService(s *Service) *MarketplacenotesService { + rs := &MarketplacenotesService{s: s} + return rs +} + +type MarketplacenotesService struct { + s *Service +} + +func NewMarketplaceoffersService(s *Service) *MarketplaceoffersService { + rs := &MarketplaceoffersService{s: s} + return rs +} + +type MarketplaceoffersService struct { + s *Service +} + +func NewMarketplaceordersService(s *Service) *MarketplaceordersService { + rs := &MarketplaceordersService{s: s} + return rs +} + +type MarketplaceordersService struct { + s *Service +} + +func NewNegotiationroundsService(s *Service) *NegotiationroundsService { + rs := &NegotiationroundsService{s: s} + return rs +} + +type NegotiationroundsService struct { + s *Service +} + +func NewNegotiationsService(s *Service) *NegotiationsService { + rs := &NegotiationsService{s: s} + return rs +} + +type NegotiationsService struct { + s *Service +} + +func NewOffersService(s *Service) *OffersService { + rs := &OffersService{s: s} + return rs +} + +type OffersService struct { + s *Service +} + +func NewPerformanceReportService(s *Service) *PerformanceReportService { + rs := &PerformanceReportService{s: s} + return rs +} + +type PerformanceReportService struct { + s *Service +} + +func NewPretargetingConfigService(s *Service) *PretargetingConfigService { + rs := &PretargetingConfigService{s: s} + return rs +} + +type PretargetingConfigService struct { + s *Service +} + +// Account: Configuration data for an Ad Exchange buyer account. +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"` + + // MaximumActiveCreatives: The maximum number of active creatives that + // an account can have, where a creative is active if it was inserted or + // bid with in the last 30 days. Please contact your technical account + // manager if you need to change this. + MaximumActiveCreatives int64 `json:"maximumActiveCreatives,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"` + + // NumberActiveCreatives: The number of creatives that this account + // inserted or bid with in the last 30 days. + NumberActiveCreatives int64 `json:"numberActiveCreatives,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BidderLocation") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Account) MarshalJSON() ([]byte, error) { + type noMethod Account + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "MaximumQps") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountBidderLocation) MarshalJSON() ([]byte, error) { + type noMethod AccountBidderLocation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountsList: 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. +type AccountsList struct { + // Items: A list of accounts. + Items []*Account `json:"items,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountsList) MarshalJSON() ([]byte, error) { + type noMethod AccountsList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AdSize struct { + Height int64 `json:"height,omitempty"` + + Width int64 `json:"width,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdSize) MarshalJSON() ([]byte, error) { + type noMethod AdSize + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AdSlotDto struct { + ChannelCode string `json:"channelCode,omitempty"` + + ChannelId int64 `json:"channelId,omitempty"` + + Description string `json:"description,omitempty"` + + Name string `json:"name,omitempty"` + + Size string `json:"size,omitempty"` + + WebPropertyId int64 `json:"webPropertyId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ChannelCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdSlotDto) MarshalJSON() ([]byte, error) { + type noMethod AdSlotDto + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AddOrderDealsRequest struct { + // Deals: The list of deals to add + Deals []*MarketplaceDeal `json:"deals,omitempty"` + + // OrderRevisionNumber: The last known order revision number. + OrderRevisionNumber int64 `json:"orderRevisionNumber,omitempty,string"` + + // UpdateAction: Indicates an optional action to take on the order + UpdateAction string `json:"updateAction,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Deals") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AddOrderDealsRequest) MarshalJSON() ([]byte, error) { + type noMethod AddOrderDealsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AddOrderDealsResponse struct { + // Deals: List of deals added (in the same order as passed in the + // request) + Deals []*MarketplaceDeal `json:"deals,omitempty"` + + // OrderRevisionNumber: The updated revision number for the order. + OrderRevisionNumber int64 `json:"orderRevisionNumber,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Deals") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AddOrderDealsResponse) MarshalJSON() ([]byte, error) { + type noMethod AddOrderDealsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AddOrderNotesRequest struct { + // Notes: The list of notes to add. + Notes []*MarketplaceNote `json:"notes,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Notes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AddOrderNotesRequest) MarshalJSON() ([]byte, error) { + type noMethod AddOrderNotesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AddOrderNotesResponse struct { + Notes []*MarketplaceNote `json:"notes,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Notes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AddOrderNotesResponse) MarshalJSON() ([]byte, error) { + type noMethod AddOrderNotesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AdvertiserDto struct { + Brands []*BrandDto `json:"brands,omitempty"` + + Id int64 `json:"id,omitempty,string"` + + Name string `json:"name,omitempty"` + + Status string `json:"status,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Brands") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdvertiserDto) MarshalJSON() ([]byte, error) { + type noMethod AdvertiserDto + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AudienceSegment struct { + Description string `json:"description,omitempty"` + + Id int64 `json:"id,omitempty,string"` + + Name string `json:"name,omitempty"` + + NumCookies int64 `json:"numCookies,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AudienceSegment) MarshalJSON() ([]byte, error) { + type noMethod AudienceSegment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BillingInfo: The configuration data for an Ad Exchange billing info. +type BillingInfo struct { + // AccountId: Account id. + AccountId int64 `json:"accountId,omitempty"` + + // AccountName: Account name. + AccountName string `json:"accountName,omitempty"` + + // BillingId: A list of adgroup IDs associated with this particular + // account. These IDs may show up as part of a realtime bidding + // BidRequest, which indicates a bid request for this account. + BillingId []string `json:"billingId,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BillingInfo) MarshalJSON() ([]byte, error) { + type noMethod BillingInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BillingInfoList: A billing info feed lists Billing Info the Ad +// Exchange buyer account has access to. Each entry in the feed +// corresponds to a single billing info. +type BillingInfoList struct { + // Items: A list of billing info relevant for your account. + Items []*BillingInfo `json:"items,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BillingInfoList) MarshalJSON() ([]byte, error) { + type noMethod BillingInfoList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type BrandDto struct { + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + Id int64 `json:"id,omitempty,string"` + + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AdvertiserId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BrandDto) MarshalJSON() ([]byte, error) { + type noMethod BrandDto + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Budget: The configuration data for Ad Exchange RTB - Budget API. +type Budget struct { + // AccountId: The id of the account. This is required for get and update + // requests. + AccountId int64 `json:"accountId,omitempty,string"` + + // BillingId: The billing id to determine which adgroup to provide + // budget information for. This is required for get and update requests. + BillingId int64 `json:"billingId,omitempty,string"` + + // BudgetAmount: The budget amount to apply for the billingId provided. + // This is required for update requests. + BudgetAmount int64 `json:"budgetAmount,omitempty,string"` + + // CurrencyCode: The currency code for the buyer. This cannot be altered + // here. + CurrencyCode string `json:"currencyCode,omitempty"` + + // Id: The unique id that describes this item. + Id string `json:"id,omitempty"` + + // Kind: The kind of the resource, i.e. "adexchangebuyer#budget". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Budget) MarshalJSON() ([]byte, error) { + type noMethod Budget + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Buyer struct { + // AccountId: Adx account id of the buyer. + AccountId string `json:"accountId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Buyer) MarshalJSON() ([]byte, error) { + type noMethod Buyer + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type BuyerDto struct { + AccountId int64 `json:"accountId,omitempty"` + + CustomerId int64 `json:"customerId,omitempty"` + + DisplayName string `json:"displayName,omitempty"` + + EnabledForInterestTargetingDeals bool `json:"enabledForInterestTargetingDeals,omitempty"` + + EnabledForPreferredDeals bool `json:"enabledForPreferredDeals,omitempty"` + + Id int64 `json:"id,omitempty"` + + SponsorAccountId int64 `json:"sponsorAccountId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BuyerDto) MarshalJSON() ([]byte, error) { + type noMethod BuyerDto + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ClientAccessCapabilities struct { + Capabilities []int64 `json:"capabilities,omitempty"` + + ClientAccountId int64 `json:"clientAccountId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Capabilities") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ClientAccessCapabilities) MarshalJSON() ([]byte, error) { + type noMethod ClientAccessCapabilities + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ContactInformation struct { + // Email: Email address of the contact. + Email string `json:"email,omitempty"` + + // Name: The name of the contact. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Email") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ContactInformation) MarshalJSON() ([]byte, error) { + type noMethod ContactInformation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type CreateOrdersRequest struct { + // Orders: The list of orders to create. + Orders []*MarketplaceOrder `json:"orders,omitempty"` + + WebPropertyCode string `json:"webPropertyCode,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Orders") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreateOrdersRequest) MarshalJSON() ([]byte, error) { + type noMethod CreateOrdersRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type CreateOrdersResponse struct { + // Orders: The list of orders successfully created. + Orders []*MarketplaceOrder `json:"orders,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Orders") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreateOrdersResponse) MarshalJSON() ([]byte, error) { + type noMethod CreateOrdersResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Creative: A creative and its classification data. +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"` + + // ApiUploadTimestamp: The last upload timestamp of this creative if it + // was uploaded via API. Read-only. The value of this field is + // generated, and will be ignored for uploads. (formatted RFC 3339 + // timestamp). + ApiUploadTimestamp string `json:"api_upload_timestamp,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"` + + // 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"` + + // DealsStatus: Top-level deals status. Read-only. This field should not + // be set in requests. If disapproved, an entry for + // auctionType=DIRECT_DEALS (or ALL) in servingRestrictions will also + // exist. Note that this may be nuanced with other contextual + // restrictions, in which case it may be preferable to read from + // servingRestrictions directly. + DealsStatus string `json:"dealsStatus,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"` + + // ImpressionTrackingUrl: The set of urls to be called to record an + // impression. + ImpressionTrackingUrl []string `json:"impressionTrackingUrl,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // NativeAd: If nativeAd is set, HTMLSnippet and videoURL should not be + // set. + NativeAd *CreativeNativeAd `json:"nativeAd,omitempty"` + + // OpenAuctionStatus: Top-level open auction status. Read-only. This + // field should not be set in requests. If disapproved, an entry for + // auctionType=OPEN_AUCTION (or ALL) in servingRestrictions will also + // exist. Note that this may be nuanced with other contextual + // restrictions, in which case it may be preferable to read from + // ServingRestrictions directly. + OpenAuctionStatus string `json:"openAuctionStatus,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"` + + // ServingRestrictions: The granular status of this ad in specific + // contexts. A context here relates to where something ultimately serves + // (for example, a physical location, a platform, an HTTPS vs HTTP + // request, or the type of auction). Read-only. This field should not be + // set in requests. + ServingRestrictions []*CreativeServingRestrictions `json:"servingRestrictions,omitempty"` + + // VendorType: All vendor types for the ads that may be shown from this + // snippet. + VendorType []int64 `json:"vendorType,omitempty"` + + // Version: The version for this creative. Read-only. This field should + // not be set in requests. + Version int64 `json:"version,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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "HTMLSnippet") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Creative) MarshalJSON() ([]byte, error) { + type noMethod Creative + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Details") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeCorrections) MarshalJSON() ([]byte, error) { + type noMethod CreativeCorrections + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeFilteringReasons: The filtering reasons for the creative. +// Read-only. This field should not be set in requests. +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"` + + // ForceSendFields is a list of field names (e.g. "Date") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeFilteringReasons) MarshalJSON() ([]byte, error) { + type noMethod CreativeFilteringReasons + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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 the + // creative-status-codes.txt file for different statuses. + FilteringStatus int64 `json:"filteringStatus,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FilteringCount") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeFilteringReasonsReasons) MarshalJSON() ([]byte, error) { + type noMethod CreativeFilteringReasonsReasons + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeNativeAd: If nativeAd is set, HTMLSnippet and videoURL should +// not be set. +type CreativeNativeAd struct { + Advertiser string `json:"advertiser,omitempty"` + + // AppIcon: The app icon, for app download ads. + AppIcon *CreativeNativeAdAppIcon `json:"appIcon,omitempty"` + + // Body: A long description of the ad. + Body string `json:"body,omitempty"` + + // CallToAction: A label for the button that the user is supposed to + // click. + CallToAction string `json:"callToAction,omitempty"` + + // ClickTrackingUrl: The URL to use for click tracking. + ClickTrackingUrl string `json:"clickTrackingUrl,omitempty"` + + // Headline: A short title for the ad. + Headline string `json:"headline,omitempty"` + + // Image: A large image. + Image *CreativeNativeAdImage `json:"image,omitempty"` + + // ImpressionTrackingUrl: The URLs are called when the impression is + // rendered. + ImpressionTrackingUrl []string `json:"impressionTrackingUrl,omitempty"` + + // Logo: A smaller image, for the advertiser logo. + Logo *CreativeNativeAdLogo `json:"logo,omitempty"` + + // Price: The price of the promoted app including the currency info. + Price string `json:"price,omitempty"` + + // StarRating: The app rating in the app store. Must be in the range + // [0-5]. + StarRating float64 `json:"starRating,omitempty"` + + // Store: The URL to the app store to purchase/download the promoted + // app. + Store string `json:"store,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Advertiser") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeNativeAd) MarshalJSON() ([]byte, error) { + type noMethod CreativeNativeAd + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeNativeAdAppIcon: The app icon, for app download ads. +type CreativeNativeAdAppIcon struct { + Height int64 `json:"height,omitempty"` + + Url string `json:"url,omitempty"` + + Width int64 `json:"width,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeNativeAdAppIcon) MarshalJSON() ([]byte, error) { + type noMethod CreativeNativeAdAppIcon + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeNativeAdImage: A large image. +type CreativeNativeAdImage struct { + Height int64 `json:"height,omitempty"` + + Url string `json:"url,omitempty"` + + Width int64 `json:"width,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeNativeAdImage) MarshalJSON() ([]byte, error) { + type noMethod CreativeNativeAdImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeNativeAdLogo: A smaller image, for the advertiser logo. +type CreativeNativeAdLogo struct { + Height int64 `json:"height,omitempty"` + + Url string `json:"url,omitempty"` + + Width int64 `json:"width,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeNativeAdLogo) MarshalJSON() ([]byte, error) { + type noMethod CreativeNativeAdLogo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type CreativeServingRestrictions struct { + // Contexts: All known contexts/restrictions. + Contexts []*CreativeServingRestrictionsContexts `json:"contexts,omitempty"` + + // DisapprovalReasons: The reasons for disapproval within this + // restriction, if any. Note that not all disapproval reasons may be + // categorized, so it is possible for the creative to have a status of + // DISAPPROVED or CONDITIONALLY_APPROVED with an empty list for + // disapproval_reasons. In this case, please reach out to your TAM to + // help debug the issue. + DisapprovalReasons []*CreativeServingRestrictionsDisapprovalReasons `json:"disapprovalReasons,omitempty"` + + // Reason: Why the creative is ineligible to serve in this context + // (e.g., it has been explicitly disapproved or is pending review). + Reason string `json:"reason,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Contexts") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeServingRestrictions) MarshalJSON() ([]byte, error) { + type noMethod CreativeServingRestrictions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type CreativeServingRestrictionsContexts struct { + // AuctionType: Only set when contextType=AUCTION_TYPE. Represents the + // auction types this restriction applies to. + AuctionType []string `json:"auctionType,omitempty"` + + // ContextType: The type of context (e.g., location, platform, auction + // type, SSL-ness). + ContextType string `json:"contextType,omitempty"` + + // GeoCriteriaId: Only set when contextType=LOCATION. Represents the geo + // criterias this restriction applies to. + GeoCriteriaId []int64 `json:"geoCriteriaId,omitempty"` + + // Platform: Only set when contextType=PLATFORM. Represents the + // platforms this restriction applies to. + Platform []string `json:"platform,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AuctionType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeServingRestrictionsContexts) MarshalJSON() ([]byte, error) { + type noMethod CreativeServingRestrictionsContexts + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type CreativeServingRestrictionsDisapprovalReasons 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"` + + // ForceSendFields is a list of field names (e.g. "Details") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeServingRestrictionsDisapprovalReasons) MarshalJSON() ([]byte, error) { + type noMethod CreativeServingRestrictionsDisapprovalReasons + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativesList: 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. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativesList) MarshalJSON() ([]byte, error) { + type noMethod CreativesList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DateTime struct { + Day int64 `json:"day,omitempty"` + + Hour int64 `json:"hour,omitempty"` + + Minute int64 `json:"minute,omitempty"` + + Month int64 `json:"month,omitempty"` + + Second int64 `json:"second,omitempty"` + + TimeZoneId string `json:"timeZoneId,omitempty"` + + Year int64 `json:"year,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Day") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DateTime) MarshalJSON() ([]byte, error) { + type noMethod DateTime + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DealPartyDto struct { + Buyer *BuyerDto `json:"buyer,omitempty"` + + BuyerSellerRole string `json:"buyerSellerRole,omitempty"` + + CustomerId int64 `json:"customerId,omitempty"` + + Name string `json:"name,omitempty"` + + WebProperty *WebPropertyDto `json:"webProperty,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Buyer") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DealPartyDto) MarshalJSON() ([]byte, error) { + type noMethod DealPartyDto + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DealTerms struct { + // Description: Description for the proposed terms of the deal. + Description string `json:"description,omitempty"` + + // GuaranteedFixedPriceTerms: The terms for guaranteed fixed price + // deals. + GuaranteedFixedPriceTerms *DealTermsGuaranteedFixedPriceTerms `json:"guaranteedFixedPriceTerms,omitempty"` + + // NonGuaranteedAuctionTerms: The terms for non-guaranteed auction + // deals. + NonGuaranteedAuctionTerms *DealTermsNonGuaranteedAuctionTerms `json:"nonGuaranteedAuctionTerms,omitempty"` + + // NonGuaranteedFixedPriceTerms: The terms for non-guaranteed fixed + // price deals. + NonGuaranteedFixedPriceTerms *DealTermsNonGuaranteedFixedPriceTerms `json:"nonGuaranteedFixedPriceTerms,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DealTerms) MarshalJSON() ([]byte, error) { + type noMethod DealTerms + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DealTermsGuaranteedFixedPriceTerms struct { + // FixedPrices: Fixed price for the specified buyer. + FixedPrices []*PricePerBuyer `json:"fixedPrices,omitempty"` + + // GuaranteedImpressions: Guaranteed impressions as a percentage. This + // is the percentage of guaranteed looks that the buyer is guaranteeing + // to buy. + GuaranteedImpressions int64 `json:"guaranteedImpressions,omitempty,string"` + + // GuaranteedLooks: Count of guaranteed looks. Required for deal, + // optional for offer. + GuaranteedLooks int64 `json:"guaranteedLooks,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "FixedPrices") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DealTermsGuaranteedFixedPriceTerms) MarshalJSON() ([]byte, error) { + type noMethod DealTermsGuaranteedFixedPriceTerms + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DealTermsNonGuaranteedAuctionTerms struct { + // PrivateAuctionId: Id of the corresponding private auction. + PrivateAuctionId string `json:"privateAuctionId,omitempty"` + + // ReservePricePerBuyers: Reserve price for the specified buyer. + ReservePricePerBuyers []*PricePerBuyer `json:"reservePricePerBuyers,omitempty"` + + // ForceSendFields is a list of field names (e.g. "PrivateAuctionId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DealTermsNonGuaranteedAuctionTerms) MarshalJSON() ([]byte, error) { + type noMethod DealTermsNonGuaranteedAuctionTerms + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DealTermsNonGuaranteedFixedPriceTerms struct { + // FixedPrices: Fixed price for the specified buyer. + FixedPrices []*PricePerBuyer `json:"fixedPrices,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FixedPrices") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DealTermsNonGuaranteedFixedPriceTerms) MarshalJSON() ([]byte, error) { + type noMethod DealTermsNonGuaranteedFixedPriceTerms + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DeleteOrderDealsRequest struct { + // DealIds: List of deals to delete for a given order + DealIds []string `json:"dealIds,omitempty"` + + // OrderRevisionNumber: The last known order revision number. + OrderRevisionNumber int64 `json:"orderRevisionNumber,omitempty,string"` + + UpdateAction string `json:"updateAction,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DealIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeleteOrderDealsRequest) MarshalJSON() ([]byte, error) { + type noMethod DeleteOrderDealsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DeleteOrderDealsResponse struct { + // Deals: List of deals deleted (in the same order as passed in the + // request) + Deals []*MarketplaceDeal `json:"deals,omitempty"` + + // OrderRevisionNumber: The updated revision number for the order. + OrderRevisionNumber int64 `json:"orderRevisionNumber,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Deals") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeleteOrderDealsResponse) MarshalJSON() ([]byte, error) { + type noMethod DeleteOrderDealsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DeliveryControl struct { + DeliveryRateType string `json:"deliveryRateType,omitempty"` + + FrequencyCaps []*DeliveryControlFrequencyCap `json:"frequencyCaps,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DeliveryRateType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeliveryControl) MarshalJSON() ([]byte, error) { + type noMethod DeliveryControl + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DeliveryControlFrequencyCap struct { + MaxImpressions int64 `json:"maxImpressions,omitempty"` + + NumTimeUnits int64 `json:"numTimeUnits,omitempty"` + + TimeUnitType string `json:"timeUnitType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MaxImpressions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeliveryControlFrequencyCap) MarshalJSON() ([]byte, error) { + type noMethod DeliveryControlFrequencyCap + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type EditAllOrderDealsRequest struct { + // Deals: List of deals to edit. Service may perform 3 different + // operations based on comparison of deals in this list vs deals already + // persisted in database: 1. Add new deal to order If a deal in this + // list does not exist in the order, the service will create a new deal + // and add it to the order. Validation will follow AddOrderDealsRequest. + // 2. Update existing deal in the order If a deal in this list already + // exist in the order, the service will update that existing deal to + // this new deal in the request. Validation will follow + // UpdateOrderDealsRequest. 3. Delete deals from the order (just need + // the id) If a existing deal in the order is not present in this list, + // the service will delete that deal from the order. Validation will + // follow DeleteOrderDealsRequest. + Deals []*MarketplaceDeal `json:"deals,omitempty"` + + // Order: If specified, also updates the order in the batch transaction. + // This is useful when the order and the deals need to be updated in one + // transaction. + Order *MarketplaceOrder `json:"order,omitempty"` + + // OrderRevisionNumber: The last known revision number for the order. + OrderRevisionNumber int64 `json:"orderRevisionNumber,omitempty,string"` + + // UpdateAction: Indicates an optional action to take on the order + UpdateAction string `json:"updateAction,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Deals") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EditAllOrderDealsRequest) MarshalJSON() ([]byte, error) { + type noMethod EditAllOrderDealsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type EditAllOrderDealsResponse struct { + // Deals: List of all deals in the order after edit. + Deals []*MarketplaceDeal `json:"deals,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Deals") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EditAllOrderDealsResponse) MarshalJSON() ([]byte, error) { + type noMethod EditAllOrderDealsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type EditHistoryDto struct { + CreatedByLoginName string `json:"createdByLoginName,omitempty"` + + CreatedTimeStamp int64 `json:"createdTimeStamp,omitempty,string"` + + LastUpdateTimeStamp int64 `json:"lastUpdateTimeStamp,omitempty,string"` + + LastUpdatedByLoginName string `json:"lastUpdatedByLoginName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreatedByLoginName") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EditHistoryDto) MarshalJSON() ([]byte, error) { + type noMethod EditHistoryDto + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GetFinalizedNegotiationByExternalDealIdRequest struct { + IncludePrivateAuctions bool `json:"includePrivateAuctions,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "IncludePrivateAuctions") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GetFinalizedNegotiationByExternalDealIdRequest) MarshalJSON() ([]byte, error) { + type noMethod GetFinalizedNegotiationByExternalDealIdRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GetNegotiationByIdRequest struct { + IncludePrivateAuctions bool `json:"includePrivateAuctions,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "IncludePrivateAuctions") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GetNegotiationByIdRequest) MarshalJSON() ([]byte, error) { + type noMethod GetNegotiationByIdRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GetNegotiationsRequest struct { + Finalized bool `json:"finalized,omitempty"` + + IncludePrivateAuctions bool `json:"includePrivateAuctions,omitempty"` + + SinceTimestampMillis int64 `json:"sinceTimestampMillis,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Finalized") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GetNegotiationsRequest) MarshalJSON() ([]byte, error) { + type noMethod GetNegotiationsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GetNegotiationsResponse struct { + Kind string `json:"kind,omitempty"` + + Negotiations []*NegotiationDto `json:"negotiations,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GetNegotiationsResponse) MarshalJSON() ([]byte, error) { + type noMethod GetNegotiationsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GetOffersResponse struct { + // Offers: The returned list of offers. + Offers []*MarketplaceOffer `json:"offers,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Offers") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GetOffersResponse) MarshalJSON() ([]byte, error) { + type noMethod GetOffersResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GetOrderDealsResponse struct { + // Deals: List of deals for the order + Deals []*MarketplaceDeal `json:"deals,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Deals") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GetOrderDealsResponse) MarshalJSON() ([]byte, error) { + type noMethod GetOrderDealsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GetOrderNotesResponse struct { + // Notes: The list of matching notes. + Notes []*MarketplaceNote `json:"notes,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Notes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GetOrderNotesResponse) MarshalJSON() ([]byte, error) { + type noMethod GetOrderNotesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GetOrdersResponse struct { + // Orders: The list of matching orders. + Orders []*MarketplaceOrder `json:"orders,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Orders") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GetOrdersResponse) MarshalJSON() ([]byte, error) { + type noMethod GetOrdersResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InventorySegmentTargeting struct { + NegativeAdSizes []*AdSize `json:"negativeAdSizes,omitempty"` + + NegativeAdTypeSegments []string `json:"negativeAdTypeSegments,omitempty"` + + NegativeAudienceSegments googleapi.Int64s `json:"negativeAudienceSegments,omitempty"` + + NegativeDeviceCategories googleapi.Int64s `json:"negativeDeviceCategories,omitempty"` + + NegativeIcmBrands googleapi.Int64s `json:"negativeIcmBrands,omitempty"` + + NegativeIcmInterests googleapi.Int64s `json:"negativeIcmInterests,omitempty"` + + NegativeInventorySlots []string `json:"negativeInventorySlots,omitempty"` + + NegativeKeyValues []*RuleKeyValuePair `json:"negativeKeyValues,omitempty"` + + NegativeLocations googleapi.Int64s `json:"negativeLocations,omitempty"` + + NegativeMobileApps []string `json:"negativeMobileApps,omitempty"` + + NegativeOperatingSystemVersions googleapi.Int64s `json:"negativeOperatingSystemVersions,omitempty"` + + NegativeOperatingSystems googleapi.Int64s `json:"negativeOperatingSystems,omitempty"` + + NegativeSiteUrls []string `json:"negativeSiteUrls,omitempty"` + + NegativeSizes googleapi.Int64s `json:"negativeSizes,omitempty"` + + NegativeVideoAdPositionSegments []string `json:"negativeVideoAdPositionSegments,omitempty"` + + NegativeVideoDurationSegments googleapi.Int64s `json:"negativeVideoDurationSegments,omitempty"` + + NegativeXfpAdSlots googleapi.Int64s `json:"negativeXfpAdSlots,omitempty"` + + NegativeXfpPlacements googleapi.Int64s `json:"negativeXfpPlacements,omitempty"` + + PositiveAdSizes []*AdSize `json:"positiveAdSizes,omitempty"` + + PositiveAdTypeSegments []string `json:"positiveAdTypeSegments,omitempty"` + + PositiveAudienceSegments googleapi.Int64s `json:"positiveAudienceSegments,omitempty"` + + PositiveDeviceCategories googleapi.Int64s `json:"positiveDeviceCategories,omitempty"` + + PositiveIcmBrands googleapi.Int64s `json:"positiveIcmBrands,omitempty"` + + PositiveIcmInterests googleapi.Int64s `json:"positiveIcmInterests,omitempty"` + + PositiveInventorySlots []string `json:"positiveInventorySlots,omitempty"` + + PositiveKeyValues []*RuleKeyValuePair `json:"positiveKeyValues,omitempty"` + + PositiveLocations googleapi.Int64s `json:"positiveLocations,omitempty"` + + PositiveMobileApps []string `json:"positiveMobileApps,omitempty"` + + PositiveOperatingSystemVersions googleapi.Int64s `json:"positiveOperatingSystemVersions,omitempty"` + + PositiveOperatingSystems googleapi.Int64s `json:"positiveOperatingSystems,omitempty"` + + PositiveSiteUrls []string `json:"positiveSiteUrls,omitempty"` + + PositiveSizes googleapi.Int64s `json:"positiveSizes,omitempty"` + + PositiveVideoAdPositionSegments []string `json:"positiveVideoAdPositionSegments,omitempty"` + + PositiveVideoDurationSegments googleapi.Int64s `json:"positiveVideoDurationSegments,omitempty"` + + PositiveXfpAdSlots googleapi.Int64s `json:"positiveXfpAdSlots,omitempty"` + + PositiveXfpPlacements googleapi.Int64s `json:"positiveXfpPlacements,omitempty"` + + // ForceSendFields is a list of field names (e.g. "NegativeAdSizes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InventorySegmentTargeting) MarshalJSON() ([]byte, error) { + type noMethod InventorySegmentTargeting + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ListClientAccessCapabilitiesRequest struct { + SponsorAccountId int64 `json:"sponsorAccountId,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "SponsorAccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListClientAccessCapabilitiesRequest) MarshalJSON() ([]byte, error) { + type noMethod ListClientAccessCapabilitiesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ListClientAccessCapabilitiesResponse struct { + ClientAccessPermissions []*ClientAccessCapabilities `json:"clientAccessPermissions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "ClientAccessPermissions") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListClientAccessCapabilitiesResponse) MarshalJSON() ([]byte, error) { + type noMethod ListClientAccessCapabilitiesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ListOffersRequest struct { + SinceTimestampMillis int64 `json:"sinceTimestampMillis,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. + // "SinceTimestampMillis") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListOffersRequest) MarshalJSON() ([]byte, error) { + type noMethod ListOffersRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ListOffersResponse struct { + Kind string `json:"kind,omitempty"` + + Offers []*OfferDto `json:"offers,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListOffersResponse) MarshalJSON() ([]byte, error) { + type noMethod ListOffersResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MarketplaceDeal: An order can contain multiple deals. A deal contains +// the terms and targeting information that is used for serving. +type MarketplaceDeal struct { + // BuyerPrivateData: Buyer private data (hidden from seller). + BuyerPrivateData *PrivateData `json:"buyerPrivateData,omitempty"` + + // CreationTimeMs: The time (ms since epoch) of the deal creation. + // (readonly) + CreationTimeMs int64 `json:"creationTimeMs,omitempty,string"` + + // DealId: A unique deal=id for the deal (readonly). + DealId string `json:"dealId,omitempty"` + + // DeliveryControl: The set of fields around delivery control that are + // interesting for a buyer to see but are non-negotiable. These are set + // by the publisher. This message is assigned an id of 100 since some + // day we would want to model this as a protobuf extension. + DeliveryControl *DeliveryControl `json:"deliveryControl,omitempty"` + + // ExternalDealId: The external deal id assigned to this deal once the + // deal is finalized. This is the deal-id that shows up in + // serving/reporting etc. (readonly) + ExternalDealId string `json:"externalDealId,omitempty"` + + // FlightEndTimeMs: Proposed flight end time of the deal (ms since + // epoch) This will generally be stored in a granularity of a second. + // (updatable) + FlightEndTimeMs int64 `json:"flightEndTimeMs,omitempty,string"` + + // FlightStartTimeMs: Proposed flight start time of the deal (ms since + // epoch) This will generally be stored in a granularity of a second. + // (updatable) + FlightStartTimeMs int64 `json:"flightStartTimeMs,omitempty,string"` + + // InventoryDescription: Description for the deal terms. (updatable) + InventoryDescription string `json:"inventoryDescription,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "adexchangebuyer#marketplaceDeal". + Kind string `json:"kind,omitempty"` + + // LastUpdateTimeMs: The time (ms since epoch) when the deal was last + // updated. (readonly) + LastUpdateTimeMs int64 `json:"lastUpdateTimeMs,omitempty,string"` + + // Name: The name of the deal. (updatable) + Name string `json:"name,omitempty"` + + // OfferId: The offer-id from which this deal was created. (readonly, + // except on create) + OfferId string `json:"offerId,omitempty"` + + // OfferRevisionNumber: The revision number of the offer that the deal + // was created from (readonly, except on create) + OfferRevisionNumber int64 `json:"offerRevisionNumber,omitempty,string"` + + OrderId string `json:"orderId,omitempty"` + + // SellerContacts: Optional Seller contact information for the deal + // (buyer-readonly) + SellerContacts []*ContactInformation `json:"sellerContacts,omitempty"` + + // SharedTargetings: The shared targeting visible to buyers and sellers. + // (updatable) + SharedTargetings []*SharedTargeting `json:"sharedTargetings,omitempty"` + + // SyndicationProduct: The syndication product associated with the deal. + // (readonly, except on create) + SyndicationProduct string `json:"syndicationProduct,omitempty"` + + // Terms: The negotiable terms of the deal. (updatable) + Terms *DealTerms `json:"terms,omitempty"` + + WebPropertyCode string `json:"webPropertyCode,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BuyerPrivateData") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MarketplaceDeal) MarshalJSON() ([]byte, error) { + type noMethod MarketplaceDeal + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type MarketplaceDealParty struct { + // Buyer: The buyer/seller associated with the deal. One of buyer/seller + // is specified for a deal-party. + Buyer *Buyer `json:"buyer,omitempty"` + + // Seller: The buyer/seller associated with the deal. One of + // buyer/seller is specified for a deal party. + Seller *Seller `json:"seller,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Buyer") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MarketplaceDealParty) MarshalJSON() ([]byte, error) { + type noMethod MarketplaceDealParty + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type MarketplaceLabel struct { + // AccountId: The accountId of the party that created the label. + AccountId string `json:"accountId,omitempty"` + + // CreateTimeMs: The creation time (in ms since epoch) for the label. + CreateTimeMs int64 `json:"createTimeMs,omitempty,string"` + + // DeprecatedMarketplaceDealParty: Information about the party that + // created the label. + DeprecatedMarketplaceDealParty *MarketplaceDealParty `json:"deprecatedMarketplaceDealParty,omitempty"` + + // Label: The label to use. + Label string `json:"label,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MarketplaceLabel) MarshalJSON() ([]byte, error) { + type noMethod MarketplaceLabel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MarketplaceNote: An order is associated with a bunch of notes which +// may optionally be associated with a deal and/or revision number. +type MarketplaceNote struct { + // CreatorRole: The role of the person (buyer/seller) creating the note. + // (readonly) + CreatorRole string `json:"creatorRole,omitempty"` + + // DealId: Notes can optionally be associated with a deal. (readonly, + // except on create) + DealId string `json:"dealId,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "adexchangebuyer#marketplaceNote". + Kind string `json:"kind,omitempty"` + + // Note: The actual note to attach. (readonly, except on create) + Note string `json:"note,omitempty"` + + // NoteId: The unique id for the note. (readonly) + NoteId string `json:"noteId,omitempty"` + + // OrderId: The order_id that a note is attached to. (readonly) + OrderId string `json:"orderId,omitempty"` + + // OrderRevisionNumber: If the note is associated with an order revision + // number, then store that here. (readonly, except on create) + OrderRevisionNumber int64 `json:"orderRevisionNumber,omitempty,string"` + + // TimestampMs: The timestamp (ms since epoch) that this note was + // created. (readonly) + TimestampMs int64 `json:"timestampMs,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "CreatorRole") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MarketplaceNote) MarshalJSON() ([]byte, error) { + type noMethod MarketplaceNote + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MarketplaceOffer: An offer is segment of inventory that a seller +// wishes to sell. It is associated with certain terms and targeting +// information which helps buyer know more about the inventory. Each +// field in an order can have one of the following setting: +// +// (readonly) - It is an error to try and set this field. +// (buyer-readonly) - Only the seller can set this field. +// (seller-readonly) - Only the buyer can set this field. (updatable) - +// The field is updatable at all times by either buyer or the seller. +type MarketplaceOffer struct { + // CreationTimeMs: Creation time in ms. since epoch (readonly) + CreationTimeMs int64 `json:"creationTimeMs,omitempty,string"` + + // CreatorContacts: Optional contact information for the creator of this + // offer. (buyer-readonly) + CreatorContacts []*ContactInformation `json:"creatorContacts,omitempty"` + + // FlightEndTimeMs: The proposed end time for the deal (ms since epoch) + // (buyer-readonly) + FlightEndTimeMs int64 `json:"flightEndTimeMs,omitempty,string"` + + // FlightStartTimeMs: Inventory availability dates. (times are in ms + // since epoch) The granularity is generally in the order of seconds. + // (buyer-readonly) + FlightStartTimeMs int64 `json:"flightStartTimeMs,omitempty,string"` + + // HasCreatorSignedOff: If the creator has already signed off on the + // offer, then the buyer can finalize the deal by accepting the offer as + // is. When copying to an order, if any of the terms are changed, then + // auto_finalize is automatically set to false. + HasCreatorSignedOff bool `json:"hasCreatorSignedOff,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "adexchangebuyer#marketplaceOffer". + Kind string `json:"kind,omitempty"` + + // Labels: Optional List of labels for the offer (optional, + // buyer-readonly). + Labels []*MarketplaceLabel `json:"labels,omitempty"` + + // LastUpdateTimeMs: Time of last update in ms. since epoch (readonly) + LastUpdateTimeMs int64 `json:"lastUpdateTimeMs,omitempty,string"` + + // Name: The name for this offer as set by the seller. (buyer-readonly) + Name string `json:"name,omitempty"` + + // OfferId: The unique id for the offer (readonly) + OfferId string `json:"offerId,omitempty"` + + // RevisionNumber: The revision number of the offer. (readonly) + RevisionNumber int64 `json:"revisionNumber,omitempty,string"` + + // Seller: Information about the seller that created this offer + // (readonly, except on create) + Seller *Seller `json:"seller,omitempty"` + + // SharedTargetings: Targeting that is shared between the buyer and the + // seller. Each targeting criteria has a specified key and for each key + // there is a list of inclusion value or exclusion values. + // (buyer-readonly) + SharedTargetings []*SharedTargeting `json:"sharedTargetings,omitempty"` + + // State: The state of the offer. (buyer-readonly) + State string `json:"state,omitempty"` + + // SyndicationProduct: The syndication product associated with the deal. + // (readonly, except on create) + SyndicationProduct string `json:"syndicationProduct,omitempty"` + + // Terms: The negotiable terms of the deal (buyer-readonly) + Terms *DealTerms `json:"terms,omitempty"` + + WebPropertyCode string `json:"webPropertyCode,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimeMs") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MarketplaceOffer) MarshalJSON() ([]byte, error) { + type noMethod MarketplaceOffer + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MarketplaceOrder: Represents an order in the marketplace. An order is +// the unit of negotiation between a seller and a buyer and contains +// deals which are served. Each field in an order can have one of the +// following setting: +// +// (readonly) - It is an error to try and set this field. +// (buyer-readonly) - Only the seller can set this field. +// (seller-readonly) - Only the buyer can set this field. (updatable) - +// The field is updatable at all times by either buyer or the seller. +type MarketplaceOrder struct { + // BilledBuyer: Reference to the buyer that will get billed for this + // order. (readonly) + BilledBuyer *Buyer `json:"billedBuyer,omitempty"` + + // Buyer: Reference to the buyer on the order. (readonly, except on + // create) + Buyer *Buyer `json:"buyer,omitempty"` + + // BuyerContacts: Optional contact information fort the buyer. + // (seller-readonly) + BuyerContacts []*ContactInformation `json:"buyerContacts,omitempty"` + + // BuyerPrivateData: Private data for buyer. (hidden from seller). + BuyerPrivateData *PrivateData `json:"buyerPrivateData,omitempty"` + + // HasBuyerSignedOff: When an order is in an accepted state, indicates + // whether the buyer has signed off Once both sides have signed off on a + // deal, the order can be finalized by the seller. (seller-readonly) + HasBuyerSignedOff bool `json:"hasBuyerSignedOff,omitempty"` + + // HasSellerSignedOff: When an order is in an accepted state, indicates + // whether the buyer has signed off Once both sides have signed off on a + // deal, the order can be finalized by the seller. (buyer-readonly) + HasSellerSignedOff bool `json:"hasSellerSignedOff,omitempty"` + + // IsRenegotiating: True if the order is being renegotiated (readonly). + IsRenegotiating bool `json:"isRenegotiating,omitempty"` + + // IsSetupComplete: True, if the buyside inventory setup is complete for + // this order. (readonly) + IsSetupComplete bool `json:"isSetupComplete,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "adexchangebuyer#marketplaceOrder". + Kind string `json:"kind,omitempty"` + + // Labels: List of labels associated with the order. (readonly) + Labels []*MarketplaceLabel `json:"labels,omitempty"` + + // LastUpdaterOrCommentorRole: The role of the last user that either + // updated the order or left a comment. (readonly) + LastUpdaterOrCommentorRole string `json:"lastUpdaterOrCommentorRole,omitempty"` + + LastUpdaterRole string `json:"lastUpdaterRole,omitempty"` + + // Name: The name for the order (updatable) + Name string `json:"name,omitempty"` + + // OrderId: The unique id of the order. (readonly). + OrderId string `json:"orderId,omitempty"` + + // OrderState: The current state of the order. (readonly) + OrderState string `json:"orderState,omitempty"` + + // OriginatorRole: Indicates whether the buyer/seller created the + // offer.(readonly) + OriginatorRole string `json:"originatorRole,omitempty"` + + // RevisionNumber: The revision number for the order (readonly). + RevisionNumber int64 `json:"revisionNumber,omitempty,string"` + + // RevisionTimeMs: The time (ms since epoch) when the order was last + // revised (readonly). + RevisionTimeMs int64 `json:"revisionTimeMs,omitempty,string"` + + // Seller: Reference to the seller on the order. (readonly, except on + // create) + Seller *Seller `json:"seller,omitempty"` + + // SellerContacts: Optional contact information for the seller + // (buyer-readonly). + SellerContacts []*ContactInformation `json:"sellerContacts,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BilledBuyer") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MarketplaceOrder) MarshalJSON() ([]byte, error) { + type noMethod MarketplaceOrder + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type MoneyDto struct { + CurrencyCode string `json:"currencyCode,omitempty"` + + Micros int64 `json:"micros,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "CurrencyCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MoneyDto) MarshalJSON() ([]byte, error) { + type noMethod MoneyDto + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type NegotiationDto struct { + // BilledBuyer: The billed buyer; Specified by a buyer buying through an + // intermediary. + BilledBuyer *DealPartyDto `json:"billedBuyer,omitempty"` + + // Buyer: Details of the buyer party in this negotiation. + Buyer *DealPartyDto `json:"buyer,omitempty"` + + // BuyerEmailContacts: The buyer party's contact email. + BuyerEmailContacts []string `json:"buyerEmailContacts,omitempty"` + + // DealType: The type of this deal. + DealType string `json:"dealType,omitempty"` + + // ExternalDealId: For finalized negotiations, the ID of the finalized + // deal. + ExternalDealId int64 `json:"externalDealId,omitempty,string"` + + Kind string `json:"kind,omitempty"` + + // LabelNames: A list of label names applicable to this negotiation. + LabelNames []string `json:"labelNames,omitempty"` + + // NegotiationId: The unique ID of this negotiation. + NegotiationId int64 `json:"negotiationId,omitempty,string"` + + // NegotiationRounds: The series of negotiation rounds for this + // negotiation. + NegotiationRounds []*NegotiationRoundDto `json:"negotiationRounds,omitempty"` + + // NegotiationState: The state of this negotiation. + NegotiationState string `json:"negotiationState,omitempty"` + + // OfferId: The ID of this negotiation's original offer. + OfferId int64 `json:"offerId,omitempty,string"` + + // Seller: Details of the seller party in this negotiation. + Seller *DealPartyDto `json:"seller,omitempty"` + + // SellerEmailContacts: The seller party's contact email. + SellerEmailContacts []string `json:"sellerEmailContacts,omitempty"` + + // Stats: The stats for this negotiation. + Stats *StatsDto `json:"stats,omitempty"` + + // Status: The status of this negotiation. + Status string `json:"status,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BilledBuyer") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *NegotiationDto) MarshalJSON() ([]byte, error) { + type noMethod NegotiationDto + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type NegotiationRoundDto struct { + // Action: The action performed by this negotiation round. + Action string `json:"action,omitempty"` + + // DbmPartnerId: Stores DBM partner ID for use by DBM + DbmPartnerId int64 `json:"dbmPartnerId,omitempty,string"` + + // EditHistory: The edit history of this negotiation round. + EditHistory *EditHistoryDto `json:"editHistory,omitempty"` + + Kind string `json:"kind,omitempty"` + + // NegotiationId: The ID of the negotiation to which this negotiation + // round applies. + NegotiationId int64 `json:"negotiationId,omitempty,string"` + + // Notes: Notes regarding this negotiation round. + Notes string `json:"notes,omitempty"` + + // OriginatorRole: The role, either buyer or seller, initiating this + // negotiation round. + OriginatorRole string `json:"originatorRole,omitempty"` + + // RoundNumber: The number of this negotiation round, in sequence. + RoundNumber int64 `json:"roundNumber,omitempty,string"` + + // Terms: The detailed terms proposed in this negotiation round. + Terms *TermsDto `json:"terms,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Action") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *NegotiationRoundDto) MarshalJSON() ([]byte, error) { + type noMethod NegotiationRoundDto + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OfferDto struct { + // Anonymous: Whether this offer is anonymous. + Anonymous bool `json:"anonymous,omitempty"` + + // BilledBuyer: The billed buyer; For buyer initiated offers, buying + // through an intermediary. + BilledBuyer *DealPartyDto `json:"billedBuyer,omitempty"` + + // ClosedToDealParties: The list of buyer or seller parties this offer + // is closed to. + ClosedToDealParties []*DealPartyDto `json:"closedToDealParties,omitempty"` + + // Creator: The creator of this offer. + Creator *DealPartyDto `json:"creator,omitempty"` + + // EmailContacts: The list of email contacts for this offer. + EmailContacts []string `json:"emailContacts,omitempty"` + + // IsOpen: Whether this offer is open. + IsOpen bool `json:"isOpen,omitempty"` + + Kind string `json:"kind,omitempty"` + + // LabelNames: The list of label names applicable to this offer. + LabelNames []string `json:"labelNames,omitempty"` + + // OfferId: The unique ID of this offer. + OfferId int64 `json:"offerId,omitempty,string"` + + // OfferState: The state of this offer. + OfferState string `json:"offerState,omitempty"` + + // OpenToDealParties: The list of buyer or seller parties this offer is + // open to. + OpenToDealParties []*DealPartyDto `json:"openToDealParties,omitempty"` + + // PointOfContact: The point of contact for this offer. + PointOfContact string `json:"pointOfContact,omitempty"` + + // Status: The status of this offer. + Status string `json:"status,omitempty"` + + // Terms: The terms of this offer. + Terms *TermsDto `json:"terms,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Anonymous") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OfferDto) MarshalJSON() ([]byte, error) { + type noMethod OfferDto + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PerformanceReport: The configuration data for an Ad Exchange +// performance report list. +type PerformanceReport struct { + // BidRate: The number of bid responses with an ad. + BidRate float64 `json:"bidRate,omitempty"` + + // BidRequestRate: The number of bid requests sent to your bidder. + BidRequestRate float64 `json:"bidRequestRate,omitempty"` + + // 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"` + + // FilteredBidRate: The number of bid responses that were filtered due + // to a policy violation or other errors. + FilteredBidRate float64 `json:"filteredBidRate,omitempty"` + + // HostedMatchStatusRate: Average QPS for hosted match operations. + HostedMatchStatusRate []interface{} `json:"hostedMatchStatusRate,omitempty"` + + // InventoryMatchRate: The number of potential queries based on your + // pretargeting settings. + InventoryMatchRate float64 `json:"inventoryMatchRate,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"` + + // SuccessfulRequestRate: The number of properly formed bid responses + // received by our servers within the deadline. + SuccessfulRequestRate float64 `json:"successfulRequestRate,omitempty"` + + // Timestamp: The unix timestamp of the starting time of this + // performance data. + Timestamp int64 `json:"timestamp,omitempty,string"` + + // UnsuccessfulRequestRate: The number of bid responses that were + // unsuccessful due to timeouts, incorrect formatting, etc. + UnsuccessfulRequestRate float64 `json:"unsuccessfulRequestRate,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BidRate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PerformanceReport) MarshalJSON() ([]byte, error) { + type noMethod PerformanceReport + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PerformanceReportList: 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 +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PerformanceReportList) MarshalJSON() ([]byte, error) { + type noMethod PerformanceReportList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PretargetingConfig struct { + // BillingId: The id for billing purposes, provided for reference. Leave + // this field blank for insert requests; the id will be generated + // automatically. + BillingId int64 `json:"billingId,omitempty,string"` + + // ConfigId: The config id; generated automatically. Leave this field + // blank for insert requests. + ConfigId int64 `json:"configId,omitempty,string"` + + // ConfigName: The name of the config. Must be unique. Required for all + // requests. + ConfigName string `json:"configName,omitempty"` + + // CreativeType: List must contain exactly one of + // PRETARGETING_CREATIVE_TYPE_HTML or PRETARGETING_CREATIVE_TYPE_VIDEO. + CreativeType []string `json:"creativeType,omitempty"` + + // Dimensions: Requests which allow one of these (width, height) pairs + // will match. All pairs must be supported ad dimensions. + Dimensions []*PretargetingConfigDimensions `json:"dimensions,omitempty"` + + // ExcludedContentLabels: Requests with any of these content labels will + // not match. Values are from content-labels.txt in the downloadable + // files section. + ExcludedContentLabels googleapi.Int64s `json:"excludedContentLabels,omitempty"` + + // ExcludedGeoCriteriaIds: Requests containing any of these geo criteria + // ids will not match. + ExcludedGeoCriteriaIds googleapi.Int64s `json:"excludedGeoCriteriaIds,omitempty"` + + // ExcludedPlacements: Requests containing any of these placements will + // not match. + ExcludedPlacements []*PretargetingConfigExcludedPlacements `json:"excludedPlacements,omitempty"` + + // ExcludedUserLists: Requests containing any of these users list ids + // will not match. + ExcludedUserLists googleapi.Int64s `json:"excludedUserLists,omitempty"` + + // ExcludedVerticals: Requests containing any of these vertical ids will + // not match. Values are from the publisher-verticals.txt file in the + // downloadable files section. + ExcludedVerticals googleapi.Int64s `json:"excludedVerticals,omitempty"` + + // GeoCriteriaIds: Requests containing any of these geo criteria ids + // will match. + GeoCriteriaIds googleapi.Int64s `json:"geoCriteriaIds,omitempty"` + + // IsActive: Whether this config is active. Required for all requests. + IsActive bool `json:"isActive,omitempty"` + + // Kind: The kind of the resource, i.e. + // "adexchangebuyer#pretargetingConfig". + Kind string `json:"kind,omitempty"` + + // Languages: Request containing any of these language codes will match. + Languages []string `json:"languages,omitempty"` + + // MobileCarriers: Requests containing any of these mobile carrier ids + // will match. Values are from mobile-carriers.csv in the downloadable + // files section. + MobileCarriers googleapi.Int64s `json:"mobileCarriers,omitempty"` + + // MobileDevices: Requests containing any of these mobile device ids + // will match. Values are from mobile-devices.csv in the downloadable + // files section. + MobileDevices googleapi.Int64s `json:"mobileDevices,omitempty"` + + // MobileOperatingSystemVersions: Requests containing any of these + // mobile operating system version ids will match. Values are from + // mobile-os.csv in the downloadable files section. + MobileOperatingSystemVersions googleapi.Int64s `json:"mobileOperatingSystemVersions,omitempty"` + + // Placements: Requests containing any of these placements will match. + Placements []*PretargetingConfigPlacements `json:"placements,omitempty"` + + // Platforms: Requests matching any of these platforms will match. + // Possible values are PRETARGETING_PLATFORM_MOBILE, + // PRETARGETING_PLATFORM_DESKTOP, and PRETARGETING_PLATFORM_TABLET. + Platforms []string `json:"platforms,omitempty"` + + // SupportedCreativeAttributes: Creative attributes should be declared + // here if all creatives corresponding to this pretargeting + // configuration have that creative attribute. Values are from + // pretargetable-creative-attributes.txt in the downloadable files + // section. + SupportedCreativeAttributes googleapi.Int64s `json:"supportedCreativeAttributes,omitempty"` + + // UserLists: Requests containing any of these user list ids will match. + UserLists googleapi.Int64s `json:"userLists,omitempty"` + + // VendorTypes: Requests that allow any of these vendor ids will match. + // Values are from vendors.txt in the downloadable files section. + VendorTypes googleapi.Int64s `json:"vendorTypes,omitempty"` + + // Verticals: Requests containing any of these vertical ids will match. + Verticals googleapi.Int64s `json:"verticals,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BillingId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PretargetingConfig) MarshalJSON() ([]byte, error) { + type noMethod PretargetingConfig + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PretargetingConfigDimensions struct { + // Height: Height in pixels. + Height int64 `json:"height,omitempty,string"` + + // Width: Width in pixels. + Width int64 `json:"width,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PretargetingConfigDimensions) MarshalJSON() ([]byte, error) { + type noMethod PretargetingConfigDimensions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PretargetingConfigExcludedPlacements struct { + // Token: The value of the placement. Interpretation depends on the + // placement type, e.g. URL for a site placement, channel name for a + // channel placement, app id for a mobile app placement. + Token string `json:"token,omitempty"` + + // Type: The type of the placement. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Token") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PretargetingConfigExcludedPlacements) MarshalJSON() ([]byte, error) { + type noMethod PretargetingConfigExcludedPlacements + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PretargetingConfigPlacements struct { + // Token: The value of the placement. Interpretation depends on the + // placement type, e.g. URL for a site placement, channel name for a + // channel placement, app id for a mobile app placement. + Token string `json:"token,omitempty"` + + // Type: The type of the placement. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Token") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PretargetingConfigPlacements) MarshalJSON() ([]byte, error) { + type noMethod PretargetingConfigPlacements + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PretargetingConfigList struct { + // Items: A list of pretargeting configs + Items []*PretargetingConfig `json:"items,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PretargetingConfigList) MarshalJSON() ([]byte, error) { + type noMethod PretargetingConfigList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Price struct { + // AmountMicros: The CPM value in micros. + AmountMicros float64 `json:"amountMicros,omitempty"` + + // CurrencyCode: The currency code for the price. + CurrencyCode string `json:"currencyCode,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AmountMicros") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Price) MarshalJSON() ([]byte, error) { + type noMethod Price + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PricePerBuyer: Used to specify pricing rules for buyers/advertisers. +// Each PricePerBuyer in an offer can become [0,1] deals. To check if +// there is a PricePerBuyer for a particular buyer or buyer/advertiser +// pair, we look for the most specific matching rule - we first look for +// a rule matching the buyer and advertiser, next a rule with the buyer +// but an empty advertiser list, and otherwise look for a matching rule +// where no buyer is set. +type PricePerBuyer struct { + // Buyer: The buyer who will pay this price. If unset, all buyers can + // pay this price (if the advertisers match, and there's no more + // specific rule matching the buyer). + Buyer *Buyer `json:"buyer,omitempty"` + + // Price: The specified price + Price *Price `json:"price,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Buyer") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PricePerBuyer) MarshalJSON() ([]byte, error) { + type noMethod PricePerBuyer + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PrivateData struct { + ReferenceId string `json:"referenceId,omitempty"` + + ReferencePayload string `json:"referencePayload,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ReferenceId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PrivateData) MarshalJSON() ([]byte, error) { + type noMethod PrivateData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type RuleKeyValuePair struct { + KeyName string `json:"keyName,omitempty"` + + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "KeyName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RuleKeyValuePair) MarshalJSON() ([]byte, error) { + type noMethod RuleKeyValuePair + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Seller struct { + // AccountId: The unique id for the seller. The seller fills in this + // field. The seller account id is then available to buyer in the offer. + AccountId string `json:"accountId,omitempty"` + + // SubAccountId: Optional sub-account id for the seller. + SubAccountId string `json:"subAccountId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Seller) MarshalJSON() ([]byte, error) { + type noMethod Seller + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type SharedTargeting struct { + // Exclusions: The list of values to exclude from targeting. + Exclusions []*TargetingValue `json:"exclusions,omitempty"` + + // Inclusions: The list of value to include as part of the targeting. + Inclusions []*TargetingValue `json:"inclusions,omitempty"` + + // Key: The key representing the shared targeting criterion. + Key string `json:"key,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Exclusions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SharedTargeting) MarshalJSON() ([]byte, error) { + type noMethod SharedTargeting + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type StatsDto struct { + Bids int64 `json:"bids,omitempty,string"` + + GoodBids int64 `json:"goodBids,omitempty,string"` + + Impressions int64 `json:"impressions,omitempty,string"` + + Requests int64 `json:"requests,omitempty,string"` + + Revenue *MoneyDto `json:"revenue,omitempty"` + + Spend *MoneyDto `json:"spend,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Bids") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *StatsDto) MarshalJSON() ([]byte, error) { + type noMethod StatsDto + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetingValue struct { + // CreativeSizeValue: The creative size value to exclude/include. + CreativeSizeValue *TargetingValueCreativeSize `json:"creativeSizeValue,omitempty"` + + // DayPartTargetingValue: The daypart targeting to include / exclude. + // Filled in when the key is GOOG_DAYPART_TARGETING. + DayPartTargetingValue *TargetingValueDayPartTargeting `json:"dayPartTargetingValue,omitempty"` + + // LongValue: The long value to exclude/include. + LongValue int64 `json:"longValue,omitempty,string"` + + // StringValue: The string value to exclude/include. + StringValue string `json:"stringValue,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreativeSizeValue") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetingValue) MarshalJSON() ([]byte, error) { + type noMethod TargetingValue + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetingValueCreativeSize struct { + // CompanionSizes: For video size type, the list of companion sizes. + CompanionSizes []*TargetingValueSize `json:"companionSizes,omitempty"` + + // CreativeSizeType: The Creative size type. + CreativeSizeType string `json:"creativeSizeType,omitempty"` + + // Size: For regular creative size type, specifies the size of the + // creative. + Size *TargetingValueSize `json:"size,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CompanionSizes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetingValueCreativeSize) MarshalJSON() ([]byte, error) { + type noMethod TargetingValueCreativeSize + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetingValueDayPartTargeting struct { + DayParts []*TargetingValueDayPartTargetingDayPart `json:"dayParts,omitempty"` + + TimeZoneType string `json:"timeZoneType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DayParts") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetingValueDayPartTargeting) MarshalJSON() ([]byte, error) { + type noMethod TargetingValueDayPartTargeting + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetingValueDayPartTargetingDayPart struct { + DayOfWeek string `json:"dayOfWeek,omitempty"` + + EndHour int64 `json:"endHour,omitempty"` + + EndMinute int64 `json:"endMinute,omitempty"` + + StartHour int64 `json:"startHour,omitempty"` + + StartMinute int64 `json:"startMinute,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DayOfWeek") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetingValueDayPartTargetingDayPart) MarshalJSON() ([]byte, error) { + type noMethod TargetingValueDayPartTargetingDayPart + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetingValueSize struct { + // Height: The height of the creative. + Height int64 `json:"height,omitempty"` + + // Width: The width of the creative. + Width int64 `json:"width,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetingValueSize) MarshalJSON() ([]byte, error) { + type noMethod TargetingValueSize + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TermsDto struct { + // AdSlots: The particular ad slots targeted by the offer. + AdSlots []*AdSlotDto `json:"adSlots,omitempty"` + + // Advertisers: A list of advertisers for this offer. + Advertisers []*AdvertiserDto `json:"advertisers,omitempty"` + + // AudienceSegment: The audience segment for the offer. + AudienceSegment *AudienceSegment `json:"audienceSegment,omitempty"` + + // AudienceSegmentDescription: A description of the audience segment for + // the offer. + AudienceSegmentDescription string `json:"audienceSegmentDescription,omitempty"` + + // BillingTerms: The billing terms. + BillingTerms string `json:"billingTerms,omitempty"` + + // BuyerBillingType: The buyer billing type. + BuyerBillingType string `json:"buyerBillingType,omitempty"` + + // Cpm: The cpm terms. + Cpm *MoneyDto `json:"cpm,omitempty"` + + // CreativeBlockingLevel: Whether to use or ignore publisher blocking + // rules. + CreativeBlockingLevel string `json:"creativeBlockingLevel,omitempty"` + + // CreativeReviewPolicy: Whether to use publisher review policy or AdX + // review policy. + CreativeReviewPolicy string `json:"creativeReviewPolicy,omitempty"` + + // DealPremium: The premium terms. + DealPremium *MoneyDto `json:"dealPremium,omitempty"` + + // Description: A description for these terms. + Description string `json:"description,omitempty"` + + // DescriptiveName: A descriptive name for these terms. + DescriptiveName string `json:"descriptiveName,omitempty"` + + // EndDate: The end date for the offer. + EndDate *DateTime `json:"endDate,omitempty"` + + // EstimatedImpressionsPerDay: The estimated daily impressions for the + // offer. + EstimatedImpressionsPerDay int64 `json:"estimatedImpressionsPerDay,omitempty,string"` + + // EstimatedSpend: The estimated spend for the offer. + EstimatedSpend *MoneyDto `json:"estimatedSpend,omitempty"` + + // FinalizeAutomatically: If true, the offer will finalize automatically + // when accepted. + FinalizeAutomatically bool `json:"finalizeAutomatically,omitempty"` + + // InventorySegmentTargeting: The inventory segment targeting for the + // offer. + InventorySegmentTargeting *InventorySegmentTargeting `json:"inventorySegmentTargeting,omitempty"` + + // IsReservation: Whether the offer is a reservation. + IsReservation bool `json:"isReservation,omitempty"` + + // MinimumSpendMicros: The minimum spend for the offer. + MinimumSpendMicros int64 `json:"minimumSpendMicros,omitempty,string"` + + // MinimumTrueLooks: The minimum true looks for the offer. + MinimumTrueLooks int64 `json:"minimumTrueLooks,omitempty,string"` + + // MonetizerType: The monetizer type. + MonetizerType string `json:"monetizerType,omitempty"` + + // SemiTransparent: Whether this offer is semi-transparent. + SemiTransparent bool `json:"semiTransparent,omitempty"` + + // StartDate: The start date for the offer. + StartDate *DateTime `json:"startDate,omitempty"` + + // TargetByDealId: Whether to target by deal id. + TargetByDealId bool `json:"targetByDealId,omitempty"` + + // TargetingAllAdSlots: If true, the offer targets all ad slots. + TargetingAllAdSlots bool `json:"targetingAllAdSlots,omitempty"` + + // TermsAttributes: A list of terms attributes. + TermsAttributes []string `json:"termsAttributes,omitempty"` + + // Urls: The urls applicable to the offer. + Urls []string `json:"urls,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AdSlots") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TermsDto) MarshalJSON() ([]byte, error) { + type noMethod TermsDto + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type WebPropertyDto struct { + AllowInterestTargetedAds bool `json:"allowInterestTargetedAds,omitempty"` + + EnabledForPreferredDeals bool `json:"enabledForPreferredDeals,omitempty"` + + Id int64 `json:"id,omitempty"` + + Name string `json:"name,omitempty"` + + PropertyCode string `json:"propertyCode,omitempty"` + + SiteUrls []string `json:"siteUrls,omitempty"` + + SyndicationProduct string `json:"syndicationProduct,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "AllowInterestTargetedAds") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *WebPropertyDto) MarshalJSON() ([]byte, error) { + type noMethod WebPropertyDto + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "adexchangebuyer.accounts.get": + +type AccountsGetCall struct { + s *Service + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.accounts.get" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsGetCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.accounts.list" call. +// Exactly one of *AccountsList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AccountsList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsListCall) Do() (*AccountsList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountsList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsPatchCall) Fields(s ...googleapi.Field) *AccountsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsPatchCall) Context(ctx context.Context) *AccountsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.accounts.patch" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsPatchCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsUpdateCall) Fields(s ...googleapi.Field) *AccountsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsUpdateCall) Context(ctx context.Context) *AccountsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.accounts.update" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsUpdateCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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.billingInfo.get": + +type BillingInfoGetCall struct { + s *Service + accountId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the billing information for one account specified by +// account ID. +func (r *BillingInfoService) Get(accountId int64) *BillingInfoGetCall { + c := &BillingInfoGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BillingInfoGetCall) Fields(s ...googleapi.Field) *BillingInfoGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BillingInfoGetCall) IfNoneMatch(entityTag string) *BillingInfoGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BillingInfoGetCall) Context(ctx context.Context) *BillingInfoGetCall { + c.ctx_ = ctx + return c +} + +func (c *BillingInfoGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": strconv.FormatInt(c.accountId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.billingInfo.get" call. +// Exactly one of *BillingInfo or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *BillingInfo.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *BillingInfoGetCall) Do() (*BillingInfo, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BillingInfo{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the billing information for one account specified by account ID.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.billingInfo.get", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "The account id.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "billinginfo/{accountId}", + // "response": { + // "$ref": "BillingInfo" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.billingInfo.list": + +type BillingInfoListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of billing information for all accounts of the +// authenticated user. +func (r *BillingInfoService) List() *BillingInfoListCall { + c := &BillingInfoListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BillingInfoListCall) Fields(s ...googleapi.Field) *BillingInfoListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BillingInfoListCall) IfNoneMatch(entityTag string) *BillingInfoListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BillingInfoListCall) Context(ctx context.Context) *BillingInfoListCall { + c.ctx_ = ctx + return c +} + +func (c *BillingInfoListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.billingInfo.list" call. +// Exactly one of *BillingInfoList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *BillingInfoList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BillingInfoListCall) Do() (*BillingInfoList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BillingInfoList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of billing information for all accounts of the authenticated user.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.billingInfo.list", + // "path": "billinginfo", + // "response": { + // "$ref": "BillingInfoList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.budget.get": + +type BudgetGetCall struct { + s *Service + accountId int64 + billingId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the budget information for the adgroup specified by the +// accountId and billingId. +func (r *BudgetService) Get(accountId int64, billingId int64) *BudgetGetCall { + c := &BudgetGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.billingId = billingId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BudgetGetCall) Fields(s ...googleapi.Field) *BudgetGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BudgetGetCall) IfNoneMatch(entityTag string) *BudgetGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BudgetGetCall) Context(ctx context.Context) *BudgetGetCall { + c.ctx_ = ctx + return c +} + +func (c *BudgetGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo/{accountId}/{billingId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": strconv.FormatInt(c.accountId, 10), + "billingId": strconv.FormatInt(c.billingId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.budget.get" call. +// Exactly one of *Budget or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Budget.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BudgetGetCall) Do() (*Budget, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Budget{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the budget information for the adgroup specified by the accountId and billingId.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.budget.get", + // "parameterOrder": [ + // "accountId", + // "billingId" + // ], + // "parameters": { + // "accountId": { + // "description": "The account id to get the budget information for.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "billingId": { + // "description": "The billing id to get the budget information for.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "billinginfo/{accountId}/{billingId}", + // "response": { + // "$ref": "Budget" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.budget.patch": + +type BudgetPatchCall struct { + s *Service + accountId int64 + billingId int64 + budget *Budget + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates the budget amount for the budget of the adgroup +// specified by the accountId and billingId, with the budget amount in +// the request. This method supports patch semantics. +func (r *BudgetService) Patch(accountId int64, billingId int64, budget *Budget) *BudgetPatchCall { + c := &BudgetPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.billingId = billingId + c.budget = budget + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BudgetPatchCall) Fields(s ...googleapi.Field) *BudgetPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BudgetPatchCall) Context(ctx context.Context) *BudgetPatchCall { + c.ctx_ = ctx + return c +} + +func (c *BudgetPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.budget) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo/{accountId}/{billingId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": strconv.FormatInt(c.accountId, 10), + "billingId": strconv.FormatInt(c.billingId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.budget.patch" call. +// Exactly one of *Budget or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Budget.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BudgetPatchCall) Do() (*Budget, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Budget{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "adexchangebuyer.budget.patch", + // "parameterOrder": [ + // "accountId", + // "billingId" + // ], + // "parameters": { + // "accountId": { + // "description": "The account id associated with the budget being updated.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "billingId": { + // "description": "The billing id associated with the budget being updated.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "billinginfo/{accountId}/{billingId}", + // "request": { + // "$ref": "Budget" + // }, + // "response": { + // "$ref": "Budget" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.budget.update": + +type BudgetUpdateCall struct { + s *Service + accountId int64 + billingId int64 + budget *Budget + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates the budget amount for the budget of the adgroup +// specified by the accountId and billingId, with the budget amount in +// the request. +func (r *BudgetService) Update(accountId int64, billingId int64, budget *Budget) *BudgetUpdateCall { + c := &BudgetUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.billingId = billingId + c.budget = budget + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BudgetUpdateCall) Fields(s ...googleapi.Field) *BudgetUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BudgetUpdateCall) Context(ctx context.Context) *BudgetUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *BudgetUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.budget) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo/{accountId}/{billingId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": strconv.FormatInt(c.accountId, 10), + "billingId": strconv.FormatInt(c.billingId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.budget.update" call. +// Exactly one of *Budget or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Budget.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BudgetUpdateCall) Do() (*Budget, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Budget{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request.", + // "httpMethod": "PUT", + // "id": "adexchangebuyer.budget.update", + // "parameterOrder": [ + // "accountId", + // "billingId" + // ], + // "parameters": { + // "accountId": { + // "description": "The account id associated with the budget being updated.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "billingId": { + // "description": "The billing id associated with the budget being updated.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "billinginfo/{accountId}/{billingId}", + // "request": { + // "$ref": "Budget" + // }, + // "response": { + // "$ref": "Budget" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.clientaccess.delete": + +type ClientaccessDeleteCall struct { + s *Service + clientAccountId int64 + sponsorAccountId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: +func (r *ClientaccessService) Delete(clientAccountId int64, sponsorAccountId int64) *ClientaccessDeleteCall { + c := &ClientaccessDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.clientAccountId = clientAccountId + c.sponsorAccountId = sponsorAccountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ClientaccessDeleteCall) Fields(s ...googleapi.Field) *ClientaccessDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ClientaccessDeleteCall) Context(ctx context.Context) *ClientaccessDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ClientaccessDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("sponsorAccountId", fmt.Sprintf("%v", c.sponsorAccountId)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "clientAccess/{clientAccountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "clientAccountId": strconv.FormatInt(c.clientAccountId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.clientaccess.delete" call. +func (c *ClientaccessDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "httpMethod": "DELETE", + // "id": "adexchangebuyer.clientaccess.delete", + // "parameterOrder": [ + // "clientAccountId", + // "sponsorAccountId" + // ], + // "parameters": { + // "clientAccountId": { + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sponsorAccountId": { + // "format": "int32", + // "location": "query", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "clientAccess/{clientAccountId}", + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.clientaccess.get": + +type ClientaccessGetCall struct { + s *Service + clientAccountId int64 + sponsorAccountId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: +func (r *ClientaccessService) Get(clientAccountId int64, sponsorAccountId int64) *ClientaccessGetCall { + c := &ClientaccessGetCall{s: r.s, opt_: make(map[string]interface{})} + c.clientAccountId = clientAccountId + c.sponsorAccountId = sponsorAccountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ClientaccessGetCall) Fields(s ...googleapi.Field) *ClientaccessGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ClientaccessGetCall) IfNoneMatch(entityTag string) *ClientaccessGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ClientaccessGetCall) Context(ctx context.Context) *ClientaccessGetCall { + c.ctx_ = ctx + return c +} + +func (c *ClientaccessGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("sponsorAccountId", fmt.Sprintf("%v", c.sponsorAccountId)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "clientAccess/{clientAccountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "clientAccountId": strconv.FormatInt(c.clientAccountId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.clientaccess.get" call. +// Exactly one of *ClientAccessCapabilities or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ClientAccessCapabilities.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ClientaccessGetCall) Do() (*ClientAccessCapabilities, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ClientAccessCapabilities{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "GET", + // "id": "adexchangebuyer.clientaccess.get", + // "parameterOrder": [ + // "clientAccountId", + // "sponsorAccountId" + // ], + // "parameters": { + // "clientAccountId": { + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sponsorAccountId": { + // "format": "int32", + // "location": "query", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "clientAccess/{clientAccountId}", + // "response": { + // "$ref": "ClientAccessCapabilities" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.clientaccess.insert": + +type ClientaccessInsertCall struct { + s *Service + clientaccesscapabilities *ClientAccessCapabilities + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: +func (r *ClientaccessService) Insert(clientaccesscapabilities *ClientAccessCapabilities) *ClientaccessInsertCall { + c := &ClientaccessInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.clientaccesscapabilities = clientaccesscapabilities + return c +} + +// ClientAccountId sets the optional parameter "clientAccountId": +func (c *ClientaccessInsertCall) ClientAccountId(clientAccountId int64) *ClientaccessInsertCall { + c.opt_["clientAccountId"] = clientAccountId + return c +} + +// SponsorAccountId sets the optional parameter "sponsorAccountId": +func (c *ClientaccessInsertCall) SponsorAccountId(sponsorAccountId int64) *ClientaccessInsertCall { + c.opt_["sponsorAccountId"] = sponsorAccountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ClientaccessInsertCall) Fields(s ...googleapi.Field) *ClientaccessInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ClientaccessInsertCall) Context(ctx context.Context) *ClientaccessInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ClientaccessInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.clientaccesscapabilities) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["clientAccountId"]; ok { + params.Set("clientAccountId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sponsorAccountId"]; ok { + params.Set("sponsorAccountId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "clientAccess") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.clientaccess.insert" call. +// Exactly one of *ClientAccessCapabilities or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ClientAccessCapabilities.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ClientaccessInsertCall) Do() (*ClientAccessCapabilities, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ClientAccessCapabilities{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "POST", + // "id": "adexchangebuyer.clientaccess.insert", + // "parameters": { + // "clientAccountId": { + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "sponsorAccountId": { + // "format": "int32", + // "location": "query", + // "type": "integer" + // } + // }, + // "path": "clientAccess", + // "request": { + // "$ref": "ClientAccessCapabilities" + // }, + // "response": { + // "$ref": "ClientAccessCapabilities" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.clientaccess.list": + +type ClientaccessListCall struct { + s *Service + listclientaccesscapabilitiesrequest *ListClientAccessCapabilitiesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: +func (r *ClientaccessService) List(listclientaccesscapabilitiesrequest *ListClientAccessCapabilitiesRequest) *ClientaccessListCall { + c := &ClientaccessListCall{s: r.s, opt_: make(map[string]interface{})} + c.listclientaccesscapabilitiesrequest = listclientaccesscapabilitiesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ClientaccessListCall) Fields(s ...googleapi.Field) *ClientaccessListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ClientaccessListCall) IfNoneMatch(entityTag string) *ClientaccessListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ClientaccessListCall) Context(ctx context.Context) *ClientaccessListCall { + c.ctx_ = ctx + return c +} + +func (c *ClientaccessListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "clientAccess") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.clientaccess.list" call. +// Exactly one of *ListClientAccessCapabilitiesResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListClientAccessCapabilitiesResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ClientaccessListCall) Do() (*ListClientAccessCapabilitiesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListClientAccessCapabilitiesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "GET", + // "id": "adexchangebuyer.clientaccess.list", + // "path": "clientAccess", + // "request": { + // "$ref": "ListClientAccessCapabilitiesRequest" + // }, + // "response": { + // "$ref": "ListClientAccessCapabilitiesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.clientaccess.patch": + +type ClientaccessPatchCall struct { + s *Service + clientAccountId int64 + sponsorAccountId int64 + clientaccesscapabilities *ClientAccessCapabilities + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: +func (r *ClientaccessService) Patch(clientAccountId int64, sponsorAccountId int64, clientaccesscapabilities *ClientAccessCapabilities) *ClientaccessPatchCall { + c := &ClientaccessPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.clientAccountId = clientAccountId + c.sponsorAccountId = sponsorAccountId + c.clientaccesscapabilities = clientaccesscapabilities + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ClientaccessPatchCall) Fields(s ...googleapi.Field) *ClientaccessPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ClientaccessPatchCall) Context(ctx context.Context) *ClientaccessPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ClientaccessPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.clientaccesscapabilities) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("sponsorAccountId", fmt.Sprintf("%v", c.sponsorAccountId)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "clientAccess/{clientAccountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "clientAccountId": strconv.FormatInt(c.clientAccountId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.clientaccess.patch" call. +// Exactly one of *ClientAccessCapabilities or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ClientAccessCapabilities.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ClientaccessPatchCall) Do() (*ClientAccessCapabilities, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ClientAccessCapabilities{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "PATCH", + // "id": "adexchangebuyer.clientaccess.patch", + // "parameterOrder": [ + // "clientAccountId", + // "sponsorAccountId" + // ], + // "parameters": { + // "clientAccountId": { + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sponsorAccountId": { + // "format": "int32", + // "location": "query", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "clientAccess/{clientAccountId}", + // "request": { + // "$ref": "ClientAccessCapabilities" + // }, + // "response": { + // "$ref": "ClientAccessCapabilities" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.clientaccess.update": + +type ClientaccessUpdateCall struct { + s *Service + clientAccountId int64 + sponsorAccountId int64 + clientaccesscapabilities *ClientAccessCapabilities + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: +func (r *ClientaccessService) Update(clientAccountId int64, sponsorAccountId int64, clientaccesscapabilities *ClientAccessCapabilities) *ClientaccessUpdateCall { + c := &ClientaccessUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.clientAccountId = clientAccountId + c.sponsorAccountId = sponsorAccountId + c.clientaccesscapabilities = clientaccesscapabilities + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ClientaccessUpdateCall) Fields(s ...googleapi.Field) *ClientaccessUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ClientaccessUpdateCall) Context(ctx context.Context) *ClientaccessUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ClientaccessUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.clientaccesscapabilities) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("sponsorAccountId", fmt.Sprintf("%v", c.sponsorAccountId)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "clientAccess/{clientAccountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "clientAccountId": strconv.FormatInt(c.clientAccountId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.clientaccess.update" call. +// Exactly one of *ClientAccessCapabilities or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ClientAccessCapabilities.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ClientaccessUpdateCall) Do() (*ClientAccessCapabilities, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ClientAccessCapabilities{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "PUT", + // "id": "adexchangebuyer.clientaccess.update", + // "parameterOrder": [ + // "clientAccountId", + // "sponsorAccountId" + // ], + // "parameters": { + // "clientAccountId": { + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sponsorAccountId": { + // "format": "int32", + // "location": "query", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "clientAccess/{clientAccountId}", + // "request": { + // "$ref": "ClientAccessCapabilities" + // }, + // "response": { + // "$ref": "ClientAccessCapabilities" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativesGetCall) Fields(s ...googleapi.Field) *CreativesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativesGetCall) IfNoneMatch(entityTag string) *CreativesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativesGetCall) Context(ctx context.Context) *CreativesGetCall { + c.ctx_ = ctx + return c +} + +func (c *CreativesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "creatives/{accountId}/{buyerCreativeId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": strconv.FormatInt(c.accountId, 10), + "buyerCreativeId": c.buyerCreativeId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.creatives.get" call. +// Exactly one of *Creative or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Creative.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CreativesGetCall) Do() (*Creative, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Creative{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativesInsertCall) Fields(s ...googleapi.Field) *CreativesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativesInsertCall) Context(ctx context.Context) *CreativesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CreativesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "creatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.creatives.insert" call. +// Exactly one of *Creative or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Creative.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CreativesInsertCall) Do() (*Creative, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Creative{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// AccountId sets the optional parameter "accountId": When specified, +// only creatives for the given account ids are returned. +func (c *CreativesListCall) AccountId(accountId int64) *CreativesListCall { + c.opt_["accountId"] = accountId + return c +} + +// BuyerCreativeId sets the optional parameter "buyerCreativeId": When +// specified, only creatives for the given buyer creative ids are +// returned. +func (c *CreativesListCall) BuyerCreativeId(buyerCreativeId string) *CreativesListCall { + c.opt_["buyerCreativeId"] = buyerCreativeId + return c +} + +// DealsStatusFilter sets the optional parameter "dealsStatusFilter": +// When specified, only creatives having the given direct deals status +// are returned. +// +// Possible values: +// "approved" - Creatives which have been approved for serving on +// direct deals. +// "conditionally_approved" - Creatives which have been conditionally +// approved for serving on direct deals. +// "disapproved" - Creatives which have been disapproved for serving +// on direct deals. +// "not_checked" - Creatives whose direct deals status is not yet +// checked. +func (c *CreativesListCall) DealsStatusFilter(dealsStatusFilter string) *CreativesListCall { + c.opt_["dealsStatusFilter"] = dealsStatusFilter + 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 +} + +// OpenAuctionStatusFilter sets the optional parameter +// "openAuctionStatusFilter": When specified, only creatives having the +// given open auction status are returned. +// +// Possible values: +// "approved" - Creatives which have been approved for serving on the +// open auction. +// "conditionally_approved" - Creatives which have been conditionally +// approved for serving on the open auction. +// "disapproved" - Creatives which have been disapproved for serving +// on the open auction. +// "not_checked" - Creatives whose open auction status is not yet +// checked. +func (c *CreativesListCall) OpenAuctionStatusFilter(openAuctionStatusFilter string) *CreativesListCall { + c.opt_["openAuctionStatusFilter"] = openAuctionStatusFilter + 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativesListCall) Fields(s ...googleapi.Field) *CreativesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativesListCall) IfNoneMatch(entityTag string) *CreativesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativesListCall) Context(ctx context.Context) *CreativesListCall { + c.ctx_ = ctx + return c +} + +func (c *CreativesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["accountId"]; ok { + params.Set("accountId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["buyerCreativeId"]; ok { + params.Set("buyerCreativeId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["dealsStatusFilter"]; ok { + params.Set("dealsStatusFilter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["openAuctionStatusFilter"]; ok { + params.Set("openAuctionStatusFilter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "creatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.creatives.list" call. +// Exactly one of *CreativesList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativesList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativesListCall) Do() (*CreativesList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativesList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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": { + // "accountId": { + // "description": "When specified, only creatives for the given account ids are returned.", + // "format": "int32", + // "location": "query", + // "repeated": true, + // "type": "integer" + // }, + // "buyerCreativeId": { + // "description": "When specified, only creatives for the given buyer creative ids are returned.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "dealsStatusFilter": { + // "description": "When specified, only creatives having the given direct deals status are returned.", + // "enum": [ + // "approved", + // "conditionally_approved", + // "disapproved", + // "not_checked" + // ], + // "enumDescriptions": [ + // "Creatives which have been approved for serving on direct deals.", + // "Creatives which have been conditionally approved for serving on direct deals.", + // "Creatives which have been disapproved for serving on direct deals.", + // "Creatives whose direct deals status is not yet checked." + // ], + // "location": "query", + // "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" + // }, + // "openAuctionStatusFilter": { + // "description": "When specified, only creatives having the given open auction status are returned.", + // "enum": [ + // "approved", + // "conditionally_approved", + // "disapproved", + // "not_checked" + // ], + // "enumDescriptions": [ + // "Creatives which have been approved for serving on the open auction.", + // "Creatives which have been conditionally approved for serving on the open auction.", + // "Creatives which have been disapproved for serving on the open auction.", + // "Creatives whose open auction status is not yet checked." + // ], + // "location": "query", + // "type": "string" + // }, + // "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.deals.get": + +type DealsGetCall struct { + s *Service + dealId int64 + getfinalizednegotiationbyexternaldealidrequest *GetFinalizedNegotiationByExternalDealIdRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the requested deal. +func (r *DealsService) Get(dealId int64, getfinalizednegotiationbyexternaldealidrequest *GetFinalizedNegotiationByExternalDealIdRequest) *DealsGetCall { + c := &DealsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.dealId = dealId + c.getfinalizednegotiationbyexternaldealidrequest = getfinalizednegotiationbyexternaldealidrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DealsGetCall) Fields(s ...googleapi.Field) *DealsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DealsGetCall) IfNoneMatch(entityTag string) *DealsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DealsGetCall) Context(ctx context.Context) *DealsGetCall { + c.ctx_ = ctx + return c +} + +func (c *DealsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "deals/{dealId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "dealId": strconv.FormatInt(c.dealId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.deals.get" call. +// Exactly one of *NegotiationDto or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *NegotiationDto.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DealsGetCall) Do() (*NegotiationDto, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &NegotiationDto{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the requested deal.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.deals.get", + // "parameterOrder": [ + // "dealId" + // ], + // "parameters": { + // "dealId": { + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "deals/{dealId}", + // "request": { + // "$ref": "GetFinalizedNegotiationByExternalDealIdRequest" + // }, + // "response": { + // "$ref": "NegotiationDto" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.marketplacedeals.delete": + +type MarketplacedealsDeleteCall struct { + s *Service + orderId string + deleteorderdealsrequest *DeleteOrderDealsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Delete the specified deals from the order +func (r *MarketplacedealsService) Delete(orderId string, deleteorderdealsrequest *DeleteOrderDealsRequest) *MarketplacedealsDeleteCall { + c := &MarketplacedealsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.orderId = orderId + c.deleteorderdealsrequest = deleteorderdealsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MarketplacedealsDeleteCall) Fields(s ...googleapi.Field) *MarketplacedealsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MarketplacedealsDeleteCall) Context(ctx context.Context) *MarketplacedealsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *MarketplacedealsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.deleteorderdealsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "marketplaceOrders/{orderId}/deals/delete") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "orderId": c.orderId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.marketplacedeals.delete" call. +// Exactly one of *DeleteOrderDealsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *DeleteOrderDealsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MarketplacedealsDeleteCall) Do() (*DeleteOrderDealsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DeleteOrderDealsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Delete the specified deals from the order", + // "httpMethod": "POST", + // "id": "adexchangebuyer.marketplacedeals.delete", + // "parameterOrder": [ + // "orderId" + // ], + // "parameters": { + // "orderId": { + // "description": "The orderId to delete deals from.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "marketplaceOrders/{orderId}/deals/delete", + // "request": { + // "$ref": "DeleteOrderDealsRequest" + // }, + // "response": { + // "$ref": "DeleteOrderDealsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.marketplacedeals.insert": + +type MarketplacedealsInsertCall struct { + s *Service + orderId string + addorderdealsrequest *AddOrderDealsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Add new deals for the specified order +func (r *MarketplacedealsService) Insert(orderId string, addorderdealsrequest *AddOrderDealsRequest) *MarketplacedealsInsertCall { + c := &MarketplacedealsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.orderId = orderId + c.addorderdealsrequest = addorderdealsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MarketplacedealsInsertCall) Fields(s ...googleapi.Field) *MarketplacedealsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MarketplacedealsInsertCall) Context(ctx context.Context) *MarketplacedealsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *MarketplacedealsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.addorderdealsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "marketplaceOrders/{orderId}/deals/insert") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "orderId": c.orderId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.marketplacedeals.insert" call. +// Exactly one of *AddOrderDealsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AddOrderDealsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MarketplacedealsInsertCall) Do() (*AddOrderDealsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AddOrderDealsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add new deals for the specified order", + // "httpMethod": "POST", + // "id": "adexchangebuyer.marketplacedeals.insert", + // "parameterOrder": [ + // "orderId" + // ], + // "parameters": { + // "orderId": { + // "description": "OrderId for which deals need to be added.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "marketplaceOrders/{orderId}/deals/insert", + // "request": { + // "$ref": "AddOrderDealsRequest" + // }, + // "response": { + // "$ref": "AddOrderDealsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.marketplacedeals.list": + +type MarketplacedealsListCall struct { + s *Service + orderId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List all the deals for a given order +func (r *MarketplacedealsService) List(orderId string) *MarketplacedealsListCall { + c := &MarketplacedealsListCall{s: r.s, opt_: make(map[string]interface{})} + c.orderId = orderId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MarketplacedealsListCall) Fields(s ...googleapi.Field) *MarketplacedealsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MarketplacedealsListCall) IfNoneMatch(entityTag string) *MarketplacedealsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MarketplacedealsListCall) Context(ctx context.Context) *MarketplacedealsListCall { + c.ctx_ = ctx + return c +} + +func (c *MarketplacedealsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "marketplaceOrders/{orderId}/deals") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "orderId": c.orderId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.marketplacedeals.list" call. +// Exactly one of *GetOrderDealsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GetOrderDealsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MarketplacedealsListCall) Do() (*GetOrderDealsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &GetOrderDealsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all the deals for a given order", + // "httpMethod": "GET", + // "id": "adexchangebuyer.marketplacedeals.list", + // "parameterOrder": [ + // "orderId" + // ], + // "parameters": { + // "orderId": { + // "description": "The orderId to get deals for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "marketplaceOrders/{orderId}/deals", + // "response": { + // "$ref": "GetOrderDealsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.marketplacedeals.update": + +type MarketplacedealsUpdateCall struct { + s *Service + orderId string + editallorderdealsrequest *EditAllOrderDealsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Replaces all the deals in the order with the passed in deals +func (r *MarketplacedealsService) Update(orderId string, editallorderdealsrequest *EditAllOrderDealsRequest) *MarketplacedealsUpdateCall { + c := &MarketplacedealsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.orderId = orderId + c.editallorderdealsrequest = editallorderdealsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MarketplacedealsUpdateCall) Fields(s ...googleapi.Field) *MarketplacedealsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MarketplacedealsUpdateCall) Context(ctx context.Context) *MarketplacedealsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *MarketplacedealsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.editallorderdealsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "marketplaceOrders/{orderId}/deals/update") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "orderId": c.orderId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.marketplacedeals.update" call. +// Exactly one of *EditAllOrderDealsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *EditAllOrderDealsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MarketplacedealsUpdateCall) Do() (*EditAllOrderDealsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EditAllOrderDealsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Replaces all the deals in the order with the passed in deals", + // "httpMethod": "POST", + // "id": "adexchangebuyer.marketplacedeals.update", + // "parameterOrder": [ + // "orderId" + // ], + // "parameters": { + // "orderId": { + // "description": "The orderId to edit deals on.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "marketplaceOrders/{orderId}/deals/update", + // "request": { + // "$ref": "EditAllOrderDealsRequest" + // }, + // "response": { + // "$ref": "EditAllOrderDealsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.marketplacenotes.insert": + +type MarketplacenotesInsertCall struct { + s *Service + orderId string + addordernotesrequest *AddOrderNotesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Add notes to the order +func (r *MarketplacenotesService) Insert(orderId string, addordernotesrequest *AddOrderNotesRequest) *MarketplacenotesInsertCall { + c := &MarketplacenotesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.orderId = orderId + c.addordernotesrequest = addordernotesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MarketplacenotesInsertCall) Fields(s ...googleapi.Field) *MarketplacenotesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MarketplacenotesInsertCall) Context(ctx context.Context) *MarketplacenotesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *MarketplacenotesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.addordernotesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "marketplaceOrders/{orderId}/notes/insert") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "orderId": c.orderId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.marketplacenotes.insert" call. +// Exactly one of *AddOrderNotesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AddOrderNotesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MarketplacenotesInsertCall) Do() (*AddOrderNotesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AddOrderNotesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add notes to the order", + // "httpMethod": "POST", + // "id": "adexchangebuyer.marketplacenotes.insert", + // "parameterOrder": [ + // "orderId" + // ], + // "parameters": { + // "orderId": { + // "description": "The orderId to add notes for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "marketplaceOrders/{orderId}/notes/insert", + // "request": { + // "$ref": "AddOrderNotesRequest" + // }, + // "response": { + // "$ref": "AddOrderNotesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.marketplacenotes.list": + +type MarketplacenotesListCall struct { + s *Service + orderId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Get all the notes associated with an order +func (r *MarketplacenotesService) List(orderId string) *MarketplacenotesListCall { + c := &MarketplacenotesListCall{s: r.s, opt_: make(map[string]interface{})} + c.orderId = orderId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MarketplacenotesListCall) Fields(s ...googleapi.Field) *MarketplacenotesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MarketplacenotesListCall) IfNoneMatch(entityTag string) *MarketplacenotesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MarketplacenotesListCall) Context(ctx context.Context) *MarketplacenotesListCall { + c.ctx_ = ctx + return c +} + +func (c *MarketplacenotesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "marketplaceOrders/{orderId}/notes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "orderId": c.orderId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.marketplacenotes.list" call. +// Exactly one of *GetOrderNotesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GetOrderNotesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MarketplacenotesListCall) Do() (*GetOrderNotesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &GetOrderNotesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get all the notes associated with an order", + // "httpMethod": "GET", + // "id": "adexchangebuyer.marketplacenotes.list", + // "parameterOrder": [ + // "orderId" + // ], + // "parameters": { + // "orderId": { + // "description": "The orderId to get notes for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "marketplaceOrders/{orderId}/notes", + // "response": { + // "$ref": "GetOrderNotesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.marketplaceoffers.get": + +type MarketplaceoffersGetCall struct { + s *Service + offerId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the requested negotiation. +func (r *MarketplaceoffersService) Get(offerId string) *MarketplaceoffersGetCall { + c := &MarketplaceoffersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.offerId = offerId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MarketplaceoffersGetCall) Fields(s ...googleapi.Field) *MarketplaceoffersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MarketplaceoffersGetCall) IfNoneMatch(entityTag string) *MarketplaceoffersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MarketplaceoffersGetCall) Context(ctx context.Context) *MarketplaceoffersGetCall { + c.ctx_ = ctx + return c +} + +func (c *MarketplaceoffersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "marketplaceOffers/{offerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "offerId": c.offerId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.marketplaceoffers.get" call. +// Exactly one of *MarketplaceOffer or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *MarketplaceOffer.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MarketplaceoffersGetCall) Do() (*MarketplaceOffer, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &MarketplaceOffer{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the requested negotiation.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.marketplaceoffers.get", + // "parameterOrder": [ + // "offerId" + // ], + // "parameters": { + // "offerId": { + // "description": "The offerId for the offer to get the head revision for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "marketplaceOffers/{offerId}", + // "response": { + // "$ref": "MarketplaceOffer" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.marketplaceoffers.search": + +type MarketplaceoffersSearchCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// Search: Gets the requested negotiation. +func (r *MarketplaceoffersService) Search() *MarketplaceoffersSearchCall { + c := &MarketplaceoffersSearchCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// PqlQuery sets the optional parameter "pqlQuery": The pql query used +// to query for offers. +func (c *MarketplaceoffersSearchCall) PqlQuery(pqlQuery string) *MarketplaceoffersSearchCall { + c.opt_["pqlQuery"] = pqlQuery + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MarketplaceoffersSearchCall) Fields(s ...googleapi.Field) *MarketplaceoffersSearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MarketplaceoffersSearchCall) IfNoneMatch(entityTag string) *MarketplaceoffersSearchCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MarketplaceoffersSearchCall) Context(ctx context.Context) *MarketplaceoffersSearchCall { + c.ctx_ = ctx + return c +} + +func (c *MarketplaceoffersSearchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["pqlQuery"]; ok { + params.Set("pqlQuery", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "marketplaceOffers/search") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.marketplaceoffers.search" call. +// Exactly one of *GetOffersResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GetOffersResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MarketplaceoffersSearchCall) Do() (*GetOffersResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &GetOffersResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the requested negotiation.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.marketplaceoffers.search", + // "parameters": { + // "pqlQuery": { + // "description": "The pql query used to query for offers.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "marketplaceOffers/search", + // "response": { + // "$ref": "GetOffersResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.marketplaceorders.get": + +type MarketplaceordersGetCall struct { + s *Service + orderId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Get an order given its id +func (r *MarketplaceordersService) Get(orderId string) *MarketplaceordersGetCall { + c := &MarketplaceordersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.orderId = orderId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MarketplaceordersGetCall) Fields(s ...googleapi.Field) *MarketplaceordersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MarketplaceordersGetCall) IfNoneMatch(entityTag string) *MarketplaceordersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MarketplaceordersGetCall) Context(ctx context.Context) *MarketplaceordersGetCall { + c.ctx_ = ctx + return c +} + +func (c *MarketplaceordersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "marketplaceOrders/{orderId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "orderId": c.orderId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.marketplaceorders.get" call. +// Exactly one of *MarketplaceOrder or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *MarketplaceOrder.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MarketplaceordersGetCall) Do() (*MarketplaceOrder, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &MarketplaceOrder{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get an order given its id", + // "httpMethod": "GET", + // "id": "adexchangebuyer.marketplaceorders.get", + // "parameterOrder": [ + // "orderId" + // ], + // "parameters": { + // "orderId": { + // "description": "Id of the order to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "marketplaceOrders/{orderId}", + // "response": { + // "$ref": "MarketplaceOrder" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.marketplaceorders.insert": + +type MarketplaceordersInsertCall struct { + s *Service + createordersrequest *CreateOrdersRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Create the given list of orders +func (r *MarketplaceordersService) Insert(createordersrequest *CreateOrdersRequest) *MarketplaceordersInsertCall { + c := &MarketplaceordersInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.createordersrequest = createordersrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MarketplaceordersInsertCall) Fields(s ...googleapi.Field) *MarketplaceordersInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MarketplaceordersInsertCall) Context(ctx context.Context) *MarketplaceordersInsertCall { + c.ctx_ = ctx + return c +} + +func (c *MarketplaceordersInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.createordersrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "marketplaceOrders/insert") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.marketplaceorders.insert" call. +// Exactly one of *CreateOrdersResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CreateOrdersResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MarketplaceordersInsertCall) Do() (*CreateOrdersResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreateOrdersResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create the given list of orders", + // "httpMethod": "POST", + // "id": "adexchangebuyer.marketplaceorders.insert", + // "path": "marketplaceOrders/insert", + // "request": { + // "$ref": "CreateOrdersRequest" + // }, + // "response": { + // "$ref": "CreateOrdersResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.marketplaceorders.patch": + +type MarketplaceordersPatchCall struct { + s *Service + orderId string + revisionNumber int64 + updateAction string + marketplaceorder *MarketplaceOrder + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Update the given order. This method supports patch semantics. +func (r *MarketplaceordersService) Patch(orderId string, revisionNumber int64, updateAction string, marketplaceorder *MarketplaceOrder) *MarketplaceordersPatchCall { + c := &MarketplaceordersPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.orderId = orderId + c.revisionNumber = revisionNumber + c.updateAction = updateAction + c.marketplaceorder = marketplaceorder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MarketplaceordersPatchCall) Fields(s ...googleapi.Field) *MarketplaceordersPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MarketplaceordersPatchCall) Context(ctx context.Context) *MarketplaceordersPatchCall { + c.ctx_ = ctx + return c +} + +func (c *MarketplaceordersPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.marketplaceorder) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "marketplaceOrders/{orderId}/{revisionNumber}/{updateAction}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "orderId": c.orderId, + "revisionNumber": strconv.FormatInt(c.revisionNumber, 10), + "updateAction": c.updateAction, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.marketplaceorders.patch" call. +// Exactly one of *MarketplaceOrder or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *MarketplaceOrder.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MarketplaceordersPatchCall) Do() (*MarketplaceOrder, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &MarketplaceOrder{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update the given order. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "adexchangebuyer.marketplaceorders.patch", + // "parameterOrder": [ + // "orderId", + // "revisionNumber", + // "updateAction" + // ], + // "parameters": { + // "orderId": { + // "description": "The order id to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "revisionNumber": { + // "description": "The last known revision number to update. If the head revision in the marketplace database has since changed, an error will be thrown. The caller should then fetch the lastest order at head revision and retry the update at that revision.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "updateAction": { + // "description": "The proposed action to take on the order.", + // "enum": [ + // "accept", + // "cancel", + // "propose", + // "unknownAction", + // "updateFinalized" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "marketplaceOrders/{orderId}/{revisionNumber}/{updateAction}", + // "request": { + // "$ref": "MarketplaceOrder" + // }, + // "response": { + // "$ref": "MarketplaceOrder" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.marketplaceorders.search": + +type MarketplaceordersSearchCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// Search: Search for orders using pql query +func (r *MarketplaceordersService) Search() *MarketplaceordersSearchCall { + c := &MarketplaceordersSearchCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// PqlQuery sets the optional parameter "pqlQuery": Query string to +// retrieve specific orders. +func (c *MarketplaceordersSearchCall) PqlQuery(pqlQuery string) *MarketplaceordersSearchCall { + c.opt_["pqlQuery"] = pqlQuery + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MarketplaceordersSearchCall) Fields(s ...googleapi.Field) *MarketplaceordersSearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MarketplaceordersSearchCall) IfNoneMatch(entityTag string) *MarketplaceordersSearchCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MarketplaceordersSearchCall) Context(ctx context.Context) *MarketplaceordersSearchCall { + c.ctx_ = ctx + return c +} + +func (c *MarketplaceordersSearchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["pqlQuery"]; ok { + params.Set("pqlQuery", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "marketplaceOrders/search") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.marketplaceorders.search" call. +// Exactly one of *GetOrdersResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GetOrdersResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MarketplaceordersSearchCall) Do() (*GetOrdersResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &GetOrdersResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Search for orders using pql query", + // "httpMethod": "GET", + // "id": "adexchangebuyer.marketplaceorders.search", + // "parameters": { + // "pqlQuery": { + // "description": "Query string to retrieve specific orders.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "marketplaceOrders/search", + // "response": { + // "$ref": "GetOrdersResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.marketplaceorders.update": + +type MarketplaceordersUpdateCall struct { + s *Service + orderId string + revisionNumber int64 + updateAction string + marketplaceorder *MarketplaceOrder + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Update the given order +func (r *MarketplaceordersService) Update(orderId string, revisionNumber int64, updateAction string, marketplaceorder *MarketplaceOrder) *MarketplaceordersUpdateCall { + c := &MarketplaceordersUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.orderId = orderId + c.revisionNumber = revisionNumber + c.updateAction = updateAction + c.marketplaceorder = marketplaceorder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MarketplaceordersUpdateCall) Fields(s ...googleapi.Field) *MarketplaceordersUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MarketplaceordersUpdateCall) Context(ctx context.Context) *MarketplaceordersUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *MarketplaceordersUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.marketplaceorder) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "marketplaceOrders/{orderId}/{revisionNumber}/{updateAction}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "orderId": c.orderId, + "revisionNumber": strconv.FormatInt(c.revisionNumber, 10), + "updateAction": c.updateAction, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.marketplaceorders.update" call. +// Exactly one of *MarketplaceOrder or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *MarketplaceOrder.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MarketplaceordersUpdateCall) Do() (*MarketplaceOrder, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &MarketplaceOrder{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update the given order", + // "httpMethod": "PUT", + // "id": "adexchangebuyer.marketplaceorders.update", + // "parameterOrder": [ + // "orderId", + // "revisionNumber", + // "updateAction" + // ], + // "parameters": { + // "orderId": { + // "description": "The order id to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "revisionNumber": { + // "description": "The last known revision number to update. If the head revision in the marketplace database has since changed, an error will be thrown. The caller should then fetch the lastest order at head revision and retry the update at that revision.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "updateAction": { + // "description": "The proposed action to take on the order.", + // "enum": [ + // "accept", + // "cancel", + // "propose", + // "unknownAction", + // "updateFinalized" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "marketplaceOrders/{orderId}/{revisionNumber}/{updateAction}", + // "request": { + // "$ref": "MarketplaceOrder" + // }, + // "response": { + // "$ref": "MarketplaceOrder" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.negotiationrounds.insert": + +type NegotiationroundsInsertCall struct { + s *Service + negotiationId int64 + negotiationrounddto *NegotiationRoundDto + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Adds the requested negotiationRound to the requested +// negotiation. +func (r *NegotiationroundsService) Insert(negotiationId int64, negotiationrounddto *NegotiationRoundDto) *NegotiationroundsInsertCall { + c := &NegotiationroundsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.negotiationId = negotiationId + c.negotiationrounddto = negotiationrounddto + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *NegotiationroundsInsertCall) Fields(s ...googleapi.Field) *NegotiationroundsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *NegotiationroundsInsertCall) Context(ctx context.Context) *NegotiationroundsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *NegotiationroundsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.negotiationrounddto) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "negotiations/{negotiationId}/negotiationrounds") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "negotiationId": strconv.FormatInt(c.negotiationId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.negotiationrounds.insert" call. +// Exactly one of *NegotiationRoundDto or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *NegotiationRoundDto.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *NegotiationroundsInsertCall) Do() (*NegotiationRoundDto, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &NegotiationRoundDto{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds the requested negotiationRound to the requested negotiation.", + // "httpMethod": "POST", + // "id": "adexchangebuyer.negotiationrounds.insert", + // "parameterOrder": [ + // "negotiationId" + // ], + // "parameters": { + // "negotiationId": { + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "negotiations/{negotiationId}/negotiationrounds", + // "request": { + // "$ref": "NegotiationRoundDto" + // }, + // "response": { + // "$ref": "NegotiationRoundDto" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.negotiations.get": + +type NegotiationsGetCall struct { + s *Service + negotiationId int64 + getnegotiationbyidrequest *GetNegotiationByIdRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the requested negotiation. +func (r *NegotiationsService) Get(negotiationId int64, getnegotiationbyidrequest *GetNegotiationByIdRequest) *NegotiationsGetCall { + c := &NegotiationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.negotiationId = negotiationId + c.getnegotiationbyidrequest = getnegotiationbyidrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *NegotiationsGetCall) Fields(s ...googleapi.Field) *NegotiationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *NegotiationsGetCall) IfNoneMatch(entityTag string) *NegotiationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *NegotiationsGetCall) Context(ctx context.Context) *NegotiationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *NegotiationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "negotiations/{negotiationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "negotiationId": strconv.FormatInt(c.negotiationId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.negotiations.get" call. +// Exactly one of *NegotiationDto or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *NegotiationDto.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *NegotiationsGetCall) Do() (*NegotiationDto, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &NegotiationDto{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the requested negotiation.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.negotiations.get", + // "parameterOrder": [ + // "negotiationId" + // ], + // "parameters": { + // "negotiationId": { + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "negotiations/{negotiationId}", + // "request": { + // "$ref": "GetNegotiationByIdRequest" + // }, + // "response": { + // "$ref": "NegotiationDto" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.negotiations.insert": + +type NegotiationsInsertCall struct { + s *Service + negotiationdto *NegotiationDto + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates or updates the requested negotiation. +func (r *NegotiationsService) Insert(negotiationdto *NegotiationDto) *NegotiationsInsertCall { + c := &NegotiationsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.negotiationdto = negotiationdto + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *NegotiationsInsertCall) Fields(s ...googleapi.Field) *NegotiationsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *NegotiationsInsertCall) Context(ctx context.Context) *NegotiationsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *NegotiationsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.negotiationdto) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "negotiations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.negotiations.insert" call. +// Exactly one of *NegotiationDto or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *NegotiationDto.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *NegotiationsInsertCall) Do() (*NegotiationDto, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &NegotiationDto{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates or updates the requested negotiation.", + // "httpMethod": "POST", + // "id": "adexchangebuyer.negotiations.insert", + // "path": "negotiations", + // "request": { + // "$ref": "NegotiationDto" + // }, + // "response": { + // "$ref": "NegotiationDto" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.negotiations.list": + +type NegotiationsListCall struct { + s *Service + getnegotiationsrequest *GetNegotiationsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all negotiations the authenticated user has access to. +func (r *NegotiationsService) List(getnegotiationsrequest *GetNegotiationsRequest) *NegotiationsListCall { + c := &NegotiationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.getnegotiationsrequest = getnegotiationsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *NegotiationsListCall) Fields(s ...googleapi.Field) *NegotiationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *NegotiationsListCall) IfNoneMatch(entityTag string) *NegotiationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *NegotiationsListCall) Context(ctx context.Context) *NegotiationsListCall { + c.ctx_ = ctx + return c +} + +func (c *NegotiationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "negotiations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.negotiations.list" call. +// Exactly one of *GetNegotiationsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GetNegotiationsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *NegotiationsListCall) Do() (*GetNegotiationsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &GetNegotiationsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all negotiations the authenticated user has access to.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.negotiations.list", + // "path": "negotiations", + // "request": { + // "$ref": "GetNegotiationsRequest" + // }, + // "response": { + // "$ref": "GetNegotiationsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.offers.get": + +type OffersGetCall struct { + s *Service + offerId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the requested offer. +func (r *OffersService) Get(offerId int64) *OffersGetCall { + c := &OffersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.offerId = offerId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OffersGetCall) Fields(s ...googleapi.Field) *OffersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OffersGetCall) IfNoneMatch(entityTag string) *OffersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OffersGetCall) Context(ctx context.Context) *OffersGetCall { + c.ctx_ = ctx + return c +} + +func (c *OffersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "offers/{offerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "offerId": strconv.FormatInt(c.offerId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.offers.get" call. +// Exactly one of *OfferDto or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *OfferDto.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OffersGetCall) Do() (*OfferDto, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OfferDto{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the requested offer.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.offers.get", + // "parameterOrder": [ + // "offerId" + // ], + // "parameters": { + // "offerId": { + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "offers/{offerId}", + // "response": { + // "$ref": "OfferDto" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.offers.insert": + +type OffersInsertCall struct { + s *Service + offerdto *OfferDto + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates or updates the requested offer. +func (r *OffersService) Insert(offerdto *OfferDto) *OffersInsertCall { + c := &OffersInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.offerdto = offerdto + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OffersInsertCall) Fields(s ...googleapi.Field) *OffersInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OffersInsertCall) Context(ctx context.Context) *OffersInsertCall { + c.ctx_ = ctx + return c +} + +func (c *OffersInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.offerdto) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "offers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.offers.insert" call. +// Exactly one of *OfferDto or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *OfferDto.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OffersInsertCall) Do() (*OfferDto, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OfferDto{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates or updates the requested offer.", + // "httpMethod": "POST", + // "id": "adexchangebuyer.offers.insert", + // "path": "offers", + // "request": { + // "$ref": "OfferDto" + // }, + // "response": { + // "$ref": "OfferDto" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.offers.list": + +type OffersListCall struct { + s *Service + listoffersrequest *ListOffersRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all offers the authenticated user has access to. +func (r *OffersService) List(listoffersrequest *ListOffersRequest) *OffersListCall { + c := &OffersListCall{s: r.s, opt_: make(map[string]interface{})} + c.listoffersrequest = listoffersrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OffersListCall) Fields(s ...googleapi.Field) *OffersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OffersListCall) IfNoneMatch(entityTag string) *OffersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OffersListCall) Context(ctx context.Context) *OffersListCall { + c.ctx_ = ctx + return c +} + +func (c *OffersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "offers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.offers.list" call. +// Exactly one of *ListOffersResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListOffersResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OffersListCall) Do() (*ListOffersResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListOffersResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all offers the authenticated user has access to.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.offers.list", + // "path": "offers", + // "request": { + // "$ref": "ListOffersRequest" + // }, + // "response": { + // "$ref": "ListOffersResponse" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PerformanceReportListCall) Fields(s ...googleapi.Field) *PerformanceReportListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PerformanceReportListCall) IfNoneMatch(entityTag string) *PerformanceReportListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PerformanceReportListCall) Context(ctx context.Context) *PerformanceReportListCall { + c.ctx_ = ctx + return c +} + +func (c *PerformanceReportListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.performanceReport.list" call. +// Exactly one of *PerformanceReportList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PerformanceReportList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PerformanceReportListCall) Do() (*PerformanceReportList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PerformanceReportList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the 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" + // ] + // } + +} + +// method id "adexchangebuyer.pretargetingConfig.delete": + +type PretargetingConfigDeleteCall struct { + s *Service + accountId int64 + configId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing pretargeting config. +func (r *PretargetingConfigService) Delete(accountId int64, configId int64) *PretargetingConfigDeleteCall { + c := &PretargetingConfigDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.configId = configId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PretargetingConfigDeleteCall) Fields(s ...googleapi.Field) *PretargetingConfigDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PretargetingConfigDeleteCall) Context(ctx context.Context) *PretargetingConfigDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *PretargetingConfigDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}/{configId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": strconv.FormatInt(c.accountId, 10), + "configId": strconv.FormatInt(c.configId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.pretargetingConfig.delete" call. +func (c *PretargetingConfigDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing pretargeting config.", + // "httpMethod": "DELETE", + // "id": "adexchangebuyer.pretargetingConfig.delete", + // "parameterOrder": [ + // "accountId", + // "configId" + // ], + // "parameters": { + // "accountId": { + // "description": "The account id to delete the pretargeting config for.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "configId": { + // "description": "The specific id of the configuration to delete.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "pretargetingconfigs/{accountId}/{configId}", + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.pretargetingConfig.get": + +type PretargetingConfigGetCall struct { + s *Service + accountId int64 + configId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a specific pretargeting configuration +func (r *PretargetingConfigService) Get(accountId int64, configId int64) *PretargetingConfigGetCall { + c := &PretargetingConfigGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.configId = configId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PretargetingConfigGetCall) Fields(s ...googleapi.Field) *PretargetingConfigGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PretargetingConfigGetCall) IfNoneMatch(entityTag string) *PretargetingConfigGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PretargetingConfigGetCall) Context(ctx context.Context) *PretargetingConfigGetCall { + c.ctx_ = ctx + return c +} + +func (c *PretargetingConfigGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}/{configId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": strconv.FormatInt(c.accountId, 10), + "configId": strconv.FormatInt(c.configId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.pretargetingConfig.get" call. +// Exactly one of *PretargetingConfig or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PretargetingConfig.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PretargetingConfigGetCall) Do() (*PretargetingConfig, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PretargetingConfig{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a specific pretargeting configuration", + // "httpMethod": "GET", + // "id": "adexchangebuyer.pretargetingConfig.get", + // "parameterOrder": [ + // "accountId", + // "configId" + // ], + // "parameters": { + // "accountId": { + // "description": "The account id to get the pretargeting config for.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "configId": { + // "description": "The specific id of the configuration to retrieve.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "pretargetingconfigs/{accountId}/{configId}", + // "response": { + // "$ref": "PretargetingConfig" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.pretargetingConfig.insert": + +type PretargetingConfigInsertCall struct { + s *Service + accountId int64 + pretargetingconfig *PretargetingConfig + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new pretargeting configuration. +func (r *PretargetingConfigService) Insert(accountId int64, pretargetingconfig *PretargetingConfig) *PretargetingConfigInsertCall { + c := &PretargetingConfigInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.pretargetingconfig = pretargetingconfig + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PretargetingConfigInsertCall) Fields(s ...googleapi.Field) *PretargetingConfigInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PretargetingConfigInsertCall) Context(ctx context.Context) *PretargetingConfigInsertCall { + c.ctx_ = ctx + return c +} + +func (c *PretargetingConfigInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.pretargetingconfig) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": strconv.FormatInt(c.accountId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.pretargetingConfig.insert" call. +// Exactly one of *PretargetingConfig or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PretargetingConfig.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PretargetingConfigInsertCall) Do() (*PretargetingConfig, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PretargetingConfig{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new pretargeting configuration.", + // "httpMethod": "POST", + // "id": "adexchangebuyer.pretargetingConfig.insert", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "The account id to insert the pretargeting config for.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "pretargetingconfigs/{accountId}", + // "request": { + // "$ref": "PretargetingConfig" + // }, + // "response": { + // "$ref": "PretargetingConfig" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.pretargetingConfig.list": + +type PretargetingConfigListCall struct { + s *Service + accountId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of the authenticated user's pretargeting +// configurations. +func (r *PretargetingConfigService) List(accountId int64) *PretargetingConfigListCall { + c := &PretargetingConfigListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PretargetingConfigListCall) Fields(s ...googleapi.Field) *PretargetingConfigListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PretargetingConfigListCall) IfNoneMatch(entityTag string) *PretargetingConfigListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PretargetingConfigListCall) Context(ctx context.Context) *PretargetingConfigListCall { + c.ctx_ = ctx + return c +} + +func (c *PretargetingConfigListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": strconv.FormatInt(c.accountId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.pretargetingConfig.list" call. +// Exactly one of *PretargetingConfigList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PretargetingConfigList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PretargetingConfigListCall) Do() (*PretargetingConfigList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PretargetingConfigList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of the authenticated user's pretargeting configurations.", + // "httpMethod": "GET", + // "id": "adexchangebuyer.pretargetingConfig.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "The account id to get the pretargeting configs for.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "pretargetingconfigs/{accountId}", + // "response": { + // "$ref": "PretargetingConfigList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.pretargetingConfig.patch": + +type PretargetingConfigPatchCall struct { + s *Service + accountId int64 + configId int64 + pretargetingconfig *PretargetingConfig + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing pretargeting config. This method supports +// patch semantics. +func (r *PretargetingConfigService) Patch(accountId int64, configId int64, pretargetingconfig *PretargetingConfig) *PretargetingConfigPatchCall { + c := &PretargetingConfigPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.configId = configId + c.pretargetingconfig = pretargetingconfig + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PretargetingConfigPatchCall) Fields(s ...googleapi.Field) *PretargetingConfigPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PretargetingConfigPatchCall) Context(ctx context.Context) *PretargetingConfigPatchCall { + c.ctx_ = ctx + return c +} + +func (c *PretargetingConfigPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.pretargetingconfig) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}/{configId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": strconv.FormatInt(c.accountId, 10), + "configId": strconv.FormatInt(c.configId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.pretargetingConfig.patch" call. +// Exactly one of *PretargetingConfig or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PretargetingConfig.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PretargetingConfigPatchCall) Do() (*PretargetingConfig, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PretargetingConfig{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing pretargeting config. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "adexchangebuyer.pretargetingConfig.patch", + // "parameterOrder": [ + // "accountId", + // "configId" + // ], + // "parameters": { + // "accountId": { + // "description": "The account id to update the pretargeting config for.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "configId": { + // "description": "The specific id of the configuration to update.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "pretargetingconfigs/{accountId}/{configId}", + // "request": { + // "$ref": "PretargetingConfig" + // }, + // "response": { + // "$ref": "PretargetingConfig" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} + +// method id "adexchangebuyer.pretargetingConfig.update": + +type PretargetingConfigUpdateCall struct { + s *Service + accountId int64 + configId int64 + pretargetingconfig *PretargetingConfig + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing pretargeting config. +func (r *PretargetingConfigService) Update(accountId int64, configId int64, pretargetingconfig *PretargetingConfig) *PretargetingConfigUpdateCall { + c := &PretargetingConfigUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.configId = configId + c.pretargetingconfig = pretargetingconfig + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PretargetingConfigUpdateCall) Fields(s ...googleapi.Field) *PretargetingConfigUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PretargetingConfigUpdateCall) Context(ctx context.Context) *PretargetingConfigUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *PretargetingConfigUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.pretargetingconfig) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}/{configId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": strconv.FormatInt(c.accountId, 10), + "configId": strconv.FormatInt(c.configId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangebuyer.pretargetingConfig.update" call. +// Exactly one of *PretargetingConfig or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PretargetingConfig.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PretargetingConfigUpdateCall) Do() (*PretargetingConfig, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PretargetingConfig{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing pretargeting config.", + // "httpMethod": "PUT", + // "id": "adexchangebuyer.pretargetingConfig.update", + // "parameterOrder": [ + // "accountId", + // "configId" + // ], + // "parameters": { + // "accountId": { + // "description": "The account id to update the pretargeting config for.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "configId": { + // "description": "The specific id of the configuration to update.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "pretargetingconfigs/{accountId}/{configId}", + // "request": { + // "$ref": "PretargetingConfig" + // }, + // "response": { + // "$ref": "PretargetingConfig" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.buyer" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/adexchangeseller/v1.1/adexchangeseller-api.json b/Godeps/_workspace/src/google.golang.org/api/adexchangeseller/v1.1/adexchangeseller-api.json new file mode 100644 index 000000000..a0fe9388f --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/adexchangeseller/v1.1/adexchangeseller-api.json @@ -0,0 +1,1241 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/Ob-vIbU0CMw39spLQLZEQavYp3Q\"", + "discoveryVersion": "v1", + "id": "adexchangeseller:v1.1", + "name": "adexchangeseller", + "canonicalName": "Ad Exchange Seller", + "version": "v1.1", + "revision": "20141112", + "title": "Ad Exchange Seller API", + "description": "Gives Ad Exchange seller users access to their inventory and the ability to generate reports", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/ad-exchange/seller-rest/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/adexchangeseller/v1.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/Godeps/_workspace/src/google.golang.org/api/adexchangeseller/v1.1/adexchangeseller-gen.go b/Godeps/_workspace/src/google.golang.org/api/adexchangeseller/v1.1/adexchangeseller-gen.go new file mode 100644 index 000000000..4d183b432 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/adexchangeseller/v1.1/adexchangeseller-gen.go @@ -0,0 +1,3576 @@ +// Package adexchangeseller provides access to the Ad Exchange Seller API. +// +// See https://developers.google.com/ad-exchange/seller-rest/ +// +// Usage example: +// +// import "google.golang.org/api/adexchangeseller/v1.1" +// ... +// adexchangesellerService, err := adexchangeseller.New(oauthHttpClient) +package adexchangeseller // import "google.golang.org/api/adexchangeseller/v1.1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Accounts *AccountsService + + Adclients *AdclientsService + + Adunits *AdunitsService + + Alerts *AlertsService + + Customchannels *CustomchannelsService + + Metadata *MetadataService + + Preferreddeals *PreferreddealsService + + Reports *ReportsService + + Urlchannels *UrlchannelsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Account) MarshalJSON() ([]byte, error) { + type noMethod Account + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "ArcOptIn") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdClient) MarshalJSON() ([]byte, error) { + type noMethod AdClient + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdClients) MarshalJSON() ([]byte, error) { + type noMethod AdClients + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnit) MarshalJSON() ([]byte, error) { + type noMethod AdUnit + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnits) MarshalJSON() ([]byte, error) { + type noMethod AdUnits + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Alert) MarshalJSON() ([]byte, error) { + type noMethod Alert + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Alerts) MarshalJSON() ([]byte, error) { + type noMethod Alerts + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomChannel) MarshalJSON() ([]byte, error) { + type noMethod CustomChannel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomChannelTargetingInfo: The targeting information of this custom +// channel, if activated. +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"` + + // ForceSendFields is a list of field names (e.g. "AdsAppearOn") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomChannelTargetingInfo) MarshalJSON() ([]byte, error) { + type noMethod CustomChannelTargetingInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomChannels) MarshalJSON() ([]byte, error) { + type noMethod CustomChannels + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Metadata struct { + Items []*ReportingMetadataEntry `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adexchangeseller#metadata. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Metadata) MarshalJSON() ([]byte, error) { + type noMethod Metadata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AdvertiserName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PreferredDeal) MarshalJSON() ([]byte, error) { + type noMethod PreferredDeal + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PreferredDeals) MarshalJSON() ([]byte, error) { + type noMethod PreferredDeals + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Averages") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Report) MarshalJSON() ([]byte, error) { + type noMethod Report + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Currency") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportHeaders) MarshalJSON() ([]byte, error) { + type noMethod ReportHeaders + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. + // "CompatibleDimensions") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportingMetadataEntry) MarshalJSON() ([]byte, error) { + type noMethod ReportingMetadataEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SavedReport) MarshalJSON() ([]byte, error) { + type noMethod SavedReport + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SavedReports) MarshalJSON() ([]byte, error) { + type noMethod SavedReports + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlChannel) MarshalJSON() ([]byte, error) { + type noMethod UrlChannel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlChannels) MarshalJSON() ([]byte, error) { + type noMethod UrlChannels + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "adexchangeseller.accounts.get": + +type AccountsGetCall struct { + s *Service + accountId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.accounts.get" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsGetCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdclientsListCall) Fields(s ...googleapi.Field) *AdclientsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdclientsListCall) IfNoneMatch(entityTag string) *AdclientsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdclientsListCall) Context(ctx context.Context) *AdclientsListCall { + c.ctx_ = ctx + return c +} + +func (c *AdclientsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.adclients.list" call. +// Exactly one of *AdClients or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AdClients.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AdclientsListCall) Do() (*AdClients, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdClients{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdunitsGetCall) Fields(s ...googleapi.Field) *AdunitsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdunitsGetCall) IfNoneMatch(entityTag string) *AdunitsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdunitsGetCall) Context(ctx context.Context) *AdunitsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AdunitsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + "adUnitId": c.adUnitId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.adunits.get" call. +// Exactly one of *AdUnit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AdunitsGetCall) Do() (*AdUnit, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdunitsListCall) Fields(s ...googleapi.Field) *AdunitsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdunitsListCall) IfNoneMatch(entityTag string) *AdunitsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdunitsListCall) Context(ctx context.Context) *AdunitsListCall { + c.ctx_ = ctx + return c +} + +func (c *AdunitsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.adunits.list" call. +// Exactly one of *AdUnits or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnits.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AdunitsListCall) Do() (*AdUnits, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnits{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdunitsCustomchannelsListCall) Fields(s ...googleapi.Field) *AdunitsCustomchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdunitsCustomchannelsListCall) IfNoneMatch(entityTag string) *AdunitsCustomchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdunitsCustomchannelsListCall) Context(ctx context.Context) *AdunitsCustomchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *AdunitsCustomchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + "adUnitId": c.adUnitId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.adunits.customchannels.list" call. +// Exactly one of *CustomChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannels.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AdunitsCustomchannelsListCall) Do() (*CustomChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AlertsListCall) Fields(s ...googleapi.Field) *AlertsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AlertsListCall) IfNoneMatch(entityTag string) *AlertsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AlertsListCall) Context(ctx context.Context) *AlertsListCall { + c.ctx_ = ctx + return c +} + +func (c *AlertsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.alerts.list" call. +// Exactly one of *Alerts or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Alerts.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AlertsListCall) Do() (*Alerts, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Alerts{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomchannelsGetCall) Fields(s ...googleapi.Field) *CustomchannelsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CustomchannelsGetCall) IfNoneMatch(entityTag string) *CustomchannelsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomchannelsGetCall) Context(ctx context.Context) *CustomchannelsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CustomchannelsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + "customChannelId": c.customChannelId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.customchannels.get" call. +// Exactly one of *CustomChannel or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannel.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CustomchannelsGetCall) Do() (*CustomChannel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomchannelsListCall) Fields(s ...googleapi.Field) *CustomchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CustomchannelsListCall) IfNoneMatch(entityTag string) *CustomchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomchannelsListCall) Context(ctx context.Context) *CustomchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *CustomchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.customchannels.list" call. +// Exactly one of *CustomChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannels.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CustomchannelsListCall) Do() (*CustomChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomchannelsAdunitsListCall) Fields(s ...googleapi.Field) *CustomchannelsAdunitsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CustomchannelsAdunitsListCall) IfNoneMatch(entityTag string) *CustomchannelsAdunitsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomchannelsAdunitsListCall) Context(ctx context.Context) *CustomchannelsAdunitsListCall { + c.ctx_ = ctx + return c +} + +func (c *CustomchannelsAdunitsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + "customChannelId": c.customChannelId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.customchannels.adunits.list" call. +// Exactly one of *AdUnits or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnits.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CustomchannelsAdunitsListCall) Do() (*AdUnits, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnits{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MetadataDimensionsListCall) Fields(s ...googleapi.Field) *MetadataDimensionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MetadataDimensionsListCall) IfNoneMatch(entityTag string) *MetadataDimensionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MetadataDimensionsListCall) Context(ctx context.Context) *MetadataDimensionsListCall { + c.ctx_ = ctx + return c +} + +func (c *MetadataDimensionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "metadata/dimensions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.metadata.dimensions.list" call. +// Exactly one of *Metadata or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Metadata.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MetadataDimensionsListCall) Do() (*Metadata, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Metadata{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MetadataMetricsListCall) Fields(s ...googleapi.Field) *MetadataMetricsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MetadataMetricsListCall) IfNoneMatch(entityTag string) *MetadataMetricsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MetadataMetricsListCall) Context(ctx context.Context) *MetadataMetricsListCall { + c.ctx_ = ctx + return c +} + +func (c *MetadataMetricsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "metadata/metrics") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.metadata.metrics.list" call. +// Exactly one of *Metadata or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Metadata.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MetadataMetricsListCall) Do() (*Metadata, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Metadata{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PreferreddealsGetCall) Fields(s ...googleapi.Field) *PreferreddealsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PreferreddealsGetCall) IfNoneMatch(entityTag string) *PreferreddealsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PreferreddealsGetCall) Context(ctx context.Context) *PreferreddealsGetCall { + c.ctx_ = ctx + return c +} + +func (c *PreferreddealsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "preferreddeals/{dealId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "dealId": c.dealId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.preferreddeals.get" call. +// Exactly one of *PreferredDeal or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PreferredDeal.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PreferreddealsGetCall) Do() (*PreferredDeal, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PreferredDeal{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PreferreddealsListCall) Fields(s ...googleapi.Field) *PreferreddealsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PreferreddealsListCall) IfNoneMatch(entityTag string) *PreferreddealsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PreferreddealsListCall) Context(ctx context.Context) *PreferreddealsListCall { + c.ctx_ = ctx + return c +} + +func (c *PreferreddealsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "preferreddeals") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.preferreddeals.list" call. +// Exactly one of *PreferredDeals or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PreferredDeals.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PreferreddealsListCall) Do() (*PreferredDeals, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PreferredDeals{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsGenerateCall) Fields(s ...googleapi.Field) *ReportsGenerateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsGenerateCall) IfNoneMatch(entityTag string) *ReportsGenerateCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsGenerateCall) Context(ctx context.Context) *ReportsGenerateCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsGenerateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *ReportsGenerateCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "adexchangeseller.reports.generate" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsGenerateCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsSavedGenerateCall) Fields(s ...googleapi.Field) *ReportsSavedGenerateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsSavedGenerateCall) IfNoneMatch(entityTag string) *ReportsSavedGenerateCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsSavedGenerateCall) Context(ctx context.Context) *ReportsSavedGenerateCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsSavedGenerateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{savedReportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "savedReportId": c.savedReportId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.reports.saved.generate" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsSavedGenerateCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsSavedListCall) Fields(s ...googleapi.Field) *ReportsSavedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsSavedListCall) IfNoneMatch(entityTag string) *ReportsSavedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsSavedListCall) Context(ctx context.Context) *ReportsSavedListCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsSavedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/saved") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.reports.saved.list" call. +// Exactly one of *SavedReports or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SavedReports.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReportsSavedListCall) Do() (*SavedReports, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SavedReports{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlchannelsListCall) Fields(s ...googleapi.Field) *UrlchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UrlchannelsListCall) IfNoneMatch(entityTag string) *UrlchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlchannelsListCall) Context(ctx context.Context) *UrlchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *UrlchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/urlchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.urlchannels.list" call. +// Exactly one of *UrlChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UrlChannels.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UrlchannelsListCall) Do() (*UrlChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UrlChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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/Godeps/_workspace/src/google.golang.org/api/adexchangeseller/v1/adexchangeseller-api.json b/Godeps/_workspace/src/google.golang.org/api/adexchangeseller/v1/adexchangeseller-api.json new file mode 100644 index 000000000..a6770b259 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/adexchangeseller/v1/adexchangeseller-api.json @@ -0,0 +1,918 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/kgKc4O1bceVftsMmf3p1OXF57gg\"", + "discoveryVersion": "v1", + "id": "adexchangeseller:v1", + "name": "adexchangeseller", + "canonicalName": "Ad Exchange Seller", + "version": "v1", + "revision": "20141112", + "title": "Ad Exchange Seller API", + "description": "Gives Ad Exchange seller users access to their inventory and the ability to generate reports", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/ad-exchange/seller-rest/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/adexchangeseller/v1/", + "basePath": "/adexchangeseller/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "adexchangeseller/v1/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "csv", + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of text/csv", + "Responses with Content-Type of application/json" + ], + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.", + "location": "query" + }, + "userIp": { + "type": "string", + "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.", + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/adexchange.seller": { + "description": "View and manage your Ad Exchange data" + }, + "https://www.googleapis.com/auth/adexchange.seller.readonly": { + "description": "View your Ad Exchange data" + } + } + } + }, + "schemas": { + "AdClient": { + "id": "AdClient", + "type": "object", + "properties": { + "arcOptIn": { + "type": "boolean", + "description": "Whether this ad client is opted in to ARC." + }, + "id": { + "type": "string", + "description": "Unique identifier of this ad client." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case adexchangeseller#adClient.", + "default": "adexchangeseller#adClient" + }, + "productCode": { + "type": "string", + "description": "This ad client's product code, which corresponds to the PRODUCT_CODE report dimension." + }, + "supportsReporting": { + "type": "boolean", + "description": "Whether this ad client supports being reported on." + } + } + }, + "AdClients": { + "id": "AdClients", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The ad clients returned in this list response.", + "items": { + "$ref": "AdClient" + } + }, + "kind": { + "type": "string", + "description": "Kind of list this is, in this case adexchangeseller#adClients.", + "default": "adexchangeseller#adClients" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through ad clients. To retrieve the next page of results, set the next request's \"pageToken\" value to this." + } + } + }, + "AdUnit": { + "id": "AdUnit", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Identity code of this ad unit, not necessarily unique across ad clients." + }, + "id": { + "type": "string", + "description": "Unique identifier of this ad unit. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case adexchangeseller#adUnit.", + "default": "adexchangeseller#adUnit" + }, + "name": { + "type": "string", + "description": "Name of this ad unit." + }, + "status": { + "type": "string", + "description": "Status of this ad unit. Possible values are:\nNEW: Indicates that the ad unit was created within the last seven days and does not yet have any activity associated with it.\n\nACTIVE: Indicates that there has been activity on this ad unit in the last seven days.\n\nINACTIVE: Indicates that there has been no activity on this ad unit in the last seven days." + } + } + }, + "AdUnits": { + "id": "AdUnits", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The ad units returned in this list response.", + "items": { + "$ref": "AdUnit" + } + }, + "kind": { + "type": "string", + "description": "Kind of list this is, in this case adexchangeseller#adUnits.", + "default": "adexchangeseller#adUnits" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through ad units. To retrieve the next page of results, set the next request's \"pageToken\" value to this." + } + } + }, + "CustomChannel": { + "id": "CustomChannel", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Code of this custom channel, not necessarily unique across ad clients." + }, + "id": { + "type": "string", + "description": "Unique identifier of this custom channel. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case adexchangeseller#customChannel.", + "default": "adexchangeseller#customChannel" + }, + "name": { + "type": "string", + "description": "Name of this custom channel." + }, + "targetingInfo": { + "type": "object", + "description": "The targeting information of this custom channel, if activated.", + "properties": { + "adsAppearOn": { + "type": "string", + "description": "The name used to describe this channel externally." + }, + "description": { + "type": "string", + "description": "The external description of the channel." + }, + "location": { + "type": "string", + "description": "The locations in which ads appear. (Only valid for content and mobile content ads). Acceptable values for content ads are: TOP_LEFT, TOP_CENTER, TOP_RIGHT, MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT, BOTTOM_LEFT, BOTTOM_CENTER, BOTTOM_RIGHT, MULTIPLE_LOCATIONS. Acceptable values for mobile content ads are: TOP, MIDDLE, BOTTOM, MULTIPLE_LOCATIONS." + }, + "siteLanguage": { + "type": "string", + "description": "The language of the sites ads will be displayed on." + } + } + } + } + }, + "CustomChannels": { + "id": "CustomChannels", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The custom channels returned in this list response.", + "items": { + "$ref": "CustomChannel" + } + }, + "kind": { + "type": "string", + "description": "Kind of list this is, in this case adexchangeseller#customChannels.", + "default": "adexchangeseller#customChannels" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through custom channels. To retrieve the next page of results, set the next request's \"pageToken\" value to this." + } + } + }, + "Report": { + "id": "Report", + "type": "object", + "properties": { + "averages": { + "type": "array", + "description": "The averages of the report. This is the same length as any other row in the report; cells corresponding to dimension columns are empty.", + "items": { + "type": "string" + } + }, + "headers": { + "type": "array", + "description": "The header information of the columns requested in the report. This is a list of headers; one for each dimension in the request, followed by one for each metric in the request.", + "items": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "The currency of this column. Only present if the header type is METRIC_CURRENCY." + }, + "name": { + "type": "string", + "description": "The name of the header." + }, + "type": { + "type": "string", + "description": "The type of the header; one of DIMENSION, METRIC_TALLY, METRIC_RATIO, or METRIC_CURRENCY." + } + } + } + }, + "kind": { + "type": "string", + "description": "Kind this is, in this case adexchangeseller#report.", + "default": "adexchangeseller#report" + }, + "rows": { + "type": "array", + "description": "The output rows of the report. Each row is a list of cells; one for each dimension in the request, followed by one for each metric in the request. The dimension cells contain strings, and the metric cells contain numbers.", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "totalMatchedRows": { + "type": "string", + "description": "The total number of rows matched by the report request. Fewer rows may be returned in the response due to being limited by the row count requested or the report row limit.", + "format": "int64" + }, + "totals": { + "type": "array", + "description": "The totals of the report. This is the same length as any other row in the report; cells corresponding to dimension columns are empty.", + "items": { + "type": "string" + } + }, + "warnings": { + "type": "array", + "description": "Any warnings associated with generation of the report.", + "items": { + "type": "string" + } + } + } + }, + "SavedReport": { + "id": "SavedReport", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier of this saved report." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case adexchangeseller#savedReport.", + "default": "adexchangeseller#savedReport" + }, + "name": { + "type": "string", + "description": "This saved report's name." + } + } + }, + "SavedReports": { + "id": "SavedReports", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The saved reports returned in this list response.", + "items": { + "$ref": "SavedReport" + } + }, + "kind": { + "type": "string", + "description": "Kind of list this is, in this case adexchangeseller#savedReports.", + "default": "adexchangeseller#savedReports" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through saved reports. To retrieve the next page of results, set the next request's \"pageToken\" value to this." + } + } + }, + "UrlChannel": { + "id": "UrlChannel", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier of this URL channel. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is, in this case adexchangeseller#urlChannel.", + "default": "adexchangeseller#urlChannel" + }, + "urlPattern": { + "type": "string", + "description": "URL Pattern of this URL channel. Does not include \"http://\" or \"https://\". Example: www.example.com/home" + } + } + }, + "UrlChannels": { + "id": "UrlChannels", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "ETag of this response for caching purposes." + }, + "items": { + "type": "array", + "description": "The URL channels returned in this list response.", + "items": { + "$ref": "UrlChannel" + } + }, + "kind": { + "type": "string", + "description": "Kind of list this is, in this case adexchangeseller#urlChannels.", + "default": "adexchangeseller#urlChannels" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token used to page through URL channels. To retrieve the next page of results, set the next request's \"pageToken\" value to this." + } + } + } + }, + "resources": { + "adclients": { + "methods": { + "list": { + "id": "adexchangeseller.adclients.list", + "path": "adclients", + "httpMethod": "GET", + "description": "List all ad clients in this Ad Exchange account.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of ad clients to include in the response, used for paging.", + "format": "uint32", + "minimum": "0", + "maximum": "10000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + } + }, + "response": { + "$ref": "AdClients" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ] + } + } + }, + "adunits": { + "methods": { + "get": { + "id": "adexchangeseller.adunits.get", + "path": "adclients/{adClientId}/adunits/{adUnitId}", + "httpMethod": "GET", + "description": "Gets the specified ad unit in the specified ad client.", + "parameters": { + "adClientId": { + "type": "string", + "description": "Ad client for which to get the ad unit.", + "required": true, + "location": "path" + }, + "adUnitId": { + "type": "string", + "description": "Ad unit to retrieve.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "adClientId", + "adUnitId" + ], + "response": { + "$ref": "AdUnit" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ] + }, + "list": { + "id": "adexchangeseller.adunits.list", + "path": "adclients/{adClientId}/adunits", + "httpMethod": "GET", + "description": "List all ad units in the specified ad client for this Ad Exchange account.", + "parameters": { + "adClientId": { + "type": "string", + "description": "Ad client for which to list ad units.", + "required": true, + "location": "path" + }, + "includeInactive": { + "type": "boolean", + "description": "Whether to include inactive ad units. Default: true.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of ad units to include in the response, used for paging.", + "format": "uint32", + "minimum": "0", + "maximum": "10000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + } + }, + "parameterOrder": [ + "adClientId" + ], + "response": { + "$ref": "AdUnits" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ] + } + }, + "resources": { + "customchannels": { + "methods": { + "list": { + "id": "adexchangeseller.adunits.customchannels.list", + "path": "adclients/{adClientId}/adunits/{adUnitId}/customchannels", + "httpMethod": "GET", + "description": "List all custom channels which the specified ad unit belongs to.", + "parameters": { + "adClientId": { + "type": "string", + "description": "Ad client which contains the ad unit.", + "required": true, + "location": "path" + }, + "adUnitId": { + "type": "string", + "description": "Ad unit for which to list custom channels.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of custom channels to include in the response, used for paging.", + "format": "uint32", + "minimum": "0", + "maximum": "10000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + } + }, + "parameterOrder": [ + "adClientId", + "adUnitId" + ], + "response": { + "$ref": "CustomChannels" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ] + } + } + } + } + }, + "customchannels": { + "methods": { + "get": { + "id": "adexchangeseller.customchannels.get", + "path": "adclients/{adClientId}/customchannels/{customChannelId}", + "httpMethod": "GET", + "description": "Get the specified custom channel from the specified ad client.", + "parameters": { + "adClientId": { + "type": "string", + "description": "Ad client which contains the custom channel.", + "required": true, + "location": "path" + }, + "customChannelId": { + "type": "string", + "description": "Custom channel to retrieve.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "adClientId", + "customChannelId" + ], + "response": { + "$ref": "CustomChannel" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ] + }, + "list": { + "id": "adexchangeseller.customchannels.list", + "path": "adclients/{adClientId}/customchannels", + "httpMethod": "GET", + "description": "List all custom channels in the specified ad client for this Ad Exchange account.", + "parameters": { + "adClientId": { + "type": "string", + "description": "Ad client for which to list custom channels.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of custom channels to include in the response, used for paging.", + "format": "uint32", + "minimum": "0", + "maximum": "10000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + } + }, + "parameterOrder": [ + "adClientId" + ], + "response": { + "$ref": "CustomChannels" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ] + } + }, + "resources": { + "adunits": { + "methods": { + "list": { + "id": "adexchangeseller.customchannels.adunits.list", + "path": "adclients/{adClientId}/customchannels/{customChannelId}/adunits", + "httpMethod": "GET", + "description": "List all ad units in the specified custom channel.", + "parameters": { + "adClientId": { + "type": "string", + "description": "Ad client which contains the custom channel.", + "required": true, + "location": "path" + }, + "customChannelId": { + "type": "string", + "description": "Custom channel for which to list ad units.", + "required": true, + "location": "path" + }, + "includeInactive": { + "type": "boolean", + "description": "Whether to include inactive ad units. Default: true.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of ad units to include in the response, used for paging.", + "format": "uint32", + "minimum": "0", + "maximum": "10000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + } + }, + "parameterOrder": [ + "adClientId", + "customChannelId" + ], + "response": { + "$ref": "AdUnits" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ] + } + } + } + } + }, + "reports": { + "methods": { + "generate": { + "id": "adexchangeseller.reports.generate", + "path": "reports", + "httpMethod": "GET", + "description": "Generate an Ad Exchange report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify \"alt=csv\" as a query parameter.", + "parameters": { + "dimension": { + "type": "string", + "description": "Dimensions to base the report on.", + "pattern": "[a-zA-Z_]+", + "repeated": true, + "location": "query" + }, + "endDate": { + "type": "string", + "description": "End of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + "required": true, + "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)", + "location": "query" + }, + "filter": { + "type": "string", + "description": "Filters to be run on the report.", + "pattern": "[a-zA-Z_]+(==|=@).+", + "repeated": true, + "location": "query" + }, + "locale": { + "type": "string", + "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.", + "pattern": "[a-zA-Z_]+", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of rows of report data to return.", + "format": "uint32", + "minimum": "0", + "maximum": "50000", + "location": "query" + }, + "metric": { + "type": "string", + "description": "Numeric columns to include in the report.", + "pattern": "[a-zA-Z_]+", + "repeated": true, + "location": "query" + }, + "sort": { + "type": "string", + "description": "The name of a dimension or metric to sort the resulting report on, optionally prefixed with \"+\" to sort ascending or \"-\" to sort descending. If no prefix is specified, the column is sorted ascending.", + "pattern": "(\\+|-)?[a-zA-Z_]+", + "repeated": true, + "location": "query" + }, + "startDate": { + "type": "string", + "description": "Start of the date range to report on in \"YYYY-MM-DD\" format, inclusive.", + "required": true, + "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)", + "location": "query" + }, + "startIndex": { + "type": "integer", + "description": "Index of the first row of report data to return.", + "format": "uint32", + "minimum": "0", + "maximum": "5000", + "location": "query" + } + }, + "parameterOrder": [ + "startDate", + "endDate" + ], + "response": { + "$ref": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ], + "supportsMediaDownload": true + } + }, + "resources": { + "saved": { + "methods": { + "generate": { + "id": "adexchangeseller.reports.saved.generate", + "path": "reports/{savedReportId}", + "httpMethod": "GET", + "description": "Generate an Ad Exchange report based on the saved report ID sent in the query parameters.", + "parameters": { + "locale": { + "type": "string", + "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.", + "pattern": "[a-zA-Z_]+", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of rows of report data to return.", + "format": "int32", + "minimum": "0", + "maximum": "50000", + "location": "query" + }, + "savedReportId": { + "type": "string", + "description": "The saved report to retrieve.", + "required": true, + "location": "path" + }, + "startIndex": { + "type": "integer", + "description": "Index of the first row of report data to return.", + "format": "int32", + "minimum": "0", + "maximum": "5000", + "location": "query" + } + }, + "parameterOrder": [ + "savedReportId" + ], + "response": { + "$ref": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ] + }, + "list": { + "id": "adexchangeseller.reports.saved.list", + "path": "reports/saved", + "httpMethod": "GET", + "description": "List all saved reports in this Ad Exchange account.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of saved reports to include in the response, used for paging.", + "format": "int32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + } + }, + "response": { + "$ref": "SavedReports" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ] + } + } + } + } + }, + "urlchannels": { + "methods": { + "list": { + "id": "adexchangeseller.urlchannels.list", + "path": "adclients/{adClientId}/urlchannels", + "httpMethod": "GET", + "description": "List all URL channels in the specified ad client for this Ad Exchange account.", + "parameters": { + "adClientId": { + "type": "string", + "description": "Ad client for which to list URL channels.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of URL channels to include in the response, used for paging.", + "format": "uint32", + "minimum": "0", + "maximum": "10000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.", + "location": "query" + } + }, + "parameterOrder": [ + "adClientId" + ], + "response": { + "$ref": "UrlChannels" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/adexchangeseller/v1/adexchangeseller-gen.go b/Godeps/_workspace/src/google.golang.org/api/adexchangeseller/v1/adexchangeseller-gen.go new file mode 100644 index 000000000..cc2e32e2c --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/adexchangeseller/v1/adexchangeseller-gen.go @@ -0,0 +1,2531 @@ +// Package adexchangeseller provides access to the Ad Exchange Seller API. +// +// See https://developers.google.com/ad-exchange/seller-rest/ +// +// Usage example: +// +// import "google.golang.org/api/adexchangeseller/v1" +// ... +// adexchangesellerService, err := adexchangeseller.New(oauthHttpClient) +package adexchangeseller // import "google.golang.org/api/adexchangeseller/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Adclients *AdclientsService + + Adunits *AdunitsService + + Customchannels *CustomchannelsService + + Reports *ReportsService + + Urlchannels *UrlchannelsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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"` + + // ForceSendFields is a list of field names (e.g. "ArcOptIn") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdClient) MarshalJSON() ([]byte, error) { + type noMethod AdClient + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdClients) MarshalJSON() ([]byte, error) { + type noMethod AdClients + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnit) MarshalJSON() ([]byte, error) { + type noMethod AdUnit + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnits) MarshalJSON() ([]byte, error) { + type noMethod AdUnits + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomChannel) MarshalJSON() ([]byte, error) { + type noMethod CustomChannel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomChannelTargetingInfo: The targeting information of this custom +// channel, if activated. +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"` + + // ForceSendFields is a list of field names (e.g. "AdsAppearOn") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomChannelTargetingInfo) MarshalJSON() ([]byte, error) { + type noMethod CustomChannelTargetingInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomChannels) MarshalJSON() ([]byte, error) { + type noMethod CustomChannels + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Averages") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Report) MarshalJSON() ([]byte, error) { + type noMethod Report + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Currency") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportHeaders) MarshalJSON() ([]byte, error) { + type noMethod ReportHeaders + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SavedReport) MarshalJSON() ([]byte, error) { + type noMethod SavedReport + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SavedReports) MarshalJSON() ([]byte, error) { + type noMethod SavedReports + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlChannel) MarshalJSON() ([]byte, error) { + type noMethod UrlChannel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlChannels) MarshalJSON() ([]byte, error) { + type noMethod UrlChannels + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "adexchangeseller.adclients.list": + +type AdclientsListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdclientsListCall) Fields(s ...googleapi.Field) *AdclientsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdclientsListCall) IfNoneMatch(entityTag string) *AdclientsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdclientsListCall) Context(ctx context.Context) *AdclientsListCall { + c.ctx_ = ctx + return c +} + +func (c *AdclientsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.adclients.list" call. +// Exactly one of *AdClients or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AdClients.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AdclientsListCall) Do() (*AdClients, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdClients{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdunitsGetCall) Fields(s ...googleapi.Field) *AdunitsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdunitsGetCall) IfNoneMatch(entityTag string) *AdunitsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdunitsGetCall) Context(ctx context.Context) *AdunitsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AdunitsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + "adUnitId": c.adUnitId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.adunits.get" call. +// Exactly one of *AdUnit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AdunitsGetCall) Do() (*AdUnit, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdunitsListCall) Fields(s ...googleapi.Field) *AdunitsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdunitsListCall) IfNoneMatch(entityTag string) *AdunitsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdunitsListCall) Context(ctx context.Context) *AdunitsListCall { + c.ctx_ = ctx + return c +} + +func (c *AdunitsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.adunits.list" call. +// Exactly one of *AdUnits or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnits.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AdunitsListCall) Do() (*AdUnits, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnits{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdunitsCustomchannelsListCall) Fields(s ...googleapi.Field) *AdunitsCustomchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdunitsCustomchannelsListCall) IfNoneMatch(entityTag string) *AdunitsCustomchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdunitsCustomchannelsListCall) Context(ctx context.Context) *AdunitsCustomchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *AdunitsCustomchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + "adUnitId": c.adUnitId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.adunits.customchannels.list" call. +// Exactly one of *CustomChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannels.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AdunitsCustomchannelsListCall) Do() (*CustomChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomchannelsGetCall) Fields(s ...googleapi.Field) *CustomchannelsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CustomchannelsGetCall) IfNoneMatch(entityTag string) *CustomchannelsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomchannelsGetCall) Context(ctx context.Context) *CustomchannelsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CustomchannelsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + "customChannelId": c.customChannelId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.customchannels.get" call. +// Exactly one of *CustomChannel or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannel.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CustomchannelsGetCall) Do() (*CustomChannel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomchannelsListCall) Fields(s ...googleapi.Field) *CustomchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CustomchannelsListCall) IfNoneMatch(entityTag string) *CustomchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomchannelsListCall) Context(ctx context.Context) *CustomchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *CustomchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.customchannels.list" call. +// Exactly one of *CustomChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannels.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CustomchannelsListCall) Do() (*CustomChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomchannelsAdunitsListCall) Fields(s ...googleapi.Field) *CustomchannelsAdunitsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CustomchannelsAdunitsListCall) IfNoneMatch(entityTag string) *CustomchannelsAdunitsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomchannelsAdunitsListCall) Context(ctx context.Context) *CustomchannelsAdunitsListCall { + c.ctx_ = ctx + return c +} + +func (c *CustomchannelsAdunitsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + "customChannelId": c.customChannelId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.customchannels.adunits.list" call. +// Exactly one of *AdUnits or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnits.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CustomchannelsAdunitsListCall) Do() (*AdUnits, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnits{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsGenerateCall) Fields(s ...googleapi.Field) *ReportsGenerateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsGenerateCall) IfNoneMatch(entityTag string) *ReportsGenerateCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsGenerateCall) Context(ctx context.Context) *ReportsGenerateCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsGenerateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *ReportsGenerateCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "adexchangeseller.reports.generate" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsGenerateCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsSavedGenerateCall) Fields(s ...googleapi.Field) *ReportsSavedGenerateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsSavedGenerateCall) IfNoneMatch(entityTag string) *ReportsSavedGenerateCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsSavedGenerateCall) Context(ctx context.Context) *ReportsSavedGenerateCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsSavedGenerateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{savedReportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "savedReportId": c.savedReportId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.reports.saved.generate" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsSavedGenerateCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsSavedListCall) Fields(s ...googleapi.Field) *ReportsSavedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsSavedListCall) IfNoneMatch(entityTag string) *ReportsSavedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsSavedListCall) Context(ctx context.Context) *ReportsSavedListCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsSavedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/saved") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.reports.saved.list" call. +// Exactly one of *SavedReports or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SavedReports.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReportsSavedListCall) Do() (*SavedReports, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SavedReports{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlchannelsListCall) Fields(s ...googleapi.Field) *UrlchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UrlchannelsListCall) IfNoneMatch(entityTag string) *UrlchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlchannelsListCall) Context(ctx context.Context) *UrlchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *UrlchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/urlchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.urlchannels.list" call. +// Exactly one of *UrlChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UrlChannels.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UrlchannelsListCall) Do() (*UrlChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UrlChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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/Godeps/_workspace/src/google.golang.org/api/adexchangeseller/v2.0/adexchangeseller-api.json b/Godeps/_workspace/src/google.golang.org/api/adexchangeseller/v2.0/adexchangeseller-api.json new file mode 100644 index 000000000..df5225c1c --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/adexchangeseller/v2.0/adexchangeseller-api.json @@ -0,0 +1,1164 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/6aC1_omptpkys969gj83ZtJAvZ8\"", + "discoveryVersion": "v1", + "id": "adexchangeseller:v2.0", + "name": "adexchangeseller", + "canonicalName": "Ad Exchange Seller", + "version": "v2.0", + "revision": "20141112", + "title": "Ad Exchange Seller API", + "description": "Gives Ad Exchange seller users access to their inventory and the ability to generate reports", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/ad-exchange/seller-rest/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/adexchangeseller/v2.0/", + "basePath": "/adexchangeseller/v2.0/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "adexchangeseller/v2.0/", + "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." + } + } + }, + "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 adexchangeseller#accounts.", + "default": "adexchangeseller#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 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." + } + } + }, + "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" + ] + }, + "list": { + "id": "adexchangeseller.accounts.list", + "path": "accounts", + "httpMethod": "GET", + "description": "List all accounts available to this Ad Exchange 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/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ] + } + }, + "resources": { + "adclients": { + "methods": { + "list": { + "id": "adexchangeseller.accounts.adclients.list", + "path": "accounts/{accountId}/adclients", + "httpMethod": "GET", + "description": "List all ad clients in this Ad Exchange account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account to which the ad client belongs.", + "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/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ] + } + } + }, + "alerts": { + "methods": { + "list": { + "id": "adexchangeseller.accounts.alerts.list", + "path": "accounts/{accountId}/alerts", + "httpMethod": "GET", + "description": "List the alerts for this Ad Exchange account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account owning 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/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ] + } + } + }, + "customchannels": { + "methods": { + "get": { + "id": "adexchangeseller.accounts.customchannels.get", + "path": "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}", + "httpMethod": "GET", + "description": "Get the specified custom channel from the specified ad client.", + "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/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ] + }, + "list": { + "id": "adexchangeseller.accounts.customchannels.list", + "path": "accounts/{accountId}/adclients/{adClientId}/customchannels", + "httpMethod": "GET", + "description": "List all custom channels in the specified ad client for this Ad Exchange 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": "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": [ + "accountId", + "adClientId" + ], + "response": { + "$ref": "CustomChannels" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ] + } + } + }, + "metadata": { + "resources": { + "dimensions": { + "methods": { + "list": { + "id": "adexchangeseller.accounts.metadata.dimensions.list", + "path": "accounts/{accountId}/metadata/dimensions", + "httpMethod": "GET", + "description": "List the metadata for the dimensions available to this AdExchange account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account with visibility to the dimensions.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "Metadata" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ] + } + } + }, + "metrics": { + "methods": { + "list": { + "id": "adexchangeseller.accounts.metadata.metrics.list", + "path": "accounts/{accountId}/metadata/metrics", + "httpMethod": "GET", + "description": "List the metadata for the metrics available to this AdExchange account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account with visibility to the metrics.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "Metadata" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ] + } + } + } + } + }, + "preferreddeals": { + "methods": { + "get": { + "id": "adexchangeseller.accounts.preferreddeals.get", + "path": "accounts/{accountId}/preferreddeals/{dealId}", + "httpMethod": "GET", + "description": "Get information about the selected Ad Exchange Preferred Deal.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account owning the deal.", + "required": true, + "location": "path" + }, + "dealId": { + "type": "string", + "description": "Preferred deal to get information about.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "dealId" + ], + "response": { + "$ref": "PreferredDeal" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ] + }, + "list": { + "id": "adexchangeseller.accounts.preferreddeals.list", + "path": "accounts/{accountId}/preferreddeals", + "httpMethod": "GET", + "description": "List the preferred deals for this Ad Exchange account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account owning the deals.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "PreferredDeals" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ] + } + } + }, + "reports": { + "methods": { + "generate": { + "id": "adexchangeseller.accounts.reports.generate", + "path": "accounts/{accountId}/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": { + "accountId": { + "type": "string", + "description": "Account which owns the generated 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/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ], + "supportsMediaDownload": true + } + }, + "resources": { + "saved": { + "methods": { + "generate": { + "id": "adexchangeseller.accounts.reports.saved.generate", + "path": "accounts/{accountId}/reports/{savedReportId}", + "httpMethod": "GET", + "description": "Generate an Ad Exchange report based on the saved report ID sent in the query parameters.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account owning the saved report.", + "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": "Report" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ] + }, + "list": { + "id": "adexchangeseller.accounts.reports.saved.list", + "path": "accounts/{accountId}/reports/saved", + "httpMethod": "GET", + "description": "List all saved reports in this Ad Exchange account.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account owning the saved reports.", + "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/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ] + } + } + } + } + }, + "urlchannels": { + "methods": { + "list": { + "id": "adexchangeseller.accounts.urlchannels.list", + "path": "accounts/{accountId}/adclients/{adClientId}/urlchannels", + "httpMethod": "GET", + "description": "List all URL channels in the specified ad client for this Ad Exchange 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": "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": [ + "accountId", + "adClientId" + ], + "response": { + "$ref": "UrlChannels" + }, + "scopes": [ + "https://www.googleapis.com/auth/adexchange.seller", + "https://www.googleapis.com/auth/adexchange.seller.readonly" + ] + } + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/adexchangeseller/v2.0/adexchangeseller-gen.go b/Godeps/_workspace/src/google.golang.org/api/adexchangeseller/v2.0/adexchangeseller-gen.go new file mode 100644 index 000000000..8c4dd6c3c --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/adexchangeseller/v2.0/adexchangeseller-gen.go @@ -0,0 +1,3112 @@ +// Package adexchangeseller provides access to the Ad Exchange Seller API. +// +// See https://developers.google.com/ad-exchange/seller-rest/ +// +// Usage example: +// +// import "google.golang.org/api/adexchangeseller/v2.0" +// ... +// adexchangesellerService, err := adexchangeseller.New(oauthHttpClient) +package adexchangeseller // import "google.golang.org/api/adexchangeseller/v2.0" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "adexchangeseller:v2.0" +const apiName = "adexchangeseller" +const apiVersion = "v2.0" +const basePath = "https://www.googleapis.com/adexchangeseller/v2.0/" + +// 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) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Accounts *AccountsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + rs.Adclients = NewAccountsAdclientsService(s) + rs.Alerts = NewAccountsAlertsService(s) + rs.Customchannels = NewAccountsCustomchannelsService(s) + rs.Metadata = NewAccountsMetadataService(s) + rs.Preferreddeals = NewAccountsPreferreddealsService(s) + rs.Reports = NewAccountsReportsService(s) + rs.Urlchannels = NewAccountsUrlchannelsService(s) + return rs +} + +type AccountsService struct { + s *Service + + Adclients *AccountsAdclientsService + + Alerts *AccountsAlertsService + + Customchannels *AccountsCustomchannelsService + + Metadata *AccountsMetadataService + + Preferreddeals *AccountsPreferreddealsService + + Reports *AccountsReportsService + + Urlchannels *AccountsUrlchannelsService +} + +func NewAccountsAdclientsService(s *Service) *AccountsAdclientsService { + rs := &AccountsAdclientsService{s: s} + return rs +} + +type AccountsAdclientsService 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} + return rs +} + +type AccountsCustomchannelsService struct { + s *Service +} + +func NewAccountsMetadataService(s *Service) *AccountsMetadataService { + rs := &AccountsMetadataService{s: s} + rs.Dimensions = NewAccountsMetadataDimensionsService(s) + rs.Metrics = NewAccountsMetadataMetricsService(s) + return rs +} + +type AccountsMetadataService struct { + s *Service + + Dimensions *AccountsMetadataDimensionsService + + Metrics *AccountsMetadataMetricsService +} + +func NewAccountsMetadataDimensionsService(s *Service) *AccountsMetadataDimensionsService { + rs := &AccountsMetadataDimensionsService{s: s} + return rs +} + +type AccountsMetadataDimensionsService struct { + s *Service +} + +func NewAccountsMetadataMetricsService(s *Service) *AccountsMetadataMetricsService { + rs := &AccountsMetadataMetricsService{s: s} + return rs +} + +type AccountsMetadataMetricsService struct { + s *Service +} + +func NewAccountsPreferreddealsService(s *Service) *AccountsPreferreddealsService { + rs := &AccountsPreferreddealsService{s: s} + return rs +} + +type AccountsPreferreddealsService 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 NewAccountsUrlchannelsService(s *Service) *AccountsUrlchannelsService { + rs := &AccountsUrlchannelsService{s: s} + return rs +} + +type AccountsUrlchannelsService 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Account) MarshalJSON() ([]byte, error) { + type noMethod Account + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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 adexchangeseller#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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Accounts) MarshalJSON() ([]byte, error) { + type noMethod Accounts + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "ArcOptIn") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdClient) MarshalJSON() ([]byte, error) { + type noMethod AdClient + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdClients) MarshalJSON() ([]byte, error) { + type noMethod AdClients + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Alert) MarshalJSON() ([]byte, error) { + type noMethod Alert + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Alerts) MarshalJSON() ([]byte, error) { + type noMethod Alerts + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomChannel) MarshalJSON() ([]byte, error) { + type noMethod CustomChannel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomChannelTargetingInfo: The targeting information of this custom +// channel, if activated. +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"` + + // ForceSendFields is a list of field names (e.g. "AdsAppearOn") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomChannelTargetingInfo) MarshalJSON() ([]byte, error) { + type noMethod CustomChannelTargetingInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomChannels) MarshalJSON() ([]byte, error) { + type noMethod CustomChannels + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Metadata struct { + Items []*ReportingMetadataEntry `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adexchangeseller#metadata. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Metadata) MarshalJSON() ([]byte, error) { + type noMethod Metadata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AdvertiserName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PreferredDeal) MarshalJSON() ([]byte, error) { + type noMethod PreferredDeal + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PreferredDeals) MarshalJSON() ([]byte, error) { + type noMethod PreferredDeals + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Averages") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Report) MarshalJSON() ([]byte, error) { + type noMethod Report + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Currency") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportHeaders) MarshalJSON() ([]byte, error) { + type noMethod ReportHeaders + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. + // "CompatibleDimensions") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportingMetadataEntry) MarshalJSON() ([]byte, error) { + type noMethod ReportingMetadataEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SavedReport) MarshalJSON() ([]byte, error) { + type noMethod SavedReport + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SavedReports) MarshalJSON() ([]byte, error) { + type noMethod SavedReports + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlChannel) MarshalJSON() ([]byte, error) { + type noMethod UrlChannel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlChannels) MarshalJSON() ([]byte, error) { + type noMethod UrlChannels + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "adexchangeseller.accounts.get": + +type AccountsGetCall struct { + s *Service + accountId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.accounts.get" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsGetCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.accounts.list": + +type AccountsListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List all accounts available to this Ad Exchange 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.accounts.list" call. +// Exactly one of *Accounts or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Accounts.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsListCall) Do() (*Accounts, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Accounts{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all accounts available to this Ad Exchange account.", + // "httpMethod": "GET", + // "id": "adexchangeseller.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/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.accounts.adclients.list": + +type AccountsAdclientsListCall struct { + s *Service + accountId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List all ad clients in this Ad Exchange 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAdclientsListCall) Fields(s ...googleapi.Field) *AccountsAdclientsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsAdclientsListCall) IfNoneMatch(entityTag string) *AccountsAdclientsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAdclientsListCall) Context(ctx context.Context) *AccountsAdclientsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAdclientsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.accounts.adclients.list" call. +// Exactly one of *AdClients or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AdClients.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsAdclientsListCall) Do() (*AdClients, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdClients{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all ad clients in this Ad Exchange account.", + // "httpMethod": "GET", + // "id": "adexchangeseller.accounts.adclients.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account to which the ad client belongs.", + // "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/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.accounts.alerts.list": + +type AccountsAlertsListCall struct { + s *Service + accountId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List the alerts for this Ad Exchange 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAlertsListCall) Fields(s ...googleapi.Field) *AccountsAlertsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsAlertsListCall) IfNoneMatch(entityTag string) *AccountsAlertsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAlertsListCall) Context(ctx context.Context) *AccountsAlertsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAlertsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/alerts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.accounts.alerts.list" call. +// Exactly one of *Alerts or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Alerts.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsAlertsListCall) Do() (*Alerts, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Alerts{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the alerts for this Ad Exchange account.", + // "httpMethod": "GET", + // "id": "adexchangeseller.accounts.alerts.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account owning 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/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.accounts.customchannels.get": + +type AccountsCustomchannelsGetCall struct { + s *Service + accountId string + adClientId string + customChannelId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Get the specified custom channel from the specified ad client. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsCustomchannelsGetCall) Fields(s ...googleapi.Field) *AccountsCustomchannelsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsCustomchannelsGetCall) IfNoneMatch(entityTag string) *AccountsCustomchannelsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsCustomchannelsGetCall) Context(ctx context.Context) *AccountsCustomchannelsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsCustomchannelsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + "customChannelId": c.customChannelId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.accounts.customchannels.get" call. +// Exactly one of *CustomChannel or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannel.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsCustomchannelsGetCall) Do() (*CustomChannel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get the specified custom channel from the specified ad client.", + // "httpMethod": "GET", + // "id": "adexchangeseller.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/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.accounts.customchannels.list": + +type AccountsCustomchannelsListCall struct { + s *Service + accountId string + adClientId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List all custom channels in the specified ad client for this Ad +// Exchange 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsCustomchannelsListCall) Fields(s ...googleapi.Field) *AccountsCustomchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsCustomchannelsListCall) IfNoneMatch(entityTag string) *AccountsCustomchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsCustomchannelsListCall) Context(ctx context.Context) *AccountsCustomchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsCustomchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.accounts.customchannels.list" call. +// Exactly one of *CustomChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannels.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsCustomchannelsListCall) Do() (*CustomChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all custom channels in the specified ad client for this Ad Exchange account.", + // "httpMethod": "GET", + // "id": "adexchangeseller.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": "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": "accounts/{accountId}/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.accounts.metadata.dimensions.list": + +type AccountsMetadataDimensionsListCall struct { + s *Service + accountId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List the metadata for the dimensions available to this +// AdExchange account. +func (r *AccountsMetadataDimensionsService) List(accountId string) *AccountsMetadataDimensionsListCall { + c := &AccountsMetadataDimensionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsMetadataDimensionsListCall) Fields(s ...googleapi.Field) *AccountsMetadataDimensionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsMetadataDimensionsListCall) IfNoneMatch(entityTag string) *AccountsMetadataDimensionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsMetadataDimensionsListCall) Context(ctx context.Context) *AccountsMetadataDimensionsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsMetadataDimensionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/metadata/dimensions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.accounts.metadata.dimensions.list" call. +// Exactly one of *Metadata or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Metadata.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsMetadataDimensionsListCall) Do() (*Metadata, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Metadata{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the metadata for the dimensions available to this AdExchange account.", + // "httpMethod": "GET", + // "id": "adexchangeseller.accounts.metadata.dimensions.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account with visibility to the dimensions.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/metadata/dimensions", + // "response": { + // "$ref": "Metadata" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.accounts.metadata.metrics.list": + +type AccountsMetadataMetricsListCall struct { + s *Service + accountId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List the metadata for the metrics available to this AdExchange +// account. +func (r *AccountsMetadataMetricsService) List(accountId string) *AccountsMetadataMetricsListCall { + c := &AccountsMetadataMetricsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsMetadataMetricsListCall) Fields(s ...googleapi.Field) *AccountsMetadataMetricsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsMetadataMetricsListCall) IfNoneMatch(entityTag string) *AccountsMetadataMetricsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsMetadataMetricsListCall) Context(ctx context.Context) *AccountsMetadataMetricsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsMetadataMetricsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/metadata/metrics") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.accounts.metadata.metrics.list" call. +// Exactly one of *Metadata or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Metadata.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsMetadataMetricsListCall) Do() (*Metadata, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Metadata{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the metadata for the metrics available to this AdExchange account.", + // "httpMethod": "GET", + // "id": "adexchangeseller.accounts.metadata.metrics.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account with visibility to the metrics.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/metadata/metrics", + // "response": { + // "$ref": "Metadata" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.accounts.preferreddeals.get": + +type AccountsPreferreddealsGetCall struct { + s *Service + accountId string + dealId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Get information about the selected Ad Exchange Preferred Deal. +func (r *AccountsPreferreddealsService) Get(accountId string, dealId string) *AccountsPreferreddealsGetCall { + c := &AccountsPreferreddealsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.dealId = dealId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsPreferreddealsGetCall) Fields(s ...googleapi.Field) *AccountsPreferreddealsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsPreferreddealsGetCall) IfNoneMatch(entityTag string) *AccountsPreferreddealsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsPreferreddealsGetCall) Context(ctx context.Context) *AccountsPreferreddealsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsPreferreddealsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/preferreddeals/{dealId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "dealId": c.dealId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.accounts.preferreddeals.get" call. +// Exactly one of *PreferredDeal or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PreferredDeal.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsPreferreddealsGetCall) Do() (*PreferredDeal, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PreferredDeal{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get information about the selected Ad Exchange Preferred Deal.", + // "httpMethod": "GET", + // "id": "adexchangeseller.accounts.preferreddeals.get", + // "parameterOrder": [ + // "accountId", + // "dealId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account owning the deal.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "dealId": { + // "description": "Preferred deal to get information about.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/preferreddeals/{dealId}", + // "response": { + // "$ref": "PreferredDeal" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.accounts.preferreddeals.list": + +type AccountsPreferreddealsListCall struct { + s *Service + accountId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List the preferred deals for this Ad Exchange account. +func (r *AccountsPreferreddealsService) List(accountId string) *AccountsPreferreddealsListCall { + c := &AccountsPreferreddealsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsPreferreddealsListCall) Fields(s ...googleapi.Field) *AccountsPreferreddealsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsPreferreddealsListCall) IfNoneMatch(entityTag string) *AccountsPreferreddealsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsPreferreddealsListCall) Context(ctx context.Context) *AccountsPreferreddealsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsPreferreddealsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/preferreddeals") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.accounts.preferreddeals.list" call. +// Exactly one of *PreferredDeals or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PreferredDeals.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsPreferreddealsListCall) Do() (*PreferredDeals, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PreferredDeals{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the preferred deals for this Ad Exchange account.", + // "httpMethod": "GET", + // "id": "adexchangeseller.accounts.preferreddeals.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account owning the deals.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/preferreddeals", + // "response": { + // "$ref": "PreferredDeals" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.accounts.reports.generate": + +type AccountsReportsGenerateCall struct { + s *Service + accountId string + startDate string + endDate string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 *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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsReportsGenerateCall) Fields(s ...googleapi.Field) *AccountsReportsGenerateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsReportsGenerateCall) IfNoneMatch(entityTag string) *AccountsReportsGenerateCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsReportsGenerateCall) Context(ctx context.Context) *AccountsReportsGenerateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsReportsGenerateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *AccountsReportsGenerateCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "adexchangeseller.accounts.reports.generate" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsReportsGenerateCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.accounts.reports.generate", + // "parameterOrder": [ + // "accountId", + // "startDate", + // "endDate" + // ], + // "parameters": { + // "accountId": { + // "description": "Account which owns the generated 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/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "adexchangeseller.accounts.reports.saved.generate": + +type AccountsReportsSavedGenerateCall struct { + s *Service + accountId string + savedReportId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Generate: Generate an Ad Exchange 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsReportsSavedGenerateCall) Fields(s ...googleapi.Field) *AccountsReportsSavedGenerateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsReportsSavedGenerateCall) IfNoneMatch(entityTag string) *AccountsReportsSavedGenerateCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsReportsSavedGenerateCall) Context(ctx context.Context) *AccountsReportsSavedGenerateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsReportsSavedGenerateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports/{savedReportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "savedReportId": c.savedReportId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.accounts.reports.saved.generate" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsReportsSavedGenerateCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generate an Ad Exchange report based on the saved report ID sent in the query parameters.", + // "httpMethod": "GET", + // "id": "adexchangeseller.accounts.reports.saved.generate", + // "parameterOrder": [ + // "accountId", + // "savedReportId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account owning the saved report.", + // "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": "Report" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.accounts.reports.saved.list": + +type AccountsReportsSavedListCall struct { + s *Service + accountId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List all saved reports in this Ad Exchange 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsReportsSavedListCall) Fields(s ...googleapi.Field) *AccountsReportsSavedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsReportsSavedListCall) IfNoneMatch(entityTag string) *AccountsReportsSavedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsReportsSavedListCall) Context(ctx context.Context) *AccountsReportsSavedListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsReportsSavedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports/saved") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.accounts.reports.saved.list" call. +// Exactly one of *SavedReports or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SavedReports.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsReportsSavedListCall) Do() (*SavedReports, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SavedReports{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all saved reports in this Ad Exchange account.", + // "httpMethod": "GET", + // "id": "adexchangeseller.accounts.reports.saved.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account owning the saved reports.", + // "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/adexchange.seller", + // "https://www.googleapis.com/auth/adexchange.seller.readonly" + // ] + // } + +} + +// method id "adexchangeseller.accounts.urlchannels.list": + +type AccountsUrlchannelsListCall struct { + s *Service + accountId string + adClientId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List all URL channels in the specified ad client for this Ad +// Exchange 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsUrlchannelsListCall) Fields(s ...googleapi.Field) *AccountsUrlchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsUrlchannelsListCall) IfNoneMatch(entityTag string) *AccountsUrlchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsUrlchannelsListCall) Context(ctx context.Context) *AccountsUrlchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsUrlchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/urlchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adexchangeseller.accounts.urlchannels.list" call. +// Exactly one of *UrlChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UrlChannels.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsUrlchannelsListCall) Do() (*UrlChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UrlChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all URL channels in the specified ad client for this Ad Exchange account.", + // "httpMethod": "GET", + // "id": "adexchangeseller.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": "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": "accounts/{accountId}/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/Godeps/_workspace/src/google.golang.org/api/admin/datatransfer/v1/admin-api.json b/Godeps/_workspace/src/google.golang.org/api/admin/datatransfer/v1/admin-api.json new file mode 100644 index 000000000..68b8fdca7 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/admin/datatransfer/v1/admin-api.json @@ -0,0 +1,411 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/fIZK26KtD09fXt5m9JygrSOR194\"", + "discoveryVersion": "v1", + "id": "admin:datatransfer_v1", + "name": "admin", + "canonicalName": "DataTransfer", + "version": "datatransfer_v1", + "revision": "20150917", + "title": "Admin Data Transfer API", + "description": "Admin Data Transfer API lets you transfer user data from one user to another.", + "ownerDomain": "google.com", + "ownerName": "Google", + "packagePath": "admin", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://developers.google.com/admin-sdk/data-transfer/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/admin/datatransfer/v1/", + "basePath": "/admin/datatransfer/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "admin/datatransfer/v1/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json" + ], + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.", + "location": "query" + }, + "userIp": { + "type": "string", + "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.", + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/admin.datatransfer": { + "description": "View and manage data transfers between users in your organization" + }, + "https://www.googleapis.com/auth/admin.datatransfer.readonly": { + "description": "View data transfers between users in your organization" + } + } + } + }, + "schemas": { + "Application": { + "id": "Application", + "type": "object", + "description": "The JSON template for an Application resource.", + "properties": { + "etag": { + "type": "string", + "description": "Etag of the resource." + }, + "id": { + "type": "string", + "description": "The application's ID.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies the resource as a DataTransfer Application Resource.", + "default": "admin#datatransfer#ApplicationResource" + }, + "name": { + "type": "string", + "description": "The application's name." + }, + "transferParams": { + "type": "array", + "description": "The list of all possible transfer parameters for this application. These parameters can be used to select the data of the user in this application to be transfered.", + "items": { + "$ref": "ApplicationTransferParam" + } + } + } + }, + "ApplicationDataTransfer": { + "id": "ApplicationDataTransfer", + "type": "object", + "description": "Template to map fields of ApplicationDataTransfer resource.", + "properties": { + "applicationId": { + "type": "string", + "description": "The application's ID.", + "format": "int64" + }, + "applicationTransferParams": { + "type": "array", + "description": "The transfer parameters for the application. These parameters are used to select the data which will get transfered in context of this application.", + "items": { + "$ref": "ApplicationTransferParam" + } + }, + "applicationTransferStatus": { + "type": "string", + "description": "Current status of transfer for this application. (Read-only)" + } + } + }, + "ApplicationTransferParam": { + "id": "ApplicationTransferParam", + "type": "object", + "description": "Template for application transfer parameters.", + "properties": { + "key": { + "type": "string", + "description": "The type of the transfer parameter. eg: 'PRIVACY_LEVEL'" + }, + "value": { + "type": "array", + "description": "The value of the coressponding transfer parameter. eg: 'PRIVATE' or 'SHARED'", + "items": { + "type": "string" + } + } + } + }, + "ApplicationsListResponse": { + "id": "ApplicationsListResponse", + "type": "object", + "description": "Template for a collection of Applications.", + "properties": { + "applications": { + "type": "array", + "description": "List of applications that support data transfer and are also installed for the customer.", + "items": { + "$ref": "Application" + } + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "kind": { + "type": "string", + "description": "Identifies the resource as a collection of Applications.", + "default": "admin#datatransfer#applicationsList" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token which will be used to specify next page in list API." + } + } + }, + "DataTransfer": { + "id": "DataTransfer", + "type": "object", + "description": "The JSON template for a DataTransfer resource.", + "properties": { + "applicationDataTransfers": { + "type": "array", + "description": "List of per application data transfer resources. It contains data transfer details of the applications associated with this transfer resource. Note that this list is also used to specify the applications for which data transfer has to be done at the time of the transfer resource creation.", + "items": { + "$ref": "ApplicationDataTransfer" + } + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "id": { + "type": "string", + "description": "The transfer's ID (Read-only)." + }, + "kind": { + "type": "string", + "description": "Identifies the resource as a DataTransfer request.", + "default": "admin#datatransfer#DataTransfer" + }, + "newOwnerUserId": { + "type": "string", + "description": "ID of the user to whom the data is being transfered." + }, + "oldOwnerUserId": { + "type": "string", + "description": "ID of the user whose data is being transfered." + }, + "overallTransferStatusCode": { + "type": "string", + "description": "Overall transfer status (Read-only)." + }, + "requestTime": { + "type": "string", + "description": "The time at which the data transfer was requested (Read-only).", + "format": "date-time" + } + } + }, + "DataTransfersListResponse": { + "id": "DataTransfersListResponse", + "type": "object", + "description": "Template for a collection of DataTransfer resources.", + "properties": { + "dataTransfers": { + "type": "array", + "description": "List of data transfer requests.", + "items": { + "$ref": "DataTransfer" + } + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "kind": { + "type": "string", + "description": "Identifies the resource as a collection of data transfer requests.", + "default": "admin#datatransfer#dataTransfersList" + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token which will be used to specify next page in list API." + } + } + } + }, + "resources": { + "applications": { + "methods": { + "get": { + "id": "datatransfer.applications.get", + "path": "applications/{applicationId}", + "httpMethod": "GET", + "description": "Retrieves information about an application for the given application ID.", + "parameters": { + "applicationId": { + "type": "string", + "description": "ID of the application resource to be retrieved.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "applicationId" + ], + "response": { + "$ref": "Application" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.datatransfer", + "https://www.googleapis.com/auth/admin.datatransfer.readonly" + ] + }, + "list": { + "id": "datatransfer.applications.list", + "path": "applications", + "httpMethod": "GET", + "description": "Lists the applications available for data transfer for a customer.", + "parameters": { + "customerId": { + "type": "string", + "description": "Immutable ID of the Google Apps account.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return. Default is 100.", + "format": "uint32", + "minimum": "1", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token to specify next page in the list.", + "location": "query" + } + }, + "response": { + "$ref": "ApplicationsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.datatransfer", + "https://www.googleapis.com/auth/admin.datatransfer.readonly" + ] + } + } + }, + "transfers": { + "methods": { + "get": { + "id": "datatransfer.transfers.get", + "path": "transfers/{dataTransferId}", + "httpMethod": "GET", + "description": "Retrieves a data transfer request by its resource ID.", + "parameters": { + "dataTransferId": { + "type": "string", + "description": "ID of the resource to be retrieved. This is returned in the response from the insert method.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "dataTransferId" + ], + "response": { + "$ref": "DataTransfer" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.datatransfer", + "https://www.googleapis.com/auth/admin.datatransfer.readonly" + ] + }, + "insert": { + "id": "datatransfer.transfers.insert", + "path": "transfers", + "httpMethod": "POST", + "description": "Inserts a data transfer request.", + "request": { + "$ref": "DataTransfer" + }, + "response": { + "$ref": "DataTransfer" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.datatransfer" + ] + }, + "list": { + "id": "datatransfer.transfers.list", + "path": "transfers", + "httpMethod": "GET", + "description": "Lists the transfers for a customer by source user, destination user, or status.", + "parameters": { + "customerId": { + "type": "string", + "description": "Immutable ID of the Google Apps account.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return. Default is 100.", + "format": "int32", + "minimum": "1", + "maximum": "500", + "location": "query" + }, + "newOwnerUserId": { + "type": "string", + "description": "Destination user's profile ID.", + "location": "query" + }, + "oldOwnerUserId": { + "type": "string", + "description": "Source user's profile ID.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token to specify the next page in the list.", + "location": "query" + }, + "status": { + "type": "string", + "description": "Status of the transfer.", + "location": "query" + } + }, + "response": { + "$ref": "DataTransfersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.datatransfer", + "https://www.googleapis.com/auth/admin.datatransfer.readonly" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/admin/datatransfer/v1/admin-gen.go b/Godeps/_workspace/src/google.golang.org/api/admin/datatransfer/v1/admin-gen.go new file mode 100644 index 000000000..1ba6e1f01 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/admin/datatransfer/v1/admin-gen.go @@ -0,0 +1,1050 @@ +// Package admin provides access to the Admin Data Transfer API. +// +// See https://developers.google.com/admin-sdk/data-transfer/ +// +// Usage example: +// +// import "google.golang.org/api/admin/datatransfer/v1" +// ... +// adminService, err := admin.New(oauthHttpClient) +package admin // import "google.golang.org/api/admin/datatransfer/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "admin:datatransfer_v1" +const apiName = "admin" +const apiVersion = "datatransfer_v1" +const basePath = "https://www.googleapis.com/admin/datatransfer/v1/" + +// OAuth2 scopes used by this API. +const ( + // View and manage data transfers between users in your organization + AdminDatatransferScope = "https://www.googleapis.com/auth/admin.datatransfer" + + // View data transfers between users in your organization + AdminDatatransferReadonlyScope = "https://www.googleapis.com/auth/admin.datatransfer.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.Applications = NewApplicationsService(s) + s.Transfers = NewTransfersService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Applications *ApplicationsService + + Transfers *TransfersService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewApplicationsService(s *Service) *ApplicationsService { + rs := &ApplicationsService{s: s} + return rs +} + +type ApplicationsService struct { + s *Service +} + +func NewTransfersService(s *Service) *TransfersService { + rs := &TransfersService{s: s} + return rs +} + +type TransfersService struct { + s *Service +} + +// Application: The JSON template for an Application resource. +type Application struct { + // Etag: Etag of the resource. + Etag string `json:"etag,omitempty"` + + // Id: The application's ID. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies the resource as a DataTransfer Application Resource. + Kind string `json:"kind,omitempty"` + + // Name: The application's name. + Name string `json:"name,omitempty"` + + // TransferParams: The list of all possible transfer parameters for this + // application. These parameters can be used to select the data of the + // user in this application to be transfered. + TransferParams []*ApplicationTransferParam `json:"transferParams,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Application) MarshalJSON() ([]byte, error) { + type noMethod Application + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ApplicationDataTransfer: Template to map fields of +// ApplicationDataTransfer resource. +type ApplicationDataTransfer struct { + // ApplicationId: The application's ID. + ApplicationId int64 `json:"applicationId,omitempty,string"` + + // ApplicationTransferParams: The transfer parameters for the + // application. These parameters are used to select the data which will + // get transfered in context of this application. + ApplicationTransferParams []*ApplicationTransferParam `json:"applicationTransferParams,omitempty"` + + // ApplicationTransferStatus: Current status of transfer for this + // application. (Read-only) + ApplicationTransferStatus string `json:"applicationTransferStatus,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ApplicationId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ApplicationDataTransfer) MarshalJSON() ([]byte, error) { + type noMethod ApplicationDataTransfer + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ApplicationTransferParam: Template for application transfer +// parameters. +type ApplicationTransferParam struct { + // Key: The type of the transfer parameter. eg: 'PRIVACY_LEVEL' + Key string `json:"key,omitempty"` + + // Value: The value of the coressponding transfer parameter. eg: + // 'PRIVATE' or 'SHARED' + Value []string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ApplicationTransferParam) MarshalJSON() ([]byte, error) { + type noMethod ApplicationTransferParam + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ApplicationsListResponse: Template for a collection of Applications. +type ApplicationsListResponse struct { + // Applications: List of applications that support data transfer and are + // also installed for the customer. + Applications []*Application `json:"applications,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Kind: Identifies the resource as a collection of Applications. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token which will be used to specify next + // page in list API. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Applications") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ApplicationsListResponse) MarshalJSON() ([]byte, error) { + type noMethod ApplicationsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DataTransfer: The JSON template for a DataTransfer resource. +type DataTransfer struct { + // ApplicationDataTransfers: List of per application data transfer + // resources. It contains data transfer details of the applications + // associated with this transfer resource. Note that this list is also + // used to specify the applications for which data transfer has to be + // done at the time of the transfer resource creation. + ApplicationDataTransfers []*ApplicationDataTransfer `json:"applicationDataTransfers,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Id: The transfer's ID (Read-only). + Id string `json:"id,omitempty"` + + // Kind: Identifies the resource as a DataTransfer request. + Kind string `json:"kind,omitempty"` + + // NewOwnerUserId: ID of the user to whom the data is being transfered. + NewOwnerUserId string `json:"newOwnerUserId,omitempty"` + + // OldOwnerUserId: ID of the user whose data is being transfered. + OldOwnerUserId string `json:"oldOwnerUserId,omitempty"` + + // OverallTransferStatusCode: Overall transfer status (Read-only). + OverallTransferStatusCode string `json:"overallTransferStatusCode,omitempty"` + + // RequestTime: The time at which the data transfer was requested + // (Read-only). + RequestTime string `json:"requestTime,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "ApplicationDataTransfers") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DataTransfer) MarshalJSON() ([]byte, error) { + type noMethod DataTransfer + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DataTransfersListResponse: Template for a collection of DataTransfer +// resources. +type DataTransfersListResponse struct { + // DataTransfers: List of data transfer requests. + DataTransfers []*DataTransfer `json:"dataTransfers,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Kind: Identifies the resource as a collection of data transfer + // requests. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Continuation token which will be used to specify next + // page in list API. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DataTransfers") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DataTransfersListResponse) MarshalJSON() ([]byte, error) { + type noMethod DataTransfersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "datatransfer.applications.get": + +type ApplicationsGetCall struct { + s *Service + applicationId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves information about an application for the given +// application ID. +func (r *ApplicationsService) Get(applicationId int64) *ApplicationsGetCall { + c := &ApplicationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.applicationId = applicationId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ApplicationsGetCall) Fields(s ...googleapi.Field) *ApplicationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ApplicationsGetCall) IfNoneMatch(entityTag string) *ApplicationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ApplicationsGetCall) Context(ctx context.Context) *ApplicationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ApplicationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "applicationId": strconv.FormatInt(c.applicationId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "datatransfer.applications.get" call. +// Exactly one of *Application or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Application.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ApplicationsGetCall) Do() (*Application, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Application{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves information about an application for the given application ID.", + // "httpMethod": "GET", + // "id": "datatransfer.applications.get", + // "parameterOrder": [ + // "applicationId" + // ], + // "parameters": { + // "applicationId": { + // "description": "ID of the application resource to be retrieved.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "applications/{applicationId}", + // "response": { + // "$ref": "Application" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.datatransfer", + // "https://www.googleapis.com/auth/admin.datatransfer.readonly" + // ] + // } + +} + +// method id "datatransfer.applications.list": + +type ApplicationsListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the applications available for data transfer for a +// customer. +func (r *ApplicationsService) List() *ApplicationsListCall { + c := &ApplicationsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// CustomerId sets the optional parameter "customerId": Immutable ID of +// the Google Apps account. +func (c *ApplicationsListCall) CustomerId(customerId string) *ApplicationsListCall { + c.opt_["customerId"] = customerId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. Default is 100. +func (c *ApplicationsListCall) MaxResults(maxResults int64) *ApplicationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Token to specify +// next page in the list. +func (c *ApplicationsListCall) PageToken(pageToken string) *ApplicationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ApplicationsListCall) Fields(s ...googleapi.Field) *ApplicationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ApplicationsListCall) IfNoneMatch(entityTag string) *ApplicationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ApplicationsListCall) Context(ctx context.Context) *ApplicationsListCall { + c.ctx_ = ctx + return c +} + +func (c *ApplicationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["customerId"]; ok { + params.Set("customerId", 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "applications") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "datatransfer.applications.list" call. +// Exactly one of *ApplicationsListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ApplicationsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ApplicationsListCall) Do() (*ApplicationsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ApplicationsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the applications available for data transfer for a customer.", + // "httpMethod": "GET", + // "id": "datatransfer.applications.list", + // "parameters": { + // "customerId": { + // "description": "Immutable ID of the Google Apps account.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return. Default is 100.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Token to specify next page in the list.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "applications", + // "response": { + // "$ref": "ApplicationsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.datatransfer", + // "https://www.googleapis.com/auth/admin.datatransfer.readonly" + // ] + // } + +} + +// method id "datatransfer.transfers.get": + +type TransfersGetCall struct { + s *Service + dataTransferId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves a data transfer request by its resource ID. +func (r *TransfersService) Get(dataTransferId string) *TransfersGetCall { + c := &TransfersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.dataTransferId = dataTransferId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TransfersGetCall) Fields(s ...googleapi.Field) *TransfersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TransfersGetCall) IfNoneMatch(entityTag string) *TransfersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TransfersGetCall) Context(ctx context.Context) *TransfersGetCall { + c.ctx_ = ctx + return c +} + +func (c *TransfersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "transfers/{dataTransferId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "dataTransferId": c.dataTransferId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "datatransfer.transfers.get" call. +// Exactly one of *DataTransfer or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DataTransfer.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TransfersGetCall) Do() (*DataTransfer, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DataTransfer{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a data transfer request by its resource ID.", + // "httpMethod": "GET", + // "id": "datatransfer.transfers.get", + // "parameterOrder": [ + // "dataTransferId" + // ], + // "parameters": { + // "dataTransferId": { + // "description": "ID of the resource to be retrieved. This is returned in the response from the insert method.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "transfers/{dataTransferId}", + // "response": { + // "$ref": "DataTransfer" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.datatransfer", + // "https://www.googleapis.com/auth/admin.datatransfer.readonly" + // ] + // } + +} + +// method id "datatransfer.transfers.insert": + +type TransfersInsertCall struct { + s *Service + datatransfer *DataTransfer + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a data transfer request. +func (r *TransfersService) Insert(datatransfer *DataTransfer) *TransfersInsertCall { + c := &TransfersInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.datatransfer = datatransfer + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TransfersInsertCall) Fields(s ...googleapi.Field) *TransfersInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TransfersInsertCall) Context(ctx context.Context) *TransfersInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TransfersInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.datatransfer) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "transfers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "datatransfer.transfers.insert" call. +// Exactly one of *DataTransfer or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DataTransfer.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TransfersInsertCall) Do() (*DataTransfer, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DataTransfer{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a data transfer request.", + // "httpMethod": "POST", + // "id": "datatransfer.transfers.insert", + // "path": "transfers", + // "request": { + // "$ref": "DataTransfer" + // }, + // "response": { + // "$ref": "DataTransfer" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.datatransfer" + // ] + // } + +} + +// method id "datatransfer.transfers.list": + +type TransfersListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the transfers for a customer by source user, destination +// user, or status. +func (r *TransfersService) List() *TransfersListCall { + c := &TransfersListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// CustomerId sets the optional parameter "customerId": Immutable ID of +// the Google Apps account. +func (c *TransfersListCall) CustomerId(customerId string) *TransfersListCall { + c.opt_["customerId"] = customerId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. Default is 100. +func (c *TransfersListCall) MaxResults(maxResults int64) *TransfersListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// NewOwnerUserId sets the optional parameter "newOwnerUserId": +// Destination user's profile ID. +func (c *TransfersListCall) NewOwnerUserId(newOwnerUserId string) *TransfersListCall { + c.opt_["newOwnerUserId"] = newOwnerUserId + return c +} + +// OldOwnerUserId sets the optional parameter "oldOwnerUserId": Source +// user's profile ID. +func (c *TransfersListCall) OldOwnerUserId(oldOwnerUserId string) *TransfersListCall { + c.opt_["oldOwnerUserId"] = oldOwnerUserId + return c +} + +// PageToken sets the optional parameter "pageToken": Token to specify +// the next page in the list. +func (c *TransfersListCall) PageToken(pageToken string) *TransfersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Status sets the optional parameter "status": Status of the transfer. +func (c *TransfersListCall) Status(status string) *TransfersListCall { + c.opt_["status"] = status + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TransfersListCall) Fields(s ...googleapi.Field) *TransfersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TransfersListCall) IfNoneMatch(entityTag string) *TransfersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TransfersListCall) Context(ctx context.Context) *TransfersListCall { + c.ctx_ = ctx + return c +} + +func (c *TransfersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["customerId"]; ok { + params.Set("customerId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["newOwnerUserId"]; ok { + params.Set("newOwnerUserId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["oldOwnerUserId"]; ok { + params.Set("oldOwnerUserId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["status"]; ok { + params.Set("status", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "transfers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "datatransfer.transfers.list" call. +// Exactly one of *DataTransfersListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *DataTransfersListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TransfersListCall) Do() (*DataTransfersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DataTransfersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the transfers for a customer by source user, destination user, or status.", + // "httpMethod": "GET", + // "id": "datatransfer.transfers.list", + // "parameters": { + // "customerId": { + // "description": "Immutable ID of the Google Apps account.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return. Default is 100.", + // "format": "int32", + // "location": "query", + // "maximum": "500", + // "minimum": "1", + // "type": "integer" + // }, + // "newOwnerUserId": { + // "description": "Destination user's profile ID.", + // "location": "query", + // "type": "string" + // }, + // "oldOwnerUserId": { + // "description": "Source user's profile ID.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Token to specify the next page in the list.", + // "location": "query", + // "type": "string" + // }, + // "status": { + // "description": "Status of the transfer.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "transfers", + // "response": { + // "$ref": "DataTransfersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.datatransfer", + // "https://www.googleapis.com/auth/admin.datatransfer.readonly" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/admin/directory/v1/admin-api.json b/Godeps/_workspace/src/google.golang.org/api/admin/directory/v1/admin-api.json new file mode 100644 index 000000000..3362b2286 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/admin/directory/v1/admin-api.json @@ -0,0 +1,5311 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/pRlNMQbyfGTi-02uw0zCmogMSuU\"", + "discoveryVersion": "v1", + "id": "admin:directory_v1", + "name": "admin", + "canonicalName": "directory", + "version": "directory_v1", + "revision": "20151005", + "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.customer": { + "description": "View and manage customer related information" + }, + "https://www.googleapis.com/auth/admin.directory.customer.readonly": { + "description": "View customer related information" + }, + "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.domain": { + "description": "View and manage the provisioning of domains for your customers" + }, + "https://www.googleapis.com/auth/admin.directory.domain.readonly": { + "description": "View domains related to your customers" + }, + "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.rolemanagement": { + "description": "Manage delegated admin roles for your domain" + }, + "https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly": { + "description": "View delegated admin roles for 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" + }, + "https://www.googleapis.com/auth/admin.directory.userschema": { + "description": "View and manage the provisioning of user schemas on your domain" + }, + "https://www.googleapis.com/auth/admin.directory.userschema.readonly": { + "description": "View user schemas on your domain" + } + } + } + }, + "schemas": { + "Alias": { + "id": "Alias", + "type": "object", + "description": "JSON template for Alias object in 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 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 Directory API.", + "properties": { + "activeTimeRanges": { + "type": "array", + "description": "List of active time ranges (Read-only)", + "items": { + "type": "object", + "properties": { + "activeTime": { + "type": "integer", + "description": "Duration in milliseconds", + "format": "int32" + }, + "date": { + "type": "string", + "description": "Date of usage", + "format": "date" + } + } + } + }, + "annotatedAssetId": { + "type": "string", + "description": "AssetId specified during enrollment or through later annotation" + }, + "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." + }, + "ethernetMacAddress": { + "type": "string", + "description": "Chromebook Mac Address on ethernet network interface (Read-only)" + }, + "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 on wifi network interface (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)" + }, + "recentUsers": { + "type": "array", + "description": "List of recent device users, in descending order by last login time (Read-only)", + "items": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email address of the user. Present only if the user type is managed" + }, + "type": { + "type": "string", + "description": "The type of the user" + } + } + } + }, + "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 renew after support end date (Read-only)" + } + } + }, + "ChromeOsDevices": { + "id": "ChromeOsDevices", + "type": "object", + "description": "JSON response template for List Chrome OS Devices operation in 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." + } + } + }, + "Customer": { + "id": "Customer", + "type": "object", + "description": "JSON template for Customer Resource object in Directory API.", + "properties": { + "alternateEmail": { + "type": "string", + "description": "The customer's secondary contact email address. This email address cannot be on the same domain as the customerDomain" + }, + "customerCreationTime": { + "type": "string", + "description": "The customer's creation time (Readonly)", + "format": "date-time" + }, + "customerDomain": { + "type": "string", + "description": "The customer's primary domain name string. Do not include the www prefix when creating a new customer." + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "id": { + "type": "string", + "description": "The unique ID for the customer's Google account. (Readonly)" + }, + "kind": { + "type": "string", + "description": "Identifies the resource as a customer. Value: admin#directory#customer", + "default": "admin#directory#customer" + }, + "language": { + "type": "string", + "description": "The customer's ISO 639-2 language code. The default value is en-US" + }, + "phoneNumber": { + "type": "string", + "description": "The customer's contact phone number in E.164 format." + }, + "postalAddress": { + "$ref": "CustomerPostalAddress", + "description": "The customer's postal address information." + } + } + }, + "CustomerPostalAddress": { + "id": "CustomerPostalAddress", + "type": "object", + "description": "JSON template for postal address of a customer.", + "properties": { + "addressLine1": { + "type": "string", + "description": "A customer's physical address. The address can be composed of one to three lines." + }, + "addressLine2": { + "type": "string", + "description": "Address line 2 of the address." + }, + "addressLine3": { + "type": "string", + "description": "Address line 3 of the address." + }, + "contactName": { + "type": "string", + "description": "The customer contact's name." + }, + "countryCode": { + "type": "string", + "description": "This is a required property. For countryCode information see the ISO 3166 country code elements." + }, + "locality": { + "type": "string", + "description": "Name of the locality. An example of a locality value is the city of San Francisco." + }, + "organizationName": { + "type": "string", + "description": "The company or company division name." + }, + "postalCode": { + "type": "string", + "description": "The postal code. A postalCode example is a postal zip code such as 10009. This is in accordance with - http://portablecontacts.net/draft-spec.html#address_element." + }, + "region": { + "type": "string", + "description": "Name of the region. An example of a region value is NY for the state of New York." + } + } + }, + "DomainAlias": { + "id": "DomainAlias", + "type": "object", + "description": "JSON template for Domain Alias object in Directory API.", + "properties": { + "creationTime": { + "type": "string", + "description": "The creation time of the domain alias. (Read-only).", + "format": "int64" + }, + "domainAliasName": { + "type": "string", + "description": "The domain alias name." + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is.", + "default": "admin#directory#domainAlias" + }, + "parentDomainName": { + "type": "string", + "description": "The parent domain name that the domain alias is associated with. This can either be a primary or secondary domain name within a customer.", + "annotations": { + "required": [ + "directory.domains.insert" + ] + } + }, + "verified": { + "type": "boolean", + "description": "Indicates the verification state of a domain alias. (Read-only)" + } + } + }, + "DomainAliases": { + "id": "DomainAliases", + "type": "object", + "description": "JSON response template to list domain aliases in Directory API.", + "properties": { + "domainAliases": { + "type": "array", + "description": "List of domain alias objects.", + "items": { + "$ref": "DomainAlias" + } + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is.", + "default": "admin#directory#domainAliases" + } + } + }, + "Domains": { + "id": "Domains", + "type": "object", + "description": "JSON template for Domain object in Directory API.", + "properties": { + "creationTime": { + "type": "string", + "description": "Creation time of the domain. (Read-only).", + "format": "int64" + }, + "domainAliases": { + "type": "array", + "description": "List of domain alias objects. (Read-only)", + "items": { + "$ref": "DomainAlias" + } + }, + "domainName": { + "type": "string", + "description": "The domain name of the customer.", + "annotations": { + "required": [ + "directory.domains.insert" + ] + } + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "isPrimary": { + "type": "boolean", + "description": "Indicates if the domain is a primary domain (Read-only)." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is.", + "default": "admin#directory#domain" + }, + "verified": { + "type": "boolean", + "description": "Indicates the verification state of a domain. (Read-only)." + } + } + }, + "Domains2": { + "id": "Domains2", + "type": "object", + "description": "JSON response template to list Domains in Directory API.", + "properties": { + "domains": { + "type": "array", + "description": "List of domain objects.", + "items": { + "$ref": "Domains" + } + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is.", + "default": "admin#directory#domains" + } + } + }, + "Group": { + "id": "Group", + "type": "object", + "description": "JSON template for Group resource in 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 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 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 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 Directory API.", + "properties": { + "adbStatus": { + "type": "boolean", + "description": "Adb (USB debugging) enabled or disabled on device (Read-only)" + }, + "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" + } + } + } + }, + "basebandVersion": { + "type": "string", + "description": "Mobile Device Baseband version (Read-only)" + }, + "buildNumber": { + "type": "string", + "description": "Mobile Device Build number (Read-only)" + }, + "defaultLanguage": { + "type": "string", + "description": "The default locale used on the Mobile Device (Read-only)" + }, + "developerOptionsStatus": { + "type": "boolean", + "description": "Developer options enabled or disabled on device (Read-only)" + }, + "deviceCompromisedStatus": { + "type": "string", + "description": "Mobile Device compromised status (Read-only)" + }, + "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)" + }, + "imei": { + "type": "string", + "description": "Mobile Device IMEI number (Read-only)" + }, + "kernelVersion": { + "type": "string", + "description": "Mobile Device Kernel version (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" + }, + "managedAccountIsOnOwnerProfile": { + "type": "boolean", + "description": "Boolean indicating if this account is on owner/primary profile or not (Read-only)" + }, + "meid": { + "type": "string", + "description": "Mobile Device MEID number (Read-only)" + }, + "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" + } + }, + "networkOperator": { + "type": "string", + "description": "Mobile Device mobile or network operator (if available) (Read-only)" + }, + "os": { + "type": "string", + "description": "Name of the mobile operating system" + }, + "otherAccountsInfo": { + "type": "array", + "description": "List of accounts added on device (Read-only)", + "items": { + "type": "string" + } + }, + "resourceId": { + "type": "string", + "description": "Unique identifier of Mobile Device (Read-only)" + }, + "serialNumber": { + "type": "string", + "description": "Mobile Device SSN or Serial Number (Read-only)" + }, + "status": { + "type": "string", + "description": "Status of the device (Read-only)" + }, + "supportsWorkProfile": { + "type": "boolean", + "description": "Work profile supported on device (Read-only)" + }, + "type": { + "type": "string", + "description": "The type of device (Read-only)" + }, + "unknownSourcesStatus": { + "type": "boolean", + "description": "Unknown sources enabled or disabled on device (Read-only)" + }, + "userAgent": { + "type": "string", + "description": "Mobile Device user agent" + }, + "wifiMacAddress": { + "type": "string", + "description": "Mobile Device WiFi MAC address (Read-only)" + } + } + }, + "MobileDeviceAction": { + "id": "MobileDeviceAction", + "type": "object", + "description": "JSON request template for firing commands on Mobile Device in 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 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.", + "annotations": { + "required": [ + "directory.notifications.patch", + "directory.notifications.update" + ] + } + }, + "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 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" + ] + } + }, + "orgUnitId": { + "type": "string", + "description": "Id of OrgUnit" + }, + "orgUnitPath": { + "type": "string", + "description": "Path of OrgUnit" + }, + "parentOrgUnitId": { + "type": "string", + "description": "Id of parent OrgUnit" + }, + "parentOrgUnitPath": { + "type": "string", + "description": "Path of parent OrgUnit" + } + } + }, + "OrgUnits": { + "id": "OrgUnits", + "type": "object", + "description": "JSON response template for List Organization Units operation in 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" + } + } + } + }, + "Privilege": { + "id": "Privilege", + "type": "object", + "description": "JSON template for privilege resource in Directory API.", + "properties": { + "childPrivileges": { + "type": "array", + "description": "A list of child privileges. Privileges for a service form a tree. Each privilege can have a list of child privileges; this list is empty for a leaf privilege.", + "items": { + "$ref": "Privilege" + } + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "isOuScopable": { + "type": "boolean", + "description": "If the privilege can be restricted to an organization unit." + }, + "kind": { + "type": "string", + "description": "The type of the API resource. This is always admin#directory#privilege.", + "default": "admin#directory#privilege" + }, + "privilegeName": { + "type": "string", + "description": "The name of the privilege." + }, + "serviceId": { + "type": "string", + "description": "The obfuscated ID of the service this privilege is for." + }, + "serviceName": { + "type": "string", + "description": "The name of the service this privilege is for." + } + } + }, + "Privileges": { + "id": "Privileges", + "type": "object", + "description": "JSON response template for List privileges operation in Directory API.", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "items": { + "type": "array", + "description": "A list of Privilege resources.", + "items": { + "$ref": "Privilege" + } + }, + "kind": { + "type": "string", + "description": "The type of the API resource. This is always admin#directory#privileges.", + "default": "admin#directory#privileges" + } + } + }, + "Role": { + "id": "Role", + "type": "object", + "description": "JSON template for role resource in Directory API.", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "isSuperAdminRole": { + "type": "boolean", + "description": "Returns true if the role is a super admin role." + }, + "isSystemRole": { + "type": "boolean", + "description": "Returns true if this is a pre-defined system role." + }, + "kind": { + "type": "string", + "description": "The type of the API resource. This is always admin#directory#role.", + "default": "admin#directory#role" + }, + "roleDescription": { + "type": "string", + "description": "A short description of the role." + }, + "roleId": { + "type": "string", + "description": "ID of the role.", + "format": "int64" + }, + "roleName": { + "type": "string", + "description": "Name of the role.", + "annotations": { + "required": [ + "directory.roles.insert" + ] + } + }, + "rolePrivileges": { + "type": "array", + "description": "The set of privileges that are granted to this role.", + "items": { + "type": "object", + "properties": { + "privilegeName": { + "type": "string", + "description": "The name of the privilege." + }, + "serviceId": { + "type": "string", + "description": "The obfuscated ID of the service this privilege is for." + } + } + }, + "annotations": { + "required": [ + "directory.roles.insert" + ] + } + } + } + }, + "RoleAssignment": { + "id": "RoleAssignment", + "type": "object", + "description": "JSON template for roleAssignment resource in Directory API.", + "properties": { + "assignedTo": { + "type": "string", + "description": "The unique ID of the user this role is assigned to." + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "kind": { + "type": "string", + "description": "The type of the API resource. This is always admin#directory#roleAssignment.", + "default": "admin#directory#roleAssignment" + }, + "orgUnitId": { + "type": "string", + "description": "If the role is restricted to an organization unit, this contains the ID for the organization unit the exercise of this role is restricted to." + }, + "roleAssignmentId": { + "type": "string", + "description": "ID of this roleAssignment.", + "format": "int64" + }, + "roleId": { + "type": "string", + "description": "The ID of the role that is assigned.", + "format": "int64" + }, + "scopeType": { + "type": "string", + "description": "The scope in which this role is assigned. Possible values are: \n- CUSTOMER\n- ORG_UNIT" + } + } + }, + "RoleAssignments": { + "id": "RoleAssignments", + "type": "object", + "description": "JSON response template for List roleAssignments operation in Directory API.", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "items": { + "type": "array", + "description": "A list of RoleAssignment resources.", + "items": { + "$ref": "RoleAssignment" + } + }, + "kind": { + "type": "string", + "description": "The type of the API resource. This is always admin#directory#roleAssignments.", + "default": "admin#directory#roleAssignments" + }, + "nextPageToken": { + "type": "string" + } + } + }, + "Roles": { + "id": "Roles", + "type": "object", + "description": "JSON response template for List roles operation in Directory API.", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "items": { + "type": "array", + "description": "A list of Role resources.", + "items": { + "$ref": "Role" + } + }, + "kind": { + "type": "string", + "description": "The type of the API resource. This is always admin#directory#roles.", + "default": "admin#directory#roles" + }, + "nextPageToken": { + "type": "string" + } + } + }, + "Schema": { + "id": "Schema", + "type": "object", + "description": "JSON template for Schema resource in Directory API.", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "fields": { + "type": "array", + "description": "Fields of Schema", + "items": { + "$ref": "SchemaFieldSpec" + }, + "annotations": { + "required": [ + "directory.schemas.insert", + "directory.schemas.update" + ] + } + }, + "kind": { + "type": "string", + "description": "Kind of resource this is.", + "default": "admin#directory#schema" + }, + "schemaId": { + "type": "string", + "description": "Unique identifier of Schema (Read-only)" + }, + "schemaName": { + "type": "string", + "description": "Schema name", + "annotations": { + "required": [ + "directory.schemas.insert" + ] + } + } + } + }, + "SchemaFieldSpec": { + "id": "SchemaFieldSpec", + "type": "object", + "description": "JSON template for FieldSpec resource for Schemas in Directory API.", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "fieldId": { + "type": "string", + "description": "Unique identifier of Field (Read-only)" + }, + "fieldName": { + "type": "string", + "description": "Name of the field.", + "annotations": { + "required": [ + "directory.schemas.insert", + "directory.schemas.update" + ] + } + }, + "fieldType": { + "type": "string", + "description": "Type of the field.", + "annotations": { + "required": [ + "directory.schemas.insert", + "directory.schemas.update" + ] + } + }, + "indexed": { + "type": "boolean", + "description": "Boolean specifying whether the field is indexed or not.", + "default": "true" + }, + "kind": { + "type": "string", + "description": "Kind of resource this is.", + "default": "admin#directory#schema#fieldspec" + }, + "multiValued": { + "type": "boolean", + "description": "Boolean specifying whether this is a multi-valued field or not." + }, + "numericIndexingSpec": { + "type": "object", + "description": "Indexing spec for a numeric field. By default, only exact match queries will be supported for numeric fields. Setting the numericIndexingSpec allows range queries to be supported.", + "properties": { + "maxValue": { + "type": "number", + "description": "Maximum value of this field. This is meant to be indicative rather than enforced. Values outside this range will still be indexed, but search may not be as performant.", + "format": "double" + }, + "minValue": { + "type": "number", + "description": "Minimum value of this field. This is meant to be indicative rather than enforced. Values outside this range will still be indexed, but search may not be as performant.", + "format": "double" + } + } + }, + "readAccessType": { + "type": "string", + "description": "Read ACLs on the field specifying who can view values of this field. Valid values are \"ALL_DOMAIN_USERS\" and \"ADMINS_AND_SELF\".", + "default": "ALL_DOMAIN_USERS" + } + } + }, + "Schemas": { + "id": "Schemas", + "type": "object", + "description": "JSON response template for List Schema operation in Directory API.", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is.", + "default": "admin#directory#schemas" + }, + "schemas": { + "type": "array", + "description": "List of UserSchema objects.", + "items": { + "$ref": "Schema" + } + } + } + }, + "Token": { + "id": "Token", + "type": "object", + "description": "JSON template for token resource in 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 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 Directory API.", + "properties": { + "addresses": { + "type": "any" + }, + "agreedToTerms": { + "type": "boolean", + "description": "Indicates if user has agreed to terms (Read-only)", + "readOnly": true + }, + "aliases": { + "type": "array", + "description": "List of aliases (Read-only)", + "readOnly": true, + "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", + "readOnly": true + }, + "customSchemas": { + "type": "object", + "description": "Custom fields of the user.", + "additionalProperties": { + "$ref": "UserCustomProperties" + } + }, + "customerId": { + "type": "string", + "description": "CustomerId of User (Read-only)", + "readOnly": true + }, + "deletionTime": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "emails": { + "type": "any" + }, + "etag": { + "type": "string", + "description": "ETag of the resource.", + "readOnly": true + }, + "externalIds": { + "type": "any" + }, + "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": "any" + }, + "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)", + "readOnly": true + }, + "isDelegatedAdmin": { + "type": "boolean", + "description": "Boolean indicating if the user is delegated admin (Read-only)", + "readOnly": true + }, + "isMailboxSetup": { + "type": "boolean", + "description": "Is mailbox setup (Read-only)", + "readOnly": true + }, + "kind": { + "type": "string", + "description": "Kind of resource this is.", + "default": "admin#directory#user", + "readOnly": true + }, + "lastLoginTime": { + "type": "string", + "description": "User's last login time. (Read-only)", + "format": "date-time", + "readOnly": true + }, + "name": { + "$ref": "UserName", + "description": "User's name", + "annotations": { + "required": [ + "directory.users.insert" + ] + } + }, + "nonEditableAliases": { + "type": "array", + "description": "List of non editable aliases (Read-only)", + "readOnly": true, + "items": { + "type": "string" + } + }, + "notes": { + "type": "any" + }, + "orgUnitPath": { + "type": "string", + "description": "OrgUnit of User" + }, + "organizations": { + "type": "any" + }, + "password": { + "type": "string", + "description": "User's password", + "annotations": { + "required": [ + "directory.users.insert" + ] + } + }, + "phones": { + "type": "any" + }, + "primaryEmail": { + "type": "string", + "description": "username of User", + "annotations": { + "required": [ + "directory.users.insert" + ] + } + }, + "relations": { + "type": "any" + }, + "suspended": { + "type": "boolean", + "description": "Indicates if user is suspended" + }, + "suspensionReason": { + "type": "string", + "description": "Suspension reason if user is suspended (Read-only)", + "readOnly": true + }, + "thumbnailPhotoEtag": { + "type": "string", + "description": "ETag of the user's photo (Read-only)", + "readOnly": true + }, + "thumbnailPhotoUrl": { + "type": "string", + "description": "Photo Url of the user (Read-only)", + "readOnly": true + }, + "websites": { + "type": "any" + } + } + }, + "UserAbout": { + "id": "UserAbout", + "type": "object", + "description": "JSON template for About (notes) of a user in Directory API.", + "properties": { + "contentType": { + "type": "string", + "description": "About entry can have a type which indicates the content type. It can either be plain or html. By default, notes contents are assumed to contain plain text." + }, + "value": { + "type": "string", + "description": "Actual value of notes." + } + } + }, + "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." + }, + "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." + } + } + }, + "UserCustomProperties": { + "id": "UserCustomProperties", + "type": "object", + "description": "JSON template for a set of custom properties (i.e. all fields in a particular schema)", + "additionalProperties": { + "type": "any" + } + }, + "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 types 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 primary 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. Similar 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 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 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": "Symbol 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 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 Directory API.", + "properties": { + "orgUnitPath": { + "type": "string", + "description": "OrgUnit of User" + } + } + }, + "UserWebsite": { + "id": "UserWebsite", + "type": "object", + "description": "JSON template for a website entry.", + "properties": { + "customType": { + "type": "string", + "description": "Custom Type." + }, + "primary": { + "type": "boolean", + "description": "If this is user's primary website or not." + }, + "type": { + "type": "string", + "description": "Each entry can have a type which indicates standard types of that entry. For example website could be of home, work, blog 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": "Website." + } + } + }, + "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 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 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" + ] + } + } + }, + "customers": { + "methods": { + "get": { + "id": "directory.customers.get", + "path": "customers/{customerKey}", + "httpMethod": "GET", + "description": "Retrives a customer.", + "parameters": { + "customerKey": { + "type": "string", + "description": "Id of the customer to be retrieved", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerKey" + ], + "response": { + "$ref": "Customer" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.customer", + "https://www.googleapis.com/auth/admin.directory.customer.readonly" + ] + }, + "patch": { + "id": "directory.customers.patch", + "path": "customers/{customerKey}", + "httpMethod": "PATCH", + "description": "Updates a customer. This method supports patch semantics.", + "parameters": { + "customerKey": { + "type": "string", + "description": "Id of the customer to be updated", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerKey" + ], + "request": { + "$ref": "Customer" + }, + "response": { + "$ref": "Customer" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.customer" + ] + }, + "update": { + "id": "directory.customers.update", + "path": "customers/{customerKey}", + "httpMethod": "PUT", + "description": "Updates a customer.", + "parameters": { + "customerKey": { + "type": "string", + "description": "Id of the customer to be updated", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerKey" + ], + "request": { + "$ref": "Customer" + }, + "response": { + "$ref": "Customer" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.customer" + ] + } + } + }, + "domainAliases": { + "methods": { + "delete": { + "id": "directory.domainAliases.delete", + "path": "customer/{customer}/domainaliases/{domainAliasName}", + "httpMethod": "DELETE", + "description": "Deletes a Domain Alias of the customer.", + "parameters": { + "customer": { + "type": "string", + "description": "Immutable id of the Google Apps account.", + "required": true, + "location": "path" + }, + "domainAliasName": { + "type": "string", + "description": "Name of domain alias to be retrieved.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customer", + "domainAliasName" + ], + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.domain" + ] + }, + "get": { + "id": "directory.domainAliases.get", + "path": "customer/{customer}/domainaliases/{domainAliasName}", + "httpMethod": "GET", + "description": "Retrieves a domain alias of the customer.", + "parameters": { + "customer": { + "type": "string", + "description": "Immutable id of the Google Apps account.", + "required": true, + "location": "path" + }, + "domainAliasName": { + "type": "string", + "description": "Name of domain alias to be retrieved.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customer", + "domainAliasName" + ], + "response": { + "$ref": "DomainAlias" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.domain", + "https://www.googleapis.com/auth/admin.directory.domain.readonly" + ] + }, + "insert": { + "id": "directory.domainAliases.insert", + "path": "customer/{customer}/domainaliases", + "httpMethod": "POST", + "description": "Inserts a Domain alias of the customer.", + "parameters": { + "customer": { + "type": "string", + "description": "Immutable id of the Google Apps account.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customer" + ], + "request": { + "$ref": "DomainAlias" + }, + "response": { + "$ref": "DomainAlias" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.domain" + ] + }, + "list": { + "id": "directory.domainAliases.list", + "path": "customer/{customer}/domainaliases", + "httpMethod": "GET", + "description": "Lists the domain aliases of the customer.", + "parameters": { + "customer": { + "type": "string", + "description": "Immutable id of the Google Apps account.", + "required": true, + "location": "path" + }, + "parentDomainName": { + "type": "string", + "description": "Name of the parent domain for which domain aliases are to be fetched.", + "location": "query" + } + }, + "parameterOrder": [ + "customer" + ], + "response": { + "$ref": "DomainAliases" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.domain", + "https://www.googleapis.com/auth/admin.directory.domain.readonly" + ] + } + } + }, + "domains": { + "methods": { + "delete": { + "id": "directory.domains.delete", + "path": "customer/{customer}/domains/{domainName}", + "httpMethod": "DELETE", + "description": "Deletes a domain of the customer.", + "parameters": { + "customer": { + "type": "string", + "description": "Immutable id of the Google Apps account.", + "required": true, + "location": "path" + }, + "domainName": { + "type": "string", + "description": "Name of domain to be deleted", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customer", + "domainName" + ], + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.domain" + ] + }, + "get": { + "id": "directory.domains.get", + "path": "customer/{customer}/domains/{domainName}", + "httpMethod": "GET", + "description": "Retrives a domain of the customer.", + "parameters": { + "customer": { + "type": "string", + "description": "Immutable id of the Google Apps account.", + "required": true, + "location": "path" + }, + "domainName": { + "type": "string", + "description": "Name of domain to be retrieved", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customer", + "domainName" + ], + "response": { + "$ref": "Domains" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.domain", + "https://www.googleapis.com/auth/admin.directory.domain.readonly" + ] + }, + "insert": { + "id": "directory.domains.insert", + "path": "customer/{customer}/domains", + "httpMethod": "POST", + "description": "Inserts a domain of the customer.", + "parameters": { + "customer": { + "type": "string", + "description": "Immutable id of the Google Apps account.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customer" + ], + "request": { + "$ref": "Domains" + }, + "response": { + "$ref": "Domains" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.domain" + ] + }, + "list": { + "id": "directory.domains.list", + "path": "customer/{customer}/domains", + "httpMethod": "GET", + "description": "Lists the domains of the customer.", + "parameters": { + "customer": { + "type": "string", + "description": "Immutable id of the Google Apps account.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customer" + ], + "response": { + "$ref": "Domains2" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.domain", + "https://www.googleapis.com/auth/admin.directory.domain.readonly" + ] + } + } + }, + "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 or its Id", + "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 or its Id", + "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's path or its Id", + "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 or its Id", + "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 or its Id", + "required": true, + "repeated": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId", + "orgUnitPath" + ], + "request": { + "$ref": "OrgUnit" + }, + "response": { + "$ref": "OrgUnit" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.orgunit" + ] + } + } + }, + "privileges": { + "methods": { + "list": { + "id": "directory.privileges.list", + "path": "customer/{customer}/roles/ALL/privileges", + "httpMethod": "GET", + "description": "Retrieves a paginated list of all privileges for a customer.", + "parameters": { + "customer": { + "type": "string", + "description": "Immutable ID of the Google Apps account.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customer" + ], + "response": { + "$ref": "Privileges" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.rolemanagement", + "https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly" + ] + } + } + }, + "roleAssignments": { + "methods": { + "delete": { + "id": "directory.roleAssignments.delete", + "path": "customer/{customer}/roleassignments/{roleAssignmentId}", + "httpMethod": "DELETE", + "description": "Deletes a role assignment.", + "parameters": { + "customer": { + "type": "string", + "description": "Immutable ID of the Google Apps account.", + "required": true, + "location": "path" + }, + "roleAssignmentId": { + "type": "string", + "description": "Immutable ID of the role assignment.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customer", + "roleAssignmentId" + ], + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.rolemanagement" + ] + }, + "get": { + "id": "directory.roleAssignments.get", + "path": "customer/{customer}/roleassignments/{roleAssignmentId}", + "httpMethod": "GET", + "description": "Retrieve a role assignment.", + "parameters": { + "customer": { + "type": "string", + "description": "Immutable ID of the Google Apps account.", + "required": true, + "location": "path" + }, + "roleAssignmentId": { + "type": "string", + "description": "Immutable ID of the role assignment.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customer", + "roleAssignmentId" + ], + "response": { + "$ref": "RoleAssignment" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.rolemanagement", + "https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly" + ] + }, + "insert": { + "id": "directory.roleAssignments.insert", + "path": "customer/{customer}/roleassignments", + "httpMethod": "POST", + "description": "Creates a role assignment.", + "parameters": { + "customer": { + "type": "string", + "description": "Immutable ID of the Google Apps account.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customer" + ], + "request": { + "$ref": "RoleAssignment" + }, + "response": { + "$ref": "RoleAssignment" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.rolemanagement" + ] + }, + "list": { + "id": "directory.roleAssignments.list", + "path": "customer/{customer}/roleassignments", + "httpMethod": "GET", + "description": "Retrieves a paginated list of all roleAssignments.", + "parameters": { + "customer": { + "type": "string", + "description": "Immutable ID of the Google Apps account.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "minimum": "1", + "maximum": "200", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token to specify the next page in the list.", + "location": "query" + }, + "roleId": { + "type": "string", + "description": "Immutable ID of a role. If included in the request, returns only role assignments containing this role ID.", + "location": "query" + }, + "userKey": { + "type": "string", + "description": "The user's primary email address, alias email address, or unique user ID. If included in the request, returns role assignments only for this user.", + "location": "query" + } + }, + "parameterOrder": [ + "customer" + ], + "response": { + "$ref": "RoleAssignments" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.rolemanagement", + "https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly" + ] + } + } + }, + "roles": { + "methods": { + "delete": { + "id": "directory.roles.delete", + "path": "customer/{customer}/roles/{roleId}", + "httpMethod": "DELETE", + "description": "Deletes a role.", + "parameters": { + "customer": { + "type": "string", + "description": "Immutable ID of the Google Apps account.", + "required": true, + "location": "path" + }, + "roleId": { + "type": "string", + "description": "Immutable ID of the role.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customer", + "roleId" + ], + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.rolemanagement" + ] + }, + "get": { + "id": "directory.roles.get", + "path": "customer/{customer}/roles/{roleId}", + "httpMethod": "GET", + "description": "Retrieves a role.", + "parameters": { + "customer": { + "type": "string", + "description": "Immutable ID of the Google Apps account.", + "required": true, + "location": "path" + }, + "roleId": { + "type": "string", + "description": "Immutable ID of the role.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customer", + "roleId" + ], + "response": { + "$ref": "Role" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.rolemanagement", + "https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly" + ] + }, + "insert": { + "id": "directory.roles.insert", + "path": "customer/{customer}/roles", + "httpMethod": "POST", + "description": "Creates a role.", + "parameters": { + "customer": { + "type": "string", + "description": "Immutable ID of the Google Apps account.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customer" + ], + "request": { + "$ref": "Role" + }, + "response": { + "$ref": "Role" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.rolemanagement" + ] + }, + "list": { + "id": "directory.roles.list", + "path": "customer/{customer}/roles", + "httpMethod": "GET", + "description": "Retrieves a paginated list of all the roles in a domain.", + "parameters": { + "customer": { + "type": "string", + "description": "Immutable id of the Google Apps account.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token to specify the next page in the list.", + "location": "query" + } + }, + "parameterOrder": [ + "customer" + ], + "response": { + "$ref": "Roles" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.rolemanagement", + "https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly" + ] + }, + "patch": { + "id": "directory.roles.patch", + "path": "customer/{customer}/roles/{roleId}", + "httpMethod": "PATCH", + "description": "Updates a role. This method supports patch semantics.", + "parameters": { + "customer": { + "type": "string", + "description": "Immutable ID of the Google Apps account.", + "required": true, + "location": "path" + }, + "roleId": { + "type": "string", + "description": "Immutable ID of the role.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customer", + "roleId" + ], + "request": { + "$ref": "Role" + }, + "response": { + "$ref": "Role" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.rolemanagement" + ] + }, + "update": { + "id": "directory.roles.update", + "path": "customer/{customer}/roles/{roleId}", + "httpMethod": "PUT", + "description": "Updates a role.", + "parameters": { + "customer": { + "type": "string", + "description": "Immutable ID of the Google Apps account.", + "required": true, + "location": "path" + }, + "roleId": { + "type": "string", + "description": "Immutable ID of the role.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customer", + "roleId" + ], + "request": { + "$ref": "Role" + }, + "response": { + "$ref": "Role" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.rolemanagement" + ] + } + } + }, + "schemas": { + "methods": { + "delete": { + "id": "directory.schemas.delete", + "path": "customer/{customerId}/schemas/{schemaKey}", + "httpMethod": "DELETE", + "description": "Delete schema", + "parameters": { + "customerId": { + "type": "string", + "description": "Immutable id of the Google Apps account", + "required": true, + "location": "path" + }, + "schemaKey": { + "type": "string", + "description": "Name or immutable Id of the schema", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId", + "schemaKey" + ], + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.userschema" + ] + }, + "get": { + "id": "directory.schemas.get", + "path": "customer/{customerId}/schemas/{schemaKey}", + "httpMethod": "GET", + "description": "Retrieve schema", + "parameters": { + "customerId": { + "type": "string", + "description": "Immutable id of the Google Apps account", + "required": true, + "location": "path" + }, + "schemaKey": { + "type": "string", + "description": "Name or immutable Id of the schema", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId", + "schemaKey" + ], + "response": { + "$ref": "Schema" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.userschema", + "https://www.googleapis.com/auth/admin.directory.userschema.readonly" + ] + }, + "insert": { + "id": "directory.schemas.insert", + "path": "customer/{customerId}/schemas", + "httpMethod": "POST", + "description": "Create schema.", + "parameters": { + "customerId": { + "type": "string", + "description": "Immutable id of the Google Apps account", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId" + ], + "request": { + "$ref": "Schema" + }, + "response": { + "$ref": "Schema" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.userschema" + ] + }, + "list": { + "id": "directory.schemas.list", + "path": "customer/{customerId}/schemas", + "httpMethod": "GET", + "description": "Retrieve all schemas for a customer", + "parameters": { + "customerId": { + "type": "string", + "description": "Immutable id of the Google Apps account", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId" + ], + "response": { + "$ref": "Schemas" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.userschema", + "https://www.googleapis.com/auth/admin.directory.userschema.readonly" + ] + }, + "patch": { + "id": "directory.schemas.patch", + "path": "customer/{customerId}/schemas/{schemaKey}", + "httpMethod": "PATCH", + "description": "Update schema. This method supports patch semantics.", + "parameters": { + "customerId": { + "type": "string", + "description": "Immutable id of the Google Apps account", + "required": true, + "location": "path" + }, + "schemaKey": { + "type": "string", + "description": "Name or immutable Id of the schema.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId", + "schemaKey" + ], + "request": { + "$ref": "Schema" + }, + "response": { + "$ref": "Schema" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.userschema" + ] + }, + "update": { + "id": "directory.schemas.update", + "path": "customer/{customerId}/schemas/{schemaKey}", + "httpMethod": "PUT", + "description": "Update schema", + "parameters": { + "customerId": { + "type": "string", + "description": "Immutable id of the Google Apps account", + "required": true, + "location": "path" + }, + "schemaKey": { + "type": "string", + "description": "Name or immutable Id of the schema.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "customerId", + "schemaKey" + ], + "request": { + "$ref": "Schema" + }, + "response": { + "$ref": "Schema" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.directory.userschema" + ] + } + } + }, + "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 tokens specified user has issued to 3rd party applications.", + "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": { + "customFieldMask": { + "type": "string", + "description": "Comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom.", + "location": "query" + }, + "projection": { + "type": "string", + "description": "What subset of fields to fetch for this user.", + "default": "basic", + "enum": [ + "basic", + "custom", + "full" + ], + "enumDescriptions": [ + "Do not include any custom fields for the user.", + "Include custom fields from schemas mentioned in customFieldMask.", + "Include all fields associated with this user." + ], + "location": "query" + }, + "userKey": { + "type": "string", + "description": "Email or immutable Id of the user", + "required": true, + "location": "path" + }, + "viewType": { + "type": "string", + "description": "Whether to fetch the ADMIN_VIEW or DOMAIN_PUBLIC view of the user.", + "default": "admin_view", + "enum": [ + "admin_view", + "domain_public" + ], + "enumDescriptions": [ + "Fetches the ADMIN_VIEW of the user.", + "Fetches the DOMAIN_PUBLIC view of the user." + ], + "location": "query" + } + }, + "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": { + "customFieldMask": { + "type": "string", + "description": "Comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom.", + "location": "query" + }, + "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" + }, + "projection": { + "type": "string", + "description": "What subset of fields to fetch for this user.", + "default": "basic", + "enum": [ + "basic", + "custom", + "full" + ], + "enumDescriptions": [ + "Do not include any custom fields for the user.", + "Include custom fields from schemas mentioned in customFieldMask.", + "Include all fields associated with this user." + ], + "location": "query" + }, + "query": { + "type": "string", + "description": "Query string search. Should be of the form \"\". Complete documentation is at https://developers.google.com/admin-sdk/directory/v1/guides/search-users", + "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" + }, + "viewType": { + "type": "string", + "description": "Whether to fetch the ADMIN_VIEW or DOMAIN_PUBLIC view of the user.", + "default": "admin_view", + "enum": [ + "admin_view", + "domain_public" + ], + "enumDescriptions": [ + "Fetches the ADMIN_VIEW of the user.", + "Fetches the DOMAIN_PUBLIC view of the user." + ], + "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": { + "customFieldMask": { + "type": "string", + "description": "Comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom.", + "location": "query" + }, + "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" + }, + "projection": { + "type": "string", + "description": "What subset of fields to fetch for this user.", + "default": "basic", + "enum": [ + "basic", + "custom", + "full" + ], + "enumDescriptions": [ + "Do not include any custom fields for the user.", + "Include custom fields from schemas mentioned in customFieldMask.", + "Include all fields associated with this user." + ], + "location": "query" + }, + "query": { + "type": "string", + "description": "Query string search. Should be of the form \"\". Complete documentation is at https://developers.google.com/admin-sdk/directory/v1/guides/search-users", + "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" + }, + "viewType": { + "type": "string", + "description": "Whether to fetch the ADMIN_VIEW or DOMAIN_PUBLIC view of the user.", + "default": "admin_view", + "enum": [ + "admin_view", + "domain_public" + ], + "enumDescriptions": [ + "Fetches the ADMIN_VIEW of the user.", + "Fetches the DOMAIN_PUBLIC view of the user." + ], + "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/Godeps/_workspace/src/google.golang.org/api/admin/directory/v1/admin-gen.go b/Godeps/_workspace/src/google.golang.org/api/admin/directory/v1/admin-gen.go new file mode 100644 index 000000000..fb70345b4 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/admin/directory/v1/admin-gen.go @@ -0,0 +1,14810 @@ +// Package admin provides access to the Admin Directory API. +// +// See https://developers.google.com/admin-sdk/directory/ +// +// Usage example: +// +// import "google.golang.org/api/admin/directory/v1" +// ... +// adminService, err := admin.New(oauthHttpClient) +package admin // import "google.golang.org/api/admin/directory/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 customer related information + AdminDirectoryCustomerScope = "https://www.googleapis.com/auth/admin.directory.customer" + + // View customer related information + AdminDirectoryCustomerReadonlyScope = "https://www.googleapis.com/auth/admin.directory.customer.readonly" + + // 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 domains for your customers + AdminDirectoryDomainScope = "https://www.googleapis.com/auth/admin.directory.domain" + + // View domains related to your customers + AdminDirectoryDomainReadonlyScope = "https://www.googleapis.com/auth/admin.directory.domain.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" + + // Manage delegated admin roles for your domain + AdminDirectoryRolemanagementScope = "https://www.googleapis.com/auth/admin.directory.rolemanagement" + + // View delegated admin roles for your domain + AdminDirectoryRolemanagementReadonlyScope = "https://www.googleapis.com/auth/admin.directory.rolemanagement.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" + + // View and manage the provisioning of user schemas on your domain + AdminDirectoryUserschemaScope = "https://www.googleapis.com/auth/admin.directory.userschema" + + // View user schemas on your domain + AdminDirectoryUserschemaReadonlyScope = "https://www.googleapis.com/auth/admin.directory.userschema.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.Asps = NewAspsService(s) + s.Channels = NewChannelsService(s) + s.Chromeosdevices = NewChromeosdevicesService(s) + s.Customers = NewCustomersService(s) + s.DomainAliases = NewDomainAliasesService(s) + s.Domains = NewDomainsService(s) + s.Groups = NewGroupsService(s) + s.Members = NewMembersService(s) + s.Mobiledevices = NewMobiledevicesService(s) + s.Notifications = NewNotificationsService(s) + s.Orgunits = NewOrgunitsService(s) + s.Privileges = NewPrivilegesService(s) + s.RoleAssignments = NewRoleAssignmentsService(s) + s.Roles = NewRolesService(s) + s.Schemas = NewSchemasService(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 + UserAgent string // optional additional User-Agent fragment + + Asps *AspsService + + Channels *ChannelsService + + Chromeosdevices *ChromeosdevicesService + + Customers *CustomersService + + DomainAliases *DomainAliasesService + + Domains *DomainsService + + Groups *GroupsService + + Members *MembersService + + Mobiledevices *MobiledevicesService + + Notifications *NotificationsService + + Orgunits *OrgunitsService + + Privileges *PrivilegesService + + RoleAssignments *RoleAssignmentsService + + Roles *RolesService + + Schemas *SchemasService + + Tokens *TokensService + + Users *UsersService + + VerificationCodes *VerificationCodesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 NewCustomersService(s *Service) *CustomersService { + rs := &CustomersService{s: s} + return rs +} + +type CustomersService struct { + s *Service +} + +func NewDomainAliasesService(s *Service) *DomainAliasesService { + rs := &DomainAliasesService{s: s} + return rs +} + +type DomainAliasesService struct { + s *Service +} + +func NewDomainsService(s *Service) *DomainsService { + rs := &DomainsService{s: s} + return rs +} + +type DomainsService 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 NewPrivilegesService(s *Service) *PrivilegesService { + rs := &PrivilegesService{s: s} + return rs +} + +type PrivilegesService struct { + s *Service +} + +func NewRoleAssignmentsService(s *Service) *RoleAssignmentsService { + rs := &RoleAssignmentsService{s: s} + return rs +} + +type RoleAssignmentsService struct { + s *Service +} + +func NewRolesService(s *Service) *RolesService { + rs := &RolesService{s: s} + return rs +} + +type RolesService struct { + s *Service +} + +func NewSchemasService(s *Service) *SchemasService { + rs := &SchemasService{s: s} + return rs +} + +type SchemasService 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 +} + +// Alias: JSON template for Alias object in Directory API. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Alias") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Alias) MarshalJSON() ([]byte, error) { + type noMethod Alias + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Aliases: JSON response template to list aliases in Directory API. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Aliases") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Aliases) MarshalJSON() ([]byte, error) { + type noMethod Aliases + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Asp: The template that returns individual ASP (Access Code) data. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CodeId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Asp) MarshalJSON() ([]byte, error) { + type noMethod Asp + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Asps) MarshalJSON() ([]byte, error) { + type noMethod Asps + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Channel: An notification channel used to watch for resource changes. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Address") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Channel) MarshalJSON() ([]byte, error) { + type noMethod Channel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChromeOsDevice: JSON template for Chrome Os Device resource in +// Directory API. +type ChromeOsDevice struct { + // ActiveTimeRanges: List of active time ranges (Read-only) + ActiveTimeRanges []*ChromeOsDeviceActiveTimeRanges `json:"activeTimeRanges,omitempty"` + + // AnnotatedAssetId: AssetId specified during enrollment or through + // later annotation + AnnotatedAssetId string `json:"annotatedAssetId,omitempty"` + + // 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"` + + // EthernetMacAddress: Chromebook Mac Address on ethernet network + // interface (Read-only) + EthernetMacAddress string `json:"ethernetMacAddress,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 on wifi network interface + // (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"` + + // RecentUsers: List of recent device users, in descending order by last + // login time (Read-only) + RecentUsers []*ChromeOsDeviceRecentUsers `json:"recentUsers,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 renew after support end date + // (Read-only) + WillAutoRenew bool `json:"willAutoRenew,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ActiveTimeRanges") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChromeOsDevice) MarshalJSON() ([]byte, error) { + type noMethod ChromeOsDevice + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ChromeOsDeviceActiveTimeRanges struct { + // ActiveTime: Duration in milliseconds + ActiveTime int64 `json:"activeTime,omitempty"` + + // Date: Date of usage + Date string `json:"date,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ActiveTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChromeOsDeviceActiveTimeRanges) MarshalJSON() ([]byte, error) { + type noMethod ChromeOsDeviceActiveTimeRanges + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ChromeOsDeviceRecentUsers struct { + // Email: Email address of the user. Present only if the user type is + // managed + Email string `json:"email,omitempty"` + + // Type: The type of the user + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Email") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChromeOsDeviceRecentUsers) MarshalJSON() ([]byte, error) { + type noMethod ChromeOsDeviceRecentUsers + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChromeOsDevices: JSON response template for List Chrome OS Devices +// operation in Directory API. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Chromeosdevices") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChromeOsDevices) MarshalJSON() ([]byte, error) { + type noMethod ChromeOsDevices + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Customer: JSON template for Customer Resource object in Directory +// API. +type Customer struct { + // AlternateEmail: The customer's secondary contact email address. This + // email address cannot be on the same domain as the customerDomain + AlternateEmail string `json:"alternateEmail,omitempty"` + + // CustomerCreationTime: The customer's creation time (Readonly) + CustomerCreationTime string `json:"customerCreationTime,omitempty"` + + // CustomerDomain: The customer's primary domain name string. Do not + // include the www prefix when creating a new customer. + CustomerDomain string `json:"customerDomain,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Id: The unique ID for the customer's Google account. (Readonly) + Id string `json:"id,omitempty"` + + // Kind: Identifies the resource as a customer. Value: + // admin#directory#customer + Kind string `json:"kind,omitempty"` + + // Language: The customer's ISO 639-2 language code. The default value + // is en-US + Language string `json:"language,omitempty"` + + // PhoneNumber: The customer's contact phone number in E.164 format. + PhoneNumber string `json:"phoneNumber,omitempty"` + + // PostalAddress: The customer's postal address information. + PostalAddress *CustomerPostalAddress `json:"postalAddress,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AlternateEmail") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Customer) MarshalJSON() ([]byte, error) { + type noMethod Customer + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomerPostalAddress: JSON template for postal address of a +// customer. +type CustomerPostalAddress struct { + // AddressLine1: A customer's physical address. The address can be + // composed of one to three lines. + 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: The customer contact's name. + ContactName string `json:"contactName,omitempty"` + + // CountryCode: This is a required property. For countryCode information + // see the ISO 3166 country code elements. + CountryCode string `json:"countryCode,omitempty"` + + // Locality: Name of the locality. An example of a locality value is the + // city of San Francisco. + Locality string `json:"locality,omitempty"` + + // OrganizationName: The company or company division name. + OrganizationName string `json:"organizationName,omitempty"` + + // PostalCode: The postal code. A postalCode example is a postal zip + // code such as 10009. This is in accordance with - + // http://portablecontacts.net/draft-spec.html#address_element. + PostalCode string `json:"postalCode,omitempty"` + + // Region: Name of the region. An example of a region value is NY for + // the state of New York. + Region string `json:"region,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AddressLine1") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomerPostalAddress) MarshalJSON() ([]byte, error) { + type noMethod CustomerPostalAddress + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DomainAlias: JSON template for Domain Alias object in Directory API. +type DomainAlias struct { + // CreationTime: The creation time of the domain alias. (Read-only). + CreationTime int64 `json:"creationTime,omitempty,string"` + + // DomainAliasName: The domain alias name. + DomainAliasName string `json:"domainAliasName,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Kind: Kind of resource this is. + Kind string `json:"kind,omitempty"` + + // ParentDomainName: The parent domain name that the domain alias is + // associated with. This can either be a primary or secondary domain + // name within a customer. + ParentDomainName string `json:"parentDomainName,omitempty"` + + // Verified: Indicates the verification state of a domain alias. + // (Read-only) + Verified bool `json:"verified,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DomainAlias) MarshalJSON() ([]byte, error) { + type noMethod DomainAlias + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DomainAliases: JSON response template to list domain aliases in +// Directory API. +type DomainAliases struct { + // DomainAliases: List of domain alias objects. + DomainAliases []*DomainAlias `json:"domainAliases,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Kind: Kind of resource this is. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DomainAliases") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DomainAliases) MarshalJSON() ([]byte, error) { + type noMethod DomainAliases + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Domains: JSON template for Domain object in Directory API. +type Domains struct { + // CreationTime: Creation time of the domain. (Read-only). + CreationTime int64 `json:"creationTime,omitempty,string"` + + // DomainAliases: List of domain alias objects. (Read-only) + DomainAliases []*DomainAlias `json:"domainAliases,omitempty"` + + // DomainName: The domain name of the customer. + DomainName string `json:"domainName,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // IsPrimary: Indicates if the domain is a primary domain (Read-only). + IsPrimary bool `json:"isPrimary,omitempty"` + + // Kind: Kind of resource this is. + Kind string `json:"kind,omitempty"` + + // Verified: Indicates the verification state of a domain. (Read-only). + Verified bool `json:"verified,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Domains) MarshalJSON() ([]byte, error) { + type noMethod Domains + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Domains2: JSON response template to list Domains in Directory API. +type Domains2 struct { + // Domains: List of domain objects. + Domains []*Domains `json:"domains,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Kind: Kind of resource this is. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Domains") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Domains2) MarshalJSON() ([]byte, error) { + type noMethod Domains2 + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Group: JSON template for Group resource in Directory API. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AdminCreated") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Group) MarshalJSON() ([]byte, error) { + type noMethod Group + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Groups: JSON response template for List Groups operation in Directory +// API. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Groups) MarshalJSON() ([]byte, error) { + type noMethod Groups + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Member: JSON template for Member resource in Directory API. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Email") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Member) MarshalJSON() ([]byte, error) { + type noMethod Member + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Members: JSON response template for List Members operation in +// Directory API. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Members) MarshalJSON() ([]byte, error) { + type noMethod Members + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MobileDevice: JSON template for Mobile Device resource in Directory +// API. +type MobileDevice struct { + // AdbStatus: Adb (USB debugging) enabled or disabled on device + // (Read-only) + AdbStatus bool `json:"adbStatus,omitempty"` + + // Applications: List of applications installed on Mobile Device + Applications []*MobileDeviceApplications `json:"applications,omitempty"` + + // BasebandVersion: Mobile Device Baseband version (Read-only) + BasebandVersion string `json:"basebandVersion,omitempty"` + + // BuildNumber: Mobile Device Build number (Read-only) + BuildNumber string `json:"buildNumber,omitempty"` + + // DefaultLanguage: The default locale used on the Mobile Device + // (Read-only) + DefaultLanguage string `json:"defaultLanguage,omitempty"` + + // DeveloperOptionsStatus: Developer options enabled or disabled on + // device (Read-only) + DeveloperOptionsStatus bool `json:"developerOptionsStatus,omitempty"` + + // DeviceCompromisedStatus: Mobile Device compromised status (Read-only) + DeviceCompromisedStatus string `json:"deviceCompromisedStatus,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"` + + // Imei: Mobile Device IMEI number (Read-only) + Imei string `json:"imei,omitempty"` + + // KernelVersion: Mobile Device Kernel version (Read-only) + KernelVersion string `json:"kernelVersion,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"` + + // ManagedAccountIsOnOwnerProfile: Boolean indicating if this account is + // on owner/primary profile or not (Read-only) + ManagedAccountIsOnOwnerProfile bool `json:"managedAccountIsOnOwnerProfile,omitempty"` + + // Meid: Mobile Device MEID number (Read-only) + Meid string `json:"meid,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"` + + // NetworkOperator: Mobile Device mobile or network operator (if + // available) (Read-only) + NetworkOperator string `json:"networkOperator,omitempty"` + + // Os: Name of the mobile operating system + Os string `json:"os,omitempty"` + + // OtherAccountsInfo: List of accounts added on device (Read-only) + OtherAccountsInfo []string `json:"otherAccountsInfo,omitempty"` + + // ResourceId: Unique identifier of Mobile Device (Read-only) + ResourceId string `json:"resourceId,omitempty"` + + // SerialNumber: Mobile Device SSN or Serial Number (Read-only) + SerialNumber string `json:"serialNumber,omitempty"` + + // Status: Status of the device (Read-only) + Status string `json:"status,omitempty"` + + // SupportsWorkProfile: Work profile supported on device (Read-only) + SupportsWorkProfile bool `json:"supportsWorkProfile,omitempty"` + + // Type: The type of device (Read-only) + Type string `json:"type,omitempty"` + + // UnknownSourcesStatus: Unknown sources enabled or disabled on device + // (Read-only) + UnknownSourcesStatus bool `json:"unknownSourcesStatus,omitempty"` + + // UserAgent: Mobile Device user agent + UserAgent string `json:"userAgent,omitempty"` + + // WifiMacAddress: Mobile Device WiFi MAC address (Read-only) + WifiMacAddress string `json:"wifiMacAddress,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AdbStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MobileDevice) MarshalJSON() ([]byte, error) { + type noMethod MobileDevice + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MobileDeviceApplications) MarshalJSON() ([]byte, error) { + type noMethod MobileDeviceApplications + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MobileDeviceAction: JSON request template for firing commands on +// Mobile Device in Directory Devices API. +type MobileDeviceAction struct { + // Action: Action to be taken on the Mobile Device + Action string `json:"action,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Action") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MobileDeviceAction) MarshalJSON() ([]byte, error) { + type noMethod MobileDeviceAction + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MobileDevices: JSON response template for List Mobile Devices +// operation in Directory API. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MobileDevices) MarshalJSON() ([]byte, error) { + type noMethod MobileDevices + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Notification: Template for a notification resource. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Body") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Notification) MarshalJSON() ([]byte, error) { + type noMethod Notification + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Notifications: Template for notifications list response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Notifications) MarshalJSON() ([]byte, error) { + type noMethod Notifications + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OrgUnit: JSON template for Org Unit resource in Directory API. +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"` + + // OrgUnitId: Id of OrgUnit + OrgUnitId string `json:"orgUnitId,omitempty"` + + // OrgUnitPath: Path of OrgUnit + OrgUnitPath string `json:"orgUnitPath,omitempty"` + + // ParentOrgUnitId: Id of parent OrgUnit + ParentOrgUnitId string `json:"parentOrgUnitId,omitempty"` + + // ParentOrgUnitPath: Path of parent OrgUnit + ParentOrgUnitPath string `json:"parentOrgUnitPath,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BlockInheritance") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrgUnit) MarshalJSON() ([]byte, error) { + type noMethod OrgUnit + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OrgUnits: JSON response template for List Organization Units +// operation in Directory API. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrgUnits) MarshalJSON() ([]byte, error) { + type noMethod OrgUnits + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Privilege: JSON template for privilege resource in Directory API. +type Privilege struct { + // ChildPrivileges: A list of child privileges. Privileges for a service + // form a tree. Each privilege can have a list of child privileges; this + // list is empty for a leaf privilege. + ChildPrivileges []*Privilege `json:"childPrivileges,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // IsOuScopable: If the privilege can be restricted to an organization + // unit. + IsOuScopable bool `json:"isOuScopable,omitempty"` + + // Kind: The type of the API resource. This is always + // admin#directory#privilege. + Kind string `json:"kind,omitempty"` + + // PrivilegeName: The name of the privilege. + PrivilegeName string `json:"privilegeName,omitempty"` + + // ServiceId: The obfuscated ID of the service this privilege is for. + ServiceId string `json:"serviceId,omitempty"` + + // ServiceName: The name of the service this privilege is for. + ServiceName string `json:"serviceName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ChildPrivileges") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Privilege) MarshalJSON() ([]byte, error) { + type noMethod Privilege + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Privileges: JSON response template for List privileges operation in +// Directory API. +type Privileges struct { + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Items: A list of Privilege resources. + Items []*Privilege `json:"items,omitempty"` + + // Kind: The type of the API resource. This is always + // admin#directory#privileges. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Privileges) MarshalJSON() ([]byte, error) { + type noMethod Privileges + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Role: JSON template for role resource in Directory API. +type Role struct { + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // IsSuperAdminRole: Returns true if the role is a super admin role. + IsSuperAdminRole bool `json:"isSuperAdminRole,omitempty"` + + // IsSystemRole: Returns true if this is a pre-defined system role. + IsSystemRole bool `json:"isSystemRole,omitempty"` + + // Kind: The type of the API resource. This is always + // admin#directory#role. + Kind string `json:"kind,omitempty"` + + // RoleDescription: A short description of the role. + RoleDescription string `json:"roleDescription,omitempty"` + + // RoleId: ID of the role. + RoleId int64 `json:"roleId,omitempty,string"` + + // RoleName: Name of the role. + RoleName string `json:"roleName,omitempty"` + + // RolePrivileges: The set of privileges that are granted to this role. + RolePrivileges []*RoleRolePrivileges `json:"rolePrivileges,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Role) MarshalJSON() ([]byte, error) { + type noMethod Role + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type RoleRolePrivileges struct { + // PrivilegeName: The name of the privilege. + PrivilegeName string `json:"privilegeName,omitempty"` + + // ServiceId: The obfuscated ID of the service this privilege is for. + ServiceId string `json:"serviceId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "PrivilegeName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RoleRolePrivileges) MarshalJSON() ([]byte, error) { + type noMethod RoleRolePrivileges + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RoleAssignment: JSON template for roleAssignment resource in +// Directory API. +type RoleAssignment struct { + // AssignedTo: The unique ID of the user this role is assigned to. + AssignedTo string `json:"assignedTo,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Kind: The type of the API resource. This is always + // admin#directory#roleAssignment. + Kind string `json:"kind,omitempty"` + + // OrgUnitId: If the role is restricted to an organization unit, this + // contains the ID for the organization unit the exercise of this role + // is restricted to. + OrgUnitId string `json:"orgUnitId,omitempty"` + + // RoleAssignmentId: ID of this roleAssignment. + RoleAssignmentId int64 `json:"roleAssignmentId,omitempty,string"` + + // RoleId: The ID of the role that is assigned. + RoleId int64 `json:"roleId,omitempty,string"` + + // ScopeType: The scope in which this role is assigned. Possible values + // are: + // - CUSTOMER + // - ORG_UNIT + ScopeType string `json:"scopeType,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AssignedTo") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RoleAssignment) MarshalJSON() ([]byte, error) { + type noMethod RoleAssignment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RoleAssignments: JSON response template for List roleAssignments +// operation in Directory API. +type RoleAssignments struct { + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Items: A list of RoleAssignment resources. + Items []*RoleAssignment `json:"items,omitempty"` + + // Kind: The type of the API resource. This is always + // admin#directory#roleAssignments. + Kind string `json:"kind,omitempty"` + + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RoleAssignments) MarshalJSON() ([]byte, error) { + type noMethod RoleAssignments + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Roles: JSON response template for List roles operation in Directory +// API. +type Roles struct { + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Items: A list of Role resources. + Items []*Role `json:"items,omitempty"` + + // Kind: The type of the API resource. This is always + // admin#directory#roles. + Kind string `json:"kind,omitempty"` + + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Roles) MarshalJSON() ([]byte, error) { + type noMethod Roles + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Schema: JSON template for Schema resource in Directory API. +type Schema struct { + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Fields: Fields of Schema + Fields []*SchemaFieldSpec `json:"fields,omitempty"` + + // Kind: Kind of resource this is. + Kind string `json:"kind,omitempty"` + + // SchemaId: Unique identifier of Schema (Read-only) + SchemaId string `json:"schemaId,omitempty"` + + // SchemaName: Schema name + SchemaName string `json:"schemaName,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Schema) MarshalJSON() ([]byte, error) { + type noMethod Schema + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SchemaFieldSpec: JSON template for FieldSpec resource for Schemas in +// Directory API. +type SchemaFieldSpec struct { + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // FieldId: Unique identifier of Field (Read-only) + FieldId string `json:"fieldId,omitempty"` + + // FieldName: Name of the field. + FieldName string `json:"fieldName,omitempty"` + + // FieldType: Type of the field. + FieldType string `json:"fieldType,omitempty"` + + // Indexed: Boolean specifying whether the field is indexed or not. + // + // Default: true + Indexed *bool `json:"indexed,omitempty"` + + // Kind: Kind of resource this is. + Kind string `json:"kind,omitempty"` + + // MultiValued: Boolean specifying whether this is a multi-valued field + // or not. + MultiValued bool `json:"multiValued,omitempty"` + + // NumericIndexingSpec: Indexing spec for a numeric field. By default, + // only exact match queries will be supported for numeric fields. + // Setting the numericIndexingSpec allows range queries to be supported. + NumericIndexingSpec *SchemaFieldSpecNumericIndexingSpec `json:"numericIndexingSpec,omitempty"` + + // ReadAccessType: Read ACLs on the field specifying who can view values + // of this field. Valid values are "ALL_DOMAIN_USERS" and + // "ADMINS_AND_SELF". + ReadAccessType string `json:"readAccessType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SchemaFieldSpec) MarshalJSON() ([]byte, error) { + type noMethod SchemaFieldSpec + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SchemaFieldSpecNumericIndexingSpec: Indexing spec for a numeric +// field. By default, only exact match queries will be supported for +// numeric fields. Setting the numericIndexingSpec allows range queries +// to be supported. +type SchemaFieldSpecNumericIndexingSpec struct { + // MaxValue: Maximum value of this field. This is meant to be indicative + // rather than enforced. Values outside this range will still be + // indexed, but search may not be as performant. + MaxValue float64 `json:"maxValue,omitempty"` + + // MinValue: Minimum value of this field. This is meant to be indicative + // rather than enforced. Values outside this range will still be + // indexed, but search may not be as performant. + MinValue float64 `json:"minValue,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MaxValue") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SchemaFieldSpecNumericIndexingSpec) MarshalJSON() ([]byte, error) { + type noMethod SchemaFieldSpecNumericIndexingSpec + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Schemas: JSON response template for List Schema operation in +// Directory API. +type Schemas struct { + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + // Kind: Kind of resource this is. + Kind string `json:"kind,omitempty"` + + // Schemas: List of UserSchema objects. + Schemas []*Schema `json:"schemas,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Schemas) MarshalJSON() ([]byte, error) { + type noMethod Schemas + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Token: JSON template for token resource in Directory API. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Anonymous") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Token) MarshalJSON() ([]byte, error) { + type noMethod Token + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Tokens: JSON response template for List tokens operation in Directory +// API. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Tokens) MarshalJSON() ([]byte, error) { + type noMethod Tokens + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// User: JSON template for User object in Directory API. +type User struct { + Addresses interface{} `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"` + + // CustomSchemas: Custom fields of the user. + CustomSchemas map[string]UserCustomProperties `json:"customSchemas,omitempty"` + + // CustomerId: CustomerId of User (Read-only) + CustomerId string `json:"customerId,omitempty"` + + DeletionTime string `json:"deletionTime,omitempty"` + + Emails interface{} `json:"emails,omitempty"` + + // Etag: ETag of the resource. + Etag string `json:"etag,omitempty"` + + ExternalIds interface{} `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 interface{} `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"` + + Notes interface{} `json:"notes,omitempty"` + + // OrgUnitPath: OrgUnit of User + OrgUnitPath string `json:"orgUnitPath,omitempty"` + + Organizations interface{} `json:"organizations,omitempty"` + + // Password: User's password + Password string `json:"password,omitempty"` + + Phones interface{} `json:"phones,omitempty"` + + // PrimaryEmail: username of User + PrimaryEmail string `json:"primaryEmail,omitempty"` + + Relations interface{} `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"` + + // ThumbnailPhotoEtag: ETag of the user's photo (Read-only) + ThumbnailPhotoEtag string `json:"thumbnailPhotoEtag,omitempty"` + + // ThumbnailPhotoUrl: Photo Url of the user (Read-only) + ThumbnailPhotoUrl string `json:"thumbnailPhotoUrl,omitempty"` + + Websites interface{} `json:"websites,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Addresses") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *User) MarshalJSON() ([]byte, error) { + type noMethod User + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserAbout: JSON template for About (notes) of a user in Directory +// API. +type UserAbout struct { + // ContentType: About entry can have a type which indicates the content + // type. It can either be plain or html. By default, notes contents are + // assumed to contain plain text. + ContentType string `json:"contentType,omitempty"` + + // Value: Actual value of notes. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ContentType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserAbout) MarshalJSON() ([]byte, error) { + type noMethod UserAbout + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserAddress: JSON template for address. +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. + 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"` + + // ForceSendFields is a list of field names (e.g. "Country") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserAddress) MarshalJSON() ([]byte, error) { + type noMethod UserAddress + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type UserCustomProperties interface{} + +// UserEmail: JSON template for an email. +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 types should have the CUSTOM value as type and also + // have a customType value. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Address") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserEmail) MarshalJSON() ([]byte, error) { + type noMethod UserEmail + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserExternalId: JSON template for an externalId entry. +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"` + + // ForceSendFields is a list of field names (e.g. "CustomType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserExternalId) MarshalJSON() ([]byte, error) { + type noMethod UserExternalId + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserIm: JSON template for instant messenger of an user. +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 primary 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. Similar 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"` + + // ForceSendFields is a list of field names (e.g. "CustomProtocol") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserIm) MarshalJSON() ([]byte, error) { + type noMethod UserIm + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserMakeAdmin: JSON request template for setting/revoking admin +// status of a user in Directory API. +type UserMakeAdmin struct { + // Status: Boolean indicating new admin status of the user + Status bool `json:"status,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Status") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserMakeAdmin) MarshalJSON() ([]byte, error) { + type noMethod UserMakeAdmin + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserName: JSON template for name of a user in Directory API. +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"` + + // ForceSendFields is a list of field names (e.g. "FamilyName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserName) MarshalJSON() ([]byte, error) { + type noMethod UserName + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserOrganization: JSON template for an organization entry. +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: Symbol 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"` + + // ForceSendFields is a list of field names (e.g. "CostCenter") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserOrganization) MarshalJSON() ([]byte, error) { + type noMethod UserOrganization + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserPhone: JSON template for a phone entry. +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"` + + // ForceSendFields is a list of field names (e.g. "CustomType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserPhone) MarshalJSON() ([]byte, error) { + type noMethod UserPhone + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserPhoto: JSON template for Photo object in Directory API. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserPhoto) MarshalJSON() ([]byte, error) { + type noMethod UserPhoto + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserRelation: JSON template for a relation entry. +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"` + + // ForceSendFields is a list of field names (e.g. "CustomType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserRelation) MarshalJSON() ([]byte, error) { + type noMethod UserRelation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserUndelete: JSON request template to undelete a user in Directory +// API. +type UserUndelete struct { + // OrgUnitPath: OrgUnit of User + OrgUnitPath string `json:"orgUnitPath,omitempty"` + + // ForceSendFields is a list of field names (e.g. "OrgUnitPath") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserUndelete) MarshalJSON() ([]byte, error) { + type noMethod UserUndelete + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserWebsite: JSON template for a website entry. +type UserWebsite struct { + // CustomType: Custom Type. + CustomType string `json:"customType,omitempty"` + + // Primary: If this is user's primary website or not. + Primary bool `json:"primary,omitempty"` + + // Type: Each entry can have a type which indicates standard types of + // that entry. For example website could be of home, work, blog 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: Website. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CustomType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserWebsite) MarshalJSON() ([]byte, error) { + type noMethod UserWebsite + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Users: JSON response template for List Users operation in Apps +// Directory API. +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"` + + // TriggerEvent: Event that triggered this response (only used in case + // of Push Response) + TriggerEvent string `json:"trigger_event,omitempty"` + + // Users: List of user objects. + Users []*User `json:"users,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Users) MarshalJSON() ([]byte, error) { + type noMethod Users + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VerificationCode: JSON template for verification codes in Directory +// API. +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"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VerificationCode) MarshalJSON() ([]byte, error) { + type noMethod VerificationCode + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VerificationCodes: JSON response template for List verification codes +// operation in Directory API. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VerificationCodes) MarshalJSON() ([]byte, error) { + type noMethod VerificationCodes + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "directory.asps.delete": + +type AspsDeleteCall struct { + s *Service + userKey string + codeId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AspsDeleteCall) Fields(s ...googleapi.Field) *AspsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AspsDeleteCall) Context(ctx context.Context) *AspsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AspsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/asps/{codeId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + "codeId": strconv.FormatInt(c.codeId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.asps.delete" call. +func (c *AspsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AspsGetCall) Fields(s ...googleapi.Field) *AspsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AspsGetCall) IfNoneMatch(entityTag string) *AspsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AspsGetCall) Context(ctx context.Context) *AspsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AspsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/asps/{codeId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + "codeId": strconv.FormatInt(c.codeId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.asps.get" call. +// Exactly one of *Asp or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Asp.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AspsGetCall) Do() (*Asp, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Asp{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AspsListCall) Fields(s ...googleapi.Field) *AspsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AspsListCall) IfNoneMatch(entityTag string) *AspsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AspsListCall) Context(ctx context.Context) *AspsListCall { + c.ctx_ = ctx + return c +} + +func (c *AspsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/asps") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.asps.list" call. +// Exactly one of *Asps or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Asps.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AspsListCall) Do() (*Asps, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Asps{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall { + c.ctx_ = ctx + return c +} + +func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "admin.channels.stop" call. +func (c *ChannelsStopCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "BASIC" - Includes only the basic metadata fields (e.g., deviceId, +// serialNumber, status, and user) +// "FULL" - Includes all metadata fields +func (c *ChromeosdevicesGetCall) Projection(projection string) *ChromeosdevicesGetCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChromeosdevicesGetCall) Fields(s ...googleapi.Field) *ChromeosdevicesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ChromeosdevicesGetCall) IfNoneMatch(entityTag string) *ChromeosdevicesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChromeosdevicesGetCall) Context(ctx context.Context) *ChromeosdevicesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ChromeosdevicesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/devices/chromeos/{deviceId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "deviceId": c.deviceId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.chromeosdevices.get" call. +// Exactly one of *ChromeOsDevice or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ChromeOsDevice.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ChromeosdevicesGetCall) Do() (*ChromeOsDevice, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ChromeOsDevice{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +// +// Possible values: +// "annotatedLocation" - Chromebook location as annotated by the +// administrator. +// "annotatedUser" - Chromebook user as annotated by administrator. +// "lastSync" - Chromebook last sync. +// "notes" - Chromebook notes as annotated by the administrator. +// "serialNumber" - Chromebook Serial Number. +// "status" - Chromebook status. +// "supportEndDate" - Chromebook support end date. +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. +// +// Possible values: +// "BASIC" - Includes only the basic metadata fields (e.g., deviceId, +// serialNumber, status, and user) +// "FULL" - Includes all metadata 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=1698333 +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 +// +// Possible values: +// "ASCENDING" - Ascending order. +// "DESCENDING" - Descending order. +func (c *ChromeosdevicesListCall) SortOrder(sortOrder string) *ChromeosdevicesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChromeosdevicesListCall) Fields(s ...googleapi.Field) *ChromeosdevicesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ChromeosdevicesListCall) IfNoneMatch(entityTag string) *ChromeosdevicesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChromeosdevicesListCall) Context(ctx context.Context) *ChromeosdevicesListCall { + c.ctx_ = ctx + return c +} + +func (c *ChromeosdevicesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/devices/chromeos") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.chromeosdevices.list" call. +// Exactly one of *ChromeOsDevices or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ChromeOsDevices.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ChromeosdevicesListCall) Do() (*ChromeOsDevices, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ChromeOsDevices{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "BASIC" - Includes only the basic metadata fields (e.g., deviceId, +// serialNumber, status, and user) +// "FULL" - Includes all metadata fields +func (c *ChromeosdevicesPatchCall) Projection(projection string) *ChromeosdevicesPatchCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChromeosdevicesPatchCall) Fields(s ...googleapi.Field) *ChromeosdevicesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChromeosdevicesPatchCall) Context(ctx context.Context) *ChromeosdevicesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ChromeosdevicesPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/devices/chromeos/{deviceId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "deviceId": c.deviceId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.chromeosdevices.patch" call. +// Exactly one of *ChromeOsDevice or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ChromeOsDevice.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ChromeosdevicesPatchCall) Do() (*ChromeOsDevice, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ChromeOsDevice{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "BASIC" - Includes only the basic metadata fields (e.g., deviceId, +// serialNumber, status, and user) +// "FULL" - Includes all metadata fields +func (c *ChromeosdevicesUpdateCall) Projection(projection string) *ChromeosdevicesUpdateCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChromeosdevicesUpdateCall) Fields(s ...googleapi.Field) *ChromeosdevicesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChromeosdevicesUpdateCall) Context(ctx context.Context) *ChromeosdevicesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ChromeosdevicesUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/devices/chromeos/{deviceId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "deviceId": c.deviceId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.chromeosdevices.update" call. +// Exactly one of *ChromeOsDevice or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ChromeOsDevice.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ChromeosdevicesUpdateCall) Do() (*ChromeOsDevice, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ChromeOsDevice{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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.customers.get": + +type CustomersGetCall struct { + s *Service + customerKey string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrives a customer. +func (r *CustomersService) Get(customerKey string) *CustomersGetCall { + c := &CustomersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.customerKey = customerKey + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomersGetCall) Fields(s ...googleapi.Field) *CustomersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CustomersGetCall) IfNoneMatch(entityTag string) *CustomersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomersGetCall) Context(ctx context.Context) *CustomersGetCall { + c.ctx_ = ctx + return c +} + +func (c *CustomersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerKey": c.customerKey, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.customers.get" call. +// Exactly one of *Customer or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Customer.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CustomersGetCall) Do() (*Customer, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Customer{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrives a customer.", + // "httpMethod": "GET", + // "id": "directory.customers.get", + // "parameterOrder": [ + // "customerKey" + // ], + // "parameters": { + // "customerKey": { + // "description": "Id of the customer to be retrieved", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customers/{customerKey}", + // "response": { + // "$ref": "Customer" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.customer", + // "https://www.googleapis.com/auth/admin.directory.customer.readonly" + // ] + // } + +} + +// method id "directory.customers.patch": + +type CustomersPatchCall struct { + s *Service + customerKey string + customer *Customer + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates a customer. This method supports patch semantics. +func (r *CustomersService) Patch(customerKey string, customer *Customer) *CustomersPatchCall { + c := &CustomersPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.customerKey = customerKey + c.customer = customer + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomersPatchCall) Fields(s ...googleapi.Field) *CustomersPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomersPatchCall) Context(ctx context.Context) *CustomersPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CustomersPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerKey": c.customerKey, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.customers.patch" call. +// Exactly one of *Customer or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Customer.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CustomersPatchCall) Do() (*Customer, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Customer{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a customer. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "directory.customers.patch", + // "parameterOrder": [ + // "customerKey" + // ], + // "parameters": { + // "customerKey": { + // "description": "Id of the customer to be updated", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customers/{customerKey}", + // "request": { + // "$ref": "Customer" + // }, + // "response": { + // "$ref": "Customer" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.customer" + // ] + // } + +} + +// method id "directory.customers.update": + +type CustomersUpdateCall struct { + s *Service + customerKey string + customer *Customer + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a customer. +func (r *CustomersService) Update(customerKey string, customer *Customer) *CustomersUpdateCall { + c := &CustomersUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.customerKey = customerKey + c.customer = customer + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomersUpdateCall) Fields(s ...googleapi.Field) *CustomersUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomersUpdateCall) Context(ctx context.Context) *CustomersUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CustomersUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerKey": c.customerKey, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.customers.update" call. +// Exactly one of *Customer or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Customer.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CustomersUpdateCall) Do() (*Customer, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Customer{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a customer.", + // "httpMethod": "PUT", + // "id": "directory.customers.update", + // "parameterOrder": [ + // "customerKey" + // ], + // "parameters": { + // "customerKey": { + // "description": "Id of the customer to be updated", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customers/{customerKey}", + // "request": { + // "$ref": "Customer" + // }, + // "response": { + // "$ref": "Customer" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.customer" + // ] + // } + +} + +// method id "directory.domainAliases.delete": + +type DomainAliasesDeleteCall struct { + s *Service + customer string + domainAliasName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a Domain Alias of the customer. +func (r *DomainAliasesService) Delete(customer string, domainAliasName string) *DomainAliasesDeleteCall { + c := &DomainAliasesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.customer = customer + c.domainAliasName = domainAliasName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DomainAliasesDeleteCall) Fields(s ...googleapi.Field) *DomainAliasesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DomainAliasesDeleteCall) Context(ctx context.Context) *DomainAliasesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *DomainAliasesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/domainaliases/{domainAliasName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customer": c.customer, + "domainAliasName": c.domainAliasName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.domainAliases.delete" call. +func (c *DomainAliasesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a Domain Alias of the customer.", + // "httpMethod": "DELETE", + // "id": "directory.domainAliases.delete", + // "parameterOrder": [ + // "customer", + // "domainAliasName" + // ], + // "parameters": { + // "customer": { + // "description": "Immutable id of the Google Apps account.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "domainAliasName": { + // "description": "Name of domain alias to be retrieved.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customer}/domainaliases/{domainAliasName}", + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.domain" + // ] + // } + +} + +// method id "directory.domainAliases.get": + +type DomainAliasesGetCall struct { + s *Service + customer string + domainAliasName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves a domain alias of the customer. +func (r *DomainAliasesService) Get(customer string, domainAliasName string) *DomainAliasesGetCall { + c := &DomainAliasesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.customer = customer + c.domainAliasName = domainAliasName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DomainAliasesGetCall) Fields(s ...googleapi.Field) *DomainAliasesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DomainAliasesGetCall) IfNoneMatch(entityTag string) *DomainAliasesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DomainAliasesGetCall) Context(ctx context.Context) *DomainAliasesGetCall { + c.ctx_ = ctx + return c +} + +func (c *DomainAliasesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/domainaliases/{domainAliasName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customer": c.customer, + "domainAliasName": c.domainAliasName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.domainAliases.get" call. +// Exactly one of *DomainAlias or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DomainAlias.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DomainAliasesGetCall) Do() (*DomainAlias, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DomainAlias{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a domain alias of the customer.", + // "httpMethod": "GET", + // "id": "directory.domainAliases.get", + // "parameterOrder": [ + // "customer", + // "domainAliasName" + // ], + // "parameters": { + // "customer": { + // "description": "Immutable id of the Google Apps account.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "domainAliasName": { + // "description": "Name of domain alias to be retrieved.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customer}/domainaliases/{domainAliasName}", + // "response": { + // "$ref": "DomainAlias" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.domain", + // "https://www.googleapis.com/auth/admin.directory.domain.readonly" + // ] + // } + +} + +// method id "directory.domainAliases.insert": + +type DomainAliasesInsertCall struct { + s *Service + customer string + domainalias *DomainAlias + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a Domain alias of the customer. +func (r *DomainAliasesService) Insert(customer string, domainalias *DomainAlias) *DomainAliasesInsertCall { + c := &DomainAliasesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.customer = customer + c.domainalias = domainalias + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DomainAliasesInsertCall) Fields(s ...googleapi.Field) *DomainAliasesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DomainAliasesInsertCall) Context(ctx context.Context) *DomainAliasesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *DomainAliasesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.domainalias) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/domainaliases") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customer": c.customer, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.domainAliases.insert" call. +// Exactly one of *DomainAlias or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DomainAlias.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DomainAliasesInsertCall) Do() (*DomainAlias, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DomainAlias{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a Domain alias of the customer.", + // "httpMethod": "POST", + // "id": "directory.domainAliases.insert", + // "parameterOrder": [ + // "customer" + // ], + // "parameters": { + // "customer": { + // "description": "Immutable id of the Google Apps account.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customer}/domainaliases", + // "request": { + // "$ref": "DomainAlias" + // }, + // "response": { + // "$ref": "DomainAlias" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.domain" + // ] + // } + +} + +// method id "directory.domainAliases.list": + +type DomainAliasesListCall struct { + s *Service + customer string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the domain aliases of the customer. +func (r *DomainAliasesService) List(customer string) *DomainAliasesListCall { + c := &DomainAliasesListCall{s: r.s, opt_: make(map[string]interface{})} + c.customer = customer + return c +} + +// ParentDomainName sets the optional parameter "parentDomainName": Name +// of the parent domain for which domain aliases are to be fetched. +func (c *DomainAliasesListCall) ParentDomainName(parentDomainName string) *DomainAliasesListCall { + c.opt_["parentDomainName"] = parentDomainName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DomainAliasesListCall) Fields(s ...googleapi.Field) *DomainAliasesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DomainAliasesListCall) IfNoneMatch(entityTag string) *DomainAliasesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DomainAliasesListCall) Context(ctx context.Context) *DomainAliasesListCall { + c.ctx_ = ctx + return c +} + +func (c *DomainAliasesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["parentDomainName"]; ok { + params.Set("parentDomainName", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/domainaliases") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customer": c.customer, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.domainAliases.list" call. +// Exactly one of *DomainAliases or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DomainAliases.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DomainAliasesListCall) Do() (*DomainAliases, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DomainAliases{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the domain aliases of the customer.", + // "httpMethod": "GET", + // "id": "directory.domainAliases.list", + // "parameterOrder": [ + // "customer" + // ], + // "parameters": { + // "customer": { + // "description": "Immutable id of the Google Apps account.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "parentDomainName": { + // "description": "Name of the parent domain for which domain aliases are to be fetched.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "customer/{customer}/domainaliases", + // "response": { + // "$ref": "DomainAliases" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.domain", + // "https://www.googleapis.com/auth/admin.directory.domain.readonly" + // ] + // } + +} + +// method id "directory.domains.delete": + +type DomainsDeleteCall struct { + s *Service + customer string + domainName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a domain of the customer. +func (r *DomainsService) Delete(customer string, domainName string) *DomainsDeleteCall { + c := &DomainsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.customer = customer + c.domainName = domainName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DomainsDeleteCall) Fields(s ...googleapi.Field) *DomainsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DomainsDeleteCall) Context(ctx context.Context) *DomainsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *DomainsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/domains/{domainName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customer": c.customer, + "domainName": c.domainName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.domains.delete" call. +func (c *DomainsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a domain of the customer.", + // "httpMethod": "DELETE", + // "id": "directory.domains.delete", + // "parameterOrder": [ + // "customer", + // "domainName" + // ], + // "parameters": { + // "customer": { + // "description": "Immutable id of the Google Apps account.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "domainName": { + // "description": "Name of domain to be deleted", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customer}/domains/{domainName}", + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.domain" + // ] + // } + +} + +// method id "directory.domains.get": + +type DomainsGetCall struct { + s *Service + customer string + domainName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrives a domain of the customer. +func (r *DomainsService) Get(customer string, domainName string) *DomainsGetCall { + c := &DomainsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.customer = customer + c.domainName = domainName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DomainsGetCall) Fields(s ...googleapi.Field) *DomainsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DomainsGetCall) IfNoneMatch(entityTag string) *DomainsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DomainsGetCall) Context(ctx context.Context) *DomainsGetCall { + c.ctx_ = ctx + return c +} + +func (c *DomainsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/domains/{domainName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customer": c.customer, + "domainName": c.domainName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.domains.get" call. +// Exactly one of *Domains or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Domains.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *DomainsGetCall) Do() (*Domains, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Domains{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrives a domain of the customer.", + // "httpMethod": "GET", + // "id": "directory.domains.get", + // "parameterOrder": [ + // "customer", + // "domainName" + // ], + // "parameters": { + // "customer": { + // "description": "Immutable id of the Google Apps account.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "domainName": { + // "description": "Name of domain to be retrieved", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customer}/domains/{domainName}", + // "response": { + // "$ref": "Domains" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.domain", + // "https://www.googleapis.com/auth/admin.directory.domain.readonly" + // ] + // } + +} + +// method id "directory.domains.insert": + +type DomainsInsertCall struct { + s *Service + customer string + domains *Domains + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a domain of the customer. +func (r *DomainsService) Insert(customer string, domains *Domains) *DomainsInsertCall { + c := &DomainsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.customer = customer + c.domains = domains + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DomainsInsertCall) Fields(s ...googleapi.Field) *DomainsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DomainsInsertCall) Context(ctx context.Context) *DomainsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *DomainsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.domains) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/domains") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customer": c.customer, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.domains.insert" call. +// Exactly one of *Domains or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Domains.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *DomainsInsertCall) Do() (*Domains, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Domains{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a domain of the customer.", + // "httpMethod": "POST", + // "id": "directory.domains.insert", + // "parameterOrder": [ + // "customer" + // ], + // "parameters": { + // "customer": { + // "description": "Immutable id of the Google Apps account.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customer}/domains", + // "request": { + // "$ref": "Domains" + // }, + // "response": { + // "$ref": "Domains" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.domain" + // ] + // } + +} + +// method id "directory.domains.list": + +type DomainsListCall struct { + s *Service + customer string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the domains of the customer. +func (r *DomainsService) List(customer string) *DomainsListCall { + c := &DomainsListCall{s: r.s, opt_: make(map[string]interface{})} + c.customer = customer + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DomainsListCall) Fields(s ...googleapi.Field) *DomainsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DomainsListCall) IfNoneMatch(entityTag string) *DomainsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DomainsListCall) Context(ctx context.Context) *DomainsListCall { + c.ctx_ = ctx + return c +} + +func (c *DomainsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/domains") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customer": c.customer, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.domains.list" call. +// Exactly one of *Domains2 or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Domains2.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DomainsListCall) Do() (*Domains2, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Domains2{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the domains of the customer.", + // "httpMethod": "GET", + // "id": "directory.domains.list", + // "parameterOrder": [ + // "customer" + // ], + // "parameters": { + // "customer": { + // "description": "Immutable id of the Google Apps account.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customer}/domains", + // "response": { + // "$ref": "Domains2" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.domain", + // "https://www.googleapis.com/auth/admin.directory.domain.readonly" + // ] + // } + +} + +// method id "directory.groups.delete": + +type GroupsDeleteCall struct { + s *Service + groupKey string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsDeleteCall) Fields(s ...googleapi.Field) *GroupsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsDeleteCall) Context(ctx context.Context) *GroupsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "groups/{groupKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "groupKey": c.groupKey, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.groups.delete" call. +func (c *GroupsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsGetCall) Fields(s ...googleapi.Field) *GroupsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GroupsGetCall) IfNoneMatch(entityTag string) *GroupsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsGetCall) Context(ctx context.Context) *GroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "groups/{groupKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "groupKey": c.groupKey, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.groups.get" call. +// Exactly one of *Group or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Group.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *GroupsGetCall) Do() (*Group, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Group{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsInsertCall) Fields(s ...googleapi.Field) *GroupsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsInsertCall) Context(ctx context.Context) *GroupsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.groups.insert" call. +// Exactly one of *Group or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Group.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *GroupsInsertCall) Do() (*Group, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Group{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsListCall) Fields(s ...googleapi.Field) *GroupsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GroupsListCall) IfNoneMatch(entityTag string) *GroupsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsListCall) Context(ctx context.Context) *GroupsListCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.groups.list" call. +// Exactly one of *Groups or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Groups.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *GroupsListCall) Do() (*Groups, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Groups{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsPatchCall) Fields(s ...googleapi.Field) *GroupsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsPatchCall) Context(ctx context.Context) *GroupsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "groups/{groupKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "groupKey": c.groupKey, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.groups.patch" call. +// Exactly one of *Group or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Group.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *GroupsPatchCall) Do() (*Group, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Group{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsUpdateCall) Fields(s ...googleapi.Field) *GroupsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsUpdateCall) Context(ctx context.Context) *GroupsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "groups/{groupKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "groupKey": c.groupKey, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.groups.update" call. +// Exactly one of *Group or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Group.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *GroupsUpdateCall) Do() (*Group, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Group{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsAliasesDeleteCall) Fields(s ...googleapi.Field) *GroupsAliasesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsAliasesDeleteCall) Context(ctx context.Context) *GroupsAliasesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsAliasesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "groups/{groupKey}/aliases/{alias}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "groupKey": c.groupKey, + "alias": c.alias, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.groups.aliases.delete" call. +func (c *GroupsAliasesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsAliasesInsertCall) Fields(s ...googleapi.Field) *GroupsAliasesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsAliasesInsertCall) Context(ctx context.Context) *GroupsAliasesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsAliasesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "groups/{groupKey}/aliases") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "groupKey": c.groupKey, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.groups.aliases.insert" call. +// Exactly one of *Alias or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Alias.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *GroupsAliasesInsertCall) Do() (*Alias, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Alias{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsAliasesListCall) Fields(s ...googleapi.Field) *GroupsAliasesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GroupsAliasesListCall) IfNoneMatch(entityTag string) *GroupsAliasesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsAliasesListCall) Context(ctx context.Context) *GroupsAliasesListCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsAliasesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "groups/{groupKey}/aliases") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "groupKey": c.groupKey, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.groups.aliases.list" call. +// Exactly one of *Aliases or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Aliases.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *GroupsAliasesListCall) Do() (*Aliases, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Aliases{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MembersDeleteCall) Fields(s ...googleapi.Field) *MembersDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MembersDeleteCall) Context(ctx context.Context) *MembersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *MembersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "groups/{groupKey}/members/{memberKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "groupKey": c.groupKey, + "memberKey": c.memberKey, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.members.delete" call. +func (c *MembersDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MembersGetCall) Fields(s ...googleapi.Field) *MembersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MembersGetCall) IfNoneMatch(entityTag string) *MembersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MembersGetCall) Context(ctx context.Context) *MembersGetCall { + c.ctx_ = ctx + return c +} + +func (c *MembersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "groups/{groupKey}/members/{memberKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "groupKey": c.groupKey, + "memberKey": c.memberKey, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.members.get" call. +// Exactly one of *Member or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Member.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *MembersGetCall) Do() (*Member, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Member{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MembersInsertCall) Fields(s ...googleapi.Field) *MembersInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MembersInsertCall) Context(ctx context.Context) *MembersInsertCall { + c.ctx_ = ctx + return c +} + +func (c *MembersInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "groups/{groupKey}/members") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "groupKey": c.groupKey, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.members.insert" call. +// Exactly one of *Member or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Member.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *MembersInsertCall) Do() (*Member, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Member{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MembersListCall) Fields(s ...googleapi.Field) *MembersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MembersListCall) IfNoneMatch(entityTag string) *MembersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MembersListCall) Context(ctx context.Context) *MembersListCall { + c.ctx_ = ctx + return c +} + +func (c *MembersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "groups/{groupKey}/members") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "groupKey": c.groupKey, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.members.list" call. +// Exactly one of *Members or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Members.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *MembersListCall) Do() (*Members, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Members{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MembersPatchCall) Fields(s ...googleapi.Field) *MembersPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MembersPatchCall) Context(ctx context.Context) *MembersPatchCall { + c.ctx_ = ctx + return c +} + +func (c *MembersPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "groups/{groupKey}/members/{memberKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "groupKey": c.groupKey, + "memberKey": c.memberKey, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.members.patch" call. +// Exactly one of *Member or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Member.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *MembersPatchCall) Do() (*Member, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Member{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MembersUpdateCall) Fields(s ...googleapi.Field) *MembersUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MembersUpdateCall) Context(ctx context.Context) *MembersUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *MembersUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "groups/{groupKey}/members/{memberKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "groupKey": c.groupKey, + "memberKey": c.memberKey, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.members.update" call. +// Exactly one of *Member or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Member.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *MembersUpdateCall) Do() (*Member, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Member{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MobiledevicesActionCall) Fields(s ...googleapi.Field) *MobiledevicesActionCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MobiledevicesActionCall) Context(ctx context.Context) *MobiledevicesActionCall { + c.ctx_ = ctx + return c +} + +func (c *MobiledevicesActionCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.mobiledeviceaction) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/devices/mobile/{resourceId}/action") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "resourceId": c.resourceId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.mobiledevices.action" call. +func (c *MobiledevicesActionCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MobiledevicesDeleteCall) Fields(s ...googleapi.Field) *MobiledevicesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MobiledevicesDeleteCall) Context(ctx context.Context) *MobiledevicesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *MobiledevicesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/devices/mobile/{resourceId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "resourceId": c.resourceId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.mobiledevices.delete" call. +func (c *MobiledevicesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "BASIC" - Includes only the basic metadata fields (e.g., deviceId, +// model, status, type, and status) +// "FULL" - Includes all metadata fields +func (c *MobiledevicesGetCall) Projection(projection string) *MobiledevicesGetCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MobiledevicesGetCall) Fields(s ...googleapi.Field) *MobiledevicesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MobiledevicesGetCall) IfNoneMatch(entityTag string) *MobiledevicesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MobiledevicesGetCall) Context(ctx context.Context) *MobiledevicesGetCall { + c.ctx_ = ctx + return c +} + +func (c *MobiledevicesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/devices/mobile/{resourceId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "resourceId": c.resourceId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.mobiledevices.get" call. +// Exactly one of *MobileDevice or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *MobileDevice.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MobiledevicesGetCall) Do() (*MobileDevice, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &MobileDevice{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +// +// Possible values: +// "deviceId" - Mobile Device serial number. +// "email" - Owner user email. +// "lastSync" - Last policy settings sync date time of the device. +// "model" - Mobile Device model. +// "name" - Owner user name. +// "os" - Mobile operating system. +// "status" - Status of the device. +// "type" - Type of the device. +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. +// +// Possible values: +// "BASIC" - Includes only the basic metadata fields (e.g., deviceId, +// model, status, type, and status) +// "FULL" - Includes all metadata 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 +// +// Possible values: +// "ASCENDING" - Ascending order. +// "DESCENDING" - Descending order. +func (c *MobiledevicesListCall) SortOrder(sortOrder string) *MobiledevicesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MobiledevicesListCall) Fields(s ...googleapi.Field) *MobiledevicesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MobiledevicesListCall) IfNoneMatch(entityTag string) *MobiledevicesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MobiledevicesListCall) Context(ctx context.Context) *MobiledevicesListCall { + c.ctx_ = ctx + return c +} + +func (c *MobiledevicesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/devices/mobile") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.mobiledevices.list" call. +// Exactly one of *MobileDevices or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *MobileDevices.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MobiledevicesListCall) Do() (*MobileDevices, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &MobileDevices{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *NotificationsDeleteCall) Fields(s ...googleapi.Field) *NotificationsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *NotificationsDeleteCall) Context(ctx context.Context) *NotificationsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *NotificationsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/notifications/{notificationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customer": c.customer, + "notificationId": c.notificationId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.notifications.delete" call. +func (c *NotificationsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *NotificationsGetCall) Fields(s ...googleapi.Field) *NotificationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *NotificationsGetCall) IfNoneMatch(entityTag string) *NotificationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *NotificationsGetCall) Context(ctx context.Context) *NotificationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *NotificationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/notifications/{notificationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customer": c.customer, + "notificationId": c.notificationId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.notifications.get" call. +// Exactly one of *Notification or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Notification.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *NotificationsGetCall) Do() (*Notification, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Notification{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *NotificationsListCall) Fields(s ...googleapi.Field) *NotificationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *NotificationsListCall) IfNoneMatch(entityTag string) *NotificationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *NotificationsListCall) Context(ctx context.Context) *NotificationsListCall { + c.ctx_ = ctx + return c +} + +func (c *NotificationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/notifications") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customer": c.customer, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.notifications.list" call. +// Exactly one of *Notifications or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Notifications.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *NotificationsListCall) Do() (*Notifications, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Notifications{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *NotificationsPatchCall) Fields(s ...googleapi.Field) *NotificationsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *NotificationsPatchCall) Context(ctx context.Context) *NotificationsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *NotificationsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/notifications/{notificationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customer": c.customer, + "notificationId": c.notificationId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.notifications.patch" call. +// Exactly one of *Notification or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Notification.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *NotificationsPatchCall) Do() (*Notification, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Notification{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *NotificationsUpdateCall) Fields(s ...googleapi.Field) *NotificationsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *NotificationsUpdateCall) Context(ctx context.Context) *NotificationsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *NotificationsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/notifications/{notificationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customer": c.customer, + "notificationId": c.notificationId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.notifications.update" call. +// Exactly one of *Notification or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Notification.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *NotificationsUpdateCall) Do() (*Notification, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Notification{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrgunitsDeleteCall) Fields(s ...googleapi.Field) *OrgunitsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrgunitsDeleteCall) Context(ctx context.Context) *OrgunitsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *OrgunitsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/orgunits{/orgUnitPath*}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "orgUnitPath": c.orgUnitPath[0], + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.orgunits.delete" call. +func (c *OrgunitsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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 or its Id", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrgunitsGetCall) Fields(s ...googleapi.Field) *OrgunitsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrgunitsGetCall) IfNoneMatch(entityTag string) *OrgunitsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrgunitsGetCall) Context(ctx context.Context) *OrgunitsGetCall { + c.ctx_ = ctx + return c +} + +func (c *OrgunitsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/orgunits{/orgUnitPath*}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "orgUnitPath": c.orgUnitPath[0], + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.orgunits.get" call. +// Exactly one of *OrgUnit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *OrgUnit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrgunitsGetCall) Do() (*OrgUnit, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrgUnit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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 or its Id", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrgunitsInsertCall) Fields(s ...googleapi.Field) *OrgunitsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrgunitsInsertCall) Context(ctx context.Context) *OrgunitsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *OrgunitsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/orgunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.orgunits.insert" call. +// Exactly one of *OrgUnit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *OrgUnit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrgunitsInsertCall) Do() (*OrgUnit, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrgUnit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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's path or its Id +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 +// +// Possible values: +// "all" - All sub-organization units. +// "children" - Immediate children only (default). +func (c *OrgunitsListCall) Type(type_ string) *OrgunitsListCall { + c.opt_["type"] = type_ + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrgunitsListCall) Fields(s ...googleapi.Field) *OrgunitsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrgunitsListCall) IfNoneMatch(entityTag string) *OrgunitsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrgunitsListCall) Context(ctx context.Context) *OrgunitsListCall { + c.ctx_ = ctx + return c +} + +func (c *OrgunitsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/orgunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.orgunits.list" call. +// Exactly one of *OrgUnits or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *OrgUnits.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OrgunitsListCall) Do() (*OrgUnits, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrgUnits{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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's path or its Id", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrgunitsPatchCall) Fields(s ...googleapi.Field) *OrgunitsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrgunitsPatchCall) Context(ctx context.Context) *OrgunitsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *OrgunitsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/orgunits{/orgUnitPath*}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "orgUnitPath": c.orgUnitPath[0], + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.orgunits.patch" call. +// Exactly one of *OrgUnit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *OrgUnit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrgunitsPatchCall) Do() (*OrgUnit, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrgUnit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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 or its Id", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrgunitsUpdateCall) Fields(s ...googleapi.Field) *OrgunitsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrgunitsUpdateCall) Context(ctx context.Context) *OrgunitsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *OrgunitsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/orgunits{/orgUnitPath*}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "orgUnitPath": c.orgUnitPath[0], + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.orgunits.update" call. +// Exactly one of *OrgUnit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *OrgUnit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrgunitsUpdateCall) Do() (*OrgUnit, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrgUnit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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 or its Id", + // "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.privileges.list": + +type PrivilegesListCall struct { + s *Service + customer string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a paginated list of all privileges for a customer. +func (r *PrivilegesService) List(customer string) *PrivilegesListCall { + c := &PrivilegesListCall{s: r.s, opt_: make(map[string]interface{})} + c.customer = customer + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PrivilegesListCall) Fields(s ...googleapi.Field) *PrivilegesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PrivilegesListCall) IfNoneMatch(entityTag string) *PrivilegesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PrivilegesListCall) Context(ctx context.Context) *PrivilegesListCall { + c.ctx_ = ctx + return c +} + +func (c *PrivilegesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/roles/ALL/privileges") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customer": c.customer, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.privileges.list" call. +// Exactly one of *Privileges or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Privileges.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PrivilegesListCall) Do() (*Privileges, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Privileges{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a paginated list of all privileges for a customer.", + // "httpMethod": "GET", + // "id": "directory.privileges.list", + // "parameterOrder": [ + // "customer" + // ], + // "parameters": { + // "customer": { + // "description": "Immutable ID of the Google Apps account.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customer}/roles/ALL/privileges", + // "response": { + // "$ref": "Privileges" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.rolemanagement", + // "https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly" + // ] + // } + +} + +// method id "directory.roleAssignments.delete": + +type RoleAssignmentsDeleteCall struct { + s *Service + customer string + roleAssignmentId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a role assignment. +func (r *RoleAssignmentsService) Delete(customer string, roleAssignmentId string) *RoleAssignmentsDeleteCall { + c := &RoleAssignmentsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.customer = customer + c.roleAssignmentId = roleAssignmentId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RoleAssignmentsDeleteCall) Fields(s ...googleapi.Field) *RoleAssignmentsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RoleAssignmentsDeleteCall) Context(ctx context.Context) *RoleAssignmentsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *RoleAssignmentsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/roleassignments/{roleAssignmentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customer": c.customer, + "roleAssignmentId": c.roleAssignmentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.roleAssignments.delete" call. +func (c *RoleAssignmentsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a role assignment.", + // "httpMethod": "DELETE", + // "id": "directory.roleAssignments.delete", + // "parameterOrder": [ + // "customer", + // "roleAssignmentId" + // ], + // "parameters": { + // "customer": { + // "description": "Immutable ID of the Google Apps account.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "roleAssignmentId": { + // "description": "Immutable ID of the role assignment.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customer}/roleassignments/{roleAssignmentId}", + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.rolemanagement" + // ] + // } + +} + +// method id "directory.roleAssignments.get": + +type RoleAssignmentsGetCall struct { + s *Service + customer string + roleAssignmentId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieve a role assignment. +func (r *RoleAssignmentsService) Get(customer string, roleAssignmentId string) *RoleAssignmentsGetCall { + c := &RoleAssignmentsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.customer = customer + c.roleAssignmentId = roleAssignmentId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RoleAssignmentsGetCall) Fields(s ...googleapi.Field) *RoleAssignmentsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RoleAssignmentsGetCall) IfNoneMatch(entityTag string) *RoleAssignmentsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RoleAssignmentsGetCall) Context(ctx context.Context) *RoleAssignmentsGetCall { + c.ctx_ = ctx + return c +} + +func (c *RoleAssignmentsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/roleassignments/{roleAssignmentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customer": c.customer, + "roleAssignmentId": c.roleAssignmentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.roleAssignments.get" call. +// Exactly one of *RoleAssignment or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *RoleAssignment.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RoleAssignmentsGetCall) Do() (*RoleAssignment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RoleAssignment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve a role assignment.", + // "httpMethod": "GET", + // "id": "directory.roleAssignments.get", + // "parameterOrder": [ + // "customer", + // "roleAssignmentId" + // ], + // "parameters": { + // "customer": { + // "description": "Immutable ID of the Google Apps account.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "roleAssignmentId": { + // "description": "Immutable ID of the role assignment.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customer}/roleassignments/{roleAssignmentId}", + // "response": { + // "$ref": "RoleAssignment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.rolemanagement", + // "https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly" + // ] + // } + +} + +// method id "directory.roleAssignments.insert": + +type RoleAssignmentsInsertCall struct { + s *Service + customer string + roleassignment *RoleAssignment + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a role assignment. +func (r *RoleAssignmentsService) Insert(customer string, roleassignment *RoleAssignment) *RoleAssignmentsInsertCall { + c := &RoleAssignmentsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.customer = customer + c.roleassignment = roleassignment + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RoleAssignmentsInsertCall) Fields(s ...googleapi.Field) *RoleAssignmentsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RoleAssignmentsInsertCall) Context(ctx context.Context) *RoleAssignmentsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *RoleAssignmentsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.roleassignment) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/roleassignments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customer": c.customer, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.roleAssignments.insert" call. +// Exactly one of *RoleAssignment or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *RoleAssignment.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RoleAssignmentsInsertCall) Do() (*RoleAssignment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RoleAssignment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a role assignment.", + // "httpMethod": "POST", + // "id": "directory.roleAssignments.insert", + // "parameterOrder": [ + // "customer" + // ], + // "parameters": { + // "customer": { + // "description": "Immutable ID of the Google Apps account.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customer}/roleassignments", + // "request": { + // "$ref": "RoleAssignment" + // }, + // "response": { + // "$ref": "RoleAssignment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.rolemanagement" + // ] + // } + +} + +// method id "directory.roleAssignments.list": + +type RoleAssignmentsListCall struct { + s *Service + customer string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a paginated list of all roleAssignments. +func (r *RoleAssignmentsService) List(customer string) *RoleAssignmentsListCall { + c := &RoleAssignmentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.customer = customer + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *RoleAssignmentsListCall) MaxResults(maxResults int64) *RoleAssignmentsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Token to specify +// the next page in the list. +func (c *RoleAssignmentsListCall) PageToken(pageToken string) *RoleAssignmentsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// RoleId sets the optional parameter "roleId": Immutable ID of a role. +// If included in the request, returns only role assignments containing +// this role ID. +func (c *RoleAssignmentsListCall) RoleId(roleId string) *RoleAssignmentsListCall { + c.opt_["roleId"] = roleId + return c +} + +// UserKey sets the optional parameter "userKey": The user's primary +// email address, alias email address, or unique user ID. If included in +// the request, returns role assignments only for this user. +func (c *RoleAssignmentsListCall) UserKey(userKey string) *RoleAssignmentsListCall { + c.opt_["userKey"] = userKey + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RoleAssignmentsListCall) Fields(s ...googleapi.Field) *RoleAssignmentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RoleAssignmentsListCall) IfNoneMatch(entityTag string) *RoleAssignmentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RoleAssignmentsListCall) Context(ctx context.Context) *RoleAssignmentsListCall { + c.ctx_ = ctx + return c +} + +func (c *RoleAssignmentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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_["roleId"]; ok { + params.Set("roleId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["userKey"]; ok { + params.Set("userKey", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/roleassignments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customer": c.customer, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.roleAssignments.list" call. +// Exactly one of *RoleAssignments or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *RoleAssignments.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RoleAssignmentsListCall) Do() (*RoleAssignments, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RoleAssignments{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a paginated list of all roleAssignments.", + // "httpMethod": "GET", + // "id": "directory.roleAssignments.list", + // "parameterOrder": [ + // "customer" + // ], + // "parameters": { + // "customer": { + // "description": "Immutable ID of the Google Apps account.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "maximum": "200", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Token to specify the next page in the list.", + // "location": "query", + // "type": "string" + // }, + // "roleId": { + // "description": "Immutable ID of a role. If included in the request, returns only role assignments containing this role ID.", + // "location": "query", + // "type": "string" + // }, + // "userKey": { + // "description": "The user's primary email address, alias email address, or unique user ID. If included in the request, returns role assignments only for this user.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "customer/{customer}/roleassignments", + // "response": { + // "$ref": "RoleAssignments" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.rolemanagement", + // "https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly" + // ] + // } + +} + +// method id "directory.roles.delete": + +type RolesDeleteCall struct { + s *Service + customer string + roleId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a role. +func (r *RolesService) Delete(customer string, roleId string) *RolesDeleteCall { + c := &RolesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.customer = customer + c.roleId = roleId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RolesDeleteCall) Fields(s ...googleapi.Field) *RolesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RolesDeleteCall) Context(ctx context.Context) *RolesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *RolesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/roles/{roleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customer": c.customer, + "roleId": c.roleId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.roles.delete" call. +func (c *RolesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a role.", + // "httpMethod": "DELETE", + // "id": "directory.roles.delete", + // "parameterOrder": [ + // "customer", + // "roleId" + // ], + // "parameters": { + // "customer": { + // "description": "Immutable ID of the Google Apps account.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "roleId": { + // "description": "Immutable ID of the role.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customer}/roles/{roleId}", + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.rolemanagement" + // ] + // } + +} + +// method id "directory.roles.get": + +type RolesGetCall struct { + s *Service + customer string + roleId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves a role. +func (r *RolesService) Get(customer string, roleId string) *RolesGetCall { + c := &RolesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.customer = customer + c.roleId = roleId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RolesGetCall) Fields(s ...googleapi.Field) *RolesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RolesGetCall) IfNoneMatch(entityTag string) *RolesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RolesGetCall) Context(ctx context.Context) *RolesGetCall { + c.ctx_ = ctx + return c +} + +func (c *RolesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/roles/{roleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customer": c.customer, + "roleId": c.roleId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.roles.get" call. +// Exactly one of *Role or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Role.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *RolesGetCall) Do() (*Role, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Role{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a role.", + // "httpMethod": "GET", + // "id": "directory.roles.get", + // "parameterOrder": [ + // "customer", + // "roleId" + // ], + // "parameters": { + // "customer": { + // "description": "Immutable ID of the Google Apps account.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "roleId": { + // "description": "Immutable ID of the role.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customer}/roles/{roleId}", + // "response": { + // "$ref": "Role" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.rolemanagement", + // "https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly" + // ] + // } + +} + +// method id "directory.roles.insert": + +type RolesInsertCall struct { + s *Service + customer string + role *Role + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a role. +func (r *RolesService) Insert(customer string, role *Role) *RolesInsertCall { + c := &RolesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.customer = customer + c.role = role + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RolesInsertCall) Fields(s ...googleapi.Field) *RolesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RolesInsertCall) Context(ctx context.Context) *RolesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *RolesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.role) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/roles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customer": c.customer, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.roles.insert" call. +// Exactly one of *Role or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Role.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *RolesInsertCall) Do() (*Role, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Role{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a role.", + // "httpMethod": "POST", + // "id": "directory.roles.insert", + // "parameterOrder": [ + // "customer" + // ], + // "parameters": { + // "customer": { + // "description": "Immutable ID of the Google Apps account.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customer}/roles", + // "request": { + // "$ref": "Role" + // }, + // "response": { + // "$ref": "Role" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.rolemanagement" + // ] + // } + +} + +// method id "directory.roles.list": + +type RolesListCall struct { + s *Service + customer string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a paginated list of all the roles in a domain. +func (r *RolesService) List(customer string) *RolesListCall { + c := &RolesListCall{s: r.s, opt_: make(map[string]interface{})} + c.customer = customer + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *RolesListCall) MaxResults(maxResults int64) *RolesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Token to specify +// the next page in the list. +func (c *RolesListCall) PageToken(pageToken string) *RolesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RolesListCall) Fields(s ...googleapi.Field) *RolesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RolesListCall) IfNoneMatch(entityTag string) *RolesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RolesListCall) Context(ctx context.Context) *RolesListCall { + c.ctx_ = ctx + return c +} + +func (c *RolesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/roles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customer": c.customer, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.roles.list" call. +// Exactly one of *Roles or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Roles.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *RolesListCall) Do() (*Roles, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Roles{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a paginated list of all the roles in a domain.", + // "httpMethod": "GET", + // "id": "directory.roles.list", + // "parameterOrder": [ + // "customer" + // ], + // "parameters": { + // "customer": { + // "description": "Immutable id of the Google Apps account.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "maximum": "100", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Token to specify the next page in the list.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "customer/{customer}/roles", + // "response": { + // "$ref": "Roles" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.rolemanagement", + // "https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly" + // ] + // } + +} + +// method id "directory.roles.patch": + +type RolesPatchCall struct { + s *Service + customer string + roleId string + role *Role + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates a role. This method supports patch semantics. +func (r *RolesService) Patch(customer string, roleId string, role *Role) *RolesPatchCall { + c := &RolesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.customer = customer + c.roleId = roleId + c.role = role + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RolesPatchCall) Fields(s ...googleapi.Field) *RolesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RolesPatchCall) Context(ctx context.Context) *RolesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *RolesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.role) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/roles/{roleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customer": c.customer, + "roleId": c.roleId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.roles.patch" call. +// Exactly one of *Role or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Role.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *RolesPatchCall) Do() (*Role, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Role{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a role. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "directory.roles.patch", + // "parameterOrder": [ + // "customer", + // "roleId" + // ], + // "parameters": { + // "customer": { + // "description": "Immutable ID of the Google Apps account.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "roleId": { + // "description": "Immutable ID of the role.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customer}/roles/{roleId}", + // "request": { + // "$ref": "Role" + // }, + // "response": { + // "$ref": "Role" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.rolemanagement" + // ] + // } + +} + +// method id "directory.roles.update": + +type RolesUpdateCall struct { + s *Service + customer string + roleId string + role *Role + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a role. +func (r *RolesService) Update(customer string, roleId string, role *Role) *RolesUpdateCall { + c := &RolesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.customer = customer + c.roleId = roleId + c.role = role + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RolesUpdateCall) Fields(s ...googleapi.Field) *RolesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RolesUpdateCall) Context(ctx context.Context) *RolesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *RolesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.role) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customer}/roles/{roleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customer": c.customer, + "roleId": c.roleId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.roles.update" call. +// Exactly one of *Role or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Role.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *RolesUpdateCall) Do() (*Role, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Role{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a role.", + // "httpMethod": "PUT", + // "id": "directory.roles.update", + // "parameterOrder": [ + // "customer", + // "roleId" + // ], + // "parameters": { + // "customer": { + // "description": "Immutable ID of the Google Apps account.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "roleId": { + // "description": "Immutable ID of the role.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customer}/roles/{roleId}", + // "request": { + // "$ref": "Role" + // }, + // "response": { + // "$ref": "Role" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.rolemanagement" + // ] + // } + +} + +// method id "directory.schemas.delete": + +type SchemasDeleteCall struct { + s *Service + customerId string + schemaKey string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Delete schema +func (r *SchemasService) Delete(customerId string, schemaKey string) *SchemasDeleteCall { + c := &SchemasDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.schemaKey = schemaKey + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SchemasDeleteCall) Fields(s ...googleapi.Field) *SchemasDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SchemasDeleteCall) Context(ctx context.Context) *SchemasDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *SchemasDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/schemas/{schemaKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "schemaKey": c.schemaKey, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.schemas.delete" call. +func (c *SchemasDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete schema", + // "httpMethod": "DELETE", + // "id": "directory.schemas.delete", + // "parameterOrder": [ + // "customerId", + // "schemaKey" + // ], + // "parameters": { + // "customerId": { + // "description": "Immutable id of the Google Apps account", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "schemaKey": { + // "description": "Name or immutable Id of the schema", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customerId}/schemas/{schemaKey}", + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.userschema" + // ] + // } + +} + +// method id "directory.schemas.get": + +type SchemasGetCall struct { + s *Service + customerId string + schemaKey string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieve schema +func (r *SchemasService) Get(customerId string, schemaKey string) *SchemasGetCall { + c := &SchemasGetCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.schemaKey = schemaKey + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SchemasGetCall) Fields(s ...googleapi.Field) *SchemasGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SchemasGetCall) IfNoneMatch(entityTag string) *SchemasGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SchemasGetCall) Context(ctx context.Context) *SchemasGetCall { + c.ctx_ = ctx + return c +} + +func (c *SchemasGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/schemas/{schemaKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "schemaKey": c.schemaKey, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.schemas.get" call. +// Exactly one of *Schema or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Schema.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *SchemasGetCall) Do() (*Schema, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Schema{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve schema", + // "httpMethod": "GET", + // "id": "directory.schemas.get", + // "parameterOrder": [ + // "customerId", + // "schemaKey" + // ], + // "parameters": { + // "customerId": { + // "description": "Immutable id of the Google Apps account", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "schemaKey": { + // "description": "Name or immutable Id of the schema", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customerId}/schemas/{schemaKey}", + // "response": { + // "$ref": "Schema" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.userschema", + // "https://www.googleapis.com/auth/admin.directory.userschema.readonly" + // ] + // } + +} + +// method id "directory.schemas.insert": + +type SchemasInsertCall struct { + s *Service + customerId string + schema *Schema + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Create schema. +func (r *SchemasService) Insert(customerId string, schema *Schema) *SchemasInsertCall { + c := &SchemasInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.schema = schema + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SchemasInsertCall) Fields(s ...googleapi.Field) *SchemasInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SchemasInsertCall) Context(ctx context.Context) *SchemasInsertCall { + c.ctx_ = ctx + return c +} + +func (c *SchemasInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.schema) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/schemas") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.schemas.insert" call. +// Exactly one of *Schema or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Schema.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *SchemasInsertCall) Do() (*Schema, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Schema{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create schema.", + // "httpMethod": "POST", + // "id": "directory.schemas.insert", + // "parameterOrder": [ + // "customerId" + // ], + // "parameters": { + // "customerId": { + // "description": "Immutable id of the Google Apps account", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customerId}/schemas", + // "request": { + // "$ref": "Schema" + // }, + // "response": { + // "$ref": "Schema" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.userschema" + // ] + // } + +} + +// method id "directory.schemas.list": + +type SchemasListCall struct { + s *Service + customerId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieve all schemas for a customer +func (r *SchemasService) List(customerId string) *SchemasListCall { + c := &SchemasListCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SchemasListCall) Fields(s ...googleapi.Field) *SchemasListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SchemasListCall) IfNoneMatch(entityTag string) *SchemasListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SchemasListCall) Context(ctx context.Context) *SchemasListCall { + c.ctx_ = ctx + return c +} + +func (c *SchemasListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/schemas") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.schemas.list" call. +// Exactly one of *Schemas or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Schemas.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *SchemasListCall) Do() (*Schemas, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Schemas{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve all schemas for a customer", + // "httpMethod": "GET", + // "id": "directory.schemas.list", + // "parameterOrder": [ + // "customerId" + // ], + // "parameters": { + // "customerId": { + // "description": "Immutable id of the Google Apps account", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customerId}/schemas", + // "response": { + // "$ref": "Schemas" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.userschema", + // "https://www.googleapis.com/auth/admin.directory.userschema.readonly" + // ] + // } + +} + +// method id "directory.schemas.patch": + +type SchemasPatchCall struct { + s *Service + customerId string + schemaKey string + schema *Schema + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Update schema. This method supports patch semantics. +func (r *SchemasService) Patch(customerId string, schemaKey string, schema *Schema) *SchemasPatchCall { + c := &SchemasPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.schemaKey = schemaKey + c.schema = schema + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SchemasPatchCall) Fields(s ...googleapi.Field) *SchemasPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SchemasPatchCall) Context(ctx context.Context) *SchemasPatchCall { + c.ctx_ = ctx + return c +} + +func (c *SchemasPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.schema) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/schemas/{schemaKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "schemaKey": c.schemaKey, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.schemas.patch" call. +// Exactly one of *Schema or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Schema.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *SchemasPatchCall) Do() (*Schema, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Schema{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update schema. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "directory.schemas.patch", + // "parameterOrder": [ + // "customerId", + // "schemaKey" + // ], + // "parameters": { + // "customerId": { + // "description": "Immutable id of the Google Apps account", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "schemaKey": { + // "description": "Name or immutable Id of the schema.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customerId}/schemas/{schemaKey}", + // "request": { + // "$ref": "Schema" + // }, + // "response": { + // "$ref": "Schema" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.userschema" + // ] + // } + +} + +// method id "directory.schemas.update": + +type SchemasUpdateCall struct { + s *Service + customerId string + schemaKey string + schema *Schema + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Update schema +func (r *SchemasService) Update(customerId string, schemaKey string, schema *Schema) *SchemasUpdateCall { + c := &SchemasUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.schemaKey = schemaKey + c.schema = schema + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SchemasUpdateCall) Fields(s ...googleapi.Field) *SchemasUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SchemasUpdateCall) Context(ctx context.Context) *SchemasUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *SchemasUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.schema) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customer/{customerId}/schemas/{schemaKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "schemaKey": c.schemaKey, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.schemas.update" call. +// Exactly one of *Schema or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Schema.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *SchemasUpdateCall) Do() (*Schema, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Schema{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update schema", + // "httpMethod": "PUT", + // "id": "directory.schemas.update", + // "parameterOrder": [ + // "customerId", + // "schemaKey" + // ], + // "parameters": { + // "customerId": { + // "description": "Immutable id of the Google Apps account", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "schemaKey": { + // "description": "Name or immutable Id of the schema.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "customer/{customerId}/schemas/{schemaKey}", + // "request": { + // "$ref": "Schema" + // }, + // "response": { + // "$ref": "Schema" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/admin.directory.userschema" + // ] + // } + +} + +// method id "directory.tokens.delete": + +type TokensDeleteCall struct { + s *Service + userKey string + clientId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TokensDeleteCall) Fields(s ...googleapi.Field) *TokensDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TokensDeleteCall) Context(ctx context.Context) *TokensDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TokensDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/tokens/{clientId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + "clientId": c.clientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.tokens.delete" call. +func (c *TokensDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TokensGetCall) Fields(s ...googleapi.Field) *TokensGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TokensGetCall) IfNoneMatch(entityTag string) *TokensGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TokensGetCall) Context(ctx context.Context) *TokensGetCall { + c.ctx_ = ctx + return c +} + +func (c *TokensGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/tokens/{clientId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + "clientId": c.clientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.tokens.get" call. +// Exactly one of *Token or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Token.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TokensGetCall) Do() (*Token, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Token{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// List: Returns the set of tokens specified user has issued to 3rd +// party applications. +func (r *TokensService) List(userKey string) *TokensListCall { + c := &TokensListCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TokensListCall) Fields(s ...googleapi.Field) *TokensListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TokensListCall) IfNoneMatch(entityTag string) *TokensListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TokensListCall) Context(ctx context.Context) *TokensListCall { + c.ctx_ = ctx + return c +} + +func (c *TokensListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/tokens") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.tokens.list" call. +// Exactly one of *Tokens or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Tokens.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TokensListCall) Do() (*Tokens, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Tokens{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the set of tokens specified user has issued to 3rd party applications.", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersDeleteCall) Fields(s ...googleapi.Field) *UsersDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersDeleteCall) Context(ctx context.Context) *UsersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.users.delete" call. +func (c *UsersDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete 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{} + ctx_ context.Context +} + +// 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 +} + +// CustomFieldMask sets the optional parameter "customFieldMask": +// Comma-separated list of schema names. All fields from these schemas +// are fetched. This should only be set when projection=custom. +func (c *UsersGetCall) CustomFieldMask(customFieldMask string) *UsersGetCall { + c.opt_["customFieldMask"] = customFieldMask + return c +} + +// Projection sets the optional parameter "projection": What subset of +// fields to fetch for this user. +// +// Possible values: +// "basic" (default) - Do not include any custom fields for the user. +// "custom" - Include custom fields from schemas mentioned in +// customFieldMask. +// "full" - Include all fields associated with this user. +func (c *UsersGetCall) Projection(projection string) *UsersGetCall { + c.opt_["projection"] = projection + return c +} + +// ViewType sets the optional parameter "viewType": Whether to fetch the +// ADMIN_VIEW or DOMAIN_PUBLIC view of the user. +// +// Possible values: +// "admin_view" (default) - Fetches the ADMIN_VIEW of the user. +// "domain_public" - Fetches the DOMAIN_PUBLIC view of the user. +func (c *UsersGetCall) ViewType(viewType string) *UsersGetCall { + c.opt_["viewType"] = viewType + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall { + c.ctx_ = ctx + return c +} + +func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["customFieldMask"]; ok { + params.Set("customFieldMask", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["viewType"]; ok { + params.Set("viewType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.users.get" call. +// Exactly one of *User or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *User.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *UsersGetCall) Do() (*User, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &User{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "retrieve user", + // "httpMethod": "GET", + // "id": "directory.users.get", + // "parameterOrder": [ + // "userKey" + // ], + // "parameters": { + // "customFieldMask": { + // "description": "Comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom.", + // "location": "query", + // "type": "string" + // }, + // "projection": { + // "default": "basic", + // "description": "What subset of fields to fetch for this user.", + // "enum": [ + // "basic", + // "custom", + // "full" + // ], + // "enumDescriptions": [ + // "Do not include any custom fields for the user.", + // "Include custom fields from schemas mentioned in customFieldMask.", + // "Include all fields associated with this user." + // ], + // "location": "query", + // "type": "string" + // }, + // "userKey": { + // "description": "Email or immutable Id of the user", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "viewType": { + // "default": "admin_view", + // "description": "Whether to fetch the ADMIN_VIEW or DOMAIN_PUBLIC view of the user.", + // "enum": [ + // "admin_view", + // "domain_public" + // ], + // "enumDescriptions": [ + // "Fetches the ADMIN_VIEW of the user.", + // "Fetches the DOMAIN_PUBLIC view of the user." + // ], + // "location": "query", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersInsertCall) Fields(s ...googleapi.Field) *UsersInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersInsertCall) Context(ctx context.Context) *UsersInsertCall { + c.ctx_ = ctx + return c +} + +func (c *UsersInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.users.insert" call. +// Exactly one of *User or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *User.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *UsersInsertCall) Do() (*User, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &User{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// CustomFieldMask sets the optional parameter "customFieldMask": +// Comma-separated list of schema names. All fields from these schemas +// are fetched. This should only be set when projection=custom. +func (c *UsersListCall) CustomFieldMask(customFieldMask string) *UsersListCall { + c.opt_["customFieldMask"] = customFieldMask + 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) +// +// Possible values: +// "add" - User Created Event +// "delete" - User Deleted Event +// "makeAdmin" - User Admin Status Change Event +// "undelete" - User Undeleted Event +// "update" - User Updated Event +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 +// +// Possible values: +// "email" - Primary email of the user. +// "familyName" - User's family name. +// "givenName" - User's given name. +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 +} + +// Projection sets the optional parameter "projection": What subset of +// fields to fetch for this user. +// +// Possible values: +// "basic" (default) - Do not include any custom fields for the user. +// "custom" - Include custom fields from schemas mentioned in +// customFieldMask. +// "full" - Include all fields associated with this user. +func (c *UsersListCall) Projection(projection string) *UsersListCall { + c.opt_["projection"] = projection + return c +} + +// Query sets the optional parameter "query": Query string search. +// Should be of the form "". Complete documentation is at +// https://developers.google.com/admin-sdk/directory/v1/guides/search-users +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. +// +// Possible values: +// "ASCENDING" - Ascending order. +// "DESCENDING" - Descending order. +func (c *UsersListCall) SortOrder(sortOrder string) *UsersListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// ViewType sets the optional parameter "viewType": Whether to fetch the +// ADMIN_VIEW or DOMAIN_PUBLIC view of the user. +// +// Possible values: +// "admin_view" (default) - Fetches the ADMIN_VIEW of the user. +// "domain_public" - Fetches the DOMAIN_PUBLIC view of the user. +func (c *UsersListCall) ViewType(viewType string) *UsersListCall { + c.opt_["viewType"] = viewType + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersListCall) Context(ctx context.Context) *UsersListCall { + c.ctx_ = ctx + return c +} + +func (c *UsersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["customFieldMask"]; ok { + params.Set("customFieldMask", fmt.Sprintf("%v", v)) + } + 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_["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_["showDeleted"]; ok { + params.Set("showDeleted", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortOrder"]; ok { + params.Set("sortOrder", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["viewType"]; ok { + params.Set("viewType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.users.list" call. +// Exactly one of *Users or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Users.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersListCall) Do() (*Users, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Users{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve either deleted users or all users in a domain (paginated)", + // "httpMethod": "GET", + // "id": "directory.users.list", + // "parameters": { + // "customFieldMask": { + // "description": "Comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom.", + // "location": "query", + // "type": "string" + // }, + // "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" + // }, + // "projection": { + // "default": "basic", + // "description": "What subset of fields to fetch for this user.", + // "enum": [ + // "basic", + // "custom", + // "full" + // ], + // "enumDescriptions": [ + // "Do not include any custom fields for the user.", + // "Include custom fields from schemas mentioned in customFieldMask.", + // "Include all fields associated with this user." + // ], + // "location": "query", + // "type": "string" + // }, + // "query": { + // "description": "Query string search. Should be of the form \"\". Complete documentation is at https://developers.google.com/admin-sdk/directory/v1/guides/search-users", + // "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" + // }, + // "viewType": { + // "default": "admin_view", + // "description": "Whether to fetch the ADMIN_VIEW or DOMAIN_PUBLIC view of the user.", + // "enum": [ + // "admin_view", + // "domain_public" + // ], + // "enumDescriptions": [ + // "Fetches the ADMIN_VIEW of the user.", + // "Fetches the DOMAIN_PUBLIC view of the user." + // ], + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersMakeAdminCall) Fields(s ...googleapi.Field) *UsersMakeAdminCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersMakeAdminCall) Context(ctx context.Context) *UsersMakeAdminCall { + c.ctx_ = ctx + return c +} + +func (c *UsersMakeAdminCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.usermakeadmin) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/makeAdmin") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.users.makeAdmin" call. +func (c *UsersMakeAdminCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersPatchCall) Fields(s ...googleapi.Field) *UsersPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersPatchCall) Context(ctx context.Context) *UsersPatchCall { + c.ctx_ = ctx + return c +} + +func (c *UsersPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.users.patch" call. +// Exactly one of *User or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *User.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *UsersPatchCall) Do() (*User, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &User{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "update 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersUndeleteCall) Fields(s ...googleapi.Field) *UsersUndeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersUndeleteCall) Context(ctx context.Context) *UsersUndeleteCall { + c.ctx_ = ctx + return c +} + +func (c *UsersUndeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.userundelete) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/undelete") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.users.undelete" call. +func (c *UsersUndeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersUpdateCall) Fields(s ...googleapi.Field) *UsersUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersUpdateCall) Context(ctx context.Context) *UsersUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *UsersUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.users.update" call. +// Exactly one of *User or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *User.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *UsersUpdateCall) Do() (*User, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &User{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "update 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{} + ctx_ context.Context +} + +// 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 +} + +// CustomFieldMask sets the optional parameter "customFieldMask": +// Comma-separated list of schema names. All fields from these schemas +// are fetched. This should only be set when projection=custom. +func (c *UsersWatchCall) CustomFieldMask(customFieldMask string) *UsersWatchCall { + c.opt_["customFieldMask"] = customFieldMask + 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) +// +// Possible values: +// "add" - User Created Event +// "delete" - User Deleted Event +// "makeAdmin" - User Admin Status Change Event +// "undelete" - User Undeleted Event +// "update" - User Updated Event +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 +// +// Possible values: +// "email" - Primary email of the user. +// "familyName" - User's family name. +// "givenName" - User's given name. +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 +} + +// Projection sets the optional parameter "projection": What subset of +// fields to fetch for this user. +// +// Possible values: +// "basic" (default) - Do not include any custom fields for the user. +// "custom" - Include custom fields from schemas mentioned in +// customFieldMask. +// "full" - Include all fields associated with this user. +func (c *UsersWatchCall) Projection(projection string) *UsersWatchCall { + c.opt_["projection"] = projection + return c +} + +// Query sets the optional parameter "query": Query string search. +// Should be of the form "". Complete documentation is at +// https://developers.google.com/admin-sdk/directory/v1/guides/search-users +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. +// +// Possible values: +// "ASCENDING" - Ascending order. +// "DESCENDING" - Descending order. +func (c *UsersWatchCall) SortOrder(sortOrder string) *UsersWatchCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// ViewType sets the optional parameter "viewType": Whether to fetch the +// ADMIN_VIEW or DOMAIN_PUBLIC view of the user. +// +// Possible values: +// "admin_view" (default) - Fetches the ADMIN_VIEW of the user. +// "domain_public" - Fetches the DOMAIN_PUBLIC view of the user. +func (c *UsersWatchCall) ViewType(viewType string) *UsersWatchCall { + c.opt_["viewType"] = viewType + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersWatchCall) Fields(s ...googleapi.Field) *UsersWatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersWatchCall) Context(ctx context.Context) *UsersWatchCall { + c.ctx_ = ctx + return c +} + +func (c *UsersWatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["customFieldMask"]; ok { + params.Set("customFieldMask", fmt.Sprintf("%v", v)) + } + 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_["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_["showDeleted"]; ok { + params.Set("showDeleted", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortOrder"]; ok { + params.Set("sortOrder", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["viewType"]; ok { + params.Set("viewType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.users.watch" call. +// Exactly one of *Channel or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Channel.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersWatchCall) Do() (*Channel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Channel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Watch for changes in users list", + // "httpMethod": "POST", + // "id": "directory.users.watch", + // "parameters": { + // "customFieldMask": { + // "description": "Comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom.", + // "location": "query", + // "type": "string" + // }, + // "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" + // }, + // "projection": { + // "default": "basic", + // "description": "What subset of fields to fetch for this user.", + // "enum": [ + // "basic", + // "custom", + // "full" + // ], + // "enumDescriptions": [ + // "Do not include any custom fields for the user.", + // "Include custom fields from schemas mentioned in customFieldMask.", + // "Include all fields associated with this user." + // ], + // "location": "query", + // "type": "string" + // }, + // "query": { + // "description": "Query string search. Should be of the form \"\". Complete documentation is at https://developers.google.com/admin-sdk/directory/v1/guides/search-users", + // "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" + // }, + // "viewType": { + // "default": "admin_view", + // "description": "Whether to fetch the ADMIN_VIEW or DOMAIN_PUBLIC view of the user.", + // "enum": [ + // "admin_view", + // "domain_public" + // ], + // "enumDescriptions": [ + // "Fetches the ADMIN_VIEW of the user.", + // "Fetches the DOMAIN_PUBLIC view of the user." + // ], + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersAliasesDeleteCall) Fields(s ...googleapi.Field) *UsersAliasesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersAliasesDeleteCall) Context(ctx context.Context) *UsersAliasesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *UsersAliasesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/aliases/{alias}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + "alias": c.alias, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.users.aliases.delete" call. +func (c *UsersAliasesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersAliasesInsertCall) Fields(s ...googleapi.Field) *UsersAliasesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersAliasesInsertCall) Context(ctx context.Context) *UsersAliasesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *UsersAliasesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/aliases") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.users.aliases.insert" call. +// Exactly one of *Alias or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Alias.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersAliasesInsertCall) Do() (*Alias, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Alias{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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) +// +// Possible values: +// "add" - Alias Created Event +// "delete" - Alias Deleted Event +func (c *UsersAliasesListCall) Event(event string) *UsersAliasesListCall { + c.opt_["event"] = event + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersAliasesListCall) Fields(s ...googleapi.Field) *UsersAliasesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersAliasesListCall) IfNoneMatch(entityTag string) *UsersAliasesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersAliasesListCall) Context(ctx context.Context) *UsersAliasesListCall { + c.ctx_ = ctx + return c +} + +func (c *UsersAliasesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["event"]; ok { + params.Set("event", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/aliases") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.users.aliases.list" call. +// Exactly one of *Aliases or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Aliases.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersAliasesListCall) Do() (*Aliases, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Aliases{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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) +// +// Possible values: +// "add" - Alias Created Event +// "delete" - Alias Deleted Event +func (c *UsersAliasesWatchCall) Event(event string) *UsersAliasesWatchCall { + c.opt_["event"] = event + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersAliasesWatchCall) Fields(s ...googleapi.Field) *UsersAliasesWatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersAliasesWatchCall) Context(ctx context.Context) *UsersAliasesWatchCall { + c.ctx_ = ctx + return c +} + +func (c *UsersAliasesWatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["event"]; ok { + params.Set("event", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/aliases/watch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.users.aliases.watch" call. +// Exactly one of *Channel or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Channel.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersAliasesWatchCall) Do() (*Channel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Channel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersPhotosDeleteCall) Fields(s ...googleapi.Field) *UsersPhotosDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersPhotosDeleteCall) Context(ctx context.Context) *UsersPhotosDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *UsersPhotosDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/photos/thumbnail") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.users.photos.delete" call. +func (c *UsersPhotosDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersPhotosGetCall) Fields(s ...googleapi.Field) *UsersPhotosGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersPhotosGetCall) IfNoneMatch(entityTag string) *UsersPhotosGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersPhotosGetCall) Context(ctx context.Context) *UsersPhotosGetCall { + c.ctx_ = ctx + return c +} + +func (c *UsersPhotosGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/photos/thumbnail") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.users.photos.get" call. +// Exactly one of *UserPhoto or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UserPhoto.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersPhotosGetCall) Do() (*UserPhoto, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserPhoto{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersPhotosPatchCall) Fields(s ...googleapi.Field) *UsersPhotosPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersPhotosPatchCall) Context(ctx context.Context) *UsersPhotosPatchCall { + c.ctx_ = ctx + return c +} + +func (c *UsersPhotosPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/photos/thumbnail") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.users.photos.patch" call. +// Exactly one of *UserPhoto or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UserPhoto.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersPhotosPatchCall) Do() (*UserPhoto, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserPhoto{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersPhotosUpdateCall) Fields(s ...googleapi.Field) *UsersPhotosUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersPhotosUpdateCall) Context(ctx context.Context) *UsersPhotosUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *UsersPhotosUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/photos/thumbnail") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.users.photos.update" call. +// Exactly one of *UserPhoto or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UserPhoto.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersPhotosUpdateCall) Do() (*UserPhoto, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserPhoto{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VerificationCodesGenerateCall) Fields(s ...googleapi.Field) *VerificationCodesGenerateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VerificationCodesGenerateCall) Context(ctx context.Context) *VerificationCodesGenerateCall { + c.ctx_ = ctx + return c +} + +func (c *VerificationCodesGenerateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/verificationCodes/generate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.verificationCodes.generate" call. +func (c *VerificationCodesGenerateCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VerificationCodesInvalidateCall) Fields(s ...googleapi.Field) *VerificationCodesInvalidateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VerificationCodesInvalidateCall) Context(ctx context.Context) *VerificationCodesInvalidateCall { + c.ctx_ = ctx + return c +} + +func (c *VerificationCodesInvalidateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/verificationCodes/invalidate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.verificationCodes.invalidate" call. +func (c *VerificationCodesInvalidateCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VerificationCodesListCall) Fields(s ...googleapi.Field) *VerificationCodesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *VerificationCodesListCall) IfNoneMatch(entityTag string) *VerificationCodesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VerificationCodesListCall) Context(ctx context.Context) *VerificationCodesListCall { + c.ctx_ = ctx + return c +} + +func (c *VerificationCodesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userKey}/verificationCodes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "directory.verificationCodes.list" call. +// Exactly one of *VerificationCodes or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *VerificationCodes.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *VerificationCodesListCall) Do() (*VerificationCodes, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &VerificationCodes{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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/Godeps/_workspace/src/google.golang.org/api/admin/email_migration/v2/admin-api.json b/Godeps/_workspace/src/google.golang.org/api/admin/email_migration/v2/admin-api.json new file mode 100644 index 000000000..a52012ca9 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/admin/email_migration/v2/admin-api.json @@ -0,0 +1,173 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/_VRzIG5q4_x1FzCCxocLHIuiUhw\"", + "discoveryVersion": "v1", + "id": "admin:email_migration_v2", + "name": "admin", + "version": "email_migration_v2", + "revision": "20150303", + "title": "Email Migration API v2", + "description": "Email Migration API lets you migrate emails of users to Google backends.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/googlemail-16.png", + "x32": "https://www.google.com/images/icons/product/googlemail-32.png" + }, + "documentationLink": "https://developers.google.com/admin-sdk/email-migration/v2/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/email/v2/users/", + "basePath": "/email/v2/users/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "email/v2/users/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json" + ], + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.", + "location": "query" + }, + "userIp": { + "type": "string", + "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.", + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/email.migration": { + "description": "Manage email messages of users on your domain" + } + } + } + }, + "schemas": { + "MailItem": { + "id": "MailItem", + "type": "object", + "description": "JSON template for MailItem object in Email Migration API.", + "properties": { + "isDeleted": { + "type": "boolean", + "description": "Boolean indicating if the mail is deleted (used in Vault)" + }, + "isDraft": { + "type": "boolean", + "description": "Boolean indicating if the mail is draft" + }, + "isInbox": { + "type": "boolean", + "description": "Boolean indicating if the mail is in inbox" + }, + "isSent": { + "type": "boolean", + "description": "Boolean indicating if the mail is in 'sent mails'" + }, + "isStarred": { + "type": "boolean", + "description": "Boolean indicating if the mail is starred" + }, + "isTrash": { + "type": "boolean", + "description": "Boolean indicating if the mail is in trash" + }, + "isUnread": { + "type": "boolean", + "description": "Boolean indicating if the mail is unread" + }, + "kind": { + "type": "string", + "description": "Kind of resource this is.", + "default": "mailItem" + }, + "labels": { + "type": "array", + "description": "List of labels (strings)", + "items": { + "type": "string" + } + } + } + } + }, + "resources": { + "mail": { + "methods": { + "insert": { + "id": "emailMigration.mail.insert", + "path": "{userKey}/mail", + "httpMethod": "POST", + "description": "Insert Mail into Google's Gmail backends", + "parameters": { + "userKey": { + "type": "string", + "description": "The email or immutable id of the user", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey" + ], + "request": { + "$ref": "MailItem" + }, + "scopes": [ + "https://www.googleapis.com/auth/email.migration" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "message/rfc822" + ], + "maxSize": "35MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/email/v2/users/{userKey}/mail" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/email/v2/users/{userKey}/mail" + } + } + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/admin/email_migration/v2/admin-gen.go b/Godeps/_workspace/src/google.golang.org/api/admin/email_migration/v2/admin-gen.go new file mode 100644 index 000000000..00df426b5 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/admin/email_migration/v2/admin-gen.go @@ -0,0 +1,321 @@ +// Package admin provides access to the Email Migration API v2. +// +// See https://developers.google.com/admin-sdk/email-migration/v2/ +// +// Usage example: +// +// import "google.golang.org/api/admin/email_migration/v2" +// ... +// adminService, err := admin.New(oauthHttpClient) +package admin // import "google.golang.org/api/admin/email_migration/v2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "admin:email_migration_v2" +const apiName = "admin" +const apiVersion = "email_migration_v2" +const basePath = "https://www.googleapis.com/email/v2/users/" + +// OAuth2 scopes used by this API. +const ( + // Manage email messages of users on your domain + EmailMigrationScope = "https://www.googleapis.com/auth/email.migration" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Mail = NewMailService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Mail *MailService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewMailService(s *Service) *MailService { + rs := &MailService{s: s} + return rs +} + +type MailService struct { + s *Service +} + +// MailItem: JSON template for MailItem object in Email Migration API. +type MailItem struct { + // IsDeleted: Boolean indicating if the mail is deleted (used in Vault) + IsDeleted bool `json:"isDeleted,omitempty"` + + // IsDraft: Boolean indicating if the mail is draft + IsDraft bool `json:"isDraft,omitempty"` + + // IsInbox: Boolean indicating if the mail is in inbox + IsInbox bool `json:"isInbox,omitempty"` + + // IsSent: Boolean indicating if the mail is in 'sent mails' + IsSent bool `json:"isSent,omitempty"` + + // IsStarred: Boolean indicating if the mail is starred + IsStarred bool `json:"isStarred,omitempty"` + + // IsTrash: Boolean indicating if the mail is in trash + IsTrash bool `json:"isTrash,omitempty"` + + // IsUnread: Boolean indicating if the mail is unread + IsUnread bool `json:"isUnread,omitempty"` + + // Kind: Kind of resource this is. + Kind string `json:"kind,omitempty"` + + // Labels: List of labels (strings) + Labels []string `json:"labels,omitempty"` + + // ForceSendFields is a list of field names (e.g. "IsDeleted") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MailItem) MarshalJSON() ([]byte, error) { + type noMethod MailItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "emailMigration.mail.insert": + +type MailInsertCall struct { + s *Service + userKey string + mailitem *MailItem + opt_ map[string]interface{} + media_ io.Reader + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// Insert: Insert Mail into Google's Gmail backends +func (r *MailService) Insert(userKey string, mailitem *MailItem) *MailInsertCall { + c := &MailInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.userKey = userKey + c.mailitem = mailitem + return c +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *MailInsertCall) Media(r io.Reader) *MailInsertCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *MailInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *MailInsertCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *MailInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *MailInsertCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MailInsertCall) Fields(s ...googleapi.Field) *MailInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *MailInsertCall) Context(ctx context.Context) *MailInsertCall { + c.ctx_ = ctx + return c +} + +func (c *MailInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.mailitem) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userKey}/mail") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "emailMigration.mail.insert" call. +func (c *MailInsertCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return err + } + defer res.Body.Close() + } + return nil + // { + // "description": "Insert Mail into Google's Gmail backends", + // "httpMethod": "POST", + // "id": "emailMigration.mail.insert", + // "mediaUpload": { + // "accept": [ + // "message/rfc822" + // ], + // "maxSize": "35MB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/email/v2/users/{userKey}/mail" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/email/v2/users/{userKey}/mail" + // } + // } + // }, + // "parameterOrder": [ + // "userKey" + // ], + // "parameters": { + // "userKey": { + // "description": "The email or immutable id of the user", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userKey}/mail", + // "request": { + // "$ref": "MailItem" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/email.migration" + // ], + // "supportsMediaUpload": true + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/admin/reports/v1/admin-api.json b/Godeps/_workspace/src/google.golang.org/api/admin/reports/v1/admin-api.json new file mode 100644 index 000000000..a0358be83 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/admin/reports/v1/admin-api.json @@ -0,0 +1,744 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/lycAHH8x-Ct6oDsJmcDO1AWwIZ4\"", + "discoveryVersion": "v1", + "id": "admin:reports_v1", + "name": "admin", + "canonicalName": "reports", + "version": "reports_v1", + "revision": "20150907", + "title": "Admin Reports API", + "description": "Allows the administrators of Google Apps customers to fetch reports about the usage, collaboration, security and risk for their users.", + "ownerDomain": "google.com", + "ownerName": "Google", + "packagePath": "admin", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://developers.google.com/admin-sdk/reports/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/admin/reports/v1/", + "basePath": "/admin/reports/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "admin/reports/v1/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json" + ], + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.", + "location": "query" + }, + "userIp": { + "type": "string", + "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.", + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/admin.reports.audit.readonly": { + "description": "View audit reports of Google Apps for your domain" + }, + "https://www.googleapis.com/auth/admin.reports.usage.readonly": { + "description": "View usage reports of Google Apps for your domain" + } + } + } + }, + "schemas": { + "Activities": { + "id": "Activities", + "type": "object", + "description": "JSON template for a collection of activites.", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "items": { + "type": "array", + "description": "Each record in read response.", + "items": { + "$ref": "Activity" + } + }, + "kind": { + "type": "string", + "description": "Kind of list response this is.", + "default": "admin#reports#activities" + }, + "nextPageToken": { + "type": "string", + "description": "Token for retrieving the next page" + } + } + }, + "Activity": { + "id": "Activity", + "type": "object", + "description": "JSON template for the activity resource.", + "properties": { + "actor": { + "type": "object", + "description": "User doing the action.", + "properties": { + "callerType": { + "type": "string", + "description": "User or OAuth 2LO request." + }, + "email": { + "type": "string", + "description": "Email address of the user." + }, + "key": { + "type": "string", + "description": "For OAuth 2LO API requests, consumer_key of the requestor." + }, + "profileId": { + "type": "string", + "description": "Obfuscated user id of the user." + } + } + }, + "etag": { + "type": "string", + "description": "ETag of the entry." + }, + "events": { + "type": "array", + "description": "Activity events.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of event." + }, + "parameters": { + "type": "array", + "description": "Parameter value pairs for various applications.", + "items": { + "type": "object", + "properties": { + "boolValue": { + "type": "boolean", + "description": "Boolean value of the parameter." + }, + "intValue": { + "type": "string", + "description": "Integral value of the parameter.", + "format": "int64" + }, + "multiIntValue": { + "type": "array", + "description": "Multi-int value of the parameter.", + "items": { + "type": "string", + "format": "int64" + } + }, + "multiValue": { + "type": "array", + "description": "Multi-string value of the parameter.", + "items": { + "type": "string" + } + }, + "name": { + "type": "string", + "description": "The name of the parameter." + }, + "value": { + "type": "string", + "description": "String value of the parameter." + } + } + } + }, + "type": { + "type": "string", + "description": "Type of event." + } + } + } + }, + "id": { + "type": "object", + "description": "Unique identifier for each activity record.", + "properties": { + "applicationName": { + "type": "string", + "description": "Application name to which the event belongs." + }, + "customerId": { + "type": "string", + "description": "Obfuscated customer ID of the source customer." + }, + "time": { + "type": "string", + "description": "Time of occurrence of the activity.", + "format": "date-time" + }, + "uniqueQualifier": { + "type": "string", + "description": "Unique qualifier if multiple events have the same time.", + "format": "int64" + } + } + }, + "ipAddress": { + "type": "string", + "description": "IP Address of the user doing the action." + }, + "kind": { + "type": "string", + "description": "Kind of resource this is.", + "default": "admin#reports#activity" + }, + "ownerDomain": { + "type": "string", + "description": "Domain of source customer." + } + } + }, + "Channel": { + "id": "Channel", + "type": "object", + "description": "An notification channel used to watch for resource changes.", + "properties": { + "address": { + "type": "string", + "description": "The address where notifications are delivered for this channel." + }, + "expiration": { + "type": "string", + "description": "Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "A UUID or similar unique string that identifies this channel." + }, + "kind": { + "type": "string", + "description": "Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string \"api#channel\".", + "default": "api#channel" + }, + "params": { + "type": "object", + "description": "Additional parameters controlling delivery channel behavior. Optional.", + "additionalProperties": { + "type": "string", + "description": "Declares a new parameter by name." + } + }, + "payload": { + "type": "boolean", + "description": "A Boolean value to indicate whether payload is wanted. Optional." + }, + "resourceId": { + "type": "string", + "description": "An opaque ID that identifies the resource being watched on this channel. Stable across different API versions." + }, + "resourceUri": { + "type": "string", + "description": "A version-specific identifier for the watched resource." + }, + "token": { + "type": "string", + "description": "An arbitrary string delivered to the target address with each notification delivered over this channel. Optional." + }, + "type": { + "type": "string", + "description": "The type of delivery mechanism used for this channel." + } + } + }, + "UsageReport": { + "id": "UsageReport", + "type": "object", + "description": "JSON template for a usage report.", + "properties": { + "date": { + "type": "string", + "description": "The date to which the record belongs.", + "readOnly": true + }, + "entity": { + "type": "object", + "description": "Information about the type of the item.", + "readOnly": true, + "properties": { + "customerId": { + "type": "string", + "description": "Obfuscated customer id for the record.", + "readOnly": true + }, + "profileId": { + "type": "string", + "description": "Obfuscated user id for the record.", + "readOnly": true + }, + "type": { + "type": "string", + "description": "The type of item, can be a customer or user.", + "readOnly": true + }, + "userEmail": { + "type": "string", + "description": "user's email.", + "readOnly": true + } + } + }, + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "kind": { + "type": "string", + "description": "The kind of object.", + "default": "admin#reports#usageReport" + }, + "parameters": { + "type": "array", + "description": "Parameter value pairs for various applications.", + "readOnly": true, + "items": { + "type": "object", + "properties": { + "boolValue": { + "type": "boolean", + "description": "Boolean value of the parameter.", + "readOnly": true + }, + "datetimeValue": { + "type": "string", + "description": "RFC 3339 formatted value of the parameter.", + "format": "date-time", + "readOnly": true + }, + "intValue": { + "type": "string", + "description": "Integral value of the parameter.", + "format": "int64", + "readOnly": true + }, + "msgValue": { + "type": "array", + "description": "Nested message value of the parameter.", + "readOnly": true, + "items": { + "type": "object", + "additionalProperties": { + "type": "any" + } + } + }, + "name": { + "type": "string", + "description": "The name of the parameter." + }, + "stringValue": { + "type": "string", + "description": "String value of the parameter.", + "readOnly": true + } + } + } + } + } + }, + "UsageReports": { + "id": "UsageReports", + "type": "object", + "description": "JSON template for a collection of usage reports.", + "properties": { + "etag": { + "type": "string", + "description": "ETag of the resource." + }, + "kind": { + "type": "string", + "description": "The kind of object.", + "default": "admin#reports#usageReports" + }, + "nextPageToken": { + "type": "string", + "description": "Token for retrieving the next page" + }, + "usageReports": { + "type": "array", + "description": "Various application parameter records.", + "items": { + "$ref": "UsageReport" + } + }, + "warnings": { + "type": "array", + "description": "Warnings if any.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Machine readable code / warning type." + }, + "data": { + "type": "array", + "description": "Key-Value pairs to give detailed information on the warning.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Key associated with a key-value pair to give detailed information on the warning." + }, + "value": { + "type": "string", + "description": "Value associated with a key-value pair to give detailed information on the warning." + } + } + } + }, + "message": { + "type": "string", + "description": "Human readable message for the warning." + } + } + } + } + } + } + }, + "resources": { + "activities": { + "methods": { + "list": { + "id": "reports.activities.list", + "path": "activity/users/{userKey}/applications/{applicationName}", + "httpMethod": "GET", + "description": "Retrieves a list of activities for a specific customer and application.", + "parameters": { + "actorIpAddress": { + "type": "string", + "description": "IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses.", + "location": "query" + }, + "applicationName": { + "type": "string", + "description": "Application name for which the events are to be retrieved.", + "required": true, + "pattern": "(admin)|(calendar)|(drive)|(login)|(mobile)|(token)|(groups)", + "location": "path" + }, + "customerId": { + "type": "string", + "description": "Represents the customer for which the data is to be fetched.", + "pattern": "C.+", + "location": "query" + }, + "endTime": { + "type": "string", + "description": "Return events which occured at or before this time.", + "pattern": "(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.(\\d+))?(?:(Z)|([-+])(\\d\\d):(\\d\\d))", + "location": "query" + }, + "eventName": { + "type": "string", + "description": "Name of the event being queried.", + "location": "query" + }, + "filters": { + "type": "string", + "description": "Event parameters in the form [parameter1 name][operator][parameter1 value],[parameter2 name][operator][parameter2 value],...", + "pattern": "(.+[\u003c,\u003c=,==,\u003e=,\u003e,\u003c\u003e].+,)*(.+[\u003c,\u003c=,==,\u003e=,\u003e,\u003c\u003e].+)", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Number of activity records to be shown in each page.", + "format": "int32", + "minimum": "1", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token to specify next page.", + "location": "query" + }, + "startTime": { + "type": "string", + "description": "Return events which occured at or after this time.", + "pattern": "(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.(\\d+))?(?:(Z)|([-+])(\\d\\d):(\\d\\d))", + "location": "query" + }, + "userKey": { + "type": "string", + "description": "Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for all users.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey", + "applicationName" + ], + "response": { + "$ref": "Activities" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.reports.audit.readonly" + ], + "supportsSubscription": true + }, + "watch": { + "id": "reports.activities.watch", + "path": "activity/users/{userKey}/applications/{applicationName}/watch", + "httpMethod": "POST", + "description": "Push changes to activities", + "parameters": { + "actorIpAddress": { + "type": "string", + "description": "IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses.", + "location": "query" + }, + "applicationName": { + "type": "string", + "description": "Application name for which the events are to be retrieved.", + "required": true, + "pattern": "(admin)|(calendar)|(drive)|(login)|(mobile)|(token)|(groups)", + "location": "path" + }, + "customerId": { + "type": "string", + "description": "Represents the customer for which the data is to be fetched.", + "pattern": "C.+", + "location": "query" + }, + "endTime": { + "type": "string", + "description": "Return events which occured at or before this time.", + "pattern": "(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.(\\d+))?(?:(Z)|([-+])(\\d\\d):(\\d\\d))", + "location": "query" + }, + "eventName": { + "type": "string", + "description": "Name of the event being queried.", + "location": "query" + }, + "filters": { + "type": "string", + "description": "Event parameters in the form [parameter1 name][operator][parameter1 value],[parameter2 name][operator][parameter2 value],...", + "pattern": "(.+[\u003c,\u003c=,==,\u003e=,\u003e,\u003c\u003e].+,)*(.+[\u003c,\u003c=,==,\u003e=,\u003e,\u003c\u003e].+)", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Number of activity records to be shown in each page.", + "format": "int32", + "minimum": "1", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token to specify next page.", + "location": "query" + }, + "startTime": { + "type": "string", + "description": "Return events which occured at or after this time.", + "pattern": "(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.(\\d+))?(?:(Z)|([-+])(\\d\\d):(\\d\\d))", + "location": "query" + }, + "userKey": { + "type": "string", + "description": "Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for all users.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey", + "applicationName" + ], + "request": { + "$ref": "Channel", + "parameterName": "resource" + }, + "response": { + "$ref": "Channel" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.reports.audit.readonly" + ], + "supportsSubscription": true + } + } + }, + "channels": { + "methods": { + "stop": { + "id": "admin.channels.stop", + "path": "/admin/reports_v1/channels/stop", + "httpMethod": "POST", + "description": "Stop watching resources through this channel", + "request": { + "$ref": "Channel", + "parameterName": "resource" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.reports.audit.readonly" + ] + } + } + }, + "customerUsageReports": { + "methods": { + "get": { + "id": "reports.customerUsageReports.get", + "path": "usage/dates/{date}", + "httpMethod": "GET", + "description": "Retrieves a report which is a collection of properties / statistics for a specific customer.", + "parameters": { + "customerId": { + "type": "string", + "description": "Represents the customer for which the data is to be fetched.", + "pattern": "C.+", + "location": "query" + }, + "date": { + "type": "string", + "description": "Represents the date in yyyy-mm-dd format for which the data is to be fetched.", + "required": true, + "pattern": "(\\d){4}-(\\d){2}-(\\d){2}", + "location": "path" + }, + "pageToken": { + "type": "string", + "description": "Token to specify next page.", + "location": "query" + }, + "parameters": { + "type": "string", + "description": "Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2.", + "pattern": "(((accounts)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)):.+,)*(((accounts)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)):.+)", + "location": "query" + } + }, + "parameterOrder": [ + "date" + ], + "response": { + "$ref": "UsageReports" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.reports.usage.readonly" + ] + } + } + }, + "userUsageReport": { + "methods": { + "get": { + "id": "reports.userUsageReport.get", + "path": "usage/users/{userKey}/dates/{date}", + "httpMethod": "GET", + "description": "Retrieves a report which is a collection of properties / statistics for a set of users.", + "parameters": { + "customerId": { + "type": "string", + "description": "Represents the customer for which the data is to be fetched.", + "pattern": "C.+", + "location": "query" + }, + "date": { + "type": "string", + "description": "Represents the date in yyyy-mm-dd format for which the data is to be fetched.", + "required": true, + "pattern": "(\\d){4}-(\\d){2}-(\\d){2}", + "location": "path" + }, + "filters": { + "type": "string", + "description": "Represents the set of filters including parameter operator value.", + "pattern": "(((accounts)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)):.+[\u003c,\u003c=,==,\u003e=,\u003e,!=].+,)*(((accounts)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)):.+[\u003c,\u003c=,==,\u003e=,\u003e,!=].+)", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return. Maximum allowed is 1000", + "format": "uint32", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token to specify next page.", + "location": "query" + }, + "parameters": { + "type": "string", + "description": "Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2.", + "pattern": "(((accounts)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)):.+,)*(((accounts)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)):.+)", + "location": "query" + }, + "userKey": { + "type": "string", + "description": "Represents the profile id or the user email for which the data should be filtered.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userKey", + "date" + ], + "response": { + "$ref": "UsageReports" + }, + "scopes": [ + "https://www.googleapis.com/auth/admin.reports.usage.readonly" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/admin/reports/v1/admin-gen.go b/Godeps/_workspace/src/google.golang.org/api/admin/reports/v1/admin-gen.go new file mode 100644 index 000000000..3ed847b19 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/admin/reports/v1/admin-gen.go @@ -0,0 +1,1565 @@ +// Package admin provides access to the Admin Reports API. +// +// See https://developers.google.com/admin-sdk/reports/ +// +// Usage example: +// +// import "google.golang.org/api/admin/reports/v1" +// ... +// adminService, err := admin.New(oauthHttpClient) +package admin // import "google.golang.org/api/admin/reports/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Activities *ActivitiesService + + Channels *ChannelsService + + CustomerUsageReports *CustomerUsageReportsService + + UserUsageReport *UserUsageReportService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewActivitiesService(s *Service) *ActivitiesService { + rs := &ActivitiesService{s: s} + return rs +} + +type ActivitiesService struct { + s *Service +} + +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 +} + +// Activities: JSON template for a collection of activites. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Activities) MarshalJSON() ([]byte, error) { + type noMethod Activities + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Activity: JSON template for the activity resource. +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"` + + // ForceSendFields is a list of field names (e.g. "Actor") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Activity) MarshalJSON() ([]byte, error) { + type noMethod Activity + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityActor: User doing the action. +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"` + + // ForceSendFields is a list of field names (e.g. "CallerType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityActor) MarshalJSON() ([]byte, error) { + type noMethod ActivityActor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityEvents) MarshalJSON() ([]byte, error) { + type noMethod ActivityEvents + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // MultiIntValue: Multi-int value of the parameter. + MultiIntValue googleapi.Int64s `json:"multiIntValue,omitempty"` + + // MultiValue: Multi-string value of the parameter. + MultiValue []string `json:"multiValue,omitempty"` + + // Name: The name of the parameter. + Name string `json:"name,omitempty"` + + // Value: String value of the parameter. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BoolValue") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityEventsParameters) MarshalJSON() ([]byte, error) { + type noMethod ActivityEventsParameters + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityId: Unique identifier for each activity record. +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"` + + // ForceSendFields is a list of field names (e.g. "ApplicationName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityId) MarshalJSON() ([]byte, error) { + type noMethod ActivityId + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Channel: An notification channel used to watch for resource changes. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Address") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Channel) MarshalJSON() ([]byte, error) { + type noMethod Channel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UsageReport: JSON template for a usage report. +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"` + + // ForceSendFields is a list of field names (e.g. "Date") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UsageReport) MarshalJSON() ([]byte, error) { + type noMethod UsageReport + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UsageReportEntity: Information about the type of the item. +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"` + + // ForceSendFields is a list of field names (e.g. "CustomerId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UsageReportEntity) MarshalJSON() ([]byte, error) { + type noMethod UsageReportEntity + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "BoolValue") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UsageReportParameters) MarshalJSON() ([]byte, error) { + type noMethod UsageReportParameters + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type UsageReportParametersMsgValue interface{} + +// UsageReports: JSON template for a collection of usage reports. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UsageReports) MarshalJSON() ([]byte, error) { + type noMethod UsageReports + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UsageReportsWarnings) MarshalJSON() ([]byte, error) { + type noMethod UsageReportsWarnings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UsageReportsWarningsData) MarshalJSON() ([]byte, error) { + type noMethod UsageReportsWarningsData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "reports.activities.list": + +type ActivitiesListCall struct { + s *Service + userKey string + applicationName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ActivitiesListCall) Fields(s ...googleapi.Field) *ActivitiesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ActivitiesListCall) IfNoneMatch(entityTag string) *ActivitiesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ActivitiesListCall) Context(ctx context.Context) *ActivitiesListCall { + c.ctx_ = ctx + return c +} + +func (c *ActivitiesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "activity/users/{userKey}/applications/{applicationName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + "applicationName": c.applicationName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reports.activities.list" call. +// Exactly one of *Activities or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Activities.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ActivitiesListCall) Do() (*Activities, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Activities{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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)|(calendar)|(drive)|(login)|(mobile)|(token)|(groups)", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ActivitiesWatchCall) Fields(s ...googleapi.Field) *ActivitiesWatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ActivitiesWatchCall) Context(ctx context.Context) *ActivitiesWatchCall { + c.ctx_ = ctx + return c +} + +func (c *ActivitiesWatchCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + "applicationName": c.applicationName, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reports.activities.watch" call. +// Exactly one of *Channel or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Channel.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ActivitiesWatchCall) Do() (*Channel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Channel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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)|(calendar)|(drive)|(login)|(mobile)|(token)|(groups)", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall { + c.ctx_ = ctx + return c +} + +func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "admin.channels.stop" call. +func (c *ChannelsStopCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomerUsageReportsGetCall) Fields(s ...googleapi.Field) *CustomerUsageReportsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CustomerUsageReportsGetCall) IfNoneMatch(entityTag string) *CustomerUsageReportsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomerUsageReportsGetCall) Context(ctx context.Context) *CustomerUsageReportsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CustomerUsageReportsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "usage/dates/{date}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "date": c.date, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reports.customerUsageReports.get" call. +// Exactly one of *UsageReports or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UsageReports.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CustomerUsageReportsGetCall) Do() (*UsageReports, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UsageReports{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)):.+,)*(((accounts)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)):.+)", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserUsageReportGetCall) Fields(s ...googleapi.Field) *UserUsageReportGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserUsageReportGetCall) IfNoneMatch(entityTag string) *UserUsageReportGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserUsageReportGetCall) Context(ctx context.Context) *UserUsageReportGetCall { + c.ctx_ = ctx + return c +} + +func (c *UserUsageReportGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "usage/users/{userKey}/dates/{date}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userKey": c.userKey, + "date": c.date, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reports.userUsageReport.get" call. +// Exactly one of *UsageReports or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UsageReports.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserUsageReportGetCall) Do() (*UsageReports, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UsageReports{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)):.+[\u003c,\u003c=,==,\u003e=,\u003e,!=].+,)*(((accounts)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)):.+[\u003c,\u003c=,==,\u003e=,\u003e,!=].+)", + // "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)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)):.+,)*(((accounts)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)):.+)", + // "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/Godeps/_workspace/src/google.golang.org/api/adsense/v1.2/adsense-api.json b/Godeps/_workspace/src/google.golang.org/api/adsense/v1.2/adsense-api.json new file mode 100644 index 000000000..5e8ef7c8f --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/adsense/v1.2/adsense-api.json @@ -0,0 +1,1949 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/4sbh2CScTU4USzSvCohsjZ1YVxQ\"", + "discoveryVersion": "v1", + "id": "adsense:v1.2", + "name": "adsense", + "canonicalName": "AdSense", + "version": "v1.2", + "revision": "20141218", + "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": "https://www.google.com/images/icons/product/adsense-16.png", + "x32": "https://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/Godeps/_workspace/src/google.golang.org/api/adsense/v1.2/adsense-gen.go b/Godeps/_workspace/src/google.golang.org/api/adsense/v1.2/adsense-gen.go new file mode 100644 index 000000000..7fe175b98 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/adsense/v1.2/adsense-gen.go @@ -0,0 +1,5950 @@ +// Package adsense provides access to the AdSense Management API. +// +// See https://developers.google.com/adsense/management/ +// +// Usage example: +// +// import "google.golang.org/api/adsense/v1.2" +// ... +// adsenseService, err := adsense.New(oauthHttpClient) +package adsense // import "google.golang.org/api/adsense/v1.2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Accounts *AccountsService + + Adclients *AdclientsService + + Adunits *AdunitsService + + Customchannels *CustomchannelsService + + Reports *ReportsService + + Savedadstyles *SavedadstylesService + + Urlchannels *UrlchannelsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Account) MarshalJSON() ([]byte, error) { + type noMethod Account + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Accounts) MarshalJSON() ([]byte, error) { + type noMethod Accounts + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "ArcOptIn") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdClient) MarshalJSON() ([]byte, error) { + type noMethod AdClient + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdClients) MarshalJSON() ([]byte, error) { + type noMethod AdClients + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Colors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdStyle) MarshalJSON() ([]byte, error) { + type noMethod AdStyle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdStyleColors: 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. +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"` + + // ForceSendFields is a list of field names (e.g. "Background") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdStyleColors) MarshalJSON() ([]byte, error) { + type noMethod AdStyleColors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdStyleFont: The font which is included in the style. +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"` + + // ForceSendFields is a list of field names (e.g. "Family") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdStyleFont) MarshalJSON() ([]byte, error) { + type noMethod AdStyleFont + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnit) MarshalJSON() ([]byte, error) { + type noMethod AdUnit + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdUnitContentAdsSettings: Settings specific to content ads (AFC) and +// highend mobile content ads (AFMC). +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"` + + // ForceSendFields is a list of field names (e.g. "BackupOption") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnitContentAdsSettings) MarshalJSON() ([]byte, error) { + type noMethod AdUnitContentAdsSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdUnitContentAdsSettingsBackupOption: The backup option to be used in +// instances where no ad is available. +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"` + + // ForceSendFields is a list of field names (e.g. "Color") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnitContentAdsSettingsBackupOption) MarshalJSON() ([]byte, error) { + type noMethod AdUnitContentAdsSettingsBackupOption + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdUnitFeedAdsSettings: Settings specific to feed ads (AFF). +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"` + + // ForceSendFields is a list of field names (e.g. "AdPosition") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnitFeedAdsSettings) MarshalJSON() ([]byte, error) { + type noMethod AdUnitFeedAdsSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdUnitMobileContentAdsSettings: Settings specific to WAP mobile +// content ads (AFMC). +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"` + + // ForceSendFields is a list of field names (e.g. "MarkupLanguage") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnitMobileContentAdsSettings) MarshalJSON() ([]byte, error) { + type noMethod AdUnitMobileContentAdsSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnits) MarshalJSON() ([]byte, error) { + type noMethod AdUnits + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Averages") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdsenseReportsGenerateResponse) MarshalJSON() ([]byte, error) { + type noMethod AdsenseReportsGenerateResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Currency") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdsenseReportsGenerateResponseHeaders) MarshalJSON() ([]byte, error) { + type noMethod AdsenseReportsGenerateResponseHeaders + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomChannel) MarshalJSON() ([]byte, error) { + type noMethod CustomChannel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomChannelTargetingInfo: The targeting information of this custom +// channel, if activated. +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"` + + // ForceSendFields is a list of field names (e.g. "AdsAppearOn") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomChannelTargetingInfo) MarshalJSON() ([]byte, error) { + type noMethod CustomChannelTargetingInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomChannels) MarshalJSON() ([]byte, error) { + type noMethod CustomChannels + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AdStyle") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SavedAdStyle) MarshalJSON() ([]byte, error) { + type noMethod SavedAdStyle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SavedAdStyles) MarshalJSON() ([]byte, error) { + type noMethod SavedAdStyles + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SavedReport) MarshalJSON() ([]byte, error) { + type noMethod SavedReport + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SavedReports) MarshalJSON() ([]byte, error) { + type noMethod SavedReports + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlChannel) MarshalJSON() ([]byte, error) { + type noMethod UrlChannel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlChannels) MarshalJSON() ([]byte, error) { + type noMethod UrlChannels + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "adsense.accounts.get": + +type AccountsGetCall struct { + s *Service + accountId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["tree"]; ok { + params.Set("tree", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.get" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsGetCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.list" call. +// Exactly one of *Accounts or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Accounts.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsListCall) Do() (*Accounts, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Accounts{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAdclientsListCall) Fields(s ...googleapi.Field) *AccountsAdclientsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsAdclientsListCall) IfNoneMatch(entityTag string) *AccountsAdclientsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAdclientsListCall) Context(ctx context.Context) *AccountsAdclientsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAdclientsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.adclients.list" call. +// Exactly one of *AdClients or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AdClients.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsAdclientsListCall) Do() (*AdClients, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdClients{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAdunitsGetCall) Fields(s ...googleapi.Field) *AccountsAdunitsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsAdunitsGetCall) IfNoneMatch(entityTag string) *AccountsAdunitsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAdunitsGetCall) Context(ctx context.Context) *AccountsAdunitsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAdunitsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + "adUnitId": c.adUnitId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.adunits.get" call. +// Exactly one of *AdUnit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsAdunitsGetCall) Do() (*AdUnit, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAdunitsListCall) Fields(s ...googleapi.Field) *AccountsAdunitsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsAdunitsListCall) IfNoneMatch(entityTag string) *AccountsAdunitsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAdunitsListCall) Context(ctx context.Context) *AccountsAdunitsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAdunitsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.adunits.list" call. +// Exactly one of *AdUnits or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnits.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsAdunitsListCall) Do() (*AdUnits, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnits{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAdunitsCustomchannelsListCall) Fields(s ...googleapi.Field) *AccountsAdunitsCustomchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsAdunitsCustomchannelsListCall) IfNoneMatch(entityTag string) *AccountsAdunitsCustomchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAdunitsCustomchannelsListCall) Context(ctx context.Context) *AccountsAdunitsCustomchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAdunitsCustomchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + "adUnitId": c.adUnitId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.adunits.customchannels.list" call. +// Exactly one of *CustomChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannels.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsAdunitsCustomchannelsListCall) Do() (*CustomChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsCustomchannelsGetCall) Fields(s ...googleapi.Field) *AccountsCustomchannelsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsCustomchannelsGetCall) IfNoneMatch(entityTag string) *AccountsCustomchannelsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsCustomchannelsGetCall) Context(ctx context.Context) *AccountsCustomchannelsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsCustomchannelsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + "customChannelId": c.customChannelId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.customchannels.get" call. +// Exactly one of *CustomChannel or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannel.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsCustomchannelsGetCall) Do() (*CustomChannel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsCustomchannelsListCall) Fields(s ...googleapi.Field) *AccountsCustomchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsCustomchannelsListCall) IfNoneMatch(entityTag string) *AccountsCustomchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsCustomchannelsListCall) Context(ctx context.Context) *AccountsCustomchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsCustomchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.customchannels.list" call. +// Exactly one of *CustomChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannels.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsCustomchannelsListCall) Do() (*CustomChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsCustomchannelsAdunitsListCall) Fields(s ...googleapi.Field) *AccountsCustomchannelsAdunitsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsCustomchannelsAdunitsListCall) IfNoneMatch(entityTag string) *AccountsCustomchannelsAdunitsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsCustomchannelsAdunitsListCall) Context(ctx context.Context) *AccountsCustomchannelsAdunitsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsCustomchannelsAdunitsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + "customChannelId": c.customChannelId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.customchannels.adunits.list" call. +// Exactly one of *AdUnits or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnits.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsCustomchannelsAdunitsListCall) Do() (*AdUnits, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnits{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsReportsGenerateCall) Fields(s ...googleapi.Field) *AccountsReportsGenerateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsReportsGenerateCall) IfNoneMatch(entityTag string) *AccountsReportsGenerateCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsReportsGenerateCall) Context(ctx context.Context) *AccountsReportsGenerateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsReportsGenerateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *AccountsReportsGenerateCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "adsense.accounts.reports.generate" call. +// Exactly one of *AdsenseReportsGenerateResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AdsenseReportsGenerateResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsReportsGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdsenseReportsGenerateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsReportsSavedGenerateCall) Fields(s ...googleapi.Field) *AccountsReportsSavedGenerateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsReportsSavedGenerateCall) IfNoneMatch(entityTag string) *AccountsReportsSavedGenerateCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsReportsSavedGenerateCall) Context(ctx context.Context) *AccountsReportsSavedGenerateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsReportsSavedGenerateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports/{savedReportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "savedReportId": c.savedReportId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.reports.saved.generate" call. +// Exactly one of *AdsenseReportsGenerateResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AdsenseReportsGenerateResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsReportsSavedGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdsenseReportsGenerateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsReportsSavedListCall) Fields(s ...googleapi.Field) *AccountsReportsSavedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsReportsSavedListCall) IfNoneMatch(entityTag string) *AccountsReportsSavedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsReportsSavedListCall) Context(ctx context.Context) *AccountsReportsSavedListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsReportsSavedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports/saved") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.reports.saved.list" call. +// Exactly one of *SavedReports or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SavedReports.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsReportsSavedListCall) Do() (*SavedReports, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SavedReports{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsSavedadstylesGetCall) Fields(s ...googleapi.Field) *AccountsSavedadstylesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsSavedadstylesGetCall) IfNoneMatch(entityTag string) *AccountsSavedadstylesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsSavedadstylesGetCall) Context(ctx context.Context) *AccountsSavedadstylesGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsSavedadstylesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/savedadstyles/{savedAdStyleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "savedAdStyleId": c.savedAdStyleId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.savedadstyles.get" call. +// Exactly one of *SavedAdStyle or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SavedAdStyle.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsSavedadstylesGetCall) Do() (*SavedAdStyle, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SavedAdStyle{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsSavedadstylesListCall) Fields(s ...googleapi.Field) *AccountsSavedadstylesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsSavedadstylesListCall) IfNoneMatch(entityTag string) *AccountsSavedadstylesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsSavedadstylesListCall) Context(ctx context.Context) *AccountsSavedadstylesListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsSavedadstylesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/savedadstyles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.savedadstyles.list" call. +// Exactly one of *SavedAdStyles or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SavedAdStyles.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsSavedadstylesListCall) Do() (*SavedAdStyles, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SavedAdStyles{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsUrlchannelsListCall) Fields(s ...googleapi.Field) *AccountsUrlchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsUrlchannelsListCall) IfNoneMatch(entityTag string) *AccountsUrlchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsUrlchannelsListCall) Context(ctx context.Context) *AccountsUrlchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsUrlchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/urlchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.urlchannels.list" call. +// Exactly one of *UrlChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UrlChannels.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsUrlchannelsListCall) Do() (*UrlChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UrlChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdclientsListCall) Fields(s ...googleapi.Field) *AdclientsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdclientsListCall) IfNoneMatch(entityTag string) *AdclientsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdclientsListCall) Context(ctx context.Context) *AdclientsListCall { + c.ctx_ = ctx + return c +} + +func (c *AdclientsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.adclients.list" call. +// Exactly one of *AdClients or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AdClients.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AdclientsListCall) Do() (*AdClients, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdClients{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdunitsGetCall) Fields(s ...googleapi.Field) *AdunitsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdunitsGetCall) IfNoneMatch(entityTag string) *AdunitsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdunitsGetCall) Context(ctx context.Context) *AdunitsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AdunitsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + "adUnitId": c.adUnitId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.adunits.get" call. +// Exactly one of *AdUnit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AdunitsGetCall) Do() (*AdUnit, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdunitsListCall) Fields(s ...googleapi.Field) *AdunitsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdunitsListCall) IfNoneMatch(entityTag string) *AdunitsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdunitsListCall) Context(ctx context.Context) *AdunitsListCall { + c.ctx_ = ctx + return c +} + +func (c *AdunitsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.adunits.list" call. +// Exactly one of *AdUnits or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnits.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AdunitsListCall) Do() (*AdUnits, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnits{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdunitsCustomchannelsListCall) Fields(s ...googleapi.Field) *AdunitsCustomchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdunitsCustomchannelsListCall) IfNoneMatch(entityTag string) *AdunitsCustomchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdunitsCustomchannelsListCall) Context(ctx context.Context) *AdunitsCustomchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *AdunitsCustomchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + "adUnitId": c.adUnitId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.adunits.customchannels.list" call. +// Exactly one of *CustomChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannels.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AdunitsCustomchannelsListCall) Do() (*CustomChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomchannelsGetCall) Fields(s ...googleapi.Field) *CustomchannelsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CustomchannelsGetCall) IfNoneMatch(entityTag string) *CustomchannelsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomchannelsGetCall) Context(ctx context.Context) *CustomchannelsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CustomchannelsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + "customChannelId": c.customChannelId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.customchannels.get" call. +// Exactly one of *CustomChannel or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannel.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CustomchannelsGetCall) Do() (*CustomChannel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomchannelsListCall) Fields(s ...googleapi.Field) *CustomchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CustomchannelsListCall) IfNoneMatch(entityTag string) *CustomchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomchannelsListCall) Context(ctx context.Context) *CustomchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *CustomchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.customchannels.list" call. +// Exactly one of *CustomChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannels.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CustomchannelsListCall) Do() (*CustomChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomchannelsAdunitsListCall) Fields(s ...googleapi.Field) *CustomchannelsAdunitsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CustomchannelsAdunitsListCall) IfNoneMatch(entityTag string) *CustomchannelsAdunitsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomchannelsAdunitsListCall) Context(ctx context.Context) *CustomchannelsAdunitsListCall { + c.ctx_ = ctx + return c +} + +func (c *CustomchannelsAdunitsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + "customChannelId": c.customChannelId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.customchannels.adunits.list" call. +// Exactly one of *AdUnits or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnits.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CustomchannelsAdunitsListCall) Do() (*AdUnits, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnits{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsGenerateCall) Fields(s ...googleapi.Field) *ReportsGenerateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsGenerateCall) IfNoneMatch(entityTag string) *ReportsGenerateCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsGenerateCall) Context(ctx context.Context) *ReportsGenerateCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsGenerateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *ReportsGenerateCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "adsense.reports.generate" call. +// Exactly one of *AdsenseReportsGenerateResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AdsenseReportsGenerateResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReportsGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdsenseReportsGenerateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsSavedGenerateCall) Fields(s ...googleapi.Field) *ReportsSavedGenerateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsSavedGenerateCall) IfNoneMatch(entityTag string) *ReportsSavedGenerateCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsSavedGenerateCall) Context(ctx context.Context) *ReportsSavedGenerateCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsSavedGenerateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{savedReportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "savedReportId": c.savedReportId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.reports.saved.generate" call. +// Exactly one of *AdsenseReportsGenerateResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AdsenseReportsGenerateResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReportsSavedGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdsenseReportsGenerateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsSavedListCall) Fields(s ...googleapi.Field) *ReportsSavedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsSavedListCall) IfNoneMatch(entityTag string) *ReportsSavedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsSavedListCall) Context(ctx context.Context) *ReportsSavedListCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsSavedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/saved") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.reports.saved.list" call. +// Exactly one of *SavedReports or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SavedReports.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReportsSavedListCall) Do() (*SavedReports, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SavedReports{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SavedadstylesGetCall) Fields(s ...googleapi.Field) *SavedadstylesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SavedadstylesGetCall) IfNoneMatch(entityTag string) *SavedadstylesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SavedadstylesGetCall) Context(ctx context.Context) *SavedadstylesGetCall { + c.ctx_ = ctx + return c +} + +func (c *SavedadstylesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "savedadstyles/{savedAdStyleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "savedAdStyleId": c.savedAdStyleId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.savedadstyles.get" call. +// Exactly one of *SavedAdStyle or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SavedAdStyle.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SavedadstylesGetCall) Do() (*SavedAdStyle, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SavedAdStyle{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SavedadstylesListCall) Fields(s ...googleapi.Field) *SavedadstylesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SavedadstylesListCall) IfNoneMatch(entityTag string) *SavedadstylesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SavedadstylesListCall) Context(ctx context.Context) *SavedadstylesListCall { + c.ctx_ = ctx + return c +} + +func (c *SavedadstylesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "savedadstyles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.savedadstyles.list" call. +// Exactly one of *SavedAdStyles or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SavedAdStyles.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SavedadstylesListCall) Do() (*SavedAdStyles, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SavedAdStyles{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlchannelsListCall) Fields(s ...googleapi.Field) *UrlchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UrlchannelsListCall) IfNoneMatch(entityTag string) *UrlchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlchannelsListCall) Context(ctx context.Context) *UrlchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *UrlchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/urlchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.urlchannels.list" call. +// Exactly one of *UrlChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UrlChannels.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UrlchannelsListCall) Do() (*UrlChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UrlChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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/Godeps/_workspace/src/google.golang.org/api/adsense/v1.3/adsense-api.json b/Godeps/_workspace/src/google.golang.org/api/adsense/v1.3/adsense-api.json new file mode 100644 index 000000000..1bcbaef88 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/adsense/v1.3/adsense-api.json @@ -0,0 +1,2250 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/gTf3J_Tcqy5jzBteF-x9VlOxF-c\"", + "discoveryVersion": "v1", + "id": "adsense:v1.3", + "name": "adsense", + "canonicalName": "AdSense", + "version": "v1.3", + "revision": "20141218", + "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": "https://www.google.com/images/icons/product/adsense-16.png", + "x32": "https://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/Godeps/_workspace/src/google.golang.org/api/adsense/v1.3/adsense-gen.go b/Godeps/_workspace/src/google.golang.org/api/adsense/v1.3/adsense-gen.go new file mode 100644 index 000000000..a6c05b9df --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/adsense/v1.3/adsense-gen.go @@ -0,0 +1,6995 @@ +// Package adsense provides access to the AdSense Management API. +// +// See https://developers.google.com/adsense/management/ +// +// Usage example: +// +// import "google.golang.org/api/adsense/v1.3" +// ... +// adsenseService, err := adsense.New(oauthHttpClient) +package adsense // import "google.golang.org/api/adsense/v1.3" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Accounts *AccountsService + + Adclients *AdclientsService + + Adunits *AdunitsService + + Alerts *AlertsService + + Customchannels *CustomchannelsService + + Metadata *MetadataService + + Reports *ReportsService + + Savedadstyles *SavedadstylesService + + Urlchannels *UrlchannelsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Account) MarshalJSON() ([]byte, error) { + type noMethod Account + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Accounts) MarshalJSON() ([]byte, error) { + type noMethod Accounts + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "ArcOptIn") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdClient) MarshalJSON() ([]byte, error) { + type noMethod AdClient + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdClients) MarshalJSON() ([]byte, error) { + type noMethod AdClients + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AdCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdCode) MarshalJSON() ([]byte, error) { + type noMethod AdCode + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Colors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdStyle) MarshalJSON() ([]byte, error) { + type noMethod AdStyle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdStyleColors: 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. +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"` + + // ForceSendFields is a list of field names (e.g. "Background") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdStyleColors) MarshalJSON() ([]byte, error) { + type noMethod AdStyleColors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdStyleFont: The font which is included in the style. +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"` + + // ForceSendFields is a list of field names (e.g. "Family") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdStyleFont) MarshalJSON() ([]byte, error) { + type noMethod AdStyleFont + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnit) MarshalJSON() ([]byte, error) { + type noMethod AdUnit + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdUnitContentAdsSettings: Settings specific to content ads (AFC) and +// highend mobile content ads (AFMC). +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"` + + // ForceSendFields is a list of field names (e.g. "BackupOption") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnitContentAdsSettings) MarshalJSON() ([]byte, error) { + type noMethod AdUnitContentAdsSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdUnitContentAdsSettingsBackupOption: The backup option to be used in +// instances where no ad is available. +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"` + + // ForceSendFields is a list of field names (e.g. "Color") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnitContentAdsSettingsBackupOption) MarshalJSON() ([]byte, error) { + type noMethod AdUnitContentAdsSettingsBackupOption + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdUnitFeedAdsSettings: Settings specific to feed ads (AFF). +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"` + + // ForceSendFields is a list of field names (e.g. "AdPosition") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnitFeedAdsSettings) MarshalJSON() ([]byte, error) { + type noMethod AdUnitFeedAdsSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdUnitMobileContentAdsSettings: Settings specific to WAP mobile +// content ads (AFMC). +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"` + + // ForceSendFields is a list of field names (e.g. "MarkupLanguage") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnitMobileContentAdsSettings) MarshalJSON() ([]byte, error) { + type noMethod AdUnitMobileContentAdsSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnits) MarshalJSON() ([]byte, error) { + type noMethod AdUnits + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Averages") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdsenseReportsGenerateResponse) MarshalJSON() ([]byte, error) { + type noMethod AdsenseReportsGenerateResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Currency") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdsenseReportsGenerateResponseHeaders) MarshalJSON() ([]byte, error) { + type noMethod AdsenseReportsGenerateResponseHeaders + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Alert) MarshalJSON() ([]byte, error) { + type noMethod Alert + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Alerts) MarshalJSON() ([]byte, error) { + type noMethod Alerts + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomChannel) MarshalJSON() ([]byte, error) { + type noMethod CustomChannel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomChannelTargetingInfo: The targeting information of this custom +// channel, if activated. +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"` + + // ForceSendFields is a list of field names (e.g. "AdsAppearOn") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomChannelTargetingInfo) MarshalJSON() ([]byte, error) { + type noMethod CustomChannelTargetingInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomChannels) MarshalJSON() ([]byte, error) { + type noMethod CustomChannels + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Metadata struct { + Items []*ReportingMetadataEntry `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#metadata. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Metadata) MarshalJSON() ([]byte, error) { + type noMethod Metadata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. + // "CompatibleDimensions") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportingMetadataEntry) MarshalJSON() ([]byte, error) { + type noMethod ReportingMetadataEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AdStyle") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SavedAdStyle) MarshalJSON() ([]byte, error) { + type noMethod SavedAdStyle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SavedAdStyles) MarshalJSON() ([]byte, error) { + type noMethod SavedAdStyles + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SavedReport) MarshalJSON() ([]byte, error) { + type noMethod SavedReport + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SavedReports) MarshalJSON() ([]byte, error) { + type noMethod SavedReports + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlChannel) MarshalJSON() ([]byte, error) { + type noMethod UrlChannel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlChannels) MarshalJSON() ([]byte, error) { + type noMethod UrlChannels + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "adsense.accounts.get": + +type AccountsGetCall struct { + s *Service + accountId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["tree"]; ok { + params.Set("tree", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.get" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsGetCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.list" call. +// Exactly one of *Accounts or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Accounts.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsListCall) Do() (*Accounts, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Accounts{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAdclientsListCall) Fields(s ...googleapi.Field) *AccountsAdclientsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsAdclientsListCall) IfNoneMatch(entityTag string) *AccountsAdclientsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAdclientsListCall) Context(ctx context.Context) *AccountsAdclientsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAdclientsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.adclients.list" call. +// Exactly one of *AdClients or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AdClients.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsAdclientsListCall) Do() (*AdClients, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdClients{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAdunitsGetCall) Fields(s ...googleapi.Field) *AccountsAdunitsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsAdunitsGetCall) IfNoneMatch(entityTag string) *AccountsAdunitsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAdunitsGetCall) Context(ctx context.Context) *AccountsAdunitsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAdunitsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + "adUnitId": c.adUnitId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.adunits.get" call. +// Exactly one of *AdUnit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsAdunitsGetCall) Do() (*AdUnit, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAdunitsGetAdCodeCall) Fields(s ...googleapi.Field) *AccountsAdunitsGetAdCodeCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsAdunitsGetAdCodeCall) IfNoneMatch(entityTag string) *AccountsAdunitsGetAdCodeCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAdunitsGetAdCodeCall) Context(ctx context.Context) *AccountsAdunitsGetAdCodeCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAdunitsGetAdCodeCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/adcode") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + "adUnitId": c.adUnitId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.adunits.getAdCode" call. +// Exactly one of *AdCode or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdCode.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsAdunitsGetAdCodeCall) Do() (*AdCode, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdCode{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAdunitsListCall) Fields(s ...googleapi.Field) *AccountsAdunitsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsAdunitsListCall) IfNoneMatch(entityTag string) *AccountsAdunitsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAdunitsListCall) Context(ctx context.Context) *AccountsAdunitsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAdunitsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.adunits.list" call. +// Exactly one of *AdUnits or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnits.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsAdunitsListCall) Do() (*AdUnits, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnits{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAdunitsCustomchannelsListCall) Fields(s ...googleapi.Field) *AccountsAdunitsCustomchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsAdunitsCustomchannelsListCall) IfNoneMatch(entityTag string) *AccountsAdunitsCustomchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAdunitsCustomchannelsListCall) Context(ctx context.Context) *AccountsAdunitsCustomchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAdunitsCustomchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + "adUnitId": c.adUnitId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.adunits.customchannels.list" call. +// Exactly one of *CustomChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannels.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsAdunitsCustomchannelsListCall) Do() (*CustomChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAlertsListCall) Fields(s ...googleapi.Field) *AccountsAlertsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsAlertsListCall) IfNoneMatch(entityTag string) *AccountsAlertsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAlertsListCall) Context(ctx context.Context) *AccountsAlertsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAlertsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/alerts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.alerts.list" call. +// Exactly one of *Alerts or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Alerts.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsAlertsListCall) Do() (*Alerts, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Alerts{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsCustomchannelsGetCall) Fields(s ...googleapi.Field) *AccountsCustomchannelsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsCustomchannelsGetCall) IfNoneMatch(entityTag string) *AccountsCustomchannelsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsCustomchannelsGetCall) Context(ctx context.Context) *AccountsCustomchannelsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsCustomchannelsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + "customChannelId": c.customChannelId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.customchannels.get" call. +// Exactly one of *CustomChannel or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannel.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsCustomchannelsGetCall) Do() (*CustomChannel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsCustomchannelsListCall) Fields(s ...googleapi.Field) *AccountsCustomchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsCustomchannelsListCall) IfNoneMatch(entityTag string) *AccountsCustomchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsCustomchannelsListCall) Context(ctx context.Context) *AccountsCustomchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsCustomchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.customchannels.list" call. +// Exactly one of *CustomChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannels.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsCustomchannelsListCall) Do() (*CustomChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsCustomchannelsAdunitsListCall) Fields(s ...googleapi.Field) *AccountsCustomchannelsAdunitsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsCustomchannelsAdunitsListCall) IfNoneMatch(entityTag string) *AccountsCustomchannelsAdunitsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsCustomchannelsAdunitsListCall) Context(ctx context.Context) *AccountsCustomchannelsAdunitsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsCustomchannelsAdunitsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + "customChannelId": c.customChannelId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.customchannels.adunits.list" call. +// Exactly one of *AdUnits or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnits.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsCustomchannelsAdunitsListCall) Do() (*AdUnits, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnits{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsReportsGenerateCall) Fields(s ...googleapi.Field) *AccountsReportsGenerateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsReportsGenerateCall) IfNoneMatch(entityTag string) *AccountsReportsGenerateCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsReportsGenerateCall) Context(ctx context.Context) *AccountsReportsGenerateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsReportsGenerateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *AccountsReportsGenerateCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "adsense.accounts.reports.generate" call. +// Exactly one of *AdsenseReportsGenerateResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AdsenseReportsGenerateResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsReportsGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdsenseReportsGenerateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsReportsSavedGenerateCall) Fields(s ...googleapi.Field) *AccountsReportsSavedGenerateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsReportsSavedGenerateCall) IfNoneMatch(entityTag string) *AccountsReportsSavedGenerateCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsReportsSavedGenerateCall) Context(ctx context.Context) *AccountsReportsSavedGenerateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsReportsSavedGenerateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports/{savedReportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "savedReportId": c.savedReportId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.reports.saved.generate" call. +// Exactly one of *AdsenseReportsGenerateResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AdsenseReportsGenerateResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsReportsSavedGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdsenseReportsGenerateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsReportsSavedListCall) Fields(s ...googleapi.Field) *AccountsReportsSavedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsReportsSavedListCall) IfNoneMatch(entityTag string) *AccountsReportsSavedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsReportsSavedListCall) Context(ctx context.Context) *AccountsReportsSavedListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsReportsSavedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports/saved") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.reports.saved.list" call. +// Exactly one of *SavedReports or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SavedReports.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsReportsSavedListCall) Do() (*SavedReports, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SavedReports{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsSavedadstylesGetCall) Fields(s ...googleapi.Field) *AccountsSavedadstylesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsSavedadstylesGetCall) IfNoneMatch(entityTag string) *AccountsSavedadstylesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsSavedadstylesGetCall) Context(ctx context.Context) *AccountsSavedadstylesGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsSavedadstylesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/savedadstyles/{savedAdStyleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "savedAdStyleId": c.savedAdStyleId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.savedadstyles.get" call. +// Exactly one of *SavedAdStyle or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SavedAdStyle.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsSavedadstylesGetCall) Do() (*SavedAdStyle, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SavedAdStyle{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsSavedadstylesListCall) Fields(s ...googleapi.Field) *AccountsSavedadstylesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsSavedadstylesListCall) IfNoneMatch(entityTag string) *AccountsSavedadstylesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsSavedadstylesListCall) Context(ctx context.Context) *AccountsSavedadstylesListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsSavedadstylesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/savedadstyles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.savedadstyles.list" call. +// Exactly one of *SavedAdStyles or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SavedAdStyles.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsSavedadstylesListCall) Do() (*SavedAdStyles, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SavedAdStyles{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsUrlchannelsListCall) Fields(s ...googleapi.Field) *AccountsUrlchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsUrlchannelsListCall) IfNoneMatch(entityTag string) *AccountsUrlchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsUrlchannelsListCall) Context(ctx context.Context) *AccountsUrlchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsUrlchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/urlchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.urlchannels.list" call. +// Exactly one of *UrlChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UrlChannels.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsUrlchannelsListCall) Do() (*UrlChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UrlChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdclientsListCall) Fields(s ...googleapi.Field) *AdclientsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdclientsListCall) IfNoneMatch(entityTag string) *AdclientsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdclientsListCall) Context(ctx context.Context) *AdclientsListCall { + c.ctx_ = ctx + return c +} + +func (c *AdclientsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.adclients.list" call. +// Exactly one of *AdClients or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AdClients.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AdclientsListCall) Do() (*AdClients, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdClients{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdunitsGetCall) Fields(s ...googleapi.Field) *AdunitsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdunitsGetCall) IfNoneMatch(entityTag string) *AdunitsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdunitsGetCall) Context(ctx context.Context) *AdunitsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AdunitsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + "adUnitId": c.adUnitId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.adunits.get" call. +// Exactly one of *AdUnit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AdunitsGetCall) Do() (*AdUnit, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdunitsGetAdCodeCall) Fields(s ...googleapi.Field) *AdunitsGetAdCodeCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdunitsGetAdCodeCall) IfNoneMatch(entityTag string) *AdunitsGetAdCodeCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdunitsGetAdCodeCall) Context(ctx context.Context) *AdunitsGetAdCodeCall { + c.ctx_ = ctx + return c +} + +func (c *AdunitsGetAdCodeCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}/adcode") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + "adUnitId": c.adUnitId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.adunits.getAdCode" call. +// Exactly one of *AdCode or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdCode.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AdunitsGetAdCodeCall) Do() (*AdCode, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdCode{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdunitsListCall) Fields(s ...googleapi.Field) *AdunitsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdunitsListCall) IfNoneMatch(entityTag string) *AdunitsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdunitsListCall) Context(ctx context.Context) *AdunitsListCall { + c.ctx_ = ctx + return c +} + +func (c *AdunitsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.adunits.list" call. +// Exactly one of *AdUnits or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnits.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AdunitsListCall) Do() (*AdUnits, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnits{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdunitsCustomchannelsListCall) Fields(s ...googleapi.Field) *AdunitsCustomchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdunitsCustomchannelsListCall) IfNoneMatch(entityTag string) *AdunitsCustomchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdunitsCustomchannelsListCall) Context(ctx context.Context) *AdunitsCustomchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *AdunitsCustomchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + "adUnitId": c.adUnitId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.adunits.customchannels.list" call. +// Exactly one of *CustomChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannels.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AdunitsCustomchannelsListCall) Do() (*CustomChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AlertsListCall) Fields(s ...googleapi.Field) *AlertsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AlertsListCall) IfNoneMatch(entityTag string) *AlertsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AlertsListCall) Context(ctx context.Context) *AlertsListCall { + c.ctx_ = ctx + return c +} + +func (c *AlertsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.alerts.list" call. +// Exactly one of *Alerts or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Alerts.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AlertsListCall) Do() (*Alerts, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Alerts{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomchannelsGetCall) Fields(s ...googleapi.Field) *CustomchannelsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CustomchannelsGetCall) IfNoneMatch(entityTag string) *CustomchannelsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomchannelsGetCall) Context(ctx context.Context) *CustomchannelsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CustomchannelsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + "customChannelId": c.customChannelId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.customchannels.get" call. +// Exactly one of *CustomChannel or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannel.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CustomchannelsGetCall) Do() (*CustomChannel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomchannelsListCall) Fields(s ...googleapi.Field) *CustomchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CustomchannelsListCall) IfNoneMatch(entityTag string) *CustomchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomchannelsListCall) Context(ctx context.Context) *CustomchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *CustomchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.customchannels.list" call. +// Exactly one of *CustomChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannels.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CustomchannelsListCall) Do() (*CustomChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomchannelsAdunitsListCall) Fields(s ...googleapi.Field) *CustomchannelsAdunitsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CustomchannelsAdunitsListCall) IfNoneMatch(entityTag string) *CustomchannelsAdunitsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomchannelsAdunitsListCall) Context(ctx context.Context) *CustomchannelsAdunitsListCall { + c.ctx_ = ctx + return c +} + +func (c *CustomchannelsAdunitsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + "customChannelId": c.customChannelId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.customchannels.adunits.list" call. +// Exactly one of *AdUnits or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnits.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CustomchannelsAdunitsListCall) Do() (*AdUnits, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnits{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MetadataDimensionsListCall) Fields(s ...googleapi.Field) *MetadataDimensionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MetadataDimensionsListCall) IfNoneMatch(entityTag string) *MetadataDimensionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MetadataDimensionsListCall) Context(ctx context.Context) *MetadataDimensionsListCall { + c.ctx_ = ctx + return c +} + +func (c *MetadataDimensionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "metadata/dimensions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.metadata.dimensions.list" call. +// Exactly one of *Metadata or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Metadata.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MetadataDimensionsListCall) Do() (*Metadata, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Metadata{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MetadataMetricsListCall) Fields(s ...googleapi.Field) *MetadataMetricsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MetadataMetricsListCall) IfNoneMatch(entityTag string) *MetadataMetricsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MetadataMetricsListCall) Context(ctx context.Context) *MetadataMetricsListCall { + c.ctx_ = ctx + return c +} + +func (c *MetadataMetricsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "metadata/metrics") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.metadata.metrics.list" call. +// Exactly one of *Metadata or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Metadata.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MetadataMetricsListCall) Do() (*Metadata, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Metadata{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsGenerateCall) Fields(s ...googleapi.Field) *ReportsGenerateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsGenerateCall) IfNoneMatch(entityTag string) *ReportsGenerateCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsGenerateCall) Context(ctx context.Context) *ReportsGenerateCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsGenerateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *ReportsGenerateCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "adsense.reports.generate" call. +// Exactly one of *AdsenseReportsGenerateResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AdsenseReportsGenerateResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReportsGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdsenseReportsGenerateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsSavedGenerateCall) Fields(s ...googleapi.Field) *ReportsSavedGenerateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsSavedGenerateCall) IfNoneMatch(entityTag string) *ReportsSavedGenerateCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsSavedGenerateCall) Context(ctx context.Context) *ReportsSavedGenerateCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsSavedGenerateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{savedReportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "savedReportId": c.savedReportId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.reports.saved.generate" call. +// Exactly one of *AdsenseReportsGenerateResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AdsenseReportsGenerateResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReportsSavedGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdsenseReportsGenerateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsSavedListCall) Fields(s ...googleapi.Field) *ReportsSavedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsSavedListCall) IfNoneMatch(entityTag string) *ReportsSavedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsSavedListCall) Context(ctx context.Context) *ReportsSavedListCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsSavedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/saved") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.reports.saved.list" call. +// Exactly one of *SavedReports or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SavedReports.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReportsSavedListCall) Do() (*SavedReports, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SavedReports{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SavedadstylesGetCall) Fields(s ...googleapi.Field) *SavedadstylesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SavedadstylesGetCall) IfNoneMatch(entityTag string) *SavedadstylesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SavedadstylesGetCall) Context(ctx context.Context) *SavedadstylesGetCall { + c.ctx_ = ctx + return c +} + +func (c *SavedadstylesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "savedadstyles/{savedAdStyleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "savedAdStyleId": c.savedAdStyleId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.savedadstyles.get" call. +// Exactly one of *SavedAdStyle or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SavedAdStyle.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SavedadstylesGetCall) Do() (*SavedAdStyle, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SavedAdStyle{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SavedadstylesListCall) Fields(s ...googleapi.Field) *SavedadstylesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SavedadstylesListCall) IfNoneMatch(entityTag string) *SavedadstylesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SavedadstylesListCall) Context(ctx context.Context) *SavedadstylesListCall { + c.ctx_ = ctx + return c +} + +func (c *SavedadstylesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "savedadstyles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.savedadstyles.list" call. +// Exactly one of *SavedAdStyles or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SavedAdStyles.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SavedadstylesListCall) Do() (*SavedAdStyles, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SavedAdStyles{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlchannelsListCall) Fields(s ...googleapi.Field) *UrlchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UrlchannelsListCall) IfNoneMatch(entityTag string) *UrlchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlchannelsListCall) Context(ctx context.Context) *UrlchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *UrlchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/urlchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.urlchannels.list" call. +// Exactly one of *UrlChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UrlChannels.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UrlchannelsListCall) Do() (*UrlChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UrlChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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/Godeps/_workspace/src/google.golang.org/api/adsense/v1.4/adsense-api.json b/Godeps/_workspace/src/google.golang.org/api/adsense/v1.4/adsense-api.json new file mode 100644 index 000000000..f67a90c29 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/adsense/v1.4/adsense-api.json @@ -0,0 +1,2411 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/0LJdy3bhVfuPDmaGtJK4_nceDoU\"", + "discoveryVersion": "v1", + "id": "adsense:v1.4", + "name": "adsense", + "canonicalName": "AdSense", + "version": "v1.4", + "revision": "20151013", + "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": "https://www.google.com/images/icons/product/adsense-16.png", + "x32": "https://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": { + "creation_time": { + "type": "string", + "format": "int64" + }, + "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/Godeps/_workspace/src/google.golang.org/api/adsense/v1.4/adsense-gen.go b/Godeps/_workspace/src/google.golang.org/api/adsense/v1.4/adsense-gen.go new file mode 100644 index 000000000..638c8f9df --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/adsense/v1.4/adsense-gen.go @@ -0,0 +1,7521 @@ +// Package adsense provides access to the AdSense Management API. +// +// See https://developers.google.com/adsense/management/ +// +// Usage example: +// +// import "google.golang.org/api/adsense/v1.4" +// ... +// adsenseService, err := adsense.New(oauthHttpClient) +package adsense // import "google.golang.org/api/adsense/v1.4" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Accounts *AccountsService + + Adclients *AdclientsService + + Adunits *AdunitsService + + Alerts *AlertsService + + Customchannels *CustomchannelsService + + Metadata *MetadataService + + Payments *PaymentsService + + Reports *ReportsService + + Savedadstyles *SavedadstylesService + + Urlchannels *UrlchannelsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 { + CreationTime int64 `json:"creation_time,omitempty,string"` + + // 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Account) MarshalJSON() ([]byte, error) { + type noMethod Account + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Accounts) MarshalJSON() ([]byte, error) { + type noMethod Accounts + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "ArcOptIn") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdClient) MarshalJSON() ([]byte, error) { + type noMethod AdClient + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdClients) MarshalJSON() ([]byte, error) { + type noMethod AdClients + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AdCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdCode) MarshalJSON() ([]byte, error) { + type noMethod AdCode + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Colors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdStyle) MarshalJSON() ([]byte, error) { + type noMethod AdStyle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdStyleColors: 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. +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"` + + // ForceSendFields is a list of field names (e.g. "Background") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdStyleColors) MarshalJSON() ([]byte, error) { + type noMethod AdStyleColors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdStyleFont: The font which is included in the style. +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"` + + // ForceSendFields is a list of field names (e.g. "Family") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdStyleFont) MarshalJSON() ([]byte, error) { + type noMethod AdStyleFont + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnit) MarshalJSON() ([]byte, error) { + type noMethod AdUnit + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdUnitContentAdsSettings: Settings specific to content ads (AFC) and +// highend mobile content ads (AFMC). +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"` + + // ForceSendFields is a list of field names (e.g. "BackupOption") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnitContentAdsSettings) MarshalJSON() ([]byte, error) { + type noMethod AdUnitContentAdsSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdUnitContentAdsSettingsBackupOption: The backup option to be used in +// instances where no ad is available. +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"` + + // ForceSendFields is a list of field names (e.g. "Color") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnitContentAdsSettingsBackupOption) MarshalJSON() ([]byte, error) { + type noMethod AdUnitContentAdsSettingsBackupOption + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdUnitFeedAdsSettings: Settings specific to feed ads (AFF). +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"` + + // ForceSendFields is a list of field names (e.g. "AdPosition") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnitFeedAdsSettings) MarshalJSON() ([]byte, error) { + type noMethod AdUnitFeedAdsSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdUnitMobileContentAdsSettings: Settings specific to WAP mobile +// content ads (AFMC). +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"` + + // ForceSendFields is a list of field names (e.g. "MarkupLanguage") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnitMobileContentAdsSettings) MarshalJSON() ([]byte, error) { + type noMethod AdUnitMobileContentAdsSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnits) MarshalJSON() ([]byte, error) { + type noMethod AdUnits + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Averages") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdsenseReportsGenerateResponse) MarshalJSON() ([]byte, error) { + type noMethod AdsenseReportsGenerateResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Currency") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdsenseReportsGenerateResponseHeaders) MarshalJSON() ([]byte, error) { + type noMethod AdsenseReportsGenerateResponseHeaders + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Alert) MarshalJSON() ([]byte, error) { + type noMethod Alert + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Alerts) MarshalJSON() ([]byte, error) { + type noMethod Alerts + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomChannel) MarshalJSON() ([]byte, error) { + type noMethod CustomChannel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomChannelTargetingInfo: The targeting information of this custom +// channel, if activated. +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"` + + // ForceSendFields is a list of field names (e.g. "AdsAppearOn") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomChannelTargetingInfo) MarshalJSON() ([]byte, error) { + type noMethod CustomChannelTargetingInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomChannels) MarshalJSON() ([]byte, error) { + type noMethod CustomChannels + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Metadata struct { + Items []*ReportingMetadataEntry `json:"items,omitempty"` + + // Kind: Kind of list this is, in this case adsense#metadata. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Metadata) MarshalJSON() ([]byte, error) { + type noMethod Metadata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Payment) MarshalJSON() ([]byte, error) { + type noMethod Payment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Payments) MarshalJSON() ([]byte, error) { + type noMethod Payments + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. + // "CompatibleDimensions") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportingMetadataEntry) MarshalJSON() ([]byte, error) { + type noMethod ReportingMetadataEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AdStyle") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SavedAdStyle) MarshalJSON() ([]byte, error) { + type noMethod SavedAdStyle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SavedAdStyles) MarshalJSON() ([]byte, error) { + type noMethod SavedAdStyles + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SavedReport) MarshalJSON() ([]byte, error) { + type noMethod SavedReport + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SavedReports) MarshalJSON() ([]byte, error) { + type noMethod SavedReports + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlChannel) MarshalJSON() ([]byte, error) { + type noMethod UrlChannel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlChannels) MarshalJSON() ([]byte, error) { + type noMethod UrlChannels + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "adsense.accounts.get": + +type AccountsGetCall struct { + s *Service + accountId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["tree"]; ok { + params.Set("tree", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.get" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsGetCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.list" call. +// Exactly one of *Accounts or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Accounts.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsListCall) Do() (*Accounts, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Accounts{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAdclientsListCall) Fields(s ...googleapi.Field) *AccountsAdclientsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsAdclientsListCall) IfNoneMatch(entityTag string) *AccountsAdclientsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAdclientsListCall) Context(ctx context.Context) *AccountsAdclientsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAdclientsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.adclients.list" call. +// Exactly one of *AdClients or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AdClients.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsAdclientsListCall) Do() (*AdClients, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdClients{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAdunitsGetCall) Fields(s ...googleapi.Field) *AccountsAdunitsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsAdunitsGetCall) IfNoneMatch(entityTag string) *AccountsAdunitsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAdunitsGetCall) Context(ctx context.Context) *AccountsAdunitsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAdunitsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + "adUnitId": c.adUnitId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.adunits.get" call. +// Exactly one of *AdUnit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsAdunitsGetCall) Do() (*AdUnit, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAdunitsGetAdCodeCall) Fields(s ...googleapi.Field) *AccountsAdunitsGetAdCodeCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsAdunitsGetAdCodeCall) IfNoneMatch(entityTag string) *AccountsAdunitsGetAdCodeCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAdunitsGetAdCodeCall) Context(ctx context.Context) *AccountsAdunitsGetAdCodeCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAdunitsGetAdCodeCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/adcode") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + "adUnitId": c.adUnitId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.adunits.getAdCode" call. +// Exactly one of *AdCode or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdCode.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsAdunitsGetAdCodeCall) Do() (*AdCode, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdCode{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAdunitsListCall) Fields(s ...googleapi.Field) *AccountsAdunitsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsAdunitsListCall) IfNoneMatch(entityTag string) *AccountsAdunitsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAdunitsListCall) Context(ctx context.Context) *AccountsAdunitsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAdunitsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.adunits.list" call. +// Exactly one of *AdUnits or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnits.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsAdunitsListCall) Do() (*AdUnits, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnits{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAdunitsCustomchannelsListCall) Fields(s ...googleapi.Field) *AccountsAdunitsCustomchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsAdunitsCustomchannelsListCall) IfNoneMatch(entityTag string) *AccountsAdunitsCustomchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAdunitsCustomchannelsListCall) Context(ctx context.Context) *AccountsAdunitsCustomchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAdunitsCustomchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + "adUnitId": c.adUnitId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.adunits.customchannels.list" call. +// Exactly one of *CustomChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannels.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsAdunitsCustomchannelsListCall) Do() (*CustomChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAlertsDeleteCall) Fields(s ...googleapi.Field) *AccountsAlertsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAlertsDeleteCall) Context(ctx context.Context) *AccountsAlertsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAlertsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/alerts/{alertId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "alertId": c.alertId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.alerts.delete" call. +func (c *AccountsAlertsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAlertsListCall) Fields(s ...googleapi.Field) *AccountsAlertsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsAlertsListCall) IfNoneMatch(entityTag string) *AccountsAlertsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAlertsListCall) Context(ctx context.Context) *AccountsAlertsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAlertsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/alerts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.alerts.list" call. +// Exactly one of *Alerts or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Alerts.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsAlertsListCall) Do() (*Alerts, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Alerts{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsCustomchannelsGetCall) Fields(s ...googleapi.Field) *AccountsCustomchannelsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsCustomchannelsGetCall) IfNoneMatch(entityTag string) *AccountsCustomchannelsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsCustomchannelsGetCall) Context(ctx context.Context) *AccountsCustomchannelsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsCustomchannelsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + "customChannelId": c.customChannelId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.customchannels.get" call. +// Exactly one of *CustomChannel or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannel.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsCustomchannelsGetCall) Do() (*CustomChannel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsCustomchannelsListCall) Fields(s ...googleapi.Field) *AccountsCustomchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsCustomchannelsListCall) IfNoneMatch(entityTag string) *AccountsCustomchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsCustomchannelsListCall) Context(ctx context.Context) *AccountsCustomchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsCustomchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.customchannels.list" call. +// Exactly one of *CustomChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannels.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsCustomchannelsListCall) Do() (*CustomChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsCustomchannelsAdunitsListCall) Fields(s ...googleapi.Field) *AccountsCustomchannelsAdunitsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsCustomchannelsAdunitsListCall) IfNoneMatch(entityTag string) *AccountsCustomchannelsAdunitsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsCustomchannelsAdunitsListCall) Context(ctx context.Context) *AccountsCustomchannelsAdunitsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsCustomchannelsAdunitsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + "customChannelId": c.customChannelId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.customchannels.adunits.list" call. +// Exactly one of *AdUnits or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnits.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsCustomchannelsAdunitsListCall) Do() (*AdUnits, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnits{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsPaymentsListCall) Fields(s ...googleapi.Field) *AccountsPaymentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsPaymentsListCall) IfNoneMatch(entityTag string) *AccountsPaymentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsPaymentsListCall) Context(ctx context.Context) *AccountsPaymentsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsPaymentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/payments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.payments.list" call. +// Exactly one of *Payments or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Payments.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsPaymentsListCall) Do() (*Payments, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Payments{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsReportsGenerateCall) Fields(s ...googleapi.Field) *AccountsReportsGenerateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsReportsGenerateCall) IfNoneMatch(entityTag string) *AccountsReportsGenerateCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsReportsGenerateCall) Context(ctx context.Context) *AccountsReportsGenerateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsReportsGenerateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *AccountsReportsGenerateCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "adsense.accounts.reports.generate" call. +// Exactly one of *AdsenseReportsGenerateResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AdsenseReportsGenerateResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsReportsGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdsenseReportsGenerateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsReportsSavedGenerateCall) Fields(s ...googleapi.Field) *AccountsReportsSavedGenerateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsReportsSavedGenerateCall) IfNoneMatch(entityTag string) *AccountsReportsSavedGenerateCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsReportsSavedGenerateCall) Context(ctx context.Context) *AccountsReportsSavedGenerateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsReportsSavedGenerateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports/{savedReportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "savedReportId": c.savedReportId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.reports.saved.generate" call. +// Exactly one of *AdsenseReportsGenerateResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AdsenseReportsGenerateResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsReportsSavedGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdsenseReportsGenerateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsReportsSavedListCall) Fields(s ...googleapi.Field) *AccountsReportsSavedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsReportsSavedListCall) IfNoneMatch(entityTag string) *AccountsReportsSavedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsReportsSavedListCall) Context(ctx context.Context) *AccountsReportsSavedListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsReportsSavedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports/saved") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.reports.saved.list" call. +// Exactly one of *SavedReports or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SavedReports.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsReportsSavedListCall) Do() (*SavedReports, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SavedReports{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsSavedadstylesGetCall) Fields(s ...googleapi.Field) *AccountsSavedadstylesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsSavedadstylesGetCall) IfNoneMatch(entityTag string) *AccountsSavedadstylesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsSavedadstylesGetCall) Context(ctx context.Context) *AccountsSavedadstylesGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsSavedadstylesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/savedadstyles/{savedAdStyleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "savedAdStyleId": c.savedAdStyleId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.savedadstyles.get" call. +// Exactly one of *SavedAdStyle or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SavedAdStyle.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsSavedadstylesGetCall) Do() (*SavedAdStyle, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SavedAdStyle{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsSavedadstylesListCall) Fields(s ...googleapi.Field) *AccountsSavedadstylesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsSavedadstylesListCall) IfNoneMatch(entityTag string) *AccountsSavedadstylesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsSavedadstylesListCall) Context(ctx context.Context) *AccountsSavedadstylesListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsSavedadstylesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/savedadstyles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.savedadstyles.list" call. +// Exactly one of *SavedAdStyles or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SavedAdStyles.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsSavedadstylesListCall) Do() (*SavedAdStyles, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SavedAdStyles{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsUrlchannelsListCall) Fields(s ...googleapi.Field) *AccountsUrlchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsUrlchannelsListCall) IfNoneMatch(entityTag string) *AccountsUrlchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsUrlchannelsListCall) Context(ctx context.Context) *AccountsUrlchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsUrlchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/urlchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.accounts.urlchannels.list" call. +// Exactly one of *UrlChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UrlChannels.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsUrlchannelsListCall) Do() (*UrlChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UrlChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdclientsListCall) Fields(s ...googleapi.Field) *AdclientsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdclientsListCall) IfNoneMatch(entityTag string) *AdclientsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdclientsListCall) Context(ctx context.Context) *AdclientsListCall { + c.ctx_ = ctx + return c +} + +func (c *AdclientsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.adclients.list" call. +// Exactly one of *AdClients or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AdClients.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AdclientsListCall) Do() (*AdClients, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdClients{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdunitsGetCall) Fields(s ...googleapi.Field) *AdunitsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdunitsGetCall) IfNoneMatch(entityTag string) *AdunitsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdunitsGetCall) Context(ctx context.Context) *AdunitsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AdunitsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + "adUnitId": c.adUnitId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.adunits.get" call. +// Exactly one of *AdUnit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AdunitsGetCall) Do() (*AdUnit, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdunitsGetAdCodeCall) Fields(s ...googleapi.Field) *AdunitsGetAdCodeCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdunitsGetAdCodeCall) IfNoneMatch(entityTag string) *AdunitsGetAdCodeCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdunitsGetAdCodeCall) Context(ctx context.Context) *AdunitsGetAdCodeCall { + c.ctx_ = ctx + return c +} + +func (c *AdunitsGetAdCodeCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}/adcode") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + "adUnitId": c.adUnitId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.adunits.getAdCode" call. +// Exactly one of *AdCode or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdCode.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AdunitsGetAdCodeCall) Do() (*AdCode, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdCode{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdunitsListCall) Fields(s ...googleapi.Field) *AdunitsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdunitsListCall) IfNoneMatch(entityTag string) *AdunitsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdunitsListCall) Context(ctx context.Context) *AdunitsListCall { + c.ctx_ = ctx + return c +} + +func (c *AdunitsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.adunits.list" call. +// Exactly one of *AdUnits or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnits.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AdunitsListCall) Do() (*AdUnits, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnits{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdunitsCustomchannelsListCall) Fields(s ...googleapi.Field) *AdunitsCustomchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdunitsCustomchannelsListCall) IfNoneMatch(entityTag string) *AdunitsCustomchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdunitsCustomchannelsListCall) Context(ctx context.Context) *AdunitsCustomchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *AdunitsCustomchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/adunits/{adUnitId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + "adUnitId": c.adUnitId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.adunits.customchannels.list" call. +// Exactly one of *CustomChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannels.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AdunitsCustomchannelsListCall) Do() (*CustomChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AlertsDeleteCall) Fields(s ...googleapi.Field) *AlertsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AlertsDeleteCall) Context(ctx context.Context) *AlertsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AlertsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "alerts/{alertId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "alertId": c.alertId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.alerts.delete" call. +func (c *AlertsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AlertsListCall) Fields(s ...googleapi.Field) *AlertsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AlertsListCall) IfNoneMatch(entityTag string) *AlertsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AlertsListCall) Context(ctx context.Context) *AlertsListCall { + c.ctx_ = ctx + return c +} + +func (c *AlertsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.alerts.list" call. +// Exactly one of *Alerts or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Alerts.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AlertsListCall) Do() (*Alerts, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Alerts{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomchannelsGetCall) Fields(s ...googleapi.Field) *CustomchannelsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CustomchannelsGetCall) IfNoneMatch(entityTag string) *CustomchannelsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomchannelsGetCall) Context(ctx context.Context) *CustomchannelsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CustomchannelsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + "customChannelId": c.customChannelId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.customchannels.get" call. +// Exactly one of *CustomChannel or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannel.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CustomchannelsGetCall) Do() (*CustomChannel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomchannelsListCall) Fields(s ...googleapi.Field) *CustomchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CustomchannelsListCall) IfNoneMatch(entityTag string) *CustomchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomchannelsListCall) Context(ctx context.Context) *CustomchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *CustomchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.customchannels.list" call. +// Exactly one of *CustomChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannels.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CustomchannelsListCall) Do() (*CustomChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomchannelsAdunitsListCall) Fields(s ...googleapi.Field) *CustomchannelsAdunitsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CustomchannelsAdunitsListCall) IfNoneMatch(entityTag string) *CustomchannelsAdunitsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomchannelsAdunitsListCall) Context(ctx context.Context) *CustomchannelsAdunitsListCall { + c.ctx_ = ctx + return c +} + +func (c *CustomchannelsAdunitsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + "customChannelId": c.customChannelId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.customchannels.adunits.list" call. +// Exactly one of *AdUnits or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnits.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CustomchannelsAdunitsListCall) Do() (*AdUnits, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnits{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MetadataDimensionsListCall) Fields(s ...googleapi.Field) *MetadataDimensionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MetadataDimensionsListCall) IfNoneMatch(entityTag string) *MetadataDimensionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MetadataDimensionsListCall) Context(ctx context.Context) *MetadataDimensionsListCall { + c.ctx_ = ctx + return c +} + +func (c *MetadataDimensionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "metadata/dimensions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.metadata.dimensions.list" call. +// Exactly one of *Metadata or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Metadata.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MetadataDimensionsListCall) Do() (*Metadata, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Metadata{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MetadataMetricsListCall) Fields(s ...googleapi.Field) *MetadataMetricsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MetadataMetricsListCall) IfNoneMatch(entityTag string) *MetadataMetricsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MetadataMetricsListCall) Context(ctx context.Context) *MetadataMetricsListCall { + c.ctx_ = ctx + return c +} + +func (c *MetadataMetricsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "metadata/metrics") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.metadata.metrics.list" call. +// Exactly one of *Metadata or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Metadata.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MetadataMetricsListCall) Do() (*Metadata, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Metadata{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PaymentsListCall) Fields(s ...googleapi.Field) *PaymentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PaymentsListCall) IfNoneMatch(entityTag string) *PaymentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PaymentsListCall) Context(ctx context.Context) *PaymentsListCall { + c.ctx_ = ctx + return c +} + +func (c *PaymentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "payments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.payments.list" call. +// Exactly one of *Payments or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Payments.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PaymentsListCall) Do() (*Payments, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Payments{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsGenerateCall) Fields(s ...googleapi.Field) *ReportsGenerateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsGenerateCall) IfNoneMatch(entityTag string) *ReportsGenerateCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsGenerateCall) Context(ctx context.Context) *ReportsGenerateCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsGenerateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *ReportsGenerateCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "adsense.reports.generate" call. +// Exactly one of *AdsenseReportsGenerateResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AdsenseReportsGenerateResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReportsGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdsenseReportsGenerateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsSavedGenerateCall) Fields(s ...googleapi.Field) *ReportsSavedGenerateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsSavedGenerateCall) IfNoneMatch(entityTag string) *ReportsSavedGenerateCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsSavedGenerateCall) Context(ctx context.Context) *ReportsSavedGenerateCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsSavedGenerateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{savedReportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "savedReportId": c.savedReportId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.reports.saved.generate" call. +// Exactly one of *AdsenseReportsGenerateResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AdsenseReportsGenerateResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReportsSavedGenerateCall) Do() (*AdsenseReportsGenerateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdsenseReportsGenerateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsSavedListCall) Fields(s ...googleapi.Field) *ReportsSavedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsSavedListCall) IfNoneMatch(entityTag string) *ReportsSavedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsSavedListCall) Context(ctx context.Context) *ReportsSavedListCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsSavedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/saved") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.reports.saved.list" call. +// Exactly one of *SavedReports or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SavedReports.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReportsSavedListCall) Do() (*SavedReports, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SavedReports{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SavedadstylesGetCall) Fields(s ...googleapi.Field) *SavedadstylesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SavedadstylesGetCall) IfNoneMatch(entityTag string) *SavedadstylesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SavedadstylesGetCall) Context(ctx context.Context) *SavedadstylesGetCall { + c.ctx_ = ctx + return c +} + +func (c *SavedadstylesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "savedadstyles/{savedAdStyleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "savedAdStyleId": c.savedAdStyleId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.savedadstyles.get" call. +// Exactly one of *SavedAdStyle or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SavedAdStyle.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SavedadstylesGetCall) Do() (*SavedAdStyle, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SavedAdStyle{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SavedadstylesListCall) Fields(s ...googleapi.Field) *SavedadstylesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SavedadstylesListCall) IfNoneMatch(entityTag string) *SavedadstylesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SavedadstylesListCall) Context(ctx context.Context) *SavedadstylesListCall { + c.ctx_ = ctx + return c +} + +func (c *SavedadstylesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "savedadstyles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.savedadstyles.list" call. +// Exactly one of *SavedAdStyles or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SavedAdStyles.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SavedadstylesListCall) Do() (*SavedAdStyles, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SavedAdStyles{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlchannelsListCall) Fields(s ...googleapi.Field) *UrlchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UrlchannelsListCall) IfNoneMatch(entityTag string) *UrlchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlchannelsListCall) Context(ctx context.Context) *UrlchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *UrlchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/urlchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsense.urlchannels.list" call. +// Exactly one of *UrlChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UrlChannels.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UrlchannelsListCall) Do() (*UrlChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UrlChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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/Godeps/_workspace/src/google.golang.org/api/adsensehost/v4.1/adsensehost-api.json b/Godeps/_workspace/src/google.golang.org/api/adsensehost/v4.1/adsensehost-api.json new file mode 100644 index 000000000..e4979b1d3 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/adsensehost/v4.1/adsensehost-api.json @@ -0,0 +1,1569 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/yoGXlEwGPLEAr1fmq3U4dFpyoyQ\"", + "discoveryVersion": "v1", + "id": "adsensehost:v4.1", + "name": "adsensehost", + "canonicalName": "AdSense Host", + "version": "v4.1", + "revision": "20141229", + "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": "https://www.google.com/images/icons/product/adsense-16.png", + "x32": "https://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/Godeps/_workspace/src/google.golang.org/api/adsensehost/v4.1/adsensehost-gen.go b/Godeps/_workspace/src/google.golang.org/api/adsensehost/v4.1/adsensehost-gen.go new file mode 100644 index 000000000..3b8d0302d --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/adsensehost/v4.1/adsensehost-gen.go @@ -0,0 +1,4809 @@ +// Package adsensehost provides access to the AdSense Host API. +// +// See https://developers.google.com/adsense/host/ +// +// Usage example: +// +// import "google.golang.org/api/adsensehost/v4.1" +// ... +// adsensehostService, err := adsensehost.New(oauthHttpClient) +package adsensehost // import "google.golang.org/api/adsensehost/v4.1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Accounts *AccountsService + + Adclients *AdclientsService + + Associationsessions *AssociationsessionsService + + Customchannels *CustomchannelsService + + Reports *ReportsService + + Urlchannels *UrlchannelsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Account) MarshalJSON() ([]byte, error) { + type noMethod Account + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Accounts) MarshalJSON() ([]byte, error) { + type noMethod Accounts + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ArcOptIn") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdClient) MarshalJSON() ([]byte, error) { + type noMethod AdClient + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdClients) MarshalJSON() ([]byte, error) { + type noMethod AdClients + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AdCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdCode) MarshalJSON() ([]byte, error) { + type noMethod AdCode + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Colors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdStyle) MarshalJSON() ([]byte, error) { + type noMethod AdStyle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdStyleColors: The colors included in the style. These are +// represented as six hexadecimal characters, similar to HTML color +// codes, but without the leading hash. +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"` + + // ForceSendFields is a list of field names (e.g. "Background") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdStyleColors) MarshalJSON() ([]byte, error) { + type noMethod AdStyleColors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdStyleFont: The font which is included in the style. +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"` + + // ForceSendFields is a list of field names (e.g. "Family") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdStyleFont) MarshalJSON() ([]byte, error) { + type noMethod AdStyleFont + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnit) MarshalJSON() ([]byte, error) { + type noMethod AdUnit + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdUnitContentAdsSettings: Settings specific to content ads (AFC) and +// highend mobile content ads (AFMC). +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"` + + // ForceSendFields is a list of field names (e.g. "BackupOption") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnitContentAdsSettings) MarshalJSON() ([]byte, error) { + type noMethod AdUnitContentAdsSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdUnitContentAdsSettingsBackupOption: The backup option to be used in +// instances where no ad is available. +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"` + + // ForceSendFields is a list of field names (e.g. "Color") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnitContentAdsSettingsBackupOption) MarshalJSON() ([]byte, error) { + type noMethod AdUnitContentAdsSettingsBackupOption + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdUnitMobileContentAdsSettings: Settings specific to WAP mobile +// content ads (AFMC). +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"` + + // ForceSendFields is a list of field names (e.g. "MarkupLanguage") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnitMobileContentAdsSettings) MarshalJSON() ([]byte, error) { + type noMethod AdUnitMobileContentAdsSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdUnits) MarshalJSON() ([]byte, error) { + type noMethod AdUnits + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AssociationSession) MarshalJSON() ([]byte, error) { + type noMethod AssociationSession + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomChannel) MarshalJSON() ([]byte, error) { + type noMethod CustomChannel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomChannels) MarshalJSON() ([]byte, error) { + type noMethod CustomChannels + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Averages") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Report) MarshalJSON() ([]byte, error) { + type noMethod Report + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Currency") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportHeaders) MarshalJSON() ([]byte, error) { + type noMethod ReportHeaders + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlChannel) MarshalJSON() ([]byte, error) { + type noMethod UrlChannel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlChannels) MarshalJSON() ([]byte, error) { + type noMethod UrlChannels + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "adsensehost.accounts.get": + +type AccountsGetCall struct { + s *Service + accountId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsensehost.accounts.get" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsGetCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + for _, v := range c.filterAdClientId { + params.Add("filterAdClientId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsensehost.accounts.list" call. +// Exactly one of *Accounts or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Accounts.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsListCall) Do() (*Accounts, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Accounts{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAdclientsGetCall) Fields(s ...googleapi.Field) *AccountsAdclientsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsAdclientsGetCall) IfNoneMatch(entityTag string) *AccountsAdclientsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAdclientsGetCall) Context(ctx context.Context) *AccountsAdclientsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAdclientsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsensehost.accounts.adclients.get" call. +// Exactly one of *AdClient or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdClient.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsAdclientsGetCall) Do() (*AdClient, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdClient{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAdclientsListCall) Fields(s ...googleapi.Field) *AccountsAdclientsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsAdclientsListCall) IfNoneMatch(entityTag string) *AccountsAdclientsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAdclientsListCall) Context(ctx context.Context) *AccountsAdclientsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAdclientsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsensehost.accounts.adclients.list" call. +// Exactly one of *AdClients or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AdClients.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsAdclientsListCall) Do() (*AdClients, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdClients{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAdunitsDeleteCall) Fields(s ...googleapi.Field) *AccountsAdunitsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAdunitsDeleteCall) Context(ctx context.Context) *AccountsAdunitsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAdunitsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + "adUnitId": c.adUnitId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsensehost.accounts.adunits.delete" call. +// Exactly one of *AdUnit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsAdunitsDeleteCall) Do() (*AdUnit, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAdunitsGetCall) Fields(s ...googleapi.Field) *AccountsAdunitsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsAdunitsGetCall) IfNoneMatch(entityTag string) *AccountsAdunitsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAdunitsGetCall) Context(ctx context.Context) *AccountsAdunitsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAdunitsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + "adUnitId": c.adUnitId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsensehost.accounts.adunits.get" call. +// Exactly one of *AdUnit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsAdunitsGetCall) Do() (*AdUnit, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAdunitsGetAdCodeCall) Fields(s ...googleapi.Field) *AccountsAdunitsGetAdCodeCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsAdunitsGetAdCodeCall) IfNoneMatch(entityTag string) *AccountsAdunitsGetAdCodeCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAdunitsGetAdCodeCall) Context(ctx context.Context) *AccountsAdunitsGetAdCodeCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAdunitsGetAdCodeCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["hostCustomChannelId"]; ok { + params.Set("hostCustomChannelId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + "adUnitId": c.adUnitId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsensehost.accounts.adunits.getAdCode" call. +// Exactly one of *AdCode or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdCode.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsAdunitsGetAdCodeCall) Do() (*AdCode, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdCode{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAdunitsInsertCall) Fields(s ...googleapi.Field) *AccountsAdunitsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAdunitsInsertCall) Context(ctx context.Context) *AccountsAdunitsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAdunitsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsensehost.accounts.adunits.insert" call. +// Exactly one of *AdUnit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsAdunitsInsertCall) Do() (*AdUnit, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAdunitsListCall) Fields(s ...googleapi.Field) *AccountsAdunitsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsAdunitsListCall) IfNoneMatch(entityTag string) *AccountsAdunitsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAdunitsListCall) Context(ctx context.Context) *AccountsAdunitsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAdunitsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsensehost.accounts.adunits.list" call. +// Exactly one of *AdUnits or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnits.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsAdunitsListCall) Do() (*AdUnits, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnits{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAdunitsPatchCall) Fields(s ...googleapi.Field) *AccountsAdunitsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAdunitsPatchCall) Context(ctx context.Context) *AccountsAdunitsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAdunitsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + params.Set("adUnitId", fmt.Sprintf("%v", c.adUnitId)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsensehost.accounts.adunits.patch" call. +// Exactly one of *AdUnit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsAdunitsPatchCall) Do() (*AdUnit, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAdunitsUpdateCall) Fields(s ...googleapi.Field) *AccountsAdunitsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAdunitsUpdateCall) Context(ctx context.Context) *AccountsAdunitsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAdunitsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/adunits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "adClientId": c.adClientId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsensehost.accounts.adunits.update" call. +// Exactly one of *AdUnit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdUnit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsAdunitsUpdateCall) Do() (*AdUnit, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdUnit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsReportsGenerateCall) Fields(s ...googleapi.Field) *AccountsReportsGenerateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsReportsGenerateCall) IfNoneMatch(entityTag string) *AccountsReportsGenerateCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsReportsGenerateCall) Context(ctx context.Context) *AccountsReportsGenerateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsReportsGenerateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsensehost.accounts.reports.generate" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsReportsGenerateCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdclientsGetCall) Fields(s ...googleapi.Field) *AdclientsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdclientsGetCall) IfNoneMatch(entityTag string) *AdclientsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdclientsGetCall) Context(ctx context.Context) *AdclientsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AdclientsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsensehost.adclients.get" call. +// Exactly one of *AdClient or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AdClient.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AdclientsGetCall) Do() (*AdClient, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdClient{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdclientsListCall) Fields(s ...googleapi.Field) *AdclientsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdclientsListCall) IfNoneMatch(entityTag string) *AdclientsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdclientsListCall) Context(ctx context.Context) *AdclientsListCall { + c.ctx_ = ctx + return c +} + +func (c *AdclientsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsensehost.adclients.list" call. +// Exactly one of *AdClients or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AdClients.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AdclientsListCall) Do() (*AdClients, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdClients{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AssociationsessionsStartCall) Fields(s ...googleapi.Field) *AssociationsessionsStartCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AssociationsessionsStartCall) IfNoneMatch(entityTag string) *AssociationsessionsStartCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AssociationsessionsStartCall) Context(ctx context.Context) *AssociationsessionsStartCall { + c.ctx_ = ctx + return c +} + +func (c *AssociationsessionsStartCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsensehost.associationsessions.start" call. +// Exactly one of *AssociationSession or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AssociationSession.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AssociationsessionsStartCall) Do() (*AssociationSession, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AssociationSession{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AssociationsessionsVerifyCall) Fields(s ...googleapi.Field) *AssociationsessionsVerifyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AssociationsessionsVerifyCall) IfNoneMatch(entityTag string) *AssociationsessionsVerifyCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AssociationsessionsVerifyCall) Context(ctx context.Context) *AssociationsessionsVerifyCall { + c.ctx_ = ctx + return c +} + +func (c *AssociationsessionsVerifyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("token", fmt.Sprintf("%v", c.token)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsensehost.associationsessions.verify" call. +// Exactly one of *AssociationSession or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AssociationSession.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AssociationsessionsVerifyCall) Do() (*AssociationSession, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AssociationSession{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomchannelsDeleteCall) Fields(s ...googleapi.Field) *CustomchannelsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomchannelsDeleteCall) Context(ctx context.Context) *CustomchannelsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *CustomchannelsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + "customChannelId": c.customChannelId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsensehost.customchannels.delete" call. +// Exactly one of *CustomChannel or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannel.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CustomchannelsDeleteCall) Do() (*CustomChannel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomchannelsGetCall) Fields(s ...googleapi.Field) *CustomchannelsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CustomchannelsGetCall) IfNoneMatch(entityTag string) *CustomchannelsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomchannelsGetCall) Context(ctx context.Context) *CustomchannelsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CustomchannelsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels/{customChannelId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + "customChannelId": c.customChannelId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsensehost.customchannels.get" call. +// Exactly one of *CustomChannel or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannel.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CustomchannelsGetCall) Do() (*CustomChannel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomchannelsInsertCall) Fields(s ...googleapi.Field) *CustomchannelsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomchannelsInsertCall) Context(ctx context.Context) *CustomchannelsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CustomchannelsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsensehost.customchannels.insert" call. +// Exactly one of *CustomChannel or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannel.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CustomchannelsInsertCall) Do() (*CustomChannel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomchannelsListCall) Fields(s ...googleapi.Field) *CustomchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CustomchannelsListCall) IfNoneMatch(entityTag string) *CustomchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomchannelsListCall) Context(ctx context.Context) *CustomchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *CustomchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsensehost.customchannels.list" call. +// Exactly one of *CustomChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannels.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CustomchannelsListCall) Do() (*CustomChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomchannelsPatchCall) Fields(s ...googleapi.Field) *CustomchannelsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomchannelsPatchCall) Context(ctx context.Context) *CustomchannelsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CustomchannelsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + params.Set("customChannelId", fmt.Sprintf("%v", c.customChannelId)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsensehost.customchannels.patch" call. +// Exactly one of *CustomChannel or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannel.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CustomchannelsPatchCall) Do() (*CustomChannel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomchannelsUpdateCall) Fields(s ...googleapi.Field) *CustomchannelsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomchannelsUpdateCall) Context(ctx context.Context) *CustomchannelsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CustomchannelsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/customchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsensehost.customchannels.update" call. +// Exactly one of *CustomChannel or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomChannel.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CustomchannelsUpdateCall) Do() (*CustomChannel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomChannel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsGenerateCall) Fields(s ...googleapi.Field) *ReportsGenerateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsGenerateCall) IfNoneMatch(entityTag string) *ReportsGenerateCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsGenerateCall) Context(ctx context.Context) *ReportsGenerateCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsGenerateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsensehost.reports.generate" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsGenerateCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlchannelsDeleteCall) Fields(s ...googleapi.Field) *UrlchannelsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlchannelsDeleteCall) Context(ctx context.Context) *UrlchannelsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *UrlchannelsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/urlchannels/{urlChannelId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + "urlChannelId": c.urlChannelId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsensehost.urlchannels.delete" call. +// Exactly one of *UrlChannel or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UrlChannel.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UrlchannelsDeleteCall) Do() (*UrlChannel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UrlChannel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlchannelsInsertCall) Fields(s ...googleapi.Field) *UrlchannelsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlchannelsInsertCall) Context(ctx context.Context) *UrlchannelsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *UrlchannelsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/urlchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsensehost.urlchannels.insert" call. +// Exactly one of *UrlChannel or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UrlChannel.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UrlchannelsInsertCall) Do() (*UrlChannel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UrlChannel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlchannelsListCall) Fields(s ...googleapi.Field) *UrlchannelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UrlchannelsListCall) IfNoneMatch(entityTag string) *UrlchannelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlchannelsListCall) Context(ctx context.Context) *UrlchannelsListCall { + c.ctx_ = ctx + return c +} + +func (c *UrlchannelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "adclients/{adClientId}/urlchannels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "adClientId": c.adClientId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "adsensehost.urlchannels.list" call. +// Exactly one of *UrlChannels or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UrlChannels.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UrlchannelsListCall) Do() (*UrlChannels, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UrlChannels{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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/Godeps/_workspace/src/google.golang.org/api/analytics/v2.4/analytics-api.json b/Godeps/_workspace/src/google.golang.org/api/analytics/v2.4/analytics-api.json new file mode 100644 index 000000000..384b7a374 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/analytics/v2.4/analytics-api.json @@ -0,0 +1,366 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/deWKWLiFywg1_Xne7G92xyJt8HA\"", + "discoveryVersion": "v1", + "id": "analytics:v2.4", + "name": "analytics", + "version": "v2.4", + "revision": "20150115", + "title": "Google Analytics API", + "description": "View and manage your Google Analytics data", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/analytics-16.png", + "x32": "https://www.google.com/images/icons/product/analytics-32.png" + }, + "documentationLink": "https://developers.google.com/analytics/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/analytics/v2.4/", + "basePath": "/analytics/v2.4/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "analytics/v2.4/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "atom", + "enum": [ + "atom" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/atom+xml" + ], + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "false", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.", + "location": "query" + }, + "userIp": { + "type": "string", + "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.", + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/analytics": { + "description": "View and manage your Google Analytics data" + }, + "https://www.googleapis.com/auth/analytics.readonly": { + "description": "View your Google Analytics data" + } + } + } + }, + "resources": { + "data": { + "methods": { + "get": { + "id": "analytics.data.get", + "path": "data", + "httpMethod": "GET", + "description": "Returns Analytics report data for a view (profile).", + "parameters": { + "dimensions": { + "type": "string", + "description": "A comma-separated list of Analytics dimensions. E.g., 'ga:browser,ga:city'.", + "pattern": "(ga:.+)?", + "location": "query" + }, + "end-date": { + "type": "string", + "description": "End date for fetching report data. All requests should specify an end date formatted as YYYY-MM-DD.", + "required": true, + "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}", + "location": "query" + }, + "filters": { + "type": "string", + "description": "A comma-separated list of dimension or metric filters to be applied to the report data.", + "pattern": "ga:.+", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Unique table ID for retrieving report data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID.", + "required": true, + "pattern": "ga:[0-9]+", + "location": "query" + }, + "max-results": { + "type": "integer", + "description": "The maximum number of entries to include in this feed.", + "format": "int32", + "location": "query" + }, + "metrics": { + "type": "string", + "description": "A comma-separated list of Analytics metrics. E.g., 'ga:sessions,ga:pageviews'. At least one metric must be specified to retrieve a valid Analytics report.", + "required": true, + "pattern": "ga:.+", + "location": "query" + }, + "segment": { + "type": "string", + "description": "An Analytics advanced segment to be applied to the report data.", + "location": "query" + }, + "sort": { + "type": "string", + "description": "A comma-separated list of dimensions or metrics that determine the sort order for the report data.", + "pattern": "(-)?ga:.+", + "location": "query" + }, + "start-date": { + "type": "string", + "description": "Start date for fetching report data. All requests should specify a start date formatted as YYYY-MM-DD.", + "required": true, + "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}", + "location": "query" + }, + "start-index": { + "type": "integer", + "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + "format": "int32", + "minimum": "1", + "location": "query" + } + }, + "parameterOrder": [ + "ids", + "start-date", + "end-date", + "metrics" + ], + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.readonly" + ] + } + } + }, + "management": { + "resources": { + "accounts": { + "methods": { + "list": { + "id": "analytics.management.accounts.list", + "path": "management/accounts", + "httpMethod": "GET", + "description": "Lists all accounts to which the user has access.", + "parameters": { + "max-results": { + "type": "integer", + "description": "The maximum number of accounts to include in this response.", + "format": "int32", + "location": "query" + }, + "start-index": { + "type": "integer", + "description": "An index of the first account to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + "format": "int32", + "minimum": "1", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.readonly" + ] + } + } + }, + "goals": { + "methods": { + "list": { + "id": "analytics.management.goals.list", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals", + "httpMethod": "GET", + "description": "Lists goals to which the user has access.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to retrieve goals for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to.", + "required": true, + "location": "path" + }, + "max-results": { + "type": "integer", + "description": "The maximum number of goals to include in this response.", + "format": "int32", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "View (Profile) ID to retrieve goals for. Can either be a specific view (profile) ID or '~all', which refers to all the views (profiles) that user has access to.", + "required": true, + "location": "path" + }, + "start-index": { + "type": "integer", + "description": "An index of the first goal to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID to retrieve goals for. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId" + ], + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.readonly" + ] + } + } + }, + "profiles": { + "methods": { + "list": { + "id": "analytics.management.profiles.list", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles", + "httpMethod": "GET", + "description": "Lists views (profiles) to which the user has access.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID for the views (profiles) to retrieve. Can either be a specific account ID or '~all', which refers to all the accounts to which the user has access.", + "required": true, + "location": "path" + }, + "max-results": { + "type": "integer", + "description": "The maximum number of views (profiles) to include in this response.", + "format": "int32", + "location": "query" + }, + "start-index": { + "type": "integer", + "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID for the views (profiles) to retrieve. Can either be a specific web property ID or '~all', which refers to all the web properties to which the user has access.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId" + ], + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.readonly" + ] + } + } + }, + "segments": { + "methods": { + "list": { + "id": "analytics.management.segments.list", + "path": "management/segments", + "httpMethod": "GET", + "description": "Lists advanced segments to which the user has access.", + "parameters": { + "max-results": { + "type": "integer", + "description": "The maximum number of advanced segments to include in this response.", + "format": "int32", + "location": "query" + }, + "start-index": { + "type": "integer", + "description": "An index of the first advanced segment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + "format": "int32", + "minimum": "1", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.readonly" + ] + } + } + }, + "webproperties": { + "methods": { + "list": { + "id": "analytics.management.webproperties.list", + "path": "management/accounts/{accountId}/webproperties", + "httpMethod": "GET", + "description": "Lists web properties to which the user has access.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to retrieve web properties for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to.", + "required": true, + "location": "path" + }, + "max-results": { + "type": "integer", + "description": "The maximum number of web properties to include in this response.", + "format": "int32", + "location": "query" + }, + "start-index": { + "type": "integer", + "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + "format": "int32", + "minimum": "1", + "location": "query" + } + }, + "parameterOrder": [ + "accountId" + ], + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.readonly" + ] + } + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/analytics/v2.4/analytics-gen.go b/Godeps/_workspace/src/google.golang.org/api/analytics/v2.4/analytics-gen.go new file mode 100644 index 000000000..b0bdf2a21 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/analytics/v2.4/analytics-gen.go @@ -0,0 +1,1066 @@ +// Package analytics provides access to the Google Analytics API. +// +// See https://developers.google.com/analytics/ +// +// Usage example: +// +// import "google.golang.org/api/analytics/v2.4" +// ... +// analyticsService, err := analytics.New(oauthHttpClient) +package analytics // import "google.golang.org/api/analytics/v2.4" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Data *DataService + + Management *ManagementService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DataGetCall) Fields(s ...googleapi.Field) *DataGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DataGetCall) IfNoneMatch(entityTag string) *DataGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DataGetCall) Context(ctx context.Context) *DataGetCall { + c.ctx_ = ctx + return c +} + +func (c *DataGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.data.get" call. +func (c *DataGetCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Returns 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:sessions,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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementAccountsListCall) Fields(s ...googleapi.Field) *ManagementAccountsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementAccountsListCall) IfNoneMatch(entityTag string) *ManagementAccountsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementAccountsListCall) Context(ctx context.Context) *ManagementAccountsListCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementAccountsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.accounts.list" call. +func (c *ManagementAccountsListCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Lists 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementGoalsListCall) Fields(s ...googleapi.Field) *ManagementGoalsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementGoalsListCall) IfNoneMatch(entityTag string) *ManagementGoalsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementGoalsListCall) Context(ctx context.Context) *ManagementGoalsListCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementGoalsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.goals.list" call. +func (c *ManagementGoalsListCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Lists goals to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.goals.list", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to retrieve goals for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "max-results": { + // "description": "The maximum number of goals to include in this response.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "profileId": { + // "description": "View (Profile) ID to retrieve goals for. Can either be a specific view (profile) ID or '~all', which refers to all the views (profiles) that user has access to.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "start-index": { + // "description": "An index of the first goal to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "webPropertyId": { + // "description": "Web property ID to retrieve goals for. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals", + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.profiles.list": + +type ManagementProfilesListCall struct { + s *Service + accountId string + webPropertyId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementProfilesListCall) Fields(s ...googleapi.Field) *ManagementProfilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementProfilesListCall) IfNoneMatch(entityTag string) *ManagementProfilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementProfilesListCall) Context(ctx context.Context) *ManagementProfilesListCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementProfilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.profiles.list" call. +func (c *ManagementProfilesListCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Lists 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementSegmentsListCall) Fields(s ...googleapi.Field) *ManagementSegmentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementSegmentsListCall) IfNoneMatch(entityTag string) *ManagementSegmentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementSegmentsListCall) Context(ctx context.Context) *ManagementSegmentsListCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementSegmentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.segments.list" call. +func (c *ManagementSegmentsListCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Lists 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementWebpropertiesListCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementWebpropertiesListCall) IfNoneMatch(entityTag string) *ManagementWebpropertiesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementWebpropertiesListCall) Context(ctx context.Context) *ManagementWebpropertiesListCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementWebpropertiesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.webproperties.list" call. +func (c *ManagementWebpropertiesListCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Lists 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/Godeps/_workspace/src/google.golang.org/api/analytics/v3/analytics-api.json b/Godeps/_workspace/src/google.golang.org/api/analytics/v3/analytics-api.json new file mode 100644 index 000000000..ce2af4b94 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/analytics/v3/analytics-api.json @@ -0,0 +1,6675 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/tkvvUCeQm-DiyKpCr0Y-A0UaVuo\"", + "discoveryVersion": "v1", + "id": "analytics:v3", + "name": "analytics", + "version": "v3", + "revision": "20150814", + "title": "Google Analytics API", + "description": "View and manage your Google Analytics data", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/analytics-16.png", + "x32": "https://www.google.com/images/icons/product/analytics-32.png" + }, + "documentationLink": "https://developers.google.com/analytics/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/analytics/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.manage.users.readonly": { + "description": "View Google Analytics user permissions" + }, + "https://www.googleapis.com/auth/analytics.provision": { + "description": "Create a new Google Analytics account along with its default property and view" + }, + "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" + } + } + } + }, + "AccountTicket": { + "id": "AccountTicket", + "type": "object", + "description": "JSON template for an Analytics account ticket. The account ticket consists of the ticket ID and the basic information for the account, property and profile.", + "properties": { + "account": { + "$ref": "Account", + "description": "Account for this ticket." + }, + "id": { + "type": "string", + "description": "Account ticket ID used to access the account ticket." + }, + "kind": { + "type": "string", + "description": "Resource type for account ticket.", + "default": "analytics#accountTicket" + }, + "profile": { + "$ref": "Profile", + "description": "View (Profile) for the account." + }, + "redirectUri": { + "type": "string", + "description": "Redirect URI where the user will be sent after accepting Terms of Service. Must be configured in APIs console as a callback URL." + }, + "webproperty": { + "$ref": "Webproperty", + "description": "Web property for the account." + } + } + }, + "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" + } + } + }, + "AdWordsAccount": { + "id": "AdWordsAccount", + "type": "object", + "description": "JSON template for an AdWords account.", + "properties": { + "autoTaggingEnabled": { + "type": "boolean", + "description": "True if auto-tagging is enabled on the AdWords account. Read-only after the insert operation." + }, + "customerId": { + "type": "string", + "description": "Customer ID. This field is required when creating an AdWords link.", + "annotations": { + "required": [ + "analytics.management.webPropertyAdWordsLinks.insert", + "analytics.management.webPropertyAdWordsLinks.update" + ] + } + }, + "kind": { + "type": "string", + "description": "Resource type for AdWords account.", + "default": "analytics#adWordsAccount" + } + } + }, + "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." + }, + "importBehavior": { + "type": "string" + }, + "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" + }, + "uploadType": { + "type": "string" + }, + "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" + } + } + }, + "CustomDimension": { + "id": "CustomDimension", + "type": "object", + "description": "JSON template for Analytics Custom Dimension.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID." + }, + "active": { + "type": "boolean", + "description": "Boolean indicating whether the custom dimension is active." + }, + "created": { + "type": "string", + "description": "Time the custom dimension was created.", + "format": "date-time", + "readOnly": true + }, + "id": { + "type": "string", + "description": "Custom dimension ID." + }, + "index": { + "type": "integer", + "description": "Index of the custom dimension.", + "format": "int32", + "readOnly": true + }, + "kind": { + "type": "string", + "description": "Kind value for a custom dimension. Set to \"analytics#customDimension\". It is a read-only field.", + "default": "analytics#customDimension", + "readOnly": true + }, + "name": { + "type": "string", + "description": "Name of the custom dimension." + }, + "parentLink": { + "type": "object", + "description": "Parent link for the custom dimension. Points to the property to which the custom dimension belongs.", + "properties": { + "href": { + "type": "string", + "description": "Link to the property to which the custom dimension belongs." + }, + "type": { + "type": "string", + "description": "Type of the parent link. Set to \"analytics#webproperty\".", + "default": "analytics#webproperty" + } + } + }, + "scope": { + "type": "string", + "description": "Scope of the custom dimension: HIT, SESSION, USER or PRODUCT." + }, + "selfLink": { + "type": "string", + "description": "Link for the custom dimension", + "readOnly": true + }, + "updated": { + "type": "string", + "description": "Time the custom dimension was last modified.", + "format": "date-time", + "readOnly": true + }, + "webPropertyId": { + "type": "string", + "description": "Property ID." + } + } + }, + "CustomDimensions": { + "id": "CustomDimensions", + "type": "object", + "description": "A custom dimension collection lists Analytics custom dimensions to which the user has access. Each resource in the collection corresponds to a single Analytics custom dimension.", + "properties": { + "items": { + "type": "array", + "description": "Collection of custom dimensions.", + "items": { + "$ref": "CustomDimension" + } + }, + "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#customDimensions" + }, + "nextLink": { + "type": "string", + "description": "Link to next page for this custom dimension collection." + }, + "previousLink": { + "type": "string", + "description": "Link to previous page for this custom dimension 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" + } + } + }, + "CustomMetric": { + "id": "CustomMetric", + "type": "object", + "description": "JSON template for Analytics Custom Metric.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID." + }, + "active": { + "type": "boolean", + "description": "Boolean indicating whether the custom metric is active." + }, + "created": { + "type": "string", + "description": "Time the custom metric was created.", + "format": "date-time", + "readOnly": true + }, + "id": { + "type": "string", + "description": "Custom metric ID." + }, + "index": { + "type": "integer", + "description": "Index of the custom metric.", + "format": "int32", + "readOnly": true + }, + "kind": { + "type": "string", + "description": "Kind value for a custom metric. Set to \"analytics#customMetric\". It is a read-only field.", + "default": "analytics#customMetric", + "readOnly": true + }, + "max_value": { + "type": "string", + "description": "Max value of custom metric." + }, + "min_value": { + "type": "string", + "description": "Min value of custom metric." + }, + "name": { + "type": "string", + "description": "Name of the custom metric." + }, + "parentLink": { + "type": "object", + "description": "Parent link for the custom metric. Points to the property to which the custom metric belongs.", + "properties": { + "href": { + "type": "string", + "description": "Link to the property to which the custom metric belongs." + }, + "type": { + "type": "string", + "description": "Type of the parent link. Set to \"analytics#webproperty\".", + "default": "analytics#webproperty" + } + } + }, + "scope": { + "type": "string", + "description": "Scope of the custom metric: HIT or PRODUCT." + }, + "selfLink": { + "type": "string", + "description": "Link for the custom metric", + "readOnly": true + }, + "type": { + "type": "string", + "description": "Data type of custom metric." + }, + "updated": { + "type": "string", + "description": "Time the custom metric was last modified.", + "format": "date-time", + "readOnly": true + }, + "webPropertyId": { + "type": "string", + "description": "Property ID." + } + } + }, + "CustomMetrics": { + "id": "CustomMetrics", + "type": "object", + "description": "A custom metric collection lists Analytics custom metrics to which the user has access. Each resource in the collection corresponds to a single Analytics custom metric.", + "properties": { + "items": { + "type": "array", + "description": "Collection of custom metrics.", + "items": { + "$ref": "CustomMetric" + } + }, + "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#customMetrics" + }, + "nextLink": { + "type": "string", + "description": "Link to next page for this custom metric collection." + }, + "previousLink": { + "type": "string", + "description": "Link to previous page for this custom metric 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" + } + } + }, + "EntityAdWordsLink": { + "id": "EntityAdWordsLink", + "type": "object", + "description": "JSON template for Analytics Entity AdWords Link.", + "properties": { + "adWordsAccounts": { + "type": "array", + "description": "A list of AdWords client accounts. These cannot be MCC accounts. This field is required when creating an AdWords link. It cannot be empty.", + "items": { + "$ref": "AdWordsAccount" + }, + "annotations": { + "required": [ + "analytics.management.webPropertyAdWordsLinks.insert", + "analytics.management.webPropertyAdWordsLinks.update" + ] + } + }, + "entity": { + "type": "object", + "description": "Web property being linked.", + "properties": { + "webPropertyRef": { + "$ref": "WebPropertyRef" + } + } + }, + "id": { + "type": "string", + "description": "Entity AdWords link ID" + }, + "kind": { + "type": "string", + "description": "Resource type for entity AdWords link.", + "default": "analytics#entityAdWordsLink" + }, + "name": { + "type": "string", + "description": "Name of the link. This field is required when creating an AdWords link.", + "annotations": { + "required": [ + "analytics.management.webPropertyAdWordsLinks.insert", + "analytics.management.webPropertyAdWordsLinks.update" + ] + } + }, + "profileIds": { + "type": "array", + "description": "IDs of linked Views (Profiles) represented as strings.", + "items": { + "type": "string" + } + }, + "selfLink": { + "type": "string", + "description": "URL link for this Google Analytics - Google AdWords link." + } + } + }, + "EntityAdWordsLinks": { + "id": "EntityAdWordsLinks", + "type": "object", + "description": "An entity AdWords link collection provides a list of GA-AdWords links Each resource in this collection corresponds to a single link.", + "properties": { + "items": { + "type": "array", + "description": "A list of entity AdWords links.", + "items": { + "$ref": "EntityAdWordsLink" + } + }, + "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#entityAdWordsLinks" + }, + "nextLink": { + "type": "string", + "description": "Next link for this AdWords link collection." + }, + "previousLink": { + "type": "string", + "description": "Previous link for this AdWords link 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" + } + } + }, + "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": "An integer number in [3, 90]. 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:sessionDuration\", \"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 in (0, 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 in (0, 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" + } + } + }, + "Filter": { + "id": "Filter", + "type": "object", + "description": "JSON template for an Analytics account filter.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID to which this filter belongs." + }, + "advancedDetails": { + "type": "object", + "description": "Details for the filter of the type ADVANCED.", + "properties": { + "caseSensitive": { + "type": "boolean", + "description": "Indicates if the filter expressions are case sensitive." + }, + "extractA": { + "type": "string", + "description": "Expression to extract from field A." + }, + "extractB": { + "type": "string", + "description": "Expression to extract from field B." + }, + "fieldA": { + "type": "string", + "description": "Field A." + }, + "fieldAIndex": { + "type": "integer", + "description": "The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION.", + "format": "int32" + }, + "fieldARequired": { + "type": "boolean", + "description": "Indicates if field A is required to match." + }, + "fieldB": { + "type": "string", + "description": "Field B." + }, + "fieldBIndex": { + "type": "integer", + "description": "The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION.", + "format": "int32" + }, + "fieldBRequired": { + "type": "boolean", + "description": "Indicates if field B is required to match." + }, + "outputConstructor": { + "type": "string", + "description": "Expression used to construct the output value." + }, + "outputToField": { + "type": "string", + "description": "Output field." + }, + "outputToFieldIndex": { + "type": "integer", + "description": "The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION.", + "format": "int32" + }, + "overrideOutputField": { + "type": "boolean", + "description": "Indicates if the existing value of the output field, if any, should be overridden by the output expression." + } + } + }, + "created": { + "type": "string", + "description": "Time this filter was created.", + "format": "date-time", + "readOnly": true + }, + "excludeDetails": { + "$ref": "FilterExpression", + "description": "Details for the filter of the type EXCLUDE." + }, + "id": { + "type": "string", + "description": "Filter ID." + }, + "includeDetails": { + "$ref": "FilterExpression", + "description": "Details for the filter of the type INCLUDE." + }, + "kind": { + "type": "string", + "description": "Resource type for Analytics filter.", + "default": "analytics#filter", + "readOnly": true + }, + "lowercaseDetails": { + "type": "object", + "description": "Details for the filter of the type LOWER.", + "properties": { + "field": { + "type": "string", + "description": "Field to use in the filter." + }, + "fieldIndex": { + "type": "integer", + "description": "The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION.", + "format": "int32" + } + } + }, + "name": { + "type": "string", + "description": "Name of this filter.", + "annotations": { + "required": [ + "analytics.management.filters.insert", + "analytics.management.filters.update" + ] + } + }, + "parentLink": { + "type": "object", + "description": "Parent link for this filter. Points to the account to which this filter belongs.", + "properties": { + "href": { + "type": "string", + "description": "Link to the account to which this filter belongs." + }, + "type": { + "type": "string", + "description": "Value is \"analytics#account\".", + "default": "analytics#account" + } + } + }, + "searchAndReplaceDetails": { + "type": "object", + "description": "Details for the filter of the type SEARCH_AND_REPLACE.", + "properties": { + "caseSensitive": { + "type": "boolean", + "description": "Determines if the filter is case sensitive." + }, + "field": { + "type": "string", + "description": "Field to use in the filter." + }, + "fieldIndex": { + "type": "integer", + "description": "The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION.", + "format": "int32" + }, + "replaceString": { + "type": "string", + "description": "Term to replace the search term with." + }, + "searchString": { + "type": "string", + "description": "Term to search." + } + } + }, + "selfLink": { + "type": "string", + "description": "Link for this filter.", + "readOnly": true + }, + "type": { + "type": "string", + "description": "Type of this filter. Possible values are INCLUDE, EXCLUDE, LOWERCASE, UPPERCASE, SEARCH_AND_REPLACE and ADVANCED.", + "annotations": { + "required": [ + "analytics.management.filters.insert", + "analytics.management.filters.update" + ] + } + }, + "updated": { + "type": "string", + "description": "Time this filter was last modified.", + "format": "date-time", + "readOnly": true + }, + "uppercaseDetails": { + "type": "object", + "description": "Details for the filter of the type UPPER.", + "properties": { + "field": { + "type": "string", + "description": "Field to use in the filter." + }, + "fieldIndex": { + "type": "integer", + "description": "The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION.", + "format": "int32" + } + } + } + } + }, + "FilterExpression": { + "id": "FilterExpression", + "type": "object", + "description": "JSON template for an Analytics filter expression.", + "properties": { + "caseSensitive": { + "type": "boolean", + "description": "Determines if the filter is case sensitive." + }, + "expressionValue": { + "type": "string", + "description": "Filter expression value" + }, + "field": { + "type": "string", + "description": "Field to filter. Possible values: \n- Content and Traffic \n- PAGE_REQUEST_URI, \n- PAGE_HOSTNAME, \n- PAGE_TITLE, \n- REFERRAL, \n- COST_DATA_URI (Campaign target URL), \n- HIT_TYPE, \n- INTERNAL_SEARCH_TERM, \n- INTERNAL_SEARCH_TYPE, \n- SOURCE_PROPERTY_TRACKING_ID, \n- Campaign or AdGroup \n- CAMPAIGN_SOURCE, \n- CAMPAIGN_MEDIUM, \n- CAMPAIGN_NAME, \n- CAMPAIGN_AD_GROUP, \n- CAMPAIGN_TERM, \n- CAMPAIGN_CONTENT, \n- CAMPAIGN_CODE, \n- CAMPAIGN_REFERRAL_PATH, \n- E-Commerce \n- TRANSACTION_COUNTRY, \n- TRANSACTION_REGION, \n- TRANSACTION_CITY, \n- TRANSACTION_AFFILIATION (Store or order location), \n- ITEM_NAME, \n- ITEM_CODE, \n- ITEM_VARIATION, \n- TRANSACTION_ID, \n- TRANSACTION_CURRENCY_CODE, \n- PRODUCT_ACTION_TYPE, \n- Audience/Users \n- BROWSER, \n- BROWSER_VERSION, \n- BROWSER_SIZE, \n- PLATFORM, \n- PLATFORM_VERSION, \n- LANGUAGE, \n- SCREEN_RESOLUTION, \n- SCREEN_COLORS, \n- JAVA_ENABLED (Boolean Field), \n- FLASH_VERSION, \n- GEO_SPEED (Connection speed), \n- VISITOR_TYPE, \n- GEO_ORGANIZATION (ISP organization), \n- GEO_DOMAIN, \n- GEO_IP_ADDRESS, \n- GEO_IP_VERSION, \n- Location \n- GEO_COUNTRY, \n- GEO_REGION, \n- GEO_CITY, \n- Event \n- EVENT_CATEGORY, \n- EVENT_ACTION, \n- EVENT_LABEL, \n- Other \n- CUSTOM_FIELD_1, \n- CUSTOM_FIELD_2, \n- USER_DEFINED_VALUE, \n- Application \n- APP_ID, \n- APP_INSTALLER_ID, \n- APP_NAME, \n- APP_VERSION, \n- SCREEN, \n- IS_APP (Boolean Field), \n- IS_FATAL_EXCEPTION (Boolean Field), \n- EXCEPTION_DESCRIPTION, \n- Mobile device \n- IS_MOBILE (Boolean Field, Deprecated. Use DEVICE_CATEGORY=mobile), \n- IS_TABLET (Boolean Field, Deprecated. Use DEVICE_CATEGORY=tablet), \n- DEVICE_CATEGORY, \n- MOBILE_HAS_QWERTY_KEYBOARD (Boolean Field), \n- MOBILE_HAS_NFC_SUPPORT (Boolean Field), \n- MOBILE_HAS_CELLULAR_RADIO (Boolean Field), \n- MOBILE_HAS_WIFI_SUPPORT (Boolean Field), \n- MOBILE_BRAND_NAME, \n- MOBILE_MODEL_NAME, \n- MOBILE_MARKETING_NAME, \n- MOBILE_POINTING_METHOD, \n- Social \n- SOCIAL_NETWORK, \n- SOCIAL_ACTION, \n- SOCIAL_ACTION_TARGET, \n- Custom dimension \n- CUSTOM_DIMENSION (See accompanying field index)," + }, + "fieldIndex": { + "type": "integer", + "description": "The Index of the custom dimension. Set only if the field is a is CUSTOM_DIMENSION.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Kind value for filter expression", + "default": "analytics#filterExpression" + }, + "matchType": { + "type": "string", + "description": "Match type for this filter. Possible values are BEGINS_WITH, EQUAL, ENDS_WITH, CONTAINS, or MATCHES. GEO_DOMAIN, GEO_IP_ADDRESS, PAGE_REQUEST_URI, or PAGE_HOSTNAME filters can use any match type; all other filters must use MATCHES." + } + } + }, + "FilterRef": { + "id": "FilterRef", + "type": "object", + "description": "JSON template for a profile filter link.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID to which this filter belongs.", + "readOnly": true + }, + "href": { + "type": "string", + "description": "Link for this filter." + }, + "id": { + "type": "string", + "description": "Filter ID.", + "annotations": { + "required": [ + "analytics.management.profileFilterLinks.insert" + ] + } + }, + "kind": { + "type": "string", + "description": "Kind value for filter reference.", + "default": "analytics#filterRef" + }, + "name": { + "type": "string", + "description": "Name of this filter.", + "readOnly": true + } + } + }, + "Filters": { + "id": "Filters", + "type": "object", + "description": "A filter collection lists filters created by users in an Analytics account. Each resource in the collection corresponds to a filter.", + "properties": { + "items": { + "type": "array", + "description": "A list of filters.", + "items": { + "$ref": "Filter" + } + }, + "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 1,000 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#filters" + }, + "nextLink": { + "type": "string", + "description": "Link to next page for this filter collection." + }, + "previousLink": { + "type": "string", + "description": "Link to previous page for this filter 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" + } + } + }, + "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), defaults to USD. 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)." + }, + "enhancedECommerceTracking": { + "type": "boolean", + "description": "Indicates whether enhanced ecommerce tracking is enabled for this view (profile). This property can only be enabled if ecommerce tracking is enabled." + }, + "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)." + } + } + }, + "ProfileFilterLink": { + "id": "ProfileFilterLink", + "type": "object", + "description": "JSON template for an Analytics profile filter link.", + "properties": { + "filterRef": { + "$ref": "FilterRef", + "description": "Filter for this link." + }, + "id": { + "type": "string", + "description": "Profile filter link ID." + }, + "kind": { + "type": "string", + "description": "Resource type for Analytics filter.", + "default": "analytics#profileFilterLink", + "readOnly": true + }, + "profileRef": { + "$ref": "ProfileRef", + "description": "View (Profile) for this link." + }, + "rank": { + "type": "integer", + "description": "The rank of this profile filter link relative to the other filters linked to the same profile.\nFor readonly (i.e., list and get) operations, the rank always starts at 1.\nFor write (i.e., create, update, or delete) operations, you may specify a value between 0 and 255 inclusively, [0, 255]. In order to insert a link at the end of the list, either don't specify a rank or set a rank to a number greater than the largest rank in the list. In order to insert a link to the beginning of the list specify a rank that is less than or equal to 1. The new link will move all existing filters with the same or lower rank down the list. After the link is inserted/updated/deleted all profile filter links will be renumbered starting at 1.", + "format": "int32" + }, + "selfLink": { + "type": "string", + "description": "Link for this profile filter link.", + "readOnly": true + } + } + }, + "ProfileFilterLinks": { + "id": "ProfileFilterLinks", + "type": "object", + "description": "A profile filter link collection lists profile filter links between profiles and filters. Each resource in the collection corresponds to a profile filter link.", + "properties": { + "items": { + "type": "array", + "description": "A list of profile filter links.", + "items": { + "$ref": "ProfileFilterLink" + } + }, + "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 1,000 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#profileFilterLinks" + }, + "nextLink": { + "type": "string", + "description": "Link to next page for this profile filter link collection." + }, + "previousLink": { + "type": "string", + "description": "Link to previous page for this profile filter link 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" + } + } + }, + "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" + } + } + }, + "UnsampledReport": { + "id": "UnsampledReport", + "type": "object", + "description": "JSON template for Analytics unsampled report resource.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID to which this unsampled report belongs." + }, + "cloudStorageDownloadDetails": { + "type": "object", + "description": "Download details for a file stored in Google Cloud Storage.", + "readOnly": true, + "properties": { + "bucketId": { + "type": "string", + "description": "Id of the bucket the file object is stored in." + }, + "objectId": { + "type": "string", + "description": "Id of the file object containing the report data." + } + } + }, + "created": { + "type": "string", + "description": "Time this unsampled report was created.", + "format": "date-time", + "readOnly": true + }, + "dimensions": { + "type": "string", + "description": "The dimensions for the unsampled report." + }, + "downloadType": { + "type": "string", + "description": "The type of download you need to use for the report data file.", + "readOnly": true + }, + "driveDownloadDetails": { + "type": "object", + "description": "Download details for a file stored in Google Drive.", + "readOnly": true, + "properties": { + "documentId": { + "type": "string", + "description": "Id of the document/file containing the report data." + } + } + }, + "end-date": { + "type": "string", + "description": "The end date for the unsampled report.", + "annotations": { + "required": [ + "analytics.management.filters.insert", + "analytics.management.unsampledReports.insert" + ] + } + }, + "filters": { + "type": "string", + "description": "The filters for the unsampled report." + }, + "id": { + "type": "string", + "description": "Unsampled report ID." + }, + "kind": { + "type": "string", + "description": "Resource type for an Analytics unsampled report.", + "default": "analytics#unsampledReport", + "readOnly": true + }, + "metrics": { + "type": "string", + "description": "The metrics for the unsampled report.", + "annotations": { + "required": [ + "analytics.management.filters.insert", + "analytics.management.unsampledReports.insert" + ] + } + }, + "profileId": { + "type": "string", + "description": "View (Profile) ID to which this unsampled report belongs." + }, + "segment": { + "type": "string", + "description": "The segment for the unsampled report." + }, + "selfLink": { + "type": "string", + "description": "Link for this unsampled report.", + "readOnly": true + }, + "start-date": { + "type": "string", + "description": "The start date for the unsampled report.", + "annotations": { + "required": [ + "analytics.management.filters.insert", + "analytics.management.unsampledReports.insert" + ] + } + }, + "status": { + "type": "string", + "description": "Status of this unsampled report. Possible values are PENDING, COMPLETED, or FAILED.", + "readOnly": true + }, + "title": { + "type": "string", + "description": "Title of the unsampled report.", + "annotations": { + "required": [ + "analytics.management.filters.insert", + "analytics.management.unsampledReports.insert" + ] + } + }, + "updated": { + "type": "string", + "description": "Time this unsampled report was last modified.", + "format": "date-time", + "readOnly": true + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID to which this unsampled report belongs. The web property ID is of the form UA-XXXXX-YY." + } + } + }, + "UnsampledReports": { + "id": "UnsampledReports", + "type": "object", + "description": "An unsampled report collection lists Analytics unsampled reports to which the user has access. Each view (profile) can have a set of unsampled reports. Each resource in the unsampled report collection corresponds to a single Analytics unsampled report.", + "properties": { + "items": { + "type": "array", + "description": "A list of unsampled reports.", + "items": { + "$ref": "UnsampledReport" + } + }, + "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#unsampledReports" + }, + "nextLink": { + "type": "string", + "description": "Link to next page for this unsampled report collection." + }, + "previousLink": { + "type": "string", + "description": "Link to previous page for this unsampled report 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" + } + } + }, + "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:sessions,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:activeUsers'. 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 account summaries to include in this response, where the largest acceptable value is 1000.", + "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", + "https://www.googleapis.com/auth/analytics.manage.users.readonly" + ] + }, + "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" + ] + } + } + }, + "customDimensions": { + "methods": { + "get": { + "id": "analytics.management.customDimensions.get", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}", + "httpMethod": "GET", + "description": "Get a custom dimension to which the user has access.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID for the custom dimension to retrieve.", + "required": true, + "location": "path" + }, + "customDimensionId": { + "type": "string", + "description": "The ID of the custom dimension to retrieve.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID for the custom dimension to retrieve.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "customDimensionId" + ], + "response": { + "$ref": "CustomDimension" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + }, + "insert": { + "id": "analytics.management.customDimensions.insert", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions", + "httpMethod": "POST", + "description": "Create a new custom dimension.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID for the custom dimension to create.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID for the custom dimension to create.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId" + ], + "request": { + "$ref": "CustomDimension" + }, + "response": { + "$ref": "CustomDimension" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "list": { + "id": "analytics.management.customDimensions.list", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions", + "httpMethod": "GET", + "description": "Lists custom dimensions to which the user has access.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID for the custom dimensions to retrieve.", + "required": true, + "location": "path" + }, + "max-results": { + "type": "integer", + "description": "The maximum number of custom dimensions 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 custom dimensions to retrieve.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId" + ], + "response": { + "$ref": "CustomDimensions" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.readonly" + ] + }, + "patch": { + "id": "analytics.management.customDimensions.patch", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}", + "httpMethod": "PATCH", + "description": "Updates an existing custom dimension. This method supports patch semantics.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID for the custom dimension to update.", + "required": true, + "location": "path" + }, + "customDimensionId": { + "type": "string", + "description": "Custom dimension ID for the custom dimension to update.", + "required": true, + "location": "path" + }, + "ignoreCustomDataSourceLinks": { + "type": "boolean", + "description": "Force the update and ignore any warnings related to the custom dimension being linked to a custom data source / data set.", + "default": "false", + "location": "query" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID for the custom dimension to update.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "customDimensionId" + ], + "request": { + "$ref": "CustomDimension" + }, + "response": { + "$ref": "CustomDimension" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "update": { + "id": "analytics.management.customDimensions.update", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}", + "httpMethod": "PUT", + "description": "Updates an existing custom dimension.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID for the custom dimension to update.", + "required": true, + "location": "path" + }, + "customDimensionId": { + "type": "string", + "description": "Custom dimension ID for the custom dimension to update.", + "required": true, + "location": "path" + }, + "ignoreCustomDataSourceLinks": { + "type": "boolean", + "description": "Force the update and ignore any warnings related to the custom dimension being linked to a custom data source / data set.", + "default": "false", + "location": "query" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID for the custom dimension to update.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "customDimensionId" + ], + "request": { + "$ref": "CustomDimension" + }, + "response": { + "$ref": "CustomDimension" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + } + } + }, + "customMetrics": { + "methods": { + "get": { + "id": "analytics.management.customMetrics.get", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}", + "httpMethod": "GET", + "description": "Get a custom metric to which the user has access.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID for the custom metric to retrieve.", + "required": true, + "location": "path" + }, + "customMetricId": { + "type": "string", + "description": "The ID of the custom metric to retrieve.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID for the custom metric to retrieve.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "customMetricId" + ], + "response": { + "$ref": "CustomMetric" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + }, + "insert": { + "id": "analytics.management.customMetrics.insert", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics", + "httpMethod": "POST", + "description": "Create a new custom metric.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID for the custom metric to create.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID for the custom dimension to create.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId" + ], + "request": { + "$ref": "CustomMetric" + }, + "response": { + "$ref": "CustomMetric" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "list": { + "id": "analytics.management.customMetrics.list", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics", + "httpMethod": "GET", + "description": "Lists custom metrics to which the user has access.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID for the custom metrics to retrieve.", + "required": true, + "location": "path" + }, + "max-results": { + "type": "integer", + "description": "The maximum number of custom metrics 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 custom metrics to retrieve.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId" + ], + "response": { + "$ref": "CustomMetrics" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.readonly" + ] + }, + "patch": { + "id": "analytics.management.customMetrics.patch", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}", + "httpMethod": "PATCH", + "description": "Updates an existing custom metric. This method supports patch semantics.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID for the custom metric to update.", + "required": true, + "location": "path" + }, + "customMetricId": { + "type": "string", + "description": "Custom metric ID for the custom metric to update.", + "required": true, + "location": "path" + }, + "ignoreCustomDataSourceLinks": { + "type": "boolean", + "description": "Force the update and ignore any warnings related to the custom metric being linked to a custom data source / data set.", + "default": "false", + "location": "query" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID for the custom metric to update.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "customMetricId" + ], + "request": { + "$ref": "CustomMetric" + }, + "response": { + "$ref": "CustomMetric" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "update": { + "id": "analytics.management.customMetrics.update", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}", + "httpMethod": "PUT", + "description": "Updates an existing custom metric.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID for the custom metric to update.", + "required": true, + "location": "path" + }, + "customMetricId": { + "type": "string", + "description": "Custom metric ID for the custom metric to update.", + "required": true, + "location": "path" + }, + "ignoreCustomDataSourceLinks": { + "type": "boolean", + "description": "Force the update and ignore any warnings related to the custom metric being linked to a custom data source / data set.", + "default": "false", + "location": "query" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID for the custom metric to update.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "customMetricId" + ], + "request": { + "$ref": "CustomMetric" + }, + "response": { + "$ref": "CustomMetric" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + } + } + }, + "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" + ] + } + } + }, + "filters": { + "methods": { + "delete": { + "id": "analytics.management.filters.delete", + "path": "management/accounts/{accountId}/filters/{filterId}", + "httpMethod": "DELETE", + "description": "Delete a filter.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to delete the filter for.", + "required": true, + "location": "path" + }, + "filterId": { + "type": "string", + "description": "ID of the filter to be deleted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "filterId" + ], + "response": { + "$ref": "Filter" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "get": { + "id": "analytics.management.filters.get", + "path": "management/accounts/{accountId}/filters/{filterId}", + "httpMethod": "GET", + "description": "Returns a filters to which the user has access.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to retrieve filters for.", + "required": true, + "location": "path" + }, + "filterId": { + "type": "string", + "description": "Filter ID to retrieve filters for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "filterId" + ], + "response": { + "$ref": "Filter" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + }, + "insert": { + "id": "analytics.management.filters.insert", + "path": "management/accounts/{accountId}/filters", + "httpMethod": "POST", + "description": "Create a new filter.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to create filter for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId" + ], + "request": { + "$ref": "Filter" + }, + "response": { + "$ref": "Filter" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "list": { + "id": "analytics.management.filters.list", + "path": "management/accounts/{accountId}/filters", + "httpMethod": "GET", + "description": "Lists all filters for an account", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to retrieve filters for.", + "required": true, + "pattern": "\\d+", + "location": "path" + }, + "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" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "Filters" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + }, + "patch": { + "id": "analytics.management.filters.patch", + "path": "management/accounts/{accountId}/filters/{filterId}", + "httpMethod": "PATCH", + "description": "Updates an existing filter. This method supports patch semantics.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to which the filter belongs.", + "required": true, + "location": "path" + }, + "filterId": { + "type": "string", + "description": "ID of the filter to be updated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "filterId" + ], + "request": { + "$ref": "Filter" + }, + "response": { + "$ref": "Filter" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "update": { + "id": "analytics.management.filters.update", + "path": "management/accounts/{accountId}/filters/{filterId}", + "httpMethod": "PUT", + "description": "Updates an existing filter.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to which the filter belongs.", + "required": true, + "location": "path" + }, + "filterId": { + "type": "string", + "description": "ID of the filter to be updated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "filterId" + ], + "request": { + "$ref": "Filter" + }, + "response": { + "$ref": "Filter" + }, + "scopes": [ + "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" + ] + } + } + }, + "profileFilterLinks": { + "methods": { + "delete": { + "id": "analytics.management.profileFilterLinks.delete", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}", + "httpMethod": "DELETE", + "description": "Delete a profile filter link.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to which the profile filter link belongs.", + "required": true, + "pattern": "\\d+", + "location": "path" + }, + "linkId": { + "type": "string", + "description": "ID of the profile filter link to delete.", + "required": true, + "pattern": "\\d+:\\d+", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "Profile ID to which the filter link belongs.", + "required": true, + "pattern": "\\d+", + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property Id to which the profile filter link belongs.", + "required": true, + "pattern": "UA-(\\d+)-(\\d+)", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId", + "linkId" + ], + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "get": { + "id": "analytics.management.profileFilterLinks.get", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}", + "httpMethod": "GET", + "description": "Returns a single profile filter link.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to retrieve profile filter link for.", + "required": true, + "pattern": "\\d+", + "location": "path" + }, + "linkId": { + "type": "string", + "description": "ID of the profile filter link.", + "required": true, + "pattern": "\\d+:\\d+", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "Profile ID to retrieve filter link for.", + "required": true, + "pattern": "\\d+", + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property Id to retrieve profile filter link for.", + "required": true, + "pattern": "UA-(\\d+)-(\\d+)", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId", + "linkId" + ], + "response": { + "$ref": "ProfileFilterLink" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + }, + "insert": { + "id": "analytics.management.profileFilterLinks.insert", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks", + "httpMethod": "POST", + "description": "Create a new profile filter link.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to create profile filter link for.", + "required": true, + "pattern": "\\d+", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "Profile ID to create filter link for.", + "required": true, + "pattern": "\\d+", + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property Id to create profile filter link for.", + "required": true, + "pattern": "UA-(\\d+)-(\\d+)", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId" + ], + "request": { + "$ref": "ProfileFilterLink" + }, + "response": { + "$ref": "ProfileFilterLink" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "list": { + "id": "analytics.management.profileFilterLinks.list", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks", + "httpMethod": "GET", + "description": "Lists all profile filter links for a profile.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to retrieve profile filter links for.", + "required": true, + "pattern": "\\d+", + "location": "path" + }, + "max-results": { + "type": "integer", + "description": "The maximum number of profile filter links to include in this response.", + "format": "int32", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "Profile ID to retrieve filter links for. Can either be a specific profile ID or '~all', which refers to all the profiles that user has access to.", + "required": true, + "location": "path" + }, + "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 profile filter links 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": "ProfileFilterLinks" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + }, + "patch": { + "id": "analytics.management.profileFilterLinks.patch", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}", + "httpMethod": "PATCH", + "description": "Update an existing profile filter link. This method supports patch semantics.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to which profile filter link belongs.", + "required": true, + "pattern": "\\d+", + "location": "path" + }, + "linkId": { + "type": "string", + "description": "ID of the profile filter link to be updated.", + "required": true, + "pattern": "\\d+:\\d+", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "Profile ID to which filter link belongs", + "required": true, + "pattern": "\\d+", + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property Id to which profile filter link belongs", + "required": true, + "pattern": "UA-(\\d+)-(\\d+)", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId", + "linkId" + ], + "request": { + "$ref": "ProfileFilterLink" + }, + "response": { + "$ref": "ProfileFilterLink" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "update": { + "id": "analytics.management.profileFilterLinks.update", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}", + "httpMethod": "PUT", + "description": "Update an existing profile filter link.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to which profile filter link belongs.", + "required": true, + "pattern": "\\d+", + "location": "path" + }, + "linkId": { + "type": "string", + "description": "ID of the profile filter link to be updated.", + "required": true, + "pattern": "\\d+:\\d+", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "Profile ID to which filter link belongs", + "required": true, + "pattern": "\\d+", + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property Id to which profile filter link belongs", + "required": true, + "pattern": "UA-(\\d+)-(\\d+)", + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId", + "linkId" + ], + "request": { + "$ref": "ProfileFilterLink" + }, + "response": { + "$ref": "ProfileFilterLink" + }, + "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. Can either be a specific profile ID or '~all', which refers to all the profiles that user has access to.", + "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. 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": "EntityUserLinks" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.manage.users", + "https://www.googleapis.com/auth/analytics.manage.users.readonly" + ] + }, + "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" + ] + } + } + }, + "unsampledReports": { + "methods": { + "get": { + "id": "analytics.management.unsampledReports.get", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}", + "httpMethod": "GET", + "description": "Returns a single unsampled report.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to retrieve unsampled report for.", + "required": true, + "location": "path" + }, + "profileId": { + "type": "string", + "description": "View (Profile) ID to retrieve unsampled report for.", + "required": true, + "location": "path" + }, + "unsampledReportId": { + "type": "string", + "description": "ID of the unsampled report to retrieve.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID to retrieve unsampled reports for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId", + "unsampledReportId" + ], + "response": { + "$ref": "UnsampledReport" + }, + "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.unsampledReports.insert", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports", + "httpMethod": "POST", + "description": "Create a new unsampled report.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to create the unsampled report for.", + "required": true, + "location": "path" + }, + "profileId": { + "type": "string", + "description": "View (Profile) ID to create the unsampled report for.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID to create the unsampled report for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId" + ], + "request": { + "$ref": "UnsampledReport" + }, + "response": { + "$ref": "UnsampledReport" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics", + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "list": { + "id": "analytics.management.unsampledReports.list", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports", + "httpMethod": "GET", + "description": "Lists unsampled reports to which the user has access.", + "parameters": { + "accountId": { + "type": "string", + "description": "Account ID to retrieve unsampled reports for. Must be a specific account ID, ~all is not supported.", + "required": true, + "location": "path" + }, + "max-results": { + "type": "integer", + "description": "The maximum number of unsampled reports to include in this response.", + "format": "int32", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "View (Profile) ID to retrieve unsampled reports for. Must be a specific view (profile) ID, ~all is not supported.", + "required": true, + "location": "path" + }, + "start-index": { + "type": "integer", + "description": "An index of the first unsampled report 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 unsampled reports for. Must be a specific web property ID, ~all is not supported.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "profileId" + ], + "response": { + "$ref": "UnsampledReports" + }, + "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" + } + } + } + } + } + }, + "webPropertyAdWordsLinks": { + "methods": { + "delete": { + "id": "analytics.management.webPropertyAdWordsLinks.delete", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}", + "httpMethod": "DELETE", + "description": "Deletes a web property-AdWords link.", + "parameters": { + "accountId": { + "type": "string", + "description": "ID of the account which the given web property belongs to.", + "required": true, + "location": "path" + }, + "webPropertyAdWordsLinkId": { + "type": "string", + "description": "Web property AdWords link ID.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID to delete the AdWords link for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "webPropertyAdWordsLinkId" + ], + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "get": { + "id": "analytics.management.webPropertyAdWordsLinks.get", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}", + "httpMethod": "GET", + "description": "Returns a web property-AdWords link to which the user has access.", + "parameters": { + "accountId": { + "type": "string", + "description": "ID of the account which the given web property belongs to.", + "required": true, + "location": "path" + }, + "webPropertyAdWordsLinkId": { + "type": "string", + "description": "Web property-AdWords link ID.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID to retrieve the AdWords link for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "webPropertyAdWordsLinkId" + ], + "response": { + "$ref": "EntityAdWordsLink" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + }, + "insert": { + "id": "analytics.management.webPropertyAdWordsLinks.insert", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks", + "httpMethod": "POST", + "description": "Creates a webProperty-AdWords link.", + "parameters": { + "accountId": { + "type": "string", + "description": "ID of the Google Analytics account to create the link for.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID to create the link for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId" + ], + "request": { + "$ref": "EntityAdWordsLink" + }, + "response": { + "$ref": "EntityAdWordsLink" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "list": { + "id": "analytics.management.webPropertyAdWordsLinks.list", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks", + "httpMethod": "GET", + "description": "Lists webProperty-AdWords links for a given web property.", + "parameters": { + "accountId": { + "type": "string", + "description": "ID of the account which the given web property belongs to.", + "required": true, + "pattern": "\\d+", + "location": "path" + }, + "max-results": { + "type": "integer", + "description": "The maximum number of webProperty-AdWords links to include in this response.", + "format": "int32", + "location": "query" + }, + "start-index": { + "type": "integer", + "description": "An index of the first webProperty-AdWords 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 to retrieve the AdWords links for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId" + ], + "response": { + "$ref": "EntityAdWordsLinks" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit", + "https://www.googleapis.com/auth/analytics.readonly" + ] + }, + "patch": { + "id": "analytics.management.webPropertyAdWordsLinks.patch", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}", + "httpMethod": "PATCH", + "description": "Updates an existing webProperty-AdWords link. This method supports patch semantics.", + "parameters": { + "accountId": { + "type": "string", + "description": "ID of the account which the given web property belongs to.", + "required": true, + "location": "path" + }, + "webPropertyAdWordsLinkId": { + "type": "string", + "description": "Web property-AdWords link ID.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID to retrieve the AdWords link for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "webPropertyAdWordsLinkId" + ], + "request": { + "$ref": "EntityAdWordsLink" + }, + "response": { + "$ref": "EntityAdWordsLink" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + }, + "update": { + "id": "analytics.management.webPropertyAdWordsLinks.update", + "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}", + "httpMethod": "PUT", + "description": "Updates an existing webProperty-AdWords link.", + "parameters": { + "accountId": { + "type": "string", + "description": "ID of the account which the given web property belongs to.", + "required": true, + "location": "path" + }, + "webPropertyAdWordsLinkId": { + "type": "string", + "description": "Web property-AdWords link ID.", + "required": true, + "location": "path" + }, + "webPropertyId": { + "type": "string", + "description": "Web property ID to retrieve the AdWords link for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "webPropertyId", + "webPropertyAdWordsLinkId" + ], + "request": { + "$ref": "EntityAdWordsLink" + }, + "response": { + "$ref": "EntityAdWordsLink" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.edit" + ] + } + } + }, + "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. 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" + ], + "response": { + "$ref": "EntityUserLinks" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.manage.users", + "https://www.googleapis.com/auth/analytics.manage.users.readonly" + ] + }, + "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" + ] + } + } + } + } + }, + "provisioning": { + "methods": { + "createAccountTicket": { + "id": "analytics.provisioning.createAccountTicket", + "path": "provisioning/createAccountTicket", + "httpMethod": "POST", + "description": "Creates an account ticket.", + "request": { + "$ref": "AccountTicket" + }, + "response": { + "$ref": "AccountTicket" + }, + "scopes": [ + "https://www.googleapis.com/auth/analytics.provision" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/analytics/v3/analytics-gen.go b/Godeps/_workspace/src/google.golang.org/api/analytics/v3/analytics-gen.go new file mode 100644 index 000000000..634d8ba88 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/analytics/v3/analytics-gen.go @@ -0,0 +1,16243 @@ +// Package analytics provides access to the Google Analytics API. +// +// See https://developers.google.com/analytics/ +// +// Usage example: +// +// import "google.golang.org/api/analytics/v3" +// ... +// analyticsService, err := analytics.New(oauthHttpClient) +package analytics // import "google.golang.org/api/analytics/v3" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 Google Analytics user permissions + AnalyticsManageUsersReadonlyScope = "https://www.googleapis.com/auth/analytics.manage.users.readonly" + + // Create a new Google Analytics account along with its default property + // and view + AnalyticsProvisionScope = "https://www.googleapis.com/auth/analytics.provision" + + // 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) + s.Provisioning = NewProvisioningService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Data *DataService + + Management *ManagementService + + Metadata *MetadataService + + Provisioning *ProvisioningService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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.CustomDimensions = NewManagementCustomDimensionsService(s) + rs.CustomMetrics = NewManagementCustomMetricsService(s) + rs.Experiments = NewManagementExperimentsService(s) + rs.Filters = NewManagementFiltersService(s) + rs.Goals = NewManagementGoalsService(s) + rs.ProfileFilterLinks = NewManagementProfileFilterLinksService(s) + rs.ProfileUserLinks = NewManagementProfileUserLinksService(s) + rs.Profiles = NewManagementProfilesService(s) + rs.Segments = NewManagementSegmentsService(s) + rs.UnsampledReports = NewManagementUnsampledReportsService(s) + rs.Uploads = NewManagementUploadsService(s) + rs.WebPropertyAdWordsLinks = NewManagementWebPropertyAdWordsLinksService(s) + rs.Webproperties = NewManagementWebpropertiesService(s) + rs.WebpropertyUserLinks = NewManagementWebpropertyUserLinksService(s) + return rs +} + +type ManagementService struct { + s *Service + + AccountSummaries *ManagementAccountSummariesService + + AccountUserLinks *ManagementAccountUserLinksService + + Accounts *ManagementAccountsService + + CustomDataSources *ManagementCustomDataSourcesService + + CustomDimensions *ManagementCustomDimensionsService + + CustomMetrics *ManagementCustomMetricsService + + Experiments *ManagementExperimentsService + + Filters *ManagementFiltersService + + Goals *ManagementGoalsService + + ProfileFilterLinks *ManagementProfileFilterLinksService + + ProfileUserLinks *ManagementProfileUserLinksService + + Profiles *ManagementProfilesService + + Segments *ManagementSegmentsService + + UnsampledReports *ManagementUnsampledReportsService + + Uploads *ManagementUploadsService + + WebPropertyAdWordsLinks *ManagementWebPropertyAdWordsLinksService + + 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 NewManagementCustomDimensionsService(s *Service) *ManagementCustomDimensionsService { + rs := &ManagementCustomDimensionsService{s: s} + return rs +} + +type ManagementCustomDimensionsService struct { + s *Service +} + +func NewManagementCustomMetricsService(s *Service) *ManagementCustomMetricsService { + rs := &ManagementCustomMetricsService{s: s} + return rs +} + +type ManagementCustomMetricsService struct { + s *Service +} + +func NewManagementExperimentsService(s *Service) *ManagementExperimentsService { + rs := &ManagementExperimentsService{s: s} + return rs +} + +type ManagementExperimentsService struct { + s *Service +} + +func NewManagementFiltersService(s *Service) *ManagementFiltersService { + rs := &ManagementFiltersService{s: s} + return rs +} + +type ManagementFiltersService struct { + s *Service +} + +func NewManagementGoalsService(s *Service) *ManagementGoalsService { + rs := &ManagementGoalsService{s: s} + return rs +} + +type ManagementGoalsService struct { + s *Service +} + +func NewManagementProfileFilterLinksService(s *Service) *ManagementProfileFilterLinksService { + rs := &ManagementProfileFilterLinksService{s: s} + return rs +} + +type ManagementProfileFilterLinksService 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 NewManagementUnsampledReportsService(s *Service) *ManagementUnsampledReportsService { + rs := &ManagementUnsampledReportsService{s: s} + return rs +} + +type ManagementUnsampledReportsService struct { + s *Service +} + +func NewManagementUploadsService(s *Service) *ManagementUploadsService { + rs := &ManagementUploadsService{s: s} + return rs +} + +type ManagementUploadsService struct { + s *Service +} + +func NewManagementWebPropertyAdWordsLinksService(s *Service) *ManagementWebPropertyAdWordsLinksService { + rs := &ManagementWebPropertyAdWordsLinksService{s: s} + return rs +} + +type ManagementWebPropertyAdWordsLinksService 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 +} + +func NewProvisioningService(s *Service) *ProvisioningService { + rs := &ProvisioningService{s: s} + return rs +} + +type ProvisioningService struct { + s *Service +} + +// Account: JSON template for Analytics account entry. +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"` + + // ForceSendFields is a list of field names (e.g. "ChildLink") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Account) MarshalJSON() ([]byte, error) { + type noMethod Account + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountChildLink: Child link for an account entry. Points to the list +// of web properties for this account. +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"` + + // ForceSendFields is a list of field names (e.g. "Href") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountChildLink) MarshalJSON() ([]byte, error) { + type noMethod AccountChildLink + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountPermissions: Permissions the user has for this account. +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"` + + // ForceSendFields is a list of field names (e.g. "Effective") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountPermissions) MarshalJSON() ([]byte, error) { + type noMethod AccountPermissions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountRef: JSON template for a linked account. +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"` + + // ForceSendFields is a list of field names (e.g. "Href") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountRef) MarshalJSON() ([]byte, error) { + type noMethod AccountRef + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountSummaries: 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. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountSummaries) MarshalJSON() ([]byte, error) { + type noMethod AccountSummaries + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountSummary: JSON template for an Analytics AccountSummary. An +// AccountSummary is a lightweight tree comprised of +// properties/profiles. +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountSummary) MarshalJSON() ([]byte, error) { + type noMethod AccountSummary + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountTicket: JSON template for an Analytics account ticket. The +// account ticket consists of the ticket ID and the basic information +// for the account, property and profile. +type AccountTicket struct { + // Account: Account for this ticket. + Account *Account `json:"account,omitempty"` + + // Id: Account ticket ID used to access the account ticket. + Id string `json:"id,omitempty"` + + // Kind: Resource type for account ticket. + Kind string `json:"kind,omitempty"` + + // Profile: View (Profile) for the account. + Profile *Profile `json:"profile,omitempty"` + + // RedirectUri: Redirect URI where the user will be sent after accepting + // Terms of Service. Must be configured in APIs console as a callback + // URL. + RedirectUri string `json:"redirectUri,omitempty"` + + // Webproperty: Web property for the account. + Webproperty *Webproperty `json:"webproperty,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Account") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountTicket) MarshalJSON() ([]byte, error) { + type noMethod AccountTicket + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Accounts: 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. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Accounts) MarshalJSON() ([]byte, error) { + type noMethod Accounts + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdWordsAccount: JSON template for an AdWords account. +type AdWordsAccount struct { + // AutoTaggingEnabled: True if auto-tagging is enabled on the AdWords + // account. Read-only after the insert operation. + AutoTaggingEnabled bool `json:"autoTaggingEnabled,omitempty"` + + // CustomerId: Customer ID. This field is required when creating an + // AdWords link. + CustomerId string `json:"customerId,omitempty"` + + // Kind: Resource type for AdWords account. + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AutoTaggingEnabled") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdWordsAccount) MarshalJSON() ([]byte, error) { + type noMethod AdWordsAccount + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AnalyticsDataimportDeleteUploadDataRequest: Request template for the +// delete upload data request. +type AnalyticsDataimportDeleteUploadDataRequest struct { + // CustomDataImportUids: A list of upload UIDs. + CustomDataImportUids []string `json:"customDataImportUids,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "CustomDataImportUids") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AnalyticsDataimportDeleteUploadDataRequest) MarshalJSON() ([]byte, error) { + type noMethod AnalyticsDataimportDeleteUploadDataRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Column: JSON template for a metadata column. +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"` + + // ForceSendFields is a list of field names (e.g. "Attributes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Column) MarshalJSON() ([]byte, error) { + type noMethod Column + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Columns: Lists columns (dimensions and metrics) for a particular +// report type. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AttributeNames") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Columns) MarshalJSON() ([]byte, error) { + type noMethod Columns + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomDataSource: JSON template for an Analytics custom data source. +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"` + + ImportBehavior string `json:"importBehavior,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"` + + UploadType string `json:"uploadType,omitempty"` + + // WebPropertyId: Web property ID of the form UA-XXXXX-YY to which this + // custom data source belongs. + WebPropertyId string `json:"webPropertyId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomDataSource) MarshalJSON() ([]byte, error) { + type noMethod CustomDataSource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Href") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomDataSourceChildLink) MarshalJSON() ([]byte, error) { + type noMethod CustomDataSourceChildLink + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomDataSourceParentLink: Parent link for this custom data source. +// Points to the web property to which this custom data source belongs. +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"` + + // ForceSendFields is a list of field names (e.g. "Href") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomDataSourceParentLink) MarshalJSON() ([]byte, error) { + type noMethod CustomDataSourceParentLink + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomDataSources: Lists Analytics custom data sources to which the +// user has access. Each resource in the collection corresponds to a +// single Analytics custom data source. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomDataSources) MarshalJSON() ([]byte, error) { + type noMethod CustomDataSources + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomDimension: JSON template for Analytics Custom Dimension. +type CustomDimension struct { + // AccountId: Account ID. + AccountId string `json:"accountId,omitempty"` + + // Active: Boolean indicating whether the custom dimension is active. + Active bool `json:"active,omitempty"` + + // Created: Time the custom dimension was created. + Created string `json:"created,omitempty"` + + // Id: Custom dimension ID. + Id string `json:"id,omitempty"` + + // Index: Index of the custom dimension. + Index int64 `json:"index,omitempty"` + + // Kind: Kind value for a custom dimension. Set to + // "analytics#customDimension". It is a read-only field. + Kind string `json:"kind,omitempty"` + + // Name: Name of the custom dimension. + Name string `json:"name,omitempty"` + + // ParentLink: Parent link for the custom dimension. Points to the + // property to which the custom dimension belongs. + ParentLink *CustomDimensionParentLink `json:"parentLink,omitempty"` + + // Scope: Scope of the custom dimension: HIT, SESSION, USER or PRODUCT. + Scope string `json:"scope,omitempty"` + + // SelfLink: Link for the custom dimension + SelfLink string `json:"selfLink,omitempty"` + + // Updated: Time the custom dimension was last modified. + Updated string `json:"updated,omitempty"` + + // WebPropertyId: Property ID. + WebPropertyId string `json:"webPropertyId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomDimension) MarshalJSON() ([]byte, error) { + type noMethod CustomDimension + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomDimensionParentLink: Parent link for the custom dimension. +// Points to the property to which the custom dimension belongs. +type CustomDimensionParentLink struct { + // Href: Link to the property to which the custom dimension belongs. + Href string `json:"href,omitempty"` + + // Type: Type of the parent link. Set to "analytics#webproperty". + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Href") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomDimensionParentLink) MarshalJSON() ([]byte, error) { + type noMethod CustomDimensionParentLink + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomDimensions: A custom dimension collection lists Analytics +// custom dimensions to which the user has access. Each resource in the +// collection corresponds to a single Analytics custom dimension. +type CustomDimensions struct { + // Items: Collection of custom dimensions. + Items []*CustomDimension `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 dimension collection. + NextLink string `json:"nextLink,omitempty"` + + // PreviousLink: Link to previous page for this custom dimension + // 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomDimensions) MarshalJSON() ([]byte, error) { + type noMethod CustomDimensions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomMetric: JSON template for Analytics Custom Metric. +type CustomMetric struct { + // AccountId: Account ID. + AccountId string `json:"accountId,omitempty"` + + // Active: Boolean indicating whether the custom metric is active. + Active bool `json:"active,omitempty"` + + // Created: Time the custom metric was created. + Created string `json:"created,omitempty"` + + // Id: Custom metric ID. + Id string `json:"id,omitempty"` + + // Index: Index of the custom metric. + Index int64 `json:"index,omitempty"` + + // Kind: Kind value for a custom metric. Set to + // "analytics#customMetric". It is a read-only field. + Kind string `json:"kind,omitempty"` + + // MaxValue: Max value of custom metric. + MaxValue string `json:"max_value,omitempty"` + + // MinValue: Min value of custom metric. + MinValue string `json:"min_value,omitempty"` + + // Name: Name of the custom metric. + Name string `json:"name,omitempty"` + + // ParentLink: Parent link for the custom metric. Points to the property + // to which the custom metric belongs. + ParentLink *CustomMetricParentLink `json:"parentLink,omitempty"` + + // Scope: Scope of the custom metric: HIT or PRODUCT. + Scope string `json:"scope,omitempty"` + + // SelfLink: Link for the custom metric + SelfLink string `json:"selfLink,omitempty"` + + // Type: Data type of custom metric. + Type string `json:"type,omitempty"` + + // Updated: Time the custom metric was last modified. + Updated string `json:"updated,omitempty"` + + // WebPropertyId: Property ID. + WebPropertyId string `json:"webPropertyId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomMetric) MarshalJSON() ([]byte, error) { + type noMethod CustomMetric + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomMetricParentLink: Parent link for the custom metric. Points to +// the property to which the custom metric belongs. +type CustomMetricParentLink struct { + // Href: Link to the property to which the custom metric belongs. + Href string `json:"href,omitempty"` + + // Type: Type of the parent link. Set to "analytics#webproperty". + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Href") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomMetricParentLink) MarshalJSON() ([]byte, error) { + type noMethod CustomMetricParentLink + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomMetrics: A custom metric collection lists Analytics custom +// metrics to which the user has access. Each resource in the collection +// corresponds to a single Analytics custom metric. +type CustomMetrics struct { + // Items: Collection of custom metrics. + Items []*CustomMetric `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 metric collection. + NextLink string `json:"nextLink,omitempty"` + + // PreviousLink: Link to previous page for this custom metric + // 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomMetrics) MarshalJSON() ([]byte, error) { + type noMethod CustomMetrics + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EntityAdWordsLink: JSON template for Analytics Entity AdWords Link. +type EntityAdWordsLink struct { + // AdWordsAccounts: A list of AdWords client accounts. These cannot be + // MCC accounts. This field is required when creating an AdWords link. + // It cannot be empty. + AdWordsAccounts []*AdWordsAccount `json:"adWordsAccounts,omitempty"` + + // Entity: Web property being linked. + Entity *EntityAdWordsLinkEntity `json:"entity,omitempty"` + + // Id: Entity AdWords link ID + Id string `json:"id,omitempty"` + + // Kind: Resource type for entity AdWords link. + Kind string `json:"kind,omitempty"` + + // Name: Name of the link. This field is required when creating an + // AdWords link. + Name string `json:"name,omitempty"` + + // ProfileIds: IDs of linked Views (Profiles) represented as strings. + ProfileIds []string `json:"profileIds,omitempty"` + + // SelfLink: URL link for this Google Analytics - Google AdWords link. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AdWordsAccounts") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EntityAdWordsLink) MarshalJSON() ([]byte, error) { + type noMethod EntityAdWordsLink + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EntityAdWordsLinkEntity: Web property being linked. +type EntityAdWordsLinkEntity struct { + WebPropertyRef *WebPropertyRef `json:"webPropertyRef,omitempty"` + + // ForceSendFields is a list of field names (e.g. "WebPropertyRef") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EntityAdWordsLinkEntity) MarshalJSON() ([]byte, error) { + type noMethod EntityAdWordsLinkEntity + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EntityAdWordsLinks: An entity AdWords link collection provides a list +// of GA-AdWords links Each resource in this collection corresponds to a +// single link. +type EntityAdWordsLinks struct { + // Items: A list of entity AdWords links. + Items []*EntityAdWordsLink `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 AdWords link collection. + NextLink string `json:"nextLink,omitempty"` + + // PreviousLink: Previous link for this AdWords link 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EntityAdWordsLinks) MarshalJSON() ([]byte, error) { + type noMethod EntityAdWordsLinks + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EntityUserLink: JSON template for an Analytics Entity-User Link. +// Returns permissions that a user has for an entity. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Entity") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EntityUserLink) MarshalJSON() ([]byte, error) { + type noMethod EntityUserLink + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EntityUserLinkEntity: Entity for this link. It can be an account, a +// web property, or a view (profile). +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"` + + // ForceSendFields is a list of field names (e.g. "AccountRef") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EntityUserLinkEntity) MarshalJSON() ([]byte, error) { + type noMethod EntityUserLinkEntity + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EntityUserLinkPermissions: Permissions the user has for this entity. +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"` + + // ForceSendFields is a list of field names (e.g. "Effective") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EntityUserLinkPermissions) MarshalJSON() ([]byte, error) { + type noMethod EntityUserLinkPermissions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EntityUserLinks: An entity user link collection provides a list of +// Analytics ACL links Each resource in this collection corresponds to a +// single link. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EntityUserLinks) MarshalJSON() ([]byte, error) { + type noMethod EntityUserLinks + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Experiment: JSON template for Analytics experiment resource. +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: An integer number in [3, 90]. + // 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:sessionDuration", "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 in (0, 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 in (0, 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Experiment) MarshalJSON() ([]byte, error) { + type noMethod Experiment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ExperimentParentLink: Parent link for an experiment. Points to the +// view (profile) to which this experiment belongs. +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"` + + // ForceSendFields is a list of field names (e.g. "Href") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ExperimentParentLink) MarshalJSON() ([]byte, error) { + type noMethod ExperimentParentLink + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ExperimentVariations) MarshalJSON() ([]byte, error) { + type noMethod ExperimentVariations + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Experiments: 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. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Experiments) MarshalJSON() ([]byte, error) { + type noMethod Experiments + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Filter: JSON template for an Analytics account filter. +type Filter struct { + // AccountId: Account ID to which this filter belongs. + AccountId string `json:"accountId,omitempty"` + + // AdvancedDetails: Details for the filter of the type ADVANCED. + AdvancedDetails *FilterAdvancedDetails `json:"advancedDetails,omitempty"` + + // Created: Time this filter was created. + Created string `json:"created,omitempty"` + + // ExcludeDetails: Details for the filter of the type EXCLUDE. + ExcludeDetails *FilterExpression `json:"excludeDetails,omitempty"` + + // Id: Filter ID. + Id string `json:"id,omitempty"` + + // IncludeDetails: Details for the filter of the type INCLUDE. + IncludeDetails *FilterExpression `json:"includeDetails,omitempty"` + + // Kind: Resource type for Analytics filter. + Kind string `json:"kind,omitempty"` + + // LowercaseDetails: Details for the filter of the type LOWER. + LowercaseDetails *FilterLowercaseDetails `json:"lowercaseDetails,omitempty"` + + // Name: Name of this filter. + Name string `json:"name,omitempty"` + + // ParentLink: Parent link for this filter. Points to the account to + // which this filter belongs. + ParentLink *FilterParentLink `json:"parentLink,omitempty"` + + // SearchAndReplaceDetails: Details for the filter of the type + // SEARCH_AND_REPLACE. + SearchAndReplaceDetails *FilterSearchAndReplaceDetails `json:"searchAndReplaceDetails,omitempty"` + + // SelfLink: Link for this filter. + SelfLink string `json:"selfLink,omitempty"` + + // Type: Type of this filter. Possible values are INCLUDE, EXCLUDE, + // LOWERCASE, UPPERCASE, SEARCH_AND_REPLACE and ADVANCED. + Type string `json:"type,omitempty"` + + // Updated: Time this filter was last modified. + Updated string `json:"updated,omitempty"` + + // UppercaseDetails: Details for the filter of the type UPPER. + UppercaseDetails *FilterUppercaseDetails `json:"uppercaseDetails,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Filter) MarshalJSON() ([]byte, error) { + type noMethod Filter + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FilterAdvancedDetails: Details for the filter of the type ADVANCED. +type FilterAdvancedDetails struct { + // CaseSensitive: Indicates if the filter expressions are case + // sensitive. + CaseSensitive bool `json:"caseSensitive,omitempty"` + + // ExtractA: Expression to extract from field A. + ExtractA string `json:"extractA,omitempty"` + + // ExtractB: Expression to extract from field B. + ExtractB string `json:"extractB,omitempty"` + + // FieldA: Field A. + FieldA string `json:"fieldA,omitempty"` + + // FieldAIndex: The Index of the custom dimension. Required if field is + // a CUSTOM_DIMENSION. + FieldAIndex int64 `json:"fieldAIndex,omitempty"` + + // FieldARequired: Indicates if field A is required to match. + FieldARequired bool `json:"fieldARequired,omitempty"` + + // FieldB: Field B. + FieldB string `json:"fieldB,omitempty"` + + // FieldBIndex: The Index of the custom dimension. Required if field is + // a CUSTOM_DIMENSION. + FieldBIndex int64 `json:"fieldBIndex,omitempty"` + + // FieldBRequired: Indicates if field B is required to match. + FieldBRequired bool `json:"fieldBRequired,omitempty"` + + // OutputConstructor: Expression used to construct the output value. + OutputConstructor string `json:"outputConstructor,omitempty"` + + // OutputToField: Output field. + OutputToField string `json:"outputToField,omitempty"` + + // OutputToFieldIndex: The Index of the custom dimension. Required if + // field is a CUSTOM_DIMENSION. + OutputToFieldIndex int64 `json:"outputToFieldIndex,omitempty"` + + // OverrideOutputField: Indicates if the existing value of the output + // field, if any, should be overridden by the output expression. + OverrideOutputField bool `json:"overrideOutputField,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CaseSensitive") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FilterAdvancedDetails) MarshalJSON() ([]byte, error) { + type noMethod FilterAdvancedDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FilterLowercaseDetails: Details for the filter of the type LOWER. +type FilterLowercaseDetails struct { + // Field: Field to use in the filter. + Field string `json:"field,omitempty"` + + // FieldIndex: The Index of the custom dimension. Required if field is a + // CUSTOM_DIMENSION. + FieldIndex int64 `json:"fieldIndex,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Field") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FilterLowercaseDetails) MarshalJSON() ([]byte, error) { + type noMethod FilterLowercaseDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FilterParentLink: Parent link for this filter. Points to the account +// to which this filter belongs. +type FilterParentLink struct { + // Href: Link to the account to which this filter belongs. + Href string `json:"href,omitempty"` + + // Type: Value is "analytics#account". + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Href") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FilterParentLink) MarshalJSON() ([]byte, error) { + type noMethod FilterParentLink + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FilterSearchAndReplaceDetails: Details for the filter of the type +// SEARCH_AND_REPLACE. +type FilterSearchAndReplaceDetails struct { + // CaseSensitive: Determines if the filter is case sensitive. + CaseSensitive bool `json:"caseSensitive,omitempty"` + + // Field: Field to use in the filter. + Field string `json:"field,omitempty"` + + // FieldIndex: The Index of the custom dimension. Required if field is a + // CUSTOM_DIMENSION. + FieldIndex int64 `json:"fieldIndex,omitempty"` + + // ReplaceString: Term to replace the search term with. + ReplaceString string `json:"replaceString,omitempty"` + + // SearchString: Term to search. + SearchString string `json:"searchString,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CaseSensitive") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FilterSearchAndReplaceDetails) MarshalJSON() ([]byte, error) { + type noMethod FilterSearchAndReplaceDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FilterUppercaseDetails: Details for the filter of the type UPPER. +type FilterUppercaseDetails struct { + // Field: Field to use in the filter. + Field string `json:"field,omitempty"` + + // FieldIndex: The Index of the custom dimension. Required if field is a + // CUSTOM_DIMENSION. + FieldIndex int64 `json:"fieldIndex,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Field") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FilterUppercaseDetails) MarshalJSON() ([]byte, error) { + type noMethod FilterUppercaseDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FilterExpression: JSON template for an Analytics filter expression. +type FilterExpression struct { + // CaseSensitive: Determines if the filter is case sensitive. + CaseSensitive bool `json:"caseSensitive,omitempty"` + + // ExpressionValue: Filter expression value + ExpressionValue string `json:"expressionValue,omitempty"` + + // Field: Field to filter. Possible values: + // - Content and Traffic + // - PAGE_REQUEST_URI, + // - PAGE_HOSTNAME, + // - PAGE_TITLE, + // - REFERRAL, + // - COST_DATA_URI (Campaign target URL), + // - HIT_TYPE, + // - INTERNAL_SEARCH_TERM, + // - INTERNAL_SEARCH_TYPE, + // - SOURCE_PROPERTY_TRACKING_ID, + // - Campaign or AdGroup + // - CAMPAIGN_SOURCE, + // - CAMPAIGN_MEDIUM, + // - CAMPAIGN_NAME, + // - CAMPAIGN_AD_GROUP, + // - CAMPAIGN_TERM, + // - CAMPAIGN_CONTENT, + // - CAMPAIGN_CODE, + // - CAMPAIGN_REFERRAL_PATH, + // - E-Commerce + // - TRANSACTION_COUNTRY, + // - TRANSACTION_REGION, + // - TRANSACTION_CITY, + // - TRANSACTION_AFFILIATION (Store or order location), + // - ITEM_NAME, + // - ITEM_CODE, + // - ITEM_VARIATION, + // - TRANSACTION_ID, + // - TRANSACTION_CURRENCY_CODE, + // - PRODUCT_ACTION_TYPE, + // - Audience/Users + // - BROWSER, + // - BROWSER_VERSION, + // - BROWSER_SIZE, + // - PLATFORM, + // - PLATFORM_VERSION, + // - LANGUAGE, + // - SCREEN_RESOLUTION, + // - SCREEN_COLORS, + // - JAVA_ENABLED (Boolean Field), + // - FLASH_VERSION, + // - GEO_SPEED (Connection speed), + // - VISITOR_TYPE, + // - GEO_ORGANIZATION (ISP organization), + // - GEO_DOMAIN, + // - GEO_IP_ADDRESS, + // - GEO_IP_VERSION, + // - Location + // - GEO_COUNTRY, + // - GEO_REGION, + // - GEO_CITY, + // - Event + // - EVENT_CATEGORY, + // - EVENT_ACTION, + // - EVENT_LABEL, + // - Other + // - CUSTOM_FIELD_1, + // - CUSTOM_FIELD_2, + // - USER_DEFINED_VALUE, + // - Application + // - APP_ID, + // - APP_INSTALLER_ID, + // - APP_NAME, + // - APP_VERSION, + // - SCREEN, + // - IS_APP (Boolean Field), + // - IS_FATAL_EXCEPTION (Boolean Field), + // - EXCEPTION_DESCRIPTION, + // - Mobile device + // - IS_MOBILE (Boolean Field, Deprecated. Use DEVICE_CATEGORY=mobile), + // + // - IS_TABLET (Boolean Field, Deprecated. Use DEVICE_CATEGORY=tablet), + // + // - DEVICE_CATEGORY, + // - MOBILE_HAS_QWERTY_KEYBOARD (Boolean Field), + // - MOBILE_HAS_NFC_SUPPORT (Boolean Field), + // - MOBILE_HAS_CELLULAR_RADIO (Boolean Field), + // - MOBILE_HAS_WIFI_SUPPORT (Boolean Field), + // - MOBILE_BRAND_NAME, + // - MOBILE_MODEL_NAME, + // - MOBILE_MARKETING_NAME, + // - MOBILE_POINTING_METHOD, + // - Social + // - SOCIAL_NETWORK, + // - SOCIAL_ACTION, + // - SOCIAL_ACTION_TARGET, + // - Custom dimension + // - CUSTOM_DIMENSION (See accompanying field index), + Field string `json:"field,omitempty"` + + // FieldIndex: The Index of the custom dimension. Set only if the field + // is a is CUSTOM_DIMENSION. + FieldIndex int64 `json:"fieldIndex,omitempty"` + + // Kind: Kind value for filter expression + Kind string `json:"kind,omitempty"` + + // MatchType: Match type for this filter. Possible values are + // BEGINS_WITH, EQUAL, ENDS_WITH, CONTAINS, or MATCHES. GEO_DOMAIN, + // GEO_IP_ADDRESS, PAGE_REQUEST_URI, or PAGE_HOSTNAME filters can use + // any match type; all other filters must use MATCHES. + MatchType string `json:"matchType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CaseSensitive") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FilterExpression) MarshalJSON() ([]byte, error) { + type noMethod FilterExpression + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FilterRef: JSON template for a profile filter link. +type FilterRef struct { + // AccountId: Account ID to which this filter belongs. + AccountId string `json:"accountId,omitempty"` + + // Href: Link for this filter. + Href string `json:"href,omitempty"` + + // Id: Filter ID. + Id string `json:"id,omitempty"` + + // Kind: Kind value for filter reference. + Kind string `json:"kind,omitempty"` + + // Name: Name of this filter. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FilterRef) MarshalJSON() ([]byte, error) { + type noMethod FilterRef + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Filters: A filter collection lists filters created by users in an +// Analytics account. Each resource in the collection corresponds to a +// filter. +type Filters struct { + // Items: A list of filters. + Items []*Filter `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 1,000 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 filter collection. + NextLink string `json:"nextLink,omitempty"` + + // PreviousLink: Link to previous page for this filter 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Filters) MarshalJSON() ([]byte, error) { + type noMethod Filters + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GaData: Analytics data for a given view (profile). +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ColumnHeaders") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GaData) MarshalJSON() ([]byte, error) { + type noMethod GaData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "ColumnType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GaDataColumnHeaders) MarshalJSON() ([]byte, error) { + type noMethod GaDataColumnHeaders + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GaDataDataTable struct { + Cols []*GaDataDataTableCols `json:"cols,omitempty"` + + Rows []*GaDataDataTableRows `json:"rows,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Cols") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GaDataDataTable) MarshalJSON() ([]byte, error) { + type noMethod GaDataDataTable + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GaDataDataTableCols struct { + Id string `json:"id,omitempty"` + + Label string `json:"label,omitempty"` + + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GaDataDataTableCols) MarshalJSON() ([]byte, error) { + type noMethod GaDataDataTableCols + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GaDataDataTableRows struct { + C []*GaDataDataTableRowsC `json:"c,omitempty"` + + // ForceSendFields is a list of field names (e.g. "C") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GaDataDataTableRows) MarshalJSON() ([]byte, error) { + type noMethod GaDataDataTableRows + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GaDataDataTableRowsC struct { + V string `json:"v,omitempty"` + + // ForceSendFields is a list of field names (e.g. "V") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GaDataDataTableRowsC) MarshalJSON() ([]byte, error) { + type noMethod GaDataDataTableRowsC + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GaDataProfileInfo: Information for the view (profile), for which the +// Analytics data was requested. +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"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GaDataProfileInfo) MarshalJSON() ([]byte, error) { + type noMethod GaDataProfileInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GaDataQuery: Analytics data request query parameters. +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"` + + // ForceSendFields is a list of field names (e.g. "Dimensions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GaDataQuery) MarshalJSON() ([]byte, error) { + type noMethod GaDataQuery + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Goal: JSON template for Analytics goal resource. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Goal) MarshalJSON() ([]byte, error) { + type noMethod Goal + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GoalEventDetails: Details for the goal of the type EVENT. +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"` + + // ForceSendFields is a list of field names (e.g. "EventConditions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GoalEventDetails) MarshalJSON() ([]byte, error) { + type noMethod GoalEventDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "ComparisonType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GoalEventDetailsEventConditions) MarshalJSON() ([]byte, error) { + type noMethod GoalEventDetailsEventConditions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GoalParentLink: Parent link for a goal. Points to the view (profile) +// to which this goal belongs. +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"` + + // ForceSendFields is a list of field names (e.g. "Href") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GoalParentLink) MarshalJSON() ([]byte, error) { + type noMethod GoalParentLink + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GoalUrlDestinationDetails: Details for the goal of the type +// URL_DESTINATION. +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"` + + // ForceSendFields is a list of field names (e.g. "CaseSensitive") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GoalUrlDestinationDetails) MarshalJSON() ([]byte, error) { + type noMethod GoalUrlDestinationDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GoalUrlDestinationDetailsSteps) MarshalJSON() ([]byte, error) { + type noMethod GoalUrlDestinationDetailsSteps + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GoalVisitNumPagesDetails: Details for the goal of the type +// VISIT_NUM_PAGES. +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"` + + // ForceSendFields is a list of field names (e.g. "ComparisonType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GoalVisitNumPagesDetails) MarshalJSON() ([]byte, error) { + type noMethod GoalVisitNumPagesDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GoalVisitTimeOnSiteDetails: Details for the goal of the type +// VISIT_TIME_ON_SITE. +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"` + + // ForceSendFields is a list of field names (e.g. "ComparisonType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GoalVisitTimeOnSiteDetails) MarshalJSON() ([]byte, error) { + type noMethod GoalVisitTimeOnSiteDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Goals: 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. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Goals) MarshalJSON() ([]byte, error) { + type noMethod Goals + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// McfData: Multi-Channel Funnels data for a given view (profile). +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ColumnHeaders") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *McfData) MarshalJSON() ([]byte, error) { + type noMethod McfData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "ColumnType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *McfDataColumnHeaders) MarshalJSON() ([]byte, error) { + type noMethod McfDataColumnHeaders + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// McfDataProfileInfo: Information for the view (profile), for which the +// Analytics data was requested. +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"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *McfDataProfileInfo) MarshalJSON() ([]byte, error) { + type noMethod McfDataProfileInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// McfDataQuery: Analytics data request query parameters. +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"` + + // ForceSendFields is a list of field names (e.g. "Dimensions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *McfDataQuery) MarshalJSON() ([]byte, error) { + type noMethod McfDataQuery + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// McfDataRowsItem: A union object representing a dimension or metric +// value. Only one of "primitiveValue" or "conversionPathValue" +// attribute will be populated. +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"` + + // ForceSendFields is a list of field names (e.g. "ConversionPathValue") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *McfDataRowsItem) MarshalJSON() ([]byte, error) { + type noMethod McfDataRowsItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "InteractionType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *McfDataRowsItemConversionPathValue) MarshalJSON() ([]byte, error) { + type noMethod McfDataRowsItemConversionPathValue + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Profile: JSON template for an Analytics view (profile). +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), + // defaults to USD. 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"` + + // EnhancedECommerceTracking: Indicates whether enhanced ecommerce + // tracking is enabled for this view (profile). This property can only + // be enabled if ecommerce tracking is enabled. + EnhancedECommerceTracking bool `json:"enhancedECommerceTracking,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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Profile) MarshalJSON() ([]byte, error) { + type noMethod Profile + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ProfileChildLink: Child link for this view (profile). Points to the +// list of goals for this view (profile). +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"` + + // ForceSendFields is a list of field names (e.g. "Href") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProfileChildLink) MarshalJSON() ([]byte, error) { + type noMethod ProfileChildLink + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ProfileParentLink: Parent link for this view (profile). Points to the +// web property to which this view (profile) belongs. +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"` + + // ForceSendFields is a list of field names (e.g. "Href") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProfileParentLink) MarshalJSON() ([]byte, error) { + type noMethod ProfileParentLink + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ProfilePermissions: Permissions the user has for this view (profile). +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"` + + // ForceSendFields is a list of field names (e.g. "Effective") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProfilePermissions) MarshalJSON() ([]byte, error) { + type noMethod ProfilePermissions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ProfileFilterLink: JSON template for an Analytics profile filter +// link. +type ProfileFilterLink struct { + // FilterRef: Filter for this link. + FilterRef *FilterRef `json:"filterRef,omitempty"` + + // Id: Profile filter link ID. + Id string `json:"id,omitempty"` + + // Kind: Resource type for Analytics filter. + Kind string `json:"kind,omitempty"` + + // ProfileRef: View (Profile) for this link. + ProfileRef *ProfileRef `json:"profileRef,omitempty"` + + // Rank: The rank of this profile filter link relative to the other + // filters linked to the same profile. + // For readonly (i.e., list and get) operations, the rank always starts + // at 1. + // For write (i.e., create, update, or delete) operations, you may + // specify a value between 0 and 255 inclusively, [0, 255]. In order to + // insert a link at the end of the list, either don't specify a rank or + // set a rank to a number greater than the largest rank in the list. In + // order to insert a link to the beginning of the list specify a rank + // that is less than or equal to 1. The new link will move all existing + // filters with the same or lower rank down the list. After the link is + // inserted/updated/deleted all profile filter links will be renumbered + // starting at 1. + Rank int64 `json:"rank,omitempty"` + + // SelfLink: Link for this profile filter link. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "FilterRef") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProfileFilterLink) MarshalJSON() ([]byte, error) { + type noMethod ProfileFilterLink + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ProfileFilterLinks: A profile filter link collection lists profile +// filter links between profiles and filters. Each resource in the +// collection corresponds to a profile filter link. +type ProfileFilterLinks struct { + // Items: A list of profile filter links. + Items []*ProfileFilterLink `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 1,000 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 profile filter link collection. + NextLink string `json:"nextLink,omitempty"` + + // PreviousLink: Link to previous page for this profile filter link + // 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProfileFilterLinks) MarshalJSON() ([]byte, error) { + type noMethod ProfileFilterLinks + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ProfileRef: JSON template for a linked view (profile). +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"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProfileRef) MarshalJSON() ([]byte, error) { + type noMethod ProfileRef + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ProfileSummary: JSON template for an Analytics ProfileSummary. +// ProfileSummary returns basic information (i.e., summary) for a +// profile. +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProfileSummary) MarshalJSON() ([]byte, error) { + type noMethod ProfileSummary + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Profiles: 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). +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Profiles) MarshalJSON() ([]byte, error) { + type noMethod Profiles + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RealtimeData: Real time data for a given view (profile). +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ColumnHeaders") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RealtimeData) MarshalJSON() ([]byte, error) { + type noMethod RealtimeData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "ColumnType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RealtimeDataColumnHeaders) MarshalJSON() ([]byte, error) { + type noMethod RealtimeDataColumnHeaders + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RealtimeDataProfileInfo: Information for the view (profile), for +// which the real time data was requested. +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"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RealtimeDataProfileInfo) MarshalJSON() ([]byte, error) { + type noMethod RealtimeDataProfileInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RealtimeDataQuery: Real time data request query parameters. +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"` + + // ForceSendFields is a list of field names (e.g. "Dimensions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RealtimeDataQuery) MarshalJSON() ([]byte, error) { + type noMethod RealtimeDataQuery + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Segment: JSON template for an Analytics segment. +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"` + + // ForceSendFields is a list of field names (e.g. "Created") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Segment) MarshalJSON() ([]byte, error) { + type noMethod Segment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Segments: An segment collection lists Analytics segments that the +// user has access to. Each resource in the collection corresponds to a +// single Analytics segment. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Segments) MarshalJSON() ([]byte, error) { + type noMethod Segments + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UnsampledReport: JSON template for Analytics unsampled report +// resource. +type UnsampledReport struct { + // AccountId: Account ID to which this unsampled report belongs. + AccountId string `json:"accountId,omitempty"` + + // CloudStorageDownloadDetails: Download details for a file stored in + // Google Cloud Storage. + CloudStorageDownloadDetails *UnsampledReportCloudStorageDownloadDetails `json:"cloudStorageDownloadDetails,omitempty"` + + // Created: Time this unsampled report was created. + Created string `json:"created,omitempty"` + + // Dimensions: The dimensions for the unsampled report. + Dimensions string `json:"dimensions,omitempty"` + + // DownloadType: The type of download you need to use for the report + // data file. + DownloadType string `json:"downloadType,omitempty"` + + // DriveDownloadDetails: Download details for a file stored in Google + // Drive. + DriveDownloadDetails *UnsampledReportDriveDownloadDetails `json:"driveDownloadDetails,omitempty"` + + // EndDate: The end date for the unsampled report. + EndDate string `json:"end-date,omitempty"` + + // Filters: The filters for the unsampled report. + Filters string `json:"filters,omitempty"` + + // Id: Unsampled report ID. + Id string `json:"id,omitempty"` + + // Kind: Resource type for an Analytics unsampled report. + Kind string `json:"kind,omitempty"` + + // Metrics: The metrics for the unsampled report. + Metrics string `json:"metrics,omitempty"` + + // ProfileId: View (Profile) ID to which this unsampled report belongs. + ProfileId string `json:"profileId,omitempty"` + + // Segment: The segment for the unsampled report. + Segment string `json:"segment,omitempty"` + + // SelfLink: Link for this unsampled report. + SelfLink string `json:"selfLink,omitempty"` + + // StartDate: The start date for the unsampled report. + StartDate string `json:"start-date,omitempty"` + + // Status: Status of this unsampled report. Possible values are PENDING, + // COMPLETED, or FAILED. + Status string `json:"status,omitempty"` + + // Title: Title of the unsampled report. + Title string `json:"title,omitempty"` + + // Updated: Time this unsampled report was last modified. + Updated string `json:"updated,omitempty"` + + // WebPropertyId: Web property ID to which this unsampled report + // belongs. The web property ID is of the form UA-XXXXX-YY. + WebPropertyId string `json:"webPropertyId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UnsampledReport) MarshalJSON() ([]byte, error) { + type noMethod UnsampledReport + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UnsampledReportCloudStorageDownloadDetails: Download details for a +// file stored in Google Cloud Storage. +type UnsampledReportCloudStorageDownloadDetails struct { + // BucketId: Id of the bucket the file object is stored in. + BucketId string `json:"bucketId,omitempty"` + + // ObjectId: Id of the file object containing the report data. + ObjectId string `json:"objectId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BucketId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UnsampledReportCloudStorageDownloadDetails) MarshalJSON() ([]byte, error) { + type noMethod UnsampledReportCloudStorageDownloadDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UnsampledReportDriveDownloadDetails: Download details for a file +// stored in Google Drive. +type UnsampledReportDriveDownloadDetails struct { + // DocumentId: Id of the document/file containing the report data. + DocumentId string `json:"documentId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DocumentId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UnsampledReportDriveDownloadDetails) MarshalJSON() ([]byte, error) { + type noMethod UnsampledReportDriveDownloadDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UnsampledReports: An unsampled report collection lists Analytics +// unsampled reports to which the user has access. Each view (profile) +// can have a set of unsampled reports. Each resource in the unsampled +// report collection corresponds to a single Analytics unsampled report. +type UnsampledReports struct { + // Items: A list of unsampled reports. + Items []*UnsampledReport `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 unsampled report collection. + NextLink string `json:"nextLink,omitempty"` + + // PreviousLink: Link to previous page for this unsampled report + // 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UnsampledReports) MarshalJSON() ([]byte, error) { + type noMethod UnsampledReports + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Upload: Metadata returned for an upload operation. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Upload) MarshalJSON() ([]byte, error) { + type noMethod Upload + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Uploads: 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. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Uploads) MarshalJSON() ([]byte, error) { + type noMethod Uploads + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserRef: JSON template for a user reference. +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"` + + // ForceSendFields is a list of field names (e.g. "Email") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserRef) MarshalJSON() ([]byte, error) { + type noMethod UserRef + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// WebPropertyRef: JSON template for a web property reference. +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"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *WebPropertyRef) MarshalJSON() ([]byte, error) { + type noMethod WebPropertyRef + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// WebPropertySummary: JSON template for an Analytics +// WebPropertySummary. WebPropertySummary returns basic information +// (i.e., summary) for a web property. +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *WebPropertySummary) MarshalJSON() ([]byte, error) { + type noMethod WebPropertySummary + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Webproperties: 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. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Webproperties) MarshalJSON() ([]byte, error) { + type noMethod Webproperties + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Webproperty: JSON template for an Analytics web property. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Webproperty) MarshalJSON() ([]byte, error) { + type noMethod Webproperty + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// WebpropertyChildLink: Child link for this web property. Points to the +// list of views (profiles) for this web property. +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"` + + // ForceSendFields is a list of field names (e.g. "Href") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *WebpropertyChildLink) MarshalJSON() ([]byte, error) { + type noMethod WebpropertyChildLink + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// WebpropertyParentLink: Parent link for this web property. Points to +// the account to which this web property belongs. +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"` + + // ForceSendFields is a list of field names (e.g. "Href") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *WebpropertyParentLink) MarshalJSON() ([]byte, error) { + type noMethod WebpropertyParentLink + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// WebpropertyPermissions: Permissions the user has for this web +// property. +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"` + + // ForceSendFields is a list of field names (e.g. "Effective") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *WebpropertyPermissions) MarshalJSON() ([]byte, error) { + type noMethod WebpropertyPermissions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "analytics.data.ga.get": + +type DataGaGetCall struct { + s *Service + ids string + startDate string + endDate string + metrics string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "dataTable" - Returns the response in Google Charts Data Table +// format. This is useful in creating visualization using Google Charts. +// "json" - Returns the response in standard JSON format. +func (c *DataGaGetCall) Output(output string) *DataGaGetCall { + c.opt_["output"] = output + return c +} + +// SamplingLevel sets the optional parameter "samplingLevel": The +// desired sampling level. +// +// Possible values: +// "DEFAULT" - Returns response with a sample size that balances speed +// and accuracy. +// "FASTER" - Returns a fast response with a smaller sample size. +// "HIGHER_PRECISION" - Returns a more accurate response using a large +// sample size, but this may result in the response being slower. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DataGaGetCall) Fields(s ...googleapi.Field) *DataGaGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DataGaGetCall) IfNoneMatch(entityTag string) *DataGaGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DataGaGetCall) Context(ctx context.Context) *DataGaGetCall { + c.ctx_ = ctx + return c +} + +func (c *DataGaGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.data.ga.get" call. +// Exactly one of *GaData or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *GaData.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *DataGaGetCall) Do() (*GaData, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &GaData{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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:sessions,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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "DEFAULT" - Returns response with a sample size that balances speed +// and accuracy. +// "FASTER" - Returns a fast response with a smaller sample size. +// "HIGHER_PRECISION" - Returns a more accurate response using a large +// sample size, but this may result in the response being slower. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DataMcfGetCall) Fields(s ...googleapi.Field) *DataMcfGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DataMcfGetCall) IfNoneMatch(entityTag string) *DataMcfGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DataMcfGetCall) Context(ctx context.Context) *DataMcfGetCall { + c.ctx_ = ctx + return c +} + +func (c *DataMcfGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.data.mcf.get" call. +// Exactly one of *McfData or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *McfData.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *DataMcfGetCall) Do() (*McfData, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &McfData{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DataRealtimeGetCall) Fields(s ...googleapi.Field) *DataRealtimeGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DataRealtimeGetCall) IfNoneMatch(entityTag string) *DataRealtimeGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DataRealtimeGetCall) Context(ctx context.Context) *DataRealtimeGetCall { + c.ctx_ = ctx + return c +} + +func (c *DataRealtimeGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.data.realtime.get" call. +// Exactly one of *RealtimeData or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *RealtimeData.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DataRealtimeGetCall) Do() (*RealtimeData, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RealtimeData{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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:activeUsers'. 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{} + ctx_ context.Context +} + +// 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 account summaries to include in this response, where the +// largest acceptable value is 1000. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementAccountSummariesListCall) Fields(s ...googleapi.Field) *ManagementAccountSummariesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementAccountSummariesListCall) IfNoneMatch(entityTag string) *ManagementAccountSummariesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementAccountSummariesListCall) Context(ctx context.Context) *ManagementAccountSummariesListCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementAccountSummariesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.accountSummaries.list" call. +// Exactly one of *AccountSummaries or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AccountSummaries.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementAccountSummariesListCall) Do() (*AccountSummaries, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountSummaries{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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 account summaries to include in this response, where the largest acceptable value is 1000.", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementAccountUserLinksDeleteCall) Fields(s ...googleapi.Field) *ManagementAccountUserLinksDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementAccountUserLinksDeleteCall) Context(ctx context.Context) *ManagementAccountUserLinksDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementAccountUserLinksDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/entityUserLinks/{linkId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "linkId": c.linkId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.accountUserLinks.delete" call. +func (c *ManagementAccountUserLinksDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementAccountUserLinksInsertCall) Fields(s ...googleapi.Field) *ManagementAccountUserLinksInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementAccountUserLinksInsertCall) Context(ctx context.Context) *ManagementAccountUserLinksInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementAccountUserLinksInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/entityUserLinks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.accountUserLinks.insert" call. +// Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *EntityUserLink.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementAccountUserLinksInsertCall) Do() (*EntityUserLink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EntityUserLink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementAccountUserLinksListCall) Fields(s ...googleapi.Field) *ManagementAccountUserLinksListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementAccountUserLinksListCall) IfNoneMatch(entityTag string) *ManagementAccountUserLinksListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementAccountUserLinksListCall) Context(ctx context.Context) *ManagementAccountUserLinksListCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementAccountUserLinksListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/entityUserLinks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.accountUserLinks.list" call. +// Exactly one of *EntityUserLinks or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *EntityUserLinks.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementAccountUserLinksListCall) Do() (*EntityUserLinks, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EntityUserLinks{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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", + // "https://www.googleapis.com/auth/analytics.manage.users.readonly" + // ] + // } + +} + +// method id "analytics.management.accountUserLinks.update": + +type ManagementAccountUserLinksUpdateCall struct { + s *Service + accountId string + linkId string + entityuserlink *EntityUserLink + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementAccountUserLinksUpdateCall) Fields(s ...googleapi.Field) *ManagementAccountUserLinksUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementAccountUserLinksUpdateCall) Context(ctx context.Context) *ManagementAccountUserLinksUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementAccountUserLinksUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/entityUserLinks/{linkId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "linkId": c.linkId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.accountUserLinks.update" call. +// Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *EntityUserLink.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementAccountUserLinksUpdateCall) Do() (*EntityUserLink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EntityUserLink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementAccountsListCall) Fields(s ...googleapi.Field) *ManagementAccountsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementAccountsListCall) IfNoneMatch(entityTag string) *ManagementAccountsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementAccountsListCall) Context(ctx context.Context) *ManagementAccountsListCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementAccountsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.accounts.list" call. +// Exactly one of *Accounts or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Accounts.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ManagementAccountsListCall) Do() (*Accounts, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Accounts{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementCustomDataSourcesListCall) Fields(s ...googleapi.Field) *ManagementCustomDataSourcesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementCustomDataSourcesListCall) IfNoneMatch(entityTag string) *ManagementCustomDataSourcesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementCustomDataSourcesListCall) Context(ctx context.Context) *ManagementCustomDataSourcesListCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementCustomDataSourcesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.customDataSources.list" call. +// Exactly one of *CustomDataSources or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CustomDataSources.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementCustomDataSourcesListCall) Do() (*CustomDataSources, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomDataSources{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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.customDimensions.get": + +type ManagementCustomDimensionsGetCall struct { + s *Service + accountId string + webPropertyId string + customDimensionId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Get a custom dimension to which the user has access. +func (r *ManagementCustomDimensionsService) Get(accountId string, webPropertyId string, customDimensionId string) *ManagementCustomDimensionsGetCall { + c := &ManagementCustomDimensionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.customDimensionId = customDimensionId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementCustomDimensionsGetCall) Fields(s ...googleapi.Field) *ManagementCustomDimensionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementCustomDimensionsGetCall) IfNoneMatch(entityTag string) *ManagementCustomDimensionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementCustomDimensionsGetCall) Context(ctx context.Context) *ManagementCustomDimensionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementCustomDimensionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "customDimensionId": c.customDimensionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.customDimensions.get" call. +// Exactly one of *CustomDimension or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomDimension.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementCustomDimensionsGetCall) Do() (*CustomDimension, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomDimension{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get a custom dimension to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.customDimensions.get", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "customDimensionId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID for the custom dimension to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customDimensionId": { + // "description": "The ID of the custom dimension to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID for the custom dimension to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}", + // "response": { + // "$ref": "CustomDimension" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.customDimensions.insert": + +type ManagementCustomDimensionsInsertCall struct { + s *Service + accountId string + webPropertyId string + customdimension *CustomDimension + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Create a new custom dimension. +func (r *ManagementCustomDimensionsService) Insert(accountId string, webPropertyId string, customdimension *CustomDimension) *ManagementCustomDimensionsInsertCall { + c := &ManagementCustomDimensionsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.customdimension = customdimension + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementCustomDimensionsInsertCall) Fields(s ...googleapi.Field) *ManagementCustomDimensionsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementCustomDimensionsInsertCall) Context(ctx context.Context) *ManagementCustomDimensionsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementCustomDimensionsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.customdimension) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.customDimensions.insert" call. +// Exactly one of *CustomDimension or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomDimension.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementCustomDimensionsInsertCall) Do() (*CustomDimension, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomDimension{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a new custom dimension.", + // "httpMethod": "POST", + // "id": "analytics.management.customDimensions.insert", + // "parameterOrder": [ + // "accountId", + // "webPropertyId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID for the custom dimension to create.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID for the custom dimension to create.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions", + // "request": { + // "$ref": "CustomDimension" + // }, + // "response": { + // "$ref": "CustomDimension" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.customDimensions.list": + +type ManagementCustomDimensionsListCall struct { + s *Service + accountId string + webPropertyId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists custom dimensions to which the user has access. +func (r *ManagementCustomDimensionsService) List(accountId string, webPropertyId string) *ManagementCustomDimensionsListCall { + c := &ManagementCustomDimensionsListCall{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 dimensions to include in this response. +func (c *ManagementCustomDimensionsListCall) MaxResults(maxResults int64) *ManagementCustomDimensionsListCall { + 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 *ManagementCustomDimensionsListCall) StartIndex(startIndex int64) *ManagementCustomDimensionsListCall { + c.opt_["start-index"] = startIndex + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementCustomDimensionsListCall) Fields(s ...googleapi.Field) *ManagementCustomDimensionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementCustomDimensionsListCall) IfNoneMatch(entityTag string) *ManagementCustomDimensionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementCustomDimensionsListCall) Context(ctx context.Context) *ManagementCustomDimensionsListCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementCustomDimensionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.customDimensions.list" call. +// Exactly one of *CustomDimensions or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CustomDimensions.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementCustomDimensionsListCall) Do() (*CustomDimensions, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomDimensions{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists custom dimensions to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.customDimensions.list", + // "parameterOrder": [ + // "accountId", + // "webPropertyId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID for the custom dimensions to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "max-results": { + // "description": "The maximum number of custom dimensions 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 custom dimensions to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions", + // "response": { + // "$ref": "CustomDimensions" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.customDimensions.patch": + +type ManagementCustomDimensionsPatchCall struct { + s *Service + accountId string + webPropertyId string + customDimensionId string + customdimension *CustomDimension + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing custom dimension. This method supports +// patch semantics. +func (r *ManagementCustomDimensionsService) Patch(accountId string, webPropertyId string, customDimensionId string, customdimension *CustomDimension) *ManagementCustomDimensionsPatchCall { + c := &ManagementCustomDimensionsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.customDimensionId = customDimensionId + c.customdimension = customdimension + return c +} + +// IgnoreCustomDataSourceLinks sets the optional parameter +// "ignoreCustomDataSourceLinks": Force the update and ignore any +// warnings related to the custom dimension being linked to a custom +// data source / data set. +func (c *ManagementCustomDimensionsPatchCall) IgnoreCustomDataSourceLinks(ignoreCustomDataSourceLinks bool) *ManagementCustomDimensionsPatchCall { + c.opt_["ignoreCustomDataSourceLinks"] = ignoreCustomDataSourceLinks + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementCustomDimensionsPatchCall) Fields(s ...googleapi.Field) *ManagementCustomDimensionsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementCustomDimensionsPatchCall) Context(ctx context.Context) *ManagementCustomDimensionsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementCustomDimensionsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.customdimension) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ignoreCustomDataSourceLinks"]; ok { + params.Set("ignoreCustomDataSourceLinks", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "customDimensionId": c.customDimensionId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.customDimensions.patch" call. +// Exactly one of *CustomDimension or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomDimension.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementCustomDimensionsPatchCall) Do() (*CustomDimension, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomDimension{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing custom dimension. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "analytics.management.customDimensions.patch", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "customDimensionId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID for the custom dimension to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customDimensionId": { + // "description": "Custom dimension ID for the custom dimension to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "ignoreCustomDataSourceLinks": { + // "default": "false", + // "description": "Force the update and ignore any warnings related to the custom dimension being linked to a custom data source / data set.", + // "location": "query", + // "type": "boolean" + // }, + // "webPropertyId": { + // "description": "Web property ID for the custom dimension to update.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}", + // "request": { + // "$ref": "CustomDimension" + // }, + // "response": { + // "$ref": "CustomDimension" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.customDimensions.update": + +type ManagementCustomDimensionsUpdateCall struct { + s *Service + accountId string + webPropertyId string + customDimensionId string + customdimension *CustomDimension + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing custom dimension. +func (r *ManagementCustomDimensionsService) Update(accountId string, webPropertyId string, customDimensionId string, customdimension *CustomDimension) *ManagementCustomDimensionsUpdateCall { + c := &ManagementCustomDimensionsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.customDimensionId = customDimensionId + c.customdimension = customdimension + return c +} + +// IgnoreCustomDataSourceLinks sets the optional parameter +// "ignoreCustomDataSourceLinks": Force the update and ignore any +// warnings related to the custom dimension being linked to a custom +// data source / data set. +func (c *ManagementCustomDimensionsUpdateCall) IgnoreCustomDataSourceLinks(ignoreCustomDataSourceLinks bool) *ManagementCustomDimensionsUpdateCall { + c.opt_["ignoreCustomDataSourceLinks"] = ignoreCustomDataSourceLinks + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementCustomDimensionsUpdateCall) Fields(s ...googleapi.Field) *ManagementCustomDimensionsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementCustomDimensionsUpdateCall) Context(ctx context.Context) *ManagementCustomDimensionsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementCustomDimensionsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.customdimension) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ignoreCustomDataSourceLinks"]; ok { + params.Set("ignoreCustomDataSourceLinks", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "customDimensionId": c.customDimensionId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.customDimensions.update" call. +// Exactly one of *CustomDimension or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomDimension.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementCustomDimensionsUpdateCall) Do() (*CustomDimension, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomDimension{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing custom dimension.", + // "httpMethod": "PUT", + // "id": "analytics.management.customDimensions.update", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "customDimensionId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID for the custom dimension to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customDimensionId": { + // "description": "Custom dimension ID for the custom dimension to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "ignoreCustomDataSourceLinks": { + // "default": "false", + // "description": "Force the update and ignore any warnings related to the custom dimension being linked to a custom data source / data set.", + // "location": "query", + // "type": "boolean" + // }, + // "webPropertyId": { + // "description": "Web property ID for the custom dimension to update.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}", + // "request": { + // "$ref": "CustomDimension" + // }, + // "response": { + // "$ref": "CustomDimension" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.customMetrics.get": + +type ManagementCustomMetricsGetCall struct { + s *Service + accountId string + webPropertyId string + customMetricId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Get a custom metric to which the user has access. +func (r *ManagementCustomMetricsService) Get(accountId string, webPropertyId string, customMetricId string) *ManagementCustomMetricsGetCall { + c := &ManagementCustomMetricsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.customMetricId = customMetricId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementCustomMetricsGetCall) Fields(s ...googleapi.Field) *ManagementCustomMetricsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementCustomMetricsGetCall) IfNoneMatch(entityTag string) *ManagementCustomMetricsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementCustomMetricsGetCall) Context(ctx context.Context) *ManagementCustomMetricsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementCustomMetricsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "customMetricId": c.customMetricId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.customMetrics.get" call. +// Exactly one of *CustomMetric or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomMetric.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ManagementCustomMetricsGetCall) Do() (*CustomMetric, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomMetric{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get a custom metric to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.customMetrics.get", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "customMetricId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID for the custom metric to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customMetricId": { + // "description": "The ID of the custom metric to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID for the custom metric to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}", + // "response": { + // "$ref": "CustomMetric" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.customMetrics.insert": + +type ManagementCustomMetricsInsertCall struct { + s *Service + accountId string + webPropertyId string + custommetric *CustomMetric + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Create a new custom metric. +func (r *ManagementCustomMetricsService) Insert(accountId string, webPropertyId string, custommetric *CustomMetric) *ManagementCustomMetricsInsertCall { + c := &ManagementCustomMetricsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.custommetric = custommetric + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementCustomMetricsInsertCall) Fields(s ...googleapi.Field) *ManagementCustomMetricsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementCustomMetricsInsertCall) Context(ctx context.Context) *ManagementCustomMetricsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementCustomMetricsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.custommetric) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.customMetrics.insert" call. +// Exactly one of *CustomMetric or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomMetric.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ManagementCustomMetricsInsertCall) Do() (*CustomMetric, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomMetric{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a new custom metric.", + // "httpMethod": "POST", + // "id": "analytics.management.customMetrics.insert", + // "parameterOrder": [ + // "accountId", + // "webPropertyId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID for the custom metric to create.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID for the custom dimension to create.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics", + // "request": { + // "$ref": "CustomMetric" + // }, + // "response": { + // "$ref": "CustomMetric" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.customMetrics.list": + +type ManagementCustomMetricsListCall struct { + s *Service + accountId string + webPropertyId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists custom metrics to which the user has access. +func (r *ManagementCustomMetricsService) List(accountId string, webPropertyId string) *ManagementCustomMetricsListCall { + c := &ManagementCustomMetricsListCall{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 metrics to include in this response. +func (c *ManagementCustomMetricsListCall) MaxResults(maxResults int64) *ManagementCustomMetricsListCall { + 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 *ManagementCustomMetricsListCall) StartIndex(startIndex int64) *ManagementCustomMetricsListCall { + c.opt_["start-index"] = startIndex + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementCustomMetricsListCall) Fields(s ...googleapi.Field) *ManagementCustomMetricsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementCustomMetricsListCall) IfNoneMatch(entityTag string) *ManagementCustomMetricsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementCustomMetricsListCall) Context(ctx context.Context) *ManagementCustomMetricsListCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementCustomMetricsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.customMetrics.list" call. +// Exactly one of *CustomMetrics or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomMetrics.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementCustomMetricsListCall) Do() (*CustomMetrics, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomMetrics{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists custom metrics to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.customMetrics.list", + // "parameterOrder": [ + // "accountId", + // "webPropertyId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID for the custom metrics to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "max-results": { + // "description": "The maximum number of custom metrics 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 custom metrics to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics", + // "response": { + // "$ref": "CustomMetrics" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.customMetrics.patch": + +type ManagementCustomMetricsPatchCall struct { + s *Service + accountId string + webPropertyId string + customMetricId string + custommetric *CustomMetric + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing custom metric. This method supports patch +// semantics. +func (r *ManagementCustomMetricsService) Patch(accountId string, webPropertyId string, customMetricId string, custommetric *CustomMetric) *ManagementCustomMetricsPatchCall { + c := &ManagementCustomMetricsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.customMetricId = customMetricId + c.custommetric = custommetric + return c +} + +// IgnoreCustomDataSourceLinks sets the optional parameter +// "ignoreCustomDataSourceLinks": Force the update and ignore any +// warnings related to the custom metric being linked to a custom data +// source / data set. +func (c *ManagementCustomMetricsPatchCall) IgnoreCustomDataSourceLinks(ignoreCustomDataSourceLinks bool) *ManagementCustomMetricsPatchCall { + c.opt_["ignoreCustomDataSourceLinks"] = ignoreCustomDataSourceLinks + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementCustomMetricsPatchCall) Fields(s ...googleapi.Field) *ManagementCustomMetricsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementCustomMetricsPatchCall) Context(ctx context.Context) *ManagementCustomMetricsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementCustomMetricsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.custommetric) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ignoreCustomDataSourceLinks"]; ok { + params.Set("ignoreCustomDataSourceLinks", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "customMetricId": c.customMetricId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.customMetrics.patch" call. +// Exactly one of *CustomMetric or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomMetric.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ManagementCustomMetricsPatchCall) Do() (*CustomMetric, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomMetric{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing custom metric. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "analytics.management.customMetrics.patch", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "customMetricId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID for the custom metric to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customMetricId": { + // "description": "Custom metric ID for the custom metric to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "ignoreCustomDataSourceLinks": { + // "default": "false", + // "description": "Force the update and ignore any warnings related to the custom metric being linked to a custom data source / data set.", + // "location": "query", + // "type": "boolean" + // }, + // "webPropertyId": { + // "description": "Web property ID for the custom metric to update.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}", + // "request": { + // "$ref": "CustomMetric" + // }, + // "response": { + // "$ref": "CustomMetric" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.customMetrics.update": + +type ManagementCustomMetricsUpdateCall struct { + s *Service + accountId string + webPropertyId string + customMetricId string + custommetric *CustomMetric + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing custom metric. +func (r *ManagementCustomMetricsService) Update(accountId string, webPropertyId string, customMetricId string, custommetric *CustomMetric) *ManagementCustomMetricsUpdateCall { + c := &ManagementCustomMetricsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.customMetricId = customMetricId + c.custommetric = custommetric + return c +} + +// IgnoreCustomDataSourceLinks sets the optional parameter +// "ignoreCustomDataSourceLinks": Force the update and ignore any +// warnings related to the custom metric being linked to a custom data +// source / data set. +func (c *ManagementCustomMetricsUpdateCall) IgnoreCustomDataSourceLinks(ignoreCustomDataSourceLinks bool) *ManagementCustomMetricsUpdateCall { + c.opt_["ignoreCustomDataSourceLinks"] = ignoreCustomDataSourceLinks + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementCustomMetricsUpdateCall) Fields(s ...googleapi.Field) *ManagementCustomMetricsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementCustomMetricsUpdateCall) Context(ctx context.Context) *ManagementCustomMetricsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementCustomMetricsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.custommetric) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ignoreCustomDataSourceLinks"]; ok { + params.Set("ignoreCustomDataSourceLinks", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "customMetricId": c.customMetricId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.customMetrics.update" call. +// Exactly one of *CustomMetric or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CustomMetric.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ManagementCustomMetricsUpdateCall) Do() (*CustomMetric, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomMetric{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing custom metric.", + // "httpMethod": "PUT", + // "id": "analytics.management.customMetrics.update", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "customMetricId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID for the custom metric to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customMetricId": { + // "description": "Custom metric ID for the custom metric to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "ignoreCustomDataSourceLinks": { + // "default": "false", + // "description": "Force the update and ignore any warnings related to the custom metric being linked to a custom data source / data set.", + // "location": "query", + // "type": "boolean" + // }, + // "webPropertyId": { + // "description": "Web property ID for the custom metric to update.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}", + // "request": { + // "$ref": "CustomMetric" + // }, + // "response": { + // "$ref": "CustomMetric" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.experiments.delete": + +type ManagementExperimentsDeleteCall struct { + s *Service + accountId string + webPropertyId string + profileId string + experimentId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementExperimentsDeleteCall) Fields(s ...googleapi.Field) *ManagementExperimentsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementExperimentsDeleteCall) Context(ctx context.Context) *ManagementExperimentsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementExperimentsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + "experimentId": c.experimentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.experiments.delete" call. +func (c *ManagementExperimentsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementExperimentsGetCall) Fields(s ...googleapi.Field) *ManagementExperimentsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementExperimentsGetCall) IfNoneMatch(entityTag string) *ManagementExperimentsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementExperimentsGetCall) Context(ctx context.Context) *ManagementExperimentsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementExperimentsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + "experimentId": c.experimentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.experiments.get" call. +// Exactly one of *Experiment or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Experiment.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ManagementExperimentsGetCall) Do() (*Experiment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Experiment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementExperimentsInsertCall) Fields(s ...googleapi.Field) *ManagementExperimentsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementExperimentsInsertCall) Context(ctx context.Context) *ManagementExperimentsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementExperimentsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.experiments.insert" call. +// Exactly one of *Experiment or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Experiment.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ManagementExperimentsInsertCall) Do() (*Experiment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Experiment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementExperimentsListCall) Fields(s ...googleapi.Field) *ManagementExperimentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementExperimentsListCall) IfNoneMatch(entityTag string) *ManagementExperimentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementExperimentsListCall) Context(ctx context.Context) *ManagementExperimentsListCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementExperimentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.experiments.list" call. +// Exactly one of *Experiments or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Experiments.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ManagementExperimentsListCall) Do() (*Experiments, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Experiments{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementExperimentsPatchCall) Fields(s ...googleapi.Field) *ManagementExperimentsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementExperimentsPatchCall) Context(ctx context.Context) *ManagementExperimentsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementExperimentsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + "experimentId": c.experimentId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.experiments.patch" call. +// Exactly one of *Experiment or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Experiment.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ManagementExperimentsPatchCall) Do() (*Experiment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Experiment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementExperimentsUpdateCall) Fields(s ...googleapi.Field) *ManagementExperimentsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementExperimentsUpdateCall) Context(ctx context.Context) *ManagementExperimentsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementExperimentsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + "experimentId": c.experimentId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.experiments.update" call. +// Exactly one of *Experiment or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Experiment.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ManagementExperimentsUpdateCall) Do() (*Experiment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Experiment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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.filters.delete": + +type ManagementFiltersDeleteCall struct { + s *Service + accountId string + filterId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Delete a filter. +func (r *ManagementFiltersService) Delete(accountId string, filterId string) *ManagementFiltersDeleteCall { + c := &ManagementFiltersDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.filterId = filterId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementFiltersDeleteCall) Fields(s ...googleapi.Field) *ManagementFiltersDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementFiltersDeleteCall) Context(ctx context.Context) *ManagementFiltersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementFiltersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters/{filterId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "filterId": c.filterId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.filters.delete" call. +// Exactly one of *Filter or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Filter.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ManagementFiltersDeleteCall) Do() (*Filter, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Filter{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Delete a filter.", + // "httpMethod": "DELETE", + // "id": "analytics.management.filters.delete", + // "parameterOrder": [ + // "accountId", + // "filterId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to delete the filter for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "filterId": { + // "description": "ID of the filter to be deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/filters/{filterId}", + // "response": { + // "$ref": "Filter" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.filters.get": + +type ManagementFiltersGetCall struct { + s *Service + accountId string + filterId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns a filters to which the user has access. +func (r *ManagementFiltersService) Get(accountId string, filterId string) *ManagementFiltersGetCall { + c := &ManagementFiltersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.filterId = filterId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementFiltersGetCall) Fields(s ...googleapi.Field) *ManagementFiltersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementFiltersGetCall) IfNoneMatch(entityTag string) *ManagementFiltersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementFiltersGetCall) Context(ctx context.Context) *ManagementFiltersGetCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementFiltersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters/{filterId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "filterId": c.filterId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.filters.get" call. +// Exactly one of *Filter or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Filter.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ManagementFiltersGetCall) Do() (*Filter, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Filter{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a filters to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.filters.get", + // "parameterOrder": [ + // "accountId", + // "filterId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to retrieve filters for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "filterId": { + // "description": "Filter ID to retrieve filters for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/filters/{filterId}", + // "response": { + // "$ref": "Filter" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.filters.insert": + +type ManagementFiltersInsertCall struct { + s *Service + accountId string + filter *Filter + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Create a new filter. +func (r *ManagementFiltersService) Insert(accountId string, filter *Filter) *ManagementFiltersInsertCall { + c := &ManagementFiltersInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.filter = filter + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementFiltersInsertCall) Fields(s ...googleapi.Field) *ManagementFiltersInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementFiltersInsertCall) Context(ctx context.Context) *ManagementFiltersInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementFiltersInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.filter) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.filters.insert" call. +// Exactly one of *Filter or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Filter.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ManagementFiltersInsertCall) Do() (*Filter, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Filter{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a new filter.", + // "httpMethod": "POST", + // "id": "analytics.management.filters.insert", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to create filter for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/filters", + // "request": { + // "$ref": "Filter" + // }, + // "response": { + // "$ref": "Filter" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.filters.list": + +type ManagementFiltersListCall struct { + s *Service + accountId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all filters for an account +func (r *ManagementFiltersService) List(accountId string) *ManagementFiltersListCall { + c := &ManagementFiltersListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// MaxResults sets the optional parameter "max-results": The maximum +// number of filters to include in this response. +func (c *ManagementFiltersListCall) MaxResults(maxResults int64) *ManagementFiltersListCall { + 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 *ManagementFiltersListCall) StartIndex(startIndex int64) *ManagementFiltersListCall { + c.opt_["start-index"] = startIndex + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementFiltersListCall) Fields(s ...googleapi.Field) *ManagementFiltersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementFiltersListCall) IfNoneMatch(entityTag string) *ManagementFiltersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementFiltersListCall) Context(ctx context.Context) *ManagementFiltersListCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementFiltersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.filters.list" call. +// Exactly one of *Filters or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Filters.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ManagementFiltersListCall) Do() (*Filters, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Filters{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all filters for an account", + // "httpMethod": "GET", + // "id": "analytics.management.filters.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to retrieve filters for.", + // "location": "path", + // "pattern": "\\d+", + // "required": true, + // "type": "string" + // }, + // "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/accounts/{accountId}/filters", + // "response": { + // "$ref": "Filters" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.filters.patch": + +type ManagementFiltersPatchCall struct { + s *Service + accountId string + filterId string + filter *Filter + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing filter. This method supports patch +// semantics. +func (r *ManagementFiltersService) Patch(accountId string, filterId string, filter *Filter) *ManagementFiltersPatchCall { + c := &ManagementFiltersPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.filterId = filterId + c.filter = filter + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementFiltersPatchCall) Fields(s ...googleapi.Field) *ManagementFiltersPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementFiltersPatchCall) Context(ctx context.Context) *ManagementFiltersPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementFiltersPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.filter) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters/{filterId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "filterId": c.filterId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.filters.patch" call. +// Exactly one of *Filter or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Filter.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ManagementFiltersPatchCall) Do() (*Filter, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Filter{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing filter. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "analytics.management.filters.patch", + // "parameterOrder": [ + // "accountId", + // "filterId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to which the filter belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "filterId": { + // "description": "ID of the filter to be updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/filters/{filterId}", + // "request": { + // "$ref": "Filter" + // }, + // "response": { + // "$ref": "Filter" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.filters.update": + +type ManagementFiltersUpdateCall struct { + s *Service + accountId string + filterId string + filter *Filter + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing filter. +func (r *ManagementFiltersService) Update(accountId string, filterId string, filter *Filter) *ManagementFiltersUpdateCall { + c := &ManagementFiltersUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.filterId = filterId + c.filter = filter + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementFiltersUpdateCall) Fields(s ...googleapi.Field) *ManagementFiltersUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementFiltersUpdateCall) Context(ctx context.Context) *ManagementFiltersUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementFiltersUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.filter) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters/{filterId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "filterId": c.filterId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.filters.update" call. +// Exactly one of *Filter or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Filter.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ManagementFiltersUpdateCall) Do() (*Filter, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Filter{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing filter.", + // "httpMethod": "PUT", + // "id": "analytics.management.filters.update", + // "parameterOrder": [ + // "accountId", + // "filterId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to which the filter belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "filterId": { + // "description": "ID of the filter to be updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/filters/{filterId}", + // "request": { + // "$ref": "Filter" + // }, + // "response": { + // "$ref": "Filter" + // }, + // "scopes": [ + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementGoalsGetCall) Fields(s ...googleapi.Field) *ManagementGoalsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementGoalsGetCall) IfNoneMatch(entityTag string) *ManagementGoalsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementGoalsGetCall) Context(ctx context.Context) *ManagementGoalsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementGoalsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + "goalId": c.goalId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.goals.get" call. +// Exactly one of *Goal or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Goal.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ManagementGoalsGetCall) Do() (*Goal, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Goal{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementGoalsInsertCall) Fields(s ...googleapi.Field) *ManagementGoalsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementGoalsInsertCall) Context(ctx context.Context) *ManagementGoalsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementGoalsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.goals.insert" call. +// Exactly one of *Goal or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Goal.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ManagementGoalsInsertCall) Do() (*Goal, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Goal{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementGoalsListCall) Fields(s ...googleapi.Field) *ManagementGoalsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementGoalsListCall) IfNoneMatch(entityTag string) *ManagementGoalsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementGoalsListCall) Context(ctx context.Context) *ManagementGoalsListCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementGoalsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.goals.list" call. +// Exactly one of *Goals or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Goals.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ManagementGoalsListCall) Do() (*Goals, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Goals{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementGoalsPatchCall) Fields(s ...googleapi.Field) *ManagementGoalsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementGoalsPatchCall) Context(ctx context.Context) *ManagementGoalsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementGoalsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + "goalId": c.goalId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.goals.patch" call. +// Exactly one of *Goal or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Goal.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ManagementGoalsPatchCall) Do() (*Goal, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Goal{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementGoalsUpdateCall) Fields(s ...googleapi.Field) *ManagementGoalsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementGoalsUpdateCall) Context(ctx context.Context) *ManagementGoalsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementGoalsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + "goalId": c.goalId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.goals.update" call. +// Exactly one of *Goal or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Goal.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ManagementGoalsUpdateCall) Do() (*Goal, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Goal{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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.profileFilterLinks.delete": + +type ManagementProfileFilterLinksDeleteCall struct { + s *Service + accountId string + webPropertyId string + profileId string + linkId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Delete a profile filter link. +func (r *ManagementProfileFilterLinksService) Delete(accountId string, webPropertyId string, profileId string, linkId string) *ManagementProfileFilterLinksDeleteCall { + c := &ManagementProfileFilterLinksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + c.linkId = linkId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementProfileFilterLinksDeleteCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementProfileFilterLinksDeleteCall) Context(ctx context.Context) *ManagementProfileFilterLinksDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementProfileFilterLinksDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + "linkId": c.linkId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.profileFilterLinks.delete" call. +func (c *ManagementProfileFilterLinksDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a profile filter link.", + // "httpMethod": "DELETE", + // "id": "analytics.management.profileFilterLinks.delete", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId", + // "linkId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to which the profile filter link belongs.", + // "location": "path", + // "pattern": "\\d+", + // "required": true, + // "type": "string" + // }, + // "linkId": { + // "description": "ID of the profile filter link to delete.", + // "location": "path", + // "pattern": "\\d+:\\d+", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "Profile ID to which the filter link belongs.", + // "location": "path", + // "pattern": "\\d+", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property Id to which the profile filter link belongs.", + // "location": "path", + // "pattern": "UA-(\\d+)-(\\d+)", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}", + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.profileFilterLinks.get": + +type ManagementProfileFilterLinksGetCall struct { + s *Service + accountId string + webPropertyId string + profileId string + linkId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns a single profile filter link. +func (r *ManagementProfileFilterLinksService) Get(accountId string, webPropertyId string, profileId string, linkId string) *ManagementProfileFilterLinksGetCall { + c := &ManagementProfileFilterLinksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + c.linkId = linkId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementProfileFilterLinksGetCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementProfileFilterLinksGetCall) IfNoneMatch(entityTag string) *ManagementProfileFilterLinksGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementProfileFilterLinksGetCall) Context(ctx context.Context) *ManagementProfileFilterLinksGetCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementProfileFilterLinksGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + "linkId": c.linkId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.profileFilterLinks.get" call. +// Exactly one of *ProfileFilterLink or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ProfileFilterLink.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementProfileFilterLinksGetCall) Do() (*ProfileFilterLink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProfileFilterLink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a single profile filter link.", + // "httpMethod": "GET", + // "id": "analytics.management.profileFilterLinks.get", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId", + // "linkId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to retrieve profile filter link for.", + // "location": "path", + // "pattern": "\\d+", + // "required": true, + // "type": "string" + // }, + // "linkId": { + // "description": "ID of the profile filter link.", + // "location": "path", + // "pattern": "\\d+:\\d+", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "Profile ID to retrieve filter link for.", + // "location": "path", + // "pattern": "\\d+", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property Id to retrieve profile filter link for.", + // "location": "path", + // "pattern": "UA-(\\d+)-(\\d+)", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}", + // "response": { + // "$ref": "ProfileFilterLink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.profileFilterLinks.insert": + +type ManagementProfileFilterLinksInsertCall struct { + s *Service + accountId string + webPropertyId string + profileId string + profilefilterlink *ProfileFilterLink + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Create a new profile filter link. +func (r *ManagementProfileFilterLinksService) Insert(accountId string, webPropertyId string, profileId string, profilefilterlink *ProfileFilterLink) *ManagementProfileFilterLinksInsertCall { + c := &ManagementProfileFilterLinksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + c.profilefilterlink = profilefilterlink + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementProfileFilterLinksInsertCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementProfileFilterLinksInsertCall) Context(ctx context.Context) *ManagementProfileFilterLinksInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementProfileFilterLinksInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.profilefilterlink) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.profileFilterLinks.insert" call. +// Exactly one of *ProfileFilterLink or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ProfileFilterLink.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementProfileFilterLinksInsertCall) Do() (*ProfileFilterLink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProfileFilterLink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a new profile filter link.", + // "httpMethod": "POST", + // "id": "analytics.management.profileFilterLinks.insert", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to create profile filter link for.", + // "location": "path", + // "pattern": "\\d+", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "Profile ID to create filter link for.", + // "location": "path", + // "pattern": "\\d+", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property Id to create profile filter link for.", + // "location": "path", + // "pattern": "UA-(\\d+)-(\\d+)", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks", + // "request": { + // "$ref": "ProfileFilterLink" + // }, + // "response": { + // "$ref": "ProfileFilterLink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.profileFilterLinks.list": + +type ManagementProfileFilterLinksListCall struct { + s *Service + accountId string + webPropertyId string + profileId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all profile filter links for a profile. +func (r *ManagementProfileFilterLinksService) List(accountId string, webPropertyId string, profileId string) *ManagementProfileFilterLinksListCall { + c := &ManagementProfileFilterLinksListCall{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 filter links to include in this response. +func (c *ManagementProfileFilterLinksListCall) MaxResults(maxResults int64) *ManagementProfileFilterLinksListCall { + 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 *ManagementProfileFilterLinksListCall) StartIndex(startIndex int64) *ManagementProfileFilterLinksListCall { + c.opt_["start-index"] = startIndex + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementProfileFilterLinksListCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementProfileFilterLinksListCall) IfNoneMatch(entityTag string) *ManagementProfileFilterLinksListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementProfileFilterLinksListCall) Context(ctx context.Context) *ManagementProfileFilterLinksListCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementProfileFilterLinksListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.profileFilterLinks.list" call. +// Exactly one of *ProfileFilterLinks or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ProfileFilterLinks.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementProfileFilterLinksListCall) Do() (*ProfileFilterLinks, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProfileFilterLinks{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all profile filter links for a profile.", + // "httpMethod": "GET", + // "id": "analytics.management.profileFilterLinks.list", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to retrieve profile filter links for.", + // "location": "path", + // "pattern": "\\d+", + // "required": true, + // "type": "string" + // }, + // "max-results": { + // "description": "The maximum number of profile filter links to include in this response.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "profileId": { + // "description": "Profile ID to retrieve filter links for. Can either be a specific profile ID or '~all', which refers to all the profiles that user has access to.", + // "location": "path", + // "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" + // }, + // "webPropertyId": { + // "description": "Web property Id for profile filter links 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}/profileFilterLinks", + // "response": { + // "$ref": "ProfileFilterLinks" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.profileFilterLinks.patch": + +type ManagementProfileFilterLinksPatchCall struct { + s *Service + accountId string + webPropertyId string + profileId string + linkId string + profilefilterlink *ProfileFilterLink + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Update an existing profile filter link. This method supports +// patch semantics. +func (r *ManagementProfileFilterLinksService) Patch(accountId string, webPropertyId string, profileId string, linkId string, profilefilterlink *ProfileFilterLink) *ManagementProfileFilterLinksPatchCall { + c := &ManagementProfileFilterLinksPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + c.linkId = linkId + c.profilefilterlink = profilefilterlink + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementProfileFilterLinksPatchCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementProfileFilterLinksPatchCall) Context(ctx context.Context) *ManagementProfileFilterLinksPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementProfileFilterLinksPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.profilefilterlink) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + "linkId": c.linkId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.profileFilterLinks.patch" call. +// Exactly one of *ProfileFilterLink or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ProfileFilterLink.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementProfileFilterLinksPatchCall) Do() (*ProfileFilterLink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProfileFilterLink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update an existing profile filter link. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "analytics.management.profileFilterLinks.patch", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId", + // "linkId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to which profile filter link belongs.", + // "location": "path", + // "pattern": "\\d+", + // "required": true, + // "type": "string" + // }, + // "linkId": { + // "description": "ID of the profile filter link to be updated.", + // "location": "path", + // "pattern": "\\d+:\\d+", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "Profile ID to which filter link belongs", + // "location": "path", + // "pattern": "\\d+", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property Id to which profile filter link belongs", + // "location": "path", + // "pattern": "UA-(\\d+)-(\\d+)", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}", + // "request": { + // "$ref": "ProfileFilterLink" + // }, + // "response": { + // "$ref": "ProfileFilterLink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.profileFilterLinks.update": + +type ManagementProfileFilterLinksUpdateCall struct { + s *Service + accountId string + webPropertyId string + profileId string + linkId string + profilefilterlink *ProfileFilterLink + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Update an existing profile filter link. +func (r *ManagementProfileFilterLinksService) Update(accountId string, webPropertyId string, profileId string, linkId string, profilefilterlink *ProfileFilterLink) *ManagementProfileFilterLinksUpdateCall { + c := &ManagementProfileFilterLinksUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + c.linkId = linkId + c.profilefilterlink = profilefilterlink + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementProfileFilterLinksUpdateCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementProfileFilterLinksUpdateCall) Context(ctx context.Context) *ManagementProfileFilterLinksUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementProfileFilterLinksUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.profilefilterlink) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + "linkId": c.linkId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.profileFilterLinks.update" call. +// Exactly one of *ProfileFilterLink or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ProfileFilterLink.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementProfileFilterLinksUpdateCall) Do() (*ProfileFilterLink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProfileFilterLink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update an existing profile filter link.", + // "httpMethod": "PUT", + // "id": "analytics.management.profileFilterLinks.update", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId", + // "linkId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to which profile filter link belongs.", + // "location": "path", + // "pattern": "\\d+", + // "required": true, + // "type": "string" + // }, + // "linkId": { + // "description": "ID of the profile filter link to be updated.", + // "location": "path", + // "pattern": "\\d+:\\d+", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "Profile ID to which filter link belongs", + // "location": "path", + // "pattern": "\\d+", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property Id to which profile filter link belongs", + // "location": "path", + // "pattern": "UA-(\\d+)-(\\d+)", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}", + // "request": { + // "$ref": "ProfileFilterLink" + // }, + // "response": { + // "$ref": "ProfileFilterLink" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementProfileUserLinksDeleteCall) Fields(s ...googleapi.Field) *ManagementProfileUserLinksDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementProfileUserLinksDeleteCall) Context(ctx context.Context) *ManagementProfileUserLinksDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementProfileUserLinksDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + "linkId": c.linkId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.profileUserLinks.delete" call. +func (c *ManagementProfileUserLinksDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementProfileUserLinksInsertCall) Fields(s ...googleapi.Field) *ManagementProfileUserLinksInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementProfileUserLinksInsertCall) Context(ctx context.Context) *ManagementProfileUserLinksInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementProfileUserLinksInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.profileUserLinks.insert" call. +// Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *EntityUserLink.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementProfileUserLinksInsertCall) Do() (*EntityUserLink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EntityUserLink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementProfileUserLinksListCall) Fields(s ...googleapi.Field) *ManagementProfileUserLinksListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementProfileUserLinksListCall) IfNoneMatch(entityTag string) *ManagementProfileUserLinksListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementProfileUserLinksListCall) Context(ctx context.Context) *ManagementProfileUserLinksListCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementProfileUserLinksListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.profileUserLinks.list" call. +// Exactly one of *EntityUserLinks or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *EntityUserLinks.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementProfileUserLinksListCall) Do() (*EntityUserLinks, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EntityUserLinks{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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. Can either be a specific profile ID or '~all', which refers to all the profiles that user has access to.", + // "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. 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}/entityUserLinks", + // "response": { + // "$ref": "EntityUserLinks" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.manage.users", + // "https://www.googleapis.com/auth/analytics.manage.users.readonly" + // ] + // } + +} + +// 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementProfileUserLinksUpdateCall) Fields(s ...googleapi.Field) *ManagementProfileUserLinksUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementProfileUserLinksUpdateCall) Context(ctx context.Context) *ManagementProfileUserLinksUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementProfileUserLinksUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + "linkId": c.linkId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.profileUserLinks.update" call. +// Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *EntityUserLink.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementProfileUserLinksUpdateCall) Do() (*EntityUserLink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EntityUserLink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementProfilesDeleteCall) Fields(s ...googleapi.Field) *ManagementProfilesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementProfilesDeleteCall) Context(ctx context.Context) *ManagementProfilesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementProfilesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.profiles.delete" call. +func (c *ManagementProfilesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementProfilesGetCall) Fields(s ...googleapi.Field) *ManagementProfilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementProfilesGetCall) IfNoneMatch(entityTag string) *ManagementProfilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementProfilesGetCall) Context(ctx context.Context) *ManagementProfilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementProfilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.profiles.get" call. +// Exactly one of *Profile or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Profile.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ManagementProfilesGetCall) Do() (*Profile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Profile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementProfilesInsertCall) Fields(s ...googleapi.Field) *ManagementProfilesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementProfilesInsertCall) Context(ctx context.Context) *ManagementProfilesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementProfilesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.profiles.insert" call. +// Exactly one of *Profile or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Profile.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ManagementProfilesInsertCall) Do() (*Profile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Profile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementProfilesListCall) Fields(s ...googleapi.Field) *ManagementProfilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementProfilesListCall) IfNoneMatch(entityTag string) *ManagementProfilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementProfilesListCall) Context(ctx context.Context) *ManagementProfilesListCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementProfilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.profiles.list" call. +// Exactly one of *Profiles or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Profiles.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ManagementProfilesListCall) Do() (*Profiles, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Profiles{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementProfilesPatchCall) Fields(s ...googleapi.Field) *ManagementProfilesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementProfilesPatchCall) Context(ctx context.Context) *ManagementProfilesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementProfilesPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.profiles.patch" call. +// Exactly one of *Profile or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Profile.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ManagementProfilesPatchCall) Do() (*Profile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Profile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementProfilesUpdateCall) Fields(s ...googleapi.Field) *ManagementProfilesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementProfilesUpdateCall) Context(ctx context.Context) *ManagementProfilesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementProfilesUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.profiles.update" call. +// Exactly one of *Profile or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Profile.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ManagementProfilesUpdateCall) Do() (*Profile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Profile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementSegmentsListCall) Fields(s ...googleapi.Field) *ManagementSegmentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementSegmentsListCall) IfNoneMatch(entityTag string) *ManagementSegmentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementSegmentsListCall) Context(ctx context.Context) *ManagementSegmentsListCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementSegmentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.segments.list" call. +// Exactly one of *Segments or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Segments.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ManagementSegmentsListCall) Do() (*Segments, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Segments{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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.unsampledReports.get": + +type ManagementUnsampledReportsGetCall struct { + s *Service + accountId string + webPropertyId string + profileId string + unsampledReportId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns a single unsampled report. +func (r *ManagementUnsampledReportsService) Get(accountId string, webPropertyId string, profileId string, unsampledReportId string) *ManagementUnsampledReportsGetCall { + c := &ManagementUnsampledReportsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + c.unsampledReportId = unsampledReportId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementUnsampledReportsGetCall) Fields(s ...googleapi.Field) *ManagementUnsampledReportsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementUnsampledReportsGetCall) IfNoneMatch(entityTag string) *ManagementUnsampledReportsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementUnsampledReportsGetCall) Context(ctx context.Context) *ManagementUnsampledReportsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementUnsampledReportsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + "unsampledReportId": c.unsampledReportId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.unsampledReports.get" call. +// Exactly one of *UnsampledReport or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UnsampledReport.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementUnsampledReportsGetCall) Do() (*UnsampledReport, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UnsampledReport{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a single unsampled report.", + // "httpMethod": "GET", + // "id": "analytics.management.unsampledReports.get", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId", + // "unsampledReportId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to retrieve unsampled report for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "View (Profile) ID to retrieve unsampled report for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "unsampledReportId": { + // "description": "ID of the unsampled report to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID to retrieve unsampled reports for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}", + // "response": { + // "$ref": "UnsampledReport" + // }, + // "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.unsampledReports.insert": + +type ManagementUnsampledReportsInsertCall struct { + s *Service + accountId string + webPropertyId string + profileId string + unsampledreport *UnsampledReport + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Create a new unsampled report. +func (r *ManagementUnsampledReportsService) Insert(accountId string, webPropertyId string, profileId string, unsampledreport *UnsampledReport) *ManagementUnsampledReportsInsertCall { + c := &ManagementUnsampledReportsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.profileId = profileId + c.unsampledreport = unsampledreport + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementUnsampledReportsInsertCall) Fields(s ...googleapi.Field) *ManagementUnsampledReportsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementUnsampledReportsInsertCall) Context(ctx context.Context) *ManagementUnsampledReportsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementUnsampledReportsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.unsampledreport) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.unsampledReports.insert" call. +// Exactly one of *UnsampledReport or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UnsampledReport.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementUnsampledReportsInsertCall) Do() (*UnsampledReport, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UnsampledReport{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a new unsampled report.", + // "httpMethod": "POST", + // "id": "analytics.management.unsampledReports.insert", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to create the unsampled report for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "View (Profile) ID to create the unsampled report for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID to create the unsampled report for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports", + // "request": { + // "$ref": "UnsampledReport" + // }, + // "response": { + // "$ref": "UnsampledReport" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics", + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.unsampledReports.list": + +type ManagementUnsampledReportsListCall struct { + s *Service + accountId string + webPropertyId string + profileId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists unsampled reports to which the user has access. +func (r *ManagementUnsampledReportsService) List(accountId string, webPropertyId string, profileId string) *ManagementUnsampledReportsListCall { + c := &ManagementUnsampledReportsListCall{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 unsampled reports to include in this response. +func (c *ManagementUnsampledReportsListCall) MaxResults(maxResults int64) *ManagementUnsampledReportsListCall { + c.opt_["max-results"] = maxResults + return c +} + +// StartIndex sets the optional parameter "start-index": An index of the +// first unsampled report to retrieve. Use this parameter as a +// pagination mechanism along with the max-results parameter. +func (c *ManagementUnsampledReportsListCall) StartIndex(startIndex int64) *ManagementUnsampledReportsListCall { + c.opt_["start-index"] = startIndex + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementUnsampledReportsListCall) Fields(s ...googleapi.Field) *ManagementUnsampledReportsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementUnsampledReportsListCall) IfNoneMatch(entityTag string) *ManagementUnsampledReportsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementUnsampledReportsListCall) Context(ctx context.Context) *ManagementUnsampledReportsListCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementUnsampledReportsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "profileId": c.profileId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.unsampledReports.list" call. +// Exactly one of *UnsampledReports or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *UnsampledReports.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementUnsampledReportsListCall) Do() (*UnsampledReports, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UnsampledReports{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists unsampled reports to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.unsampledReports.list", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "profileId" + // ], + // "parameters": { + // "accountId": { + // "description": "Account ID to retrieve unsampled reports for. Must be a specific account ID, ~all is not supported.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "max-results": { + // "description": "The maximum number of unsampled reports to include in this response.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "profileId": { + // "description": "View (Profile) ID to retrieve unsampled reports for. Must be a specific view (profile) ID, ~all is not supported.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "start-index": { + // "description": "An index of the first unsampled report 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 unsampled reports for. Must be a specific web property ID, ~all is not supported.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports", + // "response": { + // "$ref": "UnsampledReports" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementUploadsDeleteUploadDataCall) Fields(s ...googleapi.Field) *ManagementUploadsDeleteUploadDataCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementUploadsDeleteUploadDataCall) Context(ctx context.Context) *ManagementUploadsDeleteUploadDataCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementUploadsDeleteUploadDataCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyticsdataimportdeleteuploaddatarequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/deleteUploadData") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "customDataSourceId": c.customDataSourceId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.uploads.deleteUploadData" call. +func (c *ManagementUploadsDeleteUploadDataCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementUploadsGetCall) Fields(s ...googleapi.Field) *ManagementUploadsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementUploadsGetCall) IfNoneMatch(entityTag string) *ManagementUploadsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementUploadsGetCall) Context(ctx context.Context) *ManagementUploadsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementUploadsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads/{uploadId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "customDataSourceId": c.customDataSourceId, + "uploadId": c.uploadId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.uploads.get" call. +// Exactly one of *Upload or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Upload.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ManagementUploadsGetCall) Do() (*Upload, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Upload{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementUploadsListCall) Fields(s ...googleapi.Field) *ManagementUploadsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementUploadsListCall) IfNoneMatch(entityTag string) *ManagementUploadsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementUploadsListCall) Context(ctx context.Context) *ManagementUploadsListCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementUploadsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "customDataSourceId": c.customDataSourceId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.uploads.list" call. +// Exactly one of *Uploads or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Uploads.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ManagementUploadsListCall) Do() (*Uploads, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Uploads{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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 + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// 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 +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *ManagementUploadsUploadDataCall) Media(r io.Reader) *ManagementUploadsUploadDataCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *ManagementUploadsUploadDataCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ManagementUploadsUploadDataCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *ManagementUploadsUploadDataCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ManagementUploadsUploadDataCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementUploadsUploadDataCall) Fields(s ...googleapi.Field) *ManagementUploadsUploadDataCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *ManagementUploadsUploadDataCall) Context(ctx context.Context) *ManagementUploadsUploadDataCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementUploadsUploadDataCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + body = new(bytes.Buffer) + ctype := "application/json" + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "customDataSourceId": c.customDataSourceId, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.uploads.uploadData" call. +// Exactly one of *Upload or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Upload.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ManagementUploadsUploadDataCall) Do() (*Upload, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &Upload{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.webPropertyAdWordsLinks.delete": + +type ManagementWebPropertyAdWordsLinksDeleteCall struct { + s *Service + accountId string + webPropertyId string + webPropertyAdWordsLinkId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a web property-AdWords link. +func (r *ManagementWebPropertyAdWordsLinksService) Delete(accountId string, webPropertyId string, webPropertyAdWordsLinkId string) *ManagementWebPropertyAdWordsLinksDeleteCall { + c := &ManagementWebPropertyAdWordsLinksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.webPropertyAdWordsLinkId = webPropertyAdWordsLinkId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementWebPropertyAdWordsLinksDeleteCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementWebPropertyAdWordsLinksDeleteCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementWebPropertyAdWordsLinksDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "webPropertyAdWordsLinkId": c.webPropertyAdWordsLinkId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.webPropertyAdWordsLinks.delete" call. +func (c *ManagementWebPropertyAdWordsLinksDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a web property-AdWords link.", + // "httpMethod": "DELETE", + // "id": "analytics.management.webPropertyAdWordsLinks.delete", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "webPropertyAdWordsLinkId" + // ], + // "parameters": { + // "accountId": { + // "description": "ID of the account which the given web property belongs to.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyAdWordsLinkId": { + // "description": "Web property AdWords link ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID to delete the AdWords link for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}", + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.webPropertyAdWordsLinks.get": + +type ManagementWebPropertyAdWordsLinksGetCall struct { + s *Service + accountId string + webPropertyId string + webPropertyAdWordsLinkId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns a web property-AdWords link to which the user has +// access. +func (r *ManagementWebPropertyAdWordsLinksService) Get(accountId string, webPropertyId string, webPropertyAdWordsLinkId string) *ManagementWebPropertyAdWordsLinksGetCall { + c := &ManagementWebPropertyAdWordsLinksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.webPropertyAdWordsLinkId = webPropertyAdWordsLinkId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementWebPropertyAdWordsLinksGetCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementWebPropertyAdWordsLinksGetCall) IfNoneMatch(entityTag string) *ManagementWebPropertyAdWordsLinksGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementWebPropertyAdWordsLinksGetCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksGetCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementWebPropertyAdWordsLinksGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "webPropertyAdWordsLinkId": c.webPropertyAdWordsLinkId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.webPropertyAdWordsLinks.get" call. +// Exactly one of *EntityAdWordsLink or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *EntityAdWordsLink.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementWebPropertyAdWordsLinksGetCall) Do() (*EntityAdWordsLink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EntityAdWordsLink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a web property-AdWords link to which the user has access.", + // "httpMethod": "GET", + // "id": "analytics.management.webPropertyAdWordsLinks.get", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "webPropertyAdWordsLinkId" + // ], + // "parameters": { + // "accountId": { + // "description": "ID of the account which the given web property belongs to.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyAdWordsLinkId": { + // "description": "Web property-AdWords link ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID to retrieve the AdWords link for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}", + // "response": { + // "$ref": "EntityAdWordsLink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.webPropertyAdWordsLinks.insert": + +type ManagementWebPropertyAdWordsLinksInsertCall struct { + s *Service + accountId string + webPropertyId string + entityadwordslink *EntityAdWordsLink + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a webProperty-AdWords link. +func (r *ManagementWebPropertyAdWordsLinksService) Insert(accountId string, webPropertyId string, entityadwordslink *EntityAdWordsLink) *ManagementWebPropertyAdWordsLinksInsertCall { + c := &ManagementWebPropertyAdWordsLinksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.entityadwordslink = entityadwordslink + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementWebPropertyAdWordsLinksInsertCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementWebPropertyAdWordsLinksInsertCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementWebPropertyAdWordsLinksInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityadwordslink) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.webPropertyAdWordsLinks.insert" call. +// Exactly one of *EntityAdWordsLink or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *EntityAdWordsLink.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementWebPropertyAdWordsLinksInsertCall) Do() (*EntityAdWordsLink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EntityAdWordsLink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a webProperty-AdWords link.", + // "httpMethod": "POST", + // "id": "analytics.management.webPropertyAdWordsLinks.insert", + // "parameterOrder": [ + // "accountId", + // "webPropertyId" + // ], + // "parameters": { + // "accountId": { + // "description": "ID of the Google Analytics account to create the link for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID to create the link for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks", + // "request": { + // "$ref": "EntityAdWordsLink" + // }, + // "response": { + // "$ref": "EntityAdWordsLink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.webPropertyAdWordsLinks.list": + +type ManagementWebPropertyAdWordsLinksListCall struct { + s *Service + accountId string + webPropertyId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists webProperty-AdWords links for a given web property. +func (r *ManagementWebPropertyAdWordsLinksService) List(accountId string, webPropertyId string) *ManagementWebPropertyAdWordsLinksListCall { + c := &ManagementWebPropertyAdWordsLinksListCall{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-AdWords links to include in this response. +func (c *ManagementWebPropertyAdWordsLinksListCall) MaxResults(maxResults int64) *ManagementWebPropertyAdWordsLinksListCall { + c.opt_["max-results"] = maxResults + return c +} + +// StartIndex sets the optional parameter "start-index": An index of the +// first webProperty-AdWords link to retrieve. Use this parameter as a +// pagination mechanism along with the max-results parameter. +func (c *ManagementWebPropertyAdWordsLinksListCall) StartIndex(startIndex int64) *ManagementWebPropertyAdWordsLinksListCall { + c.opt_["start-index"] = startIndex + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementWebPropertyAdWordsLinksListCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementWebPropertyAdWordsLinksListCall) IfNoneMatch(entityTag string) *ManagementWebPropertyAdWordsLinksListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementWebPropertyAdWordsLinksListCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksListCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementWebPropertyAdWordsLinksListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.webPropertyAdWordsLinks.list" call. +// Exactly one of *EntityAdWordsLinks or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *EntityAdWordsLinks.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementWebPropertyAdWordsLinksListCall) Do() (*EntityAdWordsLinks, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EntityAdWordsLinks{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists webProperty-AdWords links for a given web property.", + // "httpMethod": "GET", + // "id": "analytics.management.webPropertyAdWordsLinks.list", + // "parameterOrder": [ + // "accountId", + // "webPropertyId" + // ], + // "parameters": { + // "accountId": { + // "description": "ID of the account which the given web property belongs to.", + // "location": "path", + // "pattern": "\\d+", + // "required": true, + // "type": "string" + // }, + // "max-results": { + // "description": "The maximum number of webProperty-AdWords links to include in this response.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "start-index": { + // "description": "An index of the first webProperty-AdWords 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 to retrieve the AdWords links for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks", + // "response": { + // "$ref": "EntityAdWordsLinks" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit", + // "https://www.googleapis.com/auth/analytics.readonly" + // ] + // } + +} + +// method id "analytics.management.webPropertyAdWordsLinks.patch": + +type ManagementWebPropertyAdWordsLinksPatchCall struct { + s *Service + accountId string + webPropertyId string + webPropertyAdWordsLinkId string + entityadwordslink *EntityAdWordsLink + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing webProperty-AdWords link. This method +// supports patch semantics. +func (r *ManagementWebPropertyAdWordsLinksService) Patch(accountId string, webPropertyId string, webPropertyAdWordsLinkId string, entityadwordslink *EntityAdWordsLink) *ManagementWebPropertyAdWordsLinksPatchCall { + c := &ManagementWebPropertyAdWordsLinksPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.webPropertyAdWordsLinkId = webPropertyAdWordsLinkId + c.entityadwordslink = entityadwordslink + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementWebPropertyAdWordsLinksPatchCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementWebPropertyAdWordsLinksPatchCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementWebPropertyAdWordsLinksPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityadwordslink) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "webPropertyAdWordsLinkId": c.webPropertyAdWordsLinkId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.webPropertyAdWordsLinks.patch" call. +// Exactly one of *EntityAdWordsLink or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *EntityAdWordsLink.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementWebPropertyAdWordsLinksPatchCall) Do() (*EntityAdWordsLink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EntityAdWordsLink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing webProperty-AdWords link. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "analytics.management.webPropertyAdWordsLinks.patch", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "webPropertyAdWordsLinkId" + // ], + // "parameters": { + // "accountId": { + // "description": "ID of the account which the given web property belongs to.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyAdWordsLinkId": { + // "description": "Web property-AdWords link ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID to retrieve the AdWords link for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}", + // "request": { + // "$ref": "EntityAdWordsLink" + // }, + // "response": { + // "$ref": "EntityAdWordsLink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.webPropertyAdWordsLinks.update": + +type ManagementWebPropertyAdWordsLinksUpdateCall struct { + s *Service + accountId string + webPropertyId string + webPropertyAdWordsLinkId string + entityadwordslink *EntityAdWordsLink + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing webProperty-AdWords link. +func (r *ManagementWebPropertyAdWordsLinksService) Update(accountId string, webPropertyId string, webPropertyAdWordsLinkId string, entityadwordslink *EntityAdWordsLink) *ManagementWebPropertyAdWordsLinksUpdateCall { + c := &ManagementWebPropertyAdWordsLinksUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.webPropertyId = webPropertyId + c.webPropertyAdWordsLinkId = webPropertyAdWordsLinkId + c.entityadwordslink = entityadwordslink + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementWebPropertyAdWordsLinksUpdateCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementWebPropertyAdWordsLinksUpdateCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementWebPropertyAdWordsLinksUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityadwordslink) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "webPropertyAdWordsLinkId": c.webPropertyAdWordsLinkId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.webPropertyAdWordsLinks.update" call. +// Exactly one of *EntityAdWordsLink or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *EntityAdWordsLink.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementWebPropertyAdWordsLinksUpdateCall) Do() (*EntityAdWordsLink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EntityAdWordsLink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing webProperty-AdWords link.", + // "httpMethod": "PUT", + // "id": "analytics.management.webPropertyAdWordsLinks.update", + // "parameterOrder": [ + // "accountId", + // "webPropertyId", + // "webPropertyAdWordsLinkId" + // ], + // "parameters": { + // "accountId": { + // "description": "ID of the account which the given web property belongs to.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyAdWordsLinkId": { + // "description": "Web property-AdWords link ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "webPropertyId": { + // "description": "Web property ID to retrieve the AdWords link for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}", + // "request": { + // "$ref": "EntityAdWordsLink" + // }, + // "response": { + // "$ref": "EntityAdWordsLink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.edit" + // ] + // } + +} + +// method id "analytics.management.webproperties.get": + +type ManagementWebpropertiesGetCall struct { + s *Service + accountId string + webPropertyId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementWebpropertiesGetCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementWebpropertiesGetCall) IfNoneMatch(entityTag string) *ManagementWebpropertiesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementWebpropertiesGetCall) Context(ctx context.Context) *ManagementWebpropertiesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementWebpropertiesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.webproperties.get" call. +// Exactly one of *Webproperty or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Webproperty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ManagementWebpropertiesGetCall) Do() (*Webproperty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Webproperty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementWebpropertiesInsertCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementWebpropertiesInsertCall) Context(ctx context.Context) *ManagementWebpropertiesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementWebpropertiesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.webproperties.insert" call. +// Exactly one of *Webproperty or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Webproperty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ManagementWebpropertiesInsertCall) Do() (*Webproperty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Webproperty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementWebpropertiesListCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementWebpropertiesListCall) IfNoneMatch(entityTag string) *ManagementWebpropertiesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementWebpropertiesListCall) Context(ctx context.Context) *ManagementWebpropertiesListCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementWebpropertiesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.webproperties.list" call. +// Exactly one of *Webproperties or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Webproperties.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementWebpropertiesListCall) Do() (*Webproperties, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Webproperties{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementWebpropertiesPatchCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementWebpropertiesPatchCall) Context(ctx context.Context) *ManagementWebpropertiesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementWebpropertiesPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.webproperties.patch" call. +// Exactly one of *Webproperty or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Webproperty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ManagementWebpropertiesPatchCall) Do() (*Webproperty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Webproperty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementWebpropertiesUpdateCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementWebpropertiesUpdateCall) Context(ctx context.Context) *ManagementWebpropertiesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementWebpropertiesUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.webproperties.update" call. +// Exactly one of *Webproperty or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Webproperty.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ManagementWebpropertiesUpdateCall) Do() (*Webproperty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Webproperty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementWebpropertyUserLinksDeleteCall) Fields(s ...googleapi.Field) *ManagementWebpropertyUserLinksDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementWebpropertyUserLinksDeleteCall) Context(ctx context.Context) *ManagementWebpropertyUserLinksDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementWebpropertyUserLinksDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "linkId": c.linkId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.webpropertyUserLinks.delete" call. +func (c *ManagementWebpropertyUserLinksDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementWebpropertyUserLinksInsertCall) Fields(s ...googleapi.Field) *ManagementWebpropertyUserLinksInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementWebpropertyUserLinksInsertCall) Context(ctx context.Context) *ManagementWebpropertyUserLinksInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementWebpropertyUserLinksInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.webpropertyUserLinks.insert" call. +// Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *EntityUserLink.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementWebpropertyUserLinksInsertCall) Do() (*EntityUserLink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EntityUserLink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementWebpropertyUserLinksListCall) Fields(s ...googleapi.Field) *ManagementWebpropertyUserLinksListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagementWebpropertyUserLinksListCall) IfNoneMatch(entityTag string) *ManagementWebpropertyUserLinksListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementWebpropertyUserLinksListCall) Context(ctx context.Context) *ManagementWebpropertyUserLinksListCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementWebpropertyUserLinksListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.webpropertyUserLinks.list" call. +// Exactly one of *EntityUserLinks or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *EntityUserLinks.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementWebpropertyUserLinksListCall) Do() (*EntityUserLinks, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EntityUserLinks{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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. 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}/entityUserLinks", + // "response": { + // "$ref": "EntityUserLinks" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.manage.users", + // "https://www.googleapis.com/auth/analytics.manage.users.readonly" + // ] + // } + +} + +// method id "analytics.management.webpropertyUserLinks.update": + +type ManagementWebpropertyUserLinksUpdateCall struct { + s *Service + accountId string + webPropertyId string + linkId string + entityuserlink *EntityUserLink + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagementWebpropertyUserLinksUpdateCall) Fields(s ...googleapi.Field) *ManagementWebpropertyUserLinksUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagementWebpropertyUserLinksUpdateCall) Context(ctx context.Context) *ManagementWebpropertyUserLinksUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ManagementWebpropertyUserLinksUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "webPropertyId": c.webPropertyId, + "linkId": c.linkId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.management.webpropertyUserLinks.update" call. +// Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *EntityUserLink.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagementWebpropertyUserLinksUpdateCall) Do() (*EntityUserLink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EntityUserLink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MetadataColumnsListCall) Fields(s ...googleapi.Field) *MetadataColumnsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MetadataColumnsListCall) IfNoneMatch(entityTag string) *MetadataColumnsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MetadataColumnsListCall) Context(ctx context.Context) *MetadataColumnsListCall { + c.ctx_ = ctx + return c +} + +func (c *MetadataColumnsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "metadata/{reportType}/columns") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "reportType": c.reportType, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.metadata.columns.list" call. +// Exactly one of *Columns or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Columns.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *MetadataColumnsListCall) Do() (*Columns, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Columns{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all 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" + // ] + // } + +} + +// method id "analytics.provisioning.createAccountTicket": + +type ProvisioningCreateAccountTicketCall struct { + s *Service + accountticket *AccountTicket + opt_ map[string]interface{} + ctx_ context.Context +} + +// CreateAccountTicket: Creates an account ticket. +func (r *ProvisioningService) CreateAccountTicket(accountticket *AccountTicket) *ProvisioningCreateAccountTicketCall { + c := &ProvisioningCreateAccountTicketCall{s: r.s, opt_: make(map[string]interface{})} + c.accountticket = accountticket + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProvisioningCreateAccountTicketCall) Fields(s ...googleapi.Field) *ProvisioningCreateAccountTicketCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProvisioningCreateAccountTicketCall) Context(ctx context.Context) *ProvisioningCreateAccountTicketCall { + c.ctx_ = ctx + return c +} + +func (c *ProvisioningCreateAccountTicketCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountticket) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "provisioning/createAccountTicket") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "analytics.provisioning.createAccountTicket" call. +// Exactly one of *AccountTicket or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AccountTicket.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProvisioningCreateAccountTicketCall) Do() (*AccountTicket, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountTicket{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an account ticket.", + // "httpMethod": "POST", + // "id": "analytics.provisioning.createAccountTicket", + // "path": "provisioning/createAccountTicket", + // "request": { + // "$ref": "AccountTicket" + // }, + // "response": { + // "$ref": "AccountTicket" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/analytics.provision" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/androidenterprise/v1/androidenterprise-api.json b/Godeps/_workspace/src/google.golang.org/api/androidenterprise/v1/androidenterprise-api.json new file mode 100644 index 000000000..21eb8506d --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/androidenterprise/v1/androidenterprise-api.json @@ -0,0 +1,2415 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/k50i1jH6d5mxm7o5MPctHqUGfAg\"", + "discoveryVersion": "v1", + "id": "androidenterprise:v1", + "name": "androidenterprise", + "canonicalName": "Android Enterprise", + "version": "v1", + "revision": "20150910", + "title": "Google Play EMM API", + "description": "Allows MDMs/EMMs and enterprises to manage the deployment of apps to Android for Work users.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/android-16.png", + "x32": "https://www.google.com/images/icons/product/android-32.png" + }, + "documentationLink": "https://developers.google.com/play/enterprise", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/androidenterprise/v1/", + "basePath": "/androidenterprise/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "androidenterprise/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/androidenterprise": { + "description": "Manage corporate Android devices" + } + } + } + }, + "schemas": { + "AppRestrictionsSchema": { + "id": "AppRestrictionsSchema", + "type": "object", + "description": "Represents the list of app restrictions available to be pre-configured for the product.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#appRestrictionsSchema\".", + "default": "androidenterprise#appRestrictionsSchema" + }, + "restrictions": { + "type": "array", + "description": "The set of restrictions that make up this schema.", + "items": { + "$ref": "AppRestrictionsSchemaRestriction" + } + } + } + }, + "AppRestrictionsSchemaRestriction": { + "id": "AppRestrictionsSchemaRestriction", + "type": "object", + "description": "A restriction in the App Restriction Schema represents a piece of configuration that may be pre-applied.", + "properties": { + "defaultValue": { + "$ref": "AppRestrictionsSchemaRestrictionRestrictionValue", + "description": "The default value of the restriction." + }, + "description": { + "type": "string", + "description": "A longer description of the restriction, giving more detail of what it affects." + }, + "entry": { + "type": "array", + "description": "For choice or multiselect restrictions, the list of possible entries' human-readable names.", + "items": { + "type": "string" + } + }, + "entryValue": { + "type": "array", + "description": "For choice or multiselect restrictions, the list of possible entries' machine-readable values.", + "items": { + "type": "string" + } + }, + "key": { + "type": "string", + "description": "The unique key that the product uses to identify the restriction, e.g. \"com.google.android.gm.fieldname\"." + }, + "restrictionType": { + "type": "string", + "description": "The type of the restriction." + }, + "title": { + "type": "string", + "description": "The name of the restriction." + } + } + }, + "AppRestrictionsSchemaRestrictionRestrictionValue": { + "id": "AppRestrictionsSchemaRestrictionRestrictionValue", + "type": "object", + "description": "A typed value for the restriction.", + "properties": { + "type": { + "type": "string", + "description": "The type of the value being provided." + }, + "valueBool": { + "type": "boolean", + "description": "The boolean value - this will only be present if type is bool." + }, + "valueInteger": { + "type": "integer", + "description": "The integer value - this will only be present if type is integer.", + "format": "int32" + }, + "valueMultiselect": { + "type": "array", + "description": "The list of string values - this will only be present if type is multiselect.", + "items": { + "type": "string" + } + }, + "valueString": { + "type": "string", + "description": "The string value - this will be present for types string, choice and hidden." + } + } + }, + "AppVersion": { + "id": "AppVersion", + "type": "object", + "description": "This represents a single version of the app.", + "properties": { + "versionCode": { + "type": "integer", + "description": "Unique increasing identifier for the app version.", + "format": "int32" + }, + "versionString": { + "type": "string", + "description": "The string used in the Play Store by the app developer to identify the version. The string is not necessarily unique or localized (for example, the string could be \"1.4\")." + } + } + }, + "ApprovalUrlInfo": { + "id": "ApprovalUrlInfo", + "type": "object", + "description": "Information on an approval URL.", + "properties": { + "approvalUrl": { + "type": "string", + "description": "A URL that displays a product's permissions and that can also be used to approve the product with the Products.approve call." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#approvalUrlInfo\".", + "default": "androidenterprise#approvalUrlInfo" + } + } + }, + "Collection": { + "id": "Collection", + "type": "object", + "description": "A collection resource defines a named set of apps that is visible to a set of users in the Google Play Store app running on those users' managed devices. Those users can then install any of those apps if they wish (which will trigger creation of install and entitlement resources). A user cannot install an app on a managed device unless the app is listed in at least one collection that is visible to that user.\n\nNote that the API can be used to directly install an app regardless of whether it is in any collection - so an enterprise has a choice of either directly pushing apps to users, or allowing users to install apps if they want. Which is appropriate will depend on the enterprise's policies and the purpose of the apps concerned.", + "properties": { + "collectionId": { + "type": "string", + "description": "Arbitrary unique ID, allocated by the API on creation." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#collection\".", + "default": "androidenterprise#collection" + }, + "name": { + "type": "string", + "description": "A user-friendly name for the collection (should be unique), e.g. \"Accounting apps\".", + "annotations": { + "required": [ + "androidenterprise.collections.insert", + "androidenterprise.collections.update" + ] + } + }, + "productId": { + "type": "array", + "description": "The IDs of the products in the collection, in the order in which they should be displayed.", + "items": { + "type": "string" + }, + "annotations": { + "required": [ + "androidenterprise.collections.insert", + "androidenterprise.collections.update" + ] + } + }, + "visibility": { + "type": "string", + "description": "Whether this collection is visible to all users, or only to the users that have been granted access through the \"Collectionviewers\" API. With the launch of the \"setAvailableProductSet\" API, this property should always be set to \"viewersOnly\", as the \"allUsers\" option will bypass the \"availableProductSet\" for all users within a domain.\n\nThe \"allUsers\" setting is deprecated, and will be removed." + } + } + }, + "CollectionViewersListResponse": { + "id": "CollectionViewersListResponse", + "type": "object", + "description": "The user resources for the collection.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#collectionViewersListResponse\".", + "default": "androidenterprise#collectionViewersListResponse" + }, + "user": { + "type": "array", + "description": "A user of an enterprise.", + "items": { + "$ref": "User" + } + } + } + }, + "CollectionsListResponse": { + "id": "CollectionsListResponse", + "type": "object", + "description": "The collection resources for the enterprise.", + "properties": { + "collection": { + "type": "array", + "description": "An ordered collection of products which can be made visible on the Google Play Store to a selected group of users.", + "items": { + "$ref": "Collection" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#collectionsListResponse\".", + "default": "androidenterprise#collectionsListResponse" + } + } + }, + "Device": { + "id": "Device", + "type": "object", + "description": "A device resource represents a mobile device managed by the MDM and belonging to a specific enterprise user.\n\nThis collection cannot be modified via the API; it is automatically populated as devices are set up to be managed.", + "properties": { + "androidId": { + "type": "string", + "description": "The Google Play Services Android ID for the device encoded as a lowercase hex string, e.g. \"123456789abcdef0\"." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#device\".", + "default": "androidenterprise#device" + }, + "managementType": { + "type": "string", + "description": "The mechanism by which this device is managed by the MDM. \"managedDevice\" means that the MDM's app is a device owner. \"managedProfile\" means that the MDM's app is the profile owner (and there is a separate personal profile which is not managed). \"containerApp\" means that the MDM's app is managing the Android for Work container app on the device." + } + } + }, + "DeviceState": { + "id": "DeviceState", + "type": "object", + "description": "The state of a user's device, as accessed by the getState and setState methods on device resources.", + "properties": { + "accountState": { + "type": "string", + "description": "The state of the Google account on the device. \"enabled\" indicates that the Google account on the device can be used to access Google services (including Google Play), while \"disabled\" means that it cannot. A new device is initially in the \"disabled\" state." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#deviceState\".", + "default": "androidenterprise#deviceState" + } + } + }, + "DevicesListResponse": { + "id": "DevicesListResponse", + "type": "object", + "description": "The device resources for the user.", + "properties": { + "device": { + "type": "array", + "description": "A managed device.", + "items": { + "$ref": "Device" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#devicesListResponse\".", + "default": "androidenterprise#devicesListResponse" + } + } + }, + "Enterprise": { + "id": "Enterprise", + "type": "object", + "description": "An enterprise resource represents a binding between an organisation and their MDM.\n\nTo create an enterprise, an admin of the enterprise must first go through a Play for Work sign-up flow. At the end of this the admin will be presented with a token (a short opaque alphanumeric string). They must then present this to the MDM, who then supplies it to the enroll method. Until this is done the MDM will not have any access to the enterprise.\n\nAfter calling enroll the MDM should call setAccount to specify the service account that will be allowed to act on behalf of the enterprise, which will be required for access to the enterprise's data through this API. Only one call of setAccount is allowed for a given enterprise; the only way to change the account later is to unenroll the enterprise and enroll it again (obtaining a new token).\n\nThe MDM can unenroll an enterprise in order to sever the binding between them. Re-enrolling an enterprise is possible, but requires a new token to be retrieved. Enterprises.unenroll requires the MDM's credentials (as enroll does), not the enterprise's. Enterprises.unenroll can only be used for enterprises that were previously enrolled with the enroll call. Any enterprises that were enrolled using the (deprecated) Enterprises.insert call must be unenrolled with Enterprises.delete and can then be re-enrolled using the Enterprises.enroll call.\n\nThe ID for an enterprise is an opaque string. It is returned by insert and enroll and can also be retrieved if the enterprise's primary domain is known using the list method.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID for the enterprise." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#enterprise\".", + "default": "androidenterprise#enterprise" + }, + "name": { + "type": "string", + "description": "The name of the enterprise, e.g. \"Example Inc\"." + }, + "primaryDomain": { + "type": "string", + "description": "The enterprise's primary domain, e.g. \"example.com\".", + "annotations": { + "required": [ + "androidenterprise.enterprises.insert" + ] + } + } + } + }, + "EnterpriseAccount": { + "id": "EnterpriseAccount", + "type": "object", + "description": "A service account that can be used to authenticate as the enterprise to API calls that require such authentication.", + "properties": { + "accountEmail": { + "type": "string", + "description": "The email address of the service account." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#enterpriseAccount\".", + "default": "androidenterprise#enterpriseAccount" + } + } + }, + "EnterprisesListResponse": { + "id": "EnterprisesListResponse", + "type": "object", + "description": "The matching enterprise resources.", + "properties": { + "enterprise": { + "type": "array", + "description": "An enterprise.", + "items": { + "$ref": "Enterprise" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#enterprisesListResponse\".", + "default": "androidenterprise#enterprisesListResponse" + } + } + }, + "EnterprisesSendTestPushNotificationResponse": { + "id": "EnterprisesSendTestPushNotificationResponse", + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "The message ID of the test push notification that was sent." + }, + "topicName": { + "type": "string", + "description": "The name of the Cloud Pub/Sub topic to which notifications for this enterprise's enrolled account will be sent." + } + } + }, + "Entitlement": { + "id": "Entitlement", + "type": "object", + "description": "The existence of an entitlement resource means that a user has the right to use a particular app on any of their devices. This might be because the app is free or because they have been allocated a license to the app from a group license purchased by the enterprise.\n\nIt should always be true that a user has an app installed on one of their devices only if they have an entitlement to it. So if an entitlement is deleted, the app will be uninstalled from all devices. Similarly if the user installs an app (and is permitted to do so), or the MDM triggers an install of the app, an entitlement to that app is automatically created. If this is impossible - e.g. the enterprise has not purchased sufficient licenses - then installation fails.\n\nNote that entitlements are always user specific, not device specific; a user may have an entitlement even though they have not installed the app anywhere. Once they have an entitlement they can install the app on multiple devices.\n\nThe API can be used to create an entitlement. If the app is a free app, a group license for that app is created. If it's a paid app, creating the entitlement consumes one license; it remains consumed until the entitlement is removed. Optionally an installation of the app on all the user's managed devices can be triggered at the time the entitlement is created. An entitlement cannot be created for an app if the app requires permissions that the enterprise has not yet accepted.\n\nEntitlements for paid apps that are due to purchases by the user on a non-managed profile will have \"userPurchase\" as entitlement reason; those entitlements cannot be removed via the API.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#entitlement\".", + "default": "androidenterprise#entitlement" + }, + "productId": { + "type": "string", + "description": "The ID of the product that the entitlement is for, e.g. \"app:com.google.android.gm\"." + }, + "reason": { + "type": "string", + "description": "The reason for the entitlement, e.g. \"free\" for free apps. This is temporary, it will be replaced by the acquisition kind field of group licenses." + } + } + }, + "EntitlementsListResponse": { + "id": "EntitlementsListResponse", + "type": "object", + "description": "The entitlement resources for the user.", + "properties": { + "entitlement": { + "type": "array", + "description": "An entitlement of a user to a product (e.g. an app). For example, a free app that they have installed, or a paid app that they have been allocated a license to.", + "items": { + "$ref": "Entitlement" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#entitlementsListResponse\".", + "default": "androidenterprise#entitlementsListResponse" + } + } + }, + "GroupLicense": { + "id": "GroupLicense", + "type": "object", + "description": "A group license object indicates a product that an enterprise admin has approved for use in the enterprise. The product may be free or paid. For free products, a group license object is created in these cases: if the enterprise admin approves a product in Google Play, if the product is added to a collection, or if an entitlement for the product is created for a user via the API. For paid products, a group license object is only created as part of the first bulk purchase of that product in Google Play by the enterprise admin.\n\nThe API can be used to query group licenses; the available information includes the total number of licenses purchased (for paid products) and the total number of licenses that have been provisioned, that is, the total number of user entitlements in existence for the product.\n\nGroup license objects are never deleted. If, for example, a free app is added to a collection and then removed, the group license will remain, allowing the enterprise admin to keep track of any remaining entitlements. An enterprise admin may indicate they are no longer interested in the group license by marking it as unapproved in Google Play.", + "properties": { + "acquisitionKind": { + "type": "string", + "description": "How this group license was acquired. \"bulkPurchase\" means that this group license object was created because the enterprise purchased licenses for this product; this is \"free\" otherwise (for free products)." + }, + "approval": { + "type": "string", + "description": "Whether the product to which this group license relates is currently approved by the enterprise, as either \"approved\" or \"unapproved\". Products are approved when a group license is first created, but this approval may be revoked by an enterprise admin via Google Play. Unapproved products will not be visible to end users in collections and new entitlements to them should not normally be created." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#groupLicense\".", + "default": "androidenterprise#groupLicense" + }, + "numProvisioned": { + "type": "integer", + "description": "The total number of provisioned licenses for this product. Returned by read operations, but ignored in write operations.", + "format": "int32" + }, + "numPurchased": { + "type": "integer", + "description": "The number of purchased licenses (possibly in multiple purchases). If this field is omitted then there is no limit on the number of licenses that can be provisioned (e.g. if the acquisition kind is \"free\").", + "format": "int32" + }, + "productId": { + "type": "string", + "description": "The ID of the product that the license is for, e.g. \"app:com.google.android.gm\"." + } + } + }, + "GroupLicenseUsersListResponse": { + "id": "GroupLicenseUsersListResponse", + "type": "object", + "description": "The user resources for the group license.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#groupLicenseUsersListResponse\".", + "default": "androidenterprise#groupLicenseUsersListResponse" + }, + "user": { + "type": "array", + "description": "A user of an enterprise.", + "items": { + "$ref": "User" + } + } + } + }, + "GroupLicensesListResponse": { + "id": "GroupLicensesListResponse", + "type": "object", + "description": "The grouplicense resources for the enterprise.", + "properties": { + "groupLicense": { + "type": "array", + "description": "A group license for a product approved for use in the enterprise.", + "items": { + "$ref": "GroupLicense" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#groupLicensesListResponse\".", + "default": "androidenterprise#groupLicensesListResponse" + } + } + }, + "Install": { + "id": "Install", + "type": "object", + "description": "The existence of an install resource indicates that an app is installed on a particular device (or that an install is pending).\n\nThe API can be used to create an install resource using the update method. This triggers the actual install of the app on the device. If the user does not already have an entitlement for the app then an attempt is made to create one. If this fails (e.g. because the app is not free and there is no available license) then the creation of the install fails.\n\nThe API can also be used to update an installed app. If the update method is used on an existing install then the app will be updated to the latest available version.\n\nNote that it is not possible to force the installation of a specific version of an app; the version code is read-only.\n\nIf a user installs an app themselves (as permitted by the enterprise), then again an install resource and possibly an entitlement resource are automatically created.\n\nThe API can also be used to delete an install resource, which triggers the removal of the app from the device. Note that deleting an install does not automatically remove the corresponding entitlement, even if there are no remaining installs. The install resource will also be deleted if the user uninstalls the app themselves.", + "properties": { + "installState": { + "type": "string", + "description": "Install state. The state \"installPending\" means that an install request has recently been made and download to the device is in progress. The state \"installed\" means that the app has been installed. This field is read-only." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#install\".", + "default": "androidenterprise#install" + }, + "productId": { + "type": "string", + "description": "The ID of the product that the install is for, e.g. \"app:com.google.android.gm\"." + }, + "versionCode": { + "type": "integer", + "description": "The version of the installed product. Guaranteed to be set only if the install state is \"installed\".", + "format": "int32" + } + } + }, + "InstallsListResponse": { + "id": "InstallsListResponse", + "type": "object", + "description": "The install resources for the device.", + "properties": { + "install": { + "type": "array", + "description": "An installation of an app for a user on a specific device. The existence of an install implies that the user must have an entitlement to the app.", + "items": { + "$ref": "Install" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#installsListResponse\".", + "default": "androidenterprise#installsListResponse" + } + } + }, + "Permission": { + "id": "Permission", + "type": "object", + "description": "A permission represents some extra capability, to be granted to an Android app, which requires explicit consent. An enterprise admin must consent to these permissions on behalf of their users before an entitlement for the app can be created.\n\nThe permissions collection is read-only. The information provided for each permission (localized name and description) is intended to be used in the MDM user interface when obtaining consent from the enterprise.", + "properties": { + "description": { + "type": "string", + "description": "A longer description of the permissions giving more details of what it affects." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#permission\".", + "default": "androidenterprise#permission" + }, + "name": { + "type": "string", + "description": "The name of the permission." + }, + "permissionId": { + "type": "string", + "description": "An opaque string uniquely identifying the permission." + } + } + }, + "Product": { + "id": "Product", + "type": "object", + "description": "A product represents an app in the Google Play Store that is available to at least some users in the enterprise. (Some apps are restricted to a single enterprise, and no information about them is made available outside that enterprise.)\n\nThe information provided for each product (localized name, icon, link to the full Google Play details page) is intended to allow a basic representation of the product within an MDM user interface.", + "properties": { + "appVersion": { + "type": "array", + "description": "App versions currently available for this product. The returned list contains only public versions. Alpha and beta versions are not included.", + "items": { + "$ref": "AppVersion" + } + }, + "authorName": { + "type": "string", + "description": "The name of the author of the product (e.g. the app developer)." + }, + "detailsUrl": { + "type": "string", + "description": "A link to the (consumer) Google Play details page for the product." + }, + "distributionChannel": { + "type": "string", + "description": "How and to whom the package is made available. The value publicGoogleHosted means that the package is available through the Play Store and not restricted to a specific enterprise. The value privateGoogleHosted means that the package is a private app (restricted to an enterprise) but hosted by Google. The value privateSelfHosted means that the package is a private app (restricted to an enterprise) and is privately hosted." + }, + "iconUrl": { + "type": "string", + "description": "A link to an image that can be used as an icon for the product." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#product\".", + "default": "androidenterprise#product" + }, + "productId": { + "type": "string", + "description": "A string of the form app:\u003cpackage name\u003e. For example, app:com.google.android.gm represents the Gmail app." + }, + "requiresContainerApp": { + "type": "boolean", + "description": "Whether this app can only be installed on devices using the Android for Work container app." + }, + "title": { + "type": "string", + "description": "The name of the product." + }, + "workDetailsUrl": { + "type": "string", + "description": "A link to the Google Play for Work details page for the product, for use by an Enterprise administrator." + } + } + }, + "ProductPermission": { + "id": "ProductPermission", + "type": "object", + "description": "A product permissions resource represents the set of permissions required by a specific app and whether or not they have been accepted by an enterprise admin.\n\nThe API can be used to read the set of permissions, and also to update the set to indicate that permissions have been accepted.", + "properties": { + "permissionId": { + "type": "string", + "description": "An opaque string uniquely identifying the permission." + }, + "state": { + "type": "string", + "description": "Whether the permission has been accepted or not." + } + } + }, + "ProductPermissions": { + "id": "ProductPermissions", + "type": "object", + "description": "Information about the permissions required by a specific app and whether they have been accepted by the enterprise.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#productPermissions\".", + "default": "androidenterprise#productPermissions" + }, + "permission": { + "type": "array", + "description": "The permissions required by the app.", + "items": { + "$ref": "ProductPermission" + }, + "annotations": { + "required": [ + "androidenterprise.products.updatePermissions" + ] + } + }, + "productId": { + "type": "string", + "description": "The ID of the app that the permissions relate to, e.g. \"app:com.google.android.gm\"." + } + } + }, + "ProductSet": { + "id": "ProductSet", + "type": "object", + "description": "A set of products.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#productSet\".", + "default": "androidenterprise#productSet" + }, + "productId": { + "type": "array", + "description": "The list of product IDs making up the set of products.", + "items": { + "type": "string" + } + } + } + }, + "ProductsApproveRequest": { + "id": "ProductsApproveRequest", + "type": "object", + "properties": { + "approvalUrlInfo": { + "$ref": "ApprovalUrlInfo", + "description": "The approval URL that was shown to the user. Only the permissions shown to the user with that URL will be accepted, which may not be the product's entire set of permissions. For example, the URL may only display new permissions from an update after the product was approved, or not include new permissions if the product was updated since the URL was generated." + } + } + }, + "ProductsGenerateApprovalUrlResponse": { + "id": "ProductsGenerateApprovalUrlResponse", + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "A URL that can be rendered in an iframe to display the permissions (if any) of a product. This URL can be used to approve the product only once and only within 24 hours of being generated, using the Products.approve call. If the product is currently unapproved and has no permissions, this URL will point to an empty page. If the product is currently approved, a URL will only be generated if that product has added permissions since it was last approved, and the URL will only display those new permissions that have not yet been accepted." + } + } + }, + "User": { + "id": "User", + "type": "object", + "description": "A user resource represents an individual user within the enterprise's domain.\n\nNote that each user is associated with a Google account based on the user's corporate email address (which must be in one of the enterprise's domains). As part of installing an MDM app to manage a device the Google account must be provisioned to the device, and so the user resource must be created before that. This can be done using the Google Admin SDK Directory API.\n\nThe ID for a user is an opaque string. It can be retrieved using the list method queried by the user's primary email address.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID for the user." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#user\".", + "default": "androidenterprise#user" + }, + "primaryEmail": { + "type": "string", + "description": "The user's primary email, e.g. \"jsmith@example.com\"." + } + } + }, + "UserToken": { + "id": "UserToken", + "type": "object", + "description": "A UserToken is used by a user when setting up a managed device or profile with their work account on a device. When the user enters their email address and token (activation code) the appropriate MDM app can be automatically downloaded.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#userToken\".", + "default": "androidenterprise#userToken" + }, + "token": { + "type": "string", + "description": "The token (activation code) to be entered by the user. This consists of a sequence of decimal digits. Note that the leading digit may be 0." + }, + "userId": { + "type": "string", + "description": "The unique ID for the user." + } + } + }, + "UsersListResponse": { + "id": "UsersListResponse", + "type": "object", + "description": "The matching user resources.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidenterprise#usersListResponse\".", + "default": "androidenterprise#usersListResponse" + }, + "user": { + "type": "array", + "description": "A user of an enterprise.", + "items": { + "$ref": "User" + } + } + } + } + }, + "resources": { + "collections": { + "methods": { + "delete": { + "id": "androidenterprise.collections.delete", + "path": "enterprises/{enterpriseId}/collections/{collectionId}", + "httpMethod": "DELETE", + "description": "Deletes a collection.", + "parameters": { + "collectionId": { + "type": "string", + "description": "The ID of the collection.", + "required": true, + "location": "path" + }, + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "collectionId" + ], + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "get": { + "id": "androidenterprise.collections.get", + "path": "enterprises/{enterpriseId}/collections/{collectionId}", + "httpMethod": "GET", + "description": "Retrieves the details of a collection.", + "parameters": { + "collectionId": { + "type": "string", + "description": "The ID of the collection.", + "required": true, + "location": "path" + }, + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "collectionId" + ], + "response": { + "$ref": "Collection" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "insert": { + "id": "androidenterprise.collections.insert", + "path": "enterprises/{enterpriseId}/collections", + "httpMethod": "POST", + "description": "Creates a new collection.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId" + ], + "request": { + "$ref": "Collection" + }, + "response": { + "$ref": "Collection" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "list": { + "id": "androidenterprise.collections.list", + "path": "enterprises/{enterpriseId}/collections", + "httpMethod": "GET", + "description": "Retrieves the IDs of all the collections for an enterprise.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId" + ], + "response": { + "$ref": "CollectionsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "patch": { + "id": "androidenterprise.collections.patch", + "path": "enterprises/{enterpriseId}/collections/{collectionId}", + "httpMethod": "PATCH", + "description": "Updates a collection. This method supports patch semantics.", + "parameters": { + "collectionId": { + "type": "string", + "description": "The ID of the collection.", + "required": true, + "location": "path" + }, + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "collectionId" + ], + "request": { + "$ref": "Collection" + }, + "response": { + "$ref": "Collection" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "update": { + "id": "androidenterprise.collections.update", + "path": "enterprises/{enterpriseId}/collections/{collectionId}", + "httpMethod": "PUT", + "description": "Updates a collection.", + "parameters": { + "collectionId": { + "type": "string", + "description": "The ID of the collection.", + "required": true, + "location": "path" + }, + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "collectionId" + ], + "request": { + "$ref": "Collection" + }, + "response": { + "$ref": "Collection" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + } + } + }, + "collectionviewers": { + "methods": { + "delete": { + "id": "androidenterprise.collectionviewers.delete", + "path": "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}", + "httpMethod": "DELETE", + "description": "Removes the user from the list of those specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only such users will see the collection.", + "parameters": { + "collectionId": { + "type": "string", + "description": "The ID of the collection.", + "required": true, + "location": "path" + }, + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "collectionId", + "userId" + ], + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "get": { + "id": "androidenterprise.collectionviewers.get", + "path": "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}", + "httpMethod": "GET", + "description": "Retrieves the ID of the user if they have been specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only these users will see the collection.", + "parameters": { + "collectionId": { + "type": "string", + "description": "The ID of the collection.", + "required": true, + "location": "path" + }, + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "collectionId", + "userId" + ], + "response": { + "$ref": "User" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "list": { + "id": "androidenterprise.collectionviewers.list", + "path": "enterprises/{enterpriseId}/collections/{collectionId}/users", + "httpMethod": "GET", + "description": "Retrieves the IDs of the users who have been specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only these users will see the collection.", + "parameters": { + "collectionId": { + "type": "string", + "description": "The ID of the collection.", + "required": true, + "location": "path" + }, + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "collectionId" + ], + "response": { + "$ref": "CollectionViewersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "patch": { + "id": "androidenterprise.collectionviewers.patch", + "path": "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}", + "httpMethod": "PATCH", + "description": "Adds the user to the list of those specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only such users will see the collection. This method supports patch semantics.", + "parameters": { + "collectionId": { + "type": "string", + "description": "The ID of the collection.", + "required": true, + "location": "path" + }, + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "collectionId", + "userId" + ], + "request": { + "$ref": "User" + }, + "response": { + "$ref": "User" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "update": { + "id": "androidenterprise.collectionviewers.update", + "path": "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}", + "httpMethod": "PUT", + "description": "Adds the user to the list of those specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only such users will see the collection.", + "parameters": { + "collectionId": { + "type": "string", + "description": "The ID of the collection.", + "required": true, + "location": "path" + }, + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "collectionId", + "userId" + ], + "request": { + "$ref": "User" + }, + "response": { + "$ref": "User" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + } + } + }, + "devices": { + "methods": { + "get": { + "id": "androidenterprise.devices.get", + "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}", + "httpMethod": "GET", + "description": "Retrieves the details of a device.", + "parameters": { + "deviceId": { + "type": "string", + "description": "The ID of the device.", + "required": true, + "location": "path" + }, + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "userId", + "deviceId" + ], + "response": { + "$ref": "Device" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "getState": { + "id": "androidenterprise.devices.getState", + "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state", + "httpMethod": "GET", + "description": "Retrieves whether a device is enabled or disabled for access by the user to Google services. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services.", + "parameters": { + "deviceId": { + "type": "string", + "description": "The ID of the device.", + "required": true, + "location": "path" + }, + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "userId", + "deviceId" + ], + "response": { + "$ref": "DeviceState" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "list": { + "id": "androidenterprise.devices.list", + "path": "enterprises/{enterpriseId}/users/{userId}/devices", + "httpMethod": "GET", + "description": "Retrieves the IDs of all of a user's devices.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "userId" + ], + "response": { + "$ref": "DevicesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "setState": { + "id": "androidenterprise.devices.setState", + "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state", + "httpMethod": "PUT", + "description": "Sets whether a device is enabled or disabled for access by the user to Google services. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services.", + "parameters": { + "deviceId": { + "type": "string", + "description": "The ID of the device.", + "required": true, + "location": "path" + }, + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "userId", + "deviceId" + ], + "request": { + "$ref": "DeviceState" + }, + "response": { + "$ref": "DeviceState" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + } + } + }, + "enterprises": { + "methods": { + "delete": { + "id": "androidenterprise.enterprises.delete", + "path": "enterprises/{enterpriseId}", + "httpMethod": "DELETE", + "description": "Deletes the binding between the MDM and enterprise. This is now deprecated; use this to unenroll customers that were previously enrolled with the 'insert' call, then enroll them again with the 'enroll' call.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId" + ], + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "enroll": { + "id": "androidenterprise.enterprises.enroll", + "path": "enterprises/enroll", + "httpMethod": "POST", + "description": "Enrolls an enterprise with the calling MDM.", + "parameters": { + "token": { + "type": "string", + "description": "The token provided by the enterprise to register the MDM.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "token" + ], + "request": { + "$ref": "Enterprise" + }, + "response": { + "$ref": "Enterprise" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "get": { + "id": "androidenterprise.enterprises.get", + "path": "enterprises/{enterpriseId}", + "httpMethod": "GET", + "description": "Retrieves the name and domain of an enterprise.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId" + ], + "response": { + "$ref": "Enterprise" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "insert": { + "id": "androidenterprise.enterprises.insert", + "path": "enterprises", + "httpMethod": "POST", + "description": "Establishes the binding between the MDM and an enterprise. This is now deprecated; use enroll instead.", + "parameters": { + "token": { + "type": "string", + "description": "The token provided by the enterprise to register the MDM.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "token" + ], + "request": { + "$ref": "Enterprise" + }, + "response": { + "$ref": "Enterprise" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "list": { + "id": "androidenterprise.enterprises.list", + "path": "enterprises", + "httpMethod": "GET", + "description": "Looks up an enterprise by domain name.", + "parameters": { + "domain": { + "type": "string", + "description": "The exact primary domain name of the enterprise to look up.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "domain" + ], + "response": { + "$ref": "EnterprisesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "sendTestPushNotification": { + "id": "androidenterprise.enterprises.sendTestPushNotification", + "path": "enterprises/{enterpriseId}/sendTestPushNotification", + "httpMethod": "POST", + "description": "Sends a test push notification to validate the MDM integration with the Google Cloud Pub/Sub service for this enterprise.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId" + ], + "response": { + "$ref": "EnterprisesSendTestPushNotificationResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "setAccount": { + "id": "androidenterprise.enterprises.setAccount", + "path": "enterprises/{enterpriseId}/account", + "httpMethod": "PUT", + "description": "Set the account that will be used to authenticate to the API as the enterprise.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId" + ], + "request": { + "$ref": "EnterpriseAccount" + }, + "response": { + "$ref": "EnterpriseAccount" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "unenroll": { + "id": "androidenterprise.enterprises.unenroll", + "path": "enterprises/{enterpriseId}/unenroll", + "httpMethod": "POST", + "description": "Unenrolls an enterprise from the calling MDM.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId" + ], + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + } + } + }, + "entitlements": { + "methods": { + "delete": { + "id": "androidenterprise.entitlements.delete", + "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}", + "httpMethod": "DELETE", + "description": "Removes an entitlement to an app for a user and uninstalls it.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "entitlementId": { + "type": "string", + "description": "The ID of the entitlement, e.g. \"app:com.google.android.gm\".", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "userId", + "entitlementId" + ], + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "get": { + "id": "androidenterprise.entitlements.get", + "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}", + "httpMethod": "GET", + "description": "Retrieves details of an entitlement.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "entitlementId": { + "type": "string", + "description": "The ID of the entitlement, e.g. \"app:com.google.android.gm\".", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "userId", + "entitlementId" + ], + "response": { + "$ref": "Entitlement" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "list": { + "id": "androidenterprise.entitlements.list", + "path": "enterprises/{enterpriseId}/users/{userId}/entitlements", + "httpMethod": "GET", + "description": "List of all entitlements for the specified user. Only the ID is set.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "userId" + ], + "response": { + "$ref": "EntitlementsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "patch": { + "id": "androidenterprise.entitlements.patch", + "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}", + "httpMethod": "PATCH", + "description": "Adds or updates an entitlement to an app for a user. This method supports patch semantics.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "entitlementId": { + "type": "string", + "description": "The ID of the entitlement, e.g. \"app:com.google.android.gm\".", + "required": true, + "location": "path" + }, + "install": { + "type": "boolean", + "description": "Set to true to also install the product on all the user's devices where possible. Failure to install on one or more devices will not prevent this operation from returning successfully, as long as the entitlement was successfully assigned to the user.", + "location": "query" + }, + "userId": { + "type": "string", + "description": "The ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "userId", + "entitlementId" + ], + "request": { + "$ref": "Entitlement" + }, + "response": { + "$ref": "Entitlement" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "update": { + "id": "androidenterprise.entitlements.update", + "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}", + "httpMethod": "PUT", + "description": "Adds or updates an entitlement to an app for a user.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "entitlementId": { + "type": "string", + "description": "The ID of the entitlement, e.g. \"app:com.google.android.gm\".", + "required": true, + "location": "path" + }, + "install": { + "type": "boolean", + "description": "Set to true to also install the product on all the user's devices where possible. Failure to install on one or more devices will not prevent this operation from returning successfully, as long as the entitlement was successfully assigned to the user.", + "location": "query" + }, + "userId": { + "type": "string", + "description": "The ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "userId", + "entitlementId" + ], + "request": { + "$ref": "Entitlement" + }, + "response": { + "$ref": "Entitlement" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + } + } + }, + "grouplicenses": { + "methods": { + "get": { + "id": "androidenterprise.grouplicenses.get", + "path": "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}", + "httpMethod": "GET", + "description": "Retrieves details of an enterprise's group license for a product.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "groupLicenseId": { + "type": "string", + "description": "The ID of the product the group license is for, e.g. \"app:com.google.android.gm\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "groupLicenseId" + ], + "response": { + "$ref": "GroupLicense" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "list": { + "id": "androidenterprise.grouplicenses.list", + "path": "enterprises/{enterpriseId}/groupLicenses", + "httpMethod": "GET", + "description": "Retrieves IDs of all products for which the enterprise has a group license.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId" + ], + "response": { + "$ref": "GroupLicensesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + } + } + }, + "grouplicenseusers": { + "methods": { + "list": { + "id": "androidenterprise.grouplicenseusers.list", + "path": "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}/users", + "httpMethod": "GET", + "description": "Retrieves the IDs of the users who have been granted entitlements under the license.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "groupLicenseId": { + "type": "string", + "description": "The ID of the product the group license is for, e.g. \"app:com.google.android.gm\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "groupLicenseId" + ], + "response": { + "$ref": "GroupLicenseUsersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + } + } + }, + "installs": { + "methods": { + "delete": { + "id": "androidenterprise.installs.delete", + "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}", + "httpMethod": "DELETE", + "description": "Requests to remove an app from a device. A call to get or list will still show the app as installed on the device until it is actually removed.", + "parameters": { + "deviceId": { + "type": "string", + "description": "The Android ID of the device.", + "required": true, + "location": "path" + }, + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "installId": { + "type": "string", + "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "userId", + "deviceId", + "installId" + ], + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "get": { + "id": "androidenterprise.installs.get", + "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}", + "httpMethod": "GET", + "description": "Retrieves details of an installation of an app on a device.", + "parameters": { + "deviceId": { + "type": "string", + "description": "The Android ID of the device.", + "required": true, + "location": "path" + }, + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "installId": { + "type": "string", + "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "userId", + "deviceId", + "installId" + ], + "response": { + "$ref": "Install" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "list": { + "id": "androidenterprise.installs.list", + "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs", + "httpMethod": "GET", + "description": "Retrieves the details of all apps installed on the specified device.", + "parameters": { + "deviceId": { + "type": "string", + "description": "The Android ID of the device.", + "required": true, + "location": "path" + }, + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "userId", + "deviceId" + ], + "response": { + "$ref": "InstallsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "patch": { + "id": "androidenterprise.installs.patch", + "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}", + "httpMethod": "PATCH", + "description": "Requests to install the latest version of an app to a device. If the app is already installed then it is updated to the latest version if necessary. This method supports patch semantics.", + "parameters": { + "deviceId": { + "type": "string", + "description": "The Android ID of the device.", + "required": true, + "location": "path" + }, + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "installId": { + "type": "string", + "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "userId", + "deviceId", + "installId" + ], + "request": { + "$ref": "Install" + }, + "response": { + "$ref": "Install" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "update": { + "id": "androidenterprise.installs.update", + "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}", + "httpMethod": "PUT", + "description": "Requests to install the latest version of an app to a device. If the app is already installed then it is updated to the latest version if necessary.", + "parameters": { + "deviceId": { + "type": "string", + "description": "The Android ID of the device.", + "required": true, + "location": "path" + }, + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "installId": { + "type": "string", + "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "userId", + "deviceId", + "installId" + ], + "request": { + "$ref": "Install" + }, + "response": { + "$ref": "Install" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + } + } + }, + "permissions": { + "methods": { + "get": { + "id": "androidenterprise.permissions.get", + "path": "permissions/{permissionId}", + "httpMethod": "GET", + "description": "Retrieves details of an Android app permission for display to an enterprise admin.", + "parameters": { + "language": { + "type": "string", + "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\")", + "location": "query" + }, + "permissionId": { + "type": "string", + "description": "The ID of the permission.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "permissionId" + ], + "response": { + "$ref": "Permission" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + } + } + }, + "products": { + "methods": { + "approve": { + "id": "androidenterprise.products.approve", + "path": "enterprises/{enterpriseId}/products/{productId}/approve", + "httpMethod": "POST", + "description": "Approves the specified product (and the relevant app permissions, if any).", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "productId": { + "type": "string", + "description": "The ID of the product.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "productId" + ], + "request": { + "$ref": "ProductsApproveRequest" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "generateApprovalUrl": { + "id": "androidenterprise.products.generateApprovalUrl", + "path": "enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl", + "httpMethod": "POST", + "description": "Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and accept them on behalf of their organization in order to approve that product.\n\nAdmins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display permissions for up to 1 day.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "languageCode": { + "type": "string", + "description": "The BCP 47 language code used for permission names and descriptions in the returned iframe, for instance \"en-US\".", + "location": "query" + }, + "productId": { + "type": "string", + "description": "The ID of the product.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "productId" + ], + "response": { + "$ref": "ProductsGenerateApprovalUrlResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "get": { + "id": "androidenterprise.products.get", + "path": "enterprises/{enterpriseId}/products/{productId}", + "httpMethod": "GET", + "description": "Retrieves details of a product for display to an enterprise admin.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "language": { + "type": "string", + "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\").", + "location": "query" + }, + "productId": { + "type": "string", + "description": "The ID of the product, e.g. \"app:com.google.android.gm\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "productId" + ], + "response": { + "$ref": "Product" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "getAppRestrictionsSchema": { + "id": "androidenterprise.products.getAppRestrictionsSchema", + "path": "enterprises/{enterpriseId}/products/{productId}/appRestrictionsSchema", + "httpMethod": "GET", + "description": "Retrieves the schema defining app restrictions configurable for this product. All products have a schema, but this may be empty if no app restrictions are defined.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "language": { + "type": "string", + "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\").", + "location": "query" + }, + "productId": { + "type": "string", + "description": "The ID of the product.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "productId" + ], + "response": { + "$ref": "AppRestrictionsSchema" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "getPermissions": { + "id": "androidenterprise.products.getPermissions", + "path": "enterprises/{enterpriseId}/products/{productId}/permissions", + "httpMethod": "GET", + "description": "Retrieves the Android app permissions required by this app.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "productId": { + "type": "string", + "description": "The ID of the product.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "productId" + ], + "response": { + "$ref": "ProductPermissions" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "updatePermissions": { + "id": "androidenterprise.products.updatePermissions", + "path": "enterprises/{enterpriseId}/products/{productId}/permissions", + "httpMethod": "PUT", + "description": "Updates the set of Android app permissions for this app that have been accepted by the enterprise.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "productId": { + "type": "string", + "description": "The ID of the product.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "productId" + ], + "request": { + "$ref": "ProductPermissions" + }, + "response": { + "$ref": "ProductPermissions" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + } + } + }, + "users": { + "methods": { + "generateToken": { + "id": "androidenterprise.users.generateToken", + "path": "enterprises/{enterpriseId}/users/{userId}/token", + "httpMethod": "POST", + "description": "Generates a token (activation code) to allow this user to configure their work account in the Android Setup Wizard. Revokes any previously generated token.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "userId" + ], + "response": { + "$ref": "UserToken" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "get": { + "id": "androidenterprise.users.get", + "path": "enterprises/{enterpriseId}/users/{userId}", + "httpMethod": "GET", + "description": "Retrieves a user's details.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "userId" + ], + "response": { + "$ref": "User" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "getAvailableProductSet": { + "id": "androidenterprise.users.getAvailableProductSet", + "path": "enterprises/{enterpriseId}/users/{userId}/availableProductSet", + "httpMethod": "GET", + "description": "Retrieves the set of products a user is entitled to access.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "userId" + ], + "response": { + "$ref": "ProductSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "list": { + "id": "androidenterprise.users.list", + "path": "enterprises/{enterpriseId}/users", + "httpMethod": "GET", + "description": "Looks up a user by email address.", + "parameters": { + "email": { + "type": "string", + "description": "The exact primary email address of the user to look up.", + "required": true, + "location": "query" + }, + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "email" + ], + "response": { + "$ref": "UsersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "revokeToken": { + "id": "androidenterprise.users.revokeToken", + "path": "enterprises/{enterpriseId}/users/{userId}/token", + "httpMethod": "DELETE", + "description": "Revokes a previously generated token (activation code) for the user.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "userId" + ], + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + }, + "setAvailableProductSet": { + "id": "androidenterprise.users.setAvailableProductSet", + "path": "enterprises/{enterpriseId}/users/{userId}/availableProductSet", + "httpMethod": "PUT", + "description": "Modifies the set of products a user is entitled to access.", + "parameters": { + "enterpriseId": { + "type": "string", + "description": "The ID of the enterprise.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The ID of the user.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "enterpriseId", + "userId" + ], + "request": { + "$ref": "ProductSet" + }, + "response": { + "$ref": "ProductSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidenterprise" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/androidenterprise/v1/androidenterprise-gen.go b/Godeps/_workspace/src/google.golang.org/api/androidenterprise/v1/androidenterprise-gen.go new file mode 100644 index 000000000..e2d8664d8 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/androidenterprise/v1/androidenterprise-gen.go @@ -0,0 +1,7947 @@ +// Package androidenterprise provides access to the Google Play EMM API. +// +// See https://developers.google.com/play/enterprise +// +// Usage example: +// +// import "google.golang.org/api/androidenterprise/v1" +// ... +// androidenterpriseService, err := androidenterprise.New(oauthHttpClient) +package androidenterprise // import "google.golang.org/api/androidenterprise/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "androidenterprise:v1" +const apiName = "androidenterprise" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/androidenterprise/v1/" + +// OAuth2 scopes used by this API. +const ( + // Manage corporate Android devices + AndroidenterpriseScope = "https://www.googleapis.com/auth/androidenterprise" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Collections = NewCollectionsService(s) + s.Collectionviewers = NewCollectionviewersService(s) + s.Devices = NewDevicesService(s) + s.Enterprises = NewEnterprisesService(s) + s.Entitlements = NewEntitlementsService(s) + s.Grouplicenses = NewGrouplicensesService(s) + s.Grouplicenseusers = NewGrouplicenseusersService(s) + s.Installs = NewInstallsService(s) + s.Permissions = NewPermissionsService(s) + s.Products = NewProductsService(s) + s.Users = NewUsersService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Collections *CollectionsService + + Collectionviewers *CollectionviewersService + + Devices *DevicesService + + Enterprises *EnterprisesService + + Entitlements *EntitlementsService + + Grouplicenses *GrouplicensesService + + Grouplicenseusers *GrouplicenseusersService + + Installs *InstallsService + + Permissions *PermissionsService + + Products *ProductsService + + Users *UsersService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewCollectionsService(s *Service) *CollectionsService { + rs := &CollectionsService{s: s} + return rs +} + +type CollectionsService struct { + s *Service +} + +func NewCollectionviewersService(s *Service) *CollectionviewersService { + rs := &CollectionviewersService{s: s} + return rs +} + +type CollectionviewersService struct { + s *Service +} + +func NewDevicesService(s *Service) *DevicesService { + rs := &DevicesService{s: s} + return rs +} + +type DevicesService struct { + s *Service +} + +func NewEnterprisesService(s *Service) *EnterprisesService { + rs := &EnterprisesService{s: s} + return rs +} + +type EnterprisesService struct { + s *Service +} + +func NewEntitlementsService(s *Service) *EntitlementsService { + rs := &EntitlementsService{s: s} + return rs +} + +type EntitlementsService struct { + s *Service +} + +func NewGrouplicensesService(s *Service) *GrouplicensesService { + rs := &GrouplicensesService{s: s} + return rs +} + +type GrouplicensesService struct { + s *Service +} + +func NewGrouplicenseusersService(s *Service) *GrouplicenseusersService { + rs := &GrouplicenseusersService{s: s} + return rs +} + +type GrouplicenseusersService struct { + s *Service +} + +func NewInstallsService(s *Service) *InstallsService { + rs := &InstallsService{s: s} + return rs +} + +type InstallsService struct { + s *Service +} + +func NewPermissionsService(s *Service) *PermissionsService { + rs := &PermissionsService{s: s} + return rs +} + +type PermissionsService struct { + s *Service +} + +func NewProductsService(s *Service) *ProductsService { + rs := &ProductsService{s: s} + return rs +} + +type ProductsService struct { + s *Service +} + +func NewUsersService(s *Service) *UsersService { + rs := &UsersService{s: s} + return rs +} + +type UsersService struct { + s *Service +} + +// AppRestrictionsSchema: Represents the list of app restrictions +// available to be pre-configured for the product. +type AppRestrictionsSchema struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidenterprise#appRestrictionsSchema". + Kind string `json:"kind,omitempty"` + + // Restrictions: The set of restrictions that make up this schema. + Restrictions []*AppRestrictionsSchemaRestriction `json:"restrictions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AppRestrictionsSchema) MarshalJSON() ([]byte, error) { + type noMethod AppRestrictionsSchema + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AppRestrictionsSchemaRestriction: A restriction in the App +// Restriction Schema represents a piece of configuration that may be +// pre-applied. +type AppRestrictionsSchemaRestriction struct { + // DefaultValue: The default value of the restriction. + DefaultValue *AppRestrictionsSchemaRestrictionRestrictionValue `json:"defaultValue,omitempty"` + + // Description: A longer description of the restriction, giving more + // detail of what it affects. + Description string `json:"description,omitempty"` + + // Entry: For choice or multiselect restrictions, the list of possible + // entries' human-readable names. + Entry []string `json:"entry,omitempty"` + + // EntryValue: For choice or multiselect restrictions, the list of + // possible entries' machine-readable values. + EntryValue []string `json:"entryValue,omitempty"` + + // Key: The unique key that the product uses to identify the + // restriction, e.g. "com.google.android.gm.fieldname". + Key string `json:"key,omitempty"` + + // RestrictionType: The type of the restriction. + RestrictionType string `json:"restrictionType,omitempty"` + + // Title: The name of the restriction. + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DefaultValue") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AppRestrictionsSchemaRestriction) MarshalJSON() ([]byte, error) { + type noMethod AppRestrictionsSchemaRestriction + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AppRestrictionsSchemaRestrictionRestrictionValue: A typed value for +// the restriction. +type AppRestrictionsSchemaRestrictionRestrictionValue struct { + // Type: The type of the value being provided. + Type string `json:"type,omitempty"` + + // ValueBool: The boolean value - this will only be present if type is + // bool. + ValueBool bool `json:"valueBool,omitempty"` + + // ValueInteger: The integer value - this will only be present if type + // is integer. + ValueInteger int64 `json:"valueInteger,omitempty"` + + // ValueMultiselect: The list of string values - this will only be + // present if type is multiselect. + ValueMultiselect []string `json:"valueMultiselect,omitempty"` + + // ValueString: The string value - this will be present for types + // string, choice and hidden. + ValueString string `json:"valueString,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Type") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AppRestrictionsSchemaRestrictionRestrictionValue) MarshalJSON() ([]byte, error) { + type noMethod AppRestrictionsSchemaRestrictionRestrictionValue + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AppVersion: This represents a single version of the app. +type AppVersion struct { + // VersionCode: Unique increasing identifier for the app version. + VersionCode int64 `json:"versionCode,omitempty"` + + // VersionString: The string used in the Play Store by the app developer + // to identify the version. The string is not necessarily unique or + // localized (for example, the string could be "1.4"). + VersionString string `json:"versionString,omitempty"` + + // ForceSendFields is a list of field names (e.g. "VersionCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AppVersion) MarshalJSON() ([]byte, error) { + type noMethod AppVersion + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ApprovalUrlInfo: Information on an approval URL. +type ApprovalUrlInfo struct { + // ApprovalUrl: A URL that displays a product's permissions and that can + // also be used to approve the product with the Products.approve call. + ApprovalUrl string `json:"approvalUrl,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidenterprise#approvalUrlInfo". + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ApprovalUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ApprovalUrlInfo) MarshalJSON() ([]byte, error) { + type noMethod ApprovalUrlInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Collection: A collection resource defines a named set of apps that is +// visible to a set of users in the Google Play Store app running on +// those users' managed devices. Those users can then install any of +// those apps if they wish (which will trigger creation of install and +// entitlement resources). A user cannot install an app on a managed +// device unless the app is listed in at least one collection that is +// visible to that user. +// +// Note that the API can be used to directly install an app regardless +// of whether it is in any collection - so an enterprise has a choice of +// either directly pushing apps to users, or allowing users to install +// apps if they want. Which is appropriate will depend on the +// enterprise's policies and the purpose of the apps concerned. +type Collection struct { + // CollectionId: Arbitrary unique ID, allocated by the API on creation. + CollectionId string `json:"collectionId,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidenterprise#collection". + Kind string `json:"kind,omitempty"` + + // Name: A user-friendly name for the collection (should be unique), + // e.g. "Accounting apps". + Name string `json:"name,omitempty"` + + // ProductId: The IDs of the products in the collection, in the order in + // which they should be displayed. + ProductId []string `json:"productId,omitempty"` + + // Visibility: Whether this collection is visible to all users, or only + // to the users that have been granted access through the + // "Collectionviewers" API. With the launch of the + // "setAvailableProductSet" API, this property should always be set to + // "viewersOnly", as the "allUsers" option will bypass the + // "availableProductSet" for all users within a domain. + // + // The "allUsers" setting is deprecated, and will be removed. + Visibility string `json:"visibility,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CollectionId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Collection) MarshalJSON() ([]byte, error) { + type noMethod Collection + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CollectionViewersListResponse: The user resources for the collection. +type CollectionViewersListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidenterprise#collectionViewersListResponse". + Kind string `json:"kind,omitempty"` + + // User: A user of an enterprise. + User []*User `json:"user,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CollectionViewersListResponse) MarshalJSON() ([]byte, error) { + type noMethod CollectionViewersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CollectionsListResponse: The collection resources for the enterprise. +type CollectionsListResponse struct { + // Collection: An ordered collection of products which can be made + // visible on the Google Play Store to a selected group of users. + Collection []*Collection `json:"collection,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidenterprise#collectionsListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Collection") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CollectionsListResponse) MarshalJSON() ([]byte, error) { + type noMethod CollectionsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Device: A device resource represents a mobile device managed by the +// MDM and belonging to a specific enterprise user. +// +// This collection cannot be modified via the API; it is automatically +// populated as devices are set up to be managed. +type Device struct { + // AndroidId: The Google Play Services Android ID for the device encoded + // as a lowercase hex string, e.g. "123456789abcdef0". + AndroidId string `json:"androidId,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidenterprise#device". + Kind string `json:"kind,omitempty"` + + // ManagementType: The mechanism by which this device is managed by the + // MDM. "managedDevice" means that the MDM's app is a device owner. + // "managedProfile" means that the MDM's app is the profile owner (and + // there is a separate personal profile which is not managed). + // "containerApp" means that the MDM's app is managing the Android for + // Work container app on the device. + ManagementType string `json:"managementType,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AndroidId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Device) MarshalJSON() ([]byte, error) { + type noMethod Device + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DeviceState: The state of a user's device, as accessed by the +// getState and setState methods on device resources. +type DeviceState struct { + // AccountState: The state of the Google account on the device. + // "enabled" indicates that the Google account on the device can be used + // to access Google services (including Google Play), while "disabled" + // means that it cannot. A new device is initially in the "disabled" + // state. + AccountState string `json:"accountState,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidenterprise#deviceState". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountState") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeviceState) MarshalJSON() ([]byte, error) { + type noMethod DeviceState + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DevicesListResponse: The device resources for the user. +type DevicesListResponse struct { + // Device: A managed device. + Device []*Device `json:"device,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidenterprise#devicesListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Device") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DevicesListResponse) MarshalJSON() ([]byte, error) { + type noMethod DevicesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Enterprise: An enterprise resource represents a binding between an +// organisation and their MDM. +// +// To create an enterprise, an admin of the enterprise must first go +// through a Play for Work sign-up flow. At the end of this the admin +// will be presented with a token (a short opaque alphanumeric string). +// They must then present this to the MDM, who then supplies it to the +// enroll method. Until this is done the MDM will not have any access to +// the enterprise. +// +// After calling enroll the MDM should call setAccount to specify the +// service account that will be allowed to act on behalf of the +// enterprise, which will be required for access to the enterprise's +// data through this API. Only one call of setAccount is allowed for a +// given enterprise; the only way to change the account later is to +// unenroll the enterprise and enroll it again (obtaining a new +// token). +// +// The MDM can unenroll an enterprise in order to sever the binding +// between them. Re-enrolling an enterprise is possible, but requires a +// new token to be retrieved. Enterprises.unenroll requires the MDM's +// credentials (as enroll does), not the enterprise's. +// Enterprises.unenroll can only be used for enterprises that were +// previously enrolled with the enroll call. Any enterprises that were +// enrolled using the (deprecated) Enterprises.insert call must be +// unenrolled with Enterprises.delete and can then be re-enrolled using +// the Enterprises.enroll call. +// +// The ID for an enterprise is an opaque string. It is returned by +// insert and enroll and can also be retrieved if the enterprise's +// primary domain is known using the list method. +type Enterprise struct { + // Id: The unique ID for the enterprise. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidenterprise#enterprise". + Kind string `json:"kind,omitempty"` + + // Name: The name of the enterprise, e.g. "Example Inc". + Name string `json:"name,omitempty"` + + // PrimaryDomain: The enterprise's primary domain, e.g. "example.com". + PrimaryDomain string `json:"primaryDomain,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Enterprise) MarshalJSON() ([]byte, error) { + type noMethod Enterprise + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EnterpriseAccount: A service account that can be used to authenticate +// as the enterprise to API calls that require such authentication. +type EnterpriseAccount struct { + // AccountEmail: The email address of the service account. + AccountEmail string `json:"accountEmail,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidenterprise#enterpriseAccount". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountEmail") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EnterpriseAccount) MarshalJSON() ([]byte, error) { + type noMethod EnterpriseAccount + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EnterprisesListResponse: The matching enterprise resources. +type EnterprisesListResponse struct { + // Enterprise: An enterprise. + Enterprise []*Enterprise `json:"enterprise,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidenterprise#enterprisesListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Enterprise") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EnterprisesListResponse) MarshalJSON() ([]byte, error) { + type noMethod EnterprisesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type EnterprisesSendTestPushNotificationResponse struct { + // MessageId: The message ID of the test push notification that was + // sent. + MessageId string `json:"messageId,omitempty"` + + // TopicName: The name of the Cloud Pub/Sub topic to which notifications + // for this enterprise's enrolled account will be sent. + TopicName string `json:"topicName,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "MessageId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EnterprisesSendTestPushNotificationResponse) MarshalJSON() ([]byte, error) { + type noMethod EnterprisesSendTestPushNotificationResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Entitlement: The existence of an entitlement resource means that a +// user has the right to use a particular app on any of their devices. +// This might be because the app is free or because they have been +// allocated a license to the app from a group license purchased by the +// enterprise. +// +// It should always be true that a user has an app installed on one of +// their devices only if they have an entitlement to it. So if an +// entitlement is deleted, the app will be uninstalled from all devices. +// Similarly if the user installs an app (and is permitted to do so), or +// the MDM triggers an install of the app, an entitlement to that app is +// automatically created. If this is impossible - e.g. the enterprise +// has not purchased sufficient licenses - then installation +// fails. +// +// Note that entitlements are always user specific, not device specific; +// a user may have an entitlement even though they have not installed +// the app anywhere. Once they have an entitlement they can install the +// app on multiple devices. +// +// The API can be used to create an entitlement. If the app is a free +// app, a group license for that app is created. If it's a paid app, +// creating the entitlement consumes one license; it remains consumed +// until the entitlement is removed. Optionally an installation of the +// app on all the user's managed devices can be triggered at the time +// the entitlement is created. An entitlement cannot be created for an +// app if the app requires permissions that the enterprise has not yet +// accepted. +// +// Entitlements for paid apps that are due to purchases by the user on a +// non-managed profile will have "userPurchase" as entitlement reason; +// those entitlements cannot be removed via the API. +type Entitlement struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidenterprise#entitlement". + Kind string `json:"kind,omitempty"` + + // ProductId: The ID of the product that the entitlement is for, e.g. + // "app:com.google.android.gm". + ProductId string `json:"productId,omitempty"` + + // Reason: The reason for the entitlement, e.g. "free" for free apps. + // This is temporary, it will be replaced by the acquisition kind field + // of group licenses. + Reason string `json:"reason,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Entitlement) MarshalJSON() ([]byte, error) { + type noMethod Entitlement + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EntitlementsListResponse: The entitlement resources for the user. +type EntitlementsListResponse struct { + // Entitlement: An entitlement of a user to a product (e.g. an app). For + // example, a free app that they have installed, or a paid app that they + // have been allocated a license to. + Entitlement []*Entitlement `json:"entitlement,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidenterprise#entitlementsListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Entitlement") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EntitlementsListResponse) MarshalJSON() ([]byte, error) { + type noMethod EntitlementsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GroupLicense: A group license object indicates a product that an +// enterprise admin has approved for use in the enterprise. The product +// may be free or paid. For free products, a group license object is +// created in these cases: if the enterprise admin approves a product in +// Google Play, if the product is added to a collection, or if an +// entitlement for the product is created for a user via the API. For +// paid products, a group license object is only created as part of the +// first bulk purchase of that product in Google Play by the enterprise +// admin. +// +// The API can be used to query group licenses; the available +// information includes the total number of licenses purchased (for paid +// products) and the total number of licenses that have been +// provisioned, that is, the total number of user entitlements in +// existence for the product. +// +// Group license objects are never deleted. If, for example, a free app +// is added to a collection and then removed, the group license will +// remain, allowing the enterprise admin to keep track of any remaining +// entitlements. An enterprise admin may indicate they are no longer +// interested in the group license by marking it as unapproved in Google +// Play. +type GroupLicense struct { + // AcquisitionKind: How this group license was acquired. "bulkPurchase" + // means that this group license object was created because the + // enterprise purchased licenses for this product; this is "free" + // otherwise (for free products). + AcquisitionKind string `json:"acquisitionKind,omitempty"` + + // Approval: Whether the product to which this group license relates is + // currently approved by the enterprise, as either "approved" or + // "unapproved". Products are approved when a group license is first + // created, but this approval may be revoked by an enterprise admin via + // Google Play. Unapproved products will not be visible to end users in + // collections and new entitlements to them should not normally be + // created. + Approval string `json:"approval,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidenterprise#groupLicense". + Kind string `json:"kind,omitempty"` + + // NumProvisioned: The total number of provisioned licenses for this + // product. Returned by read operations, but ignored in write + // operations. + NumProvisioned int64 `json:"numProvisioned,omitempty"` + + // NumPurchased: The number of purchased licenses (possibly in multiple + // purchases). If this field is omitted then there is no limit on the + // number of licenses that can be provisioned (e.g. if the acquisition + // kind is "free"). + NumPurchased int64 `json:"numPurchased,omitempty"` + + // ProductId: The ID of the product that the license is for, e.g. + // "app:com.google.android.gm". + ProductId string `json:"productId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AcquisitionKind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GroupLicense) MarshalJSON() ([]byte, error) { + type noMethod GroupLicense + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GroupLicenseUsersListResponse: The user resources for the group +// license. +type GroupLicenseUsersListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidenterprise#groupLicenseUsersListResponse". + Kind string `json:"kind,omitempty"` + + // User: A user of an enterprise. + User []*User `json:"user,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GroupLicenseUsersListResponse) MarshalJSON() ([]byte, error) { + type noMethod GroupLicenseUsersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GroupLicensesListResponse: The grouplicense resources for the +// enterprise. +type GroupLicensesListResponse struct { + // GroupLicense: A group license for a product approved for use in the + // enterprise. + GroupLicense []*GroupLicense `json:"groupLicense,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidenterprise#groupLicensesListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "GroupLicense") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GroupLicensesListResponse) MarshalJSON() ([]byte, error) { + type noMethod GroupLicensesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Install: The existence of an install resource indicates that an app +// is installed on a particular device (or that an install is +// pending). +// +// The API can be used to create an install resource using the update +// method. This triggers the actual install of the app on the device. If +// the user does not already have an entitlement for the app then an +// attempt is made to create one. If this fails (e.g. because the app is +// not free and there is no available license) then the creation of the +// install fails. +// +// The API can also be used to update an installed app. If the update +// method is used on an existing install then the app will be updated to +// the latest available version. +// +// Note that it is not possible to force the installation of a specific +// version of an app; the version code is read-only. +// +// If a user installs an app themselves (as permitted by the +// enterprise), then again an install resource and possibly an +// entitlement resource are automatically created. +// +// The API can also be used to delete an install resource, which +// triggers the removal of the app from the device. Note that deleting +// an install does not automatically remove the corresponding +// entitlement, even if there are no remaining installs. The install +// resource will also be deleted if the user uninstalls the app +// themselves. +type Install struct { + // InstallState: Install state. The state "installPending" means that an + // install request has recently been made and download to the device is + // in progress. The state "installed" means that the app has been + // installed. This field is read-only. + InstallState string `json:"installState,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidenterprise#install". + Kind string `json:"kind,omitempty"` + + // ProductId: The ID of the product that the install is for, e.g. + // "app:com.google.android.gm". + ProductId string `json:"productId,omitempty"` + + // VersionCode: The version of the installed product. Guaranteed to be + // set only if the install state is "installed". + VersionCode int64 `json:"versionCode,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "InstallState") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Install) MarshalJSON() ([]byte, error) { + type noMethod Install + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstallsListResponse: The install resources for the device. +type InstallsListResponse struct { + // Install: An installation of an app for a user on a specific device. + // The existence of an install implies that the user must have an + // entitlement to the app. + Install []*Install `json:"install,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidenterprise#installsListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Install") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstallsListResponse) MarshalJSON() ([]byte, error) { + type noMethod InstallsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Permission: A permission represents some extra capability, to be +// granted to an Android app, which requires explicit consent. An +// enterprise admin must consent to these permissions on behalf of their +// users before an entitlement for the app can be created. +// +// The permissions collection is read-only. The information provided for +// each permission (localized name and description) is intended to be +// used in the MDM user interface when obtaining consent from the +// enterprise. +type Permission struct { + // Description: A longer description of the permissions giving more + // details of what it affects. + Description string `json:"description,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidenterprise#permission". + Kind string `json:"kind,omitempty"` + + // Name: The name of the permission. + Name string `json:"name,omitempty"` + + // PermissionId: An opaque string uniquely identifying the permission. + PermissionId string `json:"permissionId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Permission) MarshalJSON() ([]byte, error) { + type noMethod Permission + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Product: A product represents an app in the Google Play Store that is +// available to at least some users in the enterprise. (Some apps are +// restricted to a single enterprise, and no information about them is +// made available outside that enterprise.) +// +// The information provided for each product (localized name, icon, link +// to the full Google Play details page) is intended to allow a basic +// representation of the product within an MDM user interface. +type Product struct { + // AppVersion: App versions currently available for this product. The + // returned list contains only public versions. Alpha and beta versions + // are not included. + AppVersion []*AppVersion `json:"appVersion,omitempty"` + + // AuthorName: The name of the author of the product (e.g. the app + // developer). + AuthorName string `json:"authorName,omitempty"` + + // DetailsUrl: A link to the (consumer) Google Play details page for the + // product. + DetailsUrl string `json:"detailsUrl,omitempty"` + + // DistributionChannel: How and to whom the package is made available. + // The value publicGoogleHosted means that the package is available + // through the Play Store and not restricted to a specific enterprise. + // The value privateGoogleHosted means that the package is a private app + // (restricted to an enterprise) but hosted by Google. The value + // privateSelfHosted means that the package is a private app (restricted + // to an enterprise) and is privately hosted. + DistributionChannel string `json:"distributionChannel,omitempty"` + + // IconUrl: A link to an image that can be used as an icon for the + // product. + IconUrl string `json:"iconUrl,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidenterprise#product". + Kind string `json:"kind,omitempty"` + + // ProductId: A string of the form app:. For example, + // app:com.google.android.gm represents the Gmail app. + ProductId string `json:"productId,omitempty"` + + // RequiresContainerApp: Whether this app can only be installed on + // devices using the Android for Work container app. + RequiresContainerApp bool `json:"requiresContainerApp,omitempty"` + + // Title: The name of the product. + Title string `json:"title,omitempty"` + + // WorkDetailsUrl: A link to the Google Play for Work details page for + // the product, for use by an Enterprise administrator. + WorkDetailsUrl string `json:"workDetailsUrl,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AppVersion") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Product) MarshalJSON() ([]byte, error) { + type noMethod Product + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ProductPermission: A product permissions resource represents the set +// of permissions required by a specific app and whether or not they +// have been accepted by an enterprise admin. +// +// The API can be used to read the set of permissions, and also to +// update the set to indicate that permissions have been accepted. +type ProductPermission struct { + // PermissionId: An opaque string uniquely identifying the permission. + PermissionId string `json:"permissionId,omitempty"` + + // State: Whether the permission has been accepted or not. + State string `json:"state,omitempty"` + + // ForceSendFields is a list of field names (e.g. "PermissionId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductPermission) MarshalJSON() ([]byte, error) { + type noMethod ProductPermission + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ProductPermissions: Information about the permissions required by a +// specific app and whether they have been accepted by the enterprise. +type ProductPermissions struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidenterprise#productPermissions". + Kind string `json:"kind,omitempty"` + + // Permission: The permissions required by the app. + Permission []*ProductPermission `json:"permission,omitempty"` + + // ProductId: The ID of the app that the permissions relate to, e.g. + // "app:com.google.android.gm". + ProductId string `json:"productId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductPermissions) MarshalJSON() ([]byte, error) { + type noMethod ProductPermissions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ProductSet: A set of products. +type ProductSet struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidenterprise#productSet". + Kind string `json:"kind,omitempty"` + + // ProductId: The list of product IDs making up the set of products. + ProductId []string `json:"productId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductSet) MarshalJSON() ([]byte, error) { + type noMethod ProductSet + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ProductsApproveRequest struct { + // ApprovalUrlInfo: The approval URL that was shown to the user. Only + // the permissions shown to the user with that URL will be accepted, + // which may not be the product's entire set of permissions. For + // example, the URL may only display new permissions from an update + // after the product was approved, or not include new permissions if the + // product was updated since the URL was generated. + ApprovalUrlInfo *ApprovalUrlInfo `json:"approvalUrlInfo,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ApprovalUrlInfo") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductsApproveRequest) MarshalJSON() ([]byte, error) { + type noMethod ProductsApproveRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ProductsGenerateApprovalUrlResponse struct { + // Url: A URL that can be rendered in an iframe to display the + // permissions (if any) of a product. This URL can be used to approve + // the product only once and only within 24 hours of being generated, + // using the Products.approve call. If the product is currently + // unapproved and has no permissions, this URL will point to an empty + // page. If the product is currently approved, a URL will only be + // generated if that product has added permissions since it was last + // approved, and the URL will only display those new permissions that + // have not yet been accepted. + Url string `json:"url,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Url") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductsGenerateApprovalUrlResponse) MarshalJSON() ([]byte, error) { + type noMethod ProductsGenerateApprovalUrlResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// User: A user resource represents an individual user within the +// enterprise's domain. +// +// Note that each user is associated with a Google account based on the +// user's corporate email address (which must be in one of the +// enterprise's domains). As part of installing an MDM app to manage a +// device the Google account must be provisioned to the device, and so +// the user resource must be created before that. This can be done using +// the Google Admin SDK Directory API. +// +// The ID for a user is an opaque string. It can be retrieved using the +// list method queried by the user's primary email address. +type User struct { + // Id: The unique ID for the user. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidenterprise#user". + Kind string `json:"kind,omitempty"` + + // PrimaryEmail: The user's primary email, e.g. "jsmith@example.com". + PrimaryEmail string `json:"primaryEmail,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *User) MarshalJSON() ([]byte, error) { + type noMethod User + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserToken: A UserToken is used by a user when setting up a managed +// device or profile with their work account on a device. When the user +// enters their email address and token (activation code) the +// appropriate MDM app can be automatically downloaded. +type UserToken struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidenterprise#userToken". + Kind string `json:"kind,omitempty"` + + // Token: The token (activation code) to be entered by the user. This + // consists of a sequence of decimal digits. Note that the leading digit + // may be 0. + Token string `json:"token,omitempty"` + + // UserId: The unique ID for the user. + UserId string `json:"userId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserToken) MarshalJSON() ([]byte, error) { + type noMethod UserToken + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UsersListResponse: The matching user resources. +type UsersListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidenterprise#usersListResponse". + Kind string `json:"kind,omitempty"` + + // User: A user of an enterprise. + User []*User `json:"user,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UsersListResponse) MarshalJSON() ([]byte, error) { + type noMethod UsersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "androidenterprise.collections.delete": + +type CollectionsDeleteCall struct { + s *Service + enterpriseId string + collectionId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a collection. +func (r *CollectionsService) Delete(enterpriseId string, collectionId string) *CollectionsDeleteCall { + c := &CollectionsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.collectionId = collectionId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CollectionsDeleteCall) Fields(s ...googleapi.Field) *CollectionsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CollectionsDeleteCall) Context(ctx context.Context) *CollectionsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *CollectionsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "collectionId": c.collectionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.collections.delete" call. +func (c *CollectionsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a collection.", + // "httpMethod": "DELETE", + // "id": "androidenterprise.collections.delete", + // "parameterOrder": [ + // "enterpriseId", + // "collectionId" + // ], + // "parameters": { + // "collectionId": { + // "description": "The ID of the collection.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/collections/{collectionId}", + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.collections.get": + +type CollectionsGetCall struct { + s *Service + enterpriseId string + collectionId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves the details of a collection. +func (r *CollectionsService) Get(enterpriseId string, collectionId string) *CollectionsGetCall { + c := &CollectionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.collectionId = collectionId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CollectionsGetCall) Fields(s ...googleapi.Field) *CollectionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CollectionsGetCall) IfNoneMatch(entityTag string) *CollectionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CollectionsGetCall) Context(ctx context.Context) *CollectionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CollectionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "collectionId": c.collectionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.collections.get" call. +// Exactly one of *Collection or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Collection.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CollectionsGetCall) Do() (*Collection, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Collection{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the details of a collection.", + // "httpMethod": "GET", + // "id": "androidenterprise.collections.get", + // "parameterOrder": [ + // "enterpriseId", + // "collectionId" + // ], + // "parameters": { + // "collectionId": { + // "description": "The ID of the collection.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/collections/{collectionId}", + // "response": { + // "$ref": "Collection" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.collections.insert": + +type CollectionsInsertCall struct { + s *Service + enterpriseId string + collection *Collection + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a new collection. +func (r *CollectionsService) Insert(enterpriseId string, collection *Collection) *CollectionsInsertCall { + c := &CollectionsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.collection = collection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CollectionsInsertCall) Fields(s ...googleapi.Field) *CollectionsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CollectionsInsertCall) Context(ctx context.Context) *CollectionsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CollectionsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.collection) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.collections.insert" call. +// Exactly one of *Collection or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Collection.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CollectionsInsertCall) Do() (*Collection, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Collection{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new collection.", + // "httpMethod": "POST", + // "id": "androidenterprise.collections.insert", + // "parameterOrder": [ + // "enterpriseId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/collections", + // "request": { + // "$ref": "Collection" + // }, + // "response": { + // "$ref": "Collection" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.collections.list": + +type CollectionsListCall struct { + s *Service + enterpriseId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the IDs of all the collections for an enterprise. +func (r *CollectionsService) List(enterpriseId string) *CollectionsListCall { + c := &CollectionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CollectionsListCall) Fields(s ...googleapi.Field) *CollectionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CollectionsListCall) IfNoneMatch(entityTag string) *CollectionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CollectionsListCall) Context(ctx context.Context) *CollectionsListCall { + c.ctx_ = ctx + return c +} + +func (c *CollectionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.collections.list" call. +// Exactly one of *CollectionsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CollectionsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CollectionsListCall) Do() (*CollectionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CollectionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the IDs of all the collections for an enterprise.", + // "httpMethod": "GET", + // "id": "androidenterprise.collections.list", + // "parameterOrder": [ + // "enterpriseId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/collections", + // "response": { + // "$ref": "CollectionsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.collections.patch": + +type CollectionsPatchCall struct { + s *Service + enterpriseId string + collectionId string + collection *Collection + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates a collection. This method supports patch semantics. +func (r *CollectionsService) Patch(enterpriseId string, collectionId string, collection *Collection) *CollectionsPatchCall { + c := &CollectionsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.collectionId = collectionId + c.collection = collection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CollectionsPatchCall) Fields(s ...googleapi.Field) *CollectionsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CollectionsPatchCall) Context(ctx context.Context) *CollectionsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CollectionsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.collection) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "collectionId": c.collectionId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.collections.patch" call. +// Exactly one of *Collection or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Collection.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CollectionsPatchCall) Do() (*Collection, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Collection{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a collection. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "androidenterprise.collections.patch", + // "parameterOrder": [ + // "enterpriseId", + // "collectionId" + // ], + // "parameters": { + // "collectionId": { + // "description": "The ID of the collection.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/collections/{collectionId}", + // "request": { + // "$ref": "Collection" + // }, + // "response": { + // "$ref": "Collection" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.collections.update": + +type CollectionsUpdateCall struct { + s *Service + enterpriseId string + collectionId string + collection *Collection + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a collection. +func (r *CollectionsService) Update(enterpriseId string, collectionId string, collection *Collection) *CollectionsUpdateCall { + c := &CollectionsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.collectionId = collectionId + c.collection = collection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CollectionsUpdateCall) Fields(s ...googleapi.Field) *CollectionsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CollectionsUpdateCall) Context(ctx context.Context) *CollectionsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CollectionsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.collection) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "collectionId": c.collectionId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.collections.update" call. +// Exactly one of *Collection or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Collection.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CollectionsUpdateCall) Do() (*Collection, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Collection{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a collection.", + // "httpMethod": "PUT", + // "id": "androidenterprise.collections.update", + // "parameterOrder": [ + // "enterpriseId", + // "collectionId" + // ], + // "parameters": { + // "collectionId": { + // "description": "The ID of the collection.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/collections/{collectionId}", + // "request": { + // "$ref": "Collection" + // }, + // "response": { + // "$ref": "Collection" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.collectionviewers.delete": + +type CollectionviewersDeleteCall struct { + s *Service + enterpriseId string + collectionId string + userId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Removes the user from the list of those specifically allowed +// to see the collection. If the collection's visibility is set to +// viewersOnly then only such users will see the collection. +func (r *CollectionviewersService) Delete(enterpriseId string, collectionId string, userId string) *CollectionviewersDeleteCall { + c := &CollectionviewersDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.collectionId = collectionId + c.userId = userId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CollectionviewersDeleteCall) Fields(s ...googleapi.Field) *CollectionviewersDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CollectionviewersDeleteCall) Context(ctx context.Context) *CollectionviewersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *CollectionviewersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "collectionId": c.collectionId, + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.collectionviewers.delete" call. +func (c *CollectionviewersDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Removes the user from the list of those specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only such users will see the collection.", + // "httpMethod": "DELETE", + // "id": "androidenterprise.collectionviewers.delete", + // "parameterOrder": [ + // "enterpriseId", + // "collectionId", + // "userId" + // ], + // "parameters": { + // "collectionId": { + // "description": "The ID of the collection.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}", + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.collectionviewers.get": + +type CollectionviewersGetCall struct { + s *Service + enterpriseId string + collectionId string + userId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves the ID of the user if they have been specifically +// allowed to see the collection. If the collection's visibility is set +// to viewersOnly then only these users will see the collection. +func (r *CollectionviewersService) Get(enterpriseId string, collectionId string, userId string) *CollectionviewersGetCall { + c := &CollectionviewersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.collectionId = collectionId + c.userId = userId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CollectionviewersGetCall) Fields(s ...googleapi.Field) *CollectionviewersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CollectionviewersGetCall) IfNoneMatch(entityTag string) *CollectionviewersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CollectionviewersGetCall) Context(ctx context.Context) *CollectionviewersGetCall { + c.ctx_ = ctx + return c +} + +func (c *CollectionviewersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "collectionId": c.collectionId, + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.collectionviewers.get" call. +// Exactly one of *User or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *User.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *CollectionviewersGetCall) Do() (*User, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &User{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the ID of the user if they have been specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only these users will see the collection.", + // "httpMethod": "GET", + // "id": "androidenterprise.collectionviewers.get", + // "parameterOrder": [ + // "enterpriseId", + // "collectionId", + // "userId" + // ], + // "parameters": { + // "collectionId": { + // "description": "The ID of the collection.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}", + // "response": { + // "$ref": "User" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.collectionviewers.list": + +type CollectionviewersListCall struct { + s *Service + enterpriseId string + collectionId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the IDs of the users who have been specifically +// allowed to see the collection. If the collection's visibility is set +// to viewersOnly then only these users will see the collection. +func (r *CollectionviewersService) List(enterpriseId string, collectionId string) *CollectionviewersListCall { + c := &CollectionviewersListCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.collectionId = collectionId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CollectionviewersListCall) Fields(s ...googleapi.Field) *CollectionviewersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CollectionviewersListCall) IfNoneMatch(entityTag string) *CollectionviewersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CollectionviewersListCall) Context(ctx context.Context) *CollectionviewersListCall { + c.ctx_ = ctx + return c +} + +func (c *CollectionviewersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}/users") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "collectionId": c.collectionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.collectionviewers.list" call. +// Exactly one of *CollectionViewersListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *CollectionViewersListResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CollectionviewersListCall) Do() (*CollectionViewersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CollectionViewersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the IDs of the users who have been specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only these users will see the collection.", + // "httpMethod": "GET", + // "id": "androidenterprise.collectionviewers.list", + // "parameterOrder": [ + // "enterpriseId", + // "collectionId" + // ], + // "parameters": { + // "collectionId": { + // "description": "The ID of the collection.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/collections/{collectionId}/users", + // "response": { + // "$ref": "CollectionViewersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.collectionviewers.patch": + +type CollectionviewersPatchCall struct { + s *Service + enterpriseId string + collectionId string + userId string + user *User + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Adds the user to the list of those specifically allowed to see +// the collection. If the collection's visibility is set to viewersOnly +// then only such users will see the collection. This method supports +// patch semantics. +func (r *CollectionviewersService) Patch(enterpriseId string, collectionId string, userId string, user *User) *CollectionviewersPatchCall { + c := &CollectionviewersPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.collectionId = collectionId + c.userId = userId + c.user = user + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CollectionviewersPatchCall) Fields(s ...googleapi.Field) *CollectionviewersPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CollectionviewersPatchCall) Context(ctx context.Context) *CollectionviewersPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CollectionviewersPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "collectionId": c.collectionId, + "userId": c.userId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.collectionviewers.patch" call. +// Exactly one of *User or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *User.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *CollectionviewersPatchCall) Do() (*User, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &User{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds the user to the list of those specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only such users will see the collection. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "androidenterprise.collectionviewers.patch", + // "parameterOrder": [ + // "enterpriseId", + // "collectionId", + // "userId" + // ], + // "parameters": { + // "collectionId": { + // "description": "The ID of the collection.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}", + // "request": { + // "$ref": "User" + // }, + // "response": { + // "$ref": "User" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.collectionviewers.update": + +type CollectionviewersUpdateCall struct { + s *Service + enterpriseId string + collectionId string + userId string + user *User + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Adds the user to the list of those specifically allowed to +// see the collection. If the collection's visibility is set to +// viewersOnly then only such users will see the collection. +func (r *CollectionviewersService) Update(enterpriseId string, collectionId string, userId string, user *User) *CollectionviewersUpdateCall { + c := &CollectionviewersUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.collectionId = collectionId + c.userId = userId + c.user = user + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CollectionviewersUpdateCall) Fields(s ...googleapi.Field) *CollectionviewersUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CollectionviewersUpdateCall) Context(ctx context.Context) *CollectionviewersUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CollectionviewersUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "collectionId": c.collectionId, + "userId": c.userId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.collectionviewers.update" call. +// Exactly one of *User or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *User.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *CollectionviewersUpdateCall) Do() (*User, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &User{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds the user to the list of those specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only such users will see the collection.", + // "httpMethod": "PUT", + // "id": "androidenterprise.collectionviewers.update", + // "parameterOrder": [ + // "enterpriseId", + // "collectionId", + // "userId" + // ], + // "parameters": { + // "collectionId": { + // "description": "The ID of the collection.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}", + // "request": { + // "$ref": "User" + // }, + // "response": { + // "$ref": "User" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.devices.get": + +type DevicesGetCall struct { + s *Service + enterpriseId string + userId string + deviceId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves the details of a device. +func (r *DevicesService) Get(enterpriseId string, userId string, deviceId string) *DevicesGetCall { + c := &DevicesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.userId = userId + c.deviceId = deviceId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DevicesGetCall) Fields(s ...googleapi.Field) *DevicesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DevicesGetCall) IfNoneMatch(entityTag string) *DevicesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DevicesGetCall) Context(ctx context.Context) *DevicesGetCall { + c.ctx_ = ctx + return c +} + +func (c *DevicesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "userId": c.userId, + "deviceId": c.deviceId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.devices.get" call. +// Exactly one of *Device or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Device.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *DevicesGetCall) Do() (*Device, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Device{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the details of a device.", + // "httpMethod": "GET", + // "id": "androidenterprise.devices.get", + // "parameterOrder": [ + // "enterpriseId", + // "userId", + // "deviceId" + // ], + // "parameters": { + // "deviceId": { + // "description": "The ID of the device.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}", + // "response": { + // "$ref": "Device" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.devices.getState": + +type DevicesGetStateCall struct { + s *Service + enterpriseId string + userId string + deviceId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetState: Retrieves whether a device is enabled or disabled for +// access by the user to Google services. The device state takes effect +// only if enforcing EMM policies on Android devices is enabled in the +// Google Admin Console. Otherwise, the device state is ignored and all +// devices are allowed access to Google services. +func (r *DevicesService) GetState(enterpriseId string, userId string, deviceId string) *DevicesGetStateCall { + c := &DevicesGetStateCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.userId = userId + c.deviceId = deviceId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DevicesGetStateCall) Fields(s ...googleapi.Field) *DevicesGetStateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DevicesGetStateCall) IfNoneMatch(entityTag string) *DevicesGetStateCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DevicesGetStateCall) Context(ctx context.Context) *DevicesGetStateCall { + c.ctx_ = ctx + return c +} + +func (c *DevicesGetStateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "userId": c.userId, + "deviceId": c.deviceId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.devices.getState" call. +// Exactly one of *DeviceState or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DeviceState.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DevicesGetStateCall) Do() (*DeviceState, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DeviceState{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves whether a device is enabled or disabled for access by the user to Google services. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services.", + // "httpMethod": "GET", + // "id": "androidenterprise.devices.getState", + // "parameterOrder": [ + // "enterpriseId", + // "userId", + // "deviceId" + // ], + // "parameters": { + // "deviceId": { + // "description": "The ID of the device.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state", + // "response": { + // "$ref": "DeviceState" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.devices.list": + +type DevicesListCall struct { + s *Service + enterpriseId string + userId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the IDs of all of a user's devices. +func (r *DevicesService) List(enterpriseId string, userId string) *DevicesListCall { + c := &DevicesListCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.userId = userId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DevicesListCall) Fields(s ...googleapi.Field) *DevicesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DevicesListCall) IfNoneMatch(entityTag string) *DevicesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DevicesListCall) Context(ctx context.Context) *DevicesListCall { + c.ctx_ = ctx + return c +} + +func (c *DevicesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.devices.list" call. +// Exactly one of *DevicesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DevicesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DevicesListCall) Do() (*DevicesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DevicesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the IDs of all of a user's devices.", + // "httpMethod": "GET", + // "id": "androidenterprise.devices.list", + // "parameterOrder": [ + // "enterpriseId", + // "userId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/users/{userId}/devices", + // "response": { + // "$ref": "DevicesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.devices.setState": + +type DevicesSetStateCall struct { + s *Service + enterpriseId string + userId string + deviceId string + devicestate *DeviceState + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetState: Sets whether a device is enabled or disabled for access by +// the user to Google services. The device state takes effect only if +// enforcing EMM policies on Android devices is enabled in the Google +// Admin Console. Otherwise, the device state is ignored and all devices +// are allowed access to Google services. +func (r *DevicesService) SetState(enterpriseId string, userId string, deviceId string, devicestate *DeviceState) *DevicesSetStateCall { + c := &DevicesSetStateCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.userId = userId + c.deviceId = deviceId + c.devicestate = devicestate + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DevicesSetStateCall) Fields(s ...googleapi.Field) *DevicesSetStateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DevicesSetStateCall) Context(ctx context.Context) *DevicesSetStateCall { + c.ctx_ = ctx + return c +} + +func (c *DevicesSetStateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.devicestate) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "userId": c.userId, + "deviceId": c.deviceId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.devices.setState" call. +// Exactly one of *DeviceState or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DeviceState.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DevicesSetStateCall) Do() (*DeviceState, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DeviceState{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets whether a device is enabled or disabled for access by the user to Google services. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services.", + // "httpMethod": "PUT", + // "id": "androidenterprise.devices.setState", + // "parameterOrder": [ + // "enterpriseId", + // "userId", + // "deviceId" + // ], + // "parameters": { + // "deviceId": { + // "description": "The ID of the device.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state", + // "request": { + // "$ref": "DeviceState" + // }, + // "response": { + // "$ref": "DeviceState" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.enterprises.delete": + +type EnterprisesDeleteCall struct { + s *Service + enterpriseId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the binding between the MDM and enterprise. This is +// now deprecated; use this to unenroll customers that were previously +// enrolled with the 'insert' call, then enroll them again with the +// 'enroll' call. +func (r *EnterprisesService) Delete(enterpriseId string) *EnterprisesDeleteCall { + c := &EnterprisesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EnterprisesDeleteCall) Fields(s ...googleapi.Field) *EnterprisesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EnterprisesDeleteCall) Context(ctx context.Context) *EnterprisesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *EnterprisesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.enterprises.delete" call. +func (c *EnterprisesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the binding between the MDM and enterprise. This is now deprecated; use this to unenroll customers that were previously enrolled with the 'insert' call, then enroll them again with the 'enroll' call.", + // "httpMethod": "DELETE", + // "id": "androidenterprise.enterprises.delete", + // "parameterOrder": [ + // "enterpriseId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}", + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.enterprises.enroll": + +type EnterprisesEnrollCall struct { + s *Service + token string + enterprise *Enterprise + opt_ map[string]interface{} + ctx_ context.Context +} + +// Enroll: Enrolls an enterprise with the calling MDM. +func (r *EnterprisesService) Enroll(token string, enterprise *Enterprise) *EnterprisesEnrollCall { + c := &EnterprisesEnrollCall{s: r.s, opt_: make(map[string]interface{})} + c.token = token + c.enterprise = enterprise + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EnterprisesEnrollCall) Fields(s ...googleapi.Field) *EnterprisesEnrollCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EnterprisesEnrollCall) Context(ctx context.Context) *EnterprisesEnrollCall { + c.ctx_ = ctx + return c +} + +func (c *EnterprisesEnrollCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterprise) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("token", fmt.Sprintf("%v", c.token)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/enroll") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.enterprises.enroll" call. +// Exactly one of *Enterprise or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Enterprise.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EnterprisesEnrollCall) Do() (*Enterprise, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Enterprise{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Enrolls an enterprise with the calling MDM.", + // "httpMethod": "POST", + // "id": "androidenterprise.enterprises.enroll", + // "parameterOrder": [ + // "token" + // ], + // "parameters": { + // "token": { + // "description": "The token provided by the enterprise to register the MDM.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/enroll", + // "request": { + // "$ref": "Enterprise" + // }, + // "response": { + // "$ref": "Enterprise" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.enterprises.get": + +type EnterprisesGetCall struct { + s *Service + enterpriseId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves the name and domain of an enterprise. +func (r *EnterprisesService) Get(enterpriseId string) *EnterprisesGetCall { + c := &EnterprisesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EnterprisesGetCall) Fields(s ...googleapi.Field) *EnterprisesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EnterprisesGetCall) IfNoneMatch(entityTag string) *EnterprisesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EnterprisesGetCall) Context(ctx context.Context) *EnterprisesGetCall { + c.ctx_ = ctx + return c +} + +func (c *EnterprisesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.enterprises.get" call. +// Exactly one of *Enterprise or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Enterprise.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EnterprisesGetCall) Do() (*Enterprise, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Enterprise{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the name and domain of an enterprise.", + // "httpMethod": "GET", + // "id": "androidenterprise.enterprises.get", + // "parameterOrder": [ + // "enterpriseId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}", + // "response": { + // "$ref": "Enterprise" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.enterprises.insert": + +type EnterprisesInsertCall struct { + s *Service + token string + enterprise *Enterprise + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Establishes the binding between the MDM and an enterprise. +// This is now deprecated; use enroll instead. +func (r *EnterprisesService) Insert(token string, enterprise *Enterprise) *EnterprisesInsertCall { + c := &EnterprisesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.token = token + c.enterprise = enterprise + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EnterprisesInsertCall) Fields(s ...googleapi.Field) *EnterprisesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EnterprisesInsertCall) Context(ctx context.Context) *EnterprisesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *EnterprisesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterprise) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("token", fmt.Sprintf("%v", c.token)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.enterprises.insert" call. +// Exactly one of *Enterprise or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Enterprise.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EnterprisesInsertCall) Do() (*Enterprise, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Enterprise{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Establishes the binding between the MDM and an enterprise. This is now deprecated; use enroll instead.", + // "httpMethod": "POST", + // "id": "androidenterprise.enterprises.insert", + // "parameterOrder": [ + // "token" + // ], + // "parameters": { + // "token": { + // "description": "The token provided by the enterprise to register the MDM.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises", + // "request": { + // "$ref": "Enterprise" + // }, + // "response": { + // "$ref": "Enterprise" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.enterprises.list": + +type EnterprisesListCall struct { + s *Service + domain string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Looks up an enterprise by domain name. +func (r *EnterprisesService) List(domain string) *EnterprisesListCall { + c := &EnterprisesListCall{s: r.s, opt_: make(map[string]interface{})} + c.domain = domain + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EnterprisesListCall) Fields(s ...googleapi.Field) *EnterprisesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EnterprisesListCall) IfNoneMatch(entityTag string) *EnterprisesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EnterprisesListCall) Context(ctx context.Context) *EnterprisesListCall { + c.ctx_ = ctx + return c +} + +func (c *EnterprisesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("domain", fmt.Sprintf("%v", c.domain)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.enterprises.list" call. +// Exactly one of *EnterprisesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *EnterprisesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EnterprisesListCall) Do() (*EnterprisesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EnterprisesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Looks up an enterprise by domain name.", + // "httpMethod": "GET", + // "id": "androidenterprise.enterprises.list", + // "parameterOrder": [ + // "domain" + // ], + // "parameters": { + // "domain": { + // "description": "The exact primary domain name of the enterprise to look up.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises", + // "response": { + // "$ref": "EnterprisesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.enterprises.sendTestPushNotification": + +type EnterprisesSendTestPushNotificationCall struct { + s *Service + enterpriseId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// SendTestPushNotification: Sends a test push notification to validate +// the MDM integration with the Google Cloud Pub/Sub service for this +// enterprise. +func (r *EnterprisesService) SendTestPushNotification(enterpriseId string) *EnterprisesSendTestPushNotificationCall { + c := &EnterprisesSendTestPushNotificationCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EnterprisesSendTestPushNotificationCall) Fields(s ...googleapi.Field) *EnterprisesSendTestPushNotificationCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EnterprisesSendTestPushNotificationCall) Context(ctx context.Context) *EnterprisesSendTestPushNotificationCall { + c.ctx_ = ctx + return c +} + +func (c *EnterprisesSendTestPushNotificationCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/sendTestPushNotification") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.enterprises.sendTestPushNotification" call. +// Exactly one of *EnterprisesSendTestPushNotificationResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *EnterprisesSendTestPushNotificationResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *EnterprisesSendTestPushNotificationCall) Do() (*EnterprisesSendTestPushNotificationResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EnterprisesSendTestPushNotificationResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sends a test push notification to validate the MDM integration with the Google Cloud Pub/Sub service for this enterprise.", + // "httpMethod": "POST", + // "id": "androidenterprise.enterprises.sendTestPushNotification", + // "parameterOrder": [ + // "enterpriseId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/sendTestPushNotification", + // "response": { + // "$ref": "EnterprisesSendTestPushNotificationResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.enterprises.setAccount": + +type EnterprisesSetAccountCall struct { + s *Service + enterpriseId string + enterpriseaccount *EnterpriseAccount + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetAccount: Set the account that will be used to authenticate to the +// API as the enterprise. +func (r *EnterprisesService) SetAccount(enterpriseId string, enterpriseaccount *EnterpriseAccount) *EnterprisesSetAccountCall { + c := &EnterprisesSetAccountCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.enterpriseaccount = enterpriseaccount + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EnterprisesSetAccountCall) Fields(s ...googleapi.Field) *EnterprisesSetAccountCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EnterprisesSetAccountCall) Context(ctx context.Context) *EnterprisesSetAccountCall { + c.ctx_ = ctx + return c +} + +func (c *EnterprisesSetAccountCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterpriseaccount) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/account") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.enterprises.setAccount" call. +// Exactly one of *EnterpriseAccount or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *EnterpriseAccount.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EnterprisesSetAccountCall) Do() (*EnterpriseAccount, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EnterpriseAccount{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Set the account that will be used to authenticate to the API as the enterprise.", + // "httpMethod": "PUT", + // "id": "androidenterprise.enterprises.setAccount", + // "parameterOrder": [ + // "enterpriseId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/account", + // "request": { + // "$ref": "EnterpriseAccount" + // }, + // "response": { + // "$ref": "EnterpriseAccount" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.enterprises.unenroll": + +type EnterprisesUnenrollCall struct { + s *Service + enterpriseId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Unenroll: Unenrolls an enterprise from the calling MDM. +func (r *EnterprisesService) Unenroll(enterpriseId string) *EnterprisesUnenrollCall { + c := &EnterprisesUnenrollCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EnterprisesUnenrollCall) Fields(s ...googleapi.Field) *EnterprisesUnenrollCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EnterprisesUnenrollCall) Context(ctx context.Context) *EnterprisesUnenrollCall { + c.ctx_ = ctx + return c +} + +func (c *EnterprisesUnenrollCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/unenroll") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.enterprises.unenroll" call. +func (c *EnterprisesUnenrollCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Unenrolls an enterprise from the calling MDM.", + // "httpMethod": "POST", + // "id": "androidenterprise.enterprises.unenroll", + // "parameterOrder": [ + // "enterpriseId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/unenroll", + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.entitlements.delete": + +type EntitlementsDeleteCall struct { + s *Service + enterpriseId string + userId string + entitlementId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Removes an entitlement to an app for a user and uninstalls +// it. +func (r *EntitlementsService) Delete(enterpriseId string, userId string, entitlementId string) *EntitlementsDeleteCall { + c := &EntitlementsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.userId = userId + c.entitlementId = entitlementId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EntitlementsDeleteCall) Fields(s ...googleapi.Field) *EntitlementsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EntitlementsDeleteCall) Context(ctx context.Context) *EntitlementsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *EntitlementsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "userId": c.userId, + "entitlementId": c.entitlementId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.entitlements.delete" call. +func (c *EntitlementsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Removes an entitlement to an app for a user and uninstalls it.", + // "httpMethod": "DELETE", + // "id": "androidenterprise.entitlements.delete", + // "parameterOrder": [ + // "enterpriseId", + // "userId", + // "entitlementId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "entitlementId": { + // "description": "The ID of the entitlement, e.g. \"app:com.google.android.gm\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}", + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.entitlements.get": + +type EntitlementsGetCall struct { + s *Service + enterpriseId string + userId string + entitlementId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves details of an entitlement. +func (r *EntitlementsService) Get(enterpriseId string, userId string, entitlementId string) *EntitlementsGetCall { + c := &EntitlementsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.userId = userId + c.entitlementId = entitlementId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EntitlementsGetCall) Fields(s ...googleapi.Field) *EntitlementsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EntitlementsGetCall) IfNoneMatch(entityTag string) *EntitlementsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EntitlementsGetCall) Context(ctx context.Context) *EntitlementsGetCall { + c.ctx_ = ctx + return c +} + +func (c *EntitlementsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "userId": c.userId, + "entitlementId": c.entitlementId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.entitlements.get" call. +// Exactly one of *Entitlement or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Entitlement.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EntitlementsGetCall) Do() (*Entitlement, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Entitlement{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves details of an entitlement.", + // "httpMethod": "GET", + // "id": "androidenterprise.entitlements.get", + // "parameterOrder": [ + // "enterpriseId", + // "userId", + // "entitlementId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "entitlementId": { + // "description": "The ID of the entitlement, e.g. \"app:com.google.android.gm\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}", + // "response": { + // "$ref": "Entitlement" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.entitlements.list": + +type EntitlementsListCall struct { + s *Service + enterpriseId string + userId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List of all entitlements for the specified user. Only the ID is +// set. +func (r *EntitlementsService) List(enterpriseId string, userId string) *EntitlementsListCall { + c := &EntitlementsListCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.userId = userId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EntitlementsListCall) Fields(s ...googleapi.Field) *EntitlementsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EntitlementsListCall) IfNoneMatch(entityTag string) *EntitlementsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EntitlementsListCall) Context(ctx context.Context) *EntitlementsListCall { + c.ctx_ = ctx + return c +} + +func (c *EntitlementsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.entitlements.list" call. +// Exactly one of *EntitlementsListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *EntitlementsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EntitlementsListCall) Do() (*EntitlementsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EntitlementsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List of all entitlements for the specified user. Only the ID is set.", + // "httpMethod": "GET", + // "id": "androidenterprise.entitlements.list", + // "parameterOrder": [ + // "enterpriseId", + // "userId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/users/{userId}/entitlements", + // "response": { + // "$ref": "EntitlementsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.entitlements.patch": + +type EntitlementsPatchCall struct { + s *Service + enterpriseId string + userId string + entitlementId string + entitlement *Entitlement + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Adds or updates an entitlement to an app for a user. This +// method supports patch semantics. +func (r *EntitlementsService) Patch(enterpriseId string, userId string, entitlementId string, entitlement *Entitlement) *EntitlementsPatchCall { + c := &EntitlementsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.userId = userId + c.entitlementId = entitlementId + c.entitlement = entitlement + return c +} + +// Install sets the optional parameter "install": Set to true to also +// install the product on all the user's devices where possible. Failure +// to install on one or more devices will not prevent this operation +// from returning successfully, as long as the entitlement was +// successfully assigned to the user. +func (c *EntitlementsPatchCall) Install(install bool) *EntitlementsPatchCall { + c.opt_["install"] = install + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EntitlementsPatchCall) Fields(s ...googleapi.Field) *EntitlementsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EntitlementsPatchCall) Context(ctx context.Context) *EntitlementsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *EntitlementsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.entitlement) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["install"]; ok { + params.Set("install", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "userId": c.userId, + "entitlementId": c.entitlementId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.entitlements.patch" call. +// Exactly one of *Entitlement or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Entitlement.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EntitlementsPatchCall) Do() (*Entitlement, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Entitlement{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds or updates an entitlement to an app for a user. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "androidenterprise.entitlements.patch", + // "parameterOrder": [ + // "enterpriseId", + // "userId", + // "entitlementId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "entitlementId": { + // "description": "The ID of the entitlement, e.g. \"app:com.google.android.gm\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "install": { + // "description": "Set to true to also install the product on all the user's devices where possible. Failure to install on one or more devices will not prevent this operation from returning successfully, as long as the entitlement was successfully assigned to the user.", + // "location": "query", + // "type": "boolean" + // }, + // "userId": { + // "description": "The ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}", + // "request": { + // "$ref": "Entitlement" + // }, + // "response": { + // "$ref": "Entitlement" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.entitlements.update": + +type EntitlementsUpdateCall struct { + s *Service + enterpriseId string + userId string + entitlementId string + entitlement *Entitlement + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Adds or updates an entitlement to an app for a user. +func (r *EntitlementsService) Update(enterpriseId string, userId string, entitlementId string, entitlement *Entitlement) *EntitlementsUpdateCall { + c := &EntitlementsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.userId = userId + c.entitlementId = entitlementId + c.entitlement = entitlement + return c +} + +// Install sets the optional parameter "install": Set to true to also +// install the product on all the user's devices where possible. Failure +// to install on one or more devices will not prevent this operation +// from returning successfully, as long as the entitlement was +// successfully assigned to the user. +func (c *EntitlementsUpdateCall) Install(install bool) *EntitlementsUpdateCall { + c.opt_["install"] = install + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EntitlementsUpdateCall) Fields(s ...googleapi.Field) *EntitlementsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EntitlementsUpdateCall) Context(ctx context.Context) *EntitlementsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *EntitlementsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.entitlement) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["install"]; ok { + params.Set("install", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "userId": c.userId, + "entitlementId": c.entitlementId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.entitlements.update" call. +// Exactly one of *Entitlement or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Entitlement.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EntitlementsUpdateCall) Do() (*Entitlement, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Entitlement{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds or updates an entitlement to an app for a user.", + // "httpMethod": "PUT", + // "id": "androidenterprise.entitlements.update", + // "parameterOrder": [ + // "enterpriseId", + // "userId", + // "entitlementId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "entitlementId": { + // "description": "The ID of the entitlement, e.g. \"app:com.google.android.gm\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "install": { + // "description": "Set to true to also install the product on all the user's devices where possible. Failure to install on one or more devices will not prevent this operation from returning successfully, as long as the entitlement was successfully assigned to the user.", + // "location": "query", + // "type": "boolean" + // }, + // "userId": { + // "description": "The ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}", + // "request": { + // "$ref": "Entitlement" + // }, + // "response": { + // "$ref": "Entitlement" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.grouplicenses.get": + +type GrouplicensesGetCall struct { + s *Service + enterpriseId string + groupLicenseId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves details of an enterprise's group license for a +// product. +func (r *GrouplicensesService) Get(enterpriseId string, groupLicenseId string) *GrouplicensesGetCall { + c := &GrouplicensesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.groupLicenseId = groupLicenseId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GrouplicensesGetCall) Fields(s ...googleapi.Field) *GrouplicensesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GrouplicensesGetCall) IfNoneMatch(entityTag string) *GrouplicensesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GrouplicensesGetCall) Context(ctx context.Context) *GrouplicensesGetCall { + c.ctx_ = ctx + return c +} + +func (c *GrouplicensesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "groupLicenseId": c.groupLicenseId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.grouplicenses.get" call. +// Exactly one of *GroupLicense or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *GroupLicense.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GrouplicensesGetCall) Do() (*GroupLicense, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &GroupLicense{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves details of an enterprise's group license for a product.", + // "httpMethod": "GET", + // "id": "androidenterprise.grouplicenses.get", + // "parameterOrder": [ + // "enterpriseId", + // "groupLicenseId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "groupLicenseId": { + // "description": "The ID of the product the group license is for, e.g. \"app:com.google.android.gm\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}", + // "response": { + // "$ref": "GroupLicense" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.grouplicenses.list": + +type GrouplicensesListCall struct { + s *Service + enterpriseId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves IDs of all products for which the enterprise has a +// group license. +func (r *GrouplicensesService) List(enterpriseId string) *GrouplicensesListCall { + c := &GrouplicensesListCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GrouplicensesListCall) Fields(s ...googleapi.Field) *GrouplicensesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GrouplicensesListCall) IfNoneMatch(entityTag string) *GrouplicensesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GrouplicensesListCall) Context(ctx context.Context) *GrouplicensesListCall { + c.ctx_ = ctx + return c +} + +func (c *GrouplicensesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/groupLicenses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.grouplicenses.list" call. +// Exactly one of *GroupLicensesListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GroupLicensesListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *GrouplicensesListCall) Do() (*GroupLicensesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &GroupLicensesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves IDs of all products for which the enterprise has a group license.", + // "httpMethod": "GET", + // "id": "androidenterprise.grouplicenses.list", + // "parameterOrder": [ + // "enterpriseId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/groupLicenses", + // "response": { + // "$ref": "GroupLicensesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.grouplicenseusers.list": + +type GrouplicenseusersListCall struct { + s *Service + enterpriseId string + groupLicenseId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the IDs of the users who have been granted +// entitlements under the license. +func (r *GrouplicenseusersService) List(enterpriseId string, groupLicenseId string) *GrouplicenseusersListCall { + c := &GrouplicenseusersListCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.groupLicenseId = groupLicenseId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GrouplicenseusersListCall) Fields(s ...googleapi.Field) *GrouplicenseusersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GrouplicenseusersListCall) IfNoneMatch(entityTag string) *GrouplicenseusersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GrouplicenseusersListCall) Context(ctx context.Context) *GrouplicenseusersListCall { + c.ctx_ = ctx + return c +} + +func (c *GrouplicenseusersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}/users") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "groupLicenseId": c.groupLicenseId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.grouplicenseusers.list" call. +// Exactly one of *GroupLicenseUsersListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *GroupLicenseUsersListResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *GrouplicenseusersListCall) Do() (*GroupLicenseUsersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &GroupLicenseUsersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the IDs of the users who have been granted entitlements under the license.", + // "httpMethod": "GET", + // "id": "androidenterprise.grouplicenseusers.list", + // "parameterOrder": [ + // "enterpriseId", + // "groupLicenseId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "groupLicenseId": { + // "description": "The ID of the product the group license is for, e.g. \"app:com.google.android.gm\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}/users", + // "response": { + // "$ref": "GroupLicenseUsersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.installs.delete": + +type InstallsDeleteCall struct { + s *Service + enterpriseId string + userId string + deviceId string + installId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Requests to remove an app from a device. A call to get or +// list will still show the app as installed on the device until it is +// actually removed. +func (r *InstallsService) Delete(enterpriseId string, userId string, deviceId string, installId string) *InstallsDeleteCall { + c := &InstallsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.userId = userId + c.deviceId = deviceId + c.installId = installId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstallsDeleteCall) Fields(s ...googleapi.Field) *InstallsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstallsDeleteCall) Context(ctx context.Context) *InstallsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *InstallsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "userId": c.userId, + "deviceId": c.deviceId, + "installId": c.installId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.installs.delete" call. +func (c *InstallsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Requests to remove an app from a device. A call to get or list will still show the app as installed on the device until it is actually removed.", + // "httpMethod": "DELETE", + // "id": "androidenterprise.installs.delete", + // "parameterOrder": [ + // "enterpriseId", + // "userId", + // "deviceId", + // "installId" + // ], + // "parameters": { + // "deviceId": { + // "description": "The Android ID of the device.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "installId": { + // "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}", + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.installs.get": + +type InstallsGetCall struct { + s *Service + enterpriseId string + userId string + deviceId string + installId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves details of an installation of an app on a device. +func (r *InstallsService) Get(enterpriseId string, userId string, deviceId string, installId string) *InstallsGetCall { + c := &InstallsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.userId = userId + c.deviceId = deviceId + c.installId = installId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstallsGetCall) Fields(s ...googleapi.Field) *InstallsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstallsGetCall) IfNoneMatch(entityTag string) *InstallsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstallsGetCall) Context(ctx context.Context) *InstallsGetCall { + c.ctx_ = ctx + return c +} + +func (c *InstallsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "userId": c.userId, + "deviceId": c.deviceId, + "installId": c.installId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.installs.get" call. +// Exactly one of *Install or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Install.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *InstallsGetCall) Do() (*Install, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Install{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves details of an installation of an app on a device.", + // "httpMethod": "GET", + // "id": "androidenterprise.installs.get", + // "parameterOrder": [ + // "enterpriseId", + // "userId", + // "deviceId", + // "installId" + // ], + // "parameters": { + // "deviceId": { + // "description": "The Android ID of the device.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "installId": { + // "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}", + // "response": { + // "$ref": "Install" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.installs.list": + +type InstallsListCall struct { + s *Service + enterpriseId string + userId string + deviceId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the details of all apps installed on the specified +// device. +func (r *InstallsService) List(enterpriseId string, userId string, deviceId string) *InstallsListCall { + c := &InstallsListCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.userId = userId + c.deviceId = deviceId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstallsListCall) Fields(s ...googleapi.Field) *InstallsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstallsListCall) IfNoneMatch(entityTag string) *InstallsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstallsListCall) Context(ctx context.Context) *InstallsListCall { + c.ctx_ = ctx + return c +} + +func (c *InstallsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "userId": c.userId, + "deviceId": c.deviceId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.installs.list" call. +// Exactly one of *InstallsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *InstallsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstallsListCall) Do() (*InstallsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstallsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the details of all apps installed on the specified device.", + // "httpMethod": "GET", + // "id": "androidenterprise.installs.list", + // "parameterOrder": [ + // "enterpriseId", + // "userId", + // "deviceId" + // ], + // "parameters": { + // "deviceId": { + // "description": "The Android ID of the device.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs", + // "response": { + // "$ref": "InstallsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.installs.patch": + +type InstallsPatchCall struct { + s *Service + enterpriseId string + userId string + deviceId string + installId string + install *Install + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Requests to install the latest version of an app to a device. +// If the app is already installed then it is updated to the latest +// version if necessary. This method supports patch semantics. +func (r *InstallsService) Patch(enterpriseId string, userId string, deviceId string, installId string, install *Install) *InstallsPatchCall { + c := &InstallsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.userId = userId + c.deviceId = deviceId + c.installId = installId + c.install = install + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstallsPatchCall) Fields(s ...googleapi.Field) *InstallsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstallsPatchCall) Context(ctx context.Context) *InstallsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *InstallsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.install) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "userId": c.userId, + "deviceId": c.deviceId, + "installId": c.installId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.installs.patch" call. +// Exactly one of *Install or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Install.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *InstallsPatchCall) Do() (*Install, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Install{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Requests to install the latest version of an app to a device. If the app is already installed then it is updated to the latest version if necessary. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "androidenterprise.installs.patch", + // "parameterOrder": [ + // "enterpriseId", + // "userId", + // "deviceId", + // "installId" + // ], + // "parameters": { + // "deviceId": { + // "description": "The Android ID of the device.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "installId": { + // "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}", + // "request": { + // "$ref": "Install" + // }, + // "response": { + // "$ref": "Install" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.installs.update": + +type InstallsUpdateCall struct { + s *Service + enterpriseId string + userId string + deviceId string + installId string + install *Install + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Requests to install the latest version of an app to a device. +// If the app is already installed then it is updated to the latest +// version if necessary. +func (r *InstallsService) Update(enterpriseId string, userId string, deviceId string, installId string, install *Install) *InstallsUpdateCall { + c := &InstallsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.userId = userId + c.deviceId = deviceId + c.installId = installId + c.install = install + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstallsUpdateCall) Fields(s ...googleapi.Field) *InstallsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstallsUpdateCall) Context(ctx context.Context) *InstallsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *InstallsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.install) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "userId": c.userId, + "deviceId": c.deviceId, + "installId": c.installId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.installs.update" call. +// Exactly one of *Install or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Install.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *InstallsUpdateCall) Do() (*Install, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Install{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Requests to install the latest version of an app to a device. If the app is already installed then it is updated to the latest version if necessary.", + // "httpMethod": "PUT", + // "id": "androidenterprise.installs.update", + // "parameterOrder": [ + // "enterpriseId", + // "userId", + // "deviceId", + // "installId" + // ], + // "parameters": { + // "deviceId": { + // "description": "The Android ID of the device.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "installId": { + // "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}", + // "request": { + // "$ref": "Install" + // }, + // "response": { + // "$ref": "Install" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.permissions.get": + +type PermissionsGetCall struct { + s *Service + permissionId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves details of an Android app permission for display to an +// enterprise admin. +func (r *PermissionsService) Get(permissionId string) *PermissionsGetCall { + c := &PermissionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.permissionId = permissionId + return c +} + +// Language sets the optional parameter "language": The BCP47 tag for +// the user's preferred language (e.g. "en-US", "de") +func (c *PermissionsGetCall) Language(language string) *PermissionsGetCall { + c.opt_["language"] = language + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PermissionsGetCall) Fields(s ...googleapi.Field) *PermissionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PermissionsGetCall) IfNoneMatch(entityTag string) *PermissionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PermissionsGetCall) Context(ctx context.Context) *PermissionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *PermissionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "permissions/{permissionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "permissionId": c.permissionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.permissions.get" call. +// Exactly one of *Permission or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Permission.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PermissionsGetCall) Do() (*Permission, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Permission{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves details of an Android app permission for display to an enterprise admin.", + // "httpMethod": "GET", + // "id": "androidenterprise.permissions.get", + // "parameterOrder": [ + // "permissionId" + // ], + // "parameters": { + // "language": { + // "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\")", + // "location": "query", + // "type": "string" + // }, + // "permissionId": { + // "description": "The ID of the permission.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "permissions/{permissionId}", + // "response": { + // "$ref": "Permission" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.products.approve": + +type ProductsApproveCall struct { + s *Service + enterpriseId string + productId string + productsapproverequest *ProductsApproveRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Approve: Approves the specified product (and the relevant app +// permissions, if any). +func (r *ProductsService) Approve(enterpriseId string, productId string, productsapproverequest *ProductsApproveRequest) *ProductsApproveCall { + c := &ProductsApproveCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.productId = productId + c.productsapproverequest = productsapproverequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProductsApproveCall) Fields(s ...googleapi.Field) *ProductsApproveCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProductsApproveCall) Context(ctx context.Context) *ProductsApproveCall { + c.ctx_ = ctx + return c +} + +func (c *ProductsApproveCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.productsapproverequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/approve") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "productId": c.productId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.products.approve" call. +func (c *ProductsApproveCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Approves the specified product (and the relevant app permissions, if any).", + // "httpMethod": "POST", + // "id": "androidenterprise.products.approve", + // "parameterOrder": [ + // "enterpriseId", + // "productId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "productId": { + // "description": "The ID of the product.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/products/{productId}/approve", + // "request": { + // "$ref": "ProductsApproveRequest" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.products.generateApprovalUrl": + +type ProductsGenerateApprovalUrlCall struct { + s *Service + enterpriseId string + productId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GenerateApprovalUrl: Generates a URL that can be rendered in an +// iframe to display the permissions (if any) of a product. An +// enterprise admin must view these permissions and accept them on +// behalf of their organization in order to approve that +// product. +// +// Admins should accept the displayed permissions by interacting with a +// separate UI element in the EMM console, which in turn should trigger +// the use of this URL as the approvalUrlInfo.approvalUrl property in a +// Products.approve call to approve the product. This URL can only be +// used to display permissions for up to 1 day. +func (r *ProductsService) GenerateApprovalUrl(enterpriseId string, productId string) *ProductsGenerateApprovalUrlCall { + c := &ProductsGenerateApprovalUrlCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.productId = productId + return c +} + +// LanguageCode sets the optional parameter "languageCode": The BCP 47 +// language code used for permission names and descriptions in the +// returned iframe, for instance "en-US". +func (c *ProductsGenerateApprovalUrlCall) LanguageCode(languageCode string) *ProductsGenerateApprovalUrlCall { + c.opt_["languageCode"] = languageCode + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProductsGenerateApprovalUrlCall) Fields(s ...googleapi.Field) *ProductsGenerateApprovalUrlCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProductsGenerateApprovalUrlCall) Context(ctx context.Context) *ProductsGenerateApprovalUrlCall { + c.ctx_ = ctx + return c +} + +func (c *ProductsGenerateApprovalUrlCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["languageCode"]; ok { + params.Set("languageCode", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "productId": c.productId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.products.generateApprovalUrl" call. +// Exactly one of *ProductsGenerateApprovalUrlResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ProductsGenerateApprovalUrlResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProductsGenerateApprovalUrlCall) Do() (*ProductsGenerateApprovalUrlResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProductsGenerateApprovalUrlResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and accept them on behalf of their organization in order to approve that product.\n\nAdmins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display permissions for up to 1 day.", + // "httpMethod": "POST", + // "id": "androidenterprise.products.generateApprovalUrl", + // "parameterOrder": [ + // "enterpriseId", + // "productId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "languageCode": { + // "description": "The BCP 47 language code used for permission names and descriptions in the returned iframe, for instance \"en-US\".", + // "location": "query", + // "type": "string" + // }, + // "productId": { + // "description": "The ID of the product.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl", + // "response": { + // "$ref": "ProductsGenerateApprovalUrlResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.products.get": + +type ProductsGetCall struct { + s *Service + enterpriseId string + productId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves details of a product for display to an enterprise +// admin. +func (r *ProductsService) Get(enterpriseId string, productId string) *ProductsGetCall { + c := &ProductsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.productId = productId + return c +} + +// Language sets the optional parameter "language": The BCP47 tag for +// the user's preferred language (e.g. "en-US", "de"). +func (c *ProductsGetCall) Language(language string) *ProductsGetCall { + c.opt_["language"] = language + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProductsGetCall) Fields(s ...googleapi.Field) *ProductsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProductsGetCall) IfNoneMatch(entityTag string) *ProductsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProductsGetCall) Context(ctx context.Context) *ProductsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProductsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "productId": c.productId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.products.get" call. +// Exactly one of *Product or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Product.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProductsGetCall) Do() (*Product, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Product{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves details of a product for display to an enterprise admin.", + // "httpMethod": "GET", + // "id": "androidenterprise.products.get", + // "parameterOrder": [ + // "enterpriseId", + // "productId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "language": { + // "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\").", + // "location": "query", + // "type": "string" + // }, + // "productId": { + // "description": "The ID of the product, e.g. \"app:com.google.android.gm\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/products/{productId}", + // "response": { + // "$ref": "Product" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.products.getAppRestrictionsSchema": + +type ProductsGetAppRestrictionsSchemaCall struct { + s *Service + enterpriseId string + productId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetAppRestrictionsSchema: Retrieves the schema defining app +// restrictions configurable for this product. All products have a +// schema, but this may be empty if no app restrictions are defined. +func (r *ProductsService) GetAppRestrictionsSchema(enterpriseId string, productId string) *ProductsGetAppRestrictionsSchemaCall { + c := &ProductsGetAppRestrictionsSchemaCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.productId = productId + return c +} + +// Language sets the optional parameter "language": The BCP47 tag for +// the user's preferred language (e.g. "en-US", "de"). +func (c *ProductsGetAppRestrictionsSchemaCall) Language(language string) *ProductsGetAppRestrictionsSchemaCall { + c.opt_["language"] = language + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProductsGetAppRestrictionsSchemaCall) Fields(s ...googleapi.Field) *ProductsGetAppRestrictionsSchemaCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProductsGetAppRestrictionsSchemaCall) IfNoneMatch(entityTag string) *ProductsGetAppRestrictionsSchemaCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProductsGetAppRestrictionsSchemaCall) Context(ctx context.Context) *ProductsGetAppRestrictionsSchemaCall { + c.ctx_ = ctx + return c +} + +func (c *ProductsGetAppRestrictionsSchemaCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/appRestrictionsSchema") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "productId": c.productId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.products.getAppRestrictionsSchema" call. +// Exactly one of *AppRestrictionsSchema or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AppRestrictionsSchema.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProductsGetAppRestrictionsSchemaCall) Do() (*AppRestrictionsSchema, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AppRestrictionsSchema{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the schema defining app restrictions configurable for this product. All products have a schema, but this may be empty if no app restrictions are defined.", + // "httpMethod": "GET", + // "id": "androidenterprise.products.getAppRestrictionsSchema", + // "parameterOrder": [ + // "enterpriseId", + // "productId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "language": { + // "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\").", + // "location": "query", + // "type": "string" + // }, + // "productId": { + // "description": "The ID of the product.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/products/{productId}/appRestrictionsSchema", + // "response": { + // "$ref": "AppRestrictionsSchema" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.products.getPermissions": + +type ProductsGetPermissionsCall struct { + s *Service + enterpriseId string + productId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetPermissions: Retrieves the Android app permissions required by +// this app. +func (r *ProductsService) GetPermissions(enterpriseId string, productId string) *ProductsGetPermissionsCall { + c := &ProductsGetPermissionsCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.productId = productId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProductsGetPermissionsCall) Fields(s ...googleapi.Field) *ProductsGetPermissionsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProductsGetPermissionsCall) IfNoneMatch(entityTag string) *ProductsGetPermissionsCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProductsGetPermissionsCall) Context(ctx context.Context) *ProductsGetPermissionsCall { + c.ctx_ = ctx + return c +} + +func (c *ProductsGetPermissionsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/permissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "productId": c.productId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.products.getPermissions" call. +// Exactly one of *ProductPermissions or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ProductPermissions.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProductsGetPermissionsCall) Do() (*ProductPermissions, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProductPermissions{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the Android app permissions required by this app.", + // "httpMethod": "GET", + // "id": "androidenterprise.products.getPermissions", + // "parameterOrder": [ + // "enterpriseId", + // "productId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "productId": { + // "description": "The ID of the product.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/products/{productId}/permissions", + // "response": { + // "$ref": "ProductPermissions" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.products.updatePermissions": + +type ProductsUpdatePermissionsCall struct { + s *Service + enterpriseId string + productId string + productpermissions *ProductPermissions + opt_ map[string]interface{} + ctx_ context.Context +} + +// UpdatePermissions: Updates the set of Android app permissions for +// this app that have been accepted by the enterprise. +func (r *ProductsService) UpdatePermissions(enterpriseId string, productId string, productpermissions *ProductPermissions) *ProductsUpdatePermissionsCall { + c := &ProductsUpdatePermissionsCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.productId = productId + c.productpermissions = productpermissions + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProductsUpdatePermissionsCall) Fields(s ...googleapi.Field) *ProductsUpdatePermissionsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProductsUpdatePermissionsCall) Context(ctx context.Context) *ProductsUpdatePermissionsCall { + c.ctx_ = ctx + return c +} + +func (c *ProductsUpdatePermissionsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.productpermissions) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/permissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "productId": c.productId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.products.updatePermissions" call. +// Exactly one of *ProductPermissions or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ProductPermissions.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProductsUpdatePermissionsCall) Do() (*ProductPermissions, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProductPermissions{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the set of Android app permissions for this app that have been accepted by the enterprise.", + // "httpMethod": "PUT", + // "id": "androidenterprise.products.updatePermissions", + // "parameterOrder": [ + // "enterpriseId", + // "productId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "productId": { + // "description": "The ID of the product.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/products/{productId}/permissions", + // "request": { + // "$ref": "ProductPermissions" + // }, + // "response": { + // "$ref": "ProductPermissions" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.users.generateToken": + +type UsersGenerateTokenCall struct { + s *Service + enterpriseId string + userId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GenerateToken: Generates a token (activation code) to allow this user +// to configure their work account in the Android Setup Wizard. Revokes +// any previously generated token. +func (r *UsersService) GenerateToken(enterpriseId string, userId string) *UsersGenerateTokenCall { + c := &UsersGenerateTokenCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.userId = userId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersGenerateTokenCall) Fields(s ...googleapi.Field) *UsersGenerateTokenCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersGenerateTokenCall) Context(ctx context.Context) *UsersGenerateTokenCall { + c.ctx_ = ctx + return c +} + +func (c *UsersGenerateTokenCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/token") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.users.generateToken" call. +// Exactly one of *UserToken or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UserToken.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersGenerateTokenCall) Do() (*UserToken, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserToken{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generates a token (activation code) to allow this user to configure their work account in the Android Setup Wizard. Revokes any previously generated token.", + // "httpMethod": "POST", + // "id": "androidenterprise.users.generateToken", + // "parameterOrder": [ + // "enterpriseId", + // "userId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/users/{userId}/token", + // "response": { + // "$ref": "UserToken" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.users.get": + +type UsersGetCall struct { + s *Service + enterpriseId string + userId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves a user's details. +func (r *UsersService) Get(enterpriseId string, userId string) *UsersGetCall { + c := &UsersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.userId = userId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall { + c.ctx_ = ctx + return c +} + +func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.users.get" call. +// Exactly one of *User or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *User.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *UsersGetCall) Do() (*User, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &User{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a user's details.", + // "httpMethod": "GET", + // "id": "androidenterprise.users.get", + // "parameterOrder": [ + // "enterpriseId", + // "userId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/users/{userId}", + // "response": { + // "$ref": "User" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.users.getAvailableProductSet": + +type UsersGetAvailableProductSetCall struct { + s *Service + enterpriseId string + userId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetAvailableProductSet: Retrieves the set of products a user is +// entitled to access. +func (r *UsersService) GetAvailableProductSet(enterpriseId string, userId string) *UsersGetAvailableProductSetCall { + c := &UsersGetAvailableProductSetCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.userId = userId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersGetAvailableProductSetCall) Fields(s ...googleapi.Field) *UsersGetAvailableProductSetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersGetAvailableProductSetCall) IfNoneMatch(entityTag string) *UsersGetAvailableProductSetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersGetAvailableProductSetCall) Context(ctx context.Context) *UsersGetAvailableProductSetCall { + c.ctx_ = ctx + return c +} + +func (c *UsersGetAvailableProductSetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/availableProductSet") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.users.getAvailableProductSet" call. +// Exactly one of *ProductSet or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ProductSet.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersGetAvailableProductSetCall) Do() (*ProductSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProductSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the set of products a user is entitled to access.", + // "httpMethod": "GET", + // "id": "androidenterprise.users.getAvailableProductSet", + // "parameterOrder": [ + // "enterpriseId", + // "userId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/users/{userId}/availableProductSet", + // "response": { + // "$ref": "ProductSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.users.list": + +type UsersListCall struct { + s *Service + enterpriseId string + email string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Looks up a user by email address. +func (r *UsersService) List(enterpriseId string, email string) *UsersListCall { + c := &UsersListCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.email = email + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersListCall) Context(ctx context.Context) *UsersListCall { + c.ctx_ = ctx + return c +} + +func (c *UsersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("email", fmt.Sprintf("%v", c.email)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.users.list" call. +// Exactly one of *UsersListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *UsersListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UsersListCall) Do() (*UsersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UsersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Looks up a user by email address.", + // "httpMethod": "GET", + // "id": "androidenterprise.users.list", + // "parameterOrder": [ + // "enterpriseId", + // "email" + // ], + // "parameters": { + // "email": { + // "description": "The exact primary email address of the user to look up.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/users", + // "response": { + // "$ref": "UsersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.users.revokeToken": + +type UsersRevokeTokenCall struct { + s *Service + enterpriseId string + userId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// RevokeToken: Revokes a previously generated token (activation code) +// for the user. +func (r *UsersService) RevokeToken(enterpriseId string, userId string) *UsersRevokeTokenCall { + c := &UsersRevokeTokenCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.userId = userId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersRevokeTokenCall) Fields(s ...googleapi.Field) *UsersRevokeTokenCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersRevokeTokenCall) Context(ctx context.Context) *UsersRevokeTokenCall { + c.ctx_ = ctx + return c +} + +func (c *UsersRevokeTokenCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/token") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.users.revokeToken" call. +func (c *UsersRevokeTokenCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Revokes a previously generated token (activation code) for the user.", + // "httpMethod": "DELETE", + // "id": "androidenterprise.users.revokeToken", + // "parameterOrder": [ + // "enterpriseId", + // "userId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/users/{userId}/token", + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} + +// method id "androidenterprise.users.setAvailableProductSet": + +type UsersSetAvailableProductSetCall struct { + s *Service + enterpriseId string + userId string + productset *ProductSet + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetAvailableProductSet: Modifies the set of products a user is +// entitled to access. +func (r *UsersService) SetAvailableProductSet(enterpriseId string, userId string, productset *ProductSet) *UsersSetAvailableProductSetCall { + c := &UsersSetAvailableProductSetCall{s: r.s, opt_: make(map[string]interface{})} + c.enterpriseId = enterpriseId + c.userId = userId + c.productset = productset + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersSetAvailableProductSetCall) Fields(s ...googleapi.Field) *UsersSetAvailableProductSetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersSetAvailableProductSetCall) Context(ctx context.Context) *UsersSetAvailableProductSetCall { + c.ctx_ = ctx + return c +} + +func (c *UsersSetAvailableProductSetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.productset) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/availableProductSet") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "enterpriseId": c.enterpriseId, + "userId": c.userId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidenterprise.users.setAvailableProductSet" call. +// Exactly one of *ProductSet or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ProductSet.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersSetAvailableProductSetCall) Do() (*ProductSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProductSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Modifies the set of products a user is entitled to access.", + // "httpMethod": "PUT", + // "id": "androidenterprise.users.setAvailableProductSet", + // "parameterOrder": [ + // "enterpriseId", + // "userId" + // ], + // "parameters": { + // "enterpriseId": { + // "description": "The ID of the enterprise.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "The ID of the user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "enterprises/{enterpriseId}/users/{userId}/availableProductSet", + // "request": { + // "$ref": "ProductSet" + // }, + // "response": { + // "$ref": "ProductSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidenterprise" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/androidpublisher/v1.1/androidpublisher-api.json b/Godeps/_workspace/src/google.golang.org/api/androidpublisher/v1.1/androidpublisher-api.json new file mode 100644 index 000000000..372070ccf --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/androidpublisher/v1.1/androidpublisher-api.json @@ -0,0 +1,256 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/yLZNoMooQ7qHvZwtvucNfre7PCU\"", + "discoveryVersion": "v1", + "id": "androidpublisher:v1.1", + "name": "androidpublisher", + "canonicalName": "Android Publisher", + "version": "v1.1", + "revision": "20150323", + "title": "Google Play Developer API", + "description": "Lets Android application developers access their Google Play accounts.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/android-16.png", + "x32": "https://www.google.com/images/icons/product/android-32.png" + }, + "documentationLink": "https://developers.google.com/android-publisher", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/androidpublisher/v1.1/applications/", + "basePath": "/androidpublisher/v1.1/applications/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "androidpublisher/v1.1/applications/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json" + ], + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.", + "location": "query" + }, + "userIp": { + "type": "string", + "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.", + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/androidpublisher": { + "description": "View and manage your Google Play Developer account" + } + } + } + }, + "schemas": { + "InappPurchase": { + "id": "InappPurchase", + "type": "object", + "description": "An InappPurchase resource indicates the status of a user's inapp product purchase.", + "properties": { + "consumptionState": { + "type": "integer", + "description": "The consumption state of the inapp product. Possible values are: \n- Yet to be consumed \n- Consumed", + "format": "int32" + }, + "developerPayload": { + "type": "string", + "description": "A developer-specified string that contains supplemental information about an order." + }, + "kind": { + "type": "string", + "description": "This kind represents an inappPurchase object in the androidpublisher service.", + "default": "androidpublisher#inappPurchase" + }, + "purchaseState": { + "type": "integer", + "description": "The purchase state of the order. Possible values are: \n- Purchased \n- Cancelled", + "format": "int32" + }, + "purchaseTime": { + "type": "string", + "description": "The time the product was purchased, in milliseconds since the epoch (Jan 1, 1970).", + "format": "int64" + } + } + }, + "SubscriptionPurchase": { + "id": "SubscriptionPurchase", + "type": "object", + "description": "A SubscriptionPurchase resource indicates the status of a user's subscription purchase.", + "properties": { + "autoRenewing": { + "type": "boolean", + "description": "Whether the subscription will automatically be renewed when it reaches its current expiry time." + }, + "initiationTimestampMsec": { + "type": "string", + "description": "Time at which the subscription was granted, in milliseconds since Epoch.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "This kind represents a subscriptionPurchase object in the androidpublisher service.", + "default": "androidpublisher#subscriptionPurchase" + }, + "validUntilTimestampMsec": { + "type": "string", + "description": "Time at which the subscription will expire, in milliseconds since Epoch.", + "format": "int64" + } + } + } + }, + "resources": { + "inapppurchases": { + "methods": { + "get": { + "id": "androidpublisher.inapppurchases.get", + "path": "{packageName}/inapp/{productId}/purchases/{token}", + "httpMethod": "GET", + "description": "Checks the purchase and consumption status of an inapp item.", + "parameters": { + "packageName": { + "type": "string", + "description": "The package name of the application the inapp product was sold in (for example, 'com.some.thing').", + "required": true, + "location": "path" + }, + "productId": { + "type": "string", + "description": "The inapp product SKU (for example, 'com.some.thing.inapp1').", + "required": true, + "location": "path" + }, + "token": { + "type": "string", + "description": "The token provided to the user's device when the inapp product was purchased.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "productId", + "token" + ], + "response": { + "$ref": "InappPurchase" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + } + } + }, + "purchases": { + "methods": { + "cancel": { + "id": "androidpublisher.purchases.cancel", + "path": "{packageName}/subscriptions/{subscriptionId}/purchases/{token}/cancel", + "httpMethod": "POST", + "description": "Cancels a user's subscription purchase. The subscription remains valid until its expiration time.", + "parameters": { + "packageName": { + "type": "string", + "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').", + "required": true, + "location": "path" + }, + "subscriptionId": { + "type": "string", + "description": "The purchased subscription ID (for example, 'monthly001').", + "required": true, + "location": "path" + }, + "token": { + "type": "string", + "description": "The token provided to the user's device when the subscription was purchased.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "subscriptionId", + "token" + ], + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "get": { + "id": "androidpublisher.purchases.get", + "path": "{packageName}/subscriptions/{subscriptionId}/purchases/{token}", + "httpMethod": "GET", + "description": "Checks whether a user's subscription purchase is valid and returns its expiry time.", + "parameters": { + "packageName": { + "type": "string", + "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').", + "required": true, + "location": "path" + }, + "subscriptionId": { + "type": "string", + "description": "The purchased subscription ID (for example, 'monthly001').", + "required": true, + "location": "path" + }, + "token": { + "type": "string", + "description": "The token provided to the user's device when the subscription was purchased.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "subscriptionId", + "token" + ], + "response": { + "$ref": "SubscriptionPurchase" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/androidpublisher/v1.1/androidpublisher-gen.go b/Godeps/_workspace/src/google.golang.org/api/androidpublisher/v1.1/androidpublisher-gen.go new file mode 100644 index 000000000..ca55607a6 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/androidpublisher/v1.1/androidpublisher-gen.go @@ -0,0 +1,581 @@ +// Package androidpublisher provides access to the Google Play Developer API. +// +// See https://developers.google.com/android-publisher +// +// Usage example: +// +// import "google.golang.org/api/androidpublisher/v1.1" +// ... +// androidpublisherService, err := androidpublisher.New(oauthHttpClient) +package androidpublisher // import "google.golang.org/api/androidpublisher/v1.1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "androidpublisher:v1.1" +const apiName = "androidpublisher" +const apiVersion = "v1.1" +const basePath = "https://www.googleapis.com/androidpublisher/v1.1/applications/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your Google Play Developer account + AndroidpublisherScope = "https://www.googleapis.com/auth/androidpublisher" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Inapppurchases = NewInapppurchasesService(s) + s.Purchases = NewPurchasesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Inapppurchases *InapppurchasesService + + Purchases *PurchasesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewInapppurchasesService(s *Service) *InapppurchasesService { + rs := &InapppurchasesService{s: s} + return rs +} + +type InapppurchasesService struct { + s *Service +} + +func NewPurchasesService(s *Service) *PurchasesService { + rs := &PurchasesService{s: s} + return rs +} + +type PurchasesService struct { + s *Service +} + +// InappPurchase: An InappPurchase resource indicates the status of a +// user's inapp product purchase. +type InappPurchase struct { + // ConsumptionState: The consumption state of the inapp product. + // Possible values are: + // - Yet to be consumed + // - Consumed + ConsumptionState int64 `json:"consumptionState,omitempty"` + + // DeveloperPayload: A developer-specified string that contains + // supplemental information about an order. + DeveloperPayload string `json:"developerPayload,omitempty"` + + // Kind: This kind represents an inappPurchase object in the + // androidpublisher service. + Kind string `json:"kind,omitempty"` + + // PurchaseState: The purchase state of the order. Possible values are: + // + // - Purchased + // - Cancelled + PurchaseState int64 `json:"purchaseState,omitempty"` + + // PurchaseTime: The time the product was purchased, in milliseconds + // since the epoch (Jan 1, 1970). + PurchaseTime int64 `json:"purchaseTime,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ConsumptionState") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InappPurchase) MarshalJSON() ([]byte, error) { + type noMethod InappPurchase + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SubscriptionPurchase: A SubscriptionPurchase resource indicates the +// status of a user's subscription purchase. +type SubscriptionPurchase struct { + // AutoRenewing: Whether the subscription will automatically be renewed + // when it reaches its current expiry time. + AutoRenewing bool `json:"autoRenewing,omitempty"` + + // InitiationTimestampMsec: Time at which the subscription was granted, + // in milliseconds since Epoch. + InitiationTimestampMsec int64 `json:"initiationTimestampMsec,omitempty,string"` + + // Kind: This kind represents a subscriptionPurchase object in the + // androidpublisher service. + Kind string `json:"kind,omitempty"` + + // ValidUntilTimestampMsec: Time at which the subscription will expire, + // in milliseconds since Epoch. + ValidUntilTimestampMsec int64 `json:"validUntilTimestampMsec,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AutoRenewing") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SubscriptionPurchase) MarshalJSON() ([]byte, error) { + type noMethod SubscriptionPurchase + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "androidpublisher.inapppurchases.get": + +type InapppurchasesGetCall struct { + s *Service + packageName string + productId string + token string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Checks the purchase and consumption status of an inapp item. +func (r *InapppurchasesService) Get(packageName string, productId string, token string) *InapppurchasesGetCall { + c := &InapppurchasesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.packageName = packageName + c.productId = productId + c.token = token + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InapppurchasesGetCall) Fields(s ...googleapi.Field) *InapppurchasesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InapppurchasesGetCall) IfNoneMatch(entityTag string) *InapppurchasesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InapppurchasesGetCall) Context(ctx context.Context) *InapppurchasesGetCall { + c.ctx_ = ctx + return c +} + +func (c *InapppurchasesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inapp/{productId}/purchases/{token}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "productId": c.productId, + "token": c.token, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.inapppurchases.get" call. +// Exactly one of *InappPurchase or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *InappPurchase.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InapppurchasesGetCall) Do() (*InappPurchase, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InappPurchase{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Checks the purchase and consumption status of an inapp item.", + // "httpMethod": "GET", + // "id": "androidpublisher.inapppurchases.get", + // "parameterOrder": [ + // "packageName", + // "productId", + // "token" + // ], + // "parameters": { + // "packageName": { + // "description": "The package name of the application the inapp product was sold in (for example, 'com.some.thing').", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "productId": { + // "description": "The inapp product SKU (for example, 'com.some.thing.inapp1').", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "token": { + // "description": "The token provided to the user's device when the inapp product was purchased.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/inapp/{productId}/purchases/{token}", + // "response": { + // "$ref": "InappPurchase" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.purchases.cancel": + +type PurchasesCancelCall struct { + s *Service + packageName string + subscriptionId string + token string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Cancel: Cancels a user's subscription purchase. The subscription +// remains valid until its expiration time. +func (r *PurchasesService) Cancel(packageName string, subscriptionId string, token string) *PurchasesCancelCall { + c := &PurchasesCancelCall{s: r.s, opt_: make(map[string]interface{})} + c.packageName = packageName + c.subscriptionId = subscriptionId + c.token = token + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PurchasesCancelCall) Fields(s ...googleapi.Field) *PurchasesCancelCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PurchasesCancelCall) Context(ctx context.Context) *PurchasesCancelCall { + c.ctx_ = ctx + return c +} + +func (c *PurchasesCancelCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/subscriptions/{subscriptionId}/purchases/{token}/cancel") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "subscriptionId": c.subscriptionId, + "token": c.token, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.purchases.cancel" call. +func (c *PurchasesCancelCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Cancels a user's subscription purchase. The subscription remains valid until its expiration time.", + // "httpMethod": "POST", + // "id": "androidpublisher.purchases.cancel", + // "parameterOrder": [ + // "packageName", + // "subscriptionId", + // "token" + // ], + // "parameters": { + // "packageName": { + // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "subscriptionId": { + // "description": "The purchased subscription ID (for example, 'monthly001').", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "token": { + // "description": "The token provided to the user's device when the subscription was purchased.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/subscriptions/{subscriptionId}/purchases/{token}/cancel", + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.purchases.get": + +type PurchasesGetCall struct { + s *Service + packageName string + subscriptionId string + token string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Checks whether a user's subscription purchase is valid and +// returns its expiry time. +func (r *PurchasesService) Get(packageName string, subscriptionId string, token string) *PurchasesGetCall { + c := &PurchasesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.packageName = packageName + c.subscriptionId = subscriptionId + c.token = token + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PurchasesGetCall) Fields(s ...googleapi.Field) *PurchasesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PurchasesGetCall) IfNoneMatch(entityTag string) *PurchasesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PurchasesGetCall) Context(ctx context.Context) *PurchasesGetCall { + c.ctx_ = ctx + return c +} + +func (c *PurchasesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/subscriptions/{subscriptionId}/purchases/{token}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "subscriptionId": c.subscriptionId, + "token": c.token, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.purchases.get" call. +// Exactly one of *SubscriptionPurchase or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SubscriptionPurchase.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PurchasesGetCall) Do() (*SubscriptionPurchase, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SubscriptionPurchase{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Checks whether a user's subscription purchase is valid and returns its expiry time.", + // "httpMethod": "GET", + // "id": "androidpublisher.purchases.get", + // "parameterOrder": [ + // "packageName", + // "subscriptionId", + // "token" + // ], + // "parameters": { + // "packageName": { + // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "subscriptionId": { + // "description": "The purchased subscription ID (for example, 'monthly001').", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "token": { + // "description": "The token provided to the user's device when the subscription was purchased.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/subscriptions/{subscriptionId}/purchases/{token}", + // "response": { + // "$ref": "SubscriptionPurchase" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/androidpublisher/v1/androidpublisher-api.json b/Godeps/_workspace/src/google.golang.org/api/androidpublisher/v1/androidpublisher-api.json new file mode 100644 index 000000000..d0d65ec89 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/androidpublisher/v1/androidpublisher-api.json @@ -0,0 +1,184 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/JGynskXPDYAm7HfLDYPma5VcVjE\"", + "discoveryVersion": "v1", + "id": "androidpublisher:v1", + "name": "androidpublisher", + "canonicalName": "Android Publisher", + "version": "v1", + "revision": "20150323", + "title": "Google Play Developer API", + "description": "Lets Android application developers access their Google Play accounts.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/android-16.png", + "x32": "https://www.google.com/images/icons/product/android-32.png" + }, + "documentationLink": "https://developers.google.com/android-publisher", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/androidpublisher/v1/applications/", + "basePath": "/androidpublisher/v1/applications/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "androidpublisher/v1/applications/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json" + ], + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.", + "location": "query" + }, + "userIp": { + "type": "string", + "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.", + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/androidpublisher": { + "description": "View and manage your Google Play Developer account" + } + } + } + }, + "schemas": { + "SubscriptionPurchase": { + "id": "SubscriptionPurchase", + "type": "object", + "description": "A SubscriptionPurchase resource indicates the status of a user's subscription purchase.", + "properties": { + "autoRenewing": { + "type": "boolean", + "description": "Whether the subscription will automatically be renewed when it reaches its current expiry time." + }, + "initiationTimestampMsec": { + "type": "string", + "description": "Time at which the subscription was granted, in milliseconds since Epoch.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "This kind represents a subscriptionPurchase object in the androidpublisher service.", + "default": "androidpublisher#subscriptionPurchase" + }, + "validUntilTimestampMsec": { + "type": "string", + "description": "Time at which the subscription will expire, in milliseconds since Epoch.", + "format": "int64" + } + } + } + }, + "resources": { + "purchases": { + "methods": { + "cancel": { + "id": "androidpublisher.purchases.cancel", + "path": "{packageName}/subscriptions/{subscriptionId}/purchases/{token}/cancel", + "httpMethod": "POST", + "description": "Cancels a user's subscription purchase. The subscription remains valid until its expiration time.", + "parameters": { + "packageName": { + "type": "string", + "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').", + "required": true, + "location": "path" + }, + "subscriptionId": { + "type": "string", + "description": "The purchased subscription ID (for example, 'monthly001').", + "required": true, + "location": "path" + }, + "token": { + "type": "string", + "description": "The token provided to the user's device when the subscription was purchased.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "subscriptionId", + "token" + ], + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "get": { + "id": "androidpublisher.purchases.get", + "path": "{packageName}/subscriptions/{subscriptionId}/purchases/{token}", + "httpMethod": "GET", + "description": "Checks whether a user's subscription purchase is valid and returns its expiry time.", + "parameters": { + "packageName": { + "type": "string", + "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').", + "required": true, + "location": "path" + }, + "subscriptionId": { + "type": "string", + "description": "The purchased subscription ID (for example, 'monthly001').", + "required": true, + "location": "path" + }, + "token": { + "type": "string", + "description": "The token provided to the user's device when the subscription was purchased.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "subscriptionId", + "token" + ], + "response": { + "$ref": "SubscriptionPurchase" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/androidpublisher/v1/androidpublisher-gen.go b/Godeps/_workspace/src/google.golang.org/api/androidpublisher/v1/androidpublisher-gen.go new file mode 100644 index 000000000..f2f532118 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/androidpublisher/v1/androidpublisher-gen.go @@ -0,0 +1,377 @@ +// Package androidpublisher provides access to the Google Play Developer API. +// +// See https://developers.google.com/android-publisher +// +// Usage example: +// +// import "google.golang.org/api/androidpublisher/v1" +// ... +// androidpublisherService, err := androidpublisher.New(oauthHttpClient) +package androidpublisher // import "google.golang.org/api/androidpublisher/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "androidpublisher:v1" +const apiName = "androidpublisher" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/androidpublisher/v1/applications/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your Google Play Developer account + AndroidpublisherScope = "https://www.googleapis.com/auth/androidpublisher" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Purchases = NewPurchasesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Purchases *PurchasesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewPurchasesService(s *Service) *PurchasesService { + rs := &PurchasesService{s: s} + return rs +} + +type PurchasesService struct { + s *Service +} + +// SubscriptionPurchase: A SubscriptionPurchase resource indicates the +// status of a user's subscription purchase. +type SubscriptionPurchase struct { + // AutoRenewing: Whether the subscription will automatically be renewed + // when it reaches its current expiry time. + AutoRenewing bool `json:"autoRenewing,omitempty"` + + // InitiationTimestampMsec: Time at which the subscription was granted, + // in milliseconds since Epoch. + InitiationTimestampMsec int64 `json:"initiationTimestampMsec,omitempty,string"` + + // Kind: This kind represents a subscriptionPurchase object in the + // androidpublisher service. + Kind string `json:"kind,omitempty"` + + // ValidUntilTimestampMsec: Time at which the subscription will expire, + // in milliseconds since Epoch. + ValidUntilTimestampMsec int64 `json:"validUntilTimestampMsec,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AutoRenewing") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SubscriptionPurchase) MarshalJSON() ([]byte, error) { + type noMethod SubscriptionPurchase + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "androidpublisher.purchases.cancel": + +type PurchasesCancelCall struct { + s *Service + packageName string + subscriptionId string + token string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Cancel: Cancels a user's subscription purchase. The subscription +// remains valid until its expiration time. +func (r *PurchasesService) Cancel(packageName string, subscriptionId string, token string) *PurchasesCancelCall { + c := &PurchasesCancelCall{s: r.s, opt_: make(map[string]interface{})} + c.packageName = packageName + c.subscriptionId = subscriptionId + c.token = token + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PurchasesCancelCall) Fields(s ...googleapi.Field) *PurchasesCancelCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PurchasesCancelCall) Context(ctx context.Context) *PurchasesCancelCall { + c.ctx_ = ctx + return c +} + +func (c *PurchasesCancelCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/subscriptions/{subscriptionId}/purchases/{token}/cancel") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "subscriptionId": c.subscriptionId, + "token": c.token, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.purchases.cancel" call. +func (c *PurchasesCancelCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Cancels a user's subscription purchase. The subscription remains valid until its expiration time.", + // "httpMethod": "POST", + // "id": "androidpublisher.purchases.cancel", + // "parameterOrder": [ + // "packageName", + // "subscriptionId", + // "token" + // ], + // "parameters": { + // "packageName": { + // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "subscriptionId": { + // "description": "The purchased subscription ID (for example, 'monthly001').", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "token": { + // "description": "The token provided to the user's device when the subscription was purchased.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/subscriptions/{subscriptionId}/purchases/{token}/cancel", + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.purchases.get": + +type PurchasesGetCall struct { + s *Service + packageName string + subscriptionId string + token string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Checks whether a user's subscription purchase is valid and +// returns its expiry time. +func (r *PurchasesService) Get(packageName string, subscriptionId string, token string) *PurchasesGetCall { + c := &PurchasesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.packageName = packageName + c.subscriptionId = subscriptionId + c.token = token + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PurchasesGetCall) Fields(s ...googleapi.Field) *PurchasesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PurchasesGetCall) IfNoneMatch(entityTag string) *PurchasesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PurchasesGetCall) Context(ctx context.Context) *PurchasesGetCall { + c.ctx_ = ctx + return c +} + +func (c *PurchasesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/subscriptions/{subscriptionId}/purchases/{token}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "subscriptionId": c.subscriptionId, + "token": c.token, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.purchases.get" call. +// Exactly one of *SubscriptionPurchase or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SubscriptionPurchase.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PurchasesGetCall) Do() (*SubscriptionPurchase, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SubscriptionPurchase{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Checks whether a user's subscription purchase is valid and returns its expiry time.", + // "httpMethod": "GET", + // "id": "androidpublisher.purchases.get", + // "parameterOrder": [ + // "packageName", + // "subscriptionId", + // "token" + // ], + // "parameters": { + // "packageName": { + // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "subscriptionId": { + // "description": "The purchased subscription ID (for example, 'monthly001').", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "token": { + // "description": "The token provided to the user's device when the subscription was purchased.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/subscriptions/{subscriptionId}/purchases/{token}", + // "response": { + // "$ref": "SubscriptionPurchase" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/androidpublisher/v2/androidpublisher-api.json b/Godeps/_workspace/src/google.golang.org/api/androidpublisher/v2/androidpublisher-api.json new file mode 100644 index 000000000..cb6917692 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/androidpublisher/v2/androidpublisher-api.json @@ -0,0 +1,3071 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/QvChBL9zzkcDEEIqZpwPMr9_TRs\"", + "discoveryVersion": "v1", + "id": "androidpublisher:v2", + "name": "androidpublisher", + "canonicalName": "Android Publisher", + "version": "v2", + "revision": "20150910", + "title": "Google Play Developer API", + "description": "Lets Android application developers access their Google Play accounts.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/android-16.png", + "x32": "https://www.google.com/images/icons/product/android-32.png" + }, + "documentationLink": "https://developers.google.com/android-publisher", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/androidpublisher/v2/applications/", + "basePath": "/androidpublisher/v2/applications/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "androidpublisher/v2/applications/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json" + ], + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.", + "location": "query" + }, + "userIp": { + "type": "string", + "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.", + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/androidpublisher": { + "description": "View and manage your Google Play Developer account" + } + } + } + }, + "schemas": { + "Apk": { + "id": "Apk", + "type": "object", + "properties": { + "binary": { + "$ref": "ApkBinary", + "description": "Information about the binary payload of this APK." + }, + "versionCode": { + "type": "integer", + "description": "The version code of the APK, as specified in the APK's manifest file.", + "format": "int32" + } + } + }, + "ApkBinary": { + "id": "ApkBinary", + "type": "object", + "description": "Represents the binary payload of an APK.", + "properties": { + "sha1": { + "type": "string", + "description": "A sha1 hash of the APK payload, encoded as a hex string and matching the output of the sha1sum command." + } + } + }, + "ApkListing": { + "id": "ApkListing", + "type": "object", + "properties": { + "language": { + "type": "string", + "description": "The language code, in BCP 47 format (eg \"en-US\")." + }, + "recentChanges": { + "type": "string", + "description": "Describe what's new in your APK." + } + } + }, + "ApkListingsListResponse": { + "id": "ApkListingsListResponse", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidpublisher#apkListingsListResponse\".", + "default": "androidpublisher#apkListingsListResponse" + }, + "listings": { + "type": "array", + "items": { + "$ref": "ApkListing" + } + } + } + }, + "ApksAddExternallyHostedRequest": { + "id": "ApksAddExternallyHostedRequest", + "type": "object", + "properties": { + "externallyHostedApk": { + "$ref": "ExternallyHostedApk", + "description": "The definition of the externally-hosted APK and where it is located." + } + } + }, + "ApksAddExternallyHostedResponse": { + "id": "ApksAddExternallyHostedResponse", + "type": "object", + "properties": { + "externallyHostedApk": { + "$ref": "ExternallyHostedApk", + "description": "The definition of the externally-hosted APK and where it is located." + } + } + }, + "ApksListResponse": { + "id": "ApksListResponse", + "type": "object", + "properties": { + "apks": { + "type": "array", + "items": { + "$ref": "Apk" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidpublisher#apksListResponse\".", + "default": "androidpublisher#apksListResponse" + } + } + }, + "AppDetails": { + "id": "AppDetails", + "type": "object", + "properties": { + "contactEmail": { + "type": "string", + "description": "The user-visible support email for this app." + }, + "contactPhone": { + "type": "string", + "description": "The user-visible support telephone number for this app." + }, + "contactWebsite": { + "type": "string", + "description": "The user-visible website for this app." + }, + "defaultLanguage": { + "type": "string", + "description": "Default language code, in BCP 47 format (eg \"en-US\")." + } + } + }, + "AppEdit": { + "id": "AppEdit", + "type": "object", + "description": "Represents an edit of an app. An edit allows clients to make multiple changes before committing them in one operation.", + "properties": { + "expiryTimeSeconds": { + "type": "string", + "description": "The time at which the edit will expire and will be no longer valid for use in any subsequent API calls (encoded as seconds since the Epoch)." + }, + "id": { + "type": "string", + "description": "The ID of the edit that can be used in subsequent API calls." + } + } + }, + "Entitlement": { + "id": "Entitlement", + "type": "object", + "description": "An Entitlement resource indicates a user's current entitlement to an inapp item or subscription.", + "properties": { + "kind": { + "type": "string", + "description": "This kind represents an entitlement object in the androidpublisher service.", + "default": "androidpublisher#entitlement" + }, + "productId": { + "type": "string", + "description": "The SKU of the product." + }, + "productType": { + "type": "string", + "description": "The type of the inapp product. Possible values are: \n- In-app item: \"inapp\" \n- Subscription: \"subs\"" + }, + "token": { + "type": "string", + "description": "The token which can be verified using the subscriptions or products API." + } + } + }, + "EntitlementsListResponse": { + "id": "EntitlementsListResponse", + "type": "object", + "properties": { + "pageInfo": { + "$ref": "PageInfo" + }, + "resources": { + "type": "array", + "items": { + "$ref": "Entitlement" + } + }, + "tokenPagination": { + "$ref": "TokenPagination" + } + } + }, + "ExpansionFile": { + "id": "ExpansionFile", + "type": "object", + "properties": { + "fileSize": { + "type": "string", + "description": "If set this field indicates that this APK has an Expansion File uploaded to it: this APK does not reference another APK's Expansion File. The field's value is the size of the uploaded Expansion File in bytes.", + "format": "int64" + }, + "referencesVersion": { + "type": "integer", + "description": "If set this APK's Expansion File references another APK's Expansion File. The file_size field will not be set.", + "format": "int32" + } + } + }, + "ExpansionFilesUploadResponse": { + "id": "ExpansionFilesUploadResponse", + "type": "object", + "properties": { + "expansionFile": { + "$ref": "ExpansionFile" + } + } + }, + "ExternallyHostedApk": { + "id": "ExternallyHostedApk", + "type": "object", + "description": "Defines an APK available for this application that is hosted externally and not uploaded to Google Play. This function is only available to enterprises who are using Google Play for Work, and whos application is restricted to the enterprise private channel", + "properties": { + "applicationLabel": { + "type": "string", + "description": "The application label." + }, + "certificateBase64s": { + "type": "array", + "description": "A certificate (or array of certificates if a certificate-chain is used) used to signed this APK, represented as a base64 encoded byte array.", + "items": { + "type": "string" + } + }, + "externallyHostedUrl": { + "type": "string", + "description": "The URL at which the APK is hosted. This must be an https URL." + }, + "fileSha1Base64": { + "type": "string", + "description": "The SHA1 checksum of this APK, represented as a base64 encoded byte array." + }, + "fileSha256Base64": { + "type": "string", + "description": "The SHA256 checksum of this APK, represented as a base64 encoded byte array." + }, + "fileSize": { + "type": "string", + "description": "The file size in bytes of this APK.", + "format": "int64" + }, + "iconBase64": { + "type": "string", + "description": "The icon image from the APK, as a base64 encoded byte array." + }, + "maximumSdk": { + "type": "integer", + "description": "The maximum SDK supported by this APK (optional).", + "format": "int32" + }, + "minimumSdk": { + "type": "integer", + "description": "The minimum SDK targeted by this APK.", + "format": "int32" + }, + "nativeCodes": { + "type": "array", + "description": "The native code environments supported by this APK (optional).", + "items": { + "type": "string" + } + }, + "packageName": { + "type": "string", + "description": "The package name." + }, + "usesFeatures": { + "type": "array", + "description": "The features required by this APK (optional).", + "items": { + "type": "string" + } + }, + "usesPermissions": { + "type": "array", + "description": "The permissions requested by this APK.", + "items": { + "$ref": "ExternallyHostedApkUsesPermission" + } + }, + "versionCode": { + "type": "integer", + "description": "The version code of this APK.", + "format": "int32" + }, + "versionName": { + "type": "string", + "description": "The version name of this APK." + } + } + }, + "ExternallyHostedApkUsesPermission": { + "id": "ExternallyHostedApkUsesPermission", + "type": "object", + "description": "A permission used by this APK.", + "properties": { + "maxSdkVersion": { + "type": "integer", + "description": "Optionally, the maximum SDK version for which the permission is required.", + "format": "int32" + }, + "name": { + "type": "string", + "description": "The name of the permission requested." + } + } + }, + "Image": { + "id": "Image", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "A unique id representing this image." + }, + "sha1": { + "type": "string", + "description": "A sha1 hash of the image that was uploaded." + }, + "url": { + "type": "string", + "description": "A URL that will serve a preview of the image." + } + } + }, + "ImagesDeleteAllResponse": { + "id": "ImagesDeleteAllResponse", + "type": "object", + "properties": { + "deleted": { + "type": "array", + "items": { + "$ref": "Image" + } + } + } + }, + "ImagesListResponse": { + "id": "ImagesListResponse", + "type": "object", + "properties": { + "images": { + "type": "array", + "items": { + "$ref": "Image" + } + } + } + }, + "ImagesUploadResponse": { + "id": "ImagesUploadResponse", + "type": "object", + "properties": { + "image": { + "$ref": "Image" + } + } + }, + "InAppProduct": { + "id": "InAppProduct", + "type": "object", + "properties": { + "defaultLanguage": { + "type": "string", + "description": "The default language of the localized data, as defined by BCP 47. e.g. \"en-US\", \"en-GB\"." + }, + "defaultPrice": { + "$ref": "Price", + "description": "Default price cannot be zero. In-app products can never be free. Default price is always in the developer's Checkout merchant currency." + }, + "listings": { + "type": "object", + "description": "List of localized title and description data.", + "additionalProperties": { + "$ref": "InAppProductListing", + "description": "The language of the localized data, as defined by BCP 47. i.e.: \"en-US\", \"en-GB\"." + } + }, + "packageName": { + "type": "string", + "description": "The package name of the parent app." + }, + "prices": { + "type": "object", + "description": "Prices per buyer region. None of these prices should be zero. In-app products can never be free.", + "additionalProperties": { + "$ref": "Price", + "description": "Region code, as defined by ISO 3166-2." + } + }, + "purchaseType": { + "type": "string", + "description": "Purchase type enum value. Unmodifiable after creation." + }, + "season": { + "$ref": "Season", + "description": "Definition of a season for a seasonal subscription. Can be defined only for yearly subscriptions." + }, + "sku": { + "type": "string", + "description": "The stock-keeping-unit (SKU) of the product, unique within an app." + }, + "status": { + "type": "string" + }, + "subscriptionPeriod": { + "type": "string", + "description": "Subscription period, specified in ISO 8601 format. Acceptable values are \"P1W\" (one week), \"P1M\" (one month) and \"P1Y\" (one year)." + }, + "trialPeriod": { + "type": "string", + "description": "Trial period, specified in ISO 8601 format. Acceptable values are anything between \"P7D\" (seven days) and \"P999D\" (999 days). Seasonal subscriptions cannot have a trial period." + } + } + }, + "InAppProductListing": { + "id": "InAppProductListing", + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "title": { + "type": "string" + } + } + }, + "InappproductsBatchRequest": { + "id": "InappproductsBatchRequest", + "type": "object", + "properties": { + "entrys": { + "type": "array", + "items": { + "$ref": "InappproductsBatchRequestEntry" + } + } + } + }, + "InappproductsBatchRequestEntry": { + "id": "InappproductsBatchRequestEntry", + "type": "object", + "properties": { + "batchId": { + "type": "integer", + "format": "uint32" + }, + "inappproductsinsertrequest": { + "$ref": "InappproductsInsertRequest" + }, + "inappproductsupdaterequest": { + "$ref": "InappproductsUpdateRequest" + }, + "methodName": { + "type": "string" + } + } + }, + "InappproductsBatchResponse": { + "id": "InappproductsBatchResponse", + "type": "object", + "properties": { + "entrys": { + "type": "array", + "items": { + "$ref": "InappproductsBatchResponseEntry" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidpublisher#inappproductsBatchResponse\".", + "default": "androidpublisher#inappproductsBatchResponse" + } + } + }, + "InappproductsBatchResponseEntry": { + "id": "InappproductsBatchResponseEntry", + "type": "object", + "properties": { + "batchId": { + "type": "integer", + "format": "uint32" + }, + "inappproductsinsertresponse": { + "$ref": "InappproductsInsertResponse" + }, + "inappproductsupdateresponse": { + "$ref": "InappproductsUpdateResponse" + } + } + }, + "InappproductsInsertRequest": { + "id": "InappproductsInsertRequest", + "type": "object", + "properties": { + "inappproduct": { + "$ref": "InAppProduct" + } + } + }, + "InappproductsInsertResponse": { + "id": "InappproductsInsertResponse", + "type": "object", + "properties": { + "inappproduct": { + "$ref": "InAppProduct" + } + } + }, + "InappproductsListResponse": { + "id": "InappproductsListResponse", + "type": "object", + "properties": { + "inappproduct": { + "type": "array", + "items": { + "$ref": "InAppProduct" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidpublisher#inappproductsListResponse\".", + "default": "androidpublisher#inappproductsListResponse" + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "tokenPagination": { + "$ref": "TokenPagination" + } + } + }, + "InappproductsUpdateRequest": { + "id": "InappproductsUpdateRequest", + "type": "object", + "properties": { + "inappproduct": { + "$ref": "InAppProduct" + } + } + }, + "InappproductsUpdateResponse": { + "id": "InappproductsUpdateResponse", + "type": "object", + "properties": { + "inappproduct": { + "$ref": "InAppProduct" + } + } + }, + "Listing": { + "id": "Listing", + "type": "object", + "properties": { + "fullDescription": { + "type": "string", + "description": "Full description of the app; this may be up to 4000 characters in length." + }, + "language": { + "type": "string", + "description": "Language localization code (for example, \"de-AT\" for Austrian German)." + }, + "shortDescription": { + "type": "string", + "description": "Short description of the app (previously known as promo text); this may be up to 80 characters in length." + }, + "title": { + "type": "string", + "description": "App's localized title." + }, + "video": { + "type": "string", + "description": "URL of a promotional YouTube video for the app." + } + } + }, + "ListingsListResponse": { + "id": "ListingsListResponse", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidpublisher#listingsListResponse\".", + "default": "androidpublisher#listingsListResponse" + }, + "listings": { + "type": "array", + "items": { + "$ref": "Listing" + } + } + } + }, + "MonthDay": { + "id": "MonthDay", + "type": "object", + "properties": { + "day": { + "type": "integer", + "description": "Day of a month, value in [1, 31] range. Valid range depends on the specified month.", + "format": "uint32" + }, + "month": { + "type": "integer", + "description": "Month of a year. e.g. 1 = JAN, 2 = FEB etc.", + "format": "uint32" + } + } + }, + "PageInfo": { + "id": "PageInfo", + "type": "object", + "properties": { + "resultPerPage": { + "type": "integer", + "format": "int32" + }, + "startIndex": { + "type": "integer", + "format": "int32" + }, + "totalResults": { + "type": "integer", + "format": "int32" + } + } + }, + "Price": { + "id": "Price", + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "3 letter Currency code, as defined by ISO 4217." + }, + "priceMicros": { + "type": "string", + "description": "The price in millionths of the currency base unit represented as a string." + } + } + }, + "ProductPurchase": { + "id": "ProductPurchase", + "type": "object", + "description": "A ProductPurchase resource indicates the status of a user's inapp product purchase.", + "properties": { + "consumptionState": { + "type": "integer", + "description": "The consumption state of the inapp product. Possible values are: \n- Yet to be consumed \n- Consumed", + "format": "int32" + }, + "developerPayload": { + "type": "string", + "description": "A developer-specified string that contains supplemental information about an order." + }, + "kind": { + "type": "string", + "description": "This kind represents an inappPurchase object in the androidpublisher service.", + "default": "androidpublisher#productPurchase" + }, + "purchaseState": { + "type": "integer", + "description": "The purchase state of the order. Possible values are: \n- Purchased \n- Cancelled", + "format": "int32" + }, + "purchaseTimeMillis": { + "type": "string", + "description": "The time the product was purchased, in milliseconds since the epoch (Jan 1, 1970).", + "format": "int64" + } + } + }, + "Season": { + "id": "Season", + "type": "object", + "properties": { + "end": { + "$ref": "MonthDay", + "description": "Inclusive end date of the recurrence period." + }, + "start": { + "$ref": "MonthDay", + "description": "Inclusive start date of the recurrence period." + } + } + }, + "SubscriptionDeferralInfo": { + "id": "SubscriptionDeferralInfo", + "type": "object", + "description": "A SubscriptionDeferralInfo contains the data needed to defer a subscription purchase to a future expiry time.", + "properties": { + "desiredExpiryTimeMillis": { + "type": "string", + "description": "The desired next expiry time for the subscription in milliseconds since Epoch. The given time must be after the current expiry time for the subscription.", + "format": "int64" + }, + "expectedExpiryTimeMillis": { + "type": "string", + "description": "The expected expiry time for the subscription. If the current expiry time for the subscription is not the value specified here, the deferral will not occur.", + "format": "int64" + } + } + }, + "SubscriptionPurchase": { + "id": "SubscriptionPurchase", + "type": "object", + "description": "A SubscriptionPurchase resource indicates the status of a user's subscription purchase.", + "properties": { + "autoRenewing": { + "type": "boolean", + "description": "Whether the subscription will automatically be renewed when it reaches its current expiry time." + }, + "expiryTimeMillis": { + "type": "string", + "description": "Time at which the subscription will expire, in milliseconds since Epoch.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "This kind represents a subscriptionPurchase object in the androidpublisher service.", + "default": "androidpublisher#subscriptionPurchase" + }, + "startTimeMillis": { + "type": "string", + "description": "Time at which the subscription was granted, in milliseconds since Epoch.", + "format": "int64" + } + } + }, + "SubscriptionPurchasesDeferRequest": { + "id": "SubscriptionPurchasesDeferRequest", + "type": "object", + "properties": { + "deferralInfo": { + "$ref": "SubscriptionDeferralInfo", + "description": "The information about the new desired expiry time for the subscription." + } + } + }, + "SubscriptionPurchasesDeferResponse": { + "id": "SubscriptionPurchasesDeferResponse", + "type": "object", + "properties": { + "newExpiryTimeMillis": { + "type": "string", + "description": "The new expiry time for the subscription in milliseconds since the Epoch.", + "format": "int64" + } + } + }, + "Testers": { + "id": "Testers", + "type": "object", + "properties": { + "googleGroups": { + "type": "array", + "items": { + "type": "string" + } + }, + "googlePlusCommunities": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "TokenPagination": { + "id": "TokenPagination", + "type": "object", + "properties": { + "nextPageToken": { + "type": "string" + }, + "previousPageToken": { + "type": "string" + } + } + }, + "Track": { + "id": "Track", + "type": "object", + "properties": { + "track": { + "type": "string" + }, + "userFraction": { + "type": "number", + "format": "double" + }, + "versionCodes": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + } + }, + "TracksListResponse": { + "id": "TracksListResponse", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"androidpublisher#tracksListResponse\".", + "default": "androidpublisher#tracksListResponse" + }, + "tracks": { + "type": "array", + "items": { + "$ref": "Track" + } + } + } + } + }, + "resources": { + "edits": { + "methods": { + "commit": { + "id": "androidpublisher.edits.commit", + "path": "{packageName}/edits/{editId}:commit", + "httpMethod": "POST", + "description": "Commits/applies the changes made in this edit back to the app.", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId" + ], + "response": { + "$ref": "AppEdit" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "delete": { + "id": "androidpublisher.edits.delete", + "path": "{packageName}/edits/{editId}", + "httpMethod": "DELETE", + "description": "Deletes an edit for an app. Creating a new edit will automatically delete any of your previous edits so this method need only be called if you want to preemptively abandon an edit.", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId" + ], + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "get": { + "id": "androidpublisher.edits.get", + "path": "{packageName}/edits/{editId}", + "httpMethod": "GET", + "description": "Returns information about the edit specified. Calls will fail if the edit is no long active (e.g. has been deleted, superseded or expired).", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId" + ], + "response": { + "$ref": "AppEdit" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "insert": { + "id": "androidpublisher.edits.insert", + "path": "{packageName}/edits", + "httpMethod": "POST", + "description": "Creates a new edit for an app, populated with the app's current state.", + "parameters": { + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName" + ], + "request": { + "$ref": "AppEdit" + }, + "response": { + "$ref": "AppEdit" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "validate": { + "id": "androidpublisher.edits.validate", + "path": "{packageName}/edits/{editId}:validate", + "httpMethod": "POST", + "description": "Checks that the edit can be successfully committed. The edit's changes are not applied to the live app.", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId" + ], + "response": { + "$ref": "AppEdit" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + } + }, + "resources": { + "apklistings": { + "methods": { + "delete": { + "id": "androidpublisher.edits.apklistings.delete", + "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}", + "httpMethod": "DELETE", + "description": "Deletes the APK-specific localized listing for a specified APK and language code.", + "parameters": { + "apkVersionCode": { + "type": "integer", + "description": "The APK version code whose APK-specific listings should be read or modified.", + "required": true, + "format": "int32", + "location": "path" + }, + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "language": { + "type": "string", + "description": "The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId", + "apkVersionCode", + "language" + ], + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "deleteall": { + "id": "androidpublisher.edits.apklistings.deleteall", + "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings", + "httpMethod": "DELETE", + "description": "Deletes all the APK-specific localized listings for a specified APK.", + "parameters": { + "apkVersionCode": { + "type": "integer", + "description": "The APK version code whose APK-specific listings should be read or modified.", + "required": true, + "format": "int32", + "location": "path" + }, + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId", + "apkVersionCode" + ], + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "get": { + "id": "androidpublisher.edits.apklistings.get", + "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}", + "httpMethod": "GET", + "description": "Fetches the APK-specific localized listing for a specified APK and language code.", + "parameters": { + "apkVersionCode": { + "type": "integer", + "description": "The APK version code whose APK-specific listings should be read or modified.", + "required": true, + "format": "int32", + "location": "path" + }, + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "language": { + "type": "string", + "description": "The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId", + "apkVersionCode", + "language" + ], + "response": { + "$ref": "ApkListing" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "list": { + "id": "androidpublisher.edits.apklistings.list", + "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings", + "httpMethod": "GET", + "description": "Lists all the APK-specific localized listings for a specified APK.", + "parameters": { + "apkVersionCode": { + "type": "integer", + "description": "The APK version code whose APK-specific listings should be read or modified.", + "required": true, + "format": "int32", + "location": "path" + }, + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId", + "apkVersionCode" + ], + "response": { + "$ref": "ApkListingsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "patch": { + "id": "androidpublisher.edits.apklistings.patch", + "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}", + "httpMethod": "PATCH", + "description": "Updates or creates the APK-specific localized listing for a specified APK and language code. This method supports patch semantics.", + "parameters": { + "apkVersionCode": { + "type": "integer", + "description": "The APK version code whose APK-specific listings should be read or modified.", + "required": true, + "format": "int32", + "location": "path" + }, + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "language": { + "type": "string", + "description": "The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId", + "apkVersionCode", + "language" + ], + "request": { + "$ref": "ApkListing" + }, + "response": { + "$ref": "ApkListing" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "update": { + "id": "androidpublisher.edits.apklistings.update", + "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}", + "httpMethod": "PUT", + "description": "Updates or creates the APK-specific localized listing for a specified APK and language code.", + "parameters": { + "apkVersionCode": { + "type": "integer", + "description": "The APK version code whose APK-specific listings should be read or modified.", + "required": true, + "format": "int32", + "location": "path" + }, + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "language": { + "type": "string", + "description": "The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId", + "apkVersionCode", + "language" + ], + "request": { + "$ref": "ApkListing" + }, + "response": { + "$ref": "ApkListing" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + } + } + }, + "apks": { + "methods": { + "addexternallyhosted": { + "id": "androidpublisher.edits.apks.addexternallyhosted", + "path": "{packageName}/edits/{editId}/apks/externallyHosted", + "httpMethod": "POST", + "description": "Creates a new APK without uploading the APK itself to Google Play, instead hosting the APK at a specified URL. This function is only available to enterprises using Google Play for Work whose application is configured to restrict distribution to the enterprise domain.", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId" + ], + "request": { + "$ref": "ApksAddExternallyHostedRequest" + }, + "response": { + "$ref": "ApksAddExternallyHostedResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "list": { + "id": "androidpublisher.edits.apks.list", + "path": "{packageName}/edits/{editId}/apks", + "httpMethod": "GET", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId" + ], + "response": { + "$ref": "ApksListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "upload": { + "id": "androidpublisher.edits.apks.upload", + "path": "{packageName}/edits/{editId}/apks", + "httpMethod": "POST", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId" + ], + "response": { + "$ref": "Apk" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "application/octet-stream", + "application/vnd.android.package-archive" + ], + "maxSize": "1GB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks" + } + } + } + } + } + }, + "details": { + "methods": { + "get": { + "id": "androidpublisher.edits.details.get", + "path": "{packageName}/edits/{editId}/details", + "httpMethod": "GET", + "description": "Fetches app details for this edit. This includes the default language and developer support contact information.", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId" + ], + "response": { + "$ref": "AppDetails" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "patch": { + "id": "androidpublisher.edits.details.patch", + "path": "{packageName}/edits/{editId}/details", + "httpMethod": "PATCH", + "description": "Updates app details for this edit. This method supports patch semantics.", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId" + ], + "request": { + "$ref": "AppDetails" + }, + "response": { + "$ref": "AppDetails" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "update": { + "id": "androidpublisher.edits.details.update", + "path": "{packageName}/edits/{editId}/details", + "httpMethod": "PUT", + "description": "Updates app details for this edit.", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId" + ], + "request": { + "$ref": "AppDetails" + }, + "response": { + "$ref": "AppDetails" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + } + } + }, + "expansionfiles": { + "methods": { + "get": { + "id": "androidpublisher.edits.expansionfiles.get", + "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", + "httpMethod": "GET", + "description": "Fetches the Expansion File configuration for the APK specified.", + "parameters": { + "apkVersionCode": { + "type": "integer", + "description": "The version code of the APK whose Expansion File configuration is being read or modified.", + "required": true, + "format": "int32", + "location": "path" + }, + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "expansionFileType": { + "type": "string", + "required": true, + "enum": [ + "main", + "patch" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId", + "apkVersionCode", + "expansionFileType" + ], + "response": { + "$ref": "ExpansionFile" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "patch": { + "id": "androidpublisher.edits.expansionfiles.patch", + "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", + "httpMethod": "PATCH", + "description": "Updates the APK's Expansion File configuration to reference another APK's Expansion Files. To add a new Expansion File use the Upload method. This method supports patch semantics.", + "parameters": { + "apkVersionCode": { + "type": "integer", + "description": "The version code of the APK whose Expansion File configuration is being read or modified.", + "required": true, + "format": "int32", + "location": "path" + }, + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "expansionFileType": { + "type": "string", + "required": true, + "enum": [ + "main", + "patch" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId", + "apkVersionCode", + "expansionFileType" + ], + "request": { + "$ref": "ExpansionFile" + }, + "response": { + "$ref": "ExpansionFile" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "update": { + "id": "androidpublisher.edits.expansionfiles.update", + "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", + "httpMethod": "PUT", + "description": "Updates the APK's Expansion File configuration to reference another APK's Expansion Files. To add a new Expansion File use the Upload method.", + "parameters": { + "apkVersionCode": { + "type": "integer", + "description": "The version code of the APK whose Expansion File configuration is being read or modified.", + "required": true, + "format": "int32", + "location": "path" + }, + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "expansionFileType": { + "type": "string", + "required": true, + "enum": [ + "main", + "patch" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId", + "apkVersionCode", + "expansionFileType" + ], + "request": { + "$ref": "ExpansionFile" + }, + "response": { + "$ref": "ExpansionFile" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "upload": { + "id": "androidpublisher.edits.expansionfiles.upload", + "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", + "httpMethod": "POST", + "description": "Uploads and attaches a new Expansion File to the APK specified.", + "parameters": { + "apkVersionCode": { + "type": "integer", + "description": "The version code of the APK whose Expansion File configuration is being read or modified.", + "required": true, + "format": "int32", + "location": "path" + }, + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "expansionFileType": { + "type": "string", + "required": true, + "enum": [ + "main", + "patch" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId", + "apkVersionCode", + "expansionFileType" + ], + "response": { + "$ref": "ExpansionFilesUploadResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "application/octet-stream" + ], + "maxSize": "2048MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}" + } + } + } + } + } + }, + "images": { + "methods": { + "delete": { + "id": "androidpublisher.edits.images.delete", + "path": "{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}", + "httpMethod": "DELETE", + "description": "Deletes the image (specified by id) from the edit.", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "imageId": { + "type": "string", + "description": "Unique identifier an image within the set of images attached to this edit.", + "required": true, + "location": "path" + }, + "imageType": { + "type": "string", + "required": true, + "enum": [ + "featureGraphic", + "icon", + "phoneScreenshots", + "promoGraphic", + "sevenInchScreenshots", + "tenInchScreenshots", + "tvBanner", + "tvScreenshots", + "wearScreenshots" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "location": "path" + }, + "language": { + "type": "string", + "description": "The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass \"de-AT\".", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId", + "language", + "imageType", + "imageId" + ], + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "deleteall": { + "id": "androidpublisher.edits.images.deleteall", + "path": "{packageName}/edits/{editId}/listings/{language}/{imageType}", + "httpMethod": "DELETE", + "description": "Deletes all images for the specified language and image type.", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "imageType": { + "type": "string", + "required": true, + "enum": [ + "featureGraphic", + "icon", + "phoneScreenshots", + "promoGraphic", + "sevenInchScreenshots", + "tenInchScreenshots", + "tvBanner", + "tvScreenshots", + "wearScreenshots" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "location": "path" + }, + "language": { + "type": "string", + "description": "The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass \"de-AT\".", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId", + "language", + "imageType" + ], + "response": { + "$ref": "ImagesDeleteAllResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "list": { + "id": "androidpublisher.edits.images.list", + "path": "{packageName}/edits/{editId}/listings/{language}/{imageType}", + "httpMethod": "GET", + "description": "Lists all images for the specified language and image type.", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "imageType": { + "type": "string", + "required": true, + "enum": [ + "featureGraphic", + "icon", + "phoneScreenshots", + "promoGraphic", + "sevenInchScreenshots", + "tenInchScreenshots", + "tvBanner", + "tvScreenshots", + "wearScreenshots" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "location": "path" + }, + "language": { + "type": "string", + "description": "The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass \"de-AT\".", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId", + "language", + "imageType" + ], + "response": { + "$ref": "ImagesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "upload": { + "id": "androidpublisher.edits.images.upload", + "path": "{packageName}/edits/{editId}/listings/{language}/{imageType}", + "httpMethod": "POST", + "description": "Uploads a new image and adds it to the list of images for the specified language and image type.", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "imageType": { + "type": "string", + "required": true, + "enum": [ + "featureGraphic", + "icon", + "phoneScreenshots", + "promoGraphic", + "sevenInchScreenshots", + "tenInchScreenshots", + "tvBanner", + "tvScreenshots", + "wearScreenshots" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "location": "path" + }, + "language": { + "type": "string", + "description": "The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass \"de-AT\".", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId", + "language", + "imageType" + ], + "response": { + "$ref": "ImagesUploadResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "image/*" + ], + "maxSize": "15MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}" + } + } + } + } + } + }, + "listings": { + "methods": { + "delete": { + "id": "androidpublisher.edits.listings.delete", + "path": "{packageName}/edits/{editId}/listings/{language}", + "httpMethod": "DELETE", + "description": "Deletes the specified localized store listing from an edit.", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "language": { + "type": "string", + "description": "The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId", + "language" + ], + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "deleteall": { + "id": "androidpublisher.edits.listings.deleteall", + "path": "{packageName}/edits/{editId}/listings", + "httpMethod": "DELETE", + "description": "Deletes all localized listings from an edit.", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId" + ], + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "get": { + "id": "androidpublisher.edits.listings.get", + "path": "{packageName}/edits/{editId}/listings/{language}", + "httpMethod": "GET", + "description": "Fetches information about a localized store listing.", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "language": { + "type": "string", + "description": "The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId", + "language" + ], + "response": { + "$ref": "Listing" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "list": { + "id": "androidpublisher.edits.listings.list", + "path": "{packageName}/edits/{editId}/listings", + "httpMethod": "GET", + "description": "Returns all of the localized store listings attached to this edit.", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId" + ], + "response": { + "$ref": "ListingsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "patch": { + "id": "androidpublisher.edits.listings.patch", + "path": "{packageName}/edits/{editId}/listings/{language}", + "httpMethod": "PATCH", + "description": "Creates or updates a localized store listing. This method supports patch semantics.", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "language": { + "type": "string", + "description": "The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId", + "language" + ], + "request": { + "$ref": "Listing" + }, + "response": { + "$ref": "Listing" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "update": { + "id": "androidpublisher.edits.listings.update", + "path": "{packageName}/edits/{editId}/listings/{language}", + "httpMethod": "PUT", + "description": "Creates or updates a localized store listing.", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "language": { + "type": "string", + "description": "The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId", + "language" + ], + "request": { + "$ref": "Listing" + }, + "response": { + "$ref": "Listing" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + } + } + }, + "testers": { + "methods": { + "get": { + "id": "androidpublisher.edits.testers.get", + "path": "{packageName}/edits/{editId}/testers/{track}", + "httpMethod": "GET", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + }, + "track": { + "type": "string", + "required": true, + "enum": [ + "alpha", + "beta", + "production", + "rollout" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ], + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId", + "track" + ], + "response": { + "$ref": "Testers" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "patch": { + "id": "androidpublisher.edits.testers.patch", + "path": "{packageName}/edits/{editId}/testers/{track}", + "httpMethod": "PATCH", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + }, + "track": { + "type": "string", + "required": true, + "enum": [ + "alpha", + "beta", + "production", + "rollout" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ], + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId", + "track" + ], + "request": { + "$ref": "Testers" + }, + "response": { + "$ref": "Testers" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "update": { + "id": "androidpublisher.edits.testers.update", + "path": "{packageName}/edits/{editId}/testers/{track}", + "httpMethod": "PUT", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + }, + "track": { + "type": "string", + "required": true, + "enum": [ + "alpha", + "beta", + "production", + "rollout" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ], + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId", + "track" + ], + "request": { + "$ref": "Testers" + }, + "response": { + "$ref": "Testers" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + } + } + }, + "tracks": { + "methods": { + "get": { + "id": "androidpublisher.edits.tracks.get", + "path": "{packageName}/edits/{editId}/tracks/{track}", + "httpMethod": "GET", + "description": "Fetches the track configuration for the specified track type. Includes the APK version codes that are in this track.", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + }, + "track": { + "type": "string", + "description": "The track type to read or modify.", + "required": true, + "enum": [ + "alpha", + "beta", + "production", + "rollout" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ], + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId", + "track" + ], + "response": { + "$ref": "Track" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "list": { + "id": "androidpublisher.edits.tracks.list", + "path": "{packageName}/edits/{editId}/tracks", + "httpMethod": "GET", + "description": "Lists all the track configurations for this edit.", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId" + ], + "response": { + "$ref": "TracksListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "patch": { + "id": "androidpublisher.edits.tracks.patch", + "path": "{packageName}/edits/{editId}/tracks/{track}", + "httpMethod": "PATCH", + "description": "Updates the track configuration for the specified track type. When halted, the rollout track cannot be updated without adding new APKs, and adding new APKs will cause it to resume. This method supports patch semantics.", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + }, + "track": { + "type": "string", + "description": "The track type to read or modify.", + "required": true, + "enum": [ + "alpha", + "beta", + "production", + "rollout" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ], + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId", + "track" + ], + "request": { + "$ref": "Track" + }, + "response": { + "$ref": "Track" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "update": { + "id": "androidpublisher.edits.tracks.update", + "path": "{packageName}/edits/{editId}/tracks/{track}", + "httpMethod": "PUT", + "description": "Updates the track configuration for the specified track type. When halted, the rollout track cannot be updated without adding new APKs, and adding new APKs will cause it to resume.", + "parameters": { + "editId": { + "type": "string", + "description": "Unique identifier for this edit.", + "required": true, + "location": "path" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + }, + "track": { + "type": "string", + "description": "The track type to read or modify.", + "required": true, + "enum": [ + "alpha", + "beta", + "production", + "rollout" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ], + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "editId", + "track" + ], + "request": { + "$ref": "Track" + }, + "response": { + "$ref": "Track" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + } + } + } + } + }, + "entitlements": { + "methods": { + "list": { + "id": "androidpublisher.entitlements.list", + "path": "{packageName}/entitlements", + "httpMethod": "GET", + "description": "Lists the user's current inapp item or subscription entitlements", + "parameters": { + "maxResults": { + "type": "integer", + "format": "uint32", + "location": "query" + }, + "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 product id of the inapp product (for example, 'sku1'). This can be used to restrict the result set.", + "location": "query" + }, + "startIndex": { + "type": "integer", + "format": "uint32", + "location": "query" + }, + "token": { + "type": "string", + "location": "query" + } + }, + "parameterOrder": [ + "packageName" + ], + "response": { + "$ref": "EntitlementsListResponse" + } + } + } + }, + "inappproducts": { + "methods": { + "batch": { + "id": "androidpublisher.inappproducts.batch", + "path": "inappproducts/batch", + "httpMethod": "POST", + "request": { + "$ref": "InappproductsBatchRequest" + }, + "response": { + "$ref": "InappproductsBatchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "delete": { + "id": "androidpublisher.inappproducts.delete", + "path": "{packageName}/inappproducts/{sku}", + "httpMethod": "DELETE", + "description": "Delete an in-app product for an app.", + "parameters": { + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app with the in-app product; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + }, + "sku": { + "type": "string", + "description": "Unique identifier for the in-app product.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "sku" + ], + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "get": { + "id": "androidpublisher.inappproducts.get", + "path": "{packageName}/inappproducts/{sku}", + "httpMethod": "GET", + "description": "Returns information about the in-app product specified.", + "parameters": { + "packageName": { + "type": "string", + "required": true, + "location": "path" + }, + "sku": { + "type": "string", + "description": "Unique identifier for the in-app product.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "sku" + ], + "response": { + "$ref": "InAppProduct" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "insert": { + "id": "androidpublisher.inappproducts.insert", + "path": "{packageName}/inappproducts", + "httpMethod": "POST", + "description": "Creates a new in-app product for an app.", + "parameters": { + "autoConvertMissingPrices": { + "type": "boolean", + "description": "If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false.", + "location": "query" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName" + ], + "request": { + "$ref": "InAppProduct" + }, + "response": { + "$ref": "InAppProduct" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "list": { + "id": "androidpublisher.inappproducts.list", + "path": "{packageName}/inappproducts", + "httpMethod": "GET", + "description": "List all the in-app products for an Android app, both subscriptions and managed in-app products..", + "parameters": { + "maxResults": { + "type": "integer", + "format": "uint32", + "location": "query" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app with in-app products; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + }, + "startIndex": { + "type": "integer", + "format": "uint32", + "location": "query" + }, + "token": { + "type": "string", + "location": "query" + } + }, + "parameterOrder": [ + "packageName" + ], + "response": { + "$ref": "InappproductsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "patch": { + "id": "androidpublisher.inappproducts.patch", + "path": "{packageName}/inappproducts/{sku}", + "httpMethod": "PATCH", + "description": "Updates the details of an in-app product. This method supports patch semantics.", + "parameters": { + "autoConvertMissingPrices": { + "type": "boolean", + "description": "If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false.", + "location": "query" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app with the in-app product; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + }, + "sku": { + "type": "string", + "description": "Unique identifier for the in-app product.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "sku" + ], + "request": { + "$ref": "InAppProduct" + }, + "response": { + "$ref": "InAppProduct" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "update": { + "id": "androidpublisher.inappproducts.update", + "path": "{packageName}/inappproducts/{sku}", + "httpMethod": "PUT", + "description": "Updates the details of an in-app product.", + "parameters": { + "autoConvertMissingPrices": { + "type": "boolean", + "description": "If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false.", + "location": "query" + }, + "packageName": { + "type": "string", + "description": "Unique identifier for the Android app with the in-app product; for example, \"com.spiffygame\".", + "required": true, + "location": "path" + }, + "sku": { + "type": "string", + "description": "Unique identifier for the in-app product.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "packageName", + "sku" + ], + "request": { + "$ref": "InAppProduct" + }, + "response": { + "$ref": "InAppProduct" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + } + } + }, + "purchases": { + "resources": { + "products": { + "methods": { + "get": { + "id": "androidpublisher.purchases.products.get", + "path": "{packageName}/purchases/products/{productId}/tokens/{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": "ProductPurchase" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + } + } + }, + "subscriptions": { + "methods": { + "cancel": { + "id": "androidpublisher.purchases.subscriptions.cancel", + "path": "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{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" + ] + }, + "defer": { + "id": "androidpublisher.purchases.subscriptions.defer", + "path": "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:defer", + "httpMethod": "POST", + "description": "Defers a user's subscription purchase until a specified future 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" + ], + "request": { + "$ref": "SubscriptionPurchasesDeferRequest" + }, + "response": { + "$ref": "SubscriptionPurchasesDeferResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "get": { + "id": "androidpublisher.purchases.subscriptions.get", + "path": "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{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" + ] + }, + "refund": { + "id": "androidpublisher.purchases.subscriptions.refund", + "path": "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:refund", + "httpMethod": "POST", + "description": "Refunds a user's subscription purchase, but the subscription remains valid until its expiration time and it will continue to recur.", + "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" + ] + }, + "revoke": { + "id": "androidpublisher.purchases.subscriptions.revoke", + "path": "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:revoke", + "httpMethod": "POST", + "description": "Refunds and immediately revokes a user's subscription purchase. Access to the subscription will be terminated immediately and it will stop recurring.", + "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" + ] + } + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/androidpublisher/v2/androidpublisher-gen.go b/Godeps/_workspace/src/google.golang.org/api/androidpublisher/v2/androidpublisher-gen.go new file mode 100644 index 000000000..e88b027f0 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/androidpublisher/v2/androidpublisher-gen.go @@ -0,0 +1,9050 @@ +// Package androidpublisher provides access to the Google Play Developer API. +// +// See https://developers.google.com/android-publisher +// +// Usage example: +// +// import "google.golang.org/api/androidpublisher/v2" +// ... +// androidpublisherService, err := androidpublisher.New(oauthHttpClient) +package androidpublisher // import "google.golang.org/api/androidpublisher/v2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "androidpublisher:v2" +const apiName = "androidpublisher" +const apiVersion = "v2" +const basePath = "https://www.googleapis.com/androidpublisher/v2/applications/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your Google Play Developer account + AndroidpublisherScope = "https://www.googleapis.com/auth/androidpublisher" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Edits = NewEditsService(s) + s.Entitlements = NewEntitlementsService(s) + s.Inappproducts = NewInappproductsService(s) + s.Purchases = NewPurchasesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Edits *EditsService + + Entitlements *EntitlementsService + + Inappproducts *InappproductsService + + Purchases *PurchasesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewEditsService(s *Service) *EditsService { + rs := &EditsService{s: s} + rs.Apklistings = NewEditsApklistingsService(s) + rs.Apks = NewEditsApksService(s) + rs.Details = NewEditsDetailsService(s) + rs.Expansionfiles = NewEditsExpansionfilesService(s) + rs.Images = NewEditsImagesService(s) + rs.Listings = NewEditsListingsService(s) + rs.Testers = NewEditsTestersService(s) + rs.Tracks = NewEditsTracksService(s) + return rs +} + +type EditsService struct { + s *Service + + Apklistings *EditsApklistingsService + + Apks *EditsApksService + + Details *EditsDetailsService + + Expansionfiles *EditsExpansionfilesService + + Images *EditsImagesService + + Listings *EditsListingsService + + Testers *EditsTestersService + + Tracks *EditsTracksService +} + +func NewEditsApklistingsService(s *Service) *EditsApklistingsService { + rs := &EditsApklistingsService{s: s} + return rs +} + +type EditsApklistingsService struct { + s *Service +} + +func NewEditsApksService(s *Service) *EditsApksService { + rs := &EditsApksService{s: s} + return rs +} + +type EditsApksService struct { + s *Service +} + +func NewEditsDetailsService(s *Service) *EditsDetailsService { + rs := &EditsDetailsService{s: s} + return rs +} + +type EditsDetailsService struct { + s *Service +} + +func NewEditsExpansionfilesService(s *Service) *EditsExpansionfilesService { + rs := &EditsExpansionfilesService{s: s} + return rs +} + +type EditsExpansionfilesService struct { + s *Service +} + +func NewEditsImagesService(s *Service) *EditsImagesService { + rs := &EditsImagesService{s: s} + return rs +} + +type EditsImagesService struct { + s *Service +} + +func NewEditsListingsService(s *Service) *EditsListingsService { + rs := &EditsListingsService{s: s} + return rs +} + +type EditsListingsService struct { + s *Service +} + +func NewEditsTestersService(s *Service) *EditsTestersService { + rs := &EditsTestersService{s: s} + return rs +} + +type EditsTestersService struct { + s *Service +} + +func NewEditsTracksService(s *Service) *EditsTracksService { + rs := &EditsTracksService{s: s} + return rs +} + +type EditsTracksService struct { + s *Service +} + +func NewEntitlementsService(s *Service) *EntitlementsService { + rs := &EntitlementsService{s: s} + return rs +} + +type EntitlementsService struct { + s *Service +} + +func NewInappproductsService(s *Service) *InappproductsService { + rs := &InappproductsService{s: s} + return rs +} + +type InappproductsService struct { + s *Service +} + +func NewPurchasesService(s *Service) *PurchasesService { + rs := &PurchasesService{s: s} + rs.Products = NewPurchasesProductsService(s) + rs.Subscriptions = NewPurchasesSubscriptionsService(s) + return rs +} + +type PurchasesService struct { + s *Service + + Products *PurchasesProductsService + + Subscriptions *PurchasesSubscriptionsService +} + +func NewPurchasesProductsService(s *Service) *PurchasesProductsService { + rs := &PurchasesProductsService{s: s} + return rs +} + +type PurchasesProductsService struct { + s *Service +} + +func NewPurchasesSubscriptionsService(s *Service) *PurchasesSubscriptionsService { + rs := &PurchasesSubscriptionsService{s: s} + return rs +} + +type PurchasesSubscriptionsService struct { + s *Service +} + +type Apk struct { + // Binary: Information about the binary payload of this APK. + Binary *ApkBinary `json:"binary,omitempty"` + + // VersionCode: The version code of the APK, as specified in the APK's + // manifest file. + VersionCode int64 `json:"versionCode,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Binary") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Apk) MarshalJSON() ([]byte, error) { + type noMethod Apk + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ApkBinary: Represents the binary payload of an APK. +type ApkBinary struct { + // Sha1: A sha1 hash of the APK payload, encoded as a hex string and + // matching the output of the sha1sum command. + Sha1 string `json:"sha1,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Sha1") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ApkBinary) MarshalJSON() ([]byte, error) { + type noMethod ApkBinary + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ApkListing struct { + // Language: The language code, in BCP 47 format (eg "en-US"). + Language string `json:"language,omitempty"` + + // RecentChanges: Describe what's new in your APK. + RecentChanges string `json:"recentChanges,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Language") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ApkListing) MarshalJSON() ([]byte, error) { + type noMethod ApkListing + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ApkListingsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidpublisher#apkListingsListResponse". + Kind string `json:"kind,omitempty"` + + Listings []*ApkListing `json:"listings,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ApkListingsListResponse) MarshalJSON() ([]byte, error) { + type noMethod ApkListingsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ApksAddExternallyHostedRequest struct { + // ExternallyHostedApk: The definition of the externally-hosted APK and + // where it is located. + ExternallyHostedApk *ExternallyHostedApk `json:"externallyHostedApk,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ExternallyHostedApk") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ApksAddExternallyHostedRequest) MarshalJSON() ([]byte, error) { + type noMethod ApksAddExternallyHostedRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ApksAddExternallyHostedResponse struct { + // ExternallyHostedApk: The definition of the externally-hosted APK and + // where it is located. + ExternallyHostedApk *ExternallyHostedApk `json:"externallyHostedApk,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ExternallyHostedApk") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ApksAddExternallyHostedResponse) MarshalJSON() ([]byte, error) { + type noMethod ApksAddExternallyHostedResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ApksListResponse struct { + Apks []*Apk `json:"apks,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidpublisher#apksListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Apks") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ApksListResponse) MarshalJSON() ([]byte, error) { + type noMethod ApksListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AppDetails struct { + // ContactEmail: The user-visible support email for this app. + ContactEmail string `json:"contactEmail,omitempty"` + + // ContactPhone: The user-visible support telephone number for this app. + ContactPhone string `json:"contactPhone,omitempty"` + + // ContactWebsite: The user-visible website for this app. + ContactWebsite string `json:"contactWebsite,omitempty"` + + // DefaultLanguage: Default language code, in BCP 47 format (eg + // "en-US"). + DefaultLanguage string `json:"defaultLanguage,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ContactEmail") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AppDetails) MarshalJSON() ([]byte, error) { + type noMethod AppDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AppEdit: Represents an edit of an app. An edit allows clients to make +// multiple changes before committing them in one operation. +type AppEdit struct { + // ExpiryTimeSeconds: The time at which the edit will expire and will be + // no longer valid for use in any subsequent API calls (encoded as + // seconds since the Epoch). + ExpiryTimeSeconds string `json:"expiryTimeSeconds,omitempty"` + + // Id: The ID of the edit that can be used in subsequent API calls. + Id string `json:"id,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ExpiryTimeSeconds") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AppEdit) MarshalJSON() ([]byte, error) { + type noMethod AppEdit + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Entitlement: An Entitlement resource indicates a user's current +// entitlement to an inapp item or subscription. +type Entitlement struct { + // Kind: This kind represents an entitlement object in the + // androidpublisher service. + Kind string `json:"kind,omitempty"` + + // ProductId: The SKU of the product. + ProductId string `json:"productId,omitempty"` + + // ProductType: The type of the inapp product. Possible values are: + // - In-app item: "inapp" + // - Subscription: "subs" + ProductType string `json:"productType,omitempty"` + + // Token: The token which can be verified using the subscriptions or + // products API. + Token string `json:"token,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Entitlement) MarshalJSON() ([]byte, error) { + type noMethod Entitlement + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type EntitlementsListResponse struct { + PageInfo *PageInfo `json:"pageInfo,omitempty"` + + Resources []*Entitlement `json:"resources,omitempty"` + + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "PageInfo") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EntitlementsListResponse) MarshalJSON() ([]byte, error) { + type noMethod EntitlementsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ExpansionFile struct { + // FileSize: If set this field indicates that this APK has an Expansion + // File uploaded to it: this APK does not reference another APK's + // Expansion File. The field's value is the size of the uploaded + // Expansion File in bytes. + FileSize int64 `json:"fileSize,omitempty,string"` + + // ReferencesVersion: If set this APK's Expansion File references + // another APK's Expansion File. The file_size field will not be set. + ReferencesVersion int64 `json:"referencesVersion,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "FileSize") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ExpansionFile) MarshalJSON() ([]byte, error) { + type noMethod ExpansionFile + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ExpansionFilesUploadResponse struct { + ExpansionFile *ExpansionFile `json:"expansionFile,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ExpansionFile") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ExpansionFilesUploadResponse) MarshalJSON() ([]byte, error) { + type noMethod ExpansionFilesUploadResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ExternallyHostedApk: Defines an APK available for this application +// that is hosted externally and not uploaded to Google Play. This +// function is only available to enterprises who are using Google Play +// for Work, and whos application is restricted to the enterprise +// private channel +type ExternallyHostedApk struct { + // ApplicationLabel: The application label. + ApplicationLabel string `json:"applicationLabel,omitempty"` + + // CertificateBase64s: A certificate (or array of certificates if a + // certificate-chain is used) used to signed this APK, represented as a + // base64 encoded byte array. + CertificateBase64s []string `json:"certificateBase64s,omitempty"` + + // ExternallyHostedUrl: The URL at which the APK is hosted. This must be + // an https URL. + ExternallyHostedUrl string `json:"externallyHostedUrl,omitempty"` + + // FileSha1Base64: The SHA1 checksum of this APK, represented as a + // base64 encoded byte array. + FileSha1Base64 string `json:"fileSha1Base64,omitempty"` + + // FileSha256Base64: The SHA256 checksum of this APK, represented as a + // base64 encoded byte array. + FileSha256Base64 string `json:"fileSha256Base64,omitempty"` + + // FileSize: The file size in bytes of this APK. + FileSize int64 `json:"fileSize,omitempty,string"` + + // IconBase64: The icon image from the APK, as a base64 encoded byte + // array. + IconBase64 string `json:"iconBase64,omitempty"` + + // MaximumSdk: The maximum SDK supported by this APK (optional). + MaximumSdk int64 `json:"maximumSdk,omitempty"` + + // MinimumSdk: The minimum SDK targeted by this APK. + MinimumSdk int64 `json:"minimumSdk,omitempty"` + + // NativeCodes: The native code environments supported by this APK + // (optional). + NativeCodes []string `json:"nativeCodes,omitempty"` + + // PackageName: The package name. + PackageName string `json:"packageName,omitempty"` + + // UsesFeatures: The features required by this APK (optional). + UsesFeatures []string `json:"usesFeatures,omitempty"` + + // UsesPermissions: The permissions requested by this APK. + UsesPermissions []*ExternallyHostedApkUsesPermission `json:"usesPermissions,omitempty"` + + // VersionCode: The version code of this APK. + VersionCode int64 `json:"versionCode,omitempty"` + + // VersionName: The version name of this APK. + VersionName string `json:"versionName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ApplicationLabel") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ExternallyHostedApk) MarshalJSON() ([]byte, error) { + type noMethod ExternallyHostedApk + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ExternallyHostedApkUsesPermission: A permission used by this APK. +type ExternallyHostedApkUsesPermission struct { + // MaxSdkVersion: Optionally, the maximum SDK version for which the + // permission is required. + MaxSdkVersion int64 `json:"maxSdkVersion,omitempty"` + + // Name: The name of the permission requested. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MaxSdkVersion") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ExternallyHostedApkUsesPermission) MarshalJSON() ([]byte, error) { + type noMethod ExternallyHostedApkUsesPermission + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Image struct { + // Id: A unique id representing this image. + Id string `json:"id,omitempty"` + + // Sha1: A sha1 hash of the image that was uploaded. + Sha1 string `json:"sha1,omitempty"` + + // Url: A URL that will serve a preview of the image. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Image) MarshalJSON() ([]byte, error) { + type noMethod Image + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ImagesDeleteAllResponse struct { + Deleted []*Image `json:"deleted,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Deleted") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ImagesDeleteAllResponse) MarshalJSON() ([]byte, error) { + type noMethod ImagesDeleteAllResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ImagesListResponse struct { + Images []*Image `json:"images,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Images") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ImagesListResponse) MarshalJSON() ([]byte, error) { + type noMethod ImagesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ImagesUploadResponse struct { + Image *Image `json:"image,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Image") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ImagesUploadResponse) MarshalJSON() ([]byte, error) { + type noMethod ImagesUploadResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InAppProduct struct { + // DefaultLanguage: The default language of the localized data, as + // defined by BCP 47. e.g. "en-US", "en-GB". + DefaultLanguage string `json:"defaultLanguage,omitempty"` + + // DefaultPrice: Default price cannot be zero. In-app products can never + // be free. Default price is always in the developer's Checkout merchant + // currency. + DefaultPrice *Price `json:"defaultPrice,omitempty"` + + // Listings: List of localized title and description data. + Listings map[string]InAppProductListing `json:"listings,omitempty"` + + // PackageName: The package name of the parent app. + PackageName string `json:"packageName,omitempty"` + + // Prices: Prices per buyer region. None of these prices should be zero. + // In-app products can never be free. + Prices map[string]Price `json:"prices,omitempty"` + + // PurchaseType: Purchase type enum value. Unmodifiable after creation. + PurchaseType string `json:"purchaseType,omitempty"` + + // Season: Definition of a season for a seasonal subscription. Can be + // defined only for yearly subscriptions. + Season *Season `json:"season,omitempty"` + + // Sku: The stock-keeping-unit (SKU) of the product, unique within an + // app. + Sku string `json:"sku,omitempty"` + + Status string `json:"status,omitempty"` + + // SubscriptionPeriod: Subscription period, specified in ISO 8601 + // format. Acceptable values are "P1W" (one week), "P1M" (one month) and + // "P1Y" (one year). + SubscriptionPeriod string `json:"subscriptionPeriod,omitempty"` + + // TrialPeriod: Trial period, specified in ISO 8601 format. Acceptable + // values are anything between "P7D" (seven days) and "P999D" (999 + // days). Seasonal subscriptions cannot have a trial period. + TrialPeriod string `json:"trialPeriod,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DefaultLanguage") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InAppProduct) MarshalJSON() ([]byte, error) { + type noMethod InAppProduct + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InAppProductListing struct { + Description string `json:"description,omitempty"` + + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InAppProductListing) MarshalJSON() ([]byte, error) { + type noMethod InAppProductListing + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InappproductsBatchRequest struct { + Entrys []*InappproductsBatchRequestEntry `json:"entrys,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Entrys") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InappproductsBatchRequest) MarshalJSON() ([]byte, error) { + type noMethod InappproductsBatchRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InappproductsBatchRequestEntry struct { + BatchId int64 `json:"batchId,omitempty"` + + Inappproductsinsertrequest *InappproductsInsertRequest `json:"inappproductsinsertrequest,omitempty"` + + Inappproductsupdaterequest *InappproductsUpdateRequest `json:"inappproductsupdaterequest,omitempty"` + + MethodName string `json:"methodName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BatchId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InappproductsBatchRequestEntry) MarshalJSON() ([]byte, error) { + type noMethod InappproductsBatchRequestEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InappproductsBatchResponse struct { + Entrys []*InappproductsBatchResponseEntry `json:"entrys,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidpublisher#inappproductsBatchResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Entrys") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InappproductsBatchResponse) MarshalJSON() ([]byte, error) { + type noMethod InappproductsBatchResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InappproductsBatchResponseEntry struct { + BatchId int64 `json:"batchId,omitempty"` + + Inappproductsinsertresponse *InappproductsInsertResponse `json:"inappproductsinsertresponse,omitempty"` + + Inappproductsupdateresponse *InappproductsUpdateResponse `json:"inappproductsupdateresponse,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BatchId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InappproductsBatchResponseEntry) MarshalJSON() ([]byte, error) { + type noMethod InappproductsBatchResponseEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InappproductsInsertRequest struct { + Inappproduct *InAppProduct `json:"inappproduct,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Inappproduct") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InappproductsInsertRequest) MarshalJSON() ([]byte, error) { + type noMethod InappproductsInsertRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InappproductsInsertResponse struct { + Inappproduct *InAppProduct `json:"inappproduct,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Inappproduct") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InappproductsInsertResponse) MarshalJSON() ([]byte, error) { + type noMethod InappproductsInsertResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InappproductsListResponse struct { + Inappproduct []*InAppProduct `json:"inappproduct,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidpublisher#inappproductsListResponse". + Kind string `json:"kind,omitempty"` + + PageInfo *PageInfo `json:"pageInfo,omitempty"` + + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Inappproduct") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InappproductsListResponse) MarshalJSON() ([]byte, error) { + type noMethod InappproductsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InappproductsUpdateRequest struct { + Inappproduct *InAppProduct `json:"inappproduct,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Inappproduct") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InappproductsUpdateRequest) MarshalJSON() ([]byte, error) { + type noMethod InappproductsUpdateRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InappproductsUpdateResponse struct { + Inappproduct *InAppProduct `json:"inappproduct,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Inappproduct") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InappproductsUpdateResponse) MarshalJSON() ([]byte, error) { + type noMethod InappproductsUpdateResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Listing struct { + // FullDescription: Full description of the app; this may be up to 4000 + // characters in length. + FullDescription string `json:"fullDescription,omitempty"` + + // Language: Language localization code (for example, "de-AT" for + // Austrian German). + Language string `json:"language,omitempty"` + + // ShortDescription: Short description of the app (previously known as + // promo text); this may be up to 80 characters in length. + ShortDescription string `json:"shortDescription,omitempty"` + + // Title: App's localized title. + Title string `json:"title,omitempty"` + + // Video: URL of a promotional YouTube video for the app. + Video string `json:"video,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "FullDescription") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Listing) MarshalJSON() ([]byte, error) { + type noMethod Listing + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ListingsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidpublisher#listingsListResponse". + Kind string `json:"kind,omitempty"` + + Listings []*Listing `json:"listings,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListingsListResponse) MarshalJSON() ([]byte, error) { + type noMethod ListingsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type MonthDay struct { + // Day: Day of a month, value in [1, 31] range. Valid range depends on + // the specified month. + Day int64 `json:"day,omitempty"` + + // Month: Month of a year. e.g. 1 = JAN, 2 = FEB etc. + Month int64 `json:"month,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Day") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MonthDay) MarshalJSON() ([]byte, error) { + type noMethod MonthDay + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PageInfo struct { + ResultPerPage int64 `json:"resultPerPage,omitempty"` + + StartIndex int64 `json:"startIndex,omitempty"` + + TotalResults int64 `json:"totalResults,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ResultPerPage") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PageInfo) MarshalJSON() ([]byte, error) { + type noMethod PageInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Price struct { + // Currency: 3 letter Currency code, as defined by ISO 4217. + Currency string `json:"currency,omitempty"` + + // PriceMicros: The price in millionths of the currency base unit + // represented as a string. + PriceMicros string `json:"priceMicros,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Currency") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Price) MarshalJSON() ([]byte, error) { + type noMethod Price + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ProductPurchase: A ProductPurchase resource indicates the status of a +// user's inapp product purchase. +type ProductPurchase struct { + // ConsumptionState: The consumption state of the inapp product. + // Possible values are: + // - Yet to be consumed + // - Consumed + ConsumptionState int64 `json:"consumptionState,omitempty"` + + // DeveloperPayload: A developer-specified string that contains + // supplemental information about an order. + DeveloperPayload string `json:"developerPayload,omitempty"` + + // Kind: This kind represents an inappPurchase object in the + // androidpublisher service. + Kind string `json:"kind,omitempty"` + + // PurchaseState: The purchase state of the order. Possible values are: + // + // - Purchased + // - Cancelled + PurchaseState int64 `json:"purchaseState,omitempty"` + + // PurchaseTimeMillis: The time the product was purchased, in + // milliseconds since the epoch (Jan 1, 1970). + PurchaseTimeMillis int64 `json:"purchaseTimeMillis,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ConsumptionState") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductPurchase) MarshalJSON() ([]byte, error) { + type noMethod ProductPurchase + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Season struct { + // End: Inclusive end date of the recurrence period. + End *MonthDay `json:"end,omitempty"` + + // Start: Inclusive start date of the recurrence period. + Start *MonthDay `json:"start,omitempty"` + + // ForceSendFields is a list of field names (e.g. "End") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Season) MarshalJSON() ([]byte, error) { + type noMethod Season + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SubscriptionDeferralInfo: A SubscriptionDeferralInfo contains the +// data needed to defer a subscription purchase to a future expiry time. +type SubscriptionDeferralInfo struct { + // DesiredExpiryTimeMillis: The desired next expiry time for the + // subscription in milliseconds since Epoch. The given time must be + // after the current expiry time for the subscription. + DesiredExpiryTimeMillis int64 `json:"desiredExpiryTimeMillis,omitempty,string"` + + // ExpectedExpiryTimeMillis: The expected expiry time for the + // subscription. If the current expiry time for the subscription is not + // the value specified here, the deferral will not occur. + ExpectedExpiryTimeMillis int64 `json:"expectedExpiryTimeMillis,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. + // "DesiredExpiryTimeMillis") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SubscriptionDeferralInfo) MarshalJSON() ([]byte, error) { + type noMethod SubscriptionDeferralInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SubscriptionPurchase: A SubscriptionPurchase resource indicates the +// status of a user's subscription purchase. +type SubscriptionPurchase struct { + // AutoRenewing: Whether the subscription will automatically be renewed + // when it reaches its current expiry time. + AutoRenewing bool `json:"autoRenewing,omitempty"` + + // ExpiryTimeMillis: Time at which the subscription will expire, in + // milliseconds since Epoch. + ExpiryTimeMillis int64 `json:"expiryTimeMillis,omitempty,string"` + + // Kind: This kind represents a subscriptionPurchase object in the + // androidpublisher service. + Kind string `json:"kind,omitempty"` + + // StartTimeMillis: Time at which the subscription was granted, in + // milliseconds since Epoch. + StartTimeMillis int64 `json:"startTimeMillis,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AutoRenewing") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SubscriptionPurchase) MarshalJSON() ([]byte, error) { + type noMethod SubscriptionPurchase + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type SubscriptionPurchasesDeferRequest struct { + // DeferralInfo: The information about the new desired expiry time for + // the subscription. + DeferralInfo *SubscriptionDeferralInfo `json:"deferralInfo,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DeferralInfo") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SubscriptionPurchasesDeferRequest) MarshalJSON() ([]byte, error) { + type noMethod SubscriptionPurchasesDeferRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type SubscriptionPurchasesDeferResponse struct { + // NewExpiryTimeMillis: The new expiry time for the subscription in + // milliseconds since the Epoch. + NewExpiryTimeMillis int64 `json:"newExpiryTimeMillis,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NewExpiryTimeMillis") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SubscriptionPurchasesDeferResponse) MarshalJSON() ([]byte, error) { + type noMethod SubscriptionPurchasesDeferResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Testers struct { + GoogleGroups []string `json:"googleGroups,omitempty"` + + GooglePlusCommunities []string `json:"googlePlusCommunities,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "GoogleGroups") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Testers) MarshalJSON() ([]byte, error) { + type noMethod Testers + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TokenPagination struct { + NextPageToken string `json:"nextPageToken,omitempty"` + + PreviousPageToken string `json:"previousPageToken,omitempty"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TokenPagination) MarshalJSON() ([]byte, error) { + type noMethod TokenPagination + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Track struct { + Track string `json:"track,omitempty"` + + UserFraction float64 `json:"userFraction,omitempty"` + + VersionCodes []int64 `json:"versionCodes,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Track") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Track) MarshalJSON() ([]byte, error) { + type noMethod Track + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TracksListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "androidpublisher#tracksListResponse". + Kind string `json:"kind,omitempty"` + + Tracks []*Track `json:"tracks,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TracksListResponse) MarshalJSON() ([]byte, error) { + type noMethod TracksListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "androidpublisher.edits.commit": + +type EditsCommitCall struct { + s *Service + packageNameid string + editId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Commit: Commits/applies the changes made in this edit back to the +// app. +func (r *EditsService) Commit(packageNameid string, editId string) *EditsCommitCall { + c := &EditsCommitCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsCommitCall) Fields(s ...googleapi.Field) *EditsCommitCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsCommitCall) Context(ctx context.Context) *EditsCommitCall { + c.ctx_ = ctx + return c +} + +func (c *EditsCommitCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}:commit") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.commit" call. +// Exactly one of *AppEdit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AppEdit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsCommitCall) Do() (*AppEdit, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AppEdit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Commits/applies the changes made in this edit back to the app.", + // "httpMethod": "POST", + // "id": "androidpublisher.edits.commit", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}:commit", + // "response": { + // "$ref": "AppEdit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.delete": + +type EditsDeleteCall struct { + s *Service + packageNameid string + editId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an edit for an app. Creating a new edit will +// automatically delete any of your previous edits so this method need +// only be called if you want to preemptively abandon an edit. +func (r *EditsService) Delete(packageNameid string, editId string) *EditsDeleteCall { + c := &EditsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsDeleteCall) Fields(s ...googleapi.Field) *EditsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsDeleteCall) Context(ctx context.Context) *EditsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *EditsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.delete" call. +func (c *EditsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an edit for an app. Creating a new edit will automatically delete any of your previous edits so this method need only be called if you want to preemptively abandon an edit.", + // "httpMethod": "DELETE", + // "id": "androidpublisher.edits.delete", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}", + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.get": + +type EditsGetCall struct { + s *Service + packageNameid string + editId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns information about the edit specified. Calls will fail if +// the edit is no long active (e.g. has been deleted, superseded or +// expired). +func (r *EditsService) Get(packageNameid string, editId string) *EditsGetCall { + c := &EditsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsGetCall) Fields(s ...googleapi.Field) *EditsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsGetCall) IfNoneMatch(entityTag string) *EditsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsGetCall) Context(ctx context.Context) *EditsGetCall { + c.ctx_ = ctx + return c +} + +func (c *EditsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.get" call. +// Exactly one of *AppEdit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AppEdit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsGetCall) Do() (*AppEdit, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AppEdit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns information about the edit specified. Calls will fail if the edit is no long active (e.g. has been deleted, superseded or expired).", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.get", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}", + // "response": { + // "$ref": "AppEdit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.insert": + +type EditsInsertCall struct { + s *Service + packageNameid string + appedit *AppEdit + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a new edit for an app, populated with the app's +// current state. +func (r *EditsService) Insert(packageNameid string, appedit *AppEdit) *EditsInsertCall { + c := &EditsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.appedit = appedit + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsInsertCall) Fields(s ...googleapi.Field) *EditsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsInsertCall) Context(ctx context.Context) *EditsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *EditsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.appedit) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.insert" call. +// Exactly one of *AppEdit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AppEdit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsInsertCall) Do() (*AppEdit, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AppEdit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new edit for an app, populated with the app's current state.", + // "httpMethod": "POST", + // "id": "androidpublisher.edits.insert", + // "parameterOrder": [ + // "packageName" + // ], + // "parameters": { + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits", + // "request": { + // "$ref": "AppEdit" + // }, + // "response": { + // "$ref": "AppEdit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.validate": + +type EditsValidateCall struct { + s *Service + packageNameid string + editId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Validate: Checks that the edit can be successfully committed. The +// edit's changes are not applied to the live app. +func (r *EditsService) Validate(packageNameid string, editId string) *EditsValidateCall { + c := &EditsValidateCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsValidateCall) Fields(s ...googleapi.Field) *EditsValidateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsValidateCall) Context(ctx context.Context) *EditsValidateCall { + c.ctx_ = ctx + return c +} + +func (c *EditsValidateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}:validate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.validate" call. +// Exactly one of *AppEdit or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AppEdit.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsValidateCall) Do() (*AppEdit, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AppEdit{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Checks that the edit can be successfully committed. The edit's changes are not applied to the live app.", + // "httpMethod": "POST", + // "id": "androidpublisher.edits.validate", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}:validate", + // "response": { + // "$ref": "AppEdit" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.apklistings.delete": + +type EditsApklistingsDeleteCall struct { + s *Service + packageNameid string + editId string + apkVersionCode int64 + language string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the APK-specific localized listing for a specified +// APK and language code. +func (r *EditsApklistingsService) Delete(packageNameid string, editId string, apkVersionCode int64, language string) *EditsApklistingsDeleteCall { + c := &EditsApklistingsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.apkVersionCode = apkVersionCode + c.language = language + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsApklistingsDeleteCall) Fields(s ...googleapi.Field) *EditsApklistingsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsApklistingsDeleteCall) Context(ctx context.Context) *EditsApklistingsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *EditsApklistingsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), + "language": c.language, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.apklistings.delete" call. +func (c *EditsApklistingsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the APK-specific localized listing for a specified APK and language code.", + // "httpMethod": "DELETE", + // "id": "androidpublisher.edits.apklistings.delete", + // "parameterOrder": [ + // "packageName", + // "editId", + // "apkVersionCode", + // "language" + // ], + // "parameters": { + // "apkVersionCode": { + // "description": "The APK version code whose APK-specific listings should be read or modified.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "language": { + // "description": "The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}", + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.apklistings.deleteall": + +type EditsApklistingsDeleteallCall struct { + s *Service + packageNameid string + editId string + apkVersionCode int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Deleteall: Deletes all the APK-specific localized listings for a +// specified APK. +func (r *EditsApklistingsService) Deleteall(packageNameid string, editId string, apkVersionCode int64) *EditsApklistingsDeleteallCall { + c := &EditsApklistingsDeleteallCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.apkVersionCode = apkVersionCode + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsApklistingsDeleteallCall) Fields(s ...googleapi.Field) *EditsApklistingsDeleteallCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsApklistingsDeleteallCall) Context(ctx context.Context) *EditsApklistingsDeleteallCall { + c.ctx_ = ctx + return c +} + +func (c *EditsApklistingsDeleteallCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.apklistings.deleteall" call. +func (c *EditsApklistingsDeleteallCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes all the APK-specific localized listings for a specified APK.", + // "httpMethod": "DELETE", + // "id": "androidpublisher.edits.apklistings.deleteall", + // "parameterOrder": [ + // "packageName", + // "editId", + // "apkVersionCode" + // ], + // "parameters": { + // "apkVersionCode": { + // "description": "The APK version code whose APK-specific listings should be read or modified.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings", + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.apklistings.get": + +type EditsApklistingsGetCall struct { + s *Service + packageNameid string + editId string + apkVersionCode int64 + language string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Fetches the APK-specific localized listing for a specified APK +// and language code. +func (r *EditsApklistingsService) Get(packageNameid string, editId string, apkVersionCode int64, language string) *EditsApklistingsGetCall { + c := &EditsApklistingsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.apkVersionCode = apkVersionCode + c.language = language + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsApklistingsGetCall) Fields(s ...googleapi.Field) *EditsApklistingsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsApklistingsGetCall) IfNoneMatch(entityTag string) *EditsApklistingsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsApklistingsGetCall) Context(ctx context.Context) *EditsApklistingsGetCall { + c.ctx_ = ctx + return c +} + +func (c *EditsApklistingsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), + "language": c.language, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.apklistings.get" call. +// Exactly one of *ApkListing or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ApkListing.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EditsApklistingsGetCall) Do() (*ApkListing, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ApkListing{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Fetches the APK-specific localized listing for a specified APK and language code.", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.apklistings.get", + // "parameterOrder": [ + // "packageName", + // "editId", + // "apkVersionCode", + // "language" + // ], + // "parameters": { + // "apkVersionCode": { + // "description": "The APK version code whose APK-specific listings should be read or modified.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "language": { + // "description": "The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}", + // "response": { + // "$ref": "ApkListing" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.apklistings.list": + +type EditsApklistingsListCall struct { + s *Service + packageNameid string + editId string + apkVersionCode int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all the APK-specific localized listings for a specified +// APK. +func (r *EditsApklistingsService) List(packageNameid string, editId string, apkVersionCode int64) *EditsApklistingsListCall { + c := &EditsApklistingsListCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.apkVersionCode = apkVersionCode + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsApklistingsListCall) Fields(s ...googleapi.Field) *EditsApklistingsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsApklistingsListCall) IfNoneMatch(entityTag string) *EditsApklistingsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsApklistingsListCall) Context(ctx context.Context) *EditsApklistingsListCall { + c.ctx_ = ctx + return c +} + +func (c *EditsApklistingsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.apklistings.list" call. +// Exactly one of *ApkListingsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ApkListingsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsApklistingsListCall) Do() (*ApkListingsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ApkListingsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all the APK-specific localized listings for a specified APK.", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.apklistings.list", + // "parameterOrder": [ + // "packageName", + // "editId", + // "apkVersionCode" + // ], + // "parameters": { + // "apkVersionCode": { + // "description": "The APK version code whose APK-specific listings should be read or modified.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings", + // "response": { + // "$ref": "ApkListingsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.apklistings.patch": + +type EditsApklistingsPatchCall struct { + s *Service + packageNameid string + editId string + apkVersionCode int64 + language string + apklisting *ApkListing + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates or creates the APK-specific localized listing for a +// specified APK and language code. This method supports patch +// semantics. +func (r *EditsApklistingsService) Patch(packageNameid string, editId string, apkVersionCode int64, language string, apklisting *ApkListing) *EditsApklistingsPatchCall { + c := &EditsApklistingsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.apkVersionCode = apkVersionCode + c.language = language + c.apklisting = apklisting + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsApklistingsPatchCall) Fields(s ...googleapi.Field) *EditsApklistingsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsApklistingsPatchCall) Context(ctx context.Context) *EditsApklistingsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *EditsApklistingsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.apklisting) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), + "language": c.language, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.apklistings.patch" call. +// Exactly one of *ApkListing or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ApkListing.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EditsApklistingsPatchCall) Do() (*ApkListing, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ApkListing{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates or creates the APK-specific localized listing for a specified APK and language code. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "androidpublisher.edits.apklistings.patch", + // "parameterOrder": [ + // "packageName", + // "editId", + // "apkVersionCode", + // "language" + // ], + // "parameters": { + // "apkVersionCode": { + // "description": "The APK version code whose APK-specific listings should be read or modified.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "language": { + // "description": "The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}", + // "request": { + // "$ref": "ApkListing" + // }, + // "response": { + // "$ref": "ApkListing" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.apklistings.update": + +type EditsApklistingsUpdateCall struct { + s *Service + packageNameid string + editId string + apkVersionCode int64 + language string + apklisting *ApkListing + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates or creates the APK-specific localized listing for a +// specified APK and language code. +func (r *EditsApklistingsService) Update(packageNameid string, editId string, apkVersionCode int64, language string, apklisting *ApkListing) *EditsApklistingsUpdateCall { + c := &EditsApklistingsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.apkVersionCode = apkVersionCode + c.language = language + c.apklisting = apklisting + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsApklistingsUpdateCall) Fields(s ...googleapi.Field) *EditsApklistingsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsApklistingsUpdateCall) Context(ctx context.Context) *EditsApklistingsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *EditsApklistingsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.apklisting) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), + "language": c.language, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.apklistings.update" call. +// Exactly one of *ApkListing or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ApkListing.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EditsApklistingsUpdateCall) Do() (*ApkListing, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ApkListing{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates or creates the APK-specific localized listing for a specified APK and language code.", + // "httpMethod": "PUT", + // "id": "androidpublisher.edits.apklistings.update", + // "parameterOrder": [ + // "packageName", + // "editId", + // "apkVersionCode", + // "language" + // ], + // "parameters": { + // "apkVersionCode": { + // "description": "The APK version code whose APK-specific listings should be read or modified.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "language": { + // "description": "The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}", + // "request": { + // "$ref": "ApkListing" + // }, + // "response": { + // "$ref": "ApkListing" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.apks.addexternallyhosted": + +type EditsApksAddexternallyhostedCall struct { + s *Service + packageNameid string + editId string + apksaddexternallyhostedrequest *ApksAddExternallyHostedRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Addexternallyhosted: Creates a new APK without uploading the APK +// itself to Google Play, instead hosting the APK at a specified URL. +// This function is only available to enterprises using Google Play for +// Work whose application is configured to restrict distribution to the +// enterprise domain. +func (r *EditsApksService) Addexternallyhosted(packageNameid string, editId string, apksaddexternallyhostedrequest *ApksAddExternallyHostedRequest) *EditsApksAddexternallyhostedCall { + c := &EditsApksAddexternallyhostedCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.apksaddexternallyhostedrequest = apksaddexternallyhostedrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsApksAddexternallyhostedCall) Fields(s ...googleapi.Field) *EditsApksAddexternallyhostedCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsApksAddexternallyhostedCall) Context(ctx context.Context) *EditsApksAddexternallyhostedCall { + c.ctx_ = ctx + return c +} + +func (c *EditsApksAddexternallyhostedCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.apksaddexternallyhostedrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/externallyHosted") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.apks.addexternallyhosted" call. +// Exactly one of *ApksAddExternallyHostedResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ApksAddExternallyHostedResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsApksAddexternallyhostedCall) Do() (*ApksAddExternallyHostedResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ApksAddExternallyHostedResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new APK without uploading the APK itself to Google Play, instead hosting the APK at a specified URL. This function is only available to enterprises using Google Play for Work whose application is configured to restrict distribution to the enterprise domain.", + // "httpMethod": "POST", + // "id": "androidpublisher.edits.apks.addexternallyhosted", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/apks/externallyHosted", + // "request": { + // "$ref": "ApksAddExternallyHostedRequest" + // }, + // "response": { + // "$ref": "ApksAddExternallyHostedResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.apks.list": + +type EditsApksListCall struct { + s *Service + packageNameid string + editId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: +func (r *EditsApksService) List(packageNameid string, editId string) *EditsApksListCall { + c := &EditsApksListCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsApksListCall) Fields(s ...googleapi.Field) *EditsApksListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsApksListCall) IfNoneMatch(entityTag string) *EditsApksListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsApksListCall) Context(ctx context.Context) *EditsApksListCall { + c.ctx_ = ctx + return c +} + +func (c *EditsApksListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.apks.list" call. +// Exactly one of *ApksListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ApksListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsApksListCall) Do() (*ApksListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ApksListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "GET", + // "id": "androidpublisher.edits.apks.list", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/apks", + // "response": { + // "$ref": "ApksListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.apks.upload": + +type EditsApksUploadCall struct { + s *Service + packageNameid string + editId string + opt_ map[string]interface{} + media_ io.Reader + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// Upload: +func (r *EditsApksService) Upload(packageNameid string, editId string) *EditsApksUploadCall { + c := &EditsApksUploadCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + return c +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *EditsApksUploadCall) Media(r io.Reader) *EditsApksUploadCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *EditsApksUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsApksUploadCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *EditsApksUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsApksUploadCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsApksUploadCall) Fields(s ...googleapi.Field) *EditsApksUploadCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *EditsApksUploadCall) Context(ctx context.Context) *EditsApksUploadCall { + c.ctx_ = ctx + return c +} + +func (c *EditsApksUploadCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + body = new(bytes.Buffer) + ctype := "application/json" + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.apks.upload" call. +// Exactly one of *Apk or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Apk.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *EditsApksUploadCall) Do() (*Apk, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &Apk{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "POST", + // "id": "androidpublisher.edits.apks.upload", + // "mediaUpload": { + // "accept": [ + // "application/octet-stream", + // "application/vnd.android.package-archive" + // ], + // "maxSize": "1GB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks" + // } + // } + // }, + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/apks", + // "response": { + // "$ref": "Apk" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "androidpublisher.edits.details.get": + +type EditsDetailsGetCall struct { + s *Service + packageNameid string + editId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Fetches app details for this edit. This includes the default +// language and developer support contact information. +func (r *EditsDetailsService) Get(packageNameid string, editId string) *EditsDetailsGetCall { + c := &EditsDetailsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsDetailsGetCall) Fields(s ...googleapi.Field) *EditsDetailsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsDetailsGetCall) IfNoneMatch(entityTag string) *EditsDetailsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsDetailsGetCall) Context(ctx context.Context) *EditsDetailsGetCall { + c.ctx_ = ctx + return c +} + +func (c *EditsDetailsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/details") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.details.get" call. +// Exactly one of *AppDetails or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AppDetails.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EditsDetailsGetCall) Do() (*AppDetails, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AppDetails{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Fetches app details for this edit. This includes the default language and developer support contact information.", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.details.get", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/details", + // "response": { + // "$ref": "AppDetails" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.details.patch": + +type EditsDetailsPatchCall struct { + s *Service + packageNameid string + editId string + appdetails *AppDetails + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates app details for this edit. This method supports patch +// semantics. +func (r *EditsDetailsService) Patch(packageNameid string, editId string, appdetails *AppDetails) *EditsDetailsPatchCall { + c := &EditsDetailsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.appdetails = appdetails + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsDetailsPatchCall) Fields(s ...googleapi.Field) *EditsDetailsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsDetailsPatchCall) Context(ctx context.Context) *EditsDetailsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *EditsDetailsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.appdetails) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/details") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.details.patch" call. +// Exactly one of *AppDetails or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AppDetails.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EditsDetailsPatchCall) Do() (*AppDetails, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AppDetails{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates app details for this edit. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "androidpublisher.edits.details.patch", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/details", + // "request": { + // "$ref": "AppDetails" + // }, + // "response": { + // "$ref": "AppDetails" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.details.update": + +type EditsDetailsUpdateCall struct { + s *Service + packageNameid string + editId string + appdetails *AppDetails + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates app details for this edit. +func (r *EditsDetailsService) Update(packageNameid string, editId string, appdetails *AppDetails) *EditsDetailsUpdateCall { + c := &EditsDetailsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.appdetails = appdetails + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsDetailsUpdateCall) Fields(s ...googleapi.Field) *EditsDetailsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsDetailsUpdateCall) Context(ctx context.Context) *EditsDetailsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *EditsDetailsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.appdetails) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/details") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.details.update" call. +// Exactly one of *AppDetails or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AppDetails.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EditsDetailsUpdateCall) Do() (*AppDetails, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AppDetails{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates app details for this edit.", + // "httpMethod": "PUT", + // "id": "androidpublisher.edits.details.update", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/details", + // "request": { + // "$ref": "AppDetails" + // }, + // "response": { + // "$ref": "AppDetails" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.expansionfiles.get": + +type EditsExpansionfilesGetCall struct { + s *Service + packageNameid string + editId string + apkVersionCode int64 + expansionFileType string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Fetches the Expansion File configuration for the APK specified. +func (r *EditsExpansionfilesService) Get(packageNameid string, editId string, apkVersionCode int64, expansionFileType string) *EditsExpansionfilesGetCall { + c := &EditsExpansionfilesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.apkVersionCode = apkVersionCode + c.expansionFileType = expansionFileType + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsExpansionfilesGetCall) Fields(s ...googleapi.Field) *EditsExpansionfilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsExpansionfilesGetCall) IfNoneMatch(entityTag string) *EditsExpansionfilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsExpansionfilesGetCall) Context(ctx context.Context) *EditsExpansionfilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *EditsExpansionfilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), + "expansionFileType": c.expansionFileType, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.expansionfiles.get" call. +// Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ExpansionFile.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsExpansionfilesGetCall) Do() (*ExpansionFile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ExpansionFile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Fetches the Expansion File configuration for the APK specified.", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.expansionfiles.get", + // "parameterOrder": [ + // "packageName", + // "editId", + // "apkVersionCode", + // "expansionFileType" + // ], + // "parameters": { + // "apkVersionCode": { + // "description": "The version code of the APK whose Expansion File configuration is being read or modified.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "expansionFileType": { + // "enum": [ + // "main", + // "patch" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", + // "response": { + // "$ref": "ExpansionFile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.expansionfiles.patch": + +type EditsExpansionfilesPatchCall struct { + s *Service + packageNameid string + editId string + apkVersionCode int64 + expansionFileType string + expansionfile *ExpansionFile + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates the APK's Expansion File configuration to reference +// another APK's Expansion Files. To add a new Expansion File use the +// Upload method. This method supports patch semantics. +func (r *EditsExpansionfilesService) Patch(packageNameid string, editId string, apkVersionCode int64, expansionFileType string, expansionfile *ExpansionFile) *EditsExpansionfilesPatchCall { + c := &EditsExpansionfilesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.apkVersionCode = apkVersionCode + c.expansionFileType = expansionFileType + c.expansionfile = expansionfile + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsExpansionfilesPatchCall) Fields(s ...googleapi.Field) *EditsExpansionfilesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsExpansionfilesPatchCall) Context(ctx context.Context) *EditsExpansionfilesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *EditsExpansionfilesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.expansionfile) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), + "expansionFileType": c.expansionFileType, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.expansionfiles.patch" call. +// Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ExpansionFile.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsExpansionfilesPatchCall) Do() (*ExpansionFile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ExpansionFile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the APK's Expansion File configuration to reference another APK's Expansion Files. To add a new Expansion File use the Upload method. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "androidpublisher.edits.expansionfiles.patch", + // "parameterOrder": [ + // "packageName", + // "editId", + // "apkVersionCode", + // "expansionFileType" + // ], + // "parameters": { + // "apkVersionCode": { + // "description": "The version code of the APK whose Expansion File configuration is being read or modified.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "expansionFileType": { + // "enum": [ + // "main", + // "patch" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", + // "request": { + // "$ref": "ExpansionFile" + // }, + // "response": { + // "$ref": "ExpansionFile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.expansionfiles.update": + +type EditsExpansionfilesUpdateCall struct { + s *Service + packageNameid string + editId string + apkVersionCode int64 + expansionFileType string + expansionfile *ExpansionFile + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates the APK's Expansion File configuration to reference +// another APK's Expansion Files. To add a new Expansion File use the +// Upload method. +func (r *EditsExpansionfilesService) Update(packageNameid string, editId string, apkVersionCode int64, expansionFileType string, expansionfile *ExpansionFile) *EditsExpansionfilesUpdateCall { + c := &EditsExpansionfilesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.apkVersionCode = apkVersionCode + c.expansionFileType = expansionFileType + c.expansionfile = expansionfile + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsExpansionfilesUpdateCall) Fields(s ...googleapi.Field) *EditsExpansionfilesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsExpansionfilesUpdateCall) Context(ctx context.Context) *EditsExpansionfilesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *EditsExpansionfilesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.expansionfile) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), + "expansionFileType": c.expansionFileType, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.expansionfiles.update" call. +// Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ExpansionFile.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsExpansionfilesUpdateCall) Do() (*ExpansionFile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ExpansionFile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the APK's Expansion File configuration to reference another APK's Expansion Files. To add a new Expansion File use the Upload method.", + // "httpMethod": "PUT", + // "id": "androidpublisher.edits.expansionfiles.update", + // "parameterOrder": [ + // "packageName", + // "editId", + // "apkVersionCode", + // "expansionFileType" + // ], + // "parameters": { + // "apkVersionCode": { + // "description": "The version code of the APK whose Expansion File configuration is being read or modified.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "expansionFileType": { + // "enum": [ + // "main", + // "patch" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", + // "request": { + // "$ref": "ExpansionFile" + // }, + // "response": { + // "$ref": "ExpansionFile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.expansionfiles.upload": + +type EditsExpansionfilesUploadCall struct { + s *Service + packageNameid string + editId string + apkVersionCode int64 + expansionFileType string + opt_ map[string]interface{} + media_ io.Reader + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// Upload: Uploads and attaches a new Expansion File to the APK +// specified. +func (r *EditsExpansionfilesService) Upload(packageNameid string, editId string, apkVersionCode int64, expansionFileType string) *EditsExpansionfilesUploadCall { + c := &EditsExpansionfilesUploadCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.apkVersionCode = apkVersionCode + c.expansionFileType = expansionFileType + return c +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *EditsExpansionfilesUploadCall) Media(r io.Reader) *EditsExpansionfilesUploadCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *EditsExpansionfilesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsExpansionfilesUploadCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *EditsExpansionfilesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsExpansionfilesUploadCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsExpansionfilesUploadCall) Fields(s ...googleapi.Field) *EditsExpansionfilesUploadCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *EditsExpansionfilesUploadCall) Context(ctx context.Context) *EditsExpansionfilesUploadCall { + c.ctx_ = ctx + return c +} + +func (c *EditsExpansionfilesUploadCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + body = new(bytes.Buffer) + ctype := "application/json" + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10), + "expansionFileType": c.expansionFileType, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.expansionfiles.upload" call. +// Exactly one of *ExpansionFilesUploadResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ExpansionFilesUploadResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsExpansionfilesUploadCall) Do() (*ExpansionFilesUploadResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &ExpansionFilesUploadResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Uploads and attaches a new Expansion File to the APK specified.", + // "httpMethod": "POST", + // "id": "androidpublisher.edits.expansionfiles.upload", + // "mediaUpload": { + // "accept": [ + // "application/octet-stream" + // ], + // "maxSize": "2048MB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}" + // } + // } + // }, + // "parameterOrder": [ + // "packageName", + // "editId", + // "apkVersionCode", + // "expansionFileType" + // ], + // "parameters": { + // "apkVersionCode": { + // "description": "The version code of the APK whose Expansion File configuration is being read or modified.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "expansionFileType": { + // "enum": [ + // "main", + // "patch" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}", + // "response": { + // "$ref": "ExpansionFilesUploadResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "androidpublisher.edits.images.delete": + +type EditsImagesDeleteCall struct { + s *Service + packageNameid string + editId string + language string + imageType string + imageId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the image (specified by id) from the edit. +func (r *EditsImagesService) Delete(packageNameid string, editId string, language string, imageType string, imageId string) *EditsImagesDeleteCall { + c := &EditsImagesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.language = language + c.imageType = imageType + c.imageId = imageId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsImagesDeleteCall) Fields(s ...googleapi.Field) *EditsImagesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsImagesDeleteCall) Context(ctx context.Context) *EditsImagesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *EditsImagesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + "language": c.language, + "imageType": c.imageType, + "imageId": c.imageId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.images.delete" call. +func (c *EditsImagesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the image (specified by id) from the edit.", + // "httpMethod": "DELETE", + // "id": "androidpublisher.edits.images.delete", + // "parameterOrder": [ + // "packageName", + // "editId", + // "language", + // "imageType", + // "imageId" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "imageId": { + // "description": "Unique identifier an image within the set of images attached to this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "imageType": { + // "enum": [ + // "featureGraphic", + // "icon", + // "phoneScreenshots", + // "promoGraphic", + // "sevenInchScreenshots", + // "tenInchScreenshots", + // "tvBanner", + // "tvScreenshots", + // "wearScreenshots" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "language": { + // "description": "The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass \"de-AT\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}", + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.images.deleteall": + +type EditsImagesDeleteallCall struct { + s *Service + packageNameid string + editId string + language string + imageType string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Deleteall: Deletes all images for the specified language and image +// type. +func (r *EditsImagesService) Deleteall(packageNameid string, editId string, language string, imageType string) *EditsImagesDeleteallCall { + c := &EditsImagesDeleteallCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.language = language + c.imageType = imageType + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsImagesDeleteallCall) Fields(s ...googleapi.Field) *EditsImagesDeleteallCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsImagesDeleteallCall) Context(ctx context.Context) *EditsImagesDeleteallCall { + c.ctx_ = ctx + return c +} + +func (c *EditsImagesDeleteallCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}/{imageType}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + "language": c.language, + "imageType": c.imageType, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.images.deleteall" call. +// Exactly one of *ImagesDeleteAllResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ImagesDeleteAllResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsImagesDeleteallCall) Do() (*ImagesDeleteAllResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ImagesDeleteAllResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes all images for the specified language and image type.", + // "httpMethod": "DELETE", + // "id": "androidpublisher.edits.images.deleteall", + // "parameterOrder": [ + // "packageName", + // "editId", + // "language", + // "imageType" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "imageType": { + // "enum": [ + // "featureGraphic", + // "icon", + // "phoneScreenshots", + // "promoGraphic", + // "sevenInchScreenshots", + // "tenInchScreenshots", + // "tvBanner", + // "tvScreenshots", + // "wearScreenshots" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "language": { + // "description": "The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass \"de-AT\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/listings/{language}/{imageType}", + // "response": { + // "$ref": "ImagesDeleteAllResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.images.list": + +type EditsImagesListCall struct { + s *Service + packageNameid string + editId string + language string + imageType string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all images for the specified language and image type. +func (r *EditsImagesService) List(packageNameid string, editId string, language string, imageType string) *EditsImagesListCall { + c := &EditsImagesListCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.language = language + c.imageType = imageType + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsImagesListCall) Fields(s ...googleapi.Field) *EditsImagesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsImagesListCall) IfNoneMatch(entityTag string) *EditsImagesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsImagesListCall) Context(ctx context.Context) *EditsImagesListCall { + c.ctx_ = ctx + return c +} + +func (c *EditsImagesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}/{imageType}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + "language": c.language, + "imageType": c.imageType, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.images.list" call. +// Exactly one of *ImagesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ImagesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsImagesListCall) Do() (*ImagesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ImagesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all images for the specified language and image type.", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.images.list", + // "parameterOrder": [ + // "packageName", + // "editId", + // "language", + // "imageType" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "imageType": { + // "enum": [ + // "featureGraphic", + // "icon", + // "phoneScreenshots", + // "promoGraphic", + // "sevenInchScreenshots", + // "tenInchScreenshots", + // "tvBanner", + // "tvScreenshots", + // "wearScreenshots" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "language": { + // "description": "The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass \"de-AT\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/listings/{language}/{imageType}", + // "response": { + // "$ref": "ImagesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.images.upload": + +type EditsImagesUploadCall struct { + s *Service + packageNameid string + editId string + language string + imageType string + opt_ map[string]interface{} + media_ io.Reader + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// Upload: Uploads a new image and adds it to the list of images for the +// specified language and image type. +func (r *EditsImagesService) Upload(packageNameid string, editId string, language string, imageType string) *EditsImagesUploadCall { + c := &EditsImagesUploadCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.language = language + c.imageType = imageType + return c +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *EditsImagesUploadCall) Media(r io.Reader) *EditsImagesUploadCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *EditsImagesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsImagesUploadCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *EditsImagesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsImagesUploadCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsImagesUploadCall) Fields(s ...googleapi.Field) *EditsImagesUploadCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *EditsImagesUploadCall) Context(ctx context.Context) *EditsImagesUploadCall { + c.ctx_ = ctx + return c +} + +func (c *EditsImagesUploadCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}/{imageType}") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + body = new(bytes.Buffer) + ctype := "application/json" + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + "language": c.language, + "imageType": c.imageType, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.images.upload" call. +// Exactly one of *ImagesUploadResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ImagesUploadResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsImagesUploadCall) Do() (*ImagesUploadResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &ImagesUploadResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Uploads a new image and adds it to the list of images for the specified language and image type.", + // "httpMethod": "POST", + // "id": "androidpublisher.edits.images.upload", + // "mediaUpload": { + // "accept": [ + // "image/*" + // ], + // "maxSize": "15MB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}" + // } + // } + // }, + // "parameterOrder": [ + // "packageName", + // "editId", + // "language", + // "imageType" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "imageType": { + // "enum": [ + // "featureGraphic", + // "icon", + // "phoneScreenshots", + // "promoGraphic", + // "sevenInchScreenshots", + // "tenInchScreenshots", + // "tvBanner", + // "tvScreenshots", + // "wearScreenshots" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "language": { + // "description": "The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass \"de-AT\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/listings/{language}/{imageType}", + // "response": { + // "$ref": "ImagesUploadResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "androidpublisher.edits.listings.delete": + +type EditsListingsDeleteCall struct { + s *Service + packageNameid string + editId string + language string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified localized store listing from an edit. +func (r *EditsListingsService) Delete(packageNameid string, editId string, language string) *EditsListingsDeleteCall { + c := &EditsListingsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.language = language + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsListingsDeleteCall) Fields(s ...googleapi.Field) *EditsListingsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsListingsDeleteCall) Context(ctx context.Context) *EditsListingsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *EditsListingsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + "language": c.language, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.listings.delete" call. +func (c *EditsListingsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified localized store listing from an edit.", + // "httpMethod": "DELETE", + // "id": "androidpublisher.edits.listings.delete", + // "parameterOrder": [ + // "packageName", + // "editId", + // "language" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "language": { + // "description": "The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/listings/{language}", + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.listings.deleteall": + +type EditsListingsDeleteallCall struct { + s *Service + packageNameid string + editId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Deleteall: Deletes all localized listings from an edit. +func (r *EditsListingsService) Deleteall(packageNameid string, editId string) *EditsListingsDeleteallCall { + c := &EditsListingsDeleteallCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsListingsDeleteallCall) Fields(s ...googleapi.Field) *EditsListingsDeleteallCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsListingsDeleteallCall) Context(ctx context.Context) *EditsListingsDeleteallCall { + c.ctx_ = ctx + return c +} + +func (c *EditsListingsDeleteallCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.listings.deleteall" call. +func (c *EditsListingsDeleteallCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes all localized listings from an edit.", + // "httpMethod": "DELETE", + // "id": "androidpublisher.edits.listings.deleteall", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/listings", + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.listings.get": + +type EditsListingsGetCall struct { + s *Service + packageNameid string + editId string + language string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Fetches information about a localized store listing. +func (r *EditsListingsService) Get(packageNameid string, editId string, language string) *EditsListingsGetCall { + c := &EditsListingsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.language = language + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsListingsGetCall) Fields(s ...googleapi.Field) *EditsListingsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsListingsGetCall) IfNoneMatch(entityTag string) *EditsListingsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsListingsGetCall) Context(ctx context.Context) *EditsListingsGetCall { + c.ctx_ = ctx + return c +} + +func (c *EditsListingsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + "language": c.language, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.listings.get" call. +// Exactly one of *Listing or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Listing.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsListingsGetCall) Do() (*Listing, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Listing{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Fetches information about a localized store listing.", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.listings.get", + // "parameterOrder": [ + // "packageName", + // "editId", + // "language" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "language": { + // "description": "The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/listings/{language}", + // "response": { + // "$ref": "Listing" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.listings.list": + +type EditsListingsListCall struct { + s *Service + packageNameid string + editId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Returns all of the localized store listings attached to this +// edit. +func (r *EditsListingsService) List(packageNameid string, editId string) *EditsListingsListCall { + c := &EditsListingsListCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsListingsListCall) Fields(s ...googleapi.Field) *EditsListingsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsListingsListCall) IfNoneMatch(entityTag string) *EditsListingsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsListingsListCall) Context(ctx context.Context) *EditsListingsListCall { + c.ctx_ = ctx + return c +} + +func (c *EditsListingsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.listings.list" call. +// Exactly one of *ListingsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListingsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsListingsListCall) Do() (*ListingsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListingsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns all of the localized store listings attached to this edit.", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.listings.list", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/listings", + // "response": { + // "$ref": "ListingsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.listings.patch": + +type EditsListingsPatchCall struct { + s *Service + packageNameid string + editId string + language string + listing *Listing + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Creates or updates a localized store listing. This method +// supports patch semantics. +func (r *EditsListingsService) Patch(packageNameid string, editId string, language string, listing *Listing) *EditsListingsPatchCall { + c := &EditsListingsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.language = language + c.listing = listing + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsListingsPatchCall) Fields(s ...googleapi.Field) *EditsListingsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsListingsPatchCall) Context(ctx context.Context) *EditsListingsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *EditsListingsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + "language": c.language, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.listings.patch" call. +// Exactly one of *Listing or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Listing.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsListingsPatchCall) Do() (*Listing, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Listing{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates or updates a localized store listing. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "androidpublisher.edits.listings.patch", + // "parameterOrder": [ + // "packageName", + // "editId", + // "language" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "language": { + // "description": "The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/listings/{language}", + // "request": { + // "$ref": "Listing" + // }, + // "response": { + // "$ref": "Listing" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.listings.update": + +type EditsListingsUpdateCall struct { + s *Service + packageNameid string + editId string + language string + listing *Listing + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Creates or updates a localized store listing. +func (r *EditsListingsService) Update(packageNameid string, editId string, language string, listing *Listing) *EditsListingsUpdateCall { + c := &EditsListingsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.language = language + c.listing = listing + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsListingsUpdateCall) Fields(s ...googleapi.Field) *EditsListingsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsListingsUpdateCall) Context(ctx context.Context) *EditsListingsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *EditsListingsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + "language": c.language, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.listings.update" call. +// Exactly one of *Listing or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Listing.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsListingsUpdateCall) Do() (*Listing, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Listing{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates or updates a localized store listing.", + // "httpMethod": "PUT", + // "id": "androidpublisher.edits.listings.update", + // "parameterOrder": [ + // "packageName", + // "editId", + // "language" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "language": { + // "description": "The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/listings/{language}", + // "request": { + // "$ref": "Listing" + // }, + // "response": { + // "$ref": "Listing" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.testers.get": + +type EditsTestersGetCall struct { + s *Service + packageNameid string + editId string + track string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: +func (r *EditsTestersService) Get(packageNameid string, editId string, track string) *EditsTestersGetCall { + c := &EditsTestersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.track = track + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsTestersGetCall) Fields(s ...googleapi.Field) *EditsTestersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsTestersGetCall) IfNoneMatch(entityTag string) *EditsTestersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsTestersGetCall) Context(ctx context.Context) *EditsTestersGetCall { + c.ctx_ = ctx + return c +} + +func (c *EditsTestersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/testers/{track}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + "track": c.track, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.testers.get" call. +// Exactly one of *Testers or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Testers.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsTestersGetCall) Do() (*Testers, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Testers{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "GET", + // "id": "androidpublisher.edits.testers.get", + // "parameterOrder": [ + // "packageName", + // "editId", + // "track" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "track": { + // "enum": [ + // "alpha", + // "beta", + // "production", + // "rollout" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "" + // ], + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/testers/{track}", + // "response": { + // "$ref": "Testers" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.testers.patch": + +type EditsTestersPatchCall struct { + s *Service + packageNameid string + editId string + track string + testers *Testers + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: +func (r *EditsTestersService) Patch(packageNameid string, editId string, track string, testers *Testers) *EditsTestersPatchCall { + c := &EditsTestersPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.track = track + c.testers = testers + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsTestersPatchCall) Fields(s ...googleapi.Field) *EditsTestersPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsTestersPatchCall) Context(ctx context.Context) *EditsTestersPatchCall { + c.ctx_ = ctx + return c +} + +func (c *EditsTestersPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testers) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/testers/{track}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + "track": c.track, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.testers.patch" call. +// Exactly one of *Testers or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Testers.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsTestersPatchCall) Do() (*Testers, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Testers{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "PATCH", + // "id": "androidpublisher.edits.testers.patch", + // "parameterOrder": [ + // "packageName", + // "editId", + // "track" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "track": { + // "enum": [ + // "alpha", + // "beta", + // "production", + // "rollout" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "" + // ], + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/testers/{track}", + // "request": { + // "$ref": "Testers" + // }, + // "response": { + // "$ref": "Testers" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.testers.update": + +type EditsTestersUpdateCall struct { + s *Service + packageNameid string + editId string + track string + testers *Testers + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: +func (r *EditsTestersService) Update(packageNameid string, editId string, track string, testers *Testers) *EditsTestersUpdateCall { + c := &EditsTestersUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.track = track + c.testers = testers + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsTestersUpdateCall) Fields(s ...googleapi.Field) *EditsTestersUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsTestersUpdateCall) Context(ctx context.Context) *EditsTestersUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *EditsTestersUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testers) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/testers/{track}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + "track": c.track, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.testers.update" call. +// Exactly one of *Testers or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Testers.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsTestersUpdateCall) Do() (*Testers, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Testers{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "PUT", + // "id": "androidpublisher.edits.testers.update", + // "parameterOrder": [ + // "packageName", + // "editId", + // "track" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "track": { + // "enum": [ + // "alpha", + // "beta", + // "production", + // "rollout" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "" + // ], + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/testers/{track}", + // "request": { + // "$ref": "Testers" + // }, + // "response": { + // "$ref": "Testers" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.tracks.get": + +type EditsTracksGetCall struct { + s *Service + packageNameid string + editId string + track string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Fetches the track configuration for the specified track type. +// Includes the APK version codes that are in this track. +func (r *EditsTracksService) Get(packageNameid string, editId string, track string) *EditsTracksGetCall { + c := &EditsTracksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.track = track + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsTracksGetCall) Fields(s ...googleapi.Field) *EditsTracksGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsTracksGetCall) IfNoneMatch(entityTag string) *EditsTracksGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsTracksGetCall) Context(ctx context.Context) *EditsTracksGetCall { + c.ctx_ = ctx + return c +} + +func (c *EditsTracksGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/tracks/{track}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + "track": c.track, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.tracks.get" call. +// Exactly one of *Track or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Track.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsTracksGetCall) Do() (*Track, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Track{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Fetches the track configuration for the specified track type. Includes the APK version codes that are in this track.", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.tracks.get", + // "parameterOrder": [ + // "packageName", + // "editId", + // "track" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "track": { + // "description": "The track type to read or modify.", + // "enum": [ + // "alpha", + // "beta", + // "production", + // "rollout" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "" + // ], + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/tracks/{track}", + // "response": { + // "$ref": "Track" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.tracks.list": + +type EditsTracksListCall struct { + s *Service + packageNameid string + editId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all the track configurations for this edit. +func (r *EditsTracksService) List(packageNameid string, editId string) *EditsTracksListCall { + c := &EditsTracksListCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsTracksListCall) Fields(s ...googleapi.Field) *EditsTracksListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EditsTracksListCall) IfNoneMatch(entityTag string) *EditsTracksListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsTracksListCall) Context(ctx context.Context) *EditsTracksListCall { + c.ctx_ = ctx + return c +} + +func (c *EditsTracksListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/tracks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.tracks.list" call. +// Exactly one of *TracksListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TracksListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EditsTracksListCall) Do() (*TracksListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TracksListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all the track configurations for this edit.", + // "httpMethod": "GET", + // "id": "androidpublisher.edits.tracks.list", + // "parameterOrder": [ + // "packageName", + // "editId" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/tracks", + // "response": { + // "$ref": "TracksListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.tracks.patch": + +type EditsTracksPatchCall struct { + s *Service + packageNameid string + editId string + track string + track2 *Track + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates the track configuration for the specified track type. +// When halted, the rollout track cannot be updated without adding new +// APKs, and adding new APKs will cause it to resume. This method +// supports patch semantics. +func (r *EditsTracksService) Patch(packageNameid string, editId string, track string, track2 *Track) *EditsTracksPatchCall { + c := &EditsTracksPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.track = track + c.track2 = track2 + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsTracksPatchCall) Fields(s ...googleapi.Field) *EditsTracksPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsTracksPatchCall) Context(ctx context.Context) *EditsTracksPatchCall { + c.ctx_ = ctx + return c +} + +func (c *EditsTracksPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.track2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/tracks/{track}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + "track": c.track, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.tracks.patch" call. +// Exactly one of *Track or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Track.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsTracksPatchCall) Do() (*Track, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Track{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the track configuration for the specified track type. When halted, the rollout track cannot be updated without adding new APKs, and adding new APKs will cause it to resume. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "androidpublisher.edits.tracks.patch", + // "parameterOrder": [ + // "packageName", + // "editId", + // "track" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "track": { + // "description": "The track type to read or modify.", + // "enum": [ + // "alpha", + // "beta", + // "production", + // "rollout" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "" + // ], + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/tracks/{track}", + // "request": { + // "$ref": "Track" + // }, + // "response": { + // "$ref": "Track" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.edits.tracks.update": + +type EditsTracksUpdateCall struct { + s *Service + packageNameid string + editId string + track string + track2 *Track + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates the track configuration for the specified track type. +// When halted, the rollout track cannot be updated without adding new +// APKs, and adding new APKs will cause it to resume. +func (r *EditsTracksService) Update(packageNameid string, editId string, track string, track2 *Track) *EditsTracksUpdateCall { + c := &EditsTracksUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.editId = editId + c.track = track + c.track2 = track2 + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EditsTracksUpdateCall) Fields(s ...googleapi.Field) *EditsTracksUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EditsTracksUpdateCall) Context(ctx context.Context) *EditsTracksUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *EditsTracksUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.track2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/tracks/{track}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "editId": c.editId, + "track": c.track, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.edits.tracks.update" call. +// Exactly one of *Track or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Track.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EditsTracksUpdateCall) Do() (*Track, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Track{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the track configuration for the specified track type. When halted, the rollout track cannot be updated without adding new APKs, and adding new APKs will cause it to resume.", + // "httpMethod": "PUT", + // "id": "androidpublisher.edits.tracks.update", + // "parameterOrder": [ + // "packageName", + // "editId", + // "track" + // ], + // "parameters": { + // "editId": { + // "description": "Unique identifier for this edit.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "track": { + // "description": "The track type to read or modify.", + // "enum": [ + // "alpha", + // "beta", + // "production", + // "rollout" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "" + // ], + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/edits/{editId}/tracks/{track}", + // "request": { + // "$ref": "Track" + // }, + // "response": { + // "$ref": "Track" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.entitlements.list": + +type EntitlementsListCall struct { + s *Service + packageName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the user's current inapp item or subscription +// entitlements +func (r *EntitlementsService) List(packageName string) *EntitlementsListCall { + c := &EntitlementsListCall{s: r.s, opt_: make(map[string]interface{})} + c.packageName = packageName + return c +} + +// MaxResults sets the optional parameter "maxResults": +func (c *EntitlementsListCall) MaxResults(maxResults int64) *EntitlementsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// ProductId sets the optional parameter "productId": The product id of +// the inapp product (for example, 'sku1'). This can be used to restrict +// the result set. +func (c *EntitlementsListCall) ProductId(productId string) *EntitlementsListCall { + c.opt_["productId"] = productId + return c +} + +// StartIndex sets the optional parameter "startIndex": +func (c *EntitlementsListCall) StartIndex(startIndex int64) *EntitlementsListCall { + c.opt_["startIndex"] = startIndex + return c +} + +// Token sets the optional parameter "token": +func (c *EntitlementsListCall) Token(token string) *EntitlementsListCall { + c.opt_["token"] = token + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EntitlementsListCall) Fields(s ...googleapi.Field) *EntitlementsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EntitlementsListCall) IfNoneMatch(entityTag string) *EntitlementsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EntitlementsListCall) Context(ctx context.Context) *EntitlementsListCall { + c.ctx_ = ctx + return c +} + +func (c *EntitlementsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["productId"]; ok { + params.Set("productId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startIndex"]; ok { + params.Set("startIndex", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["token"]; ok { + params.Set("token", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/entitlements") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.entitlements.list" call. +// Exactly one of *EntitlementsListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *EntitlementsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EntitlementsListCall) Do() (*EntitlementsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EntitlementsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the user's current inapp item or subscription entitlements", + // "httpMethod": "GET", + // "id": "androidpublisher.entitlements.list", + // "parameterOrder": [ + // "packageName" + // ], + // "parameters": { + // "maxResults": { + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "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 product id of the inapp product (for example, 'sku1'). This can be used to restrict the result set.", + // "location": "query", + // "type": "string" + // }, + // "startIndex": { + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "token": { + // "location": "query", + // "type": "string" + // } + // }, + // "path": "{packageName}/entitlements", + // "response": { + // "$ref": "EntitlementsListResponse" + // } + // } + +} + +// method id "androidpublisher.inappproducts.batch": + +type InappproductsBatchCall struct { + s *Service + inappproductsbatchrequest *InappproductsBatchRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Batch: +func (r *InappproductsService) Batch(inappproductsbatchrequest *InappproductsBatchRequest) *InappproductsBatchCall { + c := &InappproductsBatchCall{s: r.s, opt_: make(map[string]interface{})} + c.inappproductsbatchrequest = inappproductsbatchrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InappproductsBatchCall) Fields(s ...googleapi.Field) *InappproductsBatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InappproductsBatchCall) Context(ctx context.Context) *InappproductsBatchCall { + c.ctx_ = ctx + return c +} + +func (c *InappproductsBatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproductsbatchrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "inappproducts/batch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.inappproducts.batch" call. +// Exactly one of *InappproductsBatchResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *InappproductsBatchResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InappproductsBatchCall) Do() (*InappproductsBatchResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InappproductsBatchResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "POST", + // "id": "androidpublisher.inappproducts.batch", + // "path": "inappproducts/batch", + // "request": { + // "$ref": "InappproductsBatchRequest" + // }, + // "response": { + // "$ref": "InappproductsBatchResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.inappproducts.delete": + +type InappproductsDeleteCall struct { + s *Service + packageNameid string + skuid string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Delete an in-app product for an app. +func (r *InappproductsService) Delete(packageNameid string, skuid string) *InappproductsDeleteCall { + c := &InappproductsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.skuid = skuid + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InappproductsDeleteCall) Fields(s ...googleapi.Field) *InappproductsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InappproductsDeleteCall) Context(ctx context.Context) *InappproductsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *InappproductsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts/{sku}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "sku": c.skuid, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.inappproducts.delete" call. +func (c *InappproductsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete an in-app product for an app.", + // "httpMethod": "DELETE", + // "id": "androidpublisher.inappproducts.delete", + // "parameterOrder": [ + // "packageName", + // "sku" + // ], + // "parameters": { + // "packageName": { + // "description": "Unique identifier for the Android app with the in-app product; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sku": { + // "description": "Unique identifier for the in-app product.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/inappproducts/{sku}", + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.inappproducts.get": + +type InappproductsGetCall struct { + s *Service + packageName string + skuid string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns information about the in-app product specified. +func (r *InappproductsService) Get(packageName string, skuid string) *InappproductsGetCall { + c := &InappproductsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.packageName = packageName + c.skuid = skuid + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InappproductsGetCall) Fields(s ...googleapi.Field) *InappproductsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InappproductsGetCall) IfNoneMatch(entityTag string) *InappproductsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InappproductsGetCall) Context(ctx context.Context) *InappproductsGetCall { + c.ctx_ = ctx + return c +} + +func (c *InappproductsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts/{sku}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "sku": c.skuid, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.inappproducts.get" call. +// Exactly one of *InAppProduct or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *InAppProduct.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InappproductsGetCall) Do() (*InAppProduct, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InAppProduct{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns information about the in-app product specified.", + // "httpMethod": "GET", + // "id": "androidpublisher.inappproducts.get", + // "parameterOrder": [ + // "packageName", + // "sku" + // ], + // "parameters": { + // "packageName": { + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sku": { + // "description": "Unique identifier for the in-app product.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/inappproducts/{sku}", + // "response": { + // "$ref": "InAppProduct" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.inappproducts.insert": + +type InappproductsInsertCall struct { + s *Service + packageNameid string + inappproduct *InAppProduct + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a new in-app product for an app. +func (r *InappproductsService) Insert(packageNameid string, inappproduct *InAppProduct) *InappproductsInsertCall { + c := &InappproductsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.inappproduct = inappproduct + return c +} + +// AutoConvertMissingPrices sets the optional parameter +// "autoConvertMissingPrices": If true the prices for all regions +// targeted by the parent app that don't have a price specified for this +// in-app product will be auto converted to the target currency based on +// the default price. Defaults to false. +func (c *InappproductsInsertCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsInsertCall { + c.opt_["autoConvertMissingPrices"] = autoConvertMissingPrices + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InappproductsInsertCall) Fields(s ...googleapi.Field) *InappproductsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InappproductsInsertCall) Context(ctx context.Context) *InappproductsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *InappproductsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["autoConvertMissingPrices"]; ok { + params.Set("autoConvertMissingPrices", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.inappproducts.insert" call. +// Exactly one of *InAppProduct or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *InAppProduct.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InappproductsInsertCall) Do() (*InAppProduct, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InAppProduct{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new in-app product for an app.", + // "httpMethod": "POST", + // "id": "androidpublisher.inappproducts.insert", + // "parameterOrder": [ + // "packageName" + // ], + // "parameters": { + // "autoConvertMissingPrices": { + // "description": "If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false.", + // "location": "query", + // "type": "boolean" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/inappproducts", + // "request": { + // "$ref": "InAppProduct" + // }, + // "response": { + // "$ref": "InAppProduct" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.inappproducts.list": + +type InappproductsListCall struct { + s *Service + packageNameid string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List all the in-app products for an Android app, both +// subscriptions and managed in-app products.. +func (r *InappproductsService) List(packageNameid string) *InappproductsListCall { + c := &InappproductsListCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + return c +} + +// MaxResults sets the optional parameter "maxResults": +func (c *InappproductsListCall) MaxResults(maxResults int64) *InappproductsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// StartIndex sets the optional parameter "startIndex": +func (c *InappproductsListCall) StartIndex(startIndex int64) *InappproductsListCall { + c.opt_["startIndex"] = startIndex + return c +} + +// Token sets the optional parameter "token": +func (c *InappproductsListCall) Token(token string) *InappproductsListCall { + c.opt_["token"] = token + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InappproductsListCall) Fields(s ...googleapi.Field) *InappproductsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InappproductsListCall) IfNoneMatch(entityTag string) *InappproductsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InappproductsListCall) Context(ctx context.Context) *InappproductsListCall { + c.ctx_ = ctx + return c +} + +func (c *InappproductsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["token"]; ok { + params.Set("token", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.inappproducts.list" call. +// Exactly one of *InappproductsListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *InappproductsListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InappproductsListCall) Do() (*InappproductsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InappproductsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all the in-app products for an Android app, both subscriptions and managed in-app products..", + // "httpMethod": "GET", + // "id": "androidpublisher.inappproducts.list", + // "parameterOrder": [ + // "packageName" + // ], + // "parameters": { + // "maxResults": { + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app with in-app products; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "startIndex": { + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "token": { + // "location": "query", + // "type": "string" + // } + // }, + // "path": "{packageName}/inappproducts", + // "response": { + // "$ref": "InappproductsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.inappproducts.patch": + +type InappproductsPatchCall struct { + s *Service + packageNameid string + skuid string + inappproduct *InAppProduct + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates the details of an in-app product. This method supports +// patch semantics. +func (r *InappproductsService) Patch(packageNameid string, skuid string, inappproduct *InAppProduct) *InappproductsPatchCall { + c := &InappproductsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.skuid = skuid + c.inappproduct = inappproduct + return c +} + +// AutoConvertMissingPrices sets the optional parameter +// "autoConvertMissingPrices": If true the prices for all regions +// targeted by the parent app that don't have a price specified for this +// in-app product will be auto converted to the target currency based on +// the default price. Defaults to false. +func (c *InappproductsPatchCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsPatchCall { + c.opt_["autoConvertMissingPrices"] = autoConvertMissingPrices + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InappproductsPatchCall) Fields(s ...googleapi.Field) *InappproductsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InappproductsPatchCall) Context(ctx context.Context) *InappproductsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *InappproductsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["autoConvertMissingPrices"]; ok { + params.Set("autoConvertMissingPrices", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts/{sku}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "sku": c.skuid, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.inappproducts.patch" call. +// Exactly one of *InAppProduct or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *InAppProduct.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InappproductsPatchCall) Do() (*InAppProduct, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InAppProduct{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the details of an in-app product. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "androidpublisher.inappproducts.patch", + // "parameterOrder": [ + // "packageName", + // "sku" + // ], + // "parameters": { + // "autoConvertMissingPrices": { + // "description": "If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false.", + // "location": "query", + // "type": "boolean" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app with the in-app product; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sku": { + // "description": "Unique identifier for the in-app product.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/inappproducts/{sku}", + // "request": { + // "$ref": "InAppProduct" + // }, + // "response": { + // "$ref": "InAppProduct" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.inappproducts.update": + +type InappproductsUpdateCall struct { + s *Service + packageNameid string + skuid string + inappproduct *InAppProduct + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates the details of an in-app product. +func (r *InappproductsService) Update(packageNameid string, skuid string, inappproduct *InAppProduct) *InappproductsUpdateCall { + c := &InappproductsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.packageNameid = packageNameid + c.skuid = skuid + c.inappproduct = inappproduct + return c +} + +// AutoConvertMissingPrices sets the optional parameter +// "autoConvertMissingPrices": If true the prices for all regions +// targeted by the parent app that don't have a price specified for this +// in-app product will be auto converted to the target currency based on +// the default price. Defaults to false. +func (c *InappproductsUpdateCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsUpdateCall { + c.opt_["autoConvertMissingPrices"] = autoConvertMissingPrices + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InappproductsUpdateCall) Fields(s ...googleapi.Field) *InappproductsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InappproductsUpdateCall) Context(ctx context.Context) *InappproductsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *InappproductsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["autoConvertMissingPrices"]; ok { + params.Set("autoConvertMissingPrices", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts/{sku}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageNameid, + "sku": c.skuid, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.inappproducts.update" call. +// Exactly one of *InAppProduct or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *InAppProduct.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InappproductsUpdateCall) Do() (*InAppProduct, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InAppProduct{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the details of an in-app product.", + // "httpMethod": "PUT", + // "id": "androidpublisher.inappproducts.update", + // "parameterOrder": [ + // "packageName", + // "sku" + // ], + // "parameters": { + // "autoConvertMissingPrices": { + // "description": "If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false.", + // "location": "query", + // "type": "boolean" + // }, + // "packageName": { + // "description": "Unique identifier for the Android app with the in-app product; for example, \"com.spiffygame\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sku": { + // "description": "Unique identifier for the in-app product.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{packageName}/inappproducts/{sku}", + // "request": { + // "$ref": "InAppProduct" + // }, + // "response": { + // "$ref": "InAppProduct" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.purchases.products.get": + +type PurchasesProductsGetCall struct { + s *Service + packageName string + productId string + token string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Checks the purchase and consumption status of an inapp item. +func (r *PurchasesProductsService) Get(packageName string, productId string, token string) *PurchasesProductsGetCall { + c := &PurchasesProductsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.packageName = packageName + c.productId = productId + c.token = token + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PurchasesProductsGetCall) Fields(s ...googleapi.Field) *PurchasesProductsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PurchasesProductsGetCall) IfNoneMatch(entityTag string) *PurchasesProductsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PurchasesProductsGetCall) Context(ctx context.Context) *PurchasesProductsGetCall { + c.ctx_ = ctx + return c +} + +func (c *PurchasesProductsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/products/{productId}/tokens/{token}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "productId": c.productId, + "token": c.token, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.purchases.products.get" call. +// Exactly one of *ProductPurchase or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ProductPurchase.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PurchasesProductsGetCall) Do() (*ProductPurchase, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProductPurchase{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Checks the purchase and consumption status of an inapp item.", + // "httpMethod": "GET", + // "id": "androidpublisher.purchases.products.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}/purchases/products/{productId}/tokens/{token}", + // "response": { + // "$ref": "ProductPurchase" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.purchases.subscriptions.cancel": + +type PurchasesSubscriptionsCancelCall struct { + s *Service + packageName string + subscriptionId string + token string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Cancel: Cancels a user's subscription purchase. The subscription +// remains valid until its expiration time. +func (r *PurchasesSubscriptionsService) Cancel(packageName string, subscriptionId string, token string) *PurchasesSubscriptionsCancelCall { + c := &PurchasesSubscriptionsCancelCall{s: r.s, opt_: make(map[string]interface{})} + c.packageName = packageName + c.subscriptionId = subscriptionId + c.token = token + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PurchasesSubscriptionsCancelCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsCancelCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PurchasesSubscriptionsCancelCall) Context(ctx context.Context) *PurchasesSubscriptionsCancelCall { + c.ctx_ = ctx + return c +} + +func (c *PurchasesSubscriptionsCancelCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:cancel") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "subscriptionId": c.subscriptionId, + "token": c.token, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.purchases.subscriptions.cancel" call. +func (c *PurchasesSubscriptionsCancelCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Cancels a user's subscription purchase. The subscription remains valid until its expiration time.", + // "httpMethod": "POST", + // "id": "androidpublisher.purchases.subscriptions.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}/purchases/subscriptions/{subscriptionId}/tokens/{token}:cancel", + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.purchases.subscriptions.defer": + +type PurchasesSubscriptionsDeferCall struct { + s *Service + packageName string + subscriptionId string + token string + subscriptionpurchasesdeferrequest *SubscriptionPurchasesDeferRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Defer: Defers a user's subscription purchase until a specified future +// expiration time. +func (r *PurchasesSubscriptionsService) Defer(packageName string, subscriptionId string, token string, subscriptionpurchasesdeferrequest *SubscriptionPurchasesDeferRequest) *PurchasesSubscriptionsDeferCall { + c := &PurchasesSubscriptionsDeferCall{s: r.s, opt_: make(map[string]interface{})} + c.packageName = packageName + c.subscriptionId = subscriptionId + c.token = token + c.subscriptionpurchasesdeferrequest = subscriptionpurchasesdeferrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PurchasesSubscriptionsDeferCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsDeferCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PurchasesSubscriptionsDeferCall) Context(ctx context.Context) *PurchasesSubscriptionsDeferCall { + c.ctx_ = ctx + return c +} + +func (c *PurchasesSubscriptionsDeferCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscriptionpurchasesdeferrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:defer") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "subscriptionId": c.subscriptionId, + "token": c.token, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.purchases.subscriptions.defer" call. +// Exactly one of *SubscriptionPurchasesDeferResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *SubscriptionPurchasesDeferResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PurchasesSubscriptionsDeferCall) Do() (*SubscriptionPurchasesDeferResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SubscriptionPurchasesDeferResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Defers a user's subscription purchase until a specified future expiration time.", + // "httpMethod": "POST", + // "id": "androidpublisher.purchases.subscriptions.defer", + // "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}/purchases/subscriptions/{subscriptionId}/tokens/{token}:defer", + // "request": { + // "$ref": "SubscriptionPurchasesDeferRequest" + // }, + // "response": { + // "$ref": "SubscriptionPurchasesDeferResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.purchases.subscriptions.get": + +type PurchasesSubscriptionsGetCall struct { + s *Service + packageName string + subscriptionId string + token string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Checks whether a user's subscription purchase is valid and +// returns its expiry time. +func (r *PurchasesSubscriptionsService) Get(packageName string, subscriptionId string, token string) *PurchasesSubscriptionsGetCall { + c := &PurchasesSubscriptionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.packageName = packageName + c.subscriptionId = subscriptionId + c.token = token + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PurchasesSubscriptionsGetCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PurchasesSubscriptionsGetCall) IfNoneMatch(entityTag string) *PurchasesSubscriptionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PurchasesSubscriptionsGetCall) Context(ctx context.Context) *PurchasesSubscriptionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *PurchasesSubscriptionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "subscriptionId": c.subscriptionId, + "token": c.token, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.purchases.subscriptions.get" call. +// Exactly one of *SubscriptionPurchase or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SubscriptionPurchase.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PurchasesSubscriptionsGetCall) Do() (*SubscriptionPurchase, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SubscriptionPurchase{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Checks whether a user's subscription purchase is valid and returns its expiry time.", + // "httpMethod": "GET", + // "id": "androidpublisher.purchases.subscriptions.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}/purchases/subscriptions/{subscriptionId}/tokens/{token}", + // "response": { + // "$ref": "SubscriptionPurchase" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.purchases.subscriptions.refund": + +type PurchasesSubscriptionsRefundCall struct { + s *Service + packageName string + subscriptionId string + token string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Refund: Refunds a user's subscription purchase, but the subscription +// remains valid until its expiration time and it will continue to +// recur. +func (r *PurchasesSubscriptionsService) Refund(packageName string, subscriptionId string, token string) *PurchasesSubscriptionsRefundCall { + c := &PurchasesSubscriptionsRefundCall{s: r.s, opt_: make(map[string]interface{})} + c.packageName = packageName + c.subscriptionId = subscriptionId + c.token = token + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PurchasesSubscriptionsRefundCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsRefundCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PurchasesSubscriptionsRefundCall) Context(ctx context.Context) *PurchasesSubscriptionsRefundCall { + c.ctx_ = ctx + return c +} + +func (c *PurchasesSubscriptionsRefundCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:refund") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "subscriptionId": c.subscriptionId, + "token": c.token, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.purchases.subscriptions.refund" call. +func (c *PurchasesSubscriptionsRefundCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Refunds a user's subscription purchase, but the subscription remains valid until its expiration time and it will continue to recur.", + // "httpMethod": "POST", + // "id": "androidpublisher.purchases.subscriptions.refund", + // "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}/purchases/subscriptions/{subscriptionId}/tokens/{token}:refund", + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "androidpublisher.purchases.subscriptions.revoke": + +type PurchasesSubscriptionsRevokeCall struct { + s *Service + packageName string + subscriptionId string + token string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Revoke: Refunds and immediately revokes a user's subscription +// purchase. Access to the subscription will be terminated immediately +// and it will stop recurring. +func (r *PurchasesSubscriptionsService) Revoke(packageName string, subscriptionId string, token string) *PurchasesSubscriptionsRevokeCall { + c := &PurchasesSubscriptionsRevokeCall{s: r.s, opt_: make(map[string]interface{})} + c.packageName = packageName + c.subscriptionId = subscriptionId + c.token = token + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PurchasesSubscriptionsRevokeCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsRevokeCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PurchasesSubscriptionsRevokeCall) Context(ctx context.Context) *PurchasesSubscriptionsRevokeCall { + c.ctx_ = ctx + return c +} + +func (c *PurchasesSubscriptionsRevokeCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:revoke") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "packageName": c.packageName, + "subscriptionId": c.subscriptionId, + "token": c.token, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "androidpublisher.purchases.subscriptions.revoke" call. +func (c *PurchasesSubscriptionsRevokeCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Refunds and immediately revokes a user's subscription purchase. Access to the subscription will be terminated immediately and it will stop recurring.", + // "httpMethod": "POST", + // "id": "androidpublisher.purchases.subscriptions.revoke", + // "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}/purchases/subscriptions/{subscriptionId}/tokens/{token}:revoke", + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/api-list.json b/Godeps/_workspace/src/google.golang.org/api/api-list.json new file mode 100644 index 000000000..41f792a28 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/api-list.json @@ -0,0 +1,2226 @@ +{ + "kind": "discovery#directoryList", + "discoveryVersion": "v1", + "items": [ + { + "kind": "discovery#directoryItem", + "id": "adexchangebuyer:v1.2", + "name": "adexchangebuyer", + "version": "v1.2", + "title": "Ad Exchange Buyer API", + "description": "Accesses your bidding-account information, submits creatives for validation, finds available direct deals, and retrieves performance reports.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/adexchangebuyer/v1.2/rest", + "discoveryLink": "./apis/adexchangebuyer/v1.2/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/ad-exchange/buyer-rest", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "adexchangebuyer:v1.3", + "name": "adexchangebuyer", + "version": "v1.3", + "title": "Ad Exchange Buyer API", + "description": "Accesses your bidding-account information, submits creatives for validation, finds available direct deals, and retrieves performance reports.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/adexchangebuyer/v1.3/rest", + "discoveryLink": "./apis/adexchangebuyer/v1.3/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/ad-exchange/buyer-rest", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "adexchangebuyer:v1.4", + "name": "adexchangebuyer", + "version": "v1.4", + "title": "Ad Exchange Buyer API", + "description": "Accesses your bidding-account information, submits creatives for validation, finds available direct deals, and retrieves performance reports.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/adexchangebuyer/v1.4/rest", + "discoveryLink": "./apis/adexchangebuyer/v1.4/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/ad-exchange/buyer-rest", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "adexchangeseller:v1", + "name": "adexchangeseller", + "version": "v1", + "title": "Ad Exchange Seller API", + "description": "Gives Ad Exchange seller users access to their inventory and the ability to generate reports", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/adexchangeseller/v1/rest", + "discoveryLink": "./apis/adexchangeseller/v1/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/ad-exchange/seller-rest/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "adexchangeseller:v1.1", + "name": "adexchangeseller", + "version": "v1.1", + "title": "Ad Exchange Seller API", + "description": "Gives Ad Exchange seller users access to their inventory and the ability to generate reports", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/adexchangeseller/v1.1/rest", + "discoveryLink": "./apis/adexchangeseller/v1.1/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/ad-exchange/seller-rest/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "adexchangeseller:v2.0", + "name": "adexchangeseller", + "version": "v2.0", + "title": "Ad Exchange Seller API", + "description": "Gives Ad Exchange seller users access to their inventory and the ability to generate reports", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/adexchangeseller/v2.0/rest", + "discoveryLink": "./apis/adexchangeseller/v2.0/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/ad-exchange/seller-rest/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "admin:datatransfer_v1", + "name": "admin", + "version": "datatransfer_v1", + "title": "Admin Data Transfer API", + "description": "Admin Data Transfer API lets you transfer user data from one user to another.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/admin/datatransfer_v1/rest", + "discoveryLink": "./apis/admin/datatransfer_v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://developers.google.com/admin-sdk/data-transfer/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "admin:directory_v1", + "name": "admin", + "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.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/admin/directory_v1/rest", + "discoveryLink": "./apis/admin/directory_v1/rest", + "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/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "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.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/admin/email_migration_v2/rest", + "discoveryLink": "./apis/admin/email_migration_v2/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/googlemail-16.png", + "x32": "https://www.google.com/images/icons/product/googlemail-32.png" + }, + "documentationLink": "https://developers.google.com/admin-sdk/email-migration/v2/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "admin:reports_v1", + "name": "admin", + "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.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/admin/reports_v1/rest", + "discoveryLink": "./apis/admin/reports_v1/rest", + "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/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "adsense:v1.2", + "name": "adsense", + "version": "v1.2", + "title": "AdSense Management API", + "description": "Gives AdSense publishers access to their inventory and the ability to generate reports", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/adsense/v1.2/rest", + "discoveryLink": "./apis/adsense/v1.2/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/adsense-16.png", + "x32": "https://www.google.com/images/icons/product/adsense-32.png" + }, + "documentationLink": "https://developers.google.com/adsense/management/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "adsense:v1.3", + "name": "adsense", + "version": "v1.3", + "title": "AdSense Management API", + "description": "Gives AdSense publishers access to their inventory and the ability to generate reports", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/adsense/v1.3/rest", + "discoveryLink": "./apis/adsense/v1.3/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/adsense-16.png", + "x32": "https://www.google.com/images/icons/product/adsense-32.png" + }, + "documentationLink": "https://developers.google.com/adsense/management/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "adsense:v1.4", + "name": "adsense", + "version": "v1.4", + "title": "AdSense Management API", + "description": "Gives AdSense publishers access to their inventory and the ability to generate reports", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/adsense/v1.4/rest", + "discoveryLink": "./apis/adsense/v1.4/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/adsense-16.png", + "x32": "https://www.google.com/images/icons/product/adsense-32.png" + }, + "documentationLink": "https://developers.google.com/adsense/management/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "adsensehost:v4.1", + "name": "adsensehost", + "version": "v4.1", + "title": "AdSense Host API", + "description": "Gives AdSense Hosts access to report generation, ad code generation, and publisher management capabilities.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/adsensehost/v4.1/rest", + "discoveryLink": "./apis/adsensehost/v4.1/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/adsense-16.png", + "x32": "https://www.google.com/images/icons/product/adsense-32.png" + }, + "documentationLink": "https://developers.google.com/adsense/host/", + "labels": [ + "limited_availability" + ], + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "analytics:v2.4", + "name": "analytics", + "version": "v2.4", + "title": "Google Analytics API", + "description": "View and manage your Google Analytics data", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/analytics/v2.4/rest", + "discoveryLink": "./apis/analytics/v2.4/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/analytics-16.png", + "x32": "https://www.google.com/images/icons/product/analytics-32.png" + }, + "documentationLink": "https://developers.google.com/analytics/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "analytics:v3", + "name": "analytics", + "version": "v3", + "title": "Google Analytics API", + "description": "View and manage your Google Analytics data", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/analytics/v3/rest", + "discoveryLink": "./apis/analytics/v3/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/analytics-16.png", + "x32": "https://www.google.com/images/icons/product/analytics-32.png" + }, + "documentationLink": "https://developers.google.com/analytics/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "androidenterprise:v1", + "name": "androidenterprise", + "version": "v1", + "title": "Google Play EMM API", + "description": "Allows MDMs/EMMs and enterprises to manage the deployment of apps to Android for Work users.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/androidenterprise/v1/rest", + "discoveryLink": "./apis/androidenterprise/v1/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/android-16.png", + "x32": "https://www.google.com/images/icons/product/android-32.png" + }, + "documentationLink": "https://developers.google.com/play/enterprise", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "androidpublisher:v1", + "name": "androidpublisher", + "version": "v1", + "title": "Google Play Developer API", + "description": "Lets Android application developers access their Google Play accounts.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/androidpublisher/v1/rest", + "discoveryLink": "./apis/androidpublisher/v1/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/android-16.png", + "x32": "https://www.google.com/images/icons/product/android-32.png" + }, + "documentationLink": "https://developers.google.com/android-publisher", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "androidpublisher:v1.1", + "name": "androidpublisher", + "version": "v1.1", + "title": "Google Play Developer API", + "description": "Lets Android application developers access their Google Play accounts.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/androidpublisher/v1.1/rest", + "discoveryLink": "./apis/androidpublisher/v1.1/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/android-16.png", + "x32": "https://www.google.com/images/icons/product/android-32.png" + }, + "documentationLink": "https://developers.google.com/android-publisher", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "androidpublisher:v2", + "name": "androidpublisher", + "version": "v2", + "title": "Google Play Developer API", + "description": "Lets Android application developers access their Google Play accounts.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/androidpublisher/v2/rest", + "discoveryLink": "./apis/androidpublisher/v2/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/android-16.png", + "x32": "https://www.google.com/images/icons/product/android-32.png" + }, + "documentationLink": "https://developers.google.com/android-publisher", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "appsactivity:v1", + "name": "appsactivity", + "version": "v1", + "title": "Google Apps Activity API", + "description": "Provides a historical view of activity.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/appsactivity/v1/rest", + "discoveryLink": "./apis/appsactivity/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://developers.google.com/google-apps/activity/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "appstate:v1", + "name": "appstate", + "version": "v1", + "title": "Google App State API", + "description": "The Google App State API.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/appstate/v1/rest", + "discoveryLink": "./apis/appstate/v1/rest", + "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", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "autoscaler:v1beta2", + "name": "autoscaler", + "version": "v1beta2", + "title": "Google Compute Engine Autoscaler API", + "description": "The Google Compute Engine Autoscaler API provides autoscaling for groups of Cloud VMs.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/autoscaler/v1beta2/rest", + "discoveryLink": "./apis/autoscaler/v1beta2/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "http://developers.google.com/compute/docs/autoscaler", + "labels": [ + "limited_availability" + ], + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "bigquery:v2", + "name": "bigquery", + "version": "v2", + "title": "BigQuery API", + "description": "A data platform for customers to create, manage, share and query data.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/bigquery/v2/rest", + "discoveryLink": "./apis/bigquery/v2/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/search-16.gif", + "x32": "https://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/bigquery/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "blogger:v2", + "name": "blogger", + "version": "v2", + "title": "Blogger API", + "description": "API for access to the data within Blogger.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/blogger/v2/rest", + "discoveryLink": "./apis/blogger/v2/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/blogger-16.png", + "x32": "https://www.google.com/images/icons/product/blogger-32.png" + }, + "documentationLink": "https://developers.google.com/blogger/docs/2.0/json/getting_started", + "labels": [ + "limited_availability" + ], + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "blogger:v3", + "name": "blogger", + "version": "v3", + "title": "Blogger API", + "description": "API for access to the data within Blogger.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/blogger/v3/rest", + "discoveryLink": "./apis/blogger/v3/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/blogger-16.png", + "x32": "https://www.google.com/images/icons/product/blogger-32.png" + }, + "documentationLink": "https://developers.google.com/blogger/docs/3.0/getting_started", + "labels": [ + "limited_availability" + ], + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "books:v1", + "name": "books", + "version": "v1", + "title": "Books API", + "description": "Lets you search for books and manage your Google Books library.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/books/v1/rest", + "discoveryLink": "./apis/books/v1/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/ebooks-16.png", + "x32": "https://www.google.com/images/icons/product/ebooks-32.png" + }, + "documentationLink": "https://developers.google.com/books/docs/v1/getting_started", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "calendar:v3", + "name": "calendar", + "version": "v3", + "title": "Calendar API", + "description": "Lets you manipulate events and other calendar data.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest", + "discoveryLink": "./apis/calendar/v3/rest", + "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", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "civicinfo:v2", + "name": "civicinfo", + "version": "v2", + "title": "Google Civic Information API", + "description": "An API for accessing civic information.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/civicinfo/v2/rest", + "discoveryLink": "./apis/civicinfo/v2/rest", + "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", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "cloudlatencytest:v2", + "name": "cloudlatencytest", + "version": "v2", + "title": "Google Cloud Network Performance Monitoring API", + "description": "A Test API to report latency data.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/cloudlatencytest/v2/rest", + "discoveryLink": "./apis/cloudlatencytest/v2/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "cloudmonitoring:v2beta2", + "name": "cloudmonitoring", + "version": "v2beta2", + "title": "Cloud Monitoring API", + "description": "API for accessing Google Cloud and API monitoring data.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/cloudmonitoring/v2beta2/rest", + "discoveryLink": "./apis/cloudmonitoring/v2beta2/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/monitoring/v2beta2/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "clouduseraccounts:alpha", + "name": "clouduseraccounts", + "version": "alpha", + "title": "Cloud User Accounts API", + "description": "API for the Google Cloud User Accounts service.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/clouduseraccounts/alpha/rest", + "discoveryLink": "./apis/clouduseraccounts/alpha/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/compute_engine-16.png", + "x32": "https://www.google.com/images/icons/product/compute_engine-32.png" + }, + "documentationLink": "https://cloud.google.com/compute/docs/access/user-accounts/api/latest/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "clouduseraccounts:beta", + "name": "clouduseraccounts", + "version": "beta", + "title": "Cloud User Accounts API", + "description": "API for the Google Cloud User Accounts service.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/clouduseraccounts/beta/rest", + "discoveryLink": "./apis/clouduseraccounts/beta/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/compute_engine-16.png", + "x32": "https://www.google.com/images/icons/product/compute_engine-32.png" + }, + "documentationLink": "https://cloud.google.com/compute/docs/access/user-accounts/api/latest/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "clouduseraccounts:vm_alpha", + "name": "clouduseraccounts", + "version": "vm_alpha", + "title": "Cloud User Accounts API", + "description": "API for the Google Cloud User Accounts service.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/clouduseraccounts/vm_alpha/rest", + "discoveryLink": "./apis/clouduseraccounts/vm_alpha/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/compute_engine-16.png", + "x32": "https://www.google.com/images/icons/product/compute_engine-32.png" + }, + "documentationLink": "https://cloud.google.com/compute/docs/access/user-accounts/api/latest/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "clouduseraccounts:vm_beta", + "name": "clouduseraccounts", + "version": "vm_beta", + "title": "Cloud User Accounts API", + "description": "API for the Google Cloud User Accounts service.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/clouduseraccounts/vm_beta/rest", + "discoveryLink": "./apis/clouduseraccounts/vm_beta/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/compute_engine-16.png", + "x32": "https://www.google.com/images/icons/product/compute_engine-32.png" + }, + "documentationLink": "https://cloud.google.com/compute/docs/access/user-accounts/api/latest/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "compute:v1", + "name": "compute", + "version": "v1", + "title": "Compute Engine API", + "description": "API for the Google Compute Engine service.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/compute/v1/rest", + "discoveryLink": "./apis/compute/v1/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/compute_engine-16.png", + "x32": "https://www.google.com/images/icons/product/compute_engine-32.png" + }, + "documentationLink": "https://developers.google.com/compute/docs/reference/latest/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "content:v2sandbox", + "name": "content", + "version": "v2sandbox", + "title": "Content API for Shopping", + "description": "Manage product items, inventory, and Merchant Center accounts for Google Shopping.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/content/v2sandbox/rest", + "discoveryLink": "./apis/content/v2sandbox/rest", + "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-content", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "content:v2", + "name": "content", + "version": "v2", + "title": "Content API for Shopping", + "description": "Manage product items, inventory, and Merchant Center accounts for Google Shopping.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/content/v2/rest", + "discoveryLink": "./apis/content/v2/rest", + "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-content", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "coordinate:v1", + "name": "coordinate", + "version": "v1", + "title": "Google Maps Coordinate API", + "description": "Lets you view and manage jobs in a Coordinate team.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/coordinate/v1/rest", + "discoveryLink": "./apis/coordinate/v1/rest", + "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/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "customsearch:v1", + "name": "customsearch", + "version": "v1", + "title": "CustomSearch API", + "description": "Lets you search over a website or collection of websites", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/customsearch/v1/rest", + "discoveryLink": "./apis/customsearch/v1/rest", + "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", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "datastore:v1beta1", + "name": "datastore", + "version": "v1beta1", + "title": "Google Cloud Datastore API", + "description": "API for accessing Google Cloud Datastore.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/datastore/v1beta1/rest", + "discoveryLink": "./apis/datastore/v1beta1/rest", + "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/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "datastore:v1beta2", + "name": "datastore", + "version": "v1beta2", + "title": "Google Cloud Datastore API", + "description": "API for accessing Google Cloud Datastore.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/datastore/v1beta2/rest", + "discoveryLink": "./apis/datastore/v1beta2/rest", + "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/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "deploymentmanager:v2", + "name": "deploymentmanager", + "version": "v2", + "title": "Google Cloud Deployment Manager API", + "description": "The Deployment Manager API allows users to declaratively configure, deploy and run complex solutions on the Google Cloud Platform.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/deploymentmanager/v2/rest", + "discoveryLink": "./apis/deploymentmanager/v2/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/deployment-manager/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "deploymentmanager:v2beta1", + "name": "deploymentmanager", + "version": "v2beta1", + "title": "Google Cloud Deployment Manager API", + "description": "The Deployment Manager API allows users to declaratively configure, deploy and run complex solutions on the Google Cloud Platform.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/deploymentmanager/v2beta1/rest", + "discoveryLink": "./apis/deploymentmanager/v2beta1/rest", + "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/deployment-manager/", + "labels": [ + "limited_availability" + ], + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "deploymentmanager:v2beta2", + "name": "deploymentmanager", + "version": "v2beta2", + "title": "Google Cloud Deployment Manager API", + "description": "The Deployment Manager API allows users to declaratively configure, deploy and run complex solutions on the Google Cloud Platform.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/deploymentmanager/v2beta2/rest", + "discoveryLink": "./apis/deploymentmanager/v2beta2/rest", + "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/deployment-manager/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "dfareporting:v1", + "name": "dfareporting", + "version": "v1", + "title": "DFA Reporting API", + "description": "Lets you create, run and download reports.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/dfareporting/v1/rest", + "discoveryLink": "./apis/dfareporting/v1/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/doubleclick-advertisers/reporting/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "dfareporting:v1.1", + "name": "dfareporting", + "version": "v1.1", + "title": "DFA Reporting API", + "description": "Lets you create, run and download reports.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/dfareporting/v1.1/rest", + "discoveryLink": "./apis/dfareporting/v1.1/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/doubleclick-advertisers/reporting/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "dfareporting:v1.2", + "name": "dfareporting", + "version": "v1.2", + "title": "DFA Reporting API", + "description": "Lets you create, run and download reports.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/dfareporting/v1.2/rest", + "discoveryLink": "./apis/dfareporting/v1.2/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/doubleclick-advertisers/reporting/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "dfareporting:v1.3", + "name": "dfareporting", + "version": "v1.3", + "title": "DFA Reporting API", + "description": "Lets you create, run and download reports.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/dfareporting/v1.3/rest", + "discoveryLink": "./apis/dfareporting/v1.3/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/doubleclick-advertisers/reporting/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "dfareporting:v2.0", + "name": "dfareporting", + "version": "v2.0", + "title": "DCM/DFA Reporting And Trafficking API", + "description": "Manage your DoubleClick Campaign Manager ad campaigns and reports.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/dfareporting/v2.0/rest", + "discoveryLink": "./apis/dfareporting/v2.0/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/doubleclick-advertisers/reporting/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "dfareporting:v2.1", + "name": "dfareporting", + "version": "v2.1", + "title": "DCM/DFA Reporting And Trafficking API", + "description": "Manage your DoubleClick Campaign Manager ad campaigns and reports.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/dfareporting/v2.1/rest", + "discoveryLink": "./apis/dfareporting/v2.1/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/doubleclick-advertisers/reporting/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "dfareporting:v2.2", + "name": "dfareporting", + "version": "v2.2", + "title": "DCM/DFA Reporting And Trafficking API", + "description": "Manage your DoubleClick Campaign Manager ad campaigns and reports.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/dfareporting/v2.2/rest", + "discoveryLink": "./apis/dfareporting/v2.2/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/doubleclick-advertisers/reporting/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "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.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/discovery/v1/rest", + "discoveryLink": "./apis/discovery/v1/rest", + "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/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "dns:v1", + "name": "dns", + "version": "v1", + "title": "Google Cloud DNS API", + "description": "The Google Cloud DNS API provides services for configuring and serving authoritative DNS records.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/dns/v1/rest", + "discoveryLink": "./apis/dns/v1/rest", + "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", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "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.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/dns/v1beta1/rest", + "discoveryLink": "./apis/dns/v1beta1/rest", + "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", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "doubleclickbidmanager:v1", + "name": "doubleclickbidmanager", + "version": "v1", + "title": "DoubleClick Bid Manager API", + "description": "API for viewing and managing your reports in DoubleClick Bid Manager.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/doubleclickbidmanager/v1/rest", + "discoveryLink": "./apis/doubleclickbidmanager/v1/rest", + "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" + ], + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "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).", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/doubleclicksearch/v2/rest", + "discoveryLink": "./apis/doubleclicksearch/v2/rest", + "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/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "drive:v1", + "name": "drive", + "version": "v1", + "title": "Drive API", + "description": "The API to interact with Drive.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/drive/v1/rest", + "discoveryLink": "./apis/drive/v1/rest", + "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/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "drive:v2", + "name": "drive", + "version": "v2", + "title": "Drive API", + "description": "The API to interact with Drive.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/drive/v2/rest", + "discoveryLink": "./apis/drive/v2/rest", + "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/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "fitness:v1", + "name": "fitness", + "version": "v1", + "title": "Fitness", + "description": "Google Fit API", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/fitness/v1/rest", + "discoveryLink": "./apis/fitness/v1/rest", + "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/fit/rest/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "freebase:v1", + "name": "freebase", + "version": "v1", + "title": "Freebase Search", + "description": "Find Freebase entities using textual queries and other constraints.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/freebase/v1/rest", + "discoveryLink": "./apis/freebase/v1/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/freebase-16.png", + "x32": "https://www.google.com/images/icons/product/freebase-32.png" + }, + "documentationLink": "https://developers.google.com/freebase/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "fusiontables:v1", + "name": "fusiontables", + "version": "v1", + "title": "Fusion Tables API", + "description": "API for working with Fusion Tables data.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/fusiontables/v1/rest", + "discoveryLink": "./apis/fusiontables/v1/rest", + "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/fusiontables", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "fusiontables:v2", + "name": "fusiontables", + "version": "v2", + "title": "Fusion Tables API", + "description": "API for working with Fusion Tables data.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/fusiontables/v2/rest", + "discoveryLink": "./apis/fusiontables/v2/rest", + "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/fusiontables", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "games:v1", + "name": "games", + "version": "v1", + "title": "Google Play Game Services API", + "description": "The API for Google Play Game Services.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/games/v1/rest", + "discoveryLink": "./apis/games/v1/rest", + "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/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "gamesConfiguration:v1configuration", + "name": "gamesConfiguration", + "version": "v1configuration", + "title": "Google Play Game Services Publishing API", + "description": "The Publishing API for Google Play Game Services.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/gamesConfiguration/v1configuration/rest", + "discoveryLink": "./apis/gamesConfiguration/v1configuration/rest", + "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", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "gamesManagement:v1management", + "name": "gamesManagement", + "version": "v1management", + "title": "Google Play Game Services Management API", + "description": "The Management API for Google Play Game Services.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/gamesManagement/v1management/rest", + "discoveryLink": "./apis/gamesManagement/v1management/rest", + "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", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "gan:v1beta1", + "name": "gan", + "version": "v1beta1", + "title": "Google Affiliate Network API", + "description": "Lets you have programmatic access to your Google Affiliate Network data.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/gan/v1beta1/rest", + "discoveryLink": "./apis/gan/v1beta1/rest", + "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/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "genomics:v1beta2", + "name": "genomics", + "version": "v1beta2", + "title": "Genomics API", + "description": "Provides access to Genomics data.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/genomics/v1beta2/rest", + "discoveryLink": "./apis/genomics/v1beta2/rest", + "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/genomics/v1beta2/reference", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "gmail:v1", + "name": "gmail", + "version": "v1", + "title": "Gmail API", + "description": "The Gmail REST API.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/gmail/v1/rest", + "discoveryLink": "./apis/gmail/v1/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/googlemail-16.png", + "x32": "https://www.google.com/images/icons/product/googlemail-32.png" + }, + "documentationLink": "https://developers.google.com/gmail/api/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "groupsmigration:v1", + "name": "groupsmigration", + "version": "v1", + "title": "Groups Migration API", + "description": "Groups Migration Api.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/groupsmigration/v1/rest", + "discoveryLink": "./apis/groupsmigration/v1/rest", + "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/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "groupssettings:v1", + "name": "groupssettings", + "version": "v1", + "title": "Groups Settings API", + "description": "Lets you manage permission levels and related settings of a group.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/groupssettings/v1/rest", + "discoveryLink": "./apis/groupssettings/v1/rest", + "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", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "appengine:v1beta4", + "name": "appengine", + "version": "v1beta4", + "title": "Google App Engine Admin API", + "description": "The Google App Engine Admin API enables developers to provision and manage their App Engine applications.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/appengine/v1beta4/rest", + "discoveryLink": "./apis/appengine/v1beta4/rest", + "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/appengine/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "classroom:v1", + "name": "classroom", + "version": "v1", + "title": "Google Classroom API", + "description": "Google Classroom API", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/classroom/v1/rest", + "discoveryLink": "./apis/classroom/v1/rest", + "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/classroom/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "cloudbilling:v1", + "name": "cloudbilling", + "version": "v1", + "title": "Google Cloud Billing API", + "description": "Retrieves Google Developers Console billing accounts and associates them with projects.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/cloudbilling/v1/rest", + "discoveryLink": "./apis/cloudbilling/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/billing/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "clouddebugger:v2", + "name": "clouddebugger", + "version": "v2", + "title": "Google Cloud Debugger API", + "description": "Lets you examine the stack and variables of your running application without stopping or slowing it down.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/clouddebugger/v2/rest", + "discoveryLink": "./apis/clouddebugger/v2/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/tools/cloud-debugger", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "cloudresourcemanager:v1beta1", + "name": "cloudresourcemanager", + "version": "v1beta1", + "title": "Google Cloud Resource Manager API", + "description": "The Google Cloud Resource Manager API provides methods for creating, reading, and updating of project metadata.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/cloudresourcemanager/v1beta1/rest", + "discoveryLink": "./apis/cloudresourcemanager/v1beta1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/resource-manager", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "cloudtrace:v1", + "name": "cloudtrace", + "version": "v1", + "title": "Google Cloud Trace API", + "description": "The Google Cloud Trace API provides services for reading and writing runtime trace data for Cloud applications.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/cloudtrace/v1/rest", + "discoveryLink": "./apis/cloudtrace/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/tools/cloud-trace", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "container:v1", + "name": "container", + "version": "v1", + "title": "Google Container Engine API", + "description": "The Google Container Engine API is used for building and managing container based applications, powered by the open source Kubernetes technology.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/container/v1/rest", + "discoveryLink": "./apis/container/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/container-engine/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "dataflow:v1b3", + "name": "dataflow", + "version": "v1b3", + "title": "Google Dataflow API", + "description": "Google Dataflow API.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/dataflow/v1b3/rest", + "discoveryLink": "./apis/dataflow/v1b3/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/dataflow", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "genomics:v1", + "name": "genomics", + "version": "v1", + "title": "Genomics API", + "description": "An API to store, process, explore, and share DNA sequence reads, reference-based alignments, and variant calls.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/genomics/v1/rest", + "discoveryLink": "./apis/genomics/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "logging:v1beta3", + "name": "logging", + "version": "v1beta3", + "title": "Google Cloud Logging API", + "description": "Google Cloud Logging API lets you create logs, ingest log entries, and manage log sinks.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/logging/v1beta3/rest", + "discoveryLink": "./apis/logging/v1beta3/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/logging/docs/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "logging:v2beta1", + "name": "logging", + "version": "v2beta1", + "title": "Google Cloud Logging API", + "description": "Google Cloud Logging API lets you create logs, ingest log entries, and manage log sinks.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/logging/v2beta1/rest", + "discoveryLink": "./apis/logging/v2beta1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/logging/docs/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "partners:v2", + "name": "partners", + "version": "v2", + "title": "Google Partners API", + "description": "Lets advertisers search certified companies and create contact leads with them, and also audits the usage of clients.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/partners/v2/rest", + "discoveryLink": "./apis/partners/v2/rest", + "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/partners/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "playmoviespartner:v1", + "name": "playmoviespartner", + "version": "v1", + "title": "Google Play Movies Partner API", + "description": "Lets Google Play Movies Partners get the delivery status of their titles.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/playmoviespartner/v1/rest", + "discoveryLink": "./apis/playmoviespartner/v1/rest", + "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/playmoviespartner/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "proximitybeacon:v1beta1", + "name": "proximitybeacon", + "version": "v1beta1", + "title": "Google Proximity Beacon API", + "description": "This API provides services to register, manage, index, and search beacons.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/proximitybeacon/v1beta1/rest", + "discoveryLink": "./apis/proximitybeacon/v1beta1/rest", + "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/beacons/proximity/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "pubsub:v1beta1a", + "name": "pubsub", + "version": "v1beta1a", + "title": "Google Cloud Pub/Sub API", + "description": "Provides reliable, many-to-many, asynchronous messaging between applications.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/pubsub/v1beta1a/rest", + "discoveryLink": "./apis/pubsub/v1beta1a/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/pubsub/docs", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "pubsub:v1", + "name": "pubsub", + "version": "v1", + "title": "Google Cloud Pub/Sub API", + "description": "Provides reliable, many-to-many, asynchronous messaging between applications.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/pubsub/v1/rest", + "discoveryLink": "./apis/pubsub/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/pubsub/docs", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "pubsub:v1beta2", + "name": "pubsub", + "version": "v1beta2", + "title": "Google Cloud Pub/Sub API", + "description": "Provides reliable, many-to-many, asynchronous messaging between applications.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/pubsub/v1beta2/rest", + "discoveryLink": "./apis/pubsub/v1beta2/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/pubsub/docs", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "script:v1", + "name": "script", + "version": "v1", + "title": "Google Apps Script Execution API", + "description": "An API for executing Google Apps Script projects.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/script/v1/rest", + "discoveryLink": "./apis/script/v1/rest", + "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/apps-script/execution/rest/v1/run", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "storagetransfer:v1", + "name": "storagetransfer", + "version": "v1", + "title": "Google Storage Transfer API", + "description": "Transfers data from external data sources to a Google Cloud Storage bucket or between Google Cloud Storage buckets.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/storagetransfer/v1/rest", + "discoveryLink": "./apis/storagetransfer/v1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/storage/transfer", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "youtubereporting:v1", + "name": "youtubereporting", + "version": "v1", + "title": "YouTube Reporting API", + "description": "An API to schedule reporting jobs and download the resulting bulk data reports about YouTube channels, videos etc. in the form of CSV files.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/youtubereporting/v1/rest", + "discoveryLink": "./apis/youtubereporting/v1/rest", + "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/youtube/reporting/v1/reports/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "identitytoolkit:v3", + "name": "identitytoolkit", + "version": "v3", + "title": "Google Identity Toolkit API", + "description": "Help the third party sites to implement federated login.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/identitytoolkit/v3/rest", + "discoveryLink": "./apis/identitytoolkit/v3/rest", + "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/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "licensing:v1", + "name": "licensing", + "version": "v1", + "title": "Enterprise License Manager API", + "description": "Licensing API to view and manage license for your domain.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/licensing/v1/rest", + "discoveryLink": "./apis/licensing/v1/rest", + "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/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "manager:v1beta2", + "name": "manager", + "version": "v1beta2", + "title": "Deployment Manager API", + "description": "The Deployment Manager API allows users to declaratively configure, deploy and run complex solutions on the Google Cloud Platform.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/manager/v1beta2/rest", + "discoveryLink": "./apis/manager/v1beta2/rest", + "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/deployment-manager/", + "labels": [ + "limited_availability" + ], + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "mapsengine:exp2", + "name": "mapsengine", + "version": "exp2", + "title": "Google Maps Engine API", + "description": "The Google Maps Engine API allows developers to store and query geospatial vector and raster data.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/mapsengine/exp2/rest", + "discoveryLink": "./apis/mapsengine/exp2/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/maps_engine-16.png", + "x32": "https://www.google.com/images/icons/product/maps_engine-32.png" + }, + "documentationLink": "https://developers.google.com/maps-engine/", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "mapsengine:v1", + "name": "mapsengine", + "version": "v1", + "title": "Google Maps Engine API", + "description": "The Google Maps Engine API allows developers to store and query geospatial vector and raster data.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/mapsengine/v1/rest", + "discoveryLink": "./apis/mapsengine/v1/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/maps_engine-16.png", + "x32": "https://www.google.com/images/icons/product/maps_engine-32.png" + }, + "documentationLink": "https://developers.google.com/maps-engine/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "mirror:v1", + "name": "mirror", + "version": "v1", + "title": "Google Mirror API", + "description": "API for interacting with Glass users via the timeline.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/mirror/v1/rest", + "discoveryLink": "./apis/mirror/v1/rest", + "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" + ], + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "oauth2:v1", + "name": "oauth2", + "version": "v1", + "title": "Google OAuth2 API", + "description": "Lets you access OAuth2 protocol related APIs.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/oauth2/v1/rest", + "discoveryLink": "./apis/oauth2/v1/rest", + "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", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "oauth2:v2", + "name": "oauth2", + "version": "v2", + "title": "Google OAuth2 API", + "description": "Lets you access OAuth2 protocol related APIs.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/oauth2/v2/rest", + "discoveryLink": "./apis/oauth2/v2/rest", + "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", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "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.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/pagespeedonline/v1/rest", + "discoveryLink": "./apis/pagespeedonline/v1/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/pagespeed-16.png", + "x32": "https://www.google.com/images/icons/product/pagespeed-32.png" + }, + "documentationLink": "https://developers.google.com/speed/docs/insights/v1/getting_started", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "pagespeedonline:v2", + "name": "pagespeedonline", + "version": "v2", + "title": "PageSpeed Insights API", + "description": "Lets you analyze the performance of a web page and get tailored suggestions to make that page faster.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/pagespeedonline/v2/rest", + "discoveryLink": "./apis/pagespeedonline/v2/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/pagespeed-16.png", + "x32": "https://www.google.com/images/icons/product/pagespeed-32.png" + }, + "documentationLink": "https://developers.google.com/speed/docs/insights/v2/getting-started", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "plus:v1", + "name": "plus", + "version": "v1", + "title": "Google+ API", + "description": "The Google+ API enables developers to build on top of the Google+ platform.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/plus/v1/rest", + "discoveryLink": "./apis/plus/v1/rest", + "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/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "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.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/plusDomains/v1/rest", + "discoveryLink": "./apis/plusDomains/v1/rest", + "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/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "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", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/prediction/v1.2/rest", + "discoveryLink": "./apis/prediction/v1.2/rest", + "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", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "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", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/prediction/v1.3/rest", + "discoveryLink": "./apis/prediction/v1.3/rest", + "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", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "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", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/prediction/v1.4/rest", + "discoveryLink": "./apis/prediction/v1.4/rest", + "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", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "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", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/prediction/v1.5/rest", + "discoveryLink": "./apis/prediction/v1.5/rest", + "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", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "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", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/prediction/v1.6/rest", + "discoveryLink": "./apis/prediction/v1.6/rest", + "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", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "pubsub:v1beta1", + "name": "pubsub", + "version": "v1beta1", + "title": "Google Cloud Pub/Sub API", + "description": "Provides reliable, many-to-many, asynchronous messaging between applications.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/pubsub/v1beta1/rest", + "discoveryLink": "./apis/pubsub/v1beta1/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/search-16.gif", + "x32": "https://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://developers.google.com/pubsub/v1beta1", + "labels": [ + "limited_availability" + ], + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "qpxExpress:v1", + "name": "qpxExpress", + "version": "v1", + "title": "QPX Express API", + "description": "Lets you find the least expensive flights between an origin and a destination.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/qpxExpress/v1/rest", + "discoveryLink": "./apis/qpxExpress/v1/rest", + "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", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "replicapool:v1beta1", + "name": "replicapool", + "version": "v1beta1", + "title": "Replica Pool API", + "description": "The Replica Pool API allows users to declaratively provision and manage groups of Google Compute Engine instances based on a common template.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/replicapool/v1beta1/rest", + "discoveryLink": "./apis/replicapool/v1beta1/rest", + "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/compute/docs/replica-pool/", + "labels": [ + "limited_availability" + ], + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "replicapool:v1beta2", + "name": "replicapool", + "version": "v1beta2", + "title": "Google Compute Engine Instance Group Manager API", + "description": "The Google Compute Engine Instance Group Manager API provides groups of homogenous Compute Engine Instances.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/replicapool/v1beta2/rest", + "discoveryLink": "./apis/replicapool/v1beta2/rest", + "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/compute/docs/instance-groups/manager/v1beta2", + "labels": [ + "limited_availability" + ], + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "replicapoolupdater:v1beta1", + "name": "replicapoolupdater", + "version": "v1beta1", + "title": "Google Compute Engine Instance Group Updater API", + "description": "The Google Compute Engine Instance Group Updater API provides services for updating groups of Compute Engine Instances.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/replicapoolupdater/v1beta1/rest", + "discoveryLink": "./apis/replicapoolupdater/v1beta1/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/compute/docs/instance-groups/manager/#applying_rolling_updates_using_the_updater_service", + "labels": [ + "limited_availability" + ], + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "reseller:v1sandbox", + "name": "reseller", + "version": "v1sandbox", + "title": "Enterprise Apps Reseller API", + "description": "Lets you create and manage your customers and their subscriptions.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/reseller/v1sandbox/rest", + "discoveryLink": "./apis/reseller/v1sandbox/rest", + "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" + ], + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "reseller:v1", + "name": "reseller", + "version": "v1", + "title": "Enterprise Apps Reseller API", + "description": "Lets you create and manage your customers and their subscriptions.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/reseller/v1/rest", + "discoveryLink": "./apis/reseller/v1/rest", + "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" + ], + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "resourceviews:v1beta1", + "name": "resourceviews", + "version": "v1beta1", + "title": "Resource Views API", + "description": "The Resource View API allows users to create and manage logical sets of Google Compute Engine instances.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/resourceviews/v1beta1/rest", + "discoveryLink": "./apis/resourceviews/v1beta1/rest", + "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/compute/", + "labels": [ + "limited_availability" + ], + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "resourceviews:v1beta2", + "name": "resourceviews", + "version": "v1beta2", + "title": "Google Compute Engine Instance Groups API", + "description": "The Resource View API allows users to create and manage logical sets of Google Compute Engine instances.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/resourceviews/v1beta2/rest", + "discoveryLink": "./apis/resourceviews/v1beta2/rest", + "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/compute/", + "labels": [ + "limited_availability" + ], + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "siteVerification:v1", + "name": "siteVerification", + "version": "v1", + "title": "Google Site Verification API", + "description": "Lets you programatically verify ownership of websites or domains with Google.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/siteVerification/v1/rest", + "discoveryLink": "./apis/siteVerification/v1/rest", + "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/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "spectrum:v1explorer", + "name": "spectrum", + "version": "v1explorer", + "title": "Google Spectrum Database API", + "description": "API for spectrum-management functions.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/spectrum/v1explorer/rest", + "discoveryLink": "./apis/spectrum/v1explorer/rest", + "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", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "sqladmin:v1beta3", + "name": "sqladmin", + "version": "v1beta3", + "title": "Cloud SQL Administration API", + "description": "API for Cloud SQL database instance management.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/sqladmin/v1beta3/rest", + "discoveryLink": "./apis/sqladmin/v1beta3/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/sql/docs/reference/latest", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "sqladmin:v1beta4", + "name": "sqladmin", + "version": "v1beta4", + "title": "Cloud SQL Administration API", + "description": "API for Cloud SQL database instance management.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/sqladmin/v1beta4/rest", + "discoveryLink": "./apis/sqladmin/v1beta4/rest", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/sql/docs/reference/latest", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "storage:v1", + "name": "storage", + "version": "v1", + "title": "Cloud Storage JSON API", + "description": "Lets you store and retrieve potentially-large, immutable data objects.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/storage/v1/rest", + "discoveryLink": "./apis/storage/v1/rest", + "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" + ], + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "storage:v1beta1", + "name": "storage", + "version": "v1beta1", + "title": "Cloud Storage JSON API", + "description": "Lets you store and retrieve potentially-large, immutable data objects.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/storage/v1beta1/rest", + "discoveryLink": "./apis/storage/v1beta1/rest", + "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" + ], + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "storage:v1beta2", + "name": "storage", + "version": "v1beta2", + "title": "Cloud Storage JSON API", + "description": "Lets you store and retrieve potentially-large, immutable data objects.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/storage/v1beta2/rest", + "discoveryLink": "./apis/storage/v1beta2/rest", + "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" + ], + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "tagmanager:v1", + "name": "tagmanager", + "version": "v1", + "title": "Tag Manager API", + "description": "API for accessing Tag Manager accounts and containers.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/tagmanager/v1/rest", + "discoveryLink": "./apis/tagmanager/v1/rest", + "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/tag-manager/api/v1/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "taskqueue:v1beta1", + "name": "taskqueue", + "version": "v1beta1", + "title": "TaskQueue API", + "description": "Lets you access a Google App Engine Pull Task Queue over REST.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/taskqueue/v1beta1/rest", + "discoveryLink": "./apis/taskqueue/v1beta1/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/app_engine-16.png", + "x32": "https://www.google.com/images/icons/product/app_engine-32.png" + }, + "documentationLink": "https://developers.google.com/appengine/docs/python/taskqueue/rest", + "preferred": false + }, + { + "kind": "discovery#directoryItem", + "id": "taskqueue:v1beta2", + "name": "taskqueue", + "version": "v1beta2", + "title": "TaskQueue API", + "description": "Lets you access a Google App Engine Pull Task Queue over REST.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/taskqueue/v1beta2/rest", + "discoveryLink": "./apis/taskqueue/v1beta2/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/app_engine-16.png", + "x32": "https://www.google.com/images/icons/product/app_engine-32.png" + }, + "documentationLink": "https://developers.google.com/appengine/docs/python/taskqueue/rest", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "tasks:v1", + "name": "tasks", + "version": "v1", + "title": "Tasks API", + "description": "Lets you manage your tasks and task lists.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/tasks/v1/rest", + "discoveryLink": "./apis/tasks/v1/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/tasks-16.png", + "x32": "https://www.google.com/images/icons/product/tasks-32.png" + }, + "documentationLink": "https://developers.google.com/google-apps/tasks/firstapp", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "translate:v2", + "name": "translate", + "version": "v2", + "title": "Translate API", + "description": "Lets you translate text from one language to another", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/translate/v2/rest", + "discoveryLink": "./apis/translate/v2/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/translate-16.png", + "x32": "https://www.google.com/images/icons/product/translate-32.png" + }, + "documentationLink": "https://developers.google.com/translate/v2/using_rest", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "urlshortener:v1", + "name": "urlshortener", + "version": "v1", + "title": "URL Shortener API", + "description": "Lets you create, inspect, and manage goo.gl short URLs", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/urlshortener/v1/rest", + "discoveryLink": "./apis/urlshortener/v1/rest", + "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/url-shortener/v1/getting_started", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "webfonts:v1", + "name": "webfonts", + "version": "v1", + "title": "Google Fonts Developer API", + "description": "The Google Fonts Developer API.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/webfonts/v1/rest", + "discoveryLink": "./apis/webfonts/v1/rest", + "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", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "webmasters:v3", + "name": "webmasters", + "version": "v3", + "title": "Webmaster Tools API", + "description": "Lets you view Google Webmaster Tools data for your verified sites.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/webmasters/v3/rest", + "discoveryLink": "./apis/webmasters/v3/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/webmaster_tools-16.png", + "x32": "https://www.google.com/images/icons/product/webmaster_tools-32.png" + }, + "documentationLink": "https://developers.google.com/webmaster-tools/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "youtube:v3", + "name": "youtube", + "version": "v3", + "title": "YouTube Data API", + "description": "Programmatic access to YouTube features.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/youtube/v3/rest", + "discoveryLink": "./apis/youtube/v3/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/youtube-16.png", + "x32": "https://www.google.com/images/icons/product/youtube-32.png" + }, + "documentationLink": "https://developers.google.com/youtube/v3", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "youtubeAnalytics:v1", + "name": "youtubeAnalytics", + "version": "v1", + "title": "YouTube Analytics API", + "description": "Retrieve your YouTube Analytics reports.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/youtubeAnalytics/v1/rest", + "discoveryLink": "./apis/youtubeAnalytics/v1/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/youtube-16.png", + "x32": "https://www.google.com/images/icons/product/youtube-32.png" + }, + "documentationLink": "http://developers.google.com/youtube/analytics/", + "preferred": true + }, + { + "kind": "discovery#directoryItem", + "id": "youtubeAnalytics:v1beta1", + "name": "youtubeAnalytics", + "version": "v1beta1", + "title": "YouTube Analytics API", + "description": "Retrieve your YouTube Analytics reports.", + "discoveryRestUrl": "https://www.googleapis.com/discovery/v1/apis/youtubeAnalytics/v1beta1/rest", + "discoveryLink": "./apis/youtubeAnalytics/v1beta1/rest", + "icons": { + "x16": "https://www.google.com/images/icons/product/youtube-16.png", + "x32": "https://www.google.com/images/icons/product/youtube-32.png" + }, + "documentationLink": "http://developers.google.com/youtube/analytics/", + "labels": [ + "deprecated" + ], + "preferred": false + } + ] +} diff --git a/Godeps/_workspace/src/google.golang.org/api/appengine/v1beta4/appengine-api.json b/Godeps/_workspace/src/google.golang.org/api/appengine/v1beta4/appengine-api.json new file mode 100644 index 000000000..7d1851a80 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/appengine/v1beta4/appengine-api.json @@ -0,0 +1,1423 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/MxcrsWLtc_45Vl0dvlLXLZx13VM\"", + "discoveryVersion": "v1", + "id": "appengine:v1beta4", + "name": "appengine", + "version": "v1beta4", + "revision": "20150831", + "title": "Google App Engine Admin API", + "description": "The Google App Engine Admin API enables developers to provision and manage their App Engine 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/appengine/", + "protocol": "rest", + "baseUrl": "https://appengine.googleapis.com/", + "basePath": "/", + "rootUrl": "https://appengine.googleapis.com/", + "servicePath": "", + "batchPath": "batch", + "parameters": { + "access_token": { + "type": "string", + "description": "OAuth access token.", + "location": "query" + }, + "alt": { + "type": "string", + "description": "Data format for response.", + "default": "json", + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query" + }, + "bearer_token": { + "type": "string", + "description": "OAuth bearer token.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JSONP", + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "pp": { + "type": "boolean", + "description": "Pretty-print response.", + "default": "true", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query" + }, + "upload_protocol": { + "type": "string", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query" + }, + "uploadType": { + "type": "string", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query" + }, + "$.xgafv": { + "type": "string", + "description": "V1 error format.", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "schemas": { + "Application": { + "id": "Application", + "type": "object", + "description": "An Application contains the top-level configuration of an App Engine application.", + "properties": { + "name": { + "type": "string", + "description": "The full path to the application in the API. Example: \"apps/myapp\". @OutputOnly" + }, + "id": { + "type": "string", + "description": "The relative name/path of the application. Example: \"myapp\". @OutputOnly" + }, + "dispatchRules": { + "type": "array", + "description": "HTTP path dispatch rules for requests to the app that do not explicitly target a module or version. The rules are order-dependent.", + "items": { + "$ref": "UrlDispatchRule" + } + }, + "location": { + "type": "string", + "description": "The location from which the application will be run. Choices are \"us-central\" for United States and \"europe-west\" for European Union. Application instances will run out of data centers in the chosen location and all of the application's End User Content will be stored at rest in the chosen location. The default is \"us-central\"." + }, + "codeBucket": { + "type": "string", + "description": "A Google Cloud Storage bucket which can be used for storing files associated with an application. This bucket is associated with the application and can be used by the gcloud deployment commands. @OutputOnly" + } + } + }, + "UrlDispatchRule": { + "id": "UrlDispatchRule", + "type": "object", + "description": "Rules to match an HTTP request and dispatch that request to a module.", + "properties": { + "domain": { + "type": "string", + "description": "The domain name to match on. Supports '*' (glob) wildcarding on the left-hand side of a '.'. If empty, all domains will be matched (the same as '*')." + }, + "path": { + "type": "string", + "description": "The pathname within the host. This must start with a '/'. A single '*' (glob) can be included at the end of the path. The sum of the lengths of the domain and path may not exceed 100 characters." + }, + "module": { + "type": "string", + "description": "The resource id of a Module in this application that should service the matched request. The Module must already exist. Example: \"default\"." + } + } + }, + "Version": { + "id": "Version", + "type": "object", + "description": "A Version is a specific set of source code and configuration files deployed to a module.", + "properties": { + "name": { + "type": "string", + "description": "The full path to the Version resource in the API. Example: \"apps/myapp/modules/default/versions/v1\". @OutputOnly" + }, + "id": { + "type": "string", + "description": "The relative name/path of the Version within the module. Example: \"v1\". Version specifiers can contain lowercase letters, digits, and hyphens. It cannot begin with the prefix `ah-` and the names `default` and `latest` are reserved and cannot be used." + }, + "automaticScaling": { + "$ref": "AutomaticScaling", + "description": "Automatic scaling is the scaling policy that App Engine has used since its inception. It is based on request rate, response latencies, and other application metrics." + }, + "basicScaling": { + "$ref": "BasicScaling", + "description": "A module with basic scaling will create an instance when the application receives a request. The instance will be turned down when the app becomes idle. Basic scaling is ideal for work that is intermittent or driven by user activity." + }, + "manualScaling": { + "$ref": "ManualScaling", + "description": "A module with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time." + }, + "inboundServices": { + "type": "array", + "description": "Before an application can receive email or XMPP messages, the application must be configured to enable the service.", + "enumDescriptions": [ + "Not specified.", + "Allows an application to receive mail.", + "Allows an application receive email bound notifications.", + "Allows an application to receive error stanzas.", + "Allows an application to receive instant messages.", + "Allows an application to receive user subscription POSTs.", + "Allows an application to receive a user's chat presence.", + "Registers an application for notifications when a client connects or disconnects from a channel.", + "Enables warmup requests." + ], + "items": { + "type": "string", + "enum": [ + "INBOUND_SERVICE_UNSPECIFIED", + "INBOUND_SERVICE_MAIL", + "INBOUND_SERVICE_MAIL_BOUNCE", + "INBOUND_SERVICE_XMPP_ERROR", + "INBOUND_SERVICE_XMPP_MESSAGE", + "INBOUND_SERVICE_XMPP_SUBSCRIBE", + "INBOUND_SERVICE_XMPP_PRESENCE", + "INBOUND_SERVICE_CHANNEL_PRESENCE", + "INBOUND_SERVICE_WARMUP" + ] + } + }, + "instanceClass": { + "type": "string", + "description": "The frontend instance class to use to run this app. Valid values are `[F1, F2, F4, F4_1G]`. Default: \"F1\"" + }, + "network": { + "$ref": "Network", + "description": "Used to specify extra network settings (for VM runtimes only)." + }, + "resources": { + "$ref": "Resources", + "description": "Used to specify how many machine resources an app version needs (for VM runtimes only)." + }, + "runtime": { + "type": "string", + "description": "The desired runtime. Values can include python27, java7, go, etc." + }, + "threadsafe": { + "type": "boolean", + "description": "If true, multiple requests can be dispatched to the app at once." + }, + "vm": { + "type": "boolean", + "description": "Whether to deploy this app in a VM container (deprecated, use \"env\":\"2\")." + }, + "betaSettings": { + "type": "object", + "description": "Beta settings supplied to the application via metadata.", + "additionalProperties": { + "type": "string" + } + }, + "env": { + "type": "string", + "description": "The App Engine execution environment to use for this version. Default: \"1\"" + }, + "servingStatus": { + "type": "string", + "description": "The current serving status of this version. Only `SERVING` versions will have instances created or billed for. If this field is unset when a version is created, `SERVING` status will be assumed. It is an error to explicitly set this field to `SERVING_STATUS_UNSPECIFIED`.", + "enum": [ + "SERVING_STATUS_UNSPECIFIED", + "SERVING", + "STOPPED" + ] + }, + "deployer": { + "type": "string", + "description": "The email address of the user who created this version. @OutputOnly" + }, + "creationTime": { + "type": "string", + "description": "Creation time of this version. This will be between the start and end times of the operation that creates this version. @OutputOnly" + }, + "handlers": { + "type": "array", + "description": "An ordered list of URL Matching patterns that should be applied to incoming requests. The first matching URL consumes the request, and subsequent handlers are not attempted. Only returned in `GET` requests if `view=FULL` is set. May only be set on create requests; once created, is immutable.", + "items": { + "$ref": "UrlMap" + } + }, + "errorHandlers": { + "type": "array", + "description": "Custom static error pages instead of these generic error pages, (limit 10 KB/page) Only returned in `GET` requests if `view=FULL` is set. May only be set on create requests; once created, is immutable.", + "items": { + "$ref": "ErrorHandler" + } + }, + "libraries": { + "type": "array", + "description": "Configuration for Python runtime third-party libraries required by the application. Only returned in `GET` requests if `view=FULL` is set. May only be set on create requests; once created, is immutable.", + "items": { + "$ref": "Library" + } + }, + "apiConfig": { + "$ref": "ApiConfigHandler", + "description": "Serving configuration for Google Cloud Endpoints. Only returned in `GET` requests if `view=FULL` is set. May only be set on create requests; once created, is immutable." + }, + "envVariables": { + "type": "object", + "description": "Environment variables made available to the application. Only returned in `GET` requests if `view=FULL` is set. May only be set on create requests; once created, is immutable.", + "additionalProperties": { + "type": "string" + } + }, + "defaultExpiration": { + "type": "string", + "description": "The length of time a static file served by a static file handler ought to be cached by web proxies and browsers, if the handler does not specify its own expiration. Only returned in `GET` requests if `view=FULL` is set. May only be set on create requests; once created, is immutable." + }, + "healthCheck": { + "$ref": "HealthCheck", + "description": "Configure health checking for the VM instances. Unhealthy VM instances will be stopped and replaced with new instances. Only returned in `GET` requests if `view=FULL` is set. May only be set on create requests; once created, is immutable." + }, + "nobuildFilesRegex": { + "type": "string", + "description": "Go only. Files that match this pattern will not be built into the app. May only be set on create requests." + }, + "deployment": { + "$ref": "Deployment", + "description": "Code and application artifacts that make up this version. Only returned in `GET` requests if `view=FULL` is set. May only be set on create requests; once created, is immutable." + } + } + }, + "AutomaticScaling": { + "id": "AutomaticScaling", + "type": "object", + "description": "Automatic scaling is the scaling policy that App Engine has used since its inception. It is based on request rate, response latencies, and other application metrics.", + "properties": { + "coolDownPeriod": { + "type": "string", + "description": "The amount of time that the [Autoscaler](https://cloud.google.com/compute/docs/autoscaler/) should wait between changes to the number of virtual machines. Applies only to the VM runtime." + }, + "cpuUtilization": { + "$ref": "CpuUtilization", + "description": "Target scaling by CPU usage." + }, + "maxConcurrentRequests": { + "type": "integer", + "description": "The number of concurrent requests an automatic scaling instance can accept before the scheduler spawns a new instance. Default value is chosen based on the runtime.", + "format": "int32" + }, + "maxIdleInstances": { + "type": "integer", + "description": "The maximum number of idle instances that App Engine should maintain for this version.", + "format": "int32" + }, + "maxTotalInstances": { + "type": "integer", + "description": "Max number of instances that App Engine should start to handle requests.", + "format": "int32" + }, + "maxPendingLatency": { + "type": "string", + "description": "The maximum amount of time that App Engine should allow a request to wait in the pending queue before starting a new instance to handle it." + }, + "minIdleInstances": { + "type": "integer", + "description": "The minimum number of idle instances that App Engine should maintain for this version. Only applies to the default version of a module, since other versions are not expected to receive significant traffic.", + "format": "int32" + }, + "minTotalInstances": { + "type": "integer", + "description": "Minimum number of instances that App Engine should maintain.", + "format": "int32" + }, + "minPendingLatency": { + "type": "string", + "description": "The minimum amount of time that App Engine should allow a request to wait in the pending queue before starting a new instance to handle it." + } + } + }, + "CpuUtilization": { + "id": "CpuUtilization", + "type": "object", + "description": "Target scaling by CPU usage.", + "properties": { + "aggregationWindowLength": { + "type": "string", + "description": "The period of time over which CPU utilization is calculated." + }, + "targetUtilization": { + "type": "number", + "description": "Target (0-1) CPU utilization ratio to maintain when scaling.", + "format": "double" + } + } + }, + "BasicScaling": { + "id": "BasicScaling", + "type": "object", + "description": "A module with basic scaling will create an instance when the application receives a request. The instance will be turned down when the app becomes idle. Basic scaling is ideal for work that is intermittent or driven by user activity.", + "properties": { + "idleTimeout": { + "type": "string", + "description": "The instance will be shut down this amount of time after receiving its last request." + }, + "maxInstances": { + "type": "integer", + "description": "The maximum number of instances for App Engine to create for this version.", + "format": "int32" + } + } + }, + "ManualScaling": { + "id": "ManualScaling", + "type": "object", + "description": "A module with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time.", + "properties": { + "instances": { + "type": "integer", + "description": "The number of instances to assign to the module at the start. This number can later be altered by using the [Modules API](https://cloud.google.com/appengine/docs/python/modules/functions) `set_num_instances()` function.", + "format": "int32" + } + } + }, + "Network": { + "id": "Network", + "type": "object", + "description": "Used to specify extra network settings (for VM runtimes only).", + "properties": { + "forwardedPorts": { + "type": "array", + "description": "A list of ports (or port pairs) to forward from the VM into the app container.", + "items": { + "type": "string" + } + }, + "instanceTag": { + "type": "string", + "description": "A tag to apply to the VM instance during creation." + }, + "name": { + "type": "string", + "description": "The Google Compute Engine network where the VMs will be created. If not specified, or empty, the network named \"default\" will be used. (The short name should be specified, not the resource path.)" + } + } + }, + "Resources": { + "id": "Resources", + "type": "object", + "description": "Used to specify how many machine resources an app version needs.", + "properties": { + "cpu": { + "type": "number", + "description": "How many CPU cores an app version needs.", + "format": "double" + }, + "diskGb": { + "type": "number", + "description": "How much disk size, in GB, an app version needs.", + "format": "double" + }, + "memoryGb": { + "type": "number", + "description": "How much memory, in GB, an app version needs.", + "format": "double" + } + } + }, + "UrlMap": { + "id": "UrlMap", + "type": "object", + "description": "A URL pattern and description of how it should be handled. App Engine can handle URLs by executing application code, or by serving static files uploaded with the code, such as images, CSS or JavaScript.", + "properties": { + "urlRegex": { + "type": "string", + "description": "A URL prefix. This value uses regular expression syntax (and so regexp special characters must be escaped), but it should not contain groupings. All URLs that begin with this prefix are handled by this handler, using the portion of the URL after the prefix as part of the file path. This is always required." + }, + "staticFiles": { + "$ref": "StaticFilesHandler", + "description": "Returns the contents of a file, such as an image, as the response." + }, + "staticDirectory": { + "$ref": "StaticDirectoryHandler", + "description": "Serves the entire contents of a directory as static files. This attribute is deprecated. You can mimic the behavior of static directories using static files." + }, + "script": { + "$ref": "ScriptHandler", + "description": "Executes a script to handle the request that matches the URL pattern." + }, + "apiEndpoint": { + "$ref": "ApiEndpointHandler", + "description": "Use API Endpoints to handle requests." + }, + "securityLevel": { + "type": "string", + "description": "Configures whether security (HTTPS) should be enforced for this URL.", + "enum": [ + "SECURE_UNSPECIFIED", + "SECURE_DEFAULT", + "SECURE_NEVER", + "SECURE_OPTIONAL", + "SECURE_ALWAYS" + ] + }, + "login": { + "type": "string", + "description": "What level of login is required to access this resource.", + "enum": [ + "LOGIN_UNSPECIFIED", + "LOGIN_OPTIONAL", + "LOGIN_ADMIN", + "LOGIN_REQUIRED" + ] + }, + "authFailAction": { + "type": "string", + "description": "For users not logged in, how to handle access to resources with required login. Defaults to \"redirect\".", + "enum": [ + "AUTH_FAIL_ACTION_UNSPECIFIED", + "AUTH_FAIL_ACTION_REDIRECT", + "AUTH_FAIL_ACTION_UNAUTHORIZED" + ] + }, + "redirectHttpResponseCode": { + "type": "string", + "description": "`30x` code to use when performing redirects for the `secure` field. A `302` is used by default.", + "enum": [ + "REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED", + "REDIRECT_HTTP_RESPONSE_CODE_301", + "REDIRECT_HTTP_RESPONSE_CODE_302", + "REDIRECT_HTTP_RESPONSE_CODE_303", + "REDIRECT_HTTP_RESPONSE_CODE_307" + ] + } + } + }, + "StaticFilesHandler": { + "id": "StaticFilesHandler", + "type": "object", + "description": "Files served directly to the user for a given URL, such as images, CSS stylesheets, or JavaScript source files. Static file handlers describe which files in the application directory are static files, and which URLs serve them.", + "properties": { + "path": { + "type": "string", + "description": "The path to the static files matched by the URL pattern, from the application root directory. The path can refer to text matched in groupings in the URL pattern." + }, + "uploadPathRegex": { + "type": "string", + "description": "A regular expression that matches the file paths for all files that will be referenced by this handler." + }, + "httpHeaders": { + "type": "object", + "description": "HTTP headers to use for all responses from these URLs.", + "additionalProperties": { + "type": "string" + } + }, + "mimeType": { + "type": "string", + "description": "If specified, all files served by this handler will be served using the specified MIME type. If not specified, the MIME type for a file will be derived from the file's filename extension." + }, + "expiration": { + "type": "string", + "description": "The length of time a static file served by this handler ought to be cached by web proxies and browsers." + }, + "requireMatchingFile": { + "type": "boolean", + "description": "If true, this [UrlMap][google.appengine.v1beta4.UrlMap] entry does not match the request unless the file referenced by the handler also exists. If no such file exists, processing will continue with the next [UrlMap][google.appengine.v1beta4.UrlMap] that matches the requested URL." + }, + "applicationReadable": { + "type": "boolean", + "description": "By default, files declared in static file handlers are uploaded as static data and are only served to end users, they cannot be read by an application. If this field is set to true, the files are also uploaded as code data so your application can read them. Both uploads are charged against your code and static data storage resource quotas." + } + } + }, + "StaticDirectoryHandler": { + "id": "StaticDirectoryHandler", + "type": "object", + "description": "Files served directly to the user for a given URL, such as images, CSS stylesheets, or JavaScript source files. Static directory handlers make it easy to serve the entire contents of a directory as static files.", + "properties": { + "directory": { + "type": "string", + "description": "The path to the directory containing the static files, from the application root directory. Everything after the end of the matched url pattern is appended to static_dir to form the full path to the requested file." + }, + "httpHeaders": { + "type": "object", + "description": "HTTP headers to use for all responses from these URLs.", + "additionalProperties": { + "type": "string" + } + }, + "mimeType": { + "type": "string", + "description": "If specified, all files served by this handler will be served using the specified MIME type. If not specified, the MIME type for a file will be derived from the file's filename extension." + }, + "expiration": { + "type": "string", + "description": "The length of time a static file served by this handler ought to be cached by web proxies and browsers." + }, + "requireMatchingFile": { + "type": "boolean", + "description": "If true, this UrlMap entry does not match the request unless the file referenced by the handler also exists. If no such file exists, processing will continue with the next UrlMap that matches the requested URL." + }, + "applicationReadable": { + "type": "boolean", + "description": "By default, files declared in static file handlers are uploaded as static data and are only served to end users, they cannot be read by an application. If this field is set to true, the files are also uploaded as code data so your application can read them. Both uploads are charged against your code and static data storage resource quotas." + } + } + }, + "ScriptHandler": { + "id": "ScriptHandler", + "type": "object", + "description": "Executes a script to handle the request that matches the URL pattern.", + "properties": { + "scriptPath": { + "type": "string", + "description": "Specifies the path to the script from the application root directory." + } + } + }, + "ApiEndpointHandler": { + "id": "ApiEndpointHandler", + "type": "object", + "description": "Use Google Cloud Endpoints to handle requests.", + "properties": { + "scriptPath": { + "type": "string", + "description": "Specifies the path to the script from the application root directory." + } + } + }, + "ErrorHandler": { + "id": "ErrorHandler", + "type": "object", + "description": "A custom static error page to be served when an error occurs.", + "properties": { + "errorCode": { + "type": "string", + "description": "The error condition this handler applies to.", + "enum": [ + "ERROR_CODE_UNSPECIFIED", + "ERROR_CODE_DEFAULT", + "ERROR_CODE_OVER_QUOTA", + "ERROR_CODE_DOS_API_DENIAL", + "ERROR_CODE_TIMEOUT" + ] + }, + "staticFile": { + "type": "string", + "description": "Static file content to be served for this error." + }, + "mimeType": { + "type": "string", + "description": "MIME type of file. If unspecified, \"text/html\" is assumed." + } + } + }, + "Library": { + "id": "Library", + "type": "object", + "description": "A Python runtime third-party library required by the application.", + "properties": { + "name": { + "type": "string", + "description": "The name of the library, e.g. \"PIL\" or \"django\"." + }, + "version": { + "type": "string", + "description": "The version of the library to select, or \"latest\"." + } + } + }, + "ApiConfigHandler": { + "id": "ApiConfigHandler", + "type": "object", + "description": "API Serving configuration for Cloud Endpoints.", + "properties": { + "authFailAction": { + "type": "string", + "description": "For users not logged in, how to handle access to resources with required login. Defaults to \"redirect\".", + "enum": [ + "AUTH_FAIL_ACTION_UNSPECIFIED", + "AUTH_FAIL_ACTION_REDIRECT", + "AUTH_FAIL_ACTION_UNAUTHORIZED" + ] + }, + "login": { + "type": "string", + "description": "What level of login is required to access this resource. Default is \"optional\".", + "enum": [ + "LOGIN_UNSPECIFIED", + "LOGIN_OPTIONAL", + "LOGIN_ADMIN", + "LOGIN_REQUIRED" + ] + }, + "script": { + "type": "string", + "description": "Specifies the path to the script from the application root directory." + }, + "securityLevel": { + "type": "string", + "description": "Configures whether security (HTTPS) should be enforced for this URL.", + "enum": [ + "SECURE_UNSPECIFIED", + "SECURE_DEFAULT", + "SECURE_NEVER", + "SECURE_OPTIONAL", + "SECURE_ALWAYS" + ] + }, + "url": { + "type": "string", + "description": "URL to serve the endpoint at." + } + } + }, + "HealthCheck": { + "id": "HealthCheck", + "type": "object", + "description": "Configure health checking for the VM instances. Unhealthy VM instances will be killed and replaced with new instances.", + "properties": { + "disableHealthCheck": { + "type": "boolean", + "description": "Whether to explicitly disable health checks for this instance." + }, + "host": { + "type": "string", + "description": "The host header to send when performing an HTTP health check (e.g. myapp.appspot.com)" + }, + "healthyThreshold": { + "type": "integer", + "description": "The number of consecutive successful health checks before receiving traffic.", + "format": "uint32" + }, + "unhealthyThreshold": { + "type": "integer", + "description": "The number of consecutive failed health checks before removing traffic.", + "format": "uint32" + }, + "restartThreshold": { + "type": "integer", + "description": "The number of consecutive failed health checks before an instance is restarted.", + "format": "uint32" + }, + "checkInterval": { + "type": "string", + "description": "The interval between health checks." + }, + "timeout": { + "type": "string", + "description": "The amount of time before the health check is considered failed." + } + } + }, + "Deployment": { + "id": "Deployment", + "type": "object", + "description": "Code and application artifacts used to deploy a version to App Engine.", + "properties": { + "files": { + "type": "object", + "description": "A manifest of files stored in Google Cloud Storage which should be included as part of this application. All files must be readable using the credentials supplied with this call.", + "additionalProperties": { + "$ref": "FileInfo" + } + }, + "container": { + "$ref": "ContainerInfo", + "description": "If supplied, a docker (container) image which should be used to start the application. Only applicable to the 'vm' runtime." + }, + "sourceReferences": { + "type": "array", + "description": "The origin of the source code for this deployment. There can be more than one source reference per Version if source code is distributed among multiple repositories.", + "items": { + "$ref": "SourceReference" + } + } + } + }, + "FileInfo": { + "id": "FileInfo", + "type": "object", + "description": "A single source file which is part of the application to be deployed.", + "properties": { + "sourceUrl": { + "type": "string", + "description": "The URL source to use to fetch this file. Must be a URL to a resource in Google Cloud Storage." + }, + "sha1Sum": { + "type": "string", + "description": "The SHA1 (160 bits) hash of the file in hex." + }, + "mimeType": { + "type": "string", + "description": "The MIME type of the file; if unspecified, the value from Google Cloud Storage will be used." + } + } + }, + "ContainerInfo": { + "id": "ContainerInfo", + "type": "object", + "description": "A Docker (container) image which should be used to start the application.", + "properties": { + "image": { + "type": "string", + "description": "Reference to a hosted container image. Must be a URI to a resource in a Docker repository. Must be fully qualified, including tag or digest. e.g. gcr.io/my-project/image:tag or gcr.io/my-project/image@digest" + } + } + }, + "SourceReference": { + "id": "SourceReference", + "type": "object", + "description": "A reference to a particular snapshot of the source tree used to build and deploy the application.", + "properties": { + "repository": { + "type": "string", + "description": "Optional. A URI string identifying the repository. Example: \"https://source.developers.google.com/p/app-123/r/default\"" + }, + "revisionId": { + "type": "string", + "description": "The canonical (and persistent) identifier of the deployed revision, i.e. any kind of aliases including tags or branch names are not allowed. Example (git): \"2198322f89e0bb2e25021667c2ed489d1fd34e6b\"" + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "description": "This resource represents a long-running operation that is the result of a network API call.", + "properties": { + "name": { + "type": "string", + "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping above, the `name` should have the format of `operations/some/unique/name`." + }, + "metadata": { + "type": "object", + "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @ype with type URL." + } + }, + "done": { + "type": "boolean", + "description": "If the value is `false`, it means the operation is still in progress. If true, the operation is completed, and either `error` or `response` is available." + }, + "error": { + "$ref": "Status", + "description": "The error result of the operation in case of failure." + }, + "response": { + "type": "object", + "description": "The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @ype with type URL." + } + } + } + }, + "Status": { + "id": "Status", + "type": "object", + "description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). The error model is designed to be: - Simple to use and understand for most users - Flexible enough to meet unexpected needs # Overview The `Status` message contains three pieces of data: error code, error message, and error details. The error code should be an enum value of [google.rpc.Code][google.rpc.Code], but it may accept additional error codes if needed. The error message should be a developer-facing English message that helps developers *understand* and *resolve* the error. If a localized user-facing error message is needed, put the localized message in the error details or localize it in the client. The optional error details may contain arbitrary information about the error. There is a predefined set of error detail types in the package `google.rpc` which can be used for common error conditions. # Language mapping The `Status` message is the logical representation of the error model, but it is not necessarily the actual wire format. When the `Status` message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C. # Other uses The error model and the `Status` message can be used in a variety of environments, either with or without APIs, to provide a consistent developer experience across different environments. Example uses of this error model include: - Partial errors. If a service needs to return partial errors to the client, it may embed the `Status` in the normal response to indicate the partial errors. - Workflow errors. A typical workflow has multiple steps. Each step may have a `Status` message for error reporting purpose. - Batch operations. If a client uses batch request and batch response, the `Status` message should be used directly inside batch response, one for each error sub-response. - Asynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the `Status` message. - Logging. If some API errors are stored in logs, the message `Status` could be used directly after any stripping needed for security/privacy reasons.", + "properties": { + "code": { + "type": "integer", + "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", + "format": "int32" + }, + "message": { + "type": "string", + "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client." + }, + "details": { + "type": "array", + "description": "A list of messages that carry the error details. There will be a common set of message types for APIs to use.", + "items": { + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @ype with type URL." + } + } + } + } + }, + "ListVersionsResponse": { + "id": "ListVersionsResponse", + "type": "object", + "description": "Response message for `Versions.ListVersions`.", + "properties": { + "versions": { + "type": "array", + "description": "The versions belonging to the requested application module.", + "items": { + "$ref": "Version" + } + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results." + } + } + }, + "Module": { + "id": "Module", + "type": "object", + "description": "A module is a component of an application that provides a single service or configuration. A module has a collection of versions that define a specific set of code used to implement the functionality of that module.", + "properties": { + "name": { + "type": "string", + "description": "The full path to the Module resource in the API. Example: \"apps/myapp/modules/default\" @OutputOnly" + }, + "id": { + "type": "string", + "description": "The relative name/path of the module within the application. Example: \"default\" @OutputOnly" + }, + "split": { + "$ref": "TrafficSplit", + "description": "A mapping that defines fractional HTTP traffic diversion to different versions within the module." + } + } + }, + "TrafficSplit": { + "id": "TrafficSplit", + "type": "object", + "description": "Configuration for traffic splitting for versions within a single module. Traffic splitting allows traffic directed to the module to be assigned to one of several versions in a fractional way, enabling experiments and canarying new builds, for example.", + "properties": { + "shardBy": { + "type": "string", + "description": "Which mechanism should be used as a selector when choosing a version to send a request to. The traffic selection algorithm will be stable for either type until allocations are changed.", + "enum": [ + "UNSPECIFIED", + "COOKIE", + "IP" + ] + }, + "allocations": { + "type": "object", + "description": "Mapping from module version IDs within the module to fractional (0.000, 1] allocations of traffic for that version. Each version may only be specified once, but some versions in the module may not have any traffic allocation. Modules that have traffic allocated in this field may not be deleted until the module is deleted, or their traffic allocation is removed. Allocations must sum to 1. Supports precision up to two decimal places for IP-based splits and up to three decimal places for cookie-based splits.", + "additionalProperties": { + "type": "number", + "format": "double" + } + } + } + }, + "ListModulesResponse": { + "id": "ListModulesResponse", + "type": "object", + "description": "Response message for `Modules.ListModules`.", + "properties": { + "modules": { + "type": "array", + "description": "The modules belonging to the requested application.", + "items": { + "$ref": "Module" + } + }, + "nextPageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results." + } + } + }, + "ListOperationsResponse": { + "id": "ListOperationsResponse", + "type": "object", + "description": "The response message for [Operations.ListOperations][google.longrunning.Operations.ListOperations].", + "properties": { + "operations": { + "type": "array", + "description": "A list of operations that matches the specified filter in the request.", + "items": { + "$ref": "Operation" + } + }, + "nextPageToken": { + "type": "string", + "description": "The standard List next-page token." + } + } + }, + "OperationMetadata": { + "id": "OperationMetadata", + "type": "object", + "description": "Metadata for the given [google.longrunning.Operation][google.longrunning.Operation].", + "properties": { + "operationType": { + "type": "string", + "description": "The type of the operation (deprecated, use method field instead). Example: \"create_version\". @OutputOnly" + }, + "insertTime": { + "type": "string", + "description": "Timestamp that this operation was received. @OutputOnly" + }, + "endTime": { + "type": "string", + "description": "Timestamp that this operation was completed. (Not present if the operation is still in progress.) @OutputOnly" + }, + "user": { + "type": "string", + "description": "The user who requested this operation. @OutputOnly" + }, + "target": { + "type": "string", + "description": "Resource that this operation is acting on. Example: \"apps/myapp/modules/default\". @OutputOnly" + }, + "method": { + "type": "string", + "description": "API method name that initiated the operation. Example: \"google.appengine.v1beta4.Version.CreateVersion\". @OutputOnly" + } + } + } + }, + "resources": { + "apps": { + "methods": { + "get": { + "id": "appengine.apps.get", + "path": "v1beta4/apps/{appsId}", + "httpMethod": "GET", + "description": "Gets information about an application.", + "parameters": { + "appsId": { + "type": "string", + "description": "Part of `name`. Name of the application to get. For example: \"apps/myapp\".", + "required": true, + "location": "path" + }, + "ensureResourcesExist": { + "type": "boolean", + "description": "Certain resources associated with an application are created on-demand. Controls whether these resources should be created when performing the `GET` operation. If specified and any resources cloud not be created, the request will fail with an error code.", + "location": "query" + } + }, + "parameterOrder": [ + "appsId" + ], + "response": { + "$ref": "Application" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + }, + "resources": { + "modules": { + "methods": { + "delete": { + "id": "appengine.apps.modules.delete", + "path": "v1beta4/apps/{appsId}/modules/{modulesId}", + "httpMethod": "DELETE", + "description": "Deletes a module and all enclosed versions.", + "parameters": { + "appsId": { + "type": "string", + "description": "Part of `name`. Name of the resource requested. For example: \"apps/myapp/modules/default\".", + "required": true, + "location": "path" + }, + "modulesId": { + "type": "string", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "appsId", + "modulesId" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "id": "appengine.apps.modules.get", + "path": "v1beta4/apps/{appsId}/modules/{modulesId}", + "httpMethod": "GET", + "description": "Gets the current configuration of the module.", + "parameters": { + "appsId": { + "type": "string", + "description": "Part of `name`. Name of the resource requested. For example: \"apps/myapp/modules/default\".", + "required": true, + "location": "path" + }, + "modulesId": { + "type": "string", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "appsId", + "modulesId" + ], + "response": { + "$ref": "Module" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "id": "appengine.apps.modules.list", + "path": "v1beta4/apps/{appsId}/modules", + "httpMethod": "GET", + "description": "Lists all the modules in the application.", + "parameters": { + "appsId": { + "type": "string", + "description": "Part of `name`. Name of the resource requested. For example: \"apps/myapp\".", + "required": true, + "location": "path" + }, + "pageSize": { + "type": "integer", + "description": "Maximum results to return per page.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results.", + "location": "query" + } + }, + "parameterOrder": [ + "appsId" + ], + "response": { + "$ref": "ListModulesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "id": "appengine.apps.modules.patch", + "path": "v1beta4/apps/{appsId}/modules/{modulesId}", + "httpMethod": "PATCH", + "description": "Updates the configuration of the specified module.", + "parameters": { + "appsId": { + "type": "string", + "description": "Part of `name`. Name of the resource to update. For example: \"apps/myapp/modules/default\".", + "required": true, + "location": "path" + }, + "modulesId": { + "type": "string", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "location": "path" + }, + "mask": { + "type": "string", + "description": "Standard field mask for the set of fields to be updated.", + "location": "query" + }, + "migrateTraffic": { + "type": "boolean", + "description": "Whether to use Traffic Migration to shift traffic gradually. Traffic can only be migrated from a single version to another single version.", + "location": "query" + } + }, + "parameterOrder": [ + "appsId", + "modulesId" + ], + "request": { + "$ref": "Module" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + }, + "resources": { + "versions": { + "methods": { + "create": { + "id": "appengine.apps.modules.versions.create", + "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions", + "httpMethod": "POST", + "description": "Deploys new code and resource files to a version.", + "parameters": { + "appsId": { + "type": "string", + "description": "Part of `name`. Name of the resource to update. For example: \"apps/myapp/modules/default\".", + "required": true, + "location": "path" + }, + "modulesId": { + "type": "string", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "appsId", + "modulesId" + ], + "request": { + "$ref": "Version" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "id": "appengine.apps.modules.versions.delete", + "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}", + "httpMethod": "DELETE", + "description": "Deletes an existing version.", + "parameters": { + "appsId": { + "type": "string", + "description": "Part of `name`. Name of the resource requested. For example: \"apps/myapp/modules/default/versions/v1\".", + "required": true, + "location": "path" + }, + "modulesId": { + "type": "string", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "location": "path" + }, + "versionsId": { + "type": "string", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "appsId", + "modulesId", + "versionsId" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "id": "appengine.apps.modules.versions.get", + "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}", + "httpMethod": "GET", + "description": "Gets application deployment information.", + "parameters": { + "appsId": { + "type": "string", + "description": "Part of `name`. Name of the resource requested. For example: \"apps/myapp/modules/default/versions/v1\".", + "required": true, + "location": "path" + }, + "modulesId": { + "type": "string", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "location": "path" + }, + "versionsId": { + "type": "string", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "location": "path" + }, + "view": { + "type": "string", + "description": "Controls the set of fields returned in the `Get` response.", + "enum": [ + "BASIC", + "FULL" + ], + "location": "query" + } + }, + "parameterOrder": [ + "appsId", + "modulesId", + "versionsId" + ], + "response": { + "$ref": "Version" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "id": "appengine.apps.modules.versions.list", + "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions", + "httpMethod": "GET", + "description": "Lists the versions of a module.", + "parameters": { + "appsId": { + "type": "string", + "description": "Part of `name`. Name of the resource requested. For example: \"apps/myapp/modules/default\".", + "required": true, + "location": "path" + }, + "modulesId": { + "type": "string", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "location": "path" + }, + "view": { + "type": "string", + "description": "Controls the set of fields returned in the `List` response.", + "enum": [ + "BASIC", + "FULL" + ], + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "Maximum results to return per page.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Continuation token for fetching the next page of results.", + "location": "query" + } + }, + "parameterOrder": [ + "appsId", + "modulesId" + ], + "response": { + "$ref": "ListVersionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + }, + "operations": { + "methods": { + "get": { + "id": "appengine.apps.operations.get", + "path": "v1beta4/apps/{appsId}/operations/{operationsId}", + "httpMethod": "GET", + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + "parameters": { + "appsId": { + "type": "string", + "description": "Part of `name`. The name of the operation resource.", + "required": true, + "location": "path" + }, + "operationsId": { + "type": "string", + "description": "Part of `name`. See documentation of `appsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "appsId", + "operationsId" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "id": "appengine.apps.operations.list", + "path": "v1beta4/apps/{appsId}/operations", + "httpMethod": "GET", + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding below allows API services to override the binding to use different resource name schemes, such as `users/*/operations`.", + "parameters": { + "appsId": { + "type": "string", + "description": "Part of `name`. The name of the operation collection.", + "required": true, + "location": "path" + }, + "filter": { + "type": "string", + "description": "The standard list filter.", + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "The standard list page size.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The standard list page token.", + "location": "query" + } + }, + "parameterOrder": [ + "appsId" + ], + "response": { + "$ref": "ListOperationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/appengine/v1beta4/appengine-gen.go b/Godeps/_workspace/src/google.golang.org/api/appengine/v1beta4/appengine-gen.go new file mode 100644 index 000000000..7c4ca946d --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/appengine/v1beta4/appengine-gen.go @@ -0,0 +1,3083 @@ +// Package appengine provides access to the Google App Engine Admin API. +// +// See https://developers.google.com/appengine/ +// +// Usage example: +// +// import "google.golang.org/api/appengine/v1beta4" +// ... +// appengineService, err := appengine.New(oauthHttpClient) +package appengine // import "google.golang.org/api/appengine/v1beta4" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "appengine:v1beta4" +const apiName = "appengine" +const apiVersion = "v1beta4" +const basePath = "https://appengine.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your data across Google Cloud Platform services + CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Apps = NewAppsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Apps *AppsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAppsService(s *Service) *AppsService { + rs := &AppsService{s: s} + rs.Modules = NewAppsModulesService(s) + rs.Operations = NewAppsOperationsService(s) + return rs +} + +type AppsService struct { + s *Service + + Modules *AppsModulesService + + Operations *AppsOperationsService +} + +func NewAppsModulesService(s *Service) *AppsModulesService { + rs := &AppsModulesService{s: s} + rs.Versions = NewAppsModulesVersionsService(s) + return rs +} + +type AppsModulesService struct { + s *Service + + Versions *AppsModulesVersionsService +} + +func NewAppsModulesVersionsService(s *Service) *AppsModulesVersionsService { + rs := &AppsModulesVersionsService{s: s} + return rs +} + +type AppsModulesVersionsService struct { + s *Service +} + +func NewAppsOperationsService(s *Service) *AppsOperationsService { + rs := &AppsOperationsService{s: s} + return rs +} + +type AppsOperationsService struct { + s *Service +} + +// ApiConfigHandler: API Serving configuration for Cloud Endpoints. +type ApiConfigHandler struct { + // AuthFailAction: For users not logged in, how to handle access to + // resources with required login. Defaults to "redirect". + // + // Possible values: + // "AUTH_FAIL_ACTION_UNSPECIFIED" + // "AUTH_FAIL_ACTION_REDIRECT" + // "AUTH_FAIL_ACTION_UNAUTHORIZED" + AuthFailAction string `json:"authFailAction,omitempty"` + + // Login: What level of login is required to access this resource. + // Default is "optional". + // + // Possible values: + // "LOGIN_UNSPECIFIED" + // "LOGIN_OPTIONAL" + // "LOGIN_ADMIN" + // "LOGIN_REQUIRED" + Login string `json:"login,omitempty"` + + // Script: Specifies the path to the script from the application root + // directory. + Script string `json:"script,omitempty"` + + // SecurityLevel: Configures whether security (HTTPS) should be enforced + // for this URL. + // + // Possible values: + // "SECURE_UNSPECIFIED" + // "SECURE_DEFAULT" + // "SECURE_NEVER" + // "SECURE_OPTIONAL" + // "SECURE_ALWAYS" + SecurityLevel string `json:"securityLevel,omitempty"` + + // Url: URL to serve the endpoint at. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AuthFailAction") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ApiConfigHandler) MarshalJSON() ([]byte, error) { + type noMethod ApiConfigHandler + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ApiEndpointHandler: Use Google Cloud Endpoints to handle requests. +type ApiEndpointHandler struct { + // ScriptPath: Specifies the path to the script from the application + // root directory. + ScriptPath string `json:"scriptPath,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ScriptPath") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ApiEndpointHandler) MarshalJSON() ([]byte, error) { + type noMethod ApiEndpointHandler + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Application: An Application contains the top-level configuration of +// an App Engine application. +type Application struct { + // CodeBucket: A Google Cloud Storage bucket which can be used for + // storing files associated with an application. This bucket is + // associated with the application and can be used by the gcloud + // deployment commands. @OutputOnly + CodeBucket string `json:"codeBucket,omitempty"` + + // DispatchRules: HTTP path dispatch rules for requests to the app that + // do not explicitly target a module or version. The rules are + // order-dependent. + DispatchRules []*UrlDispatchRule `json:"dispatchRules,omitempty"` + + // Id: The relative name/path of the application. Example: "myapp". + // @OutputOnly + Id string `json:"id,omitempty"` + + // Location: The location from which the application will be run. + // Choices are "us-central" for United States and "europe-west" for + // European Union. Application instances will run out of data centers in + // the chosen location and all of the application's End User Content + // will be stored at rest in the chosen location. The default is + // "us-central". + Location string `json:"location,omitempty"` + + // Name: The full path to the application in the API. Example: + // "apps/myapp". @OutputOnly + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CodeBucket") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Application) MarshalJSON() ([]byte, error) { + type noMethod Application + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AutomaticScaling: Automatic scaling is the scaling policy that App +// Engine has used since its inception. It is based on request rate, +// response latencies, and other application metrics. +type AutomaticScaling struct { + // CoolDownPeriod: The amount of time that the + // [Autoscaler](https://cloud.google.com/compute/docs/autoscaler/) + // should wait between changes to the number of virtual machines. + // Applies only to the VM runtime. + CoolDownPeriod string `json:"coolDownPeriod,omitempty"` + + // CpuUtilization: Target scaling by CPU usage. + CpuUtilization *CpuUtilization `json:"cpuUtilization,omitempty"` + + // MaxConcurrentRequests: The number of concurrent requests an automatic + // scaling instance can accept before the scheduler spawns a new + // instance. Default value is chosen based on the runtime. + MaxConcurrentRequests int64 `json:"maxConcurrentRequests,omitempty"` + + // MaxIdleInstances: The maximum number of idle instances that App + // Engine should maintain for this version. + MaxIdleInstances int64 `json:"maxIdleInstances,omitempty"` + + // MaxPendingLatency: The maximum amount of time that App Engine should + // allow a request to wait in the pending queue before starting a new + // instance to handle it. + MaxPendingLatency string `json:"maxPendingLatency,omitempty"` + + // MaxTotalInstances: Max number of instances that App Engine should + // start to handle requests. + MaxTotalInstances int64 `json:"maxTotalInstances,omitempty"` + + // MinIdleInstances: The minimum number of idle instances that App + // Engine should maintain for this version. Only applies to the default + // version of a module, since other versions are not expected to receive + // significant traffic. + MinIdleInstances int64 `json:"minIdleInstances,omitempty"` + + // MinPendingLatency: The minimum amount of time that App Engine should + // allow a request to wait in the pending queue before starting a new + // instance to handle it. + MinPendingLatency string `json:"minPendingLatency,omitempty"` + + // MinTotalInstances: Minimum number of instances that App Engine should + // maintain. + MinTotalInstances int64 `json:"minTotalInstances,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CoolDownPeriod") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutomaticScaling) MarshalJSON() ([]byte, error) { + type noMethod AutomaticScaling + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BasicScaling: A module with basic scaling will create an instance +// when the application receives a request. The instance will be turned +// down when the app becomes idle. Basic scaling is ideal for work that +// is intermittent or driven by user activity. +type BasicScaling struct { + // IdleTimeout: The instance will be shut down this amount of time after + // receiving its last request. + IdleTimeout string `json:"idleTimeout,omitempty"` + + // MaxInstances: The maximum number of instances for App Engine to + // create for this version. + MaxInstances int64 `json:"maxInstances,omitempty"` + + // ForceSendFields is a list of field names (e.g. "IdleTimeout") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BasicScaling) MarshalJSON() ([]byte, error) { + type noMethod BasicScaling + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ContainerInfo: A Docker (container) image which should be used to +// start the application. +type ContainerInfo struct { + // Image: Reference to a hosted container image. Must be a URI to a + // resource in a Docker repository. Must be fully qualified, including + // tag or digest. e.g. gcr.io/my-project/image:tag or + // gcr.io/my-project/image@digest + Image string `json:"image,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Image") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ContainerInfo) MarshalJSON() ([]byte, error) { + type noMethod ContainerInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CpuUtilization: Target scaling by CPU usage. +type CpuUtilization struct { + // AggregationWindowLength: The period of time over which CPU + // utilization is calculated. + AggregationWindowLength string `json:"aggregationWindowLength,omitempty"` + + // TargetUtilization: Target (0-1) CPU utilization ratio to maintain + // when scaling. + TargetUtilization float64 `json:"targetUtilization,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "AggregationWindowLength") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CpuUtilization) MarshalJSON() ([]byte, error) { + type noMethod CpuUtilization + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Deployment: Code and application artifacts used to deploy a version +// to App Engine. +type Deployment struct { + // Container: If supplied, a docker (container) image which should be + // used to start the application. Only applicable to the 'vm' runtime. + Container *ContainerInfo `json:"container,omitempty"` + + // Files: A manifest of files stored in Google Cloud Storage which + // should be included as part of this application. All files must be + // readable using the credentials supplied with this call. + Files map[string]FileInfo `json:"files,omitempty"` + + // SourceReferences: The origin of the source code for this deployment. + // There can be more than one source reference per Version if source + // code is distributed among multiple repositories. + SourceReferences []*SourceReference `json:"sourceReferences,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Container") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Deployment) MarshalJSON() ([]byte, error) { + type noMethod Deployment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ErrorHandler: A custom static error page to be served when an error +// occurs. +type ErrorHandler struct { + // ErrorCode: The error condition this handler applies to. + // + // Possible values: + // "ERROR_CODE_UNSPECIFIED" + // "ERROR_CODE_DEFAULT" + // "ERROR_CODE_OVER_QUOTA" + // "ERROR_CODE_DOS_API_DENIAL" + // "ERROR_CODE_TIMEOUT" + ErrorCode string `json:"errorCode,omitempty"` + + // MimeType: MIME type of file. If unspecified, "text/html" is assumed. + MimeType string `json:"mimeType,omitempty"` + + // StaticFile: Static file content to be served for this error. + StaticFile string `json:"staticFile,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ErrorCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ErrorHandler) MarshalJSON() ([]byte, error) { + type noMethod ErrorHandler + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FileInfo: A single source file which is part of the application to be +// deployed. +type FileInfo struct { + // MimeType: The MIME type of the file; if unspecified, the value from + // Google Cloud Storage will be used. + MimeType string `json:"mimeType,omitempty"` + + // Sha1Sum: The SHA1 (160 bits) hash of the file in hex. + Sha1Sum string `json:"sha1Sum,omitempty"` + + // SourceUrl: The URL source to use to fetch this file. Must be a URL to + // a resource in Google Cloud Storage. + SourceUrl string `json:"sourceUrl,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MimeType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileInfo) MarshalJSON() ([]byte, error) { + type noMethod FileInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// HealthCheck: Configure health checking for the VM instances. +// Unhealthy VM instances will be killed and replaced with new +// instances. +type HealthCheck struct { + // CheckInterval: The interval between health checks. + CheckInterval string `json:"checkInterval,omitempty"` + + // DisableHealthCheck: Whether to explicitly disable health checks for + // this instance. + DisableHealthCheck bool `json:"disableHealthCheck,omitempty"` + + // HealthyThreshold: The number of consecutive successful health checks + // before receiving traffic. + HealthyThreshold int64 `json:"healthyThreshold,omitempty"` + + // Host: The host header to send when performing an HTTP health check + // (e.g. myapp.appspot.com) + Host string `json:"host,omitempty"` + + // RestartThreshold: The number of consecutive failed health checks + // before an instance is restarted. + RestartThreshold int64 `json:"restartThreshold,omitempty"` + + // Timeout: The amount of time before the health check is considered + // failed. + Timeout string `json:"timeout,omitempty"` + + // UnhealthyThreshold: The number of consecutive failed health checks + // before removing traffic. + UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CheckInterval") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HealthCheck) MarshalJSON() ([]byte, error) { + type noMethod HealthCheck + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Library: A Python runtime third-party library required by the +// application. +type Library struct { + // Name: The name of the library, e.g. "PIL" or "django". + Name string `json:"name,omitempty"` + + // Version: The version of the library to select, or "latest". + Version string `json:"version,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Library) MarshalJSON() ([]byte, error) { + type noMethod Library + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListModulesResponse: Response message for `Modules.ListModules`. +type ListModulesResponse struct { + // Modules: The modules belonging to the requested application. + Modules []*Module `json:"modules,omitempty"` + + // NextPageToken: Continuation token for fetching the next page of + // results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Modules") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListModulesResponse) MarshalJSON() ([]byte, error) { + type noMethod ListModulesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListOperationsResponse: The response message for +// [Operations.ListOperations][google.longrunning.Operations.ListOperatio +// ns]. +type ListOperationsResponse struct { + // NextPageToken: The standard List next-page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Operations: A list of operations that matches the specified filter in + // the request. + Operations []*Operation `json:"operations,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListOperationsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListVersionsResponse: Response message for `Versions.ListVersions`. +type ListVersionsResponse struct { + // NextPageToken: Continuation token for fetching the next page of + // results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Versions: The versions belonging to the requested application module. + Versions []*Version `json:"versions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListVersionsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListVersionsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ManualScaling: A module with manual scaling runs continuously, +// allowing you to perform complex initialization and rely on the state +// of its memory over time. +type ManualScaling struct { + // Instances: The number of instances to assign to the module at the + // start. This number can later be altered by using the [Modules + // API](https://cloud.google.com/appengine/docs/python/modules/functions) + // `set_num_instances()` function. + Instances int64 `json:"instances,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ManualScaling) MarshalJSON() ([]byte, error) { + type noMethod ManualScaling + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Module: A module is a component of an application that provides a +// single service or configuration. A module has a collection of +// versions that define a specific set of code used to implement the +// functionality of that module. +type Module struct { + // Id: The relative name/path of the module within the application. + // Example: "default" @OutputOnly + Id string `json:"id,omitempty"` + + // Name: The full path to the Module resource in the API. Example: + // "apps/myapp/modules/default" @OutputOnly + Name string `json:"name,omitempty"` + + // Split: A mapping that defines fractional HTTP traffic diversion to + // different versions within the module. + Split *TrafficSplit `json:"split,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Module) MarshalJSON() ([]byte, error) { + type noMethod Module + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Network: Used to specify extra network settings (for VM runtimes +// only). +type Network struct { + // ForwardedPorts: A list of ports (or port pairs) to forward from the + // VM into the app container. + ForwardedPorts []string `json:"forwardedPorts,omitempty"` + + // InstanceTag: A tag to apply to the VM instance during creation. + InstanceTag string `json:"instanceTag,omitempty"` + + // Name: The Google Compute Engine network where the VMs will be + // created. If not specified, or empty, the network named "default" will + // be used. (The short name should be specified, not the resource path.) + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ForwardedPorts") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Network) MarshalJSON() ([]byte, error) { + type noMethod Network + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Operation: This resource represents a long-running operation that is +// the result of a network API call. +type Operation struct { + // Done: If the value is `false`, it means the operation is still in + // progress. If true, the operation is completed, and either `error` or + // `response` is available. + Done bool `json:"done,omitempty"` + + // Error: The error result of the operation in case of failure. + Error *Status `json:"error,omitempty"` + + // Metadata: Service-specific metadata associated with the operation. It + // typically contains progress information and common metadata such as + // create time. Some services might not provide such metadata. Any + // method that returns a long-running operation should document the + // metadata type, if any. + Metadata OperationMetadata `json:"metadata,omitempty"` + + // Name: The server-assigned name, which is only unique within the same + // service that originally returns it. If you use the default HTTP + // mapping above, the `name` should have the format of + // `operations/some/unique/name`. + Name string `json:"name,omitempty"` + + // Response: The normal response of the operation in case of success. If + // the original method returns no data on success, such as `Delete`, the + // response is `google.protobuf.Empty`. If the original method is + // standard `Get`/`Create`/`Update`, the response should be the + // resource. For other methods, the response should have the type + // `XxxResponse`, where `Xxx` is the original method name. For example, + // if the original method name is `TakeSnapshot()`, the inferred + // response type is `TakeSnapshotResponse`. + Response OperationResponse `json:"response,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Done") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Operation) MarshalJSON() ([]byte, error) { + type noMethod Operation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationMetadata interface{} + +type OperationResponse interface{} + +// OperationMetadata1: Metadata for the given +// [google.longrunning.Operation][google.longrunning.Operation]. +type OperationMetadata1 struct { + // EndTime: Timestamp that this operation was completed. (Not present if + // the operation is still in progress.) @OutputOnly + EndTime string `json:"endTime,omitempty"` + + // InsertTime: Timestamp that this operation was received. @OutputOnly + InsertTime string `json:"insertTime,omitempty"` + + // Method: API method name that initiated the operation. Example: + // "google.appengine.v1beta4.Version.CreateVersion". @OutputOnly + Method string `json:"method,omitempty"` + + // OperationType: The type of the operation (deprecated, use method + // field instead). Example: "create_version". @OutputOnly + OperationType string `json:"operationType,omitempty"` + + // Target: Resource that this operation is acting on. Example: + // "apps/myapp/modules/default". @OutputOnly + Target string `json:"target,omitempty"` + + // User: The user who requested this operation. @OutputOnly + User string `json:"user,omitempty"` + + // ForceSendFields is a list of field names (e.g. "EndTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationMetadata1) MarshalJSON() ([]byte, error) { + type noMethod OperationMetadata1 + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Resources: Used to specify how many machine resources an app version +// needs. +type Resources struct { + // Cpu: How many CPU cores an app version needs. + Cpu float64 `json:"cpu,omitempty"` + + // DiskGb: How much disk size, in GB, an app version needs. + DiskGb float64 `json:"diskGb,omitempty"` + + // MemoryGb: How much memory, in GB, an app version needs. + MemoryGb float64 `json:"memoryGb,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Cpu") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Resources) MarshalJSON() ([]byte, error) { + type noMethod Resources + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ScriptHandler: Executes a script to handle the request that matches +// the URL pattern. +type ScriptHandler struct { + // ScriptPath: Specifies the path to the script from the application + // root directory. + ScriptPath string `json:"scriptPath,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ScriptPath") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ScriptHandler) MarshalJSON() ([]byte, error) { + type noMethod ScriptHandler + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SourceReference: A reference to a particular snapshot of the source +// tree used to build and deploy the application. +type SourceReference struct { + // Repository: Optional. A URI string identifying the repository. + // Example: "https://source.developers.google.com/p/app-123/r/default" + Repository string `json:"repository,omitempty"` + + // RevisionId: The canonical (and persistent) identifier of the deployed + // revision, i.e. any kind of aliases including tags or branch names are + // not allowed. Example (git): + // "2198322f89e0bb2e25021667c2ed489d1fd34e6b" + RevisionId string `json:"revisionId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Repository") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SourceReference) MarshalJSON() ([]byte, error) { + type noMethod SourceReference + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// StaticDirectoryHandler: Files served directly to the user for a given +// URL, such as images, CSS stylesheets, or JavaScript source files. +// Static directory handlers make it easy to serve the entire contents +// of a directory as static files. +type StaticDirectoryHandler struct { + // ApplicationReadable: By default, files declared in static file + // handlers are uploaded as static data and are only served to end + // users, they cannot be read by an application. If this field is set to + // true, the files are also uploaded as code data so your application + // can read them. Both uploads are charged against your code and static + // data storage resource quotas. + ApplicationReadable bool `json:"applicationReadable,omitempty"` + + // Directory: The path to the directory containing the static files, + // from the application root directory. Everything after the end of the + // matched url pattern is appended to static_dir to form the full path + // to the requested file. + Directory string `json:"directory,omitempty"` + + // Expiration: The length of time a static file served by this handler + // ought to be cached by web proxies and browsers. + Expiration string `json:"expiration,omitempty"` + + // HttpHeaders: HTTP headers to use for all responses from these URLs. + HttpHeaders map[string]string `json:"httpHeaders,omitempty"` + + // MimeType: If specified, all files served by this handler will be + // served using the specified MIME type. If not specified, the MIME type + // for a file will be derived from the file's filename extension. + MimeType string `json:"mimeType,omitempty"` + + // RequireMatchingFile: If true, this UrlMap entry does not match the + // request unless the file referenced by the handler also exists. If no + // such file exists, processing will continue with the next UrlMap that + // matches the requested URL. + RequireMatchingFile bool `json:"requireMatchingFile,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ApplicationReadable") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *StaticDirectoryHandler) MarshalJSON() ([]byte, error) { + type noMethod StaticDirectoryHandler + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// StaticFilesHandler: Files served directly to the user for a given +// URL, such as images, CSS stylesheets, or JavaScript source files. +// Static file handlers describe which files in the application +// directory are static files, and which URLs serve them. +type StaticFilesHandler struct { + // ApplicationReadable: By default, files declared in static file + // handlers are uploaded as static data and are only served to end + // users, they cannot be read by an application. If this field is set to + // true, the files are also uploaded as code data so your application + // can read them. Both uploads are charged against your code and static + // data storage resource quotas. + ApplicationReadable bool `json:"applicationReadable,omitempty"` + + // Expiration: The length of time a static file served by this handler + // ought to be cached by web proxies and browsers. + Expiration string `json:"expiration,omitempty"` + + // HttpHeaders: HTTP headers to use for all responses from these URLs. + HttpHeaders map[string]string `json:"httpHeaders,omitempty"` + + // MimeType: If specified, all files served by this handler will be + // served using the specified MIME type. If not specified, the MIME type + // for a file will be derived from the file's filename extension. + MimeType string `json:"mimeType,omitempty"` + + // Path: The path to the static files matched by the URL pattern, from + // the application root directory. The path can refer to text matched in + // groupings in the URL pattern. + Path string `json:"path,omitempty"` + + // RequireMatchingFile: If true, this + // [UrlMap][google.appengine.v1beta4.UrlMap] entry does not match the + // request unless the file referenced by the handler also exists. If no + // such file exists, processing will continue with the next + // [UrlMap][google.appengine.v1beta4.UrlMap] that matches the requested + // URL. + RequireMatchingFile bool `json:"requireMatchingFile,omitempty"` + + // UploadPathRegex: A regular expression that matches the file paths for + // all files that will be referenced by this handler. + UploadPathRegex string `json:"uploadPathRegex,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ApplicationReadable") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *StaticFilesHandler) MarshalJSON() ([]byte, error) { + type noMethod StaticFilesHandler + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Status: The `Status` type defines a logical error model that is +// suitable for different programming environments, including REST APIs +// and RPC APIs. It is used by [gRPC](https://github.com/grpc). The +// error model is designed to be: - Simple to use and understand for +// most users - Flexible enough to meet unexpected needs # Overview The +// `Status` message contains three pieces of data: error code, error +// message, and error details. The error code should be an enum value of +// [google.rpc.Code][google.rpc.Code], but it may accept additional +// error codes if needed. The error message should be a developer-facing +// English message that helps developers *understand* and *resolve* the +// error. If a localized user-facing error message is needed, put the +// localized message in the error details or localize it in the client. +// The optional error details may contain arbitrary information about +// the error. There is a predefined set of error detail types in the +// package `google.rpc` which can be used for common error conditions. # +// Language mapping The `Status` message is the logical representation +// of the error model, but it is not necessarily the actual wire format. +// When the `Status` message is exposed in different client libraries +// and different wire protocols, it can be mapped differently. For +// example, it will likely be mapped to some exceptions in Java, but +// more likely mapped to some error codes in C. # Other uses The error +// model and the `Status` message can be used in a variety of +// environments, either with or without APIs, to provide a consistent +// developer experience across different environments. Example uses of +// this error model include: - Partial errors. If a service needs to +// return partial errors to the client, it may embed the `Status` in the +// normal response to indicate the partial errors. - Workflow errors. A +// typical workflow has multiple steps. Each step may have a `Status` +// message for error reporting purpose. - Batch operations. If a client +// uses batch request and batch response, the `Status` message should be +// used directly inside batch response, one for each error sub-response. +// - Asynchronous operations. If an API call embeds asynchronous +// operation results in its response, the status of those operations +// should be represented directly using the `Status` message. - Logging. +// If some API errors are stored in logs, the message `Status` could be +// used directly after any stripping needed for security/privacy +// reasons. +type Status struct { + // Code: The status code, which should be an enum value of + // [google.rpc.Code][google.rpc.Code]. + Code int64 `json:"code,omitempty"` + + // Details: A list of messages that carry the error details. There will + // be a common set of message types for APIs to use. + Details []StatusDetails `json:"details,omitempty"` + + // Message: A developer-facing error message, which should be in + // English. Any user-facing error message should be localized and sent + // in the [google.rpc.Status.details][google.rpc.Status.details] field, + // or localized by the client. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Status) MarshalJSON() ([]byte, error) { + type noMethod Status + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type StatusDetails interface{} + +// TrafficSplit: Configuration for traffic splitting for versions within +// a single module. Traffic splitting allows traffic directed to the +// module to be assigned to one of several versions in a fractional way, +// enabling experiments and canarying new builds, for example. +type TrafficSplit struct { + // Allocations: Mapping from module version IDs within the module to + // fractional (0.000, 1] allocations of traffic for that version. Each + // version may only be specified once, but some versions in the module + // may not have any traffic allocation. Modules that have traffic + // allocated in this field may not be deleted until the module is + // deleted, or their traffic allocation is removed. Allocations must sum + // to 1. Supports precision up to two decimal places for IP-based splits + // and up to three decimal places for cookie-based splits. + Allocations *TrafficSplitAllocations `json:"allocations,omitempty"` + + // ShardBy: Which mechanism should be used as a selector when choosing a + // version to send a request to. The traffic selection algorithm will be + // stable for either type until allocations are changed. + // + // Possible values: + // "UNSPECIFIED" + // "COOKIE" + // "IP" + ShardBy string `json:"shardBy,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Allocations") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TrafficSplit) MarshalJSON() ([]byte, error) { + type noMethod TrafficSplit + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TrafficSplitAllocations: Mapping from module version IDs within the +// module to fractional (0.000, 1] allocations of traffic for that +// version. Each version may only be specified once, but some versions +// in the module may not have any traffic allocation. Modules that have +// traffic allocated in this field may not be deleted until the module +// is deleted, or their traffic allocation is removed. Allocations must +// sum to 1. Supports precision up to two decimal places for IP-based +// splits and up to three decimal places for cookie-based splits. +type TrafficSplitAllocations struct { +} + +// UrlDispatchRule: Rules to match an HTTP request and dispatch that +// request to a module. +type UrlDispatchRule struct { + // Domain: The domain name to match on. Supports '*' (glob) wildcarding + // on the left-hand side of a '.'. If empty, all domains will be matched + // (the same as '*'). + Domain string `json:"domain,omitempty"` + + // Module: The resource id of a Module in this application that should + // service the matched request. The Module must already exist. Example: + // "default". + Module string `json:"module,omitempty"` + + // Path: The pathname within the host. This must start with a '/'. A + // single '*' (glob) can be included at the end of the path. The sum of + // the lengths of the domain and path may not exceed 100 characters. + Path string `json:"path,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Domain") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlDispatchRule) MarshalJSON() ([]byte, error) { + type noMethod UrlDispatchRule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UrlMap: A URL pattern and description of how it should be handled. +// App Engine can handle URLs by executing application code, or by +// serving static files uploaded with the code, such as images, CSS or +// JavaScript. +type UrlMap struct { + // ApiEndpoint: Use API Endpoints to handle requests. + ApiEndpoint *ApiEndpointHandler `json:"apiEndpoint,omitempty"` + + // AuthFailAction: For users not logged in, how to handle access to + // resources with required login. Defaults to "redirect". + // + // Possible values: + // "AUTH_FAIL_ACTION_UNSPECIFIED" + // "AUTH_FAIL_ACTION_REDIRECT" + // "AUTH_FAIL_ACTION_UNAUTHORIZED" + AuthFailAction string `json:"authFailAction,omitempty"` + + // Login: What level of login is required to access this resource. + // + // Possible values: + // "LOGIN_UNSPECIFIED" + // "LOGIN_OPTIONAL" + // "LOGIN_ADMIN" + // "LOGIN_REQUIRED" + Login string `json:"login,omitempty"` + + // RedirectHttpResponseCode: `30x` code to use when performing redirects + // for the `secure` field. A `302` is used by default. + // + // Possible values: + // "REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED" + // "REDIRECT_HTTP_RESPONSE_CODE_301" + // "REDIRECT_HTTP_RESPONSE_CODE_302" + // "REDIRECT_HTTP_RESPONSE_CODE_303" + // "REDIRECT_HTTP_RESPONSE_CODE_307" + RedirectHttpResponseCode string `json:"redirectHttpResponseCode,omitempty"` + + // Script: Executes a script to handle the request that matches the URL + // pattern. + Script *ScriptHandler `json:"script,omitempty"` + + // SecurityLevel: Configures whether security (HTTPS) should be enforced + // for this URL. + // + // Possible values: + // "SECURE_UNSPECIFIED" + // "SECURE_DEFAULT" + // "SECURE_NEVER" + // "SECURE_OPTIONAL" + // "SECURE_ALWAYS" + SecurityLevel string `json:"securityLevel,omitempty"` + + // StaticDirectory: Serves the entire contents of a directory as static + // files. This attribute is deprecated. You can mimic the behavior of + // static directories using static files. + StaticDirectory *StaticDirectoryHandler `json:"staticDirectory,omitempty"` + + // StaticFiles: Returns the contents of a file, such as an image, as the + // response. + StaticFiles *StaticFilesHandler `json:"staticFiles,omitempty"` + + // UrlRegex: A URL prefix. This value uses regular expression syntax + // (and so regexp special characters must be escaped), but it should not + // contain groupings. All URLs that begin with this prefix are handled + // by this handler, using the portion of the URL after the prefix as + // part of the file path. This is always required. + UrlRegex string `json:"urlRegex,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ApiEndpoint") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlMap) MarshalJSON() ([]byte, error) { + type noMethod UrlMap + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Version: A Version is a specific set of source code and configuration +// files deployed to a module. +type Version struct { + // ApiConfig: Serving configuration for Google Cloud Endpoints. Only + // returned in `GET` requests if `view=FULL` is set. May only be set on + // create requests; once created, is immutable. + ApiConfig *ApiConfigHandler `json:"apiConfig,omitempty"` + + // AutomaticScaling: Automatic scaling is the scaling policy that App + // Engine has used since its inception. It is based on request rate, + // response latencies, and other application metrics. + AutomaticScaling *AutomaticScaling `json:"automaticScaling,omitempty"` + + // BasicScaling: A module with basic scaling will create an instance + // when the application receives a request. The instance will be turned + // down when the app becomes idle. Basic scaling is ideal for work that + // is intermittent or driven by user activity. + BasicScaling *BasicScaling `json:"basicScaling,omitempty"` + + // BetaSettings: Beta settings supplied to the application via metadata. + BetaSettings map[string]string `json:"betaSettings,omitempty"` + + // CreationTime: Creation time of this version. This will be between the + // start and end times of the operation that creates this version. + // @OutputOnly + CreationTime string `json:"creationTime,omitempty"` + + // DefaultExpiration: The length of time a static file served by a + // static file handler ought to be cached by web proxies and browsers, + // if the handler does not specify its own expiration. Only returned in + // `GET` requests if `view=FULL` is set. May only be set on create + // requests; once created, is immutable. + DefaultExpiration string `json:"defaultExpiration,omitempty"` + + // Deployer: The email address of the user who created this version. + // @OutputOnly + Deployer string `json:"deployer,omitempty"` + + // Deployment: Code and application artifacts that make up this version. + // Only returned in `GET` requests if `view=FULL` is set. May only be + // set on create requests; once created, is immutable. + Deployment *Deployment `json:"deployment,omitempty"` + + // Env: The App Engine execution environment to use for this version. + // Default: "1" + Env string `json:"env,omitempty"` + + // EnvVariables: Environment variables made available to the + // application. Only returned in `GET` requests if `view=FULL` is set. + // May only be set on create requests; once created, is immutable. + EnvVariables map[string]string `json:"envVariables,omitempty"` + + // ErrorHandlers: Custom static error pages instead of these generic + // error pages, (limit 10 KB/page) Only returned in `GET` requests if + // `view=FULL` is set. May only be set on create requests; once created, + // is immutable. + ErrorHandlers []*ErrorHandler `json:"errorHandlers,omitempty"` + + // Handlers: An ordered list of URL Matching patterns that should be + // applied to incoming requests. The first matching URL consumes the + // request, and subsequent handlers are not attempted. Only returned in + // `GET` requests if `view=FULL` is set. May only be set on create + // requests; once created, is immutable. + Handlers []*UrlMap `json:"handlers,omitempty"` + + // HealthCheck: Configure health checking for the VM instances. + // Unhealthy VM instances will be stopped and replaced with new + // instances. Only returned in `GET` requests if `view=FULL` is set. May + // only be set on create requests; once created, is immutable. + HealthCheck *HealthCheck `json:"healthCheck,omitempty"` + + // Id: The relative name/path of the Version within the module. Example: + // "v1". Version specifiers can contain lowercase letters, digits, and + // hyphens. It cannot begin with the prefix `ah-` and the names + // `default` and `latest` are reserved and cannot be used. + Id string `json:"id,omitempty"` + + // InboundServices: Before an application can receive email or XMPP + // messages, the application must be configured to enable the service. + // + // Possible values: + // "INBOUND_SERVICE_UNSPECIFIED" - Not specified. + // "INBOUND_SERVICE_MAIL" - Allows an application to receive mail. + // "INBOUND_SERVICE_MAIL_BOUNCE" - Allows an application receive email + // bound notifications. + // "INBOUND_SERVICE_XMPP_ERROR" - Allows an application to receive + // error stanzas. + // "INBOUND_SERVICE_XMPP_MESSAGE" - Allows an application to receive + // instant messages. + // "INBOUND_SERVICE_XMPP_SUBSCRIBE" - Allows an application to receive + // user subscription POSTs. + // "INBOUND_SERVICE_XMPP_PRESENCE" - Allows an application to receive + // a user's chat presence. + // "INBOUND_SERVICE_CHANNEL_PRESENCE" - Registers an application for + // notifications when a client connects or disconnects from a channel. + // "INBOUND_SERVICE_WARMUP" - Enables warmup requests. + InboundServices []string `json:"inboundServices,omitempty"` + + // InstanceClass: The frontend instance class to use to run this app. + // Valid values are `[F1, F2, F4, F4_1G]`. Default: "F1" + InstanceClass string `json:"instanceClass,omitempty"` + + // Libraries: Configuration for Python runtime third-party libraries + // required by the application. Only returned in `GET` requests if + // `view=FULL` is set. May only be set on create requests; once created, + // is immutable. + Libraries []*Library `json:"libraries,omitempty"` + + // ManualScaling: A module with manual scaling runs continuously, + // allowing you to perform complex initialization and rely on the state + // of its memory over time. + ManualScaling *ManualScaling `json:"manualScaling,omitempty"` + + // Name: The full path to the Version resource in the API. Example: + // "apps/myapp/modules/default/versions/v1". @OutputOnly + Name string `json:"name,omitempty"` + + // Network: Used to specify extra network settings (for VM runtimes + // only). + Network *Network `json:"network,omitempty"` + + // NobuildFilesRegex: Go only. Files that match this pattern will not be + // built into the app. May only be set on create requests. + NobuildFilesRegex string `json:"nobuildFilesRegex,omitempty"` + + // Resources: Used to specify how many machine resources an app version + // needs (for VM runtimes only). + Resources *Resources `json:"resources,omitempty"` + + // Runtime: The desired runtime. Values can include python27, java7, go, + // etc. + Runtime string `json:"runtime,omitempty"` + + // ServingStatus: The current serving status of this version. Only + // `SERVING` versions will have instances created or billed for. If this + // field is unset when a version is created, `SERVING` status will be + // assumed. It is an error to explicitly set this field to + // `SERVING_STATUS_UNSPECIFIED`. + // + // Possible values: + // "SERVING_STATUS_UNSPECIFIED" + // "SERVING" + // "STOPPED" + ServingStatus string `json:"servingStatus,omitempty"` + + // Threadsafe: If true, multiple requests can be dispatched to the app + // at once. + Threadsafe bool `json:"threadsafe,omitempty"` + + // Vm: Whether to deploy this app in a VM container (deprecated, use + // "env":"2"). + Vm bool `json:"vm,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ApiConfig") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Version) MarshalJSON() ([]byte, error) { + type noMethod Version + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "appengine.apps.get": + +type AppsGetCall struct { + s *Service + appsId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets information about an application. +func (r *AppsService) Get(appsId string) *AppsGetCall { + c := &AppsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.appsId = appsId + return c +} + +// EnsureResourcesExist sets the optional parameter +// "ensureResourcesExist": Certain resources associated with an +// application are created on-demand. Controls whether these resources +// should be created when performing the `GET` operation. If specified +// and any resources cloud not be created, the request will fail with an +// error code. +func (c *AppsGetCall) EnsureResourcesExist(ensureResourcesExist bool) *AppsGetCall { + c.opt_["ensureResourcesExist"] = ensureResourcesExist + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AppsGetCall) Fields(s ...googleapi.Field) *AppsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AppsGetCall) IfNoneMatch(entityTag string) *AppsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AppsGetCall) Context(ctx context.Context) *AppsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AppsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ensureResourcesExist"]; ok { + params.Set("ensureResourcesExist", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta4/apps/{appsId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "appsId": c.appsId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "appengine.apps.get" call. +// Exactly one of *Application or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Application.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AppsGetCall) Do() (*Application, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Application{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets information about an application.", + // "httpMethod": "GET", + // "id": "appengine.apps.get", + // "parameterOrder": [ + // "appsId" + // ], + // "parameters": { + // "appsId": { + // "description": "Part of `name`. Name of the application to get. For example: \"apps/myapp\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "ensureResourcesExist": { + // "description": "Certain resources associated with an application are created on-demand. Controls whether these resources should be created when performing the `GET` operation. If specified and any resources cloud not be created, the request will fail with an error code.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "v1beta4/apps/{appsId}", + // "response": { + // "$ref": "Application" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "appengine.apps.modules.delete": + +type AppsModulesDeleteCall struct { + s *Service + appsId string + modulesId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a module and all enclosed versions. +func (r *AppsModulesService) Delete(appsId string, modulesId string) *AppsModulesDeleteCall { + c := &AppsModulesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.appsId = appsId + c.modulesId = modulesId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AppsModulesDeleteCall) Fields(s ...googleapi.Field) *AppsModulesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AppsModulesDeleteCall) Context(ctx context.Context) *AppsModulesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AppsModulesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta4/apps/{appsId}/modules/{modulesId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "appsId": c.appsId, + "modulesId": c.modulesId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "appengine.apps.modules.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AppsModulesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a module and all enclosed versions.", + // "httpMethod": "DELETE", + // "id": "appengine.apps.modules.delete", + // "parameterOrder": [ + // "appsId", + // "modulesId" + // ], + // "parameters": { + // "appsId": { + // "description": "Part of `name`. Name of the resource requested. For example: \"apps/myapp/modules/default\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "modulesId": { + // "description": "Part of `name`. See documentation of `appsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta4/apps/{appsId}/modules/{modulesId}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "appengine.apps.modules.get": + +type AppsModulesGetCall struct { + s *Service + appsId string + modulesId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the current configuration of the module. +func (r *AppsModulesService) Get(appsId string, modulesId string) *AppsModulesGetCall { + c := &AppsModulesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.appsId = appsId + c.modulesId = modulesId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AppsModulesGetCall) Fields(s ...googleapi.Field) *AppsModulesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AppsModulesGetCall) IfNoneMatch(entityTag string) *AppsModulesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AppsModulesGetCall) Context(ctx context.Context) *AppsModulesGetCall { + c.ctx_ = ctx + return c +} + +func (c *AppsModulesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta4/apps/{appsId}/modules/{modulesId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "appsId": c.appsId, + "modulesId": c.modulesId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "appengine.apps.modules.get" call. +// Exactly one of *Module or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Module.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AppsModulesGetCall) Do() (*Module, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Module{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the current configuration of the module.", + // "httpMethod": "GET", + // "id": "appengine.apps.modules.get", + // "parameterOrder": [ + // "appsId", + // "modulesId" + // ], + // "parameters": { + // "appsId": { + // "description": "Part of `name`. Name of the resource requested. For example: \"apps/myapp/modules/default\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "modulesId": { + // "description": "Part of `name`. See documentation of `appsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta4/apps/{appsId}/modules/{modulesId}", + // "response": { + // "$ref": "Module" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "appengine.apps.modules.list": + +type AppsModulesListCall struct { + s *Service + appsId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all the modules in the application. +func (r *AppsModulesService) List(appsId string) *AppsModulesListCall { + c := &AppsModulesListCall{s: r.s, opt_: make(map[string]interface{})} + c.appsId = appsId + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum results to +// return per page. +func (c *AppsModulesListCall) PageSize(pageSize int64) *AppsModulesListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +// for fetching the next page of results. +func (c *AppsModulesListCall) PageToken(pageToken string) *AppsModulesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AppsModulesListCall) Fields(s ...googleapi.Field) *AppsModulesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AppsModulesListCall) IfNoneMatch(entityTag string) *AppsModulesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AppsModulesListCall) Context(ctx context.Context) *AppsModulesListCall { + c.ctx_ = ctx + return c +} + +func (c *AppsModulesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta4/apps/{appsId}/modules") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "appsId": c.appsId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "appengine.apps.modules.list" call. +// Exactly one of *ListModulesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListModulesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AppsModulesListCall) Do() (*ListModulesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListModulesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all the modules in the application.", + // "httpMethod": "GET", + // "id": "appengine.apps.modules.list", + // "parameterOrder": [ + // "appsId" + // ], + // "parameters": { + // "appsId": { + // "description": "Part of `name`. Name of the resource requested. For example: \"apps/myapp\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageSize": { + // "description": "Maximum results to return per page.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Continuation token for fetching the next page of results.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1beta4/apps/{appsId}/modules", + // "response": { + // "$ref": "ListModulesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "appengine.apps.modules.patch": + +type AppsModulesPatchCall struct { + s *Service + appsId string + modulesId string + module *Module + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates the configuration of the specified module. +func (r *AppsModulesService) Patch(appsId string, modulesId string, module *Module) *AppsModulesPatchCall { + c := &AppsModulesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.appsId = appsId + c.modulesId = modulesId + c.module = module + return c +} + +// Mask sets the optional parameter "mask": Standard field mask for the +// set of fields to be updated. +func (c *AppsModulesPatchCall) Mask(mask string) *AppsModulesPatchCall { + c.opt_["mask"] = mask + return c +} + +// MigrateTraffic sets the optional parameter "migrateTraffic": Whether +// to use Traffic Migration to shift traffic gradually. Traffic can only +// be migrated from a single version to another single version. +func (c *AppsModulesPatchCall) MigrateTraffic(migrateTraffic bool) *AppsModulesPatchCall { + c.opt_["migrateTraffic"] = migrateTraffic + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AppsModulesPatchCall) Fields(s ...googleapi.Field) *AppsModulesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AppsModulesPatchCall) Context(ctx context.Context) *AppsModulesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AppsModulesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.module) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["mask"]; ok { + params.Set("mask", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["migrateTraffic"]; ok { + params.Set("migrateTraffic", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta4/apps/{appsId}/modules/{modulesId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "appsId": c.appsId, + "modulesId": c.modulesId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "appengine.apps.modules.patch" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AppsModulesPatchCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the configuration of the specified module.", + // "httpMethod": "PATCH", + // "id": "appengine.apps.modules.patch", + // "parameterOrder": [ + // "appsId", + // "modulesId" + // ], + // "parameters": { + // "appsId": { + // "description": "Part of `name`. Name of the resource to update. For example: \"apps/myapp/modules/default\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "mask": { + // "description": "Standard field mask for the set of fields to be updated.", + // "location": "query", + // "type": "string" + // }, + // "migrateTraffic": { + // "description": "Whether to use Traffic Migration to shift traffic gradually. Traffic can only be migrated from a single version to another single version.", + // "location": "query", + // "type": "boolean" + // }, + // "modulesId": { + // "description": "Part of `name`. See documentation of `appsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta4/apps/{appsId}/modules/{modulesId}", + // "request": { + // "$ref": "Module" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "appengine.apps.modules.versions.create": + +type AppsModulesVersionsCreateCall struct { + s *Service + appsId string + modulesId string + version *Version + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Deploys new code and resource files to a version. +func (r *AppsModulesVersionsService) Create(appsId string, modulesId string, version *Version) *AppsModulesVersionsCreateCall { + c := &AppsModulesVersionsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.appsId = appsId + c.modulesId = modulesId + c.version = version + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AppsModulesVersionsCreateCall) Fields(s ...googleapi.Field) *AppsModulesVersionsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AppsModulesVersionsCreateCall) Context(ctx context.Context) *AppsModulesVersionsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *AppsModulesVersionsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.version) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta4/apps/{appsId}/modules/{modulesId}/versions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "appsId": c.appsId, + "modulesId": c.modulesId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "appengine.apps.modules.versions.create" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AppsModulesVersionsCreateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deploys new code and resource files to a version.", + // "httpMethod": "POST", + // "id": "appengine.apps.modules.versions.create", + // "parameterOrder": [ + // "appsId", + // "modulesId" + // ], + // "parameters": { + // "appsId": { + // "description": "Part of `name`. Name of the resource to update. For example: \"apps/myapp/modules/default\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "modulesId": { + // "description": "Part of `name`. See documentation of `appsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions", + // "request": { + // "$ref": "Version" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "appengine.apps.modules.versions.delete": + +type AppsModulesVersionsDeleteCall struct { + s *Service + appsId string + modulesId string + versionsId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing version. +func (r *AppsModulesVersionsService) Delete(appsId string, modulesId string, versionsId string) *AppsModulesVersionsDeleteCall { + c := &AppsModulesVersionsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.appsId = appsId + c.modulesId = modulesId + c.versionsId = versionsId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AppsModulesVersionsDeleteCall) Fields(s ...googleapi.Field) *AppsModulesVersionsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AppsModulesVersionsDeleteCall) Context(ctx context.Context) *AppsModulesVersionsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AppsModulesVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "appsId": c.appsId, + "modulesId": c.modulesId, + "versionsId": c.versionsId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "appengine.apps.modules.versions.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AppsModulesVersionsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes an existing version.", + // "httpMethod": "DELETE", + // "id": "appengine.apps.modules.versions.delete", + // "parameterOrder": [ + // "appsId", + // "modulesId", + // "versionsId" + // ], + // "parameters": { + // "appsId": { + // "description": "Part of `name`. Name of the resource requested. For example: \"apps/myapp/modules/default/versions/v1\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "modulesId": { + // "description": "Part of `name`. See documentation of `appsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "versionsId": { + // "description": "Part of `name`. See documentation of `appsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "appengine.apps.modules.versions.get": + +type AppsModulesVersionsGetCall struct { + s *Service + appsId string + modulesId string + versionsId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets application deployment information. +func (r *AppsModulesVersionsService) Get(appsId string, modulesId string, versionsId string) *AppsModulesVersionsGetCall { + c := &AppsModulesVersionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.appsId = appsId + c.modulesId = modulesId + c.versionsId = versionsId + return c +} + +// View sets the optional parameter "view": Controls the set of fields +// returned in the `Get` response. +// +// Possible values: +// "BASIC" +// "FULL" +func (c *AppsModulesVersionsGetCall) View(view string) *AppsModulesVersionsGetCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AppsModulesVersionsGetCall) Fields(s ...googleapi.Field) *AppsModulesVersionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AppsModulesVersionsGetCall) IfNoneMatch(entityTag string) *AppsModulesVersionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AppsModulesVersionsGetCall) Context(ctx context.Context) *AppsModulesVersionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AppsModulesVersionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "appsId": c.appsId, + "modulesId": c.modulesId, + "versionsId": c.versionsId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "appengine.apps.modules.versions.get" call. +// Exactly one of *Version or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Version.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AppsModulesVersionsGetCall) Do() (*Version, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Version{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets application deployment information.", + // "httpMethod": "GET", + // "id": "appengine.apps.modules.versions.get", + // "parameterOrder": [ + // "appsId", + // "modulesId", + // "versionsId" + // ], + // "parameters": { + // "appsId": { + // "description": "Part of `name`. Name of the resource requested. For example: \"apps/myapp/modules/default/versions/v1\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "modulesId": { + // "description": "Part of `name`. See documentation of `appsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "versionsId": { + // "description": "Part of `name`. See documentation of `appsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "view": { + // "description": "Controls the set of fields returned in the `Get` response.", + // "enum": [ + // "BASIC", + // "FULL" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}", + // "response": { + // "$ref": "Version" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "appengine.apps.modules.versions.list": + +type AppsModulesVersionsListCall struct { + s *Service + appsId string + modulesId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the versions of a module. +func (r *AppsModulesVersionsService) List(appsId string, modulesId string) *AppsModulesVersionsListCall { + c := &AppsModulesVersionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.appsId = appsId + c.modulesId = modulesId + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum results to +// return per page. +func (c *AppsModulesVersionsListCall) PageSize(pageSize int64) *AppsModulesVersionsListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +// for fetching the next page of results. +func (c *AppsModulesVersionsListCall) PageToken(pageToken string) *AppsModulesVersionsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// View sets the optional parameter "view": Controls the set of fields +// returned in the `List` response. +// +// Possible values: +// "BASIC" +// "FULL" +func (c *AppsModulesVersionsListCall) View(view string) *AppsModulesVersionsListCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AppsModulesVersionsListCall) Fields(s ...googleapi.Field) *AppsModulesVersionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AppsModulesVersionsListCall) IfNoneMatch(entityTag string) *AppsModulesVersionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AppsModulesVersionsListCall) Context(ctx context.Context) *AppsModulesVersionsListCall { + c.ctx_ = ctx + return c +} + +func (c *AppsModulesVersionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta4/apps/{appsId}/modules/{modulesId}/versions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "appsId": c.appsId, + "modulesId": c.modulesId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "appengine.apps.modules.versions.list" call. +// Exactly one of *ListVersionsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListVersionsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AppsModulesVersionsListCall) Do() (*ListVersionsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListVersionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the versions of a module.", + // "httpMethod": "GET", + // "id": "appengine.apps.modules.versions.list", + // "parameterOrder": [ + // "appsId", + // "modulesId" + // ], + // "parameters": { + // "appsId": { + // "description": "Part of `name`. Name of the resource requested. For example: \"apps/myapp/modules/default\".", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "modulesId": { + // "description": "Part of `name`. See documentation of `appsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageSize": { + // "description": "Maximum results to return per page.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Continuation token for fetching the next page of results.", + // "location": "query", + // "type": "string" + // }, + // "view": { + // "description": "Controls the set of fields returned in the `List` response.", + // "enum": [ + // "BASIC", + // "FULL" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1beta4/apps/{appsId}/modules/{modulesId}/versions", + // "response": { + // "$ref": "ListVersionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "appengine.apps.operations.get": + +type AppsOperationsGetCall struct { + s *Service + appsId string + operationsId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the latest state of a long-running operation. Clients can +// use this method to poll the operation result at intervals as +// recommended by the API service. +func (r *AppsOperationsService) Get(appsId string, operationsId string) *AppsOperationsGetCall { + c := &AppsOperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.appsId = appsId + c.operationsId = operationsId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AppsOperationsGetCall) Fields(s ...googleapi.Field) *AppsOperationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AppsOperationsGetCall) IfNoneMatch(entityTag string) *AppsOperationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AppsOperationsGetCall) Context(ctx context.Context) *AppsOperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AppsOperationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta4/apps/{appsId}/operations/{operationsId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "appsId": c.appsId, + "operationsId": c.operationsId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "appengine.apps.operations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AppsOperationsGetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + // "httpMethod": "GET", + // "id": "appengine.apps.operations.get", + // "parameterOrder": [ + // "appsId", + // "operationsId" + // ], + // "parameters": { + // "appsId": { + // "description": "Part of `name`. The name of the operation resource.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "operationsId": { + // "description": "Part of `name`. See documentation of `appsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta4/apps/{appsId}/operations/{operationsId}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "appengine.apps.operations.list": + +type AppsOperationsListCall struct { + s *Service + appsId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// `UNIMPLEMENTED`. NOTE: the `name` binding below allows API services +// to override the binding to use different resource name schemes, such +// as `users/*/operations`. +func (r *AppsOperationsService) List(appsId string) *AppsOperationsListCall { + c := &AppsOperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.appsId = appsId + return c +} + +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *AppsOperationsListCall) Filter(filter string) *AppsOperationsListCall { + c.opt_["filter"] = filter + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *AppsOperationsListCall) PageSize(pageSize int64) *AppsOperationsListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *AppsOperationsListCall) PageToken(pageToken string) *AppsOperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AppsOperationsListCall) Fields(s ...googleapi.Field) *AppsOperationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AppsOperationsListCall) IfNoneMatch(entityTag string) *AppsOperationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AppsOperationsListCall) Context(ctx context.Context) *AppsOperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *AppsOperationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta4/apps/{appsId}/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "appsId": c.appsId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "appengine.apps.operations.list" call. +// Exactly one of *ListOperationsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListOperationsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AppsOperationsListCall) Do() (*ListOperationsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListOperationsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding below allows API services to override the binding to use different resource name schemes, such as `users/*/operations`.", + // "httpMethod": "GET", + // "id": "appengine.apps.operations.list", + // "parameterOrder": [ + // "appsId" + // ], + // "parameters": { + // "appsId": { + // "description": "Part of `name`. The name of the operation collection.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "The standard list page size.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The standard list page token.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1beta4/apps/{appsId}/operations", + // "response": { + // "$ref": "ListOperationsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/appsactivity/v1/appsactivity-api.json b/Godeps/_workspace/src/google.golang.org/api/appsactivity/v1/appsactivity-api.json new file mode 100644 index 000000000..b36756be6 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/appsactivity/v1/appsactivity-api.json @@ -0,0 +1,477 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/ZeC-oWzDKj1E5_H69LVDW5wAByE\"", + "discoveryVersion": "v1", + "id": "appsactivity:v1", + "name": "appsactivity", + "version": "v1", + "revision": "20150326", + "title": "Google Apps Activity API", + "description": "Provides a historical view of activity.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://developers.google.com/google-apps/activity/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/appsactivity/v1/", + "basePath": "/appsactivity/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "appsactivity/v1/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json" + ], + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.", + "location": "query" + }, + "userIp": { + "type": "string", + "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.", + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/activity": { + "description": "View the activity history of your Google Apps" + }, + "https://www.googleapis.com/auth/drive": { + "description": "View and manage the files in your Google Drive" + }, + "https://www.googleapis.com/auth/drive.metadata": { + "description": "View and manage metadata of files in your Google Drive" + }, + "https://www.googleapis.com/auth/drive.metadata.readonly": { + "description": "View metadata for files in your Google Drive" + }, + "https://www.googleapis.com/auth/drive.readonly": { + "description": "View the files in your Google Drive" + } + } + } + }, + "schemas": { + "Activity": { + "id": "Activity", + "type": "object", + "description": "An Activity resource is a combined view of multiple events. An activity has a list of individual events and a combined view of the common fields among all events.", + "properties": { + "combinedEvent": { + "$ref": "Event", + "description": "The fields common to all of the singleEvents that make up the Activity." + }, + "singleEvents": { + "type": "array", + "description": "A list of all the Events that make up the Activity.", + "items": { + "$ref": "Event" + } + } + } + }, + "Event": { + "id": "Event", + "type": "object", + "description": "Represents the changes associated with an action taken by a user.", + "properties": { + "additionalEventTypes": { + "type": "array", + "description": "Additional event types. Some events may have multiple types when multiple actions are part of a single event. For example, creating a document, renaming it, and sharing it may be part of a single file-creation event.", + "items": { + "type": "string", + "enum": [ + "comment", + "create", + "edit", + "emptyTrash", + "move", + "permissionChange", + "rename", + "trash", + "unknown", + "untrash", + "upload" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "eventTimeMillis": { + "type": "string", + "description": "The time at which the event occurred formatted as Unix time in milliseconds.", + "format": "uint64" + }, + "fromUserDeletion": { + "type": "boolean", + "description": "Whether this event is caused by a user being deleted." + }, + "move": { + "$ref": "Move", + "description": "Extra information for move type events, such as changes in an object's parents." + }, + "permissionChanges": { + "type": "array", + "description": "Extra information for permissionChange type events, such as the user or group the new permission applies to.", + "items": { + "$ref": "PermissionChange" + } + }, + "primaryEventType": { + "type": "string", + "description": "The main type of event that occurred.", + "enum": [ + "comment", + "create", + "edit", + "emptyTrash", + "move", + "permissionChange", + "rename", + "trash", + "unknown", + "untrash", + "upload" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "rename": { + "$ref": "Rename", + "description": "Extra information for rename type events, such as the old and new names." + }, + "target": { + "$ref": "Target", + "description": "Information specific to the Target object modified by the event." + }, + "user": { + "$ref": "User", + "description": "Represents the user responsible for the event." + } + } + }, + "ListActivitiesResponse": { + "id": "ListActivitiesResponse", + "type": "object", + "description": "The response from the list request. Contains a list of activities and a token to retrieve the next page of results.", + "properties": { + "activities": { + "type": "array", + "description": "List of activities.", + "items": { + "$ref": "Activity" + } + }, + "nextPageToken": { + "type": "string", + "description": "Token for the next page of results." + } + } + }, + "Move": { + "id": "Move", + "type": "object", + "description": "Contains information about changes in an object's parents as a result of a move type event.", + "properties": { + "addedParents": { + "type": "array", + "description": "The added parent(s).", + "items": { + "$ref": "Parent" + } + }, + "removedParents": { + "type": "array", + "description": "The removed parent(s).", + "items": { + "$ref": "Parent" + } + } + } + }, + "Parent": { + "id": "Parent", + "type": "object", + "description": "Contains information about a parent object. For example, a folder in Drive is a parent for all files within it.", + "properties": { + "id": { + "type": "string", + "description": "The parent's ID." + }, + "isRoot": { + "type": "boolean", + "description": "Whether this is the root folder." + }, + "title": { + "type": "string", + "description": "The parent's title." + } + } + }, + "Permission": { + "id": "Permission", + "type": "object", + "description": "Contains information about the permissions and type of access allowed with regards to a Google Drive object. This is a subset of the fields contained in a corresponding Drive Permissions object.", + "properties": { + "name": { + "type": "string", + "description": "The name of the user or group the permission applies to." + }, + "permissionId": { + "type": "string", + "description": "The ID for this permission. Corresponds to the Drive API's permission ID returned as part of the Drive Permissions resource." + }, + "role": { + "type": "string", + "description": "Indicates the Google Drive permissions role. The role determines a user's ability to read, write, or comment on the file.", + "enum": [ + "commenter", + "owner", + "reader", + "writer" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "type": { + "type": "string", + "description": "Indicates how widely permissions are granted.", + "enum": [ + "anyone", + "domain", + "group", + "user" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "user": { + "$ref": "User", + "description": "The user's information if the type is USER." + }, + "withLink": { + "type": "boolean", + "description": "Whether the permission requires a link to the file." + } + } + }, + "PermissionChange": { + "id": "PermissionChange", + "type": "object", + "description": "Contains information about a Drive object's permissions that changed as a result of a permissionChange type event.", + "properties": { + "addedPermissions": { + "type": "array", + "description": "Lists all Permission objects added.", + "items": { + "$ref": "Permission" + } + }, + "removedPermissions": { + "type": "array", + "description": "Lists all Permission objects removed.", + "items": { + "$ref": "Permission" + } + } + } + }, + "Photo": { + "id": "Photo", + "type": "object", + "description": "Photo information for a user.", + "properties": { + "url": { + "type": "string", + "description": "The URL of the photo." + } + } + }, + "Rename": { + "id": "Rename", + "type": "object", + "description": "Contains information about a renametype event.", + "properties": { + "newTitle": { + "type": "string", + "description": "The new title." + }, + "oldTitle": { + "type": "string", + "description": "The old title." + } + } + }, + "Target": { + "id": "Target", + "type": "object", + "description": "Information about the object modified by the event.", + "properties": { + "id": { + "type": "string", + "description": "The ID of the target. For example, in Google Drive, this is the file or folder ID." + }, + "mimeType": { + "type": "string", + "description": "The MIME type of the target." + }, + "name": { + "type": "string", + "description": "The name of the target. For example, in Google Drive, this is the title of the file." + } + } + }, + "User": { + "id": "User", + "type": "object", + "description": "A representation of a user.", + "properties": { + "name": { + "type": "string", + "description": "The displayable name of the user." + }, + "photo": { + "$ref": "Photo", + "description": "The profile photo of the user." + } + } + } + }, + "resources": { + "activities": { + "methods": { + "list": { + "id": "appsactivity.activities.list", + "path": "activities", + "httpMethod": "GET", + "description": "Returns a list of activities visible to the current logged in user. Visible activities are determined by the visiblity settings of the object that was acted on, e.g. Drive files a user can see. An activity is a record of past events. Multiple events may be merged if they are similar. A request is scoped to activities from a given Google service using the source parameter.", + "parameters": { + "drive.ancestorId": { + "type": "string", + "description": "Identifies the Drive folder containing the items for which to return activities.", + "location": "query" + }, + "drive.fileId": { + "type": "string", + "description": "Identifies the Drive item to return activities for.", + "location": "query" + }, + "groupingStrategy": { + "type": "string", + "description": "Indicates the strategy to use when grouping singleEvents items in the associated combinedEvent object.", + "default": "driveUi", + "enum": [ + "driveUi", + "none" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of events to return on a page. The response includes a continuation token if there are more events.", + "default": "50", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A token to retrieve a specific page of results.", + "location": "query" + }, + "source": { + "type": "string", + "description": "The Google service from which to return activities. Possible values of source are: \n- drive.google.com", + "location": "query" + }, + "userId": { + "type": "string", + "description": "Indicates the user to return activity for. Use the special value me to indicate the currently authenticated user.", + "default": "me", + "location": "query" + } + }, + "response": { + "$ref": "ListActivitiesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/activity", + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.metadata", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.readonly" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/appsactivity/v1/appsactivity-gen.go b/Godeps/_workspace/src/google.golang.org/api/appsactivity/v1/appsactivity-gen.go new file mode 100644 index 000000000..652207407 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/appsactivity/v1/appsactivity-gen.go @@ -0,0 +1,704 @@ +// Package appsactivity provides access to the Google Apps Activity API. +// +// See https://developers.google.com/google-apps/activity/ +// +// Usage example: +// +// import "google.golang.org/api/appsactivity/v1" +// ... +// appsactivityService, err := appsactivity.New(oauthHttpClient) +package appsactivity // import "google.golang.org/api/appsactivity/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "appsactivity:v1" +const apiName = "appsactivity" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/appsactivity/v1/" + +// OAuth2 scopes used by this API. +const ( + // View the activity history of your Google Apps + ActivityScope = "https://www.googleapis.com/auth/activity" + + // View and manage the files in your Google Drive + DriveScope = "https://www.googleapis.com/auth/drive" + + // View and manage metadata of files in your Google Drive + DriveMetadataScope = "https://www.googleapis.com/auth/drive.metadata" + + // View metadata for files in your Google Drive + DriveMetadataReadonlyScope = "https://www.googleapis.com/auth/drive.metadata.readonly" + + // View the files in your Google Drive + DriveReadonlyScope = "https://www.googleapis.com/auth/drive.readonly" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Activities = NewActivitiesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Activities *ActivitiesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewActivitiesService(s *Service) *ActivitiesService { + rs := &ActivitiesService{s: s} + return rs +} + +type ActivitiesService struct { + s *Service +} + +// Activity: An Activity resource is a combined view of multiple events. +// An activity has a list of individual events and a combined view of +// the common fields among all events. +type Activity struct { + // CombinedEvent: The fields common to all of the singleEvents that make + // up the Activity. + CombinedEvent *Event `json:"combinedEvent,omitempty"` + + // SingleEvents: A list of all the Events that make up the Activity. + SingleEvents []*Event `json:"singleEvents,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CombinedEvent") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Activity) MarshalJSON() ([]byte, error) { + type noMethod Activity + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Event: Represents the changes associated with an action taken by a +// user. +type Event struct { + // AdditionalEventTypes: Additional event types. Some events may have + // multiple types when multiple actions are part of a single event. For + // example, creating a document, renaming it, and sharing it may be part + // of a single file-creation event. + // + // Possible values: + // "comment" + // "create" + // "edit" + // "emptyTrash" + // "move" + // "permissionChange" + // "rename" + // "trash" + // "unknown" + // "untrash" + // "upload" + AdditionalEventTypes []string `json:"additionalEventTypes,omitempty"` + + // EventTimeMillis: The time at which the event occurred formatted as + // Unix time in milliseconds. + EventTimeMillis uint64 `json:"eventTimeMillis,omitempty,string"` + + // FromUserDeletion: Whether this event is caused by a user being + // deleted. + FromUserDeletion bool `json:"fromUserDeletion,omitempty"` + + // Move: Extra information for move type events, such as changes in an + // object's parents. + Move *Move `json:"move,omitempty"` + + // PermissionChanges: Extra information for permissionChange type + // events, such as the user or group the new permission applies to. + PermissionChanges []*PermissionChange `json:"permissionChanges,omitempty"` + + // PrimaryEventType: The main type of event that occurred. + // + // Possible values: + // "comment" + // "create" + // "edit" + // "emptyTrash" + // "move" + // "permissionChange" + // "rename" + // "trash" + // "unknown" + // "untrash" + // "upload" + PrimaryEventType string `json:"primaryEventType,omitempty"` + + // Rename: Extra information for rename type events, such as the old and + // new names. + Rename *Rename `json:"rename,omitempty"` + + // Target: Information specific to the Target object modified by the + // event. + Target *Target `json:"target,omitempty"` + + // User: Represents the user responsible for the event. + User *User `json:"user,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "AdditionalEventTypes") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Event) MarshalJSON() ([]byte, error) { + type noMethod Event + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListActivitiesResponse: The response from the list request. Contains +// a list of activities and a token to retrieve the next page of +// results. +type ListActivitiesResponse struct { + // Activities: List of activities. + Activities []*Activity `json:"activities,omitempty"` + + // NextPageToken: Token for the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Activities") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListActivitiesResponse) MarshalJSON() ([]byte, error) { + type noMethod ListActivitiesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Move: Contains information about changes in an object's parents as a +// result of a move type event. +type Move struct { + // AddedParents: The added parent(s). + AddedParents []*Parent `json:"addedParents,omitempty"` + + // RemovedParents: The removed parent(s). + RemovedParents []*Parent `json:"removedParents,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AddedParents") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Move) MarshalJSON() ([]byte, error) { + type noMethod Move + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Parent: Contains information about a parent object. For example, a +// folder in Drive is a parent for all files within it. +type Parent struct { + // Id: The parent's ID. + Id string `json:"id,omitempty"` + + // IsRoot: Whether this is the root folder. + IsRoot bool `json:"isRoot,omitempty"` + + // Title: The parent's title. + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Parent) MarshalJSON() ([]byte, error) { + type noMethod Parent + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Permission: Contains information about the permissions and type of +// access allowed with regards to a Google Drive object. This is a +// subset of the fields contained in a corresponding Drive Permissions +// object. +type Permission struct { + // Name: The name of the user or group the permission applies to. + Name string `json:"name,omitempty"` + + // PermissionId: The ID for this permission. Corresponds to the Drive + // API's permission ID returned as part of the Drive Permissions + // resource. + PermissionId string `json:"permissionId,omitempty"` + + // Role: Indicates the Google Drive permissions role. The role + // determines a user's ability to read, write, or comment on the file. + // + // Possible values: + // "commenter" + // "owner" + // "reader" + // "writer" + Role string `json:"role,omitempty"` + + // Type: Indicates how widely permissions are granted. + // + // Possible values: + // "anyone" + // "domain" + // "group" + // "user" + Type string `json:"type,omitempty"` + + // User: The user's information if the type is USER. + User *User `json:"user,omitempty"` + + // WithLink: Whether the permission requires a link to the file. + WithLink bool `json:"withLink,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Permission) MarshalJSON() ([]byte, error) { + type noMethod Permission + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PermissionChange: Contains information about a Drive object's +// permissions that changed as a result of a permissionChange type +// event. +type PermissionChange struct { + // AddedPermissions: Lists all Permission objects added. + AddedPermissions []*Permission `json:"addedPermissions,omitempty"` + + // RemovedPermissions: Lists all Permission objects removed. + RemovedPermissions []*Permission `json:"removedPermissions,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AddedPermissions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PermissionChange) MarshalJSON() ([]byte, error) { + type noMethod PermissionChange + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Photo: Photo information for a user. +type Photo struct { + // Url: The URL of the photo. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Url") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Photo) MarshalJSON() ([]byte, error) { + type noMethod Photo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Rename: Contains information about a renametype event. +type Rename struct { + // NewTitle: The new title. + NewTitle string `json:"newTitle,omitempty"` + + // OldTitle: The old title. + OldTitle string `json:"oldTitle,omitempty"` + + // ForceSendFields is a list of field names (e.g. "NewTitle") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Rename) MarshalJSON() ([]byte, error) { + type noMethod Rename + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Target: Information about the object modified by the event. +type Target struct { + // Id: The ID of the target. For example, in Google Drive, this is the + // file or folder ID. + Id string `json:"id,omitempty"` + + // MimeType: The MIME type of the target. + MimeType string `json:"mimeType,omitempty"` + + // Name: The name of the target. For example, in Google Drive, this is + // the title of the file. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Target) MarshalJSON() ([]byte, error) { + type noMethod Target + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// User: A representation of a user. +type User struct { + // Name: The displayable name of the user. + Name string `json:"name,omitempty"` + + // Photo: The profile photo of the user. + Photo *Photo `json:"photo,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *User) MarshalJSON() ([]byte, error) { + type noMethod User + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "appsactivity.activities.list": + +type ActivitiesListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Returns a list of activities visible to the current logged in +// user. Visible activities are determined by the visiblity settings of +// the object that was acted on, e.g. Drive files a user can see. An +// activity is a record of past events. Multiple events may be merged if +// they are similar. A request is scoped to activities from a given +// Google service using the source parameter. +func (r *ActivitiesService) List() *ActivitiesListCall { + c := &ActivitiesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// DriveAncestorId sets the optional parameter "drive.ancestorId": +// Identifies the Drive folder containing the items for which to return +// activities. +func (c *ActivitiesListCall) DriveAncestorId(driveAncestorId string) *ActivitiesListCall { + c.opt_["drive.ancestorId"] = driveAncestorId + return c +} + +// DriveFileId sets the optional parameter "drive.fileId": Identifies +// the Drive item to return activities for. +func (c *ActivitiesListCall) DriveFileId(driveFileId string) *ActivitiesListCall { + c.opt_["drive.fileId"] = driveFileId + return c +} + +// GroupingStrategy sets the optional parameter "groupingStrategy": +// Indicates the strategy to use when grouping singleEvents items in the +// associated combinedEvent object. +// +// Possible values: +// "driveUi" (default) +// "none" +func (c *ActivitiesListCall) GroupingStrategy(groupingStrategy string) *ActivitiesListCall { + c.opt_["groupingStrategy"] = groupingStrategy + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of events to return on a page. The response includes a continuation +// token if there are more events. +func (c *ActivitiesListCall) PageSize(pageSize int64) *ActivitiesListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": A token to +// retrieve a specific page of results. +func (c *ActivitiesListCall) PageToken(pageToken string) *ActivitiesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Source sets the optional parameter "source": The Google service from +// which to return activities. Possible values of source are: +// - drive.google.com +func (c *ActivitiesListCall) Source(source string) *ActivitiesListCall { + c.opt_["source"] = source + return c +} + +// UserId sets the optional parameter "userId": Indicates the user to +// return activity for. Use the special value me to indicate the +// currently authenticated user. +func (c *ActivitiesListCall) UserId(userId string) *ActivitiesListCall { + c.opt_["userId"] = userId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ActivitiesListCall) Fields(s ...googleapi.Field) *ActivitiesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ActivitiesListCall) IfNoneMatch(entityTag string) *ActivitiesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ActivitiesListCall) Context(ctx context.Context) *ActivitiesListCall { + c.ctx_ = ctx + return c +} + +func (c *ActivitiesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["drive.ancestorId"]; ok { + params.Set("drive.ancestorId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["drive.fileId"]; ok { + params.Set("drive.fileId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["groupingStrategy"]; ok { + params.Set("groupingStrategy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["userId"]; ok { + params.Set("userId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "activities") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "appsactivity.activities.list" call. +// Exactly one of *ListActivitiesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListActivitiesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ActivitiesListCall) Do() (*ListActivitiesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListActivitiesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a list of activities visible to the current logged in user. Visible activities are determined by the visiblity settings of the object that was acted on, e.g. Drive files a user can see. An activity is a record of past events. Multiple events may be merged if they are similar. A request is scoped to activities from a given Google service using the source parameter.", + // "httpMethod": "GET", + // "id": "appsactivity.activities.list", + // "parameters": { + // "drive.ancestorId": { + // "description": "Identifies the Drive folder containing the items for which to return activities.", + // "location": "query", + // "type": "string" + // }, + // "drive.fileId": { + // "description": "Identifies the Drive item to return activities for.", + // "location": "query", + // "type": "string" + // }, + // "groupingStrategy": { + // "default": "driveUi", + // "description": "Indicates the strategy to use when grouping singleEvents items in the associated combinedEvent object.", + // "enum": [ + // "driveUi", + // "none" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "default": "50", + // "description": "The maximum number of events to return on a page. The response includes a continuation token if there are more events.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A token to retrieve a specific page of results.", + // "location": "query", + // "type": "string" + // }, + // "source": { + // "description": "The Google service from which to return activities. Possible values of source are: \n- drive.google.com", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "default": "me", + // "description": "Indicates the user to return activity for. Use the special value me to indicate the currently authenticated user.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "activities", + // "response": { + // "$ref": "ListActivitiesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/activity", + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.metadata", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/appstate/v1/appstate-api.json b/Godeps/_workspace/src/google.golang.org/api/appstate/v1/appstate-api.json new file mode 100644 index 000000000..f46cac782 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/appstate/v1/appstate-api.json @@ -0,0 +1,307 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/fq2tcHmUUpw0BqgyQT2jiNE1XgU\"", + "discoveryVersion": "v1", + "id": "appstate:v1", + "name": "appstate", + "canonicalName": "App State", + "version": "v1", + "revision": "20150119", + "title": "Google App State API", + "description": "The Google App State API.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://developers.google.com/games/services/web/api/states", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/appstate/v1/", + "basePath": "/appstate/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "appstate/v1/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json" + ], + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.", + "location": "query" + }, + "userIp": { + "type": "string", + "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.", + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/appstate": { + "description": "View and manage your data for this application" + } + } + } + }, + "schemas": { + "GetResponse": { + "id": "GetResponse", + "type": "object", + "description": "This is a JSON template for an app state resource.", + "properties": { + "currentStateVersion": { + "type": "string", + "description": "The current app state version." + }, + "data": { + "type": "string", + "description": "The requested data." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string appstate#getResponse.", + "default": "appstate#getResponse" + }, + "stateKey": { + "type": "integer", + "description": "The key for the data.", + "format": "int32" + } + } + }, + "ListResponse": { + "id": "ListResponse", + "type": "object", + "description": "This is a JSON template to convert a list-response for app state.", + "properties": { + "items": { + "type": "array", + "description": "The app state data.", + "items": { + "$ref": "GetResponse" + } + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string appstate#listResponse.", + "default": "appstate#listResponse" + }, + "maximumKeyCount": { + "type": "integer", + "description": "The maximum number of keys allowed for this user.", + "format": "int32" + } + } + }, + "UpdateRequest": { + "id": "UpdateRequest", + "type": "object", + "description": "This is a JSON template for a requests which update app state", + "properties": { + "data": { + "type": "string", + "description": "The new app state data that your application is trying to update with." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string appstate#updateRequest.", + "default": "appstate#updateRequest" + } + } + }, + "WriteResult": { + "id": "WriteResult", + "type": "object", + "description": "This is a JSON template for an app state write result.", + "properties": { + "currentStateVersion": { + "type": "string", + "description": "The version of the data for this key on the server." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string appstate#writeResult.", + "default": "appstate#writeResult" + }, + "stateKey": { + "type": "integer", + "description": "The written key.", + "format": "int32" + } + } + } + }, + "resources": { + "states": { + "methods": { + "clear": { + "id": "appstate.states.clear", + "path": "states/{stateKey}/clear", + "httpMethod": "POST", + "description": "Clears (sets to empty) the data for the passed key if and only if the passed version matches the currently stored version. This method results in a conflict error on version mismatch.", + "parameters": { + "currentDataVersion": { + "type": "string", + "description": "The version of the data to be cleared. Version strings are returned by the server.", + "location": "query" + }, + "stateKey": { + "type": "integer", + "description": "The key for the data to be retrieved.", + "required": true, + "format": "int32", + "minimum": "0", + "maximum": "3", + "location": "path" + } + }, + "parameterOrder": [ + "stateKey" + ], + "response": { + "$ref": "WriteResult" + }, + "scopes": [ + "https://www.googleapis.com/auth/appstate" + ] + }, + "delete": { + "id": "appstate.states.delete", + "path": "states/{stateKey}", + "httpMethod": "DELETE", + "description": "Deletes a key and the data associated with it. The key is removed and no longer counts against the key quota. Note that since this method is not safe in the face of concurrent modifications, it should only be used for development and testing purposes. Invoking this method in shipping code can result in data loss and data corruption.", + "parameters": { + "stateKey": { + "type": "integer", + "description": "The key for the data to be retrieved.", + "required": true, + "format": "int32", + "minimum": "0", + "maximum": "3", + "location": "path" + } + }, + "parameterOrder": [ + "stateKey" + ], + "scopes": [ + "https://www.googleapis.com/auth/appstate" + ] + }, + "get": { + "id": "appstate.states.get", + "path": "states/{stateKey}", + "httpMethod": "GET", + "description": "Retrieves the data corresponding to the passed key. If the key does not exist on the server, an HTTP 404 will be returned.", + "parameters": { + "stateKey": { + "type": "integer", + "description": "The key for the data to be retrieved.", + "required": true, + "format": "int32", + "minimum": "0", + "maximum": "3", + "location": "path" + } + }, + "parameterOrder": [ + "stateKey" + ], + "response": { + "$ref": "GetResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/appstate" + ] + }, + "list": { + "id": "appstate.states.list", + "path": "states", + "httpMethod": "GET", + "description": "Lists all the states keys, and optionally the state data.", + "parameters": { + "includeData": { + "type": "boolean", + "description": "Whether to include the full data in addition to the version number", + "default": "false", + "location": "query" + } + }, + "response": { + "$ref": "ListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/appstate" + ] + }, + "update": { + "id": "appstate.states.update", + "path": "states/{stateKey}", + "httpMethod": "PUT", + "description": "Update the data associated with the input key if and only if the passed version matches the currently stored version. This method is safe in the face of concurrent writes. Maximum per-key size is 128KB.", + "parameters": { + "currentStateVersion": { + "type": "string", + "description": "The version of the app state your application is attempting to update. If this does not match the current version, this method will return a conflict error. If there is no data stored on the server for this key, the update will succeed irrespective of the value of this parameter.", + "location": "query" + }, + "stateKey": { + "type": "integer", + "description": "The key for the data to be retrieved.", + "required": true, + "format": "int32", + "minimum": "0", + "maximum": "3", + "location": "path" + } + }, + "parameterOrder": [ + "stateKey" + ], + "request": { + "$ref": "UpdateRequest" + }, + "response": { + "$ref": "WriteResult" + }, + "scopes": [ + "https://www.googleapis.com/auth/appstate" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/appstate/v1/appstate-gen.go b/Godeps/_workspace/src/google.golang.org/api/appstate/v1/appstate-gen.go new file mode 100644 index 000000000..d65077a48 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/appstate/v1/appstate-gen.go @@ -0,0 +1,845 @@ +// Package appstate provides access to the Google App State API. +// +// See https://developers.google.com/games/services/web/api/states +// +// Usage example: +// +// import "google.golang.org/api/appstate/v1" +// ... +// appstateService, err := appstate.New(oauthHttpClient) +package appstate // import "google.golang.org/api/appstate/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "appstate:v1" +const apiName = "appstate" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/appstate/v1/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your data for this application + AppstateScope = "https://www.googleapis.com/auth/appstate" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.States = NewStatesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + States *StatesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewStatesService(s *Service) *StatesService { + rs := &StatesService{s: s} + return rs +} + +type StatesService struct { + s *Service +} + +// GetResponse: This is a JSON template for an app state resource. +type GetResponse struct { + // CurrentStateVersion: The current app state version. + CurrentStateVersion string `json:"currentStateVersion,omitempty"` + + // Data: The requested data. + Data string `json:"data,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string appstate#getResponse. + Kind string `json:"kind,omitempty"` + + // StateKey: The key for the data. + StateKey int64 `json:"stateKey,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CurrentStateVersion") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GetResponse) MarshalJSON() ([]byte, error) { + type noMethod GetResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListResponse: This is a JSON template to convert a list-response for +// app state. +type ListResponse struct { + // Items: The app state data. + Items []*GetResponse `json:"items,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string appstate#listResponse. + Kind string `json:"kind,omitempty"` + + // MaximumKeyCount: The maximum number of keys allowed for this user. + MaximumKeyCount int64 `json:"maximumKeyCount,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListResponse) MarshalJSON() ([]byte, error) { + type noMethod ListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UpdateRequest: This is a JSON template for a requests which update +// app state +type UpdateRequest struct { + // Data: The new app state data that your application is trying to + // update with. + Data string `json:"data,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string appstate#updateRequest. + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Data") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UpdateRequest) MarshalJSON() ([]byte, error) { + type noMethod UpdateRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// WriteResult: This is a JSON template for an app state write result. +type WriteResult struct { + // CurrentStateVersion: The version of the data for this key on the + // server. + CurrentStateVersion string `json:"currentStateVersion,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string appstate#writeResult. + Kind string `json:"kind,omitempty"` + + // StateKey: The written key. + StateKey int64 `json:"stateKey,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CurrentStateVersion") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *WriteResult) MarshalJSON() ([]byte, error) { + type noMethod WriteResult + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "appstate.states.clear": + +type StatesClearCall struct { + s *Service + stateKey int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Clear: Clears (sets to empty) the data for the passed key if and only +// if the passed version matches the currently stored version. This +// method results in a conflict error on version mismatch. +func (r *StatesService) Clear(stateKey int64) *StatesClearCall { + c := &StatesClearCall{s: r.s, opt_: make(map[string]interface{})} + c.stateKey = stateKey + return c +} + +// CurrentDataVersion sets the optional parameter "currentDataVersion": +// The version of the data to be cleared. Version strings are returned +// by the server. +func (c *StatesClearCall) CurrentDataVersion(currentDataVersion string) *StatesClearCall { + c.opt_["currentDataVersion"] = currentDataVersion + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *StatesClearCall) Fields(s ...googleapi.Field) *StatesClearCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *StatesClearCall) Context(ctx context.Context) *StatesClearCall { + c.ctx_ = ctx + return c +} + +func (c *StatesClearCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["currentDataVersion"]; ok { + params.Set("currentDataVersion", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "states/{stateKey}/clear") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "stateKey": strconv.FormatInt(c.stateKey, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "appstate.states.clear" call. +// Exactly one of *WriteResult or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *WriteResult.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *StatesClearCall) Do() (*WriteResult, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &WriteResult{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Clears (sets to empty) the data for the passed key if and only if the passed version matches the currently stored version. This method results in a conflict error on version mismatch.", + // "httpMethod": "POST", + // "id": "appstate.states.clear", + // "parameterOrder": [ + // "stateKey" + // ], + // "parameters": { + // "currentDataVersion": { + // "description": "The version of the data to be cleared. Version strings are returned by the server.", + // "location": "query", + // "type": "string" + // }, + // "stateKey": { + // "description": "The key for the data to be retrieved.", + // "format": "int32", + // "location": "path", + // "maximum": "3", + // "minimum": "0", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "states/{stateKey}/clear", + // "response": { + // "$ref": "WriteResult" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/appstate" + // ] + // } + +} + +// method id "appstate.states.delete": + +type StatesDeleteCall struct { + s *Service + stateKey int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a key and the data associated with it. The key is +// removed and no longer counts against the key quota. Note that since +// this method is not safe in the face of concurrent modifications, it +// should only be used for development and testing purposes. Invoking +// this method in shipping code can result in data loss and data +// corruption. +func (r *StatesService) Delete(stateKey int64) *StatesDeleteCall { + c := &StatesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.stateKey = stateKey + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *StatesDeleteCall) Fields(s ...googleapi.Field) *StatesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *StatesDeleteCall) Context(ctx context.Context) *StatesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *StatesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "states/{stateKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "stateKey": strconv.FormatInt(c.stateKey, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "appstate.states.delete" call. +func (c *StatesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a key and the data associated with it. The key is removed and no longer counts against the key quota. Note that since this method is not safe in the face of concurrent modifications, it should only be used for development and testing purposes. Invoking this method in shipping code can result in data loss and data corruption.", + // "httpMethod": "DELETE", + // "id": "appstate.states.delete", + // "parameterOrder": [ + // "stateKey" + // ], + // "parameters": { + // "stateKey": { + // "description": "The key for the data to be retrieved.", + // "format": "int32", + // "location": "path", + // "maximum": "3", + // "minimum": "0", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "states/{stateKey}", + // "scopes": [ + // "https://www.googleapis.com/auth/appstate" + // ] + // } + +} + +// method id "appstate.states.get": + +type StatesGetCall struct { + s *Service + stateKey int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves the data corresponding to the passed key. If the key +// does not exist on the server, an HTTP 404 will be returned. +func (r *StatesService) Get(stateKey int64) *StatesGetCall { + c := &StatesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.stateKey = stateKey + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *StatesGetCall) Fields(s ...googleapi.Field) *StatesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *StatesGetCall) IfNoneMatch(entityTag string) *StatesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *StatesGetCall) Context(ctx context.Context) *StatesGetCall { + c.ctx_ = ctx + return c +} + +func (c *StatesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "states/{stateKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "stateKey": strconv.FormatInt(c.stateKey, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "appstate.states.get" call. +// Exactly one of *GetResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *GetResponse.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *StatesGetCall) Do() (*GetResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &GetResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the data corresponding to the passed key. If the key does not exist on the server, an HTTP 404 will be returned.", + // "httpMethod": "GET", + // "id": "appstate.states.get", + // "parameterOrder": [ + // "stateKey" + // ], + // "parameters": { + // "stateKey": { + // "description": "The key for the data to be retrieved.", + // "format": "int32", + // "location": "path", + // "maximum": "3", + // "minimum": "0", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "states/{stateKey}", + // "response": { + // "$ref": "GetResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/appstate" + // ] + // } + +} + +// method id "appstate.states.list": + +type StatesListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all the states keys, and optionally the state data. +func (r *StatesService) List() *StatesListCall { + c := &StatesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// IncludeData sets the optional parameter "includeData": Whether to +// include the full data in addition to the version number +func (c *StatesListCall) IncludeData(includeData bool) *StatesListCall { + c.opt_["includeData"] = includeData + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *StatesListCall) Fields(s ...googleapi.Field) *StatesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *StatesListCall) IfNoneMatch(entityTag string) *StatesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *StatesListCall) Context(ctx context.Context) *StatesListCall { + c.ctx_ = ctx + return c +} + +func (c *StatesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["includeData"]; ok { + params.Set("includeData", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "states") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "appstate.states.list" call. +// Exactly one of *ListResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ListResponse.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *StatesListCall) Do() (*ListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all the states keys, and optionally the state data.", + // "httpMethod": "GET", + // "id": "appstate.states.list", + // "parameters": { + // "includeData": { + // "default": "false", + // "description": "Whether to include the full data in addition to the version number", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "states", + // "response": { + // "$ref": "ListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/appstate" + // ] + // } + +} + +// method id "appstate.states.update": + +type StatesUpdateCall struct { + s *Service + stateKey int64 + updaterequest *UpdateRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Update the data associated with the input key if and only if +// the passed version matches the currently stored version. This method +// is safe in the face of concurrent writes. Maximum per-key size is +// 128KB. +func (r *StatesService) Update(stateKey int64, updaterequest *UpdateRequest) *StatesUpdateCall { + c := &StatesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.stateKey = stateKey + c.updaterequest = updaterequest + return c +} + +// CurrentStateVersion sets the optional parameter +// "currentStateVersion": The version of the app state your application +// is attempting to update. If this does not match the current version, +// this method will return a conflict error. If there is no data stored +// on the server for this key, the update will succeed irrespective of +// the value of this parameter. +func (c *StatesUpdateCall) CurrentStateVersion(currentStateVersion string) *StatesUpdateCall { + c.opt_["currentStateVersion"] = currentStateVersion + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *StatesUpdateCall) Fields(s ...googleapi.Field) *StatesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *StatesUpdateCall) Context(ctx context.Context) *StatesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *StatesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.updaterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["currentStateVersion"]; ok { + params.Set("currentStateVersion", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "states/{stateKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "stateKey": strconv.FormatInt(c.stateKey, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "appstate.states.update" call. +// Exactly one of *WriteResult or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *WriteResult.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *StatesUpdateCall) Do() (*WriteResult, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &WriteResult{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update the data associated with the input key if and only if the passed version matches the currently stored version. This method is safe in the face of concurrent writes. Maximum per-key size is 128KB.", + // "httpMethod": "PUT", + // "id": "appstate.states.update", + // "parameterOrder": [ + // "stateKey" + // ], + // "parameters": { + // "currentStateVersion": { + // "description": "The version of the app state your application is attempting to update. If this does not match the current version, this method will return a conflict error. If there is no data stored on the server for this key, the update will succeed irrespective of the value of this parameter.", + // "location": "query", + // "type": "string" + // }, + // "stateKey": { + // "description": "The key for the data to be retrieved.", + // "format": "int32", + // "location": "path", + // "maximum": "3", + // "minimum": "0", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "states/{stateKey}", + // "request": { + // "$ref": "UpdateRequest" + // }, + // "response": { + // "$ref": "WriteResult" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/appstate" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/autoscaler/v1beta2/autoscaler-api.json b/Godeps/_workspace/src/google.golang.org/api/autoscaler/v1beta2/autoscaler-api.json new file mode 100644 index 000000000..421797b23 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/autoscaler/v1beta2/autoscaler-api.json @@ -0,0 +1,891 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/UcR-fBYlWEXj2JrwS8u3wjdNZ58\"", + "discoveryVersion": "v1", + "id": "autoscaler:v1beta2", + "name": "autoscaler", + "version": "v1beta2", + "revision": "20150213", + "title": "Google Compute Engine Autoscaler API", + "description": "The Google Compute Engine Autoscaler API provides autoscaling for groups of Cloud VMs.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "http://developers.google.com/compute/docs/autoscaler", + "labels": [ + "limited_availability" + ], + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/autoscaler/v1beta2/", + "basePath": "/autoscaler/v1beta2/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "autoscaler/v1beta2/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json" + ], + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.", + "location": "query" + }, + "userIp": { + "type": "string", + "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.", + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/compute": { + "description": "View and manage your Google Compute Engine resources" + }, + "https://www.googleapis.com/auth/compute.readonly": { + "description": "View your Google Compute Engine resources" + } + } + } + }, + "schemas": { + "Autoscaler": { + "id": "Autoscaler", + "type": "object", + "description": "Cloud Autoscaler resource.", + "properties": { + "autoscalingPolicy": { + "$ref": "AutoscalingPolicy", + "description": "Configuration parameters for autoscaling algorithm." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource provided by the client." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#autoscaler" + }, + "name": { + "type": "string", + "description": "Name of the Autoscaler resource. Must be unique per project and zone." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] A self-link to the Autoscaler configuration resource." + }, + "target": { + "type": "string", + "description": "URL to the entity which will be autoscaled. Currently the only supported value is ReplicaPool?s URL. Note: it is illegal to specify multiple Autoscalers for the same target." + } + } + }, + "AutoscalerListResponse": { + "id": "AutoscalerListResponse", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "Autoscaler resources.", + "items": { + "$ref": "Autoscaler" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#autoscalerList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output only] A token used to continue a truncated list request." + } + } + }, + "AutoscalingPolicy": { + "id": "AutoscalingPolicy", + "type": "object", + "description": "Cloud Autoscaler policy.", + "properties": { + "coolDownPeriodSec": { + "type": "integer", + "description": "The number of seconds that the Autoscaler should wait between two succeeding changes to the number of virtual machines. You should define an interval that is at least as long as the initialization time of a virtual machine and the time it may take for replica pool to create the virtual machine. The default is 60 seconds.", + "format": "int32" + }, + "cpuUtilization": { + "$ref": "AutoscalingPolicyCpuUtilization", + "description": "Exactly one utilization policy should be provided. Configuration parameters of CPU based autoscaling policy." + }, + "customMetricUtilizations": { + "type": "array", + "description": "Configuration parameters of autoscaling based on custom metric.", + "items": { + "$ref": "AutoscalingPolicyCustomMetricUtilization" + } + }, + "loadBalancingUtilization": { + "$ref": "AutoscalingPolicyLoadBalancingUtilization", + "description": "Configuration parameters of autoscaling based on load balancer." + }, + "maxNumReplicas": { + "type": "integer", + "description": "The maximum number of replicas that the Autoscaler can scale up to.", + "format": "int32" + }, + "minNumReplicas": { + "type": "integer", + "description": "The minimum number of replicas that the Autoscaler can scale down to.", + "format": "int32" + } + } + }, + "AutoscalingPolicyCpuUtilization": { + "id": "AutoscalingPolicyCpuUtilization", + "type": "object", + "description": "CPU utilization policy.", + "properties": { + "utilizationTarget": { + "type": "number", + "description": "The target utilization that the Autoscaler should maintain. It is represented as a fraction of used cores. For example: 6 cores used in 8-core VM are represented here as 0.75. Must be a float value between (0, 1]. If not defined, the default is 0.8.", + "format": "double" + } + } + }, + "AutoscalingPolicyCustomMetricUtilization": { + "id": "AutoscalingPolicyCustomMetricUtilization", + "type": "object", + "description": "Custom utilization metric policy.", + "properties": { + "metric": { + "type": "string", + "description": "Identifier of the metric. It should be a Cloud Monitoring metric. The metric can not have negative values. The metric should be an utilization metric (increasing number of VMs handling requests x times should reduce average value of the metric roughly x times). For example you could use: compute.googleapis.com/instance/network/received_bytes_count." + }, + "utilizationTarget": { + "type": "number", + "description": "Target value of the metric which Autoscaler should maintain. Must be a positive value.", + "format": "double" + }, + "utilizationTargetType": { + "type": "string", + "description": "Defines type in which utilization_target is expressed." + } + } + }, + "AutoscalingPolicyLoadBalancingUtilization": { + "id": "AutoscalingPolicyLoadBalancingUtilization", + "type": "object", + "description": "Load balancing utilization policy.", + "properties": { + "utilizationTarget": { + "type": "number", + "description": "Fraction of backend capacity utilization (set in HTTP load balancing configuration) that Autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8. For example if your maxRatePerInstance capacity (in HTTP Load Balancing configuration) is set at 10 and you would like to keep number of instances such that each instance receives 7 QPS on average, set this to 0.7.", + "format": "double" + } + } + }, + "DeprecationStatus": { + "id": "DeprecationStatus", + "type": "object", + "properties": { + "deleted": { + "type": "string" + }, + "deprecated": { + "type": "string" + }, + "obsolete": { + "type": "string" + }, + "replacement": { + "type": "string" + }, + "state": { + "type": "string" + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "properties": { + "clientOperationId": { + "type": "string" + }, + "creationTimestamp": { + "type": "string" + }, + "endTime": { + "type": "string" + }, + "error": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "location": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + } + }, + "httpErrorMessage": { + "type": "string" + }, + "httpErrorStatusCode": { + "type": "integer", + "format": "int32" + }, + "id": { + "type": "string", + "format": "uint64" + }, + "insertTime": { + "type": "string" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#Operation for Operation resources.", + "default": "autoscaler#operation" + }, + "name": { + "type": "string" + }, + "operationType": { + "type": "string" + }, + "progress": { + "type": "integer", + "format": "int32" + }, + "region": { + "type": "string" + }, + "selfLink": { + "type": "string" + }, + "startTime": { + "type": "string" + }, + "status": { + "type": "string" + }, + "statusMessage": { + "type": "string" + }, + "targetId": { + "type": "string", + "format": "uint64" + }, + "targetLink": { + "type": "string" + }, + "user": { + "type": "string" + }, + "warnings": { + "type": "array", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, + "message": { + "type": "string" + } + } + } + }, + "zone": { + "type": "string" + } + } + }, + "OperationList": { + "id": "OperationList", + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "items": { + "type": "array", + "items": { + "$ref": "Operation" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#operations for Operations resource.", + "default": "autoscaler#operationList" + }, + "nextPageToken": { + "type": "string" + }, + "selfLink": { + "type": "string" + } + } + }, + "Zone": { + "id": "Zone", + "type": "object", + "properties": { + "creationTimestamp": { + "type": "string" + }, + "deprecated": { + "$ref": "DeprecationStatus" + }, + "description": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always kind#zone for zones.", + "default": "autoscaler#zone" + }, + "maintenanceWindows": { + "type": "array", + "items": { + "type": "object", + "properties": { + "beginTime": { + "type": "string" + }, + "description": { + "type": "string" + }, + "endTime": { + "type": "string" + }, + "name": { + "type": "string" + } + } + } + }, + "name": { + "type": "string" + }, + "region": { + "type": "string" + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for the resource." + }, + "status": { + "type": "string" + } + } + }, + "ZoneList": { + "id": "ZoneList", + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "items": { + "type": "array", + "items": { + "$ref": "Zone" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "autoscaler#zoneList" + }, + "nextPageToken": { + "type": "string" + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + } + }, + "resources": { + "autoscalers": { + "methods": { + "delete": { + "id": "autoscaler.autoscalers.delete", + "path": "projects/{project}/zones/{zone}/autoscalers/{autoscaler}", + "httpMethod": "DELETE", + "description": "Deletes the specified Autoscaler resource.", + "parameters": { + "autoscaler": { + "type": "string", + "description": "Name of the Autoscaler resource.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of Autoscaler resource.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "Zone name of Autoscaler resource.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "autoscaler" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "autoscaler.autoscalers.get", + "path": "projects/{project}/zones/{zone}/autoscalers/{autoscaler}", + "httpMethod": "GET", + "description": "Gets the specified Autoscaler resource.", + "parameters": { + "autoscaler": { + "type": "string", + "description": "Name of the Autoscaler resource.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of Autoscaler resource.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "Zone name of Autoscaler resource.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "autoscaler" + ], + "response": { + "$ref": "Autoscaler" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "autoscaler.autoscalers.insert", + "path": "projects/{project}/zones/{zone}/autoscalers", + "httpMethod": "POST", + "description": "Adds new Autoscaler resource.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID of Autoscaler resource.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "Zone name of Autoscaler resource.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "request": { + "$ref": "Autoscaler" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "autoscaler.autoscalers.list", + "path": "projects/{project}/zones/{zone}/autoscalers", + "httpMethod": "GET", + "description": "Lists all Autoscaler resources in this zone.", + "parameters": { + "filter": { + "type": "string", + "location": "query" + }, + "maxResults": { + "type": "integer", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID of Autoscaler resource.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "Zone name of Autoscaler resource.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "AutoscalerListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "patch": { + "id": "autoscaler.autoscalers.patch", + "path": "projects/{project}/zones/{zone}/autoscalers/{autoscaler}", + "httpMethod": "PATCH", + "description": "Update the entire content of the Autoscaler resource. This method supports patch semantics.", + "parameters": { + "autoscaler": { + "type": "string", + "description": "Name of the Autoscaler resource.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of Autoscaler resource.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "Zone name of Autoscaler resource.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "autoscaler" + ], + "request": { + "$ref": "Autoscaler" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "update": { + "id": "autoscaler.autoscalers.update", + "path": "projects/{project}/zones/{zone}/autoscalers/{autoscaler}", + "httpMethod": "PUT", + "description": "Update the entire content of the Autoscaler resource.", + "parameters": { + "autoscaler": { + "type": "string", + "description": "Name of the Autoscaler resource.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of Autoscaler resource.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "Zone name of Autoscaler resource.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "autoscaler" + ], + "request": { + "$ref": "Autoscaler" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "zoneOperations": { + "methods": { + "delete": { + "id": "autoscaler.zoneOperations.delete", + "path": "{project}/zones/{zone}/operations/{operation}", + "httpMethod": "DELETE", + "description": "Deletes the specified zone-specific operation resource.", + "parameters": { + "operation": { + "type": "string", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "operation" + ], + "scopes": [ + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "autoscaler.zoneOperations.get", + "path": "{project}/zones/{zone}/operations/{operation}", + "httpMethod": "GET", + "description": "Retrieves the specified zone-specific operation resource.", + "parameters": { + "operation": { + "type": "string", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "operation" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "id": "autoscaler.zoneOperations.list", + "path": "{project}/zones/{zone}/operations", + "httpMethod": "GET", + "description": "Retrieves the list of operation resources contained within the specified zone.", + "parameters": { + "filter": { + "type": "string", + "location": "query" + }, + "maxResults": { + "type": "integer", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "location": "query" + }, + "project": { + "type": "string", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "OperationList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "zones": { + "methods": { + "list": { + "id": "autoscaler.zones.list", + "path": "{project}/zones", + "httpMethod": "GET", + "description": "", + "parameters": { + "filter": { + "type": "string", + "location": "query" + }, + "maxResults": { + "type": "integer", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "location": "query" + }, + "project": { + "type": "string", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "ZoneList" + }, + "scopes": [ + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/autoscaler/v1beta2/autoscaler-gen.go b/Godeps/_workspace/src/google.golang.org/api/autoscaler/v1beta2/autoscaler-gen.go new file mode 100644 index 000000000..71439abe1 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/autoscaler/v1beta2/autoscaler-gen.go @@ -0,0 +1,2111 @@ +// Package autoscaler provides access to the Google Compute Engine Autoscaler API. +// +// See http://developers.google.com/compute/docs/autoscaler +// +// Usage example: +// +// import "google.golang.org/api/autoscaler/v1beta2" +// ... +// autoscalerService, err := autoscaler.New(oauthHttpClient) +package autoscaler // import "google.golang.org/api/autoscaler/v1beta2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "autoscaler:v1beta2" +const apiName = "autoscaler" +const apiVersion = "v1beta2" +const basePath = "https://www.googleapis.com/autoscaler/v1beta2/" + +// 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" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Autoscalers = NewAutoscalersService(s) + s.ZoneOperations = NewZoneOperationsService(s) + s.Zones = NewZonesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Autoscalers *AutoscalersService + + ZoneOperations *ZoneOperationsService + + Zones *ZonesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAutoscalersService(s *Service) *AutoscalersService { + rs := &AutoscalersService{s: s} + return rs +} + +type AutoscalersService 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 +} + +// Autoscaler: Cloud Autoscaler resource. +type Autoscaler struct { + // AutoscalingPolicy: Configuration parameters for autoscaling + // algorithm. + AutoscalingPolicy *AutoscalingPolicy `json:"autoscalingPolicy,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource provided + // by the client. + Description string `json:"description,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the Autoscaler resource. Must be unique per project and + // zone. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] A self-link to the Autoscaler configuration + // resource. + SelfLink string `json:"selfLink,omitempty"` + + // Target: URL to the entity which will be autoscaled. Currently the + // only supported value is ReplicaPool?s URL. Note: it is illegal to + // specify multiple Autoscalers for the same target. + Target string `json:"target,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AutoscalingPolicy") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Autoscaler) MarshalJSON() ([]byte, error) { + type noMethod Autoscaler + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AutoscalerListResponse struct { + // Items: Autoscaler resources. + Items []*Autoscaler `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalerListResponse) MarshalJSON() ([]byte, error) { + type noMethod AutoscalerListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AutoscalingPolicy: Cloud Autoscaler policy. +type AutoscalingPolicy struct { + // CoolDownPeriodSec: The number of seconds that the Autoscaler should + // wait between two succeeding changes to the number of virtual + // machines. You should define an interval that is at least as long as + // the initialization time of a virtual machine and the time it may take + // for replica pool to create the virtual machine. The default is 60 + // seconds. + CoolDownPeriodSec int64 `json:"coolDownPeriodSec,omitempty"` + + // CpuUtilization: Exactly one utilization policy should be provided. + // Configuration parameters of CPU based autoscaling policy. + CpuUtilization *AutoscalingPolicyCpuUtilization `json:"cpuUtilization,omitempty"` + + // CustomMetricUtilizations: Configuration parameters of autoscaling + // based on custom metric. + CustomMetricUtilizations []*AutoscalingPolicyCustomMetricUtilization `json:"customMetricUtilizations,omitempty"` + + // LoadBalancingUtilization: Configuration parameters of autoscaling + // based on load balancer. + LoadBalancingUtilization *AutoscalingPolicyLoadBalancingUtilization `json:"loadBalancingUtilization,omitempty"` + + // MaxNumReplicas: The maximum number of replicas that the Autoscaler + // can scale up to. + MaxNumReplicas int64 `json:"maxNumReplicas,omitempty"` + + // MinNumReplicas: The minimum number of replicas that the Autoscaler + // can scale down to. + MinNumReplicas int64 `json:"minNumReplicas,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CoolDownPeriodSec") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalingPolicy) MarshalJSON() ([]byte, error) { + type noMethod AutoscalingPolicy + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AutoscalingPolicyCpuUtilization: CPU utilization policy. +type AutoscalingPolicyCpuUtilization struct { + // UtilizationTarget: The target utilization that the Autoscaler should + // maintain. It is represented as a fraction of used cores. For example: + // 6 cores used in 8-core VM are represented here as 0.75. Must be a + // float value between (0, 1]. If not defined, the default is 0.8. + UtilizationTarget float64 `json:"utilizationTarget,omitempty"` + + // ForceSendFields is a list of field names (e.g. "UtilizationTarget") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalingPolicyCpuUtilization) MarshalJSON() ([]byte, error) { + type noMethod AutoscalingPolicyCpuUtilization + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AutoscalingPolicyCustomMetricUtilization: Custom utilization metric +// policy. +type AutoscalingPolicyCustomMetricUtilization struct { + // Metric: Identifier of the metric. It should be a Cloud Monitoring + // metric. The metric can not have negative values. The metric should be + // an utilization metric (increasing number of VMs handling requests x + // times should reduce average value of the metric roughly x times). For + // example you could use: + // compute.googleapis.com/instance/network/received_bytes_count. + Metric string `json:"metric,omitempty"` + + // UtilizationTarget: Target value of the metric which Autoscaler should + // maintain. Must be a positive value. + UtilizationTarget float64 `json:"utilizationTarget,omitempty"` + + // UtilizationTargetType: Defines type in which utilization_target is + // expressed. + UtilizationTargetType string `json:"utilizationTargetType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Metric") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalingPolicyCustomMetricUtilization) MarshalJSON() ([]byte, error) { + type noMethod AutoscalingPolicyCustomMetricUtilization + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AutoscalingPolicyLoadBalancingUtilization: Load balancing utilization +// policy. +type AutoscalingPolicyLoadBalancingUtilization struct { + // UtilizationTarget: Fraction of backend capacity utilization (set in + // HTTP load balancing configuration) that Autoscaler should maintain. + // Must be a positive float value. If not defined, the default is 0.8. + // For example if your maxRatePerInstance capacity (in HTTP Load + // Balancing configuration) is set at 10 and you would like to keep + // number of instances such that each instance receives 7 QPS on + // average, set this to 0.7. + UtilizationTarget float64 `json:"utilizationTarget,omitempty"` + + // ForceSendFields is a list of field names (e.g. "UtilizationTarget") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalingPolicyLoadBalancingUtilization) MarshalJSON() ([]byte, error) { + type noMethod AutoscalingPolicyLoadBalancingUtilization + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DeprecationStatus struct { + Deleted string `json:"deleted,omitempty"` + + Deprecated string `json:"deprecated,omitempty"` + + Obsolete string `json:"obsolete,omitempty"` + + Replacement string `json:"replacement,omitempty"` + + State string `json:"state,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Deleted") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeprecationStatus) MarshalJSON() ([]byte, error) { + type noMethod DeprecationStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Operation struct { + ClientOperationId string `json:"clientOperationId,omitempty"` + + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + EndTime string `json:"endTime,omitempty"` + + Error *OperationError `json:"error,omitempty"` + + HttpErrorMessage string `json:"httpErrorMessage,omitempty"` + + HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"` + + Id uint64 `json:"id,omitempty,string"` + + InsertTime string `json:"insertTime,omitempty"` + + // Kind: [Output Only] Type of the resource. Always compute#Operation + // for Operation resources. + Kind string `json:"kind,omitempty"` + + Name string `json:"name,omitempty"` + + OperationType string `json:"operationType,omitempty"` + + Progress int64 `json:"progress,omitempty"` + + Region string `json:"region,omitempty"` + + SelfLink string `json:"selfLink,omitempty"` + + StartTime string `json:"startTime,omitempty"` + + Status string `json:"status,omitempty"` + + StatusMessage string `json:"statusMessage,omitempty"` + + TargetId uint64 `json:"targetId,omitempty,string"` + + TargetLink string `json:"targetLink,omitempty"` + + User string `json:"user,omitempty"` + + Warnings []*OperationWarnings `json:"warnings,omitempty"` + + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ClientOperationId") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Operation) MarshalJSON() ([]byte, error) { + type noMethod Operation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationError struct { + Errors []*OperationErrorErrors `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationError) MarshalJSON() ([]byte, error) { + type noMethod OperationError + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationErrorErrors struct { + Code string `json:"code,omitempty"` + + Location string `json:"location,omitempty"` + + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) { + type noMethod OperationErrorErrors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationWarnings struct { + Code string `json:"code,omitempty"` + + Data []*OperationWarningsData `json:"data,omitempty"` + + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationWarnings) MarshalJSON() ([]byte, error) { + type noMethod OperationWarnings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationWarningsData struct { + Key string `json:"key,omitempty"` + + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationWarningsData) MarshalJSON() ([]byte, error) { + type noMethod OperationWarningsData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationList struct { + Id string `json:"id,omitempty"` + + Items []*Operation `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#operations for + // Operations resource. + Kind string `json:"kind,omitempty"` + + NextPageToken string `json:"nextPageToken,omitempty"` + + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationList) MarshalJSON() ([]byte, error) { + type noMethod OperationList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Zone struct { + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + Description string `json:"description,omitempty"` + + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always kind#zone for zones. + Kind string `json:"kind,omitempty"` + + MaintenanceWindows []*ZoneMaintenanceWindows `json:"maintenanceWindows,omitempty"` + + Name string `json:"name,omitempty"` + + Region string `json:"region,omitempty"` + + // SelfLink: [Output Only] Server defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + Status string `json:"status,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Zone) MarshalJSON() ([]byte, error) { + type noMethod Zone + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ZoneMaintenanceWindows struct { + BeginTime string `json:"beginTime,omitempty"` + + Description string `json:"description,omitempty"` + + EndTime string `json:"endTime,omitempty"` + + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BeginTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ZoneMaintenanceWindows) MarshalJSON() ([]byte, error) { + type noMethod ZoneMaintenanceWindows + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ZoneList struct { + Id string `json:"id,omitempty"` + + Items []*Zone `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ZoneList) MarshalJSON() ([]byte, error) { + type noMethod ZoneList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "autoscaler.autoscalers.delete": + +type AutoscalersDeleteCall struct { + s *Service + project string + zone string + autoscaler string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified Autoscaler resource. +func (r *AutoscalersService) Delete(project string, zone string, autoscaler string) *AutoscalersDeleteCall { + c := &AutoscalersDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.autoscaler = autoscaler + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AutoscalersDeleteCall) Fields(s ...googleapi.Field) *AutoscalersDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AutoscalersDeleteCall) Context(ctx context.Context) *AutoscalersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/autoscalers/{autoscaler}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "autoscaler": c.autoscaler, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "autoscaler.autoscalers.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AutoscalersDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified Autoscaler resource.", + // "httpMethod": "DELETE", + // "id": "autoscaler.autoscalers.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "autoscaler" + // ], + // "parameters": { + // "autoscaler": { + // "description": "Name of the Autoscaler resource.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of Autoscaler resource.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Zone name of Autoscaler resource.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/zones/{zone}/autoscalers/{autoscaler}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "autoscaler.autoscalers.get": + +type AutoscalersGetCall struct { + s *Service + project string + zone string + autoscaler string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the specified Autoscaler resource. +func (r *AutoscalersService) Get(project string, zone string, autoscaler string) *AutoscalersGetCall { + c := &AutoscalersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.autoscaler = autoscaler + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AutoscalersGetCall) Fields(s ...googleapi.Field) *AutoscalersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AutoscalersGetCall) IfNoneMatch(entityTag string) *AutoscalersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AutoscalersGetCall) Context(ctx context.Context) *AutoscalersGetCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/autoscalers/{autoscaler}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "autoscaler": c.autoscaler, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "autoscaler.autoscalers.get" call. +// Exactly one of *Autoscaler or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Autoscaler.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AutoscalersGetCall) Do() (*Autoscaler, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Autoscaler{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the specified Autoscaler resource.", + // "httpMethod": "GET", + // "id": "autoscaler.autoscalers.get", + // "parameterOrder": [ + // "project", + // "zone", + // "autoscaler" + // ], + // "parameters": { + // "autoscaler": { + // "description": "Name of the Autoscaler resource.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of Autoscaler resource.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Zone name of Autoscaler resource.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/zones/{zone}/autoscalers/{autoscaler}", + // "response": { + // "$ref": "Autoscaler" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "autoscaler.autoscalers.insert": + +type AutoscalersInsertCall struct { + s *Service + project string + zone string + autoscaler *Autoscaler + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Adds new Autoscaler resource. +func (r *AutoscalersService) Insert(project string, zone string, autoscaler *Autoscaler) *AutoscalersInsertCall { + c := &AutoscalersInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.autoscaler = autoscaler + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AutoscalersInsertCall) Fields(s ...googleapi.Field) *AutoscalersInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AutoscalersInsertCall) Context(ctx context.Context) *AutoscalersInsertCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/autoscalers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "autoscaler.autoscalers.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AutoscalersInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds new Autoscaler resource.", + // "httpMethod": "POST", + // "id": "autoscaler.autoscalers.insert", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "Project ID of Autoscaler resource.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Zone name of Autoscaler resource.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/zones/{zone}/autoscalers", + // "request": { + // "$ref": "Autoscaler" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "autoscaler.autoscalers.list": + +type AutoscalersListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all Autoscaler resources in this zone. +func (r *AutoscalersService) List(project string, zone string) *AutoscalersListCall { + c := &AutoscalersListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +// Filter sets the optional parameter "filter": +func (c *AutoscalersListCall) Filter(filter string) *AutoscalersListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": +func (c *AutoscalersListCall) MaxResults(maxResults int64) *AutoscalersListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": +func (c *AutoscalersListCall) PageToken(pageToken string) *AutoscalersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AutoscalersListCall) Fields(s ...googleapi.Field) *AutoscalersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AutoscalersListCall) IfNoneMatch(entityTag string) *AutoscalersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AutoscalersListCall) Context(ctx context.Context) *AutoscalersListCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/autoscalers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "autoscaler.autoscalers.list" call. +// Exactly one of *AutoscalerListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AutoscalerListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AutoscalersListCall) Do() (*AutoscalerListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AutoscalerListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all Autoscaler resources in this zone.", + // "httpMethod": "GET", + // "id": "autoscaler.autoscalers.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID of Autoscaler resource.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Zone name of Autoscaler resource.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/zones/{zone}/autoscalers", + // "response": { + // "$ref": "AutoscalerListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "autoscaler.autoscalers.patch": + +type AutoscalersPatchCall struct { + s *Service + project string + zone string + autoscaler string + autoscaler2 *Autoscaler + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Update the entire content of the Autoscaler resource. This +// method supports patch semantics. +func (r *AutoscalersService) Patch(project string, zone string, autoscaler string, autoscaler2 *Autoscaler) *AutoscalersPatchCall { + c := &AutoscalersPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.autoscaler = autoscaler + c.autoscaler2 = autoscaler2 + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AutoscalersPatchCall) Fields(s ...googleapi.Field) *AutoscalersPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AutoscalersPatchCall) Context(ctx context.Context) *AutoscalersPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/autoscalers/{autoscaler}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "autoscaler": c.autoscaler, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "autoscaler.autoscalers.patch" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AutoscalersPatchCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update the entire content of the Autoscaler resource. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "autoscaler.autoscalers.patch", + // "parameterOrder": [ + // "project", + // "zone", + // "autoscaler" + // ], + // "parameters": { + // "autoscaler": { + // "description": "Name of the Autoscaler resource.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of Autoscaler resource.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Zone name of Autoscaler resource.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/zones/{zone}/autoscalers/{autoscaler}", + // "request": { + // "$ref": "Autoscaler" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "autoscaler.autoscalers.update": + +type AutoscalersUpdateCall struct { + s *Service + project string + zone string + autoscaler string + autoscaler2 *Autoscaler + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Update the entire content of the Autoscaler resource. +func (r *AutoscalersService) Update(project string, zone string, autoscaler string, autoscaler2 *Autoscaler) *AutoscalersUpdateCall { + c := &AutoscalersUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.autoscaler = autoscaler + c.autoscaler2 = autoscaler2 + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AutoscalersUpdateCall) Fields(s ...googleapi.Field) *AutoscalersUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AutoscalersUpdateCall) Context(ctx context.Context) *AutoscalersUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/autoscalers/{autoscaler}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "autoscaler": c.autoscaler, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "autoscaler.autoscalers.update" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AutoscalersUpdateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update the entire content of the Autoscaler resource.", + // "httpMethod": "PUT", + // "id": "autoscaler.autoscalers.update", + // "parameterOrder": [ + // "project", + // "zone", + // "autoscaler" + // ], + // "parameters": { + // "autoscaler": { + // "description": "Name of the Autoscaler resource.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID of Autoscaler resource.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Zone name of Autoscaler resource.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/zones/{zone}/autoscalers/{autoscaler}", + // "request": { + // "$ref": "Autoscaler" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "autoscaler.zoneOperations.delete": + +type ZoneOperationsDeleteCall struct { + s *Service + project string + zone string + operation string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneOperationsDeleteCall) Fields(s ...googleapi.Field) *ZoneOperationsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneOperationsDeleteCall) Context(ctx context.Context) *ZoneOperationsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "autoscaler.zoneOperations.delete" call. +func (c *ZoneOperationsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified zone-specific operation resource.", + // "httpMethod": "DELETE", + // "id": "autoscaler.zoneOperations.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "operation" + // ], + // "parameters": { + // "operation": { + // "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" + // }, + // "zone": { + // "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 "autoscaler.zoneOperations.get": + +type ZoneOperationsGetCall struct { + s *Service + project string + zone string + operation string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneOperationsGetCall) Fields(s ...googleapi.Field) *ZoneOperationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ZoneOperationsGetCall) IfNoneMatch(entityTag string) *ZoneOperationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneOperationsGetCall) Context(ctx context.Context) *ZoneOperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "autoscaler.zoneOperations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ZoneOperationsGetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified zone-specific operation resource.", + // "httpMethod": "GET", + // "id": "autoscaler.zoneOperations.get", + // "parameterOrder": [ + // "project", + // "zone", + // "operation" + // ], + // "parameters": { + // "operation": { + // "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" + // }, + // "zone": { + // "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 "autoscaler.zoneOperations.list": + +type ZoneOperationsListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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": +func (c *ZoneOperationsListCall) Filter(filter string) *ZoneOperationsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": +func (c *ZoneOperationsListCall) MaxResults(maxResults int64) *ZoneOperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": +func (c *ZoneOperationsListCall) PageToken(pageToken string) *ZoneOperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneOperationsListCall) Fields(s ...googleapi.Field) *ZoneOperationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ZoneOperationsListCall) IfNoneMatch(entityTag string) *ZoneOperationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneOperationsListCall) Context(ctx context.Context) *ZoneOperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneOperationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "autoscaler.zoneOperations.list" call. +// Exactly one of *OperationList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *OperationList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ZoneOperationsListCall) Do() (*OperationList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperationList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of operation resources contained within the specified zone.", + // "httpMethod": "GET", + // "id": "autoscaler.zoneOperations.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "location": "query", + // "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" + // }, + // "zone": { + // "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 "autoscaler.zones.list": + +type ZonesListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: +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": +func (c *ZonesListCall) Filter(filter string) *ZonesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": +func (c *ZonesListCall) MaxResults(maxResults int64) *ZonesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": +func (c *ZonesListCall) PageToken(pageToken string) *ZonesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZonesListCall) Fields(s ...googleapi.Field) *ZonesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ZonesListCall) IfNoneMatch(entityTag string) *ZonesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZonesListCall) Context(ctx context.Context) *ZonesListCall { + c.ctx_ = ctx + return c +} + +func (c *ZonesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "autoscaler.zones.list" call. +// Exactly one of *ZoneList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *ZoneList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ZonesListCall) Do() (*ZoneList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ZoneList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "", + // "httpMethod": "GET", + // "id": "autoscaler.zones.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "location": "query", + // "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}/zones", + // "response": { + // "$ref": "ZoneList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/bigquery/v2/bigquery-api.json b/Godeps/_workspace/src/google.golang.org/api/bigquery/v2/bigquery-api.json new file mode 100644 index 000000000..8e27c7fbb --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/bigquery/v2/bigquery-api.json @@ -0,0 +1,2348 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/_4HD2Yk5KBJwf4ZwHLl0cnazBI0\"", + "discoveryVersion": "v1", + "id": "bigquery:v2", + "name": "bigquery", + "version": "v2", + "revision": "20150911", + "title": "BigQuery API", + "description": "A data platform for customers to create, manage, share and query data.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/search-16.gif", + "x32": "https://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/bigquery/", + "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/bigquery.insertdata": { + "description": "Insert data into 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/cloud-platform.read-only": { + "description": "View 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": { + "CsvOptions": { + "id": "CsvOptions", + "type": "object", + "properties": { + "allowJaggedRows": { + "type": "boolean", + "description": "[Optional] Indicates if BigQuery should accept rows that are missing trailing optional columns. If true, BigQuery treats missing trailing columns as null values. If false, records with missing trailing columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false." + }, + "allowQuotedNewlines": { + "type": "boolean", + "description": "[Optional] Indicates if BigQuery should allow quoted data sections that contain newline characters in a CSV file. The default value is false." + }, + "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 (',')." + }, + "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.", + "default": "\"", + "pattern": ".?" + }, + "skipLeadingRows": { + "type": "integer", + "description": "[Optional] The number of rows at the top of a CSV file that BigQuery will skip when reading 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" + } + } + }, + "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." + }, + "view": { + "$ref": "TableReference", + "description": "[Pick one] A view from a different dataset to grant access to. Queries executed against that view will have read access to tables in this dataset. The role field is not required when this field is set. If that view is updated by any user, access to the view needs to be granted again via an update operation." + } + } + } + }, + "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." + }, + "defaultTableExpirationMs": { + "type": "string", + "description": "[Experimental] The default lifetime of all tables in the dataset, in milliseconds. The minimum value is 3600000 milliseconds (one hour). Once this property is set, all newly-created tables in the dataset will have an expirationTime property set to the creation time plus the value in this property, and changing the value will only affect new tables, not existing ones. When the expirationTime for a given table is reached, that table will be deleted automatically. If a table's expirationTime is modified or removed before the table expires, or if you provide an explicit expirationTime when creating a table, that value takes precedence over the default expiration time indicated by this property.", + "format": "int64" + }, + "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" + }, + "location": { + "type": "string", + "description": "[Experimental] The geographic location where the dataset should reside. Possible values include EU and US. The default value is US." + }, + "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. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.", + "annotations": { + "required": [ + "bigquery.datasets.update" + ] + } + }, + "projectId": { + "type": "string", + "description": "[Optional] The ID of the project containing this dataset.", + "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." + } + } + }, + "ExternalDataConfiguration": { + "id": "ExternalDataConfiguration", + "type": "object", + "properties": { + "compression": { + "type": "string", + "description": "[Optional] The compression type of the data source. Possible values include GZIP and NONE. The default value is NONE." + }, + "csvOptions": { + "$ref": "CsvOptions", + "description": "Additional properties to set if sourceFormat is set to CSV." + }, + "ignoreUnknownValues": { + "type": "boolean", + "description": "[Optional] Indicates if BigQuery should allow extra values that are not represented in the table schema. If true, the extra values are ignored. If false, records with extra columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. The sourceFormat property determines what BigQuery treats as an extra value: CSV: Trailing columns JSON: Named values that don't match any column names" + }, + "maxBadRecords": { + "type": "integer", + "description": "[Optional] The maximum number of bad records that BigQuery can ignore when reading data. If the number of bad records exceeds this value, an invalid error is returned in the job result. The default value is 0, which requires that all records are valid.", + "format": "int32" + }, + "schema": { + "$ref": "TableSchema", + "description": "[Required] The schema for the data." + }, + "sourceFormat": { + "type": "string", + "description": "[Required] The data format. For CSV files, specify \"CSV\". For newline-delimited JSON, specify \"NEWLINE_DELIMITED_JSON\"." + }, + "sourceUris": { + "type": "array", + "description": "[Required] The fully-qualified URIs that point to your data in Google Cloud Storage. Each URI can contain one '*' wildcard character and it must come after the 'bucket' name. Size limits related to load jobs apply to external data sources, plus an additional limit of 10 GB maximum size across all URIs.", + "items": { + "type": "string" + } + } + } + }, + "GetQueryResultsResponse": { + "id": "GetQueryResultsResponse", + "type": "object", + "properties": { + "cacheHit": { + "type": "boolean", + "description": "Whether the query result was fetched from the query cache." + }, + "errors": { + "type": "array", + "description": "[Output-only] All errors and warnings encountered during the running of the job. Errors here do not necessarily mean that the job has completed or was unsuccessful.", + "items": { + "$ref": "ErrorProto" + } + }, + "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." + }, + "totalBytesProcessed": { + "type": "string", + "description": "The total number of bytes processed for this query.", + "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. 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." + }, + "user_email": { + "type": "string", + "description": "[Output-only] Email address of the user who ran the job." + } + } + }, + "JobCancelResponse": { + "id": "JobCancelResponse", + "type": "object", + "properties": { + "job": { + "$ref": "Job", + "description": "The final state of the job." + }, + "kind": { + "type": "string", + "description": "The resource type of the response.", + "default": "bigquery#jobCancelResponse" + } + } + }, + "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": { + "compression": { + "type": "string", + "description": "[Optional] The compression type to use for exported files. Possible values include GZIP and NONE. The default value is NONE." + }, + "destinationFormat": { + "type": "string", + "description": "[Optional] The exported file format. Possible values include CSV, NEWLINE_DELIMITED_JSON and AVRO. The default value is CSV. Tables with nested or repeated fields cannot be exported as CSV." + }, + "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.", + "default": "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. If false, records with missing trailing columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. 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] Indicates if BigQuery should allow extra values that are not represented in the table schema. If true, the extra values are ignored. If false, records with extra columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. The sourceFormat property determines what BigQuery treats as an extra value: CSV: Trailing columns JSON: Named values that don't match any column names" + }, + "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. The default value is 0, which requires that all records are valid.", + "format": "int32" + }, + "projectionFields": { + "type": "array", + "description": "[Experimental] If sourceFormat is set to \"DATASTORE_BACKUP\", indicates which entity properties to load into BigQuery from a Cloud Datastore backup. Property names are case sensitive and must be top-level properties. If no properties are specified, BigQuery loads all properties. If any named property isn't found in the Cloud Datastore backup, an invalid error is returned in the job result.", + "items": { + "type": "string" + } + }, + "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.", + "default": "\"", + "pattern": ".?" + }, + "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 in Google Cloud Storage. Each URI can contain one '*' wildcard character and it must come after the 'bucket' name.", + "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_APPEND. 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 destinationTable 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." + }, + "flattenResults": { + "type": "boolean", + "description": "[Optional] Flattens all nested and repeated fields in the query results. The default value is true. allowLargeResults must be true if this is set to false.", + "default": "true" + }, + "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." + }, + "tableDefinitions": { + "type": "object", + "description": "[Experimental] If querying an external data source outside of BigQuery, describes the data format, location and other properties of the data source. By defining these properties, the data source can then be queried as if it were a standard BigQuery table.", + "additionalProperties": { + "$ref": "ExternalDataConfiguration" + } + }, + "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. The default value is true.", + "default": "true" + }, + "userDefinedFunctionResources": { + "type": "array", + "description": "[Experimental] Describes user-defined function resources used in the query.", + "items": { + "$ref": "UserDefinedFunctionResource" + } + }, + "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": "[Pick one] Source table to copy." + }, + "sourceTables": { + "type": "array", + "description": "[Pick one] Source tables to copy.", + "items": { + "$ref": "TableReference" + } + }, + "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] Email address of the 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." + } + } + }, + "JobReference": { + "id": "JobReference", + "type": "object", + "properties": { + "jobId": { + "type": "string", + "description": "[Required] The ID of the job. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). The maximum length is 1,024 characters.", + "annotations": { + "required": [ + "bigquery.jobs.getQueryResults" + ] + } + }, + "projectId": { + "type": "string", + "description": "[Required] The ID of the project containing this 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" + }, + "extract": { + "$ref": "JobStatistics4", + "description": "[Output-only] Statistics for an extract job." + }, + "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": { + "billingTier": { + "type": "integer", + "description": "[Output-only] Billing tier for the job.", + "format": "int32" + }, + "cacheHit": { + "type": "boolean", + "description": "[Output-only] Whether the query result was fetched from the query cache." + }, + "totalBytesBilled": { + "type": "string", + "description": "[Output-only] Total bytes billed for the job.", + "format": "int64" + }, + "totalBytesProcessed": { + "type": "string", + "description": "[Output-only] Total bytes processed for the job.", + "format": "int64" + } + } + }, + "JobStatistics3": { + "id": "JobStatistics3", + "type": "object", + "properties": { + "inputFileBytes": { + "type": "string", + "description": "[Output-only] Number of bytes of source data in a load 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 a load 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" + } + } + }, + "JobStatistics4": { + "id": "JobStatistics4", + "type": "object", + "properties": { + "destinationUriFileCounts": { + "type": "array", + "description": "[Output-only] Number of files per destination URI or URI pattern specified in the extract configuration. These values will be in the same order as the URIs specified in the 'destinationUris' field.", + "items": { + "type": "string", + "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 to true, BigQuery doesn't run the job. Instead, if the query is valid, BigQuery returns statistics about the job such as how many bytes would be processed. If the query is invalid, an error returns. 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] This property is deprecated." + }, + "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.", + "default": "true" + } + } + }, + "QueryResponse": { + "id": "QueryResponse", + "type": "object", + "properties": { + "cacheHit": { + "type": "boolean", + "description": "Whether the query result was fetched from the query cache." + }, + "errors": { + "type": "array", + "description": "[Output-only] All errors and warnings encountered during the running of the job. Errors here do not necessarily mean that the job has completed or was unsuccessful.", + "items": { + "$ref": "ErrorProto" + } + }, + "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" + } + } + }, + "Streamingbuffer": { + "id": "Streamingbuffer", + "type": "object", + "properties": { + "estimatedBytes": { + "type": "string", + "description": "[Output-only] A lower-bound estimate of the number of bytes currently in the streaming buffer.", + "format": "uint64" + }, + "estimatedRows": { + "type": "string", + "description": "[Output-only] A lower-bound estimate of the number of rows currently in the streaming buffer.", + "format": "uint64" + }, + "oldestEntryTime": { + "type": "string", + "description": "[Output-only] Contains the timestamp of the oldest entry in the streaming buffer, in milliseconds since the epoch, if the streaming buffer is available.", + "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" + }, + "externalDataConfiguration": { + "$ref": "ExternalDataConfiguration", + "description": "[Experimental] Describes the data format, location, and other properties of a table stored outside of BigQuery. By defining these properties, the data source can then be queried as if it were a standard BigQuery table." + }, + "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": "uint64" + }, + "location": { + "type": "string", + "description": "[Output-only] The geographic location where the table resides. This value is inherited from the dataset." + }, + "numBytes": { + "type": "string", + "description": "[Output-only] The size of this table in bytes, excluding any data in the streaming buffer.", + "format": "int64" + }, + "numRows": { + "type": "string", + "description": "[Output-only] The number of rows of data in this table, excluding any data in the streaming buffer.", + "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." + }, + "streamingBuffer": { + "$ref": "Streamingbuffer", + "description": "[Output-only] Contains information regarding this table's streaming buffer, if one is present. This field will be absent if the table is not being streamed to or if there is no data in the streaming buffer." + }, + "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", + "properties": { + "v": { + "type": "any" + } + } + }, + "TableDataInsertAllRequest": { + "id": "TableDataInsertAllRequest", + "type": "object", + "properties": { + "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." + }, + "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." + } + } + } + }, + "skipInvalidRows": { + "type": "boolean", + "description": "[Optional] Insert all valid rows of a request, even if invalid rows exist. The default value is false, which causes the entire request to fail if any invalid rows exist." + } + } + }, + "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. The maximum length is 16K characters." + }, + "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. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or underscore. The maximum length is 128 characters." + }, + "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] The ID of the dataset containing this table.", + "annotations": { + "required": [ + "bigquery.tables.update" + ] + } + }, + "projectId": { + "type": "string", + "description": "[Required] The ID of the project containing this table.", + "annotations": { + "required": [ + "bigquery.tables.update" + ] + } + }, + "tableId": { + "type": "string", + "description": "[Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.", + "annotations": { + "required": [ + "bigquery.tables.update" + ] + } + } + } + }, + "TableRow": { + "id": "TableRow", + "type": "object", + "properties": { + "f": { + "type": "array", + "description": "Represents a single row in the result set, consisting of one or more fields.", + "items": { + "$ref": "TableCell" + } + } + } + }, + "TableSchema": { + "id": "TableSchema", + "type": "object", + "properties": { + "fields": { + "type": "array", + "description": "Describes the fields in a table.", + "items": { + "$ref": "TableFieldSchema" + } + } + } + }, + "UserDefinedFunctionResource": { + "id": "UserDefinedFunctionResource", + "type": "object", + "properties": { + "inlineCode": { + "type": "string", + "description": "[Pick one] An inline resource that contains code for a user-defined function (UDF). Providing a inline code resource is equivalent to providing a URI for a file containing the same code." + }, + "resourceUri": { + "type": "string", + "description": "[Pick one] A code resource to load from a Google Cloud Storage URI (gs://bucket/path)." + } + } + }, + "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", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + }, + "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 datasets in the specified project to which you have been granted the READER dataset role.", + "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", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + }, + "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": { + "cancel": { + "id": "bigquery.jobs.cancel", + "path": "project/{projectId}/jobs/{jobId}/cancel", + "httpMethod": "POST", + "description": "Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully. Cancelled jobs may still incur costs.", + "parameters": { + "jobId": { + "type": "string", + "description": "Job ID of the job to cancel", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID of the job to cancel", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "jobId" + ], + "response": { + "$ref": "JobCancelResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "id": "bigquery.jobs.get", + "path": "projects/{projectId}/jobs/{jobId}", + "httpMethod": "GET", + "description": "Returns information about a specific job. Job information is available for a six month period after creation. Requires that you're the person who ran the job, or have the Is Owner project role.", + "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", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + }, + "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 10 seconds. If the timeout passes before the job completes, the 'jobComplete' field in the response will be false", + "format": "uint32", + "location": "query" + } + }, + "parameterOrder": [ + "projectId", + "jobId" + ], + "response": { + "$ref": "GetQueryResultsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + }, + "insert": { + "id": "bigquery.jobs.insert", + "path": "projects/{projectId}/jobs", + "httpMethod": "POST", + "description": "Starts a new asynchronous job. Requires the Can View project role.", + "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 jobs that you started in the specified project. Job information is available for a six month period after creation. The job list is sorted in reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property.", + "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", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + }, + "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", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + } + } + }, + "projects": { + "methods": { + "list": { + "id": "bigquery.projects.list", + "path": "projects", + "httpMethod": "GET", + "description": "Lists all projects to which you have been granted any project role.", + "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", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + } + } + }, + "tabledata": { + "methods": { + "insertAll": { + "id": "bigquery.tabledata.insertAll", + "path": "projects/{projectId}/datasets/{datasetId}/tables/{tableId}/insertAll", + "httpMethod": "POST", + "description": "Streams data into BigQuery one record at a time without needing to run a load job. Requires the WRITER dataset role.", + "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/bigquery.insertdata", + "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. Requires the READER dataset role.", + "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", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + } + } + }, + "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", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + }, + "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. Requires the READER dataset role.", + "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", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ] + }, + "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/Godeps/_workspace/src/google.golang.org/api/bigquery/v2/bigquery-gen.go b/Godeps/_workspace/src/google.golang.org/api/bigquery/v2/bigquery-gen.go new file mode 100644 index 000000000..279f8aebf --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/bigquery/v2/bigquery-gen.go @@ -0,0 +1,5266 @@ +// Package bigquery provides access to the BigQuery API. +// +// See https://cloud.google.com/bigquery/ +// +// Usage example: +// +// import "google.golang.org/api/bigquery/v2" +// ... +// bigqueryService, err := bigquery.New(oauthHttpClient) +package bigquery // import "google.golang.org/api/bigquery/v2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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" + + // Insert data into Google BigQuery + BigqueryInsertdataScope = "https://www.googleapis.com/auth/bigquery.insertdata" + + // View and manage your data across Google Cloud Platform services + CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" + + // View your data across Google Cloud Platform services + CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" + + // Manage your data and permissions in Google Cloud Storage + DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control" + + // View your data in Google Cloud Storage + DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only" + + // Manage your data in Google Cloud Storage + DevstorageReadWriteScope = "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 + UserAgent string // optional additional User-Agent fragment + + Datasets *DatasetsService + + Jobs *JobsService + + Projects *ProjectsService + + Tabledata *TabledataService + + Tables *TablesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 CsvOptions struct { + // AllowJaggedRows: [Optional] Indicates if BigQuery should accept rows + // that are missing trailing optional columns. If true, BigQuery treats + // missing trailing columns as null values. If false, records with + // missing trailing columns are treated as bad records, and if there are + // too many bad records, an invalid error is returned in the job result. + // The default value is false. + AllowJaggedRows bool `json:"allowJaggedRows,omitempty"` + + // AllowQuotedNewlines: [Optional] 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"` + + // 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"` + + // 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. + // + // Default: " + Quote *string `json:"quote,omitempty"` + + // SkipLeadingRows: [Optional] The number of rows at the top of a CSV + // file that BigQuery will skip when reading 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"` + + // ForceSendFields is a list of field names (e.g. "AllowJaggedRows") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CsvOptions) MarshalJSON() ([]byte, error) { + type noMethod CsvOptions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // DefaultTableExpirationMs: [Experimental] The default lifetime of all + // tables in the dataset, in milliseconds. The minimum value is 3600000 + // milliseconds (one hour). Once this property is set, all newly-created + // tables in the dataset will have an expirationTime property set to the + // creation time plus the value in this property, and changing the value + // will only affect new tables, not existing ones. When the + // expirationTime for a given table is reached, that table will be + // deleted automatically. If a table's expirationTime is modified or + // removed before the table expires, or if you provide an explicit + // expirationTime when creating a table, that value takes precedence + // over the default expiration time indicated by this property. + DefaultTableExpirationMs int64 `json:"defaultTableExpirationMs,omitempty,string"` + + // 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"` + + // Location: [Experimental] The geographic location where the dataset + // should reside. Possible values include EU and US. The default value + // is US. + Location string `json:"location,omitempty"` + + // 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Access") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Dataset) MarshalJSON() ([]byte, error) { + type noMethod Dataset + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // View: [Pick one] A view from a different dataset to grant access to. + // Queries executed against that view will have read access to tables in + // this dataset. The role field is not required when this field is set. + // If that view is updated by any user, access to the view needs to be + // granted again via an update operation. + View *TableReference `json:"view,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Domain") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DatasetAccess) MarshalJSON() ([]byte, error) { + type noMethod DatasetAccess + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Datasets") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DatasetList) MarshalJSON() ([]byte, error) { + type noMethod DatasetList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "DatasetReference") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DatasetListDatasets) MarshalJSON() ([]byte, error) { + type noMethod DatasetListDatasets + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DatasetReference struct { + // DatasetId: [Required] A unique ID for this dataset, without the + // project name. The ID must contain only letters (a-z, A-Z), numbers + // (0-9), or underscores (_). The maximum length is 1,024 characters. + DatasetId string `json:"datasetId,omitempty"` + + // ProjectId: [Optional] The ID of the project containing this dataset. + ProjectId string `json:"projectId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DatasetId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DatasetReference) MarshalJSON() ([]byte, error) { + type noMethod DatasetReference + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "DebugInfo") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ErrorProto) MarshalJSON() ([]byte, error) { + type noMethod ErrorProto + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ExternalDataConfiguration struct { + // Compression: [Optional] The compression type of the data source. + // Possible values include GZIP and NONE. The default value is NONE. + Compression string `json:"compression,omitempty"` + + // CsvOptions: Additional properties to set if sourceFormat is set to + // CSV. + CsvOptions *CsvOptions `json:"csvOptions,omitempty"` + + // IgnoreUnknownValues: [Optional] Indicates if BigQuery should allow + // extra values that are not represented in the table schema. If true, + // the extra values are ignored. If false, records with extra columns + // are treated as bad records, and if there are too many bad records, an + // invalid error is returned in the job result. The default value is + // false. The sourceFormat property determines what BigQuery treats as + // an extra value: CSV: Trailing columns JSON: Named values that don't + // match any column names + IgnoreUnknownValues bool `json:"ignoreUnknownValues,omitempty"` + + // MaxBadRecords: [Optional] The maximum number of bad records that + // BigQuery can ignore when reading data. If the number of bad records + // exceeds this value, an invalid error is returned in the job result. + // The default value is 0, which requires that all records are valid. + MaxBadRecords int64 `json:"maxBadRecords,omitempty"` + + // Schema: [Required] The schema for the data. + Schema *TableSchema `json:"schema,omitempty"` + + // SourceFormat: [Required] The data format. For CSV files, specify + // "CSV". For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". + SourceFormat string `json:"sourceFormat,omitempty"` + + // SourceUris: [Required] The fully-qualified URIs that point to your + // data in Google Cloud Storage. Each URI can contain one '*' wildcard + // character and it must come after the 'bucket' name. Size limits + // related to load jobs apply to external data sources, plus an + // additional limit of 10 GB maximum size across all URIs. + SourceUris []string `json:"sourceUris,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Compression") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ExternalDataConfiguration) MarshalJSON() ([]byte, error) { + type noMethod ExternalDataConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GetQueryResultsResponse struct { + // CacheHit: Whether the query result was fetched from the query cache. + CacheHit bool `json:"cacheHit,omitempty"` + + // Errors: [Output-only] All errors and warnings 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"` + + // 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"` + + // TotalBytesProcessed: The total number of bytes processed for this + // query. + 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. Present only when the query completes successfully. + TotalRows uint64 `json:"totalRows,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CacheHit") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GetQueryResultsResponse) MarshalJSON() ([]byte, error) { + type noMethod GetQueryResultsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // UserEmail: [Output-only] Email address of the user who ran the job. + UserEmail string `json:"user_email,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Configuration") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Job) MarshalJSON() ([]byte, error) { + type noMethod Job + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type JobCancelResponse struct { + // Job: The final state of the job. + Job *Job `json:"job,omitempty"` + + // Kind: The resource type of the response. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Job") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JobCancelResponse) MarshalJSON() ([]byte, error) { + type noMethod JobCancelResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Copy") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JobConfiguration) MarshalJSON() ([]byte, error) { + type noMethod JobConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type JobConfigurationExtract struct { + // Compression: [Optional] The compression type to use for exported + // files. Possible values include GZIP and NONE. The default value is + // NONE. + Compression string `json:"compression,omitempty"` + + // DestinationFormat: [Optional] The exported file format. Possible + // values include CSV, NEWLINE_DELIMITED_JSON and AVRO. The default + // value is CSV. Tables with nested or repeated fields cannot be + // exported as CSV. + 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. + // + // Default: true + PrintHeader *bool `json:"printHeader,omitempty"` + + // SourceTable: [Required] A reference to the table being exported. + SourceTable *TableReference `json:"sourceTable,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Compression") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JobConfigurationExtract) MarshalJSON() ([]byte, error) { + type noMethod JobConfigurationExtract + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "CreateDisposition") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JobConfigurationLink) MarshalJSON() ([]byte, error) { + type noMethod JobConfigurationLink + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type JobConfigurationLoad struct { + // AllowJaggedRows: [Optional] Accept rows that are missing trailing + // optional columns. The missing values are treated as nulls. If false, + // records with missing trailing columns are treated as bad records, and + // if there are too many bad records, an invalid error is returned in + // the job result. The default value is false. 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] Indicates if BigQuery should allow + // extra values that are not represented in the table schema. If true, + // the extra values are ignored. If false, records with extra columns + // are treated as bad records, and if there are too many bad records, an + // invalid error is returned in the job result. The default value is + // false. The sourceFormat property determines what BigQuery treats as + // an extra value: CSV: Trailing columns JSON: Named values that don't + // match any column names + 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. The default value is 0, which requires that all records are + // valid. + MaxBadRecords int64 `json:"maxBadRecords,omitempty"` + + // ProjectionFields: [Experimental] If sourceFormat is set to + // "DATASTORE_BACKUP", indicates which entity properties to load into + // BigQuery from a Cloud Datastore backup. Property names are case + // sensitive and must be top-level properties. If no properties are + // specified, BigQuery loads all properties. If any named property isn't + // found in the Cloud Datastore backup, an invalid error is returned in + // the job result. + ProjectionFields []string `json:"projectionFields,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. + // + // Default: " + 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 in Google Cloud Storage. Each URI can contain one '*' wildcard + // character and it must come after the 'bucket' name. + 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_APPEND. 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"` + + // ForceSendFields is a list of field names (e.g. "AllowJaggedRows") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JobConfigurationLoad) MarshalJSON() ([]byte, error) { + type noMethod JobConfigurationLoad + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type JobConfigurationQuery struct { + // AllowLargeResults: If true, allows the query to produce arbitrarily + // large result tables at a slight cost in performance. Requires + // destinationTable 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"` + + // FlattenResults: [Optional] Flattens all nested and repeated fields in + // the query results. The default value is true. allowLargeResults must + // be true if this is set to false. + // + // Default: true + FlattenResults *bool `json:"flattenResults,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"` + + // TableDefinitions: [Experimental] If querying an external data source + // outside of BigQuery, describes the data format, location and other + // properties of the data source. By defining these properties, the data + // source can then be queried as if it were a standard BigQuery table. + TableDefinitions map[string]ExternalDataConfiguration `json:"tableDefinitions,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. The default value is true. + // + // Default: true + UseQueryCache *bool `json:"useQueryCache,omitempty"` + + // UserDefinedFunctionResources: [Experimental] Describes user-defined + // function resources used in the query. + UserDefinedFunctionResources []*UserDefinedFunctionResource `json:"userDefinedFunctionResources,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"` + + // ForceSendFields is a list of field names (e.g. "AllowLargeResults") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JobConfigurationQuery) MarshalJSON() ([]byte, error) { + type noMethod JobConfigurationQuery + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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: [Pick one] Source table to copy. + SourceTable *TableReference `json:"sourceTable,omitempty"` + + // SourceTables: [Pick one] Source tables to copy. + SourceTables []*TableReference `json:"sourceTables,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"` + + // ForceSendFields is a list of field names (e.g. "CreateDisposition") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JobConfigurationTableCopy) MarshalJSON() ([]byte, error) { + type noMethod JobConfigurationTableCopy + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JobList) MarshalJSON() ([]byte, error) { + type noMethod JobList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // UserEmail: [Full-projection-only] Email address of the user who ran + // the job. + UserEmail string `json:"user_email,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Configuration") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JobListJobs) MarshalJSON() ([]byte, error) { + type noMethod JobListJobs + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type JobReference struct { + // JobId: [Required] The ID of the job. The ID must contain only letters + // (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). The + // maximum length is 1,024 characters. + JobId string `json:"jobId,omitempty"` + + // ProjectId: [Required] The ID of the project containing this job. + ProjectId string `json:"projectId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "JobId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JobReference) MarshalJSON() ([]byte, error) { + type noMethod JobReference + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // Extract: [Output-only] Statistics for an extract job. + Extract *JobStatistics4 `json:"extract,omitempty"` + + // 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"` + + // ForceSendFields is a list of field names (e.g. "CreationTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JobStatistics) MarshalJSON() ([]byte, error) { + type noMethod JobStatistics + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type JobStatistics2 struct { + // BillingTier: [Output-only] Billing tier for the job. + BillingTier int64 `json:"billingTier,omitempty"` + + // CacheHit: [Output-only] Whether the query result was fetched from the + // query cache. + CacheHit bool `json:"cacheHit,omitempty"` + + // TotalBytesBilled: [Output-only] Total bytes billed for the job. + TotalBytesBilled int64 `json:"totalBytesBilled,omitempty,string"` + + // TotalBytesProcessed: [Output-only] Total bytes processed for the job. + TotalBytesProcessed int64 `json:"totalBytesProcessed,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "BillingTier") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JobStatistics2) MarshalJSON() ([]byte, error) { + type noMethod JobStatistics2 + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type JobStatistics3 struct { + // InputFileBytes: [Output-only] Number of bytes of source data in a + // load 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 a load 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"` + + // ForceSendFields is a list of field names (e.g. "InputFileBytes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JobStatistics3) MarshalJSON() ([]byte, error) { + type noMethod JobStatistics3 + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type JobStatistics4 struct { + // DestinationUriFileCounts: [Output-only] Number of files per + // destination URI or URI pattern specified in the extract + // configuration. These values will be in the same order as the URIs + // specified in the 'destinationUris' field. + DestinationUriFileCounts googleapi.Int64s `json:"destinationUriFileCounts,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "DestinationUriFileCounts") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JobStatistics4) MarshalJSON() ([]byte, error) { + type noMethod JobStatistics4 + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "ErrorResult") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JobStatus) MarshalJSON() ([]byte, error) { + type noMethod JobStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type JsonValue interface{} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProjectList) MarshalJSON() ([]byte, error) { + type noMethod ProjectList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "FriendlyName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProjectListProjects) MarshalJSON() ([]byte, error) { + type noMethod ProjectListProjects + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "ProjectId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProjectReference) MarshalJSON() ([]byte, error) { + type noMethod ProjectReference + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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 to true, BigQuery doesn't run the job. + // Instead, if the query is valid, BigQuery returns statistics about the + // job such as how many bytes would be processed. If the query is + // invalid, an error returns. 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] This property is deprecated. + 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. + // + // Default: true + UseQueryCache *bool `json:"useQueryCache,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DefaultDataset") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *QueryRequest) MarshalJSON() ([]byte, error) { + type noMethod QueryRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type QueryResponse struct { + // CacheHit: Whether the query result was fetched from the query cache. + CacheHit bool `json:"cacheHit,omitempty"` + + // Errors: [Output-only] All errors and warnings 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"` + + // 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CacheHit") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *QueryResponse) MarshalJSON() ([]byte, error) { + type noMethod QueryResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Streamingbuffer struct { + // EstimatedBytes: [Output-only] A lower-bound estimate of the number of + // bytes currently in the streaming buffer. + EstimatedBytes uint64 `json:"estimatedBytes,omitempty,string"` + + // EstimatedRows: [Output-only] A lower-bound estimate of the number of + // rows currently in the streaming buffer. + EstimatedRows uint64 `json:"estimatedRows,omitempty,string"` + + // OldestEntryTime: [Output-only] Contains the timestamp of the oldest + // entry in the streaming buffer, in milliseconds since the epoch, if + // the streaming buffer is available. + OldestEntryTime uint64 `json:"oldestEntryTime,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "EstimatedBytes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Streamingbuffer) MarshalJSON() ([]byte, error) { + type noMethod Streamingbuffer + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ExternalDataConfiguration: [Experimental] Describes the data format, + // location, and other properties of a table stored outside of BigQuery. + // By defining these properties, the data source can then be queried as + // if it were a standard BigQuery table. + ExternalDataConfiguration *ExternalDataConfiguration `json:"externalDataConfiguration,omitempty"` + + // 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 uint64 `json:"lastModifiedTime,omitempty,string"` + + // Location: [Output-only] The geographic location where the table + // resides. This value is inherited from the dataset. + Location string `json:"location,omitempty"` + + // NumBytes: [Output-only] The size of this table in bytes, excluding + // any data in the streaming buffer. + NumBytes int64 `json:"numBytes,omitempty,string"` + + // NumRows: [Output-only] The number of rows of data in this table, + // excluding any data in the streaming buffer. + 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"` + + // StreamingBuffer: [Output-only] Contains information regarding this + // table's streaming buffer, if one is present. This field will be + // absent if the table is not being streamed to or if there is no data + // in the streaming buffer. + StreamingBuffer *Streamingbuffer `json:"streamingBuffer,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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Table) MarshalJSON() ([]byte, error) { + type noMethod Table + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TableCell struct { + V interface{} `json:"v,omitempty"` + + // ForceSendFields is a list of field names (e.g. "V") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TableCell) MarshalJSON() ([]byte, error) { + type noMethod TableCell + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TableDataInsertAllRequest struct { + // 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. + IgnoreUnknownValues bool `json:"ignoreUnknownValues,omitempty"` + + // Kind: The resource type of the response. + Kind string `json:"kind,omitempty"` + + // Rows: The rows to insert. + Rows []*TableDataInsertAllRequestRows `json:"rows,omitempty"` + + // SkipInvalidRows: [Optional] Insert all valid rows of a request, even + // if invalid rows exist. The default value is false, which causes the + // entire request to fail if any invalid rows exist. + SkipInvalidRows bool `json:"skipInvalidRows,omitempty"` + + // ForceSendFields is a list of field names (e.g. "IgnoreUnknownValues") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TableDataInsertAllRequest) MarshalJSON() ([]byte, error) { + type noMethod TableDataInsertAllRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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 map[string]JsonValue `json:"json,omitempty"` + + // ForceSendFields is a list of field names (e.g. "InsertId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TableDataInsertAllRequestRows) MarshalJSON() ([]byte, error) { + type noMethod TableDataInsertAllRequestRows + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "InsertErrors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TableDataInsertAllResponse) MarshalJSON() ([]byte, error) { + type noMethod TableDataInsertAllResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TableDataInsertAllResponseInsertErrors) MarshalJSON() ([]byte, error) { + type noMethod TableDataInsertAllResponseInsertErrors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TableDataList) MarshalJSON() ([]byte, error) { + type noMethod TableDataList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TableFieldSchema struct { + // Description: [Optional] The field description. The maximum length is + // 16K characters. + 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. The name must contain only letters + // (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a + // letter or underscore. The maximum length is 128 characters. + 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"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TableFieldSchema) MarshalJSON() ([]byte, error) { + type noMethod TableFieldSchema + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TableList) MarshalJSON() ([]byte, error) { + type noMethod TableList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "FriendlyName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TableListTables) MarshalJSON() ([]byte, error) { + type noMethod TableListTables + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TableReference struct { + // DatasetId: [Required] The ID of the dataset containing this table. + DatasetId string `json:"datasetId,omitempty"` + + // ProjectId: [Required] The ID of the project containing this table. + ProjectId string `json:"projectId,omitempty"` + + // TableId: [Required] The ID of the table. The ID must contain only + // letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum + // length is 1,024 characters. + TableId string `json:"tableId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DatasetId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TableReference) MarshalJSON() ([]byte, error) { + type noMethod TableReference + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TableRow struct { + // F: Represents a single row in the result set, consisting of one or + // more fields. + F []*TableCell `json:"f,omitempty"` + + // ForceSendFields is a list of field names (e.g. "F") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TableRow) MarshalJSON() ([]byte, error) { + type noMethod TableRow + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TableSchema struct { + // Fields: Describes the fields in a table. + Fields []*TableFieldSchema `json:"fields,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Fields") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TableSchema) MarshalJSON() ([]byte, error) { + type noMethod TableSchema + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type UserDefinedFunctionResource struct { + // InlineCode: [Pick one] An inline resource that contains code for a + // user-defined function (UDF). Providing a inline code resource is + // equivalent to providing a URI for a file containing the same code. + InlineCode string `json:"inlineCode,omitempty"` + + // ResourceUri: [Pick one] A code resource to load from a Google Cloud + // Storage URI (gs://bucket/path). + ResourceUri string `json:"resourceUri,omitempty"` + + // ForceSendFields is a list of field names (e.g. "InlineCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserDefinedFunctionResource) MarshalJSON() ([]byte, error) { + type noMethod UserDefinedFunctionResource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ViewDefinition struct { + // Query: [Required] A query that BigQuery executes when the view is + // referenced. + Query string `json:"query,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Query") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ViewDefinition) MarshalJSON() ([]byte, error) { + type noMethod ViewDefinition + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "bigquery.datasets.delete": + +type DatasetsDeleteCall struct { + s *Service + projectId string + datasetId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsDeleteCall) Fields(s ...googleapi.Field) *DatasetsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsDeleteCall) Context(ctx context.Context) *DatasetsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["deleteContents"]; ok { + params.Set("deleteContents", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "datasetId": c.datasetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "bigquery.datasets.delete" call. +func (c *DatasetsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsGetCall) Fields(s ...googleapi.Field) *DatasetsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DatasetsGetCall) IfNoneMatch(entityTag string) *DatasetsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsGetCall) Context(ctx context.Context) *DatasetsGetCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "datasetId": c.datasetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "bigquery.datasets.get" call. +// Exactly one of *Dataset or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Dataset.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *DatasetsGetCall) Do() (*Dataset, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Dataset{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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", + // "https://www.googleapis.com/auth/cloud-platform.read-only" + // ] + // } + +} + +// method id "bigquery.datasets.insert": + +type DatasetsInsertCall struct { + s *Service + projectId string + dataset *Dataset + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsInsertCall) Fields(s ...googleapi.Field) *DatasetsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsInsertCall) Context(ctx context.Context) *DatasetsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "bigquery.datasets.insert" call. +// Exactly one of *Dataset or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Dataset.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *DatasetsInsertCall) Do() (*Dataset, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Dataset{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// List: Lists all datasets in the specified project to which you have +// been granted the READER dataset role. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsListCall) Fields(s ...googleapi.Field) *DatasetsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DatasetsListCall) IfNoneMatch(entityTag string) *DatasetsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsListCall) Context(ctx context.Context) *DatasetsListCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "bigquery.datasets.list" call. +// Exactly one of *DatasetList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DatasetList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DatasetsListCall) Do() (*DatasetList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DatasetList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all datasets in the specified project to which you have been granted the READER dataset role.", + // "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", + // "https://www.googleapis.com/auth/cloud-platform.read-only" + // ] + // } + +} + +// method id "bigquery.datasets.patch": + +type DatasetsPatchCall struct { + s *Service + projectId string + datasetId string + dataset *Dataset + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsPatchCall) Fields(s ...googleapi.Field) *DatasetsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsPatchCall) Context(ctx context.Context) *DatasetsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "datasetId": c.datasetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "bigquery.datasets.patch" call. +// Exactly one of *Dataset or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Dataset.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *DatasetsPatchCall) Do() (*Dataset, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Dataset{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsUpdateCall) Fields(s ...googleapi.Field) *DatasetsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsUpdateCall) Context(ctx context.Context) *DatasetsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "datasetId": c.datasetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "bigquery.datasets.update" call. +// Exactly one of *Dataset or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Dataset.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *DatasetsUpdateCall) Do() (*Dataset, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Dataset{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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.cancel": + +type JobsCancelCall struct { + s *Service + projectId string + jobId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Cancel: Requests that a job be cancelled. This call will return +// immediately, and the client will need to poll for the job status to +// see if the cancel completed successfully. Cancelled jobs may still +// incur costs. +func (r *JobsService) Cancel(projectId string, jobId string) *JobsCancelCall { + c := &JobsCancelCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.jobId = jobId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *JobsCancelCall) Fields(s ...googleapi.Field) *JobsCancelCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *JobsCancelCall) Context(ctx context.Context) *JobsCancelCall { + c.ctx_ = ctx + return c +} + +func (c *JobsCancelCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "project/{projectId}/jobs/{jobId}/cancel") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "jobId": c.jobId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "bigquery.jobs.cancel" call. +// Exactly one of *JobCancelResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *JobCancelResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *JobsCancelCall) Do() (*JobCancelResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &JobCancelResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully. Cancelled jobs may still incur costs.", + // "httpMethod": "POST", + // "id": "bigquery.jobs.cancel", + // "parameterOrder": [ + // "projectId", + // "jobId" + // ], + // "parameters": { + // "jobId": { + // "description": "Job ID of the job to cancel", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID of the job to cancel", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "project/{projectId}/jobs/{jobId}/cancel", + // "response": { + // "$ref": "JobCancelResponse" + // }, + // "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{} + ctx_ context.Context +} + +// Get: Returns information about a specific job. Job information is +// available for a six month period after creation. Requires that you're +// the person who ran the job, or have the Is Owner project role. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *JobsGetCall) Fields(s ...googleapi.Field) *JobsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *JobsGetCall) IfNoneMatch(entityTag string) *JobsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *JobsGetCall) Context(ctx context.Context) *JobsGetCall { + c.ctx_ = ctx + return c +} + +func (c *JobsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/jobs/{jobId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "jobId": c.jobId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "bigquery.jobs.get" call. +// Exactly one of *Job or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Job.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *JobsGetCall) Do() (*Job, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Job{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns information about a specific job. Job information is available for a six month period after creation. Requires that you're the person who ran the job, or have the Is Owner project role.", + // "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", + // "https://www.googleapis.com/auth/cloud-platform.read-only" + // ] + // } + +} + +// method id "bigquery.jobs.getQueryResults": + +type JobsGetQueryResultsCall struct { + s *Service + projectId string + jobId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 10 seconds. If the timeout passes before the job completes, the +// 'jobComplete' field in the response will be false +func (c *JobsGetQueryResultsCall) TimeoutMs(timeoutMs int64) *JobsGetQueryResultsCall { + c.opt_["timeoutMs"] = timeoutMs + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *JobsGetQueryResultsCall) Fields(s ...googleapi.Field) *JobsGetQueryResultsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *JobsGetQueryResultsCall) IfNoneMatch(entityTag string) *JobsGetQueryResultsCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *JobsGetQueryResultsCall) Context(ctx context.Context) *JobsGetQueryResultsCall { + c.ctx_ = ctx + return c +} + +func (c *JobsGetQueryResultsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/queries/{jobId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "jobId": c.jobId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "bigquery.jobs.getQueryResults" call. +// Exactly one of *GetQueryResultsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GetQueryResultsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *JobsGetQueryResultsCall) Do() (*GetQueryResultsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &GetQueryResultsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the 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 10 seconds. If the timeout passes before the job completes, the 'jobComplete' field in the response will be false", + // "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", + // "https://www.googleapis.com/auth/cloud-platform.read-only" + // ] + // } + +} + +// method id "bigquery.jobs.insert": + +type JobsInsertCall struct { + s *Service + projectId string + job *Job + opt_ map[string]interface{} + media_ io.Reader + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// Insert: Starts a new asynchronous job. Requires the Can View project +// role. +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 +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *JobsInsertCall) Media(r io.Reader) *JobsInsertCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *JobsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *JobsInsertCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *JobsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *JobsInsertCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *JobsInsertCall) Fields(s ...googleapi.Field) *JobsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *JobsInsertCall) Context(ctx context.Context) *JobsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *JobsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/jobs") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "bigquery.jobs.insert" call. +// Exactly one of *Job or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Job.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *JobsInsertCall) Do() (*Job, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &Job{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Starts a new asynchronous job. Requires the Can View project role.", + // "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{} + ctx_ context.Context +} + +// List: Lists all jobs that you started in the specified project. Job +// information is available for a six month period after creation. The +// job list is sorted in reverse chronological order, by job creation +// time. Requires the Can View project role, or the Is Owner project +// role if you set the allUsers property. +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 +// +// Possible values: +// "full" - Includes all job data +// "minimal" - Does not include the job configuration +func (c *JobsListCall) Projection(projection string) *JobsListCall { + c.opt_["projection"] = projection + return c +} + +// StateFilter sets the optional parameter "stateFilter": Filter for job +// state +// +// Possible values: +// "done" - Finished jobs +// "pending" - Pending jobs +// "running" - Running jobs +func (c *JobsListCall) StateFilter(stateFilter string) *JobsListCall { + c.opt_["stateFilter"] = stateFilter + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *JobsListCall) Fields(s ...googleapi.Field) *JobsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *JobsListCall) IfNoneMatch(entityTag string) *JobsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *JobsListCall) Context(ctx context.Context) *JobsListCall { + c.ctx_ = ctx + return c +} + +func (c *JobsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/jobs") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "bigquery.jobs.list" call. +// Exactly one of *JobList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *JobList.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *JobsListCall) Do() (*JobList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &JobList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all jobs that you started in the specified project. Job information is available for a six month period after creation. The job list is sorted in reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property.", + // "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", + // "https://www.googleapis.com/auth/cloud-platform.read-only" + // ] + // } + +} + +// method id "bigquery.jobs.query": + +type JobsQueryCall struct { + s *Service + projectId string + queryrequest *QueryRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *JobsQueryCall) Fields(s ...googleapi.Field) *JobsQueryCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *JobsQueryCall) Context(ctx context.Context) *JobsQueryCall { + c.ctx_ = ctx + return c +} + +func (c *JobsQueryCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/queries") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "bigquery.jobs.query" call. +// Exactly one of *QueryResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *QueryResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *JobsQueryCall) Do() (*QueryResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &QueryResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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", + // "https://www.googleapis.com/auth/cloud-platform.read-only" + // ] + // } + +} + +// method id "bigquery.projects.list": + +type ProjectsListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all projects to which you have been granted any project +// role. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsListCall) Fields(s ...googleapi.Field) *ProjectsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsListCall) IfNoneMatch(entityTag string) *ProjectsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsListCall) Context(ctx context.Context) *ProjectsListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "bigquery.projects.list" call. +// Exactly one of *ProjectList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ProjectList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsListCall) Do() (*ProjectList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProjectList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all projects to which you have been granted any project role.", + // "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", + // "https://www.googleapis.com/auth/cloud-platform.read-only" + // ] + // } + +} + +// method id "bigquery.tabledata.insertAll": + +type TabledataInsertAllCall struct { + s *Service + projectId string + datasetId string + tableId string + tabledatainsertallrequest *TableDataInsertAllRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// InsertAll: Streams data into BigQuery one record at a time without +// needing to run a load job. Requires the WRITER dataset role. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TabledataInsertAllCall) Fields(s ...googleapi.Field) *TabledataInsertAllCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TabledataInsertAllCall) Context(ctx context.Context) *TabledataInsertAllCall { + c.ctx_ = ctx + return c +} + +func (c *TabledataInsertAllCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}/tables/{tableId}/insertAll") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "datasetId": c.datasetId, + "tableId": c.tableId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "bigquery.tabledata.insertAll" call. +// Exactly one of *TableDataInsertAllResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TableDataInsertAllResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TabledataInsertAllCall) Do() (*TableDataInsertAllResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TableDataInsertAllResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Streams data into BigQuery one record at a time without needing to run a load job. Requires the WRITER dataset role.", + // "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/bigquery.insertdata", + // "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{} + ctx_ context.Context +} + +// List: Retrieves table data from a specified set of rows. Requires the +// READER dataset role. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TabledataListCall) Fields(s ...googleapi.Field) *TabledataListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TabledataListCall) IfNoneMatch(entityTag string) *TabledataListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TabledataListCall) Context(ctx context.Context) *TabledataListCall { + c.ctx_ = ctx + return c +} + +func (c *TabledataListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "datasetId": c.datasetId, + "tableId": c.tableId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "bigquery.tabledata.list" call. +// Exactly one of *TableDataList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TableDataList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TabledataListCall) Do() (*TableDataList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TableDataList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves table data from a specified set of rows. Requires the READER dataset role.", + // "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", + // "https://www.googleapis.com/auth/cloud-platform.read-only" + // ] + // } + +} + +// method id "bigquery.tables.delete": + +type TablesDeleteCall struct { + s *Service + projectId string + datasetId string + tableId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesDeleteCall) Fields(s ...googleapi.Field) *TablesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesDeleteCall) Context(ctx context.Context) *TablesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TablesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}/tables/{tableId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "datasetId": c.datasetId, + "tableId": c.tableId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "bigquery.tables.delete" call. +func (c *TablesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesGetCall) Fields(s ...googleapi.Field) *TablesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TablesGetCall) IfNoneMatch(entityTag string) *TablesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesGetCall) Context(ctx context.Context) *TablesGetCall { + c.ctx_ = ctx + return c +} + +func (c *TablesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}/tables/{tableId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "datasetId": c.datasetId, + "tableId": c.tableId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "bigquery.tables.get" call. +// Exactly one of *Table or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Table.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TablesGetCall) Do() (*Table, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Table{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the 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", + // "https://www.googleapis.com/auth/cloud-platform.read-only" + // ] + // } + +} + +// method id "bigquery.tables.insert": + +type TablesInsertCall struct { + s *Service + projectId string + datasetId string + table *Table + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesInsertCall) Fields(s ...googleapi.Field) *TablesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesInsertCall) Context(ctx context.Context) *TablesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TablesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}/tables") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "datasetId": c.datasetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "bigquery.tables.insert" call. +// Exactly one of *Table or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Table.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TablesInsertCall) Do() (*Table, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Table{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// List: Lists all tables in the specified dataset. Requires the READER +// dataset role. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesListCall) Fields(s ...googleapi.Field) *TablesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TablesListCall) IfNoneMatch(entityTag string) *TablesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesListCall) Context(ctx context.Context) *TablesListCall { + c.ctx_ = ctx + return c +} + +func (c *TablesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}/tables") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "datasetId": c.datasetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "bigquery.tables.list" call. +// Exactly one of *TableList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TableList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TablesListCall) Do() (*TableList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TableList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all tables in the specified dataset. Requires the READER dataset role.", + // "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", + // "https://www.googleapis.com/auth/cloud-platform.read-only" + // ] + // } + +} + +// method id "bigquery.tables.patch": + +type TablesPatchCall struct { + s *Service + projectId string + datasetId string + tableId string + table *Table + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesPatchCall) Fields(s ...googleapi.Field) *TablesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesPatchCall) Context(ctx context.Context) *TablesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *TablesPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}/tables/{tableId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "datasetId": c.datasetId, + "tableId": c.tableId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "bigquery.tables.patch" call. +// Exactly one of *Table or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Table.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TablesPatchCall) Do() (*Table, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Table{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesUpdateCall) Fields(s ...googleapi.Field) *TablesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesUpdateCall) Context(ctx context.Context) *TablesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *TablesUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/datasets/{datasetId}/tables/{tableId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "datasetId": c.datasetId, + "tableId": c.tableId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "bigquery.tables.update" call. +// Exactly one of *Table or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Table.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TablesUpdateCall) Do() (*Table, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Table{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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/Godeps/_workspace/src/google.golang.org/api/blogger/v2/blogger-api.json b/Godeps/_workspace/src/google.golang.org/api/blogger/v2/blogger-api.json new file mode 100644 index 000000000..d1bcc5d58 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/blogger/v2/blogger-api.json @@ -0,0 +1,923 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"uUWyYHXmEn-ab7WLvo8qNz2S8ws/sAKs5msKBJR7SX4fg3Ahfyr5uno\"", + "discoveryVersion": "v1", + "id": "blogger:v2", + "name": "blogger", + "version": "v2", + "revision": "20140827", + "title": "Blogger API", + "description": "API for access to the data within Blogger.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/blogger-16.png", + "x32": "https://www.google.com/images/icons/product/blogger-32.png" + }, + "documentationLink": "https://developers.google.com/blogger/docs/2.0/json/getting_started", + "labels": [ + "limited_availability" + ], + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/blogger/v2/", + "basePath": "/blogger/v2/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "blogger/v2/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json" + ], + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.", + "location": "query" + }, + "userIp": { + "type": "string", + "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.", + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/blogger": { + "description": "Manage your Blogger account" + } + } + } + }, + "schemas": { + "Blog": { + "id": "Blog", + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "The description of this blog. This is displayed underneath the title." + }, + "id": { + "type": "string", + "description": "The identifier for this resource.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "The kind of this entry. Always blogger#blog", + "default": "blogger#blog" + }, + "locale": { + "type": "object", + "description": "The locale this Blog is set to.", + "properties": { + "country": { + "type": "string", + "description": "The country this blog's locale is set to." + }, + "language": { + "type": "string", + "description": "The language this blog is authored in." + }, + "variant": { + "type": "string", + "description": "The language variant this blog is authored in." + } + } + }, + "name": { + "type": "string", + "description": "The name of this blog. This is displayed as the title." + }, + "pages": { + "type": "object", + "description": "The container of pages in this blog.", + "properties": { + "selfLink": { + "type": "string", + "description": "The URL of the container for pages in this blog." + }, + "totalItems": { + "type": "integer", + "description": "The count of pages in this blog.", + "format": "int32" + } + } + }, + "posts": { + "type": "object", + "description": "The container of posts in this blog.", + "properties": { + "selfLink": { + "type": "string", + "description": "The URL of the container for posts in this blog." + }, + "totalItems": { + "type": "integer", + "description": "The count of posts in this blog.", + "format": "int32" + } + } + }, + "published": { + "type": "string", + "description": "RFC 3339 date-time when this blog was published.", + "format": "date-time" + }, + "selfLink": { + "type": "string", + "description": "The API REST URL to fetch this resource from." + }, + "updated": { + "type": "string", + "description": "RFC 3339 date-time when this blog was last updated.", + "format": "date-time" + }, + "url": { + "type": "string", + "description": "The URL where this blog is published." + } + } + }, + "BlogList": { + "id": "BlogList", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "The list of Blogs this user has Authorship or Admin rights over.", + "items": { + "$ref": "Blog" + } + }, + "kind": { + "type": "string", + "description": "The kind of this entity. Always blogger#blogList", + "default": "blogger#blogList" + } + } + }, + "Comment": { + "id": "Comment", + "type": "object", + "properties": { + "author": { + "type": "object", + "description": "The author of this Comment.", + "properties": { + "displayName": { + "type": "string", + "description": "The display name." + }, + "id": { + "type": "string", + "description": "The identifier of the Comment creator." + }, + "image": { + "type": "object", + "description": "The comment creator's avatar.", + "properties": { + "url": { + "type": "string", + "description": "The comment creator's avatar URL." + } + } + }, + "url": { + "type": "string", + "description": "The URL of the Comment creator's Profile page." + } + } + }, + "blog": { + "type": "object", + "description": "Data about the blog containing this comment.", + "properties": { + "id": { + "type": "string", + "description": "The identifier of the blog containing this comment.", + "format": "int64" + } + } + }, + "content": { + "type": "string", + "description": "The actual content of the comment. May include HTML markup." + }, + "id": { + "type": "string", + "description": "The identifier for this resource.", + "format": "int64" + }, + "inReplyTo": { + "type": "object", + "description": "Data about the comment this is in reply to.", + "properties": { + "id": { + "type": "string", + "description": "The identified of the parent of this comment.", + "format": "int64" + } + } + }, + "kind": { + "type": "string", + "description": "The kind of this entry. Always blogger#comment", + "default": "blogger#comment" + }, + "post": { + "type": "object", + "description": "Data about the post containing this comment.", + "properties": { + "id": { + "type": "string", + "description": "The identifier of the post containing this comment.", + "format": "int64" + } + } + }, + "published": { + "type": "string", + "description": "RFC 3339 date-time when this comment was published.", + "format": "date-time" + }, + "selfLink": { + "type": "string", + "description": "The API REST URL to fetch this resource from." + }, + "updated": { + "type": "string", + "description": "RFC 3339 date-time when this comment was last updated.", + "format": "date-time" + } + } + }, + "CommentList": { + "id": "CommentList", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "The List of Comments for a Post.", + "items": { + "$ref": "Comment" + } + }, + "kind": { + "type": "string", + "description": "The kind of this entry. Always blogger#commentList", + "default": "blogger#commentList" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to fetch the next page, if one exists." + }, + "prevPageToken": { + "type": "string", + "description": "Pagination token to fetch the previous page, if one exists." + } + } + }, + "Page": { + "id": "Page", + "type": "object", + "properties": { + "author": { + "type": "object", + "description": "The author of this Page.", + "properties": { + "displayName": { + "type": "string", + "description": "The display name." + }, + "id": { + "type": "string", + "description": "The identifier of the Page creator." + }, + "image": { + "type": "object", + "description": "The page author's avatar.", + "properties": { + "url": { + "type": "string", + "description": "The page author's avatar URL." + } + } + }, + "url": { + "type": "string", + "description": "The URL of the Page creator's Profile page." + } + } + }, + "blog": { + "type": "object", + "description": "Data about the blog containing this Page.", + "properties": { + "id": { + "type": "string", + "description": "The identifier of the blog containing this page.", + "format": "int64" + } + } + }, + "content": { + "type": "string", + "description": "The body content of this Page, in HTML." + }, + "id": { + "type": "string", + "description": "The identifier for this resource.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "The kind of this entity. Always blogger#page", + "default": "blogger#page" + }, + "published": { + "type": "string", + "description": "RFC 3339 date-time when this Page was published.", + "format": "date-time" + }, + "selfLink": { + "type": "string", + "description": "The API REST URL to fetch this resource from." + }, + "title": { + "type": "string", + "description": "The title of this entity. This is the name displayed in the Admin user interface." + }, + "updated": { + "type": "string", + "description": "RFC 3339 date-time when this Page was last updated.", + "format": "date-time" + }, + "url": { + "type": "string", + "description": "The URL that this Page is displayed at." + } + } + }, + "PageList": { + "id": "PageList", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "The list of Pages for a Blog.", + "items": { + "$ref": "Page" + } + }, + "kind": { + "type": "string", + "description": "The kind of this entity. Always blogger#pageList", + "default": "blogger#pageList" + } + } + }, + "Post": { + "id": "Post", + "type": "object", + "properties": { + "author": { + "type": "object", + "description": "The author of this Post.", + "properties": { + "displayName": { + "type": "string", + "description": "The display name." + }, + "id": { + "type": "string", + "description": "The identifier of the Post creator." + }, + "image": { + "type": "object", + "description": "The Post author's avatar.", + "properties": { + "url": { + "type": "string", + "description": "The Post author's avatar URL." + } + } + }, + "url": { + "type": "string", + "description": "The URL of the Post creator's Profile page." + } + } + }, + "blog": { + "type": "object", + "description": "Data about the blog containing this Post.", + "properties": { + "id": { + "type": "string", + "description": "The identifier of the Blog that contains this Post.", + "format": "int64" + } + } + }, + "content": { + "type": "string", + "description": "The content of the Post. May contain HTML markup." + }, + "id": { + "type": "string", + "description": "The identifier of this Post.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "The kind of this entity. Always blogger#post", + "default": "blogger#post" + }, + "labels": { + "type": "array", + "description": "The list of labels this Post was tagged with.", + "items": { + "type": "string" + } + }, + "published": { + "type": "string", + "description": "RFC 3339 date-time when this Post was published.", + "format": "date-time" + }, + "replies": { + "type": "object", + "description": "The container of comments on this Post.", + "properties": { + "selfLink": { + "type": "string", + "description": "The URL of the comments on this post." + }, + "totalItems": { + "type": "string", + "description": "The count of comments on this post.", + "format": "int64" + } + } + }, + "selfLink": { + "type": "string", + "description": "The API REST URL to fetch this resource from." + }, + "title": { + "type": "string", + "description": "The title of the Post." + }, + "updated": { + "type": "string", + "description": "RFC 3339 date-time when this Post was last updated.", + "format": "date-time" + }, + "url": { + "type": "string", + "description": "The URL where this Post is displayed." + } + } + }, + "PostList": { + "id": "PostList", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "The list of Posts for this Blog.", + "items": { + "$ref": "Post" + } + }, + "kind": { + "type": "string", + "description": "The kind of this entity. Always blogger#postList", + "default": "blogger#postList" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to fetch the next page, if one exists." + }, + "prevPageToken": { + "type": "string", + "description": "Pagination token to fetch the previous page, if one exists." + } + } + }, + "User": { + "id": "User", + "type": "object", + "properties": { + "about": { + "type": "string", + "description": "Profile summary information." + }, + "blogs": { + "type": "object", + "description": "The container of blogs for this user.", + "properties": { + "selfLink": { + "type": "string", + "description": "The URL of the Blogs for this user." + } + } + }, + "created": { + "type": "string", + "description": "The timestamp of when this profile was created, in seconds since epoch.", + "format": "date-time" + }, + "displayName": { + "type": "string", + "description": "The display name." + }, + "id": { + "type": "string", + "description": "The identifier for this User." + }, + "kind": { + "type": "string", + "description": "The kind of this entity. Always blogger#user", + "default": "blogger#user" + }, + "locale": { + "type": "object", + "description": "This user's locale", + "properties": { + "country": { + "type": "string", + "description": "The user's country setting." + }, + "language": { + "type": "string", + "description": "The user's language setting." + }, + "variant": { + "type": "string", + "description": "The user's language variant setting." + } + } + }, + "selfLink": { + "type": "string", + "description": "The API REST URL to fetch this resource from." + }, + "url": { + "type": "string", + "description": "The user's profile page." + } + } + } + }, + "resources": { + "blogs": { + "methods": { + "get": { + "id": "blogger.blogs.get", + "path": "blogs/{blogId}", + "httpMethod": "GET", + "description": "Gets one blog by id.", + "parameters": { + "blogId": { + "type": "string", + "description": "The ID of the blog to get.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId" + ], + "response": { + "$ref": "Blog" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + } + } + }, + "comments": { + "methods": { + "get": { + "id": "blogger.comments.get", + "path": "blogs/{blogId}/posts/{postId}/comments/{commentId}", + "httpMethod": "GET", + "description": "Gets one comment by id.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog to containing the comment.", + "required": true, + "location": "path" + }, + "commentId": { + "type": "string", + "description": "The ID of the comment to get.", + "required": true, + "location": "path" + }, + "postId": { + "type": "string", + "description": "ID of the post to fetch posts from.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "postId", + "commentId" + ], + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "list": { + "id": "blogger.comments.list", + "path": "blogs/{blogId}/posts/{postId}/comments", + "httpMethod": "GET", + "description": "Retrieves the comments for a blog, possibly filtered.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog to fetch comments from.", + "required": true, + "location": "path" + }, + "fetchBodies": { + "type": "boolean", + "description": "Whether the body content of the comments is included.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of comments to include in the result.", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Continuation token if request is paged.", + "location": "query" + }, + "postId": { + "type": "string", + "description": "ID of the post to fetch posts from.", + "required": true, + "location": "path" + }, + "startDate": { + "type": "string", + "description": "Earliest date of comment to fetch, a date-time with RFC 3339 formatting.", + "format": "date-time", + "location": "query" + } + }, + "parameterOrder": [ + "blogId", + "postId" + ], + "response": { + "$ref": "CommentList" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + } + } + }, + "pages": { + "methods": { + "get": { + "id": "blogger.pages.get", + "path": "blogs/{blogId}/pages/{pageId}", + "httpMethod": "GET", + "description": "Gets one blog page by id.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog containing the page.", + "required": true, + "location": "path" + }, + "pageId": { + "type": "string", + "description": "The ID of the page to get.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "pageId" + ], + "response": { + "$ref": "Page" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "list": { + "id": "blogger.pages.list", + "path": "blogs/{blogId}/pages", + "httpMethod": "GET", + "description": "Retrieves pages for a blog, possibly filtered.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog to fetch pages from.", + "required": true, + "location": "path" + }, + "fetchBodies": { + "type": "boolean", + "description": "Whether to retrieve the Page bodies.", + "location": "query" + } + }, + "parameterOrder": [ + "blogId" + ], + "response": { + "$ref": "PageList" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + } + } + }, + "posts": { + "methods": { + "get": { + "id": "blogger.posts.get", + "path": "blogs/{blogId}/posts/{postId}", + "httpMethod": "GET", + "description": "Get a post by id.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog to fetch the post from.", + "required": true, + "location": "path" + }, + "postId": { + "type": "string", + "description": "The ID of the post", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "blogId", + "postId" + ], + "response": { + "$ref": "Post" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "list": { + "id": "blogger.posts.list", + "path": "blogs/{blogId}/posts", + "httpMethod": "GET", + "description": "Retrieves a list of posts, possibly filtered.", + "parameters": { + "blogId": { + "type": "string", + "description": "ID of the blog to fetch posts from.", + "required": true, + "location": "path" + }, + "fetchBodies": { + "type": "boolean", + "description": "Whether the body content of posts is included.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of posts to fetch.", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Continuation token if the request is paged.", + "location": "query" + }, + "startDate": { + "type": "string", + "description": "Earliest post date to fetch, a date-time with RFC 3339 formatting.", + "format": "date-time", + "location": "query" + } + }, + "parameterOrder": [ + "blogId" + ], + "response": { + "$ref": "PostList" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + } + } + }, + "users": { + "methods": { + "get": { + "id": "blogger.users.get", + "path": "users/{userId}", + "httpMethod": "GET", + "description": "Gets one user by id.", + "parameters": { + "userId": { + "type": "string", + "description": "The ID of the user to get.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "User" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + } + }, + "resources": { + "blogs": { + "methods": { + "list": { + "id": "blogger.users.blogs.list", + "path": "users/{userId}/blogs", + "httpMethod": "GET", + "description": "Retrieves a list of blogs, possibly filtered.", + "parameters": { + "userId": { + "type": "string", + "description": "ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "BlogList" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + } + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/blogger/v2/blogger-gen.go b/Godeps/_workspace/src/google.golang.org/api/blogger/v2/blogger-gen.go new file mode 100644 index 000000000..05b8f6448 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/blogger/v2/blogger-gen.go @@ -0,0 +1,2236 @@ +// Package blogger provides access to the Blogger API. +// +// See https://developers.google.com/blogger/docs/2.0/json/getting_started +// +// Usage example: +// +// import "google.golang.org/api/blogger/v2" +// ... +// bloggerService, err := blogger.New(oauthHttpClient) +package blogger // import "google.golang.org/api/blogger/v2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Blogs *BlogsService + + Comments *CommentsService + + Pages *PagesService + + Posts *PostsService + + Users *UsersService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Blog) MarshalJSON() ([]byte, error) { + type noMethod Blog + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BlogLocale: The locale this Blog is set to. +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"` + + // ForceSendFields is a list of field names (e.g. "Country") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BlogLocale) MarshalJSON() ([]byte, error) { + type noMethod BlogLocale + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BlogPages: The container of pages in this blog. +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"` + + // ForceSendFields is a list of field names (e.g. "SelfLink") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BlogPages) MarshalJSON() ([]byte, error) { + type noMethod BlogPages + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BlogPosts: The container of posts in this blog. +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"` + + // ForceSendFields is a list of field names (e.g. "SelfLink") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BlogPosts) MarshalJSON() ([]byte, error) { + type noMethod BlogPosts + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BlogList) MarshalJSON() ([]byte, error) { + type noMethod BlogList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Author") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Comment) MarshalJSON() ([]byte, error) { + type noMethod Comment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentAuthor: The author of this Comment. +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"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentAuthor) MarshalJSON() ([]byte, error) { + type noMethod CommentAuthor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentAuthorImage: The comment creator's avatar. +type CommentAuthorImage struct { + // Url: The comment creator's avatar URL. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Url") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentAuthorImage) MarshalJSON() ([]byte, error) { + type noMethod CommentAuthorImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentBlog: Data about the blog containing this comment. +type CommentBlog struct { + // Id: The identifier of the blog containing this comment. + Id int64 `json:"id,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentBlog) MarshalJSON() ([]byte, error) { + type noMethod CommentBlog + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentInReplyTo: Data about the comment this is in reply to. +type CommentInReplyTo struct { + // Id: The identified of the parent of this comment. + Id int64 `json:"id,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentInReplyTo) MarshalJSON() ([]byte, error) { + type noMethod CommentInReplyTo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentPost: Data about the post containing this comment. +type CommentPost struct { + // Id: The identifier of the post containing this comment. + Id int64 `json:"id,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentPost) MarshalJSON() ([]byte, error) { + type noMethod CommentPost + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentList) MarshalJSON() ([]byte, error) { + type noMethod CommentList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Author") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Page) MarshalJSON() ([]byte, error) { + type noMethod Page + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PageAuthor: The author of this Page. +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"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PageAuthor) MarshalJSON() ([]byte, error) { + type noMethod PageAuthor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PageAuthorImage: The page author's avatar. +type PageAuthorImage struct { + // Url: The page author's avatar URL. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Url") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PageAuthorImage) MarshalJSON() ([]byte, error) { + type noMethod PageAuthorImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PageBlog: Data about the blog containing this Page. +type PageBlog struct { + // Id: The identifier of the blog containing this page. + Id int64 `json:"id,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PageBlog) MarshalJSON() ([]byte, error) { + type noMethod PageBlog + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PageList) MarshalJSON() ([]byte, error) { + type noMethod PageList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Author") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Post) MarshalJSON() ([]byte, error) { + type noMethod Post + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PostAuthor: The author of this Post. +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"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostAuthor) MarshalJSON() ([]byte, error) { + type noMethod PostAuthor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PostAuthorImage: The Post author's avatar. +type PostAuthorImage struct { + // Url: The Post author's avatar URL. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Url") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostAuthorImage) MarshalJSON() ([]byte, error) { + type noMethod PostAuthorImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PostBlog: Data about the blog containing this Post. +type PostBlog struct { + // Id: The identifier of the Blog that contains this Post. + Id int64 `json:"id,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostBlog) MarshalJSON() ([]byte, error) { + type noMethod PostBlog + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PostReplies: The container of comments on this Post. +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"` + + // ForceSendFields is a list of field names (e.g. "SelfLink") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostReplies) MarshalJSON() ([]byte, error) { + type noMethod PostReplies + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostList) MarshalJSON() ([]byte, error) { + type noMethod PostList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "About") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *User) MarshalJSON() ([]byte, error) { + type noMethod User + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserBlogs: The container of blogs for this user. +type UserBlogs struct { + // SelfLink: The URL of the Blogs for this user. + SelfLink string `json:"selfLink,omitempty"` + + // ForceSendFields is a list of field names (e.g. "SelfLink") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserBlogs) MarshalJSON() ([]byte, error) { + type noMethod UserBlogs + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserLocale: This user's locale +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"` + + // ForceSendFields is a list of field names (e.g. "Country") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserLocale) MarshalJSON() ([]byte, error) { + type noMethod UserLocale + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "blogger.blogs.get": + +type BlogsGetCall struct { + s *Service + blogId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BlogsGetCall) Fields(s ...googleapi.Field) *BlogsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BlogsGetCall) IfNoneMatch(entityTag string) *BlogsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BlogsGetCall) Context(ctx context.Context) *BlogsGetCall { + c.ctx_ = ctx + return c +} + +func (c *BlogsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.blogs.get" call. +// Exactly one of *Blog or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Blog.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *BlogsGetCall) Do() (*Blog, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Blog{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsGetCall) Fields(s ...googleapi.Field) *CommentsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CommentsGetCall) IfNoneMatch(entityTag string) *CommentsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsGetCall) Context(ctx context.Context) *CommentsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + "commentId": c.commentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.comments.get" call. +// Exactly one of *Comment or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Comment.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CommentsGetCall) Do() (*Comment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Comment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CommentsListCall) IfNoneMatch(entityTag string) *CommentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsListCall) Context(ctx context.Context) *CommentsListCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.comments.list" call. +// Exactly one of *CommentList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CommentList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CommentsListCall) Do() (*CommentList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CommentList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PagesGetCall) Fields(s ...googleapi.Field) *PagesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PagesGetCall) IfNoneMatch(entityTag string) *PagesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PagesGetCall) Context(ctx context.Context) *PagesGetCall { + c.ctx_ = ctx + return c +} + +func (c *PagesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "pageId": c.pageId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.pages.get" call. +// Exactly one of *Page or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Page.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PagesGetCall) Do() (*Page, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Page{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PagesListCall) Fields(s ...googleapi.Field) *PagesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PagesListCall) IfNoneMatch(entityTag string) *PagesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PagesListCall) Context(ctx context.Context) *PagesListCall { + c.ctx_ = ctx + return c +} + +func (c *PagesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fetchBodies"]; ok { + params.Set("fetchBodies", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.pages.list" call. +// Exactly one of *PageList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *PageList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PagesListCall) Do() (*PageList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PageList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsGetCall) Fields(s ...googleapi.Field) *PostsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PostsGetCall) IfNoneMatch(entityTag string) *PostsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsGetCall) Context(ctx context.Context) *PostsGetCall { + c.ctx_ = ctx + return c +} + +func (c *PostsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.get" call. +// Exactly one of *Post or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Post.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PostsGetCall) Do() (*Post, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Post{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsListCall) Fields(s ...googleapi.Field) *PostsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PostsListCall) IfNoneMatch(entityTag string) *PostsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsListCall) Context(ctx context.Context) *PostsListCall { + c.ctx_ = ctx + return c +} + +func (c *PostsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.list" call. +// Exactly one of *PostList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *PostList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PostsListCall) Do() (*PostList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PostList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall { + c.ctx_ = ctx + return c +} + +func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.users.get" call. +// Exactly one of *User or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *User.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *UsersGetCall) Do() (*User, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &User{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersBlogsListCall) Fields(s ...googleapi.Field) *UsersBlogsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersBlogsListCall) IfNoneMatch(entityTag string) *UsersBlogsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersBlogsListCall) Context(ctx context.Context) *UsersBlogsListCall { + c.ctx_ = ctx + return c +} + +func (c *UsersBlogsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.users.blogs.list" call. +// Exactly one of *BlogList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *BlogList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersBlogsListCall) Do() (*BlogList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BlogList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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/Godeps/_workspace/src/google.golang.org/api/blogger/v3/blogger-api.json b/Godeps/_workspace/src/google.golang.org/api/blogger/v3/blogger-api.json new file mode 100644 index 000000000..069814beb --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/blogger/v3/blogger-api.json @@ -0,0 +1,2507 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/ZRgj7Ah7gwQETAdvqLpx-xGEmV8\"", + "discoveryVersion": "v1", + "id": "blogger:v3", + "name": "blogger", + "version": "v3", + "revision": "20150422", + "title": "Blogger API", + "description": "API for access to the data within Blogger.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/blogger-16.png", + "x32": "https://www.google.com/images/icons/product/blogger-32.png" + }, + "documentationLink": "https://developers.google.com/blogger/docs/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." + }, + "status": { + "type": "string", + "description": "The status of the blog." + }, + "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": { + "etag": { + "type": "string", + "description": "Etag of the response." + }, + "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." + }, + "etag": { + "type": "string", + "description": "Etag of the resource." + }, + "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": { + "etag": { + "type": "string", + "description": "Etag of the response." + }, + "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" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to fetch the next page, if one exists." + } + } + }, + "Pageviews": { + "id": "Pageviews", + "type": "object", + "properties": { + "blogId": { + "type": "string", + "description": "Blog Id" + }, + "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." + }, + "etag": { + "type": "string", + "description": "Etag of the resource." + }, + "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" + }, + "readerComments": { + "type": "string", + "description": "Comment control and display setting for readers of this post." + }, + "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": { + "etag": { + "type": "string", + "description": "Etag of the response." + }, + "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 blog. 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 blog. 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 - Blogs where the user has Admin level access.", + "Author role - Blogs where the user has Author level access.", + "Reader role - Blogs where the user has Reader level access (to a private blog)." + ], + "repeated": true, + "location": "query" + }, + "status": { + "type": "string", + "description": "Blog statuses to include in the result (default: Live blogs only). Note that ADMIN access is required to view deleted blogs.", + "default": "LIVE", + "enum": [ + "DELETED", + "LIVE" + ], + "enumDescriptions": [ + "Blog has been deleted by an administrator.", + "Blog is currently live." + ], + "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" + }, + "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" + } + }, + "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" + }, + "isDraft": { + "type": "boolean", + "description": "Whether to create the page as a draft (default: false).", + "location": "query" + } + }, + "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" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of Pages to fetch.", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Continuation token if the request is paged.", + "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" + }, + "publish": { + "type": "boolean", + "description": "Whether a publish action should be performed when the page is updated (default: false).", + "location": "query" + }, + "revert": { + "type": "boolean", + "description": "Whether a revert action should be performed when the page is updated (default: false).", + "location": "query" + } + }, + "parameterOrder": [ + "blogId", + "pageId" + ], + "request": { + "$ref": "Page" + }, + "response": { + "$ref": "Page" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "publish": { + "id": "blogger.pages.publish", + "path": "blogs/{blogId}/pages/{pageId}/publish", + "httpMethod": "POST", + "description": "Publishes a draft 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" + ], + "response": { + "$ref": "Page" + }, + "scopes": [ + "https://www.googleapis.com/auth/blogger" + ] + }, + "revert": { + "id": "blogger.pages.revert", + "path": "blogs/{blogId}/pages/{pageId}/revert", + "httpMethod": "POST", + "description": "Revert a published or scheduled page to draft state.", + "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" + ], + "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" + }, + "publish": { + "type": "boolean", + "description": "Whether a publish action should be performed when the page is updated (default: false).", + "location": "query" + }, + "revert": { + "type": "boolean", + "description": "Whether a revert action should be performed when the page is updated (default: false).", + "location": "query" + } + }, + "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": "Publishes a draft post, optionally at the specific time of the given publishDate parameter.", + "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": "Optional date and time to schedule the publishing of the Blog. If no publishDate parameter is given, the post is either published at the a previously saved schedule date (if present), or the current time. If a future date is given, the post will be scheduled to be published.", + "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/Godeps/_workspace/src/google.golang.org/api/blogger/v3/blogger-gen.go b/Godeps/_workspace/src/google.golang.org/api/blogger/v3/blogger-gen.go new file mode 100644 index 000000000..d66ef0911 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/blogger/v3/blogger-gen.go @@ -0,0 +1,7012 @@ +// Package blogger provides access to the Blogger API. +// +// See https://developers.google.com/blogger/docs/3.0/getting_started +// +// Usage example: +// +// import "google.golang.org/api/blogger/v3" +// ... +// bloggerService, err := blogger.New(oauthHttpClient) +package blogger // import "google.golang.org/api/blogger/v3" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + BlogUserInfos *BlogUserInfosService + + Blogs *BlogsService + + Comments *CommentsService + + PageViews *PageViewsService + + Pages *PagesService + + PostUserInfos *PostUserInfosService + + Posts *PostsService + + Users *UsersService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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"` + + // Status: The status of the blog. + Status string `json:"status,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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CustomMetaData") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Blog) MarshalJSON() ([]byte, error) { + type noMethod Blog + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BlogLocale: The locale this Blog is set to. +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"` + + // ForceSendFields is a list of field names (e.g. "Country") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BlogLocale) MarshalJSON() ([]byte, error) { + type noMethod BlogLocale + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BlogPages: The container of pages in this blog. +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"` + + // ForceSendFields is a list of field names (e.g. "SelfLink") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BlogPages) MarshalJSON() ([]byte, error) { + type noMethod BlogPages + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BlogPosts: The container of posts in this blog. +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"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BlogPosts) MarshalJSON() ([]byte, error) { + type noMethod BlogPosts + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BlogUserInfos") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BlogList) MarshalJSON() ([]byte, error) { + type noMethod BlogList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "BlogId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BlogPerUserInfo) MarshalJSON() ([]byte, error) { + type noMethod BlogPerUserInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type BlogUserInfo struct { + // Blog: The Blog resource. + Blog *Blog `json:"blog,omitempty"` + + // BlogUserInfo: Information about a User for the Blog. + BlogUserInfo *BlogPerUserInfo `json:"blog_user_info,omitempty"` + + // Kind: The kind of this entity. Always blogger#blogUserInfo + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Blog") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BlogUserInfo) MarshalJSON() ([]byte, error) { + type noMethod BlogUserInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Author") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Comment) MarshalJSON() ([]byte, error) { + type noMethod Comment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentAuthor: The author of this Comment. +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"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentAuthor) MarshalJSON() ([]byte, error) { + type noMethod CommentAuthor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentAuthorImage: The comment creator's avatar. +type CommentAuthorImage struct { + // Url: The comment creator's avatar URL. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Url") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentAuthorImage) MarshalJSON() ([]byte, error) { + type noMethod CommentAuthorImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentBlog: Data about the blog containing this comment. +type CommentBlog struct { + // Id: The identifier of the blog containing this comment. + Id string `json:"id,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentBlog) MarshalJSON() ([]byte, error) { + type noMethod CommentBlog + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentInReplyTo: Data about the comment this is in reply to. +type CommentInReplyTo struct { + // Id: The identified of the parent of this comment. + Id string `json:"id,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentInReplyTo) MarshalJSON() ([]byte, error) { + type noMethod CommentInReplyTo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentPost: Data about the post containing this comment. +type CommentPost struct { + // Id: The identifier of the post containing this comment. + Id string `json:"id,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentPost) MarshalJSON() ([]byte, error) { + type noMethod CommentPost + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type CommentList struct { + // Etag: Etag of the response. + Etag string `json:"etag,omitempty"` + + // 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentList) MarshalJSON() ([]byte, error) { + type noMethod CommentList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // Etag: Etag of the resource. + Etag string `json:"etag,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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Author") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Page) MarshalJSON() ([]byte, error) { + type noMethod Page + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PageAuthor: The author of this Page. +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"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PageAuthor) MarshalJSON() ([]byte, error) { + type noMethod PageAuthor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PageAuthorImage: The page author's avatar. +type PageAuthorImage struct { + // Url: The page author's avatar URL. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Url") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PageAuthorImage) MarshalJSON() ([]byte, error) { + type noMethod PageAuthorImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PageBlog: Data about the blog containing this Page. +type PageBlog struct { + // Id: The identifier of the blog containing this page. + Id string `json:"id,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PageBlog) MarshalJSON() ([]byte, error) { + type noMethod PageBlog + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PageList struct { + // Etag: Etag of the response. + Etag string `json:"etag,omitempty"` + + // 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"` + + // NextPageToken: Pagination token to fetch the next page, if one + // exists. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PageList) MarshalJSON() ([]byte, error) { + type noMethod PageList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Pageviews struct { + // BlogId: Blog Id + BlogId string `json:"blogId,omitempty"` + + // 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BlogId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Pageviews) MarshalJSON() ([]byte, error) { + type noMethod Pageviews + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Count") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PageviewsCounts) MarshalJSON() ([]byte, error) { + type noMethod PageviewsCounts + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // Etag: Etag of the resource. + Etag string `json:"etag,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"` + + // ReaderComments: Comment control and display setting for readers of + // this post. + ReaderComments string `json:"readerComments,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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Author") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Post) MarshalJSON() ([]byte, error) { + type noMethod Post + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PostAuthor: The author of this Post. +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"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostAuthor) MarshalJSON() ([]byte, error) { + type noMethod PostAuthor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PostAuthorImage: The Post author's avatar. +type PostAuthorImage struct { + // Url: The Post author's avatar URL. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Url") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostAuthorImage) MarshalJSON() ([]byte, error) { + type noMethod PostAuthorImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PostBlog: Data about the blog containing this Post. +type PostBlog struct { + // Id: The identifier of the Blog that contains this Post. + Id string `json:"id,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostBlog) MarshalJSON() ([]byte, error) { + type noMethod PostBlog + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PostImages struct { + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Url") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostImages) MarshalJSON() ([]byte, error) { + type noMethod PostImages + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PostLocation: The location for geotagged posts. +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"` + + // ForceSendFields is a list of field names (e.g. "Lat") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostLocation) MarshalJSON() ([]byte, error) { + type noMethod PostLocation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PostReplies: The container of comments on this Post. +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"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostReplies) MarshalJSON() ([]byte, error) { + type noMethod PostReplies + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PostList struct { + // Etag: Etag of the response. + Etag string `json:"etag,omitempty"` + + // 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostList) MarshalJSON() ([]byte, error) { + type noMethod PostList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "BlogId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostPerUserInfo) MarshalJSON() ([]byte, error) { + type noMethod PostPerUserInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // PostUserInfo: Information about a User for the Post. + PostUserInfo *PostPerUserInfo `json:"post_user_info,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostUserInfo) MarshalJSON() ([]byte, error) { + type noMethod PostUserInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostUserInfosList) MarshalJSON() ([]byte, error) { + type noMethod PostUserInfosList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "About") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *User) MarshalJSON() ([]byte, error) { + type noMethod User + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserBlogs: The container of blogs for this user. +type UserBlogs struct { + // SelfLink: The URL of the Blogs for this user. + SelfLink string `json:"selfLink,omitempty"` + + // ForceSendFields is a list of field names (e.g. "SelfLink") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserBlogs) MarshalJSON() ([]byte, error) { + type noMethod UserBlogs + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserLocale: This user's locale +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"` + + // ForceSendFields is a list of field names (e.g. "Country") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserLocale) MarshalJSON() ([]byte, error) { + type noMethod UserLocale + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "blogger.blogUserInfos.get": + +type BlogUserInfosGetCall struct { + s *Service + userId string + blogId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BlogUserInfosGetCall) Fields(s ...googleapi.Field) *BlogUserInfosGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BlogUserInfosGetCall) IfNoneMatch(entityTag string) *BlogUserInfosGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BlogUserInfosGetCall) Context(ctx context.Context) *BlogUserInfosGetCall { + c.ctx_ = ctx + return c +} + +func (c *BlogUserInfosGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxPosts"]; ok { + params.Set("maxPosts", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.blogUserInfos.get" call. +// Exactly one of *BlogUserInfo or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *BlogUserInfo.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *BlogUserInfosGetCall) Do() (*BlogUserInfo, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BlogUserInfo{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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 blog. Note that some fields require elevated access. +// +// Possible values: +// "ADMIN" - Admin level detail. +// "AUTHOR" - Author level detail. +// "READER" - Reader level detail. +func (c *BlogsGetCall) View(view string) *BlogsGetCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BlogsGetCall) Fields(s ...googleapi.Field) *BlogsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BlogsGetCall) IfNoneMatch(entityTag string) *BlogsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BlogsGetCall) Context(ctx context.Context) *BlogsGetCall { + c.ctx_ = ctx + return c +} + +func (c *BlogsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.blogs.get" call. +// Exactly one of *Blog or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Blog.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *BlogsGetCall) Do() (*Blog, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Blog{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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 blog. 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{} + ctx_ context.Context +} + +// 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 blog. Note that some fields require elevated access. +// +// Possible values: +// "ADMIN" - Admin level detail. +// "AUTHOR" - Author level detail. +// "READER" - Reader level detail. +func (c *BlogsGetByUrlCall) View(view string) *BlogsGetByUrlCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BlogsGetByUrlCall) Fields(s ...googleapi.Field) *BlogsGetByUrlCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BlogsGetByUrlCall) IfNoneMatch(entityTag string) *BlogsGetByUrlCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BlogsGetByUrlCall) Context(ctx context.Context) *BlogsGetByUrlCall { + c.ctx_ = ctx + return c +} + +func (c *BlogsGetByUrlCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("url", fmt.Sprintf("%v", c.url)) + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/byurl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.blogs.getByUrl" call. +// Exactly one of *Blog or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Blog.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *BlogsGetByUrlCall) Do() (*Blog, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Blog{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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 blog. 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "ADMIN" - Admin role - Blogs where the user has Admin level access. +// "AUTHOR" - Author role - Blogs where the user has Author level +// access. +// "READER" - Reader role - Blogs where the user has Reader level +// access (to a private blog). +func (c *BlogsListByUserCall) Role(role string) *BlogsListByUserCall { + c.opt_["role"] = role + return c +} + +// Status sets the optional parameter "status": Blog statuses to include +// in the result (default: Live blogs only). Note that ADMIN access is +// required to view deleted blogs. +// +// Possible values: +// "DELETED" - Blog has been deleted by an administrator. +// "LIVE" (default) - Blog is currently live. +func (c *BlogsListByUserCall) Status(status string) *BlogsListByUserCall { + c.opt_["status"] = status + return c +} + +// View sets the optional parameter "view": Access level with which to +// view the blogs. Note that some fields require elevated access. +// +// Possible values: +// "ADMIN" - Admin level detail. +// "AUTHOR" - Author level detail. +// "READER" - Reader level detail. +func (c *BlogsListByUserCall) View(view string) *BlogsListByUserCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BlogsListByUserCall) Fields(s ...googleapi.Field) *BlogsListByUserCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BlogsListByUserCall) IfNoneMatch(entityTag string) *BlogsListByUserCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BlogsListByUserCall) Context(ctx context.Context) *BlogsListByUserCall { + c.ctx_ = ctx + return c +} + +func (c *BlogsListByUserCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["status"]; ok { + params.Set("status", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.blogs.listByUser" call. +// Exactly one of *BlogList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *BlogList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *BlogsListByUserCall) Do() (*BlogList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BlogList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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 - Blogs where the user has Admin level access.", + // "Author role - Blogs where the user has Author level access.", + // "Reader role - Blogs where the user has Reader level access (to a private blog)." + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "status": { + // "default": "LIVE", + // "description": "Blog statuses to include in the result (default: Live blogs only). Note that ADMIN access is required to view deleted blogs.", + // "enum": [ + // "DELETED", + // "LIVE" + // ], + // "enumDescriptions": [ + // "Blog has been deleted by an administrator.", + // "Blog is currently live." + // ], + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsApproveCall) Fields(s ...googleapi.Field) *CommentsApproveCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsApproveCall) Context(ctx context.Context) *CommentsApproveCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsApproveCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/approve") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + "commentId": c.commentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.comments.approve" call. +// Exactly one of *Comment or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Comment.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CommentsApproveCall) Do() (*Comment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Comment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsDeleteCall) Fields(s ...googleapi.Field) *CommentsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsDeleteCall) Context(ctx context.Context) *CommentsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + "commentId": c.commentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.comments.delete" call. +func (c *CommentsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "ADMIN" - Admin level detail +// "AUTHOR" - Author level detail +// "READER" - Admin level detail +func (c *CommentsGetCall) View(view string) *CommentsGetCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsGetCall) Fields(s ...googleapi.Field) *CommentsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CommentsGetCall) IfNoneMatch(entityTag string) *CommentsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsGetCall) Context(ctx context.Context) *CommentsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + "commentId": c.commentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.comments.get" call. +// Exactly one of *Comment or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Comment.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CommentsGetCall) Do() (*Comment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Comment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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": +// +// Possible values: +// "emptied" - Comments that have had their content removed +// "live" - Comments that are publicly visible +// "pending" - Comments that are awaiting administrator approval +// "spam" - Comments marked as spam by the administrator +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. +// +// Possible values: +// "ADMIN" - Admin level detail +// "AUTHOR" - Author level detail +// "READER" - Reader level detail +func (c *CommentsListCall) View(view string) *CommentsListCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CommentsListCall) IfNoneMatch(entityTag string) *CommentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsListCall) Context(ctx context.Context) *CommentsListCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.comments.list" call. +// Exactly one of *CommentList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CommentList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CommentsListCall) Do() (*CommentList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CommentList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the 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{} + ctx_ context.Context +} + +// 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 +} + +// Status sets the optional parameter "status": +// +// Possible values: +// "emptied" - Comments that have had their content removed +// "live" - Comments that are publicly visible +// "pending" - Comments that are awaiting administrator approval +// "spam" - Comments marked as spam by the administrator +func (c *CommentsListByBlogCall) Status(status string) *CommentsListByBlogCall { + c.opt_["status"] = status + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsListByBlogCall) Fields(s ...googleapi.Field) *CommentsListByBlogCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CommentsListByBlogCall) IfNoneMatch(entityTag string) *CommentsListByBlogCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsListByBlogCall) Context(ctx context.Context) *CommentsListByBlogCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsListByBlogCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.comments.listByBlog" call. +// Exactly one of *CommentList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CommentList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CommentsListByBlogCall) Do() (*CommentList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CommentList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the 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" + // }, + // "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" + // } + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsMarkAsSpamCall) Fields(s ...googleapi.Field) *CommentsMarkAsSpamCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsMarkAsSpamCall) Context(ctx context.Context) *CommentsMarkAsSpamCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsMarkAsSpamCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/spam") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + "commentId": c.commentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.comments.markAsSpam" call. +// Exactly one of *Comment or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Comment.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CommentsMarkAsSpamCall) Do() (*Comment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Comment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsRemoveContentCall) Fields(s ...googleapi.Field) *CommentsRemoveContentCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsRemoveContentCall) Context(ctx context.Context) *CommentsRemoveContentCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsRemoveContentCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/removecontent") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + "commentId": c.commentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.comments.removeContent" call. +// Exactly one of *Comment or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Comment.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CommentsRemoveContentCall) Do() (*Comment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Comment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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": +// +// Possible values: +// "30DAYS" - Page view counts from the last thirty days. +// "7DAYS" - Page view counts from the last seven days. +// "all" - Total page view counts from all time. +func (c *PageViewsGetCall) Range(range_ string) *PageViewsGetCall { + c.opt_["range"] = range_ + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PageViewsGetCall) Fields(s ...googleapi.Field) *PageViewsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PageViewsGetCall) IfNoneMatch(entityTag string) *PageViewsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PageViewsGetCall) Context(ctx context.Context) *PageViewsGetCall { + c.ctx_ = ctx + return c +} + +func (c *PageViewsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["range"]; ok { + params.Set("range", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pageviews") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.pageViews.get" call. +// Exactly one of *Pageviews or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Pageviews.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PageViewsGetCall) Do() (*Pageviews, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Pageviews{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PagesDeleteCall) Fields(s ...googleapi.Field) *PagesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PagesDeleteCall) Context(ctx context.Context) *PagesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *PagesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "pageId": c.pageId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.pages.delete" call. +func (c *PagesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a 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{} + ctx_ context.Context +} + +// 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": +// +// Possible values: +// "ADMIN" - Admin level detail +// "AUTHOR" - Author level detail +// "READER" - Reader level detail +func (c *PagesGetCall) View(view string) *PagesGetCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PagesGetCall) Fields(s ...googleapi.Field) *PagesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PagesGetCall) IfNoneMatch(entityTag string) *PagesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PagesGetCall) Context(ctx context.Context) *PagesGetCall { + c.ctx_ = ctx + return c +} + +func (c *PagesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "pageId": c.pageId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.pages.get" call. +// Exactly one of *Page or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Page.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PagesGetCall) Do() (*Page, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Page{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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 +} + +// IsDraft sets the optional parameter "isDraft": Whether to create the +// page as a draft (default: false). +func (c *PagesInsertCall) IsDraft(isDraft bool) *PagesInsertCall { + c.opt_["isDraft"] = isDraft + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PagesInsertCall) Fields(s ...googleapi.Field) *PagesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PagesInsertCall) Context(ctx context.Context) *PagesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *PagesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["isDraft"]; ok { + params.Set("isDraft", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.pages.insert" call. +// Exactly one of *Page or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Page.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PagesInsertCall) Do() (*Page, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Page{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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" + // }, + // "isDraft": { + // "description": "Whether to create the page as a draft (default: false).", + // "location": "query", + // "type": "boolean" + // } + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of Pages to fetch. +func (c *PagesListCall) MaxResults(maxResults int64) *PagesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +// if the request is paged. +func (c *PagesListCall) PageToken(pageToken string) *PagesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Status sets the optional parameter "status": +// +// Possible values: +// "draft" - Draft (unpublished) Pages +// "live" - Pages that are publicly visible +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. +// +// Possible values: +// "ADMIN" - Admin level detail +// "AUTHOR" - Author level detail +// "READER" - Reader level detail +func (c *PagesListCall) View(view string) *PagesListCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PagesListCall) Fields(s ...googleapi.Field) *PagesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PagesListCall) IfNoneMatch(entityTag string) *PagesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PagesListCall) Context(ctx context.Context) *PagesListCall { + c.ctx_ = ctx + return c +} + +func (c *PagesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["status"]; ok { + params.Set("status", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.pages.list" call. +// Exactly one of *PageList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *PageList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PagesListCall) Do() (*PageList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PageList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the 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" + // }, + // "maxResults": { + // "description": "Maximum number of Pages to fetch.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Continuation token if the request is paged.", + // "location": "query", + // "type": "string" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Publish sets the optional parameter "publish": Whether a publish +// action should be performed when the page is updated (default: false). +func (c *PagesPatchCall) Publish(publish bool) *PagesPatchCall { + c.opt_["publish"] = publish + return c +} + +// Revert sets the optional parameter "revert": Whether a revert action +// should be performed when the page is updated (default: false). +func (c *PagesPatchCall) Revert(revert bool) *PagesPatchCall { + c.opt_["revert"] = revert + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PagesPatchCall) Fields(s ...googleapi.Field) *PagesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PagesPatchCall) Context(ctx context.Context) *PagesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *PagesPatchCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "pageId": c.pageId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.pages.patch" call. +// Exactly one of *Page or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Page.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PagesPatchCall) Do() (*Page, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Page{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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" + // }, + // "publish": { + // "description": "Whether a publish action should be performed when the page is updated (default: false).", + // "location": "query", + // "type": "boolean" + // }, + // "revert": { + // "description": "Whether a revert action should be performed when the page is updated (default: false).", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "blogs/{blogId}/pages/{pageId}", + // "request": { + // "$ref": "Page" + // }, + // "response": { + // "$ref": "Page" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.pages.publish": + +type PagesPublishCall struct { + s *Service + blogId string + pageId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Publish: Publishes a draft page. +func (r *PagesService) Publish(blogId string, pageId string) *PagesPublishCall { + c := &PagesPublishCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.pageId = pageId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PagesPublishCall) Fields(s ...googleapi.Field) *PagesPublishCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PagesPublishCall) Context(ctx context.Context) *PagesPublishCall { + c.ctx_ = ctx + return c +} + +func (c *PagesPublishCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}/publish") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "pageId": c.pageId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.pages.publish" call. +// Exactly one of *Page or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Page.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PagesPublishCall) Do() (*Page, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Page{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Publishes a draft page.", + // "httpMethod": "POST", + // "id": "blogger.pages.publish", + // "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}/publish", + // "response": { + // "$ref": "Page" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/blogger" + // ] + // } + +} + +// method id "blogger.pages.revert": + +type PagesRevertCall struct { + s *Service + blogId string + pageId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Revert: Revert a published or scheduled page to draft state. +func (r *PagesService) Revert(blogId string, pageId string) *PagesRevertCall { + c := &PagesRevertCall{s: r.s, opt_: make(map[string]interface{})} + c.blogId = blogId + c.pageId = pageId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PagesRevertCall) Fields(s ...googleapi.Field) *PagesRevertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PagesRevertCall) Context(ctx context.Context) *PagesRevertCall { + c.ctx_ = ctx + return c +} + +func (c *PagesRevertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}/revert") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "pageId": c.pageId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.pages.revert" call. +// Exactly one of *Page or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Page.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PagesRevertCall) Do() (*Page, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Page{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Revert a published or scheduled page to draft state.", + // "httpMethod": "POST", + // "id": "blogger.pages.revert", + // "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}/revert", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Publish sets the optional parameter "publish": Whether a publish +// action should be performed when the page is updated (default: false). +func (c *PagesUpdateCall) Publish(publish bool) *PagesUpdateCall { + c.opt_["publish"] = publish + return c +} + +// Revert sets the optional parameter "revert": Whether a revert action +// should be performed when the page is updated (default: false). +func (c *PagesUpdateCall) Revert(revert bool) *PagesUpdateCall { + c.opt_["revert"] = revert + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PagesUpdateCall) Fields(s ...googleapi.Field) *PagesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PagesUpdateCall) Context(ctx context.Context) *PagesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *PagesUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "pageId": c.pageId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.pages.update" call. +// Exactly one of *Page or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Page.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PagesUpdateCall) Do() (*Page, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Page{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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" + // }, + // "publish": { + // "description": "Whether a publish action should be performed when the page is updated (default: false).", + // "location": "query", + // "type": "boolean" + // }, + // "revert": { + // "description": "Whether a revert action should be performed when the page is updated (default: false).", + // "location": "query", + // "type": "boolean" + // } + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostUserInfosGetCall) Fields(s ...googleapi.Field) *PostUserInfosGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PostUserInfosGetCall) IfNoneMatch(entityTag string) *PostUserInfosGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostUserInfosGetCall) Context(ctx context.Context) *PostUserInfosGetCall { + c.ctx_ = ctx + return c +} + +func (c *PostUserInfosGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxComments"]; ok { + params.Set("maxComments", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "blogId": c.blogId, + "postId": c.postId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.postUserInfos.get" call. +// Exactly one of *PostUserInfo or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PostUserInfo.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PostUserInfosGetCall) Do() (*PostUserInfo, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PostUserInfo{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "published" - Order by the date the post was published +// "updated" - Order by the date the post was last updated +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": +// +// Possible values: +// "draft" - Draft posts +// "live" - Published posts +// "scheduled" - Posts that are scheduled to publish in future. +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. +// +// Possible values: +// "ADMIN" - Admin level detail +// "AUTHOR" - Author level detail +// "READER" - Reader level detail +func (c *PostUserInfosListCall) View(view string) *PostUserInfosListCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostUserInfosListCall) Fields(s ...googleapi.Field) *PostUserInfosListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PostUserInfosListCall) IfNoneMatch(entityTag string) *PostUserInfosListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostUserInfosListCall) Context(ctx context.Context) *PostUserInfosListCall { + c.ctx_ = ctx + return c +} + +func (c *PostUserInfosListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}/posts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.postUserInfos.list" call. +// Exactly one of *PostUserInfosList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PostUserInfosList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PostUserInfosListCall) Do() (*PostUserInfosList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PostUserInfosList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsDeleteCall) Fields(s ...googleapi.Field) *PostsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsDeleteCall) Context(ctx context.Context) *PostsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *PostsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.delete" call. +func (c *PostsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "ADMIN" - Admin level detail +// "AUTHOR" - Author level detail +// "READER" - Reader level detail +func (c *PostsGetCall) View(view string) *PostsGetCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsGetCall) Fields(s ...googleapi.Field) *PostsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PostsGetCall) IfNoneMatch(entityTag string) *PostsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsGetCall) Context(ctx context.Context) *PostsGetCall { + c.ctx_ = ctx + return c +} + +func (c *PostsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.get" call. +// Exactly one of *Post or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Post.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PostsGetCall) Do() (*Post, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Post{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "ADMIN" - Admin level detail +// "AUTHOR" - Author level detail +// "READER" - Reader level detail +func (c *PostsGetByPathCall) View(view string) *PostsGetByPathCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsGetByPathCall) Fields(s ...googleapi.Field) *PostsGetByPathCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PostsGetByPathCall) IfNoneMatch(entityTag string) *PostsGetByPathCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsGetByPathCall) Context(ctx context.Context) *PostsGetByPathCall { + c.ctx_ = ctx + return c +} + +func (c *PostsGetByPathCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/bypath") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.getByPath" call. +// Exactly one of *Post or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Post.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PostsGetByPathCall) Do() (*Post, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Post{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsInsertCall) Fields(s ...googleapi.Field) *PostsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsInsertCall) Context(ctx context.Context) *PostsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *PostsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.insert" call. +// Exactly one of *Post or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Post.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PostsInsertCall) Do() (*Post, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Post{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +// +// Possible values: +// "published" - Order by the date the post was published +// "updated" - Order by the date the post was last updated +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. +// +// Possible values: +// "draft" - Draft (non-published) posts. +// "live" - Published posts +// "scheduled" - Posts that are scheduled to publish in the future. +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. +// +// Possible values: +// "ADMIN" - Admin level detail +// "AUTHOR" - Author level detail +// "READER" - Reader level detail +func (c *PostsListCall) View(view string) *PostsListCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsListCall) Fields(s ...googleapi.Field) *PostsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PostsListCall) IfNoneMatch(entityTag string) *PostsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsListCall) Context(ctx context.Context) *PostsListCall { + c.ctx_ = ctx + return c +} + +func (c *PostsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.list" call. +// Exactly one of *PostList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *PostList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PostsListCall) Do() (*PostList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PostList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsPatchCall) Fields(s ...googleapi.Field) *PostsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsPatchCall) Context(ctx context.Context) *PostsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *PostsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.patch" call. +// Exactly one of *Post or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Post.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PostsPatchCall) Do() (*Post, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Post{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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{} + ctx_ context.Context +} + +// Publish: Publishes a draft post, optionally at the specific time of +// the given publishDate parameter. +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": Optional date +// and time to schedule the publishing of the Blog. If no publishDate +// parameter is given, the post is either published at the a previously +// saved schedule date (if present), or the current time. If a future +// date is given, the post will be scheduled to be published. +func (c *PostsPublishCall) PublishDate(publishDate string) *PostsPublishCall { + c.opt_["publishDate"] = publishDate + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsPublishCall) Fields(s ...googleapi.Field) *PostsPublishCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsPublishCall) Context(ctx context.Context) *PostsPublishCall { + c.ctx_ = ctx + return c +} + +func (c *PostsPublishCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["publishDate"]; ok { + params.Set("publishDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/publish") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.publish" call. +// Exactly one of *Post or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Post.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PostsPublishCall) Do() (*Post, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Post{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Publishes a draft post, optionally at the specific time of the given publishDate parameter.", + // "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": "Optional date and time to schedule the publishing of the Blog. If no publishDate parameter is given, the post is either published at the a previously saved schedule date (if present), or the current time. If a future date is given, the post will be scheduled to be published.", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsRevertCall) Fields(s ...googleapi.Field) *PostsRevertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsRevertCall) Context(ctx context.Context) *PostsRevertCall { + c.ctx_ = ctx + return c +} + +func (c *PostsRevertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/revert") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.revert" call. +// Exactly one of *Post or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Post.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PostsRevertCall) Do() (*Post, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Post{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +// +// Possible values: +// "published" - Order by the date the post was published +// "updated" - Order by the date the post was last updated +func (c *PostsSearchCall) OrderBy(orderBy string) *PostsSearchCall { + c.opt_["orderBy"] = orderBy + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsSearchCall) Fields(s ...googleapi.Field) *PostsSearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PostsSearchCall) IfNoneMatch(entityTag string) *PostsSearchCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsSearchCall) Context(ctx context.Context) *PostsSearchCall { + c.ctx_ = ctx + return c +} + +func (c *PostsSearchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/search") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.search" call. +// Exactly one of *PostList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *PostList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PostsSearchCall) Do() (*PostList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PostList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsUpdateCall) Fields(s ...googleapi.Field) *PostsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsUpdateCall) Context(ctx context.Context) *PostsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *PostsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.update" call. +// Exactly one of *Post or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Post.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PostsUpdateCall) Do() (*Post, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Post{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall { + c.ctx_ = ctx + return c +} + +func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.users.get" call. +// Exactly one of *User or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *User.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *UsersGetCall) Do() (*User, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &User{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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/Godeps/_workspace/src/google.golang.org/api/books/v1/books-api.json b/Godeps/_workspace/src/google.golang.org/api/books/v1/books-api.json new file mode 100644 index 000000000..ca3543122 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/books/v1/books-api.json @@ -0,0 +1,4293 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/NfC6HUSyutjMUJzqUOocETnJU2I\"", + "discoveryVersion": "v1", + "id": "books:v1", + "name": "books", + "version": "v1", + "revision": "20150921", + "title": "Books API", + "description": "Lets you search for books and manage your Google Books library.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/ebooks-16.png", + "x32": "https://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" + } + } + }, + "Category": { + "id": "Category", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "A list of onboarding categories.", + "items": { + "type": "object", + "properties": { + "badgeUrl": { + "type": "string" + }, + "categoryId": { + "type": "string" + }, + "name": { + "type": "string" + } + } + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "onboarding#category" + } + } + }, + "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" + } + } + }, + "Discoveryclusters": { + "id": "Discoveryclusters", + "type": "object", + "properties": { + "clusters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "banner_with_content_container": { + "type": "object", + "properties": { + "fillColorArgb": { + "type": "string" + }, + "imageUrl": { + "type": "string" + }, + "maskColorArgb": { + "type": "string" + }, + "moreButtonText": { + "type": "string" + }, + "moreButtonUrl": { + "type": "string" + }, + "textColorArgb": { + "type": "string" + } + } + }, + "subTitle": { + "type": "string" + }, + "title": { + "type": "string" + }, + "totalVolumes": { + "type": "integer", + "format": "int32" + }, + "uid": { + "type": "string" + }, + "volumes": { + "type": "array", + "items": { + "$ref": "Volume" + } + } + } + } + }, + "kind": { + "type": "string", + "description": "Resorce type.", + "default": "books#discovery#clusters" + }, + "totalClusters": { + "type": "integer", + "format": "int32" + } + } + }, + "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." + } + } + }, + "Metadata": { + "id": "Metadata", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "A list of offline dictionary metadata.", + "items": { + "type": "object", + "properties": { + "download_url": { + "type": "string" + }, + "encrypted_key": { + "type": "string" + }, + "language": { + "type": "string" + }, + "size": { + "type": "string", + "format": "int64" + }, + "version": { + "type": "string", + "format": "int64" + } + } + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "dictionary#metadata" + } + } + }, + "Notification": { + "id": "Notification", + "type": "object", + "properties": { + "body": { + "type": "string" + }, + "iconUrl": { + "type": "string" + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "books#notification" + }, + "linkUrl": { + "type": "string" + }, + "title": { + "type": "string" + } + } + }, + "Offers": { + "id": "Offers", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "A list of offers.", + "items": { + "type": "object", + "properties": { + "artUrl": { + "type": "string" + }, + "gservicesKey": { + "type": "string" + }, + "id": { + "type": "string" + }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "author": { + "type": "string" + }, + "canonicalVolumeLink": { + "type": "string" + }, + "coverUrl": { + "type": "string" + }, + "description": { + "type": "string" + }, + "title": { + "type": "string" + }, + "volumeId": { + "type": "string" + } + } + } + } + } + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "promooffer#offers" + } + } + }, + "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." + } + } + }, + "Usersettings": { + "id": "Usersettings", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Resource type.", + "default": "books#usersettings" + }, + "notesExport": { + "type": "object", + "description": "User settings in sub-objects, each for different purposes.", + "properties": { + "folderName": { + "type": "string" + }, + "isEnabled": { + "type": "boolean" + } + } + }, + "notification": { + "type": "object", + "properties": { + "moreFromAuthors": { + "type": "object", + "properties": { + "opted_state": { + "type": "string" + } + } + } + } + } + } + }, + "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": { + "acquisitionType": { + "type": "integer", + "description": "How this volume was acquired.", + "format": "int32" + }, + "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" + } + } + }, + "entitlementType": { + "type": "integer", + "description": "Whether this volume is purchased, sample, pd download etc.", + "format": "int32" + }, + "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": { + "allowAnonLogging": { + "type": "boolean", + "description": "Whether anonymous logging should be allowed." + }, + "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." + }, + "maturityRating": { + "type": "string" + }, + "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" + }, + "readingModes": { + "type": "any", + "description": "The reading modes available for this volume." + }, + "samplePageCount": { + "type": "integer", + "description": "Total number of sample pages as per publisher metadata.", + "format": "int32" + }, + "subtitle": { + "type": "string", + "description": "Volume subtitle. (In LITE projection.)" + }, + "title": { + "type": "string", + "description": "Volume title. (In LITE projection.)" + } + } + } + } + }, + "Volume2": { + "id": "Volume2", + "type": "object", + "properties": { + "items": { + "type": "array", + "description": "A list of volumes.", + "items": { + "$ref": "Volume" + } + }, + "kind": { + "type": "string", + "description": "Resource type.", + "default": "onboarding#volume" + }, + "nextPageToken": { + "type": "string" + } + } + }, + "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" + ] + } + } + }, + "dictionary": { + "methods": { + "listOfflineMetadata": { + "id": "books.dictionary.listOfflineMetadata", + "path": "dictionary/listOfflineMetadata", + "httpMethod": "GET", + "description": "Returns a list of offline dictionary metadata available", + "parameters": { + "cpksver": { + "type": "string", + "description": "The device/version ID from which to request the data.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "cpksver" + ], + "response": { + "$ref": "Metadata" + }, + "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": { + "getUserSettings": { + "id": "books.myconfig.getUserSettings", + "path": "myconfig/getUserSettings", + "httpMethod": "GET", + "description": "Gets the current settings for the user.", + "response": { + "$ref": "Usersettings" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + }, + "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" + ] + }, + "updateUserSettings": { + "id": "books.myconfig.updateUserSettings", + "path": "myconfig/updateUserSettings", + "httpMethod": "POST", + "description": "Sets the settings for the user. If a sub-object is specified, it will overwrite the existing sub-object stored in the server. Unspecified sub-objects will retain the existing value.", + "request": { + "$ref": "Usersettings" + }, + "response": { + "$ref": "Usersettings" + }, + "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" + ] + }, + "insert": { + "id": "books.mylibrary.annotations.insert", + "path": "mylibrary/annotations", + "httpMethod": "POST", + "description": "Inserts a new annotation.", + "parameters": { + "country": { + "type": "string", + "description": "ISO-3166-1 code to override the IP-based location.", + "location": "query" + }, + "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" + }, + "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": { + "reason": { + "type": "string", + "description": "The reason for which the book is added to the library.", + "enum": [ + "IOS_PREX", + "IOS_SEARCH", + "ONBOARDING" + ], + "enumDescriptions": [ + "Volumes added from the PREX flow on iOS.", + "Volumes added from the Search flow on iOS.", + "Volumes added from the Onboarding flow." + ], + "location": "query" + }, + "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": { + "reason": { + "type": "string", + "description": "The reason for which the book is removed from the library.", + "enum": [ + "ONBOARDING" + ], + "enumDescriptions": [ + "Samples removed from the Onboarding flow." + ], + "location": "query" + }, + "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" + ] + } + } + } + } + }, + "notification": { + "methods": { + "get": { + "id": "books.notification.get", + "path": "notification/get", + "httpMethod": "GET", + "description": "Returns notification details for a given notification id.", + "parameters": { + "locale": { + "type": "string", + "description": "ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating notification title and body.", + "location": "query" + }, + "notification_id": { + "type": "string", + "description": "String to identify the notification.", + "required": true, + "location": "query" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + } + }, + "parameterOrder": [ + "notification_id" + ], + "response": { + "$ref": "Notification" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + } + } + }, + "onboarding": { + "methods": { + "listCategories": { + "id": "books.onboarding.listCategories", + "path": "onboarding/listCategories", + "httpMethod": "GET", + "description": "List categories for onboarding experience.", + "parameters": { + "locale": { + "type": "string", + "description": "ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset.", + "location": "query" + } + }, + "response": { + "$ref": "Category" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + }, + "listCategoryVolumes": { + "id": "books.onboarding.listCategoryVolumes", + "path": "onboarding/listCategoryVolumes", + "httpMethod": "GET", + "description": "List available volumes under categories for onboarding experience.", + "parameters": { + "categoryId": { + "type": "string", + "description": "List of category ids requested.", + "repeated": true, + "location": "query" + }, + "locale": { + "type": "string", + "description": "ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset.", + "location": "query" + }, + "maxAllowedMaturityRating": { + "type": "string", + "description": "The maximum allowed maturity rating of returned volumes. Books with a higher maturity rating are filtered out.", + "enum": [ + "mature", + "not-mature" + ], + "enumDescriptions": [ + "Show books which are rated mature or lower.", + "Show books which are rated not mature." + ], + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "Number of maximum results per page to be included in the response.", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value of the nextToken from the previous page.", + "location": "query" + } + }, + "response": { + "$ref": "Volume2" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + } + } + }, + "personalizedstream": { + "methods": { + "get": { + "id": "books.personalizedstream.get", + "path": "personalizedstream/get", + "httpMethod": "GET", + "description": "Returns a stream of personalized book clusters", + "parameters": { + "locale": { + "type": "string", + "description": "ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations.", + "location": "query" + }, + "maxAllowedMaturityRating": { + "type": "string", + "description": "The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out.", + "enum": [ + "mature", + "not-mature" + ], + "enumDescriptions": [ + "Show books which are rated mature or lower.", + "Show books which are rated not mature." + ], + "location": "query" + }, + "source": { + "type": "string", + "description": "String to identify the originator of this request.", + "location": "query" + } + }, + "response": { + "$ref": "Discoveryclusters" + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + } + } + }, + "promooffer": { + "methods": { + "accept": { + "id": "books.promooffer.accept", + "path": "promooffer/accept", + "httpMethod": "POST", + "description": "", + "parameters": { + "androidId": { + "type": "string", + "description": "device android_id", + "location": "query" + }, + "device": { + "type": "string", + "description": "device device", + "location": "query" + }, + "manufacturer": { + "type": "string", + "description": "device manufacturer", + "location": "query" + }, + "model": { + "type": "string", + "description": "device model", + "location": "query" + }, + "offerId": { + "type": "string", + "location": "query" + }, + "product": { + "type": "string", + "description": "device product", + "location": "query" + }, + "serial": { + "type": "string", + "description": "device serial", + "location": "query" + }, + "volumeId": { + "type": "string", + "description": "Volume id to exercise the offer", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + }, + "dismiss": { + "id": "books.promooffer.dismiss", + "path": "promooffer/dismiss", + "httpMethod": "POST", + "description": "", + "parameters": { + "androidId": { + "type": "string", + "description": "device android_id", + "location": "query" + }, + "device": { + "type": "string", + "description": "device device", + "location": "query" + }, + "manufacturer": { + "type": "string", + "description": "device manufacturer", + "location": "query" + }, + "model": { + "type": "string", + "description": "device model", + "location": "query" + }, + "offerId": { + "type": "string", + "description": "Offer to dimiss", + "location": "query" + }, + "product": { + "type": "string", + "description": "device product", + "location": "query" + }, + "serial": { + "type": "string", + "description": "device serial", + "location": "query" + } + }, + "scopes": [ + "https://www.googleapis.com/auth/books" + ] + }, + "get": { + "id": "books.promooffer.get", + "path": "promooffer/get", + "httpMethod": "GET", + "description": "Returns a list of promo offers available to the user", + "parameters": { + "androidId": { + "type": "string", + "description": "device android_id", + "location": "query" + }, + "device": { + "type": "string", + "description": "device device", + "location": "query" + }, + "manufacturer": { + "type": "string", + "description": "device manufacturer", + "location": "query" + }, + "model": { + "type": "string", + "description": "device model", + "location": "query" + }, + "product": { + "type": "string", + "description": "device product", + "location": "query" + }, + "serial": { + "type": "string", + "description": "device serial", + "location": "query" + } + }, + "response": { + "$ref": "Offers" + }, + "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" + }, + "user_library_consistent_read": { + "type": "boolean", + "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", + "related-for-play" + ], + "enumDescriptions": [ + "Recommendations for display end-of-sample.", + "Recommendations for display end-of-volume.", + "Related volumes for Play Store." + ], + "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" + }, + "maxAllowedMaturityRating": { + "type": "string", + "description": "The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out.", + "enum": [ + "mature", + "not-mature" + ], + "enumDescriptions": [ + "Show books which are rated mature or lower.", + "Show books which are rated not mature." + ], + "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" + }, + "maxAllowedMaturityRating": { + "type": "string", + "description": "The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out.", + "enum": [ + "mature", + "not-mature" + ], + "enumDescriptions": [ + "Show books which are rated mature or lower.", + "Show books which are rated not mature." + ], + "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/Godeps/_workspace/src/google.golang.org/api/books/v1/books-gen.go b/Godeps/_workspace/src/google.golang.org/api/books/v1/books-gen.go new file mode 100644 index 000000000..09c47f7f3 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/books/v1/books-gen.go @@ -0,0 +1,11363 @@ +// Package books provides access to the Books API. +// +// See https://developers.google.com/books/docs/v1/getting_started +// +// Usage example: +// +// import "google.golang.org/api/books/v1" +// ... +// booksService, err := books.New(oauthHttpClient) +package books // import "google.golang.org/api/books/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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.Dictionary = NewDictionaryService(s) + s.Layers = NewLayersService(s) + s.Myconfig = NewMyconfigService(s) + s.Mylibrary = NewMylibraryService(s) + s.Notification = NewNotificationService(s) + s.Onboarding = NewOnboardingService(s) + s.Personalizedstream = NewPersonalizedstreamService(s) + s.Promooffer = NewPromoofferService(s) + s.Volumes = NewVolumesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Bookshelves *BookshelvesService + + Cloudloading *CloudloadingService + + Dictionary *DictionaryService + + Layers *LayersService + + Myconfig *MyconfigService + + Mylibrary *MylibraryService + + Notification *NotificationService + + Onboarding *OnboardingService + + Personalizedstream *PersonalizedstreamService + + Promooffer *PromoofferService + + Volumes *VolumesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 NewDictionaryService(s *Service) *DictionaryService { + rs := &DictionaryService{s: s} + return rs +} + +type DictionaryService 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 NewNotificationService(s *Service) *NotificationService { + rs := &NotificationService{s: s} + return rs +} + +type NotificationService struct { + s *Service +} + +func NewOnboardingService(s *Service) *OnboardingService { + rs := &OnboardingService{s: s} + return rs +} + +type OnboardingService struct { + s *Service +} + +func NewPersonalizedstreamService(s *Service) *PersonalizedstreamService { + rs := &PersonalizedstreamService{s: s} + return rs +} + +type PersonalizedstreamService struct { + s *Service +} + +func NewPromoofferService(s *Service) *PromoofferService { + rs := &PromoofferService{s: s} + return rs +} + +type PromoofferService 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AfterSelectedText") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Annotation) MarshalJSON() ([]byte, error) { + type noMethod Annotation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AnnotationClientVersionRanges: Selection ranges sent from the client. +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"` + + // ForceSendFields is a list of field names (e.g. "CfiRange") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AnnotationClientVersionRanges) MarshalJSON() ([]byte, error) { + type noMethod AnnotationClientVersionRanges + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AnnotationCurrentVersionRanges: Selection ranges for the most recent +// content version. +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"` + + // ForceSendFields is a list of field names (e.g. "CfiRange") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AnnotationCurrentVersionRanges) MarshalJSON() ([]byte, error) { + type noMethod AnnotationCurrentVersionRanges + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. + // "AllowedCharacterCount") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AnnotationLayerSummary) MarshalJSON() ([]byte, error) { + type noMethod AnnotationLayerSummary + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Annotationdata struct { + // AnnotationType: The type of annotation this data is for. + AnnotationType string `json:"annotationType,omitempty"` + + Data interface{} `json:"data,omitempty"` + + // EncodedData: Base64 encoded data for this annotation data. + EncodedData 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AnnotationType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Annotationdata) MarshalJSON() ([]byte, error) { + type noMethod Annotationdata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Annotations) MarshalJSON() ([]byte, error) { + type noMethod Annotations + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AnnotationsSummary struct { + Kind string `json:"kind,omitempty"` + + Layers []*AnnotationsSummaryLayers `json:"layers,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AnnotationsSummary) MarshalJSON() ([]byte, error) { + type noMethod AnnotationsSummary + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. + // "AllowedCharacterCount") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AnnotationsSummaryLayers) MarshalJSON() ([]byte, error) { + type noMethod AnnotationsSummaryLayers + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Annotationsdata) MarshalJSON() ([]byte, error) { + type noMethod Annotationsdata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "EndOffset") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BooksAnnotationsRange) MarshalJSON() ([]byte, error) { + type noMethod BooksAnnotationsRange + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type BooksCloudloadingResource struct { + Author string `json:"author,omitempty"` + + ProcessingState string `json:"processingState,omitempty"` + + Title string `json:"title,omitempty"` + + VolumeId string `json:"volumeId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Author") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BooksCloudloadingResource) MarshalJSON() ([]byte, error) { + type noMethod BooksCloudloadingResource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type BooksVolumesRecommendedRateResponse struct { + ConsistencyToken string `json:"consistency_token,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ConsistencyToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BooksVolumesRecommendedRateResponse) MarshalJSON() ([]byte, error) { + type noMethod BooksVolumesRecommendedRateResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Access") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Bookshelf) MarshalJSON() ([]byte, error) { + type noMethod Bookshelf + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Bookshelves struct { + // Items: A list of bookshelves. + Items []*Bookshelf `json:"items,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Bookshelves) MarshalJSON() ([]byte, error) { + type noMethod Bookshelves + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Category struct { + // Items: A list of onboarding categories. + Items []*CategoryItems `json:"items,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Category) MarshalJSON() ([]byte, error) { + type noMethod Category + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type CategoryItems struct { + BadgeUrl string `json:"badgeUrl,omitempty"` + + CategoryId string `json:"categoryId,omitempty"` + + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BadgeUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CategoryItems) MarshalJSON() ([]byte, error) { + type noMethod CategoryItems + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "DeviceAllowed") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ConcurrentAccessRestriction) MarshalJSON() ([]byte, error) { + type noMethod ConcurrentAccessRestriction + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Dictlayerdata struct { + Common *DictlayerdataCommon `json:"common,omitempty"` + + Dict *DictlayerdataDict `json:"dict,omitempty"` + + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Common") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Dictlayerdata) MarshalJSON() ([]byte, error) { + type noMethod Dictlayerdata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Title") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DictlayerdataCommon) MarshalJSON() ([]byte, error) { + type noMethod DictlayerdataCommon + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DictlayerdataDict struct { + // Source: The source, url and attribution for this dictionary data. + Source *DictlayerdataDictSource `json:"source,omitempty"` + + Words []*DictlayerdataDictWords `json:"words,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Source") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DictlayerdataDict) MarshalJSON() ([]byte, error) { + type noMethod DictlayerdataDict + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DictlayerdataDictSource: The source, url and attribution for this +// dictionary data. +type DictlayerdataDictSource struct { + Attribution string `json:"attribution,omitempty"` + + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Attribution") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DictlayerdataDictSource) MarshalJSON() ([]byte, error) { + type noMethod DictlayerdataDictSource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Derivatives") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DictlayerdataDictWords) MarshalJSON() ([]byte, error) { + type noMethod DictlayerdataDictWords + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DictlayerdataDictWordsDerivatives struct { + Source *DictlayerdataDictWordsDerivativesSource `json:"source,omitempty"` + + Text string `json:"text,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Source") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DictlayerdataDictWordsDerivatives) MarshalJSON() ([]byte, error) { + type noMethod DictlayerdataDictWordsDerivatives + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DictlayerdataDictWordsDerivativesSource struct { + Attribution string `json:"attribution,omitempty"` + + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Attribution") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DictlayerdataDictWordsDerivativesSource) MarshalJSON() ([]byte, error) { + type noMethod DictlayerdataDictWordsDerivativesSource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DictlayerdataDictWordsExamples struct { + Source *DictlayerdataDictWordsExamplesSource `json:"source,omitempty"` + + Text string `json:"text,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Source") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DictlayerdataDictWordsExamples) MarshalJSON() ([]byte, error) { + type noMethod DictlayerdataDictWordsExamples + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DictlayerdataDictWordsExamplesSource struct { + Attribution string `json:"attribution,omitempty"` + + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Attribution") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DictlayerdataDictWordsExamplesSource) MarshalJSON() ([]byte, error) { + type noMethod DictlayerdataDictWordsExamplesSource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Conjugations") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DictlayerdataDictWordsSenses) MarshalJSON() ([]byte, error) { + type noMethod DictlayerdataDictWordsSenses + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DictlayerdataDictWordsSensesConjugations struct { + Type string `json:"type,omitempty"` + + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Type") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DictlayerdataDictWordsSensesConjugations) MarshalJSON() ([]byte, error) { + type noMethod DictlayerdataDictWordsSensesConjugations + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DictlayerdataDictWordsSensesDefinitions struct { + Definition string `json:"definition,omitempty"` + + Examples []*DictlayerdataDictWordsSensesDefinitionsExamples `json:"examples,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Definition") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DictlayerdataDictWordsSensesDefinitions) MarshalJSON() ([]byte, error) { + type noMethod DictlayerdataDictWordsSensesDefinitions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DictlayerdataDictWordsSensesDefinitionsExamples struct { + Source *DictlayerdataDictWordsSensesDefinitionsExamplesSource `json:"source,omitempty"` + + Text string `json:"text,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Source") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DictlayerdataDictWordsSensesDefinitionsExamples) MarshalJSON() ([]byte, error) { + type noMethod DictlayerdataDictWordsSensesDefinitionsExamples + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DictlayerdataDictWordsSensesDefinitionsExamplesSource struct { + Attribution string `json:"attribution,omitempty"` + + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Attribution") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DictlayerdataDictWordsSensesDefinitionsExamplesSource) MarshalJSON() ([]byte, error) { + type noMethod DictlayerdataDictWordsSensesDefinitionsExamplesSource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DictlayerdataDictWordsSensesSource struct { + Attribution string `json:"attribution,omitempty"` + + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Attribution") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DictlayerdataDictWordsSensesSource) MarshalJSON() ([]byte, error) { + type noMethod DictlayerdataDictWordsSensesSource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DictlayerdataDictWordsSensesSynonyms struct { + Source *DictlayerdataDictWordsSensesSynonymsSource `json:"source,omitempty"` + + Text string `json:"text,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Source") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DictlayerdataDictWordsSensesSynonyms) MarshalJSON() ([]byte, error) { + type noMethod DictlayerdataDictWordsSensesSynonyms + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DictlayerdataDictWordsSensesSynonymsSource struct { + Attribution string `json:"attribution,omitempty"` + + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Attribution") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DictlayerdataDictWordsSensesSynonymsSource) MarshalJSON() ([]byte, error) { + type noMethod DictlayerdataDictWordsSensesSynonymsSource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DictlayerdataDictWordsSource: The words with different meanings but +// not related words, e.g. "go" (game) and "go" (verb). +type DictlayerdataDictWordsSource struct { + Attribution string `json:"attribution,omitempty"` + + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Attribution") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DictlayerdataDictWordsSource) MarshalJSON() ([]byte, error) { + type noMethod DictlayerdataDictWordsSource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Discoveryclusters struct { + Clusters []*DiscoveryclustersClusters `json:"clusters,omitempty"` + + // Kind: Resorce type. + Kind string `json:"kind,omitempty"` + + TotalClusters int64 `json:"totalClusters,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Clusters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Discoveryclusters) MarshalJSON() ([]byte, error) { + type noMethod Discoveryclusters + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DiscoveryclustersClusters struct { + BannerWithContentContainer *DiscoveryclustersClustersBannerWithContentContainer `json:"banner_with_content_container,omitempty"` + + SubTitle string `json:"subTitle,omitempty"` + + Title string `json:"title,omitempty"` + + TotalVolumes int64 `json:"totalVolumes,omitempty"` + + Uid string `json:"uid,omitempty"` + + Volumes []*Volume `json:"volumes,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "BannerWithContentContainer") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DiscoveryclustersClusters) MarshalJSON() ([]byte, error) { + type noMethod DiscoveryclustersClusters + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DiscoveryclustersClustersBannerWithContentContainer struct { + FillColorArgb string `json:"fillColorArgb,omitempty"` + + ImageUrl string `json:"imageUrl,omitempty"` + + MaskColorArgb string `json:"maskColorArgb,omitempty"` + + MoreButtonText string `json:"moreButtonText,omitempty"` + + MoreButtonUrl string `json:"moreButtonUrl,omitempty"` + + TextColorArgb string `json:"textColorArgb,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FillColorArgb") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DiscoveryclustersClustersBannerWithContentContainer) MarshalJSON() ([]byte, error) { + type noMethod DiscoveryclustersClustersBannerWithContentContainer + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "DeviceAllowed") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DownloadAccessRestriction) MarshalJSON() ([]byte, error) { + type noMethod DownloadAccessRestriction + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DownloadAccesses struct { + // DownloadAccessList: A list of download access responses. + DownloadAccessList []*DownloadAccessRestriction `json:"downloadAccessList,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DownloadAccessList") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DownloadAccesses) MarshalJSON() ([]byte, error) { + type noMethod DownloadAccesses + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Geolayerdata struct { + Common *GeolayerdataCommon `json:"common,omitempty"` + + Geo *GeolayerdataGeo `json:"geo,omitempty"` + + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Common") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Geolayerdata) MarshalJSON() ([]byte, error) { + type noMethod Geolayerdata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Lang") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeolayerdataCommon) MarshalJSON() ([]byte, error) { + type noMethod GeolayerdataCommon + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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/#Zoomlevels + Zoom int64 `json:"zoom,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Boundary") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeolayerdataGeo) MarshalJSON() ([]byte, error) { + type noMethod GeolayerdataGeo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GeolayerdataGeoBoundaryItem struct { + Latitude int64 `json:"latitude,omitempty"` + + Longitude int64 `json:"longitude,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Latitude") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeolayerdataGeoBoundaryItem) MarshalJSON() ([]byte, error) { + type noMethod GeolayerdataGeoBoundaryItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GeolayerdataGeoViewport: The viewport for showing this location. This +// is a latitude, longitude rectangle. +type GeolayerdataGeoViewport struct { + Hi *GeolayerdataGeoViewportHi `json:"hi,omitempty"` + + Lo *GeolayerdataGeoViewportLo `json:"lo,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Hi") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeolayerdataGeoViewport) MarshalJSON() ([]byte, error) { + type noMethod GeolayerdataGeoViewport + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GeolayerdataGeoViewportHi struct { + Latitude float64 `json:"latitude,omitempty"` + + Longitude float64 `json:"longitude,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Latitude") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeolayerdataGeoViewportHi) MarshalJSON() ([]byte, error) { + type noMethod GeolayerdataGeoViewportHi + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GeolayerdataGeoViewportLo struct { + Latitude float64 `json:"latitude,omitempty"` + + Longitude float64 `json:"longitude,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Latitude") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeolayerdataGeoViewportLo) MarshalJSON() ([]byte, error) { + type noMethod GeolayerdataGeoViewportLo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Layersummaries) MarshalJSON() ([]byte, error) { + type noMethod Layersummaries + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AnnotationCount") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Layersummary) MarshalJSON() ([]byte, error) { + type noMethod Layersummary + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Metadata struct { + // Items: A list of offline dictionary metadata. + Items []*MetadataItems `json:"items,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Metadata) MarshalJSON() ([]byte, error) { + type noMethod Metadata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type MetadataItems struct { + DownloadUrl string `json:"download_url,omitempty"` + + EncryptedKey string `json:"encrypted_key,omitempty"` + + Language string `json:"language,omitempty"` + + Size int64 `json:"size,omitempty,string"` + + Version int64 `json:"version,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "DownloadUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MetadataItems) MarshalJSON() ([]byte, error) { + type noMethod MetadataItems + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Notification struct { + Body string `json:"body,omitempty"` + + IconUrl string `json:"iconUrl,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + LinkUrl string `json:"linkUrl,omitempty"` + + Title string `json:"title,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Body") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Notification) MarshalJSON() ([]byte, error) { + type noMethod Notification + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Offers struct { + // Items: A list of offers. + Items []*OffersItems `json:"items,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Offers) MarshalJSON() ([]byte, error) { + type noMethod Offers + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OffersItems struct { + ArtUrl string `json:"artUrl,omitempty"` + + GservicesKey string `json:"gservicesKey,omitempty"` + + Id string `json:"id,omitempty"` + + Items []*OffersItemsItems `json:"items,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ArtUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OffersItems) MarshalJSON() ([]byte, error) { + type noMethod OffersItems + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OffersItemsItems struct { + Author string `json:"author,omitempty"` + + CanonicalVolumeLink string `json:"canonicalVolumeLink,omitempty"` + + CoverUrl string `json:"coverUrl,omitempty"` + + Description string `json:"description,omitempty"` + + Title string `json:"title,omitempty"` + + VolumeId string `json:"volumeId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Author") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OffersItemsItems) MarshalJSON() ([]byte, error) { + type noMethod OffersItemsItems + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "EpubCfiPosition") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReadingPosition) MarshalJSON() ([]byte, error) { + type noMethod ReadingPosition + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ConcurrentAccess") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RequestAccess) MarshalJSON() ([]byte, error) { + type noMethod RequestAccess + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Author") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Review) MarshalJSON() ([]byte, error) { + type noMethod Review + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReviewAuthor: Author of this review. +type ReviewAuthor struct { + // DisplayName: Name of this person. + DisplayName string `json:"displayName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReviewAuthor) MarshalJSON() ([]byte, error) { + type noMethod ReviewAuthor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReviewSource: Information regarding the source of this review, when +// the review is not from a Google Books user. +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"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReviewSource) MarshalJSON() ([]byte, error) { + type noMethod ReviewSource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Usersettings struct { + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + // NotesExport: User settings in sub-objects, each for different + // purposes. + NotesExport *UsersettingsNotesExport `json:"notesExport,omitempty"` + + Notification *UsersettingsNotification `json:"notification,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Usersettings) MarshalJSON() ([]byte, error) { + type noMethod Usersettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UsersettingsNotesExport: User settings in sub-objects, each for +// different purposes. +type UsersettingsNotesExport struct { + FolderName string `json:"folderName,omitempty"` + + IsEnabled bool `json:"isEnabled,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FolderName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UsersettingsNotesExport) MarshalJSON() ([]byte, error) { + type noMethod UsersettingsNotesExport + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type UsersettingsNotification struct { + MoreFromAuthors *UsersettingsNotificationMoreFromAuthors `json:"moreFromAuthors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MoreFromAuthors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UsersettingsNotification) MarshalJSON() ([]byte, error) { + type noMethod UsersettingsNotification + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type UsersettingsNotificationMoreFromAuthors struct { + OptedState string `json:"opted_state,omitempty"` + + // ForceSendFields is a list of field names (e.g. "OptedState") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UsersettingsNotificationMoreFromAuthors) MarshalJSON() ([]byte, error) { + type noMethod UsersettingsNotificationMoreFromAuthors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccessInfo") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Volume) MarshalJSON() ([]byte, error) { + type noMethod Volume + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VolumeAccessInfo: 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.). +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"` + + // ForceSendFields is a list of field names (e.g. "AccessViewStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VolumeAccessInfo) MarshalJSON() ([]byte, error) { + type noMethod VolumeAccessInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VolumeAccessInfoEpub: Information about epub content. (In LITE +// projection.) +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"` + + // ForceSendFields is a list of field names (e.g. "AcsTokenLink") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VolumeAccessInfoEpub) MarshalJSON() ([]byte, error) { + type noMethod VolumeAccessInfoEpub + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VolumeAccessInfoPdf: Information about pdf content. (In LITE +// projection.) +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"` + + // ForceSendFields is a list of field names (e.g. "AcsTokenLink") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VolumeAccessInfoPdf) MarshalJSON() ([]byte, error) { + type noMethod VolumeAccessInfoPdf + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VolumeLayerInfo: What layers exist in this volume and high level +// information about them. +type VolumeLayerInfo struct { + // Layers: A layer should appear here if and only if the layer exists + // for this book. + Layers []*VolumeLayerInfoLayers `json:"layers,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Layers") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VolumeLayerInfo) MarshalJSON() ([]byte, error) { + type noMethod VolumeLayerInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "LayerId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VolumeLayerInfoLayers) MarshalJSON() ([]byte, error) { + type noMethod VolumeLayerInfoLayers + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VolumeRecommendedInfo: Recommendation related information for this +// volume. +type VolumeRecommendedInfo struct { + // Explanation: A text explaining why this volume is recommended. + Explanation string `json:"explanation,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Explanation") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VolumeRecommendedInfo) MarshalJSON() ([]byte, error) { + type noMethod VolumeRecommendedInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VolumeSaleInfo: 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). +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"` + + // ForceSendFields is a list of field names (e.g. "BuyLink") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VolumeSaleInfo) MarshalJSON() ([]byte, error) { + type noMethod VolumeSaleInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VolumeSaleInfoListPrice: Suggested retail price. (In LITE +// projection.) +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"` + + // ForceSendFields is a list of field names (e.g. "Amount") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VolumeSaleInfoListPrice) MarshalJSON() ([]byte, error) { + type noMethod VolumeSaleInfoListPrice + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "FinskyOfferType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VolumeSaleInfoOffers) MarshalJSON() ([]byte, error) { + type noMethod VolumeSaleInfoOffers + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VolumeSaleInfoOffersListPrice: Offer list (=undiscounted) price in +// Micros. +type VolumeSaleInfoOffersListPrice struct { + AmountInMicros float64 `json:"amountInMicros,omitempty"` + + CurrencyCode string `json:"currencyCode,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AmountInMicros") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VolumeSaleInfoOffersListPrice) MarshalJSON() ([]byte, error) { + type noMethod VolumeSaleInfoOffersListPrice + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VolumeSaleInfoOffersRentalDuration: The rental duration (for rental +// offers only). +type VolumeSaleInfoOffersRentalDuration struct { + Count float64 `json:"count,omitempty"` + + Unit string `json:"unit,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Count") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VolumeSaleInfoOffersRentalDuration) MarshalJSON() ([]byte, error) { + type noMethod VolumeSaleInfoOffersRentalDuration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VolumeSaleInfoOffersRetailPrice: Offer retail (=discounted) price in +// Micros +type VolumeSaleInfoOffersRetailPrice struct { + AmountInMicros float64 `json:"amountInMicros,omitempty"` + + CurrencyCode string `json:"currencyCode,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AmountInMicros") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VolumeSaleInfoOffersRetailPrice) MarshalJSON() ([]byte, error) { + type noMethod VolumeSaleInfoOffersRetailPrice + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VolumeSaleInfoRetailPrice: 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.) +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"` + + // ForceSendFields is a list of field names (e.g. "Amount") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VolumeSaleInfoRetailPrice) MarshalJSON() ([]byte, error) { + type noMethod VolumeSaleInfoRetailPrice + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VolumeSearchInfo: Search result information related to this volume. +type VolumeSearchInfo struct { + // TextSnippet: A text snippet containing the search query. + TextSnippet string `json:"textSnippet,omitempty"` + + // ForceSendFields is a list of field names (e.g. "TextSnippet") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VolumeSearchInfo) MarshalJSON() ([]byte, error) { + type noMethod VolumeSearchInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VolumeUserInfo: User specific information related to this volume. +// (e.g. page this user last read or whether they purchased this book) +type VolumeUserInfo struct { + // AcquisitionType: How this volume was acquired. + AcquisitionType int64 `json:"acquisitionType,omitempty"` + + // Copy: Copy/Paste accounting information. + Copy *VolumeUserInfoCopy `json:"copy,omitempty"` + + // EntitlementType: Whether this volume is purchased, sample, pd + // download etc. + EntitlementType int64 `json:"entitlementType,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"` + + // ForceSendFields is a list of field names (e.g. "AcquisitionType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VolumeUserInfo) MarshalJSON() ([]byte, error) { + type noMethod VolumeUserInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VolumeUserInfoCopy: Copy/Paste accounting information. +type VolumeUserInfoCopy struct { + AllowedCharacterCount int64 `json:"allowedCharacterCount,omitempty"` + + LimitType string `json:"limitType,omitempty"` + + RemainingCharacterCount int64 `json:"remainingCharacterCount,omitempty"` + + Updated string `json:"updated,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "AllowedCharacterCount") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VolumeUserInfoCopy) MarshalJSON() ([]byte, error) { + type noMethod VolumeUserInfoCopy + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VolumeUserInfoRentalPeriod: Period during this book is/was a valid +// rental. +type VolumeUserInfoRentalPeriod struct { + EndUtcSec int64 `json:"endUtcSec,omitempty,string"` + + StartUtcSec int64 `json:"startUtcSec,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "EndUtcSec") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VolumeUserInfoRentalPeriod) MarshalJSON() ([]byte, error) { + type noMethod VolumeUserInfoRentalPeriod + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type VolumeUserInfoUserUploadedVolumeInfo struct { + ProcessingState string `json:"processingState,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ProcessingState") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VolumeUserInfoUserUploadedVolumeInfo) MarshalJSON() ([]byte, error) { + type noMethod VolumeUserInfoUserUploadedVolumeInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VolumeVolumeInfo: General volume information. +type VolumeVolumeInfo struct { + // AllowAnonLogging: Whether anonymous logging should be allowed. + AllowAnonLogging bool `json:"allowAnonLogging,omitempty"` + + // 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"` + + MaturityRating string `json:"maturityRating,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"` + + // ReadingModes: The reading modes available for this volume. + ReadingModes interface{} `json:"readingModes,omitempty"` + + // SamplePageCount: Total number of sample pages as per publisher + // metadata. + SamplePageCount int64 `json:"samplePageCount,omitempty"` + + // Subtitle: Volume subtitle. (In LITE projection.) + Subtitle string `json:"subtitle,omitempty"` + + // Title: Volume title. (In LITE projection.) + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AllowAnonLogging") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VolumeVolumeInfo) MarshalJSON() ([]byte, error) { + type noMethod VolumeVolumeInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VolumeVolumeInfoDimensions: Physical dimensions of this volume. +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"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VolumeVolumeInfoDimensions) MarshalJSON() ([]byte, error) { + type noMethod VolumeVolumeInfoDimensions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VolumeVolumeInfoImageLinks: A list of image links for all the sizes +// that are available. (In LITE projection.) +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"` + + // ForceSendFields is a list of field names (e.g. "ExtraLarge") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VolumeVolumeInfoImageLinks) MarshalJSON() ([]byte, error) { + type noMethod VolumeVolumeInfoImageLinks + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Identifier") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VolumeVolumeInfoIndustryIdentifiers) MarshalJSON() ([]byte, error) { + type noMethod VolumeVolumeInfoIndustryIdentifiers + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Volume2 struct { + // Items: A list of volumes. + Items []*Volume `json:"items,omitempty"` + + // Kind: Resource type. + Kind string `json:"kind,omitempty"` + + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Volume2) MarshalJSON() ([]byte, error) { + type noMethod Volume2 + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AnnotationDataId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Volumeannotation) MarshalJSON() ([]byte, error) { + type noMethod Volumeannotation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VolumeannotationContentRanges: The content ranges to identify the +// selected text. +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"` + + // ForceSendFields is a list of field names (e.g. "CfiRange") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VolumeannotationContentRanges) MarshalJSON() ([]byte, error) { + type noMethod VolumeannotationContentRanges + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Volumeannotations) MarshalJSON() ([]byte, error) { + type noMethod Volumeannotations + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Volumes) MarshalJSON() ([]byte, error) { + type noMethod Volumes + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "books.bookshelves.get": + +type BookshelvesGetCall struct { + s *Service + userId string + shelf string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BookshelvesGetCall) Fields(s ...googleapi.Field) *BookshelvesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BookshelvesGetCall) IfNoneMatch(entityTag string) *BookshelvesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BookshelvesGetCall) Context(ctx context.Context) *BookshelvesGetCall { + c.ctx_ = ctx + return c +} + +func (c *BookshelvesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/bookshelves/{shelf}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "shelf": c.shelf, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.bookshelves.get" call. +// Exactly one of *Bookshelf or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Bookshelf.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *BookshelvesGetCall) Do() (*Bookshelf, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Bookshelf{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BookshelvesListCall) Fields(s ...googleapi.Field) *BookshelvesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BookshelvesListCall) IfNoneMatch(entityTag string) *BookshelvesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BookshelvesListCall) Context(ctx context.Context) *BookshelvesListCall { + c.ctx_ = ctx + return c +} + +func (c *BookshelvesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/bookshelves") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.bookshelves.list" call. +// Exactly one of *Bookshelves or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Bookshelves.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *BookshelvesListCall) Do() (*Bookshelves, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Bookshelves{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BookshelvesVolumesListCall) Fields(s ...googleapi.Field) *BookshelvesVolumesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BookshelvesVolumesListCall) IfNoneMatch(entityTag string) *BookshelvesVolumesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BookshelvesVolumesListCall) Context(ctx context.Context) *BookshelvesVolumesListCall { + c.ctx_ = ctx + return c +} + +func (c *BookshelvesVolumesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/bookshelves/{shelf}/volumes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "shelf": c.shelf, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.bookshelves.volumes.list" call. +// Exactly one of *Volumes or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Volumes.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BookshelvesVolumesListCall) Do() (*Volumes, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Volumes{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// AddBook: +func (r *CloudloadingService) AddBook() *CloudloadingAddBookCall { + c := &CloudloadingAddBookCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// DriveDocumentId sets the optional parameter "drive_document_id": A +// drive document id. The upload_client_token must not be set. +func (c *CloudloadingAddBookCall) DriveDocumentId(driveDocumentId string) *CloudloadingAddBookCall { + c.opt_["drive_document_id"] = driveDocumentId + return c +} + +// MimeType 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) MimeType(mimeType string) *CloudloadingAddBookCall { + c.opt_["mime_type"] = mimeType + 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 +} + +// UploadClientToken sets the optional parameter "upload_client_token": +func (c *CloudloadingAddBookCall) UploadClientToken(uploadClientToken string) *CloudloadingAddBookCall { + c.opt_["upload_client_token"] = uploadClientToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CloudloadingAddBookCall) Fields(s ...googleapi.Field) *CloudloadingAddBookCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CloudloadingAddBookCall) Context(ctx context.Context) *CloudloadingAddBookCall { + c.ctx_ = ctx + return c +} + +func (c *CloudloadingAddBookCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["drive_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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.cloudloading.addBook" call. +// Exactly one of *BooksCloudloadingResource or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *BooksCloudloadingResource.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CloudloadingAddBookCall) Do() (*BooksCloudloadingResource, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BooksCloudloadingResource{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CloudloadingDeleteBookCall) Fields(s ...googleapi.Field) *CloudloadingDeleteBookCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CloudloadingDeleteBookCall) Context(ctx context.Context) *CloudloadingDeleteBookCall { + c.ctx_ = ctx + return c +} + +func (c *CloudloadingDeleteBookCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("volumeId", fmt.Sprintf("%v", c.volumeId)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.cloudloading.deleteBook" call. +func (c *CloudloadingDeleteBookCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// UpdateBook: +func (r *CloudloadingService) UpdateBook(bookscloudloadingresource *BooksCloudloadingResource) *CloudloadingUpdateBookCall { + c := &CloudloadingUpdateBookCall{s: r.s, opt_: make(map[string]interface{})} + c.bookscloudloadingresource = bookscloudloadingresource + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CloudloadingUpdateBookCall) Fields(s ...googleapi.Field) *CloudloadingUpdateBookCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CloudloadingUpdateBookCall) Context(ctx context.Context) *CloudloadingUpdateBookCall { + c.ctx_ = ctx + return c +} + +func (c *CloudloadingUpdateBookCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.cloudloading.updateBook" call. +// Exactly one of *BooksCloudloadingResource or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *BooksCloudloadingResource.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CloudloadingUpdateBookCall) Do() (*BooksCloudloadingResource, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BooksCloudloadingResource{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "", + // "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.dictionary.listOfflineMetadata": + +type DictionaryListOfflineMetadataCall struct { + s *Service + cpksver string + opt_ map[string]interface{} + ctx_ context.Context +} + +// ListOfflineMetadata: Returns a list of offline dictionary metadata +// available +func (r *DictionaryService) ListOfflineMetadata(cpksver string) *DictionaryListOfflineMetadataCall { + c := &DictionaryListOfflineMetadataCall{s: r.s, opt_: make(map[string]interface{})} + c.cpksver = cpksver + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DictionaryListOfflineMetadataCall) Fields(s ...googleapi.Field) *DictionaryListOfflineMetadataCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DictionaryListOfflineMetadataCall) IfNoneMatch(entityTag string) *DictionaryListOfflineMetadataCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DictionaryListOfflineMetadataCall) Context(ctx context.Context) *DictionaryListOfflineMetadataCall { + c.ctx_ = ctx + return c +} + +func (c *DictionaryListOfflineMetadataCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("cpksver", fmt.Sprintf("%v", c.cpksver)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "dictionary/listOfflineMetadata") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.dictionary.listOfflineMetadata" call. +// Exactly one of *Metadata or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Metadata.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DictionaryListOfflineMetadataCall) Do() (*Metadata, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Metadata{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a list of offline dictionary metadata available", + // "httpMethod": "GET", + // "id": "books.dictionary.listOfflineMetadata", + // "parameterOrder": [ + // "cpksver" + // ], + // "parameters": { + // "cpksver": { + // "description": "The device/version ID from which to request the data.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "dictionary/listOfflineMetadata", + // "response": { + // "$ref": "Metadata" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersGetCall) Fields(s ...googleapi.Field) *LayersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LayersGetCall) IfNoneMatch(entityTag string) *LayersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersGetCall) Context(ctx context.Context) *LayersGetCall { + c.ctx_ = ctx + return c +} + +func (c *LayersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/{volumeId}/layersummary/{summaryId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "volumeId": c.volumeId, + "summaryId": c.summaryId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.layers.get" call. +// Exactly one of *Layersummary or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Layersummary.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *LayersGetCall) Do() (*Layersummary, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Layersummary{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersListCall) Fields(s ...googleapi.Field) *LayersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LayersListCall) IfNoneMatch(entityTag string) *LayersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersListCall) Context(ctx context.Context) *LayersListCall { + c.ctx_ = ctx + return c +} + +func (c *LayersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/{volumeId}/layersummary") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "volumeId": c.volumeId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.layers.list" call. +// Exactly one of *Layersummaries or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Layersummaries.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersListCall) Do() (*Layersummaries, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Layersummaries{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersAnnotationDataGetCall) Fields(s ...googleapi.Field) *LayersAnnotationDataGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LayersAnnotationDataGetCall) IfNoneMatch(entityTag string) *LayersAnnotationDataGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersAnnotationDataGetCall) Context(ctx context.Context) *LayersAnnotationDataGetCall { + c.ctx_ = ctx + return c +} + +func (c *LayersAnnotationDataGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "volumeId": c.volumeId, + "layerId": c.layerId, + "annotationDataId": c.annotationDataId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.layers.annotationData.get" call. +// Exactly one of *Annotationdata or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Annotationdata.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersAnnotationDataGetCall) Do() (*Annotationdata, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Annotationdata{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersAnnotationDataListCall) Fields(s ...googleapi.Field) *LayersAnnotationDataListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LayersAnnotationDataListCall) IfNoneMatch(entityTag string) *LayersAnnotationDataListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersAnnotationDataListCall) Context(ctx context.Context) *LayersAnnotationDataListCall { + c.ctx_ = ctx + return c +} + +func (c *LayersAnnotationDataListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/{volumeId}/layers/{layerId}/data") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "volumeId": c.volumeId, + "layerId": c.layerId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.layers.annotationData.list" call. +// Exactly one of *Annotationsdata or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Annotationsdata.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersAnnotationDataListCall) Do() (*Annotationsdata, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Annotationsdata{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersVolumeAnnotationsGetCall) Fields(s ...googleapi.Field) *LayersVolumeAnnotationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LayersVolumeAnnotationsGetCall) IfNoneMatch(entityTag string) *LayersVolumeAnnotationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersVolumeAnnotationsGetCall) Context(ctx context.Context) *LayersVolumeAnnotationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *LayersVolumeAnnotationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "volumeId": c.volumeId, + "layerId": c.layerId, + "annotationId": c.annotationId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.layers.volumeAnnotations.get" call. +// Exactly one of *Volumeannotation or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *Volumeannotation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersVolumeAnnotationsGetCall) Do() (*Volumeannotation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Volumeannotation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersVolumeAnnotationsListCall) Fields(s ...googleapi.Field) *LayersVolumeAnnotationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LayersVolumeAnnotationsListCall) IfNoneMatch(entityTag string) *LayersVolumeAnnotationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersVolumeAnnotationsListCall) Context(ctx context.Context) *LayersVolumeAnnotationsListCall { + c.ctx_ = ctx + return c +} + +func (c *LayersVolumeAnnotationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/{volumeId}/layers/{layerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "volumeId": c.volumeId, + "layerId": c.layerId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.layers.volumeAnnotations.list" call. +// Exactly one of *Volumeannotations or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *Volumeannotations.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersVolumeAnnotationsListCall) Do() (*Volumeannotations, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Volumeannotations{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the 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.getUserSettings": + +type MyconfigGetUserSettingsCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetUserSettings: Gets the current settings for the user. +func (r *MyconfigService) GetUserSettings() *MyconfigGetUserSettingsCall { + c := &MyconfigGetUserSettingsCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MyconfigGetUserSettingsCall) Fields(s ...googleapi.Field) *MyconfigGetUserSettingsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MyconfigGetUserSettingsCall) IfNoneMatch(entityTag string) *MyconfigGetUserSettingsCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MyconfigGetUserSettingsCall) Context(ctx context.Context) *MyconfigGetUserSettingsCall { + c.ctx_ = ctx + return c +} + +func (c *MyconfigGetUserSettingsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "myconfig/getUserSettings") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.myconfig.getUserSettings" call. +// Exactly one of *Usersettings or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Usersettings.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MyconfigGetUserSettingsCall) Do() (*Usersettings, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Usersettings{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the current settings for the user.", + // "httpMethod": "GET", + // "id": "books.myconfig.getUserSettings", + // "path": "myconfig/getUserSettings", + // "response": { + // "$ref": "Usersettings" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MyconfigReleaseDownloadAccessCall) Fields(s ...googleapi.Field) *MyconfigReleaseDownloadAccessCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MyconfigReleaseDownloadAccessCall) Context(ctx context.Context) *MyconfigReleaseDownloadAccessCall { + c.ctx_ = ctx + return c +} + +func (c *MyconfigReleaseDownloadAccessCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.myconfig.releaseDownloadAccess" call. +// Exactly one of *DownloadAccesses or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DownloadAccesses.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MyconfigReleaseDownloadAccessCall) Do() (*DownloadAccesses, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DownloadAccesses{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "BOTH" - Both concurrent and download licenses. +// "CONCURRENT" - Concurrent access license. +// "DOWNLOAD" - Offline download access license. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MyconfigRequestAccessCall) Fields(s ...googleapi.Field) *MyconfigRequestAccessCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MyconfigRequestAccessCall) Context(ctx context.Context) *MyconfigRequestAccessCall { + c.ctx_ = ctx + return c +} + +func (c *MyconfigRequestAccessCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.myconfig.requestAccess" call. +// Exactly one of *RequestAccess or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *RequestAccess.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MyconfigRequestAccessCall) Do() (*RequestAccess, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RequestAccess{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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' +// +// Possible values: +// "RENTALS" - Client supports 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MyconfigSyncVolumeLicensesCall) Fields(s ...googleapi.Field) *MyconfigSyncVolumeLicensesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MyconfigSyncVolumeLicensesCall) Context(ctx context.Context) *MyconfigSyncVolumeLicensesCall { + c.ctx_ = ctx + return c +} + +func (c *MyconfigSyncVolumeLicensesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.myconfig.syncVolumeLicenses" call. +// Exactly one of *Volumes or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Volumes.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *MyconfigSyncVolumeLicensesCall) Do() (*Volumes, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Volumes{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.myconfig.updateUserSettings": + +type MyconfigUpdateUserSettingsCall struct { + s *Service + usersettings *Usersettings + opt_ map[string]interface{} + ctx_ context.Context +} + +// UpdateUserSettings: Sets the settings for the user. If a sub-object +// is specified, it will overwrite the existing sub-object stored in the +// server. Unspecified sub-objects will retain the existing value. +func (r *MyconfigService) UpdateUserSettings(usersettings *Usersettings) *MyconfigUpdateUserSettingsCall { + c := &MyconfigUpdateUserSettingsCall{s: r.s, opt_: make(map[string]interface{})} + c.usersettings = usersettings + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MyconfigUpdateUserSettingsCall) Fields(s ...googleapi.Field) *MyconfigUpdateUserSettingsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MyconfigUpdateUserSettingsCall) Context(ctx context.Context) *MyconfigUpdateUserSettingsCall { + c.ctx_ = ctx + return c +} + +func (c *MyconfigUpdateUserSettingsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.usersettings) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "myconfig/updateUserSettings") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.myconfig.updateUserSettings" call. +// Exactly one of *Usersettings or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Usersettings.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MyconfigUpdateUserSettingsCall) Do() (*Usersettings, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Usersettings{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the settings for the user. If a sub-object is specified, it will overwrite the existing sub-object stored in the server. Unspecified sub-objects will retain the existing value.", + // "httpMethod": "POST", + // "id": "books.myconfig.updateUserSettings", + // "path": "myconfig/updateUserSettings", + // "request": { + // "$ref": "Usersettings" + // }, + // "response": { + // "$ref": "Usersettings" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.mylibrary.annotations.delete": + +type MylibraryAnnotationsDeleteCall struct { + s *Service + annotationId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MylibraryAnnotationsDeleteCall) Fields(s ...googleapi.Field) *MylibraryAnnotationsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MylibraryAnnotationsDeleteCall) Context(ctx context.Context) *MylibraryAnnotationsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *MylibraryAnnotationsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/annotations/{annotationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "annotationId": c.annotationId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.mylibrary.annotations.delete" call. +func (c *MylibraryAnnotationsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes 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.insert": + +type MylibraryAnnotationsInsertCall struct { + s *Service + annotation *Annotation + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Country sets the optional parameter "country": ISO-3166-1 code to +// override the IP-based location. +func (c *MylibraryAnnotationsInsertCall) Country(country string) *MylibraryAnnotationsInsertCall { + c.opt_["country"] = country + 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MylibraryAnnotationsInsertCall) Fields(s ...googleapi.Field) *MylibraryAnnotationsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MylibraryAnnotationsInsertCall) Context(ctx context.Context) *MylibraryAnnotationsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *MylibraryAnnotationsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["country"]; ok { + params.Set("country", fmt.Sprintf("%v", v)) + } + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.mylibrary.annotations.insert" call. +// Exactly one of *Annotation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Annotation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MylibraryAnnotationsInsertCall) Do() (*Annotation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Annotation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new annotation.", + // "httpMethod": "POST", + // "id": "books.mylibrary.annotations.insert", + // "parameters": { + // "country": { + // "description": "ISO-3166-1 code to override the IP-based location.", + // "location": "query", + // "type": "string" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MylibraryAnnotationsListCall) Fields(s ...googleapi.Field) *MylibraryAnnotationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MylibraryAnnotationsListCall) IfNoneMatch(entityTag string) *MylibraryAnnotationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MylibraryAnnotationsListCall) Context(ctx context.Context) *MylibraryAnnotationsListCall { + c.ctx_ = ctx + return c +} + +func (c *MylibraryAnnotationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.mylibrary.annotations.list" call. +// Exactly one of *Annotations or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Annotations.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MylibraryAnnotationsListCall) Do() (*Annotations, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Annotations{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MylibraryAnnotationsSummaryCall) Fields(s ...googleapi.Field) *MylibraryAnnotationsSummaryCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MylibraryAnnotationsSummaryCall) Context(ctx context.Context) *MylibraryAnnotationsSummaryCall { + c.ctx_ = ctx + return c +} + +func (c *MylibraryAnnotationsSummaryCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("volumeId", fmt.Sprintf("%v", c.volumeId)) + for _, v := range c.layerIds { + params.Add("layerIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.mylibrary.annotations.summary" call. +// Exactly one of *AnnotationsSummary or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AnnotationsSummary.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MylibraryAnnotationsSummaryCall) Do() (*AnnotationsSummary, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AnnotationsSummary{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MylibraryAnnotationsUpdateCall) Fields(s ...googleapi.Field) *MylibraryAnnotationsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MylibraryAnnotationsUpdateCall) Context(ctx context.Context) *MylibraryAnnotationsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *MylibraryAnnotationsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/annotations/{annotationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "annotationId": c.annotationId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.mylibrary.annotations.update" call. +// Exactly one of *Annotation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Annotation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MylibraryAnnotationsUpdateCall) Do() (*Annotation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Annotation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Reason sets the optional parameter "reason": The reason for which the +// book is added to the library. +// +// Possible values: +// "IOS_PREX" - Volumes added from the PREX flow on iOS. +// "IOS_SEARCH" - Volumes added from the Search flow on iOS. +// "ONBOARDING" - Volumes added from the Onboarding flow. +func (c *MylibraryBookshelvesAddVolumeCall) Reason(reason string) *MylibraryBookshelvesAddVolumeCall { + c.opt_["reason"] = reason + 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MylibraryBookshelvesAddVolumeCall) Fields(s ...googleapi.Field) *MylibraryBookshelvesAddVolumeCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MylibraryBookshelvesAddVolumeCall) Context(ctx context.Context) *MylibraryBookshelvesAddVolumeCall { + c.ctx_ = ctx + return c +} + +func (c *MylibraryBookshelvesAddVolumeCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("volumeId", fmt.Sprintf("%v", c.volumeId)) + if v, ok := c.opt_["reason"]; ok { + params.Set("reason", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/bookshelves/{shelf}/addVolume") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "shelf": c.shelf, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.mylibrary.bookshelves.addVolume" call. +func (c *MylibraryBookshelvesAddVolumeCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Adds a volume to a bookshelf.", + // "httpMethod": "POST", + // "id": "books.mylibrary.bookshelves.addVolume", + // "parameterOrder": [ + // "shelf", + // "volumeId" + // ], + // "parameters": { + // "reason": { + // "description": "The reason for which the book is added to the library.", + // "enum": [ + // "IOS_PREX", + // "IOS_SEARCH", + // "ONBOARDING" + // ], + // "enumDescriptions": [ + // "Volumes added from the PREX flow on iOS.", + // "Volumes added from the Search flow on iOS.", + // "Volumes added from the Onboarding flow." + // ], + // "location": "query", + // "type": "string" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MylibraryBookshelvesClearVolumesCall) Fields(s ...googleapi.Field) *MylibraryBookshelvesClearVolumesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MylibraryBookshelvesClearVolumesCall) Context(ctx context.Context) *MylibraryBookshelvesClearVolumesCall { + c.ctx_ = ctx + return c +} + +func (c *MylibraryBookshelvesClearVolumesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/bookshelves/{shelf}/clearVolumes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "shelf": c.shelf, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.mylibrary.bookshelves.clearVolumes" call. +func (c *MylibraryBookshelvesClearVolumesCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MylibraryBookshelvesGetCall) Fields(s ...googleapi.Field) *MylibraryBookshelvesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MylibraryBookshelvesGetCall) IfNoneMatch(entityTag string) *MylibraryBookshelvesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MylibraryBookshelvesGetCall) Context(ctx context.Context) *MylibraryBookshelvesGetCall { + c.ctx_ = ctx + return c +} + +func (c *MylibraryBookshelvesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/bookshelves/{shelf}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "shelf": c.shelf, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.mylibrary.bookshelves.get" call. +// Exactly one of *Bookshelf or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Bookshelf.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MylibraryBookshelvesGetCall) Do() (*Bookshelf, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Bookshelf{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MylibraryBookshelvesListCall) Fields(s ...googleapi.Field) *MylibraryBookshelvesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MylibraryBookshelvesListCall) IfNoneMatch(entityTag string) *MylibraryBookshelvesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MylibraryBookshelvesListCall) Context(ctx context.Context) *MylibraryBookshelvesListCall { + c.ctx_ = ctx + return c +} + +func (c *MylibraryBookshelvesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.mylibrary.bookshelves.list" call. +// Exactly one of *Bookshelves or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Bookshelves.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MylibraryBookshelvesListCall) Do() (*Bookshelves, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Bookshelves{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MylibraryBookshelvesMoveVolumeCall) Fields(s ...googleapi.Field) *MylibraryBookshelvesMoveVolumeCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MylibraryBookshelvesMoveVolumeCall) Context(ctx context.Context) *MylibraryBookshelvesMoveVolumeCall { + c.ctx_ = ctx + return c +} + +func (c *MylibraryBookshelvesMoveVolumeCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/bookshelves/{shelf}/moveVolume") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "shelf": c.shelf, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.mylibrary.bookshelves.moveVolume" call. +func (c *MylibraryBookshelvesMoveVolumeCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Reason sets the optional parameter "reason": The reason for which the +// book is removed from the library. +// +// Possible values: +// "ONBOARDING" - Samples removed from the Onboarding flow. +func (c *MylibraryBookshelvesRemoveVolumeCall) Reason(reason string) *MylibraryBookshelvesRemoveVolumeCall { + c.opt_["reason"] = reason + 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MylibraryBookshelvesRemoveVolumeCall) Fields(s ...googleapi.Field) *MylibraryBookshelvesRemoveVolumeCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MylibraryBookshelvesRemoveVolumeCall) Context(ctx context.Context) *MylibraryBookshelvesRemoveVolumeCall { + c.ctx_ = ctx + return c +} + +func (c *MylibraryBookshelvesRemoveVolumeCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("volumeId", fmt.Sprintf("%v", c.volumeId)) + if v, ok := c.opt_["reason"]; ok { + params.Set("reason", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/bookshelves/{shelf}/removeVolume") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "shelf": c.shelf, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.mylibrary.bookshelves.removeVolume" call. +func (c *MylibraryBookshelvesRemoveVolumeCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Removes a volume from a bookshelf.", + // "httpMethod": "POST", + // "id": "books.mylibrary.bookshelves.removeVolume", + // "parameterOrder": [ + // "shelf", + // "volumeId" + // ], + // "parameters": { + // "reason": { + // "description": "The reason for which the book is removed from the library.", + // "enum": [ + // "ONBOARDING" + // ], + // "enumDescriptions": [ + // "Samples removed from the Onboarding flow." + // ], + // "location": "query", + // "type": "string" + // }, + // "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "full" - Includes all volume data. +// "lite" - Includes a subset of fields in volumeInfo and accessInfo. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MylibraryBookshelvesVolumesListCall) Fields(s ...googleapi.Field) *MylibraryBookshelvesVolumesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MylibraryBookshelvesVolumesListCall) IfNoneMatch(entityTag string) *MylibraryBookshelvesVolumesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MylibraryBookshelvesVolumesListCall) Context(ctx context.Context) *MylibraryBookshelvesVolumesListCall { + c.ctx_ = ctx + return c +} + +func (c *MylibraryBookshelvesVolumesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/bookshelves/{shelf}/volumes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "shelf": c.shelf, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.mylibrary.bookshelves.volumes.list" call. +// Exactly one of *Volumes or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Volumes.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *MylibraryBookshelvesVolumesListCall) Do() (*Volumes, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Volumes{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MylibraryReadingpositionsGetCall) Fields(s ...googleapi.Field) *MylibraryReadingpositionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MylibraryReadingpositionsGetCall) IfNoneMatch(entityTag string) *MylibraryReadingpositionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MylibraryReadingpositionsGetCall) Context(ctx context.Context) *MylibraryReadingpositionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *MylibraryReadingpositionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/readingpositions/{volumeId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "volumeId": c.volumeId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.mylibrary.readingpositions.get" call. +// Exactly one of *ReadingPosition or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ReadingPosition.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MylibraryReadingpositionsGetCall) Do() (*ReadingPosition, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ReadingPosition{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "bookmark" - User chose bookmark within volume. +// "chapter" - User selected chapter from list. +// "next-page" - Next page event. +// "prev-page" - Previous page event. +// "scroll" - User navigated to page. +// "search" - User chose search results within volume. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MylibraryReadingpositionsSetPositionCall) Fields(s ...googleapi.Field) *MylibraryReadingpositionsSetPositionCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MylibraryReadingpositionsSetPositionCall) Context(ctx context.Context) *MylibraryReadingpositionsSetPositionCall { + c.ctx_ = ctx + return c +} + +func (c *MylibraryReadingpositionsSetPositionCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "mylibrary/readingpositions/{volumeId}/setPosition") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "volumeId": c.volumeId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.mylibrary.readingpositions.setPosition" call. +func (c *MylibraryReadingpositionsSetPositionCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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.notification.get": + +type NotificationGetCall struct { + s *Service + notificationId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns notification details for a given notification id. +func (r *NotificationService) Get(notificationId string) *NotificationGetCall { + c := &NotificationGetCall{s: r.s, opt_: make(map[string]interface{})} + c.notificationId = notificationId + return c +} + +// Locale sets the optional parameter "locale": ISO-639-1 language and +// ISO-3166-1 country code. Ex: 'en_US'. Used for generating +// notification title and body. +func (c *NotificationGetCall) Locale(locale string) *NotificationGetCall { + c.opt_["locale"] = locale + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *NotificationGetCall) Source(source string) *NotificationGetCall { + c.opt_["source"] = source + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *NotificationGetCall) Fields(s ...googleapi.Field) *NotificationGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *NotificationGetCall) IfNoneMatch(entityTag string) *NotificationGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *NotificationGetCall) Context(ctx context.Context) *NotificationGetCall { + c.ctx_ = ctx + return c +} + +func (c *NotificationGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("notification_id", fmt.Sprintf("%v", c.notificationId)) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "notification/get") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.notification.get" call. +// Exactly one of *Notification or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Notification.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *NotificationGetCall) Do() (*Notification, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Notification{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns notification details for a given notification id.", + // "httpMethod": "GET", + // "id": "books.notification.get", + // "parameterOrder": [ + // "notification_id" + // ], + // "parameters": { + // "locale": { + // "description": "ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating notification title and body.", + // "location": "query", + // "type": "string" + // }, + // "notification_id": { + // "description": "String to identify the notification.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "notification/get", + // "response": { + // "$ref": "Notification" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.onboarding.listCategories": + +type OnboardingListCategoriesCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// ListCategories: List categories for onboarding experience. +func (r *OnboardingService) ListCategories() *OnboardingListCategoriesCall { + c := &OnboardingListCategoriesCall{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. Default is en-US if unset. +func (c *OnboardingListCategoriesCall) Locale(locale string) *OnboardingListCategoriesCall { + c.opt_["locale"] = locale + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OnboardingListCategoriesCall) Fields(s ...googleapi.Field) *OnboardingListCategoriesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OnboardingListCategoriesCall) IfNoneMatch(entityTag string) *OnboardingListCategoriesCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OnboardingListCategoriesCall) Context(ctx context.Context) *OnboardingListCategoriesCall { + c.ctx_ = ctx + return c +} + +func (c *OnboardingListCategoriesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "onboarding/listCategories") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.onboarding.listCategories" call. +// Exactly one of *Category or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Category.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OnboardingListCategoriesCall) Do() (*Category, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Category{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List categories for onboarding experience.", + // "httpMethod": "GET", + // "id": "books.onboarding.listCategories", + // "parameters": { + // "locale": { + // "description": "ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "onboarding/listCategories", + // "response": { + // "$ref": "Category" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.onboarding.listCategoryVolumes": + +type OnboardingListCategoryVolumesCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// ListCategoryVolumes: List available volumes under categories for +// onboarding experience. +func (r *OnboardingService) ListCategoryVolumes() *OnboardingListCategoryVolumesCall { + c := &OnboardingListCategoryVolumesCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// CategoryId sets the optional parameter "categoryId": List of category +// ids requested. +func (c *OnboardingListCategoryVolumesCall) CategoryId(categoryId string) *OnboardingListCategoryVolumesCall { + c.opt_["categoryId"] = categoryId + return c +} + +// Locale sets the optional parameter "locale": ISO-639-1 language and +// ISO-3166-1 country code. Default is en-US if unset. +func (c *OnboardingListCategoryVolumesCall) Locale(locale string) *OnboardingListCategoryVolumesCall { + c.opt_["locale"] = locale + return c +} + +// MaxAllowedMaturityRating sets the optional parameter +// "maxAllowedMaturityRating": The maximum allowed maturity rating of +// returned volumes. Books with a higher maturity rating are filtered +// out. +// +// Possible values: +// "mature" - Show books which are rated mature or lower. +// "not-mature" - Show books which are rated not mature. +func (c *OnboardingListCategoryVolumesCall) MaxAllowedMaturityRating(maxAllowedMaturityRating string) *OnboardingListCategoryVolumesCall { + c.opt_["maxAllowedMaturityRating"] = maxAllowedMaturityRating + return c +} + +// PageSize sets the optional parameter "pageSize": Number of maximum +// results per page to be included in the response. +func (c *OnboardingListCategoryVolumesCall) PageSize(pageSize int64) *OnboardingListCategoryVolumesCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": The value of the +// nextToken from the previous page. +func (c *OnboardingListCategoryVolumesCall) PageToken(pageToken string) *OnboardingListCategoryVolumesCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OnboardingListCategoryVolumesCall) Fields(s ...googleapi.Field) *OnboardingListCategoryVolumesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OnboardingListCategoryVolumesCall) IfNoneMatch(entityTag string) *OnboardingListCategoryVolumesCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OnboardingListCategoryVolumesCall) Context(ctx context.Context) *OnboardingListCategoryVolumesCall { + c.ctx_ = ctx + return c +} + +func (c *OnboardingListCategoryVolumesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["categoryId"]; ok { + params.Set("categoryId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxAllowedMaturityRating"]; ok { + params.Set("maxAllowedMaturityRating", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "onboarding/listCategoryVolumes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.onboarding.listCategoryVolumes" call. +// Exactly one of *Volume2 or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Volume2.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OnboardingListCategoryVolumesCall) Do() (*Volume2, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Volume2{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List available volumes under categories for onboarding experience.", + // "httpMethod": "GET", + // "id": "books.onboarding.listCategoryVolumes", + // "parameters": { + // "categoryId": { + // "description": "List of category ids requested.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "locale": { + // "description": "ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset.", + // "location": "query", + // "type": "string" + // }, + // "maxAllowedMaturityRating": { + // "description": "The maximum allowed maturity rating of returned volumes. Books with a higher maturity rating are filtered out.", + // "enum": [ + // "mature", + // "not-mature" + // ], + // "enumDescriptions": [ + // "Show books which are rated mature or lower.", + // "Show books which are rated not mature." + // ], + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "Number of maximum results per page to be included in the response.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value of the nextToken from the previous page.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "onboarding/listCategoryVolumes", + // "response": { + // "$ref": "Volume2" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.personalizedstream.get": + +type PersonalizedstreamGetCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns a stream of personalized book clusters +func (r *PersonalizedstreamService) Get() *PersonalizedstreamGetCall { + c := &PersonalizedstreamGetCall{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 *PersonalizedstreamGetCall) Locale(locale string) *PersonalizedstreamGetCall { + c.opt_["locale"] = locale + return c +} + +// MaxAllowedMaturityRating sets the optional parameter +// "maxAllowedMaturityRating": The maximum allowed maturity rating of +// returned recommendations. Books with a higher maturity rating are +// filtered out. +// +// Possible values: +// "mature" - Show books which are rated mature or lower. +// "not-mature" - Show books which are rated not mature. +func (c *PersonalizedstreamGetCall) MaxAllowedMaturityRating(maxAllowedMaturityRating string) *PersonalizedstreamGetCall { + c.opt_["maxAllowedMaturityRating"] = maxAllowedMaturityRating + return c +} + +// Source sets the optional parameter "source": String to identify the +// originator of this request. +func (c *PersonalizedstreamGetCall) Source(source string) *PersonalizedstreamGetCall { + c.opt_["source"] = source + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PersonalizedstreamGetCall) Fields(s ...googleapi.Field) *PersonalizedstreamGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PersonalizedstreamGetCall) IfNoneMatch(entityTag string) *PersonalizedstreamGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PersonalizedstreamGetCall) Context(ctx context.Context) *PersonalizedstreamGetCall { + c.ctx_ = ctx + return c +} + +func (c *PersonalizedstreamGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxAllowedMaturityRating"]; ok { + params.Set("maxAllowedMaturityRating", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "personalizedstream/get") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.personalizedstream.get" call. +// Exactly one of *Discoveryclusters or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *Discoveryclusters.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PersonalizedstreamGetCall) Do() (*Discoveryclusters, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Discoveryclusters{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a stream of personalized book clusters", + // "httpMethod": "GET", + // "id": "books.personalizedstream.get", + // "parameters": { + // "locale": { + // "description": "ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations.", + // "location": "query", + // "type": "string" + // }, + // "maxAllowedMaturityRating": { + // "description": "The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out.", + // "enum": [ + // "mature", + // "not-mature" + // ], + // "enumDescriptions": [ + // "Show books which are rated mature or lower.", + // "Show books which are rated not mature." + // ], + // "location": "query", + // "type": "string" + // }, + // "source": { + // "description": "String to identify the originator of this request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "personalizedstream/get", + // "response": { + // "$ref": "Discoveryclusters" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.promooffer.accept": + +type PromoofferAcceptCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// Accept: +func (r *PromoofferService) Accept() *PromoofferAcceptCall { + c := &PromoofferAcceptCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// AndroidId sets the optional parameter "androidId": device android_id +func (c *PromoofferAcceptCall) AndroidId(androidId string) *PromoofferAcceptCall { + c.opt_["androidId"] = androidId + return c +} + +// Device sets the optional parameter "device": device device +func (c *PromoofferAcceptCall) Device(device string) *PromoofferAcceptCall { + c.opt_["device"] = device + return c +} + +// Manufacturer sets the optional parameter "manufacturer": device +// manufacturer +func (c *PromoofferAcceptCall) Manufacturer(manufacturer string) *PromoofferAcceptCall { + c.opt_["manufacturer"] = manufacturer + return c +} + +// Model sets the optional parameter "model": device model +func (c *PromoofferAcceptCall) Model(model string) *PromoofferAcceptCall { + c.opt_["model"] = model + return c +} + +// OfferId sets the optional parameter "offerId": +func (c *PromoofferAcceptCall) OfferId(offerId string) *PromoofferAcceptCall { + c.opt_["offerId"] = offerId + return c +} + +// Product sets the optional parameter "product": device product +func (c *PromoofferAcceptCall) Product(product string) *PromoofferAcceptCall { + c.opt_["product"] = product + return c +} + +// Serial sets the optional parameter "serial": device serial +func (c *PromoofferAcceptCall) Serial(serial string) *PromoofferAcceptCall { + c.opt_["serial"] = serial + return c +} + +// VolumeId sets the optional parameter "volumeId": Volume id to +// exercise the offer +func (c *PromoofferAcceptCall) VolumeId(volumeId string) *PromoofferAcceptCall { + c.opt_["volumeId"] = volumeId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PromoofferAcceptCall) Fields(s ...googleapi.Field) *PromoofferAcceptCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PromoofferAcceptCall) Context(ctx context.Context) *PromoofferAcceptCall { + c.ctx_ = ctx + return c +} + +func (c *PromoofferAcceptCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["androidId"]; ok { + params.Set("androidId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["device"]; ok { + params.Set("device", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["manufacturer"]; ok { + params.Set("manufacturer", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["model"]; ok { + params.Set("model", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["offerId"]; ok { + params.Set("offerId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["product"]; ok { + params.Set("product", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["serial"]; ok { + params.Set("serial", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["volumeId"]; ok { + params.Set("volumeId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "promooffer/accept") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.promooffer.accept" call. +func (c *PromoofferAcceptCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "", + // "httpMethod": "POST", + // "id": "books.promooffer.accept", + // "parameters": { + // "androidId": { + // "description": "device android_id", + // "location": "query", + // "type": "string" + // }, + // "device": { + // "description": "device device", + // "location": "query", + // "type": "string" + // }, + // "manufacturer": { + // "description": "device manufacturer", + // "location": "query", + // "type": "string" + // }, + // "model": { + // "description": "device model", + // "location": "query", + // "type": "string" + // }, + // "offerId": { + // "location": "query", + // "type": "string" + // }, + // "product": { + // "description": "device product", + // "location": "query", + // "type": "string" + // }, + // "serial": { + // "description": "device serial", + // "location": "query", + // "type": "string" + // }, + // "volumeId": { + // "description": "Volume id to exercise the offer", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "promooffer/accept", + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.promooffer.dismiss": + +type PromoofferDismissCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// Dismiss: +func (r *PromoofferService) Dismiss() *PromoofferDismissCall { + c := &PromoofferDismissCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// AndroidId sets the optional parameter "androidId": device android_id +func (c *PromoofferDismissCall) AndroidId(androidId string) *PromoofferDismissCall { + c.opt_["androidId"] = androidId + return c +} + +// Device sets the optional parameter "device": device device +func (c *PromoofferDismissCall) Device(device string) *PromoofferDismissCall { + c.opt_["device"] = device + return c +} + +// Manufacturer sets the optional parameter "manufacturer": device +// manufacturer +func (c *PromoofferDismissCall) Manufacturer(manufacturer string) *PromoofferDismissCall { + c.opt_["manufacturer"] = manufacturer + return c +} + +// Model sets the optional parameter "model": device model +func (c *PromoofferDismissCall) Model(model string) *PromoofferDismissCall { + c.opt_["model"] = model + return c +} + +// OfferId sets the optional parameter "offerId": Offer to dimiss +func (c *PromoofferDismissCall) OfferId(offerId string) *PromoofferDismissCall { + c.opt_["offerId"] = offerId + return c +} + +// Product sets the optional parameter "product": device product +func (c *PromoofferDismissCall) Product(product string) *PromoofferDismissCall { + c.opt_["product"] = product + return c +} + +// Serial sets the optional parameter "serial": device serial +func (c *PromoofferDismissCall) Serial(serial string) *PromoofferDismissCall { + c.opt_["serial"] = serial + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PromoofferDismissCall) Fields(s ...googleapi.Field) *PromoofferDismissCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PromoofferDismissCall) Context(ctx context.Context) *PromoofferDismissCall { + c.ctx_ = ctx + return c +} + +func (c *PromoofferDismissCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["androidId"]; ok { + params.Set("androidId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["device"]; ok { + params.Set("device", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["manufacturer"]; ok { + params.Set("manufacturer", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["model"]; ok { + params.Set("model", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["offerId"]; ok { + params.Set("offerId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["product"]; ok { + params.Set("product", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["serial"]; ok { + params.Set("serial", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "promooffer/dismiss") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.promooffer.dismiss" call. +func (c *PromoofferDismissCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "", + // "httpMethod": "POST", + // "id": "books.promooffer.dismiss", + // "parameters": { + // "androidId": { + // "description": "device android_id", + // "location": "query", + // "type": "string" + // }, + // "device": { + // "description": "device device", + // "location": "query", + // "type": "string" + // }, + // "manufacturer": { + // "description": "device manufacturer", + // "location": "query", + // "type": "string" + // }, + // "model": { + // "description": "device model", + // "location": "query", + // "type": "string" + // }, + // "offerId": { + // "description": "Offer to dimiss", + // "location": "query", + // "type": "string" + // }, + // "product": { + // "description": "device product", + // "location": "query", + // "type": "string" + // }, + // "serial": { + // "description": "device serial", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "promooffer/dismiss", + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.promooffer.get": + +type PromoofferGetCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns a list of promo offers available to the user +func (r *PromoofferService) Get() *PromoofferGetCall { + c := &PromoofferGetCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// AndroidId sets the optional parameter "androidId": device android_id +func (c *PromoofferGetCall) AndroidId(androidId string) *PromoofferGetCall { + c.opt_["androidId"] = androidId + return c +} + +// Device sets the optional parameter "device": device device +func (c *PromoofferGetCall) Device(device string) *PromoofferGetCall { + c.opt_["device"] = device + return c +} + +// Manufacturer sets the optional parameter "manufacturer": device +// manufacturer +func (c *PromoofferGetCall) Manufacturer(manufacturer string) *PromoofferGetCall { + c.opt_["manufacturer"] = manufacturer + return c +} + +// Model sets the optional parameter "model": device model +func (c *PromoofferGetCall) Model(model string) *PromoofferGetCall { + c.opt_["model"] = model + return c +} + +// Product sets the optional parameter "product": device product +func (c *PromoofferGetCall) Product(product string) *PromoofferGetCall { + c.opt_["product"] = product + return c +} + +// Serial sets the optional parameter "serial": device serial +func (c *PromoofferGetCall) Serial(serial string) *PromoofferGetCall { + c.opt_["serial"] = serial + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PromoofferGetCall) Fields(s ...googleapi.Field) *PromoofferGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PromoofferGetCall) IfNoneMatch(entityTag string) *PromoofferGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PromoofferGetCall) Context(ctx context.Context) *PromoofferGetCall { + c.ctx_ = ctx + return c +} + +func (c *PromoofferGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["androidId"]; ok { + params.Set("androidId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["device"]; ok { + params.Set("device", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["manufacturer"]; ok { + params.Set("manufacturer", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["model"]; ok { + params.Set("model", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["product"]; ok { + params.Set("product", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["serial"]; ok { + params.Set("serial", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "promooffer/get") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.promooffer.get" call. +// Exactly one of *Offers or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Offers.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *PromoofferGetCall) Do() (*Offers, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Offers{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a list of promo offers available to the user", + // "httpMethod": "GET", + // "id": "books.promooffer.get", + // "parameters": { + // "androidId": { + // "description": "device android_id", + // "location": "query", + // "type": "string" + // }, + // "device": { + // "description": "device device", + // "location": "query", + // "type": "string" + // }, + // "manufacturer": { + // "description": "device manufacturer", + // "location": "query", + // "type": "string" + // }, + // "model": { + // "description": "device model", + // "location": "query", + // "type": "string" + // }, + // "product": { + // "description": "device product", + // "location": "query", + // "type": "string" + // }, + // "serial": { + // "description": "device serial", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "promooffer/get", + // "response": { + // "$ref": "Offers" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/books" + // ] + // } + +} + +// method id "books.volumes.get": + +type VolumesGetCall struct { + s *Service + volumeId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "full" - Includes all volume data. +// "lite" - Includes a subset of fields in volumeInfo and accessInfo. +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 +} + +// UserLibraryConsistentRead sets the optional parameter +// "user_library_consistent_read": +func (c *VolumesGetCall) UserLibraryConsistentRead(userLibraryConsistentRead bool) *VolumesGetCall { + c.opt_["user_library_consistent_read"] = userLibraryConsistentRead + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VolumesGetCall) Fields(s ...googleapi.Field) *VolumesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *VolumesGetCall) IfNoneMatch(entityTag string) *VolumesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VolumesGetCall) Context(ctx context.Context) *VolumesGetCall { + c.ctx_ = ctx + return c +} + +func (c *VolumesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["user_library_consistent_read"]; ok { + params.Set("user_library_consistent_read", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/{volumeId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "volumeId": c.volumeId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.volumes.get" call. +// Exactly one of *Volume or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Volume.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *VolumesGetCall) Do() (*Volume, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Volume{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets 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" + // }, + // "user_library_consistent_read": { + // "location": "query", + // "type": "boolean" + // }, + // "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "epub" - All volumes with epub. +func (c *VolumesListCall) Download(download string) *VolumesListCall { + c.opt_["download"] = download + return c +} + +// Filter sets the optional parameter "filter": Filter search results. +// +// Possible values: +// "ebooks" - All Google eBooks. +// "free-ebooks" - Google eBook with full volume text viewability. +// "full" - Public can view entire volume text. +// "paid-ebooks" - Google eBook with a price. +// "partial" - Public able to see parts of text. +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. +// +// Possible values: +// "my-library" - Restrict to the user's library, any shelf. +// "no-restrict" - Do not restrict based on 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. +// +// Possible values: +// "newest" - Most recently published. +// "relevance" - Relevance to search terms. +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. +// +// Possible values: +// "all" - All volume content types. +// "books" - Just books. +// "magazines" - Just 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. +// +// Possible values: +// "full" - Includes all volume data. +// "lite" - Includes a subset of fields in volumeInfo and accessInfo. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VolumesListCall) Fields(s ...googleapi.Field) *VolumesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *VolumesListCall) IfNoneMatch(entityTag string) *VolumesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VolumesListCall) Context(ctx context.Context) *VolumesListCall { + c.ctx_ = ctx + return c +} + +func (c *VolumesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.volumes.list" call. +// Exactly one of *Volumes or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Volumes.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *VolumesListCall) Do() (*Volumes, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Volumes{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "end-of-sample" - Recommendations for display end-of-sample. +// "end-of-volume" - Recommendations for display end-of-volume. +// "related-for-play" - Related volumes for Play Store. +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 +} + +// MaxAllowedMaturityRating sets the optional parameter +// "maxAllowedMaturityRating": The maximum allowed maturity rating of +// returned recommendations. Books with a higher maturity rating are +// filtered out. +// +// Possible values: +// "mature" - Show books which are rated mature or lower. +// "not-mature" - Show books which are rated not mature. +func (c *VolumesAssociatedListCall) MaxAllowedMaturityRating(maxAllowedMaturityRating string) *VolumesAssociatedListCall { + c.opt_["maxAllowedMaturityRating"] = maxAllowedMaturityRating + 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VolumesAssociatedListCall) Fields(s ...googleapi.Field) *VolumesAssociatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *VolumesAssociatedListCall) IfNoneMatch(entityTag string) *VolumesAssociatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VolumesAssociatedListCall) Context(ctx context.Context) *VolumesAssociatedListCall { + c.ctx_ = ctx + return c +} + +func (c *VolumesAssociatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["maxAllowedMaturityRating"]; ok { + params.Set("maxAllowedMaturityRating", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "volumes/{volumeId}/associated") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "volumeId": c.volumeId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.volumes.associated.list" call. +// Exactly one of *Volumes or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Volumes.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *VolumesAssociatedListCall) Do() (*Volumes, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Volumes{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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", + // "related-for-play" + // ], + // "enumDescriptions": [ + // "Recommendations for display end-of-sample.", + // "Recommendations for display end-of-volume.", + // "Related volumes for Play Store." + // ], + // "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" + // }, + // "maxAllowedMaturityRating": { + // "description": "The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out.", + // "enum": [ + // "mature", + // "not-mature" + // ], + // "enumDescriptions": [ + // "Show books which are rated mature or lower.", + // "Show books which are rated not mature." + // ], + // "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{} + ctx_ context.Context +} + +// 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 +// +// Possible values: +// "PREORDERED" - Preordered books (not yet available) +// "PREVIOUSLY_RENTED" - User-rented books past their expiration time +// "PUBLIC_DOMAIN" - Public domain books +// "PURCHASED" - Purchased books +// "RENTED" - User-rented books +// "SAMPLE" - Sample books +// "UPLOADED" - User uploaded books +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. +// +// Possible values: +// "COMPLETED_FAILED" - The volume processing hase failed. +// "COMPLETED_SUCCESS" - The volume processing was completed. +// "RUNNING" - The volume processing is not completed. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VolumesMybooksListCall) Fields(s ...googleapi.Field) *VolumesMybooksListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *VolumesMybooksListCall) IfNoneMatch(entityTag string) *VolumesMybooksListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VolumesMybooksListCall) Context(ctx context.Context) *VolumesMybooksListCall { + c.ctx_ = ctx + return c +} + +func (c *VolumesMybooksListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.volumes.mybooks.list" call. +// Exactly one of *Volumes or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Volumes.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *VolumesMybooksListCall) Do() (*Volumes, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Volumes{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// MaxAllowedMaturityRating sets the optional parameter +// "maxAllowedMaturityRating": The maximum allowed maturity rating of +// returned recommendations. Books with a higher maturity rating are +// filtered out. +// +// Possible values: +// "mature" - Show books which are rated mature or lower. +// "not-mature" - Show books which are rated not mature. +func (c *VolumesRecommendedListCall) MaxAllowedMaturityRating(maxAllowedMaturityRating string) *VolumesRecommendedListCall { + c.opt_["maxAllowedMaturityRating"] = maxAllowedMaturityRating + 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VolumesRecommendedListCall) Fields(s ...googleapi.Field) *VolumesRecommendedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *VolumesRecommendedListCall) IfNoneMatch(entityTag string) *VolumesRecommendedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VolumesRecommendedListCall) Context(ctx context.Context) *VolumesRecommendedListCall { + c.ctx_ = ctx + return c +} + +func (c *VolumesRecommendedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["locale"]; ok { + params.Set("locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxAllowedMaturityRating"]; ok { + params.Set("maxAllowedMaturityRating", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["source"]; ok { + params.Set("source", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.volumes.recommended.list" call. +// Exactly one of *Volumes or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Volumes.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *VolumesRecommendedListCall) Do() (*Volumes, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Volumes{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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" + // }, + // "maxAllowedMaturityRating": { + // "description": "The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out.", + // "enum": [ + // "mature", + // "not-mature" + // ], + // "enumDescriptions": [ + // "Show books which are rated mature or lower.", + // "Show books which are rated not mature." + // ], + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VolumesRecommendedRateCall) Fields(s ...googleapi.Field) *VolumesRecommendedRateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VolumesRecommendedRateCall) Context(ctx context.Context) *VolumesRecommendedRateCall { + c.ctx_ = ctx + return c +} + +func (c *VolumesRecommendedRateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.volumes.recommended.rate" call. +// Exactly one of *BooksVolumesRecommendedRateResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *BooksVolumesRecommendedRateResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *VolumesRecommendedRateCall) Do() (*BooksVolumesRecommendedRateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BooksVolumesRecommendedRateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "COMPLETED_FAILED" - The volume processing hase failed. +// "COMPLETED_SUCCESS" - The volume processing was completed. +// "RUNNING" - The volume processing is not completed. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VolumesUseruploadedListCall) Fields(s ...googleapi.Field) *VolumesUseruploadedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *VolumesUseruploadedListCall) IfNoneMatch(entityTag string) *VolumesUseruploadedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VolumesUseruploadedListCall) Context(ctx context.Context) *VolumesUseruploadedListCall { + c.ctx_ = ctx + return c +} + +func (c *VolumesUseruploadedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "books.volumes.useruploaded.list" call. +// Exactly one of *Volumes or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Volumes.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *VolumesUseruploadedListCall) Do() (*Volumes, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Volumes{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/Godeps/_workspace/src/google.golang.org/api/calendar/v3/calendar-api.json b/Godeps/_workspace/src/google.golang.org/api/calendar/v3/calendar-api.json new file mode 100644 index 000000000..887eadf1f --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/calendar/v3/calendar-api.json @@ -0,0 +1,2666 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/l_k1z-nMnRAcKQK6zuQvkZvA4dI\"", + "discoveryVersion": "v1", + "id": "calendar:v3", + "name": "calendar", + "version": "v3", + "revision": "20150902", + "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, in which case nextSyncToken is provided." + }, + "nextSyncToken": { + "type": "string", + "description": "Token used at a later point in time to retrieve only the entries that have changed since this result was returned. Omitted if further results are available, in which case nextPageToken is provided." + } + } + }, + "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. To retrieve IDs call the calendarList.list() method." + }, + "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. (Formatted as an IANA Time Zone Database name, e.g. \"Europe/Zurich\".) 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. Omitted if no further results are available, in which case nextSyncToken is provided." + }, + "nextSyncToken": { + "type": "string", + "description": "Token used at a later point in time to retrieve only the entries that have changed since this result was returned. Omitted if further results are available, in which case nextPageToken is provided." + } + } + }, + "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 hexadecimal format \"#0088aa\". This property supersedes the index-based colorId property. To set or change this property, you need to specify colorRgbFormat=true in the parameters of the insert, update and patch methods. 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). This property is superseded by the backgroundColor and foregroundColor properties and can be ignored when using these properties. Optional." + }, + "defaultReminders": { + "type": "array", + "description": "The default reminders that the authenticated user has for this calendar.", + "items": { + "$ref": "EventReminder" + } + }, + "deleted": { + "type": "boolean", + "description": "Whether this calendar list entry has been deleted from the calendar list. Read-only. Optional. The default is False.", + "default": "false" + }, + "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 hexadecimal format \"#ffffff\". This property supersedes the index-based colorId property. To set or change this property, you need to specify colorRgbFormat=true in the parameters of the insert, update and patch methods. 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. SMS reminders are only available for Google Apps for Work, Education, and Government customers.", + "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": "A global palette of calendar colors, mapping from the color ID to its definition. A 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": "A global 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 RFC3339 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" + }, + "attachments": { + "type": "array", + "description": "File attachments for the event. Currently only Google Drive attachments are supported.\nIn order to modify attachments the supportsAttachments request parameter should be set to true.\nThere can be at most 25 attachments per event,", + "items": { + "$ref": "EventAttachment" + } + }, + "attendees": { + "type": "array", + "description": "The attendees of the event. See the Events with attendees guide for more information on scheduling events with other calendar users.", + "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 RFC3339 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. It corresponds to theid field in the People collection of the Google+ API" + }, + "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. The height must be an integer greater than 0. Optional.", + "format": "int32" + }, + "iconLink": { + "type": "string", + "description": "The gadget's icon URL. The URL scheme must be HTTPS." + }, + "link": { + "type": "string", + "description": "The gadget's URL. The URL scheme must be HTTPS." + }, + "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. The width must be an integer greater than 0. 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 unique identifier as defined in RFC5545. It is used to uniquely identify events accross calendaring systems and must be supplied when importing events via the import method.\nNote that the icalUID and the id are not identical and only one of them should be supplied at event creation time. One difference in their semantics is that in recurring events, all occurrences of one event have different ids while they all share the same icalUIDs.", + "annotations": { + "required": [ + "calendar.events.import" + ] + } + }, + "id": { + "type": "string", + "description": "Opaque 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.\nIf you do not specify an ID, it will be automatically generated by the server.\nNote that the icalUID and the id are not identical and only one of them should be supplied at event creation time. One difference in their semantics is that in recurring events, all occurrences of one event have different ids while they all share the same icalUIDs." + }, + "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. It must be a valid email address as per RFC5322." + }, + "id": { + "type": "string", + "description": "The organizer's Profile ID, if available. It corresponds to theid field in the People collection of the Google+ API" + }, + "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, as specified in RFC5545. Note that DTSTART and DTEND lines are not allowed in this field; event start and end times are specified in the start and end fields. 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 id of the recurring event to which this instance belongs. 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. The maximum number of override reminders is 5.", + "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 from which the event was created. For example, a web page, an email message or any document identifiable by an URL with HTTP or HTTPS scheme. Can only be seen or modified 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. The URL scheme 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 RFC3339 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" + } + } + }, + "EventAttachment": { + "id": "EventAttachment", + "type": "object", + "properties": { + "fileId": { + "type": "string", + "description": "ID of the attached file. Read-only.\nFor Google Drive files, this is the ID of the corresponding Files resource entry in the Drive API." + }, + "fileUrl": { + "type": "string", + "description": "URL link to the attachment.\nFor adding Google Drive file attachments use the same format as in alternateLink property of the Files resource in the Drive API.", + "annotations": { + "required": [ + "calendar.events.import", + "calendar.events.insert", + "calendar.events.update" + ] + } + }, + "iconLink": { + "type": "string", + "description": "URL link to the attachment's icon. Read-only." + }, + "mimeType": { + "type": "string", + "description": "Internet media type (MIME type) of the attachment." + }, + "title": { + "type": "string", + "description": "Attachment title." + } + } + }, + "EventAttendee": { + "id": "EventAttendee", + "type": "object", + "properties": { + "additionalGuests": { + "type": "integer", + "description": "Number of additional guests. Optional. The default is 0.", + "default": "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. It must be a valid email address as per RFC5322.", + "annotations": { + "required": [ + "calendar.events.import", + "calendar.events.insert", + "calendar.events.update" + ] + } + }, + "id": { + "type": "string", + "description": "The attendee's Profile ID, if available. It corresponds to theid field in the People collection of the Google+ API" + }, + "optional": { + "type": "boolean", + "description": "Whether this is an optional attendee. Optional. The default is False.", + "default": "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.", + "default": "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.", + "default": "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 RFC3339). A time zone offset is required unless a time zone is explicitly specified in timeZone.", + "format": "date-time" + }, + "timeZone": { + "type": "string", + "description": "The time zone in which the time is specified. (Formatted as an IANA Time Zone Database name, e.g. \"Europe/Zurich\".) For recurring events this field is required and specifies the time zone in which the recurrence is expanded. For single events this field is optional and indicates a custom time zone for the event start/end." + } + } + }, + "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. These are only available for Google Apps for Work, Education, and Government customers. Requests to set SMS reminders for other account types are ignored. \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. Valid values are between 0 and 40320 (4 weeks in minutes).", + "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, in which case nextSyncToken is provided." + }, + "nextSyncToken": { + "type": "string", + "description": "Token used at a later point in time to retrieve only the entries that have changed since this result was returned. Omitted if further results are available, in which case nextPageToken is provided." + }, + "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 RFC3339 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" + }, + "nextPageToken": { + "type": "string", + "description": "Token used to access the next page of this result. Omitted if no further results are available, in which case nextSyncToken is provided." + }, + "nextSyncToken": { + "type": "string", + "description": "Token used at a later point in time to retrieve only the entries that have changed since this result was returned. Omitted if further results are available, in which case nextPageToken is provided." + } + } + }, + "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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + "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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + "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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + "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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional.", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token specifying which result page to return. Optional.", + "location": "query" + }, + "showDeleted": { + "type": "boolean", + "description": "Whether to include deleted ACLs in the result. Deleted ACLs are represented by role equal to \"none\". Deleted ACLs will always be included if syncToken is provided. Optional. The default is False.", + "location": "query" + }, + "syncToken": { + "type": "string", + "description": "Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All entries deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False.\nIf the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken.\nLearn more about incremental synchronization.\nOptional. The default is to return all entries.", + "location": "query" + } + }, + "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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + "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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + "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" + ] + }, + "watch": { + "id": "calendar.acl.watch", + "path": "calendars/{calendarId}/acl/watch", + "httpMethod": "POST", + "description": "Watch for changes to ACL resources.", + "parameters": { + "calendarId": { + "type": "string", + "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional.", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token specifying which result page to return. Optional.", + "location": "query" + }, + "showDeleted": { + "type": "boolean", + "description": "Whether to include deleted ACLs in the result. Deleted ACLs are represented by role equal to \"none\". Deleted ACLs will always be included if syncToken is provided. Optional. The default is False.", + "location": "query" + }, + "syncToken": { + "type": "string", + "description": "Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All entries deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False.\nIf the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken.\nLearn more about incremental synchronization.\nOptional. The default is to return all entries.", + "location": "query" + } + }, + "parameterOrder": [ + "calendarId" + ], + "request": { + "$ref": "Channel", + "parameterName": "resource" + }, + "response": { + "$ref": "Channel" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar" + ], + "supportsSubscription": true + } + } + }, + "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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + "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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + "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. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional.", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "minAccessRole": { + "type": "string", + "description": "The minimum access role for the user in the returned entries. 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" + }, + "showDeleted": { + "type": "boolean", + "description": "Whether to include deleted calendar list entries in the result. Optional. The default is False.", + "location": "query" + }, + "showHidden": { + "type": "boolean", + "description": "Whether to show hidden entries. Optional. The default is False.", + "location": "query" + }, + "syncToken": { + "type": "string", + "description": "Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. If only read-only fields such as calendar properties or ACLs have changed, the entry won't be returned. All entries deleted and hidden since the previous list request will always be in the result set and it is not allowed to set showDeleted neither showHidden to False.\nTo ensure client state consistency minAccessRole query parameter cannot be specified together with nextSyncToken.\nIf the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken.\nLearn more about incremental synchronization.\nOptional. The default is to return all entries.", + "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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + "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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + "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" + ] + }, + "watch": { + "id": "calendar.calendarList.watch", + "path": "users/me/calendarList/watch", + "httpMethod": "POST", + "description": "Watch for changes to CalendarList resources.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional.", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "minAccessRole": { + "type": "string", + "description": "The minimum access role for the user in the returned entries. 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" + }, + "showDeleted": { + "type": "boolean", + "description": "Whether to include deleted calendar list entries in the result. Optional. The default is False.", + "location": "query" + }, + "showHidden": { + "type": "boolean", + "description": "Whether to show hidden entries. Optional. The default is False.", + "location": "query" + }, + "syncToken": { + "type": "string", + "description": "Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. If only read-only fields such as calendar properties or ACLs have changed, the entry won't be returned. All entries deleted and hidden since the previous list request will always be in the result set and it is not allowed to set showDeleted neither showHidden to False.\nTo ensure client state consistency minAccessRole query parameter cannot be specified together with nextSyncToken.\nIf the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken.\nLearn more about incremental synchronization.\nOptional. The default is to return all entries.", + "location": "query" + } + }, + "request": { + "$ref": "Channel", + "parameterName": "resource" + }, + "response": { + "$ref": "Channel" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar", + "https://www.googleapis.com/auth/calendar.readonly" + ], + "supportsSubscription": true + } + } + }, + "calendars": { + "methods": { + "clear": { + "id": "calendar.calendars.clear", + "path": "calendars/{calendarId}/clear", + "httpMethod": "POST", + "description": "Clears a primary calendar. This operation deletes all events associated with the primary calendar of an account.", + "parameters": { + "calendarId": { + "type": "string", + "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + "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. Use calendars.clear for clearing all events on primary calendars.", + "parameters": { + "calendarId": { + "type": "string", + "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + "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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + "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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + "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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + "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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + "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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + "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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + "required": true, + "location": "path" + }, + "supportsAttachments": { + "type": "boolean", + "description": "Whether API client performing operation supports event attachments. Optional. The default is False.", + "location": "query" + } + }, + "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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + "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" + }, + "supportsAttachments": { + "type": "boolean", + "description": "Whether API client performing operation supports event attachments. 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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + "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. By default the value is 250 events. The page size can never be larger than 2500 events. 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. Must be an RFC3339 timestamp with mandatory time zone offset.", + "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. Must be an RFC3339 timestamp with mandatory time zone offset.", + "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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + "required": true, + "location": "path" + }, + "iCalUID": { + "type": "string", + "description": "Specifies event ID in the iCalendar format 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. By default the value is 250 events. The page size can never be larger than 2500 events. 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" + }, + "syncToken": { + "type": "string", + "description": "Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All events deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False.\nThere are several query parameters that cannot be specified together with nextSyncToken to ensure consistency of the client state.\n\nThese are: \n- iCalUID \n- orderBy \n- privateExtendedProperty \n- q \n- sharedExtendedProperty \n- timeMin \n- timeMax \n- updatedMin If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken.\nLearn more about incremental synchronization.\nOptional. The default is to return all entries.", + "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. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored.", + "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. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored.", + "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 RFC3339 timestamp) to filter by. When specified, entries deleted since this time will always be included regardless of showDeleted. 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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + "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" + }, + "supportsAttachments": { + "type": "boolean", + "description": "Whether API client performing operation supports event attachments. 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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + "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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + "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" + }, + "supportsAttachments": { + "type": "boolean", + "description": "Whether API client performing operation supports event attachments. 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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + "required": true, + "location": "path" + }, + "iCalUID": { + "type": "string", + "description": "Specifies event ID in the iCalendar format 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. By default the value is 250 events. The page size can never be larger than 2500 events. 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" + }, + "syncToken": { + "type": "string", + "description": "Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All events deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False.\nThere are several query parameters that cannot be specified together with nextSyncToken to ensure consistency of the client state.\n\nThese are: \n- iCalUID \n- orderBy \n- privateExtendedProperty \n- q \n- sharedExtendedProperty \n- timeMin \n- timeMax \n- updatedMin If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken.\nLearn more about incremental synchronization.\nOptional. The default is to return all entries.", + "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. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored.", + "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. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored.", + "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 RFC3339 timestamp) to filter by. When specified, entries deleted since this time will always be included regardless of showDeleted. 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.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional.", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token specifying which result page to return. Optional.", + "location": "query" + }, + "syncToken": { + "type": "string", + "description": "Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then.\nIf the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken.\nLearn more about incremental synchronization.\nOptional. The default is to return all entries.", + "location": "query" + } + }, + "response": { + "$ref": "Settings" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar", + "https://www.googleapis.com/auth/calendar.readonly" + ], + "supportsSubscription": true + }, + "watch": { + "id": "calendar.settings.watch", + "path": "users/me/settings/watch", + "httpMethod": "POST", + "description": "Watch for changes to Settings resources.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional.", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Token specifying which result page to return. Optional.", + "location": "query" + }, + "syncToken": { + "type": "string", + "description": "Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then.\nIf the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken.\nLearn more about incremental synchronization.\nOptional. The default is to return all entries.", + "location": "query" + } + }, + "request": { + "$ref": "Channel", + "parameterName": "resource" + }, + "response": { + "$ref": "Channel" + }, + "scopes": [ + "https://www.googleapis.com/auth/calendar", + "https://www.googleapis.com/auth/calendar.readonly" + ], + "supportsSubscription": true + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/calendar/v3/calendar-gen.go b/Godeps/_workspace/src/google.golang.org/api/calendar/v3/calendar-gen.go new file mode 100644 index 000000000..17b3628d1 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/calendar/v3/calendar-gen.go @@ -0,0 +1,7663 @@ +// Package calendar provides access to the Calendar API. +// +// See https://developers.google.com/google-apps/calendar/firstapp +// +// Usage example: +// +// import "google.golang.org/api/calendar/v3" +// ... +// calendarService, err := calendar.New(oauthHttpClient) +package calendar // import "google.golang.org/api/calendar/v3" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Acl *AclService + + CalendarList *CalendarListService + + Calendars *CalendarsService + + Channels *ChannelsService + + Colors *ColorsService + + Events *EventsService + + Freebusy *FreebusyService + + Settings *SettingsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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, in which case + // nextSyncToken is provided. + NextPageToken string `json:"nextPageToken,omitempty"` + + // NextSyncToken: Token used at a later point in time to retrieve only + // the entries that have changed since this result was returned. Omitted + // if further results are available, in which case nextPageToken is + // provided. + NextSyncToken string `json:"nextSyncToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Acl) MarshalJSON() ([]byte, error) { + type noMethod Acl + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AclRule) MarshalJSON() ([]byte, error) { + type noMethod AclRule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AclRuleScope: The scope of the rule. +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"` + + // ForceSendFields is a list of field names (e.g. "Type") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AclRuleScope) MarshalJSON() ([]byte, error) { + type noMethod AclRuleScope + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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. To retrieve IDs call the + // calendarList.list() method. + 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. (Formatted as an IANA Time + // Zone Database name, e.g. "Europe/Zurich".) Optional. + TimeZone string `json:"timeZone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Calendar) MarshalJSON() ([]byte, error) { + type noMethod Calendar + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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. + // Omitted if no further results are available, in which case + // nextSyncToken is provided. + NextPageToken string `json:"nextPageToken,omitempty"` + + // NextSyncToken: Token used at a later point in time to retrieve only + // the entries that have changed since this result was returned. Omitted + // if further results are available, in which case nextPageToken is + // provided. + NextSyncToken string `json:"nextSyncToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CalendarList) MarshalJSON() ([]byte, error) { + type noMethod CalendarList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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 hexadecimal + // format "#0088aa". This property supersedes the index-based colorId + // property. To set or change this property, you need to specify + // colorRgbFormat=true in the parameters of the insert, update and patch + // methods. 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). This property is superseded by the backgroundColor + // and foregroundColor properties and can be ignored when using these + // properties. Optional. + ColorId string `json:"colorId,omitempty"` + + // DefaultReminders: The default reminders that the authenticated user + // has for this calendar. + DefaultReminders []*EventReminder `json:"defaultReminders,omitempty"` + + // Deleted: Whether this calendar list entry has been deleted from the + // calendar list. Read-only. Optional. The default is False. + Deleted bool `json:"deleted,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 + // hexadecimal format "#ffffff". This property supersedes the + // index-based colorId property. To set or change this property, you + // need to specify colorRgbFormat=true in the parameters of the insert, + // update and patch methods. 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccessRole") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CalendarListEntry) MarshalJSON() ([]byte, error) { + type noMethod CalendarListEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CalendarListEntryNotificationSettings: The notifications that the +// authenticated user is receiving for this calendar. +type CalendarListEntryNotificationSettings struct { + // Notifications: The list of notifications set for this calendar. + Notifications []*CalendarNotification `json:"notifications,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Notifications") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CalendarListEntryNotificationSettings) MarshalJSON() ([]byte, error) { + type noMethod CalendarListEntryNotificationSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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. SMS reminders are only available for + // Google Apps for Work, Education, and Government customers. + 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"` + + // ForceSendFields is a list of field names (e.g. "Method") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CalendarNotification) MarshalJSON() ([]byte, error) { + type noMethod CalendarNotification + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Address") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Channel) MarshalJSON() ([]byte, error) { + type noMethod Channel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Background") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ColorDefinition) MarshalJSON() ([]byte, error) { + type noMethod ColorDefinition + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Colors struct { + // Calendar: A global palette of calendar colors, mapping from the color + // ID to its definition. A calendarListEntry resource refers to one of + // these color IDs in its color field. Read-only. + Calendar map[string]ColorDefinition `json:"calendar,omitempty"` + + // Event: A global 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 map[string]ColorDefinition `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 RFC3339 + // timestamp). Read-only. + Updated string `json:"updated,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Calendar") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Colors) MarshalJSON() ([]byte, error) { + type noMethod Colors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Domain") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Error) MarshalJSON() ([]byte, error) { + type noMethod Error + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Event struct { + // AnyoneCanAddSelf: Whether anyone can invite themselves to the event. + // Optional. The default is False. + AnyoneCanAddSelf bool `json:"anyoneCanAddSelf,omitempty"` + + // Attachments: File attachments for the event. Currently only Google + // Drive attachments are supported. + // In order to modify attachments the supportsAttachments request + // parameter should be set to true. + // There can be at most 25 attachments per event, + Attachments []*EventAttachment `json:"attachments,omitempty"` + + // Attendees: The attendees of the event. See the Events with attendees + // guide for more information on scheduling events with other calendar + // users. + 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 RFC3339 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. + // + // Default: 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. + // + // Default: 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 unique identifier as defined in RFC5545. It is used to + // uniquely identify events accross calendaring systems and must be + // supplied when importing events via the import method. + // Note that the icalUID and the id are not identical and only one of + // them should be supplied at event creation time. One difference in + // their semantics is that in recurring events, all occurrences of one + // event have different ids while they all share the same icalUIDs. + ICalUID string `json:"iCalUID,omitempty"` + + // Id: Opaque 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. + // If you do not specify an ID, it will be automatically generated by + // the server. + // Note that the icalUID and the id are not identical and only one of + // them should be supplied at event creation time. One difference in + // their semantics is that in recurring events, all occurrences of one + // event have different ids while they all share the same icalUIDs. + 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, as specified in RFC5545. Note that DTSTART and DTEND + // lines are not allowed in this field; event start and end times are + // specified in the start and end fields. 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 + // id of the recurring event to which this instance belongs. 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 from which the event was created. For example, a web + // page, an email message or any document identifiable by an URL with + // HTTP or HTTPS scheme. Can only be seen or modified 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 RFC3339 + // 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AnyoneCanAddSelf") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Event) MarshalJSON() ([]byte, error) { + type noMethod Event + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventCreator: The creator of the event. Read-only. +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. It corresponds to theid + // field in the People collection of the Google+ API + 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"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventCreator) MarshalJSON() ([]byte, error) { + type noMethod EventCreator + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventExtendedProperties: Extended properties of the event. +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"` + + // ForceSendFields is a list of field names (e.g. "Private") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventExtendedProperties) MarshalJSON() ([]byte, error) { + type noMethod EventExtendedProperties + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventGadget: A gadget that extends this event. +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. The height must be an integer + // greater than 0. Optional. + Height int64 `json:"height,omitempty"` + + // IconLink: The gadget's icon URL. The URL scheme must be HTTPS. + IconLink string `json:"iconLink,omitempty"` + + // Link: The gadget's URL. The URL scheme must be HTTPS. + 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. The width must be an integer + // greater than 0. Optional. + Width int64 `json:"width,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Display") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventGadget) MarshalJSON() ([]byte, error) { + type noMethod EventGadget + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventOrganizer: 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. +type EventOrganizer struct { + // DisplayName: The organizer's name, if available. + DisplayName string `json:"displayName,omitempty"` + + // Email: The organizer's email address, if available. It must be a + // valid email address as per RFC5322. + Email string `json:"email,omitempty"` + + // Id: The organizer's Profile ID, if available. It corresponds to theid + // field in the People collection of the Google+ API + 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"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventOrganizer) MarshalJSON() ([]byte, error) { + type noMethod EventOrganizer + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventReminders: Information about the event's reminders for the +// authenticated user. +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. The maximum number of override + // reminders is 5. + Overrides []*EventReminder `json:"overrides,omitempty"` + + // UseDefault: Whether the default reminders of the calendar apply to + // the event. + UseDefault bool `json:"useDefault,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Overrides") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventReminders) MarshalJSON() ([]byte, error) { + type noMethod EventReminders + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventSource: Source from which the event was created. For example, a +// web page, an email message or any document identifiable by an URL +// with HTTP or HTTPS scheme. Can only be seen or modified by the +// creator of the event. +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. The URL scheme must be + // HTTP or HTTPS. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Title") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventSource) MarshalJSON() ([]byte, error) { + type noMethod EventSource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type EventAttachment struct { + // FileId: ID of the attached file. Read-only. + // For Google Drive files, this is the ID of the corresponding Files + // resource entry in the Drive API. + FileId string `json:"fileId,omitempty"` + + // FileUrl: URL link to the attachment. + // For adding Google Drive file attachments use the same format as in + // alternateLink property of the Files resource in the Drive API. + FileUrl string `json:"fileUrl,omitempty"` + + // IconLink: URL link to the attachment's icon. Read-only. + IconLink string `json:"iconLink,omitempty"` + + // MimeType: Internet media type (MIME type) of the attachment. + MimeType string `json:"mimeType,omitempty"` + + // Title: Attachment title. + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FileId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventAttachment) MarshalJSON() ([]byte, error) { + type noMethod EventAttachment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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. It must be a valid email address as + // per RFC5322. + Email string `json:"email,omitempty"` + + // Id: The attendee's Profile ID, if available. It corresponds to theid + // field in the People collection of the Google+ API + 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"` + + // ForceSendFields is a list of field names (e.g. "AdditionalGuests") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventAttendee) MarshalJSON() ([]byte, error) { + type noMethod EventAttendee + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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 RFC3339). A time zone offset is required unless a time + // zone is explicitly specified in timeZone. + DateTime string `json:"dateTime,omitempty"` + + // TimeZone: The time zone in which the time is specified. (Formatted as + // an IANA Time Zone Database name, e.g. "Europe/Zurich".) For recurring + // events this field is required and specifies the time zone in which + // the recurrence is expanded. For single events this field is optional + // and indicates a custom time zone for the event start/end. + TimeZone string `json:"timeZone,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Date") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventDateTime) MarshalJSON() ([]byte, error) { + type noMethod EventDateTime + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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. These are only available for + // Google Apps for Work, Education, and Government customers. Requests + // to set SMS reminders for other account types are ignored. + // - "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. Valid values are between 0 and 40320 (4 + // weeks in minutes). + Minutes int64 `json:"minutes,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Method") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventReminder) MarshalJSON() ([]byte, error) { + type noMethod EventReminder + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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, in which case + // nextSyncToken is provided. + NextPageToken string `json:"nextPageToken,omitempty"` + + // NextSyncToken: Token used at a later point in time to retrieve only + // the entries that have changed since this result was returned. Omitted + // if further results are available, in which case nextPageToken is + // provided. + NextSyncToken string `json:"nextSyncToken,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 RFC3339 + // timestamp). Read-only. + Updated string `json:"updated,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccessRole") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Events) MarshalJSON() ([]byte, error) { + type noMethod Events + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Busy") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FreeBusyCalendar) MarshalJSON() ([]byte, error) { + type noMethod FreeBusyCalendar + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Calendars") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FreeBusyGroup) MarshalJSON() ([]byte, error) { + type noMethod FreeBusyGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. + // "CalendarExpansionMax") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FreeBusyRequest) MarshalJSON() ([]byte, error) { + type noMethod FreeBusyRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type FreeBusyRequestItem struct { + // Id: The identifier of a calendar or a group. + Id string `json:"id,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FreeBusyRequestItem) MarshalJSON() ([]byte, error) { + type noMethod FreeBusyRequestItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type FreeBusyResponse struct { + // Calendars: List of free/busy information for calendars. + Calendars map[string]FreeBusyCalendar `json:"calendars,omitempty"` + + // Groups: Expansion of groups. + Groups map[string]FreeBusyGroup `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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Calendars") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FreeBusyResponse) MarshalJSON() ([]byte, error) { + type noMethod FreeBusyResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Setting) MarshalJSON() ([]byte, error) { + type noMethod Setting + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // NextPageToken: Token used to access the next page of this result. + // Omitted if no further results are available, in which case + // nextSyncToken is provided. + NextPageToken string `json:"nextPageToken,omitempty"` + + // NextSyncToken: Token used at a later point in time to retrieve only + // the entries that have changed since this result was returned. Omitted + // if further results are available, in which case nextPageToken is + // provided. + NextSyncToken string `json:"nextSyncToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Settings) MarshalJSON() ([]byte, error) { + type noMethod Settings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "End") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TimePeriod) MarshalJSON() ([]byte, error) { + type noMethod TimePeriod + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "calendar.acl.delete": + +type AclDeleteCall struct { + s *Service + calendarId string + ruleId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AclDeleteCall) Fields(s ...googleapi.Field) *AclDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AclDeleteCall) Context(ctx context.Context) *AclDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AclDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl/{ruleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + "ruleId": c.ruleId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.acl.delete" call. +func (c *AclDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an access control rule.", + // "httpMethod": "DELETE", + // "id": "calendar.acl.delete", + // "parameterOrder": [ + // "calendarId", + // "ruleId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AclGetCall) Fields(s ...googleapi.Field) *AclGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AclGetCall) IfNoneMatch(entityTag string) *AclGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AclGetCall) Context(ctx context.Context) *AclGetCall { + c.ctx_ = ctx + return c +} + +func (c *AclGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl/{ruleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + "ruleId": c.ruleId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.acl.get" call. +// Exactly one of *AclRule or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AclRule.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AclGetCall) Do() (*AclRule, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AclRule{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns an access control rule.", + // "httpMethod": "GET", + // "id": "calendar.acl.get", + // "parameterOrder": [ + // "calendarId", + // "ruleId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AclInsertCall) Fields(s ...googleapi.Field) *AclInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AclInsertCall) Context(ctx context.Context) *AclInsertCall { + c.ctx_ = ctx + return c +} + +func (c *AclInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.acl.insert" call. +// Exactly one of *AclRule or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AclRule.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AclInsertCall) Do() (*AclRule, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AclRule{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an access control rule.", + // "httpMethod": "POST", + // "id": "calendar.acl.insert", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of entries returned on one result page. By default the value is 100 +// entries. The page size can never be larger than 250 entries. +func (c *AclListCall) MaxResults(maxResults int64) *AclListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Token specifying +// which result page to return. +func (c *AclListCall) PageToken(pageToken string) *AclListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// ShowDeleted sets the optional parameter "showDeleted": Whether to +// include deleted ACLs in the result. Deleted ACLs are represented by +// role equal to "none". Deleted ACLs will always be included if +// syncToken is provided. The default is False. +func (c *AclListCall) ShowDeleted(showDeleted bool) *AclListCall { + c.opt_["showDeleted"] = showDeleted + return c +} + +// SyncToken sets the optional parameter "syncToken": Token obtained +// from the nextSyncToken field returned on the last page of results +// from the previous list request. It makes the result of this list +// request contain only entries that have changed since then. All +// entries deleted since the previous list request will always be in the +// result set and it is not allowed to set showDeleted to False. +// If the syncToken expires, the server will respond with a 410 GONE +// response code and the client should clear its storage and perform a +// full synchronization without any syncToken. +// Learn more about incremental synchronization. +// The default is to return all entries. +func (c *AclListCall) SyncToken(syncToken string) *AclListCall { + c.opt_["syncToken"] = syncToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AclListCall) Fields(s ...googleapi.Field) *AclListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AclListCall) IfNoneMatch(entityTag string) *AclListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AclListCall) Context(ctx context.Context) *AclListCall { + c.ctx_ = ctx + return c +} + +func (c *AclListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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_["syncToken"]; ok { + params.Set("syncToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.acl.list" call. +// Exactly one of *Acl or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Acl.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AclListCall) Do() (*Acl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Acl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the rules in the access control list for the calendar.", + // "httpMethod": "GET", + // "id": "calendar.acl.list", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Token specifying which result page to return. Optional.", + // "location": "query", + // "type": "string" + // }, + // "showDeleted": { + // "description": "Whether to include deleted ACLs in the result. Deleted ACLs are represented by role equal to \"none\". Deleted ACLs will always be included if syncToken is provided. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // }, + // "syncToken": { + // "description": "Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All entries deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False.\nIf the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken.\nLearn more about incremental synchronization.\nOptional. The default is to return all entries.", + // "location": "query", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AclPatchCall) Fields(s ...googleapi.Field) *AclPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AclPatchCall) Context(ctx context.Context) *AclPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AclPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl/{ruleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + "ruleId": c.ruleId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.acl.patch" call. +// Exactly one of *AclRule or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AclRule.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AclPatchCall) Do() (*AclRule, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AclRule{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an access control rule. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "calendar.acl.patch", + // "parameterOrder": [ + // "calendarId", + // "ruleId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AclUpdateCall) Fields(s ...googleapi.Field) *AclUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AclUpdateCall) Context(ctx context.Context) *AclUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AclUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl/{ruleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + "ruleId": c.ruleId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.acl.update" call. +// Exactly one of *AclRule or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AclRule.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AclUpdateCall) Do() (*AclRule, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AclRule{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an access control rule.", + // "httpMethod": "PUT", + // "id": "calendar.acl.update", + // "parameterOrder": [ + // "calendarId", + // "ruleId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + // "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.watch": + +type AclWatchCall struct { + s *Service + calendarId string + channel *Channel + opt_ map[string]interface{} + ctx_ context.Context +} + +// Watch: Watch for changes to ACL resources. +func (r *AclService) Watch(calendarId string, channel *Channel) *AclWatchCall { + c := &AclWatchCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + c.channel = channel + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of entries returned on one result page. By default the value is 100 +// entries. The page size can never be larger than 250 entries. +func (c *AclWatchCall) MaxResults(maxResults int64) *AclWatchCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Token specifying +// which result page to return. +func (c *AclWatchCall) PageToken(pageToken string) *AclWatchCall { + c.opt_["pageToken"] = pageToken + return c +} + +// ShowDeleted sets the optional parameter "showDeleted": Whether to +// include deleted ACLs in the result. Deleted ACLs are represented by +// role equal to "none". Deleted ACLs will always be included if +// syncToken is provided. The default is False. +func (c *AclWatchCall) ShowDeleted(showDeleted bool) *AclWatchCall { + c.opt_["showDeleted"] = showDeleted + return c +} + +// SyncToken sets the optional parameter "syncToken": Token obtained +// from the nextSyncToken field returned on the last page of results +// from the previous list request. It makes the result of this list +// request contain only entries that have changed since then. All +// entries deleted since the previous list request will always be in the +// result set and it is not allowed to set showDeleted to False. +// If the syncToken expires, the server will respond with a 410 GONE +// response code and the client should clear its storage and perform a +// full synchronization without any syncToken. +// Learn more about incremental synchronization. +// The default is to return all entries. +func (c *AclWatchCall) SyncToken(syncToken string) *AclWatchCall { + c.opt_["syncToken"] = syncToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AclWatchCall) Fields(s ...googleapi.Field) *AclWatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AclWatchCall) Context(ctx context.Context) *AclWatchCall { + c.ctx_ = ctx + return c +} + +func (c *AclWatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.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_["syncToken"]; ok { + params.Set("syncToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl/watch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.acl.watch" call. +// Exactly one of *Channel or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Channel.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AclWatchCall) Do() (*Channel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Channel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Watch for changes to ACL resources.", + // "httpMethod": "POST", + // "id": "calendar.acl.watch", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Token specifying which result page to return. Optional.", + // "location": "query", + // "type": "string" + // }, + // "showDeleted": { + // "description": "Whether to include deleted ACLs in the result. Deleted ACLs are represented by role equal to \"none\". Deleted ACLs will always be included if syncToken is provided. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // }, + // "syncToken": { + // "description": "Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All entries deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False.\nIf the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken.\nLearn more about incremental synchronization.\nOptional. The default is to return all entries.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "calendars/{calendarId}/acl/watch", + // "request": { + // "$ref": "Channel", + // "parameterName": "resource" + // }, + // "response": { + // "$ref": "Channel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar" + // ], + // "supportsSubscription": true + // } + +} + +// method id "calendar.calendarList.delete": + +type CalendarListDeleteCall struct { + s *Service + calendarId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CalendarListDeleteCall) Fields(s ...googleapi.Field) *CalendarListDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CalendarListDeleteCall) Context(ctx context.Context) *CalendarListDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *CalendarListDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList/{calendarId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.calendarList.delete" call. +func (c *CalendarListDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an entry on the user's calendar list.", + // "httpMethod": "DELETE", + // "id": "calendar.calendarList.delete", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CalendarListGetCall) Fields(s ...googleapi.Field) *CalendarListGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CalendarListGetCall) IfNoneMatch(entityTag string) *CalendarListGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CalendarListGetCall) Context(ctx context.Context) *CalendarListGetCall { + c.ctx_ = ctx + return c +} + +func (c *CalendarListGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList/{calendarId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.calendarList.get" call. +// Exactly one of *CalendarListEntry or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CalendarListEntry.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CalendarListGetCall) Do() (*CalendarListEntry, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CalendarListEntry{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns an entry on the user's calendar list.", + // "httpMethod": "GET", + // "id": "calendar.calendarList.get", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CalendarListInsertCall) Fields(s ...googleapi.Field) *CalendarListInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CalendarListInsertCall) Context(ctx context.Context) *CalendarListInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CalendarListInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["colorRgbFormat"]; ok { + params.Set("colorRgbFormat", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.calendarList.insert" call. +// Exactly one of *CalendarListEntry or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CalendarListEntry.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CalendarListInsertCall) Do() (*CalendarListEntry, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CalendarListEntry{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. By default the value is 100 +// entries. The page size can never be larger than 250 entries. +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 entries. The +// default is no restriction. +// +// Possible values: +// "freeBusyReader" - The user can read free/busy information. +// "owner" - The user can read and modify events and access control +// lists. +// "reader" - The user can read events that are not private. +// "writer" - The user can read and modify events. +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 +} + +// ShowDeleted sets the optional parameter "showDeleted": Whether to +// include deleted calendar list entries in the result. The default is +// False. +func (c *CalendarListListCall) ShowDeleted(showDeleted bool) *CalendarListListCall { + c.opt_["showDeleted"] = showDeleted + 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 +} + +// SyncToken sets the optional parameter "syncToken": Token obtained +// from the nextSyncToken field returned on the last page of results +// from the previous list request. It makes the result of this list +// request contain only entries that have changed since then. If only +// read-only fields such as calendar properties or ACLs have changed, +// the entry won't be returned. All entries deleted and hidden since the +// previous list request will always be in the result set and it is not +// allowed to set showDeleted neither showHidden to False. +// To ensure client state consistency minAccessRole query parameter +// cannot be specified together with nextSyncToken. +// If the syncToken expires, the server will respond with a 410 GONE +// response code and the client should clear its storage and perform a +// full synchronization without any syncToken. +// Learn more about incremental synchronization. +// The default is to return all entries. +func (c *CalendarListListCall) SyncToken(syncToken string) *CalendarListListCall { + c.opt_["syncToken"] = syncToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CalendarListListCall) Fields(s ...googleapi.Field) *CalendarListListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CalendarListListCall) IfNoneMatch(entityTag string) *CalendarListListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CalendarListListCall) Context(ctx context.Context) *CalendarListListCall { + c.ctx_ = ctx + return c +} + +func (c *CalendarListListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["syncToken"]; ok { + params.Set("syncToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.calendarList.list" call. +// Exactly one of *CalendarList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CalendarList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CalendarListListCall) Do() (*CalendarList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CalendarList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "minAccessRole": { + // "description": "The minimum access role for the user in the returned entries. 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" + // }, + // "showDeleted": { + // "description": "Whether to include deleted calendar list entries in the result. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // }, + // "showHidden": { + // "description": "Whether to show hidden entries. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // }, + // "syncToken": { + // "description": "Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. If only read-only fields such as calendar properties or ACLs have changed, the entry won't be returned. All entries deleted and hidden since the previous list request will always be in the result set and it is not allowed to set showDeleted neither showHidden to False.\nTo ensure client state consistency minAccessRole query parameter cannot be specified together with nextSyncToken.\nIf the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken.\nLearn more about incremental synchronization.\nOptional. The default is to return all entries.", + // "location": "query", + // "type": "string" + // } + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CalendarListPatchCall) Fields(s ...googleapi.Field) *CalendarListPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CalendarListPatchCall) Context(ctx context.Context) *CalendarListPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CalendarListPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["colorRgbFormat"]; ok { + params.Set("colorRgbFormat", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList/{calendarId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.calendarList.patch" call. +// Exactly one of *CalendarListEntry or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CalendarListEntry.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CalendarListPatchCall) Do() (*CalendarListEntry, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CalendarListEntry{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CalendarListUpdateCall) Fields(s ...googleapi.Field) *CalendarListUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CalendarListUpdateCall) Context(ctx context.Context) *CalendarListUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CalendarListUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["colorRgbFormat"]; ok { + params.Set("colorRgbFormat", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList/{calendarId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.calendarList.update" call. +// Exactly one of *CalendarListEntry or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CalendarListEntry.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CalendarListUpdateCall) Do() (*CalendarListEntry, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CalendarListEntry{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an entry on the user's calendar list.", + // "httpMethod": "PUT", + // "id": "calendar.calendarList.update", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + // "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.watch": + +type CalendarListWatchCall struct { + s *Service + channel *Channel + opt_ map[string]interface{} + ctx_ context.Context +} + +// Watch: Watch for changes to CalendarList resources. +func (r *CalendarListService) Watch(channel *Channel) *CalendarListWatchCall { + c := &CalendarListWatchCall{s: r.s, opt_: make(map[string]interface{})} + c.channel = channel + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of entries returned on one result page. By default the value is 100 +// entries. The page size can never be larger than 250 entries. +func (c *CalendarListWatchCall) MaxResults(maxResults int64) *CalendarListWatchCall { + c.opt_["maxResults"] = maxResults + return c +} + +// MinAccessRole sets the optional parameter "minAccessRole": The +// minimum access role for the user in the returned entries. The +// default is no restriction. +// +// Possible values: +// "freeBusyReader" - The user can read free/busy information. +// "owner" - The user can read and modify events and access control +// lists. +// "reader" - The user can read events that are not private. +// "writer" - The user can read and modify events. +func (c *CalendarListWatchCall) MinAccessRole(minAccessRole string) *CalendarListWatchCall { + c.opt_["minAccessRole"] = minAccessRole + return c +} + +// PageToken sets the optional parameter "pageToken": Token specifying +// which result page to return. +func (c *CalendarListWatchCall) PageToken(pageToken string) *CalendarListWatchCall { + c.opt_["pageToken"] = pageToken + return c +} + +// ShowDeleted sets the optional parameter "showDeleted": Whether to +// include deleted calendar list entries in the result. The default is +// False. +func (c *CalendarListWatchCall) ShowDeleted(showDeleted bool) *CalendarListWatchCall { + c.opt_["showDeleted"] = showDeleted + return c +} + +// ShowHidden sets the optional parameter "showHidden": Whether to show +// hidden entries. The default is False. +func (c *CalendarListWatchCall) ShowHidden(showHidden bool) *CalendarListWatchCall { + c.opt_["showHidden"] = showHidden + return c +} + +// SyncToken sets the optional parameter "syncToken": Token obtained +// from the nextSyncToken field returned on the last page of results +// from the previous list request. It makes the result of this list +// request contain only entries that have changed since then. If only +// read-only fields such as calendar properties or ACLs have changed, +// the entry won't be returned. All entries deleted and hidden since the +// previous list request will always be in the result set and it is not +// allowed to set showDeleted neither showHidden to False. +// To ensure client state consistency minAccessRole query parameter +// cannot be specified together with nextSyncToken. +// If the syncToken expires, the server will respond with a 410 GONE +// response code and the client should clear its storage and perform a +// full synchronization without any syncToken. +// Learn more about incremental synchronization. +// The default is to return all entries. +func (c *CalendarListWatchCall) SyncToken(syncToken string) *CalendarListWatchCall { + c.opt_["syncToken"] = syncToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CalendarListWatchCall) Fields(s ...googleapi.Field) *CalendarListWatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CalendarListWatchCall) Context(ctx context.Context) *CalendarListWatchCall { + c.ctx_ = ctx + return c +} + +func (c *CalendarListWatchCall) doRequest(alt string) (*http.Response, 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", alt) + 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_["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_["syncToken"]; ok { + params.Set("syncToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList/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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.calendarList.watch" call. +// Exactly one of *Channel or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Channel.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CalendarListWatchCall) Do() (*Channel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Channel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Watch for changes to CalendarList resources.", + // "httpMethod": "POST", + // "id": "calendar.calendarList.watch", + // "parameters": { + // "maxResults": { + // "description": "Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "minAccessRole": { + // "description": "The minimum access role for the user in the returned entries. 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" + // }, + // "showDeleted": { + // "description": "Whether to include deleted calendar list entries in the result. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // }, + // "showHidden": { + // "description": "Whether to show hidden entries. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // }, + // "syncToken": { + // "description": "Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. If only read-only fields such as calendar properties or ACLs have changed, the entry won't be returned. All entries deleted and hidden since the previous list request will always be in the result set and it is not allowed to set showDeleted neither showHidden to False.\nTo ensure client state consistency minAccessRole query parameter cannot be specified together with nextSyncToken.\nIf the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken.\nLearn more about incremental synchronization.\nOptional. The default is to return all entries.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "users/me/calendarList/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.calendars.clear": + +type CalendarsClearCall struct { + s *Service + calendarId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Clear: Clears a primary calendar. This operation deletes all events +// associated with the primary calendar of an account. +func (r *CalendarsService) Clear(calendarId string) *CalendarsClearCall { + c := &CalendarsClearCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CalendarsClearCall) Fields(s ...googleapi.Field) *CalendarsClearCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CalendarsClearCall) Context(ctx context.Context) *CalendarsClearCall { + c.ctx_ = ctx + return c +} + +func (c *CalendarsClearCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/clear") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.calendars.clear" call. +func (c *CalendarsClearCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Clears a primary calendar. This operation deletes all events associated with the primary calendar of an account.", + // "httpMethod": "POST", + // "id": "calendar.calendars.clear", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes a secondary calendar. Use calendars.clear for +// clearing all events on primary calendars. +func (r *CalendarsService) Delete(calendarId string) *CalendarsDeleteCall { + c := &CalendarsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.calendarId = calendarId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CalendarsDeleteCall) Fields(s ...googleapi.Field) *CalendarsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CalendarsDeleteCall) Context(ctx context.Context) *CalendarsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *CalendarsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.calendars.delete" call. +func (c *CalendarsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a secondary calendar. Use calendars.clear for clearing all events on primary calendars.", + // "httpMethod": "DELETE", + // "id": "calendar.calendars.delete", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CalendarsGetCall) Fields(s ...googleapi.Field) *CalendarsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CalendarsGetCall) IfNoneMatch(entityTag string) *CalendarsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CalendarsGetCall) Context(ctx context.Context) *CalendarsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CalendarsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.calendars.get" call. +// Exactly one of *Calendar or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Calendar.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CalendarsGetCall) Do() (*Calendar, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Calendar{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns metadata for a calendar.", + // "httpMethod": "GET", + // "id": "calendar.calendars.get", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CalendarsInsertCall) Fields(s ...googleapi.Field) *CalendarsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CalendarsInsertCall) Context(ctx context.Context) *CalendarsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CalendarsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.calendars.insert" call. +// Exactly one of *Calendar or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Calendar.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CalendarsInsertCall) Do() (*Calendar, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Calendar{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CalendarsPatchCall) Fields(s ...googleapi.Field) *CalendarsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CalendarsPatchCall) Context(ctx context.Context) *CalendarsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CalendarsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.calendars.patch" call. +// Exactly one of *Calendar or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Calendar.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CalendarsPatchCall) Do() (*Calendar, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Calendar{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates metadata for a calendar. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "calendar.calendars.patch", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CalendarsUpdateCall) Fields(s ...googleapi.Field) *CalendarsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CalendarsUpdateCall) Context(ctx context.Context) *CalendarsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CalendarsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.calendars.update" call. +// Exactly one of *Calendar or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Calendar.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CalendarsUpdateCall) Do() (*Calendar, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Calendar{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates metadata for a calendar.", + // "httpMethod": "PUT", + // "id": "calendar.calendars.update", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall { + c.ctx_ = ctx + return c +} + +func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.channels.stop" call. +func (c *ChannelsStopCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ColorsGetCall) Fields(s ...googleapi.Field) *ColorsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ColorsGetCall) IfNoneMatch(entityTag string) *ColorsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ColorsGetCall) Context(ctx context.Context) *ColorsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ColorsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "colors") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.colors.get" call. +// Exactly one of *Colors or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Colors.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ColorsGetCall) Do() (*Colors, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Colors{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventsDeleteCall) Fields(s ...googleapi.Field) *EventsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventsDeleteCall) Context(ctx context.Context) *EventsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *EventsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["sendNotifications"]; ok { + params.Set("sendNotifications", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + "eventId": c.eventId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.events.delete" call. +func (c *EventsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an event.", + // "httpMethod": "DELETE", + // "id": "calendar.events.delete", + // "parameterOrder": [ + // "calendarId", + // "eventId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventsGetCall) Fields(s ...googleapi.Field) *EventsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EventsGetCall) IfNoneMatch(entityTag string) *EventsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventsGetCall) Context(ctx context.Context) *EventsGetCall { + c.ctx_ = ctx + return c +} + +func (c *EventsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + "eventId": c.eventId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.events.get" call. +// Exactly one of *Event or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Event.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EventsGetCall) Do() (*Event, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Event{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// SupportsAttachments sets the optional parameter +// "supportsAttachments": Whether API client performing operation +// supports event attachments. The default is False. +func (c *EventsImportCall) SupportsAttachments(supportsAttachments bool) *EventsImportCall { + c.opt_["supportsAttachments"] = supportsAttachments + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventsImportCall) Fields(s ...googleapi.Field) *EventsImportCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventsImportCall) Context(ctx context.Context) *EventsImportCall { + c.ctx_ = ctx + return c +} + +func (c *EventsImportCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["supportsAttachments"]; ok { + params.Set("supportsAttachments", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/import") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.events.import" call. +// Exactly one of *Event or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Event.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EventsImportCall) Do() (*Event, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Event{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "supportsAttachments": { + // "description": "Whether API client performing operation supports event attachments. Optional. The default is False.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// SupportsAttachments sets the optional parameter +// "supportsAttachments": Whether API client performing operation +// supports event attachments. The default is False. +func (c *EventsInsertCall) SupportsAttachments(supportsAttachments bool) *EventsInsertCall { + c.opt_["supportsAttachments"] = supportsAttachments + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventsInsertCall) Fields(s ...googleapi.Field) *EventsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventsInsertCall) Context(ctx context.Context) *EventsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *EventsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["supportsAttachments"]; ok { + params.Set("supportsAttachments", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.events.insert" call. +// Exactly one of *Event or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Event.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EventsInsertCall) Do() (*Event, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Event{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an event.", + // "httpMethod": "POST", + // "id": "calendar.events.insert", + // "parameterOrder": [ + // "calendarId" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + // "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" + // }, + // "supportsAttachments": { + // "description": "Whether API client performing operation supports event attachments. 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{} + ctx_ context.Context +} + +// 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. By default the value is 250 +// events. The page size can never be larger than 2500 events. +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. Must be an RFC3339 timestamp with +// mandatory time zone offset. +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. Must be an RFC3339 timestamp with mandatory +// time zone offset. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventsInstancesCall) Fields(s ...googleapi.Field) *EventsInstancesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EventsInstancesCall) IfNoneMatch(entityTag string) *EventsInstancesCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventsInstancesCall) Context(ctx context.Context) *EventsInstancesCall { + c.ctx_ = ctx + return c +} + +func (c *EventsInstancesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + "eventId": c.eventId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.events.instances" call. +// Exactly one of *Events or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Events.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EventsInstancesCall) Do() (*Events, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Events{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + // "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. By default the value is 250 events. The page size can never be larger than 2500 events. 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. Must be an RFC3339 timestamp with mandatory time zone offset.", + // "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. Must be an RFC3339 timestamp with mandatory time zone offset.", + // "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{} + ctx_ context.Context +} + +// 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 event ID in +// the iCalendar format 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. By default the value is 250 +// events. The page size can never be larger than 2500 events. +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. +// +// Possible values: +// "startTime" - Order by the start date/time (ascending). This is +// only available when querying single events (i.e. the parameter +// singleEvents is True) +// "updated" - Order by last modification time (ascending). +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 +} + +// SyncToken sets the optional parameter "syncToken": Token obtained +// from the nextSyncToken field returned on the last page of results +// from the previous list request. It makes the result of this list +// request contain only entries that have changed since then. All events +// deleted since the previous list request will always be in the result +// set and it is not allowed to set showDeleted to False. +// There are several query parameters that cannot be specified together +// with nextSyncToken to ensure consistency of the client state. +// +// These are: +// - iCalUID +// - orderBy +// - privateExtendedProperty +// - q +// - sharedExtendedProperty +// - timeMin +// - timeMax +// - updatedMin If the syncToken expires, the server will respond with a +// 410 GONE response code and the client should clear its storage and +// perform a full synchronization without any syncToken. +// Learn more about incremental synchronization. +// The default is to return all entries. +func (c *EventsListCall) SyncToken(syncToken string) *EventsListCall { + c.opt_["syncToken"] = syncToken + 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. Must be an RFC3339 timestamp with +// mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, +// 2011-06-03T10:00:00Z. Milliseconds may be provided but will be +// ignored. +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. Must be an RFC3339 timestamp with mandatory +// time zone offset, e.g., 2011-06-03T10:00:00-07:00, +// 2011-06-03T10:00:00Z. Milliseconds may be provided but will be +// ignored. +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 RFC3339 timestamp) to filter +// by. When specified, entries deleted since this time will always be +// included regardless of showDeleted. The default is not to filter by +// last modification time. +func (c *EventsListCall) UpdatedMin(updatedMin string) *EventsListCall { + c.opt_["updatedMin"] = updatedMin + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventsListCall) Fields(s ...googleapi.Field) *EventsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EventsListCall) IfNoneMatch(entityTag string) *EventsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventsListCall) Context(ctx context.Context) *EventsListCall { + c.ctx_ = ctx + return c +} + +func (c *EventsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["syncToken"]; ok { + params.Set("syncToken", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.events.list" call. +// Exactly one of *Events or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Events.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EventsListCall) Do() (*Events, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Events{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "iCalUID": { + // "description": "Specifies event ID in the iCalendar format 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. By default the value is 250 events. The page size can never be larger than 2500 events. 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" + // }, + // "syncToken": { + // "description": "Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All events deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False.\nThere are several query parameters that cannot be specified together with nextSyncToken to ensure consistency of the client state.\n\nThese are: \n- iCalUID \n- orderBy \n- privateExtendedProperty \n- q \n- sharedExtendedProperty \n- timeMin \n- timeMax \n- updatedMin If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken.\nLearn more about incremental synchronization.\nOptional. The default is to return all entries.", + // "location": "query", + // "type": "string" + // }, + // "timeMax": { + // "description": "Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored.", + // "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. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored.", + // "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 RFC3339 timestamp) to filter by. When specified, entries deleted since this time will always be included regardless of showDeleted. 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventsMoveCall) Fields(s ...googleapi.Field) *EventsMoveCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventsMoveCall) Context(ctx context.Context) *EventsMoveCall { + c.ctx_ = ctx + return c +} + +func (c *EventsMoveCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("destination", fmt.Sprintf("%v", c.destinationid)) + if v, ok := c.opt_["sendNotifications"]; ok { + params.Set("sendNotifications", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}/move") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + "eventId": c.eventId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.events.move" call. +// Exactly one of *Event or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Event.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EventsMoveCall) Do() (*Event, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Event{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// SupportsAttachments sets the optional parameter +// "supportsAttachments": Whether API client performing operation +// supports event attachments. The default is False. +func (c *EventsPatchCall) SupportsAttachments(supportsAttachments bool) *EventsPatchCall { + c.opt_["supportsAttachments"] = supportsAttachments + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventsPatchCall) Fields(s ...googleapi.Field) *EventsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventsPatchCall) Context(ctx context.Context) *EventsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *EventsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["supportsAttachments"]; ok { + params.Set("supportsAttachments", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + "eventId": c.eventId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.events.patch" call. +// Exactly one of *Event or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Event.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EventsPatchCall) Do() (*Event, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Event{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + // "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" + // }, + // "supportsAttachments": { + // "description": "Whether API client performing operation supports event attachments. 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventsQuickAddCall) Fields(s ...googleapi.Field) *EventsQuickAddCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventsQuickAddCall) Context(ctx context.Context) *EventsQuickAddCall { + c.ctx_ = ctx + return c +} + +func (c *EventsQuickAddCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("text", fmt.Sprintf("%v", c.text)) + if v, ok := c.opt_["sendNotifications"]; ok { + params.Set("sendNotifications", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/quickAdd") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.events.quickAdd" call. +// Exactly one of *Event or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Event.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EventsQuickAddCall) Do() (*Event, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Event{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an event based on a simple text string.", + // "httpMethod": "POST", + // "id": "calendar.events.quickAdd", + // "parameterOrder": [ + // "calendarId", + // "text" + // ], + // "parameters": { + // "calendarId": { + // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// SupportsAttachments sets the optional parameter +// "supportsAttachments": Whether API client performing operation +// supports event attachments. The default is False. +func (c *EventsUpdateCall) SupportsAttachments(supportsAttachments bool) *EventsUpdateCall { + c.opt_["supportsAttachments"] = supportsAttachments + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventsUpdateCall) Fields(s ...googleapi.Field) *EventsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventsUpdateCall) Context(ctx context.Context) *EventsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *EventsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["supportsAttachments"]; ok { + params.Set("supportsAttachments", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + "eventId": c.eventId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.events.update" call. +// Exactly one of *Event or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Event.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EventsUpdateCall) Do() (*Event, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Event{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + // "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" + // }, + // "supportsAttachments": { + // "description": "Whether API client performing operation supports event attachments. 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{} + ctx_ context.Context +} + +// 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 event ID in +// the iCalendar format 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. By default the value is 250 +// events. The page size can never be larger than 2500 events. +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. +// +// Possible values: +// "startTime" - Order by the start date/time (ascending). This is +// only available when querying single events (i.e. the parameter +// singleEvents is True) +// "updated" - Order by last modification time (ascending). +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 +} + +// SyncToken sets the optional parameter "syncToken": Token obtained +// from the nextSyncToken field returned on the last page of results +// from the previous list request. It makes the result of this list +// request contain only entries that have changed since then. All events +// deleted since the previous list request will always be in the result +// set and it is not allowed to set showDeleted to False. +// There are several query parameters that cannot be specified together +// with nextSyncToken to ensure consistency of the client state. +// +// These are: +// - iCalUID +// - orderBy +// - privateExtendedProperty +// - q +// - sharedExtendedProperty +// - timeMin +// - timeMax +// - updatedMin If the syncToken expires, the server will respond with a +// 410 GONE response code and the client should clear its storage and +// perform a full synchronization without any syncToken. +// Learn more about incremental synchronization. +// The default is to return all entries. +func (c *EventsWatchCall) SyncToken(syncToken string) *EventsWatchCall { + c.opt_["syncToken"] = syncToken + 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. Must be an RFC3339 timestamp with +// mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, +// 2011-06-03T10:00:00Z. Milliseconds may be provided but will be +// ignored. +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. Must be an RFC3339 timestamp with mandatory +// time zone offset, e.g., 2011-06-03T10:00:00-07:00, +// 2011-06-03T10:00:00Z. Milliseconds may be provided but will be +// ignored. +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 RFC3339 timestamp) to filter +// by. When specified, entries deleted since this time will always be +// included regardless of showDeleted. The default is not to filter by +// last modification time. +func (c *EventsWatchCall) UpdatedMin(updatedMin string) *EventsWatchCall { + c.opt_["updatedMin"] = updatedMin + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventsWatchCall) Fields(s ...googleapi.Field) *EventsWatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventsWatchCall) Context(ctx context.Context) *EventsWatchCall { + c.ctx_ = ctx + return c +} + +func (c *EventsWatchCall) doRequest(alt string) (*http.Response, 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", alt) + 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_["syncToken"]; ok { + params.Set("syncToken", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/watch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "calendarId": c.calendarId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.events.watch" call. +// Exactly one of *Channel or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Channel.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EventsWatchCall) Do() (*Channel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Channel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "iCalUID": { + // "description": "Specifies event ID in the iCalendar format 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. By default the value is 250 events. The page size can never be larger than 2500 events. 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" + // }, + // "syncToken": { + // "description": "Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All events deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False.\nThere are several query parameters that cannot be specified together with nextSyncToken to ensure consistency of the client state.\n\nThese are: \n- iCalUID \n- orderBy \n- privateExtendedProperty \n- q \n- sharedExtendedProperty \n- timeMin \n- timeMax \n- updatedMin If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken.\nLearn more about incremental synchronization.\nOptional. The default is to return all entries.", + // "location": "query", + // "type": "string" + // }, + // "timeMax": { + // "description": "Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored.", + // "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. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored.", + // "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 RFC3339 timestamp) to filter by. When specified, entries deleted since this time will always be included regardless of showDeleted. 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FreebusyQueryCall) Fields(s ...googleapi.Field) *FreebusyQueryCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FreebusyQueryCall) Context(ctx context.Context) *FreebusyQueryCall { + c.ctx_ = ctx + return c +} + +func (c *FreebusyQueryCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.freebusy.query" call. +// Exactly one of *FreeBusyResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FreeBusyResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FreebusyQueryCall) Do() (*FreeBusyResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FreeBusyResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SettingsGetCall) Fields(s ...googleapi.Field) *SettingsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SettingsGetCall) IfNoneMatch(entityTag string) *SettingsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SettingsGetCall) Context(ctx context.Context) *SettingsGetCall { + c.ctx_ = ctx + return c +} + +func (c *SettingsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/settings/{setting}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "setting": c.setting, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.settings.get" call. +// Exactly one of *Setting or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Setting.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *SettingsGetCall) Do() (*Setting, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Setting{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a 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{} + ctx_ context.Context +} + +// 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 +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of entries returned on one result page. By default the value is 100 +// entries. The page size can never be larger than 250 entries. +func (c *SettingsListCall) MaxResults(maxResults int64) *SettingsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Token specifying +// which result page to return. +func (c *SettingsListCall) PageToken(pageToken string) *SettingsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SyncToken sets the optional parameter "syncToken": Token obtained +// from the nextSyncToken field returned on the last page of results +// from the previous list request. It makes the result of this list +// request contain only entries that have changed since then. +// If the syncToken expires, the server will respond with a 410 GONE +// response code and the client should clear its storage and perform a +// full synchronization without any syncToken. +// Learn more about incremental synchronization. +// The default is to return all entries. +func (c *SettingsListCall) SyncToken(syncToken string) *SettingsListCall { + c.opt_["syncToken"] = syncToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SettingsListCall) Fields(s ...googleapi.Field) *SettingsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SettingsListCall) IfNoneMatch(entityTag string) *SettingsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SettingsListCall) Context(ctx context.Context) *SettingsListCall { + c.ctx_ = ctx + return c +} + +func (c *SettingsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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_["syncToken"]; ok { + params.Set("syncToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/settings") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.settings.list" call. +// Exactly one of *Settings or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Settings.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SettingsListCall) Do() (*Settings, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Settings{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns all user settings for the authenticated user.", + // "httpMethod": "GET", + // "id": "calendar.settings.list", + // "parameters": { + // "maxResults": { + // "description": "Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Token specifying which result page to return. Optional.", + // "location": "query", + // "type": "string" + // }, + // "syncToken": { + // "description": "Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then.\nIf the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken.\nLearn more about incremental synchronization.\nOptional. The default is to return all entries.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "users/me/settings", + // "response": { + // "$ref": "Settings" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/calendar", + // "https://www.googleapis.com/auth/calendar.readonly" + // ], + // "supportsSubscription": true + // } + +} + +// method id "calendar.settings.watch": + +type SettingsWatchCall struct { + s *Service + channel *Channel + opt_ map[string]interface{} + ctx_ context.Context +} + +// Watch: Watch for changes to Settings resources. +func (r *SettingsService) Watch(channel *Channel) *SettingsWatchCall { + c := &SettingsWatchCall{s: r.s, opt_: make(map[string]interface{})} + c.channel = channel + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of entries returned on one result page. By default the value is 100 +// entries. The page size can never be larger than 250 entries. +func (c *SettingsWatchCall) MaxResults(maxResults int64) *SettingsWatchCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Token specifying +// which result page to return. +func (c *SettingsWatchCall) PageToken(pageToken string) *SettingsWatchCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SyncToken sets the optional parameter "syncToken": Token obtained +// from the nextSyncToken field returned on the last page of results +// from the previous list request. It makes the result of this list +// request contain only entries that have changed since then. +// If the syncToken expires, the server will respond with a 410 GONE +// response code and the client should clear its storage and perform a +// full synchronization without any syncToken. +// Learn more about incremental synchronization. +// The default is to return all entries. +func (c *SettingsWatchCall) SyncToken(syncToken string) *SettingsWatchCall { + c.opt_["syncToken"] = syncToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SettingsWatchCall) Fields(s ...googleapi.Field) *SettingsWatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SettingsWatchCall) Context(ctx context.Context) *SettingsWatchCall { + c.ctx_ = ctx + return c +} + +func (c *SettingsWatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.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_["syncToken"]; ok { + params.Set("syncToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/settings/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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "calendar.settings.watch" call. +// Exactly one of *Channel or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Channel.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *SettingsWatchCall) Do() (*Channel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Channel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Watch for changes to Settings resources.", + // "httpMethod": "POST", + // "id": "calendar.settings.watch", + // "parameters": { + // "maxResults": { + // "description": "Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Token specifying which result page to return. Optional.", + // "location": "query", + // "type": "string" + // }, + // "syncToken": { + // "description": "Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then.\nIf the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken.\nLearn more about incremental synchronization.\nOptional. The default is to return all entries.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "users/me/settings/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 + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/civicinfo/v2/civicinfo-api.json b/Godeps/_workspace/src/google.golang.org/api/civicinfo/v2/civicinfo-api.json new file mode 100644 index 000000000..e9faf7651 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/civicinfo/v2/civicinfo-api.json @@ -0,0 +1,1069 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/ZiNhyAfCE7ZKhbU1KQ-igi1g1zk\"", + "discoveryVersion": "v1", + "id": "civicinfo:v2", + "name": "civicinfo", + "canonicalName": "Civic Info", + "version": "v2", + "revision": "20150820", + "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/v2/", + "basePath": "/civicinfo/v2/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "civicinfo/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" + } + }, + "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": "array", + "description": "The levels of government of the office for this contest. There may be more than one in cases where a jurisdiction effectively acts at two different levels of government; for example, the mayor of the District of Columbia acts at \"locality\" level, but also effectively at both \"administrative-area-2\" and \"administrative-area-1\".", + "items": { + "type": "string" + } + }, + "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." + }, + "referendumBallotResponses": { + "type": "array", + "description": "The set of ballot responses for the referendum. A ballot response represents a line on the ballot. Common examples might include \"yes\" or \"no\" for referenda, or a judge's name for a retention contest. This field is only populated for contests of type 'Referendum'.", + "items": { + "type": "string" + } + }, + "referendumBrief": { + "type": "string", + "description": "Specifies a short summary of the referendum that is typically on the ballot below the title but above the text. This field is only populated for contests of type 'Referendum'." + }, + "referendumConStatement": { + "type": "string", + "description": "A statement in opposition to the referendum. It does not necessarily appear on the ballot. This field is only populated for contests of type 'Referendum'." + }, + "referendumEffectOfAbstain": { + "type": "string", + "description": "Specifies what effect abstaining (not voting) on the proposition will have (i.e. whether abstaining is considered a vote against it). This field is only populated for contests of type 'Referendum'." + }, + "referendumPassageThreshold": { + "type": "string", + "description": "The threshold of votes that the referendum needs in order to pass, e.g. \"two-thirds\". This field is only populated for contests of type 'Referendum'." + }, + "referendumProStatement": { + "type": "string", + "description": "A statement in favor of the referendum. It does not necessarily appear on the ballot. This field is only populated for contests of type 'Referendum'." + }, + "referendumSubtitle": { + "type": "string", + "description": "A brief description of the referendum. This field is only populated for contests of type 'Referendum'." + }, + "referendumText": { + "type": "string", + "description": "The full text 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'." + }, + "roles": { + "type": "array", + "description": "The roles which this office fulfills.", + "items": { + "type": "string" + } + }, + "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" + } + } + } + }, + "DivisionSearchResult": { + "id": "DivisionSearchResult", + "type": "object", + "description": "Represents a political geographic division that matches the requested query.", + "properties": { + "aliases": { + "type": "array", + "description": "Other Open Civic Data identifiers that refer to the same division -- for example, those that refer to other political divisions whose boundaries are defined to be coterminous with this one. For example, ocd-division/country:us/state:wy will include an alias of ocd-division/country:us/state:wy/cd:1, since Wyoming has only one Congressional district.", + "items": { + "type": "string" + } + }, + "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." + }, + "ocdDivisionId": { + "type": "string", + "description": "The political division of the election. Represented as an OCD Division ID. Voters within these political jurisdictions are covered by this election. This is typically a state such as ocd-division/country:us/state:ca or for the midterms or general election the entire US (i.e. ocd-division/country:us)." + } + } + }, + "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": { + "alsoKnownAs": { + "type": "array", + "description": "Any other valid OCD IDs that refer to the same division.\n\nBecause OCD IDs are meant to be human-readable and at least somewhat predictable, there are occasionally several identifiers for a single division. These identifiers are defined to be equivalent to one another, and one is always indicated as the primary identifier. The primary identifier will be returned in ocd_id above, and any other equivalent valid identifiers will be returned in this list.\n\nFor example, if this division's OCD ID is ocd-division/country:us/district:dc, this will contain ocd-division/country:us/state:dc.", + "items": { + "type": "string" + } + }, + "name": { + "type": "string", + "description": "The name of the division." + }, + "officeIndices": { + "type": "array", + "description": "List of indices in the offices array, one for each office elected from this division. Will only be present if includeOffices was true (or absent) in the request.", + "items": { + "type": "integer", + "format": "uint32" + } + } + } + }, + "Office": { + "id": "Office", + "type": "object", + "description": "Information about an Office held by one or more Officials.", + "properties": { + "divisionId": { + "type": "string", + "description": "The OCD ID of the division with which this office is associated." + }, + "levels": { + "type": "array", + "description": "The levels of government of which this office is part. There may be more than one in cases where a jurisdiction effectively acts at two different levels of government; for example, the mayor of the District of Columbia acts at \"locality\" level, but also effectively at both \"administrative-area-2\" and \"administrative-area-1\".", + "items": { + "type": "string" + } + }, + "name": { + "type": "string", + "description": "The human-readable name of the office." + }, + "officialIndices": { + "type": "array", + "description": "List of indices in the officials array of people who presently hold this office.", + "items": { + "type": "integer", + "format": "uint32" + } + }, + "roles": { + "type": "array", + "description": "The roles which this office fulfills. Roles are not meant to be exhaustive, or to exactly specify the entire set of responsibilities of a given office, but are meant to be rough categories that are useful for general selection from or sorting of a list of offices.", + "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 person 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, an election day voting location, or a drop off location for a completed ballot.", + "properties": { + "address": { + "$ref": "SimpleAddressType", + "description": "The address of the location." + }, + "endDate": { + "type": "string", + "description": "The last date that this early vote site or drop off location 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 or drop off location. 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 or drop off location may be used. This field is not populated for polling locations." + }, + "voterServices": { + "type": "string", + "description": "The services provided by this early vote site or drop off location. This field is not populated for polling locations." + } + } + }, + "RepresentativeInfoData": { + "id": "RepresentativeInfoData", + "type": "object", + "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." + } + }, + "offices": { + "type": "array", + "description": "Elected offices referenced by the divisions listed above. Will only be present if includeOffices was true in the request.", + "items": { + "$ref": "Office" + } + }, + "officials": { + "type": "array", + "description": "Officials holding the offices listed above. Will only be present if includeOffices was true in the request.", + "items": { + "$ref": "Official" + } + } + } + }, + "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": "array", + "description": "Elected offices referenced by the divisions listed above. Will only be present if includeOffices was true in the request.", + "items": { + "$ref": "Office" + } + }, + "officials": { + "type": "array", + "description": "Officials holding the offices listed above. Will only be present if includeOffices was true in the request.", + "items": { + "$ref": "Official" + } + } + } + }, + "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." + } + } + }, + "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" + } + }, + "dropOffLocations": { + "type": "array", + "description": "Locations where a voter is eligible to drop off a completed ballot. The voter must have received and completed a ballot prior to arriving at the location. The location may not have ballots available on the premises. These locations could be open on or before election day as indicated in the pollingHours field.", + "items": { + "$ref": "PollingLocation" + } + }, + "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" + }, + "mailOnly": { + "type": "boolean", + "description": "Specifies whether voters in the precinct vote only by mailing their ballots (with the possible option of dropping off their ballots as well)." + }, + "normalizedInput": { + "$ref": "SimpleAddressType", + "description": "The normalized version of the requested address" + }, + "otherElections": { + "type": "array", + "description": "If no election ID was specified in the query, and there was more than one election with data for the given voter, this will contain information about the other elections that could apply.", + "items": { + "$ref": "Election" + } + }, + "pollingLocations": { + "type": "array", + "description": "Locations where the voter is eligible to vote on election day.", + "items": { + "$ref": "PollingLocation" + } + }, + "precinctId": { + "type": "string" + }, + "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" + } + } + } + } + }, + "resources": { + "divisions": { + "methods": { + "search": { + "id": "civicinfo.divisions.search", + "path": "divisions", + "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", + "httpMethod": "GET", + "description": "Looks up information relevant to a voter based on the voter's registered address.", + "parameters": { + "address": { + "type": "string", + "description": "The registered address of the voter to look up.", + "required": true, + "location": "query" + }, + "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", + "default": "0", + "format": "int64", + "location": "query" + }, + "officialOnly": { + "type": "boolean", + "description": "If set to true, only data from official state sources will be returned.", + "default": "false", + "location": "query" + } + }, + "parameterOrder": [ + "address" + ], + "response": { + "$ref": "VoterInfoResponse" + } + } + } + }, + "representatives": { + "methods": { + "representativeInfoByAddress": { + "id": "civicinfo.representatives.representativeInfoByAddress", + "path": "representatives", + "httpMethod": "GET", + "description": "Looks up political geography and representative information for a single address.", + "parameters": { + "address": { + "type": "string", + "description": "The address to look up. May only be specified if the field ocdId is not given in the URL.", + "location": "query" + }, + "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" + }, + "levels": { + "type": "string", + "description": "A list of office levels to filter by. Only offices that serve at least one of these levels will be returned. Divisions that don't contain a matching office will not be returned.", + "enum": [ + "administrativeArea1", + "administrativeArea2", + "country", + "international", + "locality", + "regional", + "special", + "subLocality1", + "subLocality2" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + }, + "roles": { + "type": "string", + "description": "A list of office roles to filter by. Only offices fulfilling one of these roles will be returned. Divisions that don't contain a matching office will not be returned.", + "enum": [ + "deputyHeadOfGovernment", + "executiveCouncil", + "governmentOfficer", + "headOfGovernment", + "headOfState", + "highestCourtJudge", + "judge", + "legislatorLowerBody", + "legislatorUpperBody", + "schoolBoard", + "specialPurposeOfficer" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + } + }, + "response": { + "$ref": "RepresentativeInfoResponse" + } + }, + "representativeInfoByDivision": { + "id": "civicinfo.representatives.representativeInfoByDivision", + "path": "representatives/{ocdId}", + "httpMethod": "GET", + "description": "Looks up representative information for a single geographic division.", + "parameters": { + "levels": { + "type": "string", + "description": "A list of office levels to filter by. Only offices that serve at least one of these levels will be returned. Divisions that don't contain a matching office will not be returned.", + "enum": [ + "administrativeArea1", + "administrativeArea2", + "country", + "international", + "locality", + "regional", + "special", + "subLocality1", + "subLocality2" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + }, + "ocdId": { + "type": "string", + "description": "The Open Civic Data division identifier of the division to look up.", + "required": true, + "location": "path" + }, + "recursive": { + "type": "boolean", + "description": "If true, information about all divisions contained in the division requested will be included as well. For example, if querying ocd-division/country:us/district:dc, this would also return all DC's wards and ANCs.", + "location": "query" + }, + "roles": { + "type": "string", + "description": "A list of office roles to filter by. Only offices fulfilling one of these roles will be returned. Divisions that don't contain a matching office will not be returned.", + "enum": [ + "deputyHeadOfGovernment", + "executiveCouncil", + "governmentOfficer", + "headOfGovernment", + "headOfState", + "highestCourtJudge", + "judge", + "legislatorLowerBody", + "legislatorUpperBody", + "schoolBoard", + "specialPurposeOfficer" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "ocdId" + ], + "response": { + "$ref": "RepresentativeInfoData" + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/civicinfo/v2/civicinfo-gen.go b/Godeps/_workspace/src/google.golang.org/api/civicinfo/v2/civicinfo-gen.go new file mode 100644 index 000000000..a05ee35f9 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/civicinfo/v2/civicinfo-gen.go @@ -0,0 +1,1868 @@ +// Package civicinfo provides access to the Google Civic Information API. +// +// See https://developers.google.com/civic-information +// +// Usage example: +// +// import "google.golang.org/api/civicinfo/v2" +// ... +// civicinfoService, err := civicinfo.New(oauthHttpClient) +package civicinfo // import "google.golang.org/api/civicinfo/v2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "civicinfo:v2" +const apiName = "civicinfo" +const apiVersion = "v2" +const basePath = "https://www.googleapis.com/civicinfo/v2/" + +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 + UserAgent string // optional additional User-Agent fragment + + Divisions *DivisionsService + + Elections *ElectionsService + + Representatives *RepresentativesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 +} + +// AdministrationRegion: Describes information about a regional election +// administrative area. +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"` + + // LocalJurisdiction: The city or county that provides election + // information for this voter. This object can have the same elements as + // state. + LocalJurisdiction *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"` + + // ForceSendFields is a list of field names (e.g. + // "ElectionAdministrationBody") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdministrationRegion) MarshalJSON() ([]byte, error) { + type noMethod AdministrationRegion + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdministrativeBody: Information about an election administrative body +// (e.g. County Board of Elections). +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"` + + // VoterServices: A description of the services this administrative body + // may provide. + VoterServices []string `json:"voter_services,omitempty"` + + // VotingLocationFinderUrl: A URL provided by this administrative body + // for looking up where to vote. + VotingLocationFinderUrl string `json:"votingLocationFinderUrl,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "AbsenteeVotingInfoUrl") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdministrativeBody) MarshalJSON() ([]byte, error) { + type noMethod AdministrativeBody + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Candidate: Information about a candidate running for elected office. +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"` + + // ForceSendFields is a list of field names (e.g. "CandidateUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Candidate) MarshalJSON() ([]byte, error) { + type noMethod Candidate + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Channel: A social media or web channel for a candidate. +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Channel) MarshalJSON() ([]byte, error) { + type noMethod Channel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Contest: Information about a contest that appears on a voter's +// ballot. +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 levels of government of the office for this contest. There + // may be more than one in cases where a jurisdiction effectively acts + // at two different levels of government; for example, the mayor of the + // District of Columbia acts at "locality" level, but also effectively + // at both "administrative-area-2" and "administrative-area-1". + 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"` + + // ReferendumBallotResponses: The set of ballot responses for the + // referendum. A ballot response represents a line on the ballot. Common + // examples might include "yes" or "no" for referenda, or a judge's name + // for a retention contest. This field is only populated for contests of + // type 'Referendum'. + ReferendumBallotResponses []string `json:"referendumBallotResponses,omitempty"` + + // ReferendumBrief: Specifies a short summary of the referendum that is + // typically on the ballot below the title but above the text. This + // field is only populated for contests of type 'Referendum'. + ReferendumBrief string `json:"referendumBrief,omitempty"` + + // ReferendumConStatement: A statement in opposition to the referendum. + // It does not necessarily appear on the ballot. This field is only + // populated for contests of type 'Referendum'. + ReferendumConStatement string `json:"referendumConStatement,omitempty"` + + // ReferendumEffectOfAbstain: Specifies what effect abstaining (not + // voting) on the proposition will have (i.e. whether abstaining is + // considered a vote against it). This field is only populated for + // contests of type 'Referendum'. + ReferendumEffectOfAbstain string `json:"referendumEffectOfAbstain,omitempty"` + + // ReferendumPassageThreshold: The threshold of votes that the + // referendum needs in order to pass, e.g. "two-thirds". This field is + // only populated for contests of type 'Referendum'. + ReferendumPassageThreshold string `json:"referendumPassageThreshold,omitempty"` + + // ReferendumProStatement: A statement in favor of the referendum. It + // does not necessarily appear on the ballot. This field is only + // populated for contests of type 'Referendum'. + ReferendumProStatement string `json:"referendumProStatement,omitempty"` + + // ReferendumSubtitle: A brief description of the referendum. This field + // is only populated for contests of type 'Referendum'. + ReferendumSubtitle string `json:"referendumSubtitle,omitempty"` + + // ReferendumText: The full text of the referendum. This field is only + // populated for contests of type 'Referendum'. + ReferendumText string `json:"referendumText,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"` + + // Roles: The roles which this office fulfills. + Roles []string `json:"roles,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"` + + // ForceSendFields is a list of field names (e.g. "BallotPlacement") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Contest) MarshalJSON() ([]byte, error) { + type noMethod Contest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DivisionSearchResponse: The result of a division search query. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DivisionSearchResponse) MarshalJSON() ([]byte, error) { + type noMethod DivisionSearchResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DivisionSearchResult: Represents a political geographic division that +// matches the requested query. +type DivisionSearchResult struct { + // Aliases: Other Open Civic Data identifiers that refer to the same + // division -- for example, those that refer to other political + // divisions whose boundaries are defined to be coterminous with this + // one. For example, ocd-division/country:us/state:wy will include an + // alias of ocd-division/country:us/state:wy/cd:1, since Wyoming has + // only one Congressional district. + Aliases []string `json:"aliases,omitempty"` + + // 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"` + + // ForceSendFields is a list of field names (e.g. "Aliases") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DivisionSearchResult) MarshalJSON() ([]byte, error) { + type noMethod DivisionSearchResult + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Election: Information about the election that was queried. +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"` + + // OcdDivisionId: The political division of the election. Represented as + // an OCD Division ID. Voters within these political jurisdictions are + // covered by this election. This is typically a state such as + // ocd-division/country:us/state:ca or for the midterms or general + // election the entire US (i.e. ocd-division/country:us). + OcdDivisionId string `json:"ocdDivisionId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ElectionDay") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Election) MarshalJSON() ([]byte, error) { + type noMethod Election + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ElectionOfficial: Information about individual election officials. +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"` + + // ForceSendFields is a list of field names (e.g. "EmailAddress") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ElectionOfficial) MarshalJSON() ([]byte, error) { + type noMethod ElectionOfficial + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ElectionsQueryResponse: The list of elections available for this +// version of the API. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Elections") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ElectionsQueryResponse) MarshalJSON() ([]byte, error) { + type noMethod ElectionsQueryResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ElectoralDistrict: Describes the geographic scope of a contest. +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ElectoralDistrict) MarshalJSON() ([]byte, error) { + type noMethod ElectoralDistrict + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GeographicDivision: Describes a political geography. +type GeographicDivision struct { + // AlsoKnownAs: Any other valid OCD IDs that refer to the same + // division. + // + // Because OCD IDs are meant to be human-readable and at least somewhat + // predictable, there are occasionally several identifiers for a single + // division. These identifiers are defined to be equivalent to one + // another, and one is always indicated as the primary identifier. The + // primary identifier will be returned in ocd_id above, and any other + // equivalent valid identifiers will be returned in this list. + // + // For example, if this division's OCD ID is + // ocd-division/country:us/district:dc, this will contain + // ocd-division/country:us/state:dc. + AlsoKnownAs []string `json:"alsoKnownAs,omitempty"` + + // Name: The name of the division. + Name string `json:"name,omitempty"` + + // OfficeIndices: List of indices in the offices array, one for each + // office elected from this division. Will only be present if + // includeOffices was true (or absent) in the request. + OfficeIndices []int64 `json:"officeIndices,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AlsoKnownAs") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeographicDivision) MarshalJSON() ([]byte, error) { + type noMethod GeographicDivision + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Office: Information about an Office held by one or more Officials. +type Office struct { + // DivisionId: The OCD ID of the division with which this office is + // associated. + DivisionId string `json:"divisionId,omitempty"` + + // Levels: The levels of government of which this office is part. There + // may be more than one in cases where a jurisdiction effectively acts + // at two different levels of government; for example, the mayor of the + // District of Columbia acts at "locality" level, but also effectively + // at both "administrative-area-2" and "administrative-area-1". + Levels []string `json:"levels,omitempty"` + + // Name: The human-readable name of the office. + Name string `json:"name,omitempty"` + + // OfficialIndices: List of indices in the officials array of people who + // presently hold this office. + OfficialIndices []int64 `json:"officialIndices,omitempty"` + + // Roles: The roles which this office fulfills. Roles are not meant to + // be exhaustive, or to exactly specify the entire set of + // responsibilities of a given office, but are meant to be rough + // categories that are useful for general selection from or sorting of a + // list of offices. + Roles []string `json:"roles,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"` + + // ForceSendFields is a list of field names (e.g. "DivisionId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Office) MarshalJSON() ([]byte, error) { + type noMethod Office + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Official: Information about a person holding an elected office. +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"` + + // ForceSendFields is a list of field names (e.g. "Address") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Official) MarshalJSON() ([]byte, error) { + type noMethod Official + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PollingLocation: A location where a voter can vote. This may be an +// early vote site, an election day voting location, or a drop off +// location for a completed ballot. +type PollingLocation struct { + // Address: The address of the location. + Address *SimpleAddressType `json:"address,omitempty"` + + // EndDate: The last date that this early vote site or drop off location + // 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 or drop off location. 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 or drop off + // location 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 or drop + // off location. This field is not populated for polling locations. + VoterServices string `json:"voterServices,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Address") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PollingLocation) MarshalJSON() ([]byte, error) { + type noMethod PollingLocation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type RepresentativeInfoData struct { + // Divisions: Political geographic divisions that contain the requested + // address. + Divisions map[string]GeographicDivision `json:"divisions,omitempty"` + + // Offices: Elected offices referenced by the divisions listed above. + // Will only be present if includeOffices was true in the request. + Offices []*Office `json:"offices,omitempty"` + + // Officials: Officials holding the offices listed above. Will only be + // present if includeOffices was true in the request. + Officials []*Official `json:"officials,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Divisions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RepresentativeInfoData) MarshalJSON() ([]byte, error) { + type noMethod RepresentativeInfoData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RepresentativeInfoResponse: The result of a representative info +// lookup query. +type RepresentativeInfoResponse struct { + // Divisions: Political geographic divisions that contain the requested + // address. + Divisions map[string]GeographicDivision `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 []*Office `json:"offices,omitempty"` + + // Officials: Officials holding the offices listed above. Will only be + // present if includeOffices was true in the request. + Officials []*Official `json:"officials,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Divisions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RepresentativeInfoResponse) MarshalJSON() ([]byte, error) { + type noMethod RepresentativeInfoResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SimpleAddressType: A simple representation of an address. +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"` + + // ForceSendFields is a list of field names (e.g. "City") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SimpleAddressType) MarshalJSON() ([]byte, error) { + type noMethod SimpleAddressType + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Source: Contains information about the data source for the element +// containing it. +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"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Source) MarshalJSON() ([]byte, error) { + type noMethod Source + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VoterInfoResponse: The result of a voter info lookup query. +type VoterInfoResponse struct { + // Contests: Contests that will appear on the voter's ballot. + Contests []*Contest `json:"contests,omitempty"` + + // DropOffLocations: Locations where a voter is eligible to drop off a + // completed ballot. The voter must have received and completed a ballot + // prior to arriving at the location. The location may not have ballots + // available on the premises. These locations could be open on or before + // election day as indicated in the pollingHours field. + DropOffLocations []*PollingLocation `json:"dropOffLocations,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"` + + // MailOnly: Specifies whether voters in the precinct vote only by + // mailing their ballots (with the possible option of dropping off their + // ballots as well). + MailOnly bool `json:"mailOnly,omitempty"` + + // NormalizedInput: The normalized version of the requested address + NormalizedInput *SimpleAddressType `json:"normalizedInput,omitempty"` + + // OtherElections: If no election ID was specified in the query, and + // there was more than one election with data for the given voter, this + // will contain information about the other elections that could apply. + OtherElections []*Election `json:"otherElections,omitempty"` + + // PollingLocations: Locations where the voter is eligible to vote on + // election day. + PollingLocations []*PollingLocation `json:"pollingLocations,omitempty"` + + PrecinctId string `json:"precinctId,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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Contests") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VoterInfoResponse) MarshalJSON() ([]byte, error) { + type noMethod VoterInfoResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "civicinfo.divisions.search": + +type DivisionsSearchCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DivisionsSearchCall) Fields(s ...googleapi.Field) *DivisionsSearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DivisionsSearchCall) IfNoneMatch(entityTag string) *DivisionsSearchCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DivisionsSearchCall) Context(ctx context.Context) *DivisionsSearchCall { + c.ctx_ = ctx + return c +} + +func (c *DivisionsSearchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["query"]; ok { + params.Set("query", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "divisions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "civicinfo.divisions.search" call. +// Exactly one of *DivisionSearchResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DivisionSearchResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DivisionsSearchCall) Do() (*DivisionSearchResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DivisionSearchResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "divisions", + // "response": { + // "$ref": "DivisionSearchResponse" + // } + // } + +} + +// method id "civicinfo.elections.electionQuery": + +type ElectionsElectionQueryCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// ElectionQuery: List of available elections to query. +func (r *ElectionsService) ElectionQuery() *ElectionsElectionQueryCall { + c := &ElectionsElectionQueryCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ElectionsElectionQueryCall) Fields(s ...googleapi.Field) *ElectionsElectionQueryCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ElectionsElectionQueryCall) IfNoneMatch(entityTag string) *ElectionsElectionQueryCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ElectionsElectionQueryCall) Context(ctx context.Context) *ElectionsElectionQueryCall { + c.ctx_ = ctx + return c +} + +func (c *ElectionsElectionQueryCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "elections") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "civicinfo.elections.electionQuery" call. +// Exactly one of *ElectionsQueryResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ElectionsQueryResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ElectionsElectionQueryCall) Do() (*ElectionsQueryResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ElectionsQueryResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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 + address string + opt_ map[string]interface{} + ctx_ context.Context +} + +// VoterInfoQuery: Looks up information relevant to a voter based on the +// voter's registered address. +func (r *ElectionsService) VoterInfoQuery(address string) *ElectionsVoterInfoQueryCall { + c := &ElectionsVoterInfoQueryCall{s: r.s, opt_: make(map[string]interface{})} + c.address = address + return c +} + +// ElectionId sets the optional parameter "electionId": 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 +func (c *ElectionsVoterInfoQueryCall) ElectionId(electionId int64) *ElectionsVoterInfoQueryCall { + c.opt_["electionId"] = electionId + 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ElectionsVoterInfoQueryCall) Fields(s ...googleapi.Field) *ElectionsVoterInfoQueryCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ElectionsVoterInfoQueryCall) IfNoneMatch(entityTag string) *ElectionsVoterInfoQueryCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ElectionsVoterInfoQueryCall) Context(ctx context.Context) *ElectionsVoterInfoQueryCall { + c.ctx_ = ctx + return c +} + +func (c *ElectionsVoterInfoQueryCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("address", fmt.Sprintf("%v", c.address)) + if v, ok := c.opt_["electionId"]; ok { + params.Set("electionId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["officialOnly"]; ok { + params.Set("officialOnly", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "voterinfo") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "civicinfo.elections.voterInfoQuery" call. +// Exactly one of *VoterInfoResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *VoterInfoResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ElectionsVoterInfoQueryCall) Do() (*VoterInfoResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &VoterInfoResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Looks up information relevant to a voter based on the voter's registered address.", + // "httpMethod": "GET", + // "id": "civicinfo.elections.voterInfoQuery", + // "parameterOrder": [ + // "address" + // ], + // "parameters": { + // "address": { + // "description": "The registered address of the voter to look up.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "electionId": { + // "default": "0", + // "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": "query", + // "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", + // "response": { + // "$ref": "VoterInfoResponse" + // } + // } + +} + +// method id "civicinfo.representatives.representativeInfoByAddress": + +type RepresentativesRepresentativeInfoByAddressCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// RepresentativeInfoByAddress: Looks up political geography and +// representative information for a single address. +func (r *RepresentativesService) RepresentativeInfoByAddress() *RepresentativesRepresentativeInfoByAddressCall { + c := &RepresentativesRepresentativeInfoByAddressCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Address sets the optional parameter "address": The address to look +// up. May only be specified if the field ocdId is not given in the URL. +func (c *RepresentativesRepresentativeInfoByAddressCall) Address(address string) *RepresentativesRepresentativeInfoByAddressCall { + c.opt_["address"] = address + 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 *RepresentativesRepresentativeInfoByAddressCall) IncludeOffices(includeOffices bool) *RepresentativesRepresentativeInfoByAddressCall { + c.opt_["includeOffices"] = includeOffices + return c +} + +// Levels sets the optional parameter "levels": A list of office levels +// to filter by. Only offices that serve at least one of these levels +// will be returned. Divisions that don't contain a matching office will +// not be returned. +// +// Possible values: +// "administrativeArea1" +// "administrativeArea2" +// "country" +// "international" +// "locality" +// "regional" +// "special" +// "subLocality1" +// "subLocality2" +func (c *RepresentativesRepresentativeInfoByAddressCall) Levels(levels string) *RepresentativesRepresentativeInfoByAddressCall { + c.opt_["levels"] = levels + return c +} + +// Roles sets the optional parameter "roles": A list of office roles to +// filter by. Only offices fulfilling one of these roles will be +// returned. Divisions that don't contain a matching office will not be +// returned. +// +// Possible values: +// "deputyHeadOfGovernment" +// "executiveCouncil" +// "governmentOfficer" +// "headOfGovernment" +// "headOfState" +// "highestCourtJudge" +// "judge" +// "legislatorLowerBody" +// "legislatorUpperBody" +// "schoolBoard" +// "specialPurposeOfficer" +func (c *RepresentativesRepresentativeInfoByAddressCall) Roles(roles string) *RepresentativesRepresentativeInfoByAddressCall { + c.opt_["roles"] = roles + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RepresentativesRepresentativeInfoByAddressCall) Fields(s ...googleapi.Field) *RepresentativesRepresentativeInfoByAddressCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RepresentativesRepresentativeInfoByAddressCall) IfNoneMatch(entityTag string) *RepresentativesRepresentativeInfoByAddressCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RepresentativesRepresentativeInfoByAddressCall) Context(ctx context.Context) *RepresentativesRepresentativeInfoByAddressCall { + c.ctx_ = ctx + return c +} + +func (c *RepresentativesRepresentativeInfoByAddressCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["address"]; ok { + params.Set("address", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["includeOffices"]; ok { + params.Set("includeOffices", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["levels"]; ok { + params.Set("levels", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["roles"]; ok { + params.Set("roles", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "representatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "civicinfo.representatives.representativeInfoByAddress" call. +// Exactly one of *RepresentativeInfoResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *RepresentativeInfoResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RepresentativesRepresentativeInfoByAddressCall) Do() (*RepresentativeInfoResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RepresentativeInfoResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Looks up political geography and representative information for a single address.", + // "httpMethod": "GET", + // "id": "civicinfo.representatives.representativeInfoByAddress", + // "parameters": { + // "address": { + // "description": "The address to look up. May only be specified if the field ocdId is not given in the URL.", + // "location": "query", + // "type": "string" + // }, + // "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" + // }, + // "levels": { + // "description": "A list of office levels to filter by. Only offices that serve at least one of these levels will be returned. Divisions that don't contain a matching office will not be returned.", + // "enum": [ + // "administrativeArea1", + // "administrativeArea2", + // "country", + // "international", + // "locality", + // "regional", + // "special", + // "subLocality1", + // "subLocality2" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "roles": { + // "description": "A list of office roles to filter by. Only offices fulfilling one of these roles will be returned. Divisions that don't contain a matching office will not be returned.", + // "enum": [ + // "deputyHeadOfGovernment", + // "executiveCouncil", + // "governmentOfficer", + // "headOfGovernment", + // "headOfState", + // "highestCourtJudge", + // "judge", + // "legislatorLowerBody", + // "legislatorUpperBody", + // "schoolBoard", + // "specialPurposeOfficer" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "representatives", + // "response": { + // "$ref": "RepresentativeInfoResponse" + // } + // } + +} + +// method id "civicinfo.representatives.representativeInfoByDivision": + +type RepresentativesRepresentativeInfoByDivisionCall struct { + s *Service + ocdId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// RepresentativeInfoByDivision: Looks up representative information for +// a single geographic division. +func (r *RepresentativesService) RepresentativeInfoByDivision(ocdId string) *RepresentativesRepresentativeInfoByDivisionCall { + c := &RepresentativesRepresentativeInfoByDivisionCall{s: r.s, opt_: make(map[string]interface{})} + c.ocdId = ocdId + return c +} + +// Levels sets the optional parameter "levels": A list of office levels +// to filter by. Only offices that serve at least one of these levels +// will be returned. Divisions that don't contain a matching office will +// not be returned. +// +// Possible values: +// "administrativeArea1" +// "administrativeArea2" +// "country" +// "international" +// "locality" +// "regional" +// "special" +// "subLocality1" +// "subLocality2" +func (c *RepresentativesRepresentativeInfoByDivisionCall) Levels(levels string) *RepresentativesRepresentativeInfoByDivisionCall { + c.opt_["levels"] = levels + return c +} + +// Recursive sets the optional parameter "recursive": If true, +// information about all divisions contained in the division requested +// will be included as well. For example, if querying +// ocd-division/country:us/district:dc, this would also return all DC's +// wards and ANCs. +func (c *RepresentativesRepresentativeInfoByDivisionCall) Recursive(recursive bool) *RepresentativesRepresentativeInfoByDivisionCall { + c.opt_["recursive"] = recursive + return c +} + +// Roles sets the optional parameter "roles": A list of office roles to +// filter by. Only offices fulfilling one of these roles will be +// returned. Divisions that don't contain a matching office will not be +// returned. +// +// Possible values: +// "deputyHeadOfGovernment" +// "executiveCouncil" +// "governmentOfficer" +// "headOfGovernment" +// "headOfState" +// "highestCourtJudge" +// "judge" +// "legislatorLowerBody" +// "legislatorUpperBody" +// "schoolBoard" +// "specialPurposeOfficer" +func (c *RepresentativesRepresentativeInfoByDivisionCall) Roles(roles string) *RepresentativesRepresentativeInfoByDivisionCall { + c.opt_["roles"] = roles + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RepresentativesRepresentativeInfoByDivisionCall) Fields(s ...googleapi.Field) *RepresentativesRepresentativeInfoByDivisionCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RepresentativesRepresentativeInfoByDivisionCall) IfNoneMatch(entityTag string) *RepresentativesRepresentativeInfoByDivisionCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RepresentativesRepresentativeInfoByDivisionCall) Context(ctx context.Context) *RepresentativesRepresentativeInfoByDivisionCall { + c.ctx_ = ctx + return c +} + +func (c *RepresentativesRepresentativeInfoByDivisionCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["levels"]; ok { + params.Set("levels", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["recursive"]; ok { + params.Set("recursive", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["roles"]; ok { + params.Set("roles", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "representatives/{ocdId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "ocdId": c.ocdId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "civicinfo.representatives.representativeInfoByDivision" call. +// Exactly one of *RepresentativeInfoData or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *RepresentativeInfoData.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RepresentativesRepresentativeInfoByDivisionCall) Do() (*RepresentativeInfoData, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RepresentativeInfoData{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Looks up representative information for a single geographic division.", + // "httpMethod": "GET", + // "id": "civicinfo.representatives.representativeInfoByDivision", + // "parameterOrder": [ + // "ocdId" + // ], + // "parameters": { + // "levels": { + // "description": "A list of office levels to filter by. Only offices that serve at least one of these levels will be returned. Divisions that don't contain a matching office will not be returned.", + // "enum": [ + // "administrativeArea1", + // "administrativeArea2", + // "country", + // "international", + // "locality", + // "regional", + // "special", + // "subLocality1", + // "subLocality2" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ocdId": { + // "description": "The Open Civic Data division identifier of the division to look up.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "recursive": { + // "description": "If true, information about all divisions contained in the division requested will be included as well. For example, if querying ocd-division/country:us/district:dc, this would also return all DC's wards and ANCs.", + // "location": "query", + // "type": "boolean" + // }, + // "roles": { + // "description": "A list of office roles to filter by. Only offices fulfilling one of these roles will be returned. Divisions that don't contain a matching office will not be returned.", + // "enum": [ + // "deputyHeadOfGovernment", + // "executiveCouncil", + // "governmentOfficer", + // "headOfGovernment", + // "headOfState", + // "highestCourtJudge", + // "judge", + // "legislatorLowerBody", + // "legislatorUpperBody", + // "schoolBoard", + // "specialPurposeOfficer" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "representatives/{ocdId}", + // "response": { + // "$ref": "RepresentativeInfoData" + // } + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/classroom/v1/classroom-api.json b/Godeps/_workspace/src/google.golang.org/api/classroom/v1/classroom-api.json new file mode 100644 index 000000000..58c117f08 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/classroom/v1/classroom-api.json @@ -0,0 +1,1109 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/VbFh0P5gIX42P6rhPLVK-GI_3-Y\"", + "discoveryVersion": "v1", + "id": "classroom:v1", + "name": "classroom", + "version": "v1", + "revision": "20151013", + "title": "Google Classroom API", + "description": "Google Classroom 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/classroom/", + "protocol": "rest", + "baseUrl": "https://classroom.googleapis.com/", + "basePath": "/", + "rootUrl": "https://classroom.googleapis.com/", + "servicePath": "", + "batchPath": "batch", + "parameters": { + "access_token": { + "type": "string", + "description": "OAuth access token.", + "location": "query" + }, + "alt": { + "type": "string", + "description": "Data format for response.", + "default": "json", + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query" + }, + "bearer_token": { + "type": "string", + "description": "OAuth bearer token.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JSONP", + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "pp": { + "type": "boolean", + "description": "Pretty-print response.", + "default": "true", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query" + }, + "upload_protocol": { + "type": "string", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query" + }, + "uploadType": { + "type": "string", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query" + }, + "$.xgafv": { + "type": "string", + "description": "V1 error format.", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/classroom.courses": { + "description": "Manage your Google Classroom classes" + }, + "https://www.googleapis.com/auth/classroom.courses.readonly": { + "description": "View your Google Classroom classes" + }, + "https://www.googleapis.com/auth/classroom.profile.emails": { + "description": "View the email addresses of people in your classes" + }, + "https://www.googleapis.com/auth/classroom.profile.photos": { + "description": "View the profile photos of people in your classes" + }, + "https://www.googleapis.com/auth/classroom.rosters": { + "description": "Manage your Google Classroom class rosters" + }, + "https://www.googleapis.com/auth/classroom.rosters.readonly": { + "description": "View your Google Classroom class rosters" + } + } + } + }, + "schemas": { + "Course": { + "id": "Course", + "type": "object", + "description": "A Course in Classroom.", + "properties": { + "id": { + "type": "string", + "description": "Identifier for this course assigned by Classroom. When creating a course, you may optionally set this identifier to an alias string in the request to create a corresponding alias. The `id` is still assigned by Classroom and cannot be updated after the course is created. Specifying this field in a course update mask will result in an error." + }, + "name": { + "type": "string", + "description": "Name of the course. For example, \"10th Grade Biology\". The name is required. It must be between 1 and 750 characters and a valid UTF-8 string." + }, + "section": { + "type": "string", + "description": "Section of the course. For example, \"Period 2\". If set, this field must be a valid UTF-8 string and no longer than 2800 characters." + }, + "descriptionHeading": { + "type": "string", + "description": "Optional heading for the description. For example, \"Welcome to 10th Grade Biology.\" If set, this field must be a valid UTF-8 string and no longer than 3600 characters." + }, + "description": { + "type": "string", + "description": "Optional description. For example, \"We'll be learning about the structure of living creatures from a combination of textbooks, guest lectures, and lab work. Expect to be excited!\" If set, this field must be a valid UTF-8 string and no longer than 30,000 characters." + }, + "room": { + "type": "string", + "description": "Optional room location. For example, \"301\". If set, this field must be a valid UTF-8 string and no longer than 650 characters." + }, + "ownerId": { + "type": "string", + "description": "The identifier of the owner of a course. When specified as a parameter of a create course request, this field is required. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user This must be set in a create request. Specifying this field in a course update mask will result in an `INVALID_ARGUMENT` error." + }, + "creationTime": { + "type": "string", + "description": "Creation time of the course. Specifying this field in a course update mask will result in an error. Read-only." + }, + "updateTime": { + "type": "string", + "description": "Time of the most recent update to this course. Specifying this field in a course update mask will result in an error. Read-only." + }, + "enrollmentCode": { + "type": "string", + "description": "Enrollment code to use when joining this course. Specifying this field in a course update mask will result in an error. Read-only." + }, + "courseState": { + "type": "string", + "description": "State of the course. If unspecified, the default state is `PROVISIONED`.", + "enum": [ + "COURSE_STATE_UNSPECIFIED", + "ACTIVE", + "ARCHIVED", + "PROVISIONED", + "DECLINED" + ] + }, + "alternateLink": { + "type": "string", + "description": "Absolute link to this course in the Classroom web UI. Read-only." + } + } + }, + "Empty": { + "id": "Empty", + "type": "object", + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`." + }, + "ListCoursesResponse": { + "id": "ListCoursesResponse", + "type": "object", + "description": "Response when listing courses.", + "properties": { + "courses": { + "type": "array", + "description": "Courses that match the list request.", + "items": { + "$ref": "Course" + } + }, + "nextPageToken": { + "type": "string", + "description": "Token identifying the next page of results to return. If empty, no further results are available." + } + } + }, + "CourseAlias": { + "id": "CourseAlias", + "type": "object", + "description": "Alternative identifier for a course. An alias uniquely identifies a course. It must be unique within one of the following scopes: * domain: A domain-scoped alias is visible to all users within the alias creator's domain and can be created only by a domain admin. A domain-scoped alias is often used when a course has an identifier external to Classroom. * project: A project-scoped alias is visible to any request from an application using the Developer Console project ID that created the alias and can be created by any project. A project-scoped alias is often used when an application has alternative identifiers. A random value can also be used to avoid duplicate courses in the event of transmission failures, as retrying a request will return `ALREADY_EXISTS` if a previous one has succeeded.", + "properties": { + "alias": { + "type": "string", + "description": "Alias string. The format of the string indicates the desired alias scoping. * `d:` indicates a domain-scoped alias. Example: `d:math_101` * `p:` indicates a project-scoped alias. Example: `p:abc123` This field has a maximum length of 256 characters." + } + } + }, + "ListCourseAliasesResponse": { + "id": "ListCourseAliasesResponse", + "type": "object", + "description": "Response when listing course aliases.", + "properties": { + "aliases": { + "type": "array", + "description": "The course aliases.", + "items": { + "$ref": "CourseAlias" + } + }, + "nextPageToken": { + "type": "string", + "description": "Token identifying the next page of results to return. If empty, no further results are available." + } + } + }, + "Invitation": { + "id": "Invitation", + "type": "object", + "description": "An invitation to join a course.", + "properties": { + "id": { + "type": "string", + "description": "Identifier assigned by Classroom. Read-only." + }, + "userId": { + "type": "string", + "description": "Identifier of the invited user. When specified as a parameter of a request, this identifier can be set to one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user" + }, + "courseId": { + "type": "string", + "description": "Identifier of the course to invite the user to." + }, + "role": { + "type": "string", + "description": "Role to invite the user to have. Must not be `COURSE_ROLE_UNSPECIFIED`.", + "enum": [ + "COURSE_ROLE_UNSPECIFIED", + "STUDENT", + "TEACHER" + ] + } + } + }, + "ListInvitationsResponse": { + "id": "ListInvitationsResponse", + "type": "object", + "description": "Response when listing invitations.", + "properties": { + "invitations": { + "type": "array", + "description": "Invitations that match the list request.", + "items": { + "$ref": "Invitation" + } + }, + "nextPageToken": { + "type": "string", + "description": "Token identifying the next page of results to return. If empty, no further results are available." + } + } + }, + "UserProfile": { + "id": "UserProfile", + "type": "object", + "description": "Global information for a user.", + "properties": { + "id": { + "type": "string", + "description": "Identifier of the user. Read-only." + }, + "name": { + "$ref": "Name", + "description": "Name of the user. Read-only." + }, + "emailAddress": { + "type": "string", + "description": "Email address of the user. Read-only." + }, + "photoUrl": { + "type": "string", + "description": "URL of user's profile photo. Read-only." + }, + "permissions": { + "type": "array", + "description": "Global permissions of the user. Read-only.", + "items": { + "$ref": "GlobalPermission" + } + } + } + }, + "Name": { + "id": "Name", + "type": "object", + "description": "Details of the user's name.", + "properties": { + "givenName": { + "type": "string", + "description": "The user's first name. Read-only." + }, + "familyName": { + "type": "string", + "description": "The user's last name. Read-only." + }, + "fullName": { + "type": "string", + "description": "The user's full name formed by concatenating the first and last name values. Read-only." + } + } + }, + "GlobalPermission": { + "id": "GlobalPermission", + "type": "object", + "description": "Global user permission description.", + "properties": { + "permission": { + "type": "string", + "description": "Permission value.", + "enum": [ + "PERMISSION_UNSPECIFIED", + "CREATE_COURSE" + ] + } + } + }, + "Teacher": { + "id": "Teacher", + "type": "object", + "description": "Teacher of a course.", + "properties": { + "courseId": { + "type": "string", + "description": "Identifier of the course. Read-only." + }, + "userId": { + "type": "string", + "description": "Identifier of the user. When specified as a parameter of a request, this identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user" + }, + "profile": { + "$ref": "UserProfile", + "description": "Global user information for the teacher. Read-only." + } + } + }, + "ListTeachersResponse": { + "id": "ListTeachersResponse", + "type": "object", + "description": "Response when listing teachers.", + "properties": { + "teachers": { + "type": "array", + "description": "Teachers who match the list request.", + "items": { + "$ref": "Teacher" + } + }, + "nextPageToken": { + "type": "string", + "description": "Token identifying the next page of results to return. If empty, no further results are available." + } + } + }, + "Student": { + "id": "Student", + "type": "object", + "description": "Student in a course.", + "properties": { + "courseId": { + "type": "string", + "description": "Identifier of the course. Read-only." + }, + "userId": { + "type": "string", + "description": "Identifier of the user. When specified as a parameter of a request, this identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user" + }, + "profile": { + "$ref": "UserProfile", + "description": "Global user information for the student. Read-only." + } + } + }, + "ListStudentsResponse": { + "id": "ListStudentsResponse", + "type": "object", + "description": "Response when listing students.", + "properties": { + "students": { + "type": "array", + "description": "Students who match the list request.", + "items": { + "$ref": "Student" + } + }, + "nextPageToken": { + "type": "string", + "description": "Token identifying the next page of results to return. If empty, no further results are available." + } + } + } + }, + "resources": { + "courses": { + "methods": { + "create": { + "id": "classroom.courses.create", + "path": "v1/courses", + "httpMethod": "POST", + "description": "Creates a course. The user specified in `ownerId` is the owner of the created course and added as a teacher. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create courses or for access errors. * `NOT_FOUND` if the primary teacher is not a valid user. * `FAILED_PRECONDITION` if the course owner's account is disabled or for the following request errors: * UserGroupsMembershipLimitReached * `ALREADY_EXISTS` if an alias was specified in the `id` and already exists.", + "request": { + "$ref": "Course" + }, + "response": { + "$ref": "Course" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.courses" + ] + }, + "get": { + "id": "classroom.courses.get", + "path": "v1/courses/{id}", + "httpMethod": "GET", + "description": "Returns a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors. * `NOT_FOUND` if no course exists with the requested ID.", + "parameters": { + "id": { + "type": "string", + "description": "Identifier of the course to return. This identifier can be either the Classroom-assigned identifier or an alias.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "Course" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.courses", + "https://www.googleapis.com/auth/classroom.courses.readonly" + ] + }, + "update": { + "id": "classroom.courses.update", + "path": "v1/courses/{id}", + "httpMethod": "PUT", + "description": "Updates a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to modify the requested course or for access errors. * `NOT_FOUND` if no course exists with the requested ID. * `FAILED_PRECONDITION` for the following request errors: * CourseNotModifiable", + "parameters": { + "id": { + "type": "string", + "description": "Identifier of the course to update. This identifier can be either the Classroom-assigned identifier or an alias.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "Course" + }, + "response": { + "$ref": "Course" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.courses" + ] + }, + "patch": { + "id": "classroom.courses.patch", + "path": "v1/courses/{id}", + "httpMethod": "PATCH", + "description": "Updates one or more fields in a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to modify the requested course or for access errors. * `NOT_FOUND` if no course exists with the requested ID. * `INVALID_ARGUMENT` if invalid fields are specified in the update mask or if no update mask is supplied. * `FAILED_PRECONDITION` for the following request errors: * CourseNotModifiable", + "parameters": { + "id": { + "type": "string", + "description": "Identifier of the course to update. This identifier can be either the Classroom-assigned identifier or an alias.", + "required": true, + "location": "path" + }, + "updateMask": { + "type": "string", + "description": "Mask that identifies which fields on the course to update. This field is required to do an update. The update will fail if invalid fields are specified. The following fields are valid: * `name` * `section` * `descriptionHeading` * `description` * `room` * `courseState` When set in a query parameter, this field should be specified as `updateMask=,,...`", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "Course" + }, + "response": { + "$ref": "Course" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.courses" + ] + }, + "delete": { + "id": "classroom.courses.delete", + "path": "v1/courses/{id}", + "httpMethod": "DELETE", + "description": "Deletes a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete the requested course or for access errors. * `NOT_FOUND` if no course exists with the requested ID.", + "parameters": { + "id": { + "type": "string", + "description": "Identifier of the course to delete. This identifier can be either the Classroom-assigned identifier or an alias.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.courses" + ] + }, + "list": { + "id": "classroom.courses.list", + "path": "v1/courses", + "httpMethod": "GET", + "description": "Returns a list of courses that the requesting user is permitted to view, restricted to those that match the request. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the query argument is malformed. * `NOT_FOUND` if any users specified in the query arguments do not exist.", + "parameters": { + "studentId": { + "type": "string", + "description": "Restricts returned courses to those having a student with the specified identifier. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user", + "location": "query" + }, + "teacherId": { + "type": "string", + "description": "Restricts returned courses to those having a teacher with the specified identifier. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user", + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token.", + "location": "query" + } + }, + "response": { + "$ref": "ListCoursesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.courses", + "https://www.googleapis.com/auth/classroom.courses.readonly" + ] + } + }, + "resources": { + "aliases": { + "methods": { + "create": { + "id": "classroom.courses.aliases.create", + "path": "v1/courses/{courseId}/aliases", + "httpMethod": "POST", + "description": "Creates an alias for a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create the alias or for access errors. * `NOT_FOUND` if the course does not exist. * `ALREADY_EXISTS` if the alias already exists.", + "parameters": { + "courseId": { + "type": "string", + "description": "Identifier of the course to alias. This identifier can be either the Classroom-assigned identifier or an alias.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "courseId" + ], + "request": { + "$ref": "CourseAlias" + }, + "response": { + "$ref": "CourseAlias" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.courses" + ] + }, + "delete": { + "id": "classroom.courses.aliases.delete", + "path": "v1/courses/{courseId}/aliases/{alias}", + "httpMethod": "DELETE", + "description": "Deletes an alias of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to remove the alias or for access errors. * `NOT_FOUND` if the alias does not exist.", + "parameters": { + "courseId": { + "type": "string", + "description": "Identifier of the course whose alias should be deleted. This identifier can be either the Classroom-assigned identifier or an alias.", + "required": true, + "location": "path" + }, + "alias": { + "type": "string", + "description": "Alias to delete. This may not be the Classroom-assigned identifier.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "courseId", + "alias" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.courses" + ] + }, + "list": { + "id": "classroom.courses.aliases.list", + "path": "v1/courses/{courseId}/aliases", + "httpMethod": "GET", + "description": "Returns a list of aliases for a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the course or for access errors. * `NOT_FOUND` if the course does not exist.", + "parameters": { + "courseId": { + "type": "string", + "description": "The identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.", + "required": true, + "location": "path" + }, + "pageSize": { + "type": "integer", + "description": "Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token.", + "location": "query" + } + }, + "parameterOrder": [ + "courseId" + ], + "response": { + "$ref": "ListCourseAliasesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.courses", + "https://www.googleapis.com/auth/classroom.courses.readonly" + ] + } + } + }, + "teachers": { + "methods": { + "create": { + "id": "classroom.courses.teachers.create", + "path": "v1/courses/{courseId}/teachers", + "httpMethod": "POST", + "description": "Creates a teacher of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create teachers in this course or for access errors. * `NOT_FOUND` if the requested course ID does not exist. * `FAILED_PRECONDITION` if the requested user's account is disabled, for the following request errors: * CourseMemberLimitReached * CourseNotModifiable * CourseTeacherLimitReached * UserGroupsMembershipLimitReached * `ALREADY_EXISTS` if the user is already a teacher or student in the course.", + "parameters": { + "courseId": { + "type": "string", + "description": "Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "courseId" + ], + "request": { + "$ref": "Teacher" + }, + "response": { + "$ref": "Teacher" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.profile.emails", + "https://www.googleapis.com/auth/classroom.profile.photos", + "https://www.googleapis.com/auth/classroom.rosters" + ] + }, + "get": { + "id": "classroom.courses.teachers.get", + "path": "v1/courses/{courseId}/teachers/{userId}", + "httpMethod": "GET", + "description": "Returns a teacher of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view teachers of this course or for access errors. * `NOT_FOUND` if no teacher of this course has the requested ID or if the course does not exist.", + "parameters": { + "courseId": { + "type": "string", + "description": "Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "Identifier of the teacher to return. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "courseId", + "userId" + ], + "response": { + "$ref": "Teacher" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.profile.emails", + "https://www.googleapis.com/auth/classroom.profile.photos", + "https://www.googleapis.com/auth/classroom.rosters", + "https://www.googleapis.com/auth/classroom.rosters.readonly" + ] + }, + "delete": { + "id": "classroom.courses.teachers.delete", + "path": "v1/courses/{courseId}/teachers/{userId}", + "httpMethod": "DELETE", + "description": "Deletes a teacher of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete teachers of this course or for access errors. * `NOT_FOUND` if no teacher of this course has the requested ID or if the course does not exist. * `FAILED_PRECONDITION` if the requested ID belongs to the primary teacher of this course.", + "parameters": { + "courseId": { + "type": "string", + "description": "Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "Identifier of the teacher to delete. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "courseId", + "userId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.rosters" + ] + }, + "list": { + "id": "classroom.courses.teachers.list", + "path": "v1/courses/{courseId}/teachers", + "httpMethod": "GET", + "description": "Returns a list of teachers of this course that the requester is permitted to view. This method returns the following error codes: * `NOT_FOUND` if the course does not exist. * `PERMISSION_DENIED` for access errors.", + "parameters": { + "courseId": { + "type": "string", + "description": "Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.", + "required": true, + "location": "path" + }, + "pageSize": { + "type": "integer", + "description": "Maximum number of items to return. Zero means no maximum. The server may return fewer than the specified number of results.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token.", + "location": "query" + } + }, + "parameterOrder": [ + "courseId" + ], + "response": { + "$ref": "ListTeachersResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.profile.emails", + "https://www.googleapis.com/auth/classroom.profile.photos", + "https://www.googleapis.com/auth/classroom.rosters", + "https://www.googleapis.com/auth/classroom.rosters.readonly" + ] + } + } + }, + "students": { + "methods": { + "create": { + "id": "classroom.courses.students.create", + "path": "v1/courses/{courseId}/students", + "httpMethod": "POST", + "description": "Adds a user as a student of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create students in this course or for access errors. * `NOT_FOUND` if the requested course ID does not exist. * `FAILED_PRECONDITION` if the requested user's account is disabled, for the following request errors: * CourseMemberLimitReached * CourseNotModifiable * UserGroupsMembershipLimitReached * `ALREADY_EXISTS` if the user is already a student or teacher in the course.", + "parameters": { + "courseId": { + "type": "string", + "description": "Identifier of the course to create the student in. This identifier can be either the Classroom-assigned identifier or an alias.", + "required": true, + "location": "path" + }, + "enrollmentCode": { + "type": "string", + "description": "Enrollment code of the course to create the student in. This code is required if userId corresponds to the requesting user; it may be omitted if the requesting user has administrative permissions to create students for any user.", + "location": "query" + } + }, + "parameterOrder": [ + "courseId" + ], + "request": { + "$ref": "Student" + }, + "response": { + "$ref": "Student" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.profile.emails", + "https://www.googleapis.com/auth/classroom.profile.photos", + "https://www.googleapis.com/auth/classroom.rosters" + ] + }, + "get": { + "id": "classroom.courses.students.get", + "path": "v1/courses/{courseId}/students/{userId}", + "httpMethod": "GET", + "description": "Returns a student of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view students of this course or for access errors. * `NOT_FOUND` if no student of this course has the requested ID or if the course does not exist.", + "parameters": { + "courseId": { + "type": "string", + "description": "Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "Identifier of the student to return. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "courseId", + "userId" + ], + "response": { + "$ref": "Student" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.profile.emails", + "https://www.googleapis.com/auth/classroom.profile.photos", + "https://www.googleapis.com/auth/classroom.rosters", + "https://www.googleapis.com/auth/classroom.rosters.readonly" + ] + }, + "delete": { + "id": "classroom.courses.students.delete", + "path": "v1/courses/{courseId}/students/{userId}", + "httpMethod": "DELETE", + "description": "Deletes a student of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete students of this course or for access errors. * `NOT_FOUND` if no student of this course has the requested ID or if the course does not exist.", + "parameters": { + "courseId": { + "type": "string", + "description": "Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "Identifier of the student to delete. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "courseId", + "userId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.rosters" + ] + }, + "list": { + "id": "classroom.courses.students.list", + "path": "v1/courses/{courseId}/students", + "httpMethod": "GET", + "description": "Returns a list of students of this course that the requester is permitted to view. This method returns the following error codes: * `NOT_FOUND` if the course does not exist. * `PERMISSION_DENIED` for access errors.", + "parameters": { + "courseId": { + "type": "string", + "description": "Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.", + "required": true, + "location": "path" + }, + "pageSize": { + "type": "integer", + "description": "Maximum number of items to return. Zero means no maximum. The server may return fewer than the specified number of results.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token.", + "location": "query" + } + }, + "parameterOrder": [ + "courseId" + ], + "response": { + "$ref": "ListStudentsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.profile.emails", + "https://www.googleapis.com/auth/classroom.profile.photos", + "https://www.googleapis.com/auth/classroom.rosters", + "https://www.googleapis.com/auth/classroom.rosters.readonly" + ] + } + } + } + } + }, + "invitations": { + "methods": { + "create": { + "id": "classroom.invitations.create", + "path": "v1/invitations", + "httpMethod": "POST", + "description": "Creates an invitation. Only one invitation for a user and course may exist at a time. Delete and re-create an invitation to make changes. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create invitations for this course or for access errors. * `NOT_FOUND` if the course or the user does not exist. * `FAILED_PRECONDITION` if the requested user's account is disabled or if the user already has this role or a role with greater permissions. * `ALREADY_EXISTS` if an invitation for the specified user and course already exists.", + "request": { + "$ref": "Invitation" + }, + "response": { + "$ref": "Invitation" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.rosters" + ] + }, + "get": { + "id": "classroom.invitations.get", + "path": "v1/invitations/{id}", + "httpMethod": "GET", + "description": "Returns an invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view the requested invitation or for access errors. * `NOT_FOUND` if no invitation exists with the requested ID.", + "parameters": { + "id": { + "type": "string", + "description": "Identifier of the invitation to return.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "Invitation" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.rosters", + "https://www.googleapis.com/auth/classroom.rosters.readonly" + ] + }, + "delete": { + "id": "classroom.invitations.delete", + "path": "v1/invitations/{id}", + "httpMethod": "DELETE", + "description": "Deletes an invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete the requested invitation or for access errors. * `NOT_FOUND` if no invitation exists with the requested ID.", + "parameters": { + "id": { + "type": "string", + "description": "Identifier of the invitation to delete.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.rosters" + ] + }, + "list": { + "id": "classroom.invitations.list", + "path": "v1/invitations", + "httpMethod": "GET", + "description": "Returns a list of invitations that the requesting user is permitted to view, restricted to those that match the list request. *Note:* At least one of `user_id` or `course_id` must be supplied. Both fields can be supplied. This method returns the following error codes: * `PERMISSION_DENIED` for access errors.", + "parameters": { + "userId": { + "type": "string", + "description": "Restricts returned invitations to those for a specific user. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user", + "location": "query" + }, + "courseId": { + "type": "string", + "description": "Restricts returned invitations to those for a course with the specified identifier.", + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "Maximum number of items to return. Zero means no maximum. The server may return fewer than the specified number of results.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token.", + "location": "query" + } + }, + "response": { + "$ref": "ListInvitationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.rosters", + "https://www.googleapis.com/auth/classroom.rosters.readonly" + ] + }, + "accept": { + "id": "classroom.invitations.accept", + "path": "v1/invitations/{id}:accept", + "httpMethod": "POST", + "description": "Accepts an invitation, removing it and adding the invited user to the teachers or students (as appropriate) of the specified course. Only the invited user may accept an invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to accept the requested invitation or for access errors. * `FAILED_PRECONDITION` for the following request errors: * CourseMemberLimitReached * CourseNotModifiable * CourseTeacherLimitReached * UserGroupsMembershipLimitReached * `NOT_FOUND` if no invitation exists with the requested ID.", + "parameters": { + "id": { + "type": "string", + "description": "Identifier of the invitation to accept.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.rosters" + ] + } + } + }, + "userProfiles": { + "methods": { + "get": { + "id": "classroom.userProfiles.get", + "path": "v1/userProfiles/{userId}", + "httpMethod": "GET", + "description": "Returns a user profile. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access this user profile or if no profile exists with the requested ID or for access errors.", + "parameters": { + "userId": { + "type": "string", + "description": "Identifier of the profile to return. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "UserProfile" + }, + "scopes": [ + "https://www.googleapis.com/auth/classroom.profile.emails", + "https://www.googleapis.com/auth/classroom.profile.photos", + "https://www.googleapis.com/auth/classroom.rosters", + "https://www.googleapis.com/auth/classroom.rosters.readonly" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/classroom/v1/classroom-gen.go b/Godeps/_workspace/src/google.golang.org/api/classroom/v1/classroom-gen.go new file mode 100644 index 000000000..6e809d31b --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/classroom/v1/classroom-gen.go @@ -0,0 +1,3849 @@ +// Package classroom provides access to the Google Classroom API. +// +// See https://developers.google.com/classroom/ +// +// Usage example: +// +// import "google.golang.org/api/classroom/v1" +// ... +// classroomService, err := classroom.New(oauthHttpClient) +package classroom // import "google.golang.org/api/classroom/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "classroom:v1" +const apiName = "classroom" +const apiVersion = "v1" +const basePath = "https://classroom.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // Manage your Google Classroom classes + ClassroomCoursesScope = "https://www.googleapis.com/auth/classroom.courses" + + // View your Google Classroom classes + ClassroomCoursesReadonlyScope = "https://www.googleapis.com/auth/classroom.courses.readonly" + + // View the email addresses of people in your classes + ClassroomProfileEmailsScope = "https://www.googleapis.com/auth/classroom.profile.emails" + + // View the profile photos of people in your classes + ClassroomProfilePhotosScope = "https://www.googleapis.com/auth/classroom.profile.photos" + + // Manage your Google Classroom class rosters + ClassroomRostersScope = "https://www.googleapis.com/auth/classroom.rosters" + + // View your Google Classroom class rosters + ClassroomRostersReadonlyScope = "https://www.googleapis.com/auth/classroom.rosters.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.Courses = NewCoursesService(s) + s.Invitations = NewInvitationsService(s) + s.UserProfiles = NewUserProfilesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Courses *CoursesService + + Invitations *InvitationsService + + UserProfiles *UserProfilesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewCoursesService(s *Service) *CoursesService { + rs := &CoursesService{s: s} + rs.Aliases = NewCoursesAliasesService(s) + rs.Students = NewCoursesStudentsService(s) + rs.Teachers = NewCoursesTeachersService(s) + return rs +} + +type CoursesService struct { + s *Service + + Aliases *CoursesAliasesService + + Students *CoursesStudentsService + + Teachers *CoursesTeachersService +} + +func NewCoursesAliasesService(s *Service) *CoursesAliasesService { + rs := &CoursesAliasesService{s: s} + return rs +} + +type CoursesAliasesService struct { + s *Service +} + +func NewCoursesStudentsService(s *Service) *CoursesStudentsService { + rs := &CoursesStudentsService{s: s} + return rs +} + +type CoursesStudentsService struct { + s *Service +} + +func NewCoursesTeachersService(s *Service) *CoursesTeachersService { + rs := &CoursesTeachersService{s: s} + return rs +} + +type CoursesTeachersService struct { + s *Service +} + +func NewInvitationsService(s *Service) *InvitationsService { + rs := &InvitationsService{s: s} + return rs +} + +type InvitationsService struct { + s *Service +} + +func NewUserProfilesService(s *Service) *UserProfilesService { + rs := &UserProfilesService{s: s} + return rs +} + +type UserProfilesService struct { + s *Service +} + +// Course: A Course in Classroom. +type Course struct { + // AlternateLink: Absolute link to this course in the Classroom web UI. + // Read-only. + AlternateLink string `json:"alternateLink,omitempty"` + + // CourseState: State of the course. If unspecified, the default state + // is `PROVISIONED`. + // + // Possible values: + // "COURSE_STATE_UNSPECIFIED" + // "ACTIVE" + // "ARCHIVED" + // "PROVISIONED" + // "DECLINED" + CourseState string `json:"courseState,omitempty"` + + // CreationTime: Creation time of the course. Specifying this field in a + // course update mask will result in an error. Read-only. + CreationTime string `json:"creationTime,omitempty"` + + // Description: Optional description. For example, "We'll be learning + // about the structure of living creatures from a combination of + // textbooks, guest lectures, and lab work. Expect to be excited!" If + // set, this field must be a valid UTF-8 string and no longer than + // 30,000 characters. + Description string `json:"description,omitempty"` + + // DescriptionHeading: Optional heading for the description. For + // example, "Welcome to 10th Grade Biology." If set, this field must be + // a valid UTF-8 string and no longer than 3600 characters. + DescriptionHeading string `json:"descriptionHeading,omitempty"` + + // EnrollmentCode: Enrollment code to use when joining this course. + // Specifying this field in a course update mask will result in an + // error. Read-only. + EnrollmentCode string `json:"enrollmentCode,omitempty"` + + // Id: Identifier for this course assigned by Classroom. When creating a + // course, you may optionally set this identifier to an alias string in + // the request to create a corresponding alias. The `id` is still + // assigned by Classroom and cannot be updated after the course is + // created. Specifying this field in a course update mask will result in + // an error. + Id string `json:"id,omitempty"` + + // Name: Name of the course. For example, "10th Grade Biology". The name + // is required. It must be between 1 and 750 characters and a valid + // UTF-8 string. + Name string `json:"name,omitempty"` + + // OwnerId: The identifier of the owner of a course. When specified as a + // parameter of a create course request, this field is required. The + // identifier can be one of the following: * the numeric identifier for + // the user * the email address of the user * the string literal "me", + // indicating the requesting user This must be set in a create request. + // Specifying this field in a course update mask will result in an + // `INVALID_ARGUMENT` error. + OwnerId string `json:"ownerId,omitempty"` + + // Room: Optional room location. For example, "301". If set, this field + // must be a valid UTF-8 string and no longer than 650 characters. + Room string `json:"room,omitempty"` + + // Section: Section of the course. For example, "Period 2". If set, this + // field must be a valid UTF-8 string and no longer than 2800 + // characters. + Section string `json:"section,omitempty"` + + // UpdateTime: Time of the most recent update to this course. Specifying + // this field in a course update mask will result in an error. + // Read-only. + UpdateTime string `json:"updateTime,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AlternateLink") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Course) MarshalJSON() ([]byte, error) { + type noMethod Course + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CourseAlias: Alternative identifier for a course. An alias uniquely +// identifies a course. It must be unique within one of the following +// scopes: * domain: A domain-scoped alias is visible to all users +// within the alias creator's domain and can be created only by a domain +// admin. A domain-scoped alias is often used when a course has an +// identifier external to Classroom. * project: A project-scoped alias +// is visible to any request from an application using the Developer +// Console project ID that created the alias and can be created by any +// project. A project-scoped alias is often used when an application has +// alternative identifiers. A random value can also be used to avoid +// duplicate courses in the event of transmission failures, as retrying +// a request will return `ALREADY_EXISTS` if a previous one has +// succeeded. +type CourseAlias struct { + // Alias: Alias string. The format of the string indicates the desired + // alias scoping. * `d:` indicates a domain-scoped alias. Example: + // `d:math_101` * `p:` indicates a project-scoped alias. Example: + // `p:abc123` This field has a maximum length of 256 characters. + Alias string `json:"alias,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Alias") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CourseAlias) MarshalJSON() ([]byte, error) { + type noMethod CourseAlias + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Empty: A generic empty message that you can re-use to avoid defining +// duplicated empty messages in your APIs. A typical example is to use +// it as the request or the response type of an API method. For +// instance: service Foo { rpc Bar(google.protobuf.Empty) returns +// (google.protobuf.Empty); } The JSON representation for `Empty` is +// empty JSON object `{}`. +type Empty struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// GlobalPermission: Global user permission description. +type GlobalPermission struct { + // Permission: Permission value. + // + // Possible values: + // "PERMISSION_UNSPECIFIED" + // "CREATE_COURSE" + Permission string `json:"permission,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Permission") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GlobalPermission) MarshalJSON() ([]byte, error) { + type noMethod GlobalPermission + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Invitation: An invitation to join a course. +type Invitation struct { + // CourseId: Identifier of the course to invite the user to. + CourseId string `json:"courseId,omitempty"` + + // Id: Identifier assigned by Classroom. Read-only. + Id string `json:"id,omitempty"` + + // Role: Role to invite the user to have. Must not be + // `COURSE_ROLE_UNSPECIFIED`. + // + // Possible values: + // "COURSE_ROLE_UNSPECIFIED" + // "STUDENT" + // "TEACHER" + Role string `json:"role,omitempty"` + + // UserId: Identifier of the invited user. When specified as a parameter + // of a request, this identifier can be set to one of the following: * + // the numeric identifier for the user * the email address of the user * + // the string literal "me", indicating the requesting user + UserId string `json:"userId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CourseId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Invitation) MarshalJSON() ([]byte, error) { + type noMethod Invitation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListCourseAliasesResponse: Response when listing course aliases. +type ListCourseAliasesResponse struct { + // Aliases: The course aliases. + Aliases []*CourseAlias `json:"aliases,omitempty"` + + // NextPageToken: Token identifying the next page of results to return. + // If empty, no further results are available. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Aliases") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListCourseAliasesResponse) MarshalJSON() ([]byte, error) { + type noMethod ListCourseAliasesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListCoursesResponse: Response when listing courses. +type ListCoursesResponse struct { + // Courses: Courses that match the list request. + Courses []*Course `json:"courses,omitempty"` + + // NextPageToken: Token identifying the next page of results to return. + // If empty, no further results are available. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Courses") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListCoursesResponse) MarshalJSON() ([]byte, error) { + type noMethod ListCoursesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListInvitationsResponse: Response when listing invitations. +type ListInvitationsResponse struct { + // Invitations: Invitations that match the list request. + Invitations []*Invitation `json:"invitations,omitempty"` + + // NextPageToken: Token identifying the next page of results to return. + // If empty, no further results are available. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Invitations") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListInvitationsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListInvitationsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListStudentsResponse: Response when listing students. +type ListStudentsResponse struct { + // NextPageToken: Token identifying the next page of results to return. + // If empty, no further results are available. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Students: Students who match the list request. + Students []*Student `json:"students,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListStudentsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListStudentsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListTeachersResponse: Response when listing teachers. +type ListTeachersResponse struct { + // NextPageToken: Token identifying the next page of results to return. + // If empty, no further results are available. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Teachers: Teachers who match the list request. + Teachers []*Teacher `json:"teachers,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListTeachersResponse) MarshalJSON() ([]byte, error) { + type noMethod ListTeachersResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Name: Details of the user's name. +type Name struct { + // FamilyName: The user's last name. Read-only. + FamilyName string `json:"familyName,omitempty"` + + // FullName: The user's full name formed by concatenating the first and + // last name values. Read-only. + FullName string `json:"fullName,omitempty"` + + // GivenName: The user's first name. Read-only. + GivenName string `json:"givenName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FamilyName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Name) MarshalJSON() ([]byte, error) { + type noMethod Name + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Student: Student in a course. +type Student struct { + // CourseId: Identifier of the course. Read-only. + CourseId string `json:"courseId,omitempty"` + + // Profile: Global user information for the student. Read-only. + Profile *UserProfile `json:"profile,omitempty"` + + // UserId: Identifier of the user. When specified as a parameter of a + // request, this identifier can be one of the following: * the numeric + // identifier for the user * the email address of the user * the string + // literal "me", indicating the requesting user + UserId string `json:"userId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CourseId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Student) MarshalJSON() ([]byte, error) { + type noMethod Student + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Teacher: Teacher of a course. +type Teacher struct { + // CourseId: Identifier of the course. Read-only. + CourseId string `json:"courseId,omitempty"` + + // Profile: Global user information for the teacher. Read-only. + Profile *UserProfile `json:"profile,omitempty"` + + // UserId: Identifier of the user. When specified as a parameter of a + // request, this identifier can be one of the following: * the numeric + // identifier for the user * the email address of the user * the string + // literal "me", indicating the requesting user + UserId string `json:"userId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CourseId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Teacher) MarshalJSON() ([]byte, error) { + type noMethod Teacher + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserProfile: Global information for a user. +type UserProfile struct { + // EmailAddress: Email address of the user. Read-only. + EmailAddress string `json:"emailAddress,omitempty"` + + // Id: Identifier of the user. Read-only. + Id string `json:"id,omitempty"` + + // Name: Name of the user. Read-only. + Name *Name `json:"name,omitempty"` + + // Permissions: Global permissions of the user. Read-only. + Permissions []*GlobalPermission `json:"permissions,omitempty"` + + // PhotoUrl: URL of user's profile photo. Read-only. + PhotoUrl string `json:"photoUrl,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "EmailAddress") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserProfile) MarshalJSON() ([]byte, error) { + type noMethod UserProfile + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "classroom.courses.create": + +type CoursesCreateCall struct { + s *Service + course *Course + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a course. The user specified in `ownerId` is the +// owner of the created course and added as a teacher. This method +// returns the following error codes: * `PERMISSION_DENIED` if the +// requesting user is not permitted to create courses or for access +// errors. * `NOT_FOUND` if the primary teacher is not a valid user. * +// `FAILED_PRECONDITION` if the course owner's account is disabled or +// for the following request errors: * UserGroupsMembershipLimitReached +// * `ALREADY_EXISTS` if an alias was specified in the `id` and already +// exists. +func (r *CoursesService) Create(course *Course) *CoursesCreateCall { + c := &CoursesCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.course = course + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CoursesCreateCall) Fields(s ...googleapi.Field) *CoursesCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CoursesCreateCall) Context(ctx context.Context) *CoursesCreateCall { + c.ctx_ = ctx + return c +} + +func (c *CoursesCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.course) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "classroom.courses.create" call. +// Exactly one of *Course or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Course.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CoursesCreateCall) Do() (*Course, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Course{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a course. The user specified in `ownerId` is the owner of the created course and added as a teacher. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create courses or for access errors. * `NOT_FOUND` if the primary teacher is not a valid user. * `FAILED_PRECONDITION` if the course owner's account is disabled or for the following request errors: * UserGroupsMembershipLimitReached * `ALREADY_EXISTS` if an alias was specified in the `id` and already exists.", + // "httpMethod": "POST", + // "id": "classroom.courses.create", + // "path": "v1/courses", + // "request": { + // "$ref": "Course" + // }, + // "response": { + // "$ref": "Course" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/classroom.courses" + // ] + // } + +} + +// method id "classroom.courses.delete": + +type CoursesDeleteCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a course. This method returns the following error +// codes: * `PERMISSION_DENIED` if the requesting user is not permitted +// to delete the requested course or for access errors. * `NOT_FOUND` if +// no course exists with the requested ID. +func (r *CoursesService) Delete(id string) *CoursesDeleteCall { + c := &CoursesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CoursesDeleteCall) Fields(s ...googleapi.Field) *CoursesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CoursesDeleteCall) Context(ctx context.Context) *CoursesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *CoursesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "classroom.courses.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CoursesDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete the requested course or for access errors. * `NOT_FOUND` if no course exists with the requested ID.", + // "httpMethod": "DELETE", + // "id": "classroom.courses.delete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Identifier of the course to delete. This identifier can be either the Classroom-assigned identifier or an alias.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/courses/{id}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/classroom.courses" + // ] + // } + +} + +// method id "classroom.courses.get": + +type CoursesGetCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns a course. This method returns the following error codes: +// * `PERMISSION_DENIED` if the requesting user is not permitted to +// access the requested course or for access errors. * `NOT_FOUND` if no +// course exists with the requested ID. +func (r *CoursesService) Get(id string) *CoursesGetCall { + c := &CoursesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CoursesGetCall) Fields(s ...googleapi.Field) *CoursesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CoursesGetCall) IfNoneMatch(entityTag string) *CoursesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CoursesGetCall) Context(ctx context.Context) *CoursesGetCall { + c.ctx_ = ctx + return c +} + +func (c *CoursesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "classroom.courses.get" call. +// Exactly one of *Course or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Course.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CoursesGetCall) Do() (*Course, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Course{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors. * `NOT_FOUND` if no course exists with the requested ID.", + // "httpMethod": "GET", + // "id": "classroom.courses.get", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Identifier of the course to return. This identifier can be either the Classroom-assigned identifier or an alias.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/courses/{id}", + // "response": { + // "$ref": "Course" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/classroom.courses", + // "https://www.googleapis.com/auth/classroom.courses.readonly" + // ] + // } + +} + +// method id "classroom.courses.list": + +type CoursesListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Returns a list of courses that the requesting user is permitted +// to view, restricted to those that match the request. This method +// returns the following error codes: * `PERMISSION_DENIED` for access +// errors. * `INVALID_ARGUMENT` if the query argument is malformed. * +// `NOT_FOUND` if any users specified in the query arguments do not +// exist. +func (r *CoursesService) List() *CoursesListCall { + c := &CoursesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// items to return. Zero or unspecified indicates that the server may +// assign a maximum. The server may return fewer than the specified +// number of results. +func (c *CoursesListCall) PageSize(pageSize int64) *CoursesListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": nextPageToken +// value returned from a previous list call, indicating that the +// subsequent page of results should be returned. The list request must +// be otherwise identical to the one that resulted in this token. +func (c *CoursesListCall) PageToken(pageToken string) *CoursesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StudentId sets the optional parameter "studentId": Restricts returned +// courses to those having a student with the specified identifier. The +// identifier can be one of the following: * the numeric identifier for +// the user * the email address of the user * the string literal "me", +// indicating the requesting user +func (c *CoursesListCall) StudentId(studentId string) *CoursesListCall { + c.opt_["studentId"] = studentId + return c +} + +// TeacherId sets the optional parameter "teacherId": Restricts returned +// courses to those having a teacher with the specified identifier. The +// identifier can be one of the following: * the numeric identifier for +// the user * the email address of the user * the string literal "me", +// indicating the requesting user +func (c *CoursesListCall) TeacherId(teacherId string) *CoursesListCall { + c.opt_["teacherId"] = teacherId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CoursesListCall) Fields(s ...googleapi.Field) *CoursesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CoursesListCall) IfNoneMatch(entityTag string) *CoursesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CoursesListCall) Context(ctx context.Context) *CoursesListCall { + c.ctx_ = ctx + return c +} + +func (c *CoursesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["studentId"]; ok { + params.Set("studentId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["teacherId"]; ok { + params.Set("teacherId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "classroom.courses.list" call. +// Exactly one of *ListCoursesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListCoursesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CoursesListCall) Do() (*ListCoursesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListCoursesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a list of courses that the requesting user is permitted to view, restricted to those that match the request. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the query argument is malformed. * `NOT_FOUND` if any users specified in the query arguments do not exist.", + // "httpMethod": "GET", + // "id": "classroom.courses.list", + // "parameters": { + // "pageSize": { + // "description": "Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token.", + // "location": "query", + // "type": "string" + // }, + // "studentId": { + // "description": "Restricts returned courses to those having a student with the specified identifier. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user", + // "location": "query", + // "type": "string" + // }, + // "teacherId": { + // "description": "Restricts returned courses to those having a teacher with the specified identifier. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/courses", + // "response": { + // "$ref": "ListCoursesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/classroom.courses", + // "https://www.googleapis.com/auth/classroom.courses.readonly" + // ] + // } + +} + +// method id "classroom.courses.patch": + +type CoursesPatchCall struct { + s *Service + id string + course *Course + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates one or more fields in a course. This method returns +// the following error codes: * `PERMISSION_DENIED` if the requesting +// user is not permitted to modify the requested course or for access +// errors. * `NOT_FOUND` if no course exists with the requested ID. * +// `INVALID_ARGUMENT` if invalid fields are specified in the update mask +// or if no update mask is supplied. * `FAILED_PRECONDITION` for the +// following request errors: * CourseNotModifiable +func (r *CoursesService) Patch(id string, course *Course) *CoursesPatchCall { + c := &CoursesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.course = course + return c +} + +// UpdateMask sets the optional parameter "updateMask": Mask that +// identifies which fields on the course to update. This field is +// required to do an update. The update will fail if invalid fields are +// specified. The following fields are valid: * `name` * `section` * +// `descriptionHeading` * `description` * `room` * `courseState` When +// set in a query parameter, this field should be specified as +// `updateMask=,,...` +func (c *CoursesPatchCall) UpdateMask(updateMask string) *CoursesPatchCall { + c.opt_["updateMask"] = updateMask + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CoursesPatchCall) Fields(s ...googleapi.Field) *CoursesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CoursesPatchCall) Context(ctx context.Context) *CoursesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CoursesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.course) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["updateMask"]; ok { + params.Set("updateMask", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "classroom.courses.patch" call. +// Exactly one of *Course or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Course.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CoursesPatchCall) Do() (*Course, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Course{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates one or more fields in a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to modify the requested course or for access errors. * `NOT_FOUND` if no course exists with the requested ID. * `INVALID_ARGUMENT` if invalid fields are specified in the update mask or if no update mask is supplied. * `FAILED_PRECONDITION` for the following request errors: * CourseNotModifiable", + // "httpMethod": "PATCH", + // "id": "classroom.courses.patch", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Identifier of the course to update. This identifier can be either the Classroom-assigned identifier or an alias.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "Mask that identifies which fields on the course to update. This field is required to do an update. The update will fail if invalid fields are specified. The following fields are valid: * `name` * `section` * `descriptionHeading` * `description` * `room` * `courseState` When set in a query parameter, this field should be specified as `updateMask=,,...`", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/courses/{id}", + // "request": { + // "$ref": "Course" + // }, + // "response": { + // "$ref": "Course" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/classroom.courses" + // ] + // } + +} + +// method id "classroom.courses.update": + +type CoursesUpdateCall struct { + s *Service + id string + course *Course + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a course. This method returns the following error +// codes: * `PERMISSION_DENIED` if the requesting user is not permitted +// to modify the requested course or for access errors. * `NOT_FOUND` if +// no course exists with the requested ID. * `FAILED_PRECONDITION` for +// the following request errors: * CourseNotModifiable +func (r *CoursesService) Update(id string, course *Course) *CoursesUpdateCall { + c := &CoursesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.course = course + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CoursesUpdateCall) Fields(s ...googleapi.Field) *CoursesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CoursesUpdateCall) Context(ctx context.Context) *CoursesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CoursesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.course) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "classroom.courses.update" call. +// Exactly one of *Course or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Course.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CoursesUpdateCall) Do() (*Course, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Course{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to modify the requested course or for access errors. * `NOT_FOUND` if no course exists with the requested ID. * `FAILED_PRECONDITION` for the following request errors: * CourseNotModifiable", + // "httpMethod": "PUT", + // "id": "classroom.courses.update", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Identifier of the course to update. This identifier can be either the Classroom-assigned identifier or an alias.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/courses/{id}", + // "request": { + // "$ref": "Course" + // }, + // "response": { + // "$ref": "Course" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/classroom.courses" + // ] + // } + +} + +// method id "classroom.courses.aliases.create": + +type CoursesAliasesCreateCall struct { + s *Service + courseId string + coursealias *CourseAlias + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates an alias for a course. This method returns the +// following error codes: * `PERMISSION_DENIED` if the requesting user +// is not permitted to create the alias or for access errors. * +// `NOT_FOUND` if the course does not exist. * `ALREADY_EXISTS` if the +// alias already exists. +func (r *CoursesAliasesService) Create(courseId string, coursealias *CourseAlias) *CoursesAliasesCreateCall { + c := &CoursesAliasesCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.courseId = courseId + c.coursealias = coursealias + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CoursesAliasesCreateCall) Fields(s ...googleapi.Field) *CoursesAliasesCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CoursesAliasesCreateCall) Context(ctx context.Context) *CoursesAliasesCreateCall { + c.ctx_ = ctx + return c +} + +func (c *CoursesAliasesCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.coursealias) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/aliases") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "classroom.courses.aliases.create" call. +// Exactly one of *CourseAlias or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CourseAlias.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CoursesAliasesCreateCall) Do() (*CourseAlias, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CourseAlias{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an alias for a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create the alias or for access errors. * `NOT_FOUND` if the course does not exist. * `ALREADY_EXISTS` if the alias already exists.", + // "httpMethod": "POST", + // "id": "classroom.courses.aliases.create", + // "parameterOrder": [ + // "courseId" + // ], + // "parameters": { + // "courseId": { + // "description": "Identifier of the course to alias. This identifier can be either the Classroom-assigned identifier or an alias.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/courses/{courseId}/aliases", + // "request": { + // "$ref": "CourseAlias" + // }, + // "response": { + // "$ref": "CourseAlias" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/classroom.courses" + // ] + // } + +} + +// method id "classroom.courses.aliases.delete": + +type CoursesAliasesDeleteCall struct { + s *Service + courseId string + aliasid string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an alias of a course. This method returns the +// following error codes: * `PERMISSION_DENIED` if the requesting user +// is not permitted to remove the alias or for access errors. * +// `NOT_FOUND` if the alias does not exist. +func (r *CoursesAliasesService) Delete(courseId string, aliasid string) *CoursesAliasesDeleteCall { + c := &CoursesAliasesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.courseId = courseId + c.aliasid = aliasid + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CoursesAliasesDeleteCall) Fields(s ...googleapi.Field) *CoursesAliasesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CoursesAliasesDeleteCall) Context(ctx context.Context) *CoursesAliasesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *CoursesAliasesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/aliases/{alias}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "alias": c.aliasid, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "classroom.courses.aliases.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CoursesAliasesDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes an alias of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to remove the alias or for access errors. * `NOT_FOUND` if the alias does not exist.", + // "httpMethod": "DELETE", + // "id": "classroom.courses.aliases.delete", + // "parameterOrder": [ + // "courseId", + // "alias" + // ], + // "parameters": { + // "alias": { + // "description": "Alias to delete. This may not be the Classroom-assigned identifier.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "courseId": { + // "description": "Identifier of the course whose alias should be deleted. This identifier can be either the Classroom-assigned identifier or an alias.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/courses/{courseId}/aliases/{alias}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/classroom.courses" + // ] + // } + +} + +// method id "classroom.courses.aliases.list": + +type CoursesAliasesListCall struct { + s *Service + courseId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Returns a list of aliases for a course. This method returns the +// following error codes: * `PERMISSION_DENIED` if the requesting user +// is not permitted to access the course or for access errors. * +// `NOT_FOUND` if the course does not exist. +func (r *CoursesAliasesService) List(courseId string) *CoursesAliasesListCall { + c := &CoursesAliasesListCall{s: r.s, opt_: make(map[string]interface{})} + c.courseId = courseId + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// items to return. Zero or unspecified indicates that the server may +// assign a maximum. The server may return fewer than the specified +// number of results. +func (c *CoursesAliasesListCall) PageSize(pageSize int64) *CoursesAliasesListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": nextPageToken +// value returned from a previous list call, indicating that the +// subsequent page of results should be returned. The list request must +// be otherwise identical to the one that resulted in this token. +func (c *CoursesAliasesListCall) PageToken(pageToken string) *CoursesAliasesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CoursesAliasesListCall) Fields(s ...googleapi.Field) *CoursesAliasesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CoursesAliasesListCall) IfNoneMatch(entityTag string) *CoursesAliasesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CoursesAliasesListCall) Context(ctx context.Context) *CoursesAliasesListCall { + c.ctx_ = ctx + return c +} + +func (c *CoursesAliasesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/aliases") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "classroom.courses.aliases.list" call. +// Exactly one of *ListCourseAliasesResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListCourseAliasesResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CoursesAliasesListCall) Do() (*ListCourseAliasesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListCourseAliasesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a list of aliases for a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the course or for access errors. * `NOT_FOUND` if the course does not exist.", + // "httpMethod": "GET", + // "id": "classroom.courses.aliases.list", + // "parameterOrder": [ + // "courseId" + // ], + // "parameters": { + // "courseId": { + // "description": "The identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageSize": { + // "description": "Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/courses/{courseId}/aliases", + // "response": { + // "$ref": "ListCourseAliasesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/classroom.courses", + // "https://www.googleapis.com/auth/classroom.courses.readonly" + // ] + // } + +} + +// method id "classroom.courses.students.create": + +type CoursesStudentsCreateCall struct { + s *Service + courseId string + student *Student + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Adds a user as a student of a course. This method returns the +// following error codes: * `PERMISSION_DENIED` if the requesting user +// is not permitted to create students in this course or for access +// errors. * `NOT_FOUND` if the requested course ID does not exist. * +// `FAILED_PRECONDITION` if the requested user's account is disabled, +// for the following request errors: * CourseMemberLimitReached * +// CourseNotModifiable * UserGroupsMembershipLimitReached * +// `ALREADY_EXISTS` if the user is already a student or teacher in the +// course. +func (r *CoursesStudentsService) Create(courseId string, student *Student) *CoursesStudentsCreateCall { + c := &CoursesStudentsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.courseId = courseId + c.student = student + return c +} + +// EnrollmentCode sets the optional parameter "enrollmentCode": +// Enrollment code of the course to create the student in. This code is +// required if userId corresponds to the requesting user; it may be +// omitted if the requesting user has administrative permissions to +// create students for any user. +func (c *CoursesStudentsCreateCall) EnrollmentCode(enrollmentCode string) *CoursesStudentsCreateCall { + c.opt_["enrollmentCode"] = enrollmentCode + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CoursesStudentsCreateCall) Fields(s ...googleapi.Field) *CoursesStudentsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CoursesStudentsCreateCall) Context(ctx context.Context) *CoursesStudentsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *CoursesStudentsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.student) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["enrollmentCode"]; ok { + params.Set("enrollmentCode", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/students") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "classroom.courses.students.create" call. +// Exactly one of *Student or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Student.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CoursesStudentsCreateCall) Do() (*Student, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Student{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds a user as a student of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create students in this course or for access errors. * `NOT_FOUND` if the requested course ID does not exist. * `FAILED_PRECONDITION` if the requested user's account is disabled, for the following request errors: * CourseMemberLimitReached * CourseNotModifiable * UserGroupsMembershipLimitReached * `ALREADY_EXISTS` if the user is already a student or teacher in the course.", + // "httpMethod": "POST", + // "id": "classroom.courses.students.create", + // "parameterOrder": [ + // "courseId" + // ], + // "parameters": { + // "courseId": { + // "description": "Identifier of the course to create the student in. This identifier can be either the Classroom-assigned identifier or an alias.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "enrollmentCode": { + // "description": "Enrollment code of the course to create the student in. This code is required if userId corresponds to the requesting user; it may be omitted if the requesting user has administrative permissions to create students for any user.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/courses/{courseId}/students", + // "request": { + // "$ref": "Student" + // }, + // "response": { + // "$ref": "Student" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/classroom.profile.emails", + // "https://www.googleapis.com/auth/classroom.profile.photos", + // "https://www.googleapis.com/auth/classroom.rosters" + // ] + // } + +} + +// method id "classroom.courses.students.delete": + +type CoursesStudentsDeleteCall struct { + s *Service + courseId string + userId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a student of a course. This method returns the +// following error codes: * `PERMISSION_DENIED` if the requesting user +// is not permitted to delete students of this course or for access +// errors. * `NOT_FOUND` if no student of this course has the requested +// ID or if the course does not exist. +func (r *CoursesStudentsService) Delete(courseId string, userId string) *CoursesStudentsDeleteCall { + c := &CoursesStudentsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.courseId = courseId + c.userId = userId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CoursesStudentsDeleteCall) Fields(s ...googleapi.Field) *CoursesStudentsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CoursesStudentsDeleteCall) Context(ctx context.Context) *CoursesStudentsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *CoursesStudentsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/students/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "classroom.courses.students.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CoursesStudentsDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a student of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete students of this course or for access errors. * `NOT_FOUND` if no student of this course has the requested ID or if the course does not exist.", + // "httpMethod": "DELETE", + // "id": "classroom.courses.students.delete", + // "parameterOrder": [ + // "courseId", + // "userId" + // ], + // "parameters": { + // "courseId": { + // "description": "Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "Identifier of the student to delete. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/courses/{courseId}/students/{userId}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/classroom.rosters" + // ] + // } + +} + +// method id "classroom.courses.students.get": + +type CoursesStudentsGetCall struct { + s *Service + courseId string + userId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns a student of a course. This method returns the following +// error codes: * `PERMISSION_DENIED` if the requesting user is not +// permitted to view students of this course or for access errors. * +// `NOT_FOUND` if no student of this course has the requested ID or if +// the course does not exist. +func (r *CoursesStudentsService) Get(courseId string, userId string) *CoursesStudentsGetCall { + c := &CoursesStudentsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.courseId = courseId + c.userId = userId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CoursesStudentsGetCall) Fields(s ...googleapi.Field) *CoursesStudentsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CoursesStudentsGetCall) IfNoneMatch(entityTag string) *CoursesStudentsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CoursesStudentsGetCall) Context(ctx context.Context) *CoursesStudentsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CoursesStudentsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/students/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "classroom.courses.students.get" call. +// Exactly one of *Student or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Student.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CoursesStudentsGetCall) Do() (*Student, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Student{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a student of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view students of this course or for access errors. * `NOT_FOUND` if no student of this course has the requested ID or if the course does not exist.", + // "httpMethod": "GET", + // "id": "classroom.courses.students.get", + // "parameterOrder": [ + // "courseId", + // "userId" + // ], + // "parameters": { + // "courseId": { + // "description": "Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "Identifier of the student to return. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/courses/{courseId}/students/{userId}", + // "response": { + // "$ref": "Student" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/classroom.profile.emails", + // "https://www.googleapis.com/auth/classroom.profile.photos", + // "https://www.googleapis.com/auth/classroom.rosters", + // "https://www.googleapis.com/auth/classroom.rosters.readonly" + // ] + // } + +} + +// method id "classroom.courses.students.list": + +type CoursesStudentsListCall struct { + s *Service + courseId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Returns a list of students of this course that the requester is +// permitted to view. This method returns the following error codes: * +// `NOT_FOUND` if the course does not exist. * `PERMISSION_DENIED` for +// access errors. +func (r *CoursesStudentsService) List(courseId string) *CoursesStudentsListCall { + c := &CoursesStudentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.courseId = courseId + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// items to return. Zero means no maximum. The server may return fewer +// than the specified number of results. +func (c *CoursesStudentsListCall) PageSize(pageSize int64) *CoursesStudentsListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": nextPageToken +// value returned from a previous list call, indicating that the +// subsequent page of results should be returned. The list request must +// be otherwise identical to the one that resulted in this token. +func (c *CoursesStudentsListCall) PageToken(pageToken string) *CoursesStudentsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CoursesStudentsListCall) Fields(s ...googleapi.Field) *CoursesStudentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CoursesStudentsListCall) IfNoneMatch(entityTag string) *CoursesStudentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CoursesStudentsListCall) Context(ctx context.Context) *CoursesStudentsListCall { + c.ctx_ = ctx + return c +} + +func (c *CoursesStudentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/students") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "classroom.courses.students.list" call. +// Exactly one of *ListStudentsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListStudentsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CoursesStudentsListCall) Do() (*ListStudentsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListStudentsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a list of students of this course that the requester is permitted to view. This method returns the following error codes: * `NOT_FOUND` if the course does not exist. * `PERMISSION_DENIED` for access errors.", + // "httpMethod": "GET", + // "id": "classroom.courses.students.list", + // "parameterOrder": [ + // "courseId" + // ], + // "parameters": { + // "courseId": { + // "description": "Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageSize": { + // "description": "Maximum number of items to return. Zero means no maximum. The server may return fewer than the specified number of results.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/courses/{courseId}/students", + // "response": { + // "$ref": "ListStudentsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/classroom.profile.emails", + // "https://www.googleapis.com/auth/classroom.profile.photos", + // "https://www.googleapis.com/auth/classroom.rosters", + // "https://www.googleapis.com/auth/classroom.rosters.readonly" + // ] + // } + +} + +// method id "classroom.courses.teachers.create": + +type CoursesTeachersCreateCall struct { + s *Service + courseId string + teacher *Teacher + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a teacher of a course. This method returns the +// following error codes: * `PERMISSION_DENIED` if the requesting user +// is not permitted to create teachers in this course or for access +// errors. * `NOT_FOUND` if the requested course ID does not exist. * +// `FAILED_PRECONDITION` if the requested user's account is disabled, +// for the following request errors: * CourseMemberLimitReached * +// CourseNotModifiable * CourseTeacherLimitReached * +// UserGroupsMembershipLimitReached * `ALREADY_EXISTS` if the user is +// already a teacher or student in the course. +func (r *CoursesTeachersService) Create(courseId string, teacher *Teacher) *CoursesTeachersCreateCall { + c := &CoursesTeachersCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.courseId = courseId + c.teacher = teacher + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CoursesTeachersCreateCall) Fields(s ...googleapi.Field) *CoursesTeachersCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CoursesTeachersCreateCall) Context(ctx context.Context) *CoursesTeachersCreateCall { + c.ctx_ = ctx + return c +} + +func (c *CoursesTeachersCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.teacher) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/teachers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "classroom.courses.teachers.create" call. +// Exactly one of *Teacher or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Teacher.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CoursesTeachersCreateCall) Do() (*Teacher, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Teacher{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a teacher of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create teachers in this course or for access errors. * `NOT_FOUND` if the requested course ID does not exist. * `FAILED_PRECONDITION` if the requested user's account is disabled, for the following request errors: * CourseMemberLimitReached * CourseNotModifiable * CourseTeacherLimitReached * UserGroupsMembershipLimitReached * `ALREADY_EXISTS` if the user is already a teacher or student in the course.", + // "httpMethod": "POST", + // "id": "classroom.courses.teachers.create", + // "parameterOrder": [ + // "courseId" + // ], + // "parameters": { + // "courseId": { + // "description": "Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/courses/{courseId}/teachers", + // "request": { + // "$ref": "Teacher" + // }, + // "response": { + // "$ref": "Teacher" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/classroom.profile.emails", + // "https://www.googleapis.com/auth/classroom.profile.photos", + // "https://www.googleapis.com/auth/classroom.rosters" + // ] + // } + +} + +// method id "classroom.courses.teachers.delete": + +type CoursesTeachersDeleteCall struct { + s *Service + courseId string + userId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a teacher of a course. This method returns the +// following error codes: * `PERMISSION_DENIED` if the requesting user +// is not permitted to delete teachers of this course or for access +// errors. * `NOT_FOUND` if no teacher of this course has the requested +// ID or if the course does not exist. * `FAILED_PRECONDITION` if the +// requested ID belongs to the primary teacher of this course. +func (r *CoursesTeachersService) Delete(courseId string, userId string) *CoursesTeachersDeleteCall { + c := &CoursesTeachersDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.courseId = courseId + c.userId = userId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CoursesTeachersDeleteCall) Fields(s ...googleapi.Field) *CoursesTeachersDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CoursesTeachersDeleteCall) Context(ctx context.Context) *CoursesTeachersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *CoursesTeachersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/teachers/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "classroom.courses.teachers.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CoursesTeachersDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a teacher of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete teachers of this course or for access errors. * `NOT_FOUND` if no teacher of this course has the requested ID or if the course does not exist. * `FAILED_PRECONDITION` if the requested ID belongs to the primary teacher of this course.", + // "httpMethod": "DELETE", + // "id": "classroom.courses.teachers.delete", + // "parameterOrder": [ + // "courseId", + // "userId" + // ], + // "parameters": { + // "courseId": { + // "description": "Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "Identifier of the teacher to delete. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/courses/{courseId}/teachers/{userId}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/classroom.rosters" + // ] + // } + +} + +// method id "classroom.courses.teachers.get": + +type CoursesTeachersGetCall struct { + s *Service + courseId string + userId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns a teacher of a course. This method returns the following +// error codes: * `PERMISSION_DENIED` if the requesting user is not +// permitted to view teachers of this course or for access errors. * +// `NOT_FOUND` if no teacher of this course has the requested ID or if +// the course does not exist. +func (r *CoursesTeachersService) Get(courseId string, userId string) *CoursesTeachersGetCall { + c := &CoursesTeachersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.courseId = courseId + c.userId = userId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CoursesTeachersGetCall) Fields(s ...googleapi.Field) *CoursesTeachersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CoursesTeachersGetCall) IfNoneMatch(entityTag string) *CoursesTeachersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CoursesTeachersGetCall) Context(ctx context.Context) *CoursesTeachersGetCall { + c.ctx_ = ctx + return c +} + +func (c *CoursesTeachersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/teachers/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "classroom.courses.teachers.get" call. +// Exactly one of *Teacher or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Teacher.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CoursesTeachersGetCall) Do() (*Teacher, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Teacher{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a teacher of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view teachers of this course or for access errors. * `NOT_FOUND` if no teacher of this course has the requested ID or if the course does not exist.", + // "httpMethod": "GET", + // "id": "classroom.courses.teachers.get", + // "parameterOrder": [ + // "courseId", + // "userId" + // ], + // "parameters": { + // "courseId": { + // "description": "Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "Identifier of the teacher to return. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/courses/{courseId}/teachers/{userId}", + // "response": { + // "$ref": "Teacher" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/classroom.profile.emails", + // "https://www.googleapis.com/auth/classroom.profile.photos", + // "https://www.googleapis.com/auth/classroom.rosters", + // "https://www.googleapis.com/auth/classroom.rosters.readonly" + // ] + // } + +} + +// method id "classroom.courses.teachers.list": + +type CoursesTeachersListCall struct { + s *Service + courseId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Returns a list of teachers of this course that the requester is +// permitted to view. This method returns the following error codes: * +// `NOT_FOUND` if the course does not exist. * `PERMISSION_DENIED` for +// access errors. +func (r *CoursesTeachersService) List(courseId string) *CoursesTeachersListCall { + c := &CoursesTeachersListCall{s: r.s, opt_: make(map[string]interface{})} + c.courseId = courseId + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// items to return. Zero means no maximum. The server may return fewer +// than the specified number of results. +func (c *CoursesTeachersListCall) PageSize(pageSize int64) *CoursesTeachersListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": nextPageToken +// value returned from a previous list call, indicating that the +// subsequent page of results should be returned. The list request must +// be otherwise identical to the one that resulted in this token. +func (c *CoursesTeachersListCall) PageToken(pageToken string) *CoursesTeachersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CoursesTeachersListCall) Fields(s ...googleapi.Field) *CoursesTeachersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CoursesTeachersListCall) IfNoneMatch(entityTag string) *CoursesTeachersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CoursesTeachersListCall) Context(ctx context.Context) *CoursesTeachersListCall { + c.ctx_ = ctx + return c +} + +func (c *CoursesTeachersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/teachers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "courseId": c.courseId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "classroom.courses.teachers.list" call. +// Exactly one of *ListTeachersResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListTeachersResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CoursesTeachersListCall) Do() (*ListTeachersResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListTeachersResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a list of teachers of this course that the requester is permitted to view. This method returns the following error codes: * `NOT_FOUND` if the course does not exist. * `PERMISSION_DENIED` for access errors.", + // "httpMethod": "GET", + // "id": "classroom.courses.teachers.list", + // "parameterOrder": [ + // "courseId" + // ], + // "parameters": { + // "courseId": { + // "description": "Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageSize": { + // "description": "Maximum number of items to return. Zero means no maximum. The server may return fewer than the specified number of results.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/courses/{courseId}/teachers", + // "response": { + // "$ref": "ListTeachersResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/classroom.profile.emails", + // "https://www.googleapis.com/auth/classroom.profile.photos", + // "https://www.googleapis.com/auth/classroom.rosters", + // "https://www.googleapis.com/auth/classroom.rosters.readonly" + // ] + // } + +} + +// method id "classroom.invitations.accept": + +type InvitationsAcceptCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Accept: Accepts an invitation, removing it and adding the invited +// user to the teachers or students (as appropriate) of the specified +// course. Only the invited user may accept an invitation. This method +// returns the following error codes: * `PERMISSION_DENIED` if the +// requesting user is not permitted to accept the requested invitation +// or for access errors. * `FAILED_PRECONDITION` for the following +// request errors: * CourseMemberLimitReached * CourseNotModifiable * +// CourseTeacherLimitReached * UserGroupsMembershipLimitReached * +// `NOT_FOUND` if no invitation exists with the requested ID. +func (r *InvitationsService) Accept(id string) *InvitationsAcceptCall { + c := &InvitationsAcceptCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InvitationsAcceptCall) Fields(s ...googleapi.Field) *InvitationsAcceptCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InvitationsAcceptCall) Context(ctx context.Context) *InvitationsAcceptCall { + c.ctx_ = ctx + return c +} + +func (c *InvitationsAcceptCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/invitations/{id}:accept") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "classroom.invitations.accept" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *InvitationsAcceptCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Accepts an invitation, removing it and adding the invited user to the teachers or students (as appropriate) of the specified course. Only the invited user may accept an invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to accept the requested invitation or for access errors. * `FAILED_PRECONDITION` for the following request errors: * CourseMemberLimitReached * CourseNotModifiable * CourseTeacherLimitReached * UserGroupsMembershipLimitReached * `NOT_FOUND` if no invitation exists with the requested ID.", + // "httpMethod": "POST", + // "id": "classroom.invitations.accept", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Identifier of the invitation to accept.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/invitations/{id}:accept", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/classroom.rosters" + // ] + // } + +} + +// method id "classroom.invitations.create": + +type InvitationsCreateCall struct { + s *Service + invitation *Invitation + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates an invitation. Only one invitation for a user and +// course may exist at a time. Delete and re-create an invitation to +// make changes. This method returns the following error codes: * +// `PERMISSION_DENIED` if the requesting user is not permitted to create +// invitations for this course or for access errors. * `NOT_FOUND` if +// the course or the user does not exist. * `FAILED_PRECONDITION` if the +// requested user's account is disabled or if the user already has this +// role or a role with greater permissions. * `ALREADY_EXISTS` if an +// invitation for the specified user and course already exists. +func (r *InvitationsService) Create(invitation *Invitation) *InvitationsCreateCall { + c := &InvitationsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.invitation = invitation + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InvitationsCreateCall) Fields(s ...googleapi.Field) *InvitationsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InvitationsCreateCall) Context(ctx context.Context) *InvitationsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *InvitationsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.invitation) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/invitations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "classroom.invitations.create" call. +// Exactly one of *Invitation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Invitation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InvitationsCreateCall) Do() (*Invitation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Invitation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an invitation. Only one invitation for a user and course may exist at a time. Delete and re-create an invitation to make changes. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create invitations for this course or for access errors. * `NOT_FOUND` if the course or the user does not exist. * `FAILED_PRECONDITION` if the requested user's account is disabled or if the user already has this role or a role with greater permissions. * `ALREADY_EXISTS` if an invitation for the specified user and course already exists.", + // "httpMethod": "POST", + // "id": "classroom.invitations.create", + // "path": "v1/invitations", + // "request": { + // "$ref": "Invitation" + // }, + // "response": { + // "$ref": "Invitation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/classroom.rosters" + // ] + // } + +} + +// method id "classroom.invitations.delete": + +type InvitationsDeleteCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an invitation. This method returns the following +// error codes: * `PERMISSION_DENIED` if the requesting user is not +// permitted to delete the requested invitation or for access errors. * +// `NOT_FOUND` if no invitation exists with the requested ID. +func (r *InvitationsService) Delete(id string) *InvitationsDeleteCall { + c := &InvitationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InvitationsDeleteCall) Fields(s ...googleapi.Field) *InvitationsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InvitationsDeleteCall) Context(ctx context.Context) *InvitationsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *InvitationsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/invitations/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "classroom.invitations.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *InvitationsDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes an invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete the requested invitation or for access errors. * `NOT_FOUND` if no invitation exists with the requested ID.", + // "httpMethod": "DELETE", + // "id": "classroom.invitations.delete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Identifier of the invitation to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/invitations/{id}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/classroom.rosters" + // ] + // } + +} + +// method id "classroom.invitations.get": + +type InvitationsGetCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns an invitation. This method returns the following error +// codes: * `PERMISSION_DENIED` if the requesting user is not permitted +// to view the requested invitation or for access errors. * `NOT_FOUND` +// if no invitation exists with the requested ID. +func (r *InvitationsService) Get(id string) *InvitationsGetCall { + c := &InvitationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InvitationsGetCall) Fields(s ...googleapi.Field) *InvitationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InvitationsGetCall) IfNoneMatch(entityTag string) *InvitationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InvitationsGetCall) Context(ctx context.Context) *InvitationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *InvitationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/invitations/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "classroom.invitations.get" call. +// Exactly one of *Invitation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Invitation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InvitationsGetCall) Do() (*Invitation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Invitation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns an invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view the requested invitation or for access errors. * `NOT_FOUND` if no invitation exists with the requested ID.", + // "httpMethod": "GET", + // "id": "classroom.invitations.get", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Identifier of the invitation to return.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/invitations/{id}", + // "response": { + // "$ref": "Invitation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/classroom.rosters", + // "https://www.googleapis.com/auth/classroom.rosters.readonly" + // ] + // } + +} + +// method id "classroom.invitations.list": + +type InvitationsListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Returns a list of invitations that the requesting user is +// permitted to view, restricted to those that match the list request. +// *Note:* At least one of `user_id` or `course_id` must be supplied. +// Both fields can be supplied. This method returns the following error +// codes: * `PERMISSION_DENIED` for access errors. +func (r *InvitationsService) List() *InvitationsListCall { + c := &InvitationsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// CourseId sets the optional parameter "courseId": Restricts returned +// invitations to those for a course with the specified identifier. +func (c *InvitationsListCall) CourseId(courseId string) *InvitationsListCall { + c.opt_["courseId"] = courseId + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// items to return. Zero means no maximum. The server may return fewer +// than the specified number of results. +func (c *InvitationsListCall) PageSize(pageSize int64) *InvitationsListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": nextPageToken +// value returned from a previous list call, indicating that the +// subsequent page of results should be returned. The list request must +// be otherwise identical to the one that resulted in this token. +func (c *InvitationsListCall) PageToken(pageToken string) *InvitationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// UserId sets the optional parameter "userId": Restricts returned +// invitations to those for a specific user. The identifier can be one +// of the following: * the numeric identifier for the user * the email +// address of the user * the string literal "me", indicating the +// requesting user +func (c *InvitationsListCall) UserId(userId string) *InvitationsListCall { + c.opt_["userId"] = userId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InvitationsListCall) Fields(s ...googleapi.Field) *InvitationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InvitationsListCall) IfNoneMatch(entityTag string) *InvitationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InvitationsListCall) Context(ctx context.Context) *InvitationsListCall { + c.ctx_ = ctx + return c +} + +func (c *InvitationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["courseId"]; ok { + params.Set("courseId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["userId"]; ok { + params.Set("userId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/invitations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "classroom.invitations.list" call. +// Exactly one of *ListInvitationsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListInvitationsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InvitationsListCall) Do() (*ListInvitationsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListInvitationsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a list of invitations that the requesting user is permitted to view, restricted to those that match the list request. *Note:* At least one of `user_id` or `course_id` must be supplied. Both fields can be supplied. This method returns the following error codes: * `PERMISSION_DENIED` for access errors.", + // "httpMethod": "GET", + // "id": "classroom.invitations.list", + // "parameters": { + // "courseId": { + // "description": "Restricts returned invitations to those for a course with the specified identifier.", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "Maximum number of items to return. Zero means no maximum. The server may return fewer than the specified number of results.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token.", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "description": "Restricts returned invitations to those for a specific user. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/invitations", + // "response": { + // "$ref": "ListInvitationsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/classroom.rosters", + // "https://www.googleapis.com/auth/classroom.rosters.readonly" + // ] + // } + +} + +// method id "classroom.userProfiles.get": + +type UserProfilesGetCall struct { + s *Service + userId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns a user profile. This method returns the following error +// codes: * `PERMISSION_DENIED` if the requesting user is not permitted +// to access this user profile or if no profile exists with the +// requested ID or for access errors. +func (r *UserProfilesService) Get(userId string) *UserProfilesGetCall { + c := &UserProfilesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserProfilesGetCall) Fields(s ...googleapi.Field) *UserProfilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserProfilesGetCall) IfNoneMatch(entityTag string) *UserProfilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserProfilesGetCall) Context(ctx context.Context) *UserProfilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *UserProfilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/userProfiles/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "classroom.userProfiles.get" call. +// Exactly one of *UserProfile or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UserProfile.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserProfilesGetCall) Do() (*UserProfile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserProfile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a user profile. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access this user profile or if no profile exists with the requested ID or for access errors.", + // "httpMethod": "GET", + // "id": "classroom.userProfiles.get", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "userId": { + // "description": "Identifier of the profile to return. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `\"me\"`, indicating the requesting user", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/userProfiles/{userId}", + // "response": { + // "$ref": "UserProfile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/classroom.profile.emails", + // "https://www.googleapis.com/auth/classroom.profile.photos", + // "https://www.googleapis.com/auth/classroom.rosters", + // "https://www.googleapis.com/auth/classroom.rosters.readonly" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/cloudbilling/v1/cloudbilling-api.json b/Godeps/_workspace/src/google.golang.org/api/cloudbilling/v1/cloudbilling-api.json new file mode 100644 index 000000000..6033ea662 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/cloudbilling/v1/cloudbilling-api.json @@ -0,0 +1,343 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/vc2WYrePuDcqazgNVjmdzE5Mns4\"", + "discoveryVersion": "v1", + "id": "cloudbilling:v1", + "name": "cloudbilling", + "version": "v1", + "revision": "20150903", + "title": "Google Cloud Billing API", + "description": "Retrieves Google Developers Console billing accounts and associates them with projects.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/billing/", + "protocol": "rest", + "baseUrl": "https://cloudbilling.googleapis.com/", + "basePath": "/", + "rootUrl": "https://cloudbilling.googleapis.com/", + "servicePath": "", + "batchPath": "batch", + "parameters": { + "access_token": { + "type": "string", + "description": "OAuth access token.", + "location": "query" + }, + "alt": { + "type": "string", + "description": "Data format for response.", + "default": "json", + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query" + }, + "bearer_token": { + "type": "string", + "description": "OAuth bearer token.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JSONP", + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "pp": { + "type": "boolean", + "description": "Pretty-print response.", + "default": "true", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query" + }, + "upload_protocol": { + "type": "string", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query" + }, + "uploadType": { + "type": "string", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query" + }, + "$.xgafv": { + "type": "string", + "description": "V1 error format.", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "schemas": { + "BillingAccount": { + "id": "BillingAccount", + "type": "object", + "description": "A billing account in [Google Developers Console](https://console.developers.google.com/). You can assign a billing account to one or more projects.", + "properties": { + "name": { + "type": "string", + "description": "The resource name of the billing account. The resource name has the form `billingAccounts/{billing_account_id}`. For example, `billingAccounts/012345-567890-ABCDEF` would be the resource name for billing account `012345-567890-ABCDEF`." + }, + "open": { + "type": "boolean", + "description": "True if the billing account is open, and will therefore be charged for any usage on associated projects. False if the billing account is closed, and therefore projects associated with it will be unable to use paid services." + }, + "displayName": { + "type": "string", + "description": "The display name given to the billing account, such as `My Billing Account`. This name is displayed in the Google Developers Console." + } + } + }, + "ListBillingAccountsResponse": { + "id": "ListBillingAccountsResponse", + "type": "object", + "description": "Response message for `ListBillingAccounts`.", + "properties": { + "billingAccounts": { + "type": "array", + "description": "A list of billing accounts.", + "items": { + "$ref": "BillingAccount" + } + }, + "nextPageToken": { + "type": "string", + "description": "A token to retrieve the next page of results. To retrieve the next page, call `ListBillingAccounts` again with the `page_token` field set to this value. This field is empty if there are no more results to retrieve." + } + } + }, + "ListProjectBillingInfoResponse": { + "id": "ListProjectBillingInfoResponse", + "type": "object", + "description": "Request message for `ListProjectBillingInfoResponse`.", + "properties": { + "projectBillingInfo": { + "type": "array", + "description": "A list of `ProjectBillingInfo` resources representing the projects associated with the billing account.", + "items": { + "$ref": "ProjectBillingInfo" + } + }, + "nextPageToken": { + "type": "string", + "description": "A token to retrieve the next page of results. To retrieve the next page, call `ListProjectBillingInfo` again with the `page_token` field set to this value. This field is empty if there are no more results to retrieve." + } + } + }, + "ProjectBillingInfo": { + "id": "ProjectBillingInfo", + "type": "object", + "description": "Encapsulation of billing information for a Developers Console project. A project has at most one associated billing account at a time (but a billing account can be assigned to multiple projects).", + "properties": { + "name": { + "type": "string", + "description": "The resource name for the `ProjectBillingInfo`; has the form `projects/{project_id}/billingInfo`. For example, the resource name for the billing information for project `tokyo-rain-123` would be `projects/tokyo-rain-123/billingInfo`. This field is read-only." + }, + "projectId": { + "type": "string", + "description": "The ID of the project that this `ProjectBillingInfo` represents, such as `tokyo-rain-123`. This is a convenience field so that you don't need to parse the `name` field to obtain a project ID. This field is read-only." + }, + "billingAccountName": { + "type": "string", + "description": "The resource name of the billing account associated with the project, if any. For example, `billingAccounts/012345-567890-ABCDEF`." + }, + "billingEnabled": { + "type": "boolean", + "description": "True if the project is associated with an open billing account, to which usage on the project is charged. False if the project is associated with a closed billing account, or no billing account at all, and therefore cannot use paid services. This field is read-only." + } + } + } + }, + "resources": { + "billingAccounts": { + "methods": { + "get": { + "id": "cloudbilling.billingAccounts.get", + "path": "v1/{+name}", + "httpMethod": "GET", + "description": "Gets information about a billing account. The current authenticated user must be an [owner of the billing account](https://support.google.com/cloud/answer/4430947).", + "parameters": { + "name": { + "type": "string", + "description": "The resource name of the billing account to retrieve. For example, `billingAccounts/012345-567890-ABCDEF`.", + "required": true, + "pattern": "^billingAccounts/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "BillingAccount" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "id": "cloudbilling.billingAccounts.list", + "path": "v1/billingAccounts", + "httpMethod": "GET", + "description": "Lists the billing accounts that the current authenticated user [owns](https://support.google.com/cloud/answer/4430947).", + "parameters": { + "pageSize": { + "type": "integer", + "description": "Requested page size. The maximum page size is 100; this is also the default.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A token identifying a page of results to return. This should be a `next_page_token` value returned from a previous `ListBillingAccounts` call. If unspecified, the first page of results is returned.", + "location": "query" + } + }, + "response": { + "$ref": "ListBillingAccountsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + }, + "resources": { + "projects": { + "methods": { + "list": { + "id": "cloudbilling.billingAccounts.projects.list", + "path": "v1/{+name}/projects", + "httpMethod": "GET", + "description": "Lists the projects associated with a billing account. The current authenticated user must be an [owner of the billing account](https://support.google.com/cloud/answer/4430947).", + "parameters": { + "name": { + "type": "string", + "description": "The resource name of the billing account associated with the projects that you want to list. For example, `billingAccounts/012345-567890-ABCDEF`.", + "required": true, + "pattern": "^billingAccounts/[^/]*$", + "location": "path" + }, + "pageSize": { + "type": "integer", + "description": "Requested page size. The maximum page size is 100; this is also the default.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A token identifying a page of results to be returned. This should be a `next_page_token` value returned from a previous `ListProjectBillingInfo` call. If unspecified, the first page of results is returned.", + "location": "query" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "ListProjectBillingInfoResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + }, + "projects": { + "methods": { + "getBillingInfo": { + "id": "cloudbilling.projects.getBillingInfo", + "path": "v1/{+name}/billingInfo", + "httpMethod": "GET", + "description": "Gets the billing information for a project. The current authenticated user must have [permission to view the project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo ).", + "parameters": { + "name": { + "type": "string", + "description": "The resource name of the project for which billing information is retrieved. For example, `projects/tokyo-rain-123`.", + "required": true, + "pattern": "^projects/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "ProjectBillingInfo" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "updateBillingInfo": { + "id": "cloudbilling.projects.updateBillingInfo", + "path": "v1/{+name}/billingInfo", + "httpMethod": "PUT", + "description": "Sets or updates the billing account associated with a project. You specify the new billing account by setting the `billing_account_name` in the `ProjectBillingInfo` resource to the resource name of a billing account. Associating a project with an open billing account enables billing on the project and allows charges for resource usage. If the project already had a billing account, this method changes the billing account used for resource usage charges. *Note:* Incurred charges that have not yet been reported in the transaction history of the Google Developers Console may be billed to the new billing account, even if the charge occurred before the new billing account was assigned to the project. The current authenticated user must have ownership privileges for both the [project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo ) and the [billing account](https://support.google.com/cloud/answer/4430947). You can disable billing on the project by setting the `billing_account_name` field to empty. This action disassociates the current billing account from the project. Any billable activity of your in-use services will stop, and your application could stop functioning as expected. Any unbilled charges to date will be billed to the previously associated account. The current authenticated user must be either an owner of the project or an owner of the billing account for the project. Note that associating a project with a *closed* billing account will have much the same effect as disabling billing on the project: any paid resources used by the project will be shut down. Thus, unless you wish to disable billing, you should always call this method with the name of an *open* billing account.", + "parameters": { + "name": { + "type": "string", + "description": "The resource name of the project associated with the billing information that you want to update. For example, `projects/tokyo-rain-123`.", + "required": true, + "pattern": "^projects/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "name" + ], + "request": { + "$ref": "ProjectBillingInfo" + }, + "response": { + "$ref": "ProjectBillingInfo" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/cloudbilling/v1/cloudbilling-gen.go b/Godeps/_workspace/src/google.golang.org/api/cloudbilling/v1/cloudbilling-gen.go new file mode 100644 index 000000000..475c3d523 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/cloudbilling/v1/cloudbilling-gen.go @@ -0,0 +1,982 @@ +// Package cloudbilling provides access to the Google Cloud Billing API. +// +// See https://cloud.google.com/billing/ +// +// Usage example: +// +// import "google.golang.org/api/cloudbilling/v1" +// ... +// cloudbillingService, err := cloudbilling.New(oauthHttpClient) +package cloudbilling // import "google.golang.org/api/cloudbilling/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "cloudbilling:v1" +const apiName = "cloudbilling" +const apiVersion = "v1" +const basePath = "https://cloudbilling.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your data across Google Cloud Platform services + CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.BillingAccounts = NewBillingAccountsService(s) + s.Projects = NewProjectsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + BillingAccounts *BillingAccountsService + + Projects *ProjectsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewBillingAccountsService(s *Service) *BillingAccountsService { + rs := &BillingAccountsService{s: s} + rs.Projects = NewBillingAccountsProjectsService(s) + return rs +} + +type BillingAccountsService struct { + s *Service + + Projects *BillingAccountsProjectsService +} + +func NewBillingAccountsProjectsService(s *Service) *BillingAccountsProjectsService { + rs := &BillingAccountsProjectsService{s: s} + return rs +} + +type BillingAccountsProjectsService struct { + s *Service +} + +func NewProjectsService(s *Service) *ProjectsService { + rs := &ProjectsService{s: s} + return rs +} + +type ProjectsService struct { + s *Service +} + +// BillingAccount: A billing account in [Google Developers +// Console](https://console.developers.google.com/). You can assign a +// billing account to one or more projects. +type BillingAccount struct { + // DisplayName: The display name given to the billing account, such as + // `My Billing Account`. This name is displayed in the Google Developers + // Console. + DisplayName string `json:"displayName,omitempty"` + + // Name: The resource name of the billing account. The resource name has + // the form `billingAccounts/{billing_account_id}`. For example, + // `billingAccounts/012345-567890-ABCDEF` would be the resource name for + // billing account `012345-567890-ABCDEF`. + Name string `json:"name,omitempty"` + + // Open: True if the billing account is open, and will therefore be + // charged for any usage on associated projects. False if the billing + // account is closed, and therefore projects associated with it will be + // unable to use paid services. + Open bool `json:"open,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BillingAccount) MarshalJSON() ([]byte, error) { + type noMethod BillingAccount + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListBillingAccountsResponse: Response message for +// `ListBillingAccounts`. +type ListBillingAccountsResponse struct { + // BillingAccounts: A list of billing accounts. + BillingAccounts []*BillingAccount `json:"billingAccounts,omitempty"` + + // NextPageToken: A token to retrieve the next page of results. To + // retrieve the next page, call `ListBillingAccounts` again with the + // `page_token` field set to this value. This field is empty if there + // are no more results to retrieve. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BillingAccounts") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListBillingAccountsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListBillingAccountsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListProjectBillingInfoResponse: Request message for +// `ListProjectBillingInfoResponse`. +type ListProjectBillingInfoResponse struct { + // NextPageToken: A token to retrieve the next page of results. To + // retrieve the next page, call `ListProjectBillingInfo` again with the + // `page_token` field set to this value. This field is empty if there + // are no more results to retrieve. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ProjectBillingInfo: A list of `ProjectBillingInfo` resources + // representing the projects associated with the billing account. + ProjectBillingInfo []*ProjectBillingInfo `json:"projectBillingInfo,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListProjectBillingInfoResponse) MarshalJSON() ([]byte, error) { + type noMethod ListProjectBillingInfoResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ProjectBillingInfo: Encapsulation of billing information for a +// Developers Console project. A project has at most one associated +// billing account at a time (but a billing account can be assigned to +// multiple projects). +type ProjectBillingInfo struct { + // BillingAccountName: The resource name of the billing account + // associated with the project, if any. For example, + // `billingAccounts/012345-567890-ABCDEF`. + BillingAccountName string `json:"billingAccountName,omitempty"` + + // BillingEnabled: True if the project is associated with an open + // billing account, to which usage on the project is charged. False if + // the project is associated with a closed billing account, or no + // billing account at all, and therefore cannot use paid services. This + // field is read-only. + BillingEnabled bool `json:"billingEnabled,omitempty"` + + // Name: The resource name for the `ProjectBillingInfo`; has the form + // `projects/{project_id}/billingInfo`. For example, the resource name + // for the billing information for project `tokyo-rain-123` would be + // `projects/tokyo-rain-123/billingInfo`. This field is read-only. + Name string `json:"name,omitempty"` + + // ProjectId: The ID of the project that this `ProjectBillingInfo` + // represents, such as `tokyo-rain-123`. This is a convenience field so + // that you don't need to parse the `name` field to obtain a project ID. + // This field is read-only. + ProjectId string `json:"projectId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BillingAccountName") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProjectBillingInfo) MarshalJSON() ([]byte, error) { + type noMethod ProjectBillingInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "cloudbilling.billingAccounts.get": + +type BillingAccountsGetCall struct { + s *Service + name string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets information about a billing account. The current +// authenticated user must be an [owner of the billing +// account](https://support.google.com/cloud/answer/4430947). +func (r *BillingAccountsService) Get(name string) *BillingAccountsGetCall { + c := &BillingAccountsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BillingAccountsGetCall) Fields(s ...googleapi.Field) *BillingAccountsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BillingAccountsGetCall) IfNoneMatch(entityTag string) *BillingAccountsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BillingAccountsGetCall) Context(ctx context.Context) *BillingAccountsGetCall { + c.ctx_ = ctx + return c +} + +func (c *BillingAccountsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudbilling.billingAccounts.get" call. +// Exactly one of *BillingAccount or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *BillingAccount.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BillingAccountsGetCall) Do() (*BillingAccount, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BillingAccount{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets information about a billing account. The current authenticated user must be an [owner of the billing account](https://support.google.com/cloud/answer/4430947).", + // "httpMethod": "GET", + // "id": "cloudbilling.billingAccounts.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The resource name of the billing account to retrieve. For example, `billingAccounts/012345-567890-ABCDEF`.", + // "location": "path", + // "pattern": "^billingAccounts/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "BillingAccount" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudbilling.billingAccounts.list": + +type BillingAccountsListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the billing accounts that the current authenticated user +// [owns](https://support.google.com/cloud/answer/4430947). +func (r *BillingAccountsService) List() *BillingAccountsListCall { + c := &BillingAccountsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// PageSize sets the optional parameter "pageSize": Requested page size. +// The maximum page size is 100; this is also the default. +func (c *BillingAccountsListCall) PageSize(pageSize int64) *BillingAccountsListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": A token +// identifying a page of results to return. This should be a +// `next_page_token` value returned from a previous +// `ListBillingAccounts` call. If unspecified, the first page of results +// is returned. +func (c *BillingAccountsListCall) PageToken(pageToken string) *BillingAccountsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BillingAccountsListCall) Fields(s ...googleapi.Field) *BillingAccountsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BillingAccountsListCall) IfNoneMatch(entityTag string) *BillingAccountsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BillingAccountsListCall) Context(ctx context.Context) *BillingAccountsListCall { + c.ctx_ = ctx + return c +} + +func (c *BillingAccountsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/billingAccounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudbilling.billingAccounts.list" call. +// Exactly one of *ListBillingAccountsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListBillingAccountsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BillingAccountsListCall) Do() (*ListBillingAccountsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListBillingAccountsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the billing accounts that the current authenticated user [owns](https://support.google.com/cloud/answer/4430947).", + // "httpMethod": "GET", + // "id": "cloudbilling.billingAccounts.list", + // "parameters": { + // "pageSize": { + // "description": "Requested page size. The maximum page size is 100; this is also the default.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A token identifying a page of results to return. This should be a `next_page_token` value returned from a previous `ListBillingAccounts` call. If unspecified, the first page of results is returned.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/billingAccounts", + // "response": { + // "$ref": "ListBillingAccountsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudbilling.billingAccounts.projects.list": + +type BillingAccountsProjectsListCall struct { + s *Service + name string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the projects associated with a billing account. The +// current authenticated user must be an [owner of the billing +// account](https://support.google.com/cloud/answer/4430947). +func (r *BillingAccountsProjectsService) List(name string) *BillingAccountsProjectsListCall { + c := &BillingAccountsProjectsListCall{s: r.s, opt_: make(map[string]interface{})} + c.name = name + return c +} + +// PageSize sets the optional parameter "pageSize": Requested page size. +// The maximum page size is 100; this is also the default. +func (c *BillingAccountsProjectsListCall) PageSize(pageSize int64) *BillingAccountsProjectsListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": A token +// identifying a page of results to be returned. This should be a +// `next_page_token` value returned from a previous +// `ListProjectBillingInfo` call. If unspecified, the first page of +// results is returned. +func (c *BillingAccountsProjectsListCall) PageToken(pageToken string) *BillingAccountsProjectsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BillingAccountsProjectsListCall) Fields(s ...googleapi.Field) *BillingAccountsProjectsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BillingAccountsProjectsListCall) IfNoneMatch(entityTag string) *BillingAccountsProjectsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BillingAccountsProjectsListCall) Context(ctx context.Context) *BillingAccountsProjectsListCall { + c.ctx_ = ctx + return c +} + +func (c *BillingAccountsProjectsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/projects") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudbilling.billingAccounts.projects.list" call. +// Exactly one of *ListProjectBillingInfoResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListProjectBillingInfoResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BillingAccountsProjectsListCall) Do() (*ListProjectBillingInfoResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListProjectBillingInfoResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the projects associated with a billing account. The current authenticated user must be an [owner of the billing account](https://support.google.com/cloud/answer/4430947).", + // "httpMethod": "GET", + // "id": "cloudbilling.billingAccounts.projects.list", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The resource name of the billing account associated with the projects that you want to list. For example, `billingAccounts/012345-567890-ABCDEF`.", + // "location": "path", + // "pattern": "^billingAccounts/[^/]*$", + // "required": true, + // "type": "string" + // }, + // "pageSize": { + // "description": "Requested page size. The maximum page size is 100; this is also the default.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A token identifying a page of results to be returned. This should be a `next_page_token` value returned from a previous `ListProjectBillingInfo` call. If unspecified, the first page of results is returned.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/{+name}/projects", + // "response": { + // "$ref": "ListProjectBillingInfoResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudbilling.projects.getBillingInfo": + +type ProjectsGetBillingInfoCall struct { + s *Service + name string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetBillingInfo: Gets the billing information for a project. The +// current authenticated user must have [permission to view the +// project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxof +// vnoo ). +func (r *ProjectsService) GetBillingInfo(name string) *ProjectsGetBillingInfoCall { + c := &ProjectsGetBillingInfoCall{s: r.s, opt_: make(map[string]interface{})} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsGetBillingInfoCall) Fields(s ...googleapi.Field) *ProjectsGetBillingInfoCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsGetBillingInfoCall) IfNoneMatch(entityTag string) *ProjectsGetBillingInfoCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsGetBillingInfoCall) Context(ctx context.Context) *ProjectsGetBillingInfoCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsGetBillingInfoCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/billingInfo") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudbilling.projects.getBillingInfo" call. +// Exactly one of *ProjectBillingInfo or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ProjectBillingInfo.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsGetBillingInfoCall) Do() (*ProjectBillingInfo, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProjectBillingInfo{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the billing information for a project. The current authenticated user must have [permission to view the project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo ).", + // "httpMethod": "GET", + // "id": "cloudbilling.projects.getBillingInfo", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The resource name of the project for which billing information is retrieved. For example, `projects/tokyo-rain-123`.", + // "location": "path", + // "pattern": "^projects/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}/billingInfo", + // "response": { + // "$ref": "ProjectBillingInfo" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudbilling.projects.updateBillingInfo": + +type ProjectsUpdateBillingInfoCall struct { + s *Service + name string + projectbillinginfo *ProjectBillingInfo + opt_ map[string]interface{} + ctx_ context.Context +} + +// UpdateBillingInfo: Sets or updates the billing account associated +// with a project. You specify the new billing account by setting the +// `billing_account_name` in the `ProjectBillingInfo` resource to the +// resource name of a billing account. Associating a project with an +// open billing account enables billing on the project and allows +// charges for resource usage. If the project already had a billing +// account, this method changes the billing account used for resource +// usage charges. *Note:* Incurred charges that have not yet been +// reported in the transaction history of the Google Developers Console +// may be billed to the new billing account, even if the charge occurred +// before the new billing account was assigned to the project. The +// current authenticated user must have ownership privileges for both +// the +// [project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxo +// fvnoo ) and the [billing +// account](https://support.google.com/cloud/answer/4430947). You can +// disable billing on the project by setting the `billing_account_name` +// field to empty. This action disassociates the current billing account +// from the project. Any billable activity of your in-use services will +// stop, and your application could stop functioning as expected. Any +// unbilled charges to date will be billed to the previously associated +// account. The current authenticated user must be either an owner of +// the project or an owner of the billing account for the project. Note +// that associating a project with a *closed* billing account will have +// much the same effect as disabling billing on the project: any paid +// resources used by the project will be shut down. Thus, unless you +// wish to disable billing, you should always call this method with the +// name of an *open* billing account. +func (r *ProjectsService) UpdateBillingInfo(name string, projectbillinginfo *ProjectBillingInfo) *ProjectsUpdateBillingInfoCall { + c := &ProjectsUpdateBillingInfoCall{s: r.s, opt_: make(map[string]interface{})} + c.name = name + c.projectbillinginfo = projectbillinginfo + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsUpdateBillingInfoCall) Fields(s ...googleapi.Field) *ProjectsUpdateBillingInfoCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsUpdateBillingInfoCall) Context(ctx context.Context) *ProjectsUpdateBillingInfoCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsUpdateBillingInfoCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectbillinginfo) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/billingInfo") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudbilling.projects.updateBillingInfo" call. +// Exactly one of *ProjectBillingInfo or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ProjectBillingInfo.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsUpdateBillingInfoCall) Do() (*ProjectBillingInfo, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProjectBillingInfo{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets or updates the billing account associated with a project. You specify the new billing account by setting the `billing_account_name` in the `ProjectBillingInfo` resource to the resource name of a billing account. Associating a project with an open billing account enables billing on the project and allows charges for resource usage. If the project already had a billing account, this method changes the billing account used for resource usage charges. *Note:* Incurred charges that have not yet been reported in the transaction history of the Google Developers Console may be billed to the new billing account, even if the charge occurred before the new billing account was assigned to the project. The current authenticated user must have ownership privileges for both the [project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo ) and the [billing account](https://support.google.com/cloud/answer/4430947). You can disable billing on the project by setting the `billing_account_name` field to empty. This action disassociates the current billing account from the project. Any billable activity of your in-use services will stop, and your application could stop functioning as expected. Any unbilled charges to date will be billed to the previously associated account. The current authenticated user must be either an owner of the project or an owner of the billing account for the project. Note that associating a project with a *closed* billing account will have much the same effect as disabling billing on the project: any paid resources used by the project will be shut down. Thus, unless you wish to disable billing, you should always call this method with the name of an *open* billing account.", + // "httpMethod": "PUT", + // "id": "cloudbilling.projects.updateBillingInfo", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The resource name of the project associated with the billing information that you want to update. For example, `projects/tokyo-rain-123`.", + // "location": "path", + // "pattern": "^projects/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}/billingInfo", + // "request": { + // "$ref": "ProjectBillingInfo" + // }, + // "response": { + // "$ref": "ProjectBillingInfo" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/clouddebugger/v2/clouddebugger-api.json b/Godeps/_workspace/src/google.golang.org/api/clouddebugger/v2/clouddebugger-api.json new file mode 100644 index 000000000..81cc52b0d --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/clouddebugger/v2/clouddebugger-api.json @@ -0,0 +1,913 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/IirqKiawPBlWznB4XZKKLikRaQQ\"", + "discoveryVersion": "v1", + "id": "clouddebugger:v2", + "name": "clouddebugger", + "version": "v2", + "revision": "20150725", + "title": "Google Cloud Debugger API", + "description": "Lets you examine the stack and variables of your running application without stopping or slowing it down.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/tools/cloud-debugger", + "protocol": "rest", + "baseUrl": "https://clouddebugger.googleapis.com/", + "basePath": "/", + "rootUrl": "https://clouddebugger.googleapis.com/", + "servicePath": "", + "batchPath": "batch", + "parameters": { + "access_token": { + "type": "string", + "description": "OAuth access token.", + "location": "query" + }, + "alt": { + "type": "string", + "description": "Data format for response.", + "default": "json", + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query" + }, + "bearer_token": { + "type": "string", + "description": "OAuth bearer token.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JSONP", + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "pp": { + "type": "boolean", + "description": "Pretty-print response.", + "default": "true", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query" + }, + "upload_protocol": { + "type": "string", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query" + }, + "uploadType": { + "type": "string", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query" + }, + "$.xgafv": { + "type": "string", + "description": "V1 error format.", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/cloud_debugger": { + "description": "Manage cloud debugger" + }, + "https://www.googleapis.com/auth/cloud_debugletcontroller": { + "description": "Manage active breakpoints in cloud debugger" + } + } + } + }, + "schemas": { + "RegisterDebuggeeRequest": { + "id": "RegisterDebuggeeRequest", + "type": "object", + "description": "The request to register a debuggee.", + "properties": { + "debuggee": { + "$ref": "Debuggee", + "description": "The debuggee information to register. The fields 'project', 'uniquifier', 'description' and 'agent_version' of the debuggee must be set." + } + } + }, + "Debuggee": { + "id": "Debuggee", + "type": "object", + "description": "Represents the application to debug. The application may include one or more replicated processes executing the same code. Each of these processes is attached with a debugger agent, carrying out the debugging commands. The agents attached to the same debuggee are identified by using exactly the same fields' values when registering.", + "properties": { + "id": { + "type": "string", + "description": "Debuggee unique identifer generated by the server." + }, + "project": { + "type": "string", + "description": "The project the debuggee is associated with. Use the project number when registering a Google Cloud Platform project." + }, + "uniquifier": { + "type": "string", + "description": "The debuggee uniqifier within the project. Any string that id the application within the project can be used. Recomended to include environement and version or build id's." + }, + "description": { + "type": "string", + "description": "A human readable description of the debuggee. Recommended to include human readable project name, environment name, and version information ." + }, + "isInactive": { + "type": "boolean", + "description": "If set to true indicates that the debuggee has not been seen by the Controller service in the last active time period (defined by the server)." + }, + "agentVersion": { + "type": "string", + "description": "Version ID of the agent release. The version ID is structured as following: \"domain/type/vmajor.minor\" (for example \"google.com/gcp-java/v1.1\")." + }, + "isDisabled": { + "type": "boolean", + "description": "If set to true, indicates that the agent should disable itself and detach from the debuggee." + }, + "status": { + "$ref": "StatusMessage", + "description": "Human readable message to be displayed to the user about this debuggee. Absense of this field indicates no message. The message can be either informational or error." + }, + "sourceContexts": { + "type": "array", + "description": "Repository snapshots containing the source code of the project.", + "items": { + "$ref": "SourceContext" + } + }, + "labels": { + "type": "object", + "description": "A set of custom debuggee properties, populated by the agent, to be displayed to the user.", + "additionalProperties": { + "type": "string" + } + } + } + }, + "StatusMessage": { + "id": "StatusMessage", + "type": "object", + "description": "Represents a contextual status message. The message can indicate an error or informational status, and refer to specific parts of the containing object. For example, the Breakpoint.status field can indicate an error referring to the BREAKPOINT_SOURCE_LOCATION with the message \"Location not found\".", + "properties": { + "isError": { + "type": "boolean", + "description": "Distinguishes errors from informational messages." + }, + "refersTo": { + "type": "string", + "description": "Reference to which the message applies.", + "enum": [ + "UNSPECIFIED", + "BREAKPOINT_SOURCE_LOCATION", + "BREAKPOINT_CONDITION", + "BREAKPOINT_EXPRESSION", + "VARIABLE_NAME", + "VARIABLE_VALUE" + ] + }, + "description": { + "$ref": "FormatMessage", + "description": "Status message text." + } + } + }, + "FormatMessage": { + "id": "FormatMessage", + "type": "object", + "description": "Represents a message with parameters.", + "properties": { + "format": { + "type": "string", + "description": "Format template of the message. The \"format\" uses placeholders \"$0\", \"$1\", etc. to reference parameters. \"$$\" can be used to denote the '$' character. Examples: \"Failed to load '$0' which helps debug $1 the first time it is loaded. Again, $0 is very important.\" \"Please pay $$10 to use $0 instead of $1.\"" + }, + "parameters": { + "type": "array", + "description": "Optional parameters to be embedded into the message.", + "items": { + "type": "string" + } + } + } + }, + "SourceContext": { + "id": "SourceContext", + "type": "object", + "description": "A SourceContext is a reference to a tree of files. A SourceContext together with a path point to a unique revision of a single file or directory.", + "properties": { + "cloudRepo": { + "$ref": "CloudRepoSourceContext", + "description": "A SourceContext referring to a revision in a cloud repo." + }, + "cloudWorkspace": { + "$ref": "CloudWorkspaceSourceContext", + "description": "A SourceContext referring to a snapshot in a cloud workspace." + }, + "gerrit": { + "$ref": "GerritSourceContext", + "description": "A SourceContext referring to a Gerrit project." + }, + "git": { + "$ref": "GitSourceContext", + "description": "A SourceContext referring to any third party Git repo (e.g. GitHub)." + } + } + }, + "CloudRepoSourceContext": { + "id": "CloudRepoSourceContext", + "type": "object", + "description": "A CloudRepoSourceContext denotes a particular revision in a cloud repo (a repo hosted by the Google Cloud Platform).", + "properties": { + "repoId": { + "$ref": "RepoId", + "description": "The ID of the repo." + }, + "revisionId": { + "type": "string", + "description": "A revision ID." + }, + "aliasName": { + "type": "string", + "description": "The name of an alias (branch, tag, etc.)." + } + } + }, + "RepoId": { + "id": "RepoId", + "type": "object", + "description": "A unique identifier for a cloud repo.", + "properties": { + "projectRepoId": { + "$ref": "ProjectRepoId", + "description": "A combination of a project ID and a repo name." + }, + "uid": { + "type": "string", + "description": "A server-assigned, globally unique identifier." + } + } + }, + "ProjectRepoId": { + "id": "ProjectRepoId", + "type": "object", + "description": "Selects a repo using a Google Cloud Platform project ID (e.g. winged-cargo-31) and a repo name within that project.", + "properties": { + "projectId": { + "type": "string", + "description": "The ID of the project." + }, + "repoName": { + "type": "string", + "description": "The name of the repo. Leave empty for the default repo." + } + } + }, + "CloudWorkspaceSourceContext": { + "id": "CloudWorkspaceSourceContext", + "type": "object", + "description": "A CloudWorkspaceSourceContext denotes a workspace at a particular snapshot.", + "properties": { + "workspaceId": { + "$ref": "CloudWorkspaceId", + "description": "The ID of the workspace." + }, + "snapshotId": { + "type": "string", + "description": "The ID of the snapshot. An empty snapshot_id refers to the most recent snapshot." + } + } + }, + "CloudWorkspaceId": { + "id": "CloudWorkspaceId", + "type": "object", + "description": "A CloudWorkspaceId is a unique identifier for a cloud workspace. A cloud workspace is a place associated with a repo where modified files can be stored before they are committed.", + "properties": { + "repoId": { + "$ref": "RepoId", + "description": "The ID of the repo containing the workspace." + }, + "name": { + "type": "string", + "description": "The unique name of the workspace within the repo. This is the name chosen by the client in the Source API's CreateWorkspace method." + } + } + }, + "GerritSourceContext": { + "id": "GerritSourceContext", + "type": "object", + "description": "A SourceContext referring to a Gerrit project.", + "properties": { + "hostUri": { + "type": "string", + "description": "The URI of a running Gerrit instance." + }, + "gerritProject": { + "type": "string", + "description": "The full project name within the host. Projects may be nested, so \"project/subproject\" is a valid project name. The \"repo name\" is hostURI/project." + }, + "revisionId": { + "type": "string", + "description": "A revision (commit) ID." + }, + "aliasName": { + "type": "string", + "description": "The name of an alias (branch, tag, etc.)." + } + } + }, + "GitSourceContext": { + "id": "GitSourceContext", + "type": "object", + "description": "A GitSourceContext denotes a particular revision in a third party Git repository (e.g. GitHub).", + "properties": { + "url": { + "type": "string", + "description": "Git repository URL." + }, + "revisionId": { + "type": "string", + "description": "Git commit hash. required." + } + } + }, + "RegisterDebuggeeResponse": { + "id": "RegisterDebuggeeResponse", + "type": "object", + "description": "The response of registering a debuggee.", + "properties": { + "debuggee": { + "$ref": "Debuggee", + "description": "The debuggee resource. The field 'id' is guranteed to be set (in addition to the echoed fields)." + } + } + }, + "ListActiveBreakpointsResponse": { + "id": "ListActiveBreakpointsResponse", + "type": "object", + "description": "The response of listing active breakpoints.", + "properties": { + "breakpoints": { + "type": "array", + "description": "List of all active breakpoints. The fields 'id' and 'location' are guranteed to be set on each breakpoint.", + "items": { + "$ref": "Breakpoint" + } + }, + "nextWaitToken": { + "type": "string", + "description": "A wait token that can be used in the next method call to block until the list of breakpoints changes." + } + } + }, + "Breakpoint": { + "id": "Breakpoint", + "type": "object", + "description": "Represents the breakpoint specification, status and results.", + "properties": { + "id": { + "type": "string", + "description": "Breakpoint identifier, unique in the scope of the debuggee." + }, + "action": { + "type": "string", + "description": "Defines what to do when the breakpoint hits.", + "enum": [ + "CAPTURE", + "LOG" + ] + }, + "location": { + "$ref": "SourceLocation", + "description": "The breakpoint source location." + }, + "condition": { + "type": "string", + "description": "A condition to trigger the breakpoint. The condition is a compound boolean expression composed using expressions in a programming language at the source location." + }, + "expressions": { + "type": "array", + "description": "A list of read-only expressions to evaluate at the breakpoint location. The expressions are composed using expressions in the programming language at the source location. If the breakpoint action is \"LOG\", the evaluated expressions are included in log statements.", + "items": { + "type": "string" + } + }, + "logMessageFormat": { + "type": "string", + "description": "Only relevant when action is \"LOG\". Defines the message to log when the breakpoint hits. The message may include parameter placeholders \"$0\", \"$1\", etc. These placeholders will be replaced with the evaluated value of the appropriate expression. Expressions not referenced in \"log_message_format\" will not be logged. Example: \"Poisonous message received, id = $0, count = $1\" with expressions = [ \"message.id\", \"message.count\" ]." + }, + "logLevel": { + "type": "string", + "description": "Indicates the severity of the log. Only relevant when action is \"LOG\".", + "enum": [ + "INFO", + "WARNING", + "ERROR" + ] + }, + "isFinalState": { + "type": "boolean", + "description": "When true, indicates that this is a final result and the breakpoint state will not change from here on." + }, + "createTime": { + "type": "string", + "description": "The time this breakpoint was created by the server. The value is in seconds resolution." + }, + "finalTime": { + "type": "string", + "description": "The time this breakpoint was finalized as seen by the server. The value is in seconds resolution." + }, + "userEmail": { + "type": "string", + "description": "The e-mail of the user that created this breakpoint" + }, + "status": { + "$ref": "StatusMessage", + "description": "Breakpoint status. The status includes an error flag and a human readable message. This field will usually stay unset. The message can be either informational or error. Nevertheless, clients should always display the text message back to the user. Error status of a breakpoint indicates complete failure. Example (non-final state): 'Still loading symbols...' Examples (final state): 'Failed to insert breakpoint' referring to breakpoint, 'Field f not found in class C' referring to condition, ..." + }, + "stackFrames": { + "type": "array", + "description": "The stack at breakpoint time.", + "items": { + "$ref": "StackFrame" + } + }, + "evaluatedExpressions": { + "type": "array", + "description": "The evaluated expressions' values at breakpoint time. The evaluated expressions appear in exactly the same order they are listed in the 'expressions' field. The 'name' field holds the original expression text, the 'value'/'members' field holds the result of the evaluated expression. If the expression can not be evaluated, an error text is placed in the value field.", + "items": { + "$ref": "Variable" + } + }, + "variableTable": { + "type": "array", + "description": "The variable_table exists to aid with computation, memory and network traffic optimization. It enables storing a variable once and reference it from multiple variables, including variables stored in the variable_table itself. For example, the object 'this', which may appear at many levels of the stack, can have all of it's data stored once in this table. The stack frame variables then would hold only a reference to it. The variable var_index field is an index into this repeated field. The stored objects are nameless and get their name from the referencing variable. The effective variable is a merge of the referencing veariable and the referenced variable.", + "items": { + "$ref": "Variable" + } + } + } + }, + "SourceLocation": { + "id": "SourceLocation", + "type": "object", + "description": "Represents a location in the source code.", + "properties": { + "path": { + "type": "string", + "description": "A path to the source file within the source context of the target binary." + }, + "line": { + "type": "integer", + "description": "The line inside the file (first line value is '1').", + "format": "int32" + } + } + }, + "StackFrame": { + "id": "StackFrame", + "type": "object", + "description": "Represents a stack frame context.", + "properties": { + "function": { + "type": "string", + "description": "The unmangled function name at the call site." + }, + "location": { + "$ref": "SourceLocation", + "description": "The source location of the call site." + }, + "arguments": { + "type": "array", + "description": "The set of arguments passed to this function Note that this might not be populated for all stack frames.", + "items": { + "$ref": "Variable" + } + }, + "locals": { + "type": "array", + "description": "The set of local variables at the stack frame location. Note that this might not be populated for all stack frames.", + "items": { + "$ref": "Variable" + } + } + } + }, + "Variable": { + "id": "Variable", + "type": "object", + "description": "Represents a variable or an argument possibly of a compound object type. 1. A simple variable such as, int x = 5 is represented as: { name: \"x\", value: \"5\" } 2. A compound object such as, struct T { int m1; int m2; }; T x = { 3, 7 }; is represented as: { name: \"x\", members { name: \"m1\", value: \"3\" }, members { name: \"m2\", value: \"7\" } } 3. A pointer where the pointee was captured such as, T x = { 3, 7 }; T* p = &x; is represented as: { name: \"p\", value: \"0x00500500\", members { name: \"m1\", value: \"3\" }, members { name: \"m2\", value: \"7\" } } 4. A pointer where the pointee was not captured or is inaccessible such as, T* p = new T; is represented as: { name: \"p\", value: \"0x00400400\", members { value: \"\" } } the value text should decribe the reason for the missing value. such as , ,\n. note that a null pointer should not have members. 5. An unnamed value such as, int* p = new int(7); is represented as, { name: \"p\", value: \"0x00500500\", members { value: \"7\" } } 6. An unnamed pointer where the pointee was not captured such as, int* p = new int(7); int** pp = &p; is represented as: { name: \"pp\", value: \"0x00500500\", members { value: \"0x00400400\", members { value: \"\" } } } To optimize computation, memory and network traffic, variables that repeat in the output multiple times can be stored once in a shared variable table and be referenced using the var_index field. The variables stored in the shared table are nameless and are essentially a partition of the complete variable. To reconstruct the complete variable merge the referencing variable with the referenced variable. When using the shared variable table, variables can be represented as: T x = { 3, 7 }; T* p = &x; T& r = x; are represented as, { name: \"x\", var_index: 3 } { name: \"p\", value \"0x00500500\", var_index: 3 } { name: \"r\", var_index: 3 } with shared variable table entry #3: { members { name: \"m1\", value: \"3\" }, members { name: \"m2\", value: \"7\" } } Note that the pointer address is stored with the referencing variable and not with the referenced variable, to allow the referenced variable to be shared between pointer and references.", + "properties": { + "name": { + "type": "string", + "description": "The name of the variable, if any." + }, + "value": { + "type": "string", + "description": "The simple value of the variable." + }, + "members": { + "type": "array", + "description": "The members contained or pointed to by the variable.", + "items": { + "$ref": "Variable" + } + }, + "varTableIndex": { + "type": "integer", + "description": "This is a reference to a variable in the shared variable table. More than one variable can reference the same variable in the table. The var_index field is an index into variable_table in Breakpoint.", + "format": "int32" + }, + "status": { + "$ref": "StatusMessage", + "description": "Status associated with the variable. This field will usually stay unset. A status of a single variable only applies to that variable or expression. The rest of breakpoint data still remains valid. Variables might be reported in error state even when breakpoint is not in final state. The message may refer to variable name with \"refers_to\" set to \"VARIABLE_NAME\". Alternatively \"refers_to\" will be set to \"VARIABLE_VALUE\". In either case variable value and members will be unset. Example of error message applied to name: \"Invalid expression syntax\". Example of information message applied to value: \"Not captured\". Examples of error message applied to value: \"Malformed string\", \"Field f not found in class C\", \"Null pointer dereference\"." + } + } + }, + "UpdateActiveBreakpointRequest": { + "id": "UpdateActiveBreakpointRequest", + "type": "object", + "description": "The request to update an active breakpoint.", + "properties": { + "breakpoint": { + "$ref": "Breakpoint", + "description": "The updated breakpoint information. The field 'id' must be set." + } + } + }, + "UpdateActiveBreakpointResponse": { + "id": "UpdateActiveBreakpointResponse", + "type": "object", + "description": "The response of updating an active breakpoint. The message is defined to allow future extensions." + }, + "SetBreakpointResponse": { + "id": "SetBreakpointResponse", + "type": "object", + "description": "The response of setting a breakpoint.", + "properties": { + "breakpoint": { + "$ref": "Breakpoint", + "description": "The breakpoint resource. The field 'id' is guranteed to be set (in addition to the echoed fileds)." + } + } + }, + "GetBreakpointResponse": { + "id": "GetBreakpointResponse", + "type": "object", + "description": "The response of getting breakpoint information.", + "properties": { + "breakpoint": { + "$ref": "Breakpoint", + "description": "The complete breakpoint state. The fields 'id' and 'location' are guranteed to be set." + } + } + }, + "Empty": { + "id": "Empty", + "type": "object", + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`." + }, + "ListBreakpointsResponse": { + "id": "ListBreakpointsResponse", + "type": "object", + "description": "The response of listing breakpoints.", + "properties": { + "breakpoints": { + "type": "array", + "description": "List of all breakpoints with complete state. The fields 'id' and 'location' are guranteed to be set on each breakpoint.", + "items": { + "$ref": "Breakpoint" + } + }, + "nextWaitToken": { + "type": "string", + "description": "A wait token that can be used in the next call to ListBreakpoints to block until the list of breakpoints has changes." + } + } + }, + "ListDebuggeesResponse": { + "id": "ListDebuggeesResponse", + "type": "object", + "description": "The response of listing debuggees.", + "properties": { + "debuggees": { + "type": "array", + "description": "The list of debuggees accessible to the calling user. Note that the description field is the only human readable field that should be displayed to the user. The fields 'debuggee.id' and 'description' are guranteed to be set on each debuggee.", + "items": { + "$ref": "Debuggee" + } + } + } + } + }, + "resources": { + "controller": { + "resources": { + "debuggees": { + "methods": { + "register": { + "id": "clouddebugger.controller.debuggees.register", + "path": "v2/controller/debuggees/register", + "httpMethod": "POST", + "description": "Registers the debuggee with the controller. All agents should call this API with the same request content to get back the same stable 'debuggee_id'. Agents should call this API again whenever ListActiveBreakpoints or UpdateActiveBreakpoint return the error google.rpc.Code.NOT_FOUND. It allows the server to disable the agent or recover from any registration loss. If the debuggee is disabled server, the response will have is_disabled' set to true.", + "request": { + "$ref": "RegisterDebuggeeRequest" + }, + "response": { + "$ref": "RegisterDebuggeeResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud_debugletcontroller" + ] + } + }, + "resources": { + "breakpoints": { + "methods": { + "list": { + "id": "clouddebugger.controller.debuggees.breakpoints.list", + "path": "v2/controller/debuggees/{debuggeeId}/breakpoints", + "httpMethod": "GET", + "description": "Returns the list of all active breakpoints for the specified debuggee. The breakpoint specification (location, condition, and expression fields) is semantically immutable, although the field values may change. For example, an agent may update the location line number to reflect the actual line the breakpoint was set to, but that doesn't change the breakpoint semantics. Thus, an agent does not need to check if a breakpoint has changed when it encounters the same breakpoint on a successive call. Moreover, an agent should remember breakpoints that are complete until the controller removes them from the active list to avoid setting those breakpoints again.", + "parameters": { + "debuggeeId": { + "type": "string", + "description": "Identifies the debuggee.", + "required": true, + "location": "path" + }, + "waitToken": { + "type": "string", + "description": "A wait token that, if specified, blocks the method call until the list of active breakpoints has changed, or a server selected timeout has expired. The value should be set from the last returned response. The error code google.rpc.Code.ABORTED is returned on wait timeout (which does not require the agent to re-register with the server)", + "location": "query" + } + }, + "parameterOrder": [ + "debuggeeId" + ], + "response": { + "$ref": "ListActiveBreakpointsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud_debugletcontroller" + ] + }, + "update": { + "id": "clouddebugger.controller.debuggees.breakpoints.update", + "path": "v2/controller/debuggees/{debuggeeId}/breakpoints/{id}", + "httpMethod": "PUT", + "description": "Updates the breakpoint state or mutable fields. The entire Breakpoint protobuf must be sent back to the controller. Updates to active breakpoint fields are only allowed if the new value does not change the breakpoint specification. Updates to the 'location', 'condition' and 'expression' fields should not alter the breakpoint semantics. They are restricted to changes such as canonicalizing a value or snapping the location to the correct line of code.", + "parameters": { + "debuggeeId": { + "type": "string", + "description": "Identifies the debuggee being debugged.", + "required": true, + "location": "path" + }, + "id": { + "type": "string", + "description": "Breakpoint identifier, unique in the scope of the debuggee.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "debuggeeId", + "id" + ], + "request": { + "$ref": "UpdateActiveBreakpointRequest" + }, + "response": { + "$ref": "UpdateActiveBreakpointResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud_debugletcontroller" + ] + } + } + } + } + } + } + }, + "debugger": { + "resources": { + "debuggees": { + "methods": { + "list": { + "id": "clouddebugger.debugger.debuggees.list", + "path": "v2/debugger/debuggees", + "httpMethod": "GET", + "description": "Lists all the debuggees that the user can set breakpoints to.", + "parameters": { + "project": { + "type": "string", + "description": "Set to the project number of the Google Cloud Platform to list the debuggees that are part of that project.", + "location": "query" + }, + "includeInactive": { + "type": "boolean", + "description": "When set to true the result includes all debuggees, otherwise only debugees that are active.", + "location": "query" + } + }, + "response": { + "$ref": "ListDebuggeesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud_debugger" + ] + } + }, + "resources": { + "breakpoints": { + "methods": { + "set": { + "id": "clouddebugger.debugger.debuggees.breakpoints.set", + "path": "v2/debugger/debuggees/{debuggeeId}/breakpoints/set", + "httpMethod": "POST", + "description": "Sets the breakpoint to the debuggee.", + "parameters": { + "debuggeeId": { + "type": "string", + "description": "The debuggee id to set the breakpoint to.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "debuggeeId" + ], + "request": { + "$ref": "Breakpoint" + }, + "response": { + "$ref": "SetBreakpointResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud_debugger" + ] + }, + "get": { + "id": "clouddebugger.debugger.debuggees.breakpoints.get", + "path": "v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}", + "httpMethod": "GET", + "description": "Gets breakpoint information.", + "parameters": { + "debuggeeId": { + "type": "string", + "description": "The debuggee id to get the breakpoint from.", + "required": true, + "location": "path" + }, + "breakpointId": { + "type": "string", + "description": "The breakpoint to get.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "debuggeeId", + "breakpointId" + ], + "response": { + "$ref": "GetBreakpointResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud_debugger" + ] + }, + "delete": { + "id": "clouddebugger.debugger.debuggees.breakpoints.delete", + "path": "v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}", + "httpMethod": "DELETE", + "description": "Deletes the breakpoint from the debuggee.", + "parameters": { + "debuggeeId": { + "type": "string", + "description": "The debuggee id to delete the breakpoint from.", + "required": true, + "location": "path" + }, + "breakpointId": { + "type": "string", + "description": "The breakpoint to delete.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "debuggeeId", + "breakpointId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud_debugger" + ] + }, + "list": { + "id": "clouddebugger.debugger.debuggees.breakpoints.list", + "path": "v2/debugger/debuggees/{debuggeeId}/breakpoints", + "httpMethod": "GET", + "description": "Lists all breakpoints of the debuggee that the user has access to.", + "parameters": { + "debuggeeId": { + "type": "string", + "description": "The debuggee id to list breakpoint from.", + "required": true, + "location": "path" + }, + "includeAllUsers": { + "type": "boolean", + "description": "When set to true the response includes the list of breakpoints set by any user, otherwise only breakpoints set by the caller.", + "location": "query" + }, + "includeInactive": { + "type": "boolean", + "description": "When set to true the response includes active and inactive breakpoints, otherwise only active breakpoints are returned.", + "location": "query" + }, + "action.value": { + "type": "string", + "description": "Only breakpoints with the specified action will pass the filter.", + "enum": [ + "CAPTURE", + "LOG" + ], + "location": "query" + }, + "stripResults": { + "type": "boolean", + "description": "When set to true the response breakpoints will be stripped of the results fields: stack_frames, evaluated_expressions and variable_table.", + "location": "query" + }, + "waitToken": { + "type": "string", + "description": "A wait token that, if specified, blocks the call until the breakpoints list has changed, or a server selected timeout has expired. The value should be set from the last response to ListBreakpoints. The error code ABORTED is returned on wait timeout, which should be called again with the same wait_token.", + "location": "query" + } + }, + "parameterOrder": [ + "debuggeeId" + ], + "response": { + "$ref": "ListBreakpointsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud_debugger" + ] + } + } + } + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/clouddebugger/v2/clouddebugger-gen.go b/Godeps/_workspace/src/google.golang.org/api/clouddebugger/v2/clouddebugger-gen.go new file mode 100644 index 000000000..23d0639a6 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/clouddebugger/v2/clouddebugger-gen.go @@ -0,0 +1,2126 @@ +// Package clouddebugger provides access to the Google Cloud Debugger API. +// +// See https://cloud.google.com/tools/cloud-debugger +// +// Usage example: +// +// import "google.golang.org/api/clouddebugger/v2" +// ... +// clouddebuggerService, err := clouddebugger.New(oauthHttpClient) +package clouddebugger // import "google.golang.org/api/clouddebugger/v2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "clouddebugger:v2" +const apiName = "clouddebugger" +const apiVersion = "v2" +const basePath = "https://clouddebugger.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your data across Google Cloud Platform services + CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" + + // Manage cloud debugger + CloudDebuggerScope = "https://www.googleapis.com/auth/cloud_debugger" + + // Manage active breakpoints in cloud debugger + CloudDebugletcontrollerScope = "https://www.googleapis.com/auth/cloud_debugletcontroller" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Controller = NewControllerService(s) + s.Debugger = NewDebuggerService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Controller *ControllerService + + Debugger *DebuggerService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewControllerService(s *Service) *ControllerService { + rs := &ControllerService{s: s} + rs.Debuggees = NewControllerDebuggeesService(s) + return rs +} + +type ControllerService struct { + s *Service + + Debuggees *ControllerDebuggeesService +} + +func NewControllerDebuggeesService(s *Service) *ControllerDebuggeesService { + rs := &ControllerDebuggeesService{s: s} + rs.Breakpoints = NewControllerDebuggeesBreakpointsService(s) + return rs +} + +type ControllerDebuggeesService struct { + s *Service + + Breakpoints *ControllerDebuggeesBreakpointsService +} + +func NewControllerDebuggeesBreakpointsService(s *Service) *ControllerDebuggeesBreakpointsService { + rs := &ControllerDebuggeesBreakpointsService{s: s} + return rs +} + +type ControllerDebuggeesBreakpointsService struct { + s *Service +} + +func NewDebuggerService(s *Service) *DebuggerService { + rs := &DebuggerService{s: s} + rs.Debuggees = NewDebuggerDebuggeesService(s) + return rs +} + +type DebuggerService struct { + s *Service + + Debuggees *DebuggerDebuggeesService +} + +func NewDebuggerDebuggeesService(s *Service) *DebuggerDebuggeesService { + rs := &DebuggerDebuggeesService{s: s} + rs.Breakpoints = NewDebuggerDebuggeesBreakpointsService(s) + return rs +} + +type DebuggerDebuggeesService struct { + s *Service + + Breakpoints *DebuggerDebuggeesBreakpointsService +} + +func NewDebuggerDebuggeesBreakpointsService(s *Service) *DebuggerDebuggeesBreakpointsService { + rs := &DebuggerDebuggeesBreakpointsService{s: s} + return rs +} + +type DebuggerDebuggeesBreakpointsService struct { + s *Service +} + +// Breakpoint: Represents the breakpoint specification, status and +// results. +type Breakpoint struct { + // Action: Defines what to do when the breakpoint hits. + // + // Possible values: + // "CAPTURE" + // "LOG" + Action string `json:"action,omitempty"` + + // Condition: A condition to trigger the breakpoint. The condition is a + // compound boolean expression composed using expressions in a + // programming language at the source location. + Condition string `json:"condition,omitempty"` + + // CreateTime: The time this breakpoint was created by the server. The + // value is in seconds resolution. + CreateTime string `json:"createTime,omitempty"` + + // EvaluatedExpressions: The evaluated expressions' values at breakpoint + // time. The evaluated expressions appear in exactly the same order they + // are listed in the 'expressions' field. The 'name' field holds the + // original expression text, the 'value'/'members' field holds the + // result of the evaluated expression. If the expression can not be + // evaluated, an error text is placed in the value field. + EvaluatedExpressions []*Variable `json:"evaluatedExpressions,omitempty"` + + // Expressions: A list of read-only expressions to evaluate at the + // breakpoint location. The expressions are composed using expressions + // in the programming language at the source location. If the breakpoint + // action is "LOG", the evaluated expressions are included in log + // statements. + Expressions []string `json:"expressions,omitempty"` + + // FinalTime: The time this breakpoint was finalized as seen by the + // server. The value is in seconds resolution. + FinalTime string `json:"finalTime,omitempty"` + + // Id: Breakpoint identifier, unique in the scope of the debuggee. + Id string `json:"id,omitempty"` + + // IsFinalState: When true, indicates that this is a final result and + // the breakpoint state will not change from here on. + IsFinalState bool `json:"isFinalState,omitempty"` + + // Location: The breakpoint source location. + Location *SourceLocation `json:"location,omitempty"` + + // LogLevel: Indicates the severity of the log. Only relevant when + // action is "LOG". + // + // Possible values: + // "INFO" + // "WARNING" + // "ERROR" + LogLevel string `json:"logLevel,omitempty"` + + // LogMessageFormat: Only relevant when action is "LOG". Defines the + // message to log when the breakpoint hits. The message may include + // parameter placeholders "$0", "$1", etc. These placeholders will be + // replaced with the evaluated value of the appropriate expression. + // Expressions not referenced in "log_message_format" will not be + // logged. Example: "Poisonous message received, id = $0, count = $1" + // with expressions = [ "message.id", "message.count" ]. + LogMessageFormat string `json:"logMessageFormat,omitempty"` + + // StackFrames: The stack at breakpoint time. + StackFrames []*StackFrame `json:"stackFrames,omitempty"` + + // Status: Breakpoint status. The status includes an error flag and a + // human readable message. This field will usually stay unset. The + // message can be either informational or error. Nevertheless, clients + // should always display the text message back to the user. Error status + // of a breakpoint indicates complete failure. Example (non-final + // state): 'Still loading symbols...' Examples (final state): 'Failed to + // insert breakpoint' referring to breakpoint, 'Field f not found in + // class C' referring to condition, ... + Status *StatusMessage `json:"status,omitempty"` + + // UserEmail: The e-mail of the user that created this breakpoint + UserEmail string `json:"userEmail,omitempty"` + + // VariableTable: The variable_table exists to aid with computation, + // memory and network traffic optimization. It enables storing a + // variable once and reference it from multiple variables, including + // variables stored in the variable_table itself. For example, the + // object 'this', which may appear at many levels of the stack, can have + // all of it's data stored once in this table. The stack frame variables + // then would hold only a reference to it. The variable var_index field + // is an index into this repeated field. The stored objects are nameless + // and get their name from the referencing variable. The effective + // variable is a merge of the referencing veariable and the referenced + // variable. + VariableTable []*Variable `json:"variableTable,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Action") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Breakpoint) MarshalJSON() ([]byte, error) { + type noMethod Breakpoint + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CloudRepoSourceContext: A CloudRepoSourceContext denotes a particular +// revision in a cloud repo (a repo hosted by the Google Cloud +// Platform). +type CloudRepoSourceContext struct { + // AliasName: The name of an alias (branch, tag, etc.). + AliasName string `json:"aliasName,omitempty"` + + // RepoId: The ID of the repo. + RepoId *RepoId `json:"repoId,omitempty"` + + // RevisionId: A revision ID. + RevisionId string `json:"revisionId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AliasName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CloudRepoSourceContext) MarshalJSON() ([]byte, error) { + type noMethod CloudRepoSourceContext + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CloudWorkspaceId: A CloudWorkspaceId is a unique identifier for a +// cloud workspace. A cloud workspace is a place associated with a repo +// where modified files can be stored before they are committed. +type CloudWorkspaceId struct { + // Name: The unique name of the workspace within the repo. This is the + // name chosen by the client in the Source API's CreateWorkspace method. + Name string `json:"name,omitempty"` + + // RepoId: The ID of the repo containing the workspace. + RepoId *RepoId `json:"repoId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CloudWorkspaceId) MarshalJSON() ([]byte, error) { + type noMethod CloudWorkspaceId + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CloudWorkspaceSourceContext: A CloudWorkspaceSourceContext denotes a +// workspace at a particular snapshot. +type CloudWorkspaceSourceContext struct { + // SnapshotId: The ID of the snapshot. An empty snapshot_id refers to + // the most recent snapshot. + SnapshotId string `json:"snapshotId,omitempty"` + + // WorkspaceId: The ID of the workspace. + WorkspaceId *CloudWorkspaceId `json:"workspaceId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "SnapshotId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CloudWorkspaceSourceContext) MarshalJSON() ([]byte, error) { + type noMethod CloudWorkspaceSourceContext + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Debuggee: Represents the application to debug. The application may +// include one or more replicated processes executing the same code. +// Each of these processes is attached with a debugger agent, carrying +// out the debugging commands. The agents attached to the same debuggee +// are identified by using exactly the same fields' values when +// registering. +type Debuggee struct { + // AgentVersion: Version ID of the agent release. The version ID is + // structured as following: "domain/type/vmajor.minor" (for example + // "google.com/gcp-java/v1.1"). + AgentVersion string `json:"agentVersion,omitempty"` + + // Description: A human readable description of the debuggee. + // Recommended to include human readable project name, environment name, + // and version information . + Description string `json:"description,omitempty"` + + // Id: Debuggee unique identifer generated by the server. + Id string `json:"id,omitempty"` + + // IsDisabled: If set to true, indicates that the agent should disable + // itself and detach from the debuggee. + IsDisabled bool `json:"isDisabled,omitempty"` + + // IsInactive: If set to true indicates that the debuggee has not been + // seen by the Controller service in the last active time period + // (defined by the server). + IsInactive bool `json:"isInactive,omitempty"` + + // Labels: A set of custom debuggee properties, populated by the agent, + // to be displayed to the user. + Labels map[string]string `json:"labels,omitempty"` + + // Project: The project the debuggee is associated with. Use the project + // number when registering a Google Cloud Platform project. + Project string `json:"project,omitempty"` + + // SourceContexts: Repository snapshots containing the source code of + // the project. + SourceContexts []*SourceContext `json:"sourceContexts,omitempty"` + + // Status: Human readable message to be displayed to the user about this + // debuggee. Absense of this field indicates no message. The message can + // be either informational or error. + Status *StatusMessage `json:"status,omitempty"` + + // Uniquifier: The debuggee uniqifier within the project. Any string + // that id the application within the project can be used. Recomended to + // include environement and version or build id's. + Uniquifier string `json:"uniquifier,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AgentVersion") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Debuggee) MarshalJSON() ([]byte, error) { + type noMethod Debuggee + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Empty: A generic empty message that you can re-use to avoid defining +// duplicated empty messages in your APIs. A typical example is to use +// it as the request or the response type of an API method. For +// instance: service Foo { rpc Bar(google.protobuf.Empty) returns +// (google.protobuf.Empty); } The JSON representation for `Empty` is +// empty JSON object `{}`. +type Empty struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// FormatMessage: Represents a message with parameters. +type FormatMessage struct { + // Format: Format template of the message. The "format" uses + // placeholders "$0", "$1", etc. to reference parameters. "$$" can be + // used to denote the '$' character. Examples: "Failed to load '$0' + // which helps debug $1 the first time it is loaded. Again, $0 is very + // important." "Please pay $$10 to use $0 instead of $1." + Format string `json:"format,omitempty"` + + // Parameters: Optional parameters to be embedded into the message. + Parameters []string `json:"parameters,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Format") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FormatMessage) MarshalJSON() ([]byte, error) { + type noMethod FormatMessage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GerritSourceContext: A SourceContext referring to a Gerrit project. +type GerritSourceContext struct { + // AliasName: The name of an alias (branch, tag, etc.). + AliasName string `json:"aliasName,omitempty"` + + // GerritProject: The full project name within the host. Projects may be + // nested, so "project/subproject" is a valid project name. The "repo + // name" is hostURI/project. + GerritProject string `json:"gerritProject,omitempty"` + + // HostUri: The URI of a running Gerrit instance. + HostUri string `json:"hostUri,omitempty"` + + // RevisionId: A revision (commit) ID. + RevisionId string `json:"revisionId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AliasName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GerritSourceContext) MarshalJSON() ([]byte, error) { + type noMethod GerritSourceContext + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GetBreakpointResponse: The response of getting breakpoint +// information. +type GetBreakpointResponse struct { + // Breakpoint: The complete breakpoint state. The fields 'id' and + // 'location' are guranteed to be set. + Breakpoint *Breakpoint `json:"breakpoint,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Breakpoint") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GetBreakpointResponse) MarshalJSON() ([]byte, error) { + type noMethod GetBreakpointResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GitSourceContext: A GitSourceContext denotes a particular revision in +// a third party Git repository (e.g. GitHub). +type GitSourceContext struct { + // RevisionId: Git commit hash. required. + RevisionId string `json:"revisionId,omitempty"` + + // Url: Git repository URL. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "RevisionId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GitSourceContext) MarshalJSON() ([]byte, error) { + type noMethod GitSourceContext + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListActiveBreakpointsResponse: The response of listing active +// breakpoints. +type ListActiveBreakpointsResponse struct { + // Breakpoints: List of all active breakpoints. The fields 'id' and + // 'location' are guranteed to be set on each breakpoint. + Breakpoints []*Breakpoint `json:"breakpoints,omitempty"` + + // NextWaitToken: A wait token that can be used in the next method call + // to block until the list of breakpoints changes. + NextWaitToken string `json:"nextWaitToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Breakpoints") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListActiveBreakpointsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListActiveBreakpointsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListBreakpointsResponse: The response of listing breakpoints. +type ListBreakpointsResponse struct { + // Breakpoints: List of all breakpoints with complete state. The fields + // 'id' and 'location' are guranteed to be set on each breakpoint. + Breakpoints []*Breakpoint `json:"breakpoints,omitempty"` + + // NextWaitToken: A wait token that can be used in the next call to + // ListBreakpoints to block until the list of breakpoints has changes. + NextWaitToken string `json:"nextWaitToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Breakpoints") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListBreakpointsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListBreakpointsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListDebuggeesResponse: The response of listing debuggees. +type ListDebuggeesResponse struct { + // Debuggees: The list of debuggees accessible to the calling user. Note + // that the description field is the only human readable field that + // should be displayed to the user. The fields 'debuggee.id' and + // 'description' are guranteed to be set on each debuggee. + Debuggees []*Debuggee `json:"debuggees,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Debuggees") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListDebuggeesResponse) MarshalJSON() ([]byte, error) { + type noMethod ListDebuggeesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ProjectRepoId: Selects a repo using a Google Cloud Platform project +// ID (e.g. winged-cargo-31) and a repo name within that project. +type ProjectRepoId struct { + // ProjectId: The ID of the project. + ProjectId string `json:"projectId,omitempty"` + + // RepoName: The name of the repo. Leave empty for the default repo. + RepoName string `json:"repoName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ProjectId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProjectRepoId) MarshalJSON() ([]byte, error) { + type noMethod ProjectRepoId + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RegisterDebuggeeRequest: The request to register a debuggee. +type RegisterDebuggeeRequest struct { + // Debuggee: The debuggee information to register. The fields 'project', + // 'uniquifier', 'description' and 'agent_version' of the debuggee must + // be set. + Debuggee *Debuggee `json:"debuggee,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Debuggee") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RegisterDebuggeeRequest) MarshalJSON() ([]byte, error) { + type noMethod RegisterDebuggeeRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RegisterDebuggeeResponse: The response of registering a debuggee. +type RegisterDebuggeeResponse struct { + // Debuggee: The debuggee resource. The field 'id' is guranteed to be + // set (in addition to the echoed fields). + Debuggee *Debuggee `json:"debuggee,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Debuggee") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RegisterDebuggeeResponse) MarshalJSON() ([]byte, error) { + type noMethod RegisterDebuggeeResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RepoId: A unique identifier for a cloud repo. +type RepoId struct { + // ProjectRepoId: A combination of a project ID and a repo name. + ProjectRepoId *ProjectRepoId `json:"projectRepoId,omitempty"` + + // Uid: A server-assigned, globally unique identifier. + Uid string `json:"uid,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ProjectRepoId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RepoId) MarshalJSON() ([]byte, error) { + type noMethod RepoId + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SetBreakpointResponse: The response of setting a breakpoint. +type SetBreakpointResponse struct { + // Breakpoint: The breakpoint resource. The field 'id' is guranteed to + // be set (in addition to the echoed fileds). + Breakpoint *Breakpoint `json:"breakpoint,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Breakpoint") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SetBreakpointResponse) MarshalJSON() ([]byte, error) { + type noMethod SetBreakpointResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SourceContext: A SourceContext is a reference to a tree of files. A +// SourceContext together with a path point to a unique revision of a +// single file or directory. +type SourceContext struct { + // CloudRepo: A SourceContext referring to a revision in a cloud repo. + CloudRepo *CloudRepoSourceContext `json:"cloudRepo,omitempty"` + + // CloudWorkspace: A SourceContext referring to a snapshot in a cloud + // workspace. + CloudWorkspace *CloudWorkspaceSourceContext `json:"cloudWorkspace,omitempty"` + + // Gerrit: A SourceContext referring to a Gerrit project. + Gerrit *GerritSourceContext `json:"gerrit,omitempty"` + + // Git: A SourceContext referring to any third party Git repo (e.g. + // GitHub). + Git *GitSourceContext `json:"git,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CloudRepo") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SourceContext) MarshalJSON() ([]byte, error) { + type noMethod SourceContext + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SourceLocation: Represents a location in the source code. +type SourceLocation struct { + // Line: The line inside the file (first line value is '1'). + Line int64 `json:"line,omitempty"` + + // Path: A path to the source file within the source context of the + // target binary. + Path string `json:"path,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Line") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SourceLocation) MarshalJSON() ([]byte, error) { + type noMethod SourceLocation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// StackFrame: Represents a stack frame context. +type StackFrame struct { + // Arguments: The set of arguments passed to this function Note that + // this might not be populated for all stack frames. + Arguments []*Variable `json:"arguments,omitempty"` + + // Function: The unmangled function name at the call site. + Function string `json:"function,omitempty"` + + // Locals: The set of local variables at the stack frame location. Note + // that this might not be populated for all stack frames. + Locals []*Variable `json:"locals,omitempty"` + + // Location: The source location of the call site. + Location *SourceLocation `json:"location,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Arguments") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *StackFrame) MarshalJSON() ([]byte, error) { + type noMethod StackFrame + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// StatusMessage: Represents a contextual status message. The message +// can indicate an error or informational status, and refer to specific +// parts of the containing object. For example, the Breakpoint.status +// field can indicate an error referring to the +// BREAKPOINT_SOURCE_LOCATION with the message "Location not found". +type StatusMessage struct { + // Description: Status message text. + Description *FormatMessage `json:"description,omitempty"` + + // IsError: Distinguishes errors from informational messages. + IsError bool `json:"isError,omitempty"` + + // RefersTo: Reference to which the message applies. + // + // Possible values: + // "UNSPECIFIED" + // "BREAKPOINT_SOURCE_LOCATION" + // "BREAKPOINT_CONDITION" + // "BREAKPOINT_EXPRESSION" + // "VARIABLE_NAME" + // "VARIABLE_VALUE" + RefersTo string `json:"refersTo,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *StatusMessage) MarshalJSON() ([]byte, error) { + type noMethod StatusMessage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UpdateActiveBreakpointRequest: The request to update an active +// breakpoint. +type UpdateActiveBreakpointRequest struct { + // Breakpoint: The updated breakpoint information. The field 'id' must + // be set. + Breakpoint *Breakpoint `json:"breakpoint,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Breakpoint") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UpdateActiveBreakpointRequest) MarshalJSON() ([]byte, error) { + type noMethod UpdateActiveBreakpointRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UpdateActiveBreakpointResponse: The response of updating an active +// breakpoint. The message is defined to allow future extensions. +type UpdateActiveBreakpointResponse struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// Variable: Represents a variable or an argument possibly of a compound +// object type. 1. A simple variable such as, int x = 5 is represented +// as: { name: "x", value: "5" } 2. A compound object such as, struct T +// { int m1; int m2; }; T x = { 3, 7 }; is represented as: { name: "x", +// members { name: "m1", value: "3" }, members { name: "m2", value: "7" +// } } 3. A pointer where the pointee was captured such as, T x = { 3, 7 +// }; T* p = &x; is represented as: { name: "p", value: "0x00500500", +// members { name: "m1", value: "3" }, members { name: "m2", value: "7" +// } } 4. A pointer where the pointee was not captured or is +// inaccessible such as, T* p = new T; is represented as: { name: "p", +// value: "0x00400400", members { value: "" } } the value text should +// decribe the reason for the missing value. such as , , +// . note that a null pointer should not have members. 5. An unnamed +// value such as, int* p = new int(7); is represented as, { name: "p", +// value: "0x00500500", members { value: "7" } } 6. An unnamed pointer +// where the pointee was not captured such as, int* p = new int(7); +// int** pp = &p; is represented as: { name: "pp", value: "0x00500500", +// members { value: "0x00400400", members { value: "" } } } To optimize +// computation, memory and network traffic, variables that repeat in the +// output multiple times can be stored once in a shared variable table +// and be referenced using the var_index field. The variables stored in +// the shared table are nameless and are essentially a partition of the +// complete variable. To reconstruct the complete variable merge the +// referencing variable with the referenced variable. When using the +// shared variable table, variables can be represented as: T x = { 3, 7 +// }; T* p = &x; T& r = x; are represented as, { name: "x", var_index: 3 +// } { name: "p", value "0x00500500", var_index: 3 } { name: "r", +// var_index: 3 } with shared variable table entry #3: { members { name: +// "m1", value: "3" }, members { name: "m2", value: "7" } } Note that +// the pointer address is stored with the referencing variable and not +// with the referenced variable, to allow the referenced variable to be +// shared between pointer and references. +type Variable struct { + // Members: The members contained or pointed to by the variable. + Members []*Variable `json:"members,omitempty"` + + // Name: The name of the variable, if any. + Name string `json:"name,omitempty"` + + // Status: Status associated with the variable. This field will usually + // stay unset. A status of a single variable only applies to that + // variable or expression. The rest of breakpoint data still remains + // valid. Variables might be reported in error state even when + // breakpoint is not in final state. The message may refer to variable + // name with "refers_to" set to "VARIABLE_NAME". Alternatively + // "refers_to" will be set to "VARIABLE_VALUE". In either case variable + // value and members will be unset. Example of error message applied to + // name: "Invalid expression syntax". Example of information message + // applied to value: "Not captured". Examples of error message applied + // to value: "Malformed string", "Field f not found in class C", "Null + // pointer dereference". + Status *StatusMessage `json:"status,omitempty"` + + // Value: The simple value of the variable. + Value string `json:"value,omitempty"` + + // VarTableIndex: This is a reference to a variable in the shared + // variable table. More than one variable can reference the same + // variable in the table. The var_index field is an index into + // variable_table in Breakpoint. + VarTableIndex int64 `json:"varTableIndex,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Members") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Variable) MarshalJSON() ([]byte, error) { + type noMethod Variable + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "clouddebugger.controller.debuggees.register": + +type ControllerDebuggeesRegisterCall struct { + s *Service + registerdebuggeerequest *RegisterDebuggeeRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Register: Registers the debuggee with the controller. All agents +// should call this API with the same request content to get back the +// same stable 'debuggee_id'. Agents should call this API again whenever +// ListActiveBreakpoints or UpdateActiveBreakpoint return the error +// google.rpc.Code.NOT_FOUND. It allows the server to disable the agent +// or recover from any registration loss. If the debuggee is disabled +// server, the response will have is_disabled' set to true. +func (r *ControllerDebuggeesService) Register(registerdebuggeerequest *RegisterDebuggeeRequest) *ControllerDebuggeesRegisterCall { + c := &ControllerDebuggeesRegisterCall{s: r.s, opt_: make(map[string]interface{})} + c.registerdebuggeerequest = registerdebuggeerequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ControllerDebuggeesRegisterCall) Fields(s ...googleapi.Field) *ControllerDebuggeesRegisterCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ControllerDebuggeesRegisterCall) Context(ctx context.Context) *ControllerDebuggeesRegisterCall { + c.ctx_ = ctx + return c +} + +func (c *ControllerDebuggeesRegisterCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.registerdebuggeerequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/controller/debuggees/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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouddebugger.controller.debuggees.register" call. +// Exactly one of *RegisterDebuggeeResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *RegisterDebuggeeResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ControllerDebuggeesRegisterCall) Do() (*RegisterDebuggeeResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RegisterDebuggeeResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Registers the debuggee with the controller. All agents should call this API with the same request content to get back the same stable 'debuggee_id'. Agents should call this API again whenever ListActiveBreakpoints or UpdateActiveBreakpoint return the error google.rpc.Code.NOT_FOUND. It allows the server to disable the agent or recover from any registration loss. If the debuggee is disabled server, the response will have is_disabled' set to true.", + // "httpMethod": "POST", + // "id": "clouddebugger.controller.debuggees.register", + // "path": "v2/controller/debuggees/register", + // "request": { + // "$ref": "RegisterDebuggeeRequest" + // }, + // "response": { + // "$ref": "RegisterDebuggeeResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud_debugletcontroller" + // ] + // } + +} + +// method id "clouddebugger.controller.debuggees.breakpoints.list": + +type ControllerDebuggeesBreakpointsListCall struct { + s *Service + debuggeeId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Returns the list of all active breakpoints for the specified +// debuggee. The breakpoint specification (location, condition, and +// expression fields) is semantically immutable, although the field +// values may change. For example, an agent may update the location line +// number to reflect the actual line the breakpoint was set to, but that +// doesn't change the breakpoint semantics. Thus, an agent does not need +// to check if a breakpoint has changed when it encounters the same +// breakpoint on a successive call. Moreover, an agent should remember +// breakpoints that are complete until the controller removes them from +// the active list to avoid setting those breakpoints again. +func (r *ControllerDebuggeesBreakpointsService) List(debuggeeId string) *ControllerDebuggeesBreakpointsListCall { + c := &ControllerDebuggeesBreakpointsListCall{s: r.s, opt_: make(map[string]interface{})} + c.debuggeeId = debuggeeId + return c +} + +// WaitToken sets the optional parameter "waitToken": A wait token that, +// if specified, blocks the method call until the list of active +// breakpoints has changed, or a server selected timeout has expired. +// The value should be set from the last returned response. The error +// code google.rpc.Code.ABORTED is returned on wait timeout (which does +// not require the agent to re-register with the server) +func (c *ControllerDebuggeesBreakpointsListCall) WaitToken(waitToken string) *ControllerDebuggeesBreakpointsListCall { + c.opt_["waitToken"] = waitToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ControllerDebuggeesBreakpointsListCall) Fields(s ...googleapi.Field) *ControllerDebuggeesBreakpointsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ControllerDebuggeesBreakpointsListCall) IfNoneMatch(entityTag string) *ControllerDebuggeesBreakpointsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ControllerDebuggeesBreakpointsListCall) Context(ctx context.Context) *ControllerDebuggeesBreakpointsListCall { + c.ctx_ = ctx + return c +} + +func (c *ControllerDebuggeesBreakpointsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["waitToken"]; ok { + params.Set("waitToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/controller/debuggees/{debuggeeId}/breakpoints") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "debuggeeId": c.debuggeeId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouddebugger.controller.debuggees.breakpoints.list" call. +// Exactly one of *ListActiveBreakpointsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListActiveBreakpointsResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ControllerDebuggeesBreakpointsListCall) Do() (*ListActiveBreakpointsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListActiveBreakpointsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the list of all active breakpoints for the specified debuggee. The breakpoint specification (location, condition, and expression fields) is semantically immutable, although the field values may change. For example, an agent may update the location line number to reflect the actual line the breakpoint was set to, but that doesn't change the breakpoint semantics. Thus, an agent does not need to check if a breakpoint has changed when it encounters the same breakpoint on a successive call. Moreover, an agent should remember breakpoints that are complete until the controller removes them from the active list to avoid setting those breakpoints again.", + // "httpMethod": "GET", + // "id": "clouddebugger.controller.debuggees.breakpoints.list", + // "parameterOrder": [ + // "debuggeeId" + // ], + // "parameters": { + // "debuggeeId": { + // "description": "Identifies the debuggee.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "waitToken": { + // "description": "A wait token that, if specified, blocks the method call until the list of active breakpoints has changed, or a server selected timeout has expired. The value should be set from the last returned response. The error code google.rpc.Code.ABORTED is returned on wait timeout (which does not require the agent to re-register with the server)", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/controller/debuggees/{debuggeeId}/breakpoints", + // "response": { + // "$ref": "ListActiveBreakpointsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud_debugletcontroller" + // ] + // } + +} + +// method id "clouddebugger.controller.debuggees.breakpoints.update": + +type ControllerDebuggeesBreakpointsUpdateCall struct { + s *Service + debuggeeId string + id string + updateactivebreakpointrequest *UpdateActiveBreakpointRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates the breakpoint state or mutable fields. The entire +// Breakpoint protobuf must be sent back to the controller. Updates to +// active breakpoint fields are only allowed if the new value does not +// change the breakpoint specification. Updates to the 'location', +// 'condition' and 'expression' fields should not alter the breakpoint +// semantics. They are restricted to changes such as canonicalizing a +// value or snapping the location to the correct line of code. +func (r *ControllerDebuggeesBreakpointsService) Update(debuggeeId string, id string, updateactivebreakpointrequest *UpdateActiveBreakpointRequest) *ControllerDebuggeesBreakpointsUpdateCall { + c := &ControllerDebuggeesBreakpointsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.debuggeeId = debuggeeId + c.id = id + c.updateactivebreakpointrequest = updateactivebreakpointrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ControllerDebuggeesBreakpointsUpdateCall) Fields(s ...googleapi.Field) *ControllerDebuggeesBreakpointsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ControllerDebuggeesBreakpointsUpdateCall) Context(ctx context.Context) *ControllerDebuggeesBreakpointsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ControllerDebuggeesBreakpointsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateactivebreakpointrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/controller/debuggees/{debuggeeId}/breakpoints/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "debuggeeId": c.debuggeeId, + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouddebugger.controller.debuggees.breakpoints.update" call. +// Exactly one of *UpdateActiveBreakpointResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *UpdateActiveBreakpointResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ControllerDebuggeesBreakpointsUpdateCall) Do() (*UpdateActiveBreakpointResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UpdateActiveBreakpointResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the breakpoint state or mutable fields. The entire Breakpoint protobuf must be sent back to the controller. Updates to active breakpoint fields are only allowed if the new value does not change the breakpoint specification. Updates to the 'location', 'condition' and 'expression' fields should not alter the breakpoint semantics. They are restricted to changes such as canonicalizing a value or snapping the location to the correct line of code.", + // "httpMethod": "PUT", + // "id": "clouddebugger.controller.debuggees.breakpoints.update", + // "parameterOrder": [ + // "debuggeeId", + // "id" + // ], + // "parameters": { + // "debuggeeId": { + // "description": "Identifies the debuggee being debugged.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "id": { + // "description": "Breakpoint identifier, unique in the scope of the debuggee.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/controller/debuggees/{debuggeeId}/breakpoints/{id}", + // "request": { + // "$ref": "UpdateActiveBreakpointRequest" + // }, + // "response": { + // "$ref": "UpdateActiveBreakpointResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud_debugletcontroller" + // ] + // } + +} + +// method id "clouddebugger.debugger.debuggees.list": + +type DebuggerDebuggeesListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all the debuggees that the user can set breakpoints to. +func (r *DebuggerDebuggeesService) List() *DebuggerDebuggeesListCall { + c := &DebuggerDebuggeesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// IncludeInactive sets the optional parameter "includeInactive": When +// set to true the result includes all debuggees, otherwise only +// debugees that are active. +func (c *DebuggerDebuggeesListCall) IncludeInactive(includeInactive bool) *DebuggerDebuggeesListCall { + c.opt_["includeInactive"] = includeInactive + return c +} + +// Project sets the optional parameter "project": Set to the project +// number of the Google Cloud Platform to list the debuggees that are +// part of that project. +func (c *DebuggerDebuggeesListCall) Project(project string) *DebuggerDebuggeesListCall { + c.opt_["project"] = project + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DebuggerDebuggeesListCall) Fields(s ...googleapi.Field) *DebuggerDebuggeesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DebuggerDebuggeesListCall) IfNoneMatch(entityTag string) *DebuggerDebuggeesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DebuggerDebuggeesListCall) Context(ctx context.Context) *DebuggerDebuggeesListCall { + c.ctx_ = ctx + return c +} + +func (c *DebuggerDebuggeesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["includeInactive"]; ok { + params.Set("includeInactive", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["project"]; ok { + params.Set("project", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/debugger/debuggees") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouddebugger.debugger.debuggees.list" call. +// Exactly one of *ListDebuggeesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListDebuggeesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DebuggerDebuggeesListCall) Do() (*ListDebuggeesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListDebuggeesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all the debuggees that the user can set breakpoints to.", + // "httpMethod": "GET", + // "id": "clouddebugger.debugger.debuggees.list", + // "parameters": { + // "includeInactive": { + // "description": "When set to true the result includes all debuggees, otherwise only debugees that are active.", + // "location": "query", + // "type": "boolean" + // }, + // "project": { + // "description": "Set to the project number of the Google Cloud Platform to list the debuggees that are part of that project.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/debugger/debuggees", + // "response": { + // "$ref": "ListDebuggeesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud_debugger" + // ] + // } + +} + +// method id "clouddebugger.debugger.debuggees.breakpoints.delete": + +type DebuggerDebuggeesBreakpointsDeleteCall struct { + s *Service + debuggeeId string + breakpointId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the breakpoint from the debuggee. +func (r *DebuggerDebuggeesBreakpointsService) Delete(debuggeeId string, breakpointId string) *DebuggerDebuggeesBreakpointsDeleteCall { + c := &DebuggerDebuggeesBreakpointsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.debuggeeId = debuggeeId + c.breakpointId = breakpointId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DebuggerDebuggeesBreakpointsDeleteCall) Fields(s ...googleapi.Field) *DebuggerDebuggeesBreakpointsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DebuggerDebuggeesBreakpointsDeleteCall) Context(ctx context.Context) *DebuggerDebuggeesBreakpointsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *DebuggerDebuggeesBreakpointsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "debuggeeId": c.debuggeeId, + "breakpointId": c.breakpointId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouddebugger.debugger.debuggees.breakpoints.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *DebuggerDebuggeesBreakpointsDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the breakpoint from the debuggee.", + // "httpMethod": "DELETE", + // "id": "clouddebugger.debugger.debuggees.breakpoints.delete", + // "parameterOrder": [ + // "debuggeeId", + // "breakpointId" + // ], + // "parameters": { + // "breakpointId": { + // "description": "The breakpoint to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "debuggeeId": { + // "description": "The debuggee id to delete the breakpoint from.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud_debugger" + // ] + // } + +} + +// method id "clouddebugger.debugger.debuggees.breakpoints.get": + +type DebuggerDebuggeesBreakpointsGetCall struct { + s *Service + debuggeeId string + breakpointId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets breakpoint information. +func (r *DebuggerDebuggeesBreakpointsService) Get(debuggeeId string, breakpointId string) *DebuggerDebuggeesBreakpointsGetCall { + c := &DebuggerDebuggeesBreakpointsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.debuggeeId = debuggeeId + c.breakpointId = breakpointId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DebuggerDebuggeesBreakpointsGetCall) Fields(s ...googleapi.Field) *DebuggerDebuggeesBreakpointsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DebuggerDebuggeesBreakpointsGetCall) IfNoneMatch(entityTag string) *DebuggerDebuggeesBreakpointsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DebuggerDebuggeesBreakpointsGetCall) Context(ctx context.Context) *DebuggerDebuggeesBreakpointsGetCall { + c.ctx_ = ctx + return c +} + +func (c *DebuggerDebuggeesBreakpointsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "debuggeeId": c.debuggeeId, + "breakpointId": c.breakpointId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouddebugger.debugger.debuggees.breakpoints.get" call. +// Exactly one of *GetBreakpointResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GetBreakpointResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DebuggerDebuggeesBreakpointsGetCall) Do() (*GetBreakpointResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &GetBreakpointResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets breakpoint information.", + // "httpMethod": "GET", + // "id": "clouddebugger.debugger.debuggees.breakpoints.get", + // "parameterOrder": [ + // "debuggeeId", + // "breakpointId" + // ], + // "parameters": { + // "breakpointId": { + // "description": "The breakpoint to get.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "debuggeeId": { + // "description": "The debuggee id to get the breakpoint from.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}", + // "response": { + // "$ref": "GetBreakpointResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud_debugger" + // ] + // } + +} + +// method id "clouddebugger.debugger.debuggees.breakpoints.list": + +type DebuggerDebuggeesBreakpointsListCall struct { + s *Service + debuggeeId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all breakpoints of the debuggee that the user has access +// to. +func (r *DebuggerDebuggeesBreakpointsService) List(debuggeeId string) *DebuggerDebuggeesBreakpointsListCall { + c := &DebuggerDebuggeesBreakpointsListCall{s: r.s, opt_: make(map[string]interface{})} + c.debuggeeId = debuggeeId + return c +} + +// ActionValue sets the optional parameter "action.value": Only +// breakpoints with the specified action will pass the filter. +// +// Possible values: +// "CAPTURE" +// "LOG" +func (c *DebuggerDebuggeesBreakpointsListCall) ActionValue(actionValue string) *DebuggerDebuggeesBreakpointsListCall { + c.opt_["action.value"] = actionValue + return c +} + +// IncludeAllUsers sets the optional parameter "includeAllUsers": When +// set to true the response includes the list of breakpoints set by any +// user, otherwise only breakpoints set by the caller. +func (c *DebuggerDebuggeesBreakpointsListCall) IncludeAllUsers(includeAllUsers bool) *DebuggerDebuggeesBreakpointsListCall { + c.opt_["includeAllUsers"] = includeAllUsers + return c +} + +// IncludeInactive sets the optional parameter "includeInactive": When +// set to true the response includes active and inactive breakpoints, +// otherwise only active breakpoints are returned. +func (c *DebuggerDebuggeesBreakpointsListCall) IncludeInactive(includeInactive bool) *DebuggerDebuggeesBreakpointsListCall { + c.opt_["includeInactive"] = includeInactive + return c +} + +// StripResults sets the optional parameter "stripResults": When set to +// true the response breakpoints will be stripped of the results fields: +// stack_frames, evaluated_expressions and variable_table. +func (c *DebuggerDebuggeesBreakpointsListCall) StripResults(stripResults bool) *DebuggerDebuggeesBreakpointsListCall { + c.opt_["stripResults"] = stripResults + return c +} + +// WaitToken sets the optional parameter "waitToken": A wait token that, +// if specified, blocks the call until the breakpoints list has changed, +// or a server selected timeout has expired. The value should be set +// from the last response to ListBreakpoints. The error code ABORTED is +// returned on wait timeout, which should be called again with the same +// wait_token. +func (c *DebuggerDebuggeesBreakpointsListCall) WaitToken(waitToken string) *DebuggerDebuggeesBreakpointsListCall { + c.opt_["waitToken"] = waitToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DebuggerDebuggeesBreakpointsListCall) Fields(s ...googleapi.Field) *DebuggerDebuggeesBreakpointsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DebuggerDebuggeesBreakpointsListCall) IfNoneMatch(entityTag string) *DebuggerDebuggeesBreakpointsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DebuggerDebuggeesBreakpointsListCall) Context(ctx context.Context) *DebuggerDebuggeesBreakpointsListCall { + c.ctx_ = ctx + return c +} + +func (c *DebuggerDebuggeesBreakpointsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["action.value"]; ok { + params.Set("action.value", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["includeAllUsers"]; ok { + params.Set("includeAllUsers", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["includeInactive"]; ok { + params.Set("includeInactive", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["stripResults"]; ok { + params.Set("stripResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["waitToken"]; ok { + params.Set("waitToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/debugger/debuggees/{debuggeeId}/breakpoints") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "debuggeeId": c.debuggeeId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouddebugger.debugger.debuggees.breakpoints.list" call. +// Exactly one of *ListBreakpointsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListBreakpointsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DebuggerDebuggeesBreakpointsListCall) Do() (*ListBreakpointsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListBreakpointsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all breakpoints of the debuggee that the user has access to.", + // "httpMethod": "GET", + // "id": "clouddebugger.debugger.debuggees.breakpoints.list", + // "parameterOrder": [ + // "debuggeeId" + // ], + // "parameters": { + // "action.value": { + // "description": "Only breakpoints with the specified action will pass the filter.", + // "enum": [ + // "CAPTURE", + // "LOG" + // ], + // "location": "query", + // "type": "string" + // }, + // "debuggeeId": { + // "description": "The debuggee id to list breakpoint from.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "includeAllUsers": { + // "description": "When set to true the response includes the list of breakpoints set by any user, otherwise only breakpoints set by the caller.", + // "location": "query", + // "type": "boolean" + // }, + // "includeInactive": { + // "description": "When set to true the response includes active and inactive breakpoints, otherwise only active breakpoints are returned.", + // "location": "query", + // "type": "boolean" + // }, + // "stripResults": { + // "description": "When set to true the response breakpoints will be stripped of the results fields: stack_frames, evaluated_expressions and variable_table.", + // "location": "query", + // "type": "boolean" + // }, + // "waitToken": { + // "description": "A wait token that, if specified, blocks the call until the breakpoints list has changed, or a server selected timeout has expired. The value should be set from the last response to ListBreakpoints. The error code ABORTED is returned on wait timeout, which should be called again with the same wait_token.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/debugger/debuggees/{debuggeeId}/breakpoints", + // "response": { + // "$ref": "ListBreakpointsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud_debugger" + // ] + // } + +} + +// method id "clouddebugger.debugger.debuggees.breakpoints.set": + +type DebuggerDebuggeesBreakpointsSetCall struct { + s *Service + debuggeeId string + breakpoint *Breakpoint + opt_ map[string]interface{} + ctx_ context.Context +} + +// Set: Sets the breakpoint to the debuggee. +func (r *DebuggerDebuggeesBreakpointsService) Set(debuggeeId string, breakpoint *Breakpoint) *DebuggerDebuggeesBreakpointsSetCall { + c := &DebuggerDebuggeesBreakpointsSetCall{s: r.s, opt_: make(map[string]interface{})} + c.debuggeeId = debuggeeId + c.breakpoint = breakpoint + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DebuggerDebuggeesBreakpointsSetCall) Fields(s ...googleapi.Field) *DebuggerDebuggeesBreakpointsSetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DebuggerDebuggeesBreakpointsSetCall) Context(ctx context.Context) *DebuggerDebuggeesBreakpointsSetCall { + c.ctx_ = ctx + return c +} + +func (c *DebuggerDebuggeesBreakpointsSetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.breakpoint) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/debugger/debuggees/{debuggeeId}/breakpoints/set") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "debuggeeId": c.debuggeeId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouddebugger.debugger.debuggees.breakpoints.set" call. +// Exactly one of *SetBreakpointResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SetBreakpointResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DebuggerDebuggeesBreakpointsSetCall) Do() (*SetBreakpointResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SetBreakpointResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the breakpoint to the debuggee.", + // "httpMethod": "POST", + // "id": "clouddebugger.debugger.debuggees.breakpoints.set", + // "parameterOrder": [ + // "debuggeeId" + // ], + // "parameters": { + // "debuggeeId": { + // "description": "The debuggee id to set the breakpoint to.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/debugger/debuggees/{debuggeeId}/breakpoints/set", + // "request": { + // "$ref": "Breakpoint" + // }, + // "response": { + // "$ref": "SetBreakpointResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud_debugger" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/cloudlatencytest/v2/cloudlatencytest-api.json b/Godeps/_workspace/src/google.golang.org/api/cloudlatencytest/v2/cloudlatencytest-api.json new file mode 100644 index 000000000..3f0f1a08b --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/cloudlatencytest/v2/cloudlatencytest-api.json @@ -0,0 +1,212 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/qJOZypus2JZqrrIOB0BaiZ76VFY\"", + "discoveryVersion": "v1", + "id": "cloudlatencytest:v2", + "name": "cloudlatencytest", + "version": "v2", + "revision": "20150206", + "title": "Google Cloud Network Performance Monitoring API", + "description": "A Test API to report latency data.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "", + "protocol": "rest", + "baseUrl": "https://cloudlatencytest-pa.googleapis.com/v2/statscollection/", + "basePath": "/v2/statscollection/", + "rootUrl": "https://cloudlatencytest-pa.googleapis.com/", + "servicePath": "v2/statscollection/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json" + ], + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.", + "location": "query" + }, + "userIp": { + "type": "string", + "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.", + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/monitoring.readonly": { + "description": "View monitoring data for all of your Google Cloud and API projects" + } + } + } + }, + "schemas": { + "AggregatedStats": { + "id": "AggregatedStats", + "type": "object", + "properties": { + "stats": { + "type": "array", + "items": { + "$ref": "Stats" + } + } + } + }, + "AggregatedStatsReply": { + "id": "AggregatedStatsReply", + "type": "object", + "properties": { + "testValue": { + "type": "string" + } + } + }, + "DoubleValue": { + "id": "DoubleValue", + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "number", + "format": "float" + } + } + }, + "IntValue": { + "id": "IntValue", + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "string", + "format": "int64" + } + } + }, + "Stats": { + "id": "Stats", + "type": "object", + "properties": { + "doubleValues": { + "type": "array", + "items": { + "$ref": "DoubleValue" + } + }, + "intValues": { + "type": "array", + "items": { + "$ref": "IntValue" + } + }, + "stringValues": { + "type": "array", + "items": { + "$ref": "StringValue" + } + }, + "time": { + "type": "number", + "format": "double" + } + } + }, + "StatsReply": { + "id": "StatsReply", + "type": "object", + "properties": { + "testValue": { + "type": "string" + } + } + }, + "StringValue": { + "id": "StringValue", + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, + "resources": { + "statscollection": { + "methods": { + "updateaggregatedstats": { + "id": "cloudlatencytest.statscollection.updateaggregatedstats", + "path": "updateaggregatedstats", + "httpMethod": "POST", + "description": "RPC to update the new TCP stats.", + "request": { + "$ref": "AggregatedStats" + }, + "response": { + "$ref": "AggregatedStatsReply" + }, + "scopes": [ + "https://www.googleapis.com/auth/monitoring.readonly" + ] + }, + "updatestats": { + "id": "cloudlatencytest.statscollection.updatestats", + "path": "updatestats", + "httpMethod": "POST", + "description": "RPC to update the new TCP stats.", + "request": { + "$ref": "Stats" + }, + "response": { + "$ref": "StatsReply" + }, + "scopes": [ + "https://www.googleapis.com/auth/monitoring.readonly" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/cloudlatencytest/v2/cloudlatencytest-gen.go b/Godeps/_workspace/src/google.golang.org/api/cloudlatencytest/v2/cloudlatencytest-gen.go new file mode 100644 index 000000000..7f1efde44 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/cloudlatencytest/v2/cloudlatencytest-gen.go @@ -0,0 +1,447 @@ +// Package cloudlatencytest provides access to the Google Cloud Network Performance Monitoring API. +// +// Usage example: +// +// import "google.golang.org/api/cloudlatencytest/v2" +// ... +// cloudlatencytestService, err := cloudlatencytest.New(oauthHttpClient) +package cloudlatencytest // import "google.golang.org/api/cloudlatencytest/v2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "cloudlatencytest:v2" +const apiName = "cloudlatencytest" +const apiVersion = "v2" +const basePath = "https://cloudlatencytest-pa.googleapis.com/v2/statscollection/" + +// OAuth2 scopes used by this API. +const ( + // View monitoring data for all of your Google Cloud and API projects + MonitoringReadonlyScope = "https://www.googleapis.com/auth/monitoring.readonly" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Statscollection = NewStatscollectionService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Statscollection *StatscollectionService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewStatscollectionService(s *Service) *StatscollectionService { + rs := &StatscollectionService{s: s} + return rs +} + +type StatscollectionService struct { + s *Service +} + +type AggregatedStats struct { + Stats []*Stats `json:"stats,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Stats") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AggregatedStats) MarshalJSON() ([]byte, error) { + type noMethod AggregatedStats + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AggregatedStatsReply struct { + TestValue string `json:"testValue,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "TestValue") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AggregatedStatsReply) MarshalJSON() ([]byte, error) { + type noMethod AggregatedStatsReply + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DoubleValue struct { + Label string `json:"label,omitempty"` + + Value float64 `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Label") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DoubleValue) MarshalJSON() ([]byte, error) { + type noMethod DoubleValue + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type IntValue struct { + Label string `json:"label,omitempty"` + + Value int64 `json:"value,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Label") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *IntValue) MarshalJSON() ([]byte, error) { + type noMethod IntValue + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Stats struct { + DoubleValues []*DoubleValue `json:"doubleValues,omitempty"` + + IntValues []*IntValue `json:"intValues,omitempty"` + + StringValues []*StringValue `json:"stringValues,omitempty"` + + Time float64 `json:"time,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DoubleValues") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Stats) MarshalJSON() ([]byte, error) { + type noMethod Stats + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type StatsReply struct { + TestValue string `json:"testValue,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "TestValue") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *StatsReply) MarshalJSON() ([]byte, error) { + type noMethod StatsReply + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type StringValue struct { + Label string `json:"label,omitempty"` + + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Label") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *StringValue) MarshalJSON() ([]byte, error) { + type noMethod StringValue + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "cloudlatencytest.statscollection.updateaggregatedstats": + +type StatscollectionUpdateaggregatedstatsCall struct { + s *Service + aggregatedstats *AggregatedStats + opt_ map[string]interface{} + ctx_ context.Context +} + +// Updateaggregatedstats: RPC to update the new TCP stats. +func (r *StatscollectionService) Updateaggregatedstats(aggregatedstats *AggregatedStats) *StatscollectionUpdateaggregatedstatsCall { + c := &StatscollectionUpdateaggregatedstatsCall{s: r.s, opt_: make(map[string]interface{})} + c.aggregatedstats = aggregatedstats + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *StatscollectionUpdateaggregatedstatsCall) Fields(s ...googleapi.Field) *StatscollectionUpdateaggregatedstatsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *StatscollectionUpdateaggregatedstatsCall) Context(ctx context.Context) *StatscollectionUpdateaggregatedstatsCall { + c.ctx_ = ctx + return c +} + +func (c *StatscollectionUpdateaggregatedstatsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.aggregatedstats) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "updateaggregatedstats") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudlatencytest.statscollection.updateaggregatedstats" call. +// Exactly one of *AggregatedStatsReply or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AggregatedStatsReply.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *StatscollectionUpdateaggregatedstatsCall) Do() (*AggregatedStatsReply, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AggregatedStatsReply{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "RPC to update the new TCP stats.", + // "httpMethod": "POST", + // "id": "cloudlatencytest.statscollection.updateaggregatedstats", + // "path": "updateaggregatedstats", + // "request": { + // "$ref": "AggregatedStats" + // }, + // "response": { + // "$ref": "AggregatedStatsReply" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/monitoring.readonly" + // ] + // } + +} + +// method id "cloudlatencytest.statscollection.updatestats": + +type StatscollectionUpdatestatsCall struct { + s *Service + stats *Stats + opt_ map[string]interface{} + ctx_ context.Context +} + +// Updatestats: RPC to update the new TCP stats. +func (r *StatscollectionService) Updatestats(stats *Stats) *StatscollectionUpdatestatsCall { + c := &StatscollectionUpdatestatsCall{s: r.s, opt_: make(map[string]interface{})} + c.stats = stats + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *StatscollectionUpdatestatsCall) Fields(s ...googleapi.Field) *StatscollectionUpdatestatsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *StatscollectionUpdatestatsCall) Context(ctx context.Context) *StatscollectionUpdatestatsCall { + c.ctx_ = ctx + return c +} + +func (c *StatscollectionUpdatestatsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.stats) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "updatestats") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudlatencytest.statscollection.updatestats" call. +// Exactly one of *StatsReply or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *StatsReply.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *StatscollectionUpdatestatsCall) Do() (*StatsReply, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &StatsReply{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "RPC to update the new TCP stats.", + // "httpMethod": "POST", + // "id": "cloudlatencytest.statscollection.updatestats", + // "path": "updatestats", + // "request": { + // "$ref": "Stats" + // }, + // "response": { + // "$ref": "StatsReply" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/monitoring.readonly" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/cloudmonitoring/v2beta2/cloudmonitoring-api.json b/Godeps/_workspace/src/google.golang.org/api/cloudmonitoring/v2beta2/cloudmonitoring-api.json new file mode 100644 index 000000000..c6b2d23a7 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/cloudmonitoring/v2beta2/cloudmonitoring-api.json @@ -0,0 +1,839 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/avMl03W4ktR_Q7PS4O3ogtyT8Dc\"", + "discoveryVersion": "v1", + "id": "cloudmonitoring:v2beta2", + "name": "cloudmonitoring", + "canonicalName": "Cloud Monitoring", + "version": "v2beta2", + "revision": "20150713", + "title": "Cloud Monitoring API", + "description": "API for accessing Google Cloud and API monitoring data.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/monitoring/v2beta2/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/cloudmonitoring/v2beta2/projects/", + "basePath": "/cloudmonitoring/v2beta2/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "cloudmonitoring/v2beta2/projects/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json" + ], + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.", + "location": "query" + }, + "userIp": { + "type": "string", + "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.", + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/monitoring": { + "description": "View and write monitoring data for all of your Google and third-party Cloud and API projects" + } + } + } + }, + "schemas": { + "DeleteMetricDescriptorResponse": { + "id": "DeleteMetricDescriptorResponse", + "type": "object", + "description": "The response of cloudmonitoring.metricDescriptors.delete.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"cloudmonitoring#deleteMetricDescriptorResponse\".", + "default": "cloudmonitoring#deleteMetricDescriptorResponse" + } + } + }, + "ListMetricDescriptorsRequest": { + "id": "ListMetricDescriptorsRequest", + "type": "object", + "description": "The request of cloudmonitoring.metricDescriptors.list.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"cloudmonitoring#listMetricDescriptorsRequest\".", + "default": "cloudmonitoring#listMetricDescriptorsRequest" + } + } + }, + "ListMetricDescriptorsResponse": { + "id": "ListMetricDescriptorsResponse", + "type": "object", + "description": "The response of cloudmonitoring.metricDescriptors.list.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"cloudmonitoring#listMetricDescriptorsResponse\".", + "default": "cloudmonitoring#listMetricDescriptorsResponse" + }, + "metrics": { + "type": "array", + "description": "The returned metric descriptors.", + "items": { + "$ref": "MetricDescriptor" + } + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token. If present, indicates that additional results are available for retrieval. To access the results past the pagination limit, pass this value to the pageToken query parameter." + } + } + }, + "ListTimeseriesDescriptorsRequest": { + "id": "ListTimeseriesDescriptorsRequest", + "type": "object", + "description": "The request of cloudmonitoring.timeseriesDescriptors.list", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"cloudmonitoring#listTimeseriesDescriptorsRequest\".", + "default": "cloudmonitoring#listTimeseriesDescriptorsRequest" + } + } + }, + "ListTimeseriesDescriptorsResponse": { + "id": "ListTimeseriesDescriptorsResponse", + "type": "object", + "description": "The response of cloudmonitoring.timeseriesDescriptors.list", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"cloudmonitoring#listTimeseriesDescriptorsResponse\".", + "default": "cloudmonitoring#listTimeseriesDescriptorsResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token. If present, indicates that additional results are available for retrieval. To access the results past the pagination limit, set this value to the pageToken query parameter." + }, + "oldest": { + "type": "string", + "description": "The oldest timestamp of the interval of this query, as an RFC 3339 string.", + "format": "date-time" + }, + "timeseries": { + "type": "array", + "description": "The returned time series descriptors.", + "items": { + "$ref": "TimeseriesDescriptor" + } + }, + "youngest": { + "type": "string", + "description": "The youngest timestamp of the interval of this query, as an RFC 3339 string.", + "format": "date-time" + } + } + }, + "ListTimeseriesRequest": { + "id": "ListTimeseriesRequest", + "type": "object", + "description": "The request of cloudmonitoring.timeseries.list", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"cloudmonitoring#listTimeseriesRequest\".", + "default": "cloudmonitoring#listTimeseriesRequest" + } + } + }, + "ListTimeseriesResponse": { + "id": "ListTimeseriesResponse", + "type": "object", + "description": "The response of cloudmonitoring.timeseries.list", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"cloudmonitoring#listTimeseriesResponse\".", + "default": "cloudmonitoring#listTimeseriesResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token. If present, indicates that additional results are available for retrieval. To access the results past the pagination limit, set the pageToken query parameter to this value. All of the points of a time series will be returned before returning any point of the subsequent time series." + }, + "oldest": { + "type": "string", + "description": "The oldest timestamp of the interval of this query as an RFC 3339 string.", + "format": "date-time" + }, + "timeseries": { + "type": "array", + "description": "The returned time series.", + "items": { + "$ref": "Timeseries" + } + }, + "youngest": { + "type": "string", + "description": "The youngest timestamp of the interval of this query as an RFC 3339 string.", + "format": "date-time" + } + } + }, + "MetricDescriptor": { + "id": "MetricDescriptor", + "type": "object", + "description": "A metricDescriptor defines the name, label keys, and data type of a particular metric.", + "properties": { + "description": { + "type": "string", + "description": "Description of this metric." + }, + "labels": { + "type": "array", + "description": "Labels defined for this metric.", + "items": { + "$ref": "MetricDescriptorLabelDescriptor" + } + }, + "name": { + "type": "string", + "description": "The name of this metric." + }, + "project": { + "type": "string", + "description": "The project ID to which the metric belongs." + }, + "typeDescriptor": { + "$ref": "MetricDescriptorTypeDescriptor", + "description": "Type description for this metric." + } + } + }, + "MetricDescriptorLabelDescriptor": { + "id": "MetricDescriptorLabelDescriptor", + "type": "object", + "description": "A label in a metric is a description of this metric, including the key of this description (what the description is), and the value for this description.", + "properties": { + "description": { + "type": "string", + "description": "Label description." + }, + "key": { + "type": "string", + "description": "Label key." + } + } + }, + "MetricDescriptorTypeDescriptor": { + "id": "MetricDescriptorTypeDescriptor", + "type": "object", + "description": "A type in a metric contains information about how the metric is collected and what its data points look like.", + "properties": { + "metricType": { + "type": "string", + "description": "The method of collecting data for the metric. See Metric types." + }, + "valueType": { + "type": "string", + "description": "The data type of of individual points in the metric's time series. See Metric value types." + } + } + }, + "Point": { + "id": "Point", + "type": "object", + "description": "Point is a single point in a time series. It consists of a start time, an end time, and a value.", + "properties": { + "boolValue": { + "type": "boolean", + "description": "The value of this data point. Either \"true\" or \"false\"." + }, + "distributionValue": { + "$ref": "PointDistribution", + "description": "The value of this data point as a distribution. A distribution value can contain a list of buckets and/or an underflowBucket and an overflowBucket. The values of these points can be used to create a histogram." + }, + "doubleValue": { + "type": "number", + "description": "The value of this data point as a double-precision floating-point number.", + "format": "double" + }, + "end": { + "type": "string", + "description": "The interval [start, end] is the time period to which the point's value applies. For gauge metrics, whose values are instantaneous measurements, this interval should be empty (start should equal end). For cumulative metrics (of which deltas and rates are special cases), the interval should be non-empty. Both start and end are RFC 3339 strings.", + "format": "date-time" + }, + "int64Value": { + "type": "string", + "description": "The value of this data point as a 64-bit integer.", + "format": "int64" + }, + "start": { + "type": "string", + "description": "The interval [start, end] is the time period to which the point's value applies. For gauge metrics, whose values are instantaneous measurements, this interval should be empty (start should equal end). For cumulative metrics (of which deltas and rates are special cases), the interval should be non-empty. Both start and end are RFC 3339 strings.", + "format": "date-time" + }, + "stringValue": { + "type": "string", + "description": "The value of this data point in string format." + } + } + }, + "PointDistribution": { + "id": "PointDistribution", + "type": "object", + "description": "Distribution data point value type. When writing distribution points, try to be consistent with the boundaries of your buckets. If you must modify the bucket boundaries, then do so by merging, partitioning, or appending rather than skewing them.", + "properties": { + "buckets": { + "type": "array", + "description": "The finite buckets.", + "items": { + "$ref": "PointDistributionBucket" + } + }, + "overflowBucket": { + "$ref": "PointDistributionOverflowBucket", + "description": "The overflow bucket." + }, + "underflowBucket": { + "$ref": "PointDistributionUnderflowBucket", + "description": "The underflow bucket." + } + } + }, + "PointDistributionBucket": { + "id": "PointDistributionBucket", + "type": "object", + "description": "The histogram's bucket. Buckets that form the histogram of a distribution value. If the upper bound of a bucket, say U1, does not equal the lower bound of the next bucket, say L2, this means that there is no event in [U1, L2).", + "properties": { + "count": { + "type": "string", + "description": "The number of events whose values are in the interval defined by this bucket.", + "format": "int64" + }, + "lowerBound": { + "type": "number", + "description": "The lower bound of the value interval of this bucket (inclusive).", + "format": "double" + }, + "upperBound": { + "type": "number", + "description": "The upper bound of the value interval of this bucket (exclusive).", + "format": "double" + } + } + }, + "PointDistributionOverflowBucket": { + "id": "PointDistributionOverflowBucket", + "type": "object", + "description": "The overflow bucket is a special bucket that does not have the upperBound field; it includes all of the events that are no less than its lower bound.", + "properties": { + "count": { + "type": "string", + "description": "The number of events whose values are in the interval defined by this bucket.", + "format": "int64" + }, + "lowerBound": { + "type": "number", + "description": "The lower bound of the value interval of this bucket (inclusive).", + "format": "double" + } + } + }, + "PointDistributionUnderflowBucket": { + "id": "PointDistributionUnderflowBucket", + "type": "object", + "description": "The underflow bucket is a special bucket that does not have the lowerBound field; it includes all of the events that are less than its upper bound.", + "properties": { + "count": { + "type": "string", + "description": "The number of events whose values are in the interval defined by this bucket.", + "format": "int64" + }, + "upperBound": { + "type": "number", + "description": "The upper bound of the value interval of this bucket (exclusive).", + "format": "double" + } + } + }, + "Timeseries": { + "id": "Timeseries", + "type": "object", + "description": "The monitoring data is organized as metrics and stored as data points that are recorded over time. Each data point represents information like the CPU utilization of your virtual machine. A historical record of these data points is called a time series.", + "properties": { + "points": { + "type": "array", + "description": "The data points of this time series. The points are listed in order of their end timestamp, from younger to older.", + "items": { + "$ref": "Point" + } + }, + "timeseriesDesc": { + "$ref": "TimeseriesDescriptor", + "description": "The descriptor of this time series." + } + } + }, + "TimeseriesDescriptor": { + "id": "TimeseriesDescriptor", + "type": "object", + "description": "TimeseriesDescriptor identifies a single time series.", + "properties": { + "labels": { + "type": "object", + "description": "The label's name.", + "additionalProperties": { + "type": "string", + "description": "The label's name." + } + }, + "metric": { + "type": "string", + "description": "The name of the metric." + }, + "project": { + "type": "string", + "description": "The Developers Console project number to which this time series belongs." + } + } + }, + "TimeseriesDescriptorLabel": { + "id": "TimeseriesDescriptorLabel", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "The label's name." + }, + "value": { + "type": "string", + "description": "The label's value." + } + } + }, + "TimeseriesPoint": { + "id": "TimeseriesPoint", + "type": "object", + "description": "When writing time series, TimeseriesPoint should be used instead of Timeseries, to enforce single point for each time series in the timeseries.write request.", + "properties": { + "point": { + "$ref": "Point", + "description": "The data point in this time series snapshot." + }, + "timeseriesDesc": { + "$ref": "TimeseriesDescriptor", + "description": "The descriptor of this time series." + } + } + }, + "WriteTimeseriesRequest": { + "id": "WriteTimeseriesRequest", + "type": "object", + "description": "The request of cloudmonitoring.timeseries.write", + "properties": { + "commonLabels": { + "type": "object", + "description": "The label's name.", + "additionalProperties": { + "type": "string", + "description": "The label's name." + } + }, + "timeseries": { + "type": "array", + "description": "Provide time series specific labels and the data points for each time series. The labels in timeseries and the common_labels should form a complete list of labels that required by the metric.", + "items": { + "$ref": "TimeseriesPoint" + } + } + } + }, + "WriteTimeseriesResponse": { + "id": "WriteTimeseriesResponse", + "type": "object", + "description": "The response of cloudmonitoring.timeseries.write", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"cloudmonitoring#writeTimeseriesResponse\".", + "default": "cloudmonitoring#writeTimeseriesResponse" + } + } + } + }, + "resources": { + "metricDescriptors": { + "methods": { + "create": { + "id": "cloudmonitoring.metricDescriptors.create", + "path": "{project}/metricDescriptors", + "httpMethod": "POST", + "description": "Create a new metric.", + "parameters": { + "project": { + "type": "string", + "description": "The project id. The value can be the numeric project ID or string-based project name.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "request": { + "$ref": "MetricDescriptor" + }, + "response": { + "$ref": "MetricDescriptor" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring" + ] + }, + "delete": { + "id": "cloudmonitoring.metricDescriptors.delete", + "path": "{project}/metricDescriptors/{metric}", + "httpMethod": "DELETE", + "description": "Delete an existing metric.", + "parameters": { + "metric": { + "type": "string", + "description": "Name of the metric.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID to which the metric belongs.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "metric" + ], + "response": { + "$ref": "DeleteMetricDescriptorResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring" + ] + }, + "list": { + "id": "cloudmonitoring.metricDescriptors.list", + "path": "{project}/metricDescriptors", + "httpMethod": "GET", + "description": "List metric descriptors that match the query. If the query is not set, then all of the metric descriptors will be returned. Large responses will be paginated, use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken.", + "parameters": { + "count": { + "type": "integer", + "description": "Maximum number of metric descriptors per page. Used for pagination. If not specified, count = 100.", + "default": "100", + "format": "int32", + "minimum": "1", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pagination token, which is used to page through large result sets. Set this value to the value of the nextPageToken to retrieve the next page of results.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project id. The value can be the numeric project ID or string-based project name.", + "required": true, + "location": "path" + }, + "query": { + "type": "string", + "description": "The query used to search against existing metrics. Separate keywords with a space; the service joins all keywords with AND, meaning that all keywords must match for a metric to be returned. If this field is omitted, all metrics are returned. If an empty string is passed with this field, no metrics are returned.", + "location": "query" + } + }, + "parameterOrder": [ + "project" + ], + "request": { + "$ref": "ListMetricDescriptorsRequest" + }, + "response": { + "$ref": "ListMetricDescriptorsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring" + ] + } + } + }, + "timeseries": { + "methods": { + "list": { + "id": "cloudmonitoring.timeseries.list", + "path": "{project}/timeseries/{metric}", + "httpMethod": "GET", + "description": "List the data points of the time series that match the metric and labels values and that have data points in the interval. Large responses are paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken.", + "parameters": { + "aggregator": { + "type": "string", + "description": "The aggregation function that will reduce the data points in each window to a single point. This parameter is only valid for non-cumulative metrics with a value type of INT64 or DOUBLE.", + "enum": [ + "max", + "mean", + "min", + "sum" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ], + "location": "query" + }, + "count": { + "type": "integer", + "description": "Maximum number of data points per page, which is used for pagination of results.", + "default": "6000", + "format": "int32", + "minimum": "1", + "maximum": "12000", + "location": "query" + }, + "labels": { + "type": "string", + "description": "A collection of labels for the matching time series, which are represented as: \n- key==value: key equals the value \n- key=~value: key regex matches the value \n- key!=value: key does not equal the value \n- key!~value: key regex does not match the value For example, to list all of the time series descriptors for the region us-central1, you could specify:\nlabel=cloud.googleapis.com%2Flocation=~us-central1.*", + "pattern": "(.+?)(==|=~|!=|!~)(.+)", + "repeated": true, + "location": "query" + }, + "metric": { + "type": "string", + "description": "Metric names are protocol-free URLs as listed in the Supported Metrics page. For example, compute.googleapis.com/instance/disk/read_ops_count.", + "required": true, + "location": "path" + }, + "oldest": { + "type": "string", + "description": "Start of the time interval (exclusive), which is expressed as an RFC 3339 timestamp. If neither oldest nor timespan is specified, the default time interval will be (youngest - 4 hours, youngest]", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pagination token, which is used to page through large result sets. Set this value to the value of the nextPageToken to retrieve the next page of results.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID to which this time series belongs. The value can be the numeric project ID or string-based project name.", + "required": true, + "location": "path" + }, + "timespan": { + "type": "string", + "description": "Length of the time interval to query, which is an alternative way to declare the interval: (youngest - timespan, youngest]. The timespan and oldest parameters should not be used together. Units: \n- s: second \n- m: minute \n- h: hour \n- d: day \n- w: week Examples: 2s, 3m, 4w. Only one unit is allowed, for example: 2w3d is not allowed; you should use 17d instead.\n\nIf neither oldest nor timespan is specified, the default time interval will be (youngest - 4 hours, youngest].", + "pattern": "[0-9]+[smhdw]?", + "location": "query" + }, + "window": { + "type": "string", + "description": "The sampling window. At most one data point will be returned for each window in the requested time interval. This parameter is only valid for non-cumulative metric types. Units: \n- m: minute \n- h: hour \n- d: day \n- w: week Examples: 3m, 4w. Only one unit is allowed, for example: 2w3d is not allowed; you should use 17d instead.", + "pattern": "[0-9]+[mhdw]?", + "location": "query" + }, + "youngest": { + "type": "string", + "description": "End of the time interval (inclusive), which is expressed as an RFC 3339 timestamp.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "project", + "metric", + "youngest" + ], + "request": { + "$ref": "ListTimeseriesRequest" + }, + "response": { + "$ref": "ListTimeseriesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring" + ] + }, + "write": { + "id": "cloudmonitoring.timeseries.write", + "path": "{project}/timeseries:write", + "httpMethod": "POST", + "description": "Put data points to one or more time series for one or more metrics. If a time series does not exist, a new time series will be created. It is not allowed to write a time series point that is older than the existing youngest point of that time series. Points that are older than the existing youngest point of that time series will be discarded silently. Therefore, users should make sure that points of a time series are written sequentially in the order of their end time.", + "parameters": { + "project": { + "type": "string", + "description": "The project ID. The value can be the numeric project ID or string-based project name.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "request": { + "$ref": "WriteTimeseriesRequest" + }, + "response": { + "$ref": "WriteTimeseriesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring" + ] + } + } + }, + "timeseriesDescriptors": { + "methods": { + "list": { + "id": "cloudmonitoring.timeseriesDescriptors.list", + "path": "{project}/timeseriesDescriptors/{metric}", + "httpMethod": "GET", + "description": "List the descriptors of the time series that match the metric and labels values and that have data points in the interval. Large responses are paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken.", + "parameters": { + "aggregator": { + "type": "string", + "description": "The aggregation function that will reduce the data points in each window to a single point. This parameter is only valid for non-cumulative metrics with a value type of INT64 or DOUBLE.", + "enum": [ + "max", + "mean", + "min", + "sum" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ], + "location": "query" + }, + "count": { + "type": "integer", + "description": "Maximum number of time series descriptors per page. Used for pagination. If not specified, count = 100.", + "default": "100", + "format": "int32", + "minimum": "1", + "maximum": "1000", + "location": "query" + }, + "labels": { + "type": "string", + "description": "A collection of labels for the matching time series, which are represented as: \n- key==value: key equals the value \n- key=~value: key regex matches the value \n- key!=value: key does not equal the value \n- key!~value: key regex does not match the value For example, to list all of the time series descriptors for the region us-central1, you could specify:\nlabel=cloud.googleapis.com%2Flocation=~us-central1.*", + "pattern": "(.+?)(==|=~|!=|!~)(.+)", + "repeated": true, + "location": "query" + }, + "metric": { + "type": "string", + "description": "Metric names are protocol-free URLs as listed in the Supported Metrics page. For example, compute.googleapis.com/instance/disk/read_ops_count.", + "required": true, + "location": "path" + }, + "oldest": { + "type": "string", + "description": "Start of the time interval (exclusive), which is expressed as an RFC 3339 timestamp. If neither oldest nor timespan is specified, the default time interval will be (youngest - 4 hours, youngest]", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pagination token, which is used to page through large result sets. Set this value to the value of the nextPageToken to retrieve the next page of results.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID to which this time series belongs. The value can be the numeric project ID or string-based project name.", + "required": true, + "location": "path" + }, + "timespan": { + "type": "string", + "description": "Length of the time interval to query, which is an alternative way to declare the interval: (youngest - timespan, youngest]. The timespan and oldest parameters should not be used together. Units: \n- s: second \n- m: minute \n- h: hour \n- d: day \n- w: week Examples: 2s, 3m, 4w. Only one unit is allowed, for example: 2w3d is not allowed; you should use 17d instead.\n\nIf neither oldest nor timespan is specified, the default time interval will be (youngest - 4 hours, youngest].", + "pattern": "[0-9]+[smhdw]?", + "location": "query" + }, + "window": { + "type": "string", + "description": "The sampling window. At most one data point will be returned for each window in the requested time interval. This parameter is only valid for non-cumulative metric types. Units: \n- m: minute \n- h: hour \n- d: day \n- w: week Examples: 3m, 4w. Only one unit is allowed, for example: 2w3d is not allowed; you should use 17d instead.", + "pattern": "[0-9]+[mhdw]?", + "location": "query" + }, + "youngest": { + "type": "string", + "description": "End of the time interval (inclusive), which is expressed as an RFC 3339 timestamp.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "project", + "metric", + "youngest" + ], + "request": { + "$ref": "ListTimeseriesDescriptorsRequest" + }, + "response": { + "$ref": "ListTimeseriesDescriptorsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/monitoring" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/cloudmonitoring/v2beta2/cloudmonitoring-gen.go b/Godeps/_workspace/src/google.golang.org/api/cloudmonitoring/v2beta2/cloudmonitoring-gen.go new file mode 100644 index 000000000..5cfbeea72 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/cloudmonitoring/v2beta2/cloudmonitoring-gen.go @@ -0,0 +1,1950 @@ +// Package cloudmonitoring provides access to the Cloud Monitoring API. +// +// See https://cloud.google.com/monitoring/v2beta2/ +// +// Usage example: +// +// import "google.golang.org/api/cloudmonitoring/v2beta2" +// ... +// cloudmonitoringService, err := cloudmonitoring.New(oauthHttpClient) +package cloudmonitoring // import "google.golang.org/api/cloudmonitoring/v2beta2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "cloudmonitoring:v2beta2" +const apiName = "cloudmonitoring" +const apiVersion = "v2beta2" +const basePath = "https://www.googleapis.com/cloudmonitoring/v2beta2/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 and write monitoring data for all of your Google and third-party + // Cloud and API projects + MonitoringScope = "https://www.googleapis.com/auth/monitoring" +) + +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) + s.Timeseries = NewTimeseriesService(s) + s.TimeseriesDescriptors = NewTimeseriesDescriptorsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + MetricDescriptors *MetricDescriptorsService + + Timeseries *TimeseriesService + + TimeseriesDescriptors *TimeseriesDescriptorsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewMetricDescriptorsService(s *Service) *MetricDescriptorsService { + rs := &MetricDescriptorsService{s: s} + return rs +} + +type MetricDescriptorsService struct { + s *Service +} + +func NewTimeseriesService(s *Service) *TimeseriesService { + rs := &TimeseriesService{s: s} + return rs +} + +type TimeseriesService struct { + s *Service +} + +func NewTimeseriesDescriptorsService(s *Service) *TimeseriesDescriptorsService { + rs := &TimeseriesDescriptorsService{s: s} + return rs +} + +type TimeseriesDescriptorsService struct { + s *Service +} + +// DeleteMetricDescriptorResponse: The response of +// cloudmonitoring.metricDescriptors.delete. +type DeleteMetricDescriptorResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "cloudmonitoring#deleteMetricDescriptorResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeleteMetricDescriptorResponse) MarshalJSON() ([]byte, error) { + type noMethod DeleteMetricDescriptorResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListMetricDescriptorsRequest: The request of +// cloudmonitoring.metricDescriptors.list. +type ListMetricDescriptorsRequest struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "cloudmonitoring#listMetricDescriptorsRequest". + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListMetricDescriptorsRequest) MarshalJSON() ([]byte, error) { + type noMethod ListMetricDescriptorsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListMetricDescriptorsResponse: The response of +// cloudmonitoring.metricDescriptors.list. +type ListMetricDescriptorsResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "cloudmonitoring#listMetricDescriptorsResponse". + Kind string `json:"kind,omitempty"` + + // Metrics: The returned metric descriptors. + Metrics []*MetricDescriptor `json:"metrics,omitempty"` + + // NextPageToken: Pagination token. If present, indicates that + // additional results are available for retrieval. To access the results + // past the pagination limit, pass this value to the pageToken query + // parameter. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListMetricDescriptorsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListMetricDescriptorsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListTimeseriesDescriptorsRequest: The request of +// cloudmonitoring.timeseriesDescriptors.list +type ListTimeseriesDescriptorsRequest struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "cloudmonitoring#listTimeseriesDescriptorsRequest". + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListTimeseriesDescriptorsRequest) MarshalJSON() ([]byte, error) { + type noMethod ListTimeseriesDescriptorsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListTimeseriesDescriptorsResponse: The response of +// cloudmonitoring.timeseriesDescriptors.list +type ListTimeseriesDescriptorsResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "cloudmonitoring#listTimeseriesDescriptorsResponse". + 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"` + + // Oldest: The oldest timestamp of the interval of this query, as an RFC + // 3339 string. + Oldest string `json:"oldest,omitempty"` + + // Timeseries: The returned time series descriptors. + Timeseries []*TimeseriesDescriptor `json:"timeseries,omitempty"` + + // Youngest: The youngest timestamp of the interval of this query, as an + // RFC 3339 string. + Youngest string `json:"youngest,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListTimeseriesDescriptorsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListTimeseriesDescriptorsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListTimeseriesRequest: The request of cloudmonitoring.timeseries.list +type ListTimeseriesRequest struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "cloudmonitoring#listTimeseriesRequest". + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListTimeseriesRequest) MarshalJSON() ([]byte, error) { + type noMethod ListTimeseriesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListTimeseriesResponse: The response of +// cloudmonitoring.timeseries.list +type ListTimeseriesResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "cloudmonitoring#listTimeseriesResponse". + 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 the pageToken query parameter to this + // value. All of the points of a time series will be returned before + // returning any point of the subsequent time series. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Oldest: The oldest timestamp of the interval of this query as an RFC + // 3339 string. + Oldest string `json:"oldest,omitempty"` + + // Timeseries: The returned time series. + Timeseries []*Timeseries `json:"timeseries,omitempty"` + + // Youngest: The youngest timestamp of the interval of this query as an + // RFC 3339 string. + Youngest string `json:"youngest,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListTimeseriesResponse) MarshalJSON() ([]byte, error) { + type noMethod ListTimeseriesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MetricDescriptor: A metricDescriptor defines the name, label keys, +// and data type of a particular metric. +type MetricDescriptor struct { + // Description: Description of this metric. + Description string `json:"description,omitempty"` + + // Labels: Labels defined for this metric. + Labels []*MetricDescriptorLabelDescriptor `json:"labels,omitempty"` + + // Name: The name of this metric. + Name string `json:"name,omitempty"` + + // Project: The project ID to which the metric belongs. + Project string `json:"project,omitempty"` + + // TypeDescriptor: Type description for this metric. + TypeDescriptor *MetricDescriptorTypeDescriptor `json:"typeDescriptor,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MetricDescriptor) MarshalJSON() ([]byte, error) { + type noMethod MetricDescriptor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MetricDescriptorLabelDescriptor: A label in a metric is a description +// of this metric, including the key of this description (what the +// description is), and the value for this description. +type MetricDescriptorLabelDescriptor struct { + // Description: Label description. + Description string `json:"description,omitempty"` + + // Key: Label key. + Key string `json:"key,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MetricDescriptorLabelDescriptor) MarshalJSON() ([]byte, error) { + type noMethod MetricDescriptorLabelDescriptor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MetricDescriptorTypeDescriptor: A type in a metric contains +// information about how the metric is collected and what its data +// points look like. +type MetricDescriptorTypeDescriptor struct { + // MetricType: The method of collecting data for the metric. See Metric + // types. + MetricType string `json:"metricType,omitempty"` + + // ValueType: The data type of of individual points in the metric's time + // series. See Metric value types. + ValueType string `json:"valueType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MetricType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MetricDescriptorTypeDescriptor) MarshalJSON() ([]byte, error) { + type noMethod MetricDescriptorTypeDescriptor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Point: Point is a single point in a time series. It consists of a +// start time, an end time, and a value. +type Point struct { + // BoolValue: The value of this data point. Either "true" or "false". + BoolValue *bool `json:"boolValue,omitempty"` + + // DistributionValue: The value of this data point as a distribution. A + // distribution value can contain a list of buckets and/or an + // underflowBucket and an overflowBucket. The values of these points can + // be used to create a histogram. + DistributionValue *PointDistribution `json:"distributionValue,omitempty"` + + // DoubleValue: The value of this data point as a double-precision + // floating-point number. + DoubleValue *float64 `json:"doubleValue,omitempty"` + + // End: The interval [start, end] is the time period to which the + // point's value applies. For gauge metrics, whose values are + // instantaneous measurements, this interval should be empty (start + // should equal end). For cumulative metrics (of which deltas and rates + // are special cases), the interval should be non-empty. Both start and + // end are RFC 3339 strings. + End string `json:"end,omitempty"` + + // Int64Value: The value of this data point as a 64-bit integer. + Int64Value *int64 `json:"int64Value,omitempty,string"` + + // Start: The interval [start, end] is the time period to which the + // point's value applies. For gauge metrics, whose values are + // instantaneous measurements, this interval should be empty (start + // should equal end). For cumulative metrics (of which deltas and rates + // are special cases), the interval should be non-empty. Both start and + // end are RFC 3339 strings. + Start string `json:"start,omitempty"` + + // StringValue: The value of this data point in string format. + StringValue *string `json:"stringValue,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BoolValue") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Point) MarshalJSON() ([]byte, error) { + type noMethod Point + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PointDistribution: Distribution data point value type. When writing +// distribution points, try to be consistent with the boundaries of your +// buckets. If you must modify the bucket boundaries, then do so by +// merging, partitioning, or appending rather than skewing them. +type PointDistribution struct { + // Buckets: The finite buckets. + Buckets []*PointDistributionBucket `json:"buckets,omitempty"` + + // OverflowBucket: The overflow bucket. + OverflowBucket *PointDistributionOverflowBucket `json:"overflowBucket,omitempty"` + + // UnderflowBucket: The underflow bucket. + UnderflowBucket *PointDistributionUnderflowBucket `json:"underflowBucket,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Buckets") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PointDistribution) MarshalJSON() ([]byte, error) { + type noMethod PointDistribution + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PointDistributionBucket: The histogram's bucket. Buckets that form +// the histogram of a distribution value. If the upper bound of a +// bucket, say U1, does not equal the lower bound of the next bucket, +// say L2, this means that there is no event in [U1, L2). +type PointDistributionBucket struct { + // Count: The number of events whose values are in the interval defined + // by this bucket. + Count int64 `json:"count,omitempty,string"` + + // LowerBound: The lower bound of the value interval of this bucket + // (inclusive). + LowerBound float64 `json:"lowerBound,omitempty"` + + // UpperBound: The upper bound of the value interval of this bucket + // (exclusive). + UpperBound float64 `json:"upperBound,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Count") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PointDistributionBucket) MarshalJSON() ([]byte, error) { + type noMethod PointDistributionBucket + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PointDistributionOverflowBucket: The overflow bucket is a special +// bucket that does not have the upperBound field; it includes all of +// the events that are no less than its lower bound. +type PointDistributionOverflowBucket struct { + // Count: The number of events whose values are in the interval defined + // by this bucket. + Count int64 `json:"count,omitempty,string"` + + // LowerBound: The lower bound of the value interval of this bucket + // (inclusive). + LowerBound float64 `json:"lowerBound,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Count") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PointDistributionOverflowBucket) MarshalJSON() ([]byte, error) { + type noMethod PointDistributionOverflowBucket + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PointDistributionUnderflowBucket: The underflow bucket is a special +// bucket that does not have the lowerBound field; it includes all of +// the events that are less than its upper bound. +type PointDistributionUnderflowBucket struct { + // Count: The number of events whose values are in the interval defined + // by this bucket. + Count int64 `json:"count,omitempty,string"` + + // UpperBound: The upper bound of the value interval of this bucket + // (exclusive). + UpperBound float64 `json:"upperBound,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Count") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PointDistributionUnderflowBucket) MarshalJSON() ([]byte, error) { + type noMethod PointDistributionUnderflowBucket + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Timeseries: The monitoring data is organized as metrics and stored as +// data points that are recorded over time. Each data point represents +// information like the CPU utilization of your virtual machine. A +// historical record of these data points is called a time series. +type Timeseries struct { + // Points: The data points of this time series. The points are listed in + // order of their end timestamp, from younger to older. + Points []*Point `json:"points,omitempty"` + + // TimeseriesDesc: The descriptor of this time series. + TimeseriesDesc *TimeseriesDescriptor `json:"timeseriesDesc,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Points") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Timeseries) MarshalJSON() ([]byte, error) { + type noMethod Timeseries + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TimeseriesDescriptor: TimeseriesDescriptor identifies a single time +// series. +type TimeseriesDescriptor struct { + // Labels: The label's name. + Labels map[string]string `json:"labels,omitempty"` + + // Metric: The name of the metric. + Metric string `json:"metric,omitempty"` + + // Project: The Developers Console project number to which this time + // series belongs. + Project string `json:"project,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Labels") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TimeseriesDescriptor) MarshalJSON() ([]byte, error) { + type noMethod TimeseriesDescriptor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TimeseriesDescriptorLabel struct { + // Key: The label's name. + Key string `json:"key,omitempty"` + + // Value: The label's value. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TimeseriesDescriptorLabel) MarshalJSON() ([]byte, error) { + type noMethod TimeseriesDescriptorLabel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TimeseriesPoint: When writing time series, TimeseriesPoint should be +// used instead of Timeseries, to enforce single point for each time +// series in the timeseries.write request. +type TimeseriesPoint struct { + // Point: The data point in this time series snapshot. + Point *Point `json:"point,omitempty"` + + // TimeseriesDesc: The descriptor of this time series. + TimeseriesDesc *TimeseriesDescriptor `json:"timeseriesDesc,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Point") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TimeseriesPoint) MarshalJSON() ([]byte, error) { + type noMethod TimeseriesPoint + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// WriteTimeseriesRequest: The request of +// cloudmonitoring.timeseries.write +type WriteTimeseriesRequest struct { + // CommonLabels: The label's name. + CommonLabels map[string]string `json:"commonLabels,omitempty"` + + // Timeseries: Provide time series specific labels and the data points + // for each time series. The labels in timeseries and the common_labels + // should form a complete list of labels that required by the metric. + Timeseries []*TimeseriesPoint `json:"timeseries,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CommonLabels") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *WriteTimeseriesRequest) MarshalJSON() ([]byte, error) { + type noMethod WriteTimeseriesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// WriteTimeseriesResponse: The response of +// cloudmonitoring.timeseries.write +type WriteTimeseriesResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "cloudmonitoring#writeTimeseriesResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *WriteTimeseriesResponse) MarshalJSON() ([]byte, error) { + type noMethod WriteTimeseriesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "cloudmonitoring.metricDescriptors.create": + +type MetricDescriptorsCreateCall struct { + s *Service + project string + metricdescriptor *MetricDescriptor + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Create a new metric. +func (r *MetricDescriptorsService) Create(project string, metricdescriptor *MetricDescriptor) *MetricDescriptorsCreateCall { + c := &MetricDescriptorsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.metricdescriptor = metricdescriptor + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MetricDescriptorsCreateCall) Fields(s ...googleapi.Field) *MetricDescriptorsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MetricDescriptorsCreateCall) Context(ctx context.Context) *MetricDescriptorsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *MetricDescriptorsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.metricdescriptor) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/metricDescriptors") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudmonitoring.metricDescriptors.create" call. +// Exactly one of *MetricDescriptor or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *MetricDescriptor.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MetricDescriptorsCreateCall) Do() (*MetricDescriptor, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &MetricDescriptor{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a new metric.", + // "httpMethod": "POST", + // "id": "cloudmonitoring.metricDescriptors.create", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "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": "MetricDescriptor" + // }, + // "response": { + // "$ref": "MetricDescriptor" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/monitoring" + // ] + // } + +} + +// method id "cloudmonitoring.metricDescriptors.delete": + +type MetricDescriptorsDeleteCall struct { + s *Service + project string + metric string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Delete an existing metric. +func (r *MetricDescriptorsService) Delete(project string, metric string) *MetricDescriptorsDeleteCall { + c := &MetricDescriptorsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.metric = metric + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MetricDescriptorsDeleteCall) Fields(s ...googleapi.Field) *MetricDescriptorsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MetricDescriptorsDeleteCall) Context(ctx context.Context) *MetricDescriptorsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *MetricDescriptorsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/metricDescriptors/{metric}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "metric": c.metric, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudmonitoring.metricDescriptors.delete" call. +// Exactly one of *DeleteMetricDescriptorResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *DeleteMetricDescriptorResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MetricDescriptorsDeleteCall) Do() (*DeleteMetricDescriptorResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DeleteMetricDescriptorResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Delete an existing metric.", + // "httpMethod": "DELETE", + // "id": "cloudmonitoring.metricDescriptors.delete", + // "parameterOrder": [ + // "project", + // "metric" + // ], + // "parameters": { + // "metric": { + // "description": "Name of the metric.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID to which the metric belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/metricDescriptors/{metric}", + // "response": { + // "$ref": "DeleteMetricDescriptorResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/monitoring" + // ] + // } + +} + +// method id "cloudmonitoring.metricDescriptors.list": + +type MetricDescriptorsListCall struct { + s *Service + project string + listmetricdescriptorsrequest *ListMetricDescriptorsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List metric descriptors that match the query. If the query is +// not set, then all of the metric descriptors will be returned. Large +// responses will be paginated, use the nextPageToken returned in the +// response to request subsequent pages of results by setting the +// pageToken query parameter to the value of the nextPageToken. +func (r *MetricDescriptorsService) List(project string, listmetricdescriptorsrequest *ListMetricDescriptorsRequest) *MetricDescriptorsListCall { + c := &MetricDescriptorsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.listmetricdescriptorsrequest = listmetricdescriptorsrequest + 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 +} + +// Query sets the optional parameter "query": The query used to search +// against existing metrics. Separate keywords with a space; the service +// joins all keywords with AND, meaning that all keywords must match for +// a metric to be returned. If this field is omitted, all metrics are +// returned. If an empty string is passed with this field, no metrics +// are returned. +func (c *MetricDescriptorsListCall) Query(query string) *MetricDescriptorsListCall { + c.opt_["query"] = query + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MetricDescriptorsListCall) Fields(s ...googleapi.Field) *MetricDescriptorsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MetricDescriptorsListCall) IfNoneMatch(entityTag string) *MetricDescriptorsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MetricDescriptorsListCall) Context(ctx context.Context) *MetricDescriptorsListCall { + c.ctx_ = ctx + return c +} + +func (c *MetricDescriptorsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["query"]; ok { + params.Set("query", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/metricDescriptors") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudmonitoring.metricDescriptors.list" call. +// Exactly one of *ListMetricDescriptorsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListMetricDescriptorsResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MetricDescriptorsListCall) Do() (*ListMetricDescriptorsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListMetricDescriptorsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List metric descriptors that match the query. If the query is not set, then all of the metric descriptors will be returned. Large responses will be paginated, use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken.", + // "httpMethod": "GET", + // "id": "cloudmonitoring.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" + // }, + // "query": { + // "description": "The query used to search against existing metrics. Separate keywords with a space; the service joins all keywords with AND, meaning that all keywords must match for a metric to be returned. If this field is omitted, all metrics are returned. If an empty string is passed with this field, no metrics are returned.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "{project}/metricDescriptors", + // "request": { + // "$ref": "ListMetricDescriptorsRequest" + // }, + // "response": { + // "$ref": "ListMetricDescriptorsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/monitoring" + // ] + // } + +} + +// method id "cloudmonitoring.timeseries.list": + +type TimeseriesListCall struct { + s *Service + project string + metric string + youngest string + listtimeseriesrequest *ListTimeseriesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List the data points of the time series that match the metric +// and labels values and that have data points in the interval. Large +// responses are paginated; use the nextPageToken returned in the +// response to request subsequent pages of results by setting the +// pageToken query parameter to the value of the nextPageToken. +func (r *TimeseriesService) List(project string, metric string, youngest string, listtimeseriesrequest *ListTimeseriesRequest) *TimeseriesListCall { + c := &TimeseriesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.metric = metric + c.youngest = youngest + c.listtimeseriesrequest = listtimeseriesrequest + return c +} + +// Aggregator sets the optional parameter "aggregator": The aggregation +// function that will reduce the data points in each window to a single +// point. This parameter is only valid for non-cumulative metrics with a +// value type of INT64 or DOUBLE. +// +// Possible values: +// "max" +// "mean" +// "min" +// "sum" +func (c *TimeseriesListCall) Aggregator(aggregator string) *TimeseriesListCall { + c.opt_["aggregator"] = aggregator + return c +} + +// Count sets the optional parameter "count": Maximum number of data +// points per page, which is used for pagination of results. +func (c *TimeseriesListCall) Count(count int64) *TimeseriesListCall { + c.opt_["count"] = count + return c +} + +// Labels sets the optional parameter "labels": A collection of labels +// for the matching time series, which are represented as: +// - key==value: key equals the value +// - key=~value: key regex matches the value +// - key!=value: key does not equal the value +// - key!~value: key regex does not match the value For example, to +// list all of the time series descriptors for the region us-central1, +// you could +// specify: +// label=cloud.googleapis.com%2Flocation=~us-central1.* +func (c *TimeseriesListCall) Labels(labels string) *TimeseriesListCall { + c.opt_["labels"] = labels + return c +} + +// Oldest sets the optional parameter "oldest": Start of the time +// interval (exclusive), which is expressed as an RFC 3339 timestamp. If +// neither oldest nor timespan is specified, the default time interval +// will be (youngest - 4 hours, youngest] +func (c *TimeseriesListCall) Oldest(oldest string) *TimeseriesListCall { + c.opt_["oldest"] = oldest + 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 *TimeseriesListCall) PageToken(pageToken string) *TimeseriesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Timespan sets the optional parameter "timespan": Length of the time +// interval to query, which is an alternative way to declare the +// interval: (youngest - timespan, youngest]. The timespan and oldest +// parameters should not be used together. Units: +// - s: second +// - m: minute +// - h: hour +// - d: day +// - w: week Examples: 2s, 3m, 4w. Only one unit is allowed, for +// example: 2w3d is not allowed; you should use 17d instead. +// +// If neither oldest nor timespan is specified, the default time +// interval will be (youngest - 4 hours, youngest]. +func (c *TimeseriesListCall) Timespan(timespan string) *TimeseriesListCall { + c.opt_["timespan"] = timespan + return c +} + +// Window sets the optional parameter "window": The sampling window. At +// most one data point will be returned for each window in the requested +// time interval. This parameter is only valid for non-cumulative metric +// types. Units: +// - m: minute +// - h: hour +// - d: day +// - w: week Examples: 3m, 4w. Only one unit is allowed, for example: +// 2w3d is not allowed; you should use 17d instead. +func (c *TimeseriesListCall) Window(window string) *TimeseriesListCall { + c.opt_["window"] = window + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TimeseriesListCall) Fields(s ...googleapi.Field) *TimeseriesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TimeseriesListCall) IfNoneMatch(entityTag string) *TimeseriesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TimeseriesListCall) Context(ctx context.Context) *TimeseriesListCall { + c.ctx_ = ctx + return c +} + +func (c *TimeseriesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("youngest", fmt.Sprintf("%v", c.youngest)) + if v, ok := c.opt_["aggregator"]; ok { + params.Set("aggregator", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["count"]; ok { + params.Set("count", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["labels"]; ok { + params.Set("labels", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["oldest"]; ok { + params.Set("oldest", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["timespan"]; ok { + params.Set("timespan", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["window"]; ok { + params.Set("window", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/timeseries/{metric}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "metric": c.metric, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudmonitoring.timeseries.list" call. +// Exactly one of *ListTimeseriesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListTimeseriesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TimeseriesListCall) Do() (*ListTimeseriesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListTimeseriesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the data points of the time series that match the metric and labels values and that have data points in the interval. Large responses are paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken.", + // "httpMethod": "GET", + // "id": "cloudmonitoring.timeseries.list", + // "parameterOrder": [ + // "project", + // "metric", + // "youngest" + // ], + // "parameters": { + // "aggregator": { + // "description": "The aggregation function that will reduce the data points in each window to a single point. This parameter is only valid for non-cumulative metrics with a value type of INT64 or DOUBLE.", + // "enum": [ + // "max", + // "mean", + // "min", + // "sum" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "count": { + // "default": "6000", + // "description": "Maximum number of data points per page, which is used for pagination of results.", + // "format": "int32", + // "location": "query", + // "maximum": "12000", + // "minimum": "1", + // "type": "integer" + // }, + // "labels": { + // "description": "A collection of labels for the matching time series, which are represented as: \n- key==value: key equals the value \n- key=~value: key regex matches the value \n- key!=value: key does not equal the value \n- key!~value: key regex does not match the value For example, to list all of the time series descriptors for the region us-central1, you could specify:\nlabel=cloud.googleapis.com%2Flocation=~us-central1.*", + // "location": "query", + // "pattern": "(.+?)(==|=~|!=|!~)(.+)", + // "repeated": true, + // "type": "string" + // }, + // "metric": { + // "description": "Metric names are protocol-free URLs as listed in the Supported Metrics page. For example, compute.googleapis.com/instance/disk/read_ops_count.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "oldest": { + // "description": "Start of the time interval (exclusive), which is expressed as an RFC 3339 timestamp. If neither oldest nor timespan is specified, the default time interval will be (youngest - 4 hours, youngest]", + // "location": "query", + // "type": "string" + // }, + // "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 to which this time series belongs. The value can be the numeric project ID or string-based project name.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "timespan": { + // "description": "Length of the time interval to query, which is an alternative way to declare the interval: (youngest - timespan, youngest]. The timespan and oldest parameters should not be used together. Units: \n- s: second \n- m: minute \n- h: hour \n- d: day \n- w: week Examples: 2s, 3m, 4w. Only one unit is allowed, for example: 2w3d is not allowed; you should use 17d instead.\n\nIf neither oldest nor timespan is specified, the default time interval will be (youngest - 4 hours, youngest].", + // "location": "query", + // "pattern": "[0-9]+[smhdw]?", + // "type": "string" + // }, + // "window": { + // "description": "The sampling window. At most one data point will be returned for each window in the requested time interval. This parameter is only valid for non-cumulative metric types. Units: \n- m: minute \n- h: hour \n- d: day \n- w: week Examples: 3m, 4w. Only one unit is allowed, for example: 2w3d is not allowed; you should use 17d instead.", + // "location": "query", + // "pattern": "[0-9]+[mhdw]?", + // "type": "string" + // }, + // "youngest": { + // "description": "End of the time interval (inclusive), which is expressed as an RFC 3339 timestamp.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/timeseries/{metric}", + // "request": { + // "$ref": "ListTimeseriesRequest" + // }, + // "response": { + // "$ref": "ListTimeseriesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/monitoring" + // ] + // } + +} + +// method id "cloudmonitoring.timeseries.write": + +type TimeseriesWriteCall struct { + s *Service + project string + writetimeseriesrequest *WriteTimeseriesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Write: Put data points to one or more time series for one or more +// metrics. If a time series does not exist, a new time series will be +// created. It is not allowed to write a time series point that is older +// than the existing youngest point of that time series. Points that are +// older than the existing youngest point of that time series will be +// discarded silently. Therefore, users should make sure that points of +// a time series are written sequentially in the order of their end +// time. +func (r *TimeseriesService) Write(project string, writetimeseriesrequest *WriteTimeseriesRequest) *TimeseriesWriteCall { + c := &TimeseriesWriteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.writetimeseriesrequest = writetimeseriesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TimeseriesWriteCall) Fields(s ...googleapi.Field) *TimeseriesWriteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TimeseriesWriteCall) Context(ctx context.Context) *TimeseriesWriteCall { + c.ctx_ = ctx + return c +} + +func (c *TimeseriesWriteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.writetimeseriesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/timeseries:write") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudmonitoring.timeseries.write" call. +// Exactly one of *WriteTimeseriesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *WriteTimeseriesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TimeseriesWriteCall) Do() (*WriteTimeseriesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &WriteTimeseriesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Put data points to one or more time series for one or more metrics. If a time series does not exist, a new time series will be created. It is not allowed to write a time series point that is older than the existing youngest point of that time series. Points that are older than the existing youngest point of that time series will be discarded silently. Therefore, users should make sure that points of a time series are written sequentially in the order of their end time.", + // "httpMethod": "POST", + // "id": "cloudmonitoring.timeseries.write", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "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}/timeseries:write", + // "request": { + // "$ref": "WriteTimeseriesRequest" + // }, + // "response": { + // "$ref": "WriteTimeseriesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/monitoring" + // ] + // } + +} + +// method id "cloudmonitoring.timeseriesDescriptors.list": + +type TimeseriesDescriptorsListCall struct { + s *Service + project string + metric string + youngest string + listtimeseriesdescriptorsrequest *ListTimeseriesDescriptorsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List the descriptors of the time series that match the metric +// and labels values and that have data points in the interval. Large +// responses are paginated; use the nextPageToken returned in the +// response to request subsequent pages of results by setting the +// pageToken query parameter to the value of the nextPageToken. +func (r *TimeseriesDescriptorsService) List(project string, metric string, youngest string, listtimeseriesdescriptorsrequest *ListTimeseriesDescriptorsRequest) *TimeseriesDescriptorsListCall { + c := &TimeseriesDescriptorsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.metric = metric + c.youngest = youngest + c.listtimeseriesdescriptorsrequest = listtimeseriesdescriptorsrequest + return c +} + +// Aggregator sets the optional parameter "aggregator": The aggregation +// function that will reduce the data points in each window to a single +// point. This parameter is only valid for non-cumulative metrics with a +// value type of INT64 or DOUBLE. +// +// Possible values: +// "max" +// "mean" +// "min" +// "sum" +func (c *TimeseriesDescriptorsListCall) Aggregator(aggregator string) *TimeseriesDescriptorsListCall { + c.opt_["aggregator"] = aggregator + return c +} + +// Count sets the optional parameter "count": Maximum number of time +// series descriptors per page. Used for pagination. If not specified, +// count = 100. +func (c *TimeseriesDescriptorsListCall) Count(count int64) *TimeseriesDescriptorsListCall { + c.opt_["count"] = count + return c +} + +// Labels sets the optional parameter "labels": A collection of labels +// for the matching time series, which are represented as: +// - key==value: key equals the value +// - key=~value: key regex matches the value +// - key!=value: key does not equal the value +// - key!~value: key regex does not match the value For example, to +// list all of the time series descriptors for the region us-central1, +// you could +// specify: +// label=cloud.googleapis.com%2Flocation=~us-central1.* +func (c *TimeseriesDescriptorsListCall) Labels(labels string) *TimeseriesDescriptorsListCall { + c.opt_["labels"] = labels + return c +} + +// Oldest sets the optional parameter "oldest": Start of the time +// interval (exclusive), which is expressed as an RFC 3339 timestamp. If +// neither oldest nor timespan is specified, the default time interval +// will be (youngest - 4 hours, youngest] +func (c *TimeseriesDescriptorsListCall) Oldest(oldest string) *TimeseriesDescriptorsListCall { + c.opt_["oldest"] = oldest + 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 *TimeseriesDescriptorsListCall) PageToken(pageToken string) *TimeseriesDescriptorsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Timespan sets the optional parameter "timespan": Length of the time +// interval to query, which is an alternative way to declare the +// interval: (youngest - timespan, youngest]. The timespan and oldest +// parameters should not be used together. Units: +// - s: second +// - m: minute +// - h: hour +// - d: day +// - w: week Examples: 2s, 3m, 4w. Only one unit is allowed, for +// example: 2w3d is not allowed; you should use 17d instead. +// +// If neither oldest nor timespan is specified, the default time +// interval will be (youngest - 4 hours, youngest]. +func (c *TimeseriesDescriptorsListCall) Timespan(timespan string) *TimeseriesDescriptorsListCall { + c.opt_["timespan"] = timespan + return c +} + +// Window sets the optional parameter "window": The sampling window. At +// most one data point will be returned for each window in the requested +// time interval. This parameter is only valid for non-cumulative metric +// types. Units: +// - m: minute +// - h: hour +// - d: day +// - w: week Examples: 3m, 4w. Only one unit is allowed, for example: +// 2w3d is not allowed; you should use 17d instead. +func (c *TimeseriesDescriptorsListCall) Window(window string) *TimeseriesDescriptorsListCall { + c.opt_["window"] = window + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TimeseriesDescriptorsListCall) Fields(s ...googleapi.Field) *TimeseriesDescriptorsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TimeseriesDescriptorsListCall) IfNoneMatch(entityTag string) *TimeseriesDescriptorsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TimeseriesDescriptorsListCall) Context(ctx context.Context) *TimeseriesDescriptorsListCall { + c.ctx_ = ctx + return c +} + +func (c *TimeseriesDescriptorsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("youngest", fmt.Sprintf("%v", c.youngest)) + if v, ok := c.opt_["aggregator"]; ok { + params.Set("aggregator", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["count"]; ok { + params.Set("count", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["labels"]; ok { + params.Set("labels", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["oldest"]; ok { + params.Set("oldest", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["timespan"]; ok { + params.Set("timespan", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["window"]; ok { + params.Set("window", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/timeseriesDescriptors/{metric}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "metric": c.metric, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudmonitoring.timeseriesDescriptors.list" call. +// Exactly one of *ListTimeseriesDescriptorsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListTimeseriesDescriptorsResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *TimeseriesDescriptorsListCall) Do() (*ListTimeseriesDescriptorsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListTimeseriesDescriptorsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the descriptors of the time series that match the metric and labels values and that have data points in the interval. Large responses are paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken.", + // "httpMethod": "GET", + // "id": "cloudmonitoring.timeseriesDescriptors.list", + // "parameterOrder": [ + // "project", + // "metric", + // "youngest" + // ], + // "parameters": { + // "aggregator": { + // "description": "The aggregation function that will reduce the data points in each window to a single point. This parameter is only valid for non-cumulative metrics with a value type of INT64 or DOUBLE.", + // "enum": [ + // "max", + // "mean", + // "min", + // "sum" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "count": { + // "default": "100", + // "description": "Maximum number of time series descriptors per page. Used for pagination. If not specified, count = 100.", + // "format": "int32", + // "location": "query", + // "maximum": "1000", + // "minimum": "1", + // "type": "integer" + // }, + // "labels": { + // "description": "A collection of labels for the matching time series, which are represented as: \n- key==value: key equals the value \n- key=~value: key regex matches the value \n- key!=value: key does not equal the value \n- key!~value: key regex does not match the value For example, to list all of the time series descriptors for the region us-central1, you could specify:\nlabel=cloud.googleapis.com%2Flocation=~us-central1.*", + // "location": "query", + // "pattern": "(.+?)(==|=~|!=|!~)(.+)", + // "repeated": true, + // "type": "string" + // }, + // "metric": { + // "description": "Metric names are protocol-free URLs as listed in the Supported Metrics page. For example, compute.googleapis.com/instance/disk/read_ops_count.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "oldest": { + // "description": "Start of the time interval (exclusive), which is expressed as an RFC 3339 timestamp. If neither oldest nor timespan is specified, the default time interval will be (youngest - 4 hours, youngest]", + // "location": "query", + // "type": "string" + // }, + // "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 to which this time series belongs. The value can be the numeric project ID or string-based project name.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "timespan": { + // "description": "Length of the time interval to query, which is an alternative way to declare the interval: (youngest - timespan, youngest]. The timespan and oldest parameters should not be used together. Units: \n- s: second \n- m: minute \n- h: hour \n- d: day \n- w: week Examples: 2s, 3m, 4w. Only one unit is allowed, for example: 2w3d is not allowed; you should use 17d instead.\n\nIf neither oldest nor timespan is specified, the default time interval will be (youngest - 4 hours, youngest].", + // "location": "query", + // "pattern": "[0-9]+[smhdw]?", + // "type": "string" + // }, + // "window": { + // "description": "The sampling window. At most one data point will be returned for each window in the requested time interval. This parameter is only valid for non-cumulative metric types. Units: \n- m: minute \n- h: hour \n- d: day \n- w: week Examples: 3m, 4w. Only one unit is allowed, for example: 2w3d is not allowed; you should use 17d instead.", + // "location": "query", + // "pattern": "[0-9]+[mhdw]?", + // "type": "string" + // }, + // "youngest": { + // "description": "End of the time interval (inclusive), which is expressed as an RFC 3339 timestamp.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/timeseriesDescriptors/{metric}", + // "request": { + // "$ref": "ListTimeseriesDescriptorsRequest" + // }, + // "response": { + // "$ref": "ListTimeseriesDescriptorsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/monitoring" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/cloudresourcemanager/v1beta1/cloudresourcemanager-api.json b/Godeps/_workspace/src/google.golang.org/api/cloudresourcemanager/v1beta1/cloudresourcemanager-api.json new file mode 100644 index 000000000..64728338e --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/cloudresourcemanager/v1beta1/cloudresourcemanager-api.json @@ -0,0 +1,716 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/YIS10F0R5FiTmx2jJKQHlRv-GwY\"", + "discoveryVersion": "v1", + "id": "cloudresourcemanager:v1beta1", + "name": "cloudresourcemanager", + "version": "v1beta1", + "revision": "20150909", + "title": "Google Cloud Resource Manager API", + "description": "The Google Cloud Resource Manager API provides methods for creating, reading, and updating of project metadata.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/resource-manager", + "protocol": "rest", + "baseUrl": "https://cloudresourcemanager.googleapis.com/", + "basePath": "/", + "rootUrl": "https://cloudresourcemanager.googleapis.com/", + "servicePath": "", + "batchPath": "batch", + "parameters": { + "access_token": { + "type": "string", + "description": "OAuth access token.", + "location": "query" + }, + "alt": { + "type": "string", + "description": "Data format for response.", + "default": "json", + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query" + }, + "bearer_token": { + "type": "string", + "description": "OAuth bearer token.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JSONP", + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "pp": { + "type": "boolean", + "description": "Pretty-print response.", + "default": "true", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query" + }, + "upload_protocol": { + "type": "string", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query" + }, + "uploadType": { + "type": "string", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query" + }, + "$.xgafv": { + "type": "string", + "description": "V1 error format.", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "schemas": { + "Project": { + "id": "Project", + "type": "object", + "description": "A Project is a high-level Google Cloud Platform entity. It is a container for ACLs, APIs, AppEngine Apps, VMs, and other Google Cloud Platform resources.", + "properties": { + "projectNumber": { + "type": "string", + "description": "The number uniquely identifying the project. Example: 415104041262 Read-only.", + "format": "int64" + }, + "projectId": { + "type": "string", + "description": "The unique, user-assigned ID of the project. It must be 6 to 30 lowercase letters, digits, or hyphens. It must start with a letter. Trailing hyphens are prohibited. Example: tokyo-rain-123 Read-only after creation." + }, + "lifecycleState": { + "type": "string", + "description": "The project lifecycle state. Read-only.", + "enum": [ + "LIFECYCLE_STATE_UNSPECIFIED", + "ACTIVE", + "DELETE_REQUESTED", + "DELETE_IN_PROGRESS" + ] + }, + "name": { + "type": "string", + "description": "The user-assigned name of the project. It must be 4 to 30 characters. Allowed characters are: lowercase and uppercase letters, numbers, hyphen, single-quote, double-quote, space, and exclamation point. Example: My Project Read-write." + }, + "createTime": { + "type": "string", + "description": "Creation time. Read-only." + }, + "labels": { + "type": "object", + "description": "The labels associated with this project. Label keys must be between 1 and 63 characters long and must conform to the following regular expression: \\[a-z\\](\\[-a-z0-9\\]*\\[a-z0-9\\])?. Label values must be between 0 and 63 characters long and must conform to the regular expression (\\[a-z\\](\\[-a-z0-9\\]*\\[a-z0-9\\])?)?. No more than 256 labels can be associated with a given resource. Clients should store labels in a representation such as JSON that does not depend on specific characters being disallowed. Example: \"environment\" : \"dev\" Read-write.", + "additionalProperties": { + "type": "string" + } + }, + "parent": { + "$ref": "ResourceId", + "description": "An optional reference to a parent Resource. The only supported parent type is \"organization\". Once set, the parent cannot be modified. Read-write." + } + } + }, + "ResourceId": { + "id": "ResourceId", + "type": "object", + "description": "A container to reference an id for any resource type. A 'resource' in Google Cloud Platform is a generic term for something you (a developer) may want to interact with through one of our API's. Some examples are an AppEngine app, a Compute Engine instance, Cloud SQL database, ...", + "properties": { + "type": { + "type": "string", + "description": "Required field representing the resource type this id is for. At present, the only valid type is \"organization\"." + }, + "id": { + "type": "string", + "description": "Required field for the type-specific id. This should correspond to the id used in the type-specific API's." + } + } + }, + "ListProjectsResponse": { + "id": "ListProjectsResponse", + "type": "object", + "description": "A page of the response received from the [ListProjects][google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.ListProjects] method. A paginated response where more pages are available has `next_page_token` set. This token can be used in a subsequent request to retrieve the next request page.", + "properties": { + "projects": { + "type": "array", + "description": "The list of projects that matched the list filter. This list can be paginated.", + "items": { + "$ref": "Project" + } + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token. If the result set is too large to fit in a single response, this token is returned. It encodes the position of the current result cursor. Feeding this value into a new list request with the `page_token` parameter gives the next page of the results. When `next_page_token` is not filled in, there is no next page and the list returned is the last page in the result set. Pagination tokens have a limited lifetime. Note: pagination is not yet supported; the server will not set this field." + } + } + }, + "Empty": { + "id": "Empty", + "type": "object", + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`." + }, + "GetIamPolicyRequest": { + "id": "GetIamPolicyRequest", + "type": "object", + "description": "Request message for `GetIamPolicy` method." + }, + "Policy": { + "id": "Policy", + "type": "object", + "description": "Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources. A `Policy` consists of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, where the members can be user accounts, Google groups, Google domains, and service accounts. A `role` is a named list of permissions defined by IAM. **Example** ``` { \"bindings\": [ { \"role\": \"roles/owner\", \"members\": [ \"user:mike@example.com\", \"group:admins@example.com\", \"domain:google.com\", \"serviceAccount:my-other-app@appspot.gserviceaccount.com\"] }, { \"role\": \"roles/viewer\", \"members\": [\"user:sean@example.com\"] } ] } ``` For a description of IAM and its features, see the [IAM developer's guide][https://cloud.google.com/iam].", + "properties": { + "version": { + "type": "integer", + "description": "Version of the `Policy`. The default version is 0.", + "format": "int32" + }, + "bindings": { + "type": "array", + "description": "Associates a list of `members` to a `role`. Multiple `bindings` must not be specified for the same `role`. `bindings` with no members will result in an error.", + "items": { + "$ref": "Binding" + } + }, + "etag": { + "type": "string", + "description": "Can be used to perform a read-modify-write.", + "format": "byte" + } + } + }, + "Binding": { + "id": "Binding", + "type": "object", + "description": "Associates `members` with a `role`.", + "properties": { + "role": { + "type": "string", + "description": "Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. Required" + }, + "members": { + "type": "array", + "description": "Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following formats: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` or `joe@example.com`. * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`.", + "items": { + "type": "string" + } + } + } + }, + "SetIamPolicyRequest": { + "id": "SetIamPolicyRequest", + "type": "object", + "description": "Request message for `SetIamPolicy` method.", + "properties": { + "policy": { + "$ref": "Policy", + "description": "REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them." + } + } + }, + "TestIamPermissionsRequest": { + "id": "TestIamPermissionsRequest", + "type": "object", + "description": "Request message for `TestIamPermissions` method.", + "properties": { + "permissions": { + "type": "array", + "description": "The set of permissions to check for the `resource`. Permissions with wildcards (such as '*' or 'storage.*') are not allowed.", + "items": { + "type": "string" + } + } + } + }, + "TestIamPermissionsResponse": { + "id": "TestIamPermissionsResponse", + "type": "object", + "description": "Response message for `TestIamPermissions` method.", + "properties": { + "permissions": { + "type": "array", + "description": "A subset of `TestPermissionsRequest.permissions` that the caller is allowed.", + "items": { + "type": "string" + } + } + } + }, + "ListOrganizationsResponse": { + "id": "ListOrganizationsResponse", + "type": "object", + "description": "The response returned from the ListOrganizations method.", + "properties": { + "organizations": { + "type": "array", + "description": "The list of Organizations that matched the list query, possibly paginated.", + "items": { + "$ref": "Organization" + } + }, + "nextPageToken": { + "type": "string", + "description": "A pagination token to be used to retrieve the next page of results. If the result is too large to fit within the page size specified in the request, this field will be set with a token that can be used to fetch the next page of results. If this field is empty, it indicates that this response contains the last page of results." + } + } + }, + "Organization": { + "id": "Organization", + "type": "object", + "description": "The root node in the resource hierarchy to which a particular entity's (e.g., company) resources belong.", + "properties": { + "organizationId": { + "type": "string", + "description": "An immutable id for the Organization that is assigned on creation. This should be omitted when creating a new Organization. This field is read-only." + }, + "displayName": { + "type": "string", + "description": "A friendly string to be used to refer to the Organization in the UI. This field is required." + }, + "owner": { + "$ref": "OrganizationOwner", + "description": "The owner of this Organization. The owner should be specified upon creation. Once set, it cannot be changed. This field is required." + } + } + }, + "OrganizationOwner": { + "id": "OrganizationOwner", + "type": "object", + "description": "The entity that owns an Organization. The lifetime of the Organization and all of its descendants are bound to the OrganizationOwner. If the OrganizationOwner is deleted, the Organization and all its descendants will be deleted.", + "properties": { + "directoryCustomerId": { + "type": "string", + "description": "The Google for Work customer id used in the Directory API." + } + } + } + }, + "resources": { + "projects": { + "methods": { + "create": { + "id": "cloudresourcemanager.projects.create", + "path": "v1beta1/projects", + "httpMethod": "POST", + "description": "Creates a project resource. Initially, the project resource is owned by its creator exclusively. The creator can later grant permission to others to read or update the project. Several APIs are activated automatically for the project, including Google Cloud Storage.", + "request": { + "$ref": "Project" + }, + "response": { + "$ref": "Project" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "id": "cloudresourcemanager.projects.list", + "path": "v1beta1/projects", + "httpMethod": "GET", + "description": "Lists projects that are visible to the user and satisfy the specified filter. This method returns projects in an unspecified order. New projects do not necessarily appear at the end of the list.", + "parameters": { + "pageToken": { + "type": "string", + "description": "A pagination token returned from a previous call to ListProject that indicates from where listing should continue. Note: pagination is not yet supported; the server ignores this field. Optional.", + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of Projects to return in the response. The server can return fewer projects than requested. If unspecified, server picks an appropriate default. Note: pagination is not yet supported; the server ignores this field. Optional.", + "format": "int32", + "location": "query" + }, + "filter": { + "type": "string", + "description": "An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are: + `name` + `id` + labels.key where *key* is the name of a label Some examples of using labels as filters: |Filter|Description| |------|-----------| |name:*|The project has a name.| |name:Howl|The project's name is `Howl` or `howl`.| |name:HOWL|Equivalent to above.| |NAME:howl|Equivalent to above.| |labels.color:*|The project has the label `color`.| |labels.color:red|The project's label `color` has the value `red`.| |labels.color:red label.size:big|The project's label `color` has the value `red` and its label `size` has the value `big`. Optional.", + "location": "query" + } + }, + "response": { + "$ref": "ListProjectsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "id": "cloudresourcemanager.projects.get", + "path": "v1beta1/projects/{projectId}", + "httpMethod": "GET", + "description": "Retrieves the project identified by the specified `project_id` (for example, `my-project-123`). The caller must have read permissions for this project.", + "parameters": { + "projectId": { + "type": "string", + "description": "The project ID (for example, `my-project-123`). Required.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "Project" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "update": { + "id": "cloudresourcemanager.projects.update", + "path": "v1beta1/projects/{projectId}", + "httpMethod": "PUT", + "description": "Updates the attributes of the project identified by the specified `project_id` (for example, `my-project-123`). The caller must have modify permissions for this project.", + "parameters": { + "projectId": { + "type": "string", + "description": "The project ID (for example, `my-project-123`). Required.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId" + ], + "request": { + "$ref": "Project" + }, + "response": { + "$ref": "Project" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "id": "cloudresourcemanager.projects.delete", + "path": "v1beta1/projects/{projectId}", + "httpMethod": "DELETE", + "description": "Marks the project identified by the specified `project_id` (for example, `my-project-123`) for deletion. This method will only affect the project if the following criteria are met: + The project does not have a billing account associated with it. + The project has a lifecycle state of [ACTIVE][google.cloudresourcemanager.projects.v1beta1.LifecycleState.ACTIVE]. This method changes the project's lifecycle state from [ACTIVE][google.cloudresourcemanager.projects.v1beta1.LifecycleState.ACTIVE] to [DELETE_REQUESTED] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_REQUESTED]. The deletion starts at an unspecified time, at which point the lifecycle state changes to [DELETE_IN_PROGRESS] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_IN_PROGRESS]. Until the deletion completes, you can check the lifecycle state checked by retrieving the project with [GetProject] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.GetProject], and the project remains visible to [ListProjects] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.ListProjects]. However, you cannot update the project. After the deletion completes, the project is not retrievable by the [GetProject] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.GetProject] and [ListProjects] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.ListProjects] methods. The caller must have modify permissions for this project.", + "parameters": { + "projectId": { + "type": "string", + "description": "The project ID (for example, `foo-bar-123`). Required.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "undelete": { + "id": "cloudresourcemanager.projects.undelete", + "path": "v1beta1/projects/{projectId}:undelete", + "httpMethod": "POST", + "description": "Restores the project identified by the specified `project_id` (for example, `my-project-123`). You can only use this method for a project that has a lifecycle state of [DELETE_REQUESTED] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_REQUESTED]. After deletion starts, as indicated by a lifecycle state of [DELETE_IN_PROGRESS] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_IN_PROGRESS], the project cannot be restored. The caller must have modify permissions for this project.", + "parameters": { + "projectId": { + "type": "string", + "description": "The project ID (for example, `foo-bar-123`). Required.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "getIamPolicy": { + "id": "cloudresourcemanager.projects.getIamPolicy", + "path": "v1beta1/projects/{resource}:getIamPolicy", + "httpMethod": "POST", + "description": "Returns the IAM access control policy for specified project.", + "parameters": { + "resource": { + "type": "string", + "description": "REQUIRED: The resource for which policy is being requested. Resource is usually specified as a path, such as, `projects/{project}`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "resource" + ], + "request": { + "$ref": "GetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "setIamPolicy": { + "id": "cloudresourcemanager.projects.setIamPolicy", + "path": "v1beta1/projects/{resource}:setIamPolicy", + "httpMethod": "POST", + "description": "Sets the IAM access control policy for the specified project. We do not currently support 'domain:' prefixed members in a Binding of a Policy. Calling this method requires enabling the App Engine Admin API.", + "parameters": { + "resource": { + "type": "string", + "description": "REQUIRED: The resource for which policy is being specified. `resource` is usually specified as a path, such as, `projects/{project}/zones/{zone}/disks/{disk}`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "resource" + ], + "request": { + "$ref": "SetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "testIamPermissions": { + "id": "cloudresourcemanager.projects.testIamPermissions", + "path": "v1beta1/projects/{resource}:testIamPermissions", + "httpMethod": "POST", + "description": "Tests the specified permissions against the IAM access control policy for the specified project.", + "parameters": { + "resource": { + "type": "string", + "description": "REQUIRED: The resource for which policy detail is being requested. `resource` is usually specified as a path, such as, `projects/{project}`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "resource" + ], + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "organizations": { + "methods": { + "list": { + "id": "cloudresourcemanager.organizations.list", + "path": "v1beta1/organizations", + "httpMethod": "GET", + "description": "Query Organization resources.", + "parameters": { + "pageSize": { + "type": "integer", + "description": "The maximum number of Organizations to return in the response. This field is optional.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A pagination token returned from a previous call to ListOrganizations that indicates from where listing should continue. This field is optional.", + "location": "query" + }, + "filter": { + "type": "string", + "description": "An optional query string used to filter the Organizations to be return in the response. Filter rules are case-insensitive. Organizations may be filtered by `owner.directoryCustomerId` or by `domain`, where the domain is a Google for Work domain, for example: |Filter|Description| |------|-----------| |owner.directorycustomerid:123456789|Organizations with `owner.directory_customer_id` equal to `123456789`.| |domain:google.com|Organizations corresponding to the domain `google.com`.| This field is optional.", + "location": "query" + } + }, + "response": { + "$ref": "ListOrganizationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "id": "cloudresourcemanager.organizations.get", + "path": "v1beta1/organizations/{organizationId}", + "httpMethod": "GET", + "description": "Fetches an Organization resource by id.", + "parameters": { + "organizationId": { + "type": "string", + "description": "The id of the Organization resource to fetch.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "organizationId" + ], + "response": { + "$ref": "Organization" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "update": { + "id": "cloudresourcemanager.organizations.update", + "path": "v1beta1/organizations/{organizationId}", + "httpMethod": "PUT", + "description": "Updates an Organization resource.", + "parameters": { + "organizationId": { + "type": "string", + "description": "An immutable id for the Organization that is assigned on creation. This should be omitted when creating a new Organization. This field is read-only.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "organizationId" + ], + "request": { + "$ref": "Organization" + }, + "response": { + "$ref": "Organization" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "setIamPolicy": { + "id": "cloudresourcemanager.organizations.setIamPolicy", + "path": "v1beta1/organizations/{resource}:setIamPolicy", + "httpMethod": "POST", + "description": "Sets the access control policy on a Organization resource. Replaces any existing policy.", + "parameters": { + "resource": { + "type": "string", + "description": "REQUIRED: The resource for which policy is being specified. `resource` is usually specified as a path, such as, `projects/{project}/zones/{zone}/disks/{disk}`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "resource" + ], + "request": { + "$ref": "SetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "getIamPolicy": { + "id": "cloudresourcemanager.organizations.getIamPolicy", + "path": "v1beta1/organizations/{resource}:getIamPolicy", + "httpMethod": "POST", + "description": "Gets the access control policy for a Organization resource. May be empty if no such policy or resource exists.", + "parameters": { + "resource": { + "type": "string", + "description": "REQUIRED: The resource for which policy is being requested. Resource is usually specified as a path, such as, `projects/{project}`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "resource" + ], + "request": { + "$ref": "GetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "testIamPermissions": { + "id": "cloudresourcemanager.organizations.testIamPermissions", + "path": "v1beta1/organizations/{resource}:testIamPermissions", + "httpMethod": "POST", + "description": "Returns permissions that a caller has on the specified Organization.", + "parameters": { + "resource": { + "type": "string", + "description": "REQUIRED: The resource for which policy detail is being requested. `resource` is usually specified as a path, such as, `projects/{project}`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "resource" + ], + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/cloudresourcemanager/v1beta1/cloudresourcemanager-gen.go b/Godeps/_workspace/src/google.golang.org/api/cloudresourcemanager/v1beta1/cloudresourcemanager-gen.go new file mode 100644 index 000000000..756d0b453 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/cloudresourcemanager/v1beta1/cloudresourcemanager-gen.go @@ -0,0 +1,2466 @@ +// Package cloudresourcemanager provides access to the Google Cloud Resource Manager API. +// +// See https://cloud.google.com/resource-manager +// +// Usage example: +// +// import "google.golang.org/api/cloudresourcemanager/v1beta1" +// ... +// cloudresourcemanagerService, err := cloudresourcemanager.New(oauthHttpClient) +package cloudresourcemanager // import "google.golang.org/api/cloudresourcemanager/v1beta1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "cloudresourcemanager:v1beta1" +const apiName = "cloudresourcemanager" +const apiVersion = "v1beta1" +const basePath = "https://cloudresourcemanager.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your data across Google Cloud Platform services + CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Organizations = NewOrganizationsService(s) + s.Projects = NewProjectsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Organizations *OrganizationsService + + Projects *ProjectsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewOrganizationsService(s *Service) *OrganizationsService { + rs := &OrganizationsService{s: s} + return rs +} + +type OrganizationsService struct { + s *Service +} + +func NewProjectsService(s *Service) *ProjectsService { + rs := &ProjectsService{s: s} + return rs +} + +type ProjectsService struct { + s *Service +} + +// Binding: Associates `members` with a `role`. +type Binding struct { + // Members: Specifies the identities requesting access for a Cloud + // Platform resource. `members` can have the following formats: * + // `allUsers`: A special identifier that represents anyone who is on the + // internet; with or without a Google account. * + // `allAuthenticatedUsers`: A special identifier that represents anyone + // who is authenticated with a Google account or a service account. * + // `user:{emailid}`: An email address that represents a specific Google + // account. For example, `alice@gmail.com` or `joe@example.com`. * + // `serviceAccount:{emailid}`: An email address that represents a + // service account. For example, + // `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An + // email address that represents a Google group. For example, + // `admins@example.com`. * `domain:{domain}`: A Google Apps domain name + // that represents all the users of that domain. For example, + // `google.com` or `example.com`. + Members []string `json:"members,omitempty"` + + // Role: Role that is assigned to `members`. For example, + // `roles/viewer`, `roles/editor`, or `roles/owner`. Required + Role string `json:"role,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Members") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Binding) MarshalJSON() ([]byte, error) { + type noMethod Binding + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Empty: A generic empty message that you can re-use to avoid defining +// duplicated empty messages in your APIs. A typical example is to use +// it as the request or the response type of an API method. For +// instance: service Foo { rpc Bar(google.protobuf.Empty) returns +// (google.protobuf.Empty); } The JSON representation for `Empty` is +// empty JSON object `{}`. +type Empty struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// GetIamPolicyRequest: Request message for `GetIamPolicy` method. +type GetIamPolicyRequest struct { +} + +// ListOrganizationsResponse: The response returned from the +// ListOrganizations method. +type ListOrganizationsResponse struct { + // NextPageToken: A pagination token to be used to retrieve the next + // page of results. If the result is too large to fit within the page + // size specified in the request, this field will be set with a token + // that can be used to fetch the next page of results. If this field is + // empty, it indicates that this response contains the last page of + // results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Organizations: The list of Organizations that matched the list query, + // possibly paginated. + Organizations []*Organization `json:"organizations,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListOrganizationsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListOrganizationsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListProjectsResponse: A page of the response received from the +// [ListProjects][google.cloudresourcemanager.projects.v1beta1.DeveloperP +// rojects.ListProjects] method. A paginated response where more pages +// are available has `next_page_token` set. This token can be used in a +// subsequent request to retrieve the next request page. +type ListProjectsResponse struct { + // NextPageToken: Pagination token. If the result set is too large to + // fit in a single response, this token is returned. It encodes the + // position of the current result cursor. Feeding this value into a new + // list request with the `page_token` parameter gives the next page of + // the results. When `next_page_token` is not filled in, there is no + // next page and the list returned is the last page in the result set. + // Pagination tokens have a limited lifetime. Note: pagination is not + // yet supported; the server will not set this field. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Projects: The list of projects that matched the list filter. This + // list can be paginated. + Projects []*Project `json:"projects,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListProjectsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListProjectsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Organization: The root node in the resource hierarchy to which a +// particular entity's (e.g., company) resources belong. +type Organization struct { + // DisplayName: A friendly string to be used to refer to the + // Organization in the UI. This field is required. + DisplayName string `json:"displayName,omitempty"` + + // OrganizationId: An immutable id for the Organization that is assigned + // on creation. This should be omitted when creating a new Organization. + // This field is read-only. + OrganizationId string `json:"organizationId,omitempty"` + + // Owner: The owner of this Organization. The owner should be specified + // upon creation. Once set, it cannot be changed. This field is + // required. + Owner *OrganizationOwner `json:"owner,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Organization) MarshalJSON() ([]byte, error) { + type noMethod Organization + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OrganizationOwner: The entity that owns an Organization. The lifetime +// of the Organization and all of its descendants are bound to the +// OrganizationOwner. If the OrganizationOwner is deleted, the +// Organization and all its descendants will be deleted. +type OrganizationOwner struct { + // DirectoryCustomerId: The Google for Work customer id used in the + // Directory API. + DirectoryCustomerId string `json:"directoryCustomerId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DirectoryCustomerId") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrganizationOwner) MarshalJSON() ([]byte, error) { + type noMethod OrganizationOwner + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Policy: Defines an Identity and Access Management (IAM) policy. It is +// used to specify access control policies for Cloud Platform resources. +// A `Policy` consists of a list of `bindings`. A `Binding` binds a list +// of `members` to a `role`, where the members can be user accounts, +// Google groups, Google domains, and service accounts. A `role` is a +// named list of permissions defined by IAM. **Example** ``` { +// "bindings": [ { "role": "roles/owner", "members": [ +// "user:mike@example.com", "group:admins@example.com", +// "domain:google.com", +// "serviceAccount:my-other-app@appspot.gserviceaccount.com"] }, { +// "role": "roles/viewer", "members": ["user:sean@example.com"] } ] } +// ``` For a description of IAM and its features, see the [IAM +// developer's guide][https://cloud.google.com/iam]. +type Policy struct { + // Bindings: Associates a list of `members` to a `role`. Multiple + // `bindings` must not be specified for the same `role`. `bindings` with + // no members will result in an error. + Bindings []*Binding `json:"bindings,omitempty"` + + // Etag: Can be used to perform a read-modify-write. + Etag string `json:"etag,omitempty"` + + // Version: Version of the `Policy`. The default version is 0. + Version int64 `json:"version,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Bindings") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Policy) MarshalJSON() ([]byte, error) { + type noMethod Policy + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Project: A Project is a high-level Google Cloud Platform entity. It +// is a container for ACLs, APIs, AppEngine Apps, VMs, and other Google +// Cloud Platform resources. +type Project struct { + // CreateTime: Creation time. Read-only. + CreateTime string `json:"createTime,omitempty"` + + // Labels: The labels associated with this project. Label keys must be + // between 1 and 63 characters long and must conform to the following + // regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. Label values + // must be between 0 and 63 characters long and must conform to the + // regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. No more than + // 256 labels can be associated with a given resource. Clients should + // store labels in a representation such as JSON that does not depend on + // specific characters being disallowed. Example: "environment" : "dev" + // Read-write. + Labels map[string]string `json:"labels,omitempty"` + + // LifecycleState: The project lifecycle state. Read-only. + // + // Possible values: + // "LIFECYCLE_STATE_UNSPECIFIED" + // "ACTIVE" + // "DELETE_REQUESTED" + // "DELETE_IN_PROGRESS" + LifecycleState string `json:"lifecycleState,omitempty"` + + // Name: The user-assigned name of the project. It must be 4 to 30 + // characters. Allowed characters are: lowercase and uppercase letters, + // numbers, hyphen, single-quote, double-quote, space, and exclamation + // point. Example: My Project Read-write. + Name string `json:"name,omitempty"` + + // Parent: An optional reference to a parent Resource. The only + // supported parent type is "organization". Once set, the parent cannot + // be modified. Read-write. + Parent *ResourceId `json:"parent,omitempty"` + + // ProjectId: The unique, user-assigned ID of the project. It must be 6 + // to 30 lowercase letters, digits, or hyphens. It must start with a + // letter. Trailing hyphens are prohibited. Example: tokyo-rain-123 + // Read-only after creation. + ProjectId string `json:"projectId,omitempty"` + + // ProjectNumber: The number uniquely identifying the project. Example: + // 415104041262 Read-only. + ProjectNumber int64 `json:"projectNumber,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Project) MarshalJSON() ([]byte, error) { + type noMethod Project + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ResourceId: A container to reference an id for any resource type. A +// 'resource' in Google Cloud Platform is a generic term for something +// you (a developer) may want to interact with through one of our API's. +// Some examples are an AppEngine app, a Compute Engine instance, Cloud +// SQL database, ... +type ResourceId struct { + // Id: Required field for the type-specific id. This should correspond + // to the id used in the type-specific API's. + Id string `json:"id,omitempty"` + + // Type: Required field representing the resource type this id is for. + // At present, the only valid type is "organization". + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResourceId) MarshalJSON() ([]byte, error) { + type noMethod ResourceId + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SetIamPolicyRequest: Request message for `SetIamPolicy` method. +type SetIamPolicyRequest struct { + // Policy: REQUIRED: The complete policy to be applied to the + // `resource`. The size of the policy is limited to a few 10s of KB. An + // empty policy is a valid policy but certain Cloud Platform services + // (such as Projects) might reject them. + Policy *Policy `json:"policy,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Policy") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { + type noMethod SetIamPolicyRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TestIamPermissionsRequest: Request message for `TestIamPermissions` +// method. +type TestIamPermissionsRequest struct { + // Permissions: The set of permissions to check for the `resource`. + // Permissions with wildcards (such as '*' or 'storage.*') are not + // allowed. + Permissions []string `json:"permissions,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Permissions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) { + type noMethod TestIamPermissionsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TestIamPermissionsResponse: Response message for `TestIamPermissions` +// method. +type TestIamPermissionsResponse struct { + // Permissions: A subset of `TestPermissionsRequest.permissions` that + // the caller is allowed. + Permissions []string `json:"permissions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Permissions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { + type noMethod TestIamPermissionsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "cloudresourcemanager.organizations.get": + +type OrganizationsGetCall struct { + s *Service + organizationId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Fetches an Organization resource by id. +func (r *OrganizationsService) Get(organizationId string) *OrganizationsGetCall { + c := &OrganizationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.organizationId = organizationId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsGetCall) Fields(s ...googleapi.Field) *OrganizationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsGetCall) IfNoneMatch(entityTag string) *OrganizationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrganizationsGetCall) Context(ctx context.Context) *OrganizationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *OrganizationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/organizations/{organizationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "organizationId": c.organizationId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudresourcemanager.organizations.get" call. +// Exactly one of *Organization or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Organization.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OrganizationsGetCall) Do() (*Organization, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Organization{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Fetches an Organization resource by id.", + // "httpMethod": "GET", + // "id": "cloudresourcemanager.organizations.get", + // "parameterOrder": [ + // "organizationId" + // ], + // "parameters": { + // "organizationId": { + // "description": "The id of the Organization resource to fetch.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/organizations/{organizationId}", + // "response": { + // "$ref": "Organization" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudresourcemanager.organizations.getIamPolicy": + +type OrganizationsGetIamPolicyCall struct { + s *Service + resource string + getiampolicyrequest *GetIamPolicyRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetIamPolicy: Gets the access control policy for a Organization +// resource. May be empty if no such policy or resource exists. +func (r *OrganizationsService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *OrganizationsGetIamPolicyCall { + c := &OrganizationsGetIamPolicyCall{s: r.s, opt_: make(map[string]interface{})} + c.resource = resource + c.getiampolicyrequest = getiampolicyrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsGetIamPolicyCall) Fields(s ...googleapi.Field) *OrganizationsGetIamPolicyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrganizationsGetIamPolicyCall) Context(ctx context.Context) *OrganizationsGetIamPolicyCall { + c.ctx_ = ctx + return c +} + +func (c *OrganizationsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/organizations/{resource}:getIamPolicy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudresourcemanager.organizations.getIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsGetIamPolicyCall) Do() (*Policy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the access control policy for a Organization resource. May be empty if no such policy or resource exists.", + // "httpMethod": "POST", + // "id": "cloudresourcemanager.organizations.getIamPolicy", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which policy is being requested. Resource is usually specified as a path, such as, `projects/{project}`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/organizations/{resource}:getIamPolicy", + // "request": { + // "$ref": "GetIamPolicyRequest" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudresourcemanager.organizations.list": + +type OrganizationsListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Query Organization resources. +func (r *OrganizationsService) List() *OrganizationsListCall { + c := &OrganizationsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Filter sets the optional parameter "filter": An optional query string +// used to filter the Organizations to be return in the response. Filter +// rules are case-insensitive. Organizations may be filtered by +// `owner.directoryCustomerId` or by `domain`, where the domain is a +// Google for Work domain, for example: |Filter|Description| +// |------|-----------| +// |owner.directorycustomerid:123456789|Organizations with +// `owner.directory_customer_id` equal to `123456789`.| +// |domain:google.com|Organizations corresponding to the domain +// `google.com`.| This field is optional. +func (c *OrganizationsListCall) Filter(filter string) *OrganizationsListCall { + c.opt_["filter"] = filter + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of Organizations to return in the response. This field is optional. +func (c *OrganizationsListCall) PageSize(pageSize int64) *OrganizationsListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": A pagination token +// returned from a previous call to ListOrganizations that indicates +// from where listing should continue. This field is optional. +func (c *OrganizationsListCall) PageToken(pageToken string) *OrganizationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsListCall) Fields(s ...googleapi.Field) *OrganizationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrganizationsListCall) IfNoneMatch(entityTag string) *OrganizationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrganizationsListCall) Context(ctx context.Context) *OrganizationsListCall { + c.ctx_ = ctx + return c +} + +func (c *OrganizationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/organizations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudresourcemanager.organizations.list" call. +// Exactly one of *ListOrganizationsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListOrganizationsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsListCall) Do() (*ListOrganizationsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListOrganizationsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Query Organization resources.", + // "httpMethod": "GET", + // "id": "cloudresourcemanager.organizations.list", + // "parameters": { + // "filter": { + // "description": "An optional query string used to filter the Organizations to be return in the response. Filter rules are case-insensitive. Organizations may be filtered by `owner.directoryCustomerId` or by `domain`, where the domain is a Google for Work domain, for example: |Filter|Description| |------|-----------| |owner.directorycustomerid:123456789|Organizations with `owner.directory_customer_id` equal to `123456789`.| |domain:google.com|Organizations corresponding to the domain `google.com`.| This field is optional.", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of Organizations to return in the response. This field is optional.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A pagination token returned from a previous call to ListOrganizations that indicates from where listing should continue. This field is optional.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1beta1/organizations", + // "response": { + // "$ref": "ListOrganizationsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudresourcemanager.organizations.setIamPolicy": + +type OrganizationsSetIamPolicyCall struct { + s *Service + resource string + setiampolicyrequest *SetIamPolicyRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetIamPolicy: Sets the access control policy on a Organization +// resource. Replaces any existing policy. +func (r *OrganizationsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *OrganizationsSetIamPolicyCall { + c := &OrganizationsSetIamPolicyCall{s: r.s, opt_: make(map[string]interface{})} + c.resource = resource + c.setiampolicyrequest = setiampolicyrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsSetIamPolicyCall) Fields(s ...googleapi.Field) *OrganizationsSetIamPolicyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrganizationsSetIamPolicyCall) Context(ctx context.Context) *OrganizationsSetIamPolicyCall { + c.ctx_ = ctx + return c +} + +func (c *OrganizationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/organizations/{resource}:setIamPolicy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudresourcemanager.organizations.setIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrganizationsSetIamPolicyCall) Do() (*Policy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the access control policy on a Organization resource. Replaces any existing policy.", + // "httpMethod": "POST", + // "id": "cloudresourcemanager.organizations.setIamPolicy", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which policy is being specified. `resource` is usually specified as a path, such as, `projects/{project}/zones/{zone}/disks/{disk}`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/organizations/{resource}:setIamPolicy", + // "request": { + // "$ref": "SetIamPolicyRequest" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudresourcemanager.organizations.testIamPermissions": + +type OrganizationsTestIamPermissionsCall struct { + s *Service + resource string + testiampermissionsrequest *TestIamPermissionsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// TestIamPermissions: Returns permissions that a caller has on the +// specified Organization. +func (r *OrganizationsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *OrganizationsTestIamPermissionsCall { + c := &OrganizationsTestIamPermissionsCall{s: r.s, opt_: make(map[string]interface{})} + c.resource = resource + c.testiampermissionsrequest = testiampermissionsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsTestIamPermissionsCall) Fields(s ...googleapi.Field) *OrganizationsTestIamPermissionsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrganizationsTestIamPermissionsCall) Context(ctx context.Context) *OrganizationsTestIamPermissionsCall { + c.ctx_ = ctx + return c +} + +func (c *OrganizationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/organizations/{resource}:testIamPermissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudresourcemanager.organizations.testIamPermissions" call. +// Exactly one of *TestIamPermissionsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TestIamPermissionsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrganizationsTestIamPermissionsCall) Do() (*TestIamPermissionsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TestIamPermissionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns permissions that a caller has on the specified Organization.", + // "httpMethod": "POST", + // "id": "cloudresourcemanager.organizations.testIamPermissions", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which policy detail is being requested. `resource` is usually specified as a path, such as, `projects/{project}`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/organizations/{resource}:testIamPermissions", + // "request": { + // "$ref": "TestIamPermissionsRequest" + // }, + // "response": { + // "$ref": "TestIamPermissionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudresourcemanager.organizations.update": + +type OrganizationsUpdateCall struct { + s *Service + organizationId string + organization *Organization + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an Organization resource. +func (r *OrganizationsService) Update(organizationId string, organization *Organization) *OrganizationsUpdateCall { + c := &OrganizationsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.organizationId = organizationId + c.organization = organization + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrganizationsUpdateCall) Fields(s ...googleapi.Field) *OrganizationsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrganizationsUpdateCall) Context(ctx context.Context) *OrganizationsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *OrganizationsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.organization) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/organizations/{organizationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "organizationId": c.organizationId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudresourcemanager.organizations.update" call. +// Exactly one of *Organization or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Organization.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OrganizationsUpdateCall) Do() (*Organization, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Organization{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an Organization resource.", + // "httpMethod": "PUT", + // "id": "cloudresourcemanager.organizations.update", + // "parameterOrder": [ + // "organizationId" + // ], + // "parameters": { + // "organizationId": { + // "description": "An immutable id for the Organization that is assigned on creation. This should be omitted when creating a new Organization. This field is read-only.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/organizations/{organizationId}", + // "request": { + // "$ref": "Organization" + // }, + // "response": { + // "$ref": "Organization" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudresourcemanager.projects.create": + +type ProjectsCreateCall struct { + s *Service + project *Project + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a project resource. Initially, the project resource +// is owned by its creator exclusively. The creator can later grant +// permission to others to read or update the project. Several APIs are +// activated automatically for the project, including Google Cloud +// Storage. +func (r *ProjectsService) Create(project *Project) *ProjectsCreateCall { + c := &ProjectsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsCreateCall) Fields(s ...googleapi.Field) *ProjectsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsCreateCall) Context(ctx context.Context) *ProjectsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.project) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudresourcemanager.projects.create" call. +// Exactly one of *Project or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Project.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsCreateCall) Do() (*Project, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Project{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a project resource. Initially, the project resource is owned by its creator exclusively. The creator can later grant permission to others to read or update the project. Several APIs are activated automatically for the project, including Google Cloud Storage.", + // "httpMethod": "POST", + // "id": "cloudresourcemanager.projects.create", + // "path": "v1beta1/projects", + // "request": { + // "$ref": "Project" + // }, + // "response": { + // "$ref": "Project" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudresourcemanager.projects.delete": + +type ProjectsDeleteCall struct { + s *Service + projectId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Marks the project identified by the specified `project_id` +// (for example, `my-project-123`) for deletion. This method will only +// affect the project if the following criteria are met: + The project +// does not have a billing account associated with it. + The project has +// a lifecycle state of +// [ACTIVE][google.cloudresourcemanager.projects.v1beta1.LifecycleState.A +// CTIVE]. This method changes the project's lifecycle state from +// [ACTIVE][google.cloudresourcemanager.projects.v1beta1.LifecycleState.A +// CTIVE] to [DELETE_REQUESTED] +// [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_RE +// QUESTED]. The deletion starts at an unspecified time, at which point +// the lifecycle state changes to [DELETE_IN_PROGRESS] +// [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_IN +// _PROGRESS]. Until the deletion completes, you can check the lifecycle +// state checked by retrieving the project with [GetProject] +// [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.GetPro +// ject], and the project remains visible to [ListProjects] +// [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.ListPr +// ojects]. However, you cannot update the project. After the deletion +// completes, the project is not retrievable by the [GetProject] +// [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.GetPro +// ject] and [ListProjects] +// [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.ListPr +// ojects] methods. The caller must have modify permissions for this +// project. +func (r *ProjectsService) Delete(projectId string) *ProjectsDeleteCall { + c := &ProjectsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsDeleteCall) Fields(s ...googleapi.Field) *ProjectsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsDeleteCall) Context(ctx context.Context) *ProjectsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudresourcemanager.projects.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Marks the project identified by the specified `project_id` (for example, `my-project-123`) for deletion. This method will only affect the project if the following criteria are met: + The project does not have a billing account associated with it. + The project has a lifecycle state of [ACTIVE][google.cloudresourcemanager.projects.v1beta1.LifecycleState.ACTIVE]. This method changes the project's lifecycle state from [ACTIVE][google.cloudresourcemanager.projects.v1beta1.LifecycleState.ACTIVE] to [DELETE_REQUESTED] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_REQUESTED]. The deletion starts at an unspecified time, at which point the lifecycle state changes to [DELETE_IN_PROGRESS] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_IN_PROGRESS]. Until the deletion completes, you can check the lifecycle state checked by retrieving the project with [GetProject] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.GetProject], and the project remains visible to [ListProjects] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.ListProjects]. However, you cannot update the project. After the deletion completes, the project is not retrievable by the [GetProject] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.GetProject] and [ListProjects] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.ListProjects] methods. The caller must have modify permissions for this project.", + // "httpMethod": "DELETE", + // "id": "cloudresourcemanager.projects.delete", + // "parameterOrder": [ + // "projectId" + // ], + // "parameters": { + // "projectId": { + // "description": "The project ID (for example, `foo-bar-123`). Required.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/projects/{projectId}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudresourcemanager.projects.get": + +type ProjectsGetCall struct { + s *Service + projectId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves the project identified by the specified `project_id` +// (for example, `my-project-123`). The caller must have read +// permissions for this project. +func (r *ProjectsService) Get(projectId string) *ProjectsGetCall { + c := &ProjectsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudresourcemanager.projects.get" call. +// Exactly one of *Project or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Project.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsGetCall) Do() (*Project, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Project{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the project identified by the specified `project_id` (for example, `my-project-123`). The caller must have read permissions for this project.", + // "httpMethod": "GET", + // "id": "cloudresourcemanager.projects.get", + // "parameterOrder": [ + // "projectId" + // ], + // "parameters": { + // "projectId": { + // "description": "The project ID (for example, `my-project-123`). Required.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/projects/{projectId}", + // "response": { + // "$ref": "Project" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudresourcemanager.projects.getIamPolicy": + +type ProjectsGetIamPolicyCall struct { + s *Service + resource string + getiampolicyrequest *GetIamPolicyRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetIamPolicy: Returns the IAM access control policy for specified +// project. +func (r *ProjectsService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsGetIamPolicyCall { + c := &ProjectsGetIamPolicyCall{s: r.s, opt_: make(map[string]interface{})} + c.resource = resource + c.getiampolicyrequest = getiampolicyrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsGetIamPolicyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsGetIamPolicyCall) Context(ctx context.Context) *ProjectsGetIamPolicyCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{resource}:getIamPolicy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudresourcemanager.projects.getIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsGetIamPolicyCall) Do() (*Policy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the IAM access control policy for specified project.", + // "httpMethod": "POST", + // "id": "cloudresourcemanager.projects.getIamPolicy", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which policy is being requested. Resource is usually specified as a path, such as, `projects/{project}`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/projects/{resource}:getIamPolicy", + // "request": { + // "$ref": "GetIamPolicyRequest" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudresourcemanager.projects.list": + +type ProjectsListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists projects that are visible to the user and satisfy the +// specified filter. This method returns projects in an unspecified +// order. New projects do not necessarily appear at the end of the list. +func (r *ProjectsService) List() *ProjectsListCall { + c := &ProjectsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Filter sets the optional parameter "filter": An expression for +// filtering the results of the request. Filter rules are case +// insensitive. The fields eligible for filtering are: + `name` + `id` + +// labels.key where *key* is the name of a label Some examples of using +// labels as filters: |Filter|Description| |------|-----------| +// |name:*|The project has a name.| |name:Howl|The project's name is +// `Howl` or `howl`.| |name:HOWL|Equivalent to above.| +// |NAME:howl|Equivalent to above.| |labels.color:*|The project has the +// label `color`.| |labels.color:red|The project's label `color` has the +// value `red`.| |labels.color:red label.size:big|The project's label +// `color` has the value `red` and its label `size` has the value `big`. +func (c *ProjectsListCall) Filter(filter string) *ProjectsListCall { + c.opt_["filter"] = filter + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of Projects to return in the response. The server can return fewer +// projects than requested. If unspecified, server picks an appropriate +// default. Note: pagination is not yet supported; the server ignores +// this field. +func (c *ProjectsListCall) PageSize(pageSize int64) *ProjectsListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": A pagination token +// returned from a previous call to ListProject that indicates from +// where listing should continue. Note: pagination is not yet supported; +// the server ignores this field. +func (c *ProjectsListCall) PageToken(pageToken string) *ProjectsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsListCall) Fields(s ...googleapi.Field) *ProjectsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsListCall) IfNoneMatch(entityTag string) *ProjectsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsListCall) Context(ctx context.Context) *ProjectsListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudresourcemanager.projects.list" call. +// Exactly one of *ListProjectsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListProjectsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsListCall) Do() (*ListProjectsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListProjectsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists projects that are visible to the user and satisfy the specified filter. This method returns projects in an unspecified order. New projects do not necessarily appear at the end of the list.", + // "httpMethod": "GET", + // "id": "cloudresourcemanager.projects.list", + // "parameters": { + // "filter": { + // "description": "An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are: + `name` + `id` + labels.key where *key* is the name of a label Some examples of using labels as filters: |Filter|Description| |------|-----------| |name:*|The project has a name.| |name:Howl|The project's name is `Howl` or `howl`.| |name:HOWL|Equivalent to above.| |NAME:howl|Equivalent to above.| |labels.color:*|The project has the label `color`.| |labels.color:red|The project's label `color` has the value `red`.| |labels.color:red label.size:big|The project's label `color` has the value `red` and its label `size` has the value `big`. Optional.", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of Projects to return in the response. The server can return fewer projects than requested. If unspecified, server picks an appropriate default. Note: pagination is not yet supported; the server ignores this field. Optional.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A pagination token returned from a previous call to ListProject that indicates from where listing should continue. Note: pagination is not yet supported; the server ignores this field. Optional.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1beta1/projects", + // "response": { + // "$ref": "ListProjectsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudresourcemanager.projects.setIamPolicy": + +type ProjectsSetIamPolicyCall struct { + s *Service + resource string + setiampolicyrequest *SetIamPolicyRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetIamPolicy: Sets the IAM access control policy for the specified +// project. We do not currently support 'domain:' prefixed members in a +// Binding of a Policy. Calling this method requires enabling the App +// Engine Admin API. +func (r *ProjectsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsSetIamPolicyCall { + c := &ProjectsSetIamPolicyCall{s: r.s, opt_: make(map[string]interface{})} + c.resource = resource + c.setiampolicyrequest = setiampolicyrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsSetIamPolicyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSetIamPolicyCall) Context(ctx context.Context) *ProjectsSetIamPolicyCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{resource}:setIamPolicy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudresourcemanager.projects.setIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsSetIamPolicyCall) Do() (*Policy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the IAM access control policy for the specified project. We do not currently support 'domain:' prefixed members in a Binding of a Policy. Calling this method requires enabling the App Engine Admin API.", + // "httpMethod": "POST", + // "id": "cloudresourcemanager.projects.setIamPolicy", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which policy is being specified. `resource` is usually specified as a path, such as, `projects/{project}/zones/{zone}/disks/{disk}`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/projects/{resource}:setIamPolicy", + // "request": { + // "$ref": "SetIamPolicyRequest" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudresourcemanager.projects.testIamPermissions": + +type ProjectsTestIamPermissionsCall struct { + s *Service + resource string + testiampermissionsrequest *TestIamPermissionsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// TestIamPermissions: Tests the specified permissions against the IAM +// access control policy for the specified project. +func (r *ProjectsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsTestIamPermissionsCall { + c := &ProjectsTestIamPermissionsCall{s: r.s, opt_: make(map[string]interface{})} + c.resource = resource + c.testiampermissionsrequest = testiampermissionsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsTestIamPermissionsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsTestIamPermissionsCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{resource}:testIamPermissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudresourcemanager.projects.testIamPermissions" call. +// Exactly one of *TestIamPermissionsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TestIamPermissionsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsTestIamPermissionsCall) Do() (*TestIamPermissionsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TestIamPermissionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Tests the specified permissions against the IAM access control policy for the specified project.", + // "httpMethod": "POST", + // "id": "cloudresourcemanager.projects.testIamPermissions", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which policy detail is being requested. `resource` is usually specified as a path, such as, `projects/{project}`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/projects/{resource}:testIamPermissions", + // "request": { + // "$ref": "TestIamPermissionsRequest" + // }, + // "response": { + // "$ref": "TestIamPermissionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudresourcemanager.projects.undelete": + +type ProjectsUndeleteCall struct { + s *Service + projectId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Undelete: Restores the project identified by the specified +// `project_id` (for example, `my-project-123`). You can only use this +// method for a project that has a lifecycle state of [DELETE_REQUESTED] +// [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_RE +// QUESTED]. After deletion starts, as indicated by a lifecycle state of +// [DELETE_IN_PROGRESS] +// [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_IN +// _PROGRESS], the project cannot be restored. The caller must have +// modify permissions for this project. +func (r *ProjectsService) Undelete(projectId string) *ProjectsUndeleteCall { + c := &ProjectsUndeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsUndeleteCall) Fields(s ...googleapi.Field) *ProjectsUndeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsUndeleteCall) Context(ctx context.Context) *ProjectsUndeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsUndeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}:undelete") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudresourcemanager.projects.undelete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsUndeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Restores the project identified by the specified `project_id` (for example, `my-project-123`). You can only use this method for a project that has a lifecycle state of [DELETE_REQUESTED] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_REQUESTED]. After deletion starts, as indicated by a lifecycle state of [DELETE_IN_PROGRESS] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_IN_PROGRESS], the project cannot be restored. The caller must have modify permissions for this project.", + // "httpMethod": "POST", + // "id": "cloudresourcemanager.projects.undelete", + // "parameterOrder": [ + // "projectId" + // ], + // "parameters": { + // "projectId": { + // "description": "The project ID (for example, `foo-bar-123`). Required.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/projects/{projectId}:undelete", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudresourcemanager.projects.update": + +type ProjectsUpdateCall struct { + s *Service + projectId string + project *Project + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates the attributes of the project identified by the +// specified `project_id` (for example, `my-project-123`). The caller +// must have modify permissions for this project. +func (r *ProjectsService) Update(projectId string, project *Project) *ProjectsUpdateCall { + c := &ProjectsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.project = project + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsUpdateCall) Fields(s ...googleapi.Field) *ProjectsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsUpdateCall) Context(ctx context.Context) *ProjectsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.project) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudresourcemanager.projects.update" call. +// Exactly one of *Project or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Project.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsUpdateCall) Do() (*Project, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Project{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the attributes of the project identified by the specified `project_id` (for example, `my-project-123`). The caller must have modify permissions for this project.", + // "httpMethod": "PUT", + // "id": "cloudresourcemanager.projects.update", + // "parameterOrder": [ + // "projectId" + // ], + // "parameters": { + // "projectId": { + // "description": "The project ID (for example, `my-project-123`). Required.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/projects/{projectId}", + // "request": { + // "$ref": "Project" + // }, + // "response": { + // "$ref": "Project" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/cloudtrace/v1/cloudtrace-api.json b/Godeps/_workspace/src/google.golang.org/api/cloudtrace/v1/cloudtrace-api.json new file mode 100644 index 000000000..a2ad026b8 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/cloudtrace/v1/cloudtrace-api.json @@ -0,0 +1,385 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/aRfd7FZnMyWmSYyC0t8ruQh7iCI\"", + "discoveryVersion": "v1", + "id": "cloudtrace:v1", + "name": "cloudtrace", + "version": "v1", + "revision": "20150825", + "title": "Google Cloud Trace API", + "description": "The Google Cloud Trace API provides services for reading and writing runtime trace data for Cloud applications.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/tools/cloud-trace", + "protocol": "rest", + "baseUrl": "https://cloudtrace.googleapis.com/", + "basePath": "/", + "rootUrl": "https://cloudtrace.googleapis.com/", + "servicePath": "", + "batchPath": "batch", + "parameters": { + "access_token": { + "type": "string", + "description": "OAuth access token.", + "location": "query" + }, + "alt": { + "type": "string", + "description": "Data format for response.", + "default": "json", + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query" + }, + "bearer_token": { + "type": "string", + "description": "OAuth bearer token.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JSONP", + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "pp": { + "type": "boolean", + "description": "Pretty-print response.", + "default": "true", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query" + }, + "upload_protocol": { + "type": "string", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query" + }, + "uploadType": { + "type": "string", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query" + }, + "$.xgafv": { + "type": "string", + "description": "V1 error format.", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "schemas": { + "ListTracesResponse": { + "id": "ListTracesResponse", + "type": "object", + "description": "The response message for the ListTraces method.", + "properties": { + "traces": { + "type": "array", + "description": "The list of trace records returned.", + "items": { + "$ref": "Trace" + } + }, + "nextPageToken": { + "type": "string", + "description": "If defined, indicates that there are more topics that match the request, and this value should be passed to the next ListTopicsRequest to continue." + } + } + }, + "Trace": { + "id": "Trace", + "type": "object", + "description": "A Trace is a collection of spans describing the execution timings of a single operation.", + "properties": { + "projectId": { + "type": "string", + "description": "The Project ID of the Google Cloud project." + }, + "traceId": { + "type": "string", + "description": "A 128-bit numeric value, formatted as a 32-byte hex string, that represents a trace. Each trace should have an identifier that is globally unique." + }, + "spans": { + "type": "array", + "description": "The collection of span records within this trace. Spans that appear in calls to PatchTraces may be incomplete or partial.", + "items": { + "$ref": "TraceSpan" + } + } + } + }, + "TraceSpan": { + "id": "TraceSpan", + "type": "object", + "description": "A span is the data recorded with a single span.", + "properties": { + "spanId": { + "type": "string", + "description": "Identifier of the span within the trace. Each span should have an identifier that is unique per trace.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "SpanKind distinguishes spans generated in a particular context. For example, two spans with the same name, one with the kind RPC_CLIENT, and the other with RPC_SERVER can indicate the queueing latency associated with the span.", + "enum": [ + "SPAN_KIND_UNSPECIFIED", + "RPC_SERVER", + "RPC_CLIENT" + ] + }, + "name": { + "type": "string", + "description": "The name of the trace. This is sanitized and displayed on the UI. This may be a method name or some other per-callsite name. For the same binary and the same call point, it is a good practice to choose a consistent name in order to correlate cross-trace spans." + }, + "startTime": { + "type": "string", + "description": "The start time of the span in nanoseconds from the UNIX epoch." + }, + "endTime": { + "type": "string", + "description": "The end time of the span in nanoseconds from the UNIX epoch." + }, + "parentSpanId": { + "type": "string", + "description": "Identifies the parent of the current span. May be missing. Serialized bytes representation of SpanId.", + "format": "uint64" + }, + "labels": { + "type": "object", + "description": "Annotations via labels.", + "additionalProperties": { + "type": "string" + } + } + } + }, + "Traces": { + "id": "Traces", + "type": "object", + "description": "A list of traces for the PatchTraces method.", + "properties": { + "traces": { + "type": "array", + "description": "A list of traces.", + "items": { + "$ref": "Trace" + } + } + } + }, + "Empty": { + "id": "Empty", + "type": "object", + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`." + } + }, + "resources": { + "projects": { + "methods": { + "patchTraces": { + "id": "cloudtrace.projects.patchTraces", + "path": "v1/projects/{projectId}/traces", + "httpMethod": "PATCH", + "description": "Updates the existing traces specified by PatchTracesRequest and inserts the new traces. Any existing trace or span fields included in an update are overwritten by the update, and any additional fields in an update are merged with the existing trace data.", + "parameters": { + "projectId": { + "type": "string", + "description": "The project id of the trace to patch.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId" + ], + "request": { + "$ref": "Traces" + }, + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + }, + "resources": { + "traces": { + "methods": { + "list": { + "id": "cloudtrace.projects.traces.list", + "path": "v1/projects/{projectId}/traces", + "httpMethod": "GET", + "description": "List traces matching the filter expression.", + "parameters": { + "projectId": { + "type": "string", + "description": "The stringified-version of the project id.", + "required": true, + "location": "path" + }, + "view": { + "type": "string", + "description": "ViewType specifies the projection of the result.", + "enum": [ + "VIEW_TYPE_UNSPECIFIED", + "MINIMAL", + "ROOTSPAN", + "COMPLETE" + ], + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "Maximum number of topics to return. If not specified or \u003c= 0, the implementation will select a reasonable value. The implemenation may always return fewer than the requested page_size.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The token identifying the page of results to return from the ListTraces method. If present, this value is should be taken from the next_page_token field of a previous ListTracesResponse.", + "location": "query" + }, + "startTime": { + "type": "string", + "description": "End of the time interval (inclusive).", + "location": "query" + }, + "endTime": { + "type": "string", + "description": "Start of the time interval (exclusive).", + "location": "query" + }, + "filter": { + "type": "string", + "description": "An optional filter for the request.", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "The trace field used to establish the order of traces returned by the ListTraces method. Possible options are: trace_id name (name field of root span) duration (different between end_time and start_time fields of root span) start (start_time field of root span) Descending order can be specified by appending \"desc\" to the sort field: name desc Only one sort field is permitted, though this may change in the future.", + "location": "query" + } + }, + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "ListTracesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "id": "cloudtrace.projects.traces.get", + "path": "v1/projects/{projectId}/traces/{traceId}", + "httpMethod": "GET", + "description": "Gets one trace by id.", + "parameters": { + "projectId": { + "type": "string", + "description": "The project id of the trace to return.", + "required": true, + "location": "path" + }, + "traceId": { + "type": "string", + "description": "The trace id of the trace to return.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "traceId" + ], + "response": { + "$ref": "Trace" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + }, + "v1": { + "methods": { + "getDiscovery": { + "id": "cloudtrace.getDiscovery", + "path": "v1/discovery", + "httpMethod": "GET", + "description": "Returns a discovery document in the specified `format`. The typeurl in the returned google.protobuf.Any value depends on the requested format.", + "parameters": { + "format": { + "type": "string", + "description": "The format requested for discovery.", + "location": "query" + }, + "labels": { + "type": "string", + "description": "A list of labels (like visibility) influencing the scope of the requested doc.", + "repeated": true, + "location": "query" + }, + "version": { + "type": "string", + "description": "The API version of the requested discovery doc.", + "location": "query" + }, + "args": { + "type": "string", + "description": "Any additional arguments.", + "repeated": true, + "location": "query" + } + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/cloudtrace/v1/cloudtrace-gen.go b/Godeps/_workspace/src/google.golang.org/api/cloudtrace/v1/cloudtrace-gen.go new file mode 100644 index 000000000..e79c4d58b --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/cloudtrace/v1/cloudtrace-gen.go @@ -0,0 +1,919 @@ +// Package cloudtrace provides access to the Google Cloud Trace API. +// +// See https://cloud.google.com/tools/cloud-trace +// +// Usage example: +// +// import "google.golang.org/api/cloudtrace/v1" +// ... +// cloudtraceService, err := cloudtrace.New(oauthHttpClient) +package cloudtrace // import "google.golang.org/api/cloudtrace/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "cloudtrace:v1" +const apiName = "cloudtrace" +const apiVersion = "v1" +const basePath = "https://cloudtrace.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your data across Google Cloud Platform services + CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) + s.V1 = NewV1Service(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Projects *ProjectsService + + V1 *V1Service +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewProjectsService(s *Service) *ProjectsService { + rs := &ProjectsService{s: s} + rs.Traces = NewProjectsTracesService(s) + return rs +} + +type ProjectsService struct { + s *Service + + Traces *ProjectsTracesService +} + +func NewProjectsTracesService(s *Service) *ProjectsTracesService { + rs := &ProjectsTracesService{s: s} + return rs +} + +type ProjectsTracesService struct { + s *Service +} + +func NewV1Service(s *Service) *V1Service { + rs := &V1Service{s: s} + return rs +} + +type V1Service struct { + s *Service +} + +// Empty: A generic empty message that you can re-use to avoid defining +// duplicated empty messages in your APIs. A typical example is to use +// it as the request or the response type of an API method. For +// instance: service Foo { rpc Bar(google.protobuf.Empty) returns +// (google.protobuf.Empty); } The JSON representation for `Empty` is +// empty JSON object `{}`. +type Empty struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// ListTracesResponse: The response message for the ListTraces method. +type ListTracesResponse struct { + // NextPageToken: If defined, indicates that there are more topics that + // match the request, and this value should be passed to the next + // ListTopicsRequest to continue. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Traces: The list of trace records returned. + Traces []*Trace `json:"traces,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListTracesResponse) MarshalJSON() ([]byte, error) { + type noMethod ListTracesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Trace: A Trace is a collection of spans describing the execution +// timings of a single operation. +type Trace struct { + // ProjectId: The Project ID of the Google Cloud project. + ProjectId string `json:"projectId,omitempty"` + + // Spans: The collection of span records within this trace. Spans that + // appear in calls to PatchTraces may be incomplete or partial. + Spans []*TraceSpan `json:"spans,omitempty"` + + // TraceId: A 128-bit numeric value, formatted as a 32-byte hex string, + // that represents a trace. Each trace should have an identifier that is + // globally unique. + TraceId string `json:"traceId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ProjectId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Trace) MarshalJSON() ([]byte, error) { + type noMethod Trace + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TraceSpan: A span is the data recorded with a single span. +type TraceSpan struct { + // EndTime: The end time of the span in nanoseconds from the UNIX epoch. + EndTime string `json:"endTime,omitempty"` + + // Kind: SpanKind distinguishes spans generated in a particular context. + // For example, two spans with the same name, one with the kind + // RPC_CLIENT, and the other with RPC_SERVER can indicate the queueing + // latency associated with the span. + // + // Possible values: + // "SPAN_KIND_UNSPECIFIED" + // "RPC_SERVER" + // "RPC_CLIENT" + Kind string `json:"kind,omitempty"` + + // Labels: Annotations via labels. + Labels map[string]string `json:"labels,omitempty"` + + // Name: The name of the trace. This is sanitized and displayed on the + // UI. This may be a method name or some other per-callsite name. For + // the same binary and the same call point, it is a good practice to + // choose a consistent name in order to correlate cross-trace spans. + Name string `json:"name,omitempty"` + + // ParentSpanId: Identifies the parent of the current span. May be + // missing. Serialized bytes representation of SpanId. + ParentSpanId uint64 `json:"parentSpanId,omitempty,string"` + + // SpanId: Identifier of the span within the trace. Each span should + // have an identifier that is unique per trace. + SpanId uint64 `json:"spanId,omitempty,string"` + + // StartTime: The start time of the span in nanoseconds from the UNIX + // epoch. + StartTime string `json:"startTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "EndTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TraceSpan) MarshalJSON() ([]byte, error) { + type noMethod TraceSpan + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Traces: A list of traces for the PatchTraces method. +type Traces struct { + // Traces: A list of traces. + Traces []*Trace `json:"traces,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Traces") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Traces) MarshalJSON() ([]byte, error) { + type noMethod Traces + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "cloudtrace.projects.patchTraces": + +type ProjectsPatchTracesCall struct { + s *Service + projectId string + traces *Traces + opt_ map[string]interface{} + ctx_ context.Context +} + +// PatchTraces: Updates the existing traces specified by +// PatchTracesRequest and inserts the new traces. Any existing trace or +// span fields included in an update are overwritten by the update, and +// any additional fields in an update are merged with the existing trace +// data. +func (r *ProjectsService) PatchTraces(projectId string, traces *Traces) *ProjectsPatchTracesCall { + c := &ProjectsPatchTracesCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.traces = traces + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsPatchTracesCall) Fields(s ...googleapi.Field) *ProjectsPatchTracesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsPatchTracesCall) Context(ctx context.Context) *ProjectsPatchTracesCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsPatchTracesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.traces) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/traces") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudtrace.projects.patchTraces" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsPatchTracesCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the existing traces specified by PatchTracesRequest and inserts the new traces. Any existing trace or span fields included in an update are overwritten by the update, and any additional fields in an update are merged with the existing trace data.", + // "httpMethod": "PATCH", + // "id": "cloudtrace.projects.patchTraces", + // "parameterOrder": [ + // "projectId" + // ], + // "parameters": { + // "projectId": { + // "description": "The project id of the trace to patch.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/projects/{projectId}/traces", + // "request": { + // "$ref": "Traces" + // }, + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudtrace.projects.traces.get": + +type ProjectsTracesGetCall struct { + s *Service + projectId string + traceId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one trace by id. +func (r *ProjectsTracesService) Get(projectId string, traceId string) *ProjectsTracesGetCall { + c := &ProjectsTracesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.traceId = traceId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsTracesGetCall) Fields(s ...googleapi.Field) *ProjectsTracesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsTracesGetCall) IfNoneMatch(entityTag string) *ProjectsTracesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsTracesGetCall) Context(ctx context.Context) *ProjectsTracesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsTracesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/traces/{traceId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "traceId": c.traceId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudtrace.projects.traces.get" call. +// Exactly one of *Trace or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Trace.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsTracesGetCall) Do() (*Trace, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Trace{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one trace by id.", + // "httpMethod": "GET", + // "id": "cloudtrace.projects.traces.get", + // "parameterOrder": [ + // "projectId", + // "traceId" + // ], + // "parameters": { + // "projectId": { + // "description": "The project id of the trace to return.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "traceId": { + // "description": "The trace id of the trace to return.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/projects/{projectId}/traces/{traceId}", + // "response": { + // "$ref": "Trace" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudtrace.projects.traces.list": + +type ProjectsTracesListCall struct { + s *Service + projectId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List traces matching the filter expression. +func (r *ProjectsTracesService) List(projectId string) *ProjectsTracesListCall { + c := &ProjectsTracesListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + return c +} + +// EndTime sets the optional parameter "endTime": Start of the time +// interval (exclusive). +func (c *ProjectsTracesListCall) EndTime(endTime string) *ProjectsTracesListCall { + c.opt_["endTime"] = endTime + return c +} + +// Filter sets the optional parameter "filter": An optional filter for +// the request. +func (c *ProjectsTracesListCall) Filter(filter string) *ProjectsTracesListCall { + c.opt_["filter"] = filter + return c +} + +// OrderBy sets the optional parameter "orderBy": The trace field used +// to establish the order of traces returned by the ListTraces method. +// Possible options are: trace_id name (name field of root span) +// duration (different between end_time and start_time fields of root +// span) start (start_time field of root span) Descending order can be +// specified by appending "desc" to the sort field: name desc Only one +// sort field is permitted, though this may change in the future. +func (c *ProjectsTracesListCall) OrderBy(orderBy string) *ProjectsTracesListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// topics to return. If not specified or <= 0, the implementation will +// select a reasonable value. The implemenation may always return fewer +// than the requested page_size. +func (c *ProjectsTracesListCall) PageSize(pageSize int64) *ProjectsTracesListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": The token +// identifying the page of results to return from the ListTraces method. +// If present, this value is should be taken from the next_page_token +// field of a previous ListTracesResponse. +func (c *ProjectsTracesListCall) PageToken(pageToken string) *ProjectsTracesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StartTime sets the optional parameter "startTime": End of the time +// interval (inclusive). +func (c *ProjectsTracesListCall) StartTime(startTime string) *ProjectsTracesListCall { + c.opt_["startTime"] = startTime + return c +} + +// View sets the optional parameter "view": ViewType specifies the +// projection of the result. +// +// Possible values: +// "VIEW_TYPE_UNSPECIFIED" +// "MINIMAL" +// "ROOTSPAN" +// "COMPLETE" +func (c *ProjectsTracesListCall) View(view string) *ProjectsTracesListCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsTracesListCall) Fields(s ...googleapi.Field) *ProjectsTracesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsTracesListCall) IfNoneMatch(entityTag string) *ProjectsTracesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsTracesListCall) Context(ctx context.Context) *ProjectsTracesListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsTracesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["endTime"]; ok { + params.Set("endTime", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startTime"]; ok { + params.Set("startTime", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/traces") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudtrace.projects.traces.list" call. +// Exactly one of *ListTracesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListTracesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsTracesListCall) Do() (*ListTracesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListTracesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List traces matching the filter expression.", + // "httpMethod": "GET", + // "id": "cloudtrace.projects.traces.list", + // "parameterOrder": [ + // "projectId" + // ], + // "parameters": { + // "endTime": { + // "description": "Start of the time interval (exclusive).", + // "location": "query", + // "type": "string" + // }, + // "filter": { + // "description": "An optional filter for the request.", + // "location": "query", + // "type": "string" + // }, + // "orderBy": { + // "description": "The trace field used to establish the order of traces returned by the ListTraces method. Possible options are: trace_id name (name field of root span) duration (different between end_time and start_time fields of root span) start (start_time field of root span) Descending order can be specified by appending \"desc\" to the sort field: name desc Only one sort field is permitted, though this may change in the future.", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "Maximum number of topics to return. If not specified or \u003c= 0, the implementation will select a reasonable value. The implemenation may always return fewer than the requested page_size.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The token identifying the page of results to return from the ListTraces method. If present, this value is should be taken from the next_page_token field of a previous ListTracesResponse.", + // "location": "query", + // "type": "string" + // }, + // "projectId": { + // "description": "The stringified-version of the project id.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "startTime": { + // "description": "End of the time interval (inclusive).", + // "location": "query", + // "type": "string" + // }, + // "view": { + // "description": "ViewType specifies the projection of the result.", + // "enum": [ + // "VIEW_TYPE_UNSPECIFIED", + // "MINIMAL", + // "ROOTSPAN", + // "COMPLETE" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/projects/{projectId}/traces", + // "response": { + // "$ref": "ListTracesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudtrace.getDiscovery": + +type V1GetDiscoveryCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetDiscovery: Returns a discovery document in the specified `format`. +// The typeurl in the returned google.protobuf.Any value depends on the +// requested format. +func (r *V1Service) GetDiscovery() *V1GetDiscoveryCall { + c := &V1GetDiscoveryCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Args sets the optional parameter "args": Any additional arguments. +func (c *V1GetDiscoveryCall) Args(args string) *V1GetDiscoveryCall { + c.opt_["args"] = args + return c +} + +// Format sets the optional parameter "format": The format requested for +// discovery. +func (c *V1GetDiscoveryCall) Format(format string) *V1GetDiscoveryCall { + c.opt_["format"] = format + return c +} + +// Labels sets the optional parameter "labels": A list of labels (like +// visibility) influencing the scope of the requested doc. +func (c *V1GetDiscoveryCall) Labels(labels string) *V1GetDiscoveryCall { + c.opt_["labels"] = labels + return c +} + +// Version sets the optional parameter "version": The API version of the +// requested discovery doc. +func (c *V1GetDiscoveryCall) Version(version string) *V1GetDiscoveryCall { + c.opt_["version"] = version + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *V1GetDiscoveryCall) Fields(s ...googleapi.Field) *V1GetDiscoveryCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *V1GetDiscoveryCall) IfNoneMatch(entityTag string) *V1GetDiscoveryCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *V1GetDiscoveryCall) Context(ctx context.Context) *V1GetDiscoveryCall { + c.ctx_ = ctx + return c +} + +func (c *V1GetDiscoveryCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["args"]; ok { + params.Set("args", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["format"]; ok { + params.Set("format", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["labels"]; ok { + params.Set("labels", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["version"]; ok { + params.Set("version", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/discovery") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "cloudtrace.getDiscovery" call. +func (c *V1GetDiscoveryCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Returns a discovery document in the specified `format`. The typeurl in the returned google.protobuf.Any value depends on the requested format.", + // "httpMethod": "GET", + // "id": "cloudtrace.getDiscovery", + // "parameters": { + // "args": { + // "description": "Any additional arguments.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "format": { + // "description": "The format requested for discovery.", + // "location": "query", + // "type": "string" + // }, + // "labels": { + // "description": "A list of labels (like visibility) influencing the scope of the requested doc.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "version": { + // "description": "The API version of the requested discovery doc.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/discovery" + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/v0.alpha/clouduseraccounts-api.json b/Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/v0.alpha/clouduseraccounts-api.json new file mode 100644 index 000000000..7d148dc3e --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/v0.alpha/clouduseraccounts-api.json @@ -0,0 +1,1818 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/D_beAFQQyveoQCMpniTgyTLEBjs\"", + "discoveryVersion": "v1", + "id": "clouduseraccounts:alpha", + "name": "clouduseraccounts", + "canonicalName": "Cloud User Accounts", + "version": "alpha", + "revision": "20150917", + "title": "Cloud User Accounts API", + "description": "API for the Google Cloud User Accounts service.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/compute_engine-16.png", + "x32": "https://www.google.com/images/icons/product/compute_engine-32.png" + }, + "documentationLink": "https://cloud.google.com/compute/docs/access/user-accounts/api/latest/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/clouduseraccounts/alpha/projects/", + "basePath": "/clouduseraccounts/alpha/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "clouduseraccounts/alpha/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/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/cloud.useraccounts": { + "description": "Manage your Google Cloud User Accounts" + }, + "https://www.googleapis.com/auth/cloud.useraccounts.readonly": { + "description": "View your Google Cloud User Accounts" + } + } + } + }, + "schemas": { + "AuthorizedKeysView": { + "id": "AuthorizedKeysView", + "type": "object", + "description": "A list of authorized public keys for a user account.", + "properties": { + "keys": { + "type": "array", + "description": "[Output Only] The list of authorized public keys in SSH format.", + "items": { + "type": "string" + } + }, + "sudoer": { + "type": "boolean", + "description": "[Output Only] Whether the user has the ability to elevate on the instance that requested the authorized keys." + } + } + }, + "Binding": { + "id": "Binding", + "type": "object", + "description": "Associates `members` with a `role`.", + "properties": { + "members": { + "type": "array", + "description": "Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following formats:\n\n* `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` or `joe@example.com`.\n\n* `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.\n\n* `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`.", + "items": { + "type": "string" + } + }, + "role": { + "type": "string", + "description": "Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`." + } + } + }, + "Condition": { + "id": "Condition", + "type": "object", + "description": "A condition to be met.", + "properties": { + "iam": { + "type": "string", + "description": "Trusted attributes supplied by the IAM system.", + "enum": [ + "ATTRIBUTION", + "AUTHORITY", + "NO_ATTR" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "op": { + "type": "string", + "description": "An operator to apply the subject with.", + "enum": [ + "DISCHARGED", + "EQUALS", + "IN", + "NOT_EQUALS", + "NOT_IN", + "NO_OP" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "svc": { + "type": "string", + "description": "Trusted attributes discharged by the service." + }, + "sys": { + "type": "string", + "description": "Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.", + "enum": [ + "IP", + "NAME", + "NO_ATTR", + "REGION", + "SERVICE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "value": { + "type": "string", + "description": "The object of the condition. Exactly one of these must be set." + }, + "values": { + "type": "array", + "description": "The objects of the condition. This is mutually exclusive with 'value'.", + "items": { + "type": "string" + } + } + } + }, + "Group": { + "id": "Group", + "type": "object", + "description": "A Group resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always clouduseraccounts#group for groups.", + "default": "clouduseraccounts#group" + }, + "members": { + "type": "array", + "description": "[Output Only] A list of URLs to User resources who belong to the group. Users may only be members of groups in the same project.", + "items": { + "type": "string" + } + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created.", + "pattern": "[a-z][-a-z0-9_]{0,31}", + "annotations": { + "required": [ + "clouduseraccounts.groups.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for the resource." + } + } + }, + "GroupList": { + "id": "GroupList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of Group resources.", + "items": { + "$ref": "Group" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always clouduseraccounts#groupList for lists of groups.", + "default": "clouduseraccounts#groupList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for this resource." + } + } + }, + "GroupsAddMemberRequest": { + "id": "GroupsAddMemberRequest", + "type": "object", + "properties": { + "users": { + "type": "array", + "description": "Fully-qualified URLs of the User resources to add.", + "items": { + "type": "string" + } + } + } + }, + "GroupsRemoveMemberRequest": { + "id": "GroupsRemoveMemberRequest", + "type": "object", + "properties": { + "users": { + "type": "array", + "description": "Fully-qualified URLs of the User resources to remove.", + "items": { + "type": "string" + } + } + } + }, + "LinuxAccountViews": { + "id": "LinuxAccountViews", + "type": "object", + "description": "A list of all Linux accounts for this project. This API is only used by Compute Engine virtual machines to get information about user accounts for a project or instance. Linux resources are read-only views into users and groups managed by the Compute Engine Accounts API.", + "properties": { + "groupViews": { + "type": "array", + "description": "[Output Only] A list of all groups within a project.", + "items": { + "$ref": "LinuxGroupView" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always clouduseraccounts#linuxAccountViews for Linux resources.", + "default": "clouduseraccounts#linuxAccountViews" + }, + "userViews": { + "type": "array", + "description": "[Output Only] A list of all users within a project.", + "items": { + "$ref": "LinuxUserView" + } + } + } + }, + "LinuxGetAuthorizedKeysViewResponse": { + "id": "LinuxGetAuthorizedKeysViewResponse", + "type": "object", + "properties": { + "resource": { + "$ref": "AuthorizedKeysView", + "description": "[Output Only] A list of authorized public keys for a user." + } + } + }, + "LinuxGetLinuxAccountViewsResponse": { + "id": "LinuxGetLinuxAccountViewsResponse", + "type": "object", + "properties": { + "resource": { + "$ref": "LinuxAccountViews", + "description": "[Output Only] A list of authorized user accounts and groups." + } + } + }, + "LinuxGroupView": { + "id": "LinuxGroupView", + "type": "object", + "description": "A detailed view of a Linux group.", + "properties": { + "gid": { + "type": "integer", + "description": "[Output Only] The Group ID.", + "format": "uint32" + }, + "groupName": { + "type": "string", + "description": "[Output Only] Group name." + }, + "members": { + "type": "array", + "description": "[Output Only] List of user accounts that belong to the group.", + "items": { + "type": "string" + } + } + } + }, + "LinuxUserView": { + "id": "LinuxUserView", + "type": "object", + "description": "A detailed view of a Linux user account.", + "properties": { + "gecos": { + "type": "string", + "description": "[Output Only] The GECOS (user information) entry for this account." + }, + "gid": { + "type": "integer", + "description": "[Output Only] User's default group ID.", + "format": "uint32" + }, + "homeDirectory": { + "type": "string", + "description": "[Output Only] The path to the home directory for this account." + }, + "shell": { + "type": "string", + "description": "[Output Only] The path to the login shell for this account." + }, + "uid": { + "type": "integer", + "description": "[Output Only] User ID.", + "format": "uint32" + }, + "username": { + "type": "string", + "description": "[Output Only] The username of the account." + } + } + }, + "LogConfig": { + "id": "LogConfig", + "type": "object", + "description": "Specifies what kind of log the caller must write", + "properties": { + "counter": { + "$ref": "LogConfigCounterOptions", + "description": "Counter options." + } + } + }, + "LogConfigCounterOptions": { + "id": "LogConfigCounterOptions", + "type": "object", + "description": "Options for counters", + "properties": { + "field": { + "type": "string", + "description": "The field value to attribute." + }, + "metric": { + "type": "string", + "description": "The metric to update." + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "description": "An Operation resource, used to manage asynchronous API requests.", + "properties": { + "clientOperationId": { + "type": "string", + "description": "[Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all Operation resources in the project." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "endTime": { + "type": "string", + "description": "[Output Only] The time that this operation was completed. This is in RFC3339 text format." + }, + "error": { + "type": "object", + "description": "[Output Only] If errors are generated during processing of the operation, this field will be populated.", + "properties": { + "errors": { + "type": "array", + "description": "[Output Only] The array of errors encountered while processing this operation.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The error type identifier for this error." + }, + "location": { + "type": "string", + "description": "[Output Only] Indicates the field in the request which caused the error. This property is optional." + }, + "message": { + "type": "string", + "description": "[Output Only] An optional, human-readable error message." + } + } + } + } + } + }, + "httpErrorMessage": { + "type": "string", + "description": "[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND." + }, + "httpErrorStatusCode": { + "type": "integer", + "description": "[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as 404.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "[Output Only] The time that this operation was requested. This is in RFC3339 text format." + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#operation for Operation resources.", + "default": "clouduseraccounts#operation" + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource." + }, + "operationType": { + "type": "string", + "description": "[Output Only] Type of the operation, such as insert, compute.instanceGroups.update, or compute.instanceGroups.delete." + }, + "progress": { + "type": "integer", + "description": "[Output Only] 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 monotonically increase as the operation progresses.", + "format": "int32" + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where the operation resides. Only applicable for regional resources." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "startTime": { + "type": "string", + "description": "[Output Only] The time that this operation was started by the server. This is in RFC3339 text format." + }, + "status": { + "type": "string", + "description": "[Output Only] Status of the operation. Can be one of the following: PENDING, RUNNING, or DONE.", + "enum": [ + "DONE", + "PENDING", + "RUNNING" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "statusMessage": { + "type": "string", + "description": "[Output Only] An optional textual description of the current status of the operation." + }, + "targetId": { + "type": "string", + "description": "[Output Only] Unique target ID which identifies a particular incarnation of the target.", + "format": "uint64" + }, + "targetLink": { + "type": "string", + "description": "[Output Only] URL of the resource the operation is mutating." + }, + "user": { + "type": "string", + "description": "[Output Only] User who requested the operation, for example: user@example.com." + }, + "warnings": { + "type": "array", + "description": "[Output Only] If warning messages are generated during processing of the operation, this field will be populated.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + }, + "zone": { + "type": "string", + "description": "[Output Only] URL of the zone where the operation resides." + } + } + }, + "OperationList": { + "id": "OperationList", + "type": "object", + "description": "Contains a list of Operation resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] The Operation resources.", + "items": { + "$ref": "Operation" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#operations for Operations resource.", + "default": "clouduseraccounts#operationList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncate." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "Policy": { + "id": "Policy", + "type": "object", + "description": "Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources.\n\n\n\nA `Policy` consists of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, where the members can be user accounts, Google groups, Google domains, and service accounts. A `role` is a named list of permissions defined by IAM.\n\n**Example**\n\n{ \"bindings\": [ { \"role\": \"roles/owner\", \"members\": [ \"user:mike@example.com\", \"group:admins@example.com\", \"domain:google.com\", \"serviceAccount:my-other-app@appspot.gserviceaccount.com\"] }, { \"role\": \"roles/viewer\", \"members\": [\"user:sean@example.com\"] } ] }\n\nFor a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam).", + "properties": { + "bindings": { + "type": "array", + "description": "Associates a list of `members` to a `role`. Multiple `bindings` must not be specified for the same `role`. `bindings` with no members will result in an error.", + "items": { + "$ref": "Binding" + } + }, + "etag": { + "type": "string", + "description": "Can be used to perform a read-modify-write.", + "format": "byte" + }, + "rules": { + "type": "array", + "description": "", + "items": { + "$ref": "Rule" + } + }, + "version": { + "type": "integer", + "description": "Version of the `Policy`. The default version is 0.", + "format": "int32" + } + } + }, + "PublicKey": { + "id": "PublicKey", + "type": "object", + "description": "A public key for authenticating to guests.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "expirationTimestamp": { + "type": "string", + "description": "Optional expiration timestamp. If provided, the timestamp must be in RFC3339 text format. If not provided, the public key never expires." + }, + "fingerprint": { + "type": "string", + "description": "[Output Only] The fingerprint of the key is defined by RFC4716 to be the MD5 digest of the public key." + }, + "key": { + "type": "string", + "description": "Public key text in SSH format, defined by RFC4253 section 6.6." + } + } + }, + "Rule": { + "id": "Rule", + "type": "object", + "description": "A rule to be applied in a Policy.", + "properties": { + "action": { + "type": "string", + "description": "Required", + "enum": [ + "ALLOW", + "ALLOW_WITH_LOG", + "DENY", + "DENY_WITH_LOG", + "LOG", + "NO_ACTION" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "conditions": { + "type": "array", + "description": "Additional restrictions that must be met", + "items": { + "$ref": "Condition" + } + }, + "description": { + "type": "string", + "description": "Human-readable description of the rule." + }, + "ins": { + "type": "array", + "description": "The rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in this set of entries.", + "items": { + "type": "string" + } + }, + "logConfigs": { + "type": "array", + "description": "The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.", + "items": { + "$ref": "LogConfig" + } + }, + "notIns": { + "type": "array", + "description": "The rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is not in this set of entries.", + "items": { + "type": "string" + } + }, + "permissions": { + "type": "array", + "description": "A permission is a string of form '..' (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.", + "items": { + "type": "string" + } + } + } + }, + "TestPermissionsRequest": { + "id": "TestPermissionsRequest", + "type": "object", + "properties": { + "permissions": { + "type": "array", + "description": "The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed.", + "items": { + "type": "string" + } + } + } + }, + "TestPermissionsResponse": { + "id": "TestPermissionsResponse", + "type": "object", + "properties": { + "permissions": { + "type": "array", + "description": "A subset of `TestPermissionsRequest.permissions` that the caller is allowed.", + "items": { + "type": "string" + } + } + } + }, + "User": { + "id": "User", + "type": "object", + "description": "A User resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "groups": { + "type": "array", + "description": "[Output Only] A list of URLs to Group resources who contain the user. Users are only members of groups in the same project.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always clouduseraccounts#user for users.", + "default": "clouduseraccounts#user" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created.", + "pattern": "[a-z][-a-z0-9_]{0,31}", + "annotations": { + "required": [ + "clouduseraccounts.users.insert" + ] + } + }, + "owner": { + "type": "string", + "description": "Email address of account's owner. This account will be validated to make sure it exists. The email can belong to any domain, but it must be tied to a Google account.", + "annotations": { + "required": [ + "clouduseraccounts.users.insert" + ] + } + }, + "publicKeys": { + "type": "array", + "description": "[Output Only] Public keys that this user may use to login.", + "items": { + "$ref": "PublicKey" + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for the resource." + } + } + }, + "UserList": { + "id": "UserList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of User resources.", + "items": { + "$ref": "User" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always clouduseraccounts#userList for lists of users.", + "default": "clouduseraccounts#userList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for this resource." + } + } + } + }, + "resources": { + "globalAccountsOperations": { + "methods": { + "delete": { + "id": "clouduseraccounts.globalAccountsOperations.delete", + "path": "{project}/global/operations/{operation}", + "httpMethod": "DELETE", + "description": "Deletes the specified operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the Operations resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "get": { + "id": "clouduseraccounts.globalAccountsOperations.get", + "path": "{project}/global/operations/{operation}", + "httpMethod": "GET", + "description": "Retrieves the specified operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the Operations resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "list": { + "id": "clouduseraccounts.globalAccountsOperations.list", + "path": "{project}/global/operations", + "httpMethod": "GET", + "description": "Retrieves the list of operation resources contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + } + } + }, + "groups": { + "methods": { + "addMember": { + "id": "clouduseraccounts.groups.addMember", + "path": "{project}/global/groups/{groupName}/addMember", + "httpMethod": "POST", + "description": "Adds users to the specified group.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the group for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "groupName" + ], + "request": { + "$ref": "GroupsAddMemberRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "delete": { + "id": "clouduseraccounts.groups.delete", + "path": "{project}/global/groups/{groupName}", + "httpMethod": "DELETE", + "description": "Deletes the specified Group resource.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the Group resource to delete.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "groupName" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "get": { + "id": "clouduseraccounts.groups.get", + "path": "{project}/global/groups/{groupName}", + "httpMethod": "GET", + "description": "Returns the specified Group resource.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the Group resource to return.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "groupName" + ], + "response": { + "$ref": "Group" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "getIamPolicy": { + "id": "clouduseraccounts.groups.getIamPolicy", + "path": "{project}/global/groups/{resource}/getIamPolicy", + "httpMethod": "GET", + "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "insert": { + "id": "clouduseraccounts.groups.insert", + "path": "{project}/global/groups", + "httpMethod": "POST", + "description": "Creates a Group resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "Group" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "list": { + "id": "clouduseraccounts.groups.list", + "path": "{project}/global/groups", + "httpMethod": "GET", + "description": "Retrieves the list of groups contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "GroupList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "removeMember": { + "id": "clouduseraccounts.groups.removeMember", + "path": "{project}/global/groups/{groupName}/removeMember", + "httpMethod": "POST", + "description": "Removes users from the specified group.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the group for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "groupName" + ], + "request": { + "$ref": "GroupsRemoveMemberRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "setIamPolicy": { + "id": "clouduseraccounts.groups.setIamPolicy", + "path": "{project}/global/groups/{resource}/setIamPolicy", + "httpMethod": "POST", + "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "request": { + "$ref": "Policy" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "testIamPermissions": { + "id": "clouduseraccounts.groups.testIamPermissions", + "path": "{project}/global/groups/{resource}/testIamPermissions", + "httpMethod": "POST", + "description": "Returns permissions that a caller has on the specified resource.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "request": { + "$ref": "TestPermissionsRequest" + }, + "response": { + "$ref": "TestPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + } + } + }, + "linux": { + "methods": { + "getAuthorizedKeysView": { + "id": "clouduseraccounts.linux.getAuthorizedKeysView", + "path": "{project}/zones/{zone}/authorizedKeysView/{user}", + "httpMethod": "POST", + "description": "Returns a list of authorized public keys for a specific user account.", + "parameters": { + "instance": { + "type": "string", + "description": "The fully-qualified URL of the virtual machine requesting the view.", + "required": true, + "location": "query" + }, + "login": { + "type": "boolean", + "description": "Whether the view was requested as part of a user-initiated login.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "user": { + "type": "string", + "description": "The user account for which you want to get a list of authorized public keys.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "zone": { + "type": "string", + "description": "Name of the zone for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "user", + "instance" + ], + "response": { + "$ref": "LinuxGetAuthorizedKeysViewResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "getLinuxAccountViews": { + "id": "clouduseraccounts.linux.getLinuxAccountViews", + "path": "{project}/zones/{zone}/linuxAccountViews", + "httpMethod": "POST", + "description": "Retrieves a list of user accounts for an instance within a specific project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "instance": { + "type": "string", + "description": "The fully-qualified URL of the virtual machine requesting the views.", + "required": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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 for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "response": { + "$ref": "LinuxGetLinuxAccountViewsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + } + } + }, + "users": { + "methods": { + "addPublicKey": { + "id": "clouduseraccounts.users.addPublicKey", + "path": "{project}/global/users/{user}/addPublicKey", + "httpMethod": "POST", + "description": "Adds a public key to the specified User resource with the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "user": { + "type": "string", + "description": "Name of the user for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user" + ], + "request": { + "$ref": "PublicKey" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "delete": { + "id": "clouduseraccounts.users.delete", + "path": "{project}/global/users/{user}", + "httpMethod": "DELETE", + "description": "Deletes the specified User resource.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "user": { + "type": "string", + "description": "Name of the user resource to delete.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "get": { + "id": "clouduseraccounts.users.get", + "path": "{project}/global/users/{user}", + "httpMethod": "GET", + "description": "Returns the specified User resource.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "user": { + "type": "string", + "description": "Name of the user resource to return.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user" + ], + "response": { + "$ref": "User" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "getIamPolicy": { + "id": "clouduseraccounts.users.getIamPolicy", + "path": "{project}/global/users/{resource}/getIamPolicy", + "httpMethod": "GET", + "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "insert": { + "id": "clouduseraccounts.users.insert", + "path": "{project}/global/users", + "httpMethod": "POST", + "description": "Creates a User resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "User" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "list": { + "id": "clouduseraccounts.users.list", + "path": "{project}/global/users", + "httpMethod": "GET", + "description": "Retrieves a list of users contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "UserList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "removePublicKey": { + "id": "clouduseraccounts.users.removePublicKey", + "path": "{project}/global/users/{user}/removePublicKey", + "httpMethod": "POST", + "description": "Removes the specified public key from the user.", + "parameters": { + "fingerprint": { + "type": "string", + "description": "The fingerprint of the public key to delete. Public keys are identified by their fingerprint, which is defined by RFC4716 to be the MD5 digest of the public key.", + "required": true, + "pattern": "[a-f0-9]{32}", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "user": { + "type": "string", + "description": "Name of the user for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user", + "fingerprint" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "setIamPolicy": { + "id": "clouduseraccounts.users.setIamPolicy", + "path": "{project}/global/users/{resource}/setIamPolicy", + "httpMethod": "POST", + "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "request": { + "$ref": "Policy" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "testIamPermissions": { + "id": "clouduseraccounts.users.testIamPermissions", + "path": "{project}/global/users/{resource}/testIamPermissions", + "httpMethod": "POST", + "description": "Returns permissions that a caller has on the specified resource.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "request": { + "$ref": "TestPermissionsRequest" + }, + "response": { + "$ref": "TestPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/v0.alpha/clouduseraccounts-gen.go b/Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/v0.alpha/clouduseraccounts-gen.go new file mode 100644 index 000000000..d49b7089a --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/v0.alpha/clouduseraccounts-gen.go @@ -0,0 +1,4592 @@ +// Package clouduseraccounts provides access to the Cloud User Accounts API. +// +// See https://cloud.google.com/compute/docs/access/user-accounts/api/latest/ +// +// Usage example: +// +// import "google.golang.org/api/clouduseraccounts/v0.alpha" +// ... +// clouduseraccountsService, err := clouduseraccounts.New(oauthHttpClient) +package clouduseraccounts // import "google.golang.org/api/clouduseraccounts/v0.alpha" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "clouduseraccounts:alpha" +const apiName = "clouduseraccounts" +const apiVersion = "alpha" +const basePath = "https://www.googleapis.com/clouduseraccounts/alpha/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 data across Google Cloud Platform services + CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" + + // Manage your Google Cloud User Accounts + CloudUseraccountsScope = "https://www.googleapis.com/auth/cloud.useraccounts" + + // View your Google Cloud User Accounts + CloudUseraccountsReadonlyScope = "https://www.googleapis.com/auth/cloud.useraccounts.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.GlobalAccountsOperations = NewGlobalAccountsOperationsService(s) + s.Groups = NewGroupsService(s) + s.Linux = NewLinuxService(s) + s.Users = NewUsersService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + GlobalAccountsOperations *GlobalAccountsOperationsService + + Groups *GroupsService + + Linux *LinuxService + + Users *UsersService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewGlobalAccountsOperationsService(s *Service) *GlobalAccountsOperationsService { + rs := &GlobalAccountsOperationsService{s: s} + return rs +} + +type GlobalAccountsOperationsService struct { + s *Service +} + +func NewGroupsService(s *Service) *GroupsService { + rs := &GroupsService{s: s} + return rs +} + +type GroupsService struct { + s *Service +} + +func NewLinuxService(s *Service) *LinuxService { + rs := &LinuxService{s: s} + return rs +} + +type LinuxService struct { + s *Service +} + +func NewUsersService(s *Service) *UsersService { + rs := &UsersService{s: s} + return rs +} + +type UsersService struct { + s *Service +} + +// AuthorizedKeysView: A list of authorized public keys for a user +// account. +type AuthorizedKeysView struct { + // Keys: [Output Only] The list of authorized public keys in SSH format. + Keys []string `json:"keys,omitempty"` + + // Sudoer: [Output Only] Whether the user has the ability to elevate on + // the instance that requested the authorized keys. + Sudoer bool `json:"sudoer,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Keys") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AuthorizedKeysView) MarshalJSON() ([]byte, error) { + type noMethod AuthorizedKeysView + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Binding: Associates `members` with a `role`. +type Binding struct { + // Members: Specifies the identities requesting access for a Cloud + // Platform resource. `members` can have the following formats: + // + // * `allUsers`: A special identifier that represents anyone who is on + // the internet; with or without a Google account. + // + // * `allAuthenticatedUsers`: A special identifier that represents + // anyone who is authenticated with a Google account or a service + // account. + // + // * `user:{emailid}`: An email address that represents a specific + // Google account. For example, `alice@gmail.com` or + // `joe@example.com`. + // + // * `serviceAccount:{emailid}`: An email address that represents a + // service account. For example, + // `my-other-app@appspot.gserviceaccount.com`. + // + // * `group:{emailid}`: An email address that represents a Google group. + // For example, `admins@example.com`. + // + // * `domain:{domain}`: A Google Apps domain name that represents all + // the users of that domain. For example, `google.com` or `example.com`. + Members []string `json:"members,omitempty"` + + // Role: Role that is assigned to `members`. For example, + // `roles/viewer`, `roles/editor`, or `roles/owner`. + Role string `json:"role,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Members") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Binding) MarshalJSON() ([]byte, error) { + type noMethod Binding + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Condition: A condition to be met. +type Condition struct { + // Iam: Trusted attributes supplied by the IAM system. + // + // Possible values: + // "ATTRIBUTION" + // "AUTHORITY" + // "NO_ATTR" + Iam string `json:"iam,omitempty"` + + // Op: An operator to apply the subject with. + // + // Possible values: + // "DISCHARGED" + // "EQUALS" + // "IN" + // "NOT_EQUALS" + // "NOT_IN" + // "NO_OP" + Op string `json:"op,omitempty"` + + // Svc: Trusted attributes discharged by the service. + Svc string `json:"svc,omitempty"` + + // Sys: Trusted attributes supplied by any service that owns resources + // and uses the IAM system for access control. + // + // Possible values: + // "IP" + // "NAME" + // "NO_ATTR" + // "REGION" + // "SERVICE" + Sys string `json:"sys,omitempty"` + + // Value: The object of the condition. Exactly one of these must be set. + Value string `json:"value,omitempty"` + + // Values: The objects of the condition. This is mutually exclusive with + // 'value'. + Values []string `json:"values,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Iam") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Condition) MarshalJSON() ([]byte, error) { + type noMethod Condition + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Group: A Group resource. +type Group struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always + // clouduseraccounts#group for groups. + Kind string `json:"kind,omitempty"` + + // Members: [Output Only] A list of URLs to User resources who belong to + // the group. Users may only be members of groups in the same project. + Members []string `json:"members,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] Server defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Group) MarshalJSON() ([]byte, error) { + type noMethod Group + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GroupList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of Group resources. + Items []*Group `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always + // clouduseraccounts#groupList for lists of groups. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GroupList) MarshalJSON() ([]byte, error) { + type noMethod GroupList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GroupsAddMemberRequest struct { + // Users: Fully-qualified URLs of the User resources to add. + Users []string `json:"users,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Users") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GroupsAddMemberRequest) MarshalJSON() ([]byte, error) { + type noMethod GroupsAddMemberRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GroupsRemoveMemberRequest struct { + // Users: Fully-qualified URLs of the User resources to remove. + Users []string `json:"users,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Users") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GroupsRemoveMemberRequest) MarshalJSON() ([]byte, error) { + type noMethod GroupsRemoveMemberRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LinuxAccountViews: A list of all Linux accounts for this project. +// This API is only used by Compute Engine virtual machines to get +// information about user accounts for a project or instance. Linux +// resources are read-only views into users and groups managed by the +// Compute Engine Accounts API. +type LinuxAccountViews struct { + // GroupViews: [Output Only] A list of all groups within a project. + GroupViews []*LinuxGroupView `json:"groupViews,omitempty"` + + // Kind: [Output Only] Type of the resource. Always + // clouduseraccounts#linuxAccountViews for Linux resources. + Kind string `json:"kind,omitempty"` + + // UserViews: [Output Only] A list of all users within a project. + UserViews []*LinuxUserView `json:"userViews,omitempty"` + + // ForceSendFields is a list of field names (e.g. "GroupViews") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LinuxAccountViews) MarshalJSON() ([]byte, error) { + type noMethod LinuxAccountViews + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type LinuxGetAuthorizedKeysViewResponse struct { + // Resource: [Output Only] A list of authorized public keys for a user. + Resource *AuthorizedKeysView `json:"resource,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Resource") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LinuxGetAuthorizedKeysViewResponse) MarshalJSON() ([]byte, error) { + type noMethod LinuxGetAuthorizedKeysViewResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type LinuxGetLinuxAccountViewsResponse struct { + // Resource: [Output Only] A list of authorized user accounts and + // groups. + Resource *LinuxAccountViews `json:"resource,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Resource") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LinuxGetLinuxAccountViewsResponse) MarshalJSON() ([]byte, error) { + type noMethod LinuxGetLinuxAccountViewsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LinuxGroupView: A detailed view of a Linux group. +type LinuxGroupView struct { + // Gid: [Output Only] The Group ID. + Gid int64 `json:"gid,omitempty"` + + // GroupName: [Output Only] Group name. + GroupName string `json:"groupName,omitempty"` + + // Members: [Output Only] List of user accounts that belong to the + // group. + Members []string `json:"members,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Gid") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LinuxGroupView) MarshalJSON() ([]byte, error) { + type noMethod LinuxGroupView + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LinuxUserView: A detailed view of a Linux user account. +type LinuxUserView struct { + // Gecos: [Output Only] The GECOS (user information) entry for this + // account. + Gecos string `json:"gecos,omitempty"` + + // Gid: [Output Only] User's default group ID. + Gid int64 `json:"gid,omitempty"` + + // HomeDirectory: [Output Only] The path to the home directory for this + // account. + HomeDirectory string `json:"homeDirectory,omitempty"` + + // Shell: [Output Only] The path to the login shell for this account. + Shell string `json:"shell,omitempty"` + + // Uid: [Output Only] User ID. + Uid int64 `json:"uid,omitempty"` + + // Username: [Output Only] The username of the account. + Username string `json:"username,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Gecos") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LinuxUserView) MarshalJSON() ([]byte, error) { + type noMethod LinuxUserView + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LogConfig: Specifies what kind of log the caller must write +type LogConfig struct { + // Counter: Counter options. + Counter *LogConfigCounterOptions `json:"counter,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Counter") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LogConfig) MarshalJSON() ([]byte, error) { + type noMethod LogConfig + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LogConfigCounterOptions: Options for counters +type LogConfigCounterOptions struct { + // Field: The field value to attribute. + Field string `json:"field,omitempty"` + + // Metric: The metric to update. + Metric string `json:"metric,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Field") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LogConfigCounterOptions) MarshalJSON() ([]byte, error) { + type noMethod LogConfigCounterOptions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Operation: An Operation resource, used to manage asynchronous API +// requests. +type Operation struct { + // ClientOperationId: [Output Only] An optional identifier specified by + // the client when the mutation was initiated. Must be unique for all + // Operation resources in the project. + ClientOperationId string `json:"clientOperationId,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // EndTime: [Output Only] The time that this operation was completed. + // This is in RFC3339 text format. + EndTime string `json:"endTime,omitempty"` + + // Error: [Output Only] If errors are generated during processing of the + // operation, this field will be populated. + Error *OperationError `json:"error,omitempty"` + + // HttpErrorMessage: [Output Only] If the operation fails, this field + // contains the HTTP error message that was returned, such as NOT FOUND. + HttpErrorMessage string `json:"httpErrorMessage,omitempty"` + + // HttpErrorStatusCode: [Output Only] If the operation fails, this field + // contains the HTTP error message that was returned, such as 404. + HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // InsertTime: [Output Only] The time that this operation was requested. + // This is in RFC3339 text format. + InsertTime string `json:"insertTime,omitempty"` + + // Kind: [Output Only] Type of the resource. Always compute#operation + // for Operation resources. + Kind string `json:"kind,omitempty"` + + // Name: [Output Only] Name of the resource. + Name string `json:"name,omitempty"` + + // OperationType: [Output Only] Type of the operation, such as insert, + // compute.instanceGroups.update, or compute.instanceGroups.delete. + OperationType string `json:"operationType,omitempty"` + + // Progress: [Output Only] 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 monotonically + // increase as the operation progresses. + Progress int64 `json:"progress,omitempty"` + + // Region: [Output Only] URL of the region where the operation resides. + // Only applicable for regional resources. + Region string `json:"region,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // StartTime: [Output Only] The time that this operation was started by + // the server. This is in RFC3339 text format. + StartTime string `json:"startTime,omitempty"` + + // Status: [Output Only] Status of the operation. Can be one of the + // following: PENDING, RUNNING, or DONE. + // + // Possible values: + // "DONE" + // "PENDING" + // "RUNNING" + Status string `json:"status,omitempty"` + + // StatusMessage: [Output Only] An optional textual description of the + // current status of the operation. + StatusMessage string `json:"statusMessage,omitempty"` + + // TargetId: [Output Only] Unique target ID which identifies a + // particular incarnation of the target. + TargetId uint64 `json:"targetId,omitempty,string"` + + // TargetLink: [Output Only] URL of the resource the operation is + // mutating. + TargetLink string `json:"targetLink,omitempty"` + + // User: [Output Only] User who requested the operation, for example: + // user@example.com. + User string `json:"user,omitempty"` + + // Warnings: [Output Only] If warning messages are generated during + // processing of the operation, this field will be populated. + Warnings []*OperationWarnings `json:"warnings,omitempty"` + + // Zone: [Output Only] URL of the zone where the operation resides. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ClientOperationId") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Operation) MarshalJSON() ([]byte, error) { + type noMethod Operation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationError: [Output Only] If errors are generated during +// processing of the operation, this field will be populated. +type OperationError struct { + // Errors: [Output Only] The array of errors encountered while + // processing this operation. + Errors []*OperationErrorErrors `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationError) MarshalJSON() ([]byte, error) { + type noMethod OperationError + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationErrorErrors struct { + // Code: [Output Only] The error type identifier for this error. + Code string `json:"code,omitempty"` + + // Location: [Output Only] Indicates the field in the request which + // caused the error. This property is optional. + Location string `json:"location,omitempty"` + + // Message: [Output Only] An optional, human-readable error message. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) { + type noMethod OperationErrorErrors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationWarnings struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*OperationWarningsData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationWarnings) MarshalJSON() ([]byte, error) { + type noMethod OperationWarnings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationWarningsData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationWarningsData) MarshalJSON() ([]byte, error) { + type noMethod OperationWarningsData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationList: Contains a list of Operation resources. +type OperationList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] The Operation resources. + Items []*Operation `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#operations for + // Operations resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncate. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationList) MarshalJSON() ([]byte, error) { + type noMethod OperationList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Policy: Defines an Identity and Access Management (IAM) policy. It is +// used to specify access control policies for Cloud Platform +// resources. +// +// +// +// A `Policy` consists of a list of `bindings`. A `Binding` binds a list +// of `members` to a `role`, where the members can be user accounts, +// Google groups, Google domains, and service accounts. A `role` is a +// named list of permissions defined by IAM. +// +// **Example** +// +// { "bindings": [ { "role": "roles/owner", "members": [ +// "user:mike@example.com", "group:admins@example.com", +// "domain:google.com", +// "serviceAccount:my-other-app@appspot.gserviceaccount.com"] }, { +// "role": "roles/viewer", "members": ["user:sean@example.com"] } ] +// } +// +// For a description of IAM and its features, see the [IAM developer's +// guide](https://cloud.google.com/iam). +type Policy struct { + // Bindings: Associates a list of `members` to a `role`. Multiple + // `bindings` must not be specified for the same `role`. `bindings` with + // no members will result in an error. + Bindings []*Binding `json:"bindings,omitempty"` + + // Etag: Can be used to perform a read-modify-write. + Etag string `json:"etag,omitempty"` + + Rules []*Rule `json:"rules,omitempty"` + + // Version: Version of the `Policy`. The default version is 0. + Version int64 `json:"version,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Bindings") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Policy) MarshalJSON() ([]byte, error) { + type noMethod Policy + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PublicKey: A public key for authenticating to guests. +type PublicKey struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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"` + + // ExpirationTimestamp: Optional expiration timestamp. If provided, the + // timestamp must be in RFC3339 text format. If not provided, the public + // key never expires. + ExpirationTimestamp string `json:"expirationTimestamp,omitempty"` + + // Fingerprint: [Output Only] The fingerprint of the key is defined by + // RFC4716 to be the MD5 digest of the public key. + Fingerprint string `json:"fingerprint,omitempty"` + + // Key: Public key text in SSH format, defined by RFC4253 section 6.6. + Key string `json:"key,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PublicKey) MarshalJSON() ([]byte, error) { + type noMethod PublicKey + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Rule: A rule to be applied in a Policy. +type Rule struct { + // Action: Required + // + // Possible values: + // "ALLOW" + // "ALLOW_WITH_LOG" + // "DENY" + // "DENY_WITH_LOG" + // "LOG" + // "NO_ACTION" + Action string `json:"action,omitempty"` + + // Conditions: Additional restrictions that must be met + Conditions []*Condition `json:"conditions,omitempty"` + + // Description: Human-readable description of the rule. + Description string `json:"description,omitempty"` + + // Ins: The rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in this + // set of entries. + Ins []string `json:"ins,omitempty"` + + // LogConfigs: The config returned to callers of + // tech.iam.IAM.CheckPolicy for any entries that match the LOG action. + LogConfigs []*LogConfig `json:"logConfigs,omitempty"` + + // NotIns: The rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is not + // in this set of entries. + NotIns []string `json:"notIns,omitempty"` + + // Permissions: A permission is a string of form '..' (e.g., + // 'storage.buckets.list'). A value of '*' matches all permissions, and + // a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs. + Permissions []string `json:"permissions,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Action") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Rule) MarshalJSON() ([]byte, error) { + type noMethod Rule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TestPermissionsRequest struct { + // Permissions: The set of permissions to check for the 'resource'. + // Permissions with wildcards (such as '*' or 'storage.*') are not + // allowed. + Permissions []string `json:"permissions,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Permissions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TestPermissionsRequest) MarshalJSON() ([]byte, error) { + type noMethod TestPermissionsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TestPermissionsResponse struct { + // Permissions: A subset of `TestPermissionsRequest.permissions` that + // the caller is allowed. + Permissions []string `json:"permissions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Permissions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TestPermissionsResponse) MarshalJSON() ([]byte, error) { + type noMethod TestPermissionsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// User: A User resource. +type User struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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"` + + // Groups: [Output Only] A list of URLs to Group resources who contain + // the user. Users are only members of groups in the same project. + Groups []string `json:"groups,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always + // clouduseraccounts#user for users. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. + Name string `json:"name,omitempty"` + + // Owner: Email address of account's owner. This account will be + // validated to make sure it exists. The email can belong to any domain, + // but it must be tied to a Google account. + Owner string `json:"owner,omitempty"` + + // PublicKeys: [Output Only] Public keys that this user may use to + // login. + PublicKeys []*PublicKey `json:"publicKeys,omitempty"` + + // SelfLink: [Output Only] Server defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *User) MarshalJSON() ([]byte, error) { + type noMethod User + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type UserList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of User resources. + Items []*User `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always + // clouduseraccounts#userList for lists of users. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserList) MarshalJSON() ([]byte, error) { + type noMethod UserList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "clouduseraccounts.globalAccountsOperations.delete": + +type GlobalAccountsOperationsDeleteCall struct { + s *Service + project string + operation string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified operation resource. +func (r *GlobalAccountsOperationsService) Delete(project string, operation string) *GlobalAccountsOperationsDeleteCall { + c := &GlobalAccountsOperationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.operation = operation + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalAccountsOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalAccountsOperationsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalAccountsOperationsDeleteCall) Context(ctx context.Context) *GlobalAccountsOperationsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalAccountsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.globalAccountsOperations.delete" call. +func (c *GlobalAccountsOperationsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified operation resource.", + // "httpMethod": "DELETE", + // "id": "clouduseraccounts.globalAccountsOperations.delete", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the Operations resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.globalAccountsOperations.get": + +type GlobalAccountsOperationsGetCall struct { + s *Service + project string + operation string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves the specified operation resource. +func (r *GlobalAccountsOperationsService) Get(project string, operation string) *GlobalAccountsOperationsGetCall { + c := &GlobalAccountsOperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.operation = operation + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalAccountsOperationsGetCall) Fields(s ...googleapi.Field) *GlobalAccountsOperationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalAccountsOperationsGetCall) IfNoneMatch(entityTag string) *GlobalAccountsOperationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalAccountsOperationsGetCall) Context(ctx context.Context) *GlobalAccountsOperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalAccountsOperationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.globalAccountsOperations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GlobalAccountsOperationsGetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified operation resource.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.globalAccountsOperations.get", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the Operations resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.globalAccountsOperations.list": + +type GlobalAccountsOperationsListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of operation resources contained within the +// specified project. +func (r *GlobalAccountsOperationsService) List(project string) *GlobalAccountsOperationsListCall { + c := &GlobalAccountsOperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *GlobalAccountsOperationsListCall) Filter(filter string) *GlobalAccountsOperationsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *GlobalAccountsOperationsListCall) MaxResults(maxResults int64) *GlobalAccountsOperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *GlobalAccountsOperationsListCall) OrderBy(orderBy string) *GlobalAccountsOperationsListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *GlobalAccountsOperationsListCall) PageToken(pageToken string) *GlobalAccountsOperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalAccountsOperationsListCall) Fields(s ...googleapi.Field) *GlobalAccountsOperationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalAccountsOperationsListCall) IfNoneMatch(entityTag string) *GlobalAccountsOperationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalAccountsOperationsListCall) Context(ctx context.Context) *GlobalAccountsOperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalAccountsOperationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.globalAccountsOperations.list" call. +// Exactly one of *OperationList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *OperationList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *GlobalAccountsOperationsListCall) Do() (*OperationList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperationList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of operation resources contained within the specified project.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.globalAccountsOperations.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.groups.addMember": + +type GroupsAddMemberCall struct { + s *Service + project string + groupName string + groupsaddmemberrequest *GroupsAddMemberRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// AddMember: Adds users to the specified group. +func (r *GroupsService) AddMember(project string, groupName string, groupsaddmemberrequest *GroupsAddMemberRequest) *GroupsAddMemberCall { + c := &GroupsAddMemberCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.groupName = groupName + c.groupsaddmemberrequest = groupsaddmemberrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsAddMemberCall) Fields(s ...googleapi.Field) *GroupsAddMemberCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsAddMemberCall) Context(ctx context.Context) *GroupsAddMemberCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsAddMemberCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupsaddmemberrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{groupName}/addMember") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "groupName": c.groupName, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.addMember" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GroupsAddMemberCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds users to the specified group.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.groups.addMember", + // "parameterOrder": [ + // "project", + // "groupName" + // ], + // "parameters": { + // "groupName": { + // "description": "Name of the group for this request.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/groups/{groupName}/addMember", + // "request": { + // "$ref": "GroupsAddMemberRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.groups.delete": + +type GroupsDeleteCall struct { + s *Service + project string + groupName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified Group resource. +func (r *GroupsService) Delete(project string, groupName string) *GroupsDeleteCall { + c := &GroupsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.groupName = groupName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsDeleteCall) Fields(s ...googleapi.Field) *GroupsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsDeleteCall) Context(ctx context.Context) *GroupsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{groupName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "groupName": c.groupName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GroupsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified Group resource.", + // "httpMethod": "DELETE", + // "id": "clouduseraccounts.groups.delete", + // "parameterOrder": [ + // "project", + // "groupName" + // ], + // "parameters": { + // "groupName": { + // "description": "Name of the Group resource to delete.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/groups/{groupName}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.groups.get": + +type GroupsGetCall struct { + s *Service + project string + groupName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified Group resource. +func (r *GroupsService) Get(project string, groupName string) *GroupsGetCall { + c := &GroupsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.groupName = groupName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsGetCall) Fields(s ...googleapi.Field) *GroupsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GroupsGetCall) IfNoneMatch(entityTag string) *GroupsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsGetCall) Context(ctx context.Context) *GroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{groupName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "groupName": c.groupName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.get" call. +// Exactly one of *Group or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Group.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *GroupsGetCall) Do() (*Group, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Group{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified Group resource.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.groups.get", + // "parameterOrder": [ + // "project", + // "groupName" + // ], + // "parameters": { + // "groupName": { + // "description": "Name of the Group resource to return.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/groups/{groupName}", + // "response": { + // "$ref": "Group" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.groups.getIamPolicy": + +type GroupsGetIamPolicyCall struct { + s *Service + project string + resource string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetIamPolicy: Gets the access control policy for a resource. May be +// empty if no such policy or resource exists. +func (r *GroupsService) GetIamPolicy(project string, resource string) *GroupsGetIamPolicyCall { + c := &GroupsGetIamPolicyCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.resource = resource + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsGetIamPolicyCall) Fields(s ...googleapi.Field) *GroupsGetIamPolicyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GroupsGetIamPolicyCall) IfNoneMatch(entityTag string) *GroupsGetIamPolicyCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsGetIamPolicyCall) Context(ctx context.Context) *GroupsGetIamPolicyCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{resource}/getIamPolicy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "resource": c.resource, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.getIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *GroupsGetIamPolicyCall) Do() (*Policy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.groups.getIamPolicy", + // "parameterOrder": [ + // "project", + // "resource" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "resource": { + // "description": "Name of the resource for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/groups/{resource}/getIamPolicy", + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.groups.insert": + +type GroupsInsertCall struct { + s *Service + project string + group *Group + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a Group resource in the specified project using the +// data included in the request. +func (r *GroupsService) Insert(project string, group *Group) *GroupsInsertCall { + c := &GroupsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.group = group + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsInsertCall) Fields(s ...googleapi.Field) *GroupsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsInsertCall) Context(ctx context.Context) *GroupsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GroupsInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a Group resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.groups.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/groups", + // "request": { + // "$ref": "Group" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.groups.list": + +type GroupsListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of groups contained within the specified +// project. +func (r *GroupsService) List(project string) *GroupsListCall { + c := &GroupsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *GroupsListCall) Filter(filter string) *GroupsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *GroupsListCall) MaxResults(maxResults int64) *GroupsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *GroupsListCall) OrderBy(orderBy string) *GroupsListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *GroupsListCall) PageToken(pageToken string) *GroupsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsListCall) Fields(s ...googleapi.Field) *GroupsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GroupsListCall) IfNoneMatch(entityTag string) *GroupsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsListCall) Context(ctx context.Context) *GroupsListCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.list" call. +// Exactly one of *GroupList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *GroupList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GroupsListCall) Do() (*GroupList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &GroupList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of groups contained within the specified project.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.groups.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/groups", + // "response": { + // "$ref": "GroupList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.groups.removeMember": + +type GroupsRemoveMemberCall struct { + s *Service + project string + groupName string + groupsremovememberrequest *GroupsRemoveMemberRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// RemoveMember: Removes users from the specified group. +func (r *GroupsService) RemoveMember(project string, groupName string, groupsremovememberrequest *GroupsRemoveMemberRequest) *GroupsRemoveMemberCall { + c := &GroupsRemoveMemberCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.groupName = groupName + c.groupsremovememberrequest = groupsremovememberrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsRemoveMemberCall) Fields(s ...googleapi.Field) *GroupsRemoveMemberCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsRemoveMemberCall) Context(ctx context.Context) *GroupsRemoveMemberCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsRemoveMemberCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupsremovememberrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{groupName}/removeMember") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "groupName": c.groupName, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.removeMember" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GroupsRemoveMemberCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Removes users from the specified group.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.groups.removeMember", + // "parameterOrder": [ + // "project", + // "groupName" + // ], + // "parameters": { + // "groupName": { + // "description": "Name of the group for this request.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/groups/{groupName}/removeMember", + // "request": { + // "$ref": "GroupsRemoveMemberRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.groups.setIamPolicy": + +type GroupsSetIamPolicyCall struct { + s *Service + project string + resource string + policy *Policy + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetIamPolicy: Sets the access control policy on the specified +// resource. Replaces any existing policy. +func (r *GroupsService) SetIamPolicy(project string, resource string, policy *Policy) *GroupsSetIamPolicyCall { + c := &GroupsSetIamPolicyCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.resource = resource + c.policy = policy + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsSetIamPolicyCall) Fields(s ...googleapi.Field) *GroupsSetIamPolicyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsSetIamPolicyCall) Context(ctx context.Context) *GroupsSetIamPolicyCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{resource}/setIamPolicy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "resource": c.resource, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.setIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *GroupsSetIamPolicyCall) Do() (*Policy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.groups.setIamPolicy", + // "parameterOrder": [ + // "project", + // "resource" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "resource": { + // "description": "Name of the resource for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/groups/{resource}/setIamPolicy", + // "request": { + // "$ref": "Policy" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.groups.testIamPermissions": + +type GroupsTestIamPermissionsCall struct { + s *Service + project string + resource string + testpermissionsrequest *TestPermissionsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// TestIamPermissions: Returns permissions that a caller has on the +// specified resource. +func (r *GroupsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *GroupsTestIamPermissionsCall { + c := &GroupsTestIamPermissionsCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.resource = resource + c.testpermissionsrequest = testpermissionsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *GroupsTestIamPermissionsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsTestIamPermissionsCall) Context(ctx context.Context) *GroupsTestIamPermissionsCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{resource}/testIamPermissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "resource": c.resource, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.testIamPermissions" call. +// Exactly one of *TestPermissionsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TestPermissionsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *GroupsTestIamPermissionsCall) Do() (*TestPermissionsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TestPermissionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns permissions that a caller has on the specified resource.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.groups.testIamPermissions", + // "parameterOrder": [ + // "project", + // "resource" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "resource": { + // "description": "Name of the resource for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/groups/{resource}/testIamPermissions", + // "request": { + // "$ref": "TestPermissionsRequest" + // }, + // "response": { + // "$ref": "TestPermissionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.linux.getAuthorizedKeysView": + +type LinuxGetAuthorizedKeysViewCall struct { + s *Service + project string + zone string + user string + instance string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetAuthorizedKeysView: Returns a list of authorized public keys for a +// specific user account. +func (r *LinuxService) GetAuthorizedKeysView(project string, zone string, user string, instance string) *LinuxGetAuthorizedKeysViewCall { + c := &LinuxGetAuthorizedKeysViewCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.user = user + c.instance = instance + return c +} + +// Login sets the optional parameter "login": Whether the view was +// requested as part of a user-initiated login. +func (c *LinuxGetAuthorizedKeysViewCall) Login(login bool) *LinuxGetAuthorizedKeysViewCall { + c.opt_["login"] = login + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LinuxGetAuthorizedKeysViewCall) Fields(s ...googleapi.Field) *LinuxGetAuthorizedKeysViewCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LinuxGetAuthorizedKeysViewCall) Context(ctx context.Context) *LinuxGetAuthorizedKeysViewCall { + c.ctx_ = ctx + return c +} + +func (c *LinuxGetAuthorizedKeysViewCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("instance", fmt.Sprintf("%v", c.instance)) + if v, ok := c.opt_["login"]; ok { + params.Set("login", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/authorizedKeysView/{user}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "user": c.user, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.linux.getAuthorizedKeysView" call. +// Exactly one of *LinuxGetAuthorizedKeysViewResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *LinuxGetAuthorizedKeysViewResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *LinuxGetAuthorizedKeysViewCall) Do() (*LinuxGetAuthorizedKeysViewResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LinuxGetAuthorizedKeysViewResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a list of authorized public keys for a specific user account.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.linux.getAuthorizedKeysView", + // "parameterOrder": [ + // "project", + // "zone", + // "user", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "The fully-qualified URL of the virtual machine requesting the view.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "login": { + // "description": "Whether the view was requested as part of a user-initiated login.", + // "location": "query", + // "type": "boolean" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "user": { + // "description": "The user account for which you want to get a list of authorized public keys.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/authorizedKeysView/{user}", + // "response": { + // "$ref": "LinuxGetAuthorizedKeysViewResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.linux.getLinuxAccountViews": + +type LinuxGetLinuxAccountViewsCall struct { + s *Service + project string + zone string + instance string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetLinuxAccountViews: Retrieves a list of user accounts for an +// instance within a specific project. +func (r *LinuxService) GetLinuxAccountViews(project string, zone string, instance string) *LinuxGetLinuxAccountViewsCall { + c := &LinuxGetLinuxAccountViewsCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *LinuxGetLinuxAccountViewsCall) Filter(filter string) *LinuxGetLinuxAccountViewsCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *LinuxGetLinuxAccountViewsCall) MaxResults(maxResults int64) *LinuxGetLinuxAccountViewsCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *LinuxGetLinuxAccountViewsCall) OrderBy(orderBy string) *LinuxGetLinuxAccountViewsCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *LinuxGetLinuxAccountViewsCall) PageToken(pageToken string) *LinuxGetLinuxAccountViewsCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LinuxGetLinuxAccountViewsCall) Fields(s ...googleapi.Field) *LinuxGetLinuxAccountViewsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LinuxGetLinuxAccountViewsCall) Context(ctx context.Context) *LinuxGetLinuxAccountViewsCall { + c.ctx_ = ctx + return c +} + +func (c *LinuxGetLinuxAccountViewsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("instance", fmt.Sprintf("%v", c.instance)) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/linuxAccountViews") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.linux.getLinuxAccountViews" call. +// Exactly one of *LinuxGetLinuxAccountViewsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *LinuxGetLinuxAccountViewsResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *LinuxGetLinuxAccountViewsCall) Do() (*LinuxGetLinuxAccountViewsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LinuxGetLinuxAccountViewsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of user accounts for an instance within a specific project.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.linux.getLinuxAccountViews", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "instance": { + // "description": "The fully-qualified URL of the virtual machine requesting the views.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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 for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/linuxAccountViews", + // "response": { + // "$ref": "LinuxGetLinuxAccountViewsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.users.addPublicKey": + +type UsersAddPublicKeyCall struct { + s *Service + project string + user string + publickey *PublicKey + opt_ map[string]interface{} + ctx_ context.Context +} + +// AddPublicKey: Adds a public key to the specified User resource with +// the data included in the request. +func (r *UsersService) AddPublicKey(project string, user string, publickey *PublicKey) *UsersAddPublicKeyCall { + c := &UsersAddPublicKeyCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.user = user + c.publickey = publickey + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersAddPublicKeyCall) Fields(s ...googleapi.Field) *UsersAddPublicKeyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersAddPublicKeyCall) Context(ctx context.Context) *UsersAddPublicKeyCall { + c.ctx_ = ctx + return c +} + +func (c *UsersAddPublicKeyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.publickey) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{user}/addPublicKey") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "user": c.user, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.addPublicKey" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersAddPublicKeyCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds a public key to the specified User resource with the data included in the request.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.users.addPublicKey", + // "parameterOrder": [ + // "project", + // "user" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "user": { + // "description": "Name of the user for this request.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/users/{user}/addPublicKey", + // "request": { + // "$ref": "PublicKey" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.users.delete": + +type UsersDeleteCall struct { + s *Service + project string + user string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified User resource. +func (r *UsersService) Delete(project string, user string) *UsersDeleteCall { + c := &UsersDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.user = user + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersDeleteCall) Fields(s ...googleapi.Field) *UsersDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersDeleteCall) Context(ctx context.Context) *UsersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{user}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "user": c.user, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified User resource.", + // "httpMethod": "DELETE", + // "id": "clouduseraccounts.users.delete", + // "parameterOrder": [ + // "project", + // "user" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "user": { + // "description": "Name of the user resource to delete.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/users/{user}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.users.get": + +type UsersGetCall struct { + s *Service + project string + user string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified User resource. +func (r *UsersService) Get(project string, user string) *UsersGetCall { + c := &UsersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.user = user + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall { + c.ctx_ = ctx + return c +} + +func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{user}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "user": c.user, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.get" call. +// Exactly one of *User or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *User.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *UsersGetCall) Do() (*User, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &User{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified User resource.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.users.get", + // "parameterOrder": [ + // "project", + // "user" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "user": { + // "description": "Name of the user resource to return.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/users/{user}", + // "response": { + // "$ref": "User" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.users.getIamPolicy": + +type UsersGetIamPolicyCall struct { + s *Service + project string + resource string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetIamPolicy: Gets the access control policy for a resource. May be +// empty if no such policy or resource exists. +func (r *UsersService) GetIamPolicy(project string, resource string) *UsersGetIamPolicyCall { + c := &UsersGetIamPolicyCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.resource = resource + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersGetIamPolicyCall) Fields(s ...googleapi.Field) *UsersGetIamPolicyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersGetIamPolicyCall) IfNoneMatch(entityTag string) *UsersGetIamPolicyCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersGetIamPolicyCall) Context(ctx context.Context) *UsersGetIamPolicyCall { + c.ctx_ = ctx + return c +} + +func (c *UsersGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{resource}/getIamPolicy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "resource": c.resource, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.getIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersGetIamPolicyCall) Do() (*Policy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.users.getIamPolicy", + // "parameterOrder": [ + // "project", + // "resource" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "resource": { + // "description": "Name of the resource for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/users/{resource}/getIamPolicy", + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.users.insert": + +type UsersInsertCall struct { + s *Service + project string + user *User + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a User resource in the specified project using the +// data included in the request. +func (r *UsersService) Insert(project string, user *User) *UsersInsertCall { + c := &UsersInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.user = user + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersInsertCall) Fields(s ...googleapi.Field) *UsersInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersInsertCall) Context(ctx context.Context) *UsersInsertCall { + c.ctx_ = ctx + return c +} + +func (c *UsersInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a User resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.users.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/users", + // "request": { + // "$ref": "User" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.users.list": + +type UsersListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of users contained within the specified +// project. +func (r *UsersService) List(project string) *UsersListCall { + c := &UsersListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *UsersListCall) Filter(filter string) *UsersListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *UsersListCall) MaxResults(maxResults int64) *UsersListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *UsersListCall) OrderBy(orderBy string) *UsersListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *UsersListCall) PageToken(pageToken string) *UsersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersListCall) Context(ctx context.Context) *UsersListCall { + c.ctx_ = ctx + return c +} + +func (c *UsersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.list" call. +// Exactly one of *UserList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *UserList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersListCall) Do() (*UserList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of users contained within the specified project.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.users.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/users", + // "response": { + // "$ref": "UserList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.users.removePublicKey": + +type UsersRemovePublicKeyCall struct { + s *Service + project string + user string + fingerprint string + opt_ map[string]interface{} + ctx_ context.Context +} + +// RemovePublicKey: Removes the specified public key from the user. +func (r *UsersService) RemovePublicKey(project string, user string, fingerprint string) *UsersRemovePublicKeyCall { + c := &UsersRemovePublicKeyCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.user = user + c.fingerprint = fingerprint + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersRemovePublicKeyCall) Fields(s ...googleapi.Field) *UsersRemovePublicKeyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersRemovePublicKeyCall) Context(ctx context.Context) *UsersRemovePublicKeyCall { + c.ctx_ = ctx + return c +} + +func (c *UsersRemovePublicKeyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("fingerprint", fmt.Sprintf("%v", c.fingerprint)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{user}/removePublicKey") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "user": c.user, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.removePublicKey" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersRemovePublicKeyCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Removes the specified public key from the user.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.users.removePublicKey", + // "parameterOrder": [ + // "project", + // "user", + // "fingerprint" + // ], + // "parameters": { + // "fingerprint": { + // "description": "The fingerprint of the public key to delete. Public keys are identified by their fingerprint, which is defined by RFC4716 to be the MD5 digest of the public key.", + // "location": "query", + // "pattern": "[a-f0-9]{32}", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "user": { + // "description": "Name of the user for this request.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/users/{user}/removePublicKey", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.users.setIamPolicy": + +type UsersSetIamPolicyCall struct { + s *Service + project string + resource string + policy *Policy + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetIamPolicy: Sets the access control policy on the specified +// resource. Replaces any existing policy. +func (r *UsersService) SetIamPolicy(project string, resource string, policy *Policy) *UsersSetIamPolicyCall { + c := &UsersSetIamPolicyCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.resource = resource + c.policy = policy + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersSetIamPolicyCall) Fields(s ...googleapi.Field) *UsersSetIamPolicyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersSetIamPolicyCall) Context(ctx context.Context) *UsersSetIamPolicyCall { + c.ctx_ = ctx + return c +} + +func (c *UsersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{resource}/setIamPolicy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "resource": c.resource, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.setIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersSetIamPolicyCall) Do() (*Policy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.users.setIamPolicy", + // "parameterOrder": [ + // "project", + // "resource" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "resource": { + // "description": "Name of the resource for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/users/{resource}/setIamPolicy", + // "request": { + // "$ref": "Policy" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.users.testIamPermissions": + +type UsersTestIamPermissionsCall struct { + s *Service + project string + resource string + testpermissionsrequest *TestPermissionsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// TestIamPermissions: Returns permissions that a caller has on the +// specified resource. +func (r *UsersService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *UsersTestIamPermissionsCall { + c := &UsersTestIamPermissionsCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.resource = resource + c.testpermissionsrequest = testpermissionsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersTestIamPermissionsCall) Fields(s ...googleapi.Field) *UsersTestIamPermissionsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersTestIamPermissionsCall) Context(ctx context.Context) *UsersTestIamPermissionsCall { + c.ctx_ = ctx + return c +} + +func (c *UsersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{resource}/testIamPermissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "resource": c.resource, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.testIamPermissions" call. +// Exactly one of *TestPermissionsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TestPermissionsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UsersTestIamPermissionsCall) Do() (*TestPermissionsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TestPermissionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns permissions that a caller has on the specified resource.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.users.testIamPermissions", + // "parameterOrder": [ + // "project", + // "resource" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "resource": { + // "description": "Name of the resource for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/users/{resource}/testIamPermissions", + // "request": { + // "$ref": "TestPermissionsRequest" + // }, + // "response": { + // "$ref": "TestPermissionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/v0.beta/clouduseraccounts-api.json b/Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/v0.beta/clouduseraccounts-api.json new file mode 100644 index 000000000..4c69589c4 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/v0.beta/clouduseraccounts-api.json @@ -0,0 +1,1355 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/xBfFzMk6wt9FD4JzWVbI-t4fKcE\"", + "discoveryVersion": "v1", + "id": "clouduseraccounts:beta", + "name": "clouduseraccounts", + "canonicalName": "Cloud User Accounts", + "version": "beta", + "revision": "20150917", + "title": "Cloud User Accounts API", + "description": "API for the Google Cloud User Accounts service.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/compute_engine-16.png", + "x32": "https://www.google.com/images/icons/product/compute_engine-32.png" + }, + "documentationLink": "https://cloud.google.com/compute/docs/access/user-accounts/api/latest/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/clouduseraccounts/beta/projects/", + "basePath": "/clouduseraccounts/beta/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "clouduseraccounts/beta/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/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/cloud.useraccounts": { + "description": "Manage your Google Cloud User Accounts" + }, + "https://www.googleapis.com/auth/cloud.useraccounts.readonly": { + "description": "View your Google Cloud User Accounts" + } + } + } + }, + "schemas": { + "AuthorizedKeysView": { + "id": "AuthorizedKeysView", + "type": "object", + "description": "A list of authorized public keys for a user account.", + "properties": { + "keys": { + "type": "array", + "description": "[Output Only] The list of authorized public keys in SSH format.", + "items": { + "type": "string" + } + }, + "sudoer": { + "type": "boolean", + "description": "[Output Only] Whether the user has the ability to elevate on the instance that requested the authorized keys." + } + } + }, + "Group": { + "id": "Group", + "type": "object", + "description": "A Group resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always clouduseraccounts#group for groups.", + "default": "clouduseraccounts#group" + }, + "members": { + "type": "array", + "description": "[Output Only] A list of URLs to User resources who belong to the group. Users may only be members of groups in the same project.", + "items": { + "type": "string" + } + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created.", + "pattern": "[a-z][-a-z0-9_]{0,31}", + "annotations": { + "required": [ + "clouduseraccounts.groups.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for the resource." + } + } + }, + "GroupList": { + "id": "GroupList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of Group resources.", + "items": { + "$ref": "Group" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always clouduseraccounts#groupList for lists of groups.", + "default": "clouduseraccounts#groupList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for this resource." + } + } + }, + "GroupsAddMemberRequest": { + "id": "GroupsAddMemberRequest", + "type": "object", + "properties": { + "users": { + "type": "array", + "description": "Fully-qualified URLs of the User resources to add.", + "items": { + "type": "string" + } + } + } + }, + "GroupsRemoveMemberRequest": { + "id": "GroupsRemoveMemberRequest", + "type": "object", + "properties": { + "users": { + "type": "array", + "description": "Fully-qualified URLs of the User resources to remove.", + "items": { + "type": "string" + } + } + } + }, + "LinuxAccountViews": { + "id": "LinuxAccountViews", + "type": "object", + "description": "A list of all Linux accounts for this project. This API is only used by Compute Engine virtual machines to get information about user accounts for a project or instance. Linux resources are read-only views into users and groups managed by the Compute Engine Accounts API.", + "properties": { + "groupViews": { + "type": "array", + "description": "[Output Only] A list of all groups within a project.", + "items": { + "$ref": "LinuxGroupView" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always clouduseraccounts#linuxAccountViews for Linux resources.", + "default": "clouduseraccounts#linuxAccountViews" + }, + "userViews": { + "type": "array", + "description": "[Output Only] A list of all users within a project.", + "items": { + "$ref": "LinuxUserView" + } + } + } + }, + "LinuxGetAuthorizedKeysViewResponse": { + "id": "LinuxGetAuthorizedKeysViewResponse", + "type": "object", + "properties": { + "resource": { + "$ref": "AuthorizedKeysView", + "description": "[Output Only] A list of authorized public keys for a user." + } + } + }, + "LinuxGetLinuxAccountViewsResponse": { + "id": "LinuxGetLinuxAccountViewsResponse", + "type": "object", + "properties": { + "resource": { + "$ref": "LinuxAccountViews", + "description": "[Output Only] A list of authorized user accounts and groups." + } + } + }, + "LinuxGroupView": { + "id": "LinuxGroupView", + "type": "object", + "description": "A detailed view of a Linux group.", + "properties": { + "gid": { + "type": "integer", + "description": "[Output Only] The Group ID.", + "format": "uint32" + }, + "groupName": { + "type": "string", + "description": "[Output Only] Group name." + }, + "members": { + "type": "array", + "description": "[Output Only] List of user accounts that belong to the group.", + "items": { + "type": "string" + } + } + } + }, + "LinuxUserView": { + "id": "LinuxUserView", + "type": "object", + "description": "A detailed view of a Linux user account.", + "properties": { + "gecos": { + "type": "string", + "description": "[Output Only] The GECOS (user information) entry for this account." + }, + "gid": { + "type": "integer", + "description": "[Output Only] User's default group ID.", + "format": "uint32" + }, + "homeDirectory": { + "type": "string", + "description": "[Output Only] The path to the home directory for this account." + }, + "shell": { + "type": "string", + "description": "[Output Only] The path to the login shell for this account." + }, + "uid": { + "type": "integer", + "description": "[Output Only] User ID.", + "format": "uint32" + }, + "username": { + "type": "string", + "description": "[Output Only] The username of the account." + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "description": "An Operation resource, used to manage asynchronous API requests.", + "properties": { + "clientOperationId": { + "type": "string", + "description": "[Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all Operation resources in the project." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "endTime": { + "type": "string", + "description": "[Output Only] The time that this operation was completed. This is in RFC3339 text format." + }, + "error": { + "type": "object", + "description": "[Output Only] If errors are generated during processing of the operation, this field will be populated.", + "properties": { + "errors": { + "type": "array", + "description": "[Output Only] The array of errors encountered while processing this operation.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The error type identifier for this error." + }, + "location": { + "type": "string", + "description": "[Output Only] Indicates the field in the request which caused the error. This property is optional." + }, + "message": { + "type": "string", + "description": "[Output Only] An optional, human-readable error message." + } + } + } + } + } + }, + "httpErrorMessage": { + "type": "string", + "description": "[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND." + }, + "httpErrorStatusCode": { + "type": "integer", + "description": "[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as 404.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "[Output Only] The time that this operation was requested. This is in RFC3339 text format." + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#operation for Operation resources.", + "default": "clouduseraccounts#operation" + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource." + }, + "operationType": { + "type": "string", + "description": "[Output Only] Type of the operation, such as insert, compute.instanceGroups.update, or compute.instanceGroups.delete." + }, + "progress": { + "type": "integer", + "description": "[Output Only] 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 monotonically increase as the operation progresses.", + "format": "int32" + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where the operation resides. Only applicable for regional resources." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "startTime": { + "type": "string", + "description": "[Output Only] The time that this operation was started by the server. This is in RFC3339 text format." + }, + "status": { + "type": "string", + "description": "[Output Only] Status of the operation. Can be one of the following: PENDING, RUNNING, or DONE.", + "enum": [ + "DONE", + "PENDING", + "RUNNING" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "statusMessage": { + "type": "string", + "description": "[Output Only] An optional textual description of the current status of the operation." + }, + "targetId": { + "type": "string", + "description": "[Output Only] Unique target ID which identifies a particular incarnation of the target.", + "format": "uint64" + }, + "targetLink": { + "type": "string", + "description": "[Output Only] URL of the resource the operation is mutating." + }, + "user": { + "type": "string", + "description": "[Output Only] User who requested the operation, for example: user@example.com." + }, + "warnings": { + "type": "array", + "description": "[Output Only] If warning messages are generated during processing of the operation, this field will be populated.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + }, + "zone": { + "type": "string", + "description": "[Output Only] URL of the zone where the operation resides." + } + } + }, + "OperationList": { + "id": "OperationList", + "type": "object", + "description": "Contains a list of Operation resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] The Operation resources.", + "items": { + "$ref": "Operation" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#operations for Operations resource.", + "default": "clouduseraccounts#operationList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncate." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "PublicKey": { + "id": "PublicKey", + "type": "object", + "description": "A public key for authenticating to guests.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "expirationTimestamp": { + "type": "string", + "description": "Optional expiration timestamp. If provided, the timestamp must be in RFC3339 text format. If not provided, the public key never expires." + }, + "fingerprint": { + "type": "string", + "description": "[Output Only] The fingerprint of the key is defined by RFC4716 to be the MD5 digest of the public key." + }, + "key": { + "type": "string", + "description": "Public key text in SSH format, defined by RFC4253 section 6.6." + } + } + }, + "User": { + "id": "User", + "type": "object", + "description": "A User resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "groups": { + "type": "array", + "description": "[Output Only] A list of URLs to Group resources who contain the user. Users are only members of groups in the same project.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always clouduseraccounts#user for users.", + "default": "clouduseraccounts#user" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created.", + "pattern": "[a-z][-a-z0-9_]{0,31}", + "annotations": { + "required": [ + "clouduseraccounts.users.insert" + ] + } + }, + "owner": { + "type": "string", + "description": "Email address of account's owner. This account will be validated to make sure it exists. The email can belong to any domain, but it must be tied to a Google account.", + "annotations": { + "required": [ + "clouduseraccounts.users.insert" + ] + } + }, + "publicKeys": { + "type": "array", + "description": "[Output Only] Public keys that this user may use to login.", + "items": { + "$ref": "PublicKey" + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for the resource." + } + } + }, + "UserList": { + "id": "UserList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of User resources.", + "items": { + "$ref": "User" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always clouduseraccounts#userList for lists of users.", + "default": "clouduseraccounts#userList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for this resource." + } + } + } + }, + "resources": { + "globalAccountsOperations": { + "methods": { + "delete": { + "id": "clouduseraccounts.globalAccountsOperations.delete", + "path": "{project}/global/operations/{operation}", + "httpMethod": "DELETE", + "description": "Deletes the specified operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the Operations resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "get": { + "id": "clouduseraccounts.globalAccountsOperations.get", + "path": "{project}/global/operations/{operation}", + "httpMethod": "GET", + "description": "Retrieves the specified operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the Operations resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "list": { + "id": "clouduseraccounts.globalAccountsOperations.list", + "path": "{project}/global/operations", + "httpMethod": "GET", + "description": "Retrieves the list of operation resources contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + } + } + }, + "groups": { + "methods": { + "addMember": { + "id": "clouduseraccounts.groups.addMember", + "path": "{project}/global/groups/{groupName}/addMember", + "httpMethod": "POST", + "description": "Adds users to the specified group.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the group for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "groupName" + ], + "request": { + "$ref": "GroupsAddMemberRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "delete": { + "id": "clouduseraccounts.groups.delete", + "path": "{project}/global/groups/{groupName}", + "httpMethod": "DELETE", + "description": "Deletes the specified Group resource.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the Group resource to delete.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "groupName" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "get": { + "id": "clouduseraccounts.groups.get", + "path": "{project}/global/groups/{groupName}", + "httpMethod": "GET", + "description": "Returns the specified Group resource.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the Group resource to return.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "groupName" + ], + "response": { + "$ref": "Group" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "insert": { + "id": "clouduseraccounts.groups.insert", + "path": "{project}/global/groups", + "httpMethod": "POST", + "description": "Creates a Group resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "Group" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "list": { + "id": "clouduseraccounts.groups.list", + "path": "{project}/global/groups", + "httpMethod": "GET", + "description": "Retrieves the list of groups contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "GroupList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "removeMember": { + "id": "clouduseraccounts.groups.removeMember", + "path": "{project}/global/groups/{groupName}/removeMember", + "httpMethod": "POST", + "description": "Removes users from the specified group.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the group for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "groupName" + ], + "request": { + "$ref": "GroupsRemoveMemberRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + } + } + }, + "linux": { + "methods": { + "getAuthorizedKeysView": { + "id": "clouduseraccounts.linux.getAuthorizedKeysView", + "path": "{project}/zones/{zone}/authorizedKeysView/{user}", + "httpMethod": "POST", + "description": "Returns a list of authorized public keys for a specific user account.", + "parameters": { + "instance": { + "type": "string", + "description": "The fully-qualified URL of the virtual machine requesting the view.", + "required": true, + "location": "query" + }, + "login": { + "type": "boolean", + "description": "Whether the view was requested as part of a user-initiated login.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "user": { + "type": "string", + "description": "The user account for which you want to get a list of authorized public keys.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "zone": { + "type": "string", + "description": "Name of the zone for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "user", + "instance" + ], + "response": { + "$ref": "LinuxGetAuthorizedKeysViewResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "getLinuxAccountViews": { + "id": "clouduseraccounts.linux.getLinuxAccountViews", + "path": "{project}/zones/{zone}/linuxAccountViews", + "httpMethod": "POST", + "description": "Retrieves a list of user accounts for an instance within a specific project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "instance": { + "type": "string", + "description": "The fully-qualified URL of the virtual machine requesting the views.", + "required": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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 for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "response": { + "$ref": "LinuxGetLinuxAccountViewsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + } + } + }, + "users": { + "methods": { + "addPublicKey": { + "id": "clouduseraccounts.users.addPublicKey", + "path": "{project}/global/users/{user}/addPublicKey", + "httpMethod": "POST", + "description": "Adds a public key to the specified User resource with the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "user": { + "type": "string", + "description": "Name of the user for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user" + ], + "request": { + "$ref": "PublicKey" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "delete": { + "id": "clouduseraccounts.users.delete", + "path": "{project}/global/users/{user}", + "httpMethod": "DELETE", + "description": "Deletes the specified User resource.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "user": { + "type": "string", + "description": "Name of the user resource to delete.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "get": { + "id": "clouduseraccounts.users.get", + "path": "{project}/global/users/{user}", + "httpMethod": "GET", + "description": "Returns the specified User resource.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "user": { + "type": "string", + "description": "Name of the user resource to return.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user" + ], + "response": { + "$ref": "User" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "insert": { + "id": "clouduseraccounts.users.insert", + "path": "{project}/global/users", + "httpMethod": "POST", + "description": "Creates a User resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "User" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "list": { + "id": "clouduseraccounts.users.list", + "path": "{project}/global/users", + "httpMethod": "GET", + "description": "Retrieves a list of users contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "UserList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "removePublicKey": { + "id": "clouduseraccounts.users.removePublicKey", + "path": "{project}/global/users/{user}/removePublicKey", + "httpMethod": "POST", + "description": "Removes the specified public key from the user.", + "parameters": { + "fingerprint": { + "type": "string", + "description": "The fingerprint of the public key to delete. Public keys are identified by their fingerprint, which is defined by RFC4716 to be the MD5 digest of the public key.", + "required": true, + "pattern": "[a-f0-9]{32}", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "user": { + "type": "string", + "description": "Name of the user for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user", + "fingerprint" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/v0.beta/clouduseraccounts-gen.go b/Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/v0.beta/clouduseraccounts-gen.go new file mode 100644 index 000000000..9dd8f8879 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/v0.beta/clouduseraccounts-gen.go @@ -0,0 +1,3451 @@ +// Package clouduseraccounts provides access to the Cloud User Accounts API. +// +// See https://cloud.google.com/compute/docs/access/user-accounts/api/latest/ +// +// Usage example: +// +// import "google.golang.org/api/clouduseraccounts/v0.beta" +// ... +// clouduseraccountsService, err := clouduseraccounts.New(oauthHttpClient) +package clouduseraccounts // import "google.golang.org/api/clouduseraccounts/v0.beta" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "clouduseraccounts:beta" +const apiName = "clouduseraccounts" +const apiVersion = "beta" +const basePath = "https://www.googleapis.com/clouduseraccounts/beta/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 data across Google Cloud Platform services + CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" + + // Manage your Google Cloud User Accounts + CloudUseraccountsScope = "https://www.googleapis.com/auth/cloud.useraccounts" + + // View your Google Cloud User Accounts + CloudUseraccountsReadonlyScope = "https://www.googleapis.com/auth/cloud.useraccounts.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.GlobalAccountsOperations = NewGlobalAccountsOperationsService(s) + s.Groups = NewGroupsService(s) + s.Linux = NewLinuxService(s) + s.Users = NewUsersService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + GlobalAccountsOperations *GlobalAccountsOperationsService + + Groups *GroupsService + + Linux *LinuxService + + Users *UsersService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewGlobalAccountsOperationsService(s *Service) *GlobalAccountsOperationsService { + rs := &GlobalAccountsOperationsService{s: s} + return rs +} + +type GlobalAccountsOperationsService struct { + s *Service +} + +func NewGroupsService(s *Service) *GroupsService { + rs := &GroupsService{s: s} + return rs +} + +type GroupsService struct { + s *Service +} + +func NewLinuxService(s *Service) *LinuxService { + rs := &LinuxService{s: s} + return rs +} + +type LinuxService struct { + s *Service +} + +func NewUsersService(s *Service) *UsersService { + rs := &UsersService{s: s} + return rs +} + +type UsersService struct { + s *Service +} + +// AuthorizedKeysView: A list of authorized public keys for a user +// account. +type AuthorizedKeysView struct { + // Keys: [Output Only] The list of authorized public keys in SSH format. + Keys []string `json:"keys,omitempty"` + + // Sudoer: [Output Only] Whether the user has the ability to elevate on + // the instance that requested the authorized keys. + Sudoer bool `json:"sudoer,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Keys") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AuthorizedKeysView) MarshalJSON() ([]byte, error) { + type noMethod AuthorizedKeysView + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Group: A Group resource. +type Group struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always + // clouduseraccounts#group for groups. + Kind string `json:"kind,omitempty"` + + // Members: [Output Only] A list of URLs to User resources who belong to + // the group. Users may only be members of groups in the same project. + Members []string `json:"members,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] Server defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Group) MarshalJSON() ([]byte, error) { + type noMethod Group + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GroupList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of Group resources. + Items []*Group `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always + // clouduseraccounts#groupList for lists of groups. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GroupList) MarshalJSON() ([]byte, error) { + type noMethod GroupList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GroupsAddMemberRequest struct { + // Users: Fully-qualified URLs of the User resources to add. + Users []string `json:"users,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Users") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GroupsAddMemberRequest) MarshalJSON() ([]byte, error) { + type noMethod GroupsAddMemberRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GroupsRemoveMemberRequest struct { + // Users: Fully-qualified URLs of the User resources to remove. + Users []string `json:"users,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Users") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GroupsRemoveMemberRequest) MarshalJSON() ([]byte, error) { + type noMethod GroupsRemoveMemberRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LinuxAccountViews: A list of all Linux accounts for this project. +// This API is only used by Compute Engine virtual machines to get +// information about user accounts for a project or instance. Linux +// resources are read-only views into users and groups managed by the +// Compute Engine Accounts API. +type LinuxAccountViews struct { + // GroupViews: [Output Only] A list of all groups within a project. + GroupViews []*LinuxGroupView `json:"groupViews,omitempty"` + + // Kind: [Output Only] Type of the resource. Always + // clouduseraccounts#linuxAccountViews for Linux resources. + Kind string `json:"kind,omitempty"` + + // UserViews: [Output Only] A list of all users within a project. + UserViews []*LinuxUserView `json:"userViews,omitempty"` + + // ForceSendFields is a list of field names (e.g. "GroupViews") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LinuxAccountViews) MarshalJSON() ([]byte, error) { + type noMethod LinuxAccountViews + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type LinuxGetAuthorizedKeysViewResponse struct { + // Resource: [Output Only] A list of authorized public keys for a user. + Resource *AuthorizedKeysView `json:"resource,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Resource") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LinuxGetAuthorizedKeysViewResponse) MarshalJSON() ([]byte, error) { + type noMethod LinuxGetAuthorizedKeysViewResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type LinuxGetLinuxAccountViewsResponse struct { + // Resource: [Output Only] A list of authorized user accounts and + // groups. + Resource *LinuxAccountViews `json:"resource,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Resource") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LinuxGetLinuxAccountViewsResponse) MarshalJSON() ([]byte, error) { + type noMethod LinuxGetLinuxAccountViewsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LinuxGroupView: A detailed view of a Linux group. +type LinuxGroupView struct { + // Gid: [Output Only] The Group ID. + Gid int64 `json:"gid,omitempty"` + + // GroupName: [Output Only] Group name. + GroupName string `json:"groupName,omitempty"` + + // Members: [Output Only] List of user accounts that belong to the + // group. + Members []string `json:"members,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Gid") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LinuxGroupView) MarshalJSON() ([]byte, error) { + type noMethod LinuxGroupView + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LinuxUserView: A detailed view of a Linux user account. +type LinuxUserView struct { + // Gecos: [Output Only] The GECOS (user information) entry for this + // account. + Gecos string `json:"gecos,omitempty"` + + // Gid: [Output Only] User's default group ID. + Gid int64 `json:"gid,omitempty"` + + // HomeDirectory: [Output Only] The path to the home directory for this + // account. + HomeDirectory string `json:"homeDirectory,omitempty"` + + // Shell: [Output Only] The path to the login shell for this account. + Shell string `json:"shell,omitempty"` + + // Uid: [Output Only] User ID. + Uid int64 `json:"uid,omitempty"` + + // Username: [Output Only] The username of the account. + Username string `json:"username,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Gecos") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LinuxUserView) MarshalJSON() ([]byte, error) { + type noMethod LinuxUserView + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Operation: An Operation resource, used to manage asynchronous API +// requests. +type Operation struct { + // ClientOperationId: [Output Only] An optional identifier specified by + // the client when the mutation was initiated. Must be unique for all + // Operation resources in the project. + ClientOperationId string `json:"clientOperationId,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // EndTime: [Output Only] The time that this operation was completed. + // This is in RFC3339 text format. + EndTime string `json:"endTime,omitempty"` + + // Error: [Output Only] If errors are generated during processing of the + // operation, this field will be populated. + Error *OperationError `json:"error,omitempty"` + + // HttpErrorMessage: [Output Only] If the operation fails, this field + // contains the HTTP error message that was returned, such as NOT FOUND. + HttpErrorMessage string `json:"httpErrorMessage,omitempty"` + + // HttpErrorStatusCode: [Output Only] If the operation fails, this field + // contains the HTTP error message that was returned, such as 404. + HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // InsertTime: [Output Only] The time that this operation was requested. + // This is in RFC3339 text format. + InsertTime string `json:"insertTime,omitempty"` + + // Kind: [Output Only] Type of the resource. Always compute#operation + // for Operation resources. + Kind string `json:"kind,omitempty"` + + // Name: [Output Only] Name of the resource. + Name string `json:"name,omitempty"` + + // OperationType: [Output Only] Type of the operation, such as insert, + // compute.instanceGroups.update, or compute.instanceGroups.delete. + OperationType string `json:"operationType,omitempty"` + + // Progress: [Output Only] 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 monotonically + // increase as the operation progresses. + Progress int64 `json:"progress,omitempty"` + + // Region: [Output Only] URL of the region where the operation resides. + // Only applicable for regional resources. + Region string `json:"region,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // StartTime: [Output Only] The time that this operation was started by + // the server. This is in RFC3339 text format. + StartTime string `json:"startTime,omitempty"` + + // Status: [Output Only] Status of the operation. Can be one of the + // following: PENDING, RUNNING, or DONE. + // + // Possible values: + // "DONE" + // "PENDING" + // "RUNNING" + Status string `json:"status,omitempty"` + + // StatusMessage: [Output Only] An optional textual description of the + // current status of the operation. + StatusMessage string `json:"statusMessage,omitempty"` + + // TargetId: [Output Only] Unique target ID which identifies a + // particular incarnation of the target. + TargetId uint64 `json:"targetId,omitempty,string"` + + // TargetLink: [Output Only] URL of the resource the operation is + // mutating. + TargetLink string `json:"targetLink,omitempty"` + + // User: [Output Only] User who requested the operation, for example: + // user@example.com. + User string `json:"user,omitempty"` + + // Warnings: [Output Only] If warning messages are generated during + // processing of the operation, this field will be populated. + Warnings []*OperationWarnings `json:"warnings,omitempty"` + + // Zone: [Output Only] URL of the zone where the operation resides. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ClientOperationId") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Operation) MarshalJSON() ([]byte, error) { + type noMethod Operation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationError: [Output Only] If errors are generated during +// processing of the operation, this field will be populated. +type OperationError struct { + // Errors: [Output Only] The array of errors encountered while + // processing this operation. + Errors []*OperationErrorErrors `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationError) MarshalJSON() ([]byte, error) { + type noMethod OperationError + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationErrorErrors struct { + // Code: [Output Only] The error type identifier for this error. + Code string `json:"code,omitempty"` + + // Location: [Output Only] Indicates the field in the request which + // caused the error. This property is optional. + Location string `json:"location,omitempty"` + + // Message: [Output Only] An optional, human-readable error message. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) { + type noMethod OperationErrorErrors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationWarnings struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*OperationWarningsData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationWarnings) MarshalJSON() ([]byte, error) { + type noMethod OperationWarnings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationWarningsData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationWarningsData) MarshalJSON() ([]byte, error) { + type noMethod OperationWarningsData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationList: Contains a list of Operation resources. +type OperationList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] The Operation resources. + Items []*Operation `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#operations for + // Operations resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncate. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationList) MarshalJSON() ([]byte, error) { + type noMethod OperationList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PublicKey: A public key for authenticating to guests. +type PublicKey struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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"` + + // ExpirationTimestamp: Optional expiration timestamp. If provided, the + // timestamp must be in RFC3339 text format. If not provided, the public + // key never expires. + ExpirationTimestamp string `json:"expirationTimestamp,omitempty"` + + // Fingerprint: [Output Only] The fingerprint of the key is defined by + // RFC4716 to be the MD5 digest of the public key. + Fingerprint string `json:"fingerprint,omitempty"` + + // Key: Public key text in SSH format, defined by RFC4253 section 6.6. + Key string `json:"key,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PublicKey) MarshalJSON() ([]byte, error) { + type noMethod PublicKey + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// User: A User resource. +type User struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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"` + + // Groups: [Output Only] A list of URLs to Group resources who contain + // the user. Users are only members of groups in the same project. + Groups []string `json:"groups,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always + // clouduseraccounts#user for users. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. + Name string `json:"name,omitempty"` + + // Owner: Email address of account's owner. This account will be + // validated to make sure it exists. The email can belong to any domain, + // but it must be tied to a Google account. + Owner string `json:"owner,omitempty"` + + // PublicKeys: [Output Only] Public keys that this user may use to + // login. + PublicKeys []*PublicKey `json:"publicKeys,omitempty"` + + // SelfLink: [Output Only] Server defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *User) MarshalJSON() ([]byte, error) { + type noMethod User + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type UserList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of User resources. + Items []*User `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always + // clouduseraccounts#userList for lists of users. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserList) MarshalJSON() ([]byte, error) { + type noMethod UserList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "clouduseraccounts.globalAccountsOperations.delete": + +type GlobalAccountsOperationsDeleteCall struct { + s *Service + project string + operation string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified operation resource. +func (r *GlobalAccountsOperationsService) Delete(project string, operation string) *GlobalAccountsOperationsDeleteCall { + c := &GlobalAccountsOperationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.operation = operation + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalAccountsOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalAccountsOperationsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalAccountsOperationsDeleteCall) Context(ctx context.Context) *GlobalAccountsOperationsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalAccountsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.globalAccountsOperations.delete" call. +func (c *GlobalAccountsOperationsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified operation resource.", + // "httpMethod": "DELETE", + // "id": "clouduseraccounts.globalAccountsOperations.delete", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the Operations resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.globalAccountsOperations.get": + +type GlobalAccountsOperationsGetCall struct { + s *Service + project string + operation string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves the specified operation resource. +func (r *GlobalAccountsOperationsService) Get(project string, operation string) *GlobalAccountsOperationsGetCall { + c := &GlobalAccountsOperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.operation = operation + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalAccountsOperationsGetCall) Fields(s ...googleapi.Field) *GlobalAccountsOperationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalAccountsOperationsGetCall) IfNoneMatch(entityTag string) *GlobalAccountsOperationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalAccountsOperationsGetCall) Context(ctx context.Context) *GlobalAccountsOperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalAccountsOperationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.globalAccountsOperations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GlobalAccountsOperationsGetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified operation resource.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.globalAccountsOperations.get", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the Operations resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.globalAccountsOperations.list": + +type GlobalAccountsOperationsListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of operation resources contained within the +// specified project. +func (r *GlobalAccountsOperationsService) List(project string) *GlobalAccountsOperationsListCall { + c := &GlobalAccountsOperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *GlobalAccountsOperationsListCall) Filter(filter string) *GlobalAccountsOperationsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *GlobalAccountsOperationsListCall) MaxResults(maxResults int64) *GlobalAccountsOperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *GlobalAccountsOperationsListCall) OrderBy(orderBy string) *GlobalAccountsOperationsListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *GlobalAccountsOperationsListCall) PageToken(pageToken string) *GlobalAccountsOperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalAccountsOperationsListCall) Fields(s ...googleapi.Field) *GlobalAccountsOperationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalAccountsOperationsListCall) IfNoneMatch(entityTag string) *GlobalAccountsOperationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalAccountsOperationsListCall) Context(ctx context.Context) *GlobalAccountsOperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalAccountsOperationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.globalAccountsOperations.list" call. +// Exactly one of *OperationList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *OperationList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *GlobalAccountsOperationsListCall) Do() (*OperationList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperationList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of operation resources contained within the specified project.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.globalAccountsOperations.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.groups.addMember": + +type GroupsAddMemberCall struct { + s *Service + project string + groupName string + groupsaddmemberrequest *GroupsAddMemberRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// AddMember: Adds users to the specified group. +func (r *GroupsService) AddMember(project string, groupName string, groupsaddmemberrequest *GroupsAddMemberRequest) *GroupsAddMemberCall { + c := &GroupsAddMemberCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.groupName = groupName + c.groupsaddmemberrequest = groupsaddmemberrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsAddMemberCall) Fields(s ...googleapi.Field) *GroupsAddMemberCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsAddMemberCall) Context(ctx context.Context) *GroupsAddMemberCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsAddMemberCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupsaddmemberrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{groupName}/addMember") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "groupName": c.groupName, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.addMember" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GroupsAddMemberCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds users to the specified group.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.groups.addMember", + // "parameterOrder": [ + // "project", + // "groupName" + // ], + // "parameters": { + // "groupName": { + // "description": "Name of the group for this request.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/groups/{groupName}/addMember", + // "request": { + // "$ref": "GroupsAddMemberRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.groups.delete": + +type GroupsDeleteCall struct { + s *Service + project string + groupName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified Group resource. +func (r *GroupsService) Delete(project string, groupName string) *GroupsDeleteCall { + c := &GroupsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.groupName = groupName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsDeleteCall) Fields(s ...googleapi.Field) *GroupsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsDeleteCall) Context(ctx context.Context) *GroupsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{groupName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "groupName": c.groupName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GroupsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified Group resource.", + // "httpMethod": "DELETE", + // "id": "clouduseraccounts.groups.delete", + // "parameterOrder": [ + // "project", + // "groupName" + // ], + // "parameters": { + // "groupName": { + // "description": "Name of the Group resource to delete.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/groups/{groupName}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.groups.get": + +type GroupsGetCall struct { + s *Service + project string + groupName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified Group resource. +func (r *GroupsService) Get(project string, groupName string) *GroupsGetCall { + c := &GroupsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.groupName = groupName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsGetCall) Fields(s ...googleapi.Field) *GroupsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GroupsGetCall) IfNoneMatch(entityTag string) *GroupsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsGetCall) Context(ctx context.Context) *GroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{groupName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "groupName": c.groupName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.get" call. +// Exactly one of *Group or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Group.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *GroupsGetCall) Do() (*Group, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Group{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified Group resource.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.groups.get", + // "parameterOrder": [ + // "project", + // "groupName" + // ], + // "parameters": { + // "groupName": { + // "description": "Name of the Group resource to return.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/groups/{groupName}", + // "response": { + // "$ref": "Group" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.groups.insert": + +type GroupsInsertCall struct { + s *Service + project string + group *Group + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a Group resource in the specified project using the +// data included in the request. +func (r *GroupsService) Insert(project string, group *Group) *GroupsInsertCall { + c := &GroupsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.group = group + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsInsertCall) Fields(s ...googleapi.Field) *GroupsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsInsertCall) Context(ctx context.Context) *GroupsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GroupsInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a Group resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.groups.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/groups", + // "request": { + // "$ref": "Group" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.groups.list": + +type GroupsListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of groups contained within the specified +// project. +func (r *GroupsService) List(project string) *GroupsListCall { + c := &GroupsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *GroupsListCall) Filter(filter string) *GroupsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *GroupsListCall) MaxResults(maxResults int64) *GroupsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *GroupsListCall) OrderBy(orderBy string) *GroupsListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *GroupsListCall) PageToken(pageToken string) *GroupsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsListCall) Fields(s ...googleapi.Field) *GroupsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GroupsListCall) IfNoneMatch(entityTag string) *GroupsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsListCall) Context(ctx context.Context) *GroupsListCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.list" call. +// Exactly one of *GroupList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *GroupList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GroupsListCall) Do() (*GroupList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &GroupList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of groups contained within the specified project.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.groups.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/groups", + // "response": { + // "$ref": "GroupList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.groups.removeMember": + +type GroupsRemoveMemberCall struct { + s *Service + project string + groupName string + groupsremovememberrequest *GroupsRemoveMemberRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// RemoveMember: Removes users from the specified group. +func (r *GroupsService) RemoveMember(project string, groupName string, groupsremovememberrequest *GroupsRemoveMemberRequest) *GroupsRemoveMemberCall { + c := &GroupsRemoveMemberCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.groupName = groupName + c.groupsremovememberrequest = groupsremovememberrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsRemoveMemberCall) Fields(s ...googleapi.Field) *GroupsRemoveMemberCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsRemoveMemberCall) Context(ctx context.Context) *GroupsRemoveMemberCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsRemoveMemberCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupsremovememberrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{groupName}/removeMember") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "groupName": c.groupName, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.removeMember" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GroupsRemoveMemberCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Removes users from the specified group.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.groups.removeMember", + // "parameterOrder": [ + // "project", + // "groupName" + // ], + // "parameters": { + // "groupName": { + // "description": "Name of the group for this request.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/groups/{groupName}/removeMember", + // "request": { + // "$ref": "GroupsRemoveMemberRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.linux.getAuthorizedKeysView": + +type LinuxGetAuthorizedKeysViewCall struct { + s *Service + project string + zone string + user string + instance string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetAuthorizedKeysView: Returns a list of authorized public keys for a +// specific user account. +func (r *LinuxService) GetAuthorizedKeysView(project string, zone string, user string, instance string) *LinuxGetAuthorizedKeysViewCall { + c := &LinuxGetAuthorizedKeysViewCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.user = user + c.instance = instance + return c +} + +// Login sets the optional parameter "login": Whether the view was +// requested as part of a user-initiated login. +func (c *LinuxGetAuthorizedKeysViewCall) Login(login bool) *LinuxGetAuthorizedKeysViewCall { + c.opt_["login"] = login + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LinuxGetAuthorizedKeysViewCall) Fields(s ...googleapi.Field) *LinuxGetAuthorizedKeysViewCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LinuxGetAuthorizedKeysViewCall) Context(ctx context.Context) *LinuxGetAuthorizedKeysViewCall { + c.ctx_ = ctx + return c +} + +func (c *LinuxGetAuthorizedKeysViewCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("instance", fmt.Sprintf("%v", c.instance)) + if v, ok := c.opt_["login"]; ok { + params.Set("login", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/authorizedKeysView/{user}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "user": c.user, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.linux.getAuthorizedKeysView" call. +// Exactly one of *LinuxGetAuthorizedKeysViewResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *LinuxGetAuthorizedKeysViewResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *LinuxGetAuthorizedKeysViewCall) Do() (*LinuxGetAuthorizedKeysViewResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LinuxGetAuthorizedKeysViewResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a list of authorized public keys for a specific user account.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.linux.getAuthorizedKeysView", + // "parameterOrder": [ + // "project", + // "zone", + // "user", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "The fully-qualified URL of the virtual machine requesting the view.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "login": { + // "description": "Whether the view was requested as part of a user-initiated login.", + // "location": "query", + // "type": "boolean" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "user": { + // "description": "The user account for which you want to get a list of authorized public keys.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/authorizedKeysView/{user}", + // "response": { + // "$ref": "LinuxGetAuthorizedKeysViewResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.linux.getLinuxAccountViews": + +type LinuxGetLinuxAccountViewsCall struct { + s *Service + project string + zone string + instance string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetLinuxAccountViews: Retrieves a list of user accounts for an +// instance within a specific project. +func (r *LinuxService) GetLinuxAccountViews(project string, zone string, instance string) *LinuxGetLinuxAccountViewsCall { + c := &LinuxGetLinuxAccountViewsCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *LinuxGetLinuxAccountViewsCall) Filter(filter string) *LinuxGetLinuxAccountViewsCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *LinuxGetLinuxAccountViewsCall) MaxResults(maxResults int64) *LinuxGetLinuxAccountViewsCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *LinuxGetLinuxAccountViewsCall) OrderBy(orderBy string) *LinuxGetLinuxAccountViewsCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *LinuxGetLinuxAccountViewsCall) PageToken(pageToken string) *LinuxGetLinuxAccountViewsCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LinuxGetLinuxAccountViewsCall) Fields(s ...googleapi.Field) *LinuxGetLinuxAccountViewsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LinuxGetLinuxAccountViewsCall) Context(ctx context.Context) *LinuxGetLinuxAccountViewsCall { + c.ctx_ = ctx + return c +} + +func (c *LinuxGetLinuxAccountViewsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("instance", fmt.Sprintf("%v", c.instance)) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/linuxAccountViews") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.linux.getLinuxAccountViews" call. +// Exactly one of *LinuxGetLinuxAccountViewsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *LinuxGetLinuxAccountViewsResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *LinuxGetLinuxAccountViewsCall) Do() (*LinuxGetLinuxAccountViewsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LinuxGetLinuxAccountViewsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of user accounts for an instance within a specific project.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.linux.getLinuxAccountViews", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "instance": { + // "description": "The fully-qualified URL of the virtual machine requesting the views.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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 for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/linuxAccountViews", + // "response": { + // "$ref": "LinuxGetLinuxAccountViewsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.users.addPublicKey": + +type UsersAddPublicKeyCall struct { + s *Service + project string + user string + publickey *PublicKey + opt_ map[string]interface{} + ctx_ context.Context +} + +// AddPublicKey: Adds a public key to the specified User resource with +// the data included in the request. +func (r *UsersService) AddPublicKey(project string, user string, publickey *PublicKey) *UsersAddPublicKeyCall { + c := &UsersAddPublicKeyCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.user = user + c.publickey = publickey + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersAddPublicKeyCall) Fields(s ...googleapi.Field) *UsersAddPublicKeyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersAddPublicKeyCall) Context(ctx context.Context) *UsersAddPublicKeyCall { + c.ctx_ = ctx + return c +} + +func (c *UsersAddPublicKeyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.publickey) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{user}/addPublicKey") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "user": c.user, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.addPublicKey" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersAddPublicKeyCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds a public key to the specified User resource with the data included in the request.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.users.addPublicKey", + // "parameterOrder": [ + // "project", + // "user" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "user": { + // "description": "Name of the user for this request.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/users/{user}/addPublicKey", + // "request": { + // "$ref": "PublicKey" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.users.delete": + +type UsersDeleteCall struct { + s *Service + project string + user string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified User resource. +func (r *UsersService) Delete(project string, user string) *UsersDeleteCall { + c := &UsersDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.user = user + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersDeleteCall) Fields(s ...googleapi.Field) *UsersDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersDeleteCall) Context(ctx context.Context) *UsersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{user}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "user": c.user, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified User resource.", + // "httpMethod": "DELETE", + // "id": "clouduseraccounts.users.delete", + // "parameterOrder": [ + // "project", + // "user" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "user": { + // "description": "Name of the user resource to delete.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/users/{user}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.users.get": + +type UsersGetCall struct { + s *Service + project string + user string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified User resource. +func (r *UsersService) Get(project string, user string) *UsersGetCall { + c := &UsersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.user = user + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall { + c.ctx_ = ctx + return c +} + +func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{user}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "user": c.user, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.get" call. +// Exactly one of *User or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *User.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *UsersGetCall) Do() (*User, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &User{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified User resource.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.users.get", + // "parameterOrder": [ + // "project", + // "user" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "user": { + // "description": "Name of the user resource to return.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/users/{user}", + // "response": { + // "$ref": "User" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.users.insert": + +type UsersInsertCall struct { + s *Service + project string + user *User + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a User resource in the specified project using the +// data included in the request. +func (r *UsersService) Insert(project string, user *User) *UsersInsertCall { + c := &UsersInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.user = user + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersInsertCall) Fields(s ...googleapi.Field) *UsersInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersInsertCall) Context(ctx context.Context) *UsersInsertCall { + c.ctx_ = ctx + return c +} + +func (c *UsersInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a User resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.users.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/users", + // "request": { + // "$ref": "User" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.users.list": + +type UsersListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of users contained within the specified +// project. +func (r *UsersService) List(project string) *UsersListCall { + c := &UsersListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *UsersListCall) Filter(filter string) *UsersListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *UsersListCall) MaxResults(maxResults int64) *UsersListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *UsersListCall) OrderBy(orderBy string) *UsersListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *UsersListCall) PageToken(pageToken string) *UsersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersListCall) Context(ctx context.Context) *UsersListCall { + c.ctx_ = ctx + return c +} + +func (c *UsersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.list" call. +// Exactly one of *UserList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *UserList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersListCall) Do() (*UserList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of users contained within the specified project.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.users.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/users", + // "response": { + // "$ref": "UserList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.users.removePublicKey": + +type UsersRemovePublicKeyCall struct { + s *Service + project string + user string + fingerprint string + opt_ map[string]interface{} + ctx_ context.Context +} + +// RemovePublicKey: Removes the specified public key from the user. +func (r *UsersService) RemovePublicKey(project string, user string, fingerprint string) *UsersRemovePublicKeyCall { + c := &UsersRemovePublicKeyCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.user = user + c.fingerprint = fingerprint + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersRemovePublicKeyCall) Fields(s ...googleapi.Field) *UsersRemovePublicKeyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersRemovePublicKeyCall) Context(ctx context.Context) *UsersRemovePublicKeyCall { + c.ctx_ = ctx + return c +} + +func (c *UsersRemovePublicKeyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("fingerprint", fmt.Sprintf("%v", c.fingerprint)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{user}/removePublicKey") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "user": c.user, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.removePublicKey" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersRemovePublicKeyCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Removes the specified public key from the user.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.users.removePublicKey", + // "parameterOrder": [ + // "project", + // "user", + // "fingerprint" + // ], + // "parameters": { + // "fingerprint": { + // "description": "The fingerprint of the public key to delete. Public keys are identified by their fingerprint, which is defined by RFC4716 to be the MD5 digest of the public key.", + // "location": "query", + // "pattern": "[a-f0-9]{32}", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "user": { + // "description": "Name of the user for this request.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/users/{user}/removePublicKey", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/vm_alpha/clouduseraccounts-api.json b/Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/vm_alpha/clouduseraccounts-api.json new file mode 100644 index 000000000..c714973a4 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/vm_alpha/clouduseraccounts-api.json @@ -0,0 +1,1818 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/5nMv6T9tApKbBeNZEQlnf4XjGl0\"", + "discoveryVersion": "v1", + "id": "clouduseraccounts:vm_alpha", + "name": "clouduseraccounts", + "canonicalName": "Cloud User Accounts", + "version": "vm_alpha", + "revision": "20150917", + "title": "Cloud User Accounts API", + "description": "API for the Google Cloud User Accounts service.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/compute_engine-16.png", + "x32": "https://www.google.com/images/icons/product/compute_engine-32.png" + }, + "documentationLink": "https://cloud.google.com/compute/docs/access/user-accounts/api/latest/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/clouduseraccounts/vm_alpha/projects/", + "basePath": "/clouduseraccounts/vm_alpha/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "clouduseraccounts/vm_alpha/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/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/cloud.useraccounts": { + "description": "Manage your Google Cloud User Accounts" + }, + "https://www.googleapis.com/auth/cloud.useraccounts.readonly": { + "description": "View your Google Cloud User Accounts" + } + } + } + }, + "schemas": { + "AuthorizedKeysView": { + "id": "AuthorizedKeysView", + "type": "object", + "description": "A list of authorized public keys for a user account.", + "properties": { + "keys": { + "type": "array", + "description": "[Output Only] The list of authorized public keys in SSH format.", + "items": { + "type": "string" + } + }, + "sudoer": { + "type": "boolean", + "description": "[Output Only] Whether the user has the ability to elevate on the instance that requested the authorized keys." + } + } + }, + "Binding": { + "id": "Binding", + "type": "object", + "description": "Associates `members` with a `role`.", + "properties": { + "members": { + "type": "array", + "description": "Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following formats:\n\n* `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.\n\n* `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.\n\n* `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` or `joe@example.com`.\n\n* `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.\n\n* `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.\n\n* `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`.", + "items": { + "type": "string" + } + }, + "role": { + "type": "string", + "description": "Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`." + } + } + }, + "Condition": { + "id": "Condition", + "type": "object", + "description": "A condition to be met.", + "properties": { + "iam": { + "type": "string", + "description": "Trusted attributes supplied by the IAM system.", + "enum": [ + "ATTRIBUTION", + "AUTHORITY", + "NO_ATTR" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "op": { + "type": "string", + "description": "An operator to apply the subject with.", + "enum": [ + "DISCHARGED", + "EQUALS", + "IN", + "NOT_EQUALS", + "NOT_IN", + "NO_OP" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "svc": { + "type": "string", + "description": "Trusted attributes discharged by the service." + }, + "sys": { + "type": "string", + "description": "Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.", + "enum": [ + "IP", + "NAME", + "NO_ATTR", + "REGION", + "SERVICE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "value": { + "type": "string", + "description": "The object of the condition. Exactly one of these must be set." + }, + "values": { + "type": "array", + "description": "The objects of the condition. This is mutually exclusive with 'value'.", + "items": { + "type": "string" + } + } + } + }, + "Group": { + "id": "Group", + "type": "object", + "description": "A Group resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always clouduseraccounts#group for groups.", + "default": "clouduseraccounts#group" + }, + "members": { + "type": "array", + "description": "[Output Only] A list of URLs to User resources who belong to the group. Users may only be members of groups in the same project.", + "items": { + "type": "string" + } + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created.", + "pattern": "[a-z][-a-z0-9_]{0,31}", + "annotations": { + "required": [ + "clouduseraccounts.groups.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for the resource." + } + } + }, + "GroupList": { + "id": "GroupList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of Group resources.", + "items": { + "$ref": "Group" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always clouduseraccounts#groupList for lists of groups.", + "default": "clouduseraccounts#groupList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for this resource." + } + } + }, + "GroupsAddMemberRequest": { + "id": "GroupsAddMemberRequest", + "type": "object", + "properties": { + "users": { + "type": "array", + "description": "Fully-qualified URLs of the User resources to add.", + "items": { + "type": "string" + } + } + } + }, + "GroupsRemoveMemberRequest": { + "id": "GroupsRemoveMemberRequest", + "type": "object", + "properties": { + "users": { + "type": "array", + "description": "Fully-qualified URLs of the User resources to remove.", + "items": { + "type": "string" + } + } + } + }, + "LinuxAccountViews": { + "id": "LinuxAccountViews", + "type": "object", + "description": "A list of all Linux accounts for this project. This API is only used by Compute Engine virtual machines to get information about user accounts for a project or instance. Linux resources are read-only views into users and groups managed by the Compute Engine Accounts API.", + "properties": { + "groupViews": { + "type": "array", + "description": "[Output Only] A list of all groups within a project.", + "items": { + "$ref": "LinuxGroupView" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always clouduseraccounts#linuxAccountViews for Linux resources.", + "default": "clouduseraccounts#linuxAccountViews" + }, + "userViews": { + "type": "array", + "description": "[Output Only] A list of all users within a project.", + "items": { + "$ref": "LinuxUserView" + } + } + } + }, + "LinuxGetAuthorizedKeysViewResponse": { + "id": "LinuxGetAuthorizedKeysViewResponse", + "type": "object", + "properties": { + "resource": { + "$ref": "AuthorizedKeysView", + "description": "[Output Only] A list of authorized public keys for a user." + } + } + }, + "LinuxGetLinuxAccountViewsResponse": { + "id": "LinuxGetLinuxAccountViewsResponse", + "type": "object", + "properties": { + "resource": { + "$ref": "LinuxAccountViews", + "description": "[Output Only] A list of authorized user accounts and groups." + } + } + }, + "LinuxGroupView": { + "id": "LinuxGroupView", + "type": "object", + "description": "A detailed view of a Linux group.", + "properties": { + "gid": { + "type": "integer", + "description": "[Output Only] The Group ID.", + "format": "uint32" + }, + "groupName": { + "type": "string", + "description": "[Output Only] Group name." + }, + "members": { + "type": "array", + "description": "[Output Only] List of user accounts that belong to the group.", + "items": { + "type": "string" + } + } + } + }, + "LinuxUserView": { + "id": "LinuxUserView", + "type": "object", + "description": "A detailed view of a Linux user account.", + "properties": { + "gecos": { + "type": "string", + "description": "[Output Only] The GECOS (user information) entry for this account." + }, + "gid": { + "type": "integer", + "description": "[Output Only] User's default group ID.", + "format": "uint32" + }, + "homeDirectory": { + "type": "string", + "description": "[Output Only] The path to the home directory for this account." + }, + "shell": { + "type": "string", + "description": "[Output Only] The path to the login shell for this account." + }, + "uid": { + "type": "integer", + "description": "[Output Only] User ID.", + "format": "uint32" + }, + "username": { + "type": "string", + "description": "[Output Only] The username of the account." + } + } + }, + "LogConfig": { + "id": "LogConfig", + "type": "object", + "description": "Specifies what kind of log the caller must write", + "properties": { + "counter": { + "$ref": "LogConfigCounterOptions", + "description": "Counter options." + } + } + }, + "LogConfigCounterOptions": { + "id": "LogConfigCounterOptions", + "type": "object", + "description": "Options for counters", + "properties": { + "field": { + "type": "string", + "description": "The field value to attribute." + }, + "metric": { + "type": "string", + "description": "The metric to update." + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "description": "An Operation resource, used to manage asynchronous API requests.", + "properties": { + "clientOperationId": { + "type": "string", + "description": "[Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all Operation resources in the project." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "endTime": { + "type": "string", + "description": "[Output Only] The time that this operation was completed. This is in RFC3339 text format." + }, + "error": { + "type": "object", + "description": "[Output Only] If errors are generated during processing of the operation, this field will be populated.", + "properties": { + "errors": { + "type": "array", + "description": "[Output Only] The array of errors encountered while processing this operation.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The error type identifier for this error." + }, + "location": { + "type": "string", + "description": "[Output Only] Indicates the field in the request which caused the error. This property is optional." + }, + "message": { + "type": "string", + "description": "[Output Only] An optional, human-readable error message." + } + } + } + } + } + }, + "httpErrorMessage": { + "type": "string", + "description": "[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND." + }, + "httpErrorStatusCode": { + "type": "integer", + "description": "[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as 404.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "[Output Only] The time that this operation was requested. This is in RFC3339 text format." + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#operation for Operation resources.", + "default": "clouduseraccounts#operation" + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource." + }, + "operationType": { + "type": "string", + "description": "[Output Only] Type of the operation, such as insert, compute.instanceGroups.update, or compute.instanceGroups.delete." + }, + "progress": { + "type": "integer", + "description": "[Output Only] 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 monotonically increase as the operation progresses.", + "format": "int32" + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where the operation resides. Only applicable for regional resources." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "startTime": { + "type": "string", + "description": "[Output Only] The time that this operation was started by the server. This is in RFC3339 text format." + }, + "status": { + "type": "string", + "description": "[Output Only] Status of the operation. Can be one of the following: PENDING, RUNNING, or DONE.", + "enum": [ + "DONE", + "PENDING", + "RUNNING" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "statusMessage": { + "type": "string", + "description": "[Output Only] An optional textual description of the current status of the operation." + }, + "targetId": { + "type": "string", + "description": "[Output Only] Unique target ID which identifies a particular incarnation of the target.", + "format": "uint64" + }, + "targetLink": { + "type": "string", + "description": "[Output Only] URL of the resource the operation is mutating." + }, + "user": { + "type": "string", + "description": "[Output Only] User who requested the operation, for example: user@example.com." + }, + "warnings": { + "type": "array", + "description": "[Output Only] If warning messages are generated during processing of the operation, this field will be populated.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + }, + "zone": { + "type": "string", + "description": "[Output Only] URL of the zone where the operation resides." + } + } + }, + "OperationList": { + "id": "OperationList", + "type": "object", + "description": "Contains a list of Operation resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] The Operation resources.", + "items": { + "$ref": "Operation" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#operations for Operations resource.", + "default": "clouduseraccounts#operationList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncate." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "Policy": { + "id": "Policy", + "type": "object", + "description": "Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources.\n\n\n\nA `Policy` consists of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, where the members can be user accounts, Google groups, Google domains, and service accounts. A `role` is a named list of permissions defined by IAM.\n\n**Example**\n\n{ \"bindings\": [ { \"role\": \"roles/owner\", \"members\": [ \"user:mike@example.com\", \"group:admins@example.com\", \"domain:google.com\", \"serviceAccount:my-other-app@appspot.gserviceaccount.com\"] }, { \"role\": \"roles/viewer\", \"members\": [\"user:sean@example.com\"] } ] }\n\nFor a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam).", + "properties": { + "bindings": { + "type": "array", + "description": "Associates a list of `members` to a `role`. Multiple `bindings` must not be specified for the same `role`. `bindings` with no members will result in an error.", + "items": { + "$ref": "Binding" + } + }, + "etag": { + "type": "string", + "description": "Can be used to perform a read-modify-write.", + "format": "byte" + }, + "rules": { + "type": "array", + "description": "", + "items": { + "$ref": "Rule" + } + }, + "version": { + "type": "integer", + "description": "Version of the `Policy`. The default version is 0.", + "format": "int32" + } + } + }, + "PublicKey": { + "id": "PublicKey", + "type": "object", + "description": "A public key for authenticating to guests.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "expirationTimestamp": { + "type": "string", + "description": "Optional expiration timestamp. If provided, the timestamp must be in RFC3339 text format. If not provided, the public key never expires." + }, + "fingerprint": { + "type": "string", + "description": "[Output Only] The fingerprint of the key is defined by RFC4716 to be the MD5 digest of the public key." + }, + "key": { + "type": "string", + "description": "Public key text in SSH format, defined by RFC4253 section 6.6." + } + } + }, + "Rule": { + "id": "Rule", + "type": "object", + "description": "A rule to be applied in a Policy.", + "properties": { + "action": { + "type": "string", + "description": "Required", + "enum": [ + "ALLOW", + "ALLOW_WITH_LOG", + "DENY", + "DENY_WITH_LOG", + "LOG", + "NO_ACTION" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "conditions": { + "type": "array", + "description": "Additional restrictions that must be met", + "items": { + "$ref": "Condition" + } + }, + "description": { + "type": "string", + "description": "Human-readable description of the rule." + }, + "ins": { + "type": "array", + "description": "The rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in this set of entries.", + "items": { + "type": "string" + } + }, + "logConfigs": { + "type": "array", + "description": "The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.", + "items": { + "$ref": "LogConfig" + } + }, + "notIns": { + "type": "array", + "description": "The rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is not in this set of entries.", + "items": { + "type": "string" + } + }, + "permissions": { + "type": "array", + "description": "A permission is a string of form '..' (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.", + "items": { + "type": "string" + } + } + } + }, + "TestPermissionsRequest": { + "id": "TestPermissionsRequest", + "type": "object", + "properties": { + "permissions": { + "type": "array", + "description": "The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed.", + "items": { + "type": "string" + } + } + } + }, + "TestPermissionsResponse": { + "id": "TestPermissionsResponse", + "type": "object", + "properties": { + "permissions": { + "type": "array", + "description": "A subset of `TestPermissionsRequest.permissions` that the caller is allowed.", + "items": { + "type": "string" + } + } + } + }, + "User": { + "id": "User", + "type": "object", + "description": "A User resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "groups": { + "type": "array", + "description": "[Output Only] A list of URLs to Group resources who contain the user. Users are only members of groups in the same project.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always clouduseraccounts#user for users.", + "default": "clouduseraccounts#user" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created.", + "pattern": "[a-z][-a-z0-9_]{0,31}", + "annotations": { + "required": [ + "clouduseraccounts.users.insert" + ] + } + }, + "owner": { + "type": "string", + "description": "Email address of account's owner. This account will be validated to make sure it exists. The email can belong to any domain, but it must be tied to a Google account.", + "annotations": { + "required": [ + "clouduseraccounts.users.insert" + ] + } + }, + "publicKeys": { + "type": "array", + "description": "[Output Only] Public keys that this user may use to login.", + "items": { + "$ref": "PublicKey" + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for the resource." + } + } + }, + "UserList": { + "id": "UserList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of User resources.", + "items": { + "$ref": "User" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always clouduseraccounts#userList for lists of users.", + "default": "clouduseraccounts#userList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for this resource." + } + } + } + }, + "resources": { + "globalAccountsOperations": { + "methods": { + "delete": { + "id": "clouduseraccounts.globalAccountsOperations.delete", + "path": "{project}/global/operations/{operation}", + "httpMethod": "DELETE", + "description": "Deletes the specified operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the Operations resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "get": { + "id": "clouduseraccounts.globalAccountsOperations.get", + "path": "{project}/global/operations/{operation}", + "httpMethod": "GET", + "description": "Retrieves the specified operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the Operations resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "list": { + "id": "clouduseraccounts.globalAccountsOperations.list", + "path": "{project}/global/operations", + "httpMethod": "GET", + "description": "Retrieves the list of operation resources contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + } + } + }, + "groups": { + "methods": { + "addMember": { + "id": "clouduseraccounts.groups.addMember", + "path": "{project}/global/groups/{groupName}/addMember", + "httpMethod": "POST", + "description": "Adds users to the specified group.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the group for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "groupName" + ], + "request": { + "$ref": "GroupsAddMemberRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "delete": { + "id": "clouduseraccounts.groups.delete", + "path": "{project}/global/groups/{groupName}", + "httpMethod": "DELETE", + "description": "Deletes the specified Group resource.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the Group resource to delete.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "groupName" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "get": { + "id": "clouduseraccounts.groups.get", + "path": "{project}/global/groups/{groupName}", + "httpMethod": "GET", + "description": "Returns the specified Group resource.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the Group resource to return.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "groupName" + ], + "response": { + "$ref": "Group" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "getIamPolicy": { + "id": "clouduseraccounts.groups.getIamPolicy", + "path": "{project}/global/groups/{resource}/getIamPolicy", + "httpMethod": "GET", + "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "insert": { + "id": "clouduseraccounts.groups.insert", + "path": "{project}/global/groups", + "httpMethod": "POST", + "description": "Creates a Group resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "Group" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "list": { + "id": "clouduseraccounts.groups.list", + "path": "{project}/global/groups", + "httpMethod": "GET", + "description": "Retrieves the list of groups contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "GroupList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "removeMember": { + "id": "clouduseraccounts.groups.removeMember", + "path": "{project}/global/groups/{groupName}/removeMember", + "httpMethod": "POST", + "description": "Removes users from the specified group.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the group for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "groupName" + ], + "request": { + "$ref": "GroupsRemoveMemberRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "setIamPolicy": { + "id": "clouduseraccounts.groups.setIamPolicy", + "path": "{project}/global/groups/{resource}/setIamPolicy", + "httpMethod": "POST", + "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "request": { + "$ref": "Policy" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "testIamPermissions": { + "id": "clouduseraccounts.groups.testIamPermissions", + "path": "{project}/global/groups/{resource}/testIamPermissions", + "httpMethod": "POST", + "description": "Returns permissions that a caller has on the specified resource.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "request": { + "$ref": "TestPermissionsRequest" + }, + "response": { + "$ref": "TestPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + } + } + }, + "linux": { + "methods": { + "getAuthorizedKeysView": { + "id": "clouduseraccounts.linux.getAuthorizedKeysView", + "path": "{project}/zones/{zone}/authorizedKeysView/{user}", + "httpMethod": "POST", + "description": "Returns a list of authorized public keys for a specific user account.", + "parameters": { + "instance": { + "type": "string", + "description": "The fully-qualified URL of the virtual machine requesting the view.", + "required": true, + "location": "query" + }, + "login": { + "type": "boolean", + "description": "Whether the view was requested as part of a user-initiated login.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "user": { + "type": "string", + "description": "The user account for which you want to get a list of authorized public keys.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "zone": { + "type": "string", + "description": "Name of the zone for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "user", + "instance" + ], + "response": { + "$ref": "LinuxGetAuthorizedKeysViewResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "getLinuxAccountViews": { + "id": "clouduseraccounts.linux.getLinuxAccountViews", + "path": "{project}/zones/{zone}/linuxAccountViews", + "httpMethod": "POST", + "description": "Retrieves a list of user accounts for an instance within a specific project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "instance": { + "type": "string", + "description": "The fully-qualified URL of the virtual machine requesting the views.", + "required": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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 for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "response": { + "$ref": "LinuxGetLinuxAccountViewsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + } + } + }, + "users": { + "methods": { + "addPublicKey": { + "id": "clouduseraccounts.users.addPublicKey", + "path": "{project}/global/users/{user}/addPublicKey", + "httpMethod": "POST", + "description": "Adds a public key to the specified User resource with the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "user": { + "type": "string", + "description": "Name of the user for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user" + ], + "request": { + "$ref": "PublicKey" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "delete": { + "id": "clouduseraccounts.users.delete", + "path": "{project}/global/users/{user}", + "httpMethod": "DELETE", + "description": "Deletes the specified User resource.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "user": { + "type": "string", + "description": "Name of the user resource to delete.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "get": { + "id": "clouduseraccounts.users.get", + "path": "{project}/global/users/{user}", + "httpMethod": "GET", + "description": "Returns the specified User resource.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "user": { + "type": "string", + "description": "Name of the user resource to return.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user" + ], + "response": { + "$ref": "User" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "getIamPolicy": { + "id": "clouduseraccounts.users.getIamPolicy", + "path": "{project}/global/users/{resource}/getIamPolicy", + "httpMethod": "GET", + "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "insert": { + "id": "clouduseraccounts.users.insert", + "path": "{project}/global/users", + "httpMethod": "POST", + "description": "Creates a User resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "User" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "list": { + "id": "clouduseraccounts.users.list", + "path": "{project}/global/users", + "httpMethod": "GET", + "description": "Retrieves a list of users contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "UserList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "removePublicKey": { + "id": "clouduseraccounts.users.removePublicKey", + "path": "{project}/global/users/{user}/removePublicKey", + "httpMethod": "POST", + "description": "Removes the specified public key from the user.", + "parameters": { + "fingerprint": { + "type": "string", + "description": "The fingerprint of the public key to delete. Public keys are identified by their fingerprint, which is defined by RFC4716 to be the MD5 digest of the public key.", + "required": true, + "pattern": "[a-f0-9]{32}", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "user": { + "type": "string", + "description": "Name of the user for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user", + "fingerprint" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "setIamPolicy": { + "id": "clouduseraccounts.users.setIamPolicy", + "path": "{project}/global/users/{resource}/setIamPolicy", + "httpMethod": "POST", + "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "request": { + "$ref": "Policy" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "testIamPermissions": { + "id": "clouduseraccounts.users.testIamPermissions", + "path": "{project}/global/users/{resource}/testIamPermissions", + "httpMethod": "POST", + "description": "Returns permissions that a caller has on the specified resource.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "Name of the resource for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "resource" + ], + "request": { + "$ref": "TestPermissionsRequest" + }, + "response": { + "$ref": "TestPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/vm_alpha/clouduseraccounts-gen.go b/Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/vm_alpha/clouduseraccounts-gen.go new file mode 100644 index 000000000..e5e3bec3e --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/vm_alpha/clouduseraccounts-gen.go @@ -0,0 +1,4592 @@ +// Package clouduseraccounts provides access to the Cloud User Accounts API. +// +// See https://cloud.google.com/compute/docs/access/user-accounts/api/latest/ +// +// Usage example: +// +// import "google.golang.org/api/clouduseraccounts/vm_alpha" +// ... +// clouduseraccountsService, err := clouduseraccounts.New(oauthHttpClient) +package clouduseraccounts // import "google.golang.org/api/clouduseraccounts/vm_alpha" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "clouduseraccounts:vm_alpha" +const apiName = "clouduseraccounts" +const apiVersion = "vm_alpha" +const basePath = "https://www.googleapis.com/clouduseraccounts/vm_alpha/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 data across Google Cloud Platform services + CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" + + // Manage your Google Cloud User Accounts + CloudUseraccountsScope = "https://www.googleapis.com/auth/cloud.useraccounts" + + // View your Google Cloud User Accounts + CloudUseraccountsReadonlyScope = "https://www.googleapis.com/auth/cloud.useraccounts.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.GlobalAccountsOperations = NewGlobalAccountsOperationsService(s) + s.Groups = NewGroupsService(s) + s.Linux = NewLinuxService(s) + s.Users = NewUsersService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + GlobalAccountsOperations *GlobalAccountsOperationsService + + Groups *GroupsService + + Linux *LinuxService + + Users *UsersService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewGlobalAccountsOperationsService(s *Service) *GlobalAccountsOperationsService { + rs := &GlobalAccountsOperationsService{s: s} + return rs +} + +type GlobalAccountsOperationsService struct { + s *Service +} + +func NewGroupsService(s *Service) *GroupsService { + rs := &GroupsService{s: s} + return rs +} + +type GroupsService struct { + s *Service +} + +func NewLinuxService(s *Service) *LinuxService { + rs := &LinuxService{s: s} + return rs +} + +type LinuxService struct { + s *Service +} + +func NewUsersService(s *Service) *UsersService { + rs := &UsersService{s: s} + return rs +} + +type UsersService struct { + s *Service +} + +// AuthorizedKeysView: A list of authorized public keys for a user +// account. +type AuthorizedKeysView struct { + // Keys: [Output Only] The list of authorized public keys in SSH format. + Keys []string `json:"keys,omitempty"` + + // Sudoer: [Output Only] Whether the user has the ability to elevate on + // the instance that requested the authorized keys. + Sudoer bool `json:"sudoer,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Keys") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AuthorizedKeysView) MarshalJSON() ([]byte, error) { + type noMethod AuthorizedKeysView + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Binding: Associates `members` with a `role`. +type Binding struct { + // Members: Specifies the identities requesting access for a Cloud + // Platform resource. `members` can have the following formats: + // + // * `allUsers`: A special identifier that represents anyone who is on + // the internet; with or without a Google account. + // + // * `allAuthenticatedUsers`: A special identifier that represents + // anyone who is authenticated with a Google account or a service + // account. + // + // * `user:{emailid}`: An email address that represents a specific + // Google account. For example, `alice@gmail.com` or + // `joe@example.com`. + // + // * `serviceAccount:{emailid}`: An email address that represents a + // service account. For example, + // `my-other-app@appspot.gserviceaccount.com`. + // + // * `group:{emailid}`: An email address that represents a Google group. + // For example, `admins@example.com`. + // + // * `domain:{domain}`: A Google Apps domain name that represents all + // the users of that domain. For example, `google.com` or `example.com`. + Members []string `json:"members,omitempty"` + + // Role: Role that is assigned to `members`. For example, + // `roles/viewer`, `roles/editor`, or `roles/owner`. + Role string `json:"role,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Members") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Binding) MarshalJSON() ([]byte, error) { + type noMethod Binding + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Condition: A condition to be met. +type Condition struct { + // Iam: Trusted attributes supplied by the IAM system. + // + // Possible values: + // "ATTRIBUTION" + // "AUTHORITY" + // "NO_ATTR" + Iam string `json:"iam,omitempty"` + + // Op: An operator to apply the subject with. + // + // Possible values: + // "DISCHARGED" + // "EQUALS" + // "IN" + // "NOT_EQUALS" + // "NOT_IN" + // "NO_OP" + Op string `json:"op,omitempty"` + + // Svc: Trusted attributes discharged by the service. + Svc string `json:"svc,omitempty"` + + // Sys: Trusted attributes supplied by any service that owns resources + // and uses the IAM system for access control. + // + // Possible values: + // "IP" + // "NAME" + // "NO_ATTR" + // "REGION" + // "SERVICE" + Sys string `json:"sys,omitempty"` + + // Value: The object of the condition. Exactly one of these must be set. + Value string `json:"value,omitempty"` + + // Values: The objects of the condition. This is mutually exclusive with + // 'value'. + Values []string `json:"values,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Iam") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Condition) MarshalJSON() ([]byte, error) { + type noMethod Condition + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Group: A Group resource. +type Group struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always + // clouduseraccounts#group for groups. + Kind string `json:"kind,omitempty"` + + // Members: [Output Only] A list of URLs to User resources who belong to + // the group. Users may only be members of groups in the same project. + Members []string `json:"members,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] Server defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Group) MarshalJSON() ([]byte, error) { + type noMethod Group + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GroupList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of Group resources. + Items []*Group `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always + // clouduseraccounts#groupList for lists of groups. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GroupList) MarshalJSON() ([]byte, error) { + type noMethod GroupList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GroupsAddMemberRequest struct { + // Users: Fully-qualified URLs of the User resources to add. + Users []string `json:"users,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Users") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GroupsAddMemberRequest) MarshalJSON() ([]byte, error) { + type noMethod GroupsAddMemberRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GroupsRemoveMemberRequest struct { + // Users: Fully-qualified URLs of the User resources to remove. + Users []string `json:"users,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Users") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GroupsRemoveMemberRequest) MarshalJSON() ([]byte, error) { + type noMethod GroupsRemoveMemberRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LinuxAccountViews: A list of all Linux accounts for this project. +// This API is only used by Compute Engine virtual machines to get +// information about user accounts for a project or instance. Linux +// resources are read-only views into users and groups managed by the +// Compute Engine Accounts API. +type LinuxAccountViews struct { + // GroupViews: [Output Only] A list of all groups within a project. + GroupViews []*LinuxGroupView `json:"groupViews,omitempty"` + + // Kind: [Output Only] Type of the resource. Always + // clouduseraccounts#linuxAccountViews for Linux resources. + Kind string `json:"kind,omitempty"` + + // UserViews: [Output Only] A list of all users within a project. + UserViews []*LinuxUserView `json:"userViews,omitempty"` + + // ForceSendFields is a list of field names (e.g. "GroupViews") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LinuxAccountViews) MarshalJSON() ([]byte, error) { + type noMethod LinuxAccountViews + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type LinuxGetAuthorizedKeysViewResponse struct { + // Resource: [Output Only] A list of authorized public keys for a user. + Resource *AuthorizedKeysView `json:"resource,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Resource") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LinuxGetAuthorizedKeysViewResponse) MarshalJSON() ([]byte, error) { + type noMethod LinuxGetAuthorizedKeysViewResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type LinuxGetLinuxAccountViewsResponse struct { + // Resource: [Output Only] A list of authorized user accounts and + // groups. + Resource *LinuxAccountViews `json:"resource,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Resource") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LinuxGetLinuxAccountViewsResponse) MarshalJSON() ([]byte, error) { + type noMethod LinuxGetLinuxAccountViewsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LinuxGroupView: A detailed view of a Linux group. +type LinuxGroupView struct { + // Gid: [Output Only] The Group ID. + Gid int64 `json:"gid,omitempty"` + + // GroupName: [Output Only] Group name. + GroupName string `json:"groupName,omitempty"` + + // Members: [Output Only] List of user accounts that belong to the + // group. + Members []string `json:"members,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Gid") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LinuxGroupView) MarshalJSON() ([]byte, error) { + type noMethod LinuxGroupView + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LinuxUserView: A detailed view of a Linux user account. +type LinuxUserView struct { + // Gecos: [Output Only] The GECOS (user information) entry for this + // account. + Gecos string `json:"gecos,omitempty"` + + // Gid: [Output Only] User's default group ID. + Gid int64 `json:"gid,omitempty"` + + // HomeDirectory: [Output Only] The path to the home directory for this + // account. + HomeDirectory string `json:"homeDirectory,omitempty"` + + // Shell: [Output Only] The path to the login shell for this account. + Shell string `json:"shell,omitempty"` + + // Uid: [Output Only] User ID. + Uid int64 `json:"uid,omitempty"` + + // Username: [Output Only] The username of the account. + Username string `json:"username,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Gecos") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LinuxUserView) MarshalJSON() ([]byte, error) { + type noMethod LinuxUserView + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LogConfig: Specifies what kind of log the caller must write +type LogConfig struct { + // Counter: Counter options. + Counter *LogConfigCounterOptions `json:"counter,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Counter") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LogConfig) MarshalJSON() ([]byte, error) { + type noMethod LogConfig + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LogConfigCounterOptions: Options for counters +type LogConfigCounterOptions struct { + // Field: The field value to attribute. + Field string `json:"field,omitempty"` + + // Metric: The metric to update. + Metric string `json:"metric,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Field") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LogConfigCounterOptions) MarshalJSON() ([]byte, error) { + type noMethod LogConfigCounterOptions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Operation: An Operation resource, used to manage asynchronous API +// requests. +type Operation struct { + // ClientOperationId: [Output Only] An optional identifier specified by + // the client when the mutation was initiated. Must be unique for all + // Operation resources in the project. + ClientOperationId string `json:"clientOperationId,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // EndTime: [Output Only] The time that this operation was completed. + // This is in RFC3339 text format. + EndTime string `json:"endTime,omitempty"` + + // Error: [Output Only] If errors are generated during processing of the + // operation, this field will be populated. + Error *OperationError `json:"error,omitempty"` + + // HttpErrorMessage: [Output Only] If the operation fails, this field + // contains the HTTP error message that was returned, such as NOT FOUND. + HttpErrorMessage string `json:"httpErrorMessage,omitempty"` + + // HttpErrorStatusCode: [Output Only] If the operation fails, this field + // contains the HTTP error message that was returned, such as 404. + HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // InsertTime: [Output Only] The time that this operation was requested. + // This is in RFC3339 text format. + InsertTime string `json:"insertTime,omitempty"` + + // Kind: [Output Only] Type of the resource. Always compute#operation + // for Operation resources. + Kind string `json:"kind,omitempty"` + + // Name: [Output Only] Name of the resource. + Name string `json:"name,omitempty"` + + // OperationType: [Output Only] Type of the operation, such as insert, + // compute.instanceGroups.update, or compute.instanceGroups.delete. + OperationType string `json:"operationType,omitempty"` + + // Progress: [Output Only] 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 monotonically + // increase as the operation progresses. + Progress int64 `json:"progress,omitempty"` + + // Region: [Output Only] URL of the region where the operation resides. + // Only applicable for regional resources. + Region string `json:"region,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // StartTime: [Output Only] The time that this operation was started by + // the server. This is in RFC3339 text format. + StartTime string `json:"startTime,omitempty"` + + // Status: [Output Only] Status of the operation. Can be one of the + // following: PENDING, RUNNING, or DONE. + // + // Possible values: + // "DONE" + // "PENDING" + // "RUNNING" + Status string `json:"status,omitempty"` + + // StatusMessage: [Output Only] An optional textual description of the + // current status of the operation. + StatusMessage string `json:"statusMessage,omitempty"` + + // TargetId: [Output Only] Unique target ID which identifies a + // particular incarnation of the target. + TargetId uint64 `json:"targetId,omitempty,string"` + + // TargetLink: [Output Only] URL of the resource the operation is + // mutating. + TargetLink string `json:"targetLink,omitempty"` + + // User: [Output Only] User who requested the operation, for example: + // user@example.com. + User string `json:"user,omitempty"` + + // Warnings: [Output Only] If warning messages are generated during + // processing of the operation, this field will be populated. + Warnings []*OperationWarnings `json:"warnings,omitempty"` + + // Zone: [Output Only] URL of the zone where the operation resides. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ClientOperationId") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Operation) MarshalJSON() ([]byte, error) { + type noMethod Operation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationError: [Output Only] If errors are generated during +// processing of the operation, this field will be populated. +type OperationError struct { + // Errors: [Output Only] The array of errors encountered while + // processing this operation. + Errors []*OperationErrorErrors `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationError) MarshalJSON() ([]byte, error) { + type noMethod OperationError + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationErrorErrors struct { + // Code: [Output Only] The error type identifier for this error. + Code string `json:"code,omitempty"` + + // Location: [Output Only] Indicates the field in the request which + // caused the error. This property is optional. + Location string `json:"location,omitempty"` + + // Message: [Output Only] An optional, human-readable error message. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) { + type noMethod OperationErrorErrors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationWarnings struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*OperationWarningsData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationWarnings) MarshalJSON() ([]byte, error) { + type noMethod OperationWarnings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationWarningsData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationWarningsData) MarshalJSON() ([]byte, error) { + type noMethod OperationWarningsData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationList: Contains a list of Operation resources. +type OperationList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] The Operation resources. + Items []*Operation `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#operations for + // Operations resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncate. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationList) MarshalJSON() ([]byte, error) { + type noMethod OperationList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Policy: Defines an Identity and Access Management (IAM) policy. It is +// used to specify access control policies for Cloud Platform +// resources. +// +// +// +// A `Policy` consists of a list of `bindings`. A `Binding` binds a list +// of `members` to a `role`, where the members can be user accounts, +// Google groups, Google domains, and service accounts. A `role` is a +// named list of permissions defined by IAM. +// +// **Example** +// +// { "bindings": [ { "role": "roles/owner", "members": [ +// "user:mike@example.com", "group:admins@example.com", +// "domain:google.com", +// "serviceAccount:my-other-app@appspot.gserviceaccount.com"] }, { +// "role": "roles/viewer", "members": ["user:sean@example.com"] } ] +// } +// +// For a description of IAM and its features, see the [IAM developer's +// guide](https://cloud.google.com/iam). +type Policy struct { + // Bindings: Associates a list of `members` to a `role`. Multiple + // `bindings` must not be specified for the same `role`. `bindings` with + // no members will result in an error. + Bindings []*Binding `json:"bindings,omitempty"` + + // Etag: Can be used to perform a read-modify-write. + Etag string `json:"etag,omitempty"` + + Rules []*Rule `json:"rules,omitempty"` + + // Version: Version of the `Policy`. The default version is 0. + Version int64 `json:"version,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Bindings") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Policy) MarshalJSON() ([]byte, error) { + type noMethod Policy + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PublicKey: A public key for authenticating to guests. +type PublicKey struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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"` + + // ExpirationTimestamp: Optional expiration timestamp. If provided, the + // timestamp must be in RFC3339 text format. If not provided, the public + // key never expires. + ExpirationTimestamp string `json:"expirationTimestamp,omitempty"` + + // Fingerprint: [Output Only] The fingerprint of the key is defined by + // RFC4716 to be the MD5 digest of the public key. + Fingerprint string `json:"fingerprint,omitempty"` + + // Key: Public key text in SSH format, defined by RFC4253 section 6.6. + Key string `json:"key,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PublicKey) MarshalJSON() ([]byte, error) { + type noMethod PublicKey + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Rule: A rule to be applied in a Policy. +type Rule struct { + // Action: Required + // + // Possible values: + // "ALLOW" + // "ALLOW_WITH_LOG" + // "DENY" + // "DENY_WITH_LOG" + // "LOG" + // "NO_ACTION" + Action string `json:"action,omitempty"` + + // Conditions: Additional restrictions that must be met + Conditions []*Condition `json:"conditions,omitempty"` + + // Description: Human-readable description of the rule. + Description string `json:"description,omitempty"` + + // Ins: The rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in this + // set of entries. + Ins []string `json:"ins,omitempty"` + + // LogConfigs: The config returned to callers of + // tech.iam.IAM.CheckPolicy for any entries that match the LOG action. + LogConfigs []*LogConfig `json:"logConfigs,omitempty"` + + // NotIns: The rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is not + // in this set of entries. + NotIns []string `json:"notIns,omitempty"` + + // Permissions: A permission is a string of form '..' (e.g., + // 'storage.buckets.list'). A value of '*' matches all permissions, and + // a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs. + Permissions []string `json:"permissions,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Action") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Rule) MarshalJSON() ([]byte, error) { + type noMethod Rule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TestPermissionsRequest struct { + // Permissions: The set of permissions to check for the 'resource'. + // Permissions with wildcards (such as '*' or 'storage.*') are not + // allowed. + Permissions []string `json:"permissions,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Permissions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TestPermissionsRequest) MarshalJSON() ([]byte, error) { + type noMethod TestPermissionsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TestPermissionsResponse struct { + // Permissions: A subset of `TestPermissionsRequest.permissions` that + // the caller is allowed. + Permissions []string `json:"permissions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Permissions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TestPermissionsResponse) MarshalJSON() ([]byte, error) { + type noMethod TestPermissionsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// User: A User resource. +type User struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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"` + + // Groups: [Output Only] A list of URLs to Group resources who contain + // the user. Users are only members of groups in the same project. + Groups []string `json:"groups,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always + // clouduseraccounts#user for users. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. + Name string `json:"name,omitempty"` + + // Owner: Email address of account's owner. This account will be + // validated to make sure it exists. The email can belong to any domain, + // but it must be tied to a Google account. + Owner string `json:"owner,omitempty"` + + // PublicKeys: [Output Only] Public keys that this user may use to + // login. + PublicKeys []*PublicKey `json:"publicKeys,omitempty"` + + // SelfLink: [Output Only] Server defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *User) MarshalJSON() ([]byte, error) { + type noMethod User + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type UserList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of User resources. + Items []*User `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always + // clouduseraccounts#userList for lists of users. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserList) MarshalJSON() ([]byte, error) { + type noMethod UserList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "clouduseraccounts.globalAccountsOperations.delete": + +type GlobalAccountsOperationsDeleteCall struct { + s *Service + project string + operation string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified operation resource. +func (r *GlobalAccountsOperationsService) Delete(project string, operation string) *GlobalAccountsOperationsDeleteCall { + c := &GlobalAccountsOperationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.operation = operation + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalAccountsOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalAccountsOperationsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalAccountsOperationsDeleteCall) Context(ctx context.Context) *GlobalAccountsOperationsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalAccountsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.globalAccountsOperations.delete" call. +func (c *GlobalAccountsOperationsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified operation resource.", + // "httpMethod": "DELETE", + // "id": "clouduseraccounts.globalAccountsOperations.delete", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the Operations resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.globalAccountsOperations.get": + +type GlobalAccountsOperationsGetCall struct { + s *Service + project string + operation string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves the specified operation resource. +func (r *GlobalAccountsOperationsService) Get(project string, operation string) *GlobalAccountsOperationsGetCall { + c := &GlobalAccountsOperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.operation = operation + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalAccountsOperationsGetCall) Fields(s ...googleapi.Field) *GlobalAccountsOperationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalAccountsOperationsGetCall) IfNoneMatch(entityTag string) *GlobalAccountsOperationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalAccountsOperationsGetCall) Context(ctx context.Context) *GlobalAccountsOperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalAccountsOperationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.globalAccountsOperations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GlobalAccountsOperationsGetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified operation resource.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.globalAccountsOperations.get", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the Operations resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.globalAccountsOperations.list": + +type GlobalAccountsOperationsListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of operation resources contained within the +// specified project. +func (r *GlobalAccountsOperationsService) List(project string) *GlobalAccountsOperationsListCall { + c := &GlobalAccountsOperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *GlobalAccountsOperationsListCall) Filter(filter string) *GlobalAccountsOperationsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *GlobalAccountsOperationsListCall) MaxResults(maxResults int64) *GlobalAccountsOperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *GlobalAccountsOperationsListCall) OrderBy(orderBy string) *GlobalAccountsOperationsListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *GlobalAccountsOperationsListCall) PageToken(pageToken string) *GlobalAccountsOperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalAccountsOperationsListCall) Fields(s ...googleapi.Field) *GlobalAccountsOperationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalAccountsOperationsListCall) IfNoneMatch(entityTag string) *GlobalAccountsOperationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalAccountsOperationsListCall) Context(ctx context.Context) *GlobalAccountsOperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalAccountsOperationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.globalAccountsOperations.list" call. +// Exactly one of *OperationList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *OperationList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *GlobalAccountsOperationsListCall) Do() (*OperationList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperationList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of operation resources contained within the specified project.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.globalAccountsOperations.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.groups.addMember": + +type GroupsAddMemberCall struct { + s *Service + project string + groupName string + groupsaddmemberrequest *GroupsAddMemberRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// AddMember: Adds users to the specified group. +func (r *GroupsService) AddMember(project string, groupName string, groupsaddmemberrequest *GroupsAddMemberRequest) *GroupsAddMemberCall { + c := &GroupsAddMemberCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.groupName = groupName + c.groupsaddmemberrequest = groupsaddmemberrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsAddMemberCall) Fields(s ...googleapi.Field) *GroupsAddMemberCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsAddMemberCall) Context(ctx context.Context) *GroupsAddMemberCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsAddMemberCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupsaddmemberrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{groupName}/addMember") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "groupName": c.groupName, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.addMember" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GroupsAddMemberCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds users to the specified group.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.groups.addMember", + // "parameterOrder": [ + // "project", + // "groupName" + // ], + // "parameters": { + // "groupName": { + // "description": "Name of the group for this request.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/groups/{groupName}/addMember", + // "request": { + // "$ref": "GroupsAddMemberRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.groups.delete": + +type GroupsDeleteCall struct { + s *Service + project string + groupName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified Group resource. +func (r *GroupsService) Delete(project string, groupName string) *GroupsDeleteCall { + c := &GroupsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.groupName = groupName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsDeleteCall) Fields(s ...googleapi.Field) *GroupsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsDeleteCall) Context(ctx context.Context) *GroupsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{groupName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "groupName": c.groupName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GroupsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified Group resource.", + // "httpMethod": "DELETE", + // "id": "clouduseraccounts.groups.delete", + // "parameterOrder": [ + // "project", + // "groupName" + // ], + // "parameters": { + // "groupName": { + // "description": "Name of the Group resource to delete.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/groups/{groupName}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.groups.get": + +type GroupsGetCall struct { + s *Service + project string + groupName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified Group resource. +func (r *GroupsService) Get(project string, groupName string) *GroupsGetCall { + c := &GroupsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.groupName = groupName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsGetCall) Fields(s ...googleapi.Field) *GroupsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GroupsGetCall) IfNoneMatch(entityTag string) *GroupsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsGetCall) Context(ctx context.Context) *GroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{groupName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "groupName": c.groupName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.get" call. +// Exactly one of *Group or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Group.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *GroupsGetCall) Do() (*Group, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Group{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified Group resource.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.groups.get", + // "parameterOrder": [ + // "project", + // "groupName" + // ], + // "parameters": { + // "groupName": { + // "description": "Name of the Group resource to return.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/groups/{groupName}", + // "response": { + // "$ref": "Group" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.groups.getIamPolicy": + +type GroupsGetIamPolicyCall struct { + s *Service + project string + resource string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetIamPolicy: Gets the access control policy for a resource. May be +// empty if no such policy or resource exists. +func (r *GroupsService) GetIamPolicy(project string, resource string) *GroupsGetIamPolicyCall { + c := &GroupsGetIamPolicyCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.resource = resource + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsGetIamPolicyCall) Fields(s ...googleapi.Field) *GroupsGetIamPolicyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GroupsGetIamPolicyCall) IfNoneMatch(entityTag string) *GroupsGetIamPolicyCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsGetIamPolicyCall) Context(ctx context.Context) *GroupsGetIamPolicyCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{resource}/getIamPolicy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "resource": c.resource, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.getIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *GroupsGetIamPolicyCall) Do() (*Policy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.groups.getIamPolicy", + // "parameterOrder": [ + // "project", + // "resource" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "resource": { + // "description": "Name of the resource for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/groups/{resource}/getIamPolicy", + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.groups.insert": + +type GroupsInsertCall struct { + s *Service + project string + group *Group + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a Group resource in the specified project using the +// data included in the request. +func (r *GroupsService) Insert(project string, group *Group) *GroupsInsertCall { + c := &GroupsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.group = group + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsInsertCall) Fields(s ...googleapi.Field) *GroupsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsInsertCall) Context(ctx context.Context) *GroupsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GroupsInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a Group resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.groups.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/groups", + // "request": { + // "$ref": "Group" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.groups.list": + +type GroupsListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of groups contained within the specified +// project. +func (r *GroupsService) List(project string) *GroupsListCall { + c := &GroupsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *GroupsListCall) Filter(filter string) *GroupsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *GroupsListCall) MaxResults(maxResults int64) *GroupsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *GroupsListCall) OrderBy(orderBy string) *GroupsListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *GroupsListCall) PageToken(pageToken string) *GroupsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsListCall) Fields(s ...googleapi.Field) *GroupsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GroupsListCall) IfNoneMatch(entityTag string) *GroupsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsListCall) Context(ctx context.Context) *GroupsListCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.list" call. +// Exactly one of *GroupList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *GroupList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GroupsListCall) Do() (*GroupList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &GroupList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of groups contained within the specified project.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.groups.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/groups", + // "response": { + // "$ref": "GroupList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.groups.removeMember": + +type GroupsRemoveMemberCall struct { + s *Service + project string + groupName string + groupsremovememberrequest *GroupsRemoveMemberRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// RemoveMember: Removes users from the specified group. +func (r *GroupsService) RemoveMember(project string, groupName string, groupsremovememberrequest *GroupsRemoveMemberRequest) *GroupsRemoveMemberCall { + c := &GroupsRemoveMemberCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.groupName = groupName + c.groupsremovememberrequest = groupsremovememberrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsRemoveMemberCall) Fields(s ...googleapi.Field) *GroupsRemoveMemberCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsRemoveMemberCall) Context(ctx context.Context) *GroupsRemoveMemberCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsRemoveMemberCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupsremovememberrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{groupName}/removeMember") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "groupName": c.groupName, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.removeMember" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GroupsRemoveMemberCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Removes users from the specified group.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.groups.removeMember", + // "parameterOrder": [ + // "project", + // "groupName" + // ], + // "parameters": { + // "groupName": { + // "description": "Name of the group for this request.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/groups/{groupName}/removeMember", + // "request": { + // "$ref": "GroupsRemoveMemberRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.groups.setIamPolicy": + +type GroupsSetIamPolicyCall struct { + s *Service + project string + resource string + policy *Policy + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetIamPolicy: Sets the access control policy on the specified +// resource. Replaces any existing policy. +func (r *GroupsService) SetIamPolicy(project string, resource string, policy *Policy) *GroupsSetIamPolicyCall { + c := &GroupsSetIamPolicyCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.resource = resource + c.policy = policy + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsSetIamPolicyCall) Fields(s ...googleapi.Field) *GroupsSetIamPolicyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsSetIamPolicyCall) Context(ctx context.Context) *GroupsSetIamPolicyCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{resource}/setIamPolicy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "resource": c.resource, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.setIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *GroupsSetIamPolicyCall) Do() (*Policy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.groups.setIamPolicy", + // "parameterOrder": [ + // "project", + // "resource" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "resource": { + // "description": "Name of the resource for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/groups/{resource}/setIamPolicy", + // "request": { + // "$ref": "Policy" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.groups.testIamPermissions": + +type GroupsTestIamPermissionsCall struct { + s *Service + project string + resource string + testpermissionsrequest *TestPermissionsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// TestIamPermissions: Returns permissions that a caller has on the +// specified resource. +func (r *GroupsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *GroupsTestIamPermissionsCall { + c := &GroupsTestIamPermissionsCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.resource = resource + c.testpermissionsrequest = testpermissionsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *GroupsTestIamPermissionsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsTestIamPermissionsCall) Context(ctx context.Context) *GroupsTestIamPermissionsCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{resource}/testIamPermissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "resource": c.resource, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.testIamPermissions" call. +// Exactly one of *TestPermissionsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TestPermissionsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *GroupsTestIamPermissionsCall) Do() (*TestPermissionsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TestPermissionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns permissions that a caller has on the specified resource.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.groups.testIamPermissions", + // "parameterOrder": [ + // "project", + // "resource" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "resource": { + // "description": "Name of the resource for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/groups/{resource}/testIamPermissions", + // "request": { + // "$ref": "TestPermissionsRequest" + // }, + // "response": { + // "$ref": "TestPermissionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.linux.getAuthorizedKeysView": + +type LinuxGetAuthorizedKeysViewCall struct { + s *Service + project string + zone string + user string + instance string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetAuthorizedKeysView: Returns a list of authorized public keys for a +// specific user account. +func (r *LinuxService) GetAuthorizedKeysView(project string, zone string, user string, instance string) *LinuxGetAuthorizedKeysViewCall { + c := &LinuxGetAuthorizedKeysViewCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.user = user + c.instance = instance + return c +} + +// Login sets the optional parameter "login": Whether the view was +// requested as part of a user-initiated login. +func (c *LinuxGetAuthorizedKeysViewCall) Login(login bool) *LinuxGetAuthorizedKeysViewCall { + c.opt_["login"] = login + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LinuxGetAuthorizedKeysViewCall) Fields(s ...googleapi.Field) *LinuxGetAuthorizedKeysViewCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LinuxGetAuthorizedKeysViewCall) Context(ctx context.Context) *LinuxGetAuthorizedKeysViewCall { + c.ctx_ = ctx + return c +} + +func (c *LinuxGetAuthorizedKeysViewCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("instance", fmt.Sprintf("%v", c.instance)) + if v, ok := c.opt_["login"]; ok { + params.Set("login", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/authorizedKeysView/{user}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "user": c.user, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.linux.getAuthorizedKeysView" call. +// Exactly one of *LinuxGetAuthorizedKeysViewResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *LinuxGetAuthorizedKeysViewResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *LinuxGetAuthorizedKeysViewCall) Do() (*LinuxGetAuthorizedKeysViewResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LinuxGetAuthorizedKeysViewResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a list of authorized public keys for a specific user account.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.linux.getAuthorizedKeysView", + // "parameterOrder": [ + // "project", + // "zone", + // "user", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "The fully-qualified URL of the virtual machine requesting the view.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "login": { + // "description": "Whether the view was requested as part of a user-initiated login.", + // "location": "query", + // "type": "boolean" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "user": { + // "description": "The user account for which you want to get a list of authorized public keys.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/authorizedKeysView/{user}", + // "response": { + // "$ref": "LinuxGetAuthorizedKeysViewResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.linux.getLinuxAccountViews": + +type LinuxGetLinuxAccountViewsCall struct { + s *Service + project string + zone string + instance string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetLinuxAccountViews: Retrieves a list of user accounts for an +// instance within a specific project. +func (r *LinuxService) GetLinuxAccountViews(project string, zone string, instance string) *LinuxGetLinuxAccountViewsCall { + c := &LinuxGetLinuxAccountViewsCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *LinuxGetLinuxAccountViewsCall) Filter(filter string) *LinuxGetLinuxAccountViewsCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *LinuxGetLinuxAccountViewsCall) MaxResults(maxResults int64) *LinuxGetLinuxAccountViewsCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *LinuxGetLinuxAccountViewsCall) OrderBy(orderBy string) *LinuxGetLinuxAccountViewsCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *LinuxGetLinuxAccountViewsCall) PageToken(pageToken string) *LinuxGetLinuxAccountViewsCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LinuxGetLinuxAccountViewsCall) Fields(s ...googleapi.Field) *LinuxGetLinuxAccountViewsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LinuxGetLinuxAccountViewsCall) Context(ctx context.Context) *LinuxGetLinuxAccountViewsCall { + c.ctx_ = ctx + return c +} + +func (c *LinuxGetLinuxAccountViewsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("instance", fmt.Sprintf("%v", c.instance)) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/linuxAccountViews") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.linux.getLinuxAccountViews" call. +// Exactly one of *LinuxGetLinuxAccountViewsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *LinuxGetLinuxAccountViewsResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *LinuxGetLinuxAccountViewsCall) Do() (*LinuxGetLinuxAccountViewsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LinuxGetLinuxAccountViewsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of user accounts for an instance within a specific project.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.linux.getLinuxAccountViews", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "instance": { + // "description": "The fully-qualified URL of the virtual machine requesting the views.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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 for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/linuxAccountViews", + // "response": { + // "$ref": "LinuxGetLinuxAccountViewsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.users.addPublicKey": + +type UsersAddPublicKeyCall struct { + s *Service + project string + user string + publickey *PublicKey + opt_ map[string]interface{} + ctx_ context.Context +} + +// AddPublicKey: Adds a public key to the specified User resource with +// the data included in the request. +func (r *UsersService) AddPublicKey(project string, user string, publickey *PublicKey) *UsersAddPublicKeyCall { + c := &UsersAddPublicKeyCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.user = user + c.publickey = publickey + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersAddPublicKeyCall) Fields(s ...googleapi.Field) *UsersAddPublicKeyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersAddPublicKeyCall) Context(ctx context.Context) *UsersAddPublicKeyCall { + c.ctx_ = ctx + return c +} + +func (c *UsersAddPublicKeyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.publickey) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{user}/addPublicKey") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "user": c.user, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.addPublicKey" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersAddPublicKeyCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds a public key to the specified User resource with the data included in the request.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.users.addPublicKey", + // "parameterOrder": [ + // "project", + // "user" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "user": { + // "description": "Name of the user for this request.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/users/{user}/addPublicKey", + // "request": { + // "$ref": "PublicKey" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.users.delete": + +type UsersDeleteCall struct { + s *Service + project string + user string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified User resource. +func (r *UsersService) Delete(project string, user string) *UsersDeleteCall { + c := &UsersDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.user = user + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersDeleteCall) Fields(s ...googleapi.Field) *UsersDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersDeleteCall) Context(ctx context.Context) *UsersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{user}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "user": c.user, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified User resource.", + // "httpMethod": "DELETE", + // "id": "clouduseraccounts.users.delete", + // "parameterOrder": [ + // "project", + // "user" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "user": { + // "description": "Name of the user resource to delete.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/users/{user}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.users.get": + +type UsersGetCall struct { + s *Service + project string + user string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified User resource. +func (r *UsersService) Get(project string, user string) *UsersGetCall { + c := &UsersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.user = user + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall { + c.ctx_ = ctx + return c +} + +func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{user}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "user": c.user, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.get" call. +// Exactly one of *User or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *User.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *UsersGetCall) Do() (*User, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &User{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified User resource.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.users.get", + // "parameterOrder": [ + // "project", + // "user" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "user": { + // "description": "Name of the user resource to return.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/users/{user}", + // "response": { + // "$ref": "User" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.users.getIamPolicy": + +type UsersGetIamPolicyCall struct { + s *Service + project string + resource string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetIamPolicy: Gets the access control policy for a resource. May be +// empty if no such policy or resource exists. +func (r *UsersService) GetIamPolicy(project string, resource string) *UsersGetIamPolicyCall { + c := &UsersGetIamPolicyCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.resource = resource + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersGetIamPolicyCall) Fields(s ...googleapi.Field) *UsersGetIamPolicyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersGetIamPolicyCall) IfNoneMatch(entityTag string) *UsersGetIamPolicyCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersGetIamPolicyCall) Context(ctx context.Context) *UsersGetIamPolicyCall { + c.ctx_ = ctx + return c +} + +func (c *UsersGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{resource}/getIamPolicy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "resource": c.resource, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.getIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersGetIamPolicyCall) Do() (*Policy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.users.getIamPolicy", + // "parameterOrder": [ + // "project", + // "resource" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "resource": { + // "description": "Name of the resource for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/users/{resource}/getIamPolicy", + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.users.insert": + +type UsersInsertCall struct { + s *Service + project string + user *User + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a User resource in the specified project using the +// data included in the request. +func (r *UsersService) Insert(project string, user *User) *UsersInsertCall { + c := &UsersInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.user = user + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersInsertCall) Fields(s ...googleapi.Field) *UsersInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersInsertCall) Context(ctx context.Context) *UsersInsertCall { + c.ctx_ = ctx + return c +} + +func (c *UsersInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a User resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.users.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/users", + // "request": { + // "$ref": "User" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.users.list": + +type UsersListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of users contained within the specified +// project. +func (r *UsersService) List(project string) *UsersListCall { + c := &UsersListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *UsersListCall) Filter(filter string) *UsersListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *UsersListCall) MaxResults(maxResults int64) *UsersListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *UsersListCall) OrderBy(orderBy string) *UsersListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *UsersListCall) PageToken(pageToken string) *UsersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersListCall) Context(ctx context.Context) *UsersListCall { + c.ctx_ = ctx + return c +} + +func (c *UsersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.list" call. +// Exactly one of *UserList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *UserList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersListCall) Do() (*UserList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of users contained within the specified project.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.users.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/users", + // "response": { + // "$ref": "UserList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.users.removePublicKey": + +type UsersRemovePublicKeyCall struct { + s *Service + project string + user string + fingerprint string + opt_ map[string]interface{} + ctx_ context.Context +} + +// RemovePublicKey: Removes the specified public key from the user. +func (r *UsersService) RemovePublicKey(project string, user string, fingerprint string) *UsersRemovePublicKeyCall { + c := &UsersRemovePublicKeyCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.user = user + c.fingerprint = fingerprint + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersRemovePublicKeyCall) Fields(s ...googleapi.Field) *UsersRemovePublicKeyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersRemovePublicKeyCall) Context(ctx context.Context) *UsersRemovePublicKeyCall { + c.ctx_ = ctx + return c +} + +func (c *UsersRemovePublicKeyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("fingerprint", fmt.Sprintf("%v", c.fingerprint)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{user}/removePublicKey") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "user": c.user, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.removePublicKey" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersRemovePublicKeyCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Removes the specified public key from the user.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.users.removePublicKey", + // "parameterOrder": [ + // "project", + // "user", + // "fingerprint" + // ], + // "parameters": { + // "fingerprint": { + // "description": "The fingerprint of the public key to delete. Public keys are identified by their fingerprint, which is defined by RFC4716 to be the MD5 digest of the public key.", + // "location": "query", + // "pattern": "[a-f0-9]{32}", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "user": { + // "description": "Name of the user for this request.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/users/{user}/removePublicKey", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.users.setIamPolicy": + +type UsersSetIamPolicyCall struct { + s *Service + project string + resource string + policy *Policy + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetIamPolicy: Sets the access control policy on the specified +// resource. Replaces any existing policy. +func (r *UsersService) SetIamPolicy(project string, resource string, policy *Policy) *UsersSetIamPolicyCall { + c := &UsersSetIamPolicyCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.resource = resource + c.policy = policy + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersSetIamPolicyCall) Fields(s ...googleapi.Field) *UsersSetIamPolicyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersSetIamPolicyCall) Context(ctx context.Context) *UsersSetIamPolicyCall { + c.ctx_ = ctx + return c +} + +func (c *UsersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{resource}/setIamPolicy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "resource": c.resource, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.setIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersSetIamPolicyCall) Do() (*Policy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.users.setIamPolicy", + // "parameterOrder": [ + // "project", + // "resource" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "resource": { + // "description": "Name of the resource for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/users/{resource}/setIamPolicy", + // "request": { + // "$ref": "Policy" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.users.testIamPermissions": + +type UsersTestIamPermissionsCall struct { + s *Service + project string + resource string + testpermissionsrequest *TestPermissionsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// TestIamPermissions: Returns permissions that a caller has on the +// specified resource. +func (r *UsersService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *UsersTestIamPermissionsCall { + c := &UsersTestIamPermissionsCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.resource = resource + c.testpermissionsrequest = testpermissionsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersTestIamPermissionsCall) Fields(s ...googleapi.Field) *UsersTestIamPermissionsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersTestIamPermissionsCall) Context(ctx context.Context) *UsersTestIamPermissionsCall { + c.ctx_ = ctx + return c +} + +func (c *UsersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{resource}/testIamPermissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "resource": c.resource, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.testIamPermissions" call. +// Exactly one of *TestPermissionsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TestPermissionsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UsersTestIamPermissionsCall) Do() (*TestPermissionsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TestPermissionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns permissions that a caller has on the specified resource.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.users.testIamPermissions", + // "parameterOrder": [ + // "project", + // "resource" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "resource": { + // "description": "Name of the resource for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/users/{resource}/testIamPermissions", + // "request": { + // "$ref": "TestPermissionsRequest" + // }, + // "response": { + // "$ref": "TestPermissionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/vm_beta/clouduseraccounts-api.json b/Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/vm_beta/clouduseraccounts-api.json new file mode 100644 index 000000000..cba1ad015 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/vm_beta/clouduseraccounts-api.json @@ -0,0 +1,1355 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/w-hH-zUDJ75oKTTP-1F8OjQaYyU\"", + "discoveryVersion": "v1", + "id": "clouduseraccounts:vm_beta", + "name": "clouduseraccounts", + "canonicalName": "Cloud User Accounts", + "version": "vm_beta", + "revision": "20150917", + "title": "Cloud User Accounts API", + "description": "API for the Google Cloud User Accounts service.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/compute_engine-16.png", + "x32": "https://www.google.com/images/icons/product/compute_engine-32.png" + }, + "documentationLink": "https://cloud.google.com/compute/docs/access/user-accounts/api/latest/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/clouduseraccounts/vm_beta/projects/", + "basePath": "/clouduseraccounts/vm_beta/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "clouduseraccounts/vm_beta/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/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/cloud.useraccounts": { + "description": "Manage your Google Cloud User Accounts" + }, + "https://www.googleapis.com/auth/cloud.useraccounts.readonly": { + "description": "View your Google Cloud User Accounts" + } + } + } + }, + "schemas": { + "AuthorizedKeysView": { + "id": "AuthorizedKeysView", + "type": "object", + "description": "A list of authorized public keys for a user account.", + "properties": { + "keys": { + "type": "array", + "description": "[Output Only] The list of authorized public keys in SSH format.", + "items": { + "type": "string" + } + }, + "sudoer": { + "type": "boolean", + "description": "[Output Only] Whether the user has the ability to elevate on the instance that requested the authorized keys." + } + } + }, + "Group": { + "id": "Group", + "type": "object", + "description": "A Group resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always clouduseraccounts#group for groups.", + "default": "clouduseraccounts#group" + }, + "members": { + "type": "array", + "description": "[Output Only] A list of URLs to User resources who belong to the group. Users may only be members of groups in the same project.", + "items": { + "type": "string" + } + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created.", + "pattern": "[a-z][-a-z0-9_]{0,31}", + "annotations": { + "required": [ + "clouduseraccounts.groups.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for the resource." + } + } + }, + "GroupList": { + "id": "GroupList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of Group resources.", + "items": { + "$ref": "Group" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always clouduseraccounts#groupList for lists of groups.", + "default": "clouduseraccounts#groupList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for this resource." + } + } + }, + "GroupsAddMemberRequest": { + "id": "GroupsAddMemberRequest", + "type": "object", + "properties": { + "users": { + "type": "array", + "description": "Fully-qualified URLs of the User resources to add.", + "items": { + "type": "string" + } + } + } + }, + "GroupsRemoveMemberRequest": { + "id": "GroupsRemoveMemberRequest", + "type": "object", + "properties": { + "users": { + "type": "array", + "description": "Fully-qualified URLs of the User resources to remove.", + "items": { + "type": "string" + } + } + } + }, + "LinuxAccountViews": { + "id": "LinuxAccountViews", + "type": "object", + "description": "A list of all Linux accounts for this project. This API is only used by Compute Engine virtual machines to get information about user accounts for a project or instance. Linux resources are read-only views into users and groups managed by the Compute Engine Accounts API.", + "properties": { + "groupViews": { + "type": "array", + "description": "[Output Only] A list of all groups within a project.", + "items": { + "$ref": "LinuxGroupView" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always clouduseraccounts#linuxAccountViews for Linux resources.", + "default": "clouduseraccounts#linuxAccountViews" + }, + "userViews": { + "type": "array", + "description": "[Output Only] A list of all users within a project.", + "items": { + "$ref": "LinuxUserView" + } + } + } + }, + "LinuxGetAuthorizedKeysViewResponse": { + "id": "LinuxGetAuthorizedKeysViewResponse", + "type": "object", + "properties": { + "resource": { + "$ref": "AuthorizedKeysView", + "description": "[Output Only] A list of authorized public keys for a user." + } + } + }, + "LinuxGetLinuxAccountViewsResponse": { + "id": "LinuxGetLinuxAccountViewsResponse", + "type": "object", + "properties": { + "resource": { + "$ref": "LinuxAccountViews", + "description": "[Output Only] A list of authorized user accounts and groups." + } + } + }, + "LinuxGroupView": { + "id": "LinuxGroupView", + "type": "object", + "description": "A detailed view of a Linux group.", + "properties": { + "gid": { + "type": "integer", + "description": "[Output Only] The Group ID.", + "format": "uint32" + }, + "groupName": { + "type": "string", + "description": "[Output Only] Group name." + }, + "members": { + "type": "array", + "description": "[Output Only] List of user accounts that belong to the group.", + "items": { + "type": "string" + } + } + } + }, + "LinuxUserView": { + "id": "LinuxUserView", + "type": "object", + "description": "A detailed view of a Linux user account.", + "properties": { + "gecos": { + "type": "string", + "description": "[Output Only] The GECOS (user information) entry for this account." + }, + "gid": { + "type": "integer", + "description": "[Output Only] User's default group ID.", + "format": "uint32" + }, + "homeDirectory": { + "type": "string", + "description": "[Output Only] The path to the home directory for this account." + }, + "shell": { + "type": "string", + "description": "[Output Only] The path to the login shell for this account." + }, + "uid": { + "type": "integer", + "description": "[Output Only] User ID.", + "format": "uint32" + }, + "username": { + "type": "string", + "description": "[Output Only] The username of the account." + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "description": "An Operation resource, used to manage asynchronous API requests.", + "properties": { + "clientOperationId": { + "type": "string", + "description": "[Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all Operation resources in the project." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "endTime": { + "type": "string", + "description": "[Output Only] The time that this operation was completed. This is in RFC3339 text format." + }, + "error": { + "type": "object", + "description": "[Output Only] If errors are generated during processing of the operation, this field will be populated.", + "properties": { + "errors": { + "type": "array", + "description": "[Output Only] The array of errors encountered while processing this operation.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The error type identifier for this error." + }, + "location": { + "type": "string", + "description": "[Output Only] Indicates the field in the request which caused the error. This property is optional." + }, + "message": { + "type": "string", + "description": "[Output Only] An optional, human-readable error message." + } + } + } + } + } + }, + "httpErrorMessage": { + "type": "string", + "description": "[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND." + }, + "httpErrorStatusCode": { + "type": "integer", + "description": "[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as 404.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "[Output Only] The time that this operation was requested. This is in RFC3339 text format." + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#operation for Operation resources.", + "default": "clouduseraccounts#operation" + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource." + }, + "operationType": { + "type": "string", + "description": "[Output Only] Type of the operation, such as insert, compute.instanceGroups.update, or compute.instanceGroups.delete." + }, + "progress": { + "type": "integer", + "description": "[Output Only] 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 monotonically increase as the operation progresses.", + "format": "int32" + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where the operation resides. Only applicable for regional resources." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "startTime": { + "type": "string", + "description": "[Output Only] The time that this operation was started by the server. This is in RFC3339 text format." + }, + "status": { + "type": "string", + "description": "[Output Only] Status of the operation. Can be one of the following: PENDING, RUNNING, or DONE.", + "enum": [ + "DONE", + "PENDING", + "RUNNING" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "statusMessage": { + "type": "string", + "description": "[Output Only] An optional textual description of the current status of the operation." + }, + "targetId": { + "type": "string", + "description": "[Output Only] Unique target ID which identifies a particular incarnation of the target.", + "format": "uint64" + }, + "targetLink": { + "type": "string", + "description": "[Output Only] URL of the resource the operation is mutating." + }, + "user": { + "type": "string", + "description": "[Output Only] User who requested the operation, for example: user@example.com." + }, + "warnings": { + "type": "array", + "description": "[Output Only] If warning messages are generated during processing of the operation, this field will be populated.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + }, + "zone": { + "type": "string", + "description": "[Output Only] URL of the zone where the operation resides." + } + } + }, + "OperationList": { + "id": "OperationList", + "type": "object", + "description": "Contains a list of Operation resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] The Operation resources.", + "items": { + "$ref": "Operation" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#operations for Operations resource.", + "default": "clouduseraccounts#operationList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncate." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "PublicKey": { + "id": "PublicKey", + "type": "object", + "description": "A public key for authenticating to guests.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "expirationTimestamp": { + "type": "string", + "description": "Optional expiration timestamp. If provided, the timestamp must be in RFC3339 text format. If not provided, the public key never expires." + }, + "fingerprint": { + "type": "string", + "description": "[Output Only] The fingerprint of the key is defined by RFC4716 to be the MD5 digest of the public key." + }, + "key": { + "type": "string", + "description": "Public key text in SSH format, defined by RFC4253 section 6.6." + } + } + }, + "User": { + "id": "User", + "type": "object", + "description": "A User resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "groups": { + "type": "array", + "description": "[Output Only] A list of URLs to Group resources who contain the user. Users are only members of groups in the same project.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always clouduseraccounts#user for users.", + "default": "clouduseraccounts#user" + }, + "name": { + "type": "string", + "description": "Name of the resource; provided by the client when the resource is created.", + "pattern": "[a-z][-a-z0-9_]{0,31}", + "annotations": { + "required": [ + "clouduseraccounts.users.insert" + ] + } + }, + "owner": { + "type": "string", + "description": "Email address of account's owner. This account will be validated to make sure it exists. The email can belong to any domain, but it must be tied to a Google account.", + "annotations": { + "required": [ + "clouduseraccounts.users.insert" + ] + } + }, + "publicKeys": { + "type": "array", + "description": "[Output Only] Public keys that this user may use to login.", + "items": { + "$ref": "PublicKey" + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for the resource." + } + } + }, + "UserList": { + "id": "UserList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of User resources.", + "items": { + "$ref": "User" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always clouduseraccounts#userList for lists of users.", + "default": "clouduseraccounts#userList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for this resource." + } + } + } + }, + "resources": { + "globalAccountsOperations": { + "methods": { + "delete": { + "id": "clouduseraccounts.globalAccountsOperations.delete", + "path": "{project}/global/operations/{operation}", + "httpMethod": "DELETE", + "description": "Deletes the specified operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the Operations resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "get": { + "id": "clouduseraccounts.globalAccountsOperations.get", + "path": "{project}/global/operations/{operation}", + "httpMethod": "GET", + "description": "Retrieves the specified operation resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the Operations resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "list": { + "id": "clouduseraccounts.globalAccountsOperations.list", + "path": "{project}/global/operations", + "httpMethod": "GET", + "description": "Retrieves the list of operation resources contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + } + } + }, + "groups": { + "methods": { + "addMember": { + "id": "clouduseraccounts.groups.addMember", + "path": "{project}/global/groups/{groupName}/addMember", + "httpMethod": "POST", + "description": "Adds users to the specified group.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the group for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "groupName" + ], + "request": { + "$ref": "GroupsAddMemberRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "delete": { + "id": "clouduseraccounts.groups.delete", + "path": "{project}/global/groups/{groupName}", + "httpMethod": "DELETE", + "description": "Deletes the specified Group resource.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the Group resource to delete.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "groupName" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "get": { + "id": "clouduseraccounts.groups.get", + "path": "{project}/global/groups/{groupName}", + "httpMethod": "GET", + "description": "Returns the specified Group resource.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the Group resource to return.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "groupName" + ], + "response": { + "$ref": "Group" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "insert": { + "id": "clouduseraccounts.groups.insert", + "path": "{project}/global/groups", + "httpMethod": "POST", + "description": "Creates a Group resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "Group" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "list": { + "id": "clouduseraccounts.groups.list", + "path": "{project}/global/groups", + "httpMethod": "GET", + "description": "Retrieves the list of groups contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "GroupList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "removeMember": { + "id": "clouduseraccounts.groups.removeMember", + "path": "{project}/global/groups/{groupName}/removeMember", + "httpMethod": "POST", + "description": "Removes users from the specified group.", + "parameters": { + "groupName": { + "type": "string", + "description": "Name of the group for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "groupName" + ], + "request": { + "$ref": "GroupsRemoveMemberRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + } + } + }, + "linux": { + "methods": { + "getAuthorizedKeysView": { + "id": "clouduseraccounts.linux.getAuthorizedKeysView", + "path": "{project}/zones/{zone}/authorizedKeysView/{user}", + "httpMethod": "POST", + "description": "Returns a list of authorized public keys for a specific user account.", + "parameters": { + "instance": { + "type": "string", + "description": "The fully-qualified URL of the virtual machine requesting the view.", + "required": true, + "location": "query" + }, + "login": { + "type": "boolean", + "description": "Whether the view was requested as part of a user-initiated login.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "user": { + "type": "string", + "description": "The user account for which you want to get a list of authorized public keys.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + }, + "zone": { + "type": "string", + "description": "Name of the zone for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "user", + "instance" + ], + "response": { + "$ref": "LinuxGetAuthorizedKeysViewResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "getLinuxAccountViews": { + "id": "clouduseraccounts.linux.getLinuxAccountViews", + "path": "{project}/zones/{zone}/linuxAccountViews", + "httpMethod": "POST", + "description": "Retrieves a list of user accounts for an instance within a specific project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "instance": { + "type": "string", + "description": "The fully-qualified URL of the virtual machine requesting the views.", + "required": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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 for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "response": { + "$ref": "LinuxGetLinuxAccountViewsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + } + } + }, + "users": { + "methods": { + "addPublicKey": { + "id": "clouduseraccounts.users.addPublicKey", + "path": "{project}/global/users/{user}/addPublicKey", + "httpMethod": "POST", + "description": "Adds a public key to the specified User resource with the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "user": { + "type": "string", + "description": "Name of the user for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user" + ], + "request": { + "$ref": "PublicKey" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "delete": { + "id": "clouduseraccounts.users.delete", + "path": "{project}/global/users/{user}", + "httpMethod": "DELETE", + "description": "Deletes the specified User resource.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "user": { + "type": "string", + "description": "Name of the user resource to delete.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "get": { + "id": "clouduseraccounts.users.get", + "path": "{project}/global/users/{user}", + "httpMethod": "GET", + "description": "Returns the specified User resource.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "user": { + "type": "string", + "description": "Name of the user resource to return.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user" + ], + "response": { + "$ref": "User" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "insert": { + "id": "clouduseraccounts.users.insert", + "path": "{project}/global/users", + "httpMethod": "POST", + "description": "Creates a User resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "User" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + }, + "list": { + "id": "clouduseraccounts.users.list", + "path": "{project}/global/users", + "httpMethod": "GET", + "description": "Retrieves a list of users contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "UserList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/cloud.useraccounts", + "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + ] + }, + "removePublicKey": { + "id": "clouduseraccounts.users.removePublicKey", + "path": "{project}/global/users/{user}/removePublicKey", + "httpMethod": "POST", + "description": "Removes the specified public key from the user.", + "parameters": { + "fingerprint": { + "type": "string", + "description": "The fingerprint of the public key to delete. Public keys are identified by their fingerprint, which is defined by RFC4716 to be the MD5 digest of the public key.", + "required": true, + "pattern": "[a-f0-9]{32}", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "user": { + "type": "string", + "description": "Name of the user for this request.", + "required": true, + "pattern": "[a-z][-a-z0-9_]{0,31}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "user", + "fingerprint" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud.useraccounts" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/vm_beta/clouduseraccounts-gen.go b/Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/vm_beta/clouduseraccounts-gen.go new file mode 100644 index 000000000..30075b3c0 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/clouduseraccounts/vm_beta/clouduseraccounts-gen.go @@ -0,0 +1,3451 @@ +// Package clouduseraccounts provides access to the Cloud User Accounts API. +// +// See https://cloud.google.com/compute/docs/access/user-accounts/api/latest/ +// +// Usage example: +// +// import "google.golang.org/api/clouduseraccounts/vm_beta" +// ... +// clouduseraccountsService, err := clouduseraccounts.New(oauthHttpClient) +package clouduseraccounts // import "google.golang.org/api/clouduseraccounts/vm_beta" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "clouduseraccounts:vm_beta" +const apiName = "clouduseraccounts" +const apiVersion = "vm_beta" +const basePath = "https://www.googleapis.com/clouduseraccounts/vm_beta/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 data across Google Cloud Platform services + CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" + + // Manage your Google Cloud User Accounts + CloudUseraccountsScope = "https://www.googleapis.com/auth/cloud.useraccounts" + + // View your Google Cloud User Accounts + CloudUseraccountsReadonlyScope = "https://www.googleapis.com/auth/cloud.useraccounts.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.GlobalAccountsOperations = NewGlobalAccountsOperationsService(s) + s.Groups = NewGroupsService(s) + s.Linux = NewLinuxService(s) + s.Users = NewUsersService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + GlobalAccountsOperations *GlobalAccountsOperationsService + + Groups *GroupsService + + Linux *LinuxService + + Users *UsersService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewGlobalAccountsOperationsService(s *Service) *GlobalAccountsOperationsService { + rs := &GlobalAccountsOperationsService{s: s} + return rs +} + +type GlobalAccountsOperationsService struct { + s *Service +} + +func NewGroupsService(s *Service) *GroupsService { + rs := &GroupsService{s: s} + return rs +} + +type GroupsService struct { + s *Service +} + +func NewLinuxService(s *Service) *LinuxService { + rs := &LinuxService{s: s} + return rs +} + +type LinuxService struct { + s *Service +} + +func NewUsersService(s *Service) *UsersService { + rs := &UsersService{s: s} + return rs +} + +type UsersService struct { + s *Service +} + +// AuthorizedKeysView: A list of authorized public keys for a user +// account. +type AuthorizedKeysView struct { + // Keys: [Output Only] The list of authorized public keys in SSH format. + Keys []string `json:"keys,omitempty"` + + // Sudoer: [Output Only] Whether the user has the ability to elevate on + // the instance that requested the authorized keys. + Sudoer bool `json:"sudoer,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Keys") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AuthorizedKeysView) MarshalJSON() ([]byte, error) { + type noMethod AuthorizedKeysView + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Group: A Group resource. +type Group struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always + // clouduseraccounts#group for groups. + Kind string `json:"kind,omitempty"` + + // Members: [Output Only] A list of URLs to User resources who belong to + // the group. Users may only be members of groups in the same project. + Members []string `json:"members,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] Server defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Group) MarshalJSON() ([]byte, error) { + type noMethod Group + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GroupList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of Group resources. + Items []*Group `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always + // clouduseraccounts#groupList for lists of groups. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GroupList) MarshalJSON() ([]byte, error) { + type noMethod GroupList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GroupsAddMemberRequest struct { + // Users: Fully-qualified URLs of the User resources to add. + Users []string `json:"users,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Users") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GroupsAddMemberRequest) MarshalJSON() ([]byte, error) { + type noMethod GroupsAddMemberRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GroupsRemoveMemberRequest struct { + // Users: Fully-qualified URLs of the User resources to remove. + Users []string `json:"users,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Users") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GroupsRemoveMemberRequest) MarshalJSON() ([]byte, error) { + type noMethod GroupsRemoveMemberRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LinuxAccountViews: A list of all Linux accounts for this project. +// This API is only used by Compute Engine virtual machines to get +// information about user accounts for a project or instance. Linux +// resources are read-only views into users and groups managed by the +// Compute Engine Accounts API. +type LinuxAccountViews struct { + // GroupViews: [Output Only] A list of all groups within a project. + GroupViews []*LinuxGroupView `json:"groupViews,omitempty"` + + // Kind: [Output Only] Type of the resource. Always + // clouduseraccounts#linuxAccountViews for Linux resources. + Kind string `json:"kind,omitempty"` + + // UserViews: [Output Only] A list of all users within a project. + UserViews []*LinuxUserView `json:"userViews,omitempty"` + + // ForceSendFields is a list of field names (e.g. "GroupViews") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LinuxAccountViews) MarshalJSON() ([]byte, error) { + type noMethod LinuxAccountViews + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type LinuxGetAuthorizedKeysViewResponse struct { + // Resource: [Output Only] A list of authorized public keys for a user. + Resource *AuthorizedKeysView `json:"resource,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Resource") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LinuxGetAuthorizedKeysViewResponse) MarshalJSON() ([]byte, error) { + type noMethod LinuxGetAuthorizedKeysViewResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type LinuxGetLinuxAccountViewsResponse struct { + // Resource: [Output Only] A list of authorized user accounts and + // groups. + Resource *LinuxAccountViews `json:"resource,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Resource") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LinuxGetLinuxAccountViewsResponse) MarshalJSON() ([]byte, error) { + type noMethod LinuxGetLinuxAccountViewsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LinuxGroupView: A detailed view of a Linux group. +type LinuxGroupView struct { + // Gid: [Output Only] The Group ID. + Gid int64 `json:"gid,omitempty"` + + // GroupName: [Output Only] Group name. + GroupName string `json:"groupName,omitempty"` + + // Members: [Output Only] List of user accounts that belong to the + // group. + Members []string `json:"members,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Gid") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LinuxGroupView) MarshalJSON() ([]byte, error) { + type noMethod LinuxGroupView + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LinuxUserView: A detailed view of a Linux user account. +type LinuxUserView struct { + // Gecos: [Output Only] The GECOS (user information) entry for this + // account. + Gecos string `json:"gecos,omitempty"` + + // Gid: [Output Only] User's default group ID. + Gid int64 `json:"gid,omitempty"` + + // HomeDirectory: [Output Only] The path to the home directory for this + // account. + HomeDirectory string `json:"homeDirectory,omitempty"` + + // Shell: [Output Only] The path to the login shell for this account. + Shell string `json:"shell,omitempty"` + + // Uid: [Output Only] User ID. + Uid int64 `json:"uid,omitempty"` + + // Username: [Output Only] The username of the account. + Username string `json:"username,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Gecos") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LinuxUserView) MarshalJSON() ([]byte, error) { + type noMethod LinuxUserView + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Operation: An Operation resource, used to manage asynchronous API +// requests. +type Operation struct { + // ClientOperationId: [Output Only] An optional identifier specified by + // the client when the mutation was initiated. Must be unique for all + // Operation resources in the project. + ClientOperationId string `json:"clientOperationId,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // EndTime: [Output Only] The time that this operation was completed. + // This is in RFC3339 text format. + EndTime string `json:"endTime,omitempty"` + + // Error: [Output Only] If errors are generated during processing of the + // operation, this field will be populated. + Error *OperationError `json:"error,omitempty"` + + // HttpErrorMessage: [Output Only] If the operation fails, this field + // contains the HTTP error message that was returned, such as NOT FOUND. + HttpErrorMessage string `json:"httpErrorMessage,omitempty"` + + // HttpErrorStatusCode: [Output Only] If the operation fails, this field + // contains the HTTP error message that was returned, such as 404. + HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // InsertTime: [Output Only] The time that this operation was requested. + // This is in RFC3339 text format. + InsertTime string `json:"insertTime,omitempty"` + + // Kind: [Output Only] Type of the resource. Always compute#operation + // for Operation resources. + Kind string `json:"kind,omitempty"` + + // Name: [Output Only] Name of the resource. + Name string `json:"name,omitempty"` + + // OperationType: [Output Only] Type of the operation, such as insert, + // compute.instanceGroups.update, or compute.instanceGroups.delete. + OperationType string `json:"operationType,omitempty"` + + // Progress: [Output Only] 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 monotonically + // increase as the operation progresses. + Progress int64 `json:"progress,omitempty"` + + // Region: [Output Only] URL of the region where the operation resides. + // Only applicable for regional resources. + Region string `json:"region,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // StartTime: [Output Only] The time that this operation was started by + // the server. This is in RFC3339 text format. + StartTime string `json:"startTime,omitempty"` + + // Status: [Output Only] Status of the operation. Can be one of the + // following: PENDING, RUNNING, or DONE. + // + // Possible values: + // "DONE" + // "PENDING" + // "RUNNING" + Status string `json:"status,omitempty"` + + // StatusMessage: [Output Only] An optional textual description of the + // current status of the operation. + StatusMessage string `json:"statusMessage,omitempty"` + + // TargetId: [Output Only] Unique target ID which identifies a + // particular incarnation of the target. + TargetId uint64 `json:"targetId,omitempty,string"` + + // TargetLink: [Output Only] URL of the resource the operation is + // mutating. + TargetLink string `json:"targetLink,omitempty"` + + // User: [Output Only] User who requested the operation, for example: + // user@example.com. + User string `json:"user,omitempty"` + + // Warnings: [Output Only] If warning messages are generated during + // processing of the operation, this field will be populated. + Warnings []*OperationWarnings `json:"warnings,omitempty"` + + // Zone: [Output Only] URL of the zone where the operation resides. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ClientOperationId") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Operation) MarshalJSON() ([]byte, error) { + type noMethod Operation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationError: [Output Only] If errors are generated during +// processing of the operation, this field will be populated. +type OperationError struct { + // Errors: [Output Only] The array of errors encountered while + // processing this operation. + Errors []*OperationErrorErrors `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationError) MarshalJSON() ([]byte, error) { + type noMethod OperationError + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationErrorErrors struct { + // Code: [Output Only] The error type identifier for this error. + Code string `json:"code,omitempty"` + + // Location: [Output Only] Indicates the field in the request which + // caused the error. This property is optional. + Location string `json:"location,omitempty"` + + // Message: [Output Only] An optional, human-readable error message. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) { + type noMethod OperationErrorErrors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationWarnings struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*OperationWarningsData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationWarnings) MarshalJSON() ([]byte, error) { + type noMethod OperationWarnings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationWarningsData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationWarningsData) MarshalJSON() ([]byte, error) { + type noMethod OperationWarningsData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationList: Contains a list of Operation resources. +type OperationList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] The Operation resources. + Items []*Operation `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#operations for + // Operations resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncate. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationList) MarshalJSON() ([]byte, error) { + type noMethod OperationList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PublicKey: A public key for authenticating to guests. +type PublicKey struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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"` + + // ExpirationTimestamp: Optional expiration timestamp. If provided, the + // timestamp must be in RFC3339 text format. If not provided, the public + // key never expires. + ExpirationTimestamp string `json:"expirationTimestamp,omitempty"` + + // Fingerprint: [Output Only] The fingerprint of the key is defined by + // RFC4716 to be the MD5 digest of the public key. + Fingerprint string `json:"fingerprint,omitempty"` + + // Key: Public key text in SSH format, defined by RFC4253 section 6.6. + Key string `json:"key,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PublicKey) MarshalJSON() ([]byte, error) { + type noMethod PublicKey + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// User: A User resource. +type User struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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"` + + // Groups: [Output Only] A list of URLs to Group resources who contain + // the user. Users are only members of groups in the same project. + Groups []string `json:"groups,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always + // clouduseraccounts#user for users. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource; provided by the client when the resource + // is created. + Name string `json:"name,omitempty"` + + // Owner: Email address of account's owner. This account will be + // validated to make sure it exists. The email can belong to any domain, + // but it must be tied to a Google account. + Owner string `json:"owner,omitempty"` + + // PublicKeys: [Output Only] Public keys that this user may use to + // login. + PublicKeys []*PublicKey `json:"publicKeys,omitempty"` + + // SelfLink: [Output Only] Server defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *User) MarshalJSON() ([]byte, error) { + type noMethod User + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type UserList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of User resources. + Items []*User `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always + // clouduseraccounts#userList for lists of users. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserList) MarshalJSON() ([]byte, error) { + type noMethod UserList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "clouduseraccounts.globalAccountsOperations.delete": + +type GlobalAccountsOperationsDeleteCall struct { + s *Service + project string + operation string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified operation resource. +func (r *GlobalAccountsOperationsService) Delete(project string, operation string) *GlobalAccountsOperationsDeleteCall { + c := &GlobalAccountsOperationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.operation = operation + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalAccountsOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalAccountsOperationsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalAccountsOperationsDeleteCall) Context(ctx context.Context) *GlobalAccountsOperationsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalAccountsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.globalAccountsOperations.delete" call. +func (c *GlobalAccountsOperationsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified operation resource.", + // "httpMethod": "DELETE", + // "id": "clouduseraccounts.globalAccountsOperations.delete", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the Operations resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.globalAccountsOperations.get": + +type GlobalAccountsOperationsGetCall struct { + s *Service + project string + operation string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves the specified operation resource. +func (r *GlobalAccountsOperationsService) Get(project string, operation string) *GlobalAccountsOperationsGetCall { + c := &GlobalAccountsOperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.operation = operation + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalAccountsOperationsGetCall) Fields(s ...googleapi.Field) *GlobalAccountsOperationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalAccountsOperationsGetCall) IfNoneMatch(entityTag string) *GlobalAccountsOperationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalAccountsOperationsGetCall) Context(ctx context.Context) *GlobalAccountsOperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalAccountsOperationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.globalAccountsOperations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GlobalAccountsOperationsGetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified operation resource.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.globalAccountsOperations.get", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the Operations resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.globalAccountsOperations.list": + +type GlobalAccountsOperationsListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of operation resources contained within the +// specified project. +func (r *GlobalAccountsOperationsService) List(project string) *GlobalAccountsOperationsListCall { + c := &GlobalAccountsOperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *GlobalAccountsOperationsListCall) Filter(filter string) *GlobalAccountsOperationsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *GlobalAccountsOperationsListCall) MaxResults(maxResults int64) *GlobalAccountsOperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *GlobalAccountsOperationsListCall) OrderBy(orderBy string) *GlobalAccountsOperationsListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *GlobalAccountsOperationsListCall) PageToken(pageToken string) *GlobalAccountsOperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalAccountsOperationsListCall) Fields(s ...googleapi.Field) *GlobalAccountsOperationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalAccountsOperationsListCall) IfNoneMatch(entityTag string) *GlobalAccountsOperationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalAccountsOperationsListCall) Context(ctx context.Context) *GlobalAccountsOperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalAccountsOperationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.globalAccountsOperations.list" call. +// Exactly one of *OperationList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *OperationList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *GlobalAccountsOperationsListCall) Do() (*OperationList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperationList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of operation resources contained within the specified project.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.globalAccountsOperations.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.groups.addMember": + +type GroupsAddMemberCall struct { + s *Service + project string + groupName string + groupsaddmemberrequest *GroupsAddMemberRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// AddMember: Adds users to the specified group. +func (r *GroupsService) AddMember(project string, groupName string, groupsaddmemberrequest *GroupsAddMemberRequest) *GroupsAddMemberCall { + c := &GroupsAddMemberCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.groupName = groupName + c.groupsaddmemberrequest = groupsaddmemberrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsAddMemberCall) Fields(s ...googleapi.Field) *GroupsAddMemberCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsAddMemberCall) Context(ctx context.Context) *GroupsAddMemberCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsAddMemberCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupsaddmemberrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{groupName}/addMember") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "groupName": c.groupName, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.addMember" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GroupsAddMemberCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds users to the specified group.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.groups.addMember", + // "parameterOrder": [ + // "project", + // "groupName" + // ], + // "parameters": { + // "groupName": { + // "description": "Name of the group for this request.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/groups/{groupName}/addMember", + // "request": { + // "$ref": "GroupsAddMemberRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.groups.delete": + +type GroupsDeleteCall struct { + s *Service + project string + groupName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified Group resource. +func (r *GroupsService) Delete(project string, groupName string) *GroupsDeleteCall { + c := &GroupsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.groupName = groupName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsDeleteCall) Fields(s ...googleapi.Field) *GroupsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsDeleteCall) Context(ctx context.Context) *GroupsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{groupName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "groupName": c.groupName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GroupsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified Group resource.", + // "httpMethod": "DELETE", + // "id": "clouduseraccounts.groups.delete", + // "parameterOrder": [ + // "project", + // "groupName" + // ], + // "parameters": { + // "groupName": { + // "description": "Name of the Group resource to delete.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/groups/{groupName}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.groups.get": + +type GroupsGetCall struct { + s *Service + project string + groupName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified Group resource. +func (r *GroupsService) Get(project string, groupName string) *GroupsGetCall { + c := &GroupsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.groupName = groupName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsGetCall) Fields(s ...googleapi.Field) *GroupsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GroupsGetCall) IfNoneMatch(entityTag string) *GroupsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsGetCall) Context(ctx context.Context) *GroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{groupName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "groupName": c.groupName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.get" call. +// Exactly one of *Group or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Group.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *GroupsGetCall) Do() (*Group, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Group{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified Group resource.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.groups.get", + // "parameterOrder": [ + // "project", + // "groupName" + // ], + // "parameters": { + // "groupName": { + // "description": "Name of the Group resource to return.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/groups/{groupName}", + // "response": { + // "$ref": "Group" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.groups.insert": + +type GroupsInsertCall struct { + s *Service + project string + group *Group + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a Group resource in the specified project using the +// data included in the request. +func (r *GroupsService) Insert(project string, group *Group) *GroupsInsertCall { + c := &GroupsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.group = group + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsInsertCall) Fields(s ...googleapi.Field) *GroupsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsInsertCall) Context(ctx context.Context) *GroupsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GroupsInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a Group resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.groups.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/groups", + // "request": { + // "$ref": "Group" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.groups.list": + +type GroupsListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of groups contained within the specified +// project. +func (r *GroupsService) List(project string) *GroupsListCall { + c := &GroupsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *GroupsListCall) Filter(filter string) *GroupsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *GroupsListCall) MaxResults(maxResults int64) *GroupsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *GroupsListCall) OrderBy(orderBy string) *GroupsListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *GroupsListCall) PageToken(pageToken string) *GroupsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsListCall) Fields(s ...googleapi.Field) *GroupsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GroupsListCall) IfNoneMatch(entityTag string) *GroupsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsListCall) Context(ctx context.Context) *GroupsListCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.list" call. +// Exactly one of *GroupList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *GroupList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GroupsListCall) Do() (*GroupList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &GroupList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of groups contained within the specified project.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.groups.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/groups", + // "response": { + // "$ref": "GroupList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.groups.removeMember": + +type GroupsRemoveMemberCall struct { + s *Service + project string + groupName string + groupsremovememberrequest *GroupsRemoveMemberRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// RemoveMember: Removes users from the specified group. +func (r *GroupsService) RemoveMember(project string, groupName string, groupsremovememberrequest *GroupsRemoveMemberRequest) *GroupsRemoveMemberCall { + c := &GroupsRemoveMemberCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.groupName = groupName + c.groupsremovememberrequest = groupsremovememberrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsRemoveMemberCall) Fields(s ...googleapi.Field) *GroupsRemoveMemberCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsRemoveMemberCall) Context(ctx context.Context) *GroupsRemoveMemberCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsRemoveMemberCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupsremovememberrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/groups/{groupName}/removeMember") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "groupName": c.groupName, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.groups.removeMember" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GroupsRemoveMemberCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Removes users from the specified group.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.groups.removeMember", + // "parameterOrder": [ + // "project", + // "groupName" + // ], + // "parameters": { + // "groupName": { + // "description": "Name of the group for this request.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/groups/{groupName}/removeMember", + // "request": { + // "$ref": "GroupsRemoveMemberRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.linux.getAuthorizedKeysView": + +type LinuxGetAuthorizedKeysViewCall struct { + s *Service + project string + zone string + user string + instance string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetAuthorizedKeysView: Returns a list of authorized public keys for a +// specific user account. +func (r *LinuxService) GetAuthorizedKeysView(project string, zone string, user string, instance string) *LinuxGetAuthorizedKeysViewCall { + c := &LinuxGetAuthorizedKeysViewCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.user = user + c.instance = instance + return c +} + +// Login sets the optional parameter "login": Whether the view was +// requested as part of a user-initiated login. +func (c *LinuxGetAuthorizedKeysViewCall) Login(login bool) *LinuxGetAuthorizedKeysViewCall { + c.opt_["login"] = login + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LinuxGetAuthorizedKeysViewCall) Fields(s ...googleapi.Field) *LinuxGetAuthorizedKeysViewCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LinuxGetAuthorizedKeysViewCall) Context(ctx context.Context) *LinuxGetAuthorizedKeysViewCall { + c.ctx_ = ctx + return c +} + +func (c *LinuxGetAuthorizedKeysViewCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("instance", fmt.Sprintf("%v", c.instance)) + if v, ok := c.opt_["login"]; ok { + params.Set("login", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/authorizedKeysView/{user}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "user": c.user, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.linux.getAuthorizedKeysView" call. +// Exactly one of *LinuxGetAuthorizedKeysViewResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *LinuxGetAuthorizedKeysViewResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *LinuxGetAuthorizedKeysViewCall) Do() (*LinuxGetAuthorizedKeysViewResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LinuxGetAuthorizedKeysViewResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a list of authorized public keys for a specific user account.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.linux.getAuthorizedKeysView", + // "parameterOrder": [ + // "project", + // "zone", + // "user", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "The fully-qualified URL of the virtual machine requesting the view.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "login": { + // "description": "Whether the view was requested as part of a user-initiated login.", + // "location": "query", + // "type": "boolean" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "user": { + // "description": "The user account for which you want to get a list of authorized public keys.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/authorizedKeysView/{user}", + // "response": { + // "$ref": "LinuxGetAuthorizedKeysViewResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.linux.getLinuxAccountViews": + +type LinuxGetLinuxAccountViewsCall struct { + s *Service + project string + zone string + instance string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetLinuxAccountViews: Retrieves a list of user accounts for an +// instance within a specific project. +func (r *LinuxService) GetLinuxAccountViews(project string, zone string, instance string) *LinuxGetLinuxAccountViewsCall { + c := &LinuxGetLinuxAccountViewsCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *LinuxGetLinuxAccountViewsCall) Filter(filter string) *LinuxGetLinuxAccountViewsCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *LinuxGetLinuxAccountViewsCall) MaxResults(maxResults int64) *LinuxGetLinuxAccountViewsCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *LinuxGetLinuxAccountViewsCall) OrderBy(orderBy string) *LinuxGetLinuxAccountViewsCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *LinuxGetLinuxAccountViewsCall) PageToken(pageToken string) *LinuxGetLinuxAccountViewsCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LinuxGetLinuxAccountViewsCall) Fields(s ...googleapi.Field) *LinuxGetLinuxAccountViewsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LinuxGetLinuxAccountViewsCall) Context(ctx context.Context) *LinuxGetLinuxAccountViewsCall { + c.ctx_ = ctx + return c +} + +func (c *LinuxGetLinuxAccountViewsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("instance", fmt.Sprintf("%v", c.instance)) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/linuxAccountViews") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.linux.getLinuxAccountViews" call. +// Exactly one of *LinuxGetLinuxAccountViewsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *LinuxGetLinuxAccountViewsResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *LinuxGetLinuxAccountViewsCall) Do() (*LinuxGetLinuxAccountViewsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LinuxGetLinuxAccountViewsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of user accounts for an instance within a specific project.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.linux.getLinuxAccountViews", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "instance": { + // "description": "The fully-qualified URL of the virtual machine requesting the views.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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 for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/linuxAccountViews", + // "response": { + // "$ref": "LinuxGetLinuxAccountViewsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.users.addPublicKey": + +type UsersAddPublicKeyCall struct { + s *Service + project string + user string + publickey *PublicKey + opt_ map[string]interface{} + ctx_ context.Context +} + +// AddPublicKey: Adds a public key to the specified User resource with +// the data included in the request. +func (r *UsersService) AddPublicKey(project string, user string, publickey *PublicKey) *UsersAddPublicKeyCall { + c := &UsersAddPublicKeyCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.user = user + c.publickey = publickey + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersAddPublicKeyCall) Fields(s ...googleapi.Field) *UsersAddPublicKeyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersAddPublicKeyCall) Context(ctx context.Context) *UsersAddPublicKeyCall { + c.ctx_ = ctx + return c +} + +func (c *UsersAddPublicKeyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.publickey) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{user}/addPublicKey") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "user": c.user, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.addPublicKey" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersAddPublicKeyCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds a public key to the specified User resource with the data included in the request.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.users.addPublicKey", + // "parameterOrder": [ + // "project", + // "user" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "user": { + // "description": "Name of the user for this request.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/users/{user}/addPublicKey", + // "request": { + // "$ref": "PublicKey" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.users.delete": + +type UsersDeleteCall struct { + s *Service + project string + user string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified User resource. +func (r *UsersService) Delete(project string, user string) *UsersDeleteCall { + c := &UsersDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.user = user + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersDeleteCall) Fields(s ...googleapi.Field) *UsersDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersDeleteCall) Context(ctx context.Context) *UsersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{user}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "user": c.user, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified User resource.", + // "httpMethod": "DELETE", + // "id": "clouduseraccounts.users.delete", + // "parameterOrder": [ + // "project", + // "user" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "user": { + // "description": "Name of the user resource to delete.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/users/{user}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.users.get": + +type UsersGetCall struct { + s *Service + project string + user string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified User resource. +func (r *UsersService) Get(project string, user string) *UsersGetCall { + c := &UsersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.user = user + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall { + c.ctx_ = ctx + return c +} + +func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{user}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "user": c.user, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.get" call. +// Exactly one of *User or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *User.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *UsersGetCall) Do() (*User, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &User{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified User resource.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.users.get", + // "parameterOrder": [ + // "project", + // "user" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "user": { + // "description": "Name of the user resource to return.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/users/{user}", + // "response": { + // "$ref": "User" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.users.insert": + +type UsersInsertCall struct { + s *Service + project string + user *User + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a User resource in the specified project using the +// data included in the request. +func (r *UsersService) Insert(project string, user *User) *UsersInsertCall { + c := &UsersInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.user = user + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersInsertCall) Fields(s ...googleapi.Field) *UsersInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersInsertCall) Context(ctx context.Context) *UsersInsertCall { + c.ctx_ = ctx + return c +} + +func (c *UsersInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a User resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.users.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/users", + // "request": { + // "$ref": "User" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} + +// method id "clouduseraccounts.users.list": + +type UsersListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of users contained within the specified +// project. +func (r *UsersService) List(project string) *UsersListCall { + c := &UsersListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *UsersListCall) Filter(filter string) *UsersListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *UsersListCall) MaxResults(maxResults int64) *UsersListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *UsersListCall) OrderBy(orderBy string) *UsersListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *UsersListCall) PageToken(pageToken string) *UsersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersListCall) Context(ctx context.Context) *UsersListCall { + c.ctx_ = ctx + return c +} + +func (c *UsersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.list" call. +// Exactly one of *UserList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *UserList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersListCall) Do() (*UserList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of users contained within the specified project.", + // "httpMethod": "GET", + // "id": "clouduseraccounts.users.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/users", + // "response": { + // "$ref": "UserList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/cloud.useraccounts", + // "https://www.googleapis.com/auth/cloud.useraccounts.readonly" + // ] + // } + +} + +// method id "clouduseraccounts.users.removePublicKey": + +type UsersRemovePublicKeyCall struct { + s *Service + project string + user string + fingerprint string + opt_ map[string]interface{} + ctx_ context.Context +} + +// RemovePublicKey: Removes the specified public key from the user. +func (r *UsersService) RemovePublicKey(project string, user string, fingerprint string) *UsersRemovePublicKeyCall { + c := &UsersRemovePublicKeyCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.user = user + c.fingerprint = fingerprint + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersRemovePublicKeyCall) Fields(s ...googleapi.Field) *UsersRemovePublicKeyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersRemovePublicKeyCall) Context(ctx context.Context) *UsersRemovePublicKeyCall { + c.ctx_ = ctx + return c +} + +func (c *UsersRemovePublicKeyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("fingerprint", fmt.Sprintf("%v", c.fingerprint)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/users/{user}/removePublicKey") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "user": c.user, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "clouduseraccounts.users.removePublicKey" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersRemovePublicKeyCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Removes the specified public key from the user.", + // "httpMethod": "POST", + // "id": "clouduseraccounts.users.removePublicKey", + // "parameterOrder": [ + // "project", + // "user", + // "fingerprint" + // ], + // "parameters": { + // "fingerprint": { + // "description": "The fingerprint of the public key to delete. Public keys are identified by their fingerprint, which is defined by RFC4716 to be the MD5 digest of the public key.", + // "location": "query", + // "pattern": "[a-f0-9]{32}", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "user": { + // "description": "Name of the user for this request.", + // "location": "path", + // "pattern": "[a-z][-a-z0-9_]{0,31}", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/users/{user}/removePublicKey", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud.useraccounts" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/compute/v0.beta/compute-api.json b/Godeps/_workspace/src/google.golang.org/api/compute/v0.beta/compute-api.json new file mode 100644 index 000000000..4a803f043 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/compute/v0.beta/compute-api.json @@ -0,0 +1,14405 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/53Hy10U_as1pSFK_KirJ2eQZmGA\"", + "discoveryVersion": "v1", + "id": "compute:beta", + "name": "compute", + "version": "beta", + "revision": "20151015", + "title": "Compute Engine API", + "description": "API for the Google Compute Engine service.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/compute_engine-16.png", + "x32": "https://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/beta/projects/", + "basePath": "/compute/beta/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "compute/beta/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/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": "[Output Only] Type of the resource. Always compute#accessConfig for access configs.", + "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 external IP address available to the project or leave this field undefined to use an IP from a shared ephemeral IP address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance." + }, + "type": { + "type": "string", + "description": "The type of configuration. The default and only option is ONE_TO_ONE_NAT.", + "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 static external IP address represented by this resource." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#address for addresses.", + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.addresses.insert" + ] + } + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where the regional address resides. This field is not applicable to global addresses." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "status": { + "type": "string", + "description": "[Output Only] The status of the address, which can be either IN_USE or RESERVED. An address that is RESERVED is currently reserved and available to use. An IN_USE address is currently being used by another resource and is not available.", + "enum": [ + "IN_USE", + "RESERVED" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "users": { + "type": "array", + "description": "[Output Only] The URLs of the resources that are using this address.", + "items": { + "type": "string" + } + } + } + }, + "AddressAggregatedList": { + "id": "AddressAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "object", + "description": "[Output Only] A map of scoped address lists.", + "additionalProperties": { + "$ref": "AddressesScopedList", + "description": "[Output Only] Name of the scope containing this set of addresses." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#addressAggregatedList for aggregated lists of addresses.", + "default": "compute#addressAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "AddressList": { + "id": "AddressList", + "type": "object", + "description": "Contains a list of address resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of Address resources.", + "items": { + "$ref": "Address" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#addressList for lists of addresses.", + "default": "compute#addressList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + } + } + }, + "AddressesScopedList": { + "id": "AddressesScopedList", + "type": "object", + "properties": { + "addresses": { + "type": "array", + "description": "[Output Only] List of addresses contained in this scope.", + "items": { + "$ref": "Address" + } + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning which replaces the list of addresses when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "AttachedDisk": { + "id": "AttachedDisk", + "type": "object", + "description": "An instance-attached disk resource.", + "properties": { + "autoDelete": { + "type": "boolean", + "description": "Specifies 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. The virtual machine will use the first partition of the disk for its root filesystem." + }, + "deviceName": { + "type": "string", + "description": "Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance.\n\nIf not specified, the server chooses a default device name to apply to this disk, in the form persistent-disks-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks." + }, + "diskEncryptionKey": { + "$ref": "CustomerEncryptionKey", + "description": "Encrypts or decrypts a disk using a customer-supplied encryption key.\n\nIf you are creating a new disk, this field encrypts the disk using a customer-supplied encryption key. If you are attaching an existing disk that is already encrypted, this field decrypts the disk using the customer-supplied encryption key.\n\nIf you encrypt a new disk using a customer-supplied encryption key, you must provide the same key again when attempting to use this resource at a later time (e.g. to create a snapshot or image from the disk or to attach the disk to a virtual machine).\n\nIf no customer-supplied encryption key is provided at creation, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later." + }, + "index": { + "type": "integer", + "description": "Assigns a zero-based index to this disk, where 0 is reserved for the boot disk. For example, if you have many disks attached to an instance, each disk would have a unique index number. If not specified, the server will choose an appropriate value.", + "format": "int32" + }, + "initializeParams": { + "$ref": "AttachedDiskInitializeParams", + "description": "[Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance.\n\nThis property is mutually exclusive with the source property; you can only define one or the other, but not both." + }, + "interface": { + "type": "string", + "description": "Specifies the disk interface to use for attaching this disk, either SCSI or NVME. The default is SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance.", + "enum": [ + "NVME", + "SCSI" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#attachedDisk for attached disks.", + "default": "compute#attachedDisk" + }, + "licenses": { + "type": "array", + "description": "[Output Only] Any valid publicly visible licenses.", + "items": { + "type": "string" + } + }, + "mode": { + "type": "string", + "description": "The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode.", + "enum": [ + "READ_ONLY", + "READ_WRITE" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "source": { + "type": "string", + "description": "Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks." + }, + "type": { + "type": "string", + "description": "Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.", + "enum": [ + "PERSISTENT", + "SCRATCH" + ], + "enumDescriptions": [ + "", + "" + ], + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + } + } + }, + "AttachedDiskInitializeParams": { + "id": "AttachedDiskInitializeParams", + "type": "object", + "description": "[Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance.\n\nThis property is mutually exclusive with the source property; you can only define one or the other, but not both.", + "properties": { + "diskName": { + "type": "string", + "description": "Specifies the disk name. If not specified, the default is to use the name of the instance." + }, + "diskSizeGb": { + "type": "string", + "description": "Specifies the size of the disk in base-2 GB.", + "format": "int64" + }, + "diskStorageType": { + "type": "string", + "description": "Storage type of the disk.", + "enum": [ + "HDD", + "SSD" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "diskType": { + "type": "string", + "description": "Specifies the disk type to use to create the instance. If not specified, the default is pd-standard, specified using the full URL. For example:\n\nhttps://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard \n\nOther values include pd-ssd and local-ssd. If you define this field, you can provide either the full or partial URL. For example, the following are valid values: \n- https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType \n- projects/project/zones/zone/diskTypes/diskType \n- zones/zone/diskTypes/diskType" + }, + "sourceImage": { + "type": "string", + "description": "A source image used to create the disk. You can provide a private (custom) image, and Compute Engine will use the corresponding image from your project. For example:\n\nglobal/images/my-private-image \n\nOr you can provide an image from a publicly-available project. For example, to use a Debian image from the debian-cloud project, make sure to include the project in the URL:\n\nprojects/debian-cloud/global/images/debian-7-wheezy-vYYYYMMDD \n\nwhere vYYYYMMDD is the image version. The fully-qualified URL will also work in both cases." + }, + "sourceImageEncryptionKey": { + "$ref": "CustomerEncryptionKey", + "description": "The customer-supplied encryption key of the source image. This key is required if the source image is protected by a customer-supplied encryption key.\n\nIf the incorrect key is provided, the operation will fail." + } + } + }, + "Autoscaler": { + "id": "Autoscaler", + "type": "object", + "properties": { + "autoscalingPolicy": { + "$ref": "AutoscalingPolicy", + "description": "Autoscaling configuration." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#autoscaler" + }, + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.instanceGroups.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "target": { + "type": "string", + "description": "URL of Instance Group Manager or Replica Pool which will be controlled by Autoscaler." + }, + "zone": { + "type": "string", + "description": "[Output Only] URL of the zone where the instance group resides." + } + } + }, + "AutoscalerAggregatedList": { + "id": "AutoscalerAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "object", + "description": "A map of scoped autoscaler lists.", + "additionalProperties": { + "$ref": "AutoscalersScopedList", + "description": "Name of the scope containing this set of autoscalers." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#autoscalerAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "AutoscalerList": { + "id": "AutoscalerList", + "type": "object", + "description": "Contains a list of persistent autoscaler resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of Autoscaler resources.", + "items": { + "$ref": "Autoscaler" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#autoscalerList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "AutoscalersScopedList": { + "id": "AutoscalersScopedList", + "type": "object", + "properties": { + "autoscalers": { + "type": "array", + "description": "List of autoscalers contained in this scope.", + "items": { + "$ref": "Autoscaler" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of autoscalers when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "AutoscalingPolicy": { + "id": "AutoscalingPolicy", + "type": "object", + "description": "Cloud Autoscaler policy.", + "properties": { + "coolDownPeriodSec": { + "type": "integer", + "description": "The number of seconds that the Autoscaler should wait between two succeeding changes to the number of virtual machines. You should define an interval that is at least as long as the initialization time of a virtual machine and the time it may take for replica pool to create the virtual machine. The default is 60 seconds.", + "format": "int32" + }, + "cpuUtilization": { + "$ref": "AutoscalingPolicyCpuUtilization", + "description": "TODO(jbartosik): Add support for scaling based on muliple utilization metrics (take max recommendation). Exactly one utilization policy should be provided. Configuration parameters of CPU based autoscaling policy." + }, + "customMetricUtilizations": { + "type": "array", + "description": "Configuration parameters of autoscaling based on custom metric.", + "items": { + "$ref": "AutoscalingPolicyCustomMetricUtilization" + } + }, + "loadBalancingUtilization": { + "$ref": "AutoscalingPolicyLoadBalancingUtilization", + "description": "Configuration parameters of autoscaling based on load balancer." + }, + "maxNumReplicas": { + "type": "integer", + "description": "The maximum number of replicas that the Autoscaler can scale up to. This field is required for config to be effective. Maximum number of replicas should be not lower than minimal number of replicas. Absolute limit for this value is defined in Autoscaler backend.", + "format": "int32" + }, + "minNumReplicas": { + "type": "integer", + "description": "The minimum number of replicas that the Autoscaler can scale down to. Can't be less than 0. If not provided Autoscaler will choose default value depending on maximal number of replicas.", + "format": "int32" + } + } + }, + "AutoscalingPolicyCpuUtilization": { + "id": "AutoscalingPolicyCpuUtilization", + "type": "object", + "description": "CPU utilization policy.", + "properties": { + "utilizationTarget": { + "type": "number", + "description": "The target utilization that the Autoscaler should maintain. It is represented as a fraction of used cores. For example: 6 cores used in 8-core VM are represented here as 0.75. Must be a float value between (0, 1]. If not defined, the default is 0.8.", + "format": "double" + } + } + }, + "AutoscalingPolicyCustomMetricUtilization": { + "id": "AutoscalingPolicyCustomMetricUtilization", + "type": "object", + "description": "Custom utilization metric policy.", + "properties": { + "metric": { + "type": "string", + "description": "Identifier of the metric. It should be a Cloud Monitoring metric. The metric can not have negative values. The metric should be an utilization metric (increasing number of VMs handling requests x times should reduce average value of the metric roughly x times). For example you could use: compute.googleapis.com/instance/network/received_bytes_count." + }, + "utilizationTarget": { + "type": "number", + "description": "Target value of the metric which Autoscaler should maintain. Must be a positive value.", + "format": "double" + }, + "utilizationTargetType": { + "type": "string", + "description": "Defines type in which utilization_target is expressed.", + "enum": [ + "DELTA_PER_MINUTE", + "DELTA_PER_SECOND", + "GAUGE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "AutoscalingPolicyLoadBalancingUtilization": { + "id": "AutoscalingPolicyLoadBalancingUtilization", + "type": "object", + "description": "Load balancing utilization policy.", + "properties": { + "utilizationTarget": { + "type": "number", + "description": "Fraction of backend capacity utilization (set in HTTP load balancing configuration) that Autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8. For example if your maxRatePerInstance capacity (in HTTP Load Balancing configuration) is set at 10 and you would like to keep number of instances such that each instance receives 7 QPS on average, set this to 0.7.", + "format": "double" + } + } + }, + "Backend": { + "id": "Backend", + "type": "object", + "description": "Message containing information of one individual backend.", + "properties": { + "balancingMode": { + "type": "string", + "description": "Specifies the balancing mode for this backend. The default is UTILIZATION but available values are UTILIZATION and RATE.", + "enum": [ + "RATE", + "UTILIZATION" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "capacityScaler": { + "type": "number", + "description": "A multiplier applied to the group's maximum servicing capacity (either UTILIZATION or RATE). Default value is 1, which means the group will serve up to 100% of its configured CPU or RPS (depending on balancingMode). A setting of 0 means the group is completely drained, offering 0% of its available CPU or RPS. Valid range is [0.0,1.0].", + "format": "float" + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource. Provided by the client when the resource is created." + }, + "group": { + "type": "string", + "description": "The fully-qualified URL of a zonal Instance Group resource. This instance group defines the list of instances that serve traffic. Member virtual machine instances from each instance group must live in the same zone as the instance group itself. No two backends in a backend service are allowed to use same Instance Group resource.\n\nNote that you must specify an Instance Group resource using the fully-qualified URL, rather than a partial URL." + }, + "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.0, 1.0].", + "format": "float" + } + } + }, + "BackendService": { + "id": "BackendService", + "type": "object", + "description": "A BackendService resource. This resource defines a group of backend virtual machines 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": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "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": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#backendService for backend services.", + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "port": { + "type": "integer", + "description": "Deprecated in favor of port name. The TCP port to connect on the backend. The default value is 80.", + "format": "int32" + }, + "portName": { + "type": "string", + "description": "Name of backend port. The same name should appear in the resource views referenced by this service. Required." + }, + "protocol": { + "type": "string", + "enum": [ + "HTTP", + "HTTPS" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "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": "[Output Only] Type of resource. Always compute#backendServiceGroupHealth for the health of backend services.", + "default": "compute#backendServiceGroupHealth" + } + } + }, + "BackendServiceList": { + "id": "BackendServiceList", + "type": "object", + "description": "Contains a list of BackendService resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of BackendService resources.", + "items": { + "$ref": "BackendService" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#backendServiceList for lists of backend services.", + "default": "compute#backendServiceList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "CustomerEncryptionKey": { + "id": "CustomerEncryptionKey", + "type": "object", + "description": "Represents a customer-supplied encryption key", + "properties": { + "rawKey": { + "type": "string", + "description": "Specifies a 256-bit customer-supplied encryption key, encoded in base64 to either encrypt or decrypt this resource." + }, + "rsaEncryptedKey": { + "type": "string", + "description": "Specifies a base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.\n\nThe key must meet the following requirements before you can provide it to Compute Engine: \n- The key is wrapped using a RSA public key certificate provided by Google. \n- After being wrapped, the key must be encoded in base64 encoding. Get the RSA public key certificate provided by Google at:\nhttps://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem" + }, + "sha256": { + "type": "string", + "description": "[Output only] The base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource." + } + } + }, + "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": "The URL of the suggested replacement for a deprecated resource. The suggested replacement resource must be the same kind of resource as the deprecated resource." + }, + "state": { + "type": "string", + "description": "The deprecation state of this resource. This 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. Operations which use OBSOLETE or DELETED resources will be rejected and result in an error.", + "enum": [ + "DELETED", + "DEPRECATED", + "OBSOLETE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "Disk": { + "id": "Disk", + "type": "object", + "description": "A Disk resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "diskEncryptionKey": { + "$ref": "CustomerEncryptionKey", + "description": "Encrypts the disk using a customer-supplied encryption key.\n\nIf you encrypt the disk using a customer-supplied encryption key, and you want to use the disk later (e.g. to create a disk snapshot or an image, or to attach the disk to a virtual machine), you must provide the same key in your request. If you provide an incorrect key, or no key, the operation will fail.\n\nCustomer-supplied encryption keys do not protect access to metadata of the disk.\n\nIf no customer-supplied encryption key is provided at creation, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#disk for disks.", + "default": "compute#disk" + }, + "lastAttachTimestamp": { + "type": "string", + "description": "[Output Only] Last attach timestamp in RFC3339 text format." + }, + "lastDetachTimestamp": { + "type": "string", + "description": "[Output Only] Last detach timestamp in RFC3339 text format." + }, + "licenses": { + "type": "array", + "description": "Any applicable publicly visible licenses.", + "items": { + "type": "string" + } + }, + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "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": "[Output Only] Server-defined fully-qualified URL for this resource." + }, + "sizeGb": { + "type": "string", + "description": "Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the sourceImage or sourceSnapshot parameter, or specify it alone to create an empty persistent disk.\n\nIf you specify this field along with sourceImage or sourceSnapshot, the value of sizeGb must not be less than the size of the sourceImage or the size of the snapshot.", + "format": "int64" + }, + "sourceImage": { + "type": "string", + "description": "The source image used to create this disk. If the source image is deleted from the system, this field will not be set, even if an image with the same name has been re-created.\n\nWhen creating a disk, you can provide a private (custom) image using the following input, and Compute Engine will use the corresponding image from your project. For example:\n\nglobal/images/my-private-image \n\nOr you can provide an image from a publicly-available project. For example, to use a Debian image from the debian-cloud project, make sure to include the project in the URL:\n\nprojects/debian-cloud/global/images/debian-7-wheezy-vYYYYMMDD \n\nwhere vYYYYMMDD is the image version. The fully-qualified URL will also work in both cases." + }, + "sourceImageEncryptionKey": { + "$ref": "CustomerEncryptionKey", + "description": "The customer-supplied encryption key of the source image. This key is required if the source image is protected by a customer-supplied encryption key.\n\nIf the incorrect key is provided, the operation will fail." + }, + "sourceImageId": { + "type": "string", + "description": "The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used." + }, + "sourceSnapshot": { + "type": "string", + "description": "The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: \n- https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot \n- projects/project/global/snapshots/snapshot \n- global/snapshots/snapshot" + }, + "sourceSnapshotEncryptionKey": { + "$ref": "CustomerEncryptionKey", + "description": "The customer-supplied encryption key of the source snapshot. This key is required if the source snapshot is protected by a customer-supplied encryption key.\n\nIf the incorrect key is provided, the operation will fail." + }, + "sourceSnapshotId": { + "type": "string", + "description": "[Output Only] The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used." + }, + "status": { + "type": "string", + "description": "[Output Only] The status of disk creation. Applicable statuses includes: CREATING, FAILED, READY, RESTORING.", + "enum": [ + "CREATING", + "FAILED", + "READY", + "RESTORING" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "storageType": { + "type": "string", + "description": "[Deprecated] Storage type of the persistent disk.", + "enum": [ + "HDD", + "SSD" + ], + "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." + }, + "users": { + "type": "array", + "description": "Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance", + "items": { + "type": "string" + } + }, + "zone": { + "type": "string", + "description": "[Output Only] URL of the zone where the disk resides." + } + } + }, + "DiskAggregatedList": { + "id": "DiskAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "object", + "description": "[Output Only] A map of scoped disk lists.", + "additionalProperties": { + "$ref": "DisksScopedList", + "description": "[Output Only] Name of the scope containing this set of disks." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#diskAggregatedList for aggregated lists of persistent disks.", + "default": "compute#diskAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "DiskList": { + "id": "DiskList", + "type": "object", + "description": "A list of Disk resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of persistent disks.", + "items": { + "$ref": "Disk" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#diskList for lists of disks.", + "default": "compute#diskList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "DiskType": { + "id": "DiskType", + "type": "object", + "description": "A disk type resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "defaultDiskSizeGb": { + "type": "string", + "description": "[Output Only] Server-defined default disk size in GB.", + "format": "int64" + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "[Output Only] The deprecation status associated with this disk type." + }, + "description": { + "type": "string", + "description": "[Output Only] An optional textual description of the resource." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#diskType for disk types.", + "default": "compute#diskType" + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "validDiskSize": { + "type": "string", + "description": "[Output Only] An optional textual description of the valid disk size, such as \"10GB-10TB\"." + }, + "zone": { + "type": "string", + "description": "[Output Only] URL of the zone where the disk type resides." + } + } + }, + "DiskTypeAggregatedList": { + "id": "DiskTypeAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "object", + "description": "[Output Only] A map of scoped disk type lists.", + "additionalProperties": { + "$ref": "DiskTypesScopedList", + "description": "[Output Only] Name of the scope containing this set of disk types." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#diskTypeAggregatedList.", + "default": "compute#diskTypeAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "DiskTypeList": { + "id": "DiskTypeList", + "type": "object", + "description": "Contains a list of disk type resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of Disk Type resources.", + "items": { + "$ref": "DiskType" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#diskTypeList for disk types.", + "default": "compute#diskTypeList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "DiskTypesScopedList": { + "id": "DiskTypesScopedList", + "type": "object", + "properties": { + "diskTypes": { + "type": "array", + "description": "[Output Only] List of disk types contained in this scope.", + "items": { + "$ref": "DiskType" + } + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning which replaces the list of disk types when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "DisksScopedList": { + "id": "DisksScopedList", + "type": "object", + "properties": { + "disks": { + "type": "array", + "description": "[Output Only] List of disks contained in this scope.", + "items": { + "$ref": "Disk" + } + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning which replaces the list of disks when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] 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": "The IP protocol that is allowed for this rule. The protocol type is required when creating a firewall. This value 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. This field is only applicable for UDP or TCP protocol. 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": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Ony] Type of the resource. Always compute#firewall for firewall rules.", + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "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 resource for this firewall rule. This field is required for creating an instance but optional when creating a firewall rule. If not specified when creating a firewall rule, the default network is used:\nglobal/networks/default\nIf you choose to specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: \n- https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network \n- projects/myproject/global/networks/my-network \n- global/networks/default" + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "sourceRanges": { + "type": "array", + "description": "The IP address blocks that this rule applies to, expressed in CIDR format. One or both of sourceRanges and sourceTags may be set.\n\nIf both properties are set, an inbound connection is allowed if the range matches the sourceRanges OR the tag of the source matches the sourceTags property. The connection does not need to match both properties.", + "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.\n\nIf both properties are set, an inbound connection is allowed if the range matches the sourceRanges OR the tag of the source matches the sourceTags property. The connection does not need to match both properties.", + "items": { + "type": "string" + } + }, + "targetTags": { + "type": "array", + "description": "A list of instance tags indicating sets of instances located in the network that 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": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of Firewall resources.", + "items": { + "$ref": "Firewall" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#firewallList for lists of firewalls.", + "default": "compute#firewallList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "ForwardingRule": { + "id": "ForwardingRule", + "type": "object", + "description": "A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines 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": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#forwardingRule.", + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "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. Forwarding rules with the same `[IPAddress, IPProtocol]` pair must have disjoint port ranges." + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where the regional forwarding rule resides. This field is not applicable to global forwarding rules." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "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 or TargetHttpsProxy resource." + } + } + }, + "ForwardingRuleAggregatedList": { + "id": "ForwardingRuleAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "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": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "ForwardingRuleList": { + "id": "ForwardingRuleList", + "type": "object", + "description": "Contains a list of ForwardingRule resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Set by the server." + }, + "items": { + "type": "array", + "description": "A list of ForwardingRule resources.", + "items": { + "$ref": "ForwardingRule" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#forwardingRuleList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "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": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] 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." + }, + "port": { + "type": "integer", + "description": "The port on the instance.", + "format": "int32" + } + } + }, + "HostRule": { + "id": "HostRule", + "type": "object", + "description": "UrlMaps A host-matching rule for a URL. If matched, will use the named PathMatcher to select the BackendService.", + "properties": { + "description": { + "type": "string", + "description": "An optional textual description." + }, + "hosts": { + "type": "array", + "description": "The list of host patterns to match. They must be valid hostnames, except * will match any string of ([a-z0-9-.]*). In that case, * must be the first character and must be followed in the pattern by either - or ..", + "items": { + "type": "string" + } + }, + "pathMatcher": { + "type": "string", + "description": "The name of the PathMatcher to use to match the path portion of the URL if the hostRule matches the URL's host portion." + } + } + }, + "HttpHealthCheck": { + "id": "HttpHealthCheck", + "type": "object", + "description": "An HttpHealthCheck resource. This resource defines a template for how individual instances 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": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "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 instance 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": "[Output Only] Unique identifier for the resource. Defined by the server.", + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "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": "[Output Only] Server-defined URL for the resource." + }, + "timeoutSec": { + "type": "integer", + "description": "How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than checkIntervalSec.", + "format": "int32" + }, + "unhealthyThreshold": { + "type": "integer", + "description": "A so-far healthy instance 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": "[Output Only] Unique identifier for the resource. Defined by the server." + }, + "items": { + "type": "array", + "description": "A list of HttpHealthCheck resources.", + "items": { + "$ref": "HttpHealthCheck" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#httpHealthCheckList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "HttpsHealthCheck": { + "id": "HttpsHealthCheck", + "type": "object", + "description": "An HttpsHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTPS.", + "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": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "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 instance 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 HTTPS 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": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#httpsHealthCheck" + }, + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "port": { + "type": "integer", + "description": "The TCP port number for the HTTPS health check request. The default value is 443.", + "format": "int32" + }, + "requestPath": { + "type": "string", + "description": "The request path of the HTTPS health check request. The default value is \"/\"." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "timeoutSec": { + "type": "integer", + "description": "How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have a greater value than checkIntervalSec.", + "format": "int32" + }, + "unhealthyThreshold": { + "type": "integer", + "description": "A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2.", + "format": "int32" + } + } + }, + "HttpsHealthCheckList": { + "id": "HttpsHealthCheckList", + "type": "object", + "description": "Contains a list of HttpsHealthCheck resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of HttpsHealthCheck resources.", + "items": { + "$ref": "HttpsHealthCheck" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#httpsHealthCheckList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "Image": { + "id": "Image", + "type": "object", + "description": "An 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": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "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 persistent disk (in GB).", + "format": "int64" + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "imageEncryptionKey": { + "$ref": "CustomerEncryptionKey", + "description": "Encrypts the image using a customer-supplied encryption key.\n\nIf you encrypt an image using a customer-supplied encryption key, and you want to use the image later (e.g. to create a disk from the image), you must provide the same key used encrypt the image in your future request. If you provide an incorrect key, or no key, the operation will fail.\n\nCustomer-supplied encryption keys do not protect access to metadata of the disk.\n\nIf no customer-supplied encryption key is provided at creation, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the image later." + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#image for images.", + "default": "compute#image" + }, + "licenses": { + "type": "array", + "description": "Any applicable publicly visible licenses.", + "items": { + "type": "string" + } + }, + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + }, + "rawDisk": { + "type": "object", + "description": "The parameters of the raw disk image.", + "properties": { + "containerType": { + "type": "string", + "description": "The format used to encode and transmit the block device, which 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. You must provide either this property or the sourceDisk property but not both.", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + } + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "sourceDisk": { + "type": "string", + "description": "URL of the The source disk used to create this image. This can be a full or valid partial URL. You must provide either this property or the rawDisk.source property but not both to create an image. For example, the following are valid values: \n- https://www.googleapis.com/compute/v1/projects/project/zones/zone/disk/disk \n- projects/project/zones/zone/disk/disk \n- zones/zone/disks/disk" + }, + "sourceDiskEncryptionKey": { + "$ref": "CustomerEncryptionKey", + "description": "Specifies the customer-supplied encryption key of the source disk. This key is required if the source disk is protected by a customer-supplied encryption key.\n\nIf the incorrect key is provided the operation will fail." + }, + "sourceDiskId": { + "type": "string", + "description": "The ID value of the disk used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given disk name." + }, + "sourceType": { + "type": "string", + "description": "The type of the image used to create this disk. The default and only value is RAW", + "default": "RAW", + "enum": [ + "RAW" + ], + "enumDescriptions": [ + "" + ] + }, + "status": { + "type": "string", + "description": "[Output Only] The status of the image. An image can be used to create other resources, such as instances, only after the image has been successfully created and the status is set to READY. Possible values are FAILED, PENDING, or READY.", + "enum": [ + "FAILED", + "PENDING", + "READY" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "ImageList": { + "id": "ImageList", + "type": "object", + "description": "Contains a list of Image resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of Image resources.", + "items": { + "$ref": "Image" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#imageList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "Instance": { + "id": "Instance", + "type": "object", + "description": "An Instance resource.", + "properties": { + "canIpForward": { + "type": "boolean", + "description": "Allows this instance to send and receive packets with non-matching destination or source IPs. This is required if you plan to use this instance to forward routes. For more information, see Enabling IP Forwarding." + }, + "cpuPlatform": { + "type": "string", + "description": "[Output Only] The CPU platform used by this instance." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client 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": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#instance for instances.", + "default": "compute#instance" + }, + "labelFingerprint": { + "type": "string", + "description": "A fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.\n\nTo see the latest fingerprint, make get() request to the instance.", + "format": "byte" + }, + "labels": { + "type": "object", + "description": "Labels to apply to this instance. These can be later modified by the setLabels method. Each label key & value must comply with RFC1035. Label values may be empty.", + "additionalProperties": { + "type": "string" + } + }, + "machineType": { + "type": "string", + "description": "Full or partial URL of the machine type resource to use for this instance. This is provided by the client when the instance is created. For example, the following is a valid partial url:\n\nzones/zone/machineTypes/machine-type", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + }, + "metadata": { + "$ref": "Metadata", + "description": "The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys." + }, + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash." + }, + "networkInterfaces": { + "type": "array", + "description": "An 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.", + "items": { + "$ref": "NetworkInterface" + } + }, + "scheduling": { + "$ref": "Scheduling", + "description": "Scheduling options for this instance." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for this resource." + }, + "serviceAccounts": { + "type": "array", + "description": "A list of service accounts, with their specified scopes, authorized for this instance. Service accounts generate access tokens that can be accessed through the metadata server and used to authenticate applications on the instance. See Authenticating from Google Compute Engine for more information.", + "items": { + "$ref": "ServiceAccount" + } + }, + "status": { + "type": "string", + "description": "[Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, and TERMINATED.", + "enum": [ + "PROVISIONING", + "RUNNING", + "STAGING", + "STOPPED", + "STOPPING", + "SUSPENDED", + "SUSPENDING", + "TERMINATED" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "statusMessage": { + "type": "string", + "description": "[Output Only] An optional, human-readable explanation of the status." + }, + "tags": { + "$ref": "Tags", + "description": "A list of tags to appy to this instance. Tags are used to identify valid sources or targets for network firewalls and are specified by the client during 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": "[Output Only] URL of the zone where the instance resides." + } + } + }, + "InstanceAggregatedList": { + "id": "InstanceAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "object", + "description": "[Output Only] A map of scoped instance lists.", + "additionalProperties": { + "$ref": "InstancesScopedList", + "description": "Name of the scope containing this set of instances." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#instanceAggregatedList for aggregated lists of Instance resources.", + "default": "compute#instanceAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for this resource." + } + } + }, + "InstanceGroup": { + "id": "InstanceGroup", + "type": "object", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] The creation timestamp for this instance group in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional text description for the instance group." + }, + "fingerprint": { + "type": "string", + "description": "[Output Only] The fingerprint of the named ports. The system uses this fingerprint to detect conflicts when multiple users change the named ports concurrently.", + "format": "byte" + }, + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this resource type. The server generates this identifier.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceGroup for instance groups.", + "default": "compute#instanceGroup" + }, + "name": { + "type": "string", + "description": "The name of the instance group. 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.instanceGroupManagers.insert" + ] + } + }, + "namedPorts": { + "type": "array", + "description": "Assigns a name to a port number. For example: {name: \"http\", port: 80}\n\nThis allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: \"http\", port: 80},{name: \"http\", port: 8080}] \n\nNamed ports apply to all instances in this instance group.", + "items": { + "$ref": "NamedPort" + } + }, + "network": { + "type": "string", + "description": "[Output Only] The URL of the network to which all instances in the instance group belong." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this instance group. The server generates this URL." + }, + "size": { + "type": "integer", + "description": "[Output Only] The total number of instances in the instance group.", + "format": "int32" + }, + "zone": { + "type": "string", + "description": "[Output Only] The URL of the zone where the instance group is located." + } + } + }, + "InstanceGroupAggregatedList": { + "id": "InstanceGroupAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this aggregated list of instance groups. The server generates this identifier." + }, + "items": { + "type": "object", + "description": "A map of scoped instance group lists.", + "additionalProperties": { + "$ref": "InstanceGroupsScopedList", + "description": "The name of the scope that contains this set of instance groups." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceGroupAggregatedList for aggregated lists of instance groups.", + "default": "compute#instanceGroupAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token that is used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this resource type. The server generates this URL." + } + } + }, + "InstanceGroupList": { + "id": "InstanceGroupList", + "type": "object", + "description": "A list of InstanceGroup resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this list of instance groups. The server generates this identifier." + }, + "items": { + "type": "array", + "description": "A list of instance groups.", + "items": { + "$ref": "InstanceGroup" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceGroupList for instance group lists.", + "default": "compute#instanceGroupList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token that is used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this resource type. The server generates this URL." + } + } + }, + "InstanceGroupManager": { + "id": "InstanceGroupManager", + "type": "object", + "description": "InstanceGroupManagers\n\nNext available tag: 19", + "properties": { + "autoHealingPolicies": { + "type": "array", + "description": "The autohealing policy for this managed instance group. You can specify only one value.", + "items": { + "$ref": "InstanceGroupManagerAutoHealingPolicy" + } + }, + "baseInstanceName": { + "type": "string", + "description": "The base instance name to use for instances in this group. The value must be 1-58 characters long. Instances are named by appending a hyphen and a random four-character string to the base instance name. The base instance name must comply with RFC1035.", + "pattern": "[a-z][-a-z0-9]{0,57}", + "annotations": { + "required": [ + "compute.instanceGroupManagers.insert" + ] + } + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] The creation timestamp for this managed instance group in RFC3339 text format." + }, + "currentActions": { + "$ref": "InstanceGroupManagerActionsSummary", + "description": "[Output Only] The list of instance actions and the number of instances in this managed instance group that are scheduled for each of those actions." + }, + "description": { + "type": "string", + "description": "An optional text description for the managed instance group." + }, + "fingerprint": { + "type": "string", + "description": "[Output Only] The fingerprint of the target pools information. You can use this optional field for optimistic locking when you update the target pool entries.", + "format": "byte" + }, + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this resource type. The server generates this identifier.", + "format": "uint64" + }, + "instanceGroup": { + "type": "string", + "description": "[Output Only] The URL of the Instance Group resource." + }, + "instanceTemplate": { + "type": "string", + "description": "The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group.", + "annotations": { + "required": [ + "compute.instanceGroupManagers.insert" + ] + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups.", + "default": "compute#instanceGroupManager" + }, + "name": { + "type": "string", + "description": "The name of the managed instance group. 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.instanceGroupManagers.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this managed instance group. The server defines this URL." + }, + "targetPools": { + "type": "array", + "description": "The URLs for all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group.", + "items": { + "type": "string" + } + }, + "targetSize": { + "type": "integer", + "description": "The target number of running instances for this managed instance group. Deleting or abandoning instances reduces this number. Resizing the group changes this number.", + "format": "int32", + "annotations": { + "required": [ + "compute.instanceGroupManagers.insert" + ] + } + }, + "zone": { + "type": "string", + "description": "The name of the zone where the managed instance group is located." + } + } + }, + "InstanceGroupManagerActionsSummary": { + "id": "InstanceGroupManagerActionsSummary", + "type": "object", + "properties": { + "abandoning": { + "type": "integer", + "description": "[Output Only] The total number of instances in the managed instance group that are scheduled to be abandoned. Abandoning an instance removes it from the managed instance group without deleting it.", + "format": "int32" + }, + "creating": { + "type": "integer", + "description": "[Output Only] The number of instances in the managed instance group that are scheduled to be created or are currently being created.", + "format": "int32" + }, + "deleting": { + "type": "integer", + "description": "[Output Only] The number of instances in the managed instance group that are scheduled to be deleted or are currently being deleted.", + "format": "int32" + }, + "none": { + "type": "integer", + "description": "[Output Only] The number of instances in the managed instance group that are running and have no scheduled actions.", + "format": "int32" + }, + "recreating": { + "type": "integer", + "description": "[Output Only] The number of instances in the managed instance group that are scheduled to be recreated or are currently being being recreated. Recreating an instance deletes the existing root persistent disk and creates a new disk from the image that is defined in the instance template.", + "format": "int32" + }, + "refreshing": { + "type": "integer", + "description": "[Output Only] The number of instances in the managed instance group that are being reconfigured with properties that do not require a restart or a recreate action. For example, setting or removing target pools for the instance.", + "format": "int32" + }, + "restarting": { + "type": "integer", + "description": "[Output Only] The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted.", + "format": "int32" + } + } + }, + "InstanceGroupManagerAggregatedList": { + "id": "InstanceGroupManagerAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this aggregated list of managed instance groups. The server generates this identifier." + }, + "items": { + "type": "object", + "description": "[Output Only] A map of filtered managed instance group lists.", + "additionalProperties": { + "$ref": "InstanceGroupManagersScopedList", + "description": "[Output Only] The name of the scope that contains this set of managed instance groups." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceGroupManagerAggregatedList for an aggregated list of managed instance groups.", + "default": "compute#instanceGroupManagerAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token that is used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this resource type. The server generates this URL." + } + } + }, + "InstanceGroupManagerAutoHealingPolicy": { + "id": "InstanceGroupManagerAutoHealingPolicy", + "type": "object", + "properties": { + "actionType": { + "type": "string", + "description": "The action to perform when an instance in this group becomes unhealthy. Possible values are RECREATE or RESTART. RECREATE replaces an unhealthy instance using the same name and instance template as the unhealthy instance. RESTART performs a soft restart on an instance. If the instance cannot reboot, the instance performs a hard restart.", + "enum": [ + "RECREATE", + "RESTART" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "healthCheck": { + "type": "string", + "description": "The URL for the HealthCheck that signals autohealing." + } + } + }, + "InstanceGroupManagerList": { + "id": "InstanceGroupManagerList", + "type": "object", + "description": "[Output Only] A list of managed instance groups.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this resource type. The server generates this identifier." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of managed instance groups.", + "items": { + "$ref": "InstanceGroupManager" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceGroupManagerList for a list of managed instance groups.", + "default": "compute#instanceGroupManagerList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token that is used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this resource type. The server generates this URL." + } + } + }, + "InstanceGroupManagersAbandonInstancesRequest": { + "id": "InstanceGroupManagersAbandonInstancesRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "The URL for one or more instances to abandon from the managed instance group.", + "items": { + "type": "string" + } + } + } + }, + "InstanceGroupManagersDeleteInstancesRequest": { + "id": "InstanceGroupManagersDeleteInstancesRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "The list of instances to delete from this managed instance group. Specify one or more instance URLs.", + "items": { + "type": "string" + } + } + } + }, + "InstanceGroupManagersListManagedInstancesResponse": { + "id": "InstanceGroupManagersListManagedInstancesResponse", + "type": "object", + "properties": { + "managedInstances": { + "type": "array", + "description": "[Output Only] The list of instances in the managed instance group.", + "items": { + "$ref": "ManagedInstance" + } + } + } + }, + "InstanceGroupManagersRecreateInstancesRequest": { + "id": "InstanceGroupManagersRecreateInstancesRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "The URL for one or more instances to recreate.", + "items": { + "type": "string" + } + } + } + }, + "InstanceGroupManagersScopedList": { + "id": "InstanceGroupManagersScopedList", + "type": "object", + "properties": { + "instanceGroupManagers": { + "type": "array", + "description": "[Output Only] The list of managed instance groups that are contained in the specified project and zone.", + "items": { + "$ref": "InstanceGroupManager" + } + }, + "warning": { + "type": "object", + "description": "[Output Only] The warning that replaces the list of managed instance groups when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "InstanceGroupManagersSetAutoHealingRequest": { + "id": "InstanceGroupManagersSetAutoHealingRequest", + "type": "object", + "properties": { + "autoHealingPolicies": { + "type": "array", + "items": { + "$ref": "InstanceGroupManagerAutoHealingPolicy" + } + } + } + }, + "InstanceGroupManagersSetInstanceTemplateRequest": { + "id": "InstanceGroupManagersSetInstanceTemplateRequest", + "type": "object", + "properties": { + "instanceTemplate": { + "type": "string", + "description": "The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group." + } + } + }, + "InstanceGroupManagersSetTargetPoolsRequest": { + "id": "InstanceGroupManagersSetTargetPoolsRequest", + "type": "object", + "properties": { + "fingerprint": { + "type": "string", + "description": "The fingerprint of the target pools information. Use this optional property to prevent conflicts when multiple users change the target pools settings concurrently. Obtain the fingerprint with the instanceGroupManagers.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request.", + "format": "byte" + }, + "targetPools": { + "type": "array", + "description": "The list of target pool URLs that instances in this managed instance group belong to. The managed instance group applies these target pools to all of the instances in the group. Existing instances and new instances in the group all receive these target pool settings.", + "items": { + "type": "string" + } + } + } + }, + "InstanceGroupsAddInstancesRequest": { + "id": "InstanceGroupsAddInstancesRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "The list of instances to add to the instance group.", + "items": { + "$ref": "InstanceReference" + } + } + } + }, + "InstanceGroupsListInstances": { + "id": "InstanceGroupsListInstances", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this list of instance groups. The server generates this identifier." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of instances and any named ports that are assigned to those instances.", + "items": { + "$ref": "InstanceWithNamedPorts" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceGroupsListInstances for lists of instance groups.", + "default": "compute#instanceGroupsListInstances" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token that is used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this list of instance groups. The server generates this URL." + } + } + }, + "InstanceGroupsListInstancesRequest": { + "id": "InstanceGroupsListInstancesRequest", + "type": "object", + "properties": { + "instanceState": { + "type": "string", + "description": "A filter for the state of the instances in the instance group. Valid options are ALL or RUNNING. If you do not specify this parameter the list includes all instances regardless of their state.", + "enum": [ + "ALL", + "RUNNING" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "InstanceGroupsRemoveInstancesRequest": { + "id": "InstanceGroupsRemoveInstancesRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "The list of instances to remove from the instance group.", + "items": { + "$ref": "InstanceReference" + } + } + } + }, + "InstanceGroupsScopedList": { + "id": "InstanceGroupsScopedList", + "type": "object", + "properties": { + "instanceGroups": { + "type": "array", + "description": "[Output Only] The list of instance groups that are contained in this scope.", + "items": { + "$ref": "InstanceGroup" + } + }, + "warning": { + "type": "object", + "description": "[Output Only] An informational warning that replaces the list of instance groups when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "InstanceGroupsSetNamedPortsRequest": { + "id": "InstanceGroupsSetNamedPortsRequest", + "type": "object", + "properties": { + "fingerprint": { + "type": "string", + "description": "The fingerprint of the named ports information for this instance group. Use this optional property to prevent conflicts when multiple users change the named ports settings concurrently. Obtain the fingerprint with the instanceGroups.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request.", + "format": "byte" + }, + "namedPorts": { + "type": "array", + "description": "The list of named ports to set for this instance group.", + "items": { + "$ref": "NamedPort" + } + } + } + }, + "InstanceList": { + "id": "InstanceList", + "type": "object", + "description": "Contains a list of instance resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of Instance resources.", + "items": { + "$ref": "Instance" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#instanceList for lists of Instance resources.", + "default": "compute#instanceList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for this resource." + } + } + }, + "InstanceProperties": { + "id": "InstanceProperties", + "type": "object", + "description": "", + "properties": { + "canIpForward": { + "type": "boolean", + "description": "Enables instances created based on this template to send packets with source IP addresses other than their own and receive packets with destination IP addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, specify true. If unsure, leave this set to false. See the canIpForward documentation for more information." + }, + "description": { + "type": "string", + "description": "An optional text description for the instances that are created from this instance template." + }, + "disks": { + "type": "array", + "description": "An array of disks that are associated with the instances that are created from this template.", + "items": { + "$ref": "AttachedDisk" + } + }, + "machineType": { + "type": "string", + "description": "The machine type to use for instances that are created from this template.", + "annotations": { + "required": [ + "compute.instanceTemplates.insert" + ] + } + }, + "metadata": { + "$ref": "Metadata", + "description": "The metadata key/value pairs to assign to instances that are created from this template. These pairs can consist of custom metadata or predefined keys. See Project and instance metadata for more information." + }, + "networkInterfaces": { + "type": "array", + "description": "An array of network access configurations for this interface.", + "items": { + "$ref": "NetworkInterface" + } + }, + "scheduling": { + "$ref": "Scheduling", + "description": "Specifies the scheduling options for the instances that are created from this template." + }, + "serviceAccounts": { + "type": "array", + "description": "A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from this template. Use metadata queries to obtain the access tokens for these instances.", + "items": { + "$ref": "ServiceAccount" + } + }, + "tags": { + "$ref": "Tags", + "description": "A list of tags to apply to the instances that are created from this template. The tags identify valid sources or targets for network firewalls. The setTags method can modify this list of tags. Each tag within the list must comply with RFC1035." + } + } + }, + "InstanceReference": { + "id": "InstanceReference", + "type": "object", + "properties": { + "instance": { + "type": "string", + "description": "The URL for a specific instance." + } + } + }, + "InstanceTemplate": { + "id": "InstanceTemplate", + "type": "object", + "description": "An Instance Template resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] The creation timestamp for this instance template in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional text description for the instance template." + }, + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this instance template. The server defines this identifier.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceTemplate for instance templates.", + "default": "compute#instanceTemplate" + }, + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.instanceTemplates.insert" + ] + } + }, + "properties": { + "$ref": "InstanceProperties", + "description": "The instance properties for this instance template." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this instance template. The server defines this URL." + } + } + }, + "InstanceTemplateList": { + "id": "InstanceTemplateList", + "type": "object", + "description": "A list of instance templates.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this instance template. The server defines this identifier." + }, + "items": { + "type": "array", + "description": "[Output Only] list of InstanceTemplate resources.", + "items": { + "$ref": "InstanceTemplate" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceTemplatesListResponse for instance template lists.", + "default": "compute#instanceTemplateList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token that is used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this instance template list. The server defines this URL." + } + } + }, + "InstanceWithNamedPorts": { + "id": "InstanceWithNamedPorts", + "type": "object", + "properties": { + "instance": { + "type": "string", + "description": "[Output Only] The URL of the instance." + }, + "namedPorts": { + "type": "array", + "description": "[Output Only] The named ports that belong to this instance group.", + "items": { + "$ref": "NamedPort" + } + }, + "status": { + "type": "string", + "description": "[Output Only] The status of the instance.", + "enum": [ + "PROVISIONING", + "RUNNING", + "STAGING", + "STOPPED", + "STOPPING", + "SUSPENDED", + "SUSPENDING", + "TERMINATED" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "InstancesScopedList": { + "id": "InstancesScopedList", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "[Output Only] List of instances contained in this scope.", + "items": { + "$ref": "Instance" + } + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning which replaces the list of instances when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "InstancesSetLabelsRequest": { + "id": "InstancesSetLabelsRequest", + "type": "object", + "properties": { + "labelFingerprint": { + "type": "string", + "format": "byte" + }, + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "InstancesSetMachineTypeRequest": { + "id": "InstancesSetMachineTypeRequest", + "type": "object", + "properties": { + "machineType": { + "type": "string", + "description": "Full or partial URL of the machine type resource. See Instance.machine_type." + } + } + }, + "License": { + "id": "License", + "type": "object", + "description": "A license resource.", + "properties": { + "chargesUseFee": { + "type": "boolean", + "description": "If true, the customer will be charged license fee for running software that contains this license on an instance." + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#license for licenses.", + "default": "compute#license" + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource. The name is 1-63 characters long and complies with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + } + } + }, + "MachineType": { + "id": "MachineType", + "type": "object", + "description": "A Machine Type resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "[Output Only] The deprecation status associated with this machine type." + }, + "description": { + "type": "string", + "description": "[Output Only] An optional textual description of the resource." + }, + "guestCpus": { + "type": "integer", + "description": "[Output Only] The tumber of CPUs exposed to the instance.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#machineType" + }, + "maximumPersistentDisks": { + "type": "integer", + "description": "[Output Only] Maximum persistent disks allowed.", + "format": "int32" + }, + "maximumPersistentDisksSizeGb": { + "type": "string", + "description": "[Output Only] Maximum total persistent disks size (GB) allowed.", + "format": "int64" + }, + "memoryMb": { + "type": "integer", + "description": "[Output Only] The amount of physical memory available to the instance, defined in MB.", + "format": "int32" + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "zone": { + "type": "string", + "description": "[Output Only] The name of the zone where the machine type resides, such as us-central1-a." + } + } + }, + "MachineTypeAggregatedList": { + "id": "MachineTypeAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "object", + "description": "[Output Only] A map of scoped machine type lists.", + "additionalProperties": { + "$ref": "MachineTypesScopedList", + "description": "[Output Only] Name of the scope containing this set of machine types." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#machineTypeAggregatedList for aggregated lists of machine types.", + "default": "compute#machineTypeAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "MachineTypeList": { + "id": "MachineTypeList", + "type": "object", + "description": "Contains a list of Machine Type resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of Machine Type resources.", + "items": { + "$ref": "MachineType" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#machineTypeList for lists of machine types.", + "default": "compute#machineTypeList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "MachineTypesScopedList": { + "id": "MachineTypesScopedList", + "type": "object", + "properties": { + "machineTypes": { + "type": "array", + "description": "[Output Only] List of machine types contained in this scope.", + "items": { + "$ref": "MachineType" + } + }, + "warning": { + "type": "object", + "description": "[Output Only] An informational warning that appears when the machine types list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "ManagedInstance": { + "id": "ManagedInstance", + "type": "object", + "properties": { + "currentAction": { + "type": "string", + "description": "[Output Only] The current action that the managed instance group has scheduled for the instance. Possible values: \n- NONE The instance is running, and the managed instance group does not have any scheduled actions for this instance. \n- CREATING The managed instance group is creating this instance. \n- RECREATING The managed instance group is recreating this instance. \n- DELETING The managed instance group is permanently deleting this instance. \n- ABANDONING The managed instance group is abandoning this instance. The instance will be removed from the instance group and from any target pools that are associated with this group. \n- RESTARTING The managed instance group is restarting the instance. \n- REFRESHING The managed instance group is applying configuration changes to the instance without stopping it. For example, the group can update the target pool list for an instance without stopping that instance.", + "enum": [ + "ABANDONING", + "CREATING", + "DELETING", + "NONE", + "RECREATING", + "REFRESHING", + "RESTARTING" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "id": { + "type": "string", + "description": "[Output only] The unique identifier for this resource. This field is empty when instance does not exist.", + "format": "uint64" + }, + "instance": { + "type": "string", + "description": "[Output Only] The URL of the instance. The URL can exist even if the instance has not yet been created." + }, + "instanceStatus": { + "type": "string", + "description": "[Output Only] The status of the instance. This field is empty when the instance does not exist.", + "enum": [ + "PROVISIONING", + "RUNNING", + "STAGING", + "STOPPED", + "STOPPING", + "SUSPENDED", + "SUSPENDING", + "TERMINATED" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "lastAttempt": { + "$ref": "ManagedInstanceLastAttempt", + "description": "[Output Only] Information about the last attempt to create or delete the instance." + } + } + }, + "ManagedInstanceLastAttempt": { + "id": "ManagedInstanceLastAttempt", + "type": "object", + "properties": { + "errors": { + "type": "object", + "description": "[Output Only] Encountered errors during the last attempt to create or delete the instance.", + "properties": { + "errors": { + "type": "array", + "description": "[Output Only] The array of errors encountered while processing this operation.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The error type identifier for this error." + }, + "location": { + "type": "string", + "description": "[Output Only] Indicates the field in the request which caused the error. This property is optional." + }, + "message": { + "type": "string", + "description": "[Output Only] An optional, human-readable error message." + } + } + } + } + } + } + } + }, + "Metadata": { + "id": "Metadata", + "type": "object", + "description": "A metadata key/value entry.", + "properties": { + "fingerprint": { + "type": "string", + "description": "Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change 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": "[Output Only] Type of the resource. Always compute#metadata for metadata.", + "default": "compute#metadata" + } + } + }, + "NamedPort": { + "id": "NamedPort", + "type": "object", + "description": "The named port. For example: .", + "properties": { + "name": { + "type": "string", + "description": "The name for this named port. The name must be 1-63 characters long, and comply with RFC1035." + }, + "port": { + "type": "integer", + "description": "The port number, which can be a value between 1 and 65535.", + "format": "int32" + } + } + }, + "Network": { + "id": "Network", + "type": "object", + "description": "A network resource.", + "properties": { + "IPv4Range": { + "type": "string", + "description": "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}" + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource. Provided by the client when the resource is created." + }, + "gatewayIPv4": { + "type": "string", + "description": "A gateway address for default routing to other networks. This value is read only and is selected by the Google Compute Engine, typically as the first usable address in the IPv4Range.", + "pattern": "[0-9]{1,3}(?:\\.[0-9]{1,3}){3}" + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#network for networks.", + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.networks.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + } + } + }, + "NetworkInterface": { + "id": "NetworkInterface", + "type": "object", + "description": "A network interface resource attached to an instance.", + "properties": { + "accessConfigs": { + "type": "array", + "description": "An array of configurations for this interface. 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": "[Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc." + }, + "network": { + "type": "string", + "description": "URL of the network resource for this instance. This is required for creating an instance but optional when creating a firewall rule. If not specified when creating a firewall rule, the default network is used:\n\nglobal/networks/default \n\nIf you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: \n- https://www.googleapis.com/compute/v1/projects/project/global/networks/network \n- projects/project/global/networks/network \n- global/networks/default", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + }, + "networkIP": { + "type": "string", + "description": "[Output Only] An optional IPV4 internal network address assigned to the instance for this network interface." + } + } + }, + "NetworkList": { + "id": "NetworkList", + "type": "object", + "description": "Contains a list of Network resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of Network resources.", + "items": { + "$ref": "Network" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#networkList for lists of networks.", + "default": "compute#networkList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource ." + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "description": "An Operation resource, used to manage asynchronous API requests.", + "properties": { + "clientOperationId": { + "type": "string", + "description": "[Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all Operation resources in the project." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "endTime": { + "type": "string", + "description": "[Output Only] The time that this operation was completed. This is in RFC3339 text format." + }, + "error": { + "type": "object", + "description": "[Output Only] If errors are generated during processing of the operation, this field will be populated.", + "properties": { + "errors": { + "type": "array", + "description": "[Output Only] The array of errors encountered while processing this operation.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The error type identifier for this error." + }, + "location": { + "type": "string", + "description": "[Output Only] Indicates the field in the request which caused the error. This property is optional." + }, + "message": { + "type": "string", + "description": "[Output Only] An optional, human-readable error message." + } + } + } + } + } + }, + "httpErrorMessage": { + "type": "string", + "description": "[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND." + }, + "httpErrorStatusCode": { + "type": "integer", + "description": "[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as 404.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "[Output Only] The time that this operation was requested. This is in RFC3339 text format." + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#operation for Operation resources.", + "default": "compute#operation" + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource." + }, + "operationType": { + "type": "string", + "description": "[Output Only] Type of the operation, such as insert, compute.instanceGroups.update, or compute.instanceGroups.delete." + }, + "progress": { + "type": "integer", + "description": "[Output Only] 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 monotonically increase as the operation progresses.", + "format": "int32" + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where the operation resides. Only applicable for regional resources." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "startTime": { + "type": "string", + "description": "[Output Only] The time that this operation was started by the server. This is in RFC3339 text format." + }, + "status": { + "type": "string", + "description": "[Output Only] Status of the operation. Can be one of the following: PENDING, RUNNING, or DONE.", + "enum": [ + "DONE", + "PENDING", + "RUNNING" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "statusMessage": { + "type": "string", + "description": "[Output Only] An optional textual description of the current status of the operation." + }, + "targetId": { + "type": "string", + "description": "[Output Only] Unique target ID which identifies a particular incarnation of the target.", + "format": "uint64" + }, + "targetLink": { + "type": "string", + "description": "[Output Only] URL of the resource the operation is mutating." + }, + "user": { + "type": "string", + "description": "[Output Only] User who requested the operation, for example: user@example.com." + }, + "warnings": { + "type": "array", + "description": "[Output Only] If warning messages are generated during processing of the operation, this field will be populated.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + }, + "zone": { + "type": "string", + "description": "[Output Only] URL of the zone where the operation resides." + } + } + }, + "OperationAggregatedList": { + "id": "OperationAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "object", + "description": "[Output Only] A map of scoped operation lists.", + "additionalProperties": { + "$ref": "OperationsScopedList", + "description": "[Output Only] Name of the scope containing this set of operations." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#operationAggregatedList for aggregated lists of operations.", + "default": "compute#operationAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "OperationList": { + "id": "OperationList", + "type": "object", + "description": "Contains a list of Operation resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] The Operation resources.", + "items": { + "$ref": "Operation" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#operations for Operations resource.", + "default": "compute#operationList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncate." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "OperationsScopedList": { + "id": "OperationsScopedList", + "type": "object", + "properties": { + "operations": { + "type": "array", + "description": "[Output Only] List of operations contained in this scope.", + "items": { + "$ref": "Operation" + } + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning which replaces the list of operations when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] 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", + "description": "An optional textual description of the resource." + }, + "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 only be created in the Google Developers 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. See Custom metadata for more information." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource." + }, + "enabledFeatures": { + "type": "array", + "description": "Restricted features enabled for use on this project.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#project for projects.", + "default": "compute#project" + }, + "name": { + "type": "string", + "description": "Name of the resource." + }, + "quotas": { + "type": "array", + "description": "[Output Only] Quotas assigned to this project.", + "items": { + "$ref": "Quota" + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "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": "[Output Only] Quota limit for this metric.", + "format": "double" + }, + "metric": { + "type": "string", + "description": "[Output Only] Name of the quota metric.", + "enum": [ + "BACKEND_SERVICES", + "CPUS", + "DISKS_TOTAL_GB", + "FIREWALLS", + "FORWARDING_RULES", + "HEALTH_CHECKS", + "IMAGES", + "INSTANCES", + "INSTANCE_GROUPS", + "INSTANCE_GROUP_MANAGERS", + "INSTANCE_TEMPLATES", + "IN_USE_ADDRESSES", + "LOCAL_SSD_TOTAL_GB", + "NETWORKS", + "ROUTES", + "SNAPSHOTS", + "SSD_TOTAL_GB", + "STATIC_ADDRESSES", + "TARGET_HTTP_PROXIES", + "TARGET_INSTANCES", + "TARGET_POOLS", + "TARGET_VPN_GATEWAYS", + "URL_MAPS", + "VPN_TUNNELS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "usage": { + "type": "number", + "description": "[Output Only] Current usage of this metric.", + "format": "double" + } + } + }, + "Region": { + "id": "Region", + "type": "object", + "description": "Region resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "[Output Only] The deprecation status associated with this region." + }, + "description": { + "type": "string", + "description": "[Output Only] Textual description of the resource." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server .", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#region for regions.", + "default": "compute#region" + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource." + }, + "quotas": { + "type": "array", + "description": "[Output Only] Quotas assigned to this region.", + "items": { + "$ref": "Quota" + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "status": { + "type": "string", + "description": "[Output Only] Status of the region, either UP or DOWN.", + "enum": [ + "DOWN", + "UP" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "zones": { + "type": "array", + "description": "[Output Only] A list of zones available 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": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of Region resources.", + "items": { + "$ref": "Region" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#regionList for lists of regions.", + "default": "compute#regionList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "ResourceGroupReference": { + "id": "ResourceGroupReference", + "type": "object", + "properties": { + "group": { + "type": "string", + "description": "A URI referencing one of the resource views listed in the backend service." + } + } + }, + "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 instances by tag and the set of Routes for a particular instance is called its routing table. For each packet leaving a instance, the system searches that instance'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 nextHop field of the winning Route -- either to another instance destination, a instance gateway or a Google Compute Engien-operated gateway. Packets that do not match any Route in the sending instance's routing table are dropped.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource. Provided by the client when the resource is created." + }, + "destRange": { + "type": "string", + "description": "The destination range of outgoing packets that this route applies to.", + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of this resource. Always compute#routes for Route resources.", + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "network": { + "type": "string", + "description": "Fully-qualified URL of the network that this route applies to.", + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "nextHopGateway": { + "type": "string", + "description": "The URL to a gateway that should handle matching packets. Currently, this is only the internet gateway: projects/\u003cproject-id\u003e/global/gateways/default-internet-gateway" + }, + "nextHopInstance": { + "type": "string", + "description": "The fully-qualified URL to an instance that should handle matching packets. For example:\nhttps://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/" + }, + "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." + }, + "nextHopVpnTunnel": { + "type": "string", + "description": "The URL to a VpnTunnel that 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. Default value is 1000. A valid range is between 0 and 65535.", + "format": "uint32", + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined fully-qualified URL for this resource." + }, + "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": "[Output Only] If potential misconfigurations are detected for this route, this field will be populated with warning messages.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + } + }, + "RouteList": { + "id": "RouteList", + "type": "object", + "description": "Contains a list of route resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server." + }, + "items": { + "type": "array", + "description": "A list of Route resources.", + "items": { + "$ref": "Route" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#routeList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "Scheduling": { + "id": "Scheduling", + "type": "object", + "description": "Sets the scheduling options for an Instance.", + "properties": { + "automaticRestart": { + "type": "boolean", + "description": "Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the automatic restart option for standard instances. Preemptible instances cannot be automatically restarted." + }, + "onHostMaintenance": { + "type": "string", + "description": "Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and only possible behavior is TERMINATE. For more information, see Setting maintenance behavior.", + "enum": [ + "MIGRATE", + "TERMINATE" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "preemptible": { + "type": "boolean", + "description": "Whether the instance is preemptible." + } + } + }, + "SerialPortOutput": { + "id": "SerialPortOutput", + "type": "object", + "description": "An instance's serial console output.", + "properties": { + "contents": { + "type": "string", + "description": "[Output Only] The contents of the console output." + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#serialPortOutput for serial port output.", + "default": "compute#serialPortOutput" + }, + "selfLink": { + "type": "string", + "description": "[Output Only] 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." + }, + "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": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "diskSizeGb": { + "type": "string", + "description": "[Output Only] Size of the snapshot, specified in GB.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#snapshot for Snapshot resources.", + "default": "compute#snapshot" + }, + "licenses": { + "type": "array", + "description": "Public visible licenses.", + "items": { + "type": "string" + } + }, + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "snapshotEncryptionKey": { + "$ref": "CustomerEncryptionKey", + "description": "Encrypts the snapshot using a customer-supplied encryption key.\n\nIf you encrypt a snapshot using a customer-supplied encryption key, and you want to use the snapshot later (e.g. to create a disk from the snapshot), you must provide the same key used encrypt the snapshot in your future request. If you provide an incorrect key, or no key, the request will fail.\n\nCustomer-supplied encryption keys do not protect access to metadata of the disk.\n\nIf no customer-supplied encryption key is provided at creation, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the snapshot later." + }, + "sourceDisk": { + "type": "string", + "description": "The source disk used to create this snapshot." + }, + "sourceDiskEncryptionKey": { + "$ref": "CustomerEncryptionKey", + "description": "Specifies the customer-supplied encryption key of the source disk. This key is required if the source disk is protected by a customer-supplied encryption key.\n\nIf the incorrect key is provided, the request will fail." + }, + "sourceDiskId": { + "type": "string", + "description": "[Output Only] 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": "[Output Only] The status of the snapshot.", + "enum": [ + "CREATING", + "DELETING", + "FAILED", + "READY", + "UPLOADING" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "storageBytes": { + "type": "string", + "description": "[Output Only] 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": "[Output Only] 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 Snapshot resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server." + }, + "items": { + "type": "array", + "description": "A list of Snapshot resources.", + "items": { + "$ref": "Snapshot" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#snapshotList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "SslCertificate": { + "id": "SslCertificate", + "type": "object", + "description": "An SslCertificate resource. This resource provides a mechanism to upload an SSL key and certificate to global HTTPS loadbalancer to serve secure connections.", + "properties": { + "certificate": { + "type": "string", + "description": "A local certificate file. The certificate must be in PEM format. The certificate chain must be no greater than 5 certs long. The chain must include at least one intermediate cert." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource. Provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#sslCertificate for SSL certificates.", + "default": "compute#sslCertificate" + }, + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "privateKey": { + "type": "string", + "description": "A write-only private key in PEM format. Only insert RPCs will include this field." + }, + "selfLink": { + "type": "string", + "description": "[Output only] Server-defined URL for the resource." + } + } + }, + "SslCertificateList": { + "id": "SslCertificateList", + "type": "object", + "description": "Contains a list of SslCertificate resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server." + }, + "items": { + "type": "array", + "description": "A list of SslCertificate resources.", + "items": { + "$ref": "SslCertificate" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#sslCertificateList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "Tags": { + "id": "Tags", + "type": "object", + "description": "A set of instance tags.", + "properties": { + "fingerprint": { + "type": "string", + "description": "Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.\n\nTo see the latest fingerprint, make get() request to the instance.", + "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": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#operation for Operation resources.", + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "urlMap": { + "type": "string", + "description": "URL to the UrlMap resource that defines the mapping from URL to the BackendService." + } + } + }, + "TargetHttpProxyList": { + "id": "TargetHttpProxyList", + "type": "object", + "description": "A list of TargetHttpProxy resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of TargetHttpProxy resources.", + "items": { + "$ref": "TargetHttpProxy" + } + }, + "kind": { + "type": "string", + "description": "Type of resource. Always compute#targetHttpProxyList for lists of Target HTTP proxies.", + "default": "compute#targetHttpProxyList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "TargetHttpsProxiesSetSslCertificatesRequest": { + "id": "TargetHttpsProxiesSetSslCertificatesRequest", + "type": "object", + "properties": { + "sslCertificates": { + "type": "array", + "description": "New set of URLs to SslCertificate resources to associate with this TargetHttpProxy. Currently exactly one ssl certificate must be specified.", + "items": { + "type": "string" + } + } + } + }, + "TargetHttpsProxy": { + "id": "TargetHttpsProxy", + "type": "object", + "description": "A TargetHttpsProxy resource. This resource defines an HTTPS proxy.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource. Provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#targetHttpsProxy" + }, + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "sslCertificates": { + "type": "array", + "description": "URLs to SslCertificate resources that are used to authenticate connections to Backends. Currently exactly one SSL certificate must be specified.", + "items": { + "type": "string" + } + }, + "urlMap": { + "type": "string", + "description": "URL to the UrlMap resource that defines the mapping from URL to the BackendService." + } + } + }, + "TargetHttpsProxyList": { + "id": "TargetHttpsProxyList", + "type": "object", + "description": "Contains a list of TargetHttpsProxy resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of TargetHttpsProxy resources.", + "items": { + "$ref": "TargetHttpsProxy" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#targetHttpsProxyList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "TargetInstance": { + "id": "TargetInstance", + "type": "object", + "description": "A TargetInstance resource. This resource defines an endpoint instance that terminates traffic of certain protocols.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "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 instance. Currently only NO_NAT (default value) is supported.", + "enum": [ + "NO_NAT" + ], + "enumDescriptions": [ + "" + ] + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "zone": { + "type": "string", + "description": "[Output Only] URL of the zone where the target instance resides." + } + } + }, + "TargetInstanceAggregatedList": { + "id": "TargetInstanceAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "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": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "TargetInstanceList": { + "id": "TargetInstanceList", + "type": "object", + "description": "Contains a list of TargetInstance resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of TargetInstance resources.", + "items": { + "$ref": "TargetInstance" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#targetInstanceList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "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": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "TargetPool": { + "id": "TargetPool", + "type": "object", + "description": "A TargetPool resource. This resource defines a pool of instances, 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\nbackupPool and failoverRatio together define the fallback behavior of the primary target pool: if the ratio of the healthy instances 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 instances 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 instances with the best effort, or to all instances when no instance is healthy." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client 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 instances 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 instances 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 instances with the best effort, or to all instances when no instance is healthy.", + "format": "float" + }, + "healthChecks": { + "type": "array", + "description": "A list of URLs to the HttpHealthCheck resource. A member instance in this pool is considered healthy if and only if all specified health checks pass. An empty list means all member instances will be considered healthy at all times.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "instances": { + "type": "array", + "description": "A list of resource URLs to the member virtual machines 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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where the target pool resides." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "sessionAffinity": { + "type": "string", + "description": "Sesssion affinity option, must be one of the following values:\nNONE: Connections from the same client IP may go to any instance in the pool.\nCLIENT_IP: Connections from the same client IP will go to the same instance in the pool while that instance remains healthy.\nCLIENT_IP_PROTO: Connections from the same client IP with the same IP protocol will go to the same instance in the pool while that instance remains healthy.", + "enum": [ + "CLIENT_IP", + "CLIENT_IP_PROTO", + "NONE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "TargetPoolAggregatedList": { + "id": "TargetPoolAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server." + }, + "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": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "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": "[Output Only] Unique identifier for the resource. Defined by the server." + }, + "items": { + "type": "array", + "description": "A list of TargetPool resources.", + "items": { + "$ref": "TargetPool" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#targetPoolList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "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": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "TargetReference": { + "id": "TargetReference", + "type": "object", + "properties": { + "target": { + "type": "string" + } + } + }, + "TargetVpnGateway": { + "id": "TargetVpnGateway", + "type": "object", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource. Provided by the client when the resource is created." + }, + "forwardingRules": { + "type": "array", + "description": "[Output Only] A list of URLs to the ForwardingRule resources. ForwardingRules are created using compute.forwardingRules.insert and associated to a VPN gateway.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways.", + "default": "compute#targetVpnGateway" + }, + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.targetVpnGateways.insert" + ] + } + }, + "network": { + "type": "string", + "description": "URL of the network to which this VPN gateway is attached. Provided by the client when the VPN gateway is created.", + "annotations": { + "required": [ + "compute.targetVpnGateways.insert" + ] + } + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where the target VPN gateway resides." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "status": { + "type": "string", + "description": "[Output Only] The status of the VPN gateway.", + "enum": [ + "CREATING", + "DELETING", + "FAILED", + "READY" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "tunnels": { + "type": "array", + "description": "[Output Only] A list of URLs to VpnTunnel resources. VpnTunnels are created using compute.vpntunnels.insert and associated to a VPN gateway.", + "items": { + "type": "string" + } + } + } + }, + "TargetVpnGatewayAggregatedList": { + "id": "TargetVpnGatewayAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server." + }, + "items": { + "type": "object", + "description": "A map of scoped target vpn gateway lists.", + "additionalProperties": { + "$ref": "TargetVpnGatewaysScopedList", + "description": "[Output Only] Name of the scope containing this set of target vpn gateways." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways.", + "default": "compute#targetVpnGatewayAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + } + } + }, + "TargetVpnGatewayList": { + "id": "TargetVpnGatewayList", + "type": "object", + "description": "Contains a list of TargetVpnGateway resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of TargetVpnGateway resources.", + "items": { + "$ref": "TargetVpnGateway" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways.", + "default": "compute#targetVpnGatewayList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + } + } + }, + "TargetVpnGatewaysScopedList": { + "id": "TargetVpnGatewaysScopedList", + "type": "object", + "properties": { + "targetVpnGateways": { + "type": "array", + "description": "[Output Only] List of target vpn gateways contained in this scope.", + "items": { + "$ref": "TargetVpnGateway" + } + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning which replaces the list of addresses when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "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": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "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": "[Output Only] Unique identifier for the resource. Set by the server.", + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "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": "[Output Only] Server-defined URL for the resource." + }, + "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": "[Output Only] Unique identifier for the resource. Set by the server." + }, + "items": { + "type": "array", + "description": "A list of UrlMap resources.", + "items": { + "$ref": "UrlMap" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#urlMapList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "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 just 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 bucketName. If not supplied, defaults to usage. The report is stored as a CSV file named report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the usage according to Pacific Time. If you supply a prefix, it should conform to Cloud Storage object naming conventions." + } + } + }, + "VpnTunnel": { + "id": "VpnTunnel", + "type": "object", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource. Provided by the client when the resource is created." + }, + "detailedStatus": { + "type": "string", + "description": "[Output Only] Detailed status message for the VPN tunnel." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server.", + "format": "uint64" + }, + "ikeVersion": { + "type": "integer", + "description": "IKE protocol version to use when establishing the VPN tunnel with peer VPN gateway. Acceptable IKE versions are 1 or 2. Default version is 2.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels.", + "default": "compute#vpnTunnel" + }, + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.vpnTunnels.insert" + ] + } + }, + "peerIp": { + "type": "string", + "description": "IP address of the peer VPN gateway." + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where the VPN tunnel resides." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "sharedSecret": { + "type": "string", + "description": "Shared secret used to set the secure session between the GCE VPN gateway and the peer VPN gateway." + }, + "sharedSecretHash": { + "type": "string", + "description": "Hash of the shared secret." + }, + "status": { + "type": "string", + "description": "[Output Only] The status of the VPN tunnel.", + "enum": [ + "AUTHORIZATION_ERROR", + "DEPROVISIONING", + "ESTABLISHED", + "FAILED", + "FIRST_HANDSHAKE", + "NEGOTIATION_FAILURE", + "NETWORK_ERROR", + "NO_INCOMING_PACKETS", + "PROVISIONING", + "REJECTED", + "WAITING_FOR_FULL_CONFIG" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "targetVpnGateway": { + "type": "string", + "description": "URL of the VPN gateway to which this VPN tunnel is associated. Provided by the client when the VPN tunnel is created.", + "annotations": { + "required": [ + "compute.vpnTunnels.insert" + ] + } + } + } + }, + "VpnTunnelAggregatedList": { + "id": "VpnTunnelAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "object", + "description": "[Output Only] A map of scoped vpn tunnel lists.", + "additionalProperties": { + "$ref": "VpnTunnelsScopedList", + "description": "Name of the scope containing this set of vpn tunnels." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels.", + "default": "compute#vpnTunnelAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "VpnTunnelList": { + "id": "VpnTunnelList", + "type": "object", + "description": "Contains a list of VpnTunnel resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of VpnTunnel resources.", + "items": { + "$ref": "VpnTunnel" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels.", + "default": "compute#vpnTunnelList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + } + } + }, + "VpnTunnelsScopedList": { + "id": "VpnTunnelsScopedList", + "type": "object", + "properties": { + "vpnTunnels": { + "type": "array", + "description": "List of vpn tunnels contained in this scope.", + "items": { + "$ref": "VpnTunnel" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of addresses when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "Zone": { + "id": "Zone", + "type": "object", + "description": "A Zone resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "[Output Only] The deprecation status associated with this zone." + }, + "description": { + "type": "string", + "description": "[Output Only] Textual description of the resource." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always kind#zone for zones.", + "default": "compute#zone" + }, + "maintenanceWindows": { + "type": "array", + "description": "[Output Only] Any scheduled maintenance windows for this zone. When the zone is in a maintenance window, all resources which reside in the zone will be unavailable. For more information, see Maintenance Windows", + "items": { + "type": "object", + "properties": { + "beginTime": { + "type": "string", + "description": "[Output Only] Starting time of the maintenance window, in RFC3339 format." + }, + "description": { + "type": "string", + "description": "[Output Only] Textual description of the maintenance window." + }, + "endTime": { + "type": "string", + "description": "[Output Only] Ending time of the maintenance window, in RFC3339 format." + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the maintenance window." + } + } + } + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource." + }, + "region": { + "type": "string", + "description": "[Output Only] Full URL reference to the region which hosts the zone." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "status": { + "type": "string", + "description": "[Output Only] Status of the zone, either UP or DOWN.", + "enum": [ + "DOWN", + "UP" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "ZoneList": { + "id": "ZoneList", + "type": "object", + "description": "Contains a list of zone resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of Zone resources.", + "items": { + "$ref": "Zone" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#zoneList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + } + }, + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the region for 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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the region for 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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the region for 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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the region for 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/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "autoscalers": { + "methods": { + "aggregatedList": { + "id": "compute.autoscalers.aggregatedList", + "path": "{project}/aggregated/autoscalers", + "httpMethod": "GET", + "description": "Retrieves the list of autoscalers grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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": "AutoscalerAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.autoscalers.delete", + "path": "{project}/zones/{zone}/autoscalers/{autoscaler}", + "httpMethod": "DELETE", + "description": "Deletes the specified autoscaler resource.", + "parameters": { + "autoscaler": { + "type": "string", + "description": "Name of the persistent autoscaler 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", + "autoscaler" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.autoscalers.get", + "path": "{project}/zones/{zone}/autoscalers/{autoscaler}", + "httpMethod": "GET", + "description": "Returns the specified autoscaler resource.", + "parameters": { + "autoscaler": { + "type": "string", + "description": "Name of the persistent autoscaler 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", + "autoscaler" + ], + "response": { + "$ref": "Autoscaler" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.autoscalers.insert", + "path": "{project}/zones/{zone}/autoscalers", + "httpMethod": "POST", + "description": "Creates an autoscaler 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": "Autoscaler" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.autoscalers.list", + "path": "{project}/zones/{zone}/autoscalers", + "httpMethod": "GET", + "description": "Retrieves the list of autoscaler resources contained within the specified zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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": "AutoscalerList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "patch": { + "id": "compute.autoscalers.patch", + "path": "{project}/zones/{zone}/autoscalers", + "httpMethod": "PATCH", + "description": "Updates an autoscaler resource in the specified project using the data included in the request. This method supports patch semantics.", + "parameters": { + "autoscaler": { + "type": "string", + "description": "Name of the autoscaler resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "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", + "autoscaler" + ], + "request": { + "$ref": "Autoscaler" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "update": { + "id": "compute.autoscalers.update", + "path": "{project}/zones/{zone}/autoscalers", + "httpMethod": "PUT", + "description": "Updates an autoscaler resource in the specified project using the data included in the request.", + "parameters": { + "autoscaler": { + "type": "string", + "description": "Name of the autoscaler resource to update.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "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" + ], + "request": { + "$ref": "Autoscaler" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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", + "description": "Creates a snapshot of this disk.", + "parameters": { + "disk": { + "type": "string", + "description": "Name of the persistent disk to snapshot.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots.", + "parameters": { + "disk": { + "type": "string", + "description": "Name of the persistent disk to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.disks.get", + "path": "{project}/zones/{zone}/disks/{disk}", + "httpMethod": "GET", + "description": "Returns a specified persistent disk.", + "parameters": { + "disk": { + "type": "string", + "description": "Name of the persistent disk to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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 in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.disks.list", + "path": "{project}/zones/{zone}/disks", + "httpMethod": "GET", + "description": "Retrieves the list of persistent disks contained within the specified zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + "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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + "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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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 Operations resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the Operations resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.globalOperations.get", + "path": "{project}/global/operations/{operation}", + "httpMethod": "GET", + "description": "Retrieves the specified Operations resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the Operations resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "httpsHealthChecks": { + "methods": { + "delete": { + "id": "compute.httpsHealthChecks.delete", + "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}", + "httpMethod": "DELETE", + "description": "Deletes the specified HttpsHealthCheck resource.", + "parameters": { + "httpsHealthCheck": { + "type": "string", + "description": "Name of the HttpsHealthCheck 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", + "httpsHealthCheck" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.httpsHealthChecks.get", + "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}", + "httpMethod": "GET", + "description": "Returns the specified HttpsHealthCheck resource.", + "parameters": { + "httpsHealthCheck": { + "type": "string", + "description": "Name of the HttpsHealthCheck 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", + "httpsHealthCheck" + ], + "response": { + "$ref": "HttpsHealthCheck" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.httpsHealthChecks.insert", + "path": "{project}/global/httpsHealthChecks", + "httpMethod": "POST", + "description": "Creates a HttpsHealthCheck 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": "HttpsHealthCheck" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.httpsHealthChecks.list", + "path": "{project}/global/httpsHealthChecks", + "httpMethod": "GET", + "description": "Retrieves the list of HttpsHealthCheck resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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": "HttpsHealthCheckList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "patch": { + "id": "compute.httpsHealthChecks.patch", + "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}", + "httpMethod": "PATCH", + "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.", + "parameters": { + "httpsHealthCheck": { + "type": "string", + "description": "Name of the HttpsHealthCheck 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", + "httpsHealthCheck" + ], + "request": { + "$ref": "HttpsHealthCheck" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "update": { + "id": "compute.httpsHealthChecks.update", + "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}", + "httpMethod": "PUT", + "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request.", + "parameters": { + "httpsHealthCheck": { + "type": "string", + "description": "Name of the HttpsHealthCheck 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", + "httpsHealthCheck" + ], + "request": { + "$ref": "HttpsHealthCheck" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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.\n\nIf an empty request 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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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 private images available to the specified project. Private images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 7. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud.\n\nSee Accessing images for more information.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "instanceGroupManagers": { + "methods": { + "abandonInstances": { + "id": "compute.instanceGroupManagers.abandonInstances", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances", + "httpMethod": "POST", + "description": "Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersAbandonInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "aggregatedList": { + "id": "compute.instanceGroupManagers.aggregatedList", + "path": "{project}/aggregated/instanceGroupManagers", + "httpMethod": "GET", + "description": "Retrieves the list of managed instance groups and groups them by zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "InstanceGroupManagerAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.instanceGroupManagers.delete", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}", + "httpMethod": "DELETE", + "description": "Deletes the specified managed instance group and all of the instances in that group.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group to delete.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "deleteInstances": { + "id": "compute.instanceGroupManagers.deleteInstances", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances", + "httpMethod": "POST", + "description": "Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersDeleteInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.instanceGroupManagers.get", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}", + "httpMethod": "GET", + "description": "Returns all of the details about the specified managed instance group.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "response": { + "$ref": "InstanceGroupManager" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.instanceGroupManagers.insert", + "path": "{project}/zones/{zone}/instanceGroupManagers", + "httpMethod": "POST", + "description": "Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method.", + "parameters": { + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where you want to create the managed instance group.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "request": { + "$ref": "InstanceGroupManager" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.instanceGroupManagers.list", + "path": "{project}/zones/{zone}/instanceGroupManagers", + "httpMethod": "GET", + "description": "Retrieves a list of managed instance groups that are contained within the specified project and zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "InstanceGroupManagerList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "listManagedInstances": { + "id": "compute.instanceGroupManagers.listManagedInstances", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances", + "httpMethod": "POST", + "description": "Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "response": { + "$ref": "InstanceGroupManagersListManagedInstancesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "recreateInstances": { + "id": "compute.instanceGroupManagers.recreateInstances", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances", + "httpMethod": "POST", + "description": "Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersRecreateInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "resize": { + "id": "compute.instanceGroupManagers.resize", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize", + "httpMethod": "POST", + "description": "Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "size": { + "type": "integer", + "description": "The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter.", + "required": true, + "format": "int32", + "location": "query" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager", + "size" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "setAutoHealingPolicies": { + "id": "compute.instanceGroupManagers.setAutoHealingPolicies", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies", + "httpMethod": "POST", + "description": "Modifies the autohealing policy.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the instance group manager.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The URL of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersSetAutoHealingRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "setInstanceTemplate": { + "id": "compute.instanceGroupManagers.setInstanceTemplate", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate", + "httpMethod": "POST", + "description": "Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you recreate them.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersSetInstanceTemplateRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "setTargetPools": { + "id": "compute.instanceGroupManagers.setTargetPools", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools", + "httpMethod": "POST", + "description": "Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersSetTargetPoolsRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "instanceGroups": { + "methods": { + "addInstances": { + "id": "compute.instanceGroups.addInstances", + "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances", + "httpMethod": "POST", + "description": "Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. TODO: Change to comment to state \"if IG is load balanced.\"", + "parameters": { + "instanceGroup": { + "type": "string", + "description": "The name of the instance group where you are adding instances.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroup" + ], + "request": { + "$ref": "InstanceGroupsAddInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "aggregatedList": { + "id": "compute.instanceGroups.aggregatedList", + "path": "{project}/aggregated/instanceGroups", + "httpMethod": "GET", + "description": "Retrieves the list of instance groups and sorts them by zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "InstanceGroupAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.instanceGroups.delete", + "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}", + "httpMethod": "DELETE", + "description": "Deletes the specified instance group. The instances in the group are not deleted.", + "parameters": { + "instanceGroup": { + "type": "string", + "description": "The name of the instance group to delete.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroup" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.instanceGroups.get", + "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}", + "httpMethod": "GET", + "description": "Returns the specified instance group resource.", + "parameters": { + "instanceGroup": { + "type": "string", + "description": "The name of the instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroup" + ], + "response": { + "$ref": "InstanceGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.instanceGroups.insert", + "path": "{project}/zones/{zone}/instanceGroups", + "httpMethod": "POST", + "description": "Creates an instance group in the specified project using the parameters that are included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where you want to create the instance group.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "request": { + "$ref": "InstanceGroup" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.instanceGroups.list", + "path": "{project}/zones/{zone}/instanceGroups", + "httpMethod": "GET", + "description": "Retrieves the list of instance groups that are located in the specified project and zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "InstanceGroupList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "listInstances": { + "id": "compute.instanceGroups.listInstances", + "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances", + "httpMethod": "POST", + "description": "Lists the instances in the specified instance group.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "instanceGroup": { + "type": "string", + "description": "The name of the instance group from which you want to generate a list of included instances.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroup" + ], + "request": { + "$ref": "InstanceGroupsListInstancesRequest" + }, + "response": { + "$ref": "InstanceGroupsListInstances" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "removeInstances": { + "id": "compute.instanceGroups.removeInstances", + "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances", + "httpMethod": "POST", + "description": "Removes one or more instances from the specified instance group, but does not delete those instances.", + "parameters": { + "instanceGroup": { + "type": "string", + "description": "The name of the instance group where the specified instances will be removed.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroup" + ], + "request": { + "$ref": "InstanceGroupsRemoveInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "setNamedPorts": { + "id": "compute.instanceGroups.setNamedPorts", + "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts", + "httpMethod": "POST", + "description": "Sets the named ports for the specified instance group.", + "parameters": { + "instanceGroup": { + "type": "string", + "description": "The name of the instance group where the named ports are updated.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroup" + ], + "request": { + "$ref": "InstanceGroupsSetNamedPortsRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "instanceTemplates": { + "methods": { + "delete": { + "id": "compute.instanceTemplates.delete", + "path": "{project}/global/instanceTemplates/{instanceTemplate}", + "httpMethod": "DELETE", + "description": "Deletes the specified instance template.", + "parameters": { + "instanceTemplate": { + "type": "string", + "description": "The name of the instance template to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "instanceTemplate" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.instanceTemplates.get", + "path": "{project}/global/instanceTemplates/{instanceTemplate}", + "httpMethod": "GET", + "description": "Returns the specified instance template resource.", + "parameters": { + "instanceTemplate": { + "type": "string", + "description": "The name of the instance template.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "instanceTemplate" + ], + "response": { + "$ref": "InstanceTemplate" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.instanceTemplates.insert", + "path": "{project}/global/instanceTemplates", + "httpMethod": "POST", + "description": "Creates an instance template in the specified project using the data that is included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "InstanceTemplate" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.instanceTemplates.list", + "path": "{project}/global/instanceTemplates", + "httpMethod": "GET", + "description": "Retrieves a list of instance templates that are contained within the specified project and zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "InstanceTemplateList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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": "The instance name for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "networkInterface": { + "type": "string", + "description": "The name of the network interface to add to this instance.", + "required": true, + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "aggregatedList": { + "id": "compute.instances.aggregatedList", + "path": "{project}/aggregated/instances", + "httpMethod": "GET", + "description": "Retrieves aggregated list of instance resources.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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 ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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. For more information, see Shutting down an instance.", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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": "The name of the access config to delete.", + "required": true, + "location": "query" + }, + "instance": { + "type": "string", + "description": "The instance name for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "networkInterface": { + "type": "string", + "description": "The name of the network interface.", + "required": true, + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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 ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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" + }, + "port": { + "type": "integer", + "description": "Specifies which COM or serial port to retrieve data from.", + "default": "1", + "format": "int32", + "minimum": "1", + "maximum": "4", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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": "The device name of the disk to modify.", + "required": true, + "pattern": "\\w[\\w.-]{0,254}", + "location": "query" + }, + "instance": { + "type": "string", + "description": "The instance name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "setLabels": { + "id": "compute.instances.setLabels", + "path": "{project}/zones/{zone}/instances/{instance}/setLabels", + "httpMethod": "POST", + "description": "Sets labels 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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "request": { + "$ref": "InstancesSetLabelsRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "setMachineType": { + "id": "compute.instances.setMachineType", + "path": "{project}/zones/{zone}/instances/{instance}/setMachineType", + "httpMethod": "POST", + "description": "Sets machine type for the specified instances 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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instance" + ], + "request": { + "$ref": "InstancesSetMachineTypeRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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 ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "start": { + "id": "compute.instances.start", + "path": "{project}/zones/{zone}/instances/{instance}/start", + "httpMethod": "POST", + "description": "This method starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance resource to start.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "stop": { + "id": "compute.instances.stop", + "path": "{project}/zones/{zone}/instances/{instance}/stop", + "httpMethod": "POST", + "description": "This method stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine is using, such as persistent disks and static IP addresses,will continue to be charged until they are deleted. For more information, see Stopping an instance.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance resource to stop.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "licenses": { + "methods": { + "get": { + "id": "compute.licenses.get", + "path": "{project}/global/licenses/{license}", + "httpMethod": "GET", + "description": "Returns the specified license resource.", + "parameters": { + "license": { + "type": "string", + "description": "Name of the license resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "license" + ], + "response": { + "$ref": "License" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "setUsageExportBucket": { + "id": "compute.projects.setUsageExportBucket", + "path": "{project}/setUsageExportBucket", + "httpMethod": "POST", + "description": "Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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" + ] + }, + "setUsageExportCloudStorageBucket": { + "id": "compute.projects.setUsageExportCloudStorageBucket", + "path": "{project}/setUsageExportCloudStorageBucket", + "httpMethod": "POST", + "description": "[Deprecated] Use setUsageExportBucket instead.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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 Operations resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the Operations resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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 Operations resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the Operations resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + "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 Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot.\n\nFor more information, see Deleting snaphots.", + "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 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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.snapshots.get", + "path": "{project}/global/snapshots/{snapshot}", + "httpMethod": "GET", + "description": "Returns the specified 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 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/cloud-platform", + "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 Snapshot resources contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "sslCertificates": { + "methods": { + "delete": { + "id": "compute.sslCertificates.delete", + "path": "{project}/global/sslCertificates/{sslCertificate}", + "httpMethod": "DELETE", + "description": "Deletes the specified SslCertificate 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" + }, + "sslCertificate": { + "type": "string", + "description": "Name of the SslCertificate resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "sslCertificate" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.sslCertificates.get", + "path": "{project}/global/sslCertificates/{sslCertificate}", + "httpMethod": "GET", + "description": "Returns the specified SslCertificate 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" + }, + "sslCertificate": { + "type": "string", + "description": "Name of the SslCertificate resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "sslCertificate" + ], + "response": { + "$ref": "SslCertificate" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.sslCertificates.insert", + "path": "{project}/global/sslCertificates", + "httpMethod": "POST", + "description": "Creates a SslCertificate 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": "SslCertificate" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.sslCertificates.list", + "path": "{project}/global/sslCertificates", + "httpMethod": "GET", + "description": "Retrieves the list of SslCertificate resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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": "SslCertificateList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + "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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "targetHttpsProxies": { + "methods": { + "delete": { + "id": "compute.targetHttpsProxies.delete", + "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}", + "httpMethod": "DELETE", + "description": "Deletes the specified TargetHttpsProxy 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" + }, + "targetHttpsProxy": { + "type": "string", + "description": "Name of the TargetHttpsProxy resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "targetHttpsProxy" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.targetHttpsProxies.get", + "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}", + "httpMethod": "GET", + "description": "Returns the specified TargetHttpsProxy 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" + }, + "targetHttpsProxy": { + "type": "string", + "description": "Name of the TargetHttpsProxy resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "targetHttpsProxy" + ], + "response": { + "$ref": "TargetHttpsProxy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.targetHttpsProxies.insert", + "path": "{project}/global/targetHttpsProxies", + "httpMethod": "POST", + "description": "Creates a TargetHttpsProxy 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": "TargetHttpsProxy" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.targetHttpsProxies.list", + "path": "{project}/global/targetHttpsProxies", + "httpMethod": "GET", + "description": "Retrieves the list of TargetHttpsProxy resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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": "TargetHttpsProxyList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "setSslCertificates": { + "id": "compute.targetHttpsProxies.setSslCertificates", + "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates", + "httpMethod": "POST", + "description": "Replaces SslCertificates for TargetHttpsProxy.", + "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" + }, + "targetHttpsProxy": { + "type": "string", + "description": "Name of the TargetHttpsProxy 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", + "targetHttpsProxy" + ], + "request": { + "$ref": "TargetHttpsProxiesSetSslCertificatesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "setUrlMap": { + "id": "compute.targetHttpsProxies.setUrlMap", + "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap", + "httpMethod": "POST", + "description": "Changes the URL map for TargetHttpsProxy.", + "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" + }, + "targetHttpsProxy": { + "type": "string", + "description": "Name of the TargetHttpsProxy 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", + "targetHttpsProxy" + ], + "request": { + "$ref": "UrlMapReference" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "targetVpnGateways": { + "methods": { + "aggregatedList": { + "id": "compute.targetVpnGateways.aggregatedList", + "path": "{project}/aggregated/targetVpnGateways", + "httpMethod": "GET", + "description": "Retrieves the list of target VPN gateways grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "TargetVpnGatewayAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.targetVpnGateways.delete", + "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}", + "httpMethod": "DELETE", + "description": "Deletes the specified TargetVpnGateway resource.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetVpnGateway": { + "type": "string", + "description": "Name of the TargetVpnGateway resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetVpnGateway" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.targetVpnGateways.get", + "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}", + "httpMethod": "GET", + "description": "Returns the specified TargetVpnGateway resource.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetVpnGateway": { + "type": "string", + "description": "Name of the TargetVpnGateway resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetVpnGateway" + ], + "response": { + "$ref": "TargetVpnGateway" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.targetVpnGateways.insert", + "path": "{project}/regions/{region}/targetVpnGateways", + "httpMethod": "POST", + "description": "Creates a TargetVpnGateway resource in the specified project and region using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "request": { + "$ref": "TargetVpnGateway" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.targetVpnGateways.list", + "path": "{project}/regions/{region}/targetVpnGateways", + "httpMethod": "GET", + "description": "Retrieves the list of TargetVpnGateway resources available to the specified project and region.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "response": { + "$ref": "TargetVpnGatewayList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "vpnTunnels": { + "methods": { + "aggregatedList": { + "id": "compute.vpnTunnels.aggregatedList", + "path": "{project}/aggregated/vpnTunnels", + "httpMethod": "GET", + "description": "Retrieves the list of VPN tunnels grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "VpnTunnelAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.vpnTunnels.delete", + "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}", + "httpMethod": "DELETE", + "description": "Deletes the specified VpnTunnel resource.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "vpnTunnel": { + "type": "string", + "description": "Name of the VpnTunnel resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "vpnTunnel" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.vpnTunnels.get", + "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}", + "httpMethod": "GET", + "description": "Returns the specified VpnTunnel resource.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "vpnTunnel": { + "type": "string", + "description": "Name of the VpnTunnel resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "vpnTunnel" + ], + "response": { + "$ref": "VpnTunnel" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.vpnTunnels.insert", + "path": "{project}/regions/{region}/vpnTunnels", + "httpMethod": "POST", + "description": "Creates a VpnTunnel resource in the specified project and region using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "request": { + "$ref": "VpnTunnel" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.vpnTunnels.list", + "path": "{project}/regions/{region}/vpnTunnels", + "httpMethod": "GET", + "description": "Retrieves the list of VpnTunnel resources contained in the specified project and region.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "response": { + "$ref": "VpnTunnelList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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 Operations resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the Operations resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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 Operations resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the Operations resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/compute/v0.beta/compute-gen.go b/Godeps/_workspace/src/google.golang.org/api/compute/v0.beta/compute-gen.go new file mode 100644 index 000000000..ae14a8011 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/compute/v0.beta/compute-gen.go @@ -0,0 +1,39109 @@ +// Package compute provides access to the Compute Engine API. +// +// See https://developers.google.com/compute/docs/reference/latest/ +// +// Usage example: +// +// import "google.golang.org/api/compute/v0.beta" +// ... +// computeService, err := compute.New(oauthHttpClient) +package compute // import "google.golang.org/api/compute/v0.beta" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "compute:beta" +const apiName = "compute" +const apiVersion = "beta" +const basePath = "https://www.googleapis.com/compute/beta/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 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 + DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control" + + // View your data in Google Cloud Storage + DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only" + + // Manage your data in Google Cloud Storage + DevstorageReadWriteScope = "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.Autoscalers = NewAutoscalersService(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.HttpsHealthChecks = NewHttpsHealthChecksService(s) + s.Images = NewImagesService(s) + s.InstanceGroupManagers = NewInstanceGroupManagersService(s) + s.InstanceGroups = NewInstanceGroupsService(s) + s.InstanceTemplates = NewInstanceTemplatesService(s) + s.Instances = NewInstancesService(s) + s.Licenses = NewLicensesService(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.SslCertificates = NewSslCertificatesService(s) + s.TargetHttpProxies = NewTargetHttpProxiesService(s) + s.TargetHttpsProxies = NewTargetHttpsProxiesService(s) + s.TargetInstances = NewTargetInstancesService(s) + s.TargetPools = NewTargetPoolsService(s) + s.TargetVpnGateways = NewTargetVpnGatewaysService(s) + s.UrlMaps = NewUrlMapsService(s) + s.VpnTunnels = NewVpnTunnelsService(s) + s.ZoneOperations = NewZoneOperationsService(s) + s.Zones = NewZonesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Addresses *AddressesService + + Autoscalers *AutoscalersService + + BackendServices *BackendServicesService + + DiskTypes *DiskTypesService + + Disks *DisksService + + Firewalls *FirewallsService + + ForwardingRules *ForwardingRulesService + + GlobalAddresses *GlobalAddressesService + + GlobalForwardingRules *GlobalForwardingRulesService + + GlobalOperations *GlobalOperationsService + + HttpHealthChecks *HttpHealthChecksService + + HttpsHealthChecks *HttpsHealthChecksService + + Images *ImagesService + + InstanceGroupManagers *InstanceGroupManagersService + + InstanceGroups *InstanceGroupsService + + InstanceTemplates *InstanceTemplatesService + + Instances *InstancesService + + Licenses *LicensesService + + MachineTypes *MachineTypesService + + Networks *NetworksService + + Projects *ProjectsService + + RegionOperations *RegionOperationsService + + Regions *RegionsService + + Routes *RoutesService + + Snapshots *SnapshotsService + + SslCertificates *SslCertificatesService + + TargetHttpProxies *TargetHttpProxiesService + + TargetHttpsProxies *TargetHttpsProxiesService + + TargetInstances *TargetInstancesService + + TargetPools *TargetPoolsService + + TargetVpnGateways *TargetVpnGatewaysService + + UrlMaps *UrlMapsService + + VpnTunnels *VpnTunnelsService + + ZoneOperations *ZoneOperationsService + + Zones *ZonesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAddressesService(s *Service) *AddressesService { + rs := &AddressesService{s: s} + return rs +} + +type AddressesService struct { + s *Service +} + +func NewAutoscalersService(s *Service) *AutoscalersService { + rs := &AutoscalersService{s: s} + return rs +} + +type AutoscalersService 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 NewHttpsHealthChecksService(s *Service) *HttpsHealthChecksService { + rs := &HttpsHealthChecksService{s: s} + return rs +} + +type HttpsHealthChecksService struct { + s *Service +} + +func NewImagesService(s *Service) *ImagesService { + rs := &ImagesService{s: s} + return rs +} + +type ImagesService struct { + s *Service +} + +func NewInstanceGroupManagersService(s *Service) *InstanceGroupManagersService { + rs := &InstanceGroupManagersService{s: s} + return rs +} + +type InstanceGroupManagersService struct { + s *Service +} + +func NewInstanceGroupsService(s *Service) *InstanceGroupsService { + rs := &InstanceGroupsService{s: s} + return rs +} + +type InstanceGroupsService struct { + s *Service +} + +func NewInstanceTemplatesService(s *Service) *InstanceTemplatesService { + rs := &InstanceTemplatesService{s: s} + return rs +} + +type InstanceTemplatesService struct { + s *Service +} + +func NewInstancesService(s *Service) *InstancesService { + rs := &InstancesService{s: s} + return rs +} + +type InstancesService struct { + s *Service +} + +func NewLicensesService(s *Service) *LicensesService { + rs := &LicensesService{s: s} + return rs +} + +type LicensesService 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 NewSslCertificatesService(s *Service) *SslCertificatesService { + rs := &SslCertificatesService{s: s} + return rs +} + +type SslCertificatesService struct { + s *Service +} + +func NewTargetHttpProxiesService(s *Service) *TargetHttpProxiesService { + rs := &TargetHttpProxiesService{s: s} + return rs +} + +type TargetHttpProxiesService struct { + s *Service +} + +func NewTargetHttpsProxiesService(s *Service) *TargetHttpsProxiesService { + rs := &TargetHttpsProxiesService{s: s} + return rs +} + +type TargetHttpsProxiesService 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 NewTargetVpnGatewaysService(s *Service) *TargetVpnGatewaysService { + rs := &TargetVpnGatewaysService{s: s} + return rs +} + +type TargetVpnGatewaysService struct { + s *Service +} + +func NewUrlMapsService(s *Service) *UrlMapsService { + rs := &UrlMapsService{s: s} + return rs +} + +type UrlMapsService struct { + s *Service +} + +func NewVpnTunnelsService(s *Service) *VpnTunnelsService { + rs := &VpnTunnelsService{s: s} + return rs +} + +type VpnTunnelsService 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 +} + +// AccessConfig: An access configuration attached to an instance's +// network interface. +type AccessConfig struct { + // Kind: [Output Only] Type of the resource. Always compute#accessConfig + // for access configs. + 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 external IP address available to the project or + // leave this field undefined to use an IP from a shared ephemeral IP + // address pool. If you specify a static external IP address, it must + // live in the same region as the zone of the instance. + NatIP string `json:"natIP,omitempty"` + + // Type: The type of configuration. The default and only option is + // ONE_TO_ONE_NAT. + // + // Possible values: + // "ONE_TO_ONE_NAT" (default) + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccessConfig) MarshalJSON() ([]byte, error) { + type noMethod AccessConfig + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Address: A reserved address resource. +type Address struct { + // Address: The static external IP address represented by this resource. + Address string `json:"address,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always compute#address for + // addresses. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // Region: [Output Only] URL of the region where the regional address + // resides. This field is not applicable to global addresses. + Region string `json:"region,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // Status: [Output Only] The status of the address, which can be either + // IN_USE or RESERVED. An address that is RESERVED is currently reserved + // and available to use. An IN_USE address is currently being used by + // another resource and is not available. + // + // Possible values: + // "IN_USE" + // "RESERVED" + Status string `json:"status,omitempty"` + + // Users: [Output Only] The URLs of the resources that are using this + // address. + Users []string `json:"users,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Address") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Address) MarshalJSON() ([]byte, error) { + type noMethod Address + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AddressAggregatedList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A map of scoped address lists. + Items map[string]AddressesScopedList `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always + // compute#addressAggregatedList for aggregated lists of addresses. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AddressAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod AddressAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AddressList: Contains a list of address resources. +type AddressList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of Address resources. + Items []*Address `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#addressList for + // lists of addresses. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AddressList) MarshalJSON() ([]byte, error) { + type noMethod AddressList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AddressesScopedList struct { + // Addresses: [Output Only] List of addresses contained in this scope. + Addresses []*Address `json:"addresses,omitempty"` + + // Warning: [Output Only] Informational warning which replaces the list + // of addresses when the list is empty. + Warning *AddressesScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Addresses") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AddressesScopedList) MarshalJSON() ([]byte, error) { + type noMethod AddressesScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AddressesScopedListWarning: [Output Only] Informational warning which +// replaces the list of addresses when the list is empty. +type AddressesScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*AddressesScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AddressesScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod AddressesScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AddressesScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AddressesScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod AddressesScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AttachedDisk: An instance-attached disk resource. +type AttachedDisk struct { + // AutoDelete: Specifies 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. The virtual machine will + // use the first partition of the disk for its root filesystem. + Boot bool `json:"boot,omitempty"` + + // DeviceName: Specifies a unique device name of your choice that is + // reflected into the /dev/disk/by-id/google-* tree of a Linux operating + // system running within the instance. This name can be used to + // reference the device for mounting, resizing, and so on, from within + // the instance. + // + // If not specified, the server chooses a default device name to apply + // to this disk, in the form persistent-disks-x, where x is a number + // assigned by Google Compute Engine. This field is only applicable for + // persistent disks. + DeviceName string `json:"deviceName,omitempty"` + + // DiskEncryptionKey: Encrypts or decrypts a disk using a + // customer-supplied encryption key. + // + // If you are creating a new disk, this field encrypts the disk using a + // customer-supplied encryption key. If you are attaching an existing + // disk that is already encrypted, this field decrypts the disk using + // the customer-supplied encryption key. + // + // If you encrypt a new disk using a customer-supplied encryption key, + // you must provide the same key again when attempting to use this + // resource at a later time (e.g. to create a snapshot or image from the + // disk or to attach the disk to a virtual machine). + // + // If no customer-supplied encryption key is provided at creation, then + // the disk will be encrypted using an automatically generated key and + // you do not need to provide a key to use the disk later. + DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"` + + // Index: Assigns a zero-based index to this disk, where 0 is reserved + // for the boot disk. For example, if you have many disks attached to an + // instance, each disk would have a unique index number. If not + // specified, the server will choose an appropriate value. + Index int64 `json:"index,omitempty"` + + // InitializeParams: [Input Only] Specifies the parameters for a new + // disk that will be created alongside the new instance. Use + // initialization parameters to create boot disks or local SSDs attached + // to the new instance. + // + // This property is mutually exclusive with the source property; you can + // only define one or the other, but not both. + InitializeParams *AttachedDiskInitializeParams `json:"initializeParams,omitempty"` + + // Interface: Specifies the disk interface to use for attaching this + // disk, either SCSI or NVME. The default is SCSI. For performance + // characteristics of SCSI over NVMe, see Local SSD performance. + // + // Possible values: + // "NVME" + // "SCSI" + Interface string `json:"interface,omitempty"` + + // Kind: [Output Only] Type of the resource. Always compute#attachedDisk + // for attached disks. + Kind string `json:"kind,omitempty"` + + // Licenses: [Output Only] Any valid publicly visible licenses. + Licenses []string `json:"licenses,omitempty"` + + // Mode: The mode in which to attach this disk, either READ_WRITE or + // READ_ONLY. If not specified, the default is to attach the disk in + // READ_WRITE mode. + // + // Possible values: + // "READ_ONLY" + // "READ_WRITE" + Mode string `json:"mode,omitempty"` + + // Source: Specifies a valid partial or full URL to an existing + // Persistent Disk resource. This field is only applicable for + // persistent disks. + Source string `json:"source,omitempty"` + + // Type: Specifies the type of the disk, either SCRATCH or PERSISTENT. + // If not specified, the default is PERSISTENT. + // + // Possible values: + // "PERSISTENT" + // "SCRATCH" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AutoDelete") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AttachedDisk) MarshalJSON() ([]byte, error) { + type noMethod AttachedDisk + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AttachedDiskInitializeParams: [Input Only] Specifies the parameters +// for a new disk that will be created alongside the new instance. Use +// initialization parameters to create boot disks or local SSDs attached +// to the new instance. +// +// This property is mutually exclusive with the source property; you can +// only define one or the other, but not both. +type AttachedDiskInitializeParams struct { + // DiskName: Specifies the disk name. If not specified, the default is + // to use the name of the instance. + DiskName string `json:"diskName,omitempty"` + + // DiskSizeGb: Specifies the size of the disk in base-2 GB. + DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"` + + // DiskStorageType: Storage type of the disk. + // + // Possible values: + // "HDD" + // "SSD" + DiskStorageType string `json:"diskStorageType,omitempty"` + + // DiskType: Specifies the disk type to use to create the instance. If + // not specified, the default is pd-standard, specified using the full + // URL. For + // example: + // + // https://www.googleapis.com/compute/v1/projects/project/zones + // /zone/diskTypes/pd-standard + // + // Other values include pd-ssd and local-ssd. If you define this field, + // you can provide either the full or partial URL. For example, the + // following are valid values: + // - + // https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType + // - projects/project/zones/zone/diskTypes/diskType + // - zones/zone/diskTypes/diskType + DiskType string `json:"diskType,omitempty"` + + // SourceImage: A source image used to create the disk. You can provide + // a private (custom) image, and Compute Engine will use the + // corresponding image from your project. For + // example: + // + // global/images/my-private-image + // + // Or you can provide an image from a publicly-available project. For + // example, to use a Debian image from the debian-cloud project, make + // sure to include the project in the + // URL: + // + // projects/debian-cloud/global/images/debian-7-wheezy-vYYYYMMDD + // + // where vYYYYMMDD is the image version. The fully-qualified URL will + // also work in both cases. + SourceImage string `json:"sourceImage,omitempty"` + + // SourceImageEncryptionKey: The customer-supplied encryption key of the + // source image. This key is required if the source image is protected + // by a customer-supplied encryption key. + // + // If the incorrect key is provided, the operation will fail. + SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DiskName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AttachedDiskInitializeParams) MarshalJSON() ([]byte, error) { + type noMethod AttachedDiskInitializeParams + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Autoscaler struct { + // AutoscalingPolicy: Autoscaling configuration. + AutoscalingPolicy *AutoscalingPolicy `json:"autoscalingPolicy,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource; defined by the + // server. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // Target: URL of Instance Group Manager or Replica Pool which will be + // controlled by Autoscaler. + Target string `json:"target,omitempty"` + + // Zone: [Output Only] URL of the zone where the instance group resides. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AutoscalingPolicy") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Autoscaler) MarshalJSON() ([]byte, error) { + type noMethod Autoscaler + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AutoscalerAggregatedList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A map of scoped autoscaler lists. + Items map[string]AutoscalersScopedList `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalerAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod AutoscalerAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AutoscalerList: Contains a list of persistent autoscaler resources. +type AutoscalerList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of Autoscaler resources. + Items []*Autoscaler `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalerList) MarshalJSON() ([]byte, error) { + type noMethod AutoscalerList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AutoscalersScopedList struct { + // Autoscalers: List of autoscalers contained in this scope. + Autoscalers []*Autoscaler `json:"autoscalers,omitempty"` + + // Warning: Informational warning which replaces the list of autoscalers + // when the list is empty. + Warning *AutoscalersScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Autoscalers") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalersScopedList) MarshalJSON() ([]byte, error) { + type noMethod AutoscalersScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AutoscalersScopedListWarning: Informational warning which replaces +// the list of autoscalers when the list is empty. +type AutoscalersScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*AutoscalersScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalersScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod AutoscalersScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AutoscalersScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalersScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod AutoscalersScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AutoscalingPolicy: Cloud Autoscaler policy. +type AutoscalingPolicy struct { + // CoolDownPeriodSec: The number of seconds that the Autoscaler should + // wait between two succeeding changes to the number of virtual + // machines. You should define an interval that is at least as long as + // the initialization time of a virtual machine and the time it may take + // for replica pool to create the virtual machine. The default is 60 + // seconds. + CoolDownPeriodSec int64 `json:"coolDownPeriodSec,omitempty"` + + // CpuUtilization: TODO(jbartosik): Add support for scaling based on + // muliple utilization metrics (take max recommendation). Exactly one + // utilization policy should be provided. Configuration parameters of + // CPU based autoscaling policy. + CpuUtilization *AutoscalingPolicyCpuUtilization `json:"cpuUtilization,omitempty"` + + // CustomMetricUtilizations: Configuration parameters of autoscaling + // based on custom metric. + CustomMetricUtilizations []*AutoscalingPolicyCustomMetricUtilization `json:"customMetricUtilizations,omitempty"` + + // LoadBalancingUtilization: Configuration parameters of autoscaling + // based on load balancer. + LoadBalancingUtilization *AutoscalingPolicyLoadBalancingUtilization `json:"loadBalancingUtilization,omitempty"` + + // MaxNumReplicas: The maximum number of replicas that the Autoscaler + // can scale up to. This field is required for config to be effective. + // Maximum number of replicas should be not lower than minimal number of + // replicas. Absolute limit for this value is defined in Autoscaler + // backend. + MaxNumReplicas int64 `json:"maxNumReplicas,omitempty"` + + // MinNumReplicas: The minimum number of replicas that the Autoscaler + // can scale down to. Can't be less than 0. If not provided Autoscaler + // will choose default value depending on maximal number of replicas. + MinNumReplicas int64 `json:"minNumReplicas,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CoolDownPeriodSec") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalingPolicy) MarshalJSON() ([]byte, error) { + type noMethod AutoscalingPolicy + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AutoscalingPolicyCpuUtilization: CPU utilization policy. +type AutoscalingPolicyCpuUtilization struct { + // UtilizationTarget: The target utilization that the Autoscaler should + // maintain. It is represented as a fraction of used cores. For example: + // 6 cores used in 8-core VM are represented here as 0.75. Must be a + // float value between (0, 1]. If not defined, the default is 0.8. + UtilizationTarget float64 `json:"utilizationTarget,omitempty"` + + // ForceSendFields is a list of field names (e.g. "UtilizationTarget") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalingPolicyCpuUtilization) MarshalJSON() ([]byte, error) { + type noMethod AutoscalingPolicyCpuUtilization + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AutoscalingPolicyCustomMetricUtilization: Custom utilization metric +// policy. +type AutoscalingPolicyCustomMetricUtilization struct { + // Metric: Identifier of the metric. It should be a Cloud Monitoring + // metric. The metric can not have negative values. The metric should be + // an utilization metric (increasing number of VMs handling requests x + // times should reduce average value of the metric roughly x times). For + // example you could use: + // compute.googleapis.com/instance/network/received_bytes_count. + Metric string `json:"metric,omitempty"` + + // UtilizationTarget: Target value of the metric which Autoscaler should + // maintain. Must be a positive value. + UtilizationTarget float64 `json:"utilizationTarget,omitempty"` + + // UtilizationTargetType: Defines type in which utilization_target is + // expressed. + // + // Possible values: + // "DELTA_PER_MINUTE" + // "DELTA_PER_SECOND" + // "GAUGE" + UtilizationTargetType string `json:"utilizationTargetType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Metric") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalingPolicyCustomMetricUtilization) MarshalJSON() ([]byte, error) { + type noMethod AutoscalingPolicyCustomMetricUtilization + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AutoscalingPolicyLoadBalancingUtilization: Load balancing utilization +// policy. +type AutoscalingPolicyLoadBalancingUtilization struct { + // UtilizationTarget: Fraction of backend capacity utilization (set in + // HTTP load balancing configuration) that Autoscaler should maintain. + // Must be a positive float value. If not defined, the default is 0.8. + // For example if your maxRatePerInstance capacity (in HTTP Load + // Balancing configuration) is set at 10 and you would like to keep + // number of instances such that each instance receives 7 QPS on + // average, set this to 0.7. + UtilizationTarget float64 `json:"utilizationTarget,omitempty"` + + // ForceSendFields is a list of field names (e.g. "UtilizationTarget") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalingPolicyLoadBalancingUtilization) MarshalJSON() ([]byte, error) { + type noMethod AutoscalingPolicyLoadBalancingUtilization + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Backend: Message containing information of one individual backend. +type Backend struct { + // BalancingMode: Specifies the balancing mode for this backend. The + // default is UTILIZATION but available values are UTILIZATION and RATE. + // + // Possible values: + // "RATE" + // "UTILIZATION" + BalancingMode string `json:"balancingMode,omitempty"` + + // CapacityScaler: A multiplier applied to the group's maximum servicing + // capacity (either UTILIZATION or RATE). Default value is 1, which + // means the group will serve up to 100% of its configured CPU or RPS + // (depending on balancingMode). A setting of 0 means the group is + // completely drained, offering 0% of its available CPU or RPS. Valid + // range is [0.0,1.0]. + CapacityScaler float64 `json:"capacityScaler,omitempty"` + + // Description: An optional textual description of the resource. + // Provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Group: The fully-qualified URL of a zonal Instance Group resource. + // This instance group defines the list of instances that serve traffic. + // Member virtual machine instances from each instance group must live + // in the same zone as the instance group itself. No two backends in a + // backend service are allowed to use same Instance Group + // resource. + // + // Note that you must specify an Instance Group resource using the + // fully-qualified URL, rather than a partial URL. + 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.0, 1.0]. + MaxUtilization float64 `json:"maxUtilization,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BalancingMode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Backend) MarshalJSON() ([]byte, error) { + type noMethod Backend + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BackendService: A BackendService resource. This resource defines a +// group of backend virtual machines together with their serving +// capacity. +type BackendService struct { + // Backends: The list of backends that serve this BackendService. + Backends []*Backend `json:"backends,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of resource. Always compute#backendService + // for backend services. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // Port: Deprecated in favor of port name. The TCP port to connect on + // the backend. The default value is 80. + Port int64 `json:"port,omitempty"` + + // PortName: Name of backend port. The same name should appear in the + // resource views referenced by this service. Required. + PortName string `json:"portName,omitempty"` + + // Possible values: + // "HTTP" + // "HTTPS" + Protocol string `json:"protocol,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Backends") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BackendService) MarshalJSON() ([]byte, error) { + type noMethod BackendService + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type BackendServiceGroupHealth struct { + HealthStatus []*HealthStatus `json:"healthStatus,omitempty"` + + // Kind: [Output Only] Type of resource. Always + // compute#backendServiceGroupHealth for the health of backend services. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "HealthStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BackendServiceGroupHealth) MarshalJSON() ([]byte, error) { + type noMethod BackendServiceGroupHealth + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BackendServiceList: Contains a list of BackendService resources. +type BackendServiceList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of BackendService resources. + Items []*BackendService `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always + // compute#backendServiceList for lists of backend services. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BackendServiceList) MarshalJSON() ([]byte, error) { + type noMethod BackendServiceList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomerEncryptionKey: Represents a customer-supplied encryption key +type CustomerEncryptionKey struct { + // RawKey: Specifies a 256-bit customer-supplied encryption key, encoded + // in base64 to either encrypt or decrypt this resource. + RawKey string `json:"rawKey,omitempty"` + + // RsaEncryptedKey: Specifies a base64 encoded, RSA-wrapped 2048-bit + // customer-supplied encryption key to either encrypt or decrypt this + // resource. + // + // The key must meet the following requirements before you can provide + // it to Compute Engine: + // - The key is wrapped using a RSA public key certificate provided by + // Google. + // - After being wrapped, the key must be encoded in base64 encoding. + // Get the RSA public key certificate provided by Google + // at: + // https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingre + // ss.pem + RsaEncryptedKey string `json:"rsaEncryptedKey,omitempty"` + + // Sha256: [Output only] The base64 encoded SHA-256 hash of the + // customer-supplied encryption key that protects this resource. + Sha256 string `json:"sha256,omitempty"` + + // ForceSendFields is a list of field names (e.g. "RawKey") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomerEncryptionKey) MarshalJSON() ([]byte, error) { + type noMethod CustomerEncryptionKey + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DeprecationStatus: Deprecation status for a public resource. +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: The URL of the suggested replacement for a deprecated + // resource. The suggested replacement resource must be the same kind of + // resource as the deprecated resource. + Replacement string `json:"replacement,omitempty"` + + // State: The deprecation state of this resource. This 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. Operations which use OBSOLETE or DELETED resources + // will be rejected and result in an error. + // + // Possible values: + // "DELETED" + // "DEPRECATED" + // "OBSOLETE" + State string `json:"state,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Deleted") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeprecationStatus) MarshalJSON() ([]byte, error) { + type noMethod DeprecationStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Disk: A Disk resource. +type Disk struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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"` + + // DiskEncryptionKey: Encrypts the disk using a customer-supplied + // encryption key. + // + // If you encrypt the disk using a customer-supplied encryption key, and + // you want to use the disk later (e.g. to create a disk snapshot or an + // image, or to attach the disk to a virtual machine), you must provide + // the same key in your request. If you provide an incorrect key, or no + // key, the operation will fail. + // + // Customer-supplied encryption keys do not protect access to metadata + // of the disk. + // + // If no customer-supplied encryption key is provided at creation, then + // the disk will be encrypted using an automatically generated key and + // you do not need to provide a key to use the disk later. + DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always compute#disk for + // disks. + Kind string `json:"kind,omitempty"` + + // LastAttachTimestamp: [Output Only] Last attach timestamp in RFC3339 + // text format. + LastAttachTimestamp string `json:"lastAttachTimestamp,omitempty"` + + // LastDetachTimestamp: [Output Only] Last detach timestamp in RFC3339 + // text format. + LastDetachTimestamp string `json:"lastDetachTimestamp,omitempty"` + + // Licenses: Any applicable publicly visible licenses. + Licenses []string `json:"licenses,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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // Options: Internal use only. + Options string `json:"options,omitempty"` + + // SelfLink: [Output Only] Server-defined fully-qualified URL for this + // resource. + SelfLink string `json:"selfLink,omitempty"` + + // SizeGb: Size of the persistent disk, specified in GB. You can specify + // this field when creating a persistent disk using the sourceImage or + // sourceSnapshot parameter, or specify it alone to create an empty + // persistent disk. + // + // If you specify this field along with sourceImage or sourceSnapshot, + // the value of sizeGb must not be less than the size of the sourceImage + // or the size of the snapshot. + SizeGb int64 `json:"sizeGb,omitempty,string"` + + // SourceImage: The source image used to create this disk. If the source + // image is deleted from the system, this field will not be set, even if + // an image with the same name has been re-created. + // + // When creating a disk, you can provide a private (custom) image using + // the following input, and Compute Engine will use the corresponding + // image from your project. For example: + // + // global/images/my-private-image + // + // Or you can provide an image from a publicly-available project. For + // example, to use a Debian image from the debian-cloud project, make + // sure to include the project in the + // URL: + // + // projects/debian-cloud/global/images/debian-7-wheezy-vYYYYMMDD + // + // where vYYYYMMDD is the image version. The fully-qualified URL will + // also work in both cases. + SourceImage string `json:"sourceImage,omitempty"` + + // SourceImageEncryptionKey: The customer-supplied encryption key of the + // source image. This key is required if the source image is protected + // by a customer-supplied encryption key. + // + // If the incorrect key is provided, the operation will fail. + SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"` + + // SourceImageId: The ID value of the image used to create this disk. + // This value identifies the exact image that was used to create this + // persistent disk. For example, if you created the persistent disk from + // an image that was later deleted and recreated under the same name, + // the source image ID would identify the exact version of the image + // that was used. + SourceImageId string `json:"sourceImageId,omitempty"` + + // SourceSnapshot: The source snapshot used to create this disk. You can + // provide this as a partial or full URL to the resource. For example, + // the following are valid values: + // - + // https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot + // - projects/project/global/snapshots/snapshot + // - global/snapshots/snapshot + SourceSnapshot string `json:"sourceSnapshot,omitempty"` + + // SourceSnapshotEncryptionKey: The customer-supplied encryption key of + // the source snapshot. This key is required if the source snapshot is + // protected by a customer-supplied encryption key. + // + // If the incorrect key is provided, the operation will fail. + SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"` + + // SourceSnapshotId: [Output Only] The unique ID of the snapshot used to + // create this disk. This value identifies the exact snapshot that was + // used to create this persistent disk. For example, if you created the + // persistent disk from a snapshot that was later deleted and recreated + // under the same name, the source snapshot ID would identify the exact + // version of the snapshot that was used. + SourceSnapshotId string `json:"sourceSnapshotId,omitempty"` + + // Status: [Output Only] The status of disk creation. Applicable + // statuses includes: CREATING, FAILED, READY, RESTORING. + // + // Possible values: + // "CREATING" + // "FAILED" + // "READY" + // "RESTORING" + Status string `json:"status,omitempty"` + + // StorageType: [Deprecated] Storage type of the persistent disk. + // + // Possible values: + // "HDD" + // "SSD" + StorageType string `json:"storageType,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"` + + // Users: Links to the users of the disk (attached instances) in form: + // project/zones/zone/instances/instance + Users []string `json:"users,omitempty"` + + // Zone: [Output Only] URL of the zone where the disk resides. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Disk) MarshalJSON() ([]byte, error) { + type noMethod Disk + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DiskAggregatedList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A map of scoped disk lists. + Items map[string]DisksScopedList `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always + // compute#diskAggregatedList for aggregated lists of persistent disks. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DiskAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod DiskAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DiskList: A list of Disk resources. +type DiskList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of persistent disks. + Items []*Disk `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#diskList for + // lists of disks. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DiskList) MarshalJSON() ([]byte, error) { + type noMethod DiskList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DiskType: A disk type resource. +type DiskType struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // DefaultDiskSizeGb: [Output Only] Server-defined default disk size in + // GB. + DefaultDiskSizeGb int64 `json:"defaultDiskSizeGb,omitempty,string"` + + // Deprecated: [Output Only] The deprecation status associated with this + // disk type. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: [Output Only] An optional textual description of the + // resource. + Description string `json:"description,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always compute#diskType for + // disk types. + Kind string `json:"kind,omitempty"` + + // Name: [Output Only] Name of the resource. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ValidDiskSize: [Output Only] An optional textual description of the + // valid disk size, such as "10GB-10TB". + ValidDiskSize string `json:"validDiskSize,omitempty"` + + // Zone: [Output Only] URL of the zone where the disk type resides. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DiskType) MarshalJSON() ([]byte, error) { + type noMethod DiskType + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DiskTypeAggregatedList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A map of scoped disk type lists. + Items map[string]DiskTypesScopedList `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always + // compute#diskTypeAggregatedList. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DiskTypeAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod DiskTypeAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DiskTypeList: Contains a list of disk type resources. +type DiskTypeList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of Disk Type resources. + Items []*DiskType `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#diskTypeList for + // disk types. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DiskTypeList) MarshalJSON() ([]byte, error) { + type noMethod DiskTypeList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DiskTypesScopedList struct { + // DiskTypes: [Output Only] List of disk types contained in this scope. + DiskTypes []*DiskType `json:"diskTypes,omitempty"` + + // Warning: [Output Only] Informational warning which replaces the list + // of disk types when the list is empty. + Warning *DiskTypesScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DiskTypes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DiskTypesScopedList) MarshalJSON() ([]byte, error) { + type noMethod DiskTypesScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DiskTypesScopedListWarning: [Output Only] Informational warning which +// replaces the list of disk types when the list is empty. +type DiskTypesScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*DiskTypesScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DiskTypesScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod DiskTypesScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DiskTypesScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DiskTypesScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod DiskTypesScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DisksScopedList struct { + // Disks: [Output Only] List of disks contained in this scope. + Disks []*Disk `json:"disks,omitempty"` + + // Warning: [Output Only] Informational warning which replaces the list + // of disks when the list is empty. + Warning *DisksScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Disks") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DisksScopedList) MarshalJSON() ([]byte, error) { + type noMethod DisksScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DisksScopedListWarning: [Output Only] Informational warning which +// replaces the list of disks when the list is empty. +type DisksScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*DisksScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DisksScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod DisksScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DisksScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DisksScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod DisksScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Firewall: A Firewall resource. +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: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Ony] Type of the resource. Always compute#firewall for + // firewall rules. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // Network: URL of the network resource for this firewall rule. This + // field is required for creating an instance but optional when creating + // a firewall rule. If not specified when creating a firewall rule, the + // default network is used: + // global/networks/default + // If you choose to specify this property, you can specify the network + // as a full or partial URL. For example, the following are all valid + // URLs: + // - + // https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network + // - projects/myproject/global/networks/my-network + // - global/networks/default + Network string `json:"network,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // SourceRanges: The IP address blocks that this rule applies to, + // expressed in CIDR format. One or both of sourceRanges and sourceTags + // may be set. + // + // If both properties are set, an inbound connection is allowed if the + // range matches the sourceRanges OR the tag of the source matches the + // sourceTags property. The connection does not need to match both + // properties. + 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. + // + // If both properties are set, an inbound connection is allowed if the + // range matches the sourceRanges OR the tag of the source matches the + // sourceTags property. The connection does not need to match both + // properties. + SourceTags []string `json:"sourceTags,omitempty"` + + // TargetTags: A list of instance tags indicating sets of instances + // located in the network that 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Allowed") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Firewall) MarshalJSON() ([]byte, error) { + type noMethod Firewall + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type FirewallAllowed struct { + // IPProtocol: The IP protocol that is allowed for this rule. The + // protocol type is required when creating a firewall. This value 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. This field is + // only applicable for UDP or TCP protocol. 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"` + + // ForceSendFields is a list of field names (e.g. "IPProtocol") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FirewallAllowed) MarshalJSON() ([]byte, error) { + type noMethod FirewallAllowed + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FirewallList: Contains a list of Firewall resources. +type FirewallList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of Firewall resources. + Items []*Firewall `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#firewallList for + // lists of firewalls. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FirewallList) MarshalJSON() ([]byte, error) { + type noMethod FirewallList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ForwardingRule: A ForwardingRule resource. A ForwardingRule resource +// specifies which pool of target virtual machines to forward a packet +// to if it matches the given [IPAddress, IPProtocol, portRange] tuple. +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. + // + // Possible values: + // "AH" + // "ESP" + // "SCTP" + // "TCP" + // "UDP" + IPProtocol string `json:"IPProtocol,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always + // compute#forwardingRule. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + 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. Forwarding rules with the same `[IPAddress, IPProtocol]` + // pair must have disjoint port ranges. + PortRange string `json:"portRange,omitempty"` + + // Region: [Output Only] URL of the region where the regional forwarding + // rule resides. This field is not applicable to global forwarding + // rules. + Region string `json:"region,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + 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 or TargetHttpsProxy resource. + Target string `json:"target,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "IPAddress") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ForwardingRule) MarshalJSON() ([]byte, error) { + type noMethod ForwardingRule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ForwardingRuleAggregatedList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A map of scoped forwarding rule lists. + Items map[string]ForwardingRulesScopedList `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ForwardingRuleAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod ForwardingRuleAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ForwardingRuleList: Contains a list of ForwardingRule resources. +type ForwardingRuleList struct { + // Id: [Output Only] Unique identifier for the resource. Set by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of ForwardingRule resources. + Items []*ForwardingRule `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ForwardingRuleList) MarshalJSON() ([]byte, error) { + type noMethod ForwardingRuleList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "ForwardingRules") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ForwardingRulesScopedList) MarshalJSON() ([]byte, error) { + type noMethod ForwardingRulesScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ForwardingRulesScopedListWarning: Informational warning which +// replaces the list of forwarding rules when the list is empty. +type ForwardingRulesScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*ForwardingRulesScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ForwardingRulesScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod ForwardingRulesScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ForwardingRulesScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ForwardingRulesScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod ForwardingRulesScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type HealthCheckReference struct { + HealthCheck string `json:"healthCheck,omitempty"` + + // ForceSendFields is a list of field names (e.g. "HealthCheck") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HealthCheckReference) MarshalJSON() ([]byte, error) { + type noMethod HealthCheckReference + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type HealthStatus struct { + // HealthState: Health state of the instance. + // + // Possible values: + // "HEALTHY" + // "UNHEALTHY" + 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"` + + // Port: The port on the instance. + Port int64 `json:"port,omitempty"` + + // ForceSendFields is a list of field names (e.g. "HealthState") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HealthStatus) MarshalJSON() ([]byte, error) { + type noMethod HealthStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// HostRule: UrlMaps A host-matching rule for a URL. If matched, will +// use the named PathMatcher to select the BackendService. +type HostRule struct { + // Description: An optional textual description. + Description string `json:"description,omitempty"` + + // Hosts: The list of host patterns to match. They must be valid + // hostnames, except * will match any string of ([a-z0-9-.]*). In that + // case, * must be the first character and must be followed in the + // pattern by either - or .. + Hosts []string `json:"hosts,omitempty"` + + // PathMatcher: The name of the PathMatcher to use to match the path + // portion of the URL if the hostRule matches the URL's host portion. + PathMatcher string `json:"pathMatcher,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HostRule) MarshalJSON() ([]byte, error) { + type noMethod HostRule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// HttpHealthCheck: An HttpHealthCheck resource. This resource defines a +// template for how individual instances should be checked for health, +// via HTTP. +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: [Output Only] Creation timestamp in RFC3339 text + // format. + 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 instance 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: [Output Only] Unique identifier for the resource. Defined by the + // server. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + 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: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // TimeoutSec: How long (in seconds) to wait before claiming failure. + // The default value is 5 seconds. It is invalid for timeoutSec to have + // greater value than checkIntervalSec. + TimeoutSec int64 `json:"timeoutSec,omitempty"` + + // UnhealthyThreshold: A so-far healthy instance will be marked + // unhealthy after this many consecutive failures. The default value is + // 2. + UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HttpHealthCheck) MarshalJSON() ([]byte, error) { + type noMethod HttpHealthCheck + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// HttpHealthCheckList: Contains a list of HttpHealthCheck resources. +type HttpHealthCheckList struct { + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of HttpHealthCheck resources. + Items []*HttpHealthCheck `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HttpHealthCheckList) MarshalJSON() ([]byte, error) { + type noMethod HttpHealthCheckList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// HttpsHealthCheck: An HttpsHealthCheck resource. This resource defines +// a template for how individual instances should be checked for health, +// via HTTPS. +type HttpsHealthCheck struct { + // CheckIntervalSec: How often (in seconds) to send a health check. The + // default value is 5 seconds. + CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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 instance 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 HTTPS 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: [Output Only] Unique identifier for the resource; defined by the + // server. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // Port: The TCP port number for the HTTPS health check request. The + // default value is 443. + Port int64 `json:"port,omitempty"` + + // RequestPath: The request path of the HTTPS health check request. The + // default value is "/". + RequestPath string `json:"requestPath,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // TimeoutSec: How long (in seconds) to wait before claiming failure. + // The default value is 5 seconds. It is invalid for timeoutSec to have + // a greater value than checkIntervalSec. + TimeoutSec int64 `json:"timeoutSec,omitempty"` + + // UnhealthyThreshold: A so-far healthy instance will be marked + // unhealthy after this many consecutive failures. The default value is + // 2. + UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HttpsHealthCheck) MarshalJSON() ([]byte, error) { + type noMethod HttpsHealthCheck + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// HttpsHealthCheckList: Contains a list of HttpsHealthCheck resources. +type HttpsHealthCheckList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of HttpsHealthCheck resources. + Items []*HttpsHealthCheck `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HttpsHealthCheckList) MarshalJSON() ([]byte, error) { + type noMethod HttpsHealthCheckList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Image: An Image resource. +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: [Output Only] Creation timestamp in RFC3339 text + // format. + 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 persistent disk + // (in GB). + DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // ImageEncryptionKey: Encrypts the image using a customer-supplied + // encryption key. + // + // If you encrypt an image using a customer-supplied encryption key, and + // you want to use the image later (e.g. to create a disk from the + // image), you must provide the same key used encrypt the image in your + // future request. If you provide an incorrect key, or no key, the + // operation will fail. + // + // Customer-supplied encryption keys do not protect access to metadata + // of the disk. + // + // If no customer-supplied encryption key is provided at creation, then + // the disk will be encrypted using an automatically generated key and + // you do not need to provide a key to use the image later. + ImageEncryptionKey *CustomerEncryptionKey `json:"imageEncryptionKey,omitempty"` + + // Kind: [Output Only] Type of the resource. Always compute#image for + // images. + Kind string `json:"kind,omitempty"` + + // Licenses: Any applicable publicly visible licenses. + Licenses []string `json:"licenses,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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // RawDisk: The parameters of the raw disk image. + RawDisk *ImageRawDisk `json:"rawDisk,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // SourceDisk: URL of the The source disk used to create this image. + // This can be a full or valid partial URL. You must provide either this + // property or the rawDisk.source property but not both to create an + // image. For example, the following are valid values: + // - + // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disk/disk + // - projects/project/zones/zone/disk/disk + // - zones/zone/disks/disk + SourceDisk string `json:"sourceDisk,omitempty"` + + // SourceDiskEncryptionKey: Specifies the customer-supplied encryption + // key of the source disk. This key is required if the source disk is + // protected by a customer-supplied encryption key. + // + // If the incorrect key is provided the operation will fail. + SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"` + + // SourceDiskId: The ID value of the disk used to create this image. + // This value may be used to determine whether the image was taken from + // the current or a previous instance of a given disk name. + SourceDiskId string `json:"sourceDiskId,omitempty"` + + // SourceType: The type of the image used to create this disk. The + // default and only value is RAW + // + // Possible values: + // "RAW" (default) + SourceType string `json:"sourceType,omitempty"` + + // Status: [Output Only] The status of the image. An image can be used + // to create other resources, such as instances, only after the image + // has been successfully created and the status is set to READY. + // Possible values are FAILED, PENDING, or READY. + // + // Possible values: + // "FAILED" + // "PENDING" + // "READY" + Status string `json:"status,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ArchiveSizeBytes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Image) MarshalJSON() ([]byte, error) { + type noMethod Image + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ImageRawDisk: The parameters of the raw disk image. +type ImageRawDisk struct { + // ContainerType: The format used to encode and transmit the block + // device, which 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. + // + // Possible values: + // "TAR" + 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. You must provide either this property or the sourceDisk + // property but not both. + Source string `json:"source,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ContainerType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ImageRawDisk) MarshalJSON() ([]byte, error) { + type noMethod ImageRawDisk + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ImageList: Contains a list of Image resources. +type ImageList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of Image resources. + Items []*Image `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ImageList) MarshalJSON() ([]byte, error) { + type noMethod ImageList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Instance: An Instance resource. +type Instance struct { + // CanIpForward: Allows this instance to send and receive packets with + // non-matching destination or source IPs. This is required if you plan + // to use this instance to forward routes. For more information, see + // Enabling IP Forwarding. + CanIpForward bool `json:"canIpForward,omitempty"` + + // CpuPlatform: [Output Only] The CPU platform used by this instance. + CpuPlatform string `json:"cpuPlatform,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always compute#instance for + // instances. + Kind string `json:"kind,omitempty"` + + // LabelFingerprint: A fingerprint for this request, which is + // essentially a hash of the metadata's contents and used for optimistic + // locking. The fingerprint is initially generated by Compute Engine and + // changes after every request to modify or update metadata. You must + // always provide an up-to-date fingerprint hash in order to update or + // change metadata. + // + // To see the latest fingerprint, make get() request to the instance. + LabelFingerprint string `json:"labelFingerprint,omitempty"` + + // Labels: Labels to apply to this instance. These can be later modified + // by the setLabels method. Each label key & value must comply with + // RFC1035. Label values may be empty. + Labels map[string]string `json:"labels,omitempty"` + + // MachineType: Full or partial URL of the machine type resource to use + // for this instance. This is provided by the client when the instance + // is created. For example, the following is a valid partial + // url: + // + // zones/zone/machineTypes/machine-type + MachineType string `json:"machineType,omitempty"` + + // Metadata: The metadata key/value pairs assigned to this instance. + // This includes custom metadata and predefined keys. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // NetworkInterfaces: An 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. + NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"` + + // Scheduling: Scheduling options for this instance. + Scheduling *Scheduling `json:"scheduling,omitempty"` + + // SelfLink: [Output Only] Server defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServiceAccounts: A list of service accounts, with their specified + // scopes, authorized for this instance. Service accounts generate + // access tokens that can be accessed through the metadata server and + // used to authenticate applications on the instance. See Authenticating + // from Google Compute Engine for more information. + ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"` + + // Status: [Output Only] The status of the instance. One of the + // following values: PROVISIONING, STAGING, RUNNING, STOPPING, and + // TERMINATED. + // + // Possible values: + // "PROVISIONING" + // "RUNNING" + // "STAGING" + // "STOPPED" + // "STOPPING" + // "SUSPENDED" + // "SUSPENDING" + // "TERMINATED" + Status string `json:"status,omitempty"` + + // StatusMessage: [Output Only] An optional, human-readable explanation + // of the status. + StatusMessage string `json:"statusMessage,omitempty"` + + // Tags: A list of tags to appy to this instance. Tags are used to + // identify valid sources or targets for network firewalls and are + // specified by the client during 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: [Output Only] URL of the zone where the instance resides. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CanIpForward") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Instance) MarshalJSON() ([]byte, error) { + type noMethod Instance + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceAggregatedList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A map of scoped instance lists. + Items map[string]InstancesScopedList `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always + // compute#instanceAggregatedList for aggregated lists of Instance + // resources. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod InstanceAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroup struct { + // CreationTimestamp: [Output Only] The creation timestamp for this + // instance group in RFC3339 text format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional text description for the instance group. + Description string `json:"description,omitempty"` + + // Fingerprint: [Output Only] The fingerprint of the named ports. The + // system uses this fingerprint to detect conflicts when multiple users + // change the named ports concurrently. + Fingerprint string `json:"fingerprint,omitempty"` + + // Id: [Output Only] A unique identifier for this resource type. The + // server generates this identifier. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] The resource type, which is always + // compute#instanceGroup for instance groups. + Kind string `json:"kind,omitempty"` + + // Name: The name of the instance group. The name must be 1-63 + // characters long, and comply with RFC1035. + Name string `json:"name,omitempty"` + + // NamedPorts: Assigns a name to a port number. For example: {name: + // "http", port: 80} + // + // This allows the system to reference ports by the assigned name + // instead of a port number. Named ports can also contain multiple + // ports. For example: [{name: "http", port: 80},{name: "http", port: + // 8080}] + // + // Named ports apply to all instances in this instance group. + NamedPorts []*NamedPort `json:"namedPorts,omitempty"` + + // Network: [Output Only] The URL of the network to which all instances + // in the instance group belong. + Network string `json:"network,omitempty"` + + // SelfLink: [Output Only] The URL for this instance group. The server + // generates this URL. + SelfLink string `json:"selfLink,omitempty"` + + // Size: [Output Only] The total number of instances in the instance + // group. + Size int64 `json:"size,omitempty"` + + // Zone: [Output Only] The URL of the zone where the instance group is + // located. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroup) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupAggregatedList struct { + // Id: [Output Only] A unique identifier for this aggregated list of + // instance groups. The server generates this identifier. + Id string `json:"id,omitempty"` + + // Items: A map of scoped instance group lists. + Items map[string]InstanceGroupsScopedList `json:"items,omitempty"` + + // Kind: [Output Only] The resource type, which is always + // compute#instanceGroupAggregatedList for aggregated lists of instance + // groups. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token that is used to continue a + // truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] The URL for this resource type. The server + // generates this URL. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceGroupList: A list of InstanceGroup resources. +type InstanceGroupList struct { + // Id: [Output Only] A unique identifier for this list of instance + // groups. The server generates this identifier. + Id string `json:"id,omitempty"` + + // Items: A list of instance groups. + Items []*InstanceGroup `json:"items,omitempty"` + + // Kind: [Output Only] The resource type, which is always + // compute#instanceGroupList for instance group lists. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token that is used to continue a + // truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] The URL for this resource type. The server + // generates this URL. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupList) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceGroupManager: InstanceGroupManagers +// +// Next available tag: 19 +type InstanceGroupManager struct { + // AutoHealingPolicies: The autohealing policy for this managed instance + // group. You can specify only one value. + AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"` + + // BaseInstanceName: The base instance name to use for instances in this + // group. The value must be 1-58 characters long. Instances are named by + // appending a hyphen and a random four-character string to the base + // instance name. The base instance name must comply with RFC1035. + BaseInstanceName string `json:"baseInstanceName,omitempty"` + + // CreationTimestamp: [Output Only] The creation timestamp for this + // managed instance group in RFC3339 text format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // CurrentActions: [Output Only] The list of instance actions and the + // number of instances in this managed instance group that are scheduled + // for each of those actions. + CurrentActions *InstanceGroupManagerActionsSummary `json:"currentActions,omitempty"` + + // Description: An optional text description for the managed instance + // group. + Description string `json:"description,omitempty"` + + // Fingerprint: [Output Only] The fingerprint of the target pools + // information. You can use this optional field for optimistic locking + // when you update the target pool entries. + Fingerprint string `json:"fingerprint,omitempty"` + + // Id: [Output Only] A unique identifier for this resource type. The + // server generates this identifier. + Id uint64 `json:"id,omitempty,string"` + + // InstanceGroup: [Output Only] The URL of the Instance Group resource. + InstanceGroup string `json:"instanceGroup,omitempty"` + + // InstanceTemplate: The URL of the instance template that is specified + // for this managed instance group. The group uses this template to + // create all new instances in the managed instance group. + InstanceTemplate string `json:"instanceTemplate,omitempty"` + + // Kind: [Output Only] The resource type, which is always + // compute#instanceGroupManager for managed instance groups. + Kind string `json:"kind,omitempty"` + + // Name: The name of the managed instance group. The name must be 1-63 + // characters long, and comply with RFC1035. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] The URL for this managed instance group. The + // server defines this URL. + SelfLink string `json:"selfLink,omitempty"` + + // TargetPools: The URLs for all TargetPool resources to which instances + // in the instanceGroup field are added. The target pools automatically + // apply to all of the instances in the managed instance group. + TargetPools []string `json:"targetPools,omitempty"` + + // TargetSize: The target number of running instances for this managed + // instance group. Deleting or abandoning instances reduces this number. + // Resizing the group changes this number. + TargetSize int64 `json:"targetSize,omitempty"` + + // Zone: The name of the zone where the managed instance group is + // located. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManager) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManager + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagerActionsSummary struct { + // Abandoning: [Output Only] The total number of instances in the + // managed instance group that are scheduled to be abandoned. Abandoning + // an instance removes it from the managed instance group without + // deleting it. + Abandoning int64 `json:"abandoning,omitempty"` + + // Creating: [Output Only] The number of instances in the managed + // instance group that are scheduled to be created or are currently + // being created. + Creating int64 `json:"creating,omitempty"` + + // Deleting: [Output Only] The number of instances in the managed + // instance group that are scheduled to be deleted or are currently + // being deleted. + Deleting int64 `json:"deleting,omitempty"` + + // None: [Output Only] The number of instances in the managed instance + // group that are running and have no scheduled actions. + None int64 `json:"none,omitempty"` + + // Recreating: [Output Only] The number of instances in the managed + // instance group that are scheduled to be recreated or are currently + // being being recreated. Recreating an instance deletes the existing + // root persistent disk and creates a new disk from the image that is + // defined in the instance template. + Recreating int64 `json:"recreating,omitempty"` + + // Refreshing: [Output Only] The number of instances in the managed + // instance group that are being reconfigured with properties that do + // not require a restart or a recreate action. For example, setting or + // removing target pools for the instance. + Refreshing int64 `json:"refreshing,omitempty"` + + // Restarting: [Output Only] The number of instances in the managed + // instance group that are scheduled to be restarted or are currently + // being restarted. + Restarting int64 `json:"restarting,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Abandoning") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagerActionsSummary) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagerActionsSummary + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagerAggregatedList struct { + // Id: [Output Only] A unique identifier for this aggregated list of + // managed instance groups. The server generates this identifier. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A map of filtered managed instance group lists. + Items map[string]InstanceGroupManagersScopedList `json:"items,omitempty"` + + // Kind: [Output Only] The resource type, which is always + // compute#instanceGroupManagerAggregatedList for an aggregated list of + // managed instance groups. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token that is used to continue a + // truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] The URL for this resource type. The server + // generates this URL. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagerAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagerAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagerAutoHealingPolicy struct { + // ActionType: The action to perform when an instance in this group + // becomes unhealthy. Possible values are RECREATE or RESTART. RECREATE + // replaces an unhealthy instance using the same name and instance + // template as the unhealthy instance. RESTART performs a soft restart + // on an instance. If the instance cannot reboot, the instance performs + // a hard restart. + // + // Possible values: + // "RECREATE" + // "RESTART" + ActionType string `json:"actionType,omitempty"` + + // HealthCheck: The URL for the HealthCheck that signals autohealing. + HealthCheck string `json:"healthCheck,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ActionType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagerAutoHealingPolicy) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagerAutoHealingPolicy + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceGroupManagerList: [Output Only] A list of managed instance +// groups. +type InstanceGroupManagerList struct { + // Id: [Output Only] A unique identifier for this resource type. The + // server generates this identifier. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of managed instance groups. + Items []*InstanceGroupManager `json:"items,omitempty"` + + // Kind: [Output Only] The resource type, which is always + // compute#instanceGroupManagerList for a list of managed instance + // groups. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token that is used to continue a + // truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] The URL for this resource type. The server + // generates this URL. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagerList) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagerList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersAbandonInstancesRequest struct { + // Instances: The URL for one or more instances to abandon from the + // managed instance group. + Instances []string `json:"instances,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersAbandonInstancesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersDeleteInstancesRequest struct { + // Instances: The list of instances to delete from this managed instance + // group. Specify one or more instance URLs. + Instances []string `json:"instances,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersDeleteInstancesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersListManagedInstancesResponse struct { + // ManagedInstances: [Output Only] The list of instances in the managed + // instance group. + ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ManagedInstances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersListManagedInstancesResponse) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersListManagedInstancesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersRecreateInstancesRequest struct { + // Instances: The URL for one or more instances to recreate. + Instances []string `json:"instances,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersRecreateInstancesRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersRecreateInstancesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersScopedList struct { + // InstanceGroupManagers: [Output Only] The list of managed instance + // groups that are contained in the specified project and zone. + InstanceGroupManagers []*InstanceGroupManager `json:"instanceGroupManagers,omitempty"` + + // Warning: [Output Only] The warning that replaces the list of managed + // instance groups when the list is empty. + Warning *InstanceGroupManagersScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "InstanceGroupManagers") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersScopedList) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceGroupManagersScopedListWarning: [Output Only] The warning +// that replaces the list of managed instance groups when the list is +// empty. +type InstanceGroupManagersScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*InstanceGroupManagersScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersSetAutoHealingRequest struct { + AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersSetAutoHealingRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersSetAutoHealingRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersSetInstanceTemplateRequest struct { + // InstanceTemplate: The URL of the instance template that is specified + // for this managed instance group. The group uses this template to + // create all new instances in the managed instance group. + InstanceTemplate string `json:"instanceTemplate,omitempty"` + + // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersSetInstanceTemplateRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersSetInstanceTemplateRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersSetTargetPoolsRequest struct { + // Fingerprint: The fingerprint of the target pools information. Use + // this optional property to prevent conflicts when multiple users + // change the target pools settings concurrently. Obtain the fingerprint + // with the instanceGroupManagers.get method. Then, include the + // fingerprint in your request to ensure that you do not overwrite + // changes that were applied from another concurrent request. + Fingerprint string `json:"fingerprint,omitempty"` + + // TargetPools: The list of target pool URLs that instances in this + // managed instance group belong to. The managed instance group applies + // these target pools to all of the instances in the group. Existing + // instances and new instances in the group all receive these target + // pool settings. + TargetPools []string `json:"targetPools,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Fingerprint") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersSetTargetPoolsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupsAddInstancesRequest struct { + // Instances: The list of instances to add to the instance group. + Instances []*InstanceReference `json:"instances,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupsAddInstancesRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupsAddInstancesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupsListInstances struct { + // Id: [Output Only] A unique identifier for this list of instance + // groups. The server generates this identifier. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of instances and any named ports that are + // assigned to those instances. + Items []*InstanceWithNamedPorts `json:"items,omitempty"` + + // Kind: [Output Only] The resource type, which is always + // compute#instanceGroupsListInstances for lists of instance groups. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token that is used to continue a + // truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] The URL for this list of instance groups. The + // server generates this URL. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupsListInstances) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupsListInstances + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupsListInstancesRequest struct { + // InstanceState: A filter for the state of the instances in the + // instance group. Valid options are ALL or RUNNING. If you do not + // specify this parameter the list includes all instances regardless of + // their state. + // + // Possible values: + // "ALL" + // "RUNNING" + InstanceState string `json:"instanceState,omitempty"` + + // ForceSendFields is a list of field names (e.g. "InstanceState") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupsListInstancesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupsRemoveInstancesRequest struct { + // Instances: The list of instances to remove from the instance group. + Instances []*InstanceReference `json:"instances,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupsRemoveInstancesRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupsRemoveInstancesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupsScopedList struct { + // InstanceGroups: [Output Only] The list of instance groups that are + // contained in this scope. + InstanceGroups []*InstanceGroup `json:"instanceGroups,omitempty"` + + // Warning: [Output Only] An informational warning that replaces the + // list of instance groups when the list is empty. + Warning *InstanceGroupsScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "InstanceGroups") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupsScopedList) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupsScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceGroupsScopedListWarning: [Output Only] An informational +// warning that replaces the list of instance groups when the list is +// empty. +type InstanceGroupsScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*InstanceGroupsScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupsScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupsScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupsScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupsScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupsScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupsSetNamedPortsRequest struct { + // Fingerprint: The fingerprint of the named ports information for this + // instance group. Use this optional property to prevent conflicts when + // multiple users change the named ports settings concurrently. Obtain + // the fingerprint with the instanceGroups.get method. Then, include the + // fingerprint in your request to ensure that you do not overwrite + // changes that were applied from another concurrent request. + Fingerprint string `json:"fingerprint,omitempty"` + + // NamedPorts: The list of named ports to set for this instance group. + NamedPorts []*NamedPort `json:"namedPorts,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Fingerprint") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupsSetNamedPortsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceList: Contains a list of instance resources. +type InstanceList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of Instance resources. + Items []*Instance `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#instanceList for + // lists of Instance resources. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceList) MarshalJSON() ([]byte, error) { + type noMethod InstanceList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceProperties struct { + // CanIpForward: Enables instances created based on this template to + // send packets with source IP addresses other than their own and + // receive packets with destination IP addresses other than their own. + // If these instances will be used as an IP gateway or it will be set as + // the next-hop in a Route resource, specify true. If unsure, leave this + // set to false. See the canIpForward documentation for more + // information. + CanIpForward bool `json:"canIpForward,omitempty"` + + // Description: An optional text description for the instances that are + // created from this instance template. + Description string `json:"description,omitempty"` + + // Disks: An array of disks that are associated with the instances that + // are created from this template. + Disks []*AttachedDisk `json:"disks,omitempty"` + + // MachineType: The machine type to use for instances that are created + // from this template. + MachineType string `json:"machineType,omitempty"` + + // Metadata: The metadata key/value pairs to assign to instances that + // are created from this template. These pairs can consist of custom + // metadata or predefined keys. See Project and instance metadata for + // more information. + Metadata *Metadata `json:"metadata,omitempty"` + + // NetworkInterfaces: An array of network access configurations for this + // interface. + NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"` + + // Scheduling: Specifies the scheduling options for the instances that + // are created from this template. + Scheduling *Scheduling `json:"scheduling,omitempty"` + + // ServiceAccounts: A list of service accounts with specified scopes. + // Access tokens for these service accounts are available to the + // instances that are created from this template. Use metadata queries + // to obtain the access tokens for these instances. + ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"` + + // Tags: A list of tags to apply to the instances that are created from + // this template. The tags identify valid sources or targets for network + // firewalls. The setTags method can modify this list of tags. Each tag + // within the list must comply with RFC1035. + Tags *Tags `json:"tags,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CanIpForward") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceProperties) MarshalJSON() ([]byte, error) { + type noMethod InstanceProperties + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceReference struct { + // Instance: The URL for a specific instance. + Instance string `json:"instance,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instance") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceReference) MarshalJSON() ([]byte, error) { + type noMethod InstanceReference + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceTemplate: An Instance Template resource. +type InstanceTemplate struct { + // CreationTimestamp: [Output Only] The creation timestamp for this + // instance template in RFC3339 text format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional text description for the instance template. + Description string `json:"description,omitempty"` + + // Id: [Output Only] A unique identifier for this instance template. The + // server defines this identifier. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] The resource type, which is always + // compute#instanceTemplate for instance templates. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // Properties: The instance properties for this instance template. + Properties *InstanceProperties `json:"properties,omitempty"` + + // SelfLink: [Output Only] The URL for this instance template. The + // server defines this URL. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceTemplate) MarshalJSON() ([]byte, error) { + type noMethod InstanceTemplate + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceTemplateList: A list of instance templates. +type InstanceTemplateList struct { + // Id: [Output Only] A unique identifier for this instance template. The + // server defines this identifier. + Id string `json:"id,omitempty"` + + // Items: [Output Only] list of InstanceTemplate resources. + Items []*InstanceTemplate `json:"items,omitempty"` + + // Kind: [Output Only] The resource type, which is always + // compute#instanceTemplatesListResponse for instance template lists. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token that is used to continue a + // truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] The URL for this instance template list. The + // server defines this URL. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceTemplateList) MarshalJSON() ([]byte, error) { + type noMethod InstanceTemplateList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceWithNamedPorts struct { + // Instance: [Output Only] The URL of the instance. + Instance string `json:"instance,omitempty"` + + // NamedPorts: [Output Only] The named ports that belong to this + // instance group. + NamedPorts []*NamedPort `json:"namedPorts,omitempty"` + + // Status: [Output Only] The status of the instance. + // + // Possible values: + // "PROVISIONING" + // "RUNNING" + // "STAGING" + // "STOPPED" + // "STOPPING" + // "SUSPENDED" + // "SUSPENDING" + // "TERMINATED" + Status string `json:"status,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instance") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceWithNamedPorts) MarshalJSON() ([]byte, error) { + type noMethod InstanceWithNamedPorts + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstancesScopedList struct { + // Instances: [Output Only] List of instances contained in this scope. + Instances []*Instance `json:"instances,omitempty"` + + // Warning: [Output Only] Informational warning which replaces the list + // of instances when the list is empty. + Warning *InstancesScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesScopedList) MarshalJSON() ([]byte, error) { + type noMethod InstancesScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstancesScopedListWarning: [Output Only] Informational warning which +// replaces the list of instances when the list is empty. +type InstancesScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*InstancesScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod InstancesScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstancesScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod InstancesScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstancesSetLabelsRequest struct { + LabelFingerprint string `json:"labelFingerprint,omitempty"` + + Labels map[string]string `json:"labels,omitempty"` + + // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesSetLabelsRequest) MarshalJSON() ([]byte, error) { + type noMethod InstancesSetLabelsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstancesSetMachineTypeRequest struct { + // MachineType: Full or partial URL of the machine type resource. See + // Instance.machine_type. + MachineType string `json:"machineType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MachineType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesSetMachineTypeRequest) MarshalJSON() ([]byte, error) { + type noMethod InstancesSetMachineTypeRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// License: A license resource. +type License struct { + // ChargesUseFee: If true, the customer will be charged license fee for + // running software that contains this license on an instance. + ChargesUseFee bool `json:"chargesUseFee,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#license for + // licenses. + Kind string `json:"kind,omitempty"` + + // Name: [Output Only] Name of the resource. The name is 1-63 characters + // long and complies with RFC1035. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ChargesUseFee") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *License) MarshalJSON() ([]byte, error) { + type noMethod License + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MachineType: A Machine Type resource. +type MachineType struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Deprecated: [Output Only] The deprecation status associated with this + // machine type. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: [Output Only] An optional textual description of the + // resource. + Description string `json:"description,omitempty"` + + // GuestCpus: [Output Only] The tumber of CPUs exposed to the instance. + GuestCpus int64 `json:"guestCpus,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // MaximumPersistentDisks: [Output Only] Maximum persistent disks + // allowed. + MaximumPersistentDisks int64 `json:"maximumPersistentDisks,omitempty"` + + // MaximumPersistentDisksSizeGb: [Output Only] Maximum total persistent + // disks size (GB) allowed. + MaximumPersistentDisksSizeGb int64 `json:"maximumPersistentDisksSizeGb,omitempty,string"` + + // MemoryMb: [Output Only] The amount of physical memory available to + // the instance, defined in MB. + MemoryMb int64 `json:"memoryMb,omitempty"` + + // Name: [Output Only] Name of the resource. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // Zone: [Output Only] The name of the zone where the machine type + // resides, such as us-central1-a. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MachineType) MarshalJSON() ([]byte, error) { + type noMethod MachineType + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type MachineTypeAggregatedList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A map of scoped machine type lists. + Items map[string]MachineTypesScopedList `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always + // compute#machineTypeAggregatedList for aggregated lists of machine + // types. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MachineTypeAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod MachineTypeAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MachineTypeList: Contains a list of Machine Type resources. +type MachineTypeList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of Machine Type resources. + Items []*MachineType `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#machineTypeList + // for lists of machine types. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MachineTypeList) MarshalJSON() ([]byte, error) { + type noMethod MachineTypeList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type MachineTypesScopedList struct { + // MachineTypes: [Output Only] List of machine types contained in this + // scope. + MachineTypes []*MachineType `json:"machineTypes,omitempty"` + + // Warning: [Output Only] An informational warning that appears when the + // machine types list is empty. + Warning *MachineTypesScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MachineTypes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MachineTypesScopedList) MarshalJSON() ([]byte, error) { + type noMethod MachineTypesScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MachineTypesScopedListWarning: [Output Only] An informational warning +// that appears when the machine types list is empty. +type MachineTypesScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*MachineTypesScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MachineTypesScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod MachineTypesScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type MachineTypesScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MachineTypesScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod MachineTypesScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ManagedInstance struct { + // CurrentAction: [Output Only] The current action that the managed + // instance group has scheduled for the instance. Possible values: + // - NONE The instance is running, and the managed instance group does + // not have any scheduled actions for this instance. + // - CREATING The managed instance group is creating this instance. + // - RECREATING The managed instance group is recreating this instance. + // + // - DELETING The managed instance group is permanently deleting this + // instance. + // - ABANDONING The managed instance group is abandoning this instance. + // The instance will be removed from the instance group and from any + // target pools that are associated with this group. + // - RESTARTING The managed instance group is restarting the instance. + // + // - REFRESHING The managed instance group is applying configuration + // changes to the instance without stopping it. For example, the group + // can update the target pool list for an instance without stopping that + // instance. + // + // Possible values: + // "ABANDONING" + // "CREATING" + // "DELETING" + // "NONE" + // "RECREATING" + // "REFRESHING" + // "RESTARTING" + CurrentAction string `json:"currentAction,omitempty"` + + // Id: [Output only] The unique identifier for this resource. This field + // is empty when instance does not exist. + Id uint64 `json:"id,omitempty,string"` + + // Instance: [Output Only] The URL of the instance. The URL can exist + // even if the instance has not yet been created. + Instance string `json:"instance,omitempty"` + + // InstanceStatus: [Output Only] The status of the instance. This field + // is empty when the instance does not exist. + // + // Possible values: + // "PROVISIONING" + // "RUNNING" + // "STAGING" + // "STOPPED" + // "STOPPING" + // "SUSPENDED" + // "SUSPENDING" + // "TERMINATED" + InstanceStatus string `json:"instanceStatus,omitempty"` + + // LastAttempt: [Output Only] Information about the last attempt to + // create or delete the instance. + LastAttempt *ManagedInstanceLastAttempt `json:"lastAttempt,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CurrentAction") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ManagedInstance) MarshalJSON() ([]byte, error) { + type noMethod ManagedInstance + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ManagedInstanceLastAttempt struct { + // Errors: [Output Only] Encountered errors during the last attempt to + // create or delete the instance. + Errors *ManagedInstanceLastAttemptErrors `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ManagedInstanceLastAttempt) MarshalJSON() ([]byte, error) { + type noMethod ManagedInstanceLastAttempt + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ManagedInstanceLastAttemptErrors: [Output Only] Encountered errors +// during the last attempt to create or delete the instance. +type ManagedInstanceLastAttemptErrors struct { + // Errors: [Output Only] The array of errors encountered while + // processing this operation. + Errors []*ManagedInstanceLastAttemptErrorsErrors `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ManagedInstanceLastAttemptErrors) MarshalJSON() ([]byte, error) { + type noMethod ManagedInstanceLastAttemptErrors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ManagedInstanceLastAttemptErrorsErrors struct { + // Code: [Output Only] The error type identifier for this error. + Code string `json:"code,omitempty"` + + // Location: [Output Only] Indicates the field in the request which + // caused the error. This property is optional. + Location string `json:"location,omitempty"` + + // Message: [Output Only] An optional, human-readable error message. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ManagedInstanceLastAttemptErrorsErrors) MarshalJSON() ([]byte, error) { + type noMethod ManagedInstanceLastAttemptErrorsErrors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Metadata: A metadata key/value entry. +type Metadata struct { + // Fingerprint: Specifies a fingerprint for this request, which is + // essentially a hash of the metadata's contents and used for optimistic + // locking. The fingerprint is initially generated by Compute Engine and + // changes after every request to modify or update metadata. You must + // always provide an up-to-date fingerprint hash in order to update or + // change 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: [Output Only] Type of the resource. Always compute#metadata for + // metadata. + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Fingerprint") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Metadata) MarshalJSON() ([]byte, error) { + type noMethod Metadata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MetadataItems) MarshalJSON() ([]byte, error) { + type noMethod MetadataItems + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// NamedPort: The named port. For example: . +type NamedPort struct { + // Name: The name for this named port. The name must be 1-63 characters + // long, and comply with RFC1035. + Name string `json:"name,omitempty"` + + // Port: The port number, which can be a value between 1 and 65535. + Port int64 `json:"port,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *NamedPort) MarshalJSON() ([]byte, error) { + type noMethod NamedPort + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Network: A network resource. +type Network struct { + // IPv4Range: 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: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: A gateway address for default routing to other networks. + // This value is read only and is selected by the Google Compute Engine, + // typically as the first usable address in the IPv4Range. + GatewayIPv4 string `json:"gatewayIPv4,omitempty"` + + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always compute#network for + // networks. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "IPv4Range") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Network) MarshalJSON() ([]byte, error) { + type noMethod Network + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// NetworkInterface: A network interface resource attached to an +// instance. +type NetworkInterface struct { + // AccessConfigs: An array of configurations for this interface. + // 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: [Output Only] The name of the network interface, generated by + // the server. For network devices, these are eth0, eth1, etc. + Name string `json:"name,omitempty"` + + // Network: URL of the network resource for this instance. This is + // required for creating an instance but optional when creating a + // firewall rule. If not specified when creating a firewall rule, the + // default network is used: + // + // global/networks/default + // + // If you specify this property, you can specify the network as a full + // or partial URL. For example, the following are all valid URLs: + // - + // https://www.googleapis.com/compute/v1/projects/project/global/networks/network + // - projects/project/global/networks/network + // - global/networks/default + Network string `json:"network,omitempty"` + + // NetworkIP: [Output Only] An optional IPV4 internal network address + // assigned to the instance for this network interface. + NetworkIP string `json:"networkIP,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AccessConfigs") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *NetworkInterface) MarshalJSON() ([]byte, error) { + type noMethod NetworkInterface + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// NetworkList: Contains a list of Network resources. +type NetworkList struct { + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of Network resources. + Items []*Network `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#networkList for + // lists of networks. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource . + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *NetworkList) MarshalJSON() ([]byte, error) { + type noMethod NetworkList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Operation: An Operation resource, used to manage asynchronous API +// requests. +type Operation struct { + // ClientOperationId: [Output Only] An optional identifier specified by + // the client when the mutation was initiated. Must be unique for all + // Operation resources in the project. + ClientOperationId string `json:"clientOperationId,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // EndTime: [Output Only] The time that this operation was completed. + // This is in RFC3339 text format. + EndTime string `json:"endTime,omitempty"` + + // Error: [Output Only] If errors are generated during processing of the + // operation, this field will be populated. + Error *OperationError `json:"error,omitempty"` + + // HttpErrorMessage: [Output Only] If the operation fails, this field + // contains the HTTP error message that was returned, such as NOT FOUND. + HttpErrorMessage string `json:"httpErrorMessage,omitempty"` + + // HttpErrorStatusCode: [Output Only] If the operation fails, this field + // contains the HTTP error message that was returned, such as 404. + HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // InsertTime: [Output Only] The time that this operation was requested. + // This is in RFC3339 text format. + InsertTime string `json:"insertTime,omitempty"` + + // Kind: [Output Only] Type of the resource. Always compute#operation + // for Operation resources. + Kind string `json:"kind,omitempty"` + + // Name: [Output Only] Name of the resource. + Name string `json:"name,omitempty"` + + // OperationType: [Output Only] Type of the operation, such as insert, + // compute.instanceGroups.update, or compute.instanceGroups.delete. + OperationType string `json:"operationType,omitempty"` + + // Progress: [Output Only] 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 monotonically + // increase as the operation progresses. + Progress int64 `json:"progress,omitempty"` + + // Region: [Output Only] URL of the region where the operation resides. + // Only applicable for regional resources. + Region string `json:"region,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // StartTime: [Output Only] The time that this operation was started by + // the server. This is in RFC3339 text format. + StartTime string `json:"startTime,omitempty"` + + // Status: [Output Only] Status of the operation. Can be one of the + // following: PENDING, RUNNING, or DONE. + // + // Possible values: + // "DONE" + // "PENDING" + // "RUNNING" + Status string `json:"status,omitempty"` + + // StatusMessage: [Output Only] An optional textual description of the + // current status of the operation. + StatusMessage string `json:"statusMessage,omitempty"` + + // TargetId: [Output Only] Unique target ID which identifies a + // particular incarnation of the target. + TargetId uint64 `json:"targetId,omitempty,string"` + + // TargetLink: [Output Only] URL of the resource the operation is + // mutating. + TargetLink string `json:"targetLink,omitempty"` + + // User: [Output Only] User who requested the operation, for example: + // user@example.com. + User string `json:"user,omitempty"` + + // Warnings: [Output Only] If warning messages are generated during + // processing of the operation, this field will be populated. + Warnings []*OperationWarnings `json:"warnings,omitempty"` + + // Zone: [Output Only] URL of the zone where the operation resides. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ClientOperationId") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Operation) MarshalJSON() ([]byte, error) { + type noMethod Operation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationError: [Output Only] If errors are generated during +// processing of the operation, this field will be populated. +type OperationError struct { + // Errors: [Output Only] The array of errors encountered while + // processing this operation. + Errors []*OperationErrorErrors `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationError) MarshalJSON() ([]byte, error) { + type noMethod OperationError + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationErrorErrors struct { + // Code: [Output Only] The error type identifier for this error. + Code string `json:"code,omitempty"` + + // Location: [Output Only] Indicates the field in the request which + // caused the error. This property is optional. + Location string `json:"location,omitempty"` + + // Message: [Output Only] An optional, human-readable error message. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) { + type noMethod OperationErrorErrors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationWarnings struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*OperationWarningsData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationWarnings) MarshalJSON() ([]byte, error) { + type noMethod OperationWarnings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationWarningsData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationWarningsData) MarshalJSON() ([]byte, error) { + type noMethod OperationWarningsData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationAggregatedList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A map of scoped operation lists. + Items map[string]OperationsScopedList `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always + // compute#operationAggregatedList for aggregated lists of operations. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod OperationAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationList: Contains a list of Operation resources. +type OperationList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] The Operation resources. + Items []*Operation `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#operations for + // Operations resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncate. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationList) MarshalJSON() ([]byte, error) { + type noMethod OperationList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationsScopedList struct { + // Operations: [Output Only] List of operations contained in this scope. + Operations []*Operation `json:"operations,omitempty"` + + // Warning: [Output Only] Informational warning which replaces the list + // of operations when the list is empty. + Warning *OperationsScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Operations") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationsScopedList) MarshalJSON() ([]byte, error) { + type noMethod OperationsScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationsScopedListWarning: [Output Only] Informational warning +// which replaces the list of operations when the list is empty. +type OperationsScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*OperationsScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationsScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod OperationsScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationsScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationsScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod OperationsScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PathMatcher: 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. +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: An optional textual description of the resource. + 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"` + + // ForceSendFields is a list of field names (e.g. "DefaultService") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PathMatcher) MarshalJSON() ([]byte, error) { + type noMethod PathMatcher + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PathRule: A path-matching rule for a URL. If matched, will use the +// specified BackendService to handle the traffic arriving at this URL. +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"` + + // ForceSendFields is a list of field names (e.g. "Paths") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PathRule) MarshalJSON() ([]byte, error) { + type noMethod PathRule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Project: A Project resource. Projects can only be created in the +// Google Developers Console. Unless marked otherwise, values can only +// be modified in the console. +type Project struct { + // CommonInstanceMetadata: Metadata key/value pairs available to all + // instances contained in this project. See Custom metadata for more + // information. + CommonInstanceMetadata *Metadata `json:"commonInstanceMetadata,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource. + Description string `json:"description,omitempty"` + + // EnabledFeatures: Restricted features enabled for use on this project. + EnabledFeatures []string `json:"enabledFeatures,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always compute#project for + // projects. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // Quotas: [Output Only] Quotas assigned to this project. + Quotas []*Quota `json:"quotas,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // UsageExportLocation: The location in Cloud Storage and naming method + // of the daily usage report. + UsageExportLocation *UsageExportLocation `json:"usageExportLocation,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "CommonInstanceMetadata") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Project) MarshalJSON() ([]byte, error) { + type noMethod Project + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Quota: A quotas entry. +type Quota struct { + // Limit: [Output Only] Quota limit for this metric. + Limit float64 `json:"limit,omitempty"` + + // Metric: [Output Only] Name of the quota metric. + // + // Possible values: + // "BACKEND_SERVICES" + // "CPUS" + // "DISKS_TOTAL_GB" + // "FIREWALLS" + // "FORWARDING_RULES" + // "HEALTH_CHECKS" + // "IMAGES" + // "INSTANCES" + // "INSTANCE_GROUPS" + // "INSTANCE_GROUP_MANAGERS" + // "INSTANCE_TEMPLATES" + // "IN_USE_ADDRESSES" + // "LOCAL_SSD_TOTAL_GB" + // "NETWORKS" + // "ROUTES" + // "SNAPSHOTS" + // "SSD_TOTAL_GB" + // "STATIC_ADDRESSES" + // "TARGET_HTTP_PROXIES" + // "TARGET_INSTANCES" + // "TARGET_POOLS" + // "TARGET_VPN_GATEWAYS" + // "URL_MAPS" + // "VPN_TUNNELS" + Metric string `json:"metric,omitempty"` + + // Usage: [Output Only] Current usage of this metric. + Usage float64 `json:"usage,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Limit") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Quota) MarshalJSON() ([]byte, error) { + type noMethod Quota + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Region: Region resource. +type Region struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Deprecated: [Output Only] The deprecation status associated with this + // region. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: [Output Only] Textual description of the resource. + Description string `json:"description,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server . + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always compute#region for + // regions. + Kind string `json:"kind,omitempty"` + + // Name: [Output Only] Name of the resource. + Name string `json:"name,omitempty"` + + // Quotas: [Output Only] Quotas assigned to this region. + Quotas []*Quota `json:"quotas,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // Status: [Output Only] Status of the region, either UP or DOWN. + // + // Possible values: + // "DOWN" + // "UP" + Status string `json:"status,omitempty"` + + // Zones: [Output Only] A list of zones available in this region, in the + // form of resource URLs. + Zones []string `json:"zones,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Region) MarshalJSON() ([]byte, error) { + type noMethod Region + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RegionList: Contains a list of region resources. +type RegionList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of Region resources. + Items []*Region `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#regionList for + // lists of regions. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RegionList) MarshalJSON() ([]byte, error) { + type noMethod RegionList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ResourceGroupReference struct { + // Group: A URI referencing one of the resource views listed in the + // backend service. + Group string `json:"group,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Group") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResourceGroupReference) MarshalJSON() ([]byte, error) { + type noMethod ResourceGroupReference + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Route: The route resource. A Route is a rule that specifies how +// certain packets should be handled by the virtual network. Routes are +// associated with instances by tag and the set of Routes for a +// particular instance is called its routing table. For each packet +// leaving a instance, the system searches that instance'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 +// nextHop field of the winning Route -- either to another instance +// destination, a instance gateway or a Google Compute Engien-operated +// gateway. Packets that do not match any Route in the sending +// instance's routing table are dropped. +type Route struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: The destination range of outgoing packets that this route + // applies to. + DestRange string `json:"destRange,omitempty"` + + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of this resource. Always compute#routes for + // Route resources. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // Network: Fully-qualified URL of the network that this route applies + // to. + Network string `json:"network,omitempty"` + + // NextHopGateway: The URL to a gateway that should handle matching + // packets. Currently, this is only the internet gateway: + // projects//global/gateways/default-internet-gateway + NextHopGateway string `json:"nextHopGateway,omitempty"` + + // NextHopInstance: The fully-qualified URL to an instance that should + // handle matching packets. For + // example: + // https://www.googleapis.com/compute/v1/projects/project/zones/ + // zone/instances/ + 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"` + + // NextHopVpnTunnel: The URL to a VpnTunnel that should handle matching + // packets. + NextHopVpnTunnel string `json:"nextHopVpnTunnel,omitempty"` + + // Priority: Breaks ties between Routes of equal specificity. Routes + // with smaller values win when tied with routes with larger values. + // Default value is 1000. A valid range is between 0 and 65535. + Priority int64 `json:"priority,omitempty"` + + // SelfLink: [Output Only] Server-defined fully-qualified URL for this + // resource. + SelfLink string `json:"selfLink,omitempty"` + + // Tags: A list of instance tags to which this route applies. + Tags []string `json:"tags,omitempty"` + + // Warnings: [Output Only] If potential misconfigurations are detected + // for this route, this field will be populated with warning messages. + Warnings []*RouteWarnings `json:"warnings,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Route) MarshalJSON() ([]byte, error) { + type noMethod Route + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type RouteWarnings struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*RouteWarningsData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RouteWarnings) MarshalJSON() ([]byte, error) { + type noMethod RouteWarnings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type RouteWarningsData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RouteWarningsData) MarshalJSON() ([]byte, error) { + type noMethod RouteWarningsData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RouteList: Contains a list of route resources. +type RouteList struct { + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of Route resources. + Items []*Route `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RouteList) MarshalJSON() ([]byte, error) { + type noMethod RouteList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Scheduling: Sets the scheduling options for an Instance. +type Scheduling struct { + // AutomaticRestart: Specifies whether the instance should be + // automatically restarted if it is terminated by Compute Engine (not + // terminated by a user). You can only set the automatic restart option + // for standard instances. Preemptible instances cannot be automatically + // restarted. + AutomaticRestart bool `json:"automaticRestart,omitempty"` + + // OnHostMaintenance: Defines the maintenance behavior for this + // instance. For standard instances, the default behavior is MIGRATE. + // For preemptible instances, the default and only possible behavior is + // TERMINATE. For more information, see Setting maintenance behavior. + // + // Possible values: + // "MIGRATE" + // "TERMINATE" + OnHostMaintenance string `json:"onHostMaintenance,omitempty"` + + // Preemptible: Whether the instance is preemptible. + Preemptible bool `json:"preemptible,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AutomaticRestart") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Scheduling) MarshalJSON() ([]byte, error) { + type noMethod Scheduling + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SerialPortOutput: An instance's serial console output. +type SerialPortOutput struct { + // Contents: [Output Only] The contents of the console output. + Contents string `json:"contents,omitempty"` + + // Kind: [Output Only] Type of the resource. Always + // compute#serialPortOutput for serial port output. + Kind string `json:"kind,omitempty"` + + // SelfLink: [Output Only] Server defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Contents") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SerialPortOutput) MarshalJSON() ([]byte, error) { + type noMethod SerialPortOutput + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ServiceAccount: A service account. +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"` + + // ForceSendFields is a list of field names (e.g. "Email") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ServiceAccount) MarshalJSON() ([]byte, error) { + type noMethod ServiceAccount + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Snapshot: A persistent disk snapshot resource. +type Snapshot struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Size of the snapshot, specified in GB. + DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always compute#snapshot for + // Snapshot resources. + Kind string `json:"kind,omitempty"` + + // Licenses: Public visible licenses. + Licenses []string `json:"licenses,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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // SnapshotEncryptionKey: Encrypts the snapshot using a + // customer-supplied encryption key. + // + // If you encrypt a snapshot using a customer-supplied encryption key, + // and you want to use the snapshot later (e.g. to create a disk from + // the snapshot), you must provide the same key used encrypt the + // snapshot in your future request. If you provide an incorrect key, or + // no key, the request will fail. + // + // Customer-supplied encryption keys do not protect access to metadata + // of the disk. + // + // If no customer-supplied encryption key is provided at creation, then + // the disk will be encrypted using an automatically generated key and + // you do not need to provide a key to use the snapshot later. + SnapshotEncryptionKey *CustomerEncryptionKey `json:"snapshotEncryptionKey,omitempty"` + + // SourceDisk: The source disk used to create this snapshot. + SourceDisk string `json:"sourceDisk,omitempty"` + + // SourceDiskEncryptionKey: Specifies the customer-supplied encryption + // key of the source disk. This key is required if the source disk is + // protected by a customer-supplied encryption key. + // + // If the incorrect key is provided, the request will fail. + SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"` + + // SourceDiskId: [Output Only] 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: [Output Only] The status of the snapshot. + // + // Possible values: + // "CREATING" + // "DELETING" + // "FAILED" + // "READY" + // "UPLOADING" + Status string `json:"status,omitempty"` + + // StorageBytes: [Output Only] 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: [Output Only] An indicator whether storageBytes + // is in a stable state or it is being adjusted as a result of shared + // storage reallocation. + // + // Possible values: + // "UPDATING" + // "UP_TO_DATE" + StorageBytesStatus string `json:"storageBytesStatus,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Snapshot) MarshalJSON() ([]byte, error) { + type noMethod Snapshot + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SnapshotList: Contains a list of Snapshot resources. +type SnapshotList struct { + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of Snapshot resources. + Items []*Snapshot `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SnapshotList) MarshalJSON() ([]byte, error) { + type noMethod SnapshotList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SslCertificate: An SslCertificate resource. This resource provides a +// mechanism to upload an SSL key and certificate to global HTTPS +// loadbalancer to serve secure connections. +type SslCertificate struct { + // Certificate: A local certificate file. The certificate must be in PEM + // format. The certificate chain must be no greater than 5 certs long. + // The chain must include at least one intermediate cert. + Certificate string `json:"certificate,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always + // compute#sslCertificate for SSL certificates. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // PrivateKey: A write-only private key in PEM format. Only insert RPCs + // will include this field. + PrivateKey string `json:"privateKey,omitempty"` + + // SelfLink: [Output only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Certificate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SslCertificate) MarshalJSON() ([]byte, error) { + type noMethod SslCertificate + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SslCertificateList: Contains a list of SslCertificate resources. +type SslCertificateList struct { + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of SslCertificate resources. + Items []*SslCertificate `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SslCertificateList) MarshalJSON() ([]byte, error) { + type noMethod SslCertificateList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Tags: A set of instance tags. +type Tags struct { + // Fingerprint: Specifies a fingerprint for this request, which is + // essentially a hash of the metadata's contents and used for optimistic + // locking. The fingerprint is initially generated by Compute Engine and + // changes after every request to modify or update metadata. You must + // always provide an up-to-date fingerprint hash in order to update or + // change metadata. + // + // To see the latest fingerprint, make get() request to the instance. + 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"` + + // ForceSendFields is a list of field names (e.g. "Fingerprint") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Tags) MarshalJSON() ([]byte, error) { + type noMethod Tags + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetHttpProxy: A TargetHttpProxy resource. This resource defines an +// HTTP proxy. +type TargetHttpProxy struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of resource. Always compute#operation for + // Operation resources. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetHttpProxy) MarshalJSON() ([]byte, error) { + type noMethod TargetHttpProxy + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetHttpProxyList: A list of TargetHttpProxy resources. +type TargetHttpProxyList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of TargetHttpProxy resources. + Items []*TargetHttpProxy `json:"items,omitempty"` + + // Kind: Type of resource. Always compute#targetHttpProxyList for lists + // of Target HTTP proxies. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetHttpProxyList) MarshalJSON() ([]byte, error) { + type noMethod TargetHttpProxyList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetHttpsProxiesSetSslCertificatesRequest struct { + // SslCertificates: New set of URLs to SslCertificate resources to + // associate with this TargetHttpProxy. Currently exactly one ssl + // certificate must be specified. + SslCertificates []string `json:"sslCertificates,omitempty"` + + // ForceSendFields is a list of field names (e.g. "SslCertificates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetHttpsProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) { + type noMethod TargetHttpsProxiesSetSslCertificatesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetHttpsProxy: A TargetHttpsProxy resource. This resource defines +// an HTTPS proxy. +type TargetHttpsProxy struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource; defined by the + // server. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // SslCertificates: URLs to SslCertificate resources that are used to + // authenticate connections to Backends. Currently exactly one SSL + // certificate must be specified. + SslCertificates []string `json:"sslCertificates,omitempty"` + + // UrlMap: URL to the UrlMap resource that defines the mapping from URL + // to the BackendService. + UrlMap string `json:"urlMap,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetHttpsProxy) MarshalJSON() ([]byte, error) { + type noMethod TargetHttpsProxy + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetHttpsProxyList: Contains a list of TargetHttpsProxy resources. +type TargetHttpsProxyList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of TargetHttpsProxy resources. + Items []*TargetHttpsProxy `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetHttpsProxyList) MarshalJSON() ([]byte, error) { + type noMethod TargetHttpsProxyList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetInstance: A TargetInstance resource. This resource defines an +// endpoint instance that terminates traffic of certain protocols. +type TargetInstance struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource; defined by the + // server. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // NatPolicy: NAT option controlling how IPs are NAT'ed to the instance. + // Currently only NO_NAT (default value) is supported. + // + // Possible values: + // "NO_NAT" + NatPolicy string `json:"natPolicy,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // Zone: [Output Only] URL of the zone where the target instance + // resides. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetInstance) MarshalJSON() ([]byte, error) { + type noMethod TargetInstance + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetInstanceAggregatedList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A map of scoped target instance lists. + Items map[string]TargetInstancesScopedList `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetInstanceAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod TargetInstanceAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetInstanceList: Contains a list of TargetInstance resources. +type TargetInstanceList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of TargetInstance resources. + Items []*TargetInstance `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetInstanceList) MarshalJSON() ([]byte, error) { + type noMethod TargetInstanceList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "TargetInstances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetInstancesScopedList) MarshalJSON() ([]byte, error) { + type noMethod TargetInstancesScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetInstancesScopedListWarning: Informational warning which +// replaces the list of addresses when the list is empty. +type TargetInstancesScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*TargetInstancesScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetInstancesScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod TargetInstancesScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetInstancesScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetInstancesScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod TargetInstancesScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetPool: A TargetPool resource. This resource defines a pool of +// instances, associated HttpHealthCheck resources, and the fallback +// TargetPool. +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 instances 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 + // instances 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 instances with the best effort, or to + // all instances when no instance is healthy. + BackupPool string `json:"backupPool,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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 instances 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 instances 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 instances with the best effort, or to all instances when no + // instance is healthy. + FailoverRatio float64 `json:"failoverRatio,omitempty"` + + // HealthChecks: A list of URLs to the HttpHealthCheck resource. A + // member instance in this pool is considered healthy if and only if all + // specified health checks pass. An empty list means all member + // instances will be considered healthy at all times. + HealthChecks []string `json:"healthChecks,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Instances: A list of resource URLs to the member virtual machines + // 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // Region: [Output Only] URL of the region where the target pool + // resides. + Region string `json:"region,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + 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 instance in + // the pool. + // CLIENT_IP: Connections from the same client IP will go to the same + // instance in the pool while that instance remains + // healthy. + // CLIENT_IP_PROTO: Connections from the same client IP with the same IP + // protocol will go to the same instance in the pool while that instance + // remains healthy. + // + // Possible values: + // "CLIENT_IP" + // "CLIENT_IP_PROTO" + // "NONE" + SessionAffinity string `json:"sessionAffinity,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BackupPool") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPool) MarshalJSON() ([]byte, error) { + type noMethod TargetPool + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetPoolAggregatedList struct { + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A map of scoped target pool lists. + Items map[string]TargetPoolsScopedList `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetPoolInstanceHealth struct { + HealthStatus []*HealthStatus `json:"healthStatus,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "HealthStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolInstanceHealth) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolInstanceHealth + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetPoolList: Contains a list of TargetPool resources. +type TargetPoolList struct { + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of TargetPool resources. + Items []*TargetPool `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolList) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetPoolsAddHealthCheckRequest struct { + // HealthChecks: Health check URLs to be added to targetPool. + HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"` + + // ForceSendFields is a list of field names (e.g. "HealthChecks") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolsAddHealthCheckRequest) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolsAddHealthCheckRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetPoolsAddInstanceRequest struct { + // Instances: URLs of the instances to be added to targetPool. + Instances []*InstanceReference `json:"instances,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolsAddInstanceRequest) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolsAddInstanceRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetPoolsRemoveHealthCheckRequest struct { + // HealthChecks: Health check URLs to be removed from targetPool. + HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"` + + // ForceSendFields is a list of field names (e.g. "HealthChecks") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolsRemoveHealthCheckRequest) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolsRemoveHealthCheckRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetPoolsRemoveInstanceRequest struct { + // Instances: URLs of the instances to be removed from targetPool. + Instances []*InstanceReference `json:"instances,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolsRemoveInstanceRequest) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolsRemoveInstanceRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "TargetPools") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolsScopedList) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolsScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetPoolsScopedListWarning: Informational warning which replaces +// the list of addresses when the list is empty. +type TargetPoolsScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*TargetPoolsScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolsScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolsScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetPoolsScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolsScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolsScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetReference struct { + Target string `json:"target,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Target") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetReference) MarshalJSON() ([]byte, error) { + type noMethod TargetReference + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetVpnGateway struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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"` + + // ForwardingRules: [Output Only] A list of URLs to the ForwardingRule + // resources. ForwardingRules are created using + // compute.forwardingRules.insert and associated to a VPN gateway. + ForwardingRules []string `json:"forwardingRules,omitempty"` + + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway + // for target VPN gateways. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // Network: URL of the network to which this VPN gateway is attached. + // Provided by the client when the VPN gateway is created. + Network string `json:"network,omitempty"` + + // Region: [Output Only] URL of the region where the target VPN gateway + // resides. + Region string `json:"region,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // Status: [Output Only] The status of the VPN gateway. + // + // Possible values: + // "CREATING" + // "DELETING" + // "FAILED" + // "READY" + Status string `json:"status,omitempty"` + + // Tunnels: [Output Only] A list of URLs to VpnTunnel resources. + // VpnTunnels are created using compute.vpntunnels.insert and associated + // to a VPN gateway. + Tunnels []string `json:"tunnels,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetVpnGateway) MarshalJSON() ([]byte, error) { + type noMethod TargetVpnGateway + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetVpnGatewayAggregatedList struct { + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A map of scoped target vpn gateway lists. + Items map[string]TargetVpnGatewaysScopedList `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway + // for target VPN gateways. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetVpnGatewayAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod TargetVpnGatewayAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetVpnGatewayList: Contains a list of TargetVpnGateway resources. +type TargetVpnGatewayList struct { + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of TargetVpnGateway resources. + Items []*TargetVpnGateway `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway + // for target VPN gateways. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetVpnGatewayList) MarshalJSON() ([]byte, error) { + type noMethod TargetVpnGatewayList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetVpnGatewaysScopedList struct { + // TargetVpnGateways: [Output Only] List of target vpn gateways + // contained in this scope. + TargetVpnGateways []*TargetVpnGateway `json:"targetVpnGateways,omitempty"` + + // Warning: [Output Only] Informational warning which replaces the list + // of addresses when the list is empty. + Warning *TargetVpnGatewaysScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "TargetVpnGateways") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetVpnGatewaysScopedList) MarshalJSON() ([]byte, error) { + type noMethod TargetVpnGatewaysScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetVpnGatewaysScopedListWarning: [Output Only] Informational +// warning which replaces the list of addresses when the list is empty. +type TargetVpnGatewaysScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*TargetVpnGatewaysScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetVpnGatewaysScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod TargetVpnGatewaysScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetVpnGatewaysScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetVpnGatewaysScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod TargetVpnGatewaysScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TestFailure struct { + ActualService string `json:"actualService,omitempty"` + + ExpectedService string `json:"expectedService,omitempty"` + + Host string `json:"host,omitempty"` + + Path string `json:"path,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ActualService") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TestFailure) MarshalJSON() ([]byte, error) { + type noMethod TestFailure + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UrlMap: 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. +type UrlMap struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource. Set by the + // server. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // PathMatchers: The list of named PathMatchers to use against the URL. + PathMatchers []*PathMatcher `json:"pathMatchers,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlMap) MarshalJSON() ([]byte, error) { + type noMethod UrlMap + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UrlMapList: Contains a list of UrlMap resources. +type UrlMapList struct { + // Id: [Output Only] Unique identifier for the resource. Set by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of UrlMap resources. + Items []*UrlMap `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlMapList) MarshalJSON() ([]byte, error) { + type noMethod UrlMapList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type UrlMapReference struct { + UrlMap string `json:"urlMap,omitempty"` + + // ForceSendFields is a list of field names (e.g. "UrlMap") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlMapReference) MarshalJSON() ([]byte, error) { + type noMethod UrlMapReference + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UrlMapTest: Message for the expected URL mappings. +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"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlMapTest) MarshalJSON() ([]byte, error) { + type noMethod UrlMapTest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UrlMapValidationResult: Message representing the validation result +// for a UrlMap. +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"` + + // ForceSendFields is a list of field names (e.g. "LoadErrors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlMapValidationResult) MarshalJSON() ([]byte, error) { + type noMethod UrlMapValidationResult + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type UrlMapsValidateRequest struct { + // Resource: Content of the UrlMap to be validated. + Resource *UrlMap `json:"resource,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Resource") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlMapsValidateRequest) MarshalJSON() ([]byte, error) { + type noMethod UrlMapsValidateRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type UrlMapsValidateResponse struct { + Result *UrlMapValidationResult `json:"result,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Result") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlMapsValidateResponse) MarshalJSON() ([]byte, error) { + type noMethod UrlMapsValidateResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UsageExportLocation: The location in Cloud Storage and naming method +// of the daily usage report. Contains bucket_name and report_name +// prefix. +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 just 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 bucketName. If not supplied, defaults to usage. The + // report is stored as a CSV file named + // report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the + // usage according to Pacific Time. If you supply a prefix, it should + // conform to Cloud Storage object naming conventions. + ReportNamePrefix string `json:"reportNamePrefix,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BucketName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UsageExportLocation) MarshalJSON() ([]byte, error) { + type noMethod UsageExportLocation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type VpnTunnel struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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"` + + // DetailedStatus: [Output Only] Detailed status message for the VPN + // tunnel. + DetailedStatus string `json:"detailedStatus,omitempty"` + + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // IkeVersion: IKE protocol version to use when establishing the VPN + // tunnel with peer VPN gateway. Acceptable IKE versions are 1 or 2. + // Default version is 2. + IkeVersion int64 `json:"ikeVersion,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for + // VPN tunnels. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // PeerIp: IP address of the peer VPN gateway. + PeerIp string `json:"peerIp,omitempty"` + + // Region: [Output Only] URL of the region where the VPN tunnel resides. + Region string `json:"region,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // SharedSecret: Shared secret used to set the secure session between + // the GCE VPN gateway and the peer VPN gateway. + SharedSecret string `json:"sharedSecret,omitempty"` + + // SharedSecretHash: Hash of the shared secret. + SharedSecretHash string `json:"sharedSecretHash,omitempty"` + + // Status: [Output Only] The status of the VPN tunnel. + // + // Possible values: + // "AUTHORIZATION_ERROR" + // "DEPROVISIONING" + // "ESTABLISHED" + // "FAILED" + // "FIRST_HANDSHAKE" + // "NEGOTIATION_FAILURE" + // "NETWORK_ERROR" + // "NO_INCOMING_PACKETS" + // "PROVISIONING" + // "REJECTED" + // "WAITING_FOR_FULL_CONFIG" + Status string `json:"status,omitempty"` + + // TargetVpnGateway: URL of the VPN gateway to which this VPN tunnel is + // associated. Provided by the client when the VPN tunnel is created. + TargetVpnGateway string `json:"targetVpnGateway,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VpnTunnel) MarshalJSON() ([]byte, error) { + type noMethod VpnTunnel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type VpnTunnelAggregatedList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A map of scoped vpn tunnel lists. + Items map[string]VpnTunnelsScopedList `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for + // VPN tunnels. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VpnTunnelAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod VpnTunnelAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VpnTunnelList: Contains a list of VpnTunnel resources. +type VpnTunnelList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of VpnTunnel resources. + Items []*VpnTunnel `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for + // VPN tunnels. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VpnTunnelList) MarshalJSON() ([]byte, error) { + type noMethod VpnTunnelList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type VpnTunnelsScopedList struct { + // VpnTunnels: List of vpn tunnels contained in this scope. + VpnTunnels []*VpnTunnel `json:"vpnTunnels,omitempty"` + + // Warning: Informational warning which replaces the list of addresses + // when the list is empty. + Warning *VpnTunnelsScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "VpnTunnels") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VpnTunnelsScopedList) MarshalJSON() ([]byte, error) { + type noMethod VpnTunnelsScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VpnTunnelsScopedListWarning: Informational warning which replaces the +// list of addresses when the list is empty. +type VpnTunnelsScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*VpnTunnelsScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VpnTunnelsScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod VpnTunnelsScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type VpnTunnelsScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VpnTunnelsScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod VpnTunnelsScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Zone: A Zone resource. +type Zone struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Deprecated: [Output Only] The deprecation status associated with this + // zone. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: [Output Only] Textual description of the resource. + Description string `json:"description,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always kind#zone for zones. + Kind string `json:"kind,omitempty"` + + // MaintenanceWindows: [Output Only] Any scheduled maintenance windows + // for this zone. When the zone is in a maintenance window, all + // resources which reside in the zone will be unavailable. For more + // information, see Maintenance Windows + MaintenanceWindows []*ZoneMaintenanceWindows `json:"maintenanceWindows,omitempty"` + + // Name: [Output Only] Name of the resource. + Name string `json:"name,omitempty"` + + // Region: [Output Only] Full URL reference to the region which hosts + // the zone. + Region string `json:"region,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // Status: [Output Only] Status of the zone, either UP or DOWN. + // + // Possible values: + // "DOWN" + // "UP" + Status string `json:"status,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Zone) MarshalJSON() ([]byte, error) { + type noMethod Zone + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ZoneMaintenanceWindows struct { + // BeginTime: [Output Only] Starting time of the maintenance window, in + // RFC3339 format. + BeginTime string `json:"beginTime,omitempty"` + + // Description: [Output Only] Textual description of the maintenance + // window. + Description string `json:"description,omitempty"` + + // EndTime: [Output Only] Ending time of the maintenance window, in + // RFC3339 format. + EndTime string `json:"endTime,omitempty"` + + // Name: [Output Only] Name of the maintenance window. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BeginTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ZoneMaintenanceWindows) MarshalJSON() ([]byte, error) { + type noMethod ZoneMaintenanceWindows + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ZoneList: Contains a list of zone resources. +type ZoneList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of Zone resources. + Items []*Zone `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ZoneList) MarshalJSON() ([]byte, error) { + type noMethod ZoneList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "compute.addresses.aggregatedList": + +type AddressesAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of addresses grouped by scope. +// For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/aggregatedList +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *AddressesAggregatedListCall) MaxResults(maxResults int64) *AddressesAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *AddressesAggregatedListCall) OrderBy(orderBy string) *AddressesAggregatedListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *AddressesAggregatedListCall) PageToken(pageToken string) *AddressesAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AddressesAggregatedListCall) Fields(s ...googleapi.Field) *AddressesAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AddressesAggregatedListCall) IfNoneMatch(entityTag string) *AddressesAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AddressesAggregatedListCall) Context(ctx context.Context) *AddressesAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *AddressesAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/addresses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.addresses.aggregatedList" call. +// Exactly one of *AddressAggregatedList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AddressAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AddressesAggregatedListCall) Do() (*AddressAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AddressAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of addresses grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.addresses.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified address resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AddressesDeleteCall) Fields(s ...googleapi.Field) *AddressesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AddressesDeleteCall) Context(ctx context.Context) *AddressesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AddressesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "address": c.address, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.addresses.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AddressesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the region for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Returns the specified address resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AddressesGetCall) Fields(s ...googleapi.Field) *AddressesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AddressesGetCall) IfNoneMatch(entityTag string) *AddressesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AddressesGetCall) Context(ctx context.Context) *AddressesGetCall { + c.ctx_ = ctx + return c +} + +func (c *AddressesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "address": c.address, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.addresses.get" call. +// Exactly one of *Address or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Address.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AddressesGetCall) Do() (*Address, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Address{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the region for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates an address resource in the specified project using +// the data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AddressesInsertCall) Fields(s ...googleapi.Field) *AddressesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AddressesInsertCall) Context(ctx context.Context) *AddressesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *AddressesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.addresses.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AddressesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the region for 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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.addresses.list": + +type AddressesListCall struct { + s *Service + project string + region string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of address resources contained within the +// specified region. +// For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *AddressesListCall) MaxResults(maxResults int64) *AddressesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *AddressesListCall) OrderBy(orderBy string) *AddressesListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *AddressesListCall) PageToken(pageToken string) *AddressesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AddressesListCall) Fields(s ...googleapi.Field) *AddressesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AddressesListCall) IfNoneMatch(entityTag string) *AddressesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AddressesListCall) Context(ctx context.Context) *AddressesListCall { + c.ctx_ = ctx + return c +} + +func (c *AddressesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.addresses.list" call. +// Exactly one of *AddressList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AddressList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AddressesListCall) Do() (*AddressList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AddressList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of address resources contained within the specified region.", + // "httpMethod": "GET", + // "id": "compute.addresses.list", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the region for 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/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.autoscalers.aggregatedList": + +type AutoscalersAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of autoscalers grouped by scope. +func (r *AutoscalersService) AggregatedList(project string) *AutoscalersAggregatedListCall { + c := &AutoscalersAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *AutoscalersAggregatedListCall) Filter(filter string) *AutoscalersAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *AutoscalersAggregatedListCall) MaxResults(maxResults int64) *AutoscalersAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *AutoscalersAggregatedListCall) OrderBy(orderBy string) *AutoscalersAggregatedListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *AutoscalersAggregatedListCall) PageToken(pageToken string) *AutoscalersAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AutoscalersAggregatedListCall) Fields(s ...googleapi.Field) *AutoscalersAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AutoscalersAggregatedListCall) IfNoneMatch(entityTag string) *AutoscalersAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AutoscalersAggregatedListCall) Context(ctx context.Context) *AutoscalersAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/autoscalers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.autoscalers.aggregatedList" call. +// Exactly one of *AutoscalerAggregatedList or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *AutoscalerAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AutoscalersAggregatedListCall) Do() (*AutoscalerAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AutoscalerAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of autoscalers grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.autoscalers.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/autoscalers", + // "response": { + // "$ref": "AutoscalerAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.autoscalers.delete": + +type AutoscalersDeleteCall struct { + s *Service + project string + zone string + autoscaler string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified autoscaler resource. +func (r *AutoscalersService) Delete(project string, zone string, autoscaler string) *AutoscalersDeleteCall { + c := &AutoscalersDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.autoscaler = autoscaler + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AutoscalersDeleteCall) Fields(s ...googleapi.Field) *AutoscalersDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AutoscalersDeleteCall) Context(ctx context.Context) *AutoscalersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "autoscaler": c.autoscaler, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.autoscalers.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AutoscalersDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified autoscaler resource.", + // "httpMethod": "DELETE", + // "id": "compute.autoscalers.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "autoscaler" + // ], + // "parameters": { + // "autoscaler": { + // "description": "Name of the persistent autoscaler 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}/autoscalers/{autoscaler}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.autoscalers.get": + +type AutoscalersGetCall struct { + s *Service + project string + zone string + autoscaler string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified autoscaler resource. +func (r *AutoscalersService) Get(project string, zone string, autoscaler string) *AutoscalersGetCall { + c := &AutoscalersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.autoscaler = autoscaler + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AutoscalersGetCall) Fields(s ...googleapi.Field) *AutoscalersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AutoscalersGetCall) IfNoneMatch(entityTag string) *AutoscalersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AutoscalersGetCall) Context(ctx context.Context) *AutoscalersGetCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "autoscaler": c.autoscaler, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.autoscalers.get" call. +// Exactly one of *Autoscaler or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Autoscaler.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AutoscalersGetCall) Do() (*Autoscaler, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Autoscaler{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified autoscaler resource.", + // "httpMethod": "GET", + // "id": "compute.autoscalers.get", + // "parameterOrder": [ + // "project", + // "zone", + // "autoscaler" + // ], + // "parameters": { + // "autoscaler": { + // "description": "Name of the persistent autoscaler 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}/autoscalers/{autoscaler}", + // "response": { + // "$ref": "Autoscaler" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.autoscalers.insert": + +type AutoscalersInsertCall struct { + s *Service + project string + zone string + autoscaler *Autoscaler + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates an autoscaler resource in the specified project using +// the data included in the request. +func (r *AutoscalersService) Insert(project string, zone string, autoscaler *Autoscaler) *AutoscalersInsertCall { + c := &AutoscalersInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.autoscaler = autoscaler + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AutoscalersInsertCall) Fields(s ...googleapi.Field) *AutoscalersInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AutoscalersInsertCall) Context(ctx context.Context) *AutoscalersInsertCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.autoscalers.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AutoscalersInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an autoscaler resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.autoscalers.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}/autoscalers", + // "request": { + // "$ref": "Autoscaler" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.autoscalers.list": + +type AutoscalersListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of autoscaler resources contained within the +// specified zone. +func (r *AutoscalersService) List(project string, zone string) *AutoscalersListCall { + c := &AutoscalersListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *AutoscalersListCall) Filter(filter string) *AutoscalersListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *AutoscalersListCall) MaxResults(maxResults int64) *AutoscalersListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *AutoscalersListCall) OrderBy(orderBy string) *AutoscalersListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *AutoscalersListCall) PageToken(pageToken string) *AutoscalersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AutoscalersListCall) Fields(s ...googleapi.Field) *AutoscalersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AutoscalersListCall) IfNoneMatch(entityTag string) *AutoscalersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AutoscalersListCall) Context(ctx context.Context) *AutoscalersListCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.autoscalers.list" call. +// Exactly one of *AutoscalerList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AutoscalerList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AutoscalersListCall) Do() (*AutoscalerList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AutoscalerList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of autoscaler resources contained within the specified zone.", + // "httpMethod": "GET", + // "id": "compute.autoscalers.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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}/autoscalers", + // "response": { + // "$ref": "AutoscalerList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.autoscalers.patch": + +type AutoscalersPatchCall struct { + s *Service + project string + zone string + autoscaler string + autoscaler2 *Autoscaler + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an autoscaler resource in the specified project using +// the data included in the request. This method supports patch +// semantics. +func (r *AutoscalersService) Patch(project string, zone string, autoscaler string, autoscaler2 *Autoscaler) *AutoscalersPatchCall { + c := &AutoscalersPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.autoscaler = autoscaler + c.autoscaler2 = autoscaler2 + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AutoscalersPatchCall) Fields(s ...googleapi.Field) *AutoscalersPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AutoscalersPatchCall) Context(ctx context.Context) *AutoscalersPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("autoscaler", fmt.Sprintf("%v", c.autoscaler)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.autoscalers.patch" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AutoscalersPatchCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an autoscaler resource in the specified project using the data included in the request. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "compute.autoscalers.patch", + // "parameterOrder": [ + // "project", + // "zone", + // "autoscaler" + // ], + // "parameters": { + // "autoscaler": { + // "description": "Name of the autoscaler resource to update.", + // "location": "query", + // "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}/autoscalers", + // "request": { + // "$ref": "Autoscaler" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.autoscalers.update": + +type AutoscalersUpdateCall struct { + s *Service + project string + zone string + autoscaler *Autoscaler + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an autoscaler resource in the specified project using +// the data included in the request. +func (r *AutoscalersService) Update(project string, zone string, autoscaler *Autoscaler) *AutoscalersUpdateCall { + c := &AutoscalersUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.autoscaler = autoscaler + return c +} + +// Autoscaler sets the optional parameter "autoscaler": Name of the +// autoscaler resource to update. +func (c *AutoscalersUpdateCall) Autoscaler(autoscaler string) *AutoscalersUpdateCall { + c.opt_["autoscaler"] = autoscaler + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AutoscalersUpdateCall) Fields(s ...googleapi.Field) *AutoscalersUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AutoscalersUpdateCall) Context(ctx context.Context) *AutoscalersUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["autoscaler"]; ok { + params.Set("autoscaler", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.autoscalers.update" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AutoscalersUpdateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an autoscaler resource in the specified project using the data included in the request.", + // "httpMethod": "PUT", + // "id": "compute.autoscalers.update", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "autoscaler": { + // "description": "Name of the autoscaler resource to update.", + // "location": "query", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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}/autoscalers", + // "request": { + // "$ref": "Autoscaler" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.backendServices.delete": + +type BackendServicesDeleteCall struct { + s *Service + project string + backendService string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified BackendService resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BackendServicesDeleteCall) Fields(s ...googleapi.Field) *BackendServicesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BackendServicesDeleteCall) Context(ctx context.Context) *BackendServicesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *BackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "backendService": c.backendService, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.backendServices.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *BackendServicesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.backendServices.get": + +type BackendServicesGetCall struct { + s *Service + project string + backendService string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified BackendService resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BackendServicesGetCall) Fields(s ...googleapi.Field) *BackendServicesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BackendServicesGetCall) IfNoneMatch(entityTag string) *BackendServicesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BackendServicesGetCall) Context(ctx context.Context) *BackendServicesGetCall { + c.ctx_ = ctx + return c +} + +func (c *BackendServicesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "backendService": c.backendService, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.backendServices.get" call. +// Exactly one of *BackendService or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *BackendService.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BackendServicesGetCall) Do() (*BackendService, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BackendService{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// GetHealth: Gets the most recent health check results for this +// BackendService. +// For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/getHealth +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BackendServicesGetHealthCall) Fields(s ...googleapi.Field) *BackendServicesGetHealthCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BackendServicesGetHealthCall) Context(ctx context.Context) *BackendServicesGetHealthCall { + c.ctx_ = ctx + return c +} + +func (c *BackendServicesGetHealthCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/getHealth") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "backendService": c.backendService, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.backendServices.getHealth" call. +// Exactly one of *BackendServiceGroupHealth or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *BackendServiceGroupHealth.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BackendServicesGetHealthCall) Do() (*BackendServiceGroupHealth, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BackendServiceGroupHealth{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates a BackendService resource in the specified project +// using the data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BackendServicesInsertCall) Fields(s ...googleapi.Field) *BackendServicesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BackendServicesInsertCall) Context(ctx context.Context) *BackendServicesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *BackendServicesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.backendServices.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *BackendServicesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.backendServices.list": + +type BackendServicesListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of BackendService resources available to the +// specified project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *BackendServicesListCall) MaxResults(maxResults int64) *BackendServicesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *BackendServicesListCall) OrderBy(orderBy string) *BackendServicesListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *BackendServicesListCall) PageToken(pageToken string) *BackendServicesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BackendServicesListCall) Fields(s ...googleapi.Field) *BackendServicesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BackendServicesListCall) IfNoneMatch(entityTag string) *BackendServicesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BackendServicesListCall) Context(ctx context.Context) *BackendServicesListCall { + c.ctx_ = ctx + return c +} + +func (c *BackendServicesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.backendServices.list" call. +// Exactly one of *BackendServiceList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BackendServiceList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BackendServicesListCall) Do() (*BackendServiceList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BackendServiceList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of BackendService resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.backendServices.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Patch: Update the entire content of the BackendService resource. This +// method supports patch semantics. +// For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/patch +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BackendServicesPatchCall) Fields(s ...googleapi.Field) *BackendServicesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BackendServicesPatchCall) Context(ctx context.Context) *BackendServicesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *BackendServicesPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "backendService": c.backendService, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.backendServices.patch" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *BackendServicesPatchCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update the 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Update: Update the entire content of the BackendService resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/update +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BackendServicesUpdateCall) Fields(s ...googleapi.Field) *BackendServicesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BackendServicesUpdateCall) Context(ctx context.Context) *BackendServicesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *BackendServicesUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "backendService": c.backendService, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.backendServices.update" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *BackendServicesUpdateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update the 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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.diskTypes.aggregatedList": + +type DiskTypesAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of disk type resources grouped by +// scope. +// For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/aggregatedList +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *DiskTypesAggregatedListCall) MaxResults(maxResults int64) *DiskTypesAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *DiskTypesAggregatedListCall) OrderBy(orderBy string) *DiskTypesAggregatedListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *DiskTypesAggregatedListCall) PageToken(pageToken string) *DiskTypesAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DiskTypesAggregatedListCall) Fields(s ...googleapi.Field) *DiskTypesAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DiskTypesAggregatedListCall) IfNoneMatch(entityTag string) *DiskTypesAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DiskTypesAggregatedListCall) Context(ctx context.Context) *DiskTypesAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *DiskTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/diskTypes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.diskTypes.aggregatedList" call. +// Exactly one of *DiskTypeAggregatedList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DiskTypeAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DiskTypesAggregatedListCall) Do() (*DiskTypeAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DiskTypeAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of disk type resources grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.diskTypes.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Returns the specified disk type resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DiskTypesGetCall) Fields(s ...googleapi.Field) *DiskTypesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DiskTypesGetCall) IfNoneMatch(entityTag string) *DiskTypesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DiskTypesGetCall) Context(ctx context.Context) *DiskTypesGetCall { + c.ctx_ = ctx + return c +} + +func (c *DiskTypesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes/{diskType}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "diskType": c.diskType, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.diskTypes.get" call. +// Exactly one of *DiskType or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *DiskType.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DiskTypesGetCall) Do() (*DiskType, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DiskType{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// List: Retrieves the list of disk type resources available to the +// specified project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *DiskTypesListCall) MaxResults(maxResults int64) *DiskTypesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *DiskTypesListCall) OrderBy(orderBy string) *DiskTypesListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *DiskTypesListCall) PageToken(pageToken string) *DiskTypesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DiskTypesListCall) Fields(s ...googleapi.Field) *DiskTypesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DiskTypesListCall) IfNoneMatch(entityTag string) *DiskTypesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DiskTypesListCall) Context(ctx context.Context) *DiskTypesListCall { + c.ctx_ = ctx + return c +} + +func (c *DiskTypesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.diskTypes.list" call. +// Exactly one of *DiskTypeList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DiskTypeList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DiskTypesListCall) Do() (*DiskTypeList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DiskTypeList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of disk type resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.diskTypes.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of disks grouped by scope. +// For details, see https://cloud.google.com/compute/docs/reference/latest/disks/aggregatedList +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *DisksAggregatedListCall) MaxResults(maxResults int64) *DisksAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *DisksAggregatedListCall) OrderBy(orderBy string) *DisksAggregatedListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *DisksAggregatedListCall) PageToken(pageToken string) *DisksAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DisksAggregatedListCall) Fields(s ...googleapi.Field) *DisksAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DisksAggregatedListCall) IfNoneMatch(entityTag string) *DisksAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DisksAggregatedListCall) Context(ctx context.Context) *DisksAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *DisksAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/disks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.disks.aggregatedList" call. +// Exactly one of *DiskAggregatedList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DiskAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DisksAggregatedListCall) Do() (*DiskAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DiskAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of disks grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.disks.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// CreateSnapshot: Creates a snapshot of this disk. +// For details, see https://cloud.google.com/compute/docs/reference/latest/disks/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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DisksCreateSnapshotCall) Fields(s ...googleapi.Field) *DisksCreateSnapshotCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DisksCreateSnapshotCall) Context(ctx context.Context) *DisksCreateSnapshotCall { + c.ctx_ = ctx + return c +} + +func (c *DisksCreateSnapshotCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/createSnapshot") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "disk": c.disk, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.disks.createSnapshot" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DisksCreateSnapshotCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a snapshot of this disk.", + // "httpMethod": "POST", + // "id": "compute.disks.createSnapshot", + // "parameterOrder": [ + // "project", + // "zone", + // "disk" + // ], + // "parameters": { + // "disk": { + // "description": "Name of the persistent disk to snapshot.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified persistent disk. Deleting a disk +// removes its data permanently and is irreversible. However, deleting a +// disk does not delete any snapshots previously made from the disk. You +// must separately delete snapshots. +// For details, see https://cloud.google.com/compute/docs/reference/latest/disks/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DisksDeleteCall) Fields(s ...googleapi.Field) *DisksDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DisksDeleteCall) Context(ctx context.Context) *DisksDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *DisksDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "disk": c.disk, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.disks.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DisksDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots.", + // "httpMethod": "DELETE", + // "id": "compute.disks.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "disk" + // ], + // "parameters": { + // "disk": { + // "description": "Name of the persistent disk to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Returns a specified persistent disk. +// For details, see https://cloud.google.com/compute/docs/reference/latest/disks/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DisksGetCall) Fields(s ...googleapi.Field) *DisksGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DisksGetCall) IfNoneMatch(entityTag string) *DisksGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DisksGetCall) Context(ctx context.Context) *DisksGetCall { + c.ctx_ = ctx + return c +} + +func (c *DisksGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "disk": c.disk, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.disks.get" call. +// Exactly one of *Disk or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Disk.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *DisksGetCall) Do() (*Disk, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Disk{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a specified persistent disk.", + // "httpMethod": "GET", + // "id": "compute.disks.get", + // "parameterOrder": [ + // "project", + // "zone", + // "disk" + // ], + // "parameters": { + // "disk": { + // "description": "Name of the persistent disk to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates a persistent disk in the specified project using the +// data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/disks/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DisksInsertCall) Fields(s ...googleapi.Field) *DisksInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DisksInsertCall) Context(ctx context.Context) *DisksInsertCall { + c.ctx_ = ctx + return c +} + +func (c *DisksInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["sourceImage"]; ok { + params.Set("sourceImage", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.disks.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DisksInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a persistent disk in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.disks.insert", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.disks.list": + +type DisksListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of persistent disks contained within the +// specified zone. +// For details, see https://cloud.google.com/compute/docs/reference/latest/disks/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *DisksListCall) MaxResults(maxResults int64) *DisksListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *DisksListCall) OrderBy(orderBy string) *DisksListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *DisksListCall) PageToken(pageToken string) *DisksListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DisksListCall) Fields(s ...googleapi.Field) *DisksListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DisksListCall) IfNoneMatch(entityTag string) *DisksListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DisksListCall) Context(ctx context.Context) *DisksListCall { + c.ctx_ = ctx + return c +} + +func (c *DisksListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.disks.list" call. +// Exactly one of *DiskList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *DiskList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DisksListCall) Do() (*DiskList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DiskList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of persistent disks contained within the specified zone.", + // "httpMethod": "GET", + // "id": "compute.disks.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified firewall resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FirewallsDeleteCall) Fields(s ...googleapi.Field) *FirewallsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FirewallsDeleteCall) Context(ctx context.Context) *FirewallsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *FirewallsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "firewall": c.firewall, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.firewalls.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FirewallsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.firewalls.get": + +type FirewallsGetCall struct { + s *Service + project string + firewall string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified firewall resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FirewallsGetCall) Fields(s ...googleapi.Field) *FirewallsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FirewallsGetCall) IfNoneMatch(entityTag string) *FirewallsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FirewallsGetCall) Context(ctx context.Context) *FirewallsGetCall { + c.ctx_ = ctx + return c +} + +func (c *FirewallsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "firewall": c.firewall, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.firewalls.get" call. +// Exactly one of *Firewall or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Firewall.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FirewallsGetCall) Do() (*Firewall, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Firewall{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates a firewall resource in the specified project using +// the data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FirewallsInsertCall) Fields(s ...googleapi.Field) *FirewallsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FirewallsInsertCall) Context(ctx context.Context) *FirewallsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *FirewallsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.firewalls.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FirewallsInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.firewalls.list": + +type FirewallsListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of firewall resources available to the +// specified project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *FirewallsListCall) MaxResults(maxResults int64) *FirewallsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *FirewallsListCall) OrderBy(orderBy string) *FirewallsListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *FirewallsListCall) PageToken(pageToken string) *FirewallsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FirewallsListCall) Fields(s ...googleapi.Field) *FirewallsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FirewallsListCall) IfNoneMatch(entityTag string) *FirewallsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FirewallsListCall) Context(ctx context.Context) *FirewallsListCall { + c.ctx_ = ctx + return c +} + +func (c *FirewallsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.firewalls.list" call. +// Exactly one of *FirewallList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *FirewallList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FirewallsListCall) Do() (*FirewallList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FirewallList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of firewall resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.firewalls.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Patch: Updates the specified firewall resource with the data included +// in the request. This method supports patch semantics. +// For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/patch +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FirewallsPatchCall) Fields(s ...googleapi.Field) *FirewallsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FirewallsPatchCall) Context(ctx context.Context) *FirewallsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *FirewallsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "firewall": c.firewall, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.firewalls.patch" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FirewallsPatchCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Update: Updates the specified firewall resource with the data +// included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/update +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FirewallsUpdateCall) Fields(s ...googleapi.Field) *FirewallsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FirewallsUpdateCall) Context(ctx context.Context) *FirewallsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *FirewallsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "firewall": c.firewall, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.firewalls.update" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FirewallsUpdateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.forwardingRules.aggregatedList": + +type ForwardingRulesAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of forwarding rules grouped by +// scope. +// For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/aggregatedList +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *ForwardingRulesAggregatedListCall) MaxResults(maxResults int64) *ForwardingRulesAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *ForwardingRulesAggregatedListCall) OrderBy(orderBy string) *ForwardingRulesAggregatedListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *ForwardingRulesAggregatedListCall) PageToken(pageToken string) *ForwardingRulesAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ForwardingRulesAggregatedListCall) Fields(s ...googleapi.Field) *ForwardingRulesAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ForwardingRulesAggregatedListCall) IfNoneMatch(entityTag string) *ForwardingRulesAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ForwardingRulesAggregatedListCall) Context(ctx context.Context) *ForwardingRulesAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *ForwardingRulesAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/forwardingRules") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.forwardingRules.aggregatedList" call. +// Exactly one of *ForwardingRuleAggregatedList or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ForwardingRuleAggregatedList.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ForwardingRulesAggregatedListCall) Do() (*ForwardingRuleAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ForwardingRuleAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of forwarding rules grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.forwardingRules.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified ForwardingRule resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *ForwardingRulesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ForwardingRulesDeleteCall) Context(ctx context.Context) *ForwardingRulesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "forwardingRule": c.forwardingRule, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.forwardingRules.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ForwardingRulesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Returns the specified ForwardingRule resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ForwardingRulesGetCall) Fields(s ...googleapi.Field) *ForwardingRulesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ForwardingRulesGetCall) IfNoneMatch(entityTag string) *ForwardingRulesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ForwardingRulesGetCall) Context(ctx context.Context) *ForwardingRulesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "forwardingRule": c.forwardingRule, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.forwardingRules.get" call. +// Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ForwardingRule.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ForwardingRulesGetCall) Do() (*ForwardingRule, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ForwardingRule{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates a ForwardingRule resource in the specified project +// and region using the data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ForwardingRulesInsertCall) Fields(s ...googleapi.Field) *ForwardingRulesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ForwardingRulesInsertCall) Context(ctx context.Context) *ForwardingRulesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ForwardingRulesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.forwardingRules.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ForwardingRulesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.forwardingRules.list": + +type ForwardingRulesListCall struct { + s *Service + project string + region string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of ForwardingRule resources available to the +// specified project and region. +// For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *ForwardingRulesListCall) MaxResults(maxResults int64) *ForwardingRulesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *ForwardingRulesListCall) OrderBy(orderBy string) *ForwardingRulesListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *ForwardingRulesListCall) PageToken(pageToken string) *ForwardingRulesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ForwardingRulesListCall) Fields(s ...googleapi.Field) *ForwardingRulesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ForwardingRulesListCall) IfNoneMatch(entityTag string) *ForwardingRulesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ForwardingRulesListCall) Context(ctx context.Context) *ForwardingRulesListCall { + c.ctx_ = ctx + return c +} + +func (c *ForwardingRulesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.forwardingRules.list" call. +// Exactly one of *ForwardingRuleList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ForwardingRuleList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ForwardingRulesListCall) Do() (*ForwardingRuleList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ForwardingRuleList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of ForwardingRule resources available to the specified project and region.", + // "httpMethod": "GET", + // "id": "compute.forwardingRules.list", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// SetTarget: Changes target url for forwarding rule. +// For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/setTarget +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *ForwardingRulesSetTargetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ForwardingRulesSetTargetCall) Context(ctx context.Context) *ForwardingRulesSetTargetCall { + c.ctx_ = ctx + return c +} + +func (c *ForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "forwardingRule": c.forwardingRule, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.forwardingRules.setTarget" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ForwardingRulesSetTargetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalAddresses.delete": + +type GlobalAddressesDeleteCall struct { + s *Service + project string + address string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified address resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalAddressesDeleteCall) Fields(s ...googleapi.Field) *GlobalAddressesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalAddressesDeleteCall) Context(ctx context.Context) *GlobalAddressesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalAddressesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "address": c.address, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalAddresses.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GlobalAddressesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalAddresses.get": + +type GlobalAddressesGetCall struct { + s *Service + project string + address string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified address resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalAddressesGetCall) Fields(s ...googleapi.Field) *GlobalAddressesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalAddressesGetCall) IfNoneMatch(entityTag string) *GlobalAddressesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalAddressesGetCall) Context(ctx context.Context) *GlobalAddressesGetCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalAddressesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "address": c.address, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalAddresses.get" call. +// Exactly one of *Address or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Address.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *GlobalAddressesGetCall) Do() (*Address, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Address{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates an address resource in the specified project using +// the data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalAddressesInsertCall) Fields(s ...googleapi.Field) *GlobalAddressesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalAddressesInsertCall) Context(ctx context.Context) *GlobalAddressesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalAddressesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalAddresses.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GlobalAddressesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalAddresses.list": + +type GlobalAddressesListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of global address resources. +// For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *GlobalAddressesListCall) MaxResults(maxResults int64) *GlobalAddressesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *GlobalAddressesListCall) OrderBy(orderBy string) *GlobalAddressesListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *GlobalAddressesListCall) PageToken(pageToken string) *GlobalAddressesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalAddressesListCall) Fields(s ...googleapi.Field) *GlobalAddressesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalAddressesListCall) IfNoneMatch(entityTag string) *GlobalAddressesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalAddressesListCall) Context(ctx context.Context) *GlobalAddressesListCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalAddressesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalAddresses.list" call. +// Exactly one of *AddressList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AddressList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GlobalAddressesListCall) Do() (*AddressList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AddressList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of global address resources.", + // "httpMethod": "GET", + // "id": "compute.globalAddresses.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified ForwardingRule resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalForwardingRulesDeleteCall) Context(ctx context.Context) *GlobalForwardingRulesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "forwardingRule": c.forwardingRule, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalForwardingRules.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GlobalForwardingRulesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalForwardingRules.get": + +type GlobalForwardingRulesGetCall struct { + s *Service + project string + forwardingRule string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified ForwardingRule resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalForwardingRulesGetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalForwardingRulesGetCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalForwardingRulesGetCall) Context(ctx context.Context) *GlobalForwardingRulesGetCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "forwardingRule": c.forwardingRule, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalForwardingRules.get" call. +// Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ForwardingRule.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *GlobalForwardingRulesGetCall) Do() (*ForwardingRule, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ForwardingRule{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates a ForwardingRule resource in the specified project +// and region using the data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalForwardingRulesInsertCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalForwardingRulesInsertCall) Context(ctx context.Context) *GlobalForwardingRulesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalForwardingRulesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalForwardingRules.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GlobalForwardingRulesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalForwardingRules.list": + +type GlobalForwardingRulesListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of ForwardingRule resources available to the +// specified project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *GlobalForwardingRulesListCall) MaxResults(maxResults int64) *GlobalForwardingRulesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *GlobalForwardingRulesListCall) OrderBy(orderBy string) *GlobalForwardingRulesListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *GlobalForwardingRulesListCall) PageToken(pageToken string) *GlobalForwardingRulesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalForwardingRulesListCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalForwardingRulesListCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalForwardingRulesListCall) Context(ctx context.Context) *GlobalForwardingRulesListCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalForwardingRulesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalForwardingRules.list" call. +// Exactly one of *ForwardingRuleList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ForwardingRuleList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *GlobalForwardingRulesListCall) Do() (*ForwardingRuleList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ForwardingRuleList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of ForwardingRule resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.globalForwardingRules.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// SetTarget: Changes target url for forwarding rule. +// For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/setTarget +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetTargetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalForwardingRulesSetTargetCall) Context(ctx context.Context) *GlobalForwardingRulesSetTargetCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}/setTarget") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "forwardingRule": c.forwardingRule, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalForwardingRules.setTarget" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GlobalForwardingRulesSetTargetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalOperations.aggregatedList": + +type GlobalOperationsAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of all operations grouped by +// scope. +// For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/aggregatedList +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *GlobalOperationsAggregatedListCall) MaxResults(maxResults int64) *GlobalOperationsAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *GlobalOperationsAggregatedListCall) OrderBy(orderBy string) *GlobalOperationsAggregatedListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *GlobalOperationsAggregatedListCall) PageToken(pageToken string) *GlobalOperationsAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalOperationsAggregatedListCall) Fields(s ...googleapi.Field) *GlobalOperationsAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalOperationsAggregatedListCall) IfNoneMatch(entityTag string) *GlobalOperationsAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalOperationsAggregatedListCall) Context(ctx context.Context) *GlobalOperationsAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalOperationsAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalOperations.aggregatedList" call. +// Exactly one of *OperationAggregatedList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *OperationAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *GlobalOperationsAggregatedListCall) Do() (*OperationAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperationAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of all operations grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.globalOperations.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified Operations resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalOperationsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalOperationsDeleteCall) Context(ctx context.Context) *GlobalOperationsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalOperations.delete" call. +func (c *GlobalOperationsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified Operations resource.", + // "httpMethod": "DELETE", + // "id": "compute.globalOperations.delete", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the Operations resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalOperations.get": + +type GlobalOperationsGetCall struct { + s *Service + project string + operation string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves the specified Operations resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalOperationsGetCall) Fields(s ...googleapi.Field) *GlobalOperationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalOperationsGetCall) IfNoneMatch(entityTag string) *GlobalOperationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalOperationsGetCall) Context(ctx context.Context) *GlobalOperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalOperationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalOperations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GlobalOperationsGetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified Operations resource.", + // "httpMethod": "GET", + // "id": "compute.globalOperations.get", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the Operations resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// List: Retrieves the list of Operation resources contained within the +// specified project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *GlobalOperationsListCall) MaxResults(maxResults int64) *GlobalOperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *GlobalOperationsListCall) OrderBy(orderBy string) *GlobalOperationsListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *GlobalOperationsListCall) PageToken(pageToken string) *GlobalOperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalOperationsListCall) Fields(s ...googleapi.Field) *GlobalOperationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalOperationsListCall) IfNoneMatch(entityTag string) *GlobalOperationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalOperationsListCall) Context(ctx context.Context) *GlobalOperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalOperationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalOperations.list" call. +// Exactly one of *OperationList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *OperationList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *GlobalOperationsListCall) Do() (*OperationList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperationList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of Operation resources contained within the specified project.", + // "httpMethod": "GET", + // "id": "compute.globalOperations.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified HttpHealthCheck resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpHealthChecksDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HttpHealthChecksDeleteCall) Context(ctx context.Context) *HttpHealthChecksDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *HttpHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "httpHealthCheck": c.httpHealthCheck, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpHealthChecks.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *HttpHealthChecksDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.httpHealthChecks.get": + +type HttpHealthChecksGetCall struct { + s *Service + project string + httpHealthCheck string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified HttpHealthCheck resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpHealthChecksGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *HttpHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpHealthChecksGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HttpHealthChecksGetCall) Context(ctx context.Context) *HttpHealthChecksGetCall { + c.ctx_ = ctx + return c +} + +func (c *HttpHealthChecksGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "httpHealthCheck": c.httpHealthCheck, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpHealthChecks.get" call. +// Exactly one of *HttpHealthCheck or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *HttpHealthCheck.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *HttpHealthChecksGetCall) Do() (*HttpHealthCheck, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &HttpHealthCheck{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates a HttpHealthCheck resource in the specified project +// using the data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpHealthChecksInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HttpHealthChecksInsertCall) Context(ctx context.Context) *HttpHealthChecksInsertCall { + c.ctx_ = ctx + return c +} + +func (c *HttpHealthChecksInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpHealthChecks.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *HttpHealthChecksInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.httpHealthChecks.list": + +type HttpHealthChecksListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of HttpHealthCheck resources available to +// the specified project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *HttpHealthChecksListCall) MaxResults(maxResults int64) *HttpHealthChecksListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *HttpHealthChecksListCall) OrderBy(orderBy string) *HttpHealthChecksListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *HttpHealthChecksListCall) PageToken(pageToken string) *HttpHealthChecksListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpHealthChecksListCall) Fields(s ...googleapi.Field) *HttpHealthChecksListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *HttpHealthChecksListCall) IfNoneMatch(entityTag string) *HttpHealthChecksListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HttpHealthChecksListCall) Context(ctx context.Context) *HttpHealthChecksListCall { + c.ctx_ = ctx + return c +} + +func (c *HttpHealthChecksListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpHealthChecks.list" call. +// Exactly one of *HttpHealthCheckList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *HttpHealthCheckList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *HttpHealthChecksListCall) Do() (*HttpHealthCheckList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &HttpHealthCheckList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of HttpHealthCheck resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.httpHealthChecks.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Patch: Updates a HttpHealthCheck resource in the specified project +// using the data included in the request. This method supports patch +// semantics. +// For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/patch +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpHealthChecksPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HttpHealthChecksPatchCall) Context(ctx context.Context) *HttpHealthChecksPatchCall { + c.ctx_ = ctx + return c +} + +func (c *HttpHealthChecksPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "httpHealthCheck": c.httpHealthCheck, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpHealthChecks.patch" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *HttpHealthChecksPatchCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Update: Updates a HttpHealthCheck resource in the specified project +// using the data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/update +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpHealthChecksUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HttpHealthChecksUpdateCall) Context(ctx context.Context) *HttpHealthChecksUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *HttpHealthChecksUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "httpHealthCheck": c.httpHealthCheck, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpHealthChecks.update" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *HttpHealthChecksUpdateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.httpsHealthChecks.delete": + +type HttpsHealthChecksDeleteCall struct { + s *Service + project string + httpsHealthCheck string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified HttpsHealthCheck resource. +func (r *HttpsHealthChecksService) Delete(project string, httpsHealthCheck string) *HttpsHealthChecksDeleteCall { + c := &HttpsHealthChecksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.httpsHealthCheck = httpsHealthCheck + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpsHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpsHealthChecksDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HttpsHealthChecksDeleteCall) Context(ctx context.Context) *HttpsHealthChecksDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *HttpsHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "httpsHealthCheck": c.httpsHealthCheck, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpsHealthChecks.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *HttpsHealthChecksDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified HttpsHealthCheck resource.", + // "httpMethod": "DELETE", + // "id": "compute.httpsHealthChecks.delete", + // "parameterOrder": [ + // "project", + // "httpsHealthCheck" + // ], + // "parameters": { + // "httpsHealthCheck": { + // "description": "Name of the HttpsHealthCheck 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/httpsHealthChecks/{httpsHealthCheck}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.httpsHealthChecks.get": + +type HttpsHealthChecksGetCall struct { + s *Service + project string + httpsHealthCheck string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified HttpsHealthCheck resource. +func (r *HttpsHealthChecksService) Get(project string, httpsHealthCheck string) *HttpsHealthChecksGetCall { + c := &HttpsHealthChecksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.httpsHealthCheck = httpsHealthCheck + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpsHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpsHealthChecksGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *HttpsHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpsHealthChecksGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HttpsHealthChecksGetCall) Context(ctx context.Context) *HttpsHealthChecksGetCall { + c.ctx_ = ctx + return c +} + +func (c *HttpsHealthChecksGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "httpsHealthCheck": c.httpsHealthCheck, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpsHealthChecks.get" call. +// Exactly one of *HttpsHealthCheck or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *HttpsHealthCheck.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *HttpsHealthChecksGetCall) Do() (*HttpsHealthCheck, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &HttpsHealthCheck{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified HttpsHealthCheck resource.", + // "httpMethod": "GET", + // "id": "compute.httpsHealthChecks.get", + // "parameterOrder": [ + // "project", + // "httpsHealthCheck" + // ], + // "parameters": { + // "httpsHealthCheck": { + // "description": "Name of the HttpsHealthCheck 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/httpsHealthChecks/{httpsHealthCheck}", + // "response": { + // "$ref": "HttpsHealthCheck" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.httpsHealthChecks.insert": + +type HttpsHealthChecksInsertCall struct { + s *Service + project string + httpshealthcheck *HttpsHealthCheck + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a HttpsHealthCheck resource in the specified project +// using the data included in the request. +func (r *HttpsHealthChecksService) Insert(project string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksInsertCall { + c := &HttpsHealthChecksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.httpshealthcheck = httpshealthcheck + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpsHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpsHealthChecksInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HttpsHealthChecksInsertCall) Context(ctx context.Context) *HttpsHealthChecksInsertCall { + c.ctx_ = ctx + return c +} + +func (c *HttpsHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpsHealthChecks.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *HttpsHealthChecksInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a HttpsHealthCheck resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.httpsHealthChecks.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/httpsHealthChecks", + // "request": { + // "$ref": "HttpsHealthCheck" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.httpsHealthChecks.list": + +type HttpsHealthChecksListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of HttpsHealthCheck resources available to +// the specified project. +func (r *HttpsHealthChecksService) List(project string) *HttpsHealthChecksListCall { + c := &HttpsHealthChecksListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *HttpsHealthChecksListCall) Filter(filter string) *HttpsHealthChecksListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *HttpsHealthChecksListCall) MaxResults(maxResults int64) *HttpsHealthChecksListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *HttpsHealthChecksListCall) OrderBy(orderBy string) *HttpsHealthChecksListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *HttpsHealthChecksListCall) PageToken(pageToken string) *HttpsHealthChecksListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpsHealthChecksListCall) Fields(s ...googleapi.Field) *HttpsHealthChecksListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *HttpsHealthChecksListCall) IfNoneMatch(entityTag string) *HttpsHealthChecksListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HttpsHealthChecksListCall) Context(ctx context.Context) *HttpsHealthChecksListCall { + c.ctx_ = ctx + return c +} + +func (c *HttpsHealthChecksListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpsHealthChecks.list" call. +// Exactly one of *HttpsHealthCheckList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *HttpsHealthCheckList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *HttpsHealthChecksListCall) Do() (*HttpsHealthCheckList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &HttpsHealthCheckList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of HttpsHealthCheck resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.httpsHealthChecks.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/httpsHealthChecks", + // "response": { + // "$ref": "HttpsHealthCheckList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.httpsHealthChecks.patch": + +type HttpsHealthChecksPatchCall struct { + s *Service + project string + httpsHealthCheck string + httpshealthcheck *HttpsHealthCheck + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates a HttpsHealthCheck resource in the specified project +// using the data included in the request. This method supports patch +// semantics. +func (r *HttpsHealthChecksService) Patch(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksPatchCall { + c := &HttpsHealthChecksPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.httpsHealthCheck = httpsHealthCheck + c.httpshealthcheck = httpshealthcheck + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpsHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpsHealthChecksPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HttpsHealthChecksPatchCall) Context(ctx context.Context) *HttpsHealthChecksPatchCall { + c.ctx_ = ctx + return c +} + +func (c *HttpsHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "httpsHealthCheck": c.httpsHealthCheck, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpsHealthChecks.patch" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *HttpsHealthChecksPatchCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "compute.httpsHealthChecks.patch", + // "parameterOrder": [ + // "project", + // "httpsHealthCheck" + // ], + // "parameters": { + // "httpsHealthCheck": { + // "description": "Name of the HttpsHealthCheck 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/httpsHealthChecks/{httpsHealthCheck}", + // "request": { + // "$ref": "HttpsHealthCheck" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.httpsHealthChecks.update": + +type HttpsHealthChecksUpdateCall struct { + s *Service + project string + httpsHealthCheck string + httpshealthcheck *HttpsHealthCheck + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a HttpsHealthCheck resource in the specified project +// using the data included in the request. +func (r *HttpsHealthChecksService) Update(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksUpdateCall { + c := &HttpsHealthChecksUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.httpsHealthCheck = httpsHealthCheck + c.httpshealthcheck = httpshealthcheck + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpsHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpsHealthChecksUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HttpsHealthChecksUpdateCall) Context(ctx context.Context) *HttpsHealthChecksUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *HttpsHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "httpsHealthCheck": c.httpsHealthCheck, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpsHealthChecks.update" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *HttpsHealthChecksUpdateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request.", + // "httpMethod": "PUT", + // "id": "compute.httpsHealthChecks.update", + // "parameterOrder": [ + // "project", + // "httpsHealthCheck" + // ], + // "parameters": { + // "httpsHealthCheck": { + // "description": "Name of the HttpsHealthCheck 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/httpsHealthChecks/{httpsHealthCheck}", + // "request": { + // "$ref": "HttpsHealthCheck" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.images.delete": + +type ImagesDeleteCall struct { + s *Service + project string + image string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified image resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/images/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ImagesDeleteCall) Fields(s ...googleapi.Field) *ImagesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ImagesDeleteCall) Context(ctx context.Context) *ImagesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ImagesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "image": c.image, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.images.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ImagesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Deprecate: Sets the deprecation status of an image. +// +// If an empty request body is given, clears the deprecation status +// instead. +// For details, see https://cloud.google.com/compute/docs/reference/latest/images/deprecate +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ImagesDeprecateCall) Fields(s ...googleapi.Field) *ImagesDeprecateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ImagesDeprecateCall) Context(ctx context.Context) *ImagesDeprecateCall { + c.ctx_ = ctx + return c +} + +func (c *ImagesDeprecateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}/deprecate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "image": c.image, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.images.deprecate" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ImagesDeprecateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the deprecation status of an image.\n\nIf an empty request 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.images.get": + +type ImagesGetCall struct { + s *Service + project string + image string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified image resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/images/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ImagesGetCall) Fields(s ...googleapi.Field) *ImagesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ImagesGetCall) IfNoneMatch(entityTag string) *ImagesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ImagesGetCall) Context(ctx context.Context) *ImagesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ImagesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "image": c.image, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.images.get" call. +// Exactly one of *Image or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Image.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ImagesGetCall) Do() (*Image, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Image{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates an image resource in the specified project using the +// data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/images/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ImagesInsertCall) Fields(s ...googleapi.Field) *ImagesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ImagesInsertCall) Context(ctx context.Context) *ImagesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ImagesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.images.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ImagesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// List: Retrieves the list of private images available to the specified +// project. Private images are images you create that belong to your +// project. This method does not get any images that belong to other +// projects, including publicly-available images, like Debian 7. If you +// want to get a list of publicly-available images, use this method to +// make a request to the respective image project, such as debian-cloud +// or windows-cloud. +// +// See Accessing images for more information. +// For details, see https://cloud.google.com/compute/docs/reference/latest/images/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *ImagesListCall) MaxResults(maxResults int64) *ImagesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *ImagesListCall) OrderBy(orderBy string) *ImagesListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *ImagesListCall) PageToken(pageToken string) *ImagesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ImagesListCall) Fields(s ...googleapi.Field) *ImagesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ImagesListCall) IfNoneMatch(entityTag string) *ImagesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ImagesListCall) Context(ctx context.Context) *ImagesListCall { + c.ctx_ = ctx + return c +} + +func (c *ImagesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.images.list" call. +// Exactly one of *ImageList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ImageList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ImagesListCall) Do() (*ImageList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ImageList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of private images available to the specified project. Private images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 7. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud.\n\nSee Accessing images for more information.", + // "httpMethod": "GET", + // "id": "compute.images.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.abandonInstances": + +type InstanceGroupManagersAbandonInstancesCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// AbandonInstances: Schedules a group action to remove the specified +// instances from the managed instance group. Abandoning an instance +// does not delete the instance, but it does remove the instance from +// any target pools that are applied by the managed instance group. This +// method reduces the targetSize of the managed instance group by the +// number of instances that you abandon. This operation is marked as +// DONE when the action is scheduled even if the instances have not yet +// been removed from the group. You must separately verify the status of +// the abandoning action with the listmanagedinstances method. +func (r *InstanceGroupManagersService) AbandonInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest) *InstanceGroupManagersAbandonInstancesCall { + c := &InstanceGroupManagersAbandonInstancesCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanagersabandoninstancesrequest = instancegroupmanagersabandoninstancesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAbandonInstancesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *InstanceGroupManagersAbandonInstancesCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersabandoninstancesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.abandonInstances" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagersAbandonInstancesCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.", + // "httpMethod": "POST", + // "id": "compute.instanceGroupManagers.abandonInstances", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances", + // "request": { + // "$ref": "InstanceGroupManagersAbandonInstancesRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.aggregatedList": + +type InstanceGroupManagersAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of managed instance groups and +// groups them by zone. +func (r *InstanceGroupManagersService) AggregatedList(project string) *InstanceGroupManagersAggregatedListCall { + c := &InstanceGroupManagersAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *InstanceGroupManagersAggregatedListCall) Filter(filter string) *InstanceGroupManagersAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *InstanceGroupManagersAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupManagersAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *InstanceGroupManagersAggregatedListCall) OrderBy(orderBy string) *InstanceGroupManagersAggregatedListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *InstanceGroupManagersAggregatedListCall) PageToken(pageToken string) *InstanceGroupManagersAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstanceGroupManagersAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersAggregatedListCall) Context(ctx context.Context) *InstanceGroupManagersAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroupManagers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.aggregatedList" call. +// Exactly one of *InstanceGroupManagerAggregatedList or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *InstanceGroupManagerAggregatedList.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *InstanceGroupManagersAggregatedListCall) Do() (*InstanceGroupManagerAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceGroupManagerAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of managed instance groups and groups them by zone.", + // "httpMethod": "GET", + // "id": "compute.instanceGroupManagers.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/instanceGroupManagers", + // "response": { + // "$ref": "InstanceGroupManagerAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.delete": + +type InstanceGroupManagersDeleteCall struct { + s *Service + project string + zone string + instanceGroupManager string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified managed instance group and all of the +// instances in that group. +func (r *InstanceGroupManagersService) Delete(project string, zone string, instanceGroupManager string) *InstanceGroupManagersDeleteCall { + c := &InstanceGroupManagersDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersDeleteCall) Context(ctx context.Context) *InstanceGroupManagersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagersDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified managed instance group and all of the instances in that group.", + // "httpMethod": "DELETE", + // "id": "compute.instanceGroupManagers.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.deleteInstances": + +type InstanceGroupManagersDeleteInstancesCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// DeleteInstances: Schedules a group action to delete the specified +// instances in the managed instance group. The instances are also +// removed from any target pools of which they were a member. This +// method reduces the targetSize of the managed instance group by the +// number of instances that you delete. This operation is marked as DONE +// when the action is scheduled even if the instances are still being +// deleted. You must separately verify the status of the deleting action +// with the listmanagedinstances method. +func (r *InstanceGroupManagersService) DeleteInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest) *InstanceGroupManagersDeleteInstancesCall { + c := &InstanceGroupManagersDeleteInstancesCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanagersdeleteinstancesrequest = instancegroupmanagersdeleteinstancesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteInstancesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *InstanceGroupManagersDeleteInstancesCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteinstancesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.deleteInstances" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagersDeleteInstancesCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method.", + // "httpMethod": "POST", + // "id": "compute.instanceGroupManagers.deleteInstances", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances", + // "request": { + // "$ref": "InstanceGroupManagersDeleteInstancesRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.get": + +type InstanceGroupManagersGetCall struct { + s *Service + project string + zone string + instanceGroupManager string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns all of the details about the specified managed instance +// group. +func (r *InstanceGroupManagersService) Get(project string, zone string, instanceGroupManager string) *InstanceGroupManagersGetCall { + c := &InstanceGroupManagersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *InstanceGroupManagersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *InstanceGroupManagersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersGetCall) Context(ctx context.Context) *InstanceGroupManagersGetCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.get" call. +// Exactly one of *InstanceGroupManager or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *InstanceGroupManager.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstanceGroupManagersGetCall) Do() (*InstanceGroupManager, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceGroupManager{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns all of the details about the specified managed instance group.", + // "httpMethod": "GET", + // "id": "compute.instanceGroupManagers.get", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}", + // "response": { + // "$ref": "InstanceGroupManager" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.insert": + +type InstanceGroupManagersInsertCall struct { + s *Service + project string + zone string + instancegroupmanager *InstanceGroupManager + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a managed instance group using the information that +// you specify in the request. After the group is created, it schedules +// an action to create instances in the group using the specified +// instance template. This operation is marked as DONE when the group is +// created even if the instances in the group have not yet been created. +// You must separately verify the status of the individual instances +// with the listmanagedinstances method. +func (r *InstanceGroupManagersService) Insert(project string, zone string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersInsertCall { + c := &InstanceGroupManagersInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instancegroupmanager = instancegroupmanager + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *InstanceGroupManagersInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersInsertCall) Context(ctx context.Context) *InstanceGroupManagersInsertCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagersInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method.", + // "httpMethod": "POST", + // "id": "compute.instanceGroupManagers.insert", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where you want to create the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers", + // "request": { + // "$ref": "InstanceGroupManager" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.list": + +type InstanceGroupManagersListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of managed instance groups that are contained +// within the specified project and zone. +func (r *InstanceGroupManagersService) List(project string, zone string) *InstanceGroupManagersListCall { + c := &InstanceGroupManagersListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *InstanceGroupManagersListCall) Filter(filter string) *InstanceGroupManagersListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *InstanceGroupManagersListCall) MaxResults(maxResults int64) *InstanceGroupManagersListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *InstanceGroupManagersListCall) OrderBy(orderBy string) *InstanceGroupManagersListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *InstanceGroupManagersListCall) PageToken(pageToken string) *InstanceGroupManagersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstanceGroupManagersListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersListCall) Context(ctx context.Context) *InstanceGroupManagersListCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.list" call. +// Exactly one of *InstanceGroupManagerList or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *InstanceGroupManagerList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstanceGroupManagersListCall) Do() (*InstanceGroupManagerList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceGroupManagerList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of managed instance groups that are contained within the specified project and zone.", + // "httpMethod": "GET", + // "id": "compute.instanceGroupManagers.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers", + // "response": { + // "$ref": "InstanceGroupManagerList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.listManagedInstances": + +type InstanceGroupManagersListManagedInstancesCall struct { + s *Service + project string + zone string + instanceGroupManager string + opt_ map[string]interface{} + ctx_ context.Context +} + +// ListManagedInstances: Lists all of the instances in the managed +// instance group. Each instance in the list has a currentAction, which +// indicates the action that the managed instance group is performing on +// the instance. For example, if the group is still creating an +// instance, the currentAction is CREATING. If a previous action failed, +// the list displays the errors for that failed action. +func (r *InstanceGroupManagersService) ListManagedInstances(project string, zone string, instanceGroupManager string) *InstanceGroupManagersListManagedInstancesCall { + c := &InstanceGroupManagersListManagedInstancesCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListManagedInstancesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *InstanceGroupManagersListManagedInstancesCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.listManagedInstances" call. +// Exactly one of *InstanceGroupManagersListManagedInstancesResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *InstanceGroupManagersListManagedInstancesResponse.ServerResponse.Head +// er or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *InstanceGroupManagersListManagedInstancesCall) Do() (*InstanceGroupManagersListManagedInstancesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceGroupManagersListManagedInstancesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action.", + // "httpMethod": "POST", + // "id": "compute.instanceGroupManagers.listManagedInstances", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances", + // "response": { + // "$ref": "InstanceGroupManagersListManagedInstancesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.recreateInstances": + +type InstanceGroupManagersRecreateInstancesCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// RecreateInstances: Schedules a group action to recreate the specified +// instances in the managed instance group. The instances are deleted +// and recreated using the current instance template for the managed +// instance group. This operation is marked as DONE when the action is +// scheduled even if the instances have not yet been recreated. You must +// separately verify the status of the recreating action with the +// listmanagedinstances method. +func (r *InstanceGroupManagersService) RecreateInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest) *InstanceGroupManagersRecreateInstancesCall { + c := &InstanceGroupManagersRecreateInstancesCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanagersrecreateinstancesrequest = instancegroupmanagersrecreateinstancesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersRecreateInstancesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *InstanceGroupManagersRecreateInstancesCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersrecreateinstancesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.recreateInstances" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagersRecreateInstancesCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.", + // "httpMethod": "POST", + // "id": "compute.instanceGroupManagers.recreateInstances", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances", + // "request": { + // "$ref": "InstanceGroupManagersRecreateInstancesRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.resize": + +type InstanceGroupManagersResizeCall struct { + s *Service + project string + zone string + instanceGroupManager string + size int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Resize: Resizes the managed instance group. If you increase the size, +// the group creates new instances using the current instance template. +// If you decrease the size, the group deletes instances. The resize +// operation is marked DONE when the resize actions are scheduled even +// if the group has not yet added or deleted any instances. You must +// separately verify the status of the creating or deleting actions with +// the listmanagedinstances method. +func (r *InstanceGroupManagersService) Resize(project string, zone string, instanceGroupManager string, size int64) *InstanceGroupManagersResizeCall { + c := &InstanceGroupManagersResizeCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.size = size + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersResizeCall) Context(ctx context.Context) *InstanceGroupManagersResizeCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("size", fmt.Sprintf("%v", c.size)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.resize" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagersResizeCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.", + // "httpMethod": "POST", + // "id": "compute.instanceGroupManagers.resize", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager", + // "size" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "size": { + // "description": "The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter.", + // "format": "int32", + // "location": "query", + // "required": true, + // "type": "integer" + // }, + // "zone": { + // "description": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.setAutoHealingPolicies": + +type InstanceGroupManagersSetAutoHealingPoliciesCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagerssetautohealingrequest *InstanceGroupManagersSetAutoHealingRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetAutoHealingPolicies: Modifies the autohealing policy. +func (r *InstanceGroupManagersService) SetAutoHealingPolicies(project string, zone string, instanceGroupManager string, instancegroupmanagerssetautohealingrequest *InstanceGroupManagersSetAutoHealingRequest) *InstanceGroupManagersSetAutoHealingPoliciesCall { + c := &InstanceGroupManagersSetAutoHealingPoliciesCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanagerssetautohealingrequest = instancegroupmanagerssetautohealingrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetAutoHealingPoliciesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Context(ctx context.Context) *InstanceGroupManagersSetAutoHealingPoliciesCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetautohealingrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.setAutoHealingPolicies" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Modifies the autohealing policy.", + // "httpMethod": "POST", + // "id": "compute.instanceGroupManagers.setAutoHealingPolicies", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the instance group manager.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The URL of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies", + // "request": { + // "$ref": "InstanceGroupManagersSetAutoHealingRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.setInstanceTemplate": + +type InstanceGroupManagersSetInstanceTemplateCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetInstanceTemplate: Specifies the instance template to use when +// creating new instances in this group. The templates for existing +// instances in the group do not change unless you recreate them. +func (r *InstanceGroupManagersService) SetInstanceTemplate(project string, zone string, instanceGroupManager string, instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest) *InstanceGroupManagersSetInstanceTemplateCall { + c := &InstanceGroupManagersSetInstanceTemplateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanagerssetinstancetemplaterequest = instancegroupmanagerssetinstancetemplaterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetInstanceTemplateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *InstanceGroupManagersSetInstanceTemplateCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetinstancetemplaterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.setInstanceTemplate" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagersSetInstanceTemplateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you recreate them.", + // "httpMethod": "POST", + // "id": "compute.instanceGroupManagers.setInstanceTemplate", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate", + // "request": { + // "$ref": "InstanceGroupManagersSetInstanceTemplateRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.setTargetPools": + +type InstanceGroupManagersSetTargetPoolsCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetTargetPools: Modifies the target pools to which all instances in +// this managed instance group are assigned. The target pools +// automatically apply to all of the instances in the managed instance +// group. This operation is marked DONE when you make the request even +// if the instances have not yet been added to their target pools. The +// change might take some time to apply to all of the instances in the +// group depending on the size of the group. +func (r *InstanceGroupManagersService) SetTargetPools(project string, zone string, instanceGroupManager string, instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest) *InstanceGroupManagersSetTargetPoolsCall { + c := &InstanceGroupManagersSetTargetPoolsCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanagerssettargetpoolsrequest = instancegroupmanagerssettargetpoolsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetTargetPoolsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *InstanceGroupManagersSetTargetPoolsCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssettargetpoolsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.setTargetPools" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagersSetTargetPoolsCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group.", + // "httpMethod": "POST", + // "id": "compute.instanceGroupManagers.setTargetPools", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools", + // "request": { + // "$ref": "InstanceGroupManagersSetTargetPoolsRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroups.addInstances": + +type InstanceGroupsAddInstancesCall struct { + s *Service + project string + zone string + instanceGroup string + instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// AddInstances: Adds a list of instances to the specified instance +// group. All of the instances in the instance group must be in the same +// network/subnetwork. TODO: Change to comment to state "if IG is load +// balanced." +func (r *InstanceGroupsService) AddInstances(project string, zone string, instanceGroup string, instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest) *InstanceGroupsAddInstancesCall { + c := &InstanceGroupsAddInstancesCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroup = instanceGroup + c.instancegroupsaddinstancesrequest = instancegroupsaddinstancesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupsAddInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsAddInstancesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupsAddInstancesCall) Context(ctx context.Context) *InstanceGroupsAddInstancesCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsAddInstancesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsaddinstancesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroup": c.instanceGroup, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.addInstances" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupsAddInstancesCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. TODO: Change to comment to state \"if IG is load balanced.\"", + // "httpMethod": "POST", + // "id": "compute.instanceGroups.addInstances", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroup" + // ], + // "parameters": { + // "instanceGroup": { + // "description": "The name of the instance group where you are adding instances.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances", + // "request": { + // "$ref": "InstanceGroupsAddInstancesRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroups.aggregatedList": + +type InstanceGroupsAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of instance groups and sorts them +// by zone. +func (r *InstanceGroupsService) AggregatedList(project string) *InstanceGroupsAggregatedListCall { + c := &InstanceGroupsAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *InstanceGroupsAggregatedListCall) Filter(filter string) *InstanceGroupsAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *InstanceGroupsAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupsAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *InstanceGroupsAggregatedListCall) OrderBy(orderBy string) *InstanceGroupsAggregatedListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *InstanceGroupsAggregatedListCall) PageToken(pageToken string) *InstanceGroupsAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupsAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupsAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstanceGroupsAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupsAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupsAggregatedListCall) Context(ctx context.Context) *InstanceGroupsAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.aggregatedList" call. +// Exactly one of *InstanceGroupAggregatedList or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *InstanceGroupAggregatedList.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstanceGroupsAggregatedListCall) Do() (*InstanceGroupAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceGroupAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of instance groups and sorts them by zone.", + // "httpMethod": "GET", + // "id": "compute.instanceGroups.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/instanceGroups", + // "response": { + // "$ref": "InstanceGroupAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroups.delete": + +type InstanceGroupsDeleteCall struct { + s *Service + project string + zone string + instanceGroup string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified instance group. The instances in the +// group are not deleted. +func (r *InstanceGroupsService) Delete(project string, zone string, instanceGroup string) *InstanceGroupsDeleteCall { + c := &InstanceGroupsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroup = instanceGroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupsDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupsDeleteCall) Context(ctx context.Context) *InstanceGroupsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroup": c.instanceGroup, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified instance group. The instances in the group are not deleted.", + // "httpMethod": "DELETE", + // "id": "compute.instanceGroups.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroup" + // ], + // "parameters": { + // "instanceGroup": { + // "description": "The name of the instance group to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroups.get": + +type InstanceGroupsGetCall struct { + s *Service + project string + zone string + instanceGroup string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified instance group resource. +func (r *InstanceGroupsService) Get(project string, zone string, instanceGroup string) *InstanceGroupsGetCall { + c := &InstanceGroupsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroup = instanceGroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupsGetCall) Fields(s ...googleapi.Field) *InstanceGroupsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstanceGroupsGetCall) IfNoneMatch(entityTag string) *InstanceGroupsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupsGetCall) Context(ctx context.Context) *InstanceGroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroup": c.instanceGroup, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.get" call. +// Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *InstanceGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstanceGroupsGetCall) Do() (*InstanceGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified instance group resource.", + // "httpMethod": "GET", + // "id": "compute.instanceGroups.get", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroup" + // ], + // "parameters": { + // "instanceGroup": { + // "description": "The name of the instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}", + // "response": { + // "$ref": "InstanceGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroups.insert": + +type InstanceGroupsInsertCall struct { + s *Service + project string + zone string + instancegroup *InstanceGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates an instance group in the specified project using the +// parameters that are included in the request. +func (r *InstanceGroupsService) Insert(project string, zone string, instancegroup *InstanceGroup) *InstanceGroupsInsertCall { + c := &InstanceGroupsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instancegroup = instancegroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupsInsertCall) Fields(s ...googleapi.Field) *InstanceGroupsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupsInsertCall) Context(ctx context.Context) *InstanceGroupsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupsInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an instance group in the specified project using the parameters that are included in the request.", + // "httpMethod": "POST", + // "id": "compute.instanceGroups.insert", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where you want to create the instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroups", + // "request": { + // "$ref": "InstanceGroup" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroups.list": + +type InstanceGroupsListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of instance groups that are located in the +// specified project and zone. +func (r *InstanceGroupsService) List(project string, zone string) *InstanceGroupsListCall { + c := &InstanceGroupsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *InstanceGroupsListCall) Filter(filter string) *InstanceGroupsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *InstanceGroupsListCall) MaxResults(maxResults int64) *InstanceGroupsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *InstanceGroupsListCall) OrderBy(orderBy string) *InstanceGroupsListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *InstanceGroupsListCall) PageToken(pageToken string) *InstanceGroupsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupsListCall) Fields(s ...googleapi.Field) *InstanceGroupsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstanceGroupsListCall) IfNoneMatch(entityTag string) *InstanceGroupsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupsListCall) Context(ctx context.Context) *InstanceGroupsListCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.list" call. +// Exactly one of *InstanceGroupList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *InstanceGroupList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstanceGroupsListCall) Do() (*InstanceGroupList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceGroupList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of instance groups that are located in the specified project and zone.", + // "httpMethod": "GET", + // "id": "compute.instanceGroups.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroups", + // "response": { + // "$ref": "InstanceGroupList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroups.listInstances": + +type InstanceGroupsListInstancesCall struct { + s *Service + project string + zone string + instanceGroup string + instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// ListInstances: Lists the instances in the specified instance group. +func (r *InstanceGroupsService) ListInstances(project string, zone string, instanceGroup string, instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest) *InstanceGroupsListInstancesCall { + c := &InstanceGroupsListInstancesCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroup = instanceGroup + c.instancegroupslistinstancesrequest = instancegroupslistinstancesrequest + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *InstanceGroupsListInstancesCall) Filter(filter string) *InstanceGroupsListInstancesCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *InstanceGroupsListInstancesCall) MaxResults(maxResults int64) *InstanceGroupsListInstancesCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *InstanceGroupsListInstancesCall) OrderBy(orderBy string) *InstanceGroupsListInstancesCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *InstanceGroupsListInstancesCall) PageToken(pageToken string) *InstanceGroupsListInstancesCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsListInstancesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupsListInstancesCall) Context(ctx context.Context) *InstanceGroupsListInstancesCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupslistinstancesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroup": c.instanceGroup, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.listInstances" call. +// Exactly one of *InstanceGroupsListInstances or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *InstanceGroupsListInstances.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstanceGroupsListInstancesCall) Do() (*InstanceGroupsListInstances, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceGroupsListInstances{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the instances in the specified instance group.", + // "httpMethod": "POST", + // "id": "compute.instanceGroups.listInstances", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroup" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "instanceGroup": { + // "description": "The name of the instance group from which you want to generate a list of included instances.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances", + // "request": { + // "$ref": "InstanceGroupsListInstancesRequest" + // }, + // "response": { + // "$ref": "InstanceGroupsListInstances" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroups.removeInstances": + +type InstanceGroupsRemoveInstancesCall struct { + s *Service + project string + zone string + instanceGroup string + instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// RemoveInstances: Removes one or more instances from the specified +// instance group, but does not delete those instances. +func (r *InstanceGroupsService) RemoveInstances(project string, zone string, instanceGroup string, instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest) *InstanceGroupsRemoveInstancesCall { + c := &InstanceGroupsRemoveInstancesCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroup = instanceGroup + c.instancegroupsremoveinstancesrequest = instancegroupsremoveinstancesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupsRemoveInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsRemoveInstancesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupsRemoveInstancesCall) Context(ctx context.Context) *InstanceGroupsRemoveInstancesCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsRemoveInstancesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsremoveinstancesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroup": c.instanceGroup, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.removeInstances" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupsRemoveInstancesCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Removes one or more instances from the specified instance group, but does not delete those instances.", + // "httpMethod": "POST", + // "id": "compute.instanceGroups.removeInstances", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroup" + // ], + // "parameters": { + // "instanceGroup": { + // "description": "The name of the instance group where the specified instances will be removed.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances", + // "request": { + // "$ref": "InstanceGroupsRemoveInstancesRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroups.setNamedPorts": + +type InstanceGroupsSetNamedPortsCall struct { + s *Service + project string + zone string + instanceGroup string + instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetNamedPorts: Sets the named ports for the specified instance group. +func (r *InstanceGroupsService) SetNamedPorts(project string, zone string, instanceGroup string, instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest) *InstanceGroupsSetNamedPortsCall { + c := &InstanceGroupsSetNamedPortsCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroup = instanceGroup + c.instancegroupssetnamedportsrequest = instancegroupssetnamedportsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *InstanceGroupsSetNamedPortsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *InstanceGroupsSetNamedPortsCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupssetnamedportsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroup": c.instanceGroup, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.setNamedPorts" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupsSetNamedPortsCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the named ports for the specified instance group.", + // "httpMethod": "POST", + // "id": "compute.instanceGroups.setNamedPorts", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroup" + // ], + // "parameters": { + // "instanceGroup": { + // "description": "The name of the instance group where the named ports are updated.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts", + // "request": { + // "$ref": "InstanceGroupsSetNamedPortsRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceTemplates.delete": + +type InstanceTemplatesDeleteCall struct { + s *Service + project string + instanceTemplate string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified instance template. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/delete +func (r *InstanceTemplatesService) Delete(project string, instanceTemplate string) *InstanceTemplatesDeleteCall { + c := &InstanceTemplatesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instanceTemplate = instanceTemplate + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceTemplatesDeleteCall) Fields(s ...googleapi.Field) *InstanceTemplatesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceTemplatesDeleteCall) Context(ctx context.Context) *InstanceTemplatesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instanceTemplate": c.instanceTemplate, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceTemplates.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceTemplatesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified instance template.", + // "httpMethod": "DELETE", + // "id": "compute.instanceTemplates.delete", + // "parameterOrder": [ + // "project", + // "instanceTemplate" + // ], + // "parameters": { + // "instanceTemplate": { + // "description": "The name of the instance template to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/instanceTemplates/{instanceTemplate}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceTemplates.get": + +type InstanceTemplatesGetCall struct { + s *Service + project string + instanceTemplate string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified instance template resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/get +func (r *InstanceTemplatesService) Get(project string, instanceTemplate string) *InstanceTemplatesGetCall { + c := &InstanceTemplatesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instanceTemplate = instanceTemplate + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceTemplatesGetCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstanceTemplatesGetCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceTemplatesGetCall) Context(ctx context.Context) *InstanceTemplatesGetCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceTemplatesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instanceTemplate": c.instanceTemplate, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceTemplates.get" call. +// Exactly one of *InstanceTemplate or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *InstanceTemplate.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstanceTemplatesGetCall) Do() (*InstanceTemplate, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceTemplate{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified instance template resource.", + // "httpMethod": "GET", + // "id": "compute.instanceTemplates.get", + // "parameterOrder": [ + // "project", + // "instanceTemplate" + // ], + // "parameters": { + // "instanceTemplate": { + // "description": "The name of the instance template.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/instanceTemplates/{instanceTemplate}", + // "response": { + // "$ref": "InstanceTemplate" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceTemplates.insert": + +type InstanceTemplatesInsertCall struct { + s *Service + project string + instancetemplate *InstanceTemplate + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates an instance template in the specified project using +// the data that is included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/insert +func (r *InstanceTemplatesService) Insert(project string, instancetemplate *InstanceTemplate) *InstanceTemplatesInsertCall { + c := &InstanceTemplatesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instancetemplate = instancetemplate + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceTemplatesInsertCall) Fields(s ...googleapi.Field) *InstanceTemplatesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceTemplatesInsertCall) Context(ctx context.Context) *InstanceTemplatesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceTemplates.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceTemplatesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an instance template in the specified project using the data that is included in the request.", + // "httpMethod": "POST", + // "id": "compute.instanceTemplates.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/instanceTemplates", + // "request": { + // "$ref": "InstanceTemplate" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceTemplates.list": + +type InstanceTemplatesListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of instance templates that are contained +// within the specified project and zone. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/list +func (r *InstanceTemplatesService) List(project string) *InstanceTemplatesListCall { + c := &InstanceTemplatesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *InstanceTemplatesListCall) Filter(filter string) *InstanceTemplatesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *InstanceTemplatesListCall) MaxResults(maxResults int64) *InstanceTemplatesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *InstanceTemplatesListCall) OrderBy(orderBy string) *InstanceTemplatesListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *InstanceTemplatesListCall) PageToken(pageToken string) *InstanceTemplatesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceTemplatesListCall) Fields(s ...googleapi.Field) *InstanceTemplatesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstanceTemplatesListCall) IfNoneMatch(entityTag string) *InstanceTemplatesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceTemplatesListCall) Context(ctx context.Context) *InstanceTemplatesListCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceTemplatesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceTemplates.list" call. +// Exactly one of *InstanceTemplateList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *InstanceTemplateList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstanceTemplatesListCall) Do() (*InstanceTemplateList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceTemplateList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of instance templates that are contained within the specified project and zone.", + // "httpMethod": "GET", + // "id": "compute.instanceTemplates.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/instanceTemplates", + // "response": { + // "$ref": "InstanceTemplateList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "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{} + ctx_ context.Context +} + +// AddAccessConfig: Adds an access config to an instance's network +// interface. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/addAccessConfig +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesAddAccessConfigCall) Fields(s ...googleapi.Field) *InstancesAddAccessConfigCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesAddAccessConfigCall) Context(ctx context.Context) *InstancesAddAccessConfigCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesAddAccessConfigCall) doRequest(alt string) (*http.Response, 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", alt) + params.Set("networkInterface", fmt.Sprintf("%v", c.networkInterface)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/addAccessConfig") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.addAccessConfig" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesAddAccessConfigCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds an access config to an instance's network interface.", + // "httpMethod": "POST", + // "id": "compute.instances.addAccessConfig", + // "parameterOrder": [ + // "project", + // "zone", + // "instance", + // "networkInterface" + // ], + // "parameters": { + // "instance": { + // "description": "The instance name for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "networkInterface": { + // "description": "The name of the network interface to add to this instance.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.aggregatedList": + +type InstancesAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// AggregatedList: Retrieves aggregated list of instance resources. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *InstancesAggregatedListCall) MaxResults(maxResults int64) *InstancesAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *InstancesAggregatedListCall) OrderBy(orderBy string) *InstancesAggregatedListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *InstancesAggregatedListCall) PageToken(pageToken string) *InstancesAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesAggregatedListCall) Fields(s ...googleapi.Field) *InstancesAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstancesAggregatedListCall) IfNoneMatch(entityTag string) *InstancesAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesAggregatedListCall) Context(ctx context.Context) *InstancesAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.aggregatedList" call. +// Exactly one of *InstanceAggregatedList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *InstanceAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstancesAggregatedListCall) Do() (*InstanceAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves aggregated list of instance resources.", + // "httpMethod": "GET", + // "id": "compute.instances.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// AttachDisk: Attaches a Disk resource to an instance. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/attachDisk +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesAttachDiskCall) Fields(s ...googleapi.Field) *InstancesAttachDiskCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesAttachDiskCall) Context(ctx context.Context) *InstancesAttachDiskCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesAttachDiskCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/attachDisk") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.attachDisk" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesAttachDiskCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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 ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified Instance resource. For more +// information, see Shutting down an instance. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified Instance resource. For more information, see Shutting down an instance.", + // "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// DeleteAccessConfig: Deletes an access config from an instance's +// network interface. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/deleteAccessConfig +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesDeleteAccessConfigCall) Fields(s ...googleapi.Field) *InstancesDeleteAccessConfigCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesDeleteAccessConfigCall) Context(ctx context.Context) *InstancesDeleteAccessConfigCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesDeleteAccessConfigCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("accessConfig", fmt.Sprintf("%v", c.accessConfig)) + params.Set("networkInterface", fmt.Sprintf("%v", c.networkInterface)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.deleteAccessConfig" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesDeleteAccessConfigCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "The name of the access config to delete.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "instance": { + // "description": "The instance name for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "networkInterface": { + // "description": "The name of the network interface.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// DetachDisk: Detaches a disk from an instance. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/detachDisk +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesDetachDiskCall) Fields(s ...googleapi.Field) *InstancesDetachDiskCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesDetachDiskCall) Context(ctx context.Context) *InstancesDetachDiskCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesDetachDiskCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("deviceName", fmt.Sprintf("%v", c.deviceName)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/detachDisk") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.detachDisk" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesDetachDiskCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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 ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Returns the specified instance resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.get" call. +// Exactly one of *Instance or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Instance.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesGetCall) Do() (*Instance, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Instance{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// GetSerialPortOutput: Returns the specified instance's serial port +// output. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/getSerialPortOutput +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 +} + +// Port sets the optional parameter "port": Specifies which COM or +// serial port to retrieve data from. +func (c *InstancesGetSerialPortOutputCall) Port(port int64) *InstancesGetSerialPortOutputCall { + c.opt_["port"] = port + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesGetSerialPortOutputCall) Fields(s ...googleapi.Field) *InstancesGetSerialPortOutputCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstancesGetSerialPortOutputCall) IfNoneMatch(entityTag string) *InstancesGetSerialPortOutputCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesGetSerialPortOutputCall) Context(ctx context.Context) *InstancesGetSerialPortOutputCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesGetSerialPortOutputCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["port"]; ok { + params.Set("port", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/serialPort") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.getSerialPortOutput" call. +// Exactly one of *SerialPortOutput or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SerialPortOutput.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstancesGetSerialPortOutputCall) Do() (*SerialPortOutput, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SerialPortOutput{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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" + // }, + // "port": { + // "default": "1", + // "description": "Specifies which COM or serial port to retrieve data from.", + // "format": "int32", + // "location": "query", + // "maximum": "4", + // "minimum": "1", + // "type": "integer" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates an instance resource in the specified project using +// the data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.list": + +type InstancesListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of instance resources contained within the +// specified zone. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *InstancesListCall) OrderBy(orderBy string) *InstancesListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.list" call. +// Exactly one of *InstanceList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *InstanceList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesListCall) Do() (*InstanceList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of instance resources contained within the specified zone.", + // "httpMethod": "GET", + // "id": "compute.instances.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Reset: Performs a hard reset on the instance. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/reset +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesResetCall) Fields(s ...googleapi.Field) *InstancesResetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesResetCall) Context(ctx context.Context) *InstancesResetCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesResetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/reset") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.reset" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesResetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// SetDiskAutoDelete: Sets the auto-delete flag for a disk attached to +// an instance. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setDiskAutoDelete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesSetDiskAutoDeleteCall) Fields(s ...googleapi.Field) *InstancesSetDiskAutoDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesSetDiskAutoDeleteCall) Context(ctx context.Context) *InstancesSetDiskAutoDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesSetDiskAutoDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("autoDelete", fmt.Sprintf("%v", c.autoDelete)) + params.Set("deviceName", fmt.Sprintf("%v", c.deviceName)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.setDiskAutoDelete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesSetDiskAutoDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets 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": "The device name of the disk to modify.", + // "location": "query", + // "pattern": "\\w[\\w.-]{0,254}", + // "required": true, + // "type": "string" + // }, + // "instance": { + // "description": "The instance name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.setLabels": + +type InstancesSetLabelsCall struct { + s *Service + project string + zone string + instance string + instancessetlabelsrequest *InstancesSetLabelsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetLabels: Sets labels for the specified instance to the data +// included in the request. +func (r *InstancesService) SetLabels(project string, zone string, instance string, instancessetlabelsrequest *InstancesSetLabelsRequest) *InstancesSetLabelsCall { + c := &InstancesSetLabelsCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.instancessetlabelsrequest = instancessetlabelsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesSetLabelsCall) Fields(s ...googleapi.Field) *InstancesSetLabelsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesSetLabelsCall) Context(ctx context.Context) *InstancesSetLabelsCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesSetLabelsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetlabelsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setLabels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.setLabels" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesSetLabelsCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets labels for the specified instance to the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.instances.setLabels", + // "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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}/setLabels", + // "request": { + // "$ref": "InstancesSetLabelsRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.setMachineType": + +type InstancesSetMachineTypeCall struct { + s *Service + project string + zone string + instance string + instancessetmachinetyperequest *InstancesSetMachineTypeRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetMachineType: Sets machine type for the specified instances to the +// data included in the request. +func (r *InstancesService) SetMachineType(project string, zone string, instance string, instancessetmachinetyperequest *InstancesSetMachineTypeRequest) *InstancesSetMachineTypeCall { + c := &InstancesSetMachineTypeCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + c.instancessetmachinetyperequest = instancessetmachinetyperequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesSetMachineTypeCall) Fields(s ...googleapi.Field) *InstancesSetMachineTypeCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesSetMachineTypeCall) Context(ctx context.Context) *InstancesSetMachineTypeCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesSetMachineTypeCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachinetyperequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineType") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.setMachineType" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesSetMachineTypeCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets machine type for the specified instances to the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.instances.setMachineType", + // "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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}/setMachineType", + // "request": { + // "$ref": "InstancesSetMachineTypeRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "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{} + ctx_ context.Context +} + +// SetMetadata: Sets metadata for the specified instance to the data +// included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setMetadata +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesSetMetadataCall) Fields(s ...googleapi.Field) *InstancesSetMetadataCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesSetMetadataCall) Context(ctx context.Context) *InstancesSetMetadataCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesSetMetadataCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMetadata") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.setMetadata" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesSetMetadataCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// SetScheduling: Sets an instance's scheduling options. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setScheduling +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesSetSchedulingCall) Fields(s ...googleapi.Field) *InstancesSetSchedulingCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesSetSchedulingCall) Context(ctx context.Context) *InstancesSetSchedulingCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesSetSchedulingCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setScheduling") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.setScheduling" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesSetSchedulingCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets 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 ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// SetTags: Sets tags for the specified instance to the data included in +// the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setTags +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesSetTagsCall) Fields(s ...googleapi.Field) *InstancesSetTagsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesSetTagsCall) Context(ctx context.Context) *InstancesSetTagsCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesSetTagsCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setTags") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.setTags" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesSetTagsCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.start": + +type InstancesStartCall struct { + s *Service + project string + zone string + instance string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Start: This method starts an instance that was stopped using the +// using the instances().stop method. For more information, see Restart +// an instance. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/start +func (r *InstancesService) Start(project string, zone string, instance string) *InstancesStartCall { + c := &InstancesStartCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesStartCall) Fields(s ...googleapi.Field) *InstancesStartCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesStartCall) Context(ctx context.Context) *InstancesStartCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesStartCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/start") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.start" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesStartCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "This method starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.", + // "httpMethod": "POST", + // "id": "compute.instances.start", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance resource to start.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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}/start", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.stop": + +type InstancesStopCall struct { + s *Service + project string + zone string + instance string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Stop: This method stops a running instance, shutting it down cleanly, +// and allows you to restart the instance at a later time. Stopped +// instances do not incur per-minute, virtual machine usage charges +// while they are stopped, but any resources that the virtual machine is +// using, such as persistent disks and static IP addresses,will continue +// to be charged until they are deleted. For more information, see +// Stopping an instance. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/stop +func (r *InstancesService) Stop(project string, zone string, instance string) *InstancesStopCall { + c := &InstancesStopCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesStopCall) Fields(s ...googleapi.Field) *InstancesStopCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesStopCall) Context(ctx context.Context) *InstancesStopCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesStopCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/stop") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.stop" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesStopCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "This method stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine is using, such as persistent disks and static IP addresses,will continue to be charged until they are deleted. For more information, see Stopping an instance.", + // "httpMethod": "POST", + // "id": "compute.instances.stop", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance resource to stop.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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}/stop", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.licenses.get": + +type LicensesGetCall struct { + s *Service + project string + license string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified license resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/licenses/get +func (r *LicensesService) Get(project string, license string) *LicensesGetCall { + c := &LicensesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.license = license + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LicensesGetCall) Fields(s ...googleapi.Field) *LicensesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LicensesGetCall) IfNoneMatch(entityTag string) *LicensesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LicensesGetCall) Context(ctx context.Context) *LicensesGetCall { + c.ctx_ = ctx + return c +} + +func (c *LicensesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "license": c.license, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.licenses.get" call. +// Exactly one of *License or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *License.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *LicensesGetCall) Do() (*License, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &License{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified license resource.", + // "httpMethod": "GET", + // "id": "compute.licenses.get", + // "parameterOrder": [ + // "project", + // "license" + // ], + // "parameters": { + // "license": { + // "description": "Name of the license resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/licenses/{license}", + // "response": { + // "$ref": "License" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "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{} + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of machine type resources grouped +// by scope. +// For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/aggregatedList +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *MachineTypesAggregatedListCall) MaxResults(maxResults int64) *MachineTypesAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *MachineTypesAggregatedListCall) OrderBy(orderBy string) *MachineTypesAggregatedListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *MachineTypesAggregatedListCall) PageToken(pageToken string) *MachineTypesAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MachineTypesAggregatedListCall) Fields(s ...googleapi.Field) *MachineTypesAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MachineTypesAggregatedListCall) IfNoneMatch(entityTag string) *MachineTypesAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MachineTypesAggregatedListCall) Context(ctx context.Context) *MachineTypesAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *MachineTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/machineTypes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.machineTypes.aggregatedList" call. +// Exactly one of *MachineTypeAggregatedList or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *MachineTypeAggregatedList.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MachineTypesAggregatedListCall) Do() (*MachineTypeAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &MachineTypeAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of machine type resources grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.machineTypes.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Returns the specified machine type resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MachineTypesGetCall) Fields(s ...googleapi.Field) *MachineTypesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MachineTypesGetCall) IfNoneMatch(entityTag string) *MachineTypesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MachineTypesGetCall) Context(ctx context.Context) *MachineTypesGetCall { + c.ctx_ = ctx + return c +} + +func (c *MachineTypesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes/{machineType}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "machineType": c.machineType, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.machineTypes.get" call. +// Exactly one of *MachineType or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *MachineType.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MachineTypesGetCall) Do() (*MachineType, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &MachineType{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// List: Retrieves the list of machine type resources available to the +// specified project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *MachineTypesListCall) MaxResults(maxResults int64) *MachineTypesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *MachineTypesListCall) OrderBy(orderBy string) *MachineTypesListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *MachineTypesListCall) PageToken(pageToken string) *MachineTypesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MachineTypesListCall) Fields(s ...googleapi.Field) *MachineTypesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MachineTypesListCall) IfNoneMatch(entityTag string) *MachineTypesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MachineTypesListCall) Context(ctx context.Context) *MachineTypesListCall { + c.ctx_ = ctx + return c +} + +func (c *MachineTypesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.machineTypes.list" call. +// Exactly one of *MachineTypeList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *MachineTypeList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MachineTypesListCall) Do() (*MachineTypeList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &MachineTypeList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of machine type resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.machineTypes.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified network resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/networks/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *NetworksDeleteCall) Fields(s ...googleapi.Field) *NetworksDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *NetworksDeleteCall) Context(ctx context.Context) *NetworksDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *NetworksDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "network": c.network, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.networks.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *NetworksDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.networks.get": + +type NetworksGetCall struct { + s *Service + project string + network string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified network resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/networks/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *NetworksGetCall) Fields(s ...googleapi.Field) *NetworksGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *NetworksGetCall) IfNoneMatch(entityTag string) *NetworksGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *NetworksGetCall) Context(ctx context.Context) *NetworksGetCall { + c.ctx_ = ctx + return c +} + +func (c *NetworksGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "network": c.network, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.networks.get" call. +// Exactly one of *Network or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Network.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *NetworksGetCall) Do() (*Network, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Network{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates a network resource in the specified project using the +// data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/networks/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *NetworksInsertCall) Fields(s ...googleapi.Field) *NetworksInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *NetworksInsertCall) Context(ctx context.Context) *NetworksInsertCall { + c.ctx_ = ctx + return c +} + +func (c *NetworksInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.networks.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *NetworksInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.networks.list": + +type NetworksListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of network resources available to the +// specified project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/networks/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *NetworksListCall) MaxResults(maxResults int64) *NetworksListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *NetworksListCall) OrderBy(orderBy string) *NetworksListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *NetworksListCall) PageToken(pageToken string) *NetworksListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *NetworksListCall) Fields(s ...googleapi.Field) *NetworksListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *NetworksListCall) IfNoneMatch(entityTag string) *NetworksListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *NetworksListCall) Context(ctx context.Context) *NetworksListCall { + c.ctx_ = ctx + return c +} + +func (c *NetworksListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.networks.list" call. +// Exactly one of *NetworkList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *NetworkList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *NetworksListCall) Do() (*NetworkList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &NetworkList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of network resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.networks.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Returns the specified project resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/projects/get +func (r *ProjectsService) Get(project string) *ProjectsGetCall { + c := &ProjectsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.projects.get" call. +// Exactly one of *Project or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Project.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsGetCall) Do() (*Project, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Project{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified project resource.", + // "httpMethod": "GET", + // "id": "compute.projects.get", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// SetCommonInstanceMetadata: Sets metadata common to all instances +// within the specified project using the data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setCommonInstanceMetadata +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSetCommonInstanceMetadataCall) Fields(s ...googleapi.Field) *ProjectsSetCommonInstanceMetadataCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSetCommonInstanceMetadataCall) Context(ctx context.Context) *ProjectsSetCommonInstanceMetadataCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSetCommonInstanceMetadataCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setCommonInstanceMetadata") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.projects.setCommonInstanceMetadata" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsSetCommonInstanceMetadataCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.projects.setUsageExportBucket": + +type ProjectsSetUsageExportBucketCall struct { + s *Service + project string + usageexportlocation *UsageExportLocation + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetUsageExportBucket: Enables the usage export feature and sets the +// usage export bucket where reports are stored. If you provide an empty +// request body using this method, the usage export feature will be +// disabled. +// For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setUsageExportBucket +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSetUsageExportBucketCall) Fields(s ...googleapi.Field) *ProjectsSetUsageExportBucketCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSetUsageExportBucketCall) Context(ctx context.Context) *ProjectsSetUsageExportBucketCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSetUsageExportBucketCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setUsageExportBucket") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.projects.setUsageExportBucket" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsSetUsageExportBucketCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled.", + // "httpMethod": "POST", + // "id": "compute.projects.setUsageExportBucket", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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.projects.setUsageExportCloudStorageBucket": + +type ProjectsSetUsageExportCloudStorageBucketCall struct { + s *Service + project string + usageexportlocation *UsageExportLocation + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetUsageExportCloudStorageBucket: [Deprecated] Use +// setUsageExportBucket instead. +func (r *ProjectsService) SetUsageExportCloudStorageBucket(project string, usageexportlocation *UsageExportLocation) *ProjectsSetUsageExportCloudStorageBucketCall { + c := &ProjectsSetUsageExportCloudStorageBucketCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.usageexportlocation = usageexportlocation + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSetUsageExportCloudStorageBucketCall) Fields(s ...googleapi.Field) *ProjectsSetUsageExportCloudStorageBucketCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSetUsageExportCloudStorageBucketCall) Context(ctx context.Context) *ProjectsSetUsageExportCloudStorageBucketCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSetUsageExportCloudStorageBucketCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setUsageExportCloudStorageBucket") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.projects.setUsageExportCloudStorageBucket" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsSetUsageExportCloudStorageBucketCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "[Deprecated] Use setUsageExportBucket instead.", + // "httpMethod": "POST", + // "id": "compute.projects.setUsageExportCloudStorageBucket", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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}/setUsageExportCloudStorageBucket", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified region-specific Operations resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionOperationsDeleteCall) Fields(s ...googleapi.Field) *RegionOperationsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RegionOperationsDeleteCall) Context(ctx context.Context) *RegionOperationsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *RegionOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.regionOperations.delete" call. +func (c *RegionOperationsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified region-specific Operations resource.", + // "httpMethod": "DELETE", + // "id": "compute.regionOperations.delete", + // "parameterOrder": [ + // "project", + // "region", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the Operations resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Retrieves the specified region-specific Operations resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionOperationsGetCall) Fields(s ...googleapi.Field) *RegionOperationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RegionOperationsGetCall) IfNoneMatch(entityTag string) *RegionOperationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RegionOperationsGetCall) Context(ctx context.Context) *RegionOperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *RegionOperationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.regionOperations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RegionOperationsGetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified region-specific Operations resource.", + // "httpMethod": "GET", + // "id": "compute.regionOperations.get", + // "parameterOrder": [ + // "project", + // "region", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the Operations resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// List: Retrieves the list of Operation resources contained within the +// specified region. +// For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *RegionOperationsListCall) MaxResults(maxResults int64) *RegionOperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *RegionOperationsListCall) OrderBy(orderBy string) *RegionOperationsListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *RegionOperationsListCall) PageToken(pageToken string) *RegionOperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionOperationsListCall) Fields(s ...googleapi.Field) *RegionOperationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RegionOperationsListCall) IfNoneMatch(entityTag string) *RegionOperationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RegionOperationsListCall) Context(ctx context.Context) *RegionOperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *RegionOperationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.regionOperations.list" call. +// Exactly one of *OperationList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *OperationList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RegionOperationsListCall) Do() (*OperationList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperationList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of Operation resources contained within the specified region.", + // "httpMethod": "GET", + // "id": "compute.regionOperations.list", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Returns the specified region resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/regions/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionsGetCall) Fields(s ...googleapi.Field) *RegionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RegionsGetCall) IfNoneMatch(entityTag string) *RegionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RegionsGetCall) Context(ctx context.Context) *RegionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *RegionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.regions.get" call. +// Exactly one of *Region or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Region.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *RegionsGetCall) Do() (*Region, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Region{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified region resource.", + // "httpMethod": "GET", + // "id": "compute.regions.get", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// List: Retrieves the list of region resources available to the +// specified project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/regions/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *RegionsListCall) MaxResults(maxResults int64) *RegionsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *RegionsListCall) OrderBy(orderBy string) *RegionsListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *RegionsListCall) PageToken(pageToken string) *RegionsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall { + c.ctx_ = ctx + return c +} + +func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.regions.list" call. +// Exactly one of *RegionList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *RegionList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RegionsListCall) Do() (*RegionList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RegionList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of region resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.regions.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified route resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/routes/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RoutesDeleteCall) Fields(s ...googleapi.Field) *RoutesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RoutesDeleteCall) Context(ctx context.Context) *RoutesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *RoutesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "route": c.route, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.routes.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RoutesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.routes.get": + +type RoutesGetCall struct { + s *Service + project string + route string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified route resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/routes/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RoutesGetCall) Fields(s ...googleapi.Field) *RoutesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RoutesGetCall) IfNoneMatch(entityTag string) *RoutesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RoutesGetCall) Context(ctx context.Context) *RoutesGetCall { + c.ctx_ = ctx + return c +} + +func (c *RoutesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "route": c.route, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.routes.get" call. +// Exactly one of *Route or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Route.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *RoutesGetCall) Do() (*Route, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Route{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates a route resource in the specified project using the +// data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/routes/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RoutesInsertCall) Fields(s ...googleapi.Field) *RoutesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RoutesInsertCall) Context(ctx context.Context) *RoutesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *RoutesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.routes.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RoutesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.routes.list": + +type RoutesListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of route resources available to the +// specified project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/routes/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *RoutesListCall) MaxResults(maxResults int64) *RoutesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *RoutesListCall) OrderBy(orderBy string) *RoutesListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *RoutesListCall) PageToken(pageToken string) *RoutesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RoutesListCall) Fields(s ...googleapi.Field) *RoutesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RoutesListCall) IfNoneMatch(entityTag string) *RoutesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RoutesListCall) Context(ctx context.Context) *RoutesListCall { + c.ctx_ = ctx + return c +} + +func (c *RoutesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.routes.list" call. +// Exactly one of *RouteList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *RouteList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RoutesListCall) Do() (*RouteList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RouteList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of route resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.routes.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified Snapshot resource. Keep in mind that +// deleting a single snapshot might not necessarily delete all the data +// on that snapshot. If any data on the snapshot that is marked for +// deletion is needed for subsequent snapshots, the data will be moved +// to the next corresponding snapshot. +// +// For more information, see Deleting snaphots. +// For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SnapshotsDeleteCall) Fields(s ...googleapi.Field) *SnapshotsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SnapshotsDeleteCall) Context(ctx context.Context) *SnapshotsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *SnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "snapshot": c.snapshot, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.snapshots.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SnapshotsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot.\n\nFor more information, see Deleting snaphots.", + // "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 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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.snapshots.get": + +type SnapshotsGetCall struct { + s *Service + project string + snapshot string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified Snapshot resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SnapshotsGetCall) Fields(s ...googleapi.Field) *SnapshotsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SnapshotsGetCall) IfNoneMatch(entityTag string) *SnapshotsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SnapshotsGetCall) Context(ctx context.Context) *SnapshotsGetCall { + c.ctx_ = ctx + return c +} + +func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "snapshot": c.snapshot, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.snapshots.get" call. +// Exactly one of *Snapshot or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Snapshot.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SnapshotsGetCall) Do() (*Snapshot, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Snapshot{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified 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 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// List: Retrieves the list of Snapshot resources contained within the +// specified project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *SnapshotsListCall) OrderBy(orderBy string) *SnapshotsListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SnapshotsListCall) Fields(s ...googleapi.Field) *SnapshotsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SnapshotsListCall) IfNoneMatch(entityTag string) *SnapshotsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SnapshotsListCall) Context(ctx context.Context) *SnapshotsListCall { + c.ctx_ = ctx + return c +} + +func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.snapshots.list" call. +// Exactly one of *SnapshotList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SnapshotList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SnapshotsListCall) Do() (*SnapshotList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SnapshotList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of Snapshot resources contained within the specified project.", + // "httpMethod": "GET", + // "id": "compute.snapshots.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.sslCertificates.delete": + +type SslCertificatesDeleteCall struct { + s *Service + project string + sslCertificate string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified SslCertificate resource. +func (r *SslCertificatesService) Delete(project string, sslCertificate string) *SslCertificatesDeleteCall { + c := &SslCertificatesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.sslCertificate = sslCertificate + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SslCertificatesDeleteCall) Fields(s ...googleapi.Field) *SslCertificatesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SslCertificatesDeleteCall) Context(ctx context.Context) *SslCertificatesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *SslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "sslCertificate": c.sslCertificate, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.sslCertificates.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SslCertificatesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified SslCertificate resource.", + // "httpMethod": "DELETE", + // "id": "compute.sslCertificates.delete", + // "parameterOrder": [ + // "project", + // "sslCertificate" + // ], + // "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" + // }, + // "sslCertificate": { + // "description": "Name of the SslCertificate resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/sslCertificates/{sslCertificate}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.sslCertificates.get": + +type SslCertificatesGetCall struct { + s *Service + project string + sslCertificate string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified SslCertificate resource. +func (r *SslCertificatesService) Get(project string, sslCertificate string) *SslCertificatesGetCall { + c := &SslCertificatesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.sslCertificate = sslCertificate + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SslCertificatesGetCall) Fields(s ...googleapi.Field) *SslCertificatesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SslCertificatesGetCall) IfNoneMatch(entityTag string) *SslCertificatesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SslCertificatesGetCall) Context(ctx context.Context) *SslCertificatesGetCall { + c.ctx_ = ctx + return c +} + +func (c *SslCertificatesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "sslCertificate": c.sslCertificate, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.sslCertificates.get" call. +// Exactly one of *SslCertificate or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SslCertificate.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SslCertificatesGetCall) Do() (*SslCertificate, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SslCertificate{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified SslCertificate resource.", + // "httpMethod": "GET", + // "id": "compute.sslCertificates.get", + // "parameterOrder": [ + // "project", + // "sslCertificate" + // ], + // "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" + // }, + // "sslCertificate": { + // "description": "Name of the SslCertificate resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/sslCertificates/{sslCertificate}", + // "response": { + // "$ref": "SslCertificate" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.sslCertificates.insert": + +type SslCertificatesInsertCall struct { + s *Service + project string + sslcertificate *SslCertificate + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a SslCertificate resource in the specified project +// using the data included in the request. +func (r *SslCertificatesService) Insert(project string, sslcertificate *SslCertificate) *SslCertificatesInsertCall { + c := &SslCertificatesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.sslcertificate = sslcertificate + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SslCertificatesInsertCall) Fields(s ...googleapi.Field) *SslCertificatesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SslCertificatesInsertCall) Context(ctx context.Context) *SslCertificatesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *SslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.sslCertificates.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SslCertificatesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a SslCertificate resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.sslCertificates.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/sslCertificates", + // "request": { + // "$ref": "SslCertificate" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.sslCertificates.list": + +type SslCertificatesListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of SslCertificate resources available to the +// specified project. +func (r *SslCertificatesService) List(project string) *SslCertificatesListCall { + c := &SslCertificatesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *SslCertificatesListCall) Filter(filter string) *SslCertificatesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *SslCertificatesListCall) MaxResults(maxResults int64) *SslCertificatesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *SslCertificatesListCall) OrderBy(orderBy string) *SslCertificatesListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *SslCertificatesListCall) PageToken(pageToken string) *SslCertificatesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SslCertificatesListCall) Fields(s ...googleapi.Field) *SslCertificatesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SslCertificatesListCall) IfNoneMatch(entityTag string) *SslCertificatesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SslCertificatesListCall) Context(ctx context.Context) *SslCertificatesListCall { + c.ctx_ = ctx + return c +} + +func (c *SslCertificatesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.sslCertificates.list" call. +// Exactly one of *SslCertificateList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SslCertificateList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SslCertificatesListCall) Do() (*SslCertificateList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SslCertificateList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of SslCertificate resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.sslCertificates.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/sslCertificates", + // "response": { + // "$ref": "SslCertificateList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified TargetHttpProxy resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpProxiesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetHttpProxiesDeleteCall) Context(ctx context.Context) *TargetHttpProxiesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "targetHttpProxy": c.targetHttpProxy, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpProxies.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetHttpProxiesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetHttpProxies.get": + +type TargetHttpProxiesGetCall struct { + s *Service + project string + targetHttpProxy string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified TargetHttpProxy resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpProxiesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetHttpProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpProxiesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetHttpProxiesGetCall) Context(ctx context.Context) *TargetHttpProxiesGetCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "targetHttpProxy": c.targetHttpProxy, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpProxies.get" call. +// Exactly one of *TargetHttpProxy or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TargetHttpProxy.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetHttpProxiesGetCall) Do() (*TargetHttpProxy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetHttpProxy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates a TargetHttpProxy resource in the specified project +// using the data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpProxiesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetHttpProxiesInsertCall) Context(ctx context.Context) *TargetHttpProxiesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpProxies.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetHttpProxiesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetHttpProxies.list": + +type TargetHttpProxiesListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of TargetHttpProxy resources available to +// the specified project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *TargetHttpProxiesListCall) MaxResults(maxResults int64) *TargetHttpProxiesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *TargetHttpProxiesListCall) OrderBy(orderBy string) *TargetHttpProxiesListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *TargetHttpProxiesListCall) PageToken(pageToken string) *TargetHttpProxiesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpProxiesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetHttpProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpProxiesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetHttpProxiesListCall) Context(ctx context.Context) *TargetHttpProxiesListCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpProxiesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpProxies.list" call. +// Exactly one of *TargetHttpProxyList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TargetHttpProxyList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetHttpProxiesListCall) Do() (*TargetHttpProxyList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetHttpProxyList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of TargetHttpProxy resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.targetHttpProxies.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// SetUrlMap: Changes the URL map for TargetHttpProxy. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/setUrlMap +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpProxiesSetUrlMapCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetHttpProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpProxiesSetUrlMapCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "targetHttpProxy": c.targetHttpProxy, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpProxies.setUrlMap" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetHttpProxiesSetUrlMapCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetHttpsProxies.delete": + +type TargetHttpsProxiesDeleteCall struct { + s *Service + project string + targetHttpsProxy string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified TargetHttpsProxy resource. +func (r *TargetHttpsProxiesService) Delete(project string, targetHttpsProxy string) *TargetHttpsProxiesDeleteCall { + c := &TargetHttpsProxiesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.targetHttpsProxy = targetHttpsProxy + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpsProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetHttpsProxiesDeleteCall) Context(ctx context.Context) *TargetHttpsProxiesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "targetHttpsProxy": c.targetHttpsProxy, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpsProxies.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetHttpsProxiesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified TargetHttpsProxy resource.", + // "httpMethod": "DELETE", + // "id": "compute.targetHttpsProxies.delete", + // "parameterOrder": [ + // "project", + // "targetHttpsProxy" + // ], + // "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" + // }, + // "targetHttpsProxy": { + // "description": "Name of the TargetHttpsProxy resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetHttpsProxies.get": + +type TargetHttpsProxiesGetCall struct { + s *Service + project string + targetHttpsProxy string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified TargetHttpsProxy resource. +func (r *TargetHttpsProxiesService) Get(project string, targetHttpsProxy string) *TargetHttpsProxiesGetCall { + c := &TargetHttpsProxiesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.targetHttpsProxy = targetHttpsProxy + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpsProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetHttpsProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetHttpsProxiesGetCall) Context(ctx context.Context) *TargetHttpsProxiesGetCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "targetHttpsProxy": c.targetHttpsProxy, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpsProxies.get" call. +// Exactly one of *TargetHttpsProxy or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TargetHttpsProxy.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetHttpsProxiesGetCall) Do() (*TargetHttpsProxy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetHttpsProxy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified TargetHttpsProxy resource.", + // "httpMethod": "GET", + // "id": "compute.targetHttpsProxies.get", + // "parameterOrder": [ + // "project", + // "targetHttpsProxy" + // ], + // "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" + // }, + // "targetHttpsProxy": { + // "description": "Name of the TargetHttpsProxy resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}", + // "response": { + // "$ref": "TargetHttpsProxy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetHttpsProxies.insert": + +type TargetHttpsProxiesInsertCall struct { + s *Service + project string + targethttpsproxy *TargetHttpsProxy + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a TargetHttpsProxy resource in the specified project +// using the data included in the request. +func (r *TargetHttpsProxiesService) Insert(project string, targethttpsproxy *TargetHttpsProxy) *TargetHttpsProxiesInsertCall { + c := &TargetHttpsProxiesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.targethttpsproxy = targethttpsproxy + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpsProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetHttpsProxiesInsertCall) Context(ctx context.Context) *TargetHttpsProxiesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpsProxies.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetHttpsProxiesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a TargetHttpsProxy resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.targetHttpsProxies.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/targetHttpsProxies", + // "request": { + // "$ref": "TargetHttpsProxy" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetHttpsProxies.list": + +type TargetHttpsProxiesListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of TargetHttpsProxy resources available to +// the specified project. +func (r *TargetHttpsProxiesService) List(project string) *TargetHttpsProxiesListCall { + c := &TargetHttpsProxiesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *TargetHttpsProxiesListCall) Filter(filter string) *TargetHttpsProxiesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *TargetHttpsProxiesListCall) MaxResults(maxResults int64) *TargetHttpsProxiesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *TargetHttpsProxiesListCall) OrderBy(orderBy string) *TargetHttpsProxiesListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *TargetHttpsProxiesListCall) PageToken(pageToken string) *TargetHttpsProxiesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpsProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetHttpsProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetHttpsProxiesListCall) Context(ctx context.Context) *TargetHttpsProxiesListCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpsProxiesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpsProxies.list" call. +// Exactly one of *TargetHttpsProxyList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TargetHttpsProxyList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetHttpsProxiesListCall) Do() (*TargetHttpsProxyList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetHttpsProxyList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of TargetHttpsProxy resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.targetHttpsProxies.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/targetHttpsProxies", + // "response": { + // "$ref": "TargetHttpsProxyList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetHttpsProxies.setSslCertificates": + +type TargetHttpsProxiesSetSslCertificatesCall struct { + s *Service + project string + targetHttpsProxy string + targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetSslCertificates: Replaces SslCertificates for TargetHttpsProxy. +func (r *TargetHttpsProxiesService) SetSslCertificates(project string, targetHttpsProxy string, targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest) *TargetHttpsProxiesSetSslCertificatesCall { + c := &TargetHttpsProxiesSetSslCertificatesCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.targetHttpsProxy = targetHttpsProxy + c.targethttpsproxiessetsslcertificatesrequest = targethttpsproxiessetsslcertificatesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpsProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslCertificatesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetHttpsProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslCertificatesCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetsslcertificatesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "targetHttpsProxy": c.targetHttpsProxy, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpsProxies.setSslCertificates" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetHttpsProxiesSetSslCertificatesCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Replaces SslCertificates for TargetHttpsProxy.", + // "httpMethod": "POST", + // "id": "compute.targetHttpsProxies.setSslCertificates", + // "parameterOrder": [ + // "project", + // "targetHttpsProxy" + // ], + // "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" + // }, + // "targetHttpsProxy": { + // "description": "Name of the TargetHttpsProxy 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}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates", + // "request": { + // "$ref": "TargetHttpsProxiesSetSslCertificatesRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetHttpsProxies.setUrlMap": + +type TargetHttpsProxiesSetUrlMapCall struct { + s *Service + project string + targetHttpsProxy string + urlmapreference *UrlMapReference + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetUrlMap: Changes the URL map for TargetHttpsProxy. +func (r *TargetHttpsProxiesService) SetUrlMap(project string, targetHttpsProxy string, urlmapreference *UrlMapReference) *TargetHttpsProxiesSetUrlMapCall { + c := &TargetHttpsProxiesSetUrlMapCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.targetHttpsProxy = targetHttpsProxy + c.urlmapreference = urlmapreference + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpsProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetUrlMapCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetHttpsProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpsProxiesSetUrlMapCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "targetHttpsProxy": c.targetHttpsProxy, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpsProxies.setUrlMap" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetHttpsProxiesSetUrlMapCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Changes the URL map for TargetHttpsProxy.", + // "httpMethod": "POST", + // "id": "compute.targetHttpsProxies.setUrlMap", + // "parameterOrder": [ + // "project", + // "targetHttpsProxy" + // ], + // "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" + // }, + // "targetHttpsProxy": { + // "description": "Name of the TargetHttpsProxy 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}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap", + // "request": { + // "$ref": "UrlMapReference" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetInstances.aggregatedList": + +type TargetInstancesAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of target instances grouped by +// scope. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/aggregatedList +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *TargetInstancesAggregatedListCall) MaxResults(maxResults int64) *TargetInstancesAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *TargetInstancesAggregatedListCall) OrderBy(orderBy string) *TargetInstancesAggregatedListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *TargetInstancesAggregatedListCall) PageToken(pageToken string) *TargetInstancesAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetInstancesAggregatedListCall) Fields(s ...googleapi.Field) *TargetInstancesAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetInstancesAggregatedListCall) IfNoneMatch(entityTag string) *TargetInstancesAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetInstancesAggregatedListCall) Context(ctx context.Context) *TargetInstancesAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *TargetInstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetInstances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetInstances.aggregatedList" call. +// Exactly one of *TargetInstanceAggregatedList or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *TargetInstanceAggregatedList.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetInstancesAggregatedListCall) Do() (*TargetInstanceAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetInstanceAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of target instances grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.targetInstances.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified TargetInstance resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetInstancesDeleteCall) Fields(s ...googleapi.Field) *TargetInstancesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetInstancesDeleteCall) Context(ctx context.Context) *TargetInstancesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TargetInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "targetInstance": c.targetInstance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetInstances.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetInstancesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Returns the specified TargetInstance resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetInstancesGetCall) Fields(s ...googleapi.Field) *TargetInstancesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetInstancesGetCall) IfNoneMatch(entityTag string) *TargetInstancesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetInstancesGetCall) Context(ctx context.Context) *TargetInstancesGetCall { + c.ctx_ = ctx + return c +} + +func (c *TargetInstancesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "targetInstance": c.targetInstance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetInstances.get" call. +// Exactly one of *TargetInstance or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TargetInstance.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetInstancesGetCall) Do() (*TargetInstance, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetInstance{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates a TargetInstance resource in the specified project +// and zone using the data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetInstancesInsertCall) Fields(s ...googleapi.Field) *TargetInstancesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetInstancesInsertCall) Context(ctx context.Context) *TargetInstancesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TargetInstancesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetInstances.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetInstancesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetInstances.list": + +type TargetInstancesListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of TargetInstance resources available to the +// specified project and zone. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *TargetInstancesListCall) MaxResults(maxResults int64) *TargetInstancesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *TargetInstancesListCall) OrderBy(orderBy string) *TargetInstancesListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *TargetInstancesListCall) PageToken(pageToken string) *TargetInstancesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetInstancesListCall) Fields(s ...googleapi.Field) *TargetInstancesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetInstancesListCall) IfNoneMatch(entityTag string) *TargetInstancesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetInstancesListCall) Context(ctx context.Context) *TargetInstancesListCall { + c.ctx_ = ctx + return c +} + +func (c *TargetInstancesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetInstances.list" call. +// Exactly one of *TargetInstanceList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TargetInstanceList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetInstancesListCall) Do() (*TargetInstanceList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetInstanceList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of TargetInstance resources available to the specified project and zone.", + // "httpMethod": "GET", + // "id": "compute.targetInstances.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// AddHealthCheck: Adds health check URL to targetPool. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addHealthCheck +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetPoolsAddHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsAddHealthCheckCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetPoolsAddHealthCheckCall) Context(ctx context.Context) *TargetPoolsAddHealthCheckCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsAddHealthCheckCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "targetPool": c.targetPool, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.addHealthCheck" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetPoolsAddHealthCheckCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// AddInstance: Adds instance url to targetPool. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addInstance +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetPoolsAddInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsAddInstanceCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetPoolsAddInstanceCall) Context(ctx context.Context) *TargetPoolsAddInstanceCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsAddInstanceCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addInstance") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "targetPool": c.targetPool, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.addInstance" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetPoolsAddInstanceCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetPools.aggregatedList": + +type TargetPoolsAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of target pools grouped by scope. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/aggregatedList +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *TargetPoolsAggregatedListCall) MaxResults(maxResults int64) *TargetPoolsAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *TargetPoolsAggregatedListCall) OrderBy(orderBy string) *TargetPoolsAggregatedListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *TargetPoolsAggregatedListCall) PageToken(pageToken string) *TargetPoolsAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetPoolsAggregatedListCall) Fields(s ...googleapi.Field) *TargetPoolsAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetPoolsAggregatedListCall) IfNoneMatch(entityTag string) *TargetPoolsAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetPoolsAggregatedListCall) Context(ctx context.Context) *TargetPoolsAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetPools") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.aggregatedList" call. +// Exactly one of *TargetPoolAggregatedList or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TargetPoolAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetPoolsAggregatedListCall) Do() (*TargetPoolAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetPoolAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of target pools grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.targetPools.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified TargetPool resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetPoolsDeleteCall) Fields(s ...googleapi.Field) *TargetPoolsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetPoolsDeleteCall) Context(ctx context.Context) *TargetPoolsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "targetPool": c.targetPool, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetPoolsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Returns the specified TargetPool resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetPoolsGetCall) Fields(s ...googleapi.Field) *TargetPoolsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetPoolsGetCall) IfNoneMatch(entityTag string) *TargetPoolsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetPoolsGetCall) Context(ctx context.Context) *TargetPoolsGetCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "targetPool": c.targetPool, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.get" call. +// Exactly one of *TargetPool or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TargetPool.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetPoolsGetCall) Do() (*TargetPool, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetPool{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// GetHealth: Gets the most recent health check results for each IP for +// the given instance that is referenced by given TargetPool. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/getHealth +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetPoolsGetHealthCall) Fields(s ...googleapi.Field) *TargetPoolsGetHealthCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetPoolsGetHealthCall) Context(ctx context.Context) *TargetPoolsGetHealthCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsGetHealthCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/getHealth") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "targetPool": c.targetPool, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.getHealth" call. +// Exactly one of *TargetPoolInstanceHealth or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TargetPoolInstanceHealth.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetPoolsGetHealthCall) Do() (*TargetPoolInstanceHealth, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetPoolInstanceHealth{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates a TargetPool resource in the specified project and +// region using the data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetPoolsInsertCall) Fields(s ...googleapi.Field) *TargetPoolsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetPoolsInsertCall) Context(ctx context.Context) *TargetPoolsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetPoolsInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetPools.list": + +type TargetPoolsListCall struct { + s *Service + project string + region string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of TargetPool resources available to the +// specified project and region. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *TargetPoolsListCall) MaxResults(maxResults int64) *TargetPoolsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *TargetPoolsListCall) OrderBy(orderBy string) *TargetPoolsListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *TargetPoolsListCall) PageToken(pageToken string) *TargetPoolsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetPoolsListCall) Fields(s ...googleapi.Field) *TargetPoolsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetPoolsListCall) IfNoneMatch(entityTag string) *TargetPoolsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetPoolsListCall) Context(ctx context.Context) *TargetPoolsListCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.list" call. +// Exactly one of *TargetPoolList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TargetPoolList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetPoolsListCall) Do() (*TargetPoolList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetPoolList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of TargetPool resources available to the specified project and region.", + // "httpMethod": "GET", + // "id": "compute.targetPools.list", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// RemoveHealthCheck: Removes health check URL from targetPool. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeHealthCheck +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetPoolsRemoveHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveHealthCheckCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetPoolsRemoveHealthCheckCall) Context(ctx context.Context) *TargetPoolsRemoveHealthCheckCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsRemoveHealthCheckCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "targetPool": c.targetPool, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.removeHealthCheck" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetPoolsRemoveHealthCheckCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// RemoveInstance: Removes instance URL from targetPool. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeInstance +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetPoolsRemoveInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveInstanceCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetPoolsRemoveInstanceCall) Context(ctx context.Context) *TargetPoolsRemoveInstanceCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsRemoveInstanceCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeInstance") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "targetPool": c.targetPool, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.removeInstance" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetPoolsRemoveInstanceCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// SetBackup: Changes backup pool configurations. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/setBackup +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetPoolsSetBackupCall) Fields(s ...googleapi.Field) *TargetPoolsSetBackupCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetPoolsSetBackupCall) Context(ctx context.Context) *TargetPoolsSetBackupCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsSetBackupCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["failoverRatio"]; ok { + params.Set("failoverRatio", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "targetPool": c.targetPool, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.setBackup" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetPoolsSetBackupCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetVpnGateways.aggregatedList": + +type TargetVpnGatewaysAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of target VPN gateways grouped by +// scope. +func (r *TargetVpnGatewaysService) AggregatedList(project string) *TargetVpnGatewaysAggregatedListCall { + c := &TargetVpnGatewaysAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *TargetVpnGatewaysAggregatedListCall) Filter(filter string) *TargetVpnGatewaysAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *TargetVpnGatewaysAggregatedListCall) MaxResults(maxResults int64) *TargetVpnGatewaysAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *TargetVpnGatewaysAggregatedListCall) OrderBy(orderBy string) *TargetVpnGatewaysAggregatedListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *TargetVpnGatewaysAggregatedListCall) PageToken(pageToken string) *TargetVpnGatewaysAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetVpnGatewaysAggregatedListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetVpnGatewaysAggregatedListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetVpnGatewaysAggregatedListCall) Context(ctx context.Context) *TargetVpnGatewaysAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *TargetVpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetVpnGateways") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetVpnGateways.aggregatedList" call. +// Exactly one of *TargetVpnGatewayAggregatedList or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *TargetVpnGatewayAggregatedList.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetVpnGatewaysAggregatedListCall) Do() (*TargetVpnGatewayAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetVpnGatewayAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of target VPN gateways grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.targetVpnGateways.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/targetVpnGateways", + // "response": { + // "$ref": "TargetVpnGatewayAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetVpnGateways.delete": + +type TargetVpnGatewaysDeleteCall struct { + s *Service + project string + region string + targetVpnGateway string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified TargetVpnGateway resource. +func (r *TargetVpnGatewaysService) Delete(project string, region string, targetVpnGateway string) *TargetVpnGatewaysDeleteCall { + c := &TargetVpnGatewaysDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetVpnGateway = targetVpnGateway + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetVpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetVpnGatewaysDeleteCall) Context(ctx context.Context) *TargetVpnGatewaysDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TargetVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "targetVpnGateway": c.targetVpnGateway, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetVpnGateways.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetVpnGatewaysDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified TargetVpnGateway resource.", + // "httpMethod": "DELETE", + // "id": "compute.targetVpnGateways.delete", + // "parameterOrder": [ + // "project", + // "region", + // "targetVpnGateway" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the region for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetVpnGateway": { + // "description": "Name of the TargetVpnGateway resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetVpnGateways.get": + +type TargetVpnGatewaysGetCall struct { + s *Service + project string + region string + targetVpnGateway string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified TargetVpnGateway resource. +func (r *TargetVpnGatewaysService) Get(project string, region string, targetVpnGateway string) *TargetVpnGatewaysGetCall { + c := &TargetVpnGatewaysGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetVpnGateway = targetVpnGateway + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetVpnGatewaysGetCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetVpnGatewaysGetCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetVpnGatewaysGetCall) Context(ctx context.Context) *TargetVpnGatewaysGetCall { + c.ctx_ = ctx + return c +} + +func (c *TargetVpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "targetVpnGateway": c.targetVpnGateway, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetVpnGateways.get" call. +// Exactly one of *TargetVpnGateway or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TargetVpnGateway.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetVpnGatewaysGetCall) Do() (*TargetVpnGateway, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetVpnGateway{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified TargetVpnGateway resource.", + // "httpMethod": "GET", + // "id": "compute.targetVpnGateways.get", + // "parameterOrder": [ + // "project", + // "region", + // "targetVpnGateway" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the region for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetVpnGateway": { + // "description": "Name of the TargetVpnGateway resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}", + // "response": { + // "$ref": "TargetVpnGateway" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetVpnGateways.insert": + +type TargetVpnGatewaysInsertCall struct { + s *Service + project string + region string + targetvpngateway *TargetVpnGateway + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a TargetVpnGateway resource in the specified project +// and region using the data included in the request. +func (r *TargetVpnGatewaysService) Insert(project string, region string, targetvpngateway *TargetVpnGateway) *TargetVpnGatewaysInsertCall { + c := &TargetVpnGatewaysInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetvpngateway = targetvpngateway + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetVpnGatewaysInsertCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetVpnGatewaysInsertCall) Context(ctx context.Context) *TargetVpnGatewaysInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TargetVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetvpngateway) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetVpnGateways.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetVpnGatewaysInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a TargetVpnGateway resource in the specified project and region using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.targetVpnGateways.insert", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the region for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetVpnGateways", + // "request": { + // "$ref": "TargetVpnGateway" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetVpnGateways.list": + +type TargetVpnGatewaysListCall struct { + s *Service + project string + region string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of TargetVpnGateway resources available to +// the specified project and region. +func (r *TargetVpnGatewaysService) List(project string, region string) *TargetVpnGatewaysListCall { + c := &TargetVpnGatewaysListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *TargetVpnGatewaysListCall) Filter(filter string) *TargetVpnGatewaysListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *TargetVpnGatewaysListCall) MaxResults(maxResults int64) *TargetVpnGatewaysListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *TargetVpnGatewaysListCall) OrderBy(orderBy string) *TargetVpnGatewaysListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *TargetVpnGatewaysListCall) PageToken(pageToken string) *TargetVpnGatewaysListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetVpnGatewaysListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetVpnGatewaysListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetVpnGatewaysListCall) Context(ctx context.Context) *TargetVpnGatewaysListCall { + c.ctx_ = ctx + return c +} + +func (c *TargetVpnGatewaysListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetVpnGateways.list" call. +// Exactly one of *TargetVpnGatewayList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TargetVpnGatewayList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetVpnGatewaysListCall) Do() (*TargetVpnGatewayList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetVpnGatewayList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of TargetVpnGateway resources available to the specified project and region.", + // "httpMethod": "GET", + // "id": "compute.targetVpnGateways.list", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the region for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetVpnGateways", + // "response": { + // "$ref": "TargetVpnGatewayList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.urlMaps.delete": + +type UrlMapsDeleteCall struct { + s *Service + project string + urlMap string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified UrlMap resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlMapsDeleteCall) Fields(s ...googleapi.Field) *UrlMapsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlMapsDeleteCall) Context(ctx context.Context) *UrlMapsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *UrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "urlMap": c.urlMap, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.urlMaps.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UrlMapsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.urlMaps.get": + +type UrlMapsGetCall struct { + s *Service + project string + urlMap string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified UrlMap resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlMapsGetCall) Fields(s ...googleapi.Field) *UrlMapsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UrlMapsGetCall) IfNoneMatch(entityTag string) *UrlMapsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlMapsGetCall) Context(ctx context.Context) *UrlMapsGetCall { + c.ctx_ = ctx + return c +} + +func (c *UrlMapsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "urlMap": c.urlMap, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.urlMaps.get" call. +// Exactly one of *UrlMap or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *UrlMap.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UrlMapsGetCall) Do() (*UrlMap, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UrlMap{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates a UrlMap resource in the specified project using the +// data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlMapsInsertCall) Fields(s ...googleapi.Field) *UrlMapsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlMapsInsertCall) Context(ctx context.Context) *UrlMapsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *UrlMapsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.urlMaps.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UrlMapsInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.urlMaps.list": + +type UrlMapsListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of UrlMap resources available to the +// specified project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *UrlMapsListCall) MaxResults(maxResults int64) *UrlMapsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *UrlMapsListCall) OrderBy(orderBy string) *UrlMapsListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *UrlMapsListCall) PageToken(pageToken string) *UrlMapsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlMapsListCall) Fields(s ...googleapi.Field) *UrlMapsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UrlMapsListCall) IfNoneMatch(entityTag string) *UrlMapsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlMapsListCall) Context(ctx context.Context) *UrlMapsListCall { + c.ctx_ = ctx + return c +} + +func (c *UrlMapsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.urlMaps.list" call. +// Exactly one of *UrlMapList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UrlMapList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UrlMapsListCall) Do() (*UrlMapList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UrlMapList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of UrlMap resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.urlMaps.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Patch: Update the entire content of the UrlMap resource. This method +// supports patch semantics. +// For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/patch +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlMapsPatchCall) Fields(s ...googleapi.Field) *UrlMapsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlMapsPatchCall) Context(ctx context.Context) *UrlMapsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *UrlMapsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "urlMap": c.urlMap, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.urlMaps.patch" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UrlMapsPatchCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update the 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Update: Update the entire content of the UrlMap resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/update +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlMapsUpdateCall) Fields(s ...googleapi.Field) *UrlMapsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlMapsUpdateCall) Context(ctx context.Context) *UrlMapsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *UrlMapsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "urlMap": c.urlMap, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.urlMaps.update" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UrlMapsUpdateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update the 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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. +// For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/validate +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlMapsValidateCall) Fields(s ...googleapi.Field) *UrlMapsValidateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlMapsValidateCall) Context(ctx context.Context) *UrlMapsValidateCall { + c.ctx_ = ctx + return c +} + +func (c *UrlMapsValidateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/validate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "urlMap": c.urlMap, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.urlMaps.validate" call. +// Exactly one of *UrlMapsValidateResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *UrlMapsValidateResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UrlMapsValidateCall) Do() (*UrlMapsValidateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UrlMapsValidateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.vpnTunnels.aggregatedList": + +type VpnTunnelsAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of VPN tunnels grouped by scope. +func (r *VpnTunnelsService) AggregatedList(project string) *VpnTunnelsAggregatedListCall { + c := &VpnTunnelsAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *VpnTunnelsAggregatedListCall) Filter(filter string) *VpnTunnelsAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *VpnTunnelsAggregatedListCall) MaxResults(maxResults int64) *VpnTunnelsAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *VpnTunnelsAggregatedListCall) OrderBy(orderBy string) *VpnTunnelsAggregatedListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *VpnTunnelsAggregatedListCall) PageToken(pageToken string) *VpnTunnelsAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VpnTunnelsAggregatedListCall) Fields(s ...googleapi.Field) *VpnTunnelsAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *VpnTunnelsAggregatedListCall) IfNoneMatch(entityTag string) *VpnTunnelsAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VpnTunnelsAggregatedListCall) Context(ctx context.Context) *VpnTunnelsAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *VpnTunnelsAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/vpnTunnels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.vpnTunnels.aggregatedList" call. +// Exactly one of *VpnTunnelAggregatedList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *VpnTunnelAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *VpnTunnelsAggregatedListCall) Do() (*VpnTunnelAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &VpnTunnelAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of VPN tunnels grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.vpnTunnels.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/vpnTunnels", + // "response": { + // "$ref": "VpnTunnelAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.vpnTunnels.delete": + +type VpnTunnelsDeleteCall struct { + s *Service + project string + region string + vpnTunnel string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified VpnTunnel resource. +func (r *VpnTunnelsService) Delete(project string, region string, vpnTunnel string) *VpnTunnelsDeleteCall { + c := &VpnTunnelsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.vpnTunnel = vpnTunnel + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VpnTunnelsDeleteCall) Fields(s ...googleapi.Field) *VpnTunnelsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VpnTunnelsDeleteCall) Context(ctx context.Context) *VpnTunnelsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *VpnTunnelsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "vpnTunnel": c.vpnTunnel, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.vpnTunnels.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *VpnTunnelsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified VpnTunnel resource.", + // "httpMethod": "DELETE", + // "id": "compute.vpnTunnels.delete", + // "parameterOrder": [ + // "project", + // "region", + // "vpnTunnel" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the region for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "vpnTunnel": { + // "description": "Name of the VpnTunnel resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.vpnTunnels.get": + +type VpnTunnelsGetCall struct { + s *Service + project string + region string + vpnTunnel string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified VpnTunnel resource. +func (r *VpnTunnelsService) Get(project string, region string, vpnTunnel string) *VpnTunnelsGetCall { + c := &VpnTunnelsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.vpnTunnel = vpnTunnel + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VpnTunnelsGetCall) Fields(s ...googleapi.Field) *VpnTunnelsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *VpnTunnelsGetCall) IfNoneMatch(entityTag string) *VpnTunnelsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VpnTunnelsGetCall) Context(ctx context.Context) *VpnTunnelsGetCall { + c.ctx_ = ctx + return c +} + +func (c *VpnTunnelsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "vpnTunnel": c.vpnTunnel, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.vpnTunnels.get" call. +// Exactly one of *VpnTunnel or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *VpnTunnel.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *VpnTunnelsGetCall) Do() (*VpnTunnel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &VpnTunnel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified VpnTunnel resource.", + // "httpMethod": "GET", + // "id": "compute.vpnTunnels.get", + // "parameterOrder": [ + // "project", + // "region", + // "vpnTunnel" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the region for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "vpnTunnel": { + // "description": "Name of the VpnTunnel resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}", + // "response": { + // "$ref": "VpnTunnel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.vpnTunnels.insert": + +type VpnTunnelsInsertCall struct { + s *Service + project string + region string + vpntunnel *VpnTunnel + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a VpnTunnel resource in the specified project and +// region using the data included in the request. +func (r *VpnTunnelsService) Insert(project string, region string, vpntunnel *VpnTunnel) *VpnTunnelsInsertCall { + c := &VpnTunnelsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.vpntunnel = vpntunnel + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VpnTunnelsInsertCall) Fields(s ...googleapi.Field) *VpnTunnelsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VpnTunnelsInsertCall) Context(ctx context.Context) *VpnTunnelsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *VpnTunnelsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpntunnel) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.vpnTunnels.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *VpnTunnelsInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a VpnTunnel resource in the specified project and region using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.vpnTunnels.insert", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the region for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/vpnTunnels", + // "request": { + // "$ref": "VpnTunnel" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.vpnTunnels.list": + +type VpnTunnelsListCall struct { + s *Service + project string + region string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of VpnTunnel resources contained in the +// specified project and region. +func (r *VpnTunnelsService) List(project string, region string) *VpnTunnelsListCall { + c := &VpnTunnelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *VpnTunnelsListCall) Filter(filter string) *VpnTunnelsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *VpnTunnelsListCall) MaxResults(maxResults int64) *VpnTunnelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *VpnTunnelsListCall) OrderBy(orderBy string) *VpnTunnelsListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *VpnTunnelsListCall) PageToken(pageToken string) *VpnTunnelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VpnTunnelsListCall) Fields(s ...googleapi.Field) *VpnTunnelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *VpnTunnelsListCall) IfNoneMatch(entityTag string) *VpnTunnelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VpnTunnelsListCall) Context(ctx context.Context) *VpnTunnelsListCall { + c.ctx_ = ctx + return c +} + +func (c *VpnTunnelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.vpnTunnels.list" call. +// Exactly one of *VpnTunnelList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *VpnTunnelList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *VpnTunnelsListCall) Do() (*VpnTunnelList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &VpnTunnelList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of VpnTunnel resources contained in the specified project and region.", + // "httpMethod": "GET", + // "id": "compute.vpnTunnels.list", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the region for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/vpnTunnels", + // "response": { + // "$ref": "VpnTunnelList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified zone-specific Operations resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneOperationsDeleteCall) Fields(s ...googleapi.Field) *ZoneOperationsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneOperationsDeleteCall) Context(ctx context.Context) *ZoneOperationsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.zoneOperations.delete" call. +func (c *ZoneOperationsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified zone-specific Operations resource.", + // "httpMethod": "DELETE", + // "id": "compute.zoneOperations.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the Operations resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Retrieves the specified zone-specific Operations resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneOperationsGetCall) Fields(s ...googleapi.Field) *ZoneOperationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ZoneOperationsGetCall) IfNoneMatch(entityTag string) *ZoneOperationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneOperationsGetCall) Context(ctx context.Context) *ZoneOperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.zoneOperations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ZoneOperationsGetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified zone-specific Operations resource.", + // "httpMethod": "GET", + // "id": "compute.zoneOperations.get", + // "parameterOrder": [ + // "project", + // "zone", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the Operations resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// List: Retrieves the list of Operation resources contained within the +// specified zone. +// For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *ZoneOperationsListCall) MaxResults(maxResults int64) *ZoneOperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *ZoneOperationsListCall) OrderBy(orderBy string) *ZoneOperationsListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *ZoneOperationsListCall) PageToken(pageToken string) *ZoneOperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneOperationsListCall) Fields(s ...googleapi.Field) *ZoneOperationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ZoneOperationsListCall) IfNoneMatch(entityTag string) *ZoneOperationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneOperationsListCall) Context(ctx context.Context) *ZoneOperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneOperationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.zoneOperations.list" call. +// Exactly one of *OperationList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *OperationList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ZoneOperationsListCall) Do() (*OperationList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperationList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of Operation resources contained within the specified zone.", + // "httpMethod": "GET", + // "id": "compute.zoneOperations.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Returns the specified zone resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/zones/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZonesGetCall) Fields(s ...googleapi.Field) *ZonesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ZonesGetCall) IfNoneMatch(entityTag string) *ZonesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZonesGetCall) Context(ctx context.Context) *ZonesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ZonesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.zones.get" call. +// Exactly one of *Zone or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Zone.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ZonesGetCall) Do() (*Zone, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Zone{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified zone resource.", + // "httpMethod": "GET", + // "id": "compute.zones.get", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// List: Retrieves the list of zone resources available to the specified +// project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/zones/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *ZonesListCall) MaxResults(maxResults int64) *ZonesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by +// a certain order. By default, results are returned in alphanumerical +// order based on the resource name. +// +// You can also sort results in descending order based on the creation +// timestamp using orderBy="creationTimestamp desc". This sorts results +// based on the creationTimestamp field in reverse chronological order +// (newest result first). Use this to sort resources like operations so +// that the newest operation is returned first. +// +// Currently, only sorting by name or creationTimestamp desc is +// supported. +func (c *ZonesListCall) OrderBy(orderBy string) *ZonesListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *ZonesListCall) PageToken(pageToken string) *ZonesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZonesListCall) Fields(s ...googleapi.Field) *ZonesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ZonesListCall) IfNoneMatch(entityTag string) *ZonesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZonesListCall) Context(ctx context.Context) *ZonesListCall { + c.ctx_ = ctx + return c +} + +func (c *ZonesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.zones.list" call. +// Exactly one of *ZoneList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *ZoneList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ZonesListCall) Do() (*ZoneList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ZoneList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of zone resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.zones.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/compute/v1/compute-api.json b/Godeps/_workspace/src/google.golang.org/api/compute/v1/compute-api.json new file mode 100644 index 000000000..9b2e56d6e --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/compute/v1/compute-api.json @@ -0,0 +1,13950 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/K2YWeNBEH2yOCjdgDssBGJY_KU4\"", + "discoveryVersion": "v1", + "id": "compute:v1", + "name": "compute", + "version": "v1", + "revision": "20151015", + "title": "Compute Engine API", + "description": "API for the Google Compute Engine service.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/compute_engine-16.png", + "x32": "https://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/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "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": "[Output Only] Type of the resource. Always compute#accessConfig for access configs.", + "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 external IP address available to the project or leave this field undefined to use an IP from a shared ephemeral IP address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance." + }, + "type": { + "type": "string", + "description": "The type of configuration. The default and only option is ONE_TO_ONE_NAT.", + "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 static external IP address represented by this resource." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#address for addresses.", + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.addresses.insert" + ] + } + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where the regional address resides. This field is not applicable to global addresses." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "status": { + "type": "string", + "description": "[Output Only] The status of the address, which can be either IN_USE or RESERVED. An address that is RESERVED is currently reserved and available to use. An IN_USE address is currently being used by another resource and is not available.", + "enum": [ + "IN_USE", + "RESERVED" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "users": { + "type": "array", + "description": "[Output Only] The URLs of the resources that are using this address.", + "items": { + "type": "string" + } + } + } + }, + "AddressAggregatedList": { + "id": "AddressAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "object", + "description": "[Output Only] A map of scoped address lists.", + "additionalProperties": { + "$ref": "AddressesScopedList", + "description": "[Output Only] Name of the scope containing this set of addresses." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#addressAggregatedList for aggregated lists of addresses.", + "default": "compute#addressAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "AddressList": { + "id": "AddressList", + "type": "object", + "description": "Contains a list of address resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of Address resources.", + "items": { + "$ref": "Address" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#addressList for lists of addresses.", + "default": "compute#addressList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + } + } + }, + "AddressesScopedList": { + "id": "AddressesScopedList", + "type": "object", + "properties": { + "addresses": { + "type": "array", + "description": "[Output Only] List of addresses contained in this scope.", + "items": { + "$ref": "Address" + } + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning which replaces the list of addresses when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "AttachedDisk": { + "id": "AttachedDisk", + "type": "object", + "description": "An instance-attached disk resource.", + "properties": { + "autoDelete": { + "type": "boolean", + "description": "Specifies 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. The virtual machine will use the first partition of the disk for its root filesystem." + }, + "deviceName": { + "type": "string", + "description": "Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance.\n\nIf not specified, the server chooses a default device name to apply to this disk, in the form persistent-disks-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks." + }, + "index": { + "type": "integer", + "description": "Assigns a zero-based index to this disk, where 0 is reserved for the boot disk. For example, if you have many disks attached to an instance, each disk would have a unique index number. If not specified, the server will choose an appropriate value.", + "format": "int32" + }, + "initializeParams": { + "$ref": "AttachedDiskInitializeParams", + "description": "[Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance.\n\nThis property is mutually exclusive with the source property; you can only define one or the other, but not both." + }, + "interface": { + "type": "string", + "description": "Specifies the disk interface to use for attaching this disk, either SCSI or NVME. The default is SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance.", + "enum": [ + "NVME", + "SCSI" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#attachedDisk for attached disks.", + "default": "compute#attachedDisk" + }, + "licenses": { + "type": "array", + "description": "[Output Only] Any valid publicly visible licenses.", + "items": { + "type": "string" + } + }, + "mode": { + "type": "string", + "description": "The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode.", + "enum": [ + "READ_ONLY", + "READ_WRITE" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "source": { + "type": "string", + "description": "Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks." + }, + "type": { + "type": "string", + "description": "Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.", + "enum": [ + "PERSISTENT", + "SCRATCH" + ], + "enumDescriptions": [ + "", + "" + ], + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + } + } + }, + "AttachedDiskInitializeParams": { + "id": "AttachedDiskInitializeParams", + "type": "object", + "description": "[Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance.\n\nThis property is mutually exclusive with the source property; you can only define one or the other, but not both.", + "properties": { + "diskName": { + "type": "string", + "description": "Specifies the disk name. If not specified, the default is to use the name of the instance." + }, + "diskSizeGb": { + "type": "string", + "description": "Specifies the size of the disk in base-2 GB.", + "format": "int64" + }, + "diskType": { + "type": "string", + "description": "Specifies the disk type to use to create the instance. If not specified, the default is pd-standard, specified using the full URL. For example:\n\nhttps://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard \n\nOther values include pd-ssd and local-ssd. If you define this field, you can provide either the full or partial URL. For example, the following are valid values: \n- https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType \n- projects/project/zones/zone/diskTypes/diskType \n- zones/zone/diskTypes/diskType" + }, + "sourceImage": { + "type": "string", + "description": "A source image used to create the disk. You can provide a private (custom) image, and Compute Engine will use the corresponding image from your project. For example:\n\nglobal/images/my-private-image \n\nOr you can provide an image from a publicly-available project. For example, to use a Debian image from the debian-cloud project, make sure to include the project in the URL:\n\nprojects/debian-cloud/global/images/debian-7-wheezy-vYYYYMMDD \n\nwhere vYYYYMMDD is the image version. The fully-qualified URL will also work in both cases." + } + } + }, + "Autoscaler": { + "id": "Autoscaler", + "type": "object", + "properties": { + "autoscalingPolicy": { + "$ref": "AutoscalingPolicy", + "description": "Autoscaling configuration." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#autoscaler" + }, + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.instanceGroups.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "target": { + "type": "string", + "description": "URL of Instance Group Manager or Replica Pool which will be controlled by Autoscaler." + }, + "zone": { + "type": "string", + "description": "[Output Only] URL of the zone where the instance group resides." + } + } + }, + "AutoscalerAggregatedList": { + "id": "AutoscalerAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "object", + "description": "A map of scoped autoscaler lists.", + "additionalProperties": { + "$ref": "AutoscalersScopedList", + "description": "Name of the scope containing this set of autoscalers." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#autoscalerAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "AutoscalerList": { + "id": "AutoscalerList", + "type": "object", + "description": "Contains a list of persistent autoscaler resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of Autoscaler resources.", + "items": { + "$ref": "Autoscaler" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#autoscalerList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "AutoscalersScopedList": { + "id": "AutoscalersScopedList", + "type": "object", + "properties": { + "autoscalers": { + "type": "array", + "description": "List of autoscalers contained in this scope.", + "items": { + "$ref": "Autoscaler" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of autoscalers when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "AutoscalingPolicy": { + "id": "AutoscalingPolicy", + "type": "object", + "description": "Cloud Autoscaler policy.", + "properties": { + "coolDownPeriodSec": { + "type": "integer", + "description": "The number of seconds that the Autoscaler should wait between two succeeding changes to the number of virtual machines. You should define an interval that is at least as long as the initialization time of a virtual machine and the time it may take for replica pool to create the virtual machine. The default is 60 seconds.", + "format": "int32" + }, + "cpuUtilization": { + "$ref": "AutoscalingPolicyCpuUtilization", + "description": "TODO(jbartosik): Add support for scaling based on muliple utilization metrics (take max recommendation). Exactly one utilization policy should be provided. Configuration parameters of CPU based autoscaling policy." + }, + "customMetricUtilizations": { + "type": "array", + "description": "Configuration parameters of autoscaling based on custom metric.", + "items": { + "$ref": "AutoscalingPolicyCustomMetricUtilization" + } + }, + "loadBalancingUtilization": { + "$ref": "AutoscalingPolicyLoadBalancingUtilization", + "description": "Configuration parameters of autoscaling based on load balancer." + }, + "maxNumReplicas": { + "type": "integer", + "description": "The maximum number of replicas that the Autoscaler can scale up to. This field is required for config to be effective. Maximum number of replicas should be not lower than minimal number of replicas. Absolute limit for this value is defined in Autoscaler backend.", + "format": "int32" + }, + "minNumReplicas": { + "type": "integer", + "description": "The minimum number of replicas that the Autoscaler can scale down to. Can't be less than 0. If not provided Autoscaler will choose default value depending on maximal number of replicas.", + "format": "int32" + } + } + }, + "AutoscalingPolicyCpuUtilization": { + "id": "AutoscalingPolicyCpuUtilization", + "type": "object", + "description": "CPU utilization policy.", + "properties": { + "utilizationTarget": { + "type": "number", + "description": "The target utilization that the Autoscaler should maintain. It is represented as a fraction of used cores. For example: 6 cores used in 8-core VM are represented here as 0.75. Must be a float value between (0, 1]. If not defined, the default is 0.8.", + "format": "double" + } + } + }, + "AutoscalingPolicyCustomMetricUtilization": { + "id": "AutoscalingPolicyCustomMetricUtilization", + "type": "object", + "description": "Custom utilization metric policy.", + "properties": { + "metric": { + "type": "string", + "description": "Identifier of the metric. It should be a Cloud Monitoring metric. The metric can not have negative values. The metric should be an utilization metric (increasing number of VMs handling requests x times should reduce average value of the metric roughly x times). For example you could use: compute.googleapis.com/instance/network/received_bytes_count." + }, + "utilizationTarget": { + "type": "number", + "description": "Target value of the metric which Autoscaler should maintain. Must be a positive value.", + "format": "double" + }, + "utilizationTargetType": { + "type": "string", + "description": "Defines type in which utilization_target is expressed.", + "enum": [ + "DELTA_PER_MINUTE", + "DELTA_PER_SECOND", + "GAUGE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "AutoscalingPolicyLoadBalancingUtilization": { + "id": "AutoscalingPolicyLoadBalancingUtilization", + "type": "object", + "description": "Load balancing utilization policy.", + "properties": { + "utilizationTarget": { + "type": "number", + "description": "Fraction of backend capacity utilization (set in HTTP load balancing configuration) that Autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8. For example if your maxRatePerInstance capacity (in HTTP Load Balancing configuration) is set at 10 and you would like to keep number of instances such that each instance receives 7 QPS on average, set this to 0.7.", + "format": "double" + } + } + }, + "Backend": { + "id": "Backend", + "type": "object", + "description": "Message containing information of one individual backend.", + "properties": { + "balancingMode": { + "type": "string", + "description": "Specifies the balancing mode for this backend. The default is UTILIZATION but available values are UTILIZATION and RATE.", + "enum": [ + "RATE", + "UTILIZATION" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "capacityScaler": { + "type": "number", + "description": "A multiplier applied to the group's maximum servicing capacity (either UTILIZATION or RATE). Default value is 1, which means the group will serve up to 100% of its configured CPU or RPS (depending on balancingMode). A setting of 0 means the group is completely drained, offering 0% of its available CPU or RPS. Valid range is [0.0,1.0].", + "format": "float" + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource. Provided by the client when the resource is created." + }, + "group": { + "type": "string", + "description": "The fully-qualified URL of a zonal Instance Group resource. This instance group defines the list of instances that serve traffic. Member virtual machine instances from each instance group must live in the same zone as the instance group itself. No two backends in a backend service are allowed to use same Instance Group resource.\n\nNote that you must specify an Instance Group resource using the fully-qualified URL, rather than a partial URL." + }, + "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.0, 1.0].", + "format": "float" + } + } + }, + "BackendService": { + "id": "BackendService", + "type": "object", + "description": "A BackendService resource. This resource defines a group of backend virtual machines 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": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "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": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#backendService for backend services.", + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "port": { + "type": "integer", + "description": "Deprecated in favor of port name. The TCP port to connect on the backend. The default value is 80.", + "format": "int32" + }, + "portName": { + "type": "string", + "description": "Name of backend port. The same name should appear in the resource views referenced by this service. Required." + }, + "protocol": { + "type": "string", + "enum": [ + "HTTP", + "HTTPS" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "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": "[Output Only] Type of resource. Always compute#backendServiceGroupHealth for the health of backend services.", + "default": "compute#backendServiceGroupHealth" + } + } + }, + "BackendServiceList": { + "id": "BackendServiceList", + "type": "object", + "description": "Contains a list of BackendService resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of BackendService resources.", + "items": { + "$ref": "BackendService" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#backendServiceList for lists of backend services.", + "default": "compute#backendServiceList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "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": "The URL of the suggested replacement for a deprecated resource. The suggested replacement resource must be the same kind of resource as the deprecated resource." + }, + "state": { + "type": "string", + "description": "The deprecation state of this resource. This 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. Operations which use OBSOLETE or DELETED resources will be rejected and result in an error.", + "enum": [ + "DELETED", + "DEPRECATED", + "OBSOLETE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "Disk": { + "id": "Disk", + "type": "object", + "description": "A Disk resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#disk for disks.", + "default": "compute#disk" + }, + "lastAttachTimestamp": { + "type": "string", + "description": "[Output Only] Last attach timestamp in RFC3339 text format." + }, + "lastDetachTimestamp": { + "type": "string", + "description": "[Output Only] Last detach timestamp in RFC3339 text format." + }, + "licenses": { + "type": "array", + "description": "Any applicable publicly visible licenses.", + "items": { + "type": "string" + } + }, + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "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": "[Output Only] Server-defined fully-qualified URL for this resource." + }, + "sizeGb": { + "type": "string", + "description": "Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the sourceImage or sourceSnapshot parameter, or specify it alone to create an empty persistent disk.\n\nIf you specify this field along with sourceImage or sourceSnapshot, the value of sizeGb must not be less than the size of the sourceImage or the size of the snapshot.", + "format": "int64" + }, + "sourceImage": { + "type": "string", + "description": "The source image used to create this disk. If the source image is deleted from the system, this field will not be set, even if an image with the same name has been re-created.\n\nWhen creating a disk, you can provide a private (custom) image using the following input, and Compute Engine will use the corresponding image from your project. For example:\n\nglobal/images/my-private-image \n\nOr you can provide an image from a publicly-available project. For example, to use a Debian image from the debian-cloud project, make sure to include the project in the URL:\n\nprojects/debian-cloud/global/images/debian-7-wheezy-vYYYYMMDD \n\nwhere vYYYYMMDD is the image version. The fully-qualified URL will also work in both cases." + }, + "sourceImageId": { + "type": "string", + "description": "The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used." + }, + "sourceSnapshot": { + "type": "string", + "description": "The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: \n- https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot \n- projects/project/global/snapshots/snapshot \n- global/snapshots/snapshot" + }, + "sourceSnapshotId": { + "type": "string", + "description": "[Output Only] The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used." + }, + "status": { + "type": "string", + "description": "[Output Only] The status of disk creation. Applicable statuses includes: CREATING, FAILED, READY, RESTORING.", + "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." + }, + "users": { + "type": "array", + "description": "Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance", + "items": { + "type": "string" + } + }, + "zone": { + "type": "string", + "description": "[Output Only] URL of the zone where the disk resides." + } + } + }, + "DiskAggregatedList": { + "id": "DiskAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "object", + "description": "[Output Only] A map of scoped disk lists.", + "additionalProperties": { + "$ref": "DisksScopedList", + "description": "[Output Only] Name of the scope containing this set of disks." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#diskAggregatedList for aggregated lists of persistent disks.", + "default": "compute#diskAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "DiskList": { + "id": "DiskList", + "type": "object", + "description": "A list of Disk resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of persistent disks.", + "items": { + "$ref": "Disk" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#diskList for lists of disks.", + "default": "compute#diskList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "DiskMoveRequest": { + "id": "DiskMoveRequest", + "type": "object", + "properties": { + "destinationZone": { + "type": "string", + "description": "The URL of the destination zone to move the disk to. This can be a full or partial URL. For example, the following are all valid URLs to a zone: \n- https://www.googleapis.com/compute/v1/projects/project/zones/zone \n- projects/project/zones/zone \n- zones/zone" + }, + "targetDisk": { + "type": "string", + "description": "The URL of the target disk to move. This can be a full or partial URL. For example, the following are all valid URLs to a disk: \n- https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk \n- projects/project/zones/zone/disks/disk \n- zones/zone/disks/disk" + } + } + }, + "DiskType": { + "id": "DiskType", + "type": "object", + "description": "A disk type resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "defaultDiskSizeGb": { + "type": "string", + "description": "[Output Only] Server-defined default disk size in GB.", + "format": "int64" + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "[Output Only] The deprecation status associated with this disk type." + }, + "description": { + "type": "string", + "description": "[Output Only] An optional textual description of the resource." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#diskType for disk types.", + "default": "compute#diskType" + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "validDiskSize": { + "type": "string", + "description": "[Output Only] An optional textual description of the valid disk size, such as \"10GB-10TB\"." + }, + "zone": { + "type": "string", + "description": "[Output Only] URL of the zone where the disk type resides." + } + } + }, + "DiskTypeAggregatedList": { + "id": "DiskTypeAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "object", + "description": "[Output Only] A map of scoped disk type lists.", + "additionalProperties": { + "$ref": "DiskTypesScopedList", + "description": "[Output Only] Name of the scope containing this set of disk types." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#diskTypeAggregatedList.", + "default": "compute#diskTypeAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "DiskTypeList": { + "id": "DiskTypeList", + "type": "object", + "description": "Contains a list of disk type resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of Disk Type resources.", + "items": { + "$ref": "DiskType" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#diskTypeList for disk types.", + "default": "compute#diskTypeList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "DiskTypesScopedList": { + "id": "DiskTypesScopedList", + "type": "object", + "properties": { + "diskTypes": { + "type": "array", + "description": "[Output Only] List of disk types contained in this scope.", + "items": { + "$ref": "DiskType" + } + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning which replaces the list of disk types when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "DisksScopedList": { + "id": "DisksScopedList", + "type": "object", + "properties": { + "disks": { + "type": "array", + "description": "[Output Only] List of disks contained in this scope.", + "items": { + "$ref": "Disk" + } + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning which replaces the list of disks when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] 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": "The IP protocol that is allowed for this rule. The protocol type is required when creating a firewall. This value 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. This field is only applicable for UDP or TCP protocol. 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": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Ony] Type of the resource. Always compute#firewall for firewall rules.", + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "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 resource for this firewall rule. This field is required for creating an instance but optional when creating a firewall rule. If not specified when creating a firewall rule, the default network is used:\nglobal/networks/default\nIf you choose to specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: \n- https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network \n- projects/myproject/global/networks/my-network \n- global/networks/default" + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "sourceRanges": { + "type": "array", + "description": "The IP address blocks that this rule applies to, expressed in CIDR format. One or both of sourceRanges and sourceTags may be set.\n\nIf both properties are set, an inbound connection is allowed if the range matches the sourceRanges OR the tag of the source matches the sourceTags property. The connection does not need to match both properties.", + "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.\n\nIf both properties are set, an inbound connection is allowed if the range matches the sourceRanges OR the tag of the source matches the sourceTags property. The connection does not need to match both properties.", + "items": { + "type": "string" + } + }, + "targetTags": { + "type": "array", + "description": "A list of instance tags indicating sets of instances located in the network that 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": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of Firewall resources.", + "items": { + "$ref": "Firewall" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#firewallList for lists of firewalls.", + "default": "compute#firewallList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "ForwardingRule": { + "id": "ForwardingRule", + "type": "object", + "description": "A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines 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": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#forwardingRule.", + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "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. Forwarding rules with the same `[IPAddress, IPProtocol]` pair must have disjoint port ranges." + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where the regional forwarding rule resides. This field is not applicable to global forwarding rules." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "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 or TargetHttpsProxy resource." + } + } + }, + "ForwardingRuleAggregatedList": { + "id": "ForwardingRuleAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "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": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "ForwardingRuleList": { + "id": "ForwardingRuleList", + "type": "object", + "description": "Contains a list of ForwardingRule resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Set by the server." + }, + "items": { + "type": "array", + "description": "A list of ForwardingRule resources.", + "items": { + "$ref": "ForwardingRule" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#forwardingRuleList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "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": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] 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." + }, + "port": { + "type": "integer", + "description": "The port on the instance.", + "format": "int32" + } + } + }, + "HostRule": { + "id": "HostRule", + "type": "object", + "description": "UrlMaps A host-matching rule for a URL. If matched, will use the named PathMatcher to select the BackendService.", + "properties": { + "description": { + "type": "string", + "description": "An optional textual description." + }, + "hosts": { + "type": "array", + "description": "The list of host patterns to match. They must be valid hostnames, except * will match any string of ([a-z0-9-.]*). In that case, * must be the first character and must be followed in the pattern by either - or ..", + "items": { + "type": "string" + } + }, + "pathMatcher": { + "type": "string", + "description": "The name of the PathMatcher to use to match the path portion of the URL if the hostRule matches the URL's host portion." + } + } + }, + "HttpHealthCheck": { + "id": "HttpHealthCheck", + "type": "object", + "description": "An HttpHealthCheck resource. This resource defines a template for how individual instances 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": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "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 instance 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": "[Output Only] Unique identifier for the resource. Defined by the server.", + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "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": "[Output Only] Server-defined URL for the resource." + }, + "timeoutSec": { + "type": "integer", + "description": "How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than checkIntervalSec.", + "format": "int32" + }, + "unhealthyThreshold": { + "type": "integer", + "description": "A so-far healthy instance 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": "[Output Only] Unique identifier for the resource. Defined by the server." + }, + "items": { + "type": "array", + "description": "A list of HttpHealthCheck resources.", + "items": { + "$ref": "HttpHealthCheck" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#httpHealthCheckList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "HttpsHealthCheck": { + "id": "HttpsHealthCheck", + "type": "object", + "description": "An HttpsHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTPS.", + "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": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "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 instance 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 HTTPS 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": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#httpsHealthCheck" + }, + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "port": { + "type": "integer", + "description": "The TCP port number for the HTTPS health check request. The default value is 443.", + "format": "int32" + }, + "requestPath": { + "type": "string", + "description": "The request path of the HTTPS health check request. The default value is \"/\"." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "timeoutSec": { + "type": "integer", + "description": "How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have a greater value than checkIntervalSec.", + "format": "int32" + }, + "unhealthyThreshold": { + "type": "integer", + "description": "A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2.", + "format": "int32" + } + } + }, + "HttpsHealthCheckList": { + "id": "HttpsHealthCheckList", + "type": "object", + "description": "Contains a list of HttpsHealthCheck resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of HttpsHealthCheck resources.", + "items": { + "$ref": "HttpsHealthCheck" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#httpsHealthCheckList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "Image": { + "id": "Image", + "type": "object", + "description": "An 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": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "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 persistent disk (in GB).", + "format": "int64" + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#image for images.", + "default": "compute#image" + }, + "licenses": { + "type": "array", + "description": "Any applicable publicly visible licenses.", + "items": { + "type": "string" + } + }, + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + }, + "rawDisk": { + "type": "object", + "description": "The parameters of the raw disk image.", + "properties": { + "containerType": { + "type": "string", + "description": "The format used to encode and transmit the block device, which 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. You must provide either this property or the sourceDisk property but not both.", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + } + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "sourceDisk": { + "type": "string", + "description": "URL of the The source disk used to create this image. This can be a full or valid partial URL. You must provide either this property or the rawDisk.source property but not both to create an image. For example, the following are valid values: \n- https://www.googleapis.com/compute/v1/projects/project/zones/zone/disk/disk \n- projects/project/zones/zone/disk/disk \n- zones/zone/disks/disk" + }, + "sourceDiskId": { + "type": "string", + "description": "The ID value of the disk used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given disk name." + }, + "sourceType": { + "type": "string", + "description": "The type of the image used to create this disk. The default and only value is RAW", + "default": "RAW", + "enum": [ + "RAW" + ], + "enumDescriptions": [ + "" + ] + }, + "status": { + "type": "string", + "description": "[Output Only] The status of the image. An image can be used to create other resources, such as instances, only after the image has been successfully created and the status is set to READY. Possible values are FAILED, PENDING, or READY.", + "enum": [ + "FAILED", + "PENDING", + "READY" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "ImageList": { + "id": "ImageList", + "type": "object", + "description": "Contains a list of Image resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of Image resources.", + "items": { + "$ref": "Image" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#imageList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "Instance": { + "id": "Instance", + "type": "object", + "description": "An Instance resource.", + "properties": { + "canIpForward": { + "type": "boolean", + "description": "Allows this instance to send and receive packets with non-matching destination or source IPs. This is required if you plan to use this instance to forward routes. For more information, see Enabling IP Forwarding." + }, + "cpuPlatform": { + "type": "string", + "description": "[Output Only] The CPU platform used by this instance." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client 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": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#instance for instances.", + "default": "compute#instance" + }, + "machineType": { + "type": "string", + "description": "Full or partial URL of the machine type resource to use for this instance. This is provided by the client when the instance is created. For example, the following is a valid partial url:\n\nzones/zone/machineTypes/machine-type", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + }, + "metadata": { + "$ref": "Metadata", + "description": "The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys." + }, + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash." + }, + "networkInterfaces": { + "type": "array", + "description": "An 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.", + "items": { + "$ref": "NetworkInterface" + } + }, + "scheduling": { + "$ref": "Scheduling", + "description": "Scheduling options for this instance." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for this resource." + }, + "serviceAccounts": { + "type": "array", + "description": "A list of service accounts, with their specified scopes, authorized for this instance. Service accounts generate access tokens that can be accessed through the metadata server and used to authenticate applications on the instance. See Authenticating from Google Compute Engine for more information.", + "items": { + "$ref": "ServiceAccount" + } + }, + "status": { + "type": "string", + "description": "[Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, and TERMINATED.", + "enum": [ + "PROVISIONING", + "RUNNING", + "STAGING", + "STOPPED", + "STOPPING", + "SUSPENDED", + "SUSPENDING", + "TERMINATED" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "statusMessage": { + "type": "string", + "description": "[Output Only] An optional, human-readable explanation of the status." + }, + "tags": { + "$ref": "Tags", + "description": "A list of tags to appy to this instance. Tags are used to identify valid sources or targets for network firewalls and are specified by the client during 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": "[Output Only] URL of the zone where the instance resides." + } + } + }, + "InstanceAggregatedList": { + "id": "InstanceAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "object", + "description": "[Output Only] A map of scoped instance lists.", + "additionalProperties": { + "$ref": "InstancesScopedList", + "description": "Name of the scope containing this set of instances." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#instanceAggregatedList for aggregated lists of Instance resources.", + "default": "compute#instanceAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for this resource." + } + } + }, + "InstanceGroup": { + "id": "InstanceGroup", + "type": "object", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] The creation timestamp for this instance group in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional text description for the instance group." + }, + "fingerprint": { + "type": "string", + "description": "[Output Only] The fingerprint of the named ports. The system uses this fingerprint to detect conflicts when multiple users change the named ports concurrently.", + "format": "byte" + }, + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this resource type. The server generates this identifier.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceGroup for instance groups.", + "default": "compute#instanceGroup" + }, + "name": { + "type": "string", + "description": "The name of the instance group. 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.instanceGroupManagers.insert" + ] + } + }, + "namedPorts": { + "type": "array", + "description": "Assigns a name to a port number. For example: {name: \"http\", port: 80}\n\nThis allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: \"http\", port: 80},{name: \"http\", port: 8080}] \n\nNamed ports apply to all instances in this instance group.", + "items": { + "$ref": "NamedPort" + } + }, + "network": { + "type": "string", + "description": "[Output Only] The URL of the network to which all instances in the instance group belong." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this instance group. The server generates this URL." + }, + "size": { + "type": "integer", + "description": "[Output Only] The total number of instances in the instance group.", + "format": "int32" + }, + "zone": { + "type": "string", + "description": "[Output Only] The URL of the zone where the instance group is located." + } + } + }, + "InstanceGroupAggregatedList": { + "id": "InstanceGroupAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this aggregated list of instance groups. The server generates this identifier." + }, + "items": { + "type": "object", + "description": "A map of scoped instance group lists.", + "additionalProperties": { + "$ref": "InstanceGroupsScopedList", + "description": "The name of the scope that contains this set of instance groups." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceGroupAggregatedList for aggregated lists of instance groups.", + "default": "compute#instanceGroupAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token that is used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this resource type. The server generates this URL." + } + } + }, + "InstanceGroupList": { + "id": "InstanceGroupList", + "type": "object", + "description": "A list of InstanceGroup resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this list of instance groups. The server generates this identifier." + }, + "items": { + "type": "array", + "description": "A list of instance groups.", + "items": { + "$ref": "InstanceGroup" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceGroupList for instance group lists.", + "default": "compute#instanceGroupList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token that is used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this resource type. The server generates this URL." + } + } + }, + "InstanceGroupManager": { + "id": "InstanceGroupManager", + "type": "object", + "description": "InstanceGroupManagers\n\nNext available tag: 19", + "properties": { + "baseInstanceName": { + "type": "string", + "description": "The base instance name to use for instances in this group. The value must be 1-58 characters long. Instances are named by appending a hyphen and a random four-character string to the base instance name. The base instance name must comply with RFC1035.", + "pattern": "[a-z][-a-z0-9]{0,57}", + "annotations": { + "required": [ + "compute.instanceGroupManagers.insert" + ] + } + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] The creation timestamp for this managed instance group in RFC3339 text format." + }, + "currentActions": { + "$ref": "InstanceGroupManagerActionsSummary", + "description": "[Output Only] The list of instance actions and the number of instances in this managed instance group that are scheduled for each of those actions." + }, + "description": { + "type": "string", + "description": "An optional text description for the managed instance group." + }, + "fingerprint": { + "type": "string", + "description": "[Output Only] The fingerprint of the target pools information. You can use this optional field for optimistic locking when you update the target pool entries.", + "format": "byte" + }, + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this resource type. The server generates this identifier.", + "format": "uint64" + }, + "instanceGroup": { + "type": "string", + "description": "[Output Only] The URL of the Instance Group resource." + }, + "instanceTemplate": { + "type": "string", + "description": "The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group.", + "annotations": { + "required": [ + "compute.instanceGroupManagers.insert" + ] + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups.", + "default": "compute#instanceGroupManager" + }, + "name": { + "type": "string", + "description": "The name of the managed instance group. 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.instanceGroupManagers.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this managed instance group. The server defines this URL." + }, + "targetPools": { + "type": "array", + "description": "The URLs for all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group.", + "items": { + "type": "string" + } + }, + "targetSize": { + "type": "integer", + "description": "The target number of running instances for this managed instance group. Deleting or abandoning instances reduces this number. Resizing the group changes this number.", + "format": "int32", + "annotations": { + "required": [ + "compute.instanceGroupManagers.insert" + ] + } + }, + "zone": { + "type": "string", + "description": "The name of the zone where the managed instance group is located." + } + } + }, + "InstanceGroupManagerActionsSummary": { + "id": "InstanceGroupManagerActionsSummary", + "type": "object", + "properties": { + "abandoning": { + "type": "integer", + "description": "[Output Only] The total number of instances in the managed instance group that are scheduled to be abandoned. Abandoning an instance removes it from the managed instance group without deleting it.", + "format": "int32" + }, + "creating": { + "type": "integer", + "description": "[Output Only] The number of instances in the managed instance group that are scheduled to be created or are currently being created.", + "format": "int32" + }, + "deleting": { + "type": "integer", + "description": "[Output Only] The number of instances in the managed instance group that are scheduled to be deleted or are currently being deleted.", + "format": "int32" + }, + "none": { + "type": "integer", + "description": "[Output Only] The number of instances in the managed instance group that are running and have no scheduled actions.", + "format": "int32" + }, + "recreating": { + "type": "integer", + "description": "[Output Only] The number of instances in the managed instance group that are scheduled to be recreated or are currently being being recreated. Recreating an instance deletes the existing root persistent disk and creates a new disk from the image that is defined in the instance template.", + "format": "int32" + }, + "refreshing": { + "type": "integer", + "description": "[Output Only] The number of instances in the managed instance group that are being reconfigured with properties that do not require a restart or a recreate action. For example, setting or removing target pools for the instance.", + "format": "int32" + }, + "restarting": { + "type": "integer", + "description": "[Output Only] The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted.", + "format": "int32" + } + } + }, + "InstanceGroupManagerAggregatedList": { + "id": "InstanceGroupManagerAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this aggregated list of managed instance groups. The server generates this identifier." + }, + "items": { + "type": "object", + "description": "[Output Only] A map of filtered managed instance group lists.", + "additionalProperties": { + "$ref": "InstanceGroupManagersScopedList", + "description": "[Output Only] The name of the scope that contains this set of managed instance groups." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceGroupManagerAggregatedList for an aggregated list of managed instance groups.", + "default": "compute#instanceGroupManagerAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token that is used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this resource type. The server generates this URL." + } + } + }, + "InstanceGroupManagerList": { + "id": "InstanceGroupManagerList", + "type": "object", + "description": "[Output Only] A list of managed instance groups.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this resource type. The server generates this identifier." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of managed instance groups.", + "items": { + "$ref": "InstanceGroupManager" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceGroupManagerList for a list of managed instance groups.", + "default": "compute#instanceGroupManagerList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token that is used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this resource type. The server generates this URL." + } + } + }, + "InstanceGroupManagersAbandonInstancesRequest": { + "id": "InstanceGroupManagersAbandonInstancesRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "The URL for one or more instances to abandon from the managed instance group.", + "items": { + "type": "string" + } + } + } + }, + "InstanceGroupManagersDeleteInstancesRequest": { + "id": "InstanceGroupManagersDeleteInstancesRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "The list of instances to delete from this managed instance group. Specify one or more instance URLs.", + "items": { + "type": "string" + } + } + } + }, + "InstanceGroupManagersListManagedInstancesResponse": { + "id": "InstanceGroupManagersListManagedInstancesResponse", + "type": "object", + "properties": { + "managedInstances": { + "type": "array", + "description": "[Output Only] The list of instances in the managed instance group.", + "items": { + "$ref": "ManagedInstance" + } + } + } + }, + "InstanceGroupManagersRecreateInstancesRequest": { + "id": "InstanceGroupManagersRecreateInstancesRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "The URL for one or more instances to recreate.", + "items": { + "type": "string" + } + } + } + }, + "InstanceGroupManagersScopedList": { + "id": "InstanceGroupManagersScopedList", + "type": "object", + "properties": { + "instanceGroupManagers": { + "type": "array", + "description": "[Output Only] The list of managed instance groups that are contained in the specified project and zone.", + "items": { + "$ref": "InstanceGroupManager" + } + }, + "warning": { + "type": "object", + "description": "[Output Only] The warning that replaces the list of managed instance groups when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "InstanceGroupManagersSetInstanceTemplateRequest": { + "id": "InstanceGroupManagersSetInstanceTemplateRequest", + "type": "object", + "properties": { + "instanceTemplate": { + "type": "string", + "description": "The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group." + } + } + }, + "InstanceGroupManagersSetTargetPoolsRequest": { + "id": "InstanceGroupManagersSetTargetPoolsRequest", + "type": "object", + "properties": { + "fingerprint": { + "type": "string", + "description": "The fingerprint of the target pools information. Use this optional property to prevent conflicts when multiple users change the target pools settings concurrently. Obtain the fingerprint with the instanceGroupManagers.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request.", + "format": "byte" + }, + "targetPools": { + "type": "array", + "description": "The list of target pool URLs that instances in this managed instance group belong to. The managed instance group applies these target pools to all of the instances in the group. Existing instances and new instances in the group all receive these target pool settings.", + "items": { + "type": "string" + } + } + } + }, + "InstanceGroupsAddInstancesRequest": { + "id": "InstanceGroupsAddInstancesRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "The list of instances to add to the instance group.", + "items": { + "$ref": "InstanceReference" + } + } + } + }, + "InstanceGroupsListInstances": { + "id": "InstanceGroupsListInstances", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this list of instance groups. The server generates this identifier." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of instances and any named ports that are assigned to those instances.", + "items": { + "$ref": "InstanceWithNamedPorts" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceGroupsListInstances for lists of instance groups.", + "default": "compute#instanceGroupsListInstances" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token that is used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this list of instance groups. The server generates this URL." + } + } + }, + "InstanceGroupsListInstancesRequest": { + "id": "InstanceGroupsListInstancesRequest", + "type": "object", + "properties": { + "instanceState": { + "type": "string", + "description": "A filter for the state of the instances in the instance group. Valid options are ALL or RUNNING. If you do not specify this parameter the list includes all instances regardless of their state.", + "enum": [ + "ALL", + "RUNNING" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "InstanceGroupsRemoveInstancesRequest": { + "id": "InstanceGroupsRemoveInstancesRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "The list of instances to remove from the instance group.", + "items": { + "$ref": "InstanceReference" + } + } + } + }, + "InstanceGroupsScopedList": { + "id": "InstanceGroupsScopedList", + "type": "object", + "properties": { + "instanceGroups": { + "type": "array", + "description": "[Output Only] The list of instance groups that are contained in this scope.", + "items": { + "$ref": "InstanceGroup" + } + }, + "warning": { + "type": "object", + "description": "[Output Only] An informational warning that replaces the list of instance groups when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "InstanceGroupsSetNamedPortsRequest": { + "id": "InstanceGroupsSetNamedPortsRequest", + "type": "object", + "properties": { + "fingerprint": { + "type": "string", + "description": "The fingerprint of the named ports information for this instance group. Use this optional property to prevent conflicts when multiple users change the named ports settings concurrently. Obtain the fingerprint with the instanceGroups.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request.", + "format": "byte" + }, + "namedPorts": { + "type": "array", + "description": "The list of named ports to set for this instance group.", + "items": { + "$ref": "NamedPort" + } + } + } + }, + "InstanceList": { + "id": "InstanceList", + "type": "object", + "description": "Contains a list of instance resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of Instance resources.", + "items": { + "$ref": "Instance" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#instanceList for lists of Instance resources.", + "default": "compute#instanceList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for this resource." + } + } + }, + "InstanceMoveRequest": { + "id": "InstanceMoveRequest", + "type": "object", + "properties": { + "destinationZone": { + "type": "string", + "description": "The URL of the destination zone to move the instance to. This can be a full or partial URL. For example, the following are all valid URLs to a zone: \n- https://www.googleapis.com/compute/v1/projects/project/zones/zone \n- projects/project/zones/zone \n- zones/zone" + }, + "targetInstance": { + "type": "string", + "description": "The URL of the target instance to move. This can be a full or partial URL. For example, the following are all valid URLs to an instance: \n- https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance \n- projects/project/zones/zone/instances/instance \n- zones/zone/instances/instance" + } + } + }, + "InstanceProperties": { + "id": "InstanceProperties", + "type": "object", + "description": "", + "properties": { + "canIpForward": { + "type": "boolean", + "description": "Enables instances created based on this template to send packets with source IP addresses other than their own and receive packets with destination IP addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, specify true. If unsure, leave this set to false. See the canIpForward documentation for more information." + }, + "description": { + "type": "string", + "description": "An optional text description for the instances that are created from this instance template." + }, + "disks": { + "type": "array", + "description": "An array of disks that are associated with the instances that are created from this template.", + "items": { + "$ref": "AttachedDisk" + } + }, + "machineType": { + "type": "string", + "description": "The machine type to use for instances that are created from this template.", + "annotations": { + "required": [ + "compute.instanceTemplates.insert" + ] + } + }, + "metadata": { + "$ref": "Metadata", + "description": "The metadata key/value pairs to assign to instances that are created from this template. These pairs can consist of custom metadata or predefined keys. See Project and instance metadata for more information." + }, + "networkInterfaces": { + "type": "array", + "description": "An array of network access configurations for this interface.", + "items": { + "$ref": "NetworkInterface" + } + }, + "scheduling": { + "$ref": "Scheduling", + "description": "Specifies the scheduling options for the instances that are created from this template." + }, + "serviceAccounts": { + "type": "array", + "description": "A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from this template. Use metadata queries to obtain the access tokens for these instances.", + "items": { + "$ref": "ServiceAccount" + } + }, + "tags": { + "$ref": "Tags", + "description": "A list of tags to apply to the instances that are created from this template. The tags identify valid sources or targets for network firewalls. The setTags method can modify this list of tags. Each tag within the list must comply with RFC1035." + } + } + }, + "InstanceReference": { + "id": "InstanceReference", + "type": "object", + "properties": { + "instance": { + "type": "string", + "description": "The URL for a specific instance." + } + } + }, + "InstanceTemplate": { + "id": "InstanceTemplate", + "type": "object", + "description": "An Instance Template resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] The creation timestamp for this instance template in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional text description for the instance template." + }, + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this instance template. The server defines this identifier.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceTemplate for instance templates.", + "default": "compute#instanceTemplate" + }, + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.instanceTemplates.insert" + ] + } + }, + "properties": { + "$ref": "InstanceProperties", + "description": "The instance properties for this instance template." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this instance template. The server defines this URL." + } + } + }, + "InstanceTemplateList": { + "id": "InstanceTemplateList", + "type": "object", + "description": "A list of instance templates.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this instance template. The server defines this identifier." + }, + "items": { + "type": "array", + "description": "[Output Only] list of InstanceTemplate resources.", + "items": { + "$ref": "InstanceTemplate" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceTemplatesListResponse for instance template lists.", + "default": "compute#instanceTemplateList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token that is used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this instance template list. The server defines this URL." + } + } + }, + "InstanceWithNamedPorts": { + "id": "InstanceWithNamedPorts", + "type": "object", + "properties": { + "instance": { + "type": "string", + "description": "[Output Only] The URL of the instance." + }, + "namedPorts": { + "type": "array", + "description": "[Output Only] The named ports that belong to this instance group.", + "items": { + "$ref": "NamedPort" + } + }, + "status": { + "type": "string", + "description": "[Output Only] The status of the instance.", + "enum": [ + "PROVISIONING", + "RUNNING", + "STAGING", + "STOPPED", + "STOPPING", + "SUSPENDED", + "SUSPENDING", + "TERMINATED" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "InstancesScopedList": { + "id": "InstancesScopedList", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "[Output Only] List of instances contained in this scope.", + "items": { + "$ref": "Instance" + } + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning which replaces the list of instances when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "License": { + "id": "License", + "type": "object", + "description": "A license resource.", + "properties": { + "chargesUseFee": { + "type": "boolean", + "description": "If true, the customer will be charged license fee for running software that contains this license on an instance." + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#license for licenses.", + "default": "compute#license" + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource. The name is 1-63 characters long and complies with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.images.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + } + } + }, + "MachineType": { + "id": "MachineType", + "type": "object", + "description": "A Machine Type resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "[Output Only] The deprecation status associated with this machine type." + }, + "description": { + "type": "string", + "description": "[Output Only] An optional textual description of the resource." + }, + "guestCpus": { + "type": "integer", + "description": "[Output Only] The tumber of CPUs exposed to the instance.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "imageSpaceGb": { + "type": "integer", + "description": "[Deprecated] This property is deprecated and will never be populated with any relevant values.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#machineType" + }, + "maximumPersistentDisks": { + "type": "integer", + "description": "[Output Only] Maximum persistent disks allowed.", + "format": "int32" + }, + "maximumPersistentDisksSizeGb": { + "type": "string", + "description": "[Output Only] Maximum total persistent disks size (GB) allowed.", + "format": "int64" + }, + "memoryMb": { + "type": "integer", + "description": "[Output Only] The amount of physical memory available to the instance, defined in MB.", + "format": "int32" + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "scratchDisks": { + "type": "array", + "description": "[Output Only] 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": "[Output Only] Server-defined URL for the resource." + }, + "zone": { + "type": "string", + "description": "[Output Only] The name of the zone where the machine type resides, such as us-central1-a." + } + } + }, + "MachineTypeAggregatedList": { + "id": "MachineTypeAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "object", + "description": "[Output Only] A map of scoped machine type lists.", + "additionalProperties": { + "$ref": "MachineTypesScopedList", + "description": "[Output Only] Name of the scope containing this set of machine types." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#machineTypeAggregatedList for aggregated lists of machine types.", + "default": "compute#machineTypeAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "MachineTypeList": { + "id": "MachineTypeList", + "type": "object", + "description": "Contains a list of Machine Type resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of Machine Type resources.", + "items": { + "$ref": "MachineType" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#machineTypeList for lists of machine types.", + "default": "compute#machineTypeList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "MachineTypesScopedList": { + "id": "MachineTypesScopedList", + "type": "object", + "properties": { + "machineTypes": { + "type": "array", + "description": "[Output Only] List of machine types contained in this scope.", + "items": { + "$ref": "MachineType" + } + }, + "warning": { + "type": "object", + "description": "[Output Only] An informational warning that appears when the machine types list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "ManagedInstance": { + "id": "ManagedInstance", + "type": "object", + "properties": { + "currentAction": { + "type": "string", + "description": "[Output Only] The current action that the managed instance group has scheduled for the instance. Possible values: \n- NONE The instance is running, and the managed instance group does not have any scheduled actions for this instance. \n- CREATING The managed instance group is creating this instance. \n- RECREATING The managed instance group is recreating this instance. \n- DELETING The managed instance group is permanently deleting this instance. \n- ABANDONING The managed instance group is abandoning this instance. The instance will be removed from the instance group and from any target pools that are associated with this group. \n- RESTARTING The managed instance group is restarting the instance. \n- REFRESHING The managed instance group is applying configuration changes to the instance without stopping it. For example, the group can update the target pool list for an instance without stopping that instance.", + "enum": [ + "ABANDONING", + "CREATING", + "DELETING", + "NONE", + "RECREATING", + "REFRESHING", + "RESTARTING" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "id": { + "type": "string", + "description": "[Output only] The unique identifier for this resource. This field is empty when instance does not exist.", + "format": "uint64" + }, + "instance": { + "type": "string", + "description": "[Output Only] The URL of the instance. The URL can exist even if the instance has not yet been created." + }, + "instanceStatus": { + "type": "string", + "description": "[Output Only] The status of the instance. This field is empty when the instance does not exist.", + "enum": [ + "PROVISIONING", + "RUNNING", + "STAGING", + "STOPPED", + "STOPPING", + "SUSPENDED", + "SUSPENDING", + "TERMINATED" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "lastAttempt": { + "$ref": "ManagedInstanceLastAttempt", + "description": "[Output Only] Information about the last attempt to create or delete the instance." + } + } + }, + "ManagedInstanceLastAttempt": { + "id": "ManagedInstanceLastAttempt", + "type": "object", + "properties": { + "errors": { + "type": "object", + "description": "[Output Only] Encountered errors during the last attempt to create or delete the instance.", + "properties": { + "errors": { + "type": "array", + "description": "[Output Only] The array of errors encountered while processing this operation.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The error type identifier for this error." + }, + "location": { + "type": "string", + "description": "[Output Only] Indicates the field in the request which caused the error. This property is optional." + }, + "message": { + "type": "string", + "description": "[Output Only] An optional, human-readable error message." + } + } + } + } + } + } + } + }, + "Metadata": { + "id": "Metadata", + "type": "object", + "description": "A metadata key/value entry.", + "properties": { + "fingerprint": { + "type": "string", + "description": "Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change 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": "[Output Only] Type of the resource. Always compute#metadata for metadata.", + "default": "compute#metadata" + } + } + }, + "NamedPort": { + "id": "NamedPort", + "type": "object", + "description": "The named port. For example: .", + "properties": { + "name": { + "type": "string", + "description": "The name for this named port. The name must be 1-63 characters long, and comply with RFC1035." + }, + "port": { + "type": "integer", + "description": "The port number, which can be a value between 1 and 65535.", + "format": "int32" + } + } + }, + "Network": { + "id": "Network", + "type": "object", + "description": "A network resource.", + "properties": { + "IPv4Range": { + "type": "string", + "description": "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}" + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource. Provided by the client when the resource is created." + }, + "gatewayIPv4": { + "type": "string", + "description": "A gateway address for default routing to other networks. This value is read only and is selected by the Google Compute Engine, typically as the first usable address in the IPv4Range.", + "pattern": "[0-9]{1,3}(?:\\.[0-9]{1,3}){3}" + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#network for networks.", + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.networks.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + } + } + }, + "NetworkInterface": { + "id": "NetworkInterface", + "type": "object", + "description": "A network interface resource attached to an instance.", + "properties": { + "accessConfigs": { + "type": "array", + "description": "An array of configurations for this interface. 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": "[Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc." + }, + "network": { + "type": "string", + "description": "URL of the network resource for this instance. This is required for creating an instance but optional when creating a firewall rule. If not specified when creating a firewall rule, the default network is used:\n\nglobal/networks/default \n\nIf you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: \n- https://www.googleapis.com/compute/v1/projects/project/global/networks/network \n- projects/project/global/networks/network \n- global/networks/default", + "annotations": { + "required": [ + "compute.instances.insert" + ] + } + }, + "networkIP": { + "type": "string", + "description": "[Output Only] An optional IPV4 internal network address assigned to the instance for this network interface." + } + } + }, + "NetworkList": { + "id": "NetworkList", + "type": "object", + "description": "Contains a list of Network resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of Network resources.", + "items": { + "$ref": "Network" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#networkList for lists of networks.", + "default": "compute#networkList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource ." + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "description": "An Operation resource, used to manage asynchronous API requests.", + "properties": { + "clientOperationId": { + "type": "string", + "description": "[Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all Operation resources in the project." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "endTime": { + "type": "string", + "description": "[Output Only] The time that this operation was completed. This is in RFC3339 text format." + }, + "error": { + "type": "object", + "description": "[Output Only] If errors are generated during processing of the operation, this field will be populated.", + "properties": { + "errors": { + "type": "array", + "description": "[Output Only] The array of errors encountered while processing this operation.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The error type identifier for this error." + }, + "location": { + "type": "string", + "description": "[Output Only] Indicates the field in the request which caused the error. This property is optional." + }, + "message": { + "type": "string", + "description": "[Output Only] An optional, human-readable error message." + } + } + } + } + } + }, + "httpErrorMessage": { + "type": "string", + "description": "[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND." + }, + "httpErrorStatusCode": { + "type": "integer", + "description": "[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as 404.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "[Output Only] The time that this operation was requested. This is in RFC3339 text format." + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#operation for Operation resources.", + "default": "compute#operation" + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource." + }, + "operationType": { + "type": "string", + "description": "[Output Only] Type of the operation, such as insert, compute.instanceGroups.update, or compute.instanceGroups.delete." + }, + "progress": { + "type": "integer", + "description": "[Output Only] 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 monotonically increase as the operation progresses.", + "format": "int32" + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where the operation resides. Only applicable for regional resources." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "startTime": { + "type": "string", + "description": "[Output Only] The time that this operation was started by the server. This is in RFC3339 text format." + }, + "status": { + "type": "string", + "description": "[Output Only] Status of the operation. Can be one of the following: PENDING, RUNNING, or DONE.", + "enum": [ + "DONE", + "PENDING", + "RUNNING" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "statusMessage": { + "type": "string", + "description": "[Output Only] An optional textual description of the current status of the operation." + }, + "targetId": { + "type": "string", + "description": "[Output Only] Unique target ID which identifies a particular incarnation of the target.", + "format": "uint64" + }, + "targetLink": { + "type": "string", + "description": "[Output Only] URL of the resource the operation is mutating." + }, + "user": { + "type": "string", + "description": "[Output Only] User who requested the operation, for example: user@example.com." + }, + "warnings": { + "type": "array", + "description": "[Output Only] If warning messages are generated during processing of the operation, this field will be populated.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + }, + "zone": { + "type": "string", + "description": "[Output Only] URL of the zone where the operation resides." + } + } + }, + "OperationAggregatedList": { + "id": "OperationAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "object", + "description": "[Output Only] A map of scoped operation lists.", + "additionalProperties": { + "$ref": "OperationsScopedList", + "description": "[Output Only] Name of the scope containing this set of operations." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#operationAggregatedList for aggregated lists of operations.", + "default": "compute#operationAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "OperationList": { + "id": "OperationList", + "type": "object", + "description": "Contains a list of Operation resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] The Operation resources.", + "items": { + "$ref": "Operation" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#operations for Operations resource.", + "default": "compute#operationList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncate." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "OperationsScopedList": { + "id": "OperationsScopedList", + "type": "object", + "properties": { + "operations": { + "type": "array", + "description": "[Output Only] List of operations contained in this scope.", + "items": { + "$ref": "Operation" + } + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning which replaces the list of operations when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] 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", + "description": "An optional textual description of the resource." + }, + "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 only be created in the Google Developers 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. See Custom metadata for more information." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource." + }, + "enabledFeatures": { + "type": "array", + "description": "Restricted features enabled for use on this project.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#project for projects.", + "default": "compute#project" + }, + "name": { + "type": "string", + "description": "Name of the resource." + }, + "quotas": { + "type": "array", + "description": "[Output Only] Quotas assigned to this project.", + "items": { + "$ref": "Quota" + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "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": "[Output Only] Quota limit for this metric.", + "format": "double" + }, + "metric": { + "type": "string", + "description": "[Output Only] Name of the quota metric.", + "enum": [ + "BACKEND_SERVICES", + "CPUS", + "DISKS_TOTAL_GB", + "FIREWALLS", + "FORWARDING_RULES", + "HEALTH_CHECKS", + "IMAGES", + "INSTANCES", + "INSTANCE_GROUPS", + "INSTANCE_GROUP_MANAGERS", + "INSTANCE_TEMPLATES", + "IN_USE_ADDRESSES", + "LOCAL_SSD_TOTAL_GB", + "NETWORKS", + "ROUTES", + "SNAPSHOTS", + "SSD_TOTAL_GB", + "STATIC_ADDRESSES", + "TARGET_HTTP_PROXIES", + "TARGET_INSTANCES", + "TARGET_POOLS", + "TARGET_VPN_GATEWAYS", + "URL_MAPS", + "VPN_TUNNELS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "usage": { + "type": "number", + "description": "[Output Only] Current usage of this metric.", + "format": "double" + } + } + }, + "Region": { + "id": "Region", + "type": "object", + "description": "Region resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "[Output Only] The deprecation status associated with this region." + }, + "description": { + "type": "string", + "description": "[Output Only] Textual description of the resource." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server .", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#region for regions.", + "default": "compute#region" + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource." + }, + "quotas": { + "type": "array", + "description": "[Output Only] Quotas assigned to this region.", + "items": { + "$ref": "Quota" + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "status": { + "type": "string", + "description": "[Output Only] Status of the region, either UP or DOWN.", + "enum": [ + "DOWN", + "UP" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "zones": { + "type": "array", + "description": "[Output Only] A list of zones available 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": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of Region resources.", + "items": { + "$ref": "Region" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#regionList for lists of regions.", + "default": "compute#regionList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "ResourceGroupReference": { + "id": "ResourceGroupReference", + "type": "object", + "properties": { + "group": { + "type": "string", + "description": "A URI referencing one of the resource views listed in the backend service." + } + } + }, + "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 instances by tag and the set of Routes for a particular instance is called its routing table. For each packet leaving a instance, the system searches that instance'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 nextHop field of the winning Route -- either to another instance destination, a instance gateway or a Google Compute Engien-operated gateway. Packets that do not match any Route in the sending instance's routing table are dropped.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource. Provided by the client when the resource is created." + }, + "destRange": { + "type": "string", + "description": "The destination range of outgoing packets that this route applies to.", + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of this resource. Always compute#routes for Route resources.", + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "network": { + "type": "string", + "description": "Fully-qualified URL of the network that this route applies to.", + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "nextHopGateway": { + "type": "string", + "description": "The URL to a gateway that should handle matching packets. Currently, this is only the internet gateway: projects/\u003cproject-id\u003e/global/gateways/default-internet-gateway" + }, + "nextHopInstance": { + "type": "string", + "description": "The fully-qualified URL to an instance that should handle matching packets. For example:\nhttps://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/" + }, + "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." + }, + "nextHopVpnTunnel": { + "type": "string", + "description": "The URL to a VpnTunnel that 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. Default value is 1000. A valid range is between 0 and 65535.", + "format": "uint32", + "annotations": { + "required": [ + "compute.routes.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined fully-qualified URL for this resource." + }, + "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": "[Output Only] If potential misconfigurations are detected for this route, this field will be populated with warning messages.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + } + }, + "RouteList": { + "id": "RouteList", + "type": "object", + "description": "Contains a list of route resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server." + }, + "items": { + "type": "array", + "description": "A list of Route resources.", + "items": { + "$ref": "Route" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#routeList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "Scheduling": { + "id": "Scheduling", + "type": "object", + "description": "Sets the scheduling options for an Instance.", + "properties": { + "automaticRestart": { + "type": "boolean", + "description": "Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the automatic restart option for standard instances. Preemptible instances cannot be automatically restarted." + }, + "onHostMaintenance": { + "type": "string", + "description": "Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and only possible behavior is TERMINATE. For more information, see Setting maintenance behavior.", + "enum": [ + "MIGRATE", + "TERMINATE" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "preemptible": { + "type": "boolean", + "description": "Whether the instance is preemptible." + } + } + }, + "SerialPortOutput": { + "id": "SerialPortOutput", + "type": "object", + "description": "An instance's serial console output.", + "properties": { + "contents": { + "type": "string", + "description": "[Output Only] The contents of the console output." + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#serialPortOutput for serial port output.", + "default": "compute#serialPortOutput" + }, + "selfLink": { + "type": "string", + "description": "[Output Only] 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." + }, + "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": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "diskSizeGb": { + "type": "string", + "description": "[Output Only] Size of the snapshot, specified in GB.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#snapshot for Snapshot resources.", + "default": "compute#snapshot" + }, + "licenses": { + "type": "array", + "description": "Public visible licenses.", + "items": { + "type": "string" + } + }, + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "sourceDisk": { + "type": "string", + "description": "The source disk used to create this snapshot." + }, + "sourceDiskId": { + "type": "string", + "description": "[Output Only] 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": "[Output Only] The status of the snapshot.", + "enum": [ + "CREATING", + "DELETING", + "FAILED", + "READY", + "UPLOADING" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "storageBytes": { + "type": "string", + "description": "[Output Only] 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": "[Output Only] 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 Snapshot resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server." + }, + "items": { + "type": "array", + "description": "A list of Snapshot resources.", + "items": { + "$ref": "Snapshot" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#snapshotList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "SslCertificate": { + "id": "SslCertificate", + "type": "object", + "description": "An SslCertificate resource. This resource provides a mechanism to upload an SSL key and certificate to global HTTPS loadbalancer to serve secure connections.", + "properties": { + "certificate": { + "type": "string", + "description": "A local certificate file. The certificate must be in PEM format. The certificate chain must be no greater than 5 certs long. The chain must include at least one intermediate cert." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource. Provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#sslCertificate for SSL certificates.", + "default": "compute#sslCertificate" + }, + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "privateKey": { + "type": "string", + "description": "A write-only private key in PEM format. Only insert RPCs will include this field." + }, + "selfLink": { + "type": "string", + "description": "[Output only] Server-defined URL for the resource." + } + } + }, + "SslCertificateList": { + "id": "SslCertificateList", + "type": "object", + "description": "Contains a list of SslCertificate resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server." + }, + "items": { + "type": "array", + "description": "A list of SslCertificate resources.", + "items": { + "$ref": "SslCertificate" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#sslCertificateList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "Tags": { + "id": "Tags", + "type": "object", + "description": "A set of instance tags.", + "properties": { + "fingerprint": { + "type": "string", + "description": "Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.\n\nTo see the latest fingerprint, make get() request to the instance.", + "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": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#operation for Operation resources.", + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "urlMap": { + "type": "string", + "description": "URL to the UrlMap resource that defines the mapping from URL to the BackendService." + } + } + }, + "TargetHttpProxyList": { + "id": "TargetHttpProxyList", + "type": "object", + "description": "A list of TargetHttpProxy resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of TargetHttpProxy resources.", + "items": { + "$ref": "TargetHttpProxy" + } + }, + "kind": { + "type": "string", + "description": "Type of resource. Always compute#targetHttpProxyList for lists of Target HTTP proxies.", + "default": "compute#targetHttpProxyList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "TargetHttpsProxiesSetSslCertificatesRequest": { + "id": "TargetHttpsProxiesSetSslCertificatesRequest", + "type": "object", + "properties": { + "sslCertificates": { + "type": "array", + "description": "New set of URLs to SslCertificate resources to associate with this TargetHttpProxy. Currently exactly one ssl certificate must be specified.", + "items": { + "type": "string" + } + } + } + }, + "TargetHttpsProxy": { + "id": "TargetHttpsProxy", + "type": "object", + "description": "A TargetHttpsProxy resource. This resource defines an HTTPS proxy.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource. Provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#targetHttpsProxy" + }, + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "sslCertificates": { + "type": "array", + "description": "URLs to SslCertificate resources that are used to authenticate connections to Backends. Currently exactly one SSL certificate must be specified.", + "items": { + "type": "string" + } + }, + "urlMap": { + "type": "string", + "description": "URL to the UrlMap resource that defines the mapping from URL to the BackendService." + } + } + }, + "TargetHttpsProxyList": { + "id": "TargetHttpsProxyList", + "type": "object", + "description": "Contains a list of TargetHttpsProxy resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of TargetHttpsProxy resources.", + "items": { + "$ref": "TargetHttpsProxy" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#targetHttpsProxyList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "TargetInstance": { + "id": "TargetInstance", + "type": "object", + "description": "A TargetInstance resource. This resource defines an endpoint instance that terminates traffic of certain protocols.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "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 instance. Currently only NO_NAT (default value) is supported.", + "enum": [ + "NO_NAT" + ], + "enumDescriptions": [ + "" + ] + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "zone": { + "type": "string", + "description": "[Output Only] URL of the zone where the target instance resides." + } + } + }, + "TargetInstanceAggregatedList": { + "id": "TargetInstanceAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "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": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "TargetInstanceList": { + "id": "TargetInstanceList", + "type": "object", + "description": "Contains a list of TargetInstance resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of TargetInstance resources.", + "items": { + "$ref": "TargetInstance" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#targetInstanceList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "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": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "TargetPool": { + "id": "TargetPool", + "type": "object", + "description": "A TargetPool resource. This resource defines a pool of instances, 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\nbackupPool and failoverRatio together define the fallback behavior of the primary target pool: if the ratio of the healthy instances 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 instances 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 instances with the best effort, or to all instances when no instance is healthy." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client 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 instances 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 instances 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 instances with the best effort, or to all instances when no instance is healthy.", + "format": "float" + }, + "healthChecks": { + "type": "array", + "description": "A list of URLs to the HttpHealthCheck resource. A member instance in this pool is considered healthy if and only if all specified health checks pass. An empty list means all member instances will be considered healthy at all times.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "instances": { + "type": "array", + "description": "A list of resource URLs to the member virtual machines 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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where the target pool resides." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "sessionAffinity": { + "type": "string", + "description": "Sesssion affinity option, must be one of the following values:\nNONE: Connections from the same client IP may go to any instance in the pool.\nCLIENT_IP: Connections from the same client IP will go to the same instance in the pool while that instance remains healthy.\nCLIENT_IP_PROTO: Connections from the same client IP with the same IP protocol will go to the same instance in the pool while that instance remains healthy.", + "enum": [ + "CLIENT_IP", + "CLIENT_IP_PROTO", + "NONE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "TargetPoolAggregatedList": { + "id": "TargetPoolAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server." + }, + "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": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "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": "[Output Only] Unique identifier for the resource. Defined by the server." + }, + "items": { + "type": "array", + "description": "A list of TargetPool resources.", + "items": { + "$ref": "TargetPool" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#targetPoolList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "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": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "TargetReference": { + "id": "TargetReference", + "type": "object", + "properties": { + "target": { + "type": "string" + } + } + }, + "TargetVpnGateway": { + "id": "TargetVpnGateway", + "type": "object", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource. Provided by the client when the resource is created." + }, + "forwardingRules": { + "type": "array", + "description": "[Output Only] A list of URLs to the ForwardingRule resources. ForwardingRules are created using compute.forwardingRules.insert and associated to a VPN gateway.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways.", + "default": "compute#targetVpnGateway" + }, + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.targetVpnGateways.insert" + ] + } + }, + "network": { + "type": "string", + "description": "URL of the network to which this VPN gateway is attached. Provided by the client when the VPN gateway is created.", + "annotations": { + "required": [ + "compute.targetVpnGateways.insert" + ] + } + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where the target VPN gateway resides." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "status": { + "type": "string", + "description": "[Output Only] The status of the VPN gateway.", + "enum": [ + "CREATING", + "DELETING", + "FAILED", + "READY" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "tunnels": { + "type": "array", + "description": "[Output Only] A list of URLs to VpnTunnel resources. VpnTunnels are created using compute.vpntunnels.insert and associated to a VPN gateway.", + "items": { + "type": "string" + } + } + } + }, + "TargetVpnGatewayAggregatedList": { + "id": "TargetVpnGatewayAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server." + }, + "items": { + "type": "object", + "description": "A map of scoped target vpn gateway lists.", + "additionalProperties": { + "$ref": "TargetVpnGatewaysScopedList", + "description": "[Output Only] Name of the scope containing this set of target vpn gateways." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways.", + "default": "compute#targetVpnGatewayAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + } + } + }, + "TargetVpnGatewayList": { + "id": "TargetVpnGatewayList", + "type": "object", + "description": "Contains a list of TargetVpnGateway resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of TargetVpnGateway resources.", + "items": { + "$ref": "TargetVpnGateway" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways.", + "default": "compute#targetVpnGatewayList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + } + } + }, + "TargetVpnGatewaysScopedList": { + "id": "TargetVpnGatewaysScopedList", + "type": "object", + "properties": { + "targetVpnGateways": { + "type": "array", + "description": "[Output Only] List of target vpn gateways contained in this scope.", + "items": { + "$ref": "TargetVpnGateway" + } + }, + "warning": { + "type": "object", + "description": "[Output Only] Informational warning which replaces the list of addresses when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "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": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "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": "[Output Only] Unique identifier for the resource. Set by the server.", + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "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": "[Output Only] Server-defined URL for the resource." + }, + "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": "[Output Only] Unique identifier for the resource. Set by the server." + }, + "items": { + "type": "array", + "description": "A list of UrlMap resources.", + "items": { + "$ref": "UrlMap" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#urlMapList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "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 just 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 bucketName. If not supplied, defaults to usage. The report is stored as a CSV file named report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the usage according to Pacific Time. If you supply a prefix, it should conform to Cloud Storage object naming conventions." + } + } + }, + "VpnTunnel": { + "id": "VpnTunnel", + "type": "object", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource. Provided by the client when the resource is created." + }, + "detailedStatus": { + "type": "string", + "description": "[Output Only] Detailed status message for the VPN tunnel." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server.", + "format": "uint64" + }, + "ikeVersion": { + "type": "integer", + "description": "IKE protocol version to use when establishing the VPN tunnel with peer VPN gateway. Acceptable IKE versions are 1 or 2. Default version is 2.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels.", + "default": "compute#vpnTunnel" + }, + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.vpnTunnels.insert" + ] + } + }, + "peerIp": { + "type": "string", + "description": "IP address of the peer VPN gateway." + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where the VPN tunnel resides." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "sharedSecret": { + "type": "string", + "description": "Shared secret used to set the secure session between the GCE VPN gateway and the peer VPN gateway." + }, + "sharedSecretHash": { + "type": "string", + "description": "Hash of the shared secret." + }, + "status": { + "type": "string", + "description": "[Output Only] The status of the VPN tunnel.", + "enum": [ + "AUTHORIZATION_ERROR", + "DEPROVISIONING", + "ESTABLISHED", + "FAILED", + "FIRST_HANDSHAKE", + "NEGOTIATION_FAILURE", + "NETWORK_ERROR", + "NO_INCOMING_PACKETS", + "PROVISIONING", + "REJECTED", + "WAITING_FOR_FULL_CONFIG" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "targetVpnGateway": { + "type": "string", + "description": "URL of the VPN gateway to which this VPN tunnel is associated. Provided by the client when the VPN tunnel is created.", + "annotations": { + "required": [ + "compute.vpnTunnels.insert" + ] + } + } + } + }, + "VpnTunnelAggregatedList": { + "id": "VpnTunnelAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "object", + "description": "[Output Only] A map of scoped vpn tunnel lists.", + "additionalProperties": { + "$ref": "VpnTunnelsScopedList", + "description": "Name of the scope containing this set of vpn tunnels." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels.", + "default": "compute#vpnTunnelAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "VpnTunnelList": { + "id": "VpnTunnelList", + "type": "object", + "description": "Contains a list of VpnTunnel resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of VpnTunnel resources.", + "items": { + "$ref": "VpnTunnel" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels.", + "default": "compute#vpnTunnelList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + } + } + }, + "VpnTunnelsScopedList": { + "id": "VpnTunnelsScopedList", + "type": "object", + "properties": { + "vpnTunnels": { + "type": "array", + "description": "List of vpn tunnels contained in this scope.", + "items": { + "$ref": "VpnTunnel" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of addresses when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] 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", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "Zone": { + "id": "Zone", + "type": "object", + "description": "A Zone resource.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "deprecated": { + "$ref": "DeprecationStatus", + "description": "[Output Only] The deprecation status associated with this zone." + }, + "description": { + "type": "string", + "description": "[Output Only] Textual description of the resource." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always kind#zone for zones.", + "default": "compute#zone" + }, + "maintenanceWindows": { + "type": "array", + "description": "[Output Only] Any scheduled maintenance windows for this zone. When the zone is in a maintenance window, all resources which reside in the zone will be unavailable. For more information, see Maintenance Windows", + "items": { + "type": "object", + "properties": { + "beginTime": { + "type": "string", + "description": "[Output Only] Starting time of the maintenance window, in RFC3339 format." + }, + "description": { + "type": "string", + "description": "[Output Only] Textual description of the maintenance window." + }, + "endTime": { + "type": "string", + "description": "[Output Only] Ending time of the maintenance window, in RFC3339 format." + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the maintenance window." + } + } + } + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource." + }, + "region": { + "type": "string", + "description": "[Output Only] Full URL reference to the region which hosts the zone." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "status": { + "type": "string", + "description": "[Output Only] Status of the zone, either UP or DOWN.", + "enum": [ + "DOWN", + "UP" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "ZoneList": { + "id": "ZoneList", + "type": "object", + "description": "Contains a list of zone resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of Zone resources.", + "items": { + "$ref": "Zone" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#zoneList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + } + }, + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the region for 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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the region for 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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the region for 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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the region for 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/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "autoscalers": { + "methods": { + "aggregatedList": { + "id": "compute.autoscalers.aggregatedList", + "path": "{project}/aggregated/autoscalers", + "httpMethod": "GET", + "description": "Retrieves the list of autoscalers grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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": "AutoscalerAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.autoscalers.delete", + "path": "{project}/zones/{zone}/autoscalers/{autoscaler}", + "httpMethod": "DELETE", + "description": "Deletes the specified autoscaler resource.", + "parameters": { + "autoscaler": { + "type": "string", + "description": "Name of the persistent autoscaler 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", + "autoscaler" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.autoscalers.get", + "path": "{project}/zones/{zone}/autoscalers/{autoscaler}", + "httpMethod": "GET", + "description": "Returns the specified autoscaler resource.", + "parameters": { + "autoscaler": { + "type": "string", + "description": "Name of the persistent autoscaler 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", + "autoscaler" + ], + "response": { + "$ref": "Autoscaler" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.autoscalers.insert", + "path": "{project}/zones/{zone}/autoscalers", + "httpMethod": "POST", + "description": "Creates an autoscaler 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": "Autoscaler" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.autoscalers.list", + "path": "{project}/zones/{zone}/autoscalers", + "httpMethod": "GET", + "description": "Retrieves the list of autoscaler resources contained within the specified zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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": "AutoscalerList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "patch": { + "id": "compute.autoscalers.patch", + "path": "{project}/zones/{zone}/autoscalers", + "httpMethod": "PATCH", + "description": "Updates an autoscaler resource in the specified project using the data included in the request. This method supports patch semantics.", + "parameters": { + "autoscaler": { + "type": "string", + "description": "Name of the autoscaler resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "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", + "autoscaler" + ], + "request": { + "$ref": "Autoscaler" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "update": { + "id": "compute.autoscalers.update", + "path": "{project}/zones/{zone}/autoscalers", + "httpMethod": "PUT", + "description": "Updates an autoscaler resource in the specified project using the data included in the request.", + "parameters": { + "autoscaler": { + "type": "string", + "description": "Name of the autoscaler resource to update.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "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" + ], + "request": { + "$ref": "Autoscaler" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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", + "description": "Creates a snapshot of this disk.", + "parameters": { + "disk": { + "type": "string", + "description": "Name of the persistent disk to snapshot.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots.", + "parameters": { + "disk": { + "type": "string", + "description": "Name of the persistent disk to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.disks.get", + "path": "{project}/zones/{zone}/disks/{disk}", + "httpMethod": "GET", + "description": "Returns a specified persistent disk.", + "parameters": { + "disk": { + "type": "string", + "description": "Name of the persistent disk to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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 in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.disks.list", + "path": "{project}/zones/{zone}/disks", + "httpMethod": "GET", + "description": "Retrieves the list of persistent disks contained within the specified zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + "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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + "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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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 Operations resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the Operations resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.globalOperations.get", + "path": "{project}/global/operations/{operation}", + "httpMethod": "GET", + "description": "Retrieves the specified Operations resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the Operations resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "httpsHealthChecks": { + "methods": { + "delete": { + "id": "compute.httpsHealthChecks.delete", + "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}", + "httpMethod": "DELETE", + "description": "Deletes the specified HttpsHealthCheck resource.", + "parameters": { + "httpsHealthCheck": { + "type": "string", + "description": "Name of the HttpsHealthCheck 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", + "httpsHealthCheck" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.httpsHealthChecks.get", + "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}", + "httpMethod": "GET", + "description": "Returns the specified HttpsHealthCheck resource.", + "parameters": { + "httpsHealthCheck": { + "type": "string", + "description": "Name of the HttpsHealthCheck 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", + "httpsHealthCheck" + ], + "response": { + "$ref": "HttpsHealthCheck" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.httpsHealthChecks.insert", + "path": "{project}/global/httpsHealthChecks", + "httpMethod": "POST", + "description": "Creates a HttpsHealthCheck 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": "HttpsHealthCheck" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.httpsHealthChecks.list", + "path": "{project}/global/httpsHealthChecks", + "httpMethod": "GET", + "description": "Retrieves the list of HttpsHealthCheck resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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": "HttpsHealthCheckList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "patch": { + "id": "compute.httpsHealthChecks.patch", + "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}", + "httpMethod": "PATCH", + "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.", + "parameters": { + "httpsHealthCheck": { + "type": "string", + "description": "Name of the HttpsHealthCheck 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", + "httpsHealthCheck" + ], + "request": { + "$ref": "HttpsHealthCheck" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "update": { + "id": "compute.httpsHealthChecks.update", + "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}", + "httpMethod": "PUT", + "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request.", + "parameters": { + "httpsHealthCheck": { + "type": "string", + "description": "Name of the HttpsHealthCheck 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", + "httpsHealthCheck" + ], + "request": { + "$ref": "HttpsHealthCheck" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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.\n\nIf an empty request 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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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 private images available to the specified project. Private images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 7. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud.\n\nSee Accessing images for more information.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "instanceGroupManagers": { + "methods": { + "abandonInstances": { + "id": "compute.instanceGroupManagers.abandonInstances", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances", + "httpMethod": "POST", + "description": "Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersAbandonInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "aggregatedList": { + "id": "compute.instanceGroupManagers.aggregatedList", + "path": "{project}/aggregated/instanceGroupManagers", + "httpMethod": "GET", + "description": "Retrieves the list of managed instance groups and groups them by zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "InstanceGroupManagerAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.instanceGroupManagers.delete", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}", + "httpMethod": "DELETE", + "description": "Deletes the specified managed instance group and all of the instances in that group.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group to delete.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "deleteInstances": { + "id": "compute.instanceGroupManagers.deleteInstances", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances", + "httpMethod": "POST", + "description": "Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersDeleteInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.instanceGroupManagers.get", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}", + "httpMethod": "GET", + "description": "Returns all of the details about the specified managed instance group.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "response": { + "$ref": "InstanceGroupManager" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.instanceGroupManagers.insert", + "path": "{project}/zones/{zone}/instanceGroupManagers", + "httpMethod": "POST", + "description": "Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method.", + "parameters": { + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where you want to create the managed instance group.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "request": { + "$ref": "InstanceGroupManager" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.instanceGroupManagers.list", + "path": "{project}/zones/{zone}/instanceGroupManagers", + "httpMethod": "GET", + "description": "Retrieves a list of managed instance groups that are contained within the specified project and zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "InstanceGroupManagerList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "listManagedInstances": { + "id": "compute.instanceGroupManagers.listManagedInstances", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances", + "httpMethod": "POST", + "description": "Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "response": { + "$ref": "InstanceGroupManagersListManagedInstancesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "recreateInstances": { + "id": "compute.instanceGroupManagers.recreateInstances", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances", + "httpMethod": "POST", + "description": "Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersRecreateInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "resize": { + "id": "compute.instanceGroupManagers.resize", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize", + "httpMethod": "POST", + "description": "Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "size": { + "type": "integer", + "description": "The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter.", + "required": true, + "format": "int32", + "location": "query" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager", + "size" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "setInstanceTemplate": { + "id": "compute.instanceGroupManagers.setInstanceTemplate", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate", + "httpMethod": "POST", + "description": "Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you recreate them.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersSetInstanceTemplateRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "setTargetPools": { + "id": "compute.instanceGroupManagers.setTargetPools", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools", + "httpMethod": "POST", + "description": "Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersSetTargetPoolsRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "instanceGroups": { + "methods": { + "addInstances": { + "id": "compute.instanceGroups.addInstances", + "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances", + "httpMethod": "POST", + "description": "Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. TODO: Change to comment to state \"if IG is load balanced.\"", + "parameters": { + "instanceGroup": { + "type": "string", + "description": "The name of the instance group where you are adding instances.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroup" + ], + "request": { + "$ref": "InstanceGroupsAddInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "aggregatedList": { + "id": "compute.instanceGroups.aggregatedList", + "path": "{project}/aggregated/instanceGroups", + "httpMethod": "GET", + "description": "Retrieves the list of instance groups and sorts them by zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "InstanceGroupAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.instanceGroups.delete", + "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}", + "httpMethod": "DELETE", + "description": "Deletes the specified instance group. The instances in the group are not deleted.", + "parameters": { + "instanceGroup": { + "type": "string", + "description": "The name of the instance group to delete.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroup" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.instanceGroups.get", + "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}", + "httpMethod": "GET", + "description": "Returns the specified instance group resource.", + "parameters": { + "instanceGroup": { + "type": "string", + "description": "The name of the instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroup" + ], + "response": { + "$ref": "InstanceGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.instanceGroups.insert", + "path": "{project}/zones/{zone}/instanceGroups", + "httpMethod": "POST", + "description": "Creates an instance group in the specified project using the parameters that are included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where you want to create the instance group.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "request": { + "$ref": "InstanceGroup" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.instanceGroups.list", + "path": "{project}/zones/{zone}/instanceGroups", + "httpMethod": "GET", + "description": "Retrieves the list of instance groups that are located in the specified project and zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "InstanceGroupList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "listInstances": { + "id": "compute.instanceGroups.listInstances", + "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances", + "httpMethod": "POST", + "description": "Lists the instances in the specified instance group.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "instanceGroup": { + "type": "string", + "description": "The name of the instance group from which you want to generate a list of included instances.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroup" + ], + "request": { + "$ref": "InstanceGroupsListInstancesRequest" + }, + "response": { + "$ref": "InstanceGroupsListInstances" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "removeInstances": { + "id": "compute.instanceGroups.removeInstances", + "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances", + "httpMethod": "POST", + "description": "Removes one or more instances from the specified instance group, but does not delete those instances.", + "parameters": { + "instanceGroup": { + "type": "string", + "description": "The name of the instance group where the specified instances will be removed.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroup" + ], + "request": { + "$ref": "InstanceGroupsRemoveInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "setNamedPorts": { + "id": "compute.instanceGroups.setNamedPorts", + "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts", + "httpMethod": "POST", + "description": "Sets the named ports for the specified instance group.", + "parameters": { + "instanceGroup": { + "type": "string", + "description": "The name of the instance group where the named ports are updated.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroup" + ], + "request": { + "$ref": "InstanceGroupsSetNamedPortsRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "instanceTemplates": { + "methods": { + "delete": { + "id": "compute.instanceTemplates.delete", + "path": "{project}/global/instanceTemplates/{instanceTemplate}", + "httpMethod": "DELETE", + "description": "Deletes the specified instance template.", + "parameters": { + "instanceTemplate": { + "type": "string", + "description": "The name of the instance template to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "instanceTemplate" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.instanceTemplates.get", + "path": "{project}/global/instanceTemplates/{instanceTemplate}", + "httpMethod": "GET", + "description": "Returns the specified instance template resource.", + "parameters": { + "instanceTemplate": { + "type": "string", + "description": "The name of the instance template.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "instanceTemplate" + ], + "response": { + "$ref": "InstanceTemplate" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.instanceTemplates.insert", + "path": "{project}/global/instanceTemplates", + "httpMethod": "POST", + "description": "Creates an instance template in the specified project using the data that is included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "InstanceTemplate" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.instanceTemplates.list", + "path": "{project}/global/instanceTemplates", + "httpMethod": "GET", + "description": "Retrieves a list of instance templates that are contained within the specified project and zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "InstanceTemplateList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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": "The instance name for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "networkInterface": { + "type": "string", + "description": "The name of the network interface to add to this instance.", + "required": true, + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "aggregatedList": { + "id": "compute.instances.aggregatedList", + "path": "{project}/aggregated/instances", + "httpMethod": "GET", + "description": "Retrieves aggregated list of instance resources.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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 ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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. For more information, see Shutting down an instance.", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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": "The name of the access config to delete.", + "required": true, + "location": "query" + }, + "instance": { + "type": "string", + "description": "The instance name for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "networkInterface": { + "type": "string", + "description": "The name of the network interface.", + "required": true, + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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 ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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" + }, + "port": { + "type": "integer", + "description": "Specifies which COM or serial port to retrieve data from.", + "default": "1", + "format": "int32", + "minimum": "1", + "maximum": "4", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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": "The device name of the disk to modify.", + "required": true, + "pattern": "\\w[\\w.-]{0,254}", + "location": "query" + }, + "instance": { + "type": "string", + "description": "The instance name.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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 ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "start": { + "id": "compute.instances.start", + "path": "{project}/zones/{zone}/instances/{instance}/start", + "httpMethod": "POST", + "description": "This method starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance resource to start.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "stop": { + "id": "compute.instances.stop", + "path": "{project}/zones/{zone}/instances/{instance}/stop", + "httpMethod": "POST", + "description": "This method stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine is using, such as persistent disks and static IP addresses,will continue to be charged until they are deleted. For more information, see Stopping an instance.", + "parameters": { + "instance": { + "type": "string", + "description": "Name of the instance resource to stop.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "licenses": { + "methods": { + "get": { + "id": "compute.licenses.get", + "path": "{project}/global/licenses/{license}", + "httpMethod": "GET", + "description": "Returns the specified license resource.", + "parameters": { + "license": { + "type": "string", + "description": "Name of the license resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "license" + ], + "response": { + "$ref": "License" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the zone for 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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "moveDisk": { + "id": "compute.projects.moveDisk", + "path": "{project}/moveDisk", + "httpMethod": "POST", + "description": "Moves a persistent disk from one zone to another.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "DiskMoveRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "moveInstance": { + "id": "compute.projects.moveInstance", + "path": "{project}/moveInstance", + "httpMethod": "POST", + "description": "Moves an instance and its attached persistent disks from one zone to another.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "InstanceMoveRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "setUsageExportBucket": { + "id": "compute.projects.setUsageExportBucket", + "path": "{project}/setUsageExportBucket", + "httpMethod": "POST", + "description": "Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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 Operations resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the Operations resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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 Operations resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the Operations resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + "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 Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot.\n\nFor more information, see Deleting snaphots.", + "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 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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.snapshots.get", + "path": "{project}/global/snapshots/{snapshot}", + "httpMethod": "GET", + "description": "Returns the specified 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 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/cloud-platform", + "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 Snapshot resources contained within the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "sslCertificates": { + "methods": { + "delete": { + "id": "compute.sslCertificates.delete", + "path": "{project}/global/sslCertificates/{sslCertificate}", + "httpMethod": "DELETE", + "description": "Deletes the specified SslCertificate 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" + }, + "sslCertificate": { + "type": "string", + "description": "Name of the SslCertificate resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "sslCertificate" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.sslCertificates.get", + "path": "{project}/global/sslCertificates/{sslCertificate}", + "httpMethod": "GET", + "description": "Returns the specified SslCertificate 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" + }, + "sslCertificate": { + "type": "string", + "description": "Name of the SslCertificate resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "sslCertificate" + ], + "response": { + "$ref": "SslCertificate" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.sslCertificates.insert", + "path": "{project}/global/sslCertificates", + "httpMethod": "POST", + "description": "Creates a SslCertificate 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": "SslCertificate" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.sslCertificates.list", + "path": "{project}/global/sslCertificates", + "httpMethod": "GET", + "description": "Retrieves the list of SslCertificate resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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": "SslCertificateList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + "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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "targetHttpsProxies": { + "methods": { + "delete": { + "id": "compute.targetHttpsProxies.delete", + "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}", + "httpMethod": "DELETE", + "description": "Deletes the specified TargetHttpsProxy 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" + }, + "targetHttpsProxy": { + "type": "string", + "description": "Name of the TargetHttpsProxy resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "targetHttpsProxy" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.targetHttpsProxies.get", + "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}", + "httpMethod": "GET", + "description": "Returns the specified TargetHttpsProxy 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" + }, + "targetHttpsProxy": { + "type": "string", + "description": "Name of the TargetHttpsProxy resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "targetHttpsProxy" + ], + "response": { + "$ref": "TargetHttpsProxy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.targetHttpsProxies.insert", + "path": "{project}/global/targetHttpsProxies", + "httpMethod": "POST", + "description": "Creates a TargetHttpsProxy 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": "TargetHttpsProxy" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.targetHttpsProxies.list", + "path": "{project}/global/targetHttpsProxies", + "httpMethod": "GET", + "description": "Retrieves the list of TargetHttpsProxy resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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": "TargetHttpsProxyList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "setSslCertificates": { + "id": "compute.targetHttpsProxies.setSslCertificates", + "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates", + "httpMethod": "POST", + "description": "Replaces SslCertificates for TargetHttpsProxy.", + "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" + }, + "targetHttpsProxy": { + "type": "string", + "description": "Name of the TargetHttpsProxy 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", + "targetHttpsProxy" + ], + "request": { + "$ref": "TargetHttpsProxiesSetSslCertificatesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "setUrlMap": { + "id": "compute.targetHttpsProxies.setUrlMap", + "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap", + "httpMethod": "POST", + "description": "Changes the URL map for TargetHttpsProxy.", + "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" + }, + "targetHttpsProxy": { + "type": "string", + "description": "Name of the TargetHttpsProxy 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", + "targetHttpsProxy" + ], + "request": { + "$ref": "UrlMapReference" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "targetVpnGateways": { + "methods": { + "aggregatedList": { + "id": "compute.targetVpnGateways.aggregatedList", + "path": "{project}/aggregated/targetVpnGateways", + "httpMethod": "GET", + "description": "Retrieves the list of target VPN gateways grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "TargetVpnGatewayAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.targetVpnGateways.delete", + "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}", + "httpMethod": "DELETE", + "description": "Deletes the specified TargetVpnGateway resource.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetVpnGateway": { + "type": "string", + "description": "Name of the TargetVpnGateway resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetVpnGateway" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.targetVpnGateways.get", + "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}", + "httpMethod": "GET", + "description": "Returns the specified TargetVpnGateway resource.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "targetVpnGateway": { + "type": "string", + "description": "Name of the TargetVpnGateway resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "targetVpnGateway" + ], + "response": { + "$ref": "TargetVpnGateway" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.targetVpnGateways.insert", + "path": "{project}/regions/{region}/targetVpnGateways", + "httpMethod": "POST", + "description": "Creates a TargetVpnGateway resource in the specified project and region using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "request": { + "$ref": "TargetVpnGateway" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.targetVpnGateways.list", + "path": "{project}/regions/{region}/targetVpnGateways", + "httpMethod": "GET", + "description": "Retrieves the list of TargetVpnGateway resources available to the specified project and region.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "response": { + "$ref": "TargetVpnGatewayList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "vpnTunnels": { + "methods": { + "aggregatedList": { + "id": "compute.vpnTunnels.aggregatedList", + "path": "{project}/aggregated/vpnTunnels", + "httpMethod": "GET", + "description": "Retrieves the list of VPN tunnels grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "VpnTunnelAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.vpnTunnels.delete", + "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}", + "httpMethod": "DELETE", + "description": "Deletes the specified VpnTunnel resource.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "vpnTunnel": { + "type": "string", + "description": "Name of the VpnTunnel resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "vpnTunnel" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.vpnTunnels.get", + "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}", + "httpMethod": "GET", + "description": "Returns the specified VpnTunnel resource.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "vpnTunnel": { + "type": "string", + "description": "Name of the VpnTunnel resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region", + "vpnTunnel" + ], + "response": { + "$ref": "VpnTunnel" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.vpnTunnels.insert", + "path": "{project}/regions/{region}/vpnTunnels", + "httpMethod": "POST", + "description": "Creates a VpnTunnel resource in the specified project and region using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "request": { + "$ref": "VpnTunnel" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.vpnTunnels.list", + "path": "{project}/regions/{region}/vpnTunnels", + "httpMethod": "GET", + "description": "Retrieves the list of VpnTunnel resources contained in the specified project and region.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "The name of the region for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "region" + ], + "response": { + "$ref": "VpnTunnelList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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 Operations resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the Operations resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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 Operations resource.", + "parameters": { + "operation": { + "type": "string", + "description": "Name of the Operations resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "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": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/compute/v1/compute-gen.go b/Godeps/_workspace/src/google.golang.org/api/compute/v1/compute-gen.go new file mode 100644 index 000000000..55e1fdfee --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/compute/v1/compute-gen.go @@ -0,0 +1,37418 @@ +// Package compute provides access to the Compute Engine API. +// +// See https://developers.google.com/compute/docs/reference/latest/ +// +// Usage example: +// +// import "google.golang.org/api/compute/v1" +// ... +// computeService, err := compute.New(oauthHttpClient) +package compute // import "google.golang.org/api/compute/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 data across Google Cloud Platform services + CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" + + // 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 + DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control" + + // View your data in Google Cloud Storage + DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only" + + // Manage your data in Google Cloud Storage + DevstorageReadWriteScope = "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.Autoscalers = NewAutoscalersService(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.HttpsHealthChecks = NewHttpsHealthChecksService(s) + s.Images = NewImagesService(s) + s.InstanceGroupManagers = NewInstanceGroupManagersService(s) + s.InstanceGroups = NewInstanceGroupsService(s) + s.InstanceTemplates = NewInstanceTemplatesService(s) + s.Instances = NewInstancesService(s) + s.Licenses = NewLicensesService(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.SslCertificates = NewSslCertificatesService(s) + s.TargetHttpProxies = NewTargetHttpProxiesService(s) + s.TargetHttpsProxies = NewTargetHttpsProxiesService(s) + s.TargetInstances = NewTargetInstancesService(s) + s.TargetPools = NewTargetPoolsService(s) + s.TargetVpnGateways = NewTargetVpnGatewaysService(s) + s.UrlMaps = NewUrlMapsService(s) + s.VpnTunnels = NewVpnTunnelsService(s) + s.ZoneOperations = NewZoneOperationsService(s) + s.Zones = NewZonesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Addresses *AddressesService + + Autoscalers *AutoscalersService + + BackendServices *BackendServicesService + + DiskTypes *DiskTypesService + + Disks *DisksService + + Firewalls *FirewallsService + + ForwardingRules *ForwardingRulesService + + GlobalAddresses *GlobalAddressesService + + GlobalForwardingRules *GlobalForwardingRulesService + + GlobalOperations *GlobalOperationsService + + HttpHealthChecks *HttpHealthChecksService + + HttpsHealthChecks *HttpsHealthChecksService + + Images *ImagesService + + InstanceGroupManagers *InstanceGroupManagersService + + InstanceGroups *InstanceGroupsService + + InstanceTemplates *InstanceTemplatesService + + Instances *InstancesService + + Licenses *LicensesService + + MachineTypes *MachineTypesService + + Networks *NetworksService + + Projects *ProjectsService + + RegionOperations *RegionOperationsService + + Regions *RegionsService + + Routes *RoutesService + + Snapshots *SnapshotsService + + SslCertificates *SslCertificatesService + + TargetHttpProxies *TargetHttpProxiesService + + TargetHttpsProxies *TargetHttpsProxiesService + + TargetInstances *TargetInstancesService + + TargetPools *TargetPoolsService + + TargetVpnGateways *TargetVpnGatewaysService + + UrlMaps *UrlMapsService + + VpnTunnels *VpnTunnelsService + + ZoneOperations *ZoneOperationsService + + Zones *ZonesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAddressesService(s *Service) *AddressesService { + rs := &AddressesService{s: s} + return rs +} + +type AddressesService struct { + s *Service +} + +func NewAutoscalersService(s *Service) *AutoscalersService { + rs := &AutoscalersService{s: s} + return rs +} + +type AutoscalersService 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 NewHttpsHealthChecksService(s *Service) *HttpsHealthChecksService { + rs := &HttpsHealthChecksService{s: s} + return rs +} + +type HttpsHealthChecksService struct { + s *Service +} + +func NewImagesService(s *Service) *ImagesService { + rs := &ImagesService{s: s} + return rs +} + +type ImagesService struct { + s *Service +} + +func NewInstanceGroupManagersService(s *Service) *InstanceGroupManagersService { + rs := &InstanceGroupManagersService{s: s} + return rs +} + +type InstanceGroupManagersService struct { + s *Service +} + +func NewInstanceGroupsService(s *Service) *InstanceGroupsService { + rs := &InstanceGroupsService{s: s} + return rs +} + +type InstanceGroupsService struct { + s *Service +} + +func NewInstanceTemplatesService(s *Service) *InstanceTemplatesService { + rs := &InstanceTemplatesService{s: s} + return rs +} + +type InstanceTemplatesService struct { + s *Service +} + +func NewInstancesService(s *Service) *InstancesService { + rs := &InstancesService{s: s} + return rs +} + +type InstancesService struct { + s *Service +} + +func NewLicensesService(s *Service) *LicensesService { + rs := &LicensesService{s: s} + return rs +} + +type LicensesService 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 NewSslCertificatesService(s *Service) *SslCertificatesService { + rs := &SslCertificatesService{s: s} + return rs +} + +type SslCertificatesService struct { + s *Service +} + +func NewTargetHttpProxiesService(s *Service) *TargetHttpProxiesService { + rs := &TargetHttpProxiesService{s: s} + return rs +} + +type TargetHttpProxiesService struct { + s *Service +} + +func NewTargetHttpsProxiesService(s *Service) *TargetHttpsProxiesService { + rs := &TargetHttpsProxiesService{s: s} + return rs +} + +type TargetHttpsProxiesService 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 NewTargetVpnGatewaysService(s *Service) *TargetVpnGatewaysService { + rs := &TargetVpnGatewaysService{s: s} + return rs +} + +type TargetVpnGatewaysService struct { + s *Service +} + +func NewUrlMapsService(s *Service) *UrlMapsService { + rs := &UrlMapsService{s: s} + return rs +} + +type UrlMapsService struct { + s *Service +} + +func NewVpnTunnelsService(s *Service) *VpnTunnelsService { + rs := &VpnTunnelsService{s: s} + return rs +} + +type VpnTunnelsService 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 +} + +// AccessConfig: An access configuration attached to an instance's +// network interface. +type AccessConfig struct { + // Kind: [Output Only] Type of the resource. Always compute#accessConfig + // for access configs. + 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 external IP address available to the project or + // leave this field undefined to use an IP from a shared ephemeral IP + // address pool. If you specify a static external IP address, it must + // live in the same region as the zone of the instance. + NatIP string `json:"natIP,omitempty"` + + // Type: The type of configuration. The default and only option is + // ONE_TO_ONE_NAT. + // + // Possible values: + // "ONE_TO_ONE_NAT" (default) + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccessConfig) MarshalJSON() ([]byte, error) { + type noMethod AccessConfig + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Address: A reserved address resource. +type Address struct { + // Address: The static external IP address represented by this resource. + Address string `json:"address,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always compute#address for + // addresses. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // Region: [Output Only] URL of the region where the regional address + // resides. This field is not applicable to global addresses. + Region string `json:"region,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // Status: [Output Only] The status of the address, which can be either + // IN_USE or RESERVED. An address that is RESERVED is currently reserved + // and available to use. An IN_USE address is currently being used by + // another resource and is not available. + // + // Possible values: + // "IN_USE" + // "RESERVED" + Status string `json:"status,omitempty"` + + // Users: [Output Only] The URLs of the resources that are using this + // address. + Users []string `json:"users,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Address") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Address) MarshalJSON() ([]byte, error) { + type noMethod Address + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AddressAggregatedList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A map of scoped address lists. + Items map[string]AddressesScopedList `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always + // compute#addressAggregatedList for aggregated lists of addresses. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AddressAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod AddressAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AddressList: Contains a list of address resources. +type AddressList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of Address resources. + Items []*Address `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#addressList for + // lists of addresses. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AddressList) MarshalJSON() ([]byte, error) { + type noMethod AddressList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AddressesScopedList struct { + // Addresses: [Output Only] List of addresses contained in this scope. + Addresses []*Address `json:"addresses,omitempty"` + + // Warning: [Output Only] Informational warning which replaces the list + // of addresses when the list is empty. + Warning *AddressesScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Addresses") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AddressesScopedList) MarshalJSON() ([]byte, error) { + type noMethod AddressesScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AddressesScopedListWarning: [Output Only] Informational warning which +// replaces the list of addresses when the list is empty. +type AddressesScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*AddressesScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AddressesScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod AddressesScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AddressesScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AddressesScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod AddressesScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AttachedDisk: An instance-attached disk resource. +type AttachedDisk struct { + // AutoDelete: Specifies 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. The virtual machine will + // use the first partition of the disk for its root filesystem. + Boot bool `json:"boot,omitempty"` + + // DeviceName: Specifies a unique device name of your choice that is + // reflected into the /dev/disk/by-id/google-* tree of a Linux operating + // system running within the instance. This name can be used to + // reference the device for mounting, resizing, and so on, from within + // the instance. + // + // If not specified, the server chooses a default device name to apply + // to this disk, in the form persistent-disks-x, where x is a number + // assigned by Google Compute Engine. This field is only applicable for + // persistent disks. + DeviceName string `json:"deviceName,omitempty"` + + // Index: Assigns a zero-based index to this disk, where 0 is reserved + // for the boot disk. For example, if you have many disks attached to an + // instance, each disk would have a unique index number. If not + // specified, the server will choose an appropriate value. + Index int64 `json:"index,omitempty"` + + // InitializeParams: [Input Only] Specifies the parameters for a new + // disk that will be created alongside the new instance. Use + // initialization parameters to create boot disks or local SSDs attached + // to the new instance. + // + // This property is mutually exclusive with the source property; you can + // only define one or the other, but not both. + InitializeParams *AttachedDiskInitializeParams `json:"initializeParams,omitempty"` + + // Interface: Specifies the disk interface to use for attaching this + // disk, either SCSI or NVME. The default is SCSI. For performance + // characteristics of SCSI over NVMe, see Local SSD performance. + // + // Possible values: + // "NVME" + // "SCSI" + Interface string `json:"interface,omitempty"` + + // Kind: [Output Only] Type of the resource. Always compute#attachedDisk + // for attached disks. + Kind string `json:"kind,omitempty"` + + // Licenses: [Output Only] Any valid publicly visible licenses. + Licenses []string `json:"licenses,omitempty"` + + // Mode: The mode in which to attach this disk, either READ_WRITE or + // READ_ONLY. If not specified, the default is to attach the disk in + // READ_WRITE mode. + // + // Possible values: + // "READ_ONLY" + // "READ_WRITE" + Mode string `json:"mode,omitempty"` + + // Source: Specifies a valid partial or full URL to an existing + // Persistent Disk resource. This field is only applicable for + // persistent disks. + Source string `json:"source,omitempty"` + + // Type: Specifies the type of the disk, either SCRATCH or PERSISTENT. + // If not specified, the default is PERSISTENT. + // + // Possible values: + // "PERSISTENT" + // "SCRATCH" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AutoDelete") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AttachedDisk) MarshalJSON() ([]byte, error) { + type noMethod AttachedDisk + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AttachedDiskInitializeParams: [Input Only] Specifies the parameters +// for a new disk that will be created alongside the new instance. Use +// initialization parameters to create boot disks or local SSDs attached +// to the new instance. +// +// This property is mutually exclusive with the source property; you can +// only define one or the other, but not both. +type AttachedDiskInitializeParams struct { + // DiskName: Specifies the disk name. If not specified, the default is + // to use the name of the instance. + DiskName string `json:"diskName,omitempty"` + + // DiskSizeGb: Specifies the size of the disk in base-2 GB. + DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"` + + // DiskType: Specifies the disk type to use to create the instance. If + // not specified, the default is pd-standard, specified using the full + // URL. For + // example: + // + // https://www.googleapis.com/compute/v1/projects/project/zones + // /zone/diskTypes/pd-standard + // + // Other values include pd-ssd and local-ssd. If you define this field, + // you can provide either the full or partial URL. For example, the + // following are valid values: + // - + // https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType + // - projects/project/zones/zone/diskTypes/diskType + // - zones/zone/diskTypes/diskType + DiskType string `json:"diskType,omitempty"` + + // SourceImage: A source image used to create the disk. You can provide + // a private (custom) image, and Compute Engine will use the + // corresponding image from your project. For + // example: + // + // global/images/my-private-image + // + // Or you can provide an image from a publicly-available project. For + // example, to use a Debian image from the debian-cloud project, make + // sure to include the project in the + // URL: + // + // projects/debian-cloud/global/images/debian-7-wheezy-vYYYYMMDD + // + // where vYYYYMMDD is the image version. The fully-qualified URL will + // also work in both cases. + SourceImage string `json:"sourceImage,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DiskName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AttachedDiskInitializeParams) MarshalJSON() ([]byte, error) { + type noMethod AttachedDiskInitializeParams + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Autoscaler struct { + // AutoscalingPolicy: Autoscaling configuration. + AutoscalingPolicy *AutoscalingPolicy `json:"autoscalingPolicy,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource; defined by the + // server. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // Target: URL of Instance Group Manager or Replica Pool which will be + // controlled by Autoscaler. + Target string `json:"target,omitempty"` + + // Zone: [Output Only] URL of the zone where the instance group resides. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AutoscalingPolicy") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Autoscaler) MarshalJSON() ([]byte, error) { + type noMethod Autoscaler + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AutoscalerAggregatedList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A map of scoped autoscaler lists. + Items map[string]AutoscalersScopedList `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalerAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod AutoscalerAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AutoscalerList: Contains a list of persistent autoscaler resources. +type AutoscalerList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of Autoscaler resources. + Items []*Autoscaler `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalerList) MarshalJSON() ([]byte, error) { + type noMethod AutoscalerList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AutoscalersScopedList struct { + // Autoscalers: List of autoscalers contained in this scope. + Autoscalers []*Autoscaler `json:"autoscalers,omitempty"` + + // Warning: Informational warning which replaces the list of autoscalers + // when the list is empty. + Warning *AutoscalersScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Autoscalers") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalersScopedList) MarshalJSON() ([]byte, error) { + type noMethod AutoscalersScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AutoscalersScopedListWarning: Informational warning which replaces +// the list of autoscalers when the list is empty. +type AutoscalersScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*AutoscalersScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalersScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod AutoscalersScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AutoscalersScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalersScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod AutoscalersScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AutoscalingPolicy: Cloud Autoscaler policy. +type AutoscalingPolicy struct { + // CoolDownPeriodSec: The number of seconds that the Autoscaler should + // wait between two succeeding changes to the number of virtual + // machines. You should define an interval that is at least as long as + // the initialization time of a virtual machine and the time it may take + // for replica pool to create the virtual machine. The default is 60 + // seconds. + CoolDownPeriodSec int64 `json:"coolDownPeriodSec,omitempty"` + + // CpuUtilization: TODO(jbartosik): Add support for scaling based on + // muliple utilization metrics (take max recommendation). Exactly one + // utilization policy should be provided. Configuration parameters of + // CPU based autoscaling policy. + CpuUtilization *AutoscalingPolicyCpuUtilization `json:"cpuUtilization,omitempty"` + + // CustomMetricUtilizations: Configuration parameters of autoscaling + // based on custom metric. + CustomMetricUtilizations []*AutoscalingPolicyCustomMetricUtilization `json:"customMetricUtilizations,omitempty"` + + // LoadBalancingUtilization: Configuration parameters of autoscaling + // based on load balancer. + LoadBalancingUtilization *AutoscalingPolicyLoadBalancingUtilization `json:"loadBalancingUtilization,omitempty"` + + // MaxNumReplicas: The maximum number of replicas that the Autoscaler + // can scale up to. This field is required for config to be effective. + // Maximum number of replicas should be not lower than minimal number of + // replicas. Absolute limit for this value is defined in Autoscaler + // backend. + MaxNumReplicas int64 `json:"maxNumReplicas,omitempty"` + + // MinNumReplicas: The minimum number of replicas that the Autoscaler + // can scale down to. Can't be less than 0. If not provided Autoscaler + // will choose default value depending on maximal number of replicas. + MinNumReplicas int64 `json:"minNumReplicas,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CoolDownPeriodSec") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalingPolicy) MarshalJSON() ([]byte, error) { + type noMethod AutoscalingPolicy + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AutoscalingPolicyCpuUtilization: CPU utilization policy. +type AutoscalingPolicyCpuUtilization struct { + // UtilizationTarget: The target utilization that the Autoscaler should + // maintain. It is represented as a fraction of used cores. For example: + // 6 cores used in 8-core VM are represented here as 0.75. Must be a + // float value between (0, 1]. If not defined, the default is 0.8. + UtilizationTarget float64 `json:"utilizationTarget,omitempty"` + + // ForceSendFields is a list of field names (e.g. "UtilizationTarget") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalingPolicyCpuUtilization) MarshalJSON() ([]byte, error) { + type noMethod AutoscalingPolicyCpuUtilization + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AutoscalingPolicyCustomMetricUtilization: Custom utilization metric +// policy. +type AutoscalingPolicyCustomMetricUtilization struct { + // Metric: Identifier of the metric. It should be a Cloud Monitoring + // metric. The metric can not have negative values. The metric should be + // an utilization metric (increasing number of VMs handling requests x + // times should reduce average value of the metric roughly x times). For + // example you could use: + // compute.googleapis.com/instance/network/received_bytes_count. + Metric string `json:"metric,omitempty"` + + // UtilizationTarget: Target value of the metric which Autoscaler should + // maintain. Must be a positive value. + UtilizationTarget float64 `json:"utilizationTarget,omitempty"` + + // UtilizationTargetType: Defines type in which utilization_target is + // expressed. + // + // Possible values: + // "DELTA_PER_MINUTE" + // "DELTA_PER_SECOND" + // "GAUGE" + UtilizationTargetType string `json:"utilizationTargetType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Metric") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalingPolicyCustomMetricUtilization) MarshalJSON() ([]byte, error) { + type noMethod AutoscalingPolicyCustomMetricUtilization + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AutoscalingPolicyLoadBalancingUtilization: Load balancing utilization +// policy. +type AutoscalingPolicyLoadBalancingUtilization struct { + // UtilizationTarget: Fraction of backend capacity utilization (set in + // HTTP load balancing configuration) that Autoscaler should maintain. + // Must be a positive float value. If not defined, the default is 0.8. + // For example if your maxRatePerInstance capacity (in HTTP Load + // Balancing configuration) is set at 10 and you would like to keep + // number of instances such that each instance receives 7 QPS on + // average, set this to 0.7. + UtilizationTarget float64 `json:"utilizationTarget,omitempty"` + + // ForceSendFields is a list of field names (e.g. "UtilizationTarget") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalingPolicyLoadBalancingUtilization) MarshalJSON() ([]byte, error) { + type noMethod AutoscalingPolicyLoadBalancingUtilization + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Backend: Message containing information of one individual backend. +type Backend struct { + // BalancingMode: Specifies the balancing mode for this backend. The + // default is UTILIZATION but available values are UTILIZATION and RATE. + // + // Possible values: + // "RATE" + // "UTILIZATION" + BalancingMode string `json:"balancingMode,omitempty"` + + // CapacityScaler: A multiplier applied to the group's maximum servicing + // capacity (either UTILIZATION or RATE). Default value is 1, which + // means the group will serve up to 100% of its configured CPU or RPS + // (depending on balancingMode). A setting of 0 means the group is + // completely drained, offering 0% of its available CPU or RPS. Valid + // range is [0.0,1.0]. + CapacityScaler float64 `json:"capacityScaler,omitempty"` + + // Description: An optional textual description of the resource. + // Provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Group: The fully-qualified URL of a zonal Instance Group resource. + // This instance group defines the list of instances that serve traffic. + // Member virtual machine instances from each instance group must live + // in the same zone as the instance group itself. No two backends in a + // backend service are allowed to use same Instance Group + // resource. + // + // Note that you must specify an Instance Group resource using the + // fully-qualified URL, rather than a partial URL. + 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.0, 1.0]. + MaxUtilization float64 `json:"maxUtilization,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BalancingMode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Backend) MarshalJSON() ([]byte, error) { + type noMethod Backend + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BackendService: A BackendService resource. This resource defines a +// group of backend virtual machines together with their serving +// capacity. +type BackendService struct { + // Backends: The list of backends that serve this BackendService. + Backends []*Backend `json:"backends,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of resource. Always compute#backendService + // for backend services. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // Port: Deprecated in favor of port name. The TCP port to connect on + // the backend. The default value is 80. + Port int64 `json:"port,omitempty"` + + // PortName: Name of backend port. The same name should appear in the + // resource views referenced by this service. Required. + PortName string `json:"portName,omitempty"` + + // Possible values: + // "HTTP" + // "HTTPS" + Protocol string `json:"protocol,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Backends") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BackendService) MarshalJSON() ([]byte, error) { + type noMethod BackendService + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type BackendServiceGroupHealth struct { + HealthStatus []*HealthStatus `json:"healthStatus,omitempty"` + + // Kind: [Output Only] Type of resource. Always + // compute#backendServiceGroupHealth for the health of backend services. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "HealthStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BackendServiceGroupHealth) MarshalJSON() ([]byte, error) { + type noMethod BackendServiceGroupHealth + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BackendServiceList: Contains a list of BackendService resources. +type BackendServiceList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of BackendService resources. + Items []*BackendService `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always + // compute#backendServiceList for lists of backend services. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BackendServiceList) MarshalJSON() ([]byte, error) { + type noMethod BackendServiceList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DeprecationStatus: Deprecation status for a public resource. +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: The URL of the suggested replacement for a deprecated + // resource. The suggested replacement resource must be the same kind of + // resource as the deprecated resource. + Replacement string `json:"replacement,omitempty"` + + // State: The deprecation state of this resource. This 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. Operations which use OBSOLETE or DELETED resources + // will be rejected and result in an error. + // + // Possible values: + // "DELETED" + // "DEPRECATED" + // "OBSOLETE" + State string `json:"state,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Deleted") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeprecationStatus) MarshalJSON() ([]byte, error) { + type noMethod DeprecationStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Disk: A Disk resource. +type Disk struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always compute#disk for + // disks. + Kind string `json:"kind,omitempty"` + + // LastAttachTimestamp: [Output Only] Last attach timestamp in RFC3339 + // text format. + LastAttachTimestamp string `json:"lastAttachTimestamp,omitempty"` + + // LastDetachTimestamp: [Output Only] Last detach timestamp in RFC3339 + // text format. + LastDetachTimestamp string `json:"lastDetachTimestamp,omitempty"` + + // Licenses: Any applicable publicly visible licenses. + Licenses []string `json:"licenses,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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // Options: Internal use only. + Options string `json:"options,omitempty"` + + // SelfLink: [Output Only] Server-defined fully-qualified URL for this + // resource. + SelfLink string `json:"selfLink,omitempty"` + + // SizeGb: Size of the persistent disk, specified in GB. You can specify + // this field when creating a persistent disk using the sourceImage or + // sourceSnapshot parameter, or specify it alone to create an empty + // persistent disk. + // + // If you specify this field along with sourceImage or sourceSnapshot, + // the value of sizeGb must not be less than the size of the sourceImage + // or the size of the snapshot. + SizeGb int64 `json:"sizeGb,omitempty,string"` + + // SourceImage: The source image used to create this disk. If the source + // image is deleted from the system, this field will not be set, even if + // an image with the same name has been re-created. + // + // When creating a disk, you can provide a private (custom) image using + // the following input, and Compute Engine will use the corresponding + // image from your project. For example: + // + // global/images/my-private-image + // + // Or you can provide an image from a publicly-available project. For + // example, to use a Debian image from the debian-cloud project, make + // sure to include the project in the + // URL: + // + // projects/debian-cloud/global/images/debian-7-wheezy-vYYYYMMDD + // + // where vYYYYMMDD is the image version. The fully-qualified URL will + // also work in both cases. + SourceImage string `json:"sourceImage,omitempty"` + + // SourceImageId: The ID value of the image used to create this disk. + // This value identifies the exact image that was used to create this + // persistent disk. For example, if you created the persistent disk from + // an image that was later deleted and recreated under the same name, + // the source image ID would identify the exact version of the image + // that was used. + SourceImageId string `json:"sourceImageId,omitempty"` + + // SourceSnapshot: The source snapshot used to create this disk. You can + // provide this as a partial or full URL to the resource. For example, + // the following are valid values: + // - + // https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot + // - projects/project/global/snapshots/snapshot + // - global/snapshots/snapshot + SourceSnapshot string `json:"sourceSnapshot,omitempty"` + + // SourceSnapshotId: [Output Only] The unique ID of the snapshot used to + // create this disk. This value identifies the exact snapshot that was + // used to create this persistent disk. For example, if you created the + // persistent disk from a snapshot that was later deleted and recreated + // under the same name, the source snapshot ID would identify the exact + // version of the snapshot that was used. + SourceSnapshotId string `json:"sourceSnapshotId,omitempty"` + + // Status: [Output Only] The status of disk creation. Applicable + // statuses includes: CREATING, FAILED, READY, RESTORING. + // + // Possible values: + // "CREATING" + // "FAILED" + // "READY" + // "RESTORING" + 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"` + + // Users: Links to the users of the disk (attached instances) in form: + // project/zones/zone/instances/instance + Users []string `json:"users,omitempty"` + + // Zone: [Output Only] URL of the zone where the disk resides. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Disk) MarshalJSON() ([]byte, error) { + type noMethod Disk + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DiskAggregatedList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A map of scoped disk lists. + Items map[string]DisksScopedList `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always + // compute#diskAggregatedList for aggregated lists of persistent disks. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DiskAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod DiskAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DiskList: A list of Disk resources. +type DiskList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of persistent disks. + Items []*Disk `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#diskList for + // lists of disks. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DiskList) MarshalJSON() ([]byte, error) { + type noMethod DiskList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DiskMoveRequest struct { + // DestinationZone: The URL of the destination zone to move the disk to. + // This can be a full or partial URL. For example, the following are all + // valid URLs to a zone: + // - https://www.googleapis.com/compute/v1/projects/project/zones/zone + // + // - projects/project/zones/zone + // - zones/zone + DestinationZone string `json:"destinationZone,omitempty"` + + // TargetDisk: The URL of the target disk to move. This can be a full or + // partial URL. For example, the following are all valid URLs to a disk: + // + // - + // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk + // - projects/project/zones/zone/disks/disk + // - zones/zone/disks/disk + TargetDisk string `json:"targetDisk,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DestinationZone") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DiskMoveRequest) MarshalJSON() ([]byte, error) { + type noMethod DiskMoveRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DiskType: A disk type resource. +type DiskType struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // DefaultDiskSizeGb: [Output Only] Server-defined default disk size in + // GB. + DefaultDiskSizeGb int64 `json:"defaultDiskSizeGb,omitempty,string"` + + // Deprecated: [Output Only] The deprecation status associated with this + // disk type. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: [Output Only] An optional textual description of the + // resource. + Description string `json:"description,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always compute#diskType for + // disk types. + Kind string `json:"kind,omitempty"` + + // Name: [Output Only] Name of the resource. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ValidDiskSize: [Output Only] An optional textual description of the + // valid disk size, such as "10GB-10TB". + ValidDiskSize string `json:"validDiskSize,omitempty"` + + // Zone: [Output Only] URL of the zone where the disk type resides. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DiskType) MarshalJSON() ([]byte, error) { + type noMethod DiskType + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DiskTypeAggregatedList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A map of scoped disk type lists. + Items map[string]DiskTypesScopedList `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always + // compute#diskTypeAggregatedList. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DiskTypeAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod DiskTypeAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DiskTypeList: Contains a list of disk type resources. +type DiskTypeList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of Disk Type resources. + Items []*DiskType `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#diskTypeList for + // disk types. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DiskTypeList) MarshalJSON() ([]byte, error) { + type noMethod DiskTypeList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DiskTypesScopedList struct { + // DiskTypes: [Output Only] List of disk types contained in this scope. + DiskTypes []*DiskType `json:"diskTypes,omitempty"` + + // Warning: [Output Only] Informational warning which replaces the list + // of disk types when the list is empty. + Warning *DiskTypesScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DiskTypes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DiskTypesScopedList) MarshalJSON() ([]byte, error) { + type noMethod DiskTypesScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DiskTypesScopedListWarning: [Output Only] Informational warning which +// replaces the list of disk types when the list is empty. +type DiskTypesScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*DiskTypesScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DiskTypesScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod DiskTypesScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DiskTypesScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DiskTypesScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod DiskTypesScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DisksScopedList struct { + // Disks: [Output Only] List of disks contained in this scope. + Disks []*Disk `json:"disks,omitempty"` + + // Warning: [Output Only] Informational warning which replaces the list + // of disks when the list is empty. + Warning *DisksScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Disks") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DisksScopedList) MarshalJSON() ([]byte, error) { + type noMethod DisksScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DisksScopedListWarning: [Output Only] Informational warning which +// replaces the list of disks when the list is empty. +type DisksScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*DisksScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DisksScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod DisksScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DisksScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DisksScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod DisksScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Firewall: A Firewall resource. +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: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Ony] Type of the resource. Always compute#firewall for + // firewall rules. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // Network: URL of the network resource for this firewall rule. This + // field is required for creating an instance but optional when creating + // a firewall rule. If not specified when creating a firewall rule, the + // default network is used: + // global/networks/default + // If you choose to specify this property, you can specify the network + // as a full or partial URL. For example, the following are all valid + // URLs: + // - + // https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network + // - projects/myproject/global/networks/my-network + // - global/networks/default + Network string `json:"network,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // SourceRanges: The IP address blocks that this rule applies to, + // expressed in CIDR format. One or both of sourceRanges and sourceTags + // may be set. + // + // If both properties are set, an inbound connection is allowed if the + // range matches the sourceRanges OR the tag of the source matches the + // sourceTags property. The connection does not need to match both + // properties. + 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. + // + // If both properties are set, an inbound connection is allowed if the + // range matches the sourceRanges OR the tag of the source matches the + // sourceTags property. The connection does not need to match both + // properties. + SourceTags []string `json:"sourceTags,omitempty"` + + // TargetTags: A list of instance tags indicating sets of instances + // located in the network that 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Allowed") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Firewall) MarshalJSON() ([]byte, error) { + type noMethod Firewall + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type FirewallAllowed struct { + // IPProtocol: The IP protocol that is allowed for this rule. The + // protocol type is required when creating a firewall. This value 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. This field is + // only applicable for UDP or TCP protocol. 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"` + + // ForceSendFields is a list of field names (e.g. "IPProtocol") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FirewallAllowed) MarshalJSON() ([]byte, error) { + type noMethod FirewallAllowed + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FirewallList: Contains a list of Firewall resources. +type FirewallList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of Firewall resources. + Items []*Firewall `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#firewallList for + // lists of firewalls. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FirewallList) MarshalJSON() ([]byte, error) { + type noMethod FirewallList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ForwardingRule: A ForwardingRule resource. A ForwardingRule resource +// specifies which pool of target virtual machines to forward a packet +// to if it matches the given [IPAddress, IPProtocol, portRange] tuple. +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. + // + // Possible values: + // "AH" + // "ESP" + // "SCTP" + // "TCP" + // "UDP" + IPProtocol string `json:"IPProtocol,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always + // compute#forwardingRule. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + 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. Forwarding rules with the same `[IPAddress, IPProtocol]` + // pair must have disjoint port ranges. + PortRange string `json:"portRange,omitempty"` + + // Region: [Output Only] URL of the region where the regional forwarding + // rule resides. This field is not applicable to global forwarding + // rules. + Region string `json:"region,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + 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 or TargetHttpsProxy resource. + Target string `json:"target,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "IPAddress") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ForwardingRule) MarshalJSON() ([]byte, error) { + type noMethod ForwardingRule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ForwardingRuleAggregatedList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A map of scoped forwarding rule lists. + Items map[string]ForwardingRulesScopedList `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ForwardingRuleAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod ForwardingRuleAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ForwardingRuleList: Contains a list of ForwardingRule resources. +type ForwardingRuleList struct { + // Id: [Output Only] Unique identifier for the resource. Set by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of ForwardingRule resources. + Items []*ForwardingRule `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ForwardingRuleList) MarshalJSON() ([]byte, error) { + type noMethod ForwardingRuleList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "ForwardingRules") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ForwardingRulesScopedList) MarshalJSON() ([]byte, error) { + type noMethod ForwardingRulesScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ForwardingRulesScopedListWarning: Informational warning which +// replaces the list of forwarding rules when the list is empty. +type ForwardingRulesScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*ForwardingRulesScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ForwardingRulesScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod ForwardingRulesScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ForwardingRulesScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ForwardingRulesScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod ForwardingRulesScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type HealthCheckReference struct { + HealthCheck string `json:"healthCheck,omitempty"` + + // ForceSendFields is a list of field names (e.g. "HealthCheck") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HealthCheckReference) MarshalJSON() ([]byte, error) { + type noMethod HealthCheckReference + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type HealthStatus struct { + // HealthState: Health state of the instance. + // + // Possible values: + // "HEALTHY" + // "UNHEALTHY" + 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"` + + // Port: The port on the instance. + Port int64 `json:"port,omitempty"` + + // ForceSendFields is a list of field names (e.g. "HealthState") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HealthStatus) MarshalJSON() ([]byte, error) { + type noMethod HealthStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// HostRule: UrlMaps A host-matching rule for a URL. If matched, will +// use the named PathMatcher to select the BackendService. +type HostRule struct { + // Description: An optional textual description. + Description string `json:"description,omitempty"` + + // Hosts: The list of host patterns to match. They must be valid + // hostnames, except * will match any string of ([a-z0-9-.]*). In that + // case, * must be the first character and must be followed in the + // pattern by either - or .. + Hosts []string `json:"hosts,omitempty"` + + // PathMatcher: The name of the PathMatcher to use to match the path + // portion of the URL if the hostRule matches the URL's host portion. + PathMatcher string `json:"pathMatcher,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HostRule) MarshalJSON() ([]byte, error) { + type noMethod HostRule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// HttpHealthCheck: An HttpHealthCheck resource. This resource defines a +// template for how individual instances should be checked for health, +// via HTTP. +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: [Output Only] Creation timestamp in RFC3339 text + // format. + 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 instance 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: [Output Only] Unique identifier for the resource. Defined by the + // server. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + 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: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // TimeoutSec: How long (in seconds) to wait before claiming failure. + // The default value is 5 seconds. It is invalid for timeoutSec to have + // greater value than checkIntervalSec. + TimeoutSec int64 `json:"timeoutSec,omitempty"` + + // UnhealthyThreshold: A so-far healthy instance will be marked + // unhealthy after this many consecutive failures. The default value is + // 2. + UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HttpHealthCheck) MarshalJSON() ([]byte, error) { + type noMethod HttpHealthCheck + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// HttpHealthCheckList: Contains a list of HttpHealthCheck resources. +type HttpHealthCheckList struct { + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of HttpHealthCheck resources. + Items []*HttpHealthCheck `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HttpHealthCheckList) MarshalJSON() ([]byte, error) { + type noMethod HttpHealthCheckList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// HttpsHealthCheck: An HttpsHealthCheck resource. This resource defines +// a template for how individual instances should be checked for health, +// via HTTPS. +type HttpsHealthCheck struct { + // CheckIntervalSec: How often (in seconds) to send a health check. The + // default value is 5 seconds. + CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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 instance 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 HTTPS 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: [Output Only] Unique identifier for the resource; defined by the + // server. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // Port: The TCP port number for the HTTPS health check request. The + // default value is 443. + Port int64 `json:"port,omitempty"` + + // RequestPath: The request path of the HTTPS health check request. The + // default value is "/". + RequestPath string `json:"requestPath,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // TimeoutSec: How long (in seconds) to wait before claiming failure. + // The default value is 5 seconds. It is invalid for timeoutSec to have + // a greater value than checkIntervalSec. + TimeoutSec int64 `json:"timeoutSec,omitempty"` + + // UnhealthyThreshold: A so-far healthy instance will be marked + // unhealthy after this many consecutive failures. The default value is + // 2. + UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HttpsHealthCheck) MarshalJSON() ([]byte, error) { + type noMethod HttpsHealthCheck + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// HttpsHealthCheckList: Contains a list of HttpsHealthCheck resources. +type HttpsHealthCheckList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of HttpsHealthCheck resources. + Items []*HttpsHealthCheck `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HttpsHealthCheckList) MarshalJSON() ([]byte, error) { + type noMethod HttpsHealthCheckList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Image: An Image resource. +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: [Output Only] Creation timestamp in RFC3339 text + // format. + 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 persistent disk + // (in GB). + DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always compute#image for + // images. + Kind string `json:"kind,omitempty"` + + // Licenses: Any applicable publicly visible licenses. + Licenses []string `json:"licenses,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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // RawDisk: The parameters of the raw disk image. + RawDisk *ImageRawDisk `json:"rawDisk,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // SourceDisk: URL of the The source disk used to create this image. + // This can be a full or valid partial URL. You must provide either this + // property or the rawDisk.source property but not both to create an + // image. For example, the following are valid values: + // - + // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disk/disk + // - projects/project/zones/zone/disk/disk + // - zones/zone/disks/disk + SourceDisk string `json:"sourceDisk,omitempty"` + + // SourceDiskId: The ID value of the disk used to create this image. + // This value may be used to determine whether the image was taken from + // the current or a previous instance of a given disk name. + SourceDiskId string `json:"sourceDiskId,omitempty"` + + // SourceType: The type of the image used to create this disk. The + // default and only value is RAW + // + // Possible values: + // "RAW" (default) + SourceType string `json:"sourceType,omitempty"` + + // Status: [Output Only] The status of the image. An image can be used + // to create other resources, such as instances, only after the image + // has been successfully created and the status is set to READY. + // Possible values are FAILED, PENDING, or READY. + // + // Possible values: + // "FAILED" + // "PENDING" + // "READY" + Status string `json:"status,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ArchiveSizeBytes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Image) MarshalJSON() ([]byte, error) { + type noMethod Image + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ImageRawDisk: The parameters of the raw disk image. +type ImageRawDisk struct { + // ContainerType: The format used to encode and transmit the block + // device, which 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. + // + // Possible values: + // "TAR" + 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. You must provide either this property or the sourceDisk + // property but not both. + Source string `json:"source,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ContainerType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ImageRawDisk) MarshalJSON() ([]byte, error) { + type noMethod ImageRawDisk + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ImageList: Contains a list of Image resources. +type ImageList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of Image resources. + Items []*Image `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ImageList) MarshalJSON() ([]byte, error) { + type noMethod ImageList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Instance: An Instance resource. +type Instance struct { + // CanIpForward: Allows this instance to send and receive packets with + // non-matching destination or source IPs. This is required if you plan + // to use this instance to forward routes. For more information, see + // Enabling IP Forwarding. + CanIpForward bool `json:"canIpForward,omitempty"` + + // CpuPlatform: [Output Only] The CPU platform used by this instance. + CpuPlatform string `json:"cpuPlatform,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always compute#instance for + // instances. + Kind string `json:"kind,omitempty"` + + // MachineType: Full or partial URL of the machine type resource to use + // for this instance. This is provided by the client when the instance + // is created. For example, the following is a valid partial + // url: + // + // zones/zone/machineTypes/machine-type + MachineType string `json:"machineType,omitempty"` + + // Metadata: The metadata key/value pairs assigned to this instance. + // This includes custom metadata and predefined keys. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // NetworkInterfaces: An 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. + NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"` + + // Scheduling: Scheduling options for this instance. + Scheduling *Scheduling `json:"scheduling,omitempty"` + + // SelfLink: [Output Only] Server defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServiceAccounts: A list of service accounts, with their specified + // scopes, authorized for this instance. Service accounts generate + // access tokens that can be accessed through the metadata server and + // used to authenticate applications on the instance. See Authenticating + // from Google Compute Engine for more information. + ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"` + + // Status: [Output Only] The status of the instance. One of the + // following values: PROVISIONING, STAGING, RUNNING, STOPPING, and + // TERMINATED. + // + // Possible values: + // "PROVISIONING" + // "RUNNING" + // "STAGING" + // "STOPPED" + // "STOPPING" + // "SUSPENDED" + // "SUSPENDING" + // "TERMINATED" + Status string `json:"status,omitempty"` + + // StatusMessage: [Output Only] An optional, human-readable explanation + // of the status. + StatusMessage string `json:"statusMessage,omitempty"` + + // Tags: A list of tags to appy to this instance. Tags are used to + // identify valid sources or targets for network firewalls and are + // specified by the client during 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: [Output Only] URL of the zone where the instance resides. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CanIpForward") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Instance) MarshalJSON() ([]byte, error) { + type noMethod Instance + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceAggregatedList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A map of scoped instance lists. + Items map[string]InstancesScopedList `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always + // compute#instanceAggregatedList for aggregated lists of Instance + // resources. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod InstanceAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroup struct { + // CreationTimestamp: [Output Only] The creation timestamp for this + // instance group in RFC3339 text format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional text description for the instance group. + Description string `json:"description,omitempty"` + + // Fingerprint: [Output Only] The fingerprint of the named ports. The + // system uses this fingerprint to detect conflicts when multiple users + // change the named ports concurrently. + Fingerprint string `json:"fingerprint,omitempty"` + + // Id: [Output Only] A unique identifier for this resource type. The + // server generates this identifier. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] The resource type, which is always + // compute#instanceGroup for instance groups. + Kind string `json:"kind,omitempty"` + + // Name: The name of the instance group. The name must be 1-63 + // characters long, and comply with RFC1035. + Name string `json:"name,omitempty"` + + // NamedPorts: Assigns a name to a port number. For example: {name: + // "http", port: 80} + // + // This allows the system to reference ports by the assigned name + // instead of a port number. Named ports can also contain multiple + // ports. For example: [{name: "http", port: 80},{name: "http", port: + // 8080}] + // + // Named ports apply to all instances in this instance group. + NamedPorts []*NamedPort `json:"namedPorts,omitempty"` + + // Network: [Output Only] The URL of the network to which all instances + // in the instance group belong. + Network string `json:"network,omitempty"` + + // SelfLink: [Output Only] The URL for this instance group. The server + // generates this URL. + SelfLink string `json:"selfLink,omitempty"` + + // Size: [Output Only] The total number of instances in the instance + // group. + Size int64 `json:"size,omitempty"` + + // Zone: [Output Only] The URL of the zone where the instance group is + // located. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroup) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupAggregatedList struct { + // Id: [Output Only] A unique identifier for this aggregated list of + // instance groups. The server generates this identifier. + Id string `json:"id,omitempty"` + + // Items: A map of scoped instance group lists. + Items map[string]InstanceGroupsScopedList `json:"items,omitempty"` + + // Kind: [Output Only] The resource type, which is always + // compute#instanceGroupAggregatedList for aggregated lists of instance + // groups. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token that is used to continue a + // truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] The URL for this resource type. The server + // generates this URL. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceGroupList: A list of InstanceGroup resources. +type InstanceGroupList struct { + // Id: [Output Only] A unique identifier for this list of instance + // groups. The server generates this identifier. + Id string `json:"id,omitempty"` + + // Items: A list of instance groups. + Items []*InstanceGroup `json:"items,omitempty"` + + // Kind: [Output Only] The resource type, which is always + // compute#instanceGroupList for instance group lists. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token that is used to continue a + // truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] The URL for this resource type. The server + // generates this URL. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupList) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceGroupManager: InstanceGroupManagers +// +// Next available tag: 19 +type InstanceGroupManager struct { + // BaseInstanceName: The base instance name to use for instances in this + // group. The value must be 1-58 characters long. Instances are named by + // appending a hyphen and a random four-character string to the base + // instance name. The base instance name must comply with RFC1035. + BaseInstanceName string `json:"baseInstanceName,omitempty"` + + // CreationTimestamp: [Output Only] The creation timestamp for this + // managed instance group in RFC3339 text format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // CurrentActions: [Output Only] The list of instance actions and the + // number of instances in this managed instance group that are scheduled + // for each of those actions. + CurrentActions *InstanceGroupManagerActionsSummary `json:"currentActions,omitempty"` + + // Description: An optional text description for the managed instance + // group. + Description string `json:"description,omitempty"` + + // Fingerprint: [Output Only] The fingerprint of the target pools + // information. You can use this optional field for optimistic locking + // when you update the target pool entries. + Fingerprint string `json:"fingerprint,omitempty"` + + // Id: [Output Only] A unique identifier for this resource type. The + // server generates this identifier. + Id uint64 `json:"id,omitempty,string"` + + // InstanceGroup: [Output Only] The URL of the Instance Group resource. + InstanceGroup string `json:"instanceGroup,omitempty"` + + // InstanceTemplate: The URL of the instance template that is specified + // for this managed instance group. The group uses this template to + // create all new instances in the managed instance group. + InstanceTemplate string `json:"instanceTemplate,omitempty"` + + // Kind: [Output Only] The resource type, which is always + // compute#instanceGroupManager for managed instance groups. + Kind string `json:"kind,omitempty"` + + // Name: The name of the managed instance group. The name must be 1-63 + // characters long, and comply with RFC1035. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] The URL for this managed instance group. The + // server defines this URL. + SelfLink string `json:"selfLink,omitempty"` + + // TargetPools: The URLs for all TargetPool resources to which instances + // in the instanceGroup field are added. The target pools automatically + // apply to all of the instances in the managed instance group. + TargetPools []string `json:"targetPools,omitempty"` + + // TargetSize: The target number of running instances for this managed + // instance group. Deleting or abandoning instances reduces this number. + // Resizing the group changes this number. + TargetSize int64 `json:"targetSize,omitempty"` + + // Zone: The name of the zone where the managed instance group is + // located. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BaseInstanceName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManager) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManager + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagerActionsSummary struct { + // Abandoning: [Output Only] The total number of instances in the + // managed instance group that are scheduled to be abandoned. Abandoning + // an instance removes it from the managed instance group without + // deleting it. + Abandoning int64 `json:"abandoning,omitempty"` + + // Creating: [Output Only] The number of instances in the managed + // instance group that are scheduled to be created or are currently + // being created. + Creating int64 `json:"creating,omitempty"` + + // Deleting: [Output Only] The number of instances in the managed + // instance group that are scheduled to be deleted or are currently + // being deleted. + Deleting int64 `json:"deleting,omitempty"` + + // None: [Output Only] The number of instances in the managed instance + // group that are running and have no scheduled actions. + None int64 `json:"none,omitempty"` + + // Recreating: [Output Only] The number of instances in the managed + // instance group that are scheduled to be recreated or are currently + // being being recreated. Recreating an instance deletes the existing + // root persistent disk and creates a new disk from the image that is + // defined in the instance template. + Recreating int64 `json:"recreating,omitempty"` + + // Refreshing: [Output Only] The number of instances in the managed + // instance group that are being reconfigured with properties that do + // not require a restart or a recreate action. For example, setting or + // removing target pools for the instance. + Refreshing int64 `json:"refreshing,omitempty"` + + // Restarting: [Output Only] The number of instances in the managed + // instance group that are scheduled to be restarted or are currently + // being restarted. + Restarting int64 `json:"restarting,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Abandoning") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagerActionsSummary) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagerActionsSummary + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagerAggregatedList struct { + // Id: [Output Only] A unique identifier for this aggregated list of + // managed instance groups. The server generates this identifier. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A map of filtered managed instance group lists. + Items map[string]InstanceGroupManagersScopedList `json:"items,omitempty"` + + // Kind: [Output Only] The resource type, which is always + // compute#instanceGroupManagerAggregatedList for an aggregated list of + // managed instance groups. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token that is used to continue a + // truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] The URL for this resource type. The server + // generates this URL. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagerAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagerAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceGroupManagerList: [Output Only] A list of managed instance +// groups. +type InstanceGroupManagerList struct { + // Id: [Output Only] A unique identifier for this resource type. The + // server generates this identifier. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of managed instance groups. + Items []*InstanceGroupManager `json:"items,omitempty"` + + // Kind: [Output Only] The resource type, which is always + // compute#instanceGroupManagerList for a list of managed instance + // groups. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token that is used to continue a + // truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] The URL for this resource type. The server + // generates this URL. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagerList) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagerList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersAbandonInstancesRequest struct { + // Instances: The URL for one or more instances to abandon from the + // managed instance group. + Instances []string `json:"instances,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersAbandonInstancesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersDeleteInstancesRequest struct { + // Instances: The list of instances to delete from this managed instance + // group. Specify one or more instance URLs. + Instances []string `json:"instances,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersDeleteInstancesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersListManagedInstancesResponse struct { + // ManagedInstances: [Output Only] The list of instances in the managed + // instance group. + ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ManagedInstances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersListManagedInstancesResponse) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersListManagedInstancesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersRecreateInstancesRequest struct { + // Instances: The URL for one or more instances to recreate. + Instances []string `json:"instances,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersRecreateInstancesRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersRecreateInstancesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersScopedList struct { + // InstanceGroupManagers: [Output Only] The list of managed instance + // groups that are contained in the specified project and zone. + InstanceGroupManagers []*InstanceGroupManager `json:"instanceGroupManagers,omitempty"` + + // Warning: [Output Only] The warning that replaces the list of managed + // instance groups when the list is empty. + Warning *InstanceGroupManagersScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "InstanceGroupManagers") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersScopedList) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceGroupManagersScopedListWarning: [Output Only] The warning +// that replaces the list of managed instance groups when the list is +// empty. +type InstanceGroupManagersScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*InstanceGroupManagersScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersSetInstanceTemplateRequest struct { + // InstanceTemplate: The URL of the instance template that is specified + // for this managed instance group. The group uses this template to + // create all new instances in the managed instance group. + InstanceTemplate string `json:"instanceTemplate,omitempty"` + + // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersSetInstanceTemplateRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersSetInstanceTemplateRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersSetTargetPoolsRequest struct { + // Fingerprint: The fingerprint of the target pools information. Use + // this optional property to prevent conflicts when multiple users + // change the target pools settings concurrently. Obtain the fingerprint + // with the instanceGroupManagers.get method. Then, include the + // fingerprint in your request to ensure that you do not overwrite + // changes that were applied from another concurrent request. + Fingerprint string `json:"fingerprint,omitempty"` + + // TargetPools: The list of target pool URLs that instances in this + // managed instance group belong to. The managed instance group applies + // these target pools to all of the instances in the group. Existing + // instances and new instances in the group all receive these target + // pool settings. + TargetPools []string `json:"targetPools,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Fingerprint") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersSetTargetPoolsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupsAddInstancesRequest struct { + // Instances: The list of instances to add to the instance group. + Instances []*InstanceReference `json:"instances,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupsAddInstancesRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupsAddInstancesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupsListInstances struct { + // Id: [Output Only] A unique identifier for this list of instance + // groups. The server generates this identifier. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of instances and any named ports that are + // assigned to those instances. + Items []*InstanceWithNamedPorts `json:"items,omitempty"` + + // Kind: [Output Only] The resource type, which is always + // compute#instanceGroupsListInstances for lists of instance groups. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token that is used to continue a + // truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] The URL for this list of instance groups. The + // server generates this URL. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupsListInstances) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupsListInstances + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupsListInstancesRequest struct { + // InstanceState: A filter for the state of the instances in the + // instance group. Valid options are ALL or RUNNING. If you do not + // specify this parameter the list includes all instances regardless of + // their state. + // + // Possible values: + // "ALL" + // "RUNNING" + InstanceState string `json:"instanceState,omitempty"` + + // ForceSendFields is a list of field names (e.g. "InstanceState") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupsListInstancesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupsRemoveInstancesRequest struct { + // Instances: The list of instances to remove from the instance group. + Instances []*InstanceReference `json:"instances,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupsRemoveInstancesRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupsRemoveInstancesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupsScopedList struct { + // InstanceGroups: [Output Only] The list of instance groups that are + // contained in this scope. + InstanceGroups []*InstanceGroup `json:"instanceGroups,omitempty"` + + // Warning: [Output Only] An informational warning that replaces the + // list of instance groups when the list is empty. + Warning *InstanceGroupsScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "InstanceGroups") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupsScopedList) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupsScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceGroupsScopedListWarning: [Output Only] An informational +// warning that replaces the list of instance groups when the list is +// empty. +type InstanceGroupsScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*InstanceGroupsScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupsScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupsScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupsScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupsScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupsScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupsSetNamedPortsRequest struct { + // Fingerprint: The fingerprint of the named ports information for this + // instance group. Use this optional property to prevent conflicts when + // multiple users change the named ports settings concurrently. Obtain + // the fingerprint with the instanceGroups.get method. Then, include the + // fingerprint in your request to ensure that you do not overwrite + // changes that were applied from another concurrent request. + Fingerprint string `json:"fingerprint,omitempty"` + + // NamedPorts: The list of named ports to set for this instance group. + NamedPorts []*NamedPort `json:"namedPorts,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Fingerprint") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupsSetNamedPortsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceList: Contains a list of instance resources. +type InstanceList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of Instance resources. + Items []*Instance `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#instanceList for + // lists of Instance resources. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceList) MarshalJSON() ([]byte, error) { + type noMethod InstanceList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceMoveRequest struct { + // DestinationZone: The URL of the destination zone to move the instance + // to. This can be a full or partial URL. For example, the following are + // all valid URLs to a zone: + // - https://www.googleapis.com/compute/v1/projects/project/zones/zone + // + // - projects/project/zones/zone + // - zones/zone + DestinationZone string `json:"destinationZone,omitempty"` + + // TargetInstance: The URL of the target instance to move. This can be a + // full or partial URL. For example, the following are all valid URLs to + // an instance: + // - + // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + // - projects/project/zones/zone/instances/instance + // - zones/zone/instances/instance + TargetInstance string `json:"targetInstance,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DestinationZone") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceMoveRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceMoveRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceProperties struct { + // CanIpForward: Enables instances created based on this template to + // send packets with source IP addresses other than their own and + // receive packets with destination IP addresses other than their own. + // If these instances will be used as an IP gateway or it will be set as + // the next-hop in a Route resource, specify true. If unsure, leave this + // set to false. See the canIpForward documentation for more + // information. + CanIpForward bool `json:"canIpForward,omitempty"` + + // Description: An optional text description for the instances that are + // created from this instance template. + Description string `json:"description,omitempty"` + + // Disks: An array of disks that are associated with the instances that + // are created from this template. + Disks []*AttachedDisk `json:"disks,omitempty"` + + // MachineType: The machine type to use for instances that are created + // from this template. + MachineType string `json:"machineType,omitempty"` + + // Metadata: The metadata key/value pairs to assign to instances that + // are created from this template. These pairs can consist of custom + // metadata or predefined keys. See Project and instance metadata for + // more information. + Metadata *Metadata `json:"metadata,omitempty"` + + // NetworkInterfaces: An array of network access configurations for this + // interface. + NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"` + + // Scheduling: Specifies the scheduling options for the instances that + // are created from this template. + Scheduling *Scheduling `json:"scheduling,omitempty"` + + // ServiceAccounts: A list of service accounts with specified scopes. + // Access tokens for these service accounts are available to the + // instances that are created from this template. Use metadata queries + // to obtain the access tokens for these instances. + ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"` + + // Tags: A list of tags to apply to the instances that are created from + // this template. The tags identify valid sources or targets for network + // firewalls. The setTags method can modify this list of tags. Each tag + // within the list must comply with RFC1035. + Tags *Tags `json:"tags,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CanIpForward") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceProperties) MarshalJSON() ([]byte, error) { + type noMethod InstanceProperties + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceReference struct { + // Instance: The URL for a specific instance. + Instance string `json:"instance,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instance") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceReference) MarshalJSON() ([]byte, error) { + type noMethod InstanceReference + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceTemplate: An Instance Template resource. +type InstanceTemplate struct { + // CreationTimestamp: [Output Only] The creation timestamp for this + // instance template in RFC3339 text format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional text description for the instance template. + Description string `json:"description,omitempty"` + + // Id: [Output Only] A unique identifier for this instance template. The + // server defines this identifier. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] The resource type, which is always + // compute#instanceTemplate for instance templates. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // Properties: The instance properties for this instance template. + Properties *InstanceProperties `json:"properties,omitempty"` + + // SelfLink: [Output Only] The URL for this instance template. The + // server defines this URL. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceTemplate) MarshalJSON() ([]byte, error) { + type noMethod InstanceTemplate + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceTemplateList: A list of instance templates. +type InstanceTemplateList struct { + // Id: [Output Only] A unique identifier for this instance template. The + // server defines this identifier. + Id string `json:"id,omitempty"` + + // Items: [Output Only] list of InstanceTemplate resources. + Items []*InstanceTemplate `json:"items,omitempty"` + + // Kind: [Output Only] The resource type, which is always + // compute#instanceTemplatesListResponse for instance template lists. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token that is used to continue a + // truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] The URL for this instance template list. The + // server defines this URL. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceTemplateList) MarshalJSON() ([]byte, error) { + type noMethod InstanceTemplateList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceWithNamedPorts struct { + // Instance: [Output Only] The URL of the instance. + Instance string `json:"instance,omitempty"` + + // NamedPorts: [Output Only] The named ports that belong to this + // instance group. + NamedPorts []*NamedPort `json:"namedPorts,omitempty"` + + // Status: [Output Only] The status of the instance. + // + // Possible values: + // "PROVISIONING" + // "RUNNING" + // "STAGING" + // "STOPPED" + // "STOPPING" + // "SUSPENDED" + // "SUSPENDING" + // "TERMINATED" + Status string `json:"status,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instance") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceWithNamedPorts) MarshalJSON() ([]byte, error) { + type noMethod InstanceWithNamedPorts + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstancesScopedList struct { + // Instances: [Output Only] List of instances contained in this scope. + Instances []*Instance `json:"instances,omitempty"` + + // Warning: [Output Only] Informational warning which replaces the list + // of instances when the list is empty. + Warning *InstancesScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesScopedList) MarshalJSON() ([]byte, error) { + type noMethod InstancesScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstancesScopedListWarning: [Output Only] Informational warning which +// replaces the list of instances when the list is empty. +type InstancesScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*InstancesScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod InstancesScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstancesScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod InstancesScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// License: A license resource. +type License struct { + // ChargesUseFee: If true, the customer will be charged license fee for + // running software that contains this license on an instance. + ChargesUseFee bool `json:"chargesUseFee,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#license for + // licenses. + Kind string `json:"kind,omitempty"` + + // Name: [Output Only] Name of the resource. The name is 1-63 characters + // long and complies with RFC1035. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ChargesUseFee") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *License) MarshalJSON() ([]byte, error) { + type noMethod License + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MachineType: A Machine Type resource. +type MachineType struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Deprecated: [Output Only] The deprecation status associated with this + // machine type. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: [Output Only] An optional textual description of the + // resource. + Description string `json:"description,omitempty"` + + // GuestCpus: [Output Only] The tumber of CPUs exposed to the instance. + GuestCpus int64 `json:"guestCpus,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // ImageSpaceGb: [Deprecated] This property is deprecated and will never + // be populated with any relevant values. + ImageSpaceGb int64 `json:"imageSpaceGb,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // MaximumPersistentDisks: [Output Only] Maximum persistent disks + // allowed. + MaximumPersistentDisks int64 `json:"maximumPersistentDisks,omitempty"` + + // MaximumPersistentDisksSizeGb: [Output Only] Maximum total persistent + // disks size (GB) allowed. + MaximumPersistentDisksSizeGb int64 `json:"maximumPersistentDisksSizeGb,omitempty,string"` + + // MemoryMb: [Output Only] The amount of physical memory available to + // the instance, defined in MB. + MemoryMb int64 `json:"memoryMb,omitempty"` + + // Name: [Output Only] Name of the resource. + Name string `json:"name,omitempty"` + + // ScratchDisks: [Output Only] List of extended scratch disks assigned + // to the instance. + ScratchDisks []*MachineTypeScratchDisks `json:"scratchDisks,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // Zone: [Output Only] The name of the zone where the machine type + // resides, such as us-central1-a. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MachineType) MarshalJSON() ([]byte, error) { + type noMethod MachineType + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type MachineTypeScratchDisks struct { + // DiskGb: Size of the scratch disk, defined in GB. + DiskGb int64 `json:"diskGb,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DiskGb") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MachineTypeScratchDisks) MarshalJSON() ([]byte, error) { + type noMethod MachineTypeScratchDisks + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type MachineTypeAggregatedList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A map of scoped machine type lists. + Items map[string]MachineTypesScopedList `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always + // compute#machineTypeAggregatedList for aggregated lists of machine + // types. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MachineTypeAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod MachineTypeAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MachineTypeList: Contains a list of Machine Type resources. +type MachineTypeList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of Machine Type resources. + Items []*MachineType `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#machineTypeList + // for lists of machine types. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MachineTypeList) MarshalJSON() ([]byte, error) { + type noMethod MachineTypeList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type MachineTypesScopedList struct { + // MachineTypes: [Output Only] List of machine types contained in this + // scope. + MachineTypes []*MachineType `json:"machineTypes,omitempty"` + + // Warning: [Output Only] An informational warning that appears when the + // machine types list is empty. + Warning *MachineTypesScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MachineTypes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MachineTypesScopedList) MarshalJSON() ([]byte, error) { + type noMethod MachineTypesScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MachineTypesScopedListWarning: [Output Only] An informational warning +// that appears when the machine types list is empty. +type MachineTypesScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*MachineTypesScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MachineTypesScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod MachineTypesScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type MachineTypesScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MachineTypesScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod MachineTypesScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ManagedInstance struct { + // CurrentAction: [Output Only] The current action that the managed + // instance group has scheduled for the instance. Possible values: + // - NONE The instance is running, and the managed instance group does + // not have any scheduled actions for this instance. + // - CREATING The managed instance group is creating this instance. + // - RECREATING The managed instance group is recreating this instance. + // + // - DELETING The managed instance group is permanently deleting this + // instance. + // - ABANDONING The managed instance group is abandoning this instance. + // The instance will be removed from the instance group and from any + // target pools that are associated with this group. + // - RESTARTING The managed instance group is restarting the instance. + // + // - REFRESHING The managed instance group is applying configuration + // changes to the instance without stopping it. For example, the group + // can update the target pool list for an instance without stopping that + // instance. + // + // Possible values: + // "ABANDONING" + // "CREATING" + // "DELETING" + // "NONE" + // "RECREATING" + // "REFRESHING" + // "RESTARTING" + CurrentAction string `json:"currentAction,omitempty"` + + // Id: [Output only] The unique identifier for this resource. This field + // is empty when instance does not exist. + Id uint64 `json:"id,omitempty,string"` + + // Instance: [Output Only] The URL of the instance. The URL can exist + // even if the instance has not yet been created. + Instance string `json:"instance,omitempty"` + + // InstanceStatus: [Output Only] The status of the instance. This field + // is empty when the instance does not exist. + // + // Possible values: + // "PROVISIONING" + // "RUNNING" + // "STAGING" + // "STOPPED" + // "STOPPING" + // "SUSPENDED" + // "SUSPENDING" + // "TERMINATED" + InstanceStatus string `json:"instanceStatus,omitempty"` + + // LastAttempt: [Output Only] Information about the last attempt to + // create or delete the instance. + LastAttempt *ManagedInstanceLastAttempt `json:"lastAttempt,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CurrentAction") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ManagedInstance) MarshalJSON() ([]byte, error) { + type noMethod ManagedInstance + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ManagedInstanceLastAttempt struct { + // Errors: [Output Only] Encountered errors during the last attempt to + // create or delete the instance. + Errors *ManagedInstanceLastAttemptErrors `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ManagedInstanceLastAttempt) MarshalJSON() ([]byte, error) { + type noMethod ManagedInstanceLastAttempt + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ManagedInstanceLastAttemptErrors: [Output Only] Encountered errors +// during the last attempt to create or delete the instance. +type ManagedInstanceLastAttemptErrors struct { + // Errors: [Output Only] The array of errors encountered while + // processing this operation. + Errors []*ManagedInstanceLastAttemptErrorsErrors `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ManagedInstanceLastAttemptErrors) MarshalJSON() ([]byte, error) { + type noMethod ManagedInstanceLastAttemptErrors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ManagedInstanceLastAttemptErrorsErrors struct { + // Code: [Output Only] The error type identifier for this error. + Code string `json:"code,omitempty"` + + // Location: [Output Only] Indicates the field in the request which + // caused the error. This property is optional. + Location string `json:"location,omitempty"` + + // Message: [Output Only] An optional, human-readable error message. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ManagedInstanceLastAttemptErrorsErrors) MarshalJSON() ([]byte, error) { + type noMethod ManagedInstanceLastAttemptErrorsErrors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Metadata: A metadata key/value entry. +type Metadata struct { + // Fingerprint: Specifies a fingerprint for this request, which is + // essentially a hash of the metadata's contents and used for optimistic + // locking. The fingerprint is initially generated by Compute Engine and + // changes after every request to modify or update metadata. You must + // always provide an up-to-date fingerprint hash in order to update or + // change 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: [Output Only] Type of the resource. Always compute#metadata for + // metadata. + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Fingerprint") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Metadata) MarshalJSON() ([]byte, error) { + type noMethod Metadata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MetadataItems) MarshalJSON() ([]byte, error) { + type noMethod MetadataItems + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// NamedPort: The named port. For example: . +type NamedPort struct { + // Name: The name for this named port. The name must be 1-63 characters + // long, and comply with RFC1035. + Name string `json:"name,omitempty"` + + // Port: The port number, which can be a value between 1 and 65535. + Port int64 `json:"port,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *NamedPort) MarshalJSON() ([]byte, error) { + type noMethod NamedPort + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Network: A network resource. +type Network struct { + // IPv4Range: 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: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: A gateway address for default routing to other networks. + // This value is read only and is selected by the Google Compute Engine, + // typically as the first usable address in the IPv4Range. + GatewayIPv4 string `json:"gatewayIPv4,omitempty"` + + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always compute#network for + // networks. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "IPv4Range") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Network) MarshalJSON() ([]byte, error) { + type noMethod Network + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// NetworkInterface: A network interface resource attached to an +// instance. +type NetworkInterface struct { + // AccessConfigs: An array of configurations for this interface. + // 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: [Output Only] The name of the network interface, generated by + // the server. For network devices, these are eth0, eth1, etc. + Name string `json:"name,omitempty"` + + // Network: URL of the network resource for this instance. This is + // required for creating an instance but optional when creating a + // firewall rule. If not specified when creating a firewall rule, the + // default network is used: + // + // global/networks/default + // + // If you specify this property, you can specify the network as a full + // or partial URL. For example, the following are all valid URLs: + // - + // https://www.googleapis.com/compute/v1/projects/project/global/networks/network + // - projects/project/global/networks/network + // - global/networks/default + Network string `json:"network,omitempty"` + + // NetworkIP: [Output Only] An optional IPV4 internal network address + // assigned to the instance for this network interface. + NetworkIP string `json:"networkIP,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AccessConfigs") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *NetworkInterface) MarshalJSON() ([]byte, error) { + type noMethod NetworkInterface + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// NetworkList: Contains a list of Network resources. +type NetworkList struct { + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of Network resources. + Items []*Network `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#networkList for + // lists of networks. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource . + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *NetworkList) MarshalJSON() ([]byte, error) { + type noMethod NetworkList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Operation: An Operation resource, used to manage asynchronous API +// requests. +type Operation struct { + // ClientOperationId: [Output Only] An optional identifier specified by + // the client when the mutation was initiated. Must be unique for all + // Operation resources in the project. + ClientOperationId string `json:"clientOperationId,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // EndTime: [Output Only] The time that this operation was completed. + // This is in RFC3339 text format. + EndTime string `json:"endTime,omitempty"` + + // Error: [Output Only] If errors are generated during processing of the + // operation, this field will be populated. + Error *OperationError `json:"error,omitempty"` + + // HttpErrorMessage: [Output Only] If the operation fails, this field + // contains the HTTP error message that was returned, such as NOT FOUND. + HttpErrorMessage string `json:"httpErrorMessage,omitempty"` + + // HttpErrorStatusCode: [Output Only] If the operation fails, this field + // contains the HTTP error message that was returned, such as 404. + HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // InsertTime: [Output Only] The time that this operation was requested. + // This is in RFC3339 text format. + InsertTime string `json:"insertTime,omitempty"` + + // Kind: [Output Only] Type of the resource. Always compute#operation + // for Operation resources. + Kind string `json:"kind,omitempty"` + + // Name: [Output Only] Name of the resource. + Name string `json:"name,omitempty"` + + // OperationType: [Output Only] Type of the operation, such as insert, + // compute.instanceGroups.update, or compute.instanceGroups.delete. + OperationType string `json:"operationType,omitempty"` + + // Progress: [Output Only] 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 monotonically + // increase as the operation progresses. + Progress int64 `json:"progress,omitempty"` + + // Region: [Output Only] URL of the region where the operation resides. + // Only applicable for regional resources. + Region string `json:"region,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // StartTime: [Output Only] The time that this operation was started by + // the server. This is in RFC3339 text format. + StartTime string `json:"startTime,omitempty"` + + // Status: [Output Only] Status of the operation. Can be one of the + // following: PENDING, RUNNING, or DONE. + // + // Possible values: + // "DONE" + // "PENDING" + // "RUNNING" + Status string `json:"status,omitempty"` + + // StatusMessage: [Output Only] An optional textual description of the + // current status of the operation. + StatusMessage string `json:"statusMessage,omitempty"` + + // TargetId: [Output Only] Unique target ID which identifies a + // particular incarnation of the target. + TargetId uint64 `json:"targetId,omitempty,string"` + + // TargetLink: [Output Only] URL of the resource the operation is + // mutating. + TargetLink string `json:"targetLink,omitempty"` + + // User: [Output Only] User who requested the operation, for example: + // user@example.com. + User string `json:"user,omitempty"` + + // Warnings: [Output Only] If warning messages are generated during + // processing of the operation, this field will be populated. + Warnings []*OperationWarnings `json:"warnings,omitempty"` + + // Zone: [Output Only] URL of the zone where the operation resides. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ClientOperationId") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Operation) MarshalJSON() ([]byte, error) { + type noMethod Operation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationError: [Output Only] If errors are generated during +// processing of the operation, this field will be populated. +type OperationError struct { + // Errors: [Output Only] The array of errors encountered while + // processing this operation. + Errors []*OperationErrorErrors `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationError) MarshalJSON() ([]byte, error) { + type noMethod OperationError + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationErrorErrors struct { + // Code: [Output Only] The error type identifier for this error. + Code string `json:"code,omitempty"` + + // Location: [Output Only] Indicates the field in the request which + // caused the error. This property is optional. + Location string `json:"location,omitempty"` + + // Message: [Output Only] An optional, human-readable error message. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) { + type noMethod OperationErrorErrors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationWarnings struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*OperationWarningsData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationWarnings) MarshalJSON() ([]byte, error) { + type noMethod OperationWarnings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationWarningsData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationWarningsData) MarshalJSON() ([]byte, error) { + type noMethod OperationWarningsData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationAggregatedList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A map of scoped operation lists. + Items map[string]OperationsScopedList `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always + // compute#operationAggregatedList for aggregated lists of operations. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod OperationAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationList: Contains a list of Operation resources. +type OperationList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] The Operation resources. + Items []*Operation `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#operations for + // Operations resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncate. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationList) MarshalJSON() ([]byte, error) { + type noMethod OperationList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationsScopedList struct { + // Operations: [Output Only] List of operations contained in this scope. + Operations []*Operation `json:"operations,omitempty"` + + // Warning: [Output Only] Informational warning which replaces the list + // of operations when the list is empty. + Warning *OperationsScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Operations") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationsScopedList) MarshalJSON() ([]byte, error) { + type noMethod OperationsScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationsScopedListWarning: [Output Only] Informational warning +// which replaces the list of operations when the list is empty. +type OperationsScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*OperationsScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationsScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod OperationsScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationsScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationsScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod OperationsScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PathMatcher: 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. +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: An optional textual description of the resource. + 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"` + + // ForceSendFields is a list of field names (e.g. "DefaultService") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PathMatcher) MarshalJSON() ([]byte, error) { + type noMethod PathMatcher + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PathRule: A path-matching rule for a URL. If matched, will use the +// specified BackendService to handle the traffic arriving at this URL. +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"` + + // ForceSendFields is a list of field names (e.g. "Paths") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PathRule) MarshalJSON() ([]byte, error) { + type noMethod PathRule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Project: A Project resource. Projects can only be created in the +// Google Developers Console. Unless marked otherwise, values can only +// be modified in the console. +type Project struct { + // CommonInstanceMetadata: Metadata key/value pairs available to all + // instances contained in this project. See Custom metadata for more + // information. + CommonInstanceMetadata *Metadata `json:"commonInstanceMetadata,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource. + Description string `json:"description,omitempty"` + + // EnabledFeatures: Restricted features enabled for use on this project. + EnabledFeatures []string `json:"enabledFeatures,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always compute#project for + // projects. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource. + Name string `json:"name,omitempty"` + + // Quotas: [Output Only] Quotas assigned to this project. + Quotas []*Quota `json:"quotas,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // UsageExportLocation: The location in Cloud Storage and naming method + // of the daily usage report. + UsageExportLocation *UsageExportLocation `json:"usageExportLocation,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "CommonInstanceMetadata") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Project) MarshalJSON() ([]byte, error) { + type noMethod Project + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Quota: A quotas entry. +type Quota struct { + // Limit: [Output Only] Quota limit for this metric. + Limit float64 `json:"limit,omitempty"` + + // Metric: [Output Only] Name of the quota metric. + // + // Possible values: + // "BACKEND_SERVICES" + // "CPUS" + // "DISKS_TOTAL_GB" + // "FIREWALLS" + // "FORWARDING_RULES" + // "HEALTH_CHECKS" + // "IMAGES" + // "INSTANCES" + // "INSTANCE_GROUPS" + // "INSTANCE_GROUP_MANAGERS" + // "INSTANCE_TEMPLATES" + // "IN_USE_ADDRESSES" + // "LOCAL_SSD_TOTAL_GB" + // "NETWORKS" + // "ROUTES" + // "SNAPSHOTS" + // "SSD_TOTAL_GB" + // "STATIC_ADDRESSES" + // "TARGET_HTTP_PROXIES" + // "TARGET_INSTANCES" + // "TARGET_POOLS" + // "TARGET_VPN_GATEWAYS" + // "URL_MAPS" + // "VPN_TUNNELS" + Metric string `json:"metric,omitempty"` + + // Usage: [Output Only] Current usage of this metric. + Usage float64 `json:"usage,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Limit") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Quota) MarshalJSON() ([]byte, error) { + type noMethod Quota + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Region: Region resource. +type Region struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Deprecated: [Output Only] The deprecation status associated with this + // region. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: [Output Only] Textual description of the resource. + Description string `json:"description,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server . + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always compute#region for + // regions. + Kind string `json:"kind,omitempty"` + + // Name: [Output Only] Name of the resource. + Name string `json:"name,omitempty"` + + // Quotas: [Output Only] Quotas assigned to this region. + Quotas []*Quota `json:"quotas,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // Status: [Output Only] Status of the region, either UP or DOWN. + // + // Possible values: + // "DOWN" + // "UP" + Status string `json:"status,omitempty"` + + // Zones: [Output Only] A list of zones available in this region, in the + // form of resource URLs. + Zones []string `json:"zones,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Region) MarshalJSON() ([]byte, error) { + type noMethod Region + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RegionList: Contains a list of region resources. +type RegionList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of Region resources. + Items []*Region `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#regionList for + // lists of regions. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RegionList) MarshalJSON() ([]byte, error) { + type noMethod RegionList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ResourceGroupReference struct { + // Group: A URI referencing one of the resource views listed in the + // backend service. + Group string `json:"group,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Group") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResourceGroupReference) MarshalJSON() ([]byte, error) { + type noMethod ResourceGroupReference + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Route: The route resource. A Route is a rule that specifies how +// certain packets should be handled by the virtual network. Routes are +// associated with instances by tag and the set of Routes for a +// particular instance is called its routing table. For each packet +// leaving a instance, the system searches that instance'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 +// nextHop field of the winning Route -- either to another instance +// destination, a instance gateway or a Google Compute Engien-operated +// gateway. Packets that do not match any Route in the sending +// instance's routing table are dropped. +type Route struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: The destination range of outgoing packets that this route + // applies to. + DestRange string `json:"destRange,omitempty"` + + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of this resource. Always compute#routes for + // Route resources. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // Network: Fully-qualified URL of the network that this route applies + // to. + Network string `json:"network,omitempty"` + + // NextHopGateway: The URL to a gateway that should handle matching + // packets. Currently, this is only the internet gateway: + // projects//global/gateways/default-internet-gateway + NextHopGateway string `json:"nextHopGateway,omitempty"` + + // NextHopInstance: The fully-qualified URL to an instance that should + // handle matching packets. For + // example: + // https://www.googleapis.com/compute/v1/projects/project/zones/ + // zone/instances/ + 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"` + + // NextHopVpnTunnel: The URL to a VpnTunnel that should handle matching + // packets. + NextHopVpnTunnel string `json:"nextHopVpnTunnel,omitempty"` + + // Priority: Breaks ties between Routes of equal specificity. Routes + // with smaller values win when tied with routes with larger values. + // Default value is 1000. A valid range is between 0 and 65535. + Priority int64 `json:"priority,omitempty"` + + // SelfLink: [Output Only] Server-defined fully-qualified URL for this + // resource. + SelfLink string `json:"selfLink,omitempty"` + + // Tags: A list of instance tags to which this route applies. + Tags []string `json:"tags,omitempty"` + + // Warnings: [Output Only] If potential misconfigurations are detected + // for this route, this field will be populated with warning messages. + Warnings []*RouteWarnings `json:"warnings,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Route) MarshalJSON() ([]byte, error) { + type noMethod Route + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type RouteWarnings struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*RouteWarningsData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RouteWarnings) MarshalJSON() ([]byte, error) { + type noMethod RouteWarnings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type RouteWarningsData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RouteWarningsData) MarshalJSON() ([]byte, error) { + type noMethod RouteWarningsData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RouteList: Contains a list of route resources. +type RouteList struct { + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of Route resources. + Items []*Route `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RouteList) MarshalJSON() ([]byte, error) { + type noMethod RouteList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Scheduling: Sets the scheduling options for an Instance. +type Scheduling struct { + // AutomaticRestart: Specifies whether the instance should be + // automatically restarted if it is terminated by Compute Engine (not + // terminated by a user). You can only set the automatic restart option + // for standard instances. Preemptible instances cannot be automatically + // restarted. + AutomaticRestart bool `json:"automaticRestart,omitempty"` + + // OnHostMaintenance: Defines the maintenance behavior for this + // instance. For standard instances, the default behavior is MIGRATE. + // For preemptible instances, the default and only possible behavior is + // TERMINATE. For more information, see Setting maintenance behavior. + // + // Possible values: + // "MIGRATE" + // "TERMINATE" + OnHostMaintenance string `json:"onHostMaintenance,omitempty"` + + // Preemptible: Whether the instance is preemptible. + Preemptible bool `json:"preemptible,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AutomaticRestart") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Scheduling) MarshalJSON() ([]byte, error) { + type noMethod Scheduling + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SerialPortOutput: An instance's serial console output. +type SerialPortOutput struct { + // Contents: [Output Only] The contents of the console output. + Contents string `json:"contents,omitempty"` + + // Kind: [Output Only] Type of the resource. Always + // compute#serialPortOutput for serial port output. + Kind string `json:"kind,omitempty"` + + // SelfLink: [Output Only] Server defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Contents") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SerialPortOutput) MarshalJSON() ([]byte, error) { + type noMethod SerialPortOutput + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ServiceAccount: A service account. +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"` + + // ForceSendFields is a list of field names (e.g. "Email") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ServiceAccount) MarshalJSON() ([]byte, error) { + type noMethod ServiceAccount + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Snapshot: A persistent disk snapshot resource. +type Snapshot struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Size of the snapshot, specified in GB. + DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always compute#snapshot for + // Snapshot resources. + Kind string `json:"kind,omitempty"` + + // Licenses: Public visible licenses. + Licenses []string `json:"licenses,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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // SourceDisk: The source disk used to create this snapshot. + SourceDisk string `json:"sourceDisk,omitempty"` + + // SourceDiskId: [Output Only] 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: [Output Only] The status of the snapshot. + // + // Possible values: + // "CREATING" + // "DELETING" + // "FAILED" + // "READY" + // "UPLOADING" + Status string `json:"status,omitempty"` + + // StorageBytes: [Output Only] 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: [Output Only] An indicator whether storageBytes + // is in a stable state or it is being adjusted as a result of shared + // storage reallocation. + // + // Possible values: + // "UPDATING" + // "UP_TO_DATE" + StorageBytesStatus string `json:"storageBytesStatus,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Snapshot) MarshalJSON() ([]byte, error) { + type noMethod Snapshot + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SnapshotList: Contains a list of Snapshot resources. +type SnapshotList struct { + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of Snapshot resources. + Items []*Snapshot `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SnapshotList) MarshalJSON() ([]byte, error) { + type noMethod SnapshotList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SslCertificate: An SslCertificate resource. This resource provides a +// mechanism to upload an SSL key and certificate to global HTTPS +// loadbalancer to serve secure connections. +type SslCertificate struct { + // Certificate: A local certificate file. The certificate must be in PEM + // format. The certificate chain must be no greater than 5 certs long. + // The chain must include at least one intermediate cert. + Certificate string `json:"certificate,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always + // compute#sslCertificate for SSL certificates. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // PrivateKey: A write-only private key in PEM format. Only insert RPCs + // will include this field. + PrivateKey string `json:"privateKey,omitempty"` + + // SelfLink: [Output only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Certificate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SslCertificate) MarshalJSON() ([]byte, error) { + type noMethod SslCertificate + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SslCertificateList: Contains a list of SslCertificate resources. +type SslCertificateList struct { + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of SslCertificate resources. + Items []*SslCertificate `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SslCertificateList) MarshalJSON() ([]byte, error) { + type noMethod SslCertificateList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Tags: A set of instance tags. +type Tags struct { + // Fingerprint: Specifies a fingerprint for this request, which is + // essentially a hash of the metadata's contents and used for optimistic + // locking. The fingerprint is initially generated by Compute Engine and + // changes after every request to modify or update metadata. You must + // always provide an up-to-date fingerprint hash in order to update or + // change metadata. + // + // To see the latest fingerprint, make get() request to the instance. + 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"` + + // ForceSendFields is a list of field names (e.g. "Fingerprint") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Tags) MarshalJSON() ([]byte, error) { + type noMethod Tags + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetHttpProxy: A TargetHttpProxy resource. This resource defines an +// HTTP proxy. +type TargetHttpProxy struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of resource. Always compute#operation for + // Operation resources. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetHttpProxy) MarshalJSON() ([]byte, error) { + type noMethod TargetHttpProxy + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetHttpProxyList: A list of TargetHttpProxy resources. +type TargetHttpProxyList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of TargetHttpProxy resources. + Items []*TargetHttpProxy `json:"items,omitempty"` + + // Kind: Type of resource. Always compute#targetHttpProxyList for lists + // of Target HTTP proxies. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetHttpProxyList) MarshalJSON() ([]byte, error) { + type noMethod TargetHttpProxyList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetHttpsProxiesSetSslCertificatesRequest struct { + // SslCertificates: New set of URLs to SslCertificate resources to + // associate with this TargetHttpProxy. Currently exactly one ssl + // certificate must be specified. + SslCertificates []string `json:"sslCertificates,omitempty"` + + // ForceSendFields is a list of field names (e.g. "SslCertificates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetHttpsProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) { + type noMethod TargetHttpsProxiesSetSslCertificatesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetHttpsProxy: A TargetHttpsProxy resource. This resource defines +// an HTTPS proxy. +type TargetHttpsProxy struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource; defined by the + // server. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // SslCertificates: URLs to SslCertificate resources that are used to + // authenticate connections to Backends. Currently exactly one SSL + // certificate must be specified. + SslCertificates []string `json:"sslCertificates,omitempty"` + + // UrlMap: URL to the UrlMap resource that defines the mapping from URL + // to the BackendService. + UrlMap string `json:"urlMap,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetHttpsProxy) MarshalJSON() ([]byte, error) { + type noMethod TargetHttpsProxy + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetHttpsProxyList: Contains a list of TargetHttpsProxy resources. +type TargetHttpsProxyList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of TargetHttpsProxy resources. + Items []*TargetHttpsProxy `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetHttpsProxyList) MarshalJSON() ([]byte, error) { + type noMethod TargetHttpsProxyList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetInstance: A TargetInstance resource. This resource defines an +// endpoint instance that terminates traffic of certain protocols. +type TargetInstance struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource; defined by the + // server. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // NatPolicy: NAT option controlling how IPs are NAT'ed to the instance. + // Currently only NO_NAT (default value) is supported. + // + // Possible values: + // "NO_NAT" + NatPolicy string `json:"natPolicy,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // Zone: [Output Only] URL of the zone where the target instance + // resides. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetInstance) MarshalJSON() ([]byte, error) { + type noMethod TargetInstance + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetInstanceAggregatedList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A map of scoped target instance lists. + Items map[string]TargetInstancesScopedList `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetInstanceAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod TargetInstanceAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetInstanceList: Contains a list of TargetInstance resources. +type TargetInstanceList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of TargetInstance resources. + Items []*TargetInstance `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetInstanceList) MarshalJSON() ([]byte, error) { + type noMethod TargetInstanceList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "TargetInstances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetInstancesScopedList) MarshalJSON() ([]byte, error) { + type noMethod TargetInstancesScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetInstancesScopedListWarning: Informational warning which +// replaces the list of addresses when the list is empty. +type TargetInstancesScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*TargetInstancesScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetInstancesScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod TargetInstancesScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetInstancesScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetInstancesScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod TargetInstancesScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetPool: A TargetPool resource. This resource defines a pool of +// instances, associated HttpHealthCheck resources, and the fallback +// TargetPool. +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 instances 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 + // instances 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 instances with the best effort, or to + // all instances when no instance is healthy. + BackupPool string `json:"backupPool,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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 instances 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 instances 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 instances with the best effort, or to all instances when no + // instance is healthy. + FailoverRatio float64 `json:"failoverRatio,omitempty"` + + // HealthChecks: A list of URLs to the HttpHealthCheck resource. A + // member instance in this pool is considered healthy if and only if all + // specified health checks pass. An empty list means all member + // instances will be considered healthy at all times. + HealthChecks []string `json:"healthChecks,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Instances: A list of resource URLs to the member virtual machines + // 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // Region: [Output Only] URL of the region where the target pool + // resides. + Region string `json:"region,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + 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 instance in + // the pool. + // CLIENT_IP: Connections from the same client IP will go to the same + // instance in the pool while that instance remains + // healthy. + // CLIENT_IP_PROTO: Connections from the same client IP with the same IP + // protocol will go to the same instance in the pool while that instance + // remains healthy. + // + // Possible values: + // "CLIENT_IP" + // "CLIENT_IP_PROTO" + // "NONE" + SessionAffinity string `json:"sessionAffinity,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BackupPool") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPool) MarshalJSON() ([]byte, error) { + type noMethod TargetPool + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetPoolAggregatedList struct { + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A map of scoped target pool lists. + Items map[string]TargetPoolsScopedList `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetPoolInstanceHealth struct { + HealthStatus []*HealthStatus `json:"healthStatus,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "HealthStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolInstanceHealth) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolInstanceHealth + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetPoolList: Contains a list of TargetPool resources. +type TargetPoolList struct { + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of TargetPool resources. + Items []*TargetPool `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolList) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetPoolsAddHealthCheckRequest struct { + // HealthChecks: Health check URLs to be added to targetPool. + HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"` + + // ForceSendFields is a list of field names (e.g. "HealthChecks") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolsAddHealthCheckRequest) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolsAddHealthCheckRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetPoolsAddInstanceRequest struct { + // Instances: URLs of the instances to be added to targetPool. + Instances []*InstanceReference `json:"instances,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolsAddInstanceRequest) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolsAddInstanceRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetPoolsRemoveHealthCheckRequest struct { + // HealthChecks: Health check URLs to be removed from targetPool. + HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"` + + // ForceSendFields is a list of field names (e.g. "HealthChecks") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolsRemoveHealthCheckRequest) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolsRemoveHealthCheckRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetPoolsRemoveInstanceRequest struct { + // Instances: URLs of the instances to be removed from targetPool. + Instances []*InstanceReference `json:"instances,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolsRemoveInstanceRequest) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolsRemoveInstanceRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "TargetPools") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolsScopedList) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolsScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetPoolsScopedListWarning: Informational warning which replaces +// the list of addresses when the list is empty. +type TargetPoolsScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*TargetPoolsScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolsScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolsScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetPoolsScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolsScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolsScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetReference struct { + Target string `json:"target,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Target") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetReference) MarshalJSON() ([]byte, error) { + type noMethod TargetReference + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetVpnGateway struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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"` + + // ForwardingRules: [Output Only] A list of URLs to the ForwardingRule + // resources. ForwardingRules are created using + // compute.forwardingRules.insert and associated to a VPN gateway. + ForwardingRules []string `json:"forwardingRules,omitempty"` + + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway + // for target VPN gateways. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // Network: URL of the network to which this VPN gateway is attached. + // Provided by the client when the VPN gateway is created. + Network string `json:"network,omitempty"` + + // Region: [Output Only] URL of the region where the target VPN gateway + // resides. + Region string `json:"region,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // Status: [Output Only] The status of the VPN gateway. + // + // Possible values: + // "CREATING" + // "DELETING" + // "FAILED" + // "READY" + Status string `json:"status,omitempty"` + + // Tunnels: [Output Only] A list of URLs to VpnTunnel resources. + // VpnTunnels are created using compute.vpntunnels.insert and associated + // to a VPN gateway. + Tunnels []string `json:"tunnels,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetVpnGateway) MarshalJSON() ([]byte, error) { + type noMethod TargetVpnGateway + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetVpnGatewayAggregatedList struct { + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A map of scoped target vpn gateway lists. + Items map[string]TargetVpnGatewaysScopedList `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway + // for target VPN gateways. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetVpnGatewayAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod TargetVpnGatewayAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetVpnGatewayList: Contains a list of TargetVpnGateway resources. +type TargetVpnGatewayList struct { + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of TargetVpnGateway resources. + Items []*TargetVpnGateway `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway + // for target VPN gateways. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetVpnGatewayList) MarshalJSON() ([]byte, error) { + type noMethod TargetVpnGatewayList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetVpnGatewaysScopedList struct { + // TargetVpnGateways: [Output Only] List of target vpn gateways + // contained in this scope. + TargetVpnGateways []*TargetVpnGateway `json:"targetVpnGateways,omitempty"` + + // Warning: [Output Only] Informational warning which replaces the list + // of addresses when the list is empty. + Warning *TargetVpnGatewaysScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "TargetVpnGateways") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetVpnGatewaysScopedList) MarshalJSON() ([]byte, error) { + type noMethod TargetVpnGatewaysScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetVpnGatewaysScopedListWarning: [Output Only] Informational +// warning which replaces the list of addresses when the list is empty. +type TargetVpnGatewaysScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*TargetVpnGatewaysScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetVpnGatewaysScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod TargetVpnGatewaysScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetVpnGatewaysScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetVpnGatewaysScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod TargetVpnGatewaysScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TestFailure struct { + ActualService string `json:"actualService,omitempty"` + + ExpectedService string `json:"expectedService,omitempty"` + + Host string `json:"host,omitempty"` + + Path string `json:"path,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ActualService") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TestFailure) MarshalJSON() ([]byte, error) { + type noMethod TestFailure + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UrlMap: 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. +type UrlMap struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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: [Output Only] Unique identifier for the resource. Set by the + // server. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // PathMatchers: The list of named PathMatchers to use against the URL. + PathMatchers []*PathMatcher `json:"pathMatchers,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlMap) MarshalJSON() ([]byte, error) { + type noMethod UrlMap + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UrlMapList: Contains a list of UrlMap resources. +type UrlMapList struct { + // Id: [Output Only] Unique identifier for the resource. Set by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of UrlMap resources. + Items []*UrlMap `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlMapList) MarshalJSON() ([]byte, error) { + type noMethod UrlMapList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type UrlMapReference struct { + UrlMap string `json:"urlMap,omitempty"` + + // ForceSendFields is a list of field names (e.g. "UrlMap") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlMapReference) MarshalJSON() ([]byte, error) { + type noMethod UrlMapReference + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UrlMapTest: Message for the expected URL mappings. +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"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlMapTest) MarshalJSON() ([]byte, error) { + type noMethod UrlMapTest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UrlMapValidationResult: Message representing the validation result +// for a UrlMap. +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"` + + // ForceSendFields is a list of field names (e.g. "LoadErrors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlMapValidationResult) MarshalJSON() ([]byte, error) { + type noMethod UrlMapValidationResult + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type UrlMapsValidateRequest struct { + // Resource: Content of the UrlMap to be validated. + Resource *UrlMap `json:"resource,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Resource") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlMapsValidateRequest) MarshalJSON() ([]byte, error) { + type noMethod UrlMapsValidateRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type UrlMapsValidateResponse struct { + Result *UrlMapValidationResult `json:"result,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Result") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlMapsValidateResponse) MarshalJSON() ([]byte, error) { + type noMethod UrlMapsValidateResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UsageExportLocation: The location in Cloud Storage and naming method +// of the daily usage report. Contains bucket_name and report_name +// prefix. +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 just 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 bucketName. If not supplied, defaults to usage. The + // report is stored as a CSV file named + // report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the + // usage according to Pacific Time. If you supply a prefix, it should + // conform to Cloud Storage object naming conventions. + ReportNamePrefix string `json:"reportNamePrefix,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BucketName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UsageExportLocation) MarshalJSON() ([]byte, error) { + type noMethod UsageExportLocation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type VpnTunnel struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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"` + + // DetailedStatus: [Output Only] Detailed status message for the VPN + // tunnel. + DetailedStatus string `json:"detailedStatus,omitempty"` + + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // IkeVersion: IKE protocol version to use when establishing the VPN + // tunnel with peer VPN gateway. Acceptable IKE versions are 1 or 2. + // Default version is 2. + IkeVersion int64 `json:"ikeVersion,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for + // VPN tunnels. + 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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // PeerIp: IP address of the peer VPN gateway. + PeerIp string `json:"peerIp,omitempty"` + + // Region: [Output Only] URL of the region where the VPN tunnel resides. + Region string `json:"region,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // SharedSecret: Shared secret used to set the secure session between + // the GCE VPN gateway and the peer VPN gateway. + SharedSecret string `json:"sharedSecret,omitempty"` + + // SharedSecretHash: Hash of the shared secret. + SharedSecretHash string `json:"sharedSecretHash,omitempty"` + + // Status: [Output Only] The status of the VPN tunnel. + // + // Possible values: + // "AUTHORIZATION_ERROR" + // "DEPROVISIONING" + // "ESTABLISHED" + // "FAILED" + // "FIRST_HANDSHAKE" + // "NEGOTIATION_FAILURE" + // "NETWORK_ERROR" + // "NO_INCOMING_PACKETS" + // "PROVISIONING" + // "REJECTED" + // "WAITING_FOR_FULL_CONFIG" + Status string `json:"status,omitempty"` + + // TargetVpnGateway: URL of the VPN gateway to which this VPN tunnel is + // associated. Provided by the client when the VPN tunnel is created. + TargetVpnGateway string `json:"targetVpnGateway,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VpnTunnel) MarshalJSON() ([]byte, error) { + type noMethod VpnTunnel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type VpnTunnelAggregatedList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A map of scoped vpn tunnel lists. + Items map[string]VpnTunnelsScopedList `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for + // VPN tunnels. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VpnTunnelAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod VpnTunnelAggregatedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VpnTunnelList: Contains a list of VpnTunnel resources. +type VpnTunnelList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of VpnTunnel resources. + Items []*VpnTunnel `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for + // VPN tunnels. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VpnTunnelList) MarshalJSON() ([]byte, error) { + type noMethod VpnTunnelList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type VpnTunnelsScopedList struct { + // VpnTunnels: List of vpn tunnels contained in this scope. + VpnTunnels []*VpnTunnel `json:"vpnTunnels,omitempty"` + + // Warning: Informational warning which replaces the list of addresses + // when the list is empty. + Warning *VpnTunnelsScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "VpnTunnels") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VpnTunnelsScopedList) MarshalJSON() ([]byte, error) { + type noMethod VpnTunnelsScopedList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VpnTunnelsScopedListWarning: Informational warning which replaces the +// list of addresses when the list is empty. +type VpnTunnelsScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*VpnTunnelsScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VpnTunnelsScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod VpnTunnelsScopedListWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type VpnTunnelsScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VpnTunnelsScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod VpnTunnelsScopedListWarningData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Zone: A Zone resource. +type Zone struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Deprecated: [Output Only] The deprecation status associated with this + // zone. + Deprecated *DeprecationStatus `json:"deprecated,omitempty"` + + // Description: [Output Only] Textual description of the resource. + Description string `json:"description,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always kind#zone for zones. + Kind string `json:"kind,omitempty"` + + // MaintenanceWindows: [Output Only] Any scheduled maintenance windows + // for this zone. When the zone is in a maintenance window, all + // resources which reside in the zone will be unavailable. For more + // information, see Maintenance Windows + MaintenanceWindows []*ZoneMaintenanceWindows `json:"maintenanceWindows,omitempty"` + + // Name: [Output Only] Name of the resource. + Name string `json:"name,omitempty"` + + // Region: [Output Only] Full URL reference to the region which hosts + // the zone. + Region string `json:"region,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // Status: [Output Only] Status of the zone, either UP or DOWN. + // + // Possible values: + // "DOWN" + // "UP" + Status string `json:"status,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Zone) MarshalJSON() ([]byte, error) { + type noMethod Zone + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ZoneMaintenanceWindows struct { + // BeginTime: [Output Only] Starting time of the maintenance window, in + // RFC3339 format. + BeginTime string `json:"beginTime,omitempty"` + + // Description: [Output Only] Textual description of the maintenance + // window. + Description string `json:"description,omitempty"` + + // EndTime: [Output Only] Ending time of the maintenance window, in + // RFC3339 format. + EndTime string `json:"endTime,omitempty"` + + // Name: [Output Only] Name of the maintenance window. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BeginTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ZoneMaintenanceWindows) MarshalJSON() ([]byte, error) { + type noMethod ZoneMaintenanceWindows + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ZoneList: Contains a list of zone resources. +type ZoneList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of Zone resources. + Items []*Zone `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ZoneList) MarshalJSON() ([]byte, error) { + type noMethod ZoneList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "compute.addresses.aggregatedList": + +type AddressesAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of addresses grouped by scope. +// For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/aggregatedList +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *AddressesAggregatedListCall) MaxResults(maxResults int64) *AddressesAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *AddressesAggregatedListCall) PageToken(pageToken string) *AddressesAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AddressesAggregatedListCall) Fields(s ...googleapi.Field) *AddressesAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AddressesAggregatedListCall) IfNoneMatch(entityTag string) *AddressesAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AddressesAggregatedListCall) Context(ctx context.Context) *AddressesAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *AddressesAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/addresses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.addresses.aggregatedList" call. +// Exactly one of *AddressAggregatedList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AddressAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AddressesAggregatedListCall) Do() (*AddressAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AddressAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of addresses grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.addresses.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified address resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AddressesDeleteCall) Fields(s ...googleapi.Field) *AddressesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AddressesDeleteCall) Context(ctx context.Context) *AddressesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AddressesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "address": c.address, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.addresses.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AddressesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the region for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Returns the specified address resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AddressesGetCall) Fields(s ...googleapi.Field) *AddressesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AddressesGetCall) IfNoneMatch(entityTag string) *AddressesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AddressesGetCall) Context(ctx context.Context) *AddressesGetCall { + c.ctx_ = ctx + return c +} + +func (c *AddressesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "address": c.address, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.addresses.get" call. +// Exactly one of *Address or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Address.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AddressesGetCall) Do() (*Address, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Address{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the region for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates an address resource in the specified project using +// the data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AddressesInsertCall) Fields(s ...googleapi.Field) *AddressesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AddressesInsertCall) Context(ctx context.Context) *AddressesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *AddressesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.addresses.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AddressesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the region for 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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.addresses.list": + +type AddressesListCall struct { + s *Service + project string + region string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of address resources contained within the +// specified region. +// For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *AddressesListCall) MaxResults(maxResults int64) *AddressesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *AddressesListCall) PageToken(pageToken string) *AddressesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AddressesListCall) Fields(s ...googleapi.Field) *AddressesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AddressesListCall) IfNoneMatch(entityTag string) *AddressesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AddressesListCall) Context(ctx context.Context) *AddressesListCall { + c.ctx_ = ctx + return c +} + +func (c *AddressesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.addresses.list" call. +// Exactly one of *AddressList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AddressList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AddressesListCall) Do() (*AddressList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AddressList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of address resources contained within the specified region.", + // "httpMethod": "GET", + // "id": "compute.addresses.list", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the region for 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/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.autoscalers.aggregatedList": + +type AutoscalersAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of autoscalers grouped by scope. +func (r *AutoscalersService) AggregatedList(project string) *AutoscalersAggregatedListCall { + c := &AutoscalersAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *AutoscalersAggregatedListCall) Filter(filter string) *AutoscalersAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *AutoscalersAggregatedListCall) MaxResults(maxResults int64) *AutoscalersAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *AutoscalersAggregatedListCall) PageToken(pageToken string) *AutoscalersAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AutoscalersAggregatedListCall) Fields(s ...googleapi.Field) *AutoscalersAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AutoscalersAggregatedListCall) IfNoneMatch(entityTag string) *AutoscalersAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AutoscalersAggregatedListCall) Context(ctx context.Context) *AutoscalersAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/autoscalers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.autoscalers.aggregatedList" call. +// Exactly one of *AutoscalerAggregatedList or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *AutoscalerAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AutoscalersAggregatedListCall) Do() (*AutoscalerAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AutoscalerAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of autoscalers grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.autoscalers.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/autoscalers", + // "response": { + // "$ref": "AutoscalerAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.autoscalers.delete": + +type AutoscalersDeleteCall struct { + s *Service + project string + zone string + autoscaler string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified autoscaler resource. +func (r *AutoscalersService) Delete(project string, zone string, autoscaler string) *AutoscalersDeleteCall { + c := &AutoscalersDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.autoscaler = autoscaler + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AutoscalersDeleteCall) Fields(s ...googleapi.Field) *AutoscalersDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AutoscalersDeleteCall) Context(ctx context.Context) *AutoscalersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "autoscaler": c.autoscaler, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.autoscalers.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AutoscalersDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified autoscaler resource.", + // "httpMethod": "DELETE", + // "id": "compute.autoscalers.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "autoscaler" + // ], + // "parameters": { + // "autoscaler": { + // "description": "Name of the persistent autoscaler 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}/autoscalers/{autoscaler}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.autoscalers.get": + +type AutoscalersGetCall struct { + s *Service + project string + zone string + autoscaler string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified autoscaler resource. +func (r *AutoscalersService) Get(project string, zone string, autoscaler string) *AutoscalersGetCall { + c := &AutoscalersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.autoscaler = autoscaler + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AutoscalersGetCall) Fields(s ...googleapi.Field) *AutoscalersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AutoscalersGetCall) IfNoneMatch(entityTag string) *AutoscalersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AutoscalersGetCall) Context(ctx context.Context) *AutoscalersGetCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "autoscaler": c.autoscaler, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.autoscalers.get" call. +// Exactly one of *Autoscaler or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Autoscaler.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AutoscalersGetCall) Do() (*Autoscaler, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Autoscaler{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified autoscaler resource.", + // "httpMethod": "GET", + // "id": "compute.autoscalers.get", + // "parameterOrder": [ + // "project", + // "zone", + // "autoscaler" + // ], + // "parameters": { + // "autoscaler": { + // "description": "Name of the persistent autoscaler 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}/autoscalers/{autoscaler}", + // "response": { + // "$ref": "Autoscaler" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.autoscalers.insert": + +type AutoscalersInsertCall struct { + s *Service + project string + zone string + autoscaler *Autoscaler + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates an autoscaler resource in the specified project using +// the data included in the request. +func (r *AutoscalersService) Insert(project string, zone string, autoscaler *Autoscaler) *AutoscalersInsertCall { + c := &AutoscalersInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.autoscaler = autoscaler + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AutoscalersInsertCall) Fields(s ...googleapi.Field) *AutoscalersInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AutoscalersInsertCall) Context(ctx context.Context) *AutoscalersInsertCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.autoscalers.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AutoscalersInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an autoscaler resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.autoscalers.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}/autoscalers", + // "request": { + // "$ref": "Autoscaler" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.autoscalers.list": + +type AutoscalersListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of autoscaler resources contained within the +// specified zone. +func (r *AutoscalersService) List(project string, zone string) *AutoscalersListCall { + c := &AutoscalersListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *AutoscalersListCall) Filter(filter string) *AutoscalersListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *AutoscalersListCall) MaxResults(maxResults int64) *AutoscalersListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *AutoscalersListCall) PageToken(pageToken string) *AutoscalersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AutoscalersListCall) Fields(s ...googleapi.Field) *AutoscalersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AutoscalersListCall) IfNoneMatch(entityTag string) *AutoscalersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AutoscalersListCall) Context(ctx context.Context) *AutoscalersListCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.autoscalers.list" call. +// Exactly one of *AutoscalerList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AutoscalerList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AutoscalersListCall) Do() (*AutoscalerList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AutoscalerList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of autoscaler resources contained within the specified zone.", + // "httpMethod": "GET", + // "id": "compute.autoscalers.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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}/autoscalers", + // "response": { + // "$ref": "AutoscalerList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.autoscalers.patch": + +type AutoscalersPatchCall struct { + s *Service + project string + zone string + autoscaler string + autoscaler2 *Autoscaler + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an autoscaler resource in the specified project using +// the data included in the request. This method supports patch +// semantics. +func (r *AutoscalersService) Patch(project string, zone string, autoscaler string, autoscaler2 *Autoscaler) *AutoscalersPatchCall { + c := &AutoscalersPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.autoscaler = autoscaler + c.autoscaler2 = autoscaler2 + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AutoscalersPatchCall) Fields(s ...googleapi.Field) *AutoscalersPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AutoscalersPatchCall) Context(ctx context.Context) *AutoscalersPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("autoscaler", fmt.Sprintf("%v", c.autoscaler)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.autoscalers.patch" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AutoscalersPatchCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an autoscaler resource in the specified project using the data included in the request. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "compute.autoscalers.patch", + // "parameterOrder": [ + // "project", + // "zone", + // "autoscaler" + // ], + // "parameters": { + // "autoscaler": { + // "description": "Name of the autoscaler resource to update.", + // "location": "query", + // "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}/autoscalers", + // "request": { + // "$ref": "Autoscaler" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.autoscalers.update": + +type AutoscalersUpdateCall struct { + s *Service + project string + zone string + autoscaler *Autoscaler + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an autoscaler resource in the specified project using +// the data included in the request. +func (r *AutoscalersService) Update(project string, zone string, autoscaler *Autoscaler) *AutoscalersUpdateCall { + c := &AutoscalersUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.autoscaler = autoscaler + return c +} + +// Autoscaler sets the optional parameter "autoscaler": Name of the +// autoscaler resource to update. +func (c *AutoscalersUpdateCall) Autoscaler(autoscaler string) *AutoscalersUpdateCall { + c.opt_["autoscaler"] = autoscaler + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AutoscalersUpdateCall) Fields(s ...googleapi.Field) *AutoscalersUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AutoscalersUpdateCall) Context(ctx context.Context) *AutoscalersUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["autoscaler"]; ok { + params.Set("autoscaler", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.autoscalers.update" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AutoscalersUpdateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an autoscaler resource in the specified project using the data included in the request.", + // "httpMethod": "PUT", + // "id": "compute.autoscalers.update", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "autoscaler": { + // "description": "Name of the autoscaler resource to update.", + // "location": "query", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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}/autoscalers", + // "request": { + // "$ref": "Autoscaler" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.backendServices.delete": + +type BackendServicesDeleteCall struct { + s *Service + project string + backendService string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified BackendService resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BackendServicesDeleteCall) Fields(s ...googleapi.Field) *BackendServicesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BackendServicesDeleteCall) Context(ctx context.Context) *BackendServicesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *BackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "backendService": c.backendService, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.backendServices.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *BackendServicesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.backendServices.get": + +type BackendServicesGetCall struct { + s *Service + project string + backendService string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified BackendService resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BackendServicesGetCall) Fields(s ...googleapi.Field) *BackendServicesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BackendServicesGetCall) IfNoneMatch(entityTag string) *BackendServicesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BackendServicesGetCall) Context(ctx context.Context) *BackendServicesGetCall { + c.ctx_ = ctx + return c +} + +func (c *BackendServicesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "backendService": c.backendService, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.backendServices.get" call. +// Exactly one of *BackendService or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *BackendService.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BackendServicesGetCall) Do() (*BackendService, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BackendService{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// GetHealth: Gets the most recent health check results for this +// BackendService. +// For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/getHealth +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BackendServicesGetHealthCall) Fields(s ...googleapi.Field) *BackendServicesGetHealthCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BackendServicesGetHealthCall) Context(ctx context.Context) *BackendServicesGetHealthCall { + c.ctx_ = ctx + return c +} + +func (c *BackendServicesGetHealthCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/getHealth") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "backendService": c.backendService, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.backendServices.getHealth" call. +// Exactly one of *BackendServiceGroupHealth or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *BackendServiceGroupHealth.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BackendServicesGetHealthCall) Do() (*BackendServiceGroupHealth, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BackendServiceGroupHealth{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates a BackendService resource in the specified project +// using the data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BackendServicesInsertCall) Fields(s ...googleapi.Field) *BackendServicesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BackendServicesInsertCall) Context(ctx context.Context) *BackendServicesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *BackendServicesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.backendServices.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *BackendServicesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.backendServices.list": + +type BackendServicesListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of BackendService resources available to the +// specified project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *BackendServicesListCall) MaxResults(maxResults int64) *BackendServicesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *BackendServicesListCall) PageToken(pageToken string) *BackendServicesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BackendServicesListCall) Fields(s ...googleapi.Field) *BackendServicesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BackendServicesListCall) IfNoneMatch(entityTag string) *BackendServicesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BackendServicesListCall) Context(ctx context.Context) *BackendServicesListCall { + c.ctx_ = ctx + return c +} + +func (c *BackendServicesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.backendServices.list" call. +// Exactly one of *BackendServiceList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BackendServiceList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BackendServicesListCall) Do() (*BackendServiceList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BackendServiceList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of BackendService resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.backendServices.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Patch: Update the entire content of the BackendService resource. This +// method supports patch semantics. +// For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/patch +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BackendServicesPatchCall) Fields(s ...googleapi.Field) *BackendServicesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BackendServicesPatchCall) Context(ctx context.Context) *BackendServicesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *BackendServicesPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "backendService": c.backendService, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.backendServices.patch" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *BackendServicesPatchCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update the 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Update: Update the entire content of the BackendService resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/update +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BackendServicesUpdateCall) Fields(s ...googleapi.Field) *BackendServicesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BackendServicesUpdateCall) Context(ctx context.Context) *BackendServicesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *BackendServicesUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "backendService": c.backendService, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.backendServices.update" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *BackendServicesUpdateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update the 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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.diskTypes.aggregatedList": + +type DiskTypesAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of disk type resources grouped by +// scope. +// For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/aggregatedList +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *DiskTypesAggregatedListCall) MaxResults(maxResults int64) *DiskTypesAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *DiskTypesAggregatedListCall) PageToken(pageToken string) *DiskTypesAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DiskTypesAggregatedListCall) Fields(s ...googleapi.Field) *DiskTypesAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DiskTypesAggregatedListCall) IfNoneMatch(entityTag string) *DiskTypesAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DiskTypesAggregatedListCall) Context(ctx context.Context) *DiskTypesAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *DiskTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/diskTypes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.diskTypes.aggregatedList" call. +// Exactly one of *DiskTypeAggregatedList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DiskTypeAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DiskTypesAggregatedListCall) Do() (*DiskTypeAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DiskTypeAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of disk type resources grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.diskTypes.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Returns the specified disk type resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DiskTypesGetCall) Fields(s ...googleapi.Field) *DiskTypesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DiskTypesGetCall) IfNoneMatch(entityTag string) *DiskTypesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DiskTypesGetCall) Context(ctx context.Context) *DiskTypesGetCall { + c.ctx_ = ctx + return c +} + +func (c *DiskTypesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes/{diskType}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "diskType": c.diskType, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.diskTypes.get" call. +// Exactly one of *DiskType or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *DiskType.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DiskTypesGetCall) Do() (*DiskType, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DiskType{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// List: Retrieves the list of disk type resources available to the +// specified project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *DiskTypesListCall) MaxResults(maxResults int64) *DiskTypesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *DiskTypesListCall) PageToken(pageToken string) *DiskTypesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DiskTypesListCall) Fields(s ...googleapi.Field) *DiskTypesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DiskTypesListCall) IfNoneMatch(entityTag string) *DiskTypesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DiskTypesListCall) Context(ctx context.Context) *DiskTypesListCall { + c.ctx_ = ctx + return c +} + +func (c *DiskTypesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.diskTypes.list" call. +// Exactly one of *DiskTypeList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DiskTypeList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DiskTypesListCall) Do() (*DiskTypeList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DiskTypeList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of disk type resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.diskTypes.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of disks grouped by scope. +// For details, see https://cloud.google.com/compute/docs/reference/latest/disks/aggregatedList +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *DisksAggregatedListCall) MaxResults(maxResults int64) *DisksAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *DisksAggregatedListCall) PageToken(pageToken string) *DisksAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DisksAggregatedListCall) Fields(s ...googleapi.Field) *DisksAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DisksAggregatedListCall) IfNoneMatch(entityTag string) *DisksAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DisksAggregatedListCall) Context(ctx context.Context) *DisksAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *DisksAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/disks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.disks.aggregatedList" call. +// Exactly one of *DiskAggregatedList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DiskAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DisksAggregatedListCall) Do() (*DiskAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DiskAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of disks grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.disks.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// CreateSnapshot: Creates a snapshot of this disk. +// For details, see https://cloud.google.com/compute/docs/reference/latest/disks/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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DisksCreateSnapshotCall) Fields(s ...googleapi.Field) *DisksCreateSnapshotCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DisksCreateSnapshotCall) Context(ctx context.Context) *DisksCreateSnapshotCall { + c.ctx_ = ctx + return c +} + +func (c *DisksCreateSnapshotCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/createSnapshot") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "disk": c.disk, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.disks.createSnapshot" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DisksCreateSnapshotCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a snapshot of this disk.", + // "httpMethod": "POST", + // "id": "compute.disks.createSnapshot", + // "parameterOrder": [ + // "project", + // "zone", + // "disk" + // ], + // "parameters": { + // "disk": { + // "description": "Name of the persistent disk to snapshot.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified persistent disk. Deleting a disk +// removes its data permanently and is irreversible. However, deleting a +// disk does not delete any snapshots previously made from the disk. You +// must separately delete snapshots. +// For details, see https://cloud.google.com/compute/docs/reference/latest/disks/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DisksDeleteCall) Fields(s ...googleapi.Field) *DisksDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DisksDeleteCall) Context(ctx context.Context) *DisksDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *DisksDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "disk": c.disk, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.disks.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DisksDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots.", + // "httpMethod": "DELETE", + // "id": "compute.disks.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "disk" + // ], + // "parameters": { + // "disk": { + // "description": "Name of the persistent disk to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Returns a specified persistent disk. +// For details, see https://cloud.google.com/compute/docs/reference/latest/disks/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DisksGetCall) Fields(s ...googleapi.Field) *DisksGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DisksGetCall) IfNoneMatch(entityTag string) *DisksGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DisksGetCall) Context(ctx context.Context) *DisksGetCall { + c.ctx_ = ctx + return c +} + +func (c *DisksGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "disk": c.disk, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.disks.get" call. +// Exactly one of *Disk or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Disk.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *DisksGetCall) Do() (*Disk, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Disk{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a specified persistent disk.", + // "httpMethod": "GET", + // "id": "compute.disks.get", + // "parameterOrder": [ + // "project", + // "zone", + // "disk" + // ], + // "parameters": { + // "disk": { + // "description": "Name of the persistent disk to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates a persistent disk in the specified project using the +// data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/disks/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DisksInsertCall) Fields(s ...googleapi.Field) *DisksInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DisksInsertCall) Context(ctx context.Context) *DisksInsertCall { + c.ctx_ = ctx + return c +} + +func (c *DisksInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["sourceImage"]; ok { + params.Set("sourceImage", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.disks.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DisksInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a persistent disk in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.disks.insert", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.disks.list": + +type DisksListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of persistent disks contained within the +// specified zone. +// For details, see https://cloud.google.com/compute/docs/reference/latest/disks/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *DisksListCall) MaxResults(maxResults int64) *DisksListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *DisksListCall) PageToken(pageToken string) *DisksListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DisksListCall) Fields(s ...googleapi.Field) *DisksListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DisksListCall) IfNoneMatch(entityTag string) *DisksListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DisksListCall) Context(ctx context.Context) *DisksListCall { + c.ctx_ = ctx + return c +} + +func (c *DisksListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.disks.list" call. +// Exactly one of *DiskList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *DiskList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DisksListCall) Do() (*DiskList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DiskList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of persistent disks contained within the specified zone.", + // "httpMethod": "GET", + // "id": "compute.disks.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified firewall resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FirewallsDeleteCall) Fields(s ...googleapi.Field) *FirewallsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FirewallsDeleteCall) Context(ctx context.Context) *FirewallsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *FirewallsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "firewall": c.firewall, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.firewalls.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FirewallsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.firewalls.get": + +type FirewallsGetCall struct { + s *Service + project string + firewall string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified firewall resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FirewallsGetCall) Fields(s ...googleapi.Field) *FirewallsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FirewallsGetCall) IfNoneMatch(entityTag string) *FirewallsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FirewallsGetCall) Context(ctx context.Context) *FirewallsGetCall { + c.ctx_ = ctx + return c +} + +func (c *FirewallsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "firewall": c.firewall, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.firewalls.get" call. +// Exactly one of *Firewall or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Firewall.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FirewallsGetCall) Do() (*Firewall, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Firewall{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates a firewall resource in the specified project using +// the data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FirewallsInsertCall) Fields(s ...googleapi.Field) *FirewallsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FirewallsInsertCall) Context(ctx context.Context) *FirewallsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *FirewallsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.firewalls.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FirewallsInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.firewalls.list": + +type FirewallsListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of firewall resources available to the +// specified project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *FirewallsListCall) MaxResults(maxResults int64) *FirewallsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *FirewallsListCall) PageToken(pageToken string) *FirewallsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FirewallsListCall) Fields(s ...googleapi.Field) *FirewallsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FirewallsListCall) IfNoneMatch(entityTag string) *FirewallsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FirewallsListCall) Context(ctx context.Context) *FirewallsListCall { + c.ctx_ = ctx + return c +} + +func (c *FirewallsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.firewalls.list" call. +// Exactly one of *FirewallList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *FirewallList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FirewallsListCall) Do() (*FirewallList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FirewallList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of firewall resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.firewalls.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Patch: Updates the specified firewall resource with the data included +// in the request. This method supports patch semantics. +// For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/patch +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FirewallsPatchCall) Fields(s ...googleapi.Field) *FirewallsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FirewallsPatchCall) Context(ctx context.Context) *FirewallsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *FirewallsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "firewall": c.firewall, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.firewalls.patch" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FirewallsPatchCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Update: Updates the specified firewall resource with the data +// included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/update +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FirewallsUpdateCall) Fields(s ...googleapi.Field) *FirewallsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FirewallsUpdateCall) Context(ctx context.Context) *FirewallsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *FirewallsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "firewall": c.firewall, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.firewalls.update" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FirewallsUpdateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.forwardingRules.aggregatedList": + +type ForwardingRulesAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of forwarding rules grouped by +// scope. +// For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/aggregatedList +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *ForwardingRulesAggregatedListCall) MaxResults(maxResults int64) *ForwardingRulesAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *ForwardingRulesAggregatedListCall) PageToken(pageToken string) *ForwardingRulesAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ForwardingRulesAggregatedListCall) Fields(s ...googleapi.Field) *ForwardingRulesAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ForwardingRulesAggregatedListCall) IfNoneMatch(entityTag string) *ForwardingRulesAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ForwardingRulesAggregatedListCall) Context(ctx context.Context) *ForwardingRulesAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *ForwardingRulesAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/forwardingRules") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.forwardingRules.aggregatedList" call. +// Exactly one of *ForwardingRuleAggregatedList or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ForwardingRuleAggregatedList.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ForwardingRulesAggregatedListCall) Do() (*ForwardingRuleAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ForwardingRuleAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of forwarding rules grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.forwardingRules.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified ForwardingRule resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *ForwardingRulesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ForwardingRulesDeleteCall) Context(ctx context.Context) *ForwardingRulesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "forwardingRule": c.forwardingRule, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.forwardingRules.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ForwardingRulesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Returns the specified ForwardingRule resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ForwardingRulesGetCall) Fields(s ...googleapi.Field) *ForwardingRulesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ForwardingRulesGetCall) IfNoneMatch(entityTag string) *ForwardingRulesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ForwardingRulesGetCall) Context(ctx context.Context) *ForwardingRulesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "forwardingRule": c.forwardingRule, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.forwardingRules.get" call. +// Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ForwardingRule.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ForwardingRulesGetCall) Do() (*ForwardingRule, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ForwardingRule{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates a ForwardingRule resource in the specified project +// and region using the data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ForwardingRulesInsertCall) Fields(s ...googleapi.Field) *ForwardingRulesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ForwardingRulesInsertCall) Context(ctx context.Context) *ForwardingRulesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ForwardingRulesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.forwardingRules.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ForwardingRulesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.forwardingRules.list": + +type ForwardingRulesListCall struct { + s *Service + project string + region string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of ForwardingRule resources available to the +// specified project and region. +// For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *ForwardingRulesListCall) MaxResults(maxResults int64) *ForwardingRulesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *ForwardingRulesListCall) PageToken(pageToken string) *ForwardingRulesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ForwardingRulesListCall) Fields(s ...googleapi.Field) *ForwardingRulesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ForwardingRulesListCall) IfNoneMatch(entityTag string) *ForwardingRulesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ForwardingRulesListCall) Context(ctx context.Context) *ForwardingRulesListCall { + c.ctx_ = ctx + return c +} + +func (c *ForwardingRulesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.forwardingRules.list" call. +// Exactly one of *ForwardingRuleList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ForwardingRuleList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ForwardingRulesListCall) Do() (*ForwardingRuleList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ForwardingRuleList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of ForwardingRule resources available to the specified project and region.", + // "httpMethod": "GET", + // "id": "compute.forwardingRules.list", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// SetTarget: Changes target url for forwarding rule. +// For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/setTarget +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *ForwardingRulesSetTargetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ForwardingRulesSetTargetCall) Context(ctx context.Context) *ForwardingRulesSetTargetCall { + c.ctx_ = ctx + return c +} + +func (c *ForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "forwardingRule": c.forwardingRule, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.forwardingRules.setTarget" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ForwardingRulesSetTargetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalAddresses.delete": + +type GlobalAddressesDeleteCall struct { + s *Service + project string + address string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified address resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalAddressesDeleteCall) Fields(s ...googleapi.Field) *GlobalAddressesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalAddressesDeleteCall) Context(ctx context.Context) *GlobalAddressesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalAddressesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "address": c.address, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalAddresses.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GlobalAddressesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalAddresses.get": + +type GlobalAddressesGetCall struct { + s *Service + project string + address string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified address resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalAddressesGetCall) Fields(s ...googleapi.Field) *GlobalAddressesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalAddressesGetCall) IfNoneMatch(entityTag string) *GlobalAddressesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalAddressesGetCall) Context(ctx context.Context) *GlobalAddressesGetCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalAddressesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "address": c.address, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalAddresses.get" call. +// Exactly one of *Address or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Address.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *GlobalAddressesGetCall) Do() (*Address, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Address{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates an address resource in the specified project using +// the data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalAddressesInsertCall) Fields(s ...googleapi.Field) *GlobalAddressesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalAddressesInsertCall) Context(ctx context.Context) *GlobalAddressesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalAddressesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalAddresses.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GlobalAddressesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalAddresses.list": + +type GlobalAddressesListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of global address resources. +// For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *GlobalAddressesListCall) MaxResults(maxResults int64) *GlobalAddressesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *GlobalAddressesListCall) PageToken(pageToken string) *GlobalAddressesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalAddressesListCall) Fields(s ...googleapi.Field) *GlobalAddressesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalAddressesListCall) IfNoneMatch(entityTag string) *GlobalAddressesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalAddressesListCall) Context(ctx context.Context) *GlobalAddressesListCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalAddressesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalAddresses.list" call. +// Exactly one of *AddressList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AddressList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GlobalAddressesListCall) Do() (*AddressList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AddressList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of global address resources.", + // "httpMethod": "GET", + // "id": "compute.globalAddresses.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified ForwardingRule resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalForwardingRulesDeleteCall) Context(ctx context.Context) *GlobalForwardingRulesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "forwardingRule": c.forwardingRule, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalForwardingRules.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GlobalForwardingRulesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalForwardingRules.get": + +type GlobalForwardingRulesGetCall struct { + s *Service + project string + forwardingRule string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified ForwardingRule resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalForwardingRulesGetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalForwardingRulesGetCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalForwardingRulesGetCall) Context(ctx context.Context) *GlobalForwardingRulesGetCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "forwardingRule": c.forwardingRule, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalForwardingRules.get" call. +// Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ForwardingRule.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *GlobalForwardingRulesGetCall) Do() (*ForwardingRule, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ForwardingRule{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates a ForwardingRule resource in the specified project +// and region using the data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalForwardingRulesInsertCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalForwardingRulesInsertCall) Context(ctx context.Context) *GlobalForwardingRulesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalForwardingRulesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalForwardingRules.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GlobalForwardingRulesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalForwardingRules.list": + +type GlobalForwardingRulesListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of ForwardingRule resources available to the +// specified project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *GlobalForwardingRulesListCall) MaxResults(maxResults int64) *GlobalForwardingRulesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *GlobalForwardingRulesListCall) PageToken(pageToken string) *GlobalForwardingRulesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalForwardingRulesListCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalForwardingRulesListCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalForwardingRulesListCall) Context(ctx context.Context) *GlobalForwardingRulesListCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalForwardingRulesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalForwardingRules.list" call. +// Exactly one of *ForwardingRuleList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ForwardingRuleList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *GlobalForwardingRulesListCall) Do() (*ForwardingRuleList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ForwardingRuleList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of ForwardingRule resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.globalForwardingRules.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// SetTarget: Changes target url for forwarding rule. +// For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/setTarget +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetTargetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalForwardingRulesSetTargetCall) Context(ctx context.Context) *GlobalForwardingRulesSetTargetCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}/setTarget") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "forwardingRule": c.forwardingRule, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalForwardingRules.setTarget" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GlobalForwardingRulesSetTargetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalOperations.aggregatedList": + +type GlobalOperationsAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of all operations grouped by +// scope. +// For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/aggregatedList +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *GlobalOperationsAggregatedListCall) MaxResults(maxResults int64) *GlobalOperationsAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *GlobalOperationsAggregatedListCall) PageToken(pageToken string) *GlobalOperationsAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalOperationsAggregatedListCall) Fields(s ...googleapi.Field) *GlobalOperationsAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalOperationsAggregatedListCall) IfNoneMatch(entityTag string) *GlobalOperationsAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalOperationsAggregatedListCall) Context(ctx context.Context) *GlobalOperationsAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalOperationsAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalOperations.aggregatedList" call. +// Exactly one of *OperationAggregatedList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *OperationAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *GlobalOperationsAggregatedListCall) Do() (*OperationAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperationAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of all operations grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.globalOperations.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified Operations resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalOperationsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalOperationsDeleteCall) Context(ctx context.Context) *GlobalOperationsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalOperations.delete" call. +func (c *GlobalOperationsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified Operations resource.", + // "httpMethod": "DELETE", + // "id": "compute.globalOperations.delete", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the Operations resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.globalOperations.get": + +type GlobalOperationsGetCall struct { + s *Service + project string + operation string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves the specified Operations resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalOperationsGetCall) Fields(s ...googleapi.Field) *GlobalOperationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalOperationsGetCall) IfNoneMatch(entityTag string) *GlobalOperationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalOperationsGetCall) Context(ctx context.Context) *GlobalOperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalOperationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalOperations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GlobalOperationsGetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified Operations resource.", + // "httpMethod": "GET", + // "id": "compute.globalOperations.get", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the Operations resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// List: Retrieves the list of Operation resources contained within the +// specified project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *GlobalOperationsListCall) MaxResults(maxResults int64) *GlobalOperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *GlobalOperationsListCall) PageToken(pageToken string) *GlobalOperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GlobalOperationsListCall) Fields(s ...googleapi.Field) *GlobalOperationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalOperationsListCall) IfNoneMatch(entityTag string) *GlobalOperationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GlobalOperationsListCall) Context(ctx context.Context) *GlobalOperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalOperationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalOperations.list" call. +// Exactly one of *OperationList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *OperationList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *GlobalOperationsListCall) Do() (*OperationList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperationList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of Operation resources contained within the specified project.", + // "httpMethod": "GET", + // "id": "compute.globalOperations.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified HttpHealthCheck resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpHealthChecksDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HttpHealthChecksDeleteCall) Context(ctx context.Context) *HttpHealthChecksDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *HttpHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "httpHealthCheck": c.httpHealthCheck, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpHealthChecks.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *HttpHealthChecksDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.httpHealthChecks.get": + +type HttpHealthChecksGetCall struct { + s *Service + project string + httpHealthCheck string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified HttpHealthCheck resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpHealthChecksGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *HttpHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpHealthChecksGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HttpHealthChecksGetCall) Context(ctx context.Context) *HttpHealthChecksGetCall { + c.ctx_ = ctx + return c +} + +func (c *HttpHealthChecksGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "httpHealthCheck": c.httpHealthCheck, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpHealthChecks.get" call. +// Exactly one of *HttpHealthCheck or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *HttpHealthCheck.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *HttpHealthChecksGetCall) Do() (*HttpHealthCheck, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &HttpHealthCheck{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates a HttpHealthCheck resource in the specified project +// using the data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpHealthChecksInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HttpHealthChecksInsertCall) Context(ctx context.Context) *HttpHealthChecksInsertCall { + c.ctx_ = ctx + return c +} + +func (c *HttpHealthChecksInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpHealthChecks.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *HttpHealthChecksInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.httpHealthChecks.list": + +type HttpHealthChecksListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of HttpHealthCheck resources available to +// the specified project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *HttpHealthChecksListCall) MaxResults(maxResults int64) *HttpHealthChecksListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *HttpHealthChecksListCall) PageToken(pageToken string) *HttpHealthChecksListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpHealthChecksListCall) Fields(s ...googleapi.Field) *HttpHealthChecksListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *HttpHealthChecksListCall) IfNoneMatch(entityTag string) *HttpHealthChecksListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HttpHealthChecksListCall) Context(ctx context.Context) *HttpHealthChecksListCall { + c.ctx_ = ctx + return c +} + +func (c *HttpHealthChecksListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpHealthChecks.list" call. +// Exactly one of *HttpHealthCheckList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *HttpHealthCheckList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *HttpHealthChecksListCall) Do() (*HttpHealthCheckList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &HttpHealthCheckList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of HttpHealthCheck resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.httpHealthChecks.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Patch: Updates a HttpHealthCheck resource in the specified project +// using the data included in the request. This method supports patch +// semantics. +// For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/patch +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpHealthChecksPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HttpHealthChecksPatchCall) Context(ctx context.Context) *HttpHealthChecksPatchCall { + c.ctx_ = ctx + return c +} + +func (c *HttpHealthChecksPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "httpHealthCheck": c.httpHealthCheck, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpHealthChecks.patch" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *HttpHealthChecksPatchCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Update: Updates a HttpHealthCheck resource in the specified project +// using the data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/update +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpHealthChecksUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HttpHealthChecksUpdateCall) Context(ctx context.Context) *HttpHealthChecksUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *HttpHealthChecksUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "httpHealthCheck": c.httpHealthCheck, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpHealthChecks.update" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *HttpHealthChecksUpdateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.httpsHealthChecks.delete": + +type HttpsHealthChecksDeleteCall struct { + s *Service + project string + httpsHealthCheck string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified HttpsHealthCheck resource. +func (r *HttpsHealthChecksService) Delete(project string, httpsHealthCheck string) *HttpsHealthChecksDeleteCall { + c := &HttpsHealthChecksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.httpsHealthCheck = httpsHealthCheck + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpsHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpsHealthChecksDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HttpsHealthChecksDeleteCall) Context(ctx context.Context) *HttpsHealthChecksDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *HttpsHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "httpsHealthCheck": c.httpsHealthCheck, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpsHealthChecks.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *HttpsHealthChecksDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified HttpsHealthCheck resource.", + // "httpMethod": "DELETE", + // "id": "compute.httpsHealthChecks.delete", + // "parameterOrder": [ + // "project", + // "httpsHealthCheck" + // ], + // "parameters": { + // "httpsHealthCheck": { + // "description": "Name of the HttpsHealthCheck 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/httpsHealthChecks/{httpsHealthCheck}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.httpsHealthChecks.get": + +type HttpsHealthChecksGetCall struct { + s *Service + project string + httpsHealthCheck string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified HttpsHealthCheck resource. +func (r *HttpsHealthChecksService) Get(project string, httpsHealthCheck string) *HttpsHealthChecksGetCall { + c := &HttpsHealthChecksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.httpsHealthCheck = httpsHealthCheck + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpsHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpsHealthChecksGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *HttpsHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpsHealthChecksGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HttpsHealthChecksGetCall) Context(ctx context.Context) *HttpsHealthChecksGetCall { + c.ctx_ = ctx + return c +} + +func (c *HttpsHealthChecksGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "httpsHealthCheck": c.httpsHealthCheck, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpsHealthChecks.get" call. +// Exactly one of *HttpsHealthCheck or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *HttpsHealthCheck.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *HttpsHealthChecksGetCall) Do() (*HttpsHealthCheck, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &HttpsHealthCheck{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified HttpsHealthCheck resource.", + // "httpMethod": "GET", + // "id": "compute.httpsHealthChecks.get", + // "parameterOrder": [ + // "project", + // "httpsHealthCheck" + // ], + // "parameters": { + // "httpsHealthCheck": { + // "description": "Name of the HttpsHealthCheck 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/httpsHealthChecks/{httpsHealthCheck}", + // "response": { + // "$ref": "HttpsHealthCheck" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.httpsHealthChecks.insert": + +type HttpsHealthChecksInsertCall struct { + s *Service + project string + httpshealthcheck *HttpsHealthCheck + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a HttpsHealthCheck resource in the specified project +// using the data included in the request. +func (r *HttpsHealthChecksService) Insert(project string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksInsertCall { + c := &HttpsHealthChecksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.httpshealthcheck = httpshealthcheck + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpsHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpsHealthChecksInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HttpsHealthChecksInsertCall) Context(ctx context.Context) *HttpsHealthChecksInsertCall { + c.ctx_ = ctx + return c +} + +func (c *HttpsHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpsHealthChecks.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *HttpsHealthChecksInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a HttpsHealthCheck resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.httpsHealthChecks.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/httpsHealthChecks", + // "request": { + // "$ref": "HttpsHealthCheck" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.httpsHealthChecks.list": + +type HttpsHealthChecksListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of HttpsHealthCheck resources available to +// the specified project. +func (r *HttpsHealthChecksService) List(project string) *HttpsHealthChecksListCall { + c := &HttpsHealthChecksListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *HttpsHealthChecksListCall) Filter(filter string) *HttpsHealthChecksListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *HttpsHealthChecksListCall) MaxResults(maxResults int64) *HttpsHealthChecksListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *HttpsHealthChecksListCall) PageToken(pageToken string) *HttpsHealthChecksListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpsHealthChecksListCall) Fields(s ...googleapi.Field) *HttpsHealthChecksListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *HttpsHealthChecksListCall) IfNoneMatch(entityTag string) *HttpsHealthChecksListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HttpsHealthChecksListCall) Context(ctx context.Context) *HttpsHealthChecksListCall { + c.ctx_ = ctx + return c +} + +func (c *HttpsHealthChecksListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpsHealthChecks.list" call. +// Exactly one of *HttpsHealthCheckList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *HttpsHealthCheckList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *HttpsHealthChecksListCall) Do() (*HttpsHealthCheckList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &HttpsHealthCheckList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of HttpsHealthCheck resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.httpsHealthChecks.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/httpsHealthChecks", + // "response": { + // "$ref": "HttpsHealthCheckList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.httpsHealthChecks.patch": + +type HttpsHealthChecksPatchCall struct { + s *Service + project string + httpsHealthCheck string + httpshealthcheck *HttpsHealthCheck + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates a HttpsHealthCheck resource in the specified project +// using the data included in the request. This method supports patch +// semantics. +func (r *HttpsHealthChecksService) Patch(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksPatchCall { + c := &HttpsHealthChecksPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.httpsHealthCheck = httpsHealthCheck + c.httpshealthcheck = httpshealthcheck + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpsHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpsHealthChecksPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HttpsHealthChecksPatchCall) Context(ctx context.Context) *HttpsHealthChecksPatchCall { + c.ctx_ = ctx + return c +} + +func (c *HttpsHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "httpsHealthCheck": c.httpsHealthCheck, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpsHealthChecks.patch" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *HttpsHealthChecksPatchCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "compute.httpsHealthChecks.patch", + // "parameterOrder": [ + // "project", + // "httpsHealthCheck" + // ], + // "parameters": { + // "httpsHealthCheck": { + // "description": "Name of the HttpsHealthCheck 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/httpsHealthChecks/{httpsHealthCheck}", + // "request": { + // "$ref": "HttpsHealthCheck" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.httpsHealthChecks.update": + +type HttpsHealthChecksUpdateCall struct { + s *Service + project string + httpsHealthCheck string + httpshealthcheck *HttpsHealthCheck + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a HttpsHealthCheck resource in the specified project +// using the data included in the request. +func (r *HttpsHealthChecksService) Update(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksUpdateCall { + c := &HttpsHealthChecksUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.httpsHealthCheck = httpsHealthCheck + c.httpshealthcheck = httpshealthcheck + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpsHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpsHealthChecksUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HttpsHealthChecksUpdateCall) Context(ctx context.Context) *HttpsHealthChecksUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *HttpsHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "httpsHealthCheck": c.httpsHealthCheck, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpsHealthChecks.update" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *HttpsHealthChecksUpdateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request.", + // "httpMethod": "PUT", + // "id": "compute.httpsHealthChecks.update", + // "parameterOrder": [ + // "project", + // "httpsHealthCheck" + // ], + // "parameters": { + // "httpsHealthCheck": { + // "description": "Name of the HttpsHealthCheck 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/httpsHealthChecks/{httpsHealthCheck}", + // "request": { + // "$ref": "HttpsHealthCheck" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.images.delete": + +type ImagesDeleteCall struct { + s *Service + project string + image string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified image resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/images/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ImagesDeleteCall) Fields(s ...googleapi.Field) *ImagesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ImagesDeleteCall) Context(ctx context.Context) *ImagesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ImagesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "image": c.image, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.images.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ImagesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Deprecate: Sets the deprecation status of an image. +// +// If an empty request body is given, clears the deprecation status +// instead. +// For details, see https://cloud.google.com/compute/docs/reference/latest/images/deprecate +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ImagesDeprecateCall) Fields(s ...googleapi.Field) *ImagesDeprecateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ImagesDeprecateCall) Context(ctx context.Context) *ImagesDeprecateCall { + c.ctx_ = ctx + return c +} + +func (c *ImagesDeprecateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}/deprecate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "image": c.image, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.images.deprecate" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ImagesDeprecateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the deprecation status of an image.\n\nIf an empty request 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.images.get": + +type ImagesGetCall struct { + s *Service + project string + image string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified image resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/images/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ImagesGetCall) Fields(s ...googleapi.Field) *ImagesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ImagesGetCall) IfNoneMatch(entityTag string) *ImagesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ImagesGetCall) Context(ctx context.Context) *ImagesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ImagesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "image": c.image, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.images.get" call. +// Exactly one of *Image or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Image.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ImagesGetCall) Do() (*Image, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Image{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates an image resource in the specified project using the +// data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/images/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ImagesInsertCall) Fields(s ...googleapi.Field) *ImagesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ImagesInsertCall) Context(ctx context.Context) *ImagesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ImagesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.images.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ImagesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// List: Retrieves the list of private images available to the specified +// project. Private images are images you create that belong to your +// project. This method does not get any images that belong to other +// projects, including publicly-available images, like Debian 7. If you +// want to get a list of publicly-available images, use this method to +// make a request to the respective image project, such as debian-cloud +// or windows-cloud. +// +// See Accessing images for more information. +// For details, see https://cloud.google.com/compute/docs/reference/latest/images/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *ImagesListCall) MaxResults(maxResults int64) *ImagesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *ImagesListCall) PageToken(pageToken string) *ImagesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ImagesListCall) Fields(s ...googleapi.Field) *ImagesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ImagesListCall) IfNoneMatch(entityTag string) *ImagesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ImagesListCall) Context(ctx context.Context) *ImagesListCall { + c.ctx_ = ctx + return c +} + +func (c *ImagesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.images.list" call. +// Exactly one of *ImageList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ImageList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ImagesListCall) Do() (*ImageList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ImageList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of private images available to the specified project. Private images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 7. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud.\n\nSee Accessing images for more information.", + // "httpMethod": "GET", + // "id": "compute.images.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.abandonInstances": + +type InstanceGroupManagersAbandonInstancesCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// AbandonInstances: Schedules a group action to remove the specified +// instances from the managed instance group. Abandoning an instance +// does not delete the instance, but it does remove the instance from +// any target pools that are applied by the managed instance group. This +// method reduces the targetSize of the managed instance group by the +// number of instances that you abandon. This operation is marked as +// DONE when the action is scheduled even if the instances have not yet +// been removed from the group. You must separately verify the status of +// the abandoning action with the listmanagedinstances method. +func (r *InstanceGroupManagersService) AbandonInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest) *InstanceGroupManagersAbandonInstancesCall { + c := &InstanceGroupManagersAbandonInstancesCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanagersabandoninstancesrequest = instancegroupmanagersabandoninstancesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAbandonInstancesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *InstanceGroupManagersAbandonInstancesCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersabandoninstancesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.abandonInstances" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagersAbandonInstancesCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method.", + // "httpMethod": "POST", + // "id": "compute.instanceGroupManagers.abandonInstances", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances", + // "request": { + // "$ref": "InstanceGroupManagersAbandonInstancesRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.aggregatedList": + +type InstanceGroupManagersAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of managed instance groups and +// groups them by zone. +func (r *InstanceGroupManagersService) AggregatedList(project string) *InstanceGroupManagersAggregatedListCall { + c := &InstanceGroupManagersAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *InstanceGroupManagersAggregatedListCall) Filter(filter string) *InstanceGroupManagersAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *InstanceGroupManagersAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupManagersAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *InstanceGroupManagersAggregatedListCall) PageToken(pageToken string) *InstanceGroupManagersAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstanceGroupManagersAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersAggregatedListCall) Context(ctx context.Context) *InstanceGroupManagersAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroupManagers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.aggregatedList" call. +// Exactly one of *InstanceGroupManagerAggregatedList or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *InstanceGroupManagerAggregatedList.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *InstanceGroupManagersAggregatedListCall) Do() (*InstanceGroupManagerAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceGroupManagerAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of managed instance groups and groups them by zone.", + // "httpMethod": "GET", + // "id": "compute.instanceGroupManagers.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/instanceGroupManagers", + // "response": { + // "$ref": "InstanceGroupManagerAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.delete": + +type InstanceGroupManagersDeleteCall struct { + s *Service + project string + zone string + instanceGroupManager string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified managed instance group and all of the +// instances in that group. +func (r *InstanceGroupManagersService) Delete(project string, zone string, instanceGroupManager string) *InstanceGroupManagersDeleteCall { + c := &InstanceGroupManagersDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersDeleteCall) Context(ctx context.Context) *InstanceGroupManagersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagersDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified managed instance group and all of the instances in that group.", + // "httpMethod": "DELETE", + // "id": "compute.instanceGroupManagers.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.deleteInstances": + +type InstanceGroupManagersDeleteInstancesCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// DeleteInstances: Schedules a group action to delete the specified +// instances in the managed instance group. The instances are also +// removed from any target pools of which they were a member. This +// method reduces the targetSize of the managed instance group by the +// number of instances that you delete. This operation is marked as DONE +// when the action is scheduled even if the instances are still being +// deleted. You must separately verify the status of the deleting action +// with the listmanagedinstances method. +func (r *InstanceGroupManagersService) DeleteInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest) *InstanceGroupManagersDeleteInstancesCall { + c := &InstanceGroupManagersDeleteInstancesCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanagersdeleteinstancesrequest = instancegroupmanagersdeleteinstancesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteInstancesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *InstanceGroupManagersDeleteInstancesCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteinstancesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.deleteInstances" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagersDeleteInstancesCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method.", + // "httpMethod": "POST", + // "id": "compute.instanceGroupManagers.deleteInstances", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances", + // "request": { + // "$ref": "InstanceGroupManagersDeleteInstancesRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.get": + +type InstanceGroupManagersGetCall struct { + s *Service + project string + zone string + instanceGroupManager string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns all of the details about the specified managed instance +// group. +func (r *InstanceGroupManagersService) Get(project string, zone string, instanceGroupManager string) *InstanceGroupManagersGetCall { + c := &InstanceGroupManagersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *InstanceGroupManagersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *InstanceGroupManagersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersGetCall) Context(ctx context.Context) *InstanceGroupManagersGetCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.get" call. +// Exactly one of *InstanceGroupManager or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *InstanceGroupManager.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstanceGroupManagersGetCall) Do() (*InstanceGroupManager, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceGroupManager{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns all of the details about the specified managed instance group.", + // "httpMethod": "GET", + // "id": "compute.instanceGroupManagers.get", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}", + // "response": { + // "$ref": "InstanceGroupManager" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.insert": + +type InstanceGroupManagersInsertCall struct { + s *Service + project string + zone string + instancegroupmanager *InstanceGroupManager + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a managed instance group using the information that +// you specify in the request. After the group is created, it schedules +// an action to create instances in the group using the specified +// instance template. This operation is marked as DONE when the group is +// created even if the instances in the group have not yet been created. +// You must separately verify the status of the individual instances +// with the listmanagedinstances method. +func (r *InstanceGroupManagersService) Insert(project string, zone string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersInsertCall { + c := &InstanceGroupManagersInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instancegroupmanager = instancegroupmanager + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *InstanceGroupManagersInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersInsertCall) Context(ctx context.Context) *InstanceGroupManagersInsertCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagersInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method.", + // "httpMethod": "POST", + // "id": "compute.instanceGroupManagers.insert", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where you want to create the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers", + // "request": { + // "$ref": "InstanceGroupManager" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.list": + +type InstanceGroupManagersListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of managed instance groups that are contained +// within the specified project and zone. +func (r *InstanceGroupManagersService) List(project string, zone string) *InstanceGroupManagersListCall { + c := &InstanceGroupManagersListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *InstanceGroupManagersListCall) Filter(filter string) *InstanceGroupManagersListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *InstanceGroupManagersListCall) MaxResults(maxResults int64) *InstanceGroupManagersListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *InstanceGroupManagersListCall) PageToken(pageToken string) *InstanceGroupManagersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstanceGroupManagersListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersListCall) Context(ctx context.Context) *InstanceGroupManagersListCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.list" call. +// Exactly one of *InstanceGroupManagerList or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *InstanceGroupManagerList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstanceGroupManagersListCall) Do() (*InstanceGroupManagerList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceGroupManagerList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of managed instance groups that are contained within the specified project and zone.", + // "httpMethod": "GET", + // "id": "compute.instanceGroupManagers.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers", + // "response": { + // "$ref": "InstanceGroupManagerList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.listManagedInstances": + +type InstanceGroupManagersListManagedInstancesCall struct { + s *Service + project string + zone string + instanceGroupManager string + opt_ map[string]interface{} + ctx_ context.Context +} + +// ListManagedInstances: Lists all of the instances in the managed +// instance group. Each instance in the list has a currentAction, which +// indicates the action that the managed instance group is performing on +// the instance. For example, if the group is still creating an +// instance, the currentAction is CREATING. If a previous action failed, +// the list displays the errors for that failed action. +func (r *InstanceGroupManagersService) ListManagedInstances(project string, zone string, instanceGroupManager string) *InstanceGroupManagersListManagedInstancesCall { + c := &InstanceGroupManagersListManagedInstancesCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListManagedInstancesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *InstanceGroupManagersListManagedInstancesCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.listManagedInstances" call. +// Exactly one of *InstanceGroupManagersListManagedInstancesResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *InstanceGroupManagersListManagedInstancesResponse.ServerResponse.Head +// er or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *InstanceGroupManagersListManagedInstancesCall) Do() (*InstanceGroupManagersListManagedInstancesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceGroupManagersListManagedInstancesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action.", + // "httpMethod": "POST", + // "id": "compute.instanceGroupManagers.listManagedInstances", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances", + // "response": { + // "$ref": "InstanceGroupManagersListManagedInstancesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.recreateInstances": + +type InstanceGroupManagersRecreateInstancesCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// RecreateInstances: Schedules a group action to recreate the specified +// instances in the managed instance group. The instances are deleted +// and recreated using the current instance template for the managed +// instance group. This operation is marked as DONE when the action is +// scheduled even if the instances have not yet been recreated. You must +// separately verify the status of the recreating action with the +// listmanagedinstances method. +func (r *InstanceGroupManagersService) RecreateInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest) *InstanceGroupManagersRecreateInstancesCall { + c := &InstanceGroupManagersRecreateInstancesCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanagersrecreateinstancesrequest = instancegroupmanagersrecreateinstancesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersRecreateInstancesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *InstanceGroupManagersRecreateInstancesCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersrecreateinstancesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.recreateInstances" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagersRecreateInstancesCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.", + // "httpMethod": "POST", + // "id": "compute.instanceGroupManagers.recreateInstances", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances", + // "request": { + // "$ref": "InstanceGroupManagersRecreateInstancesRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.resize": + +type InstanceGroupManagersResizeCall struct { + s *Service + project string + zone string + instanceGroupManager string + size int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Resize: Resizes the managed instance group. If you increase the size, +// the group creates new instances using the current instance template. +// If you decrease the size, the group deletes instances. The resize +// operation is marked DONE when the resize actions are scheduled even +// if the group has not yet added or deleted any instances. You must +// separately verify the status of the creating or deleting actions with +// the listmanagedinstances method. +func (r *InstanceGroupManagersService) Resize(project string, zone string, instanceGroupManager string, size int64) *InstanceGroupManagersResizeCall { + c := &InstanceGroupManagersResizeCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.size = size + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersResizeCall) Context(ctx context.Context) *InstanceGroupManagersResizeCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("size", fmt.Sprintf("%v", c.size)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.resize" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagersResizeCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.", + // "httpMethod": "POST", + // "id": "compute.instanceGroupManagers.resize", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager", + // "size" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "size": { + // "description": "The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter.", + // "format": "int32", + // "location": "query", + // "required": true, + // "type": "integer" + // }, + // "zone": { + // "description": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.setInstanceTemplate": + +type InstanceGroupManagersSetInstanceTemplateCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetInstanceTemplate: Specifies the instance template to use when +// creating new instances in this group. The templates for existing +// instances in the group do not change unless you recreate them. +func (r *InstanceGroupManagersService) SetInstanceTemplate(project string, zone string, instanceGroupManager string, instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest) *InstanceGroupManagersSetInstanceTemplateCall { + c := &InstanceGroupManagersSetInstanceTemplateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanagerssetinstancetemplaterequest = instancegroupmanagerssetinstancetemplaterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetInstanceTemplateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *InstanceGroupManagersSetInstanceTemplateCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetinstancetemplaterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.setInstanceTemplate" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagersSetInstanceTemplateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you recreate them.", + // "httpMethod": "POST", + // "id": "compute.instanceGroupManagers.setInstanceTemplate", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate", + // "request": { + // "$ref": "InstanceGroupManagersSetInstanceTemplateRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.setTargetPools": + +type InstanceGroupManagersSetTargetPoolsCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetTargetPools: Modifies the target pools to which all instances in +// this managed instance group are assigned. The target pools +// automatically apply to all of the instances in the managed instance +// group. This operation is marked DONE when you make the request even +// if the instances have not yet been added to their target pools. The +// change might take some time to apply to all of the instances in the +// group depending on the size of the group. +func (r *InstanceGroupManagersService) SetTargetPools(project string, zone string, instanceGroupManager string, instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest) *InstanceGroupManagersSetTargetPoolsCall { + c := &InstanceGroupManagersSetTargetPoolsCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanagerssettargetpoolsrequest = instancegroupmanagerssettargetpoolsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetTargetPoolsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *InstanceGroupManagersSetTargetPoolsCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssettargetpoolsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.setTargetPools" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagersSetTargetPoolsCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group.", + // "httpMethod": "POST", + // "id": "compute.instanceGroupManagers.setTargetPools", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools", + // "request": { + // "$ref": "InstanceGroupManagersSetTargetPoolsRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroups.addInstances": + +type InstanceGroupsAddInstancesCall struct { + s *Service + project string + zone string + instanceGroup string + instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// AddInstances: Adds a list of instances to the specified instance +// group. All of the instances in the instance group must be in the same +// network/subnetwork. TODO: Change to comment to state "if IG is load +// balanced." +func (r *InstanceGroupsService) AddInstances(project string, zone string, instanceGroup string, instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest) *InstanceGroupsAddInstancesCall { + c := &InstanceGroupsAddInstancesCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroup = instanceGroup + c.instancegroupsaddinstancesrequest = instancegroupsaddinstancesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupsAddInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsAddInstancesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupsAddInstancesCall) Context(ctx context.Context) *InstanceGroupsAddInstancesCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsAddInstancesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsaddinstancesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroup": c.instanceGroup, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.addInstances" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupsAddInstancesCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. TODO: Change to comment to state \"if IG is load balanced.\"", + // "httpMethod": "POST", + // "id": "compute.instanceGroups.addInstances", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroup" + // ], + // "parameters": { + // "instanceGroup": { + // "description": "The name of the instance group where you are adding instances.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances", + // "request": { + // "$ref": "InstanceGroupsAddInstancesRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroups.aggregatedList": + +type InstanceGroupsAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of instance groups and sorts them +// by zone. +func (r *InstanceGroupsService) AggregatedList(project string) *InstanceGroupsAggregatedListCall { + c := &InstanceGroupsAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *InstanceGroupsAggregatedListCall) Filter(filter string) *InstanceGroupsAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *InstanceGroupsAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupsAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *InstanceGroupsAggregatedListCall) PageToken(pageToken string) *InstanceGroupsAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupsAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupsAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstanceGroupsAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupsAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupsAggregatedListCall) Context(ctx context.Context) *InstanceGroupsAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.aggregatedList" call. +// Exactly one of *InstanceGroupAggregatedList or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *InstanceGroupAggregatedList.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstanceGroupsAggregatedListCall) Do() (*InstanceGroupAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceGroupAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of instance groups and sorts them by zone.", + // "httpMethod": "GET", + // "id": "compute.instanceGroups.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/instanceGroups", + // "response": { + // "$ref": "InstanceGroupAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroups.delete": + +type InstanceGroupsDeleteCall struct { + s *Service + project string + zone string + instanceGroup string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified instance group. The instances in the +// group are not deleted. +func (r *InstanceGroupsService) Delete(project string, zone string, instanceGroup string) *InstanceGroupsDeleteCall { + c := &InstanceGroupsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroup = instanceGroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupsDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupsDeleteCall) Context(ctx context.Context) *InstanceGroupsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroup": c.instanceGroup, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified instance group. The instances in the group are not deleted.", + // "httpMethod": "DELETE", + // "id": "compute.instanceGroups.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroup" + // ], + // "parameters": { + // "instanceGroup": { + // "description": "The name of the instance group to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroups.get": + +type InstanceGroupsGetCall struct { + s *Service + project string + zone string + instanceGroup string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified instance group resource. +func (r *InstanceGroupsService) Get(project string, zone string, instanceGroup string) *InstanceGroupsGetCall { + c := &InstanceGroupsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroup = instanceGroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupsGetCall) Fields(s ...googleapi.Field) *InstanceGroupsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstanceGroupsGetCall) IfNoneMatch(entityTag string) *InstanceGroupsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupsGetCall) Context(ctx context.Context) *InstanceGroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroup": c.instanceGroup, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.get" call. +// Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *InstanceGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstanceGroupsGetCall) Do() (*InstanceGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified instance group resource.", + // "httpMethod": "GET", + // "id": "compute.instanceGroups.get", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroup" + // ], + // "parameters": { + // "instanceGroup": { + // "description": "The name of the instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}", + // "response": { + // "$ref": "InstanceGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroups.insert": + +type InstanceGroupsInsertCall struct { + s *Service + project string + zone string + instancegroup *InstanceGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates an instance group in the specified project using the +// parameters that are included in the request. +func (r *InstanceGroupsService) Insert(project string, zone string, instancegroup *InstanceGroup) *InstanceGroupsInsertCall { + c := &InstanceGroupsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instancegroup = instancegroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupsInsertCall) Fields(s ...googleapi.Field) *InstanceGroupsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupsInsertCall) Context(ctx context.Context) *InstanceGroupsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupsInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an instance group in the specified project using the parameters that are included in the request.", + // "httpMethod": "POST", + // "id": "compute.instanceGroups.insert", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where you want to create the instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroups", + // "request": { + // "$ref": "InstanceGroup" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroups.list": + +type InstanceGroupsListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of instance groups that are located in the +// specified project and zone. +func (r *InstanceGroupsService) List(project string, zone string) *InstanceGroupsListCall { + c := &InstanceGroupsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *InstanceGroupsListCall) Filter(filter string) *InstanceGroupsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *InstanceGroupsListCall) MaxResults(maxResults int64) *InstanceGroupsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *InstanceGroupsListCall) PageToken(pageToken string) *InstanceGroupsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupsListCall) Fields(s ...googleapi.Field) *InstanceGroupsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstanceGroupsListCall) IfNoneMatch(entityTag string) *InstanceGroupsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupsListCall) Context(ctx context.Context) *InstanceGroupsListCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.list" call. +// Exactly one of *InstanceGroupList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *InstanceGroupList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstanceGroupsListCall) Do() (*InstanceGroupList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceGroupList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of instance groups that are located in the specified project and zone.", + // "httpMethod": "GET", + // "id": "compute.instanceGroups.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroups", + // "response": { + // "$ref": "InstanceGroupList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroups.listInstances": + +type InstanceGroupsListInstancesCall struct { + s *Service + project string + zone string + instanceGroup string + instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// ListInstances: Lists the instances in the specified instance group. +func (r *InstanceGroupsService) ListInstances(project string, zone string, instanceGroup string, instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest) *InstanceGroupsListInstancesCall { + c := &InstanceGroupsListInstancesCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroup = instanceGroup + c.instancegroupslistinstancesrequest = instancegroupslistinstancesrequest + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *InstanceGroupsListInstancesCall) Filter(filter string) *InstanceGroupsListInstancesCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *InstanceGroupsListInstancesCall) MaxResults(maxResults int64) *InstanceGroupsListInstancesCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *InstanceGroupsListInstancesCall) PageToken(pageToken string) *InstanceGroupsListInstancesCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsListInstancesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupsListInstancesCall) Context(ctx context.Context) *InstanceGroupsListInstancesCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupslistinstancesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroup": c.instanceGroup, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.listInstances" call. +// Exactly one of *InstanceGroupsListInstances or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *InstanceGroupsListInstances.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstanceGroupsListInstancesCall) Do() (*InstanceGroupsListInstances, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceGroupsListInstances{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the instances in the specified instance group.", + // "httpMethod": "POST", + // "id": "compute.instanceGroups.listInstances", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroup" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "instanceGroup": { + // "description": "The name of the instance group from which you want to generate a list of included instances.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances", + // "request": { + // "$ref": "InstanceGroupsListInstancesRequest" + // }, + // "response": { + // "$ref": "InstanceGroupsListInstances" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroups.removeInstances": + +type InstanceGroupsRemoveInstancesCall struct { + s *Service + project string + zone string + instanceGroup string + instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// RemoveInstances: Removes one or more instances from the specified +// instance group, but does not delete those instances. +func (r *InstanceGroupsService) RemoveInstances(project string, zone string, instanceGroup string, instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest) *InstanceGroupsRemoveInstancesCall { + c := &InstanceGroupsRemoveInstancesCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroup = instanceGroup + c.instancegroupsremoveinstancesrequest = instancegroupsremoveinstancesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupsRemoveInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsRemoveInstancesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupsRemoveInstancesCall) Context(ctx context.Context) *InstanceGroupsRemoveInstancesCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsRemoveInstancesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsremoveinstancesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroup": c.instanceGroup, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.removeInstances" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupsRemoveInstancesCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Removes one or more instances from the specified instance group, but does not delete those instances.", + // "httpMethod": "POST", + // "id": "compute.instanceGroups.removeInstances", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroup" + // ], + // "parameters": { + // "instanceGroup": { + // "description": "The name of the instance group where the specified instances will be removed.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances", + // "request": { + // "$ref": "InstanceGroupsRemoveInstancesRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroups.setNamedPorts": + +type InstanceGroupsSetNamedPortsCall struct { + s *Service + project string + zone string + instanceGroup string + instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetNamedPorts: Sets the named ports for the specified instance group. +func (r *InstanceGroupsService) SetNamedPorts(project string, zone string, instanceGroup string, instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest) *InstanceGroupsSetNamedPortsCall { + c := &InstanceGroupsSetNamedPortsCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroup = instanceGroup + c.instancegroupssetnamedportsrequest = instancegroupssetnamedportsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *InstanceGroupsSetNamedPortsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *InstanceGroupsSetNamedPortsCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupssetnamedportsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroup": c.instanceGroup, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.setNamedPorts" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupsSetNamedPortsCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the named ports for the specified instance group.", + // "httpMethod": "POST", + // "id": "compute.instanceGroups.setNamedPorts", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroup" + // ], + // "parameters": { + // "instanceGroup": { + // "description": "The name of the instance group where the named ports are updated.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone where the instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts", + // "request": { + // "$ref": "InstanceGroupsSetNamedPortsRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceTemplates.delete": + +type InstanceTemplatesDeleteCall struct { + s *Service + project string + instanceTemplate string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified instance template. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/delete +func (r *InstanceTemplatesService) Delete(project string, instanceTemplate string) *InstanceTemplatesDeleteCall { + c := &InstanceTemplatesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instanceTemplate = instanceTemplate + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceTemplatesDeleteCall) Fields(s ...googleapi.Field) *InstanceTemplatesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceTemplatesDeleteCall) Context(ctx context.Context) *InstanceTemplatesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instanceTemplate": c.instanceTemplate, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceTemplates.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceTemplatesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified instance template.", + // "httpMethod": "DELETE", + // "id": "compute.instanceTemplates.delete", + // "parameterOrder": [ + // "project", + // "instanceTemplate" + // ], + // "parameters": { + // "instanceTemplate": { + // "description": "The name of the instance template to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/instanceTemplates/{instanceTemplate}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceTemplates.get": + +type InstanceTemplatesGetCall struct { + s *Service + project string + instanceTemplate string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified instance template resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/get +func (r *InstanceTemplatesService) Get(project string, instanceTemplate string) *InstanceTemplatesGetCall { + c := &InstanceTemplatesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instanceTemplate = instanceTemplate + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceTemplatesGetCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstanceTemplatesGetCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceTemplatesGetCall) Context(ctx context.Context) *InstanceTemplatesGetCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceTemplatesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instanceTemplate": c.instanceTemplate, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceTemplates.get" call. +// Exactly one of *InstanceTemplate or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *InstanceTemplate.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstanceTemplatesGetCall) Do() (*InstanceTemplate, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceTemplate{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified instance template resource.", + // "httpMethod": "GET", + // "id": "compute.instanceTemplates.get", + // "parameterOrder": [ + // "project", + // "instanceTemplate" + // ], + // "parameters": { + // "instanceTemplate": { + // "description": "The name of the instance template.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/instanceTemplates/{instanceTemplate}", + // "response": { + // "$ref": "InstanceTemplate" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceTemplates.insert": + +type InstanceTemplatesInsertCall struct { + s *Service + project string + instancetemplate *InstanceTemplate + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates an instance template in the specified project using +// the data that is included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/insert +func (r *InstanceTemplatesService) Insert(project string, instancetemplate *InstanceTemplate) *InstanceTemplatesInsertCall { + c := &InstanceTemplatesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instancetemplate = instancetemplate + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceTemplatesInsertCall) Fields(s ...googleapi.Field) *InstanceTemplatesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceTemplatesInsertCall) Context(ctx context.Context) *InstanceTemplatesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceTemplates.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceTemplatesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an instance template in the specified project using the data that is included in the request.", + // "httpMethod": "POST", + // "id": "compute.instanceTemplates.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/instanceTemplates", + // "request": { + // "$ref": "InstanceTemplate" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceTemplates.list": + +type InstanceTemplatesListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of instance templates that are contained +// within the specified project and zone. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/list +func (r *InstanceTemplatesService) List(project string) *InstanceTemplatesListCall { + c := &InstanceTemplatesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *InstanceTemplatesListCall) Filter(filter string) *InstanceTemplatesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *InstanceTemplatesListCall) MaxResults(maxResults int64) *InstanceTemplatesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *InstanceTemplatesListCall) PageToken(pageToken string) *InstanceTemplatesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceTemplatesListCall) Fields(s ...googleapi.Field) *InstanceTemplatesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstanceTemplatesListCall) IfNoneMatch(entityTag string) *InstanceTemplatesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceTemplatesListCall) Context(ctx context.Context) *InstanceTemplatesListCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceTemplatesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceTemplates.list" call. +// Exactly one of *InstanceTemplateList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *InstanceTemplateList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstanceTemplatesListCall) Do() (*InstanceTemplateList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceTemplateList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of instance templates that are contained within the specified project and zone.", + // "httpMethod": "GET", + // "id": "compute.instanceTemplates.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/instanceTemplates", + // "response": { + // "$ref": "InstanceTemplateList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "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{} + ctx_ context.Context +} + +// AddAccessConfig: Adds an access config to an instance's network +// interface. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/addAccessConfig +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesAddAccessConfigCall) Fields(s ...googleapi.Field) *InstancesAddAccessConfigCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesAddAccessConfigCall) Context(ctx context.Context) *InstancesAddAccessConfigCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesAddAccessConfigCall) doRequest(alt string) (*http.Response, 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", alt) + params.Set("networkInterface", fmt.Sprintf("%v", c.networkInterface)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/addAccessConfig") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.addAccessConfig" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesAddAccessConfigCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds an access config to an instance's network interface.", + // "httpMethod": "POST", + // "id": "compute.instances.addAccessConfig", + // "parameterOrder": [ + // "project", + // "zone", + // "instance", + // "networkInterface" + // ], + // "parameters": { + // "instance": { + // "description": "The instance name for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "networkInterface": { + // "description": "The name of the network interface to add to this instance.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.aggregatedList": + +type InstancesAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// AggregatedList: Retrieves aggregated list of instance resources. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *InstancesAggregatedListCall) MaxResults(maxResults int64) *InstancesAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *InstancesAggregatedListCall) PageToken(pageToken string) *InstancesAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesAggregatedListCall) Fields(s ...googleapi.Field) *InstancesAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstancesAggregatedListCall) IfNoneMatch(entityTag string) *InstancesAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesAggregatedListCall) Context(ctx context.Context) *InstancesAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.aggregatedList" call. +// Exactly one of *InstanceAggregatedList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *InstanceAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstancesAggregatedListCall) Do() (*InstanceAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves aggregated list of instance resources.", + // "httpMethod": "GET", + // "id": "compute.instances.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// AttachDisk: Attaches a Disk resource to an instance. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/attachDisk +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesAttachDiskCall) Fields(s ...googleapi.Field) *InstancesAttachDiskCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesAttachDiskCall) Context(ctx context.Context) *InstancesAttachDiskCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesAttachDiskCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/attachDisk") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.attachDisk" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesAttachDiskCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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 ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified Instance resource. For more +// information, see Shutting down an instance. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified Instance resource. For more information, see Shutting down an instance.", + // "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// DeleteAccessConfig: Deletes an access config from an instance's +// network interface. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/deleteAccessConfig +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesDeleteAccessConfigCall) Fields(s ...googleapi.Field) *InstancesDeleteAccessConfigCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesDeleteAccessConfigCall) Context(ctx context.Context) *InstancesDeleteAccessConfigCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesDeleteAccessConfigCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("accessConfig", fmt.Sprintf("%v", c.accessConfig)) + params.Set("networkInterface", fmt.Sprintf("%v", c.networkInterface)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.deleteAccessConfig" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesDeleteAccessConfigCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "The name of the access config to delete.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "instance": { + // "description": "The instance name for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "networkInterface": { + // "description": "The name of the network interface.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// DetachDisk: Detaches a disk from an instance. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/detachDisk +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesDetachDiskCall) Fields(s ...googleapi.Field) *InstancesDetachDiskCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesDetachDiskCall) Context(ctx context.Context) *InstancesDetachDiskCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesDetachDiskCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("deviceName", fmt.Sprintf("%v", c.deviceName)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/detachDisk") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.detachDisk" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesDetachDiskCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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 ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Returns the specified instance resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.get" call. +// Exactly one of *Instance or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Instance.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesGetCall) Do() (*Instance, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Instance{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// GetSerialPortOutput: Returns the specified instance's serial port +// output. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/getSerialPortOutput +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 +} + +// Port sets the optional parameter "port": Specifies which COM or +// serial port to retrieve data from. +func (c *InstancesGetSerialPortOutputCall) Port(port int64) *InstancesGetSerialPortOutputCall { + c.opt_["port"] = port + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesGetSerialPortOutputCall) Fields(s ...googleapi.Field) *InstancesGetSerialPortOutputCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstancesGetSerialPortOutputCall) IfNoneMatch(entityTag string) *InstancesGetSerialPortOutputCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesGetSerialPortOutputCall) Context(ctx context.Context) *InstancesGetSerialPortOutputCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesGetSerialPortOutputCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["port"]; ok { + params.Set("port", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/serialPort") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.getSerialPortOutput" call. +// Exactly one of *SerialPortOutput or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SerialPortOutput.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstancesGetSerialPortOutputCall) Do() (*SerialPortOutput, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SerialPortOutput{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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" + // }, + // "port": { + // "default": "1", + // "description": "Specifies which COM or serial port to retrieve data from.", + // "format": "int32", + // "location": "query", + // "maximum": "4", + // "minimum": "1", + // "type": "integer" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates an instance resource in the specified project using +// the data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.list": + +type InstancesListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of instance resources contained within the +// specified zone. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.list" call. +// Exactly one of *InstanceList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *InstanceList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesListCall) Do() (*InstanceList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of instance resources contained within the specified zone.", + // "httpMethod": "GET", + // "id": "compute.instances.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Reset: Performs a hard reset on the instance. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/reset +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesResetCall) Fields(s ...googleapi.Field) *InstancesResetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesResetCall) Context(ctx context.Context) *InstancesResetCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesResetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/reset") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.reset" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesResetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// SetDiskAutoDelete: Sets the auto-delete flag for a disk attached to +// an instance. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setDiskAutoDelete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesSetDiskAutoDeleteCall) Fields(s ...googleapi.Field) *InstancesSetDiskAutoDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesSetDiskAutoDeleteCall) Context(ctx context.Context) *InstancesSetDiskAutoDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesSetDiskAutoDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("autoDelete", fmt.Sprintf("%v", c.autoDelete)) + params.Set("deviceName", fmt.Sprintf("%v", c.deviceName)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.setDiskAutoDelete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesSetDiskAutoDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets 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": "The device name of the disk to modify.", + // "location": "query", + // "pattern": "\\w[\\w.-]{0,254}", + // "required": true, + // "type": "string" + // }, + // "instance": { + // "description": "The instance name.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// SetMetadata: Sets metadata for the specified instance to the data +// included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setMetadata +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesSetMetadataCall) Fields(s ...googleapi.Field) *InstancesSetMetadataCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesSetMetadataCall) Context(ctx context.Context) *InstancesSetMetadataCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesSetMetadataCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMetadata") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.setMetadata" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesSetMetadataCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// SetScheduling: Sets an instance's scheduling options. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setScheduling +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesSetSchedulingCall) Fields(s ...googleapi.Field) *InstancesSetSchedulingCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesSetSchedulingCall) Context(ctx context.Context) *InstancesSetSchedulingCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesSetSchedulingCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setScheduling") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.setScheduling" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesSetSchedulingCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets 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 ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// SetTags: Sets tags for the specified instance to the data included in +// the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setTags +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesSetTagsCall) Fields(s ...googleapi.Field) *InstancesSetTagsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesSetTagsCall) Context(ctx context.Context) *InstancesSetTagsCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesSetTagsCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setTags") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.setTags" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesSetTagsCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.start": + +type InstancesStartCall struct { + s *Service + project string + zone string + instance string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Start: This method starts an instance that was stopped using the +// using the instances().stop method. For more information, see Restart +// an instance. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/start +func (r *InstancesService) Start(project string, zone string, instance string) *InstancesStartCall { + c := &InstancesStartCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesStartCall) Fields(s ...googleapi.Field) *InstancesStartCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesStartCall) Context(ctx context.Context) *InstancesStartCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesStartCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/start") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.start" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesStartCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "This method starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance.", + // "httpMethod": "POST", + // "id": "compute.instances.start", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance resource to start.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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}/start", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instances.stop": + +type InstancesStopCall struct { + s *Service + project string + zone string + instance string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Stop: This method stops a running instance, shutting it down cleanly, +// and allows you to restart the instance at a later time. Stopped +// instances do not incur per-minute, virtual machine usage charges +// while they are stopped, but any resources that the virtual machine is +// using, such as persistent disks and static IP addresses,will continue +// to be charged until they are deleted. For more information, see +// Stopping an instance. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instances/stop +func (r *InstancesService) Stop(project string, zone string, instance string) *InstancesStopCall { + c := &InstancesStopCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instance = instance + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesStopCall) Fields(s ...googleapi.Field) *InstancesStopCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesStopCall) Context(ctx context.Context) *InstancesStopCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesStopCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/stop") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.stop" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesStopCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "This method stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine is using, such as persistent disks and static IP addresses,will continue to be charged until they are deleted. For more information, see Stopping an instance.", + // "httpMethod": "POST", + // "id": "compute.instances.stop", + // "parameterOrder": [ + // "project", + // "zone", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Name of the instance resource to stop.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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}/stop", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.licenses.get": + +type LicensesGetCall struct { + s *Service + project string + license string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified license resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/licenses/get +func (r *LicensesService) Get(project string, license string) *LicensesGetCall { + c := &LicensesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.license = license + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LicensesGetCall) Fields(s ...googleapi.Field) *LicensesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LicensesGetCall) IfNoneMatch(entityTag string) *LicensesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LicensesGetCall) Context(ctx context.Context) *LicensesGetCall { + c.ctx_ = ctx + return c +} + +func (c *LicensesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "license": c.license, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.licenses.get" call. +// Exactly one of *License or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *License.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *LicensesGetCall) Do() (*License, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &License{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified license resource.", + // "httpMethod": "GET", + // "id": "compute.licenses.get", + // "parameterOrder": [ + // "project", + // "license" + // ], + // "parameters": { + // "license": { + // "description": "Name of the license resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/licenses/{license}", + // "response": { + // "$ref": "License" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "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{} + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of machine type resources grouped +// by scope. +// For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/aggregatedList +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *MachineTypesAggregatedListCall) MaxResults(maxResults int64) *MachineTypesAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *MachineTypesAggregatedListCall) PageToken(pageToken string) *MachineTypesAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MachineTypesAggregatedListCall) Fields(s ...googleapi.Field) *MachineTypesAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MachineTypesAggregatedListCall) IfNoneMatch(entityTag string) *MachineTypesAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MachineTypesAggregatedListCall) Context(ctx context.Context) *MachineTypesAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *MachineTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/machineTypes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.machineTypes.aggregatedList" call. +// Exactly one of *MachineTypeAggregatedList or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *MachineTypeAggregatedList.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MachineTypesAggregatedListCall) Do() (*MachineTypeAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &MachineTypeAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of machine type resources grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.machineTypes.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Returns the specified machine type resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MachineTypesGetCall) Fields(s ...googleapi.Field) *MachineTypesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MachineTypesGetCall) IfNoneMatch(entityTag string) *MachineTypesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MachineTypesGetCall) Context(ctx context.Context) *MachineTypesGetCall { + c.ctx_ = ctx + return c +} + +func (c *MachineTypesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes/{machineType}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "machineType": c.machineType, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.machineTypes.get" call. +// Exactly one of *MachineType or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *MachineType.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MachineTypesGetCall) Do() (*MachineType, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &MachineType{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// List: Retrieves the list of machine type resources available to the +// specified project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *MachineTypesListCall) MaxResults(maxResults int64) *MachineTypesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *MachineTypesListCall) PageToken(pageToken string) *MachineTypesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MachineTypesListCall) Fields(s ...googleapi.Field) *MachineTypesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MachineTypesListCall) IfNoneMatch(entityTag string) *MachineTypesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MachineTypesListCall) Context(ctx context.Context) *MachineTypesListCall { + c.ctx_ = ctx + return c +} + +func (c *MachineTypesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.machineTypes.list" call. +// Exactly one of *MachineTypeList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *MachineTypeList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MachineTypesListCall) Do() (*MachineTypeList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &MachineTypeList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of machine type resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.machineTypes.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the zone for 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified network resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/networks/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *NetworksDeleteCall) Fields(s ...googleapi.Field) *NetworksDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *NetworksDeleteCall) Context(ctx context.Context) *NetworksDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *NetworksDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "network": c.network, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.networks.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *NetworksDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.networks.get": + +type NetworksGetCall struct { + s *Service + project string + network string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified network resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/networks/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *NetworksGetCall) Fields(s ...googleapi.Field) *NetworksGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *NetworksGetCall) IfNoneMatch(entityTag string) *NetworksGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *NetworksGetCall) Context(ctx context.Context) *NetworksGetCall { + c.ctx_ = ctx + return c +} + +func (c *NetworksGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "network": c.network, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.networks.get" call. +// Exactly one of *Network or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Network.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *NetworksGetCall) Do() (*Network, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Network{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates a network resource in the specified project using the +// data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/networks/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *NetworksInsertCall) Fields(s ...googleapi.Field) *NetworksInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *NetworksInsertCall) Context(ctx context.Context) *NetworksInsertCall { + c.ctx_ = ctx + return c +} + +func (c *NetworksInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.networks.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *NetworksInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.networks.list": + +type NetworksListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of network resources available to the +// specified project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/networks/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *NetworksListCall) MaxResults(maxResults int64) *NetworksListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *NetworksListCall) PageToken(pageToken string) *NetworksListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *NetworksListCall) Fields(s ...googleapi.Field) *NetworksListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *NetworksListCall) IfNoneMatch(entityTag string) *NetworksListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *NetworksListCall) Context(ctx context.Context) *NetworksListCall { + c.ctx_ = ctx + return c +} + +func (c *NetworksListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.networks.list" call. +// Exactly one of *NetworkList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *NetworkList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *NetworksListCall) Do() (*NetworkList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &NetworkList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of network resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.networks.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Returns the specified project resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/projects/get +func (r *ProjectsService) Get(project string) *ProjectsGetCall { + c := &ProjectsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.projects.get" call. +// Exactly one of *Project or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Project.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsGetCall) Do() (*Project, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Project{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified project resource.", + // "httpMethod": "GET", + // "id": "compute.projects.get", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.projects.moveDisk": + +type ProjectsMoveDiskCall struct { + s *Service + project string + diskmoverequest *DiskMoveRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// MoveDisk: Moves a persistent disk from one zone to another. +func (r *ProjectsService) MoveDisk(project string, diskmoverequest *DiskMoveRequest) *ProjectsMoveDiskCall { + c := &ProjectsMoveDiskCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.diskmoverequest = diskmoverequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsMoveDiskCall) Fields(s ...googleapi.Field) *ProjectsMoveDiskCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsMoveDiskCall) Context(ctx context.Context) *ProjectsMoveDiskCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsMoveDiskCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.diskmoverequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveDisk") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.projects.moveDisk" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsMoveDiskCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Moves a persistent disk from one zone to another.", + // "httpMethod": "POST", + // "id": "compute.projects.moveDisk", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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}/moveDisk", + // "request": { + // "$ref": "DiskMoveRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.projects.moveInstance": + +type ProjectsMoveInstanceCall struct { + s *Service + project string + instancemoverequest *InstanceMoveRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// MoveInstance: Moves an instance and its attached persistent disks +// from one zone to another. +func (r *ProjectsService) MoveInstance(project string, instancemoverequest *InstanceMoveRequest) *ProjectsMoveInstanceCall { + c := &ProjectsMoveInstanceCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instancemoverequest = instancemoverequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsMoveInstanceCall) Fields(s ...googleapi.Field) *ProjectsMoveInstanceCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsMoveInstanceCall) Context(ctx context.Context) *ProjectsMoveInstanceCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsMoveInstanceCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancemoverequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveInstance") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.projects.moveInstance" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsMoveInstanceCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Moves an instance and its attached persistent disks from one zone to another.", + // "httpMethod": "POST", + // "id": "compute.projects.moveInstance", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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}/moveInstance", + // "request": { + // "$ref": "InstanceMoveRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.projects.setCommonInstanceMetadata": + +type ProjectsSetCommonInstanceMetadataCall struct { + s *Service + project string + metadata *Metadata + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetCommonInstanceMetadata: Sets metadata common to all instances +// within the specified project using the data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setCommonInstanceMetadata +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSetCommonInstanceMetadataCall) Fields(s ...googleapi.Field) *ProjectsSetCommonInstanceMetadataCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSetCommonInstanceMetadataCall) Context(ctx context.Context) *ProjectsSetCommonInstanceMetadataCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSetCommonInstanceMetadataCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setCommonInstanceMetadata") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.projects.setCommonInstanceMetadata" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsSetCommonInstanceMetadataCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets 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": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.projects.setUsageExportBucket": + +type ProjectsSetUsageExportBucketCall struct { + s *Service + project string + usageexportlocation *UsageExportLocation + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetUsageExportBucket: Enables the usage export feature and sets the +// usage export bucket where reports are stored. If you provide an empty +// request body using this method, the usage export feature will be +// disabled. +// For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setUsageExportBucket +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSetUsageExportBucketCall) Fields(s ...googleapi.Field) *ProjectsSetUsageExportBucketCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSetUsageExportBucketCall) Context(ctx context.Context) *ProjectsSetUsageExportBucketCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSetUsageExportBucketCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setUsageExportBucket") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.projects.setUsageExportBucket" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsSetUsageExportBucketCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled.", + // "httpMethod": "POST", + // "id": "compute.projects.setUsageExportBucket", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified region-specific Operations resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionOperationsDeleteCall) Fields(s ...googleapi.Field) *RegionOperationsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RegionOperationsDeleteCall) Context(ctx context.Context) *RegionOperationsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *RegionOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.regionOperations.delete" call. +func (c *RegionOperationsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified region-specific Operations resource.", + // "httpMethod": "DELETE", + // "id": "compute.regionOperations.delete", + // "parameterOrder": [ + // "project", + // "region", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the Operations resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Retrieves the specified region-specific Operations resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionOperationsGetCall) Fields(s ...googleapi.Field) *RegionOperationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RegionOperationsGetCall) IfNoneMatch(entityTag string) *RegionOperationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RegionOperationsGetCall) Context(ctx context.Context) *RegionOperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *RegionOperationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.regionOperations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RegionOperationsGetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified region-specific Operations resource.", + // "httpMethod": "GET", + // "id": "compute.regionOperations.get", + // "parameterOrder": [ + // "project", + // "region", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the Operations resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// List: Retrieves the list of Operation resources contained within the +// specified region. +// For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *RegionOperationsListCall) MaxResults(maxResults int64) *RegionOperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *RegionOperationsListCall) PageToken(pageToken string) *RegionOperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionOperationsListCall) Fields(s ...googleapi.Field) *RegionOperationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RegionOperationsListCall) IfNoneMatch(entityTag string) *RegionOperationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RegionOperationsListCall) Context(ctx context.Context) *RegionOperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *RegionOperationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.regionOperations.list" call. +// Exactly one of *OperationList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *OperationList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RegionOperationsListCall) Do() (*OperationList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperationList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of Operation resources contained within the specified region.", + // "httpMethod": "GET", + // "id": "compute.regionOperations.list", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Returns the specified region resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/regions/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionsGetCall) Fields(s ...googleapi.Field) *RegionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RegionsGetCall) IfNoneMatch(entityTag string) *RegionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RegionsGetCall) Context(ctx context.Context) *RegionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *RegionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.regions.get" call. +// Exactly one of *Region or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Region.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *RegionsGetCall) Do() (*Region, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Region{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified region resource.", + // "httpMethod": "GET", + // "id": "compute.regions.get", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// List: Retrieves the list of region resources available to the +// specified project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/regions/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *RegionsListCall) MaxResults(maxResults int64) *RegionsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *RegionsListCall) PageToken(pageToken string) *RegionsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall { + c.ctx_ = ctx + return c +} + +func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.regions.list" call. +// Exactly one of *RegionList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *RegionList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RegionsListCall) Do() (*RegionList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RegionList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of region resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.regions.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified route resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/routes/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RoutesDeleteCall) Fields(s ...googleapi.Field) *RoutesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RoutesDeleteCall) Context(ctx context.Context) *RoutesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *RoutesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "route": c.route, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.routes.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RoutesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.routes.get": + +type RoutesGetCall struct { + s *Service + project string + route string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified route resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/routes/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RoutesGetCall) Fields(s ...googleapi.Field) *RoutesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RoutesGetCall) IfNoneMatch(entityTag string) *RoutesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RoutesGetCall) Context(ctx context.Context) *RoutesGetCall { + c.ctx_ = ctx + return c +} + +func (c *RoutesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "route": c.route, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.routes.get" call. +// Exactly one of *Route or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Route.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *RoutesGetCall) Do() (*Route, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Route{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates a route resource in the specified project using the +// data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/routes/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RoutesInsertCall) Fields(s ...googleapi.Field) *RoutesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RoutesInsertCall) Context(ctx context.Context) *RoutesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *RoutesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.routes.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RoutesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.routes.list": + +type RoutesListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of route resources available to the +// specified project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/routes/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *RoutesListCall) MaxResults(maxResults int64) *RoutesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *RoutesListCall) PageToken(pageToken string) *RoutesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RoutesListCall) Fields(s ...googleapi.Field) *RoutesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RoutesListCall) IfNoneMatch(entityTag string) *RoutesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RoutesListCall) Context(ctx context.Context) *RoutesListCall { + c.ctx_ = ctx + return c +} + +func (c *RoutesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.routes.list" call. +// Exactly one of *RouteList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *RouteList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RoutesListCall) Do() (*RouteList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RouteList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of route resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.routes.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified Snapshot resource. Keep in mind that +// deleting a single snapshot might not necessarily delete all the data +// on that snapshot. If any data on the snapshot that is marked for +// deletion is needed for subsequent snapshots, the data will be moved +// to the next corresponding snapshot. +// +// For more information, see Deleting snaphots. +// For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SnapshotsDeleteCall) Fields(s ...googleapi.Field) *SnapshotsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SnapshotsDeleteCall) Context(ctx context.Context) *SnapshotsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *SnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "snapshot": c.snapshot, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.snapshots.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SnapshotsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot.\n\nFor more information, see Deleting snaphots.", + // "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 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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.snapshots.get": + +type SnapshotsGetCall struct { + s *Service + project string + snapshot string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified Snapshot resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SnapshotsGetCall) Fields(s ...googleapi.Field) *SnapshotsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SnapshotsGetCall) IfNoneMatch(entityTag string) *SnapshotsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SnapshotsGetCall) Context(ctx context.Context) *SnapshotsGetCall { + c.ctx_ = ctx + return c +} + +func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "snapshot": c.snapshot, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.snapshots.get" call. +// Exactly one of *Snapshot or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Snapshot.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SnapshotsGetCall) Do() (*Snapshot, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Snapshot{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified 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 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// List: Retrieves the list of Snapshot resources contained within the +// specified project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SnapshotsListCall) Fields(s ...googleapi.Field) *SnapshotsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SnapshotsListCall) IfNoneMatch(entityTag string) *SnapshotsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SnapshotsListCall) Context(ctx context.Context) *SnapshotsListCall { + c.ctx_ = ctx + return c +} + +func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.snapshots.list" call. +// Exactly one of *SnapshotList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SnapshotList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SnapshotsListCall) Do() (*SnapshotList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SnapshotList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of Snapshot resources contained within the specified project.", + // "httpMethod": "GET", + // "id": "compute.snapshots.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.sslCertificates.delete": + +type SslCertificatesDeleteCall struct { + s *Service + project string + sslCertificate string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified SslCertificate resource. +func (r *SslCertificatesService) Delete(project string, sslCertificate string) *SslCertificatesDeleteCall { + c := &SslCertificatesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.sslCertificate = sslCertificate + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SslCertificatesDeleteCall) Fields(s ...googleapi.Field) *SslCertificatesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SslCertificatesDeleteCall) Context(ctx context.Context) *SslCertificatesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *SslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "sslCertificate": c.sslCertificate, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.sslCertificates.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SslCertificatesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified SslCertificate resource.", + // "httpMethod": "DELETE", + // "id": "compute.sslCertificates.delete", + // "parameterOrder": [ + // "project", + // "sslCertificate" + // ], + // "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" + // }, + // "sslCertificate": { + // "description": "Name of the SslCertificate resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/sslCertificates/{sslCertificate}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.sslCertificates.get": + +type SslCertificatesGetCall struct { + s *Service + project string + sslCertificate string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified SslCertificate resource. +func (r *SslCertificatesService) Get(project string, sslCertificate string) *SslCertificatesGetCall { + c := &SslCertificatesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.sslCertificate = sslCertificate + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SslCertificatesGetCall) Fields(s ...googleapi.Field) *SslCertificatesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SslCertificatesGetCall) IfNoneMatch(entityTag string) *SslCertificatesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SslCertificatesGetCall) Context(ctx context.Context) *SslCertificatesGetCall { + c.ctx_ = ctx + return c +} + +func (c *SslCertificatesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "sslCertificate": c.sslCertificate, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.sslCertificates.get" call. +// Exactly one of *SslCertificate or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SslCertificate.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SslCertificatesGetCall) Do() (*SslCertificate, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SslCertificate{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified SslCertificate resource.", + // "httpMethod": "GET", + // "id": "compute.sslCertificates.get", + // "parameterOrder": [ + // "project", + // "sslCertificate" + // ], + // "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" + // }, + // "sslCertificate": { + // "description": "Name of the SslCertificate resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/sslCertificates/{sslCertificate}", + // "response": { + // "$ref": "SslCertificate" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.sslCertificates.insert": + +type SslCertificatesInsertCall struct { + s *Service + project string + sslcertificate *SslCertificate + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a SslCertificate resource in the specified project +// using the data included in the request. +func (r *SslCertificatesService) Insert(project string, sslcertificate *SslCertificate) *SslCertificatesInsertCall { + c := &SslCertificatesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.sslcertificate = sslcertificate + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SslCertificatesInsertCall) Fields(s ...googleapi.Field) *SslCertificatesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SslCertificatesInsertCall) Context(ctx context.Context) *SslCertificatesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *SslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.sslCertificates.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SslCertificatesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a SslCertificate resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.sslCertificates.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/sslCertificates", + // "request": { + // "$ref": "SslCertificate" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.sslCertificates.list": + +type SslCertificatesListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of SslCertificate resources available to the +// specified project. +func (r *SslCertificatesService) List(project string) *SslCertificatesListCall { + c := &SslCertificatesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *SslCertificatesListCall) Filter(filter string) *SslCertificatesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *SslCertificatesListCall) MaxResults(maxResults int64) *SslCertificatesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *SslCertificatesListCall) PageToken(pageToken string) *SslCertificatesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SslCertificatesListCall) Fields(s ...googleapi.Field) *SslCertificatesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SslCertificatesListCall) IfNoneMatch(entityTag string) *SslCertificatesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SslCertificatesListCall) Context(ctx context.Context) *SslCertificatesListCall { + c.ctx_ = ctx + return c +} + +func (c *SslCertificatesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.sslCertificates.list" call. +// Exactly one of *SslCertificateList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SslCertificateList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SslCertificatesListCall) Do() (*SslCertificateList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SslCertificateList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of SslCertificate resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.sslCertificates.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/sslCertificates", + // "response": { + // "$ref": "SslCertificateList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified TargetHttpProxy resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpProxiesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetHttpProxiesDeleteCall) Context(ctx context.Context) *TargetHttpProxiesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "targetHttpProxy": c.targetHttpProxy, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpProxies.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetHttpProxiesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetHttpProxies.get": + +type TargetHttpProxiesGetCall struct { + s *Service + project string + targetHttpProxy string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified TargetHttpProxy resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpProxiesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetHttpProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpProxiesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetHttpProxiesGetCall) Context(ctx context.Context) *TargetHttpProxiesGetCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "targetHttpProxy": c.targetHttpProxy, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpProxies.get" call. +// Exactly one of *TargetHttpProxy or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TargetHttpProxy.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetHttpProxiesGetCall) Do() (*TargetHttpProxy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetHttpProxy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates a TargetHttpProxy resource in the specified project +// using the data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpProxiesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetHttpProxiesInsertCall) Context(ctx context.Context) *TargetHttpProxiesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpProxies.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetHttpProxiesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetHttpProxies.list": + +type TargetHttpProxiesListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of TargetHttpProxy resources available to +// the specified project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *TargetHttpProxiesListCall) MaxResults(maxResults int64) *TargetHttpProxiesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *TargetHttpProxiesListCall) PageToken(pageToken string) *TargetHttpProxiesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpProxiesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetHttpProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpProxiesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetHttpProxiesListCall) Context(ctx context.Context) *TargetHttpProxiesListCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpProxiesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpProxies.list" call. +// Exactly one of *TargetHttpProxyList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TargetHttpProxyList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetHttpProxiesListCall) Do() (*TargetHttpProxyList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetHttpProxyList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of TargetHttpProxy resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.targetHttpProxies.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// SetUrlMap: Changes the URL map for TargetHttpProxy. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/setUrlMap +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpProxiesSetUrlMapCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetHttpProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpProxiesSetUrlMapCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "targetHttpProxy": c.targetHttpProxy, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpProxies.setUrlMap" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetHttpProxiesSetUrlMapCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetHttpsProxies.delete": + +type TargetHttpsProxiesDeleteCall struct { + s *Service + project string + targetHttpsProxy string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified TargetHttpsProxy resource. +func (r *TargetHttpsProxiesService) Delete(project string, targetHttpsProxy string) *TargetHttpsProxiesDeleteCall { + c := &TargetHttpsProxiesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.targetHttpsProxy = targetHttpsProxy + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpsProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetHttpsProxiesDeleteCall) Context(ctx context.Context) *TargetHttpsProxiesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "targetHttpsProxy": c.targetHttpsProxy, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpsProxies.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetHttpsProxiesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified TargetHttpsProxy resource.", + // "httpMethod": "DELETE", + // "id": "compute.targetHttpsProxies.delete", + // "parameterOrder": [ + // "project", + // "targetHttpsProxy" + // ], + // "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" + // }, + // "targetHttpsProxy": { + // "description": "Name of the TargetHttpsProxy resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetHttpsProxies.get": + +type TargetHttpsProxiesGetCall struct { + s *Service + project string + targetHttpsProxy string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified TargetHttpsProxy resource. +func (r *TargetHttpsProxiesService) Get(project string, targetHttpsProxy string) *TargetHttpsProxiesGetCall { + c := &TargetHttpsProxiesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.targetHttpsProxy = targetHttpsProxy + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpsProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetHttpsProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetHttpsProxiesGetCall) Context(ctx context.Context) *TargetHttpsProxiesGetCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "targetHttpsProxy": c.targetHttpsProxy, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpsProxies.get" call. +// Exactly one of *TargetHttpsProxy or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TargetHttpsProxy.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetHttpsProxiesGetCall) Do() (*TargetHttpsProxy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetHttpsProxy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified TargetHttpsProxy resource.", + // "httpMethod": "GET", + // "id": "compute.targetHttpsProxies.get", + // "parameterOrder": [ + // "project", + // "targetHttpsProxy" + // ], + // "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" + // }, + // "targetHttpsProxy": { + // "description": "Name of the TargetHttpsProxy resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}", + // "response": { + // "$ref": "TargetHttpsProxy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetHttpsProxies.insert": + +type TargetHttpsProxiesInsertCall struct { + s *Service + project string + targethttpsproxy *TargetHttpsProxy + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a TargetHttpsProxy resource in the specified project +// using the data included in the request. +func (r *TargetHttpsProxiesService) Insert(project string, targethttpsproxy *TargetHttpsProxy) *TargetHttpsProxiesInsertCall { + c := &TargetHttpsProxiesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.targethttpsproxy = targethttpsproxy + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpsProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetHttpsProxiesInsertCall) Context(ctx context.Context) *TargetHttpsProxiesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpsProxies.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetHttpsProxiesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a TargetHttpsProxy resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.targetHttpsProxies.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/targetHttpsProxies", + // "request": { + // "$ref": "TargetHttpsProxy" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetHttpsProxies.list": + +type TargetHttpsProxiesListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of TargetHttpsProxy resources available to +// the specified project. +func (r *TargetHttpsProxiesService) List(project string) *TargetHttpsProxiesListCall { + c := &TargetHttpsProxiesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *TargetHttpsProxiesListCall) Filter(filter string) *TargetHttpsProxiesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *TargetHttpsProxiesListCall) MaxResults(maxResults int64) *TargetHttpsProxiesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *TargetHttpsProxiesListCall) PageToken(pageToken string) *TargetHttpsProxiesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpsProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetHttpsProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetHttpsProxiesListCall) Context(ctx context.Context) *TargetHttpsProxiesListCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpsProxiesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpsProxies.list" call. +// Exactly one of *TargetHttpsProxyList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TargetHttpsProxyList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetHttpsProxiesListCall) Do() (*TargetHttpsProxyList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetHttpsProxyList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of TargetHttpsProxy resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.targetHttpsProxies.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/targetHttpsProxies", + // "response": { + // "$ref": "TargetHttpsProxyList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetHttpsProxies.setSslCertificates": + +type TargetHttpsProxiesSetSslCertificatesCall struct { + s *Service + project string + targetHttpsProxy string + targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetSslCertificates: Replaces SslCertificates for TargetHttpsProxy. +func (r *TargetHttpsProxiesService) SetSslCertificates(project string, targetHttpsProxy string, targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest) *TargetHttpsProxiesSetSslCertificatesCall { + c := &TargetHttpsProxiesSetSslCertificatesCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.targetHttpsProxy = targetHttpsProxy + c.targethttpsproxiessetsslcertificatesrequest = targethttpsproxiessetsslcertificatesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpsProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslCertificatesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetHttpsProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslCertificatesCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetsslcertificatesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "targetHttpsProxy": c.targetHttpsProxy, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpsProxies.setSslCertificates" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetHttpsProxiesSetSslCertificatesCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Replaces SslCertificates for TargetHttpsProxy.", + // "httpMethod": "POST", + // "id": "compute.targetHttpsProxies.setSslCertificates", + // "parameterOrder": [ + // "project", + // "targetHttpsProxy" + // ], + // "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" + // }, + // "targetHttpsProxy": { + // "description": "Name of the TargetHttpsProxy 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}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates", + // "request": { + // "$ref": "TargetHttpsProxiesSetSslCertificatesRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetHttpsProxies.setUrlMap": + +type TargetHttpsProxiesSetUrlMapCall struct { + s *Service + project string + targetHttpsProxy string + urlmapreference *UrlMapReference + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetUrlMap: Changes the URL map for TargetHttpsProxy. +func (r *TargetHttpsProxiesService) SetUrlMap(project string, targetHttpsProxy string, urlmapreference *UrlMapReference) *TargetHttpsProxiesSetUrlMapCall { + c := &TargetHttpsProxiesSetUrlMapCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.targetHttpsProxy = targetHttpsProxy + c.urlmapreference = urlmapreference + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpsProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetUrlMapCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetHttpsProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpsProxiesSetUrlMapCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "targetHttpsProxy": c.targetHttpsProxy, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpsProxies.setUrlMap" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetHttpsProxiesSetUrlMapCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Changes the URL map for TargetHttpsProxy.", + // "httpMethod": "POST", + // "id": "compute.targetHttpsProxies.setUrlMap", + // "parameterOrder": [ + // "project", + // "targetHttpsProxy" + // ], + // "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" + // }, + // "targetHttpsProxy": { + // "description": "Name of the TargetHttpsProxy 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}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap", + // "request": { + // "$ref": "UrlMapReference" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetInstances.aggregatedList": + +type TargetInstancesAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of target instances grouped by +// scope. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/aggregatedList +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *TargetInstancesAggregatedListCall) MaxResults(maxResults int64) *TargetInstancesAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *TargetInstancesAggregatedListCall) PageToken(pageToken string) *TargetInstancesAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetInstancesAggregatedListCall) Fields(s ...googleapi.Field) *TargetInstancesAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetInstancesAggregatedListCall) IfNoneMatch(entityTag string) *TargetInstancesAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetInstancesAggregatedListCall) Context(ctx context.Context) *TargetInstancesAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *TargetInstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetInstances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetInstances.aggregatedList" call. +// Exactly one of *TargetInstanceAggregatedList or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *TargetInstanceAggregatedList.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetInstancesAggregatedListCall) Do() (*TargetInstanceAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetInstanceAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of target instances grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.targetInstances.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified TargetInstance resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetInstancesDeleteCall) Fields(s ...googleapi.Field) *TargetInstancesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetInstancesDeleteCall) Context(ctx context.Context) *TargetInstancesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TargetInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "targetInstance": c.targetInstance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetInstances.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetInstancesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Returns the specified TargetInstance resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetInstancesGetCall) Fields(s ...googleapi.Field) *TargetInstancesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetInstancesGetCall) IfNoneMatch(entityTag string) *TargetInstancesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetInstancesGetCall) Context(ctx context.Context) *TargetInstancesGetCall { + c.ctx_ = ctx + return c +} + +func (c *TargetInstancesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "targetInstance": c.targetInstance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetInstances.get" call. +// Exactly one of *TargetInstance or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TargetInstance.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetInstancesGetCall) Do() (*TargetInstance, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetInstance{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates a TargetInstance resource in the specified project +// and zone using the data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetInstancesInsertCall) Fields(s ...googleapi.Field) *TargetInstancesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetInstancesInsertCall) Context(ctx context.Context) *TargetInstancesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TargetInstancesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetInstances.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetInstancesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetInstances.list": + +type TargetInstancesListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of TargetInstance resources available to the +// specified project and zone. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *TargetInstancesListCall) MaxResults(maxResults int64) *TargetInstancesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *TargetInstancesListCall) PageToken(pageToken string) *TargetInstancesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetInstancesListCall) Fields(s ...googleapi.Field) *TargetInstancesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetInstancesListCall) IfNoneMatch(entityTag string) *TargetInstancesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetInstancesListCall) Context(ctx context.Context) *TargetInstancesListCall { + c.ctx_ = ctx + return c +} + +func (c *TargetInstancesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetInstances.list" call. +// Exactly one of *TargetInstanceList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TargetInstanceList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetInstancesListCall) Do() (*TargetInstanceList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetInstanceList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of TargetInstance resources available to the specified project and zone.", + // "httpMethod": "GET", + // "id": "compute.targetInstances.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// AddHealthCheck: Adds health check URL to targetPool. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addHealthCheck +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetPoolsAddHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsAddHealthCheckCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetPoolsAddHealthCheckCall) Context(ctx context.Context) *TargetPoolsAddHealthCheckCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsAddHealthCheckCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "targetPool": c.targetPool, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.addHealthCheck" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetPoolsAddHealthCheckCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// AddInstance: Adds instance url to targetPool. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addInstance +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetPoolsAddInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsAddInstanceCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetPoolsAddInstanceCall) Context(ctx context.Context) *TargetPoolsAddInstanceCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsAddInstanceCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addInstance") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "targetPool": c.targetPool, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.addInstance" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetPoolsAddInstanceCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetPools.aggregatedList": + +type TargetPoolsAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of target pools grouped by scope. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/aggregatedList +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *TargetPoolsAggregatedListCall) MaxResults(maxResults int64) *TargetPoolsAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *TargetPoolsAggregatedListCall) PageToken(pageToken string) *TargetPoolsAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetPoolsAggregatedListCall) Fields(s ...googleapi.Field) *TargetPoolsAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetPoolsAggregatedListCall) IfNoneMatch(entityTag string) *TargetPoolsAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetPoolsAggregatedListCall) Context(ctx context.Context) *TargetPoolsAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetPools") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.aggregatedList" call. +// Exactly one of *TargetPoolAggregatedList or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TargetPoolAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetPoolsAggregatedListCall) Do() (*TargetPoolAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetPoolAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of target pools grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.targetPools.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified TargetPool resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetPoolsDeleteCall) Fields(s ...googleapi.Field) *TargetPoolsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetPoolsDeleteCall) Context(ctx context.Context) *TargetPoolsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "targetPool": c.targetPool, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetPoolsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Returns the specified TargetPool resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetPoolsGetCall) Fields(s ...googleapi.Field) *TargetPoolsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetPoolsGetCall) IfNoneMatch(entityTag string) *TargetPoolsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetPoolsGetCall) Context(ctx context.Context) *TargetPoolsGetCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "targetPool": c.targetPool, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.get" call. +// Exactly one of *TargetPool or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TargetPool.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetPoolsGetCall) Do() (*TargetPool, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetPool{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// GetHealth: Gets the most recent health check results for each IP for +// the given instance that is referenced by given TargetPool. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/getHealth +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetPoolsGetHealthCall) Fields(s ...googleapi.Field) *TargetPoolsGetHealthCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetPoolsGetHealthCall) Context(ctx context.Context) *TargetPoolsGetHealthCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsGetHealthCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/getHealth") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "targetPool": c.targetPool, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.getHealth" call. +// Exactly one of *TargetPoolInstanceHealth or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TargetPoolInstanceHealth.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetPoolsGetHealthCall) Do() (*TargetPoolInstanceHealth, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetPoolInstanceHealth{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates a TargetPool resource in the specified project and +// region using the data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetPoolsInsertCall) Fields(s ...googleapi.Field) *TargetPoolsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetPoolsInsertCall) Context(ctx context.Context) *TargetPoolsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetPoolsInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetPools.list": + +type TargetPoolsListCall struct { + s *Service + project string + region string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of TargetPool resources available to the +// specified project and region. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *TargetPoolsListCall) MaxResults(maxResults int64) *TargetPoolsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *TargetPoolsListCall) PageToken(pageToken string) *TargetPoolsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetPoolsListCall) Fields(s ...googleapi.Field) *TargetPoolsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetPoolsListCall) IfNoneMatch(entityTag string) *TargetPoolsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetPoolsListCall) Context(ctx context.Context) *TargetPoolsListCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.list" call. +// Exactly one of *TargetPoolList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TargetPoolList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetPoolsListCall) Do() (*TargetPoolList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetPoolList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of TargetPool resources available to the specified project and region.", + // "httpMethod": "GET", + // "id": "compute.targetPools.list", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// RemoveHealthCheck: Removes health check URL from targetPool. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeHealthCheck +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetPoolsRemoveHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveHealthCheckCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetPoolsRemoveHealthCheckCall) Context(ctx context.Context) *TargetPoolsRemoveHealthCheckCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsRemoveHealthCheckCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "targetPool": c.targetPool, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.removeHealthCheck" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetPoolsRemoveHealthCheckCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// RemoveInstance: Removes instance URL from targetPool. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeInstance +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetPoolsRemoveInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveInstanceCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetPoolsRemoveInstanceCall) Context(ctx context.Context) *TargetPoolsRemoveInstanceCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsRemoveInstanceCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeInstance") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "targetPool": c.targetPool, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.removeInstance" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetPoolsRemoveInstanceCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// SetBackup: Changes backup pool configurations. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/setBackup +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetPoolsSetBackupCall) Fields(s ...googleapi.Field) *TargetPoolsSetBackupCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetPoolsSetBackupCall) Context(ctx context.Context) *TargetPoolsSetBackupCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsSetBackupCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["failoverRatio"]; ok { + params.Set("failoverRatio", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "targetPool": c.targetPool, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.setBackup" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetPoolsSetBackupCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetVpnGateways.aggregatedList": + +type TargetVpnGatewaysAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of target VPN gateways grouped by +// scope. +func (r *TargetVpnGatewaysService) AggregatedList(project string) *TargetVpnGatewaysAggregatedListCall { + c := &TargetVpnGatewaysAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *TargetVpnGatewaysAggregatedListCall) Filter(filter string) *TargetVpnGatewaysAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *TargetVpnGatewaysAggregatedListCall) MaxResults(maxResults int64) *TargetVpnGatewaysAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *TargetVpnGatewaysAggregatedListCall) PageToken(pageToken string) *TargetVpnGatewaysAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetVpnGatewaysAggregatedListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetVpnGatewaysAggregatedListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetVpnGatewaysAggregatedListCall) Context(ctx context.Context) *TargetVpnGatewaysAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *TargetVpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetVpnGateways") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetVpnGateways.aggregatedList" call. +// Exactly one of *TargetVpnGatewayAggregatedList or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *TargetVpnGatewayAggregatedList.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetVpnGatewaysAggregatedListCall) Do() (*TargetVpnGatewayAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetVpnGatewayAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of target VPN gateways grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.targetVpnGateways.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/targetVpnGateways", + // "response": { + // "$ref": "TargetVpnGatewayAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetVpnGateways.delete": + +type TargetVpnGatewaysDeleteCall struct { + s *Service + project string + region string + targetVpnGateway string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified TargetVpnGateway resource. +func (r *TargetVpnGatewaysService) Delete(project string, region string, targetVpnGateway string) *TargetVpnGatewaysDeleteCall { + c := &TargetVpnGatewaysDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetVpnGateway = targetVpnGateway + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetVpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetVpnGatewaysDeleteCall) Context(ctx context.Context) *TargetVpnGatewaysDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TargetVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "targetVpnGateway": c.targetVpnGateway, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetVpnGateways.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetVpnGatewaysDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified TargetVpnGateway resource.", + // "httpMethod": "DELETE", + // "id": "compute.targetVpnGateways.delete", + // "parameterOrder": [ + // "project", + // "region", + // "targetVpnGateway" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the region for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetVpnGateway": { + // "description": "Name of the TargetVpnGateway resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetVpnGateways.get": + +type TargetVpnGatewaysGetCall struct { + s *Service + project string + region string + targetVpnGateway string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified TargetVpnGateway resource. +func (r *TargetVpnGatewaysService) Get(project string, region string, targetVpnGateway string) *TargetVpnGatewaysGetCall { + c := &TargetVpnGatewaysGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetVpnGateway = targetVpnGateway + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetVpnGatewaysGetCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetVpnGatewaysGetCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetVpnGatewaysGetCall) Context(ctx context.Context) *TargetVpnGatewaysGetCall { + c.ctx_ = ctx + return c +} + +func (c *TargetVpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "targetVpnGateway": c.targetVpnGateway, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetVpnGateways.get" call. +// Exactly one of *TargetVpnGateway or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TargetVpnGateway.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetVpnGatewaysGetCall) Do() (*TargetVpnGateway, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetVpnGateway{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified TargetVpnGateway resource.", + // "httpMethod": "GET", + // "id": "compute.targetVpnGateways.get", + // "parameterOrder": [ + // "project", + // "region", + // "targetVpnGateway" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the region for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "targetVpnGateway": { + // "description": "Name of the TargetVpnGateway resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}", + // "response": { + // "$ref": "TargetVpnGateway" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetVpnGateways.insert": + +type TargetVpnGatewaysInsertCall struct { + s *Service + project string + region string + targetvpngateway *TargetVpnGateway + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a TargetVpnGateway resource in the specified project +// and region using the data included in the request. +func (r *TargetVpnGatewaysService) Insert(project string, region string, targetvpngateway *TargetVpnGateway) *TargetVpnGatewaysInsertCall { + c := &TargetVpnGatewaysInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.targetvpngateway = targetvpngateway + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetVpnGatewaysInsertCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetVpnGatewaysInsertCall) Context(ctx context.Context) *TargetVpnGatewaysInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TargetVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetvpngateway) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetVpnGateways.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetVpnGatewaysInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a TargetVpnGateway resource in the specified project and region using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.targetVpnGateways.insert", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the region for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetVpnGateways", + // "request": { + // "$ref": "TargetVpnGateway" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetVpnGateways.list": + +type TargetVpnGatewaysListCall struct { + s *Service + project string + region string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of TargetVpnGateway resources available to +// the specified project and region. +func (r *TargetVpnGatewaysService) List(project string, region string) *TargetVpnGatewaysListCall { + c := &TargetVpnGatewaysListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *TargetVpnGatewaysListCall) Filter(filter string) *TargetVpnGatewaysListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *TargetVpnGatewaysListCall) MaxResults(maxResults int64) *TargetVpnGatewaysListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *TargetVpnGatewaysListCall) PageToken(pageToken string) *TargetVpnGatewaysListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetVpnGatewaysListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetVpnGatewaysListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetVpnGatewaysListCall) Context(ctx context.Context) *TargetVpnGatewaysListCall { + c.ctx_ = ctx + return c +} + +func (c *TargetVpnGatewaysListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetVpnGateways.list" call. +// Exactly one of *TargetVpnGatewayList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TargetVpnGatewayList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetVpnGatewaysListCall) Do() (*TargetVpnGatewayList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetVpnGatewayList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of TargetVpnGateway resources available to the specified project and region.", + // "httpMethod": "GET", + // "id": "compute.targetVpnGateways.list", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the region for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/targetVpnGateways", + // "response": { + // "$ref": "TargetVpnGatewayList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.urlMaps.delete": + +type UrlMapsDeleteCall struct { + s *Service + project string + urlMap string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified UrlMap resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlMapsDeleteCall) Fields(s ...googleapi.Field) *UrlMapsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlMapsDeleteCall) Context(ctx context.Context) *UrlMapsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *UrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "urlMap": c.urlMap, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.urlMaps.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UrlMapsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.urlMaps.get": + +type UrlMapsGetCall struct { + s *Service + project string + urlMap string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified UrlMap resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlMapsGetCall) Fields(s ...googleapi.Field) *UrlMapsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UrlMapsGetCall) IfNoneMatch(entityTag string) *UrlMapsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlMapsGetCall) Context(ctx context.Context) *UrlMapsGetCall { + c.ctx_ = ctx + return c +} + +func (c *UrlMapsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "urlMap": c.urlMap, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.urlMaps.get" call. +// Exactly one of *UrlMap or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *UrlMap.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UrlMapsGetCall) Do() (*UrlMap, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UrlMap{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates a UrlMap resource in the specified project using the +// data included in the request. +// For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/insert +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlMapsInsertCall) Fields(s ...googleapi.Field) *UrlMapsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlMapsInsertCall) Context(ctx context.Context) *UrlMapsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *UrlMapsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.urlMaps.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UrlMapsInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.urlMaps.list": + +type UrlMapsListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of UrlMap resources available to the +// specified project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *UrlMapsListCall) MaxResults(maxResults int64) *UrlMapsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *UrlMapsListCall) PageToken(pageToken string) *UrlMapsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlMapsListCall) Fields(s ...googleapi.Field) *UrlMapsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UrlMapsListCall) IfNoneMatch(entityTag string) *UrlMapsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlMapsListCall) Context(ctx context.Context) *UrlMapsListCall { + c.ctx_ = ctx + return c +} + +func (c *UrlMapsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.urlMaps.list" call. +// Exactly one of *UrlMapList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UrlMapList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UrlMapsListCall) Do() (*UrlMapList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UrlMapList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of UrlMap resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.urlMaps.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Patch: Update the entire content of the UrlMap resource. This method +// supports patch semantics. +// For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/patch +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlMapsPatchCall) Fields(s ...googleapi.Field) *UrlMapsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlMapsPatchCall) Context(ctx context.Context) *UrlMapsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *UrlMapsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "urlMap": c.urlMap, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.urlMaps.patch" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UrlMapsPatchCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update the 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Update: Update the entire content of the UrlMap resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/update +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlMapsUpdateCall) Fields(s ...googleapi.Field) *UrlMapsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlMapsUpdateCall) Context(ctx context.Context) *UrlMapsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *UrlMapsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "urlMap": c.urlMap, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.urlMaps.update" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UrlMapsUpdateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update the 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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. +// For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/validate +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlMapsValidateCall) Fields(s ...googleapi.Field) *UrlMapsValidateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlMapsValidateCall) Context(ctx context.Context) *UrlMapsValidateCall { + c.ctx_ = ctx + return c +} + +func (c *UrlMapsValidateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/validate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "urlMap": c.urlMap, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.urlMaps.validate" call. +// Exactly one of *UrlMapsValidateResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *UrlMapsValidateResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UrlMapsValidateCall) Do() (*UrlMapsValidateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UrlMapsValidateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.vpnTunnels.aggregatedList": + +type VpnTunnelsAggregatedListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of VPN tunnels grouped by scope. +func (r *VpnTunnelsService) AggregatedList(project string) *VpnTunnelsAggregatedListCall { + c := &VpnTunnelsAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *VpnTunnelsAggregatedListCall) Filter(filter string) *VpnTunnelsAggregatedListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *VpnTunnelsAggregatedListCall) MaxResults(maxResults int64) *VpnTunnelsAggregatedListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *VpnTunnelsAggregatedListCall) PageToken(pageToken string) *VpnTunnelsAggregatedListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VpnTunnelsAggregatedListCall) Fields(s ...googleapi.Field) *VpnTunnelsAggregatedListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *VpnTunnelsAggregatedListCall) IfNoneMatch(entityTag string) *VpnTunnelsAggregatedListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VpnTunnelsAggregatedListCall) Context(ctx context.Context) *VpnTunnelsAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *VpnTunnelsAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/vpnTunnels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.vpnTunnels.aggregatedList" call. +// Exactly one of *VpnTunnelAggregatedList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *VpnTunnelAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *VpnTunnelsAggregatedListCall) Do() (*VpnTunnelAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &VpnTunnelAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of VPN tunnels grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.vpnTunnels.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/vpnTunnels", + // "response": { + // "$ref": "VpnTunnelAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.vpnTunnels.delete": + +type VpnTunnelsDeleteCall struct { + s *Service + project string + region string + vpnTunnel string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified VpnTunnel resource. +func (r *VpnTunnelsService) Delete(project string, region string, vpnTunnel string) *VpnTunnelsDeleteCall { + c := &VpnTunnelsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.vpnTunnel = vpnTunnel + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VpnTunnelsDeleteCall) Fields(s ...googleapi.Field) *VpnTunnelsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VpnTunnelsDeleteCall) Context(ctx context.Context) *VpnTunnelsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *VpnTunnelsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "vpnTunnel": c.vpnTunnel, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.vpnTunnels.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *VpnTunnelsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified VpnTunnel resource.", + // "httpMethod": "DELETE", + // "id": "compute.vpnTunnels.delete", + // "parameterOrder": [ + // "project", + // "region", + // "vpnTunnel" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the region for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "vpnTunnel": { + // "description": "Name of the VpnTunnel resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.vpnTunnels.get": + +type VpnTunnelsGetCall struct { + s *Service + project string + region string + vpnTunnel string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified VpnTunnel resource. +func (r *VpnTunnelsService) Get(project string, region string, vpnTunnel string) *VpnTunnelsGetCall { + c := &VpnTunnelsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.vpnTunnel = vpnTunnel + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VpnTunnelsGetCall) Fields(s ...googleapi.Field) *VpnTunnelsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *VpnTunnelsGetCall) IfNoneMatch(entityTag string) *VpnTunnelsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VpnTunnelsGetCall) Context(ctx context.Context) *VpnTunnelsGetCall { + c.ctx_ = ctx + return c +} + +func (c *VpnTunnelsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "vpnTunnel": c.vpnTunnel, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.vpnTunnels.get" call. +// Exactly one of *VpnTunnel or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *VpnTunnel.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *VpnTunnelsGetCall) Do() (*VpnTunnel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &VpnTunnel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified VpnTunnel resource.", + // "httpMethod": "GET", + // "id": "compute.vpnTunnels.get", + // "parameterOrder": [ + // "project", + // "region", + // "vpnTunnel" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the region for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "vpnTunnel": { + // "description": "Name of the VpnTunnel resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}", + // "response": { + // "$ref": "VpnTunnel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.vpnTunnels.insert": + +type VpnTunnelsInsertCall struct { + s *Service + project string + region string + vpntunnel *VpnTunnel + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a VpnTunnel resource in the specified project and +// region using the data included in the request. +func (r *VpnTunnelsService) Insert(project string, region string, vpntunnel *VpnTunnel) *VpnTunnelsInsertCall { + c := &VpnTunnelsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + c.vpntunnel = vpntunnel + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VpnTunnelsInsertCall) Fields(s ...googleapi.Field) *VpnTunnelsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VpnTunnelsInsertCall) Context(ctx context.Context) *VpnTunnelsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *VpnTunnelsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpntunnel) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.vpnTunnels.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *VpnTunnelsInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a VpnTunnel resource in the specified project and region using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.vpnTunnels.insert", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the region for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/vpnTunnels", + // "request": { + // "$ref": "VpnTunnel" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.vpnTunnels.list": + +type VpnTunnelsListCall struct { + s *Service + project string + region string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of VpnTunnel resources contained in the +// specified project and region. +func (r *VpnTunnelsService) List(project string, region string) *VpnTunnelsListCall { + c := &VpnTunnelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.region = region + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *VpnTunnelsListCall) Filter(filter string) *VpnTunnelsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *VpnTunnelsListCall) MaxResults(maxResults int64) *VpnTunnelsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *VpnTunnelsListCall) PageToken(pageToken string) *VpnTunnelsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VpnTunnelsListCall) Fields(s ...googleapi.Field) *VpnTunnelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *VpnTunnelsListCall) IfNoneMatch(entityTag string) *VpnTunnelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VpnTunnelsListCall) Context(ctx context.Context) *VpnTunnelsListCall { + c.ctx_ = ctx + return c +} + +func (c *VpnTunnelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.vpnTunnels.list" call. +// Exactly one of *VpnTunnelList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *VpnTunnelList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *VpnTunnelsListCall) Do() (*VpnTunnelList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &VpnTunnelList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of VpnTunnel resources contained in the specified project and region.", + // "httpMethod": "GET", + // "id": "compute.vpnTunnels.list", + // "parameterOrder": [ + // "project", + // "region" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "The name of the region for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/regions/{region}/vpnTunnels", + // "response": { + // "$ref": "VpnTunnelList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes the specified zone-specific Operations resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/delete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneOperationsDeleteCall) Fields(s ...googleapi.Field) *ZoneOperationsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneOperationsDeleteCall) Context(ctx context.Context) *ZoneOperationsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.zoneOperations.delete" call. +func (c *ZoneOperationsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified zone-specific Operations resource.", + // "httpMethod": "DELETE", + // "id": "compute.zoneOperations.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the Operations resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Retrieves the specified zone-specific Operations resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneOperationsGetCall) Fields(s ...googleapi.Field) *ZoneOperationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ZoneOperationsGetCall) IfNoneMatch(entityTag string) *ZoneOperationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneOperationsGetCall) Context(ctx context.Context) *ZoneOperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.zoneOperations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ZoneOperationsGetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified zone-specific Operations resource.", + // "httpMethod": "GET", + // "id": "compute.zoneOperations.get", + // "parameterOrder": [ + // "project", + // "zone", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the Operations resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// List: Retrieves the list of Operation resources contained within the +// specified zone. +// For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *ZoneOperationsListCall) MaxResults(maxResults int64) *ZoneOperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *ZoneOperationsListCall) PageToken(pageToken string) *ZoneOperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneOperationsListCall) Fields(s ...googleapi.Field) *ZoneOperationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ZoneOperationsListCall) IfNoneMatch(entityTag string) *ZoneOperationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneOperationsListCall) Context(ctx context.Context) *ZoneOperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneOperationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.zoneOperations.list" call. +// Exactly one of *OperationList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *OperationList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ZoneOperationsListCall) Do() (*OperationList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperationList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of Operation resources contained within the specified zone.", + // "httpMethod": "GET", + // "id": "compute.zoneOperations.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Returns the specified zone resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/zones/get +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZonesGetCall) Fields(s ...googleapi.Field) *ZonesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ZonesGetCall) IfNoneMatch(entityTag string) *ZonesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZonesGetCall) Context(ctx context.Context) *ZonesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ZonesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.zones.get" call. +// Exactly one of *Zone or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Zone.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ZonesGetCall) Do() (*Zone, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Zone{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified zone resource.", + // "httpMethod": "GET", + // "id": "compute.zones.get", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// List: Retrieves the list of zone resources available to the specified +// project. +// For details, see https://cloud.google.com/compute/docs/reference/latest/zones/list +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *ZonesListCall) MaxResults(maxResults int64) *ZonesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *ZonesListCall) PageToken(pageToken string) *ZonesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZonesListCall) Fields(s ...googleapi.Field) *ZonesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ZonesListCall) IfNoneMatch(entityTag string) *ZonesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZonesListCall) Context(ctx context.Context) *ZonesListCall { + c.ctx_ = ctx + return c +} + +func (c *ZonesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.zones.list" call. +// Exactly one of *ZoneList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *ZoneList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ZonesListCall) Do() (*ZoneList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ZoneList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of zone resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.zones.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/container/v1/container-api.json b/Godeps/_workspace/src/google.golang.org/api/container/v1/container-api.json new file mode 100644 index 000000000..9041b8cf2 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/container/v1/container-api.json @@ -0,0 +1,690 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/FD4oCwspiZqN6eCjsBmxDzsj5B8\"", + "discoveryVersion": "v1", + "id": "container:v1", + "name": "container", + "version": "v1", + "revision": "20150603", + "title": "Google Container Engine API", + "description": "The Google Container Engine API is used for building and managing container based applications, powered by the open source Kubernetes technology.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/container-engine/", + "protocol": "rest", + "baseUrl": "https://container.googleapis.com/", + "basePath": "/", + "rootUrl": "https://container.googleapis.com/", + "servicePath": "", + "batchPath": "batch", + "parameters": { + "access_token": { + "type": "string", + "description": "OAuth access token.", + "location": "query" + }, + "alt": { + "type": "string", + "description": "Data format for response.", + "default": "json", + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query" + }, + "bearer_token": { + "type": "string", + "description": "OAuth bearer token.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JSONP", + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "pp": { + "type": "boolean", + "description": "Pretty-print response.", + "default": "true", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query" + }, + "upload_protocol": { + "type": "string", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query" + }, + "uploadType": { + "type": "string", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query" + }, + "$.xgafv": { + "type": "string", + "description": "V1 error format.", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "schemas": { + "ListClustersResponse": { + "id": "ListClustersResponse", + "type": "object", + "description": "ListClustersResponse is the result of ListClustersRequest.", + "properties": { + "clusters": { + "type": "array", + "description": "A list of clusters in the project in the specified zone, or across all ones.", + "items": { + "$ref": "Cluster" + } + } + } + }, + "Cluster": { + "id": "Cluster", + "type": "object", + "description": "A Google Container Engine cluster.", + "properties": { + "name": { + "type": "string", + "description": "The name of this cluster. The name must be unique within this project and zone, and can be up to 40 characters with the following restrictions: * Lowercase letters, numbers, and hyphens only. * Must start with a letter. * Must end with a number or a letter." + }, + "description": { + "type": "string", + "description": "An optional description of this cluster." + }, + "initialNodeCount": { + "type": "integer", + "description": "The number of nodes to create in this cluster. You must ensure that your Compute Engine [resource quota](/compute/docs/resource-quotas) is sufficient for this number of instances. You must also have available firewall and routes quota.", + "format": "int32" + }, + "nodeConfig": { + "$ref": "NodeConfig", + "description": "Parameters used in creating the cluster's nodes. See the descriptions of the child properties of `nodeConfig`. If unspecified, the defaults for all child properties are used." + }, + "masterAuth": { + "$ref": "MasterAuth", + "description": "The authentication information for accessing the master." + }, + "loggingService": { + "type": "string", + "description": "The logging service that the cluster should write logs to. Currently available options: * \"logging.googleapis.com\" - the Google Cloud Logging service * \"none\" - no logs will be exported from the cluster * \"\" - default value; the default is \"logging.googleapis.com\"" + }, + "monitoringService": { + "type": "string", + "description": "The monitoring service that the cluster should write metrics to. Currently available options: * \"monitoring.googleapis.com\" - the Google Cloud Monitoring service * \"none\" - no metrics will be exported from the cluster * \"\" - default value; the default is \"monitoring.googleapis.com\"" + }, + "network": { + "type": "string", + "description": "The name of the Google Compute Engine [network](/compute/docs/networking#networks_1) to which the cluster is connected. If left unspecified, the \"default\" network will be used." + }, + "clusterIpv4Cidr": { + "type": "string", + "description": "The IP address range of the container pods in this cluster, in [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) notation (e.g. `10.96.0.0/14`). Leave blank to have one automatically chosen or specify a `/14` block in `10.0.0.0/8`." + }, + "selfLink": { + "type": "string", + "description": "[Output only] Server-defined URL for the resource." + }, + "zone": { + "type": "string", + "description": "[Output only] The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides." + }, + "endpoint": { + "type": "string", + "description": "[Output only] The IP address of this cluster's Kubernetes master endpoint. The endpoint can be accessed from the internet at `https://username:password@endpoint/`. See the `masterAuth` property of this resource for username and password information." + }, + "initialClusterVersion": { + "type": "string", + "description": "[Output only] The software version of Kubernetes master and kubelets used in the cluster when it was first created. The version can be upgraded over time." + }, + "currentMasterVersion": { + "type": "string", + "description": "[Output only] The current software version of the master endpoint." + }, + "currentNodeVersion": { + "type": "string", + "description": "[Output only] The current version of the node software components. If they are currently at different versions because they're in the process of being upgraded, this reflects the minimum version of any of them." + }, + "createTime": { + "type": "string", + "description": "[Output only] The time the cluster was created, in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format." + }, + "status": { + "type": "string", + "description": "[Output only] The current status of this cluster.", + "enum": [ + "STATUS_UNSPECIFIED", + "PROVISIONING", + "RUNNING", + "RECONCILING", + "STOPPING", + "ERROR" + ] + }, + "statusMessage": { + "type": "string", + "description": "[Output only] Additional information about the current status of this cluster, if available." + }, + "nodeIpv4CidrSize": { + "type": "integer", + "description": "[Output only] The size of the address space on each node for hosting containers. This is provisioned from within the container_ipv4_cidr range.", + "format": "int32" + }, + "servicesIpv4Cidr": { + "type": "string", + "description": "[Output only] The IP address range of the Kubernetes services in this cluster, in [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) notation (e.g. `1.2.3.4/29`). Service addresses are typically put in the last /16 from the container CIDR." + }, + "instanceGroupUrls": { + "type": "array", + "description": "[Output only] The resource URLs of [instance groups](/compute/docs/instance-groups/) associated with this cluster.", + "items": { + "type": "string" + } + } + } + }, + "NodeConfig": { + "id": "NodeConfig", + "type": "object", + "description": "Per-node parameters.", + "properties": { + "machineType": { + "type": "string", + "description": "The name of a Google Compute Engine [machine type](/compute/docs/machine-types) (e.g. `n1-standard-1`). If unspecified, the default machine type is `n1-standard-1`." + }, + "diskSizeGb": { + "type": "integer", + "description": "Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB. If unspecified, the default disk size is 100GB.", + "format": "int32" + }, + "oauthScopes": { + "type": "array", + "description": "The set of Google API scopes to be made available on all of the node VMs under the \"default\" service account. The following scopes are recommended, but not required, and by default are not included: * `https://www.googleapis.com/auth/compute` is required for mounting persistent storage on your nodes. * `https://www.googleapis.com/auth/devstorage.read_only` is required for communicating with *gcr.io*. If unspecified, no scopes are added.", + "items": { + "type": "string" + } + } + } + }, + "MasterAuth": { + "id": "MasterAuth", + "type": "object", + "description": "The authentication information for accessing the master endpoint. Authentication can be done using HTTP basic auth or using client certificates.", + "properties": { + "username": { + "type": "string", + "description": "The username to use for HTTP basic authentication when accessing the Kubernetes master endpoint." + }, + "password": { + "type": "string", + "description": "The password to use for HTTP basic authentication when accessing the Kubernetes master endpoint. Because the master endpoint is open to the internet, you should create a strong password." + }, + "clusterCaCertificate": { + "type": "string", + "description": "[Output only] Base64 encoded public certificate that is the root of trust for the cluster." + }, + "clientCertificate": { + "type": "string", + "description": "[Output only] Base64 encoded public certificate used by clients to authenticate to the cluster endpoint." + }, + "clientKey": { + "type": "string", + "description": "[Output only] Base64 encoded private key used by clients to authenticate to the cluster endpoint." + } + } + }, + "CreateClusterRequest": { + "id": "CreateClusterRequest", + "type": "object", + "description": "CreateClusterRequest creates a cluster.", + "properties": { + "cluster": { + "$ref": "Cluster", + "description": "A [cluster resource](/container-engine/reference/rest/v1/projects.zones.clusters)" + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "description": "Defines the operation resource. All fields are output only.", + "properties": { + "name": { + "type": "string", + "description": "The server-assigned ID for the operation." + }, + "zone": { + "type": "string", + "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the operation is taking place." + }, + "operationType": { + "type": "string", + "description": "The operation type.", + "enum": [ + "TYPE_UNSPECIFIED", + "CREATE_CLUSTER", + "DELETE_CLUSTER", + "UPGRADE_MASTER", + "UPGRADE_NODES", + "REPAIR_CLUSTER" + ] + }, + "status": { + "type": "string", + "description": "The current status of the operation.", + "enum": [ + "STATUS_UNSPECIFIED", + "PENDING", + "RUNNING", + "DONE" + ] + }, + "statusMessage": { + "type": "string", + "description": "If an error has occurred, a textual description of the error." + }, + "selfLink": { + "type": "string", + "description": "Server-defined URL for the resource." + }, + "targetLink": { + "type": "string", + "description": "Server-defined URL for the target of the operation." + } + } + }, + "UpdateClusterRequest": { + "id": "UpdateClusterRequest", + "type": "object", + "description": "UpdateClusterRequest updates a cluster.", + "properties": { + "update": { + "$ref": "ClusterUpdate", + "description": "A description of the update." + } + } + }, + "ClusterUpdate": { + "id": "ClusterUpdate", + "type": "object", + "description": "ClusterUpdate describes an update to the cluster.", + "properties": { + "desiredNodeVersion": { + "type": "string", + "description": "The Kubernetes version to change the nodes to (typically an upgrade). Use \"-\" to upgrade to the latest version supported by the server." + } + } + }, + "ListOperationsResponse": { + "id": "ListOperationsResponse", + "type": "object", + "description": "ListOperationsResponse is the result of ListOperationsRequest.", + "properties": { + "operations": { + "type": "array", + "description": "A list of operations in the project in the specified zone.", + "items": { + "$ref": "Operation" + } + } + } + }, + "ServerConfig": { + "id": "ServerConfig", + "type": "object", + "description": "Container Engine Server configuration.", + "properties": { + "defaultClusterVersion": { + "type": "string", + "description": "What version this server deploys by default." + }, + "validNodeVersions": { + "type": "array", + "description": "List of valid node upgrade target versions.", + "items": { + "type": "string" + } + } + } + } + }, + "resources": { + "projects": { + "resources": { + "zones": { + "methods": { + "getServerconfig": { + "id": "container.projects.zones.getServerconfig", + "path": "v1/projects/{projectId}/zones/{zone}/serverconfig", + "httpMethod": "GET", + "description": "Returns configuration info about the Container Engine service.", + "parameters": { + "projectId": { + "type": "string", + "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or \"-\" for all zones.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "zone" + ], + "response": { + "$ref": "ServerConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + }, + "resources": { + "clusters": { + "methods": { + "list": { + "id": "container.projects.zones.clusters.list", + "path": "v1/projects/{projectId}/zones/{zone}/clusters", + "httpMethod": "GET", + "description": "Lists all clusters owned by a project in either the specified zone or all zones.", + "parameters": { + "projectId": { + "type": "string", + "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides, or \"-\" for all zones.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "zone" + ], + "response": { + "$ref": "ListClustersResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "id": "container.projects.zones.clusters.get", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", + "httpMethod": "GET", + "description": "Gets a specific cluster.", + "parameters": { + "projectId": { + "type": "string", + "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides.", + "required": true, + "location": "path" + }, + "clusterId": { + "type": "string", + "description": "The name of the cluster to retrieve.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "response": { + "$ref": "Cluster" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "create": { + "id": "container.projects.zones.clusters.create", + "path": "v1/projects/{projectId}/zones/{zone}/clusters", + "httpMethod": "POST", + "description": "Creates a cluster, consisting of the specified number and type of Google Compute Engine instances, plus a Kubernetes master endpoint. By default, the cluster is created in the project's [default network](/compute/docs/networking#networks_1). One firewall is added for the cluster. After cluster creation, the cluster creates routes for each node to allow the containers on that node to communicate with all other instances in the cluster. Finally, an entry is added to the project's global metadata indicating which CIDR range is being used by the cluster.", + "parameters": { + "projectId": { + "type": "string", + "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "zone" + ], + "request": { + "$ref": "CreateClusterRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "update": { + "id": "container.projects.zones.clusters.update", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", + "httpMethod": "PUT", + "description": "Update settings of a specific cluster.", + "parameters": { + "projectId": { + "type": "string", + "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides.", + "required": true, + "location": "path" + }, + "clusterId": { + "type": "string", + "description": "The name of the cluster to upgrade.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "request": { + "$ref": "UpdateClusterRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "id": "container.projects.zones.clusters.delete", + "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", + "httpMethod": "DELETE", + "description": "Deletes the cluster, including the Kubernetes endpoint and all worker nodes. Firewalls and routes that were configured during cluster creation are also deleted.", + "parameters": { + "projectId": { + "type": "string", + "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides.", + "required": true, + "location": "path" + }, + "clusterId": { + "type": "string", + "description": "The name of the cluster to delete.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "zone", + "clusterId" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "operations": { + "methods": { + "list": { + "id": "container.projects.zones.operations.list", + "path": "v1/projects/{projectId}/zones/{zone}/operations", + "httpMethod": "GET", + "description": "Lists all operations in a project in a specific zone or all zones.", + "parameters": { + "projectId": { + "type": "string", + "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or \"-\" for all zones.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "zone" + ], + "response": { + "$ref": "ListOperationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "id": "container.projects.zones.operations.get", + "path": "v1/projects/{projectId}/zones/{zone}/operations/{operationId}", + "httpMethod": "GET", + "description": "Gets the specified operation.", + "parameters": { + "projectId": { + "type": "string", + "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides.", + "required": true, + "location": "path" + }, + "operationId": { + "type": "string", + "description": "The server-assigned `name` of the operation.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "zone", + "operationId" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/container/v1/container-gen.go b/Godeps/_workspace/src/google.golang.org/api/container/v1/container-gen.go new file mode 100644 index 000000000..bb98f63eb --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/container/v1/container-gen.go @@ -0,0 +1,1658 @@ +// Package container provides access to the Google Container Engine API. +// +// See https://cloud.google.com/container-engine/ +// +// Usage example: +// +// import "google.golang.org/api/container/v1" +// ... +// containerService, err := container.New(oauthHttpClient) +package container // import "google.golang.org/api/container/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "container:v1" +const apiName = "container" +const apiVersion = "v1" +const basePath = "https://container.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your data across Google Cloud Platform services + CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Projects *ProjectsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewProjectsService(s *Service) *ProjectsService { + rs := &ProjectsService{s: s} + rs.Zones = NewProjectsZonesService(s) + return rs +} + +type ProjectsService struct { + s *Service + + Zones *ProjectsZonesService +} + +func NewProjectsZonesService(s *Service) *ProjectsZonesService { + rs := &ProjectsZonesService{s: s} + rs.Clusters = NewProjectsZonesClustersService(s) + rs.Operations = NewProjectsZonesOperationsService(s) + return rs +} + +type ProjectsZonesService struct { + s *Service + + Clusters *ProjectsZonesClustersService + + Operations *ProjectsZonesOperationsService +} + +func NewProjectsZonesClustersService(s *Service) *ProjectsZonesClustersService { + rs := &ProjectsZonesClustersService{s: s} + return rs +} + +type ProjectsZonesClustersService struct { + s *Service +} + +func NewProjectsZonesOperationsService(s *Service) *ProjectsZonesOperationsService { + rs := &ProjectsZonesOperationsService{s: s} + return rs +} + +type ProjectsZonesOperationsService struct { + s *Service +} + +// Cluster: A Google Container Engine cluster. +type Cluster struct { + // ClusterIpv4Cidr: The IP address range of the container pods in this + // cluster, in + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `10.96.0.0/14`). Leave blank to have one automatically + // chosen or specify a `/14` block in `10.0.0.0/8`. + ClusterIpv4Cidr string `json:"clusterIpv4Cidr,omitempty"` + + // CreateTime: [Output only] The time the cluster was created, in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + CreateTime string `json:"createTime,omitempty"` + + // CurrentMasterVersion: [Output only] The current software version of + // the master endpoint. + CurrentMasterVersion string `json:"currentMasterVersion,omitempty"` + + // CurrentNodeVersion: [Output only] The current version of the node + // software components. If they are currently at different versions + // because they're in the process of being upgraded, this reflects the + // minimum version of any of them. + CurrentNodeVersion string `json:"currentNodeVersion,omitempty"` + + // Description: An optional description of this cluster. + Description string `json:"description,omitempty"` + + // Endpoint: [Output only] The IP address of this cluster's Kubernetes + // master endpoint. The endpoint can be accessed from the internet at + // `https://username:password@endpoint/`. See the `masterAuth` property + // of this resource for username and password information. + Endpoint string `json:"endpoint,omitempty"` + + // InitialClusterVersion: [Output only] The software version of + // Kubernetes master and kubelets used in the cluster when it was first + // created. The version can be upgraded over time. + InitialClusterVersion string `json:"initialClusterVersion,omitempty"` + + // InitialNodeCount: The number of nodes to create in this cluster. You + // must ensure that your Compute Engine [resource + // quota](/compute/docs/resource-quotas) is sufficient for this number + // of instances. You must also have available firewall and routes quota. + InitialNodeCount int64 `json:"initialNodeCount,omitempty"` + + // InstanceGroupUrls: [Output only] The resource URLs of [instance + // groups](/compute/docs/instance-groups/) associated with this cluster. + InstanceGroupUrls []string `json:"instanceGroupUrls,omitempty"` + + // LoggingService: The logging service that the cluster should write + // logs to. Currently available options: * "logging.googleapis.com" - + // the Google Cloud Logging service * "none" - no logs will be exported + // from the cluster * "" - default value; the default is + // "logging.googleapis.com" + LoggingService string `json:"loggingService,omitempty"` + + // MasterAuth: The authentication information for accessing the master. + MasterAuth *MasterAuth `json:"masterAuth,omitempty"` + + // MonitoringService: The monitoring service that the cluster should + // write metrics to. Currently available options: * + // "monitoring.googleapis.com" - the Google Cloud Monitoring service * + // "none" - no metrics will be exported from the cluster * "" - default + // value; the default is "monitoring.googleapis.com" + MonitoringService string `json:"monitoringService,omitempty"` + + // Name: The name of this cluster. The name must be unique within this + // project and zone, and can be up to 40 characters with the following + // restrictions: * Lowercase letters, numbers, and hyphens only. * Must + // start with a letter. * Must end with a number or a letter. + Name string `json:"name,omitempty"` + + // Network: The name of the Google Compute Engine + // [network](/compute/docs/networking#networks_1) to which the cluster + // is connected. If left unspecified, the "default" network will be + // used. + Network string `json:"network,omitempty"` + + // NodeConfig: Parameters used in creating the cluster's nodes. See the + // descriptions of the child properties of `nodeConfig`. If unspecified, + // the defaults for all child properties are used. + NodeConfig *NodeConfig `json:"nodeConfig,omitempty"` + + // NodeIpv4CidrSize: [Output only] The size of the address space on each + // node for hosting containers. This is provisioned from within the + // container_ipv4_cidr range. + NodeIpv4CidrSize int64 `json:"nodeIpv4CidrSize,omitempty"` + + // SelfLink: [Output only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServicesIpv4Cidr: [Output only] The IP address range of the + // Kubernetes services in this cluster, in + // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `1.2.3.4/29`). Service addresses are typically put in + // the last /16 from the container CIDR. + ServicesIpv4Cidr string `json:"servicesIpv4Cidr,omitempty"` + + // Status: [Output only] The current status of this cluster. + // + // Possible values: + // "STATUS_UNSPECIFIED" + // "PROVISIONING" + // "RUNNING" + // "RECONCILING" + // "STOPPING" + // "ERROR" + Status string `json:"status,omitempty"` + + // StatusMessage: [Output only] Additional information about the current + // status of this cluster, if available. + StatusMessage string `json:"statusMessage,omitempty"` + + // Zone: [Output only] The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the cluster resides. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ClusterIpv4Cidr") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Cluster) MarshalJSON() ([]byte, error) { + type noMethod Cluster + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ClusterUpdate: ClusterUpdate describes an update to the cluster. +type ClusterUpdate struct { + // DesiredNodeVersion: The Kubernetes version to change the nodes to + // (typically an upgrade). Use "-" to upgrade to the latest version + // supported by the server. + DesiredNodeVersion string `json:"desiredNodeVersion,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DesiredNodeVersion") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ClusterUpdate) MarshalJSON() ([]byte, error) { + type noMethod ClusterUpdate + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreateClusterRequest: CreateClusterRequest creates a cluster. +type CreateClusterRequest struct { + // Cluster: A [cluster + // resource](/container-engine/reference/rest/v1/projects.zones.clusters) + Cluster *Cluster `json:"cluster,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Cluster") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreateClusterRequest) MarshalJSON() ([]byte, error) { + type noMethod CreateClusterRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListClustersResponse: ListClustersResponse is the result of +// ListClustersRequest. +type ListClustersResponse struct { + // Clusters: A list of clusters in the project in the specified zone, or + // across all ones. + Clusters []*Cluster `json:"clusters,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Clusters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListClustersResponse) MarshalJSON() ([]byte, error) { + type noMethod ListClustersResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListOperationsResponse: ListOperationsResponse is the result of +// ListOperationsRequest. +type ListOperationsResponse struct { + // Operations: A list of operations in the project in the specified + // zone. + Operations []*Operation `json:"operations,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Operations") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListOperationsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MasterAuth: The authentication information for accessing the master +// endpoint. Authentication can be done using HTTP basic auth or using +// client certificates. +type MasterAuth struct { + // ClientCertificate: [Output only] Base64 encoded public certificate + // used by clients to authenticate to the cluster endpoint. + ClientCertificate string `json:"clientCertificate,omitempty"` + + // ClientKey: [Output only] Base64 encoded private key used by clients + // to authenticate to the cluster endpoint. + ClientKey string `json:"clientKey,omitempty"` + + // ClusterCaCertificate: [Output only] Base64 encoded public certificate + // that is the root of trust for the cluster. + ClusterCaCertificate string `json:"clusterCaCertificate,omitempty"` + + // Password: The password to use for HTTP basic authentication when + // accessing the Kubernetes master endpoint. Because the master endpoint + // is open to the internet, you should create a strong password. + Password string `json:"password,omitempty"` + + // Username: The username to use for HTTP basic authentication when + // accessing the Kubernetes master endpoint. + Username string `json:"username,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ClientCertificate") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MasterAuth) MarshalJSON() ([]byte, error) { + type noMethod MasterAuth + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// NodeConfig: Per-node parameters. +type NodeConfig struct { + // DiskSizeGb: Size of the disk attached to each node, specified in GB. + // The smallest allowed disk size is 10GB. If unspecified, the default + // disk size is 100GB. + DiskSizeGb int64 `json:"diskSizeGb,omitempty"` + + // MachineType: The name of a Google Compute Engine [machine + // type](/compute/docs/machine-types) (e.g. `n1-standard-1`). If + // unspecified, the default machine type is `n1-standard-1`. + MachineType string `json:"machineType,omitempty"` + + // OauthScopes: The set of Google API scopes to be made available on all + // of the node VMs under the "default" service account. The following + // scopes are recommended, but not required, and by default are not + // included: * `https://www.googleapis.com/auth/compute` is required for + // mounting persistent storage on your nodes. * + // `https://www.googleapis.com/auth/devstorage.read_only` is required + // for communicating with *gcr.io*. If unspecified, no scopes are added. + OauthScopes []string `json:"oauthScopes,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DiskSizeGb") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *NodeConfig) MarshalJSON() ([]byte, error) { + type noMethod NodeConfig + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Operation: Defines the operation resource. All fields are output +// only. +type Operation struct { + // Name: The server-assigned ID for the operation. + Name string `json:"name,omitempty"` + + // OperationType: The operation type. + // + // Possible values: + // "TYPE_UNSPECIFIED" + // "CREATE_CLUSTER" + // "DELETE_CLUSTER" + // "UPGRADE_MASTER" + // "UPGRADE_NODES" + // "REPAIR_CLUSTER" + OperationType string `json:"operationType,omitempty"` + + // SelfLink: Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // Status: The current status of the operation. + // + // Possible values: + // "STATUS_UNSPECIFIED" + // "PENDING" + // "RUNNING" + // "DONE" + Status string `json:"status,omitempty"` + + // StatusMessage: If an error has occurred, a textual description of the + // error. + StatusMessage string `json:"statusMessage,omitempty"` + + // TargetLink: Server-defined URL for the target of the operation. + TargetLink string `json:"targetLink,omitempty"` + + // Zone: The name of the Google Compute Engine + // [zone](/compute/docs/zones#available) in which the operation is + // taking place. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Operation) MarshalJSON() ([]byte, error) { + type noMethod Operation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ServerConfig: Container Engine Server configuration. +type ServerConfig struct { + // DefaultClusterVersion: What version this server deploys by default. + DefaultClusterVersion string `json:"defaultClusterVersion,omitempty"` + + // ValidNodeVersions: List of valid node upgrade target versions. + ValidNodeVersions []string `json:"validNodeVersions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "DefaultClusterVersion") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ServerConfig) MarshalJSON() ([]byte, error) { + type noMethod ServerConfig + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UpdateClusterRequest: UpdateClusterRequest updates a cluster. +type UpdateClusterRequest struct { + // Update: A description of the update. + Update *ClusterUpdate `json:"update,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Update") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UpdateClusterRequest) MarshalJSON() ([]byte, error) { + type noMethod UpdateClusterRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "container.projects.zones.getServerconfig": + +type ProjectsZonesGetServerconfigCall struct { + s *Service + projectId string + zone string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetServerconfig: Returns configuration info about the Container +// Engine service. +func (r *ProjectsZonesService) GetServerconfig(projectId string, zone string) *ProjectsZonesGetServerconfigCall { + c := &ProjectsZonesGetServerconfigCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.zone = zone + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsZonesGetServerconfigCall) Fields(s ...googleapi.Field) *ProjectsZonesGetServerconfigCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsZonesGetServerconfigCall) IfNoneMatch(entityTag string) *ProjectsZonesGetServerconfigCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsZonesGetServerconfigCall) Context(ctx context.Context) *ProjectsZonesGetServerconfigCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsZonesGetServerconfigCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/serverconfig") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "container.projects.zones.getServerconfig" call. +// Exactly one of *ServerConfig or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ServerConfig.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsZonesGetServerconfigCall) Do() (*ServerConfig, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ServerConfig{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns configuration info about the Container Engine service.", + // "httpMethod": "GET", + // "id": "container.projects.zones.getServerconfig", + // "parameterOrder": [ + // "projectId", + // "zone" + // ], + // "parameters": { + // "projectId": { + // "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or \"-\" for all zones.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/projects/{projectId}/zones/{zone}/serverconfig", + // "response": { + // "$ref": "ServerConfig" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "container.projects.zones.clusters.create": + +type ProjectsZonesClustersCreateCall struct { + s *Service + projectId string + zone string + createclusterrequest *CreateClusterRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a cluster, consisting of the specified number and +// type of Google Compute Engine instances, plus a Kubernetes master +// endpoint. By default, the cluster is created in the project's +// [default network](/compute/docs/networking#networks_1). One firewall +// is added for the cluster. After cluster creation, the cluster creates +// routes for each node to allow the containers on that node to +// communicate with all other instances in the cluster. Finally, an +// entry is added to the project's global metadata indicating which CIDR +// range is being used by the cluster. +func (r *ProjectsZonesClustersService) Create(projectId string, zone string, createclusterrequest *CreateClusterRequest) *ProjectsZonesClustersCreateCall { + c := &ProjectsZonesClustersCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.zone = zone + c.createclusterrequest = createclusterrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsZonesClustersCreateCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsZonesClustersCreateCall) Context(ctx context.Context) *ProjectsZonesClustersCreateCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsZonesClustersCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.createclusterrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "container.projects.zones.clusters.create" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsZonesClustersCreateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a cluster, consisting of the specified number and type of Google Compute Engine instances, plus a Kubernetes master endpoint. By default, the cluster is created in the project's [default network](/compute/docs/networking#networks_1). One firewall is added for the cluster. After cluster creation, the cluster creates routes for each node to allow the containers on that node to communicate with all other instances in the cluster. Finally, an entry is added to the project's global metadata indicating which CIDR range is being used by the cluster.", + // "httpMethod": "POST", + // "id": "container.projects.zones.clusters.create", + // "parameterOrder": [ + // "projectId", + // "zone" + // ], + // "parameters": { + // "projectId": { + // "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/projects/{projectId}/zones/{zone}/clusters", + // "request": { + // "$ref": "CreateClusterRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "container.projects.zones.clusters.delete": + +type ProjectsZonesClustersDeleteCall struct { + s *Service + projectId string + zone string + clusterId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the cluster, including the Kubernetes endpoint and +// all worker nodes. Firewalls and routes that were configured during +// cluster creation are also deleted. +func (r *ProjectsZonesClustersService) Delete(projectId string, zone string, clusterId string) *ProjectsZonesClustersDeleteCall { + c := &ProjectsZonesClustersDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.zone = zone + c.clusterId = clusterId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsZonesClustersDeleteCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsZonesClustersDeleteCall) Context(ctx context.Context) *ProjectsZonesClustersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsZonesClustersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "zone": c.zone, + "clusterId": c.clusterId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "container.projects.zones.clusters.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsZonesClustersDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the cluster, including the Kubernetes endpoint and all worker nodes. Firewalls and routes that were configured during cluster creation are also deleted.", + // "httpMethod": "DELETE", + // "id": "container.projects.zones.clusters.delete", + // "parameterOrder": [ + // "projectId", + // "zone", + // "clusterId" + // ], + // "parameters": { + // "clusterId": { + // "description": "The name of the cluster to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "container.projects.zones.clusters.get": + +type ProjectsZonesClustersGetCall struct { + s *Service + projectId string + zone string + clusterId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a specific cluster. +func (r *ProjectsZonesClustersService) Get(projectId string, zone string, clusterId string) *ProjectsZonesClustersGetCall { + c := &ProjectsZonesClustersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.zone = zone + c.clusterId = clusterId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsZonesClustersGetCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsZonesClustersGetCall) IfNoneMatch(entityTag string) *ProjectsZonesClustersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsZonesClustersGetCall) Context(ctx context.Context) *ProjectsZonesClustersGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsZonesClustersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "zone": c.zone, + "clusterId": c.clusterId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "container.projects.zones.clusters.get" call. +// Exactly one of *Cluster or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Cluster.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsZonesClustersGetCall) Do() (*Cluster, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Cluster{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a specific cluster.", + // "httpMethod": "GET", + // "id": "container.projects.zones.clusters.get", + // "parameterOrder": [ + // "projectId", + // "zone", + // "clusterId" + // ], + // "parameters": { + // "clusterId": { + // "description": "The name of the cluster to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", + // "response": { + // "$ref": "Cluster" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "container.projects.zones.clusters.list": + +type ProjectsZonesClustersListCall struct { + s *Service + projectId string + zone string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all clusters owned by a project in either the specified +// zone or all zones. +func (r *ProjectsZonesClustersService) List(projectId string, zone string) *ProjectsZonesClustersListCall { + c := &ProjectsZonesClustersListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.zone = zone + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsZonesClustersListCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsZonesClustersListCall) IfNoneMatch(entityTag string) *ProjectsZonesClustersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsZonesClustersListCall) Context(ctx context.Context) *ProjectsZonesClustersListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsZonesClustersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "container.projects.zones.clusters.list" call. +// Exactly one of *ListClustersResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListClustersResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsZonesClustersListCall) Do() (*ListClustersResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListClustersResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all clusters owned by a project in either the specified zone or all zones.", + // "httpMethod": "GET", + // "id": "container.projects.zones.clusters.list", + // "parameterOrder": [ + // "projectId", + // "zone" + // ], + // "parameters": { + // "projectId": { + // "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides, or \"-\" for all zones.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/projects/{projectId}/zones/{zone}/clusters", + // "response": { + // "$ref": "ListClustersResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "container.projects.zones.clusters.update": + +type ProjectsZonesClustersUpdateCall struct { + s *Service + projectId string + zone string + clusterId string + updateclusterrequest *UpdateClusterRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Update settings of a specific cluster. +func (r *ProjectsZonesClustersService) Update(projectId string, zone string, clusterId string, updateclusterrequest *UpdateClusterRequest) *ProjectsZonesClustersUpdateCall { + c := &ProjectsZonesClustersUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.zone = zone + c.clusterId = clusterId + c.updateclusterrequest = updateclusterrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsZonesClustersUpdateCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsZonesClustersUpdateCall) Context(ctx context.Context) *ProjectsZonesClustersUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsZonesClustersUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateclusterrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "zone": c.zone, + "clusterId": c.clusterId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "container.projects.zones.clusters.update" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsZonesClustersUpdateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update settings of a specific cluster.", + // "httpMethod": "PUT", + // "id": "container.projects.zones.clusters.update", + // "parameterOrder": [ + // "projectId", + // "zone", + // "clusterId" + // ], + // "parameters": { + // "clusterId": { + // "description": "The name of the cluster to upgrade.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}", + // "request": { + // "$ref": "UpdateClusterRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "container.projects.zones.operations.get": + +type ProjectsZonesOperationsGetCall struct { + s *Service + projectId string + zone string + operationId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the specified operation. +func (r *ProjectsZonesOperationsService) Get(projectId string, zone string, operationId string) *ProjectsZonesOperationsGetCall { + c := &ProjectsZonesOperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.zone = zone + c.operationId = operationId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsZonesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsZonesOperationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsZonesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsZonesOperationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsZonesOperationsGetCall) Context(ctx context.Context) *ProjectsZonesOperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsZonesOperationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/operations/{operationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "zone": c.zone, + "operationId": c.operationId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "container.projects.zones.operations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsZonesOperationsGetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the specified operation.", + // "httpMethod": "GET", + // "id": "container.projects.zones.operations.get", + // "parameterOrder": [ + // "projectId", + // "zone", + // "operationId" + // ], + // "parameters": { + // "operationId": { + // "description": "The server-assigned `name` of the operation.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/projects/{projectId}/zones/{zone}/operations/{operationId}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "container.projects.zones.operations.list": + +type ProjectsZonesOperationsListCall struct { + s *Service + projectId string + zone string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all operations in a project in a specific zone or all +// zones. +func (r *ProjectsZonesOperationsService) List(projectId string, zone string) *ProjectsZonesOperationsListCall { + c := &ProjectsZonesOperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.zone = zone + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsZonesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsZonesOperationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsZonesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsZonesOperationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsZonesOperationsListCall) Context(ctx context.Context) *ProjectsZonesOperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsZonesOperationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "container.projects.zones.operations.list" call. +// Exactly one of *ListOperationsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListOperationsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsZonesOperationsListCall) Do() (*ListOperationsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListOperationsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all operations in a project in a specific zone or all zones.", + // "httpMethod": "GET", + // "id": "container.projects.zones.operations.list", + // "parameterOrder": [ + // "projectId", + // "zone" + // ], + // "parameters": { + // "projectId": { + // "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or \"-\" for all zones.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/projects/{projectId}/zones/{zone}/operations", + // "response": { + // "$ref": "ListOperationsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/container/v1beta1/container-api.json b/Godeps/_workspace/src/google.golang.org/api/container/v1beta1/container-api.json new file mode 100644 index 000000000..22cc348a3 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/container/v1beta1/container-api.json @@ -0,0 +1,644 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/hfLmCQ4Ut9jPERvGmAwjUd46Fc8\"", + "discoveryVersion": "v1", + "id": "container:v1beta1", + "name": "container", + "version": "v1beta1", + "revision": "20150728", + "title": "Google Container Engine API", + "description": "The Google Container Engine API is used for building and managing container based applications, powered by the open source Kubernetes technology.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/container-engine/docs/v1beta1/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/container/v1beta1/projects/", + "basePath": "/container/v1beta1/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "container/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" + } + } + } + }, + "schemas": { + "Cluster": { + "id": "Cluster", + "type": "object", + "properties": { + "clusterApiVersion": { + "type": "string", + "description": "The API version of the Kubernetes master and kubelets running in this cluster. Leave blank to pick up the latest stable release, or specify a version of the form \"x.y.z\". The Google Container Engine release notes lists the currently supported versions. If an incorrect version is specified, the server returns an error listing the currently supported versions." + }, + "containerIpv4Cidr": { + "type": "string", + "description": "The IP address range of the container pods in this cluster, in CIDR notation (e.g. 10.96.0.0/14). Leave blank to have one automatically chosen or specify a /14 block in 10.0.0.0/8." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output only] The time the cluster was created, in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional description of this cluster." + }, + "enableCloudLogging": { + "type": "boolean", + "description": "Whether logs from the cluster should be made available via the Google Cloud Logging service. This includes both logs from your applications running in the cluster as well as logs from the Kubernetes components themselves." + }, + "enableCloudMonitoring": { + "type": "boolean", + "description": "Whether metrics from the cluster should be made available via the Google Cloud Monitoring service." + }, + "endpoint": { + "type": "string", + "description": "[Output only] The IP address of this cluster's Kubernetes master. The endpoint can be accessed from the internet at https://username:password@endpoint/.\n\nSee the masterAuth property of this resource for username and password information." + }, + "instanceGroupUrls": { + "type": "array", + "description": "[Output only] The resource URLs of [instance groups](/compute/docs/instance-groups/) associated with this cluster.", + "items": { + "type": "string" + } + }, + "masterAuth": { + "$ref": "MasterAuth", + "description": "The authentication information for accessing the master." + }, + "name": { + "type": "string", + "description": "The name of this cluster. The name must be unique within this project and zone, and can be up to 40 characters with the following restrictions: \n- Lowercase letters, numbers, and hyphens only.\n- Must start with a letter.\n- Must end with a number or a letter." + }, + "network": { + "type": "string", + "description": "The name of the Google Compute Engine network to which the cluster is connected." + }, + "nodeConfig": { + "$ref": "NodeConfig", + "description": "The machine type and image to use for all nodes in this cluster. See the descriptions of the child properties of nodeConfig." + }, + "nodeRoutingPrefixSize": { + "type": "integer", + "description": "[Output only] The size of the address space on each node for hosting containers.", + "format": "int32" + }, + "numNodes": { + "type": "integer", + "description": "The number of nodes to create in this cluster. You must ensure that your Compute Engine resource quota is sufficient for this number of instances plus one (to include the master). You must also have available firewall and routes quota.", + "format": "int32" + }, + "selfLink": { + "type": "string", + "description": "[Output only] Server-defined URL for the resource." + }, + "servicesIpv4Cidr": { + "type": "string", + "description": "[Output only] The IP address range of the Kubernetes services in this cluster, in CIDR notation (e.g. 1.2.3.4/29). Service addresses are typically put in the last /16 from the container CIDR." + }, + "status": { + "type": "string", + "description": "[Output only] The current status of this cluster.", + "enum": [ + "error", + "provisioning", + "running", + "stopping" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "statusMessage": { + "type": "string", + "description": "[Output only] Additional information about the current status of this cluster, if available." + }, + "zone": { + "type": "string", + "description": "[Output only] The name of the Google Compute Engine zone in which the cluster resides." + } + } + }, + "CreateClusterRequest": { + "id": "CreateClusterRequest", + "type": "object", + "properties": { + "cluster": { + "$ref": "Cluster", + "description": "A cluster resource." + } + } + }, + "ListAggregatedClustersResponse": { + "id": "ListAggregatedClustersResponse", + "type": "object", + "properties": { + "clusters": { + "type": "array", + "description": "A list of clusters in the project, across all zones.", + "items": { + "$ref": "Cluster" + } + } + } + }, + "ListAggregatedOperationsResponse": { + "id": "ListAggregatedOperationsResponse", + "type": "object", + "properties": { + "operations": { + "type": "array", + "description": "A list of operations in the project, across all zones.", + "items": { + "$ref": "Operation" + } + } + } + }, + "ListClustersResponse": { + "id": "ListClustersResponse", + "type": "object", + "properties": { + "clusters": { + "type": "array", + "description": "A list of clusters in the project in the specified zone.", + "items": { + "$ref": "Cluster" + } + } + } + }, + "ListOperationsResponse": { + "id": "ListOperationsResponse", + "type": "object", + "properties": { + "operations": { + "type": "array", + "description": "A list of operations in the project in the specified zone.", + "items": { + "$ref": "Operation" + } + } + } + }, + "MasterAuth": { + "id": "MasterAuth", + "type": "object", + "description": "The authentication information for accessing the master. Authentication is either done using HTTP basic authentication or using a bearer token.", + "properties": { + "bearerToken": { + "type": "string", + "description": "The token used to authenticate API requests to the master. The token is to be included in an HTTP Authorization Header in all requests to the master endpoint. The format of the header is: \"Authorization: Bearer \"." + }, + "clientCertificate": { + "type": "string", + "description": "[Output only] Base64 encoded public certificate used by clients to authenticate to the cluster endpoint." + }, + "clientKey": { + "type": "string", + "description": "[Output only] Base64 encoded private key used by clients to authenticate to the cluster endpoint." + }, + "clusterCaCertificate": { + "type": "string", + "description": "[Output only] Base64 encoded public certificate that is the root of trust for the cluster." + }, + "password": { + "type": "string", + "description": "The password to use for HTTP basic authentication when accessing the Kubernetes master endpoint. Because the master endpoint is open to the internet, you should create a strong password." + }, + "user": { + "type": "string", + "description": "The username to use for HTTP basic authentication when accessing the Kubernetes master endpoint." + } + } + }, + "NodeConfig": { + "id": "NodeConfig", + "type": "object", + "properties": { + "machineType": { + "type": "string", + "description": "The name of a Google Compute Engine machine type (e.g. n1-standard-1).\n\nIf unspecified, the default machine type is n1-standard-1." + }, + "serviceAccounts": { + "type": "array", + "description": "The optional list of ServiceAccounts, each with their specified scopes, to be made available on all of the node VMs. In addition to the service accounts and scopes specified, the \"default\" account will always be created with the following scopes to ensure the correct functioning of the cluster: \n- https://www.googleapis.com/auth/compute,\n- https://www.googleapis.com/auth/devstorage.read_only", + "items": { + "$ref": "ServiceAccount" + } + }, + "sourceImage": { + "type": "string", + "description": "The fully-specified name of a Google Compute Engine image. For example: https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/backports-debian-7-wheezy-vYYYYMMDD (where YYYMMDD is the version date).\n\nIf specifying an image, you are responsible for ensuring its compatibility with the Debian 7 backports image. We recommend leaving this field blank to accept the default backports-debian-7-wheezy value." + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "description": "Defines the operation resource. All fields are output only.", + "properties": { + "errorMessage": { + "type": "string", + "description": "If an error has occurred, a textual description of the error." + }, + "name": { + "type": "string", + "description": "The server-assigned ID for the operation." + }, + "operationType": { + "type": "string", + "description": "The operation type.", + "enum": [ + "createCluster", + "deleteCluster" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "selfLink": { + "type": "string", + "description": "Server-defined URL for the resource." + }, + "status": { + "type": "string", + "description": "The current status of the operation.", + "enum": [ + "done", + "pending", + "running" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "target": { + "type": "string", + "description": "[Optional] The URL of the cluster resource that this operation is associated with." + }, + "targetLink": { + "type": "string", + "description": "Server-defined URL for the target of the operation." + }, + "zone": { + "type": "string", + "description": "The name of the Google Compute Engine zone in which the operation is taking place." + } + } + }, + "ServiceAccount": { + "id": "ServiceAccount", + "type": "object", + "description": "A Compute Engine 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" + } + } + } + } + }, + "resources": { + "projects": { + "resources": { + "clusters": { + "methods": { + "list": { + "id": "container.projects.clusters.list", + "path": "{projectId}/clusters", + "httpMethod": "GET", + "description": "Lists all clusters owned by a project across all zones.", + "parameters": { + "projectId": { + "type": "string", + "description": "The Google Developers Console project ID or project number.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "ListAggregatedClustersResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "operations": { + "methods": { + "list": { + "id": "container.projects.operations.list", + "path": "{projectId}/operations", + "httpMethod": "GET", + "description": "Lists all operations in a project, across all zones.", + "parameters": { + "projectId": { + "type": "string", + "description": "The Google Developers Console project ID or project number.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "ListAggregatedOperationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "zones": { + "resources": { + "clusters": { + "methods": { + "create": { + "id": "container.projects.zones.clusters.create", + "path": "{projectId}/zones/{zoneId}/clusters", + "httpMethod": "POST", + "description": "Creates a cluster, consisting of the specified number and type of Google Compute Engine instances, plus a Kubernetes master instance.\n\nThe cluster is created in the project's default network.\n\nA firewall is added that allows traffic into port 443 on the master, which enables HTTPS. A firewall and a route is added for each node to allow the containers on that node to communicate with all other instances in the cluster.\n\nFinally, an entry is added to the project's global metadata indicating which CIDR range is being used by the cluster.", + "parameters": { + "projectId": { + "type": "string", + "description": "The Google Developers Console project ID or project number.", + "required": true, + "location": "path" + }, + "zoneId": { + "type": "string", + "description": "The name of the Google Compute Engine zone in which the cluster resides.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "zoneId" + ], + "request": { + "$ref": "CreateClusterRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "id": "container.projects.zones.clusters.delete", + "path": "{projectId}/zones/{zoneId}/clusters/{clusterId}", + "httpMethod": "DELETE", + "description": "Deletes the cluster, including the Kubernetes master and all worker nodes.\n\nFirewalls and routes that were configured at cluster creation are also deleted.", + "parameters": { + "clusterId": { + "type": "string", + "description": "The name of the cluster to delete.", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "description": "The Google Developers Console project ID or project number.", + "required": true, + "location": "path" + }, + "zoneId": { + "type": "string", + "description": "The name of the Google Compute Engine zone in which the cluster resides.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "zoneId", + "clusterId" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "id": "container.projects.zones.clusters.get", + "path": "{projectId}/zones/{zoneId}/clusters/{clusterId}", + "httpMethod": "GET", + "description": "Gets a specific cluster.", + "parameters": { + "clusterId": { + "type": "string", + "description": "The name of the cluster to retrieve.", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "description": "The Google Developers Console project ID or project number.", + "required": true, + "location": "path" + }, + "zoneId": { + "type": "string", + "description": "The name of the Google Compute Engine zone in which the cluster resides.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "zoneId", + "clusterId" + ], + "response": { + "$ref": "Cluster" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "id": "container.projects.zones.clusters.list", + "path": "{projectId}/zones/{zoneId}/clusters", + "httpMethod": "GET", + "description": "Lists all clusters owned by a project in the specified zone.", + "parameters": { + "projectId": { + "type": "string", + "description": "The Google Developers Console project ID or project number.", + "required": true, + "location": "path" + }, + "zoneId": { + "type": "string", + "description": "The name of the Google Compute Engine zone in which the cluster resides.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "zoneId" + ], + "response": { + "$ref": "ListClustersResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "operations": { + "methods": { + "get": { + "id": "container.projects.zones.operations.get", + "path": "{projectId}/zones/{zoneId}/operations/{operationId}", + "httpMethod": "GET", + "description": "Gets the specified operation.", + "parameters": { + "operationId": { + "type": "string", + "description": "The server-assigned name of the operation.", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "description": "The Google Developers Console project ID or project number.", + "required": true, + "location": "path" + }, + "zoneId": { + "type": "string", + "description": "The name of the Google Compute Engine zone in which the operation resides. This is always the same zone as the cluster with which the operation is associated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "zoneId", + "operationId" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "id": "container.projects.zones.operations.list", + "path": "{projectId}/zones/{zoneId}/operations", + "httpMethod": "GET", + "description": "Lists all operations in a project in a specific zone.", + "parameters": { + "projectId": { + "type": "string", + "description": "The Google Developers Console project ID or project number.", + "required": true, + "location": "path" + }, + "zoneId": { + "type": "string", + "description": "The name of the Google Compute Engine zone to return operations for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "zoneId" + ], + "response": { + "$ref": "ListOperationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/container/v1beta1/container-gen.go b/Godeps/_workspace/src/google.golang.org/api/container/v1beta1/container-gen.go new file mode 100644 index 000000000..78e9a3c61 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/container/v1beta1/container-gen.go @@ -0,0 +1,1369 @@ +// Package container provides access to the Google Container Engine API. +// +// See https://cloud.google.com/container-engine/docs/v1beta1/ +// +// Usage example: +// +// import "google.golang.org/api/container/v1beta1" +// ... +// containerService, err := container.New(oauthHttpClient) +package container + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace + +const apiId = "container:v1beta1" +const apiName = "container" +const apiVersion = "v1beta1" +const basePath = "https://www.googleapis.com/container/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" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Projects *ProjectsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewProjectsService(s *Service) *ProjectsService { + rs := &ProjectsService{s: s} + rs.Clusters = NewProjectsClustersService(s) + rs.Operations = NewProjectsOperationsService(s) + rs.Zones = NewProjectsZonesService(s) + return rs +} + +type ProjectsService struct { + s *Service + + Clusters *ProjectsClustersService + + Operations *ProjectsOperationsService + + Zones *ProjectsZonesService +} + +func NewProjectsClustersService(s *Service) *ProjectsClustersService { + rs := &ProjectsClustersService{s: s} + return rs +} + +type ProjectsClustersService struct { + s *Service +} + +func NewProjectsOperationsService(s *Service) *ProjectsOperationsService { + rs := &ProjectsOperationsService{s: s} + return rs +} + +type ProjectsOperationsService struct { + s *Service +} + +func NewProjectsZonesService(s *Service) *ProjectsZonesService { + rs := &ProjectsZonesService{s: s} + rs.Clusters = NewProjectsZonesClustersService(s) + rs.Operations = NewProjectsZonesOperationsService(s) + return rs +} + +type ProjectsZonesService struct { + s *Service + + Clusters *ProjectsZonesClustersService + + Operations *ProjectsZonesOperationsService +} + +func NewProjectsZonesClustersService(s *Service) *ProjectsZonesClustersService { + rs := &ProjectsZonesClustersService{s: s} + return rs +} + +type ProjectsZonesClustersService struct { + s *Service +} + +func NewProjectsZonesOperationsService(s *Service) *ProjectsZonesOperationsService { + rs := &ProjectsZonesOperationsService{s: s} + return rs +} + +type ProjectsZonesOperationsService struct { + s *Service +} + +type Cluster struct { + // ClusterApiVersion: The API version of the Kubernetes master and + // kubelets running in this cluster. Leave blank to pick up the latest + // stable release, or specify a version of the form "x.y.z". The Google + // Container Engine release notes lists the currently supported + // versions. If an incorrect version is specified, the server returns an + // error listing the currently supported versions. + ClusterApiVersion string `json:"clusterApiVersion,omitempty"` + + // ContainerIpv4Cidr: The IP address range of the container pods in this + // cluster, in CIDR notation (e.g. 10.96.0.0/14). Leave blank to have + // one automatically chosen or specify a /14 block in 10.0.0.0/8. + ContainerIpv4Cidr string `json:"containerIpv4Cidr,omitempty"` + + // CreationTimestamp: [Output only] The time the cluster was created, in + // RFC3339 text format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional description of this cluster. + Description string `json:"description,omitempty"` + + // EnableCloudLogging: Whether logs from the cluster should be made + // available via the Google Cloud Logging service. This includes both + // logs from your applications running in the cluster as well as logs + // from the Kubernetes components themselves. + EnableCloudLogging bool `json:"enableCloudLogging,omitempty"` + + // EnableCloudMonitoring: Whether metrics from the cluster should be + // made available via the Google Cloud Monitoring service. + EnableCloudMonitoring bool `json:"enableCloudMonitoring,omitempty"` + + // Endpoint: [Output only] The IP address of this cluster's Kubernetes + // master. The endpoint can be accessed from the internet at + // https://username:password@endpoint/. + // + // See the masterAuth property of this resource for username and + // password information. + Endpoint string `json:"endpoint,omitempty"` + + // InstanceGroupUrls: [Output only] The resource URLs of [instance + // groups](/compute/docs/instance-groups/) associated with this cluster. + InstanceGroupUrls []string `json:"instanceGroupUrls,omitempty"` + + // MasterAuth: The authentication information for accessing the master. + MasterAuth *MasterAuth `json:"masterAuth,omitempty"` + + // Name: The name of this cluster. The name must be unique within this + // project and zone, and can be up to 40 characters with the following + // restrictions: + // - Lowercase letters, numbers, and hyphens only. + // - Must start with a letter. + // - Must end with a number or a letter. + Name string `json:"name,omitempty"` + + // Network: The name of the Google Compute Engine network to which the + // cluster is connected. + Network string `json:"network,omitempty"` + + // NodeConfig: The machine type and image to use for all nodes in this + // cluster. See the descriptions of the child properties of nodeConfig. + NodeConfig *NodeConfig `json:"nodeConfig,omitempty"` + + // NodeRoutingPrefixSize: [Output only] The size of the address space on + // each node for hosting containers. + NodeRoutingPrefixSize int64 `json:"nodeRoutingPrefixSize,omitempty"` + + // NumNodes: The number of nodes to create in this cluster. You must + // ensure that your Compute Engine resource quota is sufficient for this + // number of instances plus one (to include the master). You must also + // have available firewall and routes quota. + NumNodes int64 `json:"numNodes,omitempty"` + + // SelfLink: [Output only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServicesIpv4Cidr: [Output only] The IP address range of the + // Kubernetes services in this cluster, in CIDR notation (e.g. + // 1.2.3.4/29). Service addresses are typically put in the last /16 from + // the container CIDR. + ServicesIpv4Cidr string `json:"servicesIpv4Cidr,omitempty"` + + // Status: [Output only] The current status of this cluster. + // + // Possible values: + // "error" + // "provisioning" + // "running" + // "stopping" + Status string `json:"status,omitempty"` + + // StatusMessage: [Output only] Additional information about the current + // status of this cluster, if available. + StatusMessage string `json:"statusMessage,omitempty"` + + // Zone: [Output only] The name of the Google Compute Engine zone in + // which the cluster resides. + Zone string `json:"zone,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ClusterApiVersion") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Cluster) MarshalJSON() ([]byte, error) { + type noMethod Cluster + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type CreateClusterRequest struct { + // Cluster: A cluster resource. + Cluster *Cluster `json:"cluster,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Cluster") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreateClusterRequest) MarshalJSON() ([]byte, error) { + type noMethod CreateClusterRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ListAggregatedClustersResponse struct { + // Clusters: A list of clusters in the project, across all zones. + Clusters []*Cluster `json:"clusters,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Clusters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListAggregatedClustersResponse) MarshalJSON() ([]byte, error) { + type noMethod ListAggregatedClustersResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ListAggregatedOperationsResponse struct { + // Operations: A list of operations in the project, across all zones. + Operations []*Operation `json:"operations,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Operations") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListAggregatedOperationsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListAggregatedOperationsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ListClustersResponse struct { + // Clusters: A list of clusters in the project in the specified zone. + Clusters []*Cluster `json:"clusters,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Clusters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListClustersResponse) MarshalJSON() ([]byte, error) { + type noMethod ListClustersResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ListOperationsResponse struct { + // Operations: A list of operations in the project in the specified + // zone. + Operations []*Operation `json:"operations,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Operations") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListOperationsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MasterAuth: The authentication information for accessing the master. +// Authentication is either done using HTTP basic authentication or +// using a bearer token. +type MasterAuth struct { + // BearerToken: The token used to authenticate API requests to the + // master. The token is to be included in an HTTP Authorization Header + // in all requests to the master endpoint. The format of the header is: + // "Authorization: Bearer ". + BearerToken string `json:"bearerToken,omitempty"` + + // ClientCertificate: [Output only] Base64 encoded public certificate + // used by clients to authenticate to the cluster endpoint. + ClientCertificate string `json:"clientCertificate,omitempty"` + + // ClientKey: [Output only] Base64 encoded private key used by clients + // to authenticate to the cluster endpoint. + ClientKey string `json:"clientKey,omitempty"` + + // ClusterCaCertificate: [Output only] Base64 encoded public certificate + // that is the root of trust for the cluster. + ClusterCaCertificate string `json:"clusterCaCertificate,omitempty"` + + // Password: The password to use for HTTP basic authentication when + // accessing the Kubernetes master endpoint. Because the master endpoint + // is open to the internet, you should create a strong password. + Password string `json:"password,omitempty"` + + // User: The username to use for HTTP basic authentication when + // accessing the Kubernetes master endpoint. + User string `json:"user,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BearerToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MasterAuth) MarshalJSON() ([]byte, error) { + type noMethod MasterAuth + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type NodeConfig struct { + // MachineType: The name of a Google Compute Engine machine type (e.g. + // n1-standard-1). + // + // If unspecified, the default machine type is n1-standard-1. + MachineType string `json:"machineType,omitempty"` + + // ServiceAccounts: The optional list of ServiceAccounts, each with + // their specified scopes, to be made available on all of the node VMs. + // In addition to the service accounts and scopes specified, the + // "default" account will always be created with the following scopes to + // ensure the correct functioning of the cluster: + // - https://www.googleapis.com/auth/compute, + // - https://www.googleapis.com/auth/devstorage.read_only + ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"` + + // SourceImage: The fully-specified name of a Google Compute Engine + // image. For example: + // https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/backports-debian-7-wheezy-vYYYYMMDD (where YYYMMDD is the version date). + // + // If specifying an image, you are responsible for ensuring its + // compatibility with the Debian 7 backports image. We recommend leaving + // this field blank to accept the default backports-debian-7-wheezy + // value. + SourceImage string `json:"sourceImage,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MachineType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *NodeConfig) MarshalJSON() ([]byte, error) { + type noMethod NodeConfig + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Operation: Defines the operation resource. All fields are output +// only. +type Operation struct { + // ErrorMessage: If an error has occurred, a textual description of the + // error. + ErrorMessage string `json:"errorMessage,omitempty"` + + // Name: The server-assigned ID for the operation. + Name string `json:"name,omitempty"` + + // OperationType: The operation type. + // + // Possible values: + // "createCluster" + // "deleteCluster" + OperationType string `json:"operationType,omitempty"` + + // SelfLink: Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // Status: The current status of the operation. + // + // Possible values: + // "done" + // "pending" + // "running" + Status string `json:"status,omitempty"` + + // Target: [Optional] The URL of the cluster resource that this + // operation is associated with. + Target string `json:"target,omitempty"` + + // TargetLink: Server-defined URL for the target of the operation. + TargetLink string `json:"targetLink,omitempty"` + + // Zone: The name of the Google Compute Engine zone in which the + // operation is taking place. + Zone string `json:"zone,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ErrorMessage") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Operation) MarshalJSON() ([]byte, error) { + type noMethod Operation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ServiceAccount: A Compute Engine service account. +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"` + + // ForceSendFields is a list of field names (e.g. "Email") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ServiceAccount) MarshalJSON() ([]byte, error) { + type noMethod ServiceAccount + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "container.projects.clusters.list": + +type ProjectsClustersListCall struct { + s *Service + projectId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all clusters owned by a project across all zones. +func (r *ProjectsClustersService) List(projectId string) *ProjectsClustersListCall { + c := &ProjectsClustersListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsClustersListCall) Fields(s ...googleapi.Field) *ProjectsClustersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsClustersListCall) Context(ctx context.Context) *ProjectsClustersListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsClustersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectId}/clusters") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +func (c *ProjectsClustersListCall) Do() (*ListAggregatedClustersResponse, error) { + res, err := c.doRequest("json") + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *ListAggregatedClustersResponse + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all clusters owned by a project across all zones.", + // "httpMethod": "GET", + // "id": "container.projects.clusters.list", + // "parameterOrder": [ + // "projectId" + // ], + // "parameters": { + // "projectId": { + // "description": "The Google Developers Console project ID or project number.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectId}/clusters", + // "response": { + // "$ref": "ListAggregatedClustersResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "container.projects.operations.list": + +type ProjectsOperationsListCall struct { + s *Service + projectId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all operations in a project, across all zones. +func (r *ProjectsOperationsService) List(projectId string) *ProjectsOperationsListCall { + c := &ProjectsOperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsOperationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsOperationsListCall) Context(ctx context.Context) *ProjectsOperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsOperationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectId}/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +func (c *ProjectsOperationsListCall) Do() (*ListAggregatedOperationsResponse, error) { + res, err := c.doRequest("json") + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *ListAggregatedOperationsResponse + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all operations in a project, across all zones.", + // "httpMethod": "GET", + // "id": "container.projects.operations.list", + // "parameterOrder": [ + // "projectId" + // ], + // "parameters": { + // "projectId": { + // "description": "The Google Developers Console project ID or project number.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectId}/operations", + // "response": { + // "$ref": "ListAggregatedOperationsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "container.projects.zones.clusters.create": + +type ProjectsZonesClustersCreateCall struct { + s *Service + projectId string + zoneId string + createclusterrequest *CreateClusterRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a cluster, consisting of the specified number and +// type of Google Compute Engine instances, plus a Kubernetes master +// instance. +// +// The cluster is created in the project's default network. +// +// A firewall is added that allows traffic into port 443 on the master, +// which enables HTTPS. A firewall and a route is added for each node to +// allow the containers on that node to communicate with all other +// instances in the cluster. +// +// Finally, an entry is added to the project's global metadata +// indicating which CIDR range is being used by the cluster. +func (r *ProjectsZonesClustersService) Create(projectId string, zoneId string, createclusterrequest *CreateClusterRequest) *ProjectsZonesClustersCreateCall { + c := &ProjectsZonesClustersCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.zoneId = zoneId + c.createclusterrequest = createclusterrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsZonesClustersCreateCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsZonesClustersCreateCall) Context(ctx context.Context) *ProjectsZonesClustersCreateCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsZonesClustersCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.createclusterrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectId}/zones/{zoneId}/clusters") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "zoneId": c.zoneId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +func (c *ProjectsZonesClustersCreateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a cluster, consisting of the specified number and type of Google Compute Engine instances, plus a Kubernetes master instance.\n\nThe cluster is created in the project's default network.\n\nA firewall is added that allows traffic into port 443 on the master, which enables HTTPS. A firewall and a route is added for each node to allow the containers on that node to communicate with all other instances in the cluster.\n\nFinally, an entry is added to the project's global metadata indicating which CIDR range is being used by the cluster.", + // "httpMethod": "POST", + // "id": "container.projects.zones.clusters.create", + // "parameterOrder": [ + // "projectId", + // "zoneId" + // ], + // "parameters": { + // "projectId": { + // "description": "The Google Developers Console project ID or project number.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zoneId": { + // "description": "The name of the Google Compute Engine zone in which the cluster resides.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectId}/zones/{zoneId}/clusters", + // "request": { + // "$ref": "CreateClusterRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "container.projects.zones.clusters.delete": + +type ProjectsZonesClustersDeleteCall struct { + s *Service + projectId string + zoneId string + clusterId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the cluster, including the Kubernetes master and all +// worker nodes. +// +// Firewalls and routes that were configured at cluster creation are +// also deleted. +func (r *ProjectsZonesClustersService) Delete(projectId string, zoneId string, clusterId string) *ProjectsZonesClustersDeleteCall { + c := &ProjectsZonesClustersDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.zoneId = zoneId + c.clusterId = clusterId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsZonesClustersDeleteCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsZonesClustersDeleteCall) Context(ctx context.Context) *ProjectsZonesClustersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsZonesClustersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectId}/zones/{zoneId}/clusters/{clusterId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "zoneId": c.zoneId, + "clusterId": c.clusterId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +func (c *ProjectsZonesClustersDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the cluster, including the Kubernetes master and all worker nodes.\n\nFirewalls and routes that were configured at cluster creation are also deleted.", + // "httpMethod": "DELETE", + // "id": "container.projects.zones.clusters.delete", + // "parameterOrder": [ + // "projectId", + // "zoneId", + // "clusterId" + // ], + // "parameters": { + // "clusterId": { + // "description": "The name of the cluster to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "The Google Developers Console project ID or project number.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zoneId": { + // "description": "The name of the Google Compute Engine zone in which the cluster resides.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectId}/zones/{zoneId}/clusters/{clusterId}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "container.projects.zones.clusters.get": + +type ProjectsZonesClustersGetCall struct { + s *Service + projectId string + zoneId string + clusterId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a specific cluster. +func (r *ProjectsZonesClustersService) Get(projectId string, zoneId string, clusterId string) *ProjectsZonesClustersGetCall { + c := &ProjectsZonesClustersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.zoneId = zoneId + c.clusterId = clusterId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsZonesClustersGetCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsZonesClustersGetCall) Context(ctx context.Context) *ProjectsZonesClustersGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsZonesClustersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectId}/zones/{zoneId}/clusters/{clusterId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "zoneId": c.zoneId, + "clusterId": c.clusterId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +func (c *ProjectsZonesClustersGetCall) Do() (*Cluster, error) { + res, err := c.doRequest("json") + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Cluster + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a specific cluster.", + // "httpMethod": "GET", + // "id": "container.projects.zones.clusters.get", + // "parameterOrder": [ + // "projectId", + // "zoneId", + // "clusterId" + // ], + // "parameters": { + // "clusterId": { + // "description": "The name of the cluster to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "The Google Developers Console project ID or project number.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zoneId": { + // "description": "The name of the Google Compute Engine zone in which the cluster resides.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectId}/zones/{zoneId}/clusters/{clusterId}", + // "response": { + // "$ref": "Cluster" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "container.projects.zones.clusters.list": + +type ProjectsZonesClustersListCall struct { + s *Service + projectId string + zoneId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all clusters owned by a project in the specified zone. +func (r *ProjectsZonesClustersService) List(projectId string, zoneId string) *ProjectsZonesClustersListCall { + c := &ProjectsZonesClustersListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.zoneId = zoneId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsZonesClustersListCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsZonesClustersListCall) Context(ctx context.Context) *ProjectsZonesClustersListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsZonesClustersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectId}/zones/{zoneId}/clusters") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "zoneId": c.zoneId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +func (c *ProjectsZonesClustersListCall) Do() (*ListClustersResponse, error) { + res, err := c.doRequest("json") + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *ListClustersResponse + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all clusters owned by a project in the specified zone.", + // "httpMethod": "GET", + // "id": "container.projects.zones.clusters.list", + // "parameterOrder": [ + // "projectId", + // "zoneId" + // ], + // "parameters": { + // "projectId": { + // "description": "The Google Developers Console project ID or project number.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zoneId": { + // "description": "The name of the Google Compute Engine zone in which the cluster resides.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectId}/zones/{zoneId}/clusters", + // "response": { + // "$ref": "ListClustersResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "container.projects.zones.operations.get": + +type ProjectsZonesOperationsGetCall struct { + s *Service + projectId string + zoneId string + operationId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the specified operation. +func (r *ProjectsZonesOperationsService) Get(projectId string, zoneId string, operationId string) *ProjectsZonesOperationsGetCall { + c := &ProjectsZonesOperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.zoneId = zoneId + c.operationId = operationId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsZonesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsZonesOperationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsZonesOperationsGetCall) Context(ctx context.Context) *ProjectsZonesOperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsZonesOperationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectId}/zones/{zoneId}/operations/{operationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "zoneId": c.zoneId, + "operationId": c.operationId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +func (c *ProjectsZonesOperationsGetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *Operation + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the specified operation.", + // "httpMethod": "GET", + // "id": "container.projects.zones.operations.get", + // "parameterOrder": [ + // "projectId", + // "zoneId", + // "operationId" + // ], + // "parameters": { + // "operationId": { + // "description": "The server-assigned name of the operation.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "The Google Developers Console project ID or project number.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zoneId": { + // "description": "The name of the Google Compute Engine zone in which the operation resides. This is always the same zone as the cluster with which the operation is associated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectId}/zones/{zoneId}/operations/{operationId}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "container.projects.zones.operations.list": + +type ProjectsZonesOperationsListCall struct { + s *Service + projectId string + zoneId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all operations in a project in a specific zone. +func (r *ProjectsZonesOperationsService) List(projectId string, zoneId string) *ProjectsZonesOperationsListCall { + c := &ProjectsZonesOperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.zoneId = zoneId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsZonesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsZonesOperationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsZonesOperationsListCall) Context(ctx context.Context) *ProjectsZonesOperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsZonesOperationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectId}/zones/{zoneId}/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "zoneId": c.zoneId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +func (c *ProjectsZonesOperationsListCall) Do() (*ListOperationsResponse, error) { + res, err := c.doRequest("json") + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret *ListOperationsResponse + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all operations in a project in a specific zone.", + // "httpMethod": "GET", + // "id": "container.projects.zones.operations.list", + // "parameterOrder": [ + // "projectId", + // "zoneId" + // ], + // "parameters": { + // "projectId": { + // "description": "The Google Developers Console project ID or project number.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zoneId": { + // "description": "The name of the Google Compute Engine zone to return operations for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectId}/zones/{zoneId}/operations", + // "response": { + // "$ref": "ListOperationsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/content/v2/content-api.json b/Godeps/_workspace/src/google.golang.org/api/content/v2/content-api.json new file mode 100644 index 000000000..04bbac225 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/content/v2/content-api.json @@ -0,0 +1,6047 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/qCLRcKBvpHXy_56JLKWSx1mf1Qs\"", + "discoveryVersion": "v1", + "id": "content:v2", + "name": "content", + "canonicalName": "Shopping Content", + "version": "v2", + "revision": "20150915", + "title": "Content API for Shopping", + "description": "Manage product items, inventory, and Merchant Center accounts for Google Shopping.", + "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-content", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/content/v2/", + "basePath": "/content/v2/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "content/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/content": { + "description": "Manage your product listings and accounts for Google Shopping" + } + } + } + }, + "schemas": { + "Account": { + "id": "Account", + "type": "object", + "description": "Account data.", + "properties": { + "adultContent": { + "type": "boolean", + "description": "Indicates whether the merchant sells adult content." + }, + "adwordsLinks": { + "type": "array", + "description": "List of linked AdWords accounts, active or pending approval. To create a new link request, add a new link with status active to the list. It will remain is state pending until approved or rejected in the AdWords interface. To delete an active link or to cancel a link request, remove it from the list.", + "items": { + "$ref": "AccountAdwordsLink" + } + }, + "id": { + "type": "string", + "description": "Merchant Center account ID.", + "format": "uint64", + "annotations": { + "required": [ + "content.accounts.update" + ] + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#account\".", + "default": "content#account" + }, + "name": { + "type": "string", + "description": "Display name for the account.", + "annotations": { + "required": [ + "content.accounts.insert", + "content.accounts.update" + ] + } + }, + "reviewsUrl": { + "type": "string", + "description": "URL for individual seller reviews, i.e., reviews for each child account." + }, + "sellerId": { + "type": "string", + "description": "Client-specific, locally-unique, internal ID for the child account." + }, + "users": { + "type": "array", + "description": "Users with access to the account. Every account (except for subaccounts) must have at least one admin user.", + "items": { + "$ref": "AccountUser" + } + }, + "websiteUrl": { + "type": "string", + "description": "The merchant's website." + } + } + }, + "AccountAdwordsLink": { + "id": "AccountAdwordsLink", + "type": "object", + "properties": { + "adwordsId": { + "type": "string", + "description": "Customer ID of the AdWords account.", + "format": "uint64" + }, + "status": { + "type": "string", + "description": "Status of the link between this Merchant Center account and the AdWords account. Upon retrieval, it represents the actual status of the link and can be either active if it was approved in Google AdWords or pending if it's pending approval. Upon insertion, it represents the intended status of the link. Re-uploading a link with status active when it's still pending or with status pending when it's already active will have no effect: the status will remain unchanged. Re-uploading a link with deprecated status inactive is equivalent to not submitting the link at all and will delete the link if it was active or cancel the link request if it was pending." + } + } + }, + "AccountIdentifier": { + "id": "AccountIdentifier", + "type": "object", + "properties": { + "aggregatorId": { + "type": "string", + "description": "The aggregator ID, set for aggregators and subaccounts (in that case, it represents the aggregator of the subaccount).", + "format": "uint64" + }, + "merchantId": { + "type": "string", + "description": "The merchant account ID, set for individual accounts and subaccounts.", + "format": "uint64" + } + } + }, + "AccountShipping": { + "id": "AccountShipping", + "type": "object", + "description": "The shipping settings of a merchant account.", + "properties": { + "accountId": { + "type": "string", + "description": "The ID of the account to which these account shipping settings belong.", + "format": "uint64", + "annotations": { + "required": [ + "content.accountshipping.update" + ] + } + }, + "carrierRates": { + "type": "array", + "description": "Carrier-based shipping calculations.", + "items": { + "$ref": "AccountShippingCarrierRate" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#accountShipping\".", + "default": "content#accountShipping" + }, + "locationGroups": { + "type": "array", + "description": "Location groups for shipping.", + "items": { + "$ref": "AccountShippingLocationGroup" + } + }, + "rateTables": { + "type": "array", + "description": "Rate tables definitions.", + "items": { + "$ref": "AccountShippingRateTable" + } + }, + "services": { + "type": "array", + "description": "Shipping services describing shipping fees calculation.", + "items": { + "$ref": "AccountShippingShippingService" + } + } + } + }, + "AccountShippingCarrierRate": { + "id": "AccountShippingCarrierRate", + "type": "object", + "description": "A carrier-calculated shipping rate.", + "properties": { + "carrier": { + "type": "string", + "description": "The carrier that is responsible for the shipping, such as \"UPS\", \"FedEx\", or \"USPS\".", + "annotations": { + "required": [ + "content.accountshipping.update" + ] + } + }, + "carrierService": { + "type": "string", + "description": "The carrier service, such as \"Ground\" or \"2Day\".", + "annotations": { + "required": [ + "content.accountshipping.update" + ] + } + }, + "modifierFlatRate": { + "$ref": "Price", + "description": "Additive shipping rate modifier." + }, + "modifierPercent": { + "type": "string", + "description": "Multiplicative shipping rate modifier in percent. Represented as a floating point number without the percentage character." + }, + "name": { + "type": "string", + "description": "The name of the carrier rate.", + "annotations": { + "required": [ + "content.accountshipping.update" + ] + } + }, + "saleCountry": { + "type": "string", + "description": "The sale country for which this carrier rate is valid, represented as a CLDR territory code.", + "annotations": { + "required": [ + "content.accountshipping.update" + ] + } + }, + "shippingOrigin": { + "type": "string", + "description": "Shipping origin represented as a postal code.", + "annotations": { + "required": [ + "content.accountshipping.update" + ] + } + } + } + }, + "AccountShippingCondition": { + "id": "AccountShippingCondition", + "type": "object", + "properties": { + "deliveryLocationGroup": { + "type": "string", + "description": "Delivery location in terms of a location group name. A location group with this name must be specified among location groups." + }, + "deliveryLocationId": { + "type": "string", + "description": "Delivery location in terms of a location ID. Can be used to represent administrative areas, smaller country subdivisions, or cities.", + "format": "int64" + }, + "deliveryPostalCode": { + "type": "string", + "description": "Delivery location in terms of a postal code." + }, + "deliveryPostalCodeRange": { + "$ref": "AccountShippingPostalCodeRange", + "description": "Delivery location in terms of a postal code range." + }, + "priceMax": { + "$ref": "Price", + "description": "Maximum shipping price. Forms an interval between the maximum of smaller prices (exclusive) and this price (inclusive)." + }, + "shippingLabel": { + "type": "string", + "description": "Shipping label of the product. The products with the label are matched." + }, + "weightMax": { + "$ref": "Weight", + "description": "Maximum shipping weight. Forms an interval between the maximum of smaller weight (exclusive) and this weight (inclusive)." + } + } + }, + "AccountShippingLocationGroup": { + "id": "AccountShippingLocationGroup", + "type": "object", + "description": "A user-defined locations group in a given country. All the locations of the group must be of the same type.", + "properties": { + "country": { + "type": "string", + "description": "The CLDR territory code of the country in which this location group is.", + "annotations": { + "required": [ + "content.accountshipping.update" + ] + } + }, + "locationIds": { + "type": "array", + "description": "A location ID (also called criteria ID) representing administrative areas, smaller country subdivisions (counties), or cities.", + "items": { + "type": "string", + "format": "int64" + } + }, + "name": { + "type": "string", + "description": "The name of the location group.", + "annotations": { + "required": [ + "content.accountshipping.update" + ] + } + }, + "postalCodeRanges": { + "type": "array", + "description": "A postal code range representing a city or a set of cities.", + "items": { + "$ref": "AccountShippingPostalCodeRange" + } + }, + "postalCodes": { + "type": "array", + "description": "A postal code representing a city or a set of cities. \n- A single postal code (e.g., 12345)\n- A postal code prefix followed by a star (e.g., 1234*)", + "items": { + "type": "string" + } + } + } + }, + "AccountShippingPostalCodeRange": { + "id": "AccountShippingPostalCodeRange", + "type": "object", + "description": "A postal code range, that can be either: \n- A range of postal codes (e.g., start=12340, end=12359)\n- A range of postal codes prefixes (e.g., start=1234* end=1235*). Prefixes must be of the same length (e.g., start=12* end=2* is invalid).", + "properties": { + "end": { + "type": "string", + "description": "The last (inclusive) postal code or prefix of the range.", + "annotations": { + "required": [ + "content.accountshipping.update" + ] + } + }, + "start": { + "type": "string", + "description": "The first (inclusive) postal code or prefix of the range.", + "annotations": { + "required": [ + "content.accountshipping.update" + ] + } + } + } + }, + "AccountShippingRateTable": { + "id": "AccountShippingRateTable", + "type": "object", + "description": "A single or bi-dimensional table of shipping rates. Each dimension is defined in terms of consecutive price/weight ranges, delivery locations, or shipping labels.", + "properties": { + "content": { + "type": "array", + "description": "One-dimensional table cells define one condition along the same dimension. Bi-dimensional table cells use two dimensions with respectively M and N distinct values and must contain exactly M * N cells with distinct conditions (for each possible value pairs).", + "items": { + "$ref": "AccountShippingRateTableCell" + } + }, + "name": { + "type": "string", + "description": "The name of the rate table.", + "annotations": { + "required": [ + "content.accountshipping.update" + ] + } + }, + "saleCountry": { + "type": "string", + "description": "The sale country for which this table is valid, represented as a CLDR territory code.", + "annotations": { + "required": [ + "content.accountshipping.update" + ] + } + } + } + }, + "AccountShippingRateTableCell": { + "id": "AccountShippingRateTableCell", + "type": "object", + "properties": { + "condition": { + "$ref": "AccountShippingCondition", + "description": "Conditions for which the cell is valid. All cells in a table must use the same dimension or pair of dimensions among price, weight, shipping label or delivery location. If no condition is specified, the cell acts as a catch-all and matches all the elements that are not matched by other cells in this dimension." + }, + "rate": { + "$ref": "Price", + "description": "The rate applicable if the cell conditions are matched.", + "annotations": { + "required": [ + "content.accountshipping.update" + ] + } + } + } + }, + "AccountShippingShippingService": { + "id": "AccountShippingShippingService", + "type": "object", + "description": "Shipping services provided in a country.", + "properties": { + "active": { + "type": "boolean", + "description": "Whether the shipping service is available." + }, + "calculationMethod": { + "$ref": "AccountShippingShippingServiceCalculationMethod", + "description": "Calculation method for the \"simple\" case that needs no rules." + }, + "costRuleTree": { + "$ref": "AccountShippingShippingServiceCostRule", + "description": "Decision tree for \"complicated\" shipping cost calculation." + }, + "name": { + "type": "string", + "description": "The name of this shipping service.", + "annotations": { + "required": [ + "content.accountshipping.update" + ] + } + }, + "saleCountry": { + "type": "string", + "description": "The CLDR territory code of the sale country for which this service can be used.", + "annotations": { + "required": [ + "content.accountshipping.update" + ] + } + } + } + }, + "AccountShippingShippingServiceCalculationMethod": { + "id": "AccountShippingShippingServiceCalculationMethod", + "type": "object", + "description": "Shipping cost calculation method. Exactly one of the field is set.", + "properties": { + "carrierRate": { + "type": "string", + "description": "Name of the carrier rate to use for the calculation." + }, + "excluded": { + "type": "boolean", + "description": "Delivery is excluded. Valid only within cost rules tree." + }, + "flatRate": { + "$ref": "Price", + "description": "Fixed price shipping, represented as a floating point number associated with a currency." + }, + "percentageRate": { + "type": "string", + "description": "Percentage of the price, represented as a floating point number without the percentage character." + }, + "rateTable": { + "type": "string", + "description": "Name of the rate table to use for the calculation." + } + } + }, + "AccountShippingShippingServiceCostRule": { + "id": "AccountShippingShippingServiceCostRule", + "type": "object", + "description": "Building block of the cost calculation decision tree. \n- The tree root should have no condition and no calculation method.\n- All the children must have a condition on the same dimension. The first child matching a condition is entered, therefore, price and weight conditions form contiguous intervals.\n- The last child of an element must have no condition and matches all elements not previously matched.\n- Children and calculation method are mutually exclusive, and exactly one of them must be defined; the root must only have children.", + "properties": { + "calculationMethod": { + "$ref": "AccountShippingShippingServiceCalculationMethod", + "description": "Final calculation method to be used only in leaf nodes." + }, + "children": { + "type": "array", + "description": "Subsequent rules to be applied, only for inner nodes. The last child must not specify a condition and acts as a catch-all.", + "items": { + "$ref": "AccountShippingShippingServiceCostRule" + } + }, + "condition": { + "$ref": "AccountShippingCondition", + "description": "Condition for this rule to be applicable. If no condition is specified, the rule acts as a catch-all." + } + } + }, + "AccountStatus": { + "id": "AccountStatus", + "type": "object", + "description": "The status of an account, i.e., information about its products, which is computed offline and not returned immediately at insertion time.", + "properties": { + "accountId": { + "type": "string", + "description": "The ID of the account for which the status is reported." + }, + "dataQualityIssues": { + "type": "array", + "description": "A list of data quality issues.", + "items": { + "$ref": "AccountStatusDataQualityIssue" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#accountStatus\".", + "default": "content#accountStatus" + } + } + }, + "AccountStatusDataQualityIssue": { + "id": "AccountStatusDataQualityIssue", + "type": "object", + "properties": { + "country": { + "type": "string", + "description": "Country for which this issue is reported." + }, + "displayedValue": { + "type": "string", + "description": "Actual value displayed on the landing page." + }, + "exampleItems": { + "type": "array", + "description": "Example items featuring the issue.", + "items": { + "$ref": "AccountStatusExampleItem" + } + }, + "id": { + "type": "string", + "description": "Issue identifier." + }, + "lastChecked": { + "type": "string", + "description": "Last time the account was checked for this issue." + }, + "numItems": { + "type": "integer", + "description": "Number of items in the account found to have the said issue.", + "format": "uint32" + }, + "severity": { + "type": "string", + "description": "Severity of the problem." + }, + "submittedValue": { + "type": "string", + "description": "Submitted value that causes the issue." + } + } + }, + "AccountStatusExampleItem": { + "id": "AccountStatusExampleItem", + "type": "object", + "description": "An example of an item that has poor data quality. An item value on the landing page differs from what is submitted, or conflicts with a policy.", + "properties": { + "itemId": { + "type": "string", + "description": "Unique item ID as specified in the uploaded product data." + }, + "link": { + "type": "string", + "description": "Landing page of the item." + }, + "submittedValue": { + "type": "string", + "description": "The item value that was submitted." + }, + "title": { + "type": "string", + "description": "Title of the item." + }, + "valueOnLandingPage": { + "type": "string", + "description": "The actual value on the landing page." + } + } + }, + "AccountTax": { + "id": "AccountTax", + "type": "object", + "description": "The tax settings of a merchant account.", + "properties": { + "accountId": { + "type": "string", + "description": "The ID of the account to which these account tax settings belong.", + "format": "uint64", + "annotations": { + "required": [ + "content.accounttax.update" + ] + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#accountTax\".", + "default": "content#accountTax" + }, + "rules": { + "type": "array", + "description": "Tax rules. Updating the tax rules will enable US taxes (not reversible). Defining no rules is equivalent to not charging tax at all.", + "items": { + "$ref": "AccountTaxTaxRule" + } + } + } + }, + "AccountTaxTaxRule": { + "id": "AccountTaxTaxRule", + "type": "object", + "description": "Tax calculation rule to apply in a state or province (USA only).", + "properties": { + "country": { + "type": "string", + "description": "Country code in which tax is applicable." + }, + "locationId": { + "type": "string", + "description": "State (or province) is which the tax is applicable, described by its location id (also called criteria id).", + "format": "uint64", + "annotations": { + "required": [ + "content.accounttax.update" + ] + } + }, + "ratePercent": { + "type": "string", + "description": "Explicit tax rate in percent, represented as a floating point number without the percentage character. Must not be negative." + }, + "shippingTaxed": { + "type": "boolean", + "description": "If true, shipping charges are also taxed." + }, + "useGlobalRate": { + "type": "boolean", + "description": "Whether the tax rate is taken from a global tax table or specified explicitly." + } + } + }, + "AccountUser": { + "id": "AccountUser", + "type": "object", + "properties": { + "admin": { + "type": "boolean", + "description": "Whether user is an admin." + }, + "emailAddress": { + "type": "string", + "description": "User's email address." + } + } + }, + "AccountsAuthInfoResponse": { + "id": "AccountsAuthInfoResponse", + "type": "object", + "properties": { + "accountIdentifiers": { + "type": "array", + "description": "The account identifiers corresponding to the authenticated user.\n- For an individual account: only the merchant ID is defined\n- For an aggregator: only the aggregator ID is defined\n- For a subaccount of an MCA: both the merchant ID and the aggregator ID are defined.", + "items": { + "$ref": "AccountIdentifier" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#accountsAuthInfoResponse\".", + "default": "content#accountsAuthInfoResponse" + } + } + }, + "AccountsCustomBatchRequest": { + "id": "AccountsCustomBatchRequest", + "type": "object", + "properties": { + "entries": { + "type": "array", + "description": "The request entries to be processed in the batch.", + "items": { + "$ref": "AccountsCustomBatchRequestEntry" + } + } + } + }, + "AccountsCustomBatchRequestEntry": { + "id": "AccountsCustomBatchRequestEntry", + "type": "object", + "description": "A batch entry encoding a single non-batch accounts request.", + "properties": { + "account": { + "$ref": "Account", + "description": "The account to create or update. Only defined if the method is insert or update." + }, + "accountId": { + "type": "string", + "description": "The ID of the account to get or delete. Only defined if the method is get or delete.", + "format": "uint64" + }, + "batchId": { + "type": "integer", + "description": "An entry ID, unique within the batch request.", + "format": "uint32" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "format": "uint64" + }, + "method": { + "type": "string" + } + } + }, + "AccountsCustomBatchResponse": { + "id": "AccountsCustomBatchResponse", + "type": "object", + "properties": { + "entries": { + "type": "array", + "description": "The result of the execution of the batch requests.", + "items": { + "$ref": "AccountsCustomBatchResponseEntry" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#accountsCustomBatchResponse\".", + "default": "content#accountsCustomBatchResponse" + } + } + }, + "AccountsCustomBatchResponseEntry": { + "id": "AccountsCustomBatchResponseEntry", + "type": "object", + "description": "A batch entry encoding a single non-batch accounts response.", + "properties": { + "account": { + "$ref": "Account", + "description": "The retrieved, created, or updated account. Not defined if the method was delete." + }, + "batchId": { + "type": "integer", + "description": "The ID of the request entry this entry responds to.", + "format": "uint32" + }, + "errors": { + "$ref": "Errors", + "description": "A list of errors defined if and only if the request failed." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#accountsCustomBatchResponseEntry\".", + "default": "content#accountsCustomBatchResponseEntry" + } + } + }, + "AccountsListResponse": { + "id": "AccountsListResponse", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#accountsListResponse\".", + "default": "content#accountsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token for the retrieval of the next page of accounts." + }, + "resources": { + "type": "array", + "items": { + "$ref": "Account" + } + } + } + }, + "AccountshippingCustomBatchRequest": { + "id": "AccountshippingCustomBatchRequest", + "type": "object", + "properties": { + "entries": { + "type": "array", + "description": "The request entries to be processed in the batch.", + "items": { + "$ref": "AccountshippingCustomBatchRequestEntry" + } + } + } + }, + "AccountshippingCustomBatchRequestEntry": { + "id": "AccountshippingCustomBatchRequestEntry", + "type": "object", + "description": "A batch entry encoding a single non-batch accountshipping request.", + "properties": { + "accountId": { + "type": "string", + "description": "The ID of the account for which to get/update account shipping settings.", + "format": "uint64" + }, + "accountShipping": { + "$ref": "AccountShipping", + "description": "The account shipping settings to update. Only defined if the method is update." + }, + "batchId": { + "type": "integer", + "description": "An entry ID, unique within the batch request.", + "format": "uint32" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "format": "uint64" + }, + "method": { + "type": "string" + } + } + }, + "AccountshippingCustomBatchResponse": { + "id": "AccountshippingCustomBatchResponse", + "type": "object", + "properties": { + "entries": { + "type": "array", + "description": "The result of the execution of the batch requests.", + "items": { + "$ref": "AccountshippingCustomBatchResponseEntry" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#accountshippingCustomBatchResponse\".", + "default": "content#accountshippingCustomBatchResponse" + } + } + }, + "AccountshippingCustomBatchResponseEntry": { + "id": "AccountshippingCustomBatchResponseEntry", + "type": "object", + "description": "A batch entry encoding a single non-batch accountshipping response.", + "properties": { + "accountShipping": { + "$ref": "AccountShipping", + "description": "The retrieved or updated account shipping settings." + }, + "batchId": { + "type": "integer", + "description": "The ID of the request entry this entry responds to.", + "format": "uint32" + }, + "errors": { + "$ref": "Errors", + "description": "A list of errors defined if and only if the request failed." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#accountshippingCustomBatchResponseEntry\".", + "default": "content#accountshippingCustomBatchResponseEntry" + } + } + }, + "AccountshippingListResponse": { + "id": "AccountshippingListResponse", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#accountshippingListResponse\".", + "default": "content#accountshippingListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token for the retrieval of the next page of account shipping settings." + }, + "resources": { + "type": "array", + "items": { + "$ref": "AccountShipping" + } + } + } + }, + "AccountstatusesCustomBatchRequest": { + "id": "AccountstatusesCustomBatchRequest", + "type": "object", + "properties": { + "entries": { + "type": "array", + "description": "The request entries to be processed in the batch.", + "items": { + "$ref": "AccountstatusesCustomBatchRequestEntry" + } + } + } + }, + "AccountstatusesCustomBatchRequestEntry": { + "id": "AccountstatusesCustomBatchRequestEntry", + "type": "object", + "description": "A batch entry encoding a single non-batch accountstatuses request.", + "properties": { + "accountId": { + "type": "string", + "description": "The ID of the (sub-)account whose status to get.", + "format": "uint64" + }, + "batchId": { + "type": "integer", + "description": "An entry ID, unique within the batch request.", + "format": "uint32" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "format": "uint64" + }, + "method": { + "type": "string", + "description": "The method (get)." + } + } + }, + "AccountstatusesCustomBatchResponse": { + "id": "AccountstatusesCustomBatchResponse", + "type": "object", + "properties": { + "entries": { + "type": "array", + "description": "The result of the execution of the batch requests.", + "items": { + "$ref": "AccountstatusesCustomBatchResponseEntry" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#accountstatusesCustomBatchResponse\".", + "default": "content#accountstatusesCustomBatchResponse" + } + } + }, + "AccountstatusesCustomBatchResponseEntry": { + "id": "AccountstatusesCustomBatchResponseEntry", + "type": "object", + "description": "A batch entry encoding a single non-batch accountstatuses response.", + "properties": { + "accountStatus": { + "$ref": "AccountStatus", + "description": "The requested account status. Defined if and only if the request was successful." + }, + "batchId": { + "type": "integer", + "description": "The ID of the request entry this entry responds to.", + "format": "uint32" + }, + "errors": { + "$ref": "Errors", + "description": "A list of errors defined if and only if the request failed." + } + } + }, + "AccountstatusesListResponse": { + "id": "AccountstatusesListResponse", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#accountstatusesListResponse\".", + "default": "content#accountstatusesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token for the retrieval of the next page of account statuses." + }, + "resources": { + "type": "array", + "items": { + "$ref": "AccountStatus" + } + } + } + }, + "AccounttaxCustomBatchRequest": { + "id": "AccounttaxCustomBatchRequest", + "type": "object", + "properties": { + "entries": { + "type": "array", + "description": "The request entries to be processed in the batch.", + "items": { + "$ref": "AccounttaxCustomBatchRequestEntry" + } + } + } + }, + "AccounttaxCustomBatchRequestEntry": { + "id": "AccounttaxCustomBatchRequestEntry", + "type": "object", + "description": "A batch entry encoding a single non-batch accounttax request.", + "properties": { + "accountId": { + "type": "string", + "description": "The ID of the account for which to get/update account tax settings.", + "format": "uint64" + }, + "accountTax": { + "$ref": "AccountTax", + "description": "The account tax settings to update. Only defined if the method is update." + }, + "batchId": { + "type": "integer", + "description": "An entry ID, unique within the batch request.", + "format": "uint32" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "format": "uint64" + }, + "method": { + "type": "string" + } + } + }, + "AccounttaxCustomBatchResponse": { + "id": "AccounttaxCustomBatchResponse", + "type": "object", + "properties": { + "entries": { + "type": "array", + "description": "The result of the execution of the batch requests.", + "items": { + "$ref": "AccounttaxCustomBatchResponseEntry" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#accounttaxCustomBatchResponse\".", + "default": "content#accounttaxCustomBatchResponse" + } + } + }, + "AccounttaxCustomBatchResponseEntry": { + "id": "AccounttaxCustomBatchResponseEntry", + "type": "object", + "description": "A batch entry encoding a single non-batch accounttax response.", + "properties": { + "accountTax": { + "$ref": "AccountTax", + "description": "The retrieved or updated account tax settings." + }, + "batchId": { + "type": "integer", + "description": "The ID of the request entry this entry responds to.", + "format": "uint32" + }, + "errors": { + "$ref": "Errors", + "description": "A list of errors defined if and only if the request failed." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#accounttaxCustomBatchResponseEntry\".", + "default": "content#accounttaxCustomBatchResponseEntry" + } + } + }, + "AccounttaxListResponse": { + "id": "AccounttaxListResponse", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#accounttaxListResponse\".", + "default": "content#accounttaxListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token for the retrieval of the next page of account tax settings." + }, + "resources": { + "type": "array", + "items": { + "$ref": "AccountTax" + } + } + } + }, + "Datafeed": { + "id": "Datafeed", + "type": "object", + "description": "Datafeed data.", + "properties": { + "attributeLanguage": { + "type": "string", + "description": "The two-letter ISO 639-1 language in which the attributes are defined in the data feed." + }, + "contentLanguage": { + "type": "string", + "description": "The two-letter ISO 639-1 language of the items in the feed.", + "annotations": { + "required": [ + "content.datafeeds.insert" + ] + } + }, + "contentType": { + "type": "string", + "description": "The type of data feed.", + "annotations": { + "required": [ + "content.datafeeds.insert", + "content.datafeeds.update" + ] + } + }, + "fetchSchedule": { + "$ref": "DatafeedFetchSchedule", + "description": "Fetch schedule for the feed file." + }, + "fileName": { + "type": "string", + "description": "The filename of the feed. All feeds must have a unique file name.", + "annotations": { + "required": [ + "content.datafeeds.insert", + "content.datafeeds.update" + ] + } + }, + "format": { + "$ref": "DatafeedFormat", + "description": "Format of the feed file." + }, + "id": { + "type": "string", + "description": "The ID of the data feed.", + "format": "int64", + "annotations": { + "required": [ + "content.datafeeds.update" + ] + } + }, + "intendedDestinations": { + "type": "array", + "description": "The list of intended destinations (corresponds to checked check boxes in Merchant Center).", + "items": { + "type": "string" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#datafeed\".", + "default": "content#datafeed" + }, + "name": { + "type": "string", + "description": "A descriptive name of the data feed.", + "annotations": { + "required": [ + "content.datafeeds.insert" + ] + } + }, + "targetCountry": { + "type": "string", + "description": "The country where the items in the feed will be included in the search index, represented as a CLDR territory code.", + "annotations": { + "required": [ + "content.datafeeds.insert", + "content.datafeeds.update" + ] + } + } + } + }, + "DatafeedFetchSchedule": { + "id": "DatafeedFetchSchedule", + "type": "object", + "description": "The required fields vary based on the frequency of fetching. For a monthly fetch schedule, day_of_month and hour are required. For a weekly fetch schedule, weekday and hour are required. For a daily fetch schedule, only hour is required.", + "properties": { + "dayOfMonth": { + "type": "integer", + "description": "The day of the month the feed file should be fetched (1-31).", + "format": "uint32" + }, + "fetchUrl": { + "type": "string", + "description": "The URL where the feed file can be fetched. Google Merchant Center will support automatic scheduled uploads using the HTTP, HTTPS, FTP, or SFTP protocols, so the value will need to be a valid link using one of those four protocols." + }, + "hour": { + "type": "integer", + "description": "The hour of the day the feed file should be fetched (0-24).", + "format": "uint32" + }, + "password": { + "type": "string", + "description": "An optional password for fetch_url." + }, + "timeZone": { + "type": "string", + "description": "Time zone used for schedule. UTC by default. E.g., \"America/Los_Angeles\"." + }, + "username": { + "type": "string", + "description": "An optional user name for fetch_url." + }, + "weekday": { + "type": "string", + "description": "The day of the week the feed file should be fetched." + } + } + }, + "DatafeedFormat": { + "id": "DatafeedFormat", + "type": "object", + "properties": { + "columnDelimiter": { + "type": "string", + "description": "Delimiter for the separation of values in a delimiter-separated values feed. If not specified, the delimiter will be auto-detected. Ignored for non-DSV data feeds." + }, + "fileEncoding": { + "type": "string", + "description": "Character encoding scheme of the data feed. If not specified, the encoding will be auto-detected." + }, + "quotingMode": { + "type": "string", + "description": "Specifies how double quotes are interpreted. If not specified, the mode will be auto-detected. Ignored for non-DSV data feeds." + } + } + }, + "DatafeedStatus": { + "id": "DatafeedStatus", + "type": "object", + "description": "The status of a datafeed, i.e., the result of the last retrieval of the datafeed computed asynchronously when the feed processing is finished.", + "properties": { + "datafeedId": { + "type": "string", + "description": "The ID of the feed for which the status is reported.", + "format": "uint64" + }, + "errors": { + "type": "array", + "description": "The list of errors occurring in the feed.", + "items": { + "$ref": "DatafeedStatusError" + } + }, + "itemsTotal": { + "type": "string", + "description": "The number of items in the feed that were processed.", + "format": "uint64" + }, + "itemsValid": { + "type": "string", + "description": "The number of items in the feed that were valid.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#datafeedStatus\".", + "default": "content#datafeedStatus" + }, + "lastUploadDate": { + "type": "string", + "description": "The last date at which the feed was uploaded." + }, + "processingStatus": { + "type": "string", + "description": "The processing status of the feed." + }, + "warnings": { + "type": "array", + "description": "The list of errors occurring in the feed.", + "items": { + "$ref": "DatafeedStatusError" + } + } + } + }, + "DatafeedStatusError": { + "id": "DatafeedStatusError", + "type": "object", + "description": "An error occurring in the feed, like \"invalid price\".", + "properties": { + "code": { + "type": "string", + "description": "The code of the error, e.g., \"validation/invalid_value\"." + }, + "count": { + "type": "string", + "description": "The number of occurrences of the error in the feed.", + "format": "uint64" + }, + "examples": { + "type": "array", + "description": "A list of example occurrences of the error, grouped by product.", + "items": { + "$ref": "DatafeedStatusExample" + } + }, + "message": { + "type": "string", + "description": "The error message, e.g., \"Invalid price\"." + } + } + }, + "DatafeedStatusExample": { + "id": "DatafeedStatusExample", + "type": "object", + "description": "An example occurrence for a particular error.", + "properties": { + "itemId": { + "type": "string", + "description": "The ID of the example item." + }, + "lineNumber": { + "type": "string", + "description": "Line number in the data feed where the example is found.", + "format": "uint64" + }, + "value": { + "type": "string", + "description": "The problematic value." + } + } + }, + "DatafeedsCustomBatchRequest": { + "id": "DatafeedsCustomBatchRequest", + "type": "object", + "properties": { + "entries": { + "type": "array", + "description": "The request entries to be processed in the batch.", + "items": { + "$ref": "DatafeedsCustomBatchRequestEntry" + } + } + } + }, + "DatafeedsCustomBatchRequestEntry": { + "id": "DatafeedsCustomBatchRequestEntry", + "type": "object", + "description": "A batch entry encoding a single non-batch datafeeds request.", + "properties": { + "batchId": { + "type": "integer", + "description": "An entry ID, unique within the batch request.", + "format": "uint32" + }, + "datafeed": { + "$ref": "Datafeed", + "description": "The data feed to insert." + }, + "datafeedId": { + "type": "string", + "description": "The ID of the data feed to get or delete.", + "format": "uint64" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "format": "uint64" + }, + "method": { + "type": "string" + } + } + }, + "DatafeedsCustomBatchResponse": { + "id": "DatafeedsCustomBatchResponse", + "type": "object", + "properties": { + "entries": { + "type": "array", + "description": "The result of the execution of the batch requests.", + "items": { + "$ref": "DatafeedsCustomBatchResponseEntry" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#datafeedsCustomBatchResponse\".", + "default": "content#datafeedsCustomBatchResponse" + } + } + }, + "DatafeedsCustomBatchResponseEntry": { + "id": "DatafeedsCustomBatchResponseEntry", + "type": "object", + "description": "A batch entry encoding a single non-batch datafeeds response.", + "properties": { + "batchId": { + "type": "integer", + "description": "The ID of the request entry this entry responds to.", + "format": "uint32" + }, + "datafeed": { + "$ref": "Datafeed", + "description": "The requested data feed. Defined if and only if the request was successful." + }, + "errors": { + "$ref": "Errors", + "description": "A list of errors defined if and only if the request failed." + } + } + }, + "DatafeedsListResponse": { + "id": "DatafeedsListResponse", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#datafeedsListResponse\".", + "default": "content#datafeedsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token for the retrieval of the next page of datafeeds." + }, + "resources": { + "type": "array", + "items": { + "$ref": "Datafeed" + } + } + } + }, + "DatafeedstatusesCustomBatchRequest": { + "id": "DatafeedstatusesCustomBatchRequest", + "type": "object", + "properties": { + "entries": { + "type": "array", + "description": "The request entries to be processed in the batch.", + "items": { + "$ref": "DatafeedstatusesCustomBatchRequestEntry" + } + } + } + }, + "DatafeedstatusesCustomBatchRequestEntry": { + "id": "DatafeedstatusesCustomBatchRequestEntry", + "type": "object", + "description": "A batch entry encoding a single non-batch datafeedstatuses request.", + "properties": { + "batchId": { + "type": "integer", + "description": "An entry ID, unique within the batch request.", + "format": "uint32" + }, + "datafeedId": { + "type": "string", + "description": "The ID of the data feed to get or delete.", + "format": "uint64" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "format": "uint64" + }, + "method": { + "type": "string" + } + } + }, + "DatafeedstatusesCustomBatchResponse": { + "id": "DatafeedstatusesCustomBatchResponse", + "type": "object", + "properties": { + "entries": { + "type": "array", + "description": "The result of the execution of the batch requests.", + "items": { + "$ref": "DatafeedstatusesCustomBatchResponseEntry" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#datafeedstatusesCustomBatchResponse\".", + "default": "content#datafeedstatusesCustomBatchResponse" + } + } + }, + "DatafeedstatusesCustomBatchResponseEntry": { + "id": "DatafeedstatusesCustomBatchResponseEntry", + "type": "object", + "description": "A batch entry encoding a single non-batch datafeedstatuses response.", + "properties": { + "batchId": { + "type": "integer", + "description": "The ID of the request entry this entry responds to.", + "format": "uint32" + }, + "datafeedStatus": { + "$ref": "DatafeedStatus", + "description": "The requested data feed status. Defined if and only if the request was successful." + }, + "errors": { + "$ref": "Errors", + "description": "A list of errors defined if and only if the request failed." + } + } + }, + "DatafeedstatusesListResponse": { + "id": "DatafeedstatusesListResponse", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#datafeedstatusesListResponse\".", + "default": "content#datafeedstatusesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token for the retrieval of the next page of datafeed statuses." + }, + "resources": { + "type": "array", + "items": { + "$ref": "DatafeedStatus" + } + } + } + }, + "Error": { + "id": "Error", + "type": "object", + "description": "An error returned by the API.", + "properties": { + "domain": { + "type": "string", + "description": "The domain of the error." + }, + "message": { + "type": "string", + "description": "A description of the error." + }, + "reason": { + "type": "string", + "description": "The error code." + } + } + }, + "Errors": { + "id": "Errors", + "type": "object", + "description": "A list of errors returned by a failed batch entry.", + "properties": { + "code": { + "type": "integer", + "description": "The HTTP status of the first error in errors.", + "format": "uint32" + }, + "errors": { + "type": "array", + "description": "A list of errors.", + "items": { + "$ref": "Error" + } + }, + "message": { + "type": "string", + "description": "The message of the first error in errors." + } + } + }, + "Inventory": { + "id": "Inventory", + "type": "object", + "properties": { + "availability": { + "type": "string", + "description": "The availability of the product." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#inventory\".", + "default": "content#inventory" + }, + "price": { + "$ref": "Price", + "description": "The price of the product." + }, + "quantity": { + "type": "integer", + "description": "The quantity of the product. Must be equal to or greater than zero. Supported only for local products.", + "format": "uint32" + }, + "salePrice": { + "$ref": "Price", + "description": "The sale price of the product. Mandatory if sale_price_effective_date is defined." + }, + "salePriceEffectiveDate": { + "type": "string", + "description": "A date range represented by a pair of ISO 8601 dates separated by a space, comma, or slash. Both dates might be specified as 'null' if undecided." + }, + "sellOnGoogleQuantity": { + "type": "integer", + "description": "The quantity of the product that is reserved for sell-on-google ads. Supported only for online products.", + "format": "uint32" + } + } + }, + "InventoryCustomBatchRequest": { + "id": "InventoryCustomBatchRequest", + "type": "object", + "properties": { + "entries": { + "type": "array", + "description": "The request entries to be processed in the batch.", + "items": { + "$ref": "InventoryCustomBatchRequestEntry" + } + } + } + }, + "InventoryCustomBatchRequestEntry": { + "id": "InventoryCustomBatchRequestEntry", + "type": "object", + "description": "A batch entry encoding a single non-batch inventory request.", + "properties": { + "batchId": { + "type": "integer", + "description": "An entry ID, unique within the batch request.", + "format": "uint32" + }, + "inventory": { + "$ref": "Inventory", + "description": "Price and availability of the product." + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "format": "uint64" + }, + "productId": { + "type": "string", + "description": "The ID of the product for which to update price and availability." + }, + "storeCode": { + "type": "string", + "description": "The code of the store for which to update price and availability. Use online to update price and availability of an online product." + } + } + }, + "InventoryCustomBatchResponse": { + "id": "InventoryCustomBatchResponse", + "type": "object", + "properties": { + "entries": { + "type": "array", + "description": "The result of the execution of the batch requests.", + "items": { + "$ref": "InventoryCustomBatchResponseEntry" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#inventoryCustomBatchResponse\".", + "default": "content#inventoryCustomBatchResponse" + } + } + }, + "InventoryCustomBatchResponseEntry": { + "id": "InventoryCustomBatchResponseEntry", + "type": "object", + "description": "A batch entry encoding a single non-batch inventory response.", + "properties": { + "batchId": { + "type": "integer", + "description": "The ID of the request entry this entry responds to.", + "format": "uint32" + }, + "errors": { + "$ref": "Errors", + "description": "A list of errors defined if and only if the request failed." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#inventoryCustomBatchResponseEntry\".", + "default": "content#inventoryCustomBatchResponseEntry" + } + } + }, + "InventorySetRequest": { + "id": "InventorySetRequest", + "type": "object", + "properties": { + "availability": { + "type": "string", + "description": "The availability of the product." + }, + "price": { + "$ref": "Price", + "description": "The price of the product." + }, + "quantity": { + "type": "integer", + "description": "The quantity of the product. Must be equal to or greater than zero. Supported only for local products.", + "format": "uint32" + }, + "salePrice": { + "$ref": "Price", + "description": "The sale price of the product. Mandatory if sale_price_effective_date is defined." + }, + "salePriceEffectiveDate": { + "type": "string", + "description": "A date range represented by a pair of ISO 8601 dates separated by a space, comma, or slash. Both dates might be specified as 'null' if undecided." + }, + "sellOnGoogleQuantity": { + "type": "integer", + "description": "The quantity of the product that is reserved for sell-on-google ads. Supported only for online products.", + "format": "uint32" + } + } + }, + "InventorySetResponse": { + "id": "InventorySetResponse", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#inventorySetResponse\".", + "default": "content#inventorySetResponse" + } + } + }, + "LoyaltyPoints": { + "id": "LoyaltyPoints", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of loyalty points program. It is recommended to limit the name to 12 full-width characters or 24 Roman characters." + }, + "pointsValue": { + "type": "string", + "description": "The retailer's loyalty points in absolute value.", + "format": "int64" + }, + "ratio": { + "type": "number", + "description": "The ratio of a point when converted to currency. Google assumes currency based on Merchant Center settings. If ratio is left out, it defaults to 1.0.", + "format": "double" + } + } + }, + "Order": { + "id": "Order", + "type": "object", + "properties": { + "acknowledged": { + "type": "boolean", + "description": "Whether the order was acknowledged." + }, + "customer": { + "$ref": "OrderCustomer", + "description": "The details of the customer who placed the order." + }, + "deliveryDetails": { + "$ref": "OrderDeliveryDetails", + "description": "The details for the delivery." + }, + "id": { + "type": "string", + "description": "The REST id of the order. Globally unique." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#order\".", + "default": "content#order" + }, + "lineItems": { + "type": "array", + "description": "Line items that are ordered.", + "items": { + "$ref": "OrderLineItem" + } + }, + "merchantId": { + "type": "string", + "format": "uint64" + }, + "merchantOrderId": { + "type": "string", + "description": "Merchant-provided id of the order." + }, + "netAmount": { + "$ref": "Price", + "description": "The net amount for the order. For example, if an order was originally for a grand total of $100 and a refund was issued for $20, the net amount will be $80." + }, + "paymentMethod": { + "$ref": "OrderPaymentMethod", + "description": "The details of the payment method." + }, + "paymentStatus": { + "type": "string", + "description": "The status of the payment." + }, + "placedDate": { + "type": "string", + "description": "The date when the order was placed, in ISO 8601 format." + }, + "refunds": { + "type": "array", + "description": "Refunds for the order.", + "items": { + "$ref": "OrderRefund" + } + }, + "shipments": { + "type": "array", + "description": "Shipments of the order.", + "items": { + "$ref": "OrderShipment" + } + }, + "shippingCost": { + "$ref": "Price", + "description": "The total cost of shipping for all items." + }, + "shippingCostTax": { + "$ref": "Price", + "description": "The tax for the total shipping cost." + }, + "shippingOption": { + "type": "string", + "description": "The requested shipping option." + }, + "status": { + "type": "string", + "description": "The status of the order." + } + } + }, + "OrderAddress": { + "id": "OrderAddress", + "type": "object", + "properties": { + "country": { + "type": "string", + "description": "CLDR country code (e.g. \"US\")." + }, + "fullAddress": { + "type": "array", + "description": "Strings representing the lines of the printed label for mailing the order, for example:\nJohn Smith\n1600 Amphitheatre Parkway\nMountain View, CA, 94043\nUnited States", + "items": { + "type": "string" + } + }, + "isPostOfficeBox": { + "type": "boolean", + "description": "Whether the address is a post office box." + }, + "locality": { + "type": "string", + "description": "City, town or commune. May also include dependent localities or sublocalities (e.g. neighborhoods or suburbs)." + }, + "postalCode": { + "type": "string", + "description": "Postal Code or ZIP (e.g. \"94043\")." + }, + "recipientName": { + "type": "string", + "description": "Name of the recipient." + }, + "region": { + "type": "string", + "description": "Top-level administrative subdivision of the country (e.g. \"CA\")." + }, + "streetAddress": { + "type": "array", + "description": "Street-level part of the address.", + "items": { + "type": "string" + } + } + } + }, + "OrderCancellation": { + "id": "OrderCancellation", + "type": "object", + "properties": { + "actor": { + "type": "string", + "description": "The actor that created the cancellation." + }, + "creationDate": { + "type": "string", + "description": "Date on which the cancellation has been created, in ISO 8601 format." + }, + "quantity": { + "type": "integer", + "description": "The quantity that was canceled.", + "format": "uint32" + }, + "reason": { + "type": "string", + "description": "The reason for the cancellation." + }, + "reasonText": { + "type": "string", + "description": "The explanation of the reason." + } + } + }, + "OrderCustomer": { + "id": "OrderCustomer", + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email address of the customer." + }, + "explicitMarketingPreference": { + "type": "boolean", + "description": "If set, this indicates the user had a choice to opt in or out of providing marketing rights to the merchant. If unset, this indicates the user has already made this choice in a previous purchase, and was thus not shown the marketing right opt in/out checkbox during the Purchases on Google checkout flow." + }, + "fullName": { + "type": "string", + "description": "Full name of the customer." + } + } + }, + "OrderDeliveryDetails": { + "id": "OrderDeliveryDetails", + "type": "object", + "properties": { + "address": { + "$ref": "OrderAddress", + "description": "The delivery address" + }, + "phoneNumber": { + "type": "string", + "description": "The phone number of the person receiving the delivery." + } + } + }, + "OrderLineItem": { + "id": "OrderLineItem", + "type": "object", + "properties": { + "cancellations": { + "type": "array", + "description": "Cancellations of the line item.", + "items": { + "$ref": "OrderCancellation" + } + }, + "id": { + "type": "string", + "description": "The id of the line item." + }, + "price": { + "$ref": "Price", + "description": "Total price for the line item. For example, if two items for $10 are purchased, the total price will be $20." + }, + "product": { + "$ref": "OrderLineItemProduct", + "description": "Product data from the time of the order placement." + }, + "quantityCanceled": { + "type": "integer", + "description": "Number of items canceled.", + "format": "uint32" + }, + "quantityDelivered": { + "type": "integer", + "description": "Number of items delivered.", + "format": "uint32" + }, + "quantityOrdered": { + "type": "integer", + "description": "Number of items ordered.", + "format": "uint32" + }, + "quantityPending": { + "type": "integer", + "description": "Number of items pending.", + "format": "uint32" + }, + "quantityReturned": { + "type": "integer", + "description": "Number of items returned.", + "format": "uint32" + }, + "quantityShipped": { + "type": "integer", + "description": "Number of items shipped.", + "format": "uint32" + }, + "returnInfo": { + "$ref": "OrderLineItemReturnInfo", + "description": "Details of the return policy for the line item." + }, + "returns": { + "type": "array", + "description": "Returns of the line item.", + "items": { + "$ref": "OrderReturn" + } + }, + "shippingDetails": { + "$ref": "OrderLineItemShippingDetails", + "description": "Details of the requested shipping for the line item." + }, + "tax": { + "$ref": "Price", + "description": "Total tax amount for the line item. For example, if two items are purchased, and each have a cost tax of $2, the total tax amount will be $4." + } + } + }, + "OrderLineItemProduct": { + "id": "OrderLineItemProduct", + "type": "object", + "properties": { + "brand": { + "type": "string", + "description": "Brand of the item." + }, + "channel": { + "type": "string", + "description": "The item's channel (online or local)." + }, + "condition": { + "type": "string", + "description": "Condition or state of the item." + }, + "contentLanguage": { + "type": "string", + "description": "The two-letter ISO 639-1 language code for the item." + }, + "gtin": { + "type": "string", + "description": "Global Trade Item Number (GTIN) of the item." + }, + "id": { + "type": "string", + "description": "The REST id of the product." + }, + "imageLink": { + "type": "string", + "description": "URL of an image of the item." + }, + "itemGroupId": { + "type": "string", + "description": "Shared identifier for all variants of the same product." + }, + "mpn": { + "type": "string", + "description": "Manufacturer Part Number (MPN) of the item." + }, + "offerId": { + "type": "string", + "description": "An identifier of the item." + }, + "price": { + "$ref": "Price", + "description": "Price of the item." + }, + "shownImage": { + "type": "string", + "description": "URL to the cached image shown to the user when order was placed." + }, + "targetCountry": { + "type": "string", + "description": "The CLDR territory code of the target country of the product." + }, + "title": { + "type": "string", + "description": "The title of the product." + }, + "variantAttributes": { + "type": "array", + "description": "Variant attributes for the item. These are dimensions of the product, such as color, gender, material, pattern, and size. You can find a comprehensive list of variant attributes here.", + "items": { + "$ref": "OrderLineItemProductVariantAttribute" + } + } + } + }, + "OrderLineItemProductVariantAttribute": { + "id": "OrderLineItemProductVariantAttribute", + "type": "object", + "properties": { + "dimension": { + "type": "string", + "description": "The dimension of the variant." + }, + "value": { + "type": "string", + "description": "The value for the dimension." + } + } + }, + "OrderLineItemReturnInfo": { + "id": "OrderLineItemReturnInfo", + "type": "object", + "properties": { + "daysToReturn": { + "type": "integer", + "description": "How many days later the item can be returned.", + "format": "int32", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "isReturnable": { + "type": "boolean", + "description": "Whether the item is returnable.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "policyUrl": { + "type": "string", + "description": "URL of the item return policy.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + } + } + }, + "OrderLineItemShippingDetails": { + "id": "OrderLineItemShippingDetails", + "type": "object", + "properties": { + "deliverByDate": { + "type": "string", + "description": "The delivery by date, in ISO 8601 format.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "method": { + "$ref": "OrderLineItemShippingDetailsMethod", + "description": "Details of the shipping method.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "shipByDate": { + "type": "string", + "description": "The ship by date, in ISO 8601 format.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + } + } + }, + "OrderLineItemShippingDetailsMethod": { + "id": "OrderLineItemShippingDetailsMethod", + "type": "object", + "properties": { + "carrier": { + "type": "string", + "description": "The carrier for the shipping. Optional." + }, + "maxDaysInTransit": { + "type": "integer", + "description": "Maximum transit time.", + "format": "uint32", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "methodName": { + "type": "string", + "description": "The name of the shipping method.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "minDaysInTransit": { + "type": "integer", + "description": "Minimum transit time.", + "format": "uint32", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + } + } + }, + "OrderPaymentMethod": { + "id": "OrderPaymentMethod", + "type": "object", + "properties": { + "billingAddress": { + "$ref": "OrderAddress", + "description": "The billing address." + }, + "expirationMonth": { + "type": "integer", + "description": "The card expiration month (January = 1, February = 2 etc.).", + "format": "int32" + }, + "expirationYear": { + "type": "integer", + "description": "The card expiration year (4-digit, e.g. 2015).", + "format": "int32" + }, + "lastFourDigits": { + "type": "string", + "description": "The last four digits of the card number." + }, + "phoneNumber": { + "type": "string", + "description": "The billing phone number." + }, + "type": { + "type": "string", + "description": "The type of instrument (VISA, Mastercard, etc)." + } + } + }, + "OrderRefund": { + "id": "OrderRefund", + "type": "object", + "properties": { + "actor": { + "type": "string", + "description": "The actor that created the refund." + }, + "amount": { + "$ref": "Price", + "description": "The amount that is refunded." + }, + "creationDate": { + "type": "string", + "description": "Date on which the item has been created, in ISO 8601 format." + }, + "reason": { + "type": "string", + "description": "The reason for the refund." + }, + "reasonText": { + "type": "string", + "description": "The explanation of the reason." + } + } + }, + "OrderReturn": { + "id": "OrderReturn", + "type": "object", + "properties": { + "actor": { + "type": "string", + "description": "The actor that created the refund." + }, + "creationDate": { + "type": "string", + "description": "Date on which the item has been created, in ISO 8601 format." + }, + "quantity": { + "type": "integer", + "description": "Quantity that is returned.", + "format": "uint32" + }, + "reason": { + "type": "string", + "description": "The reason for the return." + }, + "reasonText": { + "type": "string", + "description": "The explanation of the reason." + } + } + }, + "OrderShipment": { + "id": "OrderShipment", + "type": "object", + "properties": { + "carrier": { + "type": "string", + "description": "The carrier handling the shipment." + }, + "creationDate": { + "type": "string", + "description": "Date on which the shipment has been created, in ISO 8601 format." + }, + "deliveryDate": { + "type": "string", + "description": "Date on which the shipment has been delivered, in ISO 8601 format. Present only if status is delievered" + }, + "id": { + "type": "string", + "description": "The id of the shipment." + }, + "lineItems": { + "type": "array", + "description": "The line items that are shipped.", + "items": { + "$ref": "OrderShipmentLineItemShipment" + } + }, + "status": { + "type": "string", + "description": "The status of the shipment." + }, + "trackingId": { + "type": "string", + "description": "The tracking id for the shipment." + } + } + }, + "OrderShipmentLineItemShipment": { + "id": "OrderShipmentLineItemShipment", + "type": "object", + "properties": { + "lineItemId": { + "type": "string", + "description": "The id of the line item that is shipped." + }, + "quantity": { + "type": "integer", + "description": "The quantity that is shipped.", + "format": "uint32" + } + } + }, + "OrdersAcknowledgeRequest": { + "id": "OrdersAcknowledgeRequest", + "type": "object", + "properties": { + "operationId": { + "type": "string", + "description": "The ID of the operation. Unique across all operations for a given order." + } + } + }, + "OrdersAcknowledgeResponse": { + "id": "OrdersAcknowledgeResponse", + "type": "object", + "properties": { + "executionStatus": { + "type": "string", + "description": "The status of the execution." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersAcknowledgeResponse\".", + "default": "content#ordersAcknowledgeResponse" + } + } + }, + "OrdersAdvanceTestOrderResponse": { + "id": "OrdersAdvanceTestOrderResponse", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersAdvanceTestOrderResponse\".", + "default": "content#ordersAdvanceTestOrderResponse" + } + } + }, + "OrdersCancelLineItemRequest": { + "id": "OrdersCancelLineItemRequest", + "type": "object", + "properties": { + "lineItemId": { + "type": "string", + "description": "The ID of the line item to cancel." + }, + "operationId": { + "type": "string", + "description": "The ID of the operation. Unique across all operations for a given order." + }, + "quantity": { + "type": "integer", + "description": "The quantity to cancel.", + "format": "uint32" + }, + "reason": { + "type": "string", + "description": "The reason for the cancellation." + }, + "reasonText": { + "type": "string", + "description": "The explanation of the reason." + } + } + }, + "OrdersCancelLineItemResponse": { + "id": "OrdersCancelLineItemResponse", + "type": "object", + "properties": { + "executionStatus": { + "type": "string", + "description": "The status of the execution." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersCancelLineItemResponse\".", + "default": "content#ordersCancelLineItemResponse" + } + } + }, + "OrdersCancelRequest": { + "id": "OrdersCancelRequest", + "type": "object", + "properties": { + "operationId": { + "type": "string", + "description": "The ID of the operation. Unique across all operations for a given order." + }, + "reason": { + "type": "string", + "description": "The reason for the cancellation." + }, + "reasonText": { + "type": "string", + "description": "The explanation of the reason." + } + } + }, + "OrdersCancelResponse": { + "id": "OrdersCancelResponse", + "type": "object", + "properties": { + "executionStatus": { + "type": "string", + "description": "The status of the execution." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersCancelResponse\".", + "default": "content#ordersCancelResponse" + } + } + }, + "OrdersCreateTestOrderRequest": { + "id": "OrdersCreateTestOrderRequest", + "type": "object", + "properties": { + "templateName": { + "type": "string", + "description": "The test order template to use. Specify as an alternative to testOrder as a shortcut for retrieving a template and then creating an order using that template." + }, + "testOrder": { + "$ref": "TestOrder", + "description": "The test order to create." + } + } + }, + "OrdersCreateTestOrderResponse": { + "id": "OrdersCreateTestOrderResponse", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersCreateTestOrderResponse\".", + "default": "content#ordersCreateTestOrderResponse" + }, + "orderId": { + "type": "string", + "description": "The ID of the newly created test order." + } + } + }, + "OrdersCustomBatchRequest": { + "id": "OrdersCustomBatchRequest", + "type": "object", + "properties": { + "entries": { + "type": "array", + "description": "The request entries to be processed in the batch.", + "items": { + "$ref": "OrdersCustomBatchRequestEntry" + } + } + } + }, + "OrdersCustomBatchRequestEntry": { + "id": "OrdersCustomBatchRequestEntry", + "type": "object", + "properties": { + "batchId": { + "type": "integer", + "description": "An entry ID, unique within the batch request.", + "format": "uint32" + }, + "cancel": { + "$ref": "OrdersCustomBatchRequestEntryCancel", + "description": "Required for cancel method." + }, + "cancelLineItem": { + "$ref": "OrdersCustomBatchRequestEntryCancelLineItem", + "description": "Required for cancelLineItem method." + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "format": "uint64" + }, + "merchantOrderId": { + "type": "string", + "description": "The merchant order id. Required for updateMerchantOrderId and getByMerchantOrderId methods." + }, + "method": { + "type": "string", + "description": "The method to apply." + }, + "operationId": { + "type": "string", + "description": "The ID of the operation. Unique across all operations for a given order. Required for all methods beside get and getByMerchantOrderId." + }, + "orderId": { + "type": "string", + "description": "The ID of the order. Required for all methods beside getByMerchantOrderId." + }, + "refund": { + "$ref": "OrdersCustomBatchRequestEntryRefund", + "description": "Required for refund method." + }, + "returnLineItem": { + "$ref": "OrdersCustomBatchRequestEntryReturnLineItem", + "description": "Required for returnLineItem method." + }, + "shipLineItems": { + "$ref": "OrdersCustomBatchRequestEntryShipLineItems", + "description": "Required for shipLineItems method." + }, + "updateShipment": { + "$ref": "OrdersCustomBatchRequestEntryUpdateShipment", + "description": "Required for updateShipment method." + } + } + }, + "OrdersCustomBatchRequestEntryCancel": { + "id": "OrdersCustomBatchRequestEntryCancel", + "type": "object", + "properties": { + "reason": { + "type": "string", + "description": "The reason for the cancellation." + }, + "reasonText": { + "type": "string", + "description": "The explanation of the reason." + } + } + }, + "OrdersCustomBatchRequestEntryCancelLineItem": { + "id": "OrdersCustomBatchRequestEntryCancelLineItem", + "type": "object", + "properties": { + "lineItemId": { + "type": "string", + "description": "The ID of the line item to cancel." + }, + "quantity": { + "type": "integer", + "description": "The quantity to cancel.", + "format": "uint32" + }, + "reason": { + "type": "string", + "description": "The reason for the cancellation." + }, + "reasonText": { + "type": "string", + "description": "The explanation of the reason." + } + } + }, + "OrdersCustomBatchRequestEntryRefund": { + "id": "OrdersCustomBatchRequestEntryRefund", + "type": "object", + "properties": { + "amount": { + "$ref": "Price", + "description": "The amount that is refunded." + }, + "reason": { + "type": "string", + "description": "The reason for the refund." + }, + "reasonText": { + "type": "string", + "description": "The explanation of the reason." + } + } + }, + "OrdersCustomBatchRequestEntryReturnLineItem": { + "id": "OrdersCustomBatchRequestEntryReturnLineItem", + "type": "object", + "properties": { + "lineItemId": { + "type": "string", + "description": "The ID of the line item to return." + }, + "quantity": { + "type": "integer", + "description": "The quantity to return.", + "format": "uint32" + }, + "reason": { + "type": "string", + "description": "The reason for the return." + }, + "reasonText": { + "type": "string", + "description": "The explanation of the reason." + } + } + }, + "OrdersCustomBatchRequestEntryShipLineItems": { + "id": "OrdersCustomBatchRequestEntryShipLineItems", + "type": "object", + "properties": { + "carrier": { + "type": "string", + "description": "The carrier handling the shipment." + }, + "lineItems": { + "type": "array", + "description": "Line items to ship.", + "items": { + "$ref": "OrderShipmentLineItemShipment" + } + }, + "shipmentId": { + "type": "string", + "description": "The ID of the shipment." + }, + "trackingId": { + "type": "string", + "description": "The tracking id for the shipment." + } + } + }, + "OrdersCustomBatchRequestEntryUpdateShipment": { + "id": "OrdersCustomBatchRequestEntryUpdateShipment", + "type": "object", + "properties": { + "carrier": { + "type": "string", + "description": "The carrier handling the shipment. Not updated if missing." + }, + "shipmentId": { + "type": "string", + "description": "The ID of the shipment." + }, + "status": { + "type": "string", + "description": "New status for the shipment. Not updated if missing." + }, + "trackingId": { + "type": "string", + "description": "The tracking id for the shipment. Not updated if missing." + } + } + }, + "OrdersCustomBatchResponse": { + "id": "OrdersCustomBatchResponse", + "type": "object", + "properties": { + "entries": { + "type": "array", + "description": "The result of the execution of the batch requests.", + "items": { + "$ref": "OrdersCustomBatchResponseEntry" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersCustomBatchResponse\".", + "default": "content#ordersCustomBatchResponse" + } + } + }, + "OrdersCustomBatchResponseEntry": { + "id": "OrdersCustomBatchResponseEntry", + "type": "object", + "properties": { + "batchId": { + "type": "integer", + "description": "The ID of the request entry this entry responds to.", + "format": "uint32" + }, + "errors": { + "$ref": "Errors", + "description": "A list of errors defined if and only if the request failed." + }, + "executionStatus": { + "type": "string", + "description": "The status of the execution. Only defined if the method is not get or getByMerchantOrderId and if the request was successful." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersCustomBatchResponseEntry\".", + "default": "content#ordersCustomBatchResponseEntry" + }, + "order": { + "$ref": "Order", + "description": "The retrieved order. Only defined if the method is get and if the request was successful." + } + } + }, + "OrdersGetByMerchantOrderIdResponse": { + "id": "OrdersGetByMerchantOrderIdResponse", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersGetByMerchantOrderIdResponse\".", + "default": "content#ordersGetByMerchantOrderIdResponse" + }, + "order": { + "$ref": "Order", + "description": "The requested order." + } + } + }, + "OrdersGetTestOrderTemplateResponse": { + "id": "OrdersGetTestOrderTemplateResponse", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersGetTestOrderTemplateResponse\".", + "default": "content#ordersGetTestOrderTemplateResponse" + }, + "template": { + "$ref": "TestOrder", + "description": "The requested test order template." + } + } + }, + "OrdersListResponse": { + "id": "OrdersListResponse", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersListResponse\".", + "default": "content#ordersListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token for the retrieval of the next page of orders." + }, + "resources": { + "type": "array", + "items": { + "$ref": "Order" + } + } + } + }, + "OrdersRefundRequest": { + "id": "OrdersRefundRequest", + "type": "object", + "properties": { + "amount": { + "$ref": "Price", + "description": "The amount that is refunded." + }, + "operationId": { + "type": "string", + "description": "The ID of the operation. Unique across all operations for a given order." + }, + "reason": { + "type": "string", + "description": "The reason for the refund." + }, + "reasonText": { + "type": "string", + "description": "The explanation of the reason." + } + } + }, + "OrdersRefundResponse": { + "id": "OrdersRefundResponse", + "type": "object", + "properties": { + "executionStatus": { + "type": "string", + "description": "The status of the execution." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersRefundResponse\".", + "default": "content#ordersRefundResponse" + } + } + }, + "OrdersReturnLineItemRequest": { + "id": "OrdersReturnLineItemRequest", + "type": "object", + "properties": { + "lineItemId": { + "type": "string", + "description": "The ID of the line item to return." + }, + "operationId": { + "type": "string", + "description": "The ID of the operation. Unique across all operations for a given order." + }, + "quantity": { + "type": "integer", + "description": "The quantity to return.", + "format": "uint32" + }, + "reason": { + "type": "string", + "description": "The reason for the return." + }, + "reasonText": { + "type": "string", + "description": "The explanation of the reason." + } + } + }, + "OrdersReturnLineItemResponse": { + "id": "OrdersReturnLineItemResponse", + "type": "object", + "properties": { + "executionStatus": { + "type": "string", + "description": "The status of the execution." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersReturnLineItemResponse\".", + "default": "content#ordersReturnLineItemResponse" + } + } + }, + "OrdersShipLineItemsRequest": { + "id": "OrdersShipLineItemsRequest", + "type": "object", + "properties": { + "carrier": { + "type": "string", + "description": "The carrier handling the shipment." + }, + "lineItems": { + "type": "array", + "description": "Line items to ship.", + "items": { + "$ref": "OrderShipmentLineItemShipment" + } + }, + "operationId": { + "type": "string", + "description": "The ID of the operation. Unique across all operations for a given order." + }, + "shipmentId": { + "type": "string", + "description": "The ID of the shipment." + }, + "trackingId": { + "type": "string", + "description": "The tracking id for the shipment." + } + } + }, + "OrdersShipLineItemsResponse": { + "id": "OrdersShipLineItemsResponse", + "type": "object", + "properties": { + "executionStatus": { + "type": "string", + "description": "The status of the execution." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersShipLineItemsResponse\".", + "default": "content#ordersShipLineItemsResponse" + } + } + }, + "OrdersUpdateMerchantOrderIdRequest": { + "id": "OrdersUpdateMerchantOrderIdRequest", + "type": "object", + "properties": { + "merchantOrderId": { + "type": "string", + "description": "The merchant order id to be assigned to the order. Must be unique per merchant." + }, + "operationId": { + "type": "string", + "description": "The ID of the operation. Unique across all operations for a given order." + } + } + }, + "OrdersUpdateMerchantOrderIdResponse": { + "id": "OrdersUpdateMerchantOrderIdResponse", + "type": "object", + "properties": { + "executionStatus": { + "type": "string", + "description": "The status of the execution." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersUpdateMerchantOrderIdResponse\".", + "default": "content#ordersUpdateMerchantOrderIdResponse" + } + } + }, + "OrdersUpdateShipmentRequest": { + "id": "OrdersUpdateShipmentRequest", + "type": "object", + "properties": { + "carrier": { + "type": "string", + "description": "The carrier handling the shipment. Not updated if missing." + }, + "operationId": { + "type": "string", + "description": "The ID of the operation. Unique across all operations for a given order." + }, + "shipmentId": { + "type": "string", + "description": "The ID of the shipment." + }, + "status": { + "type": "string", + "description": "New status for the shipment. Not updated if missing." + }, + "trackingId": { + "type": "string", + "description": "The tracking id for the shipment. Not updated if missing." + } + } + }, + "OrdersUpdateShipmentResponse": { + "id": "OrdersUpdateShipmentResponse", + "type": "object", + "properties": { + "executionStatus": { + "type": "string", + "description": "The status of the execution." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersUpdateShipmentResponse\".", + "default": "content#ordersUpdateShipmentResponse" + } + } + }, + "Price": { + "id": "Price", + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "The currency of the price." + }, + "value": { + "type": "string", + "description": "The price represented as a number." + } + } + }, + "Product": { + "id": "Product", + "type": "object", + "description": "Product data.", + "properties": { + "additionalImageLinks": { + "type": "array", + "description": "Additional URLs of images of the item.", + "items": { + "type": "string" + } + }, + "adult": { + "type": "boolean", + "description": "Set to true if the item is targeted towards adults." + }, + "adwordsGrouping": { + "type": "string", + "description": "Used to group items in an arbitrary way. Only for CPA%, discouraged otherwise." + }, + "adwordsLabels": { + "type": "array", + "description": "Similar to adwords_grouping, but only works on CPC.", + "items": { + "type": "string" + } + }, + "adwordsRedirect": { + "type": "string", + "description": "Allows advertisers to override the item URL when the product is shown within the context of Product Ads." + }, + "ageGroup": { + "type": "string", + "description": "Target age group of the item." + }, + "aspects": { + "type": "array", + "description": "Specifies the intended aspects for the product.", + "items": { + "$ref": "ProductAspect" + } + }, + "availability": { + "type": "string", + "description": "Availability status of the item." + }, + "availabilityDate": { + "type": "string", + "description": "The day a pre-ordered product becomes available for delivery, in ISO 8601 format." + }, + "brand": { + "type": "string", + "description": "Brand of the item." + }, + "channel": { + "type": "string", + "description": "The item's channel (online or local).", + "annotations": { + "required": [ + "content.products.insert" + ] + } + }, + "color": { + "type": "string", + "description": "Color of the item." + }, + "condition": { + "type": "string", + "description": "Condition or state of the item." + }, + "contentLanguage": { + "type": "string", + "description": "The two-letter ISO 639-1 language code for the item.", + "annotations": { + "required": [ + "content.products.insert" + ] + } + }, + "customAttributes": { + "type": "array", + "description": "A list of custom (merchant-provided) attributes. It can also be used for submitting any attribute of the feed specification in its generic form (e.g., { \"name\": \"size type\", \"type\": \"text\", \"value\": \"regular\" }). This is useful for submitting attributes not explicitly exposed by the API.", + "items": { + "$ref": "ProductCustomAttribute" + } + }, + "customGroups": { + "type": "array", + "description": "A list of custom (merchant-provided) custom attribute groups.", + "items": { + "$ref": "ProductCustomGroup" + } + }, + "customLabel0": { + "type": "string", + "description": "Custom label 0 for custom grouping of items in a Shopping campaign." + }, + "customLabel1": { + "type": "string", + "description": "Custom label 1 for custom grouping of items in a Shopping campaign." + }, + "customLabel2": { + "type": "string", + "description": "Custom label 2 for custom grouping of items in a Shopping campaign." + }, + "customLabel3": { + "type": "string", + "description": "Custom label 3 for custom grouping of items in a Shopping campaign." + }, + "customLabel4": { + "type": "string", + "description": "Custom label 4 for custom grouping of items in a Shopping campaign." + }, + "description": { + "type": "string", + "description": "Description of the item." + }, + "destinations": { + "type": "array", + "description": "Specifies the intended destinations for the product.", + "items": { + "$ref": "ProductDestination" + } + }, + "displayAdsId": { + "type": "string", + "description": "An identifier for an item for dynamic remarketing campaigns." + }, + "displayAdsLink": { + "type": "string", + "description": "URL directly to your item's landing page for dynamic remarketing campaigns." + }, + "displayAdsSimilarIds": { + "type": "array", + "description": "Advertiser-specified recommendations.", + "items": { + "type": "string" + } + }, + "displayAdsTitle": { + "type": "string", + "description": "Title of an item for dynamic remarketing campaigns." + }, + "displayAdsValue": { + "type": "number", + "description": "Offer margin for dynamic remarketing campaigns.", + "format": "double" + }, + "energyEfficiencyClass": { + "type": "string", + "description": "The energy efficiency class as defined in EU directive 2010/30/EU." + }, + "expirationDate": { + "type": "string", + "description": "Date on which the item should expire, as specified upon insertion, in ISO 8601 format. The actual expiration date in Google Shopping is exposed in productstatuses as googleExpirationDate and might be earlier if expirationDate is too far in the future." + }, + "gender": { + "type": "string", + "description": "Target gender of the item." + }, + "googleProductCategory": { + "type": "string", + "description": "Google's category of the item (see Google product taxonomy)." + }, + "gtin": { + "type": "string", + "description": "Global Trade Item Number (GTIN) of the item." + }, + "id": { + "type": "string", + "description": "The REST id of the product." + }, + "identifierExists": { + "type": "boolean", + "description": "False when the item does not have unique product identifiers appropriate to its category, such as GTIN, MPN, and brand. Required according to the Unique Product Identifier Rules for all target countries except for Canada." + }, + "imageLink": { + "type": "string", + "description": "URL of an image of the item." + }, + "installment": { + "$ref": "ProductInstallment", + "description": "Number and amount of installments to pay for an item. Brazil only." + }, + "isBundle": { + "type": "boolean", + "description": "Whether the item is a merchant-defined bundle. A bundle is a custom grouping of different products sold by a merchant for a single price." + }, + "itemGroupId": { + "type": "string", + "description": "Shared identifier for all variants of the same product." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#product\".", + "default": "content#product" + }, + "link": { + "type": "string", + "description": "URL directly linking to your item's page on your website." + }, + "loyaltyPoints": { + "$ref": "LoyaltyPoints", + "description": "Loyalty points that users receive after purchasing the item. Japan only." + }, + "material": { + "type": "string", + "description": "The material of which the item is made." + }, + "mobileLink": { + "type": "string", + "description": "Link to a mobile-optimized version of the landing page." + }, + "mpn": { + "type": "string", + "description": "Manufacturer Part Number (MPN) of the item." + }, + "multipack": { + "type": "string", + "description": "The number of identical products in a merchant-defined multipack.", + "format": "int64" + }, + "offerId": { + "type": "string", + "description": "An identifier of the item.", + "annotations": { + "required": [ + "content.products.insert" + ] + } + }, + "onlineOnly": { + "type": "boolean", + "description": "Whether an item is available for purchase only online." + }, + "pattern": { + "type": "string", + "description": "The item's pattern (e.g. polka dots)." + }, + "price": { + "$ref": "Price", + "description": "Price of the item." + }, + "productType": { + "type": "string", + "description": "Your category of the item (formatted as in product feeds specification)." + }, + "salePrice": { + "$ref": "Price", + "description": "Advertised sale price of the item." + }, + "salePriceEffectiveDate": { + "type": "string", + "description": "Date range during which the item is on sale (see product feed specifications)." + }, + "sellOnGoogleQuantity": { + "type": "string", + "description": "The quantity of the product that is reserved for sell-on-google ads.", + "format": "int64" + }, + "shipping": { + "type": "array", + "description": "Shipping rules.", + "items": { + "$ref": "ProductShipping" + } + }, + "shippingHeight": { + "$ref": "ProductShippingDimension", + "description": "Height of the item for shipping." + }, + "shippingLabel": { + "type": "string", + "description": "The shipping label of the product, used to group product in account-level shipping rules." + }, + "shippingLength": { + "$ref": "ProductShippingDimension", + "description": "Length of the item for shipping." + }, + "shippingWeight": { + "$ref": "ProductShippingWeight", + "description": "Weight of the item for shipping." + }, + "shippingWidth": { + "$ref": "ProductShippingDimension", + "description": "Width of the item for shipping." + }, + "sizeSystem": { + "type": "string", + "description": "System in which the size is specified. Recommended for apparel items." + }, + "sizeType": { + "type": "string", + "description": "The cut of the item. Recommended for apparel items." + }, + "sizes": { + "type": "array", + "description": "Size of the item.", + "items": { + "type": "string" + } + }, + "targetCountry": { + "type": "string", + "description": "The CLDR territory code for the item.", + "annotations": { + "required": [ + "content.products.insert" + ] + } + }, + "taxes": { + "type": "array", + "description": "Tax information.", + "items": { + "$ref": "ProductTax" + } + }, + "title": { + "type": "string", + "description": "Title of the item." + }, + "unitPricingBaseMeasure": { + "$ref": "ProductUnitPricingBaseMeasure", + "description": "The preference of the denominator of the unit price." + }, + "unitPricingMeasure": { + "$ref": "ProductUnitPricingMeasure", + "description": "The measure and dimension of an item." + }, + "validatedDestinations": { + "type": "array", + "description": "The read-only list of intended destinations which passed validation.", + "items": { + "type": "string" + } + }, + "warnings": { + "type": "array", + "description": "Read-only warnings.", + "items": { + "$ref": "Error" + } + } + } + }, + "ProductAspect": { + "id": "ProductAspect", + "type": "object", + "properties": { + "aspectName": { + "type": "string", + "description": "The name of the aspect." + }, + "destinationName": { + "type": "string", + "description": "The name of the destination. Leave out to apply to all destinations." + }, + "intention": { + "type": "string", + "description": "Whether the aspect is required, excluded or should be validated." + } + } + }, + "ProductCustomAttribute": { + "id": "ProductCustomAttribute", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the attribute. Underscores will be replaced by spaces upon insertion." + }, + "type": { + "type": "string", + "description": "The type of the attribute." + }, + "unit": { + "type": "string", + "description": "Free-form unit of the attribute. Unit can only be used for values of type INT or FLOAT." + }, + "value": { + "type": "string", + "description": "The value of the attribute." + } + } + }, + "ProductCustomGroup": { + "id": "ProductCustomGroup", + "type": "object", + "properties": { + "attributes": { + "type": "array", + "description": "The sub-attributes.", + "items": { + "$ref": "ProductCustomAttribute" + } + }, + "name": { + "type": "string", + "description": "The name of the group. Underscores will be replaced by spaces upon insertion." + } + } + }, + "ProductDestination": { + "id": "ProductDestination", + "type": "object", + "properties": { + "destinationName": { + "type": "string", + "description": "The name of the destination." + }, + "intention": { + "type": "string", + "description": "Whether the destination is required, excluded or should be validated." + } + } + }, + "ProductInstallment": { + "id": "ProductInstallment", + "type": "object", + "properties": { + "amount": { + "$ref": "Price", + "description": "The amount the buyer has to pay per month." + }, + "months": { + "type": "string", + "description": "The number of installments the buyer has to pay.", + "format": "int64" + } + } + }, + "ProductShipping": { + "id": "ProductShipping", + "type": "object", + "properties": { + "country": { + "type": "string", + "description": "The CLDR territory code of the country to which an item will ship." + }, + "locationGroupName": { + "type": "string", + "description": "The location where the shipping is applicable, represented by a location group name." + }, + "locationId": { + "type": "string", + "description": "The numeric id of a location that the shipping rate applies to as defined in the AdWords API.", + "format": "int64" + }, + "postalCode": { + "type": "string", + "description": "The postal code range that the shipping rate applies to, represented by a postal code, a postal code prefix followed by a * wildcard, a range between two postal codes or two postal code prefixes of equal length." + }, + "price": { + "$ref": "Price", + "description": "Fixed shipping price, represented as a number." + }, + "region": { + "type": "string", + "description": "The geographic region to which a shipping rate applies (e.g. zip code)." + }, + "service": { + "type": "string", + "description": "A free-form description of the service class or delivery speed." + } + } + }, + "ProductShippingDimension": { + "id": "ProductShippingDimension", + "type": "object", + "properties": { + "unit": { + "type": "string", + "description": "The unit of value.\n\nAcceptable values are: \n- \"cm\" \n- \"in\"" + }, + "value": { + "type": "number", + "description": "The dimension of the product used to calculate the shipping cost of the item.", + "format": "double" + } + } + }, + "ProductShippingWeight": { + "id": "ProductShippingWeight", + "type": "object", + "properties": { + "unit": { + "type": "string", + "description": "The unit of value." + }, + "value": { + "type": "number", + "description": "The weight of the product used to calculate the shipping cost of the item.", + "format": "double" + } + } + }, + "ProductStatus": { + "id": "ProductStatus", + "type": "object", + "description": "The status of a product, i.e., information about a product computed asynchronously by the data quality analysis.", + "properties": { + "creationDate": { + "type": "string", + "description": "Date on which the item has been created, in ISO 8601 format." + }, + "dataQualityIssues": { + "type": "array", + "description": "A list of data quality issues associated with the product.", + "items": { + "$ref": "ProductStatusDataQualityIssue" + } + }, + "destinationStatuses": { + "type": "array", + "description": "The intended destinations for the product.", + "items": { + "$ref": "ProductStatusDestinationStatus" + } + }, + "googleExpirationDate": { + "type": "string", + "description": "Date on which the item expires in Google Shopping, in ISO 8601 format." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#productStatus\".", + "default": "content#productStatus" + }, + "lastUpdateDate": { + "type": "string", + "description": "Date on which the item has been last updated, in ISO 8601 format." + }, + "link": { + "type": "string", + "description": "The link to the product." + }, + "productId": { + "type": "string", + "description": "The id of the product for which status is reported." + }, + "title": { + "type": "string", + "description": "The title of the product." + } + } + }, + "ProductStatusDataQualityIssue": { + "id": "ProductStatusDataQualityIssue", + "type": "object", + "properties": { + "detail": { + "type": "string", + "description": "A more detailed error string." + }, + "fetchStatus": { + "type": "string", + "description": "The fetch status for landing_page_errors." + }, + "id": { + "type": "string", + "description": "The id of the data quality issue." + }, + "location": { + "type": "string", + "description": "The attribute name that is relevant for the issue." + }, + "severity": { + "type": "string", + "description": "The severity of the data quality issue." + }, + "timestamp": { + "type": "string", + "description": "The time stamp of the data quality issue." + }, + "valueOnLandingPage": { + "type": "string", + "description": "The value of that attribute that was found on the landing page" + }, + "valueProvided": { + "type": "string", + "description": "The value the attribute had at time of evaluation." + } + } + }, + "ProductStatusDestinationStatus": { + "id": "ProductStatusDestinationStatus", + "type": "object", + "properties": { + "approvalStatus": { + "type": "string", + "description": "The destination's approval status." + }, + "destination": { + "type": "string", + "description": "The name of the destination" + }, + "intention": { + "type": "string", + "description": "Whether the destination is required, excluded, selected by default or should be validated." + } + } + }, + "ProductTax": { + "id": "ProductTax", + "type": "object", + "properties": { + "country": { + "type": "string", + "description": "The country within which the item is taxed, specified as a CLDR territory code." + }, + "locationId": { + "type": "string", + "description": "The numeric id of a location that the tax rate applies to as defined in the AdWords API.", + "format": "int64" + }, + "postalCode": { + "type": "string", + "description": "The postal code range that the tax rate applies to, represented by a ZIP code, a ZIP code prefix using * wildcard, a range between two ZIP codes or two ZIP code prefixes of equal length. Examples: 94114, 94*, 94002-95460, 94*-95*." + }, + "rate": { + "type": "number", + "description": "The percentage of tax rate that applies to the item price.", + "format": "double" + }, + "region": { + "type": "string", + "description": "The geographic region to which the tax rate applies." + }, + "taxShip": { + "type": "boolean", + "description": "Set to true if tax is charged on shipping." + } + } + }, + "ProductUnitPricingBaseMeasure": { + "id": "ProductUnitPricingBaseMeasure", + "type": "object", + "properties": { + "unit": { + "type": "string", + "description": "The unit of the denominator." + }, + "value": { + "type": "string", + "description": "The denominator of the unit price.", + "format": "int64" + } + } + }, + "ProductUnitPricingMeasure": { + "id": "ProductUnitPricingMeasure", + "type": "object", + "properties": { + "unit": { + "type": "string", + "description": "The unit of the measure." + }, + "value": { + "type": "number", + "description": "The measure of an item.", + "format": "double" + } + } + }, + "ProductsCustomBatchRequest": { + "id": "ProductsCustomBatchRequest", + "type": "object", + "properties": { + "entries": { + "type": "array", + "description": "The request entries to be processed in the batch.", + "items": { + "$ref": "ProductsCustomBatchRequestEntry" + } + } + } + }, + "ProductsCustomBatchRequestEntry": { + "id": "ProductsCustomBatchRequestEntry", + "type": "object", + "description": "A batch entry encoding a single non-batch products request.", + "properties": { + "batchId": { + "type": "integer", + "description": "An entry ID, unique within the batch request.", + "format": "uint32" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "format": "uint64" + }, + "method": { + "type": "string" + }, + "product": { + "$ref": "Product", + "description": "The product to insert. Only required if the method is insert." + }, + "productId": { + "type": "string", + "description": "The ID of the product to get or delete. Only defined if the method is get or delete." + } + } + }, + "ProductsCustomBatchResponse": { + "id": "ProductsCustomBatchResponse", + "type": "object", + "properties": { + "entries": { + "type": "array", + "description": "The result of the execution of the batch requests.", + "items": { + "$ref": "ProductsCustomBatchResponseEntry" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#productsCustomBatchResponse\".", + "default": "content#productsCustomBatchResponse" + } + } + }, + "ProductsCustomBatchResponseEntry": { + "id": "ProductsCustomBatchResponseEntry", + "type": "object", + "description": "A batch entry encoding a single non-batch products response.", + "properties": { + "batchId": { + "type": "integer", + "description": "The ID of the request entry this entry responds to.", + "format": "uint32" + }, + "errors": { + "$ref": "Errors", + "description": "A list of errors defined if and only if the request failed." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#productsCustomBatchResponseEntry\".", + "default": "content#productsCustomBatchResponseEntry" + }, + "product": { + "$ref": "Product", + "description": "The inserted product. Only defined if the method is insert and if the request was successful." + } + } + }, + "ProductsListResponse": { + "id": "ProductsListResponse", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#productsListResponse\".", + "default": "content#productsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token for the retrieval of the next page of products." + }, + "resources": { + "type": "array", + "items": { + "$ref": "Product" + } + } + } + }, + "ProductstatusesCustomBatchRequest": { + "id": "ProductstatusesCustomBatchRequest", + "type": "object", + "properties": { + "entries": { + "type": "array", + "description": "The request entries to be processed in the batch.", + "items": { + "$ref": "ProductstatusesCustomBatchRequestEntry" + } + } + } + }, + "ProductstatusesCustomBatchRequestEntry": { + "id": "ProductstatusesCustomBatchRequestEntry", + "type": "object", + "description": "A batch entry encoding a single non-batch productstatuses request.", + "properties": { + "batchId": { + "type": "integer", + "description": "An entry ID, unique within the batch request.", + "format": "uint32" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "format": "uint64" + }, + "method": { + "type": "string" + }, + "productId": { + "type": "string", + "description": "The ID of the product whose status to get." + } + } + }, + "ProductstatusesCustomBatchResponse": { + "id": "ProductstatusesCustomBatchResponse", + "type": "object", + "properties": { + "entries": { + "type": "array", + "description": "The result of the execution of the batch requests.", + "items": { + "$ref": "ProductstatusesCustomBatchResponseEntry" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#productstatusesCustomBatchResponse\".", + "default": "content#productstatusesCustomBatchResponse" + } + } + }, + "ProductstatusesCustomBatchResponseEntry": { + "id": "ProductstatusesCustomBatchResponseEntry", + "type": "object", + "description": "A batch entry encoding a single non-batch productstatuses response.", + "properties": { + "batchId": { + "type": "integer", + "description": "The ID of the request entry this entry responds to.", + "format": "uint32" + }, + "errors": { + "$ref": "Errors", + "description": "A list of errors, if the request failed." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#productstatusesCustomBatchResponseEntry\".", + "default": "content#productstatusesCustomBatchResponseEntry" + }, + "productStatus": { + "$ref": "ProductStatus", + "description": "The requested product status. Only defined if the request was successful." + } + } + }, + "ProductstatusesListResponse": { + "id": "ProductstatusesListResponse", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#productstatusesListResponse\".", + "default": "content#productstatusesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token for the retrieval of the next page of products statuses." + }, + "resources": { + "type": "array", + "items": { + "$ref": "ProductStatus" + } + } + } + }, + "TestOrder": { + "id": "TestOrder", + "type": "object", + "properties": { + "customer": { + "$ref": "TestOrderCustomer", + "description": "The details of the customer who placed the order.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#testOrder\".", + "default": "content#testOrder" + }, + "lineItems": { + "type": "array", + "description": "Line items that are ordered. At least one line item must be provided.", + "items": { + "$ref": "TestOrderLineItem" + }, + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "paymentMethod": { + "$ref": "TestOrderPaymentMethod", + "description": "The details of the payment method." + }, + "predefinedDeliveryAddress": { + "type": "string", + "description": "Identifier of one of the predefined delivery addresses for the delivery.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "shippingCost": { + "$ref": "Price", + "description": "The total cost of shipping for all items.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "shippingCostTax": { + "$ref": "Price", + "description": "The tax for the total shipping cost.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "shippingOption": { + "type": "string", + "description": "The requested shipping option.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + } + } + }, + "TestOrderCustomer": { + "id": "TestOrderCustomer", + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email address of the customer.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "explicitMarketingPreference": { + "type": "boolean", + "description": "If set, this indicates the user had a choice to opt in or out of providing marketing rights to the merchant. If unset, this indicates the user has already made this choice in a previous purchase, and was thus not shown the marketing right opt in/out checkbox during the Purchases on Google checkout flow. Optional." + }, + "fullName": { + "type": "string", + "description": "Full name of the customer." + } + } + }, + "TestOrderLineItem": { + "id": "TestOrderLineItem", + "type": "object", + "properties": { + "product": { + "$ref": "TestOrderLineItemProduct", + "description": "Product data from the time of the order placement." + }, + "quantityOrdered": { + "type": "integer", + "description": "Number of items ordered.", + "format": "uint32", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "returnInfo": { + "$ref": "OrderLineItemReturnInfo", + "description": "Details of the return policy for the line item.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "shippingDetails": { + "$ref": "OrderLineItemShippingDetails", + "description": "Details of the requested shipping for the line item.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "unitTax": { + "$ref": "Price", + "description": "Unit tax for the line item.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + } + } + }, + "TestOrderLineItemProduct": { + "id": "TestOrderLineItemProduct", + "type": "object", + "properties": { + "brand": { + "type": "string", + "description": "Brand of the item.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "channel": { + "type": "string", + "description": "The item's channel.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "condition": { + "type": "string", + "description": "Condition or state of the item.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "contentLanguage": { + "type": "string", + "description": "The two-letter ISO 639-1 language code for the item.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "gtin": { + "type": "string", + "description": "Global Trade Item Number (GTIN) of the item. Optional." + }, + "imageLink": { + "type": "string", + "description": "URL of an image of the item.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "itemGroupId": { + "type": "string", + "description": "Shared identifier for all variants of the same product. Optional." + }, + "mpn": { + "type": "string", + "description": "Manufacturer Part Number (MPN) of the item. Optional." + }, + "offerId": { + "type": "string", + "description": "An identifier of the item.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "price": { + "$ref": "Price", + "description": "The price for the product.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "targetCountry": { + "type": "string", + "description": "The CLDR territory code of the target country of the product.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "title": { + "type": "string", + "description": "The title of the product.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "variantAttributes": { + "type": "array", + "description": "Variant attributes for the item. Optional.", + "items": { + "$ref": "OrderLineItemProductVariantAttribute" + } + } + } + }, + "TestOrderPaymentMethod": { + "id": "TestOrderPaymentMethod", + "type": "object", + "properties": { + "expirationMonth": { + "type": "integer", + "description": "The card expiration month (January = 1, February = 2 etc.).", + "format": "int32" + }, + "expirationYear": { + "type": "integer", + "description": "The card expiration year (4-digit, e.g. 2015).", + "format": "int32" + }, + "lastFourDigits": { + "type": "string", + "description": "The last four digits of the card number." + }, + "predefinedBillingAddress": { + "type": "string", + "description": "The billing address." + }, + "type": { + "type": "string", + "description": "The type of instrument. Note that real orders might have different values than the four values accepted by createTestOrder." + } + } + }, + "Weight": { + "id": "Weight", + "type": "object", + "properties": { + "unit": { + "type": "string", + "description": "The weight unit.", + "annotations": { + "required": [ + "content.accountshipping.update" + ] + } + }, + "value": { + "type": "string", + "description": "The weight represented as a number.", + "annotations": { + "required": [ + "content.accountshipping.update" + ] + } + } + } + } + }, + "resources": { + "accounts": { + "methods": { + "authinfo": { + "id": "content.accounts.authinfo", + "path": "accounts/authinfo", + "httpMethod": "GET", + "description": "Returns information about the authenticated user.", + "response": { + "$ref": "AccountsAuthInfoResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "custombatch": { + "id": "content.accounts.custombatch", + "path": "accounts/batch", + "httpMethod": "POST", + "description": "Retrieves, inserts, updates, and deletes multiple Merchant Center (sub-)accounts in a single request.", + "parameters": { + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + } + }, + "request": { + "$ref": "AccountsCustomBatchRequest" + }, + "response": { + "$ref": "AccountsCustomBatchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "delete": { + "id": "content.accounts.delete", + "path": "{merchantId}/accounts/{accountId}", + "httpMethod": "DELETE", + "description": "Deletes a Merchant Center sub-account.", + "parameters": { + "accountId": { + "type": "string", + "description": "The ID of the account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "accountId" + ], + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "id": "content.accounts.get", + "path": "{merchantId}/accounts/{accountId}", + "httpMethod": "GET", + "description": "Retrieves a Merchant Center account.", + "parameters": { + "accountId": { + "type": "string", + "description": "The ID of the account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "accountId" + ], + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "insert": { + "id": "content.accounts.insert", + "path": "{merchantId}/accounts", + "httpMethod": "POST", + "description": "Creates a Merchant Center sub-account.", + "parameters": { + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + } + }, + "parameterOrder": [ + "merchantId" + ], + "request": { + "$ref": "Account" + }, + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "id": "content.accounts.list", + "path": "{merchantId}/accounts", + "httpMethod": "GET", + "description": "Lists the sub-accounts in your Merchant Center account.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of accounts to return in the response, used for paging.", + "format": "uint32", + "location": "query" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "pageToken": { + "type": "string", + "description": "The token returned by the previous request.", + "location": "query" + } + }, + "parameterOrder": [ + "merchantId" + ], + "response": { + "$ref": "AccountsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "patch": { + "id": "content.accounts.patch", + "path": "{merchantId}/accounts/{accountId}", + "httpMethod": "PATCH", + "description": "Updates a Merchant Center account. This method supports patch semantics.", + "parameters": { + "accountId": { + "type": "string", + "description": "The ID of the account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "accountId" + ], + "request": { + "$ref": "Account" + }, + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "update": { + "id": "content.accounts.update", + "path": "{merchantId}/accounts/{accountId}", + "httpMethod": "PUT", + "description": "Updates a Merchant Center account.", + "parameters": { + "accountId": { + "type": "string", + "description": "The ID of the account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "accountId" + ], + "request": { + "$ref": "Account" + }, + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "accountshipping": { + "methods": { + "custombatch": { + "id": "content.accountshipping.custombatch", + "path": "accountshipping/batch", + "httpMethod": "POST", + "description": "Retrieves and updates the shipping settings of multiple accounts in a single request.", + "parameters": { + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + } + }, + "request": { + "$ref": "AccountshippingCustomBatchRequest" + }, + "response": { + "$ref": "AccountshippingCustomBatchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "id": "content.accountshipping.get", + "path": "{merchantId}/accountshipping/{accountId}", + "httpMethod": "GET", + "description": "Retrieves the shipping settings of the account.", + "parameters": { + "accountId": { + "type": "string", + "description": "The ID of the account for which to get/update account shipping settings.", + "required": true, + "format": "uint64", + "location": "path" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "accountId" + ], + "response": { + "$ref": "AccountShipping" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "id": "content.accountshipping.list", + "path": "{merchantId}/accountshipping", + "httpMethod": "GET", + "description": "Lists the shipping settings of the sub-accounts in your Merchant Center account.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of shipping settings to return in the response, used for paging.", + "format": "uint32", + "location": "query" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "pageToken": { + "type": "string", + "description": "The token returned by the previous request.", + "location": "query" + } + }, + "parameterOrder": [ + "merchantId" + ], + "response": { + "$ref": "AccountshippingListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "patch": { + "id": "content.accountshipping.patch", + "path": "{merchantId}/accountshipping/{accountId}", + "httpMethod": "PATCH", + "description": "Updates the shipping settings of the account. This method supports patch semantics.", + "parameters": { + "accountId": { + "type": "string", + "description": "The ID of the account for which to get/update account shipping settings.", + "required": true, + "format": "uint64", + "location": "path" + }, + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "accountId" + ], + "request": { + "$ref": "AccountShipping" + }, + "response": { + "$ref": "AccountShipping" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "update": { + "id": "content.accountshipping.update", + "path": "{merchantId}/accountshipping/{accountId}", + "httpMethod": "PUT", + "description": "Updates the shipping settings of the account.", + "parameters": { + "accountId": { + "type": "string", + "description": "The ID of the account for which to get/update account shipping settings.", + "required": true, + "format": "uint64", + "location": "path" + }, + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "accountId" + ], + "request": { + "$ref": "AccountShipping" + }, + "response": { + "$ref": "AccountShipping" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "accountstatuses": { + "methods": { + "custombatch": { + "id": "content.accountstatuses.custombatch", + "path": "accountstatuses/batch", + "httpMethod": "POST", + "request": { + "$ref": "AccountstatusesCustomBatchRequest" + }, + "response": { + "$ref": "AccountstatusesCustomBatchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "id": "content.accountstatuses.get", + "path": "{merchantId}/accountstatuses/{accountId}", + "httpMethod": "GET", + "description": "Retrieves the status of a Merchant Center account.", + "parameters": { + "accountId": { + "type": "string", + "description": "The ID of the account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "accountId" + ], + "response": { + "$ref": "AccountStatus" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "id": "content.accountstatuses.list", + "path": "{merchantId}/accountstatuses", + "httpMethod": "GET", + "description": "Lists the statuses of the sub-accounts in your Merchant Center account.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of account statuses to return in the response, used for paging.", + "format": "uint32", + "location": "query" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "pageToken": { + "type": "string", + "description": "The token returned by the previous request.", + "location": "query" + } + }, + "parameterOrder": [ + "merchantId" + ], + "response": { + "$ref": "AccountstatusesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "accounttax": { + "methods": { + "custombatch": { + "id": "content.accounttax.custombatch", + "path": "accounttax/batch", + "httpMethod": "POST", + "description": "Retrieves and updates tax settings of multiple accounts in a single request.", + "parameters": { + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + } + }, + "request": { + "$ref": "AccounttaxCustomBatchRequest" + }, + "response": { + "$ref": "AccounttaxCustomBatchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "id": "content.accounttax.get", + "path": "{merchantId}/accounttax/{accountId}", + "httpMethod": "GET", + "description": "Retrieves the tax settings of the account.", + "parameters": { + "accountId": { + "type": "string", + "description": "The ID of the account for which to get/update account tax settings.", + "required": true, + "format": "uint64", + "location": "path" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "accountId" + ], + "response": { + "$ref": "AccountTax" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "id": "content.accounttax.list", + "path": "{merchantId}/accounttax", + "httpMethod": "GET", + "description": "Lists the tax settings of the sub-accounts in your Merchant Center account.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of tax settings to return in the response, used for paging.", + "format": "uint32", + "location": "query" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "pageToken": { + "type": "string", + "description": "The token returned by the previous request.", + "location": "query" + } + }, + "parameterOrder": [ + "merchantId" + ], + "response": { + "$ref": "AccounttaxListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "patch": { + "id": "content.accounttax.patch", + "path": "{merchantId}/accounttax/{accountId}", + "httpMethod": "PATCH", + "description": "Updates the tax settings of the account. This method supports patch semantics.", + "parameters": { + "accountId": { + "type": "string", + "description": "The ID of the account for which to get/update account tax settings.", + "required": true, + "format": "uint64", + "location": "path" + }, + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "accountId" + ], + "request": { + "$ref": "AccountTax" + }, + "response": { + "$ref": "AccountTax" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "update": { + "id": "content.accounttax.update", + "path": "{merchantId}/accounttax/{accountId}", + "httpMethod": "PUT", + "description": "Updates the tax settings of the account.", + "parameters": { + "accountId": { + "type": "string", + "description": "The ID of the account for which to get/update account tax settings.", + "required": true, + "format": "uint64", + "location": "path" + }, + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "accountId" + ], + "request": { + "$ref": "AccountTax" + }, + "response": { + "$ref": "AccountTax" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "datafeeds": { + "methods": { + "custombatch": { + "id": "content.datafeeds.custombatch", + "path": "datafeeds/batch", + "httpMethod": "POST", + "parameters": { + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + } + }, + "request": { + "$ref": "DatafeedsCustomBatchRequest" + }, + "response": { + "$ref": "DatafeedsCustomBatchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "delete": { + "id": "content.datafeeds.delete", + "path": "{merchantId}/datafeeds/{datafeedId}", + "httpMethod": "DELETE", + "description": "Deletes a datafeed from your Merchant Center account.", + "parameters": { + "datafeedId": { + "type": "string", + "required": true, + "format": "uint64", + "location": "path" + }, + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + }, + "merchantId": { + "type": "string", + "required": true, + "format": "uint64", + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "datafeedId" + ], + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "id": "content.datafeeds.get", + "path": "{merchantId}/datafeeds/{datafeedId}", + "httpMethod": "GET", + "description": "Retrieves a datafeed from your Merchant Center account.", + "parameters": { + "datafeedId": { + "type": "string", + "required": true, + "format": "uint64", + "location": "path" + }, + "merchantId": { + "type": "string", + "required": true, + "format": "uint64", + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "datafeedId" + ], + "response": { + "$ref": "Datafeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "insert": { + "id": "content.datafeeds.insert", + "path": "{merchantId}/datafeeds", + "httpMethod": "POST", + "description": "Registers a datafeed with your Merchant Center account.", + "parameters": { + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + }, + "merchantId": { + "type": "string", + "required": true, + "format": "uint64", + "location": "path" + } + }, + "parameterOrder": [ + "merchantId" + ], + "request": { + "$ref": "Datafeed" + }, + "response": { + "$ref": "Datafeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "id": "content.datafeeds.list", + "path": "{merchantId}/datafeeds", + "httpMethod": "GET", + "description": "Lists the datafeeds in your Merchant Center account.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of products to return in the response, used for paging.", + "format": "uint32", + "location": "query" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "pageToken": { + "type": "string", + "description": "The token returned by the previous request.", + "location": "query" + } + }, + "parameterOrder": [ + "merchantId" + ], + "response": { + "$ref": "DatafeedsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "patch": { + "id": "content.datafeeds.patch", + "path": "{merchantId}/datafeeds/{datafeedId}", + "httpMethod": "PATCH", + "description": "Updates a datafeed of your Merchant Center account. This method supports patch semantics.", + "parameters": { + "datafeedId": { + "type": "string", + "required": true, + "format": "uint64", + "location": "path" + }, + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + }, + "merchantId": { + "type": "string", + "required": true, + "format": "uint64", + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "datafeedId" + ], + "request": { + "$ref": "Datafeed" + }, + "response": { + "$ref": "Datafeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "update": { + "id": "content.datafeeds.update", + "path": "{merchantId}/datafeeds/{datafeedId}", + "httpMethod": "PUT", + "description": "Updates a datafeed of your Merchant Center account.", + "parameters": { + "datafeedId": { + "type": "string", + "required": true, + "format": "uint64", + "location": "path" + }, + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + }, + "merchantId": { + "type": "string", + "required": true, + "format": "uint64", + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "datafeedId" + ], + "request": { + "$ref": "Datafeed" + }, + "response": { + "$ref": "Datafeed" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "datafeedstatuses": { + "methods": { + "custombatch": { + "id": "content.datafeedstatuses.custombatch", + "path": "datafeedstatuses/batch", + "httpMethod": "POST", + "request": { + "$ref": "DatafeedstatusesCustomBatchRequest" + }, + "response": { + "$ref": "DatafeedstatusesCustomBatchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "id": "content.datafeedstatuses.get", + "path": "{merchantId}/datafeedstatuses/{datafeedId}", + "httpMethod": "GET", + "description": "Retrieves the status of a datafeed from your Merchant Center account.", + "parameters": { + "datafeedId": { + "type": "string", + "required": true, + "format": "uint64", + "location": "path" + }, + "merchantId": { + "type": "string", + "required": true, + "format": "uint64", + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "datafeedId" + ], + "response": { + "$ref": "DatafeedStatus" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "id": "content.datafeedstatuses.list", + "path": "{merchantId}/datafeedstatuses", + "httpMethod": "GET", + "description": "Lists the statuses of the datafeeds in your Merchant Center account.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of products to return in the response, used for paging.", + "format": "uint32", + "location": "query" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "pageToken": { + "type": "string", + "description": "The token returned by the previous request.", + "location": "query" + } + }, + "parameterOrder": [ + "merchantId" + ], + "response": { + "$ref": "DatafeedstatusesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "inventory": { + "methods": { + "custombatch": { + "id": "content.inventory.custombatch", + "path": "inventory/batch", + "httpMethod": "POST", + "description": "Updates price and availability for multiple products or stores in a single request. This operation does not update the expiration date of the products.", + "parameters": { + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + } + }, + "request": { + "$ref": "InventoryCustomBatchRequest" + }, + "response": { + "$ref": "InventoryCustomBatchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "set": { + "id": "content.inventory.set", + "path": "{merchantId}/inventory/{storeCode}/products/{productId}", + "httpMethod": "POST", + "description": "Updates price and availability of a product in your Merchant Center account. This operation does not update the expiration date of the product.", + "parameters": { + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "productId": { + "type": "string", + "description": "The ID of the product for which to update price and availability.", + "required": true, + "location": "path" + }, + "storeCode": { + "type": "string", + "description": "The code of the store for which to update price and availability. Use online to update price and availability of an online product.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "storeCode", + "productId" + ], + "request": { + "$ref": "InventorySetRequest" + }, + "response": { + "$ref": "InventorySetResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "orders": { + "methods": { + "acknowledge": { + "id": "content.orders.acknowledge", + "path": "{merchantId}/orders/{orderId}/acknowledge", + "httpMethod": "POST", + "description": "Marks an order as acknowledged.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "orderId": { + "type": "string", + "description": "The ID of the order.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "orderId" + ], + "request": { + "$ref": "OrdersAcknowledgeRequest" + }, + "response": { + "$ref": "OrdersAcknowledgeResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "advancetestorder": { + "id": "content.orders.advancetestorder", + "path": "{merchantId}/testorders/{orderId}/advance", + "httpMethod": "POST", + "description": "Sandbox only. Moves a test order from state \"inProgress\" to state \"pendingShipment\".", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "orderId": { + "type": "string", + "description": "The ID of the test order to modify.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "orderId" + ], + "response": { + "$ref": "OrdersAdvanceTestOrderResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "cancel": { + "id": "content.orders.cancel", + "path": "{merchantId}/orders/{orderId}/cancel", + "httpMethod": "POST", + "description": "Cancels all line items in an order.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "orderId": { + "type": "string", + "description": "The ID of the order to cancel.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "orderId" + ], + "request": { + "$ref": "OrdersCancelRequest" + }, + "response": { + "$ref": "OrdersCancelResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "cancellineitem": { + "id": "content.orders.cancellineitem", + "path": "{merchantId}/orders/{orderId}/cancelLineItem", + "httpMethod": "POST", + "description": "Cancels a line item.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "orderId": { + "type": "string", + "description": "The ID of the order.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "orderId" + ], + "request": { + "$ref": "OrdersCancelLineItemRequest" + }, + "response": { + "$ref": "OrdersCancelLineItemResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "createtestorder": { + "id": "content.orders.createtestorder", + "path": "{merchantId}/testorders", + "httpMethod": "POST", + "description": "Sandbox only. Creates a test order.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + } + }, + "parameterOrder": [ + "merchantId" + ], + "request": { + "$ref": "OrdersCreateTestOrderRequest" + }, + "response": { + "$ref": "OrdersCreateTestOrderResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "custombatch": { + "id": "content.orders.custombatch", + "path": "orders/batch", + "httpMethod": "POST", + "description": "Retrieves or modifies multiple orders in a single request.", + "request": { + "$ref": "OrdersCustomBatchRequest" + }, + "response": { + "$ref": "OrdersCustomBatchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "id": "content.orders.get", + "path": "{merchantId}/orders/{orderId}", + "httpMethod": "GET", + "description": "Retrieves an order from your Merchant Center account.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "orderId": { + "type": "string", + "description": "The ID of the order.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "orderId" + ], + "response": { + "$ref": "Order" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "getbymerchantorderid": { + "id": "content.orders.getbymerchantorderid", + "path": "{merchantId}/ordersbymerchantid/{merchantOrderId}", + "httpMethod": "GET", + "description": "Retrieves an order using merchant order id.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "merchantOrderId": { + "type": "string", + "description": "The merchant order id to be looked for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "merchantOrderId" + ], + "response": { + "$ref": "OrdersGetByMerchantOrderIdResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "gettestordertemplate": { + "id": "content.orders.gettestordertemplate", + "path": "{merchantId}/testordertemplates/{templateName}", + "httpMethod": "GET", + "description": "Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "templateName": { + "type": "string", + "description": "The name of the template to retrieve.", + "required": true, + "enum": [ + "template1", + "template2" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "templateName" + ], + "response": { + "$ref": "OrdersGetTestOrderTemplateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "id": "content.orders.list", + "path": "{merchantId}/orders", + "httpMethod": "GET", + "description": "Lists the orders in your Merchant Center account.", + "parameters": { + "acknowledged": { + "type": "boolean", + "description": "Obtains orders that match the acknowledgement status. When set to true, obtains orders that have been acknowledged. When false, obtains orders that have not been acknowledged.\nWe recommend using this filter set to false, in conjunction with the acknowledge call, such that only un-acknowledged orders are returned.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of orders to return in the response, used for paging. The default value is 25 orders per page, and the maximum allowed value is 250 orders per page.\nKnown issue: All List calls will return all Orders without limit regardless of the value of this field.", + "format": "uint32", + "location": "query" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "orderBy": { + "type": "string", + "description": "The ordering of the returned list. The only supported value are placedDate desc and placedDate asc for now, which returns orders sorted by placement date. \"placedDate desc\" stands for listing orders by placement date, from oldest to most recent. \"placedDate asc\" stands for listing orders by placement date, from most recent to oldest. In future releases we'll support other sorting criteria.", + "enum": [ + "placedDate asc", + "placedDate desc" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The token returned by the previous request.", + "location": "query" + }, + "placedDateEnd": { + "type": "string", + "description": "Obtains orders placed before this date (exclusively), in ISO 8601 format.", + "location": "query" + }, + "placedDateStart": { + "type": "string", + "description": "Obtains orders placed after this date (inclusively), in ISO 8601 format.", + "location": "query" + }, + "statuses": { + "type": "string", + "description": "Obtains orders that match any of the specified statuses. Multiple values can be specified with comma separation. Additionally, please note that active is a shortcut for pendingShipment and partiallyShipped, and completed is a shortcut for shipped , partiallyDelivered, delivered, partiallyReturned, returned, and canceled.", + "enum": [ + "active", + "canceled", + "completed", + "delivered", + "inProgress", + "partiallyDelivered", + "partiallyReturned", + "partiallyShipped", + "pendingShipment", + "returned", + "shipped" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "merchantId" + ], + "response": { + "$ref": "OrdersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "refund": { + "id": "content.orders.refund", + "path": "{merchantId}/orders/{orderId}/refund", + "httpMethod": "POST", + "description": "Refund a portion of the order, up to the full amount paid.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "orderId": { + "type": "string", + "description": "The ID of the order to refund.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "orderId" + ], + "request": { + "$ref": "OrdersRefundRequest" + }, + "response": { + "$ref": "OrdersRefundResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "returnlineitem": { + "id": "content.orders.returnlineitem", + "path": "{merchantId}/orders/{orderId}/returnLineItem", + "httpMethod": "POST", + "description": "Returns a line item.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "orderId": { + "type": "string", + "description": "The ID of the order.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "orderId" + ], + "request": { + "$ref": "OrdersReturnLineItemRequest" + }, + "response": { + "$ref": "OrdersReturnLineItemResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "shiplineitems": { + "id": "content.orders.shiplineitems", + "path": "{merchantId}/orders/{orderId}/shipLineItems", + "httpMethod": "POST", + "description": "Marks line item(s) as shipped.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "orderId": { + "type": "string", + "description": "The ID of the order.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "orderId" + ], + "request": { + "$ref": "OrdersShipLineItemsRequest" + }, + "response": { + "$ref": "OrdersShipLineItemsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "updatemerchantorderid": { + "id": "content.orders.updatemerchantorderid", + "path": "{merchantId}/orders/{orderId}/updateMerchantOrderId", + "httpMethod": "POST", + "description": "Updates the merchant order ID for a given order.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "orderId": { + "type": "string", + "description": "The ID of the order.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "orderId" + ], + "request": { + "$ref": "OrdersUpdateMerchantOrderIdRequest" + }, + "response": { + "$ref": "OrdersUpdateMerchantOrderIdResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "updateshipment": { + "id": "content.orders.updateshipment", + "path": "{merchantId}/orders/{orderId}/updateShipment", + "httpMethod": "POST", + "description": "Updates a shipment's status, carrier, and/or tracking ID.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "orderId": { + "type": "string", + "description": "The ID of the order.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "orderId" + ], + "request": { + "$ref": "OrdersUpdateShipmentRequest" + }, + "response": { + "$ref": "OrdersUpdateShipmentResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "products": { + "methods": { + "custombatch": { + "id": "content.products.custombatch", + "path": "products/batch", + "httpMethod": "POST", + "description": "Retrieves, inserts, and deletes multiple products in a single request.", + "parameters": { + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + } + }, + "request": { + "$ref": "ProductsCustomBatchRequest" + }, + "response": { + "$ref": "ProductsCustomBatchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "delete": { + "id": "content.products.delete", + "path": "{merchantId}/products/{productId}", + "httpMethod": "DELETE", + "description": "Deletes a product from your Merchant Center account.", + "parameters": { + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "productId": { + "type": "string", + "description": "The ID of the product.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "productId" + ], + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "id": "content.products.get", + "path": "{merchantId}/products/{productId}", + "httpMethod": "GET", + "description": "Retrieves a product from your Merchant Center account.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "productId": { + "type": "string", + "description": "The ID of the product.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "productId" + ], + "response": { + "$ref": "Product" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "insert": { + "id": "content.products.insert", + "path": "{merchantId}/products", + "httpMethod": "POST", + "description": "Uploads a product to your Merchant Center account.", + "parameters": { + "dryRun": { + "type": "boolean", + "description": "Flag to run the request in dry-run mode.", + "location": "query" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + } + }, + "parameterOrder": [ + "merchantId" + ], + "request": { + "$ref": "Product" + }, + "response": { + "$ref": "Product" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "id": "content.products.list", + "path": "{merchantId}/products", + "httpMethod": "GET", + "description": "Lists the products in your Merchant Center account.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of products to return in the response, used for paging.", + "format": "uint32", + "location": "query" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "pageToken": { + "type": "string", + "description": "The token returned by the previous request.", + "location": "query" + } + }, + "parameterOrder": [ + "merchantId" + ], + "response": { + "$ref": "ProductsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + }, + "productstatuses": { + "methods": { + "custombatch": { + "id": "content.productstatuses.custombatch", + "path": "productstatuses/batch", + "httpMethod": "POST", + "description": "Gets the statuses of multiple products in a single request.", + "request": { + "$ref": "ProductstatusesCustomBatchRequest" + }, + "response": { + "$ref": "ProductstatusesCustomBatchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "id": "content.productstatuses.get", + "path": "{merchantId}/productstatuses/{productId}", + "httpMethod": "GET", + "description": "Gets the status of a product from your Merchant Center account.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "productId": { + "type": "string", + "description": "The ID of the product.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "productId" + ], + "response": { + "$ref": "ProductStatus" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "id": "content.productstatuses.list", + "path": "{merchantId}/productstatuses", + "httpMethod": "GET", + "description": "Lists the statuses of the products in your Merchant Center account.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "The maximum number of product statuses to return in the response, used for paging.", + "format": "uint32", + "location": "query" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "pageToken": { + "type": "string", + "description": "The token returned by the previous request.", + "location": "query" + } + }, + "parameterOrder": [ + "merchantId" + ], + "response": { + "$ref": "ProductstatusesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/content/v2/content-gen.go b/Godeps/_workspace/src/google.golang.org/api/content/v2/content-gen.go new file mode 100644 index 000000000..3fba8101c --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/content/v2/content-gen.go @@ -0,0 +1,12832 @@ +// Package content provides access to the Content API for Shopping. +// +// See https://developers.google.com/shopping-content +// +// Usage example: +// +// import "google.golang.org/api/content/v2" +// ... +// contentService, err := content.New(oauthHttpClient) +package content // import "google.golang.org/api/content/v2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "content:v2" +const apiName = "content" +const apiVersion = "v2" +const basePath = "https://www.googleapis.com/content/v2/" + +// OAuth2 scopes used by this API. +const ( + // Manage your product listings and accounts for Google Shopping + ContentScope = "https://www.googleapis.com/auth/content" +) + +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.Accountshipping = NewAccountshippingService(s) + s.Accountstatuses = NewAccountstatusesService(s) + s.Accounttax = NewAccounttaxService(s) + s.Datafeeds = NewDatafeedsService(s) + s.Datafeedstatuses = NewDatafeedstatusesService(s) + s.Inventory = NewInventoryService(s) + s.Orders = NewOrdersService(s) + s.Products = NewProductsService(s) + s.Productstatuses = NewProductstatusesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Accounts *AccountsService + + Accountshipping *AccountshippingService + + Accountstatuses *AccountstatusesService + + Accounttax *AccounttaxService + + Datafeeds *DatafeedsService + + Datafeedstatuses *DatafeedstatusesService + + Inventory *InventoryService + + Orders *OrdersService + + Products *ProductsService + + Productstatuses *ProductstatusesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + return rs +} + +type AccountsService struct { + s *Service +} + +func NewAccountshippingService(s *Service) *AccountshippingService { + rs := &AccountshippingService{s: s} + return rs +} + +type AccountshippingService struct { + s *Service +} + +func NewAccountstatusesService(s *Service) *AccountstatusesService { + rs := &AccountstatusesService{s: s} + return rs +} + +type AccountstatusesService struct { + s *Service +} + +func NewAccounttaxService(s *Service) *AccounttaxService { + rs := &AccounttaxService{s: s} + return rs +} + +type AccounttaxService struct { + s *Service +} + +func NewDatafeedsService(s *Service) *DatafeedsService { + rs := &DatafeedsService{s: s} + return rs +} + +type DatafeedsService struct { + s *Service +} + +func NewDatafeedstatusesService(s *Service) *DatafeedstatusesService { + rs := &DatafeedstatusesService{s: s} + return rs +} + +type DatafeedstatusesService struct { + s *Service +} + +func NewInventoryService(s *Service) *InventoryService { + rs := &InventoryService{s: s} + return rs +} + +type InventoryService struct { + s *Service +} + +func NewOrdersService(s *Service) *OrdersService { + rs := &OrdersService{s: s} + return rs +} + +type OrdersService struct { + s *Service +} + +func NewProductsService(s *Service) *ProductsService { + rs := &ProductsService{s: s} + return rs +} + +type ProductsService struct { + s *Service +} + +func NewProductstatusesService(s *Service) *ProductstatusesService { + rs := &ProductstatusesService{s: s} + return rs +} + +type ProductstatusesService struct { + s *Service +} + +// Account: Account data. +type Account struct { + // AdultContent: Indicates whether the merchant sells adult content. + AdultContent bool `json:"adultContent,omitempty"` + + // AdwordsLinks: List of linked AdWords accounts, active or pending + // approval. To create a new link request, add a new link with status + // active to the list. It will remain is state pending until approved or + // rejected in the AdWords interface. To delete an active link or to + // cancel a link request, remove it from the list. + AdwordsLinks []*AccountAdwordsLink `json:"adwordsLinks,omitempty"` + + // Id: Merchant Center account ID. + Id uint64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#account". + Kind string `json:"kind,omitempty"` + + // Name: Display name for the account. + Name string `json:"name,omitempty"` + + // ReviewsUrl: URL for individual seller reviews, i.e., reviews for each + // child account. + ReviewsUrl string `json:"reviewsUrl,omitempty"` + + // SellerId: Client-specific, locally-unique, internal ID for the child + // account. + SellerId string `json:"sellerId,omitempty"` + + // Users: Users with access to the account. Every account (except for + // subaccounts) must have at least one admin user. + Users []*AccountUser `json:"users,omitempty"` + + // WebsiteUrl: The merchant's website. + WebsiteUrl string `json:"websiteUrl,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AdultContent") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Account) MarshalJSON() ([]byte, error) { + type noMethod Account + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AccountAdwordsLink struct { + // AdwordsId: Customer ID of the AdWords account. + AdwordsId uint64 `json:"adwordsId,omitempty,string"` + + // Status: Status of the link between this Merchant Center account and + // the AdWords account. Upon retrieval, it represents the actual status + // of the link and can be either active if it was approved in Google + // AdWords or pending if it's pending approval. Upon insertion, it + // represents the intended status of the link. Re-uploading a link with + // status active when it's still pending or with status pending when + // it's already active will have no effect: the status will remain + // unchanged. Re-uploading a link with deprecated status inactive is + // equivalent to not submitting the link at all and will delete the link + // if it was active or cancel the link request if it was pending. + Status string `json:"status,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AdwordsId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountAdwordsLink) MarshalJSON() ([]byte, error) { + type noMethod AccountAdwordsLink + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AccountIdentifier struct { + // AggregatorId: The aggregator ID, set for aggregators and subaccounts + // (in that case, it represents the aggregator of the subaccount). + AggregatorId uint64 `json:"aggregatorId,omitempty,string"` + + // MerchantId: The merchant account ID, set for individual accounts and + // subaccounts. + MerchantId uint64 `json:"merchantId,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "AggregatorId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountIdentifier) MarshalJSON() ([]byte, error) { + type noMethod AccountIdentifier + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountShipping: The shipping settings of a merchant account. +type AccountShipping struct { + // AccountId: The ID of the account to which these account shipping + // settings belong. + AccountId uint64 `json:"accountId,omitempty,string"` + + // CarrierRates: Carrier-based shipping calculations. + CarrierRates []*AccountShippingCarrierRate `json:"carrierRates,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#accountShipping". + Kind string `json:"kind,omitempty"` + + // LocationGroups: Location groups for shipping. + LocationGroups []*AccountShippingLocationGroup `json:"locationGroups,omitempty"` + + // RateTables: Rate tables definitions. + RateTables []*AccountShippingRateTable `json:"rateTables,omitempty"` + + // Services: Shipping services describing shipping fees calculation. + Services []*AccountShippingShippingService `json:"services,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountShipping) MarshalJSON() ([]byte, error) { + type noMethod AccountShipping + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountShippingCarrierRate: A carrier-calculated shipping rate. +type AccountShippingCarrierRate struct { + // Carrier: The carrier that is responsible for the shipping, such as + // "UPS", "FedEx", or "USPS". + Carrier string `json:"carrier,omitempty"` + + // CarrierService: The carrier service, such as "Ground" or "2Day". + CarrierService string `json:"carrierService,omitempty"` + + // ModifierFlatRate: Additive shipping rate modifier. + ModifierFlatRate *Price `json:"modifierFlatRate,omitempty"` + + // ModifierPercent: Multiplicative shipping rate modifier in percent. + // Represented as a floating point number without the percentage + // character. + ModifierPercent string `json:"modifierPercent,omitempty"` + + // Name: The name of the carrier rate. + Name string `json:"name,omitempty"` + + // SaleCountry: The sale country for which this carrier rate is valid, + // represented as a CLDR territory code. + SaleCountry string `json:"saleCountry,omitempty"` + + // ShippingOrigin: Shipping origin represented as a postal code. + ShippingOrigin string `json:"shippingOrigin,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Carrier") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountShippingCarrierRate) MarshalJSON() ([]byte, error) { + type noMethod AccountShippingCarrierRate + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AccountShippingCondition struct { + // DeliveryLocationGroup: Delivery location in terms of a location group + // name. A location group with this name must be specified among + // location groups. + DeliveryLocationGroup string `json:"deliveryLocationGroup,omitempty"` + + // DeliveryLocationId: Delivery location in terms of a location ID. Can + // be used to represent administrative areas, smaller country + // subdivisions, or cities. + DeliveryLocationId int64 `json:"deliveryLocationId,omitempty,string"` + + // DeliveryPostalCode: Delivery location in terms of a postal code. + DeliveryPostalCode string `json:"deliveryPostalCode,omitempty"` + + // DeliveryPostalCodeRange: Delivery location in terms of a postal code + // range. + DeliveryPostalCodeRange *AccountShippingPostalCodeRange `json:"deliveryPostalCodeRange,omitempty"` + + // PriceMax: Maximum shipping price. Forms an interval between the + // maximum of smaller prices (exclusive) and this price (inclusive). + PriceMax *Price `json:"priceMax,omitempty"` + + // ShippingLabel: Shipping label of the product. The products with the + // label are matched. + ShippingLabel string `json:"shippingLabel,omitempty"` + + // WeightMax: Maximum shipping weight. Forms an interval between the + // maximum of smaller weight (exclusive) and this weight (inclusive). + WeightMax *Weight `json:"weightMax,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "DeliveryLocationGroup") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountShippingCondition) MarshalJSON() ([]byte, error) { + type noMethod AccountShippingCondition + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountShippingLocationGroup: A user-defined locations group in a +// given country. All the locations of the group must be of the same +// type. +type AccountShippingLocationGroup struct { + // Country: The CLDR territory code of the country in which this + // location group is. + Country string `json:"country,omitempty"` + + // LocationIds: A location ID (also called criteria ID) representing + // administrative areas, smaller country subdivisions (counties), or + // cities. + LocationIds googleapi.Int64s `json:"locationIds,omitempty"` + + // Name: The name of the location group. + Name string `json:"name,omitempty"` + + // PostalCodeRanges: A postal code range representing a city or a set of + // cities. + PostalCodeRanges []*AccountShippingPostalCodeRange `json:"postalCodeRanges,omitempty"` + + // PostalCodes: A postal code representing a city or a set of cities. + // + // - A single postal code (e.g., 12345) + // - A postal code prefix followed by a star (e.g., 1234*) + PostalCodes []string `json:"postalCodes,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Country") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountShippingLocationGroup) MarshalJSON() ([]byte, error) { + type noMethod AccountShippingLocationGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountShippingPostalCodeRange: A postal code range, that can be +// either: +// - A range of postal codes (e.g., start=12340, end=12359) +// - A range of postal codes prefixes (e.g., start=1234* end=1235*). +// Prefixes must be of the same length (e.g., start=12* end=2* is +// invalid). +type AccountShippingPostalCodeRange struct { + // End: The last (inclusive) postal code or prefix of the range. + End string `json:"end,omitempty"` + + // Start: The first (inclusive) postal code or prefix of the range. + Start string `json:"start,omitempty"` + + // ForceSendFields is a list of field names (e.g. "End") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountShippingPostalCodeRange) MarshalJSON() ([]byte, error) { + type noMethod AccountShippingPostalCodeRange + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountShippingRateTable: A single or bi-dimensional table of +// shipping rates. Each dimension is defined in terms of consecutive +// price/weight ranges, delivery locations, or shipping labels. +type AccountShippingRateTable struct { + // Content: One-dimensional table cells define one condition along the + // same dimension. Bi-dimensional table cells use two dimensions with + // respectively M and N distinct values and must contain exactly M * N + // cells with distinct conditions (for each possible value pairs). + Content []*AccountShippingRateTableCell `json:"content,omitempty"` + + // Name: The name of the rate table. + Name string `json:"name,omitempty"` + + // SaleCountry: The sale country for which this table is valid, + // represented as a CLDR territory code. + SaleCountry string `json:"saleCountry,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Content") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountShippingRateTable) MarshalJSON() ([]byte, error) { + type noMethod AccountShippingRateTable + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AccountShippingRateTableCell struct { + // Condition: Conditions for which the cell is valid. All cells in a + // table must use the same dimension or pair of dimensions among price, + // weight, shipping label or delivery location. If no condition is + // specified, the cell acts as a catch-all and matches all the elements + // that are not matched by other cells in this dimension. + Condition *AccountShippingCondition `json:"condition,omitempty"` + + // Rate: The rate applicable if the cell conditions are matched. + Rate *Price `json:"rate,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Condition") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountShippingRateTableCell) MarshalJSON() ([]byte, error) { + type noMethod AccountShippingRateTableCell + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountShippingShippingService: Shipping services provided in a +// country. +type AccountShippingShippingService struct { + // Active: Whether the shipping service is available. + Active bool `json:"active,omitempty"` + + // CalculationMethod: Calculation method for the "simple" case that + // needs no rules. + CalculationMethod *AccountShippingShippingServiceCalculationMethod `json:"calculationMethod,omitempty"` + + // CostRuleTree: Decision tree for "complicated" shipping cost + // calculation. + CostRuleTree *AccountShippingShippingServiceCostRule `json:"costRuleTree,omitempty"` + + // Name: The name of this shipping service. + Name string `json:"name,omitempty"` + + // SaleCountry: The CLDR territory code of the sale country for which + // this service can be used. + SaleCountry string `json:"saleCountry,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Active") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountShippingShippingService) MarshalJSON() ([]byte, error) { + type noMethod AccountShippingShippingService + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountShippingShippingServiceCalculationMethod: Shipping cost +// calculation method. Exactly one of the field is set. +type AccountShippingShippingServiceCalculationMethod struct { + // CarrierRate: Name of the carrier rate to use for the calculation. + CarrierRate string `json:"carrierRate,omitempty"` + + // Excluded: Delivery is excluded. Valid only within cost rules tree. + Excluded bool `json:"excluded,omitempty"` + + // FlatRate: Fixed price shipping, represented as a floating point + // number associated with a currency. + FlatRate *Price `json:"flatRate,omitempty"` + + // PercentageRate: Percentage of the price, represented as a floating + // point number without the percentage character. + PercentageRate string `json:"percentageRate,omitempty"` + + // RateTable: Name of the rate table to use for the calculation. + RateTable string `json:"rateTable,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CarrierRate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountShippingShippingServiceCalculationMethod) MarshalJSON() ([]byte, error) { + type noMethod AccountShippingShippingServiceCalculationMethod + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountShippingShippingServiceCostRule: Building block of the cost +// calculation decision tree. +// - The tree root should have no condition and no calculation method. +// - All the children must have a condition on the same dimension. The +// first child matching a condition is entered, therefore, price and +// weight conditions form contiguous intervals. +// - The last child of an element must have no condition and matches all +// elements not previously matched. +// - Children and calculation method are mutually exclusive, and exactly +// one of them must be defined; the root must only have children. +type AccountShippingShippingServiceCostRule struct { + // CalculationMethod: Final calculation method to be used only in leaf + // nodes. + CalculationMethod *AccountShippingShippingServiceCalculationMethod `json:"calculationMethod,omitempty"` + + // Children: Subsequent rules to be applied, only for inner nodes. The + // last child must not specify a condition and acts as a catch-all. + Children []*AccountShippingShippingServiceCostRule `json:"children,omitempty"` + + // Condition: Condition for this rule to be applicable. If no condition + // is specified, the rule acts as a catch-all. + Condition *AccountShippingCondition `json:"condition,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CalculationMethod") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountShippingShippingServiceCostRule) MarshalJSON() ([]byte, error) { + type noMethod AccountShippingShippingServiceCostRule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountStatus: The status of an account, i.e., information about its +// products, which is computed offline and not returned immediately at +// insertion time. +type AccountStatus struct { + // AccountId: The ID of the account for which the status is reported. + AccountId string `json:"accountId,omitempty"` + + // DataQualityIssues: A list of data quality issues. + DataQualityIssues []*AccountStatusDataQualityIssue `json:"dataQualityIssues,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#accountStatus". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountStatus) MarshalJSON() ([]byte, error) { + type noMethod AccountStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AccountStatusDataQualityIssue struct { + // Country: Country for which this issue is reported. + Country string `json:"country,omitempty"` + + // DisplayedValue: Actual value displayed on the landing page. + DisplayedValue string `json:"displayedValue,omitempty"` + + // ExampleItems: Example items featuring the issue. + ExampleItems []*AccountStatusExampleItem `json:"exampleItems,omitempty"` + + // Id: Issue identifier. + Id string `json:"id,omitempty"` + + // LastChecked: Last time the account was checked for this issue. + LastChecked string `json:"lastChecked,omitempty"` + + // NumItems: Number of items in the account found to have the said + // issue. + NumItems int64 `json:"numItems,omitempty"` + + // Severity: Severity of the problem. + Severity string `json:"severity,omitempty"` + + // SubmittedValue: Submitted value that causes the issue. + SubmittedValue string `json:"submittedValue,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Country") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountStatusDataQualityIssue) MarshalJSON() ([]byte, error) { + type noMethod AccountStatusDataQualityIssue + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountStatusExampleItem: An example of an item that has poor data +// quality. An item value on the landing page differs from what is +// submitted, or conflicts with a policy. +type AccountStatusExampleItem struct { + // ItemId: Unique item ID as specified in the uploaded product data. + ItemId string `json:"itemId,omitempty"` + + // Link: Landing page of the item. + Link string `json:"link,omitempty"` + + // SubmittedValue: The item value that was submitted. + SubmittedValue string `json:"submittedValue,omitempty"` + + // Title: Title of the item. + Title string `json:"title,omitempty"` + + // ValueOnLandingPage: The actual value on the landing page. + ValueOnLandingPage string `json:"valueOnLandingPage,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ItemId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountStatusExampleItem) MarshalJSON() ([]byte, error) { + type noMethod AccountStatusExampleItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountTax: The tax settings of a merchant account. +type AccountTax struct { + // AccountId: The ID of the account to which these account tax settings + // belong. + AccountId uint64 `json:"accountId,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#accountTax". + Kind string `json:"kind,omitempty"` + + // Rules: Tax rules. Updating the tax rules will enable US taxes (not + // reversible). Defining no rules is equivalent to not charging tax at + // all. + Rules []*AccountTaxTaxRule `json:"rules,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountTax) MarshalJSON() ([]byte, error) { + type noMethod AccountTax + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountTaxTaxRule: Tax calculation rule to apply in a state or +// province (USA only). +type AccountTaxTaxRule struct { + // Country: Country code in which tax is applicable. + Country string `json:"country,omitempty"` + + // LocationId: State (or province) is which the tax is applicable, + // described by its location id (also called criteria id). + LocationId uint64 `json:"locationId,omitempty,string"` + + // RatePercent: Explicit tax rate in percent, represented as a floating + // point number without the percentage character. Must not be negative. + RatePercent string `json:"ratePercent,omitempty"` + + // ShippingTaxed: If true, shipping charges are also taxed. + ShippingTaxed bool `json:"shippingTaxed,omitempty"` + + // UseGlobalRate: Whether the tax rate is taken from a global tax table + // or specified explicitly. + UseGlobalRate bool `json:"useGlobalRate,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Country") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountTaxTaxRule) MarshalJSON() ([]byte, error) { + type noMethod AccountTaxTaxRule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AccountUser struct { + // Admin: Whether user is an admin. + Admin *bool `json:"admin,omitempty"` + + // EmailAddress: User's email address. + EmailAddress string `json:"emailAddress,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Admin") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountUser) MarshalJSON() ([]byte, error) { + type noMethod AccountUser + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AccountsAuthInfoResponse struct { + // AccountIdentifiers: The account identifiers corresponding to the + // authenticated user. + // - For an individual account: only the merchant ID is defined + // - For an aggregator: only the aggregator ID is defined + // - For a subaccount of an MCA: both the merchant ID and the aggregator + // ID are defined. + AccountIdentifiers []*AccountIdentifier `json:"accountIdentifiers,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#accountsAuthInfoResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountIdentifiers") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountsAuthInfoResponse) MarshalJSON() ([]byte, error) { + type noMethod AccountsAuthInfoResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AccountsCustomBatchRequest struct { + // Entries: The request entries to be processed in the batch. + Entries []*AccountsCustomBatchRequestEntry `json:"entries,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Entries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountsCustomBatchRequest) MarshalJSON() ([]byte, error) { + type noMethod AccountsCustomBatchRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountsCustomBatchRequestEntry: A batch entry encoding a single +// non-batch accounts request. +type AccountsCustomBatchRequestEntry struct { + // Account: The account to create or update. Only defined if the method + // is insert or update. + Account *Account `json:"account,omitempty"` + + // AccountId: The ID of the account to get or delete. Only defined if + // the method is get or delete. + AccountId uint64 `json:"accountId,omitempty,string"` + + // BatchId: An entry ID, unique within the batch request. + BatchId int64 `json:"batchId,omitempty"` + + // MerchantId: The ID of the managing account. + MerchantId uint64 `json:"merchantId,omitempty,string"` + + Method string `json:"method,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Account") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountsCustomBatchRequestEntry) MarshalJSON() ([]byte, error) { + type noMethod AccountsCustomBatchRequestEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AccountsCustomBatchResponse struct { + // Entries: The result of the execution of the batch requests. + Entries []*AccountsCustomBatchResponseEntry `json:"entries,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#accountsCustomBatchResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Entries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountsCustomBatchResponse) MarshalJSON() ([]byte, error) { + type noMethod AccountsCustomBatchResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountsCustomBatchResponseEntry: A batch entry encoding a single +// non-batch accounts response. +type AccountsCustomBatchResponseEntry struct { + // Account: The retrieved, created, or updated account. Not defined if + // the method was delete. + Account *Account `json:"account,omitempty"` + + // BatchId: The ID of the request entry this entry responds to. + BatchId int64 `json:"batchId,omitempty"` + + // Errors: A list of errors defined if and only if the request failed. + Errors *Errors `json:"errors,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#accountsCustomBatchResponseEntry". + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Account") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountsCustomBatchResponseEntry) MarshalJSON() ([]byte, error) { + type noMethod AccountsCustomBatchResponseEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AccountsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#accountsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token for the retrieval of the next page of + // accounts. + NextPageToken string `json:"nextPageToken,omitempty"` + + Resources []*Account `json:"resources,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountsListResponse) MarshalJSON() ([]byte, error) { + type noMethod AccountsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AccountshippingCustomBatchRequest struct { + // Entries: The request entries to be processed in the batch. + Entries []*AccountshippingCustomBatchRequestEntry `json:"entries,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Entries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountshippingCustomBatchRequest) MarshalJSON() ([]byte, error) { + type noMethod AccountshippingCustomBatchRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountshippingCustomBatchRequestEntry: A batch entry encoding a +// single non-batch accountshipping request. +type AccountshippingCustomBatchRequestEntry struct { + // AccountId: The ID of the account for which to get/update account + // shipping settings. + AccountId uint64 `json:"accountId,omitempty,string"` + + // AccountShipping: The account shipping settings to update. Only + // defined if the method is update. + AccountShipping *AccountShipping `json:"accountShipping,omitempty"` + + // BatchId: An entry ID, unique within the batch request. + BatchId int64 `json:"batchId,omitempty"` + + // MerchantId: The ID of the managing account. + MerchantId uint64 `json:"merchantId,omitempty,string"` + + Method string `json:"method,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountshippingCustomBatchRequestEntry) MarshalJSON() ([]byte, error) { + type noMethod AccountshippingCustomBatchRequestEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AccountshippingCustomBatchResponse struct { + // Entries: The result of the execution of the batch requests. + Entries []*AccountshippingCustomBatchResponseEntry `json:"entries,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#accountshippingCustomBatchResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Entries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountshippingCustomBatchResponse) MarshalJSON() ([]byte, error) { + type noMethod AccountshippingCustomBatchResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountshippingCustomBatchResponseEntry: A batch entry encoding a +// single non-batch accountshipping response. +type AccountshippingCustomBatchResponseEntry struct { + // AccountShipping: The retrieved or updated account shipping settings. + AccountShipping *AccountShipping `json:"accountShipping,omitempty"` + + // BatchId: The ID of the request entry this entry responds to. + BatchId int64 `json:"batchId,omitempty"` + + // Errors: A list of errors defined if and only if the request failed. + Errors *Errors `json:"errors,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#accountshippingCustomBatchResponseEntry". + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AccountShipping") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountshippingCustomBatchResponseEntry) MarshalJSON() ([]byte, error) { + type noMethod AccountshippingCustomBatchResponseEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AccountshippingListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#accountshippingListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token for the retrieval of the next page of + // account shipping settings. + NextPageToken string `json:"nextPageToken,omitempty"` + + Resources []*AccountShipping `json:"resources,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountshippingListResponse) MarshalJSON() ([]byte, error) { + type noMethod AccountshippingListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AccountstatusesCustomBatchRequest struct { + // Entries: The request entries to be processed in the batch. + Entries []*AccountstatusesCustomBatchRequestEntry `json:"entries,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Entries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountstatusesCustomBatchRequest) MarshalJSON() ([]byte, error) { + type noMethod AccountstatusesCustomBatchRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountstatusesCustomBatchRequestEntry: A batch entry encoding a +// single non-batch accountstatuses request. +type AccountstatusesCustomBatchRequestEntry struct { + // AccountId: The ID of the (sub-)account whose status to get. + AccountId uint64 `json:"accountId,omitempty,string"` + + // BatchId: An entry ID, unique within the batch request. + BatchId int64 `json:"batchId,omitempty"` + + // MerchantId: The ID of the managing account. + MerchantId uint64 `json:"merchantId,omitempty,string"` + + // Method: The method (get). + Method string `json:"method,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountstatusesCustomBatchRequestEntry) MarshalJSON() ([]byte, error) { + type noMethod AccountstatusesCustomBatchRequestEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AccountstatusesCustomBatchResponse struct { + // Entries: The result of the execution of the batch requests. + Entries []*AccountstatusesCustomBatchResponseEntry `json:"entries,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#accountstatusesCustomBatchResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Entries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountstatusesCustomBatchResponse) MarshalJSON() ([]byte, error) { + type noMethod AccountstatusesCustomBatchResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountstatusesCustomBatchResponseEntry: A batch entry encoding a +// single non-batch accountstatuses response. +type AccountstatusesCustomBatchResponseEntry struct { + // AccountStatus: The requested account status. Defined if and only if + // the request was successful. + AccountStatus *AccountStatus `json:"accountStatus,omitempty"` + + // BatchId: The ID of the request entry this entry responds to. + BatchId int64 `json:"batchId,omitempty"` + + // Errors: A list of errors defined if and only if the request failed. + Errors *Errors `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AccountStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountstatusesCustomBatchResponseEntry) MarshalJSON() ([]byte, error) { + type noMethod AccountstatusesCustomBatchResponseEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AccountstatusesListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#accountstatusesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token for the retrieval of the next page of + // account statuses. + NextPageToken string `json:"nextPageToken,omitempty"` + + Resources []*AccountStatus `json:"resources,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountstatusesListResponse) MarshalJSON() ([]byte, error) { + type noMethod AccountstatusesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AccounttaxCustomBatchRequest struct { + // Entries: The request entries to be processed in the batch. + Entries []*AccounttaxCustomBatchRequestEntry `json:"entries,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Entries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccounttaxCustomBatchRequest) MarshalJSON() ([]byte, error) { + type noMethod AccounttaxCustomBatchRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccounttaxCustomBatchRequestEntry: A batch entry encoding a single +// non-batch accounttax request. +type AccounttaxCustomBatchRequestEntry struct { + // AccountId: The ID of the account for which to get/update account tax + // settings. + AccountId uint64 `json:"accountId,omitempty,string"` + + // AccountTax: The account tax settings to update. Only defined if the + // method is update. + AccountTax *AccountTax `json:"accountTax,omitempty"` + + // BatchId: An entry ID, unique within the batch request. + BatchId int64 `json:"batchId,omitempty"` + + // MerchantId: The ID of the managing account. + MerchantId uint64 `json:"merchantId,omitempty,string"` + + Method string `json:"method,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccounttaxCustomBatchRequestEntry) MarshalJSON() ([]byte, error) { + type noMethod AccounttaxCustomBatchRequestEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AccounttaxCustomBatchResponse struct { + // Entries: The result of the execution of the batch requests. + Entries []*AccounttaxCustomBatchResponseEntry `json:"entries,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#accounttaxCustomBatchResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Entries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccounttaxCustomBatchResponse) MarshalJSON() ([]byte, error) { + type noMethod AccounttaxCustomBatchResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccounttaxCustomBatchResponseEntry: A batch entry encoding a single +// non-batch accounttax response. +type AccounttaxCustomBatchResponseEntry struct { + // AccountTax: The retrieved or updated account tax settings. + AccountTax *AccountTax `json:"accountTax,omitempty"` + + // BatchId: The ID of the request entry this entry responds to. + BatchId int64 `json:"batchId,omitempty"` + + // Errors: A list of errors defined if and only if the request failed. + Errors *Errors `json:"errors,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#accounttaxCustomBatchResponseEntry". + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AccountTax") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccounttaxCustomBatchResponseEntry) MarshalJSON() ([]byte, error) { + type noMethod AccounttaxCustomBatchResponseEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AccounttaxListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#accounttaxListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token for the retrieval of the next page of + // account tax settings. + NextPageToken string `json:"nextPageToken,omitempty"` + + Resources []*AccountTax `json:"resources,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccounttaxListResponse) MarshalJSON() ([]byte, error) { + type noMethod AccounttaxListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Datafeed: Datafeed data. +type Datafeed struct { + // AttributeLanguage: The two-letter ISO 639-1 language in which the + // attributes are defined in the data feed. + AttributeLanguage string `json:"attributeLanguage,omitempty"` + + // ContentLanguage: The two-letter ISO 639-1 language of the items in + // the feed. + ContentLanguage string `json:"contentLanguage,omitempty"` + + // ContentType: The type of data feed. + ContentType string `json:"contentType,omitempty"` + + // FetchSchedule: Fetch schedule for the feed file. + FetchSchedule *DatafeedFetchSchedule `json:"fetchSchedule,omitempty"` + + // FileName: The filename of the feed. All feeds must have a unique file + // name. + FileName string `json:"fileName,omitempty"` + + // Format: Format of the feed file. + Format *DatafeedFormat `json:"format,omitempty"` + + // Id: The ID of the data feed. + Id int64 `json:"id,omitempty,string"` + + // IntendedDestinations: The list of intended destinations (corresponds + // to checked check boxes in Merchant Center). + IntendedDestinations []string `json:"intendedDestinations,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#datafeed". + Kind string `json:"kind,omitempty"` + + // Name: A descriptive name of the data feed. + Name string `json:"name,omitempty"` + + // TargetCountry: The country where the items in the feed will be + // included in the search index, represented as a CLDR territory code. + TargetCountry string `json:"targetCountry,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AttributeLanguage") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Datafeed) MarshalJSON() ([]byte, error) { + type noMethod Datafeed + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DatafeedFetchSchedule: The required fields vary based on the +// frequency of fetching. For a monthly fetch schedule, day_of_month and +// hour are required. For a weekly fetch schedule, weekday and hour are +// required. For a daily fetch schedule, only hour is required. +type DatafeedFetchSchedule struct { + // DayOfMonth: The day of the month the feed file should be fetched + // (1-31). + DayOfMonth int64 `json:"dayOfMonth,omitempty"` + + // FetchUrl: The URL where the feed file can be fetched. Google Merchant + // Center will support automatic scheduled uploads using the HTTP, + // HTTPS, FTP, or SFTP protocols, so the value will need to be a valid + // link using one of those four protocols. + FetchUrl string `json:"fetchUrl,omitempty"` + + // Hour: The hour of the day the feed file should be fetched (0-24). + Hour int64 `json:"hour,omitempty"` + + // Password: An optional password for fetch_url. + Password string `json:"password,omitempty"` + + // TimeZone: Time zone used for schedule. UTC by default. E.g., + // "America/Los_Angeles". + TimeZone string `json:"timeZone,omitempty"` + + // Username: An optional user name for fetch_url. + Username string `json:"username,omitempty"` + + // Weekday: The day of the week the feed file should be fetched. + Weekday string `json:"weekday,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DayOfMonth") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DatafeedFetchSchedule) MarshalJSON() ([]byte, error) { + type noMethod DatafeedFetchSchedule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DatafeedFormat struct { + // ColumnDelimiter: Delimiter for the separation of values in a + // delimiter-separated values feed. If not specified, the delimiter will + // be auto-detected. Ignored for non-DSV data feeds. + ColumnDelimiter string `json:"columnDelimiter,omitempty"` + + // FileEncoding: Character encoding scheme of the data feed. If not + // specified, the encoding will be auto-detected. + FileEncoding string `json:"fileEncoding,omitempty"` + + // QuotingMode: Specifies how double quotes are interpreted. If not + // specified, the mode will be auto-detected. Ignored for non-DSV data + // feeds. + QuotingMode string `json:"quotingMode,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ColumnDelimiter") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DatafeedFormat) MarshalJSON() ([]byte, error) { + type noMethod DatafeedFormat + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DatafeedStatus: The status of a datafeed, i.e., the result of the +// last retrieval of the datafeed computed asynchronously when the feed +// processing is finished. +type DatafeedStatus struct { + // DatafeedId: The ID of the feed for which the status is reported. + DatafeedId uint64 `json:"datafeedId,omitempty,string"` + + // Errors: The list of errors occurring in the feed. + Errors []*DatafeedStatusError `json:"errors,omitempty"` + + // ItemsTotal: The number of items in the feed that were processed. + ItemsTotal uint64 `json:"itemsTotal,omitempty,string"` + + // ItemsValid: The number of items in the feed that were valid. + ItemsValid uint64 `json:"itemsValid,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#datafeedStatus". + Kind string `json:"kind,omitempty"` + + // LastUploadDate: The last date at which the feed was uploaded. + LastUploadDate string `json:"lastUploadDate,omitempty"` + + // ProcessingStatus: The processing status of the feed. + ProcessingStatus string `json:"processingStatus,omitempty"` + + // Warnings: The list of errors occurring in the feed. + Warnings []*DatafeedStatusError `json:"warnings,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DatafeedId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DatafeedStatus) MarshalJSON() ([]byte, error) { + type noMethod DatafeedStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DatafeedStatusError: An error occurring in the feed, like "invalid +// price". +type DatafeedStatusError struct { + // Code: The code of the error, e.g., "validation/invalid_value". + Code string `json:"code,omitempty"` + + // Count: The number of occurrences of the error in the feed. + Count uint64 `json:"count,omitempty,string"` + + // Examples: A list of example occurrences of the error, grouped by + // product. + Examples []*DatafeedStatusExample `json:"examples,omitempty"` + + // Message: The error message, e.g., "Invalid price". + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DatafeedStatusError) MarshalJSON() ([]byte, error) { + type noMethod DatafeedStatusError + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DatafeedStatusExample: An example occurrence for a particular error. +type DatafeedStatusExample struct { + // ItemId: The ID of the example item. + ItemId string `json:"itemId,omitempty"` + + // LineNumber: Line number in the data feed where the example is found. + LineNumber uint64 `json:"lineNumber,omitempty,string"` + + // Value: The problematic value. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ItemId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DatafeedStatusExample) MarshalJSON() ([]byte, error) { + type noMethod DatafeedStatusExample + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DatafeedsCustomBatchRequest struct { + // Entries: The request entries to be processed in the batch. + Entries []*DatafeedsCustomBatchRequestEntry `json:"entries,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Entries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DatafeedsCustomBatchRequest) MarshalJSON() ([]byte, error) { + type noMethod DatafeedsCustomBatchRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DatafeedsCustomBatchRequestEntry: A batch entry encoding a single +// non-batch datafeeds request. +type DatafeedsCustomBatchRequestEntry struct { + // BatchId: An entry ID, unique within the batch request. + BatchId int64 `json:"batchId,omitempty"` + + // Datafeed: The data feed to insert. + Datafeed *Datafeed `json:"datafeed,omitempty"` + + // DatafeedId: The ID of the data feed to get or delete. + DatafeedId uint64 `json:"datafeedId,omitempty,string"` + + // MerchantId: The ID of the managing account. + MerchantId uint64 `json:"merchantId,omitempty,string"` + + Method string `json:"method,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BatchId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DatafeedsCustomBatchRequestEntry) MarshalJSON() ([]byte, error) { + type noMethod DatafeedsCustomBatchRequestEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DatafeedsCustomBatchResponse struct { + // Entries: The result of the execution of the batch requests. + Entries []*DatafeedsCustomBatchResponseEntry `json:"entries,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#datafeedsCustomBatchResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Entries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DatafeedsCustomBatchResponse) MarshalJSON() ([]byte, error) { + type noMethod DatafeedsCustomBatchResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DatafeedsCustomBatchResponseEntry: A batch entry encoding a single +// non-batch datafeeds response. +type DatafeedsCustomBatchResponseEntry struct { + // BatchId: The ID of the request entry this entry responds to. + BatchId int64 `json:"batchId,omitempty"` + + // Datafeed: The requested data feed. Defined if and only if the request + // was successful. + Datafeed *Datafeed `json:"datafeed,omitempty"` + + // Errors: A list of errors defined if and only if the request failed. + Errors *Errors `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BatchId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DatafeedsCustomBatchResponseEntry) MarshalJSON() ([]byte, error) { + type noMethod DatafeedsCustomBatchResponseEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DatafeedsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#datafeedsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token for the retrieval of the next page of + // datafeeds. + NextPageToken string `json:"nextPageToken,omitempty"` + + Resources []*Datafeed `json:"resources,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DatafeedsListResponse) MarshalJSON() ([]byte, error) { + type noMethod DatafeedsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DatafeedstatusesCustomBatchRequest struct { + // Entries: The request entries to be processed in the batch. + Entries []*DatafeedstatusesCustomBatchRequestEntry `json:"entries,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Entries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DatafeedstatusesCustomBatchRequest) MarshalJSON() ([]byte, error) { + type noMethod DatafeedstatusesCustomBatchRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DatafeedstatusesCustomBatchRequestEntry: A batch entry encoding a +// single non-batch datafeedstatuses request. +type DatafeedstatusesCustomBatchRequestEntry struct { + // BatchId: An entry ID, unique within the batch request. + BatchId int64 `json:"batchId,omitempty"` + + // DatafeedId: The ID of the data feed to get or delete. + DatafeedId uint64 `json:"datafeedId,omitempty,string"` + + // MerchantId: The ID of the managing account. + MerchantId uint64 `json:"merchantId,omitempty,string"` + + Method string `json:"method,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BatchId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DatafeedstatusesCustomBatchRequestEntry) MarshalJSON() ([]byte, error) { + type noMethod DatafeedstatusesCustomBatchRequestEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DatafeedstatusesCustomBatchResponse struct { + // Entries: The result of the execution of the batch requests. + Entries []*DatafeedstatusesCustomBatchResponseEntry `json:"entries,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#datafeedstatusesCustomBatchResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Entries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DatafeedstatusesCustomBatchResponse) MarshalJSON() ([]byte, error) { + type noMethod DatafeedstatusesCustomBatchResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DatafeedstatusesCustomBatchResponseEntry: A batch entry encoding a +// single non-batch datafeedstatuses response. +type DatafeedstatusesCustomBatchResponseEntry struct { + // BatchId: The ID of the request entry this entry responds to. + BatchId int64 `json:"batchId,omitempty"` + + // DatafeedStatus: The requested data feed status. Defined if and only + // if the request was successful. + DatafeedStatus *DatafeedStatus `json:"datafeedStatus,omitempty"` + + // Errors: A list of errors defined if and only if the request failed. + Errors *Errors `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BatchId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DatafeedstatusesCustomBatchResponseEntry) MarshalJSON() ([]byte, error) { + type noMethod DatafeedstatusesCustomBatchResponseEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DatafeedstatusesListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#datafeedstatusesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token for the retrieval of the next page of + // datafeed statuses. + NextPageToken string `json:"nextPageToken,omitempty"` + + Resources []*DatafeedStatus `json:"resources,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DatafeedstatusesListResponse) MarshalJSON() ([]byte, error) { + type noMethod DatafeedstatusesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Error: An error returned by the API. +type Error struct { + // Domain: The domain of the error. + Domain string `json:"domain,omitempty"` + + // Message: A description of the error. + Message string `json:"message,omitempty"` + + // Reason: The error code. + Reason string `json:"reason,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Domain") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Error) MarshalJSON() ([]byte, error) { + type noMethod Error + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Errors: A list of errors returned by a failed batch entry. +type Errors struct { + // Code: The HTTP status of the first error in errors. + Code int64 `json:"code,omitempty"` + + // Errors: A list of errors. + Errors []*Error `json:"errors,omitempty"` + + // Message: The message of the first error in errors. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Errors) MarshalJSON() ([]byte, error) { + type noMethod Errors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Inventory struct { + // Availability: The availability of the product. + Availability string `json:"availability,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#inventory". + Kind string `json:"kind,omitempty"` + + // Price: The price of the product. + Price *Price `json:"price,omitempty"` + + // Quantity: The quantity of the product. Must be equal to or greater + // than zero. Supported only for local products. + Quantity int64 `json:"quantity,omitempty"` + + // SalePrice: The sale price of the product. Mandatory if + // sale_price_effective_date is defined. + SalePrice *Price `json:"salePrice,omitempty"` + + // SalePriceEffectiveDate: A date range represented by a pair of ISO + // 8601 dates separated by a space, comma, or slash. Both dates might be + // specified as 'null' if undecided. + SalePriceEffectiveDate string `json:"salePriceEffectiveDate,omitempty"` + + // SellOnGoogleQuantity: The quantity of the product that is reserved + // for sell-on-google ads. Supported only for online products. + SellOnGoogleQuantity int64 `json:"sellOnGoogleQuantity,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Availability") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Inventory) MarshalJSON() ([]byte, error) { + type noMethod Inventory + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InventoryCustomBatchRequest struct { + // Entries: The request entries to be processed in the batch. + Entries []*InventoryCustomBatchRequestEntry `json:"entries,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Entries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InventoryCustomBatchRequest) MarshalJSON() ([]byte, error) { + type noMethod InventoryCustomBatchRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InventoryCustomBatchRequestEntry: A batch entry encoding a single +// non-batch inventory request. +type InventoryCustomBatchRequestEntry struct { + // BatchId: An entry ID, unique within the batch request. + BatchId int64 `json:"batchId,omitempty"` + + // Inventory: Price and availability of the product. + Inventory *Inventory `json:"inventory,omitempty"` + + // MerchantId: The ID of the managing account. + MerchantId uint64 `json:"merchantId,omitempty,string"` + + // ProductId: The ID of the product for which to update price and + // availability. + ProductId string `json:"productId,omitempty"` + + // StoreCode: The code of the store for which to update price and + // availability. Use online to update price and availability of an + // online product. + StoreCode string `json:"storeCode,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BatchId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InventoryCustomBatchRequestEntry) MarshalJSON() ([]byte, error) { + type noMethod InventoryCustomBatchRequestEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InventoryCustomBatchResponse struct { + // Entries: The result of the execution of the batch requests. + Entries []*InventoryCustomBatchResponseEntry `json:"entries,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#inventoryCustomBatchResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Entries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InventoryCustomBatchResponse) MarshalJSON() ([]byte, error) { + type noMethod InventoryCustomBatchResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InventoryCustomBatchResponseEntry: A batch entry encoding a single +// non-batch inventory response. +type InventoryCustomBatchResponseEntry struct { + // BatchId: The ID of the request entry this entry responds to. + BatchId int64 `json:"batchId,omitempty"` + + // Errors: A list of errors defined if and only if the request failed. + Errors *Errors `json:"errors,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#inventoryCustomBatchResponseEntry". + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BatchId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InventoryCustomBatchResponseEntry) MarshalJSON() ([]byte, error) { + type noMethod InventoryCustomBatchResponseEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InventorySetRequest struct { + // Availability: The availability of the product. + Availability string `json:"availability,omitempty"` + + // Price: The price of the product. + Price *Price `json:"price,omitempty"` + + // Quantity: The quantity of the product. Must be equal to or greater + // than zero. Supported only for local products. + Quantity int64 `json:"quantity,omitempty"` + + // SalePrice: The sale price of the product. Mandatory if + // sale_price_effective_date is defined. + SalePrice *Price `json:"salePrice,omitempty"` + + // SalePriceEffectiveDate: A date range represented by a pair of ISO + // 8601 dates separated by a space, comma, or slash. Both dates might be + // specified as 'null' if undecided. + SalePriceEffectiveDate string `json:"salePriceEffectiveDate,omitempty"` + + // SellOnGoogleQuantity: The quantity of the product that is reserved + // for sell-on-google ads. Supported only for online products. + SellOnGoogleQuantity int64 `json:"sellOnGoogleQuantity,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Availability") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InventorySetRequest) MarshalJSON() ([]byte, error) { + type noMethod InventorySetRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InventorySetResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#inventorySetResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InventorySetResponse) MarshalJSON() ([]byte, error) { + type noMethod InventorySetResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type LoyaltyPoints struct { + // Name: Name of loyalty points program. It is recommended to limit the + // name to 12 full-width characters or 24 Roman characters. + Name string `json:"name,omitempty"` + + // PointsValue: The retailer's loyalty points in absolute value. + PointsValue int64 `json:"pointsValue,omitempty,string"` + + // Ratio: The ratio of a point when converted to currency. Google + // assumes currency based on Merchant Center settings. If ratio is left + // out, it defaults to 1.0. + Ratio float64 `json:"ratio,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LoyaltyPoints) MarshalJSON() ([]byte, error) { + type noMethod LoyaltyPoints + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Order struct { + // Acknowledged: Whether the order was acknowledged. + Acknowledged bool `json:"acknowledged,omitempty"` + + // Customer: The details of the customer who placed the order. + Customer *OrderCustomer `json:"customer,omitempty"` + + // DeliveryDetails: The details for the delivery. + DeliveryDetails *OrderDeliveryDetails `json:"deliveryDetails,omitempty"` + + // Id: The REST id of the order. Globally unique. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#order". + Kind string `json:"kind,omitempty"` + + // LineItems: Line items that are ordered. + LineItems []*OrderLineItem `json:"lineItems,omitempty"` + + MerchantId uint64 `json:"merchantId,omitempty,string"` + + // MerchantOrderId: Merchant-provided id of the order. + MerchantOrderId string `json:"merchantOrderId,omitempty"` + + // NetAmount: The net amount for the order. For example, if an order was + // originally for a grand total of $100 and a refund was issued for $20, + // the net amount will be $80. + NetAmount *Price `json:"netAmount,omitempty"` + + // PaymentMethod: The details of the payment method. + PaymentMethod *OrderPaymentMethod `json:"paymentMethod,omitempty"` + + // PaymentStatus: The status of the payment. + PaymentStatus string `json:"paymentStatus,omitempty"` + + // PlacedDate: The date when the order was placed, in ISO 8601 format. + PlacedDate string `json:"placedDate,omitempty"` + + // Refunds: Refunds for the order. + Refunds []*OrderRefund `json:"refunds,omitempty"` + + // Shipments: Shipments of the order. + Shipments []*OrderShipment `json:"shipments,omitempty"` + + // ShippingCost: The total cost of shipping for all items. + ShippingCost *Price `json:"shippingCost,omitempty"` + + // ShippingCostTax: The tax for the total shipping cost. + ShippingCostTax *Price `json:"shippingCostTax,omitempty"` + + // ShippingOption: The requested shipping option. + ShippingOption string `json:"shippingOption,omitempty"` + + // Status: The status of the order. + Status string `json:"status,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Acknowledged") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Order) MarshalJSON() ([]byte, error) { + type noMethod Order + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderAddress struct { + // Country: CLDR country code (e.g. "US"). + Country string `json:"country,omitempty"` + + // FullAddress: Strings representing the lines of the printed label for + // mailing the order, for example: + // John Smith + // 1600 Amphitheatre Parkway + // Mountain View, CA, 94043 + // United States + FullAddress []string `json:"fullAddress,omitempty"` + + // IsPostOfficeBox: Whether the address is a post office box. + IsPostOfficeBox bool `json:"isPostOfficeBox,omitempty"` + + // Locality: City, town or commune. May also include dependent + // localities or sublocalities (e.g. neighborhoods or suburbs). + Locality string `json:"locality,omitempty"` + + // PostalCode: Postal Code or ZIP (e.g. "94043"). + PostalCode string `json:"postalCode,omitempty"` + + // RecipientName: Name of the recipient. + RecipientName string `json:"recipientName,omitempty"` + + // Region: Top-level administrative subdivision of the country (e.g. + // "CA"). + Region string `json:"region,omitempty"` + + // StreetAddress: Street-level part of the address. + StreetAddress []string `json:"streetAddress,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Country") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderAddress) MarshalJSON() ([]byte, error) { + type noMethod OrderAddress + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderCancellation struct { + // Actor: The actor that created the cancellation. + Actor string `json:"actor,omitempty"` + + // CreationDate: Date on which the cancellation has been created, in ISO + // 8601 format. + CreationDate string `json:"creationDate,omitempty"` + + // Quantity: The quantity that was canceled. + Quantity int64 `json:"quantity,omitempty"` + + // Reason: The reason for the cancellation. + Reason string `json:"reason,omitempty"` + + // ReasonText: The explanation of the reason. + ReasonText string `json:"reasonText,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Actor") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderCancellation) MarshalJSON() ([]byte, error) { + type noMethod OrderCancellation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderCustomer struct { + // Email: Email address of the customer. + Email string `json:"email,omitempty"` + + // ExplicitMarketingPreference: If set, this indicates the user had a + // choice to opt in or out of providing marketing rights to the + // merchant. If unset, this indicates the user has already made this + // choice in a previous purchase, and was thus not shown the marketing + // right opt in/out checkbox during the Purchases on Google checkout + // flow. + ExplicitMarketingPreference bool `json:"explicitMarketingPreference,omitempty"` + + // FullName: Full name of the customer. + FullName string `json:"fullName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Email") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderCustomer) MarshalJSON() ([]byte, error) { + type noMethod OrderCustomer + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderDeliveryDetails struct { + // Address: The delivery address + Address *OrderAddress `json:"address,omitempty"` + + // PhoneNumber: The phone number of the person receiving the delivery. + PhoneNumber string `json:"phoneNumber,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Address") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderDeliveryDetails) MarshalJSON() ([]byte, error) { + type noMethod OrderDeliveryDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderLineItem struct { + // Cancellations: Cancellations of the line item. + Cancellations []*OrderCancellation `json:"cancellations,omitempty"` + + // Id: The id of the line item. + Id string `json:"id,omitempty"` + + // Price: Total price for the line item. For example, if two items for + // $10 are purchased, the total price will be $20. + Price *Price `json:"price,omitempty"` + + // Product: Product data from the time of the order placement. + Product *OrderLineItemProduct `json:"product,omitempty"` + + // QuantityCanceled: Number of items canceled. + QuantityCanceled int64 `json:"quantityCanceled,omitempty"` + + // QuantityDelivered: Number of items delivered. + QuantityDelivered int64 `json:"quantityDelivered,omitempty"` + + // QuantityOrdered: Number of items ordered. + QuantityOrdered int64 `json:"quantityOrdered,omitempty"` + + // QuantityPending: Number of items pending. + QuantityPending int64 `json:"quantityPending,omitempty"` + + // QuantityReturned: Number of items returned. + QuantityReturned int64 `json:"quantityReturned,omitempty"` + + // QuantityShipped: Number of items shipped. + QuantityShipped int64 `json:"quantityShipped,omitempty"` + + // ReturnInfo: Details of the return policy for the line item. + ReturnInfo *OrderLineItemReturnInfo `json:"returnInfo,omitempty"` + + // Returns: Returns of the line item. + Returns []*OrderReturn `json:"returns,omitempty"` + + // ShippingDetails: Details of the requested shipping for the line item. + ShippingDetails *OrderLineItemShippingDetails `json:"shippingDetails,omitempty"` + + // Tax: Total tax amount for the line item. For example, if two items + // are purchased, and each have a cost tax of $2, the total tax amount + // will be $4. + Tax *Price `json:"tax,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Cancellations") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderLineItem) MarshalJSON() ([]byte, error) { + type noMethod OrderLineItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderLineItemProduct struct { + // Brand: Brand of the item. + Brand string `json:"brand,omitempty"` + + // Channel: The item's channel (online or local). + Channel string `json:"channel,omitempty"` + + // Condition: Condition or state of the item. + Condition string `json:"condition,omitempty"` + + // ContentLanguage: The two-letter ISO 639-1 language code for the item. + ContentLanguage string `json:"contentLanguage,omitempty"` + + // Gtin: Global Trade Item Number (GTIN) of the item. + Gtin string `json:"gtin,omitempty"` + + // Id: The REST id of the product. + Id string `json:"id,omitempty"` + + // ImageLink: URL of an image of the item. + ImageLink string `json:"imageLink,omitempty"` + + // ItemGroupId: Shared identifier for all variants of the same product. + ItemGroupId string `json:"itemGroupId,omitempty"` + + // Mpn: Manufacturer Part Number (MPN) of the item. + Mpn string `json:"mpn,omitempty"` + + // OfferId: An identifier of the item. + OfferId string `json:"offerId,omitempty"` + + // Price: Price of the item. + Price *Price `json:"price,omitempty"` + + // ShownImage: URL to the cached image shown to the user when order was + // placed. + ShownImage string `json:"shownImage,omitempty"` + + // TargetCountry: The CLDR territory code of the target country of the + // product. + TargetCountry string `json:"targetCountry,omitempty"` + + // Title: The title of the product. + Title string `json:"title,omitempty"` + + // VariantAttributes: Variant attributes for the item. These are + // dimensions of the product, such as color, gender, material, pattern, + // and size. You can find a comprehensive list of variant attributes + // here. + VariantAttributes []*OrderLineItemProductVariantAttribute `json:"variantAttributes,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Brand") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderLineItemProduct) MarshalJSON() ([]byte, error) { + type noMethod OrderLineItemProduct + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderLineItemProductVariantAttribute struct { + // Dimension: The dimension of the variant. + Dimension string `json:"dimension,omitempty"` + + // Value: The value for the dimension. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Dimension") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderLineItemProductVariantAttribute) MarshalJSON() ([]byte, error) { + type noMethod OrderLineItemProductVariantAttribute + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderLineItemReturnInfo struct { + // DaysToReturn: How many days later the item can be returned. + DaysToReturn int64 `json:"daysToReturn,omitempty"` + + // IsReturnable: Whether the item is returnable. + IsReturnable bool `json:"isReturnable,omitempty"` + + // PolicyUrl: URL of the item return policy. + PolicyUrl string `json:"policyUrl,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DaysToReturn") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderLineItemReturnInfo) MarshalJSON() ([]byte, error) { + type noMethod OrderLineItemReturnInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderLineItemShippingDetails struct { + // DeliverByDate: The delivery by date, in ISO 8601 format. + DeliverByDate string `json:"deliverByDate,omitempty"` + + // Method: Details of the shipping method. + Method *OrderLineItemShippingDetailsMethod `json:"method,omitempty"` + + // ShipByDate: The ship by date, in ISO 8601 format. + ShipByDate string `json:"shipByDate,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DeliverByDate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderLineItemShippingDetails) MarshalJSON() ([]byte, error) { + type noMethod OrderLineItemShippingDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderLineItemShippingDetailsMethod struct { + // Carrier: The carrier for the shipping. Optional. + Carrier string `json:"carrier,omitempty"` + + // MaxDaysInTransit: Maximum transit time. + MaxDaysInTransit int64 `json:"maxDaysInTransit,omitempty"` + + // MethodName: The name of the shipping method. + MethodName string `json:"methodName,omitempty"` + + // MinDaysInTransit: Minimum transit time. + MinDaysInTransit int64 `json:"minDaysInTransit,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Carrier") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderLineItemShippingDetailsMethod) MarshalJSON() ([]byte, error) { + type noMethod OrderLineItemShippingDetailsMethod + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderPaymentMethod struct { + // BillingAddress: The billing address. + BillingAddress *OrderAddress `json:"billingAddress,omitempty"` + + // ExpirationMonth: The card expiration month (January = 1, February = 2 + // etc.). + ExpirationMonth int64 `json:"expirationMonth,omitempty"` + + // ExpirationYear: The card expiration year (4-digit, e.g. 2015). + ExpirationYear int64 `json:"expirationYear,omitempty"` + + // LastFourDigits: The last four digits of the card number. + LastFourDigits string `json:"lastFourDigits,omitempty"` + + // PhoneNumber: The billing phone number. + PhoneNumber string `json:"phoneNumber,omitempty"` + + // Type: The type of instrument (VISA, Mastercard, etc). + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BillingAddress") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderPaymentMethod) MarshalJSON() ([]byte, error) { + type noMethod OrderPaymentMethod + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderRefund struct { + // Actor: The actor that created the refund. + Actor string `json:"actor,omitempty"` + + // Amount: The amount that is refunded. + Amount *Price `json:"amount,omitempty"` + + // CreationDate: Date on which the item has been created, in ISO 8601 + // format. + CreationDate string `json:"creationDate,omitempty"` + + // Reason: The reason for the refund. + Reason string `json:"reason,omitempty"` + + // ReasonText: The explanation of the reason. + ReasonText string `json:"reasonText,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Actor") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderRefund) MarshalJSON() ([]byte, error) { + type noMethod OrderRefund + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderReturn struct { + // Actor: The actor that created the refund. + Actor string `json:"actor,omitempty"` + + // CreationDate: Date on which the item has been created, in ISO 8601 + // format. + CreationDate string `json:"creationDate,omitempty"` + + // Quantity: Quantity that is returned. + Quantity int64 `json:"quantity,omitempty"` + + // Reason: The reason for the return. + Reason string `json:"reason,omitempty"` + + // ReasonText: The explanation of the reason. + ReasonText string `json:"reasonText,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Actor") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderReturn) MarshalJSON() ([]byte, error) { + type noMethod OrderReturn + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderShipment struct { + // Carrier: The carrier handling the shipment. + Carrier string `json:"carrier,omitempty"` + + // CreationDate: Date on which the shipment has been created, in ISO + // 8601 format. + CreationDate string `json:"creationDate,omitempty"` + + // DeliveryDate: Date on which the shipment has been delivered, in ISO + // 8601 format. Present only if status is delievered + DeliveryDate string `json:"deliveryDate,omitempty"` + + // Id: The id of the shipment. + Id string `json:"id,omitempty"` + + // LineItems: The line items that are shipped. + LineItems []*OrderShipmentLineItemShipment `json:"lineItems,omitempty"` + + // Status: The status of the shipment. + Status string `json:"status,omitempty"` + + // TrackingId: The tracking id for the shipment. + TrackingId string `json:"trackingId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Carrier") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderShipment) MarshalJSON() ([]byte, error) { + type noMethod OrderShipment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderShipmentLineItemShipment struct { + // LineItemId: The id of the line item that is shipped. + LineItemId string `json:"lineItemId,omitempty"` + + // Quantity: The quantity that is shipped. + Quantity int64 `json:"quantity,omitempty"` + + // ForceSendFields is a list of field names (e.g. "LineItemId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderShipmentLineItemShipment) MarshalJSON() ([]byte, error) { + type noMethod OrderShipmentLineItemShipment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersAcknowledgeRequest struct { + // OperationId: The ID of the operation. Unique across all operations + // for a given order. + OperationId string `json:"operationId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "OperationId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersAcknowledgeRequest) MarshalJSON() ([]byte, error) { + type noMethod OrdersAcknowledgeRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersAcknowledgeResponse struct { + // ExecutionStatus: The status of the execution. + ExecutionStatus string `json:"executionStatus,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersAcknowledgeResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersAcknowledgeResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersAcknowledgeResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersAdvanceTestOrderResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersAdvanceTestOrderResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersAdvanceTestOrderResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersAdvanceTestOrderResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCancelLineItemRequest struct { + // LineItemId: The ID of the line item to cancel. + LineItemId string `json:"lineItemId,omitempty"` + + // OperationId: The ID of the operation. Unique across all operations + // for a given order. + OperationId string `json:"operationId,omitempty"` + + // Quantity: The quantity to cancel. + Quantity int64 `json:"quantity,omitempty"` + + // Reason: The reason for the cancellation. + Reason string `json:"reason,omitempty"` + + // ReasonText: The explanation of the reason. + ReasonText string `json:"reasonText,omitempty"` + + // ForceSendFields is a list of field names (e.g. "LineItemId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCancelLineItemRequest) MarshalJSON() ([]byte, error) { + type noMethod OrdersCancelLineItemRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCancelLineItemResponse struct { + // ExecutionStatus: The status of the execution. + ExecutionStatus string `json:"executionStatus,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersCancelLineItemResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCancelLineItemResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersCancelLineItemResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCancelRequest struct { + // OperationId: The ID of the operation. Unique across all operations + // for a given order. + OperationId string `json:"operationId,omitempty"` + + // Reason: The reason for the cancellation. + Reason string `json:"reason,omitempty"` + + // ReasonText: The explanation of the reason. + ReasonText string `json:"reasonText,omitempty"` + + // ForceSendFields is a list of field names (e.g. "OperationId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCancelRequest) MarshalJSON() ([]byte, error) { + type noMethod OrdersCancelRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCancelResponse struct { + // ExecutionStatus: The status of the execution. + ExecutionStatus string `json:"executionStatus,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersCancelResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCancelResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersCancelResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCreateTestOrderRequest struct { + // TemplateName: The test order template to use. Specify as an + // alternative to testOrder as a shortcut for retrieving a template and + // then creating an order using that template. + TemplateName string `json:"templateName,omitempty"` + + // TestOrder: The test order to create. + TestOrder *TestOrder `json:"testOrder,omitempty"` + + // ForceSendFields is a list of field names (e.g. "TemplateName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCreateTestOrderRequest) MarshalJSON() ([]byte, error) { + type noMethod OrdersCreateTestOrderRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCreateTestOrderResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersCreateTestOrderResponse". + Kind string `json:"kind,omitempty"` + + // OrderId: The ID of the newly created test order. + OrderId string `json:"orderId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCreateTestOrderResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersCreateTestOrderResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCustomBatchRequest struct { + // Entries: The request entries to be processed in the batch. + Entries []*OrdersCustomBatchRequestEntry `json:"entries,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Entries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCustomBatchRequest) MarshalJSON() ([]byte, error) { + type noMethod OrdersCustomBatchRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCustomBatchRequestEntry struct { + // BatchId: An entry ID, unique within the batch request. + BatchId int64 `json:"batchId,omitempty"` + + // Cancel: Required for cancel method. + Cancel *OrdersCustomBatchRequestEntryCancel `json:"cancel,omitempty"` + + // CancelLineItem: Required for cancelLineItem method. + CancelLineItem *OrdersCustomBatchRequestEntryCancelLineItem `json:"cancelLineItem,omitempty"` + + // MerchantId: The ID of the managing account. + MerchantId uint64 `json:"merchantId,omitempty,string"` + + // MerchantOrderId: The merchant order id. Required for + // updateMerchantOrderId and getByMerchantOrderId methods. + MerchantOrderId string `json:"merchantOrderId,omitempty"` + + // Method: The method to apply. + Method string `json:"method,omitempty"` + + // OperationId: The ID of the operation. Unique across all operations + // for a given order. Required for all methods beside get and + // getByMerchantOrderId. + OperationId string `json:"operationId,omitempty"` + + // OrderId: The ID of the order. Required for all methods beside + // getByMerchantOrderId. + OrderId string `json:"orderId,omitempty"` + + // Refund: Required for refund method. + Refund *OrdersCustomBatchRequestEntryRefund `json:"refund,omitempty"` + + // ReturnLineItem: Required for returnLineItem method. + ReturnLineItem *OrdersCustomBatchRequestEntryReturnLineItem `json:"returnLineItem,omitempty"` + + // ShipLineItems: Required for shipLineItems method. + ShipLineItems *OrdersCustomBatchRequestEntryShipLineItems `json:"shipLineItems,omitempty"` + + // UpdateShipment: Required for updateShipment method. + UpdateShipment *OrdersCustomBatchRequestEntryUpdateShipment `json:"updateShipment,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BatchId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCustomBatchRequestEntry) MarshalJSON() ([]byte, error) { + type noMethod OrdersCustomBatchRequestEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCustomBatchRequestEntryCancel struct { + // Reason: The reason for the cancellation. + Reason string `json:"reason,omitempty"` + + // ReasonText: The explanation of the reason. + ReasonText string `json:"reasonText,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Reason") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCustomBatchRequestEntryCancel) MarshalJSON() ([]byte, error) { + type noMethod OrdersCustomBatchRequestEntryCancel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCustomBatchRequestEntryCancelLineItem struct { + // LineItemId: The ID of the line item to cancel. + LineItemId string `json:"lineItemId,omitempty"` + + // Quantity: The quantity to cancel. + Quantity int64 `json:"quantity,omitempty"` + + // Reason: The reason for the cancellation. + Reason string `json:"reason,omitempty"` + + // ReasonText: The explanation of the reason. + ReasonText string `json:"reasonText,omitempty"` + + // ForceSendFields is a list of field names (e.g. "LineItemId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCustomBatchRequestEntryCancelLineItem) MarshalJSON() ([]byte, error) { + type noMethod OrdersCustomBatchRequestEntryCancelLineItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCustomBatchRequestEntryRefund struct { + // Amount: The amount that is refunded. + Amount *Price `json:"amount,omitempty"` + + // Reason: The reason for the refund. + Reason string `json:"reason,omitempty"` + + // ReasonText: The explanation of the reason. + ReasonText string `json:"reasonText,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Amount") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCustomBatchRequestEntryRefund) MarshalJSON() ([]byte, error) { + type noMethod OrdersCustomBatchRequestEntryRefund + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCustomBatchRequestEntryReturnLineItem struct { + // LineItemId: The ID of the line item to return. + LineItemId string `json:"lineItemId,omitempty"` + + // Quantity: The quantity to return. + Quantity int64 `json:"quantity,omitempty"` + + // Reason: The reason for the return. + Reason string `json:"reason,omitempty"` + + // ReasonText: The explanation of the reason. + ReasonText string `json:"reasonText,omitempty"` + + // ForceSendFields is a list of field names (e.g. "LineItemId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCustomBatchRequestEntryReturnLineItem) MarshalJSON() ([]byte, error) { + type noMethod OrdersCustomBatchRequestEntryReturnLineItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCustomBatchRequestEntryShipLineItems struct { + // Carrier: The carrier handling the shipment. + Carrier string `json:"carrier,omitempty"` + + // LineItems: Line items to ship. + LineItems []*OrderShipmentLineItemShipment `json:"lineItems,omitempty"` + + // ShipmentId: The ID of the shipment. + ShipmentId string `json:"shipmentId,omitempty"` + + // TrackingId: The tracking id for the shipment. + TrackingId string `json:"trackingId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Carrier") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCustomBatchRequestEntryShipLineItems) MarshalJSON() ([]byte, error) { + type noMethod OrdersCustomBatchRequestEntryShipLineItems + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCustomBatchRequestEntryUpdateShipment struct { + // Carrier: The carrier handling the shipment. Not updated if missing. + Carrier string `json:"carrier,omitempty"` + + // ShipmentId: The ID of the shipment. + ShipmentId string `json:"shipmentId,omitempty"` + + // Status: New status for the shipment. Not updated if missing. + Status string `json:"status,omitempty"` + + // TrackingId: The tracking id for the shipment. Not updated if missing. + TrackingId string `json:"trackingId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Carrier") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCustomBatchRequestEntryUpdateShipment) MarshalJSON() ([]byte, error) { + type noMethod OrdersCustomBatchRequestEntryUpdateShipment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCustomBatchResponse struct { + // Entries: The result of the execution of the batch requests. + Entries []*OrdersCustomBatchResponseEntry `json:"entries,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersCustomBatchResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Entries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCustomBatchResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersCustomBatchResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCustomBatchResponseEntry struct { + // BatchId: The ID of the request entry this entry responds to. + BatchId int64 `json:"batchId,omitempty"` + + // Errors: A list of errors defined if and only if the request failed. + Errors *Errors `json:"errors,omitempty"` + + // ExecutionStatus: The status of the execution. Only defined if the + // method is not get or getByMerchantOrderId and if the request was + // successful. + ExecutionStatus string `json:"executionStatus,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersCustomBatchResponseEntry". + Kind string `json:"kind,omitempty"` + + // Order: The retrieved order. Only defined if the method is get and if + // the request was successful. + Order *Order `json:"order,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BatchId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCustomBatchResponseEntry) MarshalJSON() ([]byte, error) { + type noMethod OrdersCustomBatchResponseEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersGetByMerchantOrderIdResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersGetByMerchantOrderIdResponse". + Kind string `json:"kind,omitempty"` + + // Order: The requested order. + Order *Order `json:"order,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersGetByMerchantOrderIdResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersGetByMerchantOrderIdResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersGetTestOrderTemplateResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersGetTestOrderTemplateResponse". + Kind string `json:"kind,omitempty"` + + // Template: The requested test order template. + Template *TestOrder `json:"template,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersGetTestOrderTemplateResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersGetTestOrderTemplateResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token for the retrieval of the next page of + // orders. + NextPageToken string `json:"nextPageToken,omitempty"` + + Resources []*Order `json:"resources,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersListResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersRefundRequest struct { + // Amount: The amount that is refunded. + Amount *Price `json:"amount,omitempty"` + + // OperationId: The ID of the operation. Unique across all operations + // for a given order. + OperationId string `json:"operationId,omitempty"` + + // Reason: The reason for the refund. + Reason string `json:"reason,omitempty"` + + // ReasonText: The explanation of the reason. + ReasonText string `json:"reasonText,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Amount") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersRefundRequest) MarshalJSON() ([]byte, error) { + type noMethod OrdersRefundRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersRefundResponse struct { + // ExecutionStatus: The status of the execution. + ExecutionStatus string `json:"executionStatus,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersRefundResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersRefundResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersRefundResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersReturnLineItemRequest struct { + // LineItemId: The ID of the line item to return. + LineItemId string `json:"lineItemId,omitempty"` + + // OperationId: The ID of the operation. Unique across all operations + // for a given order. + OperationId string `json:"operationId,omitempty"` + + // Quantity: The quantity to return. + Quantity int64 `json:"quantity,omitempty"` + + // Reason: The reason for the return. + Reason string `json:"reason,omitempty"` + + // ReasonText: The explanation of the reason. + ReasonText string `json:"reasonText,omitempty"` + + // ForceSendFields is a list of field names (e.g. "LineItemId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersReturnLineItemRequest) MarshalJSON() ([]byte, error) { + type noMethod OrdersReturnLineItemRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersReturnLineItemResponse struct { + // ExecutionStatus: The status of the execution. + ExecutionStatus string `json:"executionStatus,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersReturnLineItemResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersReturnLineItemResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersReturnLineItemResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersShipLineItemsRequest struct { + // Carrier: The carrier handling the shipment. + Carrier string `json:"carrier,omitempty"` + + // LineItems: Line items to ship. + LineItems []*OrderShipmentLineItemShipment `json:"lineItems,omitempty"` + + // OperationId: The ID of the operation. Unique across all operations + // for a given order. + OperationId string `json:"operationId,omitempty"` + + // ShipmentId: The ID of the shipment. + ShipmentId string `json:"shipmentId,omitempty"` + + // TrackingId: The tracking id for the shipment. + TrackingId string `json:"trackingId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Carrier") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersShipLineItemsRequest) MarshalJSON() ([]byte, error) { + type noMethod OrdersShipLineItemsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersShipLineItemsResponse struct { + // ExecutionStatus: The status of the execution. + ExecutionStatus string `json:"executionStatus,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersShipLineItemsResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersShipLineItemsResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersShipLineItemsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersUpdateMerchantOrderIdRequest struct { + // MerchantOrderId: The merchant order id to be assigned to the order. + // Must be unique per merchant. + MerchantOrderId string `json:"merchantOrderId,omitempty"` + + // OperationId: The ID of the operation. Unique across all operations + // for a given order. + OperationId string `json:"operationId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MerchantOrderId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersUpdateMerchantOrderIdRequest) MarshalJSON() ([]byte, error) { + type noMethod OrdersUpdateMerchantOrderIdRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersUpdateMerchantOrderIdResponse struct { + // ExecutionStatus: The status of the execution. + ExecutionStatus string `json:"executionStatus,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersUpdateMerchantOrderIdResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersUpdateMerchantOrderIdResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersUpdateMerchantOrderIdResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersUpdateShipmentRequest struct { + // Carrier: The carrier handling the shipment. Not updated if missing. + Carrier string `json:"carrier,omitempty"` + + // OperationId: The ID of the operation. Unique across all operations + // for a given order. + OperationId string `json:"operationId,omitempty"` + + // ShipmentId: The ID of the shipment. + ShipmentId string `json:"shipmentId,omitempty"` + + // Status: New status for the shipment. Not updated if missing. + Status string `json:"status,omitempty"` + + // TrackingId: The tracking id for the shipment. Not updated if missing. + TrackingId string `json:"trackingId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Carrier") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersUpdateShipmentRequest) MarshalJSON() ([]byte, error) { + type noMethod OrdersUpdateShipmentRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersUpdateShipmentResponse struct { + // ExecutionStatus: The status of the execution. + ExecutionStatus string `json:"executionStatus,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersUpdateShipmentResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersUpdateShipmentResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersUpdateShipmentResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Price struct { + // Currency: The currency of the price. + Currency string `json:"currency,omitempty"` + + // Value: The price represented as a number. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Currency") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Price) MarshalJSON() ([]byte, error) { + type noMethod Price + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Product: Product data. +type Product struct { + // AdditionalImageLinks: Additional URLs of images of the item. + AdditionalImageLinks []string `json:"additionalImageLinks,omitempty"` + + // Adult: Set to true if the item is targeted towards adults. + Adult bool `json:"adult,omitempty"` + + // AdwordsGrouping: Used to group items in an arbitrary way. Only for + // CPA%, discouraged otherwise. + AdwordsGrouping string `json:"adwordsGrouping,omitempty"` + + // AdwordsLabels: Similar to adwords_grouping, but only works on CPC. + AdwordsLabels []string `json:"adwordsLabels,omitempty"` + + // AdwordsRedirect: Allows advertisers to override the item URL when the + // product is shown within the context of Product Ads. + AdwordsRedirect string `json:"adwordsRedirect,omitempty"` + + // AgeGroup: Target age group of the item. + AgeGroup string `json:"ageGroup,omitempty"` + + // Aspects: Specifies the intended aspects for the product. + Aspects []*ProductAspect `json:"aspects,omitempty"` + + // Availability: Availability status of the item. + Availability string `json:"availability,omitempty"` + + // AvailabilityDate: The day a pre-ordered product becomes available for + // delivery, in ISO 8601 format. + AvailabilityDate string `json:"availabilityDate,omitempty"` + + // Brand: Brand of the item. + Brand string `json:"brand,omitempty"` + + // Channel: The item's channel (online or local). + Channel string `json:"channel,omitempty"` + + // Color: Color of the item. + Color string `json:"color,omitempty"` + + // Condition: Condition or state of the item. + Condition string `json:"condition,omitempty"` + + // ContentLanguage: The two-letter ISO 639-1 language code for the item. + ContentLanguage string `json:"contentLanguage,omitempty"` + + // CustomAttributes: A list of custom (merchant-provided) attributes. It + // can also be used for submitting any attribute of the feed + // specification in its generic form (e.g., { "name": "size type", + // "type": "text", "value": "regular" }). This is useful for submitting + // attributes not explicitly exposed by the API. + CustomAttributes []*ProductCustomAttribute `json:"customAttributes,omitempty"` + + // CustomGroups: A list of custom (merchant-provided) custom attribute + // groups. + CustomGroups []*ProductCustomGroup `json:"customGroups,omitempty"` + + // CustomLabel0: Custom label 0 for custom grouping of items in a + // Shopping campaign. + CustomLabel0 string `json:"customLabel0,omitempty"` + + // CustomLabel1: Custom label 1 for custom grouping of items in a + // Shopping campaign. + CustomLabel1 string `json:"customLabel1,omitempty"` + + // CustomLabel2: Custom label 2 for custom grouping of items in a + // Shopping campaign. + CustomLabel2 string `json:"customLabel2,omitempty"` + + // CustomLabel3: Custom label 3 for custom grouping of items in a + // Shopping campaign. + CustomLabel3 string `json:"customLabel3,omitempty"` + + // CustomLabel4: Custom label 4 for custom grouping of items in a + // Shopping campaign. + CustomLabel4 string `json:"customLabel4,omitempty"` + + // Description: Description of the item. + Description string `json:"description,omitempty"` + + // Destinations: Specifies the intended destinations for the product. + Destinations []*ProductDestination `json:"destinations,omitempty"` + + // DisplayAdsId: An identifier for an item for dynamic remarketing + // campaigns. + DisplayAdsId string `json:"displayAdsId,omitempty"` + + // DisplayAdsLink: URL directly to your item's landing page for dynamic + // remarketing campaigns. + DisplayAdsLink string `json:"displayAdsLink,omitempty"` + + // DisplayAdsSimilarIds: Advertiser-specified recommendations. + DisplayAdsSimilarIds []string `json:"displayAdsSimilarIds,omitempty"` + + // DisplayAdsTitle: Title of an item for dynamic remarketing campaigns. + DisplayAdsTitle string `json:"displayAdsTitle,omitempty"` + + // DisplayAdsValue: Offer margin for dynamic remarketing campaigns. + DisplayAdsValue float64 `json:"displayAdsValue,omitempty"` + + // EnergyEfficiencyClass: The energy efficiency class as defined in EU + // directive 2010/30/EU. + EnergyEfficiencyClass string `json:"energyEfficiencyClass,omitempty"` + + // ExpirationDate: Date on which the item should expire, as specified + // upon insertion, in ISO 8601 format. The actual expiration date in + // Google Shopping is exposed in productstatuses as googleExpirationDate + // and might be earlier if expirationDate is too far in the future. + ExpirationDate string `json:"expirationDate,omitempty"` + + // Gender: Target gender of the item. + Gender string `json:"gender,omitempty"` + + // GoogleProductCategory: Google's category of the item (see Google + // product taxonomy). + GoogleProductCategory string `json:"googleProductCategory,omitempty"` + + // Gtin: Global Trade Item Number (GTIN) of the item. + Gtin string `json:"gtin,omitempty"` + + // Id: The REST id of the product. + Id string `json:"id,omitempty"` + + // IdentifierExists: False when the item does not have unique product + // identifiers appropriate to its category, such as GTIN, MPN, and + // brand. Required according to the Unique Product Identifier Rules for + // all target countries except for Canada. + IdentifierExists bool `json:"identifierExists,omitempty"` + + // ImageLink: URL of an image of the item. + ImageLink string `json:"imageLink,omitempty"` + + // Installment: Number and amount of installments to pay for an item. + // Brazil only. + Installment *ProductInstallment `json:"installment,omitempty"` + + // IsBundle: Whether the item is a merchant-defined bundle. A bundle is + // a custom grouping of different products sold by a merchant for a + // single price. + IsBundle bool `json:"isBundle,omitempty"` + + // ItemGroupId: Shared identifier for all variants of the same product. + ItemGroupId string `json:"itemGroupId,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#product". + Kind string `json:"kind,omitempty"` + + // Link: URL directly linking to your item's page on your website. + Link string `json:"link,omitempty"` + + // LoyaltyPoints: Loyalty points that users receive after purchasing the + // item. Japan only. + LoyaltyPoints *LoyaltyPoints `json:"loyaltyPoints,omitempty"` + + // Material: The material of which the item is made. + Material string `json:"material,omitempty"` + + // MobileLink: Link to a mobile-optimized version of the landing page. + MobileLink string `json:"mobileLink,omitempty"` + + // Mpn: Manufacturer Part Number (MPN) of the item. + Mpn string `json:"mpn,omitempty"` + + // Multipack: The number of identical products in a merchant-defined + // multipack. + Multipack int64 `json:"multipack,omitempty,string"` + + // OfferId: An identifier of the item. + OfferId string `json:"offerId,omitempty"` + + // OnlineOnly: Whether an item is available for purchase only online. + OnlineOnly bool `json:"onlineOnly,omitempty"` + + // Pattern: The item's pattern (e.g. polka dots). + Pattern string `json:"pattern,omitempty"` + + // Price: Price of the item. + Price *Price `json:"price,omitempty"` + + // ProductType: Your category of the item (formatted as in product feeds + // specification). + ProductType string `json:"productType,omitempty"` + + // SalePrice: Advertised sale price of the item. + SalePrice *Price `json:"salePrice,omitempty"` + + // SalePriceEffectiveDate: Date range during which the item is on sale + // (see product feed specifications). + SalePriceEffectiveDate string `json:"salePriceEffectiveDate,omitempty"` + + // SellOnGoogleQuantity: The quantity of the product that is reserved + // for sell-on-google ads. + SellOnGoogleQuantity int64 `json:"sellOnGoogleQuantity,omitempty,string"` + + // Shipping: Shipping rules. + Shipping []*ProductShipping `json:"shipping,omitempty"` + + // ShippingHeight: Height of the item for shipping. + ShippingHeight *ProductShippingDimension `json:"shippingHeight,omitempty"` + + // ShippingLabel: The shipping label of the product, used to group + // product in account-level shipping rules. + ShippingLabel string `json:"shippingLabel,omitempty"` + + // ShippingLength: Length of the item for shipping. + ShippingLength *ProductShippingDimension `json:"shippingLength,omitempty"` + + // ShippingWeight: Weight of the item for shipping. + ShippingWeight *ProductShippingWeight `json:"shippingWeight,omitempty"` + + // ShippingWidth: Width of the item for shipping. + ShippingWidth *ProductShippingDimension `json:"shippingWidth,omitempty"` + + // SizeSystem: System in which the size is specified. Recommended for + // apparel items. + SizeSystem string `json:"sizeSystem,omitempty"` + + // SizeType: The cut of the item. Recommended for apparel items. + SizeType string `json:"sizeType,omitempty"` + + // Sizes: Size of the item. + Sizes []string `json:"sizes,omitempty"` + + // TargetCountry: The CLDR territory code for the item. + TargetCountry string `json:"targetCountry,omitempty"` + + // Taxes: Tax information. + Taxes []*ProductTax `json:"taxes,omitempty"` + + // Title: Title of the item. + Title string `json:"title,omitempty"` + + // UnitPricingBaseMeasure: The preference of the denominator of the unit + // price. + UnitPricingBaseMeasure *ProductUnitPricingBaseMeasure `json:"unitPricingBaseMeasure,omitempty"` + + // UnitPricingMeasure: The measure and dimension of an item. + UnitPricingMeasure *ProductUnitPricingMeasure `json:"unitPricingMeasure,omitempty"` + + // ValidatedDestinations: The read-only list of intended destinations + // which passed validation. + ValidatedDestinations []string `json:"validatedDestinations,omitempty"` + + // Warnings: Read-only warnings. + Warnings []*Error `json:"warnings,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "AdditionalImageLinks") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Product) MarshalJSON() ([]byte, error) { + type noMethod Product + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ProductAspect struct { + // AspectName: The name of the aspect. + AspectName string `json:"aspectName,omitempty"` + + // DestinationName: The name of the destination. Leave out to apply to + // all destinations. + DestinationName string `json:"destinationName,omitempty"` + + // Intention: Whether the aspect is required, excluded or should be + // validated. + Intention string `json:"intention,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AspectName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductAspect) MarshalJSON() ([]byte, error) { + type noMethod ProductAspect + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ProductCustomAttribute struct { + // Name: The name of the attribute. Underscores will be replaced by + // spaces upon insertion. + Name string `json:"name,omitempty"` + + // Type: The type of the attribute. + Type string `json:"type,omitempty"` + + // Unit: Free-form unit of the attribute. Unit can only be used for + // values of type INT or FLOAT. + Unit string `json:"unit,omitempty"` + + // Value: The value of the attribute. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductCustomAttribute) MarshalJSON() ([]byte, error) { + type noMethod ProductCustomAttribute + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ProductCustomGroup struct { + // Attributes: The sub-attributes. + Attributes []*ProductCustomAttribute `json:"attributes,omitempty"` + + // Name: The name of the group. Underscores will be replaced by spaces + // upon insertion. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Attributes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductCustomGroup) MarshalJSON() ([]byte, error) { + type noMethod ProductCustomGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ProductDestination struct { + // DestinationName: The name of the destination. + DestinationName string `json:"destinationName,omitempty"` + + // Intention: Whether the destination is required, excluded or should be + // validated. + Intention string `json:"intention,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DestinationName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductDestination) MarshalJSON() ([]byte, error) { + type noMethod ProductDestination + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ProductInstallment struct { + // Amount: The amount the buyer has to pay per month. + Amount *Price `json:"amount,omitempty"` + + // Months: The number of installments the buyer has to pay. + Months int64 `json:"months,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Amount") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductInstallment) MarshalJSON() ([]byte, error) { + type noMethod ProductInstallment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ProductShipping struct { + // Country: The CLDR territory code of the country to which an item will + // ship. + Country string `json:"country,omitempty"` + + // LocationGroupName: The location where the shipping is applicable, + // represented by a location group name. + LocationGroupName string `json:"locationGroupName,omitempty"` + + // LocationId: The numeric id of a location that the shipping rate + // applies to as defined in the AdWords API. + LocationId int64 `json:"locationId,omitempty,string"` + + // PostalCode: The postal code range that the shipping rate applies to, + // represented by a postal code, a postal code prefix followed by a * + // wildcard, a range between two postal codes or two postal code + // prefixes of equal length. + PostalCode string `json:"postalCode,omitempty"` + + // Price: Fixed shipping price, represented as a number. + Price *Price `json:"price,omitempty"` + + // Region: The geographic region to which a shipping rate applies (e.g. + // zip code). + Region string `json:"region,omitempty"` + + // Service: A free-form description of the service class or delivery + // speed. + Service string `json:"service,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Country") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductShipping) MarshalJSON() ([]byte, error) { + type noMethod ProductShipping + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ProductShippingDimension struct { + // Unit: The unit of value. + // + // Acceptable values are: + // - "cm" + // - "in" + Unit string `json:"unit,omitempty"` + + // Value: The dimension of the product used to calculate the shipping + // cost of the item. + Value float64 `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Unit") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductShippingDimension) MarshalJSON() ([]byte, error) { + type noMethod ProductShippingDimension + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ProductShippingWeight struct { + // Unit: The unit of value. + Unit string `json:"unit,omitempty"` + + // Value: The weight of the product used to calculate the shipping cost + // of the item. + Value float64 `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Unit") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductShippingWeight) MarshalJSON() ([]byte, error) { + type noMethod ProductShippingWeight + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ProductStatus: The status of a product, i.e., information about a +// product computed asynchronously by the data quality analysis. +type ProductStatus struct { + // CreationDate: Date on which the item has been created, in ISO 8601 + // format. + CreationDate string `json:"creationDate,omitempty"` + + // DataQualityIssues: A list of data quality issues associated with the + // product. + DataQualityIssues []*ProductStatusDataQualityIssue `json:"dataQualityIssues,omitempty"` + + // DestinationStatuses: The intended destinations for the product. + DestinationStatuses []*ProductStatusDestinationStatus `json:"destinationStatuses,omitempty"` + + // GoogleExpirationDate: Date on which the item expires in Google + // Shopping, in ISO 8601 format. + GoogleExpirationDate string `json:"googleExpirationDate,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#productStatus". + Kind string `json:"kind,omitempty"` + + // LastUpdateDate: Date on which the item has been last updated, in ISO + // 8601 format. + LastUpdateDate string `json:"lastUpdateDate,omitempty"` + + // Link: The link to the product. + Link string `json:"link,omitempty"` + + // ProductId: The id of the product for which status is reported. + ProductId string `json:"productId,omitempty"` + + // Title: The title of the product. + Title string `json:"title,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationDate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductStatus) MarshalJSON() ([]byte, error) { + type noMethod ProductStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ProductStatusDataQualityIssue struct { + // Detail: A more detailed error string. + Detail string `json:"detail,omitempty"` + + // FetchStatus: The fetch status for landing_page_errors. + FetchStatus string `json:"fetchStatus,omitempty"` + + // Id: The id of the data quality issue. + Id string `json:"id,omitempty"` + + // Location: The attribute name that is relevant for the issue. + Location string `json:"location,omitempty"` + + // Severity: The severity of the data quality issue. + Severity string `json:"severity,omitempty"` + + // Timestamp: The time stamp of the data quality issue. + Timestamp string `json:"timestamp,omitempty"` + + // ValueOnLandingPage: The value of that attribute that was found on the + // landing page + ValueOnLandingPage string `json:"valueOnLandingPage,omitempty"` + + // ValueProvided: The value the attribute had at time of evaluation. + ValueProvided string `json:"valueProvided,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Detail") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductStatusDataQualityIssue) MarshalJSON() ([]byte, error) { + type noMethod ProductStatusDataQualityIssue + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ProductStatusDestinationStatus struct { + // ApprovalStatus: The destination's approval status. + ApprovalStatus string `json:"approvalStatus,omitempty"` + + // Destination: The name of the destination + Destination string `json:"destination,omitempty"` + + // Intention: Whether the destination is required, excluded, selected by + // default or should be validated. + Intention string `json:"intention,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ApprovalStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductStatusDestinationStatus) MarshalJSON() ([]byte, error) { + type noMethod ProductStatusDestinationStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ProductTax struct { + // Country: The country within which the item is taxed, specified as a + // CLDR territory code. + Country string `json:"country,omitempty"` + + // LocationId: The numeric id of a location that the tax rate applies to + // as defined in the AdWords API. + LocationId int64 `json:"locationId,omitempty,string"` + + // PostalCode: The postal code range that the tax rate applies to, + // represented by a ZIP code, a ZIP code prefix using * wildcard, a + // range between two ZIP codes or two ZIP code prefixes of equal length. + // Examples: 94114, 94*, 94002-95460, 94*-95*. + PostalCode string `json:"postalCode,omitempty"` + + // Rate: The percentage of tax rate that applies to the item price. + Rate float64 `json:"rate,omitempty"` + + // Region: The geographic region to which the tax rate applies. + Region string `json:"region,omitempty"` + + // TaxShip: Set to true if tax is charged on shipping. + TaxShip bool `json:"taxShip,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Country") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductTax) MarshalJSON() ([]byte, error) { + type noMethod ProductTax + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ProductUnitPricingBaseMeasure struct { + // Unit: The unit of the denominator. + Unit string `json:"unit,omitempty"` + + // Value: The denominator of the unit price. + Value int64 `json:"value,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Unit") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductUnitPricingBaseMeasure) MarshalJSON() ([]byte, error) { + type noMethod ProductUnitPricingBaseMeasure + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ProductUnitPricingMeasure struct { + // Unit: The unit of the measure. + Unit string `json:"unit,omitempty"` + + // Value: The measure of an item. + Value float64 `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Unit") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductUnitPricingMeasure) MarshalJSON() ([]byte, error) { + type noMethod ProductUnitPricingMeasure + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ProductsCustomBatchRequest struct { + // Entries: The request entries to be processed in the batch. + Entries []*ProductsCustomBatchRequestEntry `json:"entries,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Entries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductsCustomBatchRequest) MarshalJSON() ([]byte, error) { + type noMethod ProductsCustomBatchRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ProductsCustomBatchRequestEntry: A batch entry encoding a single +// non-batch products request. +type ProductsCustomBatchRequestEntry struct { + // BatchId: An entry ID, unique within the batch request. + BatchId int64 `json:"batchId,omitempty"` + + // MerchantId: The ID of the managing account. + MerchantId uint64 `json:"merchantId,omitempty,string"` + + Method string `json:"method,omitempty"` + + // Product: The product to insert. Only required if the method is + // insert. + Product *Product `json:"product,omitempty"` + + // ProductId: The ID of the product to get or delete. Only defined if + // the method is get or delete. + ProductId string `json:"productId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BatchId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductsCustomBatchRequestEntry) MarshalJSON() ([]byte, error) { + type noMethod ProductsCustomBatchRequestEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ProductsCustomBatchResponse struct { + // Entries: The result of the execution of the batch requests. + Entries []*ProductsCustomBatchResponseEntry `json:"entries,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#productsCustomBatchResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Entries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductsCustomBatchResponse) MarshalJSON() ([]byte, error) { + type noMethod ProductsCustomBatchResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ProductsCustomBatchResponseEntry: A batch entry encoding a single +// non-batch products response. +type ProductsCustomBatchResponseEntry struct { + // BatchId: The ID of the request entry this entry responds to. + BatchId int64 `json:"batchId,omitempty"` + + // Errors: A list of errors defined if and only if the request failed. + Errors *Errors `json:"errors,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#productsCustomBatchResponseEntry". + Kind string `json:"kind,omitempty"` + + // Product: The inserted product. Only defined if the method is insert + // and if the request was successful. + Product *Product `json:"product,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BatchId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductsCustomBatchResponseEntry) MarshalJSON() ([]byte, error) { + type noMethod ProductsCustomBatchResponseEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ProductsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#productsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token for the retrieval of the next page of + // products. + NextPageToken string `json:"nextPageToken,omitempty"` + + Resources []*Product `json:"resources,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductsListResponse) MarshalJSON() ([]byte, error) { + type noMethod ProductsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ProductstatusesCustomBatchRequest struct { + // Entries: The request entries to be processed in the batch. + Entries []*ProductstatusesCustomBatchRequestEntry `json:"entries,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Entries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductstatusesCustomBatchRequest) MarshalJSON() ([]byte, error) { + type noMethod ProductstatusesCustomBatchRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ProductstatusesCustomBatchRequestEntry: A batch entry encoding a +// single non-batch productstatuses request. +type ProductstatusesCustomBatchRequestEntry struct { + // BatchId: An entry ID, unique within the batch request. + BatchId int64 `json:"batchId,omitempty"` + + // MerchantId: The ID of the managing account. + MerchantId uint64 `json:"merchantId,omitempty,string"` + + Method string `json:"method,omitempty"` + + // ProductId: The ID of the product whose status to get. + ProductId string `json:"productId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BatchId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductstatusesCustomBatchRequestEntry) MarshalJSON() ([]byte, error) { + type noMethod ProductstatusesCustomBatchRequestEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ProductstatusesCustomBatchResponse struct { + // Entries: The result of the execution of the batch requests. + Entries []*ProductstatusesCustomBatchResponseEntry `json:"entries,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#productstatusesCustomBatchResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Entries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductstatusesCustomBatchResponse) MarshalJSON() ([]byte, error) { + type noMethod ProductstatusesCustomBatchResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ProductstatusesCustomBatchResponseEntry: A batch entry encoding a +// single non-batch productstatuses response. +type ProductstatusesCustomBatchResponseEntry struct { + // BatchId: The ID of the request entry this entry responds to. + BatchId int64 `json:"batchId,omitempty"` + + // Errors: A list of errors, if the request failed. + Errors *Errors `json:"errors,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#productstatusesCustomBatchResponseEntry". + Kind string `json:"kind,omitempty"` + + // ProductStatus: The requested product status. Only defined if the + // request was successful. + ProductStatus *ProductStatus `json:"productStatus,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BatchId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductstatusesCustomBatchResponseEntry) MarshalJSON() ([]byte, error) { + type noMethod ProductstatusesCustomBatchResponseEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ProductstatusesListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#productstatusesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token for the retrieval of the next page of + // products statuses. + NextPageToken string `json:"nextPageToken,omitempty"` + + Resources []*ProductStatus `json:"resources,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProductstatusesListResponse) MarshalJSON() ([]byte, error) { + type noMethod ProductstatusesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TestOrder struct { + // Customer: The details of the customer who placed the order. + Customer *TestOrderCustomer `json:"customer,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#testOrder". + Kind string `json:"kind,omitempty"` + + // LineItems: Line items that are ordered. At least one line item must + // be provided. + LineItems []*TestOrderLineItem `json:"lineItems,omitempty"` + + // PaymentMethod: The details of the payment method. + PaymentMethod *TestOrderPaymentMethod `json:"paymentMethod,omitempty"` + + // PredefinedDeliveryAddress: Identifier of one of the predefined + // delivery addresses for the delivery. + PredefinedDeliveryAddress string `json:"predefinedDeliveryAddress,omitempty"` + + // ShippingCost: The total cost of shipping for all items. + ShippingCost *Price `json:"shippingCost,omitempty"` + + // ShippingCostTax: The tax for the total shipping cost. + ShippingCostTax *Price `json:"shippingCostTax,omitempty"` + + // ShippingOption: The requested shipping option. + ShippingOption string `json:"shippingOption,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Customer") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TestOrder) MarshalJSON() ([]byte, error) { + type noMethod TestOrder + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TestOrderCustomer struct { + // Email: Email address of the customer. + Email string `json:"email,omitempty"` + + // ExplicitMarketingPreference: If set, this indicates the user had a + // choice to opt in or out of providing marketing rights to the + // merchant. If unset, this indicates the user has already made this + // choice in a previous purchase, and was thus not shown the marketing + // right opt in/out checkbox during the Purchases on Google checkout + // flow. Optional. + ExplicitMarketingPreference bool `json:"explicitMarketingPreference,omitempty"` + + // FullName: Full name of the customer. + FullName string `json:"fullName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Email") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TestOrderCustomer) MarshalJSON() ([]byte, error) { + type noMethod TestOrderCustomer + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TestOrderLineItem struct { + // Product: Product data from the time of the order placement. + Product *TestOrderLineItemProduct `json:"product,omitempty"` + + // QuantityOrdered: Number of items ordered. + QuantityOrdered int64 `json:"quantityOrdered,omitempty"` + + // ReturnInfo: Details of the return policy for the line item. + ReturnInfo *OrderLineItemReturnInfo `json:"returnInfo,omitempty"` + + // ShippingDetails: Details of the requested shipping for the line item. + ShippingDetails *OrderLineItemShippingDetails `json:"shippingDetails,omitempty"` + + // UnitTax: Unit tax for the line item. + UnitTax *Price `json:"unitTax,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Product") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TestOrderLineItem) MarshalJSON() ([]byte, error) { + type noMethod TestOrderLineItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TestOrderLineItemProduct struct { + // Brand: Brand of the item. + Brand string `json:"brand,omitempty"` + + // Channel: The item's channel. + Channel string `json:"channel,omitempty"` + + // Condition: Condition or state of the item. + Condition string `json:"condition,omitempty"` + + // ContentLanguage: The two-letter ISO 639-1 language code for the item. + ContentLanguage string `json:"contentLanguage,omitempty"` + + // Gtin: Global Trade Item Number (GTIN) of the item. Optional. + Gtin string `json:"gtin,omitempty"` + + // ImageLink: URL of an image of the item. + ImageLink string `json:"imageLink,omitempty"` + + // ItemGroupId: Shared identifier for all variants of the same product. + // Optional. + ItemGroupId string `json:"itemGroupId,omitempty"` + + // Mpn: Manufacturer Part Number (MPN) of the item. Optional. + Mpn string `json:"mpn,omitempty"` + + // OfferId: An identifier of the item. + OfferId string `json:"offerId,omitempty"` + + // Price: The price for the product. + Price *Price `json:"price,omitempty"` + + // TargetCountry: The CLDR territory code of the target country of the + // product. + TargetCountry string `json:"targetCountry,omitempty"` + + // Title: The title of the product. + Title string `json:"title,omitempty"` + + // VariantAttributes: Variant attributes for the item. Optional. + VariantAttributes []*OrderLineItemProductVariantAttribute `json:"variantAttributes,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Brand") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TestOrderLineItemProduct) MarshalJSON() ([]byte, error) { + type noMethod TestOrderLineItemProduct + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TestOrderPaymentMethod struct { + // ExpirationMonth: The card expiration month (January = 1, February = 2 + // etc.). + ExpirationMonth int64 `json:"expirationMonth,omitempty"` + + // ExpirationYear: The card expiration year (4-digit, e.g. 2015). + ExpirationYear int64 `json:"expirationYear,omitempty"` + + // LastFourDigits: The last four digits of the card number. + LastFourDigits string `json:"lastFourDigits,omitempty"` + + // PredefinedBillingAddress: The billing address. + PredefinedBillingAddress string `json:"predefinedBillingAddress,omitempty"` + + // Type: The type of instrument. Note that real orders might have + // different values than the four values accepted by createTestOrder. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ExpirationMonth") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TestOrderPaymentMethod) MarshalJSON() ([]byte, error) { + type noMethod TestOrderPaymentMethod + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Weight struct { + // Unit: The weight unit. + Unit string `json:"unit,omitempty"` + + // Value: The weight represented as a number. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Unit") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Weight) MarshalJSON() ([]byte, error) { + type noMethod Weight + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "content.accounts.authinfo": + +type AccountsAuthinfoCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// Authinfo: Returns information about the authenticated user. +func (r *AccountsService) Authinfo() *AccountsAuthinfoCall { + c := &AccountsAuthinfoCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAuthinfoCall) Fields(s ...googleapi.Field) *AccountsAuthinfoCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsAuthinfoCall) IfNoneMatch(entityTag string) *AccountsAuthinfoCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAuthinfoCall) Context(ctx context.Context) *AccountsAuthinfoCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAuthinfoCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/authinfo") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.accounts.authinfo" call. +// Exactly one of *AccountsAuthInfoResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *AccountsAuthInfoResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsAuthinfoCall) Do() (*AccountsAuthInfoResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountsAuthInfoResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns information about the authenticated user.", + // "httpMethod": "GET", + // "id": "content.accounts.authinfo", + // "path": "accounts/authinfo", + // "response": { + // "$ref": "AccountsAuthInfoResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.accounts.custombatch": + +type AccountsCustombatchCall struct { + s *Service + accountscustombatchrequest *AccountsCustomBatchRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Custombatch: Retrieves, inserts, updates, and deletes multiple +// Merchant Center (sub-)accounts in a single request. +func (r *AccountsService) Custombatch(accountscustombatchrequest *AccountsCustomBatchRequest) *AccountsCustombatchCall { + c := &AccountsCustombatchCall{s: r.s, opt_: make(map[string]interface{})} + c.accountscustombatchrequest = accountscustombatchrequest + return c +} + +// DryRun sets the optional parameter "dryRun": Flag to run the request +// in dry-run mode. +func (c *AccountsCustombatchCall) DryRun(dryRun bool) *AccountsCustombatchCall { + c.opt_["dryRun"] = dryRun + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsCustombatchCall) Fields(s ...googleapi.Field) *AccountsCustombatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsCustombatchCall) Context(ctx context.Context) *AccountsCustombatchCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsCustombatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountscustombatchrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["dryRun"]; ok { + params.Set("dryRun", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/batch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.accounts.custombatch" call. +// Exactly one of *AccountsCustomBatchResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *AccountsCustomBatchResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsCustombatchCall) Do() (*AccountsCustomBatchResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountsCustomBatchResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves, inserts, updates, and deletes multiple Merchant Center (sub-)accounts in a single request.", + // "httpMethod": "POST", + // "id": "content.accounts.custombatch", + // "parameters": { + // "dryRun": { + // "description": "Flag to run the request in dry-run mode.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "accounts/batch", + // "request": { + // "$ref": "AccountsCustomBatchRequest" + // }, + // "response": { + // "$ref": "AccountsCustomBatchResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.accounts.delete": + +type AccountsDeleteCall struct { + s *Service + merchantId uint64 + accountId uint64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a Merchant Center sub-account. +func (r *AccountsService) Delete(merchantId uint64, accountId uint64) *AccountsDeleteCall { + c := &AccountsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.accountId = accountId + return c +} + +// DryRun sets the optional parameter "dryRun": Flag to run the request +// in dry-run mode. +func (c *AccountsDeleteCall) DryRun(dryRun bool) *AccountsDeleteCall { + c.opt_["dryRun"] = dryRun + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsDeleteCall) Fields(s ...googleapi.Field) *AccountsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsDeleteCall) Context(ctx context.Context) *AccountsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["dryRun"]; ok { + params.Set("dryRun", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounts/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "accountId": strconv.FormatUint(c.accountId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.accounts.delete" call. +func (c *AccountsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a Merchant Center sub-account.", + // "httpMethod": "DELETE", + // "id": "content.accounts.delete", + // "parameterOrder": [ + // "merchantId", + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "The ID of the account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "dryRun": { + // "description": "Flag to run the request in dry-run mode.", + // "location": "query", + // "type": "boolean" + // }, + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/accounts/{accountId}", + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.accounts.get": + +type AccountsGetCall struct { + s *Service + merchantId uint64 + accountId uint64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves a Merchant Center account. +func (r *AccountsService) Get(merchantId uint64, accountId uint64) *AccountsGetCall { + c := &AccountsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.accountId = accountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounts/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "accountId": strconv.FormatUint(c.accountId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.accounts.get" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsGetCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a Merchant Center account.", + // "httpMethod": "GET", + // "id": "content.accounts.get", + // "parameterOrder": [ + // "merchantId", + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "The ID of the account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/accounts/{accountId}", + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.accounts.insert": + +type AccountsInsertCall struct { + s *Service + merchantId uint64 + account *Account + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a Merchant Center sub-account. +func (r *AccountsService) Insert(merchantId uint64, account *Account) *AccountsInsertCall { + c := &AccountsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.account = account + return c +} + +// DryRun sets the optional parameter "dryRun": Flag to run the request +// in dry-run mode. +func (c *AccountsInsertCall) DryRun(dryRun bool) *AccountsInsertCall { + c.opt_["dryRun"] = dryRun + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsInsertCall) Fields(s ...googleapi.Field) *AccountsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsInsertCall) Context(ctx context.Context) *AccountsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["dryRun"]; ok { + params.Set("dryRun", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.accounts.insert" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsInsertCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a Merchant Center sub-account.", + // "httpMethod": "POST", + // "id": "content.accounts.insert", + // "parameterOrder": [ + // "merchantId" + // ], + // "parameters": { + // "dryRun": { + // "description": "Flag to run the request in dry-run mode.", + // "location": "query", + // "type": "boolean" + // }, + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/accounts", + // "request": { + // "$ref": "Account" + // }, + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.accounts.list": + +type AccountsListCall struct { + s *Service + merchantId uint64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the sub-accounts in your Merchant Center account. +func (r *AccountsService) List(merchantId uint64) *AccountsListCall { + c := &AccountsListCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of accounts to return 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": The token returned +// by the previous request. +func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.accounts.list" call. +// Exactly one of *AccountsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AccountsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsListCall) Do() (*AccountsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the sub-accounts in your Merchant Center account.", + // "httpMethod": "GET", + // "id": "content.accounts.list", + // "parameterOrder": [ + // "merchantId" + // ], + // "parameters": { + // "maxResults": { + // "description": "The maximum number of accounts to return in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageToken": { + // "description": "The token returned by the previous request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "{merchantId}/accounts", + // "response": { + // "$ref": "AccountsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.accounts.patch": + +type AccountsPatchCall struct { + s *Service + merchantId uint64 + accountId uint64 + account *Account + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates a Merchant Center account. This method supports patch +// semantics. +func (r *AccountsService) Patch(merchantId uint64, accountId uint64, account *Account) *AccountsPatchCall { + c := &AccountsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.accountId = accountId + c.account = account + return c +} + +// DryRun sets the optional parameter "dryRun": Flag to run the request +// in dry-run mode. +func (c *AccountsPatchCall) DryRun(dryRun bool) *AccountsPatchCall { + c.opt_["dryRun"] = dryRun + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsPatchCall) Fields(s ...googleapi.Field) *AccountsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsPatchCall) Context(ctx context.Context) *AccountsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["dryRun"]; ok { + params.Set("dryRun", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounts/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "accountId": strconv.FormatUint(c.accountId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.accounts.patch" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsPatchCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a Merchant Center account. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "content.accounts.patch", + // "parameterOrder": [ + // "merchantId", + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "The ID of the account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "dryRun": { + // "description": "Flag to run the request in dry-run mode.", + // "location": "query", + // "type": "boolean" + // }, + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/accounts/{accountId}", + // "request": { + // "$ref": "Account" + // }, + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.accounts.update": + +type AccountsUpdateCall struct { + s *Service + merchantId uint64 + accountId uint64 + account *Account + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a Merchant Center account. +func (r *AccountsService) Update(merchantId uint64, accountId uint64, account *Account) *AccountsUpdateCall { + c := &AccountsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.accountId = accountId + c.account = account + return c +} + +// DryRun sets the optional parameter "dryRun": Flag to run the request +// in dry-run mode. +func (c *AccountsUpdateCall) DryRun(dryRun bool) *AccountsUpdateCall { + c.opt_["dryRun"] = dryRun + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsUpdateCall) Fields(s ...googleapi.Field) *AccountsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsUpdateCall) Context(ctx context.Context) *AccountsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["dryRun"]; ok { + params.Set("dryRun", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounts/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "accountId": strconv.FormatUint(c.accountId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.accounts.update" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsUpdateCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a Merchant Center account.", + // "httpMethod": "PUT", + // "id": "content.accounts.update", + // "parameterOrder": [ + // "merchantId", + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "The ID of the account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "dryRun": { + // "description": "Flag to run the request in dry-run mode.", + // "location": "query", + // "type": "boolean" + // }, + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/accounts/{accountId}", + // "request": { + // "$ref": "Account" + // }, + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.accountshipping.custombatch": + +type AccountshippingCustombatchCall struct { + s *Service + accountshippingcustombatchrequest *AccountshippingCustomBatchRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Custombatch: Retrieves and updates the shipping settings of multiple +// accounts in a single request. +func (r *AccountshippingService) Custombatch(accountshippingcustombatchrequest *AccountshippingCustomBatchRequest) *AccountshippingCustombatchCall { + c := &AccountshippingCustombatchCall{s: r.s, opt_: make(map[string]interface{})} + c.accountshippingcustombatchrequest = accountshippingcustombatchrequest + return c +} + +// DryRun sets the optional parameter "dryRun": Flag to run the request +// in dry-run mode. +func (c *AccountshippingCustombatchCall) DryRun(dryRun bool) *AccountshippingCustombatchCall { + c.opt_["dryRun"] = dryRun + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountshippingCustombatchCall) Fields(s ...googleapi.Field) *AccountshippingCustombatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountshippingCustombatchCall) Context(ctx context.Context) *AccountshippingCustombatchCall { + c.ctx_ = ctx + return c +} + +func (c *AccountshippingCustombatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountshippingcustombatchrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["dryRun"]; ok { + params.Set("dryRun", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accountshipping/batch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.accountshipping.custombatch" call. +// Exactly one of *AccountshippingCustomBatchResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AccountshippingCustomBatchResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AccountshippingCustombatchCall) Do() (*AccountshippingCustomBatchResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountshippingCustomBatchResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves and updates the shipping settings of multiple accounts in a single request.", + // "httpMethod": "POST", + // "id": "content.accountshipping.custombatch", + // "parameters": { + // "dryRun": { + // "description": "Flag to run the request in dry-run mode.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "accountshipping/batch", + // "request": { + // "$ref": "AccountshippingCustomBatchRequest" + // }, + // "response": { + // "$ref": "AccountshippingCustomBatchResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.accountshipping.get": + +type AccountshippingGetCall struct { + s *Service + merchantId uint64 + accountId uint64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves the shipping settings of the account. +func (r *AccountshippingService) Get(merchantId uint64, accountId uint64) *AccountshippingGetCall { + c := &AccountshippingGetCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.accountId = accountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountshippingGetCall) Fields(s ...googleapi.Field) *AccountshippingGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountshippingGetCall) IfNoneMatch(entityTag string) *AccountshippingGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountshippingGetCall) Context(ctx context.Context) *AccountshippingGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountshippingGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accountshipping/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "accountId": strconv.FormatUint(c.accountId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.accountshipping.get" call. +// Exactly one of *AccountShipping or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AccountShipping.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountshippingGetCall) Do() (*AccountShipping, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountShipping{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the shipping settings of the account.", + // "httpMethod": "GET", + // "id": "content.accountshipping.get", + // "parameterOrder": [ + // "merchantId", + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "The ID of the account for which to get/update account shipping settings.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/accountshipping/{accountId}", + // "response": { + // "$ref": "AccountShipping" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.accountshipping.list": + +type AccountshippingListCall struct { + s *Service + merchantId uint64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the shipping settings of the sub-accounts in your +// Merchant Center account. +func (r *AccountshippingService) List(merchantId uint64) *AccountshippingListCall { + c := &AccountshippingListCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of shipping settings to return in the response, used for +// paging. +func (c *AccountshippingListCall) MaxResults(maxResults int64) *AccountshippingListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *AccountshippingListCall) PageToken(pageToken string) *AccountshippingListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountshippingListCall) Fields(s ...googleapi.Field) *AccountshippingListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountshippingListCall) IfNoneMatch(entityTag string) *AccountshippingListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountshippingListCall) Context(ctx context.Context) *AccountshippingListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountshippingListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accountshipping") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.accountshipping.list" call. +// Exactly one of *AccountshippingListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *AccountshippingListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountshippingListCall) Do() (*AccountshippingListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountshippingListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the shipping settings of the sub-accounts in your Merchant Center account.", + // "httpMethod": "GET", + // "id": "content.accountshipping.list", + // "parameterOrder": [ + // "merchantId" + // ], + // "parameters": { + // "maxResults": { + // "description": "The maximum number of shipping settings to return in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageToken": { + // "description": "The token returned by the previous request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "{merchantId}/accountshipping", + // "response": { + // "$ref": "AccountshippingListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.accountshipping.patch": + +type AccountshippingPatchCall struct { + s *Service + merchantId uint64 + accountId uint64 + accountshipping *AccountShipping + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates the shipping settings of the account. This method +// supports patch semantics. +func (r *AccountshippingService) Patch(merchantId uint64, accountId uint64, accountshipping *AccountShipping) *AccountshippingPatchCall { + c := &AccountshippingPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.accountId = accountId + c.accountshipping = accountshipping + return c +} + +// DryRun sets the optional parameter "dryRun": Flag to run the request +// in dry-run mode. +func (c *AccountshippingPatchCall) DryRun(dryRun bool) *AccountshippingPatchCall { + c.opt_["dryRun"] = dryRun + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountshippingPatchCall) Fields(s ...googleapi.Field) *AccountshippingPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountshippingPatchCall) Context(ctx context.Context) *AccountshippingPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AccountshippingPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountshipping) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["dryRun"]; ok { + params.Set("dryRun", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accountshipping/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "accountId": strconv.FormatUint(c.accountId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.accountshipping.patch" call. +// Exactly one of *AccountShipping or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AccountShipping.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountshippingPatchCall) Do() (*AccountShipping, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountShipping{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the shipping settings of the account. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "content.accountshipping.patch", + // "parameterOrder": [ + // "merchantId", + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "The ID of the account for which to get/update account shipping settings.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "dryRun": { + // "description": "Flag to run the request in dry-run mode.", + // "location": "query", + // "type": "boolean" + // }, + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/accountshipping/{accountId}", + // "request": { + // "$ref": "AccountShipping" + // }, + // "response": { + // "$ref": "AccountShipping" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.accountshipping.update": + +type AccountshippingUpdateCall struct { + s *Service + merchantId uint64 + accountId uint64 + accountshipping *AccountShipping + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates the shipping settings of the account. +func (r *AccountshippingService) Update(merchantId uint64, accountId uint64, accountshipping *AccountShipping) *AccountshippingUpdateCall { + c := &AccountshippingUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.accountId = accountId + c.accountshipping = accountshipping + return c +} + +// DryRun sets the optional parameter "dryRun": Flag to run the request +// in dry-run mode. +func (c *AccountshippingUpdateCall) DryRun(dryRun bool) *AccountshippingUpdateCall { + c.opt_["dryRun"] = dryRun + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountshippingUpdateCall) Fields(s ...googleapi.Field) *AccountshippingUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountshippingUpdateCall) Context(ctx context.Context) *AccountshippingUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountshippingUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountshipping) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["dryRun"]; ok { + params.Set("dryRun", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accountshipping/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "accountId": strconv.FormatUint(c.accountId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.accountshipping.update" call. +// Exactly one of *AccountShipping or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AccountShipping.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountshippingUpdateCall) Do() (*AccountShipping, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountShipping{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the shipping settings of the account.", + // "httpMethod": "PUT", + // "id": "content.accountshipping.update", + // "parameterOrder": [ + // "merchantId", + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "The ID of the account for which to get/update account shipping settings.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "dryRun": { + // "description": "Flag to run the request in dry-run mode.", + // "location": "query", + // "type": "boolean" + // }, + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/accountshipping/{accountId}", + // "request": { + // "$ref": "AccountShipping" + // }, + // "response": { + // "$ref": "AccountShipping" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.accountstatuses.custombatch": + +type AccountstatusesCustombatchCall struct { + s *Service + accountstatusescustombatchrequest *AccountstatusesCustomBatchRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Custombatch: +func (r *AccountstatusesService) Custombatch(accountstatusescustombatchrequest *AccountstatusesCustomBatchRequest) *AccountstatusesCustombatchCall { + c := &AccountstatusesCustombatchCall{s: r.s, opt_: make(map[string]interface{})} + c.accountstatusescustombatchrequest = accountstatusescustombatchrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountstatusesCustombatchCall) Fields(s ...googleapi.Field) *AccountstatusesCustombatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountstatusesCustombatchCall) Context(ctx context.Context) *AccountstatusesCustombatchCall { + c.ctx_ = ctx + return c +} + +func (c *AccountstatusesCustombatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountstatusescustombatchrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accountstatuses/batch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.accountstatuses.custombatch" call. +// Exactly one of *AccountstatusesCustomBatchResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AccountstatusesCustomBatchResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AccountstatusesCustombatchCall) Do() (*AccountstatusesCustomBatchResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountstatusesCustomBatchResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "POST", + // "id": "content.accountstatuses.custombatch", + // "path": "accountstatuses/batch", + // "request": { + // "$ref": "AccountstatusesCustomBatchRequest" + // }, + // "response": { + // "$ref": "AccountstatusesCustomBatchResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.accountstatuses.get": + +type AccountstatusesGetCall struct { + s *Service + merchantId uint64 + accountId uint64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves the status of a Merchant Center account. +func (r *AccountstatusesService) Get(merchantId uint64, accountId uint64) *AccountstatusesGetCall { + c := &AccountstatusesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.accountId = accountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountstatusesGetCall) Fields(s ...googleapi.Field) *AccountstatusesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountstatusesGetCall) IfNoneMatch(entityTag string) *AccountstatusesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountstatusesGetCall) Context(ctx context.Context) *AccountstatusesGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountstatusesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accountstatuses/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "accountId": strconv.FormatUint(c.accountId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.accountstatuses.get" call. +// Exactly one of *AccountStatus or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AccountStatus.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountstatusesGetCall) Do() (*AccountStatus, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountStatus{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the status of a Merchant Center account.", + // "httpMethod": "GET", + // "id": "content.accountstatuses.get", + // "parameterOrder": [ + // "merchantId", + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "The ID of the account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/accountstatuses/{accountId}", + // "response": { + // "$ref": "AccountStatus" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.accountstatuses.list": + +type AccountstatusesListCall struct { + s *Service + merchantId uint64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the statuses of the sub-accounts in your Merchant Center +// account. +func (r *AccountstatusesService) List(merchantId uint64) *AccountstatusesListCall { + c := &AccountstatusesListCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of account statuses to return in the response, used for +// paging. +func (c *AccountstatusesListCall) MaxResults(maxResults int64) *AccountstatusesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *AccountstatusesListCall) PageToken(pageToken string) *AccountstatusesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountstatusesListCall) Fields(s ...googleapi.Field) *AccountstatusesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountstatusesListCall) IfNoneMatch(entityTag string) *AccountstatusesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountstatusesListCall) Context(ctx context.Context) *AccountstatusesListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountstatusesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accountstatuses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.accountstatuses.list" call. +// Exactly one of *AccountstatusesListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *AccountstatusesListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountstatusesListCall) Do() (*AccountstatusesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountstatusesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the statuses of the sub-accounts in your Merchant Center account.", + // "httpMethod": "GET", + // "id": "content.accountstatuses.list", + // "parameterOrder": [ + // "merchantId" + // ], + // "parameters": { + // "maxResults": { + // "description": "The maximum number of account statuses to return in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageToken": { + // "description": "The token returned by the previous request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "{merchantId}/accountstatuses", + // "response": { + // "$ref": "AccountstatusesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.accounttax.custombatch": + +type AccounttaxCustombatchCall struct { + s *Service + accounttaxcustombatchrequest *AccounttaxCustomBatchRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Custombatch: Retrieves and updates tax settings of multiple accounts +// in a single request. +func (r *AccounttaxService) Custombatch(accounttaxcustombatchrequest *AccounttaxCustomBatchRequest) *AccounttaxCustombatchCall { + c := &AccounttaxCustombatchCall{s: r.s, opt_: make(map[string]interface{})} + c.accounttaxcustombatchrequest = accounttaxcustombatchrequest + return c +} + +// DryRun sets the optional parameter "dryRun": Flag to run the request +// in dry-run mode. +func (c *AccounttaxCustombatchCall) DryRun(dryRun bool) *AccounttaxCustombatchCall { + c.opt_["dryRun"] = dryRun + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccounttaxCustombatchCall) Fields(s ...googleapi.Field) *AccounttaxCustombatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccounttaxCustombatchCall) Context(ctx context.Context) *AccounttaxCustombatchCall { + c.ctx_ = ctx + return c +} + +func (c *AccounttaxCustombatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.accounttaxcustombatchrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["dryRun"]; ok { + params.Set("dryRun", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounttax/batch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.accounttax.custombatch" call. +// Exactly one of *AccounttaxCustomBatchResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AccounttaxCustomBatchResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccounttaxCustombatchCall) Do() (*AccounttaxCustomBatchResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccounttaxCustomBatchResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves and updates tax settings of multiple accounts in a single request.", + // "httpMethod": "POST", + // "id": "content.accounttax.custombatch", + // "parameters": { + // "dryRun": { + // "description": "Flag to run the request in dry-run mode.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "accounttax/batch", + // "request": { + // "$ref": "AccounttaxCustomBatchRequest" + // }, + // "response": { + // "$ref": "AccounttaxCustomBatchResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.accounttax.get": + +type AccounttaxGetCall struct { + s *Service + merchantId uint64 + accountId uint64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves the tax settings of the account. +func (r *AccounttaxService) Get(merchantId uint64, accountId uint64) *AccounttaxGetCall { + c := &AccounttaxGetCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.accountId = accountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccounttaxGetCall) Fields(s ...googleapi.Field) *AccounttaxGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccounttaxGetCall) IfNoneMatch(entityTag string) *AccounttaxGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccounttaxGetCall) Context(ctx context.Context) *AccounttaxGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccounttaxGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounttax/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "accountId": strconv.FormatUint(c.accountId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.accounttax.get" call. +// Exactly one of *AccountTax or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AccountTax.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccounttaxGetCall) Do() (*AccountTax, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountTax{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the tax settings of the account.", + // "httpMethod": "GET", + // "id": "content.accounttax.get", + // "parameterOrder": [ + // "merchantId", + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "The ID of the account for which to get/update account tax settings.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/accounttax/{accountId}", + // "response": { + // "$ref": "AccountTax" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.accounttax.list": + +type AccounttaxListCall struct { + s *Service + merchantId uint64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the tax settings of the sub-accounts in your Merchant +// Center account. +func (r *AccounttaxService) List(merchantId uint64) *AccounttaxListCall { + c := &AccounttaxListCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of tax settings to return in the response, used for paging. +func (c *AccounttaxListCall) MaxResults(maxResults int64) *AccounttaxListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *AccounttaxListCall) PageToken(pageToken string) *AccounttaxListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccounttaxListCall) Fields(s ...googleapi.Field) *AccounttaxListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccounttaxListCall) IfNoneMatch(entityTag string) *AccounttaxListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccounttaxListCall) Context(ctx context.Context) *AccounttaxListCall { + c.ctx_ = ctx + return c +} + +func (c *AccounttaxListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounttax") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.accounttax.list" call. +// Exactly one of *AccounttaxListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AccounttaxListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccounttaxListCall) Do() (*AccounttaxListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccounttaxListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the tax settings of the sub-accounts in your Merchant Center account.", + // "httpMethod": "GET", + // "id": "content.accounttax.list", + // "parameterOrder": [ + // "merchantId" + // ], + // "parameters": { + // "maxResults": { + // "description": "The maximum number of tax settings to return in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageToken": { + // "description": "The token returned by the previous request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "{merchantId}/accounttax", + // "response": { + // "$ref": "AccounttaxListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.accounttax.patch": + +type AccounttaxPatchCall struct { + s *Service + merchantId uint64 + accountId uint64 + accounttax *AccountTax + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates the tax settings of the account. This method supports +// patch semantics. +func (r *AccounttaxService) Patch(merchantId uint64, accountId uint64, accounttax *AccountTax) *AccounttaxPatchCall { + c := &AccounttaxPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.accountId = accountId + c.accounttax = accounttax + return c +} + +// DryRun sets the optional parameter "dryRun": Flag to run the request +// in dry-run mode. +func (c *AccounttaxPatchCall) DryRun(dryRun bool) *AccounttaxPatchCall { + c.opt_["dryRun"] = dryRun + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccounttaxPatchCall) Fields(s ...googleapi.Field) *AccounttaxPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccounttaxPatchCall) Context(ctx context.Context) *AccounttaxPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AccounttaxPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.accounttax) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["dryRun"]; ok { + params.Set("dryRun", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounttax/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "accountId": strconv.FormatUint(c.accountId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.accounttax.patch" call. +// Exactly one of *AccountTax or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AccountTax.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccounttaxPatchCall) Do() (*AccountTax, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountTax{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the tax settings of the account. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "content.accounttax.patch", + // "parameterOrder": [ + // "merchantId", + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "The ID of the account for which to get/update account tax settings.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "dryRun": { + // "description": "Flag to run the request in dry-run mode.", + // "location": "query", + // "type": "boolean" + // }, + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/accounttax/{accountId}", + // "request": { + // "$ref": "AccountTax" + // }, + // "response": { + // "$ref": "AccountTax" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.accounttax.update": + +type AccounttaxUpdateCall struct { + s *Service + merchantId uint64 + accountId uint64 + accounttax *AccountTax + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates the tax settings of the account. +func (r *AccounttaxService) Update(merchantId uint64, accountId uint64, accounttax *AccountTax) *AccounttaxUpdateCall { + c := &AccounttaxUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.accountId = accountId + c.accounttax = accounttax + return c +} + +// DryRun sets the optional parameter "dryRun": Flag to run the request +// in dry-run mode. +func (c *AccounttaxUpdateCall) DryRun(dryRun bool) *AccounttaxUpdateCall { + c.opt_["dryRun"] = dryRun + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccounttaxUpdateCall) Fields(s ...googleapi.Field) *AccounttaxUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccounttaxUpdateCall) Context(ctx context.Context) *AccounttaxUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AccounttaxUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.accounttax) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["dryRun"]; ok { + params.Set("dryRun", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounttax/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "accountId": strconv.FormatUint(c.accountId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.accounttax.update" call. +// Exactly one of *AccountTax or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AccountTax.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccounttaxUpdateCall) Do() (*AccountTax, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountTax{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the tax settings of the account.", + // "httpMethod": "PUT", + // "id": "content.accounttax.update", + // "parameterOrder": [ + // "merchantId", + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "The ID of the account for which to get/update account tax settings.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "dryRun": { + // "description": "Flag to run the request in dry-run mode.", + // "location": "query", + // "type": "boolean" + // }, + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/accounttax/{accountId}", + // "request": { + // "$ref": "AccountTax" + // }, + // "response": { + // "$ref": "AccountTax" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.datafeeds.custombatch": + +type DatafeedsCustombatchCall struct { + s *Service + datafeedscustombatchrequest *DatafeedsCustomBatchRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Custombatch: +func (r *DatafeedsService) Custombatch(datafeedscustombatchrequest *DatafeedsCustomBatchRequest) *DatafeedsCustombatchCall { + c := &DatafeedsCustombatchCall{s: r.s, opt_: make(map[string]interface{})} + c.datafeedscustombatchrequest = datafeedscustombatchrequest + return c +} + +// DryRun sets the optional parameter "dryRun": Flag to run the request +// in dry-run mode. +func (c *DatafeedsCustombatchCall) DryRun(dryRun bool) *DatafeedsCustombatchCall { + c.opt_["dryRun"] = dryRun + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatafeedsCustombatchCall) Fields(s ...googleapi.Field) *DatafeedsCustombatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatafeedsCustombatchCall) Context(ctx context.Context) *DatafeedsCustombatchCall { + c.ctx_ = ctx + return c +} + +func (c *DatafeedsCustombatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.datafeedscustombatchrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["dryRun"]; ok { + params.Set("dryRun", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "datafeeds/batch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.datafeeds.custombatch" call. +// Exactly one of *DatafeedsCustomBatchResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *DatafeedsCustomBatchResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DatafeedsCustombatchCall) Do() (*DatafeedsCustomBatchResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DatafeedsCustomBatchResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "POST", + // "id": "content.datafeeds.custombatch", + // "parameters": { + // "dryRun": { + // "description": "Flag to run the request in dry-run mode.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "datafeeds/batch", + // "request": { + // "$ref": "DatafeedsCustomBatchRequest" + // }, + // "response": { + // "$ref": "DatafeedsCustomBatchResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.datafeeds.delete": + +type DatafeedsDeleteCall struct { + s *Service + merchantId uint64 + datafeedId uint64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a datafeed from your Merchant Center account. +func (r *DatafeedsService) Delete(merchantId uint64, datafeedId uint64) *DatafeedsDeleteCall { + c := &DatafeedsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.datafeedId = datafeedId + return c +} + +// DryRun sets the optional parameter "dryRun": Flag to run the request +// in dry-run mode. +func (c *DatafeedsDeleteCall) DryRun(dryRun bool) *DatafeedsDeleteCall { + c.opt_["dryRun"] = dryRun + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatafeedsDeleteCall) Fields(s ...googleapi.Field) *DatafeedsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatafeedsDeleteCall) Context(ctx context.Context) *DatafeedsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *DatafeedsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["dryRun"]; ok { + params.Set("dryRun", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeeds/{datafeedId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "datafeedId": strconv.FormatUint(c.datafeedId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.datafeeds.delete" call. +func (c *DatafeedsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a datafeed from your Merchant Center account.", + // "httpMethod": "DELETE", + // "id": "content.datafeeds.delete", + // "parameterOrder": [ + // "merchantId", + // "datafeedId" + // ], + // "parameters": { + // "datafeedId": { + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "dryRun": { + // "description": "Flag to run the request in dry-run mode.", + // "location": "query", + // "type": "boolean" + // }, + // "merchantId": { + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/datafeeds/{datafeedId}", + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.datafeeds.get": + +type DatafeedsGetCall struct { + s *Service + merchantId uint64 + datafeedId uint64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves a datafeed from your Merchant Center account. +func (r *DatafeedsService) Get(merchantId uint64, datafeedId uint64) *DatafeedsGetCall { + c := &DatafeedsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.datafeedId = datafeedId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatafeedsGetCall) Fields(s ...googleapi.Field) *DatafeedsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DatafeedsGetCall) IfNoneMatch(entityTag string) *DatafeedsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatafeedsGetCall) Context(ctx context.Context) *DatafeedsGetCall { + c.ctx_ = ctx + return c +} + +func (c *DatafeedsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeeds/{datafeedId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "datafeedId": strconv.FormatUint(c.datafeedId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.datafeeds.get" call. +// Exactly one of *Datafeed or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Datafeed.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DatafeedsGetCall) Do() (*Datafeed, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Datafeed{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a datafeed from your Merchant Center account.", + // "httpMethod": "GET", + // "id": "content.datafeeds.get", + // "parameterOrder": [ + // "merchantId", + // "datafeedId" + // ], + // "parameters": { + // "datafeedId": { + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "merchantId": { + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/datafeeds/{datafeedId}", + // "response": { + // "$ref": "Datafeed" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.datafeeds.insert": + +type DatafeedsInsertCall struct { + s *Service + merchantId uint64 + datafeed *Datafeed + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Registers a datafeed with your Merchant Center account. +func (r *DatafeedsService) Insert(merchantId uint64, datafeed *Datafeed) *DatafeedsInsertCall { + c := &DatafeedsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.datafeed = datafeed + return c +} + +// DryRun sets the optional parameter "dryRun": Flag to run the request +// in dry-run mode. +func (c *DatafeedsInsertCall) DryRun(dryRun bool) *DatafeedsInsertCall { + c.opt_["dryRun"] = dryRun + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatafeedsInsertCall) Fields(s ...googleapi.Field) *DatafeedsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatafeedsInsertCall) Context(ctx context.Context) *DatafeedsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *DatafeedsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.datafeed) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["dryRun"]; ok { + params.Set("dryRun", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeeds") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.datafeeds.insert" call. +// Exactly one of *Datafeed or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Datafeed.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DatafeedsInsertCall) Do() (*Datafeed, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Datafeed{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Registers a datafeed with your Merchant Center account.", + // "httpMethod": "POST", + // "id": "content.datafeeds.insert", + // "parameterOrder": [ + // "merchantId" + // ], + // "parameters": { + // "dryRun": { + // "description": "Flag to run the request in dry-run mode.", + // "location": "query", + // "type": "boolean" + // }, + // "merchantId": { + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/datafeeds", + // "request": { + // "$ref": "Datafeed" + // }, + // "response": { + // "$ref": "Datafeed" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.datafeeds.list": + +type DatafeedsListCall struct { + s *Service + merchantId uint64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the datafeeds in your Merchant Center account. +func (r *DatafeedsService) List(merchantId uint64) *DatafeedsListCall { + c := &DatafeedsListCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of products to return in the response, used for paging. +func (c *DatafeedsListCall) MaxResults(maxResults int64) *DatafeedsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *DatafeedsListCall) PageToken(pageToken string) *DatafeedsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatafeedsListCall) Fields(s ...googleapi.Field) *DatafeedsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DatafeedsListCall) IfNoneMatch(entityTag string) *DatafeedsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatafeedsListCall) Context(ctx context.Context) *DatafeedsListCall { + c.ctx_ = ctx + return c +} + +func (c *DatafeedsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeeds") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.datafeeds.list" call. +// Exactly one of *DatafeedsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DatafeedsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DatafeedsListCall) Do() (*DatafeedsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DatafeedsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the datafeeds in your Merchant Center account.", + // "httpMethod": "GET", + // "id": "content.datafeeds.list", + // "parameterOrder": [ + // "merchantId" + // ], + // "parameters": { + // "maxResults": { + // "description": "The maximum number of products to return in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageToken": { + // "description": "The token returned by the previous request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "{merchantId}/datafeeds", + // "response": { + // "$ref": "DatafeedsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.datafeeds.patch": + +type DatafeedsPatchCall struct { + s *Service + merchantId uint64 + datafeedId uint64 + datafeed *Datafeed + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates a datafeed of your Merchant Center account. This +// method supports patch semantics. +func (r *DatafeedsService) Patch(merchantId uint64, datafeedId uint64, datafeed *Datafeed) *DatafeedsPatchCall { + c := &DatafeedsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.datafeedId = datafeedId + c.datafeed = datafeed + return c +} + +// DryRun sets the optional parameter "dryRun": Flag to run the request +// in dry-run mode. +func (c *DatafeedsPatchCall) DryRun(dryRun bool) *DatafeedsPatchCall { + c.opt_["dryRun"] = dryRun + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatafeedsPatchCall) Fields(s ...googleapi.Field) *DatafeedsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatafeedsPatchCall) Context(ctx context.Context) *DatafeedsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *DatafeedsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.datafeed) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["dryRun"]; ok { + params.Set("dryRun", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeeds/{datafeedId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "datafeedId": strconv.FormatUint(c.datafeedId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.datafeeds.patch" call. +// Exactly one of *Datafeed or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Datafeed.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DatafeedsPatchCall) Do() (*Datafeed, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Datafeed{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a datafeed of your Merchant Center account. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "content.datafeeds.patch", + // "parameterOrder": [ + // "merchantId", + // "datafeedId" + // ], + // "parameters": { + // "datafeedId": { + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "dryRun": { + // "description": "Flag to run the request in dry-run mode.", + // "location": "query", + // "type": "boolean" + // }, + // "merchantId": { + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/datafeeds/{datafeedId}", + // "request": { + // "$ref": "Datafeed" + // }, + // "response": { + // "$ref": "Datafeed" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.datafeeds.update": + +type DatafeedsUpdateCall struct { + s *Service + merchantId uint64 + datafeedId uint64 + datafeed *Datafeed + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a datafeed of your Merchant Center account. +func (r *DatafeedsService) Update(merchantId uint64, datafeedId uint64, datafeed *Datafeed) *DatafeedsUpdateCall { + c := &DatafeedsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.datafeedId = datafeedId + c.datafeed = datafeed + return c +} + +// DryRun sets the optional parameter "dryRun": Flag to run the request +// in dry-run mode. +func (c *DatafeedsUpdateCall) DryRun(dryRun bool) *DatafeedsUpdateCall { + c.opt_["dryRun"] = dryRun + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatafeedsUpdateCall) Fields(s ...googleapi.Field) *DatafeedsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatafeedsUpdateCall) Context(ctx context.Context) *DatafeedsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *DatafeedsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.datafeed) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["dryRun"]; ok { + params.Set("dryRun", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeeds/{datafeedId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "datafeedId": strconv.FormatUint(c.datafeedId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.datafeeds.update" call. +// Exactly one of *Datafeed or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Datafeed.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DatafeedsUpdateCall) Do() (*Datafeed, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Datafeed{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a datafeed of your Merchant Center account.", + // "httpMethod": "PUT", + // "id": "content.datafeeds.update", + // "parameterOrder": [ + // "merchantId", + // "datafeedId" + // ], + // "parameters": { + // "datafeedId": { + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "dryRun": { + // "description": "Flag to run the request in dry-run mode.", + // "location": "query", + // "type": "boolean" + // }, + // "merchantId": { + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/datafeeds/{datafeedId}", + // "request": { + // "$ref": "Datafeed" + // }, + // "response": { + // "$ref": "Datafeed" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.datafeedstatuses.custombatch": + +type DatafeedstatusesCustombatchCall struct { + s *Service + datafeedstatusescustombatchrequest *DatafeedstatusesCustomBatchRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Custombatch: +func (r *DatafeedstatusesService) Custombatch(datafeedstatusescustombatchrequest *DatafeedstatusesCustomBatchRequest) *DatafeedstatusesCustombatchCall { + c := &DatafeedstatusesCustombatchCall{s: r.s, opt_: make(map[string]interface{})} + c.datafeedstatusescustombatchrequest = datafeedstatusescustombatchrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatafeedstatusesCustombatchCall) Fields(s ...googleapi.Field) *DatafeedstatusesCustombatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatafeedstatusesCustombatchCall) Context(ctx context.Context) *DatafeedstatusesCustombatchCall { + c.ctx_ = ctx + return c +} + +func (c *DatafeedstatusesCustombatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.datafeedstatusescustombatchrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "datafeedstatuses/batch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.datafeedstatuses.custombatch" call. +// Exactly one of *DatafeedstatusesCustomBatchResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *DatafeedstatusesCustomBatchResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *DatafeedstatusesCustombatchCall) Do() (*DatafeedstatusesCustomBatchResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DatafeedstatusesCustomBatchResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "POST", + // "id": "content.datafeedstatuses.custombatch", + // "path": "datafeedstatuses/batch", + // "request": { + // "$ref": "DatafeedstatusesCustomBatchRequest" + // }, + // "response": { + // "$ref": "DatafeedstatusesCustomBatchResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.datafeedstatuses.get": + +type DatafeedstatusesGetCall struct { + s *Service + merchantId uint64 + datafeedId uint64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves the status of a datafeed from your Merchant Center +// account. +func (r *DatafeedstatusesService) Get(merchantId uint64, datafeedId uint64) *DatafeedstatusesGetCall { + c := &DatafeedstatusesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.datafeedId = datafeedId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatafeedstatusesGetCall) Fields(s ...googleapi.Field) *DatafeedstatusesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DatafeedstatusesGetCall) IfNoneMatch(entityTag string) *DatafeedstatusesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatafeedstatusesGetCall) Context(ctx context.Context) *DatafeedstatusesGetCall { + c.ctx_ = ctx + return c +} + +func (c *DatafeedstatusesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeedstatuses/{datafeedId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "datafeedId": strconv.FormatUint(c.datafeedId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.datafeedstatuses.get" call. +// Exactly one of *DatafeedStatus or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DatafeedStatus.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DatafeedstatusesGetCall) Do() (*DatafeedStatus, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DatafeedStatus{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the status of a datafeed from your Merchant Center account.", + // "httpMethod": "GET", + // "id": "content.datafeedstatuses.get", + // "parameterOrder": [ + // "merchantId", + // "datafeedId" + // ], + // "parameters": { + // "datafeedId": { + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "merchantId": { + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/datafeedstatuses/{datafeedId}", + // "response": { + // "$ref": "DatafeedStatus" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.datafeedstatuses.list": + +type DatafeedstatusesListCall struct { + s *Service + merchantId uint64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the statuses of the datafeeds in your Merchant Center +// account. +func (r *DatafeedstatusesService) List(merchantId uint64) *DatafeedstatusesListCall { + c := &DatafeedstatusesListCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of products to return in the response, used for paging. +func (c *DatafeedstatusesListCall) MaxResults(maxResults int64) *DatafeedstatusesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *DatafeedstatusesListCall) PageToken(pageToken string) *DatafeedstatusesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatafeedstatusesListCall) Fields(s ...googleapi.Field) *DatafeedstatusesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DatafeedstatusesListCall) IfNoneMatch(entityTag string) *DatafeedstatusesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatafeedstatusesListCall) Context(ctx context.Context) *DatafeedstatusesListCall { + c.ctx_ = ctx + return c +} + +func (c *DatafeedstatusesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeedstatuses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.datafeedstatuses.list" call. +// Exactly one of *DatafeedstatusesListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *DatafeedstatusesListResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DatafeedstatusesListCall) Do() (*DatafeedstatusesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DatafeedstatusesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the statuses of the datafeeds in your Merchant Center account.", + // "httpMethod": "GET", + // "id": "content.datafeedstatuses.list", + // "parameterOrder": [ + // "merchantId" + // ], + // "parameters": { + // "maxResults": { + // "description": "The maximum number of products to return in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageToken": { + // "description": "The token returned by the previous request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "{merchantId}/datafeedstatuses", + // "response": { + // "$ref": "DatafeedstatusesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.inventory.custombatch": + +type InventoryCustombatchCall struct { + s *Service + inventorycustombatchrequest *InventoryCustomBatchRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Custombatch: Updates price and availability for multiple products or +// stores in a single request. This operation does not update the +// expiration date of the products. +func (r *InventoryService) Custombatch(inventorycustombatchrequest *InventoryCustomBatchRequest) *InventoryCustombatchCall { + c := &InventoryCustombatchCall{s: r.s, opt_: make(map[string]interface{})} + c.inventorycustombatchrequest = inventorycustombatchrequest + return c +} + +// DryRun sets the optional parameter "dryRun": Flag to run the request +// in dry-run mode. +func (c *InventoryCustombatchCall) DryRun(dryRun bool) *InventoryCustombatchCall { + c.opt_["dryRun"] = dryRun + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InventoryCustombatchCall) Fields(s ...googleapi.Field) *InventoryCustombatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InventoryCustombatchCall) Context(ctx context.Context) *InventoryCustombatchCall { + c.ctx_ = ctx + return c +} + +func (c *InventoryCustombatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.inventorycustombatchrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["dryRun"]; ok { + params.Set("dryRun", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "inventory/batch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.inventory.custombatch" call. +// Exactly one of *InventoryCustomBatchResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *InventoryCustomBatchResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InventoryCustombatchCall) Do() (*InventoryCustomBatchResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InventoryCustomBatchResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates price and availability for multiple products or stores in a single request. This operation does not update the expiration date of the products.", + // "httpMethod": "POST", + // "id": "content.inventory.custombatch", + // "parameters": { + // "dryRun": { + // "description": "Flag to run the request in dry-run mode.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "inventory/batch", + // "request": { + // "$ref": "InventoryCustomBatchRequest" + // }, + // "response": { + // "$ref": "InventoryCustomBatchResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.inventory.set": + +type InventorySetCall struct { + s *Service + merchantId uint64 + storeCode string + productId string + inventorysetrequest *InventorySetRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Set: Updates price and availability of a product in your Merchant +// Center account. This operation does not update the expiration date of +// the product. +func (r *InventoryService) Set(merchantId uint64, storeCode string, productId string, inventorysetrequest *InventorySetRequest) *InventorySetCall { + c := &InventorySetCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.storeCode = storeCode + c.productId = productId + c.inventorysetrequest = inventorysetrequest + return c +} + +// DryRun sets the optional parameter "dryRun": Flag to run the request +// in dry-run mode. +func (c *InventorySetCall) DryRun(dryRun bool) *InventorySetCall { + c.opt_["dryRun"] = dryRun + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InventorySetCall) Fields(s ...googleapi.Field) *InventorySetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InventorySetCall) Context(ctx context.Context) *InventorySetCall { + c.ctx_ = ctx + return c +} + +func (c *InventorySetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.inventorysetrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["dryRun"]; ok { + params.Set("dryRun", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/inventory/{storeCode}/products/{productId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "storeCode": c.storeCode, + "productId": c.productId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.inventory.set" call. +// Exactly one of *InventorySetResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *InventorySetResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InventorySetCall) Do() (*InventorySetResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InventorySetResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates price and availability of a product in your Merchant Center account. This operation does not update the expiration date of the product.", + // "httpMethod": "POST", + // "id": "content.inventory.set", + // "parameterOrder": [ + // "merchantId", + // "storeCode", + // "productId" + // ], + // "parameters": { + // "dryRun": { + // "description": "Flag to run the request in dry-run mode.", + // "location": "query", + // "type": "boolean" + // }, + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "productId": { + // "description": "The ID of the product for which to update price and availability.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "storeCode": { + // "description": "The code of the store for which to update price and availability. Use online to update price and availability of an online product.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/inventory/{storeCode}/products/{productId}", + // "request": { + // "$ref": "InventorySetRequest" + // }, + // "response": { + // "$ref": "InventorySetResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.acknowledge": + +type OrdersAcknowledgeCall struct { + s *Service + merchantId uint64 + orderId string + ordersacknowledgerequest *OrdersAcknowledgeRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Acknowledge: Marks an order as acknowledged. +func (r *OrdersService) Acknowledge(merchantId uint64, orderId string, ordersacknowledgerequest *OrdersAcknowledgeRequest) *OrdersAcknowledgeCall { + c := &OrdersAcknowledgeCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.orderId = orderId + c.ordersacknowledgerequest = ordersacknowledgerequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersAcknowledgeCall) Fields(s ...googleapi.Field) *OrdersAcknowledgeCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersAcknowledgeCall) Context(ctx context.Context) *OrdersAcknowledgeCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersAcknowledgeCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersacknowledgerequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/acknowledge") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "orderId": c.orderId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.acknowledge" call. +// Exactly one of *OrdersAcknowledgeResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *OrdersAcknowledgeResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrdersAcknowledgeCall) Do() (*OrdersAcknowledgeResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersAcknowledgeResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Marks an order as acknowledged.", + // "httpMethod": "POST", + // "id": "content.orders.acknowledge", + // "parameterOrder": [ + // "merchantId", + // "orderId" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orderId": { + // "description": "The ID of the order.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/orders/{orderId}/acknowledge", + // "request": { + // "$ref": "OrdersAcknowledgeRequest" + // }, + // "response": { + // "$ref": "OrdersAcknowledgeResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.advancetestorder": + +type OrdersAdvancetestorderCall struct { + s *Service + merchantId uint64 + orderId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Advancetestorder: Sandbox only. Moves a test order from state +// "inProgress" to state "pendingShipment". +func (r *OrdersService) Advancetestorder(merchantId uint64, orderId string) *OrdersAdvancetestorderCall { + c := &OrdersAdvancetestorderCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.orderId = orderId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersAdvancetestorderCall) Fields(s ...googleapi.Field) *OrdersAdvancetestorderCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersAdvancetestorderCall) Context(ctx context.Context) *OrdersAdvancetestorderCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersAdvancetestorderCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/testorders/{orderId}/advance") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "orderId": c.orderId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.advancetestorder" call. +// Exactly one of *OrdersAdvanceTestOrderResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *OrdersAdvanceTestOrderResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrdersAdvancetestorderCall) Do() (*OrdersAdvanceTestOrderResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersAdvanceTestOrderResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sandbox only. Moves a test order from state \"inProgress\" to state \"pendingShipment\".", + // "httpMethod": "POST", + // "id": "content.orders.advancetestorder", + // "parameterOrder": [ + // "merchantId", + // "orderId" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orderId": { + // "description": "The ID of the test order to modify.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/testorders/{orderId}/advance", + // "response": { + // "$ref": "OrdersAdvanceTestOrderResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.cancel": + +type OrdersCancelCall struct { + s *Service + merchantId uint64 + orderId string + orderscancelrequest *OrdersCancelRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Cancel: Cancels all line items in an order. +func (r *OrdersService) Cancel(merchantId uint64, orderId string, orderscancelrequest *OrdersCancelRequest) *OrdersCancelCall { + c := &OrdersCancelCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.orderId = orderId + c.orderscancelrequest = orderscancelrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersCancelCall) Fields(s ...googleapi.Field) *OrdersCancelCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersCancelCall) Context(ctx context.Context) *OrdersCancelCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersCancelCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderscancelrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/cancel") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "orderId": c.orderId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.cancel" call. +// Exactly one of *OrdersCancelResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *OrdersCancelResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrdersCancelCall) Do() (*OrdersCancelResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersCancelResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Cancels all line items in an order.", + // "httpMethod": "POST", + // "id": "content.orders.cancel", + // "parameterOrder": [ + // "merchantId", + // "orderId" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orderId": { + // "description": "The ID of the order to cancel.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/orders/{orderId}/cancel", + // "request": { + // "$ref": "OrdersCancelRequest" + // }, + // "response": { + // "$ref": "OrdersCancelResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.cancellineitem": + +type OrdersCancellineitemCall struct { + s *Service + merchantId uint64 + orderId string + orderscancellineitemrequest *OrdersCancelLineItemRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Cancellineitem: Cancels a line item. +func (r *OrdersService) Cancellineitem(merchantId uint64, orderId string, orderscancellineitemrequest *OrdersCancelLineItemRequest) *OrdersCancellineitemCall { + c := &OrdersCancellineitemCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.orderId = orderId + c.orderscancellineitemrequest = orderscancellineitemrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersCancellineitemCall) Fields(s ...googleapi.Field) *OrdersCancellineitemCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersCancellineitemCall) Context(ctx context.Context) *OrdersCancellineitemCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersCancellineitemCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderscancellineitemrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/cancelLineItem") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "orderId": c.orderId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.cancellineitem" call. +// Exactly one of *OrdersCancelLineItemResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *OrdersCancelLineItemResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrdersCancellineitemCall) Do() (*OrdersCancelLineItemResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersCancelLineItemResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Cancels a line item.", + // "httpMethod": "POST", + // "id": "content.orders.cancellineitem", + // "parameterOrder": [ + // "merchantId", + // "orderId" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orderId": { + // "description": "The ID of the order.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/orders/{orderId}/cancelLineItem", + // "request": { + // "$ref": "OrdersCancelLineItemRequest" + // }, + // "response": { + // "$ref": "OrdersCancelLineItemResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.createtestorder": + +type OrdersCreatetestorderCall struct { + s *Service + merchantId uint64 + orderscreatetestorderrequest *OrdersCreateTestOrderRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Createtestorder: Sandbox only. Creates a test order. +func (r *OrdersService) Createtestorder(merchantId uint64, orderscreatetestorderrequest *OrdersCreateTestOrderRequest) *OrdersCreatetestorderCall { + c := &OrdersCreatetestorderCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.orderscreatetestorderrequest = orderscreatetestorderrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersCreatetestorderCall) Fields(s ...googleapi.Field) *OrdersCreatetestorderCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersCreatetestorderCall) Context(ctx context.Context) *OrdersCreatetestorderCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersCreatetestorderCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderscreatetestorderrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/testorders") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.createtestorder" call. +// Exactly one of *OrdersCreateTestOrderResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *OrdersCreateTestOrderResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrdersCreatetestorderCall) Do() (*OrdersCreateTestOrderResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersCreateTestOrderResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sandbox only. Creates a test order.", + // "httpMethod": "POST", + // "id": "content.orders.createtestorder", + // "parameterOrder": [ + // "merchantId" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/testorders", + // "request": { + // "$ref": "OrdersCreateTestOrderRequest" + // }, + // "response": { + // "$ref": "OrdersCreateTestOrderResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.custombatch": + +type OrdersCustombatchCall struct { + s *Service + orderscustombatchrequest *OrdersCustomBatchRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Custombatch: Retrieves or modifies multiple orders in a single +// request. +func (r *OrdersService) Custombatch(orderscustombatchrequest *OrdersCustomBatchRequest) *OrdersCustombatchCall { + c := &OrdersCustombatchCall{s: r.s, opt_: make(map[string]interface{})} + c.orderscustombatchrequest = orderscustombatchrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersCustombatchCall) Fields(s ...googleapi.Field) *OrdersCustombatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersCustombatchCall) Context(ctx context.Context) *OrdersCustombatchCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersCustombatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderscustombatchrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "orders/batch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.custombatch" call. +// Exactly one of *OrdersCustomBatchResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *OrdersCustomBatchResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrdersCustombatchCall) Do() (*OrdersCustomBatchResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersCustomBatchResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves or modifies multiple orders in a single request.", + // "httpMethod": "POST", + // "id": "content.orders.custombatch", + // "path": "orders/batch", + // "request": { + // "$ref": "OrdersCustomBatchRequest" + // }, + // "response": { + // "$ref": "OrdersCustomBatchResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.get": + +type OrdersGetCall struct { + s *Service + merchantId uint64 + orderId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves an order from your Merchant Center account. +func (r *OrdersService) Get(merchantId uint64, orderId string) *OrdersGetCall { + c := &OrdersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.orderId = orderId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersGetCall) Fields(s ...googleapi.Field) *OrdersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrdersGetCall) IfNoneMatch(entityTag string) *OrdersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersGetCall) Context(ctx context.Context) *OrdersGetCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "orderId": c.orderId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.get" call. +// Exactly one of *Order or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Order.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrdersGetCall) Do() (*Order, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Order{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves an order from your Merchant Center account.", + // "httpMethod": "GET", + // "id": "content.orders.get", + // "parameterOrder": [ + // "merchantId", + // "orderId" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orderId": { + // "description": "The ID of the order.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/orders/{orderId}", + // "response": { + // "$ref": "Order" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.getbymerchantorderid": + +type OrdersGetbymerchantorderidCall struct { + s *Service + merchantId uint64 + merchantOrderId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Getbymerchantorderid: Retrieves an order using merchant order id. +func (r *OrdersService) Getbymerchantorderid(merchantId uint64, merchantOrderId string) *OrdersGetbymerchantorderidCall { + c := &OrdersGetbymerchantorderidCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.merchantOrderId = merchantOrderId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersGetbymerchantorderidCall) Fields(s ...googleapi.Field) *OrdersGetbymerchantorderidCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrdersGetbymerchantorderidCall) IfNoneMatch(entityTag string) *OrdersGetbymerchantorderidCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersGetbymerchantorderidCall) Context(ctx context.Context) *OrdersGetbymerchantorderidCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersGetbymerchantorderidCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/ordersbymerchantid/{merchantOrderId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "merchantOrderId": c.merchantOrderId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.getbymerchantorderid" call. +// Exactly one of *OrdersGetByMerchantOrderIdResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *OrdersGetByMerchantOrderIdResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrdersGetbymerchantorderidCall) Do() (*OrdersGetByMerchantOrderIdResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersGetByMerchantOrderIdResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves an order using merchant order id.", + // "httpMethod": "GET", + // "id": "content.orders.getbymerchantorderid", + // "parameterOrder": [ + // "merchantId", + // "merchantOrderId" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "merchantOrderId": { + // "description": "The merchant order id to be looked for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/ordersbymerchantid/{merchantOrderId}", + // "response": { + // "$ref": "OrdersGetByMerchantOrderIdResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.gettestordertemplate": + +type OrdersGettestordertemplateCall struct { + s *Service + merchantId uint64 + templateName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Gettestordertemplate: Sandbox only. Retrieves an order template that +// can be used to quickly create a new order in sandbox. +func (r *OrdersService) Gettestordertemplate(merchantId uint64, templateName string) *OrdersGettestordertemplateCall { + c := &OrdersGettestordertemplateCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.templateName = templateName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersGettestordertemplateCall) Fields(s ...googleapi.Field) *OrdersGettestordertemplateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrdersGettestordertemplateCall) IfNoneMatch(entityTag string) *OrdersGettestordertemplateCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersGettestordertemplateCall) Context(ctx context.Context) *OrdersGettestordertemplateCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersGettestordertemplateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/testordertemplates/{templateName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "templateName": c.templateName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.gettestordertemplate" call. +// Exactly one of *OrdersGetTestOrderTemplateResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *OrdersGetTestOrderTemplateResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrdersGettestordertemplateCall) Do() (*OrdersGetTestOrderTemplateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersGetTestOrderTemplateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox.", + // "httpMethod": "GET", + // "id": "content.orders.gettestordertemplate", + // "parameterOrder": [ + // "merchantId", + // "templateName" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "templateName": { + // "description": "The name of the template to retrieve.", + // "enum": [ + // "template1", + // "template2" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/testordertemplates/{templateName}", + // "response": { + // "$ref": "OrdersGetTestOrderTemplateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.list": + +type OrdersListCall struct { + s *Service + merchantId uint64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the orders in your Merchant Center account. +func (r *OrdersService) List(merchantId uint64) *OrdersListCall { + c := &OrdersListCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + return c +} + +// Acknowledged sets the optional parameter "acknowledged": Obtains +// orders that match the acknowledgement status. When set to true, +// obtains orders that have been acknowledged. When false, obtains +// orders that have not been acknowledged. +// We recommend using this filter set to false, in conjunction with the +// acknowledge call, such that only un-acknowledged orders are returned. +func (c *OrdersListCall) Acknowledged(acknowledged bool) *OrdersListCall { + c.opt_["acknowledged"] = acknowledged + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of orders to return in the response, used for paging. The +// default value is 25 orders per page, and the maximum allowed value is +// 250 orders per page. +// Known issue: All List calls will return all Orders without limit +// regardless of the value of this field. +func (c *OrdersListCall) MaxResults(maxResults int64) *OrdersListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": The ordering of the +// returned list. The only supported value are placedDate desc and +// placedDate asc for now, which returns orders sorted by placement +// date. "placedDate desc" stands for listing orders by placement date, +// from oldest to most recent. "placedDate asc" stands for listing +// orders by placement date, from most recent to oldest. In future +// releases we'll support other sorting criteria. +// +// Possible values: +// "placedDate asc" +// "placedDate desc" +func (c *OrdersListCall) OrderBy(orderBy string) *OrdersListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *OrdersListCall) PageToken(pageToken string) *OrdersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// PlacedDateEnd sets the optional parameter "placedDateEnd": Obtains +// orders placed before this date (exclusively), in ISO 8601 format. +func (c *OrdersListCall) PlacedDateEnd(placedDateEnd string) *OrdersListCall { + c.opt_["placedDateEnd"] = placedDateEnd + return c +} + +// PlacedDateStart sets the optional parameter "placedDateStart": +// Obtains orders placed after this date (inclusively), in ISO 8601 +// format. +func (c *OrdersListCall) PlacedDateStart(placedDateStart string) *OrdersListCall { + c.opt_["placedDateStart"] = placedDateStart + return c +} + +// Statuses sets the optional parameter "statuses": Obtains orders that +// match any of the specified statuses. Multiple values can be specified +// with comma separation. Additionally, please note that active is a +// shortcut for pendingShipment and partiallyShipped, and completed is a +// shortcut for shipped , partiallyDelivered, delivered, +// partiallyReturned, returned, and canceled. +// +// Possible values: +// "active" +// "canceled" +// "completed" +// "delivered" +// "inProgress" +// "partiallyDelivered" +// "partiallyReturned" +// "partiallyShipped" +// "pendingShipment" +// "returned" +// "shipped" +func (c *OrdersListCall) Statuses(statuses string) *OrdersListCall { + c.opt_["statuses"] = statuses + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersListCall) Fields(s ...googleapi.Field) *OrdersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrdersListCall) IfNoneMatch(entityTag string) *OrdersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersListCall) Context(ctx context.Context) *OrdersListCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["acknowledged"]; ok { + params.Set("acknowledged", 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_["placedDateEnd"]; ok { + params.Set("placedDateEnd", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["placedDateStart"]; ok { + params.Set("placedDateStart", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["statuses"]; ok { + params.Set("statuses", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.list" call. +// Exactly one of *OrdersListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *OrdersListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrdersListCall) Do() (*OrdersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the orders in your Merchant Center account.", + // "httpMethod": "GET", + // "id": "content.orders.list", + // "parameterOrder": [ + // "merchantId" + // ], + // "parameters": { + // "acknowledged": { + // "description": "Obtains orders that match the acknowledgement status. When set to true, obtains orders that have been acknowledged. When false, obtains orders that have not been acknowledged.\nWe recommend using this filter set to false, in conjunction with the acknowledge call, such that only un-acknowledged orders are returned.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "The maximum number of orders to return in the response, used for paging. The default value is 25 orders per page, and the maximum allowed value is 250 orders per page.\nKnown issue: All List calls will return all Orders without limit regardless of the value of this field.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orderBy": { + // "description": "The ordering of the returned list. The only supported value are placedDate desc and placedDate asc for now, which returns orders sorted by placement date. \"placedDate desc\" stands for listing orders by placement date, from oldest to most recent. \"placedDate asc\" stands for listing orders by placement date, from most recent to oldest. In future releases we'll support other sorting criteria.", + // "enum": [ + // "placedDate asc", + // "placedDate desc" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "The token returned by the previous request.", + // "location": "query", + // "type": "string" + // }, + // "placedDateEnd": { + // "description": "Obtains orders placed before this date (exclusively), in ISO 8601 format.", + // "location": "query", + // "type": "string" + // }, + // "placedDateStart": { + // "description": "Obtains orders placed after this date (inclusively), in ISO 8601 format.", + // "location": "query", + // "type": "string" + // }, + // "statuses": { + // "description": "Obtains orders that match any of the specified statuses. Multiple values can be specified with comma separation. Additionally, please note that active is a shortcut for pendingShipment and partiallyShipped, and completed is a shortcut for shipped , partiallyDelivered, delivered, partiallyReturned, returned, and canceled.", + // "enum": [ + // "active", + // "canceled", + // "completed", + // "delivered", + // "inProgress", + // "partiallyDelivered", + // "partiallyReturned", + // "partiallyShipped", + // "pendingShipment", + // "returned", + // "shipped" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/orders", + // "response": { + // "$ref": "OrdersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.refund": + +type OrdersRefundCall struct { + s *Service + merchantId uint64 + orderId string + ordersrefundrequest *OrdersRefundRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Refund: Refund a portion of the order, up to the full amount paid. +func (r *OrdersService) Refund(merchantId uint64, orderId string, ordersrefundrequest *OrdersRefundRequest) *OrdersRefundCall { + c := &OrdersRefundCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.orderId = orderId + c.ordersrefundrequest = ordersrefundrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersRefundCall) Fields(s ...googleapi.Field) *OrdersRefundCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersRefundCall) Context(ctx context.Context) *OrdersRefundCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersRefundCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersrefundrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/refund") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "orderId": c.orderId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.refund" call. +// Exactly one of *OrdersRefundResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *OrdersRefundResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrdersRefundCall) Do() (*OrdersRefundResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersRefundResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Refund a portion of the order, up to the full amount paid.", + // "httpMethod": "POST", + // "id": "content.orders.refund", + // "parameterOrder": [ + // "merchantId", + // "orderId" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orderId": { + // "description": "The ID of the order to refund.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/orders/{orderId}/refund", + // "request": { + // "$ref": "OrdersRefundRequest" + // }, + // "response": { + // "$ref": "OrdersRefundResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.returnlineitem": + +type OrdersReturnlineitemCall struct { + s *Service + merchantId uint64 + orderId string + ordersreturnlineitemrequest *OrdersReturnLineItemRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Returnlineitem: Returns a line item. +func (r *OrdersService) Returnlineitem(merchantId uint64, orderId string, ordersreturnlineitemrequest *OrdersReturnLineItemRequest) *OrdersReturnlineitemCall { + c := &OrdersReturnlineitemCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.orderId = orderId + c.ordersreturnlineitemrequest = ordersreturnlineitemrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersReturnlineitemCall) Fields(s ...googleapi.Field) *OrdersReturnlineitemCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersReturnlineitemCall) Context(ctx context.Context) *OrdersReturnlineitemCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersReturnlineitemCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersreturnlineitemrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/returnLineItem") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "orderId": c.orderId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.returnlineitem" call. +// Exactly one of *OrdersReturnLineItemResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *OrdersReturnLineItemResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrdersReturnlineitemCall) Do() (*OrdersReturnLineItemResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersReturnLineItemResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a line item.", + // "httpMethod": "POST", + // "id": "content.orders.returnlineitem", + // "parameterOrder": [ + // "merchantId", + // "orderId" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orderId": { + // "description": "The ID of the order.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/orders/{orderId}/returnLineItem", + // "request": { + // "$ref": "OrdersReturnLineItemRequest" + // }, + // "response": { + // "$ref": "OrdersReturnLineItemResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.shiplineitems": + +type OrdersShiplineitemsCall struct { + s *Service + merchantId uint64 + orderId string + ordersshiplineitemsrequest *OrdersShipLineItemsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Shiplineitems: Marks line item(s) as shipped. +func (r *OrdersService) Shiplineitems(merchantId uint64, orderId string, ordersshiplineitemsrequest *OrdersShipLineItemsRequest) *OrdersShiplineitemsCall { + c := &OrdersShiplineitemsCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.orderId = orderId + c.ordersshiplineitemsrequest = ordersshiplineitemsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersShiplineitemsCall) Fields(s ...googleapi.Field) *OrdersShiplineitemsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersShiplineitemsCall) Context(ctx context.Context) *OrdersShiplineitemsCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersShiplineitemsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersshiplineitemsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/shipLineItems") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "orderId": c.orderId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.shiplineitems" call. +// Exactly one of *OrdersShipLineItemsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *OrdersShipLineItemsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrdersShiplineitemsCall) Do() (*OrdersShipLineItemsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersShipLineItemsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Marks line item(s) as shipped.", + // "httpMethod": "POST", + // "id": "content.orders.shiplineitems", + // "parameterOrder": [ + // "merchantId", + // "orderId" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orderId": { + // "description": "The ID of the order.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/orders/{orderId}/shipLineItems", + // "request": { + // "$ref": "OrdersShipLineItemsRequest" + // }, + // "response": { + // "$ref": "OrdersShipLineItemsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.updatemerchantorderid": + +type OrdersUpdatemerchantorderidCall struct { + s *Service + merchantId uint64 + orderId string + ordersupdatemerchantorderidrequest *OrdersUpdateMerchantOrderIdRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Updatemerchantorderid: Updates the merchant order ID for a given +// order. +func (r *OrdersService) Updatemerchantorderid(merchantId uint64, orderId string, ordersupdatemerchantorderidrequest *OrdersUpdateMerchantOrderIdRequest) *OrdersUpdatemerchantorderidCall { + c := &OrdersUpdatemerchantorderidCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.orderId = orderId + c.ordersupdatemerchantorderidrequest = ordersupdatemerchantorderidrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersUpdatemerchantorderidCall) Fields(s ...googleapi.Field) *OrdersUpdatemerchantorderidCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersUpdatemerchantorderidCall) Context(ctx context.Context) *OrdersUpdatemerchantorderidCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersUpdatemerchantorderidCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersupdatemerchantorderidrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/updateMerchantOrderId") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "orderId": c.orderId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.updatemerchantorderid" call. +// Exactly one of *OrdersUpdateMerchantOrderIdResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *OrdersUpdateMerchantOrderIdResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrdersUpdatemerchantorderidCall) Do() (*OrdersUpdateMerchantOrderIdResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersUpdateMerchantOrderIdResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the merchant order ID for a given order.", + // "httpMethod": "POST", + // "id": "content.orders.updatemerchantorderid", + // "parameterOrder": [ + // "merchantId", + // "orderId" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orderId": { + // "description": "The ID of the order.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/orders/{orderId}/updateMerchantOrderId", + // "request": { + // "$ref": "OrdersUpdateMerchantOrderIdRequest" + // }, + // "response": { + // "$ref": "OrdersUpdateMerchantOrderIdResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.updateshipment": + +type OrdersUpdateshipmentCall struct { + s *Service + merchantId uint64 + orderId string + ordersupdateshipmentrequest *OrdersUpdateShipmentRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Updateshipment: Updates a shipment's status, carrier, and/or tracking +// ID. +func (r *OrdersService) Updateshipment(merchantId uint64, orderId string, ordersupdateshipmentrequest *OrdersUpdateShipmentRequest) *OrdersUpdateshipmentCall { + c := &OrdersUpdateshipmentCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.orderId = orderId + c.ordersupdateshipmentrequest = ordersupdateshipmentrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersUpdateshipmentCall) Fields(s ...googleapi.Field) *OrdersUpdateshipmentCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersUpdateshipmentCall) Context(ctx context.Context) *OrdersUpdateshipmentCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersUpdateshipmentCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersupdateshipmentrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/updateShipment") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "orderId": c.orderId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.updateshipment" call. +// Exactly one of *OrdersUpdateShipmentResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *OrdersUpdateShipmentResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrdersUpdateshipmentCall) Do() (*OrdersUpdateShipmentResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersUpdateShipmentResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a shipment's status, carrier, and/or tracking ID.", + // "httpMethod": "POST", + // "id": "content.orders.updateshipment", + // "parameterOrder": [ + // "merchantId", + // "orderId" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orderId": { + // "description": "The ID of the order.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/orders/{orderId}/updateShipment", + // "request": { + // "$ref": "OrdersUpdateShipmentRequest" + // }, + // "response": { + // "$ref": "OrdersUpdateShipmentResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.products.custombatch": + +type ProductsCustombatchCall struct { + s *Service + productscustombatchrequest *ProductsCustomBatchRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Custombatch: Retrieves, inserts, and deletes multiple products in a +// single request. +func (r *ProductsService) Custombatch(productscustombatchrequest *ProductsCustomBatchRequest) *ProductsCustombatchCall { + c := &ProductsCustombatchCall{s: r.s, opt_: make(map[string]interface{})} + c.productscustombatchrequest = productscustombatchrequest + return c +} + +// DryRun sets the optional parameter "dryRun": Flag to run the request +// in dry-run mode. +func (c *ProductsCustombatchCall) DryRun(dryRun bool) *ProductsCustombatchCall { + c.opt_["dryRun"] = dryRun + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProductsCustombatchCall) Fields(s ...googleapi.Field) *ProductsCustombatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProductsCustombatchCall) Context(ctx context.Context) *ProductsCustombatchCall { + c.ctx_ = ctx + return c +} + +func (c *ProductsCustombatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.productscustombatchrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["dryRun"]; ok { + params.Set("dryRun", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "products/batch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.products.custombatch" call. +// Exactly one of *ProductsCustomBatchResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ProductsCustomBatchResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProductsCustombatchCall) Do() (*ProductsCustomBatchResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProductsCustomBatchResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves, inserts, and deletes multiple products in a single request.", + // "httpMethod": "POST", + // "id": "content.products.custombatch", + // "parameters": { + // "dryRun": { + // "description": "Flag to run the request in dry-run mode.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "products/batch", + // "request": { + // "$ref": "ProductsCustomBatchRequest" + // }, + // "response": { + // "$ref": "ProductsCustomBatchResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.products.delete": + +type ProductsDeleteCall struct { + s *Service + merchantId uint64 + productId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a product from your Merchant Center account. +func (r *ProductsService) Delete(merchantId uint64, productId string) *ProductsDeleteCall { + c := &ProductsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.productId = productId + return c +} + +// DryRun sets the optional parameter "dryRun": Flag to run the request +// in dry-run mode. +func (c *ProductsDeleteCall) DryRun(dryRun bool) *ProductsDeleteCall { + c.opt_["dryRun"] = dryRun + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProductsDeleteCall) Fields(s ...googleapi.Field) *ProductsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProductsDeleteCall) Context(ctx context.Context) *ProductsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ProductsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["dryRun"]; ok { + params.Set("dryRun", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/products/{productId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "productId": c.productId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.products.delete" call. +func (c *ProductsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a product from your Merchant Center account.", + // "httpMethod": "DELETE", + // "id": "content.products.delete", + // "parameterOrder": [ + // "merchantId", + // "productId" + // ], + // "parameters": { + // "dryRun": { + // "description": "Flag to run the request in dry-run mode.", + // "location": "query", + // "type": "boolean" + // }, + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "productId": { + // "description": "The ID of the product.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/products/{productId}", + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.products.get": + +type ProductsGetCall struct { + s *Service + merchantId uint64 + productId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves a product from your Merchant Center account. +func (r *ProductsService) Get(merchantId uint64, productId string) *ProductsGetCall { + c := &ProductsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.productId = productId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProductsGetCall) Fields(s ...googleapi.Field) *ProductsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProductsGetCall) IfNoneMatch(entityTag string) *ProductsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProductsGetCall) Context(ctx context.Context) *ProductsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProductsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/products/{productId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "productId": c.productId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.products.get" call. +// Exactly one of *Product or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Product.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProductsGetCall) Do() (*Product, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Product{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a product from your Merchant Center account.", + // "httpMethod": "GET", + // "id": "content.products.get", + // "parameterOrder": [ + // "merchantId", + // "productId" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "productId": { + // "description": "The ID of the product.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/products/{productId}", + // "response": { + // "$ref": "Product" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.products.insert": + +type ProductsInsertCall struct { + s *Service + merchantId uint64 + product *Product + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Uploads a product to your Merchant Center account. +func (r *ProductsService) Insert(merchantId uint64, product *Product) *ProductsInsertCall { + c := &ProductsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.product = product + return c +} + +// DryRun sets the optional parameter "dryRun": Flag to run the request +// in dry-run mode. +func (c *ProductsInsertCall) DryRun(dryRun bool) *ProductsInsertCall { + c.opt_["dryRun"] = dryRun + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProductsInsertCall) Fields(s ...googleapi.Field) *ProductsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProductsInsertCall) Context(ctx context.Context) *ProductsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ProductsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.product) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["dryRun"]; ok { + params.Set("dryRun", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/products") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.products.insert" call. +// Exactly one of *Product or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Product.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProductsInsertCall) Do() (*Product, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Product{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Uploads a product to your Merchant Center account.", + // "httpMethod": "POST", + // "id": "content.products.insert", + // "parameterOrder": [ + // "merchantId" + // ], + // "parameters": { + // "dryRun": { + // "description": "Flag to run the request in dry-run mode.", + // "location": "query", + // "type": "boolean" + // }, + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/products", + // "request": { + // "$ref": "Product" + // }, + // "response": { + // "$ref": "Product" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.products.list": + +type ProductsListCall struct { + s *Service + merchantId uint64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the products in your Merchant Center account. +func (r *ProductsService) List(merchantId uint64) *ProductsListCall { + c := &ProductsListCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of products to return in the response, used for paging. +func (c *ProductsListCall) MaxResults(maxResults int64) *ProductsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *ProductsListCall) PageToken(pageToken string) *ProductsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProductsListCall) Fields(s ...googleapi.Field) *ProductsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProductsListCall) IfNoneMatch(entityTag string) *ProductsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProductsListCall) Context(ctx context.Context) *ProductsListCall { + c.ctx_ = ctx + return c +} + +func (c *ProductsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/products") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.products.list" call. +// Exactly one of *ProductsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ProductsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProductsListCall) Do() (*ProductsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProductsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the products in your Merchant Center account.", + // "httpMethod": "GET", + // "id": "content.products.list", + // "parameterOrder": [ + // "merchantId" + // ], + // "parameters": { + // "maxResults": { + // "description": "The maximum number of products to return in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageToken": { + // "description": "The token returned by the previous request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "{merchantId}/products", + // "response": { + // "$ref": "ProductsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.productstatuses.custombatch": + +type ProductstatusesCustombatchCall struct { + s *Service + productstatusescustombatchrequest *ProductstatusesCustomBatchRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Custombatch: Gets the statuses of multiple products in a single +// request. +func (r *ProductstatusesService) Custombatch(productstatusescustombatchrequest *ProductstatusesCustomBatchRequest) *ProductstatusesCustombatchCall { + c := &ProductstatusesCustombatchCall{s: r.s, opt_: make(map[string]interface{})} + c.productstatusescustombatchrequest = productstatusescustombatchrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProductstatusesCustombatchCall) Fields(s ...googleapi.Field) *ProductstatusesCustombatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProductstatusesCustombatchCall) Context(ctx context.Context) *ProductstatusesCustombatchCall { + c.ctx_ = ctx + return c +} + +func (c *ProductstatusesCustombatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.productstatusescustombatchrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "productstatuses/batch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.productstatuses.custombatch" call. +// Exactly one of *ProductstatusesCustomBatchResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ProductstatusesCustomBatchResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProductstatusesCustombatchCall) Do() (*ProductstatusesCustomBatchResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProductstatusesCustomBatchResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the statuses of multiple products in a single request.", + // "httpMethod": "POST", + // "id": "content.productstatuses.custombatch", + // "path": "productstatuses/batch", + // "request": { + // "$ref": "ProductstatusesCustomBatchRequest" + // }, + // "response": { + // "$ref": "ProductstatusesCustomBatchResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.productstatuses.get": + +type ProductstatusesGetCall struct { + s *Service + merchantId uint64 + productId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the status of a product from your Merchant Center account. +func (r *ProductstatusesService) Get(merchantId uint64, productId string) *ProductstatusesGetCall { + c := &ProductstatusesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.productId = productId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProductstatusesGetCall) Fields(s ...googleapi.Field) *ProductstatusesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProductstatusesGetCall) IfNoneMatch(entityTag string) *ProductstatusesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProductstatusesGetCall) Context(ctx context.Context) *ProductstatusesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProductstatusesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/productstatuses/{productId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "productId": c.productId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.productstatuses.get" call. +// Exactly one of *ProductStatus or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ProductStatus.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProductstatusesGetCall) Do() (*ProductStatus, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProductStatus{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the status of a product from your Merchant Center account.", + // "httpMethod": "GET", + // "id": "content.productstatuses.get", + // "parameterOrder": [ + // "merchantId", + // "productId" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "productId": { + // "description": "The ID of the product.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/productstatuses/{productId}", + // "response": { + // "$ref": "ProductStatus" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.productstatuses.list": + +type ProductstatusesListCall struct { + s *Service + merchantId uint64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the statuses of the products in your Merchant Center +// account. +func (r *ProductstatusesService) List(merchantId uint64) *ProductstatusesListCall { + c := &ProductstatusesListCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of product statuses to return in the response, used for +// paging. +func (c *ProductstatusesListCall) MaxResults(maxResults int64) *ProductstatusesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *ProductstatusesListCall) PageToken(pageToken string) *ProductstatusesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProductstatusesListCall) Fields(s ...googleapi.Field) *ProductstatusesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProductstatusesListCall) IfNoneMatch(entityTag string) *ProductstatusesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProductstatusesListCall) Context(ctx context.Context) *ProductstatusesListCall { + c.ctx_ = ctx + return c +} + +func (c *ProductstatusesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/productstatuses") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.productstatuses.list" call. +// Exactly one of *ProductstatusesListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ProductstatusesListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProductstatusesListCall) Do() (*ProductstatusesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProductstatusesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the statuses of the products in your Merchant Center account.", + // "httpMethod": "GET", + // "id": "content.productstatuses.list", + // "parameterOrder": [ + // "merchantId" + // ], + // "parameters": { + // "maxResults": { + // "description": "The maximum number of product statuses to return in the response, used for paging.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageToken": { + // "description": "The token returned by the previous request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "{merchantId}/productstatuses", + // "response": { + // "$ref": "ProductstatusesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/content/v2sandbox/content-api.json b/Godeps/_workspace/src/google.golang.org/api/content/v2sandbox/content-api.json new file mode 100644 index 000000000..ff4cd9caf --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/content/v2sandbox/content-api.json @@ -0,0 +1,2175 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/tvcbcjhYGF5BJi8y8RNxRBdwomM\"", + "discoveryVersion": "v1", + "id": "content:v2sandbox", + "name": "content", + "canonicalName": "Shopping Content", + "version": "v2sandbox", + "revision": "20150915", + "title": "Content API for Shopping", + "description": "Manage product items, inventory, and Merchant Center accounts for Google Shopping.", + "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-content", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/content/v2sandbox/", + "basePath": "/content/v2sandbox/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "content/v2sandbox/", + "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/content": { + "description": "Manage your product listings and accounts for Google Shopping" + } + } + } + }, + "schemas": { + "Error": { + "id": "Error", + "type": "object", + "description": "An error returned by the API.", + "properties": { + "domain": { + "type": "string", + "description": "The domain of the error." + }, + "message": { + "type": "string", + "description": "A description of the error." + }, + "reason": { + "type": "string", + "description": "The error code." + } + } + }, + "Errors": { + "id": "Errors", + "type": "object", + "description": "A list of errors returned by a failed batch entry.", + "properties": { + "code": { + "type": "integer", + "description": "The HTTP status of the first error in errors.", + "format": "uint32" + }, + "errors": { + "type": "array", + "description": "A list of errors.", + "items": { + "$ref": "Error" + } + }, + "message": { + "type": "string", + "description": "The message of the first error in errors." + } + } + }, + "Order": { + "id": "Order", + "type": "object", + "properties": { + "acknowledged": { + "type": "boolean", + "description": "Whether the order was acknowledged." + }, + "customer": { + "$ref": "OrderCustomer", + "description": "The details of the customer who placed the order." + }, + "deliveryDetails": { + "$ref": "OrderDeliveryDetails", + "description": "The details for the delivery." + }, + "id": { + "type": "string", + "description": "The REST id of the order. Globally unique." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#order\".", + "default": "content#order" + }, + "lineItems": { + "type": "array", + "description": "Line items that are ordered.", + "items": { + "$ref": "OrderLineItem" + } + }, + "merchantId": { + "type": "string", + "format": "uint64" + }, + "merchantOrderId": { + "type": "string", + "description": "Merchant-provided id of the order." + }, + "netAmount": { + "$ref": "Price", + "description": "The net amount for the order. For example, if an order was originally for a grand total of $100 and a refund was issued for $20, the net amount will be $80." + }, + "paymentMethod": { + "$ref": "OrderPaymentMethod", + "description": "The details of the payment method." + }, + "paymentStatus": { + "type": "string", + "description": "The status of the payment." + }, + "placedDate": { + "type": "string", + "description": "The date when the order was placed, in ISO 8601 format." + }, + "refunds": { + "type": "array", + "description": "Refunds for the order.", + "items": { + "$ref": "OrderRefund" + } + }, + "shipments": { + "type": "array", + "description": "Shipments of the order.", + "items": { + "$ref": "OrderShipment" + } + }, + "shippingCost": { + "$ref": "Price", + "description": "The total cost of shipping for all items." + }, + "shippingCostTax": { + "$ref": "Price", + "description": "The tax for the total shipping cost." + }, + "shippingOption": { + "type": "string", + "description": "The requested shipping option." + }, + "status": { + "type": "string", + "description": "The status of the order." + } + } + }, + "OrderAddress": { + "id": "OrderAddress", + "type": "object", + "properties": { + "country": { + "type": "string", + "description": "CLDR country code (e.g. \"US\")." + }, + "fullAddress": { + "type": "array", + "description": "Strings representing the lines of the printed label for mailing the order, for example:\nJohn Smith\n1600 Amphitheatre Parkway\nMountain View, CA, 94043\nUnited States", + "items": { + "type": "string" + } + }, + "isPostOfficeBox": { + "type": "boolean", + "description": "Whether the address is a post office box." + }, + "locality": { + "type": "string", + "description": "City, town or commune. May also include dependent localities or sublocalities (e.g. neighborhoods or suburbs)." + }, + "postalCode": { + "type": "string", + "description": "Postal Code or ZIP (e.g. \"94043\")." + }, + "recipientName": { + "type": "string", + "description": "Name of the recipient." + }, + "region": { + "type": "string", + "description": "Top-level administrative subdivision of the country (e.g. \"CA\")." + }, + "streetAddress": { + "type": "array", + "description": "Street-level part of the address.", + "items": { + "type": "string" + } + } + } + }, + "OrderCancellation": { + "id": "OrderCancellation", + "type": "object", + "properties": { + "actor": { + "type": "string", + "description": "The actor that created the cancellation." + }, + "creationDate": { + "type": "string", + "description": "Date on which the cancellation has been created, in ISO 8601 format." + }, + "quantity": { + "type": "integer", + "description": "The quantity that was canceled.", + "format": "uint32" + }, + "reason": { + "type": "string", + "description": "The reason for the cancellation." + }, + "reasonText": { + "type": "string", + "description": "The explanation of the reason." + } + } + }, + "OrderCustomer": { + "id": "OrderCustomer", + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email address of the customer." + }, + "explicitMarketingPreference": { + "type": "boolean", + "description": "If set, this indicates the user had a choice to opt in or out of providing marketing rights to the merchant. If unset, this indicates the user has already made this choice in a previous purchase, and was thus not shown the marketing right opt in/out checkbox during the Purchases on Google checkout flow." + }, + "fullName": { + "type": "string", + "description": "Full name of the customer." + } + } + }, + "OrderDeliveryDetails": { + "id": "OrderDeliveryDetails", + "type": "object", + "properties": { + "address": { + "$ref": "OrderAddress", + "description": "The delivery address" + }, + "phoneNumber": { + "type": "string", + "description": "The phone number of the person receiving the delivery." + } + } + }, + "OrderLineItem": { + "id": "OrderLineItem", + "type": "object", + "properties": { + "cancellations": { + "type": "array", + "description": "Cancellations of the line item.", + "items": { + "$ref": "OrderCancellation" + } + }, + "id": { + "type": "string", + "description": "The id of the line item." + }, + "price": { + "$ref": "Price", + "description": "Total price for the line item. For example, if two items for $10 are purchased, the total price will be $20." + }, + "product": { + "$ref": "OrderLineItemProduct", + "description": "Product data from the time of the order placement." + }, + "quantityCanceled": { + "type": "integer", + "description": "Number of items canceled.", + "format": "uint32" + }, + "quantityDelivered": { + "type": "integer", + "description": "Number of items delivered.", + "format": "uint32" + }, + "quantityOrdered": { + "type": "integer", + "description": "Number of items ordered.", + "format": "uint32" + }, + "quantityPending": { + "type": "integer", + "description": "Number of items pending.", + "format": "uint32" + }, + "quantityReturned": { + "type": "integer", + "description": "Number of items returned.", + "format": "uint32" + }, + "quantityShipped": { + "type": "integer", + "description": "Number of items shipped.", + "format": "uint32" + }, + "returnInfo": { + "$ref": "OrderLineItemReturnInfo", + "description": "Details of the return policy for the line item." + }, + "returns": { + "type": "array", + "description": "Returns of the line item.", + "items": { + "$ref": "OrderReturn" + } + }, + "shippingDetails": { + "$ref": "OrderLineItemShippingDetails", + "description": "Details of the requested shipping for the line item." + }, + "tax": { + "$ref": "Price", + "description": "Total tax amount for the line item. For example, if two items are purchased, and each have a cost tax of $2, the total tax amount will be $4." + } + } + }, + "OrderLineItemProduct": { + "id": "OrderLineItemProduct", + "type": "object", + "properties": { + "brand": { + "type": "string", + "description": "Brand of the item." + }, + "channel": { + "type": "string", + "description": "The item's channel (online or local)." + }, + "condition": { + "type": "string", + "description": "Condition or state of the item." + }, + "contentLanguage": { + "type": "string", + "description": "The two-letter ISO 639-1 language code for the item." + }, + "gtin": { + "type": "string", + "description": "Global Trade Item Number (GTIN) of the item." + }, + "id": { + "type": "string", + "description": "The REST id of the product." + }, + "imageLink": { + "type": "string", + "description": "URL of an image of the item." + }, + "itemGroupId": { + "type": "string", + "description": "Shared identifier for all variants of the same product." + }, + "mpn": { + "type": "string", + "description": "Manufacturer Part Number (MPN) of the item." + }, + "offerId": { + "type": "string", + "description": "An identifier of the item." + }, + "price": { + "$ref": "Price", + "description": "Price of the item." + }, + "shownImage": { + "type": "string", + "description": "URL to the cached image shown to the user when order was placed." + }, + "targetCountry": { + "type": "string", + "description": "The CLDR territory code of the target country of the product." + }, + "title": { + "type": "string", + "description": "The title of the product." + }, + "variantAttributes": { + "type": "array", + "description": "Variant attributes for the item. These are dimensions of the product, such as color, gender, material, pattern, and size. You can find a comprehensive list of variant attributes here.", + "items": { + "$ref": "OrderLineItemProductVariantAttribute" + } + } + } + }, + "OrderLineItemProductVariantAttribute": { + "id": "OrderLineItemProductVariantAttribute", + "type": "object", + "properties": { + "dimension": { + "type": "string", + "description": "The dimension of the variant." + }, + "value": { + "type": "string", + "description": "The value for the dimension." + } + } + }, + "OrderLineItemReturnInfo": { + "id": "OrderLineItemReturnInfo", + "type": "object", + "properties": { + "daysToReturn": { + "type": "integer", + "description": "How many days later the item can be returned.", + "format": "int32", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "isReturnable": { + "type": "boolean", + "description": "Whether the item is returnable.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "policyUrl": { + "type": "string", + "description": "URL of the item return policy.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + } + } + }, + "OrderLineItemShippingDetails": { + "id": "OrderLineItemShippingDetails", + "type": "object", + "properties": { + "deliverByDate": { + "type": "string", + "description": "The delivery by date, in ISO 8601 format.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "method": { + "$ref": "OrderLineItemShippingDetailsMethod", + "description": "Details of the shipping method.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "shipByDate": { + "type": "string", + "description": "The ship by date, in ISO 8601 format.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + } + } + }, + "OrderLineItemShippingDetailsMethod": { + "id": "OrderLineItemShippingDetailsMethod", + "type": "object", + "properties": { + "carrier": { + "type": "string", + "description": "The carrier for the shipping. Optional." + }, + "maxDaysInTransit": { + "type": "integer", + "description": "Maximum transit time.", + "format": "uint32", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "methodName": { + "type": "string", + "description": "The name of the shipping method.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "minDaysInTransit": { + "type": "integer", + "description": "Minimum transit time.", + "format": "uint32", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + } + } + }, + "OrderPaymentMethod": { + "id": "OrderPaymentMethod", + "type": "object", + "properties": { + "billingAddress": { + "$ref": "OrderAddress", + "description": "The billing address." + }, + "expirationMonth": { + "type": "integer", + "description": "The card expiration month (January = 1, February = 2 etc.).", + "format": "int32" + }, + "expirationYear": { + "type": "integer", + "description": "The card expiration year (4-digit, e.g. 2015).", + "format": "int32" + }, + "lastFourDigits": { + "type": "string", + "description": "The last four digits of the card number." + }, + "phoneNumber": { + "type": "string", + "description": "The billing phone number." + }, + "type": { + "type": "string", + "description": "The type of instrument (VISA, Mastercard, etc)." + } + } + }, + "OrderRefund": { + "id": "OrderRefund", + "type": "object", + "properties": { + "actor": { + "type": "string", + "description": "The actor that created the refund." + }, + "amount": { + "$ref": "Price", + "description": "The amount that is refunded." + }, + "creationDate": { + "type": "string", + "description": "Date on which the item has been created, in ISO 8601 format." + }, + "reason": { + "type": "string", + "description": "The reason for the refund." + }, + "reasonText": { + "type": "string", + "description": "The explanation of the reason." + } + } + }, + "OrderReturn": { + "id": "OrderReturn", + "type": "object", + "properties": { + "actor": { + "type": "string", + "description": "The actor that created the refund." + }, + "creationDate": { + "type": "string", + "description": "Date on which the item has been created, in ISO 8601 format." + }, + "quantity": { + "type": "integer", + "description": "Quantity that is returned.", + "format": "uint32" + }, + "reason": { + "type": "string", + "description": "The reason for the return." + }, + "reasonText": { + "type": "string", + "description": "The explanation of the reason." + } + } + }, + "OrderShipment": { + "id": "OrderShipment", + "type": "object", + "properties": { + "carrier": { + "type": "string", + "description": "The carrier handling the shipment." + }, + "creationDate": { + "type": "string", + "description": "Date on which the shipment has been created, in ISO 8601 format." + }, + "deliveryDate": { + "type": "string", + "description": "Date on which the shipment has been delivered, in ISO 8601 format. Present only if status is delievered" + }, + "id": { + "type": "string", + "description": "The id of the shipment." + }, + "lineItems": { + "type": "array", + "description": "The line items that are shipped.", + "items": { + "$ref": "OrderShipmentLineItemShipment" + } + }, + "status": { + "type": "string", + "description": "The status of the shipment." + }, + "trackingId": { + "type": "string", + "description": "The tracking id for the shipment." + } + } + }, + "OrderShipmentLineItemShipment": { + "id": "OrderShipmentLineItemShipment", + "type": "object", + "properties": { + "lineItemId": { + "type": "string", + "description": "The id of the line item that is shipped." + }, + "quantity": { + "type": "integer", + "description": "The quantity that is shipped.", + "format": "uint32" + } + } + }, + "OrdersAcknowledgeRequest": { + "id": "OrdersAcknowledgeRequest", + "type": "object", + "properties": { + "operationId": { + "type": "string", + "description": "The ID of the operation. Unique across all operations for a given order." + } + } + }, + "OrdersAcknowledgeResponse": { + "id": "OrdersAcknowledgeResponse", + "type": "object", + "properties": { + "executionStatus": { + "type": "string", + "description": "The status of the execution." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersAcknowledgeResponse\".", + "default": "content#ordersAcknowledgeResponse" + } + } + }, + "OrdersAdvanceTestOrderResponse": { + "id": "OrdersAdvanceTestOrderResponse", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersAdvanceTestOrderResponse\".", + "default": "content#ordersAdvanceTestOrderResponse" + } + } + }, + "OrdersCancelLineItemRequest": { + "id": "OrdersCancelLineItemRequest", + "type": "object", + "properties": { + "lineItemId": { + "type": "string", + "description": "The ID of the line item to cancel." + }, + "operationId": { + "type": "string", + "description": "The ID of the operation. Unique across all operations for a given order." + }, + "quantity": { + "type": "integer", + "description": "The quantity to cancel.", + "format": "uint32" + }, + "reason": { + "type": "string", + "description": "The reason for the cancellation." + }, + "reasonText": { + "type": "string", + "description": "The explanation of the reason." + } + } + }, + "OrdersCancelLineItemResponse": { + "id": "OrdersCancelLineItemResponse", + "type": "object", + "properties": { + "executionStatus": { + "type": "string", + "description": "The status of the execution." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersCancelLineItemResponse\".", + "default": "content#ordersCancelLineItemResponse" + } + } + }, + "OrdersCancelRequest": { + "id": "OrdersCancelRequest", + "type": "object", + "properties": { + "operationId": { + "type": "string", + "description": "The ID of the operation. Unique across all operations for a given order." + }, + "reason": { + "type": "string", + "description": "The reason for the cancellation." + }, + "reasonText": { + "type": "string", + "description": "The explanation of the reason." + } + } + }, + "OrdersCancelResponse": { + "id": "OrdersCancelResponse", + "type": "object", + "properties": { + "executionStatus": { + "type": "string", + "description": "The status of the execution." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersCancelResponse\".", + "default": "content#ordersCancelResponse" + } + } + }, + "OrdersCreateTestOrderRequest": { + "id": "OrdersCreateTestOrderRequest", + "type": "object", + "properties": { + "templateName": { + "type": "string", + "description": "The test order template to use. Specify as an alternative to testOrder as a shortcut for retrieving a template and then creating an order using that template." + }, + "testOrder": { + "$ref": "TestOrder", + "description": "The test order to create." + } + } + }, + "OrdersCreateTestOrderResponse": { + "id": "OrdersCreateTestOrderResponse", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersCreateTestOrderResponse\".", + "default": "content#ordersCreateTestOrderResponse" + }, + "orderId": { + "type": "string", + "description": "The ID of the newly created test order." + } + } + }, + "OrdersCustomBatchRequest": { + "id": "OrdersCustomBatchRequest", + "type": "object", + "properties": { + "entries": { + "type": "array", + "description": "The request entries to be processed in the batch.", + "items": { + "$ref": "OrdersCustomBatchRequestEntry" + } + } + } + }, + "OrdersCustomBatchRequestEntry": { + "id": "OrdersCustomBatchRequestEntry", + "type": "object", + "properties": { + "batchId": { + "type": "integer", + "description": "An entry ID, unique within the batch request.", + "format": "uint32" + }, + "cancel": { + "$ref": "OrdersCustomBatchRequestEntryCancel", + "description": "Required for cancel method." + }, + "cancelLineItem": { + "$ref": "OrdersCustomBatchRequestEntryCancelLineItem", + "description": "Required for cancelLineItem method." + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "format": "uint64" + }, + "merchantOrderId": { + "type": "string", + "description": "The merchant order id. Required for updateMerchantOrderId and getByMerchantOrderId methods." + }, + "method": { + "type": "string", + "description": "The method to apply." + }, + "operationId": { + "type": "string", + "description": "The ID of the operation. Unique across all operations for a given order. Required for all methods beside get and getByMerchantOrderId." + }, + "orderId": { + "type": "string", + "description": "The ID of the order. Required for all methods beside getByMerchantOrderId." + }, + "refund": { + "$ref": "OrdersCustomBatchRequestEntryRefund", + "description": "Required for refund method." + }, + "returnLineItem": { + "$ref": "OrdersCustomBatchRequestEntryReturnLineItem", + "description": "Required for returnLineItem method." + }, + "shipLineItems": { + "$ref": "OrdersCustomBatchRequestEntryShipLineItems", + "description": "Required for shipLineItems method." + }, + "updateShipment": { + "$ref": "OrdersCustomBatchRequestEntryUpdateShipment", + "description": "Required for updateShipment method." + } + } + }, + "OrdersCustomBatchRequestEntryCancel": { + "id": "OrdersCustomBatchRequestEntryCancel", + "type": "object", + "properties": { + "reason": { + "type": "string", + "description": "The reason for the cancellation." + }, + "reasonText": { + "type": "string", + "description": "The explanation of the reason." + } + } + }, + "OrdersCustomBatchRequestEntryCancelLineItem": { + "id": "OrdersCustomBatchRequestEntryCancelLineItem", + "type": "object", + "properties": { + "lineItemId": { + "type": "string", + "description": "The ID of the line item to cancel." + }, + "quantity": { + "type": "integer", + "description": "The quantity to cancel.", + "format": "uint32" + }, + "reason": { + "type": "string", + "description": "The reason for the cancellation." + }, + "reasonText": { + "type": "string", + "description": "The explanation of the reason." + } + } + }, + "OrdersCustomBatchRequestEntryRefund": { + "id": "OrdersCustomBatchRequestEntryRefund", + "type": "object", + "properties": { + "amount": { + "$ref": "Price", + "description": "The amount that is refunded." + }, + "reason": { + "type": "string", + "description": "The reason for the refund." + }, + "reasonText": { + "type": "string", + "description": "The explanation of the reason." + } + } + }, + "OrdersCustomBatchRequestEntryReturnLineItem": { + "id": "OrdersCustomBatchRequestEntryReturnLineItem", + "type": "object", + "properties": { + "lineItemId": { + "type": "string", + "description": "The ID of the line item to return." + }, + "quantity": { + "type": "integer", + "description": "The quantity to return.", + "format": "uint32" + }, + "reason": { + "type": "string", + "description": "The reason for the return." + }, + "reasonText": { + "type": "string", + "description": "The explanation of the reason." + } + } + }, + "OrdersCustomBatchRequestEntryShipLineItems": { + "id": "OrdersCustomBatchRequestEntryShipLineItems", + "type": "object", + "properties": { + "carrier": { + "type": "string", + "description": "The carrier handling the shipment." + }, + "lineItems": { + "type": "array", + "description": "Line items to ship.", + "items": { + "$ref": "OrderShipmentLineItemShipment" + } + }, + "shipmentId": { + "type": "string", + "description": "The ID of the shipment." + }, + "trackingId": { + "type": "string", + "description": "The tracking id for the shipment." + } + } + }, + "OrdersCustomBatchRequestEntryUpdateShipment": { + "id": "OrdersCustomBatchRequestEntryUpdateShipment", + "type": "object", + "properties": { + "carrier": { + "type": "string", + "description": "The carrier handling the shipment. Not updated if missing." + }, + "shipmentId": { + "type": "string", + "description": "The ID of the shipment." + }, + "status": { + "type": "string", + "description": "New status for the shipment. Not updated if missing." + }, + "trackingId": { + "type": "string", + "description": "The tracking id for the shipment. Not updated if missing." + } + } + }, + "OrdersCustomBatchResponse": { + "id": "OrdersCustomBatchResponse", + "type": "object", + "properties": { + "entries": { + "type": "array", + "description": "The result of the execution of the batch requests.", + "items": { + "$ref": "OrdersCustomBatchResponseEntry" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersCustomBatchResponse\".", + "default": "content#ordersCustomBatchResponse" + } + } + }, + "OrdersCustomBatchResponseEntry": { + "id": "OrdersCustomBatchResponseEntry", + "type": "object", + "properties": { + "batchId": { + "type": "integer", + "description": "The ID of the request entry this entry responds to.", + "format": "uint32" + }, + "errors": { + "$ref": "Errors", + "description": "A list of errors defined if and only if the request failed." + }, + "executionStatus": { + "type": "string", + "description": "The status of the execution. Only defined if the method is not get or getByMerchantOrderId and if the request was successful." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersCustomBatchResponseEntry\".", + "default": "content#ordersCustomBatchResponseEntry" + }, + "order": { + "$ref": "Order", + "description": "The retrieved order. Only defined if the method is get and if the request was successful." + } + } + }, + "OrdersGetByMerchantOrderIdResponse": { + "id": "OrdersGetByMerchantOrderIdResponse", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersGetByMerchantOrderIdResponse\".", + "default": "content#ordersGetByMerchantOrderIdResponse" + }, + "order": { + "$ref": "Order", + "description": "The requested order." + } + } + }, + "OrdersGetTestOrderTemplateResponse": { + "id": "OrdersGetTestOrderTemplateResponse", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersGetTestOrderTemplateResponse\".", + "default": "content#ordersGetTestOrderTemplateResponse" + }, + "template": { + "$ref": "TestOrder", + "description": "The requested test order template." + } + } + }, + "OrdersListResponse": { + "id": "OrdersListResponse", + "type": "object", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersListResponse\".", + "default": "content#ordersListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token for the retrieval of the next page of orders." + }, + "resources": { + "type": "array", + "items": { + "$ref": "Order" + } + } + } + }, + "OrdersRefundRequest": { + "id": "OrdersRefundRequest", + "type": "object", + "properties": { + "amount": { + "$ref": "Price", + "description": "The amount that is refunded." + }, + "operationId": { + "type": "string", + "description": "The ID of the operation. Unique across all operations for a given order." + }, + "reason": { + "type": "string", + "description": "The reason for the refund." + }, + "reasonText": { + "type": "string", + "description": "The explanation of the reason." + } + } + }, + "OrdersRefundResponse": { + "id": "OrdersRefundResponse", + "type": "object", + "properties": { + "executionStatus": { + "type": "string", + "description": "The status of the execution." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersRefundResponse\".", + "default": "content#ordersRefundResponse" + } + } + }, + "OrdersReturnLineItemRequest": { + "id": "OrdersReturnLineItemRequest", + "type": "object", + "properties": { + "lineItemId": { + "type": "string", + "description": "The ID of the line item to return." + }, + "operationId": { + "type": "string", + "description": "The ID of the operation. Unique across all operations for a given order." + }, + "quantity": { + "type": "integer", + "description": "The quantity to return.", + "format": "uint32" + }, + "reason": { + "type": "string", + "description": "The reason for the return." + }, + "reasonText": { + "type": "string", + "description": "The explanation of the reason." + } + } + }, + "OrdersReturnLineItemResponse": { + "id": "OrdersReturnLineItemResponse", + "type": "object", + "properties": { + "executionStatus": { + "type": "string", + "description": "The status of the execution." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersReturnLineItemResponse\".", + "default": "content#ordersReturnLineItemResponse" + } + } + }, + "OrdersShipLineItemsRequest": { + "id": "OrdersShipLineItemsRequest", + "type": "object", + "properties": { + "carrier": { + "type": "string", + "description": "The carrier handling the shipment." + }, + "lineItems": { + "type": "array", + "description": "Line items to ship.", + "items": { + "$ref": "OrderShipmentLineItemShipment" + } + }, + "operationId": { + "type": "string", + "description": "The ID of the operation. Unique across all operations for a given order." + }, + "shipmentId": { + "type": "string", + "description": "The ID of the shipment." + }, + "trackingId": { + "type": "string", + "description": "The tracking id for the shipment." + } + } + }, + "OrdersShipLineItemsResponse": { + "id": "OrdersShipLineItemsResponse", + "type": "object", + "properties": { + "executionStatus": { + "type": "string", + "description": "The status of the execution." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersShipLineItemsResponse\".", + "default": "content#ordersShipLineItemsResponse" + } + } + }, + "OrdersUpdateMerchantOrderIdRequest": { + "id": "OrdersUpdateMerchantOrderIdRequest", + "type": "object", + "properties": { + "merchantOrderId": { + "type": "string", + "description": "The merchant order id to be assigned to the order. Must be unique per merchant." + }, + "operationId": { + "type": "string", + "description": "The ID of the operation. Unique across all operations for a given order." + } + } + }, + "OrdersUpdateMerchantOrderIdResponse": { + "id": "OrdersUpdateMerchantOrderIdResponse", + "type": "object", + "properties": { + "executionStatus": { + "type": "string", + "description": "The status of the execution." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersUpdateMerchantOrderIdResponse\".", + "default": "content#ordersUpdateMerchantOrderIdResponse" + } + } + }, + "OrdersUpdateShipmentRequest": { + "id": "OrdersUpdateShipmentRequest", + "type": "object", + "properties": { + "carrier": { + "type": "string", + "description": "The carrier handling the shipment. Not updated if missing." + }, + "operationId": { + "type": "string", + "description": "The ID of the operation. Unique across all operations for a given order." + }, + "shipmentId": { + "type": "string", + "description": "The ID of the shipment." + }, + "status": { + "type": "string", + "description": "New status for the shipment. Not updated if missing." + }, + "trackingId": { + "type": "string", + "description": "The tracking id for the shipment. Not updated if missing." + } + } + }, + "OrdersUpdateShipmentResponse": { + "id": "OrdersUpdateShipmentResponse", + "type": "object", + "properties": { + "executionStatus": { + "type": "string", + "description": "The status of the execution." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#ordersUpdateShipmentResponse\".", + "default": "content#ordersUpdateShipmentResponse" + } + } + }, + "Price": { + "id": "Price", + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "The currency of the price." + }, + "value": { + "type": "string", + "description": "The price represented as a number." + } + } + }, + "TestOrder": { + "id": "TestOrder", + "type": "object", + "properties": { + "customer": { + "$ref": "TestOrderCustomer", + "description": "The details of the customer who placed the order.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"content#testOrder\".", + "default": "content#testOrder" + }, + "lineItems": { + "type": "array", + "description": "Line items that are ordered. At least one line item must be provided.", + "items": { + "$ref": "TestOrderLineItem" + }, + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "paymentMethod": { + "$ref": "TestOrderPaymentMethod", + "description": "The details of the payment method." + }, + "predefinedDeliveryAddress": { + "type": "string", + "description": "Identifier of one of the predefined delivery addresses for the delivery.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "shippingCost": { + "$ref": "Price", + "description": "The total cost of shipping for all items.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "shippingCostTax": { + "$ref": "Price", + "description": "The tax for the total shipping cost.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "shippingOption": { + "type": "string", + "description": "The requested shipping option.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + } + } + }, + "TestOrderCustomer": { + "id": "TestOrderCustomer", + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email address of the customer.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "explicitMarketingPreference": { + "type": "boolean", + "description": "If set, this indicates the user had a choice to opt in or out of providing marketing rights to the merchant. If unset, this indicates the user has already made this choice in a previous purchase, and was thus not shown the marketing right opt in/out checkbox during the Purchases on Google checkout flow. Optional." + }, + "fullName": { + "type": "string", + "description": "Full name of the customer." + } + } + }, + "TestOrderLineItem": { + "id": "TestOrderLineItem", + "type": "object", + "properties": { + "product": { + "$ref": "TestOrderLineItemProduct", + "description": "Product data from the time of the order placement." + }, + "quantityOrdered": { + "type": "integer", + "description": "Number of items ordered.", + "format": "uint32", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "returnInfo": { + "$ref": "OrderLineItemReturnInfo", + "description": "Details of the return policy for the line item.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "shippingDetails": { + "$ref": "OrderLineItemShippingDetails", + "description": "Details of the requested shipping for the line item.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "unitTax": { + "$ref": "Price", + "description": "Unit tax for the line item.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + } + } + }, + "TestOrderLineItemProduct": { + "id": "TestOrderLineItemProduct", + "type": "object", + "properties": { + "brand": { + "type": "string", + "description": "Brand of the item.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "channel": { + "type": "string", + "description": "The item's channel.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "condition": { + "type": "string", + "description": "Condition or state of the item.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "contentLanguage": { + "type": "string", + "description": "The two-letter ISO 639-1 language code for the item.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "gtin": { + "type": "string", + "description": "Global Trade Item Number (GTIN) of the item. Optional." + }, + "imageLink": { + "type": "string", + "description": "URL of an image of the item.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "itemGroupId": { + "type": "string", + "description": "Shared identifier for all variants of the same product. Optional." + }, + "mpn": { + "type": "string", + "description": "Manufacturer Part Number (MPN) of the item. Optional." + }, + "offerId": { + "type": "string", + "description": "An identifier of the item.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "price": { + "$ref": "Price", + "description": "The price for the product.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "targetCountry": { + "type": "string", + "description": "The CLDR territory code of the target country of the product.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "title": { + "type": "string", + "description": "The title of the product.", + "annotations": { + "required": [ + "content.orders.createtestorder" + ] + } + }, + "variantAttributes": { + "type": "array", + "description": "Variant attributes for the item. Optional.", + "items": { + "$ref": "OrderLineItemProductVariantAttribute" + } + } + } + }, + "TestOrderPaymentMethod": { + "id": "TestOrderPaymentMethod", + "type": "object", + "properties": { + "expirationMonth": { + "type": "integer", + "description": "The card expiration month (January = 1, February = 2 etc.).", + "format": "int32" + }, + "expirationYear": { + "type": "integer", + "description": "The card expiration year (4-digit, e.g. 2015).", + "format": "int32" + }, + "lastFourDigits": { + "type": "string", + "description": "The last four digits of the card number." + }, + "predefinedBillingAddress": { + "type": "string", + "description": "The billing address." + }, + "type": { + "type": "string", + "description": "The type of instrument. Note that real orders might have different values than the four values accepted by createTestOrder." + } + } + } + }, + "resources": { + "orders": { + "methods": { + "acknowledge": { + "id": "content.orders.acknowledge", + "path": "{merchantId}/orders/{orderId}/acknowledge", + "httpMethod": "POST", + "description": "Marks an order as acknowledged.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "orderId": { + "type": "string", + "description": "The ID of the order.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "orderId" + ], + "request": { + "$ref": "OrdersAcknowledgeRequest" + }, + "response": { + "$ref": "OrdersAcknowledgeResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "advancetestorder": { + "id": "content.orders.advancetestorder", + "path": "{merchantId}/testorders/{orderId}/advance", + "httpMethod": "POST", + "description": "Sandbox only. Moves a test order from state \"inProgress\" to state \"pendingShipment\".", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "orderId": { + "type": "string", + "description": "The ID of the test order to modify.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "orderId" + ], + "response": { + "$ref": "OrdersAdvanceTestOrderResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "cancel": { + "id": "content.orders.cancel", + "path": "{merchantId}/orders/{orderId}/cancel", + "httpMethod": "POST", + "description": "Cancels all line items in an order.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "orderId": { + "type": "string", + "description": "The ID of the order to cancel.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "orderId" + ], + "request": { + "$ref": "OrdersCancelRequest" + }, + "response": { + "$ref": "OrdersCancelResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "cancellineitem": { + "id": "content.orders.cancellineitem", + "path": "{merchantId}/orders/{orderId}/cancelLineItem", + "httpMethod": "POST", + "description": "Cancels a line item.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "orderId": { + "type": "string", + "description": "The ID of the order.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "orderId" + ], + "request": { + "$ref": "OrdersCancelLineItemRequest" + }, + "response": { + "$ref": "OrdersCancelLineItemResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "createtestorder": { + "id": "content.orders.createtestorder", + "path": "{merchantId}/testorders", + "httpMethod": "POST", + "description": "Sandbox only. Creates a test order.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + } + }, + "parameterOrder": [ + "merchantId" + ], + "request": { + "$ref": "OrdersCreateTestOrderRequest" + }, + "response": { + "$ref": "OrdersCreateTestOrderResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "custombatch": { + "id": "content.orders.custombatch", + "path": "orders/batch", + "httpMethod": "POST", + "description": "Retrieves or modifies multiple orders in a single request.", + "request": { + "$ref": "OrdersCustomBatchRequest" + }, + "response": { + "$ref": "OrdersCustomBatchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "get": { + "id": "content.orders.get", + "path": "{merchantId}/orders/{orderId}", + "httpMethod": "GET", + "description": "Retrieves an order from your Merchant Center account.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "orderId": { + "type": "string", + "description": "The ID of the order.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "orderId" + ], + "response": { + "$ref": "Order" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "getbymerchantorderid": { + "id": "content.orders.getbymerchantorderid", + "path": "{merchantId}/ordersbymerchantid/{merchantOrderId}", + "httpMethod": "GET", + "description": "Retrieves an order using merchant order id.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "merchantOrderId": { + "type": "string", + "description": "The merchant order id to be looked for.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "merchantOrderId" + ], + "response": { + "$ref": "OrdersGetByMerchantOrderIdResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "gettestordertemplate": { + "id": "content.orders.gettestordertemplate", + "path": "{merchantId}/testordertemplates/{templateName}", + "httpMethod": "GET", + "description": "Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "templateName": { + "type": "string", + "description": "The name of the template to retrieve.", + "required": true, + "enum": [ + "template1", + "template2" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "templateName" + ], + "response": { + "$ref": "OrdersGetTestOrderTemplateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "list": { + "id": "content.orders.list", + "path": "{merchantId}/orders", + "httpMethod": "GET", + "description": "Lists the orders in your Merchant Center account.", + "parameters": { + "acknowledged": { + "type": "boolean", + "description": "Obtains orders that match the acknowledgement status. When set to true, obtains orders that have been acknowledged. When false, obtains orders that have not been acknowledged.\nWe recommend using this filter set to false, in conjunction with the acknowledge call, such that only un-acknowledged orders are returned.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of orders to return in the response, used for paging. The default value is 25 orders per page, and the maximum allowed value is 250 orders per page.\nKnown issue: All List calls will return all Orders without limit regardless of the value of this field.", + "format": "uint32", + "location": "query" + }, + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "orderBy": { + "type": "string", + "description": "The ordering of the returned list. The only supported value are placedDate desc and placedDate asc for now, which returns orders sorted by placement date. \"placedDate desc\" stands for listing orders by placement date, from oldest to most recent. \"placedDate asc\" stands for listing orders by placement date, from most recent to oldest. In future releases we'll support other sorting criteria.", + "enum": [ + "placedDate asc", + "placedDate desc" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The token returned by the previous request.", + "location": "query" + }, + "placedDateEnd": { + "type": "string", + "description": "Obtains orders placed before this date (exclusively), in ISO 8601 format.", + "location": "query" + }, + "placedDateStart": { + "type": "string", + "description": "Obtains orders placed after this date (inclusively), in ISO 8601 format.", + "location": "query" + }, + "statuses": { + "type": "string", + "description": "Obtains orders that match any of the specified statuses. Multiple values can be specified with comma separation. Additionally, please note that active is a shortcut for pendingShipment and partiallyShipped, and completed is a shortcut for shipped , partiallyDelivered, delivered, partiallyReturned, returned, and canceled.", + "enum": [ + "active", + "canceled", + "completed", + "delivered", + "inProgress", + "partiallyDelivered", + "partiallyReturned", + "partiallyShipped", + "pendingShipment", + "returned", + "shipped" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "merchantId" + ], + "response": { + "$ref": "OrdersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "refund": { + "id": "content.orders.refund", + "path": "{merchantId}/orders/{orderId}/refund", + "httpMethod": "POST", + "description": "Refund a portion of the order, up to the full amount paid.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "orderId": { + "type": "string", + "description": "The ID of the order to refund.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "orderId" + ], + "request": { + "$ref": "OrdersRefundRequest" + }, + "response": { + "$ref": "OrdersRefundResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "returnlineitem": { + "id": "content.orders.returnlineitem", + "path": "{merchantId}/orders/{orderId}/returnLineItem", + "httpMethod": "POST", + "description": "Returns a line item.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "orderId": { + "type": "string", + "description": "The ID of the order.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "orderId" + ], + "request": { + "$ref": "OrdersReturnLineItemRequest" + }, + "response": { + "$ref": "OrdersReturnLineItemResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "shiplineitems": { + "id": "content.orders.shiplineitems", + "path": "{merchantId}/orders/{orderId}/shipLineItems", + "httpMethod": "POST", + "description": "Marks line item(s) as shipped.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "orderId": { + "type": "string", + "description": "The ID of the order.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "orderId" + ], + "request": { + "$ref": "OrdersShipLineItemsRequest" + }, + "response": { + "$ref": "OrdersShipLineItemsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "updatemerchantorderid": { + "id": "content.orders.updatemerchantorderid", + "path": "{merchantId}/orders/{orderId}/updateMerchantOrderId", + "httpMethod": "POST", + "description": "Updates the merchant order ID for a given order.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "orderId": { + "type": "string", + "description": "The ID of the order.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "orderId" + ], + "request": { + "$ref": "OrdersUpdateMerchantOrderIdRequest" + }, + "response": { + "$ref": "OrdersUpdateMerchantOrderIdResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + }, + "updateshipment": { + "id": "content.orders.updateshipment", + "path": "{merchantId}/orders/{orderId}/updateShipment", + "httpMethod": "POST", + "description": "Updates a shipment's status, carrier, and/or tracking ID.", + "parameters": { + "merchantId": { + "type": "string", + "description": "The ID of the managing account.", + "required": true, + "format": "uint64", + "location": "path" + }, + "orderId": { + "type": "string", + "description": "The ID of the order.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "merchantId", + "orderId" + ], + "request": { + "$ref": "OrdersUpdateShipmentRequest" + }, + "response": { + "$ref": "OrdersUpdateShipmentResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/content" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/content/v2sandbox/content-gen.go b/Godeps/_workspace/src/google.golang.org/api/content/v2sandbox/content-gen.go new file mode 100644 index 000000000..82fda329b --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/content/v2sandbox/content-gen.go @@ -0,0 +1,4013 @@ +// Package content provides access to the Content API for Shopping. +// +// See https://developers.google.com/shopping-content +// +// Usage example: +// +// import "google.golang.org/api/content/v2sandbox" +// ... +// contentService, err := content.New(oauthHttpClient) +package content // import "google.golang.org/api/content/v2sandbox" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "content:v2sandbox" +const apiName = "content" +const apiVersion = "v2sandbox" +const basePath = "https://www.googleapis.com/content/v2sandbox/" + +// OAuth2 scopes used by this API. +const ( + // Manage your product listings and accounts for Google Shopping + ContentScope = "https://www.googleapis.com/auth/content" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Orders = NewOrdersService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Orders *OrdersService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewOrdersService(s *Service) *OrdersService { + rs := &OrdersService{s: s} + return rs +} + +type OrdersService struct { + s *Service +} + +// Error: An error returned by the API. +type Error struct { + // Domain: The domain of the error. + Domain string `json:"domain,omitempty"` + + // Message: A description of the error. + Message string `json:"message,omitempty"` + + // Reason: The error code. + Reason string `json:"reason,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Domain") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Error) MarshalJSON() ([]byte, error) { + type noMethod Error + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Errors: A list of errors returned by a failed batch entry. +type Errors struct { + // Code: The HTTP status of the first error in errors. + Code int64 `json:"code,omitempty"` + + // Errors: A list of errors. + Errors []*Error `json:"errors,omitempty"` + + // Message: The message of the first error in errors. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Errors) MarshalJSON() ([]byte, error) { + type noMethod Errors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Order struct { + // Acknowledged: Whether the order was acknowledged. + Acknowledged bool `json:"acknowledged,omitempty"` + + // Customer: The details of the customer who placed the order. + Customer *OrderCustomer `json:"customer,omitempty"` + + // DeliveryDetails: The details for the delivery. + DeliveryDetails *OrderDeliveryDetails `json:"deliveryDetails,omitempty"` + + // Id: The REST id of the order. Globally unique. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#order". + Kind string `json:"kind,omitempty"` + + // LineItems: Line items that are ordered. + LineItems []*OrderLineItem `json:"lineItems,omitempty"` + + MerchantId uint64 `json:"merchantId,omitempty,string"` + + // MerchantOrderId: Merchant-provided id of the order. + MerchantOrderId string `json:"merchantOrderId,omitempty"` + + // NetAmount: The net amount for the order. For example, if an order was + // originally for a grand total of $100 and a refund was issued for $20, + // the net amount will be $80. + NetAmount *Price `json:"netAmount,omitempty"` + + // PaymentMethod: The details of the payment method. + PaymentMethod *OrderPaymentMethod `json:"paymentMethod,omitempty"` + + // PaymentStatus: The status of the payment. + PaymentStatus string `json:"paymentStatus,omitempty"` + + // PlacedDate: The date when the order was placed, in ISO 8601 format. + PlacedDate string `json:"placedDate,omitempty"` + + // Refunds: Refunds for the order. + Refunds []*OrderRefund `json:"refunds,omitempty"` + + // Shipments: Shipments of the order. + Shipments []*OrderShipment `json:"shipments,omitempty"` + + // ShippingCost: The total cost of shipping for all items. + ShippingCost *Price `json:"shippingCost,omitempty"` + + // ShippingCostTax: The tax for the total shipping cost. + ShippingCostTax *Price `json:"shippingCostTax,omitempty"` + + // ShippingOption: The requested shipping option. + ShippingOption string `json:"shippingOption,omitempty"` + + // Status: The status of the order. + Status string `json:"status,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Acknowledged") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Order) MarshalJSON() ([]byte, error) { + type noMethod Order + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderAddress struct { + // Country: CLDR country code (e.g. "US"). + Country string `json:"country,omitempty"` + + // FullAddress: Strings representing the lines of the printed label for + // mailing the order, for example: + // John Smith + // 1600 Amphitheatre Parkway + // Mountain View, CA, 94043 + // United States + FullAddress []string `json:"fullAddress,omitempty"` + + // IsPostOfficeBox: Whether the address is a post office box. + IsPostOfficeBox bool `json:"isPostOfficeBox,omitempty"` + + // Locality: City, town or commune. May also include dependent + // localities or sublocalities (e.g. neighborhoods or suburbs). + Locality string `json:"locality,omitempty"` + + // PostalCode: Postal Code or ZIP (e.g. "94043"). + PostalCode string `json:"postalCode,omitempty"` + + // RecipientName: Name of the recipient. + RecipientName string `json:"recipientName,omitempty"` + + // Region: Top-level administrative subdivision of the country (e.g. + // "CA"). + Region string `json:"region,omitempty"` + + // StreetAddress: Street-level part of the address. + StreetAddress []string `json:"streetAddress,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Country") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderAddress) MarshalJSON() ([]byte, error) { + type noMethod OrderAddress + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderCancellation struct { + // Actor: The actor that created the cancellation. + Actor string `json:"actor,omitempty"` + + // CreationDate: Date on which the cancellation has been created, in ISO + // 8601 format. + CreationDate string `json:"creationDate,omitempty"` + + // Quantity: The quantity that was canceled. + Quantity int64 `json:"quantity,omitempty"` + + // Reason: The reason for the cancellation. + Reason string `json:"reason,omitempty"` + + // ReasonText: The explanation of the reason. + ReasonText string `json:"reasonText,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Actor") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderCancellation) MarshalJSON() ([]byte, error) { + type noMethod OrderCancellation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderCustomer struct { + // Email: Email address of the customer. + Email string `json:"email,omitempty"` + + // ExplicitMarketingPreference: If set, this indicates the user had a + // choice to opt in or out of providing marketing rights to the + // merchant. If unset, this indicates the user has already made this + // choice in a previous purchase, and was thus not shown the marketing + // right opt in/out checkbox during the Purchases on Google checkout + // flow. + ExplicitMarketingPreference bool `json:"explicitMarketingPreference,omitempty"` + + // FullName: Full name of the customer. + FullName string `json:"fullName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Email") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderCustomer) MarshalJSON() ([]byte, error) { + type noMethod OrderCustomer + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderDeliveryDetails struct { + // Address: The delivery address + Address *OrderAddress `json:"address,omitempty"` + + // PhoneNumber: The phone number of the person receiving the delivery. + PhoneNumber string `json:"phoneNumber,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Address") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderDeliveryDetails) MarshalJSON() ([]byte, error) { + type noMethod OrderDeliveryDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderLineItem struct { + // Cancellations: Cancellations of the line item. + Cancellations []*OrderCancellation `json:"cancellations,omitempty"` + + // Id: The id of the line item. + Id string `json:"id,omitempty"` + + // Price: Total price for the line item. For example, if two items for + // $10 are purchased, the total price will be $20. + Price *Price `json:"price,omitempty"` + + // Product: Product data from the time of the order placement. + Product *OrderLineItemProduct `json:"product,omitempty"` + + // QuantityCanceled: Number of items canceled. + QuantityCanceled int64 `json:"quantityCanceled,omitempty"` + + // QuantityDelivered: Number of items delivered. + QuantityDelivered int64 `json:"quantityDelivered,omitempty"` + + // QuantityOrdered: Number of items ordered. + QuantityOrdered int64 `json:"quantityOrdered,omitempty"` + + // QuantityPending: Number of items pending. + QuantityPending int64 `json:"quantityPending,omitempty"` + + // QuantityReturned: Number of items returned. + QuantityReturned int64 `json:"quantityReturned,omitempty"` + + // QuantityShipped: Number of items shipped. + QuantityShipped int64 `json:"quantityShipped,omitempty"` + + // ReturnInfo: Details of the return policy for the line item. + ReturnInfo *OrderLineItemReturnInfo `json:"returnInfo,omitempty"` + + // Returns: Returns of the line item. + Returns []*OrderReturn `json:"returns,omitempty"` + + // ShippingDetails: Details of the requested shipping for the line item. + ShippingDetails *OrderLineItemShippingDetails `json:"shippingDetails,omitempty"` + + // Tax: Total tax amount for the line item. For example, if two items + // are purchased, and each have a cost tax of $2, the total tax amount + // will be $4. + Tax *Price `json:"tax,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Cancellations") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderLineItem) MarshalJSON() ([]byte, error) { + type noMethod OrderLineItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderLineItemProduct struct { + // Brand: Brand of the item. + Brand string `json:"brand,omitempty"` + + // Channel: The item's channel (online or local). + Channel string `json:"channel,omitempty"` + + // Condition: Condition or state of the item. + Condition string `json:"condition,omitempty"` + + // ContentLanguage: The two-letter ISO 639-1 language code for the item. + ContentLanguage string `json:"contentLanguage,omitempty"` + + // Gtin: Global Trade Item Number (GTIN) of the item. + Gtin string `json:"gtin,omitempty"` + + // Id: The REST id of the product. + Id string `json:"id,omitempty"` + + // ImageLink: URL of an image of the item. + ImageLink string `json:"imageLink,omitempty"` + + // ItemGroupId: Shared identifier for all variants of the same product. + ItemGroupId string `json:"itemGroupId,omitempty"` + + // Mpn: Manufacturer Part Number (MPN) of the item. + Mpn string `json:"mpn,omitempty"` + + // OfferId: An identifier of the item. + OfferId string `json:"offerId,omitempty"` + + // Price: Price of the item. + Price *Price `json:"price,omitempty"` + + // ShownImage: URL to the cached image shown to the user when order was + // placed. + ShownImage string `json:"shownImage,omitempty"` + + // TargetCountry: The CLDR territory code of the target country of the + // product. + TargetCountry string `json:"targetCountry,omitempty"` + + // Title: The title of the product. + Title string `json:"title,omitempty"` + + // VariantAttributes: Variant attributes for the item. These are + // dimensions of the product, such as color, gender, material, pattern, + // and size. You can find a comprehensive list of variant attributes + // here. + VariantAttributes []*OrderLineItemProductVariantAttribute `json:"variantAttributes,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Brand") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderLineItemProduct) MarshalJSON() ([]byte, error) { + type noMethod OrderLineItemProduct + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderLineItemProductVariantAttribute struct { + // Dimension: The dimension of the variant. + Dimension string `json:"dimension,omitempty"` + + // Value: The value for the dimension. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Dimension") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderLineItemProductVariantAttribute) MarshalJSON() ([]byte, error) { + type noMethod OrderLineItemProductVariantAttribute + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderLineItemReturnInfo struct { + // DaysToReturn: How many days later the item can be returned. + DaysToReturn int64 `json:"daysToReturn,omitempty"` + + // IsReturnable: Whether the item is returnable. + IsReturnable bool `json:"isReturnable,omitempty"` + + // PolicyUrl: URL of the item return policy. + PolicyUrl string `json:"policyUrl,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DaysToReturn") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderLineItemReturnInfo) MarshalJSON() ([]byte, error) { + type noMethod OrderLineItemReturnInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderLineItemShippingDetails struct { + // DeliverByDate: The delivery by date, in ISO 8601 format. + DeliverByDate string `json:"deliverByDate,omitempty"` + + // Method: Details of the shipping method. + Method *OrderLineItemShippingDetailsMethod `json:"method,omitempty"` + + // ShipByDate: The ship by date, in ISO 8601 format. + ShipByDate string `json:"shipByDate,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DeliverByDate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderLineItemShippingDetails) MarshalJSON() ([]byte, error) { + type noMethod OrderLineItemShippingDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderLineItemShippingDetailsMethod struct { + // Carrier: The carrier for the shipping. Optional. + Carrier string `json:"carrier,omitempty"` + + // MaxDaysInTransit: Maximum transit time. + MaxDaysInTransit int64 `json:"maxDaysInTransit,omitempty"` + + // MethodName: The name of the shipping method. + MethodName string `json:"methodName,omitempty"` + + // MinDaysInTransit: Minimum transit time. + MinDaysInTransit int64 `json:"minDaysInTransit,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Carrier") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderLineItemShippingDetailsMethod) MarshalJSON() ([]byte, error) { + type noMethod OrderLineItemShippingDetailsMethod + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderPaymentMethod struct { + // BillingAddress: The billing address. + BillingAddress *OrderAddress `json:"billingAddress,omitempty"` + + // ExpirationMonth: The card expiration month (January = 1, February = 2 + // etc.). + ExpirationMonth int64 `json:"expirationMonth,omitempty"` + + // ExpirationYear: The card expiration year (4-digit, e.g. 2015). + ExpirationYear int64 `json:"expirationYear,omitempty"` + + // LastFourDigits: The last four digits of the card number. + LastFourDigits string `json:"lastFourDigits,omitempty"` + + // PhoneNumber: The billing phone number. + PhoneNumber string `json:"phoneNumber,omitempty"` + + // Type: The type of instrument (VISA, Mastercard, etc). + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BillingAddress") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderPaymentMethod) MarshalJSON() ([]byte, error) { + type noMethod OrderPaymentMethod + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderRefund struct { + // Actor: The actor that created the refund. + Actor string `json:"actor,omitempty"` + + // Amount: The amount that is refunded. + Amount *Price `json:"amount,omitempty"` + + // CreationDate: Date on which the item has been created, in ISO 8601 + // format. + CreationDate string `json:"creationDate,omitempty"` + + // Reason: The reason for the refund. + Reason string `json:"reason,omitempty"` + + // ReasonText: The explanation of the reason. + ReasonText string `json:"reasonText,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Actor") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderRefund) MarshalJSON() ([]byte, error) { + type noMethod OrderRefund + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderReturn struct { + // Actor: The actor that created the refund. + Actor string `json:"actor,omitempty"` + + // CreationDate: Date on which the item has been created, in ISO 8601 + // format. + CreationDate string `json:"creationDate,omitempty"` + + // Quantity: Quantity that is returned. + Quantity int64 `json:"quantity,omitempty"` + + // Reason: The reason for the return. + Reason string `json:"reason,omitempty"` + + // ReasonText: The explanation of the reason. + ReasonText string `json:"reasonText,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Actor") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderReturn) MarshalJSON() ([]byte, error) { + type noMethod OrderReturn + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderShipment struct { + // Carrier: The carrier handling the shipment. + Carrier string `json:"carrier,omitempty"` + + // CreationDate: Date on which the shipment has been created, in ISO + // 8601 format. + CreationDate string `json:"creationDate,omitempty"` + + // DeliveryDate: Date on which the shipment has been delivered, in ISO + // 8601 format. Present only if status is delievered + DeliveryDate string `json:"deliveryDate,omitempty"` + + // Id: The id of the shipment. + Id string `json:"id,omitempty"` + + // LineItems: The line items that are shipped. + LineItems []*OrderShipmentLineItemShipment `json:"lineItems,omitempty"` + + // Status: The status of the shipment. + Status string `json:"status,omitempty"` + + // TrackingId: The tracking id for the shipment. + TrackingId string `json:"trackingId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Carrier") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderShipment) MarshalJSON() ([]byte, error) { + type noMethod OrderShipment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrderShipmentLineItemShipment struct { + // LineItemId: The id of the line item that is shipped. + LineItemId string `json:"lineItemId,omitempty"` + + // Quantity: The quantity that is shipped. + Quantity int64 `json:"quantity,omitempty"` + + // ForceSendFields is a list of field names (e.g. "LineItemId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderShipmentLineItemShipment) MarshalJSON() ([]byte, error) { + type noMethod OrderShipmentLineItemShipment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersAcknowledgeRequest struct { + // OperationId: The ID of the operation. Unique across all operations + // for a given order. + OperationId string `json:"operationId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "OperationId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersAcknowledgeRequest) MarshalJSON() ([]byte, error) { + type noMethod OrdersAcknowledgeRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersAcknowledgeResponse struct { + // ExecutionStatus: The status of the execution. + ExecutionStatus string `json:"executionStatus,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersAcknowledgeResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersAcknowledgeResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersAcknowledgeResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersAdvanceTestOrderResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersAdvanceTestOrderResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersAdvanceTestOrderResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersAdvanceTestOrderResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCancelLineItemRequest struct { + // LineItemId: The ID of the line item to cancel. + LineItemId string `json:"lineItemId,omitempty"` + + // OperationId: The ID of the operation. Unique across all operations + // for a given order. + OperationId string `json:"operationId,omitempty"` + + // Quantity: The quantity to cancel. + Quantity int64 `json:"quantity,omitempty"` + + // Reason: The reason for the cancellation. + Reason string `json:"reason,omitempty"` + + // ReasonText: The explanation of the reason. + ReasonText string `json:"reasonText,omitempty"` + + // ForceSendFields is a list of field names (e.g. "LineItemId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCancelLineItemRequest) MarshalJSON() ([]byte, error) { + type noMethod OrdersCancelLineItemRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCancelLineItemResponse struct { + // ExecutionStatus: The status of the execution. + ExecutionStatus string `json:"executionStatus,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersCancelLineItemResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCancelLineItemResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersCancelLineItemResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCancelRequest struct { + // OperationId: The ID of the operation. Unique across all operations + // for a given order. + OperationId string `json:"operationId,omitempty"` + + // Reason: The reason for the cancellation. + Reason string `json:"reason,omitempty"` + + // ReasonText: The explanation of the reason. + ReasonText string `json:"reasonText,omitempty"` + + // ForceSendFields is a list of field names (e.g. "OperationId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCancelRequest) MarshalJSON() ([]byte, error) { + type noMethod OrdersCancelRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCancelResponse struct { + // ExecutionStatus: The status of the execution. + ExecutionStatus string `json:"executionStatus,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersCancelResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCancelResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersCancelResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCreateTestOrderRequest struct { + // TemplateName: The test order template to use. Specify as an + // alternative to testOrder as a shortcut for retrieving a template and + // then creating an order using that template. + TemplateName string `json:"templateName,omitempty"` + + // TestOrder: The test order to create. + TestOrder *TestOrder `json:"testOrder,omitempty"` + + // ForceSendFields is a list of field names (e.g. "TemplateName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCreateTestOrderRequest) MarshalJSON() ([]byte, error) { + type noMethod OrdersCreateTestOrderRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCreateTestOrderResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersCreateTestOrderResponse". + Kind string `json:"kind,omitempty"` + + // OrderId: The ID of the newly created test order. + OrderId string `json:"orderId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCreateTestOrderResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersCreateTestOrderResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCustomBatchRequest struct { + // Entries: The request entries to be processed in the batch. + Entries []*OrdersCustomBatchRequestEntry `json:"entries,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Entries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCustomBatchRequest) MarshalJSON() ([]byte, error) { + type noMethod OrdersCustomBatchRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCustomBatchRequestEntry struct { + // BatchId: An entry ID, unique within the batch request. + BatchId int64 `json:"batchId,omitempty"` + + // Cancel: Required for cancel method. + Cancel *OrdersCustomBatchRequestEntryCancel `json:"cancel,omitempty"` + + // CancelLineItem: Required for cancelLineItem method. + CancelLineItem *OrdersCustomBatchRequestEntryCancelLineItem `json:"cancelLineItem,omitempty"` + + // MerchantId: The ID of the managing account. + MerchantId uint64 `json:"merchantId,omitempty,string"` + + // MerchantOrderId: The merchant order id. Required for + // updateMerchantOrderId and getByMerchantOrderId methods. + MerchantOrderId string `json:"merchantOrderId,omitempty"` + + // Method: The method to apply. + Method string `json:"method,omitempty"` + + // OperationId: The ID of the operation. Unique across all operations + // for a given order. Required for all methods beside get and + // getByMerchantOrderId. + OperationId string `json:"operationId,omitempty"` + + // OrderId: The ID of the order. Required for all methods beside + // getByMerchantOrderId. + OrderId string `json:"orderId,omitempty"` + + // Refund: Required for refund method. + Refund *OrdersCustomBatchRequestEntryRefund `json:"refund,omitempty"` + + // ReturnLineItem: Required for returnLineItem method. + ReturnLineItem *OrdersCustomBatchRequestEntryReturnLineItem `json:"returnLineItem,omitempty"` + + // ShipLineItems: Required for shipLineItems method. + ShipLineItems *OrdersCustomBatchRequestEntryShipLineItems `json:"shipLineItems,omitempty"` + + // UpdateShipment: Required for updateShipment method. + UpdateShipment *OrdersCustomBatchRequestEntryUpdateShipment `json:"updateShipment,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BatchId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCustomBatchRequestEntry) MarshalJSON() ([]byte, error) { + type noMethod OrdersCustomBatchRequestEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCustomBatchRequestEntryCancel struct { + // Reason: The reason for the cancellation. + Reason string `json:"reason,omitempty"` + + // ReasonText: The explanation of the reason. + ReasonText string `json:"reasonText,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Reason") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCustomBatchRequestEntryCancel) MarshalJSON() ([]byte, error) { + type noMethod OrdersCustomBatchRequestEntryCancel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCustomBatchRequestEntryCancelLineItem struct { + // LineItemId: The ID of the line item to cancel. + LineItemId string `json:"lineItemId,omitempty"` + + // Quantity: The quantity to cancel. + Quantity int64 `json:"quantity,omitempty"` + + // Reason: The reason for the cancellation. + Reason string `json:"reason,omitempty"` + + // ReasonText: The explanation of the reason. + ReasonText string `json:"reasonText,omitempty"` + + // ForceSendFields is a list of field names (e.g. "LineItemId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCustomBatchRequestEntryCancelLineItem) MarshalJSON() ([]byte, error) { + type noMethod OrdersCustomBatchRequestEntryCancelLineItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCustomBatchRequestEntryRefund struct { + // Amount: The amount that is refunded. + Amount *Price `json:"amount,omitempty"` + + // Reason: The reason for the refund. + Reason string `json:"reason,omitempty"` + + // ReasonText: The explanation of the reason. + ReasonText string `json:"reasonText,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Amount") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCustomBatchRequestEntryRefund) MarshalJSON() ([]byte, error) { + type noMethod OrdersCustomBatchRequestEntryRefund + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCustomBatchRequestEntryReturnLineItem struct { + // LineItemId: The ID of the line item to return. + LineItemId string `json:"lineItemId,omitempty"` + + // Quantity: The quantity to return. + Quantity int64 `json:"quantity,omitempty"` + + // Reason: The reason for the return. + Reason string `json:"reason,omitempty"` + + // ReasonText: The explanation of the reason. + ReasonText string `json:"reasonText,omitempty"` + + // ForceSendFields is a list of field names (e.g. "LineItemId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCustomBatchRequestEntryReturnLineItem) MarshalJSON() ([]byte, error) { + type noMethod OrdersCustomBatchRequestEntryReturnLineItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCustomBatchRequestEntryShipLineItems struct { + // Carrier: The carrier handling the shipment. + Carrier string `json:"carrier,omitempty"` + + // LineItems: Line items to ship. + LineItems []*OrderShipmentLineItemShipment `json:"lineItems,omitempty"` + + // ShipmentId: The ID of the shipment. + ShipmentId string `json:"shipmentId,omitempty"` + + // TrackingId: The tracking id for the shipment. + TrackingId string `json:"trackingId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Carrier") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCustomBatchRequestEntryShipLineItems) MarshalJSON() ([]byte, error) { + type noMethod OrdersCustomBatchRequestEntryShipLineItems + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCustomBatchRequestEntryUpdateShipment struct { + // Carrier: The carrier handling the shipment. Not updated if missing. + Carrier string `json:"carrier,omitempty"` + + // ShipmentId: The ID of the shipment. + ShipmentId string `json:"shipmentId,omitempty"` + + // Status: New status for the shipment. Not updated if missing. + Status string `json:"status,omitempty"` + + // TrackingId: The tracking id for the shipment. Not updated if missing. + TrackingId string `json:"trackingId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Carrier") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCustomBatchRequestEntryUpdateShipment) MarshalJSON() ([]byte, error) { + type noMethod OrdersCustomBatchRequestEntryUpdateShipment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCustomBatchResponse struct { + // Entries: The result of the execution of the batch requests. + Entries []*OrdersCustomBatchResponseEntry `json:"entries,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersCustomBatchResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Entries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCustomBatchResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersCustomBatchResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersCustomBatchResponseEntry struct { + // BatchId: The ID of the request entry this entry responds to. + BatchId int64 `json:"batchId,omitempty"` + + // Errors: A list of errors defined if and only if the request failed. + Errors *Errors `json:"errors,omitempty"` + + // ExecutionStatus: The status of the execution. Only defined if the + // method is not get or getByMerchantOrderId and if the request was + // successful. + ExecutionStatus string `json:"executionStatus,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersCustomBatchResponseEntry". + Kind string `json:"kind,omitempty"` + + // Order: The retrieved order. Only defined if the method is get and if + // the request was successful. + Order *Order `json:"order,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BatchId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersCustomBatchResponseEntry) MarshalJSON() ([]byte, error) { + type noMethod OrdersCustomBatchResponseEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersGetByMerchantOrderIdResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersGetByMerchantOrderIdResponse". + Kind string `json:"kind,omitempty"` + + // Order: The requested order. + Order *Order `json:"order,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersGetByMerchantOrderIdResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersGetByMerchantOrderIdResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersGetTestOrderTemplateResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersGetTestOrderTemplateResponse". + Kind string `json:"kind,omitempty"` + + // Template: The requested test order template. + Template *TestOrder `json:"template,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersGetTestOrderTemplateResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersGetTestOrderTemplateResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token for the retrieval of the next page of + // orders. + NextPageToken string `json:"nextPageToken,omitempty"` + + Resources []*Order `json:"resources,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersListResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersRefundRequest struct { + // Amount: The amount that is refunded. + Amount *Price `json:"amount,omitempty"` + + // OperationId: The ID of the operation. Unique across all operations + // for a given order. + OperationId string `json:"operationId,omitempty"` + + // Reason: The reason for the refund. + Reason string `json:"reason,omitempty"` + + // ReasonText: The explanation of the reason. + ReasonText string `json:"reasonText,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Amount") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersRefundRequest) MarshalJSON() ([]byte, error) { + type noMethod OrdersRefundRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersRefundResponse struct { + // ExecutionStatus: The status of the execution. + ExecutionStatus string `json:"executionStatus,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersRefundResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersRefundResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersRefundResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersReturnLineItemRequest struct { + // LineItemId: The ID of the line item to return. + LineItemId string `json:"lineItemId,omitempty"` + + // OperationId: The ID of the operation. Unique across all operations + // for a given order. + OperationId string `json:"operationId,omitempty"` + + // Quantity: The quantity to return. + Quantity int64 `json:"quantity,omitempty"` + + // Reason: The reason for the return. + Reason string `json:"reason,omitempty"` + + // ReasonText: The explanation of the reason. + ReasonText string `json:"reasonText,omitempty"` + + // ForceSendFields is a list of field names (e.g. "LineItemId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersReturnLineItemRequest) MarshalJSON() ([]byte, error) { + type noMethod OrdersReturnLineItemRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersReturnLineItemResponse struct { + // ExecutionStatus: The status of the execution. + ExecutionStatus string `json:"executionStatus,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersReturnLineItemResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersReturnLineItemResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersReturnLineItemResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersShipLineItemsRequest struct { + // Carrier: The carrier handling the shipment. + Carrier string `json:"carrier,omitempty"` + + // LineItems: Line items to ship. + LineItems []*OrderShipmentLineItemShipment `json:"lineItems,omitempty"` + + // OperationId: The ID of the operation. Unique across all operations + // for a given order. + OperationId string `json:"operationId,omitempty"` + + // ShipmentId: The ID of the shipment. + ShipmentId string `json:"shipmentId,omitempty"` + + // TrackingId: The tracking id for the shipment. + TrackingId string `json:"trackingId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Carrier") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersShipLineItemsRequest) MarshalJSON() ([]byte, error) { + type noMethod OrdersShipLineItemsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersShipLineItemsResponse struct { + // ExecutionStatus: The status of the execution. + ExecutionStatus string `json:"executionStatus,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersShipLineItemsResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersShipLineItemsResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersShipLineItemsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersUpdateMerchantOrderIdRequest struct { + // MerchantOrderId: The merchant order id to be assigned to the order. + // Must be unique per merchant. + MerchantOrderId string `json:"merchantOrderId,omitempty"` + + // OperationId: The ID of the operation. Unique across all operations + // for a given order. + OperationId string `json:"operationId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MerchantOrderId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersUpdateMerchantOrderIdRequest) MarshalJSON() ([]byte, error) { + type noMethod OrdersUpdateMerchantOrderIdRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersUpdateMerchantOrderIdResponse struct { + // ExecutionStatus: The status of the execution. + ExecutionStatus string `json:"executionStatus,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersUpdateMerchantOrderIdResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersUpdateMerchantOrderIdResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersUpdateMerchantOrderIdResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersUpdateShipmentRequest struct { + // Carrier: The carrier handling the shipment. Not updated if missing. + Carrier string `json:"carrier,omitempty"` + + // OperationId: The ID of the operation. Unique across all operations + // for a given order. + OperationId string `json:"operationId,omitempty"` + + // ShipmentId: The ID of the shipment. + ShipmentId string `json:"shipmentId,omitempty"` + + // Status: New status for the shipment. Not updated if missing. + Status string `json:"status,omitempty"` + + // TrackingId: The tracking id for the shipment. Not updated if missing. + TrackingId string `json:"trackingId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Carrier") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersUpdateShipmentRequest) MarshalJSON() ([]byte, error) { + type noMethod OrdersUpdateShipmentRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OrdersUpdateShipmentResponse struct { + // ExecutionStatus: The status of the execution. + ExecutionStatus string `json:"executionStatus,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#ordersUpdateShipmentResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersUpdateShipmentResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersUpdateShipmentResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Price struct { + // Currency: The currency of the price. + Currency string `json:"currency,omitempty"` + + // Value: The price represented as a number. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Currency") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Price) MarshalJSON() ([]byte, error) { + type noMethod Price + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TestOrder struct { + // Customer: The details of the customer who placed the order. + Customer *TestOrderCustomer `json:"customer,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "content#testOrder". + Kind string `json:"kind,omitempty"` + + // LineItems: Line items that are ordered. At least one line item must + // be provided. + LineItems []*TestOrderLineItem `json:"lineItems,omitempty"` + + // PaymentMethod: The details of the payment method. + PaymentMethod *TestOrderPaymentMethod `json:"paymentMethod,omitempty"` + + // PredefinedDeliveryAddress: Identifier of one of the predefined + // delivery addresses for the delivery. + PredefinedDeliveryAddress string `json:"predefinedDeliveryAddress,omitempty"` + + // ShippingCost: The total cost of shipping for all items. + ShippingCost *Price `json:"shippingCost,omitempty"` + + // ShippingCostTax: The tax for the total shipping cost. + ShippingCostTax *Price `json:"shippingCostTax,omitempty"` + + // ShippingOption: The requested shipping option. + ShippingOption string `json:"shippingOption,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Customer") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TestOrder) MarshalJSON() ([]byte, error) { + type noMethod TestOrder + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TestOrderCustomer struct { + // Email: Email address of the customer. + Email string `json:"email,omitempty"` + + // ExplicitMarketingPreference: If set, this indicates the user had a + // choice to opt in or out of providing marketing rights to the + // merchant. If unset, this indicates the user has already made this + // choice in a previous purchase, and was thus not shown the marketing + // right opt in/out checkbox during the Purchases on Google checkout + // flow. Optional. + ExplicitMarketingPreference bool `json:"explicitMarketingPreference,omitempty"` + + // FullName: Full name of the customer. + FullName string `json:"fullName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Email") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TestOrderCustomer) MarshalJSON() ([]byte, error) { + type noMethod TestOrderCustomer + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TestOrderLineItem struct { + // Product: Product data from the time of the order placement. + Product *TestOrderLineItemProduct `json:"product,omitempty"` + + // QuantityOrdered: Number of items ordered. + QuantityOrdered int64 `json:"quantityOrdered,omitempty"` + + // ReturnInfo: Details of the return policy for the line item. + ReturnInfo *OrderLineItemReturnInfo `json:"returnInfo,omitempty"` + + // ShippingDetails: Details of the requested shipping for the line item. + ShippingDetails *OrderLineItemShippingDetails `json:"shippingDetails,omitempty"` + + // UnitTax: Unit tax for the line item. + UnitTax *Price `json:"unitTax,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Product") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TestOrderLineItem) MarshalJSON() ([]byte, error) { + type noMethod TestOrderLineItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TestOrderLineItemProduct struct { + // Brand: Brand of the item. + Brand string `json:"brand,omitempty"` + + // Channel: The item's channel. + Channel string `json:"channel,omitempty"` + + // Condition: Condition or state of the item. + Condition string `json:"condition,omitempty"` + + // ContentLanguage: The two-letter ISO 639-1 language code for the item. + ContentLanguage string `json:"contentLanguage,omitempty"` + + // Gtin: Global Trade Item Number (GTIN) of the item. Optional. + Gtin string `json:"gtin,omitempty"` + + // ImageLink: URL of an image of the item. + ImageLink string `json:"imageLink,omitempty"` + + // ItemGroupId: Shared identifier for all variants of the same product. + // Optional. + ItemGroupId string `json:"itemGroupId,omitempty"` + + // Mpn: Manufacturer Part Number (MPN) of the item. Optional. + Mpn string `json:"mpn,omitempty"` + + // OfferId: An identifier of the item. + OfferId string `json:"offerId,omitempty"` + + // Price: The price for the product. + Price *Price `json:"price,omitempty"` + + // TargetCountry: The CLDR territory code of the target country of the + // product. + TargetCountry string `json:"targetCountry,omitempty"` + + // Title: The title of the product. + Title string `json:"title,omitempty"` + + // VariantAttributes: Variant attributes for the item. Optional. + VariantAttributes []*OrderLineItemProductVariantAttribute `json:"variantAttributes,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Brand") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TestOrderLineItemProduct) MarshalJSON() ([]byte, error) { + type noMethod TestOrderLineItemProduct + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TestOrderPaymentMethod struct { + // ExpirationMonth: The card expiration month (January = 1, February = 2 + // etc.). + ExpirationMonth int64 `json:"expirationMonth,omitempty"` + + // ExpirationYear: The card expiration year (4-digit, e.g. 2015). + ExpirationYear int64 `json:"expirationYear,omitempty"` + + // LastFourDigits: The last four digits of the card number. + LastFourDigits string `json:"lastFourDigits,omitempty"` + + // PredefinedBillingAddress: The billing address. + PredefinedBillingAddress string `json:"predefinedBillingAddress,omitempty"` + + // Type: The type of instrument. Note that real orders might have + // different values than the four values accepted by createTestOrder. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ExpirationMonth") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TestOrderPaymentMethod) MarshalJSON() ([]byte, error) { + type noMethod TestOrderPaymentMethod + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "content.orders.acknowledge": + +type OrdersAcknowledgeCall struct { + s *Service + merchantId uint64 + orderId string + ordersacknowledgerequest *OrdersAcknowledgeRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Acknowledge: Marks an order as acknowledged. +func (r *OrdersService) Acknowledge(merchantId uint64, orderId string, ordersacknowledgerequest *OrdersAcknowledgeRequest) *OrdersAcknowledgeCall { + c := &OrdersAcknowledgeCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.orderId = orderId + c.ordersacknowledgerequest = ordersacknowledgerequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersAcknowledgeCall) Fields(s ...googleapi.Field) *OrdersAcknowledgeCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersAcknowledgeCall) Context(ctx context.Context) *OrdersAcknowledgeCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersAcknowledgeCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersacknowledgerequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/acknowledge") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "orderId": c.orderId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.acknowledge" call. +// Exactly one of *OrdersAcknowledgeResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *OrdersAcknowledgeResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrdersAcknowledgeCall) Do() (*OrdersAcknowledgeResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersAcknowledgeResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Marks an order as acknowledged.", + // "httpMethod": "POST", + // "id": "content.orders.acknowledge", + // "parameterOrder": [ + // "merchantId", + // "orderId" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orderId": { + // "description": "The ID of the order.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/orders/{orderId}/acknowledge", + // "request": { + // "$ref": "OrdersAcknowledgeRequest" + // }, + // "response": { + // "$ref": "OrdersAcknowledgeResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.advancetestorder": + +type OrdersAdvancetestorderCall struct { + s *Service + merchantId uint64 + orderId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Advancetestorder: Sandbox only. Moves a test order from state +// "inProgress" to state "pendingShipment". +func (r *OrdersService) Advancetestorder(merchantId uint64, orderId string) *OrdersAdvancetestorderCall { + c := &OrdersAdvancetestorderCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.orderId = orderId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersAdvancetestorderCall) Fields(s ...googleapi.Field) *OrdersAdvancetestorderCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersAdvancetestorderCall) Context(ctx context.Context) *OrdersAdvancetestorderCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersAdvancetestorderCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/testorders/{orderId}/advance") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "orderId": c.orderId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.advancetestorder" call. +// Exactly one of *OrdersAdvanceTestOrderResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *OrdersAdvanceTestOrderResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrdersAdvancetestorderCall) Do() (*OrdersAdvanceTestOrderResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersAdvanceTestOrderResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sandbox only. Moves a test order from state \"inProgress\" to state \"pendingShipment\".", + // "httpMethod": "POST", + // "id": "content.orders.advancetestorder", + // "parameterOrder": [ + // "merchantId", + // "orderId" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orderId": { + // "description": "The ID of the test order to modify.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/testorders/{orderId}/advance", + // "response": { + // "$ref": "OrdersAdvanceTestOrderResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.cancel": + +type OrdersCancelCall struct { + s *Service + merchantId uint64 + orderId string + orderscancelrequest *OrdersCancelRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Cancel: Cancels all line items in an order. +func (r *OrdersService) Cancel(merchantId uint64, orderId string, orderscancelrequest *OrdersCancelRequest) *OrdersCancelCall { + c := &OrdersCancelCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.orderId = orderId + c.orderscancelrequest = orderscancelrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersCancelCall) Fields(s ...googleapi.Field) *OrdersCancelCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersCancelCall) Context(ctx context.Context) *OrdersCancelCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersCancelCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderscancelrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/cancel") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "orderId": c.orderId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.cancel" call. +// Exactly one of *OrdersCancelResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *OrdersCancelResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrdersCancelCall) Do() (*OrdersCancelResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersCancelResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Cancels all line items in an order.", + // "httpMethod": "POST", + // "id": "content.orders.cancel", + // "parameterOrder": [ + // "merchantId", + // "orderId" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orderId": { + // "description": "The ID of the order to cancel.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/orders/{orderId}/cancel", + // "request": { + // "$ref": "OrdersCancelRequest" + // }, + // "response": { + // "$ref": "OrdersCancelResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.cancellineitem": + +type OrdersCancellineitemCall struct { + s *Service + merchantId uint64 + orderId string + orderscancellineitemrequest *OrdersCancelLineItemRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Cancellineitem: Cancels a line item. +func (r *OrdersService) Cancellineitem(merchantId uint64, orderId string, orderscancellineitemrequest *OrdersCancelLineItemRequest) *OrdersCancellineitemCall { + c := &OrdersCancellineitemCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.orderId = orderId + c.orderscancellineitemrequest = orderscancellineitemrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersCancellineitemCall) Fields(s ...googleapi.Field) *OrdersCancellineitemCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersCancellineitemCall) Context(ctx context.Context) *OrdersCancellineitemCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersCancellineitemCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderscancellineitemrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/cancelLineItem") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "orderId": c.orderId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.cancellineitem" call. +// Exactly one of *OrdersCancelLineItemResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *OrdersCancelLineItemResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrdersCancellineitemCall) Do() (*OrdersCancelLineItemResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersCancelLineItemResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Cancels a line item.", + // "httpMethod": "POST", + // "id": "content.orders.cancellineitem", + // "parameterOrder": [ + // "merchantId", + // "orderId" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orderId": { + // "description": "The ID of the order.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/orders/{orderId}/cancelLineItem", + // "request": { + // "$ref": "OrdersCancelLineItemRequest" + // }, + // "response": { + // "$ref": "OrdersCancelLineItemResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.createtestorder": + +type OrdersCreatetestorderCall struct { + s *Service + merchantId uint64 + orderscreatetestorderrequest *OrdersCreateTestOrderRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Createtestorder: Sandbox only. Creates a test order. +func (r *OrdersService) Createtestorder(merchantId uint64, orderscreatetestorderrequest *OrdersCreateTestOrderRequest) *OrdersCreatetestorderCall { + c := &OrdersCreatetestorderCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.orderscreatetestorderrequest = orderscreatetestorderrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersCreatetestorderCall) Fields(s ...googleapi.Field) *OrdersCreatetestorderCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersCreatetestorderCall) Context(ctx context.Context) *OrdersCreatetestorderCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersCreatetestorderCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderscreatetestorderrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/testorders") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.createtestorder" call. +// Exactly one of *OrdersCreateTestOrderResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *OrdersCreateTestOrderResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrdersCreatetestorderCall) Do() (*OrdersCreateTestOrderResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersCreateTestOrderResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sandbox only. Creates a test order.", + // "httpMethod": "POST", + // "id": "content.orders.createtestorder", + // "parameterOrder": [ + // "merchantId" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/testorders", + // "request": { + // "$ref": "OrdersCreateTestOrderRequest" + // }, + // "response": { + // "$ref": "OrdersCreateTestOrderResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.custombatch": + +type OrdersCustombatchCall struct { + s *Service + orderscustombatchrequest *OrdersCustomBatchRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Custombatch: Retrieves or modifies multiple orders in a single +// request. +func (r *OrdersService) Custombatch(orderscustombatchrequest *OrdersCustomBatchRequest) *OrdersCustombatchCall { + c := &OrdersCustombatchCall{s: r.s, opt_: make(map[string]interface{})} + c.orderscustombatchrequest = orderscustombatchrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersCustombatchCall) Fields(s ...googleapi.Field) *OrdersCustombatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersCustombatchCall) Context(ctx context.Context) *OrdersCustombatchCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersCustombatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderscustombatchrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "orders/batch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.custombatch" call. +// Exactly one of *OrdersCustomBatchResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *OrdersCustomBatchResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrdersCustombatchCall) Do() (*OrdersCustomBatchResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersCustomBatchResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves or modifies multiple orders in a single request.", + // "httpMethod": "POST", + // "id": "content.orders.custombatch", + // "path": "orders/batch", + // "request": { + // "$ref": "OrdersCustomBatchRequest" + // }, + // "response": { + // "$ref": "OrdersCustomBatchResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.get": + +type OrdersGetCall struct { + s *Service + merchantId uint64 + orderId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves an order from your Merchant Center account. +func (r *OrdersService) Get(merchantId uint64, orderId string) *OrdersGetCall { + c := &OrdersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.orderId = orderId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersGetCall) Fields(s ...googleapi.Field) *OrdersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrdersGetCall) IfNoneMatch(entityTag string) *OrdersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersGetCall) Context(ctx context.Context) *OrdersGetCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "orderId": c.orderId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.get" call. +// Exactly one of *Order or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Order.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrdersGetCall) Do() (*Order, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Order{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves an order from your Merchant Center account.", + // "httpMethod": "GET", + // "id": "content.orders.get", + // "parameterOrder": [ + // "merchantId", + // "orderId" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orderId": { + // "description": "The ID of the order.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/orders/{orderId}", + // "response": { + // "$ref": "Order" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.getbymerchantorderid": + +type OrdersGetbymerchantorderidCall struct { + s *Service + merchantId uint64 + merchantOrderId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Getbymerchantorderid: Retrieves an order using merchant order id. +func (r *OrdersService) Getbymerchantorderid(merchantId uint64, merchantOrderId string) *OrdersGetbymerchantorderidCall { + c := &OrdersGetbymerchantorderidCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.merchantOrderId = merchantOrderId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersGetbymerchantorderidCall) Fields(s ...googleapi.Field) *OrdersGetbymerchantorderidCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrdersGetbymerchantorderidCall) IfNoneMatch(entityTag string) *OrdersGetbymerchantorderidCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersGetbymerchantorderidCall) Context(ctx context.Context) *OrdersGetbymerchantorderidCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersGetbymerchantorderidCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/ordersbymerchantid/{merchantOrderId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "merchantOrderId": c.merchantOrderId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.getbymerchantorderid" call. +// Exactly one of *OrdersGetByMerchantOrderIdResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *OrdersGetByMerchantOrderIdResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrdersGetbymerchantorderidCall) Do() (*OrdersGetByMerchantOrderIdResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersGetByMerchantOrderIdResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves an order using merchant order id.", + // "httpMethod": "GET", + // "id": "content.orders.getbymerchantorderid", + // "parameterOrder": [ + // "merchantId", + // "merchantOrderId" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "merchantOrderId": { + // "description": "The merchant order id to be looked for.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/ordersbymerchantid/{merchantOrderId}", + // "response": { + // "$ref": "OrdersGetByMerchantOrderIdResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.gettestordertemplate": + +type OrdersGettestordertemplateCall struct { + s *Service + merchantId uint64 + templateName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Gettestordertemplate: Sandbox only. Retrieves an order template that +// can be used to quickly create a new order in sandbox. +func (r *OrdersService) Gettestordertemplate(merchantId uint64, templateName string) *OrdersGettestordertemplateCall { + c := &OrdersGettestordertemplateCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.templateName = templateName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersGettestordertemplateCall) Fields(s ...googleapi.Field) *OrdersGettestordertemplateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrdersGettestordertemplateCall) IfNoneMatch(entityTag string) *OrdersGettestordertemplateCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersGettestordertemplateCall) Context(ctx context.Context) *OrdersGettestordertemplateCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersGettestordertemplateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/testordertemplates/{templateName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "templateName": c.templateName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.gettestordertemplate" call. +// Exactly one of *OrdersGetTestOrderTemplateResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *OrdersGetTestOrderTemplateResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrdersGettestordertemplateCall) Do() (*OrdersGetTestOrderTemplateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersGetTestOrderTemplateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox.", + // "httpMethod": "GET", + // "id": "content.orders.gettestordertemplate", + // "parameterOrder": [ + // "merchantId", + // "templateName" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "templateName": { + // "description": "The name of the template to retrieve.", + // "enum": [ + // "template1", + // "template2" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/testordertemplates/{templateName}", + // "response": { + // "$ref": "OrdersGetTestOrderTemplateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.list": + +type OrdersListCall struct { + s *Service + merchantId uint64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the orders in your Merchant Center account. +func (r *OrdersService) List(merchantId uint64) *OrdersListCall { + c := &OrdersListCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + return c +} + +// Acknowledged sets the optional parameter "acknowledged": Obtains +// orders that match the acknowledgement status. When set to true, +// obtains orders that have been acknowledged. When false, obtains +// orders that have not been acknowledged. +// We recommend using this filter set to false, in conjunction with the +// acknowledge call, such that only un-acknowledged orders are returned. +func (c *OrdersListCall) Acknowledged(acknowledged bool) *OrdersListCall { + c.opt_["acknowledged"] = acknowledged + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of orders to return in the response, used for paging. The +// default value is 25 orders per page, and the maximum allowed value is +// 250 orders per page. +// Known issue: All List calls will return all Orders without limit +// regardless of the value of this field. +func (c *OrdersListCall) MaxResults(maxResults int64) *OrdersListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderBy sets the optional parameter "orderBy": The ordering of the +// returned list. The only supported value are placedDate desc and +// placedDate asc for now, which returns orders sorted by placement +// date. "placedDate desc" stands for listing orders by placement date, +// from oldest to most recent. "placedDate asc" stands for listing +// orders by placement date, from most recent to oldest. In future +// releases we'll support other sorting criteria. +// +// Possible values: +// "placedDate asc" +// "placedDate desc" +func (c *OrdersListCall) OrderBy(orderBy string) *OrdersListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *OrdersListCall) PageToken(pageToken string) *OrdersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// PlacedDateEnd sets the optional parameter "placedDateEnd": Obtains +// orders placed before this date (exclusively), in ISO 8601 format. +func (c *OrdersListCall) PlacedDateEnd(placedDateEnd string) *OrdersListCall { + c.opt_["placedDateEnd"] = placedDateEnd + return c +} + +// PlacedDateStart sets the optional parameter "placedDateStart": +// Obtains orders placed after this date (inclusively), in ISO 8601 +// format. +func (c *OrdersListCall) PlacedDateStart(placedDateStart string) *OrdersListCall { + c.opt_["placedDateStart"] = placedDateStart + return c +} + +// Statuses sets the optional parameter "statuses": Obtains orders that +// match any of the specified statuses. Multiple values can be specified +// with comma separation. Additionally, please note that active is a +// shortcut for pendingShipment and partiallyShipped, and completed is a +// shortcut for shipped , partiallyDelivered, delivered, +// partiallyReturned, returned, and canceled. +// +// Possible values: +// "active" +// "canceled" +// "completed" +// "delivered" +// "inProgress" +// "partiallyDelivered" +// "partiallyReturned" +// "partiallyShipped" +// "pendingShipment" +// "returned" +// "shipped" +func (c *OrdersListCall) Statuses(statuses string) *OrdersListCall { + c.opt_["statuses"] = statuses + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersListCall) Fields(s ...googleapi.Field) *OrdersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrdersListCall) IfNoneMatch(entityTag string) *OrdersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersListCall) Context(ctx context.Context) *OrdersListCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["acknowledged"]; ok { + params.Set("acknowledged", 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_["placedDateEnd"]; ok { + params.Set("placedDateEnd", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["placedDateStart"]; ok { + params.Set("placedDateStart", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["statuses"]; ok { + params.Set("statuses", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.list" call. +// Exactly one of *OrdersListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *OrdersListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrdersListCall) Do() (*OrdersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the orders in your Merchant Center account.", + // "httpMethod": "GET", + // "id": "content.orders.list", + // "parameterOrder": [ + // "merchantId" + // ], + // "parameters": { + // "acknowledged": { + // "description": "Obtains orders that match the acknowledgement status. When set to true, obtains orders that have been acknowledged. When false, obtains orders that have not been acknowledged.\nWe recommend using this filter set to false, in conjunction with the acknowledge call, such that only un-acknowledged orders are returned.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "The maximum number of orders to return in the response, used for paging. The default value is 25 orders per page, and the maximum allowed value is 250 orders per page.\nKnown issue: All List calls will return all Orders without limit regardless of the value of this field.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orderBy": { + // "description": "The ordering of the returned list. The only supported value are placedDate desc and placedDate asc for now, which returns orders sorted by placement date. \"placedDate desc\" stands for listing orders by placement date, from oldest to most recent. \"placedDate asc\" stands for listing orders by placement date, from most recent to oldest. In future releases we'll support other sorting criteria.", + // "enum": [ + // "placedDate asc", + // "placedDate desc" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "The token returned by the previous request.", + // "location": "query", + // "type": "string" + // }, + // "placedDateEnd": { + // "description": "Obtains orders placed before this date (exclusively), in ISO 8601 format.", + // "location": "query", + // "type": "string" + // }, + // "placedDateStart": { + // "description": "Obtains orders placed after this date (inclusively), in ISO 8601 format.", + // "location": "query", + // "type": "string" + // }, + // "statuses": { + // "description": "Obtains orders that match any of the specified statuses. Multiple values can be specified with comma separation. Additionally, please note that active is a shortcut for pendingShipment and partiallyShipped, and completed is a shortcut for shipped , partiallyDelivered, delivered, partiallyReturned, returned, and canceled.", + // "enum": [ + // "active", + // "canceled", + // "completed", + // "delivered", + // "inProgress", + // "partiallyDelivered", + // "partiallyReturned", + // "partiallyShipped", + // "pendingShipment", + // "returned", + // "shipped" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/orders", + // "response": { + // "$ref": "OrdersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.refund": + +type OrdersRefundCall struct { + s *Service + merchantId uint64 + orderId string + ordersrefundrequest *OrdersRefundRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Refund: Refund a portion of the order, up to the full amount paid. +func (r *OrdersService) Refund(merchantId uint64, orderId string, ordersrefundrequest *OrdersRefundRequest) *OrdersRefundCall { + c := &OrdersRefundCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.orderId = orderId + c.ordersrefundrequest = ordersrefundrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersRefundCall) Fields(s ...googleapi.Field) *OrdersRefundCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersRefundCall) Context(ctx context.Context) *OrdersRefundCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersRefundCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersrefundrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/refund") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "orderId": c.orderId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.refund" call. +// Exactly one of *OrdersRefundResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *OrdersRefundResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrdersRefundCall) Do() (*OrdersRefundResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersRefundResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Refund a portion of the order, up to the full amount paid.", + // "httpMethod": "POST", + // "id": "content.orders.refund", + // "parameterOrder": [ + // "merchantId", + // "orderId" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orderId": { + // "description": "The ID of the order to refund.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/orders/{orderId}/refund", + // "request": { + // "$ref": "OrdersRefundRequest" + // }, + // "response": { + // "$ref": "OrdersRefundResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.returnlineitem": + +type OrdersReturnlineitemCall struct { + s *Service + merchantId uint64 + orderId string + ordersreturnlineitemrequest *OrdersReturnLineItemRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Returnlineitem: Returns a line item. +func (r *OrdersService) Returnlineitem(merchantId uint64, orderId string, ordersreturnlineitemrequest *OrdersReturnLineItemRequest) *OrdersReturnlineitemCall { + c := &OrdersReturnlineitemCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.orderId = orderId + c.ordersreturnlineitemrequest = ordersreturnlineitemrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersReturnlineitemCall) Fields(s ...googleapi.Field) *OrdersReturnlineitemCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersReturnlineitemCall) Context(ctx context.Context) *OrdersReturnlineitemCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersReturnlineitemCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersreturnlineitemrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/returnLineItem") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "orderId": c.orderId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.returnlineitem" call. +// Exactly one of *OrdersReturnLineItemResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *OrdersReturnLineItemResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrdersReturnlineitemCall) Do() (*OrdersReturnLineItemResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersReturnLineItemResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a line item.", + // "httpMethod": "POST", + // "id": "content.orders.returnlineitem", + // "parameterOrder": [ + // "merchantId", + // "orderId" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orderId": { + // "description": "The ID of the order.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/orders/{orderId}/returnLineItem", + // "request": { + // "$ref": "OrdersReturnLineItemRequest" + // }, + // "response": { + // "$ref": "OrdersReturnLineItemResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.shiplineitems": + +type OrdersShiplineitemsCall struct { + s *Service + merchantId uint64 + orderId string + ordersshiplineitemsrequest *OrdersShipLineItemsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Shiplineitems: Marks line item(s) as shipped. +func (r *OrdersService) Shiplineitems(merchantId uint64, orderId string, ordersshiplineitemsrequest *OrdersShipLineItemsRequest) *OrdersShiplineitemsCall { + c := &OrdersShiplineitemsCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.orderId = orderId + c.ordersshiplineitemsrequest = ordersshiplineitemsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersShiplineitemsCall) Fields(s ...googleapi.Field) *OrdersShiplineitemsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersShiplineitemsCall) Context(ctx context.Context) *OrdersShiplineitemsCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersShiplineitemsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersshiplineitemsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/shipLineItems") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "orderId": c.orderId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.shiplineitems" call. +// Exactly one of *OrdersShipLineItemsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *OrdersShipLineItemsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrdersShiplineitemsCall) Do() (*OrdersShipLineItemsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersShipLineItemsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Marks line item(s) as shipped.", + // "httpMethod": "POST", + // "id": "content.orders.shiplineitems", + // "parameterOrder": [ + // "merchantId", + // "orderId" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orderId": { + // "description": "The ID of the order.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/orders/{orderId}/shipLineItems", + // "request": { + // "$ref": "OrdersShipLineItemsRequest" + // }, + // "response": { + // "$ref": "OrdersShipLineItemsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.updatemerchantorderid": + +type OrdersUpdatemerchantorderidCall struct { + s *Service + merchantId uint64 + orderId string + ordersupdatemerchantorderidrequest *OrdersUpdateMerchantOrderIdRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Updatemerchantorderid: Updates the merchant order ID for a given +// order. +func (r *OrdersService) Updatemerchantorderid(merchantId uint64, orderId string, ordersupdatemerchantorderidrequest *OrdersUpdateMerchantOrderIdRequest) *OrdersUpdatemerchantorderidCall { + c := &OrdersUpdatemerchantorderidCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.orderId = orderId + c.ordersupdatemerchantorderidrequest = ordersupdatemerchantorderidrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersUpdatemerchantorderidCall) Fields(s ...googleapi.Field) *OrdersUpdatemerchantorderidCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersUpdatemerchantorderidCall) Context(ctx context.Context) *OrdersUpdatemerchantorderidCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersUpdatemerchantorderidCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersupdatemerchantorderidrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/updateMerchantOrderId") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "orderId": c.orderId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.updatemerchantorderid" call. +// Exactly one of *OrdersUpdateMerchantOrderIdResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *OrdersUpdateMerchantOrderIdResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OrdersUpdatemerchantorderidCall) Do() (*OrdersUpdateMerchantOrderIdResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersUpdateMerchantOrderIdResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the merchant order ID for a given order.", + // "httpMethod": "POST", + // "id": "content.orders.updatemerchantorderid", + // "parameterOrder": [ + // "merchantId", + // "orderId" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orderId": { + // "description": "The ID of the order.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/orders/{orderId}/updateMerchantOrderId", + // "request": { + // "$ref": "OrdersUpdateMerchantOrderIdRequest" + // }, + // "response": { + // "$ref": "OrdersUpdateMerchantOrderIdResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} + +// method id "content.orders.updateshipment": + +type OrdersUpdateshipmentCall struct { + s *Service + merchantId uint64 + orderId string + ordersupdateshipmentrequest *OrdersUpdateShipmentRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Updateshipment: Updates a shipment's status, carrier, and/or tracking +// ID. +func (r *OrdersService) Updateshipment(merchantId uint64, orderId string, ordersupdateshipmentrequest *OrdersUpdateShipmentRequest) *OrdersUpdateshipmentCall { + c := &OrdersUpdateshipmentCall{s: r.s, opt_: make(map[string]interface{})} + c.merchantId = merchantId + c.orderId = orderId + c.ordersupdateshipmentrequest = ordersupdateshipmentrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersUpdateshipmentCall) Fields(s ...googleapi.Field) *OrdersUpdateshipmentCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersUpdateshipmentCall) Context(ctx context.Context) *OrdersUpdateshipmentCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersUpdateshipmentCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersupdateshipmentrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/updateShipment") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "merchantId": strconv.FormatUint(c.merchantId, 10), + "orderId": c.orderId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "content.orders.updateshipment" call. +// Exactly one of *OrdersUpdateShipmentResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *OrdersUpdateShipmentResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrdersUpdateshipmentCall) Do() (*OrdersUpdateShipmentResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersUpdateShipmentResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a shipment's status, carrier, and/or tracking ID.", + // "httpMethod": "POST", + // "id": "content.orders.updateshipment", + // "parameterOrder": [ + // "merchantId", + // "orderId" + // ], + // "parameters": { + // "merchantId": { + // "description": "The ID of the managing account.", + // "format": "uint64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orderId": { + // "description": "The ID of the order.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{merchantId}/orders/{orderId}/updateShipment", + // "request": { + // "$ref": "OrdersUpdateShipmentRequest" + // }, + // "response": { + // "$ref": "OrdersUpdateShipmentResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/content" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/coordinate/v1/coordinate-api.json b/Godeps/_workspace/src/google.golang.org/api/coordinate/v1/coordinate-api.json new file mode 100644 index 000000000..d749cf9af --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/coordinate/v1/coordinate-api.json @@ -0,0 +1,1196 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/RNf67Qs-KGgGShWEZ1M0BbfJUQg\"", + "discoveryVersion": "v1", + "id": "coordinate:v1", + "name": "coordinate", + "version": "v1", + "revision": "20150811", + "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/", + "basePath": "/coordinate/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "coordinate/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/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." + }, + "enumitems": { + "type": "array", + "description": "List of enum items for this custom field. Populated only if the field type is enum. Enum fields appear as 'lists' in the Coordinate web and mobile UI.", + "items": { + "$ref": "EnumItemDef" + } + }, + "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" + } + } + }, + "EnumItemDef": { + "id": "EnumItemDef", + "type": "object", + "description": "Enum Item definition.", + "properties": { + "active": { + "type": "boolean", + "description": "Whether the enum item is active. Jobs may contain inactive enum values; however, setting an enum to an inactive value when creating or updating a job will result in a 500 error." + }, + "kind": { + "type": "string", + "description": "Identifies this object as an enum item definition.", + "default": "coordinate#enumItemDef" + }, + "value": { + "type": "string", + "description": "Custom field value." + } + } + }, + "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, or the string \"DELETED_USER\" if the account is no longer available." + }, + "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" + } + } + }, + "Team": { + "id": "Team", + "type": "object", + "description": "A Coordinate team.", + "properties": { + "id": { + "type": "string", + "description": "Team id, as found in a coordinate team url e.g. https://coordinate.google.com/f/xyz where \"xyz\" is the team id." + }, + "kind": { + "type": "string", + "description": "Identifies this object as a team.", + "default": "coordinate#team" + }, + "name": { + "type": "string", + "description": "Team name" + } + } + }, + "TeamListResponse": { + "id": "TeamListResponse", + "type": "object", + "description": "Response from a List Teams request.", + "properties": { + "items": { + "type": "array", + "description": "Teams in the collection.", + "items": { + "$ref": "Team" + } + }, + "kind": { + "type": "string", + "description": "Identifies this object as a list of teams.", + "default": "coordinate#teamList" + } + } + }, + "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. If a worker has been deleted from your team, the email address will appear as DELETED_USER." + }, + "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": "teams/{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": "teams/{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": "teams/{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": "Sets the value of custom fields. To set a custom field, pass the field id (from /team/teamId/custom_fields), a URL escaped '=' character, and the desired value as a parameter. For example, customField=12%3DAlice. Repeat the parameter for each custom field. Note that '=' cannot appear in the parameter value. Specifying an invalid, or inactive enum field will result in an error 500.", + "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": "teams/{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" + }, + "omitJobChanges": { + "type": "boolean", + "description": "Whether to omit detail job history information.", + "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": "teams/{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": "Sets the value of custom fields. To set a custom field, pass the field id (from /team/teamId/custom_fields), a URL escaped '=' character, and the desired value as a parameter. For example, customField=12%3DAlice. Repeat the parameter for each custom field. Note that '=' cannot appear in the parameter value. Specifying an invalid, or inactive enum field will result in an error 500.", + "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": "teams/{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": "Sets the value of custom fields. To set a custom field, pass the field id (from /team/teamId/custom_fields), a URL escaped '=' character, and the desired value as a parameter. For example, customField=12%3DAlice. Repeat the parameter for each custom field. Note that '=' cannot appear in the parameter value. Specifying an invalid, or inactive enum field will result in an error 500.", + "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": "teams/{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": "teams/{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": "teams/{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": "teams/{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" + ] + } + } + }, + "team": { + "methods": { + "list": { + "id": "coordinate.team.list", + "path": "teams", + "httpMethod": "GET", + "description": "Retrieves a list of teams for a user.", + "parameters": { + "admin": { + "type": "boolean", + "description": "Whether to include teams for which the user has the Admin role.", + "location": "query" + }, + "dispatcher": { + "type": "boolean", + "description": "Whether to include teams for which the user has the Dispatcher role.", + "location": "query" + }, + "worker": { + "type": "boolean", + "description": "Whether to include teams for which the user has the Worker role.", + "location": "query" + } + }, + "response": { + "$ref": "TeamListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/coordinate", + "https://www.googleapis.com/auth/coordinate.readonly" + ] + } + } + }, + "worker": { + "methods": { + "list": { + "id": "coordinate.worker.list", + "path": "teams/{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/Godeps/_workspace/src/google.golang.org/api/coordinate/v1/coordinate-gen.go b/Godeps/_workspace/src/google.golang.org/api/coordinate/v1/coordinate-gen.go new file mode 100644 index 000000000..f86c8335a --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/coordinate/v1/coordinate-gen.go @@ -0,0 +1,3024 @@ +// Package coordinate provides access to the Google Maps Coordinate API. +// +// See https://developers.google.com/coordinate/ +// +// Usage example: +// +// import "google.golang.org/api/coordinate/v1" +// ... +// coordinateService, err := coordinate.New(oauthHttpClient) +package coordinate // import "google.golang.org/api/coordinate/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "coordinate:v1" +const apiName = "coordinate" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/coordinate/v1/" + +// 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.Team = NewTeamService(s) + s.Worker = NewWorkerService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + CustomFieldDef *CustomFieldDefService + + Jobs *JobsService + + Location *LocationService + + Schedule *ScheduleService + + Team *TeamService + + Worker *WorkerService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 NewTeamService(s *Service) *TeamService { + rs := &TeamService{s: s} + return rs +} + +type TeamService struct { + s *Service +} + +func NewWorkerService(s *Service) *WorkerService { + rs := &WorkerService{s: s} + return rs +} + +type WorkerService struct { + s *Service +} + +// CustomField: Custom field. +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"` + + // ForceSendFields is a list of field names (e.g. "CustomFieldId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomField) MarshalJSON() ([]byte, error) { + type noMethod CustomField + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomFieldDef: Custom field definition. +type CustomFieldDef struct { + // Enabled: Whether the field is enabled. + Enabled bool `json:"enabled,omitempty"` + + // Enumitems: List of enum items for this custom field. Populated only + // if the field type is enum. Enum fields appear as 'lists' in the + // Coordinate web and mobile UI. + Enumitems []*EnumItemDef `json:"enumitems,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"` + + // ForceSendFields is a list of field names (e.g. "Enabled") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomFieldDef) MarshalJSON() ([]byte, error) { + type noMethod CustomFieldDef + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomFieldDefListResponse: Collection of custom field definitions +// for a team. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomFieldDefListResponse) MarshalJSON() ([]byte, error) { + type noMethod CustomFieldDefListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomFields: Collection of custom fields. +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"` + + // ForceSendFields is a list of field names (e.g. "CustomField") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomFields) MarshalJSON() ([]byte, error) { + type noMethod CustomFields + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EnumItemDef: Enum Item definition. +type EnumItemDef struct { + // Active: Whether the enum item is active. Jobs may contain inactive + // enum values; however, setting an enum to an inactive value when + // creating or updating a job will result in a 500 error. + Active bool `json:"active,omitempty"` + + // Kind: Identifies this object as an enum item definition. + Kind string `json:"kind,omitempty"` + + // Value: Custom field value. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Active") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EnumItemDef) MarshalJSON() ([]byte, error) { + type noMethod EnumItemDef + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Job: A job. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Job) MarshalJSON() ([]byte, error) { + type noMethod Job + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// JobChange: Change to a job. For example assigning the job to a +// different worker. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JobChange) MarshalJSON() ([]byte, error) { + type noMethod JobChange + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// JobListResponse: Response from a List Jobs request. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JobListResponse) MarshalJSON() ([]byte, error) { + type noMethod JobListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// JobState: Current state of a job. +type JobState struct { + // Assignee: Email address of the assignee, or the string "DELETED_USER" + // if the account is no longer available. + 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"` + + // ForceSendFields is a list of field names (e.g. "Assignee") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JobState) MarshalJSON() ([]byte, error) { + type noMethod JobState + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Location: Location of a job. +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"` + + // ForceSendFields is a list of field names (e.g. "AddressLine") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Location) MarshalJSON() ([]byte, error) { + type noMethod Location + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LocationListResponse: Response from a List Locations request. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LocationListResponse) MarshalJSON() ([]byte, error) { + type noMethod LocationListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LocationRecord: Recorded location of a worker. +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"` + + // ForceSendFields is a list of field names (e.g. "CollectionTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LocationRecord) MarshalJSON() ([]byte, error) { + type noMethod LocationRecord + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Schedule: Job schedule. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AllDay") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Schedule) MarshalJSON() ([]byte, error) { + type noMethod Schedule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Team: A Coordinate team. +type Team struct { + // Id: Team id, as found in a coordinate team url e.g. + // https://coordinate.google.com/f/xyz where "xyz" is the team id. + Id string `json:"id,omitempty"` + + // Kind: Identifies this object as a team. + Kind string `json:"kind,omitempty"` + + // Name: Team name + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Team) MarshalJSON() ([]byte, error) { + type noMethod Team + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TeamListResponse: Response from a List Teams request. +type TeamListResponse struct { + // Items: Teams in the collection. + Items []*Team `json:"items,omitempty"` + + // Kind: Identifies this object as a list of teams. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TeamListResponse) MarshalJSON() ([]byte, error) { + type noMethod TeamListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TokenPagination: Pagination information. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TokenPagination) MarshalJSON() ([]byte, error) { + type noMethod TokenPagination + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Worker: A worker in a Coordinate team. +type Worker struct { + // Id: Worker email address. If a worker has been deleted from your + // team, the email address will appear as DELETED_USER. + Id string `json:"id,omitempty"` + + // Kind: Identifies this object as a worker. + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Worker) MarshalJSON() ([]byte, error) { + type noMethod Worker + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// WorkerListResponse: Response from a List Workers request. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *WorkerListResponse) MarshalJSON() ([]byte, error) { + type noMethod WorkerListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "coordinate.customFieldDef.list": + +type CustomFieldDefListCall struct { + s *Service + teamId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomFieldDefListCall) Fields(s ...googleapi.Field) *CustomFieldDefListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CustomFieldDefListCall) IfNoneMatch(entityTag string) *CustomFieldDefListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomFieldDefListCall) Context(ctx context.Context) *CustomFieldDefListCall { + c.ctx_ = ctx + return c +} + +func (c *CustomFieldDefListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "teams/{teamId}/custom_fields") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "teamId": c.teamId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "coordinate.customFieldDef.list" call. +// Exactly one of *CustomFieldDefListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *CustomFieldDefListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CustomFieldDefListCall) Do() (*CustomFieldDefListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CustomFieldDefListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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": "teams/{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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *JobsGetCall) Fields(s ...googleapi.Field) *JobsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *JobsGetCall) IfNoneMatch(entityTag string) *JobsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *JobsGetCall) Context(ctx context.Context) *JobsGetCall { + c.ctx_ = ctx + return c +} + +func (c *JobsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "teams/{teamId}/jobs/{jobId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "teamId": c.teamId, + "jobId": strconv.FormatUint(c.jobId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "coordinate.jobs.get" call. +// Exactly one of *Job or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Job.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *JobsGetCall) Do() (*Job, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Job{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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": "teams/{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{} + ctx_ context.Context +} + +// 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": Sets the value +// of custom fields. To set a custom field, pass the field id (from +// /team/teamId/custom_fields), a URL escaped '=' character, and the +// desired value as a parameter. For example, customField=12%3DAlice. +// Repeat the parameter for each custom field. Note that '=' cannot +// appear in the parameter value. Specifying an invalid, or inactive +// enum field will result in an error 500. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *JobsInsertCall) Fields(s ...googleapi.Field) *JobsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *JobsInsertCall) Context(ctx context.Context) *JobsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *JobsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "teams/{teamId}/jobs") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "teamId": c.teamId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "coordinate.jobs.insert" call. +// Exactly one of *Job or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Job.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *JobsInsertCall) Do() (*Job, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Job{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Sets the value of custom fields. To set a custom field, pass the field id (from /team/teamId/custom_fields), a URL escaped '=' character, and the desired value as a parameter. For example, customField=12%3DAlice. Repeat the parameter for each custom field. Note that '=' cannot appear in the parameter value. Specifying an invalid, or inactive enum field will result in an error 500.", + // "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": "teams/{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{} + ctx_ context.Context +} + +// 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 +} + +// OmitJobChanges sets the optional parameter "omitJobChanges": Whether +// to omit detail job history information. +func (c *JobsListCall) OmitJobChanges(omitJobChanges bool) *JobsListCall { + c.opt_["omitJobChanges"] = omitJobChanges + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +func (c *JobsListCall) PageToken(pageToken string) *JobsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *JobsListCall) Fields(s ...googleapi.Field) *JobsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *JobsListCall) IfNoneMatch(entityTag string) *JobsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *JobsListCall) Context(ctx context.Context) *JobsListCall { + c.ctx_ = ctx + return c +} + +func (c *JobsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["omitJobChanges"]; ok { + params.Set("omitJobChanges", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "teams/{teamId}/jobs") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "teamId": c.teamId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "coordinate.jobs.list" call. +// Exactly one of *JobListResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *JobListResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *JobsListCall) Do() (*JobListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &JobListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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" + // }, + // "omitJobChanges": { + // "description": "Whether to omit detail job history information.", + // "location": "query", + // "type": "boolean" + // }, + // "pageToken": { + // "description": "Continuation token", + // "location": "query", + // "type": "string" + // }, + // "teamId": { + // "description": "Team ID", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "teams/{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{} + ctx_ context.Context +} + +// 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": Sets the value +// of custom fields. To set a custom field, pass the field id (from +// /team/teamId/custom_fields), a URL escaped '=' character, and the +// desired value as a parameter. For example, customField=12%3DAlice. +// Repeat the parameter for each custom field. Note that '=' cannot +// appear in the parameter value. Specifying an invalid, or inactive +// enum field will result in an error 500. +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 +// +// Possible values: +// "COMPLETED" - Completed +// "IN_PROGRESS" - In progress +// "NOT_ACCEPTED" - Not accepted +// "NOT_STARTED" - Not started +// "OBSOLETE" - Obsolete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *JobsPatchCall) Fields(s ...googleapi.Field) *JobsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *JobsPatchCall) Context(ctx context.Context) *JobsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *JobsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "teams/{teamId}/jobs/{jobId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "teamId": c.teamId, + "jobId": strconv.FormatUint(c.jobId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "coordinate.jobs.patch" call. +// Exactly one of *Job or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Job.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *JobsPatchCall) Do() (*Job, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Job{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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": "Sets the value of custom fields. To set a custom field, pass the field id (from /team/teamId/custom_fields), a URL escaped '=' character, and the desired value as a parameter. For example, customField=12%3DAlice. Repeat the parameter for each custom field. Note that '=' cannot appear in the parameter value. Specifying an invalid, or inactive enum field will result in an error 500.", + // "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": "teams/{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{} + ctx_ context.Context +} + +// 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": Sets the value +// of custom fields. To set a custom field, pass the field id (from +// /team/teamId/custom_fields), a URL escaped '=' character, and the +// desired value as a parameter. For example, customField=12%3DAlice. +// Repeat the parameter for each custom field. Note that '=' cannot +// appear in the parameter value. Specifying an invalid, or inactive +// enum field will result in an error 500. +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 +// +// Possible values: +// "COMPLETED" - Completed +// "IN_PROGRESS" - In progress +// "NOT_ACCEPTED" - Not accepted +// "NOT_STARTED" - Not started +// "OBSOLETE" - Obsolete +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *JobsUpdateCall) Fields(s ...googleapi.Field) *JobsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *JobsUpdateCall) Context(ctx context.Context) *JobsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *JobsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "teams/{teamId}/jobs/{jobId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "teamId": c.teamId, + "jobId": strconv.FormatUint(c.jobId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "coordinate.jobs.update" call. +// Exactly one of *Job or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Job.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *JobsUpdateCall) Do() (*Job, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Job{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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": "Sets the value of custom fields. To set a custom field, pass the field id (from /team/teamId/custom_fields), a URL escaped '=' character, and the desired value as a parameter. For example, customField=12%3DAlice. Repeat the parameter for each custom field. Note that '=' cannot appear in the parameter value. Specifying an invalid, or inactive enum field will result in an error 500.", + // "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": "teams/{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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LocationListCall) Fields(s ...googleapi.Field) *LocationListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LocationListCall) IfNoneMatch(entityTag string) *LocationListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LocationListCall) Context(ctx context.Context) *LocationListCall { + c.ctx_ = ctx + return c +} + +func (c *LocationListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "teams/{teamId}/workers/{workerEmail}/locations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "teamId": c.teamId, + "workerEmail": c.workerEmail, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "coordinate.location.list" call. +// Exactly one of *LocationListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *LocationListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LocationListCall) Do() (*LocationListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LocationListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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": "teams/{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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ScheduleGetCall) Fields(s ...googleapi.Field) *ScheduleGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ScheduleGetCall) IfNoneMatch(entityTag string) *ScheduleGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ScheduleGetCall) Context(ctx context.Context) *ScheduleGetCall { + c.ctx_ = ctx + return c +} + +func (c *ScheduleGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "teams/{teamId}/jobs/{jobId}/schedule") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "teamId": c.teamId, + "jobId": strconv.FormatUint(c.jobId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "coordinate.schedule.get" call. +// Exactly one of *Schedule or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Schedule.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ScheduleGetCall) Do() (*Schedule, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Schedule{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the 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": "teams/{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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SchedulePatchCall) Fields(s ...googleapi.Field) *SchedulePatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SchedulePatchCall) Context(ctx context.Context) *SchedulePatchCall { + c.ctx_ = ctx + return c +} + +func (c *SchedulePatchCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "teams/{teamId}/jobs/{jobId}/schedule") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "teamId": c.teamId, + "jobId": strconv.FormatUint(c.jobId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "coordinate.schedule.patch" call. +// Exactly one of *Schedule or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Schedule.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SchedulePatchCall) Do() (*Schedule, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Schedule{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "teams/{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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ScheduleUpdateCall) Fields(s ...googleapi.Field) *ScheduleUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ScheduleUpdateCall) Context(ctx context.Context) *ScheduleUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ScheduleUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "teams/{teamId}/jobs/{jobId}/schedule") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "teamId": c.teamId, + "jobId": strconv.FormatUint(c.jobId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "coordinate.schedule.update" call. +// Exactly one of *Schedule or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Schedule.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ScheduleUpdateCall) Do() (*Schedule, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Schedule{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "teams/{teamId}/jobs/{jobId}/schedule", + // "request": { + // "$ref": "Schedule" + // }, + // "response": { + // "$ref": "Schedule" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/coordinate" + // ] + // } + +} + +// method id "coordinate.team.list": + +type TeamListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of teams for a user. +func (r *TeamService) List() *TeamListCall { + c := &TeamListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Admin sets the optional parameter "admin": Whether to include teams +// for which the user has the Admin role. +func (c *TeamListCall) Admin(admin bool) *TeamListCall { + c.opt_["admin"] = admin + return c +} + +// Dispatcher sets the optional parameter "dispatcher": Whether to +// include teams for which the user has the Dispatcher role. +func (c *TeamListCall) Dispatcher(dispatcher bool) *TeamListCall { + c.opt_["dispatcher"] = dispatcher + return c +} + +// Worker sets the optional parameter "worker": Whether to include teams +// for which the user has the Worker role. +func (c *TeamListCall) Worker(worker bool) *TeamListCall { + c.opt_["worker"] = worker + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TeamListCall) Fields(s ...googleapi.Field) *TeamListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TeamListCall) IfNoneMatch(entityTag string) *TeamListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TeamListCall) Context(ctx context.Context) *TeamListCall { + c.ctx_ = ctx + return c +} + +func (c *TeamListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["admin"]; ok { + params.Set("admin", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["dispatcher"]; ok { + params.Set("dispatcher", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["worker"]; ok { + params.Set("worker", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "teams") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "coordinate.team.list" call. +// Exactly one of *TeamListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TeamListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TeamListCall) Do() (*TeamListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TeamListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of teams for a user.", + // "httpMethod": "GET", + // "id": "coordinate.team.list", + // "parameters": { + // "admin": { + // "description": "Whether to include teams for which the user has the Admin role.", + // "location": "query", + // "type": "boolean" + // }, + // "dispatcher": { + // "description": "Whether to include teams for which the user has the Dispatcher role.", + // "location": "query", + // "type": "boolean" + // }, + // "worker": { + // "description": "Whether to include teams for which the user has the Worker role.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "teams", + // "response": { + // "$ref": "TeamListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/coordinate", + // "https://www.googleapis.com/auth/coordinate.readonly" + // ] + // } + +} + +// method id "coordinate.worker.list": + +type WorkerListCall struct { + s *Service + teamId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *WorkerListCall) Fields(s ...googleapi.Field) *WorkerListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *WorkerListCall) IfNoneMatch(entityTag string) *WorkerListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *WorkerListCall) Context(ctx context.Context) *WorkerListCall { + c.ctx_ = ctx + return c +} + +func (c *WorkerListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "teams/{teamId}/workers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "teamId": c.teamId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "coordinate.worker.list" call. +// Exactly one of *WorkerListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *WorkerListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *WorkerListCall) Do() (*WorkerListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &WorkerListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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": "teams/{teamId}/workers", + // "response": { + // "$ref": "WorkerListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/coordinate", + // "https://www.googleapis.com/auth/coordinate.readonly" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/customsearch/v1/customsearch-api.json b/Godeps/_workspace/src/google.golang.org/api/customsearch/v1/customsearch-api.json new file mode 100644 index 000000000..ce5e279ce --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/customsearch/v1/customsearch-api.json @@ -0,0 +1,814 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"FrPV2U6xXFUq8eRv_PO3IoAURkc/KsgpNVP8dzFmgPzAjDdH7uBJP_M\"", + "discoveryVersion": "v1", + "id": "customsearch:v1", + "name": "customsearch", + "version": "v1", + "revision": "20131205", + "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/Godeps/_workspace/src/google.golang.org/api/customsearch/v1/customsearch-gen.go b/Godeps/_workspace/src/google.golang.org/api/customsearch/v1/customsearch-gen.go new file mode 100644 index 000000000..be52fda6b --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/customsearch/v1/customsearch-gen.go @@ -0,0 +1,1343 @@ +// Package customsearch provides access to the CustomSearch API. +// +// See https://developers.google.com/custom-search/v1/using_rest +// +// Usage example: +// +// import "google.golang.org/api/customsearch/v1" +// ... +// customsearchService, err := customsearch.New(oauthHttpClient) +package customsearch // import "google.golang.org/api/customsearch/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Cse *CseService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Facets") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Context) MarshalJSON() ([]byte, error) { + type noMethod Context + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ContextFacetsItem struct { + Anchor string `json:"anchor,omitempty"` + + Label string `json:"label,omitempty"` + + LabelWithOp string `json:"label_with_op,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Anchor") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ContextFacetsItem) MarshalJSON() ([]byte, error) { + type noMethod ContextFacetsItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "BodyLines") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Promotion) MarshalJSON() ([]byte, error) { + type noMethod Promotion + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PromotionBodyLines struct { + HtmlTitle string `json:"htmlTitle,omitempty"` + + Link string `json:"link,omitempty"` + + Title string `json:"title,omitempty"` + + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "HtmlTitle") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PromotionBodyLines) MarshalJSON() ([]byte, error) { + type noMethod PromotionBodyLines + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PromotionImage struct { + Height int64 `json:"height,omitempty"` + + Source string `json:"source,omitempty"` + + Width int64 `json:"width,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PromotionImage) MarshalJSON() ([]byte, error) { + type noMethod PromotionImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Count") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Query) MarshalJSON() ([]byte, error) { + type noMethod Query + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "CacheId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Result) MarshalJSON() ([]byte, error) { + type noMethod Result + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "ByteSize") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResultImage) MarshalJSON() ([]byte, error) { + type noMethod ResultImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ResultLabels struct { + DisplayName string `json:"displayName,omitempty"` + + LabelWithOp string `json:"label_with_op,omitempty"` + + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResultLabels) MarshalJSON() ([]byte, error) { + type noMethod ResultLabels + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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 map[string][]Query `json:"queries,omitempty"` + + SearchInformation *SearchSearchInformation `json:"searchInformation,omitempty"` + + Spelling *SearchSpelling `json:"spelling,omitempty"` + + Url *SearchUrl `json:"url,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Context") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Search) MarshalJSON() ([]byte, error) { + type noMethod Search + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type SearchSearchInformation struct { + FormattedSearchTime string `json:"formattedSearchTime,omitempty"` + + FormattedTotalResults string `json:"formattedTotalResults,omitempty"` + + SearchTime float64 `json:"searchTime,omitempty"` + + TotalResults int64 `json:"totalResults,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "FormattedSearchTime") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchSearchInformation) MarshalJSON() ([]byte, error) { + type noMethod SearchSearchInformation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type SearchSpelling struct { + CorrectedQuery string `json:"correctedQuery,omitempty"` + + HtmlCorrectedQuery string `json:"htmlCorrectedQuery,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CorrectedQuery") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchSpelling) MarshalJSON() ([]byte, error) { + type noMethod SearchSpelling + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type SearchUrl struct { + Template string `json:"template,omitempty"` + + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Template") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchUrl) MarshalJSON() ([]byte, error) { + type noMethod SearchUrl + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "search.cse.list": + +type CseListCall struct { + s *Service + q string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "0" - Turns off duplicate content filter. +// "1" - Turns on 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. +// +// Possible values: +// "color" - color +// "gray" - gray +// "mono" - mono +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. +// +// Possible values: +// "black" - black +// "blue" - blue +// "brown" - brown +// "gray" - gray +// "green" - green +// "pink" - pink +// "purple" - purple +// "teal" - teal +// "white" - white +// "yellow" - yellow +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. +// +// Possible values: +// "huge" - huge +// "icon" - icon +// "large" - large +// "medium" - medium +// "small" - small +// "xlarge" - xlarge +// "xxlarge" - xxlarge +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. +// +// Possible values: +// "clipart" - clipart +// "face" - face +// "lineart" - lineart +// "news" - news +// "photo" - 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 +// +// Possible values: +// "lang_ar" - Arabic +// "lang_bg" - Bulgarian +// "lang_ca" - Catalan +// "lang_cs" - Czech +// "lang_da" - Danish +// "lang_de" - German +// "lang_el" - Greek +// "lang_en" - English +// "lang_es" - Spanish +// "lang_et" - Estonian +// "lang_fi" - Finnish +// "lang_fr" - French +// "lang_hr" - Croatian +// "lang_hu" - Hungarian +// "lang_id" - Indonesian +// "lang_is" - Icelandic +// "lang_it" - Italian +// "lang_iw" - Hebrew +// "lang_ja" - Japanese +// "lang_ko" - Korean +// "lang_lt" - Lithuanian +// "lang_lv" - Latvian +// "lang_nl" - Dutch +// "lang_no" - Norwegian +// "lang_pl" - Polish +// "lang_pt" - Portuguese +// "lang_ro" - Romanian +// "lang_ru" - Russian +// "lang_sk" - Slovak +// "lang_sl" - Slovenian +// "lang_sr" - Serbian +// "lang_sv" - Swedish +// "lang_tr" - Turkish +// "lang_zh-CN" - Chinese (Simplified) +// "lang_zh-TW" - Chinese (Traditional) +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 +// +// Possible values: +// "high" - Enables highest level of safe search filtering. +// "medium" - Enables moderate safe search filtering. +// "off" (default) - Disables safe search filtering. +func (c *CseListCall) Safe(safe string) *CseListCall { + c.opt_["safe"] = safe + return c +} + +// SearchType sets the optional parameter "searchType": Specifies the +// search type: image. +// +// Possible values: +// "image" - custom image search +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 +// +// Possible values: +// "e" - exclude +// "i" - include +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CseListCall) Fields(s ...googleapi.Field) *CseListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CseListCall) IfNoneMatch(entityTag string) *CseListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CseListCall) Context(ctx context.Context) *CseListCall { + c.ctx_ = ctx + return c +} + +func (c *CseListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "search.cse.list" call. +// Exactly one of *Search or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Search.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CseListCall) Do() (*Search, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Search{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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/Godeps/_workspace/src/google.golang.org/api/dataflow/v1b3/dataflow-api.json b/Godeps/_workspace/src/google.golang.org/api/dataflow/v1b3/dataflow-api.json new file mode 100644 index 000000000..91f6b9981 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/dataflow/v1b3/dataflow-api.json @@ -0,0 +1,2368 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/5KuD_AhxWtT--XElMYogfy5V-SU\"", + "discoveryVersion": "v1", + "id": "dataflow:v1b3", + "name": "dataflow", + "version": "v1b3", + "revision": "20150401", + "title": "Google Dataflow API", + "description": "Google Dataflow 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://cloud.google.com/dataflow", + "protocol": "rest", + "baseUrl": "https://dataflow.googleapis.com/", + "basePath": "/", + "rootUrl": "https://dataflow.googleapis.com/", + "servicePath": "", + "batchPath": "batch", + "parameters": { + "access_token": { + "type": "string", + "description": "OAuth access token.", + "location": "query" + }, + "alt": { + "type": "string", + "description": "Data format for response.", + "default": "json", + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query" + }, + "bearer_token": { + "type": "string", + "description": "OAuth bearer token.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JSONP", + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "pp": { + "type": "boolean", + "description": "Pretty-print response.", + "default": "true", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query" + }, + "upload_protocol": { + "type": "string", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query" + }, + "uploadType": { + "type": "string", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query" + }, + "$.xgafv": { + "type": "string", + "description": "V1 error format.", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/userinfo.email": { + "description": "View your email address" + } + } + } + }, + "schemas": { + "Job": { + "id": "Job", + "type": "object", + "description": "Defines a job to be run by the Dataflow service.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of this job. This field is set by the Dataflow service when the Job is created, and is immutable for the life of the Job." + }, + "projectId": { + "type": "string", + "description": "The project which owns the job." + }, + "name": { + "type": "string", + "description": "The user-specified Dataflow job name. Only one Job with a given name may exist in a project at any given time. If a caller attempts to create a Job with the same name as an already-existing Job, the attempt will return the existing Job. The name must match the regular expression [a-z]([-a-z0-9]{0,38}[a-z0-9])?" + }, + "type": { + "type": "string", + "description": "The type of dataflow job.", + "enum": [ + "JOB_TYPE_UNKNOWN", + "JOB_TYPE_BATCH", + "JOB_TYPE_STREAMING" + ] + }, + "environment": { + "$ref": "Environment", + "description": "Environment for the job." + }, + "steps": { + "type": "array", + "description": "The top-level steps that constitute the entire job.", + "items": { + "$ref": "Step" + } + }, + "currentState": { + "type": "string", + "description": "The current state of the job. Jobs are created in the JOB_STATE_STOPPED state unless otherwise specified. A job in the JOB_STATE_RUNNING state may asynchronously enter a terminal state. Once a job has reached a terminal state, no further state updates may be made. This field may be mutated by the Dataflow service; callers cannot mutate it.", + "enum": [ + "JOB_STATE_UNKNOWN", + "JOB_STATE_STOPPED", + "JOB_STATE_RUNNING", + "JOB_STATE_DONE", + "JOB_STATE_FAILED", + "JOB_STATE_CANCELLED", + "JOB_STATE_UPDATED" + ] + }, + "currentStateTime": { + "type": "string", + "description": "The timestamp associated with the current state." + }, + "requestedState": { + "type": "string", + "description": "The job's requested state. UpdateJob may be used to switch between the JOB_STATE_STOPPED and JOB_STATE_RUNNING states, by setting requested_state. UpdateJob may also be used to directly set a job's requested state to JOB_STATE_CANCELLED or JOB_STATE_DONE, irrevocably terminating the job if it has not already reached a terminal state.", + "enum": [ + "JOB_STATE_UNKNOWN", + "JOB_STATE_STOPPED", + "JOB_STATE_RUNNING", + "JOB_STATE_DONE", + "JOB_STATE_FAILED", + "JOB_STATE_CANCELLED", + "JOB_STATE_UPDATED" + ] + }, + "executionInfo": { + "$ref": "JobExecutionInfo", + "description": "Information about how the Dataflow service will actually run the job." + }, + "createTime": { + "type": "string", + "description": "Timestamp when job was initially created. Immutable, set by the Dataflow service." + }, + "replaceJobId": { + "type": "string", + "description": "If this job is an update of an existing job, this field will be the ID of the job it replaced. When sending a CreateJobRequest, you can update a job by specifying it here. The job named here will be stopped, and its intermediate state transferred to this job." + }, + "transformNameMapping": { + "type": "object", + "description": "Map of transform name prefixes of the job to be replaced to the corresponding name prefixes of the new job.", + "additionalProperties": { + "type": "string" + } + }, + "clientRequestId": { + "type": "string", + "description": "Client's unique identifier of the job, re-used by SDK across retried attempts. If this field is set, the service will ensure its uniqueness. That is, the request to create a job will fail if the service has knowledge of a previously submitted job with the same client's id and job name. The caller may, for example, use this field to ensure idempotence of job creation across retried attempts to create a job. By default, the field is empty and, in that case, the service ignores it." + }, + "replacedByJobId": { + "type": "string", + "description": "If another job is an update of this job (and thus, this job is in JOB_STATE_UPDATED), this field will contain the ID of that job." + } + } + }, + "Environment": { + "id": "Environment", + "type": "object", + "description": "Describes the environment in which a Dataflow Job runs.", + "properties": { + "tempStoragePrefix": { + "type": "string", + "description": "The prefix of the resources the system should use for temporary storage. The system will append the suffix \"/temp-{JOBNAME} to this resource prefix, where {JOBNAME} is the value of the job_name field. The resulting bucket and object prefix is used as the prefix of the resources used to store temporary data needed during the job execution. NOTE: This will override the value in taskrunner_settings. The supported resource type is: Google Cloud Storage: storage.googleapis.com/{bucket}/{object} bucket.storage.googleapis.com/{object}" + }, + "clusterManagerApiService": { + "type": "string", + "description": "The type of cluster manager API to use. If unknown or unspecified, the service will attempt to choose a reasonable default. This should be in the form of the API service name, e.g. \"compute.googleapis.com\"." + }, + "experiments": { + "type": "array", + "description": "The list of experiments to enable.", + "items": { + "type": "string" + } + }, + "workerPools": { + "type": "array", + "description": "Worker pools. At least one \"harness\" worker pool must be specified in order for the job to have workers.", + "items": { + "$ref": "WorkerPool" + } + }, + "userAgent": { + "type": "object", + "description": "A description of the process that generated the request.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + } + }, + "version": { + "type": "object", + "description": "A structure describing which components and their versions of the service are required in order to run the job.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + } + }, + "dataset": { + "type": "string", + "description": "The dataset for the current project where various workflow related tables are stored. The supported resource type is: Google BigQuery: bigquery.googleapis.com/{dataset}" + }, + "sdkPipelineOptions": { + "type": "object", + "description": "The Dataflow SDK pipeline options specified by the user. These options are passed through the service and are used to recreate the SDK pipeline options on the worker in a language agnostic and platform independent way.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + } + }, + "internalExperiments": { + "type": "object", + "description": "Experimental settings.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @ype with type URL." + } + } + } + }, + "WorkerPool": { + "id": "WorkerPool", + "type": "object", + "description": "Describes one particular pool of Dataflow workers to be instantiated by the Dataflow service in order to perform the computations required by a job. Note that a workflow job may use multiple pools, in order to match the various computational requirements of the various stages of the job.", + "properties": { + "kind": { + "type": "string", + "description": "The kind of the worker pool; currently only 'harness' and 'shuffle' are supported." + }, + "numWorkers": { + "type": "integer", + "description": "Number of Google Compute Engine workers in this pool needed to execute the job. If zero or unspecified, the service will attempt to choose a reasonable default.", + "format": "int32" + }, + "packages": { + "type": "array", + "description": "Packages to be installed on workers.", + "items": { + "$ref": "Package" + } + }, + "defaultPackageSet": { + "type": "string", + "description": "The default package set to install. This allows the service to select a default set of packages which are useful to worker harnesses written in a particular language.", + "enum": [ + "DEFAULT_PACKAGE_SET_UNKNOWN", + "DEFAULT_PACKAGE_SET_NONE", + "DEFAULT_PACKAGE_SET_JAVA", + "DEFAULT_PACKAGE_SET_PYTHON" + ] + }, + "machineType": { + "type": "string", + "description": "Machine type (e.g. \"n1-standard-1\"). If empty or unspecified, the service will attempt to choose a reasonable default." + }, + "teardownPolicy": { + "type": "string", + "description": "Sets the policy for determining when to turndown worker pool. Allowed values are: TEARDOWN_ALWAYS, TEARDOWN_ON_SUCCESS, and TEARDOWN_NEVER. TEARDOWN_ALWAYS means workers are always torn down regardless of whether the job succeeds. TEARDOWN_ON_SUCCESS means workers are torn down if the job succeeds. TEARDOWN_NEVER means the workers are never torn down. If the workers are not torn down by the service, they will continue to run and use Google Compute Engine VM resources in the user's project until they are explicitly terminated by the user. Because of this, Google recommends using the TEARDOWN_ALWAYS policy except for small, manually supervised test jobs. If unknown or unspecified, the service will attempt to choose a reasonable default.", + "enum": [ + "TEARDOWN_POLICY_UNKNOWN", + "TEARDOWN_ALWAYS", + "TEARDOWN_ON_SUCCESS", + "TEARDOWN_NEVER" + ] + }, + "diskSizeGb": { + "type": "integer", + "description": "Size of root disk for VMs, in GB. If zero or unspecified, the service will attempt to choose a reasonable default.", + "format": "int32" + }, + "diskType": { + "type": "string", + "description": "Type of root disk for VMs. If empty or unspecified, the service will attempt to choose a reasonable default." + }, + "diskSourceImage": { + "type": "string", + "description": "Fully qualified source image for disks." + }, + "zone": { + "type": "string", + "description": "Zone to run the worker pools in (e.g. \"us-central1-b\"). If empty or unspecified, the service will attempt to choose a reasonable default." + }, + "taskrunnerSettings": { + "$ref": "TaskRunnerSettings", + "description": "Settings passed through to Google Compute Engine workers when using the standard Dataflow task runner. Users should ignore this field." + }, + "onHostMaintenance": { + "type": "string", + "description": "The action to take on host maintenance, as defined by the Google Compute Engine API." + }, + "dataDisks": { + "type": "array", + "description": "Data disks that are used by a VM in this workflow.", + "items": { + "$ref": "Disk" + } + }, + "metadata": { + "type": "object", + "description": "Metadata to set on the Google Compute Engine VMs.", + "additionalProperties": { + "type": "string" + } + }, + "autoscalingSettings": { + "$ref": "AutoscalingSettings", + "description": "Settings for autoscaling of this WorkerPool." + }, + "poolArgs": { + "type": "object", + "description": "Extra arguments for this worker pool.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @ype with type URL." + } + }, + "network": { + "type": "string", + "description": "Network to which VMs will be assigned. If empty or unspecified, the service will use the network \"default\"." + } + } + }, + "Package": { + "id": "Package", + "type": "object", + "description": "Packages that need to be installed in order for a worker to run the steps of the Dataflow job which will be assigned to its worker pool. This is the mechanism by which the SDK causes code to be loaded onto the workers. For example, the Dataflow Java SDK might use this to install jars containing the user's code and all of the various dependencies (libraries, data files, etc) required in order for that code to run.", + "properties": { + "name": { + "type": "string", + "description": "The name of the package." + }, + "location": { + "type": "string", + "description": "The resource to read the package from. The supported resource type is: Google Cloud Storage: storage.googleapis.com/{bucket} bucket.storage.googleapis.com/" + } + } + }, + "TaskRunnerSettings": { + "id": "TaskRunnerSettings", + "type": "object", + "description": "Taskrunner configuration settings.", + "properties": { + "taskUser": { + "type": "string", + "description": "The UNIX user ID on the worker VM to use for tasks launched by taskrunner; e.g. \"root\"." + }, + "taskGroup": { + "type": "string", + "description": "The UNIX group ID on the worker VM to use for tasks launched by taskrunner; e.g. \"wheel\"." + }, + "oauthScopes": { + "type": "array", + "description": "OAuth2 scopes to be requested by the taskrunner in order to access the dataflow API.", + "items": { + "type": "string" + } + }, + "baseUrl": { + "type": "string", + "description": "The base URL for the taskrunner to use when accessing Google Cloud APIs. When workers access Google Cloud APIs, they logically do so via relative URLs. If this field is specified, it supplies the base URL to use for resolving these relative URLs. The normative algorithm used is defined by RFC 1808, \"Relative Uniform Resource Locators\". If not specified, the default value is \"http://www.googleapis.com/\"" + }, + "dataflowApiVersion": { + "type": "string", + "description": "API version of endpoint, e.g. \"v1b3\"" + }, + "parallelWorkerSettings": { + "$ref": "WorkerSettings", + "description": "Settings to pass to the parallel worker harness." + }, + "baseTaskDir": { + "type": "string", + "description": "Location on the worker for task-specific subdirectories." + }, + "continueOnException": { + "type": "boolean", + "description": "Do we continue taskrunner if an exception is hit?" + }, + "logToSerialconsole": { + "type": "boolean", + "description": "Send taskrunner log into to Google Compute Engine VM serial console?" + }, + "alsologtostderr": { + "type": "boolean", + "description": "Also send taskrunner log info to stderr?" + }, + "logUploadLocation": { + "type": "string", + "description": "Indicates where to put logs. If this is not specified, the logs will not be uploaded. The supported resource type is: Google Cloud Storage: storage.googleapis.com/{bucket}/{object} bucket.storage.googleapis.com/{object}" + }, + "logDir": { + "type": "string", + "description": "Directory on the VM to store logs." + }, + "tempStoragePrefix": { + "type": "string", + "description": "The prefix of the resources the taskrunner should use for temporary storage. The supported resource type is: Google Cloud Storage: storage.googleapis.com/{bucket}/{object} bucket.storage.googleapis.com/{object}" + }, + "harnessCommand": { + "type": "string", + "description": "Command to launch the worker harness." + }, + "workflowFileName": { + "type": "string", + "description": "Store the workflow in this file." + }, + "commandlinesFileName": { + "type": "string", + "description": "Store preprocessing commands in this file." + }, + "vmId": { + "type": "string", + "description": "ID string of VM." + }, + "languageHint": { + "type": "string", + "description": "Suggested backend language." + }, + "streamingWorkerMainClass": { + "type": "string", + "description": "Streaming worker main class name." + } + } + }, + "WorkerSettings": { + "id": "WorkerSettings", + "type": "object", + "description": "Provides data to pass through to the worker harness.", + "properties": { + "baseUrl": { + "type": "string", + "description": "The base URL for accessing Google Cloud APIs. When workers access Google Cloud APIs, they logically do so via relative URLs. If this field is specified, it supplies the base URL to use for resolving these relative URLs. The normative algorithm used is defined by RFC 1808, \"Relative Uniform Resource Locators\". If not specified, the default value is \"http://www.googleapis.com/\"" + }, + "reportingEnabled": { + "type": "boolean", + "description": "Send work progress updates to service." + }, + "servicePath": { + "type": "string", + "description": "The Dataflow service path relative to the root URL, for example, \"dataflow/v1b3/projects\"." + }, + "shuffleServicePath": { + "type": "string", + "description": "The Shuffle service path relative to the root URL, for example, \"shuffle/v1beta1\"." + }, + "workerId": { + "type": "string", + "description": "ID of the worker running this pipeline." + }, + "tempStoragePrefix": { + "type": "string", + "description": "The prefix of the resources the system should use for temporary storage. The supported resource type is: Google Cloud Storage: storage.googleapis.com/{bucket}/{object} bucket.storage.googleapis.com/{object}" + } + } + }, + "Disk": { + "id": "Disk", + "type": "object", + "description": "Describes the data disk used by a workflow job.", + "properties": { + "sizeGb": { + "type": "integer", + "description": "Size of disk in GB. If zero or unspecified, the service will attempt to choose a reasonable default.", + "format": "int32" + }, + "diskType": { + "type": "string", + "description": "Disk storage type, as defined by Google Compute Engine. This must be a disk type appropriate to the project and zone in which the workers will run. If unknown or unspecified, the service will attempt to choose a reasonable default. For example, the standard persistent disk type is a resource name typically ending in \"pd-standard\". If SSD persistent disks are available, the resource name typically ends with \"pd-ssd\". The actual valid values are defined the Google Compute Engine API, not by the Dataflow API; consult the Google Compute Engine documentation for more information about determining the set of available disk types for a particular project and zone. Google Compute Engine Disk types are local to a particular project in a particular zone, and so the resource name will typically look something like this: compute.googleapis.com/projects/\n/zones//diskTypes/pd-standard" + }, + "mountPoint": { + "type": "string", + "description": "Directory in a VM where disk is mounted." + } + } + }, + "AutoscalingSettings": { + "id": "AutoscalingSettings", + "type": "object", + "description": "Settings for WorkerPool autoscaling.", + "properties": { + "algorithm": { + "type": "string", + "description": "The algorithm to use for autoscaling.", + "enum": [ + "AUTOSCALING_ALGORITHM_UNKNOWN", + "AUTOSCALING_ALGORITHM_NONE", + "AUTOSCALING_ALGORITHM_BASIC" + ] + }, + "maxNumWorkers": { + "type": "integer", + "description": "The maximum number of workers to cap scaling at.", + "format": "int32" + } + } + }, + "Step": { + "id": "Step", + "type": "object", + "description": "Defines a particular step within a Dataflow job. A job consists of multiple steps, each of which performs some specific operation as part of the overall job. Data is typically passed from one step to another as part of the job. Here's an example of a sequence of steps which together implement a Map-Reduce job: * Read a collection of data from some source, parsing the collection's elements. * Validate the elements. * Apply a user-defined function to map each element to some value and extract an element-specific key value. * Group elements with the same key into a single element with that key, transforming a multiply-keyed collection into a uniquely-keyed collection. * Write the elements out to some data sink. (Note that the Dataflow service may be used to run many different types of jobs, not just Map-Reduce).", + "properties": { + "kind": { + "type": "string", + "description": "The kind of step in the dataflow Job." + }, + "name": { + "type": "string", + "description": "Name identifying the step. This must be unique for each step with respect to all other steps in the dataflow Job." + }, + "properties": { + "type": "object", + "description": "Named properties associated with the step. Each kind of predefined step has its own required set of properties.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + } + } + } + }, + "JobExecutionInfo": { + "id": "JobExecutionInfo", + "type": "object", + "description": "Additional information about how a Dataflow job will be executed which isn’t contained in the submitted job.", + "properties": { + "stages": { + "type": "object", + "description": "A mapping from each stage to the information about that stage.", + "additionalProperties": { + "$ref": "JobExecutionStageInfo" + } + } + } + }, + "JobExecutionStageInfo": { + "id": "JobExecutionStageInfo", + "type": "object", + "description": "Contains information about how a particular [google.dataflow.v1beta3.Step][google.dataflow.v1beta3.Step] will be executed.", + "properties": { + "stepName": { + "type": "array", + "description": "The steps associated with the execution stage. Note that stages may have several steps, and that a given step might be run by more than one stage.", + "items": { + "type": "string" + } + } + } + }, + "ListJobsResponse": { + "id": "ListJobsResponse", + "type": "object", + "description": "Response to a request to list Dataflow jobs. This may be a partial response, depending on the page size in the ListJobsRequest.", + "properties": { + "jobs": { + "type": "array", + "description": "A subset of the requested job information.", + "items": { + "$ref": "Job" + } + }, + "nextPageToken": { + "type": "string", + "description": "Set if there may be more results than fit in this response." + } + } + }, + "ListJobMessagesResponse": { + "id": "ListJobMessagesResponse", + "type": "object", + "description": "Response to a request to list job messages.", + "properties": { + "jobMessages": { + "type": "array", + "description": "Messages in ascending timestamp order.", + "items": { + "$ref": "JobMessage" + } + }, + "nextPageToken": { + "type": "string", + "description": "The token to obtain the next page of results if there are more." + } + } + }, + "JobMessage": { + "id": "JobMessage", + "type": "object", + "description": "A particular message pertaining to a Dataflow job.", + "properties": { + "id": { + "type": "string", + "description": "Identifies the message. This is automatically generated by the service; the caller should treat it as an opaque string." + }, + "time": { + "type": "string", + "description": "The timestamp of the message." + }, + "messageText": { + "type": "string", + "description": "The text of the message." + }, + "messageImportance": { + "type": "string", + "description": "Importance level of the message.", + "enum": [ + "JOB_MESSAGE_IMPORTANCE_UNKNOWN", + "JOB_MESSAGE_DEBUG", + "JOB_MESSAGE_DETAILED", + "JOB_MESSAGE_BASIC", + "JOB_MESSAGE_WARNING", + "JOB_MESSAGE_ERROR" + ] + } + } + }, + "JobMetrics": { + "id": "JobMetrics", + "type": "object", + "description": "JobMetrics contains a collection of metrics descibing the detailed progress of a Dataflow job. Metrics correspond to user-defined and system-defined metrics in the job. This resource captures only the most recent values of each metric; time-series data can be queried for them (under the same metric names) from Cloud Monitoring.", + "properties": { + "metricTime": { + "type": "string", + "description": "Timestamp as of which metric values are current." + }, + "metrics": { + "type": "array", + "description": "All metrics for this job.", + "items": { + "$ref": "MetricUpdate" + } + } + } + }, + "MetricUpdate": { + "id": "MetricUpdate", + "type": "object", + "description": "Describes the state of a metric.", + "properties": { + "name": { + "$ref": "MetricStructuredName", + "description": "Name of the metric." + }, + "kind": { + "type": "string", + "description": "Metric aggregation kind. The possible metric aggregation kinds are \"Sum\", \"Max\", \"Min\", \"Mean\", \"Set\", \"And\", and \"Or\". The specified aggregation kind is case-insensitive. If omitted, this is not an aggregated value but instead a single metric sample value." + }, + "cumulative": { + "type": "boolean", + "description": "True if this metric is reported as the total cumulative aggregate value accumulated since the worker started working on this WorkItem. By default this is false, indicating that this metric is reported as a delta that is not associated with any WorkItem." + }, + "scalar": { + "type": "any", + "description": "Worker-computed aggregate value for aggregation kinds \"Sum\", \"Max\", \"Min\", \"And\", and \"Or\". The possible value types are Long, Double, and Boolean." + }, + "meanSum": { + "type": "any", + "description": "Worker-computed aggregate value for the \"Mean\" aggregation kind. This holds the sum of the aggregated values and is used in combination with mean_count below to obtain the actual mean aggregate value. The only possible value types are Long and Double." + }, + "meanCount": { + "type": "any", + "description": "Worker-computed aggregate value for the \"Mean\" aggregation kind. This holds the count of the aggregated values and is used in combination with mean_sum above to obtain the actual mean aggregate value. The only possible value type is Long." + }, + "set": { + "type": "any", + "description": "Worker-computed aggregate value for the \"Set\" aggregation kind. The only possible value type is a list of Values whose type can be Long, Double, or String, according to the metric's type. All Values in the list must be of the same type." + }, + "internal": { + "type": "any", + "description": "Worker-computed aggregate value for internal use by the Dataflow service." + }, + "updateTime": { + "type": "string", + "description": "Timestamp associated with the metric value. Optional when workers are reporting work progress; it will be filled in responses from the metrics API." + } + } + }, + "MetricStructuredName": { + "id": "MetricStructuredName", + "type": "object", + "description": "Identifies a metric, by describing the source which generated the metric.", + "properties": { + "origin": { + "type": "string", + "description": "Origin (namespace) of metric name. May be blank for user-define metrics; will be \"dataflow\" for metrics defined by the Dataflow service or SDK." + }, + "name": { + "type": "string", + "description": "Worker-defined metric name." + }, + "context": { + "type": "object", + "description": "Zero or more labeled fields which identify the part of the job this metric is associated with, such as the name of a step or collection. For example, built-in counters associated with steps will have context['step'] = . Counters associated with PCollections in the SDK will have context['pcollection'] =\n.", + "additionalProperties": { + "type": "string" + } + } + } + }, + "ReportWorkItemStatusRequest": { + "id": "ReportWorkItemStatusRequest", + "type": "object", + "description": "Request to report the status of WorkItems.", + "properties": { + "workerId": { + "type": "string", + "description": "The ID of the worker reporting the WorkItem status. If this does not match the ID of the worker which the Dataflow service believes currently has the lease on the WorkItem, the report will be dropped (with an error response)." + }, + "workItemStatuses": { + "type": "array", + "description": "The order is unimportant, except that the order of the WorkItemServiceState messages in the ReportWorkItemStatusResponse corresponds to the order of WorkItemStatus messages here.", + "items": { + "$ref": "WorkItemStatus" + } + }, + "currentWorkerTime": { + "type": "string", + "description": "The current timestamp at the worker." + } + } + }, + "WorkItemStatus": { + "id": "WorkItemStatus", + "type": "object", + "description": "Conveys a worker's progress through the work described by a WorkItem.", + "properties": { + "workItemId": { + "type": "string", + "description": "Identifies the WorkItem." + }, + "reportIndex": { + "type": "string", + "description": "The report index. When a WorkItem is leased, the lease will contain an initial report index. When a WorkItem's status is reported to the system, the report should be sent with that report index, and the response will contain the index the worker should use for the next report. Reports received with unexpected index values will be rejected by the service. In order to preserve idempotency, the worker should not alter the contents of a report, even if the worker must submit the same report multiple times before getting back a response. The worker should not submit a subsequent report until the response for the previous report had been received from the service.", + "format": "int64" + }, + "requestedLeaseDuration": { + "type": "string", + "description": "Amount of time the worker requests for its lease." + }, + "completed": { + "type": "boolean", + "description": "True if the WorkItem was completed (successfully or unsuccessfully)." + }, + "errors": { + "type": "array", + "description": "Specifies errors which occurred during processing. If errors are provided, and completed = true, then the WorkItem is considered to have failed.", + "items": { + "$ref": "Status" + } + }, + "metricUpdates": { + "type": "array", + "description": "Worker output metrics (counters) for this WorkItem.", + "items": { + "$ref": "MetricUpdate" + } + }, + "progress": { + "$ref": "ApproximateProgress", + "description": "The WorkItem's approximate progress." + }, + "stopPosition": { + "$ref": "Position", + "description": "A worker may split an active map task in two parts, \"primary\" and \"residual\", continuing to process the primary part and returning the residual part into the pool of available work. This event is called a \"dynamic split\" and is critical to the dynamic work rebalancing feature. The two obtained sub-tasks are called \"parts\" of the split. The parts, if concatenated, must represent the same input as would be read by the current task if the split did not happen. The exact way in which the original task is decomposed into the two parts is specified either as a position demarcating them (stop_position), or explicitly as two DerivedSources, if this task consumes a user-defined source type (dynamic_source_split). The \"current\" task is adjusted as a result of the split: after a task with range [A, B) sends a stop_position update at C, its range is considered to be [A, C), e.g.: * Progress should be interpreted relative to the new range, e.g. \"75% completed\" means \"75% of [A, C) completed\" * The worker should interpret proposed_stop_position relative to the new range, e.g. \"split at 68%\" should be interpreted as \"split at 68% of [A, C)\". * If the worker chooses to split again using stop_position, only stop_positions in [A, C) will be accepted. * Etc. dynamic_source_split has similar semantics: e.g., if a task with source S splits using dynamic_source_split into {P, R} (where P and R must be together equivalent to S), then subsequent progress and proposed_stop_position should be interpreted relative to P, and in a potential subsequent dynamic_source_split into {P', R'}, P' and R' must be together equivalent to P, etc." + }, + "dynamicSourceSplit": { + "$ref": "DynamicSourceSplit", + "description": "See documentation of stop_position." + }, + "sourceOperationResponse": { + "$ref": "SourceOperationResponse", + "description": "If the work item represented a SourceOperationRequest, and the work is completed, contains the result of the operation." + }, + "sourceFork": { + "$ref": "SourceFork", + "description": "DEPRECATED in favor of dynamic_source_split." + } + } + }, + "Status": { + "id": "Status", + "type": "object", + "description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). The error model is designed to be: - Simple to use and understand for most users - Flexible enough to meet unexpected needs # Overview The `Status` message contains three pieces of data: error code, error message, and error details. The error code should be an enum value of [google.rpc.Code][], but it may accept additional error codes if needed. The error message should be a developer-facing English message that helps developers *understand* and *resolve* the error. If a localized user-facing error message is needed, put the localized message in the error details or localize it in the client. The optional error details may contain arbitrary information about the error. There is a predefined set of error detail types in the package `google.rpc` which can be used for common error conditions. # Language mapping The `Status` message is the logical representation of the error model, but it is not necessarily the actual wire format. When the `Status` message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C. # Other uses The error model and the `Status` message can be used in a variety of environments, either with or without APIs, to provide a consistent developer experience across different environments. Example uses of this error model include: - Partial errors. If a service needs to return partial errors to the client, it may embed the `Status` in the normal response to indicate the partial errors. - Workflow errors. A typical workflow has multiple steps. Each step may have a `Status` message for error reporting purpose. - Batch operations. If a client uses batch request and batch response, the `Status` message should be used directly inside batch response, one for each error sub-response. - Asynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the `Status` message. - Logging. If some API errors are stored in logs, the message `Status` could be used directly after any stripping needed for security/privacy reasons.", + "properties": { + "code": { + "type": "integer", + "description": "The status code, which should be an enum value of [google.rpc.Code][].", + "format": "int32" + }, + "message": { + "type": "string", + "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client." + }, + "details": { + "type": "array", + "description": "A list of messages that carry the error details. There will be a common set of message types for APIs to use.", + "items": { + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @ype with type URL." + } + } + } + } + }, + "ApproximateProgress": { + "id": "ApproximateProgress", + "type": "object", + "description": "A progress measurement of a WorkItem by a worker.", + "properties": { + "position": { + "$ref": "Position", + "description": "A Position within the work to represent a progress." + }, + "percentComplete": { + "type": "number", + "description": "Completion as percentage of the work, from 0.0 (beginning, nothing complete), to 1.0 (end of the work range, entire WorkItem complete).", + "format": "float" + }, + "remainingTime": { + "type": "string", + "description": "Completion as an estimated time remaining." + } + } + }, + "Position": { + "id": "Position", + "type": "object", + "description": "Position defines a position within a collection of data. The value can be either the end position, a key (used with ordered collections), a byte offset, or a record index.", + "properties": { + "end": { + "type": "boolean", + "description": "Position is past all other positions. Also useful for the end position of an unbounded range." + }, + "key": { + "type": "string", + "description": "Position is a string key, ordered lexicographically." + }, + "byteOffset": { + "type": "string", + "description": "Position is a byte offset.", + "format": "int64" + }, + "recordIndex": { + "type": "string", + "description": "Position is a record index.", + "format": "int64" + }, + "shufflePosition": { + "type": "string", + "description": "CloudPosition is a base64 encoded BatchShufflePosition (with FIXED sharding)." + }, + "concatPosition": { + "$ref": "ConcatPosition", + "description": "CloudPosition is a concat position." + } + } + }, + "ConcatPosition": { + "id": "ConcatPosition", + "type": "object", + "description": "A position that encapsulates an inner position and an index for the inner position. A ConcatPosition can be used by a reader of a source that encapsulates a set of other sources.", + "properties": { + "index": { + "type": "integer", + "description": "Index of the inner source.", + "format": "int32" + }, + "position": { + "$ref": "Position", + "description": "Position within the inner source." + } + } + }, + "DynamicSourceSplit": { + "id": "DynamicSourceSplit", + "type": "object", + "description": "When a task splits using WorkItemStatus.dynamic_source_split, this message describes the two parts of the split relative to the description of the current task's input.", + "properties": { + "primary": { + "$ref": "DerivedSource", + "description": "Primary part (continued to be processed by worker). Specified relative to the previously-current source. Becomes current." + }, + "residual": { + "$ref": "DerivedSource", + "description": "Residual part (returned to the pool of work). Specified relative to the previously-current source." + } + } + }, + "DerivedSource": { + "id": "DerivedSource", + "type": "object", + "description": "Specification of one of the bundles produced as a result of splitting a Source (e.g. when executing a SourceSplitRequest, or when splitting an active task using WorkItemStatus.dynamic_source_split), relative to the source being split.", + "properties": { + "source": { + "$ref": "Source", + "description": "Specification of the source." + }, + "derivationMode": { + "type": "string", + "description": "What source to base the produced source on (if any).", + "enum": [ + "SOURCE_DERIVATION_MODE_UNKNOWN", + "SOURCE_DERIVATION_MODE_INDEPENDENT", + "SOURCE_DERIVATION_MODE_CHILD_OF_CURRENT", + "SOURCE_DERIVATION_MODE_SIBLING_OF_CURRENT" + ] + } + } + }, + "Source": { + "id": "Source", + "type": "object", + "description": "A source that records can be read and decoded from.", + "properties": { + "spec": { + "type": "object", + "description": "The source to read from, plus its parameters.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + } + }, + "codec": { + "type": "object", + "description": "The codec to use to decode data read from the source.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + } + }, + "baseSpecs": { + "type": "array", + "description": "While splitting, sources may specify the produced bundles as differences against another source, in order to save backend-side memory and allow bigger jobs. For details, see SourceSplitRequest. To support this use case, the full set of parameters of the source is logically obtained by taking the latest explicitly specified value of each parameter in the order: base_specs (later items win), spec (overrides anything in base_specs).", + "items": { + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + } + } + }, + "metadata": { + "$ref": "SourceMetadata", + "description": "Optionally, metadata for this source can be supplied right away, avoiding a SourceGetMetadataOperation roundtrip (see SourceOperationRequest). This field is meaningful only in the Source objects populated by the user (e.g. when filling in a DerivedSource). Source objects supplied by the framework to the user don't have this field populated." + }, + "doesNotNeedSplitting": { + "type": "boolean", + "description": "Setting this value to true hints to the framework that the source doesn't need splitting, and using SourceSplitRequest on it would yield SOURCE_SPLIT_OUTCOME_USE_CURRENT. E.g. a file splitter may set this to true when splitting a single file into a set of byte ranges of appropriate size, and set this to false when splitting a filepattern into individual files. However, for efficiency, a file splitter may decide to produce file subranges directly from the filepattern to avoid a splitting round-trip. See SourceSplitRequest for an overview of the splitting process. This field is meaningful only in the Source objects populated by the user (e.g. when filling in a DerivedSource). Source objects supplied by the framework to the user don't have this field populated." + } + } + }, + "SourceMetadata": { + "id": "SourceMetadata", + "type": "object", + "description": "Metadata about a Source useful for automatically optimizing and tuning the pipeline, etc.", + "properties": { + "producesSortedKeys": { + "type": "boolean", + "description": "Whether this source is known to produce key/value pairs with the (encoded) keys in lexicographically sorted order." + }, + "infinite": { + "type": "boolean", + "description": "Specifies that the size of this source is known to be infinite (this is a streaming source)." + }, + "estimatedSizeBytes": { + "type": "string", + "description": "An estimate of the total size (in bytes) of the data that would be read from this source. This estimate is in terms of external storage size, before any decompression or other processing done by the reader.", + "format": "int64" + } + } + }, + "SourceOperationResponse": { + "id": "SourceOperationResponse", + "type": "object", + "description": "The result of a SourceOperationRequest, specified in ReportWorkItemStatusRequest.source_operation when the work item is completed.", + "properties": { + "split": { + "$ref": "SourceSplitResponse", + "description": "A response to a request to split a source." + }, + "getMetadata": { + "$ref": "SourceGetMetadataResponse", + "description": "A response to a request to get metadata about a source." + } + } + }, + "SourceSplitResponse": { + "id": "SourceSplitResponse", + "type": "object", + "description": "The response to a SourceSplitRequest.", + "properties": { + "outcome": { + "type": "string", + "description": "Indicates whether splitting happened and produced a list of bundles. If this is USE_CURRENT_SOURCE_AS_IS, the current source should be processed \"as is\" without splitting. \"bundles\" is ignored in this case. If this is SPLITTING_HAPPENED, then \"bundles\" contains a list of bundles into which the source was split.", + "enum": [ + "SOURCE_SPLIT_OUTCOME_UNKNOWN", + "SOURCE_SPLIT_OUTCOME_USE_CURRENT", + "SOURCE_SPLIT_OUTCOME_SPLITTING_HAPPENED" + ] + }, + "bundles": { + "type": "array", + "description": "If outcome is SPLITTING_HAPPENED, then this is a list of bundles into which the source was split. Otherwise this field is ignored. This list can be empty, which means the source represents an empty input.", + "items": { + "$ref": "DerivedSource" + } + }, + "shards": { + "type": "array", + "description": "DEPRECATED in favor of bundles.", + "items": { + "$ref": "SourceSplitShard" + } + } + } + }, + "SourceSplitShard": { + "id": "SourceSplitShard", + "type": "object", + "description": "DEPRECATED in favor of DerivedSource.", + "properties": { + "source": { + "$ref": "Source", + "description": "DEPRECATED" + }, + "derivationMode": { + "type": "string", + "description": "DEPRECATED", + "enum": [ + "SOURCE_DERIVATION_MODE_UNKNOWN", + "SOURCE_DERIVATION_MODE_INDEPENDENT", + "SOURCE_DERIVATION_MODE_CHILD_OF_CURRENT", + "SOURCE_DERIVATION_MODE_SIBLING_OF_CURRENT" + ] + } + } + }, + "SourceGetMetadataResponse": { + "id": "SourceGetMetadataResponse", + "type": "object", + "description": "The result of a SourceGetMetadataOperation.", + "properties": { + "metadata": { + "$ref": "SourceMetadata", + "description": "The computed metadata." + } + } + }, + "SourceFork": { + "id": "SourceFork", + "type": "object", + "description": "DEPRECATED in favor of DynamicSourceSplit.", + "properties": { + "primary": { + "$ref": "SourceSplitShard", + "description": "DEPRECATED" + }, + "residual": { + "$ref": "SourceSplitShard", + "description": "DEPRECATED" + }, + "primarySource": { + "$ref": "DerivedSource", + "description": "DEPRECATED" + }, + "residualSource": { + "$ref": "DerivedSource", + "description": "DEPRECATED" + } + } + }, + "ReportWorkItemStatusResponse": { + "id": "ReportWorkItemStatusResponse", + "type": "object", + "description": "Response from a request to report the status of WorkItems.", + "properties": { + "workItemServiceStates": { + "type": "array", + "description": "A set of messages indicating the service-side state for each WorkItem whose status was reported, in the same order as the WorkItemStatus messages in the ReportWorkItemStatusRequest which resulting in this response.", + "items": { + "$ref": "WorkItemServiceState" + } + } + } + }, + "WorkItemServiceState": { + "id": "WorkItemServiceState", + "type": "object", + "description": "The Dataflow service's idea of the current state of a WorkItem being processed by a worker.", + "properties": { + "suggestedStopPoint": { + "$ref": "ApproximateProgress", + "description": "The progress point in the WorkItem where the Dataflow service suggests that the worker truncate the task." + }, + "leaseExpireTime": { + "type": "string", + "description": "Time at which the current lease will expire." + }, + "reportStatusInterval": { + "type": "string", + "description": "New recommended reporting interval." + }, + "harnessData": { + "type": "object", + "description": "Other data returned by the service, specific to the particular worker harness.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + } + }, + "nextReportIndex": { + "type": "string", + "description": "The index value to use for the next report sent by the worker. Note: If the report call fails for whatever reason, the worker should reuse this index for subsequent report attempts.", + "format": "int64" + }, + "suggestedStopPosition": { + "$ref": "Position", + "description": "Obsolete, always empty." + } + } + }, + "LeaseWorkItemRequest": { + "id": "LeaseWorkItemRequest", + "type": "object", + "description": "Request to lease WorkItems.", + "properties": { + "workItemTypes": { + "type": "array", + "description": "Filter for WorkItem type.", + "items": { + "type": "string" + } + }, + "workerCapabilities": { + "type": "array", + "description": "Worker capabilities. WorkItems might be limited to workers with specific capabilities.", + "items": { + "type": "string" + } + }, + "requestedLeaseDuration": { + "type": "string", + "description": "The initial lease period." + }, + "currentWorkerTime": { + "type": "string", + "description": "The current timestamp at the worker." + }, + "workerId": { + "type": "string", + "description": "Identifies the worker leasing work -- typically the ID of the virtual machine running the worker." + } + } + }, + "LeaseWorkItemResponse": { + "id": "LeaseWorkItemResponse", + "type": "object", + "description": "Response to a request to lease WorkItems.", + "properties": { + "workItems": { + "type": "array", + "description": "A list of the leased WorkItems.", + "items": { + "$ref": "WorkItem" + } + } + } + }, + "WorkItem": { + "id": "WorkItem", + "type": "object", + "description": "WorkItem represents basic information about a WorkItem to be executed in the cloud.", + "properties": { + "id": { + "type": "string", + "description": "Identifies this WorkItem.", + "format": "int64" + }, + "projectId": { + "type": "string", + "description": "Identifies the cloud project this WorkItem belongs to." + }, + "jobId": { + "type": "string", + "description": "Identifies the workflow job this WorkItem belongs to." + }, + "packages": { + "type": "array", + "description": "Any required packages that need to be fetched in order to execute this WorkItem.", + "items": { + "$ref": "Package" + } + }, + "mapTask": { + "$ref": "MapTask", + "description": "Additional information for MapTask WorkItems." + }, + "seqMapTask": { + "$ref": "SeqMapTask", + "description": "Additional information for SeqMapTask WorkItems." + }, + "shellTask": { + "$ref": "ShellTask", + "description": "Additional information for ShellTask WorkItems." + }, + "streamingSetupTask": { + "$ref": "StreamingSetupTask", + "description": "Additional information for StreamingSetupTask WorkItems." + }, + "sourceOperationTask": { + "$ref": "SourceOperationRequest", + "description": "Additional information for source operation WorkItems." + }, + "streamingComputationTask": { + "$ref": "StreamingComputationTask", + "description": "Additional information for StreamingComputationTask WorkItems." + }, + "reportStatusInterval": { + "type": "string", + "description": "Recommended reporting interval." + }, + "leaseExpireTime": { + "type": "string", + "description": "Time when the lease on this [Work][] will expire." + }, + "configuration": { + "type": "string", + "description": "Work item-specific configuration as an opaque blob." + }, + "initialReportIndex": { + "type": "string", + "description": "The initial index to use when reporting the status of the WorkItem.", + "format": "int64" + } + } + }, + "MapTask": { + "id": "MapTask", + "type": "object", + "description": "MapTask consists of an ordered set of instructions, each of which describes one particular low-level operation for the worker to perform in order to accomplish the MapTask's WorkItem. Each instruction must appear in the list before any instructions which depends on its output.", + "properties": { + "instructions": { + "type": "array", + "description": "The instructions in the MapTask.", + "items": { + "$ref": "ParallelInstruction" + } + }, + "systemName": { + "type": "string", + "description": "System-defined name of this MapTask. Unique across the workflow." + }, + "stageName": { + "type": "string", + "description": "System-defined name of the stage containing this MapTask. Unique across the workflow." + } + } + }, + "ParallelInstruction": { + "id": "ParallelInstruction", + "type": "object", + "description": "Describes a particular operation comprising a MapTask.", + "properties": { + "systemName": { + "type": "string", + "description": "System-defined name of this operation. Unique across the workflow." + }, + "name": { + "type": "string", + "description": "User-provided name of this operation." + }, + "read": { + "$ref": "ReadInstruction", + "description": "Additional information for Read instructions." + }, + "write": { + "$ref": "WriteInstruction", + "description": "Additional information for Write instructions." + }, + "parDo": { + "$ref": "ParDoInstruction", + "description": "Additional information for ParDo instructions." + }, + "partialGroupByKey": { + "$ref": "PartialGroupByKeyInstruction", + "description": "Additional information for PartialGroupByKey instructions." + }, + "flatten": { + "$ref": "FlattenInstruction", + "description": "Additional information for Flatten instructions." + }, + "outputs": { + "type": "array", + "description": "Describes the outputs of the instruction.", + "items": { + "$ref": "InstructionOutput" + } + } + } + }, + "ReadInstruction": { + "id": "ReadInstruction", + "type": "object", + "description": "An instruction that reads records. Takes no inputs, produces one output.", + "properties": { + "source": { + "$ref": "Source", + "description": "The source to read from." + } + } + }, + "WriteInstruction": { + "id": "WriteInstruction", + "type": "object", + "description": "An instruction that writes records. Takes one input, produces no outputs.", + "properties": { + "input": { + "$ref": "InstructionInput", + "description": "The input." + }, + "sink": { + "$ref": "Sink", + "description": "The sink to write to." + } + } + }, + "InstructionInput": { + "id": "InstructionInput", + "type": "object", + "description": "An input of an instruction, as a reference to an output of a producer instruction.", + "properties": { + "producerInstructionIndex": { + "type": "integer", + "description": "The index (origin zero) of the parallel instruction that produces the output to be consumed by this input. This index is relative to the list of instructions in this input's instruction's containing MapTask.", + "format": "int32" + }, + "outputNum": { + "type": "integer", + "description": "The output index (origin zero) within the producer.", + "format": "int32" + } + } + }, + "Sink": { + "id": "Sink", + "type": "object", + "description": "A sink that records can be encoded and written to.", + "properties": { + "spec": { + "type": "object", + "description": "The sink to write to, plus its parameters.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + } + }, + "codec": { + "type": "object", + "description": "The codec to use to encode data written to the sink.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + } + } + } + }, + "ParDoInstruction": { + "id": "ParDoInstruction", + "type": "object", + "description": "An instruction that does a ParDo operation. Takes one main input and zero or more side inputs, and produces zero or more outputs. Runs user code.", + "properties": { + "input": { + "$ref": "InstructionInput", + "description": "The input." + }, + "sideInputs": { + "type": "array", + "description": "Zero or more side inputs.", + "items": { + "$ref": "SideInputInfo" + } + }, + "userFn": { + "type": "object", + "description": "The user function to invoke.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + } + }, + "numOutputs": { + "type": "integer", + "description": "The number of outputs.", + "format": "int32" + }, + "multiOutputInfos": { + "type": "array", + "description": "Information about each of the outputs, if user_fn is a MultiDoFn.", + "items": { + "$ref": "MultiOutputInfo" + } + } + } + }, + "SideInputInfo": { + "id": "SideInputInfo", + "type": "object", + "description": "Information about a side input of a DoFn or an input of a SeqDoFn.", + "properties": { + "sources": { + "type": "array", + "description": "The source(s) to read element(s) from to get the value of this side input. If more than one source, then the elements are taken from the sources, in the specified order if order matters. At least one source is required.", + "items": { + "$ref": "Source" + } + }, + "kind": { + "type": "object", + "description": "How to interpret the source element(s) as a side input value.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + } + }, + "tag": { + "type": "string", + "description": "The id of the tag the user code will access this side input by; this should correspond to the tag of some MultiOutputInfo." + } + } + }, + "MultiOutputInfo": { + "id": "MultiOutputInfo", + "type": "object", + "description": "Information about an output of a multi-output DoFn.", + "properties": { + "tag": { + "type": "string", + "description": "The id of the tag the user code will emit to this output by; this should correspond to the tag of some SideInputInfo." + } + } + }, + "PartialGroupByKeyInstruction": { + "id": "PartialGroupByKeyInstruction", + "type": "object", + "description": "An instruction that does a partial group-by-key. One input and one output.", + "properties": { + "input": { + "$ref": "InstructionInput", + "description": "Describes the input to the partial group-by-key instruction." + }, + "inputElementCodec": { + "type": "object", + "description": "The codec to use for interpreting an element in the input PTable.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + } + }, + "valueCombiningFn": { + "type": "object", + "description": "The value combining function to invoke.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + } + } + } + }, + "FlattenInstruction": { + "id": "FlattenInstruction", + "type": "object", + "description": "An instruction that copies its inputs (zero or more) to its (single) output.", + "properties": { + "inputs": { + "type": "array", + "description": "Describes the inputs to the flatten instruction.", + "items": { + "$ref": "InstructionInput" + } + } + } + }, + "InstructionOutput": { + "id": "InstructionOutput", + "type": "object", + "description": "An output of an instruction.", + "properties": { + "name": { + "type": "string", + "description": "The user-provided name of this output." + }, + "systemName": { + "type": "string", + "description": "System-defined name of this output. Unique across the workflow." + }, + "codec": { + "type": "object", + "description": "The codec to use to encode data being written via this output.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + } + } + } + }, + "SeqMapTask": { + "id": "SeqMapTask", + "type": "object", + "description": "Describes a particular function to invoke.", + "properties": { + "inputs": { + "type": "array", + "description": "Information about each of the inputs.", + "items": { + "$ref": "SideInputInfo" + } + }, + "userFn": { + "type": "object", + "description": "The user function to invoke.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + } + }, + "outputInfos": { + "type": "array", + "description": "Information about each of the outputs.", + "items": { + "$ref": "SeqMapTaskOutputInfo" + } + }, + "name": { + "type": "string", + "description": "The user-provided name of the SeqDo operation." + }, + "systemName": { + "type": "string", + "description": "System-defined name of the SeqDo operation. Unique across the workflow." + }, + "stageName": { + "type": "string", + "description": "System-defined name of the stage containing the SeqDo operation. Unique across the workflow." + } + } + }, + "SeqMapTaskOutputInfo": { + "id": "SeqMapTaskOutputInfo", + "type": "object", + "description": "Information about an output of a SeqMapTask.", + "properties": { + "tag": { + "type": "string", + "description": "The id of the TupleTag the user code will tag the output value by." + }, + "sink": { + "$ref": "Sink", + "description": "The sink to write the output value to." + } + } + }, + "ShellTask": { + "id": "ShellTask", + "type": "object", + "description": "A task which consists of a shell command for the worker to execute.", + "properties": { + "command": { + "type": "string", + "description": "The shell command to run." + }, + "exitCode": { + "type": "integer", + "description": "Exit code for the task.", + "format": "int32" + } + } + }, + "StreamingSetupTask": { + "id": "StreamingSetupTask", + "type": "object", + "description": "A task which initializes part of a streaming Dataflow job.", + "properties": { + "receiveWorkPort": { + "type": "integer", + "description": "The TCP port on which the worker should listen for messages from other streaming computation workers.", + "format": "int32" + }, + "workerHarnessPort": { + "type": "integer", + "description": "The TCP port used by the worker to communicate with the Dataflow worker harness.", + "format": "int32" + }, + "streamingComputationTopology": { + "$ref": "TopologyConfig", + "description": "The global topology of the streaming Dataflow job." + } + } + }, + "TopologyConfig": { + "id": "TopologyConfig", + "type": "object", + "description": "Global topology of the streaming Dataflow job, including all computations and their sharded locations.", + "properties": { + "computations": { + "type": "array", + "description": "The computations associated with a streaming Dataflow job.", + "items": { + "$ref": "ComputationTopology" + } + }, + "dataDiskAssignments": { + "type": "array", + "description": "The disks assigned to a streaming Dataflow job.", + "items": { + "$ref": "DataDiskAssignment" + } + }, + "userStageToComputationNameMap": { + "type": "object", + "description": "Maps user stage names to stable computation names.", + "additionalProperties": { + "type": "string" + } + } + } + }, + "ComputationTopology": { + "id": "ComputationTopology", + "type": "object", + "description": "All configuration data for a particular Computation.", + "properties": { + "systemStageName": { + "type": "string", + "description": "The system stage name." + }, + "computationId": { + "type": "string", + "description": "The ID of the computation." + }, + "userStageName": { + "type": "string", + "description": "The user stage name." + }, + "keyRanges": { + "type": "array", + "description": "The key ranges processed by the computation.", + "items": { + "$ref": "KeyRangeLocation" + } + }, + "inputs": { + "type": "array", + "description": "The inputs to the computation.", + "items": { + "$ref": "StreamLocation" + } + }, + "outputs": { + "type": "array", + "description": "The outputs from the computation.", + "items": { + "$ref": "StreamLocation" + } + }, + "stateFamilies": { + "type": "array", + "description": "The state family values.", + "items": { + "$ref": "StateFamilyConfig" + } + } + } + }, + "KeyRangeLocation": { + "id": "KeyRangeLocation", + "type": "object", + "description": "Location information for a specific key-range of a sharded computation. Currently we only support UTF-8 character splits to simplify encoding into JSON.", + "properties": { + "start": { + "type": "string", + "description": "The start (inclusive) of the key range." + }, + "end": { + "type": "string", + "description": "The end (exclusive) of the key range." + }, + "deliveryEndpoint": { + "type": "string", + "description": "The physical location of this range assignment to be used for streaming computation cross-worker message delivery." + }, + "persistentDirectory": { + "type": "string", + "description": "The location of the persistent state for this range, as a persistent directory in the worker local filesystem." + }, + "dataDisk": { + "type": "string", + "description": "The name of the data disk where data for this range is stored. This name is local to the Google Cloud Platform project and uniquely identifies the disk within that project, for example \"myproject-1014-104817-4c2-harness-0-disk-1\"." + } + } + }, + "StreamLocation": { + "id": "StreamLocation", + "type": "object", + "description": "Describes a stream of data, either as input to be processed or as output of a streaming Dataflow job.", + "properties": { + "streamingStageLocation": { + "$ref": "StreamingStageLocation", + "description": "The stream is part of another computation within the current streaming Dataflow job." + }, + "pubsubLocation": { + "$ref": "PubsubLocation", + "description": "The stream is a pubsub stream." + }, + "sideInputLocation": { + "$ref": "StreamingSideInputLocation", + "description": "The stream is a streaming side input." + }, + "customSourceLocation": { + "$ref": "CustomSourceLocation", + "description": "The stream is a custom source." + } + } + }, + "StreamingStageLocation": { + "id": "StreamingStageLocation", + "type": "object", + "description": "Identifies the location of a streaming computation stage, for stage-to-stage communication.", + "properties": { + "streamId": { + "type": "string", + "description": "Identifies the particular stream within the streaming Dataflow job." + } + } + }, + "PubsubLocation": { + "id": "PubsubLocation", + "type": "object", + "description": "Identifies a pubsub location to use for transferring data into or out of a streaming Dataflow job.", + "properties": { + "topic": { + "type": "string", + "description": "A pubsub topic, in the form of \"pubsub.googleapis.com/topics/\n/\"" + }, + "subscription": { + "type": "string", + "description": "A pubsub subscription, in the form of \"pubsub.googleapis.com/subscriptions/\n/\"" + }, + "timestampLabel": { + "type": "string", + "description": "If set, contains a pubsub label from which to extract record timestamps. If left empty, record timestamps will be generated upon arrival." + }, + "idLabel": { + "type": "string", + "description": "If set, contains a pubsub label from which to extract record ids. If left empty, record deduplication will be strictly best effort." + }, + "dropLateData": { + "type": "boolean", + "description": "Indicates whether the pipeline allows late-arriving data." + }, + "trackingSubscription": { + "type": "string", + "description": "If set, specifies the pubsub subscription that will be used for tracking custom time timestamps for watermark estimation." + } + } + }, + "StreamingSideInputLocation": { + "id": "StreamingSideInputLocation", + "type": "object", + "description": "Identifies the location of a streaming side input.", + "properties": { + "tag": { + "type": "string", + "description": "Identifies the particular side input within the streaming Dataflow job." + }, + "stateFamily": { + "type": "string", + "description": "Identifies the state family where this side input is stored." + } + } + }, + "CustomSourceLocation": { + "id": "CustomSourceLocation", + "type": "object", + "description": "Identifies the location of a custom souce.", + "properties": { + "stateful": { + "type": "boolean", + "description": "Whether this source is stateful." + } + } + }, + "StateFamilyConfig": { + "id": "StateFamilyConfig", + "type": "object", + "description": "State family configuration.", + "properties": { + "stateFamily": { + "type": "string", + "description": "The state family value." + }, + "isRead": { + "type": "boolean", + "description": "If true, this family corresponds to a read operation." + } + } + }, + "DataDiskAssignment": { + "id": "DataDiskAssignment", + "type": "object", + "description": "Data disk assignment for a given VM instance.", + "properties": { + "vmInstance": { + "type": "string", + "description": "VM instance name the data disks mounted to, for example \"myproject-1014-104817-4c2-harness-0\"." + }, + "dataDisks": { + "type": "array", + "description": "Mounted data disks. The order is important a data disk's 0-based index in this list defines which persistent directory the disk is mounted to, for example the list of { \"myproject-1014-104817-4c2-harness-0-disk-0\" }, { \"myproject-1014-104817-4c2-harness-0-disk-1\" }.", + "items": { + "type": "string" + } + } + } + }, + "SourceOperationRequest": { + "id": "SourceOperationRequest", + "type": "object", + "description": "A work item that represents the different operations that can be performed on a user-defined Source specification.", + "properties": { + "split": { + "$ref": "SourceSplitRequest", + "description": "Information about a request to split a source." + }, + "getMetadata": { + "$ref": "SourceGetMetadataRequest", + "description": "Information about a request to get metadata about a source." + } + } + }, + "SourceSplitRequest": { + "id": "SourceSplitRequest", + "type": "object", + "description": "Represents the operation to split a high-level Source specification into bundles (parts for parallel processing). At a high level, splitting of a source into bundles happens as follows: SourceSplitRequest is applied to the source. If it returns SOURCE_SPLIT_OUTCOME_USE_CURRENT, no further splitting happens and the source is used \"as is\". Otherwise, splitting is applied recursively to each produced DerivedSource. As an optimization, for any Source, if its does_not_need_splitting is true, the framework assumes that splitting this source would return SOURCE_SPLIT_OUTCOME_USE_CURRENT, and doesn't initiate a SourceSplitRequest. This applies both to the initial source being split and to bundles produced from it.", + "properties": { + "source": { + "$ref": "Source", + "description": "Specification of the source to be split." + }, + "options": { + "$ref": "SourceSplitOptions", + "description": "Hints for tuning the splitting process." + } + } + }, + "SourceSplitOptions": { + "id": "SourceSplitOptions", + "type": "object", + "description": "Hints for splitting a Source into bundles (parts for parallel processing) using SourceSplitRequest.", + "properties": { + "desiredBundleSizeBytes": { + "type": "string", + "description": "The source should be split into a set of bundles where the estimated size of each is approximately this many bytes.", + "format": "int64" + }, + "desiredShardSizeBytes": { + "type": "string", + "description": "DEPRECATED in favor of desired_bundle_size_bytes.", + "format": "int64" + } + } + }, + "SourceGetMetadataRequest": { + "id": "SourceGetMetadataRequest", + "type": "object", + "description": "A request to compute the SourceMetadata of a Source.", + "properties": { + "source": { + "$ref": "Source", + "description": "Specification of the source whose metadata should be computed." + } + } + }, + "StreamingComputationTask": { + "id": "StreamingComputationTask", + "type": "object", + "description": "A task which describes what action should be performed for the specified streaming computation ranges.", + "properties": { + "taskType": { + "type": "string", + "description": "A type of streaming computation task.", + "enum": [ + "STREAMING_COMPUTATION_TASK_UNKNOWN", + "STREAMING_COMPUTATION_TASK_STOP", + "STREAMING_COMPUTATION_TASK_START" + ] + }, + "dataDisks": { + "type": "array", + "description": "Describes the set of data disks this task should apply to.", + "items": { + "$ref": "MountedDataDisk" + } + }, + "computationRanges": { + "type": "array", + "description": "Contains ranges of a streaming computation this task should apply to.", + "items": { + "$ref": "StreamingComputationRanges" + } + } + } + }, + "MountedDataDisk": { + "id": "MountedDataDisk", + "type": "object", + "description": "Describes mounted data disk.", + "properties": { + "dataDisk": { + "type": "string", + "description": "The name of the data disk. This name is local to the Google Cloud Platform project and uniquely identifies the disk within that project, for example \"myproject-1014-104817-4c2-harness-0-disk-1\"." + } + } + }, + "StreamingComputationRanges": { + "id": "StreamingComputationRanges", + "type": "object", + "description": "Describes full or partial data disk assignment information of the computation ranges.", + "properties": { + "computationId": { + "type": "string", + "description": "The ID of the computation." + }, + "rangeAssignments": { + "type": "array", + "description": "Data disk assignments for ranges from this computation.", + "items": { + "$ref": "KeyRangeDataDiskAssignment" + } + } + } + }, + "KeyRangeDataDiskAssignment": { + "id": "KeyRangeDataDiskAssignment", + "type": "object", + "description": "Data disk assignment information for a specific key-range of a sharded computation. Currently we only support UTF-8 character splits to simplify encoding into JSON.", + "properties": { + "start": { + "type": "string", + "description": "The start (inclusive) of the key range." + }, + "end": { + "type": "string", + "description": "The end (exclusive) of the key range." + }, + "dataDisk": { + "type": "string", + "description": "The name of the data disk where data for this range is stored. This name is local to the Google Cloud Platform project and uniquely identifies the disk within that project, for example \"myproject-1014-104817-4c2-harness-0-disk-1\"." + } + } + } + }, + "resources": { + "projects": { + "resources": { + "jobs": { + "methods": { + "create": { + "id": "dataflow.projects.jobs.create", + "path": "v1b3/projects/{projectId}/jobs", + "httpMethod": "POST", + "description": "Creates a dataflow job.", + "parameters": { + "projectId": { + "type": "string", + "description": "The project which owns the job.", + "required": true, + "location": "path" + }, + "view": { + "type": "string", + "description": "Level of information requested in response.", + "enum": [ + "JOB_VIEW_UNKNOWN", + "JOB_VIEW_SUMMARY", + "JOB_VIEW_ALL" + ], + "location": "query" + }, + "replaceJobId": { + "type": "string", + "description": "DEPRECATED. This field is now on the Job message.", + "location": "query" + } + }, + "parameterOrder": [ + "projectId" + ], + "request": { + "$ref": "Job" + }, + "response": { + "$ref": "Job" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/userinfo.email" + ] + }, + "get": { + "id": "dataflow.projects.jobs.get", + "path": "v1b3/projects/{projectId}/jobs/{jobId}", + "httpMethod": "GET", + "description": "Gets the state of the specified dataflow job.", + "parameters": { + "projectId": { + "type": "string", + "description": "The project which owns the job.", + "required": true, + "location": "path" + }, + "jobId": { + "type": "string", + "description": "Identifies a single job.", + "required": true, + "location": "path" + }, + "view": { + "type": "string", + "description": "Level of information requested in response.", + "enum": [ + "JOB_VIEW_UNKNOWN", + "JOB_VIEW_SUMMARY", + "JOB_VIEW_ALL" + ], + "location": "query" + } + }, + "parameterOrder": [ + "projectId", + "jobId" + ], + "response": { + "$ref": "Job" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/userinfo.email" + ] + }, + "update": { + "id": "dataflow.projects.jobs.update", + "path": "v1b3/projects/{projectId}/jobs/{jobId}", + "httpMethod": "PUT", + "description": "Updates the state of an existing dataflow job.", + "parameters": { + "projectId": { + "type": "string", + "description": "The project which owns the job.", + "required": true, + "location": "path" + }, + "jobId": { + "type": "string", + "description": "Identifies a single job.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "jobId" + ], + "request": { + "$ref": "Job" + }, + "response": { + "$ref": "Job" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/userinfo.email" + ] + }, + "list": { + "id": "dataflow.projects.jobs.list", + "path": "v1b3/projects/{projectId}/jobs", + "httpMethod": "GET", + "description": "List the jobs of a project", + "parameters": { + "projectId": { + "type": "string", + "description": "The project which owns the jobs.", + "required": true, + "location": "path" + }, + "view": { + "type": "string", + "description": "Level of information requested in response. Default is SUMMARY.", + "enum": [ + "JOB_VIEW_UNKNOWN", + "JOB_VIEW_SUMMARY", + "JOB_VIEW_ALL" + ], + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "If there are many jobs, limit response to at most this many. The actual number of jobs returned will be the lesser of max_responses and an unspecified server-defined limit.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Set this to the 'next_page_token' field of a previous response to request additional results in a long list.", + "location": "query" + } + }, + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "ListJobsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/userinfo.email" + ] + }, + "getMetrics": { + "id": "dataflow.projects.jobs.getMetrics", + "path": "v1b3/projects/{projectId}/jobs/{jobId}/metrics", + "httpMethod": "GET", + "description": "Request the job status.", + "parameters": { + "projectId": { + "type": "string", + "description": "A project id.", + "required": true, + "location": "path" + }, + "jobId": { + "type": "string", + "description": "The job to get messages for.", + "required": true, + "location": "path" + }, + "startTime": { + "type": "string", + "description": "Return only metric data that has changed since this time. Default is to return all information about all metrics for the job.", + "location": "query" + } + }, + "parameterOrder": [ + "projectId", + "jobId" + ], + "response": { + "$ref": "JobMetrics" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/userinfo.email" + ] + } + }, + "resources": { + "messages": { + "methods": { + "list": { + "id": "dataflow.projects.jobs.messages.list", + "path": "v1b3/projects/{projectId}/jobs/{jobId}/messages", + "httpMethod": "GET", + "description": "Request the job status.", + "parameters": { + "projectId": { + "type": "string", + "description": "A project id.", + "required": true, + "location": "path" + }, + "jobId": { + "type": "string", + "description": "The job to get messages about.", + "required": true, + "location": "path" + }, + "minimumImportance": { + "type": "string", + "description": "Filter to only get messages with importance \u003e= level", + "enum": [ + "JOB_MESSAGE_IMPORTANCE_UNKNOWN", + "JOB_MESSAGE_DEBUG", + "JOB_MESSAGE_DETAILED", + "JOB_MESSAGE_BASIC", + "JOB_MESSAGE_WARNING", + "JOB_MESSAGE_ERROR" + ], + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "If specified, determines the maximum number of messages to return. If unspecified, the service may choose an appropriate default, or may return an arbitrarily large number of results.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "If supplied, this should be the value of next_page_token returned by an earlier call. This will cause the next page of results to be returned.", + "location": "query" + }, + "startTime": { + "type": "string", + "description": "If specified, return only messages with timestamps \u003e= start_time. The default is the job creation time (i.e. beginning of messages).", + "location": "query" + }, + "endTime": { + "type": "string", + "description": "Return only messages with timestamps \u003c end_time. The default is now (i.e. return up to the latest messages available).", + "location": "query" + } + }, + "parameterOrder": [ + "projectId", + "jobId" + ], + "response": { + "$ref": "ListJobMessagesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/userinfo.email" + ] + } + } + }, + "workItems": { + "methods": { + "reportStatus": { + "id": "dataflow.projects.jobs.workItems.reportStatus", + "path": "v1b3/projects/{projectId}/jobs/{jobId}/workItems:reportStatus", + "httpMethod": "POST", + "description": "Reports the status of dataflow WorkItems leased by a worker.", + "parameters": { + "projectId": { + "type": "string", + "description": "The project which owns the WorkItem's job.", + "required": true, + "location": "path" + }, + "jobId": { + "type": "string", + "description": "The job which the WorkItem is part of.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "jobId" + ], + "request": { + "$ref": "ReportWorkItemStatusRequest" + }, + "response": { + "$ref": "ReportWorkItemStatusResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/userinfo.email" + ] + }, + "lease": { + "id": "dataflow.projects.jobs.workItems.lease", + "path": "v1b3/projects/{projectId}/jobs/{jobId}/workItems:lease", + "httpMethod": "POST", + "description": "Leases a dataflow WorkItem to run.", + "parameters": { + "projectId": { + "type": "string", + "description": "Identifies the project this worker belongs to.", + "required": true, + "location": "path" + }, + "jobId": { + "type": "string", + "description": "Identifies the workflow job this worker belongs to.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "jobId" + ], + "request": { + "$ref": "LeaseWorkItemRequest" + }, + "response": { + "$ref": "LeaseWorkItemResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/userinfo.email" + ] + } + } + } + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/dataflow/v1b3/dataflow-gen.go b/Godeps/_workspace/src/google.golang.org/api/dataflow/v1b3/dataflow-gen.go new file mode 100644 index 000000000..8743d19ed --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/dataflow/v1b3/dataflow-gen.go @@ -0,0 +1,4050 @@ +// Package dataflow provides access to the Google Dataflow API. +// +// See https://cloud.google.com/dataflow +// +// Usage example: +// +// import "google.golang.org/api/dataflow/v1b3" +// ... +// dataflowService, err := dataflow.New(oauthHttpClient) +package dataflow // import "google.golang.org/api/dataflow/v1b3" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "dataflow:v1b3" +const apiName = "dataflow" +const apiVersion = "v1b3" +const basePath = "https://dataflow.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your data across Google Cloud Platform services + CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" + + // 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.Projects = NewProjectsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Projects *ProjectsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewProjectsService(s *Service) *ProjectsService { + rs := &ProjectsService{s: s} + rs.Jobs = NewProjectsJobsService(s) + return rs +} + +type ProjectsService struct { + s *Service + + Jobs *ProjectsJobsService +} + +func NewProjectsJobsService(s *Service) *ProjectsJobsService { + rs := &ProjectsJobsService{s: s} + rs.Messages = NewProjectsJobsMessagesService(s) + rs.WorkItems = NewProjectsJobsWorkItemsService(s) + return rs +} + +type ProjectsJobsService struct { + s *Service + + Messages *ProjectsJobsMessagesService + + WorkItems *ProjectsJobsWorkItemsService +} + +func NewProjectsJobsMessagesService(s *Service) *ProjectsJobsMessagesService { + rs := &ProjectsJobsMessagesService{s: s} + return rs +} + +type ProjectsJobsMessagesService struct { + s *Service +} + +func NewProjectsJobsWorkItemsService(s *Service) *ProjectsJobsWorkItemsService { + rs := &ProjectsJobsWorkItemsService{s: s} + return rs +} + +type ProjectsJobsWorkItemsService struct { + s *Service +} + +// ApproximateProgress: A progress measurement of a WorkItem by a +// worker. +type ApproximateProgress struct { + // PercentComplete: Completion as percentage of the work, from 0.0 + // (beginning, nothing complete), to 1.0 (end of the work range, entire + // WorkItem complete). + PercentComplete float64 `json:"percentComplete,omitempty"` + + // Position: A Position within the work to represent a progress. + Position *Position `json:"position,omitempty"` + + // RemainingTime: Completion as an estimated time remaining. + RemainingTime string `json:"remainingTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "PercentComplete") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ApproximateProgress) MarshalJSON() ([]byte, error) { + type noMethod ApproximateProgress + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AutoscalingSettings: Settings for WorkerPool autoscaling. +type AutoscalingSettings struct { + // Algorithm: The algorithm to use for autoscaling. + // + // Possible values: + // "AUTOSCALING_ALGORITHM_UNKNOWN" + // "AUTOSCALING_ALGORITHM_NONE" + // "AUTOSCALING_ALGORITHM_BASIC" + Algorithm string `json:"algorithm,omitempty"` + + // MaxNumWorkers: The maximum number of workers to cap scaling at. + MaxNumWorkers int64 `json:"maxNumWorkers,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Algorithm") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalingSettings) MarshalJSON() ([]byte, error) { + type noMethod AutoscalingSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ComputationTopology: All configuration data for a particular +// Computation. +type ComputationTopology struct { + // ComputationId: The ID of the computation. + ComputationId string `json:"computationId,omitempty"` + + // Inputs: The inputs to the computation. + Inputs []*StreamLocation `json:"inputs,omitempty"` + + // KeyRanges: The key ranges processed by the computation. + KeyRanges []*KeyRangeLocation `json:"keyRanges,omitempty"` + + // Outputs: The outputs from the computation. + Outputs []*StreamLocation `json:"outputs,omitempty"` + + // StateFamilies: The state family values. + StateFamilies []*StateFamilyConfig `json:"stateFamilies,omitempty"` + + // SystemStageName: The system stage name. + SystemStageName string `json:"systemStageName,omitempty"` + + // UserStageName: The user stage name. + UserStageName string `json:"userStageName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ComputationId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ComputationTopology) MarshalJSON() ([]byte, error) { + type noMethod ComputationTopology + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ConcatPosition: A position that encapsulates an inner position and an +// index for the inner position. A ConcatPosition can be used by a +// reader of a source that encapsulates a set of other sources. +type ConcatPosition struct { + // Index: Index of the inner source. + Index int64 `json:"index,omitempty"` + + // Position: Position within the inner source. + Position *Position `json:"position,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Index") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ConcatPosition) MarshalJSON() ([]byte, error) { + type noMethod ConcatPosition + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomSourceLocation: Identifies the location of a custom souce. +type CustomSourceLocation struct { + // Stateful: Whether this source is stateful. + Stateful bool `json:"stateful,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Stateful") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomSourceLocation) MarshalJSON() ([]byte, error) { + type noMethod CustomSourceLocation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DataDiskAssignment: Data disk assignment for a given VM instance. +type DataDiskAssignment struct { + // DataDisks: Mounted data disks. The order is important a data disk's + // 0-based index in this list defines which persistent directory the + // disk is mounted to, for example the list of { + // "myproject-1014-104817-4c2-harness-0-disk-0" }, { + // "myproject-1014-104817-4c2-harness-0-disk-1" }. + DataDisks []string `json:"dataDisks,omitempty"` + + // VmInstance: VM instance name the data disks mounted to, for example + // "myproject-1014-104817-4c2-harness-0". + VmInstance string `json:"vmInstance,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DataDisks") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DataDiskAssignment) MarshalJSON() ([]byte, error) { + type noMethod DataDiskAssignment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DerivedSource: Specification of one of the bundles produced as a +// result of splitting a Source (e.g. when executing a +// SourceSplitRequest, or when splitting an active task using +// WorkItemStatus.dynamic_source_split), relative to the source being +// split. +type DerivedSource struct { + // DerivationMode: What source to base the produced source on (if any). + // + // Possible values: + // "SOURCE_DERIVATION_MODE_UNKNOWN" + // "SOURCE_DERIVATION_MODE_INDEPENDENT" + // "SOURCE_DERIVATION_MODE_CHILD_OF_CURRENT" + // "SOURCE_DERIVATION_MODE_SIBLING_OF_CURRENT" + DerivationMode string `json:"derivationMode,omitempty"` + + // Source: Specification of the source. + Source *Source `json:"source,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DerivationMode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DerivedSource) MarshalJSON() ([]byte, error) { + type noMethod DerivedSource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Disk: Describes the data disk used by a workflow job. +type Disk struct { + // DiskType: Disk storage type, as defined by Google Compute Engine. + // This must be a disk type appropriate to the project and zone in which + // the workers will run. If unknown or unspecified, the service will + // attempt to choose a reasonable default. For example, the standard + // persistent disk type is a resource name typically ending in + // "pd-standard". If SSD persistent disks are available, the resource + // name typically ends with "pd-ssd". The actual valid values are + // defined the Google Compute Engine API, not by the Dataflow API; + // consult the Google Compute Engine documentation for more information + // about determining the set of available disk types for a particular + // project and zone. Google Compute Engine Disk types are local to a + // particular project in a particular zone, and so the resource name + // will typically look something like this: + // compute.googleapis.com/projects/ + // /zones//diskTypes/pd-standard + DiskType string `json:"diskType,omitempty"` + + // MountPoint: Directory in a VM where disk is mounted. + MountPoint string `json:"mountPoint,omitempty"` + + // SizeGb: Size of disk in GB. If zero or unspecified, the service will + // attempt to choose a reasonable default. + SizeGb int64 `json:"sizeGb,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DiskType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Disk) MarshalJSON() ([]byte, error) { + type noMethod Disk + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DynamicSourceSplit: When a task splits using +// WorkItemStatus.dynamic_source_split, this message describes the two +// parts of the split relative to the description of the current task's +// input. +type DynamicSourceSplit struct { + // Primary: Primary part (continued to be processed by worker). + // Specified relative to the previously-current source. Becomes current. + Primary *DerivedSource `json:"primary,omitempty"` + + // Residual: Residual part (returned to the pool of work). Specified + // relative to the previously-current source. + Residual *DerivedSource `json:"residual,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Primary") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DynamicSourceSplit) MarshalJSON() ([]byte, error) { + type noMethod DynamicSourceSplit + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Environment: Describes the environment in which a Dataflow Job runs. +type Environment struct { + // ClusterManagerApiService: The type of cluster manager API to use. If + // unknown or unspecified, the service will attempt to choose a + // reasonable default. This should be in the form of the API service + // name, e.g. "compute.googleapis.com". + ClusterManagerApiService string `json:"clusterManagerApiService,omitempty"` + + // Dataset: The dataset for the current project where various workflow + // related tables are stored. The supported resource type is: Google + // BigQuery: bigquery.googleapis.com/{dataset} + Dataset string `json:"dataset,omitempty"` + + // Experiments: The list of experiments to enable. + Experiments []string `json:"experiments,omitempty"` + + // InternalExperiments: Experimental settings. + InternalExperiments EnvironmentInternalExperiments `json:"internalExperiments,omitempty"` + + // SdkPipelineOptions: The Dataflow SDK pipeline options specified by + // the user. These options are passed through the service and are used + // to recreate the SDK pipeline options on the worker in a language + // agnostic and platform independent way. + SdkPipelineOptions EnvironmentSdkPipelineOptions `json:"sdkPipelineOptions,omitempty"` + + // TempStoragePrefix: The prefix of the resources the system should use + // for temporary storage. The system will append the suffix + // "/temp-{JOBNAME} to this resource prefix, where {JOBNAME} is the + // value of the job_name field. The resulting bucket and object prefix + // is used as the prefix of the resources used to store temporary data + // needed during the job execution. NOTE: This will override the value + // in taskrunner_settings. The supported resource type is: Google Cloud + // Storage: storage.googleapis.com/{bucket}/{object} + // bucket.storage.googleapis.com/{object} + TempStoragePrefix string `json:"tempStoragePrefix,omitempty"` + + // UserAgent: A description of the process that generated the request. + UserAgent EnvironmentUserAgent `json:"userAgent,omitempty"` + + // Version: A structure describing which components and their versions + // of the service are required in order to run the job. + Version EnvironmentVersion `json:"version,omitempty"` + + // WorkerPools: Worker pools. At least one "harness" worker pool must be + // specified in order for the job to have workers. + WorkerPools []*WorkerPool `json:"workerPools,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "ClusterManagerApiService") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Environment) MarshalJSON() ([]byte, error) { + type noMethod Environment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type EnvironmentInternalExperiments interface{} + +type EnvironmentSdkPipelineOptions interface{} + +type EnvironmentUserAgent interface{} + +type EnvironmentVersion interface{} + +// FlattenInstruction: An instruction that copies its inputs (zero or +// more) to its (single) output. +type FlattenInstruction struct { + // Inputs: Describes the inputs to the flatten instruction. + Inputs []*InstructionInput `json:"inputs,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Inputs") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FlattenInstruction) MarshalJSON() ([]byte, error) { + type noMethod FlattenInstruction + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstructionInput: An input of an instruction, as a reference to an +// output of a producer instruction. +type InstructionInput struct { + // OutputNum: The output index (origin zero) within the producer. + OutputNum int64 `json:"outputNum,omitempty"` + + // ProducerInstructionIndex: The index (origin zero) of the parallel + // instruction that produces the output to be consumed by this input. + // This index is relative to the list of instructions in this input's + // instruction's containing MapTask. + ProducerInstructionIndex int64 `json:"producerInstructionIndex,omitempty"` + + // ForceSendFields is a list of field names (e.g. "OutputNum") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstructionInput) MarshalJSON() ([]byte, error) { + type noMethod InstructionInput + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstructionOutput: An output of an instruction. +type InstructionOutput struct { + // Codec: The codec to use to encode data being written via this output. + Codec InstructionOutputCodec `json:"codec,omitempty"` + + // Name: The user-provided name of this output. + Name string `json:"name,omitempty"` + + // SystemName: System-defined name of this output. Unique across the + // workflow. + SystemName string `json:"systemName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Codec") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstructionOutput) MarshalJSON() ([]byte, error) { + type noMethod InstructionOutput + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstructionOutputCodec interface{} + +// Job: Defines a job to be run by the Dataflow service. +type Job struct { + // ClientRequestId: Client's unique identifier of the job, re-used by + // SDK across retried attempts. If this field is set, the service will + // ensure its uniqueness. That is, the request to create a job will fail + // if the service has knowledge of a previously submitted job with the + // same client's id and job name. The caller may, for example, use this + // field to ensure idempotence of job creation across retried attempts + // to create a job. By default, the field is empty and, in that case, + // the service ignores it. + ClientRequestId string `json:"clientRequestId,omitempty"` + + // CreateTime: Timestamp when job was initially created. Immutable, set + // by the Dataflow service. + CreateTime string `json:"createTime,omitempty"` + + // CurrentState: The current state of the job. Jobs are created in the + // JOB_STATE_STOPPED state unless otherwise specified. A job in the + // JOB_STATE_RUNNING state may asynchronously enter a terminal state. + // Once a job has reached a terminal state, no further state updates may + // be made. This field may be mutated by the Dataflow service; callers + // cannot mutate it. + // + // Possible values: + // "JOB_STATE_UNKNOWN" + // "JOB_STATE_STOPPED" + // "JOB_STATE_RUNNING" + // "JOB_STATE_DONE" + // "JOB_STATE_FAILED" + // "JOB_STATE_CANCELLED" + // "JOB_STATE_UPDATED" + CurrentState string `json:"currentState,omitempty"` + + // CurrentStateTime: The timestamp associated with the current state. + CurrentStateTime string `json:"currentStateTime,omitempty"` + + // Environment: Environment for the job. + Environment *Environment `json:"environment,omitempty"` + + // ExecutionInfo: Information about how the Dataflow service will + // actually run the job. + ExecutionInfo *JobExecutionInfo `json:"executionInfo,omitempty"` + + // Id: The unique ID of this job. This field is set by the Dataflow + // service when the Job is created, and is immutable for the life of the + // Job. + Id string `json:"id,omitempty"` + + // Name: The user-specified Dataflow job name. Only one Job with a given + // name may exist in a project at any given time. If a caller attempts + // to create a Job with the same name as an already-existing Job, the + // attempt will return the existing Job. The name must match the regular + // expression [a-z]([-a-z0-9]{0,38}[a-z0-9])? + Name string `json:"name,omitempty"` + + // ProjectId: The project which owns the job. + ProjectId string `json:"projectId,omitempty"` + + // ReplaceJobId: If this job is an update of an existing job, this field + // will be the ID of the job it replaced. When sending a + // CreateJobRequest, you can update a job by specifying it here. The job + // named here will be stopped, and its intermediate state transferred to + // this job. + ReplaceJobId string `json:"replaceJobId,omitempty"` + + // ReplacedByJobId: If another job is an update of this job (and thus, + // this job is in JOB_STATE_UPDATED), this field will contain the ID of + // that job. + ReplacedByJobId string `json:"replacedByJobId,omitempty"` + + // RequestedState: The job's requested state. UpdateJob may be used to + // switch between the JOB_STATE_STOPPED and JOB_STATE_RUNNING states, by + // setting requested_state. UpdateJob may also be used to directly set a + // job's requested state to JOB_STATE_CANCELLED or JOB_STATE_DONE, + // irrevocably terminating the job if it has not already reached a + // terminal state. + // + // Possible values: + // "JOB_STATE_UNKNOWN" + // "JOB_STATE_STOPPED" + // "JOB_STATE_RUNNING" + // "JOB_STATE_DONE" + // "JOB_STATE_FAILED" + // "JOB_STATE_CANCELLED" + // "JOB_STATE_UPDATED" + RequestedState string `json:"requestedState,omitempty"` + + // Steps: The top-level steps that constitute the entire job. + Steps []*Step `json:"steps,omitempty"` + + // TransformNameMapping: Map of transform name prefixes of the job to be + // replaced to the corresponding name prefixes of the new job. + TransformNameMapping map[string]string `json:"transformNameMapping,omitempty"` + + // Type: The type of dataflow job. + // + // Possible values: + // "JOB_TYPE_UNKNOWN" + // "JOB_TYPE_BATCH" + // "JOB_TYPE_STREAMING" + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ClientRequestId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Job) MarshalJSON() ([]byte, error) { + type noMethod Job + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// JobExecutionInfo: Additional information about how a Dataflow job +// will be executed which isn’t contained in the submitted job. +type JobExecutionInfo struct { + // Stages: A mapping from each stage to the information about that + // stage. + Stages map[string]JobExecutionStageInfo `json:"stages,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Stages") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JobExecutionInfo) MarshalJSON() ([]byte, error) { + type noMethod JobExecutionInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// JobExecutionStageInfo: Contains information about how a particular +// [google.dataflow.v1beta3.Step][google.dataflow.v1beta3.Step] will be +// executed. +type JobExecutionStageInfo struct { + // StepName: The steps associated with the execution stage. Note that + // stages may have several steps, and that a given step might be run by + // more than one stage. + StepName []string `json:"stepName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "StepName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JobExecutionStageInfo) MarshalJSON() ([]byte, error) { + type noMethod JobExecutionStageInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// JobMessage: A particular message pertaining to a Dataflow job. +type JobMessage struct { + // Id: Identifies the message. This is automatically generated by the + // service; the caller should treat it as an opaque string. + Id string `json:"id,omitempty"` + + // MessageImportance: Importance level of the message. + // + // Possible values: + // "JOB_MESSAGE_IMPORTANCE_UNKNOWN" + // "JOB_MESSAGE_DEBUG" + // "JOB_MESSAGE_DETAILED" + // "JOB_MESSAGE_BASIC" + // "JOB_MESSAGE_WARNING" + // "JOB_MESSAGE_ERROR" + MessageImportance string `json:"messageImportance,omitempty"` + + // MessageText: The text of the message. + MessageText string `json:"messageText,omitempty"` + + // Time: The timestamp of the message. + Time string `json:"time,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JobMessage) MarshalJSON() ([]byte, error) { + type noMethod JobMessage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// JobMetrics: JobMetrics contains a collection of metrics descibing the +// detailed progress of a Dataflow job. Metrics correspond to +// user-defined and system-defined metrics in the job. This resource +// captures only the most recent values of each metric; time-series data +// can be queried for them (under the same metric names) from Cloud +// Monitoring. +type JobMetrics struct { + // MetricTime: Timestamp as of which metric values are current. + MetricTime string `json:"metricTime,omitempty"` + + // Metrics: All metrics for this job. + Metrics []*MetricUpdate `json:"metrics,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "MetricTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JobMetrics) MarshalJSON() ([]byte, error) { + type noMethod JobMetrics + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// KeyRangeDataDiskAssignment: Data disk assignment information for a +// specific key-range of a sharded computation. Currently we only +// support UTF-8 character splits to simplify encoding into JSON. +type KeyRangeDataDiskAssignment struct { + // DataDisk: The name of the data disk where data for this range is + // stored. This name is local to the Google Cloud Platform project and + // uniquely identifies the disk within that project, for example + // "myproject-1014-104817-4c2-harness-0-disk-1". + DataDisk string `json:"dataDisk,omitempty"` + + // End: The end (exclusive) of the key range. + End string `json:"end,omitempty"` + + // Start: The start (inclusive) of the key range. + Start string `json:"start,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DataDisk") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *KeyRangeDataDiskAssignment) MarshalJSON() ([]byte, error) { + type noMethod KeyRangeDataDiskAssignment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// KeyRangeLocation: Location information for a specific key-range of a +// sharded computation. Currently we only support UTF-8 character splits +// to simplify encoding into JSON. +type KeyRangeLocation struct { + // DataDisk: The name of the data disk where data for this range is + // stored. This name is local to the Google Cloud Platform project and + // uniquely identifies the disk within that project, for example + // "myproject-1014-104817-4c2-harness-0-disk-1". + DataDisk string `json:"dataDisk,omitempty"` + + // DeliveryEndpoint: The physical location of this range assignment to + // be used for streaming computation cross-worker message delivery. + DeliveryEndpoint string `json:"deliveryEndpoint,omitempty"` + + // End: The end (exclusive) of the key range. + End string `json:"end,omitempty"` + + // PersistentDirectory: The location of the persistent state for this + // range, as a persistent directory in the worker local filesystem. + PersistentDirectory string `json:"persistentDirectory,omitempty"` + + // Start: The start (inclusive) of the key range. + Start string `json:"start,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DataDisk") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *KeyRangeLocation) MarshalJSON() ([]byte, error) { + type noMethod KeyRangeLocation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LeaseWorkItemRequest: Request to lease WorkItems. +type LeaseWorkItemRequest struct { + // CurrentWorkerTime: The current timestamp at the worker. + CurrentWorkerTime string `json:"currentWorkerTime,omitempty"` + + // RequestedLeaseDuration: The initial lease period. + RequestedLeaseDuration string `json:"requestedLeaseDuration,omitempty"` + + // WorkItemTypes: Filter for WorkItem type. + WorkItemTypes []string `json:"workItemTypes,omitempty"` + + // WorkerCapabilities: Worker capabilities. WorkItems might be limited + // to workers with specific capabilities. + WorkerCapabilities []string `json:"workerCapabilities,omitempty"` + + // WorkerId: Identifies the worker leasing work -- typically the ID of + // the virtual machine running the worker. + WorkerId string `json:"workerId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CurrentWorkerTime") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LeaseWorkItemRequest) MarshalJSON() ([]byte, error) { + type noMethod LeaseWorkItemRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LeaseWorkItemResponse: Response to a request to lease WorkItems. +type LeaseWorkItemResponse struct { + // WorkItems: A list of the leased WorkItems. + WorkItems []*WorkItem `json:"workItems,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "WorkItems") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LeaseWorkItemResponse) MarshalJSON() ([]byte, error) { + type noMethod LeaseWorkItemResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListJobMessagesResponse: Response to a request to list job messages. +type ListJobMessagesResponse struct { + // JobMessages: Messages in ascending timestamp order. + JobMessages []*JobMessage `json:"jobMessages,omitempty"` + + // NextPageToken: The token to obtain the next page of results if there + // are more. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "JobMessages") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListJobMessagesResponse) MarshalJSON() ([]byte, error) { + type noMethod ListJobMessagesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListJobsResponse: Response to a request to list Dataflow jobs. This +// may be a partial response, depending on the page size in the +// ListJobsRequest. +type ListJobsResponse struct { + // Jobs: A subset of the requested job information. + Jobs []*Job `json:"jobs,omitempty"` + + // NextPageToken: Set if there may be more results than fit in this + // response. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Jobs") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListJobsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListJobsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MapTask: MapTask consists of an ordered set of instructions, each of +// which describes one particular low-level operation for the worker to +// perform in order to accomplish the MapTask's WorkItem. Each +// instruction must appear in the list before any instructions which +// depends on its output. +type MapTask struct { + // Instructions: The instructions in the MapTask. + Instructions []*ParallelInstruction `json:"instructions,omitempty"` + + // StageName: System-defined name of the stage containing this MapTask. + // Unique across the workflow. + StageName string `json:"stageName,omitempty"` + + // SystemName: System-defined name of this MapTask. Unique across the + // workflow. + SystemName string `json:"systemName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instructions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MapTask) MarshalJSON() ([]byte, error) { + type noMethod MapTask + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MetricStructuredName: Identifies a metric, by describing the source +// which generated the metric. +type MetricStructuredName struct { + // Context: Zero or more labeled fields which identify the part of the + // job this metric is associated with, such as the name of a step or + // collection. For example, built-in counters associated with steps will + // have context['step'] = . Counters associated with PCollections in the + // SDK will have context['pcollection'] = + // . + Context map[string]string `json:"context,omitempty"` + + // Name: Worker-defined metric name. + Name string `json:"name,omitempty"` + + // Origin: Origin (namespace) of metric name. May be blank for + // user-define metrics; will be "dataflow" for metrics defined by the + // Dataflow service or SDK. + Origin string `json:"origin,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Context") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MetricStructuredName) MarshalJSON() ([]byte, error) { + type noMethod MetricStructuredName + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MetricUpdate: Describes the state of a metric. +type MetricUpdate struct { + // Cumulative: True if this metric is reported as the total cumulative + // aggregate value accumulated since the worker started working on this + // WorkItem. By default this is false, indicating that this metric is + // reported as a delta that is not associated with any WorkItem. + Cumulative bool `json:"cumulative,omitempty"` + + // Internal: Worker-computed aggregate value for internal use by the + // Dataflow service. + Internal interface{} `json:"internal,omitempty"` + + // Kind: Metric aggregation kind. The possible metric aggregation kinds + // are "Sum", "Max", "Min", "Mean", "Set", "And", and "Or". The + // specified aggregation kind is case-insensitive. If omitted, this is + // not an aggregated value but instead a single metric sample value. + Kind string `json:"kind,omitempty"` + + // MeanCount: Worker-computed aggregate value for the "Mean" aggregation + // kind. This holds the count of the aggregated values and is used in + // combination with mean_sum above to obtain the actual mean aggregate + // value. The only possible value type is Long. + MeanCount interface{} `json:"meanCount,omitempty"` + + // MeanSum: Worker-computed aggregate value for the "Mean" aggregation + // kind. This holds the sum of the aggregated values and is used in + // combination with mean_count below to obtain the actual mean aggregate + // value. The only possible value types are Long and Double. + MeanSum interface{} `json:"meanSum,omitempty"` + + // Name: Name of the metric. + Name *MetricStructuredName `json:"name,omitempty"` + + // Scalar: Worker-computed aggregate value for aggregation kinds "Sum", + // "Max", "Min", "And", and "Or". The possible value types are Long, + // Double, and Boolean. + Scalar interface{} `json:"scalar,omitempty"` + + // Set: Worker-computed aggregate value for the "Set" aggregation kind. + // The only possible value type is a list of Values whose type can be + // Long, Double, or String, according to the metric's type. All Values + // in the list must be of the same type. + Set interface{} `json:"set,omitempty"` + + // UpdateTime: Timestamp associated with the metric value. Optional when + // workers are reporting work progress; it will be filled in responses + // from the metrics API. + UpdateTime string `json:"updateTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Cumulative") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MetricUpdate) MarshalJSON() ([]byte, error) { + type noMethod MetricUpdate + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MountedDataDisk: Describes mounted data disk. +type MountedDataDisk struct { + // DataDisk: The name of the data disk. This name is local to the Google + // Cloud Platform project and uniquely identifies the disk within that + // project, for example "myproject-1014-104817-4c2-harness-0-disk-1". + DataDisk string `json:"dataDisk,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DataDisk") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MountedDataDisk) MarshalJSON() ([]byte, error) { + type noMethod MountedDataDisk + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MultiOutputInfo: Information about an output of a multi-output DoFn. +type MultiOutputInfo struct { + // Tag: The id of the tag the user code will emit to this output by; + // this should correspond to the tag of some SideInputInfo. + Tag string `json:"tag,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Tag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MultiOutputInfo) MarshalJSON() ([]byte, error) { + type noMethod MultiOutputInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Package: Packages that need to be installed in order for a worker to +// run the steps of the Dataflow job which will be assigned to its +// worker pool. This is the mechanism by which the SDK causes code to be +// loaded onto the workers. For example, the Dataflow Java SDK might use +// this to install jars containing the user's code and all of the +// various dependencies (libraries, data files, etc) required in order +// for that code to run. +type Package struct { + // Location: The resource to read the package from. The supported + // resource type is: Google Cloud Storage: + // storage.googleapis.com/{bucket} bucket.storage.googleapis.com/ + Location string `json:"location,omitempty"` + + // Name: The name of the package. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Location") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Package) MarshalJSON() ([]byte, error) { + type noMethod Package + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ParDoInstruction: An instruction that does a ParDo operation. Takes +// one main input and zero or more side inputs, and produces zero or +// more outputs. Runs user code. +type ParDoInstruction struct { + // Input: The input. + Input *InstructionInput `json:"input,omitempty"` + + // MultiOutputInfos: Information about each of the outputs, if user_fn + // is a MultiDoFn. + MultiOutputInfos []*MultiOutputInfo `json:"multiOutputInfos,omitempty"` + + // NumOutputs: The number of outputs. + NumOutputs int64 `json:"numOutputs,omitempty"` + + // SideInputs: Zero or more side inputs. + SideInputs []*SideInputInfo `json:"sideInputs,omitempty"` + + // UserFn: The user function to invoke. + UserFn ParDoInstructionUserFn `json:"userFn,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Input") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ParDoInstruction) MarshalJSON() ([]byte, error) { + type noMethod ParDoInstruction + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ParDoInstructionUserFn interface{} + +// ParallelInstruction: Describes a particular operation comprising a +// MapTask. +type ParallelInstruction struct { + // Flatten: Additional information for Flatten instructions. + Flatten *FlattenInstruction `json:"flatten,omitempty"` + + // Name: User-provided name of this operation. + Name string `json:"name,omitempty"` + + // Outputs: Describes the outputs of the instruction. + Outputs []*InstructionOutput `json:"outputs,omitempty"` + + // ParDo: Additional information for ParDo instructions. + ParDo *ParDoInstruction `json:"parDo,omitempty"` + + // PartialGroupByKey: Additional information for PartialGroupByKey + // instructions. + PartialGroupByKey *PartialGroupByKeyInstruction `json:"partialGroupByKey,omitempty"` + + // Read: Additional information for Read instructions. + Read *ReadInstruction `json:"read,omitempty"` + + // SystemName: System-defined name of this operation. Unique across the + // workflow. + SystemName string `json:"systemName,omitempty"` + + // Write: Additional information for Write instructions. + Write *WriteInstruction `json:"write,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Flatten") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ParallelInstruction) MarshalJSON() ([]byte, error) { + type noMethod ParallelInstruction + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PartialGroupByKeyInstruction: An instruction that does a partial +// group-by-key. One input and one output. +type PartialGroupByKeyInstruction struct { + // Input: Describes the input to the partial group-by-key instruction. + Input *InstructionInput `json:"input,omitempty"` + + // InputElementCodec: The codec to use for interpreting an element in + // the input PTable. + InputElementCodec PartialGroupByKeyInstructionInputElementCodec `json:"inputElementCodec,omitempty"` + + // ValueCombiningFn: The value combining function to invoke. + ValueCombiningFn PartialGroupByKeyInstructionValueCombiningFn `json:"valueCombiningFn,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Input") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PartialGroupByKeyInstruction) MarshalJSON() ([]byte, error) { + type noMethod PartialGroupByKeyInstruction + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PartialGroupByKeyInstructionInputElementCodec interface{} + +type PartialGroupByKeyInstructionValueCombiningFn interface{} + +// Position: Position defines a position within a collection of data. +// The value can be either the end position, a key (used with ordered +// collections), a byte offset, or a record index. +type Position struct { + // ByteOffset: Position is a byte offset. + ByteOffset int64 `json:"byteOffset,omitempty,string"` + + // ConcatPosition: CloudPosition is a concat position. + ConcatPosition *ConcatPosition `json:"concatPosition,omitempty"` + + // End: Position is past all other positions. Also useful for the end + // position of an unbounded range. + End bool `json:"end,omitempty"` + + // Key: Position is a string key, ordered lexicographically. + Key string `json:"key,omitempty"` + + // RecordIndex: Position is a record index. + RecordIndex int64 `json:"recordIndex,omitempty,string"` + + // ShufflePosition: CloudPosition is a base64 encoded + // BatchShufflePosition (with FIXED sharding). + ShufflePosition string `json:"shufflePosition,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ByteOffset") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Position) MarshalJSON() ([]byte, error) { + type noMethod Position + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PubsubLocation: Identifies a pubsub location to use for transferring +// data into or out of a streaming Dataflow job. +type PubsubLocation struct { + // DropLateData: Indicates whether the pipeline allows late-arriving + // data. + DropLateData bool `json:"dropLateData,omitempty"` + + // IdLabel: If set, contains a pubsub label from which to extract record + // ids. If left empty, record deduplication will be strictly best + // effort. + IdLabel string `json:"idLabel,omitempty"` + + // Subscription: A pubsub subscription, in the form of + // "pubsub.googleapis.com/subscriptions/ + // /" + Subscription string `json:"subscription,omitempty"` + + // TimestampLabel: If set, contains a pubsub label from which to extract + // record timestamps. If left empty, record timestamps will be generated + // upon arrival. + TimestampLabel string `json:"timestampLabel,omitempty"` + + // Topic: A pubsub topic, in the form of + // "pubsub.googleapis.com/topics/ + // /" + Topic string `json:"topic,omitempty"` + + // TrackingSubscription: If set, specifies the pubsub subscription that + // will be used for tracking custom time timestamps for watermark + // estimation. + TrackingSubscription string `json:"trackingSubscription,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DropLateData") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PubsubLocation) MarshalJSON() ([]byte, error) { + type noMethod PubsubLocation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReadInstruction: An instruction that reads records. Takes no inputs, +// produces one output. +type ReadInstruction struct { + // Source: The source to read from. + Source *Source `json:"source,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Source") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReadInstruction) MarshalJSON() ([]byte, error) { + type noMethod ReadInstruction + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportWorkItemStatusRequest: Request to report the status of +// WorkItems. +type ReportWorkItemStatusRequest struct { + // CurrentWorkerTime: The current timestamp at the worker. + CurrentWorkerTime string `json:"currentWorkerTime,omitempty"` + + // WorkItemStatuses: The order is unimportant, except that the order of + // the WorkItemServiceState messages in the ReportWorkItemStatusResponse + // corresponds to the order of WorkItemStatus messages here. + WorkItemStatuses []*WorkItemStatus `json:"workItemStatuses,omitempty"` + + // WorkerId: The ID of the worker reporting the WorkItem status. If this + // does not match the ID of the worker which the Dataflow service + // believes currently has the lease on the WorkItem, the report will be + // dropped (with an error response). + WorkerId string `json:"workerId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CurrentWorkerTime") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportWorkItemStatusRequest) MarshalJSON() ([]byte, error) { + type noMethod ReportWorkItemStatusRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportWorkItemStatusResponse: Response from a request to report the +// status of WorkItems. +type ReportWorkItemStatusResponse struct { + // WorkItemServiceStates: A set of messages indicating the service-side + // state for each WorkItem whose status was reported, in the same order + // as the WorkItemStatus messages in the ReportWorkItemStatusRequest + // which resulting in this response. + WorkItemServiceStates []*WorkItemServiceState `json:"workItemServiceStates,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "WorkItemServiceStates") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportWorkItemStatusResponse) MarshalJSON() ([]byte, error) { + type noMethod ReportWorkItemStatusResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SeqMapTask: Describes a particular function to invoke. +type SeqMapTask struct { + // Inputs: Information about each of the inputs. + Inputs []*SideInputInfo `json:"inputs,omitempty"` + + // Name: The user-provided name of the SeqDo operation. + Name string `json:"name,omitempty"` + + // OutputInfos: Information about each of the outputs. + OutputInfos []*SeqMapTaskOutputInfo `json:"outputInfos,omitempty"` + + // StageName: System-defined name of the stage containing the SeqDo + // operation. Unique across the workflow. + StageName string `json:"stageName,omitempty"` + + // SystemName: System-defined name of the SeqDo operation. Unique across + // the workflow. + SystemName string `json:"systemName,omitempty"` + + // UserFn: The user function to invoke. + UserFn SeqMapTaskUserFn `json:"userFn,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Inputs") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SeqMapTask) MarshalJSON() ([]byte, error) { + type noMethod SeqMapTask + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type SeqMapTaskUserFn interface{} + +// SeqMapTaskOutputInfo: Information about an output of a SeqMapTask. +type SeqMapTaskOutputInfo struct { + // Sink: The sink to write the output value to. + Sink *Sink `json:"sink,omitempty"` + + // Tag: The id of the TupleTag the user code will tag the output value + // by. + Tag string `json:"tag,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Sink") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SeqMapTaskOutputInfo) MarshalJSON() ([]byte, error) { + type noMethod SeqMapTaskOutputInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ShellTask: A task which consists of a shell command for the worker to +// execute. +type ShellTask struct { + // Command: The shell command to run. + Command string `json:"command,omitempty"` + + // ExitCode: Exit code for the task. + ExitCode int64 `json:"exitCode,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Command") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ShellTask) MarshalJSON() ([]byte, error) { + type noMethod ShellTask + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SideInputInfo: Information about a side input of a DoFn or an input +// of a SeqDoFn. +type SideInputInfo struct { + // Kind: How to interpret the source element(s) as a side input value. + Kind SideInputInfoKind `json:"kind,omitempty"` + + // Sources: The source(s) to read element(s) from to get the value of + // this side input. If more than one source, then the elements are taken + // from the sources, in the specified order if order matters. At least + // one source is required. + Sources []*Source `json:"sources,omitempty"` + + // Tag: The id of the tag the user code will access this side input by; + // this should correspond to the tag of some MultiOutputInfo. + Tag string `json:"tag,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SideInputInfo) MarshalJSON() ([]byte, error) { + type noMethod SideInputInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type SideInputInfoKind interface{} + +// Sink: A sink that records can be encoded and written to. +type Sink struct { + // Codec: The codec to use to encode data written to the sink. + Codec SinkCodec `json:"codec,omitempty"` + + // Spec: The sink to write to, plus its parameters. + Spec SinkSpec `json:"spec,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Codec") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Sink) MarshalJSON() ([]byte, error) { + type noMethod Sink + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type SinkCodec interface{} + +type SinkSpec interface{} + +// Source: A source that records can be read and decoded from. +type Source struct { + // BaseSpecs: While splitting, sources may specify the produced bundles + // as differences against another source, in order to save backend-side + // memory and allow bigger jobs. For details, see SourceSplitRequest. To + // support this use case, the full set of parameters of the source is + // logically obtained by taking the latest explicitly specified value of + // each parameter in the order: base_specs (later items win), spec + // (overrides anything in base_specs). + BaseSpecs []SourceBaseSpecs `json:"baseSpecs,omitempty"` + + // Codec: The codec to use to decode data read from the source. + Codec SourceCodec `json:"codec,omitempty"` + + // DoesNotNeedSplitting: Setting this value to true hints to the + // framework that the source doesn't need splitting, and using + // SourceSplitRequest on it would yield + // SOURCE_SPLIT_OUTCOME_USE_CURRENT. E.g. a file splitter may set this + // to true when splitting a single file into a set of byte ranges of + // appropriate size, and set this to false when splitting a filepattern + // into individual files. However, for efficiency, a file splitter may + // decide to produce file subranges directly from the filepattern to + // avoid a splitting round-trip. See SourceSplitRequest for an overview + // of the splitting process. This field is meaningful only in the Source + // objects populated by the user (e.g. when filling in a DerivedSource). + // Source objects supplied by the framework to the user don't have this + // field populated. + DoesNotNeedSplitting bool `json:"doesNotNeedSplitting,omitempty"` + + // Metadata: Optionally, metadata for this source can be supplied right + // away, avoiding a SourceGetMetadataOperation roundtrip (see + // SourceOperationRequest). This field is meaningful only in the Source + // objects populated by the user (e.g. when filling in a DerivedSource). + // Source objects supplied by the framework to the user don't have this + // field populated. + Metadata *SourceMetadata `json:"metadata,omitempty"` + + // Spec: The source to read from, plus its parameters. + Spec SourceSpec `json:"spec,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BaseSpecs") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Source) MarshalJSON() ([]byte, error) { + type noMethod Source + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type SourceBaseSpecs interface{} + +type SourceCodec interface{} + +type SourceSpec interface{} + +// SourceFork: DEPRECATED in favor of DynamicSourceSplit. +type SourceFork struct { + // Primary: DEPRECATED + Primary *SourceSplitShard `json:"primary,omitempty"` + + // PrimarySource: DEPRECATED + PrimarySource *DerivedSource `json:"primarySource,omitempty"` + + // Residual: DEPRECATED + Residual *SourceSplitShard `json:"residual,omitempty"` + + // ResidualSource: DEPRECATED + ResidualSource *DerivedSource `json:"residualSource,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Primary") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SourceFork) MarshalJSON() ([]byte, error) { + type noMethod SourceFork + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SourceGetMetadataRequest: A request to compute the SourceMetadata of +// a Source. +type SourceGetMetadataRequest struct { + // Source: Specification of the source whose metadata should be + // computed. + Source *Source `json:"source,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Source") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SourceGetMetadataRequest) MarshalJSON() ([]byte, error) { + type noMethod SourceGetMetadataRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SourceGetMetadataResponse: The result of a +// SourceGetMetadataOperation. +type SourceGetMetadataResponse struct { + // Metadata: The computed metadata. + Metadata *SourceMetadata `json:"metadata,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Metadata") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SourceGetMetadataResponse) MarshalJSON() ([]byte, error) { + type noMethod SourceGetMetadataResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SourceMetadata: Metadata about a Source useful for automatically +// optimizing and tuning the pipeline, etc. +type SourceMetadata struct { + // EstimatedSizeBytes: An estimate of the total size (in bytes) of the + // data that would be read from this source. This estimate is in terms + // of external storage size, before any decompression or other + // processing done by the reader. + EstimatedSizeBytes int64 `json:"estimatedSizeBytes,omitempty,string"` + + // Infinite: Specifies that the size of this source is known to be + // infinite (this is a streaming source). + Infinite bool `json:"infinite,omitempty"` + + // ProducesSortedKeys: Whether this source is known to produce key/value + // pairs with the (encoded) keys in lexicographically sorted order. + ProducesSortedKeys bool `json:"producesSortedKeys,omitempty"` + + // ForceSendFields is a list of field names (e.g. "EstimatedSizeBytes") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SourceMetadata) MarshalJSON() ([]byte, error) { + type noMethod SourceMetadata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SourceOperationRequest: A work item that represents the different +// operations that can be performed on a user-defined Source +// specification. +type SourceOperationRequest struct { + // GetMetadata: Information about a request to get metadata about a + // source. + GetMetadata *SourceGetMetadataRequest `json:"getMetadata,omitempty"` + + // Split: Information about a request to split a source. + Split *SourceSplitRequest `json:"split,omitempty"` + + // ForceSendFields is a list of field names (e.g. "GetMetadata") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SourceOperationRequest) MarshalJSON() ([]byte, error) { + type noMethod SourceOperationRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SourceOperationResponse: The result of a SourceOperationRequest, +// specified in ReportWorkItemStatusRequest.source_operation when the +// work item is completed. +type SourceOperationResponse struct { + // GetMetadata: A response to a request to get metadata about a source. + GetMetadata *SourceGetMetadataResponse `json:"getMetadata,omitempty"` + + // Split: A response to a request to split a source. + Split *SourceSplitResponse `json:"split,omitempty"` + + // ForceSendFields is a list of field names (e.g. "GetMetadata") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SourceOperationResponse) MarshalJSON() ([]byte, error) { + type noMethod SourceOperationResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SourceSplitOptions: Hints for splitting a Source into bundles (parts +// for parallel processing) using SourceSplitRequest. +type SourceSplitOptions struct { + // DesiredBundleSizeBytes: The source should be split into a set of + // bundles where the estimated size of each is approximately this many + // bytes. + DesiredBundleSizeBytes int64 `json:"desiredBundleSizeBytes,omitempty,string"` + + // DesiredShardSizeBytes: DEPRECATED in favor of + // desired_bundle_size_bytes. + DesiredShardSizeBytes int64 `json:"desiredShardSizeBytes,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. + // "DesiredBundleSizeBytes") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SourceSplitOptions) MarshalJSON() ([]byte, error) { + type noMethod SourceSplitOptions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SourceSplitRequest: Represents the operation to split a high-level +// Source specification into bundles (parts for parallel processing). At +// a high level, splitting of a source into bundles happens as follows: +// SourceSplitRequest is applied to the source. If it returns +// SOURCE_SPLIT_OUTCOME_USE_CURRENT, no further splitting happens and +// the source is used "as is". Otherwise, splitting is applied +// recursively to each produced DerivedSource. As an optimization, for +// any Source, if its does_not_need_splitting is true, the framework +// assumes that splitting this source would return +// SOURCE_SPLIT_OUTCOME_USE_CURRENT, and doesn't initiate a +// SourceSplitRequest. This applies both to the initial source being +// split and to bundles produced from it. +type SourceSplitRequest struct { + // Options: Hints for tuning the splitting process. + Options *SourceSplitOptions `json:"options,omitempty"` + + // Source: Specification of the source to be split. + Source *Source `json:"source,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Options") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SourceSplitRequest) MarshalJSON() ([]byte, error) { + type noMethod SourceSplitRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SourceSplitResponse: The response to a SourceSplitRequest. +type SourceSplitResponse struct { + // Bundles: If outcome is SPLITTING_HAPPENED, then this is a list of + // bundles into which the source was split. Otherwise this field is + // ignored. This list can be empty, which means the source represents an + // empty input. + Bundles []*DerivedSource `json:"bundles,omitempty"` + + // Outcome: Indicates whether splitting happened and produced a list of + // bundles. If this is USE_CURRENT_SOURCE_AS_IS, the current source + // should be processed "as is" without splitting. "bundles" is ignored + // in this case. If this is SPLITTING_HAPPENED, then "bundles" contains + // a list of bundles into which the source was split. + // + // Possible values: + // "SOURCE_SPLIT_OUTCOME_UNKNOWN" + // "SOURCE_SPLIT_OUTCOME_USE_CURRENT" + // "SOURCE_SPLIT_OUTCOME_SPLITTING_HAPPENED" + Outcome string `json:"outcome,omitempty"` + + // Shards: DEPRECATED in favor of bundles. + Shards []*SourceSplitShard `json:"shards,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Bundles") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SourceSplitResponse) MarshalJSON() ([]byte, error) { + type noMethod SourceSplitResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SourceSplitShard: DEPRECATED in favor of DerivedSource. +type SourceSplitShard struct { + // DerivationMode: DEPRECATED + // + // Possible values: + // "SOURCE_DERIVATION_MODE_UNKNOWN" + // "SOURCE_DERIVATION_MODE_INDEPENDENT" + // "SOURCE_DERIVATION_MODE_CHILD_OF_CURRENT" + // "SOURCE_DERIVATION_MODE_SIBLING_OF_CURRENT" + DerivationMode string `json:"derivationMode,omitempty"` + + // Source: DEPRECATED + Source *Source `json:"source,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DerivationMode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SourceSplitShard) MarshalJSON() ([]byte, error) { + type noMethod SourceSplitShard + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// StateFamilyConfig: State family configuration. +type StateFamilyConfig struct { + // IsRead: If true, this family corresponds to a read operation. + IsRead bool `json:"isRead,omitempty"` + + // StateFamily: The state family value. + StateFamily string `json:"stateFamily,omitempty"` + + // ForceSendFields is a list of field names (e.g. "IsRead") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *StateFamilyConfig) MarshalJSON() ([]byte, error) { + type noMethod StateFamilyConfig + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Status: The `Status` type defines a logical error model that is +// suitable for different programming environments, including REST APIs +// and RPC APIs. It is used by [gRPC](https://github.com/grpc). The +// error model is designed to be: - Simple to use and understand for +// most users - Flexible enough to meet unexpected needs # Overview The +// `Status` message contains three pieces of data: error code, error +// message, and error details. The error code should be an enum value of +// [google.rpc.Code][], but it may accept additional error codes if +// needed. The error message should be a developer-facing English +// message that helps developers *understand* and *resolve* the error. +// If a localized user-facing error message is needed, put the localized +// message in the error details or localize it in the client. The +// optional error details may contain arbitrary information about the +// error. There is a predefined set of error detail types in the package +// `google.rpc` which can be used for common error conditions. # +// Language mapping The `Status` message is the logical representation +// of the error model, but it is not necessarily the actual wire format. +// When the `Status` message is exposed in different client libraries +// and different wire protocols, it can be mapped differently. For +// example, it will likely be mapped to some exceptions in Java, but +// more likely mapped to some error codes in C. # Other uses The error +// model and the `Status` message can be used in a variety of +// environments, either with or without APIs, to provide a consistent +// developer experience across different environments. Example uses of +// this error model include: - Partial errors. If a service needs to +// return partial errors to the client, it may embed the `Status` in the +// normal response to indicate the partial errors. - Workflow errors. A +// typical workflow has multiple steps. Each step may have a `Status` +// message for error reporting purpose. - Batch operations. If a client +// uses batch request and batch response, the `Status` message should be +// used directly inside batch response, one for each error sub-response. +// - Asynchronous operations. If an API call embeds asynchronous +// operation results in its response, the status of those operations +// should be represented directly using the `Status` message. - Logging. +// If some API errors are stored in logs, the message `Status` could be +// used directly after any stripping needed for security/privacy +// reasons. +type Status struct { + // Code: The status code, which should be an enum value of + // [google.rpc.Code][]. + Code int64 `json:"code,omitempty"` + + // Details: A list of messages that carry the error details. There will + // be a common set of message types for APIs to use. + Details []StatusDetails `json:"details,omitempty"` + + // Message: A developer-facing error message, which should be in + // English. Any user-facing error message should be localized and sent + // in the [google.rpc.Status.details][google.rpc.Status.details] field, + // or localized by the client. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Status) MarshalJSON() ([]byte, error) { + type noMethod Status + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type StatusDetails interface{} + +// Step: Defines a particular step within a Dataflow job. A job consists +// of multiple steps, each of which performs some specific operation as +// part of the overall job. Data is typically passed from one step to +// another as part of the job. Here's an example of a sequence of steps +// which together implement a Map-Reduce job: * Read a collection of +// data from some source, parsing the collection's elements. * Validate +// the elements. * Apply a user-defined function to map each element to +// some value and extract an element-specific key value. * Group +// elements with the same key into a single element with that key, +// transforming a multiply-keyed collection into a uniquely-keyed +// collection. * Write the elements out to some data sink. (Note that +// the Dataflow service may be used to run many different types of jobs, +// not just Map-Reduce). +type Step struct { + // Kind: The kind of step in the dataflow Job. + Kind string `json:"kind,omitempty"` + + // Name: Name identifying the step. This must be unique for each step + // with respect to all other steps in the dataflow Job. + Name string `json:"name,omitempty"` + + // Properties: Named properties associated with the step. Each kind of + // predefined step has its own required set of properties. + Properties StepProperties `json:"properties,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Step) MarshalJSON() ([]byte, error) { + type noMethod Step + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type StepProperties interface{} + +// StreamLocation: Describes a stream of data, either as input to be +// processed or as output of a streaming Dataflow job. +type StreamLocation struct { + // CustomSourceLocation: The stream is a custom source. + CustomSourceLocation *CustomSourceLocation `json:"customSourceLocation,omitempty"` + + // PubsubLocation: The stream is a pubsub stream. + PubsubLocation *PubsubLocation `json:"pubsubLocation,omitempty"` + + // SideInputLocation: The stream is a streaming side input. + SideInputLocation *StreamingSideInputLocation `json:"sideInputLocation,omitempty"` + + // StreamingStageLocation: The stream is part of another computation + // within the current streaming Dataflow job. + StreamingStageLocation *StreamingStageLocation `json:"streamingStageLocation,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "CustomSourceLocation") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *StreamLocation) MarshalJSON() ([]byte, error) { + type noMethod StreamLocation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// StreamingComputationRanges: Describes full or partial data disk +// assignment information of the computation ranges. +type StreamingComputationRanges struct { + // ComputationId: The ID of the computation. + ComputationId string `json:"computationId,omitempty"` + + // RangeAssignments: Data disk assignments for ranges from this + // computation. + RangeAssignments []*KeyRangeDataDiskAssignment `json:"rangeAssignments,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ComputationId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *StreamingComputationRanges) MarshalJSON() ([]byte, error) { + type noMethod StreamingComputationRanges + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// StreamingComputationTask: A task which describes what action should +// be performed for the specified streaming computation ranges. +type StreamingComputationTask struct { + // ComputationRanges: Contains ranges of a streaming computation this + // task should apply to. + ComputationRanges []*StreamingComputationRanges `json:"computationRanges,omitempty"` + + // DataDisks: Describes the set of data disks this task should apply to. + DataDisks []*MountedDataDisk `json:"dataDisks,omitempty"` + + // TaskType: A type of streaming computation task. + // + // Possible values: + // "STREAMING_COMPUTATION_TASK_UNKNOWN" + // "STREAMING_COMPUTATION_TASK_STOP" + // "STREAMING_COMPUTATION_TASK_START" + TaskType string `json:"taskType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ComputationRanges") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *StreamingComputationTask) MarshalJSON() ([]byte, error) { + type noMethod StreamingComputationTask + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// StreamingSetupTask: A task which initializes part of a streaming +// Dataflow job. +type StreamingSetupTask struct { + // ReceiveWorkPort: The TCP port on which the worker should listen for + // messages from other streaming computation workers. + ReceiveWorkPort int64 `json:"receiveWorkPort,omitempty"` + + // StreamingComputationTopology: The global topology of the streaming + // Dataflow job. + StreamingComputationTopology *TopologyConfig `json:"streamingComputationTopology,omitempty"` + + // WorkerHarnessPort: The TCP port used by the worker to communicate + // with the Dataflow worker harness. + WorkerHarnessPort int64 `json:"workerHarnessPort,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ReceiveWorkPort") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *StreamingSetupTask) MarshalJSON() ([]byte, error) { + type noMethod StreamingSetupTask + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// StreamingSideInputLocation: Identifies the location of a streaming +// side input. +type StreamingSideInputLocation struct { + // StateFamily: Identifies the state family where this side input is + // stored. + StateFamily string `json:"stateFamily,omitempty"` + + // Tag: Identifies the particular side input within the streaming + // Dataflow job. + Tag string `json:"tag,omitempty"` + + // ForceSendFields is a list of field names (e.g. "StateFamily") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *StreamingSideInputLocation) MarshalJSON() ([]byte, error) { + type noMethod StreamingSideInputLocation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// StreamingStageLocation: Identifies the location of a streaming +// computation stage, for stage-to-stage communication. +type StreamingStageLocation struct { + // StreamId: Identifies the particular stream within the streaming + // Dataflow job. + StreamId string `json:"streamId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "StreamId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *StreamingStageLocation) MarshalJSON() ([]byte, error) { + type noMethod StreamingStageLocation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TaskRunnerSettings: Taskrunner configuration settings. +type TaskRunnerSettings struct { + // Alsologtostderr: Also send taskrunner log info to stderr? + Alsologtostderr bool `json:"alsologtostderr,omitempty"` + + // BaseTaskDir: Location on the worker for task-specific subdirectories. + BaseTaskDir string `json:"baseTaskDir,omitempty"` + + // BaseUrl: The base URL for the taskrunner to use when accessing Google + // Cloud APIs. When workers access Google Cloud APIs, they logically do + // so via relative URLs. If this field is specified, it supplies the + // base URL to use for resolving these relative URLs. The normative + // algorithm used is defined by RFC 1808, "Relative Uniform Resource + // Locators". If not specified, the default value is + // "http://www.googleapis.com/" + BaseUrl string `json:"baseUrl,omitempty"` + + // CommandlinesFileName: Store preprocessing commands in this file. + CommandlinesFileName string `json:"commandlinesFileName,omitempty"` + + // ContinueOnException: Do we continue taskrunner if an exception is + // hit? + ContinueOnException bool `json:"continueOnException,omitempty"` + + // DataflowApiVersion: API version of endpoint, e.g. "v1b3" + DataflowApiVersion string `json:"dataflowApiVersion,omitempty"` + + // HarnessCommand: Command to launch the worker harness. + HarnessCommand string `json:"harnessCommand,omitempty"` + + // LanguageHint: Suggested backend language. + LanguageHint string `json:"languageHint,omitempty"` + + // LogDir: Directory on the VM to store logs. + LogDir string `json:"logDir,omitempty"` + + // LogToSerialconsole: Send taskrunner log into to Google Compute Engine + // VM serial console? + LogToSerialconsole bool `json:"logToSerialconsole,omitempty"` + + // LogUploadLocation: Indicates where to put logs. If this is not + // specified, the logs will not be uploaded. The supported resource type + // is: Google Cloud Storage: storage.googleapis.com/{bucket}/{object} + // bucket.storage.googleapis.com/{object} + LogUploadLocation string `json:"logUploadLocation,omitempty"` + + // OauthScopes: OAuth2 scopes to be requested by the taskrunner in order + // to access the dataflow API. + OauthScopes []string `json:"oauthScopes,omitempty"` + + // ParallelWorkerSettings: Settings to pass to the parallel worker + // harness. + ParallelWorkerSettings *WorkerSettings `json:"parallelWorkerSettings,omitempty"` + + // StreamingWorkerMainClass: Streaming worker main class name. + StreamingWorkerMainClass string `json:"streamingWorkerMainClass,omitempty"` + + // TaskGroup: The UNIX group ID on the worker VM to use for tasks + // launched by taskrunner; e.g. "wheel". + TaskGroup string `json:"taskGroup,omitempty"` + + // TaskUser: The UNIX user ID on the worker VM to use for tasks launched + // by taskrunner; e.g. "root". + TaskUser string `json:"taskUser,omitempty"` + + // TempStoragePrefix: The prefix of the resources the taskrunner should + // use for temporary storage. The supported resource type is: Google + // Cloud Storage: storage.googleapis.com/{bucket}/{object} + // bucket.storage.googleapis.com/{object} + TempStoragePrefix string `json:"tempStoragePrefix,omitempty"` + + // VmId: ID string of VM. + VmId string `json:"vmId,omitempty"` + + // WorkflowFileName: Store the workflow in this file. + WorkflowFileName string `json:"workflowFileName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Alsologtostderr") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TaskRunnerSettings) MarshalJSON() ([]byte, error) { + type noMethod TaskRunnerSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TopologyConfig: Global topology of the streaming Dataflow job, +// including all computations and their sharded locations. +type TopologyConfig struct { + // Computations: The computations associated with a streaming Dataflow + // job. + Computations []*ComputationTopology `json:"computations,omitempty"` + + // DataDiskAssignments: The disks assigned to a streaming Dataflow job. + DataDiskAssignments []*DataDiskAssignment `json:"dataDiskAssignments,omitempty"` + + // UserStageToComputationNameMap: Maps user stage names to stable + // computation names. + UserStageToComputationNameMap map[string]string `json:"userStageToComputationNameMap,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Computations") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TopologyConfig) MarshalJSON() ([]byte, error) { + type noMethod TopologyConfig + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// WorkItem: WorkItem represents basic information about a WorkItem to +// be executed in the cloud. +type WorkItem struct { + // Configuration: Work item-specific configuration as an opaque blob. + Configuration string `json:"configuration,omitempty"` + + // Id: Identifies this WorkItem. + Id int64 `json:"id,omitempty,string"` + + // InitialReportIndex: The initial index to use when reporting the + // status of the WorkItem. + InitialReportIndex int64 `json:"initialReportIndex,omitempty,string"` + + // JobId: Identifies the workflow job this WorkItem belongs to. + JobId string `json:"jobId,omitempty"` + + // LeaseExpireTime: Time when the lease on this [Work][] will expire. + LeaseExpireTime string `json:"leaseExpireTime,omitempty"` + + // MapTask: Additional information for MapTask WorkItems. + MapTask *MapTask `json:"mapTask,omitempty"` + + // Packages: Any required packages that need to be fetched in order to + // execute this WorkItem. + Packages []*Package `json:"packages,omitempty"` + + // ProjectId: Identifies the cloud project this WorkItem belongs to. + ProjectId string `json:"projectId,omitempty"` + + // ReportStatusInterval: Recommended reporting interval. + ReportStatusInterval string `json:"reportStatusInterval,omitempty"` + + // SeqMapTask: Additional information for SeqMapTask WorkItems. + SeqMapTask *SeqMapTask `json:"seqMapTask,omitempty"` + + // ShellTask: Additional information for ShellTask WorkItems. + ShellTask *ShellTask `json:"shellTask,omitempty"` + + // SourceOperationTask: Additional information for source operation + // WorkItems. + SourceOperationTask *SourceOperationRequest `json:"sourceOperationTask,omitempty"` + + // StreamingComputationTask: Additional information for + // StreamingComputationTask WorkItems. + StreamingComputationTask *StreamingComputationTask `json:"streamingComputationTask,omitempty"` + + // StreamingSetupTask: Additional information for StreamingSetupTask + // WorkItems. + StreamingSetupTask *StreamingSetupTask `json:"streamingSetupTask,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Configuration") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *WorkItem) MarshalJSON() ([]byte, error) { + type noMethod WorkItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// WorkItemServiceState: The Dataflow service's idea of the current +// state of a WorkItem being processed by a worker. +type WorkItemServiceState struct { + // HarnessData: Other data returned by the service, specific to the + // particular worker harness. + HarnessData WorkItemServiceStateHarnessData `json:"harnessData,omitempty"` + + // LeaseExpireTime: Time at which the current lease will expire. + LeaseExpireTime string `json:"leaseExpireTime,omitempty"` + + // NextReportIndex: The index value to use for the next report sent by + // the worker. Note: If the report call fails for whatever reason, the + // worker should reuse this index for subsequent report attempts. + NextReportIndex int64 `json:"nextReportIndex,omitempty,string"` + + // ReportStatusInterval: New recommended reporting interval. + ReportStatusInterval string `json:"reportStatusInterval,omitempty"` + + // SuggestedStopPoint: The progress point in the WorkItem where the + // Dataflow service suggests that the worker truncate the task. + SuggestedStopPoint *ApproximateProgress `json:"suggestedStopPoint,omitempty"` + + // SuggestedStopPosition: Obsolete, always empty. + SuggestedStopPosition *Position `json:"suggestedStopPosition,omitempty"` + + // ForceSendFields is a list of field names (e.g. "HarnessData") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *WorkItemServiceState) MarshalJSON() ([]byte, error) { + type noMethod WorkItemServiceState + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type WorkItemServiceStateHarnessData interface{} + +// WorkItemStatus: Conveys a worker's progress through the work +// described by a WorkItem. +type WorkItemStatus struct { + // Completed: True if the WorkItem was completed (successfully or + // unsuccessfully). + Completed bool `json:"completed,omitempty"` + + // DynamicSourceSplit: See documentation of stop_position. + DynamicSourceSplit *DynamicSourceSplit `json:"dynamicSourceSplit,omitempty"` + + // Errors: Specifies errors which occurred during processing. If errors + // are provided, and completed = true, then the WorkItem is considered + // to have failed. + Errors []*Status `json:"errors,omitempty"` + + // MetricUpdates: Worker output metrics (counters) for this WorkItem. + MetricUpdates []*MetricUpdate `json:"metricUpdates,omitempty"` + + // Progress: The WorkItem's approximate progress. + Progress *ApproximateProgress `json:"progress,omitempty"` + + // ReportIndex: The report index. When a WorkItem is leased, the lease + // will contain an initial report index. When a WorkItem's status is + // reported to the system, the report should be sent with that report + // index, and the response will contain the index the worker should use + // for the next report. Reports received with unexpected index values + // will be rejected by the service. In order to preserve idempotency, + // the worker should not alter the contents of a report, even if the + // worker must submit the same report multiple times before getting back + // a response. The worker should not submit a subsequent report until + // the response for the previous report had been received from the + // service. + ReportIndex int64 `json:"reportIndex,omitempty,string"` + + // RequestedLeaseDuration: Amount of time the worker requests for its + // lease. + RequestedLeaseDuration string `json:"requestedLeaseDuration,omitempty"` + + // SourceFork: DEPRECATED in favor of dynamic_source_split. + SourceFork *SourceFork `json:"sourceFork,omitempty"` + + // SourceOperationResponse: If the work item represented a + // SourceOperationRequest, and the work is completed, contains the + // result of the operation. + SourceOperationResponse *SourceOperationResponse `json:"sourceOperationResponse,omitempty"` + + // StopPosition: A worker may split an active map task in two parts, + // "primary" and "residual", continuing to process the primary part and + // returning the residual part into the pool of available work. This + // event is called a "dynamic split" and is critical to the dynamic work + // rebalancing feature. The two obtained sub-tasks are called "parts" of + // the split. The parts, if concatenated, must represent the same input + // as would be read by the current task if the split did not happen. The + // exact way in which the original task is decomposed into the two parts + // is specified either as a position demarcating them (stop_position), + // or explicitly as two DerivedSources, if this task consumes a + // user-defined source type (dynamic_source_split). The "current" task + // is adjusted as a result of the split: after a task with range [A, B) + // sends a stop_position update at C, its range is considered to be [A, + // C), e.g.: * Progress should be interpreted relative to the new range, + // e.g. "75% completed" means "75% of [A, C) completed" * The worker + // should interpret proposed_stop_position relative to the new range, + // e.g. "split at 68%" should be interpreted as "split at 68% of [A, + // C)". * If the worker chooses to split again using stop_position, only + // stop_positions in [A, C) will be accepted. * Etc. + // dynamic_source_split has similar semantics: e.g., if a task with + // source S splits using dynamic_source_split into {P, R} (where P and R + // must be together equivalent to S), then subsequent progress and + // proposed_stop_position should be interpreted relative to P, and in a + // potential subsequent dynamic_source_split into {P', R'}, P' and R' + // must be together equivalent to P, etc. + StopPosition *Position `json:"stopPosition,omitempty"` + + // WorkItemId: Identifies the WorkItem. + WorkItemId string `json:"workItemId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Completed") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *WorkItemStatus) MarshalJSON() ([]byte, error) { + type noMethod WorkItemStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// WorkerPool: Describes one particular pool of Dataflow workers to be +// instantiated by the Dataflow service in order to perform the +// computations required by a job. Note that a workflow job may use +// multiple pools, in order to match the various computational +// requirements of the various stages of the job. +type WorkerPool struct { + // AutoscalingSettings: Settings for autoscaling of this WorkerPool. + AutoscalingSettings *AutoscalingSettings `json:"autoscalingSettings,omitempty"` + + // DataDisks: Data disks that are used by a VM in this workflow. + DataDisks []*Disk `json:"dataDisks,omitempty"` + + // DefaultPackageSet: The default package set to install. This allows + // the service to select a default set of packages which are useful to + // worker harnesses written in a particular language. + // + // Possible values: + // "DEFAULT_PACKAGE_SET_UNKNOWN" + // "DEFAULT_PACKAGE_SET_NONE" + // "DEFAULT_PACKAGE_SET_JAVA" + // "DEFAULT_PACKAGE_SET_PYTHON" + DefaultPackageSet string `json:"defaultPackageSet,omitempty"` + + // DiskSizeGb: Size of root disk for VMs, in GB. If zero or unspecified, + // the service will attempt to choose a reasonable default. + DiskSizeGb int64 `json:"diskSizeGb,omitempty"` + + // DiskSourceImage: Fully qualified source image for disks. + DiskSourceImage string `json:"diskSourceImage,omitempty"` + + // DiskType: Type of root disk for VMs. If empty or unspecified, the + // service will attempt to choose a reasonable default. + DiskType string `json:"diskType,omitempty"` + + // Kind: The kind of the worker pool; currently only 'harness' and + // 'shuffle' are supported. + Kind string `json:"kind,omitempty"` + + // MachineType: Machine type (e.g. "n1-standard-1"). If empty or + // unspecified, the service will attempt to choose a reasonable default. + MachineType string `json:"machineType,omitempty"` + + // Metadata: Metadata to set on the Google Compute Engine VMs. + Metadata map[string]string `json:"metadata,omitempty"` + + // Network: Network to which VMs will be assigned. If empty or + // unspecified, the service will use the network "default". + Network string `json:"network,omitempty"` + + // NumWorkers: Number of Google Compute Engine workers in this pool + // needed to execute the job. If zero or unspecified, the service will + // attempt to choose a reasonable default. + NumWorkers int64 `json:"numWorkers,omitempty"` + + // OnHostMaintenance: The action to take on host maintenance, as defined + // by the Google Compute Engine API. + OnHostMaintenance string `json:"onHostMaintenance,omitempty"` + + // Packages: Packages to be installed on workers. + Packages []*Package `json:"packages,omitempty"` + + // PoolArgs: Extra arguments for this worker pool. + PoolArgs WorkerPoolPoolArgs `json:"poolArgs,omitempty"` + + // TaskrunnerSettings: Settings passed through to Google Compute Engine + // workers when using the standard Dataflow task runner. Users should + // ignore this field. + TaskrunnerSettings *TaskRunnerSettings `json:"taskrunnerSettings,omitempty"` + + // TeardownPolicy: Sets the policy for determining when to turndown + // worker pool. Allowed values are: TEARDOWN_ALWAYS, + // TEARDOWN_ON_SUCCESS, and TEARDOWN_NEVER. TEARDOWN_ALWAYS means + // workers are always torn down regardless of whether the job succeeds. + // TEARDOWN_ON_SUCCESS means workers are torn down if the job succeeds. + // TEARDOWN_NEVER means the workers are never torn down. If the workers + // are not torn down by the service, they will continue to run and use + // Google Compute Engine VM resources in the user's project until they + // are explicitly terminated by the user. Because of this, Google + // recommends using the TEARDOWN_ALWAYS policy except for small, + // manually supervised test jobs. If unknown or unspecified, the service + // will attempt to choose a reasonable default. + // + // Possible values: + // "TEARDOWN_POLICY_UNKNOWN" + // "TEARDOWN_ALWAYS" + // "TEARDOWN_ON_SUCCESS" + // "TEARDOWN_NEVER" + TeardownPolicy string `json:"teardownPolicy,omitempty"` + + // Zone: Zone to run the worker pools in (e.g. "us-central1-b"). If + // empty or unspecified, the service will attempt to choose a reasonable + // default. + Zone string `json:"zone,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AutoscalingSettings") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *WorkerPool) MarshalJSON() ([]byte, error) { + type noMethod WorkerPool + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type WorkerPoolPoolArgs interface{} + +// WorkerSettings: Provides data to pass through to the worker harness. +type WorkerSettings struct { + // BaseUrl: The base URL for accessing Google Cloud APIs. When workers + // access Google Cloud APIs, they logically do so via relative URLs. If + // this field is specified, it supplies the base URL to use for + // resolving these relative URLs. The normative algorithm used is + // defined by RFC 1808, "Relative Uniform Resource Locators". If not + // specified, the default value is "http://www.googleapis.com/" + BaseUrl string `json:"baseUrl,omitempty"` + + // ReportingEnabled: Send work progress updates to service. + ReportingEnabled bool `json:"reportingEnabled,omitempty"` + + // ServicePath: The Dataflow service path relative to the root URL, for + // example, "dataflow/v1b3/projects". + ServicePath string `json:"servicePath,omitempty"` + + // ShuffleServicePath: The Shuffle service path relative to the root + // URL, for example, "shuffle/v1beta1". + ShuffleServicePath string `json:"shuffleServicePath,omitempty"` + + // TempStoragePrefix: The prefix of the resources the system should use + // for temporary storage. The supported resource type is: Google Cloud + // Storage: storage.googleapis.com/{bucket}/{object} + // bucket.storage.googleapis.com/{object} + TempStoragePrefix string `json:"tempStoragePrefix,omitempty"` + + // WorkerId: ID of the worker running this pipeline. + WorkerId string `json:"workerId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BaseUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *WorkerSettings) MarshalJSON() ([]byte, error) { + type noMethod WorkerSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// WriteInstruction: An instruction that writes records. Takes one +// input, produces no outputs. +type WriteInstruction struct { + // Input: The input. + Input *InstructionInput `json:"input,omitempty"` + + // Sink: The sink to write to. + Sink *Sink `json:"sink,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Input") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *WriteInstruction) MarshalJSON() ([]byte, error) { + type noMethod WriteInstruction + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "dataflow.projects.jobs.create": + +type ProjectsJobsCreateCall struct { + s *Service + projectId string + job *Job + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a dataflow job. +func (r *ProjectsJobsService) Create(projectId string, job *Job) *ProjectsJobsCreateCall { + c := &ProjectsJobsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.job = job + return c +} + +// ReplaceJobId sets the optional parameter "replaceJobId": DEPRECATED. +// This field is now on the Job message. +func (c *ProjectsJobsCreateCall) ReplaceJobId(replaceJobId string) *ProjectsJobsCreateCall { + c.opt_["replaceJobId"] = replaceJobId + return c +} + +// View sets the optional parameter "view": Level of information +// requested in response. +// +// Possible values: +// "JOB_VIEW_UNKNOWN" +// "JOB_VIEW_SUMMARY" +// "JOB_VIEW_ALL" +func (c *ProjectsJobsCreateCall) View(view string) *ProjectsJobsCreateCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsJobsCreateCall) Fields(s ...googleapi.Field) *ProjectsJobsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsJobsCreateCall) Context(ctx context.Context) *ProjectsJobsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsJobsCreateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["replaceJobId"]; ok { + params.Set("replaceJobId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/jobs") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dataflow.projects.jobs.create" call. +// Exactly one of *Job or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Job.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsJobsCreateCall) Do() (*Job, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Job{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a dataflow job.", + // "httpMethod": "POST", + // "id": "dataflow.projects.jobs.create", + // "parameterOrder": [ + // "projectId" + // ], + // "parameters": { + // "projectId": { + // "description": "The project which owns the job.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "replaceJobId": { + // "description": "DEPRECATED. This field is now on the Job message.", + // "location": "query", + // "type": "string" + // }, + // "view": { + // "description": "Level of information requested in response.", + // "enum": [ + // "JOB_VIEW_UNKNOWN", + // "JOB_VIEW_SUMMARY", + // "JOB_VIEW_ALL" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1b3/projects/{projectId}/jobs", + // "request": { + // "$ref": "Job" + // }, + // "response": { + // "$ref": "Job" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/userinfo.email" + // ] + // } + +} + +// method id "dataflow.projects.jobs.get": + +type ProjectsJobsGetCall struct { + s *Service + projectId string + jobId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the state of the specified dataflow job. +func (r *ProjectsJobsService) Get(projectId string, jobId string) *ProjectsJobsGetCall { + c := &ProjectsJobsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.jobId = jobId + return c +} + +// View sets the optional parameter "view": Level of information +// requested in response. +// +// Possible values: +// "JOB_VIEW_UNKNOWN" +// "JOB_VIEW_SUMMARY" +// "JOB_VIEW_ALL" +func (c *ProjectsJobsGetCall) View(view string) *ProjectsJobsGetCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsJobsGetCall) Fields(s ...googleapi.Field) *ProjectsJobsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsJobsGetCall) IfNoneMatch(entityTag string) *ProjectsJobsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsJobsGetCall) Context(ctx context.Context) *ProjectsJobsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsJobsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/jobs/{jobId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "jobId": c.jobId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dataflow.projects.jobs.get" call. +// Exactly one of *Job or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Job.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsJobsGetCall) Do() (*Job, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Job{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the state of the specified dataflow job.", + // "httpMethod": "GET", + // "id": "dataflow.projects.jobs.get", + // "parameterOrder": [ + // "projectId", + // "jobId" + // ], + // "parameters": { + // "jobId": { + // "description": "Identifies a single job.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "The project which owns the job.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "view": { + // "description": "Level of information requested in response.", + // "enum": [ + // "JOB_VIEW_UNKNOWN", + // "JOB_VIEW_SUMMARY", + // "JOB_VIEW_ALL" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1b3/projects/{projectId}/jobs/{jobId}", + // "response": { + // "$ref": "Job" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/userinfo.email" + // ] + // } + +} + +// method id "dataflow.projects.jobs.getMetrics": + +type ProjectsJobsGetMetricsCall struct { + s *Service + projectId string + jobId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetMetrics: Request the job status. +func (r *ProjectsJobsService) GetMetrics(projectId string, jobId string) *ProjectsJobsGetMetricsCall { + c := &ProjectsJobsGetMetricsCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.jobId = jobId + return c +} + +// StartTime sets the optional parameter "startTime": Return only metric +// data that has changed since this time. Default is to return all +// information about all metrics for the job. +func (c *ProjectsJobsGetMetricsCall) StartTime(startTime string) *ProjectsJobsGetMetricsCall { + c.opt_["startTime"] = startTime + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsJobsGetMetricsCall) Fields(s ...googleapi.Field) *ProjectsJobsGetMetricsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsJobsGetMetricsCall) IfNoneMatch(entityTag string) *ProjectsJobsGetMetricsCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsJobsGetMetricsCall) Context(ctx context.Context) *ProjectsJobsGetMetricsCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsJobsGetMetricsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["startTime"]; ok { + params.Set("startTime", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/jobs/{jobId}/metrics") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "jobId": c.jobId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dataflow.projects.jobs.getMetrics" call. +// Exactly one of *JobMetrics or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *JobMetrics.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsJobsGetMetricsCall) Do() (*JobMetrics, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &JobMetrics{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Request the job status.", + // "httpMethod": "GET", + // "id": "dataflow.projects.jobs.getMetrics", + // "parameterOrder": [ + // "projectId", + // "jobId" + // ], + // "parameters": { + // "jobId": { + // "description": "The job to get messages for.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "A project id.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "startTime": { + // "description": "Return only metric data that has changed since this time. Default is to return all information about all metrics for the job.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1b3/projects/{projectId}/jobs/{jobId}/metrics", + // "response": { + // "$ref": "JobMetrics" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/userinfo.email" + // ] + // } + +} + +// method id "dataflow.projects.jobs.list": + +type ProjectsJobsListCall struct { + s *Service + projectId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List the jobs of a project +func (r *ProjectsJobsService) List(projectId string) *ProjectsJobsListCall { + c := &ProjectsJobsListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + return c +} + +// PageSize sets the optional parameter "pageSize": If there are many +// jobs, limit response to at most this many. The actual number of jobs +// returned will be the lesser of max_responses and an unspecified +// server-defined limit. +func (c *ProjectsJobsListCall) PageSize(pageSize int64) *ProjectsJobsListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": Set this to the +// 'next_page_token' field of a previous response to request additional +// results in a long list. +func (c *ProjectsJobsListCall) PageToken(pageToken string) *ProjectsJobsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// View sets the optional parameter "view": Level of information +// requested in response. Default is SUMMARY. +// +// Possible values: +// "JOB_VIEW_UNKNOWN" +// "JOB_VIEW_SUMMARY" +// "JOB_VIEW_ALL" +func (c *ProjectsJobsListCall) View(view string) *ProjectsJobsListCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsJobsListCall) Fields(s ...googleapi.Field) *ProjectsJobsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsJobsListCall) IfNoneMatch(entityTag string) *ProjectsJobsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsJobsListCall) Context(ctx context.Context) *ProjectsJobsListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsJobsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/jobs") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dataflow.projects.jobs.list" call. +// Exactly one of *ListJobsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListJobsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsJobsListCall) Do() (*ListJobsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListJobsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the jobs of a project", + // "httpMethod": "GET", + // "id": "dataflow.projects.jobs.list", + // "parameterOrder": [ + // "projectId" + // ], + // "parameters": { + // "pageSize": { + // "description": "If there are many jobs, limit response to at most this many. The actual number of jobs returned will be the lesser of max_responses and an unspecified server-defined limit.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Set this to the 'next_page_token' field of a previous response to request additional results in a long list.", + // "location": "query", + // "type": "string" + // }, + // "projectId": { + // "description": "The project which owns the jobs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "view": { + // "description": "Level of information requested in response. Default is SUMMARY.", + // "enum": [ + // "JOB_VIEW_UNKNOWN", + // "JOB_VIEW_SUMMARY", + // "JOB_VIEW_ALL" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1b3/projects/{projectId}/jobs", + // "response": { + // "$ref": "ListJobsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/userinfo.email" + // ] + // } + +} + +// method id "dataflow.projects.jobs.update": + +type ProjectsJobsUpdateCall struct { + s *Service + projectId string + jobId string + job *Job + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates the state of an existing dataflow job. +func (r *ProjectsJobsService) Update(projectId string, jobId string, job *Job) *ProjectsJobsUpdateCall { + c := &ProjectsJobsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.jobId = jobId + c.job = job + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsJobsUpdateCall) Fields(s ...googleapi.Field) *ProjectsJobsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsJobsUpdateCall) Context(ctx context.Context) *ProjectsJobsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsJobsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/jobs/{jobId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "jobId": c.jobId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dataflow.projects.jobs.update" call. +// Exactly one of *Job or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Job.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsJobsUpdateCall) Do() (*Job, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Job{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the state of an existing dataflow job.", + // "httpMethod": "PUT", + // "id": "dataflow.projects.jobs.update", + // "parameterOrder": [ + // "projectId", + // "jobId" + // ], + // "parameters": { + // "jobId": { + // "description": "Identifies a single job.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "The project which owns the job.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1b3/projects/{projectId}/jobs/{jobId}", + // "request": { + // "$ref": "Job" + // }, + // "response": { + // "$ref": "Job" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/userinfo.email" + // ] + // } + +} + +// method id "dataflow.projects.jobs.messages.list": + +type ProjectsJobsMessagesListCall struct { + s *Service + projectId string + jobId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Request the job status. +func (r *ProjectsJobsMessagesService) List(projectId string, jobId string) *ProjectsJobsMessagesListCall { + c := &ProjectsJobsMessagesListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.jobId = jobId + return c +} + +// EndTime sets the optional parameter "endTime": Return only messages +// with timestamps < end_time. The default is now (i.e. return up to the +// latest messages available). +func (c *ProjectsJobsMessagesListCall) EndTime(endTime string) *ProjectsJobsMessagesListCall { + c.opt_["endTime"] = endTime + return c +} + +// MinimumImportance sets the optional parameter "minimumImportance": +// Filter to only get messages with importance >= level +// +// Possible values: +// "JOB_MESSAGE_IMPORTANCE_UNKNOWN" +// "JOB_MESSAGE_DEBUG" +// "JOB_MESSAGE_DETAILED" +// "JOB_MESSAGE_BASIC" +// "JOB_MESSAGE_WARNING" +// "JOB_MESSAGE_ERROR" +func (c *ProjectsJobsMessagesListCall) MinimumImportance(minimumImportance string) *ProjectsJobsMessagesListCall { + c.opt_["minimumImportance"] = minimumImportance + return c +} + +// PageSize sets the optional parameter "pageSize": If specified, +// determines the maximum number of messages to return. If unspecified, +// the service may choose an appropriate default, or may return an +// arbitrarily large number of results. +func (c *ProjectsJobsMessagesListCall) PageSize(pageSize int64) *ProjectsJobsMessagesListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": If supplied, this +// should be the value of next_page_token returned by an earlier call. +// This will cause the next page of results to be returned. +func (c *ProjectsJobsMessagesListCall) PageToken(pageToken string) *ProjectsJobsMessagesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StartTime sets the optional parameter "startTime": If specified, +// return only messages with timestamps >= start_time. The default is +// the job creation time (i.e. beginning of messages). +func (c *ProjectsJobsMessagesListCall) StartTime(startTime string) *ProjectsJobsMessagesListCall { + c.opt_["startTime"] = startTime + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsJobsMessagesListCall) Fields(s ...googleapi.Field) *ProjectsJobsMessagesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsJobsMessagesListCall) IfNoneMatch(entityTag string) *ProjectsJobsMessagesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsJobsMessagesListCall) Context(ctx context.Context) *ProjectsJobsMessagesListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsJobsMessagesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["endTime"]; ok { + params.Set("endTime", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["minimumImportance"]; ok { + params.Set("minimumImportance", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startTime"]; ok { + params.Set("startTime", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/jobs/{jobId}/messages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "jobId": c.jobId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dataflow.projects.jobs.messages.list" call. +// Exactly one of *ListJobMessagesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListJobMessagesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsJobsMessagesListCall) Do() (*ListJobMessagesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListJobMessagesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Request the job status.", + // "httpMethod": "GET", + // "id": "dataflow.projects.jobs.messages.list", + // "parameterOrder": [ + // "projectId", + // "jobId" + // ], + // "parameters": { + // "endTime": { + // "description": "Return only messages with timestamps \u003c end_time. The default is now (i.e. return up to the latest messages available).", + // "location": "query", + // "type": "string" + // }, + // "jobId": { + // "description": "The job to get messages about.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "minimumImportance": { + // "description": "Filter to only get messages with importance \u003e= level", + // "enum": [ + // "JOB_MESSAGE_IMPORTANCE_UNKNOWN", + // "JOB_MESSAGE_DEBUG", + // "JOB_MESSAGE_DETAILED", + // "JOB_MESSAGE_BASIC", + // "JOB_MESSAGE_WARNING", + // "JOB_MESSAGE_ERROR" + // ], + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "If specified, determines the maximum number of messages to return. If unspecified, the service may choose an appropriate default, or may return an arbitrarily large number of results.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "If supplied, this should be the value of next_page_token returned by an earlier call. This will cause the next page of results to be returned.", + // "location": "query", + // "type": "string" + // }, + // "projectId": { + // "description": "A project id.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "startTime": { + // "description": "If specified, return only messages with timestamps \u003e= start_time. The default is the job creation time (i.e. beginning of messages).", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1b3/projects/{projectId}/jobs/{jobId}/messages", + // "response": { + // "$ref": "ListJobMessagesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/userinfo.email" + // ] + // } + +} + +// method id "dataflow.projects.jobs.workItems.lease": + +type ProjectsJobsWorkItemsLeaseCall struct { + s *Service + projectId string + jobId string + leaseworkitemrequest *LeaseWorkItemRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Lease: Leases a dataflow WorkItem to run. +func (r *ProjectsJobsWorkItemsService) Lease(projectId string, jobId string, leaseworkitemrequest *LeaseWorkItemRequest) *ProjectsJobsWorkItemsLeaseCall { + c := &ProjectsJobsWorkItemsLeaseCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.jobId = jobId + c.leaseworkitemrequest = leaseworkitemrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsJobsWorkItemsLeaseCall) Fields(s ...googleapi.Field) *ProjectsJobsWorkItemsLeaseCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsJobsWorkItemsLeaseCall) Context(ctx context.Context) *ProjectsJobsWorkItemsLeaseCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsJobsWorkItemsLeaseCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.leaseworkitemrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/jobs/{jobId}/workItems:lease") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "jobId": c.jobId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dataflow.projects.jobs.workItems.lease" call. +// Exactly one of *LeaseWorkItemResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *LeaseWorkItemResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsJobsWorkItemsLeaseCall) Do() (*LeaseWorkItemResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LeaseWorkItemResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Leases a dataflow WorkItem to run.", + // "httpMethod": "POST", + // "id": "dataflow.projects.jobs.workItems.lease", + // "parameterOrder": [ + // "projectId", + // "jobId" + // ], + // "parameters": { + // "jobId": { + // "description": "Identifies the workflow job this worker belongs to.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Identifies the project this worker belongs to.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1b3/projects/{projectId}/jobs/{jobId}/workItems:lease", + // "request": { + // "$ref": "LeaseWorkItemRequest" + // }, + // "response": { + // "$ref": "LeaseWorkItemResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/userinfo.email" + // ] + // } + +} + +// method id "dataflow.projects.jobs.workItems.reportStatus": + +type ProjectsJobsWorkItemsReportStatusCall struct { + s *Service + projectId string + jobId string + reportworkitemstatusrequest *ReportWorkItemStatusRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// ReportStatus: Reports the status of dataflow WorkItems leased by a +// worker. +func (r *ProjectsJobsWorkItemsService) ReportStatus(projectId string, jobId string, reportworkitemstatusrequest *ReportWorkItemStatusRequest) *ProjectsJobsWorkItemsReportStatusCall { + c := &ProjectsJobsWorkItemsReportStatusCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.jobId = jobId + c.reportworkitemstatusrequest = reportworkitemstatusrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsJobsWorkItemsReportStatusCall) Fields(s ...googleapi.Field) *ProjectsJobsWorkItemsReportStatusCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsJobsWorkItemsReportStatusCall) Context(ctx context.Context) *ProjectsJobsWorkItemsReportStatusCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsJobsWorkItemsReportStatusCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportworkitemstatusrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1b3/projects/{projectId}/jobs/{jobId}/workItems:reportStatus") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "jobId": c.jobId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dataflow.projects.jobs.workItems.reportStatus" call. +// Exactly one of *ReportWorkItemStatusResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ReportWorkItemStatusResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsJobsWorkItemsReportStatusCall) Do() (*ReportWorkItemStatusResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ReportWorkItemStatusResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Reports the status of dataflow WorkItems leased by a worker.", + // "httpMethod": "POST", + // "id": "dataflow.projects.jobs.workItems.reportStatus", + // "parameterOrder": [ + // "projectId", + // "jobId" + // ], + // "parameters": { + // "jobId": { + // "description": "The job which the WorkItem is part of.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "The project which owns the WorkItem's job.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1b3/projects/{projectId}/jobs/{jobId}/workItems:reportStatus", + // "request": { + // "$ref": "ReportWorkItemStatusRequest" + // }, + // "response": { + // "$ref": "ReportWorkItemStatusResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/userinfo.email" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/datastore/v1beta1/datastore-api.json b/Godeps/_workspace/src/google.golang.org/api/datastore/v1beta1/datastore-api.json new file mode 100644 index 000000000..1ba259d19 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/datastore/v1beta1/datastore-api.json @@ -0,0 +1,988 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/fIJ3DBpWQxusVwOa-ZxrsUl27A4\"", + "discoveryVersion": "v1", + "id": "datastore:v1beta1", + "name": "datastore", + "version": "v1beta1", + "revision": "20150402", + "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/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "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", + "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", + "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", + "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", + "properties": { + "header": { + "$ref": "ResponseHeader" + }, + "transaction": { + "type": "string", + "description": "The transaction identifier (always present).", + "format": "byte" + } + } + }, + "BlindWriteRequest": { + "id": "BlindWriteRequest", + "type": "object", + "properties": { + "mutation": { + "$ref": "Mutation", + "description": "The mutation to perform." + } + } + }, + "BlindWriteResponse": { + "id": "BlindWriteResponse", + "type": "object", + "properties": { + "header": { + "$ref": "ResponseHeader" + }, + "mutationResult": { + "$ref": "MutationResult", + "description": "The result of performing the mutation (always present)." + } + } + }, + "CommitRequest": { + "id": "CommitRequest", + "type": "object", + "properties": { + "ignoreReadOnly": { + "type": "boolean" + }, + "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", + "properties": { + "header": { + "$ref": "ResponseHeader" + }, + "mutationResult": { + "$ref": "MutationResult", + "description": "The result of performing the mutation (if any)." + } + } + }, + "CompositeFilter": { + "id": "CompositeFilter", + "type": "object", + "description": "A filter that merges the multiple other filters using the given operation.", + "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", + "description": "An 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. A property name matching regex \"__.*__\" is reserved. A reserved property name is forbidden in certain documented contexts. The name must not contain more than 500 characters. Cannot be \"\"." + } + } + } + }, + "EntityResult": { + "id": "EntityResult", + "type": "object", + "description": "The result of fetching an entity from the datastore.", + "properties": { + "entity": { + "$ref": "Entity", + "description": "The resulting entity." + } + } + }, + "Filter": { + "id": "Filter", + "type": "object", + "description": "A holder for any type of filter. Exactly one field should be specified.", + "properties": { + "compositeFilter": { + "$ref": "CompositeFilter", + "description": "A composite filter." + }, + "propertyFilter": { + "$ref": "PropertyFilter", + "description": "A filter on a property." + } + } + }, + "GqlQuery": { + "id": "GqlQuery", + "type": "object", + "description": "A GQL query.", + "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", + "description": "The query string." + } + } + }, + "GqlQueryArg": { + "id": "GqlQueryArg", + "type": "object", + "description": "A binding argument for a GQL query.", + "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", + "description": "A unique identifier for an entity.", + "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. The path can have at most 100 elements.", + "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.", + "properties": { + "id": { + "type": "string", + "description": "The ID of the entity. Never equal to zero. Values less than zero are discouraged and will not be supported in the future.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "The kind of the entity. A kind matching regex \"__.*__\" is reserved/read-only. A kind must not contain more than 500 characters. Cannot be \"\"." + }, + "name": { + "type": "string", + "description": "The name of the entity. A name matching regex \"__.*__\" is reserved/read-only. A name must not be more than 500 characters. Cannot be \"\"." + } + } + }, + "KindExpression": { + "id": "KindExpression", + "type": "object", + "description": "A representation of a kind.", + "properties": { + "name": { + "type": "string", + "description": "The name of the kind." + } + } + }, + "LookupRequest": { + "id": "LookupRequest", + "type": "object", + "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", + "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", + "description": "A set of changes to apply.", + "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", + "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", + "description": "An identifier for a particular subset of entities.\n\nEntities are partitioned into various subsets, each used by different datasets and different namespaces within a dataset and so forth.", + "properties": { + "datasetId": { + "type": "string", + "description": "The dataset ID." + }, + "namespace": { + "type": "string", + "description": "The namespace." + } + } + }, + "Property": { + "id": "Property", + "type": "object", + "description": "An entity 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", + "description": "A representation of a property in a projection.", + "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", + "description": "A filter on a specific property.", + "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", + "description": "The desired order for a specific property.", + "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", + "description": "A reference to a property relative to the kind expressions.", + "properties": { + "name": { + "type": "string", + "description": "The name of the property." + } + } + }, + "Query": { + "id": "Query", + "type": "object", + "description": "A 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", + "description": "A batch of results produced by a query.", + "properties": { + "endCursor": { + "type": "string", + "description": "A cursor that points to the position after the last result in the batch. May be absent. TODO(arfuller): Once all plans produce cursors update documentation here.", + "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", + "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", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"datastore#responseHeader\".", + "default": "datastore#responseHeader" + } + } + }, + "RollbackRequest": { + "id": "RollbackRequest", + "type": "object", + "properties": { + "transaction": { + "type": "string", + "description": "The transaction identifier, returned by a call to beginTransaction.", + "format": "byte" + } + } + }, + "RollbackResponse": { + "id": "RollbackResponse", + "type": "object", + "properties": { + "header": { + "$ref": "ResponseHeader" + } + } + }, + "RunQueryRequest": { + "id": "RunQueryRequest", + "type": "object", + "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. This partition ID is normalized with the standard default context partition ID, but all other partition IDs in RunQueryRequest are normalized with this partition ID as the context partition ID." + }, + "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", + "properties": { + "batch": { + "$ref": "QueryResultBatch", + "description": "A batch of query results (always present)." + }, + "header": { + "$ref": "ResponseHeader" + } + } + }, + "Value": { + "id": "Value", + "type": "object", + "description": "A message that can hold any of the supported value types and associated metadata.", + "properties": { + "blobKeyValue": { + "type": "string", + "description": "A blob key value." + }, + "blobValue": { + "type": "string", + "description": "A blob value. May be a maximum of 1,000,000 bytes. When indexed is true, may have at most 500 bytes.", + "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. When indexed is true, may have at most 500 characters." + } + } + } + }, + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "https://www.googleapis.com/auth/datastore", + "https://www.googleapis.com/auth/userinfo.email" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/datastore/v1beta1/datastore-gen.go b/Godeps/_workspace/src/google.golang.org/api/datastore/v1beta1/datastore-gen.go new file mode 100644 index 000000000..38956b6e1 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/datastore/v1beta1/datastore-gen.go @@ -0,0 +1,1990 @@ +// Package datastore provides access to the Google Cloud Datastore API. +// +// See https://developers.google.com/datastore/ +// +// Usage example: +// +// import "google.golang.org/api/datastore/v1beta1" +// ... +// datastoreService, err := datastore.New(oauthHttpClient) +package datastore // import "google.golang.org/api/datastore/v1beta1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 data across Google Cloud Platform services + CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" + + // 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 + UserAgent string // optional additional User-Agent fragment + + Datasets *DatasetsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Keys") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AllocateIdsRequest) MarshalJSON() ([]byte, error) { + type noMethod AllocateIdsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Header") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AllocateIdsResponse) MarshalJSON() ([]byte, error) { + type noMethod AllocateIdsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "IsolationLevel") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BeginTransactionRequest) MarshalJSON() ([]byte, error) { + type noMethod BeginTransactionRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type BeginTransactionResponse struct { + Header *ResponseHeader `json:"header,omitempty"` + + // Transaction: The transaction identifier (always present). + Transaction string `json:"transaction,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Header") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BeginTransactionResponse) MarshalJSON() ([]byte, error) { + type noMethod BeginTransactionResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type BlindWriteRequest struct { + // Mutation: The mutation to perform. + Mutation *Mutation `json:"mutation,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Mutation") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BlindWriteRequest) MarshalJSON() ([]byte, error) { + type noMethod BlindWriteRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type BlindWriteResponse struct { + Header *ResponseHeader `json:"header,omitempty"` + + // MutationResult: The result of performing the mutation (always + // present). + MutationResult *MutationResult `json:"mutationResult,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Header") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BlindWriteResponse) MarshalJSON() ([]byte, error) { + type noMethod BlindWriteResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type CommitRequest struct { + IgnoreReadOnly bool `json:"ignoreReadOnly,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"` + + // ForceSendFields is a list of field names (e.g. "IgnoreReadOnly") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommitRequest) MarshalJSON() ([]byte, error) { + type noMethod CommitRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type CommitResponse struct { + Header *ResponseHeader `json:"header,omitempty"` + + // MutationResult: The result of performing the mutation (if any). + MutationResult *MutationResult `json:"mutationResult,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Header") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommitResponse) MarshalJSON() ([]byte, error) { + type noMethod CommitResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CompositeFilter: A filter that merges the multiple other filters +// using the given operation. +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"` + + // ForceSendFields is a list of field names (e.g. "Filters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CompositeFilter) MarshalJSON() ([]byte, error) { + type noMethod CompositeFilter + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Entity: An entity. +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 map[string]Property `json:"properties,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Entity) MarshalJSON() ([]byte, error) { + type noMethod Entity + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EntityResult: The result of fetching an entity from the datastore. +type EntityResult struct { + // Entity: The resulting entity. + Entity *Entity `json:"entity,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Entity") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EntityResult) MarshalJSON() ([]byte, error) { + type noMethod EntityResult + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Filter: A holder for any type of filter. Exactly one field should be +// specified. +type Filter struct { + // CompositeFilter: A composite filter. + CompositeFilter *CompositeFilter `json:"compositeFilter,omitempty"` + + // PropertyFilter: A filter on a property. + PropertyFilter *PropertyFilter `json:"propertyFilter,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CompositeFilter") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Filter) MarshalJSON() ([]byte, error) { + type noMethod Filter + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GqlQuery: A GQL query. +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: The query string. + QueryString string `json:"queryString,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AllowLiteral") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GqlQuery) MarshalJSON() ([]byte, error) { + type noMethod GqlQuery + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GqlQueryArg: A binding argument for a GQL query. +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"` + + // ForceSendFields is a list of field names (e.g. "Cursor") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GqlQueryArg) MarshalJSON() ([]byte, error) { + type noMethod GqlQueryArg + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Key: A unique identifier for an entity. +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. The path + // can have at most 100 elements. + Path []*KeyPathElement `json:"path,omitempty"` + + // ForceSendFields is a list of field names (e.g. "PartitionId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Key) MarshalJSON() ([]byte, error) { + type noMethod Key + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// KeyPathElement: A (kind, ID/name) pair used to construct a key +// path. +// +// At 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. +type KeyPathElement struct { + // Id: The ID of the entity. Never equal to zero. Values less than zero + // are discouraged and will not be supported in the future. + Id int64 `json:"id,omitempty,string"` + + // Kind: The kind of the entity. A kind matching regex "__.*__" is + // reserved/read-only. A kind must not contain more than 500 characters. + // Cannot be "". + Kind string `json:"kind,omitempty"` + + // Name: The name of the entity. A name matching regex "__.*__" is + // reserved/read-only. A name must not be more than 500 characters. + // Cannot be "". + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *KeyPathElement) MarshalJSON() ([]byte, error) { + type noMethod KeyPathElement + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// KindExpression: A representation of a kind. +type KindExpression struct { + // Name: The name of the kind. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *KindExpression) MarshalJSON() ([]byte, error) { + type noMethod KindExpression + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Keys") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LookupRequest) MarshalJSON() ([]byte, error) { + type noMethod LookupRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Deferred") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LookupResponse) MarshalJSON() ([]byte, error) { + type noMethod LookupResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Mutation: A set of changes to apply. +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"` + + // ForceSendFields is a list of field names (e.g. "Delete") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Mutation) MarshalJSON() ([]byte, error) { + type noMethod Mutation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "IndexUpdates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MutationResult) MarshalJSON() ([]byte, error) { + type noMethod MutationResult + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PartitionId: An identifier for a particular subset of +// entities. +// +// Entities are partitioned into various subsets, each used by different +// datasets and different namespaces within a dataset and so forth. +type PartitionId struct { + // DatasetId: The dataset ID. + DatasetId string `json:"datasetId,omitempty"` + + // Namespace: The namespace. + Namespace string `json:"namespace,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DatasetId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PartitionId) MarshalJSON() ([]byte, error) { + type noMethod PartitionId + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Property: An entity property. +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"` + + // ForceSendFields is a list of field names (e.g. "Multi") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Property) MarshalJSON() ([]byte, error) { + type noMethod Property + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PropertyExpression: A representation of a property in a projection. +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"` + + // ForceSendFields is a list of field names (e.g. "AggregationFunction") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PropertyExpression) MarshalJSON() ([]byte, error) { + type noMethod PropertyExpression + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PropertyFilter: A filter on a specific property. +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"` + + // ForceSendFields is a list of field names (e.g. "Operator") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PropertyFilter) MarshalJSON() ([]byte, error) { + type noMethod PropertyFilter + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PropertyOrder: The desired order for a specific property. +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"` + + // ForceSendFields is a list of field names (e.g. "Direction") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PropertyOrder) MarshalJSON() ([]byte, error) { + type noMethod PropertyOrder + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PropertyReference: A reference to a property relative to the kind +// expressions. +type PropertyReference struct { + // Name: The name of the property. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PropertyReference) MarshalJSON() ([]byte, error) { + type noMethod PropertyReference + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Query: A query. +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"` + + // ForceSendFields is a list of field names (e.g. "EndCursor") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Query) MarshalJSON() ([]byte, error) { + type noMethod Query + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// QueryResultBatch: A batch of results produced by a query. +type QueryResultBatch struct { + // EndCursor: A cursor that points to the position after the last result + // in the batch. May be absent. TODO(arfuller): Once all plans produce + // cursors update documentation here. + 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"` + + // ForceSendFields is a list of field names (e.g. "EndCursor") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *QueryResultBatch) MarshalJSON() ([]byte, error) { + type noMethod QueryResultBatch + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "ReadConsistency") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReadOptions) MarshalJSON() ([]byte, error) { + type noMethod ReadOptions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ResponseHeader struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "datastore#responseHeader". + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResponseHeader) MarshalJSON() ([]byte, error) { + type noMethod ResponseHeader + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type RollbackRequest struct { + // Transaction: The transaction identifier, returned by a call to + // beginTransaction. + Transaction string `json:"transaction,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Transaction") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RollbackRequest) MarshalJSON() ([]byte, error) { + type noMethod RollbackRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type RollbackResponse struct { + Header *ResponseHeader `json:"header,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Header") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RollbackResponse) MarshalJSON() ([]byte, error) { + type noMethod RollbackResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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. This partition ID is + // normalized with the standard default context partition ID, but all + // other partition IDs in RunQueryRequest are normalized with this + // partition ID as the context partition ID. + 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"` + + // ForceSendFields is a list of field names (e.g. "GqlQuery") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RunQueryRequest) MarshalJSON() ([]byte, error) { + type noMethod RunQueryRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type RunQueryResponse struct { + // Batch: A batch of query results (always present). + Batch *QueryResultBatch `json:"batch,omitempty"` + + Header *ResponseHeader `json:"header,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Batch") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RunQueryResponse) MarshalJSON() ([]byte, error) { + type noMethod RunQueryResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Value: A message that can hold any of the supported value types and +// associated metadata. +type Value struct { + // BlobKeyValue: A blob key value. + BlobKeyValue string `json:"blobKeyValue,omitempty"` + + // BlobValue: A blob value. May be a maximum of 1,000,000 bytes. When + // indexed is true, may have at most 500 bytes. + 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. When indexed is true, may + // have at most 500 characters. + StringValue string `json:"stringValue,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BlobKeyValue") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Value) MarshalJSON() ([]byte, error) { + type noMethod Value + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "datastore.datasets.allocateIds": + +type DatasetsAllocateIdsCall struct { + s *Service + datasetId string + allocateidsrequest *AllocateIdsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsAllocateIdsCall) Fields(s ...googleapi.Field) *DatasetsAllocateIdsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsAllocateIdsCall) Context(ctx context.Context) *DatasetsAllocateIdsCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsAllocateIdsCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/allocateIds") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "datasetId": c.datasetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "datastore.datasets.allocateIds" call. +// Exactly one of *AllocateIdsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AllocateIdsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DatasetsAllocateIdsCall) Do() (*AllocateIdsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AllocateIdsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsBeginTransactionCall) Fields(s ...googleapi.Field) *DatasetsBeginTransactionCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsBeginTransactionCall) Context(ctx context.Context) *DatasetsBeginTransactionCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsBeginTransactionCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/beginTransaction") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "datasetId": c.datasetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "datastore.datasets.beginTransaction" call. +// Exactly one of *BeginTransactionResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *BeginTransactionResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DatasetsBeginTransactionCall) Do() (*BeginTransactionResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BeginTransactionResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsBlindWriteCall) Fields(s ...googleapi.Field) *DatasetsBlindWriteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsBlindWriteCall) Context(ctx context.Context) *DatasetsBlindWriteCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsBlindWriteCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/blindWrite") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "datasetId": c.datasetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "datastore.datasets.blindWrite" call. +// Exactly one of *BlindWriteResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BlindWriteResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DatasetsBlindWriteCall) Do() (*BlindWriteResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BlindWriteResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsCommitCall) Fields(s ...googleapi.Field) *DatasetsCommitCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsCommitCall) Context(ctx context.Context) *DatasetsCommitCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsCommitCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/commit") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "datasetId": c.datasetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "datastore.datasets.commit" call. +// Exactly one of *CommitResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CommitResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DatasetsCommitCall) Do() (*CommitResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CommitResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsLookupCall) Fields(s ...googleapi.Field) *DatasetsLookupCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsLookupCall) Context(ctx context.Context) *DatasetsLookupCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsLookupCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/lookup") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "datasetId": c.datasetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "datastore.datasets.lookup" call. +// Exactly one of *LookupResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LookupResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DatasetsLookupCall) Do() (*LookupResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LookupResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsRollbackCall) Fields(s ...googleapi.Field) *DatasetsRollbackCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsRollbackCall) Context(ctx context.Context) *DatasetsRollbackCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsRollbackCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/rollback") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "datasetId": c.datasetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "datastore.datasets.rollback" call. +// Exactly one of *RollbackResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *RollbackResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DatasetsRollbackCall) Do() (*RollbackResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RollbackResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsRunQueryCall) Fields(s ...googleapi.Field) *DatasetsRunQueryCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsRunQueryCall) Context(ctx context.Context) *DatasetsRunQueryCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsRunQueryCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/runQuery") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "datasetId": c.datasetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "datastore.datasets.runQuery" call. +// Exactly one of *RunQueryResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *RunQueryResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DatasetsRunQueryCall) Do() (*RunQueryResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RunQueryResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/datastore", + // "https://www.googleapis.com/auth/userinfo.email" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/datastore/v1beta2/datastore-api.json b/Godeps/_workspace/src/google.golang.org/api/datastore/v1beta2/datastore-api.json new file mode 100644 index 000000000..55388fe58 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/datastore/v1beta2/datastore-api.json @@ -0,0 +1,1075 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/JTCpJ6erGSGSQjeOlJBcixKgvo8\"", + "discoveryVersion": "v1", + "id": "datastore:v1beta2", + "name": "datastore", + "version": "v1beta2", + "revision": "20150402", + "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/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "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", + "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", + "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", + "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", + "properties": { + "header": { + "$ref": "ResponseHeader" + }, + "transaction": { + "type": "string", + "description": "The transaction identifier (always present).", + "format": "byte" + } + } + }, + "CommitRequest": { + "id": "CommitRequest", + "type": "object", + "properties": { + "ignoreReadOnly": { + "type": "boolean" + }, + "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", + "properties": { + "header": { + "$ref": "ResponseHeader" + }, + "mutationResult": { + "$ref": "MutationResult", + "description": "The result of performing the mutation (if any)." + } + } + }, + "CompositeFilter": { + "id": "CompositeFilter", + "type": "object", + "description": "A filter that merges the multiple other filters using the given operation.", + "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", + "description": "An 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. A property name matching regex \"__.*__\" is reserved. A reserved property name is forbidden in certain documented contexts. The name must not contain more than 500 characters. Cannot be \"\"." + } + } + } + }, + "EntityResult": { + "id": "EntityResult", + "type": "object", + "description": "The result of fetching an entity from the datastore.", + "properties": { + "entity": { + "$ref": "Entity", + "description": "The resulting entity." + } + } + }, + "Filter": { + "id": "Filter", + "type": "object", + "description": "A holder for any type of filter. Exactly one field should be specified.", + "properties": { + "compositeFilter": { + "$ref": "CompositeFilter", + "description": "A composite filter." + }, + "propertyFilter": { + "$ref": "PropertyFilter", + "description": "A filter on a property." + } + } + }, + "GqlQuery": { + "id": "GqlQuery", + "type": "object", + "description": "A GQL query.", + "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", + "description": "The query string." + } + } + }, + "GqlQueryArg": { + "id": "GqlQueryArg", + "type": "object", + "description": "A binding argument for a GQL query.", + "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", + "description": "A unique identifier for an entity.", + "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. The path can have at most 100 elements.", + "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.", + "properties": { + "id": { + "type": "string", + "description": "The ID of the entity. Never equal to zero. Values less than zero are discouraged and will not be supported in the future.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "The kind of the entity. A kind matching regex \"__.*__\" is reserved/read-only. A kind must not contain more than 500 characters. Cannot be \"\"." + }, + "name": { + "type": "string", + "description": "The name of the entity. A name matching regex \"__.*__\" is reserved/read-only. A name must not be more than 500 characters. Cannot be \"\"." + } + } + }, + "KindExpression": { + "id": "KindExpression", + "type": "object", + "description": "A representation of a kind.", + "properties": { + "name": { + "type": "string", + "description": "The name of the kind." + } + } + }, + "LookupRequest": { + "id": "LookupRequest", + "type": "object", + "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", + "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", + "description": "A set of changes to apply.", + "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", + "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", + "description": "An identifier for a particular subset of entities.\n\nEntities are partitioned into various subsets, each used by different datasets and different namespaces within a dataset and so forth.", + "properties": { + "datasetId": { + "type": "string", + "description": "The dataset ID." + }, + "namespace": { + "type": "string", + "description": "The namespace." + } + } + }, + "Property": { + "id": "Property", + "type": "object", + "description": "An entity property.", + "properties": { + "blobKeyValue": { + "type": "string", + "description": "A blob key value." + }, + "blobValue": { + "type": "string", + "description": "A blob value. May be a maximum of 1,000,000 bytes. When indexed is true, may have at most 500 bytes.", + "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. A Value instance that sets field list_value must not set field meaning or field indexed.", + "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. When indexed is true, may have at most 500 characters." + } + } + }, + "PropertyExpression": { + "id": "PropertyExpression", + "type": "object", + "description": "A representation of a property in a projection.", + "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", + "description": "A filter on a specific property.", + "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", + "description": "The desired order for a specific property.", + "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", + "description": "A reference to a property relative to the kind expressions.", + "properties": { + "name": { + "type": "string", + "description": "The name of the property." + } + } + }, + "Query": { + "id": "Query", + "type": "object", + "description": "A 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", + "description": "A batch of results produced by a query.", + "properties": { + "endCursor": { + "type": "string", + "description": "A cursor that points to the position after the last result in the batch. May be absent. TODO(arfuller): Once all plans produce cursors update documentation here.", + "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", + "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", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"datastore#responseHeader\".", + "default": "datastore#responseHeader" + } + } + }, + "RollbackRequest": { + "id": "RollbackRequest", + "type": "object", + "properties": { + "transaction": { + "type": "string", + "description": "The transaction identifier, returned by a call to beginTransaction.", + "format": "byte" + } + } + }, + "RollbackResponse": { + "id": "RollbackResponse", + "type": "object", + "properties": { + "header": { + "$ref": "ResponseHeader" + } + } + }, + "RunQueryRequest": { + "id": "RunQueryRequest", + "type": "object", + "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. This partition ID is normalized with the standard default context partition ID, but all other partition IDs in RunQueryRequest are normalized with this partition ID as the context partition ID." + }, + "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", + "properties": { + "batch": { + "$ref": "QueryResultBatch", + "description": "A batch of query results (always present)." + }, + "header": { + "$ref": "ResponseHeader" + } + } + }, + "Value": { + "id": "Value", + "type": "object", + "description": "A message that can hold any of the supported value types and associated metadata.", + "properties": { + "blobKeyValue": { + "type": "string", + "description": "A blob key value." + }, + "blobValue": { + "type": "string", + "description": "A blob value. May be a maximum of 1,000,000 bytes. When indexed is true, may have at most 500 bytes.", + "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. A Value instance that sets field list_value must not set field meaning or field indexed.", + "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. When indexed is true, may have at most 500 characters." + } + } + } + }, + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "https://www.googleapis.com/auth/datastore", + "https://www.googleapis.com/auth/userinfo.email" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/datastore/v1beta2/datastore-gen.go b/Godeps/_workspace/src/google.golang.org/api/datastore/v1beta2/datastore-gen.go new file mode 100644 index 000000000..af4ce1913 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/datastore/v1beta2/datastore-gen.go @@ -0,0 +1,1903 @@ +// Package datastore provides access to the Google Cloud Datastore API. +// +// See https://developers.google.com/datastore/ +// +// Usage example: +// +// import "google.golang.org/api/datastore/v1beta2" +// ... +// datastoreService, err := datastore.New(oauthHttpClient) +package datastore // import "google.golang.org/api/datastore/v1beta2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 data across Google Cloud Platform services + CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" + + // 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 + UserAgent string // optional additional User-Agent fragment + + Datasets *DatasetsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Keys") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AllocateIdsRequest) MarshalJSON() ([]byte, error) { + type noMethod AllocateIdsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Header") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AllocateIdsResponse) MarshalJSON() ([]byte, error) { + type noMethod AllocateIdsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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. + // + // Possible values: + // "SERIALIZABLE" + // "SNAPSHOT" + IsolationLevel string `json:"isolationLevel,omitempty"` + + // ForceSendFields is a list of field names (e.g. "IsolationLevel") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BeginTransactionRequest) MarshalJSON() ([]byte, error) { + type noMethod BeginTransactionRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type BeginTransactionResponse struct { + Header *ResponseHeader `json:"header,omitempty"` + + // Transaction: The transaction identifier (always present). + Transaction string `json:"transaction,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Header") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BeginTransactionResponse) MarshalJSON() ([]byte, error) { + type noMethod BeginTransactionResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type CommitRequest struct { + IgnoreReadOnly bool `json:"ignoreReadOnly,omitempty"` + + // Mode: The type of commit to perform. Either TRANSACTIONAL or + // NON_TRANSACTIONAL. + // + // Possible values: + // "NON_TRANSACTIONAL" + // "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"` + + // ForceSendFields is a list of field names (e.g. "IgnoreReadOnly") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommitRequest) MarshalJSON() ([]byte, error) { + type noMethod CommitRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type CommitResponse struct { + Header *ResponseHeader `json:"header,omitempty"` + + // MutationResult: The result of performing the mutation (if any). + MutationResult *MutationResult `json:"mutationResult,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Header") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommitResponse) MarshalJSON() ([]byte, error) { + type noMethod CommitResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CompositeFilter: A filter that merges the multiple other filters +// using the given operation. +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. + // + // Possible values: + // "AND" + Operator string `json:"operator,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Filters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CompositeFilter) MarshalJSON() ([]byte, error) { + type noMethod CompositeFilter + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Entity: An entity. +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 map[string]Property `json:"properties,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Entity) MarshalJSON() ([]byte, error) { + type noMethod Entity + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EntityResult: The result of fetching an entity from the datastore. +type EntityResult struct { + // Entity: The resulting entity. + Entity *Entity `json:"entity,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Entity") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EntityResult) MarshalJSON() ([]byte, error) { + type noMethod EntityResult + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Filter: A holder for any type of filter. Exactly one field should be +// specified. +type Filter struct { + // CompositeFilter: A composite filter. + CompositeFilter *CompositeFilter `json:"compositeFilter,omitempty"` + + // PropertyFilter: A filter on a property. + PropertyFilter *PropertyFilter `json:"propertyFilter,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CompositeFilter") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Filter) MarshalJSON() ([]byte, error) { + type noMethod Filter + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GqlQuery: A GQL query. +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: The query string. + QueryString string `json:"queryString,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AllowLiteral") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GqlQuery) MarshalJSON() ([]byte, error) { + type noMethod GqlQuery + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GqlQueryArg: A binding argument for a GQL query. +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"` + + // ForceSendFields is a list of field names (e.g. "Cursor") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GqlQueryArg) MarshalJSON() ([]byte, error) { + type noMethod GqlQueryArg + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Key: A unique identifier for an entity. +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. The path + // can have at most 100 elements. + Path []*KeyPathElement `json:"path,omitempty"` + + // ForceSendFields is a list of field names (e.g. "PartitionId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Key) MarshalJSON() ([]byte, error) { + type noMethod Key + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// KeyPathElement: A (kind, ID/name) pair used to construct a key +// path. +// +// At 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. +type KeyPathElement struct { + // Id: The ID of the entity. Never equal to zero. Values less than zero + // are discouraged and will not be supported in the future. + Id int64 `json:"id,omitempty,string"` + + // Kind: The kind of the entity. A kind matching regex "__.*__" is + // reserved/read-only. A kind must not contain more than 500 characters. + // Cannot be "". + Kind string `json:"kind,omitempty"` + + // Name: The name of the entity. A name matching regex "__.*__" is + // reserved/read-only. A name must not be more than 500 characters. + // Cannot be "". + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *KeyPathElement) MarshalJSON() ([]byte, error) { + type noMethod KeyPathElement + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// KindExpression: A representation of a kind. +type KindExpression struct { + // Name: The name of the kind. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *KindExpression) MarshalJSON() ([]byte, error) { + type noMethod KindExpression + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Keys") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LookupRequest) MarshalJSON() ([]byte, error) { + type noMethod LookupRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Deferred") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LookupResponse) MarshalJSON() ([]byte, error) { + type noMethod LookupResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Mutation: A set of changes to apply. +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"` + + // ForceSendFields is a list of field names (e.g. "Delete") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Mutation) MarshalJSON() ([]byte, error) { + type noMethod Mutation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "IndexUpdates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MutationResult) MarshalJSON() ([]byte, error) { + type noMethod MutationResult + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PartitionId: An identifier for a particular subset of +// entities. +// +// Entities are partitioned into various subsets, each used by different +// datasets and different namespaces within a dataset and so forth. +type PartitionId struct { + // DatasetId: The dataset ID. + DatasetId string `json:"datasetId,omitempty"` + + // Namespace: The namespace. + Namespace string `json:"namespace,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DatasetId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PartitionId) MarshalJSON() ([]byte, error) { + type noMethod PartitionId + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Property: An entity property. +type Property struct { + // BlobKeyValue: A blob key value. + BlobKeyValue *string `json:"blobKeyValue,omitempty"` + + // BlobValue: A blob value. May be a maximum of 1,000,000 bytes. When + // indexed is true, may have at most 500 bytes. + 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. A Value + // instance that sets field list_value must not set field meaning or + // field indexed. + 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. When indexed is true, may + // have at most 500 characters. + StringValue *string `json:"stringValue,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BlobKeyValue") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Property) MarshalJSON() ([]byte, error) { + type noMethod Property + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PropertyExpression: A representation of a property in a projection. +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. + // + // Possible values: + // "FIRST" + AggregationFunction string `json:"aggregationFunction,omitempty"` + + // Property: The property to project. + Property *PropertyReference `json:"property,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AggregationFunction") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PropertyExpression) MarshalJSON() ([]byte, error) { + type noMethod PropertyExpression + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PropertyFilter: A filter on a specific property. +type PropertyFilter struct { + // Operator: The operator to filter by. One of lessThan, + // lessThanOrEqual, greaterThan, greaterThanOrEqual, equal, or + // hasAncestor. + // + // Possible values: + // "EQUAL" + // "GREATER_THAN" + // "GREATER_THAN_OR_EQUAL" + // "HAS_ANCESTOR" + // "LESS_THAN" + // "LESS_THAN_OR_EQUAL" + 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"` + + // ForceSendFields is a list of field names (e.g. "Operator") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PropertyFilter) MarshalJSON() ([]byte, error) { + type noMethod PropertyFilter + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PropertyOrder: The desired order for a specific property. +type PropertyOrder struct { + // Direction: The direction to order by. One of ascending or descending. + // Optional, defaults to ascending. + // + // Possible values: + // "ASCENDING" + // "DESCENDING" + Direction string `json:"direction,omitempty"` + + // Property: The property to order by. + Property *PropertyReference `json:"property,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Direction") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PropertyOrder) MarshalJSON() ([]byte, error) { + type noMethod PropertyOrder + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PropertyReference: A reference to a property relative to the kind +// expressions. +type PropertyReference struct { + // Name: The name of the property. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PropertyReference) MarshalJSON() ([]byte, error) { + type noMethod PropertyReference + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Query: A query. +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"` + + // ForceSendFields is a list of field names (e.g. "EndCursor") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Query) MarshalJSON() ([]byte, error) { + type noMethod Query + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// QueryResultBatch: A batch of results produced by a query. +type QueryResultBatch struct { + // EndCursor: A cursor that points to the position after the last result + // in the batch. May be absent. TODO(arfuller): Once all plans produce + // cursors update documentation here. + 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. + // + // Possible values: + // "FULL" + // "KEY_ONLY" + // "PROJECTION" + 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. + // + // Possible values: + // "MORE_RESULTS_AFTER_LIMIT" + // "NOT_FINISHED" + // "NO_MORE_RESULTS" + MoreResults string `json:"moreResults,omitempty"` + + // SkippedResults: The number of results skipped because of + // Query.offset. + SkippedResults int64 `json:"skippedResults,omitempty"` + + // ForceSendFields is a list of field names (e.g. "EndCursor") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *QueryResultBatch) MarshalJSON() ([]byte, error) { + type noMethod QueryResultBatch + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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. + // + // Possible values: + // "DEFAULT" + // "EVENTUAL" + // "STRONG" + ReadConsistency string `json:"readConsistency,omitempty"` + + // Transaction: The transaction to use. Optional. + Transaction string `json:"transaction,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ReadConsistency") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReadOptions) MarshalJSON() ([]byte, error) { + type noMethod ReadOptions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ResponseHeader struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "datastore#responseHeader". + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResponseHeader) MarshalJSON() ([]byte, error) { + type noMethod ResponseHeader + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type RollbackRequest struct { + // Transaction: The transaction identifier, returned by a call to + // beginTransaction. + Transaction string `json:"transaction,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Transaction") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RollbackRequest) MarshalJSON() ([]byte, error) { + type noMethod RollbackRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type RollbackResponse struct { + Header *ResponseHeader `json:"header,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Header") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RollbackResponse) MarshalJSON() ([]byte, error) { + type noMethod RollbackResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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. This partition ID is + // normalized with the standard default context partition ID, but all + // other partition IDs in RunQueryRequest are normalized with this + // partition ID as the context partition ID. + 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"` + + // ForceSendFields is a list of field names (e.g. "GqlQuery") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RunQueryRequest) MarshalJSON() ([]byte, error) { + type noMethod RunQueryRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type RunQueryResponse struct { + // Batch: A batch of query results (always present). + Batch *QueryResultBatch `json:"batch,omitempty"` + + Header *ResponseHeader `json:"header,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Batch") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RunQueryResponse) MarshalJSON() ([]byte, error) { + type noMethod RunQueryResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Value: A message that can hold any of the supported value types and +// associated metadata. +type Value struct { + // BlobKeyValue: A blob key value. + BlobKeyValue string `json:"blobKeyValue,omitempty"` + + // BlobValue: A blob value. May be a maximum of 1,000,000 bytes. When + // indexed is true, may have at most 500 bytes. + 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. A Value + // instance that sets field list_value must not set field meaning or + // field indexed. + 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. When indexed is true, may + // have at most 500 characters. + StringValue string `json:"stringValue,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BlobKeyValue") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Value) MarshalJSON() ([]byte, error) { + type noMethod Value + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "datastore.datasets.allocateIds": + +type DatasetsAllocateIdsCall struct { + s *Service + datasetId string + allocateidsrequest *AllocateIdsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsAllocateIdsCall) Fields(s ...googleapi.Field) *DatasetsAllocateIdsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsAllocateIdsCall) Context(ctx context.Context) *DatasetsAllocateIdsCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsAllocateIdsCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/allocateIds") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "datasetId": c.datasetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "datastore.datasets.allocateIds" call. +// Exactly one of *AllocateIdsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AllocateIdsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DatasetsAllocateIdsCall) Do() (*AllocateIdsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AllocateIdsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsBeginTransactionCall) Fields(s ...googleapi.Field) *DatasetsBeginTransactionCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsBeginTransactionCall) Context(ctx context.Context) *DatasetsBeginTransactionCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsBeginTransactionCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/beginTransaction") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "datasetId": c.datasetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "datastore.datasets.beginTransaction" call. +// Exactly one of *BeginTransactionResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *BeginTransactionResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DatasetsBeginTransactionCall) Do() (*BeginTransactionResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BeginTransactionResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsCommitCall) Fields(s ...googleapi.Field) *DatasetsCommitCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsCommitCall) Context(ctx context.Context) *DatasetsCommitCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsCommitCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/commit") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "datasetId": c.datasetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "datastore.datasets.commit" call. +// Exactly one of *CommitResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CommitResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DatasetsCommitCall) Do() (*CommitResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CommitResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsLookupCall) Fields(s ...googleapi.Field) *DatasetsLookupCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsLookupCall) Context(ctx context.Context) *DatasetsLookupCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsLookupCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/lookup") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "datasetId": c.datasetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "datastore.datasets.lookup" call. +// Exactly one of *LookupResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LookupResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DatasetsLookupCall) Do() (*LookupResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LookupResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsRollbackCall) Fields(s ...googleapi.Field) *DatasetsRollbackCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsRollbackCall) Context(ctx context.Context) *DatasetsRollbackCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsRollbackCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/rollback") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "datasetId": c.datasetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "datastore.datasets.rollback" call. +// Exactly one of *RollbackResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *RollbackResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DatasetsRollbackCall) Do() (*RollbackResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RollbackResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsRunQueryCall) Fields(s ...googleapi.Field) *DatasetsRunQueryCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsRunQueryCall) Context(ctx context.Context) *DatasetsRunQueryCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsRunQueryCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/runQuery") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "datasetId": c.datasetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "datastore.datasets.runQuery" call. +// Exactly one of *RunQueryResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *RunQueryResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DatasetsRunQueryCall) Do() (*RunQueryResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RunQueryResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/datastore", + // "https://www.googleapis.com/auth/userinfo.email" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/deploymentmanager/v2/deploymentmanager-api.json b/Godeps/_workspace/src/google.golang.org/api/deploymentmanager/v2/deploymentmanager-api.json new file mode 100644 index 000000000..22f7433cd --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/deploymentmanager/v2/deploymentmanager-api.json @@ -0,0 +1,1394 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/3wCGcnGwi3iQywGP6Ncdo6mexyQ\"", + "discoveryVersion": "v1", + "id": "deploymentmanager:v2", + "name": "deploymentmanager", + "canonicalName": "Deployment Manager", + "version": "v2", + "revision": "20150831", + "title": "Google Cloud Deployment Manager API", + "description": "The Deployment Manager API allows users to declaratively configure, deploy and run complex solutions on the Google Cloud Platform.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/deployment-manager/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/deploymentmanager/v2/projects/", + "basePath": "/deploymentmanager/v2/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "deploymentmanager/v2/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/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/ndev.cloudman": { + "description": "View and manage your Google Cloud Platform management resources and deployment status information" + }, + "https://www.googleapis.com/auth/ndev.cloudman.readonly": { + "description": "View your Google Cloud Platform management resources and deployment status information" + } + } + } + }, + "schemas": { + "ConfigFile": { + "id": "ConfigFile", + "type": "object", + "description": "", + "properties": { + "content": { + "type": "string", + "description": "The contents of the file." + } + } + }, + "Deployment": { + "id": "Deployment", + "type": "object", + "description": "", + "properties": { + "description": { + "type": "string", + "description": "An optional user-provided description of the deployment." + }, + "fingerprint": { + "type": "string", + "description": "Provides a fingerprint to use in requests to modify a deployment, such as update(), stop(), and cancelPreview() requests. A fingerprint is a randomly generated value that must be provided with update(), stop(), and cancelPreview() requests to perform optimistic locking. This ensures optimistic concurrency so that only one request happens at a time.\n\nThe fingerprint is initially generated by Deployment Manager and changes after every request to modify data. To get the latest fingerprint value, perform a get() request to a deployment.", + "format": "byte" + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "[Output Only] Timestamp when the deployment was created, in RFC3339 text format ." + }, + "manifest": { + "type": "string", + "description": "[Output Only] URL of the manifest representing the last manifest that was successfully deployed." + }, + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash." + }, + "operation": { + "$ref": "Operation", + "description": "[Output Only] The Operation that most recently ran, or is currently running, on this deployment." + }, + "target": { + "$ref": "TargetConfiguration", + "description": "[Input Only] The parameters that define your deployment, including the deployment configuration and relevant templates." + }, + "update": { + "$ref": "DeploymentUpdate", + "description": "[Output Only] If Deployment Manager is currently updating or previewing an update to this deployment, the updated configuration appears here." + } + } + }, + "DeploymentUpdate": { + "id": "DeploymentUpdate", + "type": "object", + "description": "", + "properties": { + "manifest": { + "type": "string", + "description": "[Output Only] URL of the manifest representing the update configuration of this deployment." + } + } + }, + "DeploymentsCancelPreviewRequest": { + "id": "DeploymentsCancelPreviewRequest", + "type": "object", + "description": "", + "properties": { + "fingerprint": { + "type": "string", + "description": "Specifies a fingerprint for cancelPreview() requests. A fingerprint is a randomly generated value that must be provided in cancelPreview() requests to perform optimistic locking. This ensures optimistic concurrency so that the deployment does not have conflicting requests (e.g. if someone attempts to make a new update request while another user attempts to cancel a preview, this would prevent one of the requests).\n\nThe fingerprint is initially generated by Deployment Manager and changes after every request to modify a deployment. To get the latest fingerprint value, perform a get() request to a deployment.", + "format": "byte" + } + } + }, + "DeploymentsListResponse": { + "id": "DeploymentsListResponse", + "type": "object", + "description": "A response containing a partial list of deployments and a page token used to build the next request if the request has been truncated.", + "properties": { + "deployments": { + "type": "array", + "description": "[Output Only] The deployments contained in this response.", + "items": { + "$ref": "Deployment" + } + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + } + } + }, + "DeploymentsStopRequest": { + "id": "DeploymentsStopRequest", + "type": "object", + "description": "", + "properties": { + "fingerprint": { + "type": "string", + "description": "Specifies a fingerprint for stop() requests. A fingerprint is a randomly generated value that must be provided in stop() requests to perform optimistic locking. This ensures optimistic concurrency so that the deployment does not have conflicting requests (e.g. if someone attempts to make a new update request while another user attempts to stop an ongoing update request, this would prevent a collision).\n\nThe fingerprint is initially generated by Deployment Manager and changes after every request to modify a deployment. To get the latest fingerprint value, perform a get() request to a deployment.", + "format": "byte" + } + } + }, + "ImportFile": { + "id": "ImportFile", + "type": "object", + "description": "", + "properties": { + "content": { + "type": "string", + "description": "The contents of the file." + }, + "name": { + "type": "string", + "description": "The name of the file." + } + } + }, + "Manifest": { + "id": "Manifest", + "type": "object", + "description": "", + "properties": { + "config": { + "$ref": "ConfigFile", + "description": "[Output Only] The YAML configuration for this manifest." + }, + "expandedConfig": { + "type": "string", + "description": "[Output Only] The fully-expanded configuration file, including any templates and references." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "imports": { + "type": "array", + "description": "[Output Only] The imported files for this manifest.", + "items": { + "$ref": "ImportFile" + } + }, + "insertTime": { + "type": "string", + "description": "[Output Only] Timestamp when the manifest was created, in RFC3339 text format." + }, + "layout": { + "type": "string", + "description": "[Output Only] The YAML layout for this manifest." + }, + "name": { + "type": "string", + "description": "[Output Only] The name of the manifest." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Self link for the manifest." + } + } + }, + "ManifestsListResponse": { + "id": "ManifestsListResponse", + "type": "object", + "description": "A response containing a partial list of manifests and a page token used to build the next request if the request has been truncated.", + "properties": { + "manifests": { + "type": "array", + "description": "[Output Only] Manifests contained in this list response.", + "items": { + "$ref": "Manifest" + } + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "description": "An Operation resource, used to manage asynchronous API requests.", + "properties": { + "clientOperationId": { + "type": "string", + "description": "[Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all Operation resources in the project." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "endTime": { + "type": "string", + "description": "[Output Only] The time that this operation was completed. This is in RFC3339 text format." + }, + "error": { + "type": "object", + "description": "[Output Only] If errors are generated during processing of the operation, this field will be populated.", + "properties": { + "errors": { + "type": "array", + "description": "[Output Only] The array of errors encountered while processing this operation.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The error type identifier for this error." + }, + "location": { + "type": "string", + "description": "[Output Only] Indicates the field in the request which caused the error. This property is optional." + }, + "message": { + "type": "string", + "description": "[Output Only] An optional, human-readable error message." + } + } + } + } + } + }, + "httpErrorMessage": { + "type": "string", + "description": "[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND." + }, + "httpErrorStatusCode": { + "type": "integer", + "description": "[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as 404.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "[Output Only] The time that this operation was requested. This is in RFC3339 text format." + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#Operation for Operation resources.", + "default": "deploymentmanager#operation" + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource." + }, + "operationType": { + "type": "string", + "description": "[Output Only] Type of the operation, such as insert, update, and delete." + }, + "progress": { + "type": "integer", + "description": "[Output Only] 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 monotonically increase as the operation progresses.", + "format": "int32" + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where the operation resides. Only applicable for regional resources." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "startTime": { + "type": "string", + "description": "[Output Only] The time that this operation was started by the server. This is in RFC3339 text format." + }, + "status": { + "type": "string", + "description": "[Output Only] Status of the operation. Can be one of the following: PENDING, RUNNING, or DONE." + }, + "statusMessage": { + "type": "string", + "description": "[Output Only] An optional textual description of the current status of the operation." + }, + "targetId": { + "type": "string", + "description": "[Output Only] Unique target ID which identifies a particular incarnation of the target.", + "format": "uint64" + }, + "targetLink": { + "type": "string", + "description": "[Output Only] URL of the resource the operation is mutating." + }, + "user": { + "type": "string", + "description": "[Output Only] User who requested the operation, for example: user@example.com." + }, + "warnings": { + "type": "array", + "description": "[Output Only] If warning messages are generated during processing of the operation, this field will be populated.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The warning type identifier for this warning." + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + }, + "zone": { + "type": "string", + "description": "[Output Only] URL of the zone where the operation resides." + } + } + }, + "OperationsListResponse": { + "id": "OperationsListResponse", + "type": "object", + "description": "A response containing a partial list of operations and a page token used to build the next request if the request has been truncated.", + "properties": { + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "operations": { + "type": "array", + "description": "[Output Only] Operations contained in this list response.", + "items": { + "$ref": "Operation" + } + } + } + }, + "Resource": { + "id": "Resource", + "type": "object", + "description": "", + "properties": { + "finalProperties": { + "type": "string", + "description": "[Output Only] The evaluated properties of the resource with references expanded. Returned as serialized YAML." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "[Output Only] Timestamp when the resource was created or acquired, in RFC3339 text format ." + }, + "manifest": { + "type": "string", + "description": "[Output Only] URL of the manifest representing the current configuration of this resource." + }, + "name": { + "type": "string", + "description": "[Output Only] The name of the resource as it appears in the YAML config." + }, + "properties": { + "type": "string", + "description": "[Output Only] The current properties of the resource before any references have been filled in. Returned as serialized YAML." + }, + "type": { + "type": "string", + "description": "[Output Only] The type of the resource, for example compute.v1.instance, or replicaPools.v1beta2.instanceGroupManager." + }, + "update": { + "$ref": "ResourceUpdate", + "description": "[Output Only] If Deployment Manager is currently updating or previewing an update to this resource, the updated configuration appears here." + }, + "updateTime": { + "type": "string", + "description": "[Output Only] Timestamp when the resource was updated, in RFC3339 text format ." + }, + "url": { + "type": "string", + "description": "[Output Only] The URL of the actual resource." + }, + "warnings": { + "type": "array", + "description": "[Output Only] If warning messages are generated during processing of this resource, this field will be populated.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The warning type identifier for this warning." + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + } + }, + "ResourceUpdate": { + "id": "ResourceUpdate", + "type": "object", + "description": "", + "properties": { + "error": { + "type": "object", + "description": "[Output Only] If errors are generated during update of the resource, this field will be populated.", + "properties": { + "errors": { + "type": "array", + "description": "[Output Only] The array of errors encountered while processing this operation.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The error type identifier for this error." + }, + "location": { + "type": "string", + "description": "[Output Only] Indicates the field in the request which caused the error. This property is optional." + }, + "message": { + "type": "string", + "description": "[Output Only] An optional, human-readable error message." + } + } + } + } + } + }, + "finalProperties": { + "type": "string", + "description": "[Output Only] The expanded properties of the resource with reference values expanded. Returned as serialized YAML." + }, + "intent": { + "type": "string", + "description": "[Output Only] The intent of the resource: PREVIEW, UPDATE, or CANCEL." + }, + "manifest": { + "type": "string", + "description": "[Output Only] URL of the manifest representing the update configuration of this resource." + }, + "properties": { + "type": "string", + "description": "[Output Only] The set of updated properties for this resource, before references are expanded. Returned as serialized YAML." + }, + "state": { + "type": "string", + "description": "[Output Only] The state of the resource." + }, + "warnings": { + "type": "array", + "description": "[Output Only] If warning messages are generated during processing of this resource, this field will be populated.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The warning type identifier for this warning." + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + } + }, + "ResourcesListResponse": { + "id": "ResourcesListResponse", + "type": "object", + "description": "A response containing a partial list of resources and a page token used to build the next request if the request has been truncated.", + "properties": { + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request." + }, + "resources": { + "type": "array", + "description": "Resources contained in this list response.", + "items": { + "$ref": "Resource" + } + } + } + }, + "TargetConfiguration": { + "id": "TargetConfiguration", + "type": "object", + "description": "", + "properties": { + "config": { + "$ref": "ConfigFile", + "description": "The configuration to use for this deployment." + }, + "imports": { + "type": "array", + "description": "Specifies any files to import for this configuration. This can be used to import templates or other files. For example, you might import a text file in order to use the file in a template.", + "items": { + "$ref": "ImportFile" + } + } + } + }, + "Type": { + "id": "Type", + "type": "object", + "description": "A resource type supported by Deployment Manager.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "[Output Only] Timestamp when the type was created, in RFC3339 text format." + }, + "name": { + "type": "string", + "description": "Name of the type." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Self link for the type." + } + } + }, + "TypesListResponse": { + "id": "TypesListResponse", + "type": "object", + "description": "A response that returns all Types supported by Deployment Manager", + "properties": { + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request." + }, + "types": { + "type": "array", + "description": "[Output Only] A list of resource types supported by Deployment Manager.", + "items": { + "$ref": "Type" + } + } + } + } + }, + "resources": { + "deployments": { + "methods": { + "cancelPreview": { + "id": "deploymentmanager.deployments.cancelPreview", + "path": "{project}/global/deployments/{deployment}/cancelPreview", + "httpMethod": "POST", + "description": "Cancels and removes the preview currently associated with the deployment.", + "parameters": { + "deployment": { + "type": "string", + "description": "The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "deployment" + ], + "request": { + "$ref": "DeploymentsCancelPreviewRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "delete": { + "id": "deploymentmanager.deployments.delete", + "path": "{project}/global/deployments/{deployment}", + "httpMethod": "DELETE", + "description": "Deletes a deployment and all of the resources in the deployment.", + "parameters": { + "deployment": { + "type": "string", + "description": "The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "deployment" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "get": { + "id": "deploymentmanager.deployments.get", + "path": "{project}/global/deployments/{deployment}", + "httpMethod": "GET", + "description": "Gets information about a specific deployment.", + "parameters": { + "deployment": { + "type": "string", + "description": "The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "deployment" + ], + "response": { + "$ref": "Deployment" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "insert": { + "id": "deploymentmanager.deployments.insert", + "path": "{project}/global/deployments", + "httpMethod": "POST", + "description": "Creates a deployment and all of the resources described by the deployment manifest.", + "parameters": { + "preview": { + "type": "boolean", + "description": "If set to true, creates a deployment and creates \"shell\" resources but does not actually instantiate these resources. This allows you to preview what your deployment looks like. After previewing a deployment, you can deploy your resources by making a request with the update() method or you can use the cancelPreview() method to cancel the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "Deployment" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "list": { + "id": "deploymentmanager.deployments.list", + "path": "{project}/global/deployments", + "httpMethod": "GET", + "description": "Lists all deployments for a given project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "DeploymentsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "patch": { + "id": "deploymentmanager.deployments.patch", + "path": "{project}/global/deployments/{deployment}", + "httpMethod": "PATCH", + "description": "Updates a deployment and all of the resources described by the deployment manifest. This method supports patch semantics.", + "parameters": { + "createPolicy": { + "type": "string", + "description": "Sets the policy to use for creating new resources.", + "default": "CREATE_OR_ACQUIRE", + "enum": [ + "ACQUIRE", + "CREATE_OR_ACQUIRE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "deletePolicy": { + "type": "string", + "description": "Sets the policy to use for deleting resources.", + "default": "DELETE", + "enum": [ + "ABANDON", + "DELETE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "deployment": { + "type": "string", + "description": "The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "preview": { + "type": "boolean", + "description": "If set to true, updates the deployment and creates and updates the \"shell\" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment looks like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it.", + "default": "false", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "deployment" + ], + "request": { + "$ref": "Deployment" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "stop": { + "id": "deploymentmanager.deployments.stop", + "path": "{project}/global/deployments/{deployment}/stop", + "httpMethod": "POST", + "description": "Stops an ongoing operation. This does not roll back any work that has already been completed, but prevents any new work from being started.", + "parameters": { + "deployment": { + "type": "string", + "description": "The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "deployment" + ], + "request": { + "$ref": "DeploymentsStopRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "update": { + "id": "deploymentmanager.deployments.update", + "path": "{project}/global/deployments/{deployment}", + "httpMethod": "PUT", + "description": "Updates a deployment and all of the resources described by the deployment manifest.", + "parameters": { + "createPolicy": { + "type": "string", + "description": "Sets the policy to use for creating new resources.", + "default": "CREATE_OR_ACQUIRE", + "enum": [ + "ACQUIRE", + "CREATE_OR_ACQUIRE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "deletePolicy": { + "type": "string", + "description": "Sets the policy to use for deleting resources.", + "default": "DELETE", + "enum": [ + "ABANDON", + "DELETE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "deployment": { + "type": "string", + "description": "The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "preview": { + "type": "boolean", + "description": "If set to true, updates the deployment and creates and updates the \"shell\" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment looks like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it.", + "default": "false", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "deployment" + ], + "request": { + "$ref": "Deployment" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + } + } + }, + "manifests": { + "methods": { + "get": { + "id": "deploymentmanager.manifests.get", + "path": "{project}/global/deployments/{deployment}/manifests/{manifest}", + "httpMethod": "GET", + "description": "Gets information about a specific manifest.", + "parameters": { + "deployment": { + "type": "string", + "description": "The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "manifest": { + "type": "string", + "description": "The name of the manifest for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "deployment", + "manifest" + ], + "response": { + "$ref": "Manifest" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "list": { + "id": "deploymentmanager.manifests.list", + "path": "{project}/global/deployments/{deployment}/manifests", + "httpMethod": "GET", + "description": "Lists all manifests for a given deployment.", + "parameters": { + "deployment": { + "type": "string", + "description": "The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "deployment" + ], + "response": { + "$ref": "ManifestsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + } + } + }, + "operations": { + "methods": { + "get": { + "id": "deploymentmanager.operations.get", + "path": "{project}/global/operations/{operation}", + "httpMethod": "GET", + "description": "Gets information about a specific operation.", + "parameters": { + "operation": { + "type": "string", + "description": "The name of the operation for this request.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "list": { + "id": "deploymentmanager.operations.list", + "path": "{project}/global/operations", + "httpMethod": "GET", + "description": "Lists all operations for a project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "OperationsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + } + } + }, + "resources": { + "methods": { + "get": { + "id": "deploymentmanager.resources.get", + "path": "{project}/global/deployments/{deployment}/resources/{resource}", + "httpMethod": "GET", + "description": "Gets information about a single resource.", + "parameters": { + "deployment": { + "type": "string", + "description": "The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "The name of the resource for this request.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "deployment", + "resource" + ], + "response": { + "$ref": "Resource" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "list": { + "id": "deploymentmanager.resources.list", + "path": "{project}/global/deployments/{deployment}/resources", + "httpMethod": "GET", + "description": "Lists all resources in a given deployment.", + "parameters": { + "deployment": { + "type": "string", + "description": "The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "deployment" + ], + "response": { + "$ref": "ResourcesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + } + } + }, + "types": { + "methods": { + "list": { + "id": "deploymentmanager.types.list", + "path": "{project}/global/types", + "httpMethod": "GET", + "description": "Lists all resource types for Deployment Manager.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "TypesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/deploymentmanager/v2/deploymentmanager-gen.go b/Godeps/_workspace/src/google.golang.org/api/deploymentmanager/v2/deploymentmanager-gen.go new file mode 100644 index 000000000..5e905586b --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/deploymentmanager/v2/deploymentmanager-gen.go @@ -0,0 +1,3610 @@ +// Package deploymentmanager provides access to the Google Cloud Deployment Manager API. +// +// See https://cloud.google.com/deployment-manager/ +// +// Usage example: +// +// import "google.golang.org/api/deploymentmanager/v2" +// ... +// deploymentmanagerService, err := deploymentmanager.New(oauthHttpClient) +package deploymentmanager // import "google.golang.org/api/deploymentmanager/v2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "deploymentmanager:v2" +const apiName = "deploymentmanager" +const apiVersion = "v2" +const basePath = "https://www.googleapis.com/deploymentmanager/v2/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 data across Google Cloud Platform services + CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" + + // View and manage your Google Cloud Platform management resources and + // deployment status information + NdevCloudmanScope = "https://www.googleapis.com/auth/ndev.cloudman" + + // View your Google Cloud Platform management resources and deployment + // status information + NdevCloudmanReadonlyScope = "https://www.googleapis.com/auth/ndev.cloudman.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.Deployments = NewDeploymentsService(s) + s.Manifests = NewManifestsService(s) + s.Operations = NewOperationsService(s) + s.Resources = NewResourcesService(s) + s.Types = NewTypesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Deployments *DeploymentsService + + Manifests *ManifestsService + + Operations *OperationsService + + Resources *ResourcesService + + Types *TypesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewDeploymentsService(s *Service) *DeploymentsService { + rs := &DeploymentsService{s: s} + return rs +} + +type DeploymentsService struct { + s *Service +} + +func NewManifestsService(s *Service) *ManifestsService { + rs := &ManifestsService{s: s} + return rs +} + +type ManifestsService struct { + s *Service +} + +func NewOperationsService(s *Service) *OperationsService { + rs := &OperationsService{s: s} + return rs +} + +type OperationsService struct { + s *Service +} + +func NewResourcesService(s *Service) *ResourcesService { + rs := &ResourcesService{s: s} + return rs +} + +type ResourcesService struct { + s *Service +} + +func NewTypesService(s *Service) *TypesService { + rs := &TypesService{s: s} + return rs +} + +type TypesService struct { + s *Service +} + +type ConfigFile struct { + // Content: The contents of the file. + Content string `json:"content,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Content") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ConfigFile) MarshalJSON() ([]byte, error) { + type noMethod ConfigFile + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Deployment struct { + // Description: An optional user-provided description of the deployment. + Description string `json:"description,omitempty"` + + // Fingerprint: Provides a fingerprint to use in requests to modify a + // deployment, such as update(), stop(), and cancelPreview() requests. A + // fingerprint is a randomly generated value that must be provided with + // update(), stop(), and cancelPreview() requests to perform optimistic + // locking. This ensures optimistic concurrency so that only one request + // happens at a time. + // + // The fingerprint is initially generated by Deployment Manager and + // changes after every request to modify data. To get the latest + // fingerprint value, perform a get() request to a deployment. + Fingerprint string `json:"fingerprint,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // InsertTime: [Output Only] Timestamp when the deployment was created, + // in RFC3339 text format . + InsertTime string `json:"insertTime,omitempty"` + + // Manifest: [Output Only] URL of the manifest representing the last + // manifest that was successfully deployed. + Manifest string `json:"manifest,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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // Operation: [Output Only] The Operation that most recently ran, or is + // currently running, on this deployment. + Operation *Operation `json:"operation,omitempty"` + + // Target: [Input Only] The parameters that define your deployment, + // including the deployment configuration and relevant templates. + Target *TargetConfiguration `json:"target,omitempty"` + + // Update: [Output Only] If Deployment Manager is currently updating or + // previewing an update to this deployment, the updated configuration + // appears here. + Update *DeploymentUpdate `json:"update,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Deployment) MarshalJSON() ([]byte, error) { + type noMethod Deployment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DeploymentUpdate struct { + // Manifest: [Output Only] URL of the manifest representing the update + // configuration of this deployment. + Manifest string `json:"manifest,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Manifest") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeploymentUpdate) MarshalJSON() ([]byte, error) { + type noMethod DeploymentUpdate + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DeploymentsCancelPreviewRequest struct { + // Fingerprint: Specifies a fingerprint for cancelPreview() requests. A + // fingerprint is a randomly generated value that must be provided in + // cancelPreview() requests to perform optimistic locking. This ensures + // optimistic concurrency so that the deployment does not have + // conflicting requests (e.g. if someone attempts to make a new update + // request while another user attempts to cancel a preview, this would + // prevent one of the requests). + // + // The fingerprint is initially generated by Deployment Manager and + // changes after every request to modify a deployment. To get the latest + // fingerprint value, perform a get() request to a deployment. + Fingerprint string `json:"fingerprint,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Fingerprint") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeploymentsCancelPreviewRequest) MarshalJSON() ([]byte, error) { + type noMethod DeploymentsCancelPreviewRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DeploymentsListResponse: A response containing a partial list of +// deployments and a page token used to build the next request if the +// request has been truncated. +type DeploymentsListResponse struct { + // Deployments: [Output Only] The deployments contained in this + // response. + Deployments []*Deployment `json:"deployments,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Deployments") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeploymentsListResponse) MarshalJSON() ([]byte, error) { + type noMethod DeploymentsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DeploymentsStopRequest struct { + // Fingerprint: Specifies a fingerprint for stop() requests. A + // fingerprint is a randomly generated value that must be provided in + // stop() requests to perform optimistic locking. This ensures + // optimistic concurrency so that the deployment does not have + // conflicting requests (e.g. if someone attempts to make a new update + // request while another user attempts to stop an ongoing update + // request, this would prevent a collision). + // + // The fingerprint is initially generated by Deployment Manager and + // changes after every request to modify a deployment. To get the latest + // fingerprint value, perform a get() request to a deployment. + Fingerprint string `json:"fingerprint,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Fingerprint") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeploymentsStopRequest) MarshalJSON() ([]byte, error) { + type noMethod DeploymentsStopRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ImportFile struct { + // Content: The contents of the file. + Content string `json:"content,omitempty"` + + // Name: The name of the file. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Content") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ImportFile) MarshalJSON() ([]byte, error) { + type noMethod ImportFile + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Manifest struct { + // Config: [Output Only] The YAML configuration for this manifest. + Config *ConfigFile `json:"config,omitempty"` + + // ExpandedConfig: [Output Only] The fully-expanded configuration file, + // including any templates and references. + ExpandedConfig string `json:"expandedConfig,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Imports: [Output Only] The imported files for this manifest. + Imports []*ImportFile `json:"imports,omitempty"` + + // InsertTime: [Output Only] Timestamp when the manifest was created, in + // RFC3339 text format. + InsertTime string `json:"insertTime,omitempty"` + + // Layout: [Output Only] The YAML layout for this manifest. + Layout string `json:"layout,omitempty"` + + // Name: [Output Only] The name of the manifest. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] Self link for the manifest. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Config") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Manifest) MarshalJSON() ([]byte, error) { + type noMethod Manifest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ManifestsListResponse: A response containing a partial list of +// manifests and a page token used to build the next request if the +// request has been truncated. +type ManifestsListResponse struct { + // Manifests: [Output Only] Manifests contained in this list response. + Manifests []*Manifest `json:"manifests,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Manifests") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ManifestsListResponse) MarshalJSON() ([]byte, error) { + type noMethod ManifestsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Operation: An Operation resource, used to manage asynchronous API +// requests. +type Operation struct { + // ClientOperationId: [Output Only] An optional identifier specified by + // the client when the mutation was initiated. Must be unique for all + // Operation resources in the project. + ClientOperationId string `json:"clientOperationId,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // EndTime: [Output Only] The time that this operation was completed. + // This is in RFC3339 text format. + EndTime string `json:"endTime,omitempty"` + + // Error: [Output Only] If errors are generated during processing of the + // operation, this field will be populated. + Error *OperationError `json:"error,omitempty"` + + // HttpErrorMessage: [Output Only] If the operation fails, this field + // contains the HTTP error message that was returned, such as NOT FOUND. + HttpErrorMessage string `json:"httpErrorMessage,omitempty"` + + // HttpErrorStatusCode: [Output Only] If the operation fails, this field + // contains the HTTP error message that was returned, such as 404. + HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // InsertTime: [Output Only] The time that this operation was requested. + // This is in RFC3339 text format. + InsertTime string `json:"insertTime,omitempty"` + + // Kind: [Output Only] Type of the resource. Always compute#Operation + // for Operation resources. + Kind string `json:"kind,omitempty"` + + // Name: [Output Only] Name of the resource. + Name string `json:"name,omitempty"` + + // OperationType: [Output Only] Type of the operation, such as insert, + // update, and delete. + OperationType string `json:"operationType,omitempty"` + + // Progress: [Output Only] 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 monotonically + // increase as the operation progresses. + Progress int64 `json:"progress,omitempty"` + + // Region: [Output Only] URL of the region where the operation resides. + // Only applicable for regional resources. + Region string `json:"region,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // StartTime: [Output Only] The time that this operation was started by + // the server. This is in RFC3339 text format. + StartTime string `json:"startTime,omitempty"` + + // Status: [Output Only] Status of the operation. Can be one of the + // following: PENDING, RUNNING, or DONE. + Status string `json:"status,omitempty"` + + // StatusMessage: [Output Only] An optional textual description of the + // current status of the operation. + StatusMessage string `json:"statusMessage,omitempty"` + + // TargetId: [Output Only] Unique target ID which identifies a + // particular incarnation of the target. + TargetId uint64 `json:"targetId,omitempty,string"` + + // TargetLink: [Output Only] URL of the resource the operation is + // mutating. + TargetLink string `json:"targetLink,omitempty"` + + // User: [Output Only] User who requested the operation, for example: + // user@example.com. + User string `json:"user,omitempty"` + + // Warnings: [Output Only] If warning messages are generated during + // processing of the operation, this field will be populated. + Warnings []*OperationWarnings `json:"warnings,omitempty"` + + // Zone: [Output Only] URL of the zone where the operation resides. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ClientOperationId") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Operation) MarshalJSON() ([]byte, error) { + type noMethod Operation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationError: [Output Only] If errors are generated during +// processing of the operation, this field will be populated. +type OperationError struct { + // Errors: [Output Only] The array of errors encountered while + // processing this operation. + Errors []*OperationErrorErrors `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationError) MarshalJSON() ([]byte, error) { + type noMethod OperationError + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationErrorErrors struct { + // Code: [Output Only] The error type identifier for this error. + Code string `json:"code,omitempty"` + + // Location: [Output Only] Indicates the field in the request which + // caused the error. This property is optional. + Location string `json:"location,omitempty"` + + // Message: [Output Only] An optional, human-readable error message. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) { + type noMethod OperationErrorErrors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationWarnings struct { + // Code: [Output Only] The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*OperationWarningsData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationWarnings) MarshalJSON() ([]byte, error) { + type noMethod OperationWarnings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationWarningsData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationWarningsData) MarshalJSON() ([]byte, error) { + type noMethod OperationWarningsData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationsListResponse: A response containing a partial list of +// operations and a page token used to build the next request if the +// request has been truncated. +type OperationsListResponse struct { + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Operations: [Output Only] Operations contained in this list response. + Operations []*Operation `json:"operations,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationsListResponse) MarshalJSON() ([]byte, error) { + type noMethod OperationsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Resource struct { + // FinalProperties: [Output Only] The evaluated properties of the + // resource with references expanded. Returned as serialized YAML. + FinalProperties string `json:"finalProperties,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // InsertTime: [Output Only] Timestamp when the resource was created or + // acquired, in RFC3339 text format . + InsertTime string `json:"insertTime,omitempty"` + + // Manifest: [Output Only] URL of the manifest representing the current + // configuration of this resource. + Manifest string `json:"manifest,omitempty"` + + // Name: [Output Only] The name of the resource as it appears in the + // YAML config. + Name string `json:"name,omitempty"` + + // Properties: [Output Only] The current properties of the resource + // before any references have been filled in. Returned as serialized + // YAML. + Properties string `json:"properties,omitempty"` + + // Type: [Output Only] The type of the resource, for example + // compute.v1.instance, or replicaPools.v1beta2.instanceGroupManager. + Type string `json:"type,omitempty"` + + // Update: [Output Only] If Deployment Manager is currently updating or + // previewing an update to this resource, the updated configuration + // appears here. + Update *ResourceUpdate `json:"update,omitempty"` + + // UpdateTime: [Output Only] Timestamp when the resource was updated, in + // RFC3339 text format . + UpdateTime string `json:"updateTime,omitempty"` + + // Url: [Output Only] The URL of the actual resource. + Url string `json:"url,omitempty"` + + // Warnings: [Output Only] If warning messages are generated during + // processing of this resource, this field will be populated. + Warnings []*ResourceWarnings `json:"warnings,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "FinalProperties") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Resource) MarshalJSON() ([]byte, error) { + type noMethod Resource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ResourceWarnings struct { + // Code: [Output Only] The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*ResourceWarningsData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResourceWarnings) MarshalJSON() ([]byte, error) { + type noMethod ResourceWarnings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ResourceWarningsData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResourceWarningsData) MarshalJSON() ([]byte, error) { + type noMethod ResourceWarningsData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ResourceUpdate struct { + // Error: [Output Only] If errors are generated during update of the + // resource, this field will be populated. + Error *ResourceUpdateError `json:"error,omitempty"` + + // FinalProperties: [Output Only] The expanded properties of the + // resource with reference values expanded. Returned as serialized YAML. + FinalProperties string `json:"finalProperties,omitempty"` + + // Intent: [Output Only] The intent of the resource: PREVIEW, UPDATE, or + // CANCEL. + Intent string `json:"intent,omitempty"` + + // Manifest: [Output Only] URL of the manifest representing the update + // configuration of this resource. + Manifest string `json:"manifest,omitempty"` + + // Properties: [Output Only] The set of updated properties for this + // resource, before references are expanded. Returned as serialized + // YAML. + Properties string `json:"properties,omitempty"` + + // State: [Output Only] The state of the resource. + State string `json:"state,omitempty"` + + // Warnings: [Output Only] If warning messages are generated during + // processing of this resource, this field will be populated. + Warnings []*ResourceUpdateWarnings `json:"warnings,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Error") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResourceUpdate) MarshalJSON() ([]byte, error) { + type noMethod ResourceUpdate + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ResourceUpdateError: [Output Only] If errors are generated during +// update of the resource, this field will be populated. +type ResourceUpdateError struct { + // Errors: [Output Only] The array of errors encountered while + // processing this operation. + Errors []*ResourceUpdateErrorErrors `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResourceUpdateError) MarshalJSON() ([]byte, error) { + type noMethod ResourceUpdateError + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ResourceUpdateErrorErrors struct { + // Code: [Output Only] The error type identifier for this error. + Code string `json:"code,omitempty"` + + // Location: [Output Only] Indicates the field in the request which + // caused the error. This property is optional. + Location string `json:"location,omitempty"` + + // Message: [Output Only] An optional, human-readable error message. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResourceUpdateErrorErrors) MarshalJSON() ([]byte, error) { + type noMethod ResourceUpdateErrorErrors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ResourceUpdateWarnings struct { + // Code: [Output Only] The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*ResourceUpdateWarningsData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResourceUpdateWarnings) MarshalJSON() ([]byte, error) { + type noMethod ResourceUpdateWarnings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ResourceUpdateWarningsData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResourceUpdateWarningsData) MarshalJSON() ([]byte, error) { + type noMethod ResourceUpdateWarningsData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ResourcesListResponse: A response containing a partial list of +// resources and a page token used to build the next request if the +// request has been truncated. +type ResourcesListResponse struct { + // NextPageToken: A token used to continue a truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Resources: Resources contained in this list response. + Resources []*Resource `json:"resources,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResourcesListResponse) MarshalJSON() ([]byte, error) { + type noMethod ResourcesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetConfiguration struct { + // Config: The configuration to use for this deployment. + Config *ConfigFile `json:"config,omitempty"` + + // Imports: Specifies any files to import for this configuration. This + // can be used to import templates or other files. For example, you + // might import a text file in order to use the file in a template. + Imports []*ImportFile `json:"imports,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Config") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetConfiguration) MarshalJSON() ([]byte, error) { + type noMethod TargetConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Type: A resource type supported by Deployment Manager. +type Type struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // InsertTime: [Output Only] Timestamp when the type was created, in + // RFC3339 text format. + InsertTime string `json:"insertTime,omitempty"` + + // Name: Name of the type. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] Self link for the type. + SelfLink string `json:"selfLink,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Type) MarshalJSON() ([]byte, error) { + type noMethod Type + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TypesListResponse: A response that returns all Types supported by +// Deployment Manager +type TypesListResponse struct { + // NextPageToken: A token used to continue a truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Types: [Output Only] A list of resource types supported by Deployment + // Manager. + Types []*Type `json:"types,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TypesListResponse) MarshalJSON() ([]byte, error) { + type noMethod TypesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "deploymentmanager.deployments.cancelPreview": + +type DeploymentsCancelPreviewCall struct { + s *Service + project string + deployment string + deploymentscancelpreviewrequest *DeploymentsCancelPreviewRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// CancelPreview: Cancels and removes the preview currently associated +// with the deployment. +func (r *DeploymentsService) CancelPreview(project string, deployment string, deploymentscancelpreviewrequest *DeploymentsCancelPreviewRequest) *DeploymentsCancelPreviewCall { + c := &DeploymentsCancelPreviewCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + c.deploymentscancelpreviewrequest = deploymentscancelpreviewrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DeploymentsCancelPreviewCall) Fields(s ...googleapi.Field) *DeploymentsCancelPreviewCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DeploymentsCancelPreviewCall) Context(ctx context.Context) *DeploymentsCancelPreviewCall { + c.ctx_ = ctx + return c +} + +func (c *DeploymentsCancelPreviewCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.deploymentscancelpreviewrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}/cancelPreview") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "deployment": c.deployment, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.deployments.cancelPreview" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DeploymentsCancelPreviewCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Cancels and removes the preview currently associated with the deployment.", + // "httpMethod": "POST", + // "id": "deploymentmanager.deployments.cancelPreview", + // "parameterOrder": [ + // "project", + // "deployment" + // ], + // "parameters": { + // "deployment": { + // "description": "The name of the deployment for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/deployments/{deployment}/cancelPreview", + // "request": { + // "$ref": "DeploymentsCancelPreviewRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.cloudman" + // ] + // } + +} + +// method id "deploymentmanager.deployments.delete": + +type DeploymentsDeleteCall struct { + s *Service + project string + deployment string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a deployment and all of the resources in the +// deployment. +func (r *DeploymentsService) Delete(project string, deployment string) *DeploymentsDeleteCall { + c := &DeploymentsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DeploymentsDeleteCall) Fields(s ...googleapi.Field) *DeploymentsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DeploymentsDeleteCall) Context(ctx context.Context) *DeploymentsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *DeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "deployment": c.deployment, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.deployments.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DeploymentsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a deployment and all of the resources in the deployment.", + // "httpMethod": "DELETE", + // "id": "deploymentmanager.deployments.delete", + // "parameterOrder": [ + // "project", + // "deployment" + // ], + // "parameters": { + // "deployment": { + // "description": "The name of the deployment for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/deployments/{deployment}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.cloudman" + // ] + // } + +} + +// method id "deploymentmanager.deployments.get": + +type DeploymentsGetCall struct { + s *Service + project string + deployment string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets information about a specific deployment. +func (r *DeploymentsService) Get(project string, deployment string) *DeploymentsGetCall { + c := &DeploymentsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DeploymentsGetCall) Fields(s ...googleapi.Field) *DeploymentsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DeploymentsGetCall) IfNoneMatch(entityTag string) *DeploymentsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DeploymentsGetCall) Context(ctx context.Context) *DeploymentsGetCall { + c.ctx_ = ctx + return c +} + +func (c *DeploymentsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "deployment": c.deployment, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.deployments.get" call. +// Exactly one of *Deployment or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Deployment.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DeploymentsGetCall) Do() (*Deployment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Deployment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets information about a specific deployment.", + // "httpMethod": "GET", + // "id": "deploymentmanager.deployments.get", + // "parameterOrder": [ + // "project", + // "deployment" + // ], + // "parameters": { + // "deployment": { + // "description": "The name of the deployment for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/deployments/{deployment}", + // "response": { + // "$ref": "Deployment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "deploymentmanager.deployments.insert": + +type DeploymentsInsertCall struct { + s *Service + project string + deployment *Deployment + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a deployment and all of the resources described by +// the deployment manifest. +func (r *DeploymentsService) Insert(project string, deployment *Deployment) *DeploymentsInsertCall { + c := &DeploymentsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + return c +} + +// Preview sets the optional parameter "preview": If set to true, +// creates a deployment and creates "shell" resources but does not +// actually instantiate these resources. This allows you to preview what +// your deployment looks like. After previewing a deployment, you can +// deploy your resources by making a request with the update() method or +// you can use the cancelPreview() method to cancel the preview +// altogether. Note that the deployment will still exist after you +// cancel the preview and you must separately delete this deployment if +// you want to remove it. +func (c *DeploymentsInsertCall) Preview(preview bool) *DeploymentsInsertCall { + c.opt_["preview"] = preview + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DeploymentsInsertCall) Fields(s ...googleapi.Field) *DeploymentsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DeploymentsInsertCall) Context(ctx context.Context) *DeploymentsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *DeploymentsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["preview"]; ok { + params.Set("preview", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.deployments.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DeploymentsInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a deployment and all of the resources described by the deployment manifest.", + // "httpMethod": "POST", + // "id": "deploymentmanager.deployments.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "preview": { + // "description": "If set to true, creates a deployment and creates \"shell\" resources but does not actually instantiate these resources. This allows you to preview what your deployment looks like. After previewing a deployment, you can deploy your resources by making a request with the update() method or you can use the cancelPreview() method to cancel the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it.", + // "location": "query", + // "type": "boolean" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/deployments", + // "request": { + // "$ref": "Deployment" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.cloudman" + // ] + // } + +} + +// method id "deploymentmanager.deployments.list": + +type DeploymentsListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all deployments for a given project. +func (r *DeploymentsService) List(project string) *DeploymentsListCall { + c := &DeploymentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *DeploymentsListCall) Filter(filter string) *DeploymentsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *DeploymentsListCall) MaxResults(maxResults int64) *DeploymentsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *DeploymentsListCall) PageToken(pageToken string) *DeploymentsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DeploymentsListCall) Fields(s ...googleapi.Field) *DeploymentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DeploymentsListCall) IfNoneMatch(entityTag string) *DeploymentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DeploymentsListCall) Context(ctx context.Context) *DeploymentsListCall { + c.ctx_ = ctx + return c +} + +func (c *DeploymentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.deployments.list" call. +// Exactly one of *DeploymentsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DeploymentsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DeploymentsListCall) Do() (*DeploymentsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DeploymentsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all deployments for a given project.", + // "httpMethod": "GET", + // "id": "deploymentmanager.deployments.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/deployments", + // "response": { + // "$ref": "DeploymentsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "deploymentmanager.deployments.patch": + +type DeploymentsPatchCall struct { + s *Service + project string + deployment string + deployment2 *Deployment + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates a deployment and all of the resources described by the +// deployment manifest. This method supports patch semantics. +func (r *DeploymentsService) Patch(project string, deployment string, deployment2 *Deployment) *DeploymentsPatchCall { + c := &DeploymentsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + c.deployment2 = deployment2 + return c +} + +// CreatePolicy sets the optional parameter "createPolicy": Sets the +// policy to use for creating new resources. +// +// Possible values: +// "ACQUIRE" +// "CREATE_OR_ACQUIRE" (default) +func (c *DeploymentsPatchCall) CreatePolicy(createPolicy string) *DeploymentsPatchCall { + c.opt_["createPolicy"] = createPolicy + return c +} + +// DeletePolicy sets the optional parameter "deletePolicy": Sets the +// policy to use for deleting resources. +// +// Possible values: +// "ABANDON" +// "DELETE" (default) +func (c *DeploymentsPatchCall) DeletePolicy(deletePolicy string) *DeploymentsPatchCall { + c.opt_["deletePolicy"] = deletePolicy + return c +} + +// Preview sets the optional parameter "preview": If set to true, +// updates the deployment and creates and updates the "shell" resources +// but does not actually alter or instantiate these resources. This +// allows you to preview what your deployment looks like. You can use +// this intent to preview how an update would affect your deployment. +// You must provide a target.config with a configuration if this is set +// to true. After previewing a deployment, you can deploy your resources +// by making a request with the update() or you can cancelPreview() to +// remove the preview altogether. Note that the deployment will still +// exist after you cancel the preview and you must separately delete +// this deployment if you want to remove it. +func (c *DeploymentsPatchCall) Preview(preview bool) *DeploymentsPatchCall { + c.opt_["preview"] = preview + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DeploymentsPatchCall) Fields(s ...googleapi.Field) *DeploymentsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DeploymentsPatchCall) Context(ctx context.Context) *DeploymentsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *DeploymentsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["createPolicy"]; ok { + params.Set("createPolicy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["deletePolicy"]; ok { + params.Set("deletePolicy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["preview"]; ok { + params.Set("preview", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "deployment": c.deployment, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.deployments.patch" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DeploymentsPatchCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a deployment and all of the resources described by the deployment manifest. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "deploymentmanager.deployments.patch", + // "parameterOrder": [ + // "project", + // "deployment" + // ], + // "parameters": { + // "createPolicy": { + // "default": "CREATE_OR_ACQUIRE", + // "description": "Sets the policy to use for creating new resources.", + // "enum": [ + // "ACQUIRE", + // "CREATE_OR_ACQUIRE" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "deletePolicy": { + // "default": "DELETE", + // "description": "Sets the policy to use for deleting resources.", + // "enum": [ + // "ABANDON", + // "DELETE" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "deployment": { + // "description": "The name of the deployment for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "preview": { + // "default": "false", + // "description": "If set to true, updates the deployment and creates and updates the \"shell\" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment looks like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it.", + // "location": "query", + // "type": "boolean" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/deployments/{deployment}", + // "request": { + // "$ref": "Deployment" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.cloudman" + // ] + // } + +} + +// method id "deploymentmanager.deployments.stop": + +type DeploymentsStopCall struct { + s *Service + project string + deployment string + deploymentsstoprequest *DeploymentsStopRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Stop: Stops an ongoing operation. This does not roll back any work +// that has already been completed, but prevents any new work from being +// started. +func (r *DeploymentsService) Stop(project string, deployment string, deploymentsstoprequest *DeploymentsStopRequest) *DeploymentsStopCall { + c := &DeploymentsStopCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + c.deploymentsstoprequest = deploymentsstoprequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DeploymentsStopCall) Fields(s ...googleapi.Field) *DeploymentsStopCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DeploymentsStopCall) Context(ctx context.Context) *DeploymentsStopCall { + c.ctx_ = ctx + return c +} + +func (c *DeploymentsStopCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.deploymentsstoprequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}/stop") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "deployment": c.deployment, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.deployments.stop" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DeploymentsStopCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Stops an ongoing operation. This does not roll back any work that has already been completed, but prevents any new work from being started.", + // "httpMethod": "POST", + // "id": "deploymentmanager.deployments.stop", + // "parameterOrder": [ + // "project", + // "deployment" + // ], + // "parameters": { + // "deployment": { + // "description": "The name of the deployment for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/deployments/{deployment}/stop", + // "request": { + // "$ref": "DeploymentsStopRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.cloudman" + // ] + // } + +} + +// method id "deploymentmanager.deployments.update": + +type DeploymentsUpdateCall struct { + s *Service + project string + deployment string + deployment2 *Deployment + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a deployment and all of the resources described by +// the deployment manifest. +func (r *DeploymentsService) Update(project string, deployment string, deployment2 *Deployment) *DeploymentsUpdateCall { + c := &DeploymentsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + c.deployment2 = deployment2 + return c +} + +// CreatePolicy sets the optional parameter "createPolicy": Sets the +// policy to use for creating new resources. +// +// Possible values: +// "ACQUIRE" +// "CREATE_OR_ACQUIRE" (default) +func (c *DeploymentsUpdateCall) CreatePolicy(createPolicy string) *DeploymentsUpdateCall { + c.opt_["createPolicy"] = createPolicy + return c +} + +// DeletePolicy sets the optional parameter "deletePolicy": Sets the +// policy to use for deleting resources. +// +// Possible values: +// "ABANDON" +// "DELETE" (default) +func (c *DeploymentsUpdateCall) DeletePolicy(deletePolicy string) *DeploymentsUpdateCall { + c.opt_["deletePolicy"] = deletePolicy + return c +} + +// Preview sets the optional parameter "preview": If set to true, +// updates the deployment and creates and updates the "shell" resources +// but does not actually alter or instantiate these resources. This +// allows you to preview what your deployment looks like. You can use +// this intent to preview how an update would affect your deployment. +// You must provide a target.config with a configuration if this is set +// to true. After previewing a deployment, you can deploy your resources +// by making a request with the update() or you can cancelPreview() to +// remove the preview altogether. Note that the deployment will still +// exist after you cancel the preview and you must separately delete +// this deployment if you want to remove it. +func (c *DeploymentsUpdateCall) Preview(preview bool) *DeploymentsUpdateCall { + c.opt_["preview"] = preview + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DeploymentsUpdateCall) Fields(s ...googleapi.Field) *DeploymentsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DeploymentsUpdateCall) Context(ctx context.Context) *DeploymentsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *DeploymentsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["createPolicy"]; ok { + params.Set("createPolicy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["deletePolicy"]; ok { + params.Set("deletePolicy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["preview"]; ok { + params.Set("preview", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "deployment": c.deployment, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.deployments.update" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DeploymentsUpdateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a deployment and all of the resources described by the deployment manifest.", + // "httpMethod": "PUT", + // "id": "deploymentmanager.deployments.update", + // "parameterOrder": [ + // "project", + // "deployment" + // ], + // "parameters": { + // "createPolicy": { + // "default": "CREATE_OR_ACQUIRE", + // "description": "Sets the policy to use for creating new resources.", + // "enum": [ + // "ACQUIRE", + // "CREATE_OR_ACQUIRE" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "deletePolicy": { + // "default": "DELETE", + // "description": "Sets the policy to use for deleting resources.", + // "enum": [ + // "ABANDON", + // "DELETE" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "deployment": { + // "description": "The name of the deployment for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "preview": { + // "default": "false", + // "description": "If set to true, updates the deployment and creates and updates the \"shell\" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment looks like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it.", + // "location": "query", + // "type": "boolean" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/deployments/{deployment}", + // "request": { + // "$ref": "Deployment" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.cloudman" + // ] + // } + +} + +// method id "deploymentmanager.manifests.get": + +type ManifestsGetCall struct { + s *Service + project string + deployment string + manifest string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets information about a specific manifest. +func (r *ManifestsService) Get(project string, deployment string, manifest string) *ManifestsGetCall { + c := &ManifestsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + c.manifest = manifest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManifestsGetCall) Fields(s ...googleapi.Field) *ManifestsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManifestsGetCall) IfNoneMatch(entityTag string) *ManifestsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManifestsGetCall) Context(ctx context.Context) *ManifestsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ManifestsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}/manifests/{manifest}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "deployment": c.deployment, + "manifest": c.manifest, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.manifests.get" call. +// Exactly one of *Manifest or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Manifest.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ManifestsGetCall) Do() (*Manifest, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Manifest{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets information about a specific manifest.", + // "httpMethod": "GET", + // "id": "deploymentmanager.manifests.get", + // "parameterOrder": [ + // "project", + // "deployment", + // "manifest" + // ], + // "parameters": { + // "deployment": { + // "description": "The name of the deployment for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "manifest": { + // "description": "The name of the manifest for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/deployments/{deployment}/manifests/{manifest}", + // "response": { + // "$ref": "Manifest" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "deploymentmanager.manifests.list": + +type ManifestsListCall struct { + s *Service + project string + deployment string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all manifests for a given deployment. +func (r *ManifestsService) List(project string, deployment string) *ManifestsListCall { + c := &ManifestsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *ManifestsListCall) Filter(filter string) *ManifestsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *ManifestsListCall) MaxResults(maxResults int64) *ManifestsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *ManifestsListCall) PageToken(pageToken string) *ManifestsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManifestsListCall) Fields(s ...googleapi.Field) *ManifestsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManifestsListCall) IfNoneMatch(entityTag string) *ManifestsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManifestsListCall) Context(ctx context.Context) *ManifestsListCall { + c.ctx_ = ctx + return c +} + +func (c *ManifestsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}/manifests") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "deployment": c.deployment, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.manifests.list" call. +// Exactly one of *ManifestsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ManifestsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManifestsListCall) Do() (*ManifestsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ManifestsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all manifests for a given deployment.", + // "httpMethod": "GET", + // "id": "deploymentmanager.manifests.list", + // "parameterOrder": [ + // "project", + // "deployment" + // ], + // "parameters": { + // "deployment": { + // "description": "The name of the deployment for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/deployments/{deployment}/manifests", + // "response": { + // "$ref": "ManifestsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "deploymentmanager.operations.get": + +type OperationsGetCall struct { + s *Service + project string + operation string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets information about a specific operation. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.operations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OperationsGetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets information about a specific operation.", + // "httpMethod": "GET", + // "id": "deploymentmanager.operations.get", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "The name of the operation for this request.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "deploymentmanager.operations.list": + +type OperationsListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all operations for a 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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *OperationsListCall) MaxResults(maxResults int64) *OperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.operations.list" call. +// Exactly one of *OperationsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *OperationsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OperationsListCall) Do() (*OperationsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperationsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all operations for a project.", + // "httpMethod": "GET", + // "id": "deploymentmanager.operations.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "OperationsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "deploymentmanager.resources.get": + +type ResourcesGetCall struct { + s *Service + project string + deployment string + resource string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets information about a single resource. +func (r *ResourcesService) Get(project string, deployment string, resource string) *ResourcesGetCall { + c := &ResourcesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + c.resource = resource + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ResourcesGetCall) Fields(s ...googleapi.Field) *ResourcesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ResourcesGetCall) IfNoneMatch(entityTag string) *ResourcesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ResourcesGetCall) Context(ctx context.Context) *ResourcesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ResourcesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}/resources/{resource}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "deployment": c.deployment, + "resource": c.resource, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.resources.get" call. +// Exactly one of *Resource or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Resource.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ResourcesGetCall) Do() (*Resource, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Resource{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets information about a single resource.", + // "httpMethod": "GET", + // "id": "deploymentmanager.resources.get", + // "parameterOrder": [ + // "project", + // "deployment", + // "resource" + // ], + // "parameters": { + // "deployment": { + // "description": "The name of the deployment for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "resource": { + // "description": "The name of the resource for this request.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/deployments/{deployment}/resources/{resource}", + // "response": { + // "$ref": "Resource" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "deploymentmanager.resources.list": + +type ResourcesListCall struct { + s *Service + project string + deployment string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all resources in a given deployment. +func (r *ResourcesService) List(project string, deployment string) *ResourcesListCall { + c := &ResourcesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *ResourcesListCall) Filter(filter string) *ResourcesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *ResourcesListCall) MaxResults(maxResults int64) *ResourcesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *ResourcesListCall) PageToken(pageToken string) *ResourcesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ResourcesListCall) Fields(s ...googleapi.Field) *ResourcesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ResourcesListCall) IfNoneMatch(entityTag string) *ResourcesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ResourcesListCall) Context(ctx context.Context) *ResourcesListCall { + c.ctx_ = ctx + return c +} + +func (c *ResourcesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}/resources") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "deployment": c.deployment, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.resources.list" call. +// Exactly one of *ResourcesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ResourcesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ResourcesListCall) Do() (*ResourcesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ResourcesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all resources in a given deployment.", + // "httpMethod": "GET", + // "id": "deploymentmanager.resources.list", + // "parameterOrder": [ + // "project", + // "deployment" + // ], + // "parameters": { + // "deployment": { + // "description": "The name of the deployment for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/deployments/{deployment}/resources", + // "response": { + // "$ref": "ResourcesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "deploymentmanager.types.list": + +type TypesListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all resource types for Deployment Manager. +func (r *TypesService) List(project string) *TypesListCall { + c := &TypesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *TypesListCall) Filter(filter string) *TypesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *TypesListCall) MaxResults(maxResults int64) *TypesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *TypesListCall) PageToken(pageToken string) *TypesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TypesListCall) Fields(s ...googleapi.Field) *TypesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TypesListCall) IfNoneMatch(entityTag string) *TypesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TypesListCall) Context(ctx context.Context) *TypesListCall { + c.ctx_ = ctx + return c +} + +func (c *TypesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/types") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.types.list" call. +// Exactly one of *TypesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TypesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TypesListCall) Do() (*TypesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TypesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all resource types for Deployment Manager.", + // "httpMethod": "GET", + // "id": "deploymentmanager.types.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/types", + // "response": { + // "$ref": "TypesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/deploymentmanager/v2beta1/deploymentmanager-api.json b/Godeps/_workspace/src/google.golang.org/api/deploymentmanager/v2beta1/deploymentmanager-api.json new file mode 100644 index 000000000..127d9fea6 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/deploymentmanager/v2beta1/deploymentmanager-api.json @@ -0,0 +1,883 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/u5FQM4I03EZTfBK_pxzZ11vNzAs\"", + "discoveryVersion": "v1", + "id": "deploymentmanager:v2beta1", + "name": "deploymentmanager", + "version": "v2beta1", + "revision": "20150831", + "title": "Google Cloud Deployment Manager API", + "description": "The Deployment Manager API allows users to declaratively configure, deploy and run complex solutions on the Google Cloud Platform.", + "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/deployment-manager/", + "labels": [ + "limited_availability" + ], + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/deploymentmanager/v2beta1/projects/", + "basePath": "/deploymentmanager/v2beta1/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "deploymentmanager/v2beta1/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/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/ndev.cloudman": { + "description": "View and manage your Google Cloud Platform management resources and deployment status information" + }, + "https://www.googleapis.com/auth/ndev.cloudman.readonly": { + "description": "View your Google Cloud Platform management resources and deployment status information" + } + } + } + }, + "schemas": { + "Deployment": { + "id": "Deployment", + "type": "object", + "description": "Next available tag: 8", + "properties": { + "description": { + "type": "string", + "description": "! An optional user-provided description of the deployment." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "manifest": { + "type": "string", + "description": "! [Output Only] URL of the manifest representing the full configuration ! of this deployment." + }, + "name": { + "type": "string", + "description": "! The name of the deployment, which must be unique within the project." + }, + "targetConfig": { + "type": "string", + "description": "! [Input Only] The YAML configuration to use in processing this deployment. ! ! When you create a deployment, the server creates a new manifest with the ! given YAML configuration and sets the `manifest` property to the URL of ! the manifest resource." + } + } + }, + "DeploymentsListResponse": { + "id": "DeploymentsListResponse", + "type": "object", + "description": "! A response containing a partial list of deployments and a page token used ! to build the next request if the request has been truncated. Next available tag: 4", + "properties": { + "deployments": { + "type": "array", + "description": "! The deployments contained in this response.", + "items": { + "$ref": "Deployment" + } + }, + "nextPageToken": { + "type": "string", + "description": "! A token used to continue a truncated list request." + } + } + }, + "Manifest": { + "id": "Manifest", + "type": "object", + "description": "Next available tag: 10", + "properties": { + "config": { + "type": "string", + "description": "v2beta1: YAML with config - described above v2beta2: YAML + templates. ! The YAML configuration for this manifest." + }, + "evaluatedConfig": { + "type": "string", + "description": "! [Output Only] The fully-expanded configuration file, including any ! templates and references." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "name": { + "type": "string", + "description": "! [Output Only] The name of the manifest." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Self link for the manifest." + } + } + }, + "ManifestsListResponse": { + "id": "ManifestsListResponse", + "type": "object", + "description": "! A response containing a partial list of manifests and a page token used ! to build the next request if the request has been truncated. Next available tag: 4", + "properties": { + "manifests": { + "type": "array", + "description": "! Manifests contained in this list response.", + "items": { + "$ref": "Manifest" + } + }, + "nextPageToken": { + "type": "string", + "description": "! A token used to continue a truncated list request." + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "description": "! An operation resource, used to manage asynchronous API requests. Next available tag: 24", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "! [Output Only] Creation timestamp in RFC3339 text format." + }, + "endTime": { + "type": "string", + "description": "! [Output Only] The time that this operation was completed. This is in ! RFC3339 format." + }, + "error": { + "type": "object", + "description": "! [Output Only] If errors occurred during processing of this operation, ! this field will be populated.", + "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": "! [Output Only] If operation fails, the HTTP error message returned, ! e.g. NOT FOUND." + }, + "httpErrorStatusCode": { + "type": "integer", + "description": "! [Output Only] If operation fails, the HTTP error status code returned, ! e.g. 404.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "! [Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "! [Output Only] The time that this operation was requested. ! This is in RFC 3339 format." + }, + "name": { + "type": "string", + "description": "! [Output Only] Name of the operation." + }, + "operationType": { + "type": "string", + "description": "! [Output Only] Type of the operation. Examples include \"insert\", or ! \"delete\"" + }, + "progress": { + "type": "integer", + "description": "! [Output Only] 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.", + "format": "int32" + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Self link for the manifest." + }, + "startTime": { + "type": "string", + "description": "! [Output Only] The time that this operation was started by the server. ! This is in RFC 3339 format." + }, + "status": { + "type": "string", + "description": "! [Output Only] Status of the operation. Can be one of the following: ! \"PENDING\", \"RUNNING\", or \"DONE\"." + }, + "statusMessage": { + "type": "string", + "description": "! [Output Only] An optional textual description of the current status of ! the operation." + }, + "targetId": { + "type": "string", + "description": "! [Output Only] Unique target id which identifies a particular ! incarnation of the target.", + "format": "uint64" + }, + "targetLink": { + "type": "string", + "description": "! [Output Only] URL of the resource the operation is mutating." + }, + "user": { + "type": "string", + "description": "! [Output Only] User who requested the operation, for example ! \"user@example.com\"" + }, + "warnings": { + "type": "array", + "description": "! [Output Only] If warning messages generated during processing of this ! operation, this field will be populated.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "any", + "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." + } + } + } + } + } + }, + "OperationsListResponse": { + "id": "OperationsListResponse", + "type": "object", + "description": "! A response containing a partial list of operations and a page token used ! to build the next request if the request has been truncated. Next available tag: 4", + "properties": { + "nextPageToken": { + "type": "string", + "description": "! A token used to continue a truncated list request." + }, + "operations": { + "type": "array", + "description": "! Operations contained in this list response.", + "items": { + "$ref": "Operation" + } + } + } + }, + "Resource": { + "id": "Resource", + "type": "object", + "description": "Next available tag: 12", + "properties": { + "errors": { + "type": "array", + "description": "! [Output Only] A list of any errors that occurred during deployment.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "intent": { + "type": "string", + "description": "! [Output Only] The intended state of the resource." + }, + "manifest": { + "type": "string", + "description": "! [Output Only] URL of the manifest representing the current configuration ! of this resource." + }, + "name": { + "type": "string", + "description": "! [Output Only] The name of the resource as it appears in the YAML config." + }, + "state": { + "type": "string", + "description": "! [Output Only] The state of the resource." + }, + "type": { + "type": "string", + "description": "! [Output Only] The type of the resource, for example ! ?compute.v1.instance?, or ?replicaPools.v1beta2.instanceGroupManager?" + }, + "url": { + "type": "string", + "description": "! [Output Only] The URL of the actual resource." + } + } + }, + "ResourcesListResponse": { + "id": "ResourcesListResponse", + "type": "object", + "description": "! A response containing a partial list of resources and a page token used ! to build the next request if the request has been truncated. Next available tag: 4", + "properties": { + "nextPageToken": { + "type": "string", + "description": "! A token used to continue a truncated list request." + }, + "resources": { + "type": "array", + "description": "! Resources contained in this list response.", + "items": { + "$ref": "Resource" + } + } + } + }, + "Type": { + "id": "Type", + "type": "object", + "description": "! A type supported by Deployment Manager. Next available tag: 4", + "properties": { + "name": { + "type": "string", + "description": "! Name of the type." + } + } + }, + "TypesListResponse": { + "id": "TypesListResponse", + "type": "object", + "description": "! A response that returns all Types supported by Deployment Manager Next available tag: 3", + "properties": { + "types": { + "type": "array", + "description": "! Types supported by Deployment Manager", + "items": { + "$ref": "Type" + } + } + } + } + }, + "resources": { + "deployments": { + "methods": { + "delete": { + "id": "deploymentmanager.deployments.delete", + "path": "{project}/global/deployments/{deployment}", + "httpMethod": "DELETE", + "description": "! Deletes a deployment and all of the resources in the deployment.", + "parameters": { + "deployment": { + "type": "string", + "description": "! The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "! The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "deployment" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "get": { + "id": "deploymentmanager.deployments.get", + "path": "{project}/global/deployments/{deployment}", + "httpMethod": "GET", + "description": "! Gets information about a specific deployment.", + "parameters": { + "deployment": { + "type": "string", + "description": "! The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "! The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "deployment" + ], + "response": { + "$ref": "Deployment" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "insert": { + "id": "deploymentmanager.deployments.insert", + "path": "{project}/global/deployments", + "httpMethod": "POST", + "description": "! Creates a deployment and all of the resources described by the ! deployment manifest.", + "parameters": { + "project": { + "type": "string", + "description": "! The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "Deployment" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "list": { + "id": "deploymentmanager.deployments.list", + "path": "{project}/global/deployments", + "httpMethod": "GET", + "description": "! Lists all deployments for a given project.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "! Maximum count of results to be returned. ! Acceptable values are 0 to 100, inclusive. (Default: 50)", + "default": "50", + "format": "int32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "! Specifies a nextPageToken returned by a previous list request. This ! token can be used to request the next page of results from a previous ! list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "! The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "DeploymentsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + } + } + }, + "manifests": { + "methods": { + "get": { + "id": "deploymentmanager.manifests.get", + "path": "{project}/global/deployments/{deployment}/manifests/{manifest}", + "httpMethod": "GET", + "description": "! Gets information about a specific manifest.", + "parameters": { + "deployment": { + "type": "string", + "description": "! The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "manifest": { + "type": "string", + "description": "! The name of the manifest for this request.", + "required": true, + "pattern": "[-a-z0-9]{1,61}", + "location": "path" + }, + "project": { + "type": "string", + "description": "! The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "deployment", + "manifest" + ], + "response": { + "$ref": "Manifest" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "list": { + "id": "deploymentmanager.manifests.list", + "path": "{project}/global/deployments/{deployment}/manifests", + "httpMethod": "GET", + "description": "! Lists all manifests for a given deployment.", + "parameters": { + "deployment": { + "type": "string", + "description": "! The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "! Maximum count of results to be returned. ! Acceptable values are 0 to 100, inclusive. (Default: 50)", + "default": "50", + "format": "int32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "! Specifies a nextPageToken returned by a previous list request. This ! token can be used to request the next page of results from a previous ! list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "! The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "deployment" + ], + "response": { + "$ref": "ManifestsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + } + } + }, + "operations": { + "methods": { + "get": { + "id": "deploymentmanager.operations.get", + "path": "{project}/global/operations/{operation}", + "httpMethod": "GET", + "description": "! Gets information about a specific Operation.", + "parameters": { + "operation": { + "type": "string", + "description": "! The name of the operation for this request.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "! The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "list": { + "id": "deploymentmanager.operations.list", + "path": "{project}/global/operations", + "httpMethod": "GET", + "description": "! Lists all Operations for a project.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "! Maximum count of results to be returned. ! Acceptable values are 0 to 100, inclusive. (Default: 50)", + "default": "50", + "format": "int32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "! Specifies a nextPageToken returned by a previous list request. This ! token can be used to request the next page of results from a previous ! list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "! The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "OperationsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + } + } + }, + "resources": { + "methods": { + "get": { + "id": "deploymentmanager.resources.get", + "path": "{project}/global/deployments/{deployment}/resources/{resource}", + "httpMethod": "GET", + "description": "! Gets information about a single resource.", + "parameters": { + "deployment": { + "type": "string", + "description": "! The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "! The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "! The name of the resource for this request.", + "required": true, + "pattern": "[-a-z0-9]{1,61}", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "deployment", + "resource" + ], + "response": { + "$ref": "Resource" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "list": { + "id": "deploymentmanager.resources.list", + "path": "{project}/global/deployments/{deployment}/resources", + "httpMethod": "GET", + "description": "! Lists all resources in a given deployment.", + "parameters": { + "deployment": { + "type": "string", + "description": "! The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "! Maximum count of results to be returned. ! Acceptable values are 0 to 100, inclusive. (Default: 50)", + "default": "50", + "format": "int32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "! Specifies a nextPageToken returned by a previous list request. This ! token can be used to request the next page of results from a previous ! list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "! The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "deployment" + ], + "response": { + "$ref": "ResourcesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + } + } + }, + "types": { + "methods": { + "list": { + "id": "deploymentmanager.types.list", + "path": "{project}/global/types", + "httpMethod": "GET", + "description": "! Lists all Types for Deployment Manager.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "! Maximum count of results to be returned. ! Acceptable values are 0 to 100, inclusive. (Default: 50)", + "default": "50", + "format": "int32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "! Specifies a nextPageToken returned by a previous list request. This ! token can be used to request the next page of results from a previous ! list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "! The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "TypesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/deploymentmanager/v2beta1/deploymentmanager-gen.go b/Godeps/_workspace/src/google.golang.org/api/deploymentmanager/v2beta1/deploymentmanager-gen.go new file mode 100644 index 000000000..6437a7cee --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/deploymentmanager/v2beta1/deploymentmanager-gen.go @@ -0,0 +1,2323 @@ +// Package deploymentmanager provides access to the Google Cloud Deployment Manager API. +// +// See https://developers.google.com/deployment-manager/ +// +// Usage example: +// +// import "google.golang.org/api/deploymentmanager/v2beta1" +// ... +// deploymentmanagerService, err := deploymentmanager.New(oauthHttpClient) +package deploymentmanager // import "google.golang.org/api/deploymentmanager/v2beta1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "deploymentmanager:v2beta1" +const apiName = "deploymentmanager" +const apiVersion = "v2beta1" +const basePath = "https://www.googleapis.com/deploymentmanager/v2beta1/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 data across Google Cloud Platform services + CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" + + // View and manage your Google Cloud Platform management resources and + // deployment status information + NdevCloudmanScope = "https://www.googleapis.com/auth/ndev.cloudman" + + // View your Google Cloud Platform management resources and deployment + // status information + NdevCloudmanReadonlyScope = "https://www.googleapis.com/auth/ndev.cloudman.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.Deployments = NewDeploymentsService(s) + s.Manifests = NewManifestsService(s) + s.Operations = NewOperationsService(s) + s.Resources = NewResourcesService(s) + s.Types = NewTypesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Deployments *DeploymentsService + + Manifests *ManifestsService + + Operations *OperationsService + + Resources *ResourcesService + + Types *TypesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewDeploymentsService(s *Service) *DeploymentsService { + rs := &DeploymentsService{s: s} + return rs +} + +type DeploymentsService struct { + s *Service +} + +func NewManifestsService(s *Service) *ManifestsService { + rs := &ManifestsService{s: s} + return rs +} + +type ManifestsService struct { + s *Service +} + +func NewOperationsService(s *Service) *OperationsService { + rs := &OperationsService{s: s} + return rs +} + +type OperationsService struct { + s *Service +} + +func NewResourcesService(s *Service) *ResourcesService { + rs := &ResourcesService{s: s} + return rs +} + +type ResourcesService struct { + s *Service +} + +func NewTypesService(s *Service) *TypesService { + rs := &TypesService{s: s} + return rs +} + +type TypesService struct { + s *Service +} + +// Deployment: Next available tag: 8 +type Deployment struct { + // Description: ! An optional user-provided description of the + // deployment. + Description string `json:"description,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Manifest: ! [Output Only] URL of the manifest representing the full + // configuration ! of this deployment. + Manifest string `json:"manifest,omitempty"` + + // Name: ! The name of the deployment, which must be unique within the + // project. + Name string `json:"name,omitempty"` + + // TargetConfig: ! [Input Only] The YAML configuration to use in + // processing this deployment. ! ! When you create a deployment, the + // server creates a new manifest with the ! given YAML configuration and + // sets the `manifest` property to the URL of ! the manifest resource. + TargetConfig string `json:"targetConfig,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Deployment) MarshalJSON() ([]byte, error) { + type noMethod Deployment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DeploymentsListResponse: ! A response containing a partial list of +// deployments and a page token used ! to build the next request if the +// request has been truncated. Next available tag: 4 +type DeploymentsListResponse struct { + // Deployments: ! The deployments contained in this response. + Deployments []*Deployment `json:"deployments,omitempty"` + + // NextPageToken: ! A token used to continue a truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Deployments") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeploymentsListResponse) MarshalJSON() ([]byte, error) { + type noMethod DeploymentsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Manifest: Next available tag: 10 +type Manifest struct { + // Config: v2beta1: YAML with config - described above v2beta2: YAML + + // templates. ! The YAML configuration for this manifest. + Config string `json:"config,omitempty"` + + // EvaluatedConfig: ! [Output Only] The fully-expanded configuration + // file, including any ! templates and references. + EvaluatedConfig string `json:"evaluatedConfig,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Name: ! [Output Only] The name of the manifest. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] Self link for the manifest. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Config") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Manifest) MarshalJSON() ([]byte, error) { + type noMethod Manifest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ManifestsListResponse: ! A response containing a partial list of +// manifests and a page token used ! to build the next request if the +// request has been truncated. Next available tag: 4 +type ManifestsListResponse struct { + // Manifests: ! Manifests contained in this list response. + Manifests []*Manifest `json:"manifests,omitempty"` + + // NextPageToken: ! A token used to continue a truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Manifests") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ManifestsListResponse) MarshalJSON() ([]byte, error) { + type noMethod ManifestsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Operation: ! An operation resource, used to manage asynchronous API +// requests. Next available tag: 24 +type Operation struct { + // CreationTimestamp: ! [Output Only] Creation timestamp in RFC3339 text + // format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // EndTime: ! [Output Only] The time that this operation was completed. + // This is in ! RFC3339 format. + EndTime string `json:"endTime,omitempty"` + + // Error: ! [Output Only] If errors occurred during processing of this + // operation, ! this field will be populated. + Error *OperationError `json:"error,omitempty"` + + // HttpErrorMessage: ! [Output Only] If operation fails, the HTTP error + // message returned, ! e.g. NOT FOUND. + HttpErrorMessage string `json:"httpErrorMessage,omitempty"` + + // HttpErrorStatusCode: ! [Output Only] If operation fails, the HTTP + // error status code returned, ! e.g. 404. + HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"` + + // Id: ! [Output Only] Unique identifier for the resource; defined by + // the server. + Id uint64 `json:"id,omitempty,string"` + + // InsertTime: ! [Output Only] The time that this operation was + // requested. ! This is in RFC 3339 format. + InsertTime string `json:"insertTime,omitempty"` + + // Name: ! [Output Only] Name of the operation. + Name string `json:"name,omitempty"` + + // OperationType: ! [Output Only] Type of the operation. Examples + // include "insert", or ! "delete" + OperationType string `json:"operationType,omitempty"` + + // Progress: ! [Output Only] 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. + Progress int64 `json:"progress,omitempty"` + + // SelfLink: [Output Only] Self link for the manifest. + SelfLink string `json:"selfLink,omitempty"` + + // StartTime: ! [Output Only] The time that this operation was started + // by the server. ! This is in RFC 3339 format. + StartTime string `json:"startTime,omitempty"` + + // Status: ! [Output Only] Status of the operation. Can be one of the + // following: ! "PENDING", "RUNNING", or "DONE". + Status string `json:"status,omitempty"` + + // StatusMessage: ! [Output Only] An optional textual description of the + // current status of ! the operation. + StatusMessage string `json:"statusMessage,omitempty"` + + // TargetId: ! [Output Only] Unique target id which identifies a + // particular ! incarnation of the target. + TargetId uint64 `json:"targetId,omitempty,string"` + + // TargetLink: ! [Output Only] URL of the resource the operation is + // mutating. + TargetLink string `json:"targetLink,omitempty"` + + // User: ! [Output Only] User who requested the operation, for example ! + // "user@example.com" + User string `json:"user,omitempty"` + + // Warnings: ! [Output Only] If warning messages generated during + // processing of this ! operation, this field will be populated. + Warnings []*OperationWarnings `json:"warnings,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Operation) MarshalJSON() ([]byte, error) { + type noMethod Operation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationError: ! [Output Only] If errors occurred during processing +// of this operation, ! this field will be populated. +type OperationError struct { + // Errors: ! The array of errors encountered while processing this + // operation. + Errors []*OperationErrorErrors `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationError) MarshalJSON() ([]byte, error) { + type noMethod OperationError + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) { + type noMethod OperationErrorErrors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationWarnings struct { + // Code: ! The warning type identifier for this warning. + Code interface{} `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"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationWarnings) MarshalJSON() ([]byte, error) { + type noMethod OperationWarnings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationWarningsData) MarshalJSON() ([]byte, error) { + type noMethod OperationWarningsData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationsListResponse: ! A response containing a partial list of +// operations and a page token used ! to build the next request if the +// request has been truncated. Next available tag: 4 +type OperationsListResponse struct { + // NextPageToken: ! A token used to continue a truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Operations: ! Operations contained in this list response. + Operations []*Operation `json:"operations,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationsListResponse) MarshalJSON() ([]byte, error) { + type noMethod OperationsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Resource: Next available tag: 12 +type Resource struct { + // Errors: ! [Output Only] A list of any errors that occurred during + // deployment. + Errors []string `json:"errors,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Intent: ! [Output Only] The intended state of the resource. + Intent string `json:"intent,omitempty"` + + // Manifest: ! [Output Only] URL of the manifest representing the + // current configuration ! of this resource. + Manifest string `json:"manifest,omitempty"` + + // Name: ! [Output Only] The name of the resource as it appears in the + // YAML config. + Name string `json:"name,omitempty"` + + // State: ! [Output Only] The state of the resource. + State string `json:"state,omitempty"` + + // Type: ! [Output Only] The type of the resource, for example ! + // ?compute.v1.instance?, or ?replicaPools.v1beta2.instanceGroupManager? + Type string `json:"type,omitempty"` + + // Url: ! [Output Only] The URL of the actual resource. + Url string `json:"url,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Resource) MarshalJSON() ([]byte, error) { + type noMethod Resource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ResourcesListResponse: ! A response containing a partial list of +// resources and a page token used ! to build the next request if the +// request has been truncated. Next available tag: 4 +type ResourcesListResponse struct { + // NextPageToken: ! A token used to continue a truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Resources: ! Resources contained in this list response. + Resources []*Resource `json:"resources,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResourcesListResponse) MarshalJSON() ([]byte, error) { + type noMethod ResourcesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Type: ! A type supported by Deployment Manager. Next available tag: 4 +type Type struct { + // Name: ! Name of the type. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Type) MarshalJSON() ([]byte, error) { + type noMethod Type + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TypesListResponse: ! A response that returns all Types supported by +// Deployment Manager Next available tag: 3 +type TypesListResponse struct { + // Types: ! Types supported by Deployment Manager + Types []*Type `json:"types,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Types") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TypesListResponse) MarshalJSON() ([]byte, error) { + type noMethod TypesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "deploymentmanager.deployments.delete": + +type DeploymentsDeleteCall struct { + s *Service + project string + deployment string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: ! Deletes a deployment and all of the resources in the +// deployment. +func (r *DeploymentsService) Delete(project string, deployment string) *DeploymentsDeleteCall { + c := &DeploymentsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DeploymentsDeleteCall) Fields(s ...googleapi.Field) *DeploymentsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DeploymentsDeleteCall) Context(ctx context.Context) *DeploymentsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *DeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "deployment": c.deployment, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.deployments.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DeploymentsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "! Deletes a deployment and all of the resources in the deployment.", + // "httpMethod": "DELETE", + // "id": "deploymentmanager.deployments.delete", + // "parameterOrder": [ + // "project", + // "deployment" + // ], + // "parameters": { + // "deployment": { + // "description": "! The name of the deployment for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "! The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/deployments/{deployment}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.cloudman" + // ] + // } + +} + +// method id "deploymentmanager.deployments.get": + +type DeploymentsGetCall struct { + s *Service + project string + deployment string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: ! Gets information about a specific deployment. +func (r *DeploymentsService) Get(project string, deployment string) *DeploymentsGetCall { + c := &DeploymentsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DeploymentsGetCall) Fields(s ...googleapi.Field) *DeploymentsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DeploymentsGetCall) IfNoneMatch(entityTag string) *DeploymentsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DeploymentsGetCall) Context(ctx context.Context) *DeploymentsGetCall { + c.ctx_ = ctx + return c +} + +func (c *DeploymentsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "deployment": c.deployment, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.deployments.get" call. +// Exactly one of *Deployment or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Deployment.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DeploymentsGetCall) Do() (*Deployment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Deployment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "! Gets information about a specific deployment.", + // "httpMethod": "GET", + // "id": "deploymentmanager.deployments.get", + // "parameterOrder": [ + // "project", + // "deployment" + // ], + // "parameters": { + // "deployment": { + // "description": "! The name of the deployment for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "! The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/deployments/{deployment}", + // "response": { + // "$ref": "Deployment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "deploymentmanager.deployments.insert": + +type DeploymentsInsertCall struct { + s *Service + project string + deployment *Deployment + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: ! Creates a deployment and all of the resources described by +// the ! deployment manifest. +func (r *DeploymentsService) Insert(project string, deployment *Deployment) *DeploymentsInsertCall { + c := &DeploymentsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DeploymentsInsertCall) Fields(s ...googleapi.Field) *DeploymentsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DeploymentsInsertCall) Context(ctx context.Context) *DeploymentsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *DeploymentsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.deployments.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DeploymentsInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "! Creates a deployment and all of the resources described by the ! deployment manifest.", + // "httpMethod": "POST", + // "id": "deploymentmanager.deployments.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "! The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/deployments", + // "request": { + // "$ref": "Deployment" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.cloudman" + // ] + // } + +} + +// method id "deploymentmanager.deployments.list": + +type DeploymentsListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: ! Lists all deployments for a given project. +func (r *DeploymentsService) List(project string) *DeploymentsListCall { + c := &DeploymentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// MaxResults sets the optional parameter "maxResults": ! Maximum count +// of results to be returned. ! Acceptable values are 0 to 100, +// inclusive. (Default: 50) +func (c *DeploymentsListCall) MaxResults(maxResults int64) *DeploymentsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": ! Specifies a +// nextPageToken returned by a previous list request. This ! token can +// be used to request the next page of results from a previous ! list +// request. +func (c *DeploymentsListCall) PageToken(pageToken string) *DeploymentsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DeploymentsListCall) Fields(s ...googleapi.Field) *DeploymentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DeploymentsListCall) IfNoneMatch(entityTag string) *DeploymentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DeploymentsListCall) Context(ctx context.Context) *DeploymentsListCall { + c.ctx_ = ctx + return c +} + +func (c *DeploymentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.deployments.list" call. +// Exactly one of *DeploymentsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DeploymentsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DeploymentsListCall) Do() (*DeploymentsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DeploymentsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "! Lists all deployments for a given project.", + // "httpMethod": "GET", + // "id": "deploymentmanager.deployments.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "maxResults": { + // "default": "50", + // "description": "! Maximum count of results to be returned. ! Acceptable values are 0 to 100, inclusive. (Default: 50)", + // "format": "int32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "! Specifies a nextPageToken returned by a previous list request. This ! token can be used to request the next page of results from a previous ! list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "! The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/deployments", + // "response": { + // "$ref": "DeploymentsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "deploymentmanager.manifests.get": + +type ManifestsGetCall struct { + s *Service + project string + deployment string + manifest string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: ! Gets information about a specific manifest. +func (r *ManifestsService) Get(project string, deployment string, manifest string) *ManifestsGetCall { + c := &ManifestsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + c.manifest = manifest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManifestsGetCall) Fields(s ...googleapi.Field) *ManifestsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManifestsGetCall) IfNoneMatch(entityTag string) *ManifestsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManifestsGetCall) Context(ctx context.Context) *ManifestsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ManifestsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}/manifests/{manifest}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "deployment": c.deployment, + "manifest": c.manifest, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.manifests.get" call. +// Exactly one of *Manifest or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Manifest.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ManifestsGetCall) Do() (*Manifest, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Manifest{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "! Gets information about a specific manifest.", + // "httpMethod": "GET", + // "id": "deploymentmanager.manifests.get", + // "parameterOrder": [ + // "project", + // "deployment", + // "manifest" + // ], + // "parameters": { + // "deployment": { + // "description": "! The name of the deployment for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "manifest": { + // "description": "! The name of the manifest for this request.", + // "location": "path", + // "pattern": "[-a-z0-9]{1,61}", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "! The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/deployments/{deployment}/manifests/{manifest}", + // "response": { + // "$ref": "Manifest" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "deploymentmanager.manifests.list": + +type ManifestsListCall struct { + s *Service + project string + deployment string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: ! Lists all manifests for a given deployment. +func (r *ManifestsService) List(project string, deployment string) *ManifestsListCall { + c := &ManifestsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + return c +} + +// MaxResults sets the optional parameter "maxResults": ! Maximum count +// of results to be returned. ! Acceptable values are 0 to 100, +// inclusive. (Default: 50) +func (c *ManifestsListCall) MaxResults(maxResults int64) *ManifestsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": ! Specifies a +// nextPageToken returned by a previous list request. This ! token can +// be used to request the next page of results from a previous ! list +// request. +func (c *ManifestsListCall) PageToken(pageToken string) *ManifestsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManifestsListCall) Fields(s ...googleapi.Field) *ManifestsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManifestsListCall) IfNoneMatch(entityTag string) *ManifestsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManifestsListCall) Context(ctx context.Context) *ManifestsListCall { + c.ctx_ = ctx + return c +} + +func (c *ManifestsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}/manifests") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "deployment": c.deployment, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.manifests.list" call. +// Exactly one of *ManifestsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ManifestsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManifestsListCall) Do() (*ManifestsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ManifestsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "! Lists all manifests for a given deployment.", + // "httpMethod": "GET", + // "id": "deploymentmanager.manifests.list", + // "parameterOrder": [ + // "project", + // "deployment" + // ], + // "parameters": { + // "deployment": { + // "description": "! The name of the deployment for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "50", + // "description": "! Maximum count of results to be returned. ! Acceptable values are 0 to 100, inclusive. (Default: 50)", + // "format": "int32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "! Specifies a nextPageToken returned by a previous list request. This ! token can be used to request the next page of results from a previous ! list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "! The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/deployments/{deployment}/manifests", + // "response": { + // "$ref": "ManifestsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "deploymentmanager.operations.get": + +type OperationsGetCall struct { + s *Service + project string + operation string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: ! Gets information about a specific Operation. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.operations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OperationsGetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "! Gets information about a specific Operation.", + // "httpMethod": "GET", + // "id": "deploymentmanager.operations.get", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "! The name of the operation for this request.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "! The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "deploymentmanager.operations.list": + +type OperationsListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: ! Lists all Operations for a project. +func (r *OperationsService) List(project string) *OperationsListCall { + c := &OperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// MaxResults sets the optional parameter "maxResults": ! Maximum count +// of results to be returned. ! Acceptable values are 0 to 100, +// inclusive. (Default: 50) +func (c *OperationsListCall) MaxResults(maxResults int64) *OperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": ! Specifies a +// nextPageToken returned by a previous list request. This ! token can +// be used to request the next page of results from a previous ! list +// request. +func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.operations.list" call. +// Exactly one of *OperationsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *OperationsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OperationsListCall) Do() (*OperationsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperationsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "! Lists all Operations for a project.", + // "httpMethod": "GET", + // "id": "deploymentmanager.operations.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "maxResults": { + // "default": "50", + // "description": "! Maximum count of results to be returned. ! Acceptable values are 0 to 100, inclusive. (Default: 50)", + // "format": "int32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "! Specifies a nextPageToken returned by a previous list request. This ! token can be used to request the next page of results from a previous ! list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "! The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "OperationsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "deploymentmanager.resources.get": + +type ResourcesGetCall struct { + s *Service + project string + deployment string + resource string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: ! Gets information about a single resource. +func (r *ResourcesService) Get(project string, deployment string, resource string) *ResourcesGetCall { + c := &ResourcesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + c.resource = resource + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ResourcesGetCall) Fields(s ...googleapi.Field) *ResourcesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ResourcesGetCall) IfNoneMatch(entityTag string) *ResourcesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ResourcesGetCall) Context(ctx context.Context) *ResourcesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ResourcesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}/resources/{resource}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "deployment": c.deployment, + "resource": c.resource, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.resources.get" call. +// Exactly one of *Resource or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Resource.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ResourcesGetCall) Do() (*Resource, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Resource{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "! Gets information about a single resource.", + // "httpMethod": "GET", + // "id": "deploymentmanager.resources.get", + // "parameterOrder": [ + // "project", + // "deployment", + // "resource" + // ], + // "parameters": { + // "deployment": { + // "description": "! The name of the deployment for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "! The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "resource": { + // "description": "! The name of the resource for this request.", + // "location": "path", + // "pattern": "[-a-z0-9]{1,61}", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/deployments/{deployment}/resources/{resource}", + // "response": { + // "$ref": "Resource" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "deploymentmanager.resources.list": + +type ResourcesListCall struct { + s *Service + project string + deployment string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: ! Lists all resources in a given deployment. +func (r *ResourcesService) List(project string, deployment string) *ResourcesListCall { + c := &ResourcesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + return c +} + +// MaxResults sets the optional parameter "maxResults": ! Maximum count +// of results to be returned. ! Acceptable values are 0 to 100, +// inclusive. (Default: 50) +func (c *ResourcesListCall) MaxResults(maxResults int64) *ResourcesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": ! Specifies a +// nextPageToken returned by a previous list request. This ! token can +// be used to request the next page of results from a previous ! list +// request. +func (c *ResourcesListCall) PageToken(pageToken string) *ResourcesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ResourcesListCall) Fields(s ...googleapi.Field) *ResourcesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ResourcesListCall) IfNoneMatch(entityTag string) *ResourcesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ResourcesListCall) Context(ctx context.Context) *ResourcesListCall { + c.ctx_ = ctx + return c +} + +func (c *ResourcesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}/resources") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "deployment": c.deployment, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.resources.list" call. +// Exactly one of *ResourcesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ResourcesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ResourcesListCall) Do() (*ResourcesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ResourcesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "! Lists all resources in a given deployment.", + // "httpMethod": "GET", + // "id": "deploymentmanager.resources.list", + // "parameterOrder": [ + // "project", + // "deployment" + // ], + // "parameters": { + // "deployment": { + // "description": "! The name of the deployment for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "50", + // "description": "! Maximum count of results to be returned. ! Acceptable values are 0 to 100, inclusive. (Default: 50)", + // "format": "int32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "! Specifies a nextPageToken returned by a previous list request. This ! token can be used to request the next page of results from a previous ! list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "! The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/deployments/{deployment}/resources", + // "response": { + // "$ref": "ResourcesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "deploymentmanager.types.list": + +type TypesListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: ! Lists all Types for Deployment Manager. +func (r *TypesService) List(project string) *TypesListCall { + c := &TypesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// MaxResults sets the optional parameter "maxResults": ! Maximum count +// of results to be returned. ! Acceptable values are 0 to 100, +// inclusive. (Default: 50) +func (c *TypesListCall) MaxResults(maxResults int64) *TypesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": ! Specifies a +// nextPageToken returned by a previous list request. This ! token can +// be used to request the next page of results from a previous ! list +// request. +func (c *TypesListCall) PageToken(pageToken string) *TypesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TypesListCall) Fields(s ...googleapi.Field) *TypesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TypesListCall) IfNoneMatch(entityTag string) *TypesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TypesListCall) Context(ctx context.Context) *TypesListCall { + c.ctx_ = ctx + return c +} + +func (c *TypesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/types") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.types.list" call. +// Exactly one of *TypesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TypesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TypesListCall) Do() (*TypesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TypesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "! Lists all Types for Deployment Manager.", + // "httpMethod": "GET", + // "id": "deploymentmanager.types.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "maxResults": { + // "default": "50", + // "description": "! Maximum count of results to be returned. ! Acceptable values are 0 to 100, inclusive. (Default: 50)", + // "format": "int32", + // "location": "query", + // "maximum": "100", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "! Specifies a nextPageToken returned by a previous list request. This ! token can be used to request the next page of results from a previous ! list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "! The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/types", + // "response": { + // "$ref": "TypesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/deploymentmanager/v2beta2/deploymentmanager-api.json b/Godeps/_workspace/src/google.golang.org/api/deploymentmanager/v2beta2/deploymentmanager-api.json new file mode 100644 index 000000000..217245194 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/deploymentmanager/v2beta2/deploymentmanager-api.json @@ -0,0 +1,1225 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/L3qYQaCmypSCqWoWq866HN97aNc\"", + "discoveryVersion": "v1", + "id": "deploymentmanager:v2beta2", + "name": "deploymentmanager", + "canonicalName": "Deployment Manager", + "version": "v2beta2", + "revision": "20150831", + "title": "Google Cloud Deployment Manager API", + "description": "The Deployment Manager API allows users to declaratively configure, deploy and run complex solutions on the Google Cloud Platform.", + "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/deployment-manager/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/deploymentmanager/v2beta2/projects/", + "basePath": "/deploymentmanager/v2beta2/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "deploymentmanager/v2beta2/projects/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json" + ], + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.", + "location": "query" + }, + "userIp": { + "type": "string", + "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.", + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/ndev.cloudman": { + "description": "View and manage your Google Cloud Platform management resources and deployment status information" + }, + "https://www.googleapis.com/auth/ndev.cloudman.readonly": { + "description": "View your Google Cloud Platform management resources and deployment status information" + } + } + } + }, + "schemas": { + "Deployment": { + "id": "Deployment", + "type": "object", + "description": "", + "properties": { + "description": { + "type": "string", + "description": "An optional user-provided description of the deployment." + }, + "fingerprint": { + "type": "string", + "description": "Specifies a fingerprint for update() requests. A fingerprint is a randomly generated value that must be provided in update() requests to perform optimistic locking. This ensures optimistic concurrency so that only one update can be performed at a time. The fingerprint is initially generated by Deployment Manager and changes after every request to modify data. To get the latest fingerprint value, perform a get() request to a deployment.", + "format": "byte" + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "[Output Only] Timestamp when the deployment was created, in RFC3339 text format ." + }, + "intent": { + "type": "string", + "description": "[Input Only] Specifies how Deployment Manager should apply this template. Possible options are PREVIEW, UPDATE, and CANCEL.\n\nPREVIEW creates a deployment and creates \"shell\" resources but does not actually instantiate these resources. This allows you to preview what your deployment looks like. You can use this intent to preview updates to deployments or preview new deployments. You must provide a target.config with a configuration for this intent. After previewing a deployment, you can deploy your resources by making a request with the UPDATE intent or you can CANCEL the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it.\n\nUPDATE performs an update to the underlying resources in a deployment. If you provide a populated target.config field with this request, Deployment Manager uses that configuration to perform an update. If you had previewed this update beforehand, and do not supply a target.config or provide an empty target.config, Deployment Manager uses the last previewed configuration.\n\nCANCEL cancels an update that is in PREVIEW or UPDATE but does not undo any changes already made." + }, + "manifest": { + "type": "string", + "description": "[Output Only] URL of the manifest representing the last manifest that was successfully deployed." + }, + "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. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash." + }, + "state": { + "type": "string", + "description": "[Output Only] The current state of the deployment. This can be DEPLOYED, DEPLOYMENT_FAILED, PREVIEWING, UPDATING, and CANCELING." + }, + "target": { + "$ref": "TargetConfiguration", + "description": "[Input Only] The parameters that define your deployment, including the deployment configuration and relevant templates." + }, + "update": { + "$ref": "DeploymentUpdate", + "description": "[Output Only] If Deployment Manager is currently updating or previewing an update to this deployment, the updated configuration appears here." + }, + "updateTime": { + "type": "string", + "description": "[Output Only] Timestamp when the deployment was updated, in RFC3339 text format ." + } + } + }, + "DeploymentUpdate": { + "id": "DeploymentUpdate", + "type": "object", + "description": "", + "properties": { + "errors": { + "type": "array", + "description": "[Output Only] List of all errors encountered while trying to enact the update.", + "items": { + "type": "string" + } + }, + "manifest": { + "type": "string", + "description": "[Output Only] URL of the manifest representing the update configuration of this deployment." + } + } + }, + "DeploymentsListResponse": { + "id": "DeploymentsListResponse", + "type": "object", + "description": "A response containing a partial list of deployments and a page token used to build the next request if the request has been truncated.", + "properties": { + "deployments": { + "type": "array", + "description": "[Output Only] The deployments contained in this response.", + "items": { + "$ref": "Deployment" + } + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + } + } + }, + "ImportFile": { + "id": "ImportFile", + "type": "object", + "description": "", + "properties": { + "content": { + "type": "string", + "description": "The contents of the file." + }, + "name": { + "type": "string", + "description": "The name of the file." + } + } + }, + "Manifest": { + "id": "Manifest", + "type": "object", + "description": "", + "properties": { + "config": { + "type": "string", + "description": "[Output Only] The YAML configuration for this manifest." + }, + "evaluatedConfig": { + "type": "string", + "description": "[Output Only] The fully-expanded configuration file, including any templates and references." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "imports": { + "type": "array", + "description": "[Output Only] The imported files for this manifest.", + "items": { + "$ref": "ImportFile" + } + }, + "insertTime": { + "type": "string", + "description": "[Output Only] Timestamp when the manifest was created, in RFC3339 text format." + }, + "layout": { + "type": "string", + "description": "[Output Only] The YAML layout for this manifest." + }, + "name": { + "type": "string", + "description": "[Output Only] The name of the manifest." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Self link for the manifest." + } + } + }, + "ManifestsListResponse": { + "id": "ManifestsListResponse", + "type": "object", + "description": "A response containing a partial list of manifests and a page token used to build the next request if the request has been truncated.", + "properties": { + "manifests": { + "type": "array", + "description": "[Output Only] Manifests contained in this list response.", + "items": { + "$ref": "Manifest" + } + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "description": "An Operation resource, used to manage asynchronous API requests.", + "properties": { + "clientOperationId": { + "type": "string", + "description": "[Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all Operation resources in the project." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "endTime": { + "type": "string", + "description": "[Output Only] The time that this operation was completed. This is in RFC3339 text format." + }, + "error": { + "type": "object", + "description": "[Output Only] If errors are generated during processing of the operation, this field will be populated.", + "properties": { + "errors": { + "type": "array", + "description": "[Output Only] The array of errors encountered while processing this operation.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The error type identifier for this error." + }, + "location": { + "type": "string", + "description": "[Output Only] Indicates the field in the request which caused the error. This property is optional." + }, + "message": { + "type": "string", + "description": "[Output Only] An optional, human-readable error message." + } + } + } + } + } + }, + "httpErrorMessage": { + "type": "string", + "description": "[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND." + }, + "httpErrorStatusCode": { + "type": "integer", + "description": "[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as 404.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "[Output Only] The time that this operation was requested. This is in RFC3339 text format." + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#Operation for Operation resources.", + "default": "deploymentmanager#operation" + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource." + }, + "operationType": { + "type": "string", + "description": "[Output Only] Type of the operation, such as insert, update, and delete." + }, + "progress": { + "type": "integer", + "description": "[Output Only] 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 monotonically increase as the operation progresses.", + "format": "int32" + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where the operation resides. Only applicable for regional resources." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "startTime": { + "type": "string", + "description": "[Output Only] The time that this operation was started by the server. This is in RFC3339 text format." + }, + "status": { + "type": "string", + "description": "[Output Only] Status of the operation. Can be one of the following: PENDING, RUNNING, or DONE." + }, + "statusMessage": { + "type": "string", + "description": "[Output Only] An optional textual description of the current status of the operation." + }, + "targetId": { + "type": "string", + "description": "[Output Only] Unique target ID which identifies a particular incarnation of the target.", + "format": "uint64" + }, + "targetLink": { + "type": "string", + "description": "[Output Only] URL of the resource the operation is mutating." + }, + "user": { + "type": "string", + "description": "[Output Only] User who requested the operation, for example: user@example.com." + }, + "warnings": { + "type": "array", + "description": "[Output Only] If warning messages are generated during processing of the operation, this field will be populated.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The warning type identifier for this warning." + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + }, + "zone": { + "type": "string", + "description": "[Output Only] URL of the zone where the operation resides." + } + } + }, + "OperationsListResponse": { + "id": "OperationsListResponse", + "type": "object", + "description": "A response containing a partial list of operations and a page token used to build the next request if the request has been truncated.", + "properties": { + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "operations": { + "type": "array", + "description": "[Output Only] Operations contained in this list response.", + "items": { + "$ref": "Operation" + } + } + } + }, + "Resource": { + "id": "Resource", + "type": "object", + "description": "", + "properties": { + "finalProperties": { + "type": "string", + "description": "[Output Only] The evaluated properties of the resource with references expanded. Returned as serialized YAML." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "[Output Only] Timestamp when the resource was created or acquired, in RFC3339 text format ." + }, + "manifest": { + "type": "string", + "description": "[Output Only] URL of the manifest representing the current configuration of this resource." + }, + "name": { + "type": "string", + "description": "[Output Only] The name of the resource as it appears in the YAML config." + }, + "properties": { + "type": "string", + "description": "[Output Only] The current properties of the resource before any references have been filled in. Returned as serialized YAML." + }, + "type": { + "type": "string", + "description": "[Output Only] The type of the resource, for example compute.v1.instance, or replicaPools.v1beta2.instanceGroupManager." + }, + "update": { + "$ref": "ResourceUpdate", + "description": "[Output Only] If Deployment Manager is currently updating or previewing an update to this resource, the updated configuration appears here." + }, + "updateTime": { + "type": "string", + "description": "[Output Only] Timestamp when the resource was updated, in RFC3339 text format ." + }, + "url": { + "type": "string", + "description": "[Output Only] The URL of the actual resource." + } + } + }, + "ResourceUpdate": { + "id": "ResourceUpdate", + "type": "object", + "description": "", + "properties": { + "errors": { + "type": "array", + "description": "[Output Only] List of all errors encountered while trying to enact update.intent.", + "items": { + "type": "string" + } + }, + "finalProperties": { + "type": "string", + "description": "[Output Only] The expanded properties of the resource with reference values expanded. Returned as serialized YAML." + }, + "intent": { + "type": "string", + "description": "[Output Only] The intent of the resource: PREVIEW, UPDATE, or CANCEL." + }, + "manifest": { + "type": "string", + "description": "[Output Only] URL of the manifest representing the update configuration of this resource." + }, + "properties": { + "type": "string", + "description": "[Output Only] The set of updated properties for this resource, before references are expanded. Returned as serialized YAML." + }, + "state": { + "type": "string", + "description": "[Output Only] The state of the resource." + } + } + }, + "ResourcesListResponse": { + "id": "ResourcesListResponse", + "type": "object", + "description": "A response containing a partial list of resources and a page token used to build the next request if the request has been truncated.", + "properties": { + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request." + }, + "resources": { + "type": "array", + "description": "Resources contained in this list response.", + "items": { + "$ref": "Resource" + } + } + } + }, + "TargetConfiguration": { + "id": "TargetConfiguration", + "type": "object", + "description": "", + "properties": { + "config": { + "type": "string", + "description": "The configuration to use for this deployment." + }, + "imports": { + "type": "array", + "description": "Specifies any files to import for this configuration. This can be used to import templates or other files. For example, you might import a text file in order to use the file in a template.", + "items": { + "$ref": "ImportFile" + } + } + } + }, + "Type": { + "id": "Type", + "type": "object", + "description": "A resource type supported by Deployment Manager.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "[Output Only] Timestamp when the type was created, in RFC3339 text format." + }, + "name": { + "type": "string", + "description": "Name of the type." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Self link for the type." + } + } + }, + "TypesListResponse": { + "id": "TypesListResponse", + "type": "object", + "description": "A response that returns all Types supported by Deployment Manager", + "properties": { + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request." + }, + "types": { + "type": "array", + "description": "[Output Only] A list of resource types supported by Deployment Manager.", + "items": { + "$ref": "Type" + } + } + } + } + }, + "resources": { + "deployments": { + "methods": { + "delete": { + "id": "deploymentmanager.deployments.delete", + "path": "{project}/global/deployments/{deployment}", + "httpMethod": "DELETE", + "description": "Deletes a deployment and all of the resources in the deployment.", + "parameters": { + "deployment": { + "type": "string", + "description": "The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "deployment" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "get": { + "id": "deploymentmanager.deployments.get", + "path": "{project}/global/deployments/{deployment}", + "httpMethod": "GET", + "description": "Gets information about a specific deployment.", + "parameters": { + "deployment": { + "type": "string", + "description": "The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "deployment" + ], + "response": { + "$ref": "Deployment" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "insert": { + "id": "deploymentmanager.deployments.insert", + "path": "{project}/global/deployments", + "httpMethod": "POST", + "description": "Creates a deployment and all of the resources described by the deployment manifest.", + "parameters": { + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "Deployment" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "list": { + "id": "deploymentmanager.deployments.list", + "path": "{project}/global/deployments", + "httpMethod": "GET", + "description": "Lists all deployments for a given project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "DeploymentsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "patch": { + "id": "deploymentmanager.deployments.patch", + "path": "{project}/global/deployments/{deployment}", + "httpMethod": "PATCH", + "description": "Updates a deployment and all of the resources described by the deployment manifest. This method supports patch semantics.", + "parameters": { + "createPolicy": { + "type": "string", + "description": "Sets the policy to use for creating new resources.", + "default": "CREATE_OR_ACQUIRE", + "enum": [ + "ACQUIRE", + "CREATE_OR_ACQUIRE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "deletePolicy": { + "type": "string", + "description": "Sets the policy to use for deleting resources.", + "default": "DELETE", + "enum": [ + "ABANDON", + "DELETE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "deployment": { + "type": "string", + "description": "The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "updatePolicy": { + "type": "string", + "description": "Sets the policy to use for updating resources.", + "default": "PATCH", + "enum": [ + "PATCH", + "UPDATE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "project", + "deployment" + ], + "request": { + "$ref": "Deployment" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "update": { + "id": "deploymentmanager.deployments.update", + "path": "{project}/global/deployments/{deployment}", + "httpMethod": "PUT", + "description": "Updates a deployment and all of the resources described by the deployment manifest.", + "parameters": { + "createPolicy": { + "type": "string", + "description": "Sets the policy to use for creating new resources.", + "default": "CREATE_OR_ACQUIRE", + "enum": [ + "ACQUIRE", + "CREATE_OR_ACQUIRE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "deletePolicy": { + "type": "string", + "description": "Sets the policy to use for deleting resources.", + "default": "DELETE", + "enum": [ + "ABANDON", + "DELETE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "deployment": { + "type": "string", + "description": "The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "updatePolicy": { + "type": "string", + "description": "Sets the policy to use for updating resources.", + "default": "PATCH", + "enum": [ + "PATCH", + "UPDATE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "project", + "deployment" + ], + "request": { + "$ref": "Deployment" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + } + } + }, + "manifests": { + "methods": { + "get": { + "id": "deploymentmanager.manifests.get", + "path": "{project}/global/deployments/{deployment}/manifests/{manifest}", + "httpMethod": "GET", + "description": "Gets information about a specific manifest.", + "parameters": { + "deployment": { + "type": "string", + "description": "The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "manifest": { + "type": "string", + "description": "The name of the manifest for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "deployment", + "manifest" + ], + "response": { + "$ref": "Manifest" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "list": { + "id": "deploymentmanager.manifests.list", + "path": "{project}/global/deployments/{deployment}/manifests", + "httpMethod": "GET", + "description": "Lists all manifests for a given deployment.", + "parameters": { + "deployment": { + "type": "string", + "description": "The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "deployment" + ], + "response": { + "$ref": "ManifestsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + } + } + }, + "operations": { + "methods": { + "get": { + "id": "deploymentmanager.operations.get", + "path": "{project}/global/operations/{operation}", + "httpMethod": "GET", + "description": "Gets information about a specific operation.", + "parameters": { + "operation": { + "type": "string", + "description": "The name of the operation for this request.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "list": { + "id": "deploymentmanager.operations.list", + "path": "{project}/global/operations", + "httpMethod": "GET", + "description": "Lists all operations for a project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "OperationsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + } + } + }, + "resources": { + "methods": { + "get": { + "id": "deploymentmanager.resources.get", + "path": "{project}/global/deployments/{deployment}/resources/{resource}", + "httpMethod": "GET", + "description": "Gets information about a single resource.", + "parameters": { + "deployment": { + "type": "string", + "description": "The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "resource": { + "type": "string", + "description": "The name of the resource for this request.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "deployment", + "resource" + ], + "response": { + "$ref": "Resource" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "list": { + "id": "deploymentmanager.resources.list", + "path": "{project}/global/deployments/{deployment}/resources", + "httpMethod": "GET", + "description": "Lists all resources in a given deployment.", + "parameters": { + "deployment": { + "type": "string", + "description": "The name of the deployment for this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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", + "deployment" + ], + "response": { + "$ref": "ResourcesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + } + } + }, + "types": { + "methods": { + "list": { + "id": "deploymentmanager.types.list", + "path": "{project}/global/types", + "httpMethod": "GET", + "description": "Lists all resource types for Deployment Manager.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-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": "TypesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/deploymentmanager/v2beta2/deploymentmanager-gen.go b/Godeps/_workspace/src/google.golang.org/api/deploymentmanager/v2beta2/deploymentmanager-gen.go new file mode 100644 index 000000000..5f50fcf10 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/deploymentmanager/v2beta2/deploymentmanager-gen.go @@ -0,0 +1,3119 @@ +// Package deploymentmanager provides access to the Google Cloud Deployment Manager API. +// +// See https://developers.google.com/deployment-manager/ +// +// Usage example: +// +// import "google.golang.org/api/deploymentmanager/v2beta2" +// ... +// deploymentmanagerService, err := deploymentmanager.New(oauthHttpClient) +package deploymentmanager // import "google.golang.org/api/deploymentmanager/v2beta2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "deploymentmanager:v2beta2" +const apiName = "deploymentmanager" +const apiVersion = "v2beta2" +const basePath = "https://www.googleapis.com/deploymentmanager/v2beta2/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 data across Google Cloud Platform services + CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" + + // View and manage your Google Cloud Platform management resources and + // deployment status information + NdevCloudmanScope = "https://www.googleapis.com/auth/ndev.cloudman" + + // View your Google Cloud Platform management resources and deployment + // status information + NdevCloudmanReadonlyScope = "https://www.googleapis.com/auth/ndev.cloudman.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.Deployments = NewDeploymentsService(s) + s.Manifests = NewManifestsService(s) + s.Operations = NewOperationsService(s) + s.Resources = NewResourcesService(s) + s.Types = NewTypesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Deployments *DeploymentsService + + Manifests *ManifestsService + + Operations *OperationsService + + Resources *ResourcesService + + Types *TypesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewDeploymentsService(s *Service) *DeploymentsService { + rs := &DeploymentsService{s: s} + return rs +} + +type DeploymentsService struct { + s *Service +} + +func NewManifestsService(s *Service) *ManifestsService { + rs := &ManifestsService{s: s} + return rs +} + +type ManifestsService struct { + s *Service +} + +func NewOperationsService(s *Service) *OperationsService { + rs := &OperationsService{s: s} + return rs +} + +type OperationsService struct { + s *Service +} + +func NewResourcesService(s *Service) *ResourcesService { + rs := &ResourcesService{s: s} + return rs +} + +type ResourcesService struct { + s *Service +} + +func NewTypesService(s *Service) *TypesService { + rs := &TypesService{s: s} + return rs +} + +type TypesService struct { + s *Service +} + +type Deployment struct { + // Description: An optional user-provided description of the deployment. + Description string `json:"description,omitempty"` + + // Fingerprint: Specifies a fingerprint for update() requests. A + // fingerprint is a randomly generated value that must be provided in + // update() requests to perform optimistic locking. This ensures + // optimistic concurrency so that only one update can be performed at a + // time. The fingerprint is initially generated by Deployment Manager + // and changes after every request to modify data. To get the latest + // fingerprint value, perform a get() request to a deployment. + Fingerprint string `json:"fingerprint,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // InsertTime: [Output Only] Timestamp when the deployment was created, + // in RFC3339 text format . + InsertTime string `json:"insertTime,omitempty"` + + // Intent: [Input Only] Specifies how Deployment Manager should apply + // this template. Possible options are PREVIEW, UPDATE, and + // CANCEL. + // + // PREVIEW creates a deployment and creates "shell" resources but does + // not actually instantiate these resources. This allows you to preview + // what your deployment looks like. You can use this intent to preview + // updates to deployments or preview new deployments. You must provide a + // target.config with a configuration for this intent. After previewing + // a deployment, you can deploy your resources by making a request with + // the UPDATE intent or you can CANCEL the preview altogether. Note that + // the deployment will still exist after you cancel the preview and you + // must separately delete this deployment if you want to remove + // it. + // + // UPDATE performs an update to the underlying resources in a + // deployment. If you provide a populated target.config field with this + // request, Deployment Manager uses that configuration to perform an + // update. If you had previewed this update beforehand, and do not + // supply a target.config or provide an empty target.config, Deployment + // Manager uses the last previewed configuration. + // + // CANCEL cancels an update that is in PREVIEW or UPDATE but does not + // undo any changes already made. + Intent string `json:"intent,omitempty"` + + // Manifest: [Output Only] URL of the manifest representing the last + // manifest that was successfully deployed. + Manifest string `json:"manifest,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. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // State: [Output Only] The current state of the deployment. This can be + // DEPLOYED, DEPLOYMENT_FAILED, PREVIEWING, UPDATING, and CANCELING. + State string `json:"state,omitempty"` + + // Target: [Input Only] The parameters that define your deployment, + // including the deployment configuration and relevant templates. + Target *TargetConfiguration `json:"target,omitempty"` + + // Update: [Output Only] If Deployment Manager is currently updating or + // previewing an update to this deployment, the updated configuration + // appears here. + Update *DeploymentUpdate `json:"update,omitempty"` + + // UpdateTime: [Output Only] Timestamp when the deployment was updated, + // in RFC3339 text format . + UpdateTime string `json:"updateTime,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Deployment) MarshalJSON() ([]byte, error) { + type noMethod Deployment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DeploymentUpdate struct { + // Errors: [Output Only] List of all errors encountered while trying to + // enact the update. + Errors []string `json:"errors,omitempty"` + + // Manifest: [Output Only] URL of the manifest representing the update + // configuration of this deployment. + Manifest string `json:"manifest,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeploymentUpdate) MarshalJSON() ([]byte, error) { + type noMethod DeploymentUpdate + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DeploymentsListResponse: A response containing a partial list of +// deployments and a page token used to build the next request if the +// request has been truncated. +type DeploymentsListResponse struct { + // Deployments: [Output Only] The deployments contained in this + // response. + Deployments []*Deployment `json:"deployments,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Deployments") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeploymentsListResponse) MarshalJSON() ([]byte, error) { + type noMethod DeploymentsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ImportFile struct { + // Content: The contents of the file. + Content string `json:"content,omitempty"` + + // Name: The name of the file. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Content") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ImportFile) MarshalJSON() ([]byte, error) { + type noMethod ImportFile + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Manifest struct { + // Config: [Output Only] The YAML configuration for this manifest. + Config string `json:"config,omitempty"` + + // EvaluatedConfig: [Output Only] The fully-expanded configuration file, + // including any templates and references. + EvaluatedConfig string `json:"evaluatedConfig,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Imports: [Output Only] The imported files for this manifest. + Imports []*ImportFile `json:"imports,omitempty"` + + // InsertTime: [Output Only] Timestamp when the manifest was created, in + // RFC3339 text format. + InsertTime string `json:"insertTime,omitempty"` + + // Layout: [Output Only] The YAML layout for this manifest. + Layout string `json:"layout,omitempty"` + + // Name: [Output Only] The name of the manifest. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] Self link for the manifest. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Config") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Manifest) MarshalJSON() ([]byte, error) { + type noMethod Manifest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ManifestsListResponse: A response containing a partial list of +// manifests and a page token used to build the next request if the +// request has been truncated. +type ManifestsListResponse struct { + // Manifests: [Output Only] Manifests contained in this list response. + Manifests []*Manifest `json:"manifests,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Manifests") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ManifestsListResponse) MarshalJSON() ([]byte, error) { + type noMethod ManifestsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Operation: An Operation resource, used to manage asynchronous API +// requests. +type Operation struct { + // ClientOperationId: [Output Only] An optional identifier specified by + // the client when the mutation was initiated. Must be unique for all + // Operation resources in the project. + ClientOperationId string `json:"clientOperationId,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // EndTime: [Output Only] The time that this operation was completed. + // This is in RFC3339 text format. + EndTime string `json:"endTime,omitempty"` + + // Error: [Output Only] If errors are generated during processing of the + // operation, this field will be populated. + Error *OperationError `json:"error,omitempty"` + + // HttpErrorMessage: [Output Only] If the operation fails, this field + // contains the HTTP error message that was returned, such as NOT FOUND. + HttpErrorMessage string `json:"httpErrorMessage,omitempty"` + + // HttpErrorStatusCode: [Output Only] If the operation fails, this field + // contains the HTTP error message that was returned, such as 404. + HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // InsertTime: [Output Only] The time that this operation was requested. + // This is in RFC3339 text format. + InsertTime string `json:"insertTime,omitempty"` + + // Kind: [Output Only] Type of the resource. Always compute#Operation + // for Operation resources. + Kind string `json:"kind,omitempty"` + + // Name: [Output Only] Name of the resource. + Name string `json:"name,omitempty"` + + // OperationType: [Output Only] Type of the operation, such as insert, + // update, and delete. + OperationType string `json:"operationType,omitempty"` + + // Progress: [Output Only] 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 monotonically + // increase as the operation progresses. + Progress int64 `json:"progress,omitempty"` + + // Region: [Output Only] URL of the region where the operation resides. + // Only applicable for regional resources. + Region string `json:"region,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // StartTime: [Output Only] The time that this operation was started by + // the server. This is in RFC3339 text format. + StartTime string `json:"startTime,omitempty"` + + // Status: [Output Only] Status of the operation. Can be one of the + // following: PENDING, RUNNING, or DONE. + Status string `json:"status,omitempty"` + + // StatusMessage: [Output Only] An optional textual description of the + // current status of the operation. + StatusMessage string `json:"statusMessage,omitempty"` + + // TargetId: [Output Only] Unique target ID which identifies a + // particular incarnation of the target. + TargetId uint64 `json:"targetId,omitempty,string"` + + // TargetLink: [Output Only] URL of the resource the operation is + // mutating. + TargetLink string `json:"targetLink,omitempty"` + + // User: [Output Only] User who requested the operation, for example: + // user@example.com. + User string `json:"user,omitempty"` + + // Warnings: [Output Only] If warning messages are generated during + // processing of the operation, this field will be populated. + Warnings []*OperationWarnings `json:"warnings,omitempty"` + + // Zone: [Output Only] URL of the zone where the operation resides. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ClientOperationId") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Operation) MarshalJSON() ([]byte, error) { + type noMethod Operation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationError: [Output Only] If errors are generated during +// processing of the operation, this field will be populated. +type OperationError struct { + // Errors: [Output Only] The array of errors encountered while + // processing this operation. + Errors []*OperationErrorErrors `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationError) MarshalJSON() ([]byte, error) { + type noMethod OperationError + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationErrorErrors struct { + // Code: [Output Only] The error type identifier for this error. + Code string `json:"code,omitempty"` + + // Location: [Output Only] Indicates the field in the request which + // caused the error. This property is optional. + Location string `json:"location,omitempty"` + + // Message: [Output Only] An optional, human-readable error message. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) { + type noMethod OperationErrorErrors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationWarnings struct { + // Code: [Output Only] The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*OperationWarningsData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationWarnings) MarshalJSON() ([]byte, error) { + type noMethod OperationWarnings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationWarningsData struct { + // Key: [Output Only] A key for the warning data. + Key string `json:"key,omitempty"` + + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationWarningsData) MarshalJSON() ([]byte, error) { + type noMethod OperationWarningsData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationsListResponse: A response containing a partial list of +// operations and a page token used to build the next request if the +// request has been truncated. +type OperationsListResponse struct { + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Operations: [Output Only] Operations contained in this list response. + Operations []*Operation `json:"operations,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationsListResponse) MarshalJSON() ([]byte, error) { + type noMethod OperationsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Resource struct { + // FinalProperties: [Output Only] The evaluated properties of the + // resource with references expanded. Returned as serialized YAML. + FinalProperties string `json:"finalProperties,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // InsertTime: [Output Only] Timestamp when the resource was created or + // acquired, in RFC3339 text format . + InsertTime string `json:"insertTime,omitempty"` + + // Manifest: [Output Only] URL of the manifest representing the current + // configuration of this resource. + Manifest string `json:"manifest,omitempty"` + + // Name: [Output Only] The name of the resource as it appears in the + // YAML config. + Name string `json:"name,omitempty"` + + // Properties: [Output Only] The current properties of the resource + // before any references have been filled in. Returned as serialized + // YAML. + Properties string `json:"properties,omitempty"` + + // Type: [Output Only] The type of the resource, for example + // compute.v1.instance, or replicaPools.v1beta2.instanceGroupManager. + Type string `json:"type,omitempty"` + + // Update: [Output Only] If Deployment Manager is currently updating or + // previewing an update to this resource, the updated configuration + // appears here. + Update *ResourceUpdate `json:"update,omitempty"` + + // UpdateTime: [Output Only] Timestamp when the resource was updated, in + // RFC3339 text format . + UpdateTime string `json:"updateTime,omitempty"` + + // Url: [Output Only] The URL of the actual resource. + Url string `json:"url,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "FinalProperties") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Resource) MarshalJSON() ([]byte, error) { + type noMethod Resource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ResourceUpdate struct { + // Errors: [Output Only] List of all errors encountered while trying to + // enact update.intent. + Errors []string `json:"errors,omitempty"` + + // FinalProperties: [Output Only] The expanded properties of the + // resource with reference values expanded. Returned as serialized YAML. + FinalProperties string `json:"finalProperties,omitempty"` + + // Intent: [Output Only] The intent of the resource: PREVIEW, UPDATE, or + // CANCEL. + Intent string `json:"intent,omitempty"` + + // Manifest: [Output Only] URL of the manifest representing the update + // configuration of this resource. + Manifest string `json:"manifest,omitempty"` + + // Properties: [Output Only] The set of updated properties for this + // resource, before references are expanded. Returned as serialized + // YAML. + Properties string `json:"properties,omitempty"` + + // State: [Output Only] The state of the resource. + State string `json:"state,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResourceUpdate) MarshalJSON() ([]byte, error) { + type noMethod ResourceUpdate + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ResourcesListResponse: A response containing a partial list of +// resources and a page token used to build the next request if the +// request has been truncated. +type ResourcesListResponse struct { + // NextPageToken: A token used to continue a truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Resources: Resources contained in this list response. + Resources []*Resource `json:"resources,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResourcesListResponse) MarshalJSON() ([]byte, error) { + type noMethod ResourcesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetConfiguration struct { + // Config: The configuration to use for this deployment. + Config string `json:"config,omitempty"` + + // Imports: Specifies any files to import for this configuration. This + // can be used to import templates or other files. For example, you + // might import a text file in order to use the file in a template. + Imports []*ImportFile `json:"imports,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Config") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetConfiguration) MarshalJSON() ([]byte, error) { + type noMethod TargetConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Type: A resource type supported by Deployment Manager. +type Type struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // InsertTime: [Output Only] Timestamp when the type was created, in + // RFC3339 text format. + InsertTime string `json:"insertTime,omitempty"` + + // Name: Name of the type. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] Self link for the type. + SelfLink string `json:"selfLink,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Type) MarshalJSON() ([]byte, error) { + type noMethod Type + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TypesListResponse: A response that returns all Types supported by +// Deployment Manager +type TypesListResponse struct { + // NextPageToken: A token used to continue a truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Types: [Output Only] A list of resource types supported by Deployment + // Manager. + Types []*Type `json:"types,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TypesListResponse) MarshalJSON() ([]byte, error) { + type noMethod TypesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "deploymentmanager.deployments.delete": + +type DeploymentsDeleteCall struct { + s *Service + project string + deployment string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a deployment and all of the resources in the +// deployment. +func (r *DeploymentsService) Delete(project string, deployment string) *DeploymentsDeleteCall { + c := &DeploymentsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DeploymentsDeleteCall) Fields(s ...googleapi.Field) *DeploymentsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DeploymentsDeleteCall) Context(ctx context.Context) *DeploymentsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *DeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "deployment": c.deployment, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.deployments.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DeploymentsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a deployment and all of the resources in the deployment.", + // "httpMethod": "DELETE", + // "id": "deploymentmanager.deployments.delete", + // "parameterOrder": [ + // "project", + // "deployment" + // ], + // "parameters": { + // "deployment": { + // "description": "The name of the deployment for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/deployments/{deployment}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.cloudman" + // ] + // } + +} + +// method id "deploymentmanager.deployments.get": + +type DeploymentsGetCall struct { + s *Service + project string + deployment string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets information about a specific deployment. +func (r *DeploymentsService) Get(project string, deployment string) *DeploymentsGetCall { + c := &DeploymentsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DeploymentsGetCall) Fields(s ...googleapi.Field) *DeploymentsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DeploymentsGetCall) IfNoneMatch(entityTag string) *DeploymentsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DeploymentsGetCall) Context(ctx context.Context) *DeploymentsGetCall { + c.ctx_ = ctx + return c +} + +func (c *DeploymentsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "deployment": c.deployment, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.deployments.get" call. +// Exactly one of *Deployment or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Deployment.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DeploymentsGetCall) Do() (*Deployment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Deployment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets information about a specific deployment.", + // "httpMethod": "GET", + // "id": "deploymentmanager.deployments.get", + // "parameterOrder": [ + // "project", + // "deployment" + // ], + // "parameters": { + // "deployment": { + // "description": "The name of the deployment for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/deployments/{deployment}", + // "response": { + // "$ref": "Deployment" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "deploymentmanager.deployments.insert": + +type DeploymentsInsertCall struct { + s *Service + project string + deployment *Deployment + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a deployment and all of the resources described by +// the deployment manifest. +func (r *DeploymentsService) Insert(project string, deployment *Deployment) *DeploymentsInsertCall { + c := &DeploymentsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DeploymentsInsertCall) Fields(s ...googleapi.Field) *DeploymentsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DeploymentsInsertCall) Context(ctx context.Context) *DeploymentsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *DeploymentsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.deployments.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DeploymentsInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a deployment and all of the resources described by the deployment manifest.", + // "httpMethod": "POST", + // "id": "deploymentmanager.deployments.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/deployments", + // "request": { + // "$ref": "Deployment" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.cloudman" + // ] + // } + +} + +// method id "deploymentmanager.deployments.list": + +type DeploymentsListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all deployments for a given project. +func (r *DeploymentsService) List(project string) *DeploymentsListCall { + c := &DeploymentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *DeploymentsListCall) Filter(filter string) *DeploymentsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *DeploymentsListCall) MaxResults(maxResults int64) *DeploymentsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *DeploymentsListCall) PageToken(pageToken string) *DeploymentsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DeploymentsListCall) Fields(s ...googleapi.Field) *DeploymentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DeploymentsListCall) IfNoneMatch(entityTag string) *DeploymentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DeploymentsListCall) Context(ctx context.Context) *DeploymentsListCall { + c.ctx_ = ctx + return c +} + +func (c *DeploymentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.deployments.list" call. +// Exactly one of *DeploymentsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DeploymentsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DeploymentsListCall) Do() (*DeploymentsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DeploymentsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all deployments for a given project.", + // "httpMethod": "GET", + // "id": "deploymentmanager.deployments.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/deployments", + // "response": { + // "$ref": "DeploymentsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "deploymentmanager.deployments.patch": + +type DeploymentsPatchCall struct { + s *Service + project string + deployment string + deployment2 *Deployment + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates a deployment and all of the resources described by the +// deployment manifest. This method supports patch semantics. +func (r *DeploymentsService) Patch(project string, deployment string, deployment2 *Deployment) *DeploymentsPatchCall { + c := &DeploymentsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + c.deployment2 = deployment2 + return c +} + +// CreatePolicy sets the optional parameter "createPolicy": Sets the +// policy to use for creating new resources. +// +// Possible values: +// "ACQUIRE" +// "CREATE_OR_ACQUIRE" (default) +func (c *DeploymentsPatchCall) CreatePolicy(createPolicy string) *DeploymentsPatchCall { + c.opt_["createPolicy"] = createPolicy + return c +} + +// DeletePolicy sets the optional parameter "deletePolicy": Sets the +// policy to use for deleting resources. +// +// Possible values: +// "ABANDON" +// "DELETE" (default) +func (c *DeploymentsPatchCall) DeletePolicy(deletePolicy string) *DeploymentsPatchCall { + c.opt_["deletePolicy"] = deletePolicy + return c +} + +// UpdatePolicy sets the optional parameter "updatePolicy": Sets the +// policy to use for updating resources. +// +// Possible values: +// "PATCH" (default) +// "UPDATE" +func (c *DeploymentsPatchCall) UpdatePolicy(updatePolicy string) *DeploymentsPatchCall { + c.opt_["updatePolicy"] = updatePolicy + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DeploymentsPatchCall) Fields(s ...googleapi.Field) *DeploymentsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DeploymentsPatchCall) Context(ctx context.Context) *DeploymentsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *DeploymentsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["createPolicy"]; ok { + params.Set("createPolicy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["deletePolicy"]; ok { + params.Set("deletePolicy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["updatePolicy"]; ok { + params.Set("updatePolicy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "deployment": c.deployment, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.deployments.patch" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DeploymentsPatchCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a deployment and all of the resources described by the deployment manifest. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "deploymentmanager.deployments.patch", + // "parameterOrder": [ + // "project", + // "deployment" + // ], + // "parameters": { + // "createPolicy": { + // "default": "CREATE_OR_ACQUIRE", + // "description": "Sets the policy to use for creating new resources.", + // "enum": [ + // "ACQUIRE", + // "CREATE_OR_ACQUIRE" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "deletePolicy": { + // "default": "DELETE", + // "description": "Sets the policy to use for deleting resources.", + // "enum": [ + // "ABANDON", + // "DELETE" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "deployment": { + // "description": "The name of the deployment for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "updatePolicy": { + // "default": "PATCH", + // "description": "Sets the policy to use for updating resources.", + // "enum": [ + // "PATCH", + // "UPDATE" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "{project}/global/deployments/{deployment}", + // "request": { + // "$ref": "Deployment" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.cloudman" + // ] + // } + +} + +// method id "deploymentmanager.deployments.update": + +type DeploymentsUpdateCall struct { + s *Service + project string + deployment string + deployment2 *Deployment + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a deployment and all of the resources described by +// the deployment manifest. +func (r *DeploymentsService) Update(project string, deployment string, deployment2 *Deployment) *DeploymentsUpdateCall { + c := &DeploymentsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + c.deployment2 = deployment2 + return c +} + +// CreatePolicy sets the optional parameter "createPolicy": Sets the +// policy to use for creating new resources. +// +// Possible values: +// "ACQUIRE" +// "CREATE_OR_ACQUIRE" (default) +func (c *DeploymentsUpdateCall) CreatePolicy(createPolicy string) *DeploymentsUpdateCall { + c.opt_["createPolicy"] = createPolicy + return c +} + +// DeletePolicy sets the optional parameter "deletePolicy": Sets the +// policy to use for deleting resources. +// +// Possible values: +// "ABANDON" +// "DELETE" (default) +func (c *DeploymentsUpdateCall) DeletePolicy(deletePolicy string) *DeploymentsUpdateCall { + c.opt_["deletePolicy"] = deletePolicy + return c +} + +// UpdatePolicy sets the optional parameter "updatePolicy": Sets the +// policy to use for updating resources. +// +// Possible values: +// "PATCH" (default) +// "UPDATE" +func (c *DeploymentsUpdateCall) UpdatePolicy(updatePolicy string) *DeploymentsUpdateCall { + c.opt_["updatePolicy"] = updatePolicy + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DeploymentsUpdateCall) Fields(s ...googleapi.Field) *DeploymentsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DeploymentsUpdateCall) Context(ctx context.Context) *DeploymentsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *DeploymentsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["createPolicy"]; ok { + params.Set("createPolicy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["deletePolicy"]; ok { + params.Set("deletePolicy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["updatePolicy"]; ok { + params.Set("updatePolicy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "deployment": c.deployment, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.deployments.update" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DeploymentsUpdateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a deployment and all of the resources described by the deployment manifest.", + // "httpMethod": "PUT", + // "id": "deploymentmanager.deployments.update", + // "parameterOrder": [ + // "project", + // "deployment" + // ], + // "parameters": { + // "createPolicy": { + // "default": "CREATE_OR_ACQUIRE", + // "description": "Sets the policy to use for creating new resources.", + // "enum": [ + // "ACQUIRE", + // "CREATE_OR_ACQUIRE" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "deletePolicy": { + // "default": "DELETE", + // "description": "Sets the policy to use for deleting resources.", + // "enum": [ + // "ABANDON", + // "DELETE" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "deployment": { + // "description": "The name of the deployment for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "updatePolicy": { + // "default": "PATCH", + // "description": "Sets the policy to use for updating resources.", + // "enum": [ + // "PATCH", + // "UPDATE" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "{project}/global/deployments/{deployment}", + // "request": { + // "$ref": "Deployment" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.cloudman" + // ] + // } + +} + +// method id "deploymentmanager.manifests.get": + +type ManifestsGetCall struct { + s *Service + project string + deployment string + manifest string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets information about a specific manifest. +func (r *ManifestsService) Get(project string, deployment string, manifest string) *ManifestsGetCall { + c := &ManifestsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + c.manifest = manifest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManifestsGetCall) Fields(s ...googleapi.Field) *ManifestsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManifestsGetCall) IfNoneMatch(entityTag string) *ManifestsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManifestsGetCall) Context(ctx context.Context) *ManifestsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ManifestsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}/manifests/{manifest}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "deployment": c.deployment, + "manifest": c.manifest, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.manifests.get" call. +// Exactly one of *Manifest or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Manifest.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ManifestsGetCall) Do() (*Manifest, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Manifest{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets information about a specific manifest.", + // "httpMethod": "GET", + // "id": "deploymentmanager.manifests.get", + // "parameterOrder": [ + // "project", + // "deployment", + // "manifest" + // ], + // "parameters": { + // "deployment": { + // "description": "The name of the deployment for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "manifest": { + // "description": "The name of the manifest for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/deployments/{deployment}/manifests/{manifest}", + // "response": { + // "$ref": "Manifest" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "deploymentmanager.manifests.list": + +type ManifestsListCall struct { + s *Service + project string + deployment string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all manifests for a given deployment. +func (r *ManifestsService) List(project string, deployment string) *ManifestsListCall { + c := &ManifestsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *ManifestsListCall) Filter(filter string) *ManifestsListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *ManifestsListCall) MaxResults(maxResults int64) *ManifestsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *ManifestsListCall) PageToken(pageToken string) *ManifestsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManifestsListCall) Fields(s ...googleapi.Field) *ManifestsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManifestsListCall) IfNoneMatch(entityTag string) *ManifestsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManifestsListCall) Context(ctx context.Context) *ManifestsListCall { + c.ctx_ = ctx + return c +} + +func (c *ManifestsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}/manifests") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "deployment": c.deployment, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.manifests.list" call. +// Exactly one of *ManifestsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ManifestsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManifestsListCall) Do() (*ManifestsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ManifestsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all manifests for a given deployment.", + // "httpMethod": "GET", + // "id": "deploymentmanager.manifests.list", + // "parameterOrder": [ + // "project", + // "deployment" + // ], + // "parameters": { + // "deployment": { + // "description": "The name of the deployment for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/deployments/{deployment}/manifests", + // "response": { + // "$ref": "ManifestsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "deploymentmanager.operations.get": + +type OperationsGetCall struct { + s *Service + project string + operation string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets information about a specific operation. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.operations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OperationsGetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets information about a specific operation.", + // "httpMethod": "GET", + // "id": "deploymentmanager.operations.get", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "The name of the operation for this request.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "deploymentmanager.operations.list": + +type OperationsListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all operations for a 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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +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. +func (c *OperationsListCall) MaxResults(maxResults int64) *OperationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.operations.list" call. +// Exactly one of *OperationsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *OperationsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OperationsListCall) Do() (*OperationsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperationsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all operations for a project.", + // "httpMethod": "GET", + // "id": "deploymentmanager.operations.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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": "OperationsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "deploymentmanager.resources.get": + +type ResourcesGetCall struct { + s *Service + project string + deployment string + resource string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets information about a single resource. +func (r *ResourcesService) Get(project string, deployment string, resource string) *ResourcesGetCall { + c := &ResourcesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + c.resource = resource + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ResourcesGetCall) Fields(s ...googleapi.Field) *ResourcesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ResourcesGetCall) IfNoneMatch(entityTag string) *ResourcesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ResourcesGetCall) Context(ctx context.Context) *ResourcesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ResourcesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}/resources/{resource}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "deployment": c.deployment, + "resource": c.resource, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.resources.get" call. +// Exactly one of *Resource or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Resource.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ResourcesGetCall) Do() (*Resource, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Resource{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets information about a single resource.", + // "httpMethod": "GET", + // "id": "deploymentmanager.resources.get", + // "parameterOrder": [ + // "project", + // "deployment", + // "resource" + // ], + // "parameters": { + // "deployment": { + // "description": "The name of the deployment for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "resource": { + // "description": "The name of the resource for this request.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/deployments/{deployment}/resources/{resource}", + // "response": { + // "$ref": "Resource" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "deploymentmanager.resources.list": + +type ResourcesListCall struct { + s *Service + project string + deployment string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all resources in a given deployment. +func (r *ResourcesService) List(project string, deployment string) *ResourcesListCall { + c := &ResourcesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.deployment = deployment + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *ResourcesListCall) Filter(filter string) *ResourcesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *ResourcesListCall) MaxResults(maxResults int64) *ResourcesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *ResourcesListCall) PageToken(pageToken string) *ResourcesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ResourcesListCall) Fields(s ...googleapi.Field) *ResourcesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ResourcesListCall) IfNoneMatch(entityTag string) *ResourcesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ResourcesListCall) Context(ctx context.Context) *ResourcesListCall { + c.ctx_ = ctx + return c +} + +func (c *ResourcesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}/resources") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "deployment": c.deployment, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.resources.list" call. +// Exactly one of *ResourcesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ResourcesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ResourcesListCall) Do() (*ResourcesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ResourcesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all resources in a given deployment.", + // "httpMethod": "GET", + // "id": "deploymentmanager.resources.list", + // "parameterOrder": [ + // "project", + // "deployment" + // ], + // "parameters": { + // "deployment": { + // "description": "The name of the deployment for this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/deployments/{deployment}/resources", + // "response": { + // "$ref": "ResourcesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "deploymentmanager.types.list": + +type TypesListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all resource types for Deployment Manager. +func (r *TypesService) List(project string) *TypesListCall { + c := &TypesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *TypesListCall) Filter(filter string) *TypesListCall { + c.opt_["filter"] = filter + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *TypesListCall) MaxResults(maxResults int64) *TypesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *TypesListCall) PageToken(pageToken string) *TypesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TypesListCall) Fields(s ...googleapi.Field) *TypesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TypesListCall) IfNoneMatch(entityTag string) *TypesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TypesListCall) Context(ctx context.Context) *TypesListCall { + c.ctx_ = ctx + return c +} + +func (c *TypesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/types") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "deploymentmanager.types.list" call. +// Exactly one of *TypesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TypesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TypesListCall) Do() (*TypesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TypesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all resource types for Deployment Manager.", + // "httpMethod": "GET", + // "id": "deploymentmanager.types.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The project ID for this request.", + // "location": "path", + // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-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/types", + // "response": { + // "$ref": "TypesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/dfareporting/v1.1/dfareporting-api.json b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v1.1/dfareporting-api.json new file mode 100644 index 000000000..aef7061d3 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v1.1/dfareporting-api.json @@ -0,0 +1,1521 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/iNITuzieMjdA01fjEwPpxFw5muo\"", + "discoveryVersion": "v1", + "id": "dfareporting:v1.1", + "name": "dfareporting", + "version": "v1.1", + "revision": "20141112", + "title": "DFA Reporting API", + "description": "Lets you create, run and download reports.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/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/Godeps/_workspace/src/google.golang.org/api/dfareporting/v1.1/dfareporting-gen.go b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v1.1/dfareporting-gen.go new file mode 100644 index 000000000..11a7d5c72 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v1.1/dfareporting-gen.go @@ -0,0 +1,3197 @@ +// Package dfareporting provides access to the DFA Reporting API. +// +// See https://developers.google.com/doubleclick-advertisers/reporting/ +// +// Usage example: +// +// import "google.golang.org/api/dfareporting/v1.1" +// ... +// dfareportingService, err := dfareporting.New(oauthHttpClient) +package dfareporting // import "google.golang.org/api/dfareporting/v1.1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + DimensionValues *DimensionValuesService + + Files *FilesService + + Reports *ReportsService + + UserProfiles *UserProfilesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 +} + +// Activities: Represents an activity group. +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"` + + // ForceSendFields is a list of field names (e.g. "Filters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Activities) MarshalJSON() ([]byte, error) { + type noMethod Activities + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomRichMediaEvents: Represents a Custom Rich Media Events group. +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"` + + // ForceSendFields is a list of field names (e.g. "FilteredEventIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomRichMediaEvents) MarshalJSON() ([]byte, error) { + type noMethod CustomRichMediaEvents + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DateRange: Represents a date range. +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"` + + // ForceSendFields is a list of field names (e.g. "EndDate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DateRange) MarshalJSON() ([]byte, error) { + type noMethod DateRange + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionFilter: Represents a dimension filter. +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionFilter) MarshalJSON() ([]byte, error) { + type noMethod DimensionFilter + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionValue: Represents a DimensionValue resource. +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionValue) MarshalJSON() ([]byte, error) { + type noMethod DimensionValue + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionValueList: Represents the list of DimensionValue resources. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionValueList) MarshalJSON() ([]byte, error) { + type noMethod DimensionValueList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionValueRequest: Represents a DimensionValuesRequest. +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionValueRequest) MarshalJSON() ([]byte, error) { + type noMethod DimensionValueRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// File: 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". +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DateRange") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *File) MarshalJSON() ([]byte, error) { + type noMethod File + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FileUrls: The urls where the completed report file can be downloaded. +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"` + + // ForceSendFields is a list of field names (e.g. "ApiUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileUrls) MarshalJSON() ([]byte, error) { + type noMethod FileUrls + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FileList: Represents the list of File resources. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileList) MarshalJSON() ([]byte, error) { + type noMethod FileList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Recipient: Represents a recipient. +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"` + + // ForceSendFields is a list of field names (e.g. "DeliveryType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Recipient) MarshalJSON() ([]byte, error) { + type noMethod Recipient + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Report: Represents a Report resource. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Report) MarshalJSON() ([]byte, error) { + type noMethod Report + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportActiveGrpCriteria: The report criteria for a report of type +// "ACTIVE_GRP". +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"` + + // ForceSendFields is a list of field names (e.g. "DateRange") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportActiveGrpCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportActiveGrpCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportCriteria: The report criteria for a report of type "STANDARD". +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"` + + // ForceSendFields is a list of field names (e.g. "Activities") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportCrossDimensionReachCriteria: The report criteria for a report +// of type "CROSS_DIMENSION_REACH". +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"` + + // ForceSendFields is a list of field names (e.g. "Breakdown") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportCrossDimensionReachCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportCrossDimensionReachCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportDelivery: The report's email delivery settings. +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"` + + // ForceSendFields is a list of field names (e.g. "EmailOwner") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportDelivery) MarshalJSON() ([]byte, error) { + type noMethod ReportDelivery + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportFloodlightCriteria: The report criteria for a report of type +// "FLOODLIGHT". +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"` + + // ForceSendFields is a list of field names (e.g. "DateRange") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportFloodlightCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportFloodlightCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportFloodlightCriteriaReportProperties: The properties of the +// report. +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"` + + // ForceSendFields is a list of field names (e.g. + // "IncludeAttributedIPConversions") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportFloodlightCriteriaReportProperties) MarshalJSON() ([]byte, error) { + type noMethod ReportFloodlightCriteriaReportProperties + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportPathToConversionCriteria: The report criteria for a report of +// type "PATH_TO_CONVERSION". +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"` + + // ForceSendFields is a list of field names (e.g. "ActivityFilters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportPathToConversionCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportPathToConversionCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportPathToConversionCriteriaReportProperties: The properties of the +// report. +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"` + + // ForceSendFields is a list of field names (e.g. + // "ClicksLookbackWindow") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportPathToConversionCriteriaReportProperties) MarshalJSON() ([]byte, error) { + type noMethod ReportPathToConversionCriteriaReportProperties + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportReachCriteria: The report criteria for a report of type +// "REACH". +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"` + + // ForceSendFields is a list of field names (e.g. "Activities") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportReachCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportReachCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportSchedule: 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". +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"` + + // ForceSendFields is a list of field names (e.g. "Active") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportSchedule) MarshalJSON() ([]byte, error) { + type noMethod ReportSchedule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportList: Represents the list of reports. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportList) MarshalJSON() ([]byte, error) { + type noMethod ReportList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SortedDimension: Represents a sorted dimension. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SortedDimension) MarshalJSON() ([]byte, error) { + type noMethod SortedDimension + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserProfile: Represents a UserProfile resource. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserProfile) MarshalJSON() ([]byte, error) { + type noMethod UserProfile + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserProfileList: Represents the list of user profiles. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserProfileList) MarshalJSON() ([]byte, error) { + type noMethod UserProfileList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "dfareporting.dimensionValues.query": + +type DimensionValuesQueryCall struct { + s *Service + profileId int64 + dimensionvaluerequest *DimensionValueRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DimensionValuesQueryCall) Fields(s ...googleapi.Field) *DimensionValuesQueryCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DimensionValuesQueryCall) Context(ctx context.Context) *DimensionValuesQueryCall { + c.ctx_ = ctx + return c +} + +func (c *DimensionValuesQueryCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dimensionvalues/query") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.dimensionValues.query" call. +// Exactly one of *DimensionValueList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DimensionValueList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DimensionValuesQueryCall) Do() (*DimensionValueList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DimensionValueList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "ID" - Sort by file ID. +// "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field. +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'. +// +// Possible values: +// "ASCENDING" - Ascending order. +// "DESCENDING" (default) - Descending order. +func (c *FilesListCall) SortOrder(sortOrder string) *FilesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FilesListCall) Context(ctx context.Context) *FilesListCall { + c.ctx_ = ctx + return c +} + +func (c *FilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/files") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.files.list" call. +// Exactly one of *FileList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *FileList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FilesListCall) Do() (*FileList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FileList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsDeleteCall) Fields(s ...googleapi.Field) *ReportsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsDeleteCall) Context(ctx context.Context) *ReportsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.delete" call. +func (c *ReportsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsGetCall) Fields(s ...googleapi.Field) *ReportsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsGetCall) IfNoneMatch(entityTag string) *ReportsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsGetCall) Context(ctx context.Context) *ReportsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.get" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsGetCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsInsertCall) Fields(s ...googleapi.Field) *ReportsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsInsertCall) Context(ctx context.Context) *ReportsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.insert" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsInsertCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "ID" - Sort by report ID. +// "LAST_MODIFIED_TIME" (default) - Sort by 'lastModifiedTime' field. +// "NAME" - Sort by name of reports. +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'. +// +// Possible values: +// "ASCENDING" - Ascending order. +// "DESCENDING" (default) - Descending order. +func (c *ReportsListCall) SortOrder(sortOrder string) *ReportsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsListCall) Fields(s ...googleapi.Field) *ReportsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsListCall) IfNoneMatch(entityTag string) *ReportsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsListCall) Context(ctx context.Context) *ReportsListCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.list" call. +// Exactly one of *ReportList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ReportList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReportsListCall) Do() (*ReportList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ReportList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsPatchCall) Fields(s ...googleapi.Field) *ReportsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsPatchCall) Context(ctx context.Context) *ReportsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.patch" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsPatchCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsRunCall) Fields(s ...googleapi.Field) *ReportsRunCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsRunCall) Context(ctx context.Context) *ReportsRunCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsRunCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["synchronous"]; ok { + params.Set("synchronous", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/run") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.run" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ReportsRunCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsUpdateCall) Fields(s ...googleapi.Field) *ReportsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsUpdateCall) Context(ctx context.Context) *ReportsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.update" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsUpdateCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsFilesGetCall) Fields(s ...googleapi.Field) *ReportsFilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsFilesGetCall) IfNoneMatch(entityTag string) *ReportsFilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsFilesGetCall) Context(ctx context.Context) *ReportsFilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsFilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files/{fileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + "fileId": strconv.FormatInt(c.fileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.files.get" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ReportsFilesGetCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "ID" - Sort by file ID. +// "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field. +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'. +// +// Possible values: +// "ASCENDING" - Ascending order. +// "DESCENDING" (default) - Descending order. +func (c *ReportsFilesListCall) SortOrder(sortOrder string) *ReportsFilesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsFilesListCall) Fields(s ...googleapi.Field) *ReportsFilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsFilesListCall) IfNoneMatch(entityTag string) *ReportsFilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsFilesListCall) Context(ctx context.Context) *ReportsFilesListCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsFilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.files.list" call. +// Exactly one of *FileList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *FileList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReportsFilesListCall) Do() (*FileList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FileList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserProfilesGetCall) Fields(s ...googleapi.Field) *UserProfilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserProfilesGetCall) IfNoneMatch(entityTag string) *UserProfilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserProfilesGetCall) Context(ctx context.Context) *UserProfilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *UserProfilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userProfiles.get" call. +// Exactly one of *UserProfile or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UserProfile.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserProfilesGetCall) Do() (*UserProfile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserProfile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserProfilesListCall) Fields(s ...googleapi.Field) *UserProfilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserProfilesListCall) IfNoneMatch(entityTag string) *UserProfilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserProfilesListCall) Context(ctx context.Context) *UserProfilesListCall { + c.ctx_ = ctx + return c +} + +func (c *UserProfilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userProfiles.list" call. +// Exactly one of *UserProfileList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UserProfileList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UserProfilesListCall) Do() (*UserProfileList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserProfileList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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/Godeps/_workspace/src/google.golang.org/api/dfareporting/v1.2/dfareporting-api.json b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v1.2/dfareporting-api.json new file mode 100644 index 000000000..f1e7eec48 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v1.2/dfareporting-api.json @@ -0,0 +1,1589 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/rEBgz8kDYnXeo29fy2HTElYO_nc\"", + "discoveryVersion": "v1", + "id": "dfareporting:v1.2", + "name": "dfareporting", + "version": "v1.2", + "revision": "20141112", + "title": "DFA Reporting API", + "description": "Lets you create, run and download reports.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/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/Godeps/_workspace/src/google.golang.org/api/dfareporting/v1.2/dfareporting-gen.go b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v1.2/dfareporting-gen.go new file mode 100644 index 000000000..a73ad0d60 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v1.2/dfareporting-gen.go @@ -0,0 +1,3437 @@ +// Package dfareporting provides access to the DFA Reporting API. +// +// See https://developers.google.com/doubleclick-advertisers/reporting/ +// +// Usage example: +// +// import "google.golang.org/api/dfareporting/v1.2" +// ... +// dfareportingService, err := dfareporting.New(oauthHttpClient) +package dfareporting // import "google.golang.org/api/dfareporting/v1.2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + DimensionValues *DimensionValuesService + + Files *FilesService + + Reports *ReportsService + + UserProfiles *UserProfilesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 +} + +// Activities: Represents an activity group. +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"` + + // ForceSendFields is a list of field names (e.g. "Filters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Activities) MarshalJSON() ([]byte, error) { + type noMethod Activities + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomRichMediaEvents: Represents a Custom Rich Media Events group. +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"` + + // ForceSendFields is a list of field names (e.g. "FilteredEventIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomRichMediaEvents) MarshalJSON() ([]byte, error) { + type noMethod CustomRichMediaEvents + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DateRange: Represents a date range. +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"` + + // ForceSendFields is a list of field names (e.g. "EndDate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DateRange) MarshalJSON() ([]byte, error) { + type noMethod DateRange + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionFilter: Represents a dimension filter. +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionFilter) MarshalJSON() ([]byte, error) { + type noMethod DimensionFilter + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionValue: Represents a DimensionValue resource. +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionValue) MarshalJSON() ([]byte, error) { + type noMethod DimensionValue + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionValueList: Represents the list of DimensionValue resources. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionValueList) MarshalJSON() ([]byte, error) { + type noMethod DimensionValueList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionValueRequest: Represents a DimensionValuesRequest. +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionValueRequest) MarshalJSON() ([]byte, error) { + type noMethod DimensionValueRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// File: 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". +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DateRange") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *File) MarshalJSON() ([]byte, error) { + type noMethod File + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FileUrls: The urls where the completed report file can be downloaded. +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"` + + // ForceSendFields is a list of field names (e.g. "ApiUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileUrls) MarshalJSON() ([]byte, error) { + type noMethod FileUrls + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FileList: Represents the list of File resources. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileList) MarshalJSON() ([]byte, error) { + type noMethod FileList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Recipient: Represents a recipient. +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"` + + // ForceSendFields is a list of field names (e.g. "DeliveryType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Recipient) MarshalJSON() ([]byte, error) { + type noMethod Recipient + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Report: Represents a Report resource. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Report) MarshalJSON() ([]byte, error) { + type noMethod Report + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportActiveGrpCriteria: The report criteria for a report of type +// "ACTIVE_GRP". +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"` + + // ForceSendFields is a list of field names (e.g. "DateRange") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportActiveGrpCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportActiveGrpCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportCriteria: The report criteria for a report of type "STANDARD". +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"` + + // ForceSendFields is a list of field names (e.g. "Activities") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportCrossDimensionReachCriteria: The report criteria for a report +// of type "CROSS_DIMENSION_REACH". +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"` + + // ForceSendFields is a list of field names (e.g. "Breakdown") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportCrossDimensionReachCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportCrossDimensionReachCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportDelivery: The report's email delivery settings. +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"` + + // ForceSendFields is a list of field names (e.g. "EmailOwner") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportDelivery) MarshalJSON() ([]byte, error) { + type noMethod ReportDelivery + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportFloodlightCriteria: The report criteria for a report of type +// "FLOODLIGHT". +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"` + + // ForceSendFields is a list of field names (e.g. "DateRange") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportFloodlightCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportFloodlightCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportFloodlightCriteriaReportProperties: The properties of the +// report. +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"` + + // ForceSendFields is a list of field names (e.g. + // "IncludeAttributedIPConversions") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportFloodlightCriteriaReportProperties) MarshalJSON() ([]byte, error) { + type noMethod ReportFloodlightCriteriaReportProperties + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportPathToConversionCriteria: The report criteria for a report of +// type "PATH_TO_CONVERSION". +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"` + + // ForceSendFields is a list of field names (e.g. "ActivityFilters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportPathToConversionCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportPathToConversionCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportPathToConversionCriteriaReportProperties: The properties of the +// report. +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"` + + // ForceSendFields is a list of field names (e.g. + // "ClicksLookbackWindow") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportPathToConversionCriteriaReportProperties) MarshalJSON() ([]byte, error) { + type noMethod ReportPathToConversionCriteriaReportProperties + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportReachCriteria: The report criteria for a report of type +// "REACH". +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"` + + // ForceSendFields is a list of field names (e.g. "Activities") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportReachCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportReachCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportSchedule: 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". +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"` + + // ForceSendFields is a list of field names (e.g. "Active") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportSchedule) MarshalJSON() ([]byte, error) { + type noMethod ReportSchedule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportList: Represents the list of reports. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportList) MarshalJSON() ([]byte, error) { + type noMethod ReportList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SortedDimension: Represents a sorted dimension. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SortedDimension) MarshalJSON() ([]byte, error) { + type noMethod SortedDimension + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserProfile: Represents a UserProfile resource. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserProfile) MarshalJSON() ([]byte, error) { + type noMethod UserProfile + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserProfileList: Represents the list of user profiles. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserProfileList) MarshalJSON() ([]byte, error) { + type noMethod UserProfileList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "dfareporting.dimensionValues.query": + +type DimensionValuesQueryCall struct { + s *Service + profileId int64 + dimensionvaluerequest *DimensionValueRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DimensionValuesQueryCall) Fields(s ...googleapi.Field) *DimensionValuesQueryCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DimensionValuesQueryCall) Context(ctx context.Context) *DimensionValuesQueryCall { + c.ctx_ = ctx + return c +} + +func (c *DimensionValuesQueryCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dimensionvalues/query") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.dimensionValues.query" call. +// Exactly one of *DimensionValueList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DimensionValueList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DimensionValuesQueryCall) Do() (*DimensionValueList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DimensionValueList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FilesGetCall) IfNoneMatch(entityTag string) *FilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FilesGetCall) Context(ctx context.Context) *FilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *FilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{reportId}/files/{fileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "reportId": strconv.FormatInt(c.reportId, 10), + "fileId": strconv.FormatInt(c.fileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *FilesGetCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "dfareporting.files.get" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FilesGetCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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'. +// +// Possible values: +// "ALL" - All files in account. +// "MINE" (default) - My files. +// "SHARED_WITH_ME" - Files shared with me. +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. +// +// Possible values: +// "ID" - Sort by file ID. +// "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field. +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'. +// +// Possible values: +// "ASCENDING" - Ascending order. +// "DESCENDING" (default) - Descending order. +func (c *FilesListCall) SortOrder(sortOrder string) *FilesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FilesListCall) Context(ctx context.Context) *FilesListCall { + c.ctx_ = ctx + return c +} + +func (c *FilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/files") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.files.list" call. +// Exactly one of *FileList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *FileList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FilesListCall) Do() (*FileList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FileList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsDeleteCall) Fields(s ...googleapi.Field) *ReportsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsDeleteCall) Context(ctx context.Context) *ReportsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.delete" call. +func (c *ReportsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsGetCall) Fields(s ...googleapi.Field) *ReportsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsGetCall) IfNoneMatch(entityTag string) *ReportsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsGetCall) Context(ctx context.Context) *ReportsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.get" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsGetCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsInsertCall) Fields(s ...googleapi.Field) *ReportsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsInsertCall) Context(ctx context.Context) *ReportsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.insert" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsInsertCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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'. +// +// Possible values: +// "ALL" - All reports in account. +// "MINE" (default) - My reports. +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. +// +// Possible values: +// "ID" - Sort by report ID. +// "LAST_MODIFIED_TIME" (default) - Sort by 'lastModifiedTime' field. +// "NAME" - Sort by name of reports. +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'. +// +// Possible values: +// "ASCENDING" - Ascending order. +// "DESCENDING" (default) - Descending order. +func (c *ReportsListCall) SortOrder(sortOrder string) *ReportsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsListCall) Fields(s ...googleapi.Field) *ReportsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsListCall) IfNoneMatch(entityTag string) *ReportsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsListCall) Context(ctx context.Context) *ReportsListCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.list" call. +// Exactly one of *ReportList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ReportList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReportsListCall) Do() (*ReportList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ReportList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsPatchCall) Fields(s ...googleapi.Field) *ReportsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsPatchCall) Context(ctx context.Context) *ReportsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.patch" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsPatchCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsRunCall) Fields(s ...googleapi.Field) *ReportsRunCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsRunCall) Context(ctx context.Context) *ReportsRunCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsRunCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["synchronous"]; ok { + params.Set("synchronous", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/run") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.run" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ReportsRunCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsUpdateCall) Fields(s ...googleapi.Field) *ReportsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsUpdateCall) Context(ctx context.Context) *ReportsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.update" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsUpdateCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsFilesGetCall) Fields(s ...googleapi.Field) *ReportsFilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsFilesGetCall) IfNoneMatch(entityTag string) *ReportsFilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsFilesGetCall) Context(ctx context.Context) *ReportsFilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsFilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files/{fileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + "fileId": strconv.FormatInt(c.fileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *ReportsFilesGetCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "dfareporting.reports.files.get" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ReportsFilesGetCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "ID" - Sort by file ID. +// "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field. +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'. +// +// Possible values: +// "ASCENDING" - Ascending order. +// "DESCENDING" (default) - Descending order. +func (c *ReportsFilesListCall) SortOrder(sortOrder string) *ReportsFilesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsFilesListCall) Fields(s ...googleapi.Field) *ReportsFilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsFilesListCall) IfNoneMatch(entityTag string) *ReportsFilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsFilesListCall) Context(ctx context.Context) *ReportsFilesListCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsFilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.files.list" call. +// Exactly one of *FileList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *FileList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReportsFilesListCall) Do() (*FileList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FileList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserProfilesGetCall) Fields(s ...googleapi.Field) *UserProfilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserProfilesGetCall) IfNoneMatch(entityTag string) *UserProfilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserProfilesGetCall) Context(ctx context.Context) *UserProfilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *UserProfilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userProfiles.get" call. +// Exactly one of *UserProfile or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UserProfile.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserProfilesGetCall) Do() (*UserProfile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserProfile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserProfilesListCall) Fields(s ...googleapi.Field) *UserProfilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserProfilesListCall) IfNoneMatch(entityTag string) *UserProfilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserProfilesListCall) Context(ctx context.Context) *UserProfilesListCall { + c.ctx_ = ctx + return c +} + +func (c *UserProfilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userProfiles.list" call. +// Exactly one of *UserProfileList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UserProfileList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UserProfilesListCall) Do() (*UserProfileList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserProfileList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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/Godeps/_workspace/src/google.golang.org/api/dfareporting/v1.3/dfareporting-api.json b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v1.3/dfareporting-api.json new file mode 100644 index 000000000..f155481de --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v1.3/dfareporting-api.json @@ -0,0 +1,1913 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/_NHVgXxsnh4iZLUQivabzFT84as\"", + "discoveryVersion": "v1", + "id": "dfareporting:v1.3", + "name": "dfareporting", + "version": "v1.3", + "revision": "20141112", + "title": "DFA Reporting API", + "description": "Lets you create, run and download reports.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/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/Godeps/_workspace/src/google.golang.org/api/dfareporting/v1.3/dfareporting-gen.go b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v1.3/dfareporting-gen.go new file mode 100644 index 000000000..3910be93c --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v1.3/dfareporting-gen.go @@ -0,0 +1,3875 @@ +// Package dfareporting provides access to the DFA Reporting API. +// +// See https://developers.google.com/doubleclick-advertisers/reporting/ +// +// Usage example: +// +// import "google.golang.org/api/dfareporting/v1.3" +// ... +// dfareportingService, err := dfareporting.New(oauthHttpClient) +package dfareporting // import "google.golang.org/api/dfareporting/v1.3" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + DimensionValues *DimensionValuesService + + Files *FilesService + + Reports *ReportsService + + UserProfiles *UserProfilesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 +} + +// Activities: Represents an activity group. +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"` + + // ForceSendFields is a list of field names (e.g. "Filters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Activities) MarshalJSON() ([]byte, error) { + type noMethod Activities + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CompatibleFields: Represents a response to the queryCompatibleFields +// method. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "CrossDimensionReachReportCompatibleFields") to unconditionally + // include in API requests. By default, fields with empty values are + // omitted from API requests. However, any non-pointer, non-interface + // field appearing in ForceSendFields will be sent to the server + // regardless of whether the field is empty or not. This may be used to + // include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CompatibleFields) MarshalJSON() ([]byte, error) { + type noMethod CompatibleFields + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CrossDimensionReachReportCompatibleFields: Represents fields that are +// compatible to be selected for a report of type +// "CROSS_DIMENSION_REACH". +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"` + + // ForceSendFields is a list of field names (e.g. "Breakdown") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CrossDimensionReachReportCompatibleFields) MarshalJSON() ([]byte, error) { + type noMethod CrossDimensionReachReportCompatibleFields + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomRichMediaEvents: Represents a Custom Rich Media Events group. +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"` + + // ForceSendFields is a list of field names (e.g. "FilteredEventIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomRichMediaEvents) MarshalJSON() ([]byte, error) { + type noMethod CustomRichMediaEvents + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DateRange: Represents a date range. +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"` + + // ForceSendFields is a list of field names (e.g. "EndDate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DateRange) MarshalJSON() ([]byte, error) { + type noMethod DateRange + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Dimension: Represents a dimension. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Dimension) MarshalJSON() ([]byte, error) { + type noMethod Dimension + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionFilter: Represents a dimension filter. +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionFilter) MarshalJSON() ([]byte, error) { + type noMethod DimensionFilter + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionValue: Represents a DimensionValue resource. +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionValue) MarshalJSON() ([]byte, error) { + type noMethod DimensionValue + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionValueList: Represents the list of DimensionValue resources. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionValueList) MarshalJSON() ([]byte, error) { + type noMethod DimensionValueList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionValueRequest: Represents a DimensionValuesRequest. +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionValueRequest) MarshalJSON() ([]byte, error) { + type noMethod DimensionValueRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// File: 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". +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DateRange") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *File) MarshalJSON() ([]byte, error) { + type noMethod File + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FileUrls: The urls where the completed report file can be downloaded. +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"` + + // ForceSendFields is a list of field names (e.g. "ApiUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileUrls) MarshalJSON() ([]byte, error) { + type noMethod FileUrls + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FileList: Represents the list of File resources. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileList) MarshalJSON() ([]byte, error) { + type noMethod FileList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightReportCompatibleFields: Represents fields that are +// compatible to be selected for a report of type "FlOODLIGHT". +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionFilters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightReportCompatibleFields) MarshalJSON() ([]byte, error) { + type noMethod FloodlightReportCompatibleFields + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Metric: Represents a metric. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Metric) MarshalJSON() ([]byte, error) { + type noMethod Metric + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PathToConversionReportCompatibleFields: Represents fields that are +// compatible to be selected for a report of type "PATH_TO_CONVERSION". +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"` + + // ForceSendFields is a list of field names (e.g. + // "ConversionDimensions") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PathToConversionReportCompatibleFields) MarshalJSON() ([]byte, error) { + type noMethod PathToConversionReportCompatibleFields + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReachReportCompatibleFields: Represents fields that are compatible to +// be selected for a report of type "REACH". +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionFilters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReachReportCompatibleFields) MarshalJSON() ([]byte, error) { + type noMethod ReachReportCompatibleFields + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Recipient: Represents a recipient. +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"` + + // ForceSendFields is a list of field names (e.g. "DeliveryType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Recipient) MarshalJSON() ([]byte, error) { + type noMethod Recipient + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Report: Represents a Report resource. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Report) MarshalJSON() ([]byte, error) { + type noMethod Report + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportActiveGrpCriteria: The report criteria for a report of type +// "ACTIVE_GRP". +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"` + + // ForceSendFields is a list of field names (e.g. "DateRange") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportActiveGrpCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportActiveGrpCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportCriteria: The report criteria for a report of type "STANDARD". +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"` + + // ForceSendFields is a list of field names (e.g. "Activities") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportCrossDimensionReachCriteria: The report criteria for a report +// of type "CROSS_DIMENSION_REACH". +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"` + + // ForceSendFields is a list of field names (e.g. "Breakdown") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportCrossDimensionReachCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportCrossDimensionReachCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportDelivery: The report's email delivery settings. +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"` + + // ForceSendFields is a list of field names (e.g. "EmailOwner") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportDelivery) MarshalJSON() ([]byte, error) { + type noMethod ReportDelivery + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportFloodlightCriteria: The report criteria for a report of type +// "FLOODLIGHT". +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"` + + // ForceSendFields is a list of field names (e.g. + // "CustomRichMediaEvents") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportFloodlightCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportFloodlightCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportFloodlightCriteriaReportProperties: The properties of the +// report. +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"` + + // ForceSendFields is a list of field names (e.g. + // "IncludeAttributedIPConversions") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportFloodlightCriteriaReportProperties) MarshalJSON() ([]byte, error) { + type noMethod ReportFloodlightCriteriaReportProperties + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportPathToConversionCriteria: The report criteria for a report of +// type "PATH_TO_CONVERSION". +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"` + + // ForceSendFields is a list of field names (e.g. "ActivityFilters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportPathToConversionCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportPathToConversionCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportPathToConversionCriteriaReportProperties: The properties of the +// report. +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"` + + // ForceSendFields is a list of field names (e.g. + // "ClicksLookbackWindow") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportPathToConversionCriteriaReportProperties) MarshalJSON() ([]byte, error) { + type noMethod ReportPathToConversionCriteriaReportProperties + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportReachCriteria: The report criteria for a report of type +// "REACH". +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"` + + // ForceSendFields is a list of field names (e.g. "Activities") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportReachCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportReachCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportSchedule: 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". +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"` + + // ForceSendFields is a list of field names (e.g. "Active") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportSchedule) MarshalJSON() ([]byte, error) { + type noMethod ReportSchedule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportCompatibleFields: Represents fields that are compatible to be +// selected for a report of type "STANDARD". +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionFilters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportCompatibleFields) MarshalJSON() ([]byte, error) { + type noMethod ReportCompatibleFields + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportList: Represents the list of reports. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportList) MarshalJSON() ([]byte, error) { + type noMethod ReportList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SortedDimension: Represents a sorted dimension. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SortedDimension) MarshalJSON() ([]byte, error) { + type noMethod SortedDimension + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserProfile: Represents a UserProfile resource. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserProfile) MarshalJSON() ([]byte, error) { + type noMethod UserProfile + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserProfileList: Represents the list of user profiles. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserProfileList) MarshalJSON() ([]byte, error) { + type noMethod UserProfileList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "dfareporting.dimensionValues.query": + +type DimensionValuesQueryCall struct { + s *Service + profileId int64 + dimensionvaluerequest *DimensionValueRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DimensionValuesQueryCall) Fields(s ...googleapi.Field) *DimensionValuesQueryCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DimensionValuesQueryCall) Context(ctx context.Context) *DimensionValuesQueryCall { + c.ctx_ = ctx + return c +} + +func (c *DimensionValuesQueryCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dimensionvalues/query") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.dimensionValues.query" call. +// Exactly one of *DimensionValueList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DimensionValueList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DimensionValuesQueryCall) Do() (*DimensionValueList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DimensionValueList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FilesGetCall) IfNoneMatch(entityTag string) *FilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FilesGetCall) Context(ctx context.Context) *FilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *FilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{reportId}/files/{fileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "reportId": strconv.FormatInt(c.reportId, 10), + "fileId": strconv.FormatInt(c.fileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *FilesGetCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "dfareporting.files.get" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FilesGetCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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'. +// +// Possible values: +// "ALL" - All files in account. +// "MINE" (default) - My files. +// "SHARED_WITH_ME" - Files shared with me. +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. +// +// Possible values: +// "ID" - Sort by file ID. +// "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field. +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'. +// +// Possible values: +// "ASCENDING" - Ascending order. +// "DESCENDING" (default) - Descending order. +func (c *FilesListCall) SortOrder(sortOrder string) *FilesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FilesListCall) Context(ctx context.Context) *FilesListCall { + c.ctx_ = ctx + return c +} + +func (c *FilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/files") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.files.list" call. +// Exactly one of *FileList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *FileList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FilesListCall) Do() (*FileList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FileList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsDeleteCall) Fields(s ...googleapi.Field) *ReportsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsDeleteCall) Context(ctx context.Context) *ReportsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.delete" call. +func (c *ReportsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsGetCall) Fields(s ...googleapi.Field) *ReportsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsGetCall) IfNoneMatch(entityTag string) *ReportsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsGetCall) Context(ctx context.Context) *ReportsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.get" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsGetCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsInsertCall) Fields(s ...googleapi.Field) *ReportsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsInsertCall) Context(ctx context.Context) *ReportsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.insert" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsInsertCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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'. +// +// Possible values: +// "ALL" - All reports in account. +// "MINE" (default) - My reports. +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. +// +// Possible values: +// "ID" - Sort by report ID. +// "LAST_MODIFIED_TIME" (default) - Sort by 'lastModifiedTime' field. +// "NAME" - Sort by name of reports. +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'. +// +// Possible values: +// "ASCENDING" - Ascending order. +// "DESCENDING" (default) - Descending order. +func (c *ReportsListCall) SortOrder(sortOrder string) *ReportsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsListCall) Fields(s ...googleapi.Field) *ReportsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsListCall) IfNoneMatch(entityTag string) *ReportsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsListCall) Context(ctx context.Context) *ReportsListCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.list" call. +// Exactly one of *ReportList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ReportList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReportsListCall) Do() (*ReportList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ReportList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsPatchCall) Fields(s ...googleapi.Field) *ReportsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsPatchCall) Context(ctx context.Context) *ReportsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.patch" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsPatchCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsRunCall) Fields(s ...googleapi.Field) *ReportsRunCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsRunCall) Context(ctx context.Context) *ReportsRunCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsRunCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["synchronous"]; ok { + params.Set("synchronous", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/run") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.run" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ReportsRunCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsUpdateCall) Fields(s ...googleapi.Field) *ReportsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsUpdateCall) Context(ctx context.Context) *ReportsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.update" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsUpdateCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsCompatibleFieldsQueryCall) Fields(s ...googleapi.Field) *ReportsCompatibleFieldsQueryCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsCompatibleFieldsQueryCall) Context(ctx context.Context) *ReportsCompatibleFieldsQueryCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsCompatibleFieldsQueryCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/compatiblefields/query") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.compatibleFields.query" call. +// Exactly one of *CompatibleFields or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CompatibleFields.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReportsCompatibleFieldsQueryCall) Do() (*CompatibleFields, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CompatibleFields{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsFilesGetCall) Fields(s ...googleapi.Field) *ReportsFilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsFilesGetCall) IfNoneMatch(entityTag string) *ReportsFilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsFilesGetCall) Context(ctx context.Context) *ReportsFilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsFilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files/{fileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + "fileId": strconv.FormatInt(c.fileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *ReportsFilesGetCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "dfareporting.reports.files.get" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ReportsFilesGetCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "ID" - Sort by file ID. +// "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field. +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'. +// +// Possible values: +// "ASCENDING" - Ascending order. +// "DESCENDING" (default) - Descending order. +func (c *ReportsFilesListCall) SortOrder(sortOrder string) *ReportsFilesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsFilesListCall) Fields(s ...googleapi.Field) *ReportsFilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsFilesListCall) IfNoneMatch(entityTag string) *ReportsFilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsFilesListCall) Context(ctx context.Context) *ReportsFilesListCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsFilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.files.list" call. +// Exactly one of *FileList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *FileList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReportsFilesListCall) Do() (*FileList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FileList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserProfilesGetCall) Fields(s ...googleapi.Field) *UserProfilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserProfilesGetCall) IfNoneMatch(entityTag string) *UserProfilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserProfilesGetCall) Context(ctx context.Context) *UserProfilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *UserProfilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userProfiles.get" call. +// Exactly one of *UserProfile or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UserProfile.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserProfilesGetCall) Do() (*UserProfile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserProfile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserProfilesListCall) Fields(s ...googleapi.Field) *UserProfilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserProfilesListCall) IfNoneMatch(entityTag string) *UserProfilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserProfilesListCall) Context(ctx context.Context) *UserProfilesListCall { + c.ctx_ = ctx + return c +} + +func (c *UserProfilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userProfiles.list" call. +// Exactly one of *UserProfileList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UserProfileList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UserProfilesListCall) Do() (*UserProfileList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserProfileList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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/Godeps/_workspace/src/google.golang.org/api/dfareporting/v1/dfareporting-api.json b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v1/dfareporting-api.json new file mode 100644 index 000000000..1956f0e95 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v1/dfareporting-api.json @@ -0,0 +1,1172 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/MbpeaEJOniwFpvXZcTkgWQ9h6fo\"", + "discoveryVersion": "v1", + "id": "dfareporting:v1", + "name": "dfareporting", + "version": "v1", + "revision": "20141112", + "title": "DFA Reporting API", + "description": "Lets you create, run and download reports.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/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/Godeps/_workspace/src/google.golang.org/api/dfareporting/v1/dfareporting-gen.go b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v1/dfareporting-gen.go new file mode 100644 index 000000000..54884a67d --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v1/dfareporting-gen.go @@ -0,0 +1,2806 @@ +// Package dfareporting provides access to the DFA Reporting API. +// +// See https://developers.google.com/doubleclick-advertisers/reporting/ +// +// Usage example: +// +// import "google.golang.org/api/dfareporting/v1" +// ... +// dfareportingService, err := dfareporting.New(oauthHttpClient) +package dfareporting // import "google.golang.org/api/dfareporting/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + DimensionValues *DimensionValuesService + + Files *FilesService + + Reports *ReportsService + + UserProfiles *UserProfilesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 +} + +// DimensionFilter: Represents a dimension filter. +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionFilter) MarshalJSON() ([]byte, error) { + type noMethod DimensionFilter + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionValue: Represents a DimensionValue resource. +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionValue) MarshalJSON() ([]byte, error) { + type noMethod DimensionValue + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionValueList: Represents the list of DimensionValue resources. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionValueList) MarshalJSON() ([]byte, error) { + type noMethod DimensionValueList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionValueRequest: Represents a DimensionValuesRequest. +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionValueRequest) MarshalJSON() ([]byte, error) { + type noMethod DimensionValueRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// File: 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". +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DateRange") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *File) MarshalJSON() ([]byte, error) { + type noMethod File + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FileDateRange: The date range for which the file has report data. +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"` + + // ForceSendFields is a list of field names (e.g. "EndDate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileDateRange) MarshalJSON() ([]byte, error) { + type noMethod FileDateRange + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FileUrls: The urls where the completed report file can be downloaded. +type FileUrls struct { + // Csv: Urls for generated CSV data. + Csv *FileUrlsCsv `json:"csv,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Csv") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileUrls) MarshalJSON() ([]byte, error) { + type noMethod FileUrls + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FileUrlsCsv: Urls for generated CSV data. +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"` + + // ForceSendFields is a list of field names (e.g. "ApiUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileUrlsCsv) MarshalJSON() ([]byte, error) { + type noMethod FileUrlsCsv + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FileList: Represents the list of File resources. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileList) MarshalJSON() ([]byte, error) { + type noMethod FileList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Report: Represents a Report resource. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Report) MarshalJSON() ([]byte, error) { + type noMethod Report + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportCriteria: The report criteria. +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"` + + // ForceSendFields is a list of field names (e.g. "Activities") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportCriteriaActivities: Activity group. +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"` + + // ForceSendFields is a list of field names (e.g. "Filters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportCriteriaActivities) MarshalJSON() ([]byte, error) { + type noMethod ReportCriteriaActivities + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportCriteriaCustomRichMediaEvents: Custom Rich Media Events group. +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"` + + // ForceSendFields is a list of field names (e.g. "FilteredEventIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportCriteriaCustomRichMediaEvents) MarshalJSON() ([]byte, error) { + type noMethod ReportCriteriaCustomRichMediaEvents + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportCriteriaDateRange: The date range this report should be run +// for. +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"` + + // ForceSendFields is a list of field names (e.g. "EndDate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportCriteriaDateRange) MarshalJSON() ([]byte, error) { + type noMethod ReportCriteriaDateRange + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportSchedule: 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". +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"` + + // ForceSendFields is a list of field names (e.g. "Active") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportSchedule) MarshalJSON() ([]byte, error) { + type noMethod ReportSchedule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportList: Represents the list of reports. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportList) MarshalJSON() ([]byte, error) { + type noMethod ReportList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SortedDimension: Represents a sorted dimension. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SortedDimension) MarshalJSON() ([]byte, error) { + type noMethod SortedDimension + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserProfile: Represents a UserProfile resource. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserProfile) MarshalJSON() ([]byte, error) { + type noMethod UserProfile + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserProfileList: Represents the list of user profiles. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserProfileList) MarshalJSON() ([]byte, error) { + type noMethod UserProfileList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "dfareporting.dimensionValues.query": + +type DimensionValuesQueryCall struct { + s *Service + profileId int64 + dimensionvaluerequest *DimensionValueRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DimensionValuesQueryCall) Fields(s ...googleapi.Field) *DimensionValuesQueryCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DimensionValuesQueryCall) Context(ctx context.Context) *DimensionValuesQueryCall { + c.ctx_ = ctx + return c +} + +func (c *DimensionValuesQueryCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dimensionvalues/query") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.dimensionValues.query" call. +// Exactly one of *DimensionValueList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DimensionValueList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DimensionValuesQueryCall) Do() (*DimensionValueList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DimensionValueList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "ID" - Sort by file id. +// "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field. +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'. +// +// Possible values: +// "ASCENDING" - Ascending order. +// "DESCENDING" (default) - Descending order. +func (c *FilesListCall) SortOrder(sortOrder string) *FilesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FilesListCall) Context(ctx context.Context) *FilesListCall { + c.ctx_ = ctx + return c +} + +func (c *FilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/files") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.files.list" call. +// Exactly one of *FileList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *FileList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FilesListCall) Do() (*FileList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FileList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsDeleteCall) Fields(s ...googleapi.Field) *ReportsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsDeleteCall) Context(ctx context.Context) *ReportsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.delete" call. +func (c *ReportsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsGetCall) Fields(s ...googleapi.Field) *ReportsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsGetCall) IfNoneMatch(entityTag string) *ReportsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsGetCall) Context(ctx context.Context) *ReportsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.get" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsGetCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsInsertCall) Fields(s ...googleapi.Field) *ReportsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsInsertCall) Context(ctx context.Context) *ReportsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.insert" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsInsertCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "ID" - Sort by report id. +// "LAST_MODIFIED_TIME" (default) - Sort by 'lastModifiedTime' field. +// "NAME" - Sort by display name of reports. +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'. +// +// Possible values: +// "ASCENDING" - Ascending order. +// "DESCENDING" (default) - Descending order. +func (c *ReportsListCall) SortOrder(sortOrder string) *ReportsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsListCall) Fields(s ...googleapi.Field) *ReportsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsListCall) IfNoneMatch(entityTag string) *ReportsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsListCall) Context(ctx context.Context) *ReportsListCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.list" call. +// Exactly one of *ReportList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ReportList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReportsListCall) Do() (*ReportList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ReportList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsPatchCall) Fields(s ...googleapi.Field) *ReportsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsPatchCall) Context(ctx context.Context) *ReportsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.patch" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsPatchCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsRunCall) Fields(s ...googleapi.Field) *ReportsRunCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsRunCall) Context(ctx context.Context) *ReportsRunCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsRunCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["synchronous"]; ok { + params.Set("synchronous", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/run") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.run" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ReportsRunCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsUpdateCall) Fields(s ...googleapi.Field) *ReportsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsUpdateCall) Context(ctx context.Context) *ReportsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.update" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsUpdateCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsFilesGetCall) Fields(s ...googleapi.Field) *ReportsFilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsFilesGetCall) IfNoneMatch(entityTag string) *ReportsFilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsFilesGetCall) Context(ctx context.Context) *ReportsFilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsFilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files/{fileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + "fileId": strconv.FormatInt(c.fileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.files.get" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ReportsFilesGetCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "ID" - Sort by file id. +// "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field. +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'. +// +// Possible values: +// "ASCENDING" - Ascending order. +// "DESCENDING" (default) - Descending order. +func (c *ReportsFilesListCall) SortOrder(sortOrder string) *ReportsFilesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsFilesListCall) Fields(s ...googleapi.Field) *ReportsFilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsFilesListCall) IfNoneMatch(entityTag string) *ReportsFilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsFilesListCall) Context(ctx context.Context) *ReportsFilesListCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsFilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.files.list" call. +// Exactly one of *FileList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *FileList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReportsFilesListCall) Do() (*FileList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FileList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserProfilesGetCall) Fields(s ...googleapi.Field) *UserProfilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserProfilesGetCall) IfNoneMatch(entityTag string) *UserProfilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserProfilesGetCall) Context(ctx context.Context) *UserProfilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *UserProfilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userProfiles.get" call. +// Exactly one of *UserProfile or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UserProfile.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserProfilesGetCall) Do() (*UserProfile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserProfile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserProfilesListCall) Fields(s ...googleapi.Field) *UserProfilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserProfilesListCall) IfNoneMatch(entityTag string) *UserProfilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserProfilesListCall) Context(ctx context.Context) *UserProfilesListCall { + c.ctx_ = ctx + return c +} + +func (c *UserProfilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userProfiles.list" call. +// Exactly one of *UserProfileList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UserProfileList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UserProfilesListCall) Do() (*UserProfileList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserProfileList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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/Godeps/_workspace/src/google.golang.org/api/dfareporting/v2.0/dfareporting-api.json b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v2.0/dfareporting-api.json new file mode 100644 index 000000000..90e9bb972 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v2.0/dfareporting-api.json @@ -0,0 +1,15333 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/hsqpr9X90U7kI0NDFJRw_wW8z3w\"", + "discoveryVersion": "v1", + "id": "dfareporting:v2.0", + "name": "dfareporting", + "version": "v2.0", + "revision": "20150717", + "title": "DCM/DFA Reporting And Trafficking API", + "description": "Manage your DoubleClick Campaign Manager ad campaigns and reports.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/doubleclick-advertisers/reporting/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/dfareporting/v2.0/", + "basePath": "/dfareporting/v2.0/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "dfareporting/v2.0/", + "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" + }, + "https://www.googleapis.com/auth/dfatrafficking": { + "description": "View and manage your DoubleClick Campaign Manager's (DCM) display ad campaigns" + } + } + } + }, + "schemas": { + "Account": { + "id": "Account", + "type": "object", + "description": "Contains properties of a DCM account.", + "properties": { + "accountPermissionIds": { + "type": "array", + "description": "Account permissions assigned to this account.", + "items": { + "type": "string", + "format": "int64" + } + }, + "accountProfile": { + "type": "string", + "description": "Profile for this account. This is a read-only field that can be left blank.", + "enum": [ + "ACCOUNT_PROFILE_BASIC", + "ACCOUNT_PROFILE_STANDARD" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "active": { + "type": "boolean", + "description": "Whether this account is active." + }, + "activeAdsLimitTier": { + "type": "string", + "description": "Maximum number of active ads allowed for this account.", + "enum": [ + "ACTIVE_ADS_TIER_100K", + "ACTIVE_ADS_TIER_200K", + "ACTIVE_ADS_TIER_300K", + "ACTIVE_ADS_TIER_40K", + "ACTIVE_ADS_TIER_75K" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "activeViewOptOut": { + "type": "boolean", + "description": "Whether to serve creatives with Active View tags. If disabled, viewability data will not be available for any impressions." + }, + "availablePermissionIds": { + "type": "array", + "description": "User role permissions available to the user roles of this account.", + "items": { + "type": "string", + "format": "int64" + } + }, + "comscoreVceEnabled": { + "type": "boolean", + "description": "Whether campaigns created in this account will be enabled for comScore vCE by default." + }, + "countryId": { + "type": "string", + "description": "ID of the country associated with this account.", + "format": "int64" + }, + "currencyId": { + "type": "string", + "description": "ID of currency associated with this account. This is a required field.\nAcceptable values are: \n- \"1\" for USD \n- \"2\" for GBP \n- \"3\" for ESP \n- \"4\" for SEK \n- \"5\" for CAD \n- \"6\" for JPY \n- \"7\" for DEM \n- \"8\" for AUD \n- \"9\" for FRF \n- \"10\" for ITL \n- \"11\" for DKK \n- \"12\" for NOK \n- \"13\" for FIM \n- \"14\" for ZAR \n- \"15\" for IEP \n- \"16\" for NLG \n- \"17\" for EUR \n- \"18\" for KRW \n- \"19\" for TWD \n- \"20\" for SGD \n- \"21\" for CNY \n- \"22\" for HKD \n- \"23\" for NZD \n- \"24\" for MYR \n- \"25\" for BRL \n- \"26\" for PTE \n- \"27\" for MXP \n- \"28\" for CLP \n- \"29\" for TRY \n- \"30\" for ARS \n- \"31\" for PEN \n- \"32\" for ILS \n- \"33\" for CHF \n- \"34\" for VEF \n- \"35\" for COP \n- \"36\" for GTQ", + "format": "int64" + }, + "defaultCreativeSizeId": { + "type": "string", + "description": "Default placement dimensions for this account.", + "format": "int64" + }, + "description": { + "type": "string", + "description": "Description of this account." + }, + "id": { + "type": "string", + "description": "ID of this account. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#account\".", + "default": "dfareporting#account" + }, + "locale": { + "type": "string", + "description": "Locale of this account.\nAcceptable values are: \n- \"cs\" (Czech) \n- \"de\" (German) \n- \"en\" (English) \n- \"en-GB\" (English United Kingdom) \n- \"es\" (Spanish) \n- \"fr\" (French) \n- \"it\" (Italian) \n- \"ja\" (Japanese) \n- \"ko\" (Korean) \n- \"pl\" (Polish) \n- \"pt-BR\" (Portuguese Brazil) \n- \"ru\" (Russian) \n- \"sv\" (Swedish) \n- \"tr\" (Turkish) \n- \"zh-CN\" (Chinese Simplified) \n- \"zh-TW\" (Chinese Traditional)" + }, + "maximumImageSize": { + "type": "string", + "description": "Maximum image size allowed for this account.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this account. This is a required field, and must be less than 128 characters long and be globally unique." + }, + "nielsenOcrEnabled": { + "type": "boolean", + "description": "Whether campaigns created in this account will be enabled for Nielsen OCR reach ratings by default." + }, + "reportsConfiguration": { + "$ref": "ReportsConfiguration", + "description": "Reporting configuration of this account." + }, + "teaserSizeLimit": { + "type": "string", + "description": "File size limit in kilobytes of Rich Media teaser creatives. Must be between 1 and 10240.", + "format": "int64" + } + } + }, + "AccountActiveAdSummary": { + "id": "AccountActiveAdSummary", + "type": "object", + "description": "Gets a summary of active ads in an account.", + "properties": { + "accountId": { + "type": "string", + "description": "ID of the account.", + "format": "int64" + }, + "activeAds": { + "type": "string", + "description": "Ads that have been activated for the account", + "format": "int64" + }, + "activeAdsLimitTier": { + "type": "string", + "description": "Maximum number of active ads allowed for the account.", + "enum": [ + "ACTIVE_ADS_TIER_100K", + "ACTIVE_ADS_TIER_200K", + "ACTIVE_ADS_TIER_300K", + "ACTIVE_ADS_TIER_40K", + "ACTIVE_ADS_TIER_75K" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "availableAds": { + "type": "string", + "description": "Ads that can be activated for the account.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountActiveAdSummary\".", + "default": "dfareporting#accountActiveAdSummary" + } + } + }, + "AccountPermission": { + "id": "AccountPermission", + "type": "object", + "description": "AccountPermissions contains information about a particular account permission. Some features of DCM require an account permission to be present in the account.", + "properties": { + "accountProfiles": { + "type": "array", + "description": "Account profiles associated with this account permission.\n\nPossible values are:\n- \"ACCOUNT_PROFILE_BASIC\"\n- \"ACCOUNT_PROFILE_STANDARD\"", + "items": { + "type": "string", + "enum": [ + "ACCOUNT_PROFILE_BASIC", + "ACCOUNT_PROFILE_STANDARD" + ], + "enumDescriptions": [ + "", + "" + ] + } + }, + "id": { + "type": "string", + "description": "ID of this account permission.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountPermission\".", + "default": "dfareporting#accountPermission" + }, + "level": { + "type": "string", + "description": "Administrative level required to enable this account permission.", + "enum": [ + "ADMINISTRATOR", + "USER" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "name": { + "type": "string", + "description": "Name of this account permission." + }, + "permissionGroupId": { + "type": "string", + "description": "Permission group of this account permission.", + "format": "int64" + } + } + }, + "AccountPermissionGroup": { + "id": "AccountPermissionGroup", + "type": "object", + "description": "AccountPermissionGroups contains a mapping of permission group IDs to names. A permission group is a grouping of account permissions.", + "properties": { + "id": { + "type": "string", + "description": "ID of this account permission group.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountPermissionGroup\".", + "default": "dfareporting#accountPermissionGroup" + }, + "name": { + "type": "string", + "description": "Name of this account permission group." + } + } + }, + "AccountPermissionGroupsListResponse": { + "id": "AccountPermissionGroupsListResponse", + "type": "object", + "description": "Account Permission Group List Response", + "properties": { + "accountPermissionGroups": { + "type": "array", + "description": "Account permission group collection.", + "items": { + "$ref": "AccountPermissionGroup" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountPermissionGroupsListResponse\".", + "default": "dfareporting#accountPermissionGroupsListResponse" + } + } + }, + "AccountPermissionsListResponse": { + "id": "AccountPermissionsListResponse", + "type": "object", + "description": "Account Permission List Response", + "properties": { + "accountPermissions": { + "type": "array", + "description": "Account permission collection.", + "items": { + "$ref": "AccountPermission" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountPermissionsListResponse\".", + "default": "dfareporting#accountPermissionsListResponse" + } + } + }, + "AccountUserProfile": { + "id": "AccountUserProfile", + "type": "object", + "description": "AccountUserProfiles contains properties of a DCM user profile. This resource is specifically for managing user profiles, whereas UserProfiles is for accessing the API.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of the user profile. This is a read-only field that can be left blank.", + "format": "int64" + }, + "active": { + "type": "boolean", + "description": "Whether this user profile is active. This defaults to false, and must be set true on insert for the user profile to be usable." + }, + "advertiserFilter": { + "$ref": "ObjectFilter", + "description": "Filter that describes which advertisers are visible to the user profile." + }, + "campaignFilter": { + "$ref": "ObjectFilter", + "description": "Filter that describes which campaigns are visible to the user profile." + }, + "comments": { + "type": "string", + "description": "Comments for this user profile." + }, + "email": { + "type": "string", + "description": "Email of the user profile. The email addresss must be linked to a Google Account. This field is required on insertion and is read-only after insertion." + }, + "id": { + "type": "string", + "description": "ID of the user profile. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountUserProfile\".", + "default": "dfareporting#accountUserProfile" + }, + "locale": { + "type": "string", + "description": "Locale of the user profile. This is a required field.\nAcceptable values are: \n- \"cs\" (Czech) \n- \"de\" (German) \n- \"en\" (English) \n- \"en-GB\" (English United Kingdom) \n- \"es\" (Spanish) \n- \"fr\" (French) \n- \"it\" (Italian) \n- \"ja\" (Japanese) \n- \"ko\" (Korean) \n- \"pl\" (Polish) \n- \"pt-BR\" (Portuguese Brazil)\n- \"ru\" (Russian) \n- \"sv\" (Swedish) \n- \"tr\" (Turkish) \n- \"zh-CN\" (Chinese Simplified) \n- \"zh-TW\" (Chinese Traditional)" + }, + "name": { + "type": "string", + "description": "Name of the user profile. This is a required field. Must be less than 64 characters long, must be globally unique, and cannot contain whitespace or any of the following characters: \"&;\"#%,\"." + }, + "siteFilter": { + "$ref": "ObjectFilter", + "description": "Filter that describes which sites are visible to the user profile." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of the user profile. This is a read-only field that can be left blank.", + "format": "int64" + }, + "traffickerType": { + "type": "string", + "description": "Trafficker type of this user profile.", + "enum": [ + "EXTERNAL_TRAFFICKER", + "INTERNAL_NON_TRAFFICKER", + "INTERNAL_TRAFFICKER" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "userAccessType": { + "type": "string", + "description": "User type of the user profile. This is a read-only field that can be left blank.", + "enum": [ + "INTERNAL_ADMINISTRATOR", + "NORMAL_USER", + "SUPER_USER" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "userRoleFilter": { + "$ref": "ObjectFilter", + "description": "Filter that describes which user roles are visible to the user profile." + }, + "userRoleId": { + "type": "string", + "description": "User role ID of the user profile. This is a required field.", + "format": "int64" + } + } + }, + "AccountUserProfilesListResponse": { + "id": "AccountUserProfilesListResponse", + "type": "object", + "description": "Account User Profile List Response", + "properties": { + "accountUserProfiles": { + "type": "array", + "description": "Account user profile collection.", + "items": { + "$ref": "AccountUserProfile" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountUserProfilesListResponse\".", + "default": "dfareporting#accountUserProfilesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "AccountsListResponse": { + "id": "AccountsListResponse", + "type": "object", + "description": "Account List Response", + "properties": { + "accounts": { + "type": "array", + "description": "Account collection.", + "items": { + "$ref": "Account" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountsListResponse\".", + "default": "dfareporting#accountsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "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" + } + } + } + }, + "Ad": { + "id": "Ad", + "type": "object", + "description": "Contains properties of a DCM ad.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this ad. This is a read-only field that can be left blank.", + "format": "int64" + }, + "active": { + "type": "boolean", + "description": "Whether this ad is active." + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this ad. This is a required field on insertion.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "archived": { + "type": "boolean", + "description": "Whether this ad is archived." + }, + "audienceSegmentId": { + "type": "string", + "description": "Audience segment ID that is being targeted for this ad. Applicable when type is AD_SERVING_STANDARD_AD.", + "format": "int64" + }, + "campaignId": { + "type": "string", + "description": "Campaign ID of this ad. This is a required field on insertion.", + "format": "int64" + }, + "campaignIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the campaign. This is a read-only, auto-generated field." + }, + "clickThroughUrl": { + "$ref": "ClickThroughUrl", + "description": "Click-through URL for this ad. This is a required field on insertion. Applicable when type is AD_SERVING_CLICK_TRACKER." + }, + "clickThroughUrlSuffixProperties": { + "$ref": "ClickThroughUrlSuffixProperties", + "description": "Click-through URL suffix properties for this ad. Applies to the URL in the ad or (if overriding ad properties) the URL in the creative." + }, + "comments": { + "type": "string", + "description": "Comments for this ad." + }, + "compatibility": { + "type": "string", + "description": "Compatibility of this ad. Applicable when type is AD_SERVING_DEFAULT_AD. WEB and WEB_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering an in-stream video ads developed with the VAST standard.", + "enum": [ + "APP", + "APP_INTERSTITIAL", + "IN_STREAM_VIDEO", + "WEB", + "WEB_INTERSTITIAL" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "createInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the creation of this ad.This is a read-only field." + }, + "creativeGroupAssignments": { + "type": "array", + "description": "Creative group assignments for this ad. Applicable when type is AD_SERVING_CLICK_TRACKER. Only one assignment per creative group number is allowed for a maximum of two assignments.", + "items": { + "$ref": "CreativeGroupAssignment" + } + }, + "creativeRotation": { + "$ref": "CreativeRotation", + "description": "Creative rotation for this ad. Applicable when type is AD_SERVING_DEFAULT_AD, AD_SERVING_STANDARD_AD, or AD_SERVING_TRACKING. When type is AD_SERVING_DEFAULT_AD, this field should have exactly one creativeAssignment." + }, + "dayPartTargeting": { + "$ref": "DayPartTargeting", + "description": "Time and day targeting information for this ad. Applicable when type is AD_SERVING_STANDARD_AD." + }, + "defaultClickThroughEventTagProperties": { + "$ref": "DefaultClickThroughEventTagProperties", + "description": "Default click-through event tag properties for this ad." + }, + "deliverySchedule": { + "$ref": "DeliverySchedule", + "description": "Delivery schedule information for this ad. Applicable when type is AD_SERVING_STANDARD_AD or AD_SERVING_TRACKING. This field along with subfields priority and impressionRatio are required on insertion when type is AD_SERVING_STANDARD_AD." + }, + "dynamicClickTracker": { + "type": "boolean", + "description": "Whether this ad is a dynamic click tracker. Applicable when type is AD_SERVING_CLICK_TRACKER. This is a required field on insert, and is read-only after insert." + }, + "endTime": { + "type": "string", + "description": "Date and time that this ad should stop serving. Must be later than the start time. This is a required field on insertion.", + "format": "date-time" + }, + "eventTagOverrides": { + "type": "array", + "description": "Event tag overrides for this ad.", + "items": { + "$ref": "EventTagOverride" + } + }, + "geoTargeting": { + "$ref": "GeoTargeting", + "description": "Geographical targeting information for this ad.Applicable when type is AD_SERVING_STANDARD_AD." + }, + "id": { + "type": "string", + "description": "ID of this ad. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this ad. This is a read-only, auto-generated field." + }, + "keyValueTargetingExpression": { + "$ref": "KeyValueTargetingExpression", + "description": "Key-value targeting information for this ad. Applicable when type is AD_SERVING_STANDARD_AD." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#ad\".", + "default": "dfareporting#ad" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the most recent modification of this ad. This is a read-only field." + }, + "name": { + "type": "string", + "description": "Name of this ad. This is a required field and must be less than 256 characters long." + }, + "placementAssignments": { + "type": "array", + "description": "Placement assignments for this ad.", + "items": { + "$ref": "PlacementAssignment" + } + }, + "remarketing_list_expression": { + "$ref": "ListTargetingExpression", + "description": "Applicable when type is AD_SERVING_STANDARD_AD. Remarketing list targeting expression for this ad." + }, + "size": { + "$ref": "Size", + "description": "Size of this ad. Applicable when type is AD_SERVING_DEFAULT_AD." + }, + "sslCompliant": { + "type": "boolean", + "description": "Whether this ad is ssl compliant. This is a read-only field that is auto-generated when the ad is inserted or updated." + }, + "sslRequired": { + "type": "boolean", + "description": "Whether this ad requires ssl. This is a read-only field that is auto-generated when the ad is inserted or updated." + }, + "startTime": { + "type": "string", + "description": "Date and time that this ad should start serving. If creating an ad, this field must be a time in the future. This is a required field on insertion.", + "format": "date-time" + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this ad. This is a read-only field that can be left blank.", + "format": "int64" + }, + "technologyTargeting": { + "$ref": "TechnologyTargeting", + "description": "Technology platform targeting information for this ad. Applicable when type is AD_SERVING_STANDARD_AD." + }, + "type": { + "type": "string", + "description": "Type of ad. This is a required field on insertion. Note that default ads (AD_SERVING_DEFAULT_AD) cannot be created directly (see Creative resource).", + "enum": [ + "AD_SERVING_CLICK_TRACKER", + "AD_SERVING_DEFAULT_AD", + "AD_SERVING_STANDARD_AD", + "AD_SERVING_TRACKING" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "AdsListResponse": { + "id": "AdsListResponse", + "type": "object", + "description": "Ad List Response", + "properties": { + "ads": { + "type": "array", + "description": "Ad collection.", + "items": { + "$ref": "Ad" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#adsListResponse\".", + "default": "dfareporting#adsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "Advertiser": { + "id": "Advertiser", + "type": "object", + "description": "Contains properties of a DCM advertiser.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this advertiser.This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserGroupId": { + "type": "string", + "description": "ID of the advertiser group this advertiser belongs to. You can group advertisers for reporting purposes, allowing you to see aggregated information for all advertisers in each group.", + "format": "int64" + }, + "clickThroughUrlSuffix": { + "type": "string", + "description": "Suffix added to click-through URL of ad creative associations under this advertiser. Must be less than 129 characters long." + }, + "defaultClickThroughEventTagId": { + "type": "string", + "description": "ID of the click-through event tag to apply by default to the landing pages of this advertiser's campaigns.", + "format": "int64" + }, + "defaultEmail": { + "type": "string", + "description": "Default email address used in sender field for tag emails." + }, + "floodlightConfigurationId": { + "type": "string", + "description": "Floodlight configuration ID of this advertiser. The floodlight configuration ID will be created automatically, so on insert this field should be left blank. This field can be set to another advertiser's floodlight configuration ID in order to share that advertiser's floodlight configuration with this advertiser, so long as: \n- This advertiser's original floodlight configuration is not already associated with floodlight activities or floodlight activity groups. \n- This advertiser's original floodlight configuration is not already shared with another advertiser.", + "format": "int64" + }, + "floodlightConfigurationIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the floodlight configuration. This is a read-only, auto-generated field." + }, + "id": { + "type": "string", + "description": "ID of this advertiser. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this advertiser. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#advertiser\".", + "default": "dfareporting#advertiser" + }, + "name": { + "type": "string", + "description": "Name of this advertiser. This is a required field and must be less than 256 characters long and unique among advertisers of the same account." + }, + "status": { + "type": "string", + "description": "Status of this advertiser.", + "enum": [ + "APPROVED", + "ON_HOLD" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this advertiser.This is a read-only field that can be left blank.", + "format": "int64" + } + } + }, + "AdvertiserGroup": { + "id": "AdvertiserGroup", + "type": "object", + "description": "Groups advertisers together so that reports can be generated for the entire group at once.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this advertiser group. This is a read-only field that can be left blank.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "ID of this advertiser group. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#advertiserGroup\".", + "default": "dfareporting#advertiserGroup" + }, + "name": { + "type": "string", + "description": "Name of this advertiser group. This is a required field and must be less than 256 characters long and unique among advertiser groups of the same account." + } + } + }, + "AdvertiserGroupsListResponse": { + "id": "AdvertiserGroupsListResponse", + "type": "object", + "description": "Advertiser Group List Response", + "properties": { + "advertiserGroups": { + "type": "array", + "description": "Advertiser group collection.", + "items": { + "$ref": "AdvertiserGroup" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#advertiserGroupsListResponse\".", + "default": "dfareporting#advertiserGroupsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "AdvertisersListResponse": { + "id": "AdvertisersListResponse", + "type": "object", + "description": "Advertiser List Response", + "properties": { + "advertisers": { + "type": "array", + "description": "Advertiser collection.", + "items": { + "$ref": "Advertiser" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#advertisersListResponse\".", + "default": "dfareporting#advertisersListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "AudienceSegment": { + "id": "AudienceSegment", + "type": "object", + "description": "Audience Segment.", + "properties": { + "allocation": { + "type": "integer", + "description": "Weight allocated to this segment. Must be between 1 and 1000. The weight assigned will be understood in proportion to the weights assigned to other segments in the same segment group.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "ID of this audience segment. This is a read-only, auto-generated field.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this audience segment. This is a required field and must be less than 65 characters long." + } + } + }, + "AudienceSegmentGroup": { + "id": "AudienceSegmentGroup", + "type": "object", + "description": "Audience Segment Group.", + "properties": { + "audienceSegments": { + "type": "array", + "description": "Audience segments assigned to this group. The number of segments must be between 2 and 100.", + "items": { + "$ref": "AudienceSegment" + } + }, + "id": { + "type": "string", + "description": "ID of this audience segment group. This is a read-only, auto-generated field.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this audience segment group. This is a required field and must be less than 65 characters long." + } + } + }, + "Browser": { + "id": "Browser", + "type": "object", + "description": "Contains information about a browser that can be targeted by ads.", + "properties": { + "browserVersionId": { + "type": "string", + "description": "ID referring to this grouping of browser and version numbers. This is the ID used for targeting.", + "format": "int64" + }, + "dartId": { + "type": "string", + "description": "DART ID of this browser. This is the ID used when generating reports.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#browser\".", + "default": "dfareporting#browser" + }, + "majorVersion": { + "type": "string", + "description": "Major version number (leftmost number) of this browser. For example, for Chrome 5.0.376.86 beta, this field should be set to 5. An asterisk (*) may be used to target any version number, and a question mark (?) may be used to target cases where the version number cannot be identified. For example, Chrome *.* targets any version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad server knows the browser is Firefox but can't tell which version it is." + }, + "minorVersion": { + "type": "string", + "description": "Minor version number (number after first dot on left) of this browser. For example, for Chrome 5.0.375.86 beta, this field should be set to 0. An asterisk (*) may be used to target any version number, and a question mark (?) may be used to target cases where the version number cannot be identified. For example, Chrome *.* targets any version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad server knows the browser is Firefox but can't tell which version it is." + }, + "name": { + "type": "string", + "description": "Name of this browser." + } + } + }, + "BrowsersListResponse": { + "id": "BrowsersListResponse", + "type": "object", + "description": "Browser List Response", + "properties": { + "browsers": { + "type": "array", + "description": "Browser collection.", + "items": { + "$ref": "Browser" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#browsersListResponse\".", + "default": "dfareporting#browsersListResponse" + } + } + }, + "Campaign": { + "id": "Campaign", + "type": "object", + "description": "Contains properties of a DCM campaign.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this campaign. This is a read-only field that can be left blank.", + "format": "int64" + }, + "additionalCreativeOptimizationConfigurations": { + "type": "array", + "description": "Additional creative optimization configurations for the campaign.", + "items": { + "$ref": "CreativeOptimizationConfiguration" + } + }, + "advertiserGroupId": { + "type": "string", + "description": "Advertiser group ID of the associated advertiser.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this campaign. This is a required field.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the advertiser ID of this campaign. This is a read-only, auto-generated field." + }, + "archived": { + "type": "boolean", + "description": "Whether this campaign has been archived." + }, + "audienceSegmentGroups": { + "type": "array", + "description": "Audience segment groups assigned to this campaign. Cannot have more than 300 segment groups.", + "items": { + "$ref": "AudienceSegmentGroup" + } + }, + "billingInvoiceCode": { + "type": "string", + "description": "Billing invoice code included in the DCM client billing invoices associated with the campaign." + }, + "clickThroughUrlSuffixProperties": { + "$ref": "ClickThroughUrlSuffixProperties", + "description": "Click-through URL suffix override properties for this campaign." + }, + "comment": { + "type": "string", + "description": "Arbitrary comments about this campaign. Must be less than 256 characters long." + }, + "comscoreVceEnabled": { + "type": "boolean", + "description": "Whether comScore vCE reports are enabled for this campaign." + }, + "createInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the creation of this campaign. This is a read-only field." + }, + "creativeGroupIds": { + "type": "array", + "description": "List of creative group IDs that are assigned to the campaign.", + "items": { + "type": "string", + "format": "int64" + } + }, + "creativeOptimizationConfiguration": { + "$ref": "CreativeOptimizationConfiguration", + "description": "Creative optimization configuration for the campaign." + }, + "defaultClickThroughEventTagProperties": { + "$ref": "DefaultClickThroughEventTagProperties", + "description": "Click-through event tag ID override properties for this campaign." + }, + "endDate": { + "type": "string", + "description": "Date on which the campaign will stop running. On insert, the end date must be today or a future date. The end date must be later than or be the same as the start date. If, for example, you set 6/25/2015 as both the start and end dates, the effective campaign run date is just that day only, 6/25/2015. The hours, minutes, and seconds of the end date should not be set, as doing so will result in an error. This is a required field.", + "format": "date" + }, + "eventTagOverrides": { + "type": "array", + "description": "Overrides that can be used to activate or deactivate advertiser event tags.", + "items": { + "$ref": "EventTagOverride" + } + }, + "externalId": { + "type": "string", + "description": "External ID for this campaign." + }, + "id": { + "type": "string", + "description": "ID of this campaign. This is a read-only auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this campaign. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#campaign\".", + "default": "dfareporting#campaign" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the most recent modification of this campaign. This is a read-only field." + }, + "lookbackConfiguration": { + "$ref": "LookbackConfiguration", + "description": "Lookback window settings for the campaign." + }, + "name": { + "type": "string", + "description": "Name of this campaign. This is a required field and must be less than 256 characters long and unique among campaigns of the same advertiser." + }, + "nielsenOcrEnabled": { + "type": "boolean", + "description": "Whether Nielsen reports are enabled for this campaign." + }, + "startDate": { + "type": "string", + "description": "Date on which the campaign starts running. The start date can be any date. The hours, minutes, and seconds of the start date should not be set, as doing so will result in an error. This is a required field.", + "format": "date" + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this campaign. This is a read-only field that can be left blank.", + "format": "int64" + }, + "traffickerEmails": { + "type": "array", + "description": "Campaign trafficker contact emails.", + "items": { + "type": "string" + } + } + } + }, + "CampaignCreativeAssociation": { + "id": "CampaignCreativeAssociation", + "type": "object", + "description": "Identifies a creative which has been associated with a given campaign.", + "properties": { + "creativeId": { + "type": "string", + "description": "ID of the creative associated with the campaign. This is a required field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#campaignCreativeAssociation\".", + "default": "dfareporting#campaignCreativeAssociation" + } + } + }, + "CampaignCreativeAssociationsListResponse": { + "id": "CampaignCreativeAssociationsListResponse", + "type": "object", + "description": "Campaign Creative Association List Response", + "properties": { + "campaignCreativeAssociations": { + "type": "array", + "description": "Campaign creative association collection", + "items": { + "$ref": "CampaignCreativeAssociation" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#campaignCreativeAssociationsListResponse\".", + "default": "dfareporting#campaignCreativeAssociationsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "CampaignsListResponse": { + "id": "CampaignsListResponse", + "type": "object", + "description": "Campaign List Response", + "properties": { + "campaigns": { + "type": "array", + "description": "Campaign collection.", + "items": { + "$ref": "Campaign" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#campaignsListResponse\".", + "default": "dfareporting#campaignsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "ChangeLog": { + "id": "ChangeLog", + "type": "object", + "description": "Describes a change that a user has made to a resource.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of the modified object.", + "format": "int64" + }, + "action": { + "type": "string", + "description": "Action which caused the change." + }, + "changeTime": { + "type": "string", + "description": "Time when the object was modified.", + "format": "date-time" + }, + "fieldName": { + "type": "string", + "description": "Field name of the object which changed." + }, + "id": { + "type": "string", + "description": "ID of this change log.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#changeLog\".", + "default": "dfareporting#changeLog" + }, + "newValue": { + "type": "string", + "description": "New value of the object field." + }, + "objectId": { + "type": "string", + "description": "ID of the object of this change log. The object could be a campaign, placement, ad, or other type.", + "format": "int64" + }, + "objectType": { + "type": "string", + "description": "Object type of the change log." + }, + "oldValue": { + "type": "string", + "description": "Old value of the object field." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of the modified object.", + "format": "int64" + }, + "transactionId": { + "type": "string", + "description": "Transaction ID of this change log. When a single API call results in many changes, each change will have a separate ID in the change log but will share the same transactionId.", + "format": "int64" + }, + "userProfileId": { + "type": "string", + "description": "ID of the user who modified the object.", + "format": "int64" + }, + "userProfileName": { + "type": "string", + "description": "User profile name of the user who modified the object." + } + } + }, + "ChangeLogsListResponse": { + "id": "ChangeLogsListResponse", + "type": "object", + "description": "Change Log List Response", + "properties": { + "changeLogs": { + "type": "array", + "description": "Change log collection.", + "items": { + "$ref": "ChangeLog" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#changeLogsListResponse\".", + "default": "dfareporting#changeLogsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "CitiesListResponse": { + "id": "CitiesListResponse", + "type": "object", + "description": "City List Response", + "properties": { + "cities": { + "type": "array", + "description": "City collection.", + "items": { + "$ref": "City" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#citiesListResponse\".", + "default": "dfareporting#citiesListResponse" + } + } + }, + "City": { + "id": "City", + "type": "object", + "description": "Contains information about a city that can be targeted by ads.", + "properties": { + "countryCode": { + "type": "string", + "description": "Country code of the country to which this city belongs." + }, + "countryDartId": { + "type": "string", + "description": "DART ID of the country to which this city belongs.", + "format": "int64" + }, + "dartId": { + "type": "string", + "description": "DART ID of this city. This is the ID used for targeting and generating reports.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#city\".", + "default": "dfareporting#city" + }, + "metroCode": { + "type": "string", + "description": "Metro region code of the metro region (DMA) to which this city belongs." + }, + "metroDmaId": { + "type": "string", + "description": "ID of the metro region (DMA) to which this city belongs.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this city." + }, + "regionCode": { + "type": "string", + "description": "Region code of the region to which this city belongs." + }, + "regionDartId": { + "type": "string", + "description": "DART ID of the region to which this city belongs.", + "format": "int64" + } + } + }, + "ClickTag": { + "id": "ClickTag", + "type": "object", + "description": "Creative Click Tag.", + "properties": { + "eventName": { + "type": "string", + "description": "Advertiser event name associated with the click tag. This field is used by ENHANCED_BANNER, ENHANCED_IMAGE, and HTML5_BANNER creatives." + }, + "name": { + "type": "string", + "description": "Parameter name for the specified click tag. For ENHANCED_IMAGE creative assets, this field must match the value of the creative asset's creativeAssetId.name field." + }, + "value": { + "type": "string", + "description": "Parameter value for the specified click tag. This field contains a click-through url." + } + } + }, + "ClickThroughUrl": { + "id": "ClickThroughUrl", + "type": "object", + "description": "Click-through URL", + "properties": { + "customClickThroughUrl": { + "type": "string", + "description": "Custom click-through URL. Applicable if the defaultLandingPage field is set to false and the landingPageId field is left unset." + }, + "defaultLandingPage": { + "type": "boolean", + "description": "Whether the campaign default landing page is used." + }, + "landingPageId": { + "type": "string", + "description": "ID of the landing page for the click-through URL. Applicable if the defaultLandingPage field is set to false.", + "format": "int64" + } + } + }, + "ClickThroughUrlSuffixProperties": { + "id": "ClickThroughUrlSuffixProperties", + "type": "object", + "description": "Click Through URL Suffix settings.", + "properties": { + "clickThroughUrlSuffix": { + "type": "string", + "description": "Click-through URL suffix to apply to all ads in this entity's scope. Must be less than 128 characters long." + }, + "overrideInheritedSuffix": { + "type": "boolean", + "description": "Whether this entity should override the inherited click-through URL suffix with its own defined value." + } + } + }, + "CompanionClickThroughOverride": { + "id": "CompanionClickThroughOverride", + "type": "object", + "description": "Companion Click-through override.", + "properties": { + "clickThroughUrl": { + "$ref": "ClickThroughUrl", + "description": "Click-through URL of this companion click-through override." + }, + "creativeId": { + "type": "string", + "description": "ID of the creative for this companion click-through override.", + "format": "int64" + } + } + }, + "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\"." + } + } + }, + "ConnectionType": { + "id": "ConnectionType", + "type": "object", + "description": "Contains information about an internet connection type that can be targeted by ads. Clients can use the connection type to target mobile vs. broadband users.", + "properties": { + "id": { + "type": "string", + "description": "ID of this connection type.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#connectionType\".", + "default": "dfareporting#connectionType" + }, + "name": { + "type": "string", + "description": "Name of this connection type." + } + } + }, + "ConnectionTypesListResponse": { + "id": "ConnectionTypesListResponse", + "type": "object", + "description": "Connection Type List Response", + "properties": { + "connectionTypes": { + "type": "array", + "description": "Collection of connection types such as broadband and mobile.", + "items": { + "$ref": "ConnectionType" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#connectionTypesListResponse\".", + "default": "dfareporting#connectionTypesListResponse" + } + } + }, + "ContentCategoriesListResponse": { + "id": "ContentCategoriesListResponse", + "type": "object", + "description": "Content Category List Response", + "properties": { + "contentCategories": { + "type": "array", + "description": "Content category collection.", + "items": { + "$ref": "ContentCategory" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#contentCategoriesListResponse\".", + "default": "dfareporting#contentCategoriesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "ContentCategory": { + "id": "ContentCategory", + "type": "object", + "description": "Organizes placements according to the contents of their associated webpages.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this content category. This is a read-only field that can be left blank.", + "format": "int64" + }, + "description": { + "type": "string", + "description": "Description of this content category." + }, + "id": { + "type": "string", + "description": "ID of this content category. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#contentCategory\".", + "default": "dfareporting#contentCategory" + }, + "name": { + "type": "string", + "description": "Name of this content category. This is a required field and must be less than 256 characters long and unique among content categories of the same account." + } + } + }, + "CountriesListResponse": { + "id": "CountriesListResponse", + "type": "object", + "description": "Country List Response", + "properties": { + "countries": { + "type": "array", + "description": "Country collection.", + "items": { + "$ref": "Country" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#countriesListResponse\".", + "default": "dfareporting#countriesListResponse" + } + } + }, + "Country": { + "id": "Country", + "type": "object", + "description": "Contains information about a country that can be targeted by ads.", + "properties": { + "countryCode": { + "type": "string", + "description": "Country code." + }, + "dartId": { + "type": "string", + "description": "DART ID of this country. This is the ID used for targeting and generating reports.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#country\".", + "default": "dfareporting#country" + }, + "name": { + "type": "string", + "description": "Name of this country." + }, + "sslEnabled": { + "type": "boolean", + "description": "Whether ad serving supports secure servers in this country." + } + } + }, + "Creative": { + "id": "Creative", + "type": "object", + "description": "Contains properties of a Creative.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this creative. This field, if left unset, will be auto-generated for both insert and update operations. Applicable to all creative types.", + "format": "int64" + }, + "active": { + "type": "boolean", + "description": "Whether the creative is active. Applicable to all creative types." + }, + "adParameters": { + "type": "string", + "description": "Ad parameters user for VPAID creative. This is a read-only field. Applicable to the following creative types: all VPAID." + }, + "adTagKeys": { + "type": "array", + "description": "Keywords for a Rich Media creative. Keywords let you customize the creative settings of a Rich Media ad running on your site without having to contact the advertiser. You can use keywords to dynamically change the look or functionality of a creative. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "items": { + "type": "string" + } + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this creative. This is a required field. Applicable to all creative types.", + "format": "int64" + }, + "allowScriptAccess": { + "type": "boolean", + "description": "Whether script access is allowed for this creative. This is a read-only and deprecated field which will automatically be set to true on update. Applicable to the following creative types: FLASH_INPAGE." + }, + "archived": { + "type": "boolean", + "description": "Whether the creative is archived. Applicable to all creative types." + }, + "artworkType": { + "type": "string", + "description": "Type of artwork used for the creative. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "enum": [ + "ARTWORK_TYPE_FLASH", + "ARTWORK_TYPE_HTML5", + "ARTWORK_TYPE_MIXED" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "authoringTool": { + "type": "string", + "description": "Authoring tool for HTML5 banner creatives. This is a read-only field. Applicable to the following creative types: HTML5_BANNER.", + "enum": [ + "NINJA", + "SWIFFY" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "auto_advance_images": { + "type": "boolean", + "description": "Whether images are automatically advanced for enhanced image creatives. Applicable to the following creative types: ENHANCED_IMAGE." + }, + "backgroundColor": { + "type": "string", + "description": "The 6-character HTML color code, beginning with #, for the background of the window area where the Flash file is displayed. Default is white. Applicable to the following creative types: FLASH_INPAGE." + }, + "backupImageClickThroughUrl": { + "type": "string", + "description": "Click-through URL for backup image. Applicable to the following creative types: ENHANCED_BANNER, FLASH_INPAGE, and HTML5_BANNER." + }, + "backupImageFeatures": { + "type": "array", + "description": "List of feature dependencies that will cause a backup image to be served if the browser that serves the ad does not support them. Feature dependencies are features that a browser must be able to support in order to render your HTML5 creative asset correctly. This field is initially auto-generated to contain all features detected by DCM for all the assets of this creative and can then be modified by the client. To reset this field, copy over all the creativeAssets' detected features. Applicable to the following creative types: ENHANCED_BANNER and HTML5_BANNER.", + "items": { + "type": "string", + "enum": [ + "APPLICATION_CACHE", + "AUDIO", + "CANVAS", + "CANVAS_TEXT", + "CSS_ANIMATIONS", + "CSS_BACKGROUND_SIZE", + "CSS_BORDER_IMAGE", + "CSS_BORDER_RADIUS", + "CSS_BOX_SHADOW", + "CSS_COLUMNS", + "CSS_FLEX_BOX", + "CSS_FONT_FACE", + "CSS_GENERATED_CONTENT", + "CSS_GRADIENTS", + "CSS_HSLA", + "CSS_MULTIPLE_BGS", + "CSS_OPACITY", + "CSS_REFLECTIONS", + "CSS_RGBA", + "CSS_TEXT_SHADOW", + "CSS_TRANSFORMS", + "CSS_TRANSFORMS3D", + "CSS_TRANSITIONS", + "DRAG_AND_DROP", + "GEO_LOCATION", + "HASH_CHANGE", + "HISTORY", + "INDEXED_DB", + "INLINE_SVG", + "INPUT_ATTR_AUTOCOMPLETE", + "INPUT_ATTR_AUTOFOCUS", + "INPUT_ATTR_LIST", + "INPUT_ATTR_MAX", + "INPUT_ATTR_MIN", + "INPUT_ATTR_MULTIPLE", + "INPUT_ATTR_PATTERN", + "INPUT_ATTR_PLACEHOLDER", + "INPUT_ATTR_REQUIRED", + "INPUT_ATTR_STEP", + "INPUT_TYPE_COLOR", + "INPUT_TYPE_DATE", + "INPUT_TYPE_DATETIME", + "INPUT_TYPE_DATETIME_LOCAL", + "INPUT_TYPE_EMAIL", + "INPUT_TYPE_MONTH", + "INPUT_TYPE_NUMBER", + "INPUT_TYPE_RANGE", + "INPUT_TYPE_SEARCH", + "INPUT_TYPE_TEL", + "INPUT_TYPE_TIME", + "INPUT_TYPE_URL", + "INPUT_TYPE_WEEK", + "LOCAL_STORAGE", + "POST_MESSAGE", + "SESSION_STORAGE", + "SMIL", + "SVG_CLIP_PATHS", + "SVG_FE_IMAGE", + "SVG_FILTERS", + "SVG_HREF", + "TOUCH", + "VIDEO", + "WEBGL", + "WEB_SOCKETS", + "WEB_SQL_DATABASE", + "WEB_WORKERS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "backupImageReportingLabel": { + "type": "string", + "description": "Reporting label used for HTML5 banner backup image. Applicable to the following creative types: ENHANCED_BANNER." + }, + "backupImageTargetWindow": { + "$ref": "TargetWindow", + "description": "Target window for backup image. Applicable to the following creative types: ENHANCED_BANNER, FLASH_INPAGE, and HTML5_BANNER." + }, + "clickTags": { + "type": "array", + "description": "Click tags of the creative. For ENHANCED_BANNER, FLASH_INPAGE, and HTML5_BANNER creatives, this is a subset of detected click tags for the assets associated with this creative. After creating a flash asset, detected click tags will be returned in the creativeAssetMetadata. When inserting the creative, populate the creative clickTags field using the creativeAssetMetadata.clickTags field. For ENHANCED_IMAGE creatives, there should be exactly one entry in this list for each image creative asset. A click tag is matched with a corresponding creative asset by matching the clickTag.name field with the creativeAsset.assetIdentifier.name field. Applicable to the following creative types: ENHANCED_BANNER, ENHANCED_IMAGE, FLASH_INPAGE, HTML5_BANNER.", + "items": { + "$ref": "ClickTag" + } + }, + "commercialId": { + "type": "string", + "description": "Industry standard ID assigned to creative for reach and frequency. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID." + }, + "companionCreatives": { + "type": "array", + "description": "List of companion creatives assigned to an in-Stream videocreative. Acceptable values include IDs of existing flash and image creatives. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID.", + "items": { + "type": "string", + "format": "int64" + } + }, + "compatibility": { + "type": "array", + "description": "Compatibilities associated with this creative. This is a read-only field. WEB and WEB_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard. Applicable to all creative types.\n\nAcceptable values are:\n- \"APP\"\n- \"APP_INTERSTITIAL\"\n- \"IN_STREAM_VIDEO\"\n- \"WEB\"\n- \"WEB_INTERSTITIAL\"", + "items": { + "type": "string", + "enum": [ + "APP", + "APP_INTERSTITIAL", + "IN_STREAM_VIDEO", + "WEB", + "WEB_INTERSTITIAL" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + } + }, + "counterCustomEvents": { + "type": "array", + "description": "List of counter events configured for the creative. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "items": { + "$ref": "CreativeCustomEvent" + } + }, + "creativeAssets": { + "type": "array", + "description": "Assets associated with a creative. Applicable to all but the following creative types: INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and REDIRECT", + "items": { + "$ref": "CreativeAsset" + } + }, + "creativeFieldAssignments": { + "type": "array", + "description": "Creative field assignments for this creative. Applicable to all creative types.", + "items": { + "$ref": "CreativeFieldAssignment" + } + }, + "customKeyValues": { + "type": "array", + "description": "Custom key-values for a Rich Media creative. Key-values let you customize the creative settings of a Rich Media ad running on your site without having to contact the advertiser. You can use key-values to dynamically change the look or functionality of a creative. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "items": { + "type": "string" + } + }, + "exitCustomEvents": { + "type": "array", + "description": "List of exit events configured for the creative. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "items": { + "$ref": "CreativeCustomEvent" + } + }, + "fsCommand": { + "$ref": "FsCommand", + "description": "OpenWindow FSCommand of this creative. This lets the SWF file communicate with either Flash Player or the program hosting Flash Player, such as a web browser. This is only triggered if allowScriptAccess field is true. Applicable to the following creative types: FLASH_INPAGE." + }, + "htmlCode": { + "type": "string", + "description": "HTML code for the creative. This is a required field when applicable. This field is ignored if htmlCodeLocked is false. Applicable to the following creative types: all CUSTOM, FLASH_INPAGE, and HTML5_BANNER, and all RICH_MEDIA." + }, + "htmlCodeLocked": { + "type": "boolean", + "description": "Whether HTML code is DCM-generated or manually entered. Set to true to ignore changes to htmlCode. Applicable to the following creative types: FLASH_INPAGE and HTML5_BANNER." + }, + "id": { + "type": "string", + "description": "ID of this creative. This is a read-only, auto-generated field. Applicable to all creative types.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this creative. This is a read-only field. Applicable to all creative types." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creative\".", + "default": "dfareporting#creative" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Creative last modification information. This is a read-only field. Applicable to all creative types." + }, + "latestTraffickedCreativeId": { + "type": "string", + "description": "Latest Studio trafficked creative ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of the creative. This is a required field and must be less than 256 characters long. Applicable to all creative types." + }, + "overrideCss": { + "type": "string", + "description": "Override CSS value for rich media creatives. Applicable to the following creative types: all RICH_MEDIA." + }, + "redirectUrl": { + "type": "string", + "description": "URL of hosted image or another ad tag. This is a required field when applicable. Applicable to the following creative types: INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and REDIRECT" + }, + "renderingId": { + "type": "string", + "description": "ID of current rendering version. This is a read-only field. Applicable to all creative types.", + "format": "int64" + }, + "renderingIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the rendering ID of this creative. This is a read-only field. Applicable to all creative types." + }, + "requiredFlashPluginVersion": { + "type": "string", + "description": "The minimum required Flash plugin version for this creative. For example, 11.2.202.235. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID." + }, + "requiredFlashVersion": { + "type": "integer", + "description": "The internal Flash version for this creative as calculated by DoubleClick Studio. This is a read-only field. Applicable to the following creative types: FLASH_INPAGE, ENHANCED_BANNER, all RICH_MEDIA, and all VPAID.", + "format": "int32" + }, + "size": { + "$ref": "Size", + "description": "Size associated with this creative. When inserting or updating a creative either the size ID field or size width and height fields can be used. This is a required field when applicable; however for IMAGE and FLASH_INPAGE creatives, if left blank, this field will be automatically set using the actual size of the associated image assets. Applicable to the following creative types: ENHANCED_BANNER, ENHANCED_IMAGE, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all RICH_MEDIA." + }, + "skippable": { + "type": "boolean", + "description": "Whether the user can choose to skip the creative. Applicable to the following creative types: INSTREAM_VIDEO." + }, + "sslCompliant": { + "type": "boolean", + "description": "Whether the creative is SSL-compliant. This is a read-only field. Applicable to all creative types." + }, + "studioAdvertiserId": { + "type": "string", + "description": "Studio advertiser ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "format": "int64" + }, + "studioCreativeId": { + "type": "string", + "description": "Studio creative ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "format": "int64" + }, + "studioTraffickedCreativeId": { + "type": "string", + "description": "Studio trafficked creative ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "format": "int64" + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this creative. This field, if left unset, will be auto-generated for both insert and update operations. Applicable to all creative types.", + "format": "int64" + }, + "thirdPartyBackupImageImpressionsUrl": { + "type": "string", + "description": "Third-party URL used to record backup image impressions. Applicable to the following creative types: all RICH_MEDIA" + }, + "thirdPartyRichMediaImpressionsUrl": { + "type": "string", + "description": "Third-party URL used to record rich media impressions. Applicable to the following creative types: all RICH_MEDIA" + }, + "thirdPartyUrls": { + "type": "array", + "description": "Third-party URLs for tracking in-stream video creative events. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID.", + "items": { + "$ref": "ThirdPartyTrackingUrl" + } + }, + "timerCustomEvents": { + "type": "array", + "description": "List of timer events configured for the creative. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "items": { + "$ref": "CreativeCustomEvent" + } + }, + "totalFileSize": { + "type": "string", + "description": "Combined size of all creative assets. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "Type of this creative.This is a required field. Applicable to all creative types.", + "enum": [ + "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO", + "CUSTOM_INPAGE", + "CUSTOM_INTERSTITIAL", + "ENHANCED_BANNER", + "ENHANCED_IMAGE", + "FLASH_INPAGE", + "HTML5_BANNER", + "IMAGE", + "INSTREAM_VIDEO", + "INTERNAL_REDIRECT", + "INTERSTITIAL_INTERNAL_REDIRECT", + "REDIRECT", + "RICH_MEDIA_EXPANDING", + "RICH_MEDIA_IM_EXPAND", + "RICH_MEDIA_INPAGE", + "RICH_MEDIA_INPAGE_FLOATING", + "RICH_MEDIA_INTERSTITIAL_FLOAT", + "RICH_MEDIA_MOBILE_IN_APP", + "RICH_MEDIA_MULTI_FLOATING", + "RICH_MEDIA_PEEL_DOWN", + "TRACKING_TEXT", + "VAST_REDIRECT", + "VPAID_LINEAR", + "VPAID_NON_LINEAR" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "version": { + "type": "integer", + "description": "The version number helps you keep track of multiple versions of your creative in your reports. The version number will always be auto-generated during insert operations to start at 1. For tracking creatives the version cannot be incremented and will always remain at 1. For all other creative types the version can be incremented only by 1 during update operations. In addition, the version will be automatically incremented by 1 when undergoing Rich Media creative merging. Applicable to all creative types.", + "format": "int32" + }, + "videoDescription": { + "type": "string", + "description": "Description of the video ad. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID." + }, + "videoDuration": { + "type": "number", + "description": "Creative video duration in seconds. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO, all RICH_MEDIA, and all VPAID.", + "format": "float" + } + } + }, + "CreativeAsset": { + "id": "CreativeAsset", + "type": "object", + "description": "Creative Asset.", + "properties": { + "actionScript3": { + "type": "boolean", + "description": "Whether ActionScript3 is enabled for the flash asset. This is a read-only field. Applicable to the following creative types: FLASH_INPAGE and ENHANCED_BANNER." + }, + "active": { + "type": "boolean", + "description": "Whether the video asset is active. This is a read-only field for VPAID_NON_LINEAR assets. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID." + }, + "alignment": { + "type": "string", + "description": "Possible alignments for an asset. This is a read-only field. Applicable to the following creative types: RICH_MEDIA_MULTI_FLOATING.", + "enum": [ + "ALIGNMENT_BOTTOM", + "ALIGNMENT_LEFT", + "ALIGNMENT_RIGHT", + "ALIGNMENT_TOP" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "artworkType": { + "type": "string", + "description": "Artwork type of rich media creative. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA.", + "enum": [ + "ARTWORK_TYPE_FLASH", + "ARTWORK_TYPE_HTML5", + "ARTWORK_TYPE_MIXED" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "assetIdentifier": { + "$ref": "CreativeAssetId", + "description": "Identifier of this asset. This is the same identifier returned during creative asset insert operation. This is a required field. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT." + }, + "backupImageExit": { + "$ref": "CreativeCustomEvent", + "description": "Exit event configured for the backup image. Applicable to the following creative types: all RICH_MEDIA." + }, + "bitRate": { + "type": "integer", + "description": "Detected bit-rate for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID.", + "format": "int32" + }, + "childAssetType": { + "type": "string", + "description": "Rich media child asset type. This is a read-only field. Applicable to the following creative types: all VPAID.", + "enum": [ + "CHILD_ASSET_TYPE_DATA", + "CHILD_ASSET_TYPE_FLASH", + "CHILD_ASSET_TYPE_IMAGE", + "CHILD_ASSET_TYPE_VIDEO" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "collapsedSize": { + "$ref": "Size", + "description": "Size of an asset when collapsed. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA and all VPAID. Additionally, applicable to assets whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN." + }, + "customStartTimeValue": { + "type": "integer", + "description": "Custom start time in seconds for making the asset visible. Applicable to the following creative types: all RICH_MEDIA.", + "format": "int32" + }, + "detectedFeatures": { + "type": "array", + "description": "List of feature dependencies for the creative asset that are detected by DCM. Feature dependencies are features that a browser must be able to support in order to render your HTML5 creative correctly. This is a read-only, auto-generated field. Applicable to the following creative types: ENHANCED_BANNER and HTML5_BANNER.", + "items": { + "type": "string", + "enum": [ + "APPLICATION_CACHE", + "AUDIO", + "CANVAS", + "CANVAS_TEXT", + "CSS_ANIMATIONS", + "CSS_BACKGROUND_SIZE", + "CSS_BORDER_IMAGE", + "CSS_BORDER_RADIUS", + "CSS_BOX_SHADOW", + "CSS_COLUMNS", + "CSS_FLEX_BOX", + "CSS_FONT_FACE", + "CSS_GENERATED_CONTENT", + "CSS_GRADIENTS", + "CSS_HSLA", + "CSS_MULTIPLE_BGS", + "CSS_OPACITY", + "CSS_REFLECTIONS", + "CSS_RGBA", + "CSS_TEXT_SHADOW", + "CSS_TRANSFORMS", + "CSS_TRANSFORMS3D", + "CSS_TRANSITIONS", + "DRAG_AND_DROP", + "GEO_LOCATION", + "HASH_CHANGE", + "HISTORY", + "INDEXED_DB", + "INLINE_SVG", + "INPUT_ATTR_AUTOCOMPLETE", + "INPUT_ATTR_AUTOFOCUS", + "INPUT_ATTR_LIST", + "INPUT_ATTR_MAX", + "INPUT_ATTR_MIN", + "INPUT_ATTR_MULTIPLE", + "INPUT_ATTR_PATTERN", + "INPUT_ATTR_PLACEHOLDER", + "INPUT_ATTR_REQUIRED", + "INPUT_ATTR_STEP", + "INPUT_TYPE_COLOR", + "INPUT_TYPE_DATE", + "INPUT_TYPE_DATETIME", + "INPUT_TYPE_DATETIME_LOCAL", + "INPUT_TYPE_EMAIL", + "INPUT_TYPE_MONTH", + "INPUT_TYPE_NUMBER", + "INPUT_TYPE_RANGE", + "INPUT_TYPE_SEARCH", + "INPUT_TYPE_TEL", + "INPUT_TYPE_TIME", + "INPUT_TYPE_URL", + "INPUT_TYPE_WEEK", + "LOCAL_STORAGE", + "POST_MESSAGE", + "SESSION_STORAGE", + "SMIL", + "SVG_CLIP_PATHS", + "SVG_FE_IMAGE", + "SVG_FILTERS", + "SVG_HREF", + "TOUCH", + "VIDEO", + "WEBGL", + "WEB_SOCKETS", + "WEB_SQL_DATABASE", + "WEB_WORKERS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "displayType": { + "type": "string", + "description": "Type of rich media asset. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA.", + "enum": [ + "ASSET_DISPLAY_TYPE_EXPANDING", + "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH", + "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH_EXPANDING", + "ASSET_DISPLAY_TYPE_FLOATING", + "ASSET_DISPLAY_TYPE_INPAGE", + "ASSET_DISPLAY_TYPE_OVERLAY", + "ASSET_DISPLAY_TYPE_PEEL_DOWN", + "ASSET_DISPLAY_TYPE_VPAID_LINEAR", + "ASSET_DISPLAY_TYPE_VPAID_NON_LINEAR" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "duration": { + "type": "integer", + "description": "Duration in seconds for which an asset will be displayed. Applicable to the following creative types: INSTREAM_VIDEO and VPAID_LINEAR.", + "format": "int32" + }, + "durationType": { + "type": "string", + "description": "Duration type for which an asset will be displayed. Applicable to the following creative types: all RICH_MEDIA.", + "enum": [ + "ASSET_DURATION_TYPE_AUTO", + "ASSET_DURATION_TYPE_CUSTOM", + "ASSET_DURATION_TYPE_NONE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "expandedDimension": { + "$ref": "Size", + "description": "Detected expanded dimension for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID." + }, + "fileSize": { + "type": "string", + "description": "File size associated with this creative asset. This is a read-only field. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT.", + "format": "int64" + }, + "flashVersion": { + "type": "integer", + "description": "Flash version of the asset. This is a read-only field. Applicable to the following creative types: FLASH_INPAGE, ENHANCED_BANNER, all RICH_MEDIA, and all VPAID.", + "format": "int32" + }, + "hideFlashObjects": { + "type": "boolean", + "description": "Whether to hide Flash objects flag for an asset. Applicable to the following creative types: all RICH_MEDIA." + }, + "hideSelectionBoxes": { + "type": "boolean", + "description": "Whether to hide selection boxes flag for an asset. Applicable to the following creative types: all RICH_MEDIA." + }, + "horizontallyLocked": { + "type": "boolean", + "description": "Whether the asset is horizontally locked. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA." + }, + "id": { + "type": "string", + "description": "Numeric ID of this creative asset. This is a required field and should not be modified. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT.", + "format": "int64" + }, + "mimeType": { + "type": "string", + "description": "Detected MIME type for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID." + }, + "offset": { + "$ref": "OffsetPosition", + "description": "Offset position for an asset in collapsed mode. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA and all VPAID. Additionally, only applicable to assets whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN." + }, + "originalBackup": { + "type": "boolean", + "description": "Whether the backup asset is original or changed by the user in DCM. Applicable to the following creative types: all RICH_MEDIA." + }, + "position": { + "$ref": "OffsetPosition", + "description": "Offset position for an asset. Applicable to the following creative types: all RICH_MEDIA." + }, + "positionLeftUnit": { + "type": "string", + "description": "Offset left unit for an asset. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA.", + "enum": [ + "OFFSET_UNIT_PERCENT", + "OFFSET_UNIT_PIXEL", + "OFFSET_UNIT_PIXEL_FROM_CENTER" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "positionTopUnit": { + "type": "string", + "description": "Offset top unit for an asset. This is a read-only field if the asset displayType is ASSET_DISPLAY_TYPE_OVERLAY. Applicable to the following creative types: all RICH_MEDIA.", + "enum": [ + "OFFSET_UNIT_PERCENT", + "OFFSET_UNIT_PIXEL", + "OFFSET_UNIT_PIXEL_FROM_CENTER" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "progressiveServingUrl": { + "type": "string", + "description": "Progressive URL for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID." + }, + "pushdown": { + "type": "boolean", + "description": "Whether the asset pushes down other content. Applicable to the following creative types: all RICH_MEDIA. Additionally, only applicable when the asset offsets are 0, the collapsedSize.width matches size.width, and the collapsedSize.height is less than size.height." + }, + "pushdownDuration": { + "type": "number", + "description": "Pushdown duration in seconds for an asset. Must be between 0 and 9.99. Applicable to the following creative types: all RICH_MEDIA.Additionally, only applicable when the asset pushdown field is true, the offsets are 0, the collapsedSize.width matches size.width, and the collapsedSize.height is less than size.height.", + "format": "float" + }, + "role": { + "type": "string", + "description": "Role of the asset in relation to creative. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT. This is a required field.\nPRIMARY applies to ENHANCED_BANNER, FLASH_INPAGE, HTML5_BANNER, IMAGE, IMAGE_GALLERY, all RICH_MEDIA (which may contain multiple primary assets), and all VPAID creatives.\nBACKUP_IMAGE applies to ENHANCED_BANNER, FLASH_INPAGE, HTML5_BANNER, all RICH_MEDIA, and all VPAID creatives.\nADDITIONAL_IMAGE and ADDITIONAL_FLASH apply to FLASH_INPAGE creatives.\nOTHER refers to assets from sources other than DCM, such as Studio uploaded assets, applicable to all RICH_MEDIA and all VPAID creatives.\nPARENT_VIDEO refers to videos uploaded by the user in DCM and is applicable to INSTREAM_VIDEO and VPAID_LINEAR creatives.\nTRANSCODED_VIDEO refers to videos transcoded by DCM from PARENT_VIDEO assets and is applicable to INSTREAM_VIDEO and VPAID_LINEAR creatives.\nALTERNATE_VIDEO refers to the DCM representation of child asset videos from Studio, and is applicable to VPAID_LINEAR creatives. These cannot be added or removed within DCM.\nFor VPAID_LINEAR creatives, PARENT_VIDEO, TRANSCODED_VIDEO and ALTERNATE_VIDEO assets that are marked active serve as backup in case the VPAID creative cannot be served. Only PARENT_VIDEO assets can be added or removed for an INSTREAM_VIDEO or VPAID_LINEAR creative.", + "enum": [ + "ADDITIONAL_FLASH", + "ADDITIONAL_IMAGE", + "ALTERNATE_VIDEO", + "BACKUP_IMAGE", + "OTHER", + "PARENT_VIDEO", + "PRIMARY", + "TRANSCODED_VIDEO" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "size": { + "$ref": "Size", + "description": "Size associated with this creative asset. This is a required field when applicable; however for IMAGE and FLASH_INPAGE creatives, if left blank, this field will be automatically set using the actual size of the associated image asset. Applicable to the following creative types: ENHANCED_BANNER, ENHANCED_IMAGE, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all RICH_MEDIA." + }, + "sslCompliant": { + "type": "boolean", + "description": "Whether the asset is SSL-compliant. This is a read-only field. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT." + }, + "startTimeType": { + "type": "string", + "description": "Initial wait time type before making the asset visible. Applicable to the following creative types: all RICH_MEDIA.", + "enum": [ + "ASSET_START_TIME_TYPE_CUSTOM", + "ASSET_START_TIME_TYPE_NONE" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "streamingServingUrl": { + "type": "string", + "description": "Streaming URL for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID." + }, + "transparency": { + "type": "boolean", + "description": "Whether the asset is transparent. Applicable to the following creative types: all RICH_MEDIA. Additionally, only applicable to HTML5 assets." + }, + "verticallyLocked": { + "type": "boolean", + "description": "Whether the asset is vertically locked. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA." + }, + "videoDuration": { + "type": "number", + "description": "Detected video duration for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID.", + "format": "float" + }, + "windowMode": { + "type": "string", + "description": "Window mode options for flash assets. Applicable to the following creative types: FLASH_INPAGE, RICH_MEDIA_EXPANDING, RICH_MEDIA_IM_EXPAND, RICH_MEDIA_INPAGE, and RICH_MEDIA_INPAGE_FLOATING.", + "enum": [ + "OPAQUE", + "TRANSPARENT", + "WINDOW" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "zIndex": { + "type": "integer", + "description": "zIndex value of an asset. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA.Additionally, only applicable to assets whose displayType is NOT one of the following types: ASSET_DISPLAY_TYPE_INPAGE or ASSET_DISPLAY_TYPE_OVERLAY.", + "format": "int32" + }, + "zipFilename": { + "type": "string", + "description": "File name of zip file. This is a read-only field. Applicable to the following creative types: HTML5_BANNER." + }, + "zipFilesize": { + "type": "string", + "description": "Size of zip file. This is a read-only field. Applicable to the following creative types: HTML5_BANNER." + } + } + }, + "CreativeAssetId": { + "id": "CreativeAssetId", + "type": "object", + "description": "Creative Asset ID.", + "properties": { + "name": { + "type": "string", + "description": "Name of the creative asset. This is a required field while inserting an asset. After insertion, this assetIdentifier is used to identify the uploaded asset. Characters in the name must be alphanumeric or one of the following: \".-_ \". Spaces are allowed." + }, + "type": { + "type": "string", + "description": "Type of asset to upload. This is a required field. IMAGE is solely used for IMAGE creatives. Other image assets should use HTML_IMAGE.", + "enum": [ + "FLASH", + "HTML", + "HTML_IMAGE", + "IMAGE", + "VIDEO" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + } + } + }, + "CreativeAssetMetadata": { + "id": "CreativeAssetMetadata", + "type": "object", + "description": "CreativeAssets contains properties of a creative asset file which will be uploaded or has already been uploaded. Refer to the creative sample code for how to upload assets and insert a creative.", + "properties": { + "assetIdentifier": { + "$ref": "CreativeAssetId", + "description": "ID of the creative asset. This is a required field." + }, + "clickTags": { + "type": "array", + "description": "List of detected click tags for assets. This is a read-only auto-generated field.", + "items": { + "$ref": "ClickTag" + } + }, + "detectedFeatures": { + "type": "array", + "description": "List of feature dependencies for the creative asset that are detected by DCM. Feature dependencies are features that a browser must be able to support in order to render your HTML5 creative correctly. This is a read-only, auto-generated field.", + "items": { + "type": "string", + "enum": [ + "APPLICATION_CACHE", + "AUDIO", + "CANVAS", + "CANVAS_TEXT", + "CSS_ANIMATIONS", + "CSS_BACKGROUND_SIZE", + "CSS_BORDER_IMAGE", + "CSS_BORDER_RADIUS", + "CSS_BOX_SHADOW", + "CSS_COLUMNS", + "CSS_FLEX_BOX", + "CSS_FONT_FACE", + "CSS_GENERATED_CONTENT", + "CSS_GRADIENTS", + "CSS_HSLA", + "CSS_MULTIPLE_BGS", + "CSS_OPACITY", + "CSS_REFLECTIONS", + "CSS_RGBA", + "CSS_TEXT_SHADOW", + "CSS_TRANSFORMS", + "CSS_TRANSFORMS3D", + "CSS_TRANSITIONS", + "DRAG_AND_DROP", + "GEO_LOCATION", + "HASH_CHANGE", + "HISTORY", + "INDEXED_DB", + "INLINE_SVG", + "INPUT_ATTR_AUTOCOMPLETE", + "INPUT_ATTR_AUTOFOCUS", + "INPUT_ATTR_LIST", + "INPUT_ATTR_MAX", + "INPUT_ATTR_MIN", + "INPUT_ATTR_MULTIPLE", + "INPUT_ATTR_PATTERN", + "INPUT_ATTR_PLACEHOLDER", + "INPUT_ATTR_REQUIRED", + "INPUT_ATTR_STEP", + "INPUT_TYPE_COLOR", + "INPUT_TYPE_DATE", + "INPUT_TYPE_DATETIME", + "INPUT_TYPE_DATETIME_LOCAL", + "INPUT_TYPE_EMAIL", + "INPUT_TYPE_MONTH", + "INPUT_TYPE_NUMBER", + "INPUT_TYPE_RANGE", + "INPUT_TYPE_SEARCH", + "INPUT_TYPE_TEL", + "INPUT_TYPE_TIME", + "INPUT_TYPE_URL", + "INPUT_TYPE_WEEK", + "LOCAL_STORAGE", + "POST_MESSAGE", + "SESSION_STORAGE", + "SMIL", + "SVG_CLIP_PATHS", + "SVG_FE_IMAGE", + "SVG_FILTERS", + "SVG_HREF", + "TOUCH", + "VIDEO", + "WEBGL", + "WEB_SOCKETS", + "WEB_SQL_DATABASE", + "WEB_WORKERS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeAssetMetadata\".", + "default": "dfareporting#creativeAssetMetadata" + }, + "warnedValidationRules": { + "type": "array", + "description": "Rules validated during code generation that generated a warning. This is a read-only, auto-generated field.\n\nPossible values are:\n- \"CLICK_TAG_NON_TOP_LEVEL\"\n- \"CLICK_TAG_MISSING\"\n- \"CLICK_TAG_MORE_THAN_ONE\"\n- \"CLICK_TAG_INVALID\"\n- \"ORPHANED_ASSET\"\n- \"PRIMARY_HTML_MISSING\"\n- \"EXTERNAL_FILE_REFERENCED\"\n- \"MRAID_REFERENCED\"\n- \"ADMOB_REFERENCED\"\n- \"FILE_TYPE_INVALID\"\n- \"ZIP_INVALID\"\n- \"LINKED_FILE_NOT_FOUND\"\n- \"MAX_FLASH_VERSION_11\"\n- \"NOT_SSL_COMPLIANT\"\n- \"FILE_DETAIL_EMPTY\"\n- \"ASSET_INVALID\"\n- \"GWD_PROPERTIES_INVALID\"\n- \"ENABLER_UNSUPPORTED_METHOD_DCM\"\n- \"ASSET_FORMAT_UNSUPPORTED_DCM\"\n- \"COMPONENT_UNSUPPORTED_DCM\"\n- \"HTML5_FEATURE_UNSUPPORTED' \"", + "items": { + "type": "string", + "enum": [ + "ADMOB_REFERENCED", + "ASSET_FORMAT_UNSUPPORTED_DCM", + "ASSET_INVALID", + "CLICK_TAG_INVALID", + "CLICK_TAG_MISSING", + "CLICK_TAG_MORE_THAN_ONE", + "CLICK_TAG_NON_TOP_LEVEL", + "COMPONENT_UNSUPPORTED_DCM", + "ENABLER_UNSUPPORTED_METHOD_DCM", + "EXTERNAL_FILE_REFERENCED", + "FILE_DETAIL_EMPTY", + "FILE_TYPE_INVALID", + "GWD_PROPERTIES_INVALID", + "HTML5_FEATURE_UNSUPPORTED", + "LINKED_FILE_NOT_FOUND", + "MAX_FLASH_VERSION_11", + "MRAID_REFERENCED", + "NOT_SSL_COMPLIANT", + "ORPHANED_ASSET", + "PRIMARY_HTML_MISSING", + "ZIP_INVALID" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + } + }, + "CreativeAssignment": { + "id": "CreativeAssignment", + "type": "object", + "description": "Creative Assignment.", + "properties": { + "active": { + "type": "boolean", + "description": "Whether this creative assignment is active. When true, the creative will be included in the ad's rotation." + }, + "applyEventTags": { + "type": "boolean", + "description": "Whether applicable event tags should fire when this creative assignment is rendered. If this value is unset when the ad is inserted or updated, it will default to true for all creative types EXCEPT for INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and INSTREAM_VIDEO." + }, + "clickThroughUrl": { + "$ref": "ClickThroughUrl", + "description": "Click-through URL of the creative assignment." + }, + "companionCreativeOverrides": { + "type": "array", + "description": "Companion creative overrides for this creative assignment. Applicable to video ads.", + "items": { + "$ref": "CompanionClickThroughOverride" + } + }, + "creativeGroupAssignments": { + "type": "array", + "description": "Creative group assignments for this creative assignment. Only one assignment per creative group number is allowed for a maximum of two assignments.", + "items": { + "$ref": "CreativeGroupAssignment" + } + }, + "creativeId": { + "type": "string", + "description": "ID of the creative to be assigned. This is a required field.", + "format": "int64" + }, + "creativeIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the creative. This is a read-only, auto-generated field." + }, + "endTime": { + "type": "string", + "description": "Date and time that the assigned creative should stop serving. Must be later than the start time.", + "format": "date-time" + }, + "richMediaExitOverrides": { + "type": "array", + "description": "Rich media exit overrides for this creative assignment.\nApplicable when the creative type is any of the following: \n- RICH_MEDIA_INPAGE\n- RICH_MEDIA_INPAGE_FLOATING\n- RICH_MEDIA_IM_EXPAND\n- RICH_MEDIA_EXPANDING\n- RICH_MEDIA_INTERSTITIAL_FLOAT\n- RICH_MEDIA_MOBILE_IN_APP\n- RICH_MEDIA_MULTI_FLOATING\n- RICH_MEDIA_PEEL_DOWN\n- ADVANCED_BANNER\n- VPAID_LINEAR\n- VPAID_NON_LINEAR", + "items": { + "$ref": "RichMediaExitOverride" + } + }, + "sequence": { + "type": "integer", + "description": "Sequence number of the creative assignment, applicable when the rotation type is CREATIVE_ROTATION_TYPE_SEQUENTIAL.", + "format": "int32" + }, + "sslCompliant": { + "type": "boolean", + "description": "Whether the creative to be assigned is SSL-compliant. This is a read-only field that is auto-generated when the ad is inserted or updated." + }, + "startTime": { + "type": "string", + "description": "Date and time that the assigned creative should start serving.", + "format": "date-time" + }, + "weight": { + "type": "integer", + "description": "Weight of the creative assignment, applicable when the rotation type is CREATIVE_ROTATION_TYPE_RANDOM.", + "format": "int32" + } + } + }, + "CreativeCustomEvent": { + "id": "CreativeCustomEvent", + "type": "object", + "description": "Creative Custom Event.", + "properties": { + "active": { + "type": "boolean", + "description": "Whether the event is active." + }, + "advertiserCustomEventName": { + "type": "string", + "description": "User-entered name for the event." + }, + "advertiserCustomEventType": { + "type": "string", + "description": "Type of the event. This is a read-only field.", + "enum": [ + "ADVERTISER_EVENT_COUNTER", + "ADVERTISER_EVENT_EXIT", + "ADVERTISER_EVENT_TIMER" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "artworkLabel": { + "type": "string", + "description": "Artwork label column, used to link events in DCM back to events in Studio. This is a required field and should not be modified after insertion." + }, + "artworkType": { + "type": "string", + "description": "Artwork type used by the creative.This is a read-only field.", + "enum": [ + "ARTWORK_TYPE_FLASH", + "ARTWORK_TYPE_HTML5", + "ARTWORK_TYPE_MIXED" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "exitUrl": { + "type": "string", + "description": "Exit URL of the event. This field is used only for exit events." + }, + "id": { + "type": "string", + "description": "ID of this event. This is a required field and should not be modified after insertion.", + "format": "int64" + }, + "popupWindowProperties": { + "$ref": "PopupWindowProperties", + "description": "Properties for rich media popup windows. This field is used only for exit events." + }, + "targetType": { + "type": "string", + "description": "Target type used by the event.", + "enum": [ + "TARGET_BLANK", + "TARGET_PARENT", + "TARGET_POPUP", + "TARGET_SELF", + "TARGET_TOP" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "videoReportingId": { + "type": "string", + "description": "Reporting ID, used to differentiate multiple videos in a single creative." + } + } + }, + "CreativeField": { + "id": "CreativeField", + "type": "object", + "description": "Contains properties of a creative field.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this creative field. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this creative field. This is a required field on insertion.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "id": { + "type": "string", + "description": "ID of this creative field. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeField\".", + "default": "dfareporting#creativeField" + }, + "name": { + "type": "string", + "description": "Name of this creative field. This is a required field and must be less than 256 characters long and unique among creative fields of the same advertiser." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this creative field. This is a read-only field that can be left blank.", + "format": "int64" + } + } + }, + "CreativeFieldAssignment": { + "id": "CreativeFieldAssignment", + "type": "object", + "description": "Creative Field Assignment.", + "properties": { + "creativeFieldId": { + "type": "string", + "description": "ID of the creative field.", + "format": "int64" + }, + "creativeFieldValueId": { + "type": "string", + "description": "ID of the creative field value.", + "format": "int64" + } + } + }, + "CreativeFieldValue": { + "id": "CreativeFieldValue", + "type": "object", + "description": "Contains properties of a creative field value.", + "properties": { + "id": { + "type": "string", + "description": "ID of this creative field value. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeFieldValue\".", + "default": "dfareporting#creativeFieldValue" + }, + "value": { + "type": "string", + "description": "Value of this creative field value. It needs to be less than 256 characters in length and unique per creative field." + } + } + }, + "CreativeFieldValuesListResponse": { + "id": "CreativeFieldValuesListResponse", + "type": "object", + "description": "Creative Field Value List Response", + "properties": { + "creativeFieldValues": { + "type": "array", + "description": "Creative field value collection.", + "items": { + "$ref": "CreativeFieldValue" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeFieldValuesListResponse\".", + "default": "dfareporting#creativeFieldValuesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "CreativeFieldsListResponse": { + "id": "CreativeFieldsListResponse", + "type": "object", + "description": "Creative Field List Response", + "properties": { + "creativeFields": { + "type": "array", + "description": "Creative field collection.", + "items": { + "$ref": "CreativeField" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeFieldsListResponse\".", + "default": "dfareporting#creativeFieldsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "CreativeGroup": { + "id": "CreativeGroup", + "type": "object", + "description": "Contains properties of a creative group.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this creative group. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this creative group. This is a required field on insertion.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "groupNumber": { + "type": "integer", + "description": "Subgroup of the creative group. Assign your creative groups to one of the following subgroups in order to filter or manage them more easily. This field is required on insertion and is read-only after insertion.\nAcceptable values are: \n- 1\n- 2", + "format": "int32" + }, + "id": { + "type": "string", + "description": "ID of this creative group. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeGroup\".", + "default": "dfareporting#creativeGroup" + }, + "name": { + "type": "string", + "description": "Name of this creative group. This is a required field and must be less than 256 characters long and unique among creative groups of the same advertiser." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this creative group. This is a read-only field that can be left blank.", + "format": "int64" + } + } + }, + "CreativeGroupAssignment": { + "id": "CreativeGroupAssignment", + "type": "object", + "description": "Creative Group Assignment.", + "properties": { + "creativeGroupId": { + "type": "string", + "description": "ID of the creative group to be assigned.", + "format": "int64" + }, + "creativeGroupNumber": { + "type": "string", + "description": "Creative group number of the creative group assignment.", + "enum": [ + "CREATIVE_GROUP_ONE", + "CREATIVE_GROUP_TWO" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "CreativeGroupsListResponse": { + "id": "CreativeGroupsListResponse", + "type": "object", + "description": "Creative Group List Response", + "properties": { + "creativeGroups": { + "type": "array", + "description": "Creative group collection.", + "items": { + "$ref": "CreativeGroup" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeGroupsListResponse\".", + "default": "dfareporting#creativeGroupsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "CreativeOptimizationConfiguration": { + "id": "CreativeOptimizationConfiguration", + "type": "object", + "description": "Creative optimization settings.", + "properties": { + "id": { + "type": "string", + "description": "ID of this creative optimization config. This field is auto-generated when the campaign is inserted or updated. It can be null for existing campaigns.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this creative optimization config. This is a required field and must be less than 129 characters long." + }, + "optimizationActivitys": { + "type": "array", + "description": "List of optimization activities associated with this configuration.", + "items": { + "$ref": "OptimizationActivity" + } + }, + "optimizationModel": { + "type": "string", + "description": "Optimization model for this configuration.", + "enum": [ + "CLICK", + "POST_CLICK", + "POST_CLICK_AND_IMPRESSION", + "POST_IMPRESSION" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "CreativeRotation": { + "id": "CreativeRotation", + "type": "object", + "description": "Creative Rotation.", + "properties": { + "creativeAssignments": { + "type": "array", + "description": "Creative assignments in this creative rotation.", + "items": { + "$ref": "CreativeAssignment" + } + }, + "creativeOptimizationConfigurationId": { + "type": "string", + "description": "Creative optimization configuration that is used by this ad. It should refer to one of the existing optimization configurations in the ad's campaign. If it is unset or set to 0, then the campaign's default optimization configuration will be used for this ad.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "Type of creative rotation. Can be used to specify whether to use sequential or random rotation.", + "enum": [ + "CREATIVE_ROTATION_TYPE_RANDOM", + "CREATIVE_ROTATION_TYPE_SEQUENTIAL" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "weightCalculationStrategy": { + "type": "string", + "description": "Strategy for calculating weights. Used with CREATIVE_ROTATION_TYPE_RANDOM.", + "enum": [ + "WEIGHT_STRATEGY_CUSTOM", + "WEIGHT_STRATEGY_EQUAL", + "WEIGHT_STRATEGY_HIGHEST_CTR", + "WEIGHT_STRATEGY_OPTIMIZED" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "CreativeSettings": { + "id": "CreativeSettings", + "type": "object", + "description": "Creative Settings", + "properties": { + "iFrameFooter": { + "type": "string", + "description": "Header text for iFrames for this site. Must be less than or equal to 2000 characters long." + }, + "iFrameHeader": { + "type": "string", + "description": "Header text for iFrames for this site. Must be less than or equal to 2000 characters long." + } + } + }, + "CreativesListResponse": { + "id": "CreativesListResponse", + "type": "object", + "description": "Creative List Response", + "properties": { + "creatives": { + "type": "array", + "description": "Creative collection.", + "items": { + "$ref": "Creative" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativesListResponse\".", + "default": "dfareporting#creativesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "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.", + "enum": [ + "LAST_24_MONTHS", + "LAST_30_DAYS", + "LAST_365_DAYS", + "LAST_7_DAYS", + "LAST_90_DAYS", + "MONTH_TO_DATE", + "PREVIOUS_MONTH", + "PREVIOUS_QUARTER", + "PREVIOUS_WEEK", + "PREVIOUS_YEAR", + "QUARTER_TO_DATE", + "TODAY", + "WEEK_TO_DATE", + "YEAR_TO_DATE", + "YESTERDAY" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "startDate": { + "type": "string", + "description": "The start date of the date range, inclusive. A string of the format: \"yyyy-MM-dd\".", + "format": "date" + } + } + }, + "DayPartTargeting": { + "id": "DayPartTargeting", + "type": "object", + "description": "Day Part Targeting.", + "properties": { + "daysOfWeek": { + "type": "array", + "description": "Days of the week when the ad will serve.\n\nAcceptable values are:\n- \"SUNDAY\"\n- \"MONDAY\"\n- \"TUESDAY\"\n- \"WEDNESDAY\"\n- \"THURSDAY\"\n- \"FRIDAY\"\n- \"SATURDAY\"", + "items": { + "type": "string", + "enum": [ + "FRIDAY", + "MONDAY", + "SATURDAY", + "SUNDAY", + "THURSDAY", + "TUESDAY", + "WEDNESDAY" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "hoursOfDay": { + "type": "array", + "description": "Hours of the day when the ad will serve. Must be an integer between 0 and 23 (inclusive), where 0 is midnight to 1 AM, and 23 is 11 PM to midnight. Can be specified with days of week, in which case the ad would serve during these hours on the specified days. For example, if Monday, Wednesday, Friday are the days of week specified and 9-10am, 3-5pm (hours 9, 15, and 16) is specified, the ad would serve Monday, Wednesdays, and Fridays at 9-10am and 3-5pm.", + "items": { + "type": "integer", + "format": "int32" + } + }, + "userLocalTime": { + "type": "boolean", + "description": "Whether or not to use the user's local time. If false, the America/New York time zone applies." + } + } + }, + "DefaultClickThroughEventTagProperties": { + "id": "DefaultClickThroughEventTagProperties", + "type": "object", + "description": "Properties of inheriting and overriding the default click-through event tag. A campaign may override the event tag defined at the advertiser level, and an ad may also override the campaign's setting further.", + "properties": { + "defaultClickThroughEventTagId": { + "type": "string", + "description": "ID of the click-through event tag to apply to all ads in this entity's scope.", + "format": "int64" + }, + "overrideInheritedEventTag": { + "type": "boolean", + "description": "Whether this entity should override the inherited default click-through event tag with its own defined value." + } + } + }, + "DeliverySchedule": { + "id": "DeliverySchedule", + "type": "object", + "description": "Delivery Schedule.", + "properties": { + "frequencyCap": { + "$ref": "FrequencyCap", + "description": "Limit on the number of times an individual user can be served the ad within a specified period of time." + }, + "hardCutoff": { + "type": "boolean", + "description": "Whether or not hard cutoff is enabled. If true, the ad will not serve after the end date and time. Otherwise the ad will continue to be served until it has reached its delivery goals." + }, + "impressionRatio": { + "type": "string", + "description": "Impression ratio for this ad. This ratio determines how often each ad is served relative to the others. For example, if ad A has an impression ratio of 1 and ad B has an impression ratio of 3, then DCM will serve ad B three times as often as ad A. Must be between 1 and 10.", + "format": "int64" + }, + "priority": { + "type": "string", + "description": "Serving priority of an ad, with respect to other ads. The lower the priority number, the greater the priority with which it is served.", + "enum": [ + "AD_PRIORITY_01", + "AD_PRIORITY_02", + "AD_PRIORITY_03", + "AD_PRIORITY_04", + "AD_PRIORITY_05", + "AD_PRIORITY_06", + "AD_PRIORITY_07", + "AD_PRIORITY_08", + "AD_PRIORITY_09", + "AD_PRIORITY_10", + "AD_PRIORITY_11", + "AD_PRIORITY_12", + "AD_PRIORITY_13", + "AD_PRIORITY_14", + "AD_PRIORITY_15", + "AD_PRIORITY_16" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "DfpSettings": { + "id": "DfpSettings", + "type": "object", + "description": "DFP Settings", + "properties": { + "dfp_network_code": { + "type": "string", + "description": "DFP network code for this directory site." + }, + "dfp_network_name": { + "type": "string", + "description": "DFP network name for this directory site." + }, + "programmaticPlacementAccepted": { + "type": "boolean", + "description": "Whether this directory site accepts programmatic placements." + }, + "pubPaidPlacementAccepted": { + "type": "boolean", + "description": "Whether this directory site accepts publisher-paid tags." + }, + "publisherPortalOnly": { + "type": "boolean", + "description": "Whether this directory site is available only via DoubleClick Publisher Portal." + } + } + }, + "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. If not specified, defaults to EXACT. If set to WILDCARD_EXPRESSION, '*' is allowed as a placeholder for variable length character sequences, and it can be escaped with a backslash. Note, only paid search dimensions ('dfa:paidSearch*') allow a matchType other than EXACT.", + "enum": [ + "BEGINS_WITH", + "CONTAINS", + "EXACT", + "WILDCARD_EXPRESSION" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "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" + ] + } + } + } + }, + "DirectorySite": { + "id": "DirectorySite", + "type": "object", + "description": "DirectorySites contains properties of a website from the Site Directory. Sites need to be added to an account via the Sites resource before they can be assigned to a placement.", + "properties": { + "active": { + "type": "boolean", + "description": "Whether this directory site is active." + }, + "contactAssignments": { + "type": "array", + "description": "Directory site contacts.", + "items": { + "$ref": "DirectorySiteContactAssignment" + } + }, + "countryId": { + "type": "string", + "description": "Country ID of this directory site.", + "format": "int64" + }, + "currencyId": { + "type": "string", + "description": "Currency ID of this directory site.\nPossible values are: \n- \"1\" for USD \n- \"2\" for GBP \n- \"3\" for ESP \n- \"4\" for SEK \n- \"5\" for CAD \n- \"6\" for JPY \n- \"7\" for DEM \n- \"8\" for AUD \n- \"9\" for FRF \n- \"10\" for ITL \n- \"11\" for DKK \n- \"12\" for NOK \n- \"13\" for FIM \n- \"14\" for ZAR \n- \"15\" for IEP \n- \"16\" for NLG \n- \"17\" for EUR \n- \"18\" for KRW \n- \"19\" for TWD \n- \"20\" for SGD \n- \"21\" for CNY \n- \"22\" for HKD \n- \"23\" for NZD \n- \"24\" for MYR \n- \"25\" for BRL \n- \"26\" for PTE \n- \"27\" for MXP \n- \"28\" for CLP \n- \"29\" for TRY \n- \"30\" for ARS \n- \"31\" for PEN \n- \"32\" for ILS \n- \"33\" for CHF \n- \"34\" for VEF \n- \"35\" for COP \n- \"36\" for GTQ", + "format": "int64" + }, + "description": { + "type": "string", + "description": "Description of this directory site." + }, + "id": { + "type": "string", + "description": "ID of this directory site. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this directory site. This is a read-only, auto-generated field." + }, + "inpageTagFormats": { + "type": "array", + "description": "Tag types for regular placements.\n\nAcceptable values are:\n- \"STANDARD\"\n- \"IFRAME_JAVASCRIPT_INPAGE\"\n- \"INTERNAL_REDIRECT_INPAGE\"\n- \"JAVASCRIPT_INPAGE\"", + "items": { + "type": "string", + "enum": [ + "IFRAME_JAVASCRIPT_INPAGE", + "INTERNAL_REDIRECT_INPAGE", + "JAVASCRIPT_INPAGE", + "STANDARD" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + }, + "interstitialTagFormats": { + "type": "array", + "description": "Tag types for interstitial placements.\n\nAcceptable values are:\n- \"IFRAME_JAVASCRIPT_INTERSTITIAL\"\n- \"INTERNAL_REDIRECT_INTERSTITIAL\"\n- \"JAVASCRIPT_INTERSTITIAL\"", + "items": { + "type": "string", + "enum": [ + "IFRAME_JAVASCRIPT_INTERSTITIAL", + "INTERNAL_REDIRECT_INTERSTITIAL", + "JAVASCRIPT_INTERSTITIAL" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#directorySite\".", + "default": "dfareporting#directorySite" + }, + "name": { + "type": "string", + "description": "Name of this directory site." + }, + "parentId": { + "type": "string", + "description": "Parent directory site ID.", + "format": "int64" + }, + "settings": { + "$ref": "DirectorySiteSettings", + "description": "Directory site settings." + }, + "url": { + "type": "string", + "description": "URL of this directory site." + } + } + }, + "DirectorySiteContact": { + "id": "DirectorySiteContact", + "type": "object", + "description": "Contains properties of a Site Directory contact.", + "properties": { + "email": { + "type": "string", + "description": "Email address of this directory site contact." + }, + "firstName": { + "type": "string", + "description": "First name of this directory site contact." + }, + "id": { + "type": "string", + "description": "ID of this directory site contact. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#directorySiteContact\".", + "default": "dfareporting#directorySiteContact" + }, + "lastName": { + "type": "string", + "description": "Last name of this directory site contact." + }, + "role": { + "type": "string", + "description": "Directory site contact role.", + "enum": [ + "ADMIN", + "EDIT", + "VIEW" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "type": { + "type": "string", + "description": "Directory site contact type.", + "enum": [ + "BILLING", + "OTHER", + "SALES", + "TECHNICAL" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "DirectorySiteContactAssignment": { + "id": "DirectorySiteContactAssignment", + "type": "object", + "description": "Directory Site Contact Assignment", + "properties": { + "contactId": { + "type": "string", + "description": "ID of this directory site contact. This is a read-only, auto-generated field.", + "format": "int64" + }, + "visibility": { + "type": "string", + "description": "Visibility of this directory site contact assignment. When set to PUBLIC this contact assignment is visible to all account and agency users; when set to PRIVATE it is visible only to the site.", + "enum": [ + "PRIVATE", + "PUBLIC" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "DirectorySiteContactsListResponse": { + "id": "DirectorySiteContactsListResponse", + "type": "object", + "description": "Directory Site Contact List Response", + "properties": { + "directorySiteContacts": { + "type": "array", + "description": "Directory site contact collection", + "items": { + "$ref": "DirectorySiteContact" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#directorySiteContactsListResponse\".", + "default": "dfareporting#directorySiteContactsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "DirectorySiteSettings": { + "id": "DirectorySiteSettings", + "type": "object", + "description": "Directory Site Settings", + "properties": { + "activeViewOptOut": { + "type": "boolean", + "description": "Whether this directory site has disabled active view creatives." + }, + "dfp_settings": { + "$ref": "DfpSettings", + "description": "Directory site DFP settings." + }, + "instream_video_placement_accepted": { + "type": "boolean", + "description": "Whether this site accepts in-stream video ads." + }, + "interstitialPlacementAccepted": { + "type": "boolean", + "description": "Whether this site accepts interstitial ads." + }, + "nielsenOcrOptOut": { + "type": "boolean", + "description": "Whether this directory site has disabled Nielsen OCR reach ratings." + }, + "verificationTagOptOut": { + "type": "boolean", + "description": "Whether this directory site has disabled generation of Verification ins tags." + }, + "videoActiveViewOptOut": { + "type": "boolean", + "description": "Whether this directory site has disabled active view for in-stream video creatives." + } + } + }, + "DirectorySitesListResponse": { + "id": "DirectorySitesListResponse", + "type": "object", + "description": "Directory Site List Response", + "properties": { + "directorySites": { + "type": "array", + "description": "Directory site collection.", + "items": { + "$ref": "DirectorySite" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#directorySitesListResponse\".", + "default": "dfareporting#directorySitesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "EventTag": { + "id": "EventTag", + "type": "object", + "description": "Contains properties of an event tag.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this event tag. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this event tag. This field or the campaignId field is required on insertion.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "campaignId": { + "type": "string", + "description": "Campaign ID of this event tag. This field or the advertiserId field is required on insertion.", + "format": "int64" + }, + "campaignIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the campaign. This is a read-only, auto-generated field." + }, + "enabledByDefault": { + "type": "boolean", + "description": "Whether this event tag should be automatically enabled for all of the advertiser's campaigns and ads." + }, + "id": { + "type": "string", + "description": "ID of this event tag. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#eventTag\".", + "default": "dfareporting#eventTag" + }, + "name": { + "type": "string", + "description": "Name of this event tag. This is a required field and must be less than 256 characters long." + }, + "siteFilterType": { + "type": "string", + "description": "Site filter type for this event tag. If no type is specified then the event tag will be applied to all sites.", + "enum": [ + "BLACKLIST", + "WHITELIST" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "siteIds": { + "type": "array", + "description": "Filter list of site IDs associated with this event tag. The siteFilterType determines whether this is a whitelist or blacklist filter.", + "items": { + "type": "string", + "format": "int64" + } + }, + "sslCompliant": { + "type": "boolean", + "description": "Whether this tag is SSL-compliant or not. This is a read-only field." + }, + "status": { + "type": "string", + "description": "Status of this event tag. Must be ENABLED for this event tag to fire. This is a required field.", + "enum": [ + "DISABLED", + "ENABLED" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this event tag. This is a read-only field that can be left blank.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "Event tag type. Can be used to specify whether to use a third-party pixel, a third-party JavaScript URL, or a third-party click-through URL for either impression or click tracking. This is a required field.", + "enum": [ + "CLICK_THROUGH_EVENT_TAG", + "IMPRESSION_IMAGE_EVENT_TAG", + "IMPRESSION_JAVASCRIPT_EVENT_TAG" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "url": { + "type": "string", + "description": "Payload URL for this event tag. The URL on a click-through event tag should have a landing page URL appended to the end of it. This field is required on insertion." + }, + "urlEscapeLevels": { + "type": "integer", + "description": "Number of times the landing page URL should be URL-escaped before being appended to the click-through event tag URL. Only applies to click-through event tags as specified by the event tag type.", + "format": "int32" + } + } + }, + "EventTagOverride": { + "id": "EventTagOverride", + "type": "object", + "description": "Event tag override information.", + "properties": { + "enabled": { + "type": "boolean", + "description": "Whether this override is enabled." + }, + "id": { + "type": "string", + "description": "ID of this event tag override. This is a read-only, auto-generated field.", + "format": "int64" + } + } + }, + "EventTagsListResponse": { + "id": "EventTagsListResponse", + "type": "object", + "description": "Event Tag List Response", + "properties": { + "eventTags": { + "type": "array", + "description": "Event tag collection.", + "items": { + "$ref": "EventTag" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#eventTagsListResponse\".", + "default": "dfareporting#eventTagsListResponse" + } + } + }, + "File": { + "id": "File", + "type": "object", + "description": "Represents a File resource. A file contains the metadata 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 filename of the file." + }, + "format": { + "type": "string", + "description": "The output format of the report. Only available once the file is available.", + "enum": [ + "CSV", + "EXCEL" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "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.", + "enum": [ + "CANCELLED", + "FAILED", + "PROCESSING", + "REPORT_AVAILABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "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." + } + } + }, + "FloodlightActivitiesGenerateTagResponse": { + "id": "FloodlightActivitiesGenerateTagResponse", + "type": "object", + "description": "Floodlight Activity GenerateTag Response", + "properties": { + "floodlightActivityTag": { + "type": "string", + "description": "Generated tag for this floodlight activity." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightActivitiesGenerateTagResponse\".", + "default": "dfareporting#floodlightActivitiesGenerateTagResponse" + } + } + }, + "FloodlightActivitiesListResponse": { + "id": "FloodlightActivitiesListResponse", + "type": "object", + "description": "Floodlight Activity List Response", + "properties": { + "floodlightActivities": { + "type": "array", + "description": "Floodlight activity collection.", + "items": { + "$ref": "FloodlightActivity" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightActivitiesListResponse\".", + "default": "dfareporting#floodlightActivitiesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "FloodlightActivity": { + "id": "FloodlightActivity", + "type": "object", + "description": "Contains properties of a Floodlight activity.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this floodlight activity. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this floodlight activity. If this field is left blank, the value will be copied over either from the activity group's advertiser or the existing activity's advertiser.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "cacheBustingType": { + "type": "string", + "description": "Code type used for cache busting in the generated tag.", + "enum": [ + "ACTIVE_SERVER_PAGE", + "COLD_FUSION", + "JAVASCRIPT", + "JSP", + "PHP" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "countingMethod": { + "type": "string", + "description": "Counting method for conversions for this floodlight activity. This is a required field.", + "enum": [ + "ITEMS_SOLD_COUNTING", + "SESSION_COUNTING", + "STANDARD_COUNTING", + "TRANSACTIONS_COUNTING", + "UNIQUE_COUNTING" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "defaultTags": { + "type": "array", + "description": "Dynamic floodlight tags.", + "items": { + "$ref": "FloodlightActivityDynamicTag" + } + }, + "expectedUrl": { + "type": "string", + "description": "URL where this tag will be deployed. If specified, must be less than 256 characters long." + }, + "floodlightActivityGroupId": { + "type": "string", + "description": "Floodlight activity group ID of this floodlight activity. This is a required field.", + "format": "int64" + }, + "floodlightActivityGroupName": { + "type": "string", + "description": "Name of the associated floodlight activity group. This is a read-only field." + }, + "floodlightActivityGroupTagString": { + "type": "string", + "description": "Tag string of the associated floodlight activity group. This is a read-only field." + }, + "floodlightActivityGroupType": { + "type": "string", + "description": "Type of the associated floodlight activity group. This is a read-only field.", + "enum": [ + "COUNTER", + "SALE" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "floodlightConfigurationId": { + "type": "string", + "description": "Floodlight configuration ID of this floodlight activity. If this field is left blank, the value will be copied over either from the activity group's floodlight configuration or from the existing activity's floodlight configuration.", + "format": "int64" + }, + "floodlightConfigurationIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the floodlight configuration. This is a read-only, auto-generated field." + }, + "hidden": { + "type": "boolean", + "description": "Whether this activity is archived." + }, + "id": { + "type": "string", + "description": "ID of this floodlight activity. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this floodlight activity. This is a read-only, auto-generated field." + }, + "imageTagEnabled": { + "type": "boolean", + "description": "Whether the image tag is enabled for this activity." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightActivity\".", + "default": "dfareporting#floodlightActivity" + }, + "name": { + "type": "string", + "description": "Name of this floodlight activity. This is a required field. Must be less than 129 characters long and cannot contain quotes." + }, + "notes": { + "type": "string", + "description": "General notes or implementation instructions for the tag." + }, + "publisherTags": { + "type": "array", + "description": "Publisher dynamic floodlight tags.", + "items": { + "$ref": "FloodlightActivityPublisherDynamicTag" + } + }, + "secure": { + "type": "boolean", + "description": "Whether this tag should use SSL." + }, + "sslCompliant": { + "type": "boolean", + "description": "Whether the floodlight activity is SSL-compliant. This is a read-only field, its value detected by the system from the floodlight tags." + }, + "sslRequired": { + "type": "boolean", + "description": "Whether this floodlight activity must be SSL-compliant." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this floodlight activity. This is a read-only field that can be left blank.", + "format": "int64" + }, + "tagFormat": { + "type": "string", + "description": "Tag format type for the floodlight activity. If left blank, the tag format will default to HTML.", + "enum": [ + "HTML", + "XHTML" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "tagString": { + "type": "string", + "description": "Value of the cat= paramter in the floodlight tag, which the ad servers use to identify the activity. This is optional: if empty, a new tag string will be generated for you. This string must be 1 to 8 characters long, with valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among activities of the same activity group. This field is read-only after insertion." + }, + "userDefinedVariableTypes": { + "type": "array", + "description": "List of the user-defined variables used by this conversion tag. These map to the \"u[1-20]=\" in the tags. Each of these can have a user defined type.\nAcceptable values are:\n- \"U1\"\n- \"U2\"\n- \"U3\"\n- \"U4\"\n- \"U5\"\n- \"U6\"\n- \"U7\"\n- \"U8\"\n- \"U9\"\n- \"U10\"\n- \"U11\"\n- \"U12\"\n- \"U13\"\n- \"U14\"\n- \"U15\"\n- \"U16\"\n- \"U17\"\n- \"U18\"\n- \"U19\"\n- \"U20\"", + "items": { + "type": "string", + "enum": [ + "U1", + "U10", + "U11", + "U12", + "U13", + "U14", + "U15", + "U16", + "U17", + "U18", + "U19", + "U2", + "U20", + "U3", + "U4", + "U5", + "U6", + "U7", + "U8", + "U9" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + } + }, + "FloodlightActivityDynamicTag": { + "id": "FloodlightActivityDynamicTag", + "type": "object", + "description": "Dynamic Tag", + "properties": { + "id": { + "type": "string", + "description": "ID of this dynamic tag. This is a read-only, auto-generated field.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this tag." + }, + "tag": { + "type": "string", + "description": "Tag code." + } + } + }, + "FloodlightActivityGroup": { + "id": "FloodlightActivityGroup", + "type": "object", + "description": "Contains properties of a Floodlight activity group.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this floodlight activity group. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this floodlight activity group. If this field is left blank, the value will be copied over either from the floodlight configuration's advertiser or from the existing activity group's advertiser.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "floodlightConfigurationId": { + "type": "string", + "description": "Floodlight configuration ID of this floodlight activity group. This is a required field.", + "format": "int64" + }, + "floodlightConfigurationIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the floodlight configuration. This is a read-only, auto-generated field." + }, + "id": { + "type": "string", + "description": "ID of this floodlight activity group. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this floodlight activity group. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightActivityGroup\".", + "default": "dfareporting#floodlightActivityGroup" + }, + "name": { + "type": "string", + "description": "Name of this floodlight activity group. This is a required field. Must be less than 65 characters long and cannot contain quotes." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this floodlight activity group. This is a read-only field that can be left blank.", + "format": "int64" + }, + "tagString": { + "type": "string", + "description": "Value of the type= parameter in the floodlight tag, which the ad servers use to identify the activity group that the activity belongs to. This is optional: if empty, a new tag string will be generated for you. This string must be 1 to 8 characters long, with valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among activity groups of the same floodlight configuration. This field is read-only after insertion." + }, + "type": { + "type": "string", + "description": "Type of the floodlight activity group. This is a required field that is read-only after insertion.", + "enum": [ + "COUNTER", + "SALE" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "FloodlightActivityGroupsListResponse": { + "id": "FloodlightActivityGroupsListResponse", + "type": "object", + "description": "Floodlight Activity Group List Response", + "properties": { + "floodlightActivityGroups": { + "type": "array", + "description": "Floodlight activity group collection.", + "items": { + "$ref": "FloodlightActivityGroup" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightActivityGroupsListResponse\".", + "default": "dfareporting#floodlightActivityGroupsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "FloodlightActivityPublisherDynamicTag": { + "id": "FloodlightActivityPublisherDynamicTag", + "type": "object", + "description": "Publisher Dynamic Tag", + "properties": { + "clickThrough": { + "type": "boolean", + "description": "Whether this tag is applicable only for click-throughs." + }, + "directorySiteId": { + "type": "string", + "description": "Directory site ID of this dynamic tag. This is a write-only field that can be used as an alternative to the siteId field. When this resource is retrieved, only the siteId field will be populated.", + "format": "int64" + }, + "dynamicTag": { + "$ref": "FloodlightActivityDynamicTag", + "description": "Dynamic floodlight tag." + }, + "siteId": { + "type": "string", + "description": "Site ID of this dynamic tag.", + "format": "int64" + }, + "siteIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the site. This is a read-only, auto-generated field." + }, + "viewThrough": { + "type": "boolean", + "description": "Whether this tag is applicable only for view-throughs." + } + } + }, + "FloodlightConfiguration": { + "id": "FloodlightConfiguration", + "type": "object", + "description": "Contains properties of a Floodlight configuration.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this floodlight configuration. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of the parent advertiser of this floodlight configuration.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "analyticsDataSharingEnabled": { + "type": "boolean", + "description": "Whether advertiser data is shared with Google Analytics." + }, + "exposureToConversionEnabled": { + "type": "boolean", + "description": "Whether the exposure-to-conversion report is enabled. This report shows detailed pathway information on up to 10 of the most recent ad exposures seen by a user before converting." + }, + "firstDayOfWeek": { + "type": "string", + "description": "Day that will be counted as the first day of the week in reports. This is a required field.", + "enum": [ + "MONDAY", + "SUNDAY" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "id": { + "type": "string", + "description": "ID of this floodlight configuration. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this floodlight configuration. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightConfiguration\".", + "default": "dfareporting#floodlightConfiguration" + }, + "lookbackConfiguration": { + "$ref": "LookbackConfiguration", + "description": "Lookback window settings for this floodlight configuration." + }, + "naturalSearchConversionAttributionOption": { + "type": "string", + "description": "Types of attribution options for natural search conversions.", + "enum": [ + "EXCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION", + "INCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION", + "INCLUDE_NATURAL_SEARCH_TIERED_CONVERSION_ATTRIBUTION" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "omnitureSettings": { + "$ref": "OmnitureSettings", + "description": "Settings for DCM Omniture integration." + }, + "sslRequired": { + "type": "boolean", + "description": "Whether floodlight activities owned by this configuration are required to be SSL-compliant." + }, + "standardVariableTypes": { + "type": "array", + "description": "List of standard variables enabled for this configuration.\n\nAcceptable values are:\n- \"ORD\"\n- \"NUM\"", + "items": { + "type": "string", + "enum": [ + "NUM", + "ORD", + "TRAN", + "U" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this floodlight configuration. This is a read-only field that can be left blank.", + "format": "int64" + }, + "tagSettings": { + "$ref": "TagSettings", + "description": "Configuration settings for dynamic and image floodlight tags." + }, + "userDefinedVariableConfigurations": { + "type": "array", + "description": "List of user defined variables enabled for this configuration.", + "items": { + "$ref": "UserDefinedVariableConfiguration" + } + } + } + }, + "FloodlightConfigurationsListResponse": { + "id": "FloodlightConfigurationsListResponse", + "type": "object", + "description": "Floodlight Configuration List Response", + "properties": { + "floodlightConfigurations": { + "type": "array", + "description": "Floodlight configuration collection.", + "items": { + "$ref": "FloodlightConfiguration" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightConfigurationsListResponse\".", + "default": "dfareporting#floodlightConfigurationsListResponse" + } + } + }, + "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" + } + } + } + }, + "FrequencyCap": { + "id": "FrequencyCap", + "type": "object", + "description": "Frequency Cap.", + "properties": { + "duration": { + "type": "string", + "description": "Duration of time, in seconds, for this frequency cap. The maximum duration is 90 days in seconds, or 7,776,000.", + "format": "int64" + }, + "impressions": { + "type": "string", + "description": "Number of times an individual user can be served the ad within the specified duration. The maximum allowed is 15.", + "format": "int64" + } + } + }, + "FsCommand": { + "id": "FsCommand", + "type": "object", + "description": "FsCommand.", + "properties": { + "left": { + "type": "integer", + "description": "Distance from the left of the browser.Applicable when positionOption is DISTANCE_FROM_TOP_LEFT_CORNER.", + "format": "int32" + }, + "positionOption": { + "type": "string", + "description": "Position in the browser where the window will open.", + "enum": [ + "CENTERED", + "DISTANCE_FROM_TOP_LEFT_CORNER" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "top": { + "type": "integer", + "description": "Distance from the top of the browser. Applicable when positionOption is DISTANCE_FROM_TOP_LEFT_CORNER.", + "format": "int32" + }, + "windowHeight": { + "type": "integer", + "description": "Height of the window.", + "format": "int32" + }, + "windowWidth": { + "type": "integer", + "description": "Width of the window.", + "format": "int32" + } + } + }, + "GeoTargeting": { + "id": "GeoTargeting", + "type": "object", + "description": "Geographical Targeting.", + "properties": { + "cities": { + "type": "array", + "description": "Cities to be targeted. For each city only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting a city, do not target or exclude the country of the city, and do not target the metro or region of the city.", + "items": { + "$ref": "City" + } + }, + "countries": { + "type": "array", + "description": "Countries to be targeted or excluded from targeting, depending on the setting of the excludeCountries field. For each country only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting or excluding a country, do not target regions, cities, metros, or postal codes in the same country.", + "items": { + "$ref": "Country" + } + }, + "excludeCountries": { + "type": "boolean", + "description": "Whether or not to exclude the countries in the countries field from targeting. If false, the countries field refers to countries which will be targeted by the ad." + }, + "metros": { + "type": "array", + "description": "Metros to be targeted. For each metro only dmaId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting a metro, do not target or exclude the country of the metro.", + "items": { + "$ref": "Metro" + } + }, + "postalCodes": { + "type": "array", + "description": "Postal codes to be targeted. For each postal code only id is required. The other fields are populated automatically when the ad is inserted or updated. If targeting a postal code, do not target or exclude the country of the postal code.", + "items": { + "$ref": "PostalCode" + } + }, + "regions": { + "type": "array", + "description": "Regions to be targeted. For each region only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting a region, do not target or exclude the country of the region.", + "items": { + "$ref": "Region" + } + } + } + }, + "KeyValueTargetingExpression": { + "id": "KeyValueTargetingExpression", + "type": "object", + "description": "Key Value Targeting Expression.", + "properties": { + "expression": { + "type": "string", + "description": "Keyword expression being targeted by the ad." + } + } + }, + "LandingPage": { + "id": "LandingPage", + "type": "object", + "description": "Contains information about where a user's browser is taken after the user clicks an ad.", + "properties": { + "default": { + "type": "boolean", + "description": "Whether or not this landing page will be assigned to any ads or creatives that do not have a landing page assigned explicitly. Only one default landing page is allowed per campaign." + }, + "id": { + "type": "string", + "description": "ID of this landing page. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#landingPage\".", + "default": "dfareporting#landingPage" + }, + "name": { + "type": "string", + "description": "Name of this landing page. This is a required field. It must be less than 256 characters long, and must be unique among landing pages of the same campaign." + }, + "url": { + "type": "string", + "description": "URL of this landing page. This is a required field." + } + } + }, + "LandingPagesListResponse": { + "id": "LandingPagesListResponse", + "type": "object", + "description": "Landing Page List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#landingPagesListResponse\".", + "default": "dfareporting#landingPagesListResponse" + }, + "landingPages": { + "type": "array", + "description": "Landing page collection", + "items": { + "$ref": "LandingPage" + } + } + } + }, + "LastModifiedInfo": { + "id": "LastModifiedInfo", + "type": "object", + "description": "Modification timestamp.", + "properties": { + "time": { + "type": "string", + "description": "Timestamp of the last change in milliseconds since epoch.", + "format": "int64" + } + } + }, + "ListTargetingExpression": { + "id": "ListTargetingExpression", + "type": "object", + "description": "Remarketing List Targeting Expression.", + "properties": { + "expression": { + "type": "string", + "description": "Expression describing which lists are being targeted by the ad." + } + } + }, + "LookbackConfiguration": { + "id": "LookbackConfiguration", + "type": "object", + "description": "Lookback configuration settings.", + "properties": { + "clickDuration": { + "type": "integer", + "description": "Lookback window, in days, from the last time a given user clicked on one of your ads. If you enter 0, clicks will not be considered as triggering events for floodlight tracking. If you leave this field blank, the default value for your account will be used.", + "format": "int32" + }, + "postImpressionActivitiesDuration": { + "type": "integer", + "description": "Lookback window, in days, from the last time a given user viewed one of your ads. If you enter 0, impressions will not be considered as triggering events for floodlight tracking. If you leave this field blank, the default value for your account will be used.", + "format": "int32" + } + } + }, + "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" + } + } + }, + "Metro": { + "id": "Metro", + "type": "object", + "description": "Contains information about a metro region that can be targeted by ads.", + "properties": { + "countryCode": { + "type": "string", + "description": "Country code of the country to which this metro region belongs." + }, + "countryDartId": { + "type": "string", + "description": "DART ID of the country to which this metro region belongs.", + "format": "int64" + }, + "dartId": { + "type": "string", + "description": "DART ID of this metro region.", + "format": "int64" + }, + "dmaId": { + "type": "string", + "description": "DMA ID of this metro region. This is the ID used for targeting and generating reports, and is equivalent to metro_code.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#metro\".", + "default": "dfareporting#metro" + }, + "metroCode": { + "type": "string", + "description": "Metro code of this metro region. This is equivalent to dma_id." + }, + "name": { + "type": "string", + "description": "Name of this metro region." + } + } + }, + "MetrosListResponse": { + "id": "MetrosListResponse", + "type": "object", + "description": "Metro List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#metrosListResponse\".", + "default": "dfareporting#metrosListResponse" + }, + "metros": { + "type": "array", + "description": "Metro collection.", + "items": { + "$ref": "Metro" + } + } + } + }, + "MobileCarrier": { + "id": "MobileCarrier", + "type": "object", + "description": "Contains information about a mobile carrier that can be targeted by ads.", + "properties": { + "countryCode": { + "type": "string", + "description": "Country code of the country to which this mobile carrier belongs." + }, + "countryDartId": { + "type": "string", + "description": "DART ID of the country to which this mobile carrier belongs.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "ID of this mobile carrier.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#mobileCarrier\".", + "default": "dfareporting#mobileCarrier" + }, + "name": { + "type": "string", + "description": "Name of this mobile carrier." + } + } + }, + "MobileCarriersListResponse": { + "id": "MobileCarriersListResponse", + "type": "object", + "description": "Mobile Carrier List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#mobileCarriersListResponse\".", + "default": "dfareporting#mobileCarriersListResponse" + }, + "mobileCarriers": { + "type": "array", + "description": "Mobile carrier collection.", + "items": { + "$ref": "MobileCarrier" + } + } + } + }, + "ObjectFilter": { + "id": "ObjectFilter", + "type": "object", + "description": "Object Filter.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#objectFilter\".", + "default": "dfareporting#objectFilter" + }, + "objectIds": { + "type": "array", + "description": "Applicable when status is ASSIGNED. The user has access to objects with these object IDs.", + "items": { + "type": "string", + "format": "int64" + } + }, + "status": { + "type": "string", + "description": "Status of the filter. NONE means the user has access to none of the objects. ALL means the user has access to all objects. ASSIGNED means the user has access to the objects with IDs in the objectIds list.", + "enum": [ + "ALL", + "ASSIGNED", + "NONE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "OffsetPosition": { + "id": "OffsetPosition", + "type": "object", + "description": "Offset Position.", + "properties": { + "left": { + "type": "integer", + "description": "Offset distance from left side of an asset or a window.", + "format": "int32" + }, + "top": { + "type": "integer", + "description": "Offset distance from top side of an asset or a window.", + "format": "int32" + } + } + }, + "OmnitureSettings": { + "id": "OmnitureSettings", + "type": "object", + "description": "Omniture Integration Settings.", + "properties": { + "omnitureCostDataEnabled": { + "type": "boolean", + "description": "Whether placement cost data will be sent to Omniture. This property can be enabled only if omnitureIntegrationEnabled is true." + }, + "omnitureIntegrationEnabled": { + "type": "boolean", + "description": "Whether Omniture integration is enabled. This property can be enabled only when the \"Advanced Ad Serving\" account setting is enabled." + } + } + }, + "OperatingSystem": { + "id": "OperatingSystem", + "type": "object", + "description": "Contains information about an operating system that can be targeted by ads.", + "properties": { + "dartId": { + "type": "string", + "description": "DART ID of this operating system. This is the ID used for targeting.", + "format": "int64" + }, + "desktop": { + "type": "boolean", + "description": "Whether this operating system is for desktop." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#operatingSystem\".", + "default": "dfareporting#operatingSystem" + }, + "mobile": { + "type": "boolean", + "description": "Whether this operating system is for mobile." + }, + "name": { + "type": "string", + "description": "Name of this operating system." + } + } + }, + "OperatingSystemVersion": { + "id": "OperatingSystemVersion", + "type": "object", + "description": "Contains information about a particular version of an operating system that can be targeted by ads.", + "properties": { + "id": { + "type": "string", + "description": "ID of this operating system version.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#operatingSystemVersion\".", + "default": "dfareporting#operatingSystemVersion" + }, + "majorVersion": { + "type": "string", + "description": "Major version (leftmost number) of this operating system version." + }, + "minorVersion": { + "type": "string", + "description": "Minor version (number after the first dot) of this operating system version." + }, + "name": { + "type": "string", + "description": "Name of this operating system version." + }, + "operatingSystem": { + "$ref": "OperatingSystem", + "description": "Operating system of this operating system version." + } + } + }, + "OperatingSystemVersionsListResponse": { + "id": "OperatingSystemVersionsListResponse", + "type": "object", + "description": "Operating System Version List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#operatingSystemVersionsListResponse\".", + "default": "dfareporting#operatingSystemVersionsListResponse" + }, + "operatingSystemVersions": { + "type": "array", + "description": "Operating system version collection.", + "items": { + "$ref": "OperatingSystemVersion" + } + } + } + }, + "OperatingSystemsListResponse": { + "id": "OperatingSystemsListResponse", + "type": "object", + "description": "Operating System List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#operatingSystemsListResponse\".", + "default": "dfareporting#operatingSystemsListResponse" + }, + "operatingSystems": { + "type": "array", + "description": "Operating system collection.", + "items": { + "$ref": "OperatingSystem" + } + } + } + }, + "OptimizationActivity": { + "id": "OptimizationActivity", + "type": "object", + "description": "Creative optimization activity.", + "properties": { + "floodlightActivityId": { + "type": "string", + "description": "Floodlight activity ID of this optimization activity. This is a required field.", + "format": "int64" + }, + "floodlightActivityIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the floodlight activity. This is a read-only, auto-generated field." + }, + "weight": { + "type": "integer", + "description": "Weight associated with this optimization. Must be greater than 1. The weight assigned will be understood in proportion to the weights assigned to the other optimization activities.", + "format": "int32" + } + } + }, + "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" + } + } + } + }, + "Placement": { + "id": "Placement", + "type": "object", + "description": "Contains properties of a placement.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this placement. This field can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this placement. This field can be left blank.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "archived": { + "type": "boolean", + "description": "Whether this placement is archived." + }, + "campaignId": { + "type": "string", + "description": "Campaign ID of this placement. This field is a required field on insertion.", + "format": "int64" + }, + "campaignIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the campaign. This is a read-only, auto-generated field." + }, + "comment": { + "type": "string", + "description": "Comments for this placement." + }, + "compatibility": { + "type": "string", + "description": "Placement compatibility. WEB and WEB_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps.IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard. This field is required on insertion.", + "enum": [ + "APP", + "APP_INTERSTITIAL", + "IN_STREAM_VIDEO", + "WEB", + "WEB_INTERSTITIAL" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "contentCategoryId": { + "type": "string", + "description": "ID of the content category assigned to this placement.", + "format": "int64" + }, + "createInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the creation of this placement. This is a read-only field." + }, + "directorySiteId": { + "type": "string", + "description": "Directory site ID of this placement. On insert, you must set either this field or the siteId field to specify the site associated with this placement. This is a required field that is read-only after insertion.", + "format": "int64" + }, + "directorySiteIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the directory site. This is a read-only, auto-generated field." + }, + "externalId": { + "type": "string", + "description": "External ID for this placement." + }, + "id": { + "type": "string", + "description": "ID of this placement. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this placement. This is a read-only, auto-generated field." + }, + "keyName": { + "type": "string", + "description": "Key name of this placement. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placement\".", + "default": "dfareporting#placement" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the most recent modification of this placement. This is a read-only field." + }, + "lookbackConfiguration": { + "$ref": "LookbackConfiguration", + "description": "Lookback window settings for this placement." + }, + "name": { + "type": "string", + "description": "Name of this placement.This is a required field and must be less than 256 characters long." + }, + "paymentApproved": { + "type": "boolean", + "description": "Whether payment was approved for this placement. This is a read-only field relevant only to publisher-paid placements." + }, + "paymentSource": { + "type": "string", + "description": "Payment source for this placement. This is a required field that is read-only after insertion.", + "enum": [ + "PLACEMENT_AGENCY_PAID", + "PLACEMENT_PUBLISHER_PAID" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "placementGroupId": { + "type": "string", + "description": "ID of this placement's group, if applicable.", + "format": "int64" + }, + "placementGroupIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the placement group. This is a read-only, auto-generated field." + }, + "placementStrategyId": { + "type": "string", + "description": "ID of the placement strategy assigned to this placement.", + "format": "int64" + }, + "pricingSchedule": { + "$ref": "PricingSchedule", + "description": "Pricing schedule of this placement. This field is required on insertion, specifically subfields startDate, endDate and pricingType." + }, + "primary": { + "type": "boolean", + "description": "Whether this placement is the primary placement of a roadblock (placement group). You cannot change this field from true to false. Setting this field to true will automatically set the primary field on the original primary placement of the roadblock to false, and it will automatically set the roadblock's primaryPlacementId field to the ID of this placement." + }, + "publisherUpdateInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the last publisher update. This is a read-only field." + }, + "siteId": { + "type": "string", + "description": "Site ID associated with this placement. On insert, you must set either this field or the directorySiteId field to specify the site associated with this placement. This is a required field that is read-only after insertion.", + "format": "int64" + }, + "siteIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the site. This is a read-only, auto-generated field." + }, + "size": { + "$ref": "Size", + "description": "Size associated with this placement. When inserting or updating a placement, only the size ID field is used. This field is required on insertion." + }, + "sslRequired": { + "type": "boolean", + "description": "Whether creatives assigned to this placement must be SSL-compliant." + }, + "status": { + "type": "string", + "description": "Third-party placement status.", + "enum": [ + "ACKNOWLEDGE_ACCEPTANCE", + "ACKNOWLEDGE_REJECTION", + "DRAFT", + "PAYMENT_ACCEPTED", + "PAYMENT_REJECTED", + "PENDING_REVIEW" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this placement. This field can be left blank.", + "format": "int64" + }, + "tagFormats": { + "type": "array", + "description": "Tag formats to generate for this placement. This field is required on insertion.\nAcceptable values are:\n- \"PLACEMENT_TAG_STANDARD\"\n- \"PLACEMENT_TAG_IFRAME_JAVASCRIPT\"\n- \"PLACEMENT_TAG_IFRAME_ILAYER\"\n- \"PLACEMENT_TAG_INTERNAL_REDIRECT\"\n- \"PLACEMENT_TAG_JAVASCRIPT\"\n- \"PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT\"\n- \"PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT\"\n- \"PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT\"\n- \"PLACEMENT_TAG_CLICK_COMMANDS\"\n- \"PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH\"\n- \"PLACEMENT_TAG_TRACKING\"\n- \"PLACEMENT_TAG_TRACKING_IFRAME\"\n- \"PLACEMENT_TAG_TRACKING_JAVASCRIPT\"", + "items": { + "type": "string", + "enum": [ + "PLACEMENT_TAG_CLICK_COMMANDS", + "PLACEMENT_TAG_IFRAME_ILAYER", + "PLACEMENT_TAG_IFRAME_JAVASCRIPT", + "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3", + "PLACEMENT_TAG_INTERNAL_REDIRECT", + "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT", + "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT", + "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT", + "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_JAVASCRIPT", + "PLACEMENT_TAG_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_STANDARD", + "PLACEMENT_TAG_TRACKING", + "PLACEMENT_TAG_TRACKING_IFRAME", + "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "tagSetting": { + "$ref": "TagSetting", + "description": "Tag settings for this placement." + } + } + }, + "PlacementAssignment": { + "id": "PlacementAssignment", + "type": "object", + "description": "Placement Assignment.", + "properties": { + "active": { + "type": "boolean", + "description": "Whether this placement assignment is active. When true, the placement will be included in the ad's rotation." + }, + "placementId": { + "type": "string", + "description": "ID of the placement to be assigned. This is a required field.", + "format": "int64" + }, + "placementIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the placement. This is a read-only, auto-generated field." + }, + "sslRequired": { + "type": "boolean", + "description": "Whether the placement to be assigned requires SSL. This is a read-only field that is auto-generated when the ad is inserted or updated." + } + } + }, + "PlacementGroup": { + "id": "PlacementGroup", + "type": "object", + "description": "Contains properties of a package or roadblock.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this placement group. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this placement group. This is a required field on insertion.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "archived": { + "type": "boolean", + "description": "Whether this placement group is archived." + }, + "campaignId": { + "type": "string", + "description": "Campaign ID of this placement group. This field is required on insertion.", + "format": "int64" + }, + "campaignIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the campaign. This is a read-only, auto-generated field." + }, + "childPlacementIds": { + "type": "array", + "description": "IDs of placements which are assigned to this placement group. This is a read-only, auto-generated field.", + "items": { + "type": "string", + "format": "int64" + } + }, + "comment": { + "type": "string", + "description": "Comments for this placement group." + }, + "contentCategoryId": { + "type": "string", + "description": "ID of the content category assigned to this placement group.", + "format": "int64" + }, + "createInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the creation of this placement group. This is a read-only field." + }, + "directorySiteId": { + "type": "string", + "description": "Directory site ID associated with this placement group. On insert, you must set either this field or the site_id field to specify the site associated with this placement group. This is a required field that is read-only after insertion.", + "format": "int64" + }, + "directorySiteIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the directory site. This is a read-only, auto-generated field." + }, + "externalId": { + "type": "string", + "description": "External ID for this placement." + }, + "id": { + "type": "string", + "description": "ID of this placement group. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this placement group. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placementGroup\".", + "default": "dfareporting#placementGroup" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the most recent modification of this placement group. This is a read-only field." + }, + "name": { + "type": "string", + "description": "Name of this placement group. This is a required field and must be less than 256 characters long." + }, + "placementGroupType": { + "type": "string", + "description": "Type of this placement group. A package is a simple group of placements that acts as a single pricing point for a group of tags. A roadblock is a group of placements that not only acts as a single pricing point, but also assumes that all the tags in it will be served at the same time. A roadblock requires one of its assigned placements to be marked as primary for reporting. This field is required on insertion.", + "enum": [ + "PLACEMENT_PACKAGE", + "PLACEMENT_ROADBLOCK" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "placementStrategyId": { + "type": "string", + "description": "ID of the placement strategy assigned to this placement group.", + "format": "int64" + }, + "pricingSchedule": { + "$ref": "PricingSchedule", + "description": "Pricing schedule of this placement group. This field is required on insertion." + }, + "primaryPlacementId": { + "type": "string", + "description": "ID of the primary placement, used to calculate the media cost of a roadblock (placement group). Modifying this field will automatically modify the primary field on all affected roadblock child placements.", + "format": "int64" + }, + "primaryPlacementIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the primary placement. This is a read-only, auto-generated field." + }, + "programmaticSetting": { + "$ref": "ProgrammaticSetting", + "description": "Settings for a programmatic placement." + }, + "siteId": { + "type": "string", + "description": "Site ID associated with this placement group. On insert, you must set either this field or the directorySiteId field to specify the site associated with this placement group. This is a required field that is read-only after insertion.", + "format": "int64" + }, + "siteIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the site. This is a read-only, auto-generated field." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this placement group. This is a read-only field that can be left blank.", + "format": "int64" + } + } + }, + "PlacementGroupsListResponse": { + "id": "PlacementGroupsListResponse", + "type": "object", + "description": "Placement Group List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placementGroupsListResponse\".", + "default": "dfareporting#placementGroupsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "placementGroups": { + "type": "array", + "description": "Placement group collection.", + "items": { + "$ref": "PlacementGroup" + } + } + } + }, + "PlacementStrategiesListResponse": { + "id": "PlacementStrategiesListResponse", + "type": "object", + "description": "Placement Strategy List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placementStrategiesListResponse\".", + "default": "dfareporting#placementStrategiesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "placementStrategies": { + "type": "array", + "description": "Placement strategy collection.", + "items": { + "$ref": "PlacementStrategy" + } + } + } + }, + "PlacementStrategy": { + "id": "PlacementStrategy", + "type": "object", + "description": "Contains properties of a placement strategy.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this placement strategy.This is a read-only field that can be left blank.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "ID of this placement strategy. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placementStrategy\".", + "default": "dfareporting#placementStrategy" + }, + "name": { + "type": "string", + "description": "Name of this placement strategy. This is a required field. It must be less than 256 characters long and unique among placement strategies of the same account." + } + } + }, + "PlacementTag": { + "id": "PlacementTag", + "type": "object", + "description": "Placement Tag", + "properties": { + "placementId": { + "type": "string", + "description": "Placement ID", + "format": "int64" + }, + "tagDatas": { + "type": "array", + "description": "Tags generated for this placement.", + "items": { + "$ref": "TagData" + } + } + } + }, + "PlacementsGenerateTagsResponse": { + "id": "PlacementsGenerateTagsResponse", + "type": "object", + "description": "Placement GenerateTags Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placementsGenerateTagsResponse\".", + "default": "dfareporting#placementsGenerateTagsResponse" + }, + "placementTags": { + "type": "array", + "description": "Set of generated tags for the specified placements.", + "items": { + "$ref": "PlacementTag" + } + } + } + }, + "PlacementsListResponse": { + "id": "PlacementsListResponse", + "type": "object", + "description": "Placement List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placementsListResponse\".", + "default": "dfareporting#placementsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "placements": { + "type": "array", + "description": "Placement collection.", + "items": { + "$ref": "Placement" + } + } + } + }, + "PlatformType": { + "id": "PlatformType", + "type": "object", + "description": "Contains information about a platform type that can be targeted by ads.", + "properties": { + "id": { + "type": "string", + "description": "ID of this platform type.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#platformType\".", + "default": "dfareporting#platformType" + }, + "name": { + "type": "string", + "description": "Name of this platform type." + } + } + }, + "PlatformTypesListResponse": { + "id": "PlatformTypesListResponse", + "type": "object", + "description": "Platform Type List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#platformTypesListResponse\".", + "default": "dfareporting#platformTypesListResponse" + }, + "platformTypes": { + "type": "array", + "description": "Platform type collection.", + "items": { + "$ref": "PlatformType" + } + } + } + }, + "PopupWindowProperties": { + "id": "PopupWindowProperties", + "type": "object", + "description": "Popup Window Properties.", + "properties": { + "dimension": { + "$ref": "Size", + "description": "Popup dimension for a creative. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA and all VPAID" + }, + "offset": { + "$ref": "OffsetPosition", + "description": "Upper-left corner coordinates of the popup window. Applicable if positionType is COORDINATES." + }, + "positionType": { + "type": "string", + "description": "Popup window position either centered or at specific coordinate.", + "enum": [ + "CENTER", + "COORDINATES" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "showAddressBar": { + "type": "boolean", + "description": "Whether to display the browser address bar." + }, + "showMenuBar": { + "type": "boolean", + "description": "Whether to display the browser menu bar." + }, + "showScrollBar": { + "type": "boolean", + "description": "Whether to display the browser scroll bar." + }, + "showStatusBar": { + "type": "boolean", + "description": "Whether to display the browser status bar." + }, + "showToolBar": { + "type": "boolean", + "description": "Whether to display the browser tool bar." + }, + "title": { + "type": "string", + "description": "Title of popup window." + } + } + }, + "PostalCode": { + "id": "PostalCode", + "type": "object", + "description": "Contains information about a postal code that can be targeted by ads.", + "properties": { + "countryCode": { + "type": "string", + "description": "Country code of the country to which this postal code belongs." + }, + "countryDartId": { + "type": "string", + "description": "DART ID of the country to which this postal code belongs.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "ID of this postal code." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#postalCode\".", + "default": "dfareporting#postalCode" + } + } + }, + "PostalCodesListResponse": { + "id": "PostalCodesListResponse", + "type": "object", + "description": "Postal Code List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#postalCodesListResponse\".", + "default": "dfareporting#postalCodesListResponse" + }, + "postalCodes": { + "type": "array", + "description": "Postal code collection.", + "items": { + "$ref": "PostalCode" + } + } + } + }, + "PricingSchedule": { + "id": "PricingSchedule", + "type": "object", + "description": "Pricing Schedule", + "properties": { + "capCostOption": { + "type": "string", + "description": "Placement cap cost option.", + "enum": [ + "CAP_COST_CUMULATIVE", + "CAP_COST_MONTHLY", + "CAP_COST_NONE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "disregardOverdelivery": { + "type": "boolean", + "description": "Whether cap costs are ignored by ad serving." + }, + "endDate": { + "type": "string", + "description": "Placement end date. This date must be later than, or the same day as, the placement start date, but not later than the campaign end date. If, for example, you set 6/25/2015 as both the start and end dates, the effective placement date is just that day only, 6/25/2015. The hours, minutes, and seconds of the end date should not be set, as doing so will result in an error. This field is required on insertion.", + "format": "date" + }, + "flighted": { + "type": "boolean", + "description": "Whether this placement is flighted. If true, pricing periods will be computed automatically." + }, + "floodlightActivityId": { + "type": "string", + "description": "Floodlight activity ID associated with this placement. This field should be set when placement pricing type is set to PRICING_TYPE_CPA.", + "format": "int64" + }, + "pricingPeriods": { + "type": "array", + "description": "Pricing periods for this placement.", + "items": { + "$ref": "PricingSchedulePricingPeriod" + } + }, + "pricingType": { + "type": "string", + "description": "Placement pricing type. This field is required on insertion.", + "enum": [ + "PRICING_TYPE_CPA", + "PRICING_TYPE_CPC", + "PRICING_TYPE_CPM", + "PRICING_TYPE_FLAT_RATE_CLICKS", + "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "startDate": { + "type": "string", + "description": "Placement start date. This date must be later than, or the same day as, the campaign start date. The hours, minutes, and seconds of the start date should not be set, as doing so will result in an error. This field is required on insertion.", + "format": "date" + }, + "testingStartDate": { + "type": "string", + "description": "Testing start date of this placement. The hours, minutes, and seconds of the start date should not be set, as doing so will result in an error.", + "format": "date" + } + } + }, + "PricingSchedulePricingPeriod": { + "id": "PricingSchedulePricingPeriod", + "type": "object", + "description": "Pricing Period", + "properties": { + "endDate": { + "type": "string", + "description": "Pricing period end date. This date must be later than, or the same day as, the pricing period start date, but not later than the placement end date. The period end date can be the same date as the period start date. If, for example, you set 6/25/2015 as both the start and end dates, the effective pricing period date is just that day only, 6/25/2015. The hours, minutes, and seconds of the end date should not be set, as doing so will result in an error.", + "format": "date" + }, + "pricingComment": { + "type": "string", + "description": "Comments for this pricing period." + }, + "rateOrCostNanos": { + "type": "string", + "description": "Rate or cost of this pricing period.", + "format": "int64" + }, + "startDate": { + "type": "string", + "description": "Pricing period start date. This date must be later than, or the same day as, the placement start date. The hours, minutes, and seconds of the start date should not be set, as doing so will result in an error.", + "format": "date" + }, + "units": { + "type": "string", + "description": "Units of this pricing period.", + "format": "int64" + } + } + }, + "ProgrammaticSetting": { + "id": "ProgrammaticSetting", + "type": "object", + "description": "Programmatic Setting", + "properties": { + "adxDealIds": { + "type": "array", + "description": "Adx deal IDs assigned to the placement.", + "items": { + "type": "string", + "format": "int64" + } + }, + "insertionOrderId": { + "type": "string", + "description": "Insertion order ID." + }, + "insertionOrderIdStatus": { + "type": "boolean", + "description": "Whether insertion order ID has been placed in DFP. This is a read-only field." + }, + "mediaCostNanos": { + "type": "string", + "description": "Media cost for the programmatic placement.", + "format": "int64" + }, + "programmatic": { + "type": "boolean", + "description": "Whether programmatic is enabled." + }, + "traffickerEmails": { + "type": "array", + "description": "Trafficker emails assigned to the placement.", + "items": { + "type": "string" + } + } + } + }, + "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.", + "enum": [ + "ATTACHMENT", + "LINK" + ], + "enumDescriptions": [ + "", + "" + ], + "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" + } + } + }, + "Region": { + "id": "Region", + "type": "object", + "description": "Contains information about a region that can be targeted by ads.", + "properties": { + "countryCode": { + "type": "string", + "description": "Country code of the country to which this region belongs." + }, + "countryDartId": { + "type": "string", + "description": "DART ID of the country to which this region belongs.", + "format": "int64" + }, + "dartId": { + "type": "string", + "description": "DART ID of this region.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#region\".", + "default": "dfareporting#region" + }, + "name": { + "type": "string", + "description": "Name of this region." + }, + "regionCode": { + "type": "string", + "description": "Region code." + } + } + }, + "RegionsListResponse": { + "id": "RegionsListResponse", + "type": "object", + "description": "Region List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#regionsListResponse\".", + "default": "dfareporting#regionsListResponse" + }, + "regions": { + "type": "array", + "description": "Region collection.", + "items": { + "$ref": "Region" + } + } + } + }, + "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" + ] + } + }, + "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.", + "enum": [ + "ADVERTISER", + "CAMPAIGN", + "SITE_BY_ADVERTISER", + "SITE_BY_CAMPAIGN" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "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.", + "enum": [ + "ATTACHMENT", + "LINK" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "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 filename 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. 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.", + "enum": [ + "CSV", + "EXCEL" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "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" + } + }, + "enableAllDimensionCombinations": { + "type": "boolean", + "description": "Whether to enable all reach dimension combinations in the report. Defaults to false. If enabled, the date range of the report should be within the last three months." + }, + "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. Note: \n- \"DAILY\" also requires field \"every\" to be set. \n- \"WEEKLY\" also requires fields \"every\" and \"repeatsOnWeekDays\" to be set. \n- \"MONTHLY\" also requires fields \"every\" and \"runsOnDayOfMonth\" to be set.", + "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", + "enum": [ + "FRIDAY", + "MONDAY", + "SATURDAY", + "SUNDAY", + "THURSDAY", + "TUESDAY", + "WEDNESDAY" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "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.\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.", + "enum": [ + "DAY_OF_MONTH", + "WEEK_OF_MONTH" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "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 subaccount ID to which this report belongs if applicable.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "The type of the report.", + "enum": [ + "CROSS_DIMENSION_REACH", + "FLOODLIGHT", + "PATH_TO_CONVERSION", + "REACH", + "STANDARD" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ], + "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." + } + } + }, + "ReportsConfiguration": { + "id": "ReportsConfiguration", + "type": "object", + "description": "Reporting Configuration", + "properties": { + "exposureToConversionEnabled": { + "type": "boolean", + "description": "Whether the exposure to conversion report is enabled. This report shows detailed pathway information on up to 10 of the most recent ad exposures seen by a user before converting." + }, + "lookbackConfiguration": { + "$ref": "LookbackConfiguration", + "description": "Default lookback windows for new advertisers in this account." + }, + "reportGenerationTimeZoneId": { + "type": "string", + "description": "Report generation time zone ID of this account. This is a required field that can only be changed by a superuser.\nAcceptable values are:\n\n- \"1\" for \"America/New_York\" \n- \"2\" for \"Europe/London\" \n- \"3\" for \"Europe/Paris\" \n- \"4\" for \"Africa/Johannesburg\" \n- \"5\" for \"Asia/Jerusalem\" \n- \"6\" for \"Asia/Shanghai\" \n- \"7\" for \"Asia/Hong_Kong\" \n- \"8\" for \"Asia/Tokyo\" \n- \"9\" for \"Australia/Sydney\" \n- \"10\" for \"Asia/Dubai\" \n- \"11\" for \"America/Los_Angeles\" \n- \"12\" for \"Pacific/Auckland\" \n- \"13\" for \"America/Sao_Paulo\"", + "format": "int64" + } + } + }, + "RichMediaExitOverride": { + "id": "RichMediaExitOverride", + "type": "object", + "description": "Rich Media Exit Override.", + "properties": { + "customExitUrl": { + "type": "string", + "description": "Click-through URL to override the default exit URL. Applicable if the useCustomExitUrl field is set to true." + }, + "exitId": { + "type": "string", + "description": "ID for the override to refer to a specific exit in the creative.", + "format": "int64" + }, + "useCustomExitUrl": { + "type": "boolean", + "description": "Whether to use the custom exit URL." + } + } + }, + "Site": { + "id": "Site", + "type": "object", + "description": "Contains properties of a site.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this site. This is a read-only field that can be left blank.", + "format": "int64" + }, + "approved": { + "type": "boolean", + "description": "Whether this site is approved." + }, + "directorySiteId": { + "type": "string", + "description": "Directory site associated with this site. This is a required field that is read-only after insertion.", + "format": "int64" + }, + "directorySiteIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the directory site. This is a read-only, auto-generated field." + }, + "id": { + "type": "string", + "description": "ID of this site. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this site. This is a read-only, auto-generated field." + }, + "keyName": { + "type": "string", + "description": "Key name of this site. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#site\".", + "default": "dfareporting#site" + }, + "name": { + "type": "string", + "description": "Name of this site.This is a required field. Must be less than 128 characters long. If this site is under a subaccount, the name must be unique among sites of the same subaccount. Otherwise, this site is a top-level site, and the name must be unique among top-level sites of the same account." + }, + "siteContacts": { + "type": "array", + "description": "Site contacts.", + "items": { + "$ref": "SiteContact" + } + }, + "siteSettings": { + "$ref": "SiteSettings", + "description": "Site-wide settings." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this site. This is a read-only field that can be left blank.", + "format": "int64" + } + } + }, + "SiteContact": { + "id": "SiteContact", + "type": "object", + "description": "Site Contact", + "properties": { + "contactType": { + "type": "string", + "description": "Site contact type.", + "enum": [ + "SALES_PERSON", + "TRAFFICKER" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "email": { + "type": "string", + "description": "Email address of this site contact. This is a required field." + }, + "firstName": { + "type": "string", + "description": "First name of this site contact." + }, + "id": { + "type": "string", + "description": "ID of this site contact. This is a read-only, auto-generated field.", + "format": "int64" + }, + "lastName": { + "type": "string", + "description": "Last name of this site contact." + } + } + }, + "SiteSettings": { + "id": "SiteSettings", + "type": "object", + "description": "Site Settings", + "properties": { + "activeViewOptOut": { + "type": "boolean", + "description": "Whether active view creatives are disabled for this site." + }, + "creativeSettings": { + "$ref": "CreativeSettings", + "description": "Site-wide creative settings." + }, + "disableBrandSafeAds": { + "type": "boolean", + "description": "Whether brand safe ads are disabled for this site." + }, + "disableNewCookie": { + "type": "boolean", + "description": "Whether new cookies are disabled for this site." + }, + "lookbackConfiguration": { + "$ref": "LookbackConfiguration", + "description": "Lookback window settings for this site." + }, + "tagSetting": { + "$ref": "TagSetting", + "description": "Configuration settings for dynamic and image floodlight tags." + } + } + }, + "SitesListResponse": { + "id": "SitesListResponse", + "type": "object", + "description": "Site List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#sitesListResponse\".", + "default": "dfareporting#sitesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "sites": { + "type": "array", + "description": "Site collection.", + "items": { + "$ref": "Site" + } + } + } + }, + "Size": { + "id": "Size", + "type": "object", + "description": "Represents the dimensions of ads, placements, creatives, or creative assets.", + "properties": { + "height": { + "type": "integer", + "description": "Height of this size.", + "format": "int32" + }, + "iab": { + "type": "boolean", + "description": "IAB standard size. This is a read-only, auto-generated field." + }, + "id": { + "type": "string", + "description": "ID of this size. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#size\".", + "default": "dfareporting#size" + }, + "width": { + "type": "integer", + "description": "Width of this size.", + "format": "int32" + } + } + }, + "SizesListResponse": { + "id": "SizesListResponse", + "type": "object", + "description": "Size List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#sizesListResponse\".", + "default": "dfareporting#sizesListResponse" + }, + "sizes": { + "type": "array", + "description": "Size collection.", + "items": { + "$ref": "Size" + } + } + } + }, + "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.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "Subaccount": { + "id": "Subaccount", + "type": "object", + "description": "Contains properties of a DCM subaccount.", + "properties": { + "accountId": { + "type": "string", + "description": "ID of the account that contains this subaccount. This is a read-only field that can be left blank.", + "format": "int64" + }, + "availablePermissionIds": { + "type": "array", + "description": "IDs of the available user role permissions for this subaccount.", + "items": { + "type": "string", + "format": "int64" + } + }, + "id": { + "type": "string", + "description": "ID of this subaccount. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#subaccount\".", + "default": "dfareporting#subaccount" + }, + "name": { + "type": "string", + "description": "Name of this subaccount. This is a required field. Must be less than 128 characters long and be unique among subaccounts of the same account." + } + } + }, + "SubaccountsListResponse": { + "id": "SubaccountsListResponse", + "type": "object", + "description": "Subaccount List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#subaccountsListResponse\".", + "default": "dfareporting#subaccountsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "subaccounts": { + "type": "array", + "description": "Subaccount collection.", + "items": { + "$ref": "Subaccount" + } + } + } + }, + "TagData": { + "id": "TagData", + "type": "object", + "description": "Placement Tag Data", + "properties": { + "adId": { + "type": "string", + "description": "Ad associated with this placement tag.", + "format": "int64" + }, + "clickTag": { + "type": "string", + "description": "Tag string to record a click." + }, + "creativeId": { + "type": "string", + "description": "Creative associated with this placement tag.", + "format": "int64" + }, + "format": { + "type": "string", + "description": "TagData tag format of this tag.", + "enum": [ + "PLACEMENT_TAG_CLICK_COMMANDS", + "PLACEMENT_TAG_IFRAME_ILAYER", + "PLACEMENT_TAG_IFRAME_JAVASCRIPT", + "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3", + "PLACEMENT_TAG_INTERNAL_REDIRECT", + "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT", + "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT", + "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT", + "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_JAVASCRIPT", + "PLACEMENT_TAG_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_STANDARD", + "PLACEMENT_TAG_TRACKING", + "PLACEMENT_TAG_TRACKING_IFRAME", + "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "impressionTag": { + "type": "string", + "description": "Tag string for serving an ad." + } + } + }, + "TagSetting": { + "id": "TagSetting", + "type": "object", + "description": "Tag Settings", + "properties": { + "additionalKeyValues": { + "type": "string", + "description": "Additional key-values to be included in tags. Each key-value pair must be of the form key=value, and pairs must be separated by a semicolon (;). Keys and values must not contain commas. For example, id=2;color=red is a valid value for this field." + }, + "includeClickThroughUrls": { + "type": "boolean", + "description": "Whether static landing page URLs should be included in the tags. This setting applies only to placements." + }, + "includeClickTracking": { + "type": "boolean", + "description": "Whether click-tracking string should be included in the tags." + }, + "keywordOption": { + "type": "string", + "description": "Option specifying how keywords are embedded in ad tags. This setting can be used to specify whether keyword placeholders are inserted in placement tags for this site. Publishers can then add keywords to those placeholders.", + "enum": [ + "GENERATE_SEPARATE_TAG_FOR_EACH_KEYWORD", + "IGNORE", + "PLACEHOLDER_WITH_LIST_OF_KEYWORDS" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "TagSettings": { + "id": "TagSettings", + "type": "object", + "description": "Dynamic and Image Tag Settings.", + "properties": { + "dynamicTagEnabled": { + "type": "boolean", + "description": "Whether dynamic floodlight tags are enabled." + }, + "imageTagEnabled": { + "type": "boolean", + "description": "Whether image tags are enabled." + } + } + }, + "TargetWindow": { + "id": "TargetWindow", + "type": "object", + "description": "Target Window.", + "properties": { + "customHtml": { + "type": "string", + "description": "User-entered value." + }, + "targetWindowOption": { + "type": "string", + "description": "Type of browser window for which the backup image of the flash creative can be displayed.", + "enum": [ + "CURRENT_WINDOW", + "CUSTOM", + "NEW_WINDOW" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "TechnologyTargeting": { + "id": "TechnologyTargeting", + "type": "object", + "description": "Technology Targeting.", + "properties": { + "browsers": { + "type": "array", + "description": "Browsers that this ad targets. For each browser either set browserVersionId or dartId along with the version numbers. If both are specified, only browserVersionId will be used.The other fields are populated automatically when the ad is inserted or updated.", + "items": { + "$ref": "Browser" + } + }, + "connectionTypes": { + "type": "array", + "description": "Connection types that this ad targets. For each connection type only id is required.The other fields are populated automatically when the ad is inserted or updated.", + "items": { + "$ref": "ConnectionType" + } + }, + "mobileCarriers": { + "type": "array", + "description": "Mobile carriers that this ad targets. For each mobile carrier only id is required, and the other fields are populated automatically when the ad is inserted or updated. If targeting a mobile carrier, do not set targeting for any zip codes.", + "items": { + "$ref": "MobileCarrier" + } + }, + "operatingSystemVersions": { + "type": "array", + "description": "Operating system versions that this ad targets. To target all versions, use operatingSystems. For each operating system version, only id is required. The other fields are populated automatically when the ad is inserted or updated. If targeting an operating system version, do not set targeting for the corresponding operating system in operatingSystems.", + "items": { + "$ref": "OperatingSystemVersion" + } + }, + "operatingSystems": { + "type": "array", + "description": "Operating systems that this ad targets. To target specific versions, use operatingSystemVersions. For each operating system only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting an operating system, do not set targeting for operating system versions for the same operating system.", + "items": { + "$ref": "OperatingSystem" + } + }, + "platformTypes": { + "type": "array", + "description": "Platform types that this ad targets. For example, desktop, mobile, or tablet. For each platform type, only id is required, and the other fields are populated automatically when the ad is inserted or updated.", + "items": { + "$ref": "PlatformType" + } + } + } + }, + "ThirdPartyTrackingUrl": { + "id": "ThirdPartyTrackingUrl", + "type": "object", + "description": "Third-party Tracking URL.", + "properties": { + "thirdPartyUrlType": { + "type": "string", + "description": "Third-party URL type for in-stream video creatives.", + "enum": [ + "CLICK_TRACKING", + "IMPRESSION", + "RICH_MEDIA_BACKUP_IMPRESSION", + "RICH_MEDIA_IMPRESSION", + "RICH_MEDIA_RM_IMPRESSION", + "SURVEY", + "VIDEO_COMPLETE", + "VIDEO_CUSTOM", + "VIDEO_FIRST_QUARTILE", + "VIDEO_FULLSCREEN", + "VIDEO_MIDPOINT", + "VIDEO_MUTE", + "VIDEO_PAUSE", + "VIDEO_REWIND", + "VIDEO_START", + "VIDEO_STOP", + "VIDEO_THIRD_QUARTILE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "url": { + "type": "string", + "description": "URL for the specified third-party URL type." + } + } + }, + "UserDefinedVariableConfiguration": { + "id": "UserDefinedVariableConfiguration", + "type": "object", + "description": "User Defined Variable configuration.", + "properties": { + "dataType": { + "type": "string", + "description": "Data type for the variable. This is a required field.", + "enum": [ + "NUMBER", + "STRING" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "reportName": { + "type": "string", + "description": "User-friendly name for the variable which will appear in reports. This is a required field, must be less than 64 characters long, and cannot contain the following characters: \"\"\u003c\u003e\"." + }, + "variableType": { + "type": "string", + "description": "Variable name in the tag. This is a required field.", + "enum": [ + "U1", + "U10", + "U11", + "U12", + "U13", + "U14", + "U15", + "U16", + "U17", + "U18", + "U19", + "U2", + "U20", + "U3", + "U4", + "U5", + "U6", + "U7", + "U8", + "U9" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "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" + } + } + }, + "UserRole": { + "id": "UserRole", + "type": "object", + "description": "Contains properties of auser role, which is used to manage user access.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this user role. This is a read-only field that can be left blank.", + "format": "int64" + }, + "defaultUserRole": { + "type": "boolean", + "description": "Whether this is a default user role. Default user roles are created by the system for the account/subaccount and cannot be modified or deleted. Each default user role comes with a basic set of preassigned permissions." + }, + "id": { + "type": "string", + "description": "ID of this user role. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#userRole\".", + "default": "dfareporting#userRole" + }, + "name": { + "type": "string", + "description": "Name of this user role. This is a required field. Must be less than 256 characters long. If this user role is under a subaccount, the name must be unique among sites of the same subaccount. Otherwise, this user role is a top-level user role, and the name must be unique among top-level user roles of the same account." + }, + "parentUserRoleId": { + "type": "string", + "description": "ID of the user role that this user role is based on or copied from. This is a required field.", + "format": "int64" + }, + "permissions": { + "type": "array", + "description": "List of permissions associated with this user role.", + "items": { + "$ref": "UserRolePermission" + } + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this user role. This is a read-only field that can be left blank.", + "format": "int64" + } + } + }, + "UserRolePermission": { + "id": "UserRolePermission", + "type": "object", + "description": "Contains properties of a user role permission.", + "properties": { + "availability": { + "type": "string", + "description": "Levels of availability for a user role permission.", + "enum": [ + "ACCOUNT_ALWAYS", + "ACCOUNT_BY_DEFAULT", + "NOT_AVAILABLE_BY_DEFAULT", + "SUBACCOUNT_AND_ACCOUNT_ALWAYS", + "SUBACCOUNT_AND_ACCOUNT_BY_DEFAULT" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "id": { + "type": "string", + "description": "ID of this user role permission.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#userRolePermission\".", + "default": "dfareporting#userRolePermission" + }, + "name": { + "type": "string", + "description": "Name of this user role permission." + }, + "permissionGroupId": { + "type": "string", + "description": "ID of the permission group that this user role permission belongs to.", + "format": "int64" + } + } + }, + "UserRolePermissionGroup": { + "id": "UserRolePermissionGroup", + "type": "object", + "description": "Represents a grouping of related user role permissions.", + "properties": { + "id": { + "type": "string", + "description": "ID of this user role permission.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#userRolePermissionGroup\".", + "default": "dfareporting#userRolePermissionGroup" + }, + "name": { + "type": "string", + "description": "Name of this user role permission group." + } + } + }, + "UserRolePermissionGroupsListResponse": { + "id": "UserRolePermissionGroupsListResponse", + "type": "object", + "description": "User Role Permission Group List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#userRolePermissionGroupsListResponse\".", + "default": "dfareporting#userRolePermissionGroupsListResponse" + }, + "userRolePermissionGroups": { + "type": "array", + "description": "User role permission group collection.", + "items": { + "$ref": "UserRolePermissionGroup" + } + } + } + }, + "UserRolePermissionsListResponse": { + "id": "UserRolePermissionsListResponse", + "type": "object", + "description": "User Role Permission List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#userRolePermissionsListResponse\".", + "default": "dfareporting#userRolePermissionsListResponse" + }, + "userRolePermissions": { + "type": "array", + "description": "User role permission collection.", + "items": { + "$ref": "UserRolePermission" + } + } + } + }, + "UserRolesListResponse": { + "id": "UserRolesListResponse", + "type": "object", + "description": "User Role List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#userRolesListResponse\".", + "default": "dfareporting#userRolesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "userRoles": { + "type": "array", + "description": "User role collection.", + "items": { + "$ref": "UserRole" + } + } + } + } + }, + "resources": { + "accountActiveAdSummaries": { + "methods": { + "get": { + "id": "dfareporting.accountActiveAdSummaries.get", + "path": "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}", + "httpMethod": "GET", + "description": "Gets the account's active ad summary by account ID.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "summaryAccountId": { + "type": "string", + "description": "Account ID.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "summaryAccountId" + ], + "response": { + "$ref": "AccountActiveAdSummary" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "accountPermissionGroups": { + "methods": { + "get": { + "id": "dfareporting.accountPermissionGroups.get", + "path": "userprofiles/{profileId}/accountPermissionGroups/{id}", + "httpMethod": "GET", + "description": "Gets one account permission group by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Account permission group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "AccountPermissionGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.accountPermissionGroups.list", + "path": "userprofiles/{profileId}/accountPermissionGroups", + "httpMethod": "GET", + "description": "Retrieves the list of account permission groups.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AccountPermissionGroupsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "accountPermissions": { + "methods": { + "get": { + "id": "dfareporting.accountPermissions.get", + "path": "userprofiles/{profileId}/accountPermissions/{id}", + "httpMethod": "GET", + "description": "Gets one account permission by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Account permission ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "AccountPermission" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.accountPermissions.list", + "path": "userprofiles/{profileId}/accountPermissions", + "httpMethod": "GET", + "description": "Retrieves the list of account permissions.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AccountPermissionsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "accountUserProfiles": { + "methods": { + "get": { + "id": "dfareporting.accountUserProfiles.get", + "path": "userprofiles/{profileId}/accountUserProfiles/{id}", + "httpMethod": "GET", + "description": "Gets one account user profile by ID.", + "parameters": { + "id": { + "type": "string", + "description": "User profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "AccountUserProfile" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.accountUserProfiles.list", + "path": "userprofiles/{profileId}/accountUserProfiles", + "httpMethod": "GET", + "description": "Retrieves a list of account user profiles, possibly filtered.", + "parameters": { + "active": { + "type": "boolean", + "description": "Select only active user profiles.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only user profiles with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, \"user profile*2015\" will return objects with names like \"user profile June 2015\", \"user profile April 2015\", or simply \"user profile 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"user profile\" will match objects with name \"my user profile\", \"user profile 2015\", or simply \"user profile\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "subaccountId": { + "type": "string", + "description": "Select only user profiles with the specified subaccount ID.", + "format": "int64", + "location": "query" + }, + "userRoleId": { + "type": "string", + "description": "Select only user profiles with the specified user role ID.", + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AccountUserProfilesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.accountUserProfiles.patch", + "path": "userprofiles/{profileId}/accountUserProfiles", + "httpMethod": "PATCH", + "description": "Updates an existing account user profile. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "User profile ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "AccountUserProfile" + }, + "response": { + "$ref": "AccountUserProfile" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.accountUserProfiles.update", + "path": "userprofiles/{profileId}/accountUserProfiles", + "httpMethod": "PUT", + "description": "Updates an existing account user profile.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "AccountUserProfile" + }, + "response": { + "$ref": "AccountUserProfile" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "accounts": { + "methods": { + "get": { + "id": "dfareporting.accounts.get", + "path": "userprofiles/{profileId}/accounts/{id}", + "httpMethod": "GET", + "description": "Gets one account by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Account ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.accounts.list", + "path": "userprofiles/{profileId}/accounts", + "httpMethod": "GET", + "description": "Retrieves the list of accounts, possibly filtered.", + "parameters": { + "active": { + "type": "boolean", + "description": "Select only active accounts. Don't set this field to select both active and non-active accounts.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only accounts with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"account*2015\" will return objects with names like \"account June 2015\", \"account April 2015\", or simply \"account 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"account\" will match objects with name \"my account\", \"account 2015\", or simply \"account\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AccountsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.accounts.patch", + "path": "userprofiles/{profileId}/accounts", + "httpMethod": "PATCH", + "description": "Updates an existing account. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Account ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Account" + }, + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.accounts.update", + "path": "userprofiles/{profileId}/accounts", + "httpMethod": "PUT", + "description": "Updates an existing account.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Account" + }, + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "ads": { + "methods": { + "get": { + "id": "dfareporting.ads.get", + "path": "userprofiles/{profileId}/ads/{id}", + "httpMethod": "GET", + "description": "Gets one ad by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Ad ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Ad" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.ads.insert", + "path": "userprofiles/{profileId}/ads", + "httpMethod": "POST", + "description": "Inserts a new ad.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Ad" + }, + "response": { + "$ref": "Ad" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.ads.list", + "path": "userprofiles/{profileId}/ads", + "httpMethod": "GET", + "description": "Retrieves a list of ads, possibly filtered.", + "parameters": { + "active": { + "type": "boolean", + "description": "Select only active ads.", + "location": "query" + }, + "advertiserId": { + "type": "string", + "description": "Select only ads with this advertiser ID.", + "format": "int64", + "location": "query" + }, + "archived": { + "type": "boolean", + "description": "Select only archived ads.", + "location": "query" + }, + "audienceSegmentIds": { + "type": "string", + "description": "Select only ads with these audience segment IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "campaignIds": { + "type": "string", + "description": "Select only ads with these campaign IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "compatibility": { + "type": "string", + "description": "Select default ads with the specified compatibility. Applicable when type is AD_SERVING_DEFAULT_AD. WEB and WEB_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering an in-stream video ads developed with the VAST standard.", + "enum": [ + "APP", + "APP_INTERSTITIAL", + "IN_STREAM_VIDEO", + "WEB", + "WEB_INTERSTITIAL" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ], + "location": "query" + }, + "creativeIds": { + "type": "string", + "description": "Select only ads with these creative IDs assigned.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "creativeOptimizationConfigurationIds": { + "type": "string", + "description": "Select only ads with these creative optimization configuration IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "creativeType": { + "type": "string", + "description": "Select only ads with the specified creativeType.", + "enum": [ + "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO", + "CUSTOM_INPAGE", + "CUSTOM_INTERSTITIAL", + "ENHANCED_BANNER", + "ENHANCED_IMAGE", + "FLASH_INPAGE", + "HTML5_BANNER", + "IMAGE", + "INSTREAM_VIDEO", + "INTERNAL_REDIRECT", + "INTERSTITIAL_INTERNAL_REDIRECT", + "REDIRECT", + "RICH_MEDIA_EXPANDING", + "RICH_MEDIA_IM_EXPAND", + "RICH_MEDIA_INPAGE", + "RICH_MEDIA_INPAGE_FLOATING", + "RICH_MEDIA_INTERSTITIAL_FLOAT", + "RICH_MEDIA_MOBILE_IN_APP", + "RICH_MEDIA_MULTI_FLOATING", + "RICH_MEDIA_PEEL_DOWN", + "TRACKING_TEXT", + "VAST_REDIRECT", + "VPAID_LINEAR", + "VPAID_NON_LINEAR" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "location": "query" + }, + "dynamicClickTracker": { + "type": "boolean", + "description": "Select only dynamic click trackers. Applicable when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click trackers. If false, select static click trackers. Leave unset to select both.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only ads with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "landingPageIds": { + "type": "string", + "description": "Select only ads with these landing page IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "overriddenEventTagId": { + "type": "string", + "description": "Select only ads with this event tag override ID.", + "format": "int64", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "placementIds": { + "type": "string", + "description": "Select only ads with these placement IDs assigned.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "remarketingListIds": { + "type": "string", + "description": "Select only ads whose list targeting expression use these remarketing list IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"ad*2015\" will return objects with names like \"ad June 2015\", \"ad April 2015\", or simply \"ad 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"ad\" will match objects with name \"my ad\", \"ad 2015\", or simply \"ad\".", + "location": "query" + }, + "sizeIds": { + "type": "string", + "description": "Select only ads with these size IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sslCompliant": { + "type": "boolean", + "description": "Select only ads that are SSL-compliant.", + "location": "query" + }, + "sslRequired": { + "type": "boolean", + "description": "Select only ads that require SSL.", + "location": "query" + }, + "type": { + "type": "string", + "description": "Select only ads with these types.", + "enum": [ + "AD_SERVING_CLICK_TRACKER", + "AD_SERVING_DEFAULT_AD", + "AD_SERVING_STANDARD_AD", + "AD_SERVING_TRACKING" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AdsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.ads.patch", + "path": "userprofiles/{profileId}/ads", + "httpMethod": "PATCH", + "description": "Updates an existing ad. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Ad ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Ad" + }, + "response": { + "$ref": "Ad" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.ads.update", + "path": "userprofiles/{profileId}/ads", + "httpMethod": "PUT", + "description": "Updates an existing ad.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Ad" + }, + "response": { + "$ref": "Ad" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "advertiserGroups": { + "methods": { + "delete": { + "id": "dfareporting.advertiserGroups.delete", + "path": "userprofiles/{profileId}/advertiserGroups/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing advertiser group.", + "parameters": { + "id": { + "type": "string", + "description": "Advertiser group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.advertiserGroups.get", + "path": "userprofiles/{profileId}/advertiserGroups/{id}", + "httpMethod": "GET", + "description": "Gets one advertiser group by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Advertiser group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "AdvertiserGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.advertiserGroups.insert", + "path": "userprofiles/{profileId}/advertiserGroups", + "httpMethod": "POST", + "description": "Inserts a new advertiser group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "AdvertiserGroup" + }, + "response": { + "$ref": "AdvertiserGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.advertiserGroups.list", + "path": "userprofiles/{profileId}/advertiserGroups", + "httpMethod": "GET", + "description": "Retrieves a list of advertiser groups, possibly filtered.", + "parameters": { + "ids": { + "type": "string", + "description": "Select only advertiser groups with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"advertiser*2015\" will return objects with names like \"advertiser group June 2015\", \"advertiser group April 2015\", or simply \"advertiser group 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"advertisergroup\" will match objects with name \"my advertisergroup\", \"advertisergroup 2015\", or simply \"advertisergroup\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AdvertiserGroupsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.advertiserGroups.patch", + "path": "userprofiles/{profileId}/advertiserGroups", + "httpMethod": "PATCH", + "description": "Updates an existing advertiser group. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Advertiser group ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "AdvertiserGroup" + }, + "response": { + "$ref": "AdvertiserGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.advertiserGroups.update", + "path": "userprofiles/{profileId}/advertiserGroups", + "httpMethod": "PUT", + "description": "Updates an existing advertiser group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "AdvertiserGroup" + }, + "response": { + "$ref": "AdvertiserGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "advertisers": { + "methods": { + "get": { + "id": "dfareporting.advertisers.get", + "path": "userprofiles/{profileId}/advertisers/{id}", + "httpMethod": "GET", + "description": "Gets one advertiser by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Advertiser ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Advertiser" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.advertisers.insert", + "path": "userprofiles/{profileId}/advertisers", + "httpMethod": "POST", + "description": "Inserts a new advertiser.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Advertiser" + }, + "response": { + "$ref": "Advertiser" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.advertisers.list", + "path": "userprofiles/{profileId}/advertisers", + "httpMethod": "GET", + "description": "Retrieves a list of advertisers, possibly filtered.", + "parameters": { + "advertiserGroupIds": { + "type": "string", + "description": "Select only advertisers with these advertiser group IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "floodlightConfigurationIds": { + "type": "string", + "description": "Select only advertisers with these floodlight configuration IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only advertisers with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "includeAdvertisersWithoutGroupsOnly": { + "type": "boolean", + "description": "Select only advertisers which do not belong to any advertiser group.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "onlyParent": { + "type": "boolean", + "description": "Select only advertisers which use another advertiser's floodlight configuration.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"advertiser*2015\" will return objects with names like \"advertiser June 2015\", \"advertiser April 2015\", or simply \"advertiser 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"advertiser\" will match objects with name \"my advertiser\", \"advertiser 2015\", or simply \"advertiser\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "status": { + "type": "string", + "description": "Select only advertisers with the specified status.", + "enum": [ + "APPROVED", + "ON_HOLD" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "subaccountId": { + "type": "string", + "description": "Select only advertisers with these subaccount IDs.", + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AdvertisersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.advertisers.patch", + "path": "userprofiles/{profileId}/advertisers", + "httpMethod": "PATCH", + "description": "Updates an existing advertiser. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Advertiser ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Advertiser" + }, + "response": { + "$ref": "Advertiser" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.advertisers.update", + "path": "userprofiles/{profileId}/advertisers", + "httpMethod": "PUT", + "description": "Updates an existing advertiser.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Advertiser" + }, + "response": { + "$ref": "Advertiser" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "browsers": { + "methods": { + "list": { + "id": "dfareporting.browsers.list", + "path": "userprofiles/{profileId}/browsers", + "httpMethod": "GET", + "description": "Retrieves a list of browsers.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "BrowsersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "campaignCreativeAssociations": { + "methods": { + "insert": { + "id": "dfareporting.campaignCreativeAssociations.insert", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations", + "httpMethod": "POST", + "description": "Associates a creative with the specified campaign. This method creates a default ad with dimensions matching the creative in the campaign if such a default ad does not exist already.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Campaign ID in this association.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId" + ], + "request": { + "$ref": "CampaignCreativeAssociation" + }, + "response": { + "$ref": "CampaignCreativeAssociation" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.campaignCreativeAssociations.list", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations", + "httpMethod": "GET", + "description": "Retrieves the list of creative IDs associated with the specified campaign.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Campaign ID in this association.", + "required": true, + "format": "int64", + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "campaignId" + ], + "response": { + "$ref": "CampaignCreativeAssociationsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "campaigns": { + "methods": { + "get": { + "id": "dfareporting.campaigns.get", + "path": "userprofiles/{profileId}/campaigns/{id}", + "httpMethod": "GET", + "description": "Gets one campaign by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Campaign" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.campaigns.insert", + "path": "userprofiles/{profileId}/campaigns", + "httpMethod": "POST", + "description": "Inserts a new campaign.", + "parameters": { + "defaultLandingPageName": { + "type": "string", + "description": "Default landing page name for this new campaign. Must be less than 256 characters long.", + "required": true, + "location": "query" + }, + "defaultLandingPageUrl": { + "type": "string", + "description": "Default landing page URL for this new campaign.", + "required": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "defaultLandingPageName", + "defaultLandingPageUrl" + ], + "request": { + "$ref": "Campaign" + }, + "response": { + "$ref": "Campaign" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.campaigns.list", + "path": "userprofiles/{profileId}/campaigns", + "httpMethod": "GET", + "description": "Retrieves a list of campaigns, possibly filtered.", + "parameters": { + "advertiserGroupIds": { + "type": "string", + "description": "Select only campaigns whose advertisers belong to these advertiser groups.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "advertiserIds": { + "type": "string", + "description": "Select only campaigns that belong to these advertisers.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "archived": { + "type": "boolean", + "description": "Select only archived campaigns. Don't set this field to select both archived and non-archived campaigns.", + "location": "query" + }, + "atLeastOneOptimizationActivity": { + "type": "boolean", + "description": "Select only campaigns that have at least one optimization activity.", + "location": "query" + }, + "excludedIds": { + "type": "string", + "description": "Exclude campaigns with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only campaigns with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "overriddenEventTagId": { + "type": "string", + "description": "Select only campaigns that have overridden this event tag ID.", + "format": "int64", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for campaigns by name or ID. Wildcards (*) are allowed. For example, \"campaign*2015\" will return campaigns with names like \"campaign June 2015\", \"campaign April 2015\", or simply \"campaign 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"campaign\" will match campaigns with name \"my campaign\", \"campaign 2015\", or simply \"campaign\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "subaccountId": { + "type": "string", + "description": "Select only campaigns that belong to this subaccount.", + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "CampaignsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.campaigns.patch", + "path": "userprofiles/{profileId}/campaigns", + "httpMethod": "PATCH", + "description": "Updates an existing campaign. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Campaign ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Campaign" + }, + "response": { + "$ref": "Campaign" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.campaigns.update", + "path": "userprofiles/{profileId}/campaigns", + "httpMethod": "PUT", + "description": "Updates an existing campaign.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Campaign" + }, + "response": { + "$ref": "Campaign" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "changeLogs": { + "methods": { + "get": { + "id": "dfareporting.changeLogs.get", + "path": "userprofiles/{profileId}/changeLogs/{id}", + "httpMethod": "GET", + "description": "Gets one change log by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Change log ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "ChangeLog" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.changeLogs.list", + "path": "userprofiles/{profileId}/changeLogs", + "httpMethod": "GET", + "description": "Retrieves a list of change logs.", + "parameters": { + "action": { + "type": "string", + "description": "Select only change logs with the specified action.", + "enum": [ + "ACTION_ADD", + "ACTION_ASSIGN", + "ACTION_ASSOCIATE", + "ACTION_CREATE", + "ACTION_DELETE", + "ACTION_DISABLE", + "ACTION_EMAIL_TAGS", + "ACTION_ENABLE", + "ACTION_LINK", + "ACTION_MARK_AS_DEFAULT", + "ACTION_PUSH", + "ACTION_REMOVE", + "ACTION_SEND", + "ACTION_SHARE", + "ACTION_UNASSIGN", + "ACTION_UNLINK", + "ACTION_UPDATE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only change logs with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxChangeTime": { + "type": "string", + "description": "Select only change logs whose change time is before the specified maxChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is \"2015-07-18T22:54:00-04:00\". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "minChangeTime": { + "type": "string", + "description": "Select only change logs whose change time is before the specified minChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is \"2015-07-18T22:54:00-04:00\". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset.", + "location": "query" + }, + "objectIds": { + "type": "string", + "description": "Select only change logs with these object IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "objectType": { + "type": "string", + "description": "Select only change logs with the specified object type.", + "enum": [ + "OBJECT_ACCOUNT", + "OBJECT_ACCOUNT_BILLING_FEATURE", + "OBJECT_AD", + "OBJECT_ADVERTISER", + "OBJECT_ADVERTISER_GROUP", + "OBJECT_BILLING_ACCOUNT_GROUP", + "OBJECT_BILLING_FEATURE", + "OBJECT_BILLING_MINIMUM_FEE", + "OBJECT_BILLING_PROFILE", + "OBJECT_CAMPAIGN", + "OBJECT_CONTENT_CATEGORY", + "OBJECT_CREATIVE", + "OBJECT_CREATIVE_ASSET", + "OBJECT_CREATIVE_BUNDLE", + "OBJECT_CREATIVE_FIELD", + "OBJECT_CREATIVE_GROUP", + "OBJECT_DFA_SITE", + "OBJECT_EVENT_TAG", + "OBJECT_FLOODLIGHT_ACTIVITY_GROUP", + "OBJECT_FLOODLIGHT_ACTVITY", + "OBJECT_FLOODLIGHT_CONFIGURATION", + "OBJECT_INSTREAM_CREATIVE", + "OBJECT_LANDING_PAGE", + "OBJECT_MEDIA_ORDER", + "OBJECT_PLACEMENT", + "OBJECT_PLACEMENT_STRATEGY", + "OBJECT_PROVIDED_LIST_CLIENT", + "OBJECT_RATE_CARD", + "OBJECT_REMARKETING_LIST", + "OBJECT_RICHMEDIA_CREATIVE", + "OBJECT_SD_SITE", + "OBJECT_SIZE", + "OBJECT_SUBACCOUNT", + "OBJECT_USER_PROFILE", + "OBJECT_USER_PROFILE_FILTER", + "OBJECT_USER_ROLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Select only change logs whose object ID, user name, old or new values match the search string.", + "location": "query" + }, + "userProfileIds": { + "type": "string", + "description": "Select only change logs with these user profile IDs.", + "format": "int64", + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "ChangeLogsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "cities": { + "methods": { + "list": { + "id": "dfareporting.cities.list", + "path": "userprofiles/{profileId}/cities", + "httpMethod": "GET", + "description": "Retrieves a list of cities, possibly filtered.", + "parameters": { + "countryDartIds": { + "type": "string", + "description": "Select only cities from these countries.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "dartIds": { + "type": "string", + "description": "Select only cities with these DART IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "namePrefix": { + "type": "string", + "description": "Select only cities with names starting with this prefix.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "regionDartIds": { + "type": "string", + "description": "Select only cities from these regions.", + "format": "int64", + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "CitiesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "connectionTypes": { + "methods": { + "list": { + "id": "dfareporting.connectionTypes.list", + "path": "userprofiles/{profileId}/connectionTypes", + "httpMethod": "GET", + "description": "Retrieves a list of connection types.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "ConnectionTypesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "contentCategories": { + "methods": { + "delete": { + "id": "dfareporting.contentCategories.delete", + "path": "userprofiles/{profileId}/contentCategories/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing content category.", + "parameters": { + "id": { + "type": "string", + "description": "Content category ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.contentCategories.get", + "path": "userprofiles/{profileId}/contentCategories/{id}", + "httpMethod": "GET", + "description": "Gets one content category by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Content category ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "ContentCategory" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.contentCategories.insert", + "path": "userprofiles/{profileId}/contentCategories", + "httpMethod": "POST", + "description": "Inserts a new content category.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "ContentCategory" + }, + "response": { + "$ref": "ContentCategory" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.contentCategories.list", + "path": "userprofiles/{profileId}/contentCategories", + "httpMethod": "GET", + "description": "Retrieves a list of content categories, possibly filtered.", + "parameters": { + "ids": { + "type": "string", + "description": "Select only content categories with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"contentcategory*2015\" will return objects with names like \"contentcategory June 2015\", \"contentcategory April 2015\", or simply \"contentcategory 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"contentcategory\" will match objects with name \"my contentcategory\", \"contentcategory 2015\", or simply \"contentcategory\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "ContentCategoriesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.contentCategories.patch", + "path": "userprofiles/{profileId}/contentCategories", + "httpMethod": "PATCH", + "description": "Updates an existing content category. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Content category ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "ContentCategory" + }, + "response": { + "$ref": "ContentCategory" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.contentCategories.update", + "path": "userprofiles/{profileId}/contentCategories", + "httpMethod": "PUT", + "description": "Updates an existing content category.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "ContentCategory" + }, + "response": { + "$ref": "ContentCategory" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "countries": { + "methods": { + "get": { + "id": "dfareporting.countries.get", + "path": "userprofiles/{profileId}/countries/{dartId}", + "httpMethod": "GET", + "description": "Gets one country by ID.", + "parameters": { + "dartId": { + "type": "string", + "description": "Country DART ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "dartId" + ], + "response": { + "$ref": "Country" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.countries.list", + "path": "userprofiles/{profileId}/countries", + "httpMethod": "GET", + "description": "Retrieves a list of countries.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "CountriesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "creativeAssets": { + "methods": { + "insert": { + "id": "dfareporting.creativeAssets.insert", + "path": "userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets", + "httpMethod": "POST", + "description": "Inserts a new creative asset.", + "parameters": { + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this creative. This is a required field.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "advertiserId" + ], + "request": { + "$ref": "CreativeAssetMetadata" + }, + "response": { + "$ref": "CreativeAssetMetadata" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "*/*" + ], + "maxSize": "100MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/dfareporting/v2.0/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/dfareporting/v2.0/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets" + } + } + } + } + } + }, + "creativeFieldValues": { + "methods": { + "delete": { + "id": "dfareporting.creativeFieldValues.delete", + "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing creative field value.", + "parameters": { + "creativeFieldId": { + "type": "string", + "description": "Creative field ID for this creative field value.", + "required": true, + "format": "int64", + "location": "path" + }, + "id": { + "type": "string", + "description": "Creative Field Value ID", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "creativeFieldId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.creativeFieldValues.get", + "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}", + "httpMethod": "GET", + "description": "Gets one creative field value by ID.", + "parameters": { + "creativeFieldId": { + "type": "string", + "description": "Creative field ID for this creative field value.", + "required": true, + "format": "int64", + "location": "path" + }, + "id": { + "type": "string", + "description": "Creative Field Value ID", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "creativeFieldId", + "id" + ], + "response": { + "$ref": "CreativeFieldValue" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.creativeFieldValues.insert", + "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + "httpMethod": "POST", + "description": "Inserts a new creative field value.", + "parameters": { + "creativeFieldId": { + "type": "string", + "description": "Creative field ID for this creative field value.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "creativeFieldId" + ], + "request": { + "$ref": "CreativeFieldValue" + }, + "response": { + "$ref": "CreativeFieldValue" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.creativeFieldValues.list", + "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + "httpMethod": "GET", + "description": "Retrieves a list of creative field values, possibly filtered.", + "parameters": { + "creativeFieldId": { + "type": "string", + "description": "Creative field ID for this creative field value.", + "required": true, + "format": "int64", + "location": "path" + }, + "ids": { + "type": "string", + "description": "Select only creative field values with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for creative field values by their values. Wildcards (e.g. *) are not allowed.", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "VALUE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "creativeFieldId" + ], + "response": { + "$ref": "CreativeFieldValuesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.creativeFieldValues.patch", + "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + "httpMethod": "PATCH", + "description": "Updates an existing creative field value. This method supports patch semantics.", + "parameters": { + "creativeFieldId": { + "type": "string", + "description": "Creative field ID for this creative field value.", + "required": true, + "format": "int64", + "location": "path" + }, + "id": { + "type": "string", + "description": "Creative Field Value ID", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "creativeFieldId", + "id" + ], + "request": { + "$ref": "CreativeFieldValue" + }, + "response": { + "$ref": "CreativeFieldValue" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.creativeFieldValues.update", + "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + "httpMethod": "PUT", + "description": "Updates an existing creative field value.", + "parameters": { + "creativeFieldId": { + "type": "string", + "description": "Creative field ID for this creative field value.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "creativeFieldId" + ], + "request": { + "$ref": "CreativeFieldValue" + }, + "response": { + "$ref": "CreativeFieldValue" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "creativeFields": { + "methods": { + "delete": { + "id": "dfareporting.creativeFields.delete", + "path": "userprofiles/{profileId}/creativeFields/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing creative field.", + "parameters": { + "id": { + "type": "string", + "description": "Creative Field ID", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.creativeFields.get", + "path": "userprofiles/{profileId}/creativeFields/{id}", + "httpMethod": "GET", + "description": "Gets one creative field by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Creative Field ID", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "CreativeField" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.creativeFields.insert", + "path": "userprofiles/{profileId}/creativeFields", + "httpMethod": "POST", + "description": "Inserts a new creative field.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "CreativeField" + }, + "response": { + "$ref": "CreativeField" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.creativeFields.list", + "path": "userprofiles/{profileId}/creativeFields", + "httpMethod": "GET", + "description": "Retrieves a list of creative fields, possibly filtered.", + "parameters": { + "advertiserIds": { + "type": "string", + "description": "Select only creative fields that belong to these advertisers.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only creative fields with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for creative fields by name or ID. Wildcards (*) are allowed. For example, \"creativefield*2015\" will return creative fields with names like \"creativefield June 2015\", \"creativefield April 2015\", or simply \"creativefield 2015\". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of \"creativefield\" will match creative fields with the name \"my creativefield\", \"creativefield 2015\", or simply \"creativefield\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "CreativeFieldsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.creativeFields.patch", + "path": "userprofiles/{profileId}/creativeFields", + "httpMethod": "PATCH", + "description": "Updates an existing creative field. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Creative Field ID", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "CreativeField" + }, + "response": { + "$ref": "CreativeField" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.creativeFields.update", + "path": "userprofiles/{profileId}/creativeFields", + "httpMethod": "PUT", + "description": "Updates an existing creative field.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "CreativeField" + }, + "response": { + "$ref": "CreativeField" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "creativeGroups": { + "methods": { + "get": { + "id": "dfareporting.creativeGroups.get", + "path": "userprofiles/{profileId}/creativeGroups/{id}", + "httpMethod": "GET", + "description": "Gets one creative group by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Creative group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "CreativeGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.creativeGroups.insert", + "path": "userprofiles/{profileId}/creativeGroups", + "httpMethod": "POST", + "description": "Inserts a new creative group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "CreativeGroup" + }, + "response": { + "$ref": "CreativeGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.creativeGroups.list", + "path": "userprofiles/{profileId}/creativeGroups", + "httpMethod": "GET", + "description": "Retrieves a list of creative groups, possibly filtered.", + "parameters": { + "advertiserIds": { + "type": "string", + "description": "Select only creative groups that belong to these advertisers.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "groupNumber": { + "type": "integer", + "description": "Select only creative groups that belong to this subgroup.", + "format": "int32", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only creative groups with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for creative groups by name or ID. Wildcards (*) are allowed. For example, \"creativegroup*2015\" will return creative groups with names like \"creativegroup June 2015\", \"creativegroup April 2015\", or simply \"creativegroup 2015\". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of \"creativegroup\" will match creative groups with the name \"my creativegroup\", \"creativegroup 2015\", or simply \"creativegroup\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "CreativeGroupsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.creativeGroups.patch", + "path": "userprofiles/{profileId}/creativeGroups", + "httpMethod": "PATCH", + "description": "Updates an existing creative group. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Creative group ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "CreativeGroup" + }, + "response": { + "$ref": "CreativeGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.creativeGroups.update", + "path": "userprofiles/{profileId}/creativeGroups", + "httpMethod": "PUT", + "description": "Updates an existing creative group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "CreativeGroup" + }, + "response": { + "$ref": "CreativeGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "creatives": { + "methods": { + "get": { + "id": "dfareporting.creatives.get", + "path": "userprofiles/{profileId}/creatives/{id}", + "httpMethod": "GET", + "description": "Gets one creative by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Creative ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Creative" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.creatives.insert", + "path": "userprofiles/{profileId}/creatives", + "httpMethod": "POST", + "description": "Inserts a new creative.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Creative" + }, + "response": { + "$ref": "Creative" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.creatives.list", + "path": "userprofiles/{profileId}/creatives", + "httpMethod": "GET", + "description": "Retrieves a list of creatives, possibly filtered.", + "parameters": { + "active": { + "type": "boolean", + "description": "Select only active creatives. Leave blank to select active and inactive creatives.", + "location": "query" + }, + "advertiserId": { + "type": "string", + "description": "Select only creatives with this advertiser ID.", + "format": "int64", + "location": "query" + }, + "archived": { + "type": "boolean", + "description": "Select only archived creatives. Leave blank to select archived and unarchived creatives.", + "location": "query" + }, + "campaignId": { + "type": "string", + "description": "Select only creatives with this campaign ID.", + "format": "int64", + "location": "query" + }, + "companionCreativeIds": { + "type": "string", + "description": "Select only in-stream video creatives with these companion IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "creativeFieldIds": { + "type": "string", + "description": "Select only creatives with these creative field IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only creatives with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "renderingIds": { + "type": "string", + "description": "Select only creatives with these rendering IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"creative*2015\" will return objects with names like \"creative June 2015\", \"creative April 2015\", or simply \"creative 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"creative\" will match objects with name \"my creative\", \"creative 2015\", or simply \"creative\".", + "location": "query" + }, + "sizeIds": { + "type": "string", + "description": "Select only creatives with these size IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "studioCreativeId": { + "type": "string", + "description": "Select only creatives corresponding to this Studio creative ID.", + "format": "int64", + "location": "query" + }, + "types": { + "type": "string", + "description": "Select only creatives with these creative types.", + "enum": [ + "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO", + "CUSTOM_INPAGE", + "CUSTOM_INTERSTITIAL", + "ENHANCED_BANNER", + "ENHANCED_IMAGE", + "FLASH_INPAGE", + "HTML5_BANNER", + "IMAGE", + "INSTREAM_VIDEO", + "INTERNAL_REDIRECT", + "INTERSTITIAL_INTERNAL_REDIRECT", + "REDIRECT", + "RICH_MEDIA_EXPANDING", + "RICH_MEDIA_IM_EXPAND", + "RICH_MEDIA_INPAGE", + "RICH_MEDIA_INPAGE_FLOATING", + "RICH_MEDIA_INTERSTITIAL_FLOAT", + "RICH_MEDIA_MOBILE_IN_APP", + "RICH_MEDIA_MULTI_FLOATING", + "RICH_MEDIA_PEEL_DOWN", + "TRACKING_TEXT", + "VAST_REDIRECT", + "VPAID_LINEAR", + "VPAID_NON_LINEAR" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "CreativesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.creatives.patch", + "path": "userprofiles/{profileId}/creatives", + "httpMethod": "PATCH", + "description": "Updates an existing creative. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Creative ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Creative" + }, + "response": { + "$ref": "Creative" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.creatives.update", + "path": "userprofiles/{profileId}/creatives", + "httpMethod": "PUT", + "description": "Updates an existing creative.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Creative" + }, + "response": { + "$ref": "Creative" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "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" + ] + } + } + }, + "directorySiteContacts": { + "methods": { + "get": { + "id": "dfareporting.directorySiteContacts.get", + "path": "userprofiles/{profileId}/directorySiteContacts/{id}", + "httpMethod": "GET", + "description": "Gets one directory site contact by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Directory site contact ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "DirectorySiteContact" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.directorySiteContacts.list", + "path": "userprofiles/{profileId}/directorySiteContacts", + "httpMethod": "GET", + "description": "Retrieves a list of directory site contacts, possibly filtered.", + "parameters": { + "directorySiteIds": { + "type": "string", + "description": "Select only directory site contacts with these directory site IDs. This is a required field.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only directory site contacts with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, \"directory site contact*2015\" will return objects with names like \"directory site contact June 2015\", \"directory site contact April 2015\", or simply \"directory site contact 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"directory site contact\" will match objects with name \"my directory site contact\", \"directory site contact 2015\", or simply \"directory site contact\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "DirectorySiteContactsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "directorySites": { + "methods": { + "get": { + "id": "dfareporting.directorySites.get", + "path": "userprofiles/{profileId}/directorySites/{id}", + "httpMethod": "GET", + "description": "Gets one directory site by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Directory site ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "DirectorySite" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.directorySites.list", + "path": "userprofiles/{profileId}/directorySites", + "httpMethod": "GET", + "description": "Retrieves a list of directory sites, possibly filtered.", + "parameters": { + "acceptsInStreamVideoPlacements": { + "type": "boolean", + "description": "This search filter is no longer supported and will have no effect on the results returned.", + "location": "query" + }, + "acceptsInterstitialPlacements": { + "type": "boolean", + "description": "This search filter is no longer supported and will have no effect on the results returned.", + "location": "query" + }, + "acceptsPublisherPaidPlacements": { + "type": "boolean", + "description": "Select only directory sites that accept publisher paid placements. This field can be left blank.", + "location": "query" + }, + "active": { + "type": "boolean", + "description": "Select only active directory sites. Leave blank to retrieve both active and inactive directory sites.", + "location": "query" + }, + "countryId": { + "type": "string", + "description": "Select only directory sites with this country ID.", + "format": "int64", + "location": "query" + }, + "dfp_network_code": { + "type": "string", + "description": "Select only directory sites with this DFP network code.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only directory sites with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "parentId": { + "type": "string", + "description": "Select only directory sites with this parent ID.", + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name, ID or URL. Wildcards (*) are allowed. For example, \"directory site*2015\" will return objects with names like \"directory site June 2015\", \"directory site April 2015\", or simply \"directory site 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"directory site\" will match objects with name \"my directory site\", \"directory site 2015\" or simply, \"directory site\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "DirectorySitesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "eventTags": { + "methods": { + "delete": { + "id": "dfareporting.eventTags.delete", + "path": "userprofiles/{profileId}/eventTags/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing event tag.", + "parameters": { + "id": { + "type": "string", + "description": "Event tag ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.eventTags.get", + "path": "userprofiles/{profileId}/eventTags/{id}", + "httpMethod": "GET", + "description": "Gets one event tag by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Event tag ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "EventTag" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.eventTags.insert", + "path": "userprofiles/{profileId}/eventTags", + "httpMethod": "POST", + "description": "Inserts a new event tag.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "EventTag" + }, + "response": { + "$ref": "EventTag" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.eventTags.list", + "path": "userprofiles/{profileId}/eventTags", + "httpMethod": "GET", + "description": "Retrieves a list of event tags, possibly filtered.", + "parameters": { + "adId": { + "type": "string", + "description": "Select only event tags that belong to this ad.", + "format": "int64", + "location": "query" + }, + "advertiserId": { + "type": "string", + "description": "Select only event tags that belong to this advertiser.", + "format": "int64", + "location": "query" + }, + "campaignId": { + "type": "string", + "description": "Select only event tags that belong to this campaign.", + "format": "int64", + "location": "query" + }, + "definitionsOnly": { + "type": "boolean", + "description": "Examine only the specified campaign or advertiser's event tags for matching selector criteria. When set to false, the parent advertiser and parent campaign of the specified ad or campaign is examined as well. In addition, when set to false, the status field is examined as well, along with the enabledByDefault field. This parameter can not be set to true when adId is specified as ads do not define their own even tags.", + "location": "query" + }, + "enabled": { + "type": "boolean", + "description": "Select only enabled event tags. What is considered enabled or disabled depends on the definitionsOnly parameter. When definitionsOnly is set to true, only the specified advertiser or campaign's event tags' enabledByDefault field is examined. When definitionsOnly is set to false, the specified ad or specified campaign's parent advertiser's or parent campaign's event tags' enabledByDefault and status fields are examined as well.", + "location": "query" + }, + "eventTagTypes": { + "type": "string", + "description": "Select only event tags with the specified event tag types. Event tag types can be used to specify whether to use a third-party pixel, a third-party JavaScript URL, or a third-party click-through URL for either impression or click tracking.", + "enum": [ + "CLICK_THROUGH_EVENT_TAG", + "IMPRESSION_IMAGE_EVENT_TAG", + "IMPRESSION_JAVASCRIPT_EVENT_TAG" + ], + "enumDescriptions": [ + "", + "", + "" + ], + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only event tags with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"eventtag*2015\" will return objects with names like \"eventtag June 2015\", \"eventtag April 2015\", or simply \"eventtag 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"eventtag\" will match objects with name \"my eventtag\", \"eventtag 2015\", or simply \"eventtag\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "EventTagsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.eventTags.patch", + "path": "userprofiles/{profileId}/eventTags", + "httpMethod": "PATCH", + "description": "Updates an existing event tag. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Event tag ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "EventTag" + }, + "response": { + "$ref": "EventTag" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.eventTags.update", + "path": "userprofiles/{profileId}/eventTags", + "httpMethod": "PUT", + "description": "Updates an existing event tag.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "EventTag" + }, + "response": { + "$ref": "EventTag" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "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" + ] + } + } + }, + "floodlightActivities": { + "methods": { + "delete": { + "id": "dfareporting.floodlightActivities.delete", + "path": "userprofiles/{profileId}/floodlightActivities/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing floodlight activity.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight activity ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "generatetag": { + "id": "dfareporting.floodlightActivities.generatetag", + "path": "userprofiles/{profileId}/floodlightActivities/generatetag", + "httpMethod": "POST", + "description": "Generates a tag for a floodlight activity.", + "parameters": { + "floodlightActivityId": { + "type": "string", + "description": "Floodlight activity ID for which we want to generate a tag.", + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "FloodlightActivitiesGenerateTagResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.floodlightActivities.get", + "path": "userprofiles/{profileId}/floodlightActivities/{id}", + "httpMethod": "GET", + "description": "Gets one floodlight activity by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight activity ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "FloodlightActivity" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.floodlightActivities.insert", + "path": "userprofiles/{profileId}/floodlightActivities", + "httpMethod": "POST", + "description": "Inserts a new floodlight activity.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "FloodlightActivity" + }, + "response": { + "$ref": "FloodlightActivity" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.floodlightActivities.list", + "path": "userprofiles/{profileId}/floodlightActivities", + "httpMethod": "GET", + "description": "Retrieves a list of floodlight activities, possibly filtered.", + "parameters": { + "advertiserId": { + "type": "string", + "description": "Select only floodlight activities for the specified advertiser ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.", + "format": "int64", + "location": "query" + }, + "floodlightActivityGroupIds": { + "type": "string", + "description": "Select only floodlight activities with the specified floodlight activity group IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "floodlightActivityGroupName": { + "type": "string", + "description": "Select only floodlight activities with the specified floodlight activity group name.", + "location": "query" + }, + "floodlightActivityGroupTagString": { + "type": "string", + "description": "Select only floodlight activities with the specified floodlight activity group tag string.", + "location": "query" + }, + "floodlightActivityGroupType": { + "type": "string", + "description": "Select only floodlight activities with the specified floodlight activity group type.", + "enum": [ + "COUNTER", + "SALE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "floodlightConfigurationId": { + "type": "string", + "description": "Select only floodlight activities for the specified floodlight configuration ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.", + "format": "int64", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only floodlight activities with the specified IDs. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"floodlightactivity*2015\" will return objects with names like \"floodlightactivity June 2015\", \"floodlightactivity April 2015\", or simply \"floodlightactivity 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"floodlightactivity\" will match objects with name \"my floodlightactivity activity\", \"floodlightactivity 2015\", or simply \"floodlightactivity\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "tagString": { + "type": "string", + "description": "Select only floodlight activities with the specified tag string.", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "FloodlightActivitiesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.floodlightActivities.patch", + "path": "userprofiles/{profileId}/floodlightActivities", + "httpMethod": "PATCH", + "description": "Updates an existing floodlight activity. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight activity ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "FloodlightActivity" + }, + "response": { + "$ref": "FloodlightActivity" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.floodlightActivities.update", + "path": "userprofiles/{profileId}/floodlightActivities", + "httpMethod": "PUT", + "description": "Updates an existing floodlight activity.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "FloodlightActivity" + }, + "response": { + "$ref": "FloodlightActivity" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "floodlightActivityGroups": { + "methods": { + "delete": { + "id": "dfareporting.floodlightActivityGroups.delete", + "path": "userprofiles/{profileId}/floodlightActivityGroups/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing floodlight activity group.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight activity Group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.floodlightActivityGroups.get", + "path": "userprofiles/{profileId}/floodlightActivityGroups/{id}", + "httpMethod": "GET", + "description": "Gets one floodlight activity group by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight activity Group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "FloodlightActivityGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.floodlightActivityGroups.insert", + "path": "userprofiles/{profileId}/floodlightActivityGroups", + "httpMethod": "POST", + "description": "Inserts a new floodlight activity group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "FloodlightActivityGroup" + }, + "response": { + "$ref": "FloodlightActivityGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.floodlightActivityGroups.list", + "path": "userprofiles/{profileId}/floodlightActivityGroups", + "httpMethod": "GET", + "description": "Retrieves a list of floodlight activity groups, possibly filtered.", + "parameters": { + "advertiserId": { + "type": "string", + "description": "Select only floodlight activity groups with the specified advertiser ID. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.", + "format": "int64", + "location": "query" + }, + "floodlightConfigurationId": { + "type": "string", + "description": "Select only floodlight activity groups with the specified floodlight configuration ID. Must specify either advertiserId, or floodlightConfigurationId for a non-empty result.", + "format": "int64", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only floodlight activity groups with the specified IDs. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"floodlightactivitygroup*2015\" will return objects with names like \"floodlightactivitygroup June 2015\", \"floodlightactivitygroup April 2015\", or simply \"floodlightactivitygroup 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"floodlightactivitygroup\" will match objects with name \"my floodlightactivitygroup activity\", \"floodlightactivitygroup 2015\", or simply \"floodlightactivitygroup\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "type": { + "type": "string", + "description": "Select only floodlight activity groups with the specified floodlight activity group type.", + "enum": [ + "COUNTER", + "SALE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "FloodlightActivityGroupsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.floodlightActivityGroups.patch", + "path": "userprofiles/{profileId}/floodlightActivityGroups", + "httpMethod": "PATCH", + "description": "Updates an existing floodlight activity group. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight activity Group ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "FloodlightActivityGroup" + }, + "response": { + "$ref": "FloodlightActivityGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.floodlightActivityGroups.update", + "path": "userprofiles/{profileId}/floodlightActivityGroups", + "httpMethod": "PUT", + "description": "Updates an existing floodlight activity group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "FloodlightActivityGroup" + }, + "response": { + "$ref": "FloodlightActivityGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "floodlightConfigurations": { + "methods": { + "get": { + "id": "dfareporting.floodlightConfigurations.get", + "path": "userprofiles/{profileId}/floodlightConfigurations/{id}", + "httpMethod": "GET", + "description": "Gets one floodlight configuration by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight configuration ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "FloodlightConfiguration" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.floodlightConfigurations.list", + "path": "userprofiles/{profileId}/floodlightConfigurations", + "httpMethod": "GET", + "description": "Retrieves a list of floodlight configurations, possibly filtered.", + "parameters": { + "ids": { + "type": "string", + "description": "Set of IDs of floodlight configurations to retrieve. Required field; otherwise an empty list will be returned.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "FloodlightConfigurationsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.floodlightConfigurations.patch", + "path": "userprofiles/{profileId}/floodlightConfigurations", + "httpMethod": "PATCH", + "description": "Updates an existing floodlight configuration. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight configuration ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "FloodlightConfiguration" + }, + "response": { + "$ref": "FloodlightConfiguration" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.floodlightConfigurations.update", + "path": "userprofiles/{profileId}/floodlightConfigurations", + "httpMethod": "PUT", + "description": "Updates an existing floodlight configuration.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "FloodlightConfiguration" + }, + "response": { + "$ref": "FloodlightConfiguration" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "landingPages": { + "methods": { + "delete": { + "id": "dfareporting.landingPages.delete", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing campaign landing page.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Landing page campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "id": { + "type": "string", + "description": "Landing page ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.landingPages.get", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}", + "httpMethod": "GET", + "description": "Gets one campaign landing page by ID.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Landing page campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "id": { + "type": "string", + "description": "Landing page ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId", + "id" + ], + "response": { + "$ref": "LandingPage" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.landingPages.insert", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + "httpMethod": "POST", + "description": "Inserts a new landing page for the specified campaign.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Landing page campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId" + ], + "request": { + "$ref": "LandingPage" + }, + "response": { + "$ref": "LandingPage" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.landingPages.list", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + "httpMethod": "GET", + "description": "Retrieves the list of landing pages for the specified campaign.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Landing page campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId" + ], + "response": { + "$ref": "LandingPagesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.landingPages.patch", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + "httpMethod": "PATCH", + "description": "Updates an existing campaign landing page. This method supports patch semantics.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Landing page campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "id": { + "type": "string", + "description": "Landing page ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId", + "id" + ], + "request": { + "$ref": "LandingPage" + }, + "response": { + "$ref": "LandingPage" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.landingPages.update", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + "httpMethod": "PUT", + "description": "Updates an existing campaign landing page.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Landing page campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId" + ], + "request": { + "$ref": "LandingPage" + }, + "response": { + "$ref": "LandingPage" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "metros": { + "methods": { + "list": { + "id": "dfareporting.metros.list", + "path": "userprofiles/{profileId}/metros", + "httpMethod": "GET", + "description": "Retrieves a list of metros.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "MetrosListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "mobileCarriers": { + "methods": { + "list": { + "id": "dfareporting.mobileCarriers.list", + "path": "userprofiles/{profileId}/mobileCarriers", + "httpMethod": "GET", + "description": "Retrieves a list of mobile carriers.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "MobileCarriersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "operatingSystemVersions": { + "methods": { + "list": { + "id": "dfareporting.operatingSystemVersions.list", + "path": "userprofiles/{profileId}/operatingSystemVersions", + "httpMethod": "GET", + "description": "Retrieves a list of operating system versions.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "OperatingSystemVersionsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "operatingSystems": { + "methods": { + "list": { + "id": "dfareporting.operatingSystems.list", + "path": "userprofiles/{profileId}/operatingSystems", + "httpMethod": "GET", + "description": "Retrieves a list of operating systems.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "OperatingSystemsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "placementGroups": { + "methods": { + "get": { + "id": "dfareporting.placementGroups.get", + "path": "userprofiles/{profileId}/placementGroups/{id}", + "httpMethod": "GET", + "description": "Gets one placement group by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Placement group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "PlacementGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.placementGroups.insert", + "path": "userprofiles/{profileId}/placementGroups", + "httpMethod": "POST", + "description": "Inserts a new placement group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "PlacementGroup" + }, + "response": { + "$ref": "PlacementGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.placementGroups.list", + "path": "userprofiles/{profileId}/placementGroups", + "httpMethod": "GET", + "description": "Retrieves a list of placement groups, possibly filtered.", + "parameters": { + "advertiserIds": { + "type": "string", + "description": "Select only placement groups that belong to these advertisers.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "archived": { + "type": "boolean", + "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.", + "location": "query" + }, + "campaignIds": { + "type": "string", + "description": "Select only placement groups that belong to these campaigns.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "contentCategoryIds": { + "type": "string", + "description": "Select only placement groups that are associated with these content categories.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "directorySiteIds": { + "type": "string", + "description": "Select only placement groups that are associated with these directory sites.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only placement groups with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "placementGroupType": { + "type": "string", + "description": "Select only placement groups belonging with this group type. A package is a simple group of placements that acts as a single pricing point for a group of tags. A roadblock is a group of placements that not only acts as a single pricing point but also assumes that all the tags in it will be served at the same time. A roadblock requires one of its assigned placements to be marked as primary for reporting.", + "enum": [ + "PLACEMENT_PACKAGE", + "PLACEMENT_ROADBLOCK" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "placementStrategyIds": { + "type": "string", + "description": "Select only placement groups that are associated with these placement strategies.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "pricingTypes": { + "type": "string", + "description": "Select only placement groups with these pricing types.", + "enum": [ + "PRICING_TYPE_CPA", + "PRICING_TYPE_CPC", + "PRICING_TYPE_CPM", + "PRICING_TYPE_FLAT_RATE_CLICKS", + "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for placement groups by name or ID. Wildcards (*) are allowed. For example, \"placement*2015\" will return placement groups with names like \"placement group June 2015\", \"placement group May 2015\", or simply \"placements 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"placementgroup\" will match placement groups with name \"my placementgroup\", \"placementgroup 2015\", or simply \"placementgroup\".", + "location": "query" + }, + "siteIds": { + "type": "string", + "description": "Select only placement groups that are associated with these sites.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "PlacementGroupsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.placementGroups.patch", + "path": "userprofiles/{profileId}/placementGroups", + "httpMethod": "PATCH", + "description": "Updates an existing placement group. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Placement group ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "PlacementGroup" + }, + "response": { + "$ref": "PlacementGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.placementGroups.update", + "path": "userprofiles/{profileId}/placementGroups", + "httpMethod": "PUT", + "description": "Updates an existing placement group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "PlacementGroup" + }, + "response": { + "$ref": "PlacementGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "placementStrategies": { + "methods": { + "delete": { + "id": "dfareporting.placementStrategies.delete", + "path": "userprofiles/{profileId}/placementStrategies/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing placement strategy.", + "parameters": { + "id": { + "type": "string", + "description": "Placement strategy ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.placementStrategies.get", + "path": "userprofiles/{profileId}/placementStrategies/{id}", + "httpMethod": "GET", + "description": "Gets one placement strategy by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Placement strategy ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "PlacementStrategy" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.placementStrategies.insert", + "path": "userprofiles/{profileId}/placementStrategies", + "httpMethod": "POST", + "description": "Inserts a new placement strategy.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "PlacementStrategy" + }, + "response": { + "$ref": "PlacementStrategy" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.placementStrategies.list", + "path": "userprofiles/{profileId}/placementStrategies", + "httpMethod": "GET", + "description": "Retrieves a list of placement strategies, possibly filtered.", + "parameters": { + "ids": { + "type": "string", + "description": "Select only placement strategies with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"placementstrategy*2015\" will return objects with names like \"placementstrategy June 2015\", \"placementstrategy April 2015\", or simply \"placementstrategy 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"placementstrategy\" will match objects with name \"my placementstrategy\", \"placementstrategy 2015\", or simply \"placementstrategy\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "PlacementStrategiesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.placementStrategies.patch", + "path": "userprofiles/{profileId}/placementStrategies", + "httpMethod": "PATCH", + "description": "Updates an existing placement strategy. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Placement strategy ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "PlacementStrategy" + }, + "response": { + "$ref": "PlacementStrategy" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.placementStrategies.update", + "path": "userprofiles/{profileId}/placementStrategies", + "httpMethod": "PUT", + "description": "Updates an existing placement strategy.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "PlacementStrategy" + }, + "response": { + "$ref": "PlacementStrategy" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "placements": { + "methods": { + "generatetags": { + "id": "dfareporting.placements.generatetags", + "path": "userprofiles/{profileId}/placements/generatetags", + "httpMethod": "POST", + "description": "Generates tags for a placement.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Generate placements belonging to this campaign. This is a required field.", + "format": "int64", + "location": "query" + }, + "placementIds": { + "type": "string", + "description": "Generate tags for these placements.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "tagFormats": { + "type": "string", + "description": "Tag formats to generate for these placements.", + "enum": [ + "PLACEMENT_TAG_CLICK_COMMANDS", + "PLACEMENT_TAG_IFRAME_ILAYER", + "PLACEMENT_TAG_IFRAME_JAVASCRIPT", + "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3", + "PLACEMENT_TAG_INTERNAL_REDIRECT", + "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT", + "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT", + "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT", + "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_JAVASCRIPT", + "PLACEMENT_TAG_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_STANDARD", + "PLACEMENT_TAG_TRACKING", + "PLACEMENT_TAG_TRACKING_IFRAME", + "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "PlacementsGenerateTagsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.placements.get", + "path": "userprofiles/{profileId}/placements/{id}", + "httpMethod": "GET", + "description": "Gets one placement by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Placement ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Placement" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.placements.insert", + "path": "userprofiles/{profileId}/placements", + "httpMethod": "POST", + "description": "Inserts a new placement.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Placement" + }, + "response": { + "$ref": "Placement" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.placements.list", + "path": "userprofiles/{profileId}/placements", + "httpMethod": "GET", + "description": "Retrieves a list of placements, possibly filtered.", + "parameters": { + "advertiserIds": { + "type": "string", + "description": "Select only placements that belong to these advertisers.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "archived": { + "type": "boolean", + "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.", + "location": "query" + }, + "campaignIds": { + "type": "string", + "description": "Select only placements that belong to these campaigns.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "compatibilities": { + "type": "string", + "description": "Select only placements that are associated with these compatibilities. WEB and WEB_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps.IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard.", + "enum": [ + "APP", + "APP_INTERSTITIAL", + "IN_STREAM_VIDEO", + "WEB", + "WEB_INTERSTITIAL" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + }, + "contentCategoryIds": { + "type": "string", + "description": "Select only placements that are associated with these content categories.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "directorySiteIds": { + "type": "string", + "description": "Select only placements that are associated with these directory sites.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "groupIds": { + "type": "string", + "description": "Select only placements that belong to these placement groups.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only placements with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "paymentSource": { + "type": "string", + "description": "Select only placements with this payment source.", + "enum": [ + "PLACEMENT_AGENCY_PAID", + "PLACEMENT_PUBLISHER_PAID" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "placementStrategyIds": { + "type": "string", + "description": "Select only placements that are associated with these placement strategies.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "pricingTypes": { + "type": "string", + "description": "Select only placements with these pricing types.", + "enum": [ + "PRICING_TYPE_CPA", + "PRICING_TYPE_CPC", + "PRICING_TYPE_CPM", + "PRICING_TYPE_FLAT_RATE_CLICKS", + "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for placements by name or ID. Wildcards (*) are allowed. For example, \"placement*2015\" will return placements with names like \"placement June 2015\", \"placement May 2015\", or simply \"placements 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"placement\" will match placements with name \"my placement\", \"placement 2015\", or simply \"placement\".", + "location": "query" + }, + "siteIds": { + "type": "string", + "description": "Select only placements that are associated with these sites.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sizeIds": { + "type": "string", + "description": "Select only placements that are associated with these sizes.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "PlacementsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.placements.patch", + "path": "userprofiles/{profileId}/placements", + "httpMethod": "PATCH", + "description": "Updates an existing placement. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Placement ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Placement" + }, + "response": { + "$ref": "Placement" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.placements.update", + "path": "userprofiles/{profileId}/placements", + "httpMethod": "PUT", + "description": "Updates an existing placement.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Placement" + }, + "response": { + "$ref": "Placement" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "platformTypes": { + "methods": { + "list": { + "id": "dfareporting.platformTypes.list", + "path": "userprofiles/{profileId}/platformTypes", + "httpMethod": "GET", + "description": "Retrieves a list of platform types.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "PlatformTypesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "postalCodes": { + "methods": { + "list": { + "id": "dfareporting.postalCodes.list", + "path": "userprofiles/{profileId}/postalCodes", + "httpMethod": "GET", + "description": "Retrieves a list of postal codes.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "PostalCodesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "regions": { + "methods": { + "list": { + "id": "dfareporting.regions.list", + "path": "userprofiles/{profileId}/regions", + "httpMethod": "GET", + "description": "Retrieves a list of regions.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "RegionsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "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" + ] + } + } + } + } + }, + "sites": { + "methods": { + "get": { + "id": "dfareporting.sites.get", + "path": "userprofiles/{profileId}/sites/{id}", + "httpMethod": "GET", + "description": "Gets one site by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Site ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Site" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.sites.insert", + "path": "userprofiles/{profileId}/sites", + "httpMethod": "POST", + "description": "Inserts a new site.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Site" + }, + "response": { + "$ref": "Site" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.sites.list", + "path": "userprofiles/{profileId}/sites", + "httpMethod": "GET", + "description": "Retrieves a list of sites, possibly filtered.", + "parameters": { + "acceptsInStreamVideoPlacements": { + "type": "boolean", + "description": "This search filter is no longer supported and will have no effect on the results returned.", + "location": "query" + }, + "acceptsInterstitialPlacements": { + "type": "boolean", + "description": "This search filter is no longer supported and will have no effect on the results returned.", + "location": "query" + }, + "acceptsPublisherPaidPlacements": { + "type": "boolean", + "description": "Select only sites that accept publisher paid placements.", + "location": "query" + }, + "adWordsSite": { + "type": "boolean", + "description": "Select only AdWords sites.", + "location": "query" + }, + "approved": { + "type": "boolean", + "description": "Select only approved sites.", + "location": "query" + }, + "campaignIds": { + "type": "string", + "description": "Select only sites with these campaign IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "directorySiteIds": { + "type": "string", + "description": "Select only sites with these directory site IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only sites with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name, ID or keyName. Wildcards (*) are allowed. For example, \"site*2015\" will return objects with names like \"site June 2015\", \"site April 2015\", or simply \"site 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"site\" will match objects with name \"my site\", \"site 2015\", or simply \"site\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "subaccountId": { + "type": "string", + "description": "Select only sites with this subaccount ID.", + "format": "int64", + "location": "query" + }, + "unmappedSite": { + "type": "boolean", + "description": "Select only sites that have not been mapped to a directory site.", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "SitesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.sites.patch", + "path": "userprofiles/{profileId}/sites", + "httpMethod": "PATCH", + "description": "Updates an existing site. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Site ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Site" + }, + "response": { + "$ref": "Site" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.sites.update", + "path": "userprofiles/{profileId}/sites", + "httpMethod": "PUT", + "description": "Updates an existing site.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Site" + }, + "response": { + "$ref": "Site" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "sizes": { + "methods": { + "get": { + "id": "dfareporting.sizes.get", + "path": "userprofiles/{profileId}/sizes/{id}", + "httpMethod": "GET", + "description": "Gets one size by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Size ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Size" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.sizes.insert", + "path": "userprofiles/{profileId}/sizes", + "httpMethod": "POST", + "description": "Inserts a new size.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Size" + }, + "response": { + "$ref": "Size" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.sizes.list", + "path": "userprofiles/{profileId}/sizes", + "httpMethod": "GET", + "description": "Retrieves a list of sizes, possibly filtered.", + "parameters": { + "height": { + "type": "integer", + "description": "Select only sizes with this height.", + "format": "int32", + "location": "query" + }, + "iabStandard": { + "type": "boolean", + "description": "Select only IAB standard sizes.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only sizes with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "width": { + "type": "integer", + "description": "Select only sizes with this width.", + "format": "int32", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "SizesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "subaccounts": { + "methods": { + "get": { + "id": "dfareporting.subaccounts.get", + "path": "userprofiles/{profileId}/subaccounts/{id}", + "httpMethod": "GET", + "description": "Gets one subaccount by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Subaccount ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Subaccount" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.subaccounts.insert", + "path": "userprofiles/{profileId}/subaccounts", + "httpMethod": "POST", + "description": "Inserts a new subaccount.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Subaccount" + }, + "response": { + "$ref": "Subaccount" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.subaccounts.list", + "path": "userprofiles/{profileId}/subaccounts", + "httpMethod": "GET", + "description": "Gets a list of subaccounts, possibly filtered.", + "parameters": { + "ids": { + "type": "string", + "description": "Select only subaccounts with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"subaccount*2015\" will return objects with names like \"subaccount June 2015\", \"subaccount April 2015\", or simply \"subaccount 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"subaccount\" will match objects with name \"my subaccount\", \"subaccount 2015\", or simply \"subaccount\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "SubaccountsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.subaccounts.patch", + "path": "userprofiles/{profileId}/subaccounts", + "httpMethod": "PATCH", + "description": "Updates an existing subaccount. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Subaccount ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Subaccount" + }, + "response": { + "$ref": "Subaccount" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.subaccounts.update", + "path": "userprofiles/{profileId}/subaccounts", + "httpMethod": "PUT", + "description": "Updates an existing subaccount.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Subaccount" + }, + "response": { + "$ref": "Subaccount" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "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", + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "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", + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "userRolePermissionGroups": { + "methods": { + "get": { + "id": "dfareporting.userRolePermissionGroups.get", + "path": "userprofiles/{profileId}/userRolePermissionGroups/{id}", + "httpMethod": "GET", + "description": "Gets one user role permission group by ID.", + "parameters": { + "id": { + "type": "string", + "description": "User role permission group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "UserRolePermissionGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.userRolePermissionGroups.list", + "path": "userprofiles/{profileId}/userRolePermissionGroups", + "httpMethod": "GET", + "description": "Gets a list of all supported user role permission groups.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "UserRolePermissionGroupsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "userRolePermissions": { + "methods": { + "get": { + "id": "dfareporting.userRolePermissions.get", + "path": "userprofiles/{profileId}/userRolePermissions/{id}", + "httpMethod": "GET", + "description": "Gets one user role permission by ID.", + "parameters": { + "id": { + "type": "string", + "description": "User role permission ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "UserRolePermission" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.userRolePermissions.list", + "path": "userprofiles/{profileId}/userRolePermissions", + "httpMethod": "GET", + "description": "Gets a list of user role permissions, possibly filtered.", + "parameters": { + "ids": { + "type": "string", + "description": "Select only user role permissions with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "UserRolePermissionsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "userRoles": { + "methods": { + "delete": { + "id": "dfareporting.userRoles.delete", + "path": "userprofiles/{profileId}/userRoles/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing user role.", + "parameters": { + "id": { + "type": "string", + "description": "User role ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.userRoles.get", + "path": "userprofiles/{profileId}/userRoles/{id}", + "httpMethod": "GET", + "description": "Gets one user role by ID.", + "parameters": { + "id": { + "type": "string", + "description": "User role ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "UserRole" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.userRoles.insert", + "path": "userprofiles/{profileId}/userRoles", + "httpMethod": "POST", + "description": "Inserts a new user role.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "UserRole" + }, + "response": { + "$ref": "UserRole" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.userRoles.list", + "path": "userprofiles/{profileId}/userRoles", + "httpMethod": "GET", + "description": "Retrieves a list of user roles, possibly filtered.", + "parameters": { + "accountUserRoleOnly": { + "type": "boolean", + "description": "Select only account level user roles not associated with any specific subaccount.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only user roles with the specified IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"userrole*2015\" will return objects with names like \"userrole June 2015\", \"userrole April 2015\", or simply \"userrole 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"userrole\" will match objects with name \"my userrole\", \"userrole 2015\", or simply \"userrole\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "subaccountId": { + "type": "string", + "description": "Select only user roles that belong to this subaccount.", + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "UserRolesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.userRoles.patch", + "path": "userprofiles/{profileId}/userRoles", + "httpMethod": "PATCH", + "description": "Updates an existing user role. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "User role ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "UserRole" + }, + "response": { + "$ref": "UserRole" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.userRoles.update", + "path": "userprofiles/{profileId}/userRoles", + "httpMethod": "PUT", + "description": "Updates an existing user role.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "UserRole" + }, + "response": { + "$ref": "UserRole" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/dfareporting/v2.0/dfareporting-gen.go b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v2.0/dfareporting-gen.go new file mode 100644 index 000000000..f1bdda55e --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v2.0/dfareporting-gen.go @@ -0,0 +1,36804 @@ +// Package dfareporting provides access to the DCM/DFA Reporting And Trafficking API. +// +// See https://developers.google.com/doubleclick-advertisers/reporting/ +// +// Usage example: +// +// import "google.golang.org/api/dfareporting/v2.0" +// ... +// dfareportingService, err := dfareporting.New(oauthHttpClient) +package dfareporting // import "google.golang.org/api/dfareporting/v2.0" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "dfareporting:v2.0" +const apiName = "dfareporting" +const apiVersion = "v2.0" +const basePath = "https://www.googleapis.com/dfareporting/v2.0/" + +// OAuth2 scopes used by this API. +const ( + // View and manage DoubleClick for Advertisers reports + DfareportingScope = "https://www.googleapis.com/auth/dfareporting" + + // View and manage your DoubleClick Campaign Manager's (DCM) display ad + // campaigns + DfatraffickingScope = "https://www.googleapis.com/auth/dfatrafficking" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.AccountActiveAdSummaries = NewAccountActiveAdSummariesService(s) + s.AccountPermissionGroups = NewAccountPermissionGroupsService(s) + s.AccountPermissions = NewAccountPermissionsService(s) + s.AccountUserProfiles = NewAccountUserProfilesService(s) + s.Accounts = NewAccountsService(s) + s.Ads = NewAdsService(s) + s.AdvertiserGroups = NewAdvertiserGroupsService(s) + s.Advertisers = NewAdvertisersService(s) + s.Browsers = NewBrowsersService(s) + s.CampaignCreativeAssociations = NewCampaignCreativeAssociationsService(s) + s.Campaigns = NewCampaignsService(s) + s.ChangeLogs = NewChangeLogsService(s) + s.Cities = NewCitiesService(s) + s.ConnectionTypes = NewConnectionTypesService(s) + s.ContentCategories = NewContentCategoriesService(s) + s.Countries = NewCountriesService(s) + s.CreativeAssets = NewCreativeAssetsService(s) + s.CreativeFieldValues = NewCreativeFieldValuesService(s) + s.CreativeFields = NewCreativeFieldsService(s) + s.CreativeGroups = NewCreativeGroupsService(s) + s.Creatives = NewCreativesService(s) + s.DimensionValues = NewDimensionValuesService(s) + s.DirectorySiteContacts = NewDirectorySiteContactsService(s) + s.DirectorySites = NewDirectorySitesService(s) + s.EventTags = NewEventTagsService(s) + s.Files = NewFilesService(s) + s.FloodlightActivities = NewFloodlightActivitiesService(s) + s.FloodlightActivityGroups = NewFloodlightActivityGroupsService(s) + s.FloodlightConfigurations = NewFloodlightConfigurationsService(s) + s.LandingPages = NewLandingPagesService(s) + s.Metros = NewMetrosService(s) + s.MobileCarriers = NewMobileCarriersService(s) + s.OperatingSystemVersions = NewOperatingSystemVersionsService(s) + s.OperatingSystems = NewOperatingSystemsService(s) + s.PlacementGroups = NewPlacementGroupsService(s) + s.PlacementStrategies = NewPlacementStrategiesService(s) + s.Placements = NewPlacementsService(s) + s.PlatformTypes = NewPlatformTypesService(s) + s.PostalCodes = NewPostalCodesService(s) + s.Regions = NewRegionsService(s) + s.Reports = NewReportsService(s) + s.Sites = NewSitesService(s) + s.Sizes = NewSizesService(s) + s.Subaccounts = NewSubaccountsService(s) + s.UserProfiles = NewUserProfilesService(s) + s.UserRolePermissionGroups = NewUserRolePermissionGroupsService(s) + s.UserRolePermissions = NewUserRolePermissionsService(s) + s.UserRoles = NewUserRolesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + AccountActiveAdSummaries *AccountActiveAdSummariesService + + AccountPermissionGroups *AccountPermissionGroupsService + + AccountPermissions *AccountPermissionsService + + AccountUserProfiles *AccountUserProfilesService + + Accounts *AccountsService + + Ads *AdsService + + AdvertiserGroups *AdvertiserGroupsService + + Advertisers *AdvertisersService + + Browsers *BrowsersService + + CampaignCreativeAssociations *CampaignCreativeAssociationsService + + Campaigns *CampaignsService + + ChangeLogs *ChangeLogsService + + Cities *CitiesService + + ConnectionTypes *ConnectionTypesService + + ContentCategories *ContentCategoriesService + + Countries *CountriesService + + CreativeAssets *CreativeAssetsService + + CreativeFieldValues *CreativeFieldValuesService + + CreativeFields *CreativeFieldsService + + CreativeGroups *CreativeGroupsService + + Creatives *CreativesService + + DimensionValues *DimensionValuesService + + DirectorySiteContacts *DirectorySiteContactsService + + DirectorySites *DirectorySitesService + + EventTags *EventTagsService + + Files *FilesService + + FloodlightActivities *FloodlightActivitiesService + + FloodlightActivityGroups *FloodlightActivityGroupsService + + FloodlightConfigurations *FloodlightConfigurationsService + + LandingPages *LandingPagesService + + Metros *MetrosService + + MobileCarriers *MobileCarriersService + + OperatingSystemVersions *OperatingSystemVersionsService + + OperatingSystems *OperatingSystemsService + + PlacementGroups *PlacementGroupsService + + PlacementStrategies *PlacementStrategiesService + + Placements *PlacementsService + + PlatformTypes *PlatformTypesService + + PostalCodes *PostalCodesService + + Regions *RegionsService + + Reports *ReportsService + + Sites *SitesService + + Sizes *SizesService + + Subaccounts *SubaccountsService + + UserProfiles *UserProfilesService + + UserRolePermissionGroups *UserRolePermissionGroupsService + + UserRolePermissions *UserRolePermissionsService + + UserRoles *UserRolesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAccountActiveAdSummariesService(s *Service) *AccountActiveAdSummariesService { + rs := &AccountActiveAdSummariesService{s: s} + return rs +} + +type AccountActiveAdSummariesService struct { + s *Service +} + +func NewAccountPermissionGroupsService(s *Service) *AccountPermissionGroupsService { + rs := &AccountPermissionGroupsService{s: s} + return rs +} + +type AccountPermissionGroupsService struct { + s *Service +} + +func NewAccountPermissionsService(s *Service) *AccountPermissionsService { + rs := &AccountPermissionsService{s: s} + return rs +} + +type AccountPermissionsService struct { + s *Service +} + +func NewAccountUserProfilesService(s *Service) *AccountUserProfilesService { + rs := &AccountUserProfilesService{s: s} + return rs +} + +type AccountUserProfilesService struct { + s *Service +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + return rs +} + +type AccountsService struct { + s *Service +} + +func NewAdsService(s *Service) *AdsService { + rs := &AdsService{s: s} + return rs +} + +type AdsService struct { + s *Service +} + +func NewAdvertiserGroupsService(s *Service) *AdvertiserGroupsService { + rs := &AdvertiserGroupsService{s: s} + return rs +} + +type AdvertiserGroupsService struct { + s *Service +} + +func NewAdvertisersService(s *Service) *AdvertisersService { + rs := &AdvertisersService{s: s} + return rs +} + +type AdvertisersService struct { + s *Service +} + +func NewBrowsersService(s *Service) *BrowsersService { + rs := &BrowsersService{s: s} + return rs +} + +type BrowsersService struct { + s *Service +} + +func NewCampaignCreativeAssociationsService(s *Service) *CampaignCreativeAssociationsService { + rs := &CampaignCreativeAssociationsService{s: s} + return rs +} + +type CampaignCreativeAssociationsService struct { + s *Service +} + +func NewCampaignsService(s *Service) *CampaignsService { + rs := &CampaignsService{s: s} + return rs +} + +type CampaignsService struct { + s *Service +} + +func NewChangeLogsService(s *Service) *ChangeLogsService { + rs := &ChangeLogsService{s: s} + return rs +} + +type ChangeLogsService struct { + s *Service +} + +func NewCitiesService(s *Service) *CitiesService { + rs := &CitiesService{s: s} + return rs +} + +type CitiesService struct { + s *Service +} + +func NewConnectionTypesService(s *Service) *ConnectionTypesService { + rs := &ConnectionTypesService{s: s} + return rs +} + +type ConnectionTypesService struct { + s *Service +} + +func NewContentCategoriesService(s *Service) *ContentCategoriesService { + rs := &ContentCategoriesService{s: s} + return rs +} + +type ContentCategoriesService struct { + s *Service +} + +func NewCountriesService(s *Service) *CountriesService { + rs := &CountriesService{s: s} + return rs +} + +type CountriesService struct { + s *Service +} + +func NewCreativeAssetsService(s *Service) *CreativeAssetsService { + rs := &CreativeAssetsService{s: s} + return rs +} + +type CreativeAssetsService struct { + s *Service +} + +func NewCreativeFieldValuesService(s *Service) *CreativeFieldValuesService { + rs := &CreativeFieldValuesService{s: s} + return rs +} + +type CreativeFieldValuesService struct { + s *Service +} + +func NewCreativeFieldsService(s *Service) *CreativeFieldsService { + rs := &CreativeFieldsService{s: s} + return rs +} + +type CreativeFieldsService struct { + s *Service +} + +func NewCreativeGroupsService(s *Service) *CreativeGroupsService { + rs := &CreativeGroupsService{s: s} + return rs +} + +type CreativeGroupsService struct { + s *Service +} + +func NewCreativesService(s *Service) *CreativesService { + rs := &CreativesService{s: s} + return rs +} + +type CreativesService struct { + s *Service +} + +func NewDimensionValuesService(s *Service) *DimensionValuesService { + rs := &DimensionValuesService{s: s} + return rs +} + +type DimensionValuesService struct { + s *Service +} + +func NewDirectorySiteContactsService(s *Service) *DirectorySiteContactsService { + rs := &DirectorySiteContactsService{s: s} + return rs +} + +type DirectorySiteContactsService struct { + s *Service +} + +func NewDirectorySitesService(s *Service) *DirectorySitesService { + rs := &DirectorySitesService{s: s} + return rs +} + +type DirectorySitesService struct { + s *Service +} + +func NewEventTagsService(s *Service) *EventTagsService { + rs := &EventTagsService{s: s} + return rs +} + +type EventTagsService struct { + s *Service +} + +func NewFilesService(s *Service) *FilesService { + rs := &FilesService{s: s} + return rs +} + +type FilesService struct { + s *Service +} + +func NewFloodlightActivitiesService(s *Service) *FloodlightActivitiesService { + rs := &FloodlightActivitiesService{s: s} + return rs +} + +type FloodlightActivitiesService struct { + s *Service +} + +func NewFloodlightActivityGroupsService(s *Service) *FloodlightActivityGroupsService { + rs := &FloodlightActivityGroupsService{s: s} + return rs +} + +type FloodlightActivityGroupsService struct { + s *Service +} + +func NewFloodlightConfigurationsService(s *Service) *FloodlightConfigurationsService { + rs := &FloodlightConfigurationsService{s: s} + return rs +} + +type FloodlightConfigurationsService struct { + s *Service +} + +func NewLandingPagesService(s *Service) *LandingPagesService { + rs := &LandingPagesService{s: s} + return rs +} + +type LandingPagesService struct { + s *Service +} + +func NewMetrosService(s *Service) *MetrosService { + rs := &MetrosService{s: s} + return rs +} + +type MetrosService struct { + s *Service +} + +func NewMobileCarriersService(s *Service) *MobileCarriersService { + rs := &MobileCarriersService{s: s} + return rs +} + +type MobileCarriersService struct { + s *Service +} + +func NewOperatingSystemVersionsService(s *Service) *OperatingSystemVersionsService { + rs := &OperatingSystemVersionsService{s: s} + return rs +} + +type OperatingSystemVersionsService struct { + s *Service +} + +func NewOperatingSystemsService(s *Service) *OperatingSystemsService { + rs := &OperatingSystemsService{s: s} + return rs +} + +type OperatingSystemsService struct { + s *Service +} + +func NewPlacementGroupsService(s *Service) *PlacementGroupsService { + rs := &PlacementGroupsService{s: s} + return rs +} + +type PlacementGroupsService struct { + s *Service +} + +func NewPlacementStrategiesService(s *Service) *PlacementStrategiesService { + rs := &PlacementStrategiesService{s: s} + return rs +} + +type PlacementStrategiesService struct { + s *Service +} + +func NewPlacementsService(s *Service) *PlacementsService { + rs := &PlacementsService{s: s} + return rs +} + +type PlacementsService struct { + s *Service +} + +func NewPlatformTypesService(s *Service) *PlatformTypesService { + rs := &PlatformTypesService{s: s} + return rs +} + +type PlatformTypesService struct { + s *Service +} + +func NewPostalCodesService(s *Service) *PostalCodesService { + rs := &PostalCodesService{s: s} + return rs +} + +type PostalCodesService struct { + s *Service +} + +func NewRegionsService(s *Service) *RegionsService { + rs := &RegionsService{s: s} + return rs +} + +type RegionsService 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 NewSitesService(s *Service) *SitesService { + rs := &SitesService{s: s} + return rs +} + +type SitesService struct { + s *Service +} + +func NewSizesService(s *Service) *SizesService { + rs := &SizesService{s: s} + return rs +} + +type SizesService struct { + s *Service +} + +func NewSubaccountsService(s *Service) *SubaccountsService { + rs := &SubaccountsService{s: s} + return rs +} + +type SubaccountsService struct { + s *Service +} + +func NewUserProfilesService(s *Service) *UserProfilesService { + rs := &UserProfilesService{s: s} + return rs +} + +type UserProfilesService struct { + s *Service +} + +func NewUserRolePermissionGroupsService(s *Service) *UserRolePermissionGroupsService { + rs := &UserRolePermissionGroupsService{s: s} + return rs +} + +type UserRolePermissionGroupsService struct { + s *Service +} + +func NewUserRolePermissionsService(s *Service) *UserRolePermissionsService { + rs := &UserRolePermissionsService{s: s} + return rs +} + +type UserRolePermissionsService struct { + s *Service +} + +func NewUserRolesService(s *Service) *UserRolesService { + rs := &UserRolesService{s: s} + return rs +} + +type UserRolesService struct { + s *Service +} + +// Account: Contains properties of a DCM account. +type Account struct { + // AccountPermissionIds: Account permissions assigned to this account. + AccountPermissionIds googleapi.Int64s `json:"accountPermissionIds,omitempty"` + + // AccountProfile: Profile for this account. This is a read-only field + // that can be left blank. + // + // Possible values: + // "ACCOUNT_PROFILE_BASIC" + // "ACCOUNT_PROFILE_STANDARD" + AccountProfile string `json:"accountProfile,omitempty"` + + // Active: Whether this account is active. + Active bool `json:"active,omitempty"` + + // ActiveAdsLimitTier: Maximum number of active ads allowed for this + // account. + // + // Possible values: + // "ACTIVE_ADS_TIER_100K" + // "ACTIVE_ADS_TIER_200K" + // "ACTIVE_ADS_TIER_300K" + // "ACTIVE_ADS_TIER_40K" + // "ACTIVE_ADS_TIER_75K" + ActiveAdsLimitTier string `json:"activeAdsLimitTier,omitempty"` + + // ActiveViewOptOut: Whether to serve creatives with Active View tags. + // If disabled, viewability data will not be available for any + // impressions. + ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"` + + // AvailablePermissionIds: User role permissions available to the user + // roles of this account. + AvailablePermissionIds googleapi.Int64s `json:"availablePermissionIds,omitempty"` + + // ComscoreVceEnabled: Whether campaigns created in this account will be + // enabled for comScore vCE by default. + ComscoreVceEnabled bool `json:"comscoreVceEnabled,omitempty"` + + // CountryId: ID of the country associated with this account. + CountryId int64 `json:"countryId,omitempty,string"` + + // CurrencyId: ID of currency associated with this account. This is a + // required field. + // Acceptable values are: + // - "1" for USD + // - "2" for GBP + // - "3" for ESP + // - "4" for SEK + // - "5" for CAD + // - "6" for JPY + // - "7" for DEM + // - "8" for AUD + // - "9" for FRF + // - "10" for ITL + // - "11" for DKK + // - "12" for NOK + // - "13" for FIM + // - "14" for ZAR + // - "15" for IEP + // - "16" for NLG + // - "17" for EUR + // - "18" for KRW + // - "19" for TWD + // - "20" for SGD + // - "21" for CNY + // - "22" for HKD + // - "23" for NZD + // - "24" for MYR + // - "25" for BRL + // - "26" for PTE + // - "27" for MXP + // - "28" for CLP + // - "29" for TRY + // - "30" for ARS + // - "31" for PEN + // - "32" for ILS + // - "33" for CHF + // - "34" for VEF + // - "35" for COP + // - "36" for GTQ + CurrencyId int64 `json:"currencyId,omitempty,string"` + + // DefaultCreativeSizeId: Default placement dimensions for this account. + DefaultCreativeSizeId int64 `json:"defaultCreativeSizeId,omitempty,string"` + + // Description: Description of this account. + Description string `json:"description,omitempty"` + + // Id: ID of this account. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#account". + Kind string `json:"kind,omitempty"` + + // Locale: Locale of this account. + // Acceptable values are: + // - "cs" (Czech) + // - "de" (German) + // - "en" (English) + // - "en-GB" (English United Kingdom) + // - "es" (Spanish) + // - "fr" (French) + // - "it" (Italian) + // - "ja" (Japanese) + // - "ko" (Korean) + // - "pl" (Polish) + // - "pt-BR" (Portuguese Brazil) + // - "ru" (Russian) + // - "sv" (Swedish) + // - "tr" (Turkish) + // - "zh-CN" (Chinese Simplified) + // - "zh-TW" (Chinese Traditional) + Locale string `json:"locale,omitempty"` + + // MaximumImageSize: Maximum image size allowed for this account. + MaximumImageSize int64 `json:"maximumImageSize,omitempty,string"` + + // Name: Name of this account. This is a required field, and must be + // less than 128 characters long and be globally unique. + Name string `json:"name,omitempty"` + + // NielsenOcrEnabled: Whether campaigns created in this account will be + // enabled for Nielsen OCR reach ratings by default. + NielsenOcrEnabled bool `json:"nielsenOcrEnabled,omitempty"` + + // ReportsConfiguration: Reporting configuration of this account. + ReportsConfiguration *ReportsConfiguration `json:"reportsConfiguration,omitempty"` + + // TeaserSizeLimit: File size limit in kilobytes of Rich Media teaser + // creatives. Must be between 1 and 10240. + TeaserSizeLimit int64 `json:"teaserSizeLimit,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "AccountPermissionIds") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Account) MarshalJSON() ([]byte, error) { + type noMethod Account + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountActiveAdSummary: Gets a summary of active ads in an account. +type AccountActiveAdSummary struct { + // AccountId: ID of the account. + AccountId int64 `json:"accountId,omitempty,string"` + + // ActiveAds: Ads that have been activated for the account + ActiveAds int64 `json:"activeAds,omitempty,string"` + + // ActiveAdsLimitTier: Maximum number of active ads allowed for the + // account. + // + // Possible values: + // "ACTIVE_ADS_TIER_100K" + // "ACTIVE_ADS_TIER_200K" + // "ACTIVE_ADS_TIER_300K" + // "ACTIVE_ADS_TIER_40K" + // "ACTIVE_ADS_TIER_75K" + ActiveAdsLimitTier string `json:"activeAdsLimitTier,omitempty"` + + // AvailableAds: Ads that can be activated for the account. + AvailableAds int64 `json:"availableAds,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#accountActiveAdSummary". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountActiveAdSummary) MarshalJSON() ([]byte, error) { + type noMethod AccountActiveAdSummary + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountPermission: AccountPermissions contains information about a +// particular account permission. Some features of DCM require an +// account permission to be present in the account. +type AccountPermission struct { + // AccountProfiles: Account profiles associated with this account + // permission. + // + // Possible values are: + // - "ACCOUNT_PROFILE_BASIC" + // - "ACCOUNT_PROFILE_STANDARD" + // + // Possible values: + // "ACCOUNT_PROFILE_BASIC" + // "ACCOUNT_PROFILE_STANDARD" + AccountProfiles []string `json:"accountProfiles,omitempty"` + + // Id: ID of this account permission. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#accountPermission". + Kind string `json:"kind,omitempty"` + + // Level: Administrative level required to enable this account + // permission. + // + // Possible values: + // "ADMINISTRATOR" + // "USER" + Level string `json:"level,omitempty"` + + // Name: Name of this account permission. + Name string `json:"name,omitempty"` + + // PermissionGroupId: Permission group of this account permission. + PermissionGroupId int64 `json:"permissionGroupId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountProfiles") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountPermission) MarshalJSON() ([]byte, error) { + type noMethod AccountPermission + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountPermissionGroup: AccountPermissionGroups contains a mapping of +// permission group IDs to names. A permission group is a grouping of +// account permissions. +type AccountPermissionGroup struct { + // Id: ID of this account permission group. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#accountPermissionGroup". + Kind string `json:"kind,omitempty"` + + // Name: Name of this account permission group. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountPermissionGroup) MarshalJSON() ([]byte, error) { + type noMethod AccountPermissionGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountPermissionGroupsListResponse: Account Permission Group List +// Response +type AccountPermissionGroupsListResponse struct { + // AccountPermissionGroups: Account permission group collection. + AccountPermissionGroups []*AccountPermissionGroup `json:"accountPermissionGroups,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#accountPermissionGroupsListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "AccountPermissionGroups") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountPermissionGroupsListResponse) MarshalJSON() ([]byte, error) { + type noMethod AccountPermissionGroupsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountPermissionsListResponse: Account Permission List Response +type AccountPermissionsListResponse struct { + // AccountPermissions: Account permission collection. + AccountPermissions []*AccountPermission `json:"accountPermissions,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#accountPermissionsListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountPermissions") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountPermissionsListResponse) MarshalJSON() ([]byte, error) { + type noMethod AccountPermissionsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountUserProfile: AccountUserProfiles contains properties of a DCM +// user profile. This resource is specifically for managing user +// profiles, whereas UserProfiles is for accessing the API. +type AccountUserProfile struct { + // AccountId: Account ID of the user profile. This is a read-only field + // that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // Active: Whether this user profile is active. This defaults to false, + // and must be set true on insert for the user profile to be usable. + Active bool `json:"active,omitempty"` + + // AdvertiserFilter: Filter that describes which advertisers are visible + // to the user profile. + AdvertiserFilter *ObjectFilter `json:"advertiserFilter,omitempty"` + + // CampaignFilter: Filter that describes which campaigns are visible to + // the user profile. + CampaignFilter *ObjectFilter `json:"campaignFilter,omitempty"` + + // Comments: Comments for this user profile. + Comments string `json:"comments,omitempty"` + + // Email: Email of the user profile. The email addresss must be linked + // to a Google Account. This field is required on insertion and is + // read-only after insertion. + Email string `json:"email,omitempty"` + + // Id: ID of the user profile. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#accountUserProfile". + Kind string `json:"kind,omitempty"` + + // Locale: Locale of the user profile. This is a required + // field. + // Acceptable values are: + // - "cs" (Czech) + // - "de" (German) + // - "en" (English) + // - "en-GB" (English United Kingdom) + // - "es" (Spanish) + // - "fr" (French) + // - "it" (Italian) + // - "ja" (Japanese) + // - "ko" (Korean) + // - "pl" (Polish) + // - "pt-BR" (Portuguese Brazil) + // - "ru" (Russian) + // - "sv" (Swedish) + // - "tr" (Turkish) + // - "zh-CN" (Chinese Simplified) + // - "zh-TW" (Chinese Traditional) + Locale string `json:"locale,omitempty"` + + // Name: Name of the user profile. This is a required field. Must be + // less than 64 characters long, must be globally unique, and cannot + // contain whitespace or any of the following characters: "&;"#%,". + Name string `json:"name,omitempty"` + + // SiteFilter: Filter that describes which sites are visible to the user + // profile. + SiteFilter *ObjectFilter `json:"siteFilter,omitempty"` + + // SubaccountId: Subaccount ID of the user profile. This is a read-only + // field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TraffickerType: Trafficker type of this user profile. + // + // Possible values: + // "EXTERNAL_TRAFFICKER" + // "INTERNAL_NON_TRAFFICKER" + // "INTERNAL_TRAFFICKER" + TraffickerType string `json:"traffickerType,omitempty"` + + // UserAccessType: User type of the user profile. This is a read-only + // field that can be left blank. + // + // Possible values: + // "INTERNAL_ADMINISTRATOR" + // "NORMAL_USER" + // "SUPER_USER" + UserAccessType string `json:"userAccessType,omitempty"` + + // UserRoleFilter: Filter that describes which user roles are visible to + // the user profile. + UserRoleFilter *ObjectFilter `json:"userRoleFilter,omitempty"` + + // UserRoleId: User role ID of the user profile. This is a required + // field. + UserRoleId int64 `json:"userRoleId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountUserProfile) MarshalJSON() ([]byte, error) { + type noMethod AccountUserProfile + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountUserProfilesListResponse: Account User Profile List Response +type AccountUserProfilesListResponse struct { + // AccountUserProfiles: Account user profile collection. + AccountUserProfiles []*AccountUserProfile `json:"accountUserProfiles,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#accountUserProfilesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountUserProfiles") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountUserProfilesListResponse) MarshalJSON() ([]byte, error) { + type noMethod AccountUserProfilesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountsListResponse: Account List Response +type AccountsListResponse struct { + // Accounts: Account collection. + Accounts []*Account `json:"accounts,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#accountsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Accounts") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountsListResponse) MarshalJSON() ([]byte, error) { + type noMethod AccountsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Activities: Represents an activity group. +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"` + + // ForceSendFields is a list of field names (e.g. "Filters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Activities) MarshalJSON() ([]byte, error) { + type noMethod Activities + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Ad: Contains properties of a DCM ad. +type Ad struct { + // AccountId: Account ID of this ad. This is a read-only field that can + // be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // Active: Whether this ad is active. + Active bool `json:"active,omitempty"` + + // AdvertiserId: Advertiser ID of this ad. This is a required field on + // insertion. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // Archived: Whether this ad is archived. + Archived bool `json:"archived,omitempty"` + + // AudienceSegmentId: Audience segment ID that is being targeted for + // this ad. Applicable when type is AD_SERVING_STANDARD_AD. + AudienceSegmentId int64 `json:"audienceSegmentId,omitempty,string"` + + // CampaignId: Campaign ID of this ad. This is a required field on + // insertion. + CampaignId int64 `json:"campaignId,omitempty,string"` + + // CampaignIdDimensionValue: Dimension value for the ID of the campaign. + // This is a read-only, auto-generated field. + CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"` + + // ClickThroughUrl: Click-through URL for this ad. This is a required + // field on insertion. Applicable when type is AD_SERVING_CLICK_TRACKER. + ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"` + + // ClickThroughUrlSuffixProperties: Click-through URL suffix properties + // for this ad. Applies to the URL in the ad or (if overriding ad + // properties) the URL in the creative. + ClickThroughUrlSuffixProperties *ClickThroughUrlSuffixProperties `json:"clickThroughUrlSuffixProperties,omitempty"` + + // Comments: Comments for this ad. + Comments string `json:"comments,omitempty"` + + // Compatibility: Compatibility of this ad. Applicable when type is + // AD_SERVING_DEFAULT_AD. WEB and WEB_INTERSTITIAL refer to rendering + // either on desktop or on mobile devices for regular or interstitial + // ads, respectively. APP and APP_INTERSTITIAL are for rendering in + // mobile apps. IN_STREAM_VIDEO refers to rendering an in-stream video + // ads developed with the VAST standard. + // + // Possible values: + // "APP" + // "APP_INTERSTITIAL" + // "IN_STREAM_VIDEO" + // "WEB" + // "WEB_INTERSTITIAL" + Compatibility string `json:"compatibility,omitempty"` + + // CreateInfo: Information about the creation of this ad.This is a + // read-only field. + CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"` + + // CreativeGroupAssignments: Creative group assignments for this ad. + // Applicable when type is AD_SERVING_CLICK_TRACKER. Only one assignment + // per creative group number is allowed for a maximum of two + // assignments. + CreativeGroupAssignments []*CreativeGroupAssignment `json:"creativeGroupAssignments,omitempty"` + + // CreativeRotation: Creative rotation for this ad. Applicable when type + // is AD_SERVING_DEFAULT_AD, AD_SERVING_STANDARD_AD, or + // AD_SERVING_TRACKING. When type is AD_SERVING_DEFAULT_AD, this field + // should have exactly one creativeAssignment. + CreativeRotation *CreativeRotation `json:"creativeRotation,omitempty"` + + // DayPartTargeting: Time and day targeting information for this ad. + // Applicable when type is AD_SERVING_STANDARD_AD. + DayPartTargeting *DayPartTargeting `json:"dayPartTargeting,omitempty"` + + // DefaultClickThroughEventTagProperties: Default click-through event + // tag properties for this ad. + DefaultClickThroughEventTagProperties *DefaultClickThroughEventTagProperties `json:"defaultClickThroughEventTagProperties,omitempty"` + + // DeliverySchedule: Delivery schedule information for this ad. + // Applicable when type is AD_SERVING_STANDARD_AD or + // AD_SERVING_TRACKING. This field along with subfields priority and + // impressionRatio are required on insertion when type is + // AD_SERVING_STANDARD_AD. + DeliverySchedule *DeliverySchedule `json:"deliverySchedule,omitempty"` + + // DynamicClickTracker: Whether this ad is a dynamic click tracker. + // Applicable when type is AD_SERVING_CLICK_TRACKER. This is a required + // field on insert, and is read-only after insert. + DynamicClickTracker bool `json:"dynamicClickTracker,omitempty"` + + // EndTime: Date and time that this ad should stop serving. Must be + // later than the start time. This is a required field on insertion. + EndTime string `json:"endTime,omitempty"` + + // EventTagOverrides: Event tag overrides for this ad. + EventTagOverrides []*EventTagOverride `json:"eventTagOverrides,omitempty"` + + // GeoTargeting: Geographical targeting information for this + // ad.Applicable when type is AD_SERVING_STANDARD_AD. + GeoTargeting *GeoTargeting `json:"geoTargeting,omitempty"` + + // Id: ID of this ad. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this ad. This is a + // read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // KeyValueTargetingExpression: Key-value targeting information for this + // ad. Applicable when type is AD_SERVING_STANDARD_AD. + KeyValueTargetingExpression *KeyValueTargetingExpression `json:"keyValueTargetingExpression,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#ad". + Kind string `json:"kind,omitempty"` + + // LastModifiedInfo: Information about the most recent modification of + // this ad. This is a read-only field. + LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"` + + // Name: Name of this ad. This is a required field and must be less than + // 256 characters long. + Name string `json:"name,omitempty"` + + // PlacementAssignments: Placement assignments for this ad. + PlacementAssignments []*PlacementAssignment `json:"placementAssignments,omitempty"` + + // RemarketingListExpression: Applicable when type is + // AD_SERVING_STANDARD_AD. Remarketing list targeting expression for + // this ad. + RemarketingListExpression *ListTargetingExpression `json:"remarketing_list_expression,omitempty"` + + // Size: Size of this ad. Applicable when type is AD_SERVING_DEFAULT_AD. + Size *Size `json:"size,omitempty"` + + // SslCompliant: Whether this ad is ssl compliant. This is a read-only + // field that is auto-generated when the ad is inserted or updated. + SslCompliant bool `json:"sslCompliant,omitempty"` + + // SslRequired: Whether this ad requires ssl. This is a read-only field + // that is auto-generated when the ad is inserted or updated. + SslRequired bool `json:"sslRequired,omitempty"` + + // StartTime: Date and time that this ad should start serving. If + // creating an ad, this field must be a time in the future. This is a + // required field on insertion. + StartTime string `json:"startTime,omitempty"` + + // SubaccountId: Subaccount ID of this ad. This is a read-only field + // that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TechnologyTargeting: Technology platform targeting information for + // this ad. Applicable when type is AD_SERVING_STANDARD_AD. + TechnologyTargeting *TechnologyTargeting `json:"technologyTargeting,omitempty"` + + // Type: Type of ad. This is a required field on insertion. Note that + // default ads (AD_SERVING_DEFAULT_AD) cannot be created directly (see + // Creative resource). + // + // Possible values: + // "AD_SERVING_CLICK_TRACKER" + // "AD_SERVING_DEFAULT_AD" + // "AD_SERVING_STANDARD_AD" + // "AD_SERVING_TRACKING" + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Ad) MarshalJSON() ([]byte, error) { + type noMethod Ad + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdsListResponse: Ad List Response +type AdsListResponse struct { + // Ads: Ad collection. + Ads []*Ad `json:"ads,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#adsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Ads") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdsListResponse) MarshalJSON() ([]byte, error) { + type noMethod AdsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Advertiser: Contains properties of a DCM advertiser. +type Advertiser struct { + // AccountId: Account ID of this advertiser.This is a read-only field + // that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserGroupId: ID of the advertiser group this advertiser belongs + // to. You can group advertisers for reporting purposes, allowing you to + // see aggregated information for all advertisers in each group. + AdvertiserGroupId int64 `json:"advertiserGroupId,omitempty,string"` + + // ClickThroughUrlSuffix: Suffix added to click-through URL of ad + // creative associations under this advertiser. Must be less than 129 + // characters long. + ClickThroughUrlSuffix string `json:"clickThroughUrlSuffix,omitempty"` + + // DefaultClickThroughEventTagId: ID of the click-through event tag to + // apply by default to the landing pages of this advertiser's campaigns. + DefaultClickThroughEventTagId int64 `json:"defaultClickThroughEventTagId,omitempty,string"` + + // DefaultEmail: Default email address used in sender field for tag + // emails. + DefaultEmail string `json:"defaultEmail,omitempty"` + + // FloodlightConfigurationId: Floodlight configuration ID of this + // advertiser. The floodlight configuration ID will be created + // automatically, so on insert this field should be left blank. This + // field can be set to another advertiser's floodlight configuration ID + // in order to share that advertiser's floodlight configuration with + // this advertiser, so long as: + // - This advertiser's original floodlight configuration is not already + // associated with floodlight activities or floodlight activity groups. + // + // - This advertiser's original floodlight configuration is not already + // shared with another advertiser. + FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"` + + // FloodlightConfigurationIdDimensionValue: Dimension value for the ID + // of the floodlight configuration. This is a read-only, auto-generated + // field. + FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"` + + // Id: ID of this advertiser. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this advertiser. This + // is a read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#advertiser". + Kind string `json:"kind,omitempty"` + + // Name: Name of this advertiser. This is a required field and must be + // less than 256 characters long and unique among advertisers of the + // same account. + Name string `json:"name,omitempty"` + + // Status: Status of this advertiser. + // + // Possible values: + // "APPROVED" + // "ON_HOLD" + Status string `json:"status,omitempty"` + + // SubaccountId: Subaccount ID of this advertiser.This is a read-only + // field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Advertiser) MarshalJSON() ([]byte, error) { + type noMethod Advertiser + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdvertiserGroup: Groups advertisers together so that reports can be +// generated for the entire group at once. +type AdvertiserGroup struct { + // AccountId: Account ID of this advertiser group. This is a read-only + // field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // Id: ID of this advertiser group. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#advertiserGroup". + Kind string `json:"kind,omitempty"` + + // Name: Name of this advertiser group. This is a required field and + // must be less than 256 characters long and unique among advertiser + // groups of the same account. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdvertiserGroup) MarshalJSON() ([]byte, error) { + type noMethod AdvertiserGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdvertiserGroupsListResponse: Advertiser Group List Response +type AdvertiserGroupsListResponse struct { + // AdvertiserGroups: Advertiser group collection. + AdvertiserGroups []*AdvertiserGroup `json:"advertiserGroups,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#advertiserGroupsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AdvertiserGroups") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdvertiserGroupsListResponse) MarshalJSON() ([]byte, error) { + type noMethod AdvertiserGroupsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdvertisersListResponse: Advertiser List Response +type AdvertisersListResponse struct { + // Advertisers: Advertiser collection. + Advertisers []*Advertiser `json:"advertisers,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#advertisersListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Advertisers") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdvertisersListResponse) MarshalJSON() ([]byte, error) { + type noMethod AdvertisersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AudienceSegment: Audience Segment. +type AudienceSegment struct { + // Allocation: Weight allocated to this segment. Must be between 1 and + // 1000. The weight assigned will be understood in proportion to the + // weights assigned to other segments in the same segment group. + Allocation int64 `json:"allocation,omitempty"` + + // Id: ID of this audience segment. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // Name: Name of this audience segment. This is a required field and + // must be less than 65 characters long. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Allocation") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AudienceSegment) MarshalJSON() ([]byte, error) { + type noMethod AudienceSegment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AudienceSegmentGroup: Audience Segment Group. +type AudienceSegmentGroup struct { + // AudienceSegments: Audience segments assigned to this group. The + // number of segments must be between 2 and 100. + AudienceSegments []*AudienceSegment `json:"audienceSegments,omitempty"` + + // Id: ID of this audience segment group. This is a read-only, + // auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Name: Name of this audience segment group. This is a required field + // and must be less than 65 characters long. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AudienceSegments") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AudienceSegmentGroup) MarshalJSON() ([]byte, error) { + type noMethod AudienceSegmentGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Browser: Contains information about a browser that can be targeted by +// ads. +type Browser struct { + // BrowserVersionId: ID referring to this grouping of browser and + // version numbers. This is the ID used for targeting. + BrowserVersionId int64 `json:"browserVersionId,omitempty,string"` + + // DartId: DART ID of this browser. This is the ID used when generating + // reports. + DartId int64 `json:"dartId,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#browser". + Kind string `json:"kind,omitempty"` + + // MajorVersion: Major version number (leftmost number) of this browser. + // For example, for Chrome 5.0.376.86 beta, this field should be set to + // 5. An asterisk (*) may be used to target any version number, and a + // question mark (?) may be used to target cases where the version + // number cannot be identified. For example, Chrome *.* targets any + // version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets + // Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad + // server knows the browser is Firefox but can't tell which version it + // is. + MajorVersion string `json:"majorVersion,omitempty"` + + // MinorVersion: Minor version number (number after first dot on left) + // of this browser. For example, for Chrome 5.0.375.86 beta, this field + // should be set to 0. An asterisk (*) may be used to target any version + // number, and a question mark (?) may be used to target cases where the + // version number cannot be identified. For example, Chrome *.* targets + // any version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets + // Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad + // server knows the browser is Firefox but can't tell which version it + // is. + MinorVersion string `json:"minorVersion,omitempty"` + + // Name: Name of this browser. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BrowserVersionId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Browser) MarshalJSON() ([]byte, error) { + type noMethod Browser + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BrowsersListResponse: Browser List Response +type BrowsersListResponse struct { + // Browsers: Browser collection. + Browsers []*Browser `json:"browsers,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#browsersListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Browsers") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BrowsersListResponse) MarshalJSON() ([]byte, error) { + type noMethod BrowsersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Campaign: Contains properties of a DCM campaign. +type Campaign struct { + // AccountId: Account ID of this campaign. This is a read-only field + // that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdditionalCreativeOptimizationConfigurations: Additional creative + // optimization configurations for the campaign. + AdditionalCreativeOptimizationConfigurations []*CreativeOptimizationConfiguration `json:"additionalCreativeOptimizationConfigurations,omitempty"` + + // AdvertiserGroupId: Advertiser group ID of the associated advertiser. + AdvertiserGroupId int64 `json:"advertiserGroupId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this campaign. This is a required + // field. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the advertiser ID of + // this campaign. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // Archived: Whether this campaign has been archived. + Archived bool `json:"archived,omitempty"` + + // AudienceSegmentGroups: Audience segment groups assigned to this + // campaign. Cannot have more than 300 segment groups. + AudienceSegmentGroups []*AudienceSegmentGroup `json:"audienceSegmentGroups,omitempty"` + + // BillingInvoiceCode: Billing invoice code included in the DCM client + // billing invoices associated with the campaign. + BillingInvoiceCode string `json:"billingInvoiceCode,omitempty"` + + // ClickThroughUrlSuffixProperties: Click-through URL suffix override + // properties for this campaign. + ClickThroughUrlSuffixProperties *ClickThroughUrlSuffixProperties `json:"clickThroughUrlSuffixProperties,omitempty"` + + // Comment: Arbitrary comments about this campaign. Must be less than + // 256 characters long. + Comment string `json:"comment,omitempty"` + + // ComscoreVceEnabled: Whether comScore vCE reports are enabled for this + // campaign. + ComscoreVceEnabled bool `json:"comscoreVceEnabled,omitempty"` + + // CreateInfo: Information about the creation of this campaign. This is + // a read-only field. + CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"` + + // CreativeGroupIds: List of creative group IDs that are assigned to the + // campaign. + CreativeGroupIds googleapi.Int64s `json:"creativeGroupIds,omitempty"` + + // CreativeOptimizationConfiguration: Creative optimization + // configuration for the campaign. + CreativeOptimizationConfiguration *CreativeOptimizationConfiguration `json:"creativeOptimizationConfiguration,omitempty"` + + // DefaultClickThroughEventTagProperties: Click-through event tag ID + // override properties for this campaign. + DefaultClickThroughEventTagProperties *DefaultClickThroughEventTagProperties `json:"defaultClickThroughEventTagProperties,omitempty"` + + // EndDate: Date on which the campaign will stop running. On insert, the + // end date must be today or a future date. The end date must be later + // than or be the same as the start date. If, for example, you set + // 6/25/2015 as both the start and end dates, the effective campaign run + // date is just that day only, 6/25/2015. The hours, minutes, and + // seconds of the end date should not be set, as doing so will result in + // an error. This is a required field. + EndDate string `json:"endDate,omitempty"` + + // EventTagOverrides: Overrides that can be used to activate or + // deactivate advertiser event tags. + EventTagOverrides []*EventTagOverride `json:"eventTagOverrides,omitempty"` + + // ExternalId: External ID for this campaign. + ExternalId string `json:"externalId,omitempty"` + + // Id: ID of this campaign. This is a read-only auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this campaign. This + // is a read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#campaign". + Kind string `json:"kind,omitempty"` + + // LastModifiedInfo: Information about the most recent modification of + // this campaign. This is a read-only field. + LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"` + + // LookbackConfiguration: Lookback window settings for the campaign. + LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"` + + // Name: Name of this campaign. This is a required field and must be + // less than 256 characters long and unique among campaigns of the same + // advertiser. + Name string `json:"name,omitempty"` + + // NielsenOcrEnabled: Whether Nielsen reports are enabled for this + // campaign. + NielsenOcrEnabled bool `json:"nielsenOcrEnabled,omitempty"` + + // StartDate: Date on which the campaign starts running. The start date + // can be any date. The hours, minutes, and seconds of the start date + // should not be set, as doing so will result in an error. This is a + // required field. + StartDate string `json:"startDate,omitempty"` + + // SubaccountId: Subaccount ID of this campaign. This is a read-only + // field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TraffickerEmails: Campaign trafficker contact emails. + TraffickerEmails []string `json:"traffickerEmails,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Campaign) MarshalJSON() ([]byte, error) { + type noMethod Campaign + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CampaignCreativeAssociation: Identifies a creative which has been +// associated with a given campaign. +type CampaignCreativeAssociation struct { + // CreativeId: ID of the creative associated with the campaign. This is + // a required field. + CreativeId int64 `json:"creativeId,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#campaignCreativeAssociation". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreativeId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CampaignCreativeAssociation) MarshalJSON() ([]byte, error) { + type noMethod CampaignCreativeAssociation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CampaignCreativeAssociationsListResponse: Campaign Creative +// Association List Response +type CampaignCreativeAssociationsListResponse struct { + // CampaignCreativeAssociations: Campaign creative association + // collection + CampaignCreativeAssociations []*CampaignCreativeAssociation `json:"campaignCreativeAssociations,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#campaignCreativeAssociationsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "CampaignCreativeAssociations") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CampaignCreativeAssociationsListResponse) MarshalJSON() ([]byte, error) { + type noMethod CampaignCreativeAssociationsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CampaignsListResponse: Campaign List Response +type CampaignsListResponse struct { + // Campaigns: Campaign collection. + Campaigns []*Campaign `json:"campaigns,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#campaignsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Campaigns") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CampaignsListResponse) MarshalJSON() ([]byte, error) { + type noMethod CampaignsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChangeLog: Describes a change that a user has made to a resource. +type ChangeLog struct { + // AccountId: Account ID of the modified object. + AccountId int64 `json:"accountId,omitempty,string"` + + // Action: Action which caused the change. + Action string `json:"action,omitempty"` + + // ChangeTime: Time when the object was modified. + ChangeTime string `json:"changeTime,omitempty"` + + // FieldName: Field name of the object which changed. + FieldName string `json:"fieldName,omitempty"` + + // Id: ID of this change log. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#changeLog". + Kind string `json:"kind,omitempty"` + + // NewValue: New value of the object field. + NewValue string `json:"newValue,omitempty"` + + // ObjectId: ID of the object of this change log. The object could be a + // campaign, placement, ad, or other type. + ObjectId int64 `json:"objectId,omitempty,string"` + + // ObjectType: Object type of the change log. + ObjectType string `json:"objectType,omitempty"` + + // OldValue: Old value of the object field. + OldValue string `json:"oldValue,omitempty"` + + // SubaccountId: Subaccount ID of the modified object. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TransactionId: Transaction ID of this change log. When a single API + // call results in many changes, each change will have a separate ID in + // the change log but will share the same transactionId. + TransactionId int64 `json:"transactionId,omitempty,string"` + + // UserProfileId: ID of the user who modified the object. + UserProfileId int64 `json:"userProfileId,omitempty,string"` + + // UserProfileName: User profile name of the user who modified the + // object. + UserProfileName string `json:"userProfileName,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChangeLog) MarshalJSON() ([]byte, error) { + type noMethod ChangeLog + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChangeLogsListResponse: Change Log List Response +type ChangeLogsListResponse struct { + // ChangeLogs: Change log collection. + ChangeLogs []*ChangeLog `json:"changeLogs,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#changeLogsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ChangeLogs") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChangeLogsListResponse) MarshalJSON() ([]byte, error) { + type noMethod ChangeLogsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CitiesListResponse: City List Response +type CitiesListResponse struct { + // Cities: City collection. + Cities []*City `json:"cities,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#citiesListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Cities") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CitiesListResponse) MarshalJSON() ([]byte, error) { + type noMethod CitiesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// City: Contains information about a city that can be targeted by ads. +type City struct { + // CountryCode: Country code of the country to which this city belongs. + CountryCode string `json:"countryCode,omitempty"` + + // CountryDartId: DART ID of the country to which this city belongs. + CountryDartId int64 `json:"countryDartId,omitempty,string"` + + // DartId: DART ID of this city. This is the ID used for targeting and + // generating reports. + DartId int64 `json:"dartId,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#city". + Kind string `json:"kind,omitempty"` + + // MetroCode: Metro region code of the metro region (DMA) to which this + // city belongs. + MetroCode string `json:"metroCode,omitempty"` + + // MetroDmaId: ID of the metro region (DMA) to which this city belongs. + MetroDmaId int64 `json:"metroDmaId,omitempty,string"` + + // Name: Name of this city. + Name string `json:"name,omitempty"` + + // RegionCode: Region code of the region to which this city belongs. + RegionCode string `json:"regionCode,omitempty"` + + // RegionDartId: DART ID of the region to which this city belongs. + RegionDartId int64 `json:"regionDartId,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "CountryCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *City) MarshalJSON() ([]byte, error) { + type noMethod City + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ClickTag: Creative Click Tag. +type ClickTag struct { + // EventName: Advertiser event name associated with the click tag. This + // field is used by ENHANCED_BANNER, ENHANCED_IMAGE, and HTML5_BANNER + // creatives. + EventName string `json:"eventName,omitempty"` + + // Name: Parameter name for the specified click tag. For ENHANCED_IMAGE + // creative assets, this field must match the value of the creative + // asset's creativeAssetId.name field. + Name string `json:"name,omitempty"` + + // Value: Parameter value for the specified click tag. This field + // contains a click-through url. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "EventName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ClickTag) MarshalJSON() ([]byte, error) { + type noMethod ClickTag + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ClickThroughUrl: Click-through URL +type ClickThroughUrl struct { + // CustomClickThroughUrl: Custom click-through URL. Applicable if the + // defaultLandingPage field is set to false and the landingPageId field + // is left unset. + CustomClickThroughUrl string `json:"customClickThroughUrl,omitempty"` + + // DefaultLandingPage: Whether the campaign default landing page is + // used. + DefaultLandingPage bool `json:"defaultLandingPage,omitempty"` + + // LandingPageId: ID of the landing page for the click-through URL. + // Applicable if the defaultLandingPage field is set to false. + LandingPageId int64 `json:"landingPageId,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. + // "CustomClickThroughUrl") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ClickThroughUrl) MarshalJSON() ([]byte, error) { + type noMethod ClickThroughUrl + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ClickThroughUrlSuffixProperties: Click Through URL Suffix settings. +type ClickThroughUrlSuffixProperties struct { + // ClickThroughUrlSuffix: Click-through URL suffix to apply to all ads + // in this entity's scope. Must be less than 128 characters long. + ClickThroughUrlSuffix string `json:"clickThroughUrlSuffix,omitempty"` + + // OverrideInheritedSuffix: Whether this entity should override the + // inherited click-through URL suffix with its own defined value. + OverrideInheritedSuffix bool `json:"overrideInheritedSuffix,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "ClickThroughUrlSuffix") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ClickThroughUrlSuffixProperties) MarshalJSON() ([]byte, error) { + type noMethod ClickThroughUrlSuffixProperties + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CompanionClickThroughOverride: Companion Click-through override. +type CompanionClickThroughOverride struct { + // ClickThroughUrl: Click-through URL of this companion click-through + // override. + ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"` + + // CreativeId: ID of the creative for this companion click-through + // override. + CreativeId int64 `json:"creativeId,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CompanionClickThroughOverride) MarshalJSON() ([]byte, error) { + type noMethod CompanionClickThroughOverride + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CompatibleFields: Represents a response to the queryCompatibleFields +// method. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "CrossDimensionReachReportCompatibleFields") to unconditionally + // include in API requests. By default, fields with empty values are + // omitted from API requests. However, any non-pointer, non-interface + // field appearing in ForceSendFields will be sent to the server + // regardless of whether the field is empty or not. This may be used to + // include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CompatibleFields) MarshalJSON() ([]byte, error) { + type noMethod CompatibleFields + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ConnectionType: Contains information about an internet connection +// type that can be targeted by ads. Clients can use the connection type +// to target mobile vs. broadband users. +type ConnectionType struct { + // Id: ID of this connection type. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#connectionType". + Kind string `json:"kind,omitempty"` + + // Name: Name of this connection type. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ConnectionType) MarshalJSON() ([]byte, error) { + type noMethod ConnectionType + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ConnectionTypesListResponse: Connection Type List Response +type ConnectionTypesListResponse struct { + // ConnectionTypes: Collection of connection types such as broadband and + // mobile. + ConnectionTypes []*ConnectionType `json:"connectionTypes,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#connectionTypesListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ConnectionTypes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ConnectionTypesListResponse) MarshalJSON() ([]byte, error) { + type noMethod ConnectionTypesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ContentCategoriesListResponse: Content Category List Response +type ContentCategoriesListResponse struct { + // ContentCategories: Content category collection. + ContentCategories []*ContentCategory `json:"contentCategories,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#contentCategoriesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ContentCategories") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ContentCategoriesListResponse) MarshalJSON() ([]byte, error) { + type noMethod ContentCategoriesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ContentCategory: Organizes placements according to the contents of +// their associated webpages. +type ContentCategory struct { + // AccountId: Account ID of this content category. This is a read-only + // field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // Description: Description of this content category. + Description string `json:"description,omitempty"` + + // Id: ID of this content category. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#contentCategory". + Kind string `json:"kind,omitempty"` + + // Name: Name of this content category. This is a required field and + // must be less than 256 characters long and unique among content + // categories of the same account. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ContentCategory) MarshalJSON() ([]byte, error) { + type noMethod ContentCategory + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CountriesListResponse: Country List Response +type CountriesListResponse struct { + // Countries: Country collection. + Countries []*Country `json:"countries,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#countriesListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Countries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CountriesListResponse) MarshalJSON() ([]byte, error) { + type noMethod CountriesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Country: Contains information about a country that can be targeted by +// ads. +type Country struct { + // CountryCode: Country code. + CountryCode string `json:"countryCode,omitempty"` + + // DartId: DART ID of this country. This is the ID used for targeting + // and generating reports. + DartId int64 `json:"dartId,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#country". + Kind string `json:"kind,omitempty"` + + // Name: Name of this country. + Name string `json:"name,omitempty"` + + // SslEnabled: Whether ad serving supports secure servers in this + // country. + SslEnabled bool `json:"sslEnabled,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CountryCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Country) MarshalJSON() ([]byte, error) { + type noMethod Country + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Creative: Contains properties of a Creative. +type Creative struct { + // AccountId: Account ID of this creative. This field, if left unset, + // will be auto-generated for both insert and update operations. + // Applicable to all creative types. + AccountId int64 `json:"accountId,omitempty,string"` + + // Active: Whether the creative is active. Applicable to all creative + // types. + Active bool `json:"active,omitempty"` + + // AdParameters: Ad parameters user for VPAID creative. This is a + // read-only field. Applicable to the following creative types: all + // VPAID. + AdParameters string `json:"adParameters,omitempty"` + + // AdTagKeys: Keywords for a Rich Media creative. Keywords let you + // customize the creative settings of a Rich Media ad running on your + // site without having to contact the advertiser. You can use keywords + // to dynamically change the look or functionality of a creative. + // Applicable to the following creative types: all RICH_MEDIA, and all + // VPAID. + AdTagKeys []string `json:"adTagKeys,omitempty"` + + // AdvertiserId: Advertiser ID of this creative. This is a required + // field. Applicable to all creative types. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AllowScriptAccess: Whether script access is allowed for this + // creative. This is a read-only and deprecated field which will + // automatically be set to true on update. Applicable to the following + // creative types: FLASH_INPAGE. + AllowScriptAccess bool `json:"allowScriptAccess,omitempty"` + + // Archived: Whether the creative is archived. Applicable to all + // creative types. + Archived bool `json:"archived,omitempty"` + + // ArtworkType: Type of artwork used for the creative. This is a + // read-only field. Applicable to the following creative types: all + // RICH_MEDIA, and all VPAID. + // + // Possible values: + // "ARTWORK_TYPE_FLASH" + // "ARTWORK_TYPE_HTML5" + // "ARTWORK_TYPE_MIXED" + ArtworkType string `json:"artworkType,omitempty"` + + // AuthoringTool: Authoring tool for HTML5 banner creatives. This is a + // read-only field. Applicable to the following creative types: + // HTML5_BANNER. + // + // Possible values: + // "NINJA" + // "SWIFFY" + AuthoringTool string `json:"authoringTool,omitempty"` + + // AutoAdvanceImages: Whether images are automatically advanced for + // enhanced image creatives. Applicable to the following creative types: + // ENHANCED_IMAGE. + AutoAdvanceImages bool `json:"auto_advance_images,omitempty"` + + // BackgroundColor: The 6-character HTML color code, beginning with #, + // for the background of the window area where the Flash file is + // displayed. Default is white. Applicable to the following creative + // types: FLASH_INPAGE. + BackgroundColor string `json:"backgroundColor,omitempty"` + + // BackupImageClickThroughUrl: Click-through URL for backup image. + // Applicable to the following creative types: ENHANCED_BANNER, + // FLASH_INPAGE, and HTML5_BANNER. + BackupImageClickThroughUrl string `json:"backupImageClickThroughUrl,omitempty"` + + // BackupImageFeatures: List of feature dependencies that will cause a + // backup image to be served if the browser that serves the ad does not + // support them. Feature dependencies are features that a browser must + // be able to support in order to render your HTML5 creative asset + // correctly. This field is initially auto-generated to contain all + // features detected by DCM for all the assets of this creative and can + // then be modified by the client. To reset this field, copy over all + // the creativeAssets' detected features. Applicable to the following + // creative types: ENHANCED_BANNER and HTML5_BANNER. + // + // Possible values: + // "APPLICATION_CACHE" + // "AUDIO" + // "CANVAS" + // "CANVAS_TEXT" + // "CSS_ANIMATIONS" + // "CSS_BACKGROUND_SIZE" + // "CSS_BORDER_IMAGE" + // "CSS_BORDER_RADIUS" + // "CSS_BOX_SHADOW" + // "CSS_COLUMNS" + // "CSS_FLEX_BOX" + // "CSS_FONT_FACE" + // "CSS_GENERATED_CONTENT" + // "CSS_GRADIENTS" + // "CSS_HSLA" + // "CSS_MULTIPLE_BGS" + // "CSS_OPACITY" + // "CSS_REFLECTIONS" + // "CSS_RGBA" + // "CSS_TEXT_SHADOW" + // "CSS_TRANSFORMS" + // "CSS_TRANSFORMS3D" + // "CSS_TRANSITIONS" + // "DRAG_AND_DROP" + // "GEO_LOCATION" + // "HASH_CHANGE" + // "HISTORY" + // "INDEXED_DB" + // "INLINE_SVG" + // "INPUT_ATTR_AUTOCOMPLETE" + // "INPUT_ATTR_AUTOFOCUS" + // "INPUT_ATTR_LIST" + // "INPUT_ATTR_MAX" + // "INPUT_ATTR_MIN" + // "INPUT_ATTR_MULTIPLE" + // "INPUT_ATTR_PATTERN" + // "INPUT_ATTR_PLACEHOLDER" + // "INPUT_ATTR_REQUIRED" + // "INPUT_ATTR_STEP" + // "INPUT_TYPE_COLOR" + // "INPUT_TYPE_DATE" + // "INPUT_TYPE_DATETIME" + // "INPUT_TYPE_DATETIME_LOCAL" + // "INPUT_TYPE_EMAIL" + // "INPUT_TYPE_MONTH" + // "INPUT_TYPE_NUMBER" + // "INPUT_TYPE_RANGE" + // "INPUT_TYPE_SEARCH" + // "INPUT_TYPE_TEL" + // "INPUT_TYPE_TIME" + // "INPUT_TYPE_URL" + // "INPUT_TYPE_WEEK" + // "LOCAL_STORAGE" + // "POST_MESSAGE" + // "SESSION_STORAGE" + // "SMIL" + // "SVG_CLIP_PATHS" + // "SVG_FE_IMAGE" + // "SVG_FILTERS" + // "SVG_HREF" + // "TOUCH" + // "VIDEO" + // "WEBGL" + // "WEB_SOCKETS" + // "WEB_SQL_DATABASE" + // "WEB_WORKERS" + BackupImageFeatures []string `json:"backupImageFeatures,omitempty"` + + // BackupImageReportingLabel: Reporting label used for HTML5 banner + // backup image. Applicable to the following creative types: + // ENHANCED_BANNER. + BackupImageReportingLabel string `json:"backupImageReportingLabel,omitempty"` + + // BackupImageTargetWindow: Target window for backup image. Applicable + // to the following creative types: ENHANCED_BANNER, FLASH_INPAGE, and + // HTML5_BANNER. + BackupImageTargetWindow *TargetWindow `json:"backupImageTargetWindow,omitempty"` + + // ClickTags: Click tags of the creative. For ENHANCED_BANNER, + // FLASH_INPAGE, and HTML5_BANNER creatives, this is a subset of + // detected click tags for the assets associated with this creative. + // After creating a flash asset, detected click tags will be returned in + // the creativeAssetMetadata. When inserting the creative, populate the + // creative clickTags field using the creativeAssetMetadata.clickTags + // field. For ENHANCED_IMAGE creatives, there should be exactly one + // entry in this list for each image creative asset. A click tag is + // matched with a corresponding creative asset by matching the + // clickTag.name field with the creativeAsset.assetIdentifier.name + // field. Applicable to the following creative types: ENHANCED_BANNER, + // ENHANCED_IMAGE, FLASH_INPAGE, HTML5_BANNER. + ClickTags []*ClickTag `json:"clickTags,omitempty"` + + // CommercialId: Industry standard ID assigned to creative for reach and + // frequency. Applicable to the following creative types: INSTREAM_VIDEO + // and all VPAID. + CommercialId string `json:"commercialId,omitempty"` + + // CompanionCreatives: List of companion creatives assigned to an + // in-Stream videocreative. Acceptable values include IDs of existing + // flash and image creatives. Applicable to the following creative + // types: INSTREAM_VIDEO and all VPAID. + CompanionCreatives googleapi.Int64s `json:"companionCreatives,omitempty"` + + // Compatibility: Compatibilities associated with this creative. This is + // a read-only field. WEB and WEB_INTERSTITIAL refer to rendering either + // on desktop or on mobile devices for regular or interstitial ads, + // respectively. APP and APP_INTERSTITIAL are for rendering in mobile + // apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads + // developed with the VAST standard. Applicable to all creative + // types. + // + // Acceptable values are: + // - "APP" + // - "APP_INTERSTITIAL" + // - "IN_STREAM_VIDEO" + // - "WEB" + // - "WEB_INTERSTITIAL" + // + // Possible values: + // "APP" + // "APP_INTERSTITIAL" + // "IN_STREAM_VIDEO" + // "WEB" + // "WEB_INTERSTITIAL" + Compatibility []string `json:"compatibility,omitempty"` + + // CounterCustomEvents: List of counter events configured for the + // creative. Applicable to the following creative types: all RICH_MEDIA, + // and all VPAID. + CounterCustomEvents []*CreativeCustomEvent `json:"counterCustomEvents,omitempty"` + + // CreativeAssets: Assets associated with a creative. Applicable to all + // but the following creative types: INTERNAL_REDIRECT, + // INTERSTITIAL_INTERNAL_REDIRECT, and REDIRECT + CreativeAssets []*CreativeAsset `json:"creativeAssets,omitempty"` + + // CreativeFieldAssignments: Creative field assignments for this + // creative. Applicable to all creative types. + CreativeFieldAssignments []*CreativeFieldAssignment `json:"creativeFieldAssignments,omitempty"` + + // CustomKeyValues: Custom key-values for a Rich Media creative. + // Key-values let you customize the creative settings of a Rich Media ad + // running on your site without having to contact the advertiser. You + // can use key-values to dynamically change the look or functionality of + // a creative. Applicable to the following creative types: all + // RICH_MEDIA, and all VPAID. + CustomKeyValues []string `json:"customKeyValues,omitempty"` + + // ExitCustomEvents: List of exit events configured for the creative. + // Applicable to the following creative types: all RICH_MEDIA, and all + // VPAID. + ExitCustomEvents []*CreativeCustomEvent `json:"exitCustomEvents,omitempty"` + + // FsCommand: OpenWindow FSCommand of this creative. This lets the SWF + // file communicate with either Flash Player or the program hosting + // Flash Player, such as a web browser. This is only triggered if + // allowScriptAccess field is true. Applicable to the following creative + // types: FLASH_INPAGE. + FsCommand *FsCommand `json:"fsCommand,omitempty"` + + // HtmlCode: HTML code for the creative. This is a required field when + // applicable. This field is ignored if htmlCodeLocked is false. + // Applicable to the following creative types: all CUSTOM, FLASH_INPAGE, + // and HTML5_BANNER, and all RICH_MEDIA. + HtmlCode string `json:"htmlCode,omitempty"` + + // HtmlCodeLocked: Whether HTML code is DCM-generated or manually + // entered. Set to true to ignore changes to htmlCode. Applicable to the + // following creative types: FLASH_INPAGE and HTML5_BANNER. + HtmlCodeLocked bool `json:"htmlCodeLocked,omitempty"` + + // Id: ID of this creative. This is a read-only, auto-generated field. + // Applicable to all creative types. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this creative. This + // is a read-only field. Applicable to all creative types. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creative". + Kind string `json:"kind,omitempty"` + + // LastModifiedInfo: Creative last modification information. This is a + // read-only field. Applicable to all creative types. + LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"` + + // LatestTraffickedCreativeId: Latest Studio trafficked creative ID + // associated with rich media and VPAID creatives. This is a read-only + // field. Applicable to the following creative types: all RICH_MEDIA, + // and all VPAID. + LatestTraffickedCreativeId int64 `json:"latestTraffickedCreativeId,omitempty,string"` + + // Name: Name of the creative. This is a required field and must be less + // than 256 characters long. Applicable to all creative types. + Name string `json:"name,omitempty"` + + // OverrideCss: Override CSS value for rich media creatives. Applicable + // to the following creative types: all RICH_MEDIA. + OverrideCss string `json:"overrideCss,omitempty"` + + // RedirectUrl: URL of hosted image or another ad tag. This is a + // required field when applicable. Applicable to the following creative + // types: INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and + // REDIRECT + RedirectUrl string `json:"redirectUrl,omitempty"` + + // RenderingId: ID of current rendering version. This is a read-only + // field. Applicable to all creative types. + RenderingId int64 `json:"renderingId,omitempty,string"` + + // RenderingIdDimensionValue: Dimension value for the rendering ID of + // this creative. This is a read-only field. Applicable to all creative + // types. + RenderingIdDimensionValue *DimensionValue `json:"renderingIdDimensionValue,omitempty"` + + // RequiredFlashPluginVersion: The minimum required Flash plugin version + // for this creative. For example, 11.2.202.235. This is a read-only + // field. Applicable to the following creative types: all RICH_MEDIA, + // and all VPAID. + RequiredFlashPluginVersion string `json:"requiredFlashPluginVersion,omitempty"` + + // RequiredFlashVersion: The internal Flash version for this creative as + // calculated by DoubleClick Studio. This is a read-only field. + // Applicable to the following creative types: FLASH_INPAGE, + // ENHANCED_BANNER, all RICH_MEDIA, and all VPAID. + RequiredFlashVersion int64 `json:"requiredFlashVersion,omitempty"` + + // Size: Size associated with this creative. When inserting or updating + // a creative either the size ID field or size width and height fields + // can be used. This is a required field when applicable; however for + // IMAGE and FLASH_INPAGE creatives, if left blank, this field will be + // automatically set using the actual size of the associated image + // assets. Applicable to the following creative types: ENHANCED_BANNER, + // ENHANCED_IMAGE, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all + // RICH_MEDIA. + Size *Size `json:"size,omitempty"` + + // Skippable: Whether the user can choose to skip the creative. + // Applicable to the following creative types: INSTREAM_VIDEO. + Skippable bool `json:"skippable,omitempty"` + + // SslCompliant: Whether the creative is SSL-compliant. This is a + // read-only field. Applicable to all creative types. + SslCompliant bool `json:"sslCompliant,omitempty"` + + // StudioAdvertiserId: Studio advertiser ID associated with rich media + // and VPAID creatives. This is a read-only field. Applicable to the + // following creative types: all RICH_MEDIA, and all VPAID. + StudioAdvertiserId int64 `json:"studioAdvertiserId,omitempty,string"` + + // StudioCreativeId: Studio creative ID associated with rich media and + // VPAID creatives. This is a read-only field. Applicable to the + // following creative types: all RICH_MEDIA, and all VPAID. + StudioCreativeId int64 `json:"studioCreativeId,omitempty,string"` + + // StudioTraffickedCreativeId: Studio trafficked creative ID associated + // with rich media and VPAID creatives. This is a read-only field. + // Applicable to the following creative types: all RICH_MEDIA, and all + // VPAID. + StudioTraffickedCreativeId int64 `json:"studioTraffickedCreativeId,omitempty,string"` + + // SubaccountId: Subaccount ID of this creative. This field, if left + // unset, will be auto-generated for both insert and update operations. + // Applicable to all creative types. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // ThirdPartyBackupImageImpressionsUrl: Third-party URL used to record + // backup image impressions. Applicable to the following creative types: + // all RICH_MEDIA + ThirdPartyBackupImageImpressionsUrl string `json:"thirdPartyBackupImageImpressionsUrl,omitempty"` + + // ThirdPartyRichMediaImpressionsUrl: Third-party URL used to record + // rich media impressions. Applicable to the following creative types: + // all RICH_MEDIA + ThirdPartyRichMediaImpressionsUrl string `json:"thirdPartyRichMediaImpressionsUrl,omitempty"` + + // ThirdPartyUrls: Third-party URLs for tracking in-stream video + // creative events. Applicable to the following creative types: + // INSTREAM_VIDEO and all VPAID. + ThirdPartyUrls []*ThirdPartyTrackingUrl `json:"thirdPartyUrls,omitempty"` + + // TimerCustomEvents: List of timer events configured for the creative. + // Applicable to the following creative types: all RICH_MEDIA, and all + // VPAID. + TimerCustomEvents []*CreativeCustomEvent `json:"timerCustomEvents,omitempty"` + + // TotalFileSize: Combined size of all creative assets. This is a + // read-only field. Applicable to the following creative types: all + // RICH_MEDIA, and all VPAID. + TotalFileSize int64 `json:"totalFileSize,omitempty,string"` + + // Type: Type of this creative.This is a required field. Applicable to + // all creative types. + // + // Possible values: + // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO" + // "CUSTOM_INPAGE" + // "CUSTOM_INTERSTITIAL" + // "ENHANCED_BANNER" + // "ENHANCED_IMAGE" + // "FLASH_INPAGE" + // "HTML5_BANNER" + // "IMAGE" + // "INSTREAM_VIDEO" + // "INTERNAL_REDIRECT" + // "INTERSTITIAL_INTERNAL_REDIRECT" + // "REDIRECT" + // "RICH_MEDIA_EXPANDING" + // "RICH_MEDIA_IM_EXPAND" + // "RICH_MEDIA_INPAGE" + // "RICH_MEDIA_INPAGE_FLOATING" + // "RICH_MEDIA_INTERSTITIAL_FLOAT" + // "RICH_MEDIA_MOBILE_IN_APP" + // "RICH_MEDIA_MULTI_FLOATING" + // "RICH_MEDIA_PEEL_DOWN" + // "TRACKING_TEXT" + // "VAST_REDIRECT" + // "VPAID_LINEAR" + // "VPAID_NON_LINEAR" + Type string `json:"type,omitempty"` + + // Version: The version number helps you keep track of multiple versions + // of your creative in your reports. The version number will always be + // auto-generated during insert operations to start at 1. For tracking + // creatives the version cannot be incremented and will always remain at + // 1. For all other creative types the version can be incremented only + // by 1 during update operations. In addition, the version will be + // automatically incremented by 1 when undergoing Rich Media creative + // merging. Applicable to all creative types. + Version int64 `json:"version,omitempty"` + + // VideoDescription: Description of the video ad. Applicable to the + // following creative types: INSTREAM_VIDEO and all VPAID. + VideoDescription string `json:"videoDescription,omitempty"` + + // VideoDuration: Creative video duration in seconds. This is a + // read-only field. Applicable to the following creative types: + // INSTREAM_VIDEO, all RICH_MEDIA, and all VPAID. + VideoDuration float64 `json:"videoDuration,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Creative) MarshalJSON() ([]byte, error) { + type noMethod Creative + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeAsset: Creative Asset. +type CreativeAsset struct { + // ActionScript3: Whether ActionScript3 is enabled for the flash asset. + // This is a read-only field. Applicable to the following creative + // types: FLASH_INPAGE and ENHANCED_BANNER. + ActionScript3 bool `json:"actionScript3,omitempty"` + + // Active: Whether the video asset is active. This is a read-only field + // for VPAID_NON_LINEAR assets. Applicable to the following creative + // types: INSTREAM_VIDEO and all VPAID. + Active bool `json:"active,omitempty"` + + // Alignment: Possible alignments for an asset. This is a read-only + // field. Applicable to the following creative types: + // RICH_MEDIA_MULTI_FLOATING. + // + // Possible values: + // "ALIGNMENT_BOTTOM" + // "ALIGNMENT_LEFT" + // "ALIGNMENT_RIGHT" + // "ALIGNMENT_TOP" + Alignment string `json:"alignment,omitempty"` + + // ArtworkType: Artwork type of rich media creative. This is a read-only + // field. Applicable to the following creative types: all RICH_MEDIA. + // + // Possible values: + // "ARTWORK_TYPE_FLASH" + // "ARTWORK_TYPE_HTML5" + // "ARTWORK_TYPE_MIXED" + ArtworkType string `json:"artworkType,omitempty"` + + // AssetIdentifier: Identifier of this asset. This is the same + // identifier returned during creative asset insert operation. This is a + // required field. Applicable to all but the following creative types: + // all REDIRECT and TRACKING_TEXT. + AssetIdentifier *CreativeAssetId `json:"assetIdentifier,omitempty"` + + // BackupImageExit: Exit event configured for the backup image. + // Applicable to the following creative types: all RICH_MEDIA. + BackupImageExit *CreativeCustomEvent `json:"backupImageExit,omitempty"` + + // BitRate: Detected bit-rate for video asset. This is a read-only + // field. Applicable to the following creative types: INSTREAM_VIDEO and + // all VPAID. + BitRate int64 `json:"bitRate,omitempty"` + + // ChildAssetType: Rich media child asset type. This is a read-only + // field. Applicable to the following creative types: all VPAID. + // + // Possible values: + // "CHILD_ASSET_TYPE_DATA" + // "CHILD_ASSET_TYPE_FLASH" + // "CHILD_ASSET_TYPE_IMAGE" + // "CHILD_ASSET_TYPE_VIDEO" + ChildAssetType string `json:"childAssetType,omitempty"` + + // CollapsedSize: Size of an asset when collapsed. This is a read-only + // field. Applicable to the following creative types: all RICH_MEDIA and + // all VPAID. Additionally, applicable to assets whose displayType is + // ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN. + CollapsedSize *Size `json:"collapsedSize,omitempty"` + + // CustomStartTimeValue: Custom start time in seconds for making the + // asset visible. Applicable to the following creative types: all + // RICH_MEDIA. + CustomStartTimeValue int64 `json:"customStartTimeValue,omitempty"` + + // DetectedFeatures: List of feature dependencies for the creative asset + // that are detected by DCM. Feature dependencies are features that a + // browser must be able to support in order to render your HTML5 + // creative correctly. This is a read-only, auto-generated field. + // Applicable to the following creative types: ENHANCED_BANNER and + // HTML5_BANNER. + // + // Possible values: + // "APPLICATION_CACHE" + // "AUDIO" + // "CANVAS" + // "CANVAS_TEXT" + // "CSS_ANIMATIONS" + // "CSS_BACKGROUND_SIZE" + // "CSS_BORDER_IMAGE" + // "CSS_BORDER_RADIUS" + // "CSS_BOX_SHADOW" + // "CSS_COLUMNS" + // "CSS_FLEX_BOX" + // "CSS_FONT_FACE" + // "CSS_GENERATED_CONTENT" + // "CSS_GRADIENTS" + // "CSS_HSLA" + // "CSS_MULTIPLE_BGS" + // "CSS_OPACITY" + // "CSS_REFLECTIONS" + // "CSS_RGBA" + // "CSS_TEXT_SHADOW" + // "CSS_TRANSFORMS" + // "CSS_TRANSFORMS3D" + // "CSS_TRANSITIONS" + // "DRAG_AND_DROP" + // "GEO_LOCATION" + // "HASH_CHANGE" + // "HISTORY" + // "INDEXED_DB" + // "INLINE_SVG" + // "INPUT_ATTR_AUTOCOMPLETE" + // "INPUT_ATTR_AUTOFOCUS" + // "INPUT_ATTR_LIST" + // "INPUT_ATTR_MAX" + // "INPUT_ATTR_MIN" + // "INPUT_ATTR_MULTIPLE" + // "INPUT_ATTR_PATTERN" + // "INPUT_ATTR_PLACEHOLDER" + // "INPUT_ATTR_REQUIRED" + // "INPUT_ATTR_STEP" + // "INPUT_TYPE_COLOR" + // "INPUT_TYPE_DATE" + // "INPUT_TYPE_DATETIME" + // "INPUT_TYPE_DATETIME_LOCAL" + // "INPUT_TYPE_EMAIL" + // "INPUT_TYPE_MONTH" + // "INPUT_TYPE_NUMBER" + // "INPUT_TYPE_RANGE" + // "INPUT_TYPE_SEARCH" + // "INPUT_TYPE_TEL" + // "INPUT_TYPE_TIME" + // "INPUT_TYPE_URL" + // "INPUT_TYPE_WEEK" + // "LOCAL_STORAGE" + // "POST_MESSAGE" + // "SESSION_STORAGE" + // "SMIL" + // "SVG_CLIP_PATHS" + // "SVG_FE_IMAGE" + // "SVG_FILTERS" + // "SVG_HREF" + // "TOUCH" + // "VIDEO" + // "WEBGL" + // "WEB_SOCKETS" + // "WEB_SQL_DATABASE" + // "WEB_WORKERS" + DetectedFeatures []string `json:"detectedFeatures,omitempty"` + + // DisplayType: Type of rich media asset. This is a read-only field. + // Applicable to the following creative types: all RICH_MEDIA. + // + // Possible values: + // "ASSET_DISPLAY_TYPE_EXPANDING" + // "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH" + // "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH_EXPANDING" + // "ASSET_DISPLAY_TYPE_FLOATING" + // "ASSET_DISPLAY_TYPE_INPAGE" + // "ASSET_DISPLAY_TYPE_OVERLAY" + // "ASSET_DISPLAY_TYPE_PEEL_DOWN" + // "ASSET_DISPLAY_TYPE_VPAID_LINEAR" + // "ASSET_DISPLAY_TYPE_VPAID_NON_LINEAR" + DisplayType string `json:"displayType,omitempty"` + + // Duration: Duration in seconds for which an asset will be displayed. + // Applicable to the following creative types: INSTREAM_VIDEO and + // VPAID_LINEAR. + Duration int64 `json:"duration,omitempty"` + + // DurationType: Duration type for which an asset will be displayed. + // Applicable to the following creative types: all RICH_MEDIA. + // + // Possible values: + // "ASSET_DURATION_TYPE_AUTO" + // "ASSET_DURATION_TYPE_CUSTOM" + // "ASSET_DURATION_TYPE_NONE" + DurationType string `json:"durationType,omitempty"` + + // ExpandedDimension: Detected expanded dimension for video asset. This + // is a read-only field. Applicable to the following creative types: + // INSTREAM_VIDEO and all VPAID. + ExpandedDimension *Size `json:"expandedDimension,omitempty"` + + // FileSize: File size associated with this creative asset. This is a + // read-only field. Applicable to all but the following creative types: + // all REDIRECT and TRACKING_TEXT. + FileSize int64 `json:"fileSize,omitempty,string"` + + // FlashVersion: Flash version of the asset. This is a read-only field. + // Applicable to the following creative types: FLASH_INPAGE, + // ENHANCED_BANNER, all RICH_MEDIA, and all VPAID. + FlashVersion int64 `json:"flashVersion,omitempty"` + + // HideFlashObjects: Whether to hide Flash objects flag for an asset. + // Applicable to the following creative types: all RICH_MEDIA. + HideFlashObjects bool `json:"hideFlashObjects,omitempty"` + + // HideSelectionBoxes: Whether to hide selection boxes flag for an + // asset. Applicable to the following creative types: all RICH_MEDIA. + HideSelectionBoxes bool `json:"hideSelectionBoxes,omitempty"` + + // HorizontallyLocked: Whether the asset is horizontally locked. This is + // a read-only field. Applicable to the following creative types: all + // RICH_MEDIA. + HorizontallyLocked bool `json:"horizontallyLocked,omitempty"` + + // Id: Numeric ID of this creative asset. This is a required field and + // should not be modified. Applicable to all but the following creative + // types: all REDIRECT and TRACKING_TEXT. + Id int64 `json:"id,omitempty,string"` + + // MimeType: Detected MIME type for video asset. This is a read-only + // field. Applicable to the following creative types: INSTREAM_VIDEO and + // all VPAID. + MimeType string `json:"mimeType,omitempty"` + + // Offset: Offset position for an asset in collapsed mode. This is a + // read-only field. Applicable to the following creative types: all + // RICH_MEDIA and all VPAID. Additionally, only applicable to assets + // whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or + // ASSET_DISPLAY_TYPE_PEEL_DOWN. + Offset *OffsetPosition `json:"offset,omitempty"` + + // OriginalBackup: Whether the backup asset is original or changed by + // the user in DCM. Applicable to the following creative types: all + // RICH_MEDIA. + OriginalBackup bool `json:"originalBackup,omitempty"` + + // Position: Offset position for an asset. Applicable to the following + // creative types: all RICH_MEDIA. + Position *OffsetPosition `json:"position,omitempty"` + + // PositionLeftUnit: Offset left unit for an asset. This is a read-only + // field. Applicable to the following creative types: all RICH_MEDIA. + // + // Possible values: + // "OFFSET_UNIT_PERCENT" + // "OFFSET_UNIT_PIXEL" + // "OFFSET_UNIT_PIXEL_FROM_CENTER" + PositionLeftUnit string `json:"positionLeftUnit,omitempty"` + + // PositionTopUnit: Offset top unit for an asset. This is a read-only + // field if the asset displayType is ASSET_DISPLAY_TYPE_OVERLAY. + // Applicable to the following creative types: all RICH_MEDIA. + // + // Possible values: + // "OFFSET_UNIT_PERCENT" + // "OFFSET_UNIT_PIXEL" + // "OFFSET_UNIT_PIXEL_FROM_CENTER" + PositionTopUnit string `json:"positionTopUnit,omitempty"` + + // ProgressiveServingUrl: Progressive URL for video asset. This is a + // read-only field. Applicable to the following creative types: + // INSTREAM_VIDEO and all VPAID. + ProgressiveServingUrl string `json:"progressiveServingUrl,omitempty"` + + // Pushdown: Whether the asset pushes down other content. Applicable to + // the following creative types: all RICH_MEDIA. Additionally, only + // applicable when the asset offsets are 0, the collapsedSize.width + // matches size.width, and the collapsedSize.height is less than + // size.height. + Pushdown bool `json:"pushdown,omitempty"` + + // PushdownDuration: Pushdown duration in seconds for an asset. Must be + // between 0 and 9.99. Applicable to the following creative types: all + // RICH_MEDIA.Additionally, only applicable when the asset pushdown + // field is true, the offsets are 0, the collapsedSize.width matches + // size.width, and the collapsedSize.height is less than size.height. + PushdownDuration float64 `json:"pushdownDuration,omitempty"` + + // Role: Role of the asset in relation to creative. Applicable to all + // but the following creative types: all REDIRECT and TRACKING_TEXT. + // This is a required field. + // PRIMARY applies to ENHANCED_BANNER, FLASH_INPAGE, HTML5_BANNER, + // IMAGE, IMAGE_GALLERY, all RICH_MEDIA (which may contain multiple + // primary assets), and all VPAID creatives. + // BACKUP_IMAGE applies to ENHANCED_BANNER, FLASH_INPAGE, HTML5_BANNER, + // all RICH_MEDIA, and all VPAID creatives. + // ADDITIONAL_IMAGE and ADDITIONAL_FLASH apply to FLASH_INPAGE + // creatives. + // OTHER refers to assets from sources other than DCM, such as Studio + // uploaded assets, applicable to all RICH_MEDIA and all VPAID + // creatives. + // PARENT_VIDEO refers to videos uploaded by the user in DCM and is + // applicable to INSTREAM_VIDEO and VPAID_LINEAR + // creatives. + // TRANSCODED_VIDEO refers to videos transcoded by DCM from PARENT_VIDEO + // assets and is applicable to INSTREAM_VIDEO and VPAID_LINEAR + // creatives. + // ALTERNATE_VIDEO refers to the DCM representation of child asset + // videos from Studio, and is applicable to VPAID_LINEAR creatives. + // These cannot be added or removed within DCM. + // For VPAID_LINEAR creatives, PARENT_VIDEO, TRANSCODED_VIDEO and + // ALTERNATE_VIDEO assets that are marked active serve as backup in case + // the VPAID creative cannot be served. Only PARENT_VIDEO assets can be + // added or removed for an INSTREAM_VIDEO or VPAID_LINEAR creative. + // + // Possible values: + // "ADDITIONAL_FLASH" + // "ADDITIONAL_IMAGE" + // "ALTERNATE_VIDEO" + // "BACKUP_IMAGE" + // "OTHER" + // "PARENT_VIDEO" + // "PRIMARY" + // "TRANSCODED_VIDEO" + Role string `json:"role,omitempty"` + + // Size: Size associated with this creative asset. This is a required + // field when applicable; however for IMAGE and FLASH_INPAGE creatives, + // if left blank, this field will be automatically set using the actual + // size of the associated image asset. Applicable to the following + // creative types: ENHANCED_BANNER, ENHANCED_IMAGE, FLASH_INPAGE, + // HTML5_BANNER, IMAGE, and all RICH_MEDIA. + Size *Size `json:"size,omitempty"` + + // SslCompliant: Whether the asset is SSL-compliant. This is a read-only + // field. Applicable to all but the following creative types: all + // REDIRECT and TRACKING_TEXT. + SslCompliant bool `json:"sslCompliant,omitempty"` + + // StartTimeType: Initial wait time type before making the asset + // visible. Applicable to the following creative types: all RICH_MEDIA. + // + // Possible values: + // "ASSET_START_TIME_TYPE_CUSTOM" + // "ASSET_START_TIME_TYPE_NONE" + StartTimeType string `json:"startTimeType,omitempty"` + + // StreamingServingUrl: Streaming URL for video asset. This is a + // read-only field. Applicable to the following creative types: + // INSTREAM_VIDEO and all VPAID. + StreamingServingUrl string `json:"streamingServingUrl,omitempty"` + + // Transparency: Whether the asset is transparent. Applicable to the + // following creative types: all RICH_MEDIA. Additionally, only + // applicable to HTML5 assets. + Transparency bool `json:"transparency,omitempty"` + + // VerticallyLocked: Whether the asset is vertically locked. This is a + // read-only field. Applicable to the following creative types: all + // RICH_MEDIA. + VerticallyLocked bool `json:"verticallyLocked,omitempty"` + + // VideoDuration: Detected video duration for video asset. This is a + // read-only field. Applicable to the following creative types: + // INSTREAM_VIDEO and all VPAID. + VideoDuration float64 `json:"videoDuration,omitempty"` + + // WindowMode: Window mode options for flash assets. Applicable to the + // following creative types: FLASH_INPAGE, RICH_MEDIA_EXPANDING, + // RICH_MEDIA_IM_EXPAND, RICH_MEDIA_INPAGE, and + // RICH_MEDIA_INPAGE_FLOATING. + // + // Possible values: + // "OPAQUE" + // "TRANSPARENT" + // "WINDOW" + WindowMode string `json:"windowMode,omitempty"` + + // ZIndex: zIndex value of an asset. This is a read-only field. + // Applicable to the following creative types: all + // RICH_MEDIA.Additionally, only applicable to assets whose displayType + // is NOT one of the following types: ASSET_DISPLAY_TYPE_INPAGE or + // ASSET_DISPLAY_TYPE_OVERLAY. + ZIndex int64 `json:"zIndex,omitempty"` + + // ZipFilename: File name of zip file. This is a read-only field. + // Applicable to the following creative types: HTML5_BANNER. + ZipFilename string `json:"zipFilename,omitempty"` + + // ZipFilesize: Size of zip file. This is a read-only field. Applicable + // to the following creative types: HTML5_BANNER. + ZipFilesize string `json:"zipFilesize,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ActionScript3") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeAsset) MarshalJSON() ([]byte, error) { + type noMethod CreativeAsset + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeAssetId: Creative Asset ID. +type CreativeAssetId struct { + // Name: Name of the creative asset. This is a required field while + // inserting an asset. After insertion, this assetIdentifier is used to + // identify the uploaded asset. Characters in the name must be + // alphanumeric or one of the following: ".-_ ". Spaces are allowed. + Name string `json:"name,omitempty"` + + // Type: Type of asset to upload. This is a required field. IMAGE is + // solely used for IMAGE creatives. Other image assets should use + // HTML_IMAGE. + // + // Possible values: + // "FLASH" + // "HTML" + // "HTML_IMAGE" + // "IMAGE" + // "VIDEO" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeAssetId) MarshalJSON() ([]byte, error) { + type noMethod CreativeAssetId + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeAssetMetadata: CreativeAssets contains properties of a +// creative asset file which will be uploaded or has already been +// uploaded. Refer to the creative sample code for how to upload assets +// and insert a creative. +type CreativeAssetMetadata struct { + // AssetIdentifier: ID of the creative asset. This is a required field. + AssetIdentifier *CreativeAssetId `json:"assetIdentifier,omitempty"` + + // ClickTags: List of detected click tags for assets. This is a + // read-only auto-generated field. + ClickTags []*ClickTag `json:"clickTags,omitempty"` + + // DetectedFeatures: List of feature dependencies for the creative asset + // that are detected by DCM. Feature dependencies are features that a + // browser must be able to support in order to render your HTML5 + // creative correctly. This is a read-only, auto-generated field. + // + // Possible values: + // "APPLICATION_CACHE" + // "AUDIO" + // "CANVAS" + // "CANVAS_TEXT" + // "CSS_ANIMATIONS" + // "CSS_BACKGROUND_SIZE" + // "CSS_BORDER_IMAGE" + // "CSS_BORDER_RADIUS" + // "CSS_BOX_SHADOW" + // "CSS_COLUMNS" + // "CSS_FLEX_BOX" + // "CSS_FONT_FACE" + // "CSS_GENERATED_CONTENT" + // "CSS_GRADIENTS" + // "CSS_HSLA" + // "CSS_MULTIPLE_BGS" + // "CSS_OPACITY" + // "CSS_REFLECTIONS" + // "CSS_RGBA" + // "CSS_TEXT_SHADOW" + // "CSS_TRANSFORMS" + // "CSS_TRANSFORMS3D" + // "CSS_TRANSITIONS" + // "DRAG_AND_DROP" + // "GEO_LOCATION" + // "HASH_CHANGE" + // "HISTORY" + // "INDEXED_DB" + // "INLINE_SVG" + // "INPUT_ATTR_AUTOCOMPLETE" + // "INPUT_ATTR_AUTOFOCUS" + // "INPUT_ATTR_LIST" + // "INPUT_ATTR_MAX" + // "INPUT_ATTR_MIN" + // "INPUT_ATTR_MULTIPLE" + // "INPUT_ATTR_PATTERN" + // "INPUT_ATTR_PLACEHOLDER" + // "INPUT_ATTR_REQUIRED" + // "INPUT_ATTR_STEP" + // "INPUT_TYPE_COLOR" + // "INPUT_TYPE_DATE" + // "INPUT_TYPE_DATETIME" + // "INPUT_TYPE_DATETIME_LOCAL" + // "INPUT_TYPE_EMAIL" + // "INPUT_TYPE_MONTH" + // "INPUT_TYPE_NUMBER" + // "INPUT_TYPE_RANGE" + // "INPUT_TYPE_SEARCH" + // "INPUT_TYPE_TEL" + // "INPUT_TYPE_TIME" + // "INPUT_TYPE_URL" + // "INPUT_TYPE_WEEK" + // "LOCAL_STORAGE" + // "POST_MESSAGE" + // "SESSION_STORAGE" + // "SMIL" + // "SVG_CLIP_PATHS" + // "SVG_FE_IMAGE" + // "SVG_FILTERS" + // "SVG_HREF" + // "TOUCH" + // "VIDEO" + // "WEBGL" + // "WEB_SOCKETS" + // "WEB_SQL_DATABASE" + // "WEB_WORKERS" + DetectedFeatures []string `json:"detectedFeatures,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creativeAssetMetadata". + Kind string `json:"kind,omitempty"` + + // WarnedValidationRules: Rules validated during code generation that + // generated a warning. This is a read-only, auto-generated + // field. + // + // Possible values are: + // - "CLICK_TAG_NON_TOP_LEVEL" + // - "CLICK_TAG_MISSING" + // - "CLICK_TAG_MORE_THAN_ONE" + // - "CLICK_TAG_INVALID" + // - "ORPHANED_ASSET" + // - "PRIMARY_HTML_MISSING" + // - "EXTERNAL_FILE_REFERENCED" + // - "MRAID_REFERENCED" + // - "ADMOB_REFERENCED" + // - "FILE_TYPE_INVALID" + // - "ZIP_INVALID" + // - "LINKED_FILE_NOT_FOUND" + // - "MAX_FLASH_VERSION_11" + // - "NOT_SSL_COMPLIANT" + // - "FILE_DETAIL_EMPTY" + // - "ASSET_INVALID" + // - "GWD_PROPERTIES_INVALID" + // - "ENABLER_UNSUPPORTED_METHOD_DCM" + // - "ASSET_FORMAT_UNSUPPORTED_DCM" + // - "COMPONENT_UNSUPPORTED_DCM" + // - "HTML5_FEATURE_UNSUPPORTED' " + // + // Possible values: + // "ADMOB_REFERENCED" + // "ASSET_FORMAT_UNSUPPORTED_DCM" + // "ASSET_INVALID" + // "CLICK_TAG_INVALID" + // "CLICK_TAG_MISSING" + // "CLICK_TAG_MORE_THAN_ONE" + // "CLICK_TAG_NON_TOP_LEVEL" + // "COMPONENT_UNSUPPORTED_DCM" + // "ENABLER_UNSUPPORTED_METHOD_DCM" + // "EXTERNAL_FILE_REFERENCED" + // "FILE_DETAIL_EMPTY" + // "FILE_TYPE_INVALID" + // "GWD_PROPERTIES_INVALID" + // "HTML5_FEATURE_UNSUPPORTED" + // "LINKED_FILE_NOT_FOUND" + // "MAX_FLASH_VERSION_11" + // "MRAID_REFERENCED" + // "NOT_SSL_COMPLIANT" + // "ORPHANED_ASSET" + // "PRIMARY_HTML_MISSING" + // "ZIP_INVALID" + WarnedValidationRules []string `json:"warnedValidationRules,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AssetIdentifier") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeAssetMetadata) MarshalJSON() ([]byte, error) { + type noMethod CreativeAssetMetadata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeAssignment: Creative Assignment. +type CreativeAssignment struct { + // Active: Whether this creative assignment is active. When true, the + // creative will be included in the ad's rotation. + Active bool `json:"active,omitempty"` + + // ApplyEventTags: Whether applicable event tags should fire when this + // creative assignment is rendered. If this value is unset when the ad + // is inserted or updated, it will default to true for all creative + // types EXCEPT for INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, + // and INSTREAM_VIDEO. + ApplyEventTags bool `json:"applyEventTags,omitempty"` + + // ClickThroughUrl: Click-through URL of the creative assignment. + ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"` + + // CompanionCreativeOverrides: Companion creative overrides for this + // creative assignment. Applicable to video ads. + CompanionCreativeOverrides []*CompanionClickThroughOverride `json:"companionCreativeOverrides,omitempty"` + + // CreativeGroupAssignments: Creative group assignments for this + // creative assignment. Only one assignment per creative group number is + // allowed for a maximum of two assignments. + CreativeGroupAssignments []*CreativeGroupAssignment `json:"creativeGroupAssignments,omitempty"` + + // CreativeId: ID of the creative to be assigned. This is a required + // field. + CreativeId int64 `json:"creativeId,omitempty,string"` + + // CreativeIdDimensionValue: Dimension value for the ID of the creative. + // This is a read-only, auto-generated field. + CreativeIdDimensionValue *DimensionValue `json:"creativeIdDimensionValue,omitempty"` + + // EndTime: Date and time that the assigned creative should stop + // serving. Must be later than the start time. + EndTime string `json:"endTime,omitempty"` + + // RichMediaExitOverrides: Rich media exit overrides for this creative + // assignment. + // Applicable when the creative type is any of the following: + // - RICH_MEDIA_INPAGE + // - RICH_MEDIA_INPAGE_FLOATING + // - RICH_MEDIA_IM_EXPAND + // - RICH_MEDIA_EXPANDING + // - RICH_MEDIA_INTERSTITIAL_FLOAT + // - RICH_MEDIA_MOBILE_IN_APP + // - RICH_MEDIA_MULTI_FLOATING + // - RICH_MEDIA_PEEL_DOWN + // - ADVANCED_BANNER + // - VPAID_LINEAR + // - VPAID_NON_LINEAR + RichMediaExitOverrides []*RichMediaExitOverride `json:"richMediaExitOverrides,omitempty"` + + // Sequence: Sequence number of the creative assignment, applicable when + // the rotation type is CREATIVE_ROTATION_TYPE_SEQUENTIAL. + Sequence int64 `json:"sequence,omitempty"` + + // SslCompliant: Whether the creative to be assigned is SSL-compliant. + // This is a read-only field that is auto-generated when the ad is + // inserted or updated. + SslCompliant bool `json:"sslCompliant,omitempty"` + + // StartTime: Date and time that the assigned creative should start + // serving. + StartTime string `json:"startTime,omitempty"` + + // Weight: Weight of the creative assignment, applicable when the + // rotation type is CREATIVE_ROTATION_TYPE_RANDOM. + Weight int64 `json:"weight,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Active") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeAssignment) MarshalJSON() ([]byte, error) { + type noMethod CreativeAssignment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeCustomEvent: Creative Custom Event. +type CreativeCustomEvent struct { + // Active: Whether the event is active. + Active bool `json:"active,omitempty"` + + // AdvertiserCustomEventName: User-entered name for the event. + AdvertiserCustomEventName string `json:"advertiserCustomEventName,omitempty"` + + // AdvertiserCustomEventType: Type of the event. This is a read-only + // field. + // + // Possible values: + // "ADVERTISER_EVENT_COUNTER" + // "ADVERTISER_EVENT_EXIT" + // "ADVERTISER_EVENT_TIMER" + AdvertiserCustomEventType string `json:"advertiserCustomEventType,omitempty"` + + // ArtworkLabel: Artwork label column, used to link events in DCM back + // to events in Studio. This is a required field and should not be + // modified after insertion. + ArtworkLabel string `json:"artworkLabel,omitempty"` + + // ArtworkType: Artwork type used by the creative.This is a read-only + // field. + // + // Possible values: + // "ARTWORK_TYPE_FLASH" + // "ARTWORK_TYPE_HTML5" + // "ARTWORK_TYPE_MIXED" + ArtworkType string `json:"artworkType,omitempty"` + + // ExitUrl: Exit URL of the event. This field is used only for exit + // events. + ExitUrl string `json:"exitUrl,omitempty"` + + // Id: ID of this event. This is a required field and should not be + // modified after insertion. + Id int64 `json:"id,omitempty,string"` + + // PopupWindowProperties: Properties for rich media popup windows. This + // field is used only for exit events. + PopupWindowProperties *PopupWindowProperties `json:"popupWindowProperties,omitempty"` + + // TargetType: Target type used by the event. + // + // Possible values: + // "TARGET_BLANK" + // "TARGET_PARENT" + // "TARGET_POPUP" + // "TARGET_SELF" + // "TARGET_TOP" + TargetType string `json:"targetType,omitempty"` + + // VideoReportingId: Reporting ID, used to differentiate multiple videos + // in a single creative. + VideoReportingId string `json:"videoReportingId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Active") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeCustomEvent) MarshalJSON() ([]byte, error) { + type noMethod CreativeCustomEvent + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeField: Contains properties of a creative field. +type CreativeField struct { + // AccountId: Account ID of this creative field. This is a read-only + // field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this creative field. This is a + // required field on insertion. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // Id: ID of this creative field. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creativeField". + Kind string `json:"kind,omitempty"` + + // Name: Name of this creative field. This is a required field and must + // be less than 256 characters long and unique among creative fields of + // the same advertiser. + Name string `json:"name,omitempty"` + + // SubaccountId: Subaccount ID of this creative field. This is a + // read-only field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeField) MarshalJSON() ([]byte, error) { + type noMethod CreativeField + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeFieldAssignment: Creative Field Assignment. +type CreativeFieldAssignment struct { + // CreativeFieldId: ID of the creative field. + CreativeFieldId int64 `json:"creativeFieldId,omitempty,string"` + + // CreativeFieldValueId: ID of the creative field value. + CreativeFieldValueId int64 `json:"creativeFieldValueId,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "CreativeFieldId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeFieldAssignment) MarshalJSON() ([]byte, error) { + type noMethod CreativeFieldAssignment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeFieldValue: Contains properties of a creative field value. +type CreativeFieldValue struct { + // Id: ID of this creative field value. This is a read-only, + // auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creativeFieldValue". + Kind string `json:"kind,omitempty"` + + // Value: Value of this creative field value. It needs to be less than + // 256 characters in length and unique per creative field. + Value string `json:"value,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeFieldValue) MarshalJSON() ([]byte, error) { + type noMethod CreativeFieldValue + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeFieldValuesListResponse: Creative Field Value List Response +type CreativeFieldValuesListResponse struct { + // CreativeFieldValues: Creative field value collection. + CreativeFieldValues []*CreativeFieldValue `json:"creativeFieldValues,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creativeFieldValuesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreativeFieldValues") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeFieldValuesListResponse) MarshalJSON() ([]byte, error) { + type noMethod CreativeFieldValuesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeFieldsListResponse: Creative Field List Response +type CreativeFieldsListResponse struct { + // CreativeFields: Creative field collection. + CreativeFields []*CreativeField `json:"creativeFields,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creativeFieldsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreativeFields") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeFieldsListResponse) MarshalJSON() ([]byte, error) { + type noMethod CreativeFieldsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeGroup: Contains properties of a creative group. +type CreativeGroup struct { + // AccountId: Account ID of this creative group. This is a read-only + // field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this creative group. This is a + // required field on insertion. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // GroupNumber: Subgroup of the creative group. Assign your creative + // groups to one of the following subgroups in order to filter or manage + // them more easily. This field is required on insertion and is + // read-only after insertion. + // Acceptable values are: + // - 1 + // - 2 + GroupNumber int64 `json:"groupNumber,omitempty"` + + // Id: ID of this creative group. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creativeGroup". + Kind string `json:"kind,omitempty"` + + // Name: Name of this creative group. This is a required field and must + // be less than 256 characters long and unique among creative groups of + // the same advertiser. + Name string `json:"name,omitempty"` + + // SubaccountId: Subaccount ID of this creative group. This is a + // read-only field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeGroup) MarshalJSON() ([]byte, error) { + type noMethod CreativeGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeGroupAssignment: Creative Group Assignment. +type CreativeGroupAssignment struct { + // CreativeGroupId: ID of the creative group to be assigned. + CreativeGroupId int64 `json:"creativeGroupId,omitempty,string"` + + // CreativeGroupNumber: Creative group number of the creative group + // assignment. + // + // Possible values: + // "CREATIVE_GROUP_ONE" + // "CREATIVE_GROUP_TWO" + CreativeGroupNumber string `json:"creativeGroupNumber,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreativeGroupId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeGroupAssignment) MarshalJSON() ([]byte, error) { + type noMethod CreativeGroupAssignment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeGroupsListResponse: Creative Group List Response +type CreativeGroupsListResponse struct { + // CreativeGroups: Creative group collection. + CreativeGroups []*CreativeGroup `json:"creativeGroups,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creativeGroupsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreativeGroups") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeGroupsListResponse) MarshalJSON() ([]byte, error) { + type noMethod CreativeGroupsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeOptimizationConfiguration: Creative optimization settings. +type CreativeOptimizationConfiguration struct { + // Id: ID of this creative optimization config. This field is + // auto-generated when the campaign is inserted or updated. It can be + // null for existing campaigns. + Id int64 `json:"id,omitempty,string"` + + // Name: Name of this creative optimization config. This is a required + // field and must be less than 129 characters long. + Name string `json:"name,omitempty"` + + // OptimizationActivitys: List of optimization activities associated + // with this configuration. + OptimizationActivitys []*OptimizationActivity `json:"optimizationActivitys,omitempty"` + + // OptimizationModel: Optimization model for this configuration. + // + // Possible values: + // "CLICK" + // "POST_CLICK" + // "POST_CLICK_AND_IMPRESSION" + // "POST_IMPRESSION" + OptimizationModel string `json:"optimizationModel,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeOptimizationConfiguration) MarshalJSON() ([]byte, error) { + type noMethod CreativeOptimizationConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeRotation: Creative Rotation. +type CreativeRotation struct { + // CreativeAssignments: Creative assignments in this creative rotation. + CreativeAssignments []*CreativeAssignment `json:"creativeAssignments,omitempty"` + + // CreativeOptimizationConfigurationId: Creative optimization + // configuration that is used by this ad. It should refer to one of the + // existing optimization configurations in the ad's campaign. If it is + // unset or set to 0, then the campaign's default optimization + // configuration will be used for this ad. + CreativeOptimizationConfigurationId int64 `json:"creativeOptimizationConfigurationId,omitempty,string"` + + // Type: Type of creative rotation. Can be used to specify whether to + // use sequential or random rotation. + // + // Possible values: + // "CREATIVE_ROTATION_TYPE_RANDOM" + // "CREATIVE_ROTATION_TYPE_SEQUENTIAL" + Type string `json:"type,omitempty"` + + // WeightCalculationStrategy: Strategy for calculating weights. Used + // with CREATIVE_ROTATION_TYPE_RANDOM. + // + // Possible values: + // "WEIGHT_STRATEGY_CUSTOM" + // "WEIGHT_STRATEGY_EQUAL" + // "WEIGHT_STRATEGY_HIGHEST_CTR" + // "WEIGHT_STRATEGY_OPTIMIZED" + WeightCalculationStrategy string `json:"weightCalculationStrategy,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreativeAssignments") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeRotation) MarshalJSON() ([]byte, error) { + type noMethod CreativeRotation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeSettings: Creative Settings +type CreativeSettings struct { + // IFrameFooter: Header text for iFrames for this site. Must be less + // than or equal to 2000 characters long. + IFrameFooter string `json:"iFrameFooter,omitempty"` + + // IFrameHeader: Header text for iFrames for this site. Must be less + // than or equal to 2000 characters long. + IFrameHeader string `json:"iFrameHeader,omitempty"` + + // ForceSendFields is a list of field names (e.g. "IFrameFooter") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeSettings) MarshalJSON() ([]byte, error) { + type noMethod CreativeSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativesListResponse: Creative List Response +type CreativesListResponse struct { + // Creatives: Creative collection. + Creatives []*Creative `json:"creatives,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creativesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Creatives") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativesListResponse) MarshalJSON() ([]byte, error) { + type noMethod CreativesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CrossDimensionReachReportCompatibleFields: Represents fields that are +// compatible to be selected for a report of type +// "CROSS_DIMENSION_REACH". +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"` + + // ForceSendFields is a list of field names (e.g. "Breakdown") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CrossDimensionReachReportCompatibleFields) MarshalJSON() ([]byte, error) { + type noMethod CrossDimensionReachReportCompatibleFields + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomRichMediaEvents: Represents a Custom Rich Media Events group. +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"` + + // ForceSendFields is a list of field names (e.g. "FilteredEventIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomRichMediaEvents) MarshalJSON() ([]byte, error) { + type noMethod CustomRichMediaEvents + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DateRange: Represents a date range. +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. + // + // Possible values: + // "LAST_24_MONTHS" + // "LAST_30_DAYS" + // "LAST_365_DAYS" + // "LAST_7_DAYS" + // "LAST_90_DAYS" + // "MONTH_TO_DATE" + // "PREVIOUS_MONTH" + // "PREVIOUS_QUARTER" + // "PREVIOUS_WEEK" + // "PREVIOUS_YEAR" + // "QUARTER_TO_DATE" + // "TODAY" + // "WEEK_TO_DATE" + // "YEAR_TO_DATE" + // "YESTERDAY" + 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"` + + // ForceSendFields is a list of field names (e.g. "EndDate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DateRange) MarshalJSON() ([]byte, error) { + type noMethod DateRange + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DayPartTargeting: Day Part Targeting. +type DayPartTargeting struct { + // DaysOfWeek: Days of the week when the ad will serve. + // + // Acceptable values are: + // - "SUNDAY" + // - "MONDAY" + // - "TUESDAY" + // - "WEDNESDAY" + // - "THURSDAY" + // - "FRIDAY" + // - "SATURDAY" + // + // Possible values: + // "FRIDAY" + // "MONDAY" + // "SATURDAY" + // "SUNDAY" + // "THURSDAY" + // "TUESDAY" + // "WEDNESDAY" + DaysOfWeek []string `json:"daysOfWeek,omitempty"` + + // HoursOfDay: Hours of the day when the ad will serve. Must be an + // integer between 0 and 23 (inclusive), where 0 is midnight to 1 AM, + // and 23 is 11 PM to midnight. Can be specified with days of week, in + // which case the ad would serve during these hours on the specified + // days. For example, if Monday, Wednesday, Friday are the days of week + // specified and 9-10am, 3-5pm (hours 9, 15, and 16) is specified, the + // ad would serve Monday, Wednesdays, and Fridays at 9-10am and 3-5pm. + HoursOfDay []int64 `json:"hoursOfDay,omitempty"` + + // UserLocalTime: Whether or not to use the user's local time. If false, + // the America/New York time zone applies. + UserLocalTime bool `json:"userLocalTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DaysOfWeek") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DayPartTargeting) MarshalJSON() ([]byte, error) { + type noMethod DayPartTargeting + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DefaultClickThroughEventTagProperties: Properties of inheriting and +// overriding the default click-through event tag. A campaign may +// override the event tag defined at the advertiser level, and an ad may +// also override the campaign's setting further. +type DefaultClickThroughEventTagProperties struct { + // DefaultClickThroughEventTagId: ID of the click-through event tag to + // apply to all ads in this entity's scope. + DefaultClickThroughEventTagId int64 `json:"defaultClickThroughEventTagId,omitempty,string"` + + // OverrideInheritedEventTag: Whether this entity should override the + // inherited default click-through event tag with its own defined value. + OverrideInheritedEventTag bool `json:"overrideInheritedEventTag,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "DefaultClickThroughEventTagId") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DefaultClickThroughEventTagProperties) MarshalJSON() ([]byte, error) { + type noMethod DefaultClickThroughEventTagProperties + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DeliverySchedule: Delivery Schedule. +type DeliverySchedule struct { + // FrequencyCap: Limit on the number of times an individual user can be + // served the ad within a specified period of time. + FrequencyCap *FrequencyCap `json:"frequencyCap,omitempty"` + + // HardCutoff: Whether or not hard cutoff is enabled. If true, the ad + // will not serve after the end date and time. Otherwise the ad will + // continue to be served until it has reached its delivery goals. + HardCutoff bool `json:"hardCutoff,omitempty"` + + // ImpressionRatio: Impression ratio for this ad. This ratio determines + // how often each ad is served relative to the others. For example, if + // ad A has an impression ratio of 1 and ad B has an impression ratio of + // 3, then DCM will serve ad B three times as often as ad A. Must be + // between 1 and 10. + ImpressionRatio int64 `json:"impressionRatio,omitempty,string"` + + // Priority: Serving priority of an ad, with respect to other ads. The + // lower the priority number, the greater the priority with which it is + // served. + // + // Possible values: + // "AD_PRIORITY_01" + // "AD_PRIORITY_02" + // "AD_PRIORITY_03" + // "AD_PRIORITY_04" + // "AD_PRIORITY_05" + // "AD_PRIORITY_06" + // "AD_PRIORITY_07" + // "AD_PRIORITY_08" + // "AD_PRIORITY_09" + // "AD_PRIORITY_10" + // "AD_PRIORITY_11" + // "AD_PRIORITY_12" + // "AD_PRIORITY_13" + // "AD_PRIORITY_14" + // "AD_PRIORITY_15" + // "AD_PRIORITY_16" + Priority string `json:"priority,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FrequencyCap") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeliverySchedule) MarshalJSON() ([]byte, error) { + type noMethod DeliverySchedule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DfpSettings: DFP Settings +type DfpSettings struct { + // DfpNetworkCode: DFP network code for this directory site. + DfpNetworkCode string `json:"dfp_network_code,omitempty"` + + // DfpNetworkName: DFP network name for this directory site. + DfpNetworkName string `json:"dfp_network_name,omitempty"` + + // ProgrammaticPlacementAccepted: Whether this directory site accepts + // programmatic placements. + ProgrammaticPlacementAccepted bool `json:"programmaticPlacementAccepted,omitempty"` + + // PubPaidPlacementAccepted: Whether this directory site accepts + // publisher-paid tags. + PubPaidPlacementAccepted bool `json:"pubPaidPlacementAccepted,omitempty"` + + // PublisherPortalOnly: Whether this directory site is available only + // via DoubleClick Publisher Portal. + PublisherPortalOnly bool `json:"publisherPortalOnly,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DfpNetworkCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DfpSettings) MarshalJSON() ([]byte, error) { + type noMethod DfpSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Dimension: Represents a dimension. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Dimension) MarshalJSON() ([]byte, error) { + type noMethod Dimension + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionFilter: Represents a dimension filter. +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionFilter) MarshalJSON() ([]byte, error) { + type noMethod DimensionFilter + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionValue: Represents a DimensionValue resource. +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. If not specified, defaults to EXACT. If set to + // WILDCARD_EXPRESSION, '*' is allowed as a placeholder for variable + // length character sequences, and it can be escaped with a backslash. + // Note, only paid search dimensions ('dfa:paidSearch*') allow a + // matchType other than EXACT. + // + // Possible values: + // "BEGINS_WITH" + // "CONTAINS" + // "EXACT" + // "WILDCARD_EXPRESSION" + MatchType string `json:"matchType,omitempty"` + + // Value: The value of the dimension. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DimensionName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionValue) MarshalJSON() ([]byte, error) { + type noMethod DimensionValue + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionValueList: Represents the list of DimensionValue resources. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionValueList) MarshalJSON() ([]byte, error) { + type noMethod DimensionValueList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionValueRequest: Represents a DimensionValuesRequest. +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionValueRequest) MarshalJSON() ([]byte, error) { + type noMethod DimensionValueRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DirectorySite: DirectorySites contains properties of a website from +// the Site Directory. Sites need to be added to an account via the +// Sites resource before they can be assigned to a placement. +type DirectorySite struct { + // Active: Whether this directory site is active. + Active bool `json:"active,omitempty"` + + // ContactAssignments: Directory site contacts. + ContactAssignments []*DirectorySiteContactAssignment `json:"contactAssignments,omitempty"` + + // CountryId: Country ID of this directory site. + CountryId int64 `json:"countryId,omitempty,string"` + + // CurrencyId: Currency ID of this directory site. + // Possible values are: + // - "1" for USD + // - "2" for GBP + // - "3" for ESP + // - "4" for SEK + // - "5" for CAD + // - "6" for JPY + // - "7" for DEM + // - "8" for AUD + // - "9" for FRF + // - "10" for ITL + // - "11" for DKK + // - "12" for NOK + // - "13" for FIM + // - "14" for ZAR + // - "15" for IEP + // - "16" for NLG + // - "17" for EUR + // - "18" for KRW + // - "19" for TWD + // - "20" for SGD + // - "21" for CNY + // - "22" for HKD + // - "23" for NZD + // - "24" for MYR + // - "25" for BRL + // - "26" for PTE + // - "27" for MXP + // - "28" for CLP + // - "29" for TRY + // - "30" for ARS + // - "31" for PEN + // - "32" for ILS + // - "33" for CHF + // - "34" for VEF + // - "35" for COP + // - "36" for GTQ + CurrencyId int64 `json:"currencyId,omitempty,string"` + + // Description: Description of this directory site. + Description string `json:"description,omitempty"` + + // Id: ID of this directory site. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this directory site. + // This is a read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // InpageTagFormats: Tag types for regular placements. + // + // Acceptable values are: + // - "STANDARD" + // - "IFRAME_JAVASCRIPT_INPAGE" + // - "INTERNAL_REDIRECT_INPAGE" + // - "JAVASCRIPT_INPAGE" + // + // Possible values: + // "IFRAME_JAVASCRIPT_INPAGE" + // "INTERNAL_REDIRECT_INPAGE" + // "JAVASCRIPT_INPAGE" + // "STANDARD" + InpageTagFormats []string `json:"inpageTagFormats,omitempty"` + + // InterstitialTagFormats: Tag types for interstitial + // placements. + // + // Acceptable values are: + // - "IFRAME_JAVASCRIPT_INTERSTITIAL" + // - "INTERNAL_REDIRECT_INTERSTITIAL" + // - "JAVASCRIPT_INTERSTITIAL" + // + // Possible values: + // "IFRAME_JAVASCRIPT_INTERSTITIAL" + // "INTERNAL_REDIRECT_INTERSTITIAL" + // "JAVASCRIPT_INTERSTITIAL" + InterstitialTagFormats []string `json:"interstitialTagFormats,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#directorySite". + Kind string `json:"kind,omitempty"` + + // Name: Name of this directory site. + Name string `json:"name,omitempty"` + + // ParentId: Parent directory site ID. + ParentId int64 `json:"parentId,omitempty,string"` + + // Settings: Directory site settings. + Settings *DirectorySiteSettings `json:"settings,omitempty"` + + // Url: URL of this directory site. + Url string `json:"url,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Active") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DirectorySite) MarshalJSON() ([]byte, error) { + type noMethod DirectorySite + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DirectorySiteContact: Contains properties of a Site Directory +// contact. +type DirectorySiteContact struct { + // Email: Email address of this directory site contact. + Email string `json:"email,omitempty"` + + // FirstName: First name of this directory site contact. + FirstName string `json:"firstName,omitempty"` + + // Id: ID of this directory site contact. This is a read-only, + // auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#directorySiteContact". + Kind string `json:"kind,omitempty"` + + // LastName: Last name of this directory site contact. + LastName string `json:"lastName,omitempty"` + + // Role: Directory site contact role. + // + // Possible values: + // "ADMIN" + // "EDIT" + // "VIEW" + Role string `json:"role,omitempty"` + + // Type: Directory site contact type. + // + // Possible values: + // "BILLING" + // "OTHER" + // "SALES" + // "TECHNICAL" + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Email") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DirectorySiteContact) MarshalJSON() ([]byte, error) { + type noMethod DirectorySiteContact + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DirectorySiteContactAssignment: Directory Site Contact Assignment +type DirectorySiteContactAssignment struct { + // ContactId: ID of this directory site contact. This is a read-only, + // auto-generated field. + ContactId int64 `json:"contactId,omitempty,string"` + + // Visibility: Visibility of this directory site contact assignment. + // When set to PUBLIC this contact assignment is visible to all account + // and agency users; when set to PRIVATE it is visible only to the site. + // + // Possible values: + // "PRIVATE" + // "PUBLIC" + Visibility string `json:"visibility,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ContactId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DirectorySiteContactAssignment) MarshalJSON() ([]byte, error) { + type noMethod DirectorySiteContactAssignment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DirectorySiteContactsListResponse: Directory Site Contact List +// Response +type DirectorySiteContactsListResponse struct { + // DirectorySiteContacts: Directory site contact collection + DirectorySiteContacts []*DirectorySiteContact `json:"directorySiteContacts,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#directorySiteContactsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "DirectorySiteContacts") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DirectorySiteContactsListResponse) MarshalJSON() ([]byte, error) { + type noMethod DirectorySiteContactsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DirectorySiteSettings: Directory Site Settings +type DirectorySiteSettings struct { + // ActiveViewOptOut: Whether this directory site has disabled active + // view creatives. + ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"` + + // DfpSettings: Directory site DFP settings. + DfpSettings *DfpSettings `json:"dfp_settings,omitempty"` + + // InstreamVideoPlacementAccepted: Whether this site accepts in-stream + // video ads. + InstreamVideoPlacementAccepted bool `json:"instream_video_placement_accepted,omitempty"` + + // InterstitialPlacementAccepted: Whether this site accepts interstitial + // ads. + InterstitialPlacementAccepted bool `json:"interstitialPlacementAccepted,omitempty"` + + // NielsenOcrOptOut: Whether this directory site has disabled Nielsen + // OCR reach ratings. + NielsenOcrOptOut bool `json:"nielsenOcrOptOut,omitempty"` + + // VerificationTagOptOut: Whether this directory site has disabled + // generation of Verification ins tags. + VerificationTagOptOut bool `json:"verificationTagOptOut,omitempty"` + + // VideoActiveViewOptOut: Whether this directory site has disabled + // active view for in-stream video creatives. + VideoActiveViewOptOut bool `json:"videoActiveViewOptOut,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ActiveViewOptOut") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DirectorySiteSettings) MarshalJSON() ([]byte, error) { + type noMethod DirectorySiteSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DirectorySitesListResponse: Directory Site List Response +type DirectorySitesListResponse struct { + // DirectorySites: Directory site collection. + DirectorySites []*DirectorySite `json:"directorySites,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#directorySitesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DirectorySites") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DirectorySitesListResponse) MarshalJSON() ([]byte, error) { + type noMethod DirectorySitesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventTag: Contains properties of an event tag. +type EventTag struct { + // AccountId: Account ID of this event tag. This is a read-only field + // that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this event tag. This field or the + // campaignId field is required on insertion. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // CampaignId: Campaign ID of this event tag. This field or the + // advertiserId field is required on insertion. + CampaignId int64 `json:"campaignId,omitempty,string"` + + // CampaignIdDimensionValue: Dimension value for the ID of the campaign. + // This is a read-only, auto-generated field. + CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"` + + // EnabledByDefault: Whether this event tag should be automatically + // enabled for all of the advertiser's campaigns and ads. + EnabledByDefault bool `json:"enabledByDefault,omitempty"` + + // Id: ID of this event tag. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#eventTag". + Kind string `json:"kind,omitempty"` + + // Name: Name of this event tag. This is a required field and must be + // less than 256 characters long. + Name string `json:"name,omitempty"` + + // SiteFilterType: Site filter type for this event tag. If no type is + // specified then the event tag will be applied to all sites. + // + // Possible values: + // "BLACKLIST" + // "WHITELIST" + SiteFilterType string `json:"siteFilterType,omitempty"` + + // SiteIds: Filter list of site IDs associated with this event tag. The + // siteFilterType determines whether this is a whitelist or blacklist + // filter. + SiteIds googleapi.Int64s `json:"siteIds,omitempty"` + + // SslCompliant: Whether this tag is SSL-compliant or not. This is a + // read-only field. + SslCompliant bool `json:"sslCompliant,omitempty"` + + // Status: Status of this event tag. Must be ENABLED for this event tag + // to fire. This is a required field. + // + // Possible values: + // "DISABLED" + // "ENABLED" + Status string `json:"status,omitempty"` + + // SubaccountId: Subaccount ID of this event tag. This is a read-only + // field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // Type: Event tag type. Can be used to specify whether to use a + // third-party pixel, a third-party JavaScript URL, or a third-party + // click-through URL for either impression or click tracking. This is a + // required field. + // + // Possible values: + // "CLICK_THROUGH_EVENT_TAG" + // "IMPRESSION_IMAGE_EVENT_TAG" + // "IMPRESSION_JAVASCRIPT_EVENT_TAG" + Type string `json:"type,omitempty"` + + // Url: Payload URL for this event tag. The URL on a click-through event + // tag should have a landing page URL appended to the end of it. This + // field is required on insertion. + Url string `json:"url,omitempty"` + + // UrlEscapeLevels: Number of times the landing page URL should be + // URL-escaped before being appended to the click-through event tag URL. + // Only applies to click-through event tags as specified by the event + // tag type. + UrlEscapeLevels int64 `json:"urlEscapeLevels,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventTag) MarshalJSON() ([]byte, error) { + type noMethod EventTag + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventTagOverride: Event tag override information. +type EventTagOverride struct { + // Enabled: Whether this override is enabled. + Enabled bool `json:"enabled,omitempty"` + + // Id: ID of this event tag override. This is a read-only, + // auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Enabled") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventTagOverride) MarshalJSON() ([]byte, error) { + type noMethod EventTagOverride + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventTagsListResponse: Event Tag List Response +type EventTagsListResponse struct { + // EventTags: Event tag collection. + EventTags []*EventTag `json:"eventTags,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#eventTagsListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "EventTags") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventTagsListResponse) MarshalJSON() ([]byte, error) { + type noMethod EventTagsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// File: Represents a File resource. A file contains the metadata 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". +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 filename of the file. + FileName string `json:"fileName,omitempty"` + + // Format: The output format of the report. Only available once the file + // is available. + // + // Possible values: + // "CSV" + // "EXCEL" + 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. + // + // Possible values: + // "CANCELLED" + // "FAILED" + // "PROCESSING" + // "REPORT_AVAILABLE" + Status string `json:"status,omitempty"` + + // Urls: The URLs where the completed report file can be downloaded. + Urls *FileUrls `json:"urls,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DateRange") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *File) MarshalJSON() ([]byte, error) { + type noMethod File + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FileUrls: The URLs where the completed report file can be downloaded. +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"` + + // ForceSendFields is a list of field names (e.g. "ApiUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileUrls) MarshalJSON() ([]byte, error) { + type noMethod FileUrls + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FileList: Represents the list of File resources. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileList) MarshalJSON() ([]byte, error) { + type noMethod FileList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightActivitiesGenerateTagResponse: Floodlight Activity +// GenerateTag Response +type FloodlightActivitiesGenerateTagResponse struct { + // FloodlightActivityTag: Generated tag for this floodlight activity. + FloodlightActivityTag string `json:"floodlightActivityTag,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#floodlightActivitiesGenerateTagResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "FloodlightActivityTag") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightActivitiesGenerateTagResponse) MarshalJSON() ([]byte, error) { + type noMethod FloodlightActivitiesGenerateTagResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightActivitiesListResponse: Floodlight Activity List Response +type FloodlightActivitiesListResponse struct { + // FloodlightActivities: Floodlight activity collection. + FloodlightActivities []*FloodlightActivity `json:"floodlightActivities,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#floodlightActivitiesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "FloodlightActivities") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightActivitiesListResponse) MarshalJSON() ([]byte, error) { + type noMethod FloodlightActivitiesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightActivity: Contains properties of a Floodlight activity. +type FloodlightActivity struct { + // AccountId: Account ID of this floodlight activity. This is a + // read-only field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this floodlight activity. If this + // field is left blank, the value will be copied over either from the + // activity group's advertiser or the existing activity's advertiser. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // CacheBustingType: Code type used for cache busting in the generated + // tag. + // + // Possible values: + // "ACTIVE_SERVER_PAGE" + // "COLD_FUSION" + // "JAVASCRIPT" + // "JSP" + // "PHP" + CacheBustingType string `json:"cacheBustingType,omitempty"` + + // CountingMethod: Counting method for conversions for this floodlight + // activity. This is a required field. + // + // Possible values: + // "ITEMS_SOLD_COUNTING" + // "SESSION_COUNTING" + // "STANDARD_COUNTING" + // "TRANSACTIONS_COUNTING" + // "UNIQUE_COUNTING" + CountingMethod string `json:"countingMethod,omitempty"` + + // DefaultTags: Dynamic floodlight tags. + DefaultTags []*FloodlightActivityDynamicTag `json:"defaultTags,omitempty"` + + // ExpectedUrl: URL where this tag will be deployed. If specified, must + // be less than 256 characters long. + ExpectedUrl string `json:"expectedUrl,omitempty"` + + // FloodlightActivityGroupId: Floodlight activity group ID of this + // floodlight activity. This is a required field. + FloodlightActivityGroupId int64 `json:"floodlightActivityGroupId,omitempty,string"` + + // FloodlightActivityGroupName: Name of the associated floodlight + // activity group. This is a read-only field. + FloodlightActivityGroupName string `json:"floodlightActivityGroupName,omitempty"` + + // FloodlightActivityGroupTagString: Tag string of the associated + // floodlight activity group. This is a read-only field. + FloodlightActivityGroupTagString string `json:"floodlightActivityGroupTagString,omitempty"` + + // FloodlightActivityGroupType: Type of the associated floodlight + // activity group. This is a read-only field. + // + // Possible values: + // "COUNTER" + // "SALE" + FloodlightActivityGroupType string `json:"floodlightActivityGroupType,omitempty"` + + // FloodlightConfigurationId: Floodlight configuration ID of this + // floodlight activity. If this field is left blank, the value will be + // copied over either from the activity group's floodlight configuration + // or from the existing activity's floodlight configuration. + FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"` + + // FloodlightConfigurationIdDimensionValue: Dimension value for the ID + // of the floodlight configuration. This is a read-only, auto-generated + // field. + FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"` + + // Hidden: Whether this activity is archived. + Hidden bool `json:"hidden,omitempty"` + + // Id: ID of this floodlight activity. This is a read-only, + // auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this floodlight + // activity. This is a read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // ImageTagEnabled: Whether the image tag is enabled for this activity. + ImageTagEnabled bool `json:"imageTagEnabled,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#floodlightActivity". + Kind string `json:"kind,omitempty"` + + // Name: Name of this floodlight activity. This is a required field. + // Must be less than 129 characters long and cannot contain quotes. + Name string `json:"name,omitempty"` + + // Notes: General notes or implementation instructions for the tag. + Notes string `json:"notes,omitempty"` + + // PublisherTags: Publisher dynamic floodlight tags. + PublisherTags []*FloodlightActivityPublisherDynamicTag `json:"publisherTags,omitempty"` + + // Secure: Whether this tag should use SSL. + Secure bool `json:"secure,omitempty"` + + // SslCompliant: Whether the floodlight activity is SSL-compliant. This + // is a read-only field, its value detected by the system from the + // floodlight tags. + SslCompliant bool `json:"sslCompliant,omitempty"` + + // SslRequired: Whether this floodlight activity must be SSL-compliant. + SslRequired bool `json:"sslRequired,omitempty"` + + // SubaccountId: Subaccount ID of this floodlight activity. This is a + // read-only field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TagFormat: Tag format type for the floodlight activity. If left + // blank, the tag format will default to HTML. + // + // Possible values: + // "HTML" + // "XHTML" + TagFormat string `json:"tagFormat,omitempty"` + + // TagString: Value of the cat= paramter in the floodlight tag, which + // the ad servers use to identify the activity. This is optional: if + // empty, a new tag string will be generated for you. This string must + // be 1 to 8 characters long, with valid characters being + // [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among + // activities of the same activity group. This field is read-only after + // insertion. + TagString string `json:"tagString,omitempty"` + + // UserDefinedVariableTypes: List of the user-defined variables used by + // this conversion tag. These map to the "u[1-20]=" in the tags. Each of + // these can have a user defined type. + // Acceptable values are: + // - "U1" + // - "U2" + // - "U3" + // - "U4" + // - "U5" + // - "U6" + // - "U7" + // - "U8" + // - "U9" + // - "U10" + // - "U11" + // - "U12" + // - "U13" + // - "U14" + // - "U15" + // - "U16" + // - "U17" + // - "U18" + // - "U19" + // - "U20" + // + // Possible values: + // "U1" + // "U10" + // "U11" + // "U12" + // "U13" + // "U14" + // "U15" + // "U16" + // "U17" + // "U18" + // "U19" + // "U2" + // "U20" + // "U3" + // "U4" + // "U5" + // "U6" + // "U7" + // "U8" + // "U9" + UserDefinedVariableTypes []string `json:"userDefinedVariableTypes,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightActivity) MarshalJSON() ([]byte, error) { + type noMethod FloodlightActivity + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightActivityDynamicTag: Dynamic Tag +type FloodlightActivityDynamicTag struct { + // Id: ID of this dynamic tag. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // Name: Name of this tag. + Name string `json:"name,omitempty"` + + // Tag: Tag code. + Tag string `json:"tag,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightActivityDynamicTag) MarshalJSON() ([]byte, error) { + type noMethod FloodlightActivityDynamicTag + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightActivityGroup: Contains properties of a Floodlight activity +// group. +type FloodlightActivityGroup struct { + // AccountId: Account ID of this floodlight activity group. This is a + // read-only field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this floodlight activity group. If + // this field is left blank, the value will be copied over either from + // the floodlight configuration's advertiser or from the existing + // activity group's advertiser. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // FloodlightConfigurationId: Floodlight configuration ID of this + // floodlight activity group. This is a required field. + FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"` + + // FloodlightConfigurationIdDimensionValue: Dimension value for the ID + // of the floodlight configuration. This is a read-only, auto-generated + // field. + FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"` + + // Id: ID of this floodlight activity group. This is a read-only, + // auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this floodlight + // activity group. This is a read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#floodlightActivityGroup". + Kind string `json:"kind,omitempty"` + + // Name: Name of this floodlight activity group. This is a required + // field. Must be less than 65 characters long and cannot contain + // quotes. + Name string `json:"name,omitempty"` + + // SubaccountId: Subaccount ID of this floodlight activity group. This + // is a read-only field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TagString: Value of the type= parameter in the floodlight tag, which + // the ad servers use to identify the activity group that the activity + // belongs to. This is optional: if empty, a new tag string will be + // generated for you. This string must be 1 to 8 characters long, with + // valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must + // also be unique among activity groups of the same floodlight + // configuration. This field is read-only after insertion. + TagString string `json:"tagString,omitempty"` + + // Type: Type of the floodlight activity group. This is a required field + // that is read-only after insertion. + // + // Possible values: + // "COUNTER" + // "SALE" + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightActivityGroup) MarshalJSON() ([]byte, error) { + type noMethod FloodlightActivityGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightActivityGroupsListResponse: Floodlight Activity Group List +// Response +type FloodlightActivityGroupsListResponse struct { + // FloodlightActivityGroups: Floodlight activity group collection. + FloodlightActivityGroups []*FloodlightActivityGroup `json:"floodlightActivityGroups,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#floodlightActivityGroupsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "FloodlightActivityGroups") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightActivityGroupsListResponse) MarshalJSON() ([]byte, error) { + type noMethod FloodlightActivityGroupsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightActivityPublisherDynamicTag: Publisher Dynamic Tag +type FloodlightActivityPublisherDynamicTag struct { + // ClickThrough: Whether this tag is applicable only for click-throughs. + ClickThrough bool `json:"clickThrough,omitempty"` + + // DirectorySiteId: Directory site ID of this dynamic tag. This is a + // write-only field that can be used as an alternative to the siteId + // field. When this resource is retrieved, only the siteId field will be + // populated. + DirectorySiteId int64 `json:"directorySiteId,omitempty,string"` + + // DynamicTag: Dynamic floodlight tag. + DynamicTag *FloodlightActivityDynamicTag `json:"dynamicTag,omitempty"` + + // SiteId: Site ID of this dynamic tag. + SiteId int64 `json:"siteId,omitempty,string"` + + // SiteIdDimensionValue: Dimension value for the ID of the site. This is + // a read-only, auto-generated field. + SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"` + + // ViewThrough: Whether this tag is applicable only for view-throughs. + ViewThrough bool `json:"viewThrough,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ClickThrough") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightActivityPublisherDynamicTag) MarshalJSON() ([]byte, error) { + type noMethod FloodlightActivityPublisherDynamicTag + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightConfiguration: Contains properties of a Floodlight +// configuration. +type FloodlightConfiguration struct { + // AccountId: Account ID of this floodlight configuration. This is a + // read-only field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of the parent advertiser of this + // floodlight configuration. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // AnalyticsDataSharingEnabled: Whether advertiser data is shared with + // Google Analytics. + AnalyticsDataSharingEnabled bool `json:"analyticsDataSharingEnabled,omitempty"` + + // ExposureToConversionEnabled: Whether the exposure-to-conversion + // report is enabled. This report shows detailed pathway information on + // up to 10 of the most recent ad exposures seen by a user before + // converting. + ExposureToConversionEnabled bool `json:"exposureToConversionEnabled,omitempty"` + + // FirstDayOfWeek: Day that will be counted as the first day of the week + // in reports. This is a required field. + // + // Possible values: + // "MONDAY" + // "SUNDAY" + FirstDayOfWeek string `json:"firstDayOfWeek,omitempty"` + + // Id: ID of this floodlight configuration. This is a read-only, + // auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this floodlight + // configuration. This is a read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#floodlightConfiguration". + Kind string `json:"kind,omitempty"` + + // LookbackConfiguration: Lookback window settings for this floodlight + // configuration. + LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"` + + // NaturalSearchConversionAttributionOption: Types of attribution + // options for natural search conversions. + // + // Possible values: + // "EXCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION" + // "INCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION" + // "INCLUDE_NATURAL_SEARCH_TIERED_CONVERSION_ATTRIBUTION" + NaturalSearchConversionAttributionOption string `json:"naturalSearchConversionAttributionOption,omitempty"` + + // OmnitureSettings: Settings for DCM Omniture integration. + OmnitureSettings *OmnitureSettings `json:"omnitureSettings,omitempty"` + + // SslRequired: Whether floodlight activities owned by this + // configuration are required to be SSL-compliant. + SslRequired bool `json:"sslRequired,omitempty"` + + // StandardVariableTypes: List of standard variables enabled for this + // configuration. + // + // Acceptable values are: + // - "ORD" + // - "NUM" + // + // Possible values: + // "NUM" + // "ORD" + // "TRAN" + // "U" + StandardVariableTypes []string `json:"standardVariableTypes,omitempty"` + + // SubaccountId: Subaccount ID of this floodlight configuration. This is + // a read-only field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TagSettings: Configuration settings for dynamic and image floodlight + // tags. + TagSettings *TagSettings `json:"tagSettings,omitempty"` + + // UserDefinedVariableConfigurations: List of user defined variables + // enabled for this configuration. + UserDefinedVariableConfigurations []*UserDefinedVariableConfiguration `json:"userDefinedVariableConfigurations,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightConfiguration) MarshalJSON() ([]byte, error) { + type noMethod FloodlightConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightConfigurationsListResponse: Floodlight Configuration List +// Response +type FloodlightConfigurationsListResponse struct { + // FloodlightConfigurations: Floodlight configuration collection. + FloodlightConfigurations []*FloodlightConfiguration `json:"floodlightConfigurations,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#floodlightConfigurationsListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "FloodlightConfigurations") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightConfigurationsListResponse) MarshalJSON() ([]byte, error) { + type noMethod FloodlightConfigurationsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightReportCompatibleFields: Represents fields that are +// compatible to be selected for a report of type "FlOODLIGHT". +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionFilters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightReportCompatibleFields) MarshalJSON() ([]byte, error) { + type noMethod FloodlightReportCompatibleFields + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FrequencyCap: Frequency Cap. +type FrequencyCap struct { + // Duration: Duration of time, in seconds, for this frequency cap. The + // maximum duration is 90 days in seconds, or 7,776,000. + Duration int64 `json:"duration,omitempty,string"` + + // Impressions: Number of times an individual user can be served the ad + // within the specified duration. The maximum allowed is 15. + Impressions int64 `json:"impressions,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Duration") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FrequencyCap) MarshalJSON() ([]byte, error) { + type noMethod FrequencyCap + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FsCommand: FsCommand. +type FsCommand struct { + // Left: Distance from the left of the browser.Applicable when + // positionOption is DISTANCE_FROM_TOP_LEFT_CORNER. + Left int64 `json:"left,omitempty"` + + // PositionOption: Position in the browser where the window will open. + // + // Possible values: + // "CENTERED" + // "DISTANCE_FROM_TOP_LEFT_CORNER" + PositionOption string `json:"positionOption,omitempty"` + + // Top: Distance from the top of the browser. Applicable when + // positionOption is DISTANCE_FROM_TOP_LEFT_CORNER. + Top int64 `json:"top,omitempty"` + + // WindowHeight: Height of the window. + WindowHeight int64 `json:"windowHeight,omitempty"` + + // WindowWidth: Width of the window. + WindowWidth int64 `json:"windowWidth,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Left") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FsCommand) MarshalJSON() ([]byte, error) { + type noMethod FsCommand + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GeoTargeting: Geographical Targeting. +type GeoTargeting struct { + // Cities: Cities to be targeted. For each city only dartId is required. + // The other fields are populated automatically when the ad is inserted + // or updated. If targeting a city, do not target or exclude the country + // of the city, and do not target the metro or region of the city. + Cities []*City `json:"cities,omitempty"` + + // Countries: Countries to be targeted or excluded from targeting, + // depending on the setting of the excludeCountries field. For each + // country only dartId is required. The other fields are populated + // automatically when the ad is inserted or updated. If targeting or + // excluding a country, do not target regions, cities, metros, or postal + // codes in the same country. + Countries []*Country `json:"countries,omitempty"` + + // ExcludeCountries: Whether or not to exclude the countries in the + // countries field from targeting. If false, the countries field refers + // to countries which will be targeted by the ad. + ExcludeCountries bool `json:"excludeCountries,omitempty"` + + // Metros: Metros to be targeted. For each metro only dmaId is required. + // The other fields are populated automatically when the ad is inserted + // or updated. If targeting a metro, do not target or exclude the + // country of the metro. + Metros []*Metro `json:"metros,omitempty"` + + // PostalCodes: Postal codes to be targeted. For each postal code only + // id is required. The other fields are populated automatically when the + // ad is inserted or updated. If targeting a postal code, do not target + // or exclude the country of the postal code. + PostalCodes []*PostalCode `json:"postalCodes,omitempty"` + + // Regions: Regions to be targeted. For each region only dartId is + // required. The other fields are populated automatically when the ad is + // inserted or updated. If targeting a region, do not target or exclude + // the country of the region. + Regions []*Region `json:"regions,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Cities") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoTargeting) MarshalJSON() ([]byte, error) { + type noMethod GeoTargeting + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// KeyValueTargetingExpression: Key Value Targeting Expression. +type KeyValueTargetingExpression struct { + // Expression: Keyword expression being targeted by the ad. + Expression string `json:"expression,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Expression") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *KeyValueTargetingExpression) MarshalJSON() ([]byte, error) { + type noMethod KeyValueTargetingExpression + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LandingPage: Contains information about where a user's browser is +// taken after the user clicks an ad. +type LandingPage struct { + // Default: Whether or not this landing page will be assigned to any ads + // or creatives that do not have a landing page assigned explicitly. + // Only one default landing page is allowed per campaign. + Default bool `json:"default,omitempty"` + + // Id: ID of this landing page. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#landingPage". + Kind string `json:"kind,omitempty"` + + // Name: Name of this landing page. This is a required field. It must be + // less than 256 characters long, and must be unique among landing pages + // of the same campaign. + Name string `json:"name,omitempty"` + + // Url: URL of this landing page. This is a required field. + Url string `json:"url,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Default") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LandingPage) MarshalJSON() ([]byte, error) { + type noMethod LandingPage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LandingPagesListResponse: Landing Page List Response +type LandingPagesListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#landingPagesListResponse". + Kind string `json:"kind,omitempty"` + + // LandingPages: Landing page collection + LandingPages []*LandingPage `json:"landingPages,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LandingPagesListResponse) MarshalJSON() ([]byte, error) { + type noMethod LandingPagesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LastModifiedInfo: Modification timestamp. +type LastModifiedInfo struct { + // Time: Timestamp of the last change in milliseconds since epoch. + Time int64 `json:"time,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Time") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LastModifiedInfo) MarshalJSON() ([]byte, error) { + type noMethod LastModifiedInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListTargetingExpression: Remarketing List Targeting Expression. +type ListTargetingExpression struct { + // Expression: Expression describing which lists are being targeted by + // the ad. + Expression string `json:"expression,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Expression") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListTargetingExpression) MarshalJSON() ([]byte, error) { + type noMethod ListTargetingExpression + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LookbackConfiguration: Lookback configuration settings. +type LookbackConfiguration struct { + // ClickDuration: Lookback window, in days, from the last time a given + // user clicked on one of your ads. If you enter 0, clicks will not be + // considered as triggering events for floodlight tracking. If you leave + // this field blank, the default value for your account will be used. + ClickDuration int64 `json:"clickDuration,omitempty"` + + // PostImpressionActivitiesDuration: Lookback window, in days, from the + // last time a given user viewed one of your ads. If you enter 0, + // impressions will not be considered as triggering events for + // floodlight tracking. If you leave this field blank, the default value + // for your account will be used. + PostImpressionActivitiesDuration int64 `json:"postImpressionActivitiesDuration,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ClickDuration") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LookbackConfiguration) MarshalJSON() ([]byte, error) { + type noMethod LookbackConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Metric: Represents a metric. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Metric) MarshalJSON() ([]byte, error) { + type noMethod Metric + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Metro: Contains information about a metro region that can be targeted +// by ads. +type Metro struct { + // CountryCode: Country code of the country to which this metro region + // belongs. + CountryCode string `json:"countryCode,omitempty"` + + // CountryDartId: DART ID of the country to which this metro region + // belongs. + CountryDartId int64 `json:"countryDartId,omitempty,string"` + + // DartId: DART ID of this metro region. + DartId int64 `json:"dartId,omitempty,string"` + + // DmaId: DMA ID of this metro region. This is the ID used for targeting + // and generating reports, and is equivalent to metro_code. + DmaId int64 `json:"dmaId,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#metro". + Kind string `json:"kind,omitempty"` + + // MetroCode: Metro code of this metro region. This is equivalent to + // dma_id. + MetroCode string `json:"metroCode,omitempty"` + + // Name: Name of this metro region. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CountryCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Metro) MarshalJSON() ([]byte, error) { + type noMethod Metro + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MetrosListResponse: Metro List Response +type MetrosListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#metrosListResponse". + Kind string `json:"kind,omitempty"` + + // Metros: Metro collection. + Metros []*Metro `json:"metros,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MetrosListResponse) MarshalJSON() ([]byte, error) { + type noMethod MetrosListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MobileCarrier: Contains information about a mobile carrier that can +// be targeted by ads. +type MobileCarrier struct { + // CountryCode: Country code of the country to which this mobile carrier + // belongs. + CountryCode string `json:"countryCode,omitempty"` + + // CountryDartId: DART ID of the country to which this mobile carrier + // belongs. + CountryDartId int64 `json:"countryDartId,omitempty,string"` + + // Id: ID of this mobile carrier. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#mobileCarrier". + Kind string `json:"kind,omitempty"` + + // Name: Name of this mobile carrier. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CountryCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MobileCarrier) MarshalJSON() ([]byte, error) { + type noMethod MobileCarrier + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MobileCarriersListResponse: Mobile Carrier List Response +type MobileCarriersListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#mobileCarriersListResponse". + Kind string `json:"kind,omitempty"` + + // MobileCarriers: Mobile carrier collection. + MobileCarriers []*MobileCarrier `json:"mobileCarriers,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MobileCarriersListResponse) MarshalJSON() ([]byte, error) { + type noMethod MobileCarriersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ObjectFilter: Object Filter. +type ObjectFilter struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#objectFilter". + Kind string `json:"kind,omitempty"` + + // ObjectIds: Applicable when status is ASSIGNED. The user has access to + // objects with these object IDs. + ObjectIds googleapi.Int64s `json:"objectIds,omitempty"` + + // Status: Status of the filter. NONE means the user has access to none + // of the objects. ALL means the user has access to all objects. + // ASSIGNED means the user has access to the objects with IDs in the + // objectIds list. + // + // Possible values: + // "ALL" + // "ASSIGNED" + // "NONE" + Status string `json:"status,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ObjectFilter) MarshalJSON() ([]byte, error) { + type noMethod ObjectFilter + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OffsetPosition: Offset Position. +type OffsetPosition struct { + // Left: Offset distance from left side of an asset or a window. + Left int64 `json:"left,omitempty"` + + // Top: Offset distance from top side of an asset or a window. + Top int64 `json:"top,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Left") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OffsetPosition) MarshalJSON() ([]byte, error) { + type noMethod OffsetPosition + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OmnitureSettings: Omniture Integration Settings. +type OmnitureSettings struct { + // OmnitureCostDataEnabled: Whether placement cost data will be sent to + // Omniture. This property can be enabled only if + // omnitureIntegrationEnabled is true. + OmnitureCostDataEnabled bool `json:"omnitureCostDataEnabled,omitempty"` + + // OmnitureIntegrationEnabled: Whether Omniture integration is enabled. + // This property can be enabled only when the "Advanced Ad Serving" + // account setting is enabled. + OmnitureIntegrationEnabled bool `json:"omnitureIntegrationEnabled,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "OmnitureCostDataEnabled") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OmnitureSettings) MarshalJSON() ([]byte, error) { + type noMethod OmnitureSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperatingSystem: Contains information about an operating system that +// can be targeted by ads. +type OperatingSystem struct { + // DartId: DART ID of this operating system. This is the ID used for + // targeting. + DartId int64 `json:"dartId,omitempty,string"` + + // Desktop: Whether this operating system is for desktop. + Desktop bool `json:"desktop,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#operatingSystem". + Kind string `json:"kind,omitempty"` + + // Mobile: Whether this operating system is for mobile. + Mobile bool `json:"mobile,omitempty"` + + // Name: Name of this operating system. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DartId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperatingSystem) MarshalJSON() ([]byte, error) { + type noMethod OperatingSystem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperatingSystemVersion: Contains information about a particular +// version of an operating system that can be targeted by ads. +type OperatingSystemVersion struct { + // Id: ID of this operating system version. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#operatingSystemVersion". + Kind string `json:"kind,omitempty"` + + // MajorVersion: Major version (leftmost number) of this operating + // system version. + MajorVersion string `json:"majorVersion,omitempty"` + + // MinorVersion: Minor version (number after the first dot) of this + // operating system version. + MinorVersion string `json:"minorVersion,omitempty"` + + // Name: Name of this operating system version. + Name string `json:"name,omitempty"` + + // OperatingSystem: Operating system of this operating system version. + OperatingSystem *OperatingSystem `json:"operatingSystem,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperatingSystemVersion) MarshalJSON() ([]byte, error) { + type noMethod OperatingSystemVersion + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperatingSystemVersionsListResponse: Operating System Version List +// Response +type OperatingSystemVersionsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#operatingSystemVersionsListResponse". + Kind string `json:"kind,omitempty"` + + // OperatingSystemVersions: Operating system version collection. + OperatingSystemVersions []*OperatingSystemVersion `json:"operatingSystemVersions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperatingSystemVersionsListResponse) MarshalJSON() ([]byte, error) { + type noMethod OperatingSystemVersionsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperatingSystemsListResponse: Operating System List Response +type OperatingSystemsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#operatingSystemsListResponse". + Kind string `json:"kind,omitempty"` + + // OperatingSystems: Operating system collection. + OperatingSystems []*OperatingSystem `json:"operatingSystems,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperatingSystemsListResponse) MarshalJSON() ([]byte, error) { + type noMethod OperatingSystemsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OptimizationActivity: Creative optimization activity. +type OptimizationActivity struct { + // FloodlightActivityId: Floodlight activity ID of this optimization + // activity. This is a required field. + FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"` + + // FloodlightActivityIdDimensionValue: Dimension value for the ID of the + // floodlight activity. This is a read-only, auto-generated field. + FloodlightActivityIdDimensionValue *DimensionValue `json:"floodlightActivityIdDimensionValue,omitempty"` + + // Weight: Weight associated with this optimization. Must be greater + // than 1. The weight assigned will be understood in proportion to the + // weights assigned to the other optimization activities. + Weight int64 `json:"weight,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "FloodlightActivityId") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OptimizationActivity) MarshalJSON() ([]byte, error) { + type noMethod OptimizationActivity + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PathToConversionReportCompatibleFields: Represents fields that are +// compatible to be selected for a report of type "PATH_TO_CONVERSION". +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"` + + // ForceSendFields is a list of field names (e.g. + // "ConversionDimensions") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PathToConversionReportCompatibleFields) MarshalJSON() ([]byte, error) { + type noMethod PathToConversionReportCompatibleFields + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Placement: Contains properties of a placement. +type Placement struct { + // AccountId: Account ID of this placement. This field can be left + // blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this placement. This field can be left + // blank. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // Archived: Whether this placement is archived. + Archived bool `json:"archived,omitempty"` + + // CampaignId: Campaign ID of this placement. This field is a required + // field on insertion. + CampaignId int64 `json:"campaignId,omitempty,string"` + + // CampaignIdDimensionValue: Dimension value for the ID of the campaign. + // This is a read-only, auto-generated field. + CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"` + + // Comment: Comments for this placement. + Comment string `json:"comment,omitempty"` + + // Compatibility: Placement compatibility. WEB and WEB_INTERSTITIAL + // refer to rendering either on desktop or on mobile devices for regular + // or interstitial ads, respectively. APP and APP_INTERSTITIAL are for + // rendering in mobile apps.IN_STREAM_VIDEO refers to rendering in + // in-stream video ads developed with the VAST standard. This field is + // required on insertion. + // + // Possible values: + // "APP" + // "APP_INTERSTITIAL" + // "IN_STREAM_VIDEO" + // "WEB" + // "WEB_INTERSTITIAL" + Compatibility string `json:"compatibility,omitempty"` + + // ContentCategoryId: ID of the content category assigned to this + // placement. + ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"` + + // CreateInfo: Information about the creation of this placement. This is + // a read-only field. + CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"` + + // DirectorySiteId: Directory site ID of this placement. On insert, you + // must set either this field or the siteId field to specify the site + // associated with this placement. This is a required field that is + // read-only after insertion. + DirectorySiteId int64 `json:"directorySiteId,omitempty,string"` + + // DirectorySiteIdDimensionValue: Dimension value for the ID of the + // directory site. This is a read-only, auto-generated field. + DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"` + + // ExternalId: External ID for this placement. + ExternalId string `json:"externalId,omitempty"` + + // Id: ID of this placement. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this placement. This + // is a read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // KeyName: Key name of this placement. This is a read-only, + // auto-generated field. + KeyName string `json:"keyName,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#placement". + Kind string `json:"kind,omitempty"` + + // LastModifiedInfo: Information about the most recent modification of + // this placement. This is a read-only field. + LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"` + + // LookbackConfiguration: Lookback window settings for this placement. + LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"` + + // Name: Name of this placement.This is a required field and must be + // less than 256 characters long. + Name string `json:"name,omitempty"` + + // PaymentApproved: Whether payment was approved for this placement. + // This is a read-only field relevant only to publisher-paid placements. + PaymentApproved bool `json:"paymentApproved,omitempty"` + + // PaymentSource: Payment source for this placement. This is a required + // field that is read-only after insertion. + // + // Possible values: + // "PLACEMENT_AGENCY_PAID" + // "PLACEMENT_PUBLISHER_PAID" + PaymentSource string `json:"paymentSource,omitempty"` + + // PlacementGroupId: ID of this placement's group, if applicable. + PlacementGroupId int64 `json:"placementGroupId,omitempty,string"` + + // PlacementGroupIdDimensionValue: Dimension value for the ID of the + // placement group. This is a read-only, auto-generated field. + PlacementGroupIdDimensionValue *DimensionValue `json:"placementGroupIdDimensionValue,omitempty"` + + // PlacementStrategyId: ID of the placement strategy assigned to this + // placement. + PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"` + + // PricingSchedule: Pricing schedule of this placement. This field is + // required on insertion, specifically subfields startDate, endDate and + // pricingType. + PricingSchedule *PricingSchedule `json:"pricingSchedule,omitempty"` + + // Primary: Whether this placement is the primary placement of a + // roadblock (placement group). You cannot change this field from true + // to false. Setting this field to true will automatically set the + // primary field on the original primary placement of the roadblock to + // false, and it will automatically set the roadblock's + // primaryPlacementId field to the ID of this placement. + Primary bool `json:"primary,omitempty"` + + // PublisherUpdateInfo: Information about the last publisher update. + // This is a read-only field. + PublisherUpdateInfo *LastModifiedInfo `json:"publisherUpdateInfo,omitempty"` + + // SiteId: Site ID associated with this placement. On insert, you must + // set either this field or the directorySiteId field to specify the + // site associated with this placement. This is a required field that is + // read-only after insertion. + SiteId int64 `json:"siteId,omitempty,string"` + + // SiteIdDimensionValue: Dimension value for the ID of the site. This is + // a read-only, auto-generated field. + SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"` + + // Size: Size associated with this placement. When inserting or updating + // a placement, only the size ID field is used. This field is required + // on insertion. + Size *Size `json:"size,omitempty"` + + // SslRequired: Whether creatives assigned to this placement must be + // SSL-compliant. + SslRequired bool `json:"sslRequired,omitempty"` + + // Status: Third-party placement status. + // + // Possible values: + // "ACKNOWLEDGE_ACCEPTANCE" + // "ACKNOWLEDGE_REJECTION" + // "DRAFT" + // "PAYMENT_ACCEPTED" + // "PAYMENT_REJECTED" + // "PENDING_REVIEW" + Status string `json:"status,omitempty"` + + // SubaccountId: Subaccount ID of this placement. This field can be left + // blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TagFormats: Tag formats to generate for this placement. This field is + // required on insertion. + // Acceptable values are: + // - "PLACEMENT_TAG_STANDARD" + // - "PLACEMENT_TAG_IFRAME_JAVASCRIPT" + // - "PLACEMENT_TAG_IFRAME_ILAYER" + // - "PLACEMENT_TAG_INTERNAL_REDIRECT" + // - "PLACEMENT_TAG_JAVASCRIPT" + // - "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT" + // - "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT" + // - "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT" + // - "PLACEMENT_TAG_CLICK_COMMANDS" + // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH" + // - "PLACEMENT_TAG_TRACKING" + // - "PLACEMENT_TAG_TRACKING_IFRAME" + // - "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + // + // Possible values: + // "PLACEMENT_TAG_CLICK_COMMANDS" + // "PLACEMENT_TAG_IFRAME_ILAYER" + // "PLACEMENT_TAG_IFRAME_JAVASCRIPT" + // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY" + // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH" + // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3" + // "PLACEMENT_TAG_INTERNAL_REDIRECT" + // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT" + // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY" + // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT" + // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT" + // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY" + // "PLACEMENT_TAG_JAVASCRIPT" + // "PLACEMENT_TAG_JAVASCRIPT_LEGACY" + // "PLACEMENT_TAG_STANDARD" + // "PLACEMENT_TAG_TRACKING" + // "PLACEMENT_TAG_TRACKING_IFRAME" + // "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + TagFormats []string `json:"tagFormats,omitempty"` + + // TagSetting: Tag settings for this placement. + TagSetting *TagSetting `json:"tagSetting,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Placement) MarshalJSON() ([]byte, error) { + type noMethod Placement + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlacementAssignment: Placement Assignment. +type PlacementAssignment struct { + // Active: Whether this placement assignment is active. When true, the + // placement will be included in the ad's rotation. + Active bool `json:"active,omitempty"` + + // PlacementId: ID of the placement to be assigned. This is a required + // field. + PlacementId int64 `json:"placementId,omitempty,string"` + + // PlacementIdDimensionValue: Dimension value for the ID of the + // placement. This is a read-only, auto-generated field. + PlacementIdDimensionValue *DimensionValue `json:"placementIdDimensionValue,omitempty"` + + // SslRequired: Whether the placement to be assigned requires SSL. This + // is a read-only field that is auto-generated when the ad is inserted + // or updated. + SslRequired bool `json:"sslRequired,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Active") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlacementAssignment) MarshalJSON() ([]byte, error) { + type noMethod PlacementAssignment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlacementGroup: Contains properties of a package or roadblock. +type PlacementGroup struct { + // AccountId: Account ID of this placement group. This is a read-only + // field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this placement group. This is a + // required field on insertion. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // Archived: Whether this placement group is archived. + Archived bool `json:"archived,omitempty"` + + // CampaignId: Campaign ID of this placement group. This field is + // required on insertion. + CampaignId int64 `json:"campaignId,omitempty,string"` + + // CampaignIdDimensionValue: Dimension value for the ID of the campaign. + // This is a read-only, auto-generated field. + CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"` + + // ChildPlacementIds: IDs of placements which are assigned to this + // placement group. This is a read-only, auto-generated field. + ChildPlacementIds googleapi.Int64s `json:"childPlacementIds,omitempty"` + + // Comment: Comments for this placement group. + Comment string `json:"comment,omitempty"` + + // ContentCategoryId: ID of the content category assigned to this + // placement group. + ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"` + + // CreateInfo: Information about the creation of this placement group. + // This is a read-only field. + CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"` + + // DirectorySiteId: Directory site ID associated with this placement + // group. On insert, you must set either this field or the site_id field + // to specify the site associated with this placement group. This is a + // required field that is read-only after insertion. + DirectorySiteId int64 `json:"directorySiteId,omitempty,string"` + + // DirectorySiteIdDimensionValue: Dimension value for the ID of the + // directory site. This is a read-only, auto-generated field. + DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"` + + // ExternalId: External ID for this placement. + ExternalId string `json:"externalId,omitempty"` + + // Id: ID of this placement group. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this placement group. + // This is a read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#placementGroup". + Kind string `json:"kind,omitempty"` + + // LastModifiedInfo: Information about the most recent modification of + // this placement group. This is a read-only field. + LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"` + + // Name: Name of this placement group. This is a required field and must + // be less than 256 characters long. + Name string `json:"name,omitempty"` + + // PlacementGroupType: Type of this placement group. A package is a + // simple group of placements that acts as a single pricing point for a + // group of tags. A roadblock is a group of placements that not only + // acts as a single pricing point, but also assumes that all the tags in + // it will be served at the same time. A roadblock requires one of its + // assigned placements to be marked as primary for reporting. This field + // is required on insertion. + // + // Possible values: + // "PLACEMENT_PACKAGE" + // "PLACEMENT_ROADBLOCK" + PlacementGroupType string `json:"placementGroupType,omitempty"` + + // PlacementStrategyId: ID of the placement strategy assigned to this + // placement group. + PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"` + + // PricingSchedule: Pricing schedule of this placement group. This field + // is required on insertion. + PricingSchedule *PricingSchedule `json:"pricingSchedule,omitempty"` + + // PrimaryPlacementId: ID of the primary placement, used to calculate + // the media cost of a roadblock (placement group). Modifying this field + // will automatically modify the primary field on all affected roadblock + // child placements. + PrimaryPlacementId int64 `json:"primaryPlacementId,omitempty,string"` + + // PrimaryPlacementIdDimensionValue: Dimension value for the ID of the + // primary placement. This is a read-only, auto-generated field. + PrimaryPlacementIdDimensionValue *DimensionValue `json:"primaryPlacementIdDimensionValue,omitempty"` + + // ProgrammaticSetting: Settings for a programmatic placement. + ProgrammaticSetting *ProgrammaticSetting `json:"programmaticSetting,omitempty"` + + // SiteId: Site ID associated with this placement group. On insert, you + // must set either this field or the directorySiteId field to specify + // the site associated with this placement group. This is a required + // field that is read-only after insertion. + SiteId int64 `json:"siteId,omitempty,string"` + + // SiteIdDimensionValue: Dimension value for the ID of the site. This is + // a read-only, auto-generated field. + SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"` + + // SubaccountId: Subaccount ID of this placement group. This is a + // read-only field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlacementGroup) MarshalJSON() ([]byte, error) { + type noMethod PlacementGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlacementGroupsListResponse: Placement Group List Response +type PlacementGroupsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#placementGroupsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // PlacementGroups: Placement group collection. + PlacementGroups []*PlacementGroup `json:"placementGroups,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlacementGroupsListResponse) MarshalJSON() ([]byte, error) { + type noMethod PlacementGroupsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlacementStrategiesListResponse: Placement Strategy List Response +type PlacementStrategiesListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#placementStrategiesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // PlacementStrategies: Placement strategy collection. + PlacementStrategies []*PlacementStrategy `json:"placementStrategies,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlacementStrategiesListResponse) MarshalJSON() ([]byte, error) { + type noMethod PlacementStrategiesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlacementStrategy: Contains properties of a placement strategy. +type PlacementStrategy struct { + // AccountId: Account ID of this placement strategy.This is a read-only + // field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // Id: ID of this placement strategy. This is a read-only, + // auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#placementStrategy". + Kind string `json:"kind,omitempty"` + + // Name: Name of this placement strategy. This is a required field. It + // must be less than 256 characters long and unique among placement + // strategies of the same account. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlacementStrategy) MarshalJSON() ([]byte, error) { + type noMethod PlacementStrategy + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlacementTag: Placement Tag +type PlacementTag struct { + // PlacementId: Placement ID + PlacementId int64 `json:"placementId,omitempty,string"` + + // TagDatas: Tags generated for this placement. + TagDatas []*TagData `json:"tagDatas,omitempty"` + + // ForceSendFields is a list of field names (e.g. "PlacementId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlacementTag) MarshalJSON() ([]byte, error) { + type noMethod PlacementTag + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlacementsGenerateTagsResponse: Placement GenerateTags Response +type PlacementsGenerateTagsResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#placementsGenerateTagsResponse". + Kind string `json:"kind,omitempty"` + + // PlacementTags: Set of generated tags for the specified placements. + PlacementTags []*PlacementTag `json:"placementTags,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlacementsGenerateTagsResponse) MarshalJSON() ([]byte, error) { + type noMethod PlacementsGenerateTagsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlacementsListResponse: Placement List Response +type PlacementsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#placementsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Placements: Placement collection. + Placements []*Placement `json:"placements,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlacementsListResponse) MarshalJSON() ([]byte, error) { + type noMethod PlacementsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlatformType: Contains information about a platform type that can be +// targeted by ads. +type PlatformType struct { + // Id: ID of this platform type. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#platformType". + Kind string `json:"kind,omitempty"` + + // Name: Name of this platform type. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlatformType) MarshalJSON() ([]byte, error) { + type noMethod PlatformType + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlatformTypesListResponse: Platform Type List Response +type PlatformTypesListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#platformTypesListResponse". + Kind string `json:"kind,omitempty"` + + // PlatformTypes: Platform type collection. + PlatformTypes []*PlatformType `json:"platformTypes,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlatformTypesListResponse) MarshalJSON() ([]byte, error) { + type noMethod PlatformTypesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PopupWindowProperties: Popup Window Properties. +type PopupWindowProperties struct { + // Dimension: Popup dimension for a creative. This is a read-only field. + // Applicable to the following creative types: all RICH_MEDIA and all + // VPAID + Dimension *Size `json:"dimension,omitempty"` + + // Offset: Upper-left corner coordinates of the popup window. Applicable + // if positionType is COORDINATES. + Offset *OffsetPosition `json:"offset,omitempty"` + + // PositionType: Popup window position either centered or at specific + // coordinate. + // + // Possible values: + // "CENTER" + // "COORDINATES" + PositionType string `json:"positionType,omitempty"` + + // ShowAddressBar: Whether to display the browser address bar. + ShowAddressBar bool `json:"showAddressBar,omitempty"` + + // ShowMenuBar: Whether to display the browser menu bar. + ShowMenuBar bool `json:"showMenuBar,omitempty"` + + // ShowScrollBar: Whether to display the browser scroll bar. + ShowScrollBar bool `json:"showScrollBar,omitempty"` + + // ShowStatusBar: Whether to display the browser status bar. + ShowStatusBar bool `json:"showStatusBar,omitempty"` + + // ShowToolBar: Whether to display the browser tool bar. + ShowToolBar bool `json:"showToolBar,omitempty"` + + // Title: Title of popup window. + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Dimension") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PopupWindowProperties) MarshalJSON() ([]byte, error) { + type noMethod PopupWindowProperties + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PostalCode: Contains information about a postal code that can be +// targeted by ads. +type PostalCode struct { + // CountryCode: Country code of the country to which this postal code + // belongs. + CountryCode string `json:"countryCode,omitempty"` + + // CountryDartId: DART ID of the country to which this postal code + // belongs. + CountryDartId int64 `json:"countryDartId,omitempty,string"` + + // Id: ID of this postal code. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#postalCode". + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CountryCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostalCode) MarshalJSON() ([]byte, error) { + type noMethod PostalCode + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PostalCodesListResponse: Postal Code List Response +type PostalCodesListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#postalCodesListResponse". + Kind string `json:"kind,omitempty"` + + // PostalCodes: Postal code collection. + PostalCodes []*PostalCode `json:"postalCodes,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostalCodesListResponse) MarshalJSON() ([]byte, error) { + type noMethod PostalCodesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PricingSchedule: Pricing Schedule +type PricingSchedule struct { + // CapCostOption: Placement cap cost option. + // + // Possible values: + // "CAP_COST_CUMULATIVE" + // "CAP_COST_MONTHLY" + // "CAP_COST_NONE" + CapCostOption string `json:"capCostOption,omitempty"` + + // DisregardOverdelivery: Whether cap costs are ignored by ad serving. + DisregardOverdelivery bool `json:"disregardOverdelivery,omitempty"` + + // EndDate: Placement end date. This date must be later than, or the + // same day as, the placement start date, but not later than the + // campaign end date. If, for example, you set 6/25/2015 as both the + // start and end dates, the effective placement date is just that day + // only, 6/25/2015. The hours, minutes, and seconds of the end date + // should not be set, as doing so will result in an error. This field is + // required on insertion. + EndDate string `json:"endDate,omitempty"` + + // Flighted: Whether this placement is flighted. If true, pricing + // periods will be computed automatically. + Flighted bool `json:"flighted,omitempty"` + + // FloodlightActivityId: Floodlight activity ID associated with this + // placement. This field should be set when placement pricing type is + // set to PRICING_TYPE_CPA. + FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"` + + // PricingPeriods: Pricing periods for this placement. + PricingPeriods []*PricingSchedulePricingPeriod `json:"pricingPeriods,omitempty"` + + // PricingType: Placement pricing type. This field is required on + // insertion. + // + // Possible values: + // "PRICING_TYPE_CPA" + // "PRICING_TYPE_CPC" + // "PRICING_TYPE_CPM" + // "PRICING_TYPE_FLAT_RATE_CLICKS" + // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" + PricingType string `json:"pricingType,omitempty"` + + // StartDate: Placement start date. This date must be later than, or the + // same day as, the campaign start date. The hours, minutes, and seconds + // of the start date should not be set, as doing so will result in an + // error. This field is required on insertion. + StartDate string `json:"startDate,omitempty"` + + // TestingStartDate: Testing start date of this placement. The hours, + // minutes, and seconds of the start date should not be set, as doing so + // will result in an error. + TestingStartDate string `json:"testingStartDate,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CapCostOption") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PricingSchedule) MarshalJSON() ([]byte, error) { + type noMethod PricingSchedule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PricingSchedulePricingPeriod: Pricing Period +type PricingSchedulePricingPeriod struct { + // EndDate: Pricing period end date. This date must be later than, or + // the same day as, the pricing period start date, but not later than + // the placement end date. The period end date can be the same date as + // the period start date. If, for example, you set 6/25/2015 as both the + // start and end dates, the effective pricing period date is just that + // day only, 6/25/2015. The hours, minutes, and seconds of the end date + // should not be set, as doing so will result in an error. + EndDate string `json:"endDate,omitempty"` + + // PricingComment: Comments for this pricing period. + PricingComment string `json:"pricingComment,omitempty"` + + // RateOrCostNanos: Rate or cost of this pricing period. + RateOrCostNanos int64 `json:"rateOrCostNanos,omitempty,string"` + + // StartDate: Pricing period start date. This date must be later than, + // or the same day as, the placement start date. The hours, minutes, and + // seconds of the start date should not be set, as doing so will result + // in an error. + StartDate string `json:"startDate,omitempty"` + + // Units: Units of this pricing period. + Units int64 `json:"units,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "EndDate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PricingSchedulePricingPeriod) MarshalJSON() ([]byte, error) { + type noMethod PricingSchedulePricingPeriod + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ProgrammaticSetting: Programmatic Setting +type ProgrammaticSetting struct { + // AdxDealIds: Adx deal IDs assigned to the placement. + AdxDealIds googleapi.Int64s `json:"adxDealIds,omitempty"` + + // InsertionOrderId: Insertion order ID. + InsertionOrderId string `json:"insertionOrderId,omitempty"` + + // InsertionOrderIdStatus: Whether insertion order ID has been placed in + // DFP. This is a read-only field. + InsertionOrderIdStatus bool `json:"insertionOrderIdStatus,omitempty"` + + // MediaCostNanos: Media cost for the programmatic placement. + MediaCostNanos int64 `json:"mediaCostNanos,omitempty,string"` + + // Programmatic: Whether programmatic is enabled. + Programmatic bool `json:"programmatic,omitempty"` + + // TraffickerEmails: Trafficker emails assigned to the placement. + TraffickerEmails []string `json:"traffickerEmails,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AdxDealIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProgrammaticSetting) MarshalJSON() ([]byte, error) { + type noMethod ProgrammaticSetting + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReachReportCompatibleFields: Represents fields that are compatible to +// be selected for a report of type "REACH". +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionFilters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReachReportCompatibleFields) MarshalJSON() ([]byte, error) { + type noMethod ReachReportCompatibleFields + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Recipient: Represents a recipient. +type Recipient struct { + // DeliveryType: The delivery type for the recipient. + // + // Possible values: + // "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"` + + // ForceSendFields is a list of field names (e.g. "DeliveryType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Recipient) MarshalJSON() ([]byte, error) { + type noMethod Recipient + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Region: Contains information about a region that can be targeted by +// ads. +type Region struct { + // CountryCode: Country code of the country to which this region + // belongs. + CountryCode string `json:"countryCode,omitempty"` + + // CountryDartId: DART ID of the country to which this region belongs. + CountryDartId int64 `json:"countryDartId,omitempty,string"` + + // DartId: DART ID of this region. + DartId int64 `json:"dartId,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#region". + Kind string `json:"kind,omitempty"` + + // Name: Name of this region. + Name string `json:"name,omitempty"` + + // RegionCode: Region code. + RegionCode string `json:"regionCode,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CountryCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Region) MarshalJSON() ([]byte, error) { + type noMethod Region + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RegionsListResponse: Region List Response +type RegionsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#regionsListResponse". + Kind string `json:"kind,omitempty"` + + // Regions: Region collection. + Regions []*Region `json:"regions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RegionsListResponse) MarshalJSON() ([]byte, error) { + type noMethod RegionsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Report: Represents a Report resource. +type Report struct { + // AccountId: The account ID to which this report belongs. + AccountId int64 `json:"accountId,omitempty,string"` + + // 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 filename 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. 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. + // + // Possible values: + // "CSV" + // "EXCEL" + 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 subaccount ID to which this report belongs if + // applicable. + SubAccountId int64 `json:"subAccountId,omitempty,string"` + + // Type: The type of the report. + // + // Possible values: + // "CROSS_DIMENSION_REACH" + // "FLOODLIGHT" + // "PATH_TO_CONVERSION" + // "REACH" + // "STANDARD" + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Report) MarshalJSON() ([]byte, error) { + type noMethod Report + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportCriteria: The report criteria for a report of type "STANDARD". +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"` + + // ForceSendFields is a list of field names (e.g. "Activities") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportCrossDimensionReachCriteria: The report criteria for a report +// of type "CROSS_DIMENSION_REACH". +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. + // + // Possible values: + // "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"` + + // ForceSendFields is a list of field names (e.g. "Breakdown") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportCrossDimensionReachCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportCrossDimensionReachCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportDelivery: The report's email delivery settings. +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. + // + // Possible values: + // "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"` + + // ForceSendFields is a list of field names (e.g. "EmailOwner") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportDelivery) MarshalJSON() ([]byte, error) { + type noMethod ReportDelivery + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportFloodlightCriteria: The report criteria for a report of type +// "FLOODLIGHT". +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"` + + // ForceSendFields is a list of field names (e.g. + // "CustomRichMediaEvents") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportFloodlightCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportFloodlightCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportFloodlightCriteriaReportProperties: The properties of the +// report. +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"` + + // ForceSendFields is a list of field names (e.g. + // "IncludeAttributedIPConversions") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportFloodlightCriteriaReportProperties) MarshalJSON() ([]byte, error) { + type noMethod ReportFloodlightCriteriaReportProperties + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportPathToConversionCriteria: The report criteria for a report of +// type "PATH_TO_CONVERSION". +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"` + + // ForceSendFields is a list of field names (e.g. "ActivityFilters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportPathToConversionCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportPathToConversionCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportPathToConversionCriteriaReportProperties: The properties of the +// report. +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"` + + // ForceSendFields is a list of field names (e.g. + // "ClicksLookbackWindow") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportPathToConversionCriteriaReportProperties) MarshalJSON() ([]byte, error) { + type noMethod ReportPathToConversionCriteriaReportProperties + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportReachCriteria: The report criteria for a report of type +// "REACH". +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"` + + // EnableAllDimensionCombinations: Whether to enable all reach dimension + // combinations in the report. Defaults to false. If enabled, the date + // range of the report should be within the last three months. + EnableAllDimensionCombinations bool `json:"enableAllDimensionCombinations,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"` + + // ForceSendFields is a list of field names (e.g. "Activities") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportReachCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportReachCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportSchedule: 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". +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. Note: + // - "DAILY" also requires field "every" to be set. + // - "WEEKLY" also requires fields "every" and "repeatsOnWeekDays" to be + // set. + // - "MONTHLY" also requires fields "every" and "runsOnDayOfMonth" to be + // set. + Repeats string `json:"repeats,omitempty"` + + // RepeatsOnWeekDays: List of week days "WEEKLY" on which scheduled + // reports should run. + // + // Possible values: + // "FRIDAY" + // "MONDAY" + // "SATURDAY" + // "SUNDAY" + // "THURSDAY" + // "TUESDAY" + // "WEDNESDAY" + 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. + // 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. + // + // Possible values: + // "DAY_OF_MONTH" + // "WEEK_OF_MONTH" + RunsOnDayOfMonth string `json:"runsOnDayOfMonth,omitempty"` + + // StartDate: Start date of date range for which scheduled reports + // should be run. + StartDate string `json:"startDate,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Active") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportSchedule) MarshalJSON() ([]byte, error) { + type noMethod ReportSchedule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportCompatibleFields: Represents fields that are compatible to be +// selected for a report of type "STANDARD". +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionFilters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportCompatibleFields) MarshalJSON() ([]byte, error) { + type noMethod ReportCompatibleFields + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportList: Represents the list of reports. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportList) MarshalJSON() ([]byte, error) { + type noMethod ReportList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportsConfiguration: Reporting Configuration +type ReportsConfiguration struct { + // ExposureToConversionEnabled: Whether the exposure to conversion + // report is enabled. This report shows detailed pathway information on + // up to 10 of the most recent ad exposures seen by a user before + // converting. + ExposureToConversionEnabled bool `json:"exposureToConversionEnabled,omitempty"` + + // LookbackConfiguration: Default lookback windows for new advertisers + // in this account. + LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"` + + // ReportGenerationTimeZoneId: Report generation time zone ID of this + // account. This is a required field that can only be changed by a + // superuser. + // Acceptable values are: + // + // - "1" for "America/New_York" + // - "2" for "Europe/London" + // - "3" for "Europe/Paris" + // - "4" for "Africa/Johannesburg" + // - "5" for "Asia/Jerusalem" + // - "6" for "Asia/Shanghai" + // - "7" for "Asia/Hong_Kong" + // - "8" for "Asia/Tokyo" + // - "9" for "Australia/Sydney" + // - "10" for "Asia/Dubai" + // - "11" for "America/Los_Angeles" + // - "12" for "Pacific/Auckland" + // - "13" for "America/Sao_Paulo" + ReportGenerationTimeZoneId int64 `json:"reportGenerationTimeZoneId,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. + // "ExposureToConversionEnabled") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportsConfiguration) MarshalJSON() ([]byte, error) { + type noMethod ReportsConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RichMediaExitOverride: Rich Media Exit Override. +type RichMediaExitOverride struct { + // CustomExitUrl: Click-through URL to override the default exit URL. + // Applicable if the useCustomExitUrl field is set to true. + CustomExitUrl string `json:"customExitUrl,omitempty"` + + // ExitId: ID for the override to refer to a specific exit in the + // creative. + ExitId int64 `json:"exitId,omitempty,string"` + + // UseCustomExitUrl: Whether to use the custom exit URL. + UseCustomExitUrl bool `json:"useCustomExitUrl,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CustomExitUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RichMediaExitOverride) MarshalJSON() ([]byte, error) { + type noMethod RichMediaExitOverride + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Site: Contains properties of a site. +type Site struct { + // AccountId: Account ID of this site. This is a read-only field that + // can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // Approved: Whether this site is approved. + Approved bool `json:"approved,omitempty"` + + // DirectorySiteId: Directory site associated with this site. This is a + // required field that is read-only after insertion. + DirectorySiteId int64 `json:"directorySiteId,omitempty,string"` + + // DirectorySiteIdDimensionValue: Dimension value for the ID of the + // directory site. This is a read-only, auto-generated field. + DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"` + + // Id: ID of this site. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this site. This is a + // read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // KeyName: Key name of this site. This is a read-only, auto-generated + // field. + KeyName string `json:"keyName,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#site". + Kind string `json:"kind,omitempty"` + + // Name: Name of this site.This is a required field. Must be less than + // 128 characters long. If this site is under a subaccount, the name + // must be unique among sites of the same subaccount. Otherwise, this + // site is a top-level site, and the name must be unique among top-level + // sites of the same account. + Name string `json:"name,omitempty"` + + // SiteContacts: Site contacts. + SiteContacts []*SiteContact `json:"siteContacts,omitempty"` + + // SiteSettings: Site-wide settings. + SiteSettings *SiteSettings `json:"siteSettings,omitempty"` + + // SubaccountId: Subaccount ID of this site. This is a read-only field + // that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Site) MarshalJSON() ([]byte, error) { + type noMethod Site + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SiteContact: Site Contact +type SiteContact struct { + // ContactType: Site contact type. + // + // Possible values: + // "SALES_PERSON" + // "TRAFFICKER" + ContactType string `json:"contactType,omitempty"` + + // Email: Email address of this site contact. This is a required field. + Email string `json:"email,omitempty"` + + // FirstName: First name of this site contact. + FirstName string `json:"firstName,omitempty"` + + // Id: ID of this site contact. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // LastName: Last name of this site contact. + LastName string `json:"lastName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ContactType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SiteContact) MarshalJSON() ([]byte, error) { + type noMethod SiteContact + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SiteSettings: Site Settings +type SiteSettings struct { + // ActiveViewOptOut: Whether active view creatives are disabled for this + // site. + ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"` + + // CreativeSettings: Site-wide creative settings. + CreativeSettings *CreativeSettings `json:"creativeSettings,omitempty"` + + // DisableBrandSafeAds: Whether brand safe ads are disabled for this + // site. + DisableBrandSafeAds bool `json:"disableBrandSafeAds,omitempty"` + + // DisableNewCookie: Whether new cookies are disabled for this site. + DisableNewCookie bool `json:"disableNewCookie,omitempty"` + + // LookbackConfiguration: Lookback window settings for this site. + LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"` + + // TagSetting: Configuration settings for dynamic and image floodlight + // tags. + TagSetting *TagSetting `json:"tagSetting,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ActiveViewOptOut") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SiteSettings) MarshalJSON() ([]byte, error) { + type noMethod SiteSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SitesListResponse: Site List Response +type SitesListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#sitesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Sites: Site collection. + Sites []*Site `json:"sites,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SitesListResponse) MarshalJSON() ([]byte, error) { + type noMethod SitesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Size: Represents the dimensions of ads, placements, creatives, or +// creative assets. +type Size struct { + // Height: Height of this size. + Height int64 `json:"height,omitempty"` + + // Iab: IAB standard size. This is a read-only, auto-generated field. + Iab bool `json:"iab,omitempty"` + + // Id: ID of this size. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#size". + Kind string `json:"kind,omitempty"` + + // Width: Width of this size. + Width int64 `json:"width,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Size) MarshalJSON() ([]byte, error) { + type noMethod Size + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SizesListResponse: Size List Response +type SizesListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#sizesListResponse". + Kind string `json:"kind,omitempty"` + + // Sizes: Size collection. + Sizes []*Size `json:"sizes,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SizesListResponse) MarshalJSON() ([]byte, error) { + type noMethod SizesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SortedDimension: Represents a sorted dimension. +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. + // + // Possible values: + // "ASCENDING" + // "DESCENDING" + SortOrder string `json:"sortOrder,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SortedDimension) MarshalJSON() ([]byte, error) { + type noMethod SortedDimension + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Subaccount: Contains properties of a DCM subaccount. +type Subaccount struct { + // AccountId: ID of the account that contains this subaccount. This is a + // read-only field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AvailablePermissionIds: IDs of the available user role permissions + // for this subaccount. + AvailablePermissionIds googleapi.Int64s `json:"availablePermissionIds,omitempty"` + + // Id: ID of this subaccount. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#subaccount". + Kind string `json:"kind,omitempty"` + + // Name: Name of this subaccount. This is a required field. Must be less + // than 128 characters long and be unique among subaccounts of the same + // account. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Subaccount) MarshalJSON() ([]byte, error) { + type noMethod Subaccount + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SubaccountsListResponse: Subaccount List Response +type SubaccountsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#subaccountsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Subaccounts: Subaccount collection. + Subaccounts []*Subaccount `json:"subaccounts,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SubaccountsListResponse) MarshalJSON() ([]byte, error) { + type noMethod SubaccountsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TagData: Placement Tag Data +type TagData struct { + // AdId: Ad associated with this placement tag. + AdId int64 `json:"adId,omitempty,string"` + + // ClickTag: Tag string to record a click. + ClickTag string `json:"clickTag,omitempty"` + + // CreativeId: Creative associated with this placement tag. + CreativeId int64 `json:"creativeId,omitempty,string"` + + // Format: TagData tag format of this tag. + // + // Possible values: + // "PLACEMENT_TAG_CLICK_COMMANDS" + // "PLACEMENT_TAG_IFRAME_ILAYER" + // "PLACEMENT_TAG_IFRAME_JAVASCRIPT" + // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY" + // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH" + // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3" + // "PLACEMENT_TAG_INTERNAL_REDIRECT" + // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT" + // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY" + // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT" + // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT" + // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY" + // "PLACEMENT_TAG_JAVASCRIPT" + // "PLACEMENT_TAG_JAVASCRIPT_LEGACY" + // "PLACEMENT_TAG_STANDARD" + // "PLACEMENT_TAG_TRACKING" + // "PLACEMENT_TAG_TRACKING_IFRAME" + // "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + Format string `json:"format,omitempty"` + + // ImpressionTag: Tag string for serving an ad. + ImpressionTag string `json:"impressionTag,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AdId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TagData) MarshalJSON() ([]byte, error) { + type noMethod TagData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TagSetting: Tag Settings +type TagSetting struct { + // AdditionalKeyValues: Additional key-values to be included in tags. + // Each key-value pair must be of the form key=value, and pairs must be + // separated by a semicolon (;). Keys and values must not contain + // commas. For example, id=2;color=red is a valid value for this field. + AdditionalKeyValues string `json:"additionalKeyValues,omitempty"` + + // IncludeClickThroughUrls: Whether static landing page URLs should be + // included in the tags. This setting applies only to placements. + IncludeClickThroughUrls bool `json:"includeClickThroughUrls,omitempty"` + + // IncludeClickTracking: Whether click-tracking string should be + // included in the tags. + IncludeClickTracking bool `json:"includeClickTracking,omitempty"` + + // KeywordOption: Option specifying how keywords are embedded in ad + // tags. This setting can be used to specify whether keyword + // placeholders are inserted in placement tags for this site. Publishers + // can then add keywords to those placeholders. + // + // Possible values: + // "GENERATE_SEPARATE_TAG_FOR_EACH_KEYWORD" + // "IGNORE" + // "PLACEHOLDER_WITH_LIST_OF_KEYWORDS" + KeywordOption string `json:"keywordOption,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AdditionalKeyValues") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TagSetting) MarshalJSON() ([]byte, error) { + type noMethod TagSetting + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TagSettings: Dynamic and Image Tag Settings. +type TagSettings struct { + // DynamicTagEnabled: Whether dynamic floodlight tags are enabled. + DynamicTagEnabled bool `json:"dynamicTagEnabled,omitempty"` + + // ImageTagEnabled: Whether image tags are enabled. + ImageTagEnabled bool `json:"imageTagEnabled,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DynamicTagEnabled") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TagSettings) MarshalJSON() ([]byte, error) { + type noMethod TagSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetWindow: Target Window. +type TargetWindow struct { + // CustomHtml: User-entered value. + CustomHtml string `json:"customHtml,omitempty"` + + // TargetWindowOption: Type of browser window for which the backup image + // of the flash creative can be displayed. + // + // Possible values: + // "CURRENT_WINDOW" + // "CUSTOM" + // "NEW_WINDOW" + TargetWindowOption string `json:"targetWindowOption,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CustomHtml") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetWindow) MarshalJSON() ([]byte, error) { + type noMethod TargetWindow + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TechnologyTargeting: Technology Targeting. +type TechnologyTargeting struct { + // Browsers: Browsers that this ad targets. For each browser either set + // browserVersionId or dartId along with the version numbers. If both + // are specified, only browserVersionId will be used.The other fields + // are populated automatically when the ad is inserted or updated. + Browsers []*Browser `json:"browsers,omitempty"` + + // ConnectionTypes: Connection types that this ad targets. For each + // connection type only id is required.The other fields are populated + // automatically when the ad is inserted or updated. + ConnectionTypes []*ConnectionType `json:"connectionTypes,omitempty"` + + // MobileCarriers: Mobile carriers that this ad targets. For each mobile + // carrier only id is required, and the other fields are populated + // automatically when the ad is inserted or updated. If targeting a + // mobile carrier, do not set targeting for any zip codes. + MobileCarriers []*MobileCarrier `json:"mobileCarriers,omitempty"` + + // OperatingSystemVersions: Operating system versions that this ad + // targets. To target all versions, use operatingSystems. For each + // operating system version, only id is required. The other fields are + // populated automatically when the ad is inserted or updated. If + // targeting an operating system version, do not set targeting for the + // corresponding operating system in operatingSystems. + OperatingSystemVersions []*OperatingSystemVersion `json:"operatingSystemVersions,omitempty"` + + // OperatingSystems: Operating systems that this ad targets. To target + // specific versions, use operatingSystemVersions. For each operating + // system only dartId is required. The other fields are populated + // automatically when the ad is inserted or updated. If targeting an + // operating system, do not set targeting for operating system versions + // for the same operating system. + OperatingSystems []*OperatingSystem `json:"operatingSystems,omitempty"` + + // PlatformTypes: Platform types that this ad targets. For example, + // desktop, mobile, or tablet. For each platform type, only id is + // required, and the other fields are populated automatically when the + // ad is inserted or updated. + PlatformTypes []*PlatformType `json:"platformTypes,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Browsers") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TechnologyTargeting) MarshalJSON() ([]byte, error) { + type noMethod TechnologyTargeting + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ThirdPartyTrackingUrl: Third-party Tracking URL. +type ThirdPartyTrackingUrl struct { + // ThirdPartyUrlType: Third-party URL type for in-stream video + // creatives. + // + // Possible values: + // "CLICK_TRACKING" + // "IMPRESSION" + // "RICH_MEDIA_BACKUP_IMPRESSION" + // "RICH_MEDIA_IMPRESSION" + // "RICH_MEDIA_RM_IMPRESSION" + // "SURVEY" + // "VIDEO_COMPLETE" + // "VIDEO_CUSTOM" + // "VIDEO_FIRST_QUARTILE" + // "VIDEO_FULLSCREEN" + // "VIDEO_MIDPOINT" + // "VIDEO_MUTE" + // "VIDEO_PAUSE" + // "VIDEO_REWIND" + // "VIDEO_START" + // "VIDEO_STOP" + // "VIDEO_THIRD_QUARTILE" + ThirdPartyUrlType string `json:"thirdPartyUrlType,omitempty"` + + // Url: URL for the specified third-party URL type. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ThirdPartyUrlType") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ThirdPartyTrackingUrl) MarshalJSON() ([]byte, error) { + type noMethod ThirdPartyTrackingUrl + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserDefinedVariableConfiguration: User Defined Variable +// configuration. +type UserDefinedVariableConfiguration struct { + // DataType: Data type for the variable. This is a required field. + // + // Possible values: + // "NUMBER" + // "STRING" + DataType string `json:"dataType,omitempty"` + + // ReportName: User-friendly name for the variable which will appear in + // reports. This is a required field, must be less than 64 characters + // long, and cannot contain the following characters: ""<>". + ReportName string `json:"reportName,omitempty"` + + // VariableType: Variable name in the tag. This is a required field. + // + // Possible values: + // "U1" + // "U10" + // "U11" + // "U12" + // "U13" + // "U14" + // "U15" + // "U16" + // "U17" + // "U18" + // "U19" + // "U2" + // "U20" + // "U3" + // "U4" + // "U5" + // "U6" + // "U7" + // "U8" + // "U9" + VariableType string `json:"variableType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DataType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserDefinedVariableConfiguration) MarshalJSON() ([]byte, error) { + type noMethod UserDefinedVariableConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserProfile: Represents a UserProfile resource. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserProfile) MarshalJSON() ([]byte, error) { + type noMethod UserProfile + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserProfileList: Represents the list of user profiles. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserProfileList) MarshalJSON() ([]byte, error) { + type noMethod UserProfileList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserRole: Contains properties of auser role, which is used to manage +// user access. +type UserRole struct { + // AccountId: Account ID of this user role. This is a read-only field + // that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // DefaultUserRole: Whether this is a default user role. Default user + // roles are created by the system for the account/subaccount and cannot + // be modified or deleted. Each default user role comes with a basic set + // of preassigned permissions. + DefaultUserRole bool `json:"defaultUserRole,omitempty"` + + // Id: ID of this user role. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#userRole". + Kind string `json:"kind,omitempty"` + + // Name: Name of this user role. This is a required field. Must be less + // than 256 characters long. If this user role is under a subaccount, + // the name must be unique among sites of the same subaccount. + // Otherwise, this user role is a top-level user role, and the name must + // be unique among top-level user roles of the same account. + Name string `json:"name,omitempty"` + + // ParentUserRoleId: ID of the user role that this user role is based on + // or copied from. This is a required field. + ParentUserRoleId int64 `json:"parentUserRoleId,omitempty,string"` + + // Permissions: List of permissions associated with this user role. + Permissions []*UserRolePermission `json:"permissions,omitempty"` + + // SubaccountId: Subaccount ID of this user role. This is a read-only + // field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserRole) MarshalJSON() ([]byte, error) { + type noMethod UserRole + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserRolePermission: Contains properties of a user role permission. +type UserRolePermission struct { + // Availability: Levels of availability for a user role permission. + // + // Possible values: + // "ACCOUNT_ALWAYS" + // "ACCOUNT_BY_DEFAULT" + // "NOT_AVAILABLE_BY_DEFAULT" + // "SUBACCOUNT_AND_ACCOUNT_ALWAYS" + // "SUBACCOUNT_AND_ACCOUNT_BY_DEFAULT" + Availability string `json:"availability,omitempty"` + + // Id: ID of this user role permission. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#userRolePermission". + Kind string `json:"kind,omitempty"` + + // Name: Name of this user role permission. + Name string `json:"name,omitempty"` + + // PermissionGroupId: ID of the permission group that this user role + // permission belongs to. + PermissionGroupId int64 `json:"permissionGroupId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Availability") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserRolePermission) MarshalJSON() ([]byte, error) { + type noMethod UserRolePermission + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserRolePermissionGroup: Represents a grouping of related user role +// permissions. +type UserRolePermissionGroup struct { + // Id: ID of this user role permission. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#userRolePermissionGroup". + Kind string `json:"kind,omitempty"` + + // Name: Name of this user role permission group. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserRolePermissionGroup) MarshalJSON() ([]byte, error) { + type noMethod UserRolePermissionGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserRolePermissionGroupsListResponse: User Role Permission Group List +// Response +type UserRolePermissionGroupsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#userRolePermissionGroupsListResponse". + Kind string `json:"kind,omitempty"` + + // UserRolePermissionGroups: User role permission group collection. + UserRolePermissionGroups []*UserRolePermissionGroup `json:"userRolePermissionGroups,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserRolePermissionGroupsListResponse) MarshalJSON() ([]byte, error) { + type noMethod UserRolePermissionGroupsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserRolePermissionsListResponse: User Role Permission List Response +type UserRolePermissionsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#userRolePermissionsListResponse". + Kind string `json:"kind,omitempty"` + + // UserRolePermissions: User role permission collection. + UserRolePermissions []*UserRolePermission `json:"userRolePermissions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserRolePermissionsListResponse) MarshalJSON() ([]byte, error) { + type noMethod UserRolePermissionsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserRolesListResponse: User Role List Response +type UserRolesListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#userRolesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // UserRoles: User role collection. + UserRoles []*UserRole `json:"userRoles,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserRolesListResponse) MarshalJSON() ([]byte, error) { + type noMethod UserRolesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "dfareporting.accountActiveAdSummaries.get": + +type AccountActiveAdSummariesGetCall struct { + s *Service + profileId int64 + summaryAccountId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the account's active ad summary by account ID. +func (r *AccountActiveAdSummariesService) Get(profileId int64, summaryAccountId int64) *AccountActiveAdSummariesGetCall { + c := &AccountActiveAdSummariesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.summaryAccountId = summaryAccountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountActiveAdSummariesGetCall) Fields(s ...googleapi.Field) *AccountActiveAdSummariesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountActiveAdSummariesGetCall) IfNoneMatch(entityTag string) *AccountActiveAdSummariesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountActiveAdSummariesGetCall) Context(ctx context.Context) *AccountActiveAdSummariesGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountActiveAdSummariesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "summaryAccountId": strconv.FormatInt(c.summaryAccountId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountActiveAdSummaries.get" call. +// Exactly one of *AccountActiveAdSummary or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AccountActiveAdSummary.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountActiveAdSummariesGetCall) Do() (*AccountActiveAdSummary, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountActiveAdSummary{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the account's active ad summary by account ID.", + // "httpMethod": "GET", + // "id": "dfareporting.accountActiveAdSummaries.get", + // "parameterOrder": [ + // "profileId", + // "summaryAccountId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "summaryAccountId": { + // "description": "Account ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}", + // "response": { + // "$ref": "AccountActiveAdSummary" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accountPermissionGroups.get": + +type AccountPermissionGroupsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one account permission group by ID. +func (r *AccountPermissionGroupsService) Get(profileId int64, id int64) *AccountPermissionGroupsGetCall { + c := &AccountPermissionGroupsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountPermissionGroupsGetCall) Fields(s ...googleapi.Field) *AccountPermissionGroupsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountPermissionGroupsGetCall) IfNoneMatch(entityTag string) *AccountPermissionGroupsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountPermissionGroupsGetCall) Context(ctx context.Context) *AccountPermissionGroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountPermissionGroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissionGroups/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountPermissionGroups.get" call. +// Exactly one of *AccountPermissionGroup or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AccountPermissionGroup.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountPermissionGroupsGetCall) Do() (*AccountPermissionGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountPermissionGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one account permission group by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.accountPermissionGroups.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Account permission group ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountPermissionGroups/{id}", + // "response": { + // "$ref": "AccountPermissionGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accountPermissionGroups.list": + +type AccountPermissionGroupsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of account permission groups. +func (r *AccountPermissionGroupsService) List(profileId int64) *AccountPermissionGroupsListCall { + c := &AccountPermissionGroupsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountPermissionGroupsListCall) Fields(s ...googleapi.Field) *AccountPermissionGroupsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountPermissionGroupsListCall) IfNoneMatch(entityTag string) *AccountPermissionGroupsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountPermissionGroupsListCall) Context(ctx context.Context) *AccountPermissionGroupsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountPermissionGroupsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissionGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountPermissionGroups.list" call. +// Exactly one of *AccountPermissionGroupsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AccountPermissionGroupsListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AccountPermissionGroupsListCall) Do() (*AccountPermissionGroupsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountPermissionGroupsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of account permission groups.", + // "httpMethod": "GET", + // "id": "dfareporting.accountPermissionGroups.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountPermissionGroups", + // "response": { + // "$ref": "AccountPermissionGroupsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accountPermissions.get": + +type AccountPermissionsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one account permission by ID. +func (r *AccountPermissionsService) Get(profileId int64, id int64) *AccountPermissionsGetCall { + c := &AccountPermissionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountPermissionsGetCall) Fields(s ...googleapi.Field) *AccountPermissionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountPermissionsGetCall) IfNoneMatch(entityTag string) *AccountPermissionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountPermissionsGetCall) Context(ctx context.Context) *AccountPermissionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountPermissionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissions/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountPermissions.get" call. +// Exactly one of *AccountPermission or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AccountPermission.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountPermissionsGetCall) Do() (*AccountPermission, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountPermission{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one account permission by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.accountPermissions.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Account permission ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountPermissions/{id}", + // "response": { + // "$ref": "AccountPermission" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accountPermissions.list": + +type AccountPermissionsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of account permissions. +func (r *AccountPermissionsService) List(profileId int64) *AccountPermissionsListCall { + c := &AccountPermissionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountPermissionsListCall) Fields(s ...googleapi.Field) *AccountPermissionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountPermissionsListCall) IfNoneMatch(entityTag string) *AccountPermissionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountPermissionsListCall) Context(ctx context.Context) *AccountPermissionsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountPermissionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountPermissions.list" call. +// Exactly one of *AccountPermissionsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AccountPermissionsListResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountPermissionsListCall) Do() (*AccountPermissionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountPermissionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of account permissions.", + // "httpMethod": "GET", + // "id": "dfareporting.accountPermissions.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountPermissions", + // "response": { + // "$ref": "AccountPermissionsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accountUserProfiles.get": + +type AccountUserProfilesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one account user profile by ID. +func (r *AccountUserProfilesService) Get(profileId int64, id int64) *AccountUserProfilesGetCall { + c := &AccountUserProfilesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountUserProfilesGetCall) Fields(s ...googleapi.Field) *AccountUserProfilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountUserProfilesGetCall) IfNoneMatch(entityTag string) *AccountUserProfilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountUserProfilesGetCall) Context(ctx context.Context) *AccountUserProfilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountUserProfilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountUserProfiles.get" call. +// Exactly one of *AccountUserProfile or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AccountUserProfile.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountUserProfilesGetCall) Do() (*AccountUserProfile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountUserProfile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one account user profile by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.accountUserProfiles.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "User profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountUserProfiles/{id}", + // "response": { + // "$ref": "AccountUserProfile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accountUserProfiles.list": + +type AccountUserProfilesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of account user profiles, possibly filtered. +func (r *AccountUserProfilesService) List(profileId int64) *AccountUserProfilesListCall { + c := &AccountUserProfilesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Active sets the optional parameter "active": Select only active user +// profiles. +func (c *AccountUserProfilesListCall) Active(active bool) *AccountUserProfilesListCall { + c.opt_["active"] = active + return c +} + +// Ids sets the optional parameter "ids": Select only user profiles with +// these IDs. +func (c *AccountUserProfilesListCall) Ids(ids int64) *AccountUserProfilesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *AccountUserProfilesListCall) MaxResults(maxResults int64) *AccountUserProfilesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *AccountUserProfilesListCall) PageToken(pageToken string) *AccountUserProfilesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name, ID or email. Wildcards (*) are +// allowed. For example, "user profile*2015" will return objects with +// names like "user profile June 2015", "user profile April 2015", or +// simply "user profile 2015". Most of the searches also add wildcards +// implicitly at the start and the end of the search string. For +// example, a search string of "user profile" will match objects with +// name "my user profile", "user profile 2015", or simply "user +// profile". +func (c *AccountUserProfilesListCall) SearchString(searchString string) *AccountUserProfilesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *AccountUserProfilesListCall) SortField(sortField string) *AccountUserProfilesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *AccountUserProfilesListCall) SortOrder(sortOrder string) *AccountUserProfilesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// SubaccountId sets the optional parameter "subaccountId": Select only +// user profiles with the specified subaccount ID. +func (c *AccountUserProfilesListCall) SubaccountId(subaccountId int64) *AccountUserProfilesListCall { + c.opt_["subaccountId"] = subaccountId + return c +} + +// UserRoleId sets the optional parameter "userRoleId": Select only user +// profiles with the specified user role ID. +func (c *AccountUserProfilesListCall) UserRoleId(userRoleId int64) *AccountUserProfilesListCall { + c.opt_["userRoleId"] = userRoleId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountUserProfilesListCall) Fields(s ...googleapi.Field) *AccountUserProfilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountUserProfilesListCall) IfNoneMatch(entityTag string) *AccountUserProfilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountUserProfilesListCall) Context(ctx context.Context) *AccountUserProfilesListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountUserProfilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["active"]; ok { + params.Set("active", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["subaccountId"]; ok { + params.Set("subaccountId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["userRoleId"]; ok { + params.Set("userRoleId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountUserProfiles.list" call. +// Exactly one of *AccountUserProfilesListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AccountUserProfilesListResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountUserProfilesListCall) Do() (*AccountUserProfilesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountUserProfilesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of account user profiles, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.accountUserProfiles.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "active": { + // "description": "Select only active user profiles.", + // "location": "query", + // "type": "boolean" + // }, + // "ids": { + // "description": "Select only user profiles with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, \"user profile*2015\" will return objects with names like \"user profile June 2015\", \"user profile April 2015\", or simply \"user profile 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"user profile\" will match objects with name \"my user profile\", \"user profile 2015\", or simply \"user profile\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "subaccountId": { + // "description": "Select only user profiles with the specified subaccount ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "userRoleId": { + // "description": "Select only user profiles with the specified user role ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountUserProfiles", + // "response": { + // "$ref": "AccountUserProfilesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accountUserProfiles.patch": + +type AccountUserProfilesPatchCall struct { + s *Service + profileId int64 + id int64 + accountuserprofile *AccountUserProfile + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing account user profile. This method supports +// patch semantics. +func (r *AccountUserProfilesService) Patch(profileId int64, id int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesPatchCall { + c := &AccountUserProfilesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.accountuserprofile = accountuserprofile + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountUserProfilesPatchCall) Fields(s ...googleapi.Field) *AccountUserProfilesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountUserProfilesPatchCall) Context(ctx context.Context) *AccountUserProfilesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AccountUserProfilesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountUserProfiles.patch" call. +// Exactly one of *AccountUserProfile or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AccountUserProfile.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountUserProfilesPatchCall) Do() (*AccountUserProfile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountUserProfile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing account user profile. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.accountUserProfiles.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "User profile ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountUserProfiles", + // "request": { + // "$ref": "AccountUserProfile" + // }, + // "response": { + // "$ref": "AccountUserProfile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accountUserProfiles.update": + +type AccountUserProfilesUpdateCall struct { + s *Service + profileId int64 + accountuserprofile *AccountUserProfile + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing account user profile. +func (r *AccountUserProfilesService) Update(profileId int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesUpdateCall { + c := &AccountUserProfilesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.accountuserprofile = accountuserprofile + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountUserProfilesUpdateCall) Fields(s ...googleapi.Field) *AccountUserProfilesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountUserProfilesUpdateCall) Context(ctx context.Context) *AccountUserProfilesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountUserProfilesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountUserProfiles.update" call. +// Exactly one of *AccountUserProfile or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AccountUserProfile.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountUserProfilesUpdateCall) Do() (*AccountUserProfile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountUserProfile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing account user profile.", + // "httpMethod": "PUT", + // "id": "dfareporting.accountUserProfiles.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountUserProfiles", + // "request": { + // "$ref": "AccountUserProfile" + // }, + // "response": { + // "$ref": "AccountUserProfile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accounts.get": + +type AccountsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one account by ID. +func (r *AccountsService) Get(profileId int64, id int64) *AccountsGetCall { + c := &AccountsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accounts.get" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsGetCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one account by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.accounts.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Account ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accounts/{id}", + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accounts.list": + +type AccountsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of accounts, possibly filtered. +func (r *AccountsService) List(profileId int64) *AccountsListCall { + c := &AccountsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Active sets the optional parameter "active": Select only active +// accounts. Don't set this field to select both active and non-active +// accounts. +func (c *AccountsListCall) Active(active bool) *AccountsListCall { + c.opt_["active"] = active + return c +} + +// Ids sets the optional parameter "ids": Select only accounts with +// these IDs. +func (c *AccountsListCall) Ids(ids int64) *AccountsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *AccountsListCall) MaxResults(maxResults int64) *AccountsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "account*2015" will return objects with names like "account +// June 2015", "account April 2015", or simply "account 2015". Most of +// the searches also add wildcards implicitly at the start and the end +// of the search string. For example, a search string of "account" will +// match objects with name "my account", "account 2015", or simply +// "account". +func (c *AccountsListCall) SearchString(searchString string) *AccountsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *AccountsListCall) SortField(sortField string) *AccountsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *AccountsListCall) SortOrder(sortOrder string) *AccountsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["active"]; ok { + params.Set("active", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accounts.list" call. +// Exactly one of *AccountsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AccountsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsListCall) Do() (*AccountsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of accounts, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.accounts.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "active": { + // "description": "Select only active accounts. Don't set this field to select both active and non-active accounts.", + // "location": "query", + // "type": "boolean" + // }, + // "ids": { + // "description": "Select only accounts with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"account*2015\" will return objects with names like \"account June 2015\", \"account April 2015\", or simply \"account 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"account\" will match objects with name \"my account\", \"account 2015\", or simply \"account\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accounts", + // "response": { + // "$ref": "AccountsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accounts.patch": + +type AccountsPatchCall struct { + s *Service + profileId int64 + id int64 + account *Account + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing account. This method supports patch +// semantics. +func (r *AccountsService) Patch(profileId int64, id int64, account *Account) *AccountsPatchCall { + c := &AccountsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.account = account + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsPatchCall) Fields(s ...googleapi.Field) *AccountsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsPatchCall) Context(ctx context.Context) *AccountsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accounts.patch" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsPatchCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing account. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.accounts.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Account ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accounts", + // "request": { + // "$ref": "Account" + // }, + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accounts.update": + +type AccountsUpdateCall struct { + s *Service + profileId int64 + account *Account + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing account. +func (r *AccountsService) Update(profileId int64, account *Account) *AccountsUpdateCall { + c := &AccountsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.account = account + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsUpdateCall) Fields(s ...googleapi.Field) *AccountsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsUpdateCall) Context(ctx context.Context) *AccountsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accounts.update" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsUpdateCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing account.", + // "httpMethod": "PUT", + // "id": "dfareporting.accounts.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accounts", + // "request": { + // "$ref": "Account" + // }, + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.ads.get": + +type AdsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one ad by ID. +func (r *AdsService) Get(profileId int64, id int64) *AdsGetCall { + c := &AdsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdsGetCall) Fields(s ...googleapi.Field) *AdsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdsGetCall) IfNoneMatch(entityTag string) *AdsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdsGetCall) Context(ctx context.Context) *AdsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AdsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.ads.get" call. +// Exactly one of *Ad or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either *Ad.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AdsGetCall) Do() (*Ad, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Ad{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one ad by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.ads.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Ad ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/ads/{id}", + // "response": { + // "$ref": "Ad" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.ads.insert": + +type AdsInsertCall struct { + s *Service + profileId int64 + ad *Ad + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new ad. +func (r *AdsService) Insert(profileId int64, ad *Ad) *AdsInsertCall { + c := &AdsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.ad = ad + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdsInsertCall) Fields(s ...googleapi.Field) *AdsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdsInsertCall) Context(ctx context.Context) *AdsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *AdsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.ads.insert" call. +// Exactly one of *Ad or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either *Ad.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AdsInsertCall) Do() (*Ad, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Ad{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new ad.", + // "httpMethod": "POST", + // "id": "dfareporting.ads.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/ads", + // "request": { + // "$ref": "Ad" + // }, + // "response": { + // "$ref": "Ad" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.ads.list": + +type AdsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of ads, possibly filtered. +func (r *AdsService) List(profileId int64) *AdsListCall { + c := &AdsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Active sets the optional parameter "active": Select only active ads. +func (c *AdsListCall) Active(active bool) *AdsListCall { + c.opt_["active"] = active + return c +} + +// AdvertiserId sets the optional parameter "advertiserId": Select only +// ads with this advertiser ID. +func (c *AdsListCall) AdvertiserId(advertiserId int64) *AdsListCall { + c.opt_["advertiserId"] = advertiserId + return c +} + +// Archived sets the optional parameter "archived": Select only archived +// ads. +func (c *AdsListCall) Archived(archived bool) *AdsListCall { + c.opt_["archived"] = archived + return c +} + +// AudienceSegmentIds sets the optional parameter "audienceSegmentIds": +// Select only ads with these audience segment IDs. +func (c *AdsListCall) AudienceSegmentIds(audienceSegmentIds int64) *AdsListCall { + c.opt_["audienceSegmentIds"] = audienceSegmentIds + return c +} + +// CampaignIds sets the optional parameter "campaignIds": Select only +// ads with these campaign IDs. +func (c *AdsListCall) CampaignIds(campaignIds int64) *AdsListCall { + c.opt_["campaignIds"] = campaignIds + return c +} + +// Compatibility sets the optional parameter "compatibility": Select +// default ads with the specified compatibility. Applicable when type is +// AD_SERVING_DEFAULT_AD. WEB and WEB_INTERSTITIAL refer to rendering +// either on desktop or on mobile devices for regular or interstitial +// ads, respectively. APP and APP_INTERSTITIAL are for rendering in +// mobile apps. IN_STREAM_VIDEO refers to rendering an in-stream video +// ads developed with the VAST standard. +// +// Possible values: +// "APP" +// "APP_INTERSTITIAL" +// "IN_STREAM_VIDEO" +// "WEB" +// "WEB_INTERSTITIAL" +func (c *AdsListCall) Compatibility(compatibility string) *AdsListCall { + c.opt_["compatibility"] = compatibility + return c +} + +// CreativeIds sets the optional parameter "creativeIds": Select only +// ads with these creative IDs assigned. +func (c *AdsListCall) CreativeIds(creativeIds int64) *AdsListCall { + c.opt_["creativeIds"] = creativeIds + return c +} + +// CreativeOptimizationConfigurationIds sets the optional parameter +// "creativeOptimizationConfigurationIds": Select only ads with these +// creative optimization configuration IDs. +func (c *AdsListCall) CreativeOptimizationConfigurationIds(creativeOptimizationConfigurationIds int64) *AdsListCall { + c.opt_["creativeOptimizationConfigurationIds"] = creativeOptimizationConfigurationIds + return c +} + +// CreativeType sets the optional parameter "creativeType": Select only +// ads with the specified creativeType. +// +// Possible values: +// "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO" +// "CUSTOM_INPAGE" +// "CUSTOM_INTERSTITIAL" +// "ENHANCED_BANNER" +// "ENHANCED_IMAGE" +// "FLASH_INPAGE" +// "HTML5_BANNER" +// "IMAGE" +// "INSTREAM_VIDEO" +// "INTERNAL_REDIRECT" +// "INTERSTITIAL_INTERNAL_REDIRECT" +// "REDIRECT" +// "RICH_MEDIA_EXPANDING" +// "RICH_MEDIA_IM_EXPAND" +// "RICH_MEDIA_INPAGE" +// "RICH_MEDIA_INPAGE_FLOATING" +// "RICH_MEDIA_INTERSTITIAL_FLOAT" +// "RICH_MEDIA_MOBILE_IN_APP" +// "RICH_MEDIA_MULTI_FLOATING" +// "RICH_MEDIA_PEEL_DOWN" +// "TRACKING_TEXT" +// "VAST_REDIRECT" +// "VPAID_LINEAR" +// "VPAID_NON_LINEAR" +func (c *AdsListCall) CreativeType(creativeType string) *AdsListCall { + c.opt_["creativeType"] = creativeType + return c +} + +// DynamicClickTracker sets the optional parameter +// "dynamicClickTracker": Select only dynamic click trackers. Applicable +// when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click +// trackers. If false, select static click trackers. Leave unset to +// select both. +func (c *AdsListCall) DynamicClickTracker(dynamicClickTracker bool) *AdsListCall { + c.opt_["dynamicClickTracker"] = dynamicClickTracker + return c +} + +// Ids sets the optional parameter "ids": Select only ads with these +// IDs. +func (c *AdsListCall) Ids(ids int64) *AdsListCall { + c.opt_["ids"] = ids + return c +} + +// LandingPageIds sets the optional parameter "landingPageIds": Select +// only ads with these landing page IDs. +func (c *AdsListCall) LandingPageIds(landingPageIds int64) *AdsListCall { + c.opt_["landingPageIds"] = landingPageIds + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *AdsListCall) MaxResults(maxResults int64) *AdsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OverriddenEventTagId sets the optional parameter +// "overriddenEventTagId": Select only ads with this event tag override +// ID. +func (c *AdsListCall) OverriddenEventTagId(overriddenEventTagId int64) *AdsListCall { + c.opt_["overriddenEventTagId"] = overriddenEventTagId + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *AdsListCall) PageToken(pageToken string) *AdsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// PlacementIds sets the optional parameter "placementIds": Select only +// ads with these placement IDs assigned. +func (c *AdsListCall) PlacementIds(placementIds int64) *AdsListCall { + c.opt_["placementIds"] = placementIds + return c +} + +// RemarketingListIds sets the optional parameter "remarketingListIds": +// Select only ads whose list targeting expression use these remarketing +// list IDs. +func (c *AdsListCall) RemarketingListIds(remarketingListIds int64) *AdsListCall { + c.opt_["remarketingListIds"] = remarketingListIds + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "ad*2015" will return objects with names like "ad June +// 2015", "ad April 2015", or simply "ad 2015". Most of the searches +// also add wildcards implicitly at the start and the end of the search +// string. For example, a search string of "ad" will match objects with +// name "my ad", "ad 2015", or simply "ad". +func (c *AdsListCall) SearchString(searchString string) *AdsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SizeIds sets the optional parameter "sizeIds": Select only ads with +// these size IDs. +func (c *AdsListCall) SizeIds(sizeIds int64) *AdsListCall { + c.opt_["sizeIds"] = sizeIds + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *AdsListCall) SortField(sortField string) *AdsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *AdsListCall) SortOrder(sortOrder string) *AdsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// SslCompliant sets the optional parameter "sslCompliant": Select only +// ads that are SSL-compliant. +func (c *AdsListCall) SslCompliant(sslCompliant bool) *AdsListCall { + c.opt_["sslCompliant"] = sslCompliant + return c +} + +// SslRequired sets the optional parameter "sslRequired": Select only +// ads that require SSL. +func (c *AdsListCall) SslRequired(sslRequired bool) *AdsListCall { + c.opt_["sslRequired"] = sslRequired + return c +} + +// Type sets the optional parameter "type": Select only ads with these +// types. +// +// Possible values: +// "AD_SERVING_CLICK_TRACKER" +// "AD_SERVING_DEFAULT_AD" +// "AD_SERVING_STANDARD_AD" +// "AD_SERVING_TRACKING" +func (c *AdsListCall) Type(type_ string) *AdsListCall { + c.opt_["type"] = type_ + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdsListCall) Fields(s ...googleapi.Field) *AdsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdsListCall) IfNoneMatch(entityTag string) *AdsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdsListCall) Context(ctx context.Context) *AdsListCall { + c.ctx_ = ctx + return c +} + +func (c *AdsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["active"]; ok { + params.Set("active", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["advertiserId"]; ok { + params.Set("advertiserId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["archived"]; ok { + params.Set("archived", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["audienceSegmentIds"]; ok { + params.Set("audienceSegmentIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["campaignIds"]; ok { + params.Set("campaignIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["compatibility"]; ok { + params.Set("compatibility", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["creativeIds"]; ok { + params.Set("creativeIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["creativeOptimizationConfigurationIds"]; ok { + params.Set("creativeOptimizationConfigurationIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["creativeType"]; ok { + params.Set("creativeType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["dynamicClickTracker"]; ok { + params.Set("dynamicClickTracker", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["landingPageIds"]; ok { + params.Set("landingPageIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["overriddenEventTagId"]; ok { + params.Set("overriddenEventTagId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["placementIds"]; ok { + params.Set("placementIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["remarketingListIds"]; ok { + params.Set("remarketingListIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sizeIds"]; ok { + params.Set("sizeIds", 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)) + } + if v, ok := c.opt_["sslCompliant"]; ok { + params.Set("sslCompliant", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sslRequired"]; ok { + params.Set("sslRequired", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["type"]; ok { + params.Set("type", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.ads.list" call. +// Exactly one of *AdsListResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AdsListResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AdsListCall) Do() (*AdsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of ads, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.ads.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "active": { + // "description": "Select only active ads.", + // "location": "query", + // "type": "boolean" + // }, + // "advertiserId": { + // "description": "Select only ads with this advertiser ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "archived": { + // "description": "Select only archived ads.", + // "location": "query", + // "type": "boolean" + // }, + // "audienceSegmentIds": { + // "description": "Select only ads with these audience segment IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "campaignIds": { + // "description": "Select only ads with these campaign IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "compatibility": { + // "description": "Select default ads with the specified compatibility. Applicable when type is AD_SERVING_DEFAULT_AD. WEB and WEB_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering an in-stream video ads developed with the VAST standard.", + // "enum": [ + // "APP", + // "APP_INTERSTITIAL", + // "IN_STREAM_VIDEO", + // "WEB", + // "WEB_INTERSTITIAL" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "creativeIds": { + // "description": "Select only ads with these creative IDs assigned.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "creativeOptimizationConfigurationIds": { + // "description": "Select only ads with these creative optimization configuration IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "creativeType": { + // "description": "Select only ads with the specified creativeType.", + // "enum": [ + // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO", + // "CUSTOM_INPAGE", + // "CUSTOM_INTERSTITIAL", + // "ENHANCED_BANNER", + // "ENHANCED_IMAGE", + // "FLASH_INPAGE", + // "HTML5_BANNER", + // "IMAGE", + // "INSTREAM_VIDEO", + // "INTERNAL_REDIRECT", + // "INTERSTITIAL_INTERNAL_REDIRECT", + // "REDIRECT", + // "RICH_MEDIA_EXPANDING", + // "RICH_MEDIA_IM_EXPAND", + // "RICH_MEDIA_INPAGE", + // "RICH_MEDIA_INPAGE_FLOATING", + // "RICH_MEDIA_INTERSTITIAL_FLOAT", + // "RICH_MEDIA_MOBILE_IN_APP", + // "RICH_MEDIA_MULTI_FLOATING", + // "RICH_MEDIA_PEEL_DOWN", + // "TRACKING_TEXT", + // "VAST_REDIRECT", + // "VPAID_LINEAR", + // "VPAID_NON_LINEAR" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "dynamicClickTracker": { + // "description": "Select only dynamic click trackers. Applicable when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click trackers. If false, select static click trackers. Leave unset to select both.", + // "location": "query", + // "type": "boolean" + // }, + // "ids": { + // "description": "Select only ads with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "landingPageIds": { + // "description": "Select only ads with these landing page IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "overriddenEventTagId": { + // "description": "Select only ads with this event tag override ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "placementIds": { + // "description": "Select only ads with these placement IDs assigned.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "remarketingListIds": { + // "description": "Select only ads whose list targeting expression use these remarketing list IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"ad*2015\" will return objects with names like \"ad June 2015\", \"ad April 2015\", or simply \"ad 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"ad\" will match objects with name \"my ad\", \"ad 2015\", or simply \"ad\".", + // "location": "query", + // "type": "string" + // }, + // "sizeIds": { + // "description": "Select only ads with these size IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sslCompliant": { + // "description": "Select only ads that are SSL-compliant.", + // "location": "query", + // "type": "boolean" + // }, + // "sslRequired": { + // "description": "Select only ads that require SSL.", + // "location": "query", + // "type": "boolean" + // }, + // "type": { + // "description": "Select only ads with these types.", + // "enum": [ + // "AD_SERVING_CLICK_TRACKER", + // "AD_SERVING_DEFAULT_AD", + // "AD_SERVING_STANDARD_AD", + // "AD_SERVING_TRACKING" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/ads", + // "response": { + // "$ref": "AdsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.ads.patch": + +type AdsPatchCall struct { + s *Service + profileId int64 + id int64 + ad *Ad + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing ad. This method supports patch semantics. +func (r *AdsService) Patch(profileId int64, id int64, ad *Ad) *AdsPatchCall { + c := &AdsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.ad = ad + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdsPatchCall) Fields(s ...googleapi.Field) *AdsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdsPatchCall) Context(ctx context.Context) *AdsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AdsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.ads.patch" call. +// Exactly one of *Ad or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either *Ad.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AdsPatchCall) Do() (*Ad, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Ad{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing ad. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.ads.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Ad ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/ads", + // "request": { + // "$ref": "Ad" + // }, + // "response": { + // "$ref": "Ad" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.ads.update": + +type AdsUpdateCall struct { + s *Service + profileId int64 + ad *Ad + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing ad. +func (r *AdsService) Update(profileId int64, ad *Ad) *AdsUpdateCall { + c := &AdsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.ad = ad + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdsUpdateCall) Fields(s ...googleapi.Field) *AdsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdsUpdateCall) Context(ctx context.Context) *AdsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AdsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.ads.update" call. +// Exactly one of *Ad or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either *Ad.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AdsUpdateCall) Do() (*Ad, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Ad{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing ad.", + // "httpMethod": "PUT", + // "id": "dfareporting.ads.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/ads", + // "request": { + // "$ref": "Ad" + // }, + // "response": { + // "$ref": "Ad" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertiserGroups.delete": + +type AdvertiserGroupsDeleteCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing advertiser group. +func (r *AdvertiserGroupsService) Delete(profileId int64, id int64) *AdvertiserGroupsDeleteCall { + c := &AdvertiserGroupsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertiserGroupsDeleteCall) Fields(s ...googleapi.Field) *AdvertiserGroupsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertiserGroupsDeleteCall) Context(ctx context.Context) *AdvertiserGroupsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertiserGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertiserGroups.delete" call. +func (c *AdvertiserGroupsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing advertiser group.", + // "httpMethod": "DELETE", + // "id": "dfareporting.advertiserGroups.delete", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Advertiser group ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertiserGroups/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertiserGroups.get": + +type AdvertiserGroupsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one advertiser group by ID. +func (r *AdvertiserGroupsService) Get(profileId int64, id int64) *AdvertiserGroupsGetCall { + c := &AdvertiserGroupsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertiserGroupsGetCall) Fields(s ...googleapi.Field) *AdvertiserGroupsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdvertiserGroupsGetCall) IfNoneMatch(entityTag string) *AdvertiserGroupsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertiserGroupsGetCall) Context(ctx context.Context) *AdvertiserGroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertiserGroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertiserGroups.get" call. +// Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AdvertiserGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AdvertiserGroupsGetCall) Do() (*AdvertiserGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdvertiserGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one advertiser group by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.advertiserGroups.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Advertiser group ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertiserGroups/{id}", + // "response": { + // "$ref": "AdvertiserGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertiserGroups.insert": + +type AdvertiserGroupsInsertCall struct { + s *Service + profileId int64 + advertisergroup *AdvertiserGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new advertiser group. +func (r *AdvertiserGroupsService) Insert(profileId int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsInsertCall { + c := &AdvertiserGroupsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.advertisergroup = advertisergroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertiserGroupsInsertCall) Fields(s ...googleapi.Field) *AdvertiserGroupsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertiserGroupsInsertCall) Context(ctx context.Context) *AdvertiserGroupsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertiserGroupsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertiserGroups.insert" call. +// Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AdvertiserGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AdvertiserGroupsInsertCall) Do() (*AdvertiserGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdvertiserGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new advertiser group.", + // "httpMethod": "POST", + // "id": "dfareporting.advertiserGroups.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertiserGroups", + // "request": { + // "$ref": "AdvertiserGroup" + // }, + // "response": { + // "$ref": "AdvertiserGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertiserGroups.list": + +type AdvertiserGroupsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of advertiser groups, possibly filtered. +func (r *AdvertiserGroupsService) List(profileId int64) *AdvertiserGroupsListCall { + c := &AdvertiserGroupsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Ids sets the optional parameter "ids": Select only advertiser groups +// with these IDs. +func (c *AdvertiserGroupsListCall) Ids(ids int64) *AdvertiserGroupsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *AdvertiserGroupsListCall) MaxResults(maxResults int64) *AdvertiserGroupsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *AdvertiserGroupsListCall) PageToken(pageToken string) *AdvertiserGroupsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "advertiser*2015" will return objects with names like +// "advertiser group June 2015", "advertiser group April 2015", or +// simply "advertiser group 2015". Most of the searches also add +// wildcards implicitly at the start and the end of the search string. +// For example, a search string of "advertisergroup" will match objects +// with name "my advertisergroup", "advertisergroup 2015", or simply +// "advertisergroup". +func (c *AdvertiserGroupsListCall) SearchString(searchString string) *AdvertiserGroupsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *AdvertiserGroupsListCall) SortField(sortField string) *AdvertiserGroupsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *AdvertiserGroupsListCall) SortOrder(sortOrder string) *AdvertiserGroupsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertiserGroupsListCall) Fields(s ...googleapi.Field) *AdvertiserGroupsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdvertiserGroupsListCall) IfNoneMatch(entityTag string) *AdvertiserGroupsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertiserGroupsListCall) Context(ctx context.Context) *AdvertiserGroupsListCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertiserGroupsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertiserGroups.list" call. +// Exactly one of *AdvertiserGroupsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AdvertiserGroupsListResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AdvertiserGroupsListCall) Do() (*AdvertiserGroupsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdvertiserGroupsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of advertiser groups, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.advertiserGroups.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "ids": { + // "description": "Select only advertiser groups with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"advertiser*2015\" will return objects with names like \"advertiser group June 2015\", \"advertiser group April 2015\", or simply \"advertiser group 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"advertisergroup\" will match objects with name \"my advertisergroup\", \"advertisergroup 2015\", or simply \"advertisergroup\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertiserGroups", + // "response": { + // "$ref": "AdvertiserGroupsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertiserGroups.patch": + +type AdvertiserGroupsPatchCall struct { + s *Service + profileId int64 + id int64 + advertisergroup *AdvertiserGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing advertiser group. This method supports +// patch semantics. +func (r *AdvertiserGroupsService) Patch(profileId int64, id int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsPatchCall { + c := &AdvertiserGroupsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.advertisergroup = advertisergroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertiserGroupsPatchCall) Fields(s ...googleapi.Field) *AdvertiserGroupsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertiserGroupsPatchCall) Context(ctx context.Context) *AdvertiserGroupsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertiserGroupsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertiserGroups.patch" call. +// Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AdvertiserGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AdvertiserGroupsPatchCall) Do() (*AdvertiserGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdvertiserGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing advertiser group. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.advertiserGroups.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Advertiser group ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertiserGroups", + // "request": { + // "$ref": "AdvertiserGroup" + // }, + // "response": { + // "$ref": "AdvertiserGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertiserGroups.update": + +type AdvertiserGroupsUpdateCall struct { + s *Service + profileId int64 + advertisergroup *AdvertiserGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing advertiser group. +func (r *AdvertiserGroupsService) Update(profileId int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsUpdateCall { + c := &AdvertiserGroupsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.advertisergroup = advertisergroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertiserGroupsUpdateCall) Fields(s ...googleapi.Field) *AdvertiserGroupsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertiserGroupsUpdateCall) Context(ctx context.Context) *AdvertiserGroupsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertiserGroupsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertiserGroups.update" call. +// Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AdvertiserGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AdvertiserGroupsUpdateCall) Do() (*AdvertiserGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdvertiserGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing advertiser group.", + // "httpMethod": "PUT", + // "id": "dfareporting.advertiserGroups.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertiserGroups", + // "request": { + // "$ref": "AdvertiserGroup" + // }, + // "response": { + // "$ref": "AdvertiserGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertisers.get": + +type AdvertisersGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one advertiser by ID. +func (r *AdvertisersService) Get(profileId int64, id int64) *AdvertisersGetCall { + c := &AdvertisersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertisersGetCall) Fields(s ...googleapi.Field) *AdvertisersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdvertisersGetCall) IfNoneMatch(entityTag string) *AdvertisersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertisersGetCall) Context(ctx context.Context) *AdvertisersGetCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertisersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertisers.get" call. +// Exactly one of *Advertiser or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Advertiser.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AdvertisersGetCall) Do() (*Advertiser, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Advertiser{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one advertiser by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.advertisers.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Advertiser ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertisers/{id}", + // "response": { + // "$ref": "Advertiser" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertisers.insert": + +type AdvertisersInsertCall struct { + s *Service + profileId int64 + advertiser *Advertiser + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new advertiser. +func (r *AdvertisersService) Insert(profileId int64, advertiser *Advertiser) *AdvertisersInsertCall { + c := &AdvertisersInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.advertiser = advertiser + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertisersInsertCall) Fields(s ...googleapi.Field) *AdvertisersInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertisersInsertCall) Context(ctx context.Context) *AdvertisersInsertCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertisersInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertisers.insert" call. +// Exactly one of *Advertiser or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Advertiser.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AdvertisersInsertCall) Do() (*Advertiser, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Advertiser{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new advertiser.", + // "httpMethod": "POST", + // "id": "dfareporting.advertisers.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertisers", + // "request": { + // "$ref": "Advertiser" + // }, + // "response": { + // "$ref": "Advertiser" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertisers.list": + +type AdvertisersListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of advertisers, possibly filtered. +func (r *AdvertisersService) List(profileId int64) *AdvertisersListCall { + c := &AdvertisersListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdvertiserGroupIds sets the optional parameter "advertiserGroupIds": +// Select only advertisers with these advertiser group IDs. +func (c *AdvertisersListCall) AdvertiserGroupIds(advertiserGroupIds int64) *AdvertisersListCall { + c.opt_["advertiserGroupIds"] = advertiserGroupIds + return c +} + +// FloodlightConfigurationIds sets the optional parameter +// "floodlightConfigurationIds": Select only advertisers with these +// floodlight configuration IDs. +func (c *AdvertisersListCall) FloodlightConfigurationIds(floodlightConfigurationIds int64) *AdvertisersListCall { + c.opt_["floodlightConfigurationIds"] = floodlightConfigurationIds + return c +} + +// Ids sets the optional parameter "ids": Select only advertisers with +// these IDs. +func (c *AdvertisersListCall) Ids(ids int64) *AdvertisersListCall { + c.opt_["ids"] = ids + return c +} + +// IncludeAdvertisersWithoutGroupsOnly sets the optional parameter +// "includeAdvertisersWithoutGroupsOnly": Select only advertisers which +// do not belong to any advertiser group. +func (c *AdvertisersListCall) IncludeAdvertisersWithoutGroupsOnly(includeAdvertisersWithoutGroupsOnly bool) *AdvertisersListCall { + c.opt_["includeAdvertisersWithoutGroupsOnly"] = includeAdvertisersWithoutGroupsOnly + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *AdvertisersListCall) MaxResults(maxResults int64) *AdvertisersListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OnlyParent sets the optional parameter "onlyParent": Select only +// advertisers which use another advertiser's floodlight configuration. +func (c *AdvertisersListCall) OnlyParent(onlyParent bool) *AdvertisersListCall { + c.opt_["onlyParent"] = onlyParent + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *AdvertisersListCall) PageToken(pageToken string) *AdvertisersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "advertiser*2015" will return objects with names like +// "advertiser June 2015", "advertiser April 2015", or simply +// "advertiser 2015". Most of the searches also add wildcards implicitly +// at the start and the end of the search string. For example, a search +// string of "advertiser" will match objects with name "my advertiser", +// "advertiser 2015", or simply "advertiser". +func (c *AdvertisersListCall) SearchString(searchString string) *AdvertisersListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *AdvertisersListCall) SortField(sortField string) *AdvertisersListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *AdvertisersListCall) SortOrder(sortOrder string) *AdvertisersListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Status sets the optional parameter "status": Select only advertisers +// with the specified status. +// +// Possible values: +// "APPROVED" +// "ON_HOLD" +func (c *AdvertisersListCall) Status(status string) *AdvertisersListCall { + c.opt_["status"] = status + return c +} + +// SubaccountId sets the optional parameter "subaccountId": Select only +// advertisers with these subaccount IDs. +func (c *AdvertisersListCall) SubaccountId(subaccountId int64) *AdvertisersListCall { + c.opt_["subaccountId"] = subaccountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertisersListCall) Fields(s ...googleapi.Field) *AdvertisersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdvertisersListCall) IfNoneMatch(entityTag string) *AdvertisersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertisersListCall) Context(ctx context.Context) *AdvertisersListCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertisersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserGroupIds"]; ok { + params.Set("advertiserGroupIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["floodlightConfigurationIds"]; ok { + params.Set("floodlightConfigurationIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["includeAdvertisersWithoutGroupsOnly"]; ok { + params.Set("includeAdvertisersWithoutGroupsOnly", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["onlyParent"]; ok { + params.Set("onlyParent", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["status"]; ok { + params.Set("status", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["subaccountId"]; ok { + params.Set("subaccountId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertisers.list" call. +// Exactly one of *AdvertisersListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AdvertisersListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AdvertisersListCall) Do() (*AdvertisersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdvertisersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of advertisers, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.advertisers.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "advertiserGroupIds": { + // "description": "Select only advertisers with these advertiser group IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "floodlightConfigurationIds": { + // "description": "Select only advertisers with these floodlight configuration IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only advertisers with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "includeAdvertisersWithoutGroupsOnly": { + // "description": "Select only advertisers which do not belong to any advertiser group.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "onlyParent": { + // "description": "Select only advertisers which use another advertiser's floodlight configuration.", + // "location": "query", + // "type": "boolean" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"advertiser*2015\" will return objects with names like \"advertiser June 2015\", \"advertiser April 2015\", or simply \"advertiser 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"advertiser\" will match objects with name \"my advertiser\", \"advertiser 2015\", or simply \"advertiser\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "status": { + // "description": "Select only advertisers with the specified status.", + // "enum": [ + // "APPROVED", + // "ON_HOLD" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "subaccountId": { + // "description": "Select only advertisers with these subaccount IDs.", + // "format": "int64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertisers", + // "response": { + // "$ref": "AdvertisersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertisers.patch": + +type AdvertisersPatchCall struct { + s *Service + profileId int64 + id int64 + advertiser *Advertiser + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing advertiser. This method supports patch +// semantics. +func (r *AdvertisersService) Patch(profileId int64, id int64, advertiser *Advertiser) *AdvertisersPatchCall { + c := &AdvertisersPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.advertiser = advertiser + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertisersPatchCall) Fields(s ...googleapi.Field) *AdvertisersPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertisersPatchCall) Context(ctx context.Context) *AdvertisersPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertisersPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertisers.patch" call. +// Exactly one of *Advertiser or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Advertiser.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AdvertisersPatchCall) Do() (*Advertiser, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Advertiser{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing advertiser. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.advertisers.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Advertiser ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertisers", + // "request": { + // "$ref": "Advertiser" + // }, + // "response": { + // "$ref": "Advertiser" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertisers.update": + +type AdvertisersUpdateCall struct { + s *Service + profileId int64 + advertiser *Advertiser + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing advertiser. +func (r *AdvertisersService) Update(profileId int64, advertiser *Advertiser) *AdvertisersUpdateCall { + c := &AdvertisersUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.advertiser = advertiser + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertisersUpdateCall) Fields(s ...googleapi.Field) *AdvertisersUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertisersUpdateCall) Context(ctx context.Context) *AdvertisersUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertisersUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertisers.update" call. +// Exactly one of *Advertiser or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Advertiser.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AdvertisersUpdateCall) Do() (*Advertiser, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Advertiser{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing advertiser.", + // "httpMethod": "PUT", + // "id": "dfareporting.advertisers.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertisers", + // "request": { + // "$ref": "Advertiser" + // }, + // "response": { + // "$ref": "Advertiser" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.browsers.list": + +type BrowsersListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of browsers. +func (r *BrowsersService) List(profileId int64) *BrowsersListCall { + c := &BrowsersListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BrowsersListCall) Fields(s ...googleapi.Field) *BrowsersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BrowsersListCall) IfNoneMatch(entityTag string) *BrowsersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BrowsersListCall) Context(ctx context.Context) *BrowsersListCall { + c.ctx_ = ctx + return c +} + +func (c *BrowsersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/browsers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.browsers.list" call. +// Exactly one of *BrowsersListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BrowsersListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BrowsersListCall) Do() (*BrowsersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BrowsersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of browsers.", + // "httpMethod": "GET", + // "id": "dfareporting.browsers.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/browsers", + // "response": { + // "$ref": "BrowsersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.campaignCreativeAssociations.insert": + +type CampaignCreativeAssociationsInsertCall struct { + s *Service + profileId int64 + campaignId int64 + campaigncreativeassociation *CampaignCreativeAssociation + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Associates a creative with the specified campaign. This +// method creates a default ad with dimensions matching the creative in +// the campaign if such a default ad does not exist already. +func (r *CampaignCreativeAssociationsService) Insert(profileId int64, campaignId int64, campaigncreativeassociation *CampaignCreativeAssociation) *CampaignCreativeAssociationsInsertCall { + c := &CampaignCreativeAssociationsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaignId = campaignId + c.campaigncreativeassociation = campaigncreativeassociation + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CampaignCreativeAssociationsInsertCall) Fields(s ...googleapi.Field) *CampaignCreativeAssociationsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CampaignCreativeAssociationsInsertCall) Context(ctx context.Context) *CampaignCreativeAssociationsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CampaignCreativeAssociationsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaigncreativeassociation) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "campaignId": strconv.FormatInt(c.campaignId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.campaignCreativeAssociations.insert" call. +// Exactly one of *CampaignCreativeAssociation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *CampaignCreativeAssociation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CampaignCreativeAssociationsInsertCall) Do() (*CampaignCreativeAssociation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CampaignCreativeAssociation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Associates a creative with the specified campaign. This method creates a default ad with dimensions matching the creative in the campaign if such a default ad does not exist already.", + // "httpMethod": "POST", + // "id": "dfareporting.campaignCreativeAssociations.insert", + // "parameterOrder": [ + // "profileId", + // "campaignId" + // ], + // "parameters": { + // "campaignId": { + // "description": "Campaign ID in this association.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations", + // "request": { + // "$ref": "CampaignCreativeAssociation" + // }, + // "response": { + // "$ref": "CampaignCreativeAssociation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.campaignCreativeAssociations.list": + +type CampaignCreativeAssociationsListCall struct { + s *Service + profileId int64 + campaignId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of creative IDs associated with the +// specified campaign. +func (r *CampaignCreativeAssociationsService) List(profileId int64, campaignId int64) *CampaignCreativeAssociationsListCall { + c := &CampaignCreativeAssociationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaignId = campaignId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *CampaignCreativeAssociationsListCall) MaxResults(maxResults int64) *CampaignCreativeAssociationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *CampaignCreativeAssociationsListCall) PageToken(pageToken string) *CampaignCreativeAssociationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *CampaignCreativeAssociationsListCall) SortOrder(sortOrder string) *CampaignCreativeAssociationsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CampaignCreativeAssociationsListCall) Fields(s ...googleapi.Field) *CampaignCreativeAssociationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CampaignCreativeAssociationsListCall) IfNoneMatch(entityTag string) *CampaignCreativeAssociationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CampaignCreativeAssociationsListCall) Context(ctx context.Context) *CampaignCreativeAssociationsListCall { + c.ctx_ = ctx + return c +} + +func (c *CampaignCreativeAssociationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "campaignId": strconv.FormatInt(c.campaignId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.campaignCreativeAssociations.list" call. +// Exactly one of *CampaignCreativeAssociationsListResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *CampaignCreativeAssociationsListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *CampaignCreativeAssociationsListCall) Do() (*CampaignCreativeAssociationsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CampaignCreativeAssociationsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of creative IDs associated with the specified campaign.", + // "httpMethod": "GET", + // "id": "dfareporting.campaignCreativeAssociations.list", + // "parameterOrder": [ + // "profileId", + // "campaignId" + // ], + // "parameters": { + // "campaignId": { + // "description": "Campaign ID in this association.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations", + // "response": { + // "$ref": "CampaignCreativeAssociationsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.campaigns.get": + +type CampaignsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one campaign by ID. +func (r *CampaignsService) Get(profileId int64, id int64) *CampaignsGetCall { + c := &CampaignsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CampaignsGetCall) Fields(s ...googleapi.Field) *CampaignsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CampaignsGetCall) IfNoneMatch(entityTag string) *CampaignsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CampaignsGetCall) Context(ctx context.Context) *CampaignsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CampaignsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.campaigns.get" call. +// Exactly one of *Campaign or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Campaign.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CampaignsGetCall) Do() (*Campaign, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Campaign{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one campaign by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.campaigns.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Campaign ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{id}", + // "response": { + // "$ref": "Campaign" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.campaigns.insert": + +type CampaignsInsertCall struct { + s *Service + profileId int64 + defaultLandingPageName string + defaultLandingPageUrl string + campaign *Campaign + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new campaign. +func (r *CampaignsService) Insert(profileId int64, defaultLandingPageName string, defaultLandingPageUrl string, campaign *Campaign) *CampaignsInsertCall { + c := &CampaignsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.defaultLandingPageName = defaultLandingPageName + c.defaultLandingPageUrl = defaultLandingPageUrl + c.campaign = campaign + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CampaignsInsertCall) Fields(s ...googleapi.Field) *CampaignsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CampaignsInsertCall) Context(ctx context.Context) *CampaignsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CampaignsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("defaultLandingPageName", fmt.Sprintf("%v", c.defaultLandingPageName)) + params.Set("defaultLandingPageUrl", fmt.Sprintf("%v", c.defaultLandingPageUrl)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.campaigns.insert" call. +// Exactly one of *Campaign or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Campaign.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CampaignsInsertCall) Do() (*Campaign, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Campaign{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new campaign.", + // "httpMethod": "POST", + // "id": "dfareporting.campaigns.insert", + // "parameterOrder": [ + // "profileId", + // "defaultLandingPageName", + // "defaultLandingPageUrl" + // ], + // "parameters": { + // "defaultLandingPageName": { + // "description": "Default landing page name for this new campaign. Must be less than 256 characters long.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "defaultLandingPageUrl": { + // "description": "Default landing page URL for this new campaign.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns", + // "request": { + // "$ref": "Campaign" + // }, + // "response": { + // "$ref": "Campaign" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.campaigns.list": + +type CampaignsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of campaigns, possibly filtered. +func (r *CampaignsService) List(profileId int64) *CampaignsListCall { + c := &CampaignsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdvertiserGroupIds sets the optional parameter "advertiserGroupIds": +// Select only campaigns whose advertisers belong to these advertiser +// groups. +func (c *CampaignsListCall) AdvertiserGroupIds(advertiserGroupIds int64) *CampaignsListCall { + c.opt_["advertiserGroupIds"] = advertiserGroupIds + return c +} + +// AdvertiserIds sets the optional parameter "advertiserIds": Select +// only campaigns that belong to these advertisers. +func (c *CampaignsListCall) AdvertiserIds(advertiserIds int64) *CampaignsListCall { + c.opt_["advertiserIds"] = advertiserIds + return c +} + +// Archived sets the optional parameter "archived": Select only archived +// campaigns. Don't set this field to select both archived and +// non-archived campaigns. +func (c *CampaignsListCall) Archived(archived bool) *CampaignsListCall { + c.opt_["archived"] = archived + return c +} + +// AtLeastOneOptimizationActivity sets the optional parameter +// "atLeastOneOptimizationActivity": Select only campaigns that have at +// least one optimization activity. +func (c *CampaignsListCall) AtLeastOneOptimizationActivity(atLeastOneOptimizationActivity bool) *CampaignsListCall { + c.opt_["atLeastOneOptimizationActivity"] = atLeastOneOptimizationActivity + return c +} + +// ExcludedIds sets the optional parameter "excludedIds": Exclude +// campaigns with these IDs. +func (c *CampaignsListCall) ExcludedIds(excludedIds int64) *CampaignsListCall { + c.opt_["excludedIds"] = excludedIds + return c +} + +// Ids sets the optional parameter "ids": Select only campaigns with +// these IDs. +func (c *CampaignsListCall) Ids(ids int64) *CampaignsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *CampaignsListCall) MaxResults(maxResults int64) *CampaignsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OverriddenEventTagId sets the optional parameter +// "overriddenEventTagId": Select only campaigns that have overridden +// this event tag ID. +func (c *CampaignsListCall) OverriddenEventTagId(overriddenEventTagId int64) *CampaignsListCall { + c.opt_["overriddenEventTagId"] = overriddenEventTagId + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *CampaignsListCall) PageToken(pageToken string) *CampaignsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for campaigns by name or ID. Wildcards (*) are allowed. For +// example, "campaign*2015" will return campaigns with names like +// "campaign June 2015", "campaign April 2015", or simply "campaign +// 2015". Most of the searches also add wildcards implicitly at the +// start and the end of the search string. For example, a search string +// of "campaign" will match campaigns with name "my campaign", "campaign +// 2015", or simply "campaign". +func (c *CampaignsListCall) SearchString(searchString string) *CampaignsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *CampaignsListCall) SortField(sortField string) *CampaignsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *CampaignsListCall) SortOrder(sortOrder string) *CampaignsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// SubaccountId sets the optional parameter "subaccountId": Select only +// campaigns that belong to this subaccount. +func (c *CampaignsListCall) SubaccountId(subaccountId int64) *CampaignsListCall { + c.opt_["subaccountId"] = subaccountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CampaignsListCall) Fields(s ...googleapi.Field) *CampaignsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CampaignsListCall) IfNoneMatch(entityTag string) *CampaignsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CampaignsListCall) Context(ctx context.Context) *CampaignsListCall { + c.ctx_ = ctx + return c +} + +func (c *CampaignsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserGroupIds"]; ok { + params.Set("advertiserGroupIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["advertiserIds"]; ok { + params.Set("advertiserIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["archived"]; ok { + params.Set("archived", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["atLeastOneOptimizationActivity"]; ok { + params.Set("atLeastOneOptimizationActivity", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["excludedIds"]; ok { + params.Set("excludedIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["overriddenEventTagId"]; ok { + params.Set("overriddenEventTagId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["subaccountId"]; ok { + params.Set("subaccountId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.campaigns.list" call. +// Exactly one of *CampaignsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CampaignsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CampaignsListCall) Do() (*CampaignsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CampaignsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of campaigns, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.campaigns.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "advertiserGroupIds": { + // "description": "Select only campaigns whose advertisers belong to these advertiser groups.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "advertiserIds": { + // "description": "Select only campaigns that belong to these advertisers.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "archived": { + // "description": "Select only archived campaigns. Don't set this field to select both archived and non-archived campaigns.", + // "location": "query", + // "type": "boolean" + // }, + // "atLeastOneOptimizationActivity": { + // "description": "Select only campaigns that have at least one optimization activity.", + // "location": "query", + // "type": "boolean" + // }, + // "excludedIds": { + // "description": "Exclude campaigns with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only campaigns with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "overriddenEventTagId": { + // "description": "Select only campaigns that have overridden this event tag ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for campaigns by name or ID. Wildcards (*) are allowed. For example, \"campaign*2015\" will return campaigns with names like \"campaign June 2015\", \"campaign April 2015\", or simply \"campaign 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"campaign\" will match campaigns with name \"my campaign\", \"campaign 2015\", or simply \"campaign\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "subaccountId": { + // "description": "Select only campaigns that belong to this subaccount.", + // "format": "int64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns", + // "response": { + // "$ref": "CampaignsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.campaigns.patch": + +type CampaignsPatchCall struct { + s *Service + profileId int64 + id int64 + campaign *Campaign + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing campaign. This method supports patch +// semantics. +func (r *CampaignsService) Patch(profileId int64, id int64, campaign *Campaign) *CampaignsPatchCall { + c := &CampaignsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.campaign = campaign + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CampaignsPatchCall) Fields(s ...googleapi.Field) *CampaignsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CampaignsPatchCall) Context(ctx context.Context) *CampaignsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CampaignsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.campaigns.patch" call. +// Exactly one of *Campaign or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Campaign.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CampaignsPatchCall) Do() (*Campaign, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Campaign{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing campaign. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.campaigns.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Campaign ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns", + // "request": { + // "$ref": "Campaign" + // }, + // "response": { + // "$ref": "Campaign" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.campaigns.update": + +type CampaignsUpdateCall struct { + s *Service + profileId int64 + campaign *Campaign + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing campaign. +func (r *CampaignsService) Update(profileId int64, campaign *Campaign) *CampaignsUpdateCall { + c := &CampaignsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaign = campaign + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CampaignsUpdateCall) Fields(s ...googleapi.Field) *CampaignsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CampaignsUpdateCall) Context(ctx context.Context) *CampaignsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CampaignsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.campaigns.update" call. +// Exactly one of *Campaign or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Campaign.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CampaignsUpdateCall) Do() (*Campaign, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Campaign{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing campaign.", + // "httpMethod": "PUT", + // "id": "dfareporting.campaigns.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns", + // "request": { + // "$ref": "Campaign" + // }, + // "response": { + // "$ref": "Campaign" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.changeLogs.get": + +type ChangeLogsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one change log by ID. +func (r *ChangeLogsService) Get(profileId int64, id int64) *ChangeLogsGetCall { + c := &ChangeLogsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChangeLogsGetCall) Fields(s ...googleapi.Field) *ChangeLogsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ChangeLogsGetCall) IfNoneMatch(entityTag string) *ChangeLogsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChangeLogsGetCall) Context(ctx context.Context) *ChangeLogsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ChangeLogsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/changeLogs/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.changeLogs.get" call. +// Exactly one of *ChangeLog or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ChangeLog.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ChangeLogsGetCall) Do() (*ChangeLog, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ChangeLog{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one change log by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.changeLogs.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Change log ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/changeLogs/{id}", + // "response": { + // "$ref": "ChangeLog" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.changeLogs.list": + +type ChangeLogsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of change logs. +func (r *ChangeLogsService) List(profileId int64) *ChangeLogsListCall { + c := &ChangeLogsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Action sets the optional parameter "action": Select only change logs +// with the specified action. +// +// Possible values: +// "ACTION_ADD" +// "ACTION_ASSIGN" +// "ACTION_ASSOCIATE" +// "ACTION_CREATE" +// "ACTION_DELETE" +// "ACTION_DISABLE" +// "ACTION_EMAIL_TAGS" +// "ACTION_ENABLE" +// "ACTION_LINK" +// "ACTION_MARK_AS_DEFAULT" +// "ACTION_PUSH" +// "ACTION_REMOVE" +// "ACTION_SEND" +// "ACTION_SHARE" +// "ACTION_UNASSIGN" +// "ACTION_UNLINK" +// "ACTION_UPDATE" +func (c *ChangeLogsListCall) Action(action string) *ChangeLogsListCall { + c.opt_["action"] = action + return c +} + +// Ids sets the optional parameter "ids": Select only change logs with +// these IDs. +func (c *ChangeLogsListCall) Ids(ids int64) *ChangeLogsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxChangeTime sets the optional parameter "maxChangeTime": Select +// only change logs whose change time is before the specified +// maxChangeTime.The time should be formatted as an RFC3339 date/time +// string. For example, for 10:54 PM on July 18th, 2015, in the +// America/New York time zone, the format is +// "2015-07-18T22:54:00-04:00". In other words, the year, month, day, +// the letter T, the hour (24-hour clock system), minute, second, and +// then the time zone offset. +func (c *ChangeLogsListCall) MaxChangeTime(maxChangeTime string) *ChangeLogsListCall { + c.opt_["maxChangeTime"] = maxChangeTime + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *ChangeLogsListCall) MaxResults(maxResults int64) *ChangeLogsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// MinChangeTime sets the optional parameter "minChangeTime": Select +// only change logs whose change time is before the specified +// minChangeTime.The time should be formatted as an RFC3339 date/time +// string. For example, for 10:54 PM on July 18th, 2015, in the +// America/New York time zone, the format is +// "2015-07-18T22:54:00-04:00". In other words, the year, month, day, +// the letter T, the hour (24-hour clock system), minute, second, and +// then the time zone offset. +func (c *ChangeLogsListCall) MinChangeTime(minChangeTime string) *ChangeLogsListCall { + c.opt_["minChangeTime"] = minChangeTime + return c +} + +// ObjectIds sets the optional parameter "objectIds": Select only change +// logs with these object IDs. +func (c *ChangeLogsListCall) ObjectIds(objectIds int64) *ChangeLogsListCall { + c.opt_["objectIds"] = objectIds + return c +} + +// ObjectType sets the optional parameter "objectType": Select only +// change logs with the specified object type. +// +// Possible values: +// "OBJECT_ACCOUNT" +// "OBJECT_ACCOUNT_BILLING_FEATURE" +// "OBJECT_AD" +// "OBJECT_ADVERTISER" +// "OBJECT_ADVERTISER_GROUP" +// "OBJECT_BILLING_ACCOUNT_GROUP" +// "OBJECT_BILLING_FEATURE" +// "OBJECT_BILLING_MINIMUM_FEE" +// "OBJECT_BILLING_PROFILE" +// "OBJECT_CAMPAIGN" +// "OBJECT_CONTENT_CATEGORY" +// "OBJECT_CREATIVE" +// "OBJECT_CREATIVE_ASSET" +// "OBJECT_CREATIVE_BUNDLE" +// "OBJECT_CREATIVE_FIELD" +// "OBJECT_CREATIVE_GROUP" +// "OBJECT_DFA_SITE" +// "OBJECT_EVENT_TAG" +// "OBJECT_FLOODLIGHT_ACTIVITY_GROUP" +// "OBJECT_FLOODLIGHT_ACTVITY" +// "OBJECT_FLOODLIGHT_CONFIGURATION" +// "OBJECT_INSTREAM_CREATIVE" +// "OBJECT_LANDING_PAGE" +// "OBJECT_MEDIA_ORDER" +// "OBJECT_PLACEMENT" +// "OBJECT_PLACEMENT_STRATEGY" +// "OBJECT_PROVIDED_LIST_CLIENT" +// "OBJECT_RATE_CARD" +// "OBJECT_REMARKETING_LIST" +// "OBJECT_RICHMEDIA_CREATIVE" +// "OBJECT_SD_SITE" +// "OBJECT_SIZE" +// "OBJECT_SUBACCOUNT" +// "OBJECT_USER_PROFILE" +// "OBJECT_USER_PROFILE_FILTER" +// "OBJECT_USER_ROLE" +func (c *ChangeLogsListCall) ObjectType(objectType string) *ChangeLogsListCall { + c.opt_["objectType"] = objectType + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *ChangeLogsListCall) PageToken(pageToken string) *ChangeLogsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Select only +// change logs whose object ID, user name, old or new values match the +// search string. +func (c *ChangeLogsListCall) SearchString(searchString string) *ChangeLogsListCall { + c.opt_["searchString"] = searchString + return c +} + +// UserProfileIds sets the optional parameter "userProfileIds": Select +// only change logs with these user profile IDs. +func (c *ChangeLogsListCall) UserProfileIds(userProfileIds int64) *ChangeLogsListCall { + c.opt_["userProfileIds"] = userProfileIds + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChangeLogsListCall) Fields(s ...googleapi.Field) *ChangeLogsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ChangeLogsListCall) IfNoneMatch(entityTag string) *ChangeLogsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChangeLogsListCall) Context(ctx context.Context) *ChangeLogsListCall { + c.ctx_ = ctx + return c +} + +func (c *ChangeLogsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["action"]; ok { + params.Set("action", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxChangeTime"]; ok { + params.Set("maxChangeTime", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["minChangeTime"]; ok { + params.Set("minChangeTime", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["objectIds"]; ok { + params.Set("objectIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["objectType"]; ok { + params.Set("objectType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["userProfileIds"]; ok { + params.Set("userProfileIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/changeLogs") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.changeLogs.list" call. +// Exactly one of *ChangeLogsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ChangeLogsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ChangeLogsListCall) Do() (*ChangeLogsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ChangeLogsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of change logs.", + // "httpMethod": "GET", + // "id": "dfareporting.changeLogs.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "action": { + // "description": "Select only change logs with the specified action.", + // "enum": [ + // "ACTION_ADD", + // "ACTION_ASSIGN", + // "ACTION_ASSOCIATE", + // "ACTION_CREATE", + // "ACTION_DELETE", + // "ACTION_DISABLE", + // "ACTION_EMAIL_TAGS", + // "ACTION_ENABLE", + // "ACTION_LINK", + // "ACTION_MARK_AS_DEFAULT", + // "ACTION_PUSH", + // "ACTION_REMOVE", + // "ACTION_SEND", + // "ACTION_SHARE", + // "ACTION_UNASSIGN", + // "ACTION_UNLINK", + // "ACTION_UPDATE" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "ids": { + // "description": "Select only change logs with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxChangeTime": { + // "description": "Select only change logs whose change time is before the specified maxChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is \"2015-07-18T22:54:00-04:00\". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "minChangeTime": { + // "description": "Select only change logs whose change time is before the specified minChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is \"2015-07-18T22:54:00-04:00\". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset.", + // "location": "query", + // "type": "string" + // }, + // "objectIds": { + // "description": "Select only change logs with these object IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "objectType": { + // "description": "Select only change logs with the specified object type.", + // "enum": [ + // "OBJECT_ACCOUNT", + // "OBJECT_ACCOUNT_BILLING_FEATURE", + // "OBJECT_AD", + // "OBJECT_ADVERTISER", + // "OBJECT_ADVERTISER_GROUP", + // "OBJECT_BILLING_ACCOUNT_GROUP", + // "OBJECT_BILLING_FEATURE", + // "OBJECT_BILLING_MINIMUM_FEE", + // "OBJECT_BILLING_PROFILE", + // "OBJECT_CAMPAIGN", + // "OBJECT_CONTENT_CATEGORY", + // "OBJECT_CREATIVE", + // "OBJECT_CREATIVE_ASSET", + // "OBJECT_CREATIVE_BUNDLE", + // "OBJECT_CREATIVE_FIELD", + // "OBJECT_CREATIVE_GROUP", + // "OBJECT_DFA_SITE", + // "OBJECT_EVENT_TAG", + // "OBJECT_FLOODLIGHT_ACTIVITY_GROUP", + // "OBJECT_FLOODLIGHT_ACTVITY", + // "OBJECT_FLOODLIGHT_CONFIGURATION", + // "OBJECT_INSTREAM_CREATIVE", + // "OBJECT_LANDING_PAGE", + // "OBJECT_MEDIA_ORDER", + // "OBJECT_PLACEMENT", + // "OBJECT_PLACEMENT_STRATEGY", + // "OBJECT_PROVIDED_LIST_CLIENT", + // "OBJECT_RATE_CARD", + // "OBJECT_REMARKETING_LIST", + // "OBJECT_RICHMEDIA_CREATIVE", + // "OBJECT_SD_SITE", + // "OBJECT_SIZE", + // "OBJECT_SUBACCOUNT", + // "OBJECT_USER_PROFILE", + // "OBJECT_USER_PROFILE_FILTER", + // "OBJECT_USER_ROLE" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Select only change logs whose object ID, user name, old or new values match the search string.", + // "location": "query", + // "type": "string" + // }, + // "userProfileIds": { + // "description": "Select only change logs with these user profile IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/changeLogs", + // "response": { + // "$ref": "ChangeLogsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.cities.list": + +type CitiesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of cities, possibly filtered. +func (r *CitiesService) List(profileId int64) *CitiesListCall { + c := &CitiesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// CountryDartIds sets the optional parameter "countryDartIds": Select +// only cities from these countries. +func (c *CitiesListCall) CountryDartIds(countryDartIds int64) *CitiesListCall { + c.opt_["countryDartIds"] = countryDartIds + return c +} + +// DartIds sets the optional parameter "dartIds": Select only cities +// with these DART IDs. +func (c *CitiesListCall) DartIds(dartIds int64) *CitiesListCall { + c.opt_["dartIds"] = dartIds + return c +} + +// NamePrefix sets the optional parameter "namePrefix": Select only +// cities with names starting with this prefix. +func (c *CitiesListCall) NamePrefix(namePrefix string) *CitiesListCall { + c.opt_["namePrefix"] = namePrefix + return c +} + +// RegionDartIds sets the optional parameter "regionDartIds": Select +// only cities from these regions. +func (c *CitiesListCall) RegionDartIds(regionDartIds int64) *CitiesListCall { + c.opt_["regionDartIds"] = regionDartIds + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CitiesListCall) Fields(s ...googleapi.Field) *CitiesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CitiesListCall) IfNoneMatch(entityTag string) *CitiesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CitiesListCall) Context(ctx context.Context) *CitiesListCall { + c.ctx_ = ctx + return c +} + +func (c *CitiesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["countryDartIds"]; ok { + params.Set("countryDartIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["dartIds"]; ok { + params.Set("dartIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["namePrefix"]; ok { + params.Set("namePrefix", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["regionDartIds"]; ok { + params.Set("regionDartIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/cities") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.cities.list" call. +// Exactly one of *CitiesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CitiesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CitiesListCall) Do() (*CitiesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CitiesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of cities, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.cities.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "countryDartIds": { + // "description": "Select only cities from these countries.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "dartIds": { + // "description": "Select only cities with these DART IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "namePrefix": { + // "description": "Select only cities with names starting with this prefix.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "regionDartIds": { + // "description": "Select only cities from these regions.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/cities", + // "response": { + // "$ref": "CitiesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.connectionTypes.list": + +type ConnectionTypesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of connection types. +func (r *ConnectionTypesService) List(profileId int64) *ConnectionTypesListCall { + c := &ConnectionTypesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ConnectionTypesListCall) Fields(s ...googleapi.Field) *ConnectionTypesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ConnectionTypesListCall) IfNoneMatch(entityTag string) *ConnectionTypesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ConnectionTypesListCall) Context(ctx context.Context) *ConnectionTypesListCall { + c.ctx_ = ctx + return c +} + +func (c *ConnectionTypesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/connectionTypes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.connectionTypes.list" call. +// Exactly one of *ConnectionTypesListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ConnectionTypesListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ConnectionTypesListCall) Do() (*ConnectionTypesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ConnectionTypesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of connection types.", + // "httpMethod": "GET", + // "id": "dfareporting.connectionTypes.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/connectionTypes", + // "response": { + // "$ref": "ConnectionTypesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.contentCategories.delete": + +type ContentCategoriesDeleteCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing content category. +func (r *ContentCategoriesService) Delete(profileId int64, id int64) *ContentCategoriesDeleteCall { + c := &ContentCategoriesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ContentCategoriesDeleteCall) Fields(s ...googleapi.Field) *ContentCategoriesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ContentCategoriesDeleteCall) Context(ctx context.Context) *ContentCategoriesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ContentCategoriesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.contentCategories.delete" call. +func (c *ContentCategoriesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing content category.", + // "httpMethod": "DELETE", + // "id": "dfareporting.contentCategories.delete", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Content category ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/contentCategories/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.contentCategories.get": + +type ContentCategoriesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one content category by ID. +func (r *ContentCategoriesService) Get(profileId int64, id int64) *ContentCategoriesGetCall { + c := &ContentCategoriesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ContentCategoriesGetCall) Fields(s ...googleapi.Field) *ContentCategoriesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ContentCategoriesGetCall) IfNoneMatch(entityTag string) *ContentCategoriesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ContentCategoriesGetCall) Context(ctx context.Context) *ContentCategoriesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ContentCategoriesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.contentCategories.get" call. +// Exactly one of *ContentCategory or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ContentCategory.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ContentCategoriesGetCall) Do() (*ContentCategory, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ContentCategory{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one content category by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.contentCategories.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Content category ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/contentCategories/{id}", + // "response": { + // "$ref": "ContentCategory" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.contentCategories.insert": + +type ContentCategoriesInsertCall struct { + s *Service + profileId int64 + contentcategory *ContentCategory + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new content category. +func (r *ContentCategoriesService) Insert(profileId int64, contentcategory *ContentCategory) *ContentCategoriesInsertCall { + c := &ContentCategoriesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.contentcategory = contentcategory + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ContentCategoriesInsertCall) Fields(s ...googleapi.Field) *ContentCategoriesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ContentCategoriesInsertCall) Context(ctx context.Context) *ContentCategoriesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ContentCategoriesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.contentCategories.insert" call. +// Exactly one of *ContentCategory or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ContentCategory.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ContentCategoriesInsertCall) Do() (*ContentCategory, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ContentCategory{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new content category.", + // "httpMethod": "POST", + // "id": "dfareporting.contentCategories.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/contentCategories", + // "request": { + // "$ref": "ContentCategory" + // }, + // "response": { + // "$ref": "ContentCategory" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.contentCategories.list": + +type ContentCategoriesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of content categories, possibly filtered. +func (r *ContentCategoriesService) List(profileId int64) *ContentCategoriesListCall { + c := &ContentCategoriesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Ids sets the optional parameter "ids": Select only content categories +// with these IDs. +func (c *ContentCategoriesListCall) Ids(ids int64) *ContentCategoriesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *ContentCategoriesListCall) MaxResults(maxResults int64) *ContentCategoriesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *ContentCategoriesListCall) PageToken(pageToken string) *ContentCategoriesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "contentcategory*2015" will return objects with names like +// "contentcategory June 2015", "contentcategory April 2015", or simply +// "contentcategory 2015". Most of the searches also add wildcards +// implicitly at the start and the end of the search string. For +// example, a search string of "contentcategory" will match objects with +// name "my contentcategory", "contentcategory 2015", or simply +// "contentcategory". +func (c *ContentCategoriesListCall) SearchString(searchString string) *ContentCategoriesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *ContentCategoriesListCall) SortField(sortField string) *ContentCategoriesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *ContentCategoriesListCall) SortOrder(sortOrder string) *ContentCategoriesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ContentCategoriesListCall) Fields(s ...googleapi.Field) *ContentCategoriesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ContentCategoriesListCall) IfNoneMatch(entityTag string) *ContentCategoriesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ContentCategoriesListCall) Context(ctx context.Context) *ContentCategoriesListCall { + c.ctx_ = ctx + return c +} + +func (c *ContentCategoriesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.contentCategories.list" call. +// Exactly one of *ContentCategoriesListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ContentCategoriesListResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ContentCategoriesListCall) Do() (*ContentCategoriesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ContentCategoriesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of content categories, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.contentCategories.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "ids": { + // "description": "Select only content categories with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"contentcategory*2015\" will return objects with names like \"contentcategory June 2015\", \"contentcategory April 2015\", or simply \"contentcategory 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"contentcategory\" will match objects with name \"my contentcategory\", \"contentcategory 2015\", or simply \"contentcategory\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/contentCategories", + // "response": { + // "$ref": "ContentCategoriesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.contentCategories.patch": + +type ContentCategoriesPatchCall struct { + s *Service + profileId int64 + id int64 + contentcategory *ContentCategory + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing content category. This method supports +// patch semantics. +func (r *ContentCategoriesService) Patch(profileId int64, id int64, contentcategory *ContentCategory) *ContentCategoriesPatchCall { + c := &ContentCategoriesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.contentcategory = contentcategory + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ContentCategoriesPatchCall) Fields(s ...googleapi.Field) *ContentCategoriesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ContentCategoriesPatchCall) Context(ctx context.Context) *ContentCategoriesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ContentCategoriesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.contentCategories.patch" call. +// Exactly one of *ContentCategory or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ContentCategory.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ContentCategoriesPatchCall) Do() (*ContentCategory, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ContentCategory{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing content category. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.contentCategories.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Content category ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/contentCategories", + // "request": { + // "$ref": "ContentCategory" + // }, + // "response": { + // "$ref": "ContentCategory" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.contentCategories.update": + +type ContentCategoriesUpdateCall struct { + s *Service + profileId int64 + contentcategory *ContentCategory + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing content category. +func (r *ContentCategoriesService) Update(profileId int64, contentcategory *ContentCategory) *ContentCategoriesUpdateCall { + c := &ContentCategoriesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.contentcategory = contentcategory + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ContentCategoriesUpdateCall) Fields(s ...googleapi.Field) *ContentCategoriesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ContentCategoriesUpdateCall) Context(ctx context.Context) *ContentCategoriesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ContentCategoriesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.contentCategories.update" call. +// Exactly one of *ContentCategory or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ContentCategory.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ContentCategoriesUpdateCall) Do() (*ContentCategory, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ContentCategory{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing content category.", + // "httpMethod": "PUT", + // "id": "dfareporting.contentCategories.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/contentCategories", + // "request": { + // "$ref": "ContentCategory" + // }, + // "response": { + // "$ref": "ContentCategory" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.countries.get": + +type CountriesGetCall struct { + s *Service + profileId int64 + dartId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one country by ID. +func (r *CountriesService) Get(profileId int64, dartId int64) *CountriesGetCall { + c := &CountriesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.dartId = dartId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CountriesGetCall) Fields(s ...googleapi.Field) *CountriesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CountriesGetCall) IfNoneMatch(entityTag string) *CountriesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CountriesGetCall) Context(ctx context.Context) *CountriesGetCall { + c.ctx_ = ctx + return c +} + +func (c *CountriesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/countries/{dartId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "dartId": strconv.FormatInt(c.dartId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.countries.get" call. +// Exactly one of *Country or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Country.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CountriesGetCall) Do() (*Country, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Country{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one country by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.countries.get", + // "parameterOrder": [ + // "profileId", + // "dartId" + // ], + // "parameters": { + // "dartId": { + // "description": "Country DART ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/countries/{dartId}", + // "response": { + // "$ref": "Country" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.countries.list": + +type CountriesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of countries. +func (r *CountriesService) List(profileId int64) *CountriesListCall { + c := &CountriesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CountriesListCall) Fields(s ...googleapi.Field) *CountriesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CountriesListCall) IfNoneMatch(entityTag string) *CountriesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CountriesListCall) Context(ctx context.Context) *CountriesListCall { + c.ctx_ = ctx + return c +} + +func (c *CountriesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/countries") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.countries.list" call. +// Exactly one of *CountriesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CountriesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CountriesListCall) Do() (*CountriesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CountriesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of countries.", + // "httpMethod": "GET", + // "id": "dfareporting.countries.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/countries", + // "response": { + // "$ref": "CountriesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeAssets.insert": + +type CreativeAssetsInsertCall struct { + s *Service + profileId int64 + advertiserId int64 + creativeassetmetadata *CreativeAssetMetadata + opt_ map[string]interface{} + media_ io.Reader + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// Insert: Inserts a new creative asset. +func (r *CreativeAssetsService) Insert(profileId int64, advertiserId int64, creativeassetmetadata *CreativeAssetMetadata) *CreativeAssetsInsertCall { + c := &CreativeAssetsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.advertiserId = advertiserId + c.creativeassetmetadata = creativeassetmetadata + return c +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *CreativeAssetsInsertCall) Media(r io.Reader) *CreativeAssetsInsertCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *CreativeAssetsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *CreativeAssetsInsertCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *CreativeAssetsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *CreativeAssetsInsertCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeAssetsInsertCall) Fields(s ...googleapi.Field) *CreativeAssetsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *CreativeAssetsInsertCall) Context(ctx context.Context) *CreativeAssetsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeAssetsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativeassetmetadata) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "advertiserId": strconv.FormatInt(c.advertiserId, 10), + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeAssets.insert" call. +// Exactly one of *CreativeAssetMetadata or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CreativeAssetMetadata.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeAssetsInsertCall) Do() (*CreativeAssetMetadata, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &CreativeAssetMetadata{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new creative asset.", + // "httpMethod": "POST", + // "id": "dfareporting.creativeAssets.insert", + // "mediaUpload": { + // "accept": [ + // "*/*" + // ], + // "maxSize": "100MB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/dfareporting/v2.0/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/dfareporting/v2.0/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets" + // } + // } + // }, + // "parameterOrder": [ + // "profileId", + // "advertiserId" + // ], + // "parameters": { + // "advertiserId": { + // "description": "Advertiser ID of this creative. This is a required field.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets", + // "request": { + // "$ref": "CreativeAssetMetadata" + // }, + // "response": { + // "$ref": "CreativeAssetMetadata" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "dfareporting.creativeFieldValues.delete": + +type CreativeFieldValuesDeleteCall struct { + s *Service + profileId int64 + creativeFieldId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing creative field value. +func (r *CreativeFieldValuesService) Delete(profileId int64, creativeFieldId int64, id int64) *CreativeFieldValuesDeleteCall { + c := &CreativeFieldValuesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativeFieldId = creativeFieldId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldValuesDeleteCall) Fields(s ...googleapi.Field) *CreativeFieldValuesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldValuesDeleteCall) Context(ctx context.Context) *CreativeFieldValuesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldValuesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFieldValues.delete" call. +func (c *CreativeFieldValuesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing creative field value.", + // "httpMethod": "DELETE", + // "id": "dfareporting.creativeFieldValues.delete", + // "parameterOrder": [ + // "profileId", + // "creativeFieldId", + // "id" + // ], + // "parameters": { + // "creativeFieldId": { + // "description": "Creative field ID for this creative field value.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "id": { + // "description": "Creative Field Value ID", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFieldValues.get": + +type CreativeFieldValuesGetCall struct { + s *Service + profileId int64 + creativeFieldId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one creative field value by ID. +func (r *CreativeFieldValuesService) Get(profileId int64, creativeFieldId int64, id int64) *CreativeFieldValuesGetCall { + c := &CreativeFieldValuesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativeFieldId = creativeFieldId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldValuesGetCall) Fields(s ...googleapi.Field) *CreativeFieldValuesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativeFieldValuesGetCall) IfNoneMatch(entityTag string) *CreativeFieldValuesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldValuesGetCall) Context(ctx context.Context) *CreativeFieldValuesGetCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldValuesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFieldValues.get" call. +// Exactly one of *CreativeFieldValue or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CreativeFieldValue.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldValuesGetCall) Do() (*CreativeFieldValue, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeFieldValue{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one creative field value by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.creativeFieldValues.get", + // "parameterOrder": [ + // "profileId", + // "creativeFieldId", + // "id" + // ], + // "parameters": { + // "creativeFieldId": { + // "description": "Creative field ID for this creative field value.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "id": { + // "description": "Creative Field Value ID", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}", + // "response": { + // "$ref": "CreativeFieldValue" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFieldValues.insert": + +type CreativeFieldValuesInsertCall struct { + s *Service + profileId int64 + creativeFieldId int64 + creativefieldvalue *CreativeFieldValue + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new creative field value. +func (r *CreativeFieldValuesService) Insert(profileId int64, creativeFieldId int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesInsertCall { + c := &CreativeFieldValuesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativeFieldId = creativeFieldId + c.creativefieldvalue = creativefieldvalue + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldValuesInsertCall) Fields(s ...googleapi.Field) *CreativeFieldValuesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldValuesInsertCall) Context(ctx context.Context) *CreativeFieldValuesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldValuesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFieldValues.insert" call. +// Exactly one of *CreativeFieldValue or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CreativeFieldValue.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldValuesInsertCall) Do() (*CreativeFieldValue, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeFieldValue{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new creative field value.", + // "httpMethod": "POST", + // "id": "dfareporting.creativeFieldValues.insert", + // "parameterOrder": [ + // "profileId", + // "creativeFieldId" + // ], + // "parameters": { + // "creativeFieldId": { + // "description": "Creative field ID for this creative field value.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + // "request": { + // "$ref": "CreativeFieldValue" + // }, + // "response": { + // "$ref": "CreativeFieldValue" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFieldValues.list": + +type CreativeFieldValuesListCall struct { + s *Service + profileId int64 + creativeFieldId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of creative field values, possibly filtered. +func (r *CreativeFieldValuesService) List(profileId int64, creativeFieldId int64) *CreativeFieldValuesListCall { + c := &CreativeFieldValuesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativeFieldId = creativeFieldId + return c +} + +// Ids sets the optional parameter "ids": Select only creative field +// values with these IDs. +func (c *CreativeFieldValuesListCall) Ids(ids int64) *CreativeFieldValuesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *CreativeFieldValuesListCall) MaxResults(maxResults int64) *CreativeFieldValuesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *CreativeFieldValuesListCall) PageToken(pageToken string) *CreativeFieldValuesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for creative field values by their values. Wildcards (e.g. +// *) are not allowed. +func (c *CreativeFieldValuesListCall) SearchString(searchString string) *CreativeFieldValuesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "VALUE" +func (c *CreativeFieldValuesListCall) SortField(sortField string) *CreativeFieldValuesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *CreativeFieldValuesListCall) SortOrder(sortOrder string) *CreativeFieldValuesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldValuesListCall) Fields(s ...googleapi.Field) *CreativeFieldValuesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativeFieldValuesListCall) IfNoneMatch(entityTag string) *CreativeFieldValuesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldValuesListCall) Context(ctx context.Context) *CreativeFieldValuesListCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldValuesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFieldValues.list" call. +// Exactly one of *CreativeFieldValuesListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *CreativeFieldValuesListResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldValuesListCall) Do() (*CreativeFieldValuesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeFieldValuesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of creative field values, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.creativeFieldValues.list", + // "parameterOrder": [ + // "profileId", + // "creativeFieldId" + // ], + // "parameters": { + // "creativeFieldId": { + // "description": "Creative field ID for this creative field value.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only creative field values with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for creative field values by their values. Wildcards (e.g. *) are not allowed.", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "VALUE" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + // "response": { + // "$ref": "CreativeFieldValuesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFieldValues.patch": + +type CreativeFieldValuesPatchCall struct { + s *Service + profileId int64 + creativeFieldId int64 + id int64 + creativefieldvalue *CreativeFieldValue + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing creative field value. This method supports +// patch semantics. +func (r *CreativeFieldValuesService) Patch(profileId int64, creativeFieldId int64, id int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesPatchCall { + c := &CreativeFieldValuesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativeFieldId = creativeFieldId + c.id = id + c.creativefieldvalue = creativefieldvalue + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldValuesPatchCall) Fields(s ...googleapi.Field) *CreativeFieldValuesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldValuesPatchCall) Context(ctx context.Context) *CreativeFieldValuesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldValuesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFieldValues.patch" call. +// Exactly one of *CreativeFieldValue or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CreativeFieldValue.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldValuesPatchCall) Do() (*CreativeFieldValue, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeFieldValue{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing creative field value. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.creativeFieldValues.patch", + // "parameterOrder": [ + // "profileId", + // "creativeFieldId", + // "id" + // ], + // "parameters": { + // "creativeFieldId": { + // "description": "Creative field ID for this creative field value.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "id": { + // "description": "Creative Field Value ID", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + // "request": { + // "$ref": "CreativeFieldValue" + // }, + // "response": { + // "$ref": "CreativeFieldValue" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFieldValues.update": + +type CreativeFieldValuesUpdateCall struct { + s *Service + profileId int64 + creativeFieldId int64 + creativefieldvalue *CreativeFieldValue + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing creative field value. +func (r *CreativeFieldValuesService) Update(profileId int64, creativeFieldId int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesUpdateCall { + c := &CreativeFieldValuesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativeFieldId = creativeFieldId + c.creativefieldvalue = creativefieldvalue + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldValuesUpdateCall) Fields(s ...googleapi.Field) *CreativeFieldValuesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldValuesUpdateCall) Context(ctx context.Context) *CreativeFieldValuesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldValuesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFieldValues.update" call. +// Exactly one of *CreativeFieldValue or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CreativeFieldValue.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldValuesUpdateCall) Do() (*CreativeFieldValue, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeFieldValue{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing creative field value.", + // "httpMethod": "PUT", + // "id": "dfareporting.creativeFieldValues.update", + // "parameterOrder": [ + // "profileId", + // "creativeFieldId" + // ], + // "parameters": { + // "creativeFieldId": { + // "description": "Creative field ID for this creative field value.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + // "request": { + // "$ref": "CreativeFieldValue" + // }, + // "response": { + // "$ref": "CreativeFieldValue" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFields.delete": + +type CreativeFieldsDeleteCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing creative field. +func (r *CreativeFieldsService) Delete(profileId int64, id int64) *CreativeFieldsDeleteCall { + c := &CreativeFieldsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldsDeleteCall) Fields(s ...googleapi.Field) *CreativeFieldsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldsDeleteCall) Context(ctx context.Context) *CreativeFieldsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFields.delete" call. +func (c *CreativeFieldsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing creative field.", + // "httpMethod": "DELETE", + // "id": "dfareporting.creativeFields.delete", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Creative Field ID", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFields.get": + +type CreativeFieldsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one creative field by ID. +func (r *CreativeFieldsService) Get(profileId int64, id int64) *CreativeFieldsGetCall { + c := &CreativeFieldsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldsGetCall) Fields(s ...googleapi.Field) *CreativeFieldsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativeFieldsGetCall) IfNoneMatch(entityTag string) *CreativeFieldsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldsGetCall) Context(ctx context.Context) *CreativeFieldsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFields.get" call. +// Exactly one of *CreativeField or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativeField.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldsGetCall) Do() (*CreativeField, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeField{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one creative field by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.creativeFields.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Creative Field ID", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields/{id}", + // "response": { + // "$ref": "CreativeField" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFields.insert": + +type CreativeFieldsInsertCall struct { + s *Service + profileId int64 + creativefield *CreativeField + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new creative field. +func (r *CreativeFieldsService) Insert(profileId int64, creativefield *CreativeField) *CreativeFieldsInsertCall { + c := &CreativeFieldsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativefield = creativefield + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldsInsertCall) Fields(s ...googleapi.Field) *CreativeFieldsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldsInsertCall) Context(ctx context.Context) *CreativeFieldsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFields.insert" call. +// Exactly one of *CreativeField or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativeField.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldsInsertCall) Do() (*CreativeField, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeField{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new creative field.", + // "httpMethod": "POST", + // "id": "dfareporting.creativeFields.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields", + // "request": { + // "$ref": "CreativeField" + // }, + // "response": { + // "$ref": "CreativeField" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFields.list": + +type CreativeFieldsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of creative fields, possibly filtered. +func (r *CreativeFieldsService) List(profileId int64) *CreativeFieldsListCall { + c := &CreativeFieldsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdvertiserIds sets the optional parameter "advertiserIds": Select +// only creative fields that belong to these advertisers. +func (c *CreativeFieldsListCall) AdvertiserIds(advertiserIds int64) *CreativeFieldsListCall { + c.opt_["advertiserIds"] = advertiserIds + return c +} + +// Ids sets the optional parameter "ids": Select only creative fields +// with these IDs. +func (c *CreativeFieldsListCall) Ids(ids int64) *CreativeFieldsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *CreativeFieldsListCall) MaxResults(maxResults int64) *CreativeFieldsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *CreativeFieldsListCall) PageToken(pageToken string) *CreativeFieldsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for creative fields by name or ID. Wildcards (*) are +// allowed. For example, "creativefield*2015" will return creative +// fields with names like "creativefield June 2015", "creativefield +// April 2015", or simply "creativefield 2015". Most of the searches +// also add wild-cards implicitly at the start and the end of the search +// string. For example, a search string of "creativefield" will match +// creative fields with the name "my creativefield", "creativefield +// 2015", or simply "creativefield". +func (c *CreativeFieldsListCall) SearchString(searchString string) *CreativeFieldsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *CreativeFieldsListCall) SortField(sortField string) *CreativeFieldsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *CreativeFieldsListCall) SortOrder(sortOrder string) *CreativeFieldsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldsListCall) Fields(s ...googleapi.Field) *CreativeFieldsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativeFieldsListCall) IfNoneMatch(entityTag string) *CreativeFieldsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldsListCall) Context(ctx context.Context) *CreativeFieldsListCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserIds"]; ok { + params.Set("advertiserIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFields.list" call. +// Exactly one of *CreativeFieldsListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *CreativeFieldsListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldsListCall) Do() (*CreativeFieldsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeFieldsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of creative fields, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.creativeFields.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "advertiserIds": { + // "description": "Select only creative fields that belong to these advertisers.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only creative fields with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for creative fields by name or ID. Wildcards (*) are allowed. For example, \"creativefield*2015\" will return creative fields with names like \"creativefield June 2015\", \"creativefield April 2015\", or simply \"creativefield 2015\". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of \"creativefield\" will match creative fields with the name \"my creativefield\", \"creativefield 2015\", or simply \"creativefield\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields", + // "response": { + // "$ref": "CreativeFieldsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFields.patch": + +type CreativeFieldsPatchCall struct { + s *Service + profileId int64 + id int64 + creativefield *CreativeField + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing creative field. This method supports patch +// semantics. +func (r *CreativeFieldsService) Patch(profileId int64, id int64, creativefield *CreativeField) *CreativeFieldsPatchCall { + c := &CreativeFieldsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.creativefield = creativefield + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldsPatchCall) Fields(s ...googleapi.Field) *CreativeFieldsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldsPatchCall) Context(ctx context.Context) *CreativeFieldsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFields.patch" call. +// Exactly one of *CreativeField or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativeField.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldsPatchCall) Do() (*CreativeField, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeField{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing creative field. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.creativeFields.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Creative Field ID", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields", + // "request": { + // "$ref": "CreativeField" + // }, + // "response": { + // "$ref": "CreativeField" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFields.update": + +type CreativeFieldsUpdateCall struct { + s *Service + profileId int64 + creativefield *CreativeField + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing creative field. +func (r *CreativeFieldsService) Update(profileId int64, creativefield *CreativeField) *CreativeFieldsUpdateCall { + c := &CreativeFieldsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativefield = creativefield + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldsUpdateCall) Fields(s ...googleapi.Field) *CreativeFieldsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldsUpdateCall) Context(ctx context.Context) *CreativeFieldsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFields.update" call. +// Exactly one of *CreativeField or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativeField.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldsUpdateCall) Do() (*CreativeField, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeField{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing creative field.", + // "httpMethod": "PUT", + // "id": "dfareporting.creativeFields.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields", + // "request": { + // "$ref": "CreativeField" + // }, + // "response": { + // "$ref": "CreativeField" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeGroups.get": + +type CreativeGroupsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one creative group by ID. +func (r *CreativeGroupsService) Get(profileId int64, id int64) *CreativeGroupsGetCall { + c := &CreativeGroupsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeGroupsGetCall) Fields(s ...googleapi.Field) *CreativeGroupsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativeGroupsGetCall) IfNoneMatch(entityTag string) *CreativeGroupsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeGroupsGetCall) Context(ctx context.Context) *CreativeGroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeGroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeGroups.get" call. +// Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativeGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeGroupsGetCall) Do() (*CreativeGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one creative group by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.creativeGroups.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Creative group ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeGroups/{id}", + // "response": { + // "$ref": "CreativeGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeGroups.insert": + +type CreativeGroupsInsertCall struct { + s *Service + profileId int64 + creativegroup *CreativeGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new creative group. +func (r *CreativeGroupsService) Insert(profileId int64, creativegroup *CreativeGroup) *CreativeGroupsInsertCall { + c := &CreativeGroupsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativegroup = creativegroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeGroupsInsertCall) Fields(s ...googleapi.Field) *CreativeGroupsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeGroupsInsertCall) Context(ctx context.Context) *CreativeGroupsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeGroupsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeGroups.insert" call. +// Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativeGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeGroupsInsertCall) Do() (*CreativeGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new creative group.", + // "httpMethod": "POST", + // "id": "dfareporting.creativeGroups.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeGroups", + // "request": { + // "$ref": "CreativeGroup" + // }, + // "response": { + // "$ref": "CreativeGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeGroups.list": + +type CreativeGroupsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of creative groups, possibly filtered. +func (r *CreativeGroupsService) List(profileId int64) *CreativeGroupsListCall { + c := &CreativeGroupsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdvertiserIds sets the optional parameter "advertiserIds": Select +// only creative groups that belong to these advertisers. +func (c *CreativeGroupsListCall) AdvertiserIds(advertiserIds int64) *CreativeGroupsListCall { + c.opt_["advertiserIds"] = advertiserIds + return c +} + +// GroupNumber sets the optional parameter "groupNumber": Select only +// creative groups that belong to this subgroup. +func (c *CreativeGroupsListCall) GroupNumber(groupNumber int64) *CreativeGroupsListCall { + c.opt_["groupNumber"] = groupNumber + return c +} + +// Ids sets the optional parameter "ids": Select only creative groups +// with these IDs. +func (c *CreativeGroupsListCall) Ids(ids int64) *CreativeGroupsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *CreativeGroupsListCall) MaxResults(maxResults int64) *CreativeGroupsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *CreativeGroupsListCall) PageToken(pageToken string) *CreativeGroupsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for creative groups by name or ID. Wildcards (*) are +// allowed. For example, "creativegroup*2015" will return creative +// groups with names like "creativegroup June 2015", "creativegroup +// April 2015", or simply "creativegroup 2015". Most of the searches +// also add wild-cards implicitly at the start and the end of the search +// string. For example, a search string of "creativegroup" will match +// creative groups with the name "my creativegroup", "creativegroup +// 2015", or simply "creativegroup". +func (c *CreativeGroupsListCall) SearchString(searchString string) *CreativeGroupsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *CreativeGroupsListCall) SortField(sortField string) *CreativeGroupsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *CreativeGroupsListCall) SortOrder(sortOrder string) *CreativeGroupsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeGroupsListCall) Fields(s ...googleapi.Field) *CreativeGroupsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativeGroupsListCall) IfNoneMatch(entityTag string) *CreativeGroupsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeGroupsListCall) Context(ctx context.Context) *CreativeGroupsListCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeGroupsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserIds"]; ok { + params.Set("advertiserIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["groupNumber"]; ok { + params.Set("groupNumber", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeGroups.list" call. +// Exactly one of *CreativeGroupsListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *CreativeGroupsListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeGroupsListCall) Do() (*CreativeGroupsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeGroupsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of creative groups, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.creativeGroups.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "advertiserIds": { + // "description": "Select only creative groups that belong to these advertisers.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "groupNumber": { + // "description": "Select only creative groups that belong to this subgroup.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "ids": { + // "description": "Select only creative groups with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for creative groups by name or ID. Wildcards (*) are allowed. For example, \"creativegroup*2015\" will return creative groups with names like \"creativegroup June 2015\", \"creativegroup April 2015\", or simply \"creativegroup 2015\". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of \"creativegroup\" will match creative groups with the name \"my creativegroup\", \"creativegroup 2015\", or simply \"creativegroup\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeGroups", + // "response": { + // "$ref": "CreativeGroupsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeGroups.patch": + +type CreativeGroupsPatchCall struct { + s *Service + profileId int64 + id int64 + creativegroup *CreativeGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing creative group. This method supports patch +// semantics. +func (r *CreativeGroupsService) Patch(profileId int64, id int64, creativegroup *CreativeGroup) *CreativeGroupsPatchCall { + c := &CreativeGroupsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.creativegroup = creativegroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeGroupsPatchCall) Fields(s ...googleapi.Field) *CreativeGroupsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeGroupsPatchCall) Context(ctx context.Context) *CreativeGroupsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeGroupsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeGroups.patch" call. +// Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativeGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeGroupsPatchCall) Do() (*CreativeGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing creative group. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.creativeGroups.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Creative group ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeGroups", + // "request": { + // "$ref": "CreativeGroup" + // }, + // "response": { + // "$ref": "CreativeGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeGroups.update": + +type CreativeGroupsUpdateCall struct { + s *Service + profileId int64 + creativegroup *CreativeGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing creative group. +func (r *CreativeGroupsService) Update(profileId int64, creativegroup *CreativeGroup) *CreativeGroupsUpdateCall { + c := &CreativeGroupsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativegroup = creativegroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeGroupsUpdateCall) Fields(s ...googleapi.Field) *CreativeGroupsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeGroupsUpdateCall) Context(ctx context.Context) *CreativeGroupsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeGroupsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeGroups.update" call. +// Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativeGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeGroupsUpdateCall) Do() (*CreativeGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing creative group.", + // "httpMethod": "PUT", + // "id": "dfareporting.creativeGroups.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeGroups", + // "request": { + // "$ref": "CreativeGroup" + // }, + // "response": { + // "$ref": "CreativeGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creatives.get": + +type CreativesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one creative by ID. +func (r *CreativesService) Get(profileId int64, id int64) *CreativesGetCall { + c := &CreativesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativesGetCall) Fields(s ...googleapi.Field) *CreativesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativesGetCall) IfNoneMatch(entityTag string) *CreativesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativesGetCall) Context(ctx context.Context) *CreativesGetCall { + c.ctx_ = ctx + return c +} + +func (c *CreativesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creatives.get" call. +// Exactly one of *Creative or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Creative.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CreativesGetCall) Do() (*Creative, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Creative{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one creative by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.creatives.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Creative ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creatives/{id}", + // "response": { + // "$ref": "Creative" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creatives.insert": + +type CreativesInsertCall struct { + s *Service + profileId int64 + creative *Creative + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new creative. +func (r *CreativesService) Insert(profileId int64, creative *Creative) *CreativesInsertCall { + c := &CreativesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creative = creative + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativesInsertCall) Fields(s ...googleapi.Field) *CreativesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativesInsertCall) Context(ctx context.Context) *CreativesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CreativesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creatives.insert" call. +// Exactly one of *Creative or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Creative.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CreativesInsertCall) Do() (*Creative, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Creative{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new creative.", + // "httpMethod": "POST", + // "id": "dfareporting.creatives.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creatives", + // "request": { + // "$ref": "Creative" + // }, + // "response": { + // "$ref": "Creative" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creatives.list": + +type CreativesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of creatives, possibly filtered. +func (r *CreativesService) List(profileId int64) *CreativesListCall { + c := &CreativesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Active sets the optional parameter "active": Select only active +// creatives. Leave blank to select active and inactive creatives. +func (c *CreativesListCall) Active(active bool) *CreativesListCall { + c.opt_["active"] = active + return c +} + +// AdvertiserId sets the optional parameter "advertiserId": Select only +// creatives with this advertiser ID. +func (c *CreativesListCall) AdvertiserId(advertiserId int64) *CreativesListCall { + c.opt_["advertiserId"] = advertiserId + return c +} + +// Archived sets the optional parameter "archived": Select only archived +// creatives. Leave blank to select archived and unarchived creatives. +func (c *CreativesListCall) Archived(archived bool) *CreativesListCall { + c.opt_["archived"] = archived + return c +} + +// CampaignId sets the optional parameter "campaignId": Select only +// creatives with this campaign ID. +func (c *CreativesListCall) CampaignId(campaignId int64) *CreativesListCall { + c.opt_["campaignId"] = campaignId + return c +} + +// CompanionCreativeIds sets the optional parameter +// "companionCreativeIds": Select only in-stream video creatives with +// these companion IDs. +func (c *CreativesListCall) CompanionCreativeIds(companionCreativeIds int64) *CreativesListCall { + c.opt_["companionCreativeIds"] = companionCreativeIds + return c +} + +// CreativeFieldIds sets the optional parameter "creativeFieldIds": +// Select only creatives with these creative field IDs. +func (c *CreativesListCall) CreativeFieldIds(creativeFieldIds int64) *CreativesListCall { + c.opt_["creativeFieldIds"] = creativeFieldIds + return c +} + +// Ids sets the optional parameter "ids": Select only creatives with +// these IDs. +func (c *CreativesListCall) Ids(ids int64) *CreativesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *CreativesListCall) MaxResults(maxResults int64) *CreativesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *CreativesListCall) PageToken(pageToken string) *CreativesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// RenderingIds sets the optional parameter "renderingIds": Select only +// creatives with these rendering IDs. +func (c *CreativesListCall) RenderingIds(renderingIds int64) *CreativesListCall { + c.opt_["renderingIds"] = renderingIds + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "creative*2015" will return objects with names like +// "creative June 2015", "creative April 2015", or simply "creative +// 2015". Most of the searches also add wildcards implicitly at the +// start and the end of the search string. For example, a search string +// of "creative" will match objects with name "my creative", "creative +// 2015", or simply "creative". +func (c *CreativesListCall) SearchString(searchString string) *CreativesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SizeIds sets the optional parameter "sizeIds": Select only creatives +// with these size IDs. +func (c *CreativesListCall) SizeIds(sizeIds int64) *CreativesListCall { + c.opt_["sizeIds"] = sizeIds + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *CreativesListCall) SortField(sortField string) *CreativesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *CreativesListCall) SortOrder(sortOrder string) *CreativesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// StudioCreativeId sets the optional parameter "studioCreativeId": +// Select only creatives corresponding to this Studio creative ID. +func (c *CreativesListCall) StudioCreativeId(studioCreativeId int64) *CreativesListCall { + c.opt_["studioCreativeId"] = studioCreativeId + return c +} + +// Types sets the optional parameter "types": Select only creatives with +// these creative types. +// +// Possible values: +// "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO" +// "CUSTOM_INPAGE" +// "CUSTOM_INTERSTITIAL" +// "ENHANCED_BANNER" +// "ENHANCED_IMAGE" +// "FLASH_INPAGE" +// "HTML5_BANNER" +// "IMAGE" +// "INSTREAM_VIDEO" +// "INTERNAL_REDIRECT" +// "INTERSTITIAL_INTERNAL_REDIRECT" +// "REDIRECT" +// "RICH_MEDIA_EXPANDING" +// "RICH_MEDIA_IM_EXPAND" +// "RICH_MEDIA_INPAGE" +// "RICH_MEDIA_INPAGE_FLOATING" +// "RICH_MEDIA_INTERSTITIAL_FLOAT" +// "RICH_MEDIA_MOBILE_IN_APP" +// "RICH_MEDIA_MULTI_FLOATING" +// "RICH_MEDIA_PEEL_DOWN" +// "TRACKING_TEXT" +// "VAST_REDIRECT" +// "VPAID_LINEAR" +// "VPAID_NON_LINEAR" +func (c *CreativesListCall) Types(types string) *CreativesListCall { + c.opt_["types"] = types + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativesListCall) Fields(s ...googleapi.Field) *CreativesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativesListCall) IfNoneMatch(entityTag string) *CreativesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativesListCall) Context(ctx context.Context) *CreativesListCall { + c.ctx_ = ctx + return c +} + +func (c *CreativesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["active"]; ok { + params.Set("active", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["advertiserId"]; ok { + params.Set("advertiserId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["archived"]; ok { + params.Set("archived", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["campaignId"]; ok { + params.Set("campaignId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["companionCreativeIds"]; ok { + params.Set("companionCreativeIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["creativeFieldIds"]; ok { + params.Set("creativeFieldIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["renderingIds"]; ok { + params.Set("renderingIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sizeIds"]; ok { + params.Set("sizeIds", 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)) + } + if v, ok := c.opt_["studioCreativeId"]; ok { + params.Set("studioCreativeId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["types"]; ok { + params.Set("types", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creatives.list" call. +// Exactly one of *CreativesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CreativesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativesListCall) Do() (*CreativesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of creatives, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.creatives.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "active": { + // "description": "Select only active creatives. Leave blank to select active and inactive creatives.", + // "location": "query", + // "type": "boolean" + // }, + // "advertiserId": { + // "description": "Select only creatives with this advertiser ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "archived": { + // "description": "Select only archived creatives. Leave blank to select archived and unarchived creatives.", + // "location": "query", + // "type": "boolean" + // }, + // "campaignId": { + // "description": "Select only creatives with this campaign ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "companionCreativeIds": { + // "description": "Select only in-stream video creatives with these companion IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "creativeFieldIds": { + // "description": "Select only creatives with these creative field IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only creatives with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "renderingIds": { + // "description": "Select only creatives with these rendering IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"creative*2015\" will return objects with names like \"creative June 2015\", \"creative April 2015\", or simply \"creative 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"creative\" will match objects with name \"my creative\", \"creative 2015\", or simply \"creative\".", + // "location": "query", + // "type": "string" + // }, + // "sizeIds": { + // "description": "Select only creatives with these size IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "studioCreativeId": { + // "description": "Select only creatives corresponding to this Studio creative ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "types": { + // "description": "Select only creatives with these creative types.", + // "enum": [ + // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO", + // "CUSTOM_INPAGE", + // "CUSTOM_INTERSTITIAL", + // "ENHANCED_BANNER", + // "ENHANCED_IMAGE", + // "FLASH_INPAGE", + // "HTML5_BANNER", + // "IMAGE", + // "INSTREAM_VIDEO", + // "INTERNAL_REDIRECT", + // "INTERSTITIAL_INTERNAL_REDIRECT", + // "REDIRECT", + // "RICH_MEDIA_EXPANDING", + // "RICH_MEDIA_IM_EXPAND", + // "RICH_MEDIA_INPAGE", + // "RICH_MEDIA_INPAGE_FLOATING", + // "RICH_MEDIA_INTERSTITIAL_FLOAT", + // "RICH_MEDIA_MOBILE_IN_APP", + // "RICH_MEDIA_MULTI_FLOATING", + // "RICH_MEDIA_PEEL_DOWN", + // "TRACKING_TEXT", + // "VAST_REDIRECT", + // "VPAID_LINEAR", + // "VPAID_NON_LINEAR" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creatives", + // "response": { + // "$ref": "CreativesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creatives.patch": + +type CreativesPatchCall struct { + s *Service + profileId int64 + id int64 + creative *Creative + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing creative. This method supports patch +// semantics. +func (r *CreativesService) Patch(profileId int64, id int64, creative *Creative) *CreativesPatchCall { + c := &CreativesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.creative = creative + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativesPatchCall) Fields(s ...googleapi.Field) *CreativesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativesPatchCall) Context(ctx context.Context) *CreativesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CreativesPatchCall) doRequest(alt string) (*http.Response, 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", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creatives.patch" call. +// Exactly one of *Creative or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Creative.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CreativesPatchCall) Do() (*Creative, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Creative{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing creative. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.creatives.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Creative ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creatives", + // "request": { + // "$ref": "Creative" + // }, + // "response": { + // "$ref": "Creative" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creatives.update": + +type CreativesUpdateCall struct { + s *Service + profileId int64 + creative *Creative + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing creative. +func (r *CreativesService) Update(profileId int64, creative *Creative) *CreativesUpdateCall { + c := &CreativesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creative = creative + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativesUpdateCall) Fields(s ...googleapi.Field) *CreativesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativesUpdateCall) Context(ctx context.Context) *CreativesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CreativesUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creatives.update" call. +// Exactly one of *Creative or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Creative.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CreativesUpdateCall) Do() (*Creative, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Creative{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing creative.", + // "httpMethod": "PUT", + // "id": "dfareporting.creatives.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creatives", + // "request": { + // "$ref": "Creative" + // }, + // "response": { + // "$ref": "Creative" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.dimensionValues.query": + +type DimensionValuesQueryCall struct { + s *Service + profileId int64 + dimensionvaluerequest *DimensionValueRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DimensionValuesQueryCall) Fields(s ...googleapi.Field) *DimensionValuesQueryCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DimensionValuesQueryCall) Context(ctx context.Context) *DimensionValuesQueryCall { + c.ctx_ = ctx + return c +} + +func (c *DimensionValuesQueryCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dimensionvalues/query") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.dimensionValues.query" call. +// Exactly one of *DimensionValueList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DimensionValueList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DimensionValuesQueryCall) Do() (*DimensionValueList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DimensionValueList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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.directorySiteContacts.get": + +type DirectorySiteContactsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one directory site contact by ID. +func (r *DirectorySiteContactsService) Get(profileId int64, id int64) *DirectorySiteContactsGetCall { + c := &DirectorySiteContactsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DirectorySiteContactsGetCall) Fields(s ...googleapi.Field) *DirectorySiteContactsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DirectorySiteContactsGetCall) IfNoneMatch(entityTag string) *DirectorySiteContactsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DirectorySiteContactsGetCall) Context(ctx context.Context) *DirectorySiteContactsGetCall { + c.ctx_ = ctx + return c +} + +func (c *DirectorySiteContactsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySiteContacts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.directorySiteContacts.get" call. +// Exactly one of *DirectorySiteContact or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DirectorySiteContact.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DirectorySiteContactsGetCall) Do() (*DirectorySiteContact, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DirectorySiteContact{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one directory site contact by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.directorySiteContacts.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Directory site contact ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/directorySiteContacts/{id}", + // "response": { + // "$ref": "DirectorySiteContact" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.directorySiteContacts.list": + +type DirectorySiteContactsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of directory site contacts, possibly filtered. +func (r *DirectorySiteContactsService) List(profileId int64) *DirectorySiteContactsListCall { + c := &DirectorySiteContactsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// DirectorySiteIds sets the optional parameter "directorySiteIds": +// Select only directory site contacts with these directory site IDs. +// This is a required field. +func (c *DirectorySiteContactsListCall) DirectorySiteIds(directorySiteIds int64) *DirectorySiteContactsListCall { + c.opt_["directorySiteIds"] = directorySiteIds + return c +} + +// Ids sets the optional parameter "ids": Select only directory site +// contacts with these IDs. +func (c *DirectorySiteContactsListCall) Ids(ids int64) *DirectorySiteContactsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *DirectorySiteContactsListCall) MaxResults(maxResults int64) *DirectorySiteContactsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *DirectorySiteContactsListCall) PageToken(pageToken string) *DirectorySiteContactsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name, ID or email. Wildcards (*) are +// allowed. For example, "directory site contact*2015" will return +// objects with names like "directory site contact June 2015", +// "directory site contact April 2015", or simply "directory site +// contact 2015". Most of the searches also add wildcards implicitly at +// the start and the end of the search string. For example, a search +// string of "directory site contact" will match objects with name "my +// directory site contact", "directory site contact 2015", or simply +// "directory site contact". +func (c *DirectorySiteContactsListCall) SearchString(searchString string) *DirectorySiteContactsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *DirectorySiteContactsListCall) SortField(sortField string) *DirectorySiteContactsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *DirectorySiteContactsListCall) SortOrder(sortOrder string) *DirectorySiteContactsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DirectorySiteContactsListCall) Fields(s ...googleapi.Field) *DirectorySiteContactsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DirectorySiteContactsListCall) IfNoneMatch(entityTag string) *DirectorySiteContactsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DirectorySiteContactsListCall) Context(ctx context.Context) *DirectorySiteContactsListCall { + c.ctx_ = ctx + return c +} + +func (c *DirectorySiteContactsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["directorySiteIds"]; ok { + params.Set("directorySiteIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySiteContacts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.directorySiteContacts.list" call. +// Exactly one of *DirectorySiteContactsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *DirectorySiteContactsListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *DirectorySiteContactsListCall) Do() (*DirectorySiteContactsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DirectorySiteContactsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of directory site contacts, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.directorySiteContacts.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "directorySiteIds": { + // "description": "Select only directory site contacts with these directory site IDs. This is a required field.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only directory site contacts with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, \"directory site contact*2015\" will return objects with names like \"directory site contact June 2015\", \"directory site contact April 2015\", or simply \"directory site contact 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"directory site contact\" will match objects with name \"my directory site contact\", \"directory site contact 2015\", or simply \"directory site contact\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/directorySiteContacts", + // "response": { + // "$ref": "DirectorySiteContactsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.directorySites.get": + +type DirectorySitesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one directory site by ID. +func (r *DirectorySitesService) Get(profileId int64, id int64) *DirectorySitesGetCall { + c := &DirectorySitesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DirectorySitesGetCall) Fields(s ...googleapi.Field) *DirectorySitesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DirectorySitesGetCall) IfNoneMatch(entityTag string) *DirectorySitesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DirectorySitesGetCall) Context(ctx context.Context) *DirectorySitesGetCall { + c.ctx_ = ctx + return c +} + +func (c *DirectorySitesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.directorySites.get" call. +// Exactly one of *DirectorySite or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DirectorySite.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DirectorySitesGetCall) Do() (*DirectorySite, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DirectorySite{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one directory site by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.directorySites.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Directory site ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/directorySites/{id}", + // "response": { + // "$ref": "DirectorySite" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.directorySites.list": + +type DirectorySitesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of directory sites, possibly filtered. +func (r *DirectorySitesService) List(profileId int64) *DirectorySitesListCall { + c := &DirectorySitesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AcceptsInStreamVideoPlacements sets the optional parameter +// "acceptsInStreamVideoPlacements": This search filter is no longer +// supported and will have no effect on the results returned. +func (c *DirectorySitesListCall) AcceptsInStreamVideoPlacements(acceptsInStreamVideoPlacements bool) *DirectorySitesListCall { + c.opt_["acceptsInStreamVideoPlacements"] = acceptsInStreamVideoPlacements + return c +} + +// AcceptsInterstitialPlacements sets the optional parameter +// "acceptsInterstitialPlacements": This search filter is no longer +// supported and will have no effect on the results returned. +func (c *DirectorySitesListCall) AcceptsInterstitialPlacements(acceptsInterstitialPlacements bool) *DirectorySitesListCall { + c.opt_["acceptsInterstitialPlacements"] = acceptsInterstitialPlacements + return c +} + +// AcceptsPublisherPaidPlacements sets the optional parameter +// "acceptsPublisherPaidPlacements": Select only directory sites that +// accept publisher paid placements. This field can be left blank. +func (c *DirectorySitesListCall) AcceptsPublisherPaidPlacements(acceptsPublisherPaidPlacements bool) *DirectorySitesListCall { + c.opt_["acceptsPublisherPaidPlacements"] = acceptsPublisherPaidPlacements + return c +} + +// Active sets the optional parameter "active": Select only active +// directory sites. Leave blank to retrieve both active and inactive +// directory sites. +func (c *DirectorySitesListCall) Active(active bool) *DirectorySitesListCall { + c.opt_["active"] = active + return c +} + +// CountryId sets the optional parameter "countryId": Select only +// directory sites with this country ID. +func (c *DirectorySitesListCall) CountryId(countryId int64) *DirectorySitesListCall { + c.opt_["countryId"] = countryId + return c +} + +// DfpNetworkCode sets the optional parameter "dfp_network_code": Select +// only directory sites with this DFP network code. +func (c *DirectorySitesListCall) DfpNetworkCode(dfpNetworkCode string) *DirectorySitesListCall { + c.opt_["dfp_network_code"] = dfpNetworkCode + return c +} + +// Ids sets the optional parameter "ids": Select only directory sites +// with these IDs. +func (c *DirectorySitesListCall) Ids(ids int64) *DirectorySitesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *DirectorySitesListCall) MaxResults(maxResults int64) *DirectorySitesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *DirectorySitesListCall) PageToken(pageToken string) *DirectorySitesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// ParentId sets the optional parameter "parentId": Select only +// directory sites with this parent ID. +func (c *DirectorySitesListCall) ParentId(parentId int64) *DirectorySitesListCall { + c.opt_["parentId"] = parentId + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name, ID or URL. Wildcards (*) are allowed. +// For example, "directory site*2015" will return objects with names +// like "directory site June 2015", "directory site April 2015", or +// simply "directory site 2015". Most of the searches also add wildcards +// implicitly at the start and the end of the search string. For +// example, a search string of "directory site" will match objects with +// name "my directory site", "directory site 2015" or simply, "directory +// site". +func (c *DirectorySitesListCall) SearchString(searchString string) *DirectorySitesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *DirectorySitesListCall) SortField(sortField string) *DirectorySitesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *DirectorySitesListCall) SortOrder(sortOrder string) *DirectorySitesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DirectorySitesListCall) Fields(s ...googleapi.Field) *DirectorySitesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DirectorySitesListCall) IfNoneMatch(entityTag string) *DirectorySitesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DirectorySitesListCall) Context(ctx context.Context) *DirectorySitesListCall { + c.ctx_ = ctx + return c +} + +func (c *DirectorySitesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["acceptsInStreamVideoPlacements"]; ok { + params.Set("acceptsInStreamVideoPlacements", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["acceptsInterstitialPlacements"]; ok { + params.Set("acceptsInterstitialPlacements", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["acceptsPublisherPaidPlacements"]; ok { + params.Set("acceptsPublisherPaidPlacements", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["active"]; ok { + params.Set("active", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["countryId"]; ok { + params.Set("countryId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["dfp_network_code"]; ok { + params.Set("dfp_network_code", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["parentId"]; ok { + params.Set("parentId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.directorySites.list" call. +// Exactly one of *DirectorySitesListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *DirectorySitesListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DirectorySitesListCall) Do() (*DirectorySitesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DirectorySitesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of directory sites, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.directorySites.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "acceptsInStreamVideoPlacements": { + // "description": "This search filter is no longer supported and will have no effect on the results returned.", + // "location": "query", + // "type": "boolean" + // }, + // "acceptsInterstitialPlacements": { + // "description": "This search filter is no longer supported and will have no effect on the results returned.", + // "location": "query", + // "type": "boolean" + // }, + // "acceptsPublisherPaidPlacements": { + // "description": "Select only directory sites that accept publisher paid placements. This field can be left blank.", + // "location": "query", + // "type": "boolean" + // }, + // "active": { + // "description": "Select only active directory sites. Leave blank to retrieve both active and inactive directory sites.", + // "location": "query", + // "type": "boolean" + // }, + // "countryId": { + // "description": "Select only directory sites with this country ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "dfp_network_code": { + // "description": "Select only directory sites with this DFP network code.", + // "location": "query", + // "type": "string" + // }, + // "ids": { + // "description": "Select only directory sites with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "parentId": { + // "description": "Select only directory sites with this parent ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name, ID or URL. Wildcards (*) are allowed. For example, \"directory site*2015\" will return objects with names like \"directory site June 2015\", \"directory site April 2015\", or simply \"directory site 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"directory site\" will match objects with name \"my directory site\", \"directory site 2015\" or simply, \"directory site\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/directorySites", + // "response": { + // "$ref": "DirectorySitesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.eventTags.delete": + +type EventTagsDeleteCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing event tag. +func (r *EventTagsService) Delete(profileId int64, id int64) *EventTagsDeleteCall { + c := &EventTagsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventTagsDeleteCall) Fields(s ...googleapi.Field) *EventTagsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventTagsDeleteCall) Context(ctx context.Context) *EventTagsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *EventTagsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.eventTags.delete" call. +func (c *EventTagsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing event tag.", + // "httpMethod": "DELETE", + // "id": "dfareporting.eventTags.delete", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Event tag ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/eventTags/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.eventTags.get": + +type EventTagsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one event tag by ID. +func (r *EventTagsService) Get(profileId int64, id int64) *EventTagsGetCall { + c := &EventTagsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventTagsGetCall) Fields(s ...googleapi.Field) *EventTagsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EventTagsGetCall) IfNoneMatch(entityTag string) *EventTagsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventTagsGetCall) Context(ctx context.Context) *EventTagsGetCall { + c.ctx_ = ctx + return c +} + +func (c *EventTagsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.eventTags.get" call. +// Exactly one of *EventTag or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *EventTag.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EventTagsGetCall) Do() (*EventTag, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EventTag{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one event tag by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.eventTags.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Event tag ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/eventTags/{id}", + // "response": { + // "$ref": "EventTag" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.eventTags.insert": + +type EventTagsInsertCall struct { + s *Service + profileId int64 + eventtag *EventTag + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new event tag. +func (r *EventTagsService) Insert(profileId int64, eventtag *EventTag) *EventTagsInsertCall { + c := &EventTagsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.eventtag = eventtag + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventTagsInsertCall) Fields(s ...googleapi.Field) *EventTagsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventTagsInsertCall) Context(ctx context.Context) *EventTagsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *EventTagsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.eventTags.insert" call. +// Exactly one of *EventTag or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *EventTag.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EventTagsInsertCall) Do() (*EventTag, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EventTag{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new event tag.", + // "httpMethod": "POST", + // "id": "dfareporting.eventTags.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/eventTags", + // "request": { + // "$ref": "EventTag" + // }, + // "response": { + // "$ref": "EventTag" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.eventTags.list": + +type EventTagsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of event tags, possibly filtered. +func (r *EventTagsService) List(profileId int64) *EventTagsListCall { + c := &EventTagsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdId sets the optional parameter "adId": Select only event tags that +// belong to this ad. +func (c *EventTagsListCall) AdId(adId int64) *EventTagsListCall { + c.opt_["adId"] = adId + return c +} + +// AdvertiserId sets the optional parameter "advertiserId": Select only +// event tags that belong to this advertiser. +func (c *EventTagsListCall) AdvertiserId(advertiserId int64) *EventTagsListCall { + c.opt_["advertiserId"] = advertiserId + return c +} + +// CampaignId sets the optional parameter "campaignId": Select only +// event tags that belong to this campaign. +func (c *EventTagsListCall) CampaignId(campaignId int64) *EventTagsListCall { + c.opt_["campaignId"] = campaignId + return c +} + +// DefinitionsOnly sets the optional parameter "definitionsOnly": +// Examine only the specified campaign or advertiser's event tags for +// matching selector criteria. When set to false, the parent advertiser +// and parent campaign of the specified ad or campaign is examined as +// well. In addition, when set to false, the status field is examined as +// well, along with the enabledByDefault field. This parameter can not +// be set to true when adId is specified as ads do not define their own +// even tags. +func (c *EventTagsListCall) DefinitionsOnly(definitionsOnly bool) *EventTagsListCall { + c.opt_["definitionsOnly"] = definitionsOnly + return c +} + +// Enabled sets the optional parameter "enabled": Select only enabled +// event tags. What is considered enabled or disabled depends on the +// definitionsOnly parameter. When definitionsOnly is set to true, only +// the specified advertiser or campaign's event tags' enabledByDefault +// field is examined. When definitionsOnly is set to false, the +// specified ad or specified campaign's parent advertiser's or parent +// campaign's event tags' enabledByDefault and status fields are +// examined as well. +func (c *EventTagsListCall) Enabled(enabled bool) *EventTagsListCall { + c.opt_["enabled"] = enabled + return c +} + +// EventTagTypes sets the optional parameter "eventTagTypes": Select +// only event tags with the specified event tag types. Event tag types +// can be used to specify whether to use a third-party pixel, a +// third-party JavaScript URL, or a third-party click-through URL for +// either impression or click tracking. +// +// Possible values: +// "CLICK_THROUGH_EVENT_TAG" +// "IMPRESSION_IMAGE_EVENT_TAG" +// "IMPRESSION_JAVASCRIPT_EVENT_TAG" +func (c *EventTagsListCall) EventTagTypes(eventTagTypes string) *EventTagsListCall { + c.opt_["eventTagTypes"] = eventTagTypes + return c +} + +// Ids sets the optional parameter "ids": Select only event tags with +// these IDs. +func (c *EventTagsListCall) Ids(ids int64) *EventTagsListCall { + c.opt_["ids"] = ids + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "eventtag*2015" will return objects with names like +// "eventtag June 2015", "eventtag April 2015", or simply "eventtag +// 2015". Most of the searches also add wildcards implicitly at the +// start and the end of the search string. For example, a search string +// of "eventtag" will match objects with name "my eventtag", "eventtag +// 2015", or simply "eventtag". +func (c *EventTagsListCall) SearchString(searchString string) *EventTagsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *EventTagsListCall) SortField(sortField string) *EventTagsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *EventTagsListCall) SortOrder(sortOrder string) *EventTagsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventTagsListCall) Fields(s ...googleapi.Field) *EventTagsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EventTagsListCall) IfNoneMatch(entityTag string) *EventTagsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventTagsListCall) Context(ctx context.Context) *EventTagsListCall { + c.ctx_ = ctx + return c +} + +func (c *EventTagsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["adId"]; ok { + params.Set("adId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["advertiserId"]; ok { + params.Set("advertiserId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["campaignId"]; ok { + params.Set("campaignId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["definitionsOnly"]; ok { + params.Set("definitionsOnly", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["enabled"]; ok { + params.Set("enabled", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["eventTagTypes"]; ok { + params.Set("eventTagTypes", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.eventTags.list" call. +// Exactly one of *EventTagsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *EventTagsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EventTagsListCall) Do() (*EventTagsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EventTagsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of event tags, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.eventTags.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "adId": { + // "description": "Select only event tags that belong to this ad.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "advertiserId": { + // "description": "Select only event tags that belong to this advertiser.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "campaignId": { + // "description": "Select only event tags that belong to this campaign.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "definitionsOnly": { + // "description": "Examine only the specified campaign or advertiser's event tags for matching selector criteria. When set to false, the parent advertiser and parent campaign of the specified ad or campaign is examined as well. In addition, when set to false, the status field is examined as well, along with the enabledByDefault field. This parameter can not be set to true when adId is specified as ads do not define their own even tags.", + // "location": "query", + // "type": "boolean" + // }, + // "enabled": { + // "description": "Select only enabled event tags. What is considered enabled or disabled depends on the definitionsOnly parameter. When definitionsOnly is set to true, only the specified advertiser or campaign's event tags' enabledByDefault field is examined. When definitionsOnly is set to false, the specified ad or specified campaign's parent advertiser's or parent campaign's event tags' enabledByDefault and status fields are examined as well.", + // "location": "query", + // "type": "boolean" + // }, + // "eventTagTypes": { + // "description": "Select only event tags with the specified event tag types. Event tag types can be used to specify whether to use a third-party pixel, a third-party JavaScript URL, or a third-party click-through URL for either impression or click tracking.", + // "enum": [ + // "CLICK_THROUGH_EVENT_TAG", + // "IMPRESSION_IMAGE_EVENT_TAG", + // "IMPRESSION_JAVASCRIPT_EVENT_TAG" + // ], + // "enumDescriptions": [ + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only event tags with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"eventtag*2015\" will return objects with names like \"eventtag June 2015\", \"eventtag April 2015\", or simply \"eventtag 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"eventtag\" will match objects with name \"my eventtag\", \"eventtag 2015\", or simply \"eventtag\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/eventTags", + // "response": { + // "$ref": "EventTagsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.eventTags.patch": + +type EventTagsPatchCall struct { + s *Service + profileId int64 + id int64 + eventtag *EventTag + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing event tag. This method supports patch +// semantics. +func (r *EventTagsService) Patch(profileId int64, id int64, eventtag *EventTag) *EventTagsPatchCall { + c := &EventTagsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.eventtag = eventtag + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventTagsPatchCall) Fields(s ...googleapi.Field) *EventTagsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventTagsPatchCall) Context(ctx context.Context) *EventTagsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *EventTagsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.eventTags.patch" call. +// Exactly one of *EventTag or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *EventTag.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EventTagsPatchCall) Do() (*EventTag, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EventTag{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing event tag. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.eventTags.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Event tag ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/eventTags", + // "request": { + // "$ref": "EventTag" + // }, + // "response": { + // "$ref": "EventTag" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.eventTags.update": + +type EventTagsUpdateCall struct { + s *Service + profileId int64 + eventtag *EventTag + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing event tag. +func (r *EventTagsService) Update(profileId int64, eventtag *EventTag) *EventTagsUpdateCall { + c := &EventTagsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.eventtag = eventtag + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventTagsUpdateCall) Fields(s ...googleapi.Field) *EventTagsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventTagsUpdateCall) Context(ctx context.Context) *EventTagsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *EventTagsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.eventTags.update" call. +// Exactly one of *EventTag or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *EventTag.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EventTagsUpdateCall) Do() (*EventTag, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EventTag{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing event tag.", + // "httpMethod": "PUT", + // "id": "dfareporting.eventTags.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/eventTags", + // "request": { + // "$ref": "EventTag" + // }, + // "response": { + // "$ref": "EventTag" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.files.get": + +type FilesGetCall struct { + s *Service + reportId int64 + fileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FilesGetCall) IfNoneMatch(entityTag string) *FilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FilesGetCall) Context(ctx context.Context) *FilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *FilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{reportId}/files/{fileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "reportId": strconv.FormatInt(c.reportId, 10), + "fileId": strconv.FormatInt(c.fileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *FilesGetCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "dfareporting.files.get" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FilesGetCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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'. +// +// Possible values: +// "ALL" - All files in account. +// "MINE" (default) - My files. +// "SHARED_WITH_ME" - Files shared with me. +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. +// +// Possible values: +// "ID" - Sort by file ID. +// "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field. +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'. +// +// Possible values: +// "ASCENDING" - Ascending order. +// "DESCENDING" (default) - Descending order. +func (c *FilesListCall) SortOrder(sortOrder string) *FilesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FilesListCall) Context(ctx context.Context) *FilesListCall { + c.ctx_ = ctx + return c +} + +func (c *FilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/files") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.files.list" call. +// Exactly one of *FileList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *FileList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FilesListCall) Do() (*FileList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FileList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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.floodlightActivities.delete": + +type FloodlightActivitiesDeleteCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing floodlight activity. +func (r *FloodlightActivitiesService) Delete(profileId int64, id int64) *FloodlightActivitiesDeleteCall { + c := &FloodlightActivitiesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivitiesDeleteCall) Fields(s ...googleapi.Field) *FloodlightActivitiesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivitiesDeleteCall) Context(ctx context.Context) *FloodlightActivitiesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivitiesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivities.delete" call. +func (c *FloodlightActivitiesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing floodlight activity.", + // "httpMethod": "DELETE", + // "id": "dfareporting.floodlightActivities.delete", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Floodlight activity ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivities/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivities.generatetag": + +type FloodlightActivitiesGeneratetagCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Generatetag: Generates a tag for a floodlight activity. +func (r *FloodlightActivitiesService) Generatetag(profileId int64) *FloodlightActivitiesGeneratetagCall { + c := &FloodlightActivitiesGeneratetagCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// FloodlightActivityId sets the optional parameter +// "floodlightActivityId": Floodlight activity ID for which we want to +// generate a tag. +func (c *FloodlightActivitiesGeneratetagCall) FloodlightActivityId(floodlightActivityId int64) *FloodlightActivitiesGeneratetagCall { + c.opt_["floodlightActivityId"] = floodlightActivityId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivitiesGeneratetagCall) Fields(s ...googleapi.Field) *FloodlightActivitiesGeneratetagCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivitiesGeneratetagCall) Context(ctx context.Context) *FloodlightActivitiesGeneratetagCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivitiesGeneratetagCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["floodlightActivityId"]; ok { + params.Set("floodlightActivityId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/generatetag") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivities.generatetag" call. +// Exactly one of *FloodlightActivitiesGenerateTagResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *FloodlightActivitiesGenerateTagResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivitiesGeneratetagCall) Do() (*FloodlightActivitiesGenerateTagResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivitiesGenerateTagResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generates a tag for a floodlight activity.", + // "httpMethod": "POST", + // "id": "dfareporting.floodlightActivities.generatetag", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "floodlightActivityId": { + // "description": "Floodlight activity ID for which we want to generate a tag.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivities/generatetag", + // "response": { + // "$ref": "FloodlightActivitiesGenerateTagResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivities.get": + +type FloodlightActivitiesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one floodlight activity by ID. +func (r *FloodlightActivitiesService) Get(profileId int64, id int64) *FloodlightActivitiesGetCall { + c := &FloodlightActivitiesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivitiesGetCall) Fields(s ...googleapi.Field) *FloodlightActivitiesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FloodlightActivitiesGetCall) IfNoneMatch(entityTag string) *FloodlightActivitiesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivitiesGetCall) Context(ctx context.Context) *FloodlightActivitiesGetCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivitiesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivities.get" call. +// Exactly one of *FloodlightActivity or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightActivity.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivitiesGetCall) Do() (*FloodlightActivity, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivity{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one floodlight activity by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.floodlightActivities.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Floodlight activity ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivities/{id}", + // "response": { + // "$ref": "FloodlightActivity" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivities.insert": + +type FloodlightActivitiesInsertCall struct { + s *Service + profileId int64 + floodlightactivity *FloodlightActivity + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new floodlight activity. +func (r *FloodlightActivitiesService) Insert(profileId int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesInsertCall { + c := &FloodlightActivitiesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.floodlightactivity = floodlightactivity + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivitiesInsertCall) Fields(s ...googleapi.Field) *FloodlightActivitiesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivitiesInsertCall) Context(ctx context.Context) *FloodlightActivitiesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivitiesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivities.insert" call. +// Exactly one of *FloodlightActivity or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightActivity.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivitiesInsertCall) Do() (*FloodlightActivity, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivity{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new floodlight activity.", + // "httpMethod": "POST", + // "id": "dfareporting.floodlightActivities.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivities", + // "request": { + // "$ref": "FloodlightActivity" + // }, + // "response": { + // "$ref": "FloodlightActivity" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivities.list": + +type FloodlightActivitiesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of floodlight activities, possibly filtered. +func (r *FloodlightActivitiesService) List(profileId int64) *FloodlightActivitiesListCall { + c := &FloodlightActivitiesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdvertiserId sets the optional parameter "advertiserId": Select only +// floodlight activities for the specified advertiser ID. Must specify +// either ids, advertiserId, or floodlightConfigurationId for a +// non-empty result. +func (c *FloodlightActivitiesListCall) AdvertiserId(advertiserId int64) *FloodlightActivitiesListCall { + c.opt_["advertiserId"] = advertiserId + return c +} + +// FloodlightActivityGroupIds sets the optional parameter +// "floodlightActivityGroupIds": Select only floodlight activities with +// the specified floodlight activity group IDs. +func (c *FloodlightActivitiesListCall) FloodlightActivityGroupIds(floodlightActivityGroupIds int64) *FloodlightActivitiesListCall { + c.opt_["floodlightActivityGroupIds"] = floodlightActivityGroupIds + return c +} + +// FloodlightActivityGroupName sets the optional parameter +// "floodlightActivityGroupName": Select only floodlight activities with +// the specified floodlight activity group name. +func (c *FloodlightActivitiesListCall) FloodlightActivityGroupName(floodlightActivityGroupName string) *FloodlightActivitiesListCall { + c.opt_["floodlightActivityGroupName"] = floodlightActivityGroupName + return c +} + +// FloodlightActivityGroupTagString sets the optional parameter +// "floodlightActivityGroupTagString": Select only floodlight activities +// with the specified floodlight activity group tag string. +func (c *FloodlightActivitiesListCall) FloodlightActivityGroupTagString(floodlightActivityGroupTagString string) *FloodlightActivitiesListCall { + c.opt_["floodlightActivityGroupTagString"] = floodlightActivityGroupTagString + return c +} + +// FloodlightActivityGroupType sets the optional parameter +// "floodlightActivityGroupType": Select only floodlight activities with +// the specified floodlight activity group type. +// +// Possible values: +// "COUNTER" +// "SALE" +func (c *FloodlightActivitiesListCall) FloodlightActivityGroupType(floodlightActivityGroupType string) *FloodlightActivitiesListCall { + c.opt_["floodlightActivityGroupType"] = floodlightActivityGroupType + return c +} + +// FloodlightConfigurationId sets the optional parameter +// "floodlightConfigurationId": Select only floodlight activities for +// the specified floodlight configuration ID. Must specify either ids, +// advertiserId, or floodlightConfigurationId for a non-empty result. +func (c *FloodlightActivitiesListCall) FloodlightConfigurationId(floodlightConfigurationId int64) *FloodlightActivitiesListCall { + c.opt_["floodlightConfigurationId"] = floodlightConfigurationId + return c +} + +// Ids sets the optional parameter "ids": Select only floodlight +// activities with the specified IDs. Must specify either ids, +// advertiserId, or floodlightConfigurationId for a non-empty result. +func (c *FloodlightActivitiesListCall) Ids(ids int64) *FloodlightActivitiesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *FloodlightActivitiesListCall) MaxResults(maxResults int64) *FloodlightActivitiesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *FloodlightActivitiesListCall) PageToken(pageToken string) *FloodlightActivitiesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "floodlightactivity*2015" will return objects with names +// like "floodlightactivity June 2015", "floodlightactivity April 2015", +// or simply "floodlightactivity 2015". Most of the searches also add +// wildcards implicitly at the start and the end of the search string. +// For example, a search string of "floodlightactivity" will match +// objects with name "my floodlightactivity activity", +// "floodlightactivity 2015", or simply "floodlightactivity". +func (c *FloodlightActivitiesListCall) SearchString(searchString string) *FloodlightActivitiesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *FloodlightActivitiesListCall) SortField(sortField string) *FloodlightActivitiesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *FloodlightActivitiesListCall) SortOrder(sortOrder string) *FloodlightActivitiesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// TagString sets the optional parameter "tagString": Select only +// floodlight activities with the specified tag string. +func (c *FloodlightActivitiesListCall) TagString(tagString string) *FloodlightActivitiesListCall { + c.opt_["tagString"] = tagString + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivitiesListCall) Fields(s ...googleapi.Field) *FloodlightActivitiesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FloodlightActivitiesListCall) IfNoneMatch(entityTag string) *FloodlightActivitiesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivitiesListCall) Context(ctx context.Context) *FloodlightActivitiesListCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivitiesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserId"]; ok { + params.Set("advertiserId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["floodlightActivityGroupIds"]; ok { + params.Set("floodlightActivityGroupIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["floodlightActivityGroupName"]; ok { + params.Set("floodlightActivityGroupName", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["floodlightActivityGroupTagString"]; ok { + params.Set("floodlightActivityGroupTagString", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["floodlightActivityGroupType"]; ok { + params.Set("floodlightActivityGroupType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["floodlightConfigurationId"]; ok { + params.Set("floodlightConfigurationId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["tagString"]; ok { + params.Set("tagString", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivities.list" call. +// Exactly one of *FloodlightActivitiesListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *FloodlightActivitiesListResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivitiesListCall) Do() (*FloodlightActivitiesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivitiesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of floodlight activities, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.floodlightActivities.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "advertiserId": { + // "description": "Select only floodlight activities for the specified advertiser ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "floodlightActivityGroupIds": { + // "description": "Select only floodlight activities with the specified floodlight activity group IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "floodlightActivityGroupName": { + // "description": "Select only floodlight activities with the specified floodlight activity group name.", + // "location": "query", + // "type": "string" + // }, + // "floodlightActivityGroupTagString": { + // "description": "Select only floodlight activities with the specified floodlight activity group tag string.", + // "location": "query", + // "type": "string" + // }, + // "floodlightActivityGroupType": { + // "description": "Select only floodlight activities with the specified floodlight activity group type.", + // "enum": [ + // "COUNTER", + // "SALE" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "floodlightConfigurationId": { + // "description": "Select only floodlight activities for the specified floodlight configuration ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ids": { + // "description": "Select only floodlight activities with the specified IDs. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"floodlightactivity*2015\" will return objects with names like \"floodlightactivity June 2015\", \"floodlightactivity April 2015\", or simply \"floodlightactivity 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"floodlightactivity\" will match objects with name \"my floodlightactivity activity\", \"floodlightactivity 2015\", or simply \"floodlightactivity\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "tagString": { + // "description": "Select only floodlight activities with the specified tag string.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivities", + // "response": { + // "$ref": "FloodlightActivitiesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivities.patch": + +type FloodlightActivitiesPatchCall struct { + s *Service + profileId int64 + id int64 + floodlightactivity *FloodlightActivity + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing floodlight activity. This method supports +// patch semantics. +func (r *FloodlightActivitiesService) Patch(profileId int64, id int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesPatchCall { + c := &FloodlightActivitiesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.floodlightactivity = floodlightactivity + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivitiesPatchCall) Fields(s ...googleapi.Field) *FloodlightActivitiesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivitiesPatchCall) Context(ctx context.Context) *FloodlightActivitiesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivitiesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivities.patch" call. +// Exactly one of *FloodlightActivity or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightActivity.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivitiesPatchCall) Do() (*FloodlightActivity, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivity{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing floodlight activity. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.floodlightActivities.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Floodlight activity ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivities", + // "request": { + // "$ref": "FloodlightActivity" + // }, + // "response": { + // "$ref": "FloodlightActivity" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivities.update": + +type FloodlightActivitiesUpdateCall struct { + s *Service + profileId int64 + floodlightactivity *FloodlightActivity + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing floodlight activity. +func (r *FloodlightActivitiesService) Update(profileId int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesUpdateCall { + c := &FloodlightActivitiesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.floodlightactivity = floodlightactivity + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivitiesUpdateCall) Fields(s ...googleapi.Field) *FloodlightActivitiesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivitiesUpdateCall) Context(ctx context.Context) *FloodlightActivitiesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivitiesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivities.update" call. +// Exactly one of *FloodlightActivity or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightActivity.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivitiesUpdateCall) Do() (*FloodlightActivity, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivity{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing floodlight activity.", + // "httpMethod": "PUT", + // "id": "dfareporting.floodlightActivities.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivities", + // "request": { + // "$ref": "FloodlightActivity" + // }, + // "response": { + // "$ref": "FloodlightActivity" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivityGroups.delete": + +type FloodlightActivityGroupsDeleteCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing floodlight activity group. +func (r *FloodlightActivityGroupsService) Delete(profileId int64, id int64) *FloodlightActivityGroupsDeleteCall { + c := &FloodlightActivityGroupsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivityGroupsDeleteCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivityGroupsDeleteCall) Context(ctx context.Context) *FloodlightActivityGroupsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivityGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivityGroups.delete" call. +func (c *FloodlightActivityGroupsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing floodlight activity group.", + // "httpMethod": "DELETE", + // "id": "dfareporting.floodlightActivityGroups.delete", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Floodlight activity Group ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivityGroups/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivityGroups.get": + +type FloodlightActivityGroupsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one floodlight activity group by ID. +func (r *FloodlightActivityGroupsService) Get(profileId int64, id int64) *FloodlightActivityGroupsGetCall { + c := &FloodlightActivityGroupsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivityGroupsGetCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FloodlightActivityGroupsGetCall) IfNoneMatch(entityTag string) *FloodlightActivityGroupsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivityGroupsGetCall) Context(ctx context.Context) *FloodlightActivityGroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivityGroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivityGroups.get" call. +// Exactly one of *FloodlightActivityGroup or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightActivityGroup.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivityGroupsGetCall) Do() (*FloodlightActivityGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivityGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one floodlight activity group by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.floodlightActivityGroups.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Floodlight activity Group ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivityGroups/{id}", + // "response": { + // "$ref": "FloodlightActivityGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivityGroups.insert": + +type FloodlightActivityGroupsInsertCall struct { + s *Service + profileId int64 + floodlightactivitygroup *FloodlightActivityGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new floodlight activity group. +func (r *FloodlightActivityGroupsService) Insert(profileId int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsInsertCall { + c := &FloodlightActivityGroupsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.floodlightactivitygroup = floodlightactivitygroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivityGroupsInsertCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivityGroupsInsertCall) Context(ctx context.Context) *FloodlightActivityGroupsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivityGroupsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivityGroups.insert" call. +// Exactly one of *FloodlightActivityGroup or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightActivityGroup.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivityGroupsInsertCall) Do() (*FloodlightActivityGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivityGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new floodlight activity group.", + // "httpMethod": "POST", + // "id": "dfareporting.floodlightActivityGroups.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivityGroups", + // "request": { + // "$ref": "FloodlightActivityGroup" + // }, + // "response": { + // "$ref": "FloodlightActivityGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivityGroups.list": + +type FloodlightActivityGroupsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of floodlight activity groups, possibly +// filtered. +func (r *FloodlightActivityGroupsService) List(profileId int64) *FloodlightActivityGroupsListCall { + c := &FloodlightActivityGroupsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdvertiserId sets the optional parameter "advertiserId": Select only +// floodlight activity groups with the specified advertiser ID. Must +// specify either advertiserId or floodlightConfigurationId for a +// non-empty result. +func (c *FloodlightActivityGroupsListCall) AdvertiserId(advertiserId int64) *FloodlightActivityGroupsListCall { + c.opt_["advertiserId"] = advertiserId + return c +} + +// FloodlightConfigurationId sets the optional parameter +// "floodlightConfigurationId": Select only floodlight activity groups +// with the specified floodlight configuration ID. Must specify either +// advertiserId, or floodlightConfigurationId for a non-empty result. +func (c *FloodlightActivityGroupsListCall) FloodlightConfigurationId(floodlightConfigurationId int64) *FloodlightActivityGroupsListCall { + c.opt_["floodlightConfigurationId"] = floodlightConfigurationId + return c +} + +// Ids sets the optional parameter "ids": Select only floodlight +// activity groups with the specified IDs. Must specify either +// advertiserId or floodlightConfigurationId for a non-empty result. +func (c *FloodlightActivityGroupsListCall) Ids(ids int64) *FloodlightActivityGroupsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *FloodlightActivityGroupsListCall) MaxResults(maxResults int64) *FloodlightActivityGroupsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *FloodlightActivityGroupsListCall) PageToken(pageToken string) *FloodlightActivityGroupsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "floodlightactivitygroup*2015" will return objects with +// names like "floodlightactivitygroup June 2015", +// "floodlightactivitygroup April 2015", or simply +// "floodlightactivitygroup 2015". Most of the searches also add +// wildcards implicitly at the start and the end of the search string. +// For example, a search string of "floodlightactivitygroup" will match +// objects with name "my floodlightactivitygroup activity", +// "floodlightactivitygroup 2015", or simply "floodlightactivitygroup". +func (c *FloodlightActivityGroupsListCall) SearchString(searchString string) *FloodlightActivityGroupsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *FloodlightActivityGroupsListCall) SortField(sortField string) *FloodlightActivityGroupsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *FloodlightActivityGroupsListCall) SortOrder(sortOrder string) *FloodlightActivityGroupsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Type sets the optional parameter "type": Select only floodlight +// activity groups with the specified floodlight activity group type. +// +// Possible values: +// "COUNTER" +// "SALE" +func (c *FloodlightActivityGroupsListCall) Type(type_ string) *FloodlightActivityGroupsListCall { + c.opt_["type"] = type_ + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivityGroupsListCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FloodlightActivityGroupsListCall) IfNoneMatch(entityTag string) *FloodlightActivityGroupsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivityGroupsListCall) Context(ctx context.Context) *FloodlightActivityGroupsListCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivityGroupsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserId"]; ok { + params.Set("advertiserId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["floodlightConfigurationId"]; ok { + params.Set("floodlightConfigurationId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["type"]; ok { + params.Set("type", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivityGroups.list" call. +// Exactly one of *FloodlightActivityGroupsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *FloodlightActivityGroupsListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FloodlightActivityGroupsListCall) Do() (*FloodlightActivityGroupsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivityGroupsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of floodlight activity groups, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.floodlightActivityGroups.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "advertiserId": { + // "description": "Select only floodlight activity groups with the specified advertiser ID. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "floodlightConfigurationId": { + // "description": "Select only floodlight activity groups with the specified floodlight configuration ID. Must specify either advertiserId, or floodlightConfigurationId for a non-empty result.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ids": { + // "description": "Select only floodlight activity groups with the specified IDs. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"floodlightactivitygroup*2015\" will return objects with names like \"floodlightactivitygroup June 2015\", \"floodlightactivitygroup April 2015\", or simply \"floodlightactivitygroup 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"floodlightactivitygroup\" will match objects with name \"my floodlightactivitygroup activity\", \"floodlightactivitygroup 2015\", or simply \"floodlightactivitygroup\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "type": { + // "description": "Select only floodlight activity groups with the specified floodlight activity group type.", + // "enum": [ + // "COUNTER", + // "SALE" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivityGroups", + // "response": { + // "$ref": "FloodlightActivityGroupsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivityGroups.patch": + +type FloodlightActivityGroupsPatchCall struct { + s *Service + profileId int64 + id int64 + floodlightactivitygroup *FloodlightActivityGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing floodlight activity group. This method +// supports patch semantics. +func (r *FloodlightActivityGroupsService) Patch(profileId int64, id int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsPatchCall { + c := &FloodlightActivityGroupsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.floodlightactivitygroup = floodlightactivitygroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivityGroupsPatchCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivityGroupsPatchCall) Context(ctx context.Context) *FloodlightActivityGroupsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivityGroupsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivityGroups.patch" call. +// Exactly one of *FloodlightActivityGroup or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightActivityGroup.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivityGroupsPatchCall) Do() (*FloodlightActivityGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivityGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing floodlight activity group. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.floodlightActivityGroups.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Floodlight activity Group ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivityGroups", + // "request": { + // "$ref": "FloodlightActivityGroup" + // }, + // "response": { + // "$ref": "FloodlightActivityGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivityGroups.update": + +type FloodlightActivityGroupsUpdateCall struct { + s *Service + profileId int64 + floodlightactivitygroup *FloodlightActivityGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing floodlight activity group. +func (r *FloodlightActivityGroupsService) Update(profileId int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsUpdateCall { + c := &FloodlightActivityGroupsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.floodlightactivitygroup = floodlightactivitygroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivityGroupsUpdateCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivityGroupsUpdateCall) Context(ctx context.Context) *FloodlightActivityGroupsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivityGroupsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivityGroups.update" call. +// Exactly one of *FloodlightActivityGroup or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightActivityGroup.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivityGroupsUpdateCall) Do() (*FloodlightActivityGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivityGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing floodlight activity group.", + // "httpMethod": "PUT", + // "id": "dfareporting.floodlightActivityGroups.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivityGroups", + // "request": { + // "$ref": "FloodlightActivityGroup" + // }, + // "response": { + // "$ref": "FloodlightActivityGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightConfigurations.get": + +type FloodlightConfigurationsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one floodlight configuration by ID. +func (r *FloodlightConfigurationsService) Get(profileId int64, id int64) *FloodlightConfigurationsGetCall { + c := &FloodlightConfigurationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightConfigurationsGetCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FloodlightConfigurationsGetCall) IfNoneMatch(entityTag string) *FloodlightConfigurationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightConfigurationsGetCall) Context(ctx context.Context) *FloodlightConfigurationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightConfigurationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightConfigurations.get" call. +// Exactly one of *FloodlightConfiguration or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightConfiguration.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightConfigurationsGetCall) Do() (*FloodlightConfiguration, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightConfiguration{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one floodlight configuration by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.floodlightConfigurations.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Floodlight configuration ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightConfigurations/{id}", + // "response": { + // "$ref": "FloodlightConfiguration" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightConfigurations.list": + +type FloodlightConfigurationsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of floodlight configurations, possibly +// filtered. +func (r *FloodlightConfigurationsService) List(profileId int64) *FloodlightConfigurationsListCall { + c := &FloodlightConfigurationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Ids sets the optional parameter "ids": Set of IDs of floodlight +// configurations to retrieve. Required field; otherwise an empty list +// will be returned. +func (c *FloodlightConfigurationsListCall) Ids(ids int64) *FloodlightConfigurationsListCall { + c.opt_["ids"] = ids + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightConfigurationsListCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FloodlightConfigurationsListCall) IfNoneMatch(entityTag string) *FloodlightConfigurationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightConfigurationsListCall) Context(ctx context.Context) *FloodlightConfigurationsListCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightConfigurationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightConfigurations.list" call. +// Exactly one of *FloodlightConfigurationsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *FloodlightConfigurationsListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FloodlightConfigurationsListCall) Do() (*FloodlightConfigurationsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightConfigurationsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of floodlight configurations, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.floodlightConfigurations.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "ids": { + // "description": "Set of IDs of floodlight configurations to retrieve. Required field; otherwise an empty list will be returned.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightConfigurations", + // "response": { + // "$ref": "FloodlightConfigurationsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightConfigurations.patch": + +type FloodlightConfigurationsPatchCall struct { + s *Service + profileId int64 + id int64 + floodlightconfiguration *FloodlightConfiguration + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing floodlight configuration. This method +// supports patch semantics. +func (r *FloodlightConfigurationsService) Patch(profileId int64, id int64, floodlightconfiguration *FloodlightConfiguration) *FloodlightConfigurationsPatchCall { + c := &FloodlightConfigurationsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.floodlightconfiguration = floodlightconfiguration + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightConfigurationsPatchCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightConfigurationsPatchCall) Context(ctx context.Context) *FloodlightConfigurationsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightConfigurationsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightconfiguration) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightConfigurations.patch" call. +// Exactly one of *FloodlightConfiguration or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightConfiguration.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightConfigurationsPatchCall) Do() (*FloodlightConfiguration, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightConfiguration{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing floodlight configuration. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.floodlightConfigurations.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Floodlight configuration ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightConfigurations", + // "request": { + // "$ref": "FloodlightConfiguration" + // }, + // "response": { + // "$ref": "FloodlightConfiguration" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightConfigurations.update": + +type FloodlightConfigurationsUpdateCall struct { + s *Service + profileId int64 + floodlightconfiguration *FloodlightConfiguration + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing floodlight configuration. +func (r *FloodlightConfigurationsService) Update(profileId int64, floodlightconfiguration *FloodlightConfiguration) *FloodlightConfigurationsUpdateCall { + c := &FloodlightConfigurationsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.floodlightconfiguration = floodlightconfiguration + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightConfigurationsUpdateCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightConfigurationsUpdateCall) Context(ctx context.Context) *FloodlightConfigurationsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightConfigurationsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightconfiguration) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightConfigurations.update" call. +// Exactly one of *FloodlightConfiguration or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightConfiguration.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightConfigurationsUpdateCall) Do() (*FloodlightConfiguration, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightConfiguration{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing floodlight configuration.", + // "httpMethod": "PUT", + // "id": "dfareporting.floodlightConfigurations.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightConfigurations", + // "request": { + // "$ref": "FloodlightConfiguration" + // }, + // "response": { + // "$ref": "FloodlightConfiguration" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.landingPages.delete": + +type LandingPagesDeleteCall struct { + s *Service + profileId int64 + campaignId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing campaign landing page. +func (r *LandingPagesService) Delete(profileId int64, campaignId int64, id int64) *LandingPagesDeleteCall { + c := &LandingPagesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaignId = campaignId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LandingPagesDeleteCall) Fields(s ...googleapi.Field) *LandingPagesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LandingPagesDeleteCall) Context(ctx context.Context) *LandingPagesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *LandingPagesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "campaignId": strconv.FormatInt(c.campaignId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.landingPages.delete" call. +func (c *LandingPagesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing campaign landing page.", + // "httpMethod": "DELETE", + // "id": "dfareporting.landingPages.delete", + // "parameterOrder": [ + // "profileId", + // "campaignId", + // "id" + // ], + // "parameters": { + // "campaignId": { + // "description": "Landing page campaign ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "id": { + // "description": "Landing page ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.landingPages.get": + +type LandingPagesGetCall struct { + s *Service + profileId int64 + campaignId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one campaign landing page by ID. +func (r *LandingPagesService) Get(profileId int64, campaignId int64, id int64) *LandingPagesGetCall { + c := &LandingPagesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaignId = campaignId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LandingPagesGetCall) Fields(s ...googleapi.Field) *LandingPagesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LandingPagesGetCall) IfNoneMatch(entityTag string) *LandingPagesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LandingPagesGetCall) Context(ctx context.Context) *LandingPagesGetCall { + c.ctx_ = ctx + return c +} + +func (c *LandingPagesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "campaignId": strconv.FormatInt(c.campaignId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.landingPages.get" call. +// Exactly one of *LandingPage or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LandingPage.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *LandingPagesGetCall) Do() (*LandingPage, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LandingPage{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one campaign landing page by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.landingPages.get", + // "parameterOrder": [ + // "profileId", + // "campaignId", + // "id" + // ], + // "parameters": { + // "campaignId": { + // "description": "Landing page campaign ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "id": { + // "description": "Landing page ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}", + // "response": { + // "$ref": "LandingPage" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.landingPages.insert": + +type LandingPagesInsertCall struct { + s *Service + profileId int64 + campaignId int64 + landingpage *LandingPage + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new landing page for the specified campaign. +func (r *LandingPagesService) Insert(profileId int64, campaignId int64, landingpage *LandingPage) *LandingPagesInsertCall { + c := &LandingPagesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaignId = campaignId + c.landingpage = landingpage + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LandingPagesInsertCall) Fields(s ...googleapi.Field) *LandingPagesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LandingPagesInsertCall) Context(ctx context.Context) *LandingPagesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *LandingPagesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "campaignId": strconv.FormatInt(c.campaignId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.landingPages.insert" call. +// Exactly one of *LandingPage or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LandingPage.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *LandingPagesInsertCall) Do() (*LandingPage, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LandingPage{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new landing page for the specified campaign.", + // "httpMethod": "POST", + // "id": "dfareporting.landingPages.insert", + // "parameterOrder": [ + // "profileId", + // "campaignId" + // ], + // "parameters": { + // "campaignId": { + // "description": "Landing page campaign ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + // "request": { + // "$ref": "LandingPage" + // }, + // "response": { + // "$ref": "LandingPage" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.landingPages.list": + +type LandingPagesListCall struct { + s *Service + profileId int64 + campaignId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of landing pages for the specified campaign. +func (r *LandingPagesService) List(profileId int64, campaignId int64) *LandingPagesListCall { + c := &LandingPagesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaignId = campaignId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LandingPagesListCall) Fields(s ...googleapi.Field) *LandingPagesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LandingPagesListCall) IfNoneMatch(entityTag string) *LandingPagesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LandingPagesListCall) Context(ctx context.Context) *LandingPagesListCall { + c.ctx_ = ctx + return c +} + +func (c *LandingPagesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "campaignId": strconv.FormatInt(c.campaignId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.landingPages.list" call. +// Exactly one of *LandingPagesListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *LandingPagesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LandingPagesListCall) Do() (*LandingPagesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LandingPagesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of landing pages for the specified campaign.", + // "httpMethod": "GET", + // "id": "dfareporting.landingPages.list", + // "parameterOrder": [ + // "profileId", + // "campaignId" + // ], + // "parameters": { + // "campaignId": { + // "description": "Landing page campaign ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + // "response": { + // "$ref": "LandingPagesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.landingPages.patch": + +type LandingPagesPatchCall struct { + s *Service + profileId int64 + campaignId int64 + id int64 + landingpage *LandingPage + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing campaign landing page. This method +// supports patch semantics. +func (r *LandingPagesService) Patch(profileId int64, campaignId int64, id int64, landingpage *LandingPage) *LandingPagesPatchCall { + c := &LandingPagesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaignId = campaignId + c.id = id + c.landingpage = landingpage + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LandingPagesPatchCall) Fields(s ...googleapi.Field) *LandingPagesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LandingPagesPatchCall) Context(ctx context.Context) *LandingPagesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *LandingPagesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "campaignId": strconv.FormatInt(c.campaignId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.landingPages.patch" call. +// Exactly one of *LandingPage or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LandingPage.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *LandingPagesPatchCall) Do() (*LandingPage, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LandingPage{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing campaign landing page. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.landingPages.patch", + // "parameterOrder": [ + // "profileId", + // "campaignId", + // "id" + // ], + // "parameters": { + // "campaignId": { + // "description": "Landing page campaign ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "id": { + // "description": "Landing page ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + // "request": { + // "$ref": "LandingPage" + // }, + // "response": { + // "$ref": "LandingPage" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.landingPages.update": + +type LandingPagesUpdateCall struct { + s *Service + profileId int64 + campaignId int64 + landingpage *LandingPage + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing campaign landing page. +func (r *LandingPagesService) Update(profileId int64, campaignId int64, landingpage *LandingPage) *LandingPagesUpdateCall { + c := &LandingPagesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaignId = campaignId + c.landingpage = landingpage + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LandingPagesUpdateCall) Fields(s ...googleapi.Field) *LandingPagesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LandingPagesUpdateCall) Context(ctx context.Context) *LandingPagesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *LandingPagesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "campaignId": strconv.FormatInt(c.campaignId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.landingPages.update" call. +// Exactly one of *LandingPage or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LandingPage.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *LandingPagesUpdateCall) Do() (*LandingPage, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LandingPage{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing campaign landing page.", + // "httpMethod": "PUT", + // "id": "dfareporting.landingPages.update", + // "parameterOrder": [ + // "profileId", + // "campaignId" + // ], + // "parameters": { + // "campaignId": { + // "description": "Landing page campaign ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + // "request": { + // "$ref": "LandingPage" + // }, + // "response": { + // "$ref": "LandingPage" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.metros.list": + +type MetrosListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of metros. +func (r *MetrosService) List(profileId int64) *MetrosListCall { + c := &MetrosListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MetrosListCall) Fields(s ...googleapi.Field) *MetrosListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MetrosListCall) IfNoneMatch(entityTag string) *MetrosListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MetrosListCall) Context(ctx context.Context) *MetrosListCall { + c.ctx_ = ctx + return c +} + +func (c *MetrosListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/metros") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.metros.list" call. +// Exactly one of *MetrosListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *MetrosListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MetrosListCall) Do() (*MetrosListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &MetrosListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of metros.", + // "httpMethod": "GET", + // "id": "dfareporting.metros.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/metros", + // "response": { + // "$ref": "MetrosListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.mobileCarriers.list": + +type MobileCarriersListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of mobile carriers. +func (r *MobileCarriersService) List(profileId int64) *MobileCarriersListCall { + c := &MobileCarriersListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MobileCarriersListCall) Fields(s ...googleapi.Field) *MobileCarriersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MobileCarriersListCall) IfNoneMatch(entityTag string) *MobileCarriersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MobileCarriersListCall) Context(ctx context.Context) *MobileCarriersListCall { + c.ctx_ = ctx + return c +} + +func (c *MobileCarriersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileCarriers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.mobileCarriers.list" call. +// Exactly one of *MobileCarriersListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *MobileCarriersListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MobileCarriersListCall) Do() (*MobileCarriersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &MobileCarriersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of mobile carriers.", + // "httpMethod": "GET", + // "id": "dfareporting.mobileCarriers.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/mobileCarriers", + // "response": { + // "$ref": "MobileCarriersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.operatingSystemVersions.list": + +type OperatingSystemVersionsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of operating system versions. +func (r *OperatingSystemVersionsService) List(profileId int64) *OperatingSystemVersionsListCall { + c := &OperatingSystemVersionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OperatingSystemVersionsListCall) Fields(s ...googleapi.Field) *OperatingSystemVersionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OperatingSystemVersionsListCall) IfNoneMatch(entityTag string) *OperatingSystemVersionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OperatingSystemVersionsListCall) Context(ctx context.Context) *OperatingSystemVersionsListCall { + c.ctx_ = ctx + return c +} + +func (c *OperatingSystemVersionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystemVersions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.operatingSystemVersions.list" call. +// Exactly one of *OperatingSystemVersionsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *OperatingSystemVersionsListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OperatingSystemVersionsListCall) Do() (*OperatingSystemVersionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperatingSystemVersionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of operating system versions.", + // "httpMethod": "GET", + // "id": "dfareporting.operatingSystemVersions.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/operatingSystemVersions", + // "response": { + // "$ref": "OperatingSystemVersionsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.operatingSystems.list": + +type OperatingSystemsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of operating systems. +func (r *OperatingSystemsService) List(profileId int64) *OperatingSystemsListCall { + c := &OperatingSystemsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OperatingSystemsListCall) Fields(s ...googleapi.Field) *OperatingSystemsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OperatingSystemsListCall) IfNoneMatch(entityTag string) *OperatingSystemsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OperatingSystemsListCall) Context(ctx context.Context) *OperatingSystemsListCall { + c.ctx_ = ctx + return c +} + +func (c *OperatingSystemsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystems") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.operatingSystems.list" call. +// Exactly one of *OperatingSystemsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *OperatingSystemsListResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OperatingSystemsListCall) Do() (*OperatingSystemsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperatingSystemsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of operating systems.", + // "httpMethod": "GET", + // "id": "dfareporting.operatingSystems.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/operatingSystems", + // "response": { + // "$ref": "OperatingSystemsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementGroups.get": + +type PlacementGroupsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one placement group by ID. +func (r *PlacementGroupsService) Get(profileId int64, id int64) *PlacementGroupsGetCall { + c := &PlacementGroupsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementGroupsGetCall) Fields(s ...googleapi.Field) *PlacementGroupsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PlacementGroupsGetCall) IfNoneMatch(entityTag string) *PlacementGroupsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementGroupsGetCall) Context(ctx context.Context) *PlacementGroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementGroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementGroups.get" call. +// Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PlacementGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementGroupsGetCall) Do() (*PlacementGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one placement group by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.placementGroups.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Placement group ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementGroups/{id}", + // "response": { + // "$ref": "PlacementGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementGroups.insert": + +type PlacementGroupsInsertCall struct { + s *Service + profileId int64 + placementgroup *PlacementGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new placement group. +func (r *PlacementGroupsService) Insert(profileId int64, placementgroup *PlacementGroup) *PlacementGroupsInsertCall { + c := &PlacementGroupsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.placementgroup = placementgroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementGroupsInsertCall) Fields(s ...googleapi.Field) *PlacementGroupsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementGroupsInsertCall) Context(ctx context.Context) *PlacementGroupsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementGroupsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementGroups.insert" call. +// Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PlacementGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementGroupsInsertCall) Do() (*PlacementGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new placement group.", + // "httpMethod": "POST", + // "id": "dfareporting.placementGroups.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementGroups", + // "request": { + // "$ref": "PlacementGroup" + // }, + // "response": { + // "$ref": "PlacementGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementGroups.list": + +type PlacementGroupsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of placement groups, possibly filtered. +func (r *PlacementGroupsService) List(profileId int64) *PlacementGroupsListCall { + c := &PlacementGroupsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdvertiserIds sets the optional parameter "advertiserIds": Select +// only placement groups that belong to these advertisers. +func (c *PlacementGroupsListCall) AdvertiserIds(advertiserIds int64) *PlacementGroupsListCall { + c.opt_["advertiserIds"] = advertiserIds + return c +} + +// Archived sets the optional parameter "archived": Select only archived +// placements. Don't set this field to select both archived and +// non-archived placements. +func (c *PlacementGroupsListCall) Archived(archived bool) *PlacementGroupsListCall { + c.opt_["archived"] = archived + return c +} + +// CampaignIds sets the optional parameter "campaignIds": Select only +// placement groups that belong to these campaigns. +func (c *PlacementGroupsListCall) CampaignIds(campaignIds int64) *PlacementGroupsListCall { + c.opt_["campaignIds"] = campaignIds + return c +} + +// ContentCategoryIds sets the optional parameter "contentCategoryIds": +// Select only placement groups that are associated with these content +// categories. +func (c *PlacementGroupsListCall) ContentCategoryIds(contentCategoryIds int64) *PlacementGroupsListCall { + c.opt_["contentCategoryIds"] = contentCategoryIds + return c +} + +// DirectorySiteIds sets the optional parameter "directorySiteIds": +// Select only placement groups that are associated with these directory +// sites. +func (c *PlacementGroupsListCall) DirectorySiteIds(directorySiteIds int64) *PlacementGroupsListCall { + c.opt_["directorySiteIds"] = directorySiteIds + return c +} + +// Ids sets the optional parameter "ids": Select only placement groups +// with these IDs. +func (c *PlacementGroupsListCall) Ids(ids int64) *PlacementGroupsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *PlacementGroupsListCall) MaxResults(maxResults int64) *PlacementGroupsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *PlacementGroupsListCall) PageToken(pageToken string) *PlacementGroupsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// PlacementGroupType sets the optional parameter "placementGroupType": +// Select only placement groups belonging with this group type. A +// package is a simple group of placements that acts as a single pricing +// point for a group of tags. A roadblock is a group of placements that +// not only acts as a single pricing point but also assumes that all the +// tags in it will be served at the same time. A roadblock requires one +// of its assigned placements to be marked as primary for reporting. +// +// Possible values: +// "PLACEMENT_PACKAGE" +// "PLACEMENT_ROADBLOCK" +func (c *PlacementGroupsListCall) PlacementGroupType(placementGroupType string) *PlacementGroupsListCall { + c.opt_["placementGroupType"] = placementGroupType + return c +} + +// PlacementStrategyIds sets the optional parameter +// "placementStrategyIds": Select only placement groups that are +// associated with these placement strategies. +func (c *PlacementGroupsListCall) PlacementStrategyIds(placementStrategyIds int64) *PlacementGroupsListCall { + c.opt_["placementStrategyIds"] = placementStrategyIds + return c +} + +// PricingTypes sets the optional parameter "pricingTypes": Select only +// placement groups with these pricing types. +// +// Possible values: +// "PRICING_TYPE_CPA" +// "PRICING_TYPE_CPC" +// "PRICING_TYPE_CPM" +// "PRICING_TYPE_FLAT_RATE_CLICKS" +// "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" +func (c *PlacementGroupsListCall) PricingTypes(pricingTypes string) *PlacementGroupsListCall { + c.opt_["pricingTypes"] = pricingTypes + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for placement groups by name or ID. Wildcards (*) are +// allowed. For example, "placement*2015" will return placement groups +// with names like "placement group June 2015", "placement group May +// 2015", or simply "placements 2015". Most of the searches also add +// wildcards implicitly at the start and the end of the search string. +// For example, a search string of "placementgroup" will match placement +// groups with name "my placementgroup", "placementgroup 2015", or +// simply "placementgroup". +func (c *PlacementGroupsListCall) SearchString(searchString string) *PlacementGroupsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SiteIds sets the optional parameter "siteIds": Select only placement +// groups that are associated with these sites. +func (c *PlacementGroupsListCall) SiteIds(siteIds int64) *PlacementGroupsListCall { + c.opt_["siteIds"] = siteIds + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *PlacementGroupsListCall) SortField(sortField string) *PlacementGroupsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *PlacementGroupsListCall) SortOrder(sortOrder string) *PlacementGroupsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementGroupsListCall) Fields(s ...googleapi.Field) *PlacementGroupsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PlacementGroupsListCall) IfNoneMatch(entityTag string) *PlacementGroupsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementGroupsListCall) Context(ctx context.Context) *PlacementGroupsListCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementGroupsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserIds"]; ok { + params.Set("advertiserIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["archived"]; ok { + params.Set("archived", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["campaignIds"]; ok { + params.Set("campaignIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["contentCategoryIds"]; ok { + params.Set("contentCategoryIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["directorySiteIds"]; ok { + params.Set("directorySiteIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["placementGroupType"]; ok { + params.Set("placementGroupType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["placementStrategyIds"]; ok { + params.Set("placementStrategyIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pricingTypes"]; ok { + params.Set("pricingTypes", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["siteIds"]; ok { + params.Set("siteIds", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementGroups.list" call. +// Exactly one of *PlacementGroupsListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *PlacementGroupsListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementGroupsListCall) Do() (*PlacementGroupsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementGroupsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of placement groups, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.placementGroups.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "advertiserIds": { + // "description": "Select only placement groups that belong to these advertisers.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "archived": { + // "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.", + // "location": "query", + // "type": "boolean" + // }, + // "campaignIds": { + // "description": "Select only placement groups that belong to these campaigns.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "contentCategoryIds": { + // "description": "Select only placement groups that are associated with these content categories.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "directorySiteIds": { + // "description": "Select only placement groups that are associated with these directory sites.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only placement groups with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "placementGroupType": { + // "description": "Select only placement groups belonging with this group type. A package is a simple group of placements that acts as a single pricing point for a group of tags. A roadblock is a group of placements that not only acts as a single pricing point but also assumes that all the tags in it will be served at the same time. A roadblock requires one of its assigned placements to be marked as primary for reporting.", + // "enum": [ + // "PLACEMENT_PACKAGE", + // "PLACEMENT_ROADBLOCK" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "placementStrategyIds": { + // "description": "Select only placement groups that are associated with these placement strategies.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "pricingTypes": { + // "description": "Select only placement groups with these pricing types.", + // "enum": [ + // "PRICING_TYPE_CPA", + // "PRICING_TYPE_CPC", + // "PRICING_TYPE_CPM", + // "PRICING_TYPE_FLAT_RATE_CLICKS", + // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for placement groups by name or ID. Wildcards (*) are allowed. For example, \"placement*2015\" will return placement groups with names like \"placement group June 2015\", \"placement group May 2015\", or simply \"placements 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"placementgroup\" will match placement groups with name \"my placementgroup\", \"placementgroup 2015\", or simply \"placementgroup\".", + // "location": "query", + // "type": "string" + // }, + // "siteIds": { + // "description": "Select only placement groups that are associated with these sites.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementGroups", + // "response": { + // "$ref": "PlacementGroupsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementGroups.patch": + +type PlacementGroupsPatchCall struct { + s *Service + profileId int64 + id int64 + placementgroup *PlacementGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing placement group. This method supports +// patch semantics. +func (r *PlacementGroupsService) Patch(profileId int64, id int64, placementgroup *PlacementGroup) *PlacementGroupsPatchCall { + c := &PlacementGroupsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.placementgroup = placementgroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementGroupsPatchCall) Fields(s ...googleapi.Field) *PlacementGroupsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementGroupsPatchCall) Context(ctx context.Context) *PlacementGroupsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementGroupsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementGroups.patch" call. +// Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PlacementGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementGroupsPatchCall) Do() (*PlacementGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing placement group. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.placementGroups.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Placement group ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementGroups", + // "request": { + // "$ref": "PlacementGroup" + // }, + // "response": { + // "$ref": "PlacementGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementGroups.update": + +type PlacementGroupsUpdateCall struct { + s *Service + profileId int64 + placementgroup *PlacementGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing placement group. +func (r *PlacementGroupsService) Update(profileId int64, placementgroup *PlacementGroup) *PlacementGroupsUpdateCall { + c := &PlacementGroupsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.placementgroup = placementgroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementGroupsUpdateCall) Fields(s ...googleapi.Field) *PlacementGroupsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementGroupsUpdateCall) Context(ctx context.Context) *PlacementGroupsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementGroupsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementGroups.update" call. +// Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PlacementGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementGroupsUpdateCall) Do() (*PlacementGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing placement group.", + // "httpMethod": "PUT", + // "id": "dfareporting.placementGroups.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementGroups", + // "request": { + // "$ref": "PlacementGroup" + // }, + // "response": { + // "$ref": "PlacementGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementStrategies.delete": + +type PlacementStrategiesDeleteCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing placement strategy. +func (r *PlacementStrategiesService) Delete(profileId int64, id int64) *PlacementStrategiesDeleteCall { + c := &PlacementStrategiesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementStrategiesDeleteCall) Fields(s ...googleapi.Field) *PlacementStrategiesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementStrategiesDeleteCall) Context(ctx context.Context) *PlacementStrategiesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementStrategiesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementStrategies.delete" call. +func (c *PlacementStrategiesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing placement strategy.", + // "httpMethod": "DELETE", + // "id": "dfareporting.placementStrategies.delete", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Placement strategy ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementStrategies/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementStrategies.get": + +type PlacementStrategiesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one placement strategy by ID. +func (r *PlacementStrategiesService) Get(profileId int64, id int64) *PlacementStrategiesGetCall { + c := &PlacementStrategiesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementStrategiesGetCall) Fields(s ...googleapi.Field) *PlacementStrategiesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PlacementStrategiesGetCall) IfNoneMatch(entityTag string) *PlacementStrategiesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementStrategiesGetCall) Context(ctx context.Context) *PlacementStrategiesGetCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementStrategiesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementStrategies.get" call. +// Exactly one of *PlacementStrategy or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PlacementStrategy.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementStrategiesGetCall) Do() (*PlacementStrategy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementStrategy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one placement strategy by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.placementStrategies.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Placement strategy ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementStrategies/{id}", + // "response": { + // "$ref": "PlacementStrategy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementStrategies.insert": + +type PlacementStrategiesInsertCall struct { + s *Service + profileId int64 + placementstrategy *PlacementStrategy + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new placement strategy. +func (r *PlacementStrategiesService) Insert(profileId int64, placementstrategy *PlacementStrategy) *PlacementStrategiesInsertCall { + c := &PlacementStrategiesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.placementstrategy = placementstrategy + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementStrategiesInsertCall) Fields(s ...googleapi.Field) *PlacementStrategiesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementStrategiesInsertCall) Context(ctx context.Context) *PlacementStrategiesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementStrategiesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementStrategies.insert" call. +// Exactly one of *PlacementStrategy or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PlacementStrategy.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementStrategiesInsertCall) Do() (*PlacementStrategy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementStrategy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new placement strategy.", + // "httpMethod": "POST", + // "id": "dfareporting.placementStrategies.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementStrategies", + // "request": { + // "$ref": "PlacementStrategy" + // }, + // "response": { + // "$ref": "PlacementStrategy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementStrategies.list": + +type PlacementStrategiesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of placement strategies, possibly filtered. +func (r *PlacementStrategiesService) List(profileId int64) *PlacementStrategiesListCall { + c := &PlacementStrategiesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Ids sets the optional parameter "ids": Select only placement +// strategies with these IDs. +func (c *PlacementStrategiesListCall) Ids(ids int64) *PlacementStrategiesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *PlacementStrategiesListCall) MaxResults(maxResults int64) *PlacementStrategiesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *PlacementStrategiesListCall) PageToken(pageToken string) *PlacementStrategiesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "placementstrategy*2015" will return objects with names like +// "placementstrategy June 2015", "placementstrategy April 2015", or +// simply "placementstrategy 2015". Most of the searches also add +// wildcards implicitly at the start and the end of the search string. +// For example, a search string of "placementstrategy" will match +// objects with name "my placementstrategy", "placementstrategy 2015", +// or simply "placementstrategy". +func (c *PlacementStrategiesListCall) SearchString(searchString string) *PlacementStrategiesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *PlacementStrategiesListCall) SortField(sortField string) *PlacementStrategiesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *PlacementStrategiesListCall) SortOrder(sortOrder string) *PlacementStrategiesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementStrategiesListCall) Fields(s ...googleapi.Field) *PlacementStrategiesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PlacementStrategiesListCall) IfNoneMatch(entityTag string) *PlacementStrategiesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementStrategiesListCall) Context(ctx context.Context) *PlacementStrategiesListCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementStrategiesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementStrategies.list" call. +// Exactly one of *PlacementStrategiesListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PlacementStrategiesListResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementStrategiesListCall) Do() (*PlacementStrategiesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementStrategiesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of placement strategies, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.placementStrategies.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "ids": { + // "description": "Select only placement strategies with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"placementstrategy*2015\" will return objects with names like \"placementstrategy June 2015\", \"placementstrategy April 2015\", or simply \"placementstrategy 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"placementstrategy\" will match objects with name \"my placementstrategy\", \"placementstrategy 2015\", or simply \"placementstrategy\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementStrategies", + // "response": { + // "$ref": "PlacementStrategiesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementStrategies.patch": + +type PlacementStrategiesPatchCall struct { + s *Service + profileId int64 + id int64 + placementstrategy *PlacementStrategy + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing placement strategy. This method supports +// patch semantics. +func (r *PlacementStrategiesService) Patch(profileId int64, id int64, placementstrategy *PlacementStrategy) *PlacementStrategiesPatchCall { + c := &PlacementStrategiesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.placementstrategy = placementstrategy + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementStrategiesPatchCall) Fields(s ...googleapi.Field) *PlacementStrategiesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementStrategiesPatchCall) Context(ctx context.Context) *PlacementStrategiesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementStrategiesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementStrategies.patch" call. +// Exactly one of *PlacementStrategy or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PlacementStrategy.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementStrategiesPatchCall) Do() (*PlacementStrategy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementStrategy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing placement strategy. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.placementStrategies.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Placement strategy ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementStrategies", + // "request": { + // "$ref": "PlacementStrategy" + // }, + // "response": { + // "$ref": "PlacementStrategy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementStrategies.update": + +type PlacementStrategiesUpdateCall struct { + s *Service + profileId int64 + placementstrategy *PlacementStrategy + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing placement strategy. +func (r *PlacementStrategiesService) Update(profileId int64, placementstrategy *PlacementStrategy) *PlacementStrategiesUpdateCall { + c := &PlacementStrategiesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.placementstrategy = placementstrategy + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementStrategiesUpdateCall) Fields(s ...googleapi.Field) *PlacementStrategiesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementStrategiesUpdateCall) Context(ctx context.Context) *PlacementStrategiesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementStrategiesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementStrategies.update" call. +// Exactly one of *PlacementStrategy or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PlacementStrategy.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementStrategiesUpdateCall) Do() (*PlacementStrategy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementStrategy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing placement strategy.", + // "httpMethod": "PUT", + // "id": "dfareporting.placementStrategies.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementStrategies", + // "request": { + // "$ref": "PlacementStrategy" + // }, + // "response": { + // "$ref": "PlacementStrategy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placements.generatetags": + +type PlacementsGeneratetagsCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Generatetags: Generates tags for a placement. +func (r *PlacementsService) Generatetags(profileId int64) *PlacementsGeneratetagsCall { + c := &PlacementsGeneratetagsCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// CampaignId sets the optional parameter "campaignId": Generate +// placements belonging to this campaign. This is a required field. +func (c *PlacementsGeneratetagsCall) CampaignId(campaignId int64) *PlacementsGeneratetagsCall { + c.opt_["campaignId"] = campaignId + return c +} + +// PlacementIds sets the optional parameter "placementIds": Generate +// tags for these placements. +func (c *PlacementsGeneratetagsCall) PlacementIds(placementIds int64) *PlacementsGeneratetagsCall { + c.opt_["placementIds"] = placementIds + return c +} + +// TagFormats sets the optional parameter "tagFormats": Tag formats to +// generate for these placements. +// +// Possible values: +// "PLACEMENT_TAG_CLICK_COMMANDS" +// "PLACEMENT_TAG_IFRAME_ILAYER" +// "PLACEMENT_TAG_IFRAME_JAVASCRIPT" +// "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY" +// "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH" +// "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3" +// "PLACEMENT_TAG_INTERNAL_REDIRECT" +// "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT" +// "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY" +// "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT" +// "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT" +// "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY" +// "PLACEMENT_TAG_JAVASCRIPT" +// "PLACEMENT_TAG_JAVASCRIPT_LEGACY" +// "PLACEMENT_TAG_STANDARD" +// "PLACEMENT_TAG_TRACKING" +// "PLACEMENT_TAG_TRACKING_IFRAME" +// "PLACEMENT_TAG_TRACKING_JAVASCRIPT" +func (c *PlacementsGeneratetagsCall) TagFormats(tagFormats string) *PlacementsGeneratetagsCall { + c.opt_["tagFormats"] = tagFormats + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementsGeneratetagsCall) Fields(s ...googleapi.Field) *PlacementsGeneratetagsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementsGeneratetagsCall) Context(ctx context.Context) *PlacementsGeneratetagsCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementsGeneratetagsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["campaignId"]; ok { + params.Set("campaignId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["placementIds"]; ok { + params.Set("placementIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["tagFormats"]; ok { + params.Set("tagFormats", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements/generatetags") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placements.generatetags" call. +// Exactly one of *PlacementsGenerateTagsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PlacementsGenerateTagsResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementsGeneratetagsCall) Do() (*PlacementsGenerateTagsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementsGenerateTagsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generates tags for a placement.", + // "httpMethod": "POST", + // "id": "dfareporting.placements.generatetags", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "campaignId": { + // "description": "Generate placements belonging to this campaign. This is a required field.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "placementIds": { + // "description": "Generate tags for these placements.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tagFormats": { + // "description": "Tag formats to generate for these placements.", + // "enum": [ + // "PLACEMENT_TAG_CLICK_COMMANDS", + // "PLACEMENT_TAG_IFRAME_ILAYER", + // "PLACEMENT_TAG_IFRAME_JAVASCRIPT", + // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY", + // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH", + // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3", + // "PLACEMENT_TAG_INTERNAL_REDIRECT", + // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT", + // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY", + // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT", + // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT", + // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY", + // "PLACEMENT_TAG_JAVASCRIPT", + // "PLACEMENT_TAG_JAVASCRIPT_LEGACY", + // "PLACEMENT_TAG_STANDARD", + // "PLACEMENT_TAG_TRACKING", + // "PLACEMENT_TAG_TRACKING_IFRAME", + // "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placements/generatetags", + // "response": { + // "$ref": "PlacementsGenerateTagsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placements.get": + +type PlacementsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one placement by ID. +func (r *PlacementsService) Get(profileId int64, id int64) *PlacementsGetCall { + c := &PlacementsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementsGetCall) Fields(s ...googleapi.Field) *PlacementsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PlacementsGetCall) IfNoneMatch(entityTag string) *PlacementsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementsGetCall) Context(ctx context.Context) *PlacementsGetCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placements.get" call. +// Exactly one of *Placement or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Placement.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PlacementsGetCall) Do() (*Placement, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Placement{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one placement by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.placements.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Placement ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placements/{id}", + // "response": { + // "$ref": "Placement" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placements.insert": + +type PlacementsInsertCall struct { + s *Service + profileId int64 + placement *Placement + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new placement. +func (r *PlacementsService) Insert(profileId int64, placement *Placement) *PlacementsInsertCall { + c := &PlacementsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.placement = placement + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementsInsertCall) Fields(s ...googleapi.Field) *PlacementsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementsInsertCall) Context(ctx context.Context) *PlacementsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placements.insert" call. +// Exactly one of *Placement or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Placement.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PlacementsInsertCall) Do() (*Placement, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Placement{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new placement.", + // "httpMethod": "POST", + // "id": "dfareporting.placements.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placements", + // "request": { + // "$ref": "Placement" + // }, + // "response": { + // "$ref": "Placement" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placements.list": + +type PlacementsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of placements, possibly filtered. +func (r *PlacementsService) List(profileId int64) *PlacementsListCall { + c := &PlacementsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdvertiserIds sets the optional parameter "advertiserIds": Select +// only placements that belong to these advertisers. +func (c *PlacementsListCall) AdvertiserIds(advertiserIds int64) *PlacementsListCall { + c.opt_["advertiserIds"] = advertiserIds + return c +} + +// Archived sets the optional parameter "archived": Select only archived +// placements. Don't set this field to select both archived and +// non-archived placements. +func (c *PlacementsListCall) Archived(archived bool) *PlacementsListCall { + c.opt_["archived"] = archived + return c +} + +// CampaignIds sets the optional parameter "campaignIds": Select only +// placements that belong to these campaigns. +func (c *PlacementsListCall) CampaignIds(campaignIds int64) *PlacementsListCall { + c.opt_["campaignIds"] = campaignIds + return c +} + +// Compatibilities sets the optional parameter "compatibilities": Select +// only placements that are associated with these compatibilities. WEB +// and WEB_INTERSTITIAL refer to rendering either on desktop or on +// mobile devices for regular or interstitial ads respectively. APP and +// APP_INTERSTITIAL are for rendering in mobile apps.IN_STREAM_VIDEO +// refers to rendering in in-stream video ads developed with the VAST +// standard. +// +// Possible values: +// "APP" +// "APP_INTERSTITIAL" +// "IN_STREAM_VIDEO" +// "WEB" +// "WEB_INTERSTITIAL" +func (c *PlacementsListCall) Compatibilities(compatibilities string) *PlacementsListCall { + c.opt_["compatibilities"] = compatibilities + return c +} + +// ContentCategoryIds sets the optional parameter "contentCategoryIds": +// Select only placements that are associated with these content +// categories. +func (c *PlacementsListCall) ContentCategoryIds(contentCategoryIds int64) *PlacementsListCall { + c.opt_["contentCategoryIds"] = contentCategoryIds + return c +} + +// DirectorySiteIds sets the optional parameter "directorySiteIds": +// Select only placements that are associated with these directory +// sites. +func (c *PlacementsListCall) DirectorySiteIds(directorySiteIds int64) *PlacementsListCall { + c.opt_["directorySiteIds"] = directorySiteIds + return c +} + +// GroupIds sets the optional parameter "groupIds": Select only +// placements that belong to these placement groups. +func (c *PlacementsListCall) GroupIds(groupIds int64) *PlacementsListCall { + c.opt_["groupIds"] = groupIds + return c +} + +// Ids sets the optional parameter "ids": Select only placements with +// these IDs. +func (c *PlacementsListCall) Ids(ids int64) *PlacementsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *PlacementsListCall) MaxResults(maxResults int64) *PlacementsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *PlacementsListCall) PageToken(pageToken string) *PlacementsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// PaymentSource sets the optional parameter "paymentSource": Select +// only placements with this payment source. +// +// Possible values: +// "PLACEMENT_AGENCY_PAID" +// "PLACEMENT_PUBLISHER_PAID" +func (c *PlacementsListCall) PaymentSource(paymentSource string) *PlacementsListCall { + c.opt_["paymentSource"] = paymentSource + return c +} + +// PlacementStrategyIds sets the optional parameter +// "placementStrategyIds": Select only placements that are associated +// with these placement strategies. +func (c *PlacementsListCall) PlacementStrategyIds(placementStrategyIds int64) *PlacementsListCall { + c.opt_["placementStrategyIds"] = placementStrategyIds + return c +} + +// PricingTypes sets the optional parameter "pricingTypes": Select only +// placements with these pricing types. +// +// Possible values: +// "PRICING_TYPE_CPA" +// "PRICING_TYPE_CPC" +// "PRICING_TYPE_CPM" +// "PRICING_TYPE_FLAT_RATE_CLICKS" +// "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" +func (c *PlacementsListCall) PricingTypes(pricingTypes string) *PlacementsListCall { + c.opt_["pricingTypes"] = pricingTypes + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for placements by name or ID. Wildcards (*) are allowed. +// For example, "placement*2015" will return placements with names like +// "placement June 2015", "placement May 2015", or simply "placements +// 2015". Most of the searches also add wildcards implicitly at the +// start and the end of the search string. For example, a search string +// of "placement" will match placements with name "my placement", +// "placement 2015", or simply "placement". +func (c *PlacementsListCall) SearchString(searchString string) *PlacementsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SiteIds sets the optional parameter "siteIds": Select only placements +// that are associated with these sites. +func (c *PlacementsListCall) SiteIds(siteIds int64) *PlacementsListCall { + c.opt_["siteIds"] = siteIds + return c +} + +// SizeIds sets the optional parameter "sizeIds": Select only placements +// that are associated with these sizes. +func (c *PlacementsListCall) SizeIds(sizeIds int64) *PlacementsListCall { + c.opt_["sizeIds"] = sizeIds + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *PlacementsListCall) SortField(sortField string) *PlacementsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *PlacementsListCall) SortOrder(sortOrder string) *PlacementsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementsListCall) Fields(s ...googleapi.Field) *PlacementsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PlacementsListCall) IfNoneMatch(entityTag string) *PlacementsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementsListCall) Context(ctx context.Context) *PlacementsListCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserIds"]; ok { + params.Set("advertiserIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["archived"]; ok { + params.Set("archived", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["campaignIds"]; ok { + params.Set("campaignIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["compatibilities"]; ok { + params.Set("compatibilities", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["contentCategoryIds"]; ok { + params.Set("contentCategoryIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["directorySiteIds"]; ok { + params.Set("directorySiteIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["groupIds"]; ok { + params.Set("groupIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["paymentSource"]; ok { + params.Set("paymentSource", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["placementStrategyIds"]; ok { + params.Set("placementStrategyIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pricingTypes"]; ok { + params.Set("pricingTypes", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["siteIds"]; ok { + params.Set("siteIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sizeIds"]; ok { + params.Set("sizeIds", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placements.list" call. +// Exactly one of *PlacementsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PlacementsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementsListCall) Do() (*PlacementsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of placements, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.placements.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "advertiserIds": { + // "description": "Select only placements that belong to these advertisers.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "archived": { + // "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.", + // "location": "query", + // "type": "boolean" + // }, + // "campaignIds": { + // "description": "Select only placements that belong to these campaigns.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "compatibilities": { + // "description": "Select only placements that are associated with these compatibilities. WEB and WEB_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps.IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard.", + // "enum": [ + // "APP", + // "APP_INTERSTITIAL", + // "IN_STREAM_VIDEO", + // "WEB", + // "WEB_INTERSTITIAL" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "contentCategoryIds": { + // "description": "Select only placements that are associated with these content categories.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "directorySiteIds": { + // "description": "Select only placements that are associated with these directory sites.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "groupIds": { + // "description": "Select only placements that belong to these placement groups.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only placements with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "paymentSource": { + // "description": "Select only placements with this payment source.", + // "enum": [ + // "PLACEMENT_AGENCY_PAID", + // "PLACEMENT_PUBLISHER_PAID" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "placementStrategyIds": { + // "description": "Select only placements that are associated with these placement strategies.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "pricingTypes": { + // "description": "Select only placements with these pricing types.", + // "enum": [ + // "PRICING_TYPE_CPA", + // "PRICING_TYPE_CPC", + // "PRICING_TYPE_CPM", + // "PRICING_TYPE_FLAT_RATE_CLICKS", + // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for placements by name or ID. Wildcards (*) are allowed. For example, \"placement*2015\" will return placements with names like \"placement June 2015\", \"placement May 2015\", or simply \"placements 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"placement\" will match placements with name \"my placement\", \"placement 2015\", or simply \"placement\".", + // "location": "query", + // "type": "string" + // }, + // "siteIds": { + // "description": "Select only placements that are associated with these sites.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "sizeIds": { + // "description": "Select only placements that are associated with these sizes.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placements", + // "response": { + // "$ref": "PlacementsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placements.patch": + +type PlacementsPatchCall struct { + s *Service + profileId int64 + id int64 + placement *Placement + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing placement. This method supports patch +// semantics. +func (r *PlacementsService) Patch(profileId int64, id int64, placement *Placement) *PlacementsPatchCall { + c := &PlacementsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.placement = placement + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementsPatchCall) Fields(s ...googleapi.Field) *PlacementsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementsPatchCall) Context(ctx context.Context) *PlacementsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placements.patch" call. +// Exactly one of *Placement or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Placement.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PlacementsPatchCall) Do() (*Placement, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Placement{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing placement. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.placements.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Placement ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placements", + // "request": { + // "$ref": "Placement" + // }, + // "response": { + // "$ref": "Placement" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placements.update": + +type PlacementsUpdateCall struct { + s *Service + profileId int64 + placement *Placement + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing placement. +func (r *PlacementsService) Update(profileId int64, placement *Placement) *PlacementsUpdateCall { + c := &PlacementsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.placement = placement + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementsUpdateCall) Fields(s ...googleapi.Field) *PlacementsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementsUpdateCall) Context(ctx context.Context) *PlacementsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placements.update" call. +// Exactly one of *Placement or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Placement.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PlacementsUpdateCall) Do() (*Placement, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Placement{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing placement.", + // "httpMethod": "PUT", + // "id": "dfareporting.placements.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placements", + // "request": { + // "$ref": "Placement" + // }, + // "response": { + // "$ref": "Placement" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.platformTypes.list": + +type PlatformTypesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of platform types. +func (r *PlatformTypesService) List(profileId int64) *PlatformTypesListCall { + c := &PlatformTypesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlatformTypesListCall) Fields(s ...googleapi.Field) *PlatformTypesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PlatformTypesListCall) IfNoneMatch(entityTag string) *PlatformTypesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlatformTypesListCall) Context(ctx context.Context) *PlatformTypesListCall { + c.ctx_ = ctx + return c +} + +func (c *PlatformTypesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/platformTypes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.platformTypes.list" call. +// Exactly one of *PlatformTypesListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *PlatformTypesListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlatformTypesListCall) Do() (*PlatformTypesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlatformTypesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of platform types.", + // "httpMethod": "GET", + // "id": "dfareporting.platformTypes.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/platformTypes", + // "response": { + // "$ref": "PlatformTypesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.postalCodes.list": + +type PostalCodesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of postal codes. +func (r *PostalCodesService) List(profileId int64) *PostalCodesListCall { + c := &PostalCodesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostalCodesListCall) Fields(s ...googleapi.Field) *PostalCodesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PostalCodesListCall) IfNoneMatch(entityTag string) *PostalCodesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostalCodesListCall) Context(ctx context.Context) *PostalCodesListCall { + c.ctx_ = ctx + return c +} + +func (c *PostalCodesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/postalCodes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.postalCodes.list" call. +// Exactly one of *PostalCodesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PostalCodesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PostalCodesListCall) Do() (*PostalCodesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PostalCodesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of postal codes.", + // "httpMethod": "GET", + // "id": "dfareporting.postalCodes.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/postalCodes", + // "response": { + // "$ref": "PostalCodesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.regions.list": + +type RegionsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of regions. +func (r *RegionsService) List(profileId int64) *RegionsListCall { + c := &RegionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall { + c.ctx_ = ctx + return c +} + +func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/regions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.regions.list" call. +// Exactly one of *RegionsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *RegionsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RegionsListCall) Do() (*RegionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RegionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of regions.", + // "httpMethod": "GET", + // "id": "dfareporting.regions.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/regions", + // "response": { + // "$ref": "RegionsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.reports.delete": + +type ReportsDeleteCall struct { + s *Service + profileId int64 + reportId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsDeleteCall) Fields(s ...googleapi.Field) *ReportsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsDeleteCall) Context(ctx context.Context) *ReportsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.delete" call. +func (c *ReportsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsGetCall) Fields(s ...googleapi.Field) *ReportsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsGetCall) IfNoneMatch(entityTag string) *ReportsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsGetCall) Context(ctx context.Context) *ReportsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.get" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsGetCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsInsertCall) Fields(s ...googleapi.Field) *ReportsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsInsertCall) Context(ctx context.Context) *ReportsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.insert" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsInsertCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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'. +// +// Possible values: +// "ALL" - All reports in account. +// "MINE" (default) - My reports. +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. +// +// Possible values: +// "ID" - Sort by report ID. +// "LAST_MODIFIED_TIME" (default) - Sort by 'lastModifiedTime' field. +// "NAME" - Sort by name of reports. +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'. +// +// Possible values: +// "ASCENDING" - Ascending order. +// "DESCENDING" (default) - Descending order. +func (c *ReportsListCall) SortOrder(sortOrder string) *ReportsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsListCall) Fields(s ...googleapi.Field) *ReportsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsListCall) IfNoneMatch(entityTag string) *ReportsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsListCall) Context(ctx context.Context) *ReportsListCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.list" call. +// Exactly one of *ReportList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ReportList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReportsListCall) Do() (*ReportList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ReportList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsPatchCall) Fields(s ...googleapi.Field) *ReportsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsPatchCall) Context(ctx context.Context) *ReportsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.patch" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsPatchCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsRunCall) Fields(s ...googleapi.Field) *ReportsRunCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsRunCall) Context(ctx context.Context) *ReportsRunCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsRunCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["synchronous"]; ok { + params.Set("synchronous", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/run") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.run" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ReportsRunCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsUpdateCall) Fields(s ...googleapi.Field) *ReportsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsUpdateCall) Context(ctx context.Context) *ReportsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.update" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsUpdateCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsCompatibleFieldsQueryCall) Fields(s ...googleapi.Field) *ReportsCompatibleFieldsQueryCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsCompatibleFieldsQueryCall) Context(ctx context.Context) *ReportsCompatibleFieldsQueryCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsCompatibleFieldsQueryCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/compatiblefields/query") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.compatibleFields.query" call. +// Exactly one of *CompatibleFields or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CompatibleFields.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReportsCompatibleFieldsQueryCall) Do() (*CompatibleFields, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CompatibleFields{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsFilesGetCall) Fields(s ...googleapi.Field) *ReportsFilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsFilesGetCall) IfNoneMatch(entityTag string) *ReportsFilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsFilesGetCall) Context(ctx context.Context) *ReportsFilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsFilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files/{fileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + "fileId": strconv.FormatInt(c.fileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *ReportsFilesGetCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "dfareporting.reports.files.get" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ReportsFilesGetCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "ID" - Sort by file ID. +// "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field. +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'. +// +// Possible values: +// "ASCENDING" - Ascending order. +// "DESCENDING" (default) - Descending order. +func (c *ReportsFilesListCall) SortOrder(sortOrder string) *ReportsFilesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsFilesListCall) Fields(s ...googleapi.Field) *ReportsFilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsFilesListCall) IfNoneMatch(entityTag string) *ReportsFilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsFilesListCall) Context(ctx context.Context) *ReportsFilesListCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsFilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.files.list" call. +// Exactly one of *FileList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *FileList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReportsFilesListCall) Do() (*FileList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FileList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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.sites.get": + +type SitesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one site by ID. +func (r *SitesService) Get(profileId int64, id int64) *SitesGetCall { + c := &SitesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SitesGetCall) Fields(s ...googleapi.Field) *SitesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SitesGetCall) IfNoneMatch(entityTag string) *SitesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SitesGetCall) Context(ctx context.Context) *SitesGetCall { + c.ctx_ = ctx + return c +} + +func (c *SitesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.sites.get" call. +// Exactly one of *Site or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Site.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *SitesGetCall) Do() (*Site, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Site{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one site by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.sites.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Site ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/sites/{id}", + // "response": { + // "$ref": "Site" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.sites.insert": + +type SitesInsertCall struct { + s *Service + profileId int64 + site *Site + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new site. +func (r *SitesService) Insert(profileId int64, site *Site) *SitesInsertCall { + c := &SitesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.site = site + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SitesInsertCall) Fields(s ...googleapi.Field) *SitesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SitesInsertCall) Context(ctx context.Context) *SitesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *SitesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.site) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.sites.insert" call. +// Exactly one of *Site or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Site.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *SitesInsertCall) Do() (*Site, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Site{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new site.", + // "httpMethod": "POST", + // "id": "dfareporting.sites.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/sites", + // "request": { + // "$ref": "Site" + // }, + // "response": { + // "$ref": "Site" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.sites.list": + +type SitesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of sites, possibly filtered. +func (r *SitesService) List(profileId int64) *SitesListCall { + c := &SitesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AcceptsInStreamVideoPlacements sets the optional parameter +// "acceptsInStreamVideoPlacements": This search filter is no longer +// supported and will have no effect on the results returned. +func (c *SitesListCall) AcceptsInStreamVideoPlacements(acceptsInStreamVideoPlacements bool) *SitesListCall { + c.opt_["acceptsInStreamVideoPlacements"] = acceptsInStreamVideoPlacements + return c +} + +// AcceptsInterstitialPlacements sets the optional parameter +// "acceptsInterstitialPlacements": This search filter is no longer +// supported and will have no effect on the results returned. +func (c *SitesListCall) AcceptsInterstitialPlacements(acceptsInterstitialPlacements bool) *SitesListCall { + c.opt_["acceptsInterstitialPlacements"] = acceptsInterstitialPlacements + return c +} + +// AcceptsPublisherPaidPlacements sets the optional parameter +// "acceptsPublisherPaidPlacements": Select only sites that accept +// publisher paid placements. +func (c *SitesListCall) AcceptsPublisherPaidPlacements(acceptsPublisherPaidPlacements bool) *SitesListCall { + c.opt_["acceptsPublisherPaidPlacements"] = acceptsPublisherPaidPlacements + return c +} + +// AdWordsSite sets the optional parameter "adWordsSite": Select only +// AdWords sites. +func (c *SitesListCall) AdWordsSite(adWordsSite bool) *SitesListCall { + c.opt_["adWordsSite"] = adWordsSite + return c +} + +// Approved sets the optional parameter "approved": Select only approved +// sites. +func (c *SitesListCall) Approved(approved bool) *SitesListCall { + c.opt_["approved"] = approved + return c +} + +// CampaignIds sets the optional parameter "campaignIds": Select only +// sites with these campaign IDs. +func (c *SitesListCall) CampaignIds(campaignIds int64) *SitesListCall { + c.opt_["campaignIds"] = campaignIds + return c +} + +// DirectorySiteIds sets the optional parameter "directorySiteIds": +// Select only sites with these directory site IDs. +func (c *SitesListCall) DirectorySiteIds(directorySiteIds int64) *SitesListCall { + c.opt_["directorySiteIds"] = directorySiteIds + return c +} + +// Ids sets the optional parameter "ids": Select only sites with these +// IDs. +func (c *SitesListCall) Ids(ids int64) *SitesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *SitesListCall) MaxResults(maxResults int64) *SitesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *SitesListCall) PageToken(pageToken string) *SitesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name, ID or keyName. Wildcards (*) are +// allowed. For example, "site*2015" will return objects with names like +// "site June 2015", "site April 2015", or simply "site 2015". Most of +// the searches also add wildcards implicitly at the start and the end +// of the search string. For example, a search string of "site" will +// match objects with name "my site", "site 2015", or simply "site". +func (c *SitesListCall) SearchString(searchString string) *SitesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *SitesListCall) SortField(sortField string) *SitesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *SitesListCall) SortOrder(sortOrder string) *SitesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// SubaccountId sets the optional parameter "subaccountId": Select only +// sites with this subaccount ID. +func (c *SitesListCall) SubaccountId(subaccountId int64) *SitesListCall { + c.opt_["subaccountId"] = subaccountId + return c +} + +// UnmappedSite sets the optional parameter "unmappedSite": Select only +// sites that have not been mapped to a directory site. +func (c *SitesListCall) UnmappedSite(unmappedSite bool) *SitesListCall { + c.opt_["unmappedSite"] = unmappedSite + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SitesListCall) Fields(s ...googleapi.Field) *SitesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SitesListCall) IfNoneMatch(entityTag string) *SitesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SitesListCall) Context(ctx context.Context) *SitesListCall { + c.ctx_ = ctx + return c +} + +func (c *SitesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["acceptsInStreamVideoPlacements"]; ok { + params.Set("acceptsInStreamVideoPlacements", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["acceptsInterstitialPlacements"]; ok { + params.Set("acceptsInterstitialPlacements", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["acceptsPublisherPaidPlacements"]; ok { + params.Set("acceptsPublisherPaidPlacements", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["adWordsSite"]; ok { + params.Set("adWordsSite", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["approved"]; ok { + params.Set("approved", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["campaignIds"]; ok { + params.Set("campaignIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["directorySiteIds"]; ok { + params.Set("directorySiteIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["subaccountId"]; ok { + params.Set("subaccountId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["unmappedSite"]; ok { + params.Set("unmappedSite", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.sites.list" call. +// Exactly one of *SitesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SitesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SitesListCall) Do() (*SitesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SitesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of sites, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.sites.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "acceptsInStreamVideoPlacements": { + // "description": "This search filter is no longer supported and will have no effect on the results returned.", + // "location": "query", + // "type": "boolean" + // }, + // "acceptsInterstitialPlacements": { + // "description": "This search filter is no longer supported and will have no effect on the results returned.", + // "location": "query", + // "type": "boolean" + // }, + // "acceptsPublisherPaidPlacements": { + // "description": "Select only sites that accept publisher paid placements.", + // "location": "query", + // "type": "boolean" + // }, + // "adWordsSite": { + // "description": "Select only AdWords sites.", + // "location": "query", + // "type": "boolean" + // }, + // "approved": { + // "description": "Select only approved sites.", + // "location": "query", + // "type": "boolean" + // }, + // "campaignIds": { + // "description": "Select only sites with these campaign IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "directorySiteIds": { + // "description": "Select only sites with these directory site IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only sites with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name, ID or keyName. Wildcards (*) are allowed. For example, \"site*2015\" will return objects with names like \"site June 2015\", \"site April 2015\", or simply \"site 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"site\" will match objects with name \"my site\", \"site 2015\", or simply \"site\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "subaccountId": { + // "description": "Select only sites with this subaccount ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "unmappedSite": { + // "description": "Select only sites that have not been mapped to a directory site.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "userprofiles/{profileId}/sites", + // "response": { + // "$ref": "SitesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.sites.patch": + +type SitesPatchCall struct { + s *Service + profileId int64 + id int64 + site *Site + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing site. This method supports patch +// semantics. +func (r *SitesService) Patch(profileId int64, id int64, site *Site) *SitesPatchCall { + c := &SitesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.site = site + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SitesPatchCall) Fields(s ...googleapi.Field) *SitesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SitesPatchCall) Context(ctx context.Context) *SitesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *SitesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.site) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.sites.patch" call. +// Exactly one of *Site or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Site.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *SitesPatchCall) Do() (*Site, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Site{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing site. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.sites.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Site ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/sites", + // "request": { + // "$ref": "Site" + // }, + // "response": { + // "$ref": "Site" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.sites.update": + +type SitesUpdateCall struct { + s *Service + profileId int64 + site *Site + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing site. +func (r *SitesService) Update(profileId int64, site *Site) *SitesUpdateCall { + c := &SitesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.site = site + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SitesUpdateCall) Fields(s ...googleapi.Field) *SitesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SitesUpdateCall) Context(ctx context.Context) *SitesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *SitesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.site) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.sites.update" call. +// Exactly one of *Site or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Site.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *SitesUpdateCall) Do() (*Site, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Site{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing site.", + // "httpMethod": "PUT", + // "id": "dfareporting.sites.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/sites", + // "request": { + // "$ref": "Site" + // }, + // "response": { + // "$ref": "Site" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.sizes.get": + +type SizesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one size by ID. +func (r *SizesService) Get(profileId int64, id int64) *SizesGetCall { + c := &SizesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SizesGetCall) Fields(s ...googleapi.Field) *SizesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SizesGetCall) IfNoneMatch(entityTag string) *SizesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SizesGetCall) Context(ctx context.Context) *SizesGetCall { + c.ctx_ = ctx + return c +} + +func (c *SizesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.sizes.get" call. +// Exactly one of *Size or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Size.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *SizesGetCall) Do() (*Size, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Size{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one size by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.sizes.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Size ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/sizes/{id}", + // "response": { + // "$ref": "Size" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.sizes.insert": + +type SizesInsertCall struct { + s *Service + profileId int64 + size *Size + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new size. +func (r *SizesService) Insert(profileId int64, size *Size) *SizesInsertCall { + c := &SizesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.size = size + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SizesInsertCall) Fields(s ...googleapi.Field) *SizesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SizesInsertCall) Context(ctx context.Context) *SizesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *SizesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.size) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.sizes.insert" call. +// Exactly one of *Size or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Size.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *SizesInsertCall) Do() (*Size, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Size{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new size.", + // "httpMethod": "POST", + // "id": "dfareporting.sizes.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/sizes", + // "request": { + // "$ref": "Size" + // }, + // "response": { + // "$ref": "Size" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.sizes.list": + +type SizesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of sizes, possibly filtered. +func (r *SizesService) List(profileId int64) *SizesListCall { + c := &SizesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Height sets the optional parameter "height": Select only sizes with +// this height. +func (c *SizesListCall) Height(height int64) *SizesListCall { + c.opt_["height"] = height + return c +} + +// IabStandard sets the optional parameter "iabStandard": Select only +// IAB standard sizes. +func (c *SizesListCall) IabStandard(iabStandard bool) *SizesListCall { + c.opt_["iabStandard"] = iabStandard + return c +} + +// Ids sets the optional parameter "ids": Select only sizes with these +// IDs. +func (c *SizesListCall) Ids(ids int64) *SizesListCall { + c.opt_["ids"] = ids + return c +} + +// Width sets the optional parameter "width": Select only sizes with +// this width. +func (c *SizesListCall) Width(width int64) *SizesListCall { + c.opt_["width"] = width + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SizesListCall) Fields(s ...googleapi.Field) *SizesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SizesListCall) IfNoneMatch(entityTag string) *SizesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SizesListCall) Context(ctx context.Context) *SizesListCall { + c.ctx_ = ctx + return c +} + +func (c *SizesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["height"]; ok { + params.Set("height", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["iabStandard"]; ok { + params.Set("iabStandard", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["width"]; ok { + params.Set("width", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.sizes.list" call. +// Exactly one of *SizesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SizesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SizesListCall) Do() (*SizesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SizesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of sizes, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.sizes.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "height": { + // "description": "Select only sizes with this height.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "iabStandard": { + // "description": "Select only IAB standard sizes.", + // "location": "query", + // "type": "boolean" + // }, + // "ids": { + // "description": "Select only sizes with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "width": { + // "description": "Select only sizes with this width.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // } + // }, + // "path": "userprofiles/{profileId}/sizes", + // "response": { + // "$ref": "SizesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.subaccounts.get": + +type SubaccountsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one subaccount by ID. +func (r *SubaccountsService) Get(profileId int64, id int64) *SubaccountsGetCall { + c := &SubaccountsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubaccountsGetCall) Fields(s ...googleapi.Field) *SubaccountsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SubaccountsGetCall) IfNoneMatch(entityTag string) *SubaccountsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubaccountsGetCall) Context(ctx context.Context) *SubaccountsGetCall { + c.ctx_ = ctx + return c +} + +func (c *SubaccountsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.subaccounts.get" call. +// Exactly one of *Subaccount or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subaccount.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubaccountsGetCall) Do() (*Subaccount, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subaccount{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one subaccount by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.subaccounts.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Subaccount ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/subaccounts/{id}", + // "response": { + // "$ref": "Subaccount" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.subaccounts.insert": + +type SubaccountsInsertCall struct { + s *Service + profileId int64 + subaccount *Subaccount + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new subaccount. +func (r *SubaccountsService) Insert(profileId int64, subaccount *Subaccount) *SubaccountsInsertCall { + c := &SubaccountsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.subaccount = subaccount + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubaccountsInsertCall) Fields(s ...googleapi.Field) *SubaccountsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubaccountsInsertCall) Context(ctx context.Context) *SubaccountsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *SubaccountsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.subaccounts.insert" call. +// Exactly one of *Subaccount or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subaccount.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubaccountsInsertCall) Do() (*Subaccount, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subaccount{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new subaccount.", + // "httpMethod": "POST", + // "id": "dfareporting.subaccounts.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/subaccounts", + // "request": { + // "$ref": "Subaccount" + // }, + // "response": { + // "$ref": "Subaccount" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.subaccounts.list": + +type SubaccountsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Gets a list of subaccounts, possibly filtered. +func (r *SubaccountsService) List(profileId int64) *SubaccountsListCall { + c := &SubaccountsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Ids sets the optional parameter "ids": Select only subaccounts with +// these IDs. +func (c *SubaccountsListCall) Ids(ids int64) *SubaccountsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *SubaccountsListCall) MaxResults(maxResults int64) *SubaccountsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *SubaccountsListCall) PageToken(pageToken string) *SubaccountsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "subaccount*2015" will return objects with names like +// "subaccount June 2015", "subaccount April 2015", or simply +// "subaccount 2015". Most of the searches also add wildcards implicitly +// at the start and the end of the search string. For example, a search +// string of "subaccount" will match objects with name "my subaccount", +// "subaccount 2015", or simply "subaccount". +func (c *SubaccountsListCall) SearchString(searchString string) *SubaccountsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *SubaccountsListCall) SortField(sortField string) *SubaccountsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *SubaccountsListCall) SortOrder(sortOrder string) *SubaccountsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubaccountsListCall) Fields(s ...googleapi.Field) *SubaccountsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SubaccountsListCall) IfNoneMatch(entityTag string) *SubaccountsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubaccountsListCall) Context(ctx context.Context) *SubaccountsListCall { + c.ctx_ = ctx + return c +} + +func (c *SubaccountsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.subaccounts.list" call. +// Exactly one of *SubaccountsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SubaccountsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SubaccountsListCall) Do() (*SubaccountsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SubaccountsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a list of subaccounts, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.subaccounts.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "ids": { + // "description": "Select only subaccounts with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"subaccount*2015\" will return objects with names like \"subaccount June 2015\", \"subaccount April 2015\", or simply \"subaccount 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"subaccount\" will match objects with name \"my subaccount\", \"subaccount 2015\", or simply \"subaccount\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/subaccounts", + // "response": { + // "$ref": "SubaccountsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.subaccounts.patch": + +type SubaccountsPatchCall struct { + s *Service + profileId int64 + id int64 + subaccount *Subaccount + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing subaccount. This method supports patch +// semantics. +func (r *SubaccountsService) Patch(profileId int64, id int64, subaccount *Subaccount) *SubaccountsPatchCall { + c := &SubaccountsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.subaccount = subaccount + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubaccountsPatchCall) Fields(s ...googleapi.Field) *SubaccountsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubaccountsPatchCall) Context(ctx context.Context) *SubaccountsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *SubaccountsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.subaccounts.patch" call. +// Exactly one of *Subaccount or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subaccount.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubaccountsPatchCall) Do() (*Subaccount, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subaccount{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing subaccount. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.subaccounts.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Subaccount ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/subaccounts", + // "request": { + // "$ref": "Subaccount" + // }, + // "response": { + // "$ref": "Subaccount" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.subaccounts.update": + +type SubaccountsUpdateCall struct { + s *Service + profileId int64 + subaccount *Subaccount + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing subaccount. +func (r *SubaccountsService) Update(profileId int64, subaccount *Subaccount) *SubaccountsUpdateCall { + c := &SubaccountsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.subaccount = subaccount + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubaccountsUpdateCall) Fields(s ...googleapi.Field) *SubaccountsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubaccountsUpdateCall) Context(ctx context.Context) *SubaccountsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *SubaccountsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.subaccounts.update" call. +// Exactly one of *Subaccount or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subaccount.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubaccountsUpdateCall) Do() (*Subaccount, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subaccount{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing subaccount.", + // "httpMethod": "PUT", + // "id": "dfareporting.subaccounts.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/subaccounts", + // "request": { + // "$ref": "Subaccount" + // }, + // "response": { + // "$ref": "Subaccount" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userProfiles.get": + +type UserProfilesGetCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserProfilesGetCall) Fields(s ...googleapi.Field) *UserProfilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserProfilesGetCall) IfNoneMatch(entityTag string) *UserProfilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserProfilesGetCall) Context(ctx context.Context) *UserProfilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *UserProfilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userProfiles.get" call. +// Exactly one of *UserProfile or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UserProfile.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserProfilesGetCall) Do() (*UserProfile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserProfile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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", + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userProfiles.list": + +type UserProfilesListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserProfilesListCall) Fields(s ...googleapi.Field) *UserProfilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserProfilesListCall) IfNoneMatch(entityTag string) *UserProfilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserProfilesListCall) Context(ctx context.Context) *UserProfilesListCall { + c.ctx_ = ctx + return c +} + +func (c *UserProfilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userProfiles.list" call. +// Exactly one of *UserProfileList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UserProfileList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UserProfilesListCall) Do() (*UserProfileList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserProfileList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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", + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRolePermissionGroups.get": + +type UserRolePermissionGroupsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one user role permission group by ID. +func (r *UserRolePermissionGroupsService) Get(profileId int64, id int64) *UserRolePermissionGroupsGetCall { + c := &UserRolePermissionGroupsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolePermissionGroupsGetCall) Fields(s ...googleapi.Field) *UserRolePermissionGroupsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserRolePermissionGroupsGetCall) IfNoneMatch(entityTag string) *UserRolePermissionGroupsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolePermissionGroupsGetCall) Context(ctx context.Context) *UserRolePermissionGroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolePermissionGroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissionGroups/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRolePermissionGroups.get" call. +// Exactly one of *UserRolePermissionGroup or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *UserRolePermissionGroup.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UserRolePermissionGroupsGetCall) Do() (*UserRolePermissionGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRolePermissionGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one user role permission group by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.userRolePermissionGroups.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "User role permission group ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRolePermissionGroups/{id}", + // "response": { + // "$ref": "UserRolePermissionGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRolePermissionGroups.list": + +type UserRolePermissionGroupsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Gets a list of all supported user role permission groups. +func (r *UserRolePermissionGroupsService) List(profileId int64) *UserRolePermissionGroupsListCall { + c := &UserRolePermissionGroupsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolePermissionGroupsListCall) Fields(s ...googleapi.Field) *UserRolePermissionGroupsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserRolePermissionGroupsListCall) IfNoneMatch(entityTag string) *UserRolePermissionGroupsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolePermissionGroupsListCall) Context(ctx context.Context) *UserRolePermissionGroupsListCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolePermissionGroupsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissionGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRolePermissionGroups.list" call. +// Exactly one of *UserRolePermissionGroupsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *UserRolePermissionGroupsListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *UserRolePermissionGroupsListCall) Do() (*UserRolePermissionGroupsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRolePermissionGroupsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a list of all supported user role permission groups.", + // "httpMethod": "GET", + // "id": "dfareporting.userRolePermissionGroups.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRolePermissionGroups", + // "response": { + // "$ref": "UserRolePermissionGroupsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRolePermissions.get": + +type UserRolePermissionsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one user role permission by ID. +func (r *UserRolePermissionsService) Get(profileId int64, id int64) *UserRolePermissionsGetCall { + c := &UserRolePermissionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolePermissionsGetCall) Fields(s ...googleapi.Field) *UserRolePermissionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserRolePermissionsGetCall) IfNoneMatch(entityTag string) *UserRolePermissionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolePermissionsGetCall) Context(ctx context.Context) *UserRolePermissionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolePermissionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissions/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRolePermissions.get" call. +// Exactly one of *UserRolePermission or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *UserRolePermission.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UserRolePermissionsGetCall) Do() (*UserRolePermission, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRolePermission{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one user role permission by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.userRolePermissions.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "User role permission ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRolePermissions/{id}", + // "response": { + // "$ref": "UserRolePermission" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRolePermissions.list": + +type UserRolePermissionsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Gets a list of user role permissions, possibly filtered. +func (r *UserRolePermissionsService) List(profileId int64) *UserRolePermissionsListCall { + c := &UserRolePermissionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Ids sets the optional parameter "ids": Select only user role +// permissions with these IDs. +func (c *UserRolePermissionsListCall) Ids(ids int64) *UserRolePermissionsListCall { + c.opt_["ids"] = ids + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolePermissionsListCall) Fields(s ...googleapi.Field) *UserRolePermissionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserRolePermissionsListCall) IfNoneMatch(entityTag string) *UserRolePermissionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolePermissionsListCall) Context(ctx context.Context) *UserRolePermissionsListCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolePermissionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRolePermissions.list" call. +// Exactly one of *UserRolePermissionsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *UserRolePermissionsListResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UserRolePermissionsListCall) Do() (*UserRolePermissionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRolePermissionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a list of user role permissions, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.userRolePermissions.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "ids": { + // "description": "Select only user role permissions with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRolePermissions", + // "response": { + // "$ref": "UserRolePermissionsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRoles.delete": + +type UserRolesDeleteCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing user role. +func (r *UserRolesService) Delete(profileId int64, id int64) *UserRolesDeleteCall { + c := &UserRolesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolesDeleteCall) Fields(s ...googleapi.Field) *UserRolesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolesDeleteCall) Context(ctx context.Context) *UserRolesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRoles.delete" call. +func (c *UserRolesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing user role.", + // "httpMethod": "DELETE", + // "id": "dfareporting.userRoles.delete", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "User role ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRoles/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRoles.get": + +type UserRolesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one user role by ID. +func (r *UserRolesService) Get(profileId int64, id int64) *UserRolesGetCall { + c := &UserRolesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolesGetCall) Fields(s ...googleapi.Field) *UserRolesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserRolesGetCall) IfNoneMatch(entityTag string) *UserRolesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolesGetCall) Context(ctx context.Context) *UserRolesGetCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRoles.get" call. +// Exactly one of *UserRole or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *UserRole.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserRolesGetCall) Do() (*UserRole, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRole{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one user role by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.userRoles.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "User role ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRoles/{id}", + // "response": { + // "$ref": "UserRole" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRoles.insert": + +type UserRolesInsertCall struct { + s *Service + profileId int64 + userrole *UserRole + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new user role. +func (r *UserRolesService) Insert(profileId int64, userrole *UserRole) *UserRolesInsertCall { + c := &UserRolesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.userrole = userrole + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolesInsertCall) Fields(s ...googleapi.Field) *UserRolesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolesInsertCall) Context(ctx context.Context) *UserRolesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRoles.insert" call. +// Exactly one of *UserRole or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *UserRole.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserRolesInsertCall) Do() (*UserRole, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRole{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new user role.", + // "httpMethod": "POST", + // "id": "dfareporting.userRoles.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRoles", + // "request": { + // "$ref": "UserRole" + // }, + // "response": { + // "$ref": "UserRole" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRoles.list": + +type UserRolesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of user roles, possibly filtered. +func (r *UserRolesService) List(profileId int64) *UserRolesListCall { + c := &UserRolesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AccountUserRoleOnly sets the optional parameter +// "accountUserRoleOnly": Select only account level user roles not +// associated with any specific subaccount. +func (c *UserRolesListCall) AccountUserRoleOnly(accountUserRoleOnly bool) *UserRolesListCall { + c.opt_["accountUserRoleOnly"] = accountUserRoleOnly + return c +} + +// Ids sets the optional parameter "ids": Select only user roles with +// the specified IDs. +func (c *UserRolesListCall) Ids(ids int64) *UserRolesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *UserRolesListCall) MaxResults(maxResults int64) *UserRolesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *UserRolesListCall) PageToken(pageToken string) *UserRolesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "userrole*2015" will return objects with names like +// "userrole June 2015", "userrole April 2015", or simply "userrole +// 2015". Most of the searches also add wildcards implicitly at the +// start and the end of the search string. For example, a search string +// of "userrole" will match objects with name "my userrole", "userrole +// 2015", or simply "userrole". +func (c *UserRolesListCall) SearchString(searchString string) *UserRolesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *UserRolesListCall) SortField(sortField string) *UserRolesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *UserRolesListCall) SortOrder(sortOrder string) *UserRolesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// SubaccountId sets the optional parameter "subaccountId": Select only +// user roles that belong to this subaccount. +func (c *UserRolesListCall) SubaccountId(subaccountId int64) *UserRolesListCall { + c.opt_["subaccountId"] = subaccountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolesListCall) Fields(s ...googleapi.Field) *UserRolesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserRolesListCall) IfNoneMatch(entityTag string) *UserRolesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolesListCall) Context(ctx context.Context) *UserRolesListCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["accountUserRoleOnly"]; ok { + params.Set("accountUserRoleOnly", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["subaccountId"]; ok { + params.Set("subaccountId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRoles.list" call. +// Exactly one of *UserRolesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *UserRolesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UserRolesListCall) Do() (*UserRolesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRolesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of user roles, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.userRoles.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "accountUserRoleOnly": { + // "description": "Select only account level user roles not associated with any specific subaccount.", + // "location": "query", + // "type": "boolean" + // }, + // "ids": { + // "description": "Select only user roles with the specified IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"userrole*2015\" will return objects with names like \"userrole June 2015\", \"userrole April 2015\", or simply \"userrole 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"userrole\" will match objects with name \"my userrole\", \"userrole 2015\", or simply \"userrole\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "subaccountId": { + // "description": "Select only user roles that belong to this subaccount.", + // "format": "int64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRoles", + // "response": { + // "$ref": "UserRolesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRoles.patch": + +type UserRolesPatchCall struct { + s *Service + profileId int64 + id int64 + userrole *UserRole + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing user role. This method supports patch +// semantics. +func (r *UserRolesService) Patch(profileId int64, id int64, userrole *UserRole) *UserRolesPatchCall { + c := &UserRolesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.userrole = userrole + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolesPatchCall) Fields(s ...googleapi.Field) *UserRolesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolesPatchCall) Context(ctx context.Context) *UserRolesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRoles.patch" call. +// Exactly one of *UserRole or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *UserRole.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserRolesPatchCall) Do() (*UserRole, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRole{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing user role. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.userRoles.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "User role ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRoles", + // "request": { + // "$ref": "UserRole" + // }, + // "response": { + // "$ref": "UserRole" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRoles.update": + +type UserRolesUpdateCall struct { + s *Service + profileId int64 + userrole *UserRole + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing user role. +func (r *UserRolesService) Update(profileId int64, userrole *UserRole) *UserRolesUpdateCall { + c := &UserRolesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.userrole = userrole + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolesUpdateCall) Fields(s ...googleapi.Field) *UserRolesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolesUpdateCall) Context(ctx context.Context) *UserRolesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRoles.update" call. +// Exactly one of *UserRole or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *UserRole.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserRolesUpdateCall) Do() (*UserRole, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRole{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing user role.", + // "httpMethod": "PUT", + // "id": "dfareporting.userRoles.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRoles", + // "request": { + // "$ref": "UserRole" + // }, + // "response": { + // "$ref": "UserRole" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/dfareporting/v2.1/dfareporting-api.json b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v2.1/dfareporting-api.json new file mode 100644 index 000000000..346a1a325 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v2.1/dfareporting-api.json @@ -0,0 +1,17625 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/xZQxxa_Tb2iO1EIpR9uJ-M5uVs4\"", + "discoveryVersion": "v1", + "id": "dfareporting:v2.1", + "name": "dfareporting", + "version": "v2.1", + "revision": "20150717", + "title": "DCM/DFA Reporting And Trafficking API", + "description": "Manage your DoubleClick Campaign Manager ad campaigns and reports.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/doubleclick-advertisers/reporting/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/dfareporting/v2.1/", + "basePath": "/dfareporting/v2.1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "dfareporting/v2.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" + }, + "https://www.googleapis.com/auth/dfatrafficking": { + "description": "View and manage your DoubleClick Campaign Manager's (DCM) display ad campaigns" + } + } + } + }, + "schemas": { + "Account": { + "id": "Account", + "type": "object", + "description": "Contains properties of a DCM account.", + "properties": { + "accountPermissionIds": { + "type": "array", + "description": "Account permissions assigned to this account.", + "items": { + "type": "string", + "format": "int64" + } + }, + "accountProfile": { + "type": "string", + "description": "Profile for this account. This is a read-only field that can be left blank.", + "enum": [ + "ACCOUNT_PROFILE_BASIC", + "ACCOUNT_PROFILE_STANDARD" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "active": { + "type": "boolean", + "description": "Whether this account is active." + }, + "activeAdsLimitTier": { + "type": "string", + "description": "Maximum number of active ads allowed for this account.", + "enum": [ + "ACTIVE_ADS_TIER_100K", + "ACTIVE_ADS_TIER_200K", + "ACTIVE_ADS_TIER_300K", + "ACTIVE_ADS_TIER_40K", + "ACTIVE_ADS_TIER_75K" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "activeViewOptOut": { + "type": "boolean", + "description": "Whether to serve creatives with Active View tags. If disabled, viewability data will not be available for any impressions." + }, + "availablePermissionIds": { + "type": "array", + "description": "User role permissions available to the user roles of this account.", + "items": { + "type": "string", + "format": "int64" + } + }, + "comscoreVceEnabled": { + "type": "boolean", + "description": "Whether campaigns created in this account will be enabled for comScore vCE by default." + }, + "countryId": { + "type": "string", + "description": "ID of the country associated with this account.", + "format": "int64" + }, + "currencyId": { + "type": "string", + "description": "ID of currency associated with this account. This is a required field.\nAcceptable values are: \n- \"1\" for USD \n- \"2\" for GBP \n- \"3\" for ESP \n- \"4\" for SEK \n- \"5\" for CAD \n- \"6\" for JPY \n- \"7\" for DEM \n- \"8\" for AUD \n- \"9\" for FRF \n- \"10\" for ITL \n- \"11\" for DKK \n- \"12\" for NOK \n- \"13\" for FIM \n- \"14\" for ZAR \n- \"15\" for IEP \n- \"16\" for NLG \n- \"17\" for EUR \n- \"18\" for KRW \n- \"19\" for TWD \n- \"20\" for SGD \n- \"21\" for CNY \n- \"22\" for HKD \n- \"23\" for NZD \n- \"24\" for MYR \n- \"25\" for BRL \n- \"26\" for PTE \n- \"27\" for MXP \n- \"28\" for CLP \n- \"29\" for TRY \n- \"30\" for ARS \n- \"31\" for PEN \n- \"32\" for ILS \n- \"33\" for CHF \n- \"34\" for VEF \n- \"35\" for COP \n- \"36\" for GTQ", + "format": "int64" + }, + "defaultCreativeSizeId": { + "type": "string", + "description": "Default placement dimensions for this account.", + "format": "int64" + }, + "description": { + "type": "string", + "description": "Description of this account." + }, + "id": { + "type": "string", + "description": "ID of this account. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#account\".", + "default": "dfareporting#account" + }, + "locale": { + "type": "string", + "description": "Locale of this account.\nAcceptable values are: \n- \"cs\" (Czech) \n- \"de\" (German) \n- \"en\" (English) \n- \"en-GB\" (English United Kingdom) \n- \"es\" (Spanish) \n- \"fr\" (French) \n- \"it\" (Italian) \n- \"ja\" (Japanese) \n- \"ko\" (Korean) \n- \"pl\" (Polish) \n- \"pt-BR\" (Portuguese Brazil) \n- \"ru\" (Russian) \n- \"sv\" (Swedish) \n- \"tr\" (Turkish) \n- \"zh-CN\" (Chinese Simplified) \n- \"zh-TW\" (Chinese Traditional)" + }, + "maximumImageSize": { + "type": "string", + "description": "Maximum image size allowed for this account.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this account. This is a required field, and must be less than 128 characters long and be globally unique." + }, + "nielsenOcrEnabled": { + "type": "boolean", + "description": "Whether campaigns created in this account will be enabled for Nielsen OCR reach ratings by default." + }, + "reportsConfiguration": { + "$ref": "ReportsConfiguration", + "description": "Reporting configuration of this account." + }, + "teaserSizeLimit": { + "type": "string", + "description": "File size limit in kilobytes of Rich Media teaser creatives. Must be between 1 and 10240.", + "format": "int64" + } + } + }, + "AccountActiveAdSummary": { + "id": "AccountActiveAdSummary", + "type": "object", + "description": "Gets a summary of active ads in an account.", + "properties": { + "accountId": { + "type": "string", + "description": "ID of the account.", + "format": "int64" + }, + "activeAds": { + "type": "string", + "description": "Ads that have been activated for the account", + "format": "int64" + }, + "activeAdsLimitTier": { + "type": "string", + "description": "Maximum number of active ads allowed for the account.", + "enum": [ + "ACTIVE_ADS_TIER_100K", + "ACTIVE_ADS_TIER_200K", + "ACTIVE_ADS_TIER_300K", + "ACTIVE_ADS_TIER_40K", + "ACTIVE_ADS_TIER_75K" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "availableAds": { + "type": "string", + "description": "Ads that can be activated for the account.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountActiveAdSummary\".", + "default": "dfareporting#accountActiveAdSummary" + } + } + }, + "AccountPermission": { + "id": "AccountPermission", + "type": "object", + "description": "AccountPermissions contains information about a particular account permission. Some features of DCM require an account permission to be present in the account.", + "properties": { + "accountProfiles": { + "type": "array", + "description": "Account profiles associated with this account permission.\n\nPossible values are:\n- \"ACCOUNT_PROFILE_BASIC\"\n- \"ACCOUNT_PROFILE_STANDARD\"", + "items": { + "type": "string", + "enum": [ + "ACCOUNT_PROFILE_BASIC", + "ACCOUNT_PROFILE_STANDARD" + ], + "enumDescriptions": [ + "", + "" + ] + } + }, + "id": { + "type": "string", + "description": "ID of this account permission.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountPermission\".", + "default": "dfareporting#accountPermission" + }, + "level": { + "type": "string", + "description": "Administrative level required to enable this account permission.", + "enum": [ + "ADMINISTRATOR", + "USER" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "name": { + "type": "string", + "description": "Name of this account permission." + }, + "permissionGroupId": { + "type": "string", + "description": "Permission group of this account permission.", + "format": "int64" + } + } + }, + "AccountPermissionGroup": { + "id": "AccountPermissionGroup", + "type": "object", + "description": "AccountPermissionGroups contains a mapping of permission group IDs to names. A permission group is a grouping of account permissions.", + "properties": { + "id": { + "type": "string", + "description": "ID of this account permission group.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountPermissionGroup\".", + "default": "dfareporting#accountPermissionGroup" + }, + "name": { + "type": "string", + "description": "Name of this account permission group." + } + } + }, + "AccountPermissionGroupsListResponse": { + "id": "AccountPermissionGroupsListResponse", + "type": "object", + "description": "Account Permission Group List Response", + "properties": { + "accountPermissionGroups": { + "type": "array", + "description": "Account permission group collection.", + "items": { + "$ref": "AccountPermissionGroup" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountPermissionGroupsListResponse\".", + "default": "dfareporting#accountPermissionGroupsListResponse" + } + } + }, + "AccountPermissionsListResponse": { + "id": "AccountPermissionsListResponse", + "type": "object", + "description": "Account Permission List Response", + "properties": { + "accountPermissions": { + "type": "array", + "description": "Account permission collection.", + "items": { + "$ref": "AccountPermission" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountPermissionsListResponse\".", + "default": "dfareporting#accountPermissionsListResponse" + } + } + }, + "AccountUserProfile": { + "id": "AccountUserProfile", + "type": "object", + "description": "AccountUserProfiles contains properties of a DCM user profile. This resource is specifically for managing user profiles, whereas UserProfiles is for accessing the API.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of the user profile. This is a read-only field that can be left blank.", + "format": "int64" + }, + "active": { + "type": "boolean", + "description": "Whether this user profile is active. This defaults to false, and must be set true on insert for the user profile to be usable." + }, + "advertiserFilter": { + "$ref": "ObjectFilter", + "description": "Filter that describes which advertisers are visible to the user profile." + }, + "campaignFilter": { + "$ref": "ObjectFilter", + "description": "Filter that describes which campaigns are visible to the user profile." + }, + "comments": { + "type": "string", + "description": "Comments for this user profile." + }, + "email": { + "type": "string", + "description": "Email of the user profile. The email addresss must be linked to a Google Account. This field is required on insertion and is read-only after insertion." + }, + "id": { + "type": "string", + "description": "ID of the user profile. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountUserProfile\".", + "default": "dfareporting#accountUserProfile" + }, + "locale": { + "type": "string", + "description": "Locale of the user profile. This is a required field.\nAcceptable values are: \n- \"cs\" (Czech) \n- \"de\" (German) \n- \"en\" (English) \n- \"en-GB\" (English United Kingdom) \n- \"es\" (Spanish) \n- \"fr\" (French) \n- \"it\" (Italian) \n- \"ja\" (Japanese) \n- \"ko\" (Korean) \n- \"pl\" (Polish) \n- \"pt-BR\" (Portuguese Brazil)\n- \"ru\" (Russian) \n- \"sv\" (Swedish) \n- \"tr\" (Turkish) \n- \"zh-CN\" (Chinese Simplified) \n- \"zh-TW\" (Chinese Traditional)" + }, + "name": { + "type": "string", + "description": "Name of the user profile. This is a required field. Must be less than 64 characters long, must be globally unique, and cannot contain whitespace or any of the following characters: \"&;\"#%,\"." + }, + "siteFilter": { + "$ref": "ObjectFilter", + "description": "Filter that describes which sites are visible to the user profile." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of the user profile. This is a read-only field that can be left blank.", + "format": "int64" + }, + "traffickerType": { + "type": "string", + "description": "Trafficker type of this user profile.", + "enum": [ + "EXTERNAL_TRAFFICKER", + "INTERNAL_NON_TRAFFICKER", + "INTERNAL_TRAFFICKER" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "userAccessType": { + "type": "string", + "description": "User type of the user profile. This is a read-only field that can be left blank.", + "enum": [ + "INTERNAL_ADMINISTRATOR", + "NORMAL_USER", + "SUPER_USER" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "userRoleFilter": { + "$ref": "ObjectFilter", + "description": "Filter that describes which user roles are visible to the user profile." + }, + "userRoleId": { + "type": "string", + "description": "User role ID of the user profile. This is a required field.", + "format": "int64" + } + } + }, + "AccountUserProfilesListResponse": { + "id": "AccountUserProfilesListResponse", + "type": "object", + "description": "Account User Profile List Response", + "properties": { + "accountUserProfiles": { + "type": "array", + "description": "Account user profile collection.", + "items": { + "$ref": "AccountUserProfile" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountUserProfilesListResponse\".", + "default": "dfareporting#accountUserProfilesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "AccountsListResponse": { + "id": "AccountsListResponse", + "type": "object", + "description": "Account List Response", + "properties": { + "accounts": { + "type": "array", + "description": "Account collection.", + "items": { + "$ref": "Account" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountsListResponse\".", + "default": "dfareporting#accountsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "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" + } + } + } + }, + "Ad": { + "id": "Ad", + "type": "object", + "description": "Contains properties of a DCM ad.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this ad. This is a read-only field that can be left blank.", + "format": "int64" + }, + "active": { + "type": "boolean", + "description": "Whether this ad is active." + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this ad. This is a required field on insertion.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "archived": { + "type": "boolean", + "description": "Whether this ad is archived." + }, + "audienceSegmentId": { + "type": "string", + "description": "Audience segment ID that is being targeted for this ad. Applicable when type is AD_SERVING_STANDARD_AD.", + "format": "int64" + }, + "campaignId": { + "type": "string", + "description": "Campaign ID of this ad. This is a required field on insertion.", + "format": "int64" + }, + "campaignIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the campaign. This is a read-only, auto-generated field." + }, + "clickThroughUrl": { + "$ref": "ClickThroughUrl", + "description": "Click-through URL for this ad. This is a required field on insertion. Applicable when type is AD_SERVING_CLICK_TRACKER." + }, + "clickThroughUrlSuffixProperties": { + "$ref": "ClickThroughUrlSuffixProperties", + "description": "Click-through URL suffix properties for this ad. Applies to the URL in the ad or (if overriding ad properties) the URL in the creative." + }, + "comments": { + "type": "string", + "description": "Comments for this ad." + }, + "compatibility": { + "type": "string", + "description": "Compatibility of this ad. Applicable when type is AD_SERVING_DEFAULT_AD. WEB and WEB_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering an in-stream video ads developed with the VAST standard.", + "enum": [ + "APP", + "APP_INTERSTITIAL", + "IN_STREAM_VIDEO", + "WEB", + "WEB_INTERSTITIAL" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "createInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the creation of this ad.This is a read-only field." + }, + "creativeGroupAssignments": { + "type": "array", + "description": "Creative group assignments for this ad. Applicable when type is AD_SERVING_CLICK_TRACKER. Only one assignment per creative group number is allowed for a maximum of two assignments.", + "items": { + "$ref": "CreativeGroupAssignment" + } + }, + "creativeRotation": { + "$ref": "CreativeRotation", + "description": "Creative rotation for this ad. Applicable when type is AD_SERVING_DEFAULT_AD, AD_SERVING_STANDARD_AD, or AD_SERVING_TRACKING. When type is AD_SERVING_DEFAULT_AD, this field should have exactly one creativeAssignment." + }, + "dayPartTargeting": { + "$ref": "DayPartTargeting", + "description": "Time and day targeting information for this ad. Applicable when type is AD_SERVING_STANDARD_AD." + }, + "defaultClickThroughEventTagProperties": { + "$ref": "DefaultClickThroughEventTagProperties", + "description": "Default click-through event tag properties for this ad." + }, + "deliverySchedule": { + "$ref": "DeliverySchedule", + "description": "Delivery schedule information for this ad. Applicable when type is AD_SERVING_STANDARD_AD or AD_SERVING_TRACKING. This field along with subfields priority and impressionRatio are required on insertion when type is AD_SERVING_STANDARD_AD." + }, + "dynamicClickTracker": { + "type": "boolean", + "description": "Whether this ad is a dynamic click tracker. Applicable when type is AD_SERVING_CLICK_TRACKER. This is a required field on insert, and is read-only after insert." + }, + "endTime": { + "type": "string", + "description": "Date and time that this ad should stop serving. Must be later than the start time. This is a required field on insertion.", + "format": "date-time" + }, + "eventTagOverrides": { + "type": "array", + "description": "Event tag overrides for this ad.", + "items": { + "$ref": "EventTagOverride" + } + }, + "geoTargeting": { + "$ref": "GeoTargeting", + "description": "Geographical targeting information for this ad.Applicable when type is AD_SERVING_STANDARD_AD." + }, + "id": { + "type": "string", + "description": "ID of this ad. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this ad. This is a read-only, auto-generated field." + }, + "keyValueTargetingExpression": { + "$ref": "KeyValueTargetingExpression", + "description": "Key-value targeting information for this ad. Applicable when type is AD_SERVING_STANDARD_AD." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#ad\".", + "default": "dfareporting#ad" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the most recent modification of this ad. This is a read-only field." + }, + "name": { + "type": "string", + "description": "Name of this ad. This is a required field and must be less than 256 characters long." + }, + "placementAssignments": { + "type": "array", + "description": "Placement assignments for this ad.", + "items": { + "$ref": "PlacementAssignment" + } + }, + "remarketing_list_expression": { + "$ref": "ListTargetingExpression", + "description": "Applicable when type is AD_SERVING_STANDARD_AD. Remarketing list targeting expression for this ad." + }, + "size": { + "$ref": "Size", + "description": "Size of this ad. Applicable when type is AD_SERVING_DEFAULT_AD." + }, + "sslCompliant": { + "type": "boolean", + "description": "Whether this ad is ssl compliant. This is a read-only field that is auto-generated when the ad is inserted or updated." + }, + "sslRequired": { + "type": "boolean", + "description": "Whether this ad requires ssl. This is a read-only field that is auto-generated when the ad is inserted or updated." + }, + "startTime": { + "type": "string", + "description": "Date and time that this ad should start serving. If creating an ad, this field must be a time in the future. This is a required field on insertion.", + "format": "date-time" + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this ad. This is a read-only field that can be left blank.", + "format": "int64" + }, + "technologyTargeting": { + "$ref": "TechnologyTargeting", + "description": "Technology platform targeting information for this ad. Applicable when type is AD_SERVING_STANDARD_AD." + }, + "type": { + "type": "string", + "description": "Type of ad. This is a required field on insertion. Note that default ads (AD_SERVING_DEFAULT_AD) cannot be created directly (see Creative resource).", + "enum": [ + "AD_SERVING_CLICK_TRACKER", + "AD_SERVING_DEFAULT_AD", + "AD_SERVING_STANDARD_AD", + "AD_SERVING_TRACKING" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "AdSlot": { + "id": "AdSlot", + "type": "object", + "description": "Ad Slot", + "properties": { + "comment": { + "type": "string", + "description": "Comment for this ad slot." + }, + "compatibility": { + "type": "string", + "description": "Ad slot compatibility. WEB and WEB_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard.", + "enum": [ + "PLANNING_RENDERING_ENVIRONMENT_TYPE_APP", + "PLANNING_RENDERING_ENVIRONMENT_TYPE_APP_INTERSTITIAL", + "PLANNING_RENDERING_ENVIRONMENT_TYPE_IN_STREAM_VIDEO", + "PLANNING_RENDERING_ENVIRONMENT_TYPE_WEB", + "PLANNING_RENDERING_ENVIRONMENT_TYPE_WEB_INTERSTITIAL" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "height": { + "type": "string", + "description": "Height of this ad slot.", + "format": "int64" + }, + "linkedPlacementId": { + "type": "string", + "description": "ID of the placement from an external platform that is linked to this ad slot.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this ad slot." + }, + "paymentSourceType": { + "type": "string", + "description": "Payment source type of this ad slot.", + "enum": [ + "PLANNING_PAYMENT_SOURCE_TYPE_AGENCY_PAID", + "PLANNING_PAYMENT_SOURCE_TYPE_PUBLISHER_PAID" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "primary": { + "type": "boolean", + "description": "Primary ad slot of a roadblock inventory item." + }, + "width": { + "type": "string", + "description": "Width of this ad slot.", + "format": "int64" + } + } + }, + "AdsListResponse": { + "id": "AdsListResponse", + "type": "object", + "description": "Ad List Response", + "properties": { + "ads": { + "type": "array", + "description": "Ad collection.", + "items": { + "$ref": "Ad" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#adsListResponse\".", + "default": "dfareporting#adsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "Advertiser": { + "id": "Advertiser", + "type": "object", + "description": "Contains properties of a DCM advertiser.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this advertiser.This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserGroupId": { + "type": "string", + "description": "ID of the advertiser group this advertiser belongs to. You can group advertisers for reporting purposes, allowing you to see aggregated information for all advertisers in each group.", + "format": "int64" + }, + "clickThroughUrlSuffix": { + "type": "string", + "description": "Suffix added to click-through URL of ad creative associations under this advertiser. Must be less than 129 characters long." + }, + "defaultClickThroughEventTagId": { + "type": "string", + "description": "ID of the click-through event tag to apply by default to the landing pages of this advertiser's campaigns.", + "format": "int64" + }, + "defaultEmail": { + "type": "string", + "description": "Default email address used in sender field for tag emails." + }, + "floodlightConfigurationId": { + "type": "string", + "description": "Floodlight configuration ID of this advertiser. The floodlight configuration ID will be created automatically, so on insert this field should be left blank. This field can be set to another advertiser's floodlight configuration ID in order to share that advertiser's floodlight configuration with this advertiser, so long as: \n- This advertiser's original floodlight configuration is not already associated with floodlight activities or floodlight activity groups. \n- This advertiser's original floodlight configuration is not already shared with another advertiser.", + "format": "int64" + }, + "floodlightConfigurationIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the floodlight configuration. This is a read-only, auto-generated field." + }, + "id": { + "type": "string", + "description": "ID of this advertiser. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this advertiser. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#advertiser\".", + "default": "dfareporting#advertiser" + }, + "name": { + "type": "string", + "description": "Name of this advertiser. This is a required field and must be less than 256 characters long and unique among advertisers of the same account." + }, + "originalFloodlightConfigurationId": { + "type": "string", + "description": "Original floodlight configuration before any sharing occurred. Set the floodlightConfigurationId of this advertiser to originalFloodlightConfigurationId to unshare the advertiser's current floodlight configuration. You cannot unshare an advertiser's floodlight configuration if the shared configuration has activities associated with any campaign or placement.", + "format": "int64" + }, + "status": { + "type": "string", + "description": "Status of this advertiser.", + "enum": [ + "APPROVED", + "ON_HOLD" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this advertiser.This is a read-only field that can be left blank.", + "format": "int64" + } + } + }, + "AdvertiserGroup": { + "id": "AdvertiserGroup", + "type": "object", + "description": "Groups advertisers together so that reports can be generated for the entire group at once.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this advertiser group. This is a read-only field that can be left blank.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "ID of this advertiser group. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#advertiserGroup\".", + "default": "dfareporting#advertiserGroup" + }, + "name": { + "type": "string", + "description": "Name of this advertiser group. This is a required field and must be less than 256 characters long and unique among advertiser groups of the same account." + } + } + }, + "AdvertiserGroupsListResponse": { + "id": "AdvertiserGroupsListResponse", + "type": "object", + "description": "Advertiser Group List Response", + "properties": { + "advertiserGroups": { + "type": "array", + "description": "Advertiser group collection.", + "items": { + "$ref": "AdvertiserGroup" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#advertiserGroupsListResponse\".", + "default": "dfareporting#advertiserGroupsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "AdvertisersListResponse": { + "id": "AdvertisersListResponse", + "type": "object", + "description": "Advertiser List Response", + "properties": { + "advertisers": { + "type": "array", + "description": "Advertiser collection.", + "items": { + "$ref": "Advertiser" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#advertisersListResponse\".", + "default": "dfareporting#advertisersListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "AudienceSegment": { + "id": "AudienceSegment", + "type": "object", + "description": "Audience Segment.", + "properties": { + "allocation": { + "type": "integer", + "description": "Weight allocated to this segment. Must be between 1 and 1000. The weight assigned will be understood in proportion to the weights assigned to other segments in the same segment group.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "ID of this audience segment. This is a read-only, auto-generated field.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this audience segment. This is a required field and must be less than 65 characters long." + } + } + }, + "AudienceSegmentGroup": { + "id": "AudienceSegmentGroup", + "type": "object", + "description": "Audience Segment Group.", + "properties": { + "audienceSegments": { + "type": "array", + "description": "Audience segments assigned to this group. The number of segments must be between 2 and 100.", + "items": { + "$ref": "AudienceSegment" + } + }, + "id": { + "type": "string", + "description": "ID of this audience segment group. This is a read-only, auto-generated field.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this audience segment group. This is a required field and must be less than 65 characters long." + } + } + }, + "Browser": { + "id": "Browser", + "type": "object", + "description": "Contains information about a browser that can be targeted by ads.", + "properties": { + "browserVersionId": { + "type": "string", + "description": "ID referring to this grouping of browser and version numbers. This is the ID used for targeting.", + "format": "int64" + }, + "dartId": { + "type": "string", + "description": "DART ID of this browser. This is the ID used when generating reports.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#browser\".", + "default": "dfareporting#browser" + }, + "majorVersion": { + "type": "string", + "description": "Major version number (leftmost number) of this browser. For example, for Chrome 5.0.376.86 beta, this field should be set to 5. An asterisk (*) may be used to target any version number, and a question mark (?) may be used to target cases where the version number cannot be identified. For example, Chrome *.* targets any version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad server knows the browser is Firefox but can't tell which version it is." + }, + "minorVersion": { + "type": "string", + "description": "Minor version number (number after first dot on left) of this browser. For example, for Chrome 5.0.375.86 beta, this field should be set to 0. An asterisk (*) may be used to target any version number, and a question mark (?) may be used to target cases where the version number cannot be identified. For example, Chrome *.* targets any version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad server knows the browser is Firefox but can't tell which version it is." + }, + "name": { + "type": "string", + "description": "Name of this browser." + } + } + }, + "BrowsersListResponse": { + "id": "BrowsersListResponse", + "type": "object", + "description": "Browser List Response", + "properties": { + "browsers": { + "type": "array", + "description": "Browser collection.", + "items": { + "$ref": "Browser" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#browsersListResponse\".", + "default": "dfareporting#browsersListResponse" + } + } + }, + "Campaign": { + "id": "Campaign", + "type": "object", + "description": "Contains properties of a DCM campaign.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this campaign. This is a read-only field that can be left blank.", + "format": "int64" + }, + "additionalCreativeOptimizationConfigurations": { + "type": "array", + "description": "Additional creative optimization configurations for the campaign.", + "items": { + "$ref": "CreativeOptimizationConfiguration" + } + }, + "advertiserGroupId": { + "type": "string", + "description": "Advertiser group ID of the associated advertiser.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this campaign. This is a required field.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the advertiser ID of this campaign. This is a read-only, auto-generated field." + }, + "archived": { + "type": "boolean", + "description": "Whether this campaign has been archived." + }, + "audienceSegmentGroups": { + "type": "array", + "description": "Audience segment groups assigned to this campaign. Cannot have more than 300 segment groups.", + "items": { + "$ref": "AudienceSegmentGroup" + } + }, + "billingInvoiceCode": { + "type": "string", + "description": "Billing invoice code included in the DCM client billing invoices associated with the campaign." + }, + "clickThroughUrlSuffixProperties": { + "$ref": "ClickThroughUrlSuffixProperties", + "description": "Click-through URL suffix override properties for this campaign." + }, + "comment": { + "type": "string", + "description": "Arbitrary comments about this campaign. Must be less than 256 characters long." + }, + "comscoreVceEnabled": { + "type": "boolean", + "description": "Whether comScore vCE reports are enabled for this campaign." + }, + "createInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the creation of this campaign. This is a read-only field." + }, + "creativeGroupIds": { + "type": "array", + "description": "List of creative group IDs that are assigned to the campaign.", + "items": { + "type": "string", + "format": "int64" + } + }, + "creativeOptimizationConfiguration": { + "$ref": "CreativeOptimizationConfiguration", + "description": "Creative optimization configuration for the campaign." + }, + "defaultClickThroughEventTagProperties": { + "$ref": "DefaultClickThroughEventTagProperties", + "description": "Click-through event tag ID override properties for this campaign." + }, + "endDate": { + "type": "string", + "description": "Date on which the campaign will stop running. On insert, the end date must be today or a future date. The end date must be later than or be the same as the start date. If, for example, you set 6/25/2015 as both the start and end dates, the effective campaign run date is just that day only, 6/25/2015. The hours, minutes, and seconds of the end date should not be set, as doing so will result in an error. This is a required field.", + "format": "date" + }, + "eventTagOverrides": { + "type": "array", + "description": "Overrides that can be used to activate or deactivate advertiser event tags.", + "items": { + "$ref": "EventTagOverride" + } + }, + "externalId": { + "type": "string", + "description": "External ID for this campaign." + }, + "id": { + "type": "string", + "description": "ID of this campaign. This is a read-only auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this campaign. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#campaign\".", + "default": "dfareporting#campaign" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the most recent modification of this campaign. This is a read-only field." + }, + "lookbackConfiguration": { + "$ref": "LookbackConfiguration", + "description": "Lookback window settings for the campaign." + }, + "name": { + "type": "string", + "description": "Name of this campaign. This is a required field and must be less than 256 characters long and unique among campaigns of the same advertiser." + }, + "nielsenOcrEnabled": { + "type": "boolean", + "description": "Whether Nielsen reports are enabled for this campaign." + }, + "startDate": { + "type": "string", + "description": "Date on which the campaign starts running. The start date can be any date. The hours, minutes, and seconds of the start date should not be set, as doing so will result in an error. This is a required field.", + "format": "date" + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this campaign. This is a read-only field that can be left blank.", + "format": "int64" + }, + "traffickerEmails": { + "type": "array", + "description": "Campaign trafficker contact emails.", + "items": { + "type": "string" + } + } + } + }, + "CampaignCreativeAssociation": { + "id": "CampaignCreativeAssociation", + "type": "object", + "description": "Identifies a creative which has been associated with a given campaign.", + "properties": { + "creativeId": { + "type": "string", + "description": "ID of the creative associated with the campaign. This is a required field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#campaignCreativeAssociation\".", + "default": "dfareporting#campaignCreativeAssociation" + } + } + }, + "CampaignCreativeAssociationsListResponse": { + "id": "CampaignCreativeAssociationsListResponse", + "type": "object", + "description": "Campaign Creative Association List Response", + "properties": { + "campaignCreativeAssociations": { + "type": "array", + "description": "Campaign creative association collection", + "items": { + "$ref": "CampaignCreativeAssociation" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#campaignCreativeAssociationsListResponse\".", + "default": "dfareporting#campaignCreativeAssociationsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "CampaignsListResponse": { + "id": "CampaignsListResponse", + "type": "object", + "description": "Campaign List Response", + "properties": { + "campaigns": { + "type": "array", + "description": "Campaign collection.", + "items": { + "$ref": "Campaign" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#campaignsListResponse\".", + "default": "dfareporting#campaignsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "ChangeLog": { + "id": "ChangeLog", + "type": "object", + "description": "Describes a change that a user has made to a resource.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of the modified object.", + "format": "int64" + }, + "action": { + "type": "string", + "description": "Action which caused the change." + }, + "changeTime": { + "type": "string", + "description": "Time when the object was modified.", + "format": "date-time" + }, + "fieldName": { + "type": "string", + "description": "Field name of the object which changed." + }, + "id": { + "type": "string", + "description": "ID of this change log.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#changeLog\".", + "default": "dfareporting#changeLog" + }, + "newValue": { + "type": "string", + "description": "New value of the object field." + }, + "objectId": { + "type": "string", + "description": "ID of the object of this change log. The object could be a campaign, placement, ad, or other type.", + "format": "int64" + }, + "objectType": { + "type": "string", + "description": "Object type of the change log." + }, + "oldValue": { + "type": "string", + "description": "Old value of the object field." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of the modified object.", + "format": "int64" + }, + "transactionId": { + "type": "string", + "description": "Transaction ID of this change log. When a single API call results in many changes, each change will have a separate ID in the change log but will share the same transactionId.", + "format": "int64" + }, + "userProfileId": { + "type": "string", + "description": "ID of the user who modified the object.", + "format": "int64" + }, + "userProfileName": { + "type": "string", + "description": "User profile name of the user who modified the object." + } + } + }, + "ChangeLogsListResponse": { + "id": "ChangeLogsListResponse", + "type": "object", + "description": "Change Log List Response", + "properties": { + "changeLogs": { + "type": "array", + "description": "Change log collection.", + "items": { + "$ref": "ChangeLog" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#changeLogsListResponse\".", + "default": "dfareporting#changeLogsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "CitiesListResponse": { + "id": "CitiesListResponse", + "type": "object", + "description": "City List Response", + "properties": { + "cities": { + "type": "array", + "description": "City collection.", + "items": { + "$ref": "City" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#citiesListResponse\".", + "default": "dfareporting#citiesListResponse" + } + } + }, + "City": { + "id": "City", + "type": "object", + "description": "Contains information about a city that can be targeted by ads.", + "properties": { + "countryCode": { + "type": "string", + "description": "Country code of the country to which this city belongs." + }, + "countryDartId": { + "type": "string", + "description": "DART ID of the country to which this city belongs.", + "format": "int64" + }, + "dartId": { + "type": "string", + "description": "DART ID of this city. This is the ID used for targeting and generating reports.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#city\".", + "default": "dfareporting#city" + }, + "metroCode": { + "type": "string", + "description": "Metro region code of the metro region (DMA) to which this city belongs." + }, + "metroDmaId": { + "type": "string", + "description": "ID of the metro region (DMA) to which this city belongs.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this city." + }, + "regionCode": { + "type": "string", + "description": "Region code of the region to which this city belongs." + }, + "regionDartId": { + "type": "string", + "description": "DART ID of the region to which this city belongs.", + "format": "int64" + } + } + }, + "ClickTag": { + "id": "ClickTag", + "type": "object", + "description": "Creative Click Tag.", + "properties": { + "eventName": { + "type": "string", + "description": "Advertiser event name associated with the click tag. This field is used by ENHANCED_BANNER, ENHANCED_IMAGE, and HTML5_BANNER creatives." + }, + "name": { + "type": "string", + "description": "Parameter name for the specified click tag. For ENHANCED_IMAGE creative assets, this field must match the value of the creative asset's creativeAssetId.name field." + }, + "value": { + "type": "string", + "description": "Parameter value for the specified click tag. This field contains a click-through url." + } + } + }, + "ClickThroughUrl": { + "id": "ClickThroughUrl", + "type": "object", + "description": "Click-through URL", + "properties": { + "customClickThroughUrl": { + "type": "string", + "description": "Custom click-through URL. Applicable if the defaultLandingPage field is set to false and the landingPageId field is left unset." + }, + "defaultLandingPage": { + "type": "boolean", + "description": "Whether the campaign default landing page is used." + }, + "landingPageId": { + "type": "string", + "description": "ID of the landing page for the click-through URL. Applicable if the defaultLandingPage field is set to false.", + "format": "int64" + } + } + }, + "ClickThroughUrlSuffixProperties": { + "id": "ClickThroughUrlSuffixProperties", + "type": "object", + "description": "Click Through URL Suffix settings.", + "properties": { + "clickThroughUrlSuffix": { + "type": "string", + "description": "Click-through URL suffix to apply to all ads in this entity's scope. Must be less than 128 characters long." + }, + "overrideInheritedSuffix": { + "type": "boolean", + "description": "Whether this entity should override the inherited click-through URL suffix with its own defined value." + } + } + }, + "CompanionClickThroughOverride": { + "id": "CompanionClickThroughOverride", + "type": "object", + "description": "Companion Click-through override.", + "properties": { + "clickThroughUrl": { + "$ref": "ClickThroughUrl", + "description": "Click-through URL of this companion click-through override." + }, + "creativeId": { + "type": "string", + "description": "ID of the creative for this companion click-through override.", + "format": "int64" + } + } + }, + "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\"." + } + } + }, + "ConnectionType": { + "id": "ConnectionType", + "type": "object", + "description": "Contains information about an internet connection type that can be targeted by ads. Clients can use the connection type to target mobile vs. broadband users.", + "properties": { + "id": { + "type": "string", + "description": "ID of this connection type.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#connectionType\".", + "default": "dfareporting#connectionType" + }, + "name": { + "type": "string", + "description": "Name of this connection type." + } + } + }, + "ConnectionTypesListResponse": { + "id": "ConnectionTypesListResponse", + "type": "object", + "description": "Connection Type List Response", + "properties": { + "connectionTypes": { + "type": "array", + "description": "Collection of connection types such as broadband and mobile.", + "items": { + "$ref": "ConnectionType" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#connectionTypesListResponse\".", + "default": "dfareporting#connectionTypesListResponse" + } + } + }, + "ContentCategoriesListResponse": { + "id": "ContentCategoriesListResponse", + "type": "object", + "description": "Content Category List Response", + "properties": { + "contentCategories": { + "type": "array", + "description": "Content category collection.", + "items": { + "$ref": "ContentCategory" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#contentCategoriesListResponse\".", + "default": "dfareporting#contentCategoriesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "ContentCategory": { + "id": "ContentCategory", + "type": "object", + "description": "Organizes placements according to the contents of their associated webpages.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this content category. This is a read-only field that can be left blank.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "ID of this content category. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#contentCategory\".", + "default": "dfareporting#contentCategory" + }, + "name": { + "type": "string", + "description": "Name of this content category. This is a required field and must be less than 256 characters long and unique among content categories of the same account." + } + } + }, + "CountriesListResponse": { + "id": "CountriesListResponse", + "type": "object", + "description": "Country List Response", + "properties": { + "countries": { + "type": "array", + "description": "Country collection.", + "items": { + "$ref": "Country" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#countriesListResponse\".", + "default": "dfareporting#countriesListResponse" + } + } + }, + "Country": { + "id": "Country", + "type": "object", + "description": "Contains information about a country that can be targeted by ads.", + "properties": { + "countryCode": { + "type": "string", + "description": "Country code." + }, + "dartId": { + "type": "string", + "description": "DART ID of this country. This is the ID used for targeting and generating reports.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#country\".", + "default": "dfareporting#country" + }, + "name": { + "type": "string", + "description": "Name of this country." + }, + "sslEnabled": { + "type": "boolean", + "description": "Whether ad serving supports secure servers in this country." + } + } + }, + "Creative": { + "id": "Creative", + "type": "object", + "description": "Contains properties of a Creative.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this creative. This field, if left unset, will be auto-generated for both insert and update operations. Applicable to all creative types.", + "format": "int64" + }, + "active": { + "type": "boolean", + "description": "Whether the creative is active. Applicable to all creative types." + }, + "adParameters": { + "type": "string", + "description": "Ad parameters user for VPAID creative. This is a read-only field. Applicable to the following creative types: all VPAID." + }, + "adTagKeys": { + "type": "array", + "description": "Keywords for a Rich Media creative. Keywords let you customize the creative settings of a Rich Media ad running on your site without having to contact the advertiser. You can use keywords to dynamically change the look or functionality of a creative. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "items": { + "type": "string" + } + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this creative. This is a required field. Applicable to all creative types.", + "format": "int64" + }, + "allowScriptAccess": { + "type": "boolean", + "description": "Whether script access is allowed for this creative. This is a read-only and deprecated field which will automatically be set to true on update. Applicable to the following creative types: FLASH_INPAGE." + }, + "archived": { + "type": "boolean", + "description": "Whether the creative is archived. Applicable to all creative types." + }, + "artworkType": { + "type": "string", + "description": "Type of artwork used for the creative. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "enum": [ + "ARTWORK_TYPE_FLASH", + "ARTWORK_TYPE_HTML5", + "ARTWORK_TYPE_MIXED" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "authoringTool": { + "type": "string", + "description": "Authoring tool for HTML5 banner creatives. This is a read-only field. Applicable to the following creative types: HTML5_BANNER.", + "enum": [ + "NINJA", + "SWIFFY" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "auto_advance_images": { + "type": "boolean", + "description": "Whether images are automatically advanced for enhanced image creatives. Applicable to the following creative types: ENHANCED_IMAGE." + }, + "backgroundColor": { + "type": "string", + "description": "The 6-character HTML color code, beginning with #, for the background of the window area where the Flash file is displayed. Default is white. Applicable to the following creative types: FLASH_INPAGE." + }, + "backupImageClickThroughUrl": { + "type": "string", + "description": "Click-through URL for backup image. Applicable to the following creative types: ENHANCED_BANNER, FLASH_INPAGE, and HTML5_BANNER." + }, + "backupImageFeatures": { + "type": "array", + "description": "List of feature dependencies that will cause a backup image to be served if the browser that serves the ad does not support them. Feature dependencies are features that a browser must be able to support in order to render your HTML5 creative asset correctly. This field is initially auto-generated to contain all features detected by DCM for all the assets of this creative and can then be modified by the client. To reset this field, copy over all the creativeAssets' detected features. Applicable to the following creative types: ENHANCED_BANNER and HTML5_BANNER.", + "items": { + "type": "string", + "enum": [ + "APPLICATION_CACHE", + "AUDIO", + "CANVAS", + "CANVAS_TEXT", + "CSS_ANIMATIONS", + "CSS_BACKGROUND_SIZE", + "CSS_BORDER_IMAGE", + "CSS_BORDER_RADIUS", + "CSS_BOX_SHADOW", + "CSS_COLUMNS", + "CSS_FLEX_BOX", + "CSS_FONT_FACE", + "CSS_GENERATED_CONTENT", + "CSS_GRADIENTS", + "CSS_HSLA", + "CSS_MULTIPLE_BGS", + "CSS_OPACITY", + "CSS_REFLECTIONS", + "CSS_RGBA", + "CSS_TEXT_SHADOW", + "CSS_TRANSFORMS", + "CSS_TRANSFORMS3D", + "CSS_TRANSITIONS", + "DRAG_AND_DROP", + "GEO_LOCATION", + "HASH_CHANGE", + "HISTORY", + "INDEXED_DB", + "INLINE_SVG", + "INPUT_ATTR_AUTOCOMPLETE", + "INPUT_ATTR_AUTOFOCUS", + "INPUT_ATTR_LIST", + "INPUT_ATTR_MAX", + "INPUT_ATTR_MIN", + "INPUT_ATTR_MULTIPLE", + "INPUT_ATTR_PATTERN", + "INPUT_ATTR_PLACEHOLDER", + "INPUT_ATTR_REQUIRED", + "INPUT_ATTR_STEP", + "INPUT_TYPE_COLOR", + "INPUT_TYPE_DATE", + "INPUT_TYPE_DATETIME", + "INPUT_TYPE_DATETIME_LOCAL", + "INPUT_TYPE_EMAIL", + "INPUT_TYPE_MONTH", + "INPUT_TYPE_NUMBER", + "INPUT_TYPE_RANGE", + "INPUT_TYPE_SEARCH", + "INPUT_TYPE_TEL", + "INPUT_TYPE_TIME", + "INPUT_TYPE_URL", + "INPUT_TYPE_WEEK", + "LOCAL_STORAGE", + "POST_MESSAGE", + "SESSION_STORAGE", + "SMIL", + "SVG_CLIP_PATHS", + "SVG_FE_IMAGE", + "SVG_FILTERS", + "SVG_HREF", + "TOUCH", + "VIDEO", + "WEBGL", + "WEB_SOCKETS", + "WEB_SQL_DATABASE", + "WEB_WORKERS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "backupImageReportingLabel": { + "type": "string", + "description": "Reporting label used for HTML5 banner backup image. Applicable to the following creative types: ENHANCED_BANNER." + }, + "backupImageTargetWindow": { + "$ref": "TargetWindow", + "description": "Target window for backup image. Applicable to the following creative types: ENHANCED_BANNER, FLASH_INPAGE, and HTML5_BANNER." + }, + "clickTags": { + "type": "array", + "description": "Click tags of the creative. For ENHANCED_BANNER, FLASH_INPAGE, and HTML5_BANNER creatives, this is a subset of detected click tags for the assets associated with this creative. After creating a flash asset, detected click tags will be returned in the creativeAssetMetadata. When inserting the creative, populate the creative clickTags field using the creativeAssetMetadata.clickTags field. For ENHANCED_IMAGE creatives, there should be exactly one entry in this list for each image creative asset. A click tag is matched with a corresponding creative asset by matching the clickTag.name field with the creativeAsset.assetIdentifier.name field. Applicable to the following creative types: ENHANCED_BANNER, ENHANCED_IMAGE, FLASH_INPAGE, HTML5_BANNER.", + "items": { + "$ref": "ClickTag" + } + }, + "commercialId": { + "type": "string", + "description": "Industry standard ID assigned to creative for reach and frequency. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID." + }, + "companionCreatives": { + "type": "array", + "description": "List of companion creatives assigned to an in-Stream videocreative. Acceptable values include IDs of existing flash and image creatives. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID.", + "items": { + "type": "string", + "format": "int64" + } + }, + "compatibility": { + "type": "array", + "description": "Compatibilities associated with this creative. This is a read-only field. WEB and WEB_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard. Applicable to all creative types.\n\nAcceptable values are:\n- \"APP\"\n- \"APP_INTERSTITIAL\"\n- \"IN_STREAM_VIDEO\"\n- \"WEB\"\n- \"WEB_INTERSTITIAL\"", + "items": { + "type": "string", + "enum": [ + "APP", + "APP_INTERSTITIAL", + "IN_STREAM_VIDEO", + "WEB", + "WEB_INTERSTITIAL" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + } + }, + "convertFlashToHtml5": { + "type": "boolean", + "description": "Whether Flash assets associated with the creative need to be automatically converted to HTML5. This flag is enabled by default and users can choose to disable it if they don't want the system to generate and use HTML5 asset for this creative. Applicable to the following creative types: ENHANCED_BANNER and FLASH_INPAGE." + }, + "counterCustomEvents": { + "type": "array", + "description": "List of counter events configured for the creative. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "items": { + "$ref": "CreativeCustomEvent" + } + }, + "creativeAssets": { + "type": "array", + "description": "Assets associated with a creative. Applicable to all but the following creative types: INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and REDIRECT", + "items": { + "$ref": "CreativeAsset" + } + }, + "creativeFieldAssignments": { + "type": "array", + "description": "Creative field assignments for this creative. Applicable to all creative types.", + "items": { + "$ref": "CreativeFieldAssignment" + } + }, + "customKeyValues": { + "type": "array", + "description": "Custom key-values for a Rich Media creative. Key-values let you customize the creative settings of a Rich Media ad running on your site without having to contact the advertiser. You can use key-values to dynamically change the look or functionality of a creative. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "items": { + "type": "string" + } + }, + "exitCustomEvents": { + "type": "array", + "description": "List of exit events configured for the creative. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "items": { + "$ref": "CreativeCustomEvent" + } + }, + "fsCommand": { + "$ref": "FsCommand", + "description": "OpenWindow FSCommand of this creative. This lets the SWF file communicate with either Flash Player or the program hosting Flash Player, such as a web browser. This is only triggered if allowScriptAccess field is true. Applicable to the following creative types: FLASH_INPAGE." + }, + "htmlCode": { + "type": "string", + "description": "HTML code for the creative. This is a required field when applicable. This field is ignored if htmlCodeLocked is false. Applicable to the following creative types: all CUSTOM, FLASH_INPAGE, and HTML5_BANNER, and all RICH_MEDIA." + }, + "htmlCodeLocked": { + "type": "boolean", + "description": "Whether HTML code is DCM-generated or manually entered. Set to true to ignore changes to htmlCode. Applicable to the following creative types: FLASH_INPAGE and HTML5_BANNER." + }, + "id": { + "type": "string", + "description": "ID of this creative. This is a read-only, auto-generated field. Applicable to all creative types.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this creative. This is a read-only field. Applicable to all creative types." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creative\".", + "default": "dfareporting#creative" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Creative last modification information. This is a read-only field. Applicable to all creative types." + }, + "latestTraffickedCreativeId": { + "type": "string", + "description": "Latest Studio trafficked creative ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of the creative. This is a required field and must be less than 256 characters long. Applicable to all creative types." + }, + "overrideCss": { + "type": "string", + "description": "Override CSS value for rich media creatives. Applicable to the following creative types: all RICH_MEDIA." + }, + "redirectUrl": { + "type": "string", + "description": "URL of hosted image or another ad tag. This is a required field when applicable. Applicable to the following creative types: INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and REDIRECT" + }, + "renderingId": { + "type": "string", + "description": "ID of current rendering version. This is a read-only field. Applicable to all creative types.", + "format": "int64" + }, + "renderingIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the rendering ID of this creative. This is a read-only field. Applicable to all creative types." + }, + "requiredFlashPluginVersion": { + "type": "string", + "description": "The minimum required Flash plugin version for this creative. For example, 11.2.202.235. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID." + }, + "requiredFlashVersion": { + "type": "integer", + "description": "The internal Flash version for this creative as calculated by DoubleClick Studio. This is a read-only field. Applicable to the following creative types: FLASH_INPAGE, ENHANCED_BANNER, all RICH_MEDIA, and all VPAID.", + "format": "int32" + }, + "size": { + "$ref": "Size", + "description": "Size associated with this creative. When inserting or updating a creative either the size ID field or size width and height fields can be used. This is a required field when applicable; however for IMAGE and FLASH_INPAGE creatives, if left blank, this field will be automatically set using the actual size of the associated image assets. Applicable to the following creative types: ENHANCED_BANNER, ENHANCED_IMAGE, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all RICH_MEDIA." + }, + "skippable": { + "type": "boolean", + "description": "Whether the user can choose to skip the creative. Applicable to the following creative types: INSTREAM_VIDEO." + }, + "sslCompliant": { + "type": "boolean", + "description": "Whether the creative is SSL-compliant. This is a read-only field. Applicable to all creative types." + }, + "studioAdvertiserId": { + "type": "string", + "description": "Studio advertiser ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "format": "int64" + }, + "studioCreativeId": { + "type": "string", + "description": "Studio creative ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "format": "int64" + }, + "studioTraffickedCreativeId": { + "type": "string", + "description": "Studio trafficked creative ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "format": "int64" + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this creative. This field, if left unset, will be auto-generated for both insert and update operations. Applicable to all creative types.", + "format": "int64" + }, + "thirdPartyBackupImageImpressionsUrl": { + "type": "string", + "description": "Third-party URL used to record backup image impressions. Applicable to the following creative types: all RICH_MEDIA" + }, + "thirdPartyRichMediaImpressionsUrl": { + "type": "string", + "description": "Third-party URL used to record rich media impressions. Applicable to the following creative types: all RICH_MEDIA" + }, + "thirdPartyUrls": { + "type": "array", + "description": "Third-party URLs for tracking in-stream video creative events. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID.", + "items": { + "$ref": "ThirdPartyTrackingUrl" + } + }, + "timerCustomEvents": { + "type": "array", + "description": "List of timer events configured for the creative. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "items": { + "$ref": "CreativeCustomEvent" + } + }, + "totalFileSize": { + "type": "string", + "description": "Combined size of all creative assets. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "Type of this creative.This is a required field. Applicable to all creative types.", + "enum": [ + "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO", + "CUSTOM_INPAGE", + "CUSTOM_INTERSTITIAL", + "ENHANCED_BANNER", + "ENHANCED_IMAGE", + "FLASH_INPAGE", + "HTML5_BANNER", + "IMAGE", + "INSTREAM_VIDEO", + "INTERNAL_REDIRECT", + "INTERSTITIAL_INTERNAL_REDIRECT", + "REDIRECT", + "RICH_MEDIA_EXPANDING", + "RICH_MEDIA_IM_EXPAND", + "RICH_MEDIA_INPAGE", + "RICH_MEDIA_INPAGE_FLOATING", + "RICH_MEDIA_INTERSTITIAL_FLOAT", + "RICH_MEDIA_MOBILE_IN_APP", + "RICH_MEDIA_MULTI_FLOATING", + "RICH_MEDIA_PEEL_DOWN", + "TRACKING_TEXT", + "VAST_REDIRECT", + "VPAID_LINEAR", + "VPAID_NON_LINEAR" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "version": { + "type": "integer", + "description": "The version number helps you keep track of multiple versions of your creative in your reports. The version number will always be auto-generated during insert operations to start at 1. For tracking creatives the version cannot be incremented and will always remain at 1. For all other creative types the version can be incremented only by 1 during update operations. In addition, the version will be automatically incremented by 1 when undergoing Rich Media creative merging. Applicable to all creative types.", + "format": "int32" + }, + "videoDescription": { + "type": "string", + "description": "Description of the video ad. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID." + }, + "videoDuration": { + "type": "number", + "description": "Creative video duration in seconds. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO, all RICH_MEDIA, and all VPAID.", + "format": "float" + } + } + }, + "CreativeAsset": { + "id": "CreativeAsset", + "type": "object", + "description": "Creative Asset.", + "properties": { + "actionScript3": { + "type": "boolean", + "description": "Whether ActionScript3 is enabled for the flash asset. This is a read-only field. Applicable to the following creative types: FLASH_INPAGE and ENHANCED_BANNER." + }, + "active": { + "type": "boolean", + "description": "Whether the video asset is active. This is a read-only field for VPAID_NON_LINEAR assets. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID." + }, + "alignment": { + "type": "string", + "description": "Possible alignments for an asset. This is a read-only field. Applicable to the following creative types: RICH_MEDIA_MULTI_FLOATING.", + "enum": [ + "ALIGNMENT_BOTTOM", + "ALIGNMENT_LEFT", + "ALIGNMENT_RIGHT", + "ALIGNMENT_TOP" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "artworkType": { + "type": "string", + "description": "Artwork type of rich media creative. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA.", + "enum": [ + "ARTWORK_TYPE_FLASH", + "ARTWORK_TYPE_HTML5", + "ARTWORK_TYPE_MIXED" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "assetIdentifier": { + "$ref": "CreativeAssetId", + "description": "Identifier of this asset. This is the same identifier returned during creative asset insert operation. This is a required field. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT." + }, + "backupImageExit": { + "$ref": "CreativeCustomEvent", + "description": "Exit event configured for the backup image. Applicable to the following creative types: all RICH_MEDIA." + }, + "bitRate": { + "type": "integer", + "description": "Detected bit-rate for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID.", + "format": "int32" + }, + "childAssetType": { + "type": "string", + "description": "Rich media child asset type. This is a read-only field. Applicable to the following creative types: all VPAID.", + "enum": [ + "CHILD_ASSET_TYPE_DATA", + "CHILD_ASSET_TYPE_FLASH", + "CHILD_ASSET_TYPE_IMAGE", + "CHILD_ASSET_TYPE_VIDEO" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "collapsedSize": { + "$ref": "Size", + "description": "Size of an asset when collapsed. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA and all VPAID. Additionally, applicable to assets whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN." + }, + "customStartTimeValue": { + "type": "integer", + "description": "Custom start time in seconds for making the asset visible. Applicable to the following creative types: all RICH_MEDIA.", + "format": "int32" + }, + "detectedFeatures": { + "type": "array", + "description": "List of feature dependencies for the creative asset that are detected by DCM. Feature dependencies are features that a browser must be able to support in order to render your HTML5 creative correctly. This is a read-only, auto-generated field. Applicable to the following creative types: ENHANCED_BANNER and HTML5_BANNER.", + "items": { + "type": "string", + "enum": [ + "APPLICATION_CACHE", + "AUDIO", + "CANVAS", + "CANVAS_TEXT", + "CSS_ANIMATIONS", + "CSS_BACKGROUND_SIZE", + "CSS_BORDER_IMAGE", + "CSS_BORDER_RADIUS", + "CSS_BOX_SHADOW", + "CSS_COLUMNS", + "CSS_FLEX_BOX", + "CSS_FONT_FACE", + "CSS_GENERATED_CONTENT", + "CSS_GRADIENTS", + "CSS_HSLA", + "CSS_MULTIPLE_BGS", + "CSS_OPACITY", + "CSS_REFLECTIONS", + "CSS_RGBA", + "CSS_TEXT_SHADOW", + "CSS_TRANSFORMS", + "CSS_TRANSFORMS3D", + "CSS_TRANSITIONS", + "DRAG_AND_DROP", + "GEO_LOCATION", + "HASH_CHANGE", + "HISTORY", + "INDEXED_DB", + "INLINE_SVG", + "INPUT_ATTR_AUTOCOMPLETE", + "INPUT_ATTR_AUTOFOCUS", + "INPUT_ATTR_LIST", + "INPUT_ATTR_MAX", + "INPUT_ATTR_MIN", + "INPUT_ATTR_MULTIPLE", + "INPUT_ATTR_PATTERN", + "INPUT_ATTR_PLACEHOLDER", + "INPUT_ATTR_REQUIRED", + "INPUT_ATTR_STEP", + "INPUT_TYPE_COLOR", + "INPUT_TYPE_DATE", + "INPUT_TYPE_DATETIME", + "INPUT_TYPE_DATETIME_LOCAL", + "INPUT_TYPE_EMAIL", + "INPUT_TYPE_MONTH", + "INPUT_TYPE_NUMBER", + "INPUT_TYPE_RANGE", + "INPUT_TYPE_SEARCH", + "INPUT_TYPE_TEL", + "INPUT_TYPE_TIME", + "INPUT_TYPE_URL", + "INPUT_TYPE_WEEK", + "LOCAL_STORAGE", + "POST_MESSAGE", + "SESSION_STORAGE", + "SMIL", + "SVG_CLIP_PATHS", + "SVG_FE_IMAGE", + "SVG_FILTERS", + "SVG_HREF", + "TOUCH", + "VIDEO", + "WEBGL", + "WEB_SOCKETS", + "WEB_SQL_DATABASE", + "WEB_WORKERS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "displayType": { + "type": "string", + "description": "Type of rich media asset. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA.", + "enum": [ + "ASSET_DISPLAY_TYPE_EXPANDING", + "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH", + "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH_EXPANDING", + "ASSET_DISPLAY_TYPE_FLOATING", + "ASSET_DISPLAY_TYPE_INPAGE", + "ASSET_DISPLAY_TYPE_OVERLAY", + "ASSET_DISPLAY_TYPE_PEEL_DOWN", + "ASSET_DISPLAY_TYPE_VPAID_LINEAR", + "ASSET_DISPLAY_TYPE_VPAID_NON_LINEAR" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "duration": { + "type": "integer", + "description": "Duration in seconds for which an asset will be displayed. Applicable to the following creative types: INSTREAM_VIDEO and VPAID_LINEAR.", + "format": "int32" + }, + "durationType": { + "type": "string", + "description": "Duration type for which an asset will be displayed. Applicable to the following creative types: all RICH_MEDIA.", + "enum": [ + "ASSET_DURATION_TYPE_AUTO", + "ASSET_DURATION_TYPE_CUSTOM", + "ASSET_DURATION_TYPE_NONE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "expandedDimension": { + "$ref": "Size", + "description": "Detected expanded dimension for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID." + }, + "fileSize": { + "type": "string", + "description": "File size associated with this creative asset. This is a read-only field. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT.", + "format": "int64" + }, + "flashVersion": { + "type": "integer", + "description": "Flash version of the asset. This is a read-only field. Applicable to the following creative types: FLASH_INPAGE, ENHANCED_BANNER, all RICH_MEDIA, and all VPAID.", + "format": "int32" + }, + "hideFlashObjects": { + "type": "boolean", + "description": "Whether to hide Flash objects flag for an asset. Applicable to the following creative types: all RICH_MEDIA." + }, + "hideSelectionBoxes": { + "type": "boolean", + "description": "Whether to hide selection boxes flag for an asset. Applicable to the following creative types: all RICH_MEDIA." + }, + "horizontallyLocked": { + "type": "boolean", + "description": "Whether the asset is horizontally locked. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA." + }, + "id": { + "type": "string", + "description": "Numeric ID of this creative asset. This is a required field and should not be modified. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT.", + "format": "int64" + }, + "mimeType": { + "type": "string", + "description": "Detected MIME type for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID." + }, + "offset": { + "$ref": "OffsetPosition", + "description": "Offset position for an asset in collapsed mode. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA and all VPAID. Additionally, only applicable to assets whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN." + }, + "originalBackup": { + "type": "boolean", + "description": "Whether the backup asset is original or changed by the user in DCM. Applicable to the following creative types: all RICH_MEDIA." + }, + "position": { + "$ref": "OffsetPosition", + "description": "Offset position for an asset. Applicable to the following creative types: all RICH_MEDIA." + }, + "positionLeftUnit": { + "type": "string", + "description": "Offset left unit for an asset. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA.", + "enum": [ + "OFFSET_UNIT_PERCENT", + "OFFSET_UNIT_PIXEL", + "OFFSET_UNIT_PIXEL_FROM_CENTER" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "positionTopUnit": { + "type": "string", + "description": "Offset top unit for an asset. This is a read-only field if the asset displayType is ASSET_DISPLAY_TYPE_OVERLAY. Applicable to the following creative types: all RICH_MEDIA.", + "enum": [ + "OFFSET_UNIT_PERCENT", + "OFFSET_UNIT_PIXEL", + "OFFSET_UNIT_PIXEL_FROM_CENTER" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "progressiveServingUrl": { + "type": "string", + "description": "Progressive URL for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID." + }, + "pushdown": { + "type": "boolean", + "description": "Whether the asset pushes down other content. Applicable to the following creative types: all RICH_MEDIA. Additionally, only applicable when the asset offsets are 0, the collapsedSize.width matches size.width, and the collapsedSize.height is less than size.height." + }, + "pushdownDuration": { + "type": "number", + "description": "Pushdown duration in seconds for an asset. Must be between 0 and 9.99. Applicable to the following creative types: all RICH_MEDIA.Additionally, only applicable when the asset pushdown field is true, the offsets are 0, the collapsedSize.width matches size.width, and the collapsedSize.height is less than size.height.", + "format": "float" + }, + "role": { + "type": "string", + "description": "Role of the asset in relation to creative. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT. This is a required field.\nPRIMARY applies to ENHANCED_BANNER, FLASH_INPAGE, HTML5_BANNER, IMAGE, IMAGE_GALLERY, all RICH_MEDIA (which may contain multiple primary assets), and all VPAID creatives.\nBACKUP_IMAGE applies to ENHANCED_BANNER, FLASH_INPAGE, HTML5_BANNER, all RICH_MEDIA, and all VPAID creatives.\nADDITIONAL_IMAGE and ADDITIONAL_FLASH apply to FLASH_INPAGE creatives.\nOTHER refers to assets from sources other than DCM, such as Studio uploaded assets, applicable to all RICH_MEDIA and all VPAID creatives.\nPARENT_VIDEO refers to videos uploaded by the user in DCM and is applicable to INSTREAM_VIDEO and VPAID_LINEAR creatives.\nTRANSCODED_VIDEO refers to videos transcoded by DCM from PARENT_VIDEO assets and is applicable to INSTREAM_VIDEO and VPAID_LINEAR creatives.\nALTERNATE_VIDEO refers to the DCM representation of child asset videos from Studio, and is applicable to VPAID_LINEAR creatives. These cannot be added or removed within DCM.\nFor VPAID_LINEAR creatives, PARENT_VIDEO, TRANSCODED_VIDEO and ALTERNATE_VIDEO assets that are marked active serve as backup in case the VPAID creative cannot be served. Only PARENT_VIDEO assets can be added or removed for an INSTREAM_VIDEO or VPAID_LINEAR creative.", + "enum": [ + "ADDITIONAL_FLASH", + "ADDITIONAL_IMAGE", + "ALTERNATE_VIDEO", + "BACKUP_IMAGE", + "OTHER", + "PARENT_VIDEO", + "PRIMARY", + "TRANSCODED_VIDEO" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "size": { + "$ref": "Size", + "description": "Size associated with this creative asset. This is a required field when applicable; however for IMAGE and FLASH_INPAGE creatives, if left blank, this field will be automatically set using the actual size of the associated image asset. Applicable to the following creative types: ENHANCED_BANNER, ENHANCED_IMAGE, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all RICH_MEDIA." + }, + "sslCompliant": { + "type": "boolean", + "description": "Whether the asset is SSL-compliant. This is a read-only field. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT." + }, + "startTimeType": { + "type": "string", + "description": "Initial wait time type before making the asset visible. Applicable to the following creative types: all RICH_MEDIA.", + "enum": [ + "ASSET_START_TIME_TYPE_CUSTOM", + "ASSET_START_TIME_TYPE_NONE" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "streamingServingUrl": { + "type": "string", + "description": "Streaming URL for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID." + }, + "transparency": { + "type": "boolean", + "description": "Whether the asset is transparent. Applicable to the following creative types: all RICH_MEDIA. Additionally, only applicable to HTML5 assets." + }, + "verticallyLocked": { + "type": "boolean", + "description": "Whether the asset is vertically locked. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA." + }, + "videoDuration": { + "type": "number", + "description": "Detected video duration for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID.", + "format": "float" + }, + "windowMode": { + "type": "string", + "description": "Window mode options for flash assets. Applicable to the following creative types: FLASH_INPAGE, RICH_MEDIA_EXPANDING, RICH_MEDIA_IM_EXPAND, RICH_MEDIA_INPAGE, and RICH_MEDIA_INPAGE_FLOATING.", + "enum": [ + "OPAQUE", + "TRANSPARENT", + "WINDOW" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "zIndex": { + "type": "integer", + "description": "zIndex value of an asset. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA.Additionally, only applicable to assets whose displayType is NOT one of the following types: ASSET_DISPLAY_TYPE_INPAGE or ASSET_DISPLAY_TYPE_OVERLAY.", + "format": "int32" + }, + "zipFilename": { + "type": "string", + "description": "File name of zip file. This is a read-only field. Applicable to the following creative types: HTML5_BANNER." + }, + "zipFilesize": { + "type": "string", + "description": "Size of zip file. This is a read-only field. Applicable to the following creative types: HTML5_BANNER." + } + } + }, + "CreativeAssetId": { + "id": "CreativeAssetId", + "type": "object", + "description": "Creative Asset ID.", + "properties": { + "name": { + "type": "string", + "description": "Name of the creative asset. This is a required field while inserting an asset. After insertion, this assetIdentifier is used to identify the uploaded asset. Characters in the name must be alphanumeric or one of the following: \".-_ \". Spaces are allowed." + }, + "type": { + "type": "string", + "description": "Type of asset to upload. This is a required field. IMAGE is solely used for IMAGE creatives. Other image assets should use HTML_IMAGE.", + "enum": [ + "FLASH", + "HTML", + "HTML_IMAGE", + "IMAGE", + "VIDEO" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + } + } + }, + "CreativeAssetMetadata": { + "id": "CreativeAssetMetadata", + "type": "object", + "description": "CreativeAssets contains properties of a creative asset file which will be uploaded or has already been uploaded. Refer to the creative sample code for how to upload assets and insert a creative.", + "properties": { + "assetIdentifier": { + "$ref": "CreativeAssetId", + "description": "ID of the creative asset. This is a required field." + }, + "clickTags": { + "type": "array", + "description": "List of detected click tags for assets. This is a read-only auto-generated field.", + "items": { + "$ref": "ClickTag" + } + }, + "detectedFeatures": { + "type": "array", + "description": "List of feature dependencies for the creative asset that are detected by DCM. Feature dependencies are features that a browser must be able to support in order to render your HTML5 creative correctly. This is a read-only, auto-generated field.", + "items": { + "type": "string", + "enum": [ + "APPLICATION_CACHE", + "AUDIO", + "CANVAS", + "CANVAS_TEXT", + "CSS_ANIMATIONS", + "CSS_BACKGROUND_SIZE", + "CSS_BORDER_IMAGE", + "CSS_BORDER_RADIUS", + "CSS_BOX_SHADOW", + "CSS_COLUMNS", + "CSS_FLEX_BOX", + "CSS_FONT_FACE", + "CSS_GENERATED_CONTENT", + "CSS_GRADIENTS", + "CSS_HSLA", + "CSS_MULTIPLE_BGS", + "CSS_OPACITY", + "CSS_REFLECTIONS", + "CSS_RGBA", + "CSS_TEXT_SHADOW", + "CSS_TRANSFORMS", + "CSS_TRANSFORMS3D", + "CSS_TRANSITIONS", + "DRAG_AND_DROP", + "GEO_LOCATION", + "HASH_CHANGE", + "HISTORY", + "INDEXED_DB", + "INLINE_SVG", + "INPUT_ATTR_AUTOCOMPLETE", + "INPUT_ATTR_AUTOFOCUS", + "INPUT_ATTR_LIST", + "INPUT_ATTR_MAX", + "INPUT_ATTR_MIN", + "INPUT_ATTR_MULTIPLE", + "INPUT_ATTR_PATTERN", + "INPUT_ATTR_PLACEHOLDER", + "INPUT_ATTR_REQUIRED", + "INPUT_ATTR_STEP", + "INPUT_TYPE_COLOR", + "INPUT_TYPE_DATE", + "INPUT_TYPE_DATETIME", + "INPUT_TYPE_DATETIME_LOCAL", + "INPUT_TYPE_EMAIL", + "INPUT_TYPE_MONTH", + "INPUT_TYPE_NUMBER", + "INPUT_TYPE_RANGE", + "INPUT_TYPE_SEARCH", + "INPUT_TYPE_TEL", + "INPUT_TYPE_TIME", + "INPUT_TYPE_URL", + "INPUT_TYPE_WEEK", + "LOCAL_STORAGE", + "POST_MESSAGE", + "SESSION_STORAGE", + "SMIL", + "SVG_CLIP_PATHS", + "SVG_FE_IMAGE", + "SVG_FILTERS", + "SVG_HREF", + "TOUCH", + "VIDEO", + "WEBGL", + "WEB_SOCKETS", + "WEB_SQL_DATABASE", + "WEB_WORKERS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeAssetMetadata\".", + "default": "dfareporting#creativeAssetMetadata" + }, + "warnedValidationRules": { + "type": "array", + "description": "Rules validated during code generation that generated a warning. This is a read-only, auto-generated field.\n\nPossible values are:\n- \"CLICK_TAG_NON_TOP_LEVEL\"\n- \"CLICK_TAG_MISSING\"\n- \"CLICK_TAG_MORE_THAN_ONE\"\n- \"CLICK_TAG_INVALID\"\n- \"ORPHANED_ASSET\"\n- \"PRIMARY_HTML_MISSING\"\n- \"EXTERNAL_FILE_REFERENCED\"\n- \"MRAID_REFERENCED\"\n- \"ADMOB_REFERENCED\"\n- \"FILE_TYPE_INVALID\"\n- \"ZIP_INVALID\"\n- \"LINKED_FILE_NOT_FOUND\"\n- \"MAX_FLASH_VERSION_11\"\n- \"NOT_SSL_COMPLIANT\"\n- \"FILE_DETAIL_EMPTY\"\n- \"ASSET_INVALID\"\n- \"GWD_PROPERTIES_INVALID\"\n- \"ENABLER_UNSUPPORTED_METHOD_DCM\"\n- \"ASSET_FORMAT_UNSUPPORTED_DCM\"\n- \"COMPONENT_UNSUPPORTED_DCM\"\n- \"HTML5_FEATURE_UNSUPPORTED' \"", + "items": { + "type": "string", + "enum": [ + "ADMOB_REFERENCED", + "ASSET_FORMAT_UNSUPPORTED_DCM", + "ASSET_INVALID", + "CLICK_TAG_INVALID", + "CLICK_TAG_MISSING", + "CLICK_TAG_MORE_THAN_ONE", + "CLICK_TAG_NON_TOP_LEVEL", + "COMPONENT_UNSUPPORTED_DCM", + "ENABLER_UNSUPPORTED_METHOD_DCM", + "EXTERNAL_FILE_REFERENCED", + "FILE_DETAIL_EMPTY", + "FILE_TYPE_INVALID", + "GWD_PROPERTIES_INVALID", + "HTML5_FEATURE_UNSUPPORTED", + "LINKED_FILE_NOT_FOUND", + "MAX_FLASH_VERSION_11", + "MRAID_REFERENCED", + "NOT_SSL_COMPLIANT", + "ORPHANED_ASSET", + "PRIMARY_HTML_MISSING", + "ZIP_INVALID" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + } + }, + "CreativeAssignment": { + "id": "CreativeAssignment", + "type": "object", + "description": "Creative Assignment.", + "properties": { + "active": { + "type": "boolean", + "description": "Whether this creative assignment is active. When true, the creative will be included in the ad's rotation." + }, + "applyEventTags": { + "type": "boolean", + "description": "Whether applicable event tags should fire when this creative assignment is rendered. If this value is unset when the ad is inserted or updated, it will default to true for all creative types EXCEPT for INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and INSTREAM_VIDEO." + }, + "clickThroughUrl": { + "$ref": "ClickThroughUrl", + "description": "Click-through URL of the creative assignment." + }, + "companionCreativeOverrides": { + "type": "array", + "description": "Companion creative overrides for this creative assignment. Applicable to video ads.", + "items": { + "$ref": "CompanionClickThroughOverride" + } + }, + "creativeGroupAssignments": { + "type": "array", + "description": "Creative group assignments for this creative assignment. Only one assignment per creative group number is allowed for a maximum of two assignments.", + "items": { + "$ref": "CreativeGroupAssignment" + } + }, + "creativeId": { + "type": "string", + "description": "ID of the creative to be assigned. This is a required field.", + "format": "int64" + }, + "creativeIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the creative. This is a read-only, auto-generated field." + }, + "endTime": { + "type": "string", + "description": "Date and time that the assigned creative should stop serving. Must be later than the start time.", + "format": "date-time" + }, + "richMediaExitOverrides": { + "type": "array", + "description": "Rich media exit overrides for this creative assignment.\nApplicable when the creative type is any of the following: \n- RICH_MEDIA_INPAGE\n- RICH_MEDIA_INPAGE_FLOATING\n- RICH_MEDIA_IM_EXPAND\n- RICH_MEDIA_EXPANDING\n- RICH_MEDIA_INTERSTITIAL_FLOAT\n- RICH_MEDIA_MOBILE_IN_APP\n- RICH_MEDIA_MULTI_FLOATING\n- RICH_MEDIA_PEEL_DOWN\n- ADVANCED_BANNER\n- VPAID_LINEAR\n- VPAID_NON_LINEAR", + "items": { + "$ref": "RichMediaExitOverride" + } + }, + "sequence": { + "type": "integer", + "description": "Sequence number of the creative assignment, applicable when the rotation type is CREATIVE_ROTATION_TYPE_SEQUENTIAL.", + "format": "int32" + }, + "sslCompliant": { + "type": "boolean", + "description": "Whether the creative to be assigned is SSL-compliant. This is a read-only field that is auto-generated when the ad is inserted or updated." + }, + "startTime": { + "type": "string", + "description": "Date and time that the assigned creative should start serving.", + "format": "date-time" + }, + "weight": { + "type": "integer", + "description": "Weight of the creative assignment, applicable when the rotation type is CREATIVE_ROTATION_TYPE_RANDOM.", + "format": "int32" + } + } + }, + "CreativeCustomEvent": { + "id": "CreativeCustomEvent", + "type": "object", + "description": "Creative Custom Event.", + "properties": { + "active": { + "type": "boolean", + "description": "Whether the event is active." + }, + "advertiserCustomEventName": { + "type": "string", + "description": "User-entered name for the event." + }, + "advertiserCustomEventType": { + "type": "string", + "description": "Type of the event. This is a read-only field.", + "enum": [ + "ADVERTISER_EVENT_COUNTER", + "ADVERTISER_EVENT_EXIT", + "ADVERTISER_EVENT_TIMER" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "artworkLabel": { + "type": "string", + "description": "Artwork label column, used to link events in DCM back to events in Studio. This is a required field and should not be modified after insertion." + }, + "artworkType": { + "type": "string", + "description": "Artwork type used by the creative.This is a read-only field.", + "enum": [ + "ARTWORK_TYPE_FLASH", + "ARTWORK_TYPE_HTML5", + "ARTWORK_TYPE_MIXED" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "exitUrl": { + "type": "string", + "description": "Exit URL of the event. This field is used only for exit events." + }, + "id": { + "type": "string", + "description": "ID of this event. This is a required field and should not be modified after insertion.", + "format": "int64" + }, + "popupWindowProperties": { + "$ref": "PopupWindowProperties", + "description": "Properties for rich media popup windows. This field is used only for exit events." + }, + "targetType": { + "type": "string", + "description": "Target type used by the event.", + "enum": [ + "TARGET_BLANK", + "TARGET_PARENT", + "TARGET_POPUP", + "TARGET_SELF", + "TARGET_TOP" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "videoReportingId": { + "type": "string", + "description": "Reporting ID, used to differentiate multiple videos in a single creative." + } + } + }, + "CreativeField": { + "id": "CreativeField", + "type": "object", + "description": "Contains properties of a creative field.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this creative field. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this creative field. This is a required field on insertion.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "id": { + "type": "string", + "description": "ID of this creative field. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeField\".", + "default": "dfareporting#creativeField" + }, + "name": { + "type": "string", + "description": "Name of this creative field. This is a required field and must be less than 256 characters long and unique among creative fields of the same advertiser." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this creative field. This is a read-only field that can be left blank.", + "format": "int64" + } + } + }, + "CreativeFieldAssignment": { + "id": "CreativeFieldAssignment", + "type": "object", + "description": "Creative Field Assignment.", + "properties": { + "creativeFieldId": { + "type": "string", + "description": "ID of the creative field.", + "format": "int64" + }, + "creativeFieldValueId": { + "type": "string", + "description": "ID of the creative field value.", + "format": "int64" + } + } + }, + "CreativeFieldValue": { + "id": "CreativeFieldValue", + "type": "object", + "description": "Contains properties of a creative field value.", + "properties": { + "id": { + "type": "string", + "description": "ID of this creative field value. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeFieldValue\".", + "default": "dfareporting#creativeFieldValue" + }, + "value": { + "type": "string", + "description": "Value of this creative field value. It needs to be less than 256 characters in length and unique per creative field." + } + } + }, + "CreativeFieldValuesListResponse": { + "id": "CreativeFieldValuesListResponse", + "type": "object", + "description": "Creative Field Value List Response", + "properties": { + "creativeFieldValues": { + "type": "array", + "description": "Creative field value collection.", + "items": { + "$ref": "CreativeFieldValue" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeFieldValuesListResponse\".", + "default": "dfareporting#creativeFieldValuesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "CreativeFieldsListResponse": { + "id": "CreativeFieldsListResponse", + "type": "object", + "description": "Creative Field List Response", + "properties": { + "creativeFields": { + "type": "array", + "description": "Creative field collection.", + "items": { + "$ref": "CreativeField" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeFieldsListResponse\".", + "default": "dfareporting#creativeFieldsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "CreativeGroup": { + "id": "CreativeGroup", + "type": "object", + "description": "Contains properties of a creative group.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this creative group. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this creative group. This is a required field on insertion.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "groupNumber": { + "type": "integer", + "description": "Subgroup of the creative group. Assign your creative groups to one of the following subgroups in order to filter or manage them more easily. This field is required on insertion and is read-only after insertion.\nAcceptable values are: \n- 1\n- 2", + "format": "int32" + }, + "id": { + "type": "string", + "description": "ID of this creative group. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeGroup\".", + "default": "dfareporting#creativeGroup" + }, + "name": { + "type": "string", + "description": "Name of this creative group. This is a required field and must be less than 256 characters long and unique among creative groups of the same advertiser." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this creative group. This is a read-only field that can be left blank.", + "format": "int64" + } + } + }, + "CreativeGroupAssignment": { + "id": "CreativeGroupAssignment", + "type": "object", + "description": "Creative Group Assignment.", + "properties": { + "creativeGroupId": { + "type": "string", + "description": "ID of the creative group to be assigned.", + "format": "int64" + }, + "creativeGroupNumber": { + "type": "string", + "description": "Creative group number of the creative group assignment.", + "enum": [ + "CREATIVE_GROUP_ONE", + "CREATIVE_GROUP_TWO" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "CreativeGroupsListResponse": { + "id": "CreativeGroupsListResponse", + "type": "object", + "description": "Creative Group List Response", + "properties": { + "creativeGroups": { + "type": "array", + "description": "Creative group collection.", + "items": { + "$ref": "CreativeGroup" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeGroupsListResponse\".", + "default": "dfareporting#creativeGroupsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "CreativeOptimizationConfiguration": { + "id": "CreativeOptimizationConfiguration", + "type": "object", + "description": "Creative optimization settings.", + "properties": { + "id": { + "type": "string", + "description": "ID of this creative optimization config. This field is auto-generated when the campaign is inserted or updated. It can be null for existing campaigns.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this creative optimization config. This is a required field and must be less than 129 characters long." + }, + "optimizationActivitys": { + "type": "array", + "description": "List of optimization activities associated with this configuration.", + "items": { + "$ref": "OptimizationActivity" + } + }, + "optimizationModel": { + "type": "string", + "description": "Optimization model for this configuration.", + "enum": [ + "CLICK", + "POST_CLICK", + "POST_CLICK_AND_IMPRESSION", + "POST_IMPRESSION" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "CreativeRotation": { + "id": "CreativeRotation", + "type": "object", + "description": "Creative Rotation.", + "properties": { + "creativeAssignments": { + "type": "array", + "description": "Creative assignments in this creative rotation.", + "items": { + "$ref": "CreativeAssignment" + } + }, + "creativeOptimizationConfigurationId": { + "type": "string", + "description": "Creative optimization configuration that is used by this ad. It should refer to one of the existing optimization configurations in the ad's campaign. If it is unset or set to 0, then the campaign's default optimization configuration will be used for this ad.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "Type of creative rotation. Can be used to specify whether to use sequential or random rotation.", + "enum": [ + "CREATIVE_ROTATION_TYPE_RANDOM", + "CREATIVE_ROTATION_TYPE_SEQUENTIAL" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "weightCalculationStrategy": { + "type": "string", + "description": "Strategy for calculating weights. Used with CREATIVE_ROTATION_TYPE_RANDOM.", + "enum": [ + "WEIGHT_STRATEGY_CUSTOM", + "WEIGHT_STRATEGY_EQUAL", + "WEIGHT_STRATEGY_HIGHEST_CTR", + "WEIGHT_STRATEGY_OPTIMIZED" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "CreativeSettings": { + "id": "CreativeSettings", + "type": "object", + "description": "Creative Settings", + "properties": { + "iFrameFooter": { + "type": "string", + "description": "Header text for iFrames for this site. Must be less than or equal to 2000 characters long." + }, + "iFrameHeader": { + "type": "string", + "description": "Header text for iFrames for this site. Must be less than or equal to 2000 characters long." + } + } + }, + "CreativesListResponse": { + "id": "CreativesListResponse", + "type": "object", + "description": "Creative List Response", + "properties": { + "creatives": { + "type": "array", + "description": "Creative collection.", + "items": { + "$ref": "Creative" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativesListResponse\".", + "default": "dfareporting#creativesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "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.", + "enum": [ + "LAST_24_MONTHS", + "LAST_30_DAYS", + "LAST_365_DAYS", + "LAST_7_DAYS", + "LAST_90_DAYS", + "MONTH_TO_DATE", + "PREVIOUS_MONTH", + "PREVIOUS_QUARTER", + "PREVIOUS_WEEK", + "PREVIOUS_YEAR", + "QUARTER_TO_DATE", + "TODAY", + "WEEK_TO_DATE", + "YEAR_TO_DATE", + "YESTERDAY" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "startDate": { + "type": "string", + "description": "The start date of the date range, inclusive. A string of the format: \"yyyy-MM-dd\".", + "format": "date" + } + } + }, + "DayPartTargeting": { + "id": "DayPartTargeting", + "type": "object", + "description": "Day Part Targeting.", + "properties": { + "daysOfWeek": { + "type": "array", + "description": "Days of the week when the ad will serve.\n\nAcceptable values are:\n- \"SUNDAY\"\n- \"MONDAY\"\n- \"TUESDAY\"\n- \"WEDNESDAY\"\n- \"THURSDAY\"\n- \"FRIDAY\"\n- \"SATURDAY\"", + "items": { + "type": "string", + "enum": [ + "FRIDAY", + "MONDAY", + "SATURDAY", + "SUNDAY", + "THURSDAY", + "TUESDAY", + "WEDNESDAY" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "hoursOfDay": { + "type": "array", + "description": "Hours of the day when the ad will serve. Must be an integer between 0 and 23 (inclusive), where 0 is midnight to 1 AM, and 23 is 11 PM to midnight. Can be specified with days of week, in which case the ad would serve during these hours on the specified days. For example, if Monday, Wednesday, Friday are the days of week specified and 9-10am, 3-5pm (hours 9, 15, and 16) is specified, the ad would serve Monday, Wednesdays, and Fridays at 9-10am and 3-5pm.", + "items": { + "type": "integer", + "format": "int32" + } + }, + "userLocalTime": { + "type": "boolean", + "description": "Whether or not to use the user's local time. If false, the America/New York time zone applies." + } + } + }, + "DefaultClickThroughEventTagProperties": { + "id": "DefaultClickThroughEventTagProperties", + "type": "object", + "description": "Properties of inheriting and overriding the default click-through event tag. A campaign may override the event tag defined at the advertiser level, and an ad may also override the campaign's setting further.", + "properties": { + "defaultClickThroughEventTagId": { + "type": "string", + "description": "ID of the click-through event tag to apply to all ads in this entity's scope.", + "format": "int64" + }, + "overrideInheritedEventTag": { + "type": "boolean", + "description": "Whether this entity should override the inherited default click-through event tag with its own defined value." + } + } + }, + "DeliverySchedule": { + "id": "DeliverySchedule", + "type": "object", + "description": "Delivery Schedule.", + "properties": { + "frequencyCap": { + "$ref": "FrequencyCap", + "description": "Limit on the number of times an individual user can be served the ad within a specified period of time." + }, + "hardCutoff": { + "type": "boolean", + "description": "Whether or not hard cutoff is enabled. If true, the ad will not serve after the end date and time. Otherwise the ad will continue to be served until it has reached its delivery goals." + }, + "impressionRatio": { + "type": "string", + "description": "Impression ratio for this ad. This ratio determines how often each ad is served relative to the others. For example, if ad A has an impression ratio of 1 and ad B has an impression ratio of 3, then DCM will serve ad B three times as often as ad A. Must be between 1 and 10.", + "format": "int64" + }, + "priority": { + "type": "string", + "description": "Serving priority of an ad, with respect to other ads. The lower the priority number, the greater the priority with which it is served.", + "enum": [ + "AD_PRIORITY_01", + "AD_PRIORITY_02", + "AD_PRIORITY_03", + "AD_PRIORITY_04", + "AD_PRIORITY_05", + "AD_PRIORITY_06", + "AD_PRIORITY_07", + "AD_PRIORITY_08", + "AD_PRIORITY_09", + "AD_PRIORITY_10", + "AD_PRIORITY_11", + "AD_PRIORITY_12", + "AD_PRIORITY_13", + "AD_PRIORITY_14", + "AD_PRIORITY_15", + "AD_PRIORITY_16" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "DfpSettings": { + "id": "DfpSettings", + "type": "object", + "description": "DFP Settings", + "properties": { + "dfp_network_code": { + "type": "string", + "description": "DFP network code for this directory site." + }, + "dfp_network_name": { + "type": "string", + "description": "DFP network name for this directory site." + }, + "programmaticPlacementAccepted": { + "type": "boolean", + "description": "Whether this directory site accepts programmatic placements." + }, + "pubPaidPlacementAccepted": { + "type": "boolean", + "description": "Whether this directory site accepts publisher-paid tags." + }, + "publisherPortalOnly": { + "type": "boolean", + "description": "Whether this directory site is available only via DoubleClick Publisher Portal." + } + } + }, + "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. If not specified, defaults to EXACT. If set to WILDCARD_EXPRESSION, '*' is allowed as a placeholder for variable length character sequences, and it can be escaped with a backslash. Note, only paid search dimensions ('dfa:paidSearch*') allow a matchType other than EXACT.", + "enum": [ + "BEGINS_WITH", + "CONTAINS", + "EXACT", + "WILDCARD_EXPRESSION" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "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" + ] + } + } + } + }, + "DirectorySite": { + "id": "DirectorySite", + "type": "object", + "description": "DirectorySites contains properties of a website from the Site Directory. Sites need to be added to an account via the Sites resource before they can be assigned to a placement.", + "properties": { + "active": { + "type": "boolean", + "description": "Whether this directory site is active." + }, + "contactAssignments": { + "type": "array", + "description": "Directory site contacts.", + "items": { + "$ref": "DirectorySiteContactAssignment" + } + }, + "countryId": { + "type": "string", + "description": "Country ID of this directory site.", + "format": "int64" + }, + "currencyId": { + "type": "string", + "description": "Currency ID of this directory site.\nPossible values are: \n- \"1\" for USD \n- \"2\" for GBP \n- \"3\" for ESP \n- \"4\" for SEK \n- \"5\" for CAD \n- \"6\" for JPY \n- \"7\" for DEM \n- \"8\" for AUD \n- \"9\" for FRF \n- \"10\" for ITL \n- \"11\" for DKK \n- \"12\" for NOK \n- \"13\" for FIM \n- \"14\" for ZAR \n- \"15\" for IEP \n- \"16\" for NLG \n- \"17\" for EUR \n- \"18\" for KRW \n- \"19\" for TWD \n- \"20\" for SGD \n- \"21\" for CNY \n- \"22\" for HKD \n- \"23\" for NZD \n- \"24\" for MYR \n- \"25\" for BRL \n- \"26\" for PTE \n- \"27\" for MXP \n- \"28\" for CLP \n- \"29\" for TRY \n- \"30\" for ARS \n- \"31\" for PEN \n- \"32\" for ILS \n- \"33\" for CHF \n- \"34\" for VEF \n- \"35\" for COP \n- \"36\" for GTQ", + "format": "int64" + }, + "description": { + "type": "string", + "description": "Description of this directory site." + }, + "id": { + "type": "string", + "description": "ID of this directory site. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this directory site. This is a read-only, auto-generated field." + }, + "inpageTagFormats": { + "type": "array", + "description": "Tag types for regular placements.\n\nAcceptable values are:\n- \"STANDARD\"\n- \"IFRAME_JAVASCRIPT_INPAGE\"\n- \"INTERNAL_REDIRECT_INPAGE\"\n- \"JAVASCRIPT_INPAGE\"", + "items": { + "type": "string", + "enum": [ + "IFRAME_JAVASCRIPT_INPAGE", + "INTERNAL_REDIRECT_INPAGE", + "JAVASCRIPT_INPAGE", + "STANDARD" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + }, + "interstitialTagFormats": { + "type": "array", + "description": "Tag types for interstitial placements.\n\nAcceptable values are:\n- \"IFRAME_JAVASCRIPT_INTERSTITIAL\"\n- \"INTERNAL_REDIRECT_INTERSTITIAL\"\n- \"JAVASCRIPT_INTERSTITIAL\"", + "items": { + "type": "string", + "enum": [ + "IFRAME_JAVASCRIPT_INTERSTITIAL", + "INTERNAL_REDIRECT_INTERSTITIAL", + "JAVASCRIPT_INTERSTITIAL" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#directorySite\".", + "default": "dfareporting#directorySite" + }, + "name": { + "type": "string", + "description": "Name of this directory site." + }, + "parentId": { + "type": "string", + "description": "Parent directory site ID.", + "format": "int64" + }, + "settings": { + "$ref": "DirectorySiteSettings", + "description": "Directory site settings." + }, + "url": { + "type": "string", + "description": "URL of this directory site." + } + } + }, + "DirectorySiteContact": { + "id": "DirectorySiteContact", + "type": "object", + "description": "Contains properties of a Site Directory contact.", + "properties": { + "address": { + "type": "string", + "description": "Address of this directory site contact." + }, + "email": { + "type": "string", + "description": "Email address of this directory site contact." + }, + "firstName": { + "type": "string", + "description": "First name of this directory site contact." + }, + "id": { + "type": "string", + "description": "ID of this directory site contact. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#directorySiteContact\".", + "default": "dfareporting#directorySiteContact" + }, + "lastName": { + "type": "string", + "description": "Last name of this directory site contact." + }, + "phone": { + "type": "string", + "description": "Phone number of this directory site contact." + }, + "role": { + "type": "string", + "description": "Directory site contact role.", + "enum": [ + "ADMIN", + "EDIT", + "VIEW" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "title": { + "type": "string", + "description": "Title or designation of this directory site contact." + }, + "type": { + "type": "string", + "description": "Directory site contact type.", + "enum": [ + "BILLING", + "OTHER", + "SALES", + "TECHNICAL" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "DirectorySiteContactAssignment": { + "id": "DirectorySiteContactAssignment", + "type": "object", + "description": "Directory Site Contact Assignment", + "properties": { + "contactId": { + "type": "string", + "description": "ID of this directory site contact. This is a read-only, auto-generated field.", + "format": "int64" + }, + "visibility": { + "type": "string", + "description": "Visibility of this directory site contact assignment. When set to PUBLIC this contact assignment is visible to all account and agency users; when set to PRIVATE it is visible only to the site.", + "enum": [ + "PRIVATE", + "PUBLIC" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "DirectorySiteContactsListResponse": { + "id": "DirectorySiteContactsListResponse", + "type": "object", + "description": "Directory Site Contact List Response", + "properties": { + "directorySiteContacts": { + "type": "array", + "description": "Directory site contact collection", + "items": { + "$ref": "DirectorySiteContact" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#directorySiteContactsListResponse\".", + "default": "dfareporting#directorySiteContactsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "DirectorySiteSettings": { + "id": "DirectorySiteSettings", + "type": "object", + "description": "Directory Site Settings", + "properties": { + "activeViewOptOut": { + "type": "boolean", + "description": "Whether this directory site has disabled active view creatives." + }, + "dfp_settings": { + "$ref": "DfpSettings", + "description": "Directory site DFP settings." + }, + "instream_video_placement_accepted": { + "type": "boolean", + "description": "Whether this site accepts in-stream video ads." + }, + "interstitialPlacementAccepted": { + "type": "boolean", + "description": "Whether this site accepts interstitial ads." + }, + "nielsenOcrOptOut": { + "type": "boolean", + "description": "Whether this directory site has disabled Nielsen OCR reach ratings." + }, + "verificationTagOptOut": { + "type": "boolean", + "description": "Whether this directory site has disabled generation of Verification ins tags." + }, + "videoActiveViewOptOut": { + "type": "boolean", + "description": "Whether this directory site has disabled active view for in-stream video creatives." + } + } + }, + "DirectorySitesListResponse": { + "id": "DirectorySitesListResponse", + "type": "object", + "description": "Directory Site List Response", + "properties": { + "directorySites": { + "type": "array", + "description": "Directory site collection.", + "items": { + "$ref": "DirectorySite" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#directorySitesListResponse\".", + "default": "dfareporting#directorySitesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "EventTag": { + "id": "EventTag", + "type": "object", + "description": "Contains properties of an event tag.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this event tag. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this event tag. This field or the campaignId field is required on insertion.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "campaignId": { + "type": "string", + "description": "Campaign ID of this event tag. This field or the advertiserId field is required on insertion.", + "format": "int64" + }, + "campaignIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the campaign. This is a read-only, auto-generated field." + }, + "enabledByDefault": { + "type": "boolean", + "description": "Whether this event tag should be automatically enabled for all of the advertiser's campaigns and ads." + }, + "id": { + "type": "string", + "description": "ID of this event tag. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#eventTag\".", + "default": "dfareporting#eventTag" + }, + "name": { + "type": "string", + "description": "Name of this event tag. This is a required field and must be less than 256 characters long." + }, + "siteFilterType": { + "type": "string", + "description": "Site filter type for this event tag. If no type is specified then the event tag will be applied to all sites.", + "enum": [ + "BLACKLIST", + "WHITELIST" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "siteIds": { + "type": "array", + "description": "Filter list of site IDs associated with this event tag. The siteFilterType determines whether this is a whitelist or blacklist filter.", + "items": { + "type": "string", + "format": "int64" + } + }, + "sslCompliant": { + "type": "boolean", + "description": "Whether this tag is SSL-compliant or not. This is a read-only field." + }, + "status": { + "type": "string", + "description": "Status of this event tag. Must be ENABLED for this event tag to fire. This is a required field.", + "enum": [ + "DISABLED", + "ENABLED" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this event tag. This is a read-only field that can be left blank.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "Event tag type. Can be used to specify whether to use a third-party pixel, a third-party JavaScript URL, or a third-party click-through URL for either impression or click tracking. This is a required field.", + "enum": [ + "CLICK_THROUGH_EVENT_TAG", + "IMPRESSION_IMAGE_EVENT_TAG", + "IMPRESSION_JAVASCRIPT_EVENT_TAG" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "url": { + "type": "string", + "description": "Payload URL for this event tag. The URL on a click-through event tag should have a landing page URL appended to the end of it. This field is required on insertion." + }, + "urlEscapeLevels": { + "type": "integer", + "description": "Number of times the landing page URL should be URL-escaped before being appended to the click-through event tag URL. Only applies to click-through event tags as specified by the event tag type.", + "format": "int32" + } + } + }, + "EventTagOverride": { + "id": "EventTagOverride", + "type": "object", + "description": "Event tag override information.", + "properties": { + "enabled": { + "type": "boolean", + "description": "Whether this override is enabled." + }, + "id": { + "type": "string", + "description": "ID of this event tag override. This is a read-only, auto-generated field.", + "format": "int64" + } + } + }, + "EventTagsListResponse": { + "id": "EventTagsListResponse", + "type": "object", + "description": "Event Tag List Response", + "properties": { + "eventTags": { + "type": "array", + "description": "Event tag collection.", + "items": { + "$ref": "EventTag" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#eventTagsListResponse\".", + "default": "dfareporting#eventTagsListResponse" + } + } + }, + "File": { + "id": "File", + "type": "object", + "description": "Represents a File resource. A file contains the metadata 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 filename of the file." + }, + "format": { + "type": "string", + "description": "The output format of the report. Only available once the file is available.", + "enum": [ + "CSV", + "EXCEL" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "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.", + "enum": [ + "CANCELLED", + "FAILED", + "PROCESSING", + "REPORT_AVAILABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "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." + } + } + }, + "Flight": { + "id": "Flight", + "type": "object", + "description": "Flight", + "properties": { + "endDate": { + "type": "string", + "description": "Inventory item flight end date.", + "format": "date" + }, + "rateOrCost": { + "type": "string", + "description": "Rate or cost of this flight.", + "format": "int64" + }, + "startDate": { + "type": "string", + "description": "Inventory item flight start date.", + "format": "date" + }, + "units": { + "type": "string", + "description": "Units of this flight.", + "format": "int64" + } + } + }, + "FloodlightActivitiesGenerateTagResponse": { + "id": "FloodlightActivitiesGenerateTagResponse", + "type": "object", + "description": "Floodlight Activity GenerateTag Response", + "properties": { + "floodlightActivityTag": { + "type": "string", + "description": "Generated tag for this floodlight activity." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightActivitiesGenerateTagResponse\".", + "default": "dfareporting#floodlightActivitiesGenerateTagResponse" + } + } + }, + "FloodlightActivitiesListResponse": { + "id": "FloodlightActivitiesListResponse", + "type": "object", + "description": "Floodlight Activity List Response", + "properties": { + "floodlightActivities": { + "type": "array", + "description": "Floodlight activity collection.", + "items": { + "$ref": "FloodlightActivity" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightActivitiesListResponse\".", + "default": "dfareporting#floodlightActivitiesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "FloodlightActivity": { + "id": "FloodlightActivity", + "type": "object", + "description": "Contains properties of a Floodlight activity.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this floodlight activity. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this floodlight activity. If this field is left blank, the value will be copied over either from the activity group's advertiser or the existing activity's advertiser.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "cacheBustingType": { + "type": "string", + "description": "Code type used for cache busting in the generated tag.", + "enum": [ + "ACTIVE_SERVER_PAGE", + "COLD_FUSION", + "JAVASCRIPT", + "JSP", + "PHP" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "countingMethod": { + "type": "string", + "description": "Counting method for conversions for this floodlight activity. This is a required field.", + "enum": [ + "ITEMS_SOLD_COUNTING", + "SESSION_COUNTING", + "STANDARD_COUNTING", + "TRANSACTIONS_COUNTING", + "UNIQUE_COUNTING" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "defaultTags": { + "type": "array", + "description": "Dynamic floodlight tags.", + "items": { + "$ref": "FloodlightActivityDynamicTag" + } + }, + "expectedUrl": { + "type": "string", + "description": "URL where this tag will be deployed. If specified, must be less than 256 characters long." + }, + "floodlightActivityGroupId": { + "type": "string", + "description": "Floodlight activity group ID of this floodlight activity. This is a required field.", + "format": "int64" + }, + "floodlightActivityGroupName": { + "type": "string", + "description": "Name of the associated floodlight activity group. This is a read-only field." + }, + "floodlightActivityGroupTagString": { + "type": "string", + "description": "Tag string of the associated floodlight activity group. This is a read-only field." + }, + "floodlightActivityGroupType": { + "type": "string", + "description": "Type of the associated floodlight activity group. This is a read-only field.", + "enum": [ + "COUNTER", + "SALE" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "floodlightConfigurationId": { + "type": "string", + "description": "Floodlight configuration ID of this floodlight activity. If this field is left blank, the value will be copied over either from the activity group's floodlight configuration or from the existing activity's floodlight configuration.", + "format": "int64" + }, + "floodlightConfigurationIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the floodlight configuration. This is a read-only, auto-generated field." + }, + "hidden": { + "type": "boolean", + "description": "Whether this activity is archived." + }, + "id": { + "type": "string", + "description": "ID of this floodlight activity. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this floodlight activity. This is a read-only, auto-generated field." + }, + "imageTagEnabled": { + "type": "boolean", + "description": "Whether the image tag is enabled for this activity." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightActivity\".", + "default": "dfareporting#floodlightActivity" + }, + "name": { + "type": "string", + "description": "Name of this floodlight activity. This is a required field. Must be less than 129 characters long and cannot contain quotes." + }, + "notes": { + "type": "string", + "description": "General notes or implementation instructions for the tag." + }, + "publisherTags": { + "type": "array", + "description": "Publisher dynamic floodlight tags.", + "items": { + "$ref": "FloodlightActivityPublisherDynamicTag" + } + }, + "secure": { + "type": "boolean", + "description": "Whether this tag should use SSL." + }, + "sslCompliant": { + "type": "boolean", + "description": "Whether the floodlight activity is SSL-compliant. This is a read-only field, its value detected by the system from the floodlight tags." + }, + "sslRequired": { + "type": "boolean", + "description": "Whether this floodlight activity must be SSL-compliant." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this floodlight activity. This is a read-only field that can be left blank.", + "format": "int64" + }, + "tagFormat": { + "type": "string", + "description": "Tag format type for the floodlight activity. If left blank, the tag format will default to HTML.", + "enum": [ + "HTML", + "XHTML" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "tagString": { + "type": "string", + "description": "Value of the cat= paramter in the floodlight tag, which the ad servers use to identify the activity. This is optional: if empty, a new tag string will be generated for you. This string must be 1 to 8 characters long, with valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among activities of the same activity group. This field is read-only after insertion." + }, + "userDefinedVariableTypes": { + "type": "array", + "description": "List of the user-defined variables used by this conversion tag. These map to the \"u[1-20]=\" in the tags. Each of these can have a user defined type.\nAcceptable values are:\n- \"U1\"\n- \"U2\"\n- \"U3\"\n- \"U4\"\n- \"U5\"\n- \"U6\"\n- \"U7\"\n- \"U8\"\n- \"U9\"\n- \"U10\"\n- \"U11\"\n- \"U12\"\n- \"U13\"\n- \"U14\"\n- \"U15\"\n- \"U16\"\n- \"U17\"\n- \"U18\"\n- \"U19\"\n- \"U20\"", + "items": { + "type": "string", + "enum": [ + "U1", + "U10", + "U11", + "U12", + "U13", + "U14", + "U15", + "U16", + "U17", + "U18", + "U19", + "U2", + "U20", + "U3", + "U4", + "U5", + "U6", + "U7", + "U8", + "U9" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + } + }, + "FloodlightActivityDynamicTag": { + "id": "FloodlightActivityDynamicTag", + "type": "object", + "description": "Dynamic Tag", + "properties": { + "id": { + "type": "string", + "description": "ID of this dynamic tag. This is a read-only, auto-generated field.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this tag." + }, + "tag": { + "type": "string", + "description": "Tag code." + } + } + }, + "FloodlightActivityGroup": { + "id": "FloodlightActivityGroup", + "type": "object", + "description": "Contains properties of a Floodlight activity group.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this floodlight activity group. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this floodlight activity group. If this field is left blank, the value will be copied over either from the floodlight configuration's advertiser or from the existing activity group's advertiser.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "floodlightConfigurationId": { + "type": "string", + "description": "Floodlight configuration ID of this floodlight activity group. This is a required field.", + "format": "int64" + }, + "floodlightConfigurationIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the floodlight configuration. This is a read-only, auto-generated field." + }, + "id": { + "type": "string", + "description": "ID of this floodlight activity group. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this floodlight activity group. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightActivityGroup\".", + "default": "dfareporting#floodlightActivityGroup" + }, + "name": { + "type": "string", + "description": "Name of this floodlight activity group. This is a required field. Must be less than 65 characters long and cannot contain quotes." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this floodlight activity group. This is a read-only field that can be left blank.", + "format": "int64" + }, + "tagString": { + "type": "string", + "description": "Value of the type= parameter in the floodlight tag, which the ad servers use to identify the activity group that the activity belongs to. This is optional: if empty, a new tag string will be generated for you. This string must be 1 to 8 characters long, with valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among activity groups of the same floodlight configuration. This field is read-only after insertion." + }, + "type": { + "type": "string", + "description": "Type of the floodlight activity group. This is a required field that is read-only after insertion.", + "enum": [ + "COUNTER", + "SALE" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "FloodlightActivityGroupsListResponse": { + "id": "FloodlightActivityGroupsListResponse", + "type": "object", + "description": "Floodlight Activity Group List Response", + "properties": { + "floodlightActivityGroups": { + "type": "array", + "description": "Floodlight activity group collection.", + "items": { + "$ref": "FloodlightActivityGroup" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightActivityGroupsListResponse\".", + "default": "dfareporting#floodlightActivityGroupsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "FloodlightActivityPublisherDynamicTag": { + "id": "FloodlightActivityPublisherDynamicTag", + "type": "object", + "description": "Publisher Dynamic Tag", + "properties": { + "clickThrough": { + "type": "boolean", + "description": "Whether this tag is applicable only for click-throughs." + }, + "directorySiteId": { + "type": "string", + "description": "Directory site ID of this dynamic tag. This is a write-only field that can be used as an alternative to the siteId field. When this resource is retrieved, only the siteId field will be populated.", + "format": "int64" + }, + "dynamicTag": { + "$ref": "FloodlightActivityDynamicTag", + "description": "Dynamic floodlight tag." + }, + "siteId": { + "type": "string", + "description": "Site ID of this dynamic tag.", + "format": "int64" + }, + "siteIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the site. This is a read-only, auto-generated field." + }, + "viewThrough": { + "type": "boolean", + "description": "Whether this tag is applicable only for view-throughs." + } + } + }, + "FloodlightConfiguration": { + "id": "FloodlightConfiguration", + "type": "object", + "description": "Contains properties of a Floodlight configuration.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this floodlight configuration. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of the parent advertiser of this floodlight configuration.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "analyticsDataSharingEnabled": { + "type": "boolean", + "description": "Whether advertiser data is shared with Google Analytics." + }, + "exposureToConversionEnabled": { + "type": "boolean", + "description": "Whether the exposure-to-conversion report is enabled. This report shows detailed pathway information on up to 10 of the most recent ad exposures seen by a user before converting." + }, + "firstDayOfWeek": { + "type": "string", + "description": "Day that will be counted as the first day of the week in reports. This is a required field.", + "enum": [ + "MONDAY", + "SUNDAY" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "id": { + "type": "string", + "description": "ID of this floodlight configuration. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this floodlight configuration. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightConfiguration\".", + "default": "dfareporting#floodlightConfiguration" + }, + "lookbackConfiguration": { + "$ref": "LookbackConfiguration", + "description": "Lookback window settings for this floodlight configuration." + }, + "naturalSearchConversionAttributionOption": { + "type": "string", + "description": "Types of attribution options for natural search conversions.", + "enum": [ + "EXCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION", + "INCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION", + "INCLUDE_NATURAL_SEARCH_TIERED_CONVERSION_ATTRIBUTION" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "omnitureSettings": { + "$ref": "OmnitureSettings", + "description": "Settings for DCM Omniture integration." + }, + "sslRequired": { + "type": "boolean", + "description": "Whether floodlight activities owned by this configuration are required to be SSL-compliant." + }, + "standardVariableTypes": { + "type": "array", + "description": "List of standard variables enabled for this configuration.\n\nAcceptable values are:\n- \"ORD\"\n- \"NUM\"", + "items": { + "type": "string", + "enum": [ + "NUM", + "ORD", + "TRAN", + "U" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this floodlight configuration. This is a read-only field that can be left blank.", + "format": "int64" + }, + "tagSettings": { + "$ref": "TagSettings", + "description": "Configuration settings for dynamic and image floodlight tags." + }, + "userDefinedVariableConfigurations": { + "type": "array", + "description": "List of user defined variables enabled for this configuration.", + "items": { + "$ref": "UserDefinedVariableConfiguration" + } + } + } + }, + "FloodlightConfigurationsListResponse": { + "id": "FloodlightConfigurationsListResponse", + "type": "object", + "description": "Floodlight Configuration List Response", + "properties": { + "floodlightConfigurations": { + "type": "array", + "description": "Floodlight configuration collection.", + "items": { + "$ref": "FloodlightConfiguration" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightConfigurationsListResponse\".", + "default": "dfareporting#floodlightConfigurationsListResponse" + } + } + }, + "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" + } + } + } + }, + "FrequencyCap": { + "id": "FrequencyCap", + "type": "object", + "description": "Frequency Cap.", + "properties": { + "duration": { + "type": "string", + "description": "Duration of time, in seconds, for this frequency cap. The maximum duration is 90 days in seconds, or 7,776,000.", + "format": "int64" + }, + "impressions": { + "type": "string", + "description": "Number of times an individual user can be served the ad within the specified duration. The maximum allowed is 15.", + "format": "int64" + } + } + }, + "FsCommand": { + "id": "FsCommand", + "type": "object", + "description": "FsCommand.", + "properties": { + "left": { + "type": "integer", + "description": "Distance from the left of the browser.Applicable when positionOption is DISTANCE_FROM_TOP_LEFT_CORNER.", + "format": "int32" + }, + "positionOption": { + "type": "string", + "description": "Position in the browser where the window will open.", + "enum": [ + "CENTERED", + "DISTANCE_FROM_TOP_LEFT_CORNER" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "top": { + "type": "integer", + "description": "Distance from the top of the browser. Applicable when positionOption is DISTANCE_FROM_TOP_LEFT_CORNER.", + "format": "int32" + }, + "windowHeight": { + "type": "integer", + "description": "Height of the window.", + "format": "int32" + }, + "windowWidth": { + "type": "integer", + "description": "Width of the window.", + "format": "int32" + } + } + }, + "GeoTargeting": { + "id": "GeoTargeting", + "type": "object", + "description": "Geographical Targeting.", + "properties": { + "cities": { + "type": "array", + "description": "Cities to be targeted. For each city only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting a city, do not target or exclude the country of the city, and do not target the metro or region of the city.", + "items": { + "$ref": "City" + } + }, + "countries": { + "type": "array", + "description": "Countries to be targeted or excluded from targeting, depending on the setting of the excludeCountries field. For each country only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting or excluding a country, do not target regions, cities, metros, or postal codes in the same country.", + "items": { + "$ref": "Country" + } + }, + "excludeCountries": { + "type": "boolean", + "description": "Whether or not to exclude the countries in the countries field from targeting. If false, the countries field refers to countries which will be targeted by the ad." + }, + "metros": { + "type": "array", + "description": "Metros to be targeted. For each metro only dmaId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting a metro, do not target or exclude the country of the metro.", + "items": { + "$ref": "Metro" + } + }, + "postalCodes": { + "type": "array", + "description": "Postal codes to be targeted. For each postal code only id is required. The other fields are populated automatically when the ad is inserted or updated. If targeting a postal code, do not target or exclude the country of the postal code.", + "items": { + "$ref": "PostalCode" + } + }, + "regions": { + "type": "array", + "description": "Regions to be targeted. For each region only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting a region, do not target or exclude the country of the region.", + "items": { + "$ref": "Region" + } + } + } + }, + "InventoryItem": { + "id": "InventoryItem", + "type": "object", + "description": "Represents a buy from the DoubleClick Planning inventory store.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this inventory item.", + "format": "int64" + }, + "adSlots": { + "type": "array", + "description": "Ad slots of this inventory item. If this inventory item represents a standalone placement, there will be exactly one ad slot. If this inventory item represents a placement group, there will be more than one ad slot, each representing one child placement in that placement group.", + "items": { + "$ref": "AdSlot" + } + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this inventory item.", + "format": "int64" + }, + "contentCategoryId": { + "type": "string", + "description": "Content category ID of this inventory item.", + "format": "int64" + }, + "estimatedClickThroughRate": { + "type": "string", + "description": "Estimated click-through rate of this inventory item.", + "format": "int64" + }, + "estimatedConversionRate": { + "type": "string", + "description": "Estimated conversion rate of this inventory item.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "ID of this inventory item.", + "format": "int64" + }, + "inPlan": { + "type": "boolean", + "description": "Whether this inventory item is in plan." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#inventoryItem\".", + "default": "dfareporting#inventoryItem" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the most recent modification of this inventory item." + }, + "name": { + "type": "string", + "description": "Name of this inventory item. For standalone inventory items, this is the same name as that of its only ad slot. For group inventory items, this can differ from the name of any of its ad slots." + }, + "negotiationChannelId": { + "type": "string", + "description": "Negotiation channel ID of this inventory item.", + "format": "int64" + }, + "orderId": { + "type": "string", + "description": "Order ID of this inventory item.", + "format": "int64" + }, + "placementStrategyId": { + "type": "string", + "description": "Placement strategy ID of this inventory item.", + "format": "int64" + }, + "pricing": { + "$ref": "Pricing", + "description": "Pricing of this inventory item." + }, + "projectId": { + "type": "string", + "description": "Project ID of this inventory item.", + "format": "int64" + }, + "rfpId": { + "type": "string", + "description": "RFP ID of this inventory item.", + "format": "int64" + }, + "siteId": { + "type": "string", + "description": "ID of the site this inventory item is associated with.", + "format": "int64" + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this inventory item.", + "format": "int64" + } + } + }, + "InventoryItemsListResponse": { + "id": "InventoryItemsListResponse", + "type": "object", + "description": "Inventory item List Response", + "properties": { + "inventoryItems": { + "type": "array", + "description": "Inventory item collection", + "items": { + "$ref": "InventoryItem" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#inventoryItemsListResponse\".", + "default": "dfareporting#inventoryItemsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "KeyValueTargetingExpression": { + "id": "KeyValueTargetingExpression", + "type": "object", + "description": "Key Value Targeting Expression.", + "properties": { + "expression": { + "type": "string", + "description": "Keyword expression being targeted by the ad." + } + } + }, + "LandingPage": { + "id": "LandingPage", + "type": "object", + "description": "Contains information about where a user's browser is taken after the user clicks an ad.", + "properties": { + "default": { + "type": "boolean", + "description": "Whether or not this landing page will be assigned to any ads or creatives that do not have a landing page assigned explicitly. Only one default landing page is allowed per campaign." + }, + "id": { + "type": "string", + "description": "ID of this landing page. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#landingPage\".", + "default": "dfareporting#landingPage" + }, + "name": { + "type": "string", + "description": "Name of this landing page. This is a required field. It must be less than 256 characters long, and must be unique among landing pages of the same campaign." + }, + "url": { + "type": "string", + "description": "URL of this landing page. This is a required field." + } + } + }, + "LandingPagesListResponse": { + "id": "LandingPagesListResponse", + "type": "object", + "description": "Landing Page List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#landingPagesListResponse\".", + "default": "dfareporting#landingPagesListResponse" + }, + "landingPages": { + "type": "array", + "description": "Landing page collection", + "items": { + "$ref": "LandingPage" + } + } + } + }, + "LastModifiedInfo": { + "id": "LastModifiedInfo", + "type": "object", + "description": "Modification timestamp.", + "properties": { + "time": { + "type": "string", + "description": "Timestamp of the last change in milliseconds since epoch.", + "format": "int64" + } + } + }, + "ListPopulationClause": { + "id": "ListPopulationClause", + "type": "object", + "description": "A group clause made up of list population terms representing constraints joined by ORs.", + "properties": { + "terms": { + "type": "array", + "description": "Terms of this list population clause. Each clause is made up of list population terms representing constraints and are joined by ORs.", + "items": { + "$ref": "ListPopulationTerm" + } + } + } + }, + "ListPopulationRule": { + "id": "ListPopulationRule", + "type": "object", + "description": "Remarketing List Population Rule.", + "properties": { + "floodlightActivityId": { + "type": "string", + "description": "Floodlight activity ID associated with this rule. This field can be left blank.", + "format": "int64" + }, + "floodlightActivityName": { + "type": "string", + "description": "Name of floodlight activity associated with this rule. This is a read-only, auto-generated field." + }, + "listPopulationClauses": { + "type": "array", + "description": "Clauses that make up this list population rule. Clauses are joined by ANDs, and the clauses themselves are made up of list population terms which are joined by ORs.", + "items": { + "$ref": "ListPopulationClause" + } + } + } + }, + "ListPopulationTerm": { + "id": "ListPopulationTerm", + "type": "object", + "description": "Remarketing List Population Rule Term.", + "properties": { + "contains": { + "type": "boolean", + "description": "Will be true if the term should check if the user is in the list and false if the term should check if the user is not in the list. This field is only relevant when type is set to LIST_MEMBERSHIP_TERM. False by default." + }, + "negation": { + "type": "boolean", + "description": "Whether to negate the comparison result of this term during rule evaluation. This field is only relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM." + }, + "operator": { + "type": "string", + "description": "Comparison operator of this term. This field is only relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM.", + "enum": [ + "NUM_EQUALS", + "NUM_GREATER_THAN", + "NUM_GREATER_THAN_EQUAL", + "NUM_LESS_THAN", + "NUM_LESS_THAN_EQUAL", + "STRING_CONTAINS", + "STRING_EQUALS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "remarketingListId": { + "type": "string", + "description": "ID of the list in question. This field is only relevant when type is set to LIST_MEMBERSHIP_TERM.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "List population term type determines the applicable fields in this object. If left unset or set to CUSTOM_VARIABLE_TERM, then variableName, variableFriendlyName, operator, value, and negation are applicable. If set to LIST_MEMBERSHIP_TERM then remarketingListId and contains are applicable. If set to REFERRER_TERM then operator, value, and negation are applicable.", + "enum": [ + "CUSTOM_VARIABLE_TERM", + "LIST_MEMBERSHIP_TERM", + "REFERRER_TERM" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "value": { + "type": "string", + "description": "Literal to compare the variable to. This field is only relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM." + }, + "variableFriendlyName": { + "type": "string", + "description": "Friendly name of this term's variable. This is a read-only, auto-generated field. This field is only relevant when type is left unset or set to CUSTOM_VARIABLE_TERM." + }, + "variableName": { + "type": "string", + "description": "Name of the variable (U1, U2, etc.) being compared in this term. This field is only relevant when type is set to null, CUSTOM_VARIABLE_TERM or REFERRER_TERM." + } + } + }, + "ListTargetingExpression": { + "id": "ListTargetingExpression", + "type": "object", + "description": "Remarketing List Targeting Expression.", + "properties": { + "expression": { + "type": "string", + "description": "Expression describing which lists are being targeted by the ad." + } + } + }, + "LookbackConfiguration": { + "id": "LookbackConfiguration", + "type": "object", + "description": "Lookback configuration settings.", + "properties": { + "clickDuration": { + "type": "integer", + "description": "Lookback window, in days, from the last time a given user clicked on one of your ads. If you enter 0, clicks will not be considered as triggering events for floodlight tracking. If you leave this field blank, the default value for your account will be used.", + "format": "int32" + }, + "postImpressionActivitiesDuration": { + "type": "integer", + "description": "Lookback window, in days, from the last time a given user viewed one of your ads. If you enter 0, impressions will not be considered as triggering events for floodlight tracking. If you leave this field blank, the default value for your account will be used.", + "format": "int32" + } + } + }, + "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" + } + } + }, + "Metro": { + "id": "Metro", + "type": "object", + "description": "Contains information about a metro region that can be targeted by ads.", + "properties": { + "countryCode": { + "type": "string", + "description": "Country code of the country to which this metro region belongs." + }, + "countryDartId": { + "type": "string", + "description": "DART ID of the country to which this metro region belongs.", + "format": "int64" + }, + "dartId": { + "type": "string", + "description": "DART ID of this metro region.", + "format": "int64" + }, + "dmaId": { + "type": "string", + "description": "DMA ID of this metro region. This is the ID used for targeting and generating reports, and is equivalent to metro_code.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#metro\".", + "default": "dfareporting#metro" + }, + "metroCode": { + "type": "string", + "description": "Metro code of this metro region. This is equivalent to dma_id." + }, + "name": { + "type": "string", + "description": "Name of this metro region." + } + } + }, + "MetrosListResponse": { + "id": "MetrosListResponse", + "type": "object", + "description": "Metro List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#metrosListResponse\".", + "default": "dfareporting#metrosListResponse" + }, + "metros": { + "type": "array", + "description": "Metro collection.", + "items": { + "$ref": "Metro" + } + } + } + }, + "MobileCarrier": { + "id": "MobileCarrier", + "type": "object", + "description": "Contains information about a mobile carrier that can be targeted by ads.", + "properties": { + "countryCode": { + "type": "string", + "description": "Country code of the country to which this mobile carrier belongs." + }, + "countryDartId": { + "type": "string", + "description": "DART ID of the country to which this mobile carrier belongs.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "ID of this mobile carrier.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#mobileCarrier\".", + "default": "dfareporting#mobileCarrier" + }, + "name": { + "type": "string", + "description": "Name of this mobile carrier." + } + } + }, + "MobileCarriersListResponse": { + "id": "MobileCarriersListResponse", + "type": "object", + "description": "Mobile Carrier List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#mobileCarriersListResponse\".", + "default": "dfareporting#mobileCarriersListResponse" + }, + "mobileCarriers": { + "type": "array", + "description": "Mobile carrier collection.", + "items": { + "$ref": "MobileCarrier" + } + } + } + }, + "ObjectFilter": { + "id": "ObjectFilter", + "type": "object", + "description": "Object Filter.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#objectFilter\".", + "default": "dfareporting#objectFilter" + }, + "objectIds": { + "type": "array", + "description": "Applicable when status is ASSIGNED. The user has access to objects with these object IDs.", + "items": { + "type": "string", + "format": "int64" + } + }, + "status": { + "type": "string", + "description": "Status of the filter. NONE means the user has access to none of the objects. ALL means the user has access to all objects. ASSIGNED means the user has access to the objects with IDs in the objectIds list.", + "enum": [ + "ALL", + "ASSIGNED", + "NONE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "OffsetPosition": { + "id": "OffsetPosition", + "type": "object", + "description": "Offset Position.", + "properties": { + "left": { + "type": "integer", + "description": "Offset distance from left side of an asset or a window.", + "format": "int32" + }, + "top": { + "type": "integer", + "description": "Offset distance from top side of an asset or a window.", + "format": "int32" + } + } + }, + "OmnitureSettings": { + "id": "OmnitureSettings", + "type": "object", + "description": "Omniture Integration Settings.", + "properties": { + "omnitureCostDataEnabled": { + "type": "boolean", + "description": "Whether placement cost data will be sent to Omniture. This property can be enabled only if omnitureIntegrationEnabled is true." + }, + "omnitureIntegrationEnabled": { + "type": "boolean", + "description": "Whether Omniture integration is enabled. This property can be enabled only when the \"Advanced Ad Serving\" account setting is enabled." + } + } + }, + "OperatingSystem": { + "id": "OperatingSystem", + "type": "object", + "description": "Contains information about an operating system that can be targeted by ads.", + "properties": { + "dartId": { + "type": "string", + "description": "DART ID of this operating system. This is the ID used for targeting.", + "format": "int64" + }, + "desktop": { + "type": "boolean", + "description": "Whether this operating system is for desktop." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#operatingSystem\".", + "default": "dfareporting#operatingSystem" + }, + "mobile": { + "type": "boolean", + "description": "Whether this operating system is for mobile." + }, + "name": { + "type": "string", + "description": "Name of this operating system." + } + } + }, + "OperatingSystemVersion": { + "id": "OperatingSystemVersion", + "type": "object", + "description": "Contains information about a particular version of an operating system that can be targeted by ads.", + "properties": { + "id": { + "type": "string", + "description": "ID of this operating system version.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#operatingSystemVersion\".", + "default": "dfareporting#operatingSystemVersion" + }, + "majorVersion": { + "type": "string", + "description": "Major version (leftmost number) of this operating system version." + }, + "minorVersion": { + "type": "string", + "description": "Minor version (number after the first dot) of this operating system version." + }, + "name": { + "type": "string", + "description": "Name of this operating system version." + }, + "operatingSystem": { + "$ref": "OperatingSystem", + "description": "Operating system of this operating system version." + } + } + }, + "OperatingSystemVersionsListResponse": { + "id": "OperatingSystemVersionsListResponse", + "type": "object", + "description": "Operating System Version List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#operatingSystemVersionsListResponse\".", + "default": "dfareporting#operatingSystemVersionsListResponse" + }, + "operatingSystemVersions": { + "type": "array", + "description": "Operating system version collection.", + "items": { + "$ref": "OperatingSystemVersion" + } + } + } + }, + "OperatingSystemsListResponse": { + "id": "OperatingSystemsListResponse", + "type": "object", + "description": "Operating System List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#operatingSystemsListResponse\".", + "default": "dfareporting#operatingSystemsListResponse" + }, + "operatingSystems": { + "type": "array", + "description": "Operating system collection.", + "items": { + "$ref": "OperatingSystem" + } + } + } + }, + "OptimizationActivity": { + "id": "OptimizationActivity", + "type": "object", + "description": "Creative optimization activity.", + "properties": { + "floodlightActivityId": { + "type": "string", + "description": "Floodlight activity ID of this optimization activity. This is a required field.", + "format": "int64" + }, + "floodlightActivityIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the floodlight activity. This is a read-only, auto-generated field." + }, + "weight": { + "type": "integer", + "description": "Weight associated with this optimization. Must be greater than 1. The weight assigned will be understood in proportion to the weights assigned to the other optimization activities.", + "format": "int32" + } + } + }, + "Order": { + "id": "Order", + "type": "object", + "description": "Describes properties of a DoubleClick Planning order.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this order.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this order.", + "format": "int64" + }, + "approverUserProfileIds": { + "type": "array", + "description": "IDs for users that have to approve documents created for this order.", + "items": { + "type": "string", + "format": "int64" + } + }, + "buyerInvoiceId": { + "type": "string", + "description": "Buyer invoice ID associated with this order." + }, + "buyerOrganizationName": { + "type": "string", + "description": "Name of the buyer organization." + }, + "comments": { + "type": "string", + "description": "Comments in this order." + }, + "contacts": { + "type": "array", + "description": "Contacts for this order.", + "items": { + "$ref": "OrderContact" + } + }, + "id": { + "type": "string", + "description": "ID of this order. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#order\".", + "default": "dfareporting#order" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the most recent modification of this order." + }, + "name": { + "type": "string", + "description": "Name of this order." + }, + "notes": { + "type": "string", + "description": "Notes of this order." + }, + "planningTermId": { + "type": "string", + "description": "ID of the terms and conditions template used in this order.", + "format": "int64" + }, + "projectId": { + "type": "string", + "description": "Project ID of this order.", + "format": "int64" + }, + "sellerOrderId": { + "type": "string", + "description": "Seller order ID associated with this order." + }, + "sellerOrganizationName": { + "type": "string", + "description": "Name of the seller organization." + }, + "siteId": { + "type": "array", + "description": "Site IDs this order is associated with.", + "items": { + "type": "string", + "format": "int64" + } + }, + "siteNames": { + "type": "array", + "description": "Free-form site names this order is associated with.", + "items": { + "type": "string" + } + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this order.", + "format": "int64" + }, + "termsAndConditions": { + "type": "string", + "description": "Terms and conditions of this order." + } + } + }, + "OrderContact": { + "id": "OrderContact", + "type": "object", + "description": "Contact of an order.", + "properties": { + "contactInfo": { + "type": "string", + "description": "Free-form information about this contact. It could be any information related to this contact in addition to type, title, name, and signature user profile ID." + }, + "contactName": { + "type": "string", + "description": "Name of this contact." + }, + "contactTitle": { + "type": "string", + "description": "Title of this contact." + }, + "contactType": { + "type": "string", + "description": "Type of this contact.", + "enum": [ + "PLANNING_ORDER_CONTACT_BUYER_BILLING_CONTACT", + "PLANNING_ORDER_CONTACT_BUYER_CONTACT", + "PLANNING_ORDER_CONTACT_SELLER_CONTACT" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "signatureUserProfileId": { + "type": "string", + "description": "ID of the user profile containing the signature that will be embedded into order documents.", + "format": "int64" + } + } + }, + "OrderDocument": { + "id": "OrderDocument", + "type": "object", + "description": "Contains properties of a DoubleClick Planning order document.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this order document.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this order document.", + "format": "int64" + }, + "amendedOrderDocumentId": { + "type": "string", + "description": "The amended order document ID of this order document. An order document can be created by optionally amending another order document so that the change history can be preserved.", + "format": "int64" + }, + "approvedByUserProfileIds": { + "type": "array", + "description": "IDs of users who have approved this order document.", + "items": { + "type": "string", + "format": "int64" + } + }, + "cancelled": { + "type": "boolean", + "description": "Whether this order document is cancelled." + }, + "createdInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the creation of this order document." + }, + "effectiveDate": { + "type": "string", + "description": "Effective date of this order document.", + "format": "date" + }, + "id": { + "type": "string", + "description": "ID of this order document.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#orderDocument\".", + "default": "dfareporting#orderDocument" + }, + "orderId": { + "type": "string", + "description": "ID of the order from which this order document is created.", + "format": "int64" + }, + "projectId": { + "type": "string", + "description": "Project ID of this order document.", + "format": "int64" + }, + "signed": { + "type": "boolean", + "description": "Whether this order document has been signed." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this order document.", + "format": "int64" + }, + "title": { + "type": "string", + "description": "Title of this order document." + }, + "type": { + "type": "string", + "description": "Type of this order document", + "enum": [ + "PLANNING_ORDER_TYPE_CHANGE_ORDER", + "PLANNING_ORDER_TYPE_INSERTION_ORDER" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "OrderDocumentsListResponse": { + "id": "OrderDocumentsListResponse", + "type": "object", + "description": "Order document List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#orderDocumentsListResponse\".", + "default": "dfareporting#orderDocumentsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "orderDocuments": { + "type": "array", + "description": "Order document collection", + "items": { + "$ref": "OrderDocument" + } + } + } + }, + "OrdersListResponse": { + "id": "OrdersListResponse", + "type": "object", + "description": "Order List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#ordersListResponse\".", + "default": "dfareporting#ordersListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "orders": { + "type": "array", + "description": "Order collection.", + "items": { + "$ref": "Order" + } + } + } + }, + "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" + } + } + } + }, + "Placement": { + "id": "Placement", + "type": "object", + "description": "Contains properties of a placement.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this placement. This field can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this placement. This field can be left blank.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "archived": { + "type": "boolean", + "description": "Whether this placement is archived." + }, + "campaignId": { + "type": "string", + "description": "Campaign ID of this placement. This field is a required field on insertion.", + "format": "int64" + }, + "campaignIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the campaign. This is a read-only, auto-generated field." + }, + "comment": { + "type": "string", + "description": "Comments for this placement." + }, + "compatibility": { + "type": "string", + "description": "Placement compatibility. WEB and WEB_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps.IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard. This field is required on insertion.", + "enum": [ + "APP", + "APP_INTERSTITIAL", + "IN_STREAM_VIDEO", + "WEB", + "WEB_INTERSTITIAL" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "contentCategoryId": { + "type": "string", + "description": "ID of the content category assigned to this placement.", + "format": "int64" + }, + "createInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the creation of this placement. This is a read-only field." + }, + "directorySiteId": { + "type": "string", + "description": "Directory site ID of this placement. On insert, you must set either this field or the siteId field to specify the site associated with this placement. This is a required field that is read-only after insertion.", + "format": "int64" + }, + "directorySiteIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the directory site. This is a read-only, auto-generated field." + }, + "externalId": { + "type": "string", + "description": "External ID for this placement." + }, + "id": { + "type": "string", + "description": "ID of this placement. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this placement. This is a read-only, auto-generated field." + }, + "keyName": { + "type": "string", + "description": "Key name of this placement. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placement\".", + "default": "dfareporting#placement" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the most recent modification of this placement. This is a read-only field." + }, + "lookbackConfiguration": { + "$ref": "LookbackConfiguration", + "description": "Lookback window settings for this placement." + }, + "name": { + "type": "string", + "description": "Name of this placement.This is a required field and must be less than 256 characters long." + }, + "paymentApproved": { + "type": "boolean", + "description": "Whether payment was approved for this placement. This is a read-only field relevant only to publisher-paid placements." + }, + "paymentSource": { + "type": "string", + "description": "Payment source for this placement. This is a required field that is read-only after insertion.", + "enum": [ + "PLACEMENT_AGENCY_PAID", + "PLACEMENT_PUBLISHER_PAID" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "placementGroupId": { + "type": "string", + "description": "ID of this placement's group, if applicable.", + "format": "int64" + }, + "placementGroupIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the placement group. This is a read-only, auto-generated field." + }, + "placementStrategyId": { + "type": "string", + "description": "ID of the placement strategy assigned to this placement.", + "format": "int64" + }, + "pricingSchedule": { + "$ref": "PricingSchedule", + "description": "Pricing schedule of this placement. This field is required on insertion, specifically subfields startDate, endDate and pricingType." + }, + "primary": { + "type": "boolean", + "description": "Whether this placement is the primary placement of a roadblock (placement group). You cannot change this field from true to false. Setting this field to true will automatically set the primary field on the original primary placement of the roadblock to false, and it will automatically set the roadblock's primaryPlacementId field to the ID of this placement." + }, + "publisherUpdateInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the last publisher update. This is a read-only field." + }, + "siteId": { + "type": "string", + "description": "Site ID associated with this placement. On insert, you must set either this field or the directorySiteId field to specify the site associated with this placement. This is a required field that is read-only after insertion.", + "format": "int64" + }, + "siteIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the site. This is a read-only, auto-generated field." + }, + "size": { + "$ref": "Size", + "description": "Size associated with this placement. When inserting or updating a placement, only the size ID field is used. This field is required on insertion." + }, + "sslRequired": { + "type": "boolean", + "description": "Whether creatives assigned to this placement must be SSL-compliant." + }, + "status": { + "type": "string", + "description": "Third-party placement status.", + "enum": [ + "ACKNOWLEDGE_ACCEPTANCE", + "ACKNOWLEDGE_REJECTION", + "DRAFT", + "PAYMENT_ACCEPTED", + "PAYMENT_REJECTED", + "PENDING_REVIEW" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this placement. This field can be left blank.", + "format": "int64" + }, + "tagFormats": { + "type": "array", + "description": "Tag formats to generate for this placement. This field is required on insertion.\nAcceptable values are:\n- \"PLACEMENT_TAG_STANDARD\"\n- \"PLACEMENT_TAG_IFRAME_JAVASCRIPT\"\n- \"PLACEMENT_TAG_IFRAME_ILAYER\"\n- \"PLACEMENT_TAG_INTERNAL_REDIRECT\"\n- \"PLACEMENT_TAG_JAVASCRIPT\"\n- \"PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT\"\n- \"PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT\"\n- \"PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT\"\n- \"PLACEMENT_TAG_CLICK_COMMANDS\"\n- \"PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH\"\n- \"PLACEMENT_TAG_TRACKING\"\n- \"PLACEMENT_TAG_TRACKING_IFRAME\"\n- \"PLACEMENT_TAG_TRACKING_JAVASCRIPT\"", + "items": { + "type": "string", + "enum": [ + "PLACEMENT_TAG_CLICK_COMMANDS", + "PLACEMENT_TAG_IFRAME_ILAYER", + "PLACEMENT_TAG_IFRAME_JAVASCRIPT", + "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3", + "PLACEMENT_TAG_INTERNAL_REDIRECT", + "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT", + "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT", + "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT", + "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_JAVASCRIPT", + "PLACEMENT_TAG_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_STANDARD", + "PLACEMENT_TAG_TRACKING", + "PLACEMENT_TAG_TRACKING_IFRAME", + "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "tagSetting": { + "$ref": "TagSetting", + "description": "Tag settings for this placement." + } + } + }, + "PlacementAssignment": { + "id": "PlacementAssignment", + "type": "object", + "description": "Placement Assignment.", + "properties": { + "active": { + "type": "boolean", + "description": "Whether this placement assignment is active. When true, the placement will be included in the ad's rotation." + }, + "placementId": { + "type": "string", + "description": "ID of the placement to be assigned. This is a required field.", + "format": "int64" + }, + "placementIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the placement. This is a read-only, auto-generated field." + }, + "sslRequired": { + "type": "boolean", + "description": "Whether the placement to be assigned requires SSL. This is a read-only field that is auto-generated when the ad is inserted or updated." + } + } + }, + "PlacementGroup": { + "id": "PlacementGroup", + "type": "object", + "description": "Contains properties of a package or roadblock.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this placement group. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this placement group. This is a required field on insertion.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "archived": { + "type": "boolean", + "description": "Whether this placement group is archived." + }, + "campaignId": { + "type": "string", + "description": "Campaign ID of this placement group. This field is required on insertion.", + "format": "int64" + }, + "campaignIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the campaign. This is a read-only, auto-generated field." + }, + "childPlacementIds": { + "type": "array", + "description": "IDs of placements which are assigned to this placement group. This is a read-only, auto-generated field.", + "items": { + "type": "string", + "format": "int64" + } + }, + "comment": { + "type": "string", + "description": "Comments for this placement group." + }, + "contentCategoryId": { + "type": "string", + "description": "ID of the content category assigned to this placement group.", + "format": "int64" + }, + "createInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the creation of this placement group. This is a read-only field." + }, + "directorySiteId": { + "type": "string", + "description": "Directory site ID associated with this placement group. On insert, you must set either this field or the site_id field to specify the site associated with this placement group. This is a required field that is read-only after insertion.", + "format": "int64" + }, + "directorySiteIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the directory site. This is a read-only, auto-generated field." + }, + "externalId": { + "type": "string", + "description": "External ID for this placement." + }, + "id": { + "type": "string", + "description": "ID of this placement group. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this placement group. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placementGroup\".", + "default": "dfareporting#placementGroup" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the most recent modification of this placement group. This is a read-only field." + }, + "name": { + "type": "string", + "description": "Name of this placement group. This is a required field and must be less than 256 characters long." + }, + "placementGroupType": { + "type": "string", + "description": "Type of this placement group. A package is a simple group of placements that acts as a single pricing point for a group of tags. A roadblock is a group of placements that not only acts as a single pricing point, but also assumes that all the tags in it will be served at the same time. A roadblock requires one of its assigned placements to be marked as primary for reporting. This field is required on insertion.", + "enum": [ + "PLACEMENT_PACKAGE", + "PLACEMENT_ROADBLOCK" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "placementStrategyId": { + "type": "string", + "description": "ID of the placement strategy assigned to this placement group.", + "format": "int64" + }, + "pricingSchedule": { + "$ref": "PricingSchedule", + "description": "Pricing schedule of this placement group. This field is required on insertion." + }, + "primaryPlacementId": { + "type": "string", + "description": "ID of the primary placement, used to calculate the media cost of a roadblock (placement group). Modifying this field will automatically modify the primary field on all affected roadblock child placements.", + "format": "int64" + }, + "primaryPlacementIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the primary placement. This is a read-only, auto-generated field." + }, + "programmaticSetting": { + "$ref": "ProgrammaticSetting", + "description": "Settings for a programmatic placement." + }, + "siteId": { + "type": "string", + "description": "Site ID associated with this placement group. On insert, you must set either this field or the directorySiteId field to specify the site associated with this placement group. This is a required field that is read-only after insertion.", + "format": "int64" + }, + "siteIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the site. This is a read-only, auto-generated field." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this placement group. This is a read-only field that can be left blank.", + "format": "int64" + } + } + }, + "PlacementGroupsListResponse": { + "id": "PlacementGroupsListResponse", + "type": "object", + "description": "Placement Group List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placementGroupsListResponse\".", + "default": "dfareporting#placementGroupsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "placementGroups": { + "type": "array", + "description": "Placement group collection.", + "items": { + "$ref": "PlacementGroup" + } + } + } + }, + "PlacementStrategiesListResponse": { + "id": "PlacementStrategiesListResponse", + "type": "object", + "description": "Placement Strategy List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placementStrategiesListResponse\".", + "default": "dfareporting#placementStrategiesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "placementStrategies": { + "type": "array", + "description": "Placement strategy collection.", + "items": { + "$ref": "PlacementStrategy" + } + } + } + }, + "PlacementStrategy": { + "id": "PlacementStrategy", + "type": "object", + "description": "Contains properties of a placement strategy.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this placement strategy.This is a read-only field that can be left blank.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "ID of this placement strategy. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placementStrategy\".", + "default": "dfareporting#placementStrategy" + }, + "name": { + "type": "string", + "description": "Name of this placement strategy. This is a required field. It must be less than 256 characters long and unique among placement strategies of the same account." + } + } + }, + "PlacementTag": { + "id": "PlacementTag", + "type": "object", + "description": "Placement Tag", + "properties": { + "placementId": { + "type": "string", + "description": "Placement ID", + "format": "int64" + }, + "tagDatas": { + "type": "array", + "description": "Tags generated for this placement.", + "items": { + "$ref": "TagData" + } + } + } + }, + "PlacementsGenerateTagsResponse": { + "id": "PlacementsGenerateTagsResponse", + "type": "object", + "description": "Placement GenerateTags Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placementsGenerateTagsResponse\".", + "default": "dfareporting#placementsGenerateTagsResponse" + }, + "placementTags": { + "type": "array", + "description": "Set of generated tags for the specified placements.", + "items": { + "$ref": "PlacementTag" + } + } + } + }, + "PlacementsListResponse": { + "id": "PlacementsListResponse", + "type": "object", + "description": "Placement List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placementsListResponse\".", + "default": "dfareporting#placementsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "placements": { + "type": "array", + "description": "Placement collection.", + "items": { + "$ref": "Placement" + } + } + } + }, + "PlatformType": { + "id": "PlatformType", + "type": "object", + "description": "Contains information about a platform type that can be targeted by ads.", + "properties": { + "id": { + "type": "string", + "description": "ID of this platform type.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#platformType\".", + "default": "dfareporting#platformType" + }, + "name": { + "type": "string", + "description": "Name of this platform type." + } + } + }, + "PlatformTypesListResponse": { + "id": "PlatformTypesListResponse", + "type": "object", + "description": "Platform Type List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#platformTypesListResponse\".", + "default": "dfareporting#platformTypesListResponse" + }, + "platformTypes": { + "type": "array", + "description": "Platform type collection.", + "items": { + "$ref": "PlatformType" + } + } + } + }, + "PopupWindowProperties": { + "id": "PopupWindowProperties", + "type": "object", + "description": "Popup Window Properties.", + "properties": { + "dimension": { + "$ref": "Size", + "description": "Popup dimension for a creative. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA and all VPAID" + }, + "offset": { + "$ref": "OffsetPosition", + "description": "Upper-left corner coordinates of the popup window. Applicable if positionType is COORDINATES." + }, + "positionType": { + "type": "string", + "description": "Popup window position either centered or at specific coordinate.", + "enum": [ + "CENTER", + "COORDINATES" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "showAddressBar": { + "type": "boolean", + "description": "Whether to display the browser address bar." + }, + "showMenuBar": { + "type": "boolean", + "description": "Whether to display the browser menu bar." + }, + "showScrollBar": { + "type": "boolean", + "description": "Whether to display the browser scroll bar." + }, + "showStatusBar": { + "type": "boolean", + "description": "Whether to display the browser status bar." + }, + "showToolBar": { + "type": "boolean", + "description": "Whether to display the browser tool bar." + }, + "title": { + "type": "string", + "description": "Title of popup window." + } + } + }, + "PostalCode": { + "id": "PostalCode", + "type": "object", + "description": "Contains information about a postal code that can be targeted by ads.", + "properties": { + "code": { + "type": "string", + "description": "Postal code. This is equivalent to the id field." + }, + "countryCode": { + "type": "string", + "description": "Country code of the country to which this postal code belongs." + }, + "countryDartId": { + "type": "string", + "description": "DART ID of the country to which this postal code belongs.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "ID of this postal code." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#postalCode\".", + "default": "dfareporting#postalCode" + } + } + }, + "PostalCodesListResponse": { + "id": "PostalCodesListResponse", + "type": "object", + "description": "Postal Code List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#postalCodesListResponse\".", + "default": "dfareporting#postalCodesListResponse" + }, + "postalCodes": { + "type": "array", + "description": "Postal code collection.", + "items": { + "$ref": "PostalCode" + } + } + } + }, + "Pricing": { + "id": "Pricing", + "type": "object", + "description": "Pricing Information", + "properties": { + "capCostType": { + "type": "string", + "description": "Cap cost type of this inventory item.", + "enum": [ + "PLANNING_PLACEMENT_CAP_COST_TYPE_CUMULATIVE", + "PLANNING_PLACEMENT_CAP_COST_TYPE_MONTHLY", + "PLANNING_PLACEMENT_CAP_COST_TYPE_NONE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "endDate": { + "type": "string", + "description": "End date of this inventory item.", + "format": "date" + }, + "flights": { + "type": "array", + "description": "Flights of this inventory item. A flight (a.k.a. pricing period) represents the inventory item pricing information for a specific period of time.", + "items": { + "$ref": "Flight" + } + }, + "groupType": { + "type": "string", + "description": "Group type of this inventory item if it represents a placement group. Is null otherwise. There are two type of placement groups: PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE is a simple group of inventory items that acts as a single pricing point for a group of tags. PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK is a group of inventory items that not only acts as a single pricing point, but also assumes that all the tags in it will be served at the same time. A roadblock requires one of its assigned inventory items to be marked as primary.", + "enum": [ + "PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE", + "PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "pricingType": { + "type": "string", + "description": "Pricing type of this inventory item.", + "enum": [ + "PLANNING_PLACEMENT_PRICING_TYPE_CLICKS", + "PLANNING_PLACEMENT_PRICING_TYPE_CPA", + "PLANNING_PLACEMENT_PRICING_TYPE_CPC", + "PLANNING_PLACEMENT_PRICING_TYPE_CPM", + "PLANNING_PLACEMENT_PRICING_TYPE_FLAT_RATE_CLICKS", + "PLANNING_PLACEMENT_PRICING_TYPE_FLAT_RATE_IMPRESSIONS", + "PLANNING_PLACEMENT_PRICING_TYPE_IMPRESSIONS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "startDate": { + "type": "string", + "description": "Start date of this inventory item.", + "format": "date" + } + } + }, + "PricingSchedule": { + "id": "PricingSchedule", + "type": "object", + "description": "Pricing Schedule", + "properties": { + "capCostOption": { + "type": "string", + "description": "Placement cap cost option.", + "enum": [ + "CAP_COST_CUMULATIVE", + "CAP_COST_MONTHLY", + "CAP_COST_NONE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "disregardOverdelivery": { + "type": "boolean", + "description": "Whether cap costs are ignored by ad serving." + }, + "endDate": { + "type": "string", + "description": "Placement end date. This date must be later than, or the same day as, the placement start date, but not later than the campaign end date. If, for example, you set 6/25/2015 as both the start and end dates, the effective placement date is just that day only, 6/25/2015. The hours, minutes, and seconds of the end date should not be set, as doing so will result in an error. This field is required on insertion.", + "format": "date" + }, + "flighted": { + "type": "boolean", + "description": "Whether this placement is flighted. If true, pricing periods will be computed automatically." + }, + "floodlightActivityId": { + "type": "string", + "description": "Floodlight activity ID associated with this placement. This field should be set when placement pricing type is set to PRICING_TYPE_CPA.", + "format": "int64" + }, + "pricingPeriods": { + "type": "array", + "description": "Pricing periods for this placement.", + "items": { + "$ref": "PricingSchedulePricingPeriod" + } + }, + "pricingType": { + "type": "string", + "description": "Placement pricing type. This field is required on insertion.", + "enum": [ + "PRICING_TYPE_CPA", + "PRICING_TYPE_CPC", + "PRICING_TYPE_CPM", + "PRICING_TYPE_FLAT_RATE_CLICKS", + "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "startDate": { + "type": "string", + "description": "Placement start date. This date must be later than, or the same day as, the campaign start date. The hours, minutes, and seconds of the start date should not be set, as doing so will result in an error. This field is required on insertion.", + "format": "date" + }, + "testingStartDate": { + "type": "string", + "description": "Testing start date of this placement. The hours, minutes, and seconds of the start date should not be set, as doing so will result in an error.", + "format": "date" + } + } + }, + "PricingSchedulePricingPeriod": { + "id": "PricingSchedulePricingPeriod", + "type": "object", + "description": "Pricing Period", + "properties": { + "endDate": { + "type": "string", + "description": "Pricing period end date. This date must be later than, or the same day as, the pricing period start date, but not later than the placement end date. The period end date can be the same date as the period start date. If, for example, you set 6/25/2015 as both the start and end dates, the effective pricing period date is just that day only, 6/25/2015. The hours, minutes, and seconds of the end date should not be set, as doing so will result in an error.", + "format": "date" + }, + "pricingComment": { + "type": "string", + "description": "Comments for this pricing period." + }, + "rateOrCostNanos": { + "type": "string", + "description": "Rate or cost of this pricing period.", + "format": "int64" + }, + "startDate": { + "type": "string", + "description": "Pricing period start date. This date must be later than, or the same day as, the placement start date. The hours, minutes, and seconds of the start date should not be set, as doing so will result in an error.", + "format": "date" + }, + "units": { + "type": "string", + "description": "Units of this pricing period.", + "format": "int64" + } + } + }, + "ProgrammaticSetting": { + "id": "ProgrammaticSetting", + "type": "object", + "description": "Programmatic Setting", + "properties": { + "adxDealIds": { + "type": "array", + "description": "Adx deal IDs assigned to the placement.", + "items": { + "type": "string", + "format": "int64" + } + }, + "insertionOrderId": { + "type": "string", + "description": "Insertion order ID." + }, + "insertionOrderIdStatus": { + "type": "boolean", + "description": "Whether insertion order ID has been placed in DFP. This is a read-only field." + }, + "mediaCostNanos": { + "type": "string", + "description": "Media cost for the programmatic placement.", + "format": "int64" + }, + "programmatic": { + "type": "boolean", + "description": "Whether programmatic is enabled." + }, + "traffickerEmails": { + "type": "array", + "description": "Trafficker emails assigned to the placement.", + "items": { + "type": "string" + } + } + } + }, + "Project": { + "id": "Project", + "type": "object", + "description": "Contains properties of a DoubleClick Planning project.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this project.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this project.", + "format": "int64" + }, + "audienceAgeGroup": { + "type": "string", + "description": "Audience age group of this project.", + "enum": [ + "PLANNING_AUDIENCE_AGE_18_24", + "PLANNING_AUDIENCE_AGE_25_34", + "PLANNING_AUDIENCE_AGE_35_44", + "PLANNING_AUDIENCE_AGE_45_54", + "PLANNING_AUDIENCE_AGE_55_64", + "PLANNING_AUDIENCE_AGE_65_OR_MORE", + "PLANNING_AUDIENCE_AGE_UNKNOWN" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "audienceGender": { + "type": "string", + "description": "Audience gender of this project.", + "enum": [ + "PLANNING_AUDIENCE_GENDER_FEMALE", + "PLANNING_AUDIENCE_GENDER_MALE" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "budget": { + "type": "string", + "description": "Budget of this project in the currency specified by the current account. The value stored in this field represents only the non-fractional amount. For example, for USD, the smallest value that can be represented by this field is 1 US dollar.", + "format": "int64" + }, + "clientBillingCode": { + "type": "string", + "description": "Client billing code of this project." + }, + "clientName": { + "type": "string", + "description": "Name of the project client." + }, + "endDate": { + "type": "string", + "description": "End date of the project.", + "format": "date" + }, + "id": { + "type": "string", + "description": "ID of this project. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#project\".", + "default": "dfareporting#project" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the most recent modification of this project." + }, + "name": { + "type": "string", + "description": "Name of this project." + }, + "overview": { + "type": "string", + "description": "Overview of this project." + }, + "startDate": { + "type": "string", + "description": "Start date of the project.", + "format": "date" + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this project.", + "format": "int64" + }, + "targetClicks": { + "type": "string", + "description": "Number of clicks that the advertiser is targeting.", + "format": "int64" + }, + "targetConversions": { + "type": "string", + "description": "Number of conversions that the advertiser is targeting.", + "format": "int64" + }, + "targetCpaNanos": { + "type": "string", + "description": "CPA that the advertiser is targeting.", + "format": "int64" + }, + "targetCpcNanos": { + "type": "string", + "description": "CPC that the advertiser is targeting.", + "format": "int64" + }, + "targetCpmNanos": { + "type": "string", + "description": "CPM that the advertiser is targeting.", + "format": "int64" + }, + "targetImpressions": { + "type": "string", + "description": "Number of impressions that the advertiser is targeting.", + "format": "int64" + } + } + }, + "ProjectsListResponse": { + "id": "ProjectsListResponse", + "type": "object", + "description": "Project List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#projectsListResponse\".", + "default": "dfareporting#projectsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "projects": { + "type": "array", + "description": "Project collection.", + "items": { + "$ref": "Project" + } + } + } + }, + "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.", + "enum": [ + "ATTACHMENT", + "LINK" + ], + "enumDescriptions": [ + "", + "" + ], + "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" + } + } + }, + "Region": { + "id": "Region", + "type": "object", + "description": "Contains information about a region that can be targeted by ads.", + "properties": { + "countryCode": { + "type": "string", + "description": "Country code of the country to which this region belongs." + }, + "countryDartId": { + "type": "string", + "description": "DART ID of the country to which this region belongs.", + "format": "int64" + }, + "dartId": { + "type": "string", + "description": "DART ID of this region.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#region\".", + "default": "dfareporting#region" + }, + "name": { + "type": "string", + "description": "Name of this region." + }, + "regionCode": { + "type": "string", + "description": "Region code." + } + } + }, + "RegionsListResponse": { + "id": "RegionsListResponse", + "type": "object", + "description": "Region List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#regionsListResponse\".", + "default": "dfareporting#regionsListResponse" + }, + "regions": { + "type": "array", + "description": "Region collection.", + "items": { + "$ref": "Region" + } + } + } + }, + "RemarketingList": { + "id": "RemarketingList", + "type": "object", + "description": "Contains properties of a remarketing list. Remarketing enables you to create lists of users who have performed specific actions on a site, then target ads to members of those lists. This resource can be used to manage remarketing lists that are owned by your advertisers. To see all remarketing lists that are visible to your advertisers, including those that are shared to your advertiser or account, use the TargetableRemarketingLists resource.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this remarketing list. This is a read-only, auto-generated field that is only returned in GET requests.", + "format": "int64" + }, + "active": { + "type": "boolean", + "description": "Whether this remarketing list is active." + }, + "advertiserId": { + "type": "string", + "description": "Dimension value for the advertiser ID that owns this remarketing list. This is a required field.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "description": { + "type": "string", + "description": "Remarketing list description." + }, + "id": { + "type": "string", + "description": "Remarketing list ID. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#remarketingList\".", + "default": "dfareporting#remarketingList" + }, + "lifeSpan": { + "type": "string", + "description": "Number of days that a user should remain in the remarketing list without an impression.", + "format": "int64" + }, + "listPopulationRule": { + "$ref": "ListPopulationRule", + "description": "Rule used to populate the remarketing list with users." + }, + "listSize": { + "type": "string", + "description": "Number of users currently in the list. This is a read-only field.", + "format": "int64" + }, + "listSource": { + "type": "string", + "description": "Product from which this remarketing list was originated.", + "enum": [ + "REMARKETING_LIST_SOURCE_DBM", + "REMARKETING_LIST_SOURCE_DFA", + "REMARKETING_LIST_SOURCE_DMP", + "REMARKETING_LIST_SOURCE_GA", + "REMARKETING_LIST_SOURCE_OTHER" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "name": { + "type": "string", + "description": "Name of the remarketing list. This is a required field. Must be no greater than 128 characters long." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this remarketing list. This is a read-only, auto-generated field that is only returned in GET requests.", + "format": "int64" + } + } + }, + "RemarketingListShare": { + "id": "RemarketingListShare", + "type": "object", + "description": "Contains properties of a remarketing list's sharing information. Sharing allows other accounts or advertisers to target to your remarketing lists. This resource can be used to manage remarketing list sharing to other accounts and advertisers.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#remarketingListShare\".", + "default": "dfareporting#remarketingListShare" + }, + "remarketingListId": { + "type": "string", + "description": "Remarketing list ID. This is a read-only, auto-generated field.", + "format": "int64" + }, + "sharedAccountIds": { + "type": "array", + "description": "Accounts that the remarketing list is shared with.", + "items": { + "type": "string", + "format": "int64" + } + }, + "sharedAdvertiserIds": { + "type": "array", + "description": "Advertisers that the remarketing list is shared with.", + "items": { + "type": "string", + "format": "int64" + } + } + } + }, + "RemarketingListsListResponse": { + "id": "RemarketingListsListResponse", + "type": "object", + "description": "Remarketing list response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#remarketingListsListResponse\".", + "default": "dfareporting#remarketingListsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "remarketingLists": { + "type": "array", + "description": "Remarketing list collection.", + "items": { + "$ref": "RemarketingList" + } + } + } + }, + "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" + ] + } + }, + "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.", + "enum": [ + "ADVERTISER", + "CAMPAIGN", + "SITE_BY_ADVERTISER", + "SITE_BY_CAMPAIGN" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "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.", + "enum": [ + "ATTACHMENT", + "LINK" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "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 filename 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. 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.", + "enum": [ + "CSV", + "EXCEL" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "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" + } + }, + "enableAllDimensionCombinations": { + "type": "boolean", + "description": "Whether to enable all reach dimension combinations in the report. Defaults to false. If enabled, the date range of the report should be within the last three months." + }, + "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. Note: \n- \"DAILY\" also requires field \"every\" to be set. \n- \"WEEKLY\" also requires fields \"every\" and \"repeatsOnWeekDays\" to be set. \n- \"MONTHLY\" also requires fields \"every\" and \"runsOnDayOfMonth\" to be set.", + "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", + "enum": [ + "FRIDAY", + "MONDAY", + "SATURDAY", + "SUNDAY", + "THURSDAY", + "TUESDAY", + "WEDNESDAY" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "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.\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.", + "enum": [ + "DAY_OF_MONTH", + "WEEK_OF_MONTH" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "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 subaccount ID to which this report belongs if applicable.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "The type of the report.", + "enum": [ + "CROSS_DIMENSION_REACH", + "FLOODLIGHT", + "PATH_TO_CONVERSION", + "REACH", + "STANDARD" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ], + "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." + } + } + }, + "ReportsConfiguration": { + "id": "ReportsConfiguration", + "type": "object", + "description": "Reporting Configuration", + "properties": { + "exposureToConversionEnabled": { + "type": "boolean", + "description": "Whether the exposure to conversion report is enabled. This report shows detailed pathway information on up to 10 of the most recent ad exposures seen by a user before converting." + }, + "lookbackConfiguration": { + "$ref": "LookbackConfiguration", + "description": "Default lookback windows for new advertisers in this account." + }, + "reportGenerationTimeZoneId": { + "type": "string", + "description": "Report generation time zone ID of this account. This is a required field that can only be changed by a superuser.\nAcceptable values are:\n\n- \"1\" for \"America/New_York\" \n- \"2\" for \"Europe/London\" \n- \"3\" for \"Europe/Paris\" \n- \"4\" for \"Africa/Johannesburg\" \n- \"5\" for \"Asia/Jerusalem\" \n- \"6\" for \"Asia/Shanghai\" \n- \"7\" for \"Asia/Hong_Kong\" \n- \"8\" for \"Asia/Tokyo\" \n- \"9\" for \"Australia/Sydney\" \n- \"10\" for \"Asia/Dubai\" \n- \"11\" for \"America/Los_Angeles\" \n- \"12\" for \"Pacific/Auckland\" \n- \"13\" for \"America/Sao_Paulo\"", + "format": "int64" + } + } + }, + "RichMediaExitOverride": { + "id": "RichMediaExitOverride", + "type": "object", + "description": "Rich Media Exit Override.", + "properties": { + "customExitUrl": { + "type": "string", + "description": "Click-through URL to override the default exit URL. Applicable if the useCustomExitUrl field is set to true." + }, + "exitId": { + "type": "string", + "description": "ID for the override to refer to a specific exit in the creative.", + "format": "int64" + }, + "useCustomExitUrl": { + "type": "boolean", + "description": "Whether to use the custom exit URL." + } + } + }, + "Site": { + "id": "Site", + "type": "object", + "description": "Contains properties of a site.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this site. This is a read-only field that can be left blank.", + "format": "int64" + }, + "approved": { + "type": "boolean", + "description": "Whether this site is approved." + }, + "directorySiteId": { + "type": "string", + "description": "Directory site associated with this site. This is a required field that is read-only after insertion.", + "format": "int64" + }, + "directorySiteIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the directory site. This is a read-only, auto-generated field." + }, + "id": { + "type": "string", + "description": "ID of this site. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this site. This is a read-only, auto-generated field." + }, + "keyName": { + "type": "string", + "description": "Key name of this site. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#site\".", + "default": "dfareporting#site" + }, + "name": { + "type": "string", + "description": "Name of this site.This is a required field. Must be less than 128 characters long. If this site is under a subaccount, the name must be unique among sites of the same subaccount. Otherwise, this site is a top-level site, and the name must be unique among top-level sites of the same account." + }, + "siteContacts": { + "type": "array", + "description": "Site contacts.", + "items": { + "$ref": "SiteContact" + } + }, + "siteSettings": { + "$ref": "SiteSettings", + "description": "Site-wide settings." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this site. This is a read-only field that can be left blank.", + "format": "int64" + } + } + }, + "SiteContact": { + "id": "SiteContact", + "type": "object", + "description": "Site Contact", + "properties": { + "address": { + "type": "string", + "description": "Address of this site contact." + }, + "contactType": { + "type": "string", + "description": "Site contact type.", + "enum": [ + "SALES_PERSON", + "TRAFFICKER" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "email": { + "type": "string", + "description": "Email address of this site contact. This is a required field." + }, + "firstName": { + "type": "string", + "description": "First name of this site contact." + }, + "id": { + "type": "string", + "description": "ID of this site contact. This is a read-only, auto-generated field.", + "format": "int64" + }, + "lastName": { + "type": "string", + "description": "Last name of this site contact." + }, + "phone": { + "type": "string", + "description": "Primary phone number of this site contact." + }, + "title": { + "type": "string", + "description": "Title or designation of this site contact." + } + } + }, + "SiteSettings": { + "id": "SiteSettings", + "type": "object", + "description": "Site Settings", + "properties": { + "activeViewOptOut": { + "type": "boolean", + "description": "Whether active view creatives are disabled for this site." + }, + "creativeSettings": { + "$ref": "CreativeSettings", + "description": "Site-wide creative settings." + }, + "disableBrandSafeAds": { + "type": "boolean", + "description": "Whether brand safe ads are disabled for this site." + }, + "disableNewCookie": { + "type": "boolean", + "description": "Whether new cookies are disabled for this site." + }, + "lookbackConfiguration": { + "$ref": "LookbackConfiguration", + "description": "Lookback window settings for this site." + }, + "tagSetting": { + "$ref": "TagSetting", + "description": "Configuration settings for dynamic and image floodlight tags." + } + } + }, + "SitesListResponse": { + "id": "SitesListResponse", + "type": "object", + "description": "Site List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#sitesListResponse\".", + "default": "dfareporting#sitesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "sites": { + "type": "array", + "description": "Site collection.", + "items": { + "$ref": "Site" + } + } + } + }, + "Size": { + "id": "Size", + "type": "object", + "description": "Represents the dimensions of ads, placements, creatives, or creative assets.", + "properties": { + "height": { + "type": "integer", + "description": "Height of this size.", + "format": "int32" + }, + "iab": { + "type": "boolean", + "description": "IAB standard size. This is a read-only, auto-generated field." + }, + "id": { + "type": "string", + "description": "ID of this size. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#size\".", + "default": "dfareporting#size" + }, + "width": { + "type": "integer", + "description": "Width of this size.", + "format": "int32" + } + } + }, + "SizesListResponse": { + "id": "SizesListResponse", + "type": "object", + "description": "Size List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#sizesListResponse\".", + "default": "dfareporting#sizesListResponse" + }, + "sizes": { + "type": "array", + "description": "Size collection.", + "items": { + "$ref": "Size" + } + } + } + }, + "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.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "Subaccount": { + "id": "Subaccount", + "type": "object", + "description": "Contains properties of a DCM subaccount.", + "properties": { + "accountId": { + "type": "string", + "description": "ID of the account that contains this subaccount. This is a read-only field that can be left blank.", + "format": "int64" + }, + "availablePermissionIds": { + "type": "array", + "description": "IDs of the available user role permissions for this subaccount.", + "items": { + "type": "string", + "format": "int64" + } + }, + "id": { + "type": "string", + "description": "ID of this subaccount. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#subaccount\".", + "default": "dfareporting#subaccount" + }, + "name": { + "type": "string", + "description": "Name of this subaccount. This is a required field. Must be less than 128 characters long and be unique among subaccounts of the same account." + } + } + }, + "SubaccountsListResponse": { + "id": "SubaccountsListResponse", + "type": "object", + "description": "Subaccount List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#subaccountsListResponse\".", + "default": "dfareporting#subaccountsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "subaccounts": { + "type": "array", + "description": "Subaccount collection.", + "items": { + "$ref": "Subaccount" + } + } + } + }, + "TagData": { + "id": "TagData", + "type": "object", + "description": "Placement Tag Data", + "properties": { + "adId": { + "type": "string", + "description": "Ad associated with this placement tag.", + "format": "int64" + }, + "clickTag": { + "type": "string", + "description": "Tag string to record a click." + }, + "creativeId": { + "type": "string", + "description": "Creative associated with this placement tag.", + "format": "int64" + }, + "format": { + "type": "string", + "description": "TagData tag format of this tag.", + "enum": [ + "PLACEMENT_TAG_CLICK_COMMANDS", + "PLACEMENT_TAG_IFRAME_ILAYER", + "PLACEMENT_TAG_IFRAME_JAVASCRIPT", + "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3", + "PLACEMENT_TAG_INTERNAL_REDIRECT", + "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT", + "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT", + "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT", + "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_JAVASCRIPT", + "PLACEMENT_TAG_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_STANDARD", + "PLACEMENT_TAG_TRACKING", + "PLACEMENT_TAG_TRACKING_IFRAME", + "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "impressionTag": { + "type": "string", + "description": "Tag string for serving an ad." + } + } + }, + "TagSetting": { + "id": "TagSetting", + "type": "object", + "description": "Tag Settings", + "properties": { + "additionalKeyValues": { + "type": "string", + "description": "Additional key-values to be included in tags. Each key-value pair must be of the form key=value, and pairs must be separated by a semicolon (;). Keys and values must not contain commas. For example, id=2;color=red is a valid value for this field." + }, + "includeClickThroughUrls": { + "type": "boolean", + "description": "Whether static landing page URLs should be included in the tags. This setting applies only to placements." + }, + "includeClickTracking": { + "type": "boolean", + "description": "Whether click-tracking string should be included in the tags." + }, + "keywordOption": { + "type": "string", + "description": "Option specifying how keywords are embedded in ad tags. This setting can be used to specify whether keyword placeholders are inserted in placement tags for this site. Publishers can then add keywords to those placeholders.", + "enum": [ + "GENERATE_SEPARATE_TAG_FOR_EACH_KEYWORD", + "IGNORE", + "PLACEHOLDER_WITH_LIST_OF_KEYWORDS" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "TagSettings": { + "id": "TagSettings", + "type": "object", + "description": "Dynamic and Image Tag Settings.", + "properties": { + "dynamicTagEnabled": { + "type": "boolean", + "description": "Whether dynamic floodlight tags are enabled." + }, + "imageTagEnabled": { + "type": "boolean", + "description": "Whether image tags are enabled." + } + } + }, + "TargetWindow": { + "id": "TargetWindow", + "type": "object", + "description": "Target Window.", + "properties": { + "customHtml": { + "type": "string", + "description": "User-entered value." + }, + "targetWindowOption": { + "type": "string", + "description": "Type of browser window for which the backup image of the flash creative can be displayed.", + "enum": [ + "CURRENT_WINDOW", + "CUSTOM", + "NEW_WINDOW" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "TargetableRemarketingList": { + "id": "TargetableRemarketingList", + "type": "object", + "description": "Contains properties of a targetable remarketing list. Remarketing enables you to create lists of users who have performed specific actions on a site, then target ads to members of those lists. This resource is a read-only view of a remarketing list to be used to faciliate targeting ads to specific lists. Remarketing lists that are owned by your advertisers and those that are shared to your advertisers or account are accessible via this resource. To manage remarketing lists that are owned by your advertisers, use the RemarketingLists resource.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this remarketing list. This is a read-only, auto-generated field that is only returned in GET requests.", + "format": "int64" + }, + "active": { + "type": "boolean", + "description": "Whether this targetable remarketing list is active." + }, + "advertiserId": { + "type": "string", + "description": "Dimension value for the advertiser ID that owns this targetable remarketing list.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser." + }, + "description": { + "type": "string", + "description": "Targetable remarketing list description." + }, + "id": { + "type": "string", + "description": "Targetable remarketing list ID.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#targetableRemarketingList\".", + "default": "dfareporting#targetableRemarketingList" + }, + "lifeSpan": { + "type": "string", + "description": "Number of days that a user should remain in the targetable remarketing list without an impression.", + "format": "int64" + }, + "listSize": { + "type": "string", + "description": "Number of users currently in the list. This is a read-only field.", + "format": "int64" + }, + "listSource": { + "type": "string", + "description": "Product from which this targetable remarketing list was originated.", + "enum": [ + "REMARKETING_LIST_SOURCE_DBM", + "REMARKETING_LIST_SOURCE_DFA", + "REMARKETING_LIST_SOURCE_DMP", + "REMARKETING_LIST_SOURCE_GA", + "REMARKETING_LIST_SOURCE_OTHER" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "name": { + "type": "string", + "description": "Name of the targetable remarketing list. Is no greater than 128 characters long." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this remarketing list. This is a read-only, auto-generated field that is only returned in GET requests.", + "format": "int64" + } + } + }, + "TargetableRemarketingListsListResponse": { + "id": "TargetableRemarketingListsListResponse", + "type": "object", + "description": "Targetable remarketing list response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#targetableRemarketingListsListResponse\".", + "default": "dfareporting#targetableRemarketingListsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "targetableRemarketingLists": { + "type": "array", + "description": "Targetable remarketing list collection.", + "items": { + "$ref": "TargetableRemarketingList" + } + } + } + }, + "TechnologyTargeting": { + "id": "TechnologyTargeting", + "type": "object", + "description": "Technology Targeting.", + "properties": { + "browsers": { + "type": "array", + "description": "Browsers that this ad targets. For each browser either set browserVersionId or dartId along with the version numbers. If both are specified, only browserVersionId will be used.The other fields are populated automatically when the ad is inserted or updated.", + "items": { + "$ref": "Browser" + } + }, + "connectionTypes": { + "type": "array", + "description": "Connection types that this ad targets. For each connection type only id is required.The other fields are populated automatically when the ad is inserted or updated.", + "items": { + "$ref": "ConnectionType" + } + }, + "mobileCarriers": { + "type": "array", + "description": "Mobile carriers that this ad targets. For each mobile carrier only id is required, and the other fields are populated automatically when the ad is inserted or updated. If targeting a mobile carrier, do not set targeting for any zip codes.", + "items": { + "$ref": "MobileCarrier" + } + }, + "operatingSystemVersions": { + "type": "array", + "description": "Operating system versions that this ad targets. To target all versions, use operatingSystems. For each operating system version, only id is required. The other fields are populated automatically when the ad is inserted or updated. If targeting an operating system version, do not set targeting for the corresponding operating system in operatingSystems.", + "items": { + "$ref": "OperatingSystemVersion" + } + }, + "operatingSystems": { + "type": "array", + "description": "Operating systems that this ad targets. To target specific versions, use operatingSystemVersions. For each operating system only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting an operating system, do not set targeting for operating system versions for the same operating system.", + "items": { + "$ref": "OperatingSystem" + } + }, + "platformTypes": { + "type": "array", + "description": "Platform types that this ad targets. For example, desktop, mobile, or tablet. For each platform type, only id is required, and the other fields are populated automatically when the ad is inserted or updated.", + "items": { + "$ref": "PlatformType" + } + } + } + }, + "ThirdPartyTrackingUrl": { + "id": "ThirdPartyTrackingUrl", + "type": "object", + "description": "Third-party Tracking URL.", + "properties": { + "thirdPartyUrlType": { + "type": "string", + "description": "Third-party URL type for in-stream video creatives.", + "enum": [ + "CLICK_TRACKING", + "IMPRESSION", + "RICH_MEDIA_BACKUP_IMPRESSION", + "RICH_MEDIA_IMPRESSION", + "RICH_MEDIA_RM_IMPRESSION", + "SURVEY", + "VIDEO_COMPLETE", + "VIDEO_CUSTOM", + "VIDEO_FIRST_QUARTILE", + "VIDEO_FULLSCREEN", + "VIDEO_MIDPOINT", + "VIDEO_MUTE", + "VIDEO_PAUSE", + "VIDEO_REWIND", + "VIDEO_START", + "VIDEO_STOP", + "VIDEO_THIRD_QUARTILE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "url": { + "type": "string", + "description": "URL for the specified third-party URL type." + } + } + }, + "UserDefinedVariableConfiguration": { + "id": "UserDefinedVariableConfiguration", + "type": "object", + "description": "User Defined Variable configuration.", + "properties": { + "dataType": { + "type": "string", + "description": "Data type for the variable. This is a required field.", + "enum": [ + "NUMBER", + "STRING" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "reportName": { + "type": "string", + "description": "User-friendly name for the variable which will appear in reports. This is a required field, must be less than 64 characters long, and cannot contain the following characters: \"\"\u003c\u003e\"." + }, + "variableType": { + "type": "string", + "description": "Variable name in the tag. This is a required field.", + "enum": [ + "U1", + "U10", + "U11", + "U12", + "U13", + "U14", + "U15", + "U16", + "U17", + "U18", + "U19", + "U2", + "U20", + "U3", + "U4", + "U5", + "U6", + "U7", + "U8", + "U9" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "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" + } + } + }, + "UserRole": { + "id": "UserRole", + "type": "object", + "description": "Contains properties of auser role, which is used to manage user access.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this user role. This is a read-only field that can be left blank.", + "format": "int64" + }, + "defaultUserRole": { + "type": "boolean", + "description": "Whether this is a default user role. Default user roles are created by the system for the account/subaccount and cannot be modified or deleted. Each default user role comes with a basic set of preassigned permissions." + }, + "id": { + "type": "string", + "description": "ID of this user role. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#userRole\".", + "default": "dfareporting#userRole" + }, + "name": { + "type": "string", + "description": "Name of this user role. This is a required field. Must be less than 256 characters long. If this user role is under a subaccount, the name must be unique among sites of the same subaccount. Otherwise, this user role is a top-level user role, and the name must be unique among top-level user roles of the same account." + }, + "parentUserRoleId": { + "type": "string", + "description": "ID of the user role that this user role is based on or copied from. This is a required field.", + "format": "int64" + }, + "permissions": { + "type": "array", + "description": "List of permissions associated with this user role.", + "items": { + "$ref": "UserRolePermission" + } + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this user role. This is a read-only field that can be left blank.", + "format": "int64" + } + } + }, + "UserRolePermission": { + "id": "UserRolePermission", + "type": "object", + "description": "Contains properties of a user role permission.", + "properties": { + "availability": { + "type": "string", + "description": "Levels of availability for a user role permission.", + "enum": [ + "ACCOUNT_ALWAYS", + "ACCOUNT_BY_DEFAULT", + "NOT_AVAILABLE_BY_DEFAULT", + "SUBACCOUNT_AND_ACCOUNT_ALWAYS", + "SUBACCOUNT_AND_ACCOUNT_BY_DEFAULT" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "id": { + "type": "string", + "description": "ID of this user role permission.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#userRolePermission\".", + "default": "dfareporting#userRolePermission" + }, + "name": { + "type": "string", + "description": "Name of this user role permission." + }, + "permissionGroupId": { + "type": "string", + "description": "ID of the permission group that this user role permission belongs to.", + "format": "int64" + } + } + }, + "UserRolePermissionGroup": { + "id": "UserRolePermissionGroup", + "type": "object", + "description": "Represents a grouping of related user role permissions.", + "properties": { + "id": { + "type": "string", + "description": "ID of this user role permission.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#userRolePermissionGroup\".", + "default": "dfareporting#userRolePermissionGroup" + }, + "name": { + "type": "string", + "description": "Name of this user role permission group." + } + } + }, + "UserRolePermissionGroupsListResponse": { + "id": "UserRolePermissionGroupsListResponse", + "type": "object", + "description": "User Role Permission Group List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#userRolePermissionGroupsListResponse\".", + "default": "dfareporting#userRolePermissionGroupsListResponse" + }, + "userRolePermissionGroups": { + "type": "array", + "description": "User role permission group collection.", + "items": { + "$ref": "UserRolePermissionGroup" + } + } + } + }, + "UserRolePermissionsListResponse": { + "id": "UserRolePermissionsListResponse", + "type": "object", + "description": "User Role Permission List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#userRolePermissionsListResponse\".", + "default": "dfareporting#userRolePermissionsListResponse" + }, + "userRolePermissions": { + "type": "array", + "description": "User role permission collection.", + "items": { + "$ref": "UserRolePermission" + } + } + } + }, + "UserRolesListResponse": { + "id": "UserRolesListResponse", + "type": "object", + "description": "User Role List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#userRolesListResponse\".", + "default": "dfareporting#userRolesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "userRoles": { + "type": "array", + "description": "User role collection.", + "items": { + "$ref": "UserRole" + } + } + } + } + }, + "resources": { + "accountActiveAdSummaries": { + "methods": { + "get": { + "id": "dfareporting.accountActiveAdSummaries.get", + "path": "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}", + "httpMethod": "GET", + "description": "Gets the account's active ad summary by account ID.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "summaryAccountId": { + "type": "string", + "description": "Account ID.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "summaryAccountId" + ], + "response": { + "$ref": "AccountActiveAdSummary" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "accountPermissionGroups": { + "methods": { + "get": { + "id": "dfareporting.accountPermissionGroups.get", + "path": "userprofiles/{profileId}/accountPermissionGroups/{id}", + "httpMethod": "GET", + "description": "Gets one account permission group by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Account permission group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "AccountPermissionGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.accountPermissionGroups.list", + "path": "userprofiles/{profileId}/accountPermissionGroups", + "httpMethod": "GET", + "description": "Retrieves the list of account permission groups.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AccountPermissionGroupsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "accountPermissions": { + "methods": { + "get": { + "id": "dfareporting.accountPermissions.get", + "path": "userprofiles/{profileId}/accountPermissions/{id}", + "httpMethod": "GET", + "description": "Gets one account permission by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Account permission ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "AccountPermission" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.accountPermissions.list", + "path": "userprofiles/{profileId}/accountPermissions", + "httpMethod": "GET", + "description": "Retrieves the list of account permissions.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AccountPermissionsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "accountUserProfiles": { + "methods": { + "get": { + "id": "dfareporting.accountUserProfiles.get", + "path": "userprofiles/{profileId}/accountUserProfiles/{id}", + "httpMethod": "GET", + "description": "Gets one account user profile by ID.", + "parameters": { + "id": { + "type": "string", + "description": "User profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "AccountUserProfile" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.accountUserProfiles.insert", + "path": "userprofiles/{profileId}/accountUserProfiles", + "httpMethod": "POST", + "description": "Inserts a new account user profile.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "AccountUserProfile" + }, + "response": { + "$ref": "AccountUserProfile" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.accountUserProfiles.list", + "path": "userprofiles/{profileId}/accountUserProfiles", + "httpMethod": "GET", + "description": "Retrieves a list of account user profiles, possibly filtered.", + "parameters": { + "active": { + "type": "boolean", + "description": "Select only active user profiles.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only user profiles with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, \"user profile*2015\" will return objects with names like \"user profile June 2015\", \"user profile April 2015\", or simply \"user profile 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"user profile\" will match objects with name \"my user profile\", \"user profile 2015\", or simply \"user profile\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "subaccountId": { + "type": "string", + "description": "Select only user profiles with the specified subaccount ID.", + "format": "int64", + "location": "query" + }, + "userRoleId": { + "type": "string", + "description": "Select only user profiles with the specified user role ID.", + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AccountUserProfilesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.accountUserProfiles.patch", + "path": "userprofiles/{profileId}/accountUserProfiles", + "httpMethod": "PATCH", + "description": "Updates an existing account user profile. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "User profile ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "AccountUserProfile" + }, + "response": { + "$ref": "AccountUserProfile" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.accountUserProfiles.update", + "path": "userprofiles/{profileId}/accountUserProfiles", + "httpMethod": "PUT", + "description": "Updates an existing account user profile.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "AccountUserProfile" + }, + "response": { + "$ref": "AccountUserProfile" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "accounts": { + "methods": { + "get": { + "id": "dfareporting.accounts.get", + "path": "userprofiles/{profileId}/accounts/{id}", + "httpMethod": "GET", + "description": "Gets one account by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Account ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.accounts.list", + "path": "userprofiles/{profileId}/accounts", + "httpMethod": "GET", + "description": "Retrieves the list of accounts, possibly filtered.", + "parameters": { + "active": { + "type": "boolean", + "description": "Select only active accounts. Don't set this field to select both active and non-active accounts.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only accounts with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"account*2015\" will return objects with names like \"account June 2015\", \"account April 2015\", or simply \"account 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"account\" will match objects with name \"my account\", \"account 2015\", or simply \"account\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AccountsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.accounts.patch", + "path": "userprofiles/{profileId}/accounts", + "httpMethod": "PATCH", + "description": "Updates an existing account. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Account ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Account" + }, + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.accounts.update", + "path": "userprofiles/{profileId}/accounts", + "httpMethod": "PUT", + "description": "Updates an existing account.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Account" + }, + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "ads": { + "methods": { + "get": { + "id": "dfareporting.ads.get", + "path": "userprofiles/{profileId}/ads/{id}", + "httpMethod": "GET", + "description": "Gets one ad by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Ad ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Ad" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.ads.insert", + "path": "userprofiles/{profileId}/ads", + "httpMethod": "POST", + "description": "Inserts a new ad.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Ad" + }, + "response": { + "$ref": "Ad" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.ads.list", + "path": "userprofiles/{profileId}/ads", + "httpMethod": "GET", + "description": "Retrieves a list of ads, possibly filtered.", + "parameters": { + "active": { + "type": "boolean", + "description": "Select only active ads.", + "location": "query" + }, + "advertiserId": { + "type": "string", + "description": "Select only ads with this advertiser ID.", + "format": "int64", + "location": "query" + }, + "archived": { + "type": "boolean", + "description": "Select only archived ads.", + "location": "query" + }, + "audienceSegmentIds": { + "type": "string", + "description": "Select only ads with these audience segment IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "campaignIds": { + "type": "string", + "description": "Select only ads with these campaign IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "compatibility": { + "type": "string", + "description": "Select default ads with the specified compatibility. Applicable when type is AD_SERVING_DEFAULT_AD. WEB and WEB_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering an in-stream video ads developed with the VAST standard.", + "enum": [ + "APP", + "APP_INTERSTITIAL", + "IN_STREAM_VIDEO", + "WEB", + "WEB_INTERSTITIAL" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ], + "location": "query" + }, + "creativeIds": { + "type": "string", + "description": "Select only ads with these creative IDs assigned.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "creativeOptimizationConfigurationIds": { + "type": "string", + "description": "Select only ads with these creative optimization configuration IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "creativeType": { + "type": "string", + "description": "Select only ads with the specified creativeType.", + "enum": [ + "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO", + "CUSTOM_INPAGE", + "CUSTOM_INTERSTITIAL", + "ENHANCED_BANNER", + "ENHANCED_IMAGE", + "FLASH_INPAGE", + "HTML5_BANNER", + "IMAGE", + "INSTREAM_VIDEO", + "INTERNAL_REDIRECT", + "INTERSTITIAL_INTERNAL_REDIRECT", + "REDIRECT", + "RICH_MEDIA_EXPANDING", + "RICH_MEDIA_IM_EXPAND", + "RICH_MEDIA_INPAGE", + "RICH_MEDIA_INPAGE_FLOATING", + "RICH_MEDIA_INTERSTITIAL_FLOAT", + "RICH_MEDIA_MOBILE_IN_APP", + "RICH_MEDIA_MULTI_FLOATING", + "RICH_MEDIA_PEEL_DOWN", + "TRACKING_TEXT", + "VAST_REDIRECT", + "VPAID_LINEAR", + "VPAID_NON_LINEAR" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "location": "query" + }, + "dynamicClickTracker": { + "type": "boolean", + "description": "Select only dynamic click trackers. Applicable when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click trackers. If false, select static click trackers. Leave unset to select both.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only ads with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "landingPageIds": { + "type": "string", + "description": "Select only ads with these landing page IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "overriddenEventTagId": { + "type": "string", + "description": "Select only ads with this event tag override ID.", + "format": "int64", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "placementIds": { + "type": "string", + "description": "Select only ads with these placement IDs assigned.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "remarketingListIds": { + "type": "string", + "description": "Select only ads whose list targeting expression use these remarketing list IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"ad*2015\" will return objects with names like \"ad June 2015\", \"ad April 2015\", or simply \"ad 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"ad\" will match objects with name \"my ad\", \"ad 2015\", or simply \"ad\".", + "location": "query" + }, + "sizeIds": { + "type": "string", + "description": "Select only ads with these size IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sslCompliant": { + "type": "boolean", + "description": "Select only ads that are SSL-compliant.", + "location": "query" + }, + "sslRequired": { + "type": "boolean", + "description": "Select only ads that require SSL.", + "location": "query" + }, + "type": { + "type": "string", + "description": "Select only ads with these types.", + "enum": [ + "AD_SERVING_CLICK_TRACKER", + "AD_SERVING_DEFAULT_AD", + "AD_SERVING_STANDARD_AD", + "AD_SERVING_TRACKING" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AdsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.ads.patch", + "path": "userprofiles/{profileId}/ads", + "httpMethod": "PATCH", + "description": "Updates an existing ad. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Ad ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Ad" + }, + "response": { + "$ref": "Ad" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.ads.update", + "path": "userprofiles/{profileId}/ads", + "httpMethod": "PUT", + "description": "Updates an existing ad.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Ad" + }, + "response": { + "$ref": "Ad" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "advertiserGroups": { + "methods": { + "delete": { + "id": "dfareporting.advertiserGroups.delete", + "path": "userprofiles/{profileId}/advertiserGroups/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing advertiser group.", + "parameters": { + "id": { + "type": "string", + "description": "Advertiser group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.advertiserGroups.get", + "path": "userprofiles/{profileId}/advertiserGroups/{id}", + "httpMethod": "GET", + "description": "Gets one advertiser group by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Advertiser group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "AdvertiserGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.advertiserGroups.insert", + "path": "userprofiles/{profileId}/advertiserGroups", + "httpMethod": "POST", + "description": "Inserts a new advertiser group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "AdvertiserGroup" + }, + "response": { + "$ref": "AdvertiserGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.advertiserGroups.list", + "path": "userprofiles/{profileId}/advertiserGroups", + "httpMethod": "GET", + "description": "Retrieves a list of advertiser groups, possibly filtered.", + "parameters": { + "ids": { + "type": "string", + "description": "Select only advertiser groups with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"advertiser*2015\" will return objects with names like \"advertiser group June 2015\", \"advertiser group April 2015\", or simply \"advertiser group 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"advertisergroup\" will match objects with name \"my advertisergroup\", \"advertisergroup 2015\", or simply \"advertisergroup\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AdvertiserGroupsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.advertiserGroups.patch", + "path": "userprofiles/{profileId}/advertiserGroups", + "httpMethod": "PATCH", + "description": "Updates an existing advertiser group. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Advertiser group ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "AdvertiserGroup" + }, + "response": { + "$ref": "AdvertiserGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.advertiserGroups.update", + "path": "userprofiles/{profileId}/advertiserGroups", + "httpMethod": "PUT", + "description": "Updates an existing advertiser group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "AdvertiserGroup" + }, + "response": { + "$ref": "AdvertiserGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "advertisers": { + "methods": { + "get": { + "id": "dfareporting.advertisers.get", + "path": "userprofiles/{profileId}/advertisers/{id}", + "httpMethod": "GET", + "description": "Gets one advertiser by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Advertiser ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Advertiser" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.advertisers.insert", + "path": "userprofiles/{profileId}/advertisers", + "httpMethod": "POST", + "description": "Inserts a new advertiser.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Advertiser" + }, + "response": { + "$ref": "Advertiser" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.advertisers.list", + "path": "userprofiles/{profileId}/advertisers", + "httpMethod": "GET", + "description": "Retrieves a list of advertisers, possibly filtered.", + "parameters": { + "advertiserGroupIds": { + "type": "string", + "description": "Select only advertisers with these advertiser group IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "floodlightConfigurationIds": { + "type": "string", + "description": "Select only advertisers with these floodlight configuration IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only advertisers with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "includeAdvertisersWithoutGroupsOnly": { + "type": "boolean", + "description": "Select only advertisers which do not belong to any advertiser group.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "onlyParent": { + "type": "boolean", + "description": "Select only advertisers which use another advertiser's floodlight configuration.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"advertiser*2015\" will return objects with names like \"advertiser June 2015\", \"advertiser April 2015\", or simply \"advertiser 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"advertiser\" will match objects with name \"my advertiser\", \"advertiser 2015\", or simply \"advertiser\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "status": { + "type": "string", + "description": "Select only advertisers with the specified status.", + "enum": [ + "APPROVED", + "ON_HOLD" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "subaccountId": { + "type": "string", + "description": "Select only advertisers with these subaccount IDs.", + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AdvertisersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.advertisers.patch", + "path": "userprofiles/{profileId}/advertisers", + "httpMethod": "PATCH", + "description": "Updates an existing advertiser. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Advertiser ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Advertiser" + }, + "response": { + "$ref": "Advertiser" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.advertisers.update", + "path": "userprofiles/{profileId}/advertisers", + "httpMethod": "PUT", + "description": "Updates an existing advertiser.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Advertiser" + }, + "response": { + "$ref": "Advertiser" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "browsers": { + "methods": { + "list": { + "id": "dfareporting.browsers.list", + "path": "userprofiles/{profileId}/browsers", + "httpMethod": "GET", + "description": "Retrieves a list of browsers.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "BrowsersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "campaignCreativeAssociations": { + "methods": { + "insert": { + "id": "dfareporting.campaignCreativeAssociations.insert", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations", + "httpMethod": "POST", + "description": "Associates a creative with the specified campaign. This method creates a default ad with dimensions matching the creative in the campaign if such a default ad does not exist already.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Campaign ID in this association.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId" + ], + "request": { + "$ref": "CampaignCreativeAssociation" + }, + "response": { + "$ref": "CampaignCreativeAssociation" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.campaignCreativeAssociations.list", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations", + "httpMethod": "GET", + "description": "Retrieves the list of creative IDs associated with the specified campaign.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Campaign ID in this association.", + "required": true, + "format": "int64", + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "campaignId" + ], + "response": { + "$ref": "CampaignCreativeAssociationsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "campaigns": { + "methods": { + "get": { + "id": "dfareporting.campaigns.get", + "path": "userprofiles/{profileId}/campaigns/{id}", + "httpMethod": "GET", + "description": "Gets one campaign by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Campaign" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.campaigns.insert", + "path": "userprofiles/{profileId}/campaigns", + "httpMethod": "POST", + "description": "Inserts a new campaign.", + "parameters": { + "defaultLandingPageName": { + "type": "string", + "description": "Default landing page name for this new campaign. Must be less than 256 characters long.", + "required": true, + "location": "query" + }, + "defaultLandingPageUrl": { + "type": "string", + "description": "Default landing page URL for this new campaign.", + "required": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "defaultLandingPageName", + "defaultLandingPageUrl" + ], + "request": { + "$ref": "Campaign" + }, + "response": { + "$ref": "Campaign" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.campaigns.list", + "path": "userprofiles/{profileId}/campaigns", + "httpMethod": "GET", + "description": "Retrieves a list of campaigns, possibly filtered.", + "parameters": { + "advertiserGroupIds": { + "type": "string", + "description": "Select only campaigns whose advertisers belong to these advertiser groups.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "advertiserIds": { + "type": "string", + "description": "Select only campaigns that belong to these advertisers.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "archived": { + "type": "boolean", + "description": "Select only archived campaigns. Don't set this field to select both archived and non-archived campaigns.", + "location": "query" + }, + "atLeastOneOptimizationActivity": { + "type": "boolean", + "description": "Select only campaigns that have at least one optimization activity.", + "location": "query" + }, + "excludedIds": { + "type": "string", + "description": "Exclude campaigns with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only campaigns with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "overriddenEventTagId": { + "type": "string", + "description": "Select only campaigns that have overridden this event tag ID.", + "format": "int64", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for campaigns by name or ID. Wildcards (*) are allowed. For example, \"campaign*2015\" will return campaigns with names like \"campaign June 2015\", \"campaign April 2015\", or simply \"campaign 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"campaign\" will match campaigns with name \"my campaign\", \"campaign 2015\", or simply \"campaign\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "subaccountId": { + "type": "string", + "description": "Select only campaigns that belong to this subaccount.", + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "CampaignsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.campaigns.patch", + "path": "userprofiles/{profileId}/campaigns", + "httpMethod": "PATCH", + "description": "Updates an existing campaign. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Campaign ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Campaign" + }, + "response": { + "$ref": "Campaign" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.campaigns.update", + "path": "userprofiles/{profileId}/campaigns", + "httpMethod": "PUT", + "description": "Updates an existing campaign.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Campaign" + }, + "response": { + "$ref": "Campaign" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "changeLogs": { + "methods": { + "get": { + "id": "dfareporting.changeLogs.get", + "path": "userprofiles/{profileId}/changeLogs/{id}", + "httpMethod": "GET", + "description": "Gets one change log by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Change log ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "ChangeLog" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.changeLogs.list", + "path": "userprofiles/{profileId}/changeLogs", + "httpMethod": "GET", + "description": "Retrieves a list of change logs.", + "parameters": { + "action": { + "type": "string", + "description": "Select only change logs with the specified action.", + "enum": [ + "ACTION_ADD", + "ACTION_ASSIGN", + "ACTION_ASSOCIATE", + "ACTION_CREATE", + "ACTION_DELETE", + "ACTION_DISABLE", + "ACTION_EMAIL_TAGS", + "ACTION_ENABLE", + "ACTION_LINK", + "ACTION_MARK_AS_DEFAULT", + "ACTION_PUSH", + "ACTION_REMOVE", + "ACTION_SEND", + "ACTION_SHARE", + "ACTION_UNASSIGN", + "ACTION_UNLINK", + "ACTION_UPDATE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only change logs with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxChangeTime": { + "type": "string", + "description": "Select only change logs whose change time is before the specified maxChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is \"2015-07-18T22:54:00-04:00\". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "minChangeTime": { + "type": "string", + "description": "Select only change logs whose change time is before the specified minChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is \"2015-07-18T22:54:00-04:00\". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset.", + "location": "query" + }, + "objectIds": { + "type": "string", + "description": "Select only change logs with these object IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "objectType": { + "type": "string", + "description": "Select only change logs with the specified object type.", + "enum": [ + "OBJECT_ACCOUNT", + "OBJECT_ACCOUNT_BILLING_FEATURE", + "OBJECT_AD", + "OBJECT_ADVERTISER", + "OBJECT_ADVERTISER_GROUP", + "OBJECT_BILLING_ACCOUNT_GROUP", + "OBJECT_BILLING_FEATURE", + "OBJECT_BILLING_MINIMUM_FEE", + "OBJECT_BILLING_PROFILE", + "OBJECT_CAMPAIGN", + "OBJECT_CONTENT_CATEGORY", + "OBJECT_CREATIVE", + "OBJECT_CREATIVE_ASSET", + "OBJECT_CREATIVE_BUNDLE", + "OBJECT_CREATIVE_FIELD", + "OBJECT_CREATIVE_GROUP", + "OBJECT_DFA_SITE", + "OBJECT_EVENT_TAG", + "OBJECT_FLOODLIGHT_ACTIVITY_GROUP", + "OBJECT_FLOODLIGHT_ACTVITY", + "OBJECT_FLOODLIGHT_CONFIGURATION", + "OBJECT_INSTREAM_CREATIVE", + "OBJECT_LANDING_PAGE", + "OBJECT_MEDIA_ORDER", + "OBJECT_PLACEMENT", + "OBJECT_PLACEMENT_STRATEGY", + "OBJECT_PROVIDED_LIST_CLIENT", + "OBJECT_RATE_CARD", + "OBJECT_REMARKETING_LIST", + "OBJECT_RICHMEDIA_CREATIVE", + "OBJECT_SD_SITE", + "OBJECT_SIZE", + "OBJECT_SUBACCOUNT", + "OBJECT_USER_PROFILE", + "OBJECT_USER_PROFILE_FILTER", + "OBJECT_USER_ROLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Select only change logs whose object ID, user name, old or new values match the search string.", + "location": "query" + }, + "userProfileIds": { + "type": "string", + "description": "Select only change logs with these user profile IDs.", + "format": "int64", + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "ChangeLogsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "cities": { + "methods": { + "list": { + "id": "dfareporting.cities.list", + "path": "userprofiles/{profileId}/cities", + "httpMethod": "GET", + "description": "Retrieves a list of cities, possibly filtered.", + "parameters": { + "countryDartIds": { + "type": "string", + "description": "Select only cities from these countries.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "dartIds": { + "type": "string", + "description": "Select only cities with these DART IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "namePrefix": { + "type": "string", + "description": "Select only cities with names starting with this prefix.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "regionDartIds": { + "type": "string", + "description": "Select only cities from these regions.", + "format": "int64", + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "CitiesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "connectionTypes": { + "methods": { + "get": { + "id": "dfareporting.connectionTypes.get", + "path": "userprofiles/{profileId}/connectionTypes/{id}", + "httpMethod": "GET", + "description": "Gets one connection type by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Connection type ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "ConnectionType" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.connectionTypes.list", + "path": "userprofiles/{profileId}/connectionTypes", + "httpMethod": "GET", + "description": "Retrieves a list of connection types.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "ConnectionTypesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "contentCategories": { + "methods": { + "delete": { + "id": "dfareporting.contentCategories.delete", + "path": "userprofiles/{profileId}/contentCategories/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing content category.", + "parameters": { + "id": { + "type": "string", + "description": "Content category ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.contentCategories.get", + "path": "userprofiles/{profileId}/contentCategories/{id}", + "httpMethod": "GET", + "description": "Gets one content category by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Content category ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "ContentCategory" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.contentCategories.insert", + "path": "userprofiles/{profileId}/contentCategories", + "httpMethod": "POST", + "description": "Inserts a new content category.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "ContentCategory" + }, + "response": { + "$ref": "ContentCategory" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.contentCategories.list", + "path": "userprofiles/{profileId}/contentCategories", + "httpMethod": "GET", + "description": "Retrieves a list of content categories, possibly filtered.", + "parameters": { + "ids": { + "type": "string", + "description": "Select only content categories with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"contentcategory*2015\" will return objects with names like \"contentcategory June 2015\", \"contentcategory April 2015\", or simply \"contentcategory 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"contentcategory\" will match objects with name \"my contentcategory\", \"contentcategory 2015\", or simply \"contentcategory\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "ContentCategoriesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.contentCategories.patch", + "path": "userprofiles/{profileId}/contentCategories", + "httpMethod": "PATCH", + "description": "Updates an existing content category. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Content category ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "ContentCategory" + }, + "response": { + "$ref": "ContentCategory" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.contentCategories.update", + "path": "userprofiles/{profileId}/contentCategories", + "httpMethod": "PUT", + "description": "Updates an existing content category.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "ContentCategory" + }, + "response": { + "$ref": "ContentCategory" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "countries": { + "methods": { + "get": { + "id": "dfareporting.countries.get", + "path": "userprofiles/{profileId}/countries/{dartId}", + "httpMethod": "GET", + "description": "Gets one country by ID.", + "parameters": { + "dartId": { + "type": "string", + "description": "Country DART ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "dartId" + ], + "response": { + "$ref": "Country" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.countries.list", + "path": "userprofiles/{profileId}/countries", + "httpMethod": "GET", + "description": "Retrieves a list of countries.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "CountriesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "creativeAssets": { + "methods": { + "insert": { + "id": "dfareporting.creativeAssets.insert", + "path": "userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets", + "httpMethod": "POST", + "description": "Inserts a new creative asset.", + "parameters": { + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this creative. This is a required field.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "advertiserId" + ], + "request": { + "$ref": "CreativeAssetMetadata" + }, + "response": { + "$ref": "CreativeAssetMetadata" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "*/*" + ], + "maxSize": "100MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/dfareporting/v2.1/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/dfareporting/v2.1/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets" + } + } + } + } + } + }, + "creativeFieldValues": { + "methods": { + "delete": { + "id": "dfareporting.creativeFieldValues.delete", + "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing creative field value.", + "parameters": { + "creativeFieldId": { + "type": "string", + "description": "Creative field ID for this creative field value.", + "required": true, + "format": "int64", + "location": "path" + }, + "id": { + "type": "string", + "description": "Creative Field Value ID", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "creativeFieldId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.creativeFieldValues.get", + "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}", + "httpMethod": "GET", + "description": "Gets one creative field value by ID.", + "parameters": { + "creativeFieldId": { + "type": "string", + "description": "Creative field ID for this creative field value.", + "required": true, + "format": "int64", + "location": "path" + }, + "id": { + "type": "string", + "description": "Creative Field Value ID", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "creativeFieldId", + "id" + ], + "response": { + "$ref": "CreativeFieldValue" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.creativeFieldValues.insert", + "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + "httpMethod": "POST", + "description": "Inserts a new creative field value.", + "parameters": { + "creativeFieldId": { + "type": "string", + "description": "Creative field ID for this creative field value.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "creativeFieldId" + ], + "request": { + "$ref": "CreativeFieldValue" + }, + "response": { + "$ref": "CreativeFieldValue" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.creativeFieldValues.list", + "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + "httpMethod": "GET", + "description": "Retrieves a list of creative field values, possibly filtered.", + "parameters": { + "creativeFieldId": { + "type": "string", + "description": "Creative field ID for this creative field value.", + "required": true, + "format": "int64", + "location": "path" + }, + "ids": { + "type": "string", + "description": "Select only creative field values with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for creative field values by their values. Wildcards (e.g. *) are not allowed.", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "VALUE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "creativeFieldId" + ], + "response": { + "$ref": "CreativeFieldValuesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.creativeFieldValues.patch", + "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + "httpMethod": "PATCH", + "description": "Updates an existing creative field value. This method supports patch semantics.", + "parameters": { + "creativeFieldId": { + "type": "string", + "description": "Creative field ID for this creative field value.", + "required": true, + "format": "int64", + "location": "path" + }, + "id": { + "type": "string", + "description": "Creative Field Value ID", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "creativeFieldId", + "id" + ], + "request": { + "$ref": "CreativeFieldValue" + }, + "response": { + "$ref": "CreativeFieldValue" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.creativeFieldValues.update", + "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + "httpMethod": "PUT", + "description": "Updates an existing creative field value.", + "parameters": { + "creativeFieldId": { + "type": "string", + "description": "Creative field ID for this creative field value.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "creativeFieldId" + ], + "request": { + "$ref": "CreativeFieldValue" + }, + "response": { + "$ref": "CreativeFieldValue" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "creativeFields": { + "methods": { + "delete": { + "id": "dfareporting.creativeFields.delete", + "path": "userprofiles/{profileId}/creativeFields/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing creative field.", + "parameters": { + "id": { + "type": "string", + "description": "Creative Field ID", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.creativeFields.get", + "path": "userprofiles/{profileId}/creativeFields/{id}", + "httpMethod": "GET", + "description": "Gets one creative field by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Creative Field ID", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "CreativeField" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.creativeFields.insert", + "path": "userprofiles/{profileId}/creativeFields", + "httpMethod": "POST", + "description": "Inserts a new creative field.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "CreativeField" + }, + "response": { + "$ref": "CreativeField" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.creativeFields.list", + "path": "userprofiles/{profileId}/creativeFields", + "httpMethod": "GET", + "description": "Retrieves a list of creative fields, possibly filtered.", + "parameters": { + "advertiserIds": { + "type": "string", + "description": "Select only creative fields that belong to these advertisers.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only creative fields with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for creative fields by name or ID. Wildcards (*) are allowed. For example, \"creativefield*2015\" will return creative fields with names like \"creativefield June 2015\", \"creativefield April 2015\", or simply \"creativefield 2015\". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of \"creativefield\" will match creative fields with the name \"my creativefield\", \"creativefield 2015\", or simply \"creativefield\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "CreativeFieldsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.creativeFields.patch", + "path": "userprofiles/{profileId}/creativeFields", + "httpMethod": "PATCH", + "description": "Updates an existing creative field. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Creative Field ID", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "CreativeField" + }, + "response": { + "$ref": "CreativeField" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.creativeFields.update", + "path": "userprofiles/{profileId}/creativeFields", + "httpMethod": "PUT", + "description": "Updates an existing creative field.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "CreativeField" + }, + "response": { + "$ref": "CreativeField" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "creativeGroups": { + "methods": { + "get": { + "id": "dfareporting.creativeGroups.get", + "path": "userprofiles/{profileId}/creativeGroups/{id}", + "httpMethod": "GET", + "description": "Gets one creative group by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Creative group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "CreativeGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.creativeGroups.insert", + "path": "userprofiles/{profileId}/creativeGroups", + "httpMethod": "POST", + "description": "Inserts a new creative group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "CreativeGroup" + }, + "response": { + "$ref": "CreativeGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.creativeGroups.list", + "path": "userprofiles/{profileId}/creativeGroups", + "httpMethod": "GET", + "description": "Retrieves a list of creative groups, possibly filtered.", + "parameters": { + "advertiserIds": { + "type": "string", + "description": "Select only creative groups that belong to these advertisers.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "groupNumber": { + "type": "integer", + "description": "Select only creative groups that belong to this subgroup.", + "format": "int32", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only creative groups with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for creative groups by name or ID. Wildcards (*) are allowed. For example, \"creativegroup*2015\" will return creative groups with names like \"creativegroup June 2015\", \"creativegroup April 2015\", or simply \"creativegroup 2015\". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of \"creativegroup\" will match creative groups with the name \"my creativegroup\", \"creativegroup 2015\", or simply \"creativegroup\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "CreativeGroupsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.creativeGroups.patch", + "path": "userprofiles/{profileId}/creativeGroups", + "httpMethod": "PATCH", + "description": "Updates an existing creative group. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Creative group ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "CreativeGroup" + }, + "response": { + "$ref": "CreativeGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.creativeGroups.update", + "path": "userprofiles/{profileId}/creativeGroups", + "httpMethod": "PUT", + "description": "Updates an existing creative group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "CreativeGroup" + }, + "response": { + "$ref": "CreativeGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "creatives": { + "methods": { + "get": { + "id": "dfareporting.creatives.get", + "path": "userprofiles/{profileId}/creatives/{id}", + "httpMethod": "GET", + "description": "Gets one creative by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Creative ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Creative" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.creatives.insert", + "path": "userprofiles/{profileId}/creatives", + "httpMethod": "POST", + "description": "Inserts a new creative.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Creative" + }, + "response": { + "$ref": "Creative" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.creatives.list", + "path": "userprofiles/{profileId}/creatives", + "httpMethod": "GET", + "description": "Retrieves a list of creatives, possibly filtered.", + "parameters": { + "active": { + "type": "boolean", + "description": "Select only active creatives. Leave blank to select active and inactive creatives.", + "location": "query" + }, + "advertiserId": { + "type": "string", + "description": "Select only creatives with this advertiser ID.", + "format": "int64", + "location": "query" + }, + "archived": { + "type": "boolean", + "description": "Select only archived creatives. Leave blank to select archived and unarchived creatives.", + "location": "query" + }, + "campaignId": { + "type": "string", + "description": "Select only creatives with this campaign ID.", + "format": "int64", + "location": "query" + }, + "companionCreativeIds": { + "type": "string", + "description": "Select only in-stream video creatives with these companion IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "creativeFieldIds": { + "type": "string", + "description": "Select only creatives with these creative field IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only creatives with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "renderingIds": { + "type": "string", + "description": "Select only creatives with these rendering IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"creative*2015\" will return objects with names like \"creative June 2015\", \"creative April 2015\", or simply \"creative 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"creative\" will match objects with name \"my creative\", \"creative 2015\", or simply \"creative\".", + "location": "query" + }, + "sizeIds": { + "type": "string", + "description": "Select only creatives with these size IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "studioCreativeId": { + "type": "string", + "description": "Select only creatives corresponding to this Studio creative ID.", + "format": "int64", + "location": "query" + }, + "types": { + "type": "string", + "description": "Select only creatives with these creative types.", + "enum": [ + "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO", + "CUSTOM_INPAGE", + "CUSTOM_INTERSTITIAL", + "ENHANCED_BANNER", + "ENHANCED_IMAGE", + "FLASH_INPAGE", + "HTML5_BANNER", + "IMAGE", + "INSTREAM_VIDEO", + "INTERNAL_REDIRECT", + "INTERSTITIAL_INTERNAL_REDIRECT", + "REDIRECT", + "RICH_MEDIA_EXPANDING", + "RICH_MEDIA_IM_EXPAND", + "RICH_MEDIA_INPAGE", + "RICH_MEDIA_INPAGE_FLOATING", + "RICH_MEDIA_INTERSTITIAL_FLOAT", + "RICH_MEDIA_MOBILE_IN_APP", + "RICH_MEDIA_MULTI_FLOATING", + "RICH_MEDIA_PEEL_DOWN", + "TRACKING_TEXT", + "VAST_REDIRECT", + "VPAID_LINEAR", + "VPAID_NON_LINEAR" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "CreativesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.creatives.patch", + "path": "userprofiles/{profileId}/creatives", + "httpMethod": "PATCH", + "description": "Updates an existing creative. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Creative ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Creative" + }, + "response": { + "$ref": "Creative" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.creatives.update", + "path": "userprofiles/{profileId}/creatives", + "httpMethod": "PUT", + "description": "Updates an existing creative.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Creative" + }, + "response": { + "$ref": "Creative" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "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" + ] + } + } + }, + "directorySiteContacts": { + "methods": { + "get": { + "id": "dfareporting.directorySiteContacts.get", + "path": "userprofiles/{profileId}/directorySiteContacts/{id}", + "httpMethod": "GET", + "description": "Gets one directory site contact by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Directory site contact ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "DirectorySiteContact" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.directorySiteContacts.list", + "path": "userprofiles/{profileId}/directorySiteContacts", + "httpMethod": "GET", + "description": "Retrieves a list of directory site contacts, possibly filtered.", + "parameters": { + "directorySiteIds": { + "type": "string", + "description": "Select only directory site contacts with these directory site IDs. This is a required field.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only directory site contacts with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, \"directory site contact*2015\" will return objects with names like \"directory site contact June 2015\", \"directory site contact April 2015\", or simply \"directory site contact 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"directory site contact\" will match objects with name \"my directory site contact\", \"directory site contact 2015\", or simply \"directory site contact\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "DirectorySiteContactsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "directorySites": { + "methods": { + "get": { + "id": "dfareporting.directorySites.get", + "path": "userprofiles/{profileId}/directorySites/{id}", + "httpMethod": "GET", + "description": "Gets one directory site by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Directory site ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "DirectorySite" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.directorySites.insert", + "path": "userprofiles/{profileId}/directorySites", + "httpMethod": "POST", + "description": "Inserts a new directory site.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "DirectorySite" + }, + "response": { + "$ref": "DirectorySite" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.directorySites.list", + "path": "userprofiles/{profileId}/directorySites", + "httpMethod": "GET", + "description": "Retrieves a list of directory sites, possibly filtered.", + "parameters": { + "acceptsInStreamVideoPlacements": { + "type": "boolean", + "description": "This search filter is no longer supported and will have no effect on the results returned.", + "location": "query" + }, + "acceptsInterstitialPlacements": { + "type": "boolean", + "description": "This search filter is no longer supported and will have no effect on the results returned.", + "location": "query" + }, + "acceptsPublisherPaidPlacements": { + "type": "boolean", + "description": "Select only directory sites that accept publisher paid placements. This field can be left blank.", + "location": "query" + }, + "active": { + "type": "boolean", + "description": "Select only active directory sites. Leave blank to retrieve both active and inactive directory sites.", + "location": "query" + }, + "countryId": { + "type": "string", + "description": "Select only directory sites with this country ID.", + "format": "int64", + "location": "query" + }, + "dfp_network_code": { + "type": "string", + "description": "Select only directory sites with this DFP network code.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only directory sites with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "parentId": { + "type": "string", + "description": "Select only directory sites with this parent ID.", + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name, ID or URL. Wildcards (*) are allowed. For example, \"directory site*2015\" will return objects with names like \"directory site June 2015\", \"directory site April 2015\", or simply \"directory site 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"directory site\" will match objects with name \"my directory site\", \"directory site 2015\" or simply, \"directory site\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "DirectorySitesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "eventTags": { + "methods": { + "delete": { + "id": "dfareporting.eventTags.delete", + "path": "userprofiles/{profileId}/eventTags/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing event tag.", + "parameters": { + "id": { + "type": "string", + "description": "Event tag ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.eventTags.get", + "path": "userprofiles/{profileId}/eventTags/{id}", + "httpMethod": "GET", + "description": "Gets one event tag by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Event tag ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "EventTag" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.eventTags.insert", + "path": "userprofiles/{profileId}/eventTags", + "httpMethod": "POST", + "description": "Inserts a new event tag.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "EventTag" + }, + "response": { + "$ref": "EventTag" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.eventTags.list", + "path": "userprofiles/{profileId}/eventTags", + "httpMethod": "GET", + "description": "Retrieves a list of event tags, possibly filtered.", + "parameters": { + "adId": { + "type": "string", + "description": "Select only event tags that belong to this ad.", + "format": "int64", + "location": "query" + }, + "advertiserId": { + "type": "string", + "description": "Select only event tags that belong to this advertiser.", + "format": "int64", + "location": "query" + }, + "campaignId": { + "type": "string", + "description": "Select only event tags that belong to this campaign.", + "format": "int64", + "location": "query" + }, + "definitionsOnly": { + "type": "boolean", + "description": "Examine only the specified campaign or advertiser's event tags for matching selector criteria. When set to false, the parent advertiser and parent campaign of the specified ad or campaign is examined as well. In addition, when set to false, the status field is examined as well, along with the enabledByDefault field. This parameter can not be set to true when adId is specified as ads do not define their own even tags.", + "location": "query" + }, + "enabled": { + "type": "boolean", + "description": "Select only enabled event tags. What is considered enabled or disabled depends on the definitionsOnly parameter. When definitionsOnly is set to true, only the specified advertiser or campaign's event tags' enabledByDefault field is examined. When definitionsOnly is set to false, the specified ad or specified campaign's parent advertiser's or parent campaign's event tags' enabledByDefault and status fields are examined as well.", + "location": "query" + }, + "eventTagTypes": { + "type": "string", + "description": "Select only event tags with the specified event tag types. Event tag types can be used to specify whether to use a third-party pixel, a third-party JavaScript URL, or a third-party click-through URL for either impression or click tracking.", + "enum": [ + "CLICK_THROUGH_EVENT_TAG", + "IMPRESSION_IMAGE_EVENT_TAG", + "IMPRESSION_JAVASCRIPT_EVENT_TAG" + ], + "enumDescriptions": [ + "", + "", + "" + ], + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only event tags with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"eventtag*2015\" will return objects with names like \"eventtag June 2015\", \"eventtag April 2015\", or simply \"eventtag 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"eventtag\" will match objects with name \"my eventtag\", \"eventtag 2015\", or simply \"eventtag\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "EventTagsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.eventTags.patch", + "path": "userprofiles/{profileId}/eventTags", + "httpMethod": "PATCH", + "description": "Updates an existing event tag. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Event tag ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "EventTag" + }, + "response": { + "$ref": "EventTag" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.eventTags.update", + "path": "userprofiles/{profileId}/eventTags", + "httpMethod": "PUT", + "description": "Updates an existing event tag.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "EventTag" + }, + "response": { + "$ref": "EventTag" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "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" + ] + } + } + }, + "floodlightActivities": { + "methods": { + "delete": { + "id": "dfareporting.floodlightActivities.delete", + "path": "userprofiles/{profileId}/floodlightActivities/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing floodlight activity.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight activity ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "generatetag": { + "id": "dfareporting.floodlightActivities.generatetag", + "path": "userprofiles/{profileId}/floodlightActivities/generatetag", + "httpMethod": "POST", + "description": "Generates a tag for a floodlight activity.", + "parameters": { + "floodlightActivityId": { + "type": "string", + "description": "Floodlight activity ID for which we want to generate a tag.", + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "FloodlightActivitiesGenerateTagResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.floodlightActivities.get", + "path": "userprofiles/{profileId}/floodlightActivities/{id}", + "httpMethod": "GET", + "description": "Gets one floodlight activity by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight activity ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "FloodlightActivity" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.floodlightActivities.insert", + "path": "userprofiles/{profileId}/floodlightActivities", + "httpMethod": "POST", + "description": "Inserts a new floodlight activity.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "FloodlightActivity" + }, + "response": { + "$ref": "FloodlightActivity" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.floodlightActivities.list", + "path": "userprofiles/{profileId}/floodlightActivities", + "httpMethod": "GET", + "description": "Retrieves a list of floodlight activities, possibly filtered.", + "parameters": { + "advertiserId": { + "type": "string", + "description": "Select only floodlight activities for the specified advertiser ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.", + "format": "int64", + "location": "query" + }, + "floodlightActivityGroupIds": { + "type": "string", + "description": "Select only floodlight activities with the specified floodlight activity group IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "floodlightActivityGroupName": { + "type": "string", + "description": "Select only floodlight activities with the specified floodlight activity group name.", + "location": "query" + }, + "floodlightActivityGroupTagString": { + "type": "string", + "description": "Select only floodlight activities with the specified floodlight activity group tag string.", + "location": "query" + }, + "floodlightActivityGroupType": { + "type": "string", + "description": "Select only floodlight activities with the specified floodlight activity group type.", + "enum": [ + "COUNTER", + "SALE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "floodlightConfigurationId": { + "type": "string", + "description": "Select only floodlight activities for the specified floodlight configuration ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.", + "format": "int64", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only floodlight activities with the specified IDs. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"floodlightactivity*2015\" will return objects with names like \"floodlightactivity June 2015\", \"floodlightactivity April 2015\", or simply \"floodlightactivity 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"floodlightactivity\" will match objects with name \"my floodlightactivity activity\", \"floodlightactivity 2015\", or simply \"floodlightactivity\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "tagString": { + "type": "string", + "description": "Select only floodlight activities with the specified tag string.", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "FloodlightActivitiesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.floodlightActivities.patch", + "path": "userprofiles/{profileId}/floodlightActivities", + "httpMethod": "PATCH", + "description": "Updates an existing floodlight activity. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight activity ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "FloodlightActivity" + }, + "response": { + "$ref": "FloodlightActivity" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.floodlightActivities.update", + "path": "userprofiles/{profileId}/floodlightActivities", + "httpMethod": "PUT", + "description": "Updates an existing floodlight activity.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "FloodlightActivity" + }, + "response": { + "$ref": "FloodlightActivity" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "floodlightActivityGroups": { + "methods": { + "delete": { + "id": "dfareporting.floodlightActivityGroups.delete", + "path": "userprofiles/{profileId}/floodlightActivityGroups/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing floodlight activity group.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight activity Group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.floodlightActivityGroups.get", + "path": "userprofiles/{profileId}/floodlightActivityGroups/{id}", + "httpMethod": "GET", + "description": "Gets one floodlight activity group by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight activity Group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "FloodlightActivityGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.floodlightActivityGroups.insert", + "path": "userprofiles/{profileId}/floodlightActivityGroups", + "httpMethod": "POST", + "description": "Inserts a new floodlight activity group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "FloodlightActivityGroup" + }, + "response": { + "$ref": "FloodlightActivityGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.floodlightActivityGroups.list", + "path": "userprofiles/{profileId}/floodlightActivityGroups", + "httpMethod": "GET", + "description": "Retrieves a list of floodlight activity groups, possibly filtered.", + "parameters": { + "advertiserId": { + "type": "string", + "description": "Select only floodlight activity groups with the specified advertiser ID. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.", + "format": "int64", + "location": "query" + }, + "floodlightConfigurationId": { + "type": "string", + "description": "Select only floodlight activity groups with the specified floodlight configuration ID. Must specify either advertiserId, or floodlightConfigurationId for a non-empty result.", + "format": "int64", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only floodlight activity groups with the specified IDs. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"floodlightactivitygroup*2015\" will return objects with names like \"floodlightactivitygroup June 2015\", \"floodlightactivitygroup April 2015\", or simply \"floodlightactivitygroup 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"floodlightactivitygroup\" will match objects with name \"my floodlightactivitygroup activity\", \"floodlightactivitygroup 2015\", or simply \"floodlightactivitygroup\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "type": { + "type": "string", + "description": "Select only floodlight activity groups with the specified floodlight activity group type.", + "enum": [ + "COUNTER", + "SALE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "FloodlightActivityGroupsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.floodlightActivityGroups.patch", + "path": "userprofiles/{profileId}/floodlightActivityGroups", + "httpMethod": "PATCH", + "description": "Updates an existing floodlight activity group. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight activity Group ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "FloodlightActivityGroup" + }, + "response": { + "$ref": "FloodlightActivityGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.floodlightActivityGroups.update", + "path": "userprofiles/{profileId}/floodlightActivityGroups", + "httpMethod": "PUT", + "description": "Updates an existing floodlight activity group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "FloodlightActivityGroup" + }, + "response": { + "$ref": "FloodlightActivityGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "floodlightConfigurations": { + "methods": { + "get": { + "id": "dfareporting.floodlightConfigurations.get", + "path": "userprofiles/{profileId}/floodlightConfigurations/{id}", + "httpMethod": "GET", + "description": "Gets one floodlight configuration by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight configuration ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "FloodlightConfiguration" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.floodlightConfigurations.list", + "path": "userprofiles/{profileId}/floodlightConfigurations", + "httpMethod": "GET", + "description": "Retrieves a list of floodlight configurations, possibly filtered.", + "parameters": { + "ids": { + "type": "string", + "description": "Set of IDs of floodlight configurations to retrieve. Required field; otherwise an empty list will be returned.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "FloodlightConfigurationsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.floodlightConfigurations.patch", + "path": "userprofiles/{profileId}/floodlightConfigurations", + "httpMethod": "PATCH", + "description": "Updates an existing floodlight configuration. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight configuration ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "FloodlightConfiguration" + }, + "response": { + "$ref": "FloodlightConfiguration" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.floodlightConfigurations.update", + "path": "userprofiles/{profileId}/floodlightConfigurations", + "httpMethod": "PUT", + "description": "Updates an existing floodlight configuration.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "FloodlightConfiguration" + }, + "response": { + "$ref": "FloodlightConfiguration" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "inventoryItems": { + "methods": { + "get": { + "id": "dfareporting.inventoryItems.get", + "path": "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}", + "httpMethod": "GET", + "description": "Gets one inventory item by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Inventory item ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID for order documents.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "projectId", + "id" + ], + "response": { + "$ref": "InventoryItem" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.inventoryItems.list", + "path": "userprofiles/{profileId}/projects/{projectId}/inventoryItems", + "httpMethod": "GET", + "description": "Retrieves a list of inventory items, possibly filtered.", + "parameters": { + "ids": { + "type": "string", + "description": "Select only inventory items with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "inPlan": { + "type": "boolean", + "description": "Select only inventory items that are in plan.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "orderId": { + "type": "string", + "description": "Select only inventory items that belong to specified orders.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID for order documents.", + "required": true, + "format": "int64", + "location": "path" + }, + "siteId": { + "type": "string", + "description": "Select only inventory items that are associated with these sites.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "projectId" + ], + "response": { + "$ref": "InventoryItemsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "landingPages": { + "methods": { + "delete": { + "id": "dfareporting.landingPages.delete", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing campaign landing page.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Landing page campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "id": { + "type": "string", + "description": "Landing page ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.landingPages.get", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}", + "httpMethod": "GET", + "description": "Gets one campaign landing page by ID.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Landing page campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "id": { + "type": "string", + "description": "Landing page ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId", + "id" + ], + "response": { + "$ref": "LandingPage" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.landingPages.insert", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + "httpMethod": "POST", + "description": "Inserts a new landing page for the specified campaign.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Landing page campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId" + ], + "request": { + "$ref": "LandingPage" + }, + "response": { + "$ref": "LandingPage" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.landingPages.list", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + "httpMethod": "GET", + "description": "Retrieves the list of landing pages for the specified campaign.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Landing page campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId" + ], + "response": { + "$ref": "LandingPagesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.landingPages.patch", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + "httpMethod": "PATCH", + "description": "Updates an existing campaign landing page. This method supports patch semantics.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Landing page campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "id": { + "type": "string", + "description": "Landing page ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId", + "id" + ], + "request": { + "$ref": "LandingPage" + }, + "response": { + "$ref": "LandingPage" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.landingPages.update", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + "httpMethod": "PUT", + "description": "Updates an existing campaign landing page.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Landing page campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId" + ], + "request": { + "$ref": "LandingPage" + }, + "response": { + "$ref": "LandingPage" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "metros": { + "methods": { + "list": { + "id": "dfareporting.metros.list", + "path": "userprofiles/{profileId}/metros", + "httpMethod": "GET", + "description": "Retrieves a list of metros.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "MetrosListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "mobileCarriers": { + "methods": { + "get": { + "id": "dfareporting.mobileCarriers.get", + "path": "userprofiles/{profileId}/mobileCarriers/{id}", + "httpMethod": "GET", + "description": "Gets one mobile carrier by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Mobile carrier ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "MobileCarrier" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.mobileCarriers.list", + "path": "userprofiles/{profileId}/mobileCarriers", + "httpMethod": "GET", + "description": "Retrieves a list of mobile carriers.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "MobileCarriersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "operatingSystemVersions": { + "methods": { + "get": { + "id": "dfareporting.operatingSystemVersions.get", + "path": "userprofiles/{profileId}/operatingSystemVersions/{id}", + "httpMethod": "GET", + "description": "Gets one operating system version by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Operating system version ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "OperatingSystemVersion" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.operatingSystemVersions.list", + "path": "userprofiles/{profileId}/operatingSystemVersions", + "httpMethod": "GET", + "description": "Retrieves a list of operating system versions.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "OperatingSystemVersionsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "operatingSystems": { + "methods": { + "get": { + "id": "dfareporting.operatingSystems.get", + "path": "userprofiles/{profileId}/operatingSystems/{dartId}", + "httpMethod": "GET", + "description": "Gets one operating system by DART ID.", + "parameters": { + "dartId": { + "type": "string", + "description": "Operating system DART ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "dartId" + ], + "response": { + "$ref": "OperatingSystem" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.operatingSystems.list", + "path": "userprofiles/{profileId}/operatingSystems", + "httpMethod": "GET", + "description": "Retrieves a list of operating systems.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "OperatingSystemsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "orderDocuments": { + "methods": { + "get": { + "id": "dfareporting.orderDocuments.get", + "path": "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}", + "httpMethod": "GET", + "description": "Gets one order document by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Order document ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID for order documents.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "projectId", + "id" + ], + "response": { + "$ref": "OrderDocument" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.orderDocuments.list", + "path": "userprofiles/{profileId}/projects/{projectId}/orderDocuments", + "httpMethod": "GET", + "description": "Retrieves a list of order documents, possibly filtered.", + "parameters": { + "approved": { + "type": "boolean", + "description": "Select only order documents that have been approved by at least one user.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only order documents with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "orderId": { + "type": "string", + "description": "Select only order documents for specified orders.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID for order documents.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for order documents by name or ID. Wildcards (*) are allowed. For example, \"orderdocument*2015\" will return order documents with names like \"orderdocument June 2015\", \"orderdocument April 2015\", or simply \"orderdocument 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"orderdocument\" will match order documents with name \"my orderdocument\", \"orderdocument 2015\", or simply \"orderdocument\".", + "location": "query" + }, + "siteId": { + "type": "string", + "description": "Select only order documents that are associated with these sites.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "projectId" + ], + "response": { + "$ref": "OrderDocumentsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "orders": { + "methods": { + "get": { + "id": "dfareporting.orders.get", + "path": "userprofiles/{profileId}/projects/{projectId}/orders/{id}", + "httpMethod": "GET", + "description": "Gets one order by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Order ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID for orders.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "projectId", + "id" + ], + "response": { + "$ref": "Order" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.orders.list", + "path": "userprofiles/{profileId}/projects/{projectId}/orders", + "httpMethod": "GET", + "description": "Retrieves a list of orders, possibly filtered.", + "parameters": { + "ids": { + "type": "string", + "description": "Select only orders with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID for orders.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for orders by name or ID. Wildcards (*) are allowed. For example, \"order*2015\" will return orders with names like \"order June 2015\", \"order April 2015\", or simply \"order 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"order\" will match orders with name \"my order\", \"order 2015\", or simply \"order\".", + "location": "query" + }, + "siteId": { + "type": "string", + "description": "Select only orders that are associated with these site IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "projectId" + ], + "response": { + "$ref": "OrdersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "placementGroups": { + "methods": { + "get": { + "id": "dfareporting.placementGroups.get", + "path": "userprofiles/{profileId}/placementGroups/{id}", + "httpMethod": "GET", + "description": "Gets one placement group by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Placement group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "PlacementGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.placementGroups.insert", + "path": "userprofiles/{profileId}/placementGroups", + "httpMethod": "POST", + "description": "Inserts a new placement group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "PlacementGroup" + }, + "response": { + "$ref": "PlacementGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.placementGroups.list", + "path": "userprofiles/{profileId}/placementGroups", + "httpMethod": "GET", + "description": "Retrieves a list of placement groups, possibly filtered.", + "parameters": { + "advertiserIds": { + "type": "string", + "description": "Select only placement groups that belong to these advertisers.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "archived": { + "type": "boolean", + "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.", + "location": "query" + }, + "campaignIds": { + "type": "string", + "description": "Select only placement groups that belong to these campaigns.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "contentCategoryIds": { + "type": "string", + "description": "Select only placement groups that are associated with these content categories.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "directorySiteIds": { + "type": "string", + "description": "Select only placement groups that are associated with these directory sites.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only placement groups with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "placementGroupType": { + "type": "string", + "description": "Select only placement groups belonging with this group type. A package is a simple group of placements that acts as a single pricing point for a group of tags. A roadblock is a group of placements that not only acts as a single pricing point but also assumes that all the tags in it will be served at the same time. A roadblock requires one of its assigned placements to be marked as primary for reporting.", + "enum": [ + "PLACEMENT_PACKAGE", + "PLACEMENT_ROADBLOCK" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "placementStrategyIds": { + "type": "string", + "description": "Select only placement groups that are associated with these placement strategies.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "pricingTypes": { + "type": "string", + "description": "Select only placement groups with these pricing types.", + "enum": [ + "PRICING_TYPE_CPA", + "PRICING_TYPE_CPC", + "PRICING_TYPE_CPM", + "PRICING_TYPE_FLAT_RATE_CLICKS", + "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for placement groups by name or ID. Wildcards (*) are allowed. For example, \"placement*2015\" will return placement groups with names like \"placement group June 2015\", \"placement group May 2015\", or simply \"placements 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"placementgroup\" will match placement groups with name \"my placementgroup\", \"placementgroup 2015\", or simply \"placementgroup\".", + "location": "query" + }, + "siteIds": { + "type": "string", + "description": "Select only placement groups that are associated with these sites.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "PlacementGroupsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.placementGroups.patch", + "path": "userprofiles/{profileId}/placementGroups", + "httpMethod": "PATCH", + "description": "Updates an existing placement group. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Placement group ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "PlacementGroup" + }, + "response": { + "$ref": "PlacementGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.placementGroups.update", + "path": "userprofiles/{profileId}/placementGroups", + "httpMethod": "PUT", + "description": "Updates an existing placement group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "PlacementGroup" + }, + "response": { + "$ref": "PlacementGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "placementStrategies": { + "methods": { + "delete": { + "id": "dfareporting.placementStrategies.delete", + "path": "userprofiles/{profileId}/placementStrategies/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing placement strategy.", + "parameters": { + "id": { + "type": "string", + "description": "Placement strategy ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.placementStrategies.get", + "path": "userprofiles/{profileId}/placementStrategies/{id}", + "httpMethod": "GET", + "description": "Gets one placement strategy by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Placement strategy ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "PlacementStrategy" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.placementStrategies.insert", + "path": "userprofiles/{profileId}/placementStrategies", + "httpMethod": "POST", + "description": "Inserts a new placement strategy.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "PlacementStrategy" + }, + "response": { + "$ref": "PlacementStrategy" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.placementStrategies.list", + "path": "userprofiles/{profileId}/placementStrategies", + "httpMethod": "GET", + "description": "Retrieves a list of placement strategies, possibly filtered.", + "parameters": { + "ids": { + "type": "string", + "description": "Select only placement strategies with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"placementstrategy*2015\" will return objects with names like \"placementstrategy June 2015\", \"placementstrategy April 2015\", or simply \"placementstrategy 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"placementstrategy\" will match objects with name \"my placementstrategy\", \"placementstrategy 2015\", or simply \"placementstrategy\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "PlacementStrategiesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.placementStrategies.patch", + "path": "userprofiles/{profileId}/placementStrategies", + "httpMethod": "PATCH", + "description": "Updates an existing placement strategy. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Placement strategy ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "PlacementStrategy" + }, + "response": { + "$ref": "PlacementStrategy" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.placementStrategies.update", + "path": "userprofiles/{profileId}/placementStrategies", + "httpMethod": "PUT", + "description": "Updates an existing placement strategy.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "PlacementStrategy" + }, + "response": { + "$ref": "PlacementStrategy" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "placements": { + "methods": { + "generatetags": { + "id": "dfareporting.placements.generatetags", + "path": "userprofiles/{profileId}/placements/generatetags", + "httpMethod": "POST", + "description": "Generates tags for a placement.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Generate placements belonging to this campaign. This is a required field.", + "format": "int64", + "location": "query" + }, + "placementIds": { + "type": "string", + "description": "Generate tags for these placements.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "tagFormats": { + "type": "string", + "description": "Tag formats to generate for these placements.", + "enum": [ + "PLACEMENT_TAG_CLICK_COMMANDS", + "PLACEMENT_TAG_IFRAME_ILAYER", + "PLACEMENT_TAG_IFRAME_JAVASCRIPT", + "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3", + "PLACEMENT_TAG_INTERNAL_REDIRECT", + "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT", + "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT", + "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT", + "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_JAVASCRIPT", + "PLACEMENT_TAG_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_STANDARD", + "PLACEMENT_TAG_TRACKING", + "PLACEMENT_TAG_TRACKING_IFRAME", + "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "PlacementsGenerateTagsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.placements.get", + "path": "userprofiles/{profileId}/placements/{id}", + "httpMethod": "GET", + "description": "Gets one placement by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Placement ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Placement" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.placements.insert", + "path": "userprofiles/{profileId}/placements", + "httpMethod": "POST", + "description": "Inserts a new placement.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Placement" + }, + "response": { + "$ref": "Placement" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.placements.list", + "path": "userprofiles/{profileId}/placements", + "httpMethod": "GET", + "description": "Retrieves a list of placements, possibly filtered.", + "parameters": { + "advertiserIds": { + "type": "string", + "description": "Select only placements that belong to these advertisers.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "archived": { + "type": "boolean", + "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.", + "location": "query" + }, + "campaignIds": { + "type": "string", + "description": "Select only placements that belong to these campaigns.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "compatibilities": { + "type": "string", + "description": "Select only placements that are associated with these compatibilities. WEB and WEB_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps.IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard.", + "enum": [ + "APP", + "APP_INTERSTITIAL", + "IN_STREAM_VIDEO", + "WEB", + "WEB_INTERSTITIAL" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + }, + "contentCategoryIds": { + "type": "string", + "description": "Select only placements that are associated with these content categories.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "directorySiteIds": { + "type": "string", + "description": "Select only placements that are associated with these directory sites.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "groupIds": { + "type": "string", + "description": "Select only placements that belong to these placement groups.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only placements with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "paymentSource": { + "type": "string", + "description": "Select only placements with this payment source.", + "enum": [ + "PLACEMENT_AGENCY_PAID", + "PLACEMENT_PUBLISHER_PAID" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "placementStrategyIds": { + "type": "string", + "description": "Select only placements that are associated with these placement strategies.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "pricingTypes": { + "type": "string", + "description": "Select only placements with these pricing types.", + "enum": [ + "PRICING_TYPE_CPA", + "PRICING_TYPE_CPC", + "PRICING_TYPE_CPM", + "PRICING_TYPE_FLAT_RATE_CLICKS", + "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for placements by name or ID. Wildcards (*) are allowed. For example, \"placement*2015\" will return placements with names like \"placement June 2015\", \"placement May 2015\", or simply \"placements 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"placement\" will match placements with name \"my placement\", \"placement 2015\", or simply \"placement\".", + "location": "query" + }, + "siteIds": { + "type": "string", + "description": "Select only placements that are associated with these sites.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sizeIds": { + "type": "string", + "description": "Select only placements that are associated with these sizes.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "PlacementsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.placements.patch", + "path": "userprofiles/{profileId}/placements", + "httpMethod": "PATCH", + "description": "Updates an existing placement. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Placement ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Placement" + }, + "response": { + "$ref": "Placement" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.placements.update", + "path": "userprofiles/{profileId}/placements", + "httpMethod": "PUT", + "description": "Updates an existing placement.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Placement" + }, + "response": { + "$ref": "Placement" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "platformTypes": { + "methods": { + "get": { + "id": "dfareporting.platformTypes.get", + "path": "userprofiles/{profileId}/platformTypes/{id}", + "httpMethod": "GET", + "description": "Gets one platform type by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Platform type ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "PlatformType" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.platformTypes.list", + "path": "userprofiles/{profileId}/platformTypes", + "httpMethod": "GET", + "description": "Retrieves a list of platform types.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "PlatformTypesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "postalCodes": { + "methods": { + "get": { + "id": "dfareporting.postalCodes.get", + "path": "userprofiles/{profileId}/postalCodes/{code}", + "httpMethod": "GET", + "description": "Gets one postal code by ID.", + "parameters": { + "code": { + "type": "string", + "description": "Postal code ID.", + "required": true, + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "code" + ], + "response": { + "$ref": "PostalCode" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.postalCodes.list", + "path": "userprofiles/{profileId}/postalCodes", + "httpMethod": "GET", + "description": "Retrieves a list of postal codes.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "PostalCodesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "projects": { + "methods": { + "get": { + "id": "dfareporting.projects.get", + "path": "userprofiles/{profileId}/projects/{id}", + "httpMethod": "GET", + "description": "Gets one project by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Project ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Project" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.projects.list", + "path": "userprofiles/{profileId}/projects", + "httpMethod": "GET", + "description": "Retrieves a list of projects, possibly filtered.", + "parameters": { + "advertiserIds": { + "type": "string", + "description": "Select only projects with these advertiser IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only projects with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for projects by name or ID. Wildcards (*) are allowed. For example, \"project*2015\" will return projects with names like \"project June 2015\", \"project April 2015\", or simply \"project 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"project\" will match projects with name \"my project\", \"project 2015\", or simply \"project\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "ProjectsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "regions": { + "methods": { + "list": { + "id": "dfareporting.regions.list", + "path": "userprofiles/{profileId}/regions", + "httpMethod": "GET", + "description": "Retrieves a list of regions.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "RegionsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "remarketingListShares": { + "methods": { + "get": { + "id": "dfareporting.remarketingListShares.get", + "path": "userprofiles/{profileId}/remarketingListShares/{remarketingListId}", + "httpMethod": "GET", + "description": "Gets one remarketing list share by remarketing list ID.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "remarketingListId": { + "type": "string", + "description": "Remarketing list ID.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "remarketingListId" + ], + "response": { + "$ref": "RemarketingListShare" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.remarketingListShares.patch", + "path": "userprofiles/{profileId}/remarketingListShares", + "httpMethod": "PATCH", + "description": "Updates an existing remarketing list share. This method supports patch semantics.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "remarketingListId": { + "type": "string", + "description": "Remarketing list ID.", + "required": true, + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "remarketingListId" + ], + "request": { + "$ref": "RemarketingListShare" + }, + "response": { + "$ref": "RemarketingListShare" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.remarketingListShares.update", + "path": "userprofiles/{profileId}/remarketingListShares", + "httpMethod": "PUT", + "description": "Updates an existing remarketing list share.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "RemarketingListShare" + }, + "response": { + "$ref": "RemarketingListShare" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "remarketingLists": { + "methods": { + "get": { + "id": "dfareporting.remarketingLists.get", + "path": "userprofiles/{profileId}/remarketingLists/{id}", + "httpMethod": "GET", + "description": "Gets one remarketing list by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Remarketing list ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "RemarketingList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.remarketingLists.insert", + "path": "userprofiles/{profileId}/remarketingLists", + "httpMethod": "POST", + "description": "Inserts a new remarketing list.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "RemarketingList" + }, + "response": { + "$ref": "RemarketingList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.remarketingLists.list", + "path": "userprofiles/{profileId}/remarketingLists", + "httpMethod": "GET", + "description": "Retrieves a list of remarketing lists, possibly filtered.", + "parameters": { + "active": { + "type": "boolean", + "description": "Select only active or only inactive remarketing lists.", + "location": "query" + }, + "advertiserId": { + "type": "string", + "description": "Select only remarketing lists owned by this advertiser.", + "required": true, + "format": "int64", + "location": "query" + }, + "floodlightActivityId": { + "type": "string", + "description": "Select only remarketing lists that have this floodlight activity ID.", + "format": "int64", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "name": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"remarketing list*2015\" will return objects with names like \"remarketing list June 2015\", \"remarketing list April 2015\", or simply \"remarketing list 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"remarketing list\" will match objects with name \"my remarketing list\", \"remarketing list 2015\", or simply \"remarketing list\".", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "advertiserId" + ], + "response": { + "$ref": "RemarketingListsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.remarketingLists.patch", + "path": "userprofiles/{profileId}/remarketingLists", + "httpMethod": "PATCH", + "description": "Updates an existing remarketing list. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Remarketing list ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "RemarketingList" + }, + "response": { + "$ref": "RemarketingList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.remarketingLists.update", + "path": "userprofiles/{profileId}/remarketingLists", + "httpMethod": "PUT", + "description": "Updates an existing remarketing list.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "RemarketingList" + }, + "response": { + "$ref": "RemarketingList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "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" + ] + } + } + } + } + }, + "sites": { + "methods": { + "get": { + "id": "dfareporting.sites.get", + "path": "userprofiles/{profileId}/sites/{id}", + "httpMethod": "GET", + "description": "Gets one site by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Site ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Site" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.sites.insert", + "path": "userprofiles/{profileId}/sites", + "httpMethod": "POST", + "description": "Inserts a new site.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Site" + }, + "response": { + "$ref": "Site" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.sites.list", + "path": "userprofiles/{profileId}/sites", + "httpMethod": "GET", + "description": "Retrieves a list of sites, possibly filtered.", + "parameters": { + "acceptsInStreamVideoPlacements": { + "type": "boolean", + "description": "This search filter is no longer supported and will have no effect on the results returned.", + "location": "query" + }, + "acceptsInterstitialPlacements": { + "type": "boolean", + "description": "This search filter is no longer supported and will have no effect on the results returned.", + "location": "query" + }, + "acceptsPublisherPaidPlacements": { + "type": "boolean", + "description": "Select only sites that accept publisher paid placements.", + "location": "query" + }, + "adWordsSite": { + "type": "boolean", + "description": "Select only AdWords sites.", + "location": "query" + }, + "approved": { + "type": "boolean", + "description": "Select only approved sites.", + "location": "query" + }, + "campaignIds": { + "type": "string", + "description": "Select only sites with these campaign IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "directorySiteIds": { + "type": "string", + "description": "Select only sites with these directory site IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only sites with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name, ID or keyName. Wildcards (*) are allowed. For example, \"site*2015\" will return objects with names like \"site June 2015\", \"site April 2015\", or simply \"site 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"site\" will match objects with name \"my site\", \"site 2015\", or simply \"site\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "subaccountId": { + "type": "string", + "description": "Select only sites with this subaccount ID.", + "format": "int64", + "location": "query" + }, + "unmappedSite": { + "type": "boolean", + "description": "Select only sites that have not been mapped to a directory site.", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "SitesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.sites.patch", + "path": "userprofiles/{profileId}/sites", + "httpMethod": "PATCH", + "description": "Updates an existing site. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Site ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Site" + }, + "response": { + "$ref": "Site" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.sites.update", + "path": "userprofiles/{profileId}/sites", + "httpMethod": "PUT", + "description": "Updates an existing site.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Site" + }, + "response": { + "$ref": "Site" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "sizes": { + "methods": { + "get": { + "id": "dfareporting.sizes.get", + "path": "userprofiles/{profileId}/sizes/{id}", + "httpMethod": "GET", + "description": "Gets one size by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Size ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Size" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.sizes.insert", + "path": "userprofiles/{profileId}/sizes", + "httpMethod": "POST", + "description": "Inserts a new size.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Size" + }, + "response": { + "$ref": "Size" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.sizes.list", + "path": "userprofiles/{profileId}/sizes", + "httpMethod": "GET", + "description": "Retrieves a list of sizes, possibly filtered.", + "parameters": { + "height": { + "type": "integer", + "description": "Select only sizes with this height.", + "format": "int32", + "location": "query" + }, + "iabStandard": { + "type": "boolean", + "description": "Select only IAB standard sizes.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only sizes with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "width": { + "type": "integer", + "description": "Select only sizes with this width.", + "format": "int32", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "SizesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "subaccounts": { + "methods": { + "get": { + "id": "dfareporting.subaccounts.get", + "path": "userprofiles/{profileId}/subaccounts/{id}", + "httpMethod": "GET", + "description": "Gets one subaccount by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Subaccount ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Subaccount" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.subaccounts.insert", + "path": "userprofiles/{profileId}/subaccounts", + "httpMethod": "POST", + "description": "Inserts a new subaccount.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Subaccount" + }, + "response": { + "$ref": "Subaccount" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.subaccounts.list", + "path": "userprofiles/{profileId}/subaccounts", + "httpMethod": "GET", + "description": "Gets a list of subaccounts, possibly filtered.", + "parameters": { + "ids": { + "type": "string", + "description": "Select only subaccounts with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"subaccount*2015\" will return objects with names like \"subaccount June 2015\", \"subaccount April 2015\", or simply \"subaccount 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"subaccount\" will match objects with name \"my subaccount\", \"subaccount 2015\", or simply \"subaccount\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "SubaccountsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.subaccounts.patch", + "path": "userprofiles/{profileId}/subaccounts", + "httpMethod": "PATCH", + "description": "Updates an existing subaccount. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Subaccount ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Subaccount" + }, + "response": { + "$ref": "Subaccount" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.subaccounts.update", + "path": "userprofiles/{profileId}/subaccounts", + "httpMethod": "PUT", + "description": "Updates an existing subaccount.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Subaccount" + }, + "response": { + "$ref": "Subaccount" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "targetableRemarketingLists": { + "methods": { + "get": { + "id": "dfareporting.targetableRemarketingLists.get", + "path": "userprofiles/{profileId}/targetableRemarketingLists/{id}", + "httpMethod": "GET", + "description": "Gets one remarketing list by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Remarketing list ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "TargetableRemarketingList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.targetableRemarketingLists.list", + "path": "userprofiles/{profileId}/targetableRemarketingLists", + "httpMethod": "GET", + "description": "Retrieves a list of targetable remarketing lists, possibly filtered.", + "parameters": { + "active": { + "type": "boolean", + "description": "Select only active or only inactive targetable remarketing lists.", + "location": "query" + }, + "advertiserId": { + "type": "string", + "description": "Select only targetable remarketing lists targetable by these advertisers.", + "required": true, + "format": "int64", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "name": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"remarketing list*2015\" will return objects with names like \"remarketing list June 2015\", \"remarketing list April 2015\", or simply \"remarketing list 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"remarketing list\" will match objects with name \"my remarketing list\", \"remarketing list 2015\", or simply \"remarketing list\".", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "advertiserId" + ], + "response": { + "$ref": "TargetableRemarketingListsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "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", + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "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", + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "userRolePermissionGroups": { + "methods": { + "get": { + "id": "dfareporting.userRolePermissionGroups.get", + "path": "userprofiles/{profileId}/userRolePermissionGroups/{id}", + "httpMethod": "GET", + "description": "Gets one user role permission group by ID.", + "parameters": { + "id": { + "type": "string", + "description": "User role permission group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "UserRolePermissionGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.userRolePermissionGroups.list", + "path": "userprofiles/{profileId}/userRolePermissionGroups", + "httpMethod": "GET", + "description": "Gets a list of all supported user role permission groups.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "UserRolePermissionGroupsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "userRolePermissions": { + "methods": { + "get": { + "id": "dfareporting.userRolePermissions.get", + "path": "userprofiles/{profileId}/userRolePermissions/{id}", + "httpMethod": "GET", + "description": "Gets one user role permission by ID.", + "parameters": { + "id": { + "type": "string", + "description": "User role permission ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "UserRolePermission" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.userRolePermissions.list", + "path": "userprofiles/{profileId}/userRolePermissions", + "httpMethod": "GET", + "description": "Gets a list of user role permissions, possibly filtered.", + "parameters": { + "ids": { + "type": "string", + "description": "Select only user role permissions with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "UserRolePermissionsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "userRoles": { + "methods": { + "delete": { + "id": "dfareporting.userRoles.delete", + "path": "userprofiles/{profileId}/userRoles/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing user role.", + "parameters": { + "id": { + "type": "string", + "description": "User role ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.userRoles.get", + "path": "userprofiles/{profileId}/userRoles/{id}", + "httpMethod": "GET", + "description": "Gets one user role by ID.", + "parameters": { + "id": { + "type": "string", + "description": "User role ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "UserRole" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.userRoles.insert", + "path": "userprofiles/{profileId}/userRoles", + "httpMethod": "POST", + "description": "Inserts a new user role.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "UserRole" + }, + "response": { + "$ref": "UserRole" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.userRoles.list", + "path": "userprofiles/{profileId}/userRoles", + "httpMethod": "GET", + "description": "Retrieves a list of user roles, possibly filtered.", + "parameters": { + "accountUserRoleOnly": { + "type": "boolean", + "description": "Select only account level user roles not associated with any specific subaccount.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only user roles with the specified IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"userrole*2015\" will return objects with names like \"userrole June 2015\", \"userrole April 2015\", or simply \"userrole 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"userrole\" will match objects with name \"my userrole\", \"userrole 2015\", or simply \"userrole\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "subaccountId": { + "type": "string", + "description": "Select only user roles that belong to this subaccount.", + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "UserRolesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.userRoles.patch", + "path": "userprofiles/{profileId}/userRoles", + "httpMethod": "PATCH", + "description": "Updates an existing user role. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "User role ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "UserRole" + }, + "response": { + "$ref": "UserRole" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.userRoles.update", + "path": "userprofiles/{profileId}/userRoles", + "httpMethod": "PUT", + "description": "Updates an existing user role.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "UserRole" + }, + "response": { + "$ref": "UserRole" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/dfareporting/v2.1/dfareporting-gen.go b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v2.1/dfareporting-gen.go new file mode 100644 index 000000000..1325ee1c2 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v2.1/dfareporting-gen.go @@ -0,0 +1,42419 @@ +// Package dfareporting provides access to the DCM/DFA Reporting And Trafficking API. +// +// See https://developers.google.com/doubleclick-advertisers/reporting/ +// +// Usage example: +// +// import "google.golang.org/api/dfareporting/v2.1" +// ... +// dfareportingService, err := dfareporting.New(oauthHttpClient) +package dfareporting // import "google.golang.org/api/dfareporting/v2.1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "dfareporting:v2.1" +const apiName = "dfareporting" +const apiVersion = "v2.1" +const basePath = "https://www.googleapis.com/dfareporting/v2.1/" + +// OAuth2 scopes used by this API. +const ( + // View and manage DoubleClick for Advertisers reports + DfareportingScope = "https://www.googleapis.com/auth/dfareporting" + + // View and manage your DoubleClick Campaign Manager's (DCM) display ad + // campaigns + DfatraffickingScope = "https://www.googleapis.com/auth/dfatrafficking" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.AccountActiveAdSummaries = NewAccountActiveAdSummariesService(s) + s.AccountPermissionGroups = NewAccountPermissionGroupsService(s) + s.AccountPermissions = NewAccountPermissionsService(s) + s.AccountUserProfiles = NewAccountUserProfilesService(s) + s.Accounts = NewAccountsService(s) + s.Ads = NewAdsService(s) + s.AdvertiserGroups = NewAdvertiserGroupsService(s) + s.Advertisers = NewAdvertisersService(s) + s.Browsers = NewBrowsersService(s) + s.CampaignCreativeAssociations = NewCampaignCreativeAssociationsService(s) + s.Campaigns = NewCampaignsService(s) + s.ChangeLogs = NewChangeLogsService(s) + s.Cities = NewCitiesService(s) + s.ConnectionTypes = NewConnectionTypesService(s) + s.ContentCategories = NewContentCategoriesService(s) + s.Countries = NewCountriesService(s) + s.CreativeAssets = NewCreativeAssetsService(s) + s.CreativeFieldValues = NewCreativeFieldValuesService(s) + s.CreativeFields = NewCreativeFieldsService(s) + s.CreativeGroups = NewCreativeGroupsService(s) + s.Creatives = NewCreativesService(s) + s.DimensionValues = NewDimensionValuesService(s) + s.DirectorySiteContacts = NewDirectorySiteContactsService(s) + s.DirectorySites = NewDirectorySitesService(s) + s.EventTags = NewEventTagsService(s) + s.Files = NewFilesService(s) + s.FloodlightActivities = NewFloodlightActivitiesService(s) + s.FloodlightActivityGroups = NewFloodlightActivityGroupsService(s) + s.FloodlightConfigurations = NewFloodlightConfigurationsService(s) + s.InventoryItems = NewInventoryItemsService(s) + s.LandingPages = NewLandingPagesService(s) + s.Metros = NewMetrosService(s) + s.MobileCarriers = NewMobileCarriersService(s) + s.OperatingSystemVersions = NewOperatingSystemVersionsService(s) + s.OperatingSystems = NewOperatingSystemsService(s) + s.OrderDocuments = NewOrderDocumentsService(s) + s.Orders = NewOrdersService(s) + s.PlacementGroups = NewPlacementGroupsService(s) + s.PlacementStrategies = NewPlacementStrategiesService(s) + s.Placements = NewPlacementsService(s) + s.PlatformTypes = NewPlatformTypesService(s) + s.PostalCodes = NewPostalCodesService(s) + s.Projects = NewProjectsService(s) + s.Regions = NewRegionsService(s) + s.RemarketingListShares = NewRemarketingListSharesService(s) + s.RemarketingLists = NewRemarketingListsService(s) + s.Reports = NewReportsService(s) + s.Sites = NewSitesService(s) + s.Sizes = NewSizesService(s) + s.Subaccounts = NewSubaccountsService(s) + s.TargetableRemarketingLists = NewTargetableRemarketingListsService(s) + s.UserProfiles = NewUserProfilesService(s) + s.UserRolePermissionGroups = NewUserRolePermissionGroupsService(s) + s.UserRolePermissions = NewUserRolePermissionsService(s) + s.UserRoles = NewUserRolesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + AccountActiveAdSummaries *AccountActiveAdSummariesService + + AccountPermissionGroups *AccountPermissionGroupsService + + AccountPermissions *AccountPermissionsService + + AccountUserProfiles *AccountUserProfilesService + + Accounts *AccountsService + + Ads *AdsService + + AdvertiserGroups *AdvertiserGroupsService + + Advertisers *AdvertisersService + + Browsers *BrowsersService + + CampaignCreativeAssociations *CampaignCreativeAssociationsService + + Campaigns *CampaignsService + + ChangeLogs *ChangeLogsService + + Cities *CitiesService + + ConnectionTypes *ConnectionTypesService + + ContentCategories *ContentCategoriesService + + Countries *CountriesService + + CreativeAssets *CreativeAssetsService + + CreativeFieldValues *CreativeFieldValuesService + + CreativeFields *CreativeFieldsService + + CreativeGroups *CreativeGroupsService + + Creatives *CreativesService + + DimensionValues *DimensionValuesService + + DirectorySiteContacts *DirectorySiteContactsService + + DirectorySites *DirectorySitesService + + EventTags *EventTagsService + + Files *FilesService + + FloodlightActivities *FloodlightActivitiesService + + FloodlightActivityGroups *FloodlightActivityGroupsService + + FloodlightConfigurations *FloodlightConfigurationsService + + InventoryItems *InventoryItemsService + + LandingPages *LandingPagesService + + Metros *MetrosService + + MobileCarriers *MobileCarriersService + + OperatingSystemVersions *OperatingSystemVersionsService + + OperatingSystems *OperatingSystemsService + + OrderDocuments *OrderDocumentsService + + Orders *OrdersService + + PlacementGroups *PlacementGroupsService + + PlacementStrategies *PlacementStrategiesService + + Placements *PlacementsService + + PlatformTypes *PlatformTypesService + + PostalCodes *PostalCodesService + + Projects *ProjectsService + + Regions *RegionsService + + RemarketingListShares *RemarketingListSharesService + + RemarketingLists *RemarketingListsService + + Reports *ReportsService + + Sites *SitesService + + Sizes *SizesService + + Subaccounts *SubaccountsService + + TargetableRemarketingLists *TargetableRemarketingListsService + + UserProfiles *UserProfilesService + + UserRolePermissionGroups *UserRolePermissionGroupsService + + UserRolePermissions *UserRolePermissionsService + + UserRoles *UserRolesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAccountActiveAdSummariesService(s *Service) *AccountActiveAdSummariesService { + rs := &AccountActiveAdSummariesService{s: s} + return rs +} + +type AccountActiveAdSummariesService struct { + s *Service +} + +func NewAccountPermissionGroupsService(s *Service) *AccountPermissionGroupsService { + rs := &AccountPermissionGroupsService{s: s} + return rs +} + +type AccountPermissionGroupsService struct { + s *Service +} + +func NewAccountPermissionsService(s *Service) *AccountPermissionsService { + rs := &AccountPermissionsService{s: s} + return rs +} + +type AccountPermissionsService struct { + s *Service +} + +func NewAccountUserProfilesService(s *Service) *AccountUserProfilesService { + rs := &AccountUserProfilesService{s: s} + return rs +} + +type AccountUserProfilesService struct { + s *Service +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + return rs +} + +type AccountsService struct { + s *Service +} + +func NewAdsService(s *Service) *AdsService { + rs := &AdsService{s: s} + return rs +} + +type AdsService struct { + s *Service +} + +func NewAdvertiserGroupsService(s *Service) *AdvertiserGroupsService { + rs := &AdvertiserGroupsService{s: s} + return rs +} + +type AdvertiserGroupsService struct { + s *Service +} + +func NewAdvertisersService(s *Service) *AdvertisersService { + rs := &AdvertisersService{s: s} + return rs +} + +type AdvertisersService struct { + s *Service +} + +func NewBrowsersService(s *Service) *BrowsersService { + rs := &BrowsersService{s: s} + return rs +} + +type BrowsersService struct { + s *Service +} + +func NewCampaignCreativeAssociationsService(s *Service) *CampaignCreativeAssociationsService { + rs := &CampaignCreativeAssociationsService{s: s} + return rs +} + +type CampaignCreativeAssociationsService struct { + s *Service +} + +func NewCampaignsService(s *Service) *CampaignsService { + rs := &CampaignsService{s: s} + return rs +} + +type CampaignsService struct { + s *Service +} + +func NewChangeLogsService(s *Service) *ChangeLogsService { + rs := &ChangeLogsService{s: s} + return rs +} + +type ChangeLogsService struct { + s *Service +} + +func NewCitiesService(s *Service) *CitiesService { + rs := &CitiesService{s: s} + return rs +} + +type CitiesService struct { + s *Service +} + +func NewConnectionTypesService(s *Service) *ConnectionTypesService { + rs := &ConnectionTypesService{s: s} + return rs +} + +type ConnectionTypesService struct { + s *Service +} + +func NewContentCategoriesService(s *Service) *ContentCategoriesService { + rs := &ContentCategoriesService{s: s} + return rs +} + +type ContentCategoriesService struct { + s *Service +} + +func NewCountriesService(s *Service) *CountriesService { + rs := &CountriesService{s: s} + return rs +} + +type CountriesService struct { + s *Service +} + +func NewCreativeAssetsService(s *Service) *CreativeAssetsService { + rs := &CreativeAssetsService{s: s} + return rs +} + +type CreativeAssetsService struct { + s *Service +} + +func NewCreativeFieldValuesService(s *Service) *CreativeFieldValuesService { + rs := &CreativeFieldValuesService{s: s} + return rs +} + +type CreativeFieldValuesService struct { + s *Service +} + +func NewCreativeFieldsService(s *Service) *CreativeFieldsService { + rs := &CreativeFieldsService{s: s} + return rs +} + +type CreativeFieldsService struct { + s *Service +} + +func NewCreativeGroupsService(s *Service) *CreativeGroupsService { + rs := &CreativeGroupsService{s: s} + return rs +} + +type CreativeGroupsService struct { + s *Service +} + +func NewCreativesService(s *Service) *CreativesService { + rs := &CreativesService{s: s} + return rs +} + +type CreativesService struct { + s *Service +} + +func NewDimensionValuesService(s *Service) *DimensionValuesService { + rs := &DimensionValuesService{s: s} + return rs +} + +type DimensionValuesService struct { + s *Service +} + +func NewDirectorySiteContactsService(s *Service) *DirectorySiteContactsService { + rs := &DirectorySiteContactsService{s: s} + return rs +} + +type DirectorySiteContactsService struct { + s *Service +} + +func NewDirectorySitesService(s *Service) *DirectorySitesService { + rs := &DirectorySitesService{s: s} + return rs +} + +type DirectorySitesService struct { + s *Service +} + +func NewEventTagsService(s *Service) *EventTagsService { + rs := &EventTagsService{s: s} + return rs +} + +type EventTagsService struct { + s *Service +} + +func NewFilesService(s *Service) *FilesService { + rs := &FilesService{s: s} + return rs +} + +type FilesService struct { + s *Service +} + +func NewFloodlightActivitiesService(s *Service) *FloodlightActivitiesService { + rs := &FloodlightActivitiesService{s: s} + return rs +} + +type FloodlightActivitiesService struct { + s *Service +} + +func NewFloodlightActivityGroupsService(s *Service) *FloodlightActivityGroupsService { + rs := &FloodlightActivityGroupsService{s: s} + return rs +} + +type FloodlightActivityGroupsService struct { + s *Service +} + +func NewFloodlightConfigurationsService(s *Service) *FloodlightConfigurationsService { + rs := &FloodlightConfigurationsService{s: s} + return rs +} + +type FloodlightConfigurationsService struct { + s *Service +} + +func NewInventoryItemsService(s *Service) *InventoryItemsService { + rs := &InventoryItemsService{s: s} + return rs +} + +type InventoryItemsService struct { + s *Service +} + +func NewLandingPagesService(s *Service) *LandingPagesService { + rs := &LandingPagesService{s: s} + return rs +} + +type LandingPagesService struct { + s *Service +} + +func NewMetrosService(s *Service) *MetrosService { + rs := &MetrosService{s: s} + return rs +} + +type MetrosService struct { + s *Service +} + +func NewMobileCarriersService(s *Service) *MobileCarriersService { + rs := &MobileCarriersService{s: s} + return rs +} + +type MobileCarriersService struct { + s *Service +} + +func NewOperatingSystemVersionsService(s *Service) *OperatingSystemVersionsService { + rs := &OperatingSystemVersionsService{s: s} + return rs +} + +type OperatingSystemVersionsService struct { + s *Service +} + +func NewOperatingSystemsService(s *Service) *OperatingSystemsService { + rs := &OperatingSystemsService{s: s} + return rs +} + +type OperatingSystemsService struct { + s *Service +} + +func NewOrderDocumentsService(s *Service) *OrderDocumentsService { + rs := &OrderDocumentsService{s: s} + return rs +} + +type OrderDocumentsService struct { + s *Service +} + +func NewOrdersService(s *Service) *OrdersService { + rs := &OrdersService{s: s} + return rs +} + +type OrdersService struct { + s *Service +} + +func NewPlacementGroupsService(s *Service) *PlacementGroupsService { + rs := &PlacementGroupsService{s: s} + return rs +} + +type PlacementGroupsService struct { + s *Service +} + +func NewPlacementStrategiesService(s *Service) *PlacementStrategiesService { + rs := &PlacementStrategiesService{s: s} + return rs +} + +type PlacementStrategiesService struct { + s *Service +} + +func NewPlacementsService(s *Service) *PlacementsService { + rs := &PlacementsService{s: s} + return rs +} + +type PlacementsService struct { + s *Service +} + +func NewPlatformTypesService(s *Service) *PlatformTypesService { + rs := &PlatformTypesService{s: s} + return rs +} + +type PlatformTypesService struct { + s *Service +} + +func NewPostalCodesService(s *Service) *PostalCodesService { + rs := &PostalCodesService{s: s} + return rs +} + +type PostalCodesService struct { + s *Service +} + +func NewProjectsService(s *Service) *ProjectsService { + rs := &ProjectsService{s: s} + return rs +} + +type ProjectsService struct { + s *Service +} + +func NewRegionsService(s *Service) *RegionsService { + rs := &RegionsService{s: s} + return rs +} + +type RegionsService struct { + s *Service +} + +func NewRemarketingListSharesService(s *Service) *RemarketingListSharesService { + rs := &RemarketingListSharesService{s: s} + return rs +} + +type RemarketingListSharesService struct { + s *Service +} + +func NewRemarketingListsService(s *Service) *RemarketingListsService { + rs := &RemarketingListsService{s: s} + return rs +} + +type RemarketingListsService 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 NewSitesService(s *Service) *SitesService { + rs := &SitesService{s: s} + return rs +} + +type SitesService struct { + s *Service +} + +func NewSizesService(s *Service) *SizesService { + rs := &SizesService{s: s} + return rs +} + +type SizesService struct { + s *Service +} + +func NewSubaccountsService(s *Service) *SubaccountsService { + rs := &SubaccountsService{s: s} + return rs +} + +type SubaccountsService struct { + s *Service +} + +func NewTargetableRemarketingListsService(s *Service) *TargetableRemarketingListsService { + rs := &TargetableRemarketingListsService{s: s} + return rs +} + +type TargetableRemarketingListsService struct { + s *Service +} + +func NewUserProfilesService(s *Service) *UserProfilesService { + rs := &UserProfilesService{s: s} + return rs +} + +type UserProfilesService struct { + s *Service +} + +func NewUserRolePermissionGroupsService(s *Service) *UserRolePermissionGroupsService { + rs := &UserRolePermissionGroupsService{s: s} + return rs +} + +type UserRolePermissionGroupsService struct { + s *Service +} + +func NewUserRolePermissionsService(s *Service) *UserRolePermissionsService { + rs := &UserRolePermissionsService{s: s} + return rs +} + +type UserRolePermissionsService struct { + s *Service +} + +func NewUserRolesService(s *Service) *UserRolesService { + rs := &UserRolesService{s: s} + return rs +} + +type UserRolesService struct { + s *Service +} + +// Account: Contains properties of a DCM account. +type Account struct { + // AccountPermissionIds: Account permissions assigned to this account. + AccountPermissionIds googleapi.Int64s `json:"accountPermissionIds,omitempty"` + + // AccountProfile: Profile for this account. This is a read-only field + // that can be left blank. + // + // Possible values: + // "ACCOUNT_PROFILE_BASIC" + // "ACCOUNT_PROFILE_STANDARD" + AccountProfile string `json:"accountProfile,omitempty"` + + // Active: Whether this account is active. + Active bool `json:"active,omitempty"` + + // ActiveAdsLimitTier: Maximum number of active ads allowed for this + // account. + // + // Possible values: + // "ACTIVE_ADS_TIER_100K" + // "ACTIVE_ADS_TIER_200K" + // "ACTIVE_ADS_TIER_300K" + // "ACTIVE_ADS_TIER_40K" + // "ACTIVE_ADS_TIER_75K" + ActiveAdsLimitTier string `json:"activeAdsLimitTier,omitempty"` + + // ActiveViewOptOut: Whether to serve creatives with Active View tags. + // If disabled, viewability data will not be available for any + // impressions. + ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"` + + // AvailablePermissionIds: User role permissions available to the user + // roles of this account. + AvailablePermissionIds googleapi.Int64s `json:"availablePermissionIds,omitempty"` + + // ComscoreVceEnabled: Whether campaigns created in this account will be + // enabled for comScore vCE by default. + ComscoreVceEnabled bool `json:"comscoreVceEnabled,omitempty"` + + // CountryId: ID of the country associated with this account. + CountryId int64 `json:"countryId,omitempty,string"` + + // CurrencyId: ID of currency associated with this account. This is a + // required field. + // Acceptable values are: + // - "1" for USD + // - "2" for GBP + // - "3" for ESP + // - "4" for SEK + // - "5" for CAD + // - "6" for JPY + // - "7" for DEM + // - "8" for AUD + // - "9" for FRF + // - "10" for ITL + // - "11" for DKK + // - "12" for NOK + // - "13" for FIM + // - "14" for ZAR + // - "15" for IEP + // - "16" for NLG + // - "17" for EUR + // - "18" for KRW + // - "19" for TWD + // - "20" for SGD + // - "21" for CNY + // - "22" for HKD + // - "23" for NZD + // - "24" for MYR + // - "25" for BRL + // - "26" for PTE + // - "27" for MXP + // - "28" for CLP + // - "29" for TRY + // - "30" for ARS + // - "31" for PEN + // - "32" for ILS + // - "33" for CHF + // - "34" for VEF + // - "35" for COP + // - "36" for GTQ + CurrencyId int64 `json:"currencyId,omitempty,string"` + + // DefaultCreativeSizeId: Default placement dimensions for this account. + DefaultCreativeSizeId int64 `json:"defaultCreativeSizeId,omitempty,string"` + + // Description: Description of this account. + Description string `json:"description,omitempty"` + + // Id: ID of this account. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#account". + Kind string `json:"kind,omitempty"` + + // Locale: Locale of this account. + // Acceptable values are: + // - "cs" (Czech) + // - "de" (German) + // - "en" (English) + // - "en-GB" (English United Kingdom) + // - "es" (Spanish) + // - "fr" (French) + // - "it" (Italian) + // - "ja" (Japanese) + // - "ko" (Korean) + // - "pl" (Polish) + // - "pt-BR" (Portuguese Brazil) + // - "ru" (Russian) + // - "sv" (Swedish) + // - "tr" (Turkish) + // - "zh-CN" (Chinese Simplified) + // - "zh-TW" (Chinese Traditional) + Locale string `json:"locale,omitempty"` + + // MaximumImageSize: Maximum image size allowed for this account. + MaximumImageSize int64 `json:"maximumImageSize,omitempty,string"` + + // Name: Name of this account. This is a required field, and must be + // less than 128 characters long and be globally unique. + Name string `json:"name,omitempty"` + + // NielsenOcrEnabled: Whether campaigns created in this account will be + // enabled for Nielsen OCR reach ratings by default. + NielsenOcrEnabled bool `json:"nielsenOcrEnabled,omitempty"` + + // ReportsConfiguration: Reporting configuration of this account. + ReportsConfiguration *ReportsConfiguration `json:"reportsConfiguration,omitempty"` + + // TeaserSizeLimit: File size limit in kilobytes of Rich Media teaser + // creatives. Must be between 1 and 10240. + TeaserSizeLimit int64 `json:"teaserSizeLimit,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "AccountPermissionIds") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Account) MarshalJSON() ([]byte, error) { + type noMethod Account + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountActiveAdSummary: Gets a summary of active ads in an account. +type AccountActiveAdSummary struct { + // AccountId: ID of the account. + AccountId int64 `json:"accountId,omitempty,string"` + + // ActiveAds: Ads that have been activated for the account + ActiveAds int64 `json:"activeAds,omitempty,string"` + + // ActiveAdsLimitTier: Maximum number of active ads allowed for the + // account. + // + // Possible values: + // "ACTIVE_ADS_TIER_100K" + // "ACTIVE_ADS_TIER_200K" + // "ACTIVE_ADS_TIER_300K" + // "ACTIVE_ADS_TIER_40K" + // "ACTIVE_ADS_TIER_75K" + ActiveAdsLimitTier string `json:"activeAdsLimitTier,omitempty"` + + // AvailableAds: Ads that can be activated for the account. + AvailableAds int64 `json:"availableAds,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#accountActiveAdSummary". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountActiveAdSummary) MarshalJSON() ([]byte, error) { + type noMethod AccountActiveAdSummary + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountPermission: AccountPermissions contains information about a +// particular account permission. Some features of DCM require an +// account permission to be present in the account. +type AccountPermission struct { + // AccountProfiles: Account profiles associated with this account + // permission. + // + // Possible values are: + // - "ACCOUNT_PROFILE_BASIC" + // - "ACCOUNT_PROFILE_STANDARD" + // + // Possible values: + // "ACCOUNT_PROFILE_BASIC" + // "ACCOUNT_PROFILE_STANDARD" + AccountProfiles []string `json:"accountProfiles,omitempty"` + + // Id: ID of this account permission. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#accountPermission". + Kind string `json:"kind,omitempty"` + + // Level: Administrative level required to enable this account + // permission. + // + // Possible values: + // "ADMINISTRATOR" + // "USER" + Level string `json:"level,omitempty"` + + // Name: Name of this account permission. + Name string `json:"name,omitempty"` + + // PermissionGroupId: Permission group of this account permission. + PermissionGroupId int64 `json:"permissionGroupId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountProfiles") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountPermission) MarshalJSON() ([]byte, error) { + type noMethod AccountPermission + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountPermissionGroup: AccountPermissionGroups contains a mapping of +// permission group IDs to names. A permission group is a grouping of +// account permissions. +type AccountPermissionGroup struct { + // Id: ID of this account permission group. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#accountPermissionGroup". + Kind string `json:"kind,omitempty"` + + // Name: Name of this account permission group. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountPermissionGroup) MarshalJSON() ([]byte, error) { + type noMethod AccountPermissionGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountPermissionGroupsListResponse: Account Permission Group List +// Response +type AccountPermissionGroupsListResponse struct { + // AccountPermissionGroups: Account permission group collection. + AccountPermissionGroups []*AccountPermissionGroup `json:"accountPermissionGroups,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#accountPermissionGroupsListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "AccountPermissionGroups") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountPermissionGroupsListResponse) MarshalJSON() ([]byte, error) { + type noMethod AccountPermissionGroupsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountPermissionsListResponse: Account Permission List Response +type AccountPermissionsListResponse struct { + // AccountPermissions: Account permission collection. + AccountPermissions []*AccountPermission `json:"accountPermissions,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#accountPermissionsListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountPermissions") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountPermissionsListResponse) MarshalJSON() ([]byte, error) { + type noMethod AccountPermissionsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountUserProfile: AccountUserProfiles contains properties of a DCM +// user profile. This resource is specifically for managing user +// profiles, whereas UserProfiles is for accessing the API. +type AccountUserProfile struct { + // AccountId: Account ID of the user profile. This is a read-only field + // that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // Active: Whether this user profile is active. This defaults to false, + // and must be set true on insert for the user profile to be usable. + Active bool `json:"active,omitempty"` + + // AdvertiserFilter: Filter that describes which advertisers are visible + // to the user profile. + AdvertiserFilter *ObjectFilter `json:"advertiserFilter,omitempty"` + + // CampaignFilter: Filter that describes which campaigns are visible to + // the user profile. + CampaignFilter *ObjectFilter `json:"campaignFilter,omitempty"` + + // Comments: Comments for this user profile. + Comments string `json:"comments,omitempty"` + + // Email: Email of the user profile. The email addresss must be linked + // to a Google Account. This field is required on insertion and is + // read-only after insertion. + Email string `json:"email,omitempty"` + + // Id: ID of the user profile. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#accountUserProfile". + Kind string `json:"kind,omitempty"` + + // Locale: Locale of the user profile. This is a required + // field. + // Acceptable values are: + // - "cs" (Czech) + // - "de" (German) + // - "en" (English) + // - "en-GB" (English United Kingdom) + // - "es" (Spanish) + // - "fr" (French) + // - "it" (Italian) + // - "ja" (Japanese) + // - "ko" (Korean) + // - "pl" (Polish) + // - "pt-BR" (Portuguese Brazil) + // - "ru" (Russian) + // - "sv" (Swedish) + // - "tr" (Turkish) + // - "zh-CN" (Chinese Simplified) + // - "zh-TW" (Chinese Traditional) + Locale string `json:"locale,omitempty"` + + // Name: Name of the user profile. This is a required field. Must be + // less than 64 characters long, must be globally unique, and cannot + // contain whitespace or any of the following characters: "&;"#%,". + Name string `json:"name,omitempty"` + + // SiteFilter: Filter that describes which sites are visible to the user + // profile. + SiteFilter *ObjectFilter `json:"siteFilter,omitempty"` + + // SubaccountId: Subaccount ID of the user profile. This is a read-only + // field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TraffickerType: Trafficker type of this user profile. + // + // Possible values: + // "EXTERNAL_TRAFFICKER" + // "INTERNAL_NON_TRAFFICKER" + // "INTERNAL_TRAFFICKER" + TraffickerType string `json:"traffickerType,omitempty"` + + // UserAccessType: User type of the user profile. This is a read-only + // field that can be left blank. + // + // Possible values: + // "INTERNAL_ADMINISTRATOR" + // "NORMAL_USER" + // "SUPER_USER" + UserAccessType string `json:"userAccessType,omitempty"` + + // UserRoleFilter: Filter that describes which user roles are visible to + // the user profile. + UserRoleFilter *ObjectFilter `json:"userRoleFilter,omitempty"` + + // UserRoleId: User role ID of the user profile. This is a required + // field. + UserRoleId int64 `json:"userRoleId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountUserProfile) MarshalJSON() ([]byte, error) { + type noMethod AccountUserProfile + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountUserProfilesListResponse: Account User Profile List Response +type AccountUserProfilesListResponse struct { + // AccountUserProfiles: Account user profile collection. + AccountUserProfiles []*AccountUserProfile `json:"accountUserProfiles,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#accountUserProfilesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountUserProfiles") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountUserProfilesListResponse) MarshalJSON() ([]byte, error) { + type noMethod AccountUserProfilesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountsListResponse: Account List Response +type AccountsListResponse struct { + // Accounts: Account collection. + Accounts []*Account `json:"accounts,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#accountsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Accounts") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountsListResponse) MarshalJSON() ([]byte, error) { + type noMethod AccountsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Activities: Represents an activity group. +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"` + + // ForceSendFields is a list of field names (e.g. "Filters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Activities) MarshalJSON() ([]byte, error) { + type noMethod Activities + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Ad: Contains properties of a DCM ad. +type Ad struct { + // AccountId: Account ID of this ad. This is a read-only field that can + // be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // Active: Whether this ad is active. + Active bool `json:"active,omitempty"` + + // AdvertiserId: Advertiser ID of this ad. This is a required field on + // insertion. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // Archived: Whether this ad is archived. + Archived bool `json:"archived,omitempty"` + + // AudienceSegmentId: Audience segment ID that is being targeted for + // this ad. Applicable when type is AD_SERVING_STANDARD_AD. + AudienceSegmentId int64 `json:"audienceSegmentId,omitempty,string"` + + // CampaignId: Campaign ID of this ad. This is a required field on + // insertion. + CampaignId int64 `json:"campaignId,omitempty,string"` + + // CampaignIdDimensionValue: Dimension value for the ID of the campaign. + // This is a read-only, auto-generated field. + CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"` + + // ClickThroughUrl: Click-through URL for this ad. This is a required + // field on insertion. Applicable when type is AD_SERVING_CLICK_TRACKER. + ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"` + + // ClickThroughUrlSuffixProperties: Click-through URL suffix properties + // for this ad. Applies to the URL in the ad or (if overriding ad + // properties) the URL in the creative. + ClickThroughUrlSuffixProperties *ClickThroughUrlSuffixProperties `json:"clickThroughUrlSuffixProperties,omitempty"` + + // Comments: Comments for this ad. + Comments string `json:"comments,omitempty"` + + // Compatibility: Compatibility of this ad. Applicable when type is + // AD_SERVING_DEFAULT_AD. WEB and WEB_INTERSTITIAL refer to rendering + // either on desktop or on mobile devices for regular or interstitial + // ads, respectively. APP and APP_INTERSTITIAL are for rendering in + // mobile apps. IN_STREAM_VIDEO refers to rendering an in-stream video + // ads developed with the VAST standard. + // + // Possible values: + // "APP" + // "APP_INTERSTITIAL" + // "IN_STREAM_VIDEO" + // "WEB" + // "WEB_INTERSTITIAL" + Compatibility string `json:"compatibility,omitempty"` + + // CreateInfo: Information about the creation of this ad.This is a + // read-only field. + CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"` + + // CreativeGroupAssignments: Creative group assignments for this ad. + // Applicable when type is AD_SERVING_CLICK_TRACKER. Only one assignment + // per creative group number is allowed for a maximum of two + // assignments. + CreativeGroupAssignments []*CreativeGroupAssignment `json:"creativeGroupAssignments,omitempty"` + + // CreativeRotation: Creative rotation for this ad. Applicable when type + // is AD_SERVING_DEFAULT_AD, AD_SERVING_STANDARD_AD, or + // AD_SERVING_TRACKING. When type is AD_SERVING_DEFAULT_AD, this field + // should have exactly one creativeAssignment. + CreativeRotation *CreativeRotation `json:"creativeRotation,omitempty"` + + // DayPartTargeting: Time and day targeting information for this ad. + // Applicable when type is AD_SERVING_STANDARD_AD. + DayPartTargeting *DayPartTargeting `json:"dayPartTargeting,omitempty"` + + // DefaultClickThroughEventTagProperties: Default click-through event + // tag properties for this ad. + DefaultClickThroughEventTagProperties *DefaultClickThroughEventTagProperties `json:"defaultClickThroughEventTagProperties,omitempty"` + + // DeliverySchedule: Delivery schedule information for this ad. + // Applicable when type is AD_SERVING_STANDARD_AD or + // AD_SERVING_TRACKING. This field along with subfields priority and + // impressionRatio are required on insertion when type is + // AD_SERVING_STANDARD_AD. + DeliverySchedule *DeliverySchedule `json:"deliverySchedule,omitempty"` + + // DynamicClickTracker: Whether this ad is a dynamic click tracker. + // Applicable when type is AD_SERVING_CLICK_TRACKER. This is a required + // field on insert, and is read-only after insert. + DynamicClickTracker bool `json:"dynamicClickTracker,omitempty"` + + // EndTime: Date and time that this ad should stop serving. Must be + // later than the start time. This is a required field on insertion. + EndTime string `json:"endTime,omitempty"` + + // EventTagOverrides: Event tag overrides for this ad. + EventTagOverrides []*EventTagOverride `json:"eventTagOverrides,omitempty"` + + // GeoTargeting: Geographical targeting information for this + // ad.Applicable when type is AD_SERVING_STANDARD_AD. + GeoTargeting *GeoTargeting `json:"geoTargeting,omitempty"` + + // Id: ID of this ad. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this ad. This is a + // read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // KeyValueTargetingExpression: Key-value targeting information for this + // ad. Applicable when type is AD_SERVING_STANDARD_AD. + KeyValueTargetingExpression *KeyValueTargetingExpression `json:"keyValueTargetingExpression,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#ad". + Kind string `json:"kind,omitempty"` + + // LastModifiedInfo: Information about the most recent modification of + // this ad. This is a read-only field. + LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"` + + // Name: Name of this ad. This is a required field and must be less than + // 256 characters long. + Name string `json:"name,omitempty"` + + // PlacementAssignments: Placement assignments for this ad. + PlacementAssignments []*PlacementAssignment `json:"placementAssignments,omitempty"` + + // RemarketingListExpression: Applicable when type is + // AD_SERVING_STANDARD_AD. Remarketing list targeting expression for + // this ad. + RemarketingListExpression *ListTargetingExpression `json:"remarketing_list_expression,omitempty"` + + // Size: Size of this ad. Applicable when type is AD_SERVING_DEFAULT_AD. + Size *Size `json:"size,omitempty"` + + // SslCompliant: Whether this ad is ssl compliant. This is a read-only + // field that is auto-generated when the ad is inserted or updated. + SslCompliant bool `json:"sslCompliant,omitempty"` + + // SslRequired: Whether this ad requires ssl. This is a read-only field + // that is auto-generated when the ad is inserted or updated. + SslRequired bool `json:"sslRequired,omitempty"` + + // StartTime: Date and time that this ad should start serving. If + // creating an ad, this field must be a time in the future. This is a + // required field on insertion. + StartTime string `json:"startTime,omitempty"` + + // SubaccountId: Subaccount ID of this ad. This is a read-only field + // that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TechnologyTargeting: Technology platform targeting information for + // this ad. Applicable when type is AD_SERVING_STANDARD_AD. + TechnologyTargeting *TechnologyTargeting `json:"technologyTargeting,omitempty"` + + // Type: Type of ad. This is a required field on insertion. Note that + // default ads (AD_SERVING_DEFAULT_AD) cannot be created directly (see + // Creative resource). + // + // Possible values: + // "AD_SERVING_CLICK_TRACKER" + // "AD_SERVING_DEFAULT_AD" + // "AD_SERVING_STANDARD_AD" + // "AD_SERVING_TRACKING" + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Ad) MarshalJSON() ([]byte, error) { + type noMethod Ad + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdSlot: Ad Slot +type AdSlot struct { + // Comment: Comment for this ad slot. + Comment string `json:"comment,omitempty"` + + // Compatibility: Ad slot compatibility. WEB and WEB_INTERSTITIAL refer + // to rendering either on desktop or on mobile devices for regular or + // interstitial ads respectively. APP and APP_INTERSTITIAL are for + // rendering in mobile apps. IN_STREAM_VIDEO refers to rendering in + // in-stream video ads developed with the VAST standard. + // + // Possible values: + // "PLANNING_RENDERING_ENVIRONMENT_TYPE_APP" + // "PLANNING_RENDERING_ENVIRONMENT_TYPE_APP_INTERSTITIAL" + // "PLANNING_RENDERING_ENVIRONMENT_TYPE_IN_STREAM_VIDEO" + // "PLANNING_RENDERING_ENVIRONMENT_TYPE_WEB" + // "PLANNING_RENDERING_ENVIRONMENT_TYPE_WEB_INTERSTITIAL" + Compatibility string `json:"compatibility,omitempty"` + + // Height: Height of this ad slot. + Height int64 `json:"height,omitempty,string"` + + // LinkedPlacementId: ID of the placement from an external platform that + // is linked to this ad slot. + LinkedPlacementId int64 `json:"linkedPlacementId,omitempty,string"` + + // Name: Name of this ad slot. + Name string `json:"name,omitempty"` + + // PaymentSourceType: Payment source type of this ad slot. + // + // Possible values: + // "PLANNING_PAYMENT_SOURCE_TYPE_AGENCY_PAID" + // "PLANNING_PAYMENT_SOURCE_TYPE_PUBLISHER_PAID" + PaymentSourceType string `json:"paymentSourceType,omitempty"` + + // Primary: Primary ad slot of a roadblock inventory item. + Primary bool `json:"primary,omitempty"` + + // Width: Width of this ad slot. + Width int64 `json:"width,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Comment") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdSlot) MarshalJSON() ([]byte, error) { + type noMethod AdSlot + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdsListResponse: Ad List Response +type AdsListResponse struct { + // Ads: Ad collection. + Ads []*Ad `json:"ads,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#adsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Ads") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdsListResponse) MarshalJSON() ([]byte, error) { + type noMethod AdsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Advertiser: Contains properties of a DCM advertiser. +type Advertiser struct { + // AccountId: Account ID of this advertiser.This is a read-only field + // that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserGroupId: ID of the advertiser group this advertiser belongs + // to. You can group advertisers for reporting purposes, allowing you to + // see aggregated information for all advertisers in each group. + AdvertiserGroupId int64 `json:"advertiserGroupId,omitempty,string"` + + // ClickThroughUrlSuffix: Suffix added to click-through URL of ad + // creative associations under this advertiser. Must be less than 129 + // characters long. + ClickThroughUrlSuffix string `json:"clickThroughUrlSuffix,omitempty"` + + // DefaultClickThroughEventTagId: ID of the click-through event tag to + // apply by default to the landing pages of this advertiser's campaigns. + DefaultClickThroughEventTagId int64 `json:"defaultClickThroughEventTagId,omitempty,string"` + + // DefaultEmail: Default email address used in sender field for tag + // emails. + DefaultEmail string `json:"defaultEmail,omitempty"` + + // FloodlightConfigurationId: Floodlight configuration ID of this + // advertiser. The floodlight configuration ID will be created + // automatically, so on insert this field should be left blank. This + // field can be set to another advertiser's floodlight configuration ID + // in order to share that advertiser's floodlight configuration with + // this advertiser, so long as: + // - This advertiser's original floodlight configuration is not already + // associated with floodlight activities or floodlight activity groups. + // + // - This advertiser's original floodlight configuration is not already + // shared with another advertiser. + FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"` + + // FloodlightConfigurationIdDimensionValue: Dimension value for the ID + // of the floodlight configuration. This is a read-only, auto-generated + // field. + FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"` + + // Id: ID of this advertiser. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this advertiser. This + // is a read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#advertiser". + Kind string `json:"kind,omitempty"` + + // Name: Name of this advertiser. This is a required field and must be + // less than 256 characters long and unique among advertisers of the + // same account. + Name string `json:"name,omitempty"` + + // OriginalFloodlightConfigurationId: Original floodlight configuration + // before any sharing occurred. Set the floodlightConfigurationId of + // this advertiser to originalFloodlightConfigurationId to unshare the + // advertiser's current floodlight configuration. You cannot unshare an + // advertiser's floodlight configuration if the shared configuration has + // activities associated with any campaign or placement. + OriginalFloodlightConfigurationId int64 `json:"originalFloodlightConfigurationId,omitempty,string"` + + // Status: Status of this advertiser. + // + // Possible values: + // "APPROVED" + // "ON_HOLD" + Status string `json:"status,omitempty"` + + // SubaccountId: Subaccount ID of this advertiser.This is a read-only + // field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Advertiser) MarshalJSON() ([]byte, error) { + type noMethod Advertiser + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdvertiserGroup: Groups advertisers together so that reports can be +// generated for the entire group at once. +type AdvertiserGroup struct { + // AccountId: Account ID of this advertiser group. This is a read-only + // field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // Id: ID of this advertiser group. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#advertiserGroup". + Kind string `json:"kind,omitempty"` + + // Name: Name of this advertiser group. This is a required field and + // must be less than 256 characters long and unique among advertiser + // groups of the same account. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdvertiserGroup) MarshalJSON() ([]byte, error) { + type noMethod AdvertiserGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdvertiserGroupsListResponse: Advertiser Group List Response +type AdvertiserGroupsListResponse struct { + // AdvertiserGroups: Advertiser group collection. + AdvertiserGroups []*AdvertiserGroup `json:"advertiserGroups,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#advertiserGroupsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AdvertiserGroups") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdvertiserGroupsListResponse) MarshalJSON() ([]byte, error) { + type noMethod AdvertiserGroupsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdvertisersListResponse: Advertiser List Response +type AdvertisersListResponse struct { + // Advertisers: Advertiser collection. + Advertisers []*Advertiser `json:"advertisers,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#advertisersListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Advertisers") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdvertisersListResponse) MarshalJSON() ([]byte, error) { + type noMethod AdvertisersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AudienceSegment: Audience Segment. +type AudienceSegment struct { + // Allocation: Weight allocated to this segment. Must be between 1 and + // 1000. The weight assigned will be understood in proportion to the + // weights assigned to other segments in the same segment group. + Allocation int64 `json:"allocation,omitempty"` + + // Id: ID of this audience segment. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // Name: Name of this audience segment. This is a required field and + // must be less than 65 characters long. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Allocation") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AudienceSegment) MarshalJSON() ([]byte, error) { + type noMethod AudienceSegment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AudienceSegmentGroup: Audience Segment Group. +type AudienceSegmentGroup struct { + // AudienceSegments: Audience segments assigned to this group. The + // number of segments must be between 2 and 100. + AudienceSegments []*AudienceSegment `json:"audienceSegments,omitempty"` + + // Id: ID of this audience segment group. This is a read-only, + // auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Name: Name of this audience segment group. This is a required field + // and must be less than 65 characters long. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AudienceSegments") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AudienceSegmentGroup) MarshalJSON() ([]byte, error) { + type noMethod AudienceSegmentGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Browser: Contains information about a browser that can be targeted by +// ads. +type Browser struct { + // BrowserVersionId: ID referring to this grouping of browser and + // version numbers. This is the ID used for targeting. + BrowserVersionId int64 `json:"browserVersionId,omitempty,string"` + + // DartId: DART ID of this browser. This is the ID used when generating + // reports. + DartId int64 `json:"dartId,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#browser". + Kind string `json:"kind,omitempty"` + + // MajorVersion: Major version number (leftmost number) of this browser. + // For example, for Chrome 5.0.376.86 beta, this field should be set to + // 5. An asterisk (*) may be used to target any version number, and a + // question mark (?) may be used to target cases where the version + // number cannot be identified. For example, Chrome *.* targets any + // version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets + // Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad + // server knows the browser is Firefox but can't tell which version it + // is. + MajorVersion string `json:"majorVersion,omitempty"` + + // MinorVersion: Minor version number (number after first dot on left) + // of this browser. For example, for Chrome 5.0.375.86 beta, this field + // should be set to 0. An asterisk (*) may be used to target any version + // number, and a question mark (?) may be used to target cases where the + // version number cannot be identified. For example, Chrome *.* targets + // any version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets + // Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad + // server knows the browser is Firefox but can't tell which version it + // is. + MinorVersion string `json:"minorVersion,omitempty"` + + // Name: Name of this browser. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BrowserVersionId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Browser) MarshalJSON() ([]byte, error) { + type noMethod Browser + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BrowsersListResponse: Browser List Response +type BrowsersListResponse struct { + // Browsers: Browser collection. + Browsers []*Browser `json:"browsers,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#browsersListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Browsers") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BrowsersListResponse) MarshalJSON() ([]byte, error) { + type noMethod BrowsersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Campaign: Contains properties of a DCM campaign. +type Campaign struct { + // AccountId: Account ID of this campaign. This is a read-only field + // that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdditionalCreativeOptimizationConfigurations: Additional creative + // optimization configurations for the campaign. + AdditionalCreativeOptimizationConfigurations []*CreativeOptimizationConfiguration `json:"additionalCreativeOptimizationConfigurations,omitempty"` + + // AdvertiserGroupId: Advertiser group ID of the associated advertiser. + AdvertiserGroupId int64 `json:"advertiserGroupId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this campaign. This is a required + // field. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the advertiser ID of + // this campaign. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // Archived: Whether this campaign has been archived. + Archived bool `json:"archived,omitempty"` + + // AudienceSegmentGroups: Audience segment groups assigned to this + // campaign. Cannot have more than 300 segment groups. + AudienceSegmentGroups []*AudienceSegmentGroup `json:"audienceSegmentGroups,omitempty"` + + // BillingInvoiceCode: Billing invoice code included in the DCM client + // billing invoices associated with the campaign. + BillingInvoiceCode string `json:"billingInvoiceCode,omitempty"` + + // ClickThroughUrlSuffixProperties: Click-through URL suffix override + // properties for this campaign. + ClickThroughUrlSuffixProperties *ClickThroughUrlSuffixProperties `json:"clickThroughUrlSuffixProperties,omitempty"` + + // Comment: Arbitrary comments about this campaign. Must be less than + // 256 characters long. + Comment string `json:"comment,omitempty"` + + // ComscoreVceEnabled: Whether comScore vCE reports are enabled for this + // campaign. + ComscoreVceEnabled bool `json:"comscoreVceEnabled,omitempty"` + + // CreateInfo: Information about the creation of this campaign. This is + // a read-only field. + CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"` + + // CreativeGroupIds: List of creative group IDs that are assigned to the + // campaign. + CreativeGroupIds googleapi.Int64s `json:"creativeGroupIds,omitempty"` + + // CreativeOptimizationConfiguration: Creative optimization + // configuration for the campaign. + CreativeOptimizationConfiguration *CreativeOptimizationConfiguration `json:"creativeOptimizationConfiguration,omitempty"` + + // DefaultClickThroughEventTagProperties: Click-through event tag ID + // override properties for this campaign. + DefaultClickThroughEventTagProperties *DefaultClickThroughEventTagProperties `json:"defaultClickThroughEventTagProperties,omitempty"` + + // EndDate: Date on which the campaign will stop running. On insert, the + // end date must be today or a future date. The end date must be later + // than or be the same as the start date. If, for example, you set + // 6/25/2015 as both the start and end dates, the effective campaign run + // date is just that day only, 6/25/2015. The hours, minutes, and + // seconds of the end date should not be set, as doing so will result in + // an error. This is a required field. + EndDate string `json:"endDate,omitempty"` + + // EventTagOverrides: Overrides that can be used to activate or + // deactivate advertiser event tags. + EventTagOverrides []*EventTagOverride `json:"eventTagOverrides,omitempty"` + + // ExternalId: External ID for this campaign. + ExternalId string `json:"externalId,omitempty"` + + // Id: ID of this campaign. This is a read-only auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this campaign. This + // is a read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#campaign". + Kind string `json:"kind,omitempty"` + + // LastModifiedInfo: Information about the most recent modification of + // this campaign. This is a read-only field. + LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"` + + // LookbackConfiguration: Lookback window settings for the campaign. + LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"` + + // Name: Name of this campaign. This is a required field and must be + // less than 256 characters long and unique among campaigns of the same + // advertiser. + Name string `json:"name,omitempty"` + + // NielsenOcrEnabled: Whether Nielsen reports are enabled for this + // campaign. + NielsenOcrEnabled bool `json:"nielsenOcrEnabled,omitempty"` + + // StartDate: Date on which the campaign starts running. The start date + // can be any date. The hours, minutes, and seconds of the start date + // should not be set, as doing so will result in an error. This is a + // required field. + StartDate string `json:"startDate,omitempty"` + + // SubaccountId: Subaccount ID of this campaign. This is a read-only + // field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TraffickerEmails: Campaign trafficker contact emails. + TraffickerEmails []string `json:"traffickerEmails,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Campaign) MarshalJSON() ([]byte, error) { + type noMethod Campaign + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CampaignCreativeAssociation: Identifies a creative which has been +// associated with a given campaign. +type CampaignCreativeAssociation struct { + // CreativeId: ID of the creative associated with the campaign. This is + // a required field. + CreativeId int64 `json:"creativeId,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#campaignCreativeAssociation". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreativeId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CampaignCreativeAssociation) MarshalJSON() ([]byte, error) { + type noMethod CampaignCreativeAssociation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CampaignCreativeAssociationsListResponse: Campaign Creative +// Association List Response +type CampaignCreativeAssociationsListResponse struct { + // CampaignCreativeAssociations: Campaign creative association + // collection + CampaignCreativeAssociations []*CampaignCreativeAssociation `json:"campaignCreativeAssociations,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#campaignCreativeAssociationsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "CampaignCreativeAssociations") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CampaignCreativeAssociationsListResponse) MarshalJSON() ([]byte, error) { + type noMethod CampaignCreativeAssociationsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CampaignsListResponse: Campaign List Response +type CampaignsListResponse struct { + // Campaigns: Campaign collection. + Campaigns []*Campaign `json:"campaigns,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#campaignsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Campaigns") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CampaignsListResponse) MarshalJSON() ([]byte, error) { + type noMethod CampaignsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChangeLog: Describes a change that a user has made to a resource. +type ChangeLog struct { + // AccountId: Account ID of the modified object. + AccountId int64 `json:"accountId,omitempty,string"` + + // Action: Action which caused the change. + Action string `json:"action,omitempty"` + + // ChangeTime: Time when the object was modified. + ChangeTime string `json:"changeTime,omitempty"` + + // FieldName: Field name of the object which changed. + FieldName string `json:"fieldName,omitempty"` + + // Id: ID of this change log. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#changeLog". + Kind string `json:"kind,omitempty"` + + // NewValue: New value of the object field. + NewValue string `json:"newValue,omitempty"` + + // ObjectId: ID of the object of this change log. The object could be a + // campaign, placement, ad, or other type. + ObjectId int64 `json:"objectId,omitempty,string"` + + // ObjectType: Object type of the change log. + ObjectType string `json:"objectType,omitempty"` + + // OldValue: Old value of the object field. + OldValue string `json:"oldValue,omitempty"` + + // SubaccountId: Subaccount ID of the modified object. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TransactionId: Transaction ID of this change log. When a single API + // call results in many changes, each change will have a separate ID in + // the change log but will share the same transactionId. + TransactionId int64 `json:"transactionId,omitempty,string"` + + // UserProfileId: ID of the user who modified the object. + UserProfileId int64 `json:"userProfileId,omitempty,string"` + + // UserProfileName: User profile name of the user who modified the + // object. + UserProfileName string `json:"userProfileName,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChangeLog) MarshalJSON() ([]byte, error) { + type noMethod ChangeLog + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChangeLogsListResponse: Change Log List Response +type ChangeLogsListResponse struct { + // ChangeLogs: Change log collection. + ChangeLogs []*ChangeLog `json:"changeLogs,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#changeLogsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ChangeLogs") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChangeLogsListResponse) MarshalJSON() ([]byte, error) { + type noMethod ChangeLogsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CitiesListResponse: City List Response +type CitiesListResponse struct { + // Cities: City collection. + Cities []*City `json:"cities,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#citiesListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Cities") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CitiesListResponse) MarshalJSON() ([]byte, error) { + type noMethod CitiesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// City: Contains information about a city that can be targeted by ads. +type City struct { + // CountryCode: Country code of the country to which this city belongs. + CountryCode string `json:"countryCode,omitempty"` + + // CountryDartId: DART ID of the country to which this city belongs. + CountryDartId int64 `json:"countryDartId,omitempty,string"` + + // DartId: DART ID of this city. This is the ID used for targeting and + // generating reports. + DartId int64 `json:"dartId,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#city". + Kind string `json:"kind,omitempty"` + + // MetroCode: Metro region code of the metro region (DMA) to which this + // city belongs. + MetroCode string `json:"metroCode,omitempty"` + + // MetroDmaId: ID of the metro region (DMA) to which this city belongs. + MetroDmaId int64 `json:"metroDmaId,omitempty,string"` + + // Name: Name of this city. + Name string `json:"name,omitempty"` + + // RegionCode: Region code of the region to which this city belongs. + RegionCode string `json:"regionCode,omitempty"` + + // RegionDartId: DART ID of the region to which this city belongs. + RegionDartId int64 `json:"regionDartId,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "CountryCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *City) MarshalJSON() ([]byte, error) { + type noMethod City + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ClickTag: Creative Click Tag. +type ClickTag struct { + // EventName: Advertiser event name associated with the click tag. This + // field is used by ENHANCED_BANNER, ENHANCED_IMAGE, and HTML5_BANNER + // creatives. + EventName string `json:"eventName,omitempty"` + + // Name: Parameter name for the specified click tag. For ENHANCED_IMAGE + // creative assets, this field must match the value of the creative + // asset's creativeAssetId.name field. + Name string `json:"name,omitempty"` + + // Value: Parameter value for the specified click tag. This field + // contains a click-through url. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "EventName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ClickTag) MarshalJSON() ([]byte, error) { + type noMethod ClickTag + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ClickThroughUrl: Click-through URL +type ClickThroughUrl struct { + // CustomClickThroughUrl: Custom click-through URL. Applicable if the + // defaultLandingPage field is set to false and the landingPageId field + // is left unset. + CustomClickThroughUrl string `json:"customClickThroughUrl,omitempty"` + + // DefaultLandingPage: Whether the campaign default landing page is + // used. + DefaultLandingPage bool `json:"defaultLandingPage,omitempty"` + + // LandingPageId: ID of the landing page for the click-through URL. + // Applicable if the defaultLandingPage field is set to false. + LandingPageId int64 `json:"landingPageId,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. + // "CustomClickThroughUrl") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ClickThroughUrl) MarshalJSON() ([]byte, error) { + type noMethod ClickThroughUrl + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ClickThroughUrlSuffixProperties: Click Through URL Suffix settings. +type ClickThroughUrlSuffixProperties struct { + // ClickThroughUrlSuffix: Click-through URL suffix to apply to all ads + // in this entity's scope. Must be less than 128 characters long. + ClickThroughUrlSuffix string `json:"clickThroughUrlSuffix,omitempty"` + + // OverrideInheritedSuffix: Whether this entity should override the + // inherited click-through URL suffix with its own defined value. + OverrideInheritedSuffix bool `json:"overrideInheritedSuffix,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "ClickThroughUrlSuffix") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ClickThroughUrlSuffixProperties) MarshalJSON() ([]byte, error) { + type noMethod ClickThroughUrlSuffixProperties + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CompanionClickThroughOverride: Companion Click-through override. +type CompanionClickThroughOverride struct { + // ClickThroughUrl: Click-through URL of this companion click-through + // override. + ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"` + + // CreativeId: ID of the creative for this companion click-through + // override. + CreativeId int64 `json:"creativeId,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CompanionClickThroughOverride) MarshalJSON() ([]byte, error) { + type noMethod CompanionClickThroughOverride + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CompatibleFields: Represents a response to the queryCompatibleFields +// method. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "CrossDimensionReachReportCompatibleFields") to unconditionally + // include in API requests. By default, fields with empty values are + // omitted from API requests. However, any non-pointer, non-interface + // field appearing in ForceSendFields will be sent to the server + // regardless of whether the field is empty or not. This may be used to + // include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CompatibleFields) MarshalJSON() ([]byte, error) { + type noMethod CompatibleFields + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ConnectionType: Contains information about an internet connection +// type that can be targeted by ads. Clients can use the connection type +// to target mobile vs. broadband users. +type ConnectionType struct { + // Id: ID of this connection type. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#connectionType". + Kind string `json:"kind,omitempty"` + + // Name: Name of this connection type. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ConnectionType) MarshalJSON() ([]byte, error) { + type noMethod ConnectionType + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ConnectionTypesListResponse: Connection Type List Response +type ConnectionTypesListResponse struct { + // ConnectionTypes: Collection of connection types such as broadband and + // mobile. + ConnectionTypes []*ConnectionType `json:"connectionTypes,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#connectionTypesListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ConnectionTypes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ConnectionTypesListResponse) MarshalJSON() ([]byte, error) { + type noMethod ConnectionTypesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ContentCategoriesListResponse: Content Category List Response +type ContentCategoriesListResponse struct { + // ContentCategories: Content category collection. + ContentCategories []*ContentCategory `json:"contentCategories,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#contentCategoriesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ContentCategories") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ContentCategoriesListResponse) MarshalJSON() ([]byte, error) { + type noMethod ContentCategoriesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ContentCategory: Organizes placements according to the contents of +// their associated webpages. +type ContentCategory struct { + // AccountId: Account ID of this content category. This is a read-only + // field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // Id: ID of this content category. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#contentCategory". + Kind string `json:"kind,omitempty"` + + // Name: Name of this content category. This is a required field and + // must be less than 256 characters long and unique among content + // categories of the same account. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ContentCategory) MarshalJSON() ([]byte, error) { + type noMethod ContentCategory + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CountriesListResponse: Country List Response +type CountriesListResponse struct { + // Countries: Country collection. + Countries []*Country `json:"countries,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#countriesListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Countries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CountriesListResponse) MarshalJSON() ([]byte, error) { + type noMethod CountriesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Country: Contains information about a country that can be targeted by +// ads. +type Country struct { + // CountryCode: Country code. + CountryCode string `json:"countryCode,omitempty"` + + // DartId: DART ID of this country. This is the ID used for targeting + // and generating reports. + DartId int64 `json:"dartId,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#country". + Kind string `json:"kind,omitempty"` + + // Name: Name of this country. + Name string `json:"name,omitempty"` + + // SslEnabled: Whether ad serving supports secure servers in this + // country. + SslEnabled bool `json:"sslEnabled,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CountryCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Country) MarshalJSON() ([]byte, error) { + type noMethod Country + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Creative: Contains properties of a Creative. +type Creative struct { + // AccountId: Account ID of this creative. This field, if left unset, + // will be auto-generated for both insert and update operations. + // Applicable to all creative types. + AccountId int64 `json:"accountId,omitempty,string"` + + // Active: Whether the creative is active. Applicable to all creative + // types. + Active bool `json:"active,omitempty"` + + // AdParameters: Ad parameters user for VPAID creative. This is a + // read-only field. Applicable to the following creative types: all + // VPAID. + AdParameters string `json:"adParameters,omitempty"` + + // AdTagKeys: Keywords for a Rich Media creative. Keywords let you + // customize the creative settings of a Rich Media ad running on your + // site without having to contact the advertiser. You can use keywords + // to dynamically change the look or functionality of a creative. + // Applicable to the following creative types: all RICH_MEDIA, and all + // VPAID. + AdTagKeys []string `json:"adTagKeys,omitempty"` + + // AdvertiserId: Advertiser ID of this creative. This is a required + // field. Applicable to all creative types. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AllowScriptAccess: Whether script access is allowed for this + // creative. This is a read-only and deprecated field which will + // automatically be set to true on update. Applicable to the following + // creative types: FLASH_INPAGE. + AllowScriptAccess bool `json:"allowScriptAccess,omitempty"` + + // Archived: Whether the creative is archived. Applicable to all + // creative types. + Archived bool `json:"archived,omitempty"` + + // ArtworkType: Type of artwork used for the creative. This is a + // read-only field. Applicable to the following creative types: all + // RICH_MEDIA, and all VPAID. + // + // Possible values: + // "ARTWORK_TYPE_FLASH" + // "ARTWORK_TYPE_HTML5" + // "ARTWORK_TYPE_MIXED" + ArtworkType string `json:"artworkType,omitempty"` + + // AuthoringTool: Authoring tool for HTML5 banner creatives. This is a + // read-only field. Applicable to the following creative types: + // HTML5_BANNER. + // + // Possible values: + // "NINJA" + // "SWIFFY" + AuthoringTool string `json:"authoringTool,omitempty"` + + // AutoAdvanceImages: Whether images are automatically advanced for + // enhanced image creatives. Applicable to the following creative types: + // ENHANCED_IMAGE. + AutoAdvanceImages bool `json:"auto_advance_images,omitempty"` + + // BackgroundColor: The 6-character HTML color code, beginning with #, + // for the background of the window area where the Flash file is + // displayed. Default is white. Applicable to the following creative + // types: FLASH_INPAGE. + BackgroundColor string `json:"backgroundColor,omitempty"` + + // BackupImageClickThroughUrl: Click-through URL for backup image. + // Applicable to the following creative types: ENHANCED_BANNER, + // FLASH_INPAGE, and HTML5_BANNER. + BackupImageClickThroughUrl string `json:"backupImageClickThroughUrl,omitempty"` + + // BackupImageFeatures: List of feature dependencies that will cause a + // backup image to be served if the browser that serves the ad does not + // support them. Feature dependencies are features that a browser must + // be able to support in order to render your HTML5 creative asset + // correctly. This field is initially auto-generated to contain all + // features detected by DCM for all the assets of this creative and can + // then be modified by the client. To reset this field, copy over all + // the creativeAssets' detected features. Applicable to the following + // creative types: ENHANCED_BANNER and HTML5_BANNER. + // + // Possible values: + // "APPLICATION_CACHE" + // "AUDIO" + // "CANVAS" + // "CANVAS_TEXT" + // "CSS_ANIMATIONS" + // "CSS_BACKGROUND_SIZE" + // "CSS_BORDER_IMAGE" + // "CSS_BORDER_RADIUS" + // "CSS_BOX_SHADOW" + // "CSS_COLUMNS" + // "CSS_FLEX_BOX" + // "CSS_FONT_FACE" + // "CSS_GENERATED_CONTENT" + // "CSS_GRADIENTS" + // "CSS_HSLA" + // "CSS_MULTIPLE_BGS" + // "CSS_OPACITY" + // "CSS_REFLECTIONS" + // "CSS_RGBA" + // "CSS_TEXT_SHADOW" + // "CSS_TRANSFORMS" + // "CSS_TRANSFORMS3D" + // "CSS_TRANSITIONS" + // "DRAG_AND_DROP" + // "GEO_LOCATION" + // "HASH_CHANGE" + // "HISTORY" + // "INDEXED_DB" + // "INLINE_SVG" + // "INPUT_ATTR_AUTOCOMPLETE" + // "INPUT_ATTR_AUTOFOCUS" + // "INPUT_ATTR_LIST" + // "INPUT_ATTR_MAX" + // "INPUT_ATTR_MIN" + // "INPUT_ATTR_MULTIPLE" + // "INPUT_ATTR_PATTERN" + // "INPUT_ATTR_PLACEHOLDER" + // "INPUT_ATTR_REQUIRED" + // "INPUT_ATTR_STEP" + // "INPUT_TYPE_COLOR" + // "INPUT_TYPE_DATE" + // "INPUT_TYPE_DATETIME" + // "INPUT_TYPE_DATETIME_LOCAL" + // "INPUT_TYPE_EMAIL" + // "INPUT_TYPE_MONTH" + // "INPUT_TYPE_NUMBER" + // "INPUT_TYPE_RANGE" + // "INPUT_TYPE_SEARCH" + // "INPUT_TYPE_TEL" + // "INPUT_TYPE_TIME" + // "INPUT_TYPE_URL" + // "INPUT_TYPE_WEEK" + // "LOCAL_STORAGE" + // "POST_MESSAGE" + // "SESSION_STORAGE" + // "SMIL" + // "SVG_CLIP_PATHS" + // "SVG_FE_IMAGE" + // "SVG_FILTERS" + // "SVG_HREF" + // "TOUCH" + // "VIDEO" + // "WEBGL" + // "WEB_SOCKETS" + // "WEB_SQL_DATABASE" + // "WEB_WORKERS" + BackupImageFeatures []string `json:"backupImageFeatures,omitempty"` + + // BackupImageReportingLabel: Reporting label used for HTML5 banner + // backup image. Applicable to the following creative types: + // ENHANCED_BANNER. + BackupImageReportingLabel string `json:"backupImageReportingLabel,omitempty"` + + // BackupImageTargetWindow: Target window for backup image. Applicable + // to the following creative types: ENHANCED_BANNER, FLASH_INPAGE, and + // HTML5_BANNER. + BackupImageTargetWindow *TargetWindow `json:"backupImageTargetWindow,omitempty"` + + // ClickTags: Click tags of the creative. For ENHANCED_BANNER, + // FLASH_INPAGE, and HTML5_BANNER creatives, this is a subset of + // detected click tags for the assets associated with this creative. + // After creating a flash asset, detected click tags will be returned in + // the creativeAssetMetadata. When inserting the creative, populate the + // creative clickTags field using the creativeAssetMetadata.clickTags + // field. For ENHANCED_IMAGE creatives, there should be exactly one + // entry in this list for each image creative asset. A click tag is + // matched with a corresponding creative asset by matching the + // clickTag.name field with the creativeAsset.assetIdentifier.name + // field. Applicable to the following creative types: ENHANCED_BANNER, + // ENHANCED_IMAGE, FLASH_INPAGE, HTML5_BANNER. + ClickTags []*ClickTag `json:"clickTags,omitempty"` + + // CommercialId: Industry standard ID assigned to creative for reach and + // frequency. Applicable to the following creative types: INSTREAM_VIDEO + // and all VPAID. + CommercialId string `json:"commercialId,omitempty"` + + // CompanionCreatives: List of companion creatives assigned to an + // in-Stream videocreative. Acceptable values include IDs of existing + // flash and image creatives. Applicable to the following creative + // types: INSTREAM_VIDEO and all VPAID. + CompanionCreatives googleapi.Int64s `json:"companionCreatives,omitempty"` + + // Compatibility: Compatibilities associated with this creative. This is + // a read-only field. WEB and WEB_INTERSTITIAL refer to rendering either + // on desktop or on mobile devices for regular or interstitial ads, + // respectively. APP and APP_INTERSTITIAL are for rendering in mobile + // apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads + // developed with the VAST standard. Applicable to all creative + // types. + // + // Acceptable values are: + // - "APP" + // - "APP_INTERSTITIAL" + // - "IN_STREAM_VIDEO" + // - "WEB" + // - "WEB_INTERSTITIAL" + // + // Possible values: + // "APP" + // "APP_INTERSTITIAL" + // "IN_STREAM_VIDEO" + // "WEB" + // "WEB_INTERSTITIAL" + Compatibility []string `json:"compatibility,omitempty"` + + // ConvertFlashToHtml5: Whether Flash assets associated with the + // creative need to be automatically converted to HTML5. This flag is + // enabled by default and users can choose to disable it if they don't + // want the system to generate and use HTML5 asset for this creative. + // Applicable to the following creative types: ENHANCED_BANNER and + // FLASH_INPAGE. + ConvertFlashToHtml5 bool `json:"convertFlashToHtml5,omitempty"` + + // CounterCustomEvents: List of counter events configured for the + // creative. Applicable to the following creative types: all RICH_MEDIA, + // and all VPAID. + CounterCustomEvents []*CreativeCustomEvent `json:"counterCustomEvents,omitempty"` + + // CreativeAssets: Assets associated with a creative. Applicable to all + // but the following creative types: INTERNAL_REDIRECT, + // INTERSTITIAL_INTERNAL_REDIRECT, and REDIRECT + CreativeAssets []*CreativeAsset `json:"creativeAssets,omitempty"` + + // CreativeFieldAssignments: Creative field assignments for this + // creative. Applicable to all creative types. + CreativeFieldAssignments []*CreativeFieldAssignment `json:"creativeFieldAssignments,omitempty"` + + // CustomKeyValues: Custom key-values for a Rich Media creative. + // Key-values let you customize the creative settings of a Rich Media ad + // running on your site without having to contact the advertiser. You + // can use key-values to dynamically change the look or functionality of + // a creative. Applicable to the following creative types: all + // RICH_MEDIA, and all VPAID. + CustomKeyValues []string `json:"customKeyValues,omitempty"` + + // ExitCustomEvents: List of exit events configured for the creative. + // Applicable to the following creative types: all RICH_MEDIA, and all + // VPAID. + ExitCustomEvents []*CreativeCustomEvent `json:"exitCustomEvents,omitempty"` + + // FsCommand: OpenWindow FSCommand of this creative. This lets the SWF + // file communicate with either Flash Player or the program hosting + // Flash Player, such as a web browser. This is only triggered if + // allowScriptAccess field is true. Applicable to the following creative + // types: FLASH_INPAGE. + FsCommand *FsCommand `json:"fsCommand,omitempty"` + + // HtmlCode: HTML code for the creative. This is a required field when + // applicable. This field is ignored if htmlCodeLocked is false. + // Applicable to the following creative types: all CUSTOM, FLASH_INPAGE, + // and HTML5_BANNER, and all RICH_MEDIA. + HtmlCode string `json:"htmlCode,omitempty"` + + // HtmlCodeLocked: Whether HTML code is DCM-generated or manually + // entered. Set to true to ignore changes to htmlCode. Applicable to the + // following creative types: FLASH_INPAGE and HTML5_BANNER. + HtmlCodeLocked bool `json:"htmlCodeLocked,omitempty"` + + // Id: ID of this creative. This is a read-only, auto-generated field. + // Applicable to all creative types. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this creative. This + // is a read-only field. Applicable to all creative types. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creative". + Kind string `json:"kind,omitempty"` + + // LastModifiedInfo: Creative last modification information. This is a + // read-only field. Applicable to all creative types. + LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"` + + // LatestTraffickedCreativeId: Latest Studio trafficked creative ID + // associated with rich media and VPAID creatives. This is a read-only + // field. Applicable to the following creative types: all RICH_MEDIA, + // and all VPAID. + LatestTraffickedCreativeId int64 `json:"latestTraffickedCreativeId,omitempty,string"` + + // Name: Name of the creative. This is a required field and must be less + // than 256 characters long. Applicable to all creative types. + Name string `json:"name,omitempty"` + + // OverrideCss: Override CSS value for rich media creatives. Applicable + // to the following creative types: all RICH_MEDIA. + OverrideCss string `json:"overrideCss,omitempty"` + + // RedirectUrl: URL of hosted image or another ad tag. This is a + // required field when applicable. Applicable to the following creative + // types: INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and + // REDIRECT + RedirectUrl string `json:"redirectUrl,omitempty"` + + // RenderingId: ID of current rendering version. This is a read-only + // field. Applicable to all creative types. + RenderingId int64 `json:"renderingId,omitempty,string"` + + // RenderingIdDimensionValue: Dimension value for the rendering ID of + // this creative. This is a read-only field. Applicable to all creative + // types. + RenderingIdDimensionValue *DimensionValue `json:"renderingIdDimensionValue,omitempty"` + + // RequiredFlashPluginVersion: The minimum required Flash plugin version + // for this creative. For example, 11.2.202.235. This is a read-only + // field. Applicable to the following creative types: all RICH_MEDIA, + // and all VPAID. + RequiredFlashPluginVersion string `json:"requiredFlashPluginVersion,omitempty"` + + // RequiredFlashVersion: The internal Flash version for this creative as + // calculated by DoubleClick Studio. This is a read-only field. + // Applicable to the following creative types: FLASH_INPAGE, + // ENHANCED_BANNER, all RICH_MEDIA, and all VPAID. + RequiredFlashVersion int64 `json:"requiredFlashVersion,omitempty"` + + // Size: Size associated with this creative. When inserting or updating + // a creative either the size ID field or size width and height fields + // can be used. This is a required field when applicable; however for + // IMAGE and FLASH_INPAGE creatives, if left blank, this field will be + // automatically set using the actual size of the associated image + // assets. Applicable to the following creative types: ENHANCED_BANNER, + // ENHANCED_IMAGE, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all + // RICH_MEDIA. + Size *Size `json:"size,omitempty"` + + // Skippable: Whether the user can choose to skip the creative. + // Applicable to the following creative types: INSTREAM_VIDEO. + Skippable bool `json:"skippable,omitempty"` + + // SslCompliant: Whether the creative is SSL-compliant. This is a + // read-only field. Applicable to all creative types. + SslCompliant bool `json:"sslCompliant,omitempty"` + + // StudioAdvertiserId: Studio advertiser ID associated with rich media + // and VPAID creatives. This is a read-only field. Applicable to the + // following creative types: all RICH_MEDIA, and all VPAID. + StudioAdvertiserId int64 `json:"studioAdvertiserId,omitempty,string"` + + // StudioCreativeId: Studio creative ID associated with rich media and + // VPAID creatives. This is a read-only field. Applicable to the + // following creative types: all RICH_MEDIA, and all VPAID. + StudioCreativeId int64 `json:"studioCreativeId,omitempty,string"` + + // StudioTraffickedCreativeId: Studio trafficked creative ID associated + // with rich media and VPAID creatives. This is a read-only field. + // Applicable to the following creative types: all RICH_MEDIA, and all + // VPAID. + StudioTraffickedCreativeId int64 `json:"studioTraffickedCreativeId,omitempty,string"` + + // SubaccountId: Subaccount ID of this creative. This field, if left + // unset, will be auto-generated for both insert and update operations. + // Applicable to all creative types. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // ThirdPartyBackupImageImpressionsUrl: Third-party URL used to record + // backup image impressions. Applicable to the following creative types: + // all RICH_MEDIA + ThirdPartyBackupImageImpressionsUrl string `json:"thirdPartyBackupImageImpressionsUrl,omitempty"` + + // ThirdPartyRichMediaImpressionsUrl: Third-party URL used to record + // rich media impressions. Applicable to the following creative types: + // all RICH_MEDIA + ThirdPartyRichMediaImpressionsUrl string `json:"thirdPartyRichMediaImpressionsUrl,omitempty"` + + // ThirdPartyUrls: Third-party URLs for tracking in-stream video + // creative events. Applicable to the following creative types: + // INSTREAM_VIDEO and all VPAID. + ThirdPartyUrls []*ThirdPartyTrackingUrl `json:"thirdPartyUrls,omitempty"` + + // TimerCustomEvents: List of timer events configured for the creative. + // Applicable to the following creative types: all RICH_MEDIA, and all + // VPAID. + TimerCustomEvents []*CreativeCustomEvent `json:"timerCustomEvents,omitempty"` + + // TotalFileSize: Combined size of all creative assets. This is a + // read-only field. Applicable to the following creative types: all + // RICH_MEDIA, and all VPAID. + TotalFileSize int64 `json:"totalFileSize,omitempty,string"` + + // Type: Type of this creative.This is a required field. Applicable to + // all creative types. + // + // Possible values: + // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO" + // "CUSTOM_INPAGE" + // "CUSTOM_INTERSTITIAL" + // "ENHANCED_BANNER" + // "ENHANCED_IMAGE" + // "FLASH_INPAGE" + // "HTML5_BANNER" + // "IMAGE" + // "INSTREAM_VIDEO" + // "INTERNAL_REDIRECT" + // "INTERSTITIAL_INTERNAL_REDIRECT" + // "REDIRECT" + // "RICH_MEDIA_EXPANDING" + // "RICH_MEDIA_IM_EXPAND" + // "RICH_MEDIA_INPAGE" + // "RICH_MEDIA_INPAGE_FLOATING" + // "RICH_MEDIA_INTERSTITIAL_FLOAT" + // "RICH_MEDIA_MOBILE_IN_APP" + // "RICH_MEDIA_MULTI_FLOATING" + // "RICH_MEDIA_PEEL_DOWN" + // "TRACKING_TEXT" + // "VAST_REDIRECT" + // "VPAID_LINEAR" + // "VPAID_NON_LINEAR" + Type string `json:"type,omitempty"` + + // Version: The version number helps you keep track of multiple versions + // of your creative in your reports. The version number will always be + // auto-generated during insert operations to start at 1. For tracking + // creatives the version cannot be incremented and will always remain at + // 1. For all other creative types the version can be incremented only + // by 1 during update operations. In addition, the version will be + // automatically incremented by 1 when undergoing Rich Media creative + // merging. Applicable to all creative types. + Version int64 `json:"version,omitempty"` + + // VideoDescription: Description of the video ad. Applicable to the + // following creative types: INSTREAM_VIDEO and all VPAID. + VideoDescription string `json:"videoDescription,omitempty"` + + // VideoDuration: Creative video duration in seconds. This is a + // read-only field. Applicable to the following creative types: + // INSTREAM_VIDEO, all RICH_MEDIA, and all VPAID. + VideoDuration float64 `json:"videoDuration,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Creative) MarshalJSON() ([]byte, error) { + type noMethod Creative + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeAsset: Creative Asset. +type CreativeAsset struct { + // ActionScript3: Whether ActionScript3 is enabled for the flash asset. + // This is a read-only field. Applicable to the following creative + // types: FLASH_INPAGE and ENHANCED_BANNER. + ActionScript3 bool `json:"actionScript3,omitempty"` + + // Active: Whether the video asset is active. This is a read-only field + // for VPAID_NON_LINEAR assets. Applicable to the following creative + // types: INSTREAM_VIDEO and all VPAID. + Active bool `json:"active,omitempty"` + + // Alignment: Possible alignments for an asset. This is a read-only + // field. Applicable to the following creative types: + // RICH_MEDIA_MULTI_FLOATING. + // + // Possible values: + // "ALIGNMENT_BOTTOM" + // "ALIGNMENT_LEFT" + // "ALIGNMENT_RIGHT" + // "ALIGNMENT_TOP" + Alignment string `json:"alignment,omitempty"` + + // ArtworkType: Artwork type of rich media creative. This is a read-only + // field. Applicable to the following creative types: all RICH_MEDIA. + // + // Possible values: + // "ARTWORK_TYPE_FLASH" + // "ARTWORK_TYPE_HTML5" + // "ARTWORK_TYPE_MIXED" + ArtworkType string `json:"artworkType,omitempty"` + + // AssetIdentifier: Identifier of this asset. This is the same + // identifier returned during creative asset insert operation. This is a + // required field. Applicable to all but the following creative types: + // all REDIRECT and TRACKING_TEXT. + AssetIdentifier *CreativeAssetId `json:"assetIdentifier,omitempty"` + + // BackupImageExit: Exit event configured for the backup image. + // Applicable to the following creative types: all RICH_MEDIA. + BackupImageExit *CreativeCustomEvent `json:"backupImageExit,omitempty"` + + // BitRate: Detected bit-rate for video asset. This is a read-only + // field. Applicable to the following creative types: INSTREAM_VIDEO and + // all VPAID. + BitRate int64 `json:"bitRate,omitempty"` + + // ChildAssetType: Rich media child asset type. This is a read-only + // field. Applicable to the following creative types: all VPAID. + // + // Possible values: + // "CHILD_ASSET_TYPE_DATA" + // "CHILD_ASSET_TYPE_FLASH" + // "CHILD_ASSET_TYPE_IMAGE" + // "CHILD_ASSET_TYPE_VIDEO" + ChildAssetType string `json:"childAssetType,omitempty"` + + // CollapsedSize: Size of an asset when collapsed. This is a read-only + // field. Applicable to the following creative types: all RICH_MEDIA and + // all VPAID. Additionally, applicable to assets whose displayType is + // ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN. + CollapsedSize *Size `json:"collapsedSize,omitempty"` + + // CustomStartTimeValue: Custom start time in seconds for making the + // asset visible. Applicable to the following creative types: all + // RICH_MEDIA. + CustomStartTimeValue int64 `json:"customStartTimeValue,omitempty"` + + // DetectedFeatures: List of feature dependencies for the creative asset + // that are detected by DCM. Feature dependencies are features that a + // browser must be able to support in order to render your HTML5 + // creative correctly. This is a read-only, auto-generated field. + // Applicable to the following creative types: ENHANCED_BANNER and + // HTML5_BANNER. + // + // Possible values: + // "APPLICATION_CACHE" + // "AUDIO" + // "CANVAS" + // "CANVAS_TEXT" + // "CSS_ANIMATIONS" + // "CSS_BACKGROUND_SIZE" + // "CSS_BORDER_IMAGE" + // "CSS_BORDER_RADIUS" + // "CSS_BOX_SHADOW" + // "CSS_COLUMNS" + // "CSS_FLEX_BOX" + // "CSS_FONT_FACE" + // "CSS_GENERATED_CONTENT" + // "CSS_GRADIENTS" + // "CSS_HSLA" + // "CSS_MULTIPLE_BGS" + // "CSS_OPACITY" + // "CSS_REFLECTIONS" + // "CSS_RGBA" + // "CSS_TEXT_SHADOW" + // "CSS_TRANSFORMS" + // "CSS_TRANSFORMS3D" + // "CSS_TRANSITIONS" + // "DRAG_AND_DROP" + // "GEO_LOCATION" + // "HASH_CHANGE" + // "HISTORY" + // "INDEXED_DB" + // "INLINE_SVG" + // "INPUT_ATTR_AUTOCOMPLETE" + // "INPUT_ATTR_AUTOFOCUS" + // "INPUT_ATTR_LIST" + // "INPUT_ATTR_MAX" + // "INPUT_ATTR_MIN" + // "INPUT_ATTR_MULTIPLE" + // "INPUT_ATTR_PATTERN" + // "INPUT_ATTR_PLACEHOLDER" + // "INPUT_ATTR_REQUIRED" + // "INPUT_ATTR_STEP" + // "INPUT_TYPE_COLOR" + // "INPUT_TYPE_DATE" + // "INPUT_TYPE_DATETIME" + // "INPUT_TYPE_DATETIME_LOCAL" + // "INPUT_TYPE_EMAIL" + // "INPUT_TYPE_MONTH" + // "INPUT_TYPE_NUMBER" + // "INPUT_TYPE_RANGE" + // "INPUT_TYPE_SEARCH" + // "INPUT_TYPE_TEL" + // "INPUT_TYPE_TIME" + // "INPUT_TYPE_URL" + // "INPUT_TYPE_WEEK" + // "LOCAL_STORAGE" + // "POST_MESSAGE" + // "SESSION_STORAGE" + // "SMIL" + // "SVG_CLIP_PATHS" + // "SVG_FE_IMAGE" + // "SVG_FILTERS" + // "SVG_HREF" + // "TOUCH" + // "VIDEO" + // "WEBGL" + // "WEB_SOCKETS" + // "WEB_SQL_DATABASE" + // "WEB_WORKERS" + DetectedFeatures []string `json:"detectedFeatures,omitempty"` + + // DisplayType: Type of rich media asset. This is a read-only field. + // Applicable to the following creative types: all RICH_MEDIA. + // + // Possible values: + // "ASSET_DISPLAY_TYPE_EXPANDING" + // "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH" + // "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH_EXPANDING" + // "ASSET_DISPLAY_TYPE_FLOATING" + // "ASSET_DISPLAY_TYPE_INPAGE" + // "ASSET_DISPLAY_TYPE_OVERLAY" + // "ASSET_DISPLAY_TYPE_PEEL_DOWN" + // "ASSET_DISPLAY_TYPE_VPAID_LINEAR" + // "ASSET_DISPLAY_TYPE_VPAID_NON_LINEAR" + DisplayType string `json:"displayType,omitempty"` + + // Duration: Duration in seconds for which an asset will be displayed. + // Applicable to the following creative types: INSTREAM_VIDEO and + // VPAID_LINEAR. + Duration int64 `json:"duration,omitempty"` + + // DurationType: Duration type for which an asset will be displayed. + // Applicable to the following creative types: all RICH_MEDIA. + // + // Possible values: + // "ASSET_DURATION_TYPE_AUTO" + // "ASSET_DURATION_TYPE_CUSTOM" + // "ASSET_DURATION_TYPE_NONE" + DurationType string `json:"durationType,omitempty"` + + // ExpandedDimension: Detected expanded dimension for video asset. This + // is a read-only field. Applicable to the following creative types: + // INSTREAM_VIDEO and all VPAID. + ExpandedDimension *Size `json:"expandedDimension,omitempty"` + + // FileSize: File size associated with this creative asset. This is a + // read-only field. Applicable to all but the following creative types: + // all REDIRECT and TRACKING_TEXT. + FileSize int64 `json:"fileSize,omitempty,string"` + + // FlashVersion: Flash version of the asset. This is a read-only field. + // Applicable to the following creative types: FLASH_INPAGE, + // ENHANCED_BANNER, all RICH_MEDIA, and all VPAID. + FlashVersion int64 `json:"flashVersion,omitempty"` + + // HideFlashObjects: Whether to hide Flash objects flag for an asset. + // Applicable to the following creative types: all RICH_MEDIA. + HideFlashObjects bool `json:"hideFlashObjects,omitempty"` + + // HideSelectionBoxes: Whether to hide selection boxes flag for an + // asset. Applicable to the following creative types: all RICH_MEDIA. + HideSelectionBoxes bool `json:"hideSelectionBoxes,omitempty"` + + // HorizontallyLocked: Whether the asset is horizontally locked. This is + // a read-only field. Applicable to the following creative types: all + // RICH_MEDIA. + HorizontallyLocked bool `json:"horizontallyLocked,omitempty"` + + // Id: Numeric ID of this creative asset. This is a required field and + // should not be modified. Applicable to all but the following creative + // types: all REDIRECT and TRACKING_TEXT. + Id int64 `json:"id,omitempty,string"` + + // MimeType: Detected MIME type for video asset. This is a read-only + // field. Applicable to the following creative types: INSTREAM_VIDEO and + // all VPAID. + MimeType string `json:"mimeType,omitempty"` + + // Offset: Offset position for an asset in collapsed mode. This is a + // read-only field. Applicable to the following creative types: all + // RICH_MEDIA and all VPAID. Additionally, only applicable to assets + // whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or + // ASSET_DISPLAY_TYPE_PEEL_DOWN. + Offset *OffsetPosition `json:"offset,omitempty"` + + // OriginalBackup: Whether the backup asset is original or changed by + // the user in DCM. Applicable to the following creative types: all + // RICH_MEDIA. + OriginalBackup bool `json:"originalBackup,omitempty"` + + // Position: Offset position for an asset. Applicable to the following + // creative types: all RICH_MEDIA. + Position *OffsetPosition `json:"position,omitempty"` + + // PositionLeftUnit: Offset left unit for an asset. This is a read-only + // field. Applicable to the following creative types: all RICH_MEDIA. + // + // Possible values: + // "OFFSET_UNIT_PERCENT" + // "OFFSET_UNIT_PIXEL" + // "OFFSET_UNIT_PIXEL_FROM_CENTER" + PositionLeftUnit string `json:"positionLeftUnit,omitempty"` + + // PositionTopUnit: Offset top unit for an asset. This is a read-only + // field if the asset displayType is ASSET_DISPLAY_TYPE_OVERLAY. + // Applicable to the following creative types: all RICH_MEDIA. + // + // Possible values: + // "OFFSET_UNIT_PERCENT" + // "OFFSET_UNIT_PIXEL" + // "OFFSET_UNIT_PIXEL_FROM_CENTER" + PositionTopUnit string `json:"positionTopUnit,omitempty"` + + // ProgressiveServingUrl: Progressive URL for video asset. This is a + // read-only field. Applicable to the following creative types: + // INSTREAM_VIDEO and all VPAID. + ProgressiveServingUrl string `json:"progressiveServingUrl,omitempty"` + + // Pushdown: Whether the asset pushes down other content. Applicable to + // the following creative types: all RICH_MEDIA. Additionally, only + // applicable when the asset offsets are 0, the collapsedSize.width + // matches size.width, and the collapsedSize.height is less than + // size.height. + Pushdown bool `json:"pushdown,omitempty"` + + // PushdownDuration: Pushdown duration in seconds for an asset. Must be + // between 0 and 9.99. Applicable to the following creative types: all + // RICH_MEDIA.Additionally, only applicable when the asset pushdown + // field is true, the offsets are 0, the collapsedSize.width matches + // size.width, and the collapsedSize.height is less than size.height. + PushdownDuration float64 `json:"pushdownDuration,omitempty"` + + // Role: Role of the asset in relation to creative. Applicable to all + // but the following creative types: all REDIRECT and TRACKING_TEXT. + // This is a required field. + // PRIMARY applies to ENHANCED_BANNER, FLASH_INPAGE, HTML5_BANNER, + // IMAGE, IMAGE_GALLERY, all RICH_MEDIA (which may contain multiple + // primary assets), and all VPAID creatives. + // BACKUP_IMAGE applies to ENHANCED_BANNER, FLASH_INPAGE, HTML5_BANNER, + // all RICH_MEDIA, and all VPAID creatives. + // ADDITIONAL_IMAGE and ADDITIONAL_FLASH apply to FLASH_INPAGE + // creatives. + // OTHER refers to assets from sources other than DCM, such as Studio + // uploaded assets, applicable to all RICH_MEDIA and all VPAID + // creatives. + // PARENT_VIDEO refers to videos uploaded by the user in DCM and is + // applicable to INSTREAM_VIDEO and VPAID_LINEAR + // creatives. + // TRANSCODED_VIDEO refers to videos transcoded by DCM from PARENT_VIDEO + // assets and is applicable to INSTREAM_VIDEO and VPAID_LINEAR + // creatives. + // ALTERNATE_VIDEO refers to the DCM representation of child asset + // videos from Studio, and is applicable to VPAID_LINEAR creatives. + // These cannot be added or removed within DCM. + // For VPAID_LINEAR creatives, PARENT_VIDEO, TRANSCODED_VIDEO and + // ALTERNATE_VIDEO assets that are marked active serve as backup in case + // the VPAID creative cannot be served. Only PARENT_VIDEO assets can be + // added or removed for an INSTREAM_VIDEO or VPAID_LINEAR creative. + // + // Possible values: + // "ADDITIONAL_FLASH" + // "ADDITIONAL_IMAGE" + // "ALTERNATE_VIDEO" + // "BACKUP_IMAGE" + // "OTHER" + // "PARENT_VIDEO" + // "PRIMARY" + // "TRANSCODED_VIDEO" + Role string `json:"role,omitempty"` + + // Size: Size associated with this creative asset. This is a required + // field when applicable; however for IMAGE and FLASH_INPAGE creatives, + // if left blank, this field will be automatically set using the actual + // size of the associated image asset. Applicable to the following + // creative types: ENHANCED_BANNER, ENHANCED_IMAGE, FLASH_INPAGE, + // HTML5_BANNER, IMAGE, and all RICH_MEDIA. + Size *Size `json:"size,omitempty"` + + // SslCompliant: Whether the asset is SSL-compliant. This is a read-only + // field. Applicable to all but the following creative types: all + // REDIRECT and TRACKING_TEXT. + SslCompliant bool `json:"sslCompliant,omitempty"` + + // StartTimeType: Initial wait time type before making the asset + // visible. Applicable to the following creative types: all RICH_MEDIA. + // + // Possible values: + // "ASSET_START_TIME_TYPE_CUSTOM" + // "ASSET_START_TIME_TYPE_NONE" + StartTimeType string `json:"startTimeType,omitempty"` + + // StreamingServingUrl: Streaming URL for video asset. This is a + // read-only field. Applicable to the following creative types: + // INSTREAM_VIDEO and all VPAID. + StreamingServingUrl string `json:"streamingServingUrl,omitempty"` + + // Transparency: Whether the asset is transparent. Applicable to the + // following creative types: all RICH_MEDIA. Additionally, only + // applicable to HTML5 assets. + Transparency bool `json:"transparency,omitempty"` + + // VerticallyLocked: Whether the asset is vertically locked. This is a + // read-only field. Applicable to the following creative types: all + // RICH_MEDIA. + VerticallyLocked bool `json:"verticallyLocked,omitempty"` + + // VideoDuration: Detected video duration for video asset. This is a + // read-only field. Applicable to the following creative types: + // INSTREAM_VIDEO and all VPAID. + VideoDuration float64 `json:"videoDuration,omitempty"` + + // WindowMode: Window mode options for flash assets. Applicable to the + // following creative types: FLASH_INPAGE, RICH_MEDIA_EXPANDING, + // RICH_MEDIA_IM_EXPAND, RICH_MEDIA_INPAGE, and + // RICH_MEDIA_INPAGE_FLOATING. + // + // Possible values: + // "OPAQUE" + // "TRANSPARENT" + // "WINDOW" + WindowMode string `json:"windowMode,omitempty"` + + // ZIndex: zIndex value of an asset. This is a read-only field. + // Applicable to the following creative types: all + // RICH_MEDIA.Additionally, only applicable to assets whose displayType + // is NOT one of the following types: ASSET_DISPLAY_TYPE_INPAGE or + // ASSET_DISPLAY_TYPE_OVERLAY. + ZIndex int64 `json:"zIndex,omitempty"` + + // ZipFilename: File name of zip file. This is a read-only field. + // Applicable to the following creative types: HTML5_BANNER. + ZipFilename string `json:"zipFilename,omitempty"` + + // ZipFilesize: Size of zip file. This is a read-only field. Applicable + // to the following creative types: HTML5_BANNER. + ZipFilesize string `json:"zipFilesize,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ActionScript3") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeAsset) MarshalJSON() ([]byte, error) { + type noMethod CreativeAsset + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeAssetId: Creative Asset ID. +type CreativeAssetId struct { + // Name: Name of the creative asset. This is a required field while + // inserting an asset. After insertion, this assetIdentifier is used to + // identify the uploaded asset. Characters in the name must be + // alphanumeric or one of the following: ".-_ ". Spaces are allowed. + Name string `json:"name,omitempty"` + + // Type: Type of asset to upload. This is a required field. IMAGE is + // solely used for IMAGE creatives. Other image assets should use + // HTML_IMAGE. + // + // Possible values: + // "FLASH" + // "HTML" + // "HTML_IMAGE" + // "IMAGE" + // "VIDEO" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeAssetId) MarshalJSON() ([]byte, error) { + type noMethod CreativeAssetId + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeAssetMetadata: CreativeAssets contains properties of a +// creative asset file which will be uploaded or has already been +// uploaded. Refer to the creative sample code for how to upload assets +// and insert a creative. +type CreativeAssetMetadata struct { + // AssetIdentifier: ID of the creative asset. This is a required field. + AssetIdentifier *CreativeAssetId `json:"assetIdentifier,omitempty"` + + // ClickTags: List of detected click tags for assets. This is a + // read-only auto-generated field. + ClickTags []*ClickTag `json:"clickTags,omitempty"` + + // DetectedFeatures: List of feature dependencies for the creative asset + // that are detected by DCM. Feature dependencies are features that a + // browser must be able to support in order to render your HTML5 + // creative correctly. This is a read-only, auto-generated field. + // + // Possible values: + // "APPLICATION_CACHE" + // "AUDIO" + // "CANVAS" + // "CANVAS_TEXT" + // "CSS_ANIMATIONS" + // "CSS_BACKGROUND_SIZE" + // "CSS_BORDER_IMAGE" + // "CSS_BORDER_RADIUS" + // "CSS_BOX_SHADOW" + // "CSS_COLUMNS" + // "CSS_FLEX_BOX" + // "CSS_FONT_FACE" + // "CSS_GENERATED_CONTENT" + // "CSS_GRADIENTS" + // "CSS_HSLA" + // "CSS_MULTIPLE_BGS" + // "CSS_OPACITY" + // "CSS_REFLECTIONS" + // "CSS_RGBA" + // "CSS_TEXT_SHADOW" + // "CSS_TRANSFORMS" + // "CSS_TRANSFORMS3D" + // "CSS_TRANSITIONS" + // "DRAG_AND_DROP" + // "GEO_LOCATION" + // "HASH_CHANGE" + // "HISTORY" + // "INDEXED_DB" + // "INLINE_SVG" + // "INPUT_ATTR_AUTOCOMPLETE" + // "INPUT_ATTR_AUTOFOCUS" + // "INPUT_ATTR_LIST" + // "INPUT_ATTR_MAX" + // "INPUT_ATTR_MIN" + // "INPUT_ATTR_MULTIPLE" + // "INPUT_ATTR_PATTERN" + // "INPUT_ATTR_PLACEHOLDER" + // "INPUT_ATTR_REQUIRED" + // "INPUT_ATTR_STEP" + // "INPUT_TYPE_COLOR" + // "INPUT_TYPE_DATE" + // "INPUT_TYPE_DATETIME" + // "INPUT_TYPE_DATETIME_LOCAL" + // "INPUT_TYPE_EMAIL" + // "INPUT_TYPE_MONTH" + // "INPUT_TYPE_NUMBER" + // "INPUT_TYPE_RANGE" + // "INPUT_TYPE_SEARCH" + // "INPUT_TYPE_TEL" + // "INPUT_TYPE_TIME" + // "INPUT_TYPE_URL" + // "INPUT_TYPE_WEEK" + // "LOCAL_STORAGE" + // "POST_MESSAGE" + // "SESSION_STORAGE" + // "SMIL" + // "SVG_CLIP_PATHS" + // "SVG_FE_IMAGE" + // "SVG_FILTERS" + // "SVG_HREF" + // "TOUCH" + // "VIDEO" + // "WEBGL" + // "WEB_SOCKETS" + // "WEB_SQL_DATABASE" + // "WEB_WORKERS" + DetectedFeatures []string `json:"detectedFeatures,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creativeAssetMetadata". + Kind string `json:"kind,omitempty"` + + // WarnedValidationRules: Rules validated during code generation that + // generated a warning. This is a read-only, auto-generated + // field. + // + // Possible values are: + // - "CLICK_TAG_NON_TOP_LEVEL" + // - "CLICK_TAG_MISSING" + // - "CLICK_TAG_MORE_THAN_ONE" + // - "CLICK_TAG_INVALID" + // - "ORPHANED_ASSET" + // - "PRIMARY_HTML_MISSING" + // - "EXTERNAL_FILE_REFERENCED" + // - "MRAID_REFERENCED" + // - "ADMOB_REFERENCED" + // - "FILE_TYPE_INVALID" + // - "ZIP_INVALID" + // - "LINKED_FILE_NOT_FOUND" + // - "MAX_FLASH_VERSION_11" + // - "NOT_SSL_COMPLIANT" + // - "FILE_DETAIL_EMPTY" + // - "ASSET_INVALID" + // - "GWD_PROPERTIES_INVALID" + // - "ENABLER_UNSUPPORTED_METHOD_DCM" + // - "ASSET_FORMAT_UNSUPPORTED_DCM" + // - "COMPONENT_UNSUPPORTED_DCM" + // - "HTML5_FEATURE_UNSUPPORTED' " + // + // Possible values: + // "ADMOB_REFERENCED" + // "ASSET_FORMAT_UNSUPPORTED_DCM" + // "ASSET_INVALID" + // "CLICK_TAG_INVALID" + // "CLICK_TAG_MISSING" + // "CLICK_TAG_MORE_THAN_ONE" + // "CLICK_TAG_NON_TOP_LEVEL" + // "COMPONENT_UNSUPPORTED_DCM" + // "ENABLER_UNSUPPORTED_METHOD_DCM" + // "EXTERNAL_FILE_REFERENCED" + // "FILE_DETAIL_EMPTY" + // "FILE_TYPE_INVALID" + // "GWD_PROPERTIES_INVALID" + // "HTML5_FEATURE_UNSUPPORTED" + // "LINKED_FILE_NOT_FOUND" + // "MAX_FLASH_VERSION_11" + // "MRAID_REFERENCED" + // "NOT_SSL_COMPLIANT" + // "ORPHANED_ASSET" + // "PRIMARY_HTML_MISSING" + // "ZIP_INVALID" + WarnedValidationRules []string `json:"warnedValidationRules,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AssetIdentifier") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeAssetMetadata) MarshalJSON() ([]byte, error) { + type noMethod CreativeAssetMetadata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeAssignment: Creative Assignment. +type CreativeAssignment struct { + // Active: Whether this creative assignment is active. When true, the + // creative will be included in the ad's rotation. + Active bool `json:"active,omitempty"` + + // ApplyEventTags: Whether applicable event tags should fire when this + // creative assignment is rendered. If this value is unset when the ad + // is inserted or updated, it will default to true for all creative + // types EXCEPT for INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, + // and INSTREAM_VIDEO. + ApplyEventTags bool `json:"applyEventTags,omitempty"` + + // ClickThroughUrl: Click-through URL of the creative assignment. + ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"` + + // CompanionCreativeOverrides: Companion creative overrides for this + // creative assignment. Applicable to video ads. + CompanionCreativeOverrides []*CompanionClickThroughOverride `json:"companionCreativeOverrides,omitempty"` + + // CreativeGroupAssignments: Creative group assignments for this + // creative assignment. Only one assignment per creative group number is + // allowed for a maximum of two assignments. + CreativeGroupAssignments []*CreativeGroupAssignment `json:"creativeGroupAssignments,omitempty"` + + // CreativeId: ID of the creative to be assigned. This is a required + // field. + CreativeId int64 `json:"creativeId,omitempty,string"` + + // CreativeIdDimensionValue: Dimension value for the ID of the creative. + // This is a read-only, auto-generated field. + CreativeIdDimensionValue *DimensionValue `json:"creativeIdDimensionValue,omitempty"` + + // EndTime: Date and time that the assigned creative should stop + // serving. Must be later than the start time. + EndTime string `json:"endTime,omitempty"` + + // RichMediaExitOverrides: Rich media exit overrides for this creative + // assignment. + // Applicable when the creative type is any of the following: + // - RICH_MEDIA_INPAGE + // - RICH_MEDIA_INPAGE_FLOATING + // - RICH_MEDIA_IM_EXPAND + // - RICH_MEDIA_EXPANDING + // - RICH_MEDIA_INTERSTITIAL_FLOAT + // - RICH_MEDIA_MOBILE_IN_APP + // - RICH_MEDIA_MULTI_FLOATING + // - RICH_MEDIA_PEEL_DOWN + // - ADVANCED_BANNER + // - VPAID_LINEAR + // - VPAID_NON_LINEAR + RichMediaExitOverrides []*RichMediaExitOverride `json:"richMediaExitOverrides,omitempty"` + + // Sequence: Sequence number of the creative assignment, applicable when + // the rotation type is CREATIVE_ROTATION_TYPE_SEQUENTIAL. + Sequence int64 `json:"sequence,omitempty"` + + // SslCompliant: Whether the creative to be assigned is SSL-compliant. + // This is a read-only field that is auto-generated when the ad is + // inserted or updated. + SslCompliant bool `json:"sslCompliant,omitempty"` + + // StartTime: Date and time that the assigned creative should start + // serving. + StartTime string `json:"startTime,omitempty"` + + // Weight: Weight of the creative assignment, applicable when the + // rotation type is CREATIVE_ROTATION_TYPE_RANDOM. + Weight int64 `json:"weight,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Active") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeAssignment) MarshalJSON() ([]byte, error) { + type noMethod CreativeAssignment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeCustomEvent: Creative Custom Event. +type CreativeCustomEvent struct { + // Active: Whether the event is active. + Active bool `json:"active,omitempty"` + + // AdvertiserCustomEventName: User-entered name for the event. + AdvertiserCustomEventName string `json:"advertiserCustomEventName,omitempty"` + + // AdvertiserCustomEventType: Type of the event. This is a read-only + // field. + // + // Possible values: + // "ADVERTISER_EVENT_COUNTER" + // "ADVERTISER_EVENT_EXIT" + // "ADVERTISER_EVENT_TIMER" + AdvertiserCustomEventType string `json:"advertiserCustomEventType,omitempty"` + + // ArtworkLabel: Artwork label column, used to link events in DCM back + // to events in Studio. This is a required field and should not be + // modified after insertion. + ArtworkLabel string `json:"artworkLabel,omitempty"` + + // ArtworkType: Artwork type used by the creative.This is a read-only + // field. + // + // Possible values: + // "ARTWORK_TYPE_FLASH" + // "ARTWORK_TYPE_HTML5" + // "ARTWORK_TYPE_MIXED" + ArtworkType string `json:"artworkType,omitempty"` + + // ExitUrl: Exit URL of the event. This field is used only for exit + // events. + ExitUrl string `json:"exitUrl,omitempty"` + + // Id: ID of this event. This is a required field and should not be + // modified after insertion. + Id int64 `json:"id,omitempty,string"` + + // PopupWindowProperties: Properties for rich media popup windows. This + // field is used only for exit events. + PopupWindowProperties *PopupWindowProperties `json:"popupWindowProperties,omitempty"` + + // TargetType: Target type used by the event. + // + // Possible values: + // "TARGET_BLANK" + // "TARGET_PARENT" + // "TARGET_POPUP" + // "TARGET_SELF" + // "TARGET_TOP" + TargetType string `json:"targetType,omitempty"` + + // VideoReportingId: Reporting ID, used to differentiate multiple videos + // in a single creative. + VideoReportingId string `json:"videoReportingId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Active") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeCustomEvent) MarshalJSON() ([]byte, error) { + type noMethod CreativeCustomEvent + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeField: Contains properties of a creative field. +type CreativeField struct { + // AccountId: Account ID of this creative field. This is a read-only + // field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this creative field. This is a + // required field on insertion. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // Id: ID of this creative field. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creativeField". + Kind string `json:"kind,omitempty"` + + // Name: Name of this creative field. This is a required field and must + // be less than 256 characters long and unique among creative fields of + // the same advertiser. + Name string `json:"name,omitempty"` + + // SubaccountId: Subaccount ID of this creative field. This is a + // read-only field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeField) MarshalJSON() ([]byte, error) { + type noMethod CreativeField + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeFieldAssignment: Creative Field Assignment. +type CreativeFieldAssignment struct { + // CreativeFieldId: ID of the creative field. + CreativeFieldId int64 `json:"creativeFieldId,omitempty,string"` + + // CreativeFieldValueId: ID of the creative field value. + CreativeFieldValueId int64 `json:"creativeFieldValueId,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "CreativeFieldId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeFieldAssignment) MarshalJSON() ([]byte, error) { + type noMethod CreativeFieldAssignment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeFieldValue: Contains properties of a creative field value. +type CreativeFieldValue struct { + // Id: ID of this creative field value. This is a read-only, + // auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creativeFieldValue". + Kind string `json:"kind,omitempty"` + + // Value: Value of this creative field value. It needs to be less than + // 256 characters in length and unique per creative field. + Value string `json:"value,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeFieldValue) MarshalJSON() ([]byte, error) { + type noMethod CreativeFieldValue + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeFieldValuesListResponse: Creative Field Value List Response +type CreativeFieldValuesListResponse struct { + // CreativeFieldValues: Creative field value collection. + CreativeFieldValues []*CreativeFieldValue `json:"creativeFieldValues,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creativeFieldValuesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreativeFieldValues") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeFieldValuesListResponse) MarshalJSON() ([]byte, error) { + type noMethod CreativeFieldValuesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeFieldsListResponse: Creative Field List Response +type CreativeFieldsListResponse struct { + // CreativeFields: Creative field collection. + CreativeFields []*CreativeField `json:"creativeFields,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creativeFieldsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreativeFields") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeFieldsListResponse) MarshalJSON() ([]byte, error) { + type noMethod CreativeFieldsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeGroup: Contains properties of a creative group. +type CreativeGroup struct { + // AccountId: Account ID of this creative group. This is a read-only + // field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this creative group. This is a + // required field on insertion. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // GroupNumber: Subgroup of the creative group. Assign your creative + // groups to one of the following subgroups in order to filter or manage + // them more easily. This field is required on insertion and is + // read-only after insertion. + // Acceptable values are: + // - 1 + // - 2 + GroupNumber int64 `json:"groupNumber,omitempty"` + + // Id: ID of this creative group. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creativeGroup". + Kind string `json:"kind,omitempty"` + + // Name: Name of this creative group. This is a required field and must + // be less than 256 characters long and unique among creative groups of + // the same advertiser. + Name string `json:"name,omitempty"` + + // SubaccountId: Subaccount ID of this creative group. This is a + // read-only field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeGroup) MarshalJSON() ([]byte, error) { + type noMethod CreativeGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeGroupAssignment: Creative Group Assignment. +type CreativeGroupAssignment struct { + // CreativeGroupId: ID of the creative group to be assigned. + CreativeGroupId int64 `json:"creativeGroupId,omitempty,string"` + + // CreativeGroupNumber: Creative group number of the creative group + // assignment. + // + // Possible values: + // "CREATIVE_GROUP_ONE" + // "CREATIVE_GROUP_TWO" + CreativeGroupNumber string `json:"creativeGroupNumber,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreativeGroupId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeGroupAssignment) MarshalJSON() ([]byte, error) { + type noMethod CreativeGroupAssignment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeGroupsListResponse: Creative Group List Response +type CreativeGroupsListResponse struct { + // CreativeGroups: Creative group collection. + CreativeGroups []*CreativeGroup `json:"creativeGroups,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creativeGroupsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreativeGroups") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeGroupsListResponse) MarshalJSON() ([]byte, error) { + type noMethod CreativeGroupsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeOptimizationConfiguration: Creative optimization settings. +type CreativeOptimizationConfiguration struct { + // Id: ID of this creative optimization config. This field is + // auto-generated when the campaign is inserted or updated. It can be + // null for existing campaigns. + Id int64 `json:"id,omitempty,string"` + + // Name: Name of this creative optimization config. This is a required + // field and must be less than 129 characters long. + Name string `json:"name,omitempty"` + + // OptimizationActivitys: List of optimization activities associated + // with this configuration. + OptimizationActivitys []*OptimizationActivity `json:"optimizationActivitys,omitempty"` + + // OptimizationModel: Optimization model for this configuration. + // + // Possible values: + // "CLICK" + // "POST_CLICK" + // "POST_CLICK_AND_IMPRESSION" + // "POST_IMPRESSION" + OptimizationModel string `json:"optimizationModel,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeOptimizationConfiguration) MarshalJSON() ([]byte, error) { + type noMethod CreativeOptimizationConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeRotation: Creative Rotation. +type CreativeRotation struct { + // CreativeAssignments: Creative assignments in this creative rotation. + CreativeAssignments []*CreativeAssignment `json:"creativeAssignments,omitempty"` + + // CreativeOptimizationConfigurationId: Creative optimization + // configuration that is used by this ad. It should refer to one of the + // existing optimization configurations in the ad's campaign. If it is + // unset or set to 0, then the campaign's default optimization + // configuration will be used for this ad. + CreativeOptimizationConfigurationId int64 `json:"creativeOptimizationConfigurationId,omitempty,string"` + + // Type: Type of creative rotation. Can be used to specify whether to + // use sequential or random rotation. + // + // Possible values: + // "CREATIVE_ROTATION_TYPE_RANDOM" + // "CREATIVE_ROTATION_TYPE_SEQUENTIAL" + Type string `json:"type,omitempty"` + + // WeightCalculationStrategy: Strategy for calculating weights. Used + // with CREATIVE_ROTATION_TYPE_RANDOM. + // + // Possible values: + // "WEIGHT_STRATEGY_CUSTOM" + // "WEIGHT_STRATEGY_EQUAL" + // "WEIGHT_STRATEGY_HIGHEST_CTR" + // "WEIGHT_STRATEGY_OPTIMIZED" + WeightCalculationStrategy string `json:"weightCalculationStrategy,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreativeAssignments") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeRotation) MarshalJSON() ([]byte, error) { + type noMethod CreativeRotation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeSettings: Creative Settings +type CreativeSettings struct { + // IFrameFooter: Header text for iFrames for this site. Must be less + // than or equal to 2000 characters long. + IFrameFooter string `json:"iFrameFooter,omitempty"` + + // IFrameHeader: Header text for iFrames for this site. Must be less + // than or equal to 2000 characters long. + IFrameHeader string `json:"iFrameHeader,omitempty"` + + // ForceSendFields is a list of field names (e.g. "IFrameFooter") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeSettings) MarshalJSON() ([]byte, error) { + type noMethod CreativeSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativesListResponse: Creative List Response +type CreativesListResponse struct { + // Creatives: Creative collection. + Creatives []*Creative `json:"creatives,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creativesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Creatives") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativesListResponse) MarshalJSON() ([]byte, error) { + type noMethod CreativesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CrossDimensionReachReportCompatibleFields: Represents fields that are +// compatible to be selected for a report of type +// "CROSS_DIMENSION_REACH". +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"` + + // ForceSendFields is a list of field names (e.g. "Breakdown") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CrossDimensionReachReportCompatibleFields) MarshalJSON() ([]byte, error) { + type noMethod CrossDimensionReachReportCompatibleFields + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomRichMediaEvents: Represents a Custom Rich Media Events group. +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"` + + // ForceSendFields is a list of field names (e.g. "FilteredEventIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomRichMediaEvents) MarshalJSON() ([]byte, error) { + type noMethod CustomRichMediaEvents + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DateRange: Represents a date range. +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. + // + // Possible values: + // "LAST_24_MONTHS" + // "LAST_30_DAYS" + // "LAST_365_DAYS" + // "LAST_7_DAYS" + // "LAST_90_DAYS" + // "MONTH_TO_DATE" + // "PREVIOUS_MONTH" + // "PREVIOUS_QUARTER" + // "PREVIOUS_WEEK" + // "PREVIOUS_YEAR" + // "QUARTER_TO_DATE" + // "TODAY" + // "WEEK_TO_DATE" + // "YEAR_TO_DATE" + // "YESTERDAY" + 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"` + + // ForceSendFields is a list of field names (e.g. "EndDate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DateRange) MarshalJSON() ([]byte, error) { + type noMethod DateRange + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DayPartTargeting: Day Part Targeting. +type DayPartTargeting struct { + // DaysOfWeek: Days of the week when the ad will serve. + // + // Acceptable values are: + // - "SUNDAY" + // - "MONDAY" + // - "TUESDAY" + // - "WEDNESDAY" + // - "THURSDAY" + // - "FRIDAY" + // - "SATURDAY" + // + // Possible values: + // "FRIDAY" + // "MONDAY" + // "SATURDAY" + // "SUNDAY" + // "THURSDAY" + // "TUESDAY" + // "WEDNESDAY" + DaysOfWeek []string `json:"daysOfWeek,omitempty"` + + // HoursOfDay: Hours of the day when the ad will serve. Must be an + // integer between 0 and 23 (inclusive), where 0 is midnight to 1 AM, + // and 23 is 11 PM to midnight. Can be specified with days of week, in + // which case the ad would serve during these hours on the specified + // days. For example, if Monday, Wednesday, Friday are the days of week + // specified and 9-10am, 3-5pm (hours 9, 15, and 16) is specified, the + // ad would serve Monday, Wednesdays, and Fridays at 9-10am and 3-5pm. + HoursOfDay []int64 `json:"hoursOfDay,omitempty"` + + // UserLocalTime: Whether or not to use the user's local time. If false, + // the America/New York time zone applies. + UserLocalTime bool `json:"userLocalTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DaysOfWeek") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DayPartTargeting) MarshalJSON() ([]byte, error) { + type noMethod DayPartTargeting + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DefaultClickThroughEventTagProperties: Properties of inheriting and +// overriding the default click-through event tag. A campaign may +// override the event tag defined at the advertiser level, and an ad may +// also override the campaign's setting further. +type DefaultClickThroughEventTagProperties struct { + // DefaultClickThroughEventTagId: ID of the click-through event tag to + // apply to all ads in this entity's scope. + DefaultClickThroughEventTagId int64 `json:"defaultClickThroughEventTagId,omitempty,string"` + + // OverrideInheritedEventTag: Whether this entity should override the + // inherited default click-through event tag with its own defined value. + OverrideInheritedEventTag bool `json:"overrideInheritedEventTag,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "DefaultClickThroughEventTagId") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DefaultClickThroughEventTagProperties) MarshalJSON() ([]byte, error) { + type noMethod DefaultClickThroughEventTagProperties + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DeliverySchedule: Delivery Schedule. +type DeliverySchedule struct { + // FrequencyCap: Limit on the number of times an individual user can be + // served the ad within a specified period of time. + FrequencyCap *FrequencyCap `json:"frequencyCap,omitempty"` + + // HardCutoff: Whether or not hard cutoff is enabled. If true, the ad + // will not serve after the end date and time. Otherwise the ad will + // continue to be served until it has reached its delivery goals. + HardCutoff bool `json:"hardCutoff,omitempty"` + + // ImpressionRatio: Impression ratio for this ad. This ratio determines + // how often each ad is served relative to the others. For example, if + // ad A has an impression ratio of 1 and ad B has an impression ratio of + // 3, then DCM will serve ad B three times as often as ad A. Must be + // between 1 and 10. + ImpressionRatio int64 `json:"impressionRatio,omitempty,string"` + + // Priority: Serving priority of an ad, with respect to other ads. The + // lower the priority number, the greater the priority with which it is + // served. + // + // Possible values: + // "AD_PRIORITY_01" + // "AD_PRIORITY_02" + // "AD_PRIORITY_03" + // "AD_PRIORITY_04" + // "AD_PRIORITY_05" + // "AD_PRIORITY_06" + // "AD_PRIORITY_07" + // "AD_PRIORITY_08" + // "AD_PRIORITY_09" + // "AD_PRIORITY_10" + // "AD_PRIORITY_11" + // "AD_PRIORITY_12" + // "AD_PRIORITY_13" + // "AD_PRIORITY_14" + // "AD_PRIORITY_15" + // "AD_PRIORITY_16" + Priority string `json:"priority,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FrequencyCap") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeliverySchedule) MarshalJSON() ([]byte, error) { + type noMethod DeliverySchedule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DfpSettings: DFP Settings +type DfpSettings struct { + // DfpNetworkCode: DFP network code for this directory site. + DfpNetworkCode string `json:"dfp_network_code,omitempty"` + + // DfpNetworkName: DFP network name for this directory site. + DfpNetworkName string `json:"dfp_network_name,omitempty"` + + // ProgrammaticPlacementAccepted: Whether this directory site accepts + // programmatic placements. + ProgrammaticPlacementAccepted bool `json:"programmaticPlacementAccepted,omitempty"` + + // PubPaidPlacementAccepted: Whether this directory site accepts + // publisher-paid tags. + PubPaidPlacementAccepted bool `json:"pubPaidPlacementAccepted,omitempty"` + + // PublisherPortalOnly: Whether this directory site is available only + // via DoubleClick Publisher Portal. + PublisherPortalOnly bool `json:"publisherPortalOnly,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DfpNetworkCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DfpSettings) MarshalJSON() ([]byte, error) { + type noMethod DfpSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Dimension: Represents a dimension. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Dimension) MarshalJSON() ([]byte, error) { + type noMethod Dimension + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionFilter: Represents a dimension filter. +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionFilter) MarshalJSON() ([]byte, error) { + type noMethod DimensionFilter + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionValue: Represents a DimensionValue resource. +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. If not specified, defaults to EXACT. If set to + // WILDCARD_EXPRESSION, '*' is allowed as a placeholder for variable + // length character sequences, and it can be escaped with a backslash. + // Note, only paid search dimensions ('dfa:paidSearch*') allow a + // matchType other than EXACT. + // + // Possible values: + // "BEGINS_WITH" + // "CONTAINS" + // "EXACT" + // "WILDCARD_EXPRESSION" + MatchType string `json:"matchType,omitempty"` + + // Value: The value of the dimension. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DimensionName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionValue) MarshalJSON() ([]byte, error) { + type noMethod DimensionValue + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionValueList: Represents the list of DimensionValue resources. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionValueList) MarshalJSON() ([]byte, error) { + type noMethod DimensionValueList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionValueRequest: Represents a DimensionValuesRequest. +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionValueRequest) MarshalJSON() ([]byte, error) { + type noMethod DimensionValueRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DirectorySite: DirectorySites contains properties of a website from +// the Site Directory. Sites need to be added to an account via the +// Sites resource before they can be assigned to a placement. +type DirectorySite struct { + // Active: Whether this directory site is active. + Active bool `json:"active,omitempty"` + + // ContactAssignments: Directory site contacts. + ContactAssignments []*DirectorySiteContactAssignment `json:"contactAssignments,omitempty"` + + // CountryId: Country ID of this directory site. + CountryId int64 `json:"countryId,omitempty,string"` + + // CurrencyId: Currency ID of this directory site. + // Possible values are: + // - "1" for USD + // - "2" for GBP + // - "3" for ESP + // - "4" for SEK + // - "5" for CAD + // - "6" for JPY + // - "7" for DEM + // - "8" for AUD + // - "9" for FRF + // - "10" for ITL + // - "11" for DKK + // - "12" for NOK + // - "13" for FIM + // - "14" for ZAR + // - "15" for IEP + // - "16" for NLG + // - "17" for EUR + // - "18" for KRW + // - "19" for TWD + // - "20" for SGD + // - "21" for CNY + // - "22" for HKD + // - "23" for NZD + // - "24" for MYR + // - "25" for BRL + // - "26" for PTE + // - "27" for MXP + // - "28" for CLP + // - "29" for TRY + // - "30" for ARS + // - "31" for PEN + // - "32" for ILS + // - "33" for CHF + // - "34" for VEF + // - "35" for COP + // - "36" for GTQ + CurrencyId int64 `json:"currencyId,omitempty,string"` + + // Description: Description of this directory site. + Description string `json:"description,omitempty"` + + // Id: ID of this directory site. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this directory site. + // This is a read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // InpageTagFormats: Tag types for regular placements. + // + // Acceptable values are: + // - "STANDARD" + // - "IFRAME_JAVASCRIPT_INPAGE" + // - "INTERNAL_REDIRECT_INPAGE" + // - "JAVASCRIPT_INPAGE" + // + // Possible values: + // "IFRAME_JAVASCRIPT_INPAGE" + // "INTERNAL_REDIRECT_INPAGE" + // "JAVASCRIPT_INPAGE" + // "STANDARD" + InpageTagFormats []string `json:"inpageTagFormats,omitempty"` + + // InterstitialTagFormats: Tag types for interstitial + // placements. + // + // Acceptable values are: + // - "IFRAME_JAVASCRIPT_INTERSTITIAL" + // - "INTERNAL_REDIRECT_INTERSTITIAL" + // - "JAVASCRIPT_INTERSTITIAL" + // + // Possible values: + // "IFRAME_JAVASCRIPT_INTERSTITIAL" + // "INTERNAL_REDIRECT_INTERSTITIAL" + // "JAVASCRIPT_INTERSTITIAL" + InterstitialTagFormats []string `json:"interstitialTagFormats,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#directorySite". + Kind string `json:"kind,omitempty"` + + // Name: Name of this directory site. + Name string `json:"name,omitempty"` + + // ParentId: Parent directory site ID. + ParentId int64 `json:"parentId,omitempty,string"` + + // Settings: Directory site settings. + Settings *DirectorySiteSettings `json:"settings,omitempty"` + + // Url: URL of this directory site. + Url string `json:"url,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Active") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DirectorySite) MarshalJSON() ([]byte, error) { + type noMethod DirectorySite + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DirectorySiteContact: Contains properties of a Site Directory +// contact. +type DirectorySiteContact struct { + // Address: Address of this directory site contact. + Address string `json:"address,omitempty"` + + // Email: Email address of this directory site contact. + Email string `json:"email,omitempty"` + + // FirstName: First name of this directory site contact. + FirstName string `json:"firstName,omitempty"` + + // Id: ID of this directory site contact. This is a read-only, + // auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#directorySiteContact". + Kind string `json:"kind,omitempty"` + + // LastName: Last name of this directory site contact. + LastName string `json:"lastName,omitempty"` + + // Phone: Phone number of this directory site contact. + Phone string `json:"phone,omitempty"` + + // Role: Directory site contact role. + // + // Possible values: + // "ADMIN" + // "EDIT" + // "VIEW" + Role string `json:"role,omitempty"` + + // Title: Title or designation of this directory site contact. + Title string `json:"title,omitempty"` + + // Type: Directory site contact type. + // + // Possible values: + // "BILLING" + // "OTHER" + // "SALES" + // "TECHNICAL" + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Address") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DirectorySiteContact) MarshalJSON() ([]byte, error) { + type noMethod DirectorySiteContact + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DirectorySiteContactAssignment: Directory Site Contact Assignment +type DirectorySiteContactAssignment struct { + // ContactId: ID of this directory site contact. This is a read-only, + // auto-generated field. + ContactId int64 `json:"contactId,omitempty,string"` + + // Visibility: Visibility of this directory site contact assignment. + // When set to PUBLIC this contact assignment is visible to all account + // and agency users; when set to PRIVATE it is visible only to the site. + // + // Possible values: + // "PRIVATE" + // "PUBLIC" + Visibility string `json:"visibility,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ContactId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DirectorySiteContactAssignment) MarshalJSON() ([]byte, error) { + type noMethod DirectorySiteContactAssignment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DirectorySiteContactsListResponse: Directory Site Contact List +// Response +type DirectorySiteContactsListResponse struct { + // DirectorySiteContacts: Directory site contact collection + DirectorySiteContacts []*DirectorySiteContact `json:"directorySiteContacts,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#directorySiteContactsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "DirectorySiteContacts") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DirectorySiteContactsListResponse) MarshalJSON() ([]byte, error) { + type noMethod DirectorySiteContactsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DirectorySiteSettings: Directory Site Settings +type DirectorySiteSettings struct { + // ActiveViewOptOut: Whether this directory site has disabled active + // view creatives. + ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"` + + // DfpSettings: Directory site DFP settings. + DfpSettings *DfpSettings `json:"dfp_settings,omitempty"` + + // InstreamVideoPlacementAccepted: Whether this site accepts in-stream + // video ads. + InstreamVideoPlacementAccepted bool `json:"instream_video_placement_accepted,omitempty"` + + // InterstitialPlacementAccepted: Whether this site accepts interstitial + // ads. + InterstitialPlacementAccepted bool `json:"interstitialPlacementAccepted,omitempty"` + + // NielsenOcrOptOut: Whether this directory site has disabled Nielsen + // OCR reach ratings. + NielsenOcrOptOut bool `json:"nielsenOcrOptOut,omitempty"` + + // VerificationTagOptOut: Whether this directory site has disabled + // generation of Verification ins tags. + VerificationTagOptOut bool `json:"verificationTagOptOut,omitempty"` + + // VideoActiveViewOptOut: Whether this directory site has disabled + // active view for in-stream video creatives. + VideoActiveViewOptOut bool `json:"videoActiveViewOptOut,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ActiveViewOptOut") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DirectorySiteSettings) MarshalJSON() ([]byte, error) { + type noMethod DirectorySiteSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DirectorySitesListResponse: Directory Site List Response +type DirectorySitesListResponse struct { + // DirectorySites: Directory site collection. + DirectorySites []*DirectorySite `json:"directorySites,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#directorySitesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DirectorySites") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DirectorySitesListResponse) MarshalJSON() ([]byte, error) { + type noMethod DirectorySitesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventTag: Contains properties of an event tag. +type EventTag struct { + // AccountId: Account ID of this event tag. This is a read-only field + // that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this event tag. This field or the + // campaignId field is required on insertion. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // CampaignId: Campaign ID of this event tag. This field or the + // advertiserId field is required on insertion. + CampaignId int64 `json:"campaignId,omitempty,string"` + + // CampaignIdDimensionValue: Dimension value for the ID of the campaign. + // This is a read-only, auto-generated field. + CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"` + + // EnabledByDefault: Whether this event tag should be automatically + // enabled for all of the advertiser's campaigns and ads. + EnabledByDefault bool `json:"enabledByDefault,omitempty"` + + // Id: ID of this event tag. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#eventTag". + Kind string `json:"kind,omitempty"` + + // Name: Name of this event tag. This is a required field and must be + // less than 256 characters long. + Name string `json:"name,omitempty"` + + // SiteFilterType: Site filter type for this event tag. If no type is + // specified then the event tag will be applied to all sites. + // + // Possible values: + // "BLACKLIST" + // "WHITELIST" + SiteFilterType string `json:"siteFilterType,omitempty"` + + // SiteIds: Filter list of site IDs associated with this event tag. The + // siteFilterType determines whether this is a whitelist or blacklist + // filter. + SiteIds googleapi.Int64s `json:"siteIds,omitempty"` + + // SslCompliant: Whether this tag is SSL-compliant or not. This is a + // read-only field. + SslCompliant bool `json:"sslCompliant,omitempty"` + + // Status: Status of this event tag. Must be ENABLED for this event tag + // to fire. This is a required field. + // + // Possible values: + // "DISABLED" + // "ENABLED" + Status string `json:"status,omitempty"` + + // SubaccountId: Subaccount ID of this event tag. This is a read-only + // field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // Type: Event tag type. Can be used to specify whether to use a + // third-party pixel, a third-party JavaScript URL, or a third-party + // click-through URL for either impression or click tracking. This is a + // required field. + // + // Possible values: + // "CLICK_THROUGH_EVENT_TAG" + // "IMPRESSION_IMAGE_EVENT_TAG" + // "IMPRESSION_JAVASCRIPT_EVENT_TAG" + Type string `json:"type,omitempty"` + + // Url: Payload URL for this event tag. The URL on a click-through event + // tag should have a landing page URL appended to the end of it. This + // field is required on insertion. + Url string `json:"url,omitempty"` + + // UrlEscapeLevels: Number of times the landing page URL should be + // URL-escaped before being appended to the click-through event tag URL. + // Only applies to click-through event tags as specified by the event + // tag type. + UrlEscapeLevels int64 `json:"urlEscapeLevels,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventTag) MarshalJSON() ([]byte, error) { + type noMethod EventTag + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventTagOverride: Event tag override information. +type EventTagOverride struct { + // Enabled: Whether this override is enabled. + Enabled bool `json:"enabled,omitempty"` + + // Id: ID of this event tag override. This is a read-only, + // auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Enabled") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventTagOverride) MarshalJSON() ([]byte, error) { + type noMethod EventTagOverride + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventTagsListResponse: Event Tag List Response +type EventTagsListResponse struct { + // EventTags: Event tag collection. + EventTags []*EventTag `json:"eventTags,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#eventTagsListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "EventTags") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventTagsListResponse) MarshalJSON() ([]byte, error) { + type noMethod EventTagsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// File: Represents a File resource. A file contains the metadata 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". +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 filename of the file. + FileName string `json:"fileName,omitempty"` + + // Format: The output format of the report. Only available once the file + // is available. + // + // Possible values: + // "CSV" + // "EXCEL" + 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. + // + // Possible values: + // "CANCELLED" + // "FAILED" + // "PROCESSING" + // "REPORT_AVAILABLE" + Status string `json:"status,omitempty"` + + // Urls: The URLs where the completed report file can be downloaded. + Urls *FileUrls `json:"urls,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DateRange") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *File) MarshalJSON() ([]byte, error) { + type noMethod File + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FileUrls: The URLs where the completed report file can be downloaded. +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"` + + // ForceSendFields is a list of field names (e.g. "ApiUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileUrls) MarshalJSON() ([]byte, error) { + type noMethod FileUrls + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FileList: Represents the list of File resources. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileList) MarshalJSON() ([]byte, error) { + type noMethod FileList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Flight: Flight +type Flight struct { + // EndDate: Inventory item flight end date. + EndDate string `json:"endDate,omitempty"` + + // RateOrCost: Rate or cost of this flight. + RateOrCost int64 `json:"rateOrCost,omitempty,string"` + + // StartDate: Inventory item flight start date. + StartDate string `json:"startDate,omitempty"` + + // Units: Units of this flight. + Units int64 `json:"units,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "EndDate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Flight) MarshalJSON() ([]byte, error) { + type noMethod Flight + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightActivitiesGenerateTagResponse: Floodlight Activity +// GenerateTag Response +type FloodlightActivitiesGenerateTagResponse struct { + // FloodlightActivityTag: Generated tag for this floodlight activity. + FloodlightActivityTag string `json:"floodlightActivityTag,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#floodlightActivitiesGenerateTagResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "FloodlightActivityTag") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightActivitiesGenerateTagResponse) MarshalJSON() ([]byte, error) { + type noMethod FloodlightActivitiesGenerateTagResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightActivitiesListResponse: Floodlight Activity List Response +type FloodlightActivitiesListResponse struct { + // FloodlightActivities: Floodlight activity collection. + FloodlightActivities []*FloodlightActivity `json:"floodlightActivities,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#floodlightActivitiesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "FloodlightActivities") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightActivitiesListResponse) MarshalJSON() ([]byte, error) { + type noMethod FloodlightActivitiesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightActivity: Contains properties of a Floodlight activity. +type FloodlightActivity struct { + // AccountId: Account ID of this floodlight activity. This is a + // read-only field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this floodlight activity. If this + // field is left blank, the value will be copied over either from the + // activity group's advertiser or the existing activity's advertiser. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // CacheBustingType: Code type used for cache busting in the generated + // tag. + // + // Possible values: + // "ACTIVE_SERVER_PAGE" + // "COLD_FUSION" + // "JAVASCRIPT" + // "JSP" + // "PHP" + CacheBustingType string `json:"cacheBustingType,omitempty"` + + // CountingMethod: Counting method for conversions for this floodlight + // activity. This is a required field. + // + // Possible values: + // "ITEMS_SOLD_COUNTING" + // "SESSION_COUNTING" + // "STANDARD_COUNTING" + // "TRANSACTIONS_COUNTING" + // "UNIQUE_COUNTING" + CountingMethod string `json:"countingMethod,omitempty"` + + // DefaultTags: Dynamic floodlight tags. + DefaultTags []*FloodlightActivityDynamicTag `json:"defaultTags,omitempty"` + + // ExpectedUrl: URL where this tag will be deployed. If specified, must + // be less than 256 characters long. + ExpectedUrl string `json:"expectedUrl,omitempty"` + + // FloodlightActivityGroupId: Floodlight activity group ID of this + // floodlight activity. This is a required field. + FloodlightActivityGroupId int64 `json:"floodlightActivityGroupId,omitempty,string"` + + // FloodlightActivityGroupName: Name of the associated floodlight + // activity group. This is a read-only field. + FloodlightActivityGroupName string `json:"floodlightActivityGroupName,omitempty"` + + // FloodlightActivityGroupTagString: Tag string of the associated + // floodlight activity group. This is a read-only field. + FloodlightActivityGroupTagString string `json:"floodlightActivityGroupTagString,omitempty"` + + // FloodlightActivityGroupType: Type of the associated floodlight + // activity group. This is a read-only field. + // + // Possible values: + // "COUNTER" + // "SALE" + FloodlightActivityGroupType string `json:"floodlightActivityGroupType,omitempty"` + + // FloodlightConfigurationId: Floodlight configuration ID of this + // floodlight activity. If this field is left blank, the value will be + // copied over either from the activity group's floodlight configuration + // or from the existing activity's floodlight configuration. + FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"` + + // FloodlightConfigurationIdDimensionValue: Dimension value for the ID + // of the floodlight configuration. This is a read-only, auto-generated + // field. + FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"` + + // Hidden: Whether this activity is archived. + Hidden bool `json:"hidden,omitempty"` + + // Id: ID of this floodlight activity. This is a read-only, + // auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this floodlight + // activity. This is a read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // ImageTagEnabled: Whether the image tag is enabled for this activity. + ImageTagEnabled bool `json:"imageTagEnabled,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#floodlightActivity". + Kind string `json:"kind,omitempty"` + + // Name: Name of this floodlight activity. This is a required field. + // Must be less than 129 characters long and cannot contain quotes. + Name string `json:"name,omitempty"` + + // Notes: General notes or implementation instructions for the tag. + Notes string `json:"notes,omitempty"` + + // PublisherTags: Publisher dynamic floodlight tags. + PublisherTags []*FloodlightActivityPublisherDynamicTag `json:"publisherTags,omitempty"` + + // Secure: Whether this tag should use SSL. + Secure bool `json:"secure,omitempty"` + + // SslCompliant: Whether the floodlight activity is SSL-compliant. This + // is a read-only field, its value detected by the system from the + // floodlight tags. + SslCompliant bool `json:"sslCompliant,omitempty"` + + // SslRequired: Whether this floodlight activity must be SSL-compliant. + SslRequired bool `json:"sslRequired,omitempty"` + + // SubaccountId: Subaccount ID of this floodlight activity. This is a + // read-only field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TagFormat: Tag format type for the floodlight activity. If left + // blank, the tag format will default to HTML. + // + // Possible values: + // "HTML" + // "XHTML" + TagFormat string `json:"tagFormat,omitempty"` + + // TagString: Value of the cat= paramter in the floodlight tag, which + // the ad servers use to identify the activity. This is optional: if + // empty, a new tag string will be generated for you. This string must + // be 1 to 8 characters long, with valid characters being + // [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among + // activities of the same activity group. This field is read-only after + // insertion. + TagString string `json:"tagString,omitempty"` + + // UserDefinedVariableTypes: List of the user-defined variables used by + // this conversion tag. These map to the "u[1-20]=" in the tags. Each of + // these can have a user defined type. + // Acceptable values are: + // - "U1" + // - "U2" + // - "U3" + // - "U4" + // - "U5" + // - "U6" + // - "U7" + // - "U8" + // - "U9" + // - "U10" + // - "U11" + // - "U12" + // - "U13" + // - "U14" + // - "U15" + // - "U16" + // - "U17" + // - "U18" + // - "U19" + // - "U20" + // + // Possible values: + // "U1" + // "U10" + // "U11" + // "U12" + // "U13" + // "U14" + // "U15" + // "U16" + // "U17" + // "U18" + // "U19" + // "U2" + // "U20" + // "U3" + // "U4" + // "U5" + // "U6" + // "U7" + // "U8" + // "U9" + UserDefinedVariableTypes []string `json:"userDefinedVariableTypes,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightActivity) MarshalJSON() ([]byte, error) { + type noMethod FloodlightActivity + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightActivityDynamicTag: Dynamic Tag +type FloodlightActivityDynamicTag struct { + // Id: ID of this dynamic tag. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // Name: Name of this tag. + Name string `json:"name,omitempty"` + + // Tag: Tag code. + Tag string `json:"tag,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightActivityDynamicTag) MarshalJSON() ([]byte, error) { + type noMethod FloodlightActivityDynamicTag + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightActivityGroup: Contains properties of a Floodlight activity +// group. +type FloodlightActivityGroup struct { + // AccountId: Account ID of this floodlight activity group. This is a + // read-only field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this floodlight activity group. If + // this field is left blank, the value will be copied over either from + // the floodlight configuration's advertiser or from the existing + // activity group's advertiser. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // FloodlightConfigurationId: Floodlight configuration ID of this + // floodlight activity group. This is a required field. + FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"` + + // FloodlightConfigurationIdDimensionValue: Dimension value for the ID + // of the floodlight configuration. This is a read-only, auto-generated + // field. + FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"` + + // Id: ID of this floodlight activity group. This is a read-only, + // auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this floodlight + // activity group. This is a read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#floodlightActivityGroup". + Kind string `json:"kind,omitempty"` + + // Name: Name of this floodlight activity group. This is a required + // field. Must be less than 65 characters long and cannot contain + // quotes. + Name string `json:"name,omitempty"` + + // SubaccountId: Subaccount ID of this floodlight activity group. This + // is a read-only field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TagString: Value of the type= parameter in the floodlight tag, which + // the ad servers use to identify the activity group that the activity + // belongs to. This is optional: if empty, a new tag string will be + // generated for you. This string must be 1 to 8 characters long, with + // valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must + // also be unique among activity groups of the same floodlight + // configuration. This field is read-only after insertion. + TagString string `json:"tagString,omitempty"` + + // Type: Type of the floodlight activity group. This is a required field + // that is read-only after insertion. + // + // Possible values: + // "COUNTER" + // "SALE" + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightActivityGroup) MarshalJSON() ([]byte, error) { + type noMethod FloodlightActivityGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightActivityGroupsListResponse: Floodlight Activity Group List +// Response +type FloodlightActivityGroupsListResponse struct { + // FloodlightActivityGroups: Floodlight activity group collection. + FloodlightActivityGroups []*FloodlightActivityGroup `json:"floodlightActivityGroups,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#floodlightActivityGroupsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "FloodlightActivityGroups") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightActivityGroupsListResponse) MarshalJSON() ([]byte, error) { + type noMethod FloodlightActivityGroupsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightActivityPublisherDynamicTag: Publisher Dynamic Tag +type FloodlightActivityPublisherDynamicTag struct { + // ClickThrough: Whether this tag is applicable only for click-throughs. + ClickThrough bool `json:"clickThrough,omitempty"` + + // DirectorySiteId: Directory site ID of this dynamic tag. This is a + // write-only field that can be used as an alternative to the siteId + // field. When this resource is retrieved, only the siteId field will be + // populated. + DirectorySiteId int64 `json:"directorySiteId,omitempty,string"` + + // DynamicTag: Dynamic floodlight tag. + DynamicTag *FloodlightActivityDynamicTag `json:"dynamicTag,omitempty"` + + // SiteId: Site ID of this dynamic tag. + SiteId int64 `json:"siteId,omitempty,string"` + + // SiteIdDimensionValue: Dimension value for the ID of the site. This is + // a read-only, auto-generated field. + SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"` + + // ViewThrough: Whether this tag is applicable only for view-throughs. + ViewThrough bool `json:"viewThrough,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ClickThrough") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightActivityPublisherDynamicTag) MarshalJSON() ([]byte, error) { + type noMethod FloodlightActivityPublisherDynamicTag + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightConfiguration: Contains properties of a Floodlight +// configuration. +type FloodlightConfiguration struct { + // AccountId: Account ID of this floodlight configuration. This is a + // read-only field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of the parent advertiser of this + // floodlight configuration. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // AnalyticsDataSharingEnabled: Whether advertiser data is shared with + // Google Analytics. + AnalyticsDataSharingEnabled bool `json:"analyticsDataSharingEnabled,omitempty"` + + // ExposureToConversionEnabled: Whether the exposure-to-conversion + // report is enabled. This report shows detailed pathway information on + // up to 10 of the most recent ad exposures seen by a user before + // converting. + ExposureToConversionEnabled bool `json:"exposureToConversionEnabled,omitempty"` + + // FirstDayOfWeek: Day that will be counted as the first day of the week + // in reports. This is a required field. + // + // Possible values: + // "MONDAY" + // "SUNDAY" + FirstDayOfWeek string `json:"firstDayOfWeek,omitempty"` + + // Id: ID of this floodlight configuration. This is a read-only, + // auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this floodlight + // configuration. This is a read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#floodlightConfiguration". + Kind string `json:"kind,omitempty"` + + // LookbackConfiguration: Lookback window settings for this floodlight + // configuration. + LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"` + + // NaturalSearchConversionAttributionOption: Types of attribution + // options for natural search conversions. + // + // Possible values: + // "EXCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION" + // "INCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION" + // "INCLUDE_NATURAL_SEARCH_TIERED_CONVERSION_ATTRIBUTION" + NaturalSearchConversionAttributionOption string `json:"naturalSearchConversionAttributionOption,omitempty"` + + // OmnitureSettings: Settings for DCM Omniture integration. + OmnitureSettings *OmnitureSettings `json:"omnitureSettings,omitempty"` + + // SslRequired: Whether floodlight activities owned by this + // configuration are required to be SSL-compliant. + SslRequired bool `json:"sslRequired,omitempty"` + + // StandardVariableTypes: List of standard variables enabled for this + // configuration. + // + // Acceptable values are: + // - "ORD" + // - "NUM" + // + // Possible values: + // "NUM" + // "ORD" + // "TRAN" + // "U" + StandardVariableTypes []string `json:"standardVariableTypes,omitempty"` + + // SubaccountId: Subaccount ID of this floodlight configuration. This is + // a read-only field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TagSettings: Configuration settings for dynamic and image floodlight + // tags. + TagSettings *TagSettings `json:"tagSettings,omitempty"` + + // UserDefinedVariableConfigurations: List of user defined variables + // enabled for this configuration. + UserDefinedVariableConfigurations []*UserDefinedVariableConfiguration `json:"userDefinedVariableConfigurations,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightConfiguration) MarshalJSON() ([]byte, error) { + type noMethod FloodlightConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightConfigurationsListResponse: Floodlight Configuration List +// Response +type FloodlightConfigurationsListResponse struct { + // FloodlightConfigurations: Floodlight configuration collection. + FloodlightConfigurations []*FloodlightConfiguration `json:"floodlightConfigurations,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#floodlightConfigurationsListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "FloodlightConfigurations") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightConfigurationsListResponse) MarshalJSON() ([]byte, error) { + type noMethod FloodlightConfigurationsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightReportCompatibleFields: Represents fields that are +// compatible to be selected for a report of type "FlOODLIGHT". +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionFilters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightReportCompatibleFields) MarshalJSON() ([]byte, error) { + type noMethod FloodlightReportCompatibleFields + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FrequencyCap: Frequency Cap. +type FrequencyCap struct { + // Duration: Duration of time, in seconds, for this frequency cap. The + // maximum duration is 90 days in seconds, or 7,776,000. + Duration int64 `json:"duration,omitempty,string"` + + // Impressions: Number of times an individual user can be served the ad + // within the specified duration. The maximum allowed is 15. + Impressions int64 `json:"impressions,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Duration") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FrequencyCap) MarshalJSON() ([]byte, error) { + type noMethod FrequencyCap + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FsCommand: FsCommand. +type FsCommand struct { + // Left: Distance from the left of the browser.Applicable when + // positionOption is DISTANCE_FROM_TOP_LEFT_CORNER. + Left int64 `json:"left,omitempty"` + + // PositionOption: Position in the browser where the window will open. + // + // Possible values: + // "CENTERED" + // "DISTANCE_FROM_TOP_LEFT_CORNER" + PositionOption string `json:"positionOption,omitempty"` + + // Top: Distance from the top of the browser. Applicable when + // positionOption is DISTANCE_FROM_TOP_LEFT_CORNER. + Top int64 `json:"top,omitempty"` + + // WindowHeight: Height of the window. + WindowHeight int64 `json:"windowHeight,omitempty"` + + // WindowWidth: Width of the window. + WindowWidth int64 `json:"windowWidth,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Left") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FsCommand) MarshalJSON() ([]byte, error) { + type noMethod FsCommand + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GeoTargeting: Geographical Targeting. +type GeoTargeting struct { + // Cities: Cities to be targeted. For each city only dartId is required. + // The other fields are populated automatically when the ad is inserted + // or updated. If targeting a city, do not target or exclude the country + // of the city, and do not target the metro or region of the city. + Cities []*City `json:"cities,omitempty"` + + // Countries: Countries to be targeted or excluded from targeting, + // depending on the setting of the excludeCountries field. For each + // country only dartId is required. The other fields are populated + // automatically when the ad is inserted or updated. If targeting or + // excluding a country, do not target regions, cities, metros, or postal + // codes in the same country. + Countries []*Country `json:"countries,omitempty"` + + // ExcludeCountries: Whether or not to exclude the countries in the + // countries field from targeting. If false, the countries field refers + // to countries which will be targeted by the ad. + ExcludeCountries bool `json:"excludeCountries,omitempty"` + + // Metros: Metros to be targeted. For each metro only dmaId is required. + // The other fields are populated automatically when the ad is inserted + // or updated. If targeting a metro, do not target or exclude the + // country of the metro. + Metros []*Metro `json:"metros,omitempty"` + + // PostalCodes: Postal codes to be targeted. For each postal code only + // id is required. The other fields are populated automatically when the + // ad is inserted or updated. If targeting a postal code, do not target + // or exclude the country of the postal code. + PostalCodes []*PostalCode `json:"postalCodes,omitempty"` + + // Regions: Regions to be targeted. For each region only dartId is + // required. The other fields are populated automatically when the ad is + // inserted or updated. If targeting a region, do not target or exclude + // the country of the region. + Regions []*Region `json:"regions,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Cities") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoTargeting) MarshalJSON() ([]byte, error) { + type noMethod GeoTargeting + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InventoryItem: Represents a buy from the DoubleClick Planning +// inventory store. +type InventoryItem struct { + // AccountId: Account ID of this inventory item. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdSlots: Ad slots of this inventory item. If this inventory item + // represents a standalone placement, there will be exactly one ad slot. + // If this inventory item represents a placement group, there will be + // more than one ad slot, each representing one child placement in that + // placement group. + AdSlots []*AdSlot `json:"adSlots,omitempty"` + + // AdvertiserId: Advertiser ID of this inventory item. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // ContentCategoryId: Content category ID of this inventory item. + ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"` + + // EstimatedClickThroughRate: Estimated click-through rate of this + // inventory item. + EstimatedClickThroughRate int64 `json:"estimatedClickThroughRate,omitempty,string"` + + // EstimatedConversionRate: Estimated conversion rate of this inventory + // item. + EstimatedConversionRate int64 `json:"estimatedConversionRate,omitempty,string"` + + // Id: ID of this inventory item. + Id int64 `json:"id,omitempty,string"` + + // InPlan: Whether this inventory item is in plan. + InPlan bool `json:"inPlan,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#inventoryItem". + Kind string `json:"kind,omitempty"` + + // LastModifiedInfo: Information about the most recent modification of + // this inventory item. + LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"` + + // Name: Name of this inventory item. For standalone inventory items, + // this is the same name as that of its only ad slot. For group + // inventory items, this can differ from the name of any of its ad + // slots. + Name string `json:"name,omitempty"` + + // NegotiationChannelId: Negotiation channel ID of this inventory item. + NegotiationChannelId int64 `json:"negotiationChannelId,omitempty,string"` + + // OrderId: Order ID of this inventory item. + OrderId int64 `json:"orderId,omitempty,string"` + + // PlacementStrategyId: Placement strategy ID of this inventory item. + PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"` + + // Pricing: Pricing of this inventory item. + Pricing *Pricing `json:"pricing,omitempty"` + + // ProjectId: Project ID of this inventory item. + ProjectId int64 `json:"projectId,omitempty,string"` + + // RfpId: RFP ID of this inventory item. + RfpId int64 `json:"rfpId,omitempty,string"` + + // SiteId: ID of the site this inventory item is associated with. + SiteId int64 `json:"siteId,omitempty,string"` + + // SubaccountId: Subaccount ID of this inventory item. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InventoryItem) MarshalJSON() ([]byte, error) { + type noMethod InventoryItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InventoryItemsListResponse: Inventory item List Response +type InventoryItemsListResponse struct { + // InventoryItems: Inventory item collection + InventoryItems []*InventoryItem `json:"inventoryItems,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#inventoryItemsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "InventoryItems") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InventoryItemsListResponse) MarshalJSON() ([]byte, error) { + type noMethod InventoryItemsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// KeyValueTargetingExpression: Key Value Targeting Expression. +type KeyValueTargetingExpression struct { + // Expression: Keyword expression being targeted by the ad. + Expression string `json:"expression,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Expression") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *KeyValueTargetingExpression) MarshalJSON() ([]byte, error) { + type noMethod KeyValueTargetingExpression + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LandingPage: Contains information about where a user's browser is +// taken after the user clicks an ad. +type LandingPage struct { + // Default: Whether or not this landing page will be assigned to any ads + // or creatives that do not have a landing page assigned explicitly. + // Only one default landing page is allowed per campaign. + Default bool `json:"default,omitempty"` + + // Id: ID of this landing page. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#landingPage". + Kind string `json:"kind,omitempty"` + + // Name: Name of this landing page. This is a required field. It must be + // less than 256 characters long, and must be unique among landing pages + // of the same campaign. + Name string `json:"name,omitempty"` + + // Url: URL of this landing page. This is a required field. + Url string `json:"url,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Default") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LandingPage) MarshalJSON() ([]byte, error) { + type noMethod LandingPage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LandingPagesListResponse: Landing Page List Response +type LandingPagesListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#landingPagesListResponse". + Kind string `json:"kind,omitempty"` + + // LandingPages: Landing page collection + LandingPages []*LandingPage `json:"landingPages,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LandingPagesListResponse) MarshalJSON() ([]byte, error) { + type noMethod LandingPagesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LastModifiedInfo: Modification timestamp. +type LastModifiedInfo struct { + // Time: Timestamp of the last change in milliseconds since epoch. + Time int64 `json:"time,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Time") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LastModifiedInfo) MarshalJSON() ([]byte, error) { + type noMethod LastModifiedInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListPopulationClause: A group clause made up of list population terms +// representing constraints joined by ORs. +type ListPopulationClause struct { + // Terms: Terms of this list population clause. Each clause is made up + // of list population terms representing constraints and are joined by + // ORs. + Terms []*ListPopulationTerm `json:"terms,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Terms") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListPopulationClause) MarshalJSON() ([]byte, error) { + type noMethod ListPopulationClause + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListPopulationRule: Remarketing List Population Rule. +type ListPopulationRule struct { + // FloodlightActivityId: Floodlight activity ID associated with this + // rule. This field can be left blank. + FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"` + + // FloodlightActivityName: Name of floodlight activity associated with + // this rule. This is a read-only, auto-generated field. + FloodlightActivityName string `json:"floodlightActivityName,omitempty"` + + // ListPopulationClauses: Clauses that make up this list population + // rule. Clauses are joined by ANDs, and the clauses themselves are made + // up of list population terms which are joined by ORs. + ListPopulationClauses []*ListPopulationClause `json:"listPopulationClauses,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "FloodlightActivityId") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListPopulationRule) MarshalJSON() ([]byte, error) { + type noMethod ListPopulationRule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListPopulationTerm: Remarketing List Population Rule Term. +type ListPopulationTerm struct { + // Contains: Will be true if the term should check if the user is in the + // list and false if the term should check if the user is not in the + // list. This field is only relevant when type is set to + // LIST_MEMBERSHIP_TERM. False by default. + Contains bool `json:"contains,omitempty"` + + // Negation: Whether to negate the comparison result of this term during + // rule evaluation. This field is only relevant when type is left unset + // or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM. + Negation bool `json:"negation,omitempty"` + + // Operator: Comparison operator of this term. This field is only + // relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or + // REFERRER_TERM. + // + // Possible values: + // "NUM_EQUALS" + // "NUM_GREATER_THAN" + // "NUM_GREATER_THAN_EQUAL" + // "NUM_LESS_THAN" + // "NUM_LESS_THAN_EQUAL" + // "STRING_CONTAINS" + // "STRING_EQUALS" + Operator string `json:"operator,omitempty"` + + // RemarketingListId: ID of the list in question. This field is only + // relevant when type is set to LIST_MEMBERSHIP_TERM. + RemarketingListId int64 `json:"remarketingListId,omitempty,string"` + + // Type: List population term type determines the applicable fields in + // this object. If left unset or set to CUSTOM_VARIABLE_TERM, then + // variableName, variableFriendlyName, operator, value, and negation are + // applicable. If set to LIST_MEMBERSHIP_TERM then remarketingListId and + // contains are applicable. If set to REFERRER_TERM then operator, + // value, and negation are applicable. + // + // Possible values: + // "CUSTOM_VARIABLE_TERM" + // "LIST_MEMBERSHIP_TERM" + // "REFERRER_TERM" + Type string `json:"type,omitempty"` + + // Value: Literal to compare the variable to. This field is only + // relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or + // REFERRER_TERM. + Value string `json:"value,omitempty"` + + // VariableFriendlyName: Friendly name of this term's variable. This is + // a read-only, auto-generated field. This field is only relevant when + // type is left unset or set to CUSTOM_VARIABLE_TERM. + VariableFriendlyName string `json:"variableFriendlyName,omitempty"` + + // VariableName: Name of the variable (U1, U2, etc.) being compared in + // this term. This field is only relevant when type is set to null, + // CUSTOM_VARIABLE_TERM or REFERRER_TERM. + VariableName string `json:"variableName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Contains") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListPopulationTerm) MarshalJSON() ([]byte, error) { + type noMethod ListPopulationTerm + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListTargetingExpression: Remarketing List Targeting Expression. +type ListTargetingExpression struct { + // Expression: Expression describing which lists are being targeted by + // the ad. + Expression string `json:"expression,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Expression") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListTargetingExpression) MarshalJSON() ([]byte, error) { + type noMethod ListTargetingExpression + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LookbackConfiguration: Lookback configuration settings. +type LookbackConfiguration struct { + // ClickDuration: Lookback window, in days, from the last time a given + // user clicked on one of your ads. If you enter 0, clicks will not be + // considered as triggering events for floodlight tracking. If you leave + // this field blank, the default value for your account will be used. + ClickDuration int64 `json:"clickDuration,omitempty"` + + // PostImpressionActivitiesDuration: Lookback window, in days, from the + // last time a given user viewed one of your ads. If you enter 0, + // impressions will not be considered as triggering events for + // floodlight tracking. If you leave this field blank, the default value + // for your account will be used. + PostImpressionActivitiesDuration int64 `json:"postImpressionActivitiesDuration,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ClickDuration") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LookbackConfiguration) MarshalJSON() ([]byte, error) { + type noMethod LookbackConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Metric: Represents a metric. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Metric) MarshalJSON() ([]byte, error) { + type noMethod Metric + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Metro: Contains information about a metro region that can be targeted +// by ads. +type Metro struct { + // CountryCode: Country code of the country to which this metro region + // belongs. + CountryCode string `json:"countryCode,omitempty"` + + // CountryDartId: DART ID of the country to which this metro region + // belongs. + CountryDartId int64 `json:"countryDartId,omitempty,string"` + + // DartId: DART ID of this metro region. + DartId int64 `json:"dartId,omitempty,string"` + + // DmaId: DMA ID of this metro region. This is the ID used for targeting + // and generating reports, and is equivalent to metro_code. + DmaId int64 `json:"dmaId,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#metro". + Kind string `json:"kind,omitempty"` + + // MetroCode: Metro code of this metro region. This is equivalent to + // dma_id. + MetroCode string `json:"metroCode,omitempty"` + + // Name: Name of this metro region. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CountryCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Metro) MarshalJSON() ([]byte, error) { + type noMethod Metro + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MetrosListResponse: Metro List Response +type MetrosListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#metrosListResponse". + Kind string `json:"kind,omitempty"` + + // Metros: Metro collection. + Metros []*Metro `json:"metros,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MetrosListResponse) MarshalJSON() ([]byte, error) { + type noMethod MetrosListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MobileCarrier: Contains information about a mobile carrier that can +// be targeted by ads. +type MobileCarrier struct { + // CountryCode: Country code of the country to which this mobile carrier + // belongs. + CountryCode string `json:"countryCode,omitempty"` + + // CountryDartId: DART ID of the country to which this mobile carrier + // belongs. + CountryDartId int64 `json:"countryDartId,omitempty,string"` + + // Id: ID of this mobile carrier. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#mobileCarrier". + Kind string `json:"kind,omitempty"` + + // Name: Name of this mobile carrier. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CountryCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MobileCarrier) MarshalJSON() ([]byte, error) { + type noMethod MobileCarrier + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MobileCarriersListResponse: Mobile Carrier List Response +type MobileCarriersListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#mobileCarriersListResponse". + Kind string `json:"kind,omitempty"` + + // MobileCarriers: Mobile carrier collection. + MobileCarriers []*MobileCarrier `json:"mobileCarriers,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MobileCarriersListResponse) MarshalJSON() ([]byte, error) { + type noMethod MobileCarriersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ObjectFilter: Object Filter. +type ObjectFilter struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#objectFilter". + Kind string `json:"kind,omitempty"` + + // ObjectIds: Applicable when status is ASSIGNED. The user has access to + // objects with these object IDs. + ObjectIds googleapi.Int64s `json:"objectIds,omitempty"` + + // Status: Status of the filter. NONE means the user has access to none + // of the objects. ALL means the user has access to all objects. + // ASSIGNED means the user has access to the objects with IDs in the + // objectIds list. + // + // Possible values: + // "ALL" + // "ASSIGNED" + // "NONE" + Status string `json:"status,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ObjectFilter) MarshalJSON() ([]byte, error) { + type noMethod ObjectFilter + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OffsetPosition: Offset Position. +type OffsetPosition struct { + // Left: Offset distance from left side of an asset or a window. + Left int64 `json:"left,omitempty"` + + // Top: Offset distance from top side of an asset or a window. + Top int64 `json:"top,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Left") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OffsetPosition) MarshalJSON() ([]byte, error) { + type noMethod OffsetPosition + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OmnitureSettings: Omniture Integration Settings. +type OmnitureSettings struct { + // OmnitureCostDataEnabled: Whether placement cost data will be sent to + // Omniture. This property can be enabled only if + // omnitureIntegrationEnabled is true. + OmnitureCostDataEnabled bool `json:"omnitureCostDataEnabled,omitempty"` + + // OmnitureIntegrationEnabled: Whether Omniture integration is enabled. + // This property can be enabled only when the "Advanced Ad Serving" + // account setting is enabled. + OmnitureIntegrationEnabled bool `json:"omnitureIntegrationEnabled,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "OmnitureCostDataEnabled") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OmnitureSettings) MarshalJSON() ([]byte, error) { + type noMethod OmnitureSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperatingSystem: Contains information about an operating system that +// can be targeted by ads. +type OperatingSystem struct { + // DartId: DART ID of this operating system. This is the ID used for + // targeting. + DartId int64 `json:"dartId,omitempty,string"` + + // Desktop: Whether this operating system is for desktop. + Desktop bool `json:"desktop,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#operatingSystem". + Kind string `json:"kind,omitempty"` + + // Mobile: Whether this operating system is for mobile. + Mobile bool `json:"mobile,omitempty"` + + // Name: Name of this operating system. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DartId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperatingSystem) MarshalJSON() ([]byte, error) { + type noMethod OperatingSystem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperatingSystemVersion: Contains information about a particular +// version of an operating system that can be targeted by ads. +type OperatingSystemVersion struct { + // Id: ID of this operating system version. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#operatingSystemVersion". + Kind string `json:"kind,omitempty"` + + // MajorVersion: Major version (leftmost number) of this operating + // system version. + MajorVersion string `json:"majorVersion,omitempty"` + + // MinorVersion: Minor version (number after the first dot) of this + // operating system version. + MinorVersion string `json:"minorVersion,omitempty"` + + // Name: Name of this operating system version. + Name string `json:"name,omitempty"` + + // OperatingSystem: Operating system of this operating system version. + OperatingSystem *OperatingSystem `json:"operatingSystem,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperatingSystemVersion) MarshalJSON() ([]byte, error) { + type noMethod OperatingSystemVersion + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperatingSystemVersionsListResponse: Operating System Version List +// Response +type OperatingSystemVersionsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#operatingSystemVersionsListResponse". + Kind string `json:"kind,omitempty"` + + // OperatingSystemVersions: Operating system version collection. + OperatingSystemVersions []*OperatingSystemVersion `json:"operatingSystemVersions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperatingSystemVersionsListResponse) MarshalJSON() ([]byte, error) { + type noMethod OperatingSystemVersionsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperatingSystemsListResponse: Operating System List Response +type OperatingSystemsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#operatingSystemsListResponse". + Kind string `json:"kind,omitempty"` + + // OperatingSystems: Operating system collection. + OperatingSystems []*OperatingSystem `json:"operatingSystems,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperatingSystemsListResponse) MarshalJSON() ([]byte, error) { + type noMethod OperatingSystemsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OptimizationActivity: Creative optimization activity. +type OptimizationActivity struct { + // FloodlightActivityId: Floodlight activity ID of this optimization + // activity. This is a required field. + FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"` + + // FloodlightActivityIdDimensionValue: Dimension value for the ID of the + // floodlight activity. This is a read-only, auto-generated field. + FloodlightActivityIdDimensionValue *DimensionValue `json:"floodlightActivityIdDimensionValue,omitempty"` + + // Weight: Weight associated with this optimization. Must be greater + // than 1. The weight assigned will be understood in proportion to the + // weights assigned to the other optimization activities. + Weight int64 `json:"weight,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "FloodlightActivityId") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OptimizationActivity) MarshalJSON() ([]byte, error) { + type noMethod OptimizationActivity + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Order: Describes properties of a DoubleClick Planning order. +type Order struct { + // AccountId: Account ID of this order. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this order. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // ApproverUserProfileIds: IDs for users that have to approve documents + // created for this order. + ApproverUserProfileIds googleapi.Int64s `json:"approverUserProfileIds,omitempty"` + + // BuyerInvoiceId: Buyer invoice ID associated with this order. + BuyerInvoiceId string `json:"buyerInvoiceId,omitempty"` + + // BuyerOrganizationName: Name of the buyer organization. + BuyerOrganizationName string `json:"buyerOrganizationName,omitempty"` + + // Comments: Comments in this order. + Comments string `json:"comments,omitempty"` + + // Contacts: Contacts for this order. + Contacts []*OrderContact `json:"contacts,omitempty"` + + // Id: ID of this order. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#order". + Kind string `json:"kind,omitempty"` + + // LastModifiedInfo: Information about the most recent modification of + // this order. + LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"` + + // Name: Name of this order. + Name string `json:"name,omitempty"` + + // Notes: Notes of this order. + Notes string `json:"notes,omitempty"` + + // PlanningTermId: ID of the terms and conditions template used in this + // order. + PlanningTermId int64 `json:"planningTermId,omitempty,string"` + + // ProjectId: Project ID of this order. + ProjectId int64 `json:"projectId,omitempty,string"` + + // SellerOrderId: Seller order ID associated with this order. + SellerOrderId string `json:"sellerOrderId,omitempty"` + + // SellerOrganizationName: Name of the seller organization. + SellerOrganizationName string `json:"sellerOrganizationName,omitempty"` + + // SiteId: Site IDs this order is associated with. + SiteId googleapi.Int64s `json:"siteId,omitempty"` + + // SiteNames: Free-form site names this order is associated with. + SiteNames []string `json:"siteNames,omitempty"` + + // SubaccountId: Subaccount ID of this order. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TermsAndConditions: Terms and conditions of this order. + TermsAndConditions string `json:"termsAndConditions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Order) MarshalJSON() ([]byte, error) { + type noMethod Order + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OrderContact: Contact of an order. +type OrderContact struct { + // ContactInfo: Free-form information about this contact. It could be + // any information related to this contact in addition to type, title, + // name, and signature user profile ID. + ContactInfo string `json:"contactInfo,omitempty"` + + // ContactName: Name of this contact. + ContactName string `json:"contactName,omitempty"` + + // ContactTitle: Title of this contact. + ContactTitle string `json:"contactTitle,omitempty"` + + // ContactType: Type of this contact. + // + // Possible values: + // "PLANNING_ORDER_CONTACT_BUYER_BILLING_CONTACT" + // "PLANNING_ORDER_CONTACT_BUYER_CONTACT" + // "PLANNING_ORDER_CONTACT_SELLER_CONTACT" + ContactType string `json:"contactType,omitempty"` + + // SignatureUserProfileId: ID of the user profile containing the + // signature that will be embedded into order documents. + SignatureUserProfileId int64 `json:"signatureUserProfileId,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "ContactInfo") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderContact) MarshalJSON() ([]byte, error) { + type noMethod OrderContact + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OrderDocument: Contains properties of a DoubleClick Planning order +// document. +type OrderDocument struct { + // AccountId: Account ID of this order document. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this order document. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AmendedOrderDocumentId: The amended order document ID of this order + // document. An order document can be created by optionally amending + // another order document so that the change history can be preserved. + AmendedOrderDocumentId int64 `json:"amendedOrderDocumentId,omitempty,string"` + + // ApprovedByUserProfileIds: IDs of users who have approved this order + // document. + ApprovedByUserProfileIds googleapi.Int64s `json:"approvedByUserProfileIds,omitempty"` + + // Cancelled: Whether this order document is cancelled. + Cancelled bool `json:"cancelled,omitempty"` + + // CreatedInfo: Information about the creation of this order document. + CreatedInfo *LastModifiedInfo `json:"createdInfo,omitempty"` + + // EffectiveDate: Effective date of this order document. + EffectiveDate string `json:"effectiveDate,omitempty"` + + // Id: ID of this order document. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#orderDocument". + Kind string `json:"kind,omitempty"` + + // OrderId: ID of the order from which this order document is created. + OrderId int64 `json:"orderId,omitempty,string"` + + // ProjectId: Project ID of this order document. + ProjectId int64 `json:"projectId,omitempty,string"` + + // Signed: Whether this order document has been signed. + Signed bool `json:"signed,omitempty"` + + // SubaccountId: Subaccount ID of this order document. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // Title: Title of this order document. + Title string `json:"title,omitempty"` + + // Type: Type of this order document + // + // Possible values: + // "PLANNING_ORDER_TYPE_CHANGE_ORDER" + // "PLANNING_ORDER_TYPE_INSERTION_ORDER" + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderDocument) MarshalJSON() ([]byte, error) { + type noMethod OrderDocument + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OrderDocumentsListResponse: Order document List Response +type OrderDocumentsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#orderDocumentsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // OrderDocuments: Order document collection + OrderDocuments []*OrderDocument `json:"orderDocuments,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderDocumentsListResponse) MarshalJSON() ([]byte, error) { + type noMethod OrderDocumentsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OrdersListResponse: Order List Response +type OrdersListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#ordersListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Orders: Order collection. + Orders []*Order `json:"orders,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersListResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PathToConversionReportCompatibleFields: Represents fields that are +// compatible to be selected for a report of type "PATH_TO_CONVERSION". +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"` + + // ForceSendFields is a list of field names (e.g. + // "ConversionDimensions") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PathToConversionReportCompatibleFields) MarshalJSON() ([]byte, error) { + type noMethod PathToConversionReportCompatibleFields + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Placement: Contains properties of a placement. +type Placement struct { + // AccountId: Account ID of this placement. This field can be left + // blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this placement. This field can be left + // blank. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // Archived: Whether this placement is archived. + Archived bool `json:"archived,omitempty"` + + // CampaignId: Campaign ID of this placement. This field is a required + // field on insertion. + CampaignId int64 `json:"campaignId,omitempty,string"` + + // CampaignIdDimensionValue: Dimension value for the ID of the campaign. + // This is a read-only, auto-generated field. + CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"` + + // Comment: Comments for this placement. + Comment string `json:"comment,omitempty"` + + // Compatibility: Placement compatibility. WEB and WEB_INTERSTITIAL + // refer to rendering either on desktop or on mobile devices for regular + // or interstitial ads, respectively. APP and APP_INTERSTITIAL are for + // rendering in mobile apps.IN_STREAM_VIDEO refers to rendering in + // in-stream video ads developed with the VAST standard. This field is + // required on insertion. + // + // Possible values: + // "APP" + // "APP_INTERSTITIAL" + // "IN_STREAM_VIDEO" + // "WEB" + // "WEB_INTERSTITIAL" + Compatibility string `json:"compatibility,omitempty"` + + // ContentCategoryId: ID of the content category assigned to this + // placement. + ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"` + + // CreateInfo: Information about the creation of this placement. This is + // a read-only field. + CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"` + + // DirectorySiteId: Directory site ID of this placement. On insert, you + // must set either this field or the siteId field to specify the site + // associated with this placement. This is a required field that is + // read-only after insertion. + DirectorySiteId int64 `json:"directorySiteId,omitempty,string"` + + // DirectorySiteIdDimensionValue: Dimension value for the ID of the + // directory site. This is a read-only, auto-generated field. + DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"` + + // ExternalId: External ID for this placement. + ExternalId string `json:"externalId,omitempty"` + + // Id: ID of this placement. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this placement. This + // is a read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // KeyName: Key name of this placement. This is a read-only, + // auto-generated field. + KeyName string `json:"keyName,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#placement". + Kind string `json:"kind,omitempty"` + + // LastModifiedInfo: Information about the most recent modification of + // this placement. This is a read-only field. + LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"` + + // LookbackConfiguration: Lookback window settings for this placement. + LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"` + + // Name: Name of this placement.This is a required field and must be + // less than 256 characters long. + Name string `json:"name,omitempty"` + + // PaymentApproved: Whether payment was approved for this placement. + // This is a read-only field relevant only to publisher-paid placements. + PaymentApproved bool `json:"paymentApproved,omitempty"` + + // PaymentSource: Payment source for this placement. This is a required + // field that is read-only after insertion. + // + // Possible values: + // "PLACEMENT_AGENCY_PAID" + // "PLACEMENT_PUBLISHER_PAID" + PaymentSource string `json:"paymentSource,omitempty"` + + // PlacementGroupId: ID of this placement's group, if applicable. + PlacementGroupId int64 `json:"placementGroupId,omitempty,string"` + + // PlacementGroupIdDimensionValue: Dimension value for the ID of the + // placement group. This is a read-only, auto-generated field. + PlacementGroupIdDimensionValue *DimensionValue `json:"placementGroupIdDimensionValue,omitempty"` + + // PlacementStrategyId: ID of the placement strategy assigned to this + // placement. + PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"` + + // PricingSchedule: Pricing schedule of this placement. This field is + // required on insertion, specifically subfields startDate, endDate and + // pricingType. + PricingSchedule *PricingSchedule `json:"pricingSchedule,omitempty"` + + // Primary: Whether this placement is the primary placement of a + // roadblock (placement group). You cannot change this field from true + // to false. Setting this field to true will automatically set the + // primary field on the original primary placement of the roadblock to + // false, and it will automatically set the roadblock's + // primaryPlacementId field to the ID of this placement. + Primary bool `json:"primary,omitempty"` + + // PublisherUpdateInfo: Information about the last publisher update. + // This is a read-only field. + PublisherUpdateInfo *LastModifiedInfo `json:"publisherUpdateInfo,omitempty"` + + // SiteId: Site ID associated with this placement. On insert, you must + // set either this field or the directorySiteId field to specify the + // site associated with this placement. This is a required field that is + // read-only after insertion. + SiteId int64 `json:"siteId,omitempty,string"` + + // SiteIdDimensionValue: Dimension value for the ID of the site. This is + // a read-only, auto-generated field. + SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"` + + // Size: Size associated with this placement. When inserting or updating + // a placement, only the size ID field is used. This field is required + // on insertion. + Size *Size `json:"size,omitempty"` + + // SslRequired: Whether creatives assigned to this placement must be + // SSL-compliant. + SslRequired bool `json:"sslRequired,omitempty"` + + // Status: Third-party placement status. + // + // Possible values: + // "ACKNOWLEDGE_ACCEPTANCE" + // "ACKNOWLEDGE_REJECTION" + // "DRAFT" + // "PAYMENT_ACCEPTED" + // "PAYMENT_REJECTED" + // "PENDING_REVIEW" + Status string `json:"status,omitempty"` + + // SubaccountId: Subaccount ID of this placement. This field can be left + // blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TagFormats: Tag formats to generate for this placement. This field is + // required on insertion. + // Acceptable values are: + // - "PLACEMENT_TAG_STANDARD" + // - "PLACEMENT_TAG_IFRAME_JAVASCRIPT" + // - "PLACEMENT_TAG_IFRAME_ILAYER" + // - "PLACEMENT_TAG_INTERNAL_REDIRECT" + // - "PLACEMENT_TAG_JAVASCRIPT" + // - "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT" + // - "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT" + // - "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT" + // - "PLACEMENT_TAG_CLICK_COMMANDS" + // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH" + // - "PLACEMENT_TAG_TRACKING" + // - "PLACEMENT_TAG_TRACKING_IFRAME" + // - "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + // + // Possible values: + // "PLACEMENT_TAG_CLICK_COMMANDS" + // "PLACEMENT_TAG_IFRAME_ILAYER" + // "PLACEMENT_TAG_IFRAME_JAVASCRIPT" + // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY" + // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH" + // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3" + // "PLACEMENT_TAG_INTERNAL_REDIRECT" + // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT" + // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY" + // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT" + // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT" + // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY" + // "PLACEMENT_TAG_JAVASCRIPT" + // "PLACEMENT_TAG_JAVASCRIPT_LEGACY" + // "PLACEMENT_TAG_STANDARD" + // "PLACEMENT_TAG_TRACKING" + // "PLACEMENT_TAG_TRACKING_IFRAME" + // "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + TagFormats []string `json:"tagFormats,omitempty"` + + // TagSetting: Tag settings for this placement. + TagSetting *TagSetting `json:"tagSetting,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Placement) MarshalJSON() ([]byte, error) { + type noMethod Placement + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlacementAssignment: Placement Assignment. +type PlacementAssignment struct { + // Active: Whether this placement assignment is active. When true, the + // placement will be included in the ad's rotation. + Active bool `json:"active,omitempty"` + + // PlacementId: ID of the placement to be assigned. This is a required + // field. + PlacementId int64 `json:"placementId,omitempty,string"` + + // PlacementIdDimensionValue: Dimension value for the ID of the + // placement. This is a read-only, auto-generated field. + PlacementIdDimensionValue *DimensionValue `json:"placementIdDimensionValue,omitempty"` + + // SslRequired: Whether the placement to be assigned requires SSL. This + // is a read-only field that is auto-generated when the ad is inserted + // or updated. + SslRequired bool `json:"sslRequired,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Active") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlacementAssignment) MarshalJSON() ([]byte, error) { + type noMethod PlacementAssignment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlacementGroup: Contains properties of a package or roadblock. +type PlacementGroup struct { + // AccountId: Account ID of this placement group. This is a read-only + // field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this placement group. This is a + // required field on insertion. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // Archived: Whether this placement group is archived. + Archived bool `json:"archived,omitempty"` + + // CampaignId: Campaign ID of this placement group. This field is + // required on insertion. + CampaignId int64 `json:"campaignId,omitempty,string"` + + // CampaignIdDimensionValue: Dimension value for the ID of the campaign. + // This is a read-only, auto-generated field. + CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"` + + // ChildPlacementIds: IDs of placements which are assigned to this + // placement group. This is a read-only, auto-generated field. + ChildPlacementIds googleapi.Int64s `json:"childPlacementIds,omitempty"` + + // Comment: Comments for this placement group. + Comment string `json:"comment,omitempty"` + + // ContentCategoryId: ID of the content category assigned to this + // placement group. + ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"` + + // CreateInfo: Information about the creation of this placement group. + // This is a read-only field. + CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"` + + // DirectorySiteId: Directory site ID associated with this placement + // group. On insert, you must set either this field or the site_id field + // to specify the site associated with this placement group. This is a + // required field that is read-only after insertion. + DirectorySiteId int64 `json:"directorySiteId,omitempty,string"` + + // DirectorySiteIdDimensionValue: Dimension value for the ID of the + // directory site. This is a read-only, auto-generated field. + DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"` + + // ExternalId: External ID for this placement. + ExternalId string `json:"externalId,omitempty"` + + // Id: ID of this placement group. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this placement group. + // This is a read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#placementGroup". + Kind string `json:"kind,omitempty"` + + // LastModifiedInfo: Information about the most recent modification of + // this placement group. This is a read-only field. + LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"` + + // Name: Name of this placement group. This is a required field and must + // be less than 256 characters long. + Name string `json:"name,omitempty"` + + // PlacementGroupType: Type of this placement group. A package is a + // simple group of placements that acts as a single pricing point for a + // group of tags. A roadblock is a group of placements that not only + // acts as a single pricing point, but also assumes that all the tags in + // it will be served at the same time. A roadblock requires one of its + // assigned placements to be marked as primary for reporting. This field + // is required on insertion. + // + // Possible values: + // "PLACEMENT_PACKAGE" + // "PLACEMENT_ROADBLOCK" + PlacementGroupType string `json:"placementGroupType,omitempty"` + + // PlacementStrategyId: ID of the placement strategy assigned to this + // placement group. + PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"` + + // PricingSchedule: Pricing schedule of this placement group. This field + // is required on insertion. + PricingSchedule *PricingSchedule `json:"pricingSchedule,omitempty"` + + // PrimaryPlacementId: ID of the primary placement, used to calculate + // the media cost of a roadblock (placement group). Modifying this field + // will automatically modify the primary field on all affected roadblock + // child placements. + PrimaryPlacementId int64 `json:"primaryPlacementId,omitempty,string"` + + // PrimaryPlacementIdDimensionValue: Dimension value for the ID of the + // primary placement. This is a read-only, auto-generated field. + PrimaryPlacementIdDimensionValue *DimensionValue `json:"primaryPlacementIdDimensionValue,omitempty"` + + // ProgrammaticSetting: Settings for a programmatic placement. + ProgrammaticSetting *ProgrammaticSetting `json:"programmaticSetting,omitempty"` + + // SiteId: Site ID associated with this placement group. On insert, you + // must set either this field or the directorySiteId field to specify + // the site associated with this placement group. This is a required + // field that is read-only after insertion. + SiteId int64 `json:"siteId,omitempty,string"` + + // SiteIdDimensionValue: Dimension value for the ID of the site. This is + // a read-only, auto-generated field. + SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"` + + // SubaccountId: Subaccount ID of this placement group. This is a + // read-only field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlacementGroup) MarshalJSON() ([]byte, error) { + type noMethod PlacementGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlacementGroupsListResponse: Placement Group List Response +type PlacementGroupsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#placementGroupsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // PlacementGroups: Placement group collection. + PlacementGroups []*PlacementGroup `json:"placementGroups,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlacementGroupsListResponse) MarshalJSON() ([]byte, error) { + type noMethod PlacementGroupsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlacementStrategiesListResponse: Placement Strategy List Response +type PlacementStrategiesListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#placementStrategiesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // PlacementStrategies: Placement strategy collection. + PlacementStrategies []*PlacementStrategy `json:"placementStrategies,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlacementStrategiesListResponse) MarshalJSON() ([]byte, error) { + type noMethod PlacementStrategiesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlacementStrategy: Contains properties of a placement strategy. +type PlacementStrategy struct { + // AccountId: Account ID of this placement strategy.This is a read-only + // field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // Id: ID of this placement strategy. This is a read-only, + // auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#placementStrategy". + Kind string `json:"kind,omitempty"` + + // Name: Name of this placement strategy. This is a required field. It + // must be less than 256 characters long and unique among placement + // strategies of the same account. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlacementStrategy) MarshalJSON() ([]byte, error) { + type noMethod PlacementStrategy + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlacementTag: Placement Tag +type PlacementTag struct { + // PlacementId: Placement ID + PlacementId int64 `json:"placementId,omitempty,string"` + + // TagDatas: Tags generated for this placement. + TagDatas []*TagData `json:"tagDatas,omitempty"` + + // ForceSendFields is a list of field names (e.g. "PlacementId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlacementTag) MarshalJSON() ([]byte, error) { + type noMethod PlacementTag + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlacementsGenerateTagsResponse: Placement GenerateTags Response +type PlacementsGenerateTagsResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#placementsGenerateTagsResponse". + Kind string `json:"kind,omitempty"` + + // PlacementTags: Set of generated tags for the specified placements. + PlacementTags []*PlacementTag `json:"placementTags,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlacementsGenerateTagsResponse) MarshalJSON() ([]byte, error) { + type noMethod PlacementsGenerateTagsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlacementsListResponse: Placement List Response +type PlacementsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#placementsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Placements: Placement collection. + Placements []*Placement `json:"placements,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlacementsListResponse) MarshalJSON() ([]byte, error) { + type noMethod PlacementsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlatformType: Contains information about a platform type that can be +// targeted by ads. +type PlatformType struct { + // Id: ID of this platform type. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#platformType". + Kind string `json:"kind,omitempty"` + + // Name: Name of this platform type. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlatformType) MarshalJSON() ([]byte, error) { + type noMethod PlatformType + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlatformTypesListResponse: Platform Type List Response +type PlatformTypesListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#platformTypesListResponse". + Kind string `json:"kind,omitempty"` + + // PlatformTypes: Platform type collection. + PlatformTypes []*PlatformType `json:"platformTypes,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlatformTypesListResponse) MarshalJSON() ([]byte, error) { + type noMethod PlatformTypesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PopupWindowProperties: Popup Window Properties. +type PopupWindowProperties struct { + // Dimension: Popup dimension for a creative. This is a read-only field. + // Applicable to the following creative types: all RICH_MEDIA and all + // VPAID + Dimension *Size `json:"dimension,omitempty"` + + // Offset: Upper-left corner coordinates of the popup window. Applicable + // if positionType is COORDINATES. + Offset *OffsetPosition `json:"offset,omitempty"` + + // PositionType: Popup window position either centered or at specific + // coordinate. + // + // Possible values: + // "CENTER" + // "COORDINATES" + PositionType string `json:"positionType,omitempty"` + + // ShowAddressBar: Whether to display the browser address bar. + ShowAddressBar bool `json:"showAddressBar,omitempty"` + + // ShowMenuBar: Whether to display the browser menu bar. + ShowMenuBar bool `json:"showMenuBar,omitempty"` + + // ShowScrollBar: Whether to display the browser scroll bar. + ShowScrollBar bool `json:"showScrollBar,omitempty"` + + // ShowStatusBar: Whether to display the browser status bar. + ShowStatusBar bool `json:"showStatusBar,omitempty"` + + // ShowToolBar: Whether to display the browser tool bar. + ShowToolBar bool `json:"showToolBar,omitempty"` + + // Title: Title of popup window. + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Dimension") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PopupWindowProperties) MarshalJSON() ([]byte, error) { + type noMethod PopupWindowProperties + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PostalCode: Contains information about a postal code that can be +// targeted by ads. +type PostalCode struct { + // Code: Postal code. This is equivalent to the id field. + Code string `json:"code,omitempty"` + + // CountryCode: Country code of the country to which this postal code + // belongs. + CountryCode string `json:"countryCode,omitempty"` + + // CountryDartId: DART ID of the country to which this postal code + // belongs. + CountryDartId int64 `json:"countryDartId,omitempty,string"` + + // Id: ID of this postal code. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#postalCode". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostalCode) MarshalJSON() ([]byte, error) { + type noMethod PostalCode + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PostalCodesListResponse: Postal Code List Response +type PostalCodesListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#postalCodesListResponse". + Kind string `json:"kind,omitempty"` + + // PostalCodes: Postal code collection. + PostalCodes []*PostalCode `json:"postalCodes,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostalCodesListResponse) MarshalJSON() ([]byte, error) { + type noMethod PostalCodesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Pricing: Pricing Information +type Pricing struct { + // CapCostType: Cap cost type of this inventory item. + // + // Possible values: + // "PLANNING_PLACEMENT_CAP_COST_TYPE_CUMULATIVE" + // "PLANNING_PLACEMENT_CAP_COST_TYPE_MONTHLY" + // "PLANNING_PLACEMENT_CAP_COST_TYPE_NONE" + CapCostType string `json:"capCostType,omitempty"` + + // EndDate: End date of this inventory item. + EndDate string `json:"endDate,omitempty"` + + // Flights: Flights of this inventory item. A flight (a.k.a. pricing + // period) represents the inventory item pricing information for a + // specific period of time. + Flights []*Flight `json:"flights,omitempty"` + + // GroupType: Group type of this inventory item if it represents a + // placement group. Is null otherwise. There are two type of placement + // groups: PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE is a simple group of + // inventory items that acts as a single pricing point for a group of + // tags. PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK is a group of inventory + // items that not only acts as a single pricing point, but also assumes + // that all the tags in it will be served at the same time. A roadblock + // requires one of its assigned inventory items to be marked as primary. + // + // Possible values: + // "PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE" + // "PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK" + GroupType string `json:"groupType,omitempty"` + + // PricingType: Pricing type of this inventory item. + // + // Possible values: + // "PLANNING_PLACEMENT_PRICING_TYPE_CLICKS" + // "PLANNING_PLACEMENT_PRICING_TYPE_CPA" + // "PLANNING_PLACEMENT_PRICING_TYPE_CPC" + // "PLANNING_PLACEMENT_PRICING_TYPE_CPM" + // "PLANNING_PLACEMENT_PRICING_TYPE_FLAT_RATE_CLICKS" + // "PLANNING_PLACEMENT_PRICING_TYPE_FLAT_RATE_IMPRESSIONS" + // "PLANNING_PLACEMENT_PRICING_TYPE_IMPRESSIONS" + PricingType string `json:"pricingType,omitempty"` + + // StartDate: Start date of this inventory item. + StartDate string `json:"startDate,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CapCostType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Pricing) MarshalJSON() ([]byte, error) { + type noMethod Pricing + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PricingSchedule: Pricing Schedule +type PricingSchedule struct { + // CapCostOption: Placement cap cost option. + // + // Possible values: + // "CAP_COST_CUMULATIVE" + // "CAP_COST_MONTHLY" + // "CAP_COST_NONE" + CapCostOption string `json:"capCostOption,omitempty"` + + // DisregardOverdelivery: Whether cap costs are ignored by ad serving. + DisregardOverdelivery bool `json:"disregardOverdelivery,omitempty"` + + // EndDate: Placement end date. This date must be later than, or the + // same day as, the placement start date, but not later than the + // campaign end date. If, for example, you set 6/25/2015 as both the + // start and end dates, the effective placement date is just that day + // only, 6/25/2015. The hours, minutes, and seconds of the end date + // should not be set, as doing so will result in an error. This field is + // required on insertion. + EndDate string `json:"endDate,omitempty"` + + // Flighted: Whether this placement is flighted. If true, pricing + // periods will be computed automatically. + Flighted bool `json:"flighted,omitempty"` + + // FloodlightActivityId: Floodlight activity ID associated with this + // placement. This field should be set when placement pricing type is + // set to PRICING_TYPE_CPA. + FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"` + + // PricingPeriods: Pricing periods for this placement. + PricingPeriods []*PricingSchedulePricingPeriod `json:"pricingPeriods,omitempty"` + + // PricingType: Placement pricing type. This field is required on + // insertion. + // + // Possible values: + // "PRICING_TYPE_CPA" + // "PRICING_TYPE_CPC" + // "PRICING_TYPE_CPM" + // "PRICING_TYPE_FLAT_RATE_CLICKS" + // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" + PricingType string `json:"pricingType,omitempty"` + + // StartDate: Placement start date. This date must be later than, or the + // same day as, the campaign start date. The hours, minutes, and seconds + // of the start date should not be set, as doing so will result in an + // error. This field is required on insertion. + StartDate string `json:"startDate,omitempty"` + + // TestingStartDate: Testing start date of this placement. The hours, + // minutes, and seconds of the start date should not be set, as doing so + // will result in an error. + TestingStartDate string `json:"testingStartDate,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CapCostOption") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PricingSchedule) MarshalJSON() ([]byte, error) { + type noMethod PricingSchedule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PricingSchedulePricingPeriod: Pricing Period +type PricingSchedulePricingPeriod struct { + // EndDate: Pricing period end date. This date must be later than, or + // the same day as, the pricing period start date, but not later than + // the placement end date. The period end date can be the same date as + // the period start date. If, for example, you set 6/25/2015 as both the + // start and end dates, the effective pricing period date is just that + // day only, 6/25/2015. The hours, minutes, and seconds of the end date + // should not be set, as doing so will result in an error. + EndDate string `json:"endDate,omitempty"` + + // PricingComment: Comments for this pricing period. + PricingComment string `json:"pricingComment,omitempty"` + + // RateOrCostNanos: Rate or cost of this pricing period. + RateOrCostNanos int64 `json:"rateOrCostNanos,omitempty,string"` + + // StartDate: Pricing period start date. This date must be later than, + // or the same day as, the placement start date. The hours, minutes, and + // seconds of the start date should not be set, as doing so will result + // in an error. + StartDate string `json:"startDate,omitempty"` + + // Units: Units of this pricing period. + Units int64 `json:"units,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "EndDate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PricingSchedulePricingPeriod) MarshalJSON() ([]byte, error) { + type noMethod PricingSchedulePricingPeriod + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ProgrammaticSetting: Programmatic Setting +type ProgrammaticSetting struct { + // AdxDealIds: Adx deal IDs assigned to the placement. + AdxDealIds googleapi.Int64s `json:"adxDealIds,omitempty"` + + // InsertionOrderId: Insertion order ID. + InsertionOrderId string `json:"insertionOrderId,omitempty"` + + // InsertionOrderIdStatus: Whether insertion order ID has been placed in + // DFP. This is a read-only field. + InsertionOrderIdStatus bool `json:"insertionOrderIdStatus,omitempty"` + + // MediaCostNanos: Media cost for the programmatic placement. + MediaCostNanos int64 `json:"mediaCostNanos,omitempty,string"` + + // Programmatic: Whether programmatic is enabled. + Programmatic bool `json:"programmatic,omitempty"` + + // TraffickerEmails: Trafficker emails assigned to the placement. + TraffickerEmails []string `json:"traffickerEmails,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AdxDealIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProgrammaticSetting) MarshalJSON() ([]byte, error) { + type noMethod ProgrammaticSetting + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Project: Contains properties of a DoubleClick Planning project. +type Project struct { + // AccountId: Account ID of this project. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this project. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AudienceAgeGroup: Audience age group of this project. + // + // Possible values: + // "PLANNING_AUDIENCE_AGE_18_24" + // "PLANNING_AUDIENCE_AGE_25_34" + // "PLANNING_AUDIENCE_AGE_35_44" + // "PLANNING_AUDIENCE_AGE_45_54" + // "PLANNING_AUDIENCE_AGE_55_64" + // "PLANNING_AUDIENCE_AGE_65_OR_MORE" + // "PLANNING_AUDIENCE_AGE_UNKNOWN" + AudienceAgeGroup string `json:"audienceAgeGroup,omitempty"` + + // AudienceGender: Audience gender of this project. + // + // Possible values: + // "PLANNING_AUDIENCE_GENDER_FEMALE" + // "PLANNING_AUDIENCE_GENDER_MALE" + AudienceGender string `json:"audienceGender,omitempty"` + + // Budget: Budget of this project in the currency specified by the + // current account. The value stored in this field represents only the + // non-fractional amount. For example, for USD, the smallest value that + // can be represented by this field is 1 US dollar. + Budget int64 `json:"budget,omitempty,string"` + + // ClientBillingCode: Client billing code of this project. + ClientBillingCode string `json:"clientBillingCode,omitempty"` + + // ClientName: Name of the project client. + ClientName string `json:"clientName,omitempty"` + + // EndDate: End date of the project. + EndDate string `json:"endDate,omitempty"` + + // Id: ID of this project. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#project". + Kind string `json:"kind,omitempty"` + + // LastModifiedInfo: Information about the most recent modification of + // this project. + LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"` + + // Name: Name of this project. + Name string `json:"name,omitempty"` + + // Overview: Overview of this project. + Overview string `json:"overview,omitempty"` + + // StartDate: Start date of the project. + StartDate string `json:"startDate,omitempty"` + + // SubaccountId: Subaccount ID of this project. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TargetClicks: Number of clicks that the advertiser is targeting. + TargetClicks int64 `json:"targetClicks,omitempty,string"` + + // TargetConversions: Number of conversions that the advertiser is + // targeting. + TargetConversions int64 `json:"targetConversions,omitempty,string"` + + // TargetCpaNanos: CPA that the advertiser is targeting. + TargetCpaNanos int64 `json:"targetCpaNanos,omitempty,string"` + + // TargetCpcNanos: CPC that the advertiser is targeting. + TargetCpcNanos int64 `json:"targetCpcNanos,omitempty,string"` + + // TargetCpmNanos: CPM that the advertiser is targeting. + TargetCpmNanos int64 `json:"targetCpmNanos,omitempty,string"` + + // TargetImpressions: Number of impressions that the advertiser is + // targeting. + TargetImpressions int64 `json:"targetImpressions,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Project) MarshalJSON() ([]byte, error) { + type noMethod Project + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ProjectsListResponse: Project List Response +type ProjectsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#projectsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Projects: Project collection. + Projects []*Project `json:"projects,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProjectsListResponse) MarshalJSON() ([]byte, error) { + type noMethod ProjectsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReachReportCompatibleFields: Represents fields that are compatible to +// be selected for a report of type "REACH". +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionFilters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReachReportCompatibleFields) MarshalJSON() ([]byte, error) { + type noMethod ReachReportCompatibleFields + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Recipient: Represents a recipient. +type Recipient struct { + // DeliveryType: The delivery type for the recipient. + // + // Possible values: + // "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"` + + // ForceSendFields is a list of field names (e.g. "DeliveryType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Recipient) MarshalJSON() ([]byte, error) { + type noMethod Recipient + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Region: Contains information about a region that can be targeted by +// ads. +type Region struct { + // CountryCode: Country code of the country to which this region + // belongs. + CountryCode string `json:"countryCode,omitempty"` + + // CountryDartId: DART ID of the country to which this region belongs. + CountryDartId int64 `json:"countryDartId,omitempty,string"` + + // DartId: DART ID of this region. + DartId int64 `json:"dartId,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#region". + Kind string `json:"kind,omitempty"` + + // Name: Name of this region. + Name string `json:"name,omitempty"` + + // RegionCode: Region code. + RegionCode string `json:"regionCode,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CountryCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Region) MarshalJSON() ([]byte, error) { + type noMethod Region + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RegionsListResponse: Region List Response +type RegionsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#regionsListResponse". + Kind string `json:"kind,omitempty"` + + // Regions: Region collection. + Regions []*Region `json:"regions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RegionsListResponse) MarshalJSON() ([]byte, error) { + type noMethod RegionsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RemarketingList: Contains properties of a remarketing list. +// Remarketing enables you to create lists of users who have performed +// specific actions on a site, then target ads to members of those +// lists. This resource can be used to manage remarketing lists that are +// owned by your advertisers. To see all remarketing lists that are +// visible to your advertisers, including those that are shared to your +// advertiser or account, use the TargetableRemarketingLists resource. +type RemarketingList struct { + // AccountId: Account ID of this remarketing list. This is a read-only, + // auto-generated field that is only returned in GET requests. + AccountId int64 `json:"accountId,omitempty,string"` + + // Active: Whether this remarketing list is active. + Active bool `json:"active,omitempty"` + + // AdvertiserId: Dimension value for the advertiser ID that owns this + // remarketing list. This is a required field. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // Description: Remarketing list description. + Description string `json:"description,omitempty"` + + // Id: Remarketing list ID. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#remarketingList". + Kind string `json:"kind,omitempty"` + + // LifeSpan: Number of days that a user should remain in the remarketing + // list without an impression. + LifeSpan int64 `json:"lifeSpan,omitempty,string"` + + // ListPopulationRule: Rule used to populate the remarketing list with + // users. + ListPopulationRule *ListPopulationRule `json:"listPopulationRule,omitempty"` + + // ListSize: Number of users currently in the list. This is a read-only + // field. + ListSize int64 `json:"listSize,omitempty,string"` + + // ListSource: Product from which this remarketing list was originated. + // + // Possible values: + // "REMARKETING_LIST_SOURCE_DBM" + // "REMARKETING_LIST_SOURCE_DFA" + // "REMARKETING_LIST_SOURCE_DMP" + // "REMARKETING_LIST_SOURCE_GA" + // "REMARKETING_LIST_SOURCE_OTHER" + ListSource string `json:"listSource,omitempty"` + + // Name: Name of the remarketing list. This is a required field. Must be + // no greater than 128 characters long. + Name string `json:"name,omitempty"` + + // SubaccountId: Subaccount ID of this remarketing list. This is a + // read-only, auto-generated field that is only returned in GET + // requests. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RemarketingList) MarshalJSON() ([]byte, error) { + type noMethod RemarketingList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RemarketingListShare: Contains properties of a remarketing list's +// sharing information. Sharing allows other accounts or advertisers to +// target to your remarketing lists. This resource can be used to manage +// remarketing list sharing to other accounts and advertisers. +type RemarketingListShare struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#remarketingListShare". + Kind string `json:"kind,omitempty"` + + // RemarketingListId: Remarketing list ID. This is a read-only, + // auto-generated field. + RemarketingListId int64 `json:"remarketingListId,omitempty,string"` + + // SharedAccountIds: Accounts that the remarketing list is shared with. + SharedAccountIds googleapi.Int64s `json:"sharedAccountIds,omitempty"` + + // SharedAdvertiserIds: Advertisers that the remarketing list is shared + // with. + SharedAdvertiserIds googleapi.Int64s `json:"sharedAdvertiserIds,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RemarketingListShare) MarshalJSON() ([]byte, error) { + type noMethod RemarketingListShare + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RemarketingListsListResponse: Remarketing list response +type RemarketingListsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#remarketingListsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // RemarketingLists: Remarketing list collection. + RemarketingLists []*RemarketingList `json:"remarketingLists,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RemarketingListsListResponse) MarshalJSON() ([]byte, error) { + type noMethod RemarketingListsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Report: Represents a Report resource. +type Report struct { + // AccountId: The account ID to which this report belongs. + AccountId int64 `json:"accountId,omitempty,string"` + + // 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 filename 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. 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. + // + // Possible values: + // "CSV" + // "EXCEL" + 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 subaccount ID to which this report belongs if + // applicable. + SubAccountId int64 `json:"subAccountId,omitempty,string"` + + // Type: The type of the report. + // + // Possible values: + // "CROSS_DIMENSION_REACH" + // "FLOODLIGHT" + // "PATH_TO_CONVERSION" + // "REACH" + // "STANDARD" + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Report) MarshalJSON() ([]byte, error) { + type noMethod Report + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportCriteria: The report criteria for a report of type "STANDARD". +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"` + + // ForceSendFields is a list of field names (e.g. "Activities") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportCrossDimensionReachCriteria: The report criteria for a report +// of type "CROSS_DIMENSION_REACH". +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. + // + // Possible values: + // "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"` + + // ForceSendFields is a list of field names (e.g. "Breakdown") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportCrossDimensionReachCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportCrossDimensionReachCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportDelivery: The report's email delivery settings. +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. + // + // Possible values: + // "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"` + + // ForceSendFields is a list of field names (e.g. "EmailOwner") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportDelivery) MarshalJSON() ([]byte, error) { + type noMethod ReportDelivery + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportFloodlightCriteria: The report criteria for a report of type +// "FLOODLIGHT". +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"` + + // ForceSendFields is a list of field names (e.g. + // "CustomRichMediaEvents") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportFloodlightCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportFloodlightCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportFloodlightCriteriaReportProperties: The properties of the +// report. +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"` + + // ForceSendFields is a list of field names (e.g. + // "IncludeAttributedIPConversions") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportFloodlightCriteriaReportProperties) MarshalJSON() ([]byte, error) { + type noMethod ReportFloodlightCriteriaReportProperties + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportPathToConversionCriteria: The report criteria for a report of +// type "PATH_TO_CONVERSION". +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"` + + // ForceSendFields is a list of field names (e.g. "ActivityFilters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportPathToConversionCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportPathToConversionCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportPathToConversionCriteriaReportProperties: The properties of the +// report. +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"` + + // ForceSendFields is a list of field names (e.g. + // "ClicksLookbackWindow") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportPathToConversionCriteriaReportProperties) MarshalJSON() ([]byte, error) { + type noMethod ReportPathToConversionCriteriaReportProperties + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportReachCriteria: The report criteria for a report of type +// "REACH". +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"` + + // EnableAllDimensionCombinations: Whether to enable all reach dimension + // combinations in the report. Defaults to false. If enabled, the date + // range of the report should be within the last three months. + EnableAllDimensionCombinations bool `json:"enableAllDimensionCombinations,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"` + + // ForceSendFields is a list of field names (e.g. "Activities") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportReachCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportReachCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportSchedule: 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". +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. Note: + // - "DAILY" also requires field "every" to be set. + // - "WEEKLY" also requires fields "every" and "repeatsOnWeekDays" to be + // set. + // - "MONTHLY" also requires fields "every" and "runsOnDayOfMonth" to be + // set. + Repeats string `json:"repeats,omitempty"` + + // RepeatsOnWeekDays: List of week days "WEEKLY" on which scheduled + // reports should run. + // + // Possible values: + // "FRIDAY" + // "MONDAY" + // "SATURDAY" + // "SUNDAY" + // "THURSDAY" + // "TUESDAY" + // "WEDNESDAY" + 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. + // 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. + // + // Possible values: + // "DAY_OF_MONTH" + // "WEEK_OF_MONTH" + RunsOnDayOfMonth string `json:"runsOnDayOfMonth,omitempty"` + + // StartDate: Start date of date range for which scheduled reports + // should be run. + StartDate string `json:"startDate,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Active") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportSchedule) MarshalJSON() ([]byte, error) { + type noMethod ReportSchedule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportCompatibleFields: Represents fields that are compatible to be +// selected for a report of type "STANDARD". +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionFilters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportCompatibleFields) MarshalJSON() ([]byte, error) { + type noMethod ReportCompatibleFields + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportList: Represents the list of reports. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportList) MarshalJSON() ([]byte, error) { + type noMethod ReportList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportsConfiguration: Reporting Configuration +type ReportsConfiguration struct { + // ExposureToConversionEnabled: Whether the exposure to conversion + // report is enabled. This report shows detailed pathway information on + // up to 10 of the most recent ad exposures seen by a user before + // converting. + ExposureToConversionEnabled bool `json:"exposureToConversionEnabled,omitempty"` + + // LookbackConfiguration: Default lookback windows for new advertisers + // in this account. + LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"` + + // ReportGenerationTimeZoneId: Report generation time zone ID of this + // account. This is a required field that can only be changed by a + // superuser. + // Acceptable values are: + // + // - "1" for "America/New_York" + // - "2" for "Europe/London" + // - "3" for "Europe/Paris" + // - "4" for "Africa/Johannesburg" + // - "5" for "Asia/Jerusalem" + // - "6" for "Asia/Shanghai" + // - "7" for "Asia/Hong_Kong" + // - "8" for "Asia/Tokyo" + // - "9" for "Australia/Sydney" + // - "10" for "Asia/Dubai" + // - "11" for "America/Los_Angeles" + // - "12" for "Pacific/Auckland" + // - "13" for "America/Sao_Paulo" + ReportGenerationTimeZoneId int64 `json:"reportGenerationTimeZoneId,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. + // "ExposureToConversionEnabled") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportsConfiguration) MarshalJSON() ([]byte, error) { + type noMethod ReportsConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RichMediaExitOverride: Rich Media Exit Override. +type RichMediaExitOverride struct { + // CustomExitUrl: Click-through URL to override the default exit URL. + // Applicable if the useCustomExitUrl field is set to true. + CustomExitUrl string `json:"customExitUrl,omitempty"` + + // ExitId: ID for the override to refer to a specific exit in the + // creative. + ExitId int64 `json:"exitId,omitempty,string"` + + // UseCustomExitUrl: Whether to use the custom exit URL. + UseCustomExitUrl bool `json:"useCustomExitUrl,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CustomExitUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RichMediaExitOverride) MarshalJSON() ([]byte, error) { + type noMethod RichMediaExitOverride + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Site: Contains properties of a site. +type Site struct { + // AccountId: Account ID of this site. This is a read-only field that + // can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // Approved: Whether this site is approved. + Approved bool `json:"approved,omitempty"` + + // DirectorySiteId: Directory site associated with this site. This is a + // required field that is read-only after insertion. + DirectorySiteId int64 `json:"directorySiteId,omitempty,string"` + + // DirectorySiteIdDimensionValue: Dimension value for the ID of the + // directory site. This is a read-only, auto-generated field. + DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"` + + // Id: ID of this site. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this site. This is a + // read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // KeyName: Key name of this site. This is a read-only, auto-generated + // field. + KeyName string `json:"keyName,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#site". + Kind string `json:"kind,omitempty"` + + // Name: Name of this site.This is a required field. Must be less than + // 128 characters long. If this site is under a subaccount, the name + // must be unique among sites of the same subaccount. Otherwise, this + // site is a top-level site, and the name must be unique among top-level + // sites of the same account. + Name string `json:"name,omitempty"` + + // SiteContacts: Site contacts. + SiteContacts []*SiteContact `json:"siteContacts,omitempty"` + + // SiteSettings: Site-wide settings. + SiteSettings *SiteSettings `json:"siteSettings,omitempty"` + + // SubaccountId: Subaccount ID of this site. This is a read-only field + // that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Site) MarshalJSON() ([]byte, error) { + type noMethod Site + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SiteContact: Site Contact +type SiteContact struct { + // Address: Address of this site contact. + Address string `json:"address,omitempty"` + + // ContactType: Site contact type. + // + // Possible values: + // "SALES_PERSON" + // "TRAFFICKER" + ContactType string `json:"contactType,omitempty"` + + // Email: Email address of this site contact. This is a required field. + Email string `json:"email,omitempty"` + + // FirstName: First name of this site contact. + FirstName string `json:"firstName,omitempty"` + + // Id: ID of this site contact. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // LastName: Last name of this site contact. + LastName string `json:"lastName,omitempty"` + + // Phone: Primary phone number of this site contact. + Phone string `json:"phone,omitempty"` + + // Title: Title or designation of this site contact. + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Address") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SiteContact) MarshalJSON() ([]byte, error) { + type noMethod SiteContact + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SiteSettings: Site Settings +type SiteSettings struct { + // ActiveViewOptOut: Whether active view creatives are disabled for this + // site. + ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"` + + // CreativeSettings: Site-wide creative settings. + CreativeSettings *CreativeSettings `json:"creativeSettings,omitempty"` + + // DisableBrandSafeAds: Whether brand safe ads are disabled for this + // site. + DisableBrandSafeAds bool `json:"disableBrandSafeAds,omitempty"` + + // DisableNewCookie: Whether new cookies are disabled for this site. + DisableNewCookie bool `json:"disableNewCookie,omitempty"` + + // LookbackConfiguration: Lookback window settings for this site. + LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"` + + // TagSetting: Configuration settings for dynamic and image floodlight + // tags. + TagSetting *TagSetting `json:"tagSetting,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ActiveViewOptOut") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SiteSettings) MarshalJSON() ([]byte, error) { + type noMethod SiteSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SitesListResponse: Site List Response +type SitesListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#sitesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Sites: Site collection. + Sites []*Site `json:"sites,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SitesListResponse) MarshalJSON() ([]byte, error) { + type noMethod SitesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Size: Represents the dimensions of ads, placements, creatives, or +// creative assets. +type Size struct { + // Height: Height of this size. + Height int64 `json:"height,omitempty"` + + // Iab: IAB standard size. This is a read-only, auto-generated field. + Iab bool `json:"iab,omitempty"` + + // Id: ID of this size. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#size". + Kind string `json:"kind,omitempty"` + + // Width: Width of this size. + Width int64 `json:"width,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Size) MarshalJSON() ([]byte, error) { + type noMethod Size + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SizesListResponse: Size List Response +type SizesListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#sizesListResponse". + Kind string `json:"kind,omitempty"` + + // Sizes: Size collection. + Sizes []*Size `json:"sizes,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SizesListResponse) MarshalJSON() ([]byte, error) { + type noMethod SizesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SortedDimension: Represents a sorted dimension. +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. + // + // Possible values: + // "ASCENDING" + // "DESCENDING" + SortOrder string `json:"sortOrder,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SortedDimension) MarshalJSON() ([]byte, error) { + type noMethod SortedDimension + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Subaccount: Contains properties of a DCM subaccount. +type Subaccount struct { + // AccountId: ID of the account that contains this subaccount. This is a + // read-only field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AvailablePermissionIds: IDs of the available user role permissions + // for this subaccount. + AvailablePermissionIds googleapi.Int64s `json:"availablePermissionIds,omitempty"` + + // Id: ID of this subaccount. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#subaccount". + Kind string `json:"kind,omitempty"` + + // Name: Name of this subaccount. This is a required field. Must be less + // than 128 characters long and be unique among subaccounts of the same + // account. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Subaccount) MarshalJSON() ([]byte, error) { + type noMethod Subaccount + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SubaccountsListResponse: Subaccount List Response +type SubaccountsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#subaccountsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Subaccounts: Subaccount collection. + Subaccounts []*Subaccount `json:"subaccounts,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SubaccountsListResponse) MarshalJSON() ([]byte, error) { + type noMethod SubaccountsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TagData: Placement Tag Data +type TagData struct { + // AdId: Ad associated with this placement tag. + AdId int64 `json:"adId,omitempty,string"` + + // ClickTag: Tag string to record a click. + ClickTag string `json:"clickTag,omitempty"` + + // CreativeId: Creative associated with this placement tag. + CreativeId int64 `json:"creativeId,omitempty,string"` + + // Format: TagData tag format of this tag. + // + // Possible values: + // "PLACEMENT_TAG_CLICK_COMMANDS" + // "PLACEMENT_TAG_IFRAME_ILAYER" + // "PLACEMENT_TAG_IFRAME_JAVASCRIPT" + // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY" + // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH" + // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3" + // "PLACEMENT_TAG_INTERNAL_REDIRECT" + // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT" + // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY" + // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT" + // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT" + // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY" + // "PLACEMENT_TAG_JAVASCRIPT" + // "PLACEMENT_TAG_JAVASCRIPT_LEGACY" + // "PLACEMENT_TAG_STANDARD" + // "PLACEMENT_TAG_TRACKING" + // "PLACEMENT_TAG_TRACKING_IFRAME" + // "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + Format string `json:"format,omitempty"` + + // ImpressionTag: Tag string for serving an ad. + ImpressionTag string `json:"impressionTag,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AdId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TagData) MarshalJSON() ([]byte, error) { + type noMethod TagData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TagSetting: Tag Settings +type TagSetting struct { + // AdditionalKeyValues: Additional key-values to be included in tags. + // Each key-value pair must be of the form key=value, and pairs must be + // separated by a semicolon (;). Keys and values must not contain + // commas. For example, id=2;color=red is a valid value for this field. + AdditionalKeyValues string `json:"additionalKeyValues,omitempty"` + + // IncludeClickThroughUrls: Whether static landing page URLs should be + // included in the tags. This setting applies only to placements. + IncludeClickThroughUrls bool `json:"includeClickThroughUrls,omitempty"` + + // IncludeClickTracking: Whether click-tracking string should be + // included in the tags. + IncludeClickTracking bool `json:"includeClickTracking,omitempty"` + + // KeywordOption: Option specifying how keywords are embedded in ad + // tags. This setting can be used to specify whether keyword + // placeholders are inserted in placement tags for this site. Publishers + // can then add keywords to those placeholders. + // + // Possible values: + // "GENERATE_SEPARATE_TAG_FOR_EACH_KEYWORD" + // "IGNORE" + // "PLACEHOLDER_WITH_LIST_OF_KEYWORDS" + KeywordOption string `json:"keywordOption,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AdditionalKeyValues") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TagSetting) MarshalJSON() ([]byte, error) { + type noMethod TagSetting + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TagSettings: Dynamic and Image Tag Settings. +type TagSettings struct { + // DynamicTagEnabled: Whether dynamic floodlight tags are enabled. + DynamicTagEnabled bool `json:"dynamicTagEnabled,omitempty"` + + // ImageTagEnabled: Whether image tags are enabled. + ImageTagEnabled bool `json:"imageTagEnabled,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DynamicTagEnabled") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TagSettings) MarshalJSON() ([]byte, error) { + type noMethod TagSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetWindow: Target Window. +type TargetWindow struct { + // CustomHtml: User-entered value. + CustomHtml string `json:"customHtml,omitempty"` + + // TargetWindowOption: Type of browser window for which the backup image + // of the flash creative can be displayed. + // + // Possible values: + // "CURRENT_WINDOW" + // "CUSTOM" + // "NEW_WINDOW" + TargetWindowOption string `json:"targetWindowOption,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CustomHtml") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetWindow) MarshalJSON() ([]byte, error) { + type noMethod TargetWindow + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetableRemarketingList: Contains properties of a targetable +// remarketing list. Remarketing enables you to create lists of users +// who have performed specific actions on a site, then target ads to +// members of those lists. This resource is a read-only view of a +// remarketing list to be used to faciliate targeting ads to specific +// lists. Remarketing lists that are owned by your advertisers and those +// that are shared to your advertisers or account are accessible via +// this resource. To manage remarketing lists that are owned by your +// advertisers, use the RemarketingLists resource. +type TargetableRemarketingList struct { + // AccountId: Account ID of this remarketing list. This is a read-only, + // auto-generated field that is only returned in GET requests. + AccountId int64 `json:"accountId,omitempty,string"` + + // Active: Whether this targetable remarketing list is active. + Active bool `json:"active,omitempty"` + + // AdvertiserId: Dimension value for the advertiser ID that owns this + // targetable remarketing list. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // Description: Targetable remarketing list description. + Description string `json:"description,omitempty"` + + // Id: Targetable remarketing list ID. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#targetableRemarketingList". + Kind string `json:"kind,omitempty"` + + // LifeSpan: Number of days that a user should remain in the targetable + // remarketing list without an impression. + LifeSpan int64 `json:"lifeSpan,omitempty,string"` + + // ListSize: Number of users currently in the list. This is a read-only + // field. + ListSize int64 `json:"listSize,omitempty,string"` + + // ListSource: Product from which this targetable remarketing list was + // originated. + // + // Possible values: + // "REMARKETING_LIST_SOURCE_DBM" + // "REMARKETING_LIST_SOURCE_DFA" + // "REMARKETING_LIST_SOURCE_DMP" + // "REMARKETING_LIST_SOURCE_GA" + // "REMARKETING_LIST_SOURCE_OTHER" + ListSource string `json:"listSource,omitempty"` + + // Name: Name of the targetable remarketing list. Is no greater than 128 + // characters long. + Name string `json:"name,omitempty"` + + // SubaccountId: Subaccount ID of this remarketing list. This is a + // read-only, auto-generated field that is only returned in GET + // requests. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetableRemarketingList) MarshalJSON() ([]byte, error) { + type noMethod TargetableRemarketingList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetableRemarketingListsListResponse: Targetable remarketing list +// response +type TargetableRemarketingListsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#targetableRemarketingListsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // TargetableRemarketingLists: Targetable remarketing list collection. + TargetableRemarketingLists []*TargetableRemarketingList `json:"targetableRemarketingLists,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetableRemarketingListsListResponse) MarshalJSON() ([]byte, error) { + type noMethod TargetableRemarketingListsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TechnologyTargeting: Technology Targeting. +type TechnologyTargeting struct { + // Browsers: Browsers that this ad targets. For each browser either set + // browserVersionId or dartId along with the version numbers. If both + // are specified, only browserVersionId will be used.The other fields + // are populated automatically when the ad is inserted or updated. + Browsers []*Browser `json:"browsers,omitempty"` + + // ConnectionTypes: Connection types that this ad targets. For each + // connection type only id is required.The other fields are populated + // automatically when the ad is inserted or updated. + ConnectionTypes []*ConnectionType `json:"connectionTypes,omitempty"` + + // MobileCarriers: Mobile carriers that this ad targets. For each mobile + // carrier only id is required, and the other fields are populated + // automatically when the ad is inserted or updated. If targeting a + // mobile carrier, do not set targeting for any zip codes. + MobileCarriers []*MobileCarrier `json:"mobileCarriers,omitempty"` + + // OperatingSystemVersions: Operating system versions that this ad + // targets. To target all versions, use operatingSystems. For each + // operating system version, only id is required. The other fields are + // populated automatically when the ad is inserted or updated. If + // targeting an operating system version, do not set targeting for the + // corresponding operating system in operatingSystems. + OperatingSystemVersions []*OperatingSystemVersion `json:"operatingSystemVersions,omitempty"` + + // OperatingSystems: Operating systems that this ad targets. To target + // specific versions, use operatingSystemVersions. For each operating + // system only dartId is required. The other fields are populated + // automatically when the ad is inserted or updated. If targeting an + // operating system, do not set targeting for operating system versions + // for the same operating system. + OperatingSystems []*OperatingSystem `json:"operatingSystems,omitempty"` + + // PlatformTypes: Platform types that this ad targets. For example, + // desktop, mobile, or tablet. For each platform type, only id is + // required, and the other fields are populated automatically when the + // ad is inserted or updated. + PlatformTypes []*PlatformType `json:"platformTypes,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Browsers") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TechnologyTargeting) MarshalJSON() ([]byte, error) { + type noMethod TechnologyTargeting + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ThirdPartyTrackingUrl: Third-party Tracking URL. +type ThirdPartyTrackingUrl struct { + // ThirdPartyUrlType: Third-party URL type for in-stream video + // creatives. + // + // Possible values: + // "CLICK_TRACKING" + // "IMPRESSION" + // "RICH_MEDIA_BACKUP_IMPRESSION" + // "RICH_MEDIA_IMPRESSION" + // "RICH_MEDIA_RM_IMPRESSION" + // "SURVEY" + // "VIDEO_COMPLETE" + // "VIDEO_CUSTOM" + // "VIDEO_FIRST_QUARTILE" + // "VIDEO_FULLSCREEN" + // "VIDEO_MIDPOINT" + // "VIDEO_MUTE" + // "VIDEO_PAUSE" + // "VIDEO_REWIND" + // "VIDEO_START" + // "VIDEO_STOP" + // "VIDEO_THIRD_QUARTILE" + ThirdPartyUrlType string `json:"thirdPartyUrlType,omitempty"` + + // Url: URL for the specified third-party URL type. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ThirdPartyUrlType") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ThirdPartyTrackingUrl) MarshalJSON() ([]byte, error) { + type noMethod ThirdPartyTrackingUrl + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserDefinedVariableConfiguration: User Defined Variable +// configuration. +type UserDefinedVariableConfiguration struct { + // DataType: Data type for the variable. This is a required field. + // + // Possible values: + // "NUMBER" + // "STRING" + DataType string `json:"dataType,omitempty"` + + // ReportName: User-friendly name for the variable which will appear in + // reports. This is a required field, must be less than 64 characters + // long, and cannot contain the following characters: ""<>". + ReportName string `json:"reportName,omitempty"` + + // VariableType: Variable name in the tag. This is a required field. + // + // Possible values: + // "U1" + // "U10" + // "U11" + // "U12" + // "U13" + // "U14" + // "U15" + // "U16" + // "U17" + // "U18" + // "U19" + // "U2" + // "U20" + // "U3" + // "U4" + // "U5" + // "U6" + // "U7" + // "U8" + // "U9" + VariableType string `json:"variableType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DataType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserDefinedVariableConfiguration) MarshalJSON() ([]byte, error) { + type noMethod UserDefinedVariableConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserProfile: Represents a UserProfile resource. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserProfile) MarshalJSON() ([]byte, error) { + type noMethod UserProfile + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserProfileList: Represents the list of user profiles. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserProfileList) MarshalJSON() ([]byte, error) { + type noMethod UserProfileList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserRole: Contains properties of auser role, which is used to manage +// user access. +type UserRole struct { + // AccountId: Account ID of this user role. This is a read-only field + // that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // DefaultUserRole: Whether this is a default user role. Default user + // roles are created by the system for the account/subaccount and cannot + // be modified or deleted. Each default user role comes with a basic set + // of preassigned permissions. + DefaultUserRole bool `json:"defaultUserRole,omitempty"` + + // Id: ID of this user role. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#userRole". + Kind string `json:"kind,omitempty"` + + // Name: Name of this user role. This is a required field. Must be less + // than 256 characters long. If this user role is under a subaccount, + // the name must be unique among sites of the same subaccount. + // Otherwise, this user role is a top-level user role, and the name must + // be unique among top-level user roles of the same account. + Name string `json:"name,omitempty"` + + // ParentUserRoleId: ID of the user role that this user role is based on + // or copied from. This is a required field. + ParentUserRoleId int64 `json:"parentUserRoleId,omitempty,string"` + + // Permissions: List of permissions associated with this user role. + Permissions []*UserRolePermission `json:"permissions,omitempty"` + + // SubaccountId: Subaccount ID of this user role. This is a read-only + // field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserRole) MarshalJSON() ([]byte, error) { + type noMethod UserRole + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserRolePermission: Contains properties of a user role permission. +type UserRolePermission struct { + // Availability: Levels of availability for a user role permission. + // + // Possible values: + // "ACCOUNT_ALWAYS" + // "ACCOUNT_BY_DEFAULT" + // "NOT_AVAILABLE_BY_DEFAULT" + // "SUBACCOUNT_AND_ACCOUNT_ALWAYS" + // "SUBACCOUNT_AND_ACCOUNT_BY_DEFAULT" + Availability string `json:"availability,omitempty"` + + // Id: ID of this user role permission. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#userRolePermission". + Kind string `json:"kind,omitempty"` + + // Name: Name of this user role permission. + Name string `json:"name,omitempty"` + + // PermissionGroupId: ID of the permission group that this user role + // permission belongs to. + PermissionGroupId int64 `json:"permissionGroupId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Availability") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserRolePermission) MarshalJSON() ([]byte, error) { + type noMethod UserRolePermission + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserRolePermissionGroup: Represents a grouping of related user role +// permissions. +type UserRolePermissionGroup struct { + // Id: ID of this user role permission. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#userRolePermissionGroup". + Kind string `json:"kind,omitempty"` + + // Name: Name of this user role permission group. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserRolePermissionGroup) MarshalJSON() ([]byte, error) { + type noMethod UserRolePermissionGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserRolePermissionGroupsListResponse: User Role Permission Group List +// Response +type UserRolePermissionGroupsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#userRolePermissionGroupsListResponse". + Kind string `json:"kind,omitempty"` + + // UserRolePermissionGroups: User role permission group collection. + UserRolePermissionGroups []*UserRolePermissionGroup `json:"userRolePermissionGroups,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserRolePermissionGroupsListResponse) MarshalJSON() ([]byte, error) { + type noMethod UserRolePermissionGroupsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserRolePermissionsListResponse: User Role Permission List Response +type UserRolePermissionsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#userRolePermissionsListResponse". + Kind string `json:"kind,omitempty"` + + // UserRolePermissions: User role permission collection. + UserRolePermissions []*UserRolePermission `json:"userRolePermissions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserRolePermissionsListResponse) MarshalJSON() ([]byte, error) { + type noMethod UserRolePermissionsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserRolesListResponse: User Role List Response +type UserRolesListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#userRolesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // UserRoles: User role collection. + UserRoles []*UserRole `json:"userRoles,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserRolesListResponse) MarshalJSON() ([]byte, error) { + type noMethod UserRolesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "dfareporting.accountActiveAdSummaries.get": + +type AccountActiveAdSummariesGetCall struct { + s *Service + profileId int64 + summaryAccountId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the account's active ad summary by account ID. +func (r *AccountActiveAdSummariesService) Get(profileId int64, summaryAccountId int64) *AccountActiveAdSummariesGetCall { + c := &AccountActiveAdSummariesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.summaryAccountId = summaryAccountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountActiveAdSummariesGetCall) Fields(s ...googleapi.Field) *AccountActiveAdSummariesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountActiveAdSummariesGetCall) IfNoneMatch(entityTag string) *AccountActiveAdSummariesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountActiveAdSummariesGetCall) Context(ctx context.Context) *AccountActiveAdSummariesGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountActiveAdSummariesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "summaryAccountId": strconv.FormatInt(c.summaryAccountId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountActiveAdSummaries.get" call. +// Exactly one of *AccountActiveAdSummary or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AccountActiveAdSummary.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountActiveAdSummariesGetCall) Do() (*AccountActiveAdSummary, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountActiveAdSummary{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the account's active ad summary by account ID.", + // "httpMethod": "GET", + // "id": "dfareporting.accountActiveAdSummaries.get", + // "parameterOrder": [ + // "profileId", + // "summaryAccountId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "summaryAccountId": { + // "description": "Account ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}", + // "response": { + // "$ref": "AccountActiveAdSummary" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accountPermissionGroups.get": + +type AccountPermissionGroupsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one account permission group by ID. +func (r *AccountPermissionGroupsService) Get(profileId int64, id int64) *AccountPermissionGroupsGetCall { + c := &AccountPermissionGroupsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountPermissionGroupsGetCall) Fields(s ...googleapi.Field) *AccountPermissionGroupsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountPermissionGroupsGetCall) IfNoneMatch(entityTag string) *AccountPermissionGroupsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountPermissionGroupsGetCall) Context(ctx context.Context) *AccountPermissionGroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountPermissionGroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissionGroups/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountPermissionGroups.get" call. +// Exactly one of *AccountPermissionGroup or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AccountPermissionGroup.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountPermissionGroupsGetCall) Do() (*AccountPermissionGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountPermissionGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one account permission group by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.accountPermissionGroups.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Account permission group ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountPermissionGroups/{id}", + // "response": { + // "$ref": "AccountPermissionGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accountPermissionGroups.list": + +type AccountPermissionGroupsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of account permission groups. +func (r *AccountPermissionGroupsService) List(profileId int64) *AccountPermissionGroupsListCall { + c := &AccountPermissionGroupsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountPermissionGroupsListCall) Fields(s ...googleapi.Field) *AccountPermissionGroupsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountPermissionGroupsListCall) IfNoneMatch(entityTag string) *AccountPermissionGroupsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountPermissionGroupsListCall) Context(ctx context.Context) *AccountPermissionGroupsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountPermissionGroupsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissionGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountPermissionGroups.list" call. +// Exactly one of *AccountPermissionGroupsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AccountPermissionGroupsListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AccountPermissionGroupsListCall) Do() (*AccountPermissionGroupsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountPermissionGroupsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of account permission groups.", + // "httpMethod": "GET", + // "id": "dfareporting.accountPermissionGroups.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountPermissionGroups", + // "response": { + // "$ref": "AccountPermissionGroupsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accountPermissions.get": + +type AccountPermissionsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one account permission by ID. +func (r *AccountPermissionsService) Get(profileId int64, id int64) *AccountPermissionsGetCall { + c := &AccountPermissionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountPermissionsGetCall) Fields(s ...googleapi.Field) *AccountPermissionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountPermissionsGetCall) IfNoneMatch(entityTag string) *AccountPermissionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountPermissionsGetCall) Context(ctx context.Context) *AccountPermissionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountPermissionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissions/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountPermissions.get" call. +// Exactly one of *AccountPermission or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AccountPermission.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountPermissionsGetCall) Do() (*AccountPermission, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountPermission{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one account permission by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.accountPermissions.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Account permission ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountPermissions/{id}", + // "response": { + // "$ref": "AccountPermission" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accountPermissions.list": + +type AccountPermissionsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of account permissions. +func (r *AccountPermissionsService) List(profileId int64) *AccountPermissionsListCall { + c := &AccountPermissionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountPermissionsListCall) Fields(s ...googleapi.Field) *AccountPermissionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountPermissionsListCall) IfNoneMatch(entityTag string) *AccountPermissionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountPermissionsListCall) Context(ctx context.Context) *AccountPermissionsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountPermissionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountPermissions.list" call. +// Exactly one of *AccountPermissionsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AccountPermissionsListResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountPermissionsListCall) Do() (*AccountPermissionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountPermissionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of account permissions.", + // "httpMethod": "GET", + // "id": "dfareporting.accountPermissions.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountPermissions", + // "response": { + // "$ref": "AccountPermissionsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accountUserProfiles.get": + +type AccountUserProfilesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one account user profile by ID. +func (r *AccountUserProfilesService) Get(profileId int64, id int64) *AccountUserProfilesGetCall { + c := &AccountUserProfilesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountUserProfilesGetCall) Fields(s ...googleapi.Field) *AccountUserProfilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountUserProfilesGetCall) IfNoneMatch(entityTag string) *AccountUserProfilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountUserProfilesGetCall) Context(ctx context.Context) *AccountUserProfilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountUserProfilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountUserProfiles.get" call. +// Exactly one of *AccountUserProfile or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AccountUserProfile.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountUserProfilesGetCall) Do() (*AccountUserProfile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountUserProfile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one account user profile by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.accountUserProfiles.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "User profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountUserProfiles/{id}", + // "response": { + // "$ref": "AccountUserProfile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accountUserProfiles.insert": + +type AccountUserProfilesInsertCall struct { + s *Service + profileId int64 + accountuserprofile *AccountUserProfile + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new account user profile. +func (r *AccountUserProfilesService) Insert(profileId int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesInsertCall { + c := &AccountUserProfilesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.accountuserprofile = accountuserprofile + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountUserProfilesInsertCall) Fields(s ...googleapi.Field) *AccountUserProfilesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountUserProfilesInsertCall) Context(ctx context.Context) *AccountUserProfilesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *AccountUserProfilesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountUserProfiles.insert" call. +// Exactly one of *AccountUserProfile or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AccountUserProfile.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountUserProfilesInsertCall) Do() (*AccountUserProfile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountUserProfile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new account user profile.", + // "httpMethod": "POST", + // "id": "dfareporting.accountUserProfiles.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountUserProfiles", + // "request": { + // "$ref": "AccountUserProfile" + // }, + // "response": { + // "$ref": "AccountUserProfile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accountUserProfiles.list": + +type AccountUserProfilesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of account user profiles, possibly filtered. +func (r *AccountUserProfilesService) List(profileId int64) *AccountUserProfilesListCall { + c := &AccountUserProfilesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Active sets the optional parameter "active": Select only active user +// profiles. +func (c *AccountUserProfilesListCall) Active(active bool) *AccountUserProfilesListCall { + c.opt_["active"] = active + return c +} + +// Ids sets the optional parameter "ids": Select only user profiles with +// these IDs. +func (c *AccountUserProfilesListCall) Ids(ids int64) *AccountUserProfilesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *AccountUserProfilesListCall) MaxResults(maxResults int64) *AccountUserProfilesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *AccountUserProfilesListCall) PageToken(pageToken string) *AccountUserProfilesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name, ID or email. Wildcards (*) are +// allowed. For example, "user profile*2015" will return objects with +// names like "user profile June 2015", "user profile April 2015", or +// simply "user profile 2015". Most of the searches also add wildcards +// implicitly at the start and the end of the search string. For +// example, a search string of "user profile" will match objects with +// name "my user profile", "user profile 2015", or simply "user +// profile". +func (c *AccountUserProfilesListCall) SearchString(searchString string) *AccountUserProfilesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *AccountUserProfilesListCall) SortField(sortField string) *AccountUserProfilesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *AccountUserProfilesListCall) SortOrder(sortOrder string) *AccountUserProfilesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// SubaccountId sets the optional parameter "subaccountId": Select only +// user profiles with the specified subaccount ID. +func (c *AccountUserProfilesListCall) SubaccountId(subaccountId int64) *AccountUserProfilesListCall { + c.opt_["subaccountId"] = subaccountId + return c +} + +// UserRoleId sets the optional parameter "userRoleId": Select only user +// profiles with the specified user role ID. +func (c *AccountUserProfilesListCall) UserRoleId(userRoleId int64) *AccountUserProfilesListCall { + c.opt_["userRoleId"] = userRoleId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountUserProfilesListCall) Fields(s ...googleapi.Field) *AccountUserProfilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountUserProfilesListCall) IfNoneMatch(entityTag string) *AccountUserProfilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountUserProfilesListCall) Context(ctx context.Context) *AccountUserProfilesListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountUserProfilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["active"]; ok { + params.Set("active", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["subaccountId"]; ok { + params.Set("subaccountId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["userRoleId"]; ok { + params.Set("userRoleId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountUserProfiles.list" call. +// Exactly one of *AccountUserProfilesListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AccountUserProfilesListResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountUserProfilesListCall) Do() (*AccountUserProfilesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountUserProfilesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of account user profiles, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.accountUserProfiles.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "active": { + // "description": "Select only active user profiles.", + // "location": "query", + // "type": "boolean" + // }, + // "ids": { + // "description": "Select only user profiles with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, \"user profile*2015\" will return objects with names like \"user profile June 2015\", \"user profile April 2015\", or simply \"user profile 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"user profile\" will match objects with name \"my user profile\", \"user profile 2015\", or simply \"user profile\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "subaccountId": { + // "description": "Select only user profiles with the specified subaccount ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "userRoleId": { + // "description": "Select only user profiles with the specified user role ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountUserProfiles", + // "response": { + // "$ref": "AccountUserProfilesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accountUserProfiles.patch": + +type AccountUserProfilesPatchCall struct { + s *Service + profileId int64 + id int64 + accountuserprofile *AccountUserProfile + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing account user profile. This method supports +// patch semantics. +func (r *AccountUserProfilesService) Patch(profileId int64, id int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesPatchCall { + c := &AccountUserProfilesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.accountuserprofile = accountuserprofile + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountUserProfilesPatchCall) Fields(s ...googleapi.Field) *AccountUserProfilesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountUserProfilesPatchCall) Context(ctx context.Context) *AccountUserProfilesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AccountUserProfilesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountUserProfiles.patch" call. +// Exactly one of *AccountUserProfile or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AccountUserProfile.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountUserProfilesPatchCall) Do() (*AccountUserProfile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountUserProfile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing account user profile. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.accountUserProfiles.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "User profile ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountUserProfiles", + // "request": { + // "$ref": "AccountUserProfile" + // }, + // "response": { + // "$ref": "AccountUserProfile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accountUserProfiles.update": + +type AccountUserProfilesUpdateCall struct { + s *Service + profileId int64 + accountuserprofile *AccountUserProfile + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing account user profile. +func (r *AccountUserProfilesService) Update(profileId int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesUpdateCall { + c := &AccountUserProfilesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.accountuserprofile = accountuserprofile + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountUserProfilesUpdateCall) Fields(s ...googleapi.Field) *AccountUserProfilesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountUserProfilesUpdateCall) Context(ctx context.Context) *AccountUserProfilesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountUserProfilesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountUserProfiles.update" call. +// Exactly one of *AccountUserProfile or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AccountUserProfile.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountUserProfilesUpdateCall) Do() (*AccountUserProfile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountUserProfile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing account user profile.", + // "httpMethod": "PUT", + // "id": "dfareporting.accountUserProfiles.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountUserProfiles", + // "request": { + // "$ref": "AccountUserProfile" + // }, + // "response": { + // "$ref": "AccountUserProfile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accounts.get": + +type AccountsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one account by ID. +func (r *AccountsService) Get(profileId int64, id int64) *AccountsGetCall { + c := &AccountsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accounts.get" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsGetCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one account by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.accounts.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Account ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accounts/{id}", + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accounts.list": + +type AccountsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of accounts, possibly filtered. +func (r *AccountsService) List(profileId int64) *AccountsListCall { + c := &AccountsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Active sets the optional parameter "active": Select only active +// accounts. Don't set this field to select both active and non-active +// accounts. +func (c *AccountsListCall) Active(active bool) *AccountsListCall { + c.opt_["active"] = active + return c +} + +// Ids sets the optional parameter "ids": Select only accounts with +// these IDs. +func (c *AccountsListCall) Ids(ids int64) *AccountsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *AccountsListCall) MaxResults(maxResults int64) *AccountsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "account*2015" will return objects with names like "account +// June 2015", "account April 2015", or simply "account 2015". Most of +// the searches also add wildcards implicitly at the start and the end +// of the search string. For example, a search string of "account" will +// match objects with name "my account", "account 2015", or simply +// "account". +func (c *AccountsListCall) SearchString(searchString string) *AccountsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *AccountsListCall) SortField(sortField string) *AccountsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *AccountsListCall) SortOrder(sortOrder string) *AccountsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["active"]; ok { + params.Set("active", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accounts.list" call. +// Exactly one of *AccountsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AccountsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsListCall) Do() (*AccountsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of accounts, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.accounts.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "active": { + // "description": "Select only active accounts. Don't set this field to select both active and non-active accounts.", + // "location": "query", + // "type": "boolean" + // }, + // "ids": { + // "description": "Select only accounts with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"account*2015\" will return objects with names like \"account June 2015\", \"account April 2015\", or simply \"account 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"account\" will match objects with name \"my account\", \"account 2015\", or simply \"account\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accounts", + // "response": { + // "$ref": "AccountsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accounts.patch": + +type AccountsPatchCall struct { + s *Service + profileId int64 + id int64 + account *Account + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing account. This method supports patch +// semantics. +func (r *AccountsService) Patch(profileId int64, id int64, account *Account) *AccountsPatchCall { + c := &AccountsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.account = account + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsPatchCall) Fields(s ...googleapi.Field) *AccountsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsPatchCall) Context(ctx context.Context) *AccountsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accounts.patch" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsPatchCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing account. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.accounts.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Account ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accounts", + // "request": { + // "$ref": "Account" + // }, + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accounts.update": + +type AccountsUpdateCall struct { + s *Service + profileId int64 + account *Account + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing account. +func (r *AccountsService) Update(profileId int64, account *Account) *AccountsUpdateCall { + c := &AccountsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.account = account + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsUpdateCall) Fields(s ...googleapi.Field) *AccountsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsUpdateCall) Context(ctx context.Context) *AccountsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accounts.update" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsUpdateCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing account.", + // "httpMethod": "PUT", + // "id": "dfareporting.accounts.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accounts", + // "request": { + // "$ref": "Account" + // }, + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.ads.get": + +type AdsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one ad by ID. +func (r *AdsService) Get(profileId int64, id int64) *AdsGetCall { + c := &AdsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdsGetCall) Fields(s ...googleapi.Field) *AdsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdsGetCall) IfNoneMatch(entityTag string) *AdsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdsGetCall) Context(ctx context.Context) *AdsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AdsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.ads.get" call. +// Exactly one of *Ad or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either *Ad.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AdsGetCall) Do() (*Ad, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Ad{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one ad by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.ads.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Ad ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/ads/{id}", + // "response": { + // "$ref": "Ad" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.ads.insert": + +type AdsInsertCall struct { + s *Service + profileId int64 + ad *Ad + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new ad. +func (r *AdsService) Insert(profileId int64, ad *Ad) *AdsInsertCall { + c := &AdsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.ad = ad + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdsInsertCall) Fields(s ...googleapi.Field) *AdsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdsInsertCall) Context(ctx context.Context) *AdsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *AdsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.ads.insert" call. +// Exactly one of *Ad or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either *Ad.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AdsInsertCall) Do() (*Ad, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Ad{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new ad.", + // "httpMethod": "POST", + // "id": "dfareporting.ads.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/ads", + // "request": { + // "$ref": "Ad" + // }, + // "response": { + // "$ref": "Ad" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.ads.list": + +type AdsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of ads, possibly filtered. +func (r *AdsService) List(profileId int64) *AdsListCall { + c := &AdsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Active sets the optional parameter "active": Select only active ads. +func (c *AdsListCall) Active(active bool) *AdsListCall { + c.opt_["active"] = active + return c +} + +// AdvertiserId sets the optional parameter "advertiserId": Select only +// ads with this advertiser ID. +func (c *AdsListCall) AdvertiserId(advertiserId int64) *AdsListCall { + c.opt_["advertiserId"] = advertiserId + return c +} + +// Archived sets the optional parameter "archived": Select only archived +// ads. +func (c *AdsListCall) Archived(archived bool) *AdsListCall { + c.opt_["archived"] = archived + return c +} + +// AudienceSegmentIds sets the optional parameter "audienceSegmentIds": +// Select only ads with these audience segment IDs. +func (c *AdsListCall) AudienceSegmentIds(audienceSegmentIds int64) *AdsListCall { + c.opt_["audienceSegmentIds"] = audienceSegmentIds + return c +} + +// CampaignIds sets the optional parameter "campaignIds": Select only +// ads with these campaign IDs. +func (c *AdsListCall) CampaignIds(campaignIds int64) *AdsListCall { + c.opt_["campaignIds"] = campaignIds + return c +} + +// Compatibility sets the optional parameter "compatibility": Select +// default ads with the specified compatibility. Applicable when type is +// AD_SERVING_DEFAULT_AD. WEB and WEB_INTERSTITIAL refer to rendering +// either on desktop or on mobile devices for regular or interstitial +// ads, respectively. APP and APP_INTERSTITIAL are for rendering in +// mobile apps. IN_STREAM_VIDEO refers to rendering an in-stream video +// ads developed with the VAST standard. +// +// Possible values: +// "APP" +// "APP_INTERSTITIAL" +// "IN_STREAM_VIDEO" +// "WEB" +// "WEB_INTERSTITIAL" +func (c *AdsListCall) Compatibility(compatibility string) *AdsListCall { + c.opt_["compatibility"] = compatibility + return c +} + +// CreativeIds sets the optional parameter "creativeIds": Select only +// ads with these creative IDs assigned. +func (c *AdsListCall) CreativeIds(creativeIds int64) *AdsListCall { + c.opt_["creativeIds"] = creativeIds + return c +} + +// CreativeOptimizationConfigurationIds sets the optional parameter +// "creativeOptimizationConfigurationIds": Select only ads with these +// creative optimization configuration IDs. +func (c *AdsListCall) CreativeOptimizationConfigurationIds(creativeOptimizationConfigurationIds int64) *AdsListCall { + c.opt_["creativeOptimizationConfigurationIds"] = creativeOptimizationConfigurationIds + return c +} + +// CreativeType sets the optional parameter "creativeType": Select only +// ads with the specified creativeType. +// +// Possible values: +// "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO" +// "CUSTOM_INPAGE" +// "CUSTOM_INTERSTITIAL" +// "ENHANCED_BANNER" +// "ENHANCED_IMAGE" +// "FLASH_INPAGE" +// "HTML5_BANNER" +// "IMAGE" +// "INSTREAM_VIDEO" +// "INTERNAL_REDIRECT" +// "INTERSTITIAL_INTERNAL_REDIRECT" +// "REDIRECT" +// "RICH_MEDIA_EXPANDING" +// "RICH_MEDIA_IM_EXPAND" +// "RICH_MEDIA_INPAGE" +// "RICH_MEDIA_INPAGE_FLOATING" +// "RICH_MEDIA_INTERSTITIAL_FLOAT" +// "RICH_MEDIA_MOBILE_IN_APP" +// "RICH_MEDIA_MULTI_FLOATING" +// "RICH_MEDIA_PEEL_DOWN" +// "TRACKING_TEXT" +// "VAST_REDIRECT" +// "VPAID_LINEAR" +// "VPAID_NON_LINEAR" +func (c *AdsListCall) CreativeType(creativeType string) *AdsListCall { + c.opt_["creativeType"] = creativeType + return c +} + +// DynamicClickTracker sets the optional parameter +// "dynamicClickTracker": Select only dynamic click trackers. Applicable +// when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click +// trackers. If false, select static click trackers. Leave unset to +// select both. +func (c *AdsListCall) DynamicClickTracker(dynamicClickTracker bool) *AdsListCall { + c.opt_["dynamicClickTracker"] = dynamicClickTracker + return c +} + +// Ids sets the optional parameter "ids": Select only ads with these +// IDs. +func (c *AdsListCall) Ids(ids int64) *AdsListCall { + c.opt_["ids"] = ids + return c +} + +// LandingPageIds sets the optional parameter "landingPageIds": Select +// only ads with these landing page IDs. +func (c *AdsListCall) LandingPageIds(landingPageIds int64) *AdsListCall { + c.opt_["landingPageIds"] = landingPageIds + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *AdsListCall) MaxResults(maxResults int64) *AdsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OverriddenEventTagId sets the optional parameter +// "overriddenEventTagId": Select only ads with this event tag override +// ID. +func (c *AdsListCall) OverriddenEventTagId(overriddenEventTagId int64) *AdsListCall { + c.opt_["overriddenEventTagId"] = overriddenEventTagId + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *AdsListCall) PageToken(pageToken string) *AdsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// PlacementIds sets the optional parameter "placementIds": Select only +// ads with these placement IDs assigned. +func (c *AdsListCall) PlacementIds(placementIds int64) *AdsListCall { + c.opt_["placementIds"] = placementIds + return c +} + +// RemarketingListIds sets the optional parameter "remarketingListIds": +// Select only ads whose list targeting expression use these remarketing +// list IDs. +func (c *AdsListCall) RemarketingListIds(remarketingListIds int64) *AdsListCall { + c.opt_["remarketingListIds"] = remarketingListIds + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "ad*2015" will return objects with names like "ad June +// 2015", "ad April 2015", or simply "ad 2015". Most of the searches +// also add wildcards implicitly at the start and the end of the search +// string. For example, a search string of "ad" will match objects with +// name "my ad", "ad 2015", or simply "ad". +func (c *AdsListCall) SearchString(searchString string) *AdsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SizeIds sets the optional parameter "sizeIds": Select only ads with +// these size IDs. +func (c *AdsListCall) SizeIds(sizeIds int64) *AdsListCall { + c.opt_["sizeIds"] = sizeIds + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *AdsListCall) SortField(sortField string) *AdsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *AdsListCall) SortOrder(sortOrder string) *AdsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// SslCompliant sets the optional parameter "sslCompliant": Select only +// ads that are SSL-compliant. +func (c *AdsListCall) SslCompliant(sslCompliant bool) *AdsListCall { + c.opt_["sslCompliant"] = sslCompliant + return c +} + +// SslRequired sets the optional parameter "sslRequired": Select only +// ads that require SSL. +func (c *AdsListCall) SslRequired(sslRequired bool) *AdsListCall { + c.opt_["sslRequired"] = sslRequired + return c +} + +// Type sets the optional parameter "type": Select only ads with these +// types. +// +// Possible values: +// "AD_SERVING_CLICK_TRACKER" +// "AD_SERVING_DEFAULT_AD" +// "AD_SERVING_STANDARD_AD" +// "AD_SERVING_TRACKING" +func (c *AdsListCall) Type(type_ string) *AdsListCall { + c.opt_["type"] = type_ + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdsListCall) Fields(s ...googleapi.Field) *AdsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdsListCall) IfNoneMatch(entityTag string) *AdsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdsListCall) Context(ctx context.Context) *AdsListCall { + c.ctx_ = ctx + return c +} + +func (c *AdsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["active"]; ok { + params.Set("active", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["advertiserId"]; ok { + params.Set("advertiserId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["archived"]; ok { + params.Set("archived", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["audienceSegmentIds"]; ok { + params.Set("audienceSegmentIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["campaignIds"]; ok { + params.Set("campaignIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["compatibility"]; ok { + params.Set("compatibility", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["creativeIds"]; ok { + params.Set("creativeIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["creativeOptimizationConfigurationIds"]; ok { + params.Set("creativeOptimizationConfigurationIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["creativeType"]; ok { + params.Set("creativeType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["dynamicClickTracker"]; ok { + params.Set("dynamicClickTracker", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["landingPageIds"]; ok { + params.Set("landingPageIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["overriddenEventTagId"]; ok { + params.Set("overriddenEventTagId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["placementIds"]; ok { + params.Set("placementIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["remarketingListIds"]; ok { + params.Set("remarketingListIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sizeIds"]; ok { + params.Set("sizeIds", 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)) + } + if v, ok := c.opt_["sslCompliant"]; ok { + params.Set("sslCompliant", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sslRequired"]; ok { + params.Set("sslRequired", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["type"]; ok { + params.Set("type", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.ads.list" call. +// Exactly one of *AdsListResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AdsListResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AdsListCall) Do() (*AdsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of ads, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.ads.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "active": { + // "description": "Select only active ads.", + // "location": "query", + // "type": "boolean" + // }, + // "advertiserId": { + // "description": "Select only ads with this advertiser ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "archived": { + // "description": "Select only archived ads.", + // "location": "query", + // "type": "boolean" + // }, + // "audienceSegmentIds": { + // "description": "Select only ads with these audience segment IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "campaignIds": { + // "description": "Select only ads with these campaign IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "compatibility": { + // "description": "Select default ads with the specified compatibility. Applicable when type is AD_SERVING_DEFAULT_AD. WEB and WEB_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering an in-stream video ads developed with the VAST standard.", + // "enum": [ + // "APP", + // "APP_INTERSTITIAL", + // "IN_STREAM_VIDEO", + // "WEB", + // "WEB_INTERSTITIAL" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "creativeIds": { + // "description": "Select only ads with these creative IDs assigned.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "creativeOptimizationConfigurationIds": { + // "description": "Select only ads with these creative optimization configuration IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "creativeType": { + // "description": "Select only ads with the specified creativeType.", + // "enum": [ + // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO", + // "CUSTOM_INPAGE", + // "CUSTOM_INTERSTITIAL", + // "ENHANCED_BANNER", + // "ENHANCED_IMAGE", + // "FLASH_INPAGE", + // "HTML5_BANNER", + // "IMAGE", + // "INSTREAM_VIDEO", + // "INTERNAL_REDIRECT", + // "INTERSTITIAL_INTERNAL_REDIRECT", + // "REDIRECT", + // "RICH_MEDIA_EXPANDING", + // "RICH_MEDIA_IM_EXPAND", + // "RICH_MEDIA_INPAGE", + // "RICH_MEDIA_INPAGE_FLOATING", + // "RICH_MEDIA_INTERSTITIAL_FLOAT", + // "RICH_MEDIA_MOBILE_IN_APP", + // "RICH_MEDIA_MULTI_FLOATING", + // "RICH_MEDIA_PEEL_DOWN", + // "TRACKING_TEXT", + // "VAST_REDIRECT", + // "VPAID_LINEAR", + // "VPAID_NON_LINEAR" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "dynamicClickTracker": { + // "description": "Select only dynamic click trackers. Applicable when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click trackers. If false, select static click trackers. Leave unset to select both.", + // "location": "query", + // "type": "boolean" + // }, + // "ids": { + // "description": "Select only ads with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "landingPageIds": { + // "description": "Select only ads with these landing page IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "overriddenEventTagId": { + // "description": "Select only ads with this event tag override ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "placementIds": { + // "description": "Select only ads with these placement IDs assigned.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "remarketingListIds": { + // "description": "Select only ads whose list targeting expression use these remarketing list IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"ad*2015\" will return objects with names like \"ad June 2015\", \"ad April 2015\", or simply \"ad 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"ad\" will match objects with name \"my ad\", \"ad 2015\", or simply \"ad\".", + // "location": "query", + // "type": "string" + // }, + // "sizeIds": { + // "description": "Select only ads with these size IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sslCompliant": { + // "description": "Select only ads that are SSL-compliant.", + // "location": "query", + // "type": "boolean" + // }, + // "sslRequired": { + // "description": "Select only ads that require SSL.", + // "location": "query", + // "type": "boolean" + // }, + // "type": { + // "description": "Select only ads with these types.", + // "enum": [ + // "AD_SERVING_CLICK_TRACKER", + // "AD_SERVING_DEFAULT_AD", + // "AD_SERVING_STANDARD_AD", + // "AD_SERVING_TRACKING" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/ads", + // "response": { + // "$ref": "AdsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.ads.patch": + +type AdsPatchCall struct { + s *Service + profileId int64 + id int64 + ad *Ad + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing ad. This method supports patch semantics. +func (r *AdsService) Patch(profileId int64, id int64, ad *Ad) *AdsPatchCall { + c := &AdsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.ad = ad + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdsPatchCall) Fields(s ...googleapi.Field) *AdsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdsPatchCall) Context(ctx context.Context) *AdsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AdsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.ads.patch" call. +// Exactly one of *Ad or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either *Ad.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AdsPatchCall) Do() (*Ad, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Ad{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing ad. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.ads.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Ad ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/ads", + // "request": { + // "$ref": "Ad" + // }, + // "response": { + // "$ref": "Ad" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.ads.update": + +type AdsUpdateCall struct { + s *Service + profileId int64 + ad *Ad + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing ad. +func (r *AdsService) Update(profileId int64, ad *Ad) *AdsUpdateCall { + c := &AdsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.ad = ad + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdsUpdateCall) Fields(s ...googleapi.Field) *AdsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdsUpdateCall) Context(ctx context.Context) *AdsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AdsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.ads.update" call. +// Exactly one of *Ad or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either *Ad.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AdsUpdateCall) Do() (*Ad, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Ad{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing ad.", + // "httpMethod": "PUT", + // "id": "dfareporting.ads.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/ads", + // "request": { + // "$ref": "Ad" + // }, + // "response": { + // "$ref": "Ad" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertiserGroups.delete": + +type AdvertiserGroupsDeleteCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing advertiser group. +func (r *AdvertiserGroupsService) Delete(profileId int64, id int64) *AdvertiserGroupsDeleteCall { + c := &AdvertiserGroupsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertiserGroupsDeleteCall) Fields(s ...googleapi.Field) *AdvertiserGroupsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertiserGroupsDeleteCall) Context(ctx context.Context) *AdvertiserGroupsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertiserGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertiserGroups.delete" call. +func (c *AdvertiserGroupsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing advertiser group.", + // "httpMethod": "DELETE", + // "id": "dfareporting.advertiserGroups.delete", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Advertiser group ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertiserGroups/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertiserGroups.get": + +type AdvertiserGroupsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one advertiser group by ID. +func (r *AdvertiserGroupsService) Get(profileId int64, id int64) *AdvertiserGroupsGetCall { + c := &AdvertiserGroupsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertiserGroupsGetCall) Fields(s ...googleapi.Field) *AdvertiserGroupsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdvertiserGroupsGetCall) IfNoneMatch(entityTag string) *AdvertiserGroupsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertiserGroupsGetCall) Context(ctx context.Context) *AdvertiserGroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertiserGroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertiserGroups.get" call. +// Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AdvertiserGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AdvertiserGroupsGetCall) Do() (*AdvertiserGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdvertiserGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one advertiser group by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.advertiserGroups.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Advertiser group ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertiserGroups/{id}", + // "response": { + // "$ref": "AdvertiserGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertiserGroups.insert": + +type AdvertiserGroupsInsertCall struct { + s *Service + profileId int64 + advertisergroup *AdvertiserGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new advertiser group. +func (r *AdvertiserGroupsService) Insert(profileId int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsInsertCall { + c := &AdvertiserGroupsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.advertisergroup = advertisergroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertiserGroupsInsertCall) Fields(s ...googleapi.Field) *AdvertiserGroupsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertiserGroupsInsertCall) Context(ctx context.Context) *AdvertiserGroupsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertiserGroupsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertiserGroups.insert" call. +// Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AdvertiserGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AdvertiserGroupsInsertCall) Do() (*AdvertiserGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdvertiserGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new advertiser group.", + // "httpMethod": "POST", + // "id": "dfareporting.advertiserGroups.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertiserGroups", + // "request": { + // "$ref": "AdvertiserGroup" + // }, + // "response": { + // "$ref": "AdvertiserGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertiserGroups.list": + +type AdvertiserGroupsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of advertiser groups, possibly filtered. +func (r *AdvertiserGroupsService) List(profileId int64) *AdvertiserGroupsListCall { + c := &AdvertiserGroupsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Ids sets the optional parameter "ids": Select only advertiser groups +// with these IDs. +func (c *AdvertiserGroupsListCall) Ids(ids int64) *AdvertiserGroupsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *AdvertiserGroupsListCall) MaxResults(maxResults int64) *AdvertiserGroupsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *AdvertiserGroupsListCall) PageToken(pageToken string) *AdvertiserGroupsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "advertiser*2015" will return objects with names like +// "advertiser group June 2015", "advertiser group April 2015", or +// simply "advertiser group 2015". Most of the searches also add +// wildcards implicitly at the start and the end of the search string. +// For example, a search string of "advertisergroup" will match objects +// with name "my advertisergroup", "advertisergroup 2015", or simply +// "advertisergroup". +func (c *AdvertiserGroupsListCall) SearchString(searchString string) *AdvertiserGroupsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *AdvertiserGroupsListCall) SortField(sortField string) *AdvertiserGroupsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *AdvertiserGroupsListCall) SortOrder(sortOrder string) *AdvertiserGroupsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertiserGroupsListCall) Fields(s ...googleapi.Field) *AdvertiserGroupsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdvertiserGroupsListCall) IfNoneMatch(entityTag string) *AdvertiserGroupsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertiserGroupsListCall) Context(ctx context.Context) *AdvertiserGroupsListCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertiserGroupsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertiserGroups.list" call. +// Exactly one of *AdvertiserGroupsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AdvertiserGroupsListResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AdvertiserGroupsListCall) Do() (*AdvertiserGroupsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdvertiserGroupsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of advertiser groups, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.advertiserGroups.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "ids": { + // "description": "Select only advertiser groups with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"advertiser*2015\" will return objects with names like \"advertiser group June 2015\", \"advertiser group April 2015\", or simply \"advertiser group 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"advertisergroup\" will match objects with name \"my advertisergroup\", \"advertisergroup 2015\", or simply \"advertisergroup\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertiserGroups", + // "response": { + // "$ref": "AdvertiserGroupsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertiserGroups.patch": + +type AdvertiserGroupsPatchCall struct { + s *Service + profileId int64 + id int64 + advertisergroup *AdvertiserGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing advertiser group. This method supports +// patch semantics. +func (r *AdvertiserGroupsService) Patch(profileId int64, id int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsPatchCall { + c := &AdvertiserGroupsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.advertisergroup = advertisergroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertiserGroupsPatchCall) Fields(s ...googleapi.Field) *AdvertiserGroupsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertiserGroupsPatchCall) Context(ctx context.Context) *AdvertiserGroupsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertiserGroupsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertiserGroups.patch" call. +// Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AdvertiserGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AdvertiserGroupsPatchCall) Do() (*AdvertiserGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdvertiserGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing advertiser group. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.advertiserGroups.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Advertiser group ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertiserGroups", + // "request": { + // "$ref": "AdvertiserGroup" + // }, + // "response": { + // "$ref": "AdvertiserGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertiserGroups.update": + +type AdvertiserGroupsUpdateCall struct { + s *Service + profileId int64 + advertisergroup *AdvertiserGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing advertiser group. +func (r *AdvertiserGroupsService) Update(profileId int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsUpdateCall { + c := &AdvertiserGroupsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.advertisergroup = advertisergroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertiserGroupsUpdateCall) Fields(s ...googleapi.Field) *AdvertiserGroupsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertiserGroupsUpdateCall) Context(ctx context.Context) *AdvertiserGroupsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertiserGroupsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertiserGroups.update" call. +// Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AdvertiserGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AdvertiserGroupsUpdateCall) Do() (*AdvertiserGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdvertiserGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing advertiser group.", + // "httpMethod": "PUT", + // "id": "dfareporting.advertiserGroups.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertiserGroups", + // "request": { + // "$ref": "AdvertiserGroup" + // }, + // "response": { + // "$ref": "AdvertiserGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertisers.get": + +type AdvertisersGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one advertiser by ID. +func (r *AdvertisersService) Get(profileId int64, id int64) *AdvertisersGetCall { + c := &AdvertisersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertisersGetCall) Fields(s ...googleapi.Field) *AdvertisersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdvertisersGetCall) IfNoneMatch(entityTag string) *AdvertisersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertisersGetCall) Context(ctx context.Context) *AdvertisersGetCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertisersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertisers.get" call. +// Exactly one of *Advertiser or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Advertiser.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AdvertisersGetCall) Do() (*Advertiser, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Advertiser{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one advertiser by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.advertisers.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Advertiser ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertisers/{id}", + // "response": { + // "$ref": "Advertiser" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertisers.insert": + +type AdvertisersInsertCall struct { + s *Service + profileId int64 + advertiser *Advertiser + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new advertiser. +func (r *AdvertisersService) Insert(profileId int64, advertiser *Advertiser) *AdvertisersInsertCall { + c := &AdvertisersInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.advertiser = advertiser + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertisersInsertCall) Fields(s ...googleapi.Field) *AdvertisersInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertisersInsertCall) Context(ctx context.Context) *AdvertisersInsertCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertisersInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertisers.insert" call. +// Exactly one of *Advertiser or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Advertiser.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AdvertisersInsertCall) Do() (*Advertiser, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Advertiser{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new advertiser.", + // "httpMethod": "POST", + // "id": "dfareporting.advertisers.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertisers", + // "request": { + // "$ref": "Advertiser" + // }, + // "response": { + // "$ref": "Advertiser" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertisers.list": + +type AdvertisersListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of advertisers, possibly filtered. +func (r *AdvertisersService) List(profileId int64) *AdvertisersListCall { + c := &AdvertisersListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdvertiserGroupIds sets the optional parameter "advertiserGroupIds": +// Select only advertisers with these advertiser group IDs. +func (c *AdvertisersListCall) AdvertiserGroupIds(advertiserGroupIds int64) *AdvertisersListCall { + c.opt_["advertiserGroupIds"] = advertiserGroupIds + return c +} + +// FloodlightConfigurationIds sets the optional parameter +// "floodlightConfigurationIds": Select only advertisers with these +// floodlight configuration IDs. +func (c *AdvertisersListCall) FloodlightConfigurationIds(floodlightConfigurationIds int64) *AdvertisersListCall { + c.opt_["floodlightConfigurationIds"] = floodlightConfigurationIds + return c +} + +// Ids sets the optional parameter "ids": Select only advertisers with +// these IDs. +func (c *AdvertisersListCall) Ids(ids int64) *AdvertisersListCall { + c.opt_["ids"] = ids + return c +} + +// IncludeAdvertisersWithoutGroupsOnly sets the optional parameter +// "includeAdvertisersWithoutGroupsOnly": Select only advertisers which +// do not belong to any advertiser group. +func (c *AdvertisersListCall) IncludeAdvertisersWithoutGroupsOnly(includeAdvertisersWithoutGroupsOnly bool) *AdvertisersListCall { + c.opt_["includeAdvertisersWithoutGroupsOnly"] = includeAdvertisersWithoutGroupsOnly + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *AdvertisersListCall) MaxResults(maxResults int64) *AdvertisersListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OnlyParent sets the optional parameter "onlyParent": Select only +// advertisers which use another advertiser's floodlight configuration. +func (c *AdvertisersListCall) OnlyParent(onlyParent bool) *AdvertisersListCall { + c.opt_["onlyParent"] = onlyParent + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *AdvertisersListCall) PageToken(pageToken string) *AdvertisersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "advertiser*2015" will return objects with names like +// "advertiser June 2015", "advertiser April 2015", or simply +// "advertiser 2015". Most of the searches also add wildcards implicitly +// at the start and the end of the search string. For example, a search +// string of "advertiser" will match objects with name "my advertiser", +// "advertiser 2015", or simply "advertiser". +func (c *AdvertisersListCall) SearchString(searchString string) *AdvertisersListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *AdvertisersListCall) SortField(sortField string) *AdvertisersListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *AdvertisersListCall) SortOrder(sortOrder string) *AdvertisersListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Status sets the optional parameter "status": Select only advertisers +// with the specified status. +// +// Possible values: +// "APPROVED" +// "ON_HOLD" +func (c *AdvertisersListCall) Status(status string) *AdvertisersListCall { + c.opt_["status"] = status + return c +} + +// SubaccountId sets the optional parameter "subaccountId": Select only +// advertisers with these subaccount IDs. +func (c *AdvertisersListCall) SubaccountId(subaccountId int64) *AdvertisersListCall { + c.opt_["subaccountId"] = subaccountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertisersListCall) Fields(s ...googleapi.Field) *AdvertisersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdvertisersListCall) IfNoneMatch(entityTag string) *AdvertisersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertisersListCall) Context(ctx context.Context) *AdvertisersListCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertisersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserGroupIds"]; ok { + params.Set("advertiserGroupIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["floodlightConfigurationIds"]; ok { + params.Set("floodlightConfigurationIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["includeAdvertisersWithoutGroupsOnly"]; ok { + params.Set("includeAdvertisersWithoutGroupsOnly", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["onlyParent"]; ok { + params.Set("onlyParent", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["status"]; ok { + params.Set("status", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["subaccountId"]; ok { + params.Set("subaccountId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertisers.list" call. +// Exactly one of *AdvertisersListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AdvertisersListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AdvertisersListCall) Do() (*AdvertisersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdvertisersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of advertisers, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.advertisers.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "advertiserGroupIds": { + // "description": "Select only advertisers with these advertiser group IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "floodlightConfigurationIds": { + // "description": "Select only advertisers with these floodlight configuration IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only advertisers with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "includeAdvertisersWithoutGroupsOnly": { + // "description": "Select only advertisers which do not belong to any advertiser group.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "onlyParent": { + // "description": "Select only advertisers which use another advertiser's floodlight configuration.", + // "location": "query", + // "type": "boolean" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"advertiser*2015\" will return objects with names like \"advertiser June 2015\", \"advertiser April 2015\", or simply \"advertiser 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"advertiser\" will match objects with name \"my advertiser\", \"advertiser 2015\", or simply \"advertiser\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "status": { + // "description": "Select only advertisers with the specified status.", + // "enum": [ + // "APPROVED", + // "ON_HOLD" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "subaccountId": { + // "description": "Select only advertisers with these subaccount IDs.", + // "format": "int64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertisers", + // "response": { + // "$ref": "AdvertisersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertisers.patch": + +type AdvertisersPatchCall struct { + s *Service + profileId int64 + id int64 + advertiser *Advertiser + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing advertiser. This method supports patch +// semantics. +func (r *AdvertisersService) Patch(profileId int64, id int64, advertiser *Advertiser) *AdvertisersPatchCall { + c := &AdvertisersPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.advertiser = advertiser + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertisersPatchCall) Fields(s ...googleapi.Field) *AdvertisersPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertisersPatchCall) Context(ctx context.Context) *AdvertisersPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertisersPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertisers.patch" call. +// Exactly one of *Advertiser or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Advertiser.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AdvertisersPatchCall) Do() (*Advertiser, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Advertiser{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing advertiser. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.advertisers.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Advertiser ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertisers", + // "request": { + // "$ref": "Advertiser" + // }, + // "response": { + // "$ref": "Advertiser" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertisers.update": + +type AdvertisersUpdateCall struct { + s *Service + profileId int64 + advertiser *Advertiser + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing advertiser. +func (r *AdvertisersService) Update(profileId int64, advertiser *Advertiser) *AdvertisersUpdateCall { + c := &AdvertisersUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.advertiser = advertiser + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertisersUpdateCall) Fields(s ...googleapi.Field) *AdvertisersUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertisersUpdateCall) Context(ctx context.Context) *AdvertisersUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertisersUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertisers.update" call. +// Exactly one of *Advertiser or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Advertiser.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AdvertisersUpdateCall) Do() (*Advertiser, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Advertiser{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing advertiser.", + // "httpMethod": "PUT", + // "id": "dfareporting.advertisers.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertisers", + // "request": { + // "$ref": "Advertiser" + // }, + // "response": { + // "$ref": "Advertiser" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.browsers.list": + +type BrowsersListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of browsers. +func (r *BrowsersService) List(profileId int64) *BrowsersListCall { + c := &BrowsersListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BrowsersListCall) Fields(s ...googleapi.Field) *BrowsersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BrowsersListCall) IfNoneMatch(entityTag string) *BrowsersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BrowsersListCall) Context(ctx context.Context) *BrowsersListCall { + c.ctx_ = ctx + return c +} + +func (c *BrowsersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/browsers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.browsers.list" call. +// Exactly one of *BrowsersListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BrowsersListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BrowsersListCall) Do() (*BrowsersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BrowsersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of browsers.", + // "httpMethod": "GET", + // "id": "dfareporting.browsers.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/browsers", + // "response": { + // "$ref": "BrowsersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.campaignCreativeAssociations.insert": + +type CampaignCreativeAssociationsInsertCall struct { + s *Service + profileId int64 + campaignId int64 + campaigncreativeassociation *CampaignCreativeAssociation + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Associates a creative with the specified campaign. This +// method creates a default ad with dimensions matching the creative in +// the campaign if such a default ad does not exist already. +func (r *CampaignCreativeAssociationsService) Insert(profileId int64, campaignId int64, campaigncreativeassociation *CampaignCreativeAssociation) *CampaignCreativeAssociationsInsertCall { + c := &CampaignCreativeAssociationsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaignId = campaignId + c.campaigncreativeassociation = campaigncreativeassociation + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CampaignCreativeAssociationsInsertCall) Fields(s ...googleapi.Field) *CampaignCreativeAssociationsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CampaignCreativeAssociationsInsertCall) Context(ctx context.Context) *CampaignCreativeAssociationsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CampaignCreativeAssociationsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaigncreativeassociation) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "campaignId": strconv.FormatInt(c.campaignId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.campaignCreativeAssociations.insert" call. +// Exactly one of *CampaignCreativeAssociation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *CampaignCreativeAssociation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CampaignCreativeAssociationsInsertCall) Do() (*CampaignCreativeAssociation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CampaignCreativeAssociation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Associates a creative with the specified campaign. This method creates a default ad with dimensions matching the creative in the campaign if such a default ad does not exist already.", + // "httpMethod": "POST", + // "id": "dfareporting.campaignCreativeAssociations.insert", + // "parameterOrder": [ + // "profileId", + // "campaignId" + // ], + // "parameters": { + // "campaignId": { + // "description": "Campaign ID in this association.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations", + // "request": { + // "$ref": "CampaignCreativeAssociation" + // }, + // "response": { + // "$ref": "CampaignCreativeAssociation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.campaignCreativeAssociations.list": + +type CampaignCreativeAssociationsListCall struct { + s *Service + profileId int64 + campaignId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of creative IDs associated with the +// specified campaign. +func (r *CampaignCreativeAssociationsService) List(profileId int64, campaignId int64) *CampaignCreativeAssociationsListCall { + c := &CampaignCreativeAssociationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaignId = campaignId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *CampaignCreativeAssociationsListCall) MaxResults(maxResults int64) *CampaignCreativeAssociationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *CampaignCreativeAssociationsListCall) PageToken(pageToken string) *CampaignCreativeAssociationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *CampaignCreativeAssociationsListCall) SortOrder(sortOrder string) *CampaignCreativeAssociationsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CampaignCreativeAssociationsListCall) Fields(s ...googleapi.Field) *CampaignCreativeAssociationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CampaignCreativeAssociationsListCall) IfNoneMatch(entityTag string) *CampaignCreativeAssociationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CampaignCreativeAssociationsListCall) Context(ctx context.Context) *CampaignCreativeAssociationsListCall { + c.ctx_ = ctx + return c +} + +func (c *CampaignCreativeAssociationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "campaignId": strconv.FormatInt(c.campaignId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.campaignCreativeAssociations.list" call. +// Exactly one of *CampaignCreativeAssociationsListResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *CampaignCreativeAssociationsListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *CampaignCreativeAssociationsListCall) Do() (*CampaignCreativeAssociationsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CampaignCreativeAssociationsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of creative IDs associated with the specified campaign.", + // "httpMethod": "GET", + // "id": "dfareporting.campaignCreativeAssociations.list", + // "parameterOrder": [ + // "profileId", + // "campaignId" + // ], + // "parameters": { + // "campaignId": { + // "description": "Campaign ID in this association.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations", + // "response": { + // "$ref": "CampaignCreativeAssociationsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.campaigns.get": + +type CampaignsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one campaign by ID. +func (r *CampaignsService) Get(profileId int64, id int64) *CampaignsGetCall { + c := &CampaignsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CampaignsGetCall) Fields(s ...googleapi.Field) *CampaignsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CampaignsGetCall) IfNoneMatch(entityTag string) *CampaignsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CampaignsGetCall) Context(ctx context.Context) *CampaignsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CampaignsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.campaigns.get" call. +// Exactly one of *Campaign or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Campaign.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CampaignsGetCall) Do() (*Campaign, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Campaign{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one campaign by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.campaigns.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Campaign ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{id}", + // "response": { + // "$ref": "Campaign" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.campaigns.insert": + +type CampaignsInsertCall struct { + s *Service + profileId int64 + defaultLandingPageName string + defaultLandingPageUrl string + campaign *Campaign + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new campaign. +func (r *CampaignsService) Insert(profileId int64, defaultLandingPageName string, defaultLandingPageUrl string, campaign *Campaign) *CampaignsInsertCall { + c := &CampaignsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.defaultLandingPageName = defaultLandingPageName + c.defaultLandingPageUrl = defaultLandingPageUrl + c.campaign = campaign + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CampaignsInsertCall) Fields(s ...googleapi.Field) *CampaignsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CampaignsInsertCall) Context(ctx context.Context) *CampaignsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CampaignsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("defaultLandingPageName", fmt.Sprintf("%v", c.defaultLandingPageName)) + params.Set("defaultLandingPageUrl", fmt.Sprintf("%v", c.defaultLandingPageUrl)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.campaigns.insert" call. +// Exactly one of *Campaign or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Campaign.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CampaignsInsertCall) Do() (*Campaign, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Campaign{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new campaign.", + // "httpMethod": "POST", + // "id": "dfareporting.campaigns.insert", + // "parameterOrder": [ + // "profileId", + // "defaultLandingPageName", + // "defaultLandingPageUrl" + // ], + // "parameters": { + // "defaultLandingPageName": { + // "description": "Default landing page name for this new campaign. Must be less than 256 characters long.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "defaultLandingPageUrl": { + // "description": "Default landing page URL for this new campaign.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns", + // "request": { + // "$ref": "Campaign" + // }, + // "response": { + // "$ref": "Campaign" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.campaigns.list": + +type CampaignsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of campaigns, possibly filtered. +func (r *CampaignsService) List(profileId int64) *CampaignsListCall { + c := &CampaignsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdvertiserGroupIds sets the optional parameter "advertiserGroupIds": +// Select only campaigns whose advertisers belong to these advertiser +// groups. +func (c *CampaignsListCall) AdvertiserGroupIds(advertiserGroupIds int64) *CampaignsListCall { + c.opt_["advertiserGroupIds"] = advertiserGroupIds + return c +} + +// AdvertiserIds sets the optional parameter "advertiserIds": Select +// only campaigns that belong to these advertisers. +func (c *CampaignsListCall) AdvertiserIds(advertiserIds int64) *CampaignsListCall { + c.opt_["advertiserIds"] = advertiserIds + return c +} + +// Archived sets the optional parameter "archived": Select only archived +// campaigns. Don't set this field to select both archived and +// non-archived campaigns. +func (c *CampaignsListCall) Archived(archived bool) *CampaignsListCall { + c.opt_["archived"] = archived + return c +} + +// AtLeastOneOptimizationActivity sets the optional parameter +// "atLeastOneOptimizationActivity": Select only campaigns that have at +// least one optimization activity. +func (c *CampaignsListCall) AtLeastOneOptimizationActivity(atLeastOneOptimizationActivity bool) *CampaignsListCall { + c.opt_["atLeastOneOptimizationActivity"] = atLeastOneOptimizationActivity + return c +} + +// ExcludedIds sets the optional parameter "excludedIds": Exclude +// campaigns with these IDs. +func (c *CampaignsListCall) ExcludedIds(excludedIds int64) *CampaignsListCall { + c.opt_["excludedIds"] = excludedIds + return c +} + +// Ids sets the optional parameter "ids": Select only campaigns with +// these IDs. +func (c *CampaignsListCall) Ids(ids int64) *CampaignsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *CampaignsListCall) MaxResults(maxResults int64) *CampaignsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OverriddenEventTagId sets the optional parameter +// "overriddenEventTagId": Select only campaigns that have overridden +// this event tag ID. +func (c *CampaignsListCall) OverriddenEventTagId(overriddenEventTagId int64) *CampaignsListCall { + c.opt_["overriddenEventTagId"] = overriddenEventTagId + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *CampaignsListCall) PageToken(pageToken string) *CampaignsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for campaigns by name or ID. Wildcards (*) are allowed. For +// example, "campaign*2015" will return campaigns with names like +// "campaign June 2015", "campaign April 2015", or simply "campaign +// 2015". Most of the searches also add wildcards implicitly at the +// start and the end of the search string. For example, a search string +// of "campaign" will match campaigns with name "my campaign", "campaign +// 2015", or simply "campaign". +func (c *CampaignsListCall) SearchString(searchString string) *CampaignsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *CampaignsListCall) SortField(sortField string) *CampaignsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *CampaignsListCall) SortOrder(sortOrder string) *CampaignsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// SubaccountId sets the optional parameter "subaccountId": Select only +// campaigns that belong to this subaccount. +func (c *CampaignsListCall) SubaccountId(subaccountId int64) *CampaignsListCall { + c.opt_["subaccountId"] = subaccountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CampaignsListCall) Fields(s ...googleapi.Field) *CampaignsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CampaignsListCall) IfNoneMatch(entityTag string) *CampaignsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CampaignsListCall) Context(ctx context.Context) *CampaignsListCall { + c.ctx_ = ctx + return c +} + +func (c *CampaignsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserGroupIds"]; ok { + params.Set("advertiserGroupIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["advertiserIds"]; ok { + params.Set("advertiserIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["archived"]; ok { + params.Set("archived", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["atLeastOneOptimizationActivity"]; ok { + params.Set("atLeastOneOptimizationActivity", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["excludedIds"]; ok { + params.Set("excludedIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["overriddenEventTagId"]; ok { + params.Set("overriddenEventTagId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["subaccountId"]; ok { + params.Set("subaccountId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.campaigns.list" call. +// Exactly one of *CampaignsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CampaignsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CampaignsListCall) Do() (*CampaignsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CampaignsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of campaigns, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.campaigns.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "advertiserGroupIds": { + // "description": "Select only campaigns whose advertisers belong to these advertiser groups.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "advertiserIds": { + // "description": "Select only campaigns that belong to these advertisers.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "archived": { + // "description": "Select only archived campaigns. Don't set this field to select both archived and non-archived campaigns.", + // "location": "query", + // "type": "boolean" + // }, + // "atLeastOneOptimizationActivity": { + // "description": "Select only campaigns that have at least one optimization activity.", + // "location": "query", + // "type": "boolean" + // }, + // "excludedIds": { + // "description": "Exclude campaigns with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only campaigns with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "overriddenEventTagId": { + // "description": "Select only campaigns that have overridden this event tag ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for campaigns by name or ID. Wildcards (*) are allowed. For example, \"campaign*2015\" will return campaigns with names like \"campaign June 2015\", \"campaign April 2015\", or simply \"campaign 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"campaign\" will match campaigns with name \"my campaign\", \"campaign 2015\", or simply \"campaign\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "subaccountId": { + // "description": "Select only campaigns that belong to this subaccount.", + // "format": "int64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns", + // "response": { + // "$ref": "CampaignsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.campaigns.patch": + +type CampaignsPatchCall struct { + s *Service + profileId int64 + id int64 + campaign *Campaign + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing campaign. This method supports patch +// semantics. +func (r *CampaignsService) Patch(profileId int64, id int64, campaign *Campaign) *CampaignsPatchCall { + c := &CampaignsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.campaign = campaign + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CampaignsPatchCall) Fields(s ...googleapi.Field) *CampaignsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CampaignsPatchCall) Context(ctx context.Context) *CampaignsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CampaignsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.campaigns.patch" call. +// Exactly one of *Campaign or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Campaign.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CampaignsPatchCall) Do() (*Campaign, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Campaign{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing campaign. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.campaigns.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Campaign ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns", + // "request": { + // "$ref": "Campaign" + // }, + // "response": { + // "$ref": "Campaign" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.campaigns.update": + +type CampaignsUpdateCall struct { + s *Service + profileId int64 + campaign *Campaign + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing campaign. +func (r *CampaignsService) Update(profileId int64, campaign *Campaign) *CampaignsUpdateCall { + c := &CampaignsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaign = campaign + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CampaignsUpdateCall) Fields(s ...googleapi.Field) *CampaignsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CampaignsUpdateCall) Context(ctx context.Context) *CampaignsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CampaignsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.campaigns.update" call. +// Exactly one of *Campaign or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Campaign.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CampaignsUpdateCall) Do() (*Campaign, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Campaign{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing campaign.", + // "httpMethod": "PUT", + // "id": "dfareporting.campaigns.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns", + // "request": { + // "$ref": "Campaign" + // }, + // "response": { + // "$ref": "Campaign" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.changeLogs.get": + +type ChangeLogsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one change log by ID. +func (r *ChangeLogsService) Get(profileId int64, id int64) *ChangeLogsGetCall { + c := &ChangeLogsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChangeLogsGetCall) Fields(s ...googleapi.Field) *ChangeLogsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ChangeLogsGetCall) IfNoneMatch(entityTag string) *ChangeLogsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChangeLogsGetCall) Context(ctx context.Context) *ChangeLogsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ChangeLogsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/changeLogs/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.changeLogs.get" call. +// Exactly one of *ChangeLog or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ChangeLog.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ChangeLogsGetCall) Do() (*ChangeLog, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ChangeLog{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one change log by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.changeLogs.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Change log ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/changeLogs/{id}", + // "response": { + // "$ref": "ChangeLog" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.changeLogs.list": + +type ChangeLogsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of change logs. +func (r *ChangeLogsService) List(profileId int64) *ChangeLogsListCall { + c := &ChangeLogsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Action sets the optional parameter "action": Select only change logs +// with the specified action. +// +// Possible values: +// "ACTION_ADD" +// "ACTION_ASSIGN" +// "ACTION_ASSOCIATE" +// "ACTION_CREATE" +// "ACTION_DELETE" +// "ACTION_DISABLE" +// "ACTION_EMAIL_TAGS" +// "ACTION_ENABLE" +// "ACTION_LINK" +// "ACTION_MARK_AS_DEFAULT" +// "ACTION_PUSH" +// "ACTION_REMOVE" +// "ACTION_SEND" +// "ACTION_SHARE" +// "ACTION_UNASSIGN" +// "ACTION_UNLINK" +// "ACTION_UPDATE" +func (c *ChangeLogsListCall) Action(action string) *ChangeLogsListCall { + c.opt_["action"] = action + return c +} + +// Ids sets the optional parameter "ids": Select only change logs with +// these IDs. +func (c *ChangeLogsListCall) Ids(ids int64) *ChangeLogsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxChangeTime sets the optional parameter "maxChangeTime": Select +// only change logs whose change time is before the specified +// maxChangeTime.The time should be formatted as an RFC3339 date/time +// string. For example, for 10:54 PM on July 18th, 2015, in the +// America/New York time zone, the format is +// "2015-07-18T22:54:00-04:00". In other words, the year, month, day, +// the letter T, the hour (24-hour clock system), minute, second, and +// then the time zone offset. +func (c *ChangeLogsListCall) MaxChangeTime(maxChangeTime string) *ChangeLogsListCall { + c.opt_["maxChangeTime"] = maxChangeTime + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *ChangeLogsListCall) MaxResults(maxResults int64) *ChangeLogsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// MinChangeTime sets the optional parameter "minChangeTime": Select +// only change logs whose change time is before the specified +// minChangeTime.The time should be formatted as an RFC3339 date/time +// string. For example, for 10:54 PM on July 18th, 2015, in the +// America/New York time zone, the format is +// "2015-07-18T22:54:00-04:00". In other words, the year, month, day, +// the letter T, the hour (24-hour clock system), minute, second, and +// then the time zone offset. +func (c *ChangeLogsListCall) MinChangeTime(minChangeTime string) *ChangeLogsListCall { + c.opt_["minChangeTime"] = minChangeTime + return c +} + +// ObjectIds sets the optional parameter "objectIds": Select only change +// logs with these object IDs. +func (c *ChangeLogsListCall) ObjectIds(objectIds int64) *ChangeLogsListCall { + c.opt_["objectIds"] = objectIds + return c +} + +// ObjectType sets the optional parameter "objectType": Select only +// change logs with the specified object type. +// +// Possible values: +// "OBJECT_ACCOUNT" +// "OBJECT_ACCOUNT_BILLING_FEATURE" +// "OBJECT_AD" +// "OBJECT_ADVERTISER" +// "OBJECT_ADVERTISER_GROUP" +// "OBJECT_BILLING_ACCOUNT_GROUP" +// "OBJECT_BILLING_FEATURE" +// "OBJECT_BILLING_MINIMUM_FEE" +// "OBJECT_BILLING_PROFILE" +// "OBJECT_CAMPAIGN" +// "OBJECT_CONTENT_CATEGORY" +// "OBJECT_CREATIVE" +// "OBJECT_CREATIVE_ASSET" +// "OBJECT_CREATIVE_BUNDLE" +// "OBJECT_CREATIVE_FIELD" +// "OBJECT_CREATIVE_GROUP" +// "OBJECT_DFA_SITE" +// "OBJECT_EVENT_TAG" +// "OBJECT_FLOODLIGHT_ACTIVITY_GROUP" +// "OBJECT_FLOODLIGHT_ACTVITY" +// "OBJECT_FLOODLIGHT_CONFIGURATION" +// "OBJECT_INSTREAM_CREATIVE" +// "OBJECT_LANDING_PAGE" +// "OBJECT_MEDIA_ORDER" +// "OBJECT_PLACEMENT" +// "OBJECT_PLACEMENT_STRATEGY" +// "OBJECT_PROVIDED_LIST_CLIENT" +// "OBJECT_RATE_CARD" +// "OBJECT_REMARKETING_LIST" +// "OBJECT_RICHMEDIA_CREATIVE" +// "OBJECT_SD_SITE" +// "OBJECT_SIZE" +// "OBJECT_SUBACCOUNT" +// "OBJECT_USER_PROFILE" +// "OBJECT_USER_PROFILE_FILTER" +// "OBJECT_USER_ROLE" +func (c *ChangeLogsListCall) ObjectType(objectType string) *ChangeLogsListCall { + c.opt_["objectType"] = objectType + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *ChangeLogsListCall) PageToken(pageToken string) *ChangeLogsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Select only +// change logs whose object ID, user name, old or new values match the +// search string. +func (c *ChangeLogsListCall) SearchString(searchString string) *ChangeLogsListCall { + c.opt_["searchString"] = searchString + return c +} + +// UserProfileIds sets the optional parameter "userProfileIds": Select +// only change logs with these user profile IDs. +func (c *ChangeLogsListCall) UserProfileIds(userProfileIds int64) *ChangeLogsListCall { + c.opt_["userProfileIds"] = userProfileIds + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChangeLogsListCall) Fields(s ...googleapi.Field) *ChangeLogsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ChangeLogsListCall) IfNoneMatch(entityTag string) *ChangeLogsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChangeLogsListCall) Context(ctx context.Context) *ChangeLogsListCall { + c.ctx_ = ctx + return c +} + +func (c *ChangeLogsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["action"]; ok { + params.Set("action", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxChangeTime"]; ok { + params.Set("maxChangeTime", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["minChangeTime"]; ok { + params.Set("minChangeTime", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["objectIds"]; ok { + params.Set("objectIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["objectType"]; ok { + params.Set("objectType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["userProfileIds"]; ok { + params.Set("userProfileIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/changeLogs") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.changeLogs.list" call. +// Exactly one of *ChangeLogsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ChangeLogsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ChangeLogsListCall) Do() (*ChangeLogsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ChangeLogsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of change logs.", + // "httpMethod": "GET", + // "id": "dfareporting.changeLogs.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "action": { + // "description": "Select only change logs with the specified action.", + // "enum": [ + // "ACTION_ADD", + // "ACTION_ASSIGN", + // "ACTION_ASSOCIATE", + // "ACTION_CREATE", + // "ACTION_DELETE", + // "ACTION_DISABLE", + // "ACTION_EMAIL_TAGS", + // "ACTION_ENABLE", + // "ACTION_LINK", + // "ACTION_MARK_AS_DEFAULT", + // "ACTION_PUSH", + // "ACTION_REMOVE", + // "ACTION_SEND", + // "ACTION_SHARE", + // "ACTION_UNASSIGN", + // "ACTION_UNLINK", + // "ACTION_UPDATE" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "ids": { + // "description": "Select only change logs with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxChangeTime": { + // "description": "Select only change logs whose change time is before the specified maxChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is \"2015-07-18T22:54:00-04:00\". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "minChangeTime": { + // "description": "Select only change logs whose change time is before the specified minChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is \"2015-07-18T22:54:00-04:00\". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset.", + // "location": "query", + // "type": "string" + // }, + // "objectIds": { + // "description": "Select only change logs with these object IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "objectType": { + // "description": "Select only change logs with the specified object type.", + // "enum": [ + // "OBJECT_ACCOUNT", + // "OBJECT_ACCOUNT_BILLING_FEATURE", + // "OBJECT_AD", + // "OBJECT_ADVERTISER", + // "OBJECT_ADVERTISER_GROUP", + // "OBJECT_BILLING_ACCOUNT_GROUP", + // "OBJECT_BILLING_FEATURE", + // "OBJECT_BILLING_MINIMUM_FEE", + // "OBJECT_BILLING_PROFILE", + // "OBJECT_CAMPAIGN", + // "OBJECT_CONTENT_CATEGORY", + // "OBJECT_CREATIVE", + // "OBJECT_CREATIVE_ASSET", + // "OBJECT_CREATIVE_BUNDLE", + // "OBJECT_CREATIVE_FIELD", + // "OBJECT_CREATIVE_GROUP", + // "OBJECT_DFA_SITE", + // "OBJECT_EVENT_TAG", + // "OBJECT_FLOODLIGHT_ACTIVITY_GROUP", + // "OBJECT_FLOODLIGHT_ACTVITY", + // "OBJECT_FLOODLIGHT_CONFIGURATION", + // "OBJECT_INSTREAM_CREATIVE", + // "OBJECT_LANDING_PAGE", + // "OBJECT_MEDIA_ORDER", + // "OBJECT_PLACEMENT", + // "OBJECT_PLACEMENT_STRATEGY", + // "OBJECT_PROVIDED_LIST_CLIENT", + // "OBJECT_RATE_CARD", + // "OBJECT_REMARKETING_LIST", + // "OBJECT_RICHMEDIA_CREATIVE", + // "OBJECT_SD_SITE", + // "OBJECT_SIZE", + // "OBJECT_SUBACCOUNT", + // "OBJECT_USER_PROFILE", + // "OBJECT_USER_PROFILE_FILTER", + // "OBJECT_USER_ROLE" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Select only change logs whose object ID, user name, old or new values match the search string.", + // "location": "query", + // "type": "string" + // }, + // "userProfileIds": { + // "description": "Select only change logs with these user profile IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/changeLogs", + // "response": { + // "$ref": "ChangeLogsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.cities.list": + +type CitiesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of cities, possibly filtered. +func (r *CitiesService) List(profileId int64) *CitiesListCall { + c := &CitiesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// CountryDartIds sets the optional parameter "countryDartIds": Select +// only cities from these countries. +func (c *CitiesListCall) CountryDartIds(countryDartIds int64) *CitiesListCall { + c.opt_["countryDartIds"] = countryDartIds + return c +} + +// DartIds sets the optional parameter "dartIds": Select only cities +// with these DART IDs. +func (c *CitiesListCall) DartIds(dartIds int64) *CitiesListCall { + c.opt_["dartIds"] = dartIds + return c +} + +// NamePrefix sets the optional parameter "namePrefix": Select only +// cities with names starting with this prefix. +func (c *CitiesListCall) NamePrefix(namePrefix string) *CitiesListCall { + c.opt_["namePrefix"] = namePrefix + return c +} + +// RegionDartIds sets the optional parameter "regionDartIds": Select +// only cities from these regions. +func (c *CitiesListCall) RegionDartIds(regionDartIds int64) *CitiesListCall { + c.opt_["regionDartIds"] = regionDartIds + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CitiesListCall) Fields(s ...googleapi.Field) *CitiesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CitiesListCall) IfNoneMatch(entityTag string) *CitiesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CitiesListCall) Context(ctx context.Context) *CitiesListCall { + c.ctx_ = ctx + return c +} + +func (c *CitiesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["countryDartIds"]; ok { + params.Set("countryDartIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["dartIds"]; ok { + params.Set("dartIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["namePrefix"]; ok { + params.Set("namePrefix", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["regionDartIds"]; ok { + params.Set("regionDartIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/cities") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.cities.list" call. +// Exactly one of *CitiesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CitiesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CitiesListCall) Do() (*CitiesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CitiesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of cities, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.cities.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "countryDartIds": { + // "description": "Select only cities from these countries.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "dartIds": { + // "description": "Select only cities with these DART IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "namePrefix": { + // "description": "Select only cities with names starting with this prefix.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "regionDartIds": { + // "description": "Select only cities from these regions.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/cities", + // "response": { + // "$ref": "CitiesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.connectionTypes.get": + +type ConnectionTypesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one connection type by ID. +func (r *ConnectionTypesService) Get(profileId int64, id int64) *ConnectionTypesGetCall { + c := &ConnectionTypesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ConnectionTypesGetCall) Fields(s ...googleapi.Field) *ConnectionTypesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ConnectionTypesGetCall) IfNoneMatch(entityTag string) *ConnectionTypesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ConnectionTypesGetCall) Context(ctx context.Context) *ConnectionTypesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ConnectionTypesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/connectionTypes/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.connectionTypes.get" call. +// Exactly one of *ConnectionType or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ConnectionType.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ConnectionTypesGetCall) Do() (*ConnectionType, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ConnectionType{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one connection type by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.connectionTypes.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Connection type ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/connectionTypes/{id}", + // "response": { + // "$ref": "ConnectionType" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.connectionTypes.list": + +type ConnectionTypesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of connection types. +func (r *ConnectionTypesService) List(profileId int64) *ConnectionTypesListCall { + c := &ConnectionTypesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ConnectionTypesListCall) Fields(s ...googleapi.Field) *ConnectionTypesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ConnectionTypesListCall) IfNoneMatch(entityTag string) *ConnectionTypesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ConnectionTypesListCall) Context(ctx context.Context) *ConnectionTypesListCall { + c.ctx_ = ctx + return c +} + +func (c *ConnectionTypesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/connectionTypes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.connectionTypes.list" call. +// Exactly one of *ConnectionTypesListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ConnectionTypesListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ConnectionTypesListCall) Do() (*ConnectionTypesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ConnectionTypesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of connection types.", + // "httpMethod": "GET", + // "id": "dfareporting.connectionTypes.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/connectionTypes", + // "response": { + // "$ref": "ConnectionTypesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.contentCategories.delete": + +type ContentCategoriesDeleteCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing content category. +func (r *ContentCategoriesService) Delete(profileId int64, id int64) *ContentCategoriesDeleteCall { + c := &ContentCategoriesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ContentCategoriesDeleteCall) Fields(s ...googleapi.Field) *ContentCategoriesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ContentCategoriesDeleteCall) Context(ctx context.Context) *ContentCategoriesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ContentCategoriesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.contentCategories.delete" call. +func (c *ContentCategoriesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing content category.", + // "httpMethod": "DELETE", + // "id": "dfareporting.contentCategories.delete", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Content category ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/contentCategories/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.contentCategories.get": + +type ContentCategoriesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one content category by ID. +func (r *ContentCategoriesService) Get(profileId int64, id int64) *ContentCategoriesGetCall { + c := &ContentCategoriesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ContentCategoriesGetCall) Fields(s ...googleapi.Field) *ContentCategoriesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ContentCategoriesGetCall) IfNoneMatch(entityTag string) *ContentCategoriesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ContentCategoriesGetCall) Context(ctx context.Context) *ContentCategoriesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ContentCategoriesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.contentCategories.get" call. +// Exactly one of *ContentCategory or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ContentCategory.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ContentCategoriesGetCall) Do() (*ContentCategory, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ContentCategory{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one content category by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.contentCategories.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Content category ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/contentCategories/{id}", + // "response": { + // "$ref": "ContentCategory" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.contentCategories.insert": + +type ContentCategoriesInsertCall struct { + s *Service + profileId int64 + contentcategory *ContentCategory + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new content category. +func (r *ContentCategoriesService) Insert(profileId int64, contentcategory *ContentCategory) *ContentCategoriesInsertCall { + c := &ContentCategoriesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.contentcategory = contentcategory + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ContentCategoriesInsertCall) Fields(s ...googleapi.Field) *ContentCategoriesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ContentCategoriesInsertCall) Context(ctx context.Context) *ContentCategoriesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ContentCategoriesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.contentCategories.insert" call. +// Exactly one of *ContentCategory or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ContentCategory.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ContentCategoriesInsertCall) Do() (*ContentCategory, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ContentCategory{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new content category.", + // "httpMethod": "POST", + // "id": "dfareporting.contentCategories.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/contentCategories", + // "request": { + // "$ref": "ContentCategory" + // }, + // "response": { + // "$ref": "ContentCategory" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.contentCategories.list": + +type ContentCategoriesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of content categories, possibly filtered. +func (r *ContentCategoriesService) List(profileId int64) *ContentCategoriesListCall { + c := &ContentCategoriesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Ids sets the optional parameter "ids": Select only content categories +// with these IDs. +func (c *ContentCategoriesListCall) Ids(ids int64) *ContentCategoriesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *ContentCategoriesListCall) MaxResults(maxResults int64) *ContentCategoriesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *ContentCategoriesListCall) PageToken(pageToken string) *ContentCategoriesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "contentcategory*2015" will return objects with names like +// "contentcategory June 2015", "contentcategory April 2015", or simply +// "contentcategory 2015". Most of the searches also add wildcards +// implicitly at the start and the end of the search string. For +// example, a search string of "contentcategory" will match objects with +// name "my contentcategory", "contentcategory 2015", or simply +// "contentcategory". +func (c *ContentCategoriesListCall) SearchString(searchString string) *ContentCategoriesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *ContentCategoriesListCall) SortField(sortField string) *ContentCategoriesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *ContentCategoriesListCall) SortOrder(sortOrder string) *ContentCategoriesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ContentCategoriesListCall) Fields(s ...googleapi.Field) *ContentCategoriesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ContentCategoriesListCall) IfNoneMatch(entityTag string) *ContentCategoriesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ContentCategoriesListCall) Context(ctx context.Context) *ContentCategoriesListCall { + c.ctx_ = ctx + return c +} + +func (c *ContentCategoriesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.contentCategories.list" call. +// Exactly one of *ContentCategoriesListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ContentCategoriesListResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ContentCategoriesListCall) Do() (*ContentCategoriesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ContentCategoriesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of content categories, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.contentCategories.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "ids": { + // "description": "Select only content categories with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"contentcategory*2015\" will return objects with names like \"contentcategory June 2015\", \"contentcategory April 2015\", or simply \"contentcategory 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"contentcategory\" will match objects with name \"my contentcategory\", \"contentcategory 2015\", or simply \"contentcategory\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/contentCategories", + // "response": { + // "$ref": "ContentCategoriesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.contentCategories.patch": + +type ContentCategoriesPatchCall struct { + s *Service + profileId int64 + id int64 + contentcategory *ContentCategory + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing content category. This method supports +// patch semantics. +func (r *ContentCategoriesService) Patch(profileId int64, id int64, contentcategory *ContentCategory) *ContentCategoriesPatchCall { + c := &ContentCategoriesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.contentcategory = contentcategory + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ContentCategoriesPatchCall) Fields(s ...googleapi.Field) *ContentCategoriesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ContentCategoriesPatchCall) Context(ctx context.Context) *ContentCategoriesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ContentCategoriesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.contentCategories.patch" call. +// Exactly one of *ContentCategory or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ContentCategory.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ContentCategoriesPatchCall) Do() (*ContentCategory, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ContentCategory{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing content category. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.contentCategories.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Content category ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/contentCategories", + // "request": { + // "$ref": "ContentCategory" + // }, + // "response": { + // "$ref": "ContentCategory" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.contentCategories.update": + +type ContentCategoriesUpdateCall struct { + s *Service + profileId int64 + contentcategory *ContentCategory + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing content category. +func (r *ContentCategoriesService) Update(profileId int64, contentcategory *ContentCategory) *ContentCategoriesUpdateCall { + c := &ContentCategoriesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.contentcategory = contentcategory + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ContentCategoriesUpdateCall) Fields(s ...googleapi.Field) *ContentCategoriesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ContentCategoriesUpdateCall) Context(ctx context.Context) *ContentCategoriesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ContentCategoriesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.contentCategories.update" call. +// Exactly one of *ContentCategory or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ContentCategory.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ContentCategoriesUpdateCall) Do() (*ContentCategory, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ContentCategory{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing content category.", + // "httpMethod": "PUT", + // "id": "dfareporting.contentCategories.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/contentCategories", + // "request": { + // "$ref": "ContentCategory" + // }, + // "response": { + // "$ref": "ContentCategory" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.countries.get": + +type CountriesGetCall struct { + s *Service + profileId int64 + dartId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one country by ID. +func (r *CountriesService) Get(profileId int64, dartId int64) *CountriesGetCall { + c := &CountriesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.dartId = dartId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CountriesGetCall) Fields(s ...googleapi.Field) *CountriesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CountriesGetCall) IfNoneMatch(entityTag string) *CountriesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CountriesGetCall) Context(ctx context.Context) *CountriesGetCall { + c.ctx_ = ctx + return c +} + +func (c *CountriesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/countries/{dartId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "dartId": strconv.FormatInt(c.dartId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.countries.get" call. +// Exactly one of *Country or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Country.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CountriesGetCall) Do() (*Country, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Country{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one country by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.countries.get", + // "parameterOrder": [ + // "profileId", + // "dartId" + // ], + // "parameters": { + // "dartId": { + // "description": "Country DART ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/countries/{dartId}", + // "response": { + // "$ref": "Country" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.countries.list": + +type CountriesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of countries. +func (r *CountriesService) List(profileId int64) *CountriesListCall { + c := &CountriesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CountriesListCall) Fields(s ...googleapi.Field) *CountriesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CountriesListCall) IfNoneMatch(entityTag string) *CountriesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CountriesListCall) Context(ctx context.Context) *CountriesListCall { + c.ctx_ = ctx + return c +} + +func (c *CountriesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/countries") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.countries.list" call. +// Exactly one of *CountriesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CountriesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CountriesListCall) Do() (*CountriesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CountriesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of countries.", + // "httpMethod": "GET", + // "id": "dfareporting.countries.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/countries", + // "response": { + // "$ref": "CountriesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeAssets.insert": + +type CreativeAssetsInsertCall struct { + s *Service + profileId int64 + advertiserId int64 + creativeassetmetadata *CreativeAssetMetadata + opt_ map[string]interface{} + media_ io.Reader + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// Insert: Inserts a new creative asset. +func (r *CreativeAssetsService) Insert(profileId int64, advertiserId int64, creativeassetmetadata *CreativeAssetMetadata) *CreativeAssetsInsertCall { + c := &CreativeAssetsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.advertiserId = advertiserId + c.creativeassetmetadata = creativeassetmetadata + return c +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *CreativeAssetsInsertCall) Media(r io.Reader) *CreativeAssetsInsertCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *CreativeAssetsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *CreativeAssetsInsertCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *CreativeAssetsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *CreativeAssetsInsertCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeAssetsInsertCall) Fields(s ...googleapi.Field) *CreativeAssetsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *CreativeAssetsInsertCall) Context(ctx context.Context) *CreativeAssetsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeAssetsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativeassetmetadata) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "advertiserId": strconv.FormatInt(c.advertiserId, 10), + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeAssets.insert" call. +// Exactly one of *CreativeAssetMetadata or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CreativeAssetMetadata.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeAssetsInsertCall) Do() (*CreativeAssetMetadata, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &CreativeAssetMetadata{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new creative asset.", + // "httpMethod": "POST", + // "id": "dfareporting.creativeAssets.insert", + // "mediaUpload": { + // "accept": [ + // "*/*" + // ], + // "maxSize": "100MB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/dfareporting/v2.1/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/dfareporting/v2.1/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets" + // } + // } + // }, + // "parameterOrder": [ + // "profileId", + // "advertiserId" + // ], + // "parameters": { + // "advertiserId": { + // "description": "Advertiser ID of this creative. This is a required field.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets", + // "request": { + // "$ref": "CreativeAssetMetadata" + // }, + // "response": { + // "$ref": "CreativeAssetMetadata" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "dfareporting.creativeFieldValues.delete": + +type CreativeFieldValuesDeleteCall struct { + s *Service + profileId int64 + creativeFieldId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing creative field value. +func (r *CreativeFieldValuesService) Delete(profileId int64, creativeFieldId int64, id int64) *CreativeFieldValuesDeleteCall { + c := &CreativeFieldValuesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativeFieldId = creativeFieldId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldValuesDeleteCall) Fields(s ...googleapi.Field) *CreativeFieldValuesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldValuesDeleteCall) Context(ctx context.Context) *CreativeFieldValuesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldValuesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFieldValues.delete" call. +func (c *CreativeFieldValuesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing creative field value.", + // "httpMethod": "DELETE", + // "id": "dfareporting.creativeFieldValues.delete", + // "parameterOrder": [ + // "profileId", + // "creativeFieldId", + // "id" + // ], + // "parameters": { + // "creativeFieldId": { + // "description": "Creative field ID for this creative field value.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "id": { + // "description": "Creative Field Value ID", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFieldValues.get": + +type CreativeFieldValuesGetCall struct { + s *Service + profileId int64 + creativeFieldId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one creative field value by ID. +func (r *CreativeFieldValuesService) Get(profileId int64, creativeFieldId int64, id int64) *CreativeFieldValuesGetCall { + c := &CreativeFieldValuesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativeFieldId = creativeFieldId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldValuesGetCall) Fields(s ...googleapi.Field) *CreativeFieldValuesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativeFieldValuesGetCall) IfNoneMatch(entityTag string) *CreativeFieldValuesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldValuesGetCall) Context(ctx context.Context) *CreativeFieldValuesGetCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldValuesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFieldValues.get" call. +// Exactly one of *CreativeFieldValue or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CreativeFieldValue.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldValuesGetCall) Do() (*CreativeFieldValue, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeFieldValue{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one creative field value by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.creativeFieldValues.get", + // "parameterOrder": [ + // "profileId", + // "creativeFieldId", + // "id" + // ], + // "parameters": { + // "creativeFieldId": { + // "description": "Creative field ID for this creative field value.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "id": { + // "description": "Creative Field Value ID", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}", + // "response": { + // "$ref": "CreativeFieldValue" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFieldValues.insert": + +type CreativeFieldValuesInsertCall struct { + s *Service + profileId int64 + creativeFieldId int64 + creativefieldvalue *CreativeFieldValue + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new creative field value. +func (r *CreativeFieldValuesService) Insert(profileId int64, creativeFieldId int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesInsertCall { + c := &CreativeFieldValuesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativeFieldId = creativeFieldId + c.creativefieldvalue = creativefieldvalue + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldValuesInsertCall) Fields(s ...googleapi.Field) *CreativeFieldValuesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldValuesInsertCall) Context(ctx context.Context) *CreativeFieldValuesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldValuesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFieldValues.insert" call. +// Exactly one of *CreativeFieldValue or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CreativeFieldValue.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldValuesInsertCall) Do() (*CreativeFieldValue, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeFieldValue{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new creative field value.", + // "httpMethod": "POST", + // "id": "dfareporting.creativeFieldValues.insert", + // "parameterOrder": [ + // "profileId", + // "creativeFieldId" + // ], + // "parameters": { + // "creativeFieldId": { + // "description": "Creative field ID for this creative field value.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + // "request": { + // "$ref": "CreativeFieldValue" + // }, + // "response": { + // "$ref": "CreativeFieldValue" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFieldValues.list": + +type CreativeFieldValuesListCall struct { + s *Service + profileId int64 + creativeFieldId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of creative field values, possibly filtered. +func (r *CreativeFieldValuesService) List(profileId int64, creativeFieldId int64) *CreativeFieldValuesListCall { + c := &CreativeFieldValuesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativeFieldId = creativeFieldId + return c +} + +// Ids sets the optional parameter "ids": Select only creative field +// values with these IDs. +func (c *CreativeFieldValuesListCall) Ids(ids int64) *CreativeFieldValuesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *CreativeFieldValuesListCall) MaxResults(maxResults int64) *CreativeFieldValuesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *CreativeFieldValuesListCall) PageToken(pageToken string) *CreativeFieldValuesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for creative field values by their values. Wildcards (e.g. +// *) are not allowed. +func (c *CreativeFieldValuesListCall) SearchString(searchString string) *CreativeFieldValuesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "VALUE" +func (c *CreativeFieldValuesListCall) SortField(sortField string) *CreativeFieldValuesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *CreativeFieldValuesListCall) SortOrder(sortOrder string) *CreativeFieldValuesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldValuesListCall) Fields(s ...googleapi.Field) *CreativeFieldValuesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativeFieldValuesListCall) IfNoneMatch(entityTag string) *CreativeFieldValuesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldValuesListCall) Context(ctx context.Context) *CreativeFieldValuesListCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldValuesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFieldValues.list" call. +// Exactly one of *CreativeFieldValuesListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *CreativeFieldValuesListResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldValuesListCall) Do() (*CreativeFieldValuesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeFieldValuesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of creative field values, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.creativeFieldValues.list", + // "parameterOrder": [ + // "profileId", + // "creativeFieldId" + // ], + // "parameters": { + // "creativeFieldId": { + // "description": "Creative field ID for this creative field value.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only creative field values with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for creative field values by their values. Wildcards (e.g. *) are not allowed.", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "VALUE" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + // "response": { + // "$ref": "CreativeFieldValuesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFieldValues.patch": + +type CreativeFieldValuesPatchCall struct { + s *Service + profileId int64 + creativeFieldId int64 + id int64 + creativefieldvalue *CreativeFieldValue + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing creative field value. This method supports +// patch semantics. +func (r *CreativeFieldValuesService) Patch(profileId int64, creativeFieldId int64, id int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesPatchCall { + c := &CreativeFieldValuesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativeFieldId = creativeFieldId + c.id = id + c.creativefieldvalue = creativefieldvalue + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldValuesPatchCall) Fields(s ...googleapi.Field) *CreativeFieldValuesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldValuesPatchCall) Context(ctx context.Context) *CreativeFieldValuesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldValuesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFieldValues.patch" call. +// Exactly one of *CreativeFieldValue or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CreativeFieldValue.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldValuesPatchCall) Do() (*CreativeFieldValue, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeFieldValue{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing creative field value. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.creativeFieldValues.patch", + // "parameterOrder": [ + // "profileId", + // "creativeFieldId", + // "id" + // ], + // "parameters": { + // "creativeFieldId": { + // "description": "Creative field ID for this creative field value.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "id": { + // "description": "Creative Field Value ID", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + // "request": { + // "$ref": "CreativeFieldValue" + // }, + // "response": { + // "$ref": "CreativeFieldValue" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFieldValues.update": + +type CreativeFieldValuesUpdateCall struct { + s *Service + profileId int64 + creativeFieldId int64 + creativefieldvalue *CreativeFieldValue + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing creative field value. +func (r *CreativeFieldValuesService) Update(profileId int64, creativeFieldId int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesUpdateCall { + c := &CreativeFieldValuesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativeFieldId = creativeFieldId + c.creativefieldvalue = creativefieldvalue + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldValuesUpdateCall) Fields(s ...googleapi.Field) *CreativeFieldValuesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldValuesUpdateCall) Context(ctx context.Context) *CreativeFieldValuesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldValuesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFieldValues.update" call. +// Exactly one of *CreativeFieldValue or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CreativeFieldValue.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldValuesUpdateCall) Do() (*CreativeFieldValue, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeFieldValue{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing creative field value.", + // "httpMethod": "PUT", + // "id": "dfareporting.creativeFieldValues.update", + // "parameterOrder": [ + // "profileId", + // "creativeFieldId" + // ], + // "parameters": { + // "creativeFieldId": { + // "description": "Creative field ID for this creative field value.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + // "request": { + // "$ref": "CreativeFieldValue" + // }, + // "response": { + // "$ref": "CreativeFieldValue" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFields.delete": + +type CreativeFieldsDeleteCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing creative field. +func (r *CreativeFieldsService) Delete(profileId int64, id int64) *CreativeFieldsDeleteCall { + c := &CreativeFieldsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldsDeleteCall) Fields(s ...googleapi.Field) *CreativeFieldsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldsDeleteCall) Context(ctx context.Context) *CreativeFieldsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFields.delete" call. +func (c *CreativeFieldsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing creative field.", + // "httpMethod": "DELETE", + // "id": "dfareporting.creativeFields.delete", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Creative Field ID", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFields.get": + +type CreativeFieldsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one creative field by ID. +func (r *CreativeFieldsService) Get(profileId int64, id int64) *CreativeFieldsGetCall { + c := &CreativeFieldsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldsGetCall) Fields(s ...googleapi.Field) *CreativeFieldsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativeFieldsGetCall) IfNoneMatch(entityTag string) *CreativeFieldsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldsGetCall) Context(ctx context.Context) *CreativeFieldsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFields.get" call. +// Exactly one of *CreativeField or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativeField.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldsGetCall) Do() (*CreativeField, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeField{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one creative field by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.creativeFields.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Creative Field ID", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields/{id}", + // "response": { + // "$ref": "CreativeField" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFields.insert": + +type CreativeFieldsInsertCall struct { + s *Service + profileId int64 + creativefield *CreativeField + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new creative field. +func (r *CreativeFieldsService) Insert(profileId int64, creativefield *CreativeField) *CreativeFieldsInsertCall { + c := &CreativeFieldsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativefield = creativefield + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldsInsertCall) Fields(s ...googleapi.Field) *CreativeFieldsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldsInsertCall) Context(ctx context.Context) *CreativeFieldsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFields.insert" call. +// Exactly one of *CreativeField or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativeField.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldsInsertCall) Do() (*CreativeField, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeField{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new creative field.", + // "httpMethod": "POST", + // "id": "dfareporting.creativeFields.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields", + // "request": { + // "$ref": "CreativeField" + // }, + // "response": { + // "$ref": "CreativeField" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFields.list": + +type CreativeFieldsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of creative fields, possibly filtered. +func (r *CreativeFieldsService) List(profileId int64) *CreativeFieldsListCall { + c := &CreativeFieldsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdvertiserIds sets the optional parameter "advertiserIds": Select +// only creative fields that belong to these advertisers. +func (c *CreativeFieldsListCall) AdvertiserIds(advertiserIds int64) *CreativeFieldsListCall { + c.opt_["advertiserIds"] = advertiserIds + return c +} + +// Ids sets the optional parameter "ids": Select only creative fields +// with these IDs. +func (c *CreativeFieldsListCall) Ids(ids int64) *CreativeFieldsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *CreativeFieldsListCall) MaxResults(maxResults int64) *CreativeFieldsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *CreativeFieldsListCall) PageToken(pageToken string) *CreativeFieldsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for creative fields by name or ID. Wildcards (*) are +// allowed. For example, "creativefield*2015" will return creative +// fields with names like "creativefield June 2015", "creativefield +// April 2015", or simply "creativefield 2015". Most of the searches +// also add wild-cards implicitly at the start and the end of the search +// string. For example, a search string of "creativefield" will match +// creative fields with the name "my creativefield", "creativefield +// 2015", or simply "creativefield". +func (c *CreativeFieldsListCall) SearchString(searchString string) *CreativeFieldsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *CreativeFieldsListCall) SortField(sortField string) *CreativeFieldsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *CreativeFieldsListCall) SortOrder(sortOrder string) *CreativeFieldsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldsListCall) Fields(s ...googleapi.Field) *CreativeFieldsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativeFieldsListCall) IfNoneMatch(entityTag string) *CreativeFieldsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldsListCall) Context(ctx context.Context) *CreativeFieldsListCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserIds"]; ok { + params.Set("advertiserIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFields.list" call. +// Exactly one of *CreativeFieldsListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *CreativeFieldsListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldsListCall) Do() (*CreativeFieldsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeFieldsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of creative fields, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.creativeFields.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "advertiserIds": { + // "description": "Select only creative fields that belong to these advertisers.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only creative fields with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for creative fields by name or ID. Wildcards (*) are allowed. For example, \"creativefield*2015\" will return creative fields with names like \"creativefield June 2015\", \"creativefield April 2015\", or simply \"creativefield 2015\". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of \"creativefield\" will match creative fields with the name \"my creativefield\", \"creativefield 2015\", or simply \"creativefield\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields", + // "response": { + // "$ref": "CreativeFieldsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFields.patch": + +type CreativeFieldsPatchCall struct { + s *Service + profileId int64 + id int64 + creativefield *CreativeField + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing creative field. This method supports patch +// semantics. +func (r *CreativeFieldsService) Patch(profileId int64, id int64, creativefield *CreativeField) *CreativeFieldsPatchCall { + c := &CreativeFieldsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.creativefield = creativefield + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldsPatchCall) Fields(s ...googleapi.Field) *CreativeFieldsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldsPatchCall) Context(ctx context.Context) *CreativeFieldsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFields.patch" call. +// Exactly one of *CreativeField or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativeField.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldsPatchCall) Do() (*CreativeField, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeField{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing creative field. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.creativeFields.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Creative Field ID", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields", + // "request": { + // "$ref": "CreativeField" + // }, + // "response": { + // "$ref": "CreativeField" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFields.update": + +type CreativeFieldsUpdateCall struct { + s *Service + profileId int64 + creativefield *CreativeField + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing creative field. +func (r *CreativeFieldsService) Update(profileId int64, creativefield *CreativeField) *CreativeFieldsUpdateCall { + c := &CreativeFieldsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativefield = creativefield + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldsUpdateCall) Fields(s ...googleapi.Field) *CreativeFieldsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldsUpdateCall) Context(ctx context.Context) *CreativeFieldsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFields.update" call. +// Exactly one of *CreativeField or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativeField.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldsUpdateCall) Do() (*CreativeField, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeField{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing creative field.", + // "httpMethod": "PUT", + // "id": "dfareporting.creativeFields.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields", + // "request": { + // "$ref": "CreativeField" + // }, + // "response": { + // "$ref": "CreativeField" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeGroups.get": + +type CreativeGroupsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one creative group by ID. +func (r *CreativeGroupsService) Get(profileId int64, id int64) *CreativeGroupsGetCall { + c := &CreativeGroupsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeGroupsGetCall) Fields(s ...googleapi.Field) *CreativeGroupsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativeGroupsGetCall) IfNoneMatch(entityTag string) *CreativeGroupsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeGroupsGetCall) Context(ctx context.Context) *CreativeGroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeGroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeGroups.get" call. +// Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativeGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeGroupsGetCall) Do() (*CreativeGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one creative group by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.creativeGroups.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Creative group ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeGroups/{id}", + // "response": { + // "$ref": "CreativeGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeGroups.insert": + +type CreativeGroupsInsertCall struct { + s *Service + profileId int64 + creativegroup *CreativeGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new creative group. +func (r *CreativeGroupsService) Insert(profileId int64, creativegroup *CreativeGroup) *CreativeGroupsInsertCall { + c := &CreativeGroupsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativegroup = creativegroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeGroupsInsertCall) Fields(s ...googleapi.Field) *CreativeGroupsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeGroupsInsertCall) Context(ctx context.Context) *CreativeGroupsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeGroupsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeGroups.insert" call. +// Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativeGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeGroupsInsertCall) Do() (*CreativeGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new creative group.", + // "httpMethod": "POST", + // "id": "dfareporting.creativeGroups.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeGroups", + // "request": { + // "$ref": "CreativeGroup" + // }, + // "response": { + // "$ref": "CreativeGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeGroups.list": + +type CreativeGroupsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of creative groups, possibly filtered. +func (r *CreativeGroupsService) List(profileId int64) *CreativeGroupsListCall { + c := &CreativeGroupsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdvertiserIds sets the optional parameter "advertiserIds": Select +// only creative groups that belong to these advertisers. +func (c *CreativeGroupsListCall) AdvertiserIds(advertiserIds int64) *CreativeGroupsListCall { + c.opt_["advertiserIds"] = advertiserIds + return c +} + +// GroupNumber sets the optional parameter "groupNumber": Select only +// creative groups that belong to this subgroup. +func (c *CreativeGroupsListCall) GroupNumber(groupNumber int64) *CreativeGroupsListCall { + c.opt_["groupNumber"] = groupNumber + return c +} + +// Ids sets the optional parameter "ids": Select only creative groups +// with these IDs. +func (c *CreativeGroupsListCall) Ids(ids int64) *CreativeGroupsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *CreativeGroupsListCall) MaxResults(maxResults int64) *CreativeGroupsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *CreativeGroupsListCall) PageToken(pageToken string) *CreativeGroupsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for creative groups by name or ID. Wildcards (*) are +// allowed. For example, "creativegroup*2015" will return creative +// groups with names like "creativegroup June 2015", "creativegroup +// April 2015", or simply "creativegroup 2015". Most of the searches +// also add wild-cards implicitly at the start and the end of the search +// string. For example, a search string of "creativegroup" will match +// creative groups with the name "my creativegroup", "creativegroup +// 2015", or simply "creativegroup". +func (c *CreativeGroupsListCall) SearchString(searchString string) *CreativeGroupsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *CreativeGroupsListCall) SortField(sortField string) *CreativeGroupsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *CreativeGroupsListCall) SortOrder(sortOrder string) *CreativeGroupsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeGroupsListCall) Fields(s ...googleapi.Field) *CreativeGroupsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativeGroupsListCall) IfNoneMatch(entityTag string) *CreativeGroupsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeGroupsListCall) Context(ctx context.Context) *CreativeGroupsListCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeGroupsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserIds"]; ok { + params.Set("advertiserIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["groupNumber"]; ok { + params.Set("groupNumber", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeGroups.list" call. +// Exactly one of *CreativeGroupsListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *CreativeGroupsListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeGroupsListCall) Do() (*CreativeGroupsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeGroupsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of creative groups, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.creativeGroups.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "advertiserIds": { + // "description": "Select only creative groups that belong to these advertisers.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "groupNumber": { + // "description": "Select only creative groups that belong to this subgroup.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "ids": { + // "description": "Select only creative groups with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for creative groups by name or ID. Wildcards (*) are allowed. For example, \"creativegroup*2015\" will return creative groups with names like \"creativegroup June 2015\", \"creativegroup April 2015\", or simply \"creativegroup 2015\". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of \"creativegroup\" will match creative groups with the name \"my creativegroup\", \"creativegroup 2015\", or simply \"creativegroup\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeGroups", + // "response": { + // "$ref": "CreativeGroupsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeGroups.patch": + +type CreativeGroupsPatchCall struct { + s *Service + profileId int64 + id int64 + creativegroup *CreativeGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing creative group. This method supports patch +// semantics. +func (r *CreativeGroupsService) Patch(profileId int64, id int64, creativegroup *CreativeGroup) *CreativeGroupsPatchCall { + c := &CreativeGroupsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.creativegroup = creativegroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeGroupsPatchCall) Fields(s ...googleapi.Field) *CreativeGroupsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeGroupsPatchCall) Context(ctx context.Context) *CreativeGroupsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeGroupsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeGroups.patch" call. +// Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativeGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeGroupsPatchCall) Do() (*CreativeGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing creative group. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.creativeGroups.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Creative group ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeGroups", + // "request": { + // "$ref": "CreativeGroup" + // }, + // "response": { + // "$ref": "CreativeGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeGroups.update": + +type CreativeGroupsUpdateCall struct { + s *Service + profileId int64 + creativegroup *CreativeGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing creative group. +func (r *CreativeGroupsService) Update(profileId int64, creativegroup *CreativeGroup) *CreativeGroupsUpdateCall { + c := &CreativeGroupsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativegroup = creativegroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeGroupsUpdateCall) Fields(s ...googleapi.Field) *CreativeGroupsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeGroupsUpdateCall) Context(ctx context.Context) *CreativeGroupsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeGroupsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeGroups.update" call. +// Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativeGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeGroupsUpdateCall) Do() (*CreativeGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing creative group.", + // "httpMethod": "PUT", + // "id": "dfareporting.creativeGroups.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeGroups", + // "request": { + // "$ref": "CreativeGroup" + // }, + // "response": { + // "$ref": "CreativeGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creatives.get": + +type CreativesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one creative by ID. +func (r *CreativesService) Get(profileId int64, id int64) *CreativesGetCall { + c := &CreativesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativesGetCall) Fields(s ...googleapi.Field) *CreativesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativesGetCall) IfNoneMatch(entityTag string) *CreativesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativesGetCall) Context(ctx context.Context) *CreativesGetCall { + c.ctx_ = ctx + return c +} + +func (c *CreativesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creatives.get" call. +// Exactly one of *Creative or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Creative.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CreativesGetCall) Do() (*Creative, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Creative{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one creative by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.creatives.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Creative ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creatives/{id}", + // "response": { + // "$ref": "Creative" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creatives.insert": + +type CreativesInsertCall struct { + s *Service + profileId int64 + creative *Creative + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new creative. +func (r *CreativesService) Insert(profileId int64, creative *Creative) *CreativesInsertCall { + c := &CreativesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creative = creative + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativesInsertCall) Fields(s ...googleapi.Field) *CreativesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativesInsertCall) Context(ctx context.Context) *CreativesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CreativesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creatives.insert" call. +// Exactly one of *Creative or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Creative.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CreativesInsertCall) Do() (*Creative, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Creative{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new creative.", + // "httpMethod": "POST", + // "id": "dfareporting.creatives.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creatives", + // "request": { + // "$ref": "Creative" + // }, + // "response": { + // "$ref": "Creative" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creatives.list": + +type CreativesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of creatives, possibly filtered. +func (r *CreativesService) List(profileId int64) *CreativesListCall { + c := &CreativesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Active sets the optional parameter "active": Select only active +// creatives. Leave blank to select active and inactive creatives. +func (c *CreativesListCall) Active(active bool) *CreativesListCall { + c.opt_["active"] = active + return c +} + +// AdvertiserId sets the optional parameter "advertiserId": Select only +// creatives with this advertiser ID. +func (c *CreativesListCall) AdvertiserId(advertiserId int64) *CreativesListCall { + c.opt_["advertiserId"] = advertiserId + return c +} + +// Archived sets the optional parameter "archived": Select only archived +// creatives. Leave blank to select archived and unarchived creatives. +func (c *CreativesListCall) Archived(archived bool) *CreativesListCall { + c.opt_["archived"] = archived + return c +} + +// CampaignId sets the optional parameter "campaignId": Select only +// creatives with this campaign ID. +func (c *CreativesListCall) CampaignId(campaignId int64) *CreativesListCall { + c.opt_["campaignId"] = campaignId + return c +} + +// CompanionCreativeIds sets the optional parameter +// "companionCreativeIds": Select only in-stream video creatives with +// these companion IDs. +func (c *CreativesListCall) CompanionCreativeIds(companionCreativeIds int64) *CreativesListCall { + c.opt_["companionCreativeIds"] = companionCreativeIds + return c +} + +// CreativeFieldIds sets the optional parameter "creativeFieldIds": +// Select only creatives with these creative field IDs. +func (c *CreativesListCall) CreativeFieldIds(creativeFieldIds int64) *CreativesListCall { + c.opt_["creativeFieldIds"] = creativeFieldIds + return c +} + +// Ids sets the optional parameter "ids": Select only creatives with +// these IDs. +func (c *CreativesListCall) Ids(ids int64) *CreativesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *CreativesListCall) MaxResults(maxResults int64) *CreativesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *CreativesListCall) PageToken(pageToken string) *CreativesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// RenderingIds sets the optional parameter "renderingIds": Select only +// creatives with these rendering IDs. +func (c *CreativesListCall) RenderingIds(renderingIds int64) *CreativesListCall { + c.opt_["renderingIds"] = renderingIds + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "creative*2015" will return objects with names like +// "creative June 2015", "creative April 2015", or simply "creative +// 2015". Most of the searches also add wildcards implicitly at the +// start and the end of the search string. For example, a search string +// of "creative" will match objects with name "my creative", "creative +// 2015", or simply "creative". +func (c *CreativesListCall) SearchString(searchString string) *CreativesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SizeIds sets the optional parameter "sizeIds": Select only creatives +// with these size IDs. +func (c *CreativesListCall) SizeIds(sizeIds int64) *CreativesListCall { + c.opt_["sizeIds"] = sizeIds + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *CreativesListCall) SortField(sortField string) *CreativesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *CreativesListCall) SortOrder(sortOrder string) *CreativesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// StudioCreativeId sets the optional parameter "studioCreativeId": +// Select only creatives corresponding to this Studio creative ID. +func (c *CreativesListCall) StudioCreativeId(studioCreativeId int64) *CreativesListCall { + c.opt_["studioCreativeId"] = studioCreativeId + return c +} + +// Types sets the optional parameter "types": Select only creatives with +// these creative types. +// +// Possible values: +// "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO" +// "CUSTOM_INPAGE" +// "CUSTOM_INTERSTITIAL" +// "ENHANCED_BANNER" +// "ENHANCED_IMAGE" +// "FLASH_INPAGE" +// "HTML5_BANNER" +// "IMAGE" +// "INSTREAM_VIDEO" +// "INTERNAL_REDIRECT" +// "INTERSTITIAL_INTERNAL_REDIRECT" +// "REDIRECT" +// "RICH_MEDIA_EXPANDING" +// "RICH_MEDIA_IM_EXPAND" +// "RICH_MEDIA_INPAGE" +// "RICH_MEDIA_INPAGE_FLOATING" +// "RICH_MEDIA_INTERSTITIAL_FLOAT" +// "RICH_MEDIA_MOBILE_IN_APP" +// "RICH_MEDIA_MULTI_FLOATING" +// "RICH_MEDIA_PEEL_DOWN" +// "TRACKING_TEXT" +// "VAST_REDIRECT" +// "VPAID_LINEAR" +// "VPAID_NON_LINEAR" +func (c *CreativesListCall) Types(types string) *CreativesListCall { + c.opt_["types"] = types + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativesListCall) Fields(s ...googleapi.Field) *CreativesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativesListCall) IfNoneMatch(entityTag string) *CreativesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativesListCall) Context(ctx context.Context) *CreativesListCall { + c.ctx_ = ctx + return c +} + +func (c *CreativesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["active"]; ok { + params.Set("active", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["advertiserId"]; ok { + params.Set("advertiserId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["archived"]; ok { + params.Set("archived", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["campaignId"]; ok { + params.Set("campaignId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["companionCreativeIds"]; ok { + params.Set("companionCreativeIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["creativeFieldIds"]; ok { + params.Set("creativeFieldIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["renderingIds"]; ok { + params.Set("renderingIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sizeIds"]; ok { + params.Set("sizeIds", 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)) + } + if v, ok := c.opt_["studioCreativeId"]; ok { + params.Set("studioCreativeId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["types"]; ok { + params.Set("types", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creatives.list" call. +// Exactly one of *CreativesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CreativesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativesListCall) Do() (*CreativesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of creatives, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.creatives.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "active": { + // "description": "Select only active creatives. Leave blank to select active and inactive creatives.", + // "location": "query", + // "type": "boolean" + // }, + // "advertiserId": { + // "description": "Select only creatives with this advertiser ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "archived": { + // "description": "Select only archived creatives. Leave blank to select archived and unarchived creatives.", + // "location": "query", + // "type": "boolean" + // }, + // "campaignId": { + // "description": "Select only creatives with this campaign ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "companionCreativeIds": { + // "description": "Select only in-stream video creatives with these companion IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "creativeFieldIds": { + // "description": "Select only creatives with these creative field IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only creatives with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "renderingIds": { + // "description": "Select only creatives with these rendering IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"creative*2015\" will return objects with names like \"creative June 2015\", \"creative April 2015\", or simply \"creative 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"creative\" will match objects with name \"my creative\", \"creative 2015\", or simply \"creative\".", + // "location": "query", + // "type": "string" + // }, + // "sizeIds": { + // "description": "Select only creatives with these size IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "studioCreativeId": { + // "description": "Select only creatives corresponding to this Studio creative ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "types": { + // "description": "Select only creatives with these creative types.", + // "enum": [ + // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO", + // "CUSTOM_INPAGE", + // "CUSTOM_INTERSTITIAL", + // "ENHANCED_BANNER", + // "ENHANCED_IMAGE", + // "FLASH_INPAGE", + // "HTML5_BANNER", + // "IMAGE", + // "INSTREAM_VIDEO", + // "INTERNAL_REDIRECT", + // "INTERSTITIAL_INTERNAL_REDIRECT", + // "REDIRECT", + // "RICH_MEDIA_EXPANDING", + // "RICH_MEDIA_IM_EXPAND", + // "RICH_MEDIA_INPAGE", + // "RICH_MEDIA_INPAGE_FLOATING", + // "RICH_MEDIA_INTERSTITIAL_FLOAT", + // "RICH_MEDIA_MOBILE_IN_APP", + // "RICH_MEDIA_MULTI_FLOATING", + // "RICH_MEDIA_PEEL_DOWN", + // "TRACKING_TEXT", + // "VAST_REDIRECT", + // "VPAID_LINEAR", + // "VPAID_NON_LINEAR" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creatives", + // "response": { + // "$ref": "CreativesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creatives.patch": + +type CreativesPatchCall struct { + s *Service + profileId int64 + id int64 + creative *Creative + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing creative. This method supports patch +// semantics. +func (r *CreativesService) Patch(profileId int64, id int64, creative *Creative) *CreativesPatchCall { + c := &CreativesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.creative = creative + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativesPatchCall) Fields(s ...googleapi.Field) *CreativesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativesPatchCall) Context(ctx context.Context) *CreativesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CreativesPatchCall) doRequest(alt string) (*http.Response, 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", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creatives.patch" call. +// Exactly one of *Creative or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Creative.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CreativesPatchCall) Do() (*Creative, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Creative{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing creative. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.creatives.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Creative ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creatives", + // "request": { + // "$ref": "Creative" + // }, + // "response": { + // "$ref": "Creative" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creatives.update": + +type CreativesUpdateCall struct { + s *Service + profileId int64 + creative *Creative + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing creative. +func (r *CreativesService) Update(profileId int64, creative *Creative) *CreativesUpdateCall { + c := &CreativesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creative = creative + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativesUpdateCall) Fields(s ...googleapi.Field) *CreativesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativesUpdateCall) Context(ctx context.Context) *CreativesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CreativesUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creatives.update" call. +// Exactly one of *Creative or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Creative.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CreativesUpdateCall) Do() (*Creative, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Creative{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing creative.", + // "httpMethod": "PUT", + // "id": "dfareporting.creatives.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creatives", + // "request": { + // "$ref": "Creative" + // }, + // "response": { + // "$ref": "Creative" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.dimensionValues.query": + +type DimensionValuesQueryCall struct { + s *Service + profileId int64 + dimensionvaluerequest *DimensionValueRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DimensionValuesQueryCall) Fields(s ...googleapi.Field) *DimensionValuesQueryCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DimensionValuesQueryCall) Context(ctx context.Context) *DimensionValuesQueryCall { + c.ctx_ = ctx + return c +} + +func (c *DimensionValuesQueryCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dimensionvalues/query") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.dimensionValues.query" call. +// Exactly one of *DimensionValueList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DimensionValueList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DimensionValuesQueryCall) Do() (*DimensionValueList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DimensionValueList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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.directorySiteContacts.get": + +type DirectorySiteContactsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one directory site contact by ID. +func (r *DirectorySiteContactsService) Get(profileId int64, id int64) *DirectorySiteContactsGetCall { + c := &DirectorySiteContactsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DirectorySiteContactsGetCall) Fields(s ...googleapi.Field) *DirectorySiteContactsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DirectorySiteContactsGetCall) IfNoneMatch(entityTag string) *DirectorySiteContactsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DirectorySiteContactsGetCall) Context(ctx context.Context) *DirectorySiteContactsGetCall { + c.ctx_ = ctx + return c +} + +func (c *DirectorySiteContactsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySiteContacts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.directorySiteContacts.get" call. +// Exactly one of *DirectorySiteContact or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DirectorySiteContact.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DirectorySiteContactsGetCall) Do() (*DirectorySiteContact, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DirectorySiteContact{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one directory site contact by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.directorySiteContacts.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Directory site contact ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/directorySiteContacts/{id}", + // "response": { + // "$ref": "DirectorySiteContact" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.directorySiteContacts.list": + +type DirectorySiteContactsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of directory site contacts, possibly filtered. +func (r *DirectorySiteContactsService) List(profileId int64) *DirectorySiteContactsListCall { + c := &DirectorySiteContactsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// DirectorySiteIds sets the optional parameter "directorySiteIds": +// Select only directory site contacts with these directory site IDs. +// This is a required field. +func (c *DirectorySiteContactsListCall) DirectorySiteIds(directorySiteIds int64) *DirectorySiteContactsListCall { + c.opt_["directorySiteIds"] = directorySiteIds + return c +} + +// Ids sets the optional parameter "ids": Select only directory site +// contacts with these IDs. +func (c *DirectorySiteContactsListCall) Ids(ids int64) *DirectorySiteContactsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *DirectorySiteContactsListCall) MaxResults(maxResults int64) *DirectorySiteContactsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *DirectorySiteContactsListCall) PageToken(pageToken string) *DirectorySiteContactsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name, ID or email. Wildcards (*) are +// allowed. For example, "directory site contact*2015" will return +// objects with names like "directory site contact June 2015", +// "directory site contact April 2015", or simply "directory site +// contact 2015". Most of the searches also add wildcards implicitly at +// the start and the end of the search string. For example, a search +// string of "directory site contact" will match objects with name "my +// directory site contact", "directory site contact 2015", or simply +// "directory site contact". +func (c *DirectorySiteContactsListCall) SearchString(searchString string) *DirectorySiteContactsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *DirectorySiteContactsListCall) SortField(sortField string) *DirectorySiteContactsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *DirectorySiteContactsListCall) SortOrder(sortOrder string) *DirectorySiteContactsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DirectorySiteContactsListCall) Fields(s ...googleapi.Field) *DirectorySiteContactsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DirectorySiteContactsListCall) IfNoneMatch(entityTag string) *DirectorySiteContactsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DirectorySiteContactsListCall) Context(ctx context.Context) *DirectorySiteContactsListCall { + c.ctx_ = ctx + return c +} + +func (c *DirectorySiteContactsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["directorySiteIds"]; ok { + params.Set("directorySiteIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySiteContacts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.directorySiteContacts.list" call. +// Exactly one of *DirectorySiteContactsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *DirectorySiteContactsListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *DirectorySiteContactsListCall) Do() (*DirectorySiteContactsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DirectorySiteContactsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of directory site contacts, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.directorySiteContacts.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "directorySiteIds": { + // "description": "Select only directory site contacts with these directory site IDs. This is a required field.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only directory site contacts with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, \"directory site contact*2015\" will return objects with names like \"directory site contact June 2015\", \"directory site contact April 2015\", or simply \"directory site contact 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"directory site contact\" will match objects with name \"my directory site contact\", \"directory site contact 2015\", or simply \"directory site contact\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/directorySiteContacts", + // "response": { + // "$ref": "DirectorySiteContactsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.directorySites.get": + +type DirectorySitesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one directory site by ID. +func (r *DirectorySitesService) Get(profileId int64, id int64) *DirectorySitesGetCall { + c := &DirectorySitesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DirectorySitesGetCall) Fields(s ...googleapi.Field) *DirectorySitesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DirectorySitesGetCall) IfNoneMatch(entityTag string) *DirectorySitesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DirectorySitesGetCall) Context(ctx context.Context) *DirectorySitesGetCall { + c.ctx_ = ctx + return c +} + +func (c *DirectorySitesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.directorySites.get" call. +// Exactly one of *DirectorySite or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DirectorySite.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DirectorySitesGetCall) Do() (*DirectorySite, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DirectorySite{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one directory site by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.directorySites.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Directory site ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/directorySites/{id}", + // "response": { + // "$ref": "DirectorySite" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.directorySites.insert": + +type DirectorySitesInsertCall struct { + s *Service + profileId int64 + directorysite *DirectorySite + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new directory site. +func (r *DirectorySitesService) Insert(profileId int64, directorysite *DirectorySite) *DirectorySitesInsertCall { + c := &DirectorySitesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.directorysite = directorysite + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DirectorySitesInsertCall) Fields(s ...googleapi.Field) *DirectorySitesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DirectorySitesInsertCall) Context(ctx context.Context) *DirectorySitesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *DirectorySitesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.directorysite) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.directorySites.insert" call. +// Exactly one of *DirectorySite or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DirectorySite.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DirectorySitesInsertCall) Do() (*DirectorySite, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DirectorySite{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new directory site.", + // "httpMethod": "POST", + // "id": "dfareporting.directorySites.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/directorySites", + // "request": { + // "$ref": "DirectorySite" + // }, + // "response": { + // "$ref": "DirectorySite" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.directorySites.list": + +type DirectorySitesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of directory sites, possibly filtered. +func (r *DirectorySitesService) List(profileId int64) *DirectorySitesListCall { + c := &DirectorySitesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AcceptsInStreamVideoPlacements sets the optional parameter +// "acceptsInStreamVideoPlacements": This search filter is no longer +// supported and will have no effect on the results returned. +func (c *DirectorySitesListCall) AcceptsInStreamVideoPlacements(acceptsInStreamVideoPlacements bool) *DirectorySitesListCall { + c.opt_["acceptsInStreamVideoPlacements"] = acceptsInStreamVideoPlacements + return c +} + +// AcceptsInterstitialPlacements sets the optional parameter +// "acceptsInterstitialPlacements": This search filter is no longer +// supported and will have no effect on the results returned. +func (c *DirectorySitesListCall) AcceptsInterstitialPlacements(acceptsInterstitialPlacements bool) *DirectorySitesListCall { + c.opt_["acceptsInterstitialPlacements"] = acceptsInterstitialPlacements + return c +} + +// AcceptsPublisherPaidPlacements sets the optional parameter +// "acceptsPublisherPaidPlacements": Select only directory sites that +// accept publisher paid placements. This field can be left blank. +func (c *DirectorySitesListCall) AcceptsPublisherPaidPlacements(acceptsPublisherPaidPlacements bool) *DirectorySitesListCall { + c.opt_["acceptsPublisherPaidPlacements"] = acceptsPublisherPaidPlacements + return c +} + +// Active sets the optional parameter "active": Select only active +// directory sites. Leave blank to retrieve both active and inactive +// directory sites. +func (c *DirectorySitesListCall) Active(active bool) *DirectorySitesListCall { + c.opt_["active"] = active + return c +} + +// CountryId sets the optional parameter "countryId": Select only +// directory sites with this country ID. +func (c *DirectorySitesListCall) CountryId(countryId int64) *DirectorySitesListCall { + c.opt_["countryId"] = countryId + return c +} + +// DfpNetworkCode sets the optional parameter "dfp_network_code": Select +// only directory sites with this DFP network code. +func (c *DirectorySitesListCall) DfpNetworkCode(dfpNetworkCode string) *DirectorySitesListCall { + c.opt_["dfp_network_code"] = dfpNetworkCode + return c +} + +// Ids sets the optional parameter "ids": Select only directory sites +// with these IDs. +func (c *DirectorySitesListCall) Ids(ids int64) *DirectorySitesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *DirectorySitesListCall) MaxResults(maxResults int64) *DirectorySitesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *DirectorySitesListCall) PageToken(pageToken string) *DirectorySitesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// ParentId sets the optional parameter "parentId": Select only +// directory sites with this parent ID. +func (c *DirectorySitesListCall) ParentId(parentId int64) *DirectorySitesListCall { + c.opt_["parentId"] = parentId + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name, ID or URL. Wildcards (*) are allowed. +// For example, "directory site*2015" will return objects with names +// like "directory site June 2015", "directory site April 2015", or +// simply "directory site 2015". Most of the searches also add wildcards +// implicitly at the start and the end of the search string. For +// example, a search string of "directory site" will match objects with +// name "my directory site", "directory site 2015" or simply, "directory +// site". +func (c *DirectorySitesListCall) SearchString(searchString string) *DirectorySitesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *DirectorySitesListCall) SortField(sortField string) *DirectorySitesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *DirectorySitesListCall) SortOrder(sortOrder string) *DirectorySitesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DirectorySitesListCall) Fields(s ...googleapi.Field) *DirectorySitesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DirectorySitesListCall) IfNoneMatch(entityTag string) *DirectorySitesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DirectorySitesListCall) Context(ctx context.Context) *DirectorySitesListCall { + c.ctx_ = ctx + return c +} + +func (c *DirectorySitesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["acceptsInStreamVideoPlacements"]; ok { + params.Set("acceptsInStreamVideoPlacements", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["acceptsInterstitialPlacements"]; ok { + params.Set("acceptsInterstitialPlacements", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["acceptsPublisherPaidPlacements"]; ok { + params.Set("acceptsPublisherPaidPlacements", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["active"]; ok { + params.Set("active", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["countryId"]; ok { + params.Set("countryId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["dfp_network_code"]; ok { + params.Set("dfp_network_code", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["parentId"]; ok { + params.Set("parentId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.directorySites.list" call. +// Exactly one of *DirectorySitesListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *DirectorySitesListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DirectorySitesListCall) Do() (*DirectorySitesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DirectorySitesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of directory sites, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.directorySites.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "acceptsInStreamVideoPlacements": { + // "description": "This search filter is no longer supported and will have no effect on the results returned.", + // "location": "query", + // "type": "boolean" + // }, + // "acceptsInterstitialPlacements": { + // "description": "This search filter is no longer supported and will have no effect on the results returned.", + // "location": "query", + // "type": "boolean" + // }, + // "acceptsPublisherPaidPlacements": { + // "description": "Select only directory sites that accept publisher paid placements. This field can be left blank.", + // "location": "query", + // "type": "boolean" + // }, + // "active": { + // "description": "Select only active directory sites. Leave blank to retrieve both active and inactive directory sites.", + // "location": "query", + // "type": "boolean" + // }, + // "countryId": { + // "description": "Select only directory sites with this country ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "dfp_network_code": { + // "description": "Select only directory sites with this DFP network code.", + // "location": "query", + // "type": "string" + // }, + // "ids": { + // "description": "Select only directory sites with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "parentId": { + // "description": "Select only directory sites with this parent ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name, ID or URL. Wildcards (*) are allowed. For example, \"directory site*2015\" will return objects with names like \"directory site June 2015\", \"directory site April 2015\", or simply \"directory site 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"directory site\" will match objects with name \"my directory site\", \"directory site 2015\" or simply, \"directory site\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/directorySites", + // "response": { + // "$ref": "DirectorySitesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.eventTags.delete": + +type EventTagsDeleteCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing event tag. +func (r *EventTagsService) Delete(profileId int64, id int64) *EventTagsDeleteCall { + c := &EventTagsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventTagsDeleteCall) Fields(s ...googleapi.Field) *EventTagsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventTagsDeleteCall) Context(ctx context.Context) *EventTagsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *EventTagsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.eventTags.delete" call. +func (c *EventTagsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing event tag.", + // "httpMethod": "DELETE", + // "id": "dfareporting.eventTags.delete", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Event tag ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/eventTags/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.eventTags.get": + +type EventTagsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one event tag by ID. +func (r *EventTagsService) Get(profileId int64, id int64) *EventTagsGetCall { + c := &EventTagsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventTagsGetCall) Fields(s ...googleapi.Field) *EventTagsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EventTagsGetCall) IfNoneMatch(entityTag string) *EventTagsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventTagsGetCall) Context(ctx context.Context) *EventTagsGetCall { + c.ctx_ = ctx + return c +} + +func (c *EventTagsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.eventTags.get" call. +// Exactly one of *EventTag or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *EventTag.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EventTagsGetCall) Do() (*EventTag, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EventTag{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one event tag by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.eventTags.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Event tag ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/eventTags/{id}", + // "response": { + // "$ref": "EventTag" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.eventTags.insert": + +type EventTagsInsertCall struct { + s *Service + profileId int64 + eventtag *EventTag + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new event tag. +func (r *EventTagsService) Insert(profileId int64, eventtag *EventTag) *EventTagsInsertCall { + c := &EventTagsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.eventtag = eventtag + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventTagsInsertCall) Fields(s ...googleapi.Field) *EventTagsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventTagsInsertCall) Context(ctx context.Context) *EventTagsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *EventTagsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.eventTags.insert" call. +// Exactly one of *EventTag or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *EventTag.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EventTagsInsertCall) Do() (*EventTag, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EventTag{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new event tag.", + // "httpMethod": "POST", + // "id": "dfareporting.eventTags.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/eventTags", + // "request": { + // "$ref": "EventTag" + // }, + // "response": { + // "$ref": "EventTag" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.eventTags.list": + +type EventTagsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of event tags, possibly filtered. +func (r *EventTagsService) List(profileId int64) *EventTagsListCall { + c := &EventTagsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdId sets the optional parameter "adId": Select only event tags that +// belong to this ad. +func (c *EventTagsListCall) AdId(adId int64) *EventTagsListCall { + c.opt_["adId"] = adId + return c +} + +// AdvertiserId sets the optional parameter "advertiserId": Select only +// event tags that belong to this advertiser. +func (c *EventTagsListCall) AdvertiserId(advertiserId int64) *EventTagsListCall { + c.opt_["advertiserId"] = advertiserId + return c +} + +// CampaignId sets the optional parameter "campaignId": Select only +// event tags that belong to this campaign. +func (c *EventTagsListCall) CampaignId(campaignId int64) *EventTagsListCall { + c.opt_["campaignId"] = campaignId + return c +} + +// DefinitionsOnly sets the optional parameter "definitionsOnly": +// Examine only the specified campaign or advertiser's event tags for +// matching selector criteria. When set to false, the parent advertiser +// and parent campaign of the specified ad or campaign is examined as +// well. In addition, when set to false, the status field is examined as +// well, along with the enabledByDefault field. This parameter can not +// be set to true when adId is specified as ads do not define their own +// even tags. +func (c *EventTagsListCall) DefinitionsOnly(definitionsOnly bool) *EventTagsListCall { + c.opt_["definitionsOnly"] = definitionsOnly + return c +} + +// Enabled sets the optional parameter "enabled": Select only enabled +// event tags. What is considered enabled or disabled depends on the +// definitionsOnly parameter. When definitionsOnly is set to true, only +// the specified advertiser or campaign's event tags' enabledByDefault +// field is examined. When definitionsOnly is set to false, the +// specified ad or specified campaign's parent advertiser's or parent +// campaign's event tags' enabledByDefault and status fields are +// examined as well. +func (c *EventTagsListCall) Enabled(enabled bool) *EventTagsListCall { + c.opt_["enabled"] = enabled + return c +} + +// EventTagTypes sets the optional parameter "eventTagTypes": Select +// only event tags with the specified event tag types. Event tag types +// can be used to specify whether to use a third-party pixel, a +// third-party JavaScript URL, or a third-party click-through URL for +// either impression or click tracking. +// +// Possible values: +// "CLICK_THROUGH_EVENT_TAG" +// "IMPRESSION_IMAGE_EVENT_TAG" +// "IMPRESSION_JAVASCRIPT_EVENT_TAG" +func (c *EventTagsListCall) EventTagTypes(eventTagTypes string) *EventTagsListCall { + c.opt_["eventTagTypes"] = eventTagTypes + return c +} + +// Ids sets the optional parameter "ids": Select only event tags with +// these IDs. +func (c *EventTagsListCall) Ids(ids int64) *EventTagsListCall { + c.opt_["ids"] = ids + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "eventtag*2015" will return objects with names like +// "eventtag June 2015", "eventtag April 2015", or simply "eventtag +// 2015". Most of the searches also add wildcards implicitly at the +// start and the end of the search string. For example, a search string +// of "eventtag" will match objects with name "my eventtag", "eventtag +// 2015", or simply "eventtag". +func (c *EventTagsListCall) SearchString(searchString string) *EventTagsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *EventTagsListCall) SortField(sortField string) *EventTagsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *EventTagsListCall) SortOrder(sortOrder string) *EventTagsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventTagsListCall) Fields(s ...googleapi.Field) *EventTagsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EventTagsListCall) IfNoneMatch(entityTag string) *EventTagsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventTagsListCall) Context(ctx context.Context) *EventTagsListCall { + c.ctx_ = ctx + return c +} + +func (c *EventTagsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["adId"]; ok { + params.Set("adId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["advertiserId"]; ok { + params.Set("advertiserId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["campaignId"]; ok { + params.Set("campaignId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["definitionsOnly"]; ok { + params.Set("definitionsOnly", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["enabled"]; ok { + params.Set("enabled", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["eventTagTypes"]; ok { + params.Set("eventTagTypes", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.eventTags.list" call. +// Exactly one of *EventTagsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *EventTagsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EventTagsListCall) Do() (*EventTagsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EventTagsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of event tags, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.eventTags.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "adId": { + // "description": "Select only event tags that belong to this ad.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "advertiserId": { + // "description": "Select only event tags that belong to this advertiser.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "campaignId": { + // "description": "Select only event tags that belong to this campaign.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "definitionsOnly": { + // "description": "Examine only the specified campaign or advertiser's event tags for matching selector criteria. When set to false, the parent advertiser and parent campaign of the specified ad or campaign is examined as well. In addition, when set to false, the status field is examined as well, along with the enabledByDefault field. This parameter can not be set to true when adId is specified as ads do not define their own even tags.", + // "location": "query", + // "type": "boolean" + // }, + // "enabled": { + // "description": "Select only enabled event tags. What is considered enabled or disabled depends on the definitionsOnly parameter. When definitionsOnly is set to true, only the specified advertiser or campaign's event tags' enabledByDefault field is examined. When definitionsOnly is set to false, the specified ad or specified campaign's parent advertiser's or parent campaign's event tags' enabledByDefault and status fields are examined as well.", + // "location": "query", + // "type": "boolean" + // }, + // "eventTagTypes": { + // "description": "Select only event tags with the specified event tag types. Event tag types can be used to specify whether to use a third-party pixel, a third-party JavaScript URL, or a third-party click-through URL for either impression or click tracking.", + // "enum": [ + // "CLICK_THROUGH_EVENT_TAG", + // "IMPRESSION_IMAGE_EVENT_TAG", + // "IMPRESSION_JAVASCRIPT_EVENT_TAG" + // ], + // "enumDescriptions": [ + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only event tags with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"eventtag*2015\" will return objects with names like \"eventtag June 2015\", \"eventtag April 2015\", or simply \"eventtag 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"eventtag\" will match objects with name \"my eventtag\", \"eventtag 2015\", or simply \"eventtag\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/eventTags", + // "response": { + // "$ref": "EventTagsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.eventTags.patch": + +type EventTagsPatchCall struct { + s *Service + profileId int64 + id int64 + eventtag *EventTag + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing event tag. This method supports patch +// semantics. +func (r *EventTagsService) Patch(profileId int64, id int64, eventtag *EventTag) *EventTagsPatchCall { + c := &EventTagsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.eventtag = eventtag + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventTagsPatchCall) Fields(s ...googleapi.Field) *EventTagsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventTagsPatchCall) Context(ctx context.Context) *EventTagsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *EventTagsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.eventTags.patch" call. +// Exactly one of *EventTag or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *EventTag.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EventTagsPatchCall) Do() (*EventTag, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EventTag{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing event tag. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.eventTags.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Event tag ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/eventTags", + // "request": { + // "$ref": "EventTag" + // }, + // "response": { + // "$ref": "EventTag" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.eventTags.update": + +type EventTagsUpdateCall struct { + s *Service + profileId int64 + eventtag *EventTag + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing event tag. +func (r *EventTagsService) Update(profileId int64, eventtag *EventTag) *EventTagsUpdateCall { + c := &EventTagsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.eventtag = eventtag + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventTagsUpdateCall) Fields(s ...googleapi.Field) *EventTagsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventTagsUpdateCall) Context(ctx context.Context) *EventTagsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *EventTagsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.eventTags.update" call. +// Exactly one of *EventTag or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *EventTag.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EventTagsUpdateCall) Do() (*EventTag, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EventTag{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing event tag.", + // "httpMethod": "PUT", + // "id": "dfareporting.eventTags.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/eventTags", + // "request": { + // "$ref": "EventTag" + // }, + // "response": { + // "$ref": "EventTag" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.files.get": + +type FilesGetCall struct { + s *Service + reportId int64 + fileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FilesGetCall) IfNoneMatch(entityTag string) *FilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FilesGetCall) Context(ctx context.Context) *FilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *FilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{reportId}/files/{fileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "reportId": strconv.FormatInt(c.reportId, 10), + "fileId": strconv.FormatInt(c.fileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *FilesGetCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "dfareporting.files.get" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FilesGetCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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'. +// +// Possible values: +// "ALL" - All files in account. +// "MINE" (default) - My files. +// "SHARED_WITH_ME" - Files shared with me. +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. +// +// Possible values: +// "ID" - Sort by file ID. +// "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field. +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'. +// +// Possible values: +// "ASCENDING" - Ascending order. +// "DESCENDING" (default) - Descending order. +func (c *FilesListCall) SortOrder(sortOrder string) *FilesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FilesListCall) Context(ctx context.Context) *FilesListCall { + c.ctx_ = ctx + return c +} + +func (c *FilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/files") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.files.list" call. +// Exactly one of *FileList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *FileList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FilesListCall) Do() (*FileList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FileList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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.floodlightActivities.delete": + +type FloodlightActivitiesDeleteCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing floodlight activity. +func (r *FloodlightActivitiesService) Delete(profileId int64, id int64) *FloodlightActivitiesDeleteCall { + c := &FloodlightActivitiesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivitiesDeleteCall) Fields(s ...googleapi.Field) *FloodlightActivitiesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivitiesDeleteCall) Context(ctx context.Context) *FloodlightActivitiesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivitiesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivities.delete" call. +func (c *FloodlightActivitiesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing floodlight activity.", + // "httpMethod": "DELETE", + // "id": "dfareporting.floodlightActivities.delete", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Floodlight activity ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivities/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivities.generatetag": + +type FloodlightActivitiesGeneratetagCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Generatetag: Generates a tag for a floodlight activity. +func (r *FloodlightActivitiesService) Generatetag(profileId int64) *FloodlightActivitiesGeneratetagCall { + c := &FloodlightActivitiesGeneratetagCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// FloodlightActivityId sets the optional parameter +// "floodlightActivityId": Floodlight activity ID for which we want to +// generate a tag. +func (c *FloodlightActivitiesGeneratetagCall) FloodlightActivityId(floodlightActivityId int64) *FloodlightActivitiesGeneratetagCall { + c.opt_["floodlightActivityId"] = floodlightActivityId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivitiesGeneratetagCall) Fields(s ...googleapi.Field) *FloodlightActivitiesGeneratetagCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivitiesGeneratetagCall) Context(ctx context.Context) *FloodlightActivitiesGeneratetagCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivitiesGeneratetagCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["floodlightActivityId"]; ok { + params.Set("floodlightActivityId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/generatetag") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivities.generatetag" call. +// Exactly one of *FloodlightActivitiesGenerateTagResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *FloodlightActivitiesGenerateTagResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivitiesGeneratetagCall) Do() (*FloodlightActivitiesGenerateTagResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivitiesGenerateTagResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generates a tag for a floodlight activity.", + // "httpMethod": "POST", + // "id": "dfareporting.floodlightActivities.generatetag", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "floodlightActivityId": { + // "description": "Floodlight activity ID for which we want to generate a tag.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivities/generatetag", + // "response": { + // "$ref": "FloodlightActivitiesGenerateTagResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivities.get": + +type FloodlightActivitiesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one floodlight activity by ID. +func (r *FloodlightActivitiesService) Get(profileId int64, id int64) *FloodlightActivitiesGetCall { + c := &FloodlightActivitiesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivitiesGetCall) Fields(s ...googleapi.Field) *FloodlightActivitiesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FloodlightActivitiesGetCall) IfNoneMatch(entityTag string) *FloodlightActivitiesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivitiesGetCall) Context(ctx context.Context) *FloodlightActivitiesGetCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivitiesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivities.get" call. +// Exactly one of *FloodlightActivity or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightActivity.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivitiesGetCall) Do() (*FloodlightActivity, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivity{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one floodlight activity by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.floodlightActivities.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Floodlight activity ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivities/{id}", + // "response": { + // "$ref": "FloodlightActivity" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivities.insert": + +type FloodlightActivitiesInsertCall struct { + s *Service + profileId int64 + floodlightactivity *FloodlightActivity + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new floodlight activity. +func (r *FloodlightActivitiesService) Insert(profileId int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesInsertCall { + c := &FloodlightActivitiesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.floodlightactivity = floodlightactivity + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivitiesInsertCall) Fields(s ...googleapi.Field) *FloodlightActivitiesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivitiesInsertCall) Context(ctx context.Context) *FloodlightActivitiesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivitiesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivities.insert" call. +// Exactly one of *FloodlightActivity or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightActivity.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivitiesInsertCall) Do() (*FloodlightActivity, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivity{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new floodlight activity.", + // "httpMethod": "POST", + // "id": "dfareporting.floodlightActivities.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivities", + // "request": { + // "$ref": "FloodlightActivity" + // }, + // "response": { + // "$ref": "FloodlightActivity" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivities.list": + +type FloodlightActivitiesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of floodlight activities, possibly filtered. +func (r *FloodlightActivitiesService) List(profileId int64) *FloodlightActivitiesListCall { + c := &FloodlightActivitiesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdvertiserId sets the optional parameter "advertiserId": Select only +// floodlight activities for the specified advertiser ID. Must specify +// either ids, advertiserId, or floodlightConfigurationId for a +// non-empty result. +func (c *FloodlightActivitiesListCall) AdvertiserId(advertiserId int64) *FloodlightActivitiesListCall { + c.opt_["advertiserId"] = advertiserId + return c +} + +// FloodlightActivityGroupIds sets the optional parameter +// "floodlightActivityGroupIds": Select only floodlight activities with +// the specified floodlight activity group IDs. +func (c *FloodlightActivitiesListCall) FloodlightActivityGroupIds(floodlightActivityGroupIds int64) *FloodlightActivitiesListCall { + c.opt_["floodlightActivityGroupIds"] = floodlightActivityGroupIds + return c +} + +// FloodlightActivityGroupName sets the optional parameter +// "floodlightActivityGroupName": Select only floodlight activities with +// the specified floodlight activity group name. +func (c *FloodlightActivitiesListCall) FloodlightActivityGroupName(floodlightActivityGroupName string) *FloodlightActivitiesListCall { + c.opt_["floodlightActivityGroupName"] = floodlightActivityGroupName + return c +} + +// FloodlightActivityGroupTagString sets the optional parameter +// "floodlightActivityGroupTagString": Select only floodlight activities +// with the specified floodlight activity group tag string. +func (c *FloodlightActivitiesListCall) FloodlightActivityGroupTagString(floodlightActivityGroupTagString string) *FloodlightActivitiesListCall { + c.opt_["floodlightActivityGroupTagString"] = floodlightActivityGroupTagString + return c +} + +// FloodlightActivityGroupType sets the optional parameter +// "floodlightActivityGroupType": Select only floodlight activities with +// the specified floodlight activity group type. +// +// Possible values: +// "COUNTER" +// "SALE" +func (c *FloodlightActivitiesListCall) FloodlightActivityGroupType(floodlightActivityGroupType string) *FloodlightActivitiesListCall { + c.opt_["floodlightActivityGroupType"] = floodlightActivityGroupType + return c +} + +// FloodlightConfigurationId sets the optional parameter +// "floodlightConfigurationId": Select only floodlight activities for +// the specified floodlight configuration ID. Must specify either ids, +// advertiserId, or floodlightConfigurationId for a non-empty result. +func (c *FloodlightActivitiesListCall) FloodlightConfigurationId(floodlightConfigurationId int64) *FloodlightActivitiesListCall { + c.opt_["floodlightConfigurationId"] = floodlightConfigurationId + return c +} + +// Ids sets the optional parameter "ids": Select only floodlight +// activities with the specified IDs. Must specify either ids, +// advertiserId, or floodlightConfigurationId for a non-empty result. +func (c *FloodlightActivitiesListCall) Ids(ids int64) *FloodlightActivitiesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *FloodlightActivitiesListCall) MaxResults(maxResults int64) *FloodlightActivitiesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *FloodlightActivitiesListCall) PageToken(pageToken string) *FloodlightActivitiesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "floodlightactivity*2015" will return objects with names +// like "floodlightactivity June 2015", "floodlightactivity April 2015", +// or simply "floodlightactivity 2015". Most of the searches also add +// wildcards implicitly at the start and the end of the search string. +// For example, a search string of "floodlightactivity" will match +// objects with name "my floodlightactivity activity", +// "floodlightactivity 2015", or simply "floodlightactivity". +func (c *FloodlightActivitiesListCall) SearchString(searchString string) *FloodlightActivitiesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *FloodlightActivitiesListCall) SortField(sortField string) *FloodlightActivitiesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *FloodlightActivitiesListCall) SortOrder(sortOrder string) *FloodlightActivitiesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// TagString sets the optional parameter "tagString": Select only +// floodlight activities with the specified tag string. +func (c *FloodlightActivitiesListCall) TagString(tagString string) *FloodlightActivitiesListCall { + c.opt_["tagString"] = tagString + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivitiesListCall) Fields(s ...googleapi.Field) *FloodlightActivitiesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FloodlightActivitiesListCall) IfNoneMatch(entityTag string) *FloodlightActivitiesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivitiesListCall) Context(ctx context.Context) *FloodlightActivitiesListCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivitiesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserId"]; ok { + params.Set("advertiserId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["floodlightActivityGroupIds"]; ok { + params.Set("floodlightActivityGroupIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["floodlightActivityGroupName"]; ok { + params.Set("floodlightActivityGroupName", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["floodlightActivityGroupTagString"]; ok { + params.Set("floodlightActivityGroupTagString", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["floodlightActivityGroupType"]; ok { + params.Set("floodlightActivityGroupType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["floodlightConfigurationId"]; ok { + params.Set("floodlightConfigurationId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["tagString"]; ok { + params.Set("tagString", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivities.list" call. +// Exactly one of *FloodlightActivitiesListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *FloodlightActivitiesListResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivitiesListCall) Do() (*FloodlightActivitiesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivitiesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of floodlight activities, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.floodlightActivities.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "advertiserId": { + // "description": "Select only floodlight activities for the specified advertiser ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "floodlightActivityGroupIds": { + // "description": "Select only floodlight activities with the specified floodlight activity group IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "floodlightActivityGroupName": { + // "description": "Select only floodlight activities with the specified floodlight activity group name.", + // "location": "query", + // "type": "string" + // }, + // "floodlightActivityGroupTagString": { + // "description": "Select only floodlight activities with the specified floodlight activity group tag string.", + // "location": "query", + // "type": "string" + // }, + // "floodlightActivityGroupType": { + // "description": "Select only floodlight activities with the specified floodlight activity group type.", + // "enum": [ + // "COUNTER", + // "SALE" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "floodlightConfigurationId": { + // "description": "Select only floodlight activities for the specified floodlight configuration ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ids": { + // "description": "Select only floodlight activities with the specified IDs. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"floodlightactivity*2015\" will return objects with names like \"floodlightactivity June 2015\", \"floodlightactivity April 2015\", or simply \"floodlightactivity 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"floodlightactivity\" will match objects with name \"my floodlightactivity activity\", \"floodlightactivity 2015\", or simply \"floodlightactivity\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "tagString": { + // "description": "Select only floodlight activities with the specified tag string.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivities", + // "response": { + // "$ref": "FloodlightActivitiesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivities.patch": + +type FloodlightActivitiesPatchCall struct { + s *Service + profileId int64 + id int64 + floodlightactivity *FloodlightActivity + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing floodlight activity. This method supports +// patch semantics. +func (r *FloodlightActivitiesService) Patch(profileId int64, id int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesPatchCall { + c := &FloodlightActivitiesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.floodlightactivity = floodlightactivity + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivitiesPatchCall) Fields(s ...googleapi.Field) *FloodlightActivitiesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivitiesPatchCall) Context(ctx context.Context) *FloodlightActivitiesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivitiesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivities.patch" call. +// Exactly one of *FloodlightActivity or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightActivity.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivitiesPatchCall) Do() (*FloodlightActivity, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivity{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing floodlight activity. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.floodlightActivities.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Floodlight activity ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivities", + // "request": { + // "$ref": "FloodlightActivity" + // }, + // "response": { + // "$ref": "FloodlightActivity" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivities.update": + +type FloodlightActivitiesUpdateCall struct { + s *Service + profileId int64 + floodlightactivity *FloodlightActivity + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing floodlight activity. +func (r *FloodlightActivitiesService) Update(profileId int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesUpdateCall { + c := &FloodlightActivitiesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.floodlightactivity = floodlightactivity + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivitiesUpdateCall) Fields(s ...googleapi.Field) *FloodlightActivitiesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivitiesUpdateCall) Context(ctx context.Context) *FloodlightActivitiesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivitiesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivities.update" call. +// Exactly one of *FloodlightActivity or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightActivity.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivitiesUpdateCall) Do() (*FloodlightActivity, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivity{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing floodlight activity.", + // "httpMethod": "PUT", + // "id": "dfareporting.floodlightActivities.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivities", + // "request": { + // "$ref": "FloodlightActivity" + // }, + // "response": { + // "$ref": "FloodlightActivity" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivityGroups.delete": + +type FloodlightActivityGroupsDeleteCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing floodlight activity group. +func (r *FloodlightActivityGroupsService) Delete(profileId int64, id int64) *FloodlightActivityGroupsDeleteCall { + c := &FloodlightActivityGroupsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivityGroupsDeleteCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivityGroupsDeleteCall) Context(ctx context.Context) *FloodlightActivityGroupsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivityGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivityGroups.delete" call. +func (c *FloodlightActivityGroupsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing floodlight activity group.", + // "httpMethod": "DELETE", + // "id": "dfareporting.floodlightActivityGroups.delete", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Floodlight activity Group ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivityGroups/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivityGroups.get": + +type FloodlightActivityGroupsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one floodlight activity group by ID. +func (r *FloodlightActivityGroupsService) Get(profileId int64, id int64) *FloodlightActivityGroupsGetCall { + c := &FloodlightActivityGroupsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivityGroupsGetCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FloodlightActivityGroupsGetCall) IfNoneMatch(entityTag string) *FloodlightActivityGroupsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivityGroupsGetCall) Context(ctx context.Context) *FloodlightActivityGroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivityGroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivityGroups.get" call. +// Exactly one of *FloodlightActivityGroup or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightActivityGroup.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivityGroupsGetCall) Do() (*FloodlightActivityGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivityGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one floodlight activity group by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.floodlightActivityGroups.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Floodlight activity Group ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivityGroups/{id}", + // "response": { + // "$ref": "FloodlightActivityGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivityGroups.insert": + +type FloodlightActivityGroupsInsertCall struct { + s *Service + profileId int64 + floodlightactivitygroup *FloodlightActivityGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new floodlight activity group. +func (r *FloodlightActivityGroupsService) Insert(profileId int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsInsertCall { + c := &FloodlightActivityGroupsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.floodlightactivitygroup = floodlightactivitygroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivityGroupsInsertCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivityGroupsInsertCall) Context(ctx context.Context) *FloodlightActivityGroupsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivityGroupsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivityGroups.insert" call. +// Exactly one of *FloodlightActivityGroup or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightActivityGroup.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivityGroupsInsertCall) Do() (*FloodlightActivityGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivityGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new floodlight activity group.", + // "httpMethod": "POST", + // "id": "dfareporting.floodlightActivityGroups.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivityGroups", + // "request": { + // "$ref": "FloodlightActivityGroup" + // }, + // "response": { + // "$ref": "FloodlightActivityGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivityGroups.list": + +type FloodlightActivityGroupsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of floodlight activity groups, possibly +// filtered. +func (r *FloodlightActivityGroupsService) List(profileId int64) *FloodlightActivityGroupsListCall { + c := &FloodlightActivityGroupsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdvertiserId sets the optional parameter "advertiserId": Select only +// floodlight activity groups with the specified advertiser ID. Must +// specify either advertiserId or floodlightConfigurationId for a +// non-empty result. +func (c *FloodlightActivityGroupsListCall) AdvertiserId(advertiserId int64) *FloodlightActivityGroupsListCall { + c.opt_["advertiserId"] = advertiserId + return c +} + +// FloodlightConfigurationId sets the optional parameter +// "floodlightConfigurationId": Select only floodlight activity groups +// with the specified floodlight configuration ID. Must specify either +// advertiserId, or floodlightConfigurationId for a non-empty result. +func (c *FloodlightActivityGroupsListCall) FloodlightConfigurationId(floodlightConfigurationId int64) *FloodlightActivityGroupsListCall { + c.opt_["floodlightConfigurationId"] = floodlightConfigurationId + return c +} + +// Ids sets the optional parameter "ids": Select only floodlight +// activity groups with the specified IDs. Must specify either +// advertiserId or floodlightConfigurationId for a non-empty result. +func (c *FloodlightActivityGroupsListCall) Ids(ids int64) *FloodlightActivityGroupsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *FloodlightActivityGroupsListCall) MaxResults(maxResults int64) *FloodlightActivityGroupsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *FloodlightActivityGroupsListCall) PageToken(pageToken string) *FloodlightActivityGroupsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "floodlightactivitygroup*2015" will return objects with +// names like "floodlightactivitygroup June 2015", +// "floodlightactivitygroup April 2015", or simply +// "floodlightactivitygroup 2015". Most of the searches also add +// wildcards implicitly at the start and the end of the search string. +// For example, a search string of "floodlightactivitygroup" will match +// objects with name "my floodlightactivitygroup activity", +// "floodlightactivitygroup 2015", or simply "floodlightactivitygroup". +func (c *FloodlightActivityGroupsListCall) SearchString(searchString string) *FloodlightActivityGroupsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *FloodlightActivityGroupsListCall) SortField(sortField string) *FloodlightActivityGroupsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *FloodlightActivityGroupsListCall) SortOrder(sortOrder string) *FloodlightActivityGroupsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Type sets the optional parameter "type": Select only floodlight +// activity groups with the specified floodlight activity group type. +// +// Possible values: +// "COUNTER" +// "SALE" +func (c *FloodlightActivityGroupsListCall) Type(type_ string) *FloodlightActivityGroupsListCall { + c.opt_["type"] = type_ + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivityGroupsListCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FloodlightActivityGroupsListCall) IfNoneMatch(entityTag string) *FloodlightActivityGroupsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivityGroupsListCall) Context(ctx context.Context) *FloodlightActivityGroupsListCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivityGroupsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserId"]; ok { + params.Set("advertiserId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["floodlightConfigurationId"]; ok { + params.Set("floodlightConfigurationId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["type"]; ok { + params.Set("type", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivityGroups.list" call. +// Exactly one of *FloodlightActivityGroupsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *FloodlightActivityGroupsListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FloodlightActivityGroupsListCall) Do() (*FloodlightActivityGroupsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivityGroupsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of floodlight activity groups, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.floodlightActivityGroups.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "advertiserId": { + // "description": "Select only floodlight activity groups with the specified advertiser ID. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "floodlightConfigurationId": { + // "description": "Select only floodlight activity groups with the specified floodlight configuration ID. Must specify either advertiserId, or floodlightConfigurationId for a non-empty result.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ids": { + // "description": "Select only floodlight activity groups with the specified IDs. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"floodlightactivitygroup*2015\" will return objects with names like \"floodlightactivitygroup June 2015\", \"floodlightactivitygroup April 2015\", or simply \"floodlightactivitygroup 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"floodlightactivitygroup\" will match objects with name \"my floodlightactivitygroup activity\", \"floodlightactivitygroup 2015\", or simply \"floodlightactivitygroup\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "type": { + // "description": "Select only floodlight activity groups with the specified floodlight activity group type.", + // "enum": [ + // "COUNTER", + // "SALE" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivityGroups", + // "response": { + // "$ref": "FloodlightActivityGroupsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivityGroups.patch": + +type FloodlightActivityGroupsPatchCall struct { + s *Service + profileId int64 + id int64 + floodlightactivitygroup *FloodlightActivityGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing floodlight activity group. This method +// supports patch semantics. +func (r *FloodlightActivityGroupsService) Patch(profileId int64, id int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsPatchCall { + c := &FloodlightActivityGroupsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.floodlightactivitygroup = floodlightactivitygroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivityGroupsPatchCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivityGroupsPatchCall) Context(ctx context.Context) *FloodlightActivityGroupsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivityGroupsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivityGroups.patch" call. +// Exactly one of *FloodlightActivityGroup or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightActivityGroup.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivityGroupsPatchCall) Do() (*FloodlightActivityGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivityGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing floodlight activity group. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.floodlightActivityGroups.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Floodlight activity Group ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivityGroups", + // "request": { + // "$ref": "FloodlightActivityGroup" + // }, + // "response": { + // "$ref": "FloodlightActivityGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivityGroups.update": + +type FloodlightActivityGroupsUpdateCall struct { + s *Service + profileId int64 + floodlightactivitygroup *FloodlightActivityGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing floodlight activity group. +func (r *FloodlightActivityGroupsService) Update(profileId int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsUpdateCall { + c := &FloodlightActivityGroupsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.floodlightactivitygroup = floodlightactivitygroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivityGroupsUpdateCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivityGroupsUpdateCall) Context(ctx context.Context) *FloodlightActivityGroupsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivityGroupsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivityGroups.update" call. +// Exactly one of *FloodlightActivityGroup or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightActivityGroup.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivityGroupsUpdateCall) Do() (*FloodlightActivityGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivityGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing floodlight activity group.", + // "httpMethod": "PUT", + // "id": "dfareporting.floodlightActivityGroups.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivityGroups", + // "request": { + // "$ref": "FloodlightActivityGroup" + // }, + // "response": { + // "$ref": "FloodlightActivityGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightConfigurations.get": + +type FloodlightConfigurationsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one floodlight configuration by ID. +func (r *FloodlightConfigurationsService) Get(profileId int64, id int64) *FloodlightConfigurationsGetCall { + c := &FloodlightConfigurationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightConfigurationsGetCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FloodlightConfigurationsGetCall) IfNoneMatch(entityTag string) *FloodlightConfigurationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightConfigurationsGetCall) Context(ctx context.Context) *FloodlightConfigurationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightConfigurationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightConfigurations.get" call. +// Exactly one of *FloodlightConfiguration or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightConfiguration.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightConfigurationsGetCall) Do() (*FloodlightConfiguration, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightConfiguration{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one floodlight configuration by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.floodlightConfigurations.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Floodlight configuration ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightConfigurations/{id}", + // "response": { + // "$ref": "FloodlightConfiguration" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightConfigurations.list": + +type FloodlightConfigurationsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of floodlight configurations, possibly +// filtered. +func (r *FloodlightConfigurationsService) List(profileId int64) *FloodlightConfigurationsListCall { + c := &FloodlightConfigurationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Ids sets the optional parameter "ids": Set of IDs of floodlight +// configurations to retrieve. Required field; otherwise an empty list +// will be returned. +func (c *FloodlightConfigurationsListCall) Ids(ids int64) *FloodlightConfigurationsListCall { + c.opt_["ids"] = ids + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightConfigurationsListCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FloodlightConfigurationsListCall) IfNoneMatch(entityTag string) *FloodlightConfigurationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightConfigurationsListCall) Context(ctx context.Context) *FloodlightConfigurationsListCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightConfigurationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightConfigurations.list" call. +// Exactly one of *FloodlightConfigurationsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *FloodlightConfigurationsListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FloodlightConfigurationsListCall) Do() (*FloodlightConfigurationsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightConfigurationsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of floodlight configurations, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.floodlightConfigurations.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "ids": { + // "description": "Set of IDs of floodlight configurations to retrieve. Required field; otherwise an empty list will be returned.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightConfigurations", + // "response": { + // "$ref": "FloodlightConfigurationsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightConfigurations.patch": + +type FloodlightConfigurationsPatchCall struct { + s *Service + profileId int64 + id int64 + floodlightconfiguration *FloodlightConfiguration + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing floodlight configuration. This method +// supports patch semantics. +func (r *FloodlightConfigurationsService) Patch(profileId int64, id int64, floodlightconfiguration *FloodlightConfiguration) *FloodlightConfigurationsPatchCall { + c := &FloodlightConfigurationsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.floodlightconfiguration = floodlightconfiguration + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightConfigurationsPatchCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightConfigurationsPatchCall) Context(ctx context.Context) *FloodlightConfigurationsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightConfigurationsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightconfiguration) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightConfigurations.patch" call. +// Exactly one of *FloodlightConfiguration or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightConfiguration.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightConfigurationsPatchCall) Do() (*FloodlightConfiguration, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightConfiguration{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing floodlight configuration. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.floodlightConfigurations.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Floodlight configuration ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightConfigurations", + // "request": { + // "$ref": "FloodlightConfiguration" + // }, + // "response": { + // "$ref": "FloodlightConfiguration" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightConfigurations.update": + +type FloodlightConfigurationsUpdateCall struct { + s *Service + profileId int64 + floodlightconfiguration *FloodlightConfiguration + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing floodlight configuration. +func (r *FloodlightConfigurationsService) Update(profileId int64, floodlightconfiguration *FloodlightConfiguration) *FloodlightConfigurationsUpdateCall { + c := &FloodlightConfigurationsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.floodlightconfiguration = floodlightconfiguration + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightConfigurationsUpdateCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightConfigurationsUpdateCall) Context(ctx context.Context) *FloodlightConfigurationsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightConfigurationsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightconfiguration) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightConfigurations.update" call. +// Exactly one of *FloodlightConfiguration or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightConfiguration.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightConfigurationsUpdateCall) Do() (*FloodlightConfiguration, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightConfiguration{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing floodlight configuration.", + // "httpMethod": "PUT", + // "id": "dfareporting.floodlightConfigurations.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightConfigurations", + // "request": { + // "$ref": "FloodlightConfiguration" + // }, + // "response": { + // "$ref": "FloodlightConfiguration" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.inventoryItems.get": + +type InventoryItemsGetCall struct { + s *Service + profileId int64 + projectId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one inventory item by ID. +func (r *InventoryItemsService) Get(profileId int64, projectId int64, id int64) *InventoryItemsGetCall { + c := &InventoryItemsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.projectId = projectId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InventoryItemsGetCall) Fields(s ...googleapi.Field) *InventoryItemsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InventoryItemsGetCall) IfNoneMatch(entityTag string) *InventoryItemsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InventoryItemsGetCall) Context(ctx context.Context) *InventoryItemsGetCall { + c.ctx_ = ctx + return c +} + +func (c *InventoryItemsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "projectId": strconv.FormatInt(c.projectId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.inventoryItems.get" call. +// Exactly one of *InventoryItem or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *InventoryItem.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InventoryItemsGetCall) Do() (*InventoryItem, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InventoryItem{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one inventory item by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.inventoryItems.get", + // "parameterOrder": [ + // "profileId", + // "projectId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Inventory item ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID for order documents.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}", + // "response": { + // "$ref": "InventoryItem" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.inventoryItems.list": + +type InventoryItemsListCall struct { + s *Service + profileId int64 + projectId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of inventory items, possibly filtered. +func (r *InventoryItemsService) List(profileId int64, projectId int64) *InventoryItemsListCall { + c := &InventoryItemsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.projectId = projectId + return c +} + +// Ids sets the optional parameter "ids": Select only inventory items +// with these IDs. +func (c *InventoryItemsListCall) Ids(ids int64) *InventoryItemsListCall { + c.opt_["ids"] = ids + return c +} + +// InPlan sets the optional parameter "inPlan": Select only inventory +// items that are in plan. +func (c *InventoryItemsListCall) InPlan(inPlan bool) *InventoryItemsListCall { + c.opt_["inPlan"] = inPlan + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *InventoryItemsListCall) MaxResults(maxResults int64) *InventoryItemsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderId sets the optional parameter "orderId": Select only inventory +// items that belong to specified orders. +func (c *InventoryItemsListCall) OrderId(orderId int64) *InventoryItemsListCall { + c.opt_["orderId"] = orderId + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *InventoryItemsListCall) PageToken(pageToken string) *InventoryItemsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SiteId sets the optional parameter "siteId": Select only inventory +// items that are associated with these sites. +func (c *InventoryItemsListCall) SiteId(siteId int64) *InventoryItemsListCall { + c.opt_["siteId"] = siteId + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *InventoryItemsListCall) SortField(sortField string) *InventoryItemsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *InventoryItemsListCall) SortOrder(sortOrder string) *InventoryItemsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InventoryItemsListCall) Fields(s ...googleapi.Field) *InventoryItemsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InventoryItemsListCall) IfNoneMatch(entityTag string) *InventoryItemsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InventoryItemsListCall) Context(ctx context.Context) *InventoryItemsListCall { + c.ctx_ = ctx + return c +} + +func (c *InventoryItemsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["inPlan"]; ok { + params.Set("inPlan", 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_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["siteId"]; ok { + params.Set("siteId", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/inventoryItems") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "projectId": strconv.FormatInt(c.projectId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.inventoryItems.list" call. +// Exactly one of *InventoryItemsListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *InventoryItemsListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InventoryItemsListCall) Do() (*InventoryItemsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InventoryItemsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of inventory items, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.inventoryItems.list", + // "parameterOrder": [ + // "profileId", + // "projectId" + // ], + // "parameters": { + // "ids": { + // "description": "Select only inventory items with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "inPlan": { + // "description": "Select only inventory items that are in plan.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "orderId": { + // "description": "Select only inventory items that belong to specified orders.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID for order documents.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "siteId": { + // "description": "Select only inventory items that are associated with these sites.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/projects/{projectId}/inventoryItems", + // "response": { + // "$ref": "InventoryItemsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.landingPages.delete": + +type LandingPagesDeleteCall struct { + s *Service + profileId int64 + campaignId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing campaign landing page. +func (r *LandingPagesService) Delete(profileId int64, campaignId int64, id int64) *LandingPagesDeleteCall { + c := &LandingPagesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaignId = campaignId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LandingPagesDeleteCall) Fields(s ...googleapi.Field) *LandingPagesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LandingPagesDeleteCall) Context(ctx context.Context) *LandingPagesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *LandingPagesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "campaignId": strconv.FormatInt(c.campaignId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.landingPages.delete" call. +func (c *LandingPagesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing campaign landing page.", + // "httpMethod": "DELETE", + // "id": "dfareporting.landingPages.delete", + // "parameterOrder": [ + // "profileId", + // "campaignId", + // "id" + // ], + // "parameters": { + // "campaignId": { + // "description": "Landing page campaign ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "id": { + // "description": "Landing page ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.landingPages.get": + +type LandingPagesGetCall struct { + s *Service + profileId int64 + campaignId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one campaign landing page by ID. +func (r *LandingPagesService) Get(profileId int64, campaignId int64, id int64) *LandingPagesGetCall { + c := &LandingPagesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaignId = campaignId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LandingPagesGetCall) Fields(s ...googleapi.Field) *LandingPagesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LandingPagesGetCall) IfNoneMatch(entityTag string) *LandingPagesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LandingPagesGetCall) Context(ctx context.Context) *LandingPagesGetCall { + c.ctx_ = ctx + return c +} + +func (c *LandingPagesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "campaignId": strconv.FormatInt(c.campaignId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.landingPages.get" call. +// Exactly one of *LandingPage or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LandingPage.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *LandingPagesGetCall) Do() (*LandingPage, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LandingPage{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one campaign landing page by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.landingPages.get", + // "parameterOrder": [ + // "profileId", + // "campaignId", + // "id" + // ], + // "parameters": { + // "campaignId": { + // "description": "Landing page campaign ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "id": { + // "description": "Landing page ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}", + // "response": { + // "$ref": "LandingPage" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.landingPages.insert": + +type LandingPagesInsertCall struct { + s *Service + profileId int64 + campaignId int64 + landingpage *LandingPage + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new landing page for the specified campaign. +func (r *LandingPagesService) Insert(profileId int64, campaignId int64, landingpage *LandingPage) *LandingPagesInsertCall { + c := &LandingPagesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaignId = campaignId + c.landingpage = landingpage + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LandingPagesInsertCall) Fields(s ...googleapi.Field) *LandingPagesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LandingPagesInsertCall) Context(ctx context.Context) *LandingPagesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *LandingPagesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "campaignId": strconv.FormatInt(c.campaignId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.landingPages.insert" call. +// Exactly one of *LandingPage or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LandingPage.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *LandingPagesInsertCall) Do() (*LandingPage, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LandingPage{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new landing page for the specified campaign.", + // "httpMethod": "POST", + // "id": "dfareporting.landingPages.insert", + // "parameterOrder": [ + // "profileId", + // "campaignId" + // ], + // "parameters": { + // "campaignId": { + // "description": "Landing page campaign ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + // "request": { + // "$ref": "LandingPage" + // }, + // "response": { + // "$ref": "LandingPage" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.landingPages.list": + +type LandingPagesListCall struct { + s *Service + profileId int64 + campaignId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of landing pages for the specified campaign. +func (r *LandingPagesService) List(profileId int64, campaignId int64) *LandingPagesListCall { + c := &LandingPagesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaignId = campaignId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LandingPagesListCall) Fields(s ...googleapi.Field) *LandingPagesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LandingPagesListCall) IfNoneMatch(entityTag string) *LandingPagesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LandingPagesListCall) Context(ctx context.Context) *LandingPagesListCall { + c.ctx_ = ctx + return c +} + +func (c *LandingPagesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "campaignId": strconv.FormatInt(c.campaignId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.landingPages.list" call. +// Exactly one of *LandingPagesListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *LandingPagesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LandingPagesListCall) Do() (*LandingPagesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LandingPagesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of landing pages for the specified campaign.", + // "httpMethod": "GET", + // "id": "dfareporting.landingPages.list", + // "parameterOrder": [ + // "profileId", + // "campaignId" + // ], + // "parameters": { + // "campaignId": { + // "description": "Landing page campaign ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + // "response": { + // "$ref": "LandingPagesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.landingPages.patch": + +type LandingPagesPatchCall struct { + s *Service + profileId int64 + campaignId int64 + id int64 + landingpage *LandingPage + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing campaign landing page. This method +// supports patch semantics. +func (r *LandingPagesService) Patch(profileId int64, campaignId int64, id int64, landingpage *LandingPage) *LandingPagesPatchCall { + c := &LandingPagesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaignId = campaignId + c.id = id + c.landingpage = landingpage + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LandingPagesPatchCall) Fields(s ...googleapi.Field) *LandingPagesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LandingPagesPatchCall) Context(ctx context.Context) *LandingPagesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *LandingPagesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "campaignId": strconv.FormatInt(c.campaignId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.landingPages.patch" call. +// Exactly one of *LandingPage or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LandingPage.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *LandingPagesPatchCall) Do() (*LandingPage, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LandingPage{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing campaign landing page. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.landingPages.patch", + // "parameterOrder": [ + // "profileId", + // "campaignId", + // "id" + // ], + // "parameters": { + // "campaignId": { + // "description": "Landing page campaign ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "id": { + // "description": "Landing page ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + // "request": { + // "$ref": "LandingPage" + // }, + // "response": { + // "$ref": "LandingPage" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.landingPages.update": + +type LandingPagesUpdateCall struct { + s *Service + profileId int64 + campaignId int64 + landingpage *LandingPage + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing campaign landing page. +func (r *LandingPagesService) Update(profileId int64, campaignId int64, landingpage *LandingPage) *LandingPagesUpdateCall { + c := &LandingPagesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaignId = campaignId + c.landingpage = landingpage + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LandingPagesUpdateCall) Fields(s ...googleapi.Field) *LandingPagesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LandingPagesUpdateCall) Context(ctx context.Context) *LandingPagesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *LandingPagesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "campaignId": strconv.FormatInt(c.campaignId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.landingPages.update" call. +// Exactly one of *LandingPage or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LandingPage.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *LandingPagesUpdateCall) Do() (*LandingPage, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LandingPage{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing campaign landing page.", + // "httpMethod": "PUT", + // "id": "dfareporting.landingPages.update", + // "parameterOrder": [ + // "profileId", + // "campaignId" + // ], + // "parameters": { + // "campaignId": { + // "description": "Landing page campaign ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + // "request": { + // "$ref": "LandingPage" + // }, + // "response": { + // "$ref": "LandingPage" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.metros.list": + +type MetrosListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of metros. +func (r *MetrosService) List(profileId int64) *MetrosListCall { + c := &MetrosListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MetrosListCall) Fields(s ...googleapi.Field) *MetrosListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MetrosListCall) IfNoneMatch(entityTag string) *MetrosListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MetrosListCall) Context(ctx context.Context) *MetrosListCall { + c.ctx_ = ctx + return c +} + +func (c *MetrosListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/metros") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.metros.list" call. +// Exactly one of *MetrosListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *MetrosListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MetrosListCall) Do() (*MetrosListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &MetrosListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of metros.", + // "httpMethod": "GET", + // "id": "dfareporting.metros.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/metros", + // "response": { + // "$ref": "MetrosListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.mobileCarriers.get": + +type MobileCarriersGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one mobile carrier by ID. +func (r *MobileCarriersService) Get(profileId int64, id int64) *MobileCarriersGetCall { + c := &MobileCarriersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MobileCarriersGetCall) Fields(s ...googleapi.Field) *MobileCarriersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MobileCarriersGetCall) IfNoneMatch(entityTag string) *MobileCarriersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MobileCarriersGetCall) Context(ctx context.Context) *MobileCarriersGetCall { + c.ctx_ = ctx + return c +} + +func (c *MobileCarriersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileCarriers/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.mobileCarriers.get" call. +// Exactly one of *MobileCarrier or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *MobileCarrier.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MobileCarriersGetCall) Do() (*MobileCarrier, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &MobileCarrier{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one mobile carrier by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.mobileCarriers.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Mobile carrier ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/mobileCarriers/{id}", + // "response": { + // "$ref": "MobileCarrier" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.mobileCarriers.list": + +type MobileCarriersListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of mobile carriers. +func (r *MobileCarriersService) List(profileId int64) *MobileCarriersListCall { + c := &MobileCarriersListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MobileCarriersListCall) Fields(s ...googleapi.Field) *MobileCarriersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MobileCarriersListCall) IfNoneMatch(entityTag string) *MobileCarriersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MobileCarriersListCall) Context(ctx context.Context) *MobileCarriersListCall { + c.ctx_ = ctx + return c +} + +func (c *MobileCarriersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileCarriers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.mobileCarriers.list" call. +// Exactly one of *MobileCarriersListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *MobileCarriersListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MobileCarriersListCall) Do() (*MobileCarriersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &MobileCarriersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of mobile carriers.", + // "httpMethod": "GET", + // "id": "dfareporting.mobileCarriers.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/mobileCarriers", + // "response": { + // "$ref": "MobileCarriersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.operatingSystemVersions.get": + +type OperatingSystemVersionsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one operating system version by ID. +func (r *OperatingSystemVersionsService) Get(profileId int64, id int64) *OperatingSystemVersionsGetCall { + c := &OperatingSystemVersionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OperatingSystemVersionsGetCall) Fields(s ...googleapi.Field) *OperatingSystemVersionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OperatingSystemVersionsGetCall) IfNoneMatch(entityTag string) *OperatingSystemVersionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OperatingSystemVersionsGetCall) Context(ctx context.Context) *OperatingSystemVersionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *OperatingSystemVersionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystemVersions/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.operatingSystemVersions.get" call. +// Exactly one of *OperatingSystemVersion or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *OperatingSystemVersion.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OperatingSystemVersionsGetCall) Do() (*OperatingSystemVersion, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperatingSystemVersion{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one operating system version by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.operatingSystemVersions.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Operating system version ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/operatingSystemVersions/{id}", + // "response": { + // "$ref": "OperatingSystemVersion" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.operatingSystemVersions.list": + +type OperatingSystemVersionsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of operating system versions. +func (r *OperatingSystemVersionsService) List(profileId int64) *OperatingSystemVersionsListCall { + c := &OperatingSystemVersionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OperatingSystemVersionsListCall) Fields(s ...googleapi.Field) *OperatingSystemVersionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OperatingSystemVersionsListCall) IfNoneMatch(entityTag string) *OperatingSystemVersionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OperatingSystemVersionsListCall) Context(ctx context.Context) *OperatingSystemVersionsListCall { + c.ctx_ = ctx + return c +} + +func (c *OperatingSystemVersionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystemVersions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.operatingSystemVersions.list" call. +// Exactly one of *OperatingSystemVersionsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *OperatingSystemVersionsListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OperatingSystemVersionsListCall) Do() (*OperatingSystemVersionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperatingSystemVersionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of operating system versions.", + // "httpMethod": "GET", + // "id": "dfareporting.operatingSystemVersions.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/operatingSystemVersions", + // "response": { + // "$ref": "OperatingSystemVersionsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.operatingSystems.get": + +type OperatingSystemsGetCall struct { + s *Service + profileId int64 + dartId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one operating system by DART ID. +func (r *OperatingSystemsService) Get(profileId int64, dartId int64) *OperatingSystemsGetCall { + c := &OperatingSystemsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.dartId = dartId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OperatingSystemsGetCall) Fields(s ...googleapi.Field) *OperatingSystemsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OperatingSystemsGetCall) IfNoneMatch(entityTag string) *OperatingSystemsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OperatingSystemsGetCall) Context(ctx context.Context) *OperatingSystemsGetCall { + c.ctx_ = ctx + return c +} + +func (c *OperatingSystemsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystems/{dartId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "dartId": strconv.FormatInt(c.dartId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.operatingSystems.get" call. +// Exactly one of *OperatingSystem or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *OperatingSystem.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OperatingSystemsGetCall) Do() (*OperatingSystem, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperatingSystem{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one operating system by DART ID.", + // "httpMethod": "GET", + // "id": "dfareporting.operatingSystems.get", + // "parameterOrder": [ + // "profileId", + // "dartId" + // ], + // "parameters": { + // "dartId": { + // "description": "Operating system DART ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/operatingSystems/{dartId}", + // "response": { + // "$ref": "OperatingSystem" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.operatingSystems.list": + +type OperatingSystemsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of operating systems. +func (r *OperatingSystemsService) List(profileId int64) *OperatingSystemsListCall { + c := &OperatingSystemsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OperatingSystemsListCall) Fields(s ...googleapi.Field) *OperatingSystemsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OperatingSystemsListCall) IfNoneMatch(entityTag string) *OperatingSystemsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OperatingSystemsListCall) Context(ctx context.Context) *OperatingSystemsListCall { + c.ctx_ = ctx + return c +} + +func (c *OperatingSystemsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystems") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.operatingSystems.list" call. +// Exactly one of *OperatingSystemsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *OperatingSystemsListResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OperatingSystemsListCall) Do() (*OperatingSystemsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperatingSystemsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of operating systems.", + // "httpMethod": "GET", + // "id": "dfareporting.operatingSystems.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/operatingSystems", + // "response": { + // "$ref": "OperatingSystemsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.orderDocuments.get": + +type OrderDocumentsGetCall struct { + s *Service + profileId int64 + projectId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one order document by ID. +func (r *OrderDocumentsService) Get(profileId int64, projectId int64, id int64) *OrderDocumentsGetCall { + c := &OrderDocumentsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.projectId = projectId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrderDocumentsGetCall) Fields(s ...googleapi.Field) *OrderDocumentsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrderDocumentsGetCall) IfNoneMatch(entityTag string) *OrderDocumentsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrderDocumentsGetCall) Context(ctx context.Context) *OrderDocumentsGetCall { + c.ctx_ = ctx + return c +} + +func (c *OrderDocumentsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "projectId": strconv.FormatInt(c.projectId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.orderDocuments.get" call. +// Exactly one of *OrderDocument or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *OrderDocument.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrderDocumentsGetCall) Do() (*OrderDocument, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrderDocument{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one order document by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.orderDocuments.get", + // "parameterOrder": [ + // "profileId", + // "projectId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Order document ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID for order documents.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}", + // "response": { + // "$ref": "OrderDocument" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.orderDocuments.list": + +type OrderDocumentsListCall struct { + s *Service + profileId int64 + projectId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of order documents, possibly filtered. +func (r *OrderDocumentsService) List(profileId int64, projectId int64) *OrderDocumentsListCall { + c := &OrderDocumentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.projectId = projectId + return c +} + +// Approved sets the optional parameter "approved": Select only order +// documents that have been approved by at least one user. +func (c *OrderDocumentsListCall) Approved(approved bool) *OrderDocumentsListCall { + c.opt_["approved"] = approved + return c +} + +// Ids sets the optional parameter "ids": Select only order documents +// with these IDs. +func (c *OrderDocumentsListCall) Ids(ids int64) *OrderDocumentsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *OrderDocumentsListCall) MaxResults(maxResults int64) *OrderDocumentsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderId sets the optional parameter "orderId": Select only order +// documents for specified orders. +func (c *OrderDocumentsListCall) OrderId(orderId int64) *OrderDocumentsListCall { + c.opt_["orderId"] = orderId + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *OrderDocumentsListCall) PageToken(pageToken string) *OrderDocumentsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for order documents by name or ID. Wildcards (*) are +// allowed. For example, "orderdocument*2015" will return order +// documents with names like "orderdocument June 2015", "orderdocument +// April 2015", or simply "orderdocument 2015". Most of the searches +// also add wildcards implicitly at the start and the end of the search +// string. For example, a search string of "orderdocument" will match +// order documents with name "my orderdocument", "orderdocument 2015", +// or simply "orderdocument". +func (c *OrderDocumentsListCall) SearchString(searchString string) *OrderDocumentsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SiteId sets the optional parameter "siteId": Select only order +// documents that are associated with these sites. +func (c *OrderDocumentsListCall) SiteId(siteId int64) *OrderDocumentsListCall { + c.opt_["siteId"] = siteId + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *OrderDocumentsListCall) SortField(sortField string) *OrderDocumentsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *OrderDocumentsListCall) SortOrder(sortOrder string) *OrderDocumentsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrderDocumentsListCall) Fields(s ...googleapi.Field) *OrderDocumentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrderDocumentsListCall) IfNoneMatch(entityTag string) *OrderDocumentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrderDocumentsListCall) Context(ctx context.Context) *OrderDocumentsListCall { + c.ctx_ = ctx + return c +} + +func (c *OrderDocumentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["approved"]; ok { + params.Set("approved", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["siteId"]; ok { + params.Set("siteId", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orderDocuments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "projectId": strconv.FormatInt(c.projectId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.orderDocuments.list" call. +// Exactly one of *OrderDocumentsListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *OrderDocumentsListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrderDocumentsListCall) Do() (*OrderDocumentsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrderDocumentsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of order documents, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.orderDocuments.list", + // "parameterOrder": [ + // "profileId", + // "projectId" + // ], + // "parameters": { + // "approved": { + // "description": "Select only order documents that have been approved by at least one user.", + // "location": "query", + // "type": "boolean" + // }, + // "ids": { + // "description": "Select only order documents with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "orderId": { + // "description": "Select only order documents for specified orders.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID for order documents.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for order documents by name or ID. Wildcards (*) are allowed. For example, \"orderdocument*2015\" will return order documents with names like \"orderdocument June 2015\", \"orderdocument April 2015\", or simply \"orderdocument 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"orderdocument\" will match order documents with name \"my orderdocument\", \"orderdocument 2015\", or simply \"orderdocument\".", + // "location": "query", + // "type": "string" + // }, + // "siteId": { + // "description": "Select only order documents that are associated with these sites.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/projects/{projectId}/orderDocuments", + // "response": { + // "$ref": "OrderDocumentsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.orders.get": + +type OrdersGetCall struct { + s *Service + profileId int64 + projectId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one order by ID. +func (r *OrdersService) Get(profileId int64, projectId int64, id int64) *OrdersGetCall { + c := &OrdersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.projectId = projectId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersGetCall) Fields(s ...googleapi.Field) *OrdersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrdersGetCall) IfNoneMatch(entityTag string) *OrdersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersGetCall) Context(ctx context.Context) *OrdersGetCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orders/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "projectId": strconv.FormatInt(c.projectId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.orders.get" call. +// Exactly one of *Order or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Order.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrdersGetCall) Do() (*Order, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Order{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one order by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.orders.get", + // "parameterOrder": [ + // "profileId", + // "projectId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Order ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID for orders.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/projects/{projectId}/orders/{id}", + // "response": { + // "$ref": "Order" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.orders.list": + +type OrdersListCall struct { + s *Service + profileId int64 + projectId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of orders, possibly filtered. +func (r *OrdersService) List(profileId int64, projectId int64) *OrdersListCall { + c := &OrdersListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.projectId = projectId + return c +} + +// Ids sets the optional parameter "ids": Select only orders with these +// IDs. +func (c *OrdersListCall) Ids(ids int64) *OrdersListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *OrdersListCall) MaxResults(maxResults int64) *OrdersListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *OrdersListCall) PageToken(pageToken string) *OrdersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for orders by name or ID. Wildcards (*) are allowed. For +// example, "order*2015" will return orders with names like "order June +// 2015", "order April 2015", or simply "order 2015". Most of the +// searches also add wildcards implicitly at the start and the end of +// the search string. For example, a search string of "order" will match +// orders with name "my order", "order 2015", or simply "order". +func (c *OrdersListCall) SearchString(searchString string) *OrdersListCall { + c.opt_["searchString"] = searchString + return c +} + +// SiteId sets the optional parameter "siteId": Select only orders that +// are associated with these site IDs. +func (c *OrdersListCall) SiteId(siteId int64) *OrdersListCall { + c.opt_["siteId"] = siteId + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *OrdersListCall) SortField(sortField string) *OrdersListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *OrdersListCall) SortOrder(sortOrder string) *OrdersListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersListCall) Fields(s ...googleapi.Field) *OrdersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrdersListCall) IfNoneMatch(entityTag string) *OrdersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersListCall) Context(ctx context.Context) *OrdersListCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["siteId"]; ok { + params.Set("siteId", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orders") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "projectId": strconv.FormatInt(c.projectId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.orders.list" call. +// Exactly one of *OrdersListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *OrdersListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrdersListCall) Do() (*OrdersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of orders, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.orders.list", + // "parameterOrder": [ + // "profileId", + // "projectId" + // ], + // "parameters": { + // "ids": { + // "description": "Select only orders with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID for orders.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for orders by name or ID. Wildcards (*) are allowed. For example, \"order*2015\" will return orders with names like \"order June 2015\", \"order April 2015\", or simply \"order 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"order\" will match orders with name \"my order\", \"order 2015\", or simply \"order\".", + // "location": "query", + // "type": "string" + // }, + // "siteId": { + // "description": "Select only orders that are associated with these site IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/projects/{projectId}/orders", + // "response": { + // "$ref": "OrdersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementGroups.get": + +type PlacementGroupsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one placement group by ID. +func (r *PlacementGroupsService) Get(profileId int64, id int64) *PlacementGroupsGetCall { + c := &PlacementGroupsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementGroupsGetCall) Fields(s ...googleapi.Field) *PlacementGroupsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PlacementGroupsGetCall) IfNoneMatch(entityTag string) *PlacementGroupsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementGroupsGetCall) Context(ctx context.Context) *PlacementGroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementGroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementGroups.get" call. +// Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PlacementGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementGroupsGetCall) Do() (*PlacementGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one placement group by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.placementGroups.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Placement group ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementGroups/{id}", + // "response": { + // "$ref": "PlacementGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementGroups.insert": + +type PlacementGroupsInsertCall struct { + s *Service + profileId int64 + placementgroup *PlacementGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new placement group. +func (r *PlacementGroupsService) Insert(profileId int64, placementgroup *PlacementGroup) *PlacementGroupsInsertCall { + c := &PlacementGroupsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.placementgroup = placementgroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementGroupsInsertCall) Fields(s ...googleapi.Field) *PlacementGroupsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementGroupsInsertCall) Context(ctx context.Context) *PlacementGroupsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementGroupsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementGroups.insert" call. +// Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PlacementGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementGroupsInsertCall) Do() (*PlacementGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new placement group.", + // "httpMethod": "POST", + // "id": "dfareporting.placementGroups.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementGroups", + // "request": { + // "$ref": "PlacementGroup" + // }, + // "response": { + // "$ref": "PlacementGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementGroups.list": + +type PlacementGroupsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of placement groups, possibly filtered. +func (r *PlacementGroupsService) List(profileId int64) *PlacementGroupsListCall { + c := &PlacementGroupsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdvertiserIds sets the optional parameter "advertiserIds": Select +// only placement groups that belong to these advertisers. +func (c *PlacementGroupsListCall) AdvertiserIds(advertiserIds int64) *PlacementGroupsListCall { + c.opt_["advertiserIds"] = advertiserIds + return c +} + +// Archived sets the optional parameter "archived": Select only archived +// placements. Don't set this field to select both archived and +// non-archived placements. +func (c *PlacementGroupsListCall) Archived(archived bool) *PlacementGroupsListCall { + c.opt_["archived"] = archived + return c +} + +// CampaignIds sets the optional parameter "campaignIds": Select only +// placement groups that belong to these campaigns. +func (c *PlacementGroupsListCall) CampaignIds(campaignIds int64) *PlacementGroupsListCall { + c.opt_["campaignIds"] = campaignIds + return c +} + +// ContentCategoryIds sets the optional parameter "contentCategoryIds": +// Select only placement groups that are associated with these content +// categories. +func (c *PlacementGroupsListCall) ContentCategoryIds(contentCategoryIds int64) *PlacementGroupsListCall { + c.opt_["contentCategoryIds"] = contentCategoryIds + return c +} + +// DirectorySiteIds sets the optional parameter "directorySiteIds": +// Select only placement groups that are associated with these directory +// sites. +func (c *PlacementGroupsListCall) DirectorySiteIds(directorySiteIds int64) *PlacementGroupsListCall { + c.opt_["directorySiteIds"] = directorySiteIds + return c +} + +// Ids sets the optional parameter "ids": Select only placement groups +// with these IDs. +func (c *PlacementGroupsListCall) Ids(ids int64) *PlacementGroupsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *PlacementGroupsListCall) MaxResults(maxResults int64) *PlacementGroupsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *PlacementGroupsListCall) PageToken(pageToken string) *PlacementGroupsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// PlacementGroupType sets the optional parameter "placementGroupType": +// Select only placement groups belonging with this group type. A +// package is a simple group of placements that acts as a single pricing +// point for a group of tags. A roadblock is a group of placements that +// not only acts as a single pricing point but also assumes that all the +// tags in it will be served at the same time. A roadblock requires one +// of its assigned placements to be marked as primary for reporting. +// +// Possible values: +// "PLACEMENT_PACKAGE" +// "PLACEMENT_ROADBLOCK" +func (c *PlacementGroupsListCall) PlacementGroupType(placementGroupType string) *PlacementGroupsListCall { + c.opt_["placementGroupType"] = placementGroupType + return c +} + +// PlacementStrategyIds sets the optional parameter +// "placementStrategyIds": Select only placement groups that are +// associated with these placement strategies. +func (c *PlacementGroupsListCall) PlacementStrategyIds(placementStrategyIds int64) *PlacementGroupsListCall { + c.opt_["placementStrategyIds"] = placementStrategyIds + return c +} + +// PricingTypes sets the optional parameter "pricingTypes": Select only +// placement groups with these pricing types. +// +// Possible values: +// "PRICING_TYPE_CPA" +// "PRICING_TYPE_CPC" +// "PRICING_TYPE_CPM" +// "PRICING_TYPE_FLAT_RATE_CLICKS" +// "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" +func (c *PlacementGroupsListCall) PricingTypes(pricingTypes string) *PlacementGroupsListCall { + c.opt_["pricingTypes"] = pricingTypes + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for placement groups by name or ID. Wildcards (*) are +// allowed. For example, "placement*2015" will return placement groups +// with names like "placement group June 2015", "placement group May +// 2015", or simply "placements 2015". Most of the searches also add +// wildcards implicitly at the start and the end of the search string. +// For example, a search string of "placementgroup" will match placement +// groups with name "my placementgroup", "placementgroup 2015", or +// simply "placementgroup". +func (c *PlacementGroupsListCall) SearchString(searchString string) *PlacementGroupsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SiteIds sets the optional parameter "siteIds": Select only placement +// groups that are associated with these sites. +func (c *PlacementGroupsListCall) SiteIds(siteIds int64) *PlacementGroupsListCall { + c.opt_["siteIds"] = siteIds + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *PlacementGroupsListCall) SortField(sortField string) *PlacementGroupsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *PlacementGroupsListCall) SortOrder(sortOrder string) *PlacementGroupsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementGroupsListCall) Fields(s ...googleapi.Field) *PlacementGroupsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PlacementGroupsListCall) IfNoneMatch(entityTag string) *PlacementGroupsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementGroupsListCall) Context(ctx context.Context) *PlacementGroupsListCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementGroupsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserIds"]; ok { + params.Set("advertiserIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["archived"]; ok { + params.Set("archived", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["campaignIds"]; ok { + params.Set("campaignIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["contentCategoryIds"]; ok { + params.Set("contentCategoryIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["directorySiteIds"]; ok { + params.Set("directorySiteIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["placementGroupType"]; ok { + params.Set("placementGroupType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["placementStrategyIds"]; ok { + params.Set("placementStrategyIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pricingTypes"]; ok { + params.Set("pricingTypes", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["siteIds"]; ok { + params.Set("siteIds", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementGroups.list" call. +// Exactly one of *PlacementGroupsListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *PlacementGroupsListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementGroupsListCall) Do() (*PlacementGroupsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementGroupsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of placement groups, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.placementGroups.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "advertiserIds": { + // "description": "Select only placement groups that belong to these advertisers.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "archived": { + // "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.", + // "location": "query", + // "type": "boolean" + // }, + // "campaignIds": { + // "description": "Select only placement groups that belong to these campaigns.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "contentCategoryIds": { + // "description": "Select only placement groups that are associated with these content categories.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "directorySiteIds": { + // "description": "Select only placement groups that are associated with these directory sites.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only placement groups with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "placementGroupType": { + // "description": "Select only placement groups belonging with this group type. A package is a simple group of placements that acts as a single pricing point for a group of tags. A roadblock is a group of placements that not only acts as a single pricing point but also assumes that all the tags in it will be served at the same time. A roadblock requires one of its assigned placements to be marked as primary for reporting.", + // "enum": [ + // "PLACEMENT_PACKAGE", + // "PLACEMENT_ROADBLOCK" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "placementStrategyIds": { + // "description": "Select only placement groups that are associated with these placement strategies.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "pricingTypes": { + // "description": "Select only placement groups with these pricing types.", + // "enum": [ + // "PRICING_TYPE_CPA", + // "PRICING_TYPE_CPC", + // "PRICING_TYPE_CPM", + // "PRICING_TYPE_FLAT_RATE_CLICKS", + // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for placement groups by name or ID. Wildcards (*) are allowed. For example, \"placement*2015\" will return placement groups with names like \"placement group June 2015\", \"placement group May 2015\", or simply \"placements 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"placementgroup\" will match placement groups with name \"my placementgroup\", \"placementgroup 2015\", or simply \"placementgroup\".", + // "location": "query", + // "type": "string" + // }, + // "siteIds": { + // "description": "Select only placement groups that are associated with these sites.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementGroups", + // "response": { + // "$ref": "PlacementGroupsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementGroups.patch": + +type PlacementGroupsPatchCall struct { + s *Service + profileId int64 + id int64 + placementgroup *PlacementGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing placement group. This method supports +// patch semantics. +func (r *PlacementGroupsService) Patch(profileId int64, id int64, placementgroup *PlacementGroup) *PlacementGroupsPatchCall { + c := &PlacementGroupsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.placementgroup = placementgroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementGroupsPatchCall) Fields(s ...googleapi.Field) *PlacementGroupsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementGroupsPatchCall) Context(ctx context.Context) *PlacementGroupsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementGroupsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementGroups.patch" call. +// Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PlacementGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementGroupsPatchCall) Do() (*PlacementGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing placement group. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.placementGroups.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Placement group ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementGroups", + // "request": { + // "$ref": "PlacementGroup" + // }, + // "response": { + // "$ref": "PlacementGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementGroups.update": + +type PlacementGroupsUpdateCall struct { + s *Service + profileId int64 + placementgroup *PlacementGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing placement group. +func (r *PlacementGroupsService) Update(profileId int64, placementgroup *PlacementGroup) *PlacementGroupsUpdateCall { + c := &PlacementGroupsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.placementgroup = placementgroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementGroupsUpdateCall) Fields(s ...googleapi.Field) *PlacementGroupsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementGroupsUpdateCall) Context(ctx context.Context) *PlacementGroupsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementGroupsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementGroups.update" call. +// Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PlacementGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementGroupsUpdateCall) Do() (*PlacementGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing placement group.", + // "httpMethod": "PUT", + // "id": "dfareporting.placementGroups.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementGroups", + // "request": { + // "$ref": "PlacementGroup" + // }, + // "response": { + // "$ref": "PlacementGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementStrategies.delete": + +type PlacementStrategiesDeleteCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing placement strategy. +func (r *PlacementStrategiesService) Delete(profileId int64, id int64) *PlacementStrategiesDeleteCall { + c := &PlacementStrategiesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementStrategiesDeleteCall) Fields(s ...googleapi.Field) *PlacementStrategiesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementStrategiesDeleteCall) Context(ctx context.Context) *PlacementStrategiesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementStrategiesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementStrategies.delete" call. +func (c *PlacementStrategiesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing placement strategy.", + // "httpMethod": "DELETE", + // "id": "dfareporting.placementStrategies.delete", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Placement strategy ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementStrategies/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementStrategies.get": + +type PlacementStrategiesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one placement strategy by ID. +func (r *PlacementStrategiesService) Get(profileId int64, id int64) *PlacementStrategiesGetCall { + c := &PlacementStrategiesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementStrategiesGetCall) Fields(s ...googleapi.Field) *PlacementStrategiesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PlacementStrategiesGetCall) IfNoneMatch(entityTag string) *PlacementStrategiesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementStrategiesGetCall) Context(ctx context.Context) *PlacementStrategiesGetCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementStrategiesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementStrategies.get" call. +// Exactly one of *PlacementStrategy or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PlacementStrategy.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementStrategiesGetCall) Do() (*PlacementStrategy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementStrategy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one placement strategy by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.placementStrategies.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Placement strategy ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementStrategies/{id}", + // "response": { + // "$ref": "PlacementStrategy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementStrategies.insert": + +type PlacementStrategiesInsertCall struct { + s *Service + profileId int64 + placementstrategy *PlacementStrategy + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new placement strategy. +func (r *PlacementStrategiesService) Insert(profileId int64, placementstrategy *PlacementStrategy) *PlacementStrategiesInsertCall { + c := &PlacementStrategiesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.placementstrategy = placementstrategy + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementStrategiesInsertCall) Fields(s ...googleapi.Field) *PlacementStrategiesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementStrategiesInsertCall) Context(ctx context.Context) *PlacementStrategiesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementStrategiesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementStrategies.insert" call. +// Exactly one of *PlacementStrategy or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PlacementStrategy.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementStrategiesInsertCall) Do() (*PlacementStrategy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementStrategy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new placement strategy.", + // "httpMethod": "POST", + // "id": "dfareporting.placementStrategies.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementStrategies", + // "request": { + // "$ref": "PlacementStrategy" + // }, + // "response": { + // "$ref": "PlacementStrategy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementStrategies.list": + +type PlacementStrategiesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of placement strategies, possibly filtered. +func (r *PlacementStrategiesService) List(profileId int64) *PlacementStrategiesListCall { + c := &PlacementStrategiesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Ids sets the optional parameter "ids": Select only placement +// strategies with these IDs. +func (c *PlacementStrategiesListCall) Ids(ids int64) *PlacementStrategiesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *PlacementStrategiesListCall) MaxResults(maxResults int64) *PlacementStrategiesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *PlacementStrategiesListCall) PageToken(pageToken string) *PlacementStrategiesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "placementstrategy*2015" will return objects with names like +// "placementstrategy June 2015", "placementstrategy April 2015", or +// simply "placementstrategy 2015". Most of the searches also add +// wildcards implicitly at the start and the end of the search string. +// For example, a search string of "placementstrategy" will match +// objects with name "my placementstrategy", "placementstrategy 2015", +// or simply "placementstrategy". +func (c *PlacementStrategiesListCall) SearchString(searchString string) *PlacementStrategiesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *PlacementStrategiesListCall) SortField(sortField string) *PlacementStrategiesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *PlacementStrategiesListCall) SortOrder(sortOrder string) *PlacementStrategiesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementStrategiesListCall) Fields(s ...googleapi.Field) *PlacementStrategiesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PlacementStrategiesListCall) IfNoneMatch(entityTag string) *PlacementStrategiesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementStrategiesListCall) Context(ctx context.Context) *PlacementStrategiesListCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementStrategiesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementStrategies.list" call. +// Exactly one of *PlacementStrategiesListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PlacementStrategiesListResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementStrategiesListCall) Do() (*PlacementStrategiesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementStrategiesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of placement strategies, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.placementStrategies.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "ids": { + // "description": "Select only placement strategies with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"placementstrategy*2015\" will return objects with names like \"placementstrategy June 2015\", \"placementstrategy April 2015\", or simply \"placementstrategy 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"placementstrategy\" will match objects with name \"my placementstrategy\", \"placementstrategy 2015\", or simply \"placementstrategy\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementStrategies", + // "response": { + // "$ref": "PlacementStrategiesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementStrategies.patch": + +type PlacementStrategiesPatchCall struct { + s *Service + profileId int64 + id int64 + placementstrategy *PlacementStrategy + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing placement strategy. This method supports +// patch semantics. +func (r *PlacementStrategiesService) Patch(profileId int64, id int64, placementstrategy *PlacementStrategy) *PlacementStrategiesPatchCall { + c := &PlacementStrategiesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.placementstrategy = placementstrategy + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementStrategiesPatchCall) Fields(s ...googleapi.Field) *PlacementStrategiesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementStrategiesPatchCall) Context(ctx context.Context) *PlacementStrategiesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementStrategiesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementStrategies.patch" call. +// Exactly one of *PlacementStrategy or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PlacementStrategy.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementStrategiesPatchCall) Do() (*PlacementStrategy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementStrategy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing placement strategy. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.placementStrategies.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Placement strategy ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementStrategies", + // "request": { + // "$ref": "PlacementStrategy" + // }, + // "response": { + // "$ref": "PlacementStrategy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementStrategies.update": + +type PlacementStrategiesUpdateCall struct { + s *Service + profileId int64 + placementstrategy *PlacementStrategy + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing placement strategy. +func (r *PlacementStrategiesService) Update(profileId int64, placementstrategy *PlacementStrategy) *PlacementStrategiesUpdateCall { + c := &PlacementStrategiesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.placementstrategy = placementstrategy + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementStrategiesUpdateCall) Fields(s ...googleapi.Field) *PlacementStrategiesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementStrategiesUpdateCall) Context(ctx context.Context) *PlacementStrategiesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementStrategiesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementStrategies.update" call. +// Exactly one of *PlacementStrategy or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PlacementStrategy.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementStrategiesUpdateCall) Do() (*PlacementStrategy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementStrategy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing placement strategy.", + // "httpMethod": "PUT", + // "id": "dfareporting.placementStrategies.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementStrategies", + // "request": { + // "$ref": "PlacementStrategy" + // }, + // "response": { + // "$ref": "PlacementStrategy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placements.generatetags": + +type PlacementsGeneratetagsCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Generatetags: Generates tags for a placement. +func (r *PlacementsService) Generatetags(profileId int64) *PlacementsGeneratetagsCall { + c := &PlacementsGeneratetagsCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// CampaignId sets the optional parameter "campaignId": Generate +// placements belonging to this campaign. This is a required field. +func (c *PlacementsGeneratetagsCall) CampaignId(campaignId int64) *PlacementsGeneratetagsCall { + c.opt_["campaignId"] = campaignId + return c +} + +// PlacementIds sets the optional parameter "placementIds": Generate +// tags for these placements. +func (c *PlacementsGeneratetagsCall) PlacementIds(placementIds int64) *PlacementsGeneratetagsCall { + c.opt_["placementIds"] = placementIds + return c +} + +// TagFormats sets the optional parameter "tagFormats": Tag formats to +// generate for these placements. +// +// Possible values: +// "PLACEMENT_TAG_CLICK_COMMANDS" +// "PLACEMENT_TAG_IFRAME_ILAYER" +// "PLACEMENT_TAG_IFRAME_JAVASCRIPT" +// "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY" +// "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH" +// "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3" +// "PLACEMENT_TAG_INTERNAL_REDIRECT" +// "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT" +// "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY" +// "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT" +// "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT" +// "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY" +// "PLACEMENT_TAG_JAVASCRIPT" +// "PLACEMENT_TAG_JAVASCRIPT_LEGACY" +// "PLACEMENT_TAG_STANDARD" +// "PLACEMENT_TAG_TRACKING" +// "PLACEMENT_TAG_TRACKING_IFRAME" +// "PLACEMENT_TAG_TRACKING_JAVASCRIPT" +func (c *PlacementsGeneratetagsCall) TagFormats(tagFormats string) *PlacementsGeneratetagsCall { + c.opt_["tagFormats"] = tagFormats + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementsGeneratetagsCall) Fields(s ...googleapi.Field) *PlacementsGeneratetagsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementsGeneratetagsCall) Context(ctx context.Context) *PlacementsGeneratetagsCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementsGeneratetagsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["campaignId"]; ok { + params.Set("campaignId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["placementIds"]; ok { + params.Set("placementIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["tagFormats"]; ok { + params.Set("tagFormats", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements/generatetags") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placements.generatetags" call. +// Exactly one of *PlacementsGenerateTagsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PlacementsGenerateTagsResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementsGeneratetagsCall) Do() (*PlacementsGenerateTagsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementsGenerateTagsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generates tags for a placement.", + // "httpMethod": "POST", + // "id": "dfareporting.placements.generatetags", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "campaignId": { + // "description": "Generate placements belonging to this campaign. This is a required field.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "placementIds": { + // "description": "Generate tags for these placements.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tagFormats": { + // "description": "Tag formats to generate for these placements.", + // "enum": [ + // "PLACEMENT_TAG_CLICK_COMMANDS", + // "PLACEMENT_TAG_IFRAME_ILAYER", + // "PLACEMENT_TAG_IFRAME_JAVASCRIPT", + // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY", + // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH", + // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3", + // "PLACEMENT_TAG_INTERNAL_REDIRECT", + // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT", + // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY", + // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT", + // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT", + // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY", + // "PLACEMENT_TAG_JAVASCRIPT", + // "PLACEMENT_TAG_JAVASCRIPT_LEGACY", + // "PLACEMENT_TAG_STANDARD", + // "PLACEMENT_TAG_TRACKING", + // "PLACEMENT_TAG_TRACKING_IFRAME", + // "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placements/generatetags", + // "response": { + // "$ref": "PlacementsGenerateTagsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placements.get": + +type PlacementsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one placement by ID. +func (r *PlacementsService) Get(profileId int64, id int64) *PlacementsGetCall { + c := &PlacementsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementsGetCall) Fields(s ...googleapi.Field) *PlacementsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PlacementsGetCall) IfNoneMatch(entityTag string) *PlacementsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementsGetCall) Context(ctx context.Context) *PlacementsGetCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placements.get" call. +// Exactly one of *Placement or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Placement.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PlacementsGetCall) Do() (*Placement, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Placement{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one placement by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.placements.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Placement ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placements/{id}", + // "response": { + // "$ref": "Placement" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placements.insert": + +type PlacementsInsertCall struct { + s *Service + profileId int64 + placement *Placement + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new placement. +func (r *PlacementsService) Insert(profileId int64, placement *Placement) *PlacementsInsertCall { + c := &PlacementsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.placement = placement + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementsInsertCall) Fields(s ...googleapi.Field) *PlacementsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementsInsertCall) Context(ctx context.Context) *PlacementsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placements.insert" call. +// Exactly one of *Placement or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Placement.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PlacementsInsertCall) Do() (*Placement, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Placement{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new placement.", + // "httpMethod": "POST", + // "id": "dfareporting.placements.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placements", + // "request": { + // "$ref": "Placement" + // }, + // "response": { + // "$ref": "Placement" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placements.list": + +type PlacementsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of placements, possibly filtered. +func (r *PlacementsService) List(profileId int64) *PlacementsListCall { + c := &PlacementsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdvertiserIds sets the optional parameter "advertiserIds": Select +// only placements that belong to these advertisers. +func (c *PlacementsListCall) AdvertiserIds(advertiserIds int64) *PlacementsListCall { + c.opt_["advertiserIds"] = advertiserIds + return c +} + +// Archived sets the optional parameter "archived": Select only archived +// placements. Don't set this field to select both archived and +// non-archived placements. +func (c *PlacementsListCall) Archived(archived bool) *PlacementsListCall { + c.opt_["archived"] = archived + return c +} + +// CampaignIds sets the optional parameter "campaignIds": Select only +// placements that belong to these campaigns. +func (c *PlacementsListCall) CampaignIds(campaignIds int64) *PlacementsListCall { + c.opt_["campaignIds"] = campaignIds + return c +} + +// Compatibilities sets the optional parameter "compatibilities": Select +// only placements that are associated with these compatibilities. WEB +// and WEB_INTERSTITIAL refer to rendering either on desktop or on +// mobile devices for regular or interstitial ads respectively. APP and +// APP_INTERSTITIAL are for rendering in mobile apps.IN_STREAM_VIDEO +// refers to rendering in in-stream video ads developed with the VAST +// standard. +// +// Possible values: +// "APP" +// "APP_INTERSTITIAL" +// "IN_STREAM_VIDEO" +// "WEB" +// "WEB_INTERSTITIAL" +func (c *PlacementsListCall) Compatibilities(compatibilities string) *PlacementsListCall { + c.opt_["compatibilities"] = compatibilities + return c +} + +// ContentCategoryIds sets the optional parameter "contentCategoryIds": +// Select only placements that are associated with these content +// categories. +func (c *PlacementsListCall) ContentCategoryIds(contentCategoryIds int64) *PlacementsListCall { + c.opt_["contentCategoryIds"] = contentCategoryIds + return c +} + +// DirectorySiteIds sets the optional parameter "directorySiteIds": +// Select only placements that are associated with these directory +// sites. +func (c *PlacementsListCall) DirectorySiteIds(directorySiteIds int64) *PlacementsListCall { + c.opt_["directorySiteIds"] = directorySiteIds + return c +} + +// GroupIds sets the optional parameter "groupIds": Select only +// placements that belong to these placement groups. +func (c *PlacementsListCall) GroupIds(groupIds int64) *PlacementsListCall { + c.opt_["groupIds"] = groupIds + return c +} + +// Ids sets the optional parameter "ids": Select only placements with +// these IDs. +func (c *PlacementsListCall) Ids(ids int64) *PlacementsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *PlacementsListCall) MaxResults(maxResults int64) *PlacementsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *PlacementsListCall) PageToken(pageToken string) *PlacementsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// PaymentSource sets the optional parameter "paymentSource": Select +// only placements with this payment source. +// +// Possible values: +// "PLACEMENT_AGENCY_PAID" +// "PLACEMENT_PUBLISHER_PAID" +func (c *PlacementsListCall) PaymentSource(paymentSource string) *PlacementsListCall { + c.opt_["paymentSource"] = paymentSource + return c +} + +// PlacementStrategyIds sets the optional parameter +// "placementStrategyIds": Select only placements that are associated +// with these placement strategies. +func (c *PlacementsListCall) PlacementStrategyIds(placementStrategyIds int64) *PlacementsListCall { + c.opt_["placementStrategyIds"] = placementStrategyIds + return c +} + +// PricingTypes sets the optional parameter "pricingTypes": Select only +// placements with these pricing types. +// +// Possible values: +// "PRICING_TYPE_CPA" +// "PRICING_TYPE_CPC" +// "PRICING_TYPE_CPM" +// "PRICING_TYPE_FLAT_RATE_CLICKS" +// "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" +func (c *PlacementsListCall) PricingTypes(pricingTypes string) *PlacementsListCall { + c.opt_["pricingTypes"] = pricingTypes + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for placements by name or ID. Wildcards (*) are allowed. +// For example, "placement*2015" will return placements with names like +// "placement June 2015", "placement May 2015", or simply "placements +// 2015". Most of the searches also add wildcards implicitly at the +// start and the end of the search string. For example, a search string +// of "placement" will match placements with name "my placement", +// "placement 2015", or simply "placement". +func (c *PlacementsListCall) SearchString(searchString string) *PlacementsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SiteIds sets the optional parameter "siteIds": Select only placements +// that are associated with these sites. +func (c *PlacementsListCall) SiteIds(siteIds int64) *PlacementsListCall { + c.opt_["siteIds"] = siteIds + return c +} + +// SizeIds sets the optional parameter "sizeIds": Select only placements +// that are associated with these sizes. +func (c *PlacementsListCall) SizeIds(sizeIds int64) *PlacementsListCall { + c.opt_["sizeIds"] = sizeIds + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *PlacementsListCall) SortField(sortField string) *PlacementsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *PlacementsListCall) SortOrder(sortOrder string) *PlacementsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementsListCall) Fields(s ...googleapi.Field) *PlacementsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PlacementsListCall) IfNoneMatch(entityTag string) *PlacementsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementsListCall) Context(ctx context.Context) *PlacementsListCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserIds"]; ok { + params.Set("advertiserIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["archived"]; ok { + params.Set("archived", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["campaignIds"]; ok { + params.Set("campaignIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["compatibilities"]; ok { + params.Set("compatibilities", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["contentCategoryIds"]; ok { + params.Set("contentCategoryIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["directorySiteIds"]; ok { + params.Set("directorySiteIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["groupIds"]; ok { + params.Set("groupIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["paymentSource"]; ok { + params.Set("paymentSource", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["placementStrategyIds"]; ok { + params.Set("placementStrategyIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pricingTypes"]; ok { + params.Set("pricingTypes", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["siteIds"]; ok { + params.Set("siteIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sizeIds"]; ok { + params.Set("sizeIds", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placements.list" call. +// Exactly one of *PlacementsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PlacementsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementsListCall) Do() (*PlacementsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of placements, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.placements.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "advertiserIds": { + // "description": "Select only placements that belong to these advertisers.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "archived": { + // "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.", + // "location": "query", + // "type": "boolean" + // }, + // "campaignIds": { + // "description": "Select only placements that belong to these campaigns.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "compatibilities": { + // "description": "Select only placements that are associated with these compatibilities. WEB and WEB_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps.IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard.", + // "enum": [ + // "APP", + // "APP_INTERSTITIAL", + // "IN_STREAM_VIDEO", + // "WEB", + // "WEB_INTERSTITIAL" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "contentCategoryIds": { + // "description": "Select only placements that are associated with these content categories.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "directorySiteIds": { + // "description": "Select only placements that are associated with these directory sites.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "groupIds": { + // "description": "Select only placements that belong to these placement groups.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only placements with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "paymentSource": { + // "description": "Select only placements with this payment source.", + // "enum": [ + // "PLACEMENT_AGENCY_PAID", + // "PLACEMENT_PUBLISHER_PAID" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "placementStrategyIds": { + // "description": "Select only placements that are associated with these placement strategies.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "pricingTypes": { + // "description": "Select only placements with these pricing types.", + // "enum": [ + // "PRICING_TYPE_CPA", + // "PRICING_TYPE_CPC", + // "PRICING_TYPE_CPM", + // "PRICING_TYPE_FLAT_RATE_CLICKS", + // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for placements by name or ID. Wildcards (*) are allowed. For example, \"placement*2015\" will return placements with names like \"placement June 2015\", \"placement May 2015\", or simply \"placements 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"placement\" will match placements with name \"my placement\", \"placement 2015\", or simply \"placement\".", + // "location": "query", + // "type": "string" + // }, + // "siteIds": { + // "description": "Select only placements that are associated with these sites.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "sizeIds": { + // "description": "Select only placements that are associated with these sizes.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placements", + // "response": { + // "$ref": "PlacementsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placements.patch": + +type PlacementsPatchCall struct { + s *Service + profileId int64 + id int64 + placement *Placement + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing placement. This method supports patch +// semantics. +func (r *PlacementsService) Patch(profileId int64, id int64, placement *Placement) *PlacementsPatchCall { + c := &PlacementsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.placement = placement + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementsPatchCall) Fields(s ...googleapi.Field) *PlacementsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementsPatchCall) Context(ctx context.Context) *PlacementsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placements.patch" call. +// Exactly one of *Placement or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Placement.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PlacementsPatchCall) Do() (*Placement, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Placement{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing placement. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.placements.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Placement ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placements", + // "request": { + // "$ref": "Placement" + // }, + // "response": { + // "$ref": "Placement" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placements.update": + +type PlacementsUpdateCall struct { + s *Service + profileId int64 + placement *Placement + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing placement. +func (r *PlacementsService) Update(profileId int64, placement *Placement) *PlacementsUpdateCall { + c := &PlacementsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.placement = placement + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementsUpdateCall) Fields(s ...googleapi.Field) *PlacementsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementsUpdateCall) Context(ctx context.Context) *PlacementsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placements.update" call. +// Exactly one of *Placement or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Placement.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PlacementsUpdateCall) Do() (*Placement, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Placement{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing placement.", + // "httpMethod": "PUT", + // "id": "dfareporting.placements.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placements", + // "request": { + // "$ref": "Placement" + // }, + // "response": { + // "$ref": "Placement" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.platformTypes.get": + +type PlatformTypesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one platform type by ID. +func (r *PlatformTypesService) Get(profileId int64, id int64) *PlatformTypesGetCall { + c := &PlatformTypesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlatformTypesGetCall) Fields(s ...googleapi.Field) *PlatformTypesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PlatformTypesGetCall) IfNoneMatch(entityTag string) *PlatformTypesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlatformTypesGetCall) Context(ctx context.Context) *PlatformTypesGetCall { + c.ctx_ = ctx + return c +} + +func (c *PlatformTypesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/platformTypes/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.platformTypes.get" call. +// Exactly one of *PlatformType or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PlatformType.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PlatformTypesGetCall) Do() (*PlatformType, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlatformType{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one platform type by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.platformTypes.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Platform type ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/platformTypes/{id}", + // "response": { + // "$ref": "PlatformType" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.platformTypes.list": + +type PlatformTypesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of platform types. +func (r *PlatformTypesService) List(profileId int64) *PlatformTypesListCall { + c := &PlatformTypesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlatformTypesListCall) Fields(s ...googleapi.Field) *PlatformTypesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PlatformTypesListCall) IfNoneMatch(entityTag string) *PlatformTypesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlatformTypesListCall) Context(ctx context.Context) *PlatformTypesListCall { + c.ctx_ = ctx + return c +} + +func (c *PlatformTypesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/platformTypes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.platformTypes.list" call. +// Exactly one of *PlatformTypesListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *PlatformTypesListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlatformTypesListCall) Do() (*PlatformTypesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlatformTypesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of platform types.", + // "httpMethod": "GET", + // "id": "dfareporting.platformTypes.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/platformTypes", + // "response": { + // "$ref": "PlatformTypesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.postalCodes.get": + +type PostalCodesGetCall struct { + s *Service + profileId int64 + code string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one postal code by ID. +func (r *PostalCodesService) Get(profileId int64, code string) *PostalCodesGetCall { + c := &PostalCodesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.code = code + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostalCodesGetCall) Fields(s ...googleapi.Field) *PostalCodesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PostalCodesGetCall) IfNoneMatch(entityTag string) *PostalCodesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostalCodesGetCall) Context(ctx context.Context) *PostalCodesGetCall { + c.ctx_ = ctx + return c +} + +func (c *PostalCodesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/postalCodes/{code}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "code": c.code, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.postalCodes.get" call. +// Exactly one of *PostalCode or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PostalCode.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PostalCodesGetCall) Do() (*PostalCode, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PostalCode{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one postal code by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.postalCodes.get", + // "parameterOrder": [ + // "profileId", + // "code" + // ], + // "parameters": { + // "code": { + // "description": "Postal code ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/postalCodes/{code}", + // "response": { + // "$ref": "PostalCode" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.postalCodes.list": + +type PostalCodesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of postal codes. +func (r *PostalCodesService) List(profileId int64) *PostalCodesListCall { + c := &PostalCodesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostalCodesListCall) Fields(s ...googleapi.Field) *PostalCodesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PostalCodesListCall) IfNoneMatch(entityTag string) *PostalCodesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostalCodesListCall) Context(ctx context.Context) *PostalCodesListCall { + c.ctx_ = ctx + return c +} + +func (c *PostalCodesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/postalCodes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.postalCodes.list" call. +// Exactly one of *PostalCodesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PostalCodesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PostalCodesListCall) Do() (*PostalCodesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PostalCodesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of postal codes.", + // "httpMethod": "GET", + // "id": "dfareporting.postalCodes.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/postalCodes", + // "response": { + // "$ref": "PostalCodesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.projects.get": + +type ProjectsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one project by ID. +func (r *ProjectsService) Get(profileId int64, id int64) *ProjectsGetCall { + c := &ProjectsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.projects.get" call. +// Exactly one of *Project or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Project.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsGetCall) Do() (*Project, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Project{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one project by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.projects.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Project ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/projects/{id}", + // "response": { + // "$ref": "Project" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.projects.list": + +type ProjectsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of projects, possibly filtered. +func (r *ProjectsService) List(profileId int64) *ProjectsListCall { + c := &ProjectsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdvertiserIds sets the optional parameter "advertiserIds": Select +// only projects with these advertiser IDs. +func (c *ProjectsListCall) AdvertiserIds(advertiserIds int64) *ProjectsListCall { + c.opt_["advertiserIds"] = advertiserIds + return c +} + +// Ids sets the optional parameter "ids": Select only projects with +// these IDs. +func (c *ProjectsListCall) Ids(ids int64) *ProjectsListCall { + c.opt_["ids"] = ids + 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": Value of the +// nextPageToken from the previous result page. +func (c *ProjectsListCall) PageToken(pageToken string) *ProjectsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for projects by name or ID. Wildcards (*) are allowed. For +// example, "project*2015" will return projects with names like "project +// June 2015", "project April 2015", or simply "project 2015". Most of +// the searches also add wildcards implicitly at the start and the end +// of the search string. For example, a search string of "project" will +// match projects with name "my project", "project 2015", or simply +// "project". +func (c *ProjectsListCall) SearchString(searchString string) *ProjectsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *ProjectsListCall) SortField(sortField string) *ProjectsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *ProjectsListCall) SortOrder(sortOrder string) *ProjectsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsListCall) Fields(s ...googleapi.Field) *ProjectsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsListCall) IfNoneMatch(entityTag string) *ProjectsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsListCall) Context(ctx context.Context) *ProjectsListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserIds"]; ok { + params.Set("advertiserIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.projects.list" call. +// Exactly one of *ProjectsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ProjectsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsListCall) Do() (*ProjectsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProjectsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of projects, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.projects.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "advertiserIds": { + // "description": "Select only projects with these advertiser IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only projects with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for projects by name or ID. Wildcards (*) are allowed. For example, \"project*2015\" will return projects with names like \"project June 2015\", \"project April 2015\", or simply \"project 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"project\" will match projects with name \"my project\", \"project 2015\", or simply \"project\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/projects", + // "response": { + // "$ref": "ProjectsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.regions.list": + +type RegionsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of regions. +func (r *RegionsService) List(profileId int64) *RegionsListCall { + c := &RegionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall { + c.ctx_ = ctx + return c +} + +func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/regions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.regions.list" call. +// Exactly one of *RegionsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *RegionsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RegionsListCall) Do() (*RegionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RegionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of regions.", + // "httpMethod": "GET", + // "id": "dfareporting.regions.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/regions", + // "response": { + // "$ref": "RegionsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.remarketingListShares.get": + +type RemarketingListSharesGetCall struct { + s *Service + profileId int64 + remarketingListId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one remarketing list share by remarketing list ID. +func (r *RemarketingListSharesService) Get(profileId int64, remarketingListId int64) *RemarketingListSharesGetCall { + c := &RemarketingListSharesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.remarketingListId = remarketingListId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RemarketingListSharesGetCall) Fields(s ...googleapi.Field) *RemarketingListSharesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RemarketingListSharesGetCall) IfNoneMatch(entityTag string) *RemarketingListSharesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RemarketingListSharesGetCall) Context(ctx context.Context) *RemarketingListSharesGetCall { + c.ctx_ = ctx + return c +} + +func (c *RemarketingListSharesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares/{remarketingListId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "remarketingListId": strconv.FormatInt(c.remarketingListId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.remarketingListShares.get" call. +// Exactly one of *RemarketingListShare or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *RemarketingListShare.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RemarketingListSharesGetCall) Do() (*RemarketingListShare, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RemarketingListShare{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one remarketing list share by remarketing list ID.", + // "httpMethod": "GET", + // "id": "dfareporting.remarketingListShares.get", + // "parameterOrder": [ + // "profileId", + // "remarketingListId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "remarketingListId": { + // "description": "Remarketing list ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/remarketingListShares/{remarketingListId}", + // "response": { + // "$ref": "RemarketingListShare" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.remarketingListShares.patch": + +type RemarketingListSharesPatchCall struct { + s *Service + profileId int64 + remarketingListId int64 + remarketinglistshare *RemarketingListShare + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing remarketing list share. This method +// supports patch semantics. +func (r *RemarketingListSharesService) Patch(profileId int64, remarketingListId int64, remarketinglistshare *RemarketingListShare) *RemarketingListSharesPatchCall { + c := &RemarketingListSharesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.remarketingListId = remarketingListId + c.remarketinglistshare = remarketinglistshare + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RemarketingListSharesPatchCall) Fields(s ...googleapi.Field) *RemarketingListSharesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RemarketingListSharesPatchCall) Context(ctx context.Context) *RemarketingListSharesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *RemarketingListSharesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglistshare) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("remarketingListId", fmt.Sprintf("%v", c.remarketingListId)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.remarketingListShares.patch" call. +// Exactly one of *RemarketingListShare or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *RemarketingListShare.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RemarketingListSharesPatchCall) Do() (*RemarketingListShare, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RemarketingListShare{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing remarketing list share. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.remarketingListShares.patch", + // "parameterOrder": [ + // "profileId", + // "remarketingListId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "remarketingListId": { + // "description": "Remarketing list ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/remarketingListShares", + // "request": { + // "$ref": "RemarketingListShare" + // }, + // "response": { + // "$ref": "RemarketingListShare" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.remarketingListShares.update": + +type RemarketingListSharesUpdateCall struct { + s *Service + profileId int64 + remarketinglistshare *RemarketingListShare + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing remarketing list share. +func (r *RemarketingListSharesService) Update(profileId int64, remarketinglistshare *RemarketingListShare) *RemarketingListSharesUpdateCall { + c := &RemarketingListSharesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.remarketinglistshare = remarketinglistshare + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RemarketingListSharesUpdateCall) Fields(s ...googleapi.Field) *RemarketingListSharesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RemarketingListSharesUpdateCall) Context(ctx context.Context) *RemarketingListSharesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *RemarketingListSharesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglistshare) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.remarketingListShares.update" call. +// Exactly one of *RemarketingListShare or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *RemarketingListShare.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RemarketingListSharesUpdateCall) Do() (*RemarketingListShare, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RemarketingListShare{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing remarketing list share.", + // "httpMethod": "PUT", + // "id": "dfareporting.remarketingListShares.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/remarketingListShares", + // "request": { + // "$ref": "RemarketingListShare" + // }, + // "response": { + // "$ref": "RemarketingListShare" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.remarketingLists.get": + +type RemarketingListsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one remarketing list by ID. +func (r *RemarketingListsService) Get(profileId int64, id int64) *RemarketingListsGetCall { + c := &RemarketingListsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RemarketingListsGetCall) Fields(s ...googleapi.Field) *RemarketingListsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RemarketingListsGetCall) IfNoneMatch(entityTag string) *RemarketingListsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RemarketingListsGetCall) Context(ctx context.Context) *RemarketingListsGetCall { + c.ctx_ = ctx + return c +} + +func (c *RemarketingListsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.remarketingLists.get" call. +// Exactly one of *RemarketingList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *RemarketingList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RemarketingListsGetCall) Do() (*RemarketingList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RemarketingList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one remarketing list by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.remarketingLists.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Remarketing list ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/remarketingLists/{id}", + // "response": { + // "$ref": "RemarketingList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.remarketingLists.insert": + +type RemarketingListsInsertCall struct { + s *Service + profileId int64 + remarketinglist *RemarketingList + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new remarketing list. +func (r *RemarketingListsService) Insert(profileId int64, remarketinglist *RemarketingList) *RemarketingListsInsertCall { + c := &RemarketingListsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.remarketinglist = remarketinglist + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RemarketingListsInsertCall) Fields(s ...googleapi.Field) *RemarketingListsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RemarketingListsInsertCall) Context(ctx context.Context) *RemarketingListsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *RemarketingListsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.remarketingLists.insert" call. +// Exactly one of *RemarketingList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *RemarketingList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RemarketingListsInsertCall) Do() (*RemarketingList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RemarketingList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new remarketing list.", + // "httpMethod": "POST", + // "id": "dfareporting.remarketingLists.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/remarketingLists", + // "request": { + // "$ref": "RemarketingList" + // }, + // "response": { + // "$ref": "RemarketingList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.remarketingLists.list": + +type RemarketingListsListCall struct { + s *Service + profileId int64 + advertiserId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of remarketing lists, possibly filtered. +func (r *RemarketingListsService) List(profileId int64, advertiserId int64) *RemarketingListsListCall { + c := &RemarketingListsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.advertiserId = advertiserId + return c +} + +// Active sets the optional parameter "active": Select only active or +// only inactive remarketing lists. +func (c *RemarketingListsListCall) Active(active bool) *RemarketingListsListCall { + c.opt_["active"] = active + return c +} + +// FloodlightActivityId sets the optional parameter +// "floodlightActivityId": Select only remarketing lists that have this +// floodlight activity ID. +func (c *RemarketingListsListCall) FloodlightActivityId(floodlightActivityId int64) *RemarketingListsListCall { + c.opt_["floodlightActivityId"] = floodlightActivityId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *RemarketingListsListCall) MaxResults(maxResults int64) *RemarketingListsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// Name sets the optional parameter "name": Allows searching for objects +// by name or ID. Wildcards (*) are allowed. For example, "remarketing +// list*2015" will return objects with names like "remarketing list June +// 2015", "remarketing list April 2015", or simply "remarketing list +// 2015". Most of the searches also add wildcards implicitly at the +// start and the end of the search string. For example, a search string +// of "remarketing list" will match objects with name "my remarketing +// list", "remarketing list 2015", or simply "remarketing list". +func (c *RemarketingListsListCall) Name(name string) *RemarketingListsListCall { + c.opt_["name"] = name + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *RemarketingListsListCall) PageToken(pageToken string) *RemarketingListsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *RemarketingListsListCall) SortField(sortField string) *RemarketingListsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *RemarketingListsListCall) SortOrder(sortOrder string) *RemarketingListsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RemarketingListsListCall) Fields(s ...googleapi.Field) *RemarketingListsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RemarketingListsListCall) IfNoneMatch(entityTag string) *RemarketingListsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RemarketingListsListCall) Context(ctx context.Context) *RemarketingListsListCall { + c.ctx_ = ctx + return c +} + +func (c *RemarketingListsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("advertiserId", fmt.Sprintf("%v", c.advertiserId)) + if v, ok := c.opt_["active"]; ok { + params.Set("active", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["floodlightActivityId"]; ok { + params.Set("floodlightActivityId", fmt.Sprintf("%v", v)) + } + 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_["sortField"]; ok { + params.Set("sortField", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortOrder"]; ok { + params.Set("sortOrder", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.remarketingLists.list" call. +// Exactly one of *RemarketingListsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *RemarketingListsListResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RemarketingListsListCall) Do() (*RemarketingListsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RemarketingListsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of remarketing lists, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.remarketingLists.list", + // "parameterOrder": [ + // "profileId", + // "advertiserId" + // ], + // "parameters": { + // "active": { + // "description": "Select only active or only inactive remarketing lists.", + // "location": "query", + // "type": "boolean" + // }, + // "advertiserId": { + // "description": "Select only remarketing lists owned by this advertiser.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "floodlightActivityId": { + // "description": "Select only remarketing lists that have this floodlight activity ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "name": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"remarketing list*2015\" will return objects with names like \"remarketing list June 2015\", \"remarketing list April 2015\", or simply \"remarketing list 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"remarketing list\" will match objects with name \"my remarketing list\", \"remarketing list 2015\", or simply \"remarketing list\".", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/remarketingLists", + // "response": { + // "$ref": "RemarketingListsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.remarketingLists.patch": + +type RemarketingListsPatchCall struct { + s *Service + profileId int64 + id int64 + remarketinglist *RemarketingList + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing remarketing list. This method supports +// patch semantics. +func (r *RemarketingListsService) Patch(profileId int64, id int64, remarketinglist *RemarketingList) *RemarketingListsPatchCall { + c := &RemarketingListsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.remarketinglist = remarketinglist + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RemarketingListsPatchCall) Fields(s ...googleapi.Field) *RemarketingListsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RemarketingListsPatchCall) Context(ctx context.Context) *RemarketingListsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *RemarketingListsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.remarketingLists.patch" call. +// Exactly one of *RemarketingList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *RemarketingList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RemarketingListsPatchCall) Do() (*RemarketingList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RemarketingList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing remarketing list. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.remarketingLists.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Remarketing list ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/remarketingLists", + // "request": { + // "$ref": "RemarketingList" + // }, + // "response": { + // "$ref": "RemarketingList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.remarketingLists.update": + +type RemarketingListsUpdateCall struct { + s *Service + profileId int64 + remarketinglist *RemarketingList + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing remarketing list. +func (r *RemarketingListsService) Update(profileId int64, remarketinglist *RemarketingList) *RemarketingListsUpdateCall { + c := &RemarketingListsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.remarketinglist = remarketinglist + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RemarketingListsUpdateCall) Fields(s ...googleapi.Field) *RemarketingListsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RemarketingListsUpdateCall) Context(ctx context.Context) *RemarketingListsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *RemarketingListsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.remarketingLists.update" call. +// Exactly one of *RemarketingList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *RemarketingList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RemarketingListsUpdateCall) Do() (*RemarketingList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RemarketingList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing remarketing list.", + // "httpMethod": "PUT", + // "id": "dfareporting.remarketingLists.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/remarketingLists", + // "request": { + // "$ref": "RemarketingList" + // }, + // "response": { + // "$ref": "RemarketingList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.reports.delete": + +type ReportsDeleteCall struct { + s *Service + profileId int64 + reportId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsDeleteCall) Fields(s ...googleapi.Field) *ReportsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsDeleteCall) Context(ctx context.Context) *ReportsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.delete" call. +func (c *ReportsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsGetCall) Fields(s ...googleapi.Field) *ReportsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsGetCall) IfNoneMatch(entityTag string) *ReportsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsGetCall) Context(ctx context.Context) *ReportsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.get" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsGetCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsInsertCall) Fields(s ...googleapi.Field) *ReportsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsInsertCall) Context(ctx context.Context) *ReportsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.insert" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsInsertCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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'. +// +// Possible values: +// "ALL" - All reports in account. +// "MINE" (default) - My reports. +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. +// +// Possible values: +// "ID" - Sort by report ID. +// "LAST_MODIFIED_TIME" (default) - Sort by 'lastModifiedTime' field. +// "NAME" - Sort by name of reports. +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'. +// +// Possible values: +// "ASCENDING" - Ascending order. +// "DESCENDING" (default) - Descending order. +func (c *ReportsListCall) SortOrder(sortOrder string) *ReportsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsListCall) Fields(s ...googleapi.Field) *ReportsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsListCall) IfNoneMatch(entityTag string) *ReportsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsListCall) Context(ctx context.Context) *ReportsListCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.list" call. +// Exactly one of *ReportList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ReportList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReportsListCall) Do() (*ReportList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ReportList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsPatchCall) Fields(s ...googleapi.Field) *ReportsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsPatchCall) Context(ctx context.Context) *ReportsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.patch" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsPatchCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsRunCall) Fields(s ...googleapi.Field) *ReportsRunCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsRunCall) Context(ctx context.Context) *ReportsRunCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsRunCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["synchronous"]; ok { + params.Set("synchronous", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/run") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.run" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ReportsRunCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsUpdateCall) Fields(s ...googleapi.Field) *ReportsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsUpdateCall) Context(ctx context.Context) *ReportsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.update" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsUpdateCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsCompatibleFieldsQueryCall) Fields(s ...googleapi.Field) *ReportsCompatibleFieldsQueryCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsCompatibleFieldsQueryCall) Context(ctx context.Context) *ReportsCompatibleFieldsQueryCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsCompatibleFieldsQueryCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/compatiblefields/query") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.compatibleFields.query" call. +// Exactly one of *CompatibleFields or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CompatibleFields.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReportsCompatibleFieldsQueryCall) Do() (*CompatibleFields, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CompatibleFields{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsFilesGetCall) Fields(s ...googleapi.Field) *ReportsFilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsFilesGetCall) IfNoneMatch(entityTag string) *ReportsFilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsFilesGetCall) Context(ctx context.Context) *ReportsFilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsFilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files/{fileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + "fileId": strconv.FormatInt(c.fileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *ReportsFilesGetCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "dfareporting.reports.files.get" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ReportsFilesGetCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "ID" - Sort by file ID. +// "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field. +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'. +// +// Possible values: +// "ASCENDING" - Ascending order. +// "DESCENDING" (default) - Descending order. +func (c *ReportsFilesListCall) SortOrder(sortOrder string) *ReportsFilesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsFilesListCall) Fields(s ...googleapi.Field) *ReportsFilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsFilesListCall) IfNoneMatch(entityTag string) *ReportsFilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsFilesListCall) Context(ctx context.Context) *ReportsFilesListCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsFilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.files.list" call. +// Exactly one of *FileList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *FileList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReportsFilesListCall) Do() (*FileList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FileList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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.sites.get": + +type SitesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one site by ID. +func (r *SitesService) Get(profileId int64, id int64) *SitesGetCall { + c := &SitesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SitesGetCall) Fields(s ...googleapi.Field) *SitesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SitesGetCall) IfNoneMatch(entityTag string) *SitesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SitesGetCall) Context(ctx context.Context) *SitesGetCall { + c.ctx_ = ctx + return c +} + +func (c *SitesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.sites.get" call. +// Exactly one of *Site or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Site.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *SitesGetCall) Do() (*Site, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Site{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one site by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.sites.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Site ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/sites/{id}", + // "response": { + // "$ref": "Site" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.sites.insert": + +type SitesInsertCall struct { + s *Service + profileId int64 + site *Site + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new site. +func (r *SitesService) Insert(profileId int64, site *Site) *SitesInsertCall { + c := &SitesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.site = site + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SitesInsertCall) Fields(s ...googleapi.Field) *SitesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SitesInsertCall) Context(ctx context.Context) *SitesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *SitesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.site) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.sites.insert" call. +// Exactly one of *Site or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Site.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *SitesInsertCall) Do() (*Site, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Site{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new site.", + // "httpMethod": "POST", + // "id": "dfareporting.sites.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/sites", + // "request": { + // "$ref": "Site" + // }, + // "response": { + // "$ref": "Site" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.sites.list": + +type SitesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of sites, possibly filtered. +func (r *SitesService) List(profileId int64) *SitesListCall { + c := &SitesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AcceptsInStreamVideoPlacements sets the optional parameter +// "acceptsInStreamVideoPlacements": This search filter is no longer +// supported and will have no effect on the results returned. +func (c *SitesListCall) AcceptsInStreamVideoPlacements(acceptsInStreamVideoPlacements bool) *SitesListCall { + c.opt_["acceptsInStreamVideoPlacements"] = acceptsInStreamVideoPlacements + return c +} + +// AcceptsInterstitialPlacements sets the optional parameter +// "acceptsInterstitialPlacements": This search filter is no longer +// supported and will have no effect on the results returned. +func (c *SitesListCall) AcceptsInterstitialPlacements(acceptsInterstitialPlacements bool) *SitesListCall { + c.opt_["acceptsInterstitialPlacements"] = acceptsInterstitialPlacements + return c +} + +// AcceptsPublisherPaidPlacements sets the optional parameter +// "acceptsPublisherPaidPlacements": Select only sites that accept +// publisher paid placements. +func (c *SitesListCall) AcceptsPublisherPaidPlacements(acceptsPublisherPaidPlacements bool) *SitesListCall { + c.opt_["acceptsPublisherPaidPlacements"] = acceptsPublisherPaidPlacements + return c +} + +// AdWordsSite sets the optional parameter "adWordsSite": Select only +// AdWords sites. +func (c *SitesListCall) AdWordsSite(adWordsSite bool) *SitesListCall { + c.opt_["adWordsSite"] = adWordsSite + return c +} + +// Approved sets the optional parameter "approved": Select only approved +// sites. +func (c *SitesListCall) Approved(approved bool) *SitesListCall { + c.opt_["approved"] = approved + return c +} + +// CampaignIds sets the optional parameter "campaignIds": Select only +// sites with these campaign IDs. +func (c *SitesListCall) CampaignIds(campaignIds int64) *SitesListCall { + c.opt_["campaignIds"] = campaignIds + return c +} + +// DirectorySiteIds sets the optional parameter "directorySiteIds": +// Select only sites with these directory site IDs. +func (c *SitesListCall) DirectorySiteIds(directorySiteIds int64) *SitesListCall { + c.opt_["directorySiteIds"] = directorySiteIds + return c +} + +// Ids sets the optional parameter "ids": Select only sites with these +// IDs. +func (c *SitesListCall) Ids(ids int64) *SitesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *SitesListCall) MaxResults(maxResults int64) *SitesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *SitesListCall) PageToken(pageToken string) *SitesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name, ID or keyName. Wildcards (*) are +// allowed. For example, "site*2015" will return objects with names like +// "site June 2015", "site April 2015", or simply "site 2015". Most of +// the searches also add wildcards implicitly at the start and the end +// of the search string. For example, a search string of "site" will +// match objects with name "my site", "site 2015", or simply "site". +func (c *SitesListCall) SearchString(searchString string) *SitesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *SitesListCall) SortField(sortField string) *SitesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *SitesListCall) SortOrder(sortOrder string) *SitesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// SubaccountId sets the optional parameter "subaccountId": Select only +// sites with this subaccount ID. +func (c *SitesListCall) SubaccountId(subaccountId int64) *SitesListCall { + c.opt_["subaccountId"] = subaccountId + return c +} + +// UnmappedSite sets the optional parameter "unmappedSite": Select only +// sites that have not been mapped to a directory site. +func (c *SitesListCall) UnmappedSite(unmappedSite bool) *SitesListCall { + c.opt_["unmappedSite"] = unmappedSite + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SitesListCall) Fields(s ...googleapi.Field) *SitesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SitesListCall) IfNoneMatch(entityTag string) *SitesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SitesListCall) Context(ctx context.Context) *SitesListCall { + c.ctx_ = ctx + return c +} + +func (c *SitesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["acceptsInStreamVideoPlacements"]; ok { + params.Set("acceptsInStreamVideoPlacements", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["acceptsInterstitialPlacements"]; ok { + params.Set("acceptsInterstitialPlacements", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["acceptsPublisherPaidPlacements"]; ok { + params.Set("acceptsPublisherPaidPlacements", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["adWordsSite"]; ok { + params.Set("adWordsSite", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["approved"]; ok { + params.Set("approved", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["campaignIds"]; ok { + params.Set("campaignIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["directorySiteIds"]; ok { + params.Set("directorySiteIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["subaccountId"]; ok { + params.Set("subaccountId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["unmappedSite"]; ok { + params.Set("unmappedSite", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.sites.list" call. +// Exactly one of *SitesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SitesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SitesListCall) Do() (*SitesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SitesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of sites, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.sites.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "acceptsInStreamVideoPlacements": { + // "description": "This search filter is no longer supported and will have no effect on the results returned.", + // "location": "query", + // "type": "boolean" + // }, + // "acceptsInterstitialPlacements": { + // "description": "This search filter is no longer supported and will have no effect on the results returned.", + // "location": "query", + // "type": "boolean" + // }, + // "acceptsPublisherPaidPlacements": { + // "description": "Select only sites that accept publisher paid placements.", + // "location": "query", + // "type": "boolean" + // }, + // "adWordsSite": { + // "description": "Select only AdWords sites.", + // "location": "query", + // "type": "boolean" + // }, + // "approved": { + // "description": "Select only approved sites.", + // "location": "query", + // "type": "boolean" + // }, + // "campaignIds": { + // "description": "Select only sites with these campaign IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "directorySiteIds": { + // "description": "Select only sites with these directory site IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only sites with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name, ID or keyName. Wildcards (*) are allowed. For example, \"site*2015\" will return objects with names like \"site June 2015\", \"site April 2015\", or simply \"site 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"site\" will match objects with name \"my site\", \"site 2015\", or simply \"site\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "subaccountId": { + // "description": "Select only sites with this subaccount ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "unmappedSite": { + // "description": "Select only sites that have not been mapped to a directory site.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "userprofiles/{profileId}/sites", + // "response": { + // "$ref": "SitesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.sites.patch": + +type SitesPatchCall struct { + s *Service + profileId int64 + id int64 + site *Site + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing site. This method supports patch +// semantics. +func (r *SitesService) Patch(profileId int64, id int64, site *Site) *SitesPatchCall { + c := &SitesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.site = site + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SitesPatchCall) Fields(s ...googleapi.Field) *SitesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SitesPatchCall) Context(ctx context.Context) *SitesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *SitesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.site) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.sites.patch" call. +// Exactly one of *Site or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Site.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *SitesPatchCall) Do() (*Site, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Site{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing site. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.sites.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Site ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/sites", + // "request": { + // "$ref": "Site" + // }, + // "response": { + // "$ref": "Site" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.sites.update": + +type SitesUpdateCall struct { + s *Service + profileId int64 + site *Site + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing site. +func (r *SitesService) Update(profileId int64, site *Site) *SitesUpdateCall { + c := &SitesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.site = site + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SitesUpdateCall) Fields(s ...googleapi.Field) *SitesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SitesUpdateCall) Context(ctx context.Context) *SitesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *SitesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.site) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.sites.update" call. +// Exactly one of *Site or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Site.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *SitesUpdateCall) Do() (*Site, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Site{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing site.", + // "httpMethod": "PUT", + // "id": "dfareporting.sites.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/sites", + // "request": { + // "$ref": "Site" + // }, + // "response": { + // "$ref": "Site" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.sizes.get": + +type SizesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one size by ID. +func (r *SizesService) Get(profileId int64, id int64) *SizesGetCall { + c := &SizesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SizesGetCall) Fields(s ...googleapi.Field) *SizesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SizesGetCall) IfNoneMatch(entityTag string) *SizesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SizesGetCall) Context(ctx context.Context) *SizesGetCall { + c.ctx_ = ctx + return c +} + +func (c *SizesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.sizes.get" call. +// Exactly one of *Size or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Size.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *SizesGetCall) Do() (*Size, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Size{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one size by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.sizes.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Size ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/sizes/{id}", + // "response": { + // "$ref": "Size" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.sizes.insert": + +type SizesInsertCall struct { + s *Service + profileId int64 + size *Size + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new size. +func (r *SizesService) Insert(profileId int64, size *Size) *SizesInsertCall { + c := &SizesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.size = size + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SizesInsertCall) Fields(s ...googleapi.Field) *SizesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SizesInsertCall) Context(ctx context.Context) *SizesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *SizesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.size) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.sizes.insert" call. +// Exactly one of *Size or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Size.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *SizesInsertCall) Do() (*Size, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Size{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new size.", + // "httpMethod": "POST", + // "id": "dfareporting.sizes.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/sizes", + // "request": { + // "$ref": "Size" + // }, + // "response": { + // "$ref": "Size" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.sizes.list": + +type SizesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of sizes, possibly filtered. +func (r *SizesService) List(profileId int64) *SizesListCall { + c := &SizesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Height sets the optional parameter "height": Select only sizes with +// this height. +func (c *SizesListCall) Height(height int64) *SizesListCall { + c.opt_["height"] = height + return c +} + +// IabStandard sets the optional parameter "iabStandard": Select only +// IAB standard sizes. +func (c *SizesListCall) IabStandard(iabStandard bool) *SizesListCall { + c.opt_["iabStandard"] = iabStandard + return c +} + +// Ids sets the optional parameter "ids": Select only sizes with these +// IDs. +func (c *SizesListCall) Ids(ids int64) *SizesListCall { + c.opt_["ids"] = ids + return c +} + +// Width sets the optional parameter "width": Select only sizes with +// this width. +func (c *SizesListCall) Width(width int64) *SizesListCall { + c.opt_["width"] = width + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SizesListCall) Fields(s ...googleapi.Field) *SizesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SizesListCall) IfNoneMatch(entityTag string) *SizesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SizesListCall) Context(ctx context.Context) *SizesListCall { + c.ctx_ = ctx + return c +} + +func (c *SizesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["height"]; ok { + params.Set("height", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["iabStandard"]; ok { + params.Set("iabStandard", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["width"]; ok { + params.Set("width", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.sizes.list" call. +// Exactly one of *SizesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SizesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SizesListCall) Do() (*SizesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SizesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of sizes, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.sizes.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "height": { + // "description": "Select only sizes with this height.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "iabStandard": { + // "description": "Select only IAB standard sizes.", + // "location": "query", + // "type": "boolean" + // }, + // "ids": { + // "description": "Select only sizes with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "width": { + // "description": "Select only sizes with this width.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // } + // }, + // "path": "userprofiles/{profileId}/sizes", + // "response": { + // "$ref": "SizesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.subaccounts.get": + +type SubaccountsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one subaccount by ID. +func (r *SubaccountsService) Get(profileId int64, id int64) *SubaccountsGetCall { + c := &SubaccountsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubaccountsGetCall) Fields(s ...googleapi.Field) *SubaccountsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SubaccountsGetCall) IfNoneMatch(entityTag string) *SubaccountsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubaccountsGetCall) Context(ctx context.Context) *SubaccountsGetCall { + c.ctx_ = ctx + return c +} + +func (c *SubaccountsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.subaccounts.get" call. +// Exactly one of *Subaccount or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subaccount.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubaccountsGetCall) Do() (*Subaccount, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subaccount{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one subaccount by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.subaccounts.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Subaccount ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/subaccounts/{id}", + // "response": { + // "$ref": "Subaccount" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.subaccounts.insert": + +type SubaccountsInsertCall struct { + s *Service + profileId int64 + subaccount *Subaccount + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new subaccount. +func (r *SubaccountsService) Insert(profileId int64, subaccount *Subaccount) *SubaccountsInsertCall { + c := &SubaccountsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.subaccount = subaccount + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubaccountsInsertCall) Fields(s ...googleapi.Field) *SubaccountsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubaccountsInsertCall) Context(ctx context.Context) *SubaccountsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *SubaccountsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.subaccounts.insert" call. +// Exactly one of *Subaccount or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subaccount.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubaccountsInsertCall) Do() (*Subaccount, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subaccount{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new subaccount.", + // "httpMethod": "POST", + // "id": "dfareporting.subaccounts.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/subaccounts", + // "request": { + // "$ref": "Subaccount" + // }, + // "response": { + // "$ref": "Subaccount" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.subaccounts.list": + +type SubaccountsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Gets a list of subaccounts, possibly filtered. +func (r *SubaccountsService) List(profileId int64) *SubaccountsListCall { + c := &SubaccountsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Ids sets the optional parameter "ids": Select only subaccounts with +// these IDs. +func (c *SubaccountsListCall) Ids(ids int64) *SubaccountsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *SubaccountsListCall) MaxResults(maxResults int64) *SubaccountsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *SubaccountsListCall) PageToken(pageToken string) *SubaccountsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "subaccount*2015" will return objects with names like +// "subaccount June 2015", "subaccount April 2015", or simply +// "subaccount 2015". Most of the searches also add wildcards implicitly +// at the start and the end of the search string. For example, a search +// string of "subaccount" will match objects with name "my subaccount", +// "subaccount 2015", or simply "subaccount". +func (c *SubaccountsListCall) SearchString(searchString string) *SubaccountsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *SubaccountsListCall) SortField(sortField string) *SubaccountsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *SubaccountsListCall) SortOrder(sortOrder string) *SubaccountsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubaccountsListCall) Fields(s ...googleapi.Field) *SubaccountsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SubaccountsListCall) IfNoneMatch(entityTag string) *SubaccountsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubaccountsListCall) Context(ctx context.Context) *SubaccountsListCall { + c.ctx_ = ctx + return c +} + +func (c *SubaccountsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.subaccounts.list" call. +// Exactly one of *SubaccountsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SubaccountsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SubaccountsListCall) Do() (*SubaccountsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SubaccountsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a list of subaccounts, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.subaccounts.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "ids": { + // "description": "Select only subaccounts with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"subaccount*2015\" will return objects with names like \"subaccount June 2015\", \"subaccount April 2015\", or simply \"subaccount 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"subaccount\" will match objects with name \"my subaccount\", \"subaccount 2015\", or simply \"subaccount\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/subaccounts", + // "response": { + // "$ref": "SubaccountsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.subaccounts.patch": + +type SubaccountsPatchCall struct { + s *Service + profileId int64 + id int64 + subaccount *Subaccount + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing subaccount. This method supports patch +// semantics. +func (r *SubaccountsService) Patch(profileId int64, id int64, subaccount *Subaccount) *SubaccountsPatchCall { + c := &SubaccountsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.subaccount = subaccount + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubaccountsPatchCall) Fields(s ...googleapi.Field) *SubaccountsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubaccountsPatchCall) Context(ctx context.Context) *SubaccountsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *SubaccountsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.subaccounts.patch" call. +// Exactly one of *Subaccount or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subaccount.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubaccountsPatchCall) Do() (*Subaccount, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subaccount{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing subaccount. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.subaccounts.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Subaccount ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/subaccounts", + // "request": { + // "$ref": "Subaccount" + // }, + // "response": { + // "$ref": "Subaccount" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.subaccounts.update": + +type SubaccountsUpdateCall struct { + s *Service + profileId int64 + subaccount *Subaccount + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing subaccount. +func (r *SubaccountsService) Update(profileId int64, subaccount *Subaccount) *SubaccountsUpdateCall { + c := &SubaccountsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.subaccount = subaccount + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubaccountsUpdateCall) Fields(s ...googleapi.Field) *SubaccountsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubaccountsUpdateCall) Context(ctx context.Context) *SubaccountsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *SubaccountsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.subaccounts.update" call. +// Exactly one of *Subaccount or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subaccount.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubaccountsUpdateCall) Do() (*Subaccount, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subaccount{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing subaccount.", + // "httpMethod": "PUT", + // "id": "dfareporting.subaccounts.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/subaccounts", + // "request": { + // "$ref": "Subaccount" + // }, + // "response": { + // "$ref": "Subaccount" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.targetableRemarketingLists.get": + +type TargetableRemarketingListsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one remarketing list by ID. +func (r *TargetableRemarketingListsService) Get(profileId int64, id int64) *TargetableRemarketingListsGetCall { + c := &TargetableRemarketingListsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetableRemarketingListsGetCall) Fields(s ...googleapi.Field) *TargetableRemarketingListsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetableRemarketingListsGetCall) IfNoneMatch(entityTag string) *TargetableRemarketingListsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetableRemarketingListsGetCall) Context(ctx context.Context) *TargetableRemarketingListsGetCall { + c.ctx_ = ctx + return c +} + +func (c *TargetableRemarketingListsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetableRemarketingLists/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.targetableRemarketingLists.get" call. +// Exactly one of *TargetableRemarketingList or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TargetableRemarketingList.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetableRemarketingListsGetCall) Do() (*TargetableRemarketingList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetableRemarketingList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one remarketing list by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.targetableRemarketingLists.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Remarketing list ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/targetableRemarketingLists/{id}", + // "response": { + // "$ref": "TargetableRemarketingList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.targetableRemarketingLists.list": + +type TargetableRemarketingListsListCall struct { + s *Service + profileId int64 + advertiserId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of targetable remarketing lists, possibly +// filtered. +func (r *TargetableRemarketingListsService) List(profileId int64, advertiserId int64) *TargetableRemarketingListsListCall { + c := &TargetableRemarketingListsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.advertiserId = advertiserId + return c +} + +// Active sets the optional parameter "active": Select only active or +// only inactive targetable remarketing lists. +func (c *TargetableRemarketingListsListCall) Active(active bool) *TargetableRemarketingListsListCall { + c.opt_["active"] = active + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *TargetableRemarketingListsListCall) MaxResults(maxResults int64) *TargetableRemarketingListsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// Name sets the optional parameter "name": Allows searching for objects +// by name or ID. Wildcards (*) are allowed. For example, "remarketing +// list*2015" will return objects with names like "remarketing list June +// 2015", "remarketing list April 2015", or simply "remarketing list +// 2015". Most of the searches also add wildcards implicitly at the +// start and the end of the search string. For example, a search string +// of "remarketing list" will match objects with name "my remarketing +// list", "remarketing list 2015", or simply "remarketing list". +func (c *TargetableRemarketingListsListCall) Name(name string) *TargetableRemarketingListsListCall { + c.opt_["name"] = name + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *TargetableRemarketingListsListCall) PageToken(pageToken string) *TargetableRemarketingListsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *TargetableRemarketingListsListCall) SortField(sortField string) *TargetableRemarketingListsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *TargetableRemarketingListsListCall) SortOrder(sortOrder string) *TargetableRemarketingListsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetableRemarketingListsListCall) Fields(s ...googleapi.Field) *TargetableRemarketingListsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetableRemarketingListsListCall) IfNoneMatch(entityTag string) *TargetableRemarketingListsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetableRemarketingListsListCall) Context(ctx context.Context) *TargetableRemarketingListsListCall { + c.ctx_ = ctx + return c +} + +func (c *TargetableRemarketingListsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("advertiserId", fmt.Sprintf("%v", c.advertiserId)) + if v, ok := c.opt_["active"]; ok { + params.Set("active", fmt.Sprintf("%v", v)) + } + 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_["sortField"]; ok { + params.Set("sortField", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortOrder"]; ok { + params.Set("sortOrder", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetableRemarketingLists") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.targetableRemarketingLists.list" call. +// Exactly one of *TargetableRemarketingListsListResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *TargetableRemarketingListsListResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetableRemarketingListsListCall) Do() (*TargetableRemarketingListsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetableRemarketingListsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of targetable remarketing lists, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.targetableRemarketingLists.list", + // "parameterOrder": [ + // "profileId", + // "advertiserId" + // ], + // "parameters": { + // "active": { + // "description": "Select only active or only inactive targetable remarketing lists.", + // "location": "query", + // "type": "boolean" + // }, + // "advertiserId": { + // "description": "Select only targetable remarketing lists targetable by these advertisers.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "name": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"remarketing list*2015\" will return objects with names like \"remarketing list June 2015\", \"remarketing list April 2015\", or simply \"remarketing list 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"remarketing list\" will match objects with name \"my remarketing list\", \"remarketing list 2015\", or simply \"remarketing list\".", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/targetableRemarketingLists", + // "response": { + // "$ref": "TargetableRemarketingListsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userProfiles.get": + +type UserProfilesGetCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserProfilesGetCall) Fields(s ...googleapi.Field) *UserProfilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserProfilesGetCall) IfNoneMatch(entityTag string) *UserProfilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserProfilesGetCall) Context(ctx context.Context) *UserProfilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *UserProfilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userProfiles.get" call. +// Exactly one of *UserProfile or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UserProfile.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserProfilesGetCall) Do() (*UserProfile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserProfile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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", + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userProfiles.list": + +type UserProfilesListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserProfilesListCall) Fields(s ...googleapi.Field) *UserProfilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserProfilesListCall) IfNoneMatch(entityTag string) *UserProfilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserProfilesListCall) Context(ctx context.Context) *UserProfilesListCall { + c.ctx_ = ctx + return c +} + +func (c *UserProfilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userProfiles.list" call. +// Exactly one of *UserProfileList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UserProfileList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UserProfilesListCall) Do() (*UserProfileList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserProfileList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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", + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRolePermissionGroups.get": + +type UserRolePermissionGroupsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one user role permission group by ID. +func (r *UserRolePermissionGroupsService) Get(profileId int64, id int64) *UserRolePermissionGroupsGetCall { + c := &UserRolePermissionGroupsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolePermissionGroupsGetCall) Fields(s ...googleapi.Field) *UserRolePermissionGroupsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserRolePermissionGroupsGetCall) IfNoneMatch(entityTag string) *UserRolePermissionGroupsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolePermissionGroupsGetCall) Context(ctx context.Context) *UserRolePermissionGroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolePermissionGroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissionGroups/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRolePermissionGroups.get" call. +// Exactly one of *UserRolePermissionGroup or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *UserRolePermissionGroup.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UserRolePermissionGroupsGetCall) Do() (*UserRolePermissionGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRolePermissionGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one user role permission group by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.userRolePermissionGroups.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "User role permission group ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRolePermissionGroups/{id}", + // "response": { + // "$ref": "UserRolePermissionGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRolePermissionGroups.list": + +type UserRolePermissionGroupsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Gets a list of all supported user role permission groups. +func (r *UserRolePermissionGroupsService) List(profileId int64) *UserRolePermissionGroupsListCall { + c := &UserRolePermissionGroupsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolePermissionGroupsListCall) Fields(s ...googleapi.Field) *UserRolePermissionGroupsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserRolePermissionGroupsListCall) IfNoneMatch(entityTag string) *UserRolePermissionGroupsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolePermissionGroupsListCall) Context(ctx context.Context) *UserRolePermissionGroupsListCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolePermissionGroupsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissionGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRolePermissionGroups.list" call. +// Exactly one of *UserRolePermissionGroupsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *UserRolePermissionGroupsListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *UserRolePermissionGroupsListCall) Do() (*UserRolePermissionGroupsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRolePermissionGroupsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a list of all supported user role permission groups.", + // "httpMethod": "GET", + // "id": "dfareporting.userRolePermissionGroups.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRolePermissionGroups", + // "response": { + // "$ref": "UserRolePermissionGroupsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRolePermissions.get": + +type UserRolePermissionsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one user role permission by ID. +func (r *UserRolePermissionsService) Get(profileId int64, id int64) *UserRolePermissionsGetCall { + c := &UserRolePermissionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolePermissionsGetCall) Fields(s ...googleapi.Field) *UserRolePermissionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserRolePermissionsGetCall) IfNoneMatch(entityTag string) *UserRolePermissionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolePermissionsGetCall) Context(ctx context.Context) *UserRolePermissionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolePermissionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissions/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRolePermissions.get" call. +// Exactly one of *UserRolePermission or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *UserRolePermission.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UserRolePermissionsGetCall) Do() (*UserRolePermission, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRolePermission{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one user role permission by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.userRolePermissions.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "User role permission ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRolePermissions/{id}", + // "response": { + // "$ref": "UserRolePermission" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRolePermissions.list": + +type UserRolePermissionsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Gets a list of user role permissions, possibly filtered. +func (r *UserRolePermissionsService) List(profileId int64) *UserRolePermissionsListCall { + c := &UserRolePermissionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Ids sets the optional parameter "ids": Select only user role +// permissions with these IDs. +func (c *UserRolePermissionsListCall) Ids(ids int64) *UserRolePermissionsListCall { + c.opt_["ids"] = ids + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolePermissionsListCall) Fields(s ...googleapi.Field) *UserRolePermissionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserRolePermissionsListCall) IfNoneMatch(entityTag string) *UserRolePermissionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolePermissionsListCall) Context(ctx context.Context) *UserRolePermissionsListCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolePermissionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRolePermissions.list" call. +// Exactly one of *UserRolePermissionsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *UserRolePermissionsListResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UserRolePermissionsListCall) Do() (*UserRolePermissionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRolePermissionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a list of user role permissions, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.userRolePermissions.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "ids": { + // "description": "Select only user role permissions with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRolePermissions", + // "response": { + // "$ref": "UserRolePermissionsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRoles.delete": + +type UserRolesDeleteCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing user role. +func (r *UserRolesService) Delete(profileId int64, id int64) *UserRolesDeleteCall { + c := &UserRolesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolesDeleteCall) Fields(s ...googleapi.Field) *UserRolesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolesDeleteCall) Context(ctx context.Context) *UserRolesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRoles.delete" call. +func (c *UserRolesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing user role.", + // "httpMethod": "DELETE", + // "id": "dfareporting.userRoles.delete", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "User role ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRoles/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRoles.get": + +type UserRolesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one user role by ID. +func (r *UserRolesService) Get(profileId int64, id int64) *UserRolesGetCall { + c := &UserRolesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolesGetCall) Fields(s ...googleapi.Field) *UserRolesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserRolesGetCall) IfNoneMatch(entityTag string) *UserRolesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolesGetCall) Context(ctx context.Context) *UserRolesGetCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRoles.get" call. +// Exactly one of *UserRole or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *UserRole.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserRolesGetCall) Do() (*UserRole, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRole{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one user role by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.userRoles.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "User role ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRoles/{id}", + // "response": { + // "$ref": "UserRole" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRoles.insert": + +type UserRolesInsertCall struct { + s *Service + profileId int64 + userrole *UserRole + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new user role. +func (r *UserRolesService) Insert(profileId int64, userrole *UserRole) *UserRolesInsertCall { + c := &UserRolesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.userrole = userrole + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolesInsertCall) Fields(s ...googleapi.Field) *UserRolesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolesInsertCall) Context(ctx context.Context) *UserRolesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRoles.insert" call. +// Exactly one of *UserRole or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *UserRole.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserRolesInsertCall) Do() (*UserRole, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRole{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new user role.", + // "httpMethod": "POST", + // "id": "dfareporting.userRoles.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRoles", + // "request": { + // "$ref": "UserRole" + // }, + // "response": { + // "$ref": "UserRole" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRoles.list": + +type UserRolesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of user roles, possibly filtered. +func (r *UserRolesService) List(profileId int64) *UserRolesListCall { + c := &UserRolesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AccountUserRoleOnly sets the optional parameter +// "accountUserRoleOnly": Select only account level user roles not +// associated with any specific subaccount. +func (c *UserRolesListCall) AccountUserRoleOnly(accountUserRoleOnly bool) *UserRolesListCall { + c.opt_["accountUserRoleOnly"] = accountUserRoleOnly + return c +} + +// Ids sets the optional parameter "ids": Select only user roles with +// the specified IDs. +func (c *UserRolesListCall) Ids(ids int64) *UserRolesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *UserRolesListCall) MaxResults(maxResults int64) *UserRolesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *UserRolesListCall) PageToken(pageToken string) *UserRolesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "userrole*2015" will return objects with names like +// "userrole June 2015", "userrole April 2015", or simply "userrole +// 2015". Most of the searches also add wildcards implicitly at the +// start and the end of the search string. For example, a search string +// of "userrole" will match objects with name "my userrole", "userrole +// 2015", or simply "userrole". +func (c *UserRolesListCall) SearchString(searchString string) *UserRolesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *UserRolesListCall) SortField(sortField string) *UserRolesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *UserRolesListCall) SortOrder(sortOrder string) *UserRolesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// SubaccountId sets the optional parameter "subaccountId": Select only +// user roles that belong to this subaccount. +func (c *UserRolesListCall) SubaccountId(subaccountId int64) *UserRolesListCall { + c.opt_["subaccountId"] = subaccountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolesListCall) Fields(s ...googleapi.Field) *UserRolesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserRolesListCall) IfNoneMatch(entityTag string) *UserRolesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolesListCall) Context(ctx context.Context) *UserRolesListCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["accountUserRoleOnly"]; ok { + params.Set("accountUserRoleOnly", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["subaccountId"]; ok { + params.Set("subaccountId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRoles.list" call. +// Exactly one of *UserRolesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *UserRolesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UserRolesListCall) Do() (*UserRolesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRolesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of user roles, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.userRoles.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "accountUserRoleOnly": { + // "description": "Select only account level user roles not associated with any specific subaccount.", + // "location": "query", + // "type": "boolean" + // }, + // "ids": { + // "description": "Select only user roles with the specified IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"userrole*2015\" will return objects with names like \"userrole June 2015\", \"userrole April 2015\", or simply \"userrole 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"userrole\" will match objects with name \"my userrole\", \"userrole 2015\", or simply \"userrole\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "subaccountId": { + // "description": "Select only user roles that belong to this subaccount.", + // "format": "int64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRoles", + // "response": { + // "$ref": "UserRolesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRoles.patch": + +type UserRolesPatchCall struct { + s *Service + profileId int64 + id int64 + userrole *UserRole + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing user role. This method supports patch +// semantics. +func (r *UserRolesService) Patch(profileId int64, id int64, userrole *UserRole) *UserRolesPatchCall { + c := &UserRolesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.userrole = userrole + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolesPatchCall) Fields(s ...googleapi.Field) *UserRolesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolesPatchCall) Context(ctx context.Context) *UserRolesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRoles.patch" call. +// Exactly one of *UserRole or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *UserRole.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserRolesPatchCall) Do() (*UserRole, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRole{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing user role. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.userRoles.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "User role ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRoles", + // "request": { + // "$ref": "UserRole" + // }, + // "response": { + // "$ref": "UserRole" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRoles.update": + +type UserRolesUpdateCall struct { + s *Service + profileId int64 + userrole *UserRole + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing user role. +func (r *UserRolesService) Update(profileId int64, userrole *UserRole) *UserRolesUpdateCall { + c := &UserRolesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.userrole = userrole + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolesUpdateCall) Fields(s ...googleapi.Field) *UserRolesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolesUpdateCall) Context(ctx context.Context) *UserRolesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRoles.update" call. +// Exactly one of *UserRole or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *UserRole.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserRolesUpdateCall) Do() (*UserRole, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRole{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing user role.", + // "httpMethod": "PUT", + // "id": "dfareporting.userRoles.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRoles", + // "request": { + // "$ref": "UserRole" + // }, + // "response": { + // "$ref": "UserRole" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/dfareporting/v2.2/dfareporting-api.json b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v2.2/dfareporting-api.json new file mode 100644 index 000000000..e4ff70908 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v2.2/dfareporting-api.json @@ -0,0 +1,17672 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/qexyTX_0gifZ9lTG0KLr53MQrI4\"", + "discoveryVersion": "v1", + "id": "dfareporting:v2.2", + "name": "dfareporting", + "version": "v2.2", + "revision": "20150717", + "title": "DCM/DFA Reporting And Trafficking API", + "description": "Manage your DoubleClick Campaign Manager ad campaigns and reports.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/doubleclick-16.gif", + "x32": "https://www.google.com/images/icons/product/doubleclick-32.gif" + }, + "documentationLink": "https://developers.google.com/doubleclick-advertisers/reporting/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/dfareporting/v2.2/", + "basePath": "/dfareporting/v2.2/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "dfareporting/v2.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" + }, + "https://www.googleapis.com/auth/dfatrafficking": { + "description": "View and manage your DoubleClick Campaign Manager's (DCM) display ad campaigns" + } + } + } + }, + "schemas": { + "Account": { + "id": "Account", + "type": "object", + "description": "Contains properties of a DCM account.", + "properties": { + "accountPermissionIds": { + "type": "array", + "description": "Account permissions assigned to this account.", + "items": { + "type": "string", + "format": "int64" + } + }, + "accountProfile": { + "type": "string", + "description": "Profile for this account. This is a read-only field that can be left blank.", + "enum": [ + "ACCOUNT_PROFILE_BASIC", + "ACCOUNT_PROFILE_STANDARD" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "active": { + "type": "boolean", + "description": "Whether this account is active." + }, + "activeAdsLimitTier": { + "type": "string", + "description": "Maximum number of active ads allowed for this account.", + "enum": [ + "ACTIVE_ADS_TIER_100K", + "ACTIVE_ADS_TIER_200K", + "ACTIVE_ADS_TIER_300K", + "ACTIVE_ADS_TIER_40K", + "ACTIVE_ADS_TIER_75K" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "activeViewOptOut": { + "type": "boolean", + "description": "Whether to serve creatives with Active View tags. If disabled, viewability data will not be available for any impressions." + }, + "availablePermissionIds": { + "type": "array", + "description": "User role permissions available to the user roles of this account.", + "items": { + "type": "string", + "format": "int64" + } + }, + "comscoreVceEnabled": { + "type": "boolean", + "description": "Whether campaigns created in this account will be enabled for comScore vCE by default." + }, + "countryId": { + "type": "string", + "description": "ID of the country associated with this account.", + "format": "int64" + }, + "currencyId": { + "type": "string", + "description": "ID of currency associated with this account. This is a required field.\nAcceptable values are: \n- \"1\" for USD \n- \"2\" for GBP \n- \"3\" for ESP \n- \"4\" for SEK \n- \"5\" for CAD \n- \"6\" for JPY \n- \"7\" for DEM \n- \"8\" for AUD \n- \"9\" for FRF \n- \"10\" for ITL \n- \"11\" for DKK \n- \"12\" for NOK \n- \"13\" for FIM \n- \"14\" for ZAR \n- \"15\" for IEP \n- \"16\" for NLG \n- \"17\" for EUR \n- \"18\" for KRW \n- \"19\" for TWD \n- \"20\" for SGD \n- \"21\" for CNY \n- \"22\" for HKD \n- \"23\" for NZD \n- \"24\" for MYR \n- \"25\" for BRL \n- \"26\" for PTE \n- \"27\" for MXP \n- \"28\" for CLP \n- \"29\" for TRY \n- \"30\" for ARS \n- \"31\" for PEN \n- \"32\" for ILS \n- \"33\" for CHF \n- \"34\" for VEF \n- \"35\" for COP \n- \"36\" for GTQ", + "format": "int64" + }, + "defaultCreativeSizeId": { + "type": "string", + "description": "Default placement dimensions for this account.", + "format": "int64" + }, + "description": { + "type": "string", + "description": "Description of this account." + }, + "id": { + "type": "string", + "description": "ID of this account. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#account\".", + "default": "dfareporting#account" + }, + "locale": { + "type": "string", + "description": "Locale of this account.\nAcceptable values are: \n- \"cs\" (Czech) \n- \"de\" (German) \n- \"en\" (English) \n- \"en-GB\" (English United Kingdom) \n- \"es\" (Spanish) \n- \"fr\" (French) \n- \"it\" (Italian) \n- \"ja\" (Japanese) \n- \"ko\" (Korean) \n- \"pl\" (Polish) \n- \"pt-BR\" (Portuguese Brazil) \n- \"ru\" (Russian) \n- \"sv\" (Swedish) \n- \"tr\" (Turkish) \n- \"zh-CN\" (Chinese Simplified) \n- \"zh-TW\" (Chinese Traditional)" + }, + "maximumImageSize": { + "type": "string", + "description": "Maximum image size allowed for this account.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this account. This is a required field, and must be less than 128 characters long and be globally unique." + }, + "nielsenOcrEnabled": { + "type": "boolean", + "description": "Whether campaigns created in this account will be enabled for Nielsen OCR reach ratings by default." + }, + "reportsConfiguration": { + "$ref": "ReportsConfiguration", + "description": "Reporting configuration of this account." + }, + "teaserSizeLimit": { + "type": "string", + "description": "File size limit in kilobytes of Rich Media teaser creatives. Must be between 1 and 10240.", + "format": "int64" + } + } + }, + "AccountActiveAdSummary": { + "id": "AccountActiveAdSummary", + "type": "object", + "description": "Gets a summary of active ads in an account.", + "properties": { + "accountId": { + "type": "string", + "description": "ID of the account.", + "format": "int64" + }, + "activeAds": { + "type": "string", + "description": "Ads that have been activated for the account", + "format": "int64" + }, + "activeAdsLimitTier": { + "type": "string", + "description": "Maximum number of active ads allowed for the account.", + "enum": [ + "ACTIVE_ADS_TIER_100K", + "ACTIVE_ADS_TIER_200K", + "ACTIVE_ADS_TIER_300K", + "ACTIVE_ADS_TIER_40K", + "ACTIVE_ADS_TIER_75K" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "availableAds": { + "type": "string", + "description": "Ads that can be activated for the account.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountActiveAdSummary\".", + "default": "dfareporting#accountActiveAdSummary" + } + } + }, + "AccountPermission": { + "id": "AccountPermission", + "type": "object", + "description": "AccountPermissions contains information about a particular account permission. Some features of DCM require an account permission to be present in the account.", + "properties": { + "accountProfiles": { + "type": "array", + "description": "Account profiles associated with this account permission.\n\nPossible values are:\n- \"ACCOUNT_PROFILE_BASIC\"\n- \"ACCOUNT_PROFILE_STANDARD\"", + "items": { + "type": "string", + "enum": [ + "ACCOUNT_PROFILE_BASIC", + "ACCOUNT_PROFILE_STANDARD" + ], + "enumDescriptions": [ + "", + "" + ] + } + }, + "id": { + "type": "string", + "description": "ID of this account permission.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountPermission\".", + "default": "dfareporting#accountPermission" + }, + "level": { + "type": "string", + "description": "Administrative level required to enable this account permission.", + "enum": [ + "ADMINISTRATOR", + "USER" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "name": { + "type": "string", + "description": "Name of this account permission." + }, + "permissionGroupId": { + "type": "string", + "description": "Permission group of this account permission.", + "format": "int64" + } + } + }, + "AccountPermissionGroup": { + "id": "AccountPermissionGroup", + "type": "object", + "description": "AccountPermissionGroups contains a mapping of permission group IDs to names. A permission group is a grouping of account permissions.", + "properties": { + "id": { + "type": "string", + "description": "ID of this account permission group.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountPermissionGroup\".", + "default": "dfareporting#accountPermissionGroup" + }, + "name": { + "type": "string", + "description": "Name of this account permission group." + } + } + }, + "AccountPermissionGroupsListResponse": { + "id": "AccountPermissionGroupsListResponse", + "type": "object", + "description": "Account Permission Group List Response", + "properties": { + "accountPermissionGroups": { + "type": "array", + "description": "Account permission group collection.", + "items": { + "$ref": "AccountPermissionGroup" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountPermissionGroupsListResponse\".", + "default": "dfareporting#accountPermissionGroupsListResponse" + } + } + }, + "AccountPermissionsListResponse": { + "id": "AccountPermissionsListResponse", + "type": "object", + "description": "Account Permission List Response", + "properties": { + "accountPermissions": { + "type": "array", + "description": "Account permission collection.", + "items": { + "$ref": "AccountPermission" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountPermissionsListResponse\".", + "default": "dfareporting#accountPermissionsListResponse" + } + } + }, + "AccountUserProfile": { + "id": "AccountUserProfile", + "type": "object", + "description": "AccountUserProfiles contains properties of a DCM user profile. This resource is specifically for managing user profiles, whereas UserProfiles is for accessing the API.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of the user profile. This is a read-only field that can be left blank.", + "format": "int64" + }, + "active": { + "type": "boolean", + "description": "Whether this user profile is active. This defaults to false, and must be set true on insert for the user profile to be usable." + }, + "advertiserFilter": { + "$ref": "ObjectFilter", + "description": "Filter that describes which advertisers are visible to the user profile." + }, + "campaignFilter": { + "$ref": "ObjectFilter", + "description": "Filter that describes which campaigns are visible to the user profile." + }, + "comments": { + "type": "string", + "description": "Comments for this user profile." + }, + "email": { + "type": "string", + "description": "Email of the user profile. The email addresss must be linked to a Google Account. This field is required on insertion and is read-only after insertion." + }, + "id": { + "type": "string", + "description": "ID of the user profile. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountUserProfile\".", + "default": "dfareporting#accountUserProfile" + }, + "locale": { + "type": "string", + "description": "Locale of the user profile. This is a required field.\nAcceptable values are: \n- \"cs\" (Czech) \n- \"de\" (German) \n- \"en\" (English) \n- \"en-GB\" (English United Kingdom) \n- \"es\" (Spanish) \n- \"fr\" (French) \n- \"it\" (Italian) \n- \"ja\" (Japanese) \n- \"ko\" (Korean) \n- \"pl\" (Polish) \n- \"pt-BR\" (Portuguese Brazil)\n- \"ru\" (Russian) \n- \"sv\" (Swedish) \n- \"tr\" (Turkish) \n- \"zh-CN\" (Chinese Simplified) \n- \"zh-TW\" (Chinese Traditional)" + }, + "name": { + "type": "string", + "description": "Name of the user profile. This is a required field. Must be less than 64 characters long, must be globally unique, and cannot contain whitespace or any of the following characters: \"&;\"#%,\"." + }, + "siteFilter": { + "$ref": "ObjectFilter", + "description": "Filter that describes which sites are visible to the user profile." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of the user profile. This is a read-only field that can be left blank.", + "format": "int64" + }, + "traffickerType": { + "type": "string", + "description": "Trafficker type of this user profile.", + "enum": [ + "EXTERNAL_TRAFFICKER", + "INTERNAL_NON_TRAFFICKER", + "INTERNAL_TRAFFICKER" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "userAccessType": { + "type": "string", + "description": "User type of the user profile. This is a read-only field that can be left blank.", + "enum": [ + "INTERNAL_ADMINISTRATOR", + "NORMAL_USER", + "SUPER_USER" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "userRoleFilter": { + "$ref": "ObjectFilter", + "description": "Filter that describes which user roles are visible to the user profile." + }, + "userRoleId": { + "type": "string", + "description": "User role ID of the user profile. This is a required field.", + "format": "int64" + } + } + }, + "AccountUserProfilesListResponse": { + "id": "AccountUserProfilesListResponse", + "type": "object", + "description": "Account User Profile List Response", + "properties": { + "accountUserProfiles": { + "type": "array", + "description": "Account user profile collection.", + "items": { + "$ref": "AccountUserProfile" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountUserProfilesListResponse\".", + "default": "dfareporting#accountUserProfilesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "AccountsListResponse": { + "id": "AccountsListResponse", + "type": "object", + "description": "Account List Response", + "properties": { + "accounts": { + "type": "array", + "description": "Account collection.", + "items": { + "$ref": "Account" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#accountsListResponse\".", + "default": "dfareporting#accountsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "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" + } + } + } + }, + "Ad": { + "id": "Ad", + "type": "object", + "description": "Contains properties of a DCM ad.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this ad. This is a read-only field that can be left blank.", + "format": "int64" + }, + "active": { + "type": "boolean", + "description": "Whether this ad is active." + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this ad. This is a required field on insertion.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "archived": { + "type": "boolean", + "description": "Whether this ad is archived." + }, + "audienceSegmentId": { + "type": "string", + "description": "Audience segment ID that is being targeted for this ad. Applicable when type is AD_SERVING_STANDARD_AD.", + "format": "int64" + }, + "campaignId": { + "type": "string", + "description": "Campaign ID of this ad. This is a required field on insertion.", + "format": "int64" + }, + "campaignIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the campaign. This is a read-only, auto-generated field." + }, + "clickThroughUrl": { + "$ref": "ClickThroughUrl", + "description": "Click-through URL for this ad. This is a required field on insertion. Applicable when type is AD_SERVING_CLICK_TRACKER." + }, + "clickThroughUrlSuffixProperties": { + "$ref": "ClickThroughUrlSuffixProperties", + "description": "Click-through URL suffix properties for this ad. Applies to the URL in the ad or (if overriding ad properties) the URL in the creative." + }, + "comments": { + "type": "string", + "description": "Comments for this ad." + }, + "compatibility": { + "type": "string", + "description": "Compatibility of this ad. Applicable when type is AD_SERVING_DEFAULT_AD. WEB and WEB_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering an in-stream video ads developed with the VAST standard.", + "enum": [ + "APP", + "APP_INTERSTITIAL", + "IN_STREAM_VIDEO", + "WEB", + "WEB_INTERSTITIAL" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "createInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the creation of this ad.This is a read-only field." + }, + "creativeGroupAssignments": { + "type": "array", + "description": "Creative group assignments for this ad. Applicable when type is AD_SERVING_CLICK_TRACKER. Only one assignment per creative group number is allowed for a maximum of two assignments.", + "items": { + "$ref": "CreativeGroupAssignment" + } + }, + "creativeRotation": { + "$ref": "CreativeRotation", + "description": "Creative rotation for this ad. Applicable when type is AD_SERVING_DEFAULT_AD, AD_SERVING_STANDARD_AD, or AD_SERVING_TRACKING. When type is AD_SERVING_DEFAULT_AD, this field should have exactly one creativeAssignment." + }, + "dayPartTargeting": { + "$ref": "DayPartTargeting", + "description": "Time and day targeting information for this ad. Applicable when type is AD_SERVING_STANDARD_AD." + }, + "defaultClickThroughEventTagProperties": { + "$ref": "DefaultClickThroughEventTagProperties", + "description": "Default click-through event tag properties for this ad." + }, + "deliverySchedule": { + "$ref": "DeliverySchedule", + "description": "Delivery schedule information for this ad. Applicable when type is AD_SERVING_STANDARD_AD or AD_SERVING_TRACKING. This field along with subfields priority and impressionRatio are required on insertion when type is AD_SERVING_STANDARD_AD." + }, + "dynamicClickTracker": { + "type": "boolean", + "description": "Whether this ad is a dynamic click tracker. Applicable when type is AD_SERVING_CLICK_TRACKER. This is a required field on insert, and is read-only after insert." + }, + "endTime": { + "type": "string", + "description": "Date and time that this ad should stop serving. Must be later than the start time. This is a required field on insertion.", + "format": "date-time" + }, + "eventTagOverrides": { + "type": "array", + "description": "Event tag overrides for this ad.", + "items": { + "$ref": "EventTagOverride" + } + }, + "geoTargeting": { + "$ref": "GeoTargeting", + "description": "Geographical targeting information for this ad.Applicable when type is AD_SERVING_STANDARD_AD." + }, + "id": { + "type": "string", + "description": "ID of this ad. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this ad. This is a read-only, auto-generated field." + }, + "keyValueTargetingExpression": { + "$ref": "KeyValueTargetingExpression", + "description": "Key-value targeting information for this ad. Applicable when type is AD_SERVING_STANDARD_AD." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#ad\".", + "default": "dfareporting#ad" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the most recent modification of this ad. This is a read-only field." + }, + "name": { + "type": "string", + "description": "Name of this ad. This is a required field and must be less than 256 characters long." + }, + "placementAssignments": { + "type": "array", + "description": "Placement assignments for this ad.", + "items": { + "$ref": "PlacementAssignment" + } + }, + "remarketingListExpression": { + "$ref": "ListTargetingExpression", + "description": "Applicable when type is AD_SERVING_STANDARD_AD. Remarketing list targeting expression for this ad." + }, + "size": { + "$ref": "Size", + "description": "Size of this ad. Applicable when type is AD_SERVING_DEFAULT_AD." + }, + "sslCompliant": { + "type": "boolean", + "description": "Whether this ad is ssl compliant. This is a read-only field that is auto-generated when the ad is inserted or updated." + }, + "sslRequired": { + "type": "boolean", + "description": "Whether this ad requires ssl. This is a read-only field that is auto-generated when the ad is inserted or updated." + }, + "startTime": { + "type": "string", + "description": "Date and time that this ad should start serving. If creating an ad, this field must be a time in the future. This is a required field on insertion.", + "format": "date-time" + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this ad. This is a read-only field that can be left blank.", + "format": "int64" + }, + "technologyTargeting": { + "$ref": "TechnologyTargeting", + "description": "Technology platform targeting information for this ad. Applicable when type is AD_SERVING_STANDARD_AD." + }, + "type": { + "type": "string", + "description": "Type of ad. This is a required field on insertion. Note that default ads (AD_SERVING_DEFAULT_AD) cannot be created directly (see Creative resource).", + "enum": [ + "AD_SERVING_CLICK_TRACKER", + "AD_SERVING_DEFAULT_AD", + "AD_SERVING_STANDARD_AD", + "AD_SERVING_TRACKING" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "AdSlot": { + "id": "AdSlot", + "type": "object", + "description": "Ad Slot", + "properties": { + "comment": { + "type": "string", + "description": "Comment for this ad slot." + }, + "compatibility": { + "type": "string", + "description": "Ad slot compatibility. WEB and WEB_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard.", + "enum": [ + "PLANNING_RENDERING_ENVIRONMENT_TYPE_APP", + "PLANNING_RENDERING_ENVIRONMENT_TYPE_APP_INTERSTITIAL", + "PLANNING_RENDERING_ENVIRONMENT_TYPE_IN_STREAM_VIDEO", + "PLANNING_RENDERING_ENVIRONMENT_TYPE_WEB", + "PLANNING_RENDERING_ENVIRONMENT_TYPE_WEB_INTERSTITIAL" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "height": { + "type": "string", + "description": "Height of this ad slot.", + "format": "int64" + }, + "linkedPlacementId": { + "type": "string", + "description": "ID of the placement from an external platform that is linked to this ad slot.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this ad slot." + }, + "paymentSourceType": { + "type": "string", + "description": "Payment source type of this ad slot.", + "enum": [ + "PLANNING_PAYMENT_SOURCE_TYPE_AGENCY_PAID", + "PLANNING_PAYMENT_SOURCE_TYPE_PUBLISHER_PAID" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "primary": { + "type": "boolean", + "description": "Primary ad slot of a roadblock inventory item." + }, + "width": { + "type": "string", + "description": "Width of this ad slot.", + "format": "int64" + } + } + }, + "AdsListResponse": { + "id": "AdsListResponse", + "type": "object", + "description": "Ad List Response", + "properties": { + "ads": { + "type": "array", + "description": "Ad collection.", + "items": { + "$ref": "Ad" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#adsListResponse\".", + "default": "dfareporting#adsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "Advertiser": { + "id": "Advertiser", + "type": "object", + "description": "Contains properties of a DCM advertiser.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this advertiser.This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserGroupId": { + "type": "string", + "description": "ID of the advertiser group this advertiser belongs to. You can group advertisers for reporting purposes, allowing you to see aggregated information for all advertisers in each group.", + "format": "int64" + }, + "clickThroughUrlSuffix": { + "type": "string", + "description": "Suffix added to click-through URL of ad creative associations under this advertiser. Must be less than 129 characters long." + }, + "defaultClickThroughEventTagId": { + "type": "string", + "description": "ID of the click-through event tag to apply by default to the landing pages of this advertiser's campaigns.", + "format": "int64" + }, + "defaultEmail": { + "type": "string", + "description": "Default email address used in sender field for tag emails." + }, + "floodlightConfigurationId": { + "type": "string", + "description": "Floodlight configuration ID of this advertiser. The floodlight configuration ID will be created automatically, so on insert this field should be left blank. This field can be set to another advertiser's floodlight configuration ID in order to share that advertiser's floodlight configuration with this advertiser, so long as: \n- This advertiser's original floodlight configuration is not already associated with floodlight activities or floodlight activity groups. \n- This advertiser's original floodlight configuration is not already shared with another advertiser.", + "format": "int64" + }, + "floodlightConfigurationIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the floodlight configuration. This is a read-only, auto-generated field." + }, + "id": { + "type": "string", + "description": "ID of this advertiser. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this advertiser. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#advertiser\".", + "default": "dfareporting#advertiser" + }, + "name": { + "type": "string", + "description": "Name of this advertiser. This is a required field and must be less than 256 characters long and unique among advertisers of the same account." + }, + "originalFloodlightConfigurationId": { + "type": "string", + "description": "Original floodlight configuration before any sharing occurred. Set the floodlightConfigurationId of this advertiser to originalFloodlightConfigurationId to unshare the advertiser's current floodlight configuration. You cannot unshare an advertiser's floodlight configuration if the shared configuration has activities associated with any campaign or placement.", + "format": "int64" + }, + "status": { + "type": "string", + "description": "Status of this advertiser.", + "enum": [ + "APPROVED", + "ON_HOLD" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this advertiser.This is a read-only field that can be left blank.", + "format": "int64" + }, + "suspended": { + "type": "boolean", + "description": "Suspension status of this advertiser." + } + } + }, + "AdvertiserGroup": { + "id": "AdvertiserGroup", + "type": "object", + "description": "Groups advertisers together so that reports can be generated for the entire group at once.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this advertiser group. This is a read-only field that can be left blank.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "ID of this advertiser group. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#advertiserGroup\".", + "default": "dfareporting#advertiserGroup" + }, + "name": { + "type": "string", + "description": "Name of this advertiser group. This is a required field and must be less than 256 characters long and unique among advertiser groups of the same account." + } + } + }, + "AdvertiserGroupsListResponse": { + "id": "AdvertiserGroupsListResponse", + "type": "object", + "description": "Advertiser Group List Response", + "properties": { + "advertiserGroups": { + "type": "array", + "description": "Advertiser group collection.", + "items": { + "$ref": "AdvertiserGroup" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#advertiserGroupsListResponse\".", + "default": "dfareporting#advertiserGroupsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "AdvertisersListResponse": { + "id": "AdvertisersListResponse", + "type": "object", + "description": "Advertiser List Response", + "properties": { + "advertisers": { + "type": "array", + "description": "Advertiser collection.", + "items": { + "$ref": "Advertiser" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#advertisersListResponse\".", + "default": "dfareporting#advertisersListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "AudienceSegment": { + "id": "AudienceSegment", + "type": "object", + "description": "Audience Segment.", + "properties": { + "allocation": { + "type": "integer", + "description": "Weight allocated to this segment. Must be between 1 and 1000. The weight assigned will be understood in proportion to the weights assigned to other segments in the same segment group.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "ID of this audience segment. This is a read-only, auto-generated field.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this audience segment. This is a required field and must be less than 65 characters long." + } + } + }, + "AudienceSegmentGroup": { + "id": "AudienceSegmentGroup", + "type": "object", + "description": "Audience Segment Group.", + "properties": { + "audienceSegments": { + "type": "array", + "description": "Audience segments assigned to this group. The number of segments must be between 2 and 100.", + "items": { + "$ref": "AudienceSegment" + } + }, + "id": { + "type": "string", + "description": "ID of this audience segment group. This is a read-only, auto-generated field.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this audience segment group. This is a required field and must be less than 65 characters long." + } + } + }, + "Browser": { + "id": "Browser", + "type": "object", + "description": "Contains information about a browser that can be targeted by ads.", + "properties": { + "browserVersionId": { + "type": "string", + "description": "ID referring to this grouping of browser and version numbers. This is the ID used for targeting.", + "format": "int64" + }, + "dartId": { + "type": "string", + "description": "DART ID of this browser. This is the ID used when generating reports.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#browser\".", + "default": "dfareporting#browser" + }, + "majorVersion": { + "type": "string", + "description": "Major version number (leftmost number) of this browser. For example, for Chrome 5.0.376.86 beta, this field should be set to 5. An asterisk (*) may be used to target any version number, and a question mark (?) may be used to target cases where the version number cannot be identified. For example, Chrome *.* targets any version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad server knows the browser is Firefox but can't tell which version it is." + }, + "minorVersion": { + "type": "string", + "description": "Minor version number (number after first dot on left) of this browser. For example, for Chrome 5.0.375.86 beta, this field should be set to 0. An asterisk (*) may be used to target any version number, and a question mark (?) may be used to target cases where the version number cannot be identified. For example, Chrome *.* targets any version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad server knows the browser is Firefox but can't tell which version it is." + }, + "name": { + "type": "string", + "description": "Name of this browser." + } + } + }, + "BrowsersListResponse": { + "id": "BrowsersListResponse", + "type": "object", + "description": "Browser List Response", + "properties": { + "browsers": { + "type": "array", + "description": "Browser collection.", + "items": { + "$ref": "Browser" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#browsersListResponse\".", + "default": "dfareporting#browsersListResponse" + } + } + }, + "Campaign": { + "id": "Campaign", + "type": "object", + "description": "Contains properties of a DCM campaign.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this campaign. This is a read-only field that can be left blank.", + "format": "int64" + }, + "additionalCreativeOptimizationConfigurations": { + "type": "array", + "description": "Additional creative optimization configurations for the campaign.", + "items": { + "$ref": "CreativeOptimizationConfiguration" + } + }, + "advertiserGroupId": { + "type": "string", + "description": "Advertiser group ID of the associated advertiser.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this campaign. This is a required field.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the advertiser ID of this campaign. This is a read-only, auto-generated field." + }, + "archived": { + "type": "boolean", + "description": "Whether this campaign has been archived." + }, + "audienceSegmentGroups": { + "type": "array", + "description": "Audience segment groups assigned to this campaign. Cannot have more than 300 segment groups.", + "items": { + "$ref": "AudienceSegmentGroup" + } + }, + "billingInvoiceCode": { + "type": "string", + "description": "Billing invoice code included in the DCM client billing invoices associated with the campaign." + }, + "clickThroughUrlSuffixProperties": { + "$ref": "ClickThroughUrlSuffixProperties", + "description": "Click-through URL suffix override properties for this campaign." + }, + "comment": { + "type": "string", + "description": "Arbitrary comments about this campaign. Must be less than 256 characters long." + }, + "comscoreVceEnabled": { + "type": "boolean", + "description": "Whether comScore vCE reports are enabled for this campaign." + }, + "createInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the creation of this campaign. This is a read-only field." + }, + "creativeGroupIds": { + "type": "array", + "description": "List of creative group IDs that are assigned to the campaign.", + "items": { + "type": "string", + "format": "int64" + } + }, + "creativeOptimizationConfiguration": { + "$ref": "CreativeOptimizationConfiguration", + "description": "Creative optimization configuration for the campaign." + }, + "defaultClickThroughEventTagProperties": { + "$ref": "DefaultClickThroughEventTagProperties", + "description": "Click-through event tag ID override properties for this campaign." + }, + "endDate": { + "type": "string", + "description": "Date on which the campaign will stop running. On insert, the end date must be today or a future date. The end date must be later than or be the same as the start date. If, for example, you set 6/25/2015 as both the start and end dates, the effective campaign run date is just that day only, 6/25/2015. The hours, minutes, and seconds of the end date should not be set, as doing so will result in an error. This is a required field.", + "format": "date" + }, + "eventTagOverrides": { + "type": "array", + "description": "Overrides that can be used to activate or deactivate advertiser event tags.", + "items": { + "$ref": "EventTagOverride" + } + }, + "externalId": { + "type": "string", + "description": "External ID for this campaign." + }, + "id": { + "type": "string", + "description": "ID of this campaign. This is a read-only auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this campaign. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#campaign\".", + "default": "dfareporting#campaign" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the most recent modification of this campaign. This is a read-only field." + }, + "lookbackConfiguration": { + "$ref": "LookbackConfiguration", + "description": "Lookback window settings for the campaign." + }, + "name": { + "type": "string", + "description": "Name of this campaign. This is a required field and must be less than 256 characters long and unique among campaigns of the same advertiser." + }, + "nielsenOcrEnabled": { + "type": "boolean", + "description": "Whether Nielsen reports are enabled for this campaign." + }, + "startDate": { + "type": "string", + "description": "Date on which the campaign starts running. The start date can be any date. The hours, minutes, and seconds of the start date should not be set, as doing so will result in an error. This is a required field.", + "format": "date" + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this campaign. This is a read-only field that can be left blank.", + "format": "int64" + }, + "traffickerEmails": { + "type": "array", + "description": "Campaign trafficker contact emails.", + "items": { + "type": "string" + } + } + } + }, + "CampaignCreativeAssociation": { + "id": "CampaignCreativeAssociation", + "type": "object", + "description": "Identifies a creative which has been associated with a given campaign.", + "properties": { + "creativeId": { + "type": "string", + "description": "ID of the creative associated with the campaign. This is a required field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#campaignCreativeAssociation\".", + "default": "dfareporting#campaignCreativeAssociation" + } + } + }, + "CampaignCreativeAssociationsListResponse": { + "id": "CampaignCreativeAssociationsListResponse", + "type": "object", + "description": "Campaign Creative Association List Response", + "properties": { + "campaignCreativeAssociations": { + "type": "array", + "description": "Campaign creative association collection", + "items": { + "$ref": "CampaignCreativeAssociation" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#campaignCreativeAssociationsListResponse\".", + "default": "dfareporting#campaignCreativeAssociationsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "CampaignsListResponse": { + "id": "CampaignsListResponse", + "type": "object", + "description": "Campaign List Response", + "properties": { + "campaigns": { + "type": "array", + "description": "Campaign collection.", + "items": { + "$ref": "Campaign" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#campaignsListResponse\".", + "default": "dfareporting#campaignsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "ChangeLog": { + "id": "ChangeLog", + "type": "object", + "description": "Describes a change that a user has made to a resource.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of the modified object.", + "format": "int64" + }, + "action": { + "type": "string", + "description": "Action which caused the change." + }, + "changeTime": { + "type": "string", + "description": "Time when the object was modified.", + "format": "date-time" + }, + "fieldName": { + "type": "string", + "description": "Field name of the object which changed." + }, + "id": { + "type": "string", + "description": "ID of this change log.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#changeLog\".", + "default": "dfareporting#changeLog" + }, + "newValue": { + "type": "string", + "description": "New value of the object field." + }, + "objectId": { + "type": "string", + "description": "ID of the object of this change log. The object could be a campaign, placement, ad, or other type.", + "format": "int64" + }, + "objectType": { + "type": "string", + "description": "Object type of the change log." + }, + "oldValue": { + "type": "string", + "description": "Old value of the object field." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of the modified object.", + "format": "int64" + }, + "transactionId": { + "type": "string", + "description": "Transaction ID of this change log. When a single API call results in many changes, each change will have a separate ID in the change log but will share the same transactionId.", + "format": "int64" + }, + "userProfileId": { + "type": "string", + "description": "ID of the user who modified the object.", + "format": "int64" + }, + "userProfileName": { + "type": "string", + "description": "User profile name of the user who modified the object." + } + } + }, + "ChangeLogsListResponse": { + "id": "ChangeLogsListResponse", + "type": "object", + "description": "Change Log List Response", + "properties": { + "changeLogs": { + "type": "array", + "description": "Change log collection.", + "items": { + "$ref": "ChangeLog" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#changeLogsListResponse\".", + "default": "dfareporting#changeLogsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "CitiesListResponse": { + "id": "CitiesListResponse", + "type": "object", + "description": "City List Response", + "properties": { + "cities": { + "type": "array", + "description": "City collection.", + "items": { + "$ref": "City" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#citiesListResponse\".", + "default": "dfareporting#citiesListResponse" + } + } + }, + "City": { + "id": "City", + "type": "object", + "description": "Contains information about a city that can be targeted by ads.", + "properties": { + "countryCode": { + "type": "string", + "description": "Country code of the country to which this city belongs." + }, + "countryDartId": { + "type": "string", + "description": "DART ID of the country to which this city belongs.", + "format": "int64" + }, + "dartId": { + "type": "string", + "description": "DART ID of this city. This is the ID used for targeting and generating reports.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#city\".", + "default": "dfareporting#city" + }, + "metroCode": { + "type": "string", + "description": "Metro region code of the metro region (DMA) to which this city belongs." + }, + "metroDmaId": { + "type": "string", + "description": "ID of the metro region (DMA) to which this city belongs.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this city." + }, + "regionCode": { + "type": "string", + "description": "Region code of the region to which this city belongs." + }, + "regionDartId": { + "type": "string", + "description": "DART ID of the region to which this city belongs.", + "format": "int64" + } + } + }, + "ClickTag": { + "id": "ClickTag", + "type": "object", + "description": "Creative Click Tag.", + "properties": { + "eventName": { + "type": "string", + "description": "Advertiser event name associated with the click tag. This field is used by ENHANCED_BANNER, ENHANCED_IMAGE, and HTML5_BANNER creatives." + }, + "name": { + "type": "string", + "description": "Parameter name for the specified click tag. For ENHANCED_IMAGE creative assets, this field must match the value of the creative asset's creativeAssetId.name field." + }, + "value": { + "type": "string", + "description": "Parameter value for the specified click tag. This field contains a click-through url." + } + } + }, + "ClickThroughUrl": { + "id": "ClickThroughUrl", + "type": "object", + "description": "Click-through URL", + "properties": { + "computedClickThroughUrl": { + "type": "string", + "description": "Read-only convenience field representing the actual URL that will be used for this click-through. The URL is computed as follows: \n- If defaultLandingPage is enabled then the campaign's default landing page URL is assigned to this field.\n- If defaultLandingPage is not enabled and a landingPageId is specified then that landing page's URL is assigned to this field.\n- If neither of the above cases apply, then the customClickThroughUrl is assigned to this field." + }, + "customClickThroughUrl": { + "type": "string", + "description": "Custom click-through URL. Applicable if the defaultLandingPage field is set to false and the landingPageId field is left unset." + }, + "defaultLandingPage": { + "type": "boolean", + "description": "Whether the campaign default landing page is used." + }, + "landingPageId": { + "type": "string", + "description": "ID of the landing page for the click-through URL. Applicable if the defaultLandingPage field is set to false.", + "format": "int64" + } + } + }, + "ClickThroughUrlSuffixProperties": { + "id": "ClickThroughUrlSuffixProperties", + "type": "object", + "description": "Click Through URL Suffix settings.", + "properties": { + "clickThroughUrlSuffix": { + "type": "string", + "description": "Click-through URL suffix to apply to all ads in this entity's scope. Must be less than 128 characters long." + }, + "overrideInheritedSuffix": { + "type": "boolean", + "description": "Whether this entity should override the inherited click-through URL suffix with its own defined value." + } + } + }, + "CompanionClickThroughOverride": { + "id": "CompanionClickThroughOverride", + "type": "object", + "description": "Companion Click-through override.", + "properties": { + "clickThroughUrl": { + "$ref": "ClickThroughUrl", + "description": "Click-through URL of this companion click-through override." + }, + "creativeId": { + "type": "string", + "description": "ID of the creative for this companion click-through override.", + "format": "int64" + } + } + }, + "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\"." + } + } + }, + "ConnectionType": { + "id": "ConnectionType", + "type": "object", + "description": "Contains information about an internet connection type that can be targeted by ads. Clients can use the connection type to target mobile vs. broadband users.", + "properties": { + "id": { + "type": "string", + "description": "ID of this connection type.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#connectionType\".", + "default": "dfareporting#connectionType" + }, + "name": { + "type": "string", + "description": "Name of this connection type." + } + } + }, + "ConnectionTypesListResponse": { + "id": "ConnectionTypesListResponse", + "type": "object", + "description": "Connection Type List Response", + "properties": { + "connectionTypes": { + "type": "array", + "description": "Collection of connection types such as broadband and mobile.", + "items": { + "$ref": "ConnectionType" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#connectionTypesListResponse\".", + "default": "dfareporting#connectionTypesListResponse" + } + } + }, + "ContentCategoriesListResponse": { + "id": "ContentCategoriesListResponse", + "type": "object", + "description": "Content Category List Response", + "properties": { + "contentCategories": { + "type": "array", + "description": "Content category collection.", + "items": { + "$ref": "ContentCategory" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#contentCategoriesListResponse\".", + "default": "dfareporting#contentCategoriesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "ContentCategory": { + "id": "ContentCategory", + "type": "object", + "description": "Organizes placements according to the contents of their associated webpages.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this content category. This is a read-only field that can be left blank.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "ID of this content category. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#contentCategory\".", + "default": "dfareporting#contentCategory" + }, + "name": { + "type": "string", + "description": "Name of this content category. This is a required field and must be less than 256 characters long and unique among content categories of the same account." + } + } + }, + "CountriesListResponse": { + "id": "CountriesListResponse", + "type": "object", + "description": "Country List Response", + "properties": { + "countries": { + "type": "array", + "description": "Country collection.", + "items": { + "$ref": "Country" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#countriesListResponse\".", + "default": "dfareporting#countriesListResponse" + } + } + }, + "Country": { + "id": "Country", + "type": "object", + "description": "Contains information about a country that can be targeted by ads.", + "properties": { + "countryCode": { + "type": "string", + "description": "Country code." + }, + "dartId": { + "type": "string", + "description": "DART ID of this country. This is the ID used for targeting and generating reports.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#country\".", + "default": "dfareporting#country" + }, + "name": { + "type": "string", + "description": "Name of this country." + }, + "sslEnabled": { + "type": "boolean", + "description": "Whether ad serving supports secure servers in this country." + } + } + }, + "Creative": { + "id": "Creative", + "type": "object", + "description": "Contains properties of a Creative.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this creative. This field, if left unset, will be auto-generated for both insert and update operations. Applicable to all creative types.", + "format": "int64" + }, + "active": { + "type": "boolean", + "description": "Whether the creative is active. Applicable to all creative types." + }, + "adParameters": { + "type": "string", + "description": "Ad parameters user for VPAID creative. This is a read-only field. Applicable to the following creative types: all VPAID." + }, + "adTagKeys": { + "type": "array", + "description": "Keywords for a Rich Media creative. Keywords let you customize the creative settings of a Rich Media ad running on your site without having to contact the advertiser. You can use keywords to dynamically change the look or functionality of a creative. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "items": { + "type": "string" + } + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this creative. This is a required field. Applicable to all creative types.", + "format": "int64" + }, + "allowScriptAccess": { + "type": "boolean", + "description": "Whether script access is allowed for this creative. This is a read-only and deprecated field which will automatically be set to true on update. Applicable to the following creative types: FLASH_INPAGE." + }, + "archived": { + "type": "boolean", + "description": "Whether the creative is archived. Applicable to all creative types." + }, + "artworkType": { + "type": "string", + "description": "Type of artwork used for the creative. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "enum": [ + "ARTWORK_TYPE_FLASH", + "ARTWORK_TYPE_HTML5", + "ARTWORK_TYPE_MIXED" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "authoringTool": { + "type": "string", + "description": "Authoring tool for HTML5 banner creatives. This is a read-only field. Applicable to the following creative types: HTML5_BANNER.", + "enum": [ + "NINJA", + "SWIFFY" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "auto_advance_images": { + "type": "boolean", + "description": "Whether images are automatically advanced for enhanced image creatives. Applicable to the following creative types: ENHANCED_IMAGE." + }, + "backgroundColor": { + "type": "string", + "description": "The 6-character HTML color code, beginning with #, for the background of the window area where the Flash file is displayed. Default is white. Applicable to the following creative types: FLASH_INPAGE." + }, + "backupImageClickThroughUrl": { + "type": "string", + "description": "Click-through URL for backup image. Applicable to the following creative types: ENHANCED_BANNER, FLASH_INPAGE, and HTML5_BANNER." + }, + "backupImageFeatures": { + "type": "array", + "description": "List of feature dependencies that will cause a backup image to be served if the browser that serves the ad does not support them. Feature dependencies are features that a browser must be able to support in order to render your HTML5 creative asset correctly. This field is initially auto-generated to contain all features detected by DCM for all the assets of this creative and can then be modified by the client. To reset this field, copy over all the creativeAssets' detected features. Applicable to the following creative types: ENHANCED_BANNER and HTML5_BANNER.", + "items": { + "type": "string", + "enum": [ + "APPLICATION_CACHE", + "AUDIO", + "CANVAS", + "CANVAS_TEXT", + "CSS_ANIMATIONS", + "CSS_BACKGROUND_SIZE", + "CSS_BORDER_IMAGE", + "CSS_BORDER_RADIUS", + "CSS_BOX_SHADOW", + "CSS_COLUMNS", + "CSS_FLEX_BOX", + "CSS_FONT_FACE", + "CSS_GENERATED_CONTENT", + "CSS_GRADIENTS", + "CSS_HSLA", + "CSS_MULTIPLE_BGS", + "CSS_OPACITY", + "CSS_REFLECTIONS", + "CSS_RGBA", + "CSS_TEXT_SHADOW", + "CSS_TRANSFORMS", + "CSS_TRANSFORMS3D", + "CSS_TRANSITIONS", + "DRAG_AND_DROP", + "GEO_LOCATION", + "HASH_CHANGE", + "HISTORY", + "INDEXED_DB", + "INLINE_SVG", + "INPUT_ATTR_AUTOCOMPLETE", + "INPUT_ATTR_AUTOFOCUS", + "INPUT_ATTR_LIST", + "INPUT_ATTR_MAX", + "INPUT_ATTR_MIN", + "INPUT_ATTR_MULTIPLE", + "INPUT_ATTR_PATTERN", + "INPUT_ATTR_PLACEHOLDER", + "INPUT_ATTR_REQUIRED", + "INPUT_ATTR_STEP", + "INPUT_TYPE_COLOR", + "INPUT_TYPE_DATE", + "INPUT_TYPE_DATETIME", + "INPUT_TYPE_DATETIME_LOCAL", + "INPUT_TYPE_EMAIL", + "INPUT_TYPE_MONTH", + "INPUT_TYPE_NUMBER", + "INPUT_TYPE_RANGE", + "INPUT_TYPE_SEARCH", + "INPUT_TYPE_TEL", + "INPUT_TYPE_TIME", + "INPUT_TYPE_URL", + "INPUT_TYPE_WEEK", + "LOCAL_STORAGE", + "POST_MESSAGE", + "SESSION_STORAGE", + "SMIL", + "SVG_CLIP_PATHS", + "SVG_FE_IMAGE", + "SVG_FILTERS", + "SVG_HREF", + "TOUCH", + "VIDEO", + "WEBGL", + "WEB_SOCKETS", + "WEB_SQL_DATABASE", + "WEB_WORKERS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "backupImageReportingLabel": { + "type": "string", + "description": "Reporting label used for HTML5 banner backup image. Applicable to the following creative types: ENHANCED_BANNER." + }, + "backupImageTargetWindow": { + "$ref": "TargetWindow", + "description": "Target window for backup image. Applicable to the following creative types: ENHANCED_BANNER, FLASH_INPAGE, and HTML5_BANNER." + }, + "clickTags": { + "type": "array", + "description": "Click tags of the creative. For ENHANCED_BANNER, FLASH_INPAGE, and HTML5_BANNER creatives, this is a subset of detected click tags for the assets associated with this creative. After creating a flash asset, detected click tags will be returned in the creativeAssetMetadata. When inserting the creative, populate the creative clickTags field using the creativeAssetMetadata.clickTags field. For ENHANCED_IMAGE creatives, there should be exactly one entry in this list for each image creative asset. A click tag is matched with a corresponding creative asset by matching the clickTag.name field with the creativeAsset.assetIdentifier.name field. Applicable to the following creative types: ENHANCED_BANNER, ENHANCED_IMAGE, FLASH_INPAGE, HTML5_BANNER.", + "items": { + "$ref": "ClickTag" + } + }, + "commercialId": { + "type": "string", + "description": "Industry standard ID assigned to creative for reach and frequency. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID." + }, + "companionCreatives": { + "type": "array", + "description": "List of companion creatives assigned to an in-Stream videocreative. Acceptable values include IDs of existing flash and image creatives. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID.", + "items": { + "type": "string", + "format": "int64" + } + }, + "compatibility": { + "type": "array", + "description": "Compatibilities associated with this creative. This is a read-only field. WEB and WEB_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard. Applicable to all creative types.\n\nAcceptable values are:\n- \"APP\"\n- \"APP_INTERSTITIAL\"\n- \"IN_STREAM_VIDEO\"\n- \"WEB\"\n- \"WEB_INTERSTITIAL\"", + "items": { + "type": "string", + "enum": [ + "APP", + "APP_INTERSTITIAL", + "IN_STREAM_VIDEO", + "WEB", + "WEB_INTERSTITIAL" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + } + }, + "convertFlashToHtml5": { + "type": "boolean", + "description": "Whether Flash assets associated with the creative need to be automatically converted to HTML5. This flag is enabled by default and users can choose to disable it if they don't want the system to generate and use HTML5 asset for this creative. Applicable to the following creative types: ENHANCED_BANNER and FLASH_INPAGE." + }, + "counterCustomEvents": { + "type": "array", + "description": "List of counter events configured for the creative. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "items": { + "$ref": "CreativeCustomEvent" + } + }, + "creativeAssets": { + "type": "array", + "description": "Assets associated with a creative. Applicable to all but the following creative types: INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and REDIRECT", + "items": { + "$ref": "CreativeAsset" + } + }, + "creativeFieldAssignments": { + "type": "array", + "description": "Creative field assignments for this creative. Applicable to all creative types.", + "items": { + "$ref": "CreativeFieldAssignment" + } + }, + "customKeyValues": { + "type": "array", + "description": "Custom key-values for a Rich Media creative. Key-values let you customize the creative settings of a Rich Media ad running on your site without having to contact the advertiser. You can use key-values to dynamically change the look or functionality of a creative. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "items": { + "type": "string" + } + }, + "exitCustomEvents": { + "type": "array", + "description": "List of exit events configured for the creative. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "items": { + "$ref": "CreativeCustomEvent" + } + }, + "fsCommand": { + "$ref": "FsCommand", + "description": "OpenWindow FSCommand of this creative. This lets the SWF file communicate with either Flash Player or the program hosting Flash Player, such as a web browser. This is only triggered if allowScriptAccess field is true. Applicable to the following creative types: FLASH_INPAGE." + }, + "htmlCode": { + "type": "string", + "description": "HTML code for the creative. This is a required field when applicable. This field is ignored if htmlCodeLocked is false. Applicable to the following creative types: all CUSTOM, FLASH_INPAGE, and HTML5_BANNER, and all RICH_MEDIA." + }, + "htmlCodeLocked": { + "type": "boolean", + "description": "Whether HTML code is DCM-generated or manually entered. Set to true to ignore changes to htmlCode. Applicable to the following creative types: FLASH_INPAGE and HTML5_BANNER." + }, + "id": { + "type": "string", + "description": "ID of this creative. This is a read-only, auto-generated field. Applicable to all creative types.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this creative. This is a read-only field. Applicable to all creative types." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creative\".", + "default": "dfareporting#creative" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Creative last modification information. This is a read-only field. Applicable to all creative types." + }, + "latestTraffickedCreativeId": { + "type": "string", + "description": "Latest Studio trafficked creative ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of the creative. This is a required field and must be less than 256 characters long. Applicable to all creative types." + }, + "overrideCss": { + "type": "string", + "description": "Override CSS value for rich media creatives. Applicable to the following creative types: all RICH_MEDIA." + }, + "redirectUrl": { + "type": "string", + "description": "URL of hosted image or another ad tag. This is a required field when applicable. Applicable to the following creative types: INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and REDIRECT" + }, + "renderingId": { + "type": "string", + "description": "ID of current rendering version. This is a read-only field. Applicable to all creative types.", + "format": "int64" + }, + "renderingIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the rendering ID of this creative. This is a read-only field. Applicable to all creative types." + }, + "requiredFlashPluginVersion": { + "type": "string", + "description": "The minimum required Flash plugin version for this creative. For example, 11.2.202.235. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID." + }, + "requiredFlashVersion": { + "type": "integer", + "description": "The internal Flash version for this creative as calculated by DoubleClick Studio. This is a read-only field. Applicable to the following creative types: FLASH_INPAGE, ENHANCED_BANNER, all RICH_MEDIA, and all VPAID.", + "format": "int32" + }, + "size": { + "$ref": "Size", + "description": "Size associated with this creative. When inserting or updating a creative either the size ID field or size width and height fields can be used. This is a required field when applicable; however for IMAGE and FLASH_INPAGE creatives, if left blank, this field will be automatically set using the actual size of the associated image assets. Applicable to the following creative types: ENHANCED_BANNER, ENHANCED_IMAGE, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all RICH_MEDIA." + }, + "skippable": { + "type": "boolean", + "description": "Whether the user can choose to skip the creative. Applicable to the following creative types: INSTREAM_VIDEO." + }, + "sslCompliant": { + "type": "boolean", + "description": "Whether the creative is SSL-compliant. This is a read-only field. Applicable to all creative types." + }, + "sslOverride": { + "type": "boolean", + "description": "Whether creative should be treated as SSL compliant even if the system scan shows it's not." + }, + "studioAdvertiserId": { + "type": "string", + "description": "Studio advertiser ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "format": "int64" + }, + "studioCreativeId": { + "type": "string", + "description": "Studio creative ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "format": "int64" + }, + "studioTraffickedCreativeId": { + "type": "string", + "description": "Studio trafficked creative ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "format": "int64" + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this creative. This field, if left unset, will be auto-generated for both insert and update operations. Applicable to all creative types.", + "format": "int64" + }, + "thirdPartyBackupImageImpressionsUrl": { + "type": "string", + "description": "Third-party URL used to record backup image impressions. Applicable to the following creative types: all RICH_MEDIA" + }, + "thirdPartyRichMediaImpressionsUrl": { + "type": "string", + "description": "Third-party URL used to record rich media impressions. Applicable to the following creative types: all RICH_MEDIA" + }, + "thirdPartyUrls": { + "type": "array", + "description": "Third-party URLs for tracking in-stream video creative events. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID.", + "items": { + "$ref": "ThirdPartyTrackingUrl" + } + }, + "timerCustomEvents": { + "type": "array", + "description": "List of timer events configured for the creative. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "items": { + "$ref": "CreativeCustomEvent" + } + }, + "totalFileSize": { + "type": "string", + "description": "Combined size of all creative assets. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "Type of this creative.This is a required field. Applicable to all creative types.", + "enum": [ + "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO", + "CUSTOM_INPAGE", + "CUSTOM_INTERSTITIAL", + "ENHANCED_BANNER", + "ENHANCED_IMAGE", + "FLASH_INPAGE", + "HTML5_BANNER", + "IMAGE", + "INSTREAM_VIDEO", + "INTERNAL_REDIRECT", + "INTERSTITIAL_INTERNAL_REDIRECT", + "REDIRECT", + "RICH_MEDIA_EXPANDING", + "RICH_MEDIA_IM_EXPAND", + "RICH_MEDIA_INPAGE", + "RICH_MEDIA_INPAGE_FLOATING", + "RICH_MEDIA_INTERSTITIAL_FLOAT", + "RICH_MEDIA_MOBILE_IN_APP", + "RICH_MEDIA_MULTI_FLOATING", + "RICH_MEDIA_PEEL_DOWN", + "TRACKING_TEXT", + "VAST_REDIRECT", + "VPAID_LINEAR", + "VPAID_NON_LINEAR" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "version": { + "type": "integer", + "description": "The version number helps you keep track of multiple versions of your creative in your reports. The version number will always be auto-generated during insert operations to start at 1. For tracking creatives the version cannot be incremented and will always remain at 1. For all other creative types the version can be incremented only by 1 during update operations. In addition, the version will be automatically incremented by 1 when undergoing Rich Media creative merging. Applicable to all creative types.", + "format": "int32" + }, + "videoDescription": { + "type": "string", + "description": "Description of the video ad. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID." + }, + "videoDuration": { + "type": "number", + "description": "Creative video duration in seconds. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO, all RICH_MEDIA, and all VPAID.", + "format": "float" + } + } + }, + "CreativeAsset": { + "id": "CreativeAsset", + "type": "object", + "description": "Creative Asset.", + "properties": { + "actionScript3": { + "type": "boolean", + "description": "Whether ActionScript3 is enabled for the flash asset. This is a read-only field. Applicable to the following creative types: FLASH_INPAGE and ENHANCED_BANNER." + }, + "active": { + "type": "boolean", + "description": "Whether the video asset is active. This is a read-only field for VPAID_NON_LINEAR assets. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID." + }, + "alignment": { + "type": "string", + "description": "Possible alignments for an asset. This is a read-only field. Applicable to the following creative types: RICH_MEDIA_MULTI_FLOATING.", + "enum": [ + "ALIGNMENT_BOTTOM", + "ALIGNMENT_LEFT", + "ALIGNMENT_RIGHT", + "ALIGNMENT_TOP" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "artworkType": { + "type": "string", + "description": "Artwork type of rich media creative. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA.", + "enum": [ + "ARTWORK_TYPE_FLASH", + "ARTWORK_TYPE_HTML5", + "ARTWORK_TYPE_MIXED" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "assetIdentifier": { + "$ref": "CreativeAssetId", + "description": "Identifier of this asset. This is the same identifier returned during creative asset insert operation. This is a required field. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT." + }, + "backupImageExit": { + "$ref": "CreativeCustomEvent", + "description": "Exit event configured for the backup image. Applicable to the following creative types: all RICH_MEDIA." + }, + "bitRate": { + "type": "integer", + "description": "Detected bit-rate for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID.", + "format": "int32" + }, + "childAssetType": { + "type": "string", + "description": "Rich media child asset type. This is a read-only field. Applicable to the following creative types: all VPAID.", + "enum": [ + "CHILD_ASSET_TYPE_DATA", + "CHILD_ASSET_TYPE_FLASH", + "CHILD_ASSET_TYPE_IMAGE", + "CHILD_ASSET_TYPE_VIDEO" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "collapsedSize": { + "$ref": "Size", + "description": "Size of an asset when collapsed. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA and all VPAID. Additionally, applicable to assets whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN." + }, + "customStartTimeValue": { + "type": "integer", + "description": "Custom start time in seconds for making the asset visible. Applicable to the following creative types: all RICH_MEDIA.", + "format": "int32" + }, + "detectedFeatures": { + "type": "array", + "description": "List of feature dependencies for the creative asset that are detected by DCM. Feature dependencies are features that a browser must be able to support in order to render your HTML5 creative correctly. This is a read-only, auto-generated field. Applicable to the following creative types: ENHANCED_BANNER and HTML5_BANNER.", + "items": { + "type": "string", + "enum": [ + "APPLICATION_CACHE", + "AUDIO", + "CANVAS", + "CANVAS_TEXT", + "CSS_ANIMATIONS", + "CSS_BACKGROUND_SIZE", + "CSS_BORDER_IMAGE", + "CSS_BORDER_RADIUS", + "CSS_BOX_SHADOW", + "CSS_COLUMNS", + "CSS_FLEX_BOX", + "CSS_FONT_FACE", + "CSS_GENERATED_CONTENT", + "CSS_GRADIENTS", + "CSS_HSLA", + "CSS_MULTIPLE_BGS", + "CSS_OPACITY", + "CSS_REFLECTIONS", + "CSS_RGBA", + "CSS_TEXT_SHADOW", + "CSS_TRANSFORMS", + "CSS_TRANSFORMS3D", + "CSS_TRANSITIONS", + "DRAG_AND_DROP", + "GEO_LOCATION", + "HASH_CHANGE", + "HISTORY", + "INDEXED_DB", + "INLINE_SVG", + "INPUT_ATTR_AUTOCOMPLETE", + "INPUT_ATTR_AUTOFOCUS", + "INPUT_ATTR_LIST", + "INPUT_ATTR_MAX", + "INPUT_ATTR_MIN", + "INPUT_ATTR_MULTIPLE", + "INPUT_ATTR_PATTERN", + "INPUT_ATTR_PLACEHOLDER", + "INPUT_ATTR_REQUIRED", + "INPUT_ATTR_STEP", + "INPUT_TYPE_COLOR", + "INPUT_TYPE_DATE", + "INPUT_TYPE_DATETIME", + "INPUT_TYPE_DATETIME_LOCAL", + "INPUT_TYPE_EMAIL", + "INPUT_TYPE_MONTH", + "INPUT_TYPE_NUMBER", + "INPUT_TYPE_RANGE", + "INPUT_TYPE_SEARCH", + "INPUT_TYPE_TEL", + "INPUT_TYPE_TIME", + "INPUT_TYPE_URL", + "INPUT_TYPE_WEEK", + "LOCAL_STORAGE", + "POST_MESSAGE", + "SESSION_STORAGE", + "SMIL", + "SVG_CLIP_PATHS", + "SVG_FE_IMAGE", + "SVG_FILTERS", + "SVG_HREF", + "TOUCH", + "VIDEO", + "WEBGL", + "WEB_SOCKETS", + "WEB_SQL_DATABASE", + "WEB_WORKERS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "displayType": { + "type": "string", + "description": "Type of rich media asset. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA.", + "enum": [ + "ASSET_DISPLAY_TYPE_EXPANDING", + "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH", + "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH_EXPANDING", + "ASSET_DISPLAY_TYPE_FLOATING", + "ASSET_DISPLAY_TYPE_INPAGE", + "ASSET_DISPLAY_TYPE_OVERLAY", + "ASSET_DISPLAY_TYPE_PEEL_DOWN", + "ASSET_DISPLAY_TYPE_VPAID_LINEAR", + "ASSET_DISPLAY_TYPE_VPAID_NON_LINEAR" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "duration": { + "type": "integer", + "description": "Duration in seconds for which an asset will be displayed. Applicable to the following creative types: INSTREAM_VIDEO and VPAID_LINEAR.", + "format": "int32" + }, + "durationType": { + "type": "string", + "description": "Duration type for which an asset will be displayed. Applicable to the following creative types: all RICH_MEDIA.", + "enum": [ + "ASSET_DURATION_TYPE_AUTO", + "ASSET_DURATION_TYPE_CUSTOM", + "ASSET_DURATION_TYPE_NONE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "expandedDimension": { + "$ref": "Size", + "description": "Detected expanded dimension for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID." + }, + "fileSize": { + "type": "string", + "description": "File size associated with this creative asset. This is a read-only field. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT.", + "format": "int64" + }, + "flashVersion": { + "type": "integer", + "description": "Flash version of the asset. This is a read-only field. Applicable to the following creative types: FLASH_INPAGE, ENHANCED_BANNER, all RICH_MEDIA, and all VPAID.", + "format": "int32" + }, + "hideFlashObjects": { + "type": "boolean", + "description": "Whether to hide Flash objects flag for an asset. Applicable to the following creative types: all RICH_MEDIA." + }, + "hideSelectionBoxes": { + "type": "boolean", + "description": "Whether to hide selection boxes flag for an asset. Applicable to the following creative types: all RICH_MEDIA." + }, + "horizontallyLocked": { + "type": "boolean", + "description": "Whether the asset is horizontally locked. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA." + }, + "id": { + "type": "string", + "description": "Numeric ID of this creative asset. This is a required field and should not be modified. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT.", + "format": "int64" + }, + "mimeType": { + "type": "string", + "description": "Detected MIME type for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID." + }, + "offset": { + "$ref": "OffsetPosition", + "description": "Offset position for an asset in collapsed mode. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA and all VPAID. Additionally, only applicable to assets whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN." + }, + "originalBackup": { + "type": "boolean", + "description": "Whether the backup asset is original or changed by the user in DCM. Applicable to the following creative types: all RICH_MEDIA." + }, + "position": { + "$ref": "OffsetPosition", + "description": "Offset position for an asset. Applicable to the following creative types: all RICH_MEDIA." + }, + "positionLeftUnit": { + "type": "string", + "description": "Offset left unit for an asset. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA.", + "enum": [ + "OFFSET_UNIT_PERCENT", + "OFFSET_UNIT_PIXEL", + "OFFSET_UNIT_PIXEL_FROM_CENTER" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "positionTopUnit": { + "type": "string", + "description": "Offset top unit for an asset. This is a read-only field if the asset displayType is ASSET_DISPLAY_TYPE_OVERLAY. Applicable to the following creative types: all RICH_MEDIA.", + "enum": [ + "OFFSET_UNIT_PERCENT", + "OFFSET_UNIT_PIXEL", + "OFFSET_UNIT_PIXEL_FROM_CENTER" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "progressiveServingUrl": { + "type": "string", + "description": "Progressive URL for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID." + }, + "pushdown": { + "type": "boolean", + "description": "Whether the asset pushes down other content. Applicable to the following creative types: all RICH_MEDIA. Additionally, only applicable when the asset offsets are 0, the collapsedSize.width matches size.width, and the collapsedSize.height is less than size.height." + }, + "pushdownDuration": { + "type": "number", + "description": "Pushdown duration in seconds for an asset. Must be between 0 and 9.99. Applicable to the following creative types: all RICH_MEDIA.Additionally, only applicable when the asset pushdown field is true, the offsets are 0, the collapsedSize.width matches size.width, and the collapsedSize.height is less than size.height.", + "format": "float" + }, + "role": { + "type": "string", + "description": "Role of the asset in relation to creative. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT. This is a required field.\nPRIMARY applies to ENHANCED_BANNER, FLASH_INPAGE, HTML5_BANNER, IMAGE, IMAGE_GALLERY, all RICH_MEDIA (which may contain multiple primary assets), and all VPAID creatives.\nBACKUP_IMAGE applies to ENHANCED_BANNER, FLASH_INPAGE, HTML5_BANNER, all RICH_MEDIA, and all VPAID creatives.\nADDITIONAL_IMAGE and ADDITIONAL_FLASH apply to FLASH_INPAGE creatives.\nOTHER refers to assets from sources other than DCM, such as Studio uploaded assets, applicable to all RICH_MEDIA and all VPAID creatives.\nPARENT_VIDEO refers to videos uploaded by the user in DCM and is applicable to INSTREAM_VIDEO and VPAID_LINEAR creatives.\nTRANSCODED_VIDEO refers to videos transcoded by DCM from PARENT_VIDEO assets and is applicable to INSTREAM_VIDEO and VPAID_LINEAR creatives.\nALTERNATE_VIDEO refers to the DCM representation of child asset videos from Studio, and is applicable to VPAID_LINEAR creatives. These cannot be added or removed within DCM.\nFor VPAID_LINEAR creatives, PARENT_VIDEO, TRANSCODED_VIDEO and ALTERNATE_VIDEO assets that are marked active serve as backup in case the VPAID creative cannot be served. Only PARENT_VIDEO assets can be added or removed for an INSTREAM_VIDEO or VPAID_LINEAR creative.", + "enum": [ + "ADDITIONAL_FLASH", + "ADDITIONAL_IMAGE", + "ALTERNATE_VIDEO", + "BACKUP_IMAGE", + "OTHER", + "PARENT_VIDEO", + "PRIMARY", + "TRANSCODED_VIDEO" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "size": { + "$ref": "Size", + "description": "Size associated with this creative asset. This is a required field when applicable; however for IMAGE and FLASH_INPAGE creatives, if left blank, this field will be automatically set using the actual size of the associated image asset. Applicable to the following creative types: ENHANCED_BANNER, ENHANCED_IMAGE, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all RICH_MEDIA." + }, + "sslCompliant": { + "type": "boolean", + "description": "Whether the asset is SSL-compliant. This is a read-only field. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT." + }, + "startTimeType": { + "type": "string", + "description": "Initial wait time type before making the asset visible. Applicable to the following creative types: all RICH_MEDIA.", + "enum": [ + "ASSET_START_TIME_TYPE_CUSTOM", + "ASSET_START_TIME_TYPE_NONE" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "streamingServingUrl": { + "type": "string", + "description": "Streaming URL for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID." + }, + "transparency": { + "type": "boolean", + "description": "Whether the asset is transparent. Applicable to the following creative types: all RICH_MEDIA. Additionally, only applicable to HTML5 assets." + }, + "verticallyLocked": { + "type": "boolean", + "description": "Whether the asset is vertically locked. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA." + }, + "videoDuration": { + "type": "number", + "description": "Detected video duration for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID.", + "format": "float" + }, + "windowMode": { + "type": "string", + "description": "Window mode options for flash assets. Applicable to the following creative types: FLASH_INPAGE, RICH_MEDIA_EXPANDING, RICH_MEDIA_IM_EXPAND, RICH_MEDIA_INPAGE, and RICH_MEDIA_INPAGE_FLOATING.", + "enum": [ + "OPAQUE", + "TRANSPARENT", + "WINDOW" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "zIndex": { + "type": "integer", + "description": "zIndex value of an asset. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA.Additionally, only applicable to assets whose displayType is NOT one of the following types: ASSET_DISPLAY_TYPE_INPAGE or ASSET_DISPLAY_TYPE_OVERLAY.", + "format": "int32" + }, + "zipFilename": { + "type": "string", + "description": "File name of zip file. This is a read-only field. Applicable to the following creative types: HTML5_BANNER." + }, + "zipFilesize": { + "type": "string", + "description": "Size of zip file. This is a read-only field. Applicable to the following creative types: HTML5_BANNER." + } + } + }, + "CreativeAssetId": { + "id": "CreativeAssetId", + "type": "object", + "description": "Creative Asset ID.", + "properties": { + "name": { + "type": "string", + "description": "Name of the creative asset. This is a required field while inserting an asset. After insertion, this assetIdentifier is used to identify the uploaded asset. Characters in the name must be alphanumeric or one of the following: \".-_ \". Spaces are allowed." + }, + "type": { + "type": "string", + "description": "Type of asset to upload. This is a required field. IMAGE is solely used for IMAGE creatives. Other image assets should use HTML_IMAGE.", + "enum": [ + "FLASH", + "HTML", + "HTML_IMAGE", + "IMAGE", + "VIDEO" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + } + } + }, + "CreativeAssetMetadata": { + "id": "CreativeAssetMetadata", + "type": "object", + "description": "CreativeAssets contains properties of a creative asset file which will be uploaded or has already been uploaded. Refer to the creative sample code for how to upload assets and insert a creative.", + "properties": { + "assetIdentifier": { + "$ref": "CreativeAssetId", + "description": "ID of the creative asset. This is a required field." + }, + "clickTags": { + "type": "array", + "description": "List of detected click tags for assets. This is a read-only auto-generated field.", + "items": { + "$ref": "ClickTag" + } + }, + "detectedFeatures": { + "type": "array", + "description": "List of feature dependencies for the creative asset that are detected by DCM. Feature dependencies are features that a browser must be able to support in order to render your HTML5 creative correctly. This is a read-only, auto-generated field.", + "items": { + "type": "string", + "enum": [ + "APPLICATION_CACHE", + "AUDIO", + "CANVAS", + "CANVAS_TEXT", + "CSS_ANIMATIONS", + "CSS_BACKGROUND_SIZE", + "CSS_BORDER_IMAGE", + "CSS_BORDER_RADIUS", + "CSS_BOX_SHADOW", + "CSS_COLUMNS", + "CSS_FLEX_BOX", + "CSS_FONT_FACE", + "CSS_GENERATED_CONTENT", + "CSS_GRADIENTS", + "CSS_HSLA", + "CSS_MULTIPLE_BGS", + "CSS_OPACITY", + "CSS_REFLECTIONS", + "CSS_RGBA", + "CSS_TEXT_SHADOW", + "CSS_TRANSFORMS", + "CSS_TRANSFORMS3D", + "CSS_TRANSITIONS", + "DRAG_AND_DROP", + "GEO_LOCATION", + "HASH_CHANGE", + "HISTORY", + "INDEXED_DB", + "INLINE_SVG", + "INPUT_ATTR_AUTOCOMPLETE", + "INPUT_ATTR_AUTOFOCUS", + "INPUT_ATTR_LIST", + "INPUT_ATTR_MAX", + "INPUT_ATTR_MIN", + "INPUT_ATTR_MULTIPLE", + "INPUT_ATTR_PATTERN", + "INPUT_ATTR_PLACEHOLDER", + "INPUT_ATTR_REQUIRED", + "INPUT_ATTR_STEP", + "INPUT_TYPE_COLOR", + "INPUT_TYPE_DATE", + "INPUT_TYPE_DATETIME", + "INPUT_TYPE_DATETIME_LOCAL", + "INPUT_TYPE_EMAIL", + "INPUT_TYPE_MONTH", + "INPUT_TYPE_NUMBER", + "INPUT_TYPE_RANGE", + "INPUT_TYPE_SEARCH", + "INPUT_TYPE_TEL", + "INPUT_TYPE_TIME", + "INPUT_TYPE_URL", + "INPUT_TYPE_WEEK", + "LOCAL_STORAGE", + "POST_MESSAGE", + "SESSION_STORAGE", + "SMIL", + "SVG_CLIP_PATHS", + "SVG_FE_IMAGE", + "SVG_FILTERS", + "SVG_HREF", + "TOUCH", + "VIDEO", + "WEBGL", + "WEB_SOCKETS", + "WEB_SQL_DATABASE", + "WEB_WORKERS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeAssetMetadata\".", + "default": "dfareporting#creativeAssetMetadata" + }, + "warnedValidationRules": { + "type": "array", + "description": "Rules validated during code generation that generated a warning. This is a read-only, auto-generated field.\n\nPossible values are:\n- \"CLICK_TAG_NON_TOP_LEVEL\"\n- \"CLICK_TAG_MISSING\"\n- \"CLICK_TAG_MORE_THAN_ONE\"\n- \"CLICK_TAG_INVALID\"\n- \"ORPHANED_ASSET\"\n- \"PRIMARY_HTML_MISSING\"\n- \"EXTERNAL_FILE_REFERENCED\"\n- \"MRAID_REFERENCED\"\n- \"ADMOB_REFERENCED\"\n- \"FILE_TYPE_INVALID\"\n- \"ZIP_INVALID\"\n- \"LINKED_FILE_NOT_FOUND\"\n- \"MAX_FLASH_VERSION_11\"\n- \"NOT_SSL_COMPLIANT\"\n- \"FILE_DETAIL_EMPTY\"\n- \"ASSET_INVALID\"\n- \"GWD_PROPERTIES_INVALID\"\n- \"ENABLER_UNSUPPORTED_METHOD_DCM\"\n- \"ASSET_FORMAT_UNSUPPORTED_DCM\"\n- \"COMPONENT_UNSUPPORTED_DCM\"\n- \"HTML5_FEATURE_UNSUPPORTED' \"", + "items": { + "type": "string", + "enum": [ + "ADMOB_REFERENCED", + "ASSET_FORMAT_UNSUPPORTED_DCM", + "ASSET_INVALID", + "CLICK_TAG_INVALID", + "CLICK_TAG_MISSING", + "CLICK_TAG_MORE_THAN_ONE", + "CLICK_TAG_NON_TOP_LEVEL", + "COMPONENT_UNSUPPORTED_DCM", + "ENABLER_UNSUPPORTED_METHOD_DCM", + "EXTERNAL_FILE_REFERENCED", + "FILE_DETAIL_EMPTY", + "FILE_TYPE_INVALID", + "GWD_PROPERTIES_INVALID", + "HTML5_FEATURE_UNSUPPORTED", + "LINKED_FILE_NOT_FOUND", + "MAX_FLASH_VERSION_11", + "MRAID_REFERENCED", + "NOT_SSL_COMPLIANT", + "ORPHANED_ASSET", + "PRIMARY_HTML_MISSING", + "ZIP_INVALID" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + } + }, + "CreativeAssignment": { + "id": "CreativeAssignment", + "type": "object", + "description": "Creative Assignment.", + "properties": { + "active": { + "type": "boolean", + "description": "Whether this creative assignment is active. When true, the creative will be included in the ad's rotation." + }, + "applyEventTags": { + "type": "boolean", + "description": "Whether applicable event tags should fire when this creative assignment is rendered. If this value is unset when the ad is inserted or updated, it will default to true for all creative types EXCEPT for INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and INSTREAM_VIDEO." + }, + "clickThroughUrl": { + "$ref": "ClickThroughUrl", + "description": "Click-through URL of the creative assignment." + }, + "companionCreativeOverrides": { + "type": "array", + "description": "Companion creative overrides for this creative assignment. Applicable to video ads.", + "items": { + "$ref": "CompanionClickThroughOverride" + } + }, + "creativeGroupAssignments": { + "type": "array", + "description": "Creative group assignments for this creative assignment. Only one assignment per creative group number is allowed for a maximum of two assignments.", + "items": { + "$ref": "CreativeGroupAssignment" + } + }, + "creativeId": { + "type": "string", + "description": "ID of the creative to be assigned. This is a required field.", + "format": "int64" + }, + "creativeIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the creative. This is a read-only, auto-generated field." + }, + "endTime": { + "type": "string", + "description": "Date and time that the assigned creative should stop serving. Must be later than the start time.", + "format": "date-time" + }, + "richMediaExitOverrides": { + "type": "array", + "description": "Rich media exit overrides for this creative assignment.\nApplicable when the creative type is any of the following: \n- RICH_MEDIA_INPAGE\n- RICH_MEDIA_INPAGE_FLOATING\n- RICH_MEDIA_IM_EXPAND\n- RICH_MEDIA_EXPANDING\n- RICH_MEDIA_INTERSTITIAL_FLOAT\n- RICH_MEDIA_MOBILE_IN_APP\n- RICH_MEDIA_MULTI_FLOATING\n- RICH_MEDIA_PEEL_DOWN\n- ADVANCED_BANNER\n- VPAID_LINEAR\n- VPAID_NON_LINEAR", + "items": { + "$ref": "RichMediaExitOverride" + } + }, + "sequence": { + "type": "integer", + "description": "Sequence number of the creative assignment, applicable when the rotation type is CREATIVE_ROTATION_TYPE_SEQUENTIAL.", + "format": "int32" + }, + "sslCompliant": { + "type": "boolean", + "description": "Whether the creative to be assigned is SSL-compliant. This is a read-only field that is auto-generated when the ad is inserted or updated." + }, + "startTime": { + "type": "string", + "description": "Date and time that the assigned creative should start serving.", + "format": "date-time" + }, + "weight": { + "type": "integer", + "description": "Weight of the creative assignment, applicable when the rotation type is CREATIVE_ROTATION_TYPE_RANDOM.", + "format": "int32" + } + } + }, + "CreativeCustomEvent": { + "id": "CreativeCustomEvent", + "type": "object", + "description": "Creative Custom Event.", + "properties": { + "advertiserCustomEventName": { + "type": "string", + "description": "User-entered name for the event." + }, + "advertiserCustomEventType": { + "type": "string", + "description": "Type of the event. This is a read-only field.", + "enum": [ + "ADVERTISER_EVENT_COUNTER", + "ADVERTISER_EVENT_EXIT", + "ADVERTISER_EVENT_TIMER" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "artworkLabel": { + "type": "string", + "description": "Artwork label column, used to link events in DCM back to events in Studio. This is a required field and should not be modified after insertion." + }, + "artworkType": { + "type": "string", + "description": "Artwork type used by the creative.This is a read-only field.", + "enum": [ + "ARTWORK_TYPE_FLASH", + "ARTWORK_TYPE_HTML5", + "ARTWORK_TYPE_MIXED" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "exitUrl": { + "type": "string", + "description": "Exit URL of the event. This field is used only for exit events." + }, + "id": { + "type": "string", + "description": "ID of this event. This is a required field and should not be modified after insertion.", + "format": "int64" + }, + "popupWindowProperties": { + "$ref": "PopupWindowProperties", + "description": "Properties for rich media popup windows. This field is used only for exit events." + }, + "targetType": { + "type": "string", + "description": "Target type used by the event.", + "enum": [ + "TARGET_BLANK", + "TARGET_PARENT", + "TARGET_POPUP", + "TARGET_SELF", + "TARGET_TOP" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "videoReportingId": { + "type": "string", + "description": "Reporting ID, used to differentiate multiple videos in a single creative." + } + } + }, + "CreativeField": { + "id": "CreativeField", + "type": "object", + "description": "Contains properties of a creative field.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this creative field. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this creative field. This is a required field on insertion.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "id": { + "type": "string", + "description": "ID of this creative field. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeField\".", + "default": "dfareporting#creativeField" + }, + "name": { + "type": "string", + "description": "Name of this creative field. This is a required field and must be less than 256 characters long and unique among creative fields of the same advertiser." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this creative field. This is a read-only field that can be left blank.", + "format": "int64" + } + } + }, + "CreativeFieldAssignment": { + "id": "CreativeFieldAssignment", + "type": "object", + "description": "Creative Field Assignment.", + "properties": { + "creativeFieldId": { + "type": "string", + "description": "ID of the creative field.", + "format": "int64" + }, + "creativeFieldValueId": { + "type": "string", + "description": "ID of the creative field value.", + "format": "int64" + } + } + }, + "CreativeFieldValue": { + "id": "CreativeFieldValue", + "type": "object", + "description": "Contains properties of a creative field value.", + "properties": { + "id": { + "type": "string", + "description": "ID of this creative field value. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeFieldValue\".", + "default": "dfareporting#creativeFieldValue" + }, + "value": { + "type": "string", + "description": "Value of this creative field value. It needs to be less than 256 characters in length and unique per creative field." + } + } + }, + "CreativeFieldValuesListResponse": { + "id": "CreativeFieldValuesListResponse", + "type": "object", + "description": "Creative Field Value List Response", + "properties": { + "creativeFieldValues": { + "type": "array", + "description": "Creative field value collection.", + "items": { + "$ref": "CreativeFieldValue" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeFieldValuesListResponse\".", + "default": "dfareporting#creativeFieldValuesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "CreativeFieldsListResponse": { + "id": "CreativeFieldsListResponse", + "type": "object", + "description": "Creative Field List Response", + "properties": { + "creativeFields": { + "type": "array", + "description": "Creative field collection.", + "items": { + "$ref": "CreativeField" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeFieldsListResponse\".", + "default": "dfareporting#creativeFieldsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "CreativeGroup": { + "id": "CreativeGroup", + "type": "object", + "description": "Contains properties of a creative group.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this creative group. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this creative group. This is a required field on insertion.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "groupNumber": { + "type": "integer", + "description": "Subgroup of the creative group. Assign your creative groups to one of the following subgroups in order to filter or manage them more easily. This field is required on insertion and is read-only after insertion.\nAcceptable values are: \n- 1\n- 2", + "format": "int32" + }, + "id": { + "type": "string", + "description": "ID of this creative group. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeGroup\".", + "default": "dfareporting#creativeGroup" + }, + "name": { + "type": "string", + "description": "Name of this creative group. This is a required field and must be less than 256 characters long and unique among creative groups of the same advertiser." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this creative group. This is a read-only field that can be left blank.", + "format": "int64" + } + } + }, + "CreativeGroupAssignment": { + "id": "CreativeGroupAssignment", + "type": "object", + "description": "Creative Group Assignment.", + "properties": { + "creativeGroupId": { + "type": "string", + "description": "ID of the creative group to be assigned.", + "format": "int64" + }, + "creativeGroupNumber": { + "type": "string", + "description": "Creative group number of the creative group assignment.", + "enum": [ + "CREATIVE_GROUP_ONE", + "CREATIVE_GROUP_TWO" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "CreativeGroupsListResponse": { + "id": "CreativeGroupsListResponse", + "type": "object", + "description": "Creative Group List Response", + "properties": { + "creativeGroups": { + "type": "array", + "description": "Creative group collection.", + "items": { + "$ref": "CreativeGroup" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativeGroupsListResponse\".", + "default": "dfareporting#creativeGroupsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "CreativeOptimizationConfiguration": { + "id": "CreativeOptimizationConfiguration", + "type": "object", + "description": "Creative optimization settings.", + "properties": { + "id": { + "type": "string", + "description": "ID of this creative optimization config. This field is auto-generated when the campaign is inserted or updated. It can be null for existing campaigns.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this creative optimization config. This is a required field and must be less than 129 characters long." + }, + "optimizationActivitys": { + "type": "array", + "description": "List of optimization activities associated with this configuration.", + "items": { + "$ref": "OptimizationActivity" + } + }, + "optimizationModel": { + "type": "string", + "description": "Optimization model for this configuration.", + "enum": [ + "CLICK", + "POST_CLICK", + "POST_CLICK_AND_IMPRESSION", + "POST_IMPRESSION" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "CreativeRotation": { + "id": "CreativeRotation", + "type": "object", + "description": "Creative Rotation.", + "properties": { + "creativeAssignments": { + "type": "array", + "description": "Creative assignments in this creative rotation.", + "items": { + "$ref": "CreativeAssignment" + } + }, + "creativeOptimizationConfigurationId": { + "type": "string", + "description": "Creative optimization configuration that is used by this ad. It should refer to one of the existing optimization configurations in the ad's campaign. If it is unset or set to 0, then the campaign's default optimization configuration will be used for this ad.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "Type of creative rotation. Can be used to specify whether to use sequential or random rotation.", + "enum": [ + "CREATIVE_ROTATION_TYPE_RANDOM", + "CREATIVE_ROTATION_TYPE_SEQUENTIAL" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "weightCalculationStrategy": { + "type": "string", + "description": "Strategy for calculating weights. Used with CREATIVE_ROTATION_TYPE_RANDOM.", + "enum": [ + "WEIGHT_STRATEGY_CUSTOM", + "WEIGHT_STRATEGY_EQUAL", + "WEIGHT_STRATEGY_HIGHEST_CTR", + "WEIGHT_STRATEGY_OPTIMIZED" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "CreativeSettings": { + "id": "CreativeSettings", + "type": "object", + "description": "Creative Settings", + "properties": { + "iFrameFooter": { + "type": "string", + "description": "Header text for iFrames for this site. Must be less than or equal to 2000 characters long." + }, + "iFrameHeader": { + "type": "string", + "description": "Header text for iFrames for this site. Must be less than or equal to 2000 characters long." + } + } + }, + "CreativesListResponse": { + "id": "CreativesListResponse", + "type": "object", + "description": "Creative List Response", + "properties": { + "creatives": { + "type": "array", + "description": "Creative collection.", + "items": { + "$ref": "Creative" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#creativesListResponse\".", + "default": "dfareporting#creativesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "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.", + "enum": [ + "LAST_24_MONTHS", + "LAST_30_DAYS", + "LAST_365_DAYS", + "LAST_7_DAYS", + "LAST_90_DAYS", + "MONTH_TO_DATE", + "PREVIOUS_MONTH", + "PREVIOUS_QUARTER", + "PREVIOUS_WEEK", + "PREVIOUS_YEAR", + "QUARTER_TO_DATE", + "TODAY", + "WEEK_TO_DATE", + "YEAR_TO_DATE", + "YESTERDAY" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "startDate": { + "type": "string", + "description": "The start date of the date range, inclusive. A string of the format: \"yyyy-MM-dd\".", + "format": "date" + } + } + }, + "DayPartTargeting": { + "id": "DayPartTargeting", + "type": "object", + "description": "Day Part Targeting.", + "properties": { + "daysOfWeek": { + "type": "array", + "description": "Days of the week when the ad will serve.\n\nAcceptable values are:\n- \"SUNDAY\"\n- \"MONDAY\"\n- \"TUESDAY\"\n- \"WEDNESDAY\"\n- \"THURSDAY\"\n- \"FRIDAY\"\n- \"SATURDAY\"", + "items": { + "type": "string", + "enum": [ + "FRIDAY", + "MONDAY", + "SATURDAY", + "SUNDAY", + "THURSDAY", + "TUESDAY", + "WEDNESDAY" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "hoursOfDay": { + "type": "array", + "description": "Hours of the day when the ad will serve. Must be an integer between 0 and 23 (inclusive), where 0 is midnight to 1 AM, and 23 is 11 PM to midnight. Can be specified with days of week, in which case the ad would serve during these hours on the specified days. For example, if Monday, Wednesday, Friday are the days of week specified and 9-10am, 3-5pm (hours 9, 15, and 16) is specified, the ad would serve Monday, Wednesdays, and Fridays at 9-10am and 3-5pm.", + "items": { + "type": "integer", + "format": "int32" + } + }, + "userLocalTime": { + "type": "boolean", + "description": "Whether or not to use the user's local time. If false, the America/New York time zone applies." + } + } + }, + "DefaultClickThroughEventTagProperties": { + "id": "DefaultClickThroughEventTagProperties", + "type": "object", + "description": "Properties of inheriting and overriding the default click-through event tag. A campaign may override the event tag defined at the advertiser level, and an ad may also override the campaign's setting further.", + "properties": { + "defaultClickThroughEventTagId": { + "type": "string", + "description": "ID of the click-through event tag to apply to all ads in this entity's scope.", + "format": "int64" + }, + "overrideInheritedEventTag": { + "type": "boolean", + "description": "Whether this entity should override the inherited default click-through event tag with its own defined value." + } + } + }, + "DeliverySchedule": { + "id": "DeliverySchedule", + "type": "object", + "description": "Delivery Schedule.", + "properties": { + "frequencyCap": { + "$ref": "FrequencyCap", + "description": "Limit on the number of times an individual user can be served the ad within a specified period of time." + }, + "hardCutoff": { + "type": "boolean", + "description": "Whether or not hard cutoff is enabled. If true, the ad will not serve after the end date and time. Otherwise the ad will continue to be served until it has reached its delivery goals." + }, + "impressionRatio": { + "type": "string", + "description": "Impression ratio for this ad. This ratio determines how often each ad is served relative to the others. For example, if ad A has an impression ratio of 1 and ad B has an impression ratio of 3, then DCM will serve ad B three times as often as ad A. Must be between 1 and 10.", + "format": "int64" + }, + "priority": { + "type": "string", + "description": "Serving priority of an ad, with respect to other ads. The lower the priority number, the greater the priority with which it is served.", + "enum": [ + "AD_PRIORITY_01", + "AD_PRIORITY_02", + "AD_PRIORITY_03", + "AD_PRIORITY_04", + "AD_PRIORITY_05", + "AD_PRIORITY_06", + "AD_PRIORITY_07", + "AD_PRIORITY_08", + "AD_PRIORITY_09", + "AD_PRIORITY_10", + "AD_PRIORITY_11", + "AD_PRIORITY_12", + "AD_PRIORITY_13", + "AD_PRIORITY_14", + "AD_PRIORITY_15", + "AD_PRIORITY_16" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "DfpSettings": { + "id": "DfpSettings", + "type": "object", + "description": "DFP Settings", + "properties": { + "dfp_network_code": { + "type": "string", + "description": "DFP network code for this directory site." + }, + "dfp_network_name": { + "type": "string", + "description": "DFP network name for this directory site." + }, + "programmaticPlacementAccepted": { + "type": "boolean", + "description": "Whether this directory site accepts programmatic placements." + }, + "pubPaidPlacementAccepted": { + "type": "boolean", + "description": "Whether this directory site accepts publisher-paid tags." + }, + "publisherPortalOnly": { + "type": "boolean", + "description": "Whether this directory site is available only via DoubleClick Publisher Portal." + } + } + }, + "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. If not specified, defaults to EXACT. If set to WILDCARD_EXPRESSION, '*' is allowed as a placeholder for variable length character sequences, and it can be escaped with a backslash. Note, only paid search dimensions ('dfa:paidSearch*') allow a matchType other than EXACT.", + "enum": [ + "BEGINS_WITH", + "CONTAINS", + "EXACT", + "WILDCARD_EXPRESSION" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "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" + ] + } + } + } + }, + "DirectorySite": { + "id": "DirectorySite", + "type": "object", + "description": "DirectorySites contains properties of a website from the Site Directory. Sites need to be added to an account via the Sites resource before they can be assigned to a placement.", + "properties": { + "active": { + "type": "boolean", + "description": "Whether this directory site is active." + }, + "contactAssignments": { + "type": "array", + "description": "Directory site contacts.", + "items": { + "$ref": "DirectorySiteContactAssignment" + } + }, + "countryId": { + "type": "string", + "description": "Country ID of this directory site.", + "format": "int64" + }, + "currencyId": { + "type": "string", + "description": "Currency ID of this directory site.\nPossible values are: \n- \"1\" for USD \n- \"2\" for GBP \n- \"3\" for ESP \n- \"4\" for SEK \n- \"5\" for CAD \n- \"6\" for JPY \n- \"7\" for DEM \n- \"8\" for AUD \n- \"9\" for FRF \n- \"10\" for ITL \n- \"11\" for DKK \n- \"12\" for NOK \n- \"13\" for FIM \n- \"14\" for ZAR \n- \"15\" for IEP \n- \"16\" for NLG \n- \"17\" for EUR \n- \"18\" for KRW \n- \"19\" for TWD \n- \"20\" for SGD \n- \"21\" for CNY \n- \"22\" for HKD \n- \"23\" for NZD \n- \"24\" for MYR \n- \"25\" for BRL \n- \"26\" for PTE \n- \"27\" for MXP \n- \"28\" for CLP \n- \"29\" for TRY \n- \"30\" for ARS \n- \"31\" for PEN \n- \"32\" for ILS \n- \"33\" for CHF \n- \"34\" for VEF \n- \"35\" for COP \n- \"36\" for GTQ", + "format": "int64" + }, + "description": { + "type": "string", + "description": "Description of this directory site." + }, + "id": { + "type": "string", + "description": "ID of this directory site. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this directory site. This is a read-only, auto-generated field." + }, + "inpageTagFormats": { + "type": "array", + "description": "Tag types for regular placements.\n\nAcceptable values are:\n- \"STANDARD\"\n- \"IFRAME_JAVASCRIPT_INPAGE\"\n- \"INTERNAL_REDIRECT_INPAGE\"\n- \"JAVASCRIPT_INPAGE\"", + "items": { + "type": "string", + "enum": [ + "IFRAME_JAVASCRIPT_INPAGE", + "INTERNAL_REDIRECT_INPAGE", + "JAVASCRIPT_INPAGE", + "STANDARD" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + }, + "interstitialTagFormats": { + "type": "array", + "description": "Tag types for interstitial placements.\n\nAcceptable values are:\n- \"IFRAME_JAVASCRIPT_INTERSTITIAL\"\n- \"INTERNAL_REDIRECT_INTERSTITIAL\"\n- \"JAVASCRIPT_INTERSTITIAL\"", + "items": { + "type": "string", + "enum": [ + "IFRAME_JAVASCRIPT_INTERSTITIAL", + "INTERNAL_REDIRECT_INTERSTITIAL", + "JAVASCRIPT_INTERSTITIAL" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#directorySite\".", + "default": "dfareporting#directorySite" + }, + "name": { + "type": "string", + "description": "Name of this directory site." + }, + "parentId": { + "type": "string", + "description": "Parent directory site ID.", + "format": "int64" + }, + "settings": { + "$ref": "DirectorySiteSettings", + "description": "Directory site settings." + }, + "url": { + "type": "string", + "description": "URL of this directory site." + } + } + }, + "DirectorySiteContact": { + "id": "DirectorySiteContact", + "type": "object", + "description": "Contains properties of a Site Directory contact.", + "properties": { + "address": { + "type": "string", + "description": "Address of this directory site contact." + }, + "email": { + "type": "string", + "description": "Email address of this directory site contact." + }, + "firstName": { + "type": "string", + "description": "First name of this directory site contact." + }, + "id": { + "type": "string", + "description": "ID of this directory site contact. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#directorySiteContact\".", + "default": "dfareporting#directorySiteContact" + }, + "lastName": { + "type": "string", + "description": "Last name of this directory site contact." + }, + "phone": { + "type": "string", + "description": "Phone number of this directory site contact." + }, + "role": { + "type": "string", + "description": "Directory site contact role.", + "enum": [ + "ADMIN", + "EDIT", + "VIEW" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "title": { + "type": "string", + "description": "Title or designation of this directory site contact." + }, + "type": { + "type": "string", + "description": "Directory site contact type.", + "enum": [ + "BILLING", + "OTHER", + "SALES", + "TECHNICAL" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "DirectorySiteContactAssignment": { + "id": "DirectorySiteContactAssignment", + "type": "object", + "description": "Directory Site Contact Assignment", + "properties": { + "contactId": { + "type": "string", + "description": "ID of this directory site contact. This is a read-only, auto-generated field.", + "format": "int64" + }, + "visibility": { + "type": "string", + "description": "Visibility of this directory site contact assignment. When set to PUBLIC this contact assignment is visible to all account and agency users; when set to PRIVATE it is visible only to the site.", + "enum": [ + "PRIVATE", + "PUBLIC" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "DirectorySiteContactsListResponse": { + "id": "DirectorySiteContactsListResponse", + "type": "object", + "description": "Directory Site Contact List Response", + "properties": { + "directorySiteContacts": { + "type": "array", + "description": "Directory site contact collection", + "items": { + "$ref": "DirectorySiteContact" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#directorySiteContactsListResponse\".", + "default": "dfareporting#directorySiteContactsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "DirectorySiteSettings": { + "id": "DirectorySiteSettings", + "type": "object", + "description": "Directory Site Settings", + "properties": { + "activeViewOptOut": { + "type": "boolean", + "description": "Whether this directory site has disabled active view creatives." + }, + "dfp_settings": { + "$ref": "DfpSettings", + "description": "Directory site DFP settings." + }, + "instream_video_placement_accepted": { + "type": "boolean", + "description": "Whether this site accepts in-stream video ads." + }, + "interstitialPlacementAccepted": { + "type": "boolean", + "description": "Whether this site accepts interstitial ads." + }, + "nielsenOcrOptOut": { + "type": "boolean", + "description": "Whether this directory site has disabled Nielsen OCR reach ratings." + }, + "verificationTagOptOut": { + "type": "boolean", + "description": "Whether this directory site has disabled generation of Verification ins tags." + }, + "videoActiveViewOptOut": { + "type": "boolean", + "description": "Whether this directory site has disabled active view for in-stream video creatives." + } + } + }, + "DirectorySitesListResponse": { + "id": "DirectorySitesListResponse", + "type": "object", + "description": "Directory Site List Response", + "properties": { + "directorySites": { + "type": "array", + "description": "Directory site collection.", + "items": { + "$ref": "DirectorySite" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#directorySitesListResponse\".", + "default": "dfareporting#directorySitesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "EventTag": { + "id": "EventTag", + "type": "object", + "description": "Contains properties of an event tag.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this event tag. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this event tag. This field or the campaignId field is required on insertion.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "campaignId": { + "type": "string", + "description": "Campaign ID of this event tag. This field or the advertiserId field is required on insertion.", + "format": "int64" + }, + "campaignIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the campaign. This is a read-only, auto-generated field." + }, + "enabledByDefault": { + "type": "boolean", + "description": "Whether this event tag should be automatically enabled for all of the advertiser's campaigns and ads." + }, + "excludeFromAdxRequests": { + "type": "boolean", + "description": "Whether to remove this event tag from ads that are trafficked through DoubleClick Bid Manager to Ad Exchange. This may be useful if the event tag uses a pixel that is unapproved for Ad Exchange bids on one or more networks, such as the Google Display Network." + }, + "id": { + "type": "string", + "description": "ID of this event tag. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#eventTag\".", + "default": "dfareporting#eventTag" + }, + "name": { + "type": "string", + "description": "Name of this event tag. This is a required field and must be less than 256 characters long." + }, + "siteFilterType": { + "type": "string", + "description": "Site filter type for this event tag. If no type is specified then the event tag will be applied to all sites.", + "enum": [ + "BLACKLIST", + "WHITELIST" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "siteIds": { + "type": "array", + "description": "Filter list of site IDs associated with this event tag. The siteFilterType determines whether this is a whitelist or blacklist filter.", + "items": { + "type": "string", + "format": "int64" + } + }, + "sslCompliant": { + "type": "boolean", + "description": "Whether this tag is SSL-compliant or not. This is a read-only field." + }, + "status": { + "type": "string", + "description": "Status of this event tag. Must be ENABLED for this event tag to fire. This is a required field.", + "enum": [ + "DISABLED", + "ENABLED" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this event tag. This is a read-only field that can be left blank.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "Event tag type. Can be used to specify whether to use a third-party pixel, a third-party JavaScript URL, or a third-party click-through URL for either impression or click tracking. This is a required field.", + "enum": [ + "CLICK_THROUGH_EVENT_TAG", + "IMPRESSION_IMAGE_EVENT_TAG", + "IMPRESSION_JAVASCRIPT_EVENT_TAG" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "url": { + "type": "string", + "description": "Payload URL for this event tag. The URL on a click-through event tag should have a landing page URL appended to the end of it. This field is required on insertion." + }, + "urlEscapeLevels": { + "type": "integer", + "description": "Number of times the landing page URL should be URL-escaped before being appended to the click-through event tag URL. Only applies to click-through event tags as specified by the event tag type.", + "format": "int32" + } + } + }, + "EventTagOverride": { + "id": "EventTagOverride", + "type": "object", + "description": "Event tag override information.", + "properties": { + "enabled": { + "type": "boolean", + "description": "Whether this override is enabled." + }, + "id": { + "type": "string", + "description": "ID of this event tag override. This is a read-only, auto-generated field.", + "format": "int64" + } + } + }, + "EventTagsListResponse": { + "id": "EventTagsListResponse", + "type": "object", + "description": "Event Tag List Response", + "properties": { + "eventTags": { + "type": "array", + "description": "Event tag collection.", + "items": { + "$ref": "EventTag" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#eventTagsListResponse\".", + "default": "dfareporting#eventTagsListResponse" + } + } + }, + "File": { + "id": "File", + "type": "object", + "description": "Represents a File resource. A file contains the metadata 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 filename of the file." + }, + "format": { + "type": "string", + "description": "The output format of the report. Only available once the file is available.", + "enum": [ + "CSV", + "EXCEL" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "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.", + "enum": [ + "CANCELLED", + "FAILED", + "PROCESSING", + "REPORT_AVAILABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "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." + } + } + }, + "Flight": { + "id": "Flight", + "type": "object", + "description": "Flight", + "properties": { + "endDate": { + "type": "string", + "description": "Inventory item flight end date.", + "format": "date" + }, + "rateOrCost": { + "type": "string", + "description": "Rate or cost of this flight.", + "format": "int64" + }, + "startDate": { + "type": "string", + "description": "Inventory item flight start date.", + "format": "date" + }, + "units": { + "type": "string", + "description": "Units of this flight.", + "format": "int64" + } + } + }, + "FloodlightActivitiesGenerateTagResponse": { + "id": "FloodlightActivitiesGenerateTagResponse", + "type": "object", + "description": "Floodlight Activity GenerateTag Response", + "properties": { + "floodlightActivityTag": { + "type": "string", + "description": "Generated tag for this floodlight activity." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightActivitiesGenerateTagResponse\".", + "default": "dfareporting#floodlightActivitiesGenerateTagResponse" + } + } + }, + "FloodlightActivitiesListResponse": { + "id": "FloodlightActivitiesListResponse", + "type": "object", + "description": "Floodlight Activity List Response", + "properties": { + "floodlightActivities": { + "type": "array", + "description": "Floodlight activity collection.", + "items": { + "$ref": "FloodlightActivity" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightActivitiesListResponse\".", + "default": "dfareporting#floodlightActivitiesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "FloodlightActivity": { + "id": "FloodlightActivity", + "type": "object", + "description": "Contains properties of a Floodlight activity.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this floodlight activity. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this floodlight activity. If this field is left blank, the value will be copied over either from the activity group's advertiser or the existing activity's advertiser.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "cacheBustingType": { + "type": "string", + "description": "Code type used for cache busting in the generated tag.", + "enum": [ + "ACTIVE_SERVER_PAGE", + "COLD_FUSION", + "JAVASCRIPT", + "JSP", + "PHP" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "countingMethod": { + "type": "string", + "description": "Counting method for conversions for this floodlight activity. This is a required field.", + "enum": [ + "ITEMS_SOLD_COUNTING", + "SESSION_COUNTING", + "STANDARD_COUNTING", + "TRANSACTIONS_COUNTING", + "UNIQUE_COUNTING" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "defaultTags": { + "type": "array", + "description": "Dynamic floodlight tags.", + "items": { + "$ref": "FloodlightActivityDynamicTag" + } + }, + "expectedUrl": { + "type": "string", + "description": "URL where this tag will be deployed. If specified, must be less than 256 characters long." + }, + "floodlightActivityGroupId": { + "type": "string", + "description": "Floodlight activity group ID of this floodlight activity. This is a required field.", + "format": "int64" + }, + "floodlightActivityGroupName": { + "type": "string", + "description": "Name of the associated floodlight activity group. This is a read-only field." + }, + "floodlightActivityGroupTagString": { + "type": "string", + "description": "Tag string of the associated floodlight activity group. This is a read-only field." + }, + "floodlightActivityGroupType": { + "type": "string", + "description": "Type of the associated floodlight activity group. This is a read-only field.", + "enum": [ + "COUNTER", + "SALE" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "floodlightConfigurationId": { + "type": "string", + "description": "Floodlight configuration ID of this floodlight activity. If this field is left blank, the value will be copied over either from the activity group's floodlight configuration or from the existing activity's floodlight configuration.", + "format": "int64" + }, + "floodlightConfigurationIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the floodlight configuration. This is a read-only, auto-generated field." + }, + "hidden": { + "type": "boolean", + "description": "Whether this activity is archived." + }, + "id": { + "type": "string", + "description": "ID of this floodlight activity. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this floodlight activity. This is a read-only, auto-generated field." + }, + "imageTagEnabled": { + "type": "boolean", + "description": "Whether the image tag is enabled for this activity." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightActivity\".", + "default": "dfareporting#floodlightActivity" + }, + "name": { + "type": "string", + "description": "Name of this floodlight activity. This is a required field. Must be less than 129 characters long and cannot contain quotes." + }, + "notes": { + "type": "string", + "description": "General notes or implementation instructions for the tag." + }, + "publisherTags": { + "type": "array", + "description": "Publisher dynamic floodlight tags.", + "items": { + "$ref": "FloodlightActivityPublisherDynamicTag" + } + }, + "secure": { + "type": "boolean", + "description": "Whether this tag should use SSL." + }, + "sslCompliant": { + "type": "boolean", + "description": "Whether the floodlight activity is SSL-compliant. This is a read-only field, its value detected by the system from the floodlight tags." + }, + "sslRequired": { + "type": "boolean", + "description": "Whether this floodlight activity must be SSL-compliant." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this floodlight activity. This is a read-only field that can be left blank.", + "format": "int64" + }, + "tagFormat": { + "type": "string", + "description": "Tag format type for the floodlight activity. If left blank, the tag format will default to HTML.", + "enum": [ + "HTML", + "XHTML" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "tagString": { + "type": "string", + "description": "Value of the cat= paramter in the floodlight tag, which the ad servers use to identify the activity. This is optional: if empty, a new tag string will be generated for you. This string must be 1 to 8 characters long, with valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among activities of the same activity group. This field is read-only after insertion." + }, + "userDefinedVariableTypes": { + "type": "array", + "description": "List of the user-defined variables used by this conversion tag. These map to the \"u[1-20]=\" in the tags. Each of these can have a user defined type.\nAcceptable values are:\n- \"U1\"\n- \"U2\"\n- \"U3\"\n- \"U4\"\n- \"U5\"\n- \"U6\"\n- \"U7\"\n- \"U8\"\n- \"U9\"\n- \"U10\"\n- \"U11\"\n- \"U12\"\n- \"U13\"\n- \"U14\"\n- \"U15\"\n- \"U16\"\n- \"U17\"\n- \"U18\"\n- \"U19\"\n- \"U20\"", + "items": { + "type": "string", + "enum": [ + "U1", + "U10", + "U11", + "U12", + "U13", + "U14", + "U15", + "U16", + "U17", + "U18", + "U19", + "U2", + "U20", + "U3", + "U4", + "U5", + "U6", + "U7", + "U8", + "U9" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + } + }, + "FloodlightActivityDynamicTag": { + "id": "FloodlightActivityDynamicTag", + "type": "object", + "description": "Dynamic Tag", + "properties": { + "id": { + "type": "string", + "description": "ID of this dynamic tag. This is a read-only, auto-generated field.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of this tag." + }, + "tag": { + "type": "string", + "description": "Tag code." + } + } + }, + "FloodlightActivityGroup": { + "id": "FloodlightActivityGroup", + "type": "object", + "description": "Contains properties of a Floodlight activity group.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this floodlight activity group. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this floodlight activity group. If this field is left blank, the value will be copied over either from the floodlight configuration's advertiser or from the existing activity group's advertiser.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "floodlightConfigurationId": { + "type": "string", + "description": "Floodlight configuration ID of this floodlight activity group. This is a required field.", + "format": "int64" + }, + "floodlightConfigurationIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the floodlight configuration. This is a read-only, auto-generated field." + }, + "id": { + "type": "string", + "description": "ID of this floodlight activity group. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this floodlight activity group. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightActivityGroup\".", + "default": "dfareporting#floodlightActivityGroup" + }, + "name": { + "type": "string", + "description": "Name of this floodlight activity group. This is a required field. Must be less than 65 characters long and cannot contain quotes." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this floodlight activity group. This is a read-only field that can be left blank.", + "format": "int64" + }, + "tagString": { + "type": "string", + "description": "Value of the type= parameter in the floodlight tag, which the ad servers use to identify the activity group that the activity belongs to. This is optional: if empty, a new tag string will be generated for you. This string must be 1 to 8 characters long, with valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among activity groups of the same floodlight configuration. This field is read-only after insertion." + }, + "type": { + "type": "string", + "description": "Type of the floodlight activity group. This is a required field that is read-only after insertion.", + "enum": [ + "COUNTER", + "SALE" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "FloodlightActivityGroupsListResponse": { + "id": "FloodlightActivityGroupsListResponse", + "type": "object", + "description": "Floodlight Activity Group List Response", + "properties": { + "floodlightActivityGroups": { + "type": "array", + "description": "Floodlight activity group collection.", + "items": { + "$ref": "FloodlightActivityGroup" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightActivityGroupsListResponse\".", + "default": "dfareporting#floodlightActivityGroupsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "FloodlightActivityPublisherDynamicTag": { + "id": "FloodlightActivityPublisherDynamicTag", + "type": "object", + "description": "Publisher Dynamic Tag", + "properties": { + "clickThrough": { + "type": "boolean", + "description": "Whether this tag is applicable only for click-throughs." + }, + "directorySiteId": { + "type": "string", + "description": "Directory site ID of this dynamic tag. This is a write-only field that can be used as an alternative to the siteId field. When this resource is retrieved, only the siteId field will be populated.", + "format": "int64" + }, + "dynamicTag": { + "$ref": "FloodlightActivityDynamicTag", + "description": "Dynamic floodlight tag." + }, + "siteId": { + "type": "string", + "description": "Site ID of this dynamic tag.", + "format": "int64" + }, + "siteIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the site. This is a read-only, auto-generated field." + }, + "viewThrough": { + "type": "boolean", + "description": "Whether this tag is applicable only for view-throughs." + } + } + }, + "FloodlightConfiguration": { + "id": "FloodlightConfiguration", + "type": "object", + "description": "Contains properties of a Floodlight configuration.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this floodlight configuration. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of the parent advertiser of this floodlight configuration.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "analyticsDataSharingEnabled": { + "type": "boolean", + "description": "Whether advertiser data is shared with Google Analytics." + }, + "exposureToConversionEnabled": { + "type": "boolean", + "description": "Whether the exposure-to-conversion report is enabled. This report shows detailed pathway information on up to 10 of the most recent ad exposures seen by a user before converting." + }, + "firstDayOfWeek": { + "type": "string", + "description": "Day that will be counted as the first day of the week in reports. This is a required field.", + "enum": [ + "MONDAY", + "SUNDAY" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "id": { + "type": "string", + "description": "ID of this floodlight configuration. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this floodlight configuration. This is a read-only, auto-generated field." + }, + "inAppAttributionTrackingEnabled": { + "type": "boolean", + "description": "Whether in-app attribution tracking is enabled." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightConfiguration\".", + "default": "dfareporting#floodlightConfiguration" + }, + "lookbackConfiguration": { + "$ref": "LookbackConfiguration", + "description": "Lookback window settings for this floodlight configuration." + }, + "naturalSearchConversionAttributionOption": { + "type": "string", + "description": "Types of attribution options for natural search conversions.", + "enum": [ + "EXCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION", + "INCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION", + "INCLUDE_NATURAL_SEARCH_TIERED_CONVERSION_ATTRIBUTION" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "omnitureSettings": { + "$ref": "OmnitureSettings", + "description": "Settings for DCM Omniture integration." + }, + "sslRequired": { + "type": "boolean", + "description": "Whether floodlight activities owned by this configuration are required to be SSL-compliant." + }, + "standardVariableTypes": { + "type": "array", + "description": "List of standard variables enabled for this configuration.\n\nAcceptable values are:\n- \"ORD\"\n- \"NUM\"", + "items": { + "type": "string", + "enum": [ + "NUM", + "ORD", + "TRAN", + "U" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this floodlight configuration. This is a read-only field that can be left blank.", + "format": "int64" + }, + "tagSettings": { + "$ref": "TagSettings", + "description": "Configuration settings for dynamic and image floodlight tags." + }, + "thirdPartyAuthenticationTokens": { + "type": "array", + "description": "List of third-party authentication tokens enabled for this configuration.", + "items": { + "$ref": "ThirdPartyAuthenticationToken" + } + }, + "userDefinedVariableConfigurations": { + "type": "array", + "description": "List of user defined variables enabled for this configuration.", + "items": { + "$ref": "UserDefinedVariableConfiguration" + } + } + } + }, + "FloodlightConfigurationsListResponse": { + "id": "FloodlightConfigurationsListResponse", + "type": "object", + "description": "Floodlight Configuration List Response", + "properties": { + "floodlightConfigurations": { + "type": "array", + "description": "Floodlight configuration collection.", + "items": { + "$ref": "FloodlightConfiguration" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#floodlightConfigurationsListResponse\".", + "default": "dfareporting#floodlightConfigurationsListResponse" + } + } + }, + "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" + } + } + } + }, + "FrequencyCap": { + "id": "FrequencyCap", + "type": "object", + "description": "Frequency Cap.", + "properties": { + "duration": { + "type": "string", + "description": "Duration of time, in seconds, for this frequency cap. The maximum duration is 90 days in seconds, or 7,776,000.", + "format": "int64" + }, + "impressions": { + "type": "string", + "description": "Number of times an individual user can be served the ad within the specified duration. The maximum allowed is 15.", + "format": "int64" + } + } + }, + "FsCommand": { + "id": "FsCommand", + "type": "object", + "description": "FsCommand.", + "properties": { + "left": { + "type": "integer", + "description": "Distance from the left of the browser.Applicable when positionOption is DISTANCE_FROM_TOP_LEFT_CORNER.", + "format": "int32" + }, + "positionOption": { + "type": "string", + "description": "Position in the browser where the window will open.", + "enum": [ + "CENTERED", + "DISTANCE_FROM_TOP_LEFT_CORNER" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "top": { + "type": "integer", + "description": "Distance from the top of the browser. Applicable when positionOption is DISTANCE_FROM_TOP_LEFT_CORNER.", + "format": "int32" + }, + "windowHeight": { + "type": "integer", + "description": "Height of the window.", + "format": "int32" + }, + "windowWidth": { + "type": "integer", + "description": "Width of the window.", + "format": "int32" + } + } + }, + "GeoTargeting": { + "id": "GeoTargeting", + "type": "object", + "description": "Geographical Targeting.", + "properties": { + "cities": { + "type": "array", + "description": "Cities to be targeted. For each city only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting a city, do not target or exclude the country of the city, and do not target the metro or region of the city.", + "items": { + "$ref": "City" + } + }, + "countries": { + "type": "array", + "description": "Countries to be targeted or excluded from targeting, depending on the setting of the excludeCountries field. For each country only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting or excluding a country, do not target regions, cities, metros, or postal codes in the same country.", + "items": { + "$ref": "Country" + } + }, + "excludeCountries": { + "type": "boolean", + "description": "Whether or not to exclude the countries in the countries field from targeting. If false, the countries field refers to countries which will be targeted by the ad." + }, + "metros": { + "type": "array", + "description": "Metros to be targeted. For each metro only dmaId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting a metro, do not target or exclude the country of the metro.", + "items": { + "$ref": "Metro" + } + }, + "postalCodes": { + "type": "array", + "description": "Postal codes to be targeted. For each postal code only id is required. The other fields are populated automatically when the ad is inserted or updated. If targeting a postal code, do not target or exclude the country of the postal code.", + "items": { + "$ref": "PostalCode" + } + }, + "regions": { + "type": "array", + "description": "Regions to be targeted. For each region only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting a region, do not target or exclude the country of the region.", + "items": { + "$ref": "Region" + } + } + } + }, + "InventoryItem": { + "id": "InventoryItem", + "type": "object", + "description": "Represents a buy from the DoubleClick Planning inventory store.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this inventory item.", + "format": "int64" + }, + "adSlots": { + "type": "array", + "description": "Ad slots of this inventory item. If this inventory item represents a standalone placement, there will be exactly one ad slot. If this inventory item represents a placement group, there will be more than one ad slot, each representing one child placement in that placement group.", + "items": { + "$ref": "AdSlot" + } + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this inventory item.", + "format": "int64" + }, + "contentCategoryId": { + "type": "string", + "description": "Content category ID of this inventory item.", + "format": "int64" + }, + "estimatedClickThroughRate": { + "type": "string", + "description": "Estimated click-through rate of this inventory item.", + "format": "int64" + }, + "estimatedConversionRate": { + "type": "string", + "description": "Estimated conversion rate of this inventory item.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "ID of this inventory item.", + "format": "int64" + }, + "inPlan": { + "type": "boolean", + "description": "Whether this inventory item is in plan." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#inventoryItem\".", + "default": "dfareporting#inventoryItem" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the most recent modification of this inventory item." + }, + "name": { + "type": "string", + "description": "Name of this inventory item. For standalone inventory items, this is the same name as that of its only ad slot. For group inventory items, this can differ from the name of any of its ad slots." + }, + "negotiationChannelId": { + "type": "string", + "description": "Negotiation channel ID of this inventory item.", + "format": "int64" + }, + "orderId": { + "type": "string", + "description": "Order ID of this inventory item.", + "format": "int64" + }, + "placementStrategyId": { + "type": "string", + "description": "Placement strategy ID of this inventory item.", + "format": "int64" + }, + "pricing": { + "$ref": "Pricing", + "description": "Pricing of this inventory item." + }, + "projectId": { + "type": "string", + "description": "Project ID of this inventory item.", + "format": "int64" + }, + "rfpId": { + "type": "string", + "description": "RFP ID of this inventory item.", + "format": "int64" + }, + "siteId": { + "type": "string", + "description": "ID of the site this inventory item is associated with.", + "format": "int64" + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this inventory item.", + "format": "int64" + } + } + }, + "InventoryItemsListResponse": { + "id": "InventoryItemsListResponse", + "type": "object", + "description": "Inventory item List Response", + "properties": { + "inventoryItems": { + "type": "array", + "description": "Inventory item collection", + "items": { + "$ref": "InventoryItem" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#inventoryItemsListResponse\".", + "default": "dfareporting#inventoryItemsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + } + } + }, + "KeyValueTargetingExpression": { + "id": "KeyValueTargetingExpression", + "type": "object", + "description": "Key Value Targeting Expression.", + "properties": { + "expression": { + "type": "string", + "description": "Keyword expression being targeted by the ad." + } + } + }, + "LandingPage": { + "id": "LandingPage", + "type": "object", + "description": "Contains information about where a user's browser is taken after the user clicks an ad.", + "properties": { + "default": { + "type": "boolean", + "description": "Whether or not this landing page will be assigned to any ads or creatives that do not have a landing page assigned explicitly. Only one default landing page is allowed per campaign." + }, + "id": { + "type": "string", + "description": "ID of this landing page. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#landingPage\".", + "default": "dfareporting#landingPage" + }, + "name": { + "type": "string", + "description": "Name of this landing page. This is a required field. It must be less than 256 characters long, and must be unique among landing pages of the same campaign." + }, + "url": { + "type": "string", + "description": "URL of this landing page. This is a required field." + } + } + }, + "LandingPagesListResponse": { + "id": "LandingPagesListResponse", + "type": "object", + "description": "Landing Page List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#landingPagesListResponse\".", + "default": "dfareporting#landingPagesListResponse" + }, + "landingPages": { + "type": "array", + "description": "Landing page collection", + "items": { + "$ref": "LandingPage" + } + } + } + }, + "LastModifiedInfo": { + "id": "LastModifiedInfo", + "type": "object", + "description": "Modification timestamp.", + "properties": { + "time": { + "type": "string", + "description": "Timestamp of the last change in milliseconds since epoch.", + "format": "int64" + } + } + }, + "ListPopulationClause": { + "id": "ListPopulationClause", + "type": "object", + "description": "A group clause made up of list population terms representing constraints joined by ORs.", + "properties": { + "terms": { + "type": "array", + "description": "Terms of this list population clause. Each clause is made up of list population terms representing constraints and are joined by ORs.", + "items": { + "$ref": "ListPopulationTerm" + } + } + } + }, + "ListPopulationRule": { + "id": "ListPopulationRule", + "type": "object", + "description": "Remarketing List Population Rule.", + "properties": { + "floodlightActivityId": { + "type": "string", + "description": "Floodlight activity ID associated with this rule. This field can be left blank.", + "format": "int64" + }, + "floodlightActivityName": { + "type": "string", + "description": "Name of floodlight activity associated with this rule. This is a read-only, auto-generated field." + }, + "listPopulationClauses": { + "type": "array", + "description": "Clauses that make up this list population rule. Clauses are joined by ANDs, and the clauses themselves are made up of list population terms which are joined by ORs.", + "items": { + "$ref": "ListPopulationClause" + } + } + } + }, + "ListPopulationTerm": { + "id": "ListPopulationTerm", + "type": "object", + "description": "Remarketing List Population Rule Term.", + "properties": { + "contains": { + "type": "boolean", + "description": "Will be true if the term should check if the user is in the list and false if the term should check if the user is not in the list. This field is only relevant when type is set to LIST_MEMBERSHIP_TERM. False by default." + }, + "negation": { + "type": "boolean", + "description": "Whether to negate the comparison result of this term during rule evaluation. This field is only relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM." + }, + "operator": { + "type": "string", + "description": "Comparison operator of this term. This field is only relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM.", + "enum": [ + "NUM_EQUALS", + "NUM_GREATER_THAN", + "NUM_GREATER_THAN_EQUAL", + "NUM_LESS_THAN", + "NUM_LESS_THAN_EQUAL", + "STRING_CONTAINS", + "STRING_EQUALS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "remarketingListId": { + "type": "string", + "description": "ID of the list in question. This field is only relevant when type is set to LIST_MEMBERSHIP_TERM.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "List population term type determines the applicable fields in this object. If left unset or set to CUSTOM_VARIABLE_TERM, then variableName, variableFriendlyName, operator, value, and negation are applicable. If set to LIST_MEMBERSHIP_TERM then remarketingListId and contains are applicable. If set to REFERRER_TERM then operator, value, and negation are applicable.", + "enum": [ + "CUSTOM_VARIABLE_TERM", + "LIST_MEMBERSHIP_TERM", + "REFERRER_TERM" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "value": { + "type": "string", + "description": "Literal to compare the variable to. This field is only relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM." + }, + "variableFriendlyName": { + "type": "string", + "description": "Friendly name of this term's variable. This is a read-only, auto-generated field. This field is only relevant when type is left unset or set to CUSTOM_VARIABLE_TERM." + }, + "variableName": { + "type": "string", + "description": "Name of the variable (U1, U2, etc.) being compared in this term. This field is only relevant when type is set to null, CUSTOM_VARIABLE_TERM or REFERRER_TERM." + } + } + }, + "ListTargetingExpression": { + "id": "ListTargetingExpression", + "type": "object", + "description": "Remarketing List Targeting Expression.", + "properties": { + "expression": { + "type": "string", + "description": "Expression describing which lists are being targeted by the ad." + } + } + }, + "LookbackConfiguration": { + "id": "LookbackConfiguration", + "type": "object", + "description": "Lookback configuration settings.", + "properties": { + "clickDuration": { + "type": "integer", + "description": "Lookback window, in days, from the last time a given user clicked on one of your ads. If you enter 0, clicks will not be considered as triggering events for floodlight tracking. If you leave this field blank, the default value for your account will be used.", + "format": "int32" + }, + "postImpressionActivitiesDuration": { + "type": "integer", + "description": "Lookback window, in days, from the last time a given user viewed one of your ads. If you enter 0, impressions will not be considered as triggering events for floodlight tracking. If you leave this field blank, the default value for your account will be used.", + "format": "int32" + } + } + }, + "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" + } + } + }, + "Metro": { + "id": "Metro", + "type": "object", + "description": "Contains information about a metro region that can be targeted by ads.", + "properties": { + "countryCode": { + "type": "string", + "description": "Country code of the country to which this metro region belongs." + }, + "countryDartId": { + "type": "string", + "description": "DART ID of the country to which this metro region belongs.", + "format": "int64" + }, + "dartId": { + "type": "string", + "description": "DART ID of this metro region.", + "format": "int64" + }, + "dmaId": { + "type": "string", + "description": "DMA ID of this metro region. This is the ID used for targeting and generating reports, and is equivalent to metro_code.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#metro\".", + "default": "dfareporting#metro" + }, + "metroCode": { + "type": "string", + "description": "Metro code of this metro region. This is equivalent to dma_id." + }, + "name": { + "type": "string", + "description": "Name of this metro region." + } + } + }, + "MetrosListResponse": { + "id": "MetrosListResponse", + "type": "object", + "description": "Metro List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#metrosListResponse\".", + "default": "dfareporting#metrosListResponse" + }, + "metros": { + "type": "array", + "description": "Metro collection.", + "items": { + "$ref": "Metro" + } + } + } + }, + "MobileCarrier": { + "id": "MobileCarrier", + "type": "object", + "description": "Contains information about a mobile carrier that can be targeted by ads.", + "properties": { + "countryCode": { + "type": "string", + "description": "Country code of the country to which this mobile carrier belongs." + }, + "countryDartId": { + "type": "string", + "description": "DART ID of the country to which this mobile carrier belongs.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "ID of this mobile carrier.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#mobileCarrier\".", + "default": "dfareporting#mobileCarrier" + }, + "name": { + "type": "string", + "description": "Name of this mobile carrier." + } + } + }, + "MobileCarriersListResponse": { + "id": "MobileCarriersListResponse", + "type": "object", + "description": "Mobile Carrier List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#mobileCarriersListResponse\".", + "default": "dfareporting#mobileCarriersListResponse" + }, + "mobileCarriers": { + "type": "array", + "description": "Mobile carrier collection.", + "items": { + "$ref": "MobileCarrier" + } + } + } + }, + "ObjectFilter": { + "id": "ObjectFilter", + "type": "object", + "description": "Object Filter.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#objectFilter\".", + "default": "dfareporting#objectFilter" + }, + "objectIds": { + "type": "array", + "description": "Applicable when status is ASSIGNED. The user has access to objects with these object IDs.", + "items": { + "type": "string", + "format": "int64" + } + }, + "status": { + "type": "string", + "description": "Status of the filter. NONE means the user has access to none of the objects. ALL means the user has access to all objects. ASSIGNED means the user has access to the objects with IDs in the objectIds list.", + "enum": [ + "ALL", + "ASSIGNED", + "NONE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "OffsetPosition": { + "id": "OffsetPosition", + "type": "object", + "description": "Offset Position.", + "properties": { + "left": { + "type": "integer", + "description": "Offset distance from left side of an asset or a window.", + "format": "int32" + }, + "top": { + "type": "integer", + "description": "Offset distance from top side of an asset or a window.", + "format": "int32" + } + } + }, + "OmnitureSettings": { + "id": "OmnitureSettings", + "type": "object", + "description": "Omniture Integration Settings.", + "properties": { + "omnitureCostDataEnabled": { + "type": "boolean", + "description": "Whether placement cost data will be sent to Omniture. This property can be enabled only if omnitureIntegrationEnabled is true." + }, + "omnitureIntegrationEnabled": { + "type": "boolean", + "description": "Whether Omniture integration is enabled. This property can be enabled only when the \"Advanced Ad Serving\" account setting is enabled." + } + } + }, + "OperatingSystem": { + "id": "OperatingSystem", + "type": "object", + "description": "Contains information about an operating system that can be targeted by ads.", + "properties": { + "dartId": { + "type": "string", + "description": "DART ID of this operating system. This is the ID used for targeting.", + "format": "int64" + }, + "desktop": { + "type": "boolean", + "description": "Whether this operating system is for desktop." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#operatingSystem\".", + "default": "dfareporting#operatingSystem" + }, + "mobile": { + "type": "boolean", + "description": "Whether this operating system is for mobile." + }, + "name": { + "type": "string", + "description": "Name of this operating system." + } + } + }, + "OperatingSystemVersion": { + "id": "OperatingSystemVersion", + "type": "object", + "description": "Contains information about a particular version of an operating system that can be targeted by ads.", + "properties": { + "id": { + "type": "string", + "description": "ID of this operating system version.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#operatingSystemVersion\".", + "default": "dfareporting#operatingSystemVersion" + }, + "majorVersion": { + "type": "string", + "description": "Major version (leftmost number) of this operating system version." + }, + "minorVersion": { + "type": "string", + "description": "Minor version (number after the first dot) of this operating system version." + }, + "name": { + "type": "string", + "description": "Name of this operating system version." + }, + "operatingSystem": { + "$ref": "OperatingSystem", + "description": "Operating system of this operating system version." + } + } + }, + "OperatingSystemVersionsListResponse": { + "id": "OperatingSystemVersionsListResponse", + "type": "object", + "description": "Operating System Version List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#operatingSystemVersionsListResponse\".", + "default": "dfareporting#operatingSystemVersionsListResponse" + }, + "operatingSystemVersions": { + "type": "array", + "description": "Operating system version collection.", + "items": { + "$ref": "OperatingSystemVersion" + } + } + } + }, + "OperatingSystemsListResponse": { + "id": "OperatingSystemsListResponse", + "type": "object", + "description": "Operating System List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#operatingSystemsListResponse\".", + "default": "dfareporting#operatingSystemsListResponse" + }, + "operatingSystems": { + "type": "array", + "description": "Operating system collection.", + "items": { + "$ref": "OperatingSystem" + } + } + } + }, + "OptimizationActivity": { + "id": "OptimizationActivity", + "type": "object", + "description": "Creative optimization activity.", + "properties": { + "floodlightActivityId": { + "type": "string", + "description": "Floodlight activity ID of this optimization activity. This is a required field.", + "format": "int64" + }, + "floodlightActivityIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the floodlight activity. This is a read-only, auto-generated field." + }, + "weight": { + "type": "integer", + "description": "Weight associated with this optimization. Must be greater than 1. The weight assigned will be understood in proportion to the weights assigned to the other optimization activities.", + "format": "int32" + } + } + }, + "Order": { + "id": "Order", + "type": "object", + "description": "Describes properties of a DoubleClick Planning order.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this order.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this order.", + "format": "int64" + }, + "approverUserProfileIds": { + "type": "array", + "description": "IDs for users that have to approve documents created for this order.", + "items": { + "type": "string", + "format": "int64" + } + }, + "buyerInvoiceId": { + "type": "string", + "description": "Buyer invoice ID associated with this order." + }, + "buyerOrganizationName": { + "type": "string", + "description": "Name of the buyer organization." + }, + "comments": { + "type": "string", + "description": "Comments in this order." + }, + "contacts": { + "type": "array", + "description": "Contacts for this order.", + "items": { + "$ref": "OrderContact" + } + }, + "id": { + "type": "string", + "description": "ID of this order. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#order\".", + "default": "dfareporting#order" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the most recent modification of this order." + }, + "name": { + "type": "string", + "description": "Name of this order." + }, + "notes": { + "type": "string", + "description": "Notes of this order." + }, + "planningTermId": { + "type": "string", + "description": "ID of the terms and conditions template used in this order.", + "format": "int64" + }, + "projectId": { + "type": "string", + "description": "Project ID of this order.", + "format": "int64" + }, + "sellerOrderId": { + "type": "string", + "description": "Seller order ID associated with this order." + }, + "sellerOrganizationName": { + "type": "string", + "description": "Name of the seller organization." + }, + "siteId": { + "type": "array", + "description": "Site IDs this order is associated with.", + "items": { + "type": "string", + "format": "int64" + } + }, + "siteNames": { + "type": "array", + "description": "Free-form site names this order is associated with.", + "items": { + "type": "string" + } + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this order.", + "format": "int64" + }, + "termsAndConditions": { + "type": "string", + "description": "Terms and conditions of this order." + } + } + }, + "OrderContact": { + "id": "OrderContact", + "type": "object", + "description": "Contact of an order.", + "properties": { + "contactInfo": { + "type": "string", + "description": "Free-form information about this contact. It could be any information related to this contact in addition to type, title, name, and signature user profile ID." + }, + "contactName": { + "type": "string", + "description": "Name of this contact." + }, + "contactTitle": { + "type": "string", + "description": "Title of this contact." + }, + "contactType": { + "type": "string", + "description": "Type of this contact.", + "enum": [ + "PLANNING_ORDER_CONTACT_BUYER_BILLING_CONTACT", + "PLANNING_ORDER_CONTACT_BUYER_CONTACT", + "PLANNING_ORDER_CONTACT_SELLER_CONTACT" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "signatureUserProfileId": { + "type": "string", + "description": "ID of the user profile containing the signature that will be embedded into order documents.", + "format": "int64" + } + } + }, + "OrderDocument": { + "id": "OrderDocument", + "type": "object", + "description": "Contains properties of a DoubleClick Planning order document.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this order document.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this order document.", + "format": "int64" + }, + "amendedOrderDocumentId": { + "type": "string", + "description": "The amended order document ID of this order document. An order document can be created by optionally amending another order document so that the change history can be preserved.", + "format": "int64" + }, + "approvedByUserProfileIds": { + "type": "array", + "description": "IDs of users who have approved this order document.", + "items": { + "type": "string", + "format": "int64" + } + }, + "cancelled": { + "type": "boolean", + "description": "Whether this order document is cancelled." + }, + "createdInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the creation of this order document." + }, + "effectiveDate": { + "type": "string", + "description": "Effective date of this order document.", + "format": "date" + }, + "id": { + "type": "string", + "description": "ID of this order document.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#orderDocument\".", + "default": "dfareporting#orderDocument" + }, + "lastSentRecipients": { + "type": "array", + "description": "List of email addresses that received the last sent document.", + "items": { + "type": "string" + } + }, + "lastSentTime": { + "type": "string", + "description": "Timestamp of the last email sent with this order document.", + "format": "date-time" + }, + "orderId": { + "type": "string", + "description": "ID of the order from which this order document is created.", + "format": "int64" + }, + "projectId": { + "type": "string", + "description": "Project ID of this order document.", + "format": "int64" + }, + "signed": { + "type": "boolean", + "description": "Whether this order document has been signed." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this order document.", + "format": "int64" + }, + "title": { + "type": "string", + "description": "Title of this order document." + }, + "type": { + "type": "string", + "description": "Type of this order document", + "enum": [ + "PLANNING_ORDER_TYPE_CHANGE_ORDER", + "PLANNING_ORDER_TYPE_INSERTION_ORDER" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "OrderDocumentsListResponse": { + "id": "OrderDocumentsListResponse", + "type": "object", + "description": "Order document List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#orderDocumentsListResponse\".", + "default": "dfareporting#orderDocumentsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "orderDocuments": { + "type": "array", + "description": "Order document collection", + "items": { + "$ref": "OrderDocument" + } + } + } + }, + "OrdersListResponse": { + "id": "OrdersListResponse", + "type": "object", + "description": "Order List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#ordersListResponse\".", + "default": "dfareporting#ordersListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "orders": { + "type": "array", + "description": "Order collection.", + "items": { + "$ref": "Order" + } + } + } + }, + "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" + } + } + } + }, + "Placement": { + "id": "Placement", + "type": "object", + "description": "Contains properties of a placement.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this placement. This field can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this placement. This field can be left blank.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "archived": { + "type": "boolean", + "description": "Whether this placement is archived." + }, + "campaignId": { + "type": "string", + "description": "Campaign ID of this placement. This field is a required field on insertion.", + "format": "int64" + }, + "campaignIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the campaign. This is a read-only, auto-generated field." + }, + "comment": { + "type": "string", + "description": "Comments for this placement." + }, + "compatibility": { + "type": "string", + "description": "Placement compatibility. WEB and WEB_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps.IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard. This field is required on insertion.", + "enum": [ + "APP", + "APP_INTERSTITIAL", + "IN_STREAM_VIDEO", + "WEB", + "WEB_INTERSTITIAL" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "contentCategoryId": { + "type": "string", + "description": "ID of the content category assigned to this placement.", + "format": "int64" + }, + "createInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the creation of this placement. This is a read-only field." + }, + "directorySiteId": { + "type": "string", + "description": "Directory site ID of this placement. On insert, you must set either this field or the siteId field to specify the site associated with this placement. This is a required field that is read-only after insertion.", + "format": "int64" + }, + "directorySiteIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the directory site. This is a read-only, auto-generated field." + }, + "externalId": { + "type": "string", + "description": "External ID for this placement." + }, + "id": { + "type": "string", + "description": "ID of this placement. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this placement. This is a read-only, auto-generated field." + }, + "keyName": { + "type": "string", + "description": "Key name of this placement. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placement\".", + "default": "dfareporting#placement" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the most recent modification of this placement. This is a read-only field." + }, + "lookbackConfiguration": { + "$ref": "LookbackConfiguration", + "description": "Lookback window settings for this placement." + }, + "name": { + "type": "string", + "description": "Name of this placement.This is a required field and must be less than 256 characters long." + }, + "paymentApproved": { + "type": "boolean", + "description": "Whether payment was approved for this placement. This is a read-only field relevant only to publisher-paid placements." + }, + "paymentSource": { + "type": "string", + "description": "Payment source for this placement. This is a required field that is read-only after insertion.", + "enum": [ + "PLACEMENT_AGENCY_PAID", + "PLACEMENT_PUBLISHER_PAID" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "placementGroupId": { + "type": "string", + "description": "ID of this placement's group, if applicable.", + "format": "int64" + }, + "placementGroupIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the placement group. This is a read-only, auto-generated field." + }, + "placementStrategyId": { + "type": "string", + "description": "ID of the placement strategy assigned to this placement.", + "format": "int64" + }, + "pricingSchedule": { + "$ref": "PricingSchedule", + "description": "Pricing schedule of this placement. This field is required on insertion, specifically subfields startDate, endDate and pricingType." + }, + "primary": { + "type": "boolean", + "description": "Whether this placement is the primary placement of a roadblock (placement group). You cannot change this field from true to false. Setting this field to true will automatically set the primary field on the original primary placement of the roadblock to false, and it will automatically set the roadblock's primaryPlacementId field to the ID of this placement." + }, + "publisherUpdateInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the last publisher update. This is a read-only field." + }, + "siteId": { + "type": "string", + "description": "Site ID associated with this placement. On insert, you must set either this field or the directorySiteId field to specify the site associated with this placement. This is a required field that is read-only after insertion.", + "format": "int64" + }, + "siteIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the site. This is a read-only, auto-generated field." + }, + "size": { + "$ref": "Size", + "description": "Size associated with this placement. When inserting or updating a placement, only the size ID field is used. This field is required on insertion." + }, + "sslRequired": { + "type": "boolean", + "description": "Whether creatives assigned to this placement must be SSL-compliant." + }, + "status": { + "type": "string", + "description": "Third-party placement status.", + "enum": [ + "ACKNOWLEDGE_ACCEPTANCE", + "ACKNOWLEDGE_REJECTION", + "DRAFT", + "PAYMENT_ACCEPTED", + "PAYMENT_REJECTED", + "PENDING_REVIEW" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this placement. This field can be left blank.", + "format": "int64" + }, + "tagFormats": { + "type": "array", + "description": "Tag formats to generate for this placement. This field is required on insertion.\nAcceptable values are:\n- \"PLACEMENT_TAG_STANDARD\"\n- \"PLACEMENT_TAG_IFRAME_JAVASCRIPT\"\n- \"PLACEMENT_TAG_IFRAME_ILAYER\"\n- \"PLACEMENT_TAG_INTERNAL_REDIRECT\"\n- \"PLACEMENT_TAG_JAVASCRIPT\"\n- \"PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT\"\n- \"PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT\"\n- \"PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT\"\n- \"PLACEMENT_TAG_CLICK_COMMANDS\"\n- \"PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH\"\n- \"PLACEMENT_TAG_TRACKING\"\n- \"PLACEMENT_TAG_TRACKING_IFRAME\"\n- \"PLACEMENT_TAG_TRACKING_JAVASCRIPT\"", + "items": { + "type": "string", + "enum": [ + "PLACEMENT_TAG_CLICK_COMMANDS", + "PLACEMENT_TAG_IFRAME_ILAYER", + "PLACEMENT_TAG_IFRAME_JAVASCRIPT", + "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3", + "PLACEMENT_TAG_INTERNAL_REDIRECT", + "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT", + "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT", + "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT", + "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_JAVASCRIPT", + "PLACEMENT_TAG_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_STANDARD", + "PLACEMENT_TAG_TRACKING", + "PLACEMENT_TAG_TRACKING_IFRAME", + "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "tagSetting": { + "$ref": "TagSetting", + "description": "Tag settings for this placement." + } + } + }, + "PlacementAssignment": { + "id": "PlacementAssignment", + "type": "object", + "description": "Placement Assignment.", + "properties": { + "active": { + "type": "boolean", + "description": "Whether this placement assignment is active. When true, the placement will be included in the ad's rotation." + }, + "placementId": { + "type": "string", + "description": "ID of the placement to be assigned. This is a required field.", + "format": "int64" + }, + "placementIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the placement. This is a read-only, auto-generated field." + }, + "sslRequired": { + "type": "boolean", + "description": "Whether the placement to be assigned requires SSL. This is a read-only field that is auto-generated when the ad is inserted or updated." + } + } + }, + "PlacementGroup": { + "id": "PlacementGroup", + "type": "object", + "description": "Contains properties of a package or roadblock.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this placement group. This is a read-only field that can be left blank.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this placement group. This is a required field on insertion.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "archived": { + "type": "boolean", + "description": "Whether this placement group is archived." + }, + "campaignId": { + "type": "string", + "description": "Campaign ID of this placement group. This field is required on insertion.", + "format": "int64" + }, + "campaignIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the campaign. This is a read-only, auto-generated field." + }, + "childPlacementIds": { + "type": "array", + "description": "IDs of placements which are assigned to this placement group. This is a read-only, auto-generated field.", + "items": { + "type": "string", + "format": "int64" + } + }, + "comment": { + "type": "string", + "description": "Comments for this placement group." + }, + "contentCategoryId": { + "type": "string", + "description": "ID of the content category assigned to this placement group.", + "format": "int64" + }, + "createInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the creation of this placement group. This is a read-only field." + }, + "directorySiteId": { + "type": "string", + "description": "Directory site ID associated with this placement group. On insert, you must set either this field or the site_id field to specify the site associated with this placement group. This is a required field that is read-only after insertion.", + "format": "int64" + }, + "directorySiteIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the directory site. This is a read-only, auto-generated field." + }, + "externalId": { + "type": "string", + "description": "External ID for this placement." + }, + "id": { + "type": "string", + "description": "ID of this placement group. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this placement group. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placementGroup\".", + "default": "dfareporting#placementGroup" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the most recent modification of this placement group. This is a read-only field." + }, + "name": { + "type": "string", + "description": "Name of this placement group. This is a required field and must be less than 256 characters long." + }, + "placementGroupType": { + "type": "string", + "description": "Type of this placement group. A package is a simple group of placements that acts as a single pricing point for a group of tags. A roadblock is a group of placements that not only acts as a single pricing point, but also assumes that all the tags in it will be served at the same time. A roadblock requires one of its assigned placements to be marked as primary for reporting. This field is required on insertion.", + "enum": [ + "PLACEMENT_PACKAGE", + "PLACEMENT_ROADBLOCK" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "placementStrategyId": { + "type": "string", + "description": "ID of the placement strategy assigned to this placement group.", + "format": "int64" + }, + "pricingSchedule": { + "$ref": "PricingSchedule", + "description": "Pricing schedule of this placement group. This field is required on insertion." + }, + "primaryPlacementId": { + "type": "string", + "description": "ID of the primary placement, used to calculate the media cost of a roadblock (placement group). Modifying this field will automatically modify the primary field on all affected roadblock child placements.", + "format": "int64" + }, + "primaryPlacementIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the primary placement. This is a read-only, auto-generated field." + }, + "siteId": { + "type": "string", + "description": "Site ID associated with this placement group. On insert, you must set either this field or the directorySiteId field to specify the site associated with this placement group. This is a required field that is read-only after insertion.", + "format": "int64" + }, + "siteIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the site. This is a read-only, auto-generated field." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this placement group. This is a read-only field that can be left blank.", + "format": "int64" + } + } + }, + "PlacementGroupsListResponse": { + "id": "PlacementGroupsListResponse", + "type": "object", + "description": "Placement Group List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placementGroupsListResponse\".", + "default": "dfareporting#placementGroupsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "placementGroups": { + "type": "array", + "description": "Placement group collection.", + "items": { + "$ref": "PlacementGroup" + } + } + } + }, + "PlacementStrategiesListResponse": { + "id": "PlacementStrategiesListResponse", + "type": "object", + "description": "Placement Strategy List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placementStrategiesListResponse\".", + "default": "dfareporting#placementStrategiesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "placementStrategies": { + "type": "array", + "description": "Placement strategy collection.", + "items": { + "$ref": "PlacementStrategy" + } + } + } + }, + "PlacementStrategy": { + "id": "PlacementStrategy", + "type": "object", + "description": "Contains properties of a placement strategy.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this placement strategy.This is a read-only field that can be left blank.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "ID of this placement strategy. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placementStrategy\".", + "default": "dfareporting#placementStrategy" + }, + "name": { + "type": "string", + "description": "Name of this placement strategy. This is a required field. It must be less than 256 characters long and unique among placement strategies of the same account." + } + } + }, + "PlacementTag": { + "id": "PlacementTag", + "type": "object", + "description": "Placement Tag", + "properties": { + "placementId": { + "type": "string", + "description": "Placement ID", + "format": "int64" + }, + "tagDatas": { + "type": "array", + "description": "Tags generated for this placement.", + "items": { + "$ref": "TagData" + } + } + } + }, + "PlacementsGenerateTagsResponse": { + "id": "PlacementsGenerateTagsResponse", + "type": "object", + "description": "Placement GenerateTags Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placementsGenerateTagsResponse\".", + "default": "dfareporting#placementsGenerateTagsResponse" + }, + "placementTags": { + "type": "array", + "description": "Set of generated tags for the specified placements.", + "items": { + "$ref": "PlacementTag" + } + } + } + }, + "PlacementsListResponse": { + "id": "PlacementsListResponse", + "type": "object", + "description": "Placement List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#placementsListResponse\".", + "default": "dfareporting#placementsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "placements": { + "type": "array", + "description": "Placement collection.", + "items": { + "$ref": "Placement" + } + } + } + }, + "PlatformType": { + "id": "PlatformType", + "type": "object", + "description": "Contains information about a platform type that can be targeted by ads.", + "properties": { + "id": { + "type": "string", + "description": "ID of this platform type.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#platformType\".", + "default": "dfareporting#platformType" + }, + "name": { + "type": "string", + "description": "Name of this platform type." + } + } + }, + "PlatformTypesListResponse": { + "id": "PlatformTypesListResponse", + "type": "object", + "description": "Platform Type List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#platformTypesListResponse\".", + "default": "dfareporting#platformTypesListResponse" + }, + "platformTypes": { + "type": "array", + "description": "Platform type collection.", + "items": { + "$ref": "PlatformType" + } + } + } + }, + "PopupWindowProperties": { + "id": "PopupWindowProperties", + "type": "object", + "description": "Popup Window Properties.", + "properties": { + "dimension": { + "$ref": "Size", + "description": "Popup dimension for a creative. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA and all VPAID" + }, + "offset": { + "$ref": "OffsetPosition", + "description": "Upper-left corner coordinates of the popup window. Applicable if positionType is COORDINATES." + }, + "positionType": { + "type": "string", + "description": "Popup window position either centered or at specific coordinate.", + "enum": [ + "CENTER", + "COORDINATES" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "showAddressBar": { + "type": "boolean", + "description": "Whether to display the browser address bar." + }, + "showMenuBar": { + "type": "boolean", + "description": "Whether to display the browser menu bar." + }, + "showScrollBar": { + "type": "boolean", + "description": "Whether to display the browser scroll bar." + }, + "showStatusBar": { + "type": "boolean", + "description": "Whether to display the browser status bar." + }, + "showToolBar": { + "type": "boolean", + "description": "Whether to display the browser tool bar." + }, + "title": { + "type": "string", + "description": "Title of popup window." + } + } + }, + "PostalCode": { + "id": "PostalCode", + "type": "object", + "description": "Contains information about a postal code that can be targeted by ads.", + "properties": { + "code": { + "type": "string", + "description": "Postal code. This is equivalent to the id field." + }, + "countryCode": { + "type": "string", + "description": "Country code of the country to which this postal code belongs." + }, + "countryDartId": { + "type": "string", + "description": "DART ID of the country to which this postal code belongs.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "ID of this postal code." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#postalCode\".", + "default": "dfareporting#postalCode" + } + } + }, + "PostalCodesListResponse": { + "id": "PostalCodesListResponse", + "type": "object", + "description": "Postal Code List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#postalCodesListResponse\".", + "default": "dfareporting#postalCodesListResponse" + }, + "postalCodes": { + "type": "array", + "description": "Postal code collection.", + "items": { + "$ref": "PostalCode" + } + } + } + }, + "Pricing": { + "id": "Pricing", + "type": "object", + "description": "Pricing Information", + "properties": { + "capCostType": { + "type": "string", + "description": "Cap cost type of this inventory item.", + "enum": [ + "PLANNING_PLACEMENT_CAP_COST_TYPE_CUMULATIVE", + "PLANNING_PLACEMENT_CAP_COST_TYPE_MONTHLY", + "PLANNING_PLACEMENT_CAP_COST_TYPE_NONE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "endDate": { + "type": "string", + "description": "End date of this inventory item.", + "format": "date" + }, + "flights": { + "type": "array", + "description": "Flights of this inventory item. A flight (a.k.a. pricing period) represents the inventory item pricing information for a specific period of time.", + "items": { + "$ref": "Flight" + } + }, + "groupType": { + "type": "string", + "description": "Group type of this inventory item if it represents a placement group. Is null otherwise. There are two type of placement groups: PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE is a simple group of inventory items that acts as a single pricing point for a group of tags. PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK is a group of inventory items that not only acts as a single pricing point, but also assumes that all the tags in it will be served at the same time. A roadblock requires one of its assigned inventory items to be marked as primary.", + "enum": [ + "PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE", + "PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "pricingType": { + "type": "string", + "description": "Pricing type of this inventory item.", + "enum": [ + "PLANNING_PLACEMENT_PRICING_TYPE_CLICKS", + "PLANNING_PLACEMENT_PRICING_TYPE_CPA", + "PLANNING_PLACEMENT_PRICING_TYPE_CPC", + "PLANNING_PLACEMENT_PRICING_TYPE_CPM", + "PLANNING_PLACEMENT_PRICING_TYPE_FLAT_RATE_CLICKS", + "PLANNING_PLACEMENT_PRICING_TYPE_FLAT_RATE_IMPRESSIONS", + "PLANNING_PLACEMENT_PRICING_TYPE_IMPRESSIONS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "startDate": { + "type": "string", + "description": "Start date of this inventory item.", + "format": "date" + } + } + }, + "PricingSchedule": { + "id": "PricingSchedule", + "type": "object", + "description": "Pricing Schedule", + "properties": { + "capCostOption": { + "type": "string", + "description": "Placement cap cost option.", + "enum": [ + "CAP_COST_CUMULATIVE", + "CAP_COST_MONTHLY", + "CAP_COST_NONE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "disregardOverdelivery": { + "type": "boolean", + "description": "Whether cap costs are ignored by ad serving." + }, + "endDate": { + "type": "string", + "description": "Placement end date. This date must be later than, or the same day as, the placement start date, but not later than the campaign end date. If, for example, you set 6/25/2015 as both the start and end dates, the effective placement date is just that day only, 6/25/2015. The hours, minutes, and seconds of the end date should not be set, as doing so will result in an error. This field is required on insertion.", + "format": "date" + }, + "flighted": { + "type": "boolean", + "description": "Whether this placement is flighted. If true, pricing periods will be computed automatically." + }, + "floodlightActivityId": { + "type": "string", + "description": "Floodlight activity ID associated with this placement. This field should be set when placement pricing type is set to PRICING_TYPE_CPA.", + "format": "int64" + }, + "pricingPeriods": { + "type": "array", + "description": "Pricing periods for this placement.", + "items": { + "$ref": "PricingSchedulePricingPeriod" + } + }, + "pricingType": { + "type": "string", + "description": "Placement pricing type. This field is required on insertion.", + "enum": [ + "PRICING_TYPE_CPA", + "PRICING_TYPE_CPC", + "PRICING_TYPE_CPM", + "PRICING_TYPE_FLAT_RATE_CLICKS", + "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "startDate": { + "type": "string", + "description": "Placement start date. This date must be later than, or the same day as, the campaign start date. The hours, minutes, and seconds of the start date should not be set, as doing so will result in an error. This field is required on insertion.", + "format": "date" + }, + "testingStartDate": { + "type": "string", + "description": "Testing start date of this placement. The hours, minutes, and seconds of the start date should not be set, as doing so will result in an error.", + "format": "date" + } + } + }, + "PricingSchedulePricingPeriod": { + "id": "PricingSchedulePricingPeriod", + "type": "object", + "description": "Pricing Period", + "properties": { + "endDate": { + "type": "string", + "description": "Pricing period end date. This date must be later than, or the same day as, the pricing period start date, but not later than the placement end date. The period end date can be the same date as the period start date. If, for example, you set 6/25/2015 as both the start and end dates, the effective pricing period date is just that day only, 6/25/2015. The hours, minutes, and seconds of the end date should not be set, as doing so will result in an error.", + "format": "date" + }, + "pricingComment": { + "type": "string", + "description": "Comments for this pricing period." + }, + "rateOrCostNanos": { + "type": "string", + "description": "Rate or cost of this pricing period.", + "format": "int64" + }, + "startDate": { + "type": "string", + "description": "Pricing period start date. This date must be later than, or the same day as, the placement start date. The hours, minutes, and seconds of the start date should not be set, as doing so will result in an error.", + "format": "date" + }, + "units": { + "type": "string", + "description": "Units of this pricing period.", + "format": "int64" + } + } + }, + "Project": { + "id": "Project", + "type": "object", + "description": "Contains properties of a DoubleClick Planning project.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this project.", + "format": "int64" + }, + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this project.", + "format": "int64" + }, + "audienceAgeGroup": { + "type": "string", + "description": "Audience age group of this project.", + "enum": [ + "PLANNING_AUDIENCE_AGE_18_24", + "PLANNING_AUDIENCE_AGE_25_34", + "PLANNING_AUDIENCE_AGE_35_44", + "PLANNING_AUDIENCE_AGE_45_54", + "PLANNING_AUDIENCE_AGE_55_64", + "PLANNING_AUDIENCE_AGE_65_OR_MORE", + "PLANNING_AUDIENCE_AGE_UNKNOWN" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "audienceGender": { + "type": "string", + "description": "Audience gender of this project.", + "enum": [ + "PLANNING_AUDIENCE_GENDER_FEMALE", + "PLANNING_AUDIENCE_GENDER_MALE" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "budget": { + "type": "string", + "description": "Budget of this project in the currency specified by the current account. The value stored in this field represents only the non-fractional amount. For example, for USD, the smallest value that can be represented by this field is 1 US dollar.", + "format": "int64" + }, + "clientBillingCode": { + "type": "string", + "description": "Client billing code of this project." + }, + "clientName": { + "type": "string", + "description": "Name of the project client." + }, + "endDate": { + "type": "string", + "description": "End date of the project.", + "format": "date" + }, + "id": { + "type": "string", + "description": "ID of this project. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#project\".", + "default": "dfareporting#project" + }, + "lastModifiedInfo": { + "$ref": "LastModifiedInfo", + "description": "Information about the most recent modification of this project." + }, + "name": { + "type": "string", + "description": "Name of this project." + }, + "overview": { + "type": "string", + "description": "Overview of this project." + }, + "startDate": { + "type": "string", + "description": "Start date of the project.", + "format": "date" + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this project.", + "format": "int64" + }, + "targetClicks": { + "type": "string", + "description": "Number of clicks that the advertiser is targeting.", + "format": "int64" + }, + "targetConversions": { + "type": "string", + "description": "Number of conversions that the advertiser is targeting.", + "format": "int64" + }, + "targetCpaNanos": { + "type": "string", + "description": "CPA that the advertiser is targeting.", + "format": "int64" + }, + "targetCpcNanos": { + "type": "string", + "description": "CPC that the advertiser is targeting.", + "format": "int64" + }, + "targetCpmNanos": { + "type": "string", + "description": "CPM that the advertiser is targeting.", + "format": "int64" + }, + "targetImpressions": { + "type": "string", + "description": "Number of impressions that the advertiser is targeting.", + "format": "int64" + } + } + }, + "ProjectsListResponse": { + "id": "ProjectsListResponse", + "type": "object", + "description": "Project List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#projectsListResponse\".", + "default": "dfareporting#projectsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "projects": { + "type": "array", + "description": "Project collection.", + "items": { + "$ref": "Project" + } + } + } + }, + "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.", + "enum": [ + "ATTACHMENT", + "LINK" + ], + "enumDescriptions": [ + "", + "" + ], + "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" + } + } + }, + "Region": { + "id": "Region", + "type": "object", + "description": "Contains information about a region that can be targeted by ads.", + "properties": { + "countryCode": { + "type": "string", + "description": "Country code of the country to which this region belongs." + }, + "countryDartId": { + "type": "string", + "description": "DART ID of the country to which this region belongs.", + "format": "int64" + }, + "dartId": { + "type": "string", + "description": "DART ID of this region.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#region\".", + "default": "dfareporting#region" + }, + "name": { + "type": "string", + "description": "Name of this region." + }, + "regionCode": { + "type": "string", + "description": "Region code." + } + } + }, + "RegionsListResponse": { + "id": "RegionsListResponse", + "type": "object", + "description": "Region List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#regionsListResponse\".", + "default": "dfareporting#regionsListResponse" + }, + "regions": { + "type": "array", + "description": "Region collection.", + "items": { + "$ref": "Region" + } + } + } + }, + "RemarketingList": { + "id": "RemarketingList", + "type": "object", + "description": "Contains properties of a remarketing list. Remarketing enables you to create lists of users who have performed specific actions on a site, then target ads to members of those lists. This resource can be used to manage remarketing lists that are owned by your advertisers. To see all remarketing lists that are visible to your advertisers, including those that are shared to your advertiser or account, use the TargetableRemarketingLists resource.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this remarketing list. This is a read-only, auto-generated field that is only returned in GET requests.", + "format": "int64" + }, + "active": { + "type": "boolean", + "description": "Whether this remarketing list is active." + }, + "advertiserId": { + "type": "string", + "description": "Dimension value for the advertiser ID that owns this remarketing list. This is a required field.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser. This is a read-only, auto-generated field." + }, + "description": { + "type": "string", + "description": "Remarketing list description." + }, + "id": { + "type": "string", + "description": "Remarketing list ID. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#remarketingList\".", + "default": "dfareporting#remarketingList" + }, + "lifeSpan": { + "type": "string", + "description": "Number of days that a user should remain in the remarketing list without an impression.", + "format": "int64" + }, + "listPopulationRule": { + "$ref": "ListPopulationRule", + "description": "Rule used to populate the remarketing list with users." + }, + "listSize": { + "type": "string", + "description": "Number of users currently in the list. This is a read-only field.", + "format": "int64" + }, + "listSource": { + "type": "string", + "description": "Product from which this remarketing list was originated.", + "enum": [ + "REMARKETING_LIST_SOURCE_DBM", + "REMARKETING_LIST_SOURCE_DFA", + "REMARKETING_LIST_SOURCE_DMP", + "REMARKETING_LIST_SOURCE_GA", + "REMARKETING_LIST_SOURCE_OTHER" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "name": { + "type": "string", + "description": "Name of the remarketing list. This is a required field. Must be no greater than 128 characters long." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this remarketing list. This is a read-only, auto-generated field that is only returned in GET requests.", + "format": "int64" + } + } + }, + "RemarketingListShare": { + "id": "RemarketingListShare", + "type": "object", + "description": "Contains properties of a remarketing list's sharing information. Sharing allows other accounts or advertisers to target to your remarketing lists. This resource can be used to manage remarketing list sharing to other accounts and advertisers.", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#remarketingListShare\".", + "default": "dfareporting#remarketingListShare" + }, + "remarketingListId": { + "type": "string", + "description": "Remarketing list ID. This is a read-only, auto-generated field.", + "format": "int64" + }, + "sharedAccountIds": { + "type": "array", + "description": "Accounts that the remarketing list is shared with.", + "items": { + "type": "string", + "format": "int64" + } + }, + "sharedAdvertiserIds": { + "type": "array", + "description": "Advertisers that the remarketing list is shared with.", + "items": { + "type": "string", + "format": "int64" + } + } + } + }, + "RemarketingListsListResponse": { + "id": "RemarketingListsListResponse", + "type": "object", + "description": "Remarketing list response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#remarketingListsListResponse\".", + "default": "dfareporting#remarketingListsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "remarketingLists": { + "type": "array", + "description": "Remarketing list collection.", + "items": { + "$ref": "RemarketingList" + } + } + } + }, + "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" + ] + } + }, + "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.", + "enum": [ + "ADVERTISER", + "CAMPAIGN", + "SITE_BY_ADVERTISER", + "SITE_BY_CAMPAIGN" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "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.", + "enum": [ + "ATTACHMENT", + "LINK" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "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 filename 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. 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.", + "enum": [ + "CSV", + "EXCEL" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "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" + } + }, + "enableAllDimensionCombinations": { + "type": "boolean", + "description": "Whether to enable all reach dimension combinations in the report. Defaults to false. If enabled, the date range of the report should be within the last three months." + }, + "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. Note: \n- \"DAILY\" also requires field \"every\" to be set. \n- \"WEEKLY\" also requires fields \"every\" and \"repeatsOnWeekDays\" to be set. \n- \"MONTHLY\" also requires fields \"every\" and \"runsOnDayOfMonth\" to be set.", + "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", + "enum": [ + "FRIDAY", + "MONDAY", + "SATURDAY", + "SUNDAY", + "THURSDAY", + "TUESDAY", + "WEDNESDAY" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "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.\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.", + "enum": [ + "DAY_OF_MONTH", + "WEEK_OF_MONTH" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "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 subaccount ID to which this report belongs if applicable.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "The type of the report.", + "enum": [ + "CROSS_DIMENSION_REACH", + "FLOODLIGHT", + "PATH_TO_CONVERSION", + "REACH", + "STANDARD" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ], + "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." + } + } + }, + "ReportsConfiguration": { + "id": "ReportsConfiguration", + "type": "object", + "description": "Reporting Configuration", + "properties": { + "exposureToConversionEnabled": { + "type": "boolean", + "description": "Whether the exposure to conversion report is enabled. This report shows detailed pathway information on up to 10 of the most recent ad exposures seen by a user before converting." + }, + "lookbackConfiguration": { + "$ref": "LookbackConfiguration", + "description": "Default lookback windows for new advertisers in this account." + }, + "reportGenerationTimeZoneId": { + "type": "string", + "description": "Report generation time zone ID of this account. This is a required field that can only be changed by a superuser.\nAcceptable values are:\n\n- \"1\" for \"America/New_York\" \n- \"2\" for \"Europe/London\" \n- \"3\" for \"Europe/Paris\" \n- \"4\" for \"Africa/Johannesburg\" \n- \"5\" for \"Asia/Jerusalem\" \n- \"6\" for \"Asia/Shanghai\" \n- \"7\" for \"Asia/Hong_Kong\" \n- \"8\" for \"Asia/Tokyo\" \n- \"9\" for \"Australia/Sydney\" \n- \"10\" for \"Asia/Dubai\" \n- \"11\" for \"America/Los_Angeles\" \n- \"12\" for \"Pacific/Auckland\" \n- \"13\" for \"America/Sao_Paulo\"", + "format": "int64" + } + } + }, + "RichMediaExitOverride": { + "id": "RichMediaExitOverride", + "type": "object", + "description": "Rich Media Exit Override.", + "properties": { + "customExitUrl": { + "type": "string", + "description": "Click-through URL to override the default exit URL. Applicable if the useCustomExitUrl field is set to true." + }, + "exitId": { + "type": "string", + "description": "ID for the override to refer to a specific exit in the creative.", + "format": "int64" + }, + "useCustomExitUrl": { + "type": "boolean", + "description": "Whether to use the custom exit URL." + } + } + }, + "Site": { + "id": "Site", + "type": "object", + "description": "Contains properties of a site.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this site. This is a read-only field that can be left blank.", + "format": "int64" + }, + "approved": { + "type": "boolean", + "description": "Whether this site is approved." + }, + "directorySiteId": { + "type": "string", + "description": "Directory site associated with this site. This is a required field that is read-only after insertion.", + "format": "int64" + }, + "directorySiteIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the directory site. This is a read-only, auto-generated field." + }, + "id": { + "type": "string", + "description": "ID of this site. This is a read-only, auto-generated field.", + "format": "int64" + }, + "idDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of this site. This is a read-only, auto-generated field." + }, + "keyName": { + "type": "string", + "description": "Key name of this site. This is a read-only, auto-generated field." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#site\".", + "default": "dfareporting#site" + }, + "name": { + "type": "string", + "description": "Name of this site.This is a required field. Must be less than 128 characters long. If this site is under a subaccount, the name must be unique among sites of the same subaccount. Otherwise, this site is a top-level site, and the name must be unique among top-level sites of the same account." + }, + "siteContacts": { + "type": "array", + "description": "Site contacts.", + "items": { + "$ref": "SiteContact" + } + }, + "siteSettings": { + "$ref": "SiteSettings", + "description": "Site-wide settings." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this site. This is a read-only field that can be left blank.", + "format": "int64" + } + } + }, + "SiteContact": { + "id": "SiteContact", + "type": "object", + "description": "Site Contact", + "properties": { + "address": { + "type": "string", + "description": "Address of this site contact." + }, + "contactType": { + "type": "string", + "description": "Site contact type.", + "enum": [ + "SALES_PERSON", + "TRAFFICKER" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "email": { + "type": "string", + "description": "Email address of this site contact. This is a required field." + }, + "firstName": { + "type": "string", + "description": "First name of this site contact." + }, + "id": { + "type": "string", + "description": "ID of this site contact. This is a read-only, auto-generated field.", + "format": "int64" + }, + "lastName": { + "type": "string", + "description": "Last name of this site contact." + }, + "phone": { + "type": "string", + "description": "Primary phone number of this site contact." + }, + "title": { + "type": "string", + "description": "Title or designation of this site contact." + } + } + }, + "SiteSettings": { + "id": "SiteSettings", + "type": "object", + "description": "Site Settings", + "properties": { + "activeViewOptOut": { + "type": "boolean", + "description": "Whether active view creatives are disabled for this site." + }, + "creativeSettings": { + "$ref": "CreativeSettings", + "description": "Site-wide creative settings." + }, + "disableBrandSafeAds": { + "type": "boolean", + "description": "Whether brand safe ads are disabled for this site." + }, + "disableNewCookie": { + "type": "boolean", + "description": "Whether new cookies are disabled for this site." + }, + "lookbackConfiguration": { + "$ref": "LookbackConfiguration", + "description": "Lookback window settings for this site." + }, + "tagSetting": { + "$ref": "TagSetting", + "description": "Configuration settings for dynamic and image floodlight tags." + } + } + }, + "SitesListResponse": { + "id": "SitesListResponse", + "type": "object", + "description": "Site List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#sitesListResponse\".", + "default": "dfareporting#sitesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "sites": { + "type": "array", + "description": "Site collection.", + "items": { + "$ref": "Site" + } + } + } + }, + "Size": { + "id": "Size", + "type": "object", + "description": "Represents the dimensions of ads, placements, creatives, or creative assets.", + "properties": { + "height": { + "type": "integer", + "description": "Height of this size.", + "format": "int32" + }, + "iab": { + "type": "boolean", + "description": "IAB standard size. This is a read-only, auto-generated field." + }, + "id": { + "type": "string", + "description": "ID of this size. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#size\".", + "default": "dfareporting#size" + }, + "width": { + "type": "integer", + "description": "Width of this size.", + "format": "int32" + } + } + }, + "SizesListResponse": { + "id": "SizesListResponse", + "type": "object", + "description": "Size List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#sizesListResponse\".", + "default": "dfareporting#sizesListResponse" + }, + "sizes": { + "type": "array", + "description": "Size collection.", + "items": { + "$ref": "Size" + } + } + } + }, + "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.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "Subaccount": { + "id": "Subaccount", + "type": "object", + "description": "Contains properties of a DCM subaccount.", + "properties": { + "accountId": { + "type": "string", + "description": "ID of the account that contains this subaccount. This is a read-only field that can be left blank.", + "format": "int64" + }, + "availablePermissionIds": { + "type": "array", + "description": "IDs of the available user role permissions for this subaccount.", + "items": { + "type": "string", + "format": "int64" + } + }, + "id": { + "type": "string", + "description": "ID of this subaccount. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#subaccount\".", + "default": "dfareporting#subaccount" + }, + "name": { + "type": "string", + "description": "Name of this subaccount. This is a required field. Must be less than 128 characters long and be unique among subaccounts of the same account." + } + } + }, + "SubaccountsListResponse": { + "id": "SubaccountsListResponse", + "type": "object", + "description": "Subaccount List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#subaccountsListResponse\".", + "default": "dfareporting#subaccountsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "subaccounts": { + "type": "array", + "description": "Subaccount collection.", + "items": { + "$ref": "Subaccount" + } + } + } + }, + "TagData": { + "id": "TagData", + "type": "object", + "description": "Placement Tag Data", + "properties": { + "adId": { + "type": "string", + "description": "Ad associated with this placement tag.", + "format": "int64" + }, + "clickTag": { + "type": "string", + "description": "Tag string to record a click." + }, + "creativeId": { + "type": "string", + "description": "Creative associated with this placement tag.", + "format": "int64" + }, + "format": { + "type": "string", + "description": "TagData tag format of this tag.", + "enum": [ + "PLACEMENT_TAG_CLICK_COMMANDS", + "PLACEMENT_TAG_IFRAME_ILAYER", + "PLACEMENT_TAG_IFRAME_JAVASCRIPT", + "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3", + "PLACEMENT_TAG_INTERNAL_REDIRECT", + "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT", + "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT", + "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT", + "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_JAVASCRIPT", + "PLACEMENT_TAG_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_STANDARD", + "PLACEMENT_TAG_TRACKING", + "PLACEMENT_TAG_TRACKING_IFRAME", + "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "impressionTag": { + "type": "string", + "description": "Tag string for serving an ad." + } + } + }, + "TagSetting": { + "id": "TagSetting", + "type": "object", + "description": "Tag Settings", + "properties": { + "additionalKeyValues": { + "type": "string", + "description": "Additional key-values to be included in tags. Each key-value pair must be of the form key=value, and pairs must be separated by a semicolon (;). Keys and values must not contain commas. For example, id=2;color=red is a valid value for this field." + }, + "includeClickThroughUrls": { + "type": "boolean", + "description": "Whether static landing page URLs should be included in the tags. This setting applies only to placements." + }, + "includeClickTracking": { + "type": "boolean", + "description": "Whether click-tracking string should be included in the tags." + }, + "keywordOption": { + "type": "string", + "description": "Option specifying how keywords are embedded in ad tags. This setting can be used to specify whether keyword placeholders are inserted in placement tags for this site. Publishers can then add keywords to those placeholders.", + "enum": [ + "GENERATE_SEPARATE_TAG_FOR_EACH_KEYWORD", + "IGNORE", + "PLACEHOLDER_WITH_LIST_OF_KEYWORDS" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "TagSettings": { + "id": "TagSettings", + "type": "object", + "description": "Dynamic and Image Tag Settings.", + "properties": { + "dynamicTagEnabled": { + "type": "boolean", + "description": "Whether dynamic floodlight tags are enabled." + }, + "imageTagEnabled": { + "type": "boolean", + "description": "Whether image tags are enabled." + } + } + }, + "TargetWindow": { + "id": "TargetWindow", + "type": "object", + "description": "Target Window.", + "properties": { + "customHtml": { + "type": "string", + "description": "User-entered value." + }, + "targetWindowOption": { + "type": "string", + "description": "Type of browser window for which the backup image of the flash creative can be displayed.", + "enum": [ + "CURRENT_WINDOW", + "CUSTOM", + "NEW_WINDOW" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "TargetableRemarketingList": { + "id": "TargetableRemarketingList", + "type": "object", + "description": "Contains properties of a targetable remarketing list. Remarketing enables you to create lists of users who have performed specific actions on a site, then target ads to members of those lists. This resource is a read-only view of a remarketing list to be used to faciliate targeting ads to specific lists. Remarketing lists that are owned by your advertisers and those that are shared to your advertisers or account are accessible via this resource. To manage remarketing lists that are owned by your advertisers, use the RemarketingLists resource.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this remarketing list. This is a read-only, auto-generated field that is only returned in GET requests.", + "format": "int64" + }, + "active": { + "type": "boolean", + "description": "Whether this targetable remarketing list is active." + }, + "advertiserId": { + "type": "string", + "description": "Dimension value for the advertiser ID that owns this targetable remarketing list.", + "format": "int64" + }, + "advertiserIdDimensionValue": { + "$ref": "DimensionValue", + "description": "Dimension value for the ID of the advertiser." + }, + "description": { + "type": "string", + "description": "Targetable remarketing list description." + }, + "id": { + "type": "string", + "description": "Targetable remarketing list ID.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#targetableRemarketingList\".", + "default": "dfareporting#targetableRemarketingList" + }, + "lifeSpan": { + "type": "string", + "description": "Number of days that a user should remain in the targetable remarketing list without an impression.", + "format": "int64" + }, + "listSize": { + "type": "string", + "description": "Number of users currently in the list. This is a read-only field.", + "format": "int64" + }, + "listSource": { + "type": "string", + "description": "Product from which this targetable remarketing list was originated.", + "enum": [ + "REMARKETING_LIST_SOURCE_DBM", + "REMARKETING_LIST_SOURCE_DFA", + "REMARKETING_LIST_SOURCE_DMP", + "REMARKETING_LIST_SOURCE_GA", + "REMARKETING_LIST_SOURCE_OTHER" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "name": { + "type": "string", + "description": "Name of the targetable remarketing list. Is no greater than 128 characters long." + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this remarketing list. This is a read-only, auto-generated field that is only returned in GET requests.", + "format": "int64" + } + } + }, + "TargetableRemarketingListsListResponse": { + "id": "TargetableRemarketingListsListResponse", + "type": "object", + "description": "Targetable remarketing list response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#targetableRemarketingListsListResponse\".", + "default": "dfareporting#targetableRemarketingListsListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "targetableRemarketingLists": { + "type": "array", + "description": "Targetable remarketing list collection.", + "items": { + "$ref": "TargetableRemarketingList" + } + } + } + }, + "TechnologyTargeting": { + "id": "TechnologyTargeting", + "type": "object", + "description": "Technology Targeting.", + "properties": { + "browsers": { + "type": "array", + "description": "Browsers that this ad targets. For each browser either set browserVersionId or dartId along with the version numbers. If both are specified, only browserVersionId will be used.The other fields are populated automatically when the ad is inserted or updated.", + "items": { + "$ref": "Browser" + } + }, + "connectionTypes": { + "type": "array", + "description": "Connection types that this ad targets. For each connection type only id is required.The other fields are populated automatically when the ad is inserted or updated.", + "items": { + "$ref": "ConnectionType" + } + }, + "mobileCarriers": { + "type": "array", + "description": "Mobile carriers that this ad targets. For each mobile carrier only id is required, and the other fields are populated automatically when the ad is inserted or updated. If targeting a mobile carrier, do not set targeting for any zip codes.", + "items": { + "$ref": "MobileCarrier" + } + }, + "operatingSystemVersions": { + "type": "array", + "description": "Operating system versions that this ad targets. To target all versions, use operatingSystems. For each operating system version, only id is required. The other fields are populated automatically when the ad is inserted or updated. If targeting an operating system version, do not set targeting for the corresponding operating system in operatingSystems.", + "items": { + "$ref": "OperatingSystemVersion" + } + }, + "operatingSystems": { + "type": "array", + "description": "Operating systems that this ad targets. To target specific versions, use operatingSystemVersions. For each operating system only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting an operating system, do not set targeting for operating system versions for the same operating system.", + "items": { + "$ref": "OperatingSystem" + } + }, + "platformTypes": { + "type": "array", + "description": "Platform types that this ad targets. For example, desktop, mobile, or tablet. For each platform type, only id is required, and the other fields are populated automatically when the ad is inserted or updated.", + "items": { + "$ref": "PlatformType" + } + } + } + }, + "ThirdPartyAuthenticationToken": { + "id": "ThirdPartyAuthenticationToken", + "type": "object", + "description": "Third Party Authentication Token", + "properties": { + "name": { + "type": "string", + "description": "Name of the third-party authentication token." + }, + "value": { + "type": "string", + "description": "Value of the third-party authentication token. This is a read-only, auto-generated field." + } + } + }, + "ThirdPartyTrackingUrl": { + "id": "ThirdPartyTrackingUrl", + "type": "object", + "description": "Third-party Tracking URL.", + "properties": { + "thirdPartyUrlType": { + "type": "string", + "description": "Third-party URL type for in-stream video creatives.", + "enum": [ + "CLICK_TRACKING", + "IMPRESSION", + "RICH_MEDIA_BACKUP_IMPRESSION", + "RICH_MEDIA_IMPRESSION", + "RICH_MEDIA_RM_IMPRESSION", + "SURVEY", + "VIDEO_COMPLETE", + "VIDEO_CUSTOM", + "VIDEO_FIRST_QUARTILE", + "VIDEO_FULLSCREEN", + "VIDEO_MIDPOINT", + "VIDEO_MUTE", + "VIDEO_PAUSE", + "VIDEO_REWIND", + "VIDEO_START", + "VIDEO_STOP", + "VIDEO_THIRD_QUARTILE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "url": { + "type": "string", + "description": "URL for the specified third-party URL type." + } + } + }, + "UserDefinedVariableConfiguration": { + "id": "UserDefinedVariableConfiguration", + "type": "object", + "description": "User Defined Variable configuration.", + "properties": { + "dataType": { + "type": "string", + "description": "Data type for the variable. This is a required field.", + "enum": [ + "NUMBER", + "STRING" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "reportName": { + "type": "string", + "description": "User-friendly name for the variable which will appear in reports. This is a required field, must be less than 64 characters long, and cannot contain the following characters: \"\"\u003c\u003e\"." + }, + "variableType": { + "type": "string", + "description": "Variable name in the tag. This is a required field.", + "enum": [ + "U1", + "U10", + "U11", + "U12", + "U13", + "U14", + "U15", + "U16", + "U17", + "U18", + "U19", + "U2", + "U20", + "U3", + "U4", + "U5", + "U6", + "U7", + "U8", + "U9" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "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" + } + } + }, + "UserRole": { + "id": "UserRole", + "type": "object", + "description": "Contains properties of auser role, which is used to manage user access.", + "properties": { + "accountId": { + "type": "string", + "description": "Account ID of this user role. This is a read-only field that can be left blank.", + "format": "int64" + }, + "defaultUserRole": { + "type": "boolean", + "description": "Whether this is a default user role. Default user roles are created by the system for the account/subaccount and cannot be modified or deleted. Each default user role comes with a basic set of preassigned permissions." + }, + "id": { + "type": "string", + "description": "ID of this user role. This is a read-only, auto-generated field.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#userRole\".", + "default": "dfareporting#userRole" + }, + "name": { + "type": "string", + "description": "Name of this user role. This is a required field. Must be less than 256 characters long. If this user role is under a subaccount, the name must be unique among sites of the same subaccount. Otherwise, this user role is a top-level user role, and the name must be unique among top-level user roles of the same account." + }, + "parentUserRoleId": { + "type": "string", + "description": "ID of the user role that this user role is based on or copied from. This is a required field.", + "format": "int64" + }, + "permissions": { + "type": "array", + "description": "List of permissions associated with this user role.", + "items": { + "$ref": "UserRolePermission" + } + }, + "subaccountId": { + "type": "string", + "description": "Subaccount ID of this user role. This is a read-only field that can be left blank.", + "format": "int64" + } + } + }, + "UserRolePermission": { + "id": "UserRolePermission", + "type": "object", + "description": "Contains properties of a user role permission.", + "properties": { + "availability": { + "type": "string", + "description": "Levels of availability for a user role permission.", + "enum": [ + "ACCOUNT_ALWAYS", + "ACCOUNT_BY_DEFAULT", + "NOT_AVAILABLE_BY_DEFAULT", + "SUBACCOUNT_AND_ACCOUNT_ALWAYS", + "SUBACCOUNT_AND_ACCOUNT_BY_DEFAULT" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "id": { + "type": "string", + "description": "ID of this user role permission.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#userRolePermission\".", + "default": "dfareporting#userRolePermission" + }, + "name": { + "type": "string", + "description": "Name of this user role permission." + }, + "permissionGroupId": { + "type": "string", + "description": "ID of the permission group that this user role permission belongs to.", + "format": "int64" + } + } + }, + "UserRolePermissionGroup": { + "id": "UserRolePermissionGroup", + "type": "object", + "description": "Represents a grouping of related user role permissions.", + "properties": { + "id": { + "type": "string", + "description": "ID of this user role permission.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#userRolePermissionGroup\".", + "default": "dfareporting#userRolePermissionGroup" + }, + "name": { + "type": "string", + "description": "Name of this user role permission group." + } + } + }, + "UserRolePermissionGroupsListResponse": { + "id": "UserRolePermissionGroupsListResponse", + "type": "object", + "description": "User Role Permission Group List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#userRolePermissionGroupsListResponse\".", + "default": "dfareporting#userRolePermissionGroupsListResponse" + }, + "userRolePermissionGroups": { + "type": "array", + "description": "User role permission group collection.", + "items": { + "$ref": "UserRolePermissionGroup" + } + } + } + }, + "UserRolePermissionsListResponse": { + "id": "UserRolePermissionsListResponse", + "type": "object", + "description": "User Role Permission List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#userRolePermissionsListResponse\".", + "default": "dfareporting#userRolePermissionsListResponse" + }, + "userRolePermissions": { + "type": "array", + "description": "User role permission collection.", + "items": { + "$ref": "UserRolePermission" + } + } + } + }, + "UserRolesListResponse": { + "id": "UserRolesListResponse", + "type": "object", + "description": "User Role List Response", + "properties": { + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"dfareporting#userRolesListResponse\".", + "default": "dfareporting#userRolesListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Pagination token to be used for the next list operation." + }, + "userRoles": { + "type": "array", + "description": "User role collection.", + "items": { + "$ref": "UserRole" + } + } + } + } + }, + "resources": { + "accountActiveAdSummaries": { + "methods": { + "get": { + "id": "dfareporting.accountActiveAdSummaries.get", + "path": "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}", + "httpMethod": "GET", + "description": "Gets the account's active ad summary by account ID.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "summaryAccountId": { + "type": "string", + "description": "Account ID.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "summaryAccountId" + ], + "response": { + "$ref": "AccountActiveAdSummary" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "accountPermissionGroups": { + "methods": { + "get": { + "id": "dfareporting.accountPermissionGroups.get", + "path": "userprofiles/{profileId}/accountPermissionGroups/{id}", + "httpMethod": "GET", + "description": "Gets one account permission group by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Account permission group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "AccountPermissionGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.accountPermissionGroups.list", + "path": "userprofiles/{profileId}/accountPermissionGroups", + "httpMethod": "GET", + "description": "Retrieves the list of account permission groups.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AccountPermissionGroupsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "accountPermissions": { + "methods": { + "get": { + "id": "dfareporting.accountPermissions.get", + "path": "userprofiles/{profileId}/accountPermissions/{id}", + "httpMethod": "GET", + "description": "Gets one account permission by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Account permission ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "AccountPermission" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.accountPermissions.list", + "path": "userprofiles/{profileId}/accountPermissions", + "httpMethod": "GET", + "description": "Retrieves the list of account permissions.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AccountPermissionsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "accountUserProfiles": { + "methods": { + "get": { + "id": "dfareporting.accountUserProfiles.get", + "path": "userprofiles/{profileId}/accountUserProfiles/{id}", + "httpMethod": "GET", + "description": "Gets one account user profile by ID.", + "parameters": { + "id": { + "type": "string", + "description": "User profile ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "AccountUserProfile" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.accountUserProfiles.insert", + "path": "userprofiles/{profileId}/accountUserProfiles", + "httpMethod": "POST", + "description": "Inserts a new account user profile.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "AccountUserProfile" + }, + "response": { + "$ref": "AccountUserProfile" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.accountUserProfiles.list", + "path": "userprofiles/{profileId}/accountUserProfiles", + "httpMethod": "GET", + "description": "Retrieves a list of account user profiles, possibly filtered.", + "parameters": { + "active": { + "type": "boolean", + "description": "Select only active user profiles.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only user profiles with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, \"user profile*2015\" will return objects with names like \"user profile June 2015\", \"user profile April 2015\", or simply \"user profile 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"user profile\" will match objects with name \"my user profile\", \"user profile 2015\", or simply \"user profile\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "subaccountId": { + "type": "string", + "description": "Select only user profiles with the specified subaccount ID.", + "format": "int64", + "location": "query" + }, + "userRoleId": { + "type": "string", + "description": "Select only user profiles with the specified user role ID.", + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AccountUserProfilesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.accountUserProfiles.patch", + "path": "userprofiles/{profileId}/accountUserProfiles", + "httpMethod": "PATCH", + "description": "Updates an existing account user profile. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "User profile ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "AccountUserProfile" + }, + "response": { + "$ref": "AccountUserProfile" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.accountUserProfiles.update", + "path": "userprofiles/{profileId}/accountUserProfiles", + "httpMethod": "PUT", + "description": "Updates an existing account user profile.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "AccountUserProfile" + }, + "response": { + "$ref": "AccountUserProfile" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "accounts": { + "methods": { + "get": { + "id": "dfareporting.accounts.get", + "path": "userprofiles/{profileId}/accounts/{id}", + "httpMethod": "GET", + "description": "Gets one account by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Account ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.accounts.list", + "path": "userprofiles/{profileId}/accounts", + "httpMethod": "GET", + "description": "Retrieves the list of accounts, possibly filtered.", + "parameters": { + "active": { + "type": "boolean", + "description": "Select only active accounts. Don't set this field to select both active and non-active accounts.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only accounts with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"account*2015\" will return objects with names like \"account June 2015\", \"account April 2015\", or simply \"account 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"account\" will match objects with name \"my account\", \"account 2015\", or simply \"account\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AccountsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.accounts.patch", + "path": "userprofiles/{profileId}/accounts", + "httpMethod": "PATCH", + "description": "Updates an existing account. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Account ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Account" + }, + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.accounts.update", + "path": "userprofiles/{profileId}/accounts", + "httpMethod": "PUT", + "description": "Updates an existing account.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Account" + }, + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "ads": { + "methods": { + "get": { + "id": "dfareporting.ads.get", + "path": "userprofiles/{profileId}/ads/{id}", + "httpMethod": "GET", + "description": "Gets one ad by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Ad ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Ad" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.ads.insert", + "path": "userprofiles/{profileId}/ads", + "httpMethod": "POST", + "description": "Inserts a new ad.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Ad" + }, + "response": { + "$ref": "Ad" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.ads.list", + "path": "userprofiles/{profileId}/ads", + "httpMethod": "GET", + "description": "Retrieves a list of ads, possibly filtered.", + "parameters": { + "active": { + "type": "boolean", + "description": "Select only active ads.", + "location": "query" + }, + "advertiserId": { + "type": "string", + "description": "Select only ads with this advertiser ID.", + "format": "int64", + "location": "query" + }, + "archived": { + "type": "boolean", + "description": "Select only archived ads.", + "location": "query" + }, + "audienceSegmentIds": { + "type": "string", + "description": "Select only ads with these audience segment IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "campaignIds": { + "type": "string", + "description": "Select only ads with these campaign IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "compatibility": { + "type": "string", + "description": "Select default ads with the specified compatibility. Applicable when type is AD_SERVING_DEFAULT_AD. WEB and WEB_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering an in-stream video ads developed with the VAST standard.", + "enum": [ + "APP", + "APP_INTERSTITIAL", + "IN_STREAM_VIDEO", + "WEB", + "WEB_INTERSTITIAL" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ], + "location": "query" + }, + "creativeIds": { + "type": "string", + "description": "Select only ads with these creative IDs assigned.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "creativeOptimizationConfigurationIds": { + "type": "string", + "description": "Select only ads with these creative optimization configuration IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "creativeType": { + "type": "string", + "description": "Select only ads with the specified creativeType.", + "enum": [ + "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO", + "CUSTOM_INPAGE", + "CUSTOM_INTERSTITIAL", + "ENHANCED_BANNER", + "ENHANCED_IMAGE", + "FLASH_INPAGE", + "HTML5_BANNER", + "IMAGE", + "INSTREAM_VIDEO", + "INTERNAL_REDIRECT", + "INTERSTITIAL_INTERNAL_REDIRECT", + "REDIRECT", + "RICH_MEDIA_EXPANDING", + "RICH_MEDIA_IM_EXPAND", + "RICH_MEDIA_INPAGE", + "RICH_MEDIA_INPAGE_FLOATING", + "RICH_MEDIA_INTERSTITIAL_FLOAT", + "RICH_MEDIA_MOBILE_IN_APP", + "RICH_MEDIA_MULTI_FLOATING", + "RICH_MEDIA_PEEL_DOWN", + "TRACKING_TEXT", + "VAST_REDIRECT", + "VPAID_LINEAR", + "VPAID_NON_LINEAR" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "location": "query" + }, + "dynamicClickTracker": { + "type": "boolean", + "description": "Select only dynamic click trackers. Applicable when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click trackers. If false, select static click trackers. Leave unset to select both.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only ads with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "landingPageIds": { + "type": "string", + "description": "Select only ads with these landing page IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "overriddenEventTagId": { + "type": "string", + "description": "Select only ads with this event tag override ID.", + "format": "int64", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "placementIds": { + "type": "string", + "description": "Select only ads with these placement IDs assigned.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "remarketingListIds": { + "type": "string", + "description": "Select only ads whose list targeting expression use these remarketing list IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"ad*2015\" will return objects with names like \"ad June 2015\", \"ad April 2015\", or simply \"ad 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"ad\" will match objects with name \"my ad\", \"ad 2015\", or simply \"ad\".", + "location": "query" + }, + "sizeIds": { + "type": "string", + "description": "Select only ads with these size IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sslCompliant": { + "type": "boolean", + "description": "Select only ads that are SSL-compliant.", + "location": "query" + }, + "sslRequired": { + "type": "boolean", + "description": "Select only ads that require SSL.", + "location": "query" + }, + "type": { + "type": "string", + "description": "Select only ads with these types.", + "enum": [ + "AD_SERVING_CLICK_TRACKER", + "AD_SERVING_DEFAULT_AD", + "AD_SERVING_STANDARD_AD", + "AD_SERVING_TRACKING" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AdsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.ads.patch", + "path": "userprofiles/{profileId}/ads", + "httpMethod": "PATCH", + "description": "Updates an existing ad. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Ad ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Ad" + }, + "response": { + "$ref": "Ad" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.ads.update", + "path": "userprofiles/{profileId}/ads", + "httpMethod": "PUT", + "description": "Updates an existing ad.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Ad" + }, + "response": { + "$ref": "Ad" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "advertiserGroups": { + "methods": { + "delete": { + "id": "dfareporting.advertiserGroups.delete", + "path": "userprofiles/{profileId}/advertiserGroups/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing advertiser group.", + "parameters": { + "id": { + "type": "string", + "description": "Advertiser group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.advertiserGroups.get", + "path": "userprofiles/{profileId}/advertiserGroups/{id}", + "httpMethod": "GET", + "description": "Gets one advertiser group by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Advertiser group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "AdvertiserGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.advertiserGroups.insert", + "path": "userprofiles/{profileId}/advertiserGroups", + "httpMethod": "POST", + "description": "Inserts a new advertiser group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "AdvertiserGroup" + }, + "response": { + "$ref": "AdvertiserGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.advertiserGroups.list", + "path": "userprofiles/{profileId}/advertiserGroups", + "httpMethod": "GET", + "description": "Retrieves a list of advertiser groups, possibly filtered.", + "parameters": { + "ids": { + "type": "string", + "description": "Select only advertiser groups with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"advertiser*2015\" will return objects with names like \"advertiser group June 2015\", \"advertiser group April 2015\", or simply \"advertiser group 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"advertisergroup\" will match objects with name \"my advertisergroup\", \"advertisergroup 2015\", or simply \"advertisergroup\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AdvertiserGroupsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.advertiserGroups.patch", + "path": "userprofiles/{profileId}/advertiserGroups", + "httpMethod": "PATCH", + "description": "Updates an existing advertiser group. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Advertiser group ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "AdvertiserGroup" + }, + "response": { + "$ref": "AdvertiserGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.advertiserGroups.update", + "path": "userprofiles/{profileId}/advertiserGroups", + "httpMethod": "PUT", + "description": "Updates an existing advertiser group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "AdvertiserGroup" + }, + "response": { + "$ref": "AdvertiserGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "advertisers": { + "methods": { + "get": { + "id": "dfareporting.advertisers.get", + "path": "userprofiles/{profileId}/advertisers/{id}", + "httpMethod": "GET", + "description": "Gets one advertiser by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Advertiser ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Advertiser" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.advertisers.insert", + "path": "userprofiles/{profileId}/advertisers", + "httpMethod": "POST", + "description": "Inserts a new advertiser.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Advertiser" + }, + "response": { + "$ref": "Advertiser" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.advertisers.list", + "path": "userprofiles/{profileId}/advertisers", + "httpMethod": "GET", + "description": "Retrieves a list of advertisers, possibly filtered.", + "parameters": { + "advertiserGroupIds": { + "type": "string", + "description": "Select only advertisers with these advertiser group IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "floodlightConfigurationIds": { + "type": "string", + "description": "Select only advertisers with these floodlight configuration IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only advertisers with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "includeAdvertisersWithoutGroupsOnly": { + "type": "boolean", + "description": "Select only advertisers which do not belong to any advertiser group.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "onlyParent": { + "type": "boolean", + "description": "Select only advertisers which use another advertiser's floodlight configuration.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"advertiser*2015\" will return objects with names like \"advertiser June 2015\", \"advertiser April 2015\", or simply \"advertiser 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"advertiser\" will match objects with name \"my advertiser\", \"advertiser 2015\", or simply \"advertiser\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "status": { + "type": "string", + "description": "Select only advertisers with the specified status.", + "enum": [ + "APPROVED", + "ON_HOLD" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "subaccountId": { + "type": "string", + "description": "Select only advertisers with these subaccount IDs.", + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "AdvertisersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.advertisers.patch", + "path": "userprofiles/{profileId}/advertisers", + "httpMethod": "PATCH", + "description": "Updates an existing advertiser. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Advertiser ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Advertiser" + }, + "response": { + "$ref": "Advertiser" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.advertisers.update", + "path": "userprofiles/{profileId}/advertisers", + "httpMethod": "PUT", + "description": "Updates an existing advertiser.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Advertiser" + }, + "response": { + "$ref": "Advertiser" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "browsers": { + "methods": { + "list": { + "id": "dfareporting.browsers.list", + "path": "userprofiles/{profileId}/browsers", + "httpMethod": "GET", + "description": "Retrieves a list of browsers.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "BrowsersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "campaignCreativeAssociations": { + "methods": { + "insert": { + "id": "dfareporting.campaignCreativeAssociations.insert", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations", + "httpMethod": "POST", + "description": "Associates a creative with the specified campaign. This method creates a default ad with dimensions matching the creative in the campaign if such a default ad does not exist already.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Campaign ID in this association.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId" + ], + "request": { + "$ref": "CampaignCreativeAssociation" + }, + "response": { + "$ref": "CampaignCreativeAssociation" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.campaignCreativeAssociations.list", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations", + "httpMethod": "GET", + "description": "Retrieves the list of creative IDs associated with the specified campaign.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Campaign ID in this association.", + "required": true, + "format": "int64", + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "campaignId" + ], + "response": { + "$ref": "CampaignCreativeAssociationsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "campaigns": { + "methods": { + "get": { + "id": "dfareporting.campaigns.get", + "path": "userprofiles/{profileId}/campaigns/{id}", + "httpMethod": "GET", + "description": "Gets one campaign by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Campaign" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.campaigns.insert", + "path": "userprofiles/{profileId}/campaigns", + "httpMethod": "POST", + "description": "Inserts a new campaign.", + "parameters": { + "defaultLandingPageName": { + "type": "string", + "description": "Default landing page name for this new campaign. Must be less than 256 characters long.", + "required": true, + "location": "query" + }, + "defaultLandingPageUrl": { + "type": "string", + "description": "Default landing page URL for this new campaign.", + "required": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "defaultLandingPageName", + "defaultLandingPageUrl" + ], + "request": { + "$ref": "Campaign" + }, + "response": { + "$ref": "Campaign" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.campaigns.list", + "path": "userprofiles/{profileId}/campaigns", + "httpMethod": "GET", + "description": "Retrieves a list of campaigns, possibly filtered.", + "parameters": { + "advertiserGroupIds": { + "type": "string", + "description": "Select only campaigns whose advertisers belong to these advertiser groups.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "advertiserIds": { + "type": "string", + "description": "Select only campaigns that belong to these advertisers.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "archived": { + "type": "boolean", + "description": "Select only archived campaigns. Don't set this field to select both archived and non-archived campaigns.", + "location": "query" + }, + "atLeastOneOptimizationActivity": { + "type": "boolean", + "description": "Select only campaigns that have at least one optimization activity.", + "location": "query" + }, + "excludedIds": { + "type": "string", + "description": "Exclude campaigns with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only campaigns with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "overriddenEventTagId": { + "type": "string", + "description": "Select only campaigns that have overridden this event tag ID.", + "format": "int64", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for campaigns by name or ID. Wildcards (*) are allowed. For example, \"campaign*2015\" will return campaigns with names like \"campaign June 2015\", \"campaign April 2015\", or simply \"campaign 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"campaign\" will match campaigns with name \"my campaign\", \"campaign 2015\", or simply \"campaign\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "subaccountId": { + "type": "string", + "description": "Select only campaigns that belong to this subaccount.", + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "CampaignsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.campaigns.patch", + "path": "userprofiles/{profileId}/campaigns", + "httpMethod": "PATCH", + "description": "Updates an existing campaign. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Campaign ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Campaign" + }, + "response": { + "$ref": "Campaign" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.campaigns.update", + "path": "userprofiles/{profileId}/campaigns", + "httpMethod": "PUT", + "description": "Updates an existing campaign.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Campaign" + }, + "response": { + "$ref": "Campaign" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "changeLogs": { + "methods": { + "get": { + "id": "dfareporting.changeLogs.get", + "path": "userprofiles/{profileId}/changeLogs/{id}", + "httpMethod": "GET", + "description": "Gets one change log by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Change log ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "ChangeLog" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.changeLogs.list", + "path": "userprofiles/{profileId}/changeLogs", + "httpMethod": "GET", + "description": "Retrieves a list of change logs.", + "parameters": { + "action": { + "type": "string", + "description": "Select only change logs with the specified action.", + "enum": [ + "ACTION_ADD", + "ACTION_ASSIGN", + "ACTION_ASSOCIATE", + "ACTION_CREATE", + "ACTION_DELETE", + "ACTION_DISABLE", + "ACTION_EMAIL_TAGS", + "ACTION_ENABLE", + "ACTION_LINK", + "ACTION_MARK_AS_DEFAULT", + "ACTION_PUSH", + "ACTION_REMOVE", + "ACTION_SEND", + "ACTION_SHARE", + "ACTION_UNASSIGN", + "ACTION_UNLINK", + "ACTION_UPDATE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only change logs with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxChangeTime": { + "type": "string", + "description": "Select only change logs whose change time is before the specified maxChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is \"2015-07-18T22:54:00-04:00\". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "minChangeTime": { + "type": "string", + "description": "Select only change logs whose change time is before the specified minChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is \"2015-07-18T22:54:00-04:00\". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset.", + "location": "query" + }, + "objectIds": { + "type": "string", + "description": "Select only change logs with these object IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "objectType": { + "type": "string", + "description": "Select only change logs with the specified object type.", + "enum": [ + "OBJECT_ACCOUNT", + "OBJECT_ACCOUNT_BILLING_FEATURE", + "OBJECT_AD", + "OBJECT_ADVERTISER", + "OBJECT_ADVERTISER_GROUP", + "OBJECT_BILLING_ACCOUNT_GROUP", + "OBJECT_BILLING_FEATURE", + "OBJECT_BILLING_MINIMUM_FEE", + "OBJECT_BILLING_PROFILE", + "OBJECT_CAMPAIGN", + "OBJECT_CONTENT_CATEGORY", + "OBJECT_CREATIVE", + "OBJECT_CREATIVE_ASSET", + "OBJECT_CREATIVE_BUNDLE", + "OBJECT_CREATIVE_FIELD", + "OBJECT_CREATIVE_GROUP", + "OBJECT_DFA_SITE", + "OBJECT_EVENT_TAG", + "OBJECT_FLOODLIGHT_ACTIVITY_GROUP", + "OBJECT_FLOODLIGHT_ACTVITY", + "OBJECT_FLOODLIGHT_CONFIGURATION", + "OBJECT_INSTREAM_CREATIVE", + "OBJECT_LANDING_PAGE", + "OBJECT_MEDIA_ORDER", + "OBJECT_PLACEMENT", + "OBJECT_PLACEMENT_STRATEGY", + "OBJECT_PROVIDED_LIST_CLIENT", + "OBJECT_RATE_CARD", + "OBJECT_REMARKETING_LIST", + "OBJECT_RICHMEDIA_CREATIVE", + "OBJECT_SD_SITE", + "OBJECT_SIZE", + "OBJECT_SUBACCOUNT", + "OBJECT_USER_PROFILE", + "OBJECT_USER_PROFILE_FILTER", + "OBJECT_USER_ROLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Select only change logs whose object ID, user name, old or new values match the search string.", + "location": "query" + }, + "userProfileIds": { + "type": "string", + "description": "Select only change logs with these user profile IDs.", + "format": "int64", + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "ChangeLogsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "cities": { + "methods": { + "list": { + "id": "dfareporting.cities.list", + "path": "userprofiles/{profileId}/cities", + "httpMethod": "GET", + "description": "Retrieves a list of cities, possibly filtered.", + "parameters": { + "countryDartIds": { + "type": "string", + "description": "Select only cities from these countries.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "dartIds": { + "type": "string", + "description": "Select only cities with these DART IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "namePrefix": { + "type": "string", + "description": "Select only cities with names starting with this prefix.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "regionDartIds": { + "type": "string", + "description": "Select only cities from these regions.", + "format": "int64", + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "CitiesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "connectionTypes": { + "methods": { + "get": { + "id": "dfareporting.connectionTypes.get", + "path": "userprofiles/{profileId}/connectionTypes/{id}", + "httpMethod": "GET", + "description": "Gets one connection type by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Connection type ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "ConnectionType" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.connectionTypes.list", + "path": "userprofiles/{profileId}/connectionTypes", + "httpMethod": "GET", + "description": "Retrieves a list of connection types.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "ConnectionTypesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "contentCategories": { + "methods": { + "delete": { + "id": "dfareporting.contentCategories.delete", + "path": "userprofiles/{profileId}/contentCategories/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing content category.", + "parameters": { + "id": { + "type": "string", + "description": "Content category ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.contentCategories.get", + "path": "userprofiles/{profileId}/contentCategories/{id}", + "httpMethod": "GET", + "description": "Gets one content category by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Content category ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "ContentCategory" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.contentCategories.insert", + "path": "userprofiles/{profileId}/contentCategories", + "httpMethod": "POST", + "description": "Inserts a new content category.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "ContentCategory" + }, + "response": { + "$ref": "ContentCategory" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.contentCategories.list", + "path": "userprofiles/{profileId}/contentCategories", + "httpMethod": "GET", + "description": "Retrieves a list of content categories, possibly filtered.", + "parameters": { + "ids": { + "type": "string", + "description": "Select only content categories with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"contentcategory*2015\" will return objects with names like \"contentcategory June 2015\", \"contentcategory April 2015\", or simply \"contentcategory 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"contentcategory\" will match objects with name \"my contentcategory\", \"contentcategory 2015\", or simply \"contentcategory\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "ContentCategoriesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.contentCategories.patch", + "path": "userprofiles/{profileId}/contentCategories", + "httpMethod": "PATCH", + "description": "Updates an existing content category. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Content category ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "ContentCategory" + }, + "response": { + "$ref": "ContentCategory" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.contentCategories.update", + "path": "userprofiles/{profileId}/contentCategories", + "httpMethod": "PUT", + "description": "Updates an existing content category.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "ContentCategory" + }, + "response": { + "$ref": "ContentCategory" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "countries": { + "methods": { + "get": { + "id": "dfareporting.countries.get", + "path": "userprofiles/{profileId}/countries/{dartId}", + "httpMethod": "GET", + "description": "Gets one country by ID.", + "parameters": { + "dartId": { + "type": "string", + "description": "Country DART ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "dartId" + ], + "response": { + "$ref": "Country" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.countries.list", + "path": "userprofiles/{profileId}/countries", + "httpMethod": "GET", + "description": "Retrieves a list of countries.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "CountriesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "creativeAssets": { + "methods": { + "insert": { + "id": "dfareporting.creativeAssets.insert", + "path": "userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets", + "httpMethod": "POST", + "description": "Inserts a new creative asset.", + "parameters": { + "advertiserId": { + "type": "string", + "description": "Advertiser ID of this creative. This is a required field.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "advertiserId" + ], + "request": { + "$ref": "CreativeAssetMetadata" + }, + "response": { + "$ref": "CreativeAssetMetadata" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "*/*" + ], + "maxSize": "100MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/dfareporting/v2.2/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/dfareporting/v2.2/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets" + } + } + } + } + } + }, + "creativeFieldValues": { + "methods": { + "delete": { + "id": "dfareporting.creativeFieldValues.delete", + "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing creative field value.", + "parameters": { + "creativeFieldId": { + "type": "string", + "description": "Creative field ID for this creative field value.", + "required": true, + "format": "int64", + "location": "path" + }, + "id": { + "type": "string", + "description": "Creative Field Value ID", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "creativeFieldId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.creativeFieldValues.get", + "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}", + "httpMethod": "GET", + "description": "Gets one creative field value by ID.", + "parameters": { + "creativeFieldId": { + "type": "string", + "description": "Creative field ID for this creative field value.", + "required": true, + "format": "int64", + "location": "path" + }, + "id": { + "type": "string", + "description": "Creative Field Value ID", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "creativeFieldId", + "id" + ], + "response": { + "$ref": "CreativeFieldValue" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.creativeFieldValues.insert", + "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + "httpMethod": "POST", + "description": "Inserts a new creative field value.", + "parameters": { + "creativeFieldId": { + "type": "string", + "description": "Creative field ID for this creative field value.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "creativeFieldId" + ], + "request": { + "$ref": "CreativeFieldValue" + }, + "response": { + "$ref": "CreativeFieldValue" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.creativeFieldValues.list", + "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + "httpMethod": "GET", + "description": "Retrieves a list of creative field values, possibly filtered.", + "parameters": { + "creativeFieldId": { + "type": "string", + "description": "Creative field ID for this creative field value.", + "required": true, + "format": "int64", + "location": "path" + }, + "ids": { + "type": "string", + "description": "Select only creative field values with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for creative field values by their values. Wildcards (e.g. *) are not allowed.", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "VALUE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "creativeFieldId" + ], + "response": { + "$ref": "CreativeFieldValuesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.creativeFieldValues.patch", + "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + "httpMethod": "PATCH", + "description": "Updates an existing creative field value. This method supports patch semantics.", + "parameters": { + "creativeFieldId": { + "type": "string", + "description": "Creative field ID for this creative field value.", + "required": true, + "format": "int64", + "location": "path" + }, + "id": { + "type": "string", + "description": "Creative Field Value ID", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "creativeFieldId", + "id" + ], + "request": { + "$ref": "CreativeFieldValue" + }, + "response": { + "$ref": "CreativeFieldValue" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.creativeFieldValues.update", + "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + "httpMethod": "PUT", + "description": "Updates an existing creative field value.", + "parameters": { + "creativeFieldId": { + "type": "string", + "description": "Creative field ID for this creative field value.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "creativeFieldId" + ], + "request": { + "$ref": "CreativeFieldValue" + }, + "response": { + "$ref": "CreativeFieldValue" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "creativeFields": { + "methods": { + "delete": { + "id": "dfareporting.creativeFields.delete", + "path": "userprofiles/{profileId}/creativeFields/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing creative field.", + "parameters": { + "id": { + "type": "string", + "description": "Creative Field ID", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.creativeFields.get", + "path": "userprofiles/{profileId}/creativeFields/{id}", + "httpMethod": "GET", + "description": "Gets one creative field by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Creative Field ID", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "CreativeField" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.creativeFields.insert", + "path": "userprofiles/{profileId}/creativeFields", + "httpMethod": "POST", + "description": "Inserts a new creative field.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "CreativeField" + }, + "response": { + "$ref": "CreativeField" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.creativeFields.list", + "path": "userprofiles/{profileId}/creativeFields", + "httpMethod": "GET", + "description": "Retrieves a list of creative fields, possibly filtered.", + "parameters": { + "advertiserIds": { + "type": "string", + "description": "Select only creative fields that belong to these advertisers.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only creative fields with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for creative fields by name or ID. Wildcards (*) are allowed. For example, \"creativefield*2015\" will return creative fields with names like \"creativefield June 2015\", \"creativefield April 2015\", or simply \"creativefield 2015\". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of \"creativefield\" will match creative fields with the name \"my creativefield\", \"creativefield 2015\", or simply \"creativefield\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "CreativeFieldsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.creativeFields.patch", + "path": "userprofiles/{profileId}/creativeFields", + "httpMethod": "PATCH", + "description": "Updates an existing creative field. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Creative Field ID", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "CreativeField" + }, + "response": { + "$ref": "CreativeField" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.creativeFields.update", + "path": "userprofiles/{profileId}/creativeFields", + "httpMethod": "PUT", + "description": "Updates an existing creative field.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "CreativeField" + }, + "response": { + "$ref": "CreativeField" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "creativeGroups": { + "methods": { + "get": { + "id": "dfareporting.creativeGroups.get", + "path": "userprofiles/{profileId}/creativeGroups/{id}", + "httpMethod": "GET", + "description": "Gets one creative group by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Creative group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "CreativeGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.creativeGroups.insert", + "path": "userprofiles/{profileId}/creativeGroups", + "httpMethod": "POST", + "description": "Inserts a new creative group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "CreativeGroup" + }, + "response": { + "$ref": "CreativeGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.creativeGroups.list", + "path": "userprofiles/{profileId}/creativeGroups", + "httpMethod": "GET", + "description": "Retrieves a list of creative groups, possibly filtered.", + "parameters": { + "advertiserIds": { + "type": "string", + "description": "Select only creative groups that belong to these advertisers.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "groupNumber": { + "type": "integer", + "description": "Select only creative groups that belong to this subgroup.", + "format": "int32", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only creative groups with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for creative groups by name or ID. Wildcards (*) are allowed. For example, \"creativegroup*2015\" will return creative groups with names like \"creativegroup June 2015\", \"creativegroup April 2015\", or simply \"creativegroup 2015\". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of \"creativegroup\" will match creative groups with the name \"my creativegroup\", \"creativegroup 2015\", or simply \"creativegroup\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "CreativeGroupsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.creativeGroups.patch", + "path": "userprofiles/{profileId}/creativeGroups", + "httpMethod": "PATCH", + "description": "Updates an existing creative group. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Creative group ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "CreativeGroup" + }, + "response": { + "$ref": "CreativeGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.creativeGroups.update", + "path": "userprofiles/{profileId}/creativeGroups", + "httpMethod": "PUT", + "description": "Updates an existing creative group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "CreativeGroup" + }, + "response": { + "$ref": "CreativeGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "creatives": { + "methods": { + "get": { + "id": "dfareporting.creatives.get", + "path": "userprofiles/{profileId}/creatives/{id}", + "httpMethod": "GET", + "description": "Gets one creative by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Creative ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Creative" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.creatives.insert", + "path": "userprofiles/{profileId}/creatives", + "httpMethod": "POST", + "description": "Inserts a new creative.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Creative" + }, + "response": { + "$ref": "Creative" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.creatives.list", + "path": "userprofiles/{profileId}/creatives", + "httpMethod": "GET", + "description": "Retrieves a list of creatives, possibly filtered.", + "parameters": { + "active": { + "type": "boolean", + "description": "Select only active creatives. Leave blank to select active and inactive creatives.", + "location": "query" + }, + "advertiserId": { + "type": "string", + "description": "Select only creatives with this advertiser ID.", + "format": "int64", + "location": "query" + }, + "archived": { + "type": "boolean", + "description": "Select only archived creatives. Leave blank to select archived and unarchived creatives.", + "location": "query" + }, + "campaignId": { + "type": "string", + "description": "Select only creatives with this campaign ID.", + "format": "int64", + "location": "query" + }, + "companionCreativeIds": { + "type": "string", + "description": "Select only in-stream video creatives with these companion IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "creativeFieldIds": { + "type": "string", + "description": "Select only creatives with these creative field IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only creatives with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "renderingIds": { + "type": "string", + "description": "Select only creatives with these rendering IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"creative*2015\" will return objects with names like \"creative June 2015\", \"creative April 2015\", or simply \"creative 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"creative\" will match objects with name \"my creative\", \"creative 2015\", or simply \"creative\".", + "location": "query" + }, + "sizeIds": { + "type": "string", + "description": "Select only creatives with these size IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "studioCreativeId": { + "type": "string", + "description": "Select only creatives corresponding to this Studio creative ID.", + "format": "int64", + "location": "query" + }, + "types": { + "type": "string", + "description": "Select only creatives with these creative types.", + "enum": [ + "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO", + "CUSTOM_INPAGE", + "CUSTOM_INTERSTITIAL", + "ENHANCED_BANNER", + "ENHANCED_IMAGE", + "FLASH_INPAGE", + "HTML5_BANNER", + "IMAGE", + "INSTREAM_VIDEO", + "INTERNAL_REDIRECT", + "INTERSTITIAL_INTERNAL_REDIRECT", + "REDIRECT", + "RICH_MEDIA_EXPANDING", + "RICH_MEDIA_IM_EXPAND", + "RICH_MEDIA_INPAGE", + "RICH_MEDIA_INPAGE_FLOATING", + "RICH_MEDIA_INTERSTITIAL_FLOAT", + "RICH_MEDIA_MOBILE_IN_APP", + "RICH_MEDIA_MULTI_FLOATING", + "RICH_MEDIA_PEEL_DOWN", + "TRACKING_TEXT", + "VAST_REDIRECT", + "VPAID_LINEAR", + "VPAID_NON_LINEAR" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "CreativesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.creatives.patch", + "path": "userprofiles/{profileId}/creatives", + "httpMethod": "PATCH", + "description": "Updates an existing creative. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Creative ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Creative" + }, + "response": { + "$ref": "Creative" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.creatives.update", + "path": "userprofiles/{profileId}/creatives", + "httpMethod": "PUT", + "description": "Updates an existing creative.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Creative" + }, + "response": { + "$ref": "Creative" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "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" + ] + } + } + }, + "directorySiteContacts": { + "methods": { + "get": { + "id": "dfareporting.directorySiteContacts.get", + "path": "userprofiles/{profileId}/directorySiteContacts/{id}", + "httpMethod": "GET", + "description": "Gets one directory site contact by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Directory site contact ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "DirectorySiteContact" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.directorySiteContacts.list", + "path": "userprofiles/{profileId}/directorySiteContacts", + "httpMethod": "GET", + "description": "Retrieves a list of directory site contacts, possibly filtered.", + "parameters": { + "directorySiteIds": { + "type": "string", + "description": "Select only directory site contacts with these directory site IDs. This is a required field.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only directory site contacts with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, \"directory site contact*2015\" will return objects with names like \"directory site contact June 2015\", \"directory site contact April 2015\", or simply \"directory site contact 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"directory site contact\" will match objects with name \"my directory site contact\", \"directory site contact 2015\", or simply \"directory site contact\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "DirectorySiteContactsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "directorySites": { + "methods": { + "get": { + "id": "dfareporting.directorySites.get", + "path": "userprofiles/{profileId}/directorySites/{id}", + "httpMethod": "GET", + "description": "Gets one directory site by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Directory site ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "DirectorySite" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.directorySites.insert", + "path": "userprofiles/{profileId}/directorySites", + "httpMethod": "POST", + "description": "Inserts a new directory site.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "DirectorySite" + }, + "response": { + "$ref": "DirectorySite" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.directorySites.list", + "path": "userprofiles/{profileId}/directorySites", + "httpMethod": "GET", + "description": "Retrieves a list of directory sites, possibly filtered.", + "parameters": { + "acceptsInStreamVideoPlacements": { + "type": "boolean", + "description": "This search filter is no longer supported and will have no effect on the results returned.", + "location": "query" + }, + "acceptsInterstitialPlacements": { + "type": "boolean", + "description": "This search filter is no longer supported and will have no effect on the results returned.", + "location": "query" + }, + "acceptsPublisherPaidPlacements": { + "type": "boolean", + "description": "Select only directory sites that accept publisher paid placements. This field can be left blank.", + "location": "query" + }, + "active": { + "type": "boolean", + "description": "Select only active directory sites. Leave blank to retrieve both active and inactive directory sites.", + "location": "query" + }, + "countryId": { + "type": "string", + "description": "Select only directory sites with this country ID.", + "format": "int64", + "location": "query" + }, + "dfp_network_code": { + "type": "string", + "description": "Select only directory sites with this DFP network code.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only directory sites with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "parentId": { + "type": "string", + "description": "Select only directory sites with this parent ID.", + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name, ID or URL. Wildcards (*) are allowed. For example, \"directory site*2015\" will return objects with names like \"directory site June 2015\", \"directory site April 2015\", or simply \"directory site 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"directory site\" will match objects with name \"my directory site\", \"directory site 2015\" or simply, \"directory site\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "DirectorySitesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "eventTags": { + "methods": { + "delete": { + "id": "dfareporting.eventTags.delete", + "path": "userprofiles/{profileId}/eventTags/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing event tag.", + "parameters": { + "id": { + "type": "string", + "description": "Event tag ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.eventTags.get", + "path": "userprofiles/{profileId}/eventTags/{id}", + "httpMethod": "GET", + "description": "Gets one event tag by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Event tag ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "EventTag" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.eventTags.insert", + "path": "userprofiles/{profileId}/eventTags", + "httpMethod": "POST", + "description": "Inserts a new event tag.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "EventTag" + }, + "response": { + "$ref": "EventTag" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.eventTags.list", + "path": "userprofiles/{profileId}/eventTags", + "httpMethod": "GET", + "description": "Retrieves a list of event tags, possibly filtered.", + "parameters": { + "adId": { + "type": "string", + "description": "Select only event tags that belong to this ad.", + "format": "int64", + "location": "query" + }, + "advertiserId": { + "type": "string", + "description": "Select only event tags that belong to this advertiser.", + "format": "int64", + "location": "query" + }, + "campaignId": { + "type": "string", + "description": "Select only event tags that belong to this campaign.", + "format": "int64", + "location": "query" + }, + "definitionsOnly": { + "type": "boolean", + "description": "Examine only the specified campaign or advertiser's event tags for matching selector criteria. When set to false, the parent advertiser and parent campaign of the specified ad or campaign is examined as well. In addition, when set to false, the status field is examined as well, along with the enabledByDefault field. This parameter can not be set to true when adId is specified as ads do not define their own even tags.", + "location": "query" + }, + "enabled": { + "type": "boolean", + "description": "Select only enabled event tags. What is considered enabled or disabled depends on the definitionsOnly parameter. When definitionsOnly is set to true, only the specified advertiser or campaign's event tags' enabledByDefault field is examined. When definitionsOnly is set to false, the specified ad or specified campaign's parent advertiser's or parent campaign's event tags' enabledByDefault and status fields are examined as well.", + "location": "query" + }, + "eventTagTypes": { + "type": "string", + "description": "Select only event tags with the specified event tag types. Event tag types can be used to specify whether to use a third-party pixel, a third-party JavaScript URL, or a third-party click-through URL for either impression or click tracking.", + "enum": [ + "CLICK_THROUGH_EVENT_TAG", + "IMPRESSION_IMAGE_EVENT_TAG", + "IMPRESSION_JAVASCRIPT_EVENT_TAG" + ], + "enumDescriptions": [ + "", + "", + "" + ], + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only event tags with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"eventtag*2015\" will return objects with names like \"eventtag June 2015\", \"eventtag April 2015\", or simply \"eventtag 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"eventtag\" will match objects with name \"my eventtag\", \"eventtag 2015\", or simply \"eventtag\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "EventTagsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.eventTags.patch", + "path": "userprofiles/{profileId}/eventTags", + "httpMethod": "PATCH", + "description": "Updates an existing event tag. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Event tag ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "EventTag" + }, + "response": { + "$ref": "EventTag" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.eventTags.update", + "path": "userprofiles/{profileId}/eventTags", + "httpMethod": "PUT", + "description": "Updates an existing event tag.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "EventTag" + }, + "response": { + "$ref": "EventTag" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "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" + ] + } + } + }, + "floodlightActivities": { + "methods": { + "delete": { + "id": "dfareporting.floodlightActivities.delete", + "path": "userprofiles/{profileId}/floodlightActivities/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing floodlight activity.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight activity ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "generatetag": { + "id": "dfareporting.floodlightActivities.generatetag", + "path": "userprofiles/{profileId}/floodlightActivities/generatetag", + "httpMethod": "POST", + "description": "Generates a tag for a floodlight activity.", + "parameters": { + "floodlightActivityId": { + "type": "string", + "description": "Floodlight activity ID for which we want to generate a tag.", + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "FloodlightActivitiesGenerateTagResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.floodlightActivities.get", + "path": "userprofiles/{profileId}/floodlightActivities/{id}", + "httpMethod": "GET", + "description": "Gets one floodlight activity by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight activity ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "FloodlightActivity" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.floodlightActivities.insert", + "path": "userprofiles/{profileId}/floodlightActivities", + "httpMethod": "POST", + "description": "Inserts a new floodlight activity.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "FloodlightActivity" + }, + "response": { + "$ref": "FloodlightActivity" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.floodlightActivities.list", + "path": "userprofiles/{profileId}/floodlightActivities", + "httpMethod": "GET", + "description": "Retrieves a list of floodlight activities, possibly filtered.", + "parameters": { + "advertiserId": { + "type": "string", + "description": "Select only floodlight activities for the specified advertiser ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.", + "format": "int64", + "location": "query" + }, + "floodlightActivityGroupIds": { + "type": "string", + "description": "Select only floodlight activities with the specified floodlight activity group IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "floodlightActivityGroupName": { + "type": "string", + "description": "Select only floodlight activities with the specified floodlight activity group name.", + "location": "query" + }, + "floodlightActivityGroupTagString": { + "type": "string", + "description": "Select only floodlight activities with the specified floodlight activity group tag string.", + "location": "query" + }, + "floodlightActivityGroupType": { + "type": "string", + "description": "Select only floodlight activities with the specified floodlight activity group type.", + "enum": [ + "COUNTER", + "SALE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "floodlightConfigurationId": { + "type": "string", + "description": "Select only floodlight activities for the specified floodlight configuration ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.", + "format": "int64", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only floodlight activities with the specified IDs. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"floodlightactivity*2015\" will return objects with names like \"floodlightactivity June 2015\", \"floodlightactivity April 2015\", or simply \"floodlightactivity 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"floodlightactivity\" will match objects with name \"my floodlightactivity activity\", \"floodlightactivity 2015\", or simply \"floodlightactivity\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "tagString": { + "type": "string", + "description": "Select only floodlight activities with the specified tag string.", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "FloodlightActivitiesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.floodlightActivities.patch", + "path": "userprofiles/{profileId}/floodlightActivities", + "httpMethod": "PATCH", + "description": "Updates an existing floodlight activity. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight activity ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "FloodlightActivity" + }, + "response": { + "$ref": "FloodlightActivity" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.floodlightActivities.update", + "path": "userprofiles/{profileId}/floodlightActivities", + "httpMethod": "PUT", + "description": "Updates an existing floodlight activity.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "FloodlightActivity" + }, + "response": { + "$ref": "FloodlightActivity" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "floodlightActivityGroups": { + "methods": { + "delete": { + "id": "dfareporting.floodlightActivityGroups.delete", + "path": "userprofiles/{profileId}/floodlightActivityGroups/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing floodlight activity group.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight activity Group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.floodlightActivityGroups.get", + "path": "userprofiles/{profileId}/floodlightActivityGroups/{id}", + "httpMethod": "GET", + "description": "Gets one floodlight activity group by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight activity Group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "FloodlightActivityGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.floodlightActivityGroups.insert", + "path": "userprofiles/{profileId}/floodlightActivityGroups", + "httpMethod": "POST", + "description": "Inserts a new floodlight activity group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "FloodlightActivityGroup" + }, + "response": { + "$ref": "FloodlightActivityGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.floodlightActivityGroups.list", + "path": "userprofiles/{profileId}/floodlightActivityGroups", + "httpMethod": "GET", + "description": "Retrieves a list of floodlight activity groups, possibly filtered.", + "parameters": { + "advertiserId": { + "type": "string", + "description": "Select only floodlight activity groups with the specified advertiser ID. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.", + "format": "int64", + "location": "query" + }, + "floodlightConfigurationId": { + "type": "string", + "description": "Select only floodlight activity groups with the specified floodlight configuration ID. Must specify either advertiserId, or floodlightConfigurationId for a non-empty result.", + "format": "int64", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only floodlight activity groups with the specified IDs. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"floodlightactivitygroup*2015\" will return objects with names like \"floodlightactivitygroup June 2015\", \"floodlightactivitygroup April 2015\", or simply \"floodlightactivitygroup 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"floodlightactivitygroup\" will match objects with name \"my floodlightactivitygroup activity\", \"floodlightactivitygroup 2015\", or simply \"floodlightactivitygroup\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "type": { + "type": "string", + "description": "Select only floodlight activity groups with the specified floodlight activity group type.", + "enum": [ + "COUNTER", + "SALE" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "FloodlightActivityGroupsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.floodlightActivityGroups.patch", + "path": "userprofiles/{profileId}/floodlightActivityGroups", + "httpMethod": "PATCH", + "description": "Updates an existing floodlight activity group. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight activity Group ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "FloodlightActivityGroup" + }, + "response": { + "$ref": "FloodlightActivityGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.floodlightActivityGroups.update", + "path": "userprofiles/{profileId}/floodlightActivityGroups", + "httpMethod": "PUT", + "description": "Updates an existing floodlight activity group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "FloodlightActivityGroup" + }, + "response": { + "$ref": "FloodlightActivityGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "floodlightConfigurations": { + "methods": { + "get": { + "id": "dfareporting.floodlightConfigurations.get", + "path": "userprofiles/{profileId}/floodlightConfigurations/{id}", + "httpMethod": "GET", + "description": "Gets one floodlight configuration by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight configuration ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "FloodlightConfiguration" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.floodlightConfigurations.list", + "path": "userprofiles/{profileId}/floodlightConfigurations", + "httpMethod": "GET", + "description": "Retrieves a list of floodlight configurations, possibly filtered.", + "parameters": { + "ids": { + "type": "string", + "description": "Set of IDs of floodlight configurations to retrieve. Required field; otherwise an empty list will be returned.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "FloodlightConfigurationsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.floodlightConfigurations.patch", + "path": "userprofiles/{profileId}/floodlightConfigurations", + "httpMethod": "PATCH", + "description": "Updates an existing floodlight configuration. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Floodlight configuration ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "FloodlightConfiguration" + }, + "response": { + "$ref": "FloodlightConfiguration" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.floodlightConfigurations.update", + "path": "userprofiles/{profileId}/floodlightConfigurations", + "httpMethod": "PUT", + "description": "Updates an existing floodlight configuration.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "FloodlightConfiguration" + }, + "response": { + "$ref": "FloodlightConfiguration" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "inventoryItems": { + "methods": { + "get": { + "id": "dfareporting.inventoryItems.get", + "path": "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}", + "httpMethod": "GET", + "description": "Gets one inventory item by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Inventory item ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID for order documents.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "projectId", + "id" + ], + "response": { + "$ref": "InventoryItem" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.inventoryItems.list", + "path": "userprofiles/{profileId}/projects/{projectId}/inventoryItems", + "httpMethod": "GET", + "description": "Retrieves a list of inventory items, possibly filtered.", + "parameters": { + "ids": { + "type": "string", + "description": "Select only inventory items with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "inPlan": { + "type": "boolean", + "description": "Select only inventory items that are in plan.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "orderId": { + "type": "string", + "description": "Select only inventory items that belong to specified orders.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID for order documents.", + "required": true, + "format": "int64", + "location": "path" + }, + "siteId": { + "type": "string", + "description": "Select only inventory items that are associated with these sites.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "projectId" + ], + "response": { + "$ref": "InventoryItemsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "landingPages": { + "methods": { + "delete": { + "id": "dfareporting.landingPages.delete", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing campaign landing page.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Landing page campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "id": { + "type": "string", + "description": "Landing page ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.landingPages.get", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}", + "httpMethod": "GET", + "description": "Gets one campaign landing page by ID.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Landing page campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "id": { + "type": "string", + "description": "Landing page ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId", + "id" + ], + "response": { + "$ref": "LandingPage" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.landingPages.insert", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + "httpMethod": "POST", + "description": "Inserts a new landing page for the specified campaign.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Landing page campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId" + ], + "request": { + "$ref": "LandingPage" + }, + "response": { + "$ref": "LandingPage" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.landingPages.list", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + "httpMethod": "GET", + "description": "Retrieves the list of landing pages for the specified campaign.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Landing page campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId" + ], + "response": { + "$ref": "LandingPagesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.landingPages.patch", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + "httpMethod": "PATCH", + "description": "Updates an existing campaign landing page. This method supports patch semantics.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Landing page campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "id": { + "type": "string", + "description": "Landing page ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId", + "id" + ], + "request": { + "$ref": "LandingPage" + }, + "response": { + "$ref": "LandingPage" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.landingPages.update", + "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + "httpMethod": "PUT", + "description": "Updates an existing campaign landing page.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Landing page campaign ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "campaignId" + ], + "request": { + "$ref": "LandingPage" + }, + "response": { + "$ref": "LandingPage" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "metros": { + "methods": { + "list": { + "id": "dfareporting.metros.list", + "path": "userprofiles/{profileId}/metros", + "httpMethod": "GET", + "description": "Retrieves a list of metros.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "MetrosListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "mobileCarriers": { + "methods": { + "get": { + "id": "dfareporting.mobileCarriers.get", + "path": "userprofiles/{profileId}/mobileCarriers/{id}", + "httpMethod": "GET", + "description": "Gets one mobile carrier by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Mobile carrier ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "MobileCarrier" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.mobileCarriers.list", + "path": "userprofiles/{profileId}/mobileCarriers", + "httpMethod": "GET", + "description": "Retrieves a list of mobile carriers.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "MobileCarriersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "operatingSystemVersions": { + "methods": { + "get": { + "id": "dfareporting.operatingSystemVersions.get", + "path": "userprofiles/{profileId}/operatingSystemVersions/{id}", + "httpMethod": "GET", + "description": "Gets one operating system version by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Operating system version ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "OperatingSystemVersion" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.operatingSystemVersions.list", + "path": "userprofiles/{profileId}/operatingSystemVersions", + "httpMethod": "GET", + "description": "Retrieves a list of operating system versions.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "OperatingSystemVersionsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "operatingSystems": { + "methods": { + "get": { + "id": "dfareporting.operatingSystems.get", + "path": "userprofiles/{profileId}/operatingSystems/{dartId}", + "httpMethod": "GET", + "description": "Gets one operating system by DART ID.", + "parameters": { + "dartId": { + "type": "string", + "description": "Operating system DART ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "dartId" + ], + "response": { + "$ref": "OperatingSystem" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.operatingSystems.list", + "path": "userprofiles/{profileId}/operatingSystems", + "httpMethod": "GET", + "description": "Retrieves a list of operating systems.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "OperatingSystemsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "orderDocuments": { + "methods": { + "get": { + "id": "dfareporting.orderDocuments.get", + "path": "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}", + "httpMethod": "GET", + "description": "Gets one order document by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Order document ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID for order documents.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "projectId", + "id" + ], + "response": { + "$ref": "OrderDocument" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.orderDocuments.list", + "path": "userprofiles/{profileId}/projects/{projectId}/orderDocuments", + "httpMethod": "GET", + "description": "Retrieves a list of order documents, possibly filtered.", + "parameters": { + "approved": { + "type": "boolean", + "description": "Select only order documents that have been approved by at least one user.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only order documents with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "orderId": { + "type": "string", + "description": "Select only order documents for specified orders.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID for order documents.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for order documents by name or ID. Wildcards (*) are allowed. For example, \"orderdocument*2015\" will return order documents with names like \"orderdocument June 2015\", \"orderdocument April 2015\", or simply \"orderdocument 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"orderdocument\" will match order documents with name \"my orderdocument\", \"orderdocument 2015\", or simply \"orderdocument\".", + "location": "query" + }, + "siteId": { + "type": "string", + "description": "Select only order documents that are associated with these sites.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "projectId" + ], + "response": { + "$ref": "OrderDocumentsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "orders": { + "methods": { + "get": { + "id": "dfareporting.orders.get", + "path": "userprofiles/{profileId}/projects/{projectId}/orders/{id}", + "httpMethod": "GET", + "description": "Gets one order by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Order ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID for orders.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "projectId", + "id" + ], + "response": { + "$ref": "Order" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.orders.list", + "path": "userprofiles/{profileId}/projects/{projectId}/orders", + "httpMethod": "GET", + "description": "Retrieves a list of orders, possibly filtered.", + "parameters": { + "ids": { + "type": "string", + "description": "Select only orders with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "projectId": { + "type": "string", + "description": "Project ID for orders.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for orders by name or ID. Wildcards (*) are allowed. For example, \"order*2015\" will return orders with names like \"order June 2015\", \"order April 2015\", or simply \"order 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"order\" will match orders with name \"my order\", \"order 2015\", or simply \"order\".", + "location": "query" + }, + "siteId": { + "type": "string", + "description": "Select only orders that are associated with these site IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "projectId" + ], + "response": { + "$ref": "OrdersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "placementGroups": { + "methods": { + "get": { + "id": "dfareporting.placementGroups.get", + "path": "userprofiles/{profileId}/placementGroups/{id}", + "httpMethod": "GET", + "description": "Gets one placement group by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Placement group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "PlacementGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.placementGroups.insert", + "path": "userprofiles/{profileId}/placementGroups", + "httpMethod": "POST", + "description": "Inserts a new placement group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "PlacementGroup" + }, + "response": { + "$ref": "PlacementGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.placementGroups.list", + "path": "userprofiles/{profileId}/placementGroups", + "httpMethod": "GET", + "description": "Retrieves a list of placement groups, possibly filtered.", + "parameters": { + "advertiserIds": { + "type": "string", + "description": "Select only placement groups that belong to these advertisers.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "archived": { + "type": "boolean", + "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.", + "location": "query" + }, + "campaignIds": { + "type": "string", + "description": "Select only placement groups that belong to these campaigns.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "contentCategoryIds": { + "type": "string", + "description": "Select only placement groups that are associated with these content categories.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "directorySiteIds": { + "type": "string", + "description": "Select only placement groups that are associated with these directory sites.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only placement groups with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxEndDate": { + "type": "string", + "description": "Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as \"yyyy-MM-dd\".", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "maxStartDate": { + "type": "string", + "description": "Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as \"yyyy-MM-dd\".", + "location": "query" + }, + "minEndDate": { + "type": "string", + "description": "Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as \"yyyy-MM-dd\".", + "location": "query" + }, + "minStartDate": { + "type": "string", + "description": "Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as \"yyyy-MM-dd\".", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "placementGroupType": { + "type": "string", + "description": "Select only placement groups belonging with this group type. A package is a simple group of placements that acts as a single pricing point for a group of tags. A roadblock is a group of placements that not only acts as a single pricing point but also assumes that all the tags in it will be served at the same time. A roadblock requires one of its assigned placements to be marked as primary for reporting.", + "enum": [ + "PLACEMENT_PACKAGE", + "PLACEMENT_ROADBLOCK" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "placementStrategyIds": { + "type": "string", + "description": "Select only placement groups that are associated with these placement strategies.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "pricingTypes": { + "type": "string", + "description": "Select only placement groups with these pricing types.", + "enum": [ + "PRICING_TYPE_CPA", + "PRICING_TYPE_CPC", + "PRICING_TYPE_CPM", + "PRICING_TYPE_FLAT_RATE_CLICKS", + "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for placement groups by name or ID. Wildcards (*) are allowed. For example, \"placement*2015\" will return placement groups with names like \"placement group June 2015\", \"placement group May 2015\", or simply \"placements 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"placementgroup\" will match placement groups with name \"my placementgroup\", \"placementgroup 2015\", or simply \"placementgroup\".", + "location": "query" + }, + "siteIds": { + "type": "string", + "description": "Select only placement groups that are associated with these sites.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "PlacementGroupsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.placementGroups.patch", + "path": "userprofiles/{profileId}/placementGroups", + "httpMethod": "PATCH", + "description": "Updates an existing placement group. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Placement group ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "PlacementGroup" + }, + "response": { + "$ref": "PlacementGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.placementGroups.update", + "path": "userprofiles/{profileId}/placementGroups", + "httpMethod": "PUT", + "description": "Updates an existing placement group.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "PlacementGroup" + }, + "response": { + "$ref": "PlacementGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "placementStrategies": { + "methods": { + "delete": { + "id": "dfareporting.placementStrategies.delete", + "path": "userprofiles/{profileId}/placementStrategies/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing placement strategy.", + "parameters": { + "id": { + "type": "string", + "description": "Placement strategy ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.placementStrategies.get", + "path": "userprofiles/{profileId}/placementStrategies/{id}", + "httpMethod": "GET", + "description": "Gets one placement strategy by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Placement strategy ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "PlacementStrategy" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.placementStrategies.insert", + "path": "userprofiles/{profileId}/placementStrategies", + "httpMethod": "POST", + "description": "Inserts a new placement strategy.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "PlacementStrategy" + }, + "response": { + "$ref": "PlacementStrategy" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.placementStrategies.list", + "path": "userprofiles/{profileId}/placementStrategies", + "httpMethod": "GET", + "description": "Retrieves a list of placement strategies, possibly filtered.", + "parameters": { + "ids": { + "type": "string", + "description": "Select only placement strategies with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"placementstrategy*2015\" will return objects with names like \"placementstrategy June 2015\", \"placementstrategy April 2015\", or simply \"placementstrategy 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"placementstrategy\" will match objects with name \"my placementstrategy\", \"placementstrategy 2015\", or simply \"placementstrategy\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "PlacementStrategiesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.placementStrategies.patch", + "path": "userprofiles/{profileId}/placementStrategies", + "httpMethod": "PATCH", + "description": "Updates an existing placement strategy. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Placement strategy ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "PlacementStrategy" + }, + "response": { + "$ref": "PlacementStrategy" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.placementStrategies.update", + "path": "userprofiles/{profileId}/placementStrategies", + "httpMethod": "PUT", + "description": "Updates an existing placement strategy.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "PlacementStrategy" + }, + "response": { + "$ref": "PlacementStrategy" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "placements": { + "methods": { + "generatetags": { + "id": "dfareporting.placements.generatetags", + "path": "userprofiles/{profileId}/placements/generatetags", + "httpMethod": "POST", + "description": "Generates tags for a placement.", + "parameters": { + "campaignId": { + "type": "string", + "description": "Generate placements belonging to this campaign. This is a required field.", + "format": "int64", + "location": "query" + }, + "placementIds": { + "type": "string", + "description": "Generate tags for these placements.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "tagFormats": { + "type": "string", + "description": "Tag formats to generate for these placements.", + "enum": [ + "PLACEMENT_TAG_CLICK_COMMANDS", + "PLACEMENT_TAG_IFRAME_ILAYER", + "PLACEMENT_TAG_IFRAME_JAVASCRIPT", + "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH", + "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3", + "PLACEMENT_TAG_INTERNAL_REDIRECT", + "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT", + "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT", + "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT", + "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_JAVASCRIPT", + "PLACEMENT_TAG_JAVASCRIPT_LEGACY", + "PLACEMENT_TAG_STANDARD", + "PLACEMENT_TAG_TRACKING", + "PLACEMENT_TAG_TRACKING_IFRAME", + "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "PlacementsGenerateTagsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.placements.get", + "path": "userprofiles/{profileId}/placements/{id}", + "httpMethod": "GET", + "description": "Gets one placement by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Placement ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Placement" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.placements.insert", + "path": "userprofiles/{profileId}/placements", + "httpMethod": "POST", + "description": "Inserts a new placement.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Placement" + }, + "response": { + "$ref": "Placement" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.placements.list", + "path": "userprofiles/{profileId}/placements", + "httpMethod": "GET", + "description": "Retrieves a list of placements, possibly filtered.", + "parameters": { + "advertiserIds": { + "type": "string", + "description": "Select only placements that belong to these advertisers.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "archived": { + "type": "boolean", + "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.", + "location": "query" + }, + "campaignIds": { + "type": "string", + "description": "Select only placements that belong to these campaigns.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "compatibilities": { + "type": "string", + "description": "Select only placements that are associated with these compatibilities. WEB and WEB_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps.IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard.", + "enum": [ + "APP", + "APP_INTERSTITIAL", + "IN_STREAM_VIDEO", + "WEB", + "WEB_INTERSTITIAL" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + }, + "contentCategoryIds": { + "type": "string", + "description": "Select only placements that are associated with these content categories.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "directorySiteIds": { + "type": "string", + "description": "Select only placements that are associated with these directory sites.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "groupIds": { + "type": "string", + "description": "Select only placements that belong to these placement groups.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only placements with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxEndDate": { + "type": "string", + "description": "Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as \"yyyy-MM-dd\".", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "maxStartDate": { + "type": "string", + "description": "Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as \"yyyy-MM-dd\".", + "location": "query" + }, + "minEndDate": { + "type": "string", + "description": "Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as \"yyyy-MM-dd\".", + "location": "query" + }, + "minStartDate": { + "type": "string", + "description": "Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as \"yyyy-MM-dd\".", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "paymentSource": { + "type": "string", + "description": "Select only placements with this payment source.", + "enum": [ + "PLACEMENT_AGENCY_PAID", + "PLACEMENT_PUBLISHER_PAID" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "placementStrategyIds": { + "type": "string", + "description": "Select only placements that are associated with these placement strategies.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "pricingTypes": { + "type": "string", + "description": "Select only placements with these pricing types.", + "enum": [ + "PRICING_TYPE_CPA", + "PRICING_TYPE_CPC", + "PRICING_TYPE_CPM", + "PRICING_TYPE_FLAT_RATE_CLICKS", + "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ], + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for placements by name or ID. Wildcards (*) are allowed. For example, \"placement*2015\" will return placements with names like \"placement June 2015\", \"placement May 2015\", or simply \"placements 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"placement\" will match placements with name \"my placement\", \"placement 2015\", or simply \"placement\".", + "location": "query" + }, + "siteIds": { + "type": "string", + "description": "Select only placements that are associated with these sites.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sizeIds": { + "type": "string", + "description": "Select only placements that are associated with these sizes.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "PlacementsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.placements.patch", + "path": "userprofiles/{profileId}/placements", + "httpMethod": "PATCH", + "description": "Updates an existing placement. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Placement ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Placement" + }, + "response": { + "$ref": "Placement" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.placements.update", + "path": "userprofiles/{profileId}/placements", + "httpMethod": "PUT", + "description": "Updates an existing placement.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Placement" + }, + "response": { + "$ref": "Placement" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "platformTypes": { + "methods": { + "get": { + "id": "dfareporting.platformTypes.get", + "path": "userprofiles/{profileId}/platformTypes/{id}", + "httpMethod": "GET", + "description": "Gets one platform type by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Platform type ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "PlatformType" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.platformTypes.list", + "path": "userprofiles/{profileId}/platformTypes", + "httpMethod": "GET", + "description": "Retrieves a list of platform types.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "PlatformTypesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "postalCodes": { + "methods": { + "get": { + "id": "dfareporting.postalCodes.get", + "path": "userprofiles/{profileId}/postalCodes/{code}", + "httpMethod": "GET", + "description": "Gets one postal code by ID.", + "parameters": { + "code": { + "type": "string", + "description": "Postal code ID.", + "required": true, + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "code" + ], + "response": { + "$ref": "PostalCode" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.postalCodes.list", + "path": "userprofiles/{profileId}/postalCodes", + "httpMethod": "GET", + "description": "Retrieves a list of postal codes.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "PostalCodesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "projects": { + "methods": { + "get": { + "id": "dfareporting.projects.get", + "path": "userprofiles/{profileId}/projects/{id}", + "httpMethod": "GET", + "description": "Gets one project by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Project ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Project" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.projects.list", + "path": "userprofiles/{profileId}/projects", + "httpMethod": "GET", + "description": "Retrieves a list of projects, possibly filtered.", + "parameters": { + "advertiserIds": { + "type": "string", + "description": "Select only projects with these advertiser IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only projects with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for projects by name or ID. Wildcards (*) are allowed. For example, \"project*2015\" will return projects with names like \"project June 2015\", \"project April 2015\", or simply \"project 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"project\" will match projects with name \"my project\", \"project 2015\", or simply \"project\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "ProjectsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "regions": { + "methods": { + "list": { + "id": "dfareporting.regions.list", + "path": "userprofiles/{profileId}/regions", + "httpMethod": "GET", + "description": "Retrieves a list of regions.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "RegionsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "remarketingListShares": { + "methods": { + "get": { + "id": "dfareporting.remarketingListShares.get", + "path": "userprofiles/{profileId}/remarketingListShares/{remarketingListId}", + "httpMethod": "GET", + "description": "Gets one remarketing list share by remarketing list ID.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "remarketingListId": { + "type": "string", + "description": "Remarketing list ID.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "remarketingListId" + ], + "response": { + "$ref": "RemarketingListShare" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.remarketingListShares.patch", + "path": "userprofiles/{profileId}/remarketingListShares", + "httpMethod": "PATCH", + "description": "Updates an existing remarketing list share. This method supports patch semantics.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "remarketingListId": { + "type": "string", + "description": "Remarketing list ID.", + "required": true, + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "remarketingListId" + ], + "request": { + "$ref": "RemarketingListShare" + }, + "response": { + "$ref": "RemarketingListShare" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.remarketingListShares.update", + "path": "userprofiles/{profileId}/remarketingListShares", + "httpMethod": "PUT", + "description": "Updates an existing remarketing list share.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "RemarketingListShare" + }, + "response": { + "$ref": "RemarketingListShare" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "remarketingLists": { + "methods": { + "get": { + "id": "dfareporting.remarketingLists.get", + "path": "userprofiles/{profileId}/remarketingLists/{id}", + "httpMethod": "GET", + "description": "Gets one remarketing list by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Remarketing list ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "RemarketingList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.remarketingLists.insert", + "path": "userprofiles/{profileId}/remarketingLists", + "httpMethod": "POST", + "description": "Inserts a new remarketing list.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "RemarketingList" + }, + "response": { + "$ref": "RemarketingList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.remarketingLists.list", + "path": "userprofiles/{profileId}/remarketingLists", + "httpMethod": "GET", + "description": "Retrieves a list of remarketing lists, possibly filtered.", + "parameters": { + "active": { + "type": "boolean", + "description": "Select only active or only inactive remarketing lists.", + "location": "query" + }, + "advertiserId": { + "type": "string", + "description": "Select only remarketing lists owned by this advertiser.", + "required": true, + "format": "int64", + "location": "query" + }, + "floodlightActivityId": { + "type": "string", + "description": "Select only remarketing lists that have this floodlight activity ID.", + "format": "int64", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "name": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"remarketing list*2015\" will return objects with names like \"remarketing list June 2015\", \"remarketing list April 2015\", or simply \"remarketing list 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"remarketing list\" will match objects with name \"my remarketing list\", \"remarketing list 2015\", or simply \"remarketing list\".", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "advertiserId" + ], + "response": { + "$ref": "RemarketingListsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.remarketingLists.patch", + "path": "userprofiles/{profileId}/remarketingLists", + "httpMethod": "PATCH", + "description": "Updates an existing remarketing list. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Remarketing list ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "RemarketingList" + }, + "response": { + "$ref": "RemarketingList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.remarketingLists.update", + "path": "userprofiles/{profileId}/remarketingLists", + "httpMethod": "PUT", + "description": "Updates an existing remarketing list.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "RemarketingList" + }, + "response": { + "$ref": "RemarketingList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "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" + ] + } + } + } + } + }, + "sites": { + "methods": { + "get": { + "id": "dfareporting.sites.get", + "path": "userprofiles/{profileId}/sites/{id}", + "httpMethod": "GET", + "description": "Gets one site by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Site ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Site" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.sites.insert", + "path": "userprofiles/{profileId}/sites", + "httpMethod": "POST", + "description": "Inserts a new site.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Site" + }, + "response": { + "$ref": "Site" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.sites.list", + "path": "userprofiles/{profileId}/sites", + "httpMethod": "GET", + "description": "Retrieves a list of sites, possibly filtered.", + "parameters": { + "acceptsInStreamVideoPlacements": { + "type": "boolean", + "description": "This search filter is no longer supported and will have no effect on the results returned.", + "location": "query" + }, + "acceptsInterstitialPlacements": { + "type": "boolean", + "description": "This search filter is no longer supported and will have no effect on the results returned.", + "location": "query" + }, + "acceptsPublisherPaidPlacements": { + "type": "boolean", + "description": "Select only sites that accept publisher paid placements.", + "location": "query" + }, + "adWordsSite": { + "type": "boolean", + "description": "Select only AdWords sites.", + "location": "query" + }, + "approved": { + "type": "boolean", + "description": "Select only approved sites.", + "location": "query" + }, + "campaignIds": { + "type": "string", + "description": "Select only sites with these campaign IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "directorySiteIds": { + "type": "string", + "description": "Select only sites with these directory site IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only sites with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name, ID or keyName. Wildcards (*) are allowed. For example, \"site*2015\" will return objects with names like \"site June 2015\", \"site April 2015\", or simply \"site 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"site\" will match objects with name \"my site\", \"site 2015\", or simply \"site\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "subaccountId": { + "type": "string", + "description": "Select only sites with this subaccount ID.", + "format": "int64", + "location": "query" + }, + "unmappedSite": { + "type": "boolean", + "description": "Select only sites that have not been mapped to a directory site.", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "SitesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.sites.patch", + "path": "userprofiles/{profileId}/sites", + "httpMethod": "PATCH", + "description": "Updates an existing site. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Site ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Site" + }, + "response": { + "$ref": "Site" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.sites.update", + "path": "userprofiles/{profileId}/sites", + "httpMethod": "PUT", + "description": "Updates an existing site.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Site" + }, + "response": { + "$ref": "Site" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "sizes": { + "methods": { + "get": { + "id": "dfareporting.sizes.get", + "path": "userprofiles/{profileId}/sizes/{id}", + "httpMethod": "GET", + "description": "Gets one size by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Size ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Size" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.sizes.insert", + "path": "userprofiles/{profileId}/sizes", + "httpMethod": "POST", + "description": "Inserts a new size.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Size" + }, + "response": { + "$ref": "Size" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.sizes.list", + "path": "userprofiles/{profileId}/sizes", + "httpMethod": "GET", + "description": "Retrieves a list of sizes, possibly filtered.", + "parameters": { + "height": { + "type": "integer", + "description": "Select only sizes with this height.", + "format": "int32", + "location": "query" + }, + "iabStandard": { + "type": "boolean", + "description": "Select only IAB standard sizes.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only sizes with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "width": { + "type": "integer", + "description": "Select only sizes with this width.", + "format": "int32", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "SizesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "subaccounts": { + "methods": { + "get": { + "id": "dfareporting.subaccounts.get", + "path": "userprofiles/{profileId}/subaccounts/{id}", + "httpMethod": "GET", + "description": "Gets one subaccount by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Subaccount ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "Subaccount" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.subaccounts.insert", + "path": "userprofiles/{profileId}/subaccounts", + "httpMethod": "POST", + "description": "Inserts a new subaccount.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Subaccount" + }, + "response": { + "$ref": "Subaccount" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.subaccounts.list", + "path": "userprofiles/{profileId}/subaccounts", + "httpMethod": "GET", + "description": "Gets a list of subaccounts, possibly filtered.", + "parameters": { + "ids": { + "type": "string", + "description": "Select only subaccounts with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"subaccount*2015\" will return objects with names like \"subaccount June 2015\", \"subaccount April 2015\", or simply \"subaccount 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"subaccount\" will match objects with name \"my subaccount\", \"subaccount 2015\", or simply \"subaccount\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "SubaccountsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.subaccounts.patch", + "path": "userprofiles/{profileId}/subaccounts", + "httpMethod": "PATCH", + "description": "Updates an existing subaccount. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "Subaccount ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "Subaccount" + }, + "response": { + "$ref": "Subaccount" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.subaccounts.update", + "path": "userprofiles/{profileId}/subaccounts", + "httpMethod": "PUT", + "description": "Updates an existing subaccount.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "Subaccount" + }, + "response": { + "$ref": "Subaccount" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "targetableRemarketingLists": { + "methods": { + "get": { + "id": "dfareporting.targetableRemarketingLists.get", + "path": "userprofiles/{profileId}/targetableRemarketingLists/{id}", + "httpMethod": "GET", + "description": "Gets one remarketing list by ID.", + "parameters": { + "id": { + "type": "string", + "description": "Remarketing list ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "TargetableRemarketingList" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.targetableRemarketingLists.list", + "path": "userprofiles/{profileId}/targetableRemarketingLists", + "httpMethod": "GET", + "description": "Retrieves a list of targetable remarketing lists, possibly filtered.", + "parameters": { + "active": { + "type": "boolean", + "description": "Select only active or only inactive targetable remarketing lists.", + "location": "query" + }, + "advertiserId": { + "type": "string", + "description": "Select only targetable remarketing lists targetable by these advertisers.", + "required": true, + "format": "int64", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "name": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"remarketing list*2015\" will return objects with names like \"remarketing list June 2015\", \"remarketing list April 2015\", or simply \"remarketing list 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"remarketing list\" will match objects with name \"my remarketing list\", \"remarketing list 2015\", or simply \"remarketing list\".", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + } + }, + "parameterOrder": [ + "profileId", + "advertiserId" + ], + "response": { + "$ref": "TargetableRemarketingListsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "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", + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "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", + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "userRolePermissionGroups": { + "methods": { + "get": { + "id": "dfareporting.userRolePermissionGroups.get", + "path": "userprofiles/{profileId}/userRolePermissionGroups/{id}", + "httpMethod": "GET", + "description": "Gets one user role permission group by ID.", + "parameters": { + "id": { + "type": "string", + "description": "User role permission group ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "UserRolePermissionGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.userRolePermissionGroups.list", + "path": "userprofiles/{profileId}/userRolePermissionGroups", + "httpMethod": "GET", + "description": "Gets a list of all supported user role permission groups.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "UserRolePermissionGroupsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "userRolePermissions": { + "methods": { + "get": { + "id": "dfareporting.userRolePermissions.get", + "path": "userprofiles/{profileId}/userRolePermissions/{id}", + "httpMethod": "GET", + "description": "Gets one user role permission by ID.", + "parameters": { + "id": { + "type": "string", + "description": "User role permission ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "UserRolePermission" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.userRolePermissions.list", + "path": "userprofiles/{profileId}/userRolePermissions", + "httpMethod": "GET", + "description": "Gets a list of user role permissions, possibly filtered.", + "parameters": { + "ids": { + "type": "string", + "description": "Select only user role permissions with these IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "UserRolePermissionsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + }, + "userRoles": { + "methods": { + "delete": { + "id": "dfareporting.userRoles.delete", + "path": "userprofiles/{profileId}/userRoles/{id}", + "httpMethod": "DELETE", + "description": "Deletes an existing user role.", + "parameters": { + "id": { + "type": "string", + "description": "User role ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "get": { + "id": "dfareporting.userRoles.get", + "path": "userprofiles/{profileId}/userRoles/{id}", + "httpMethod": "GET", + "description": "Gets one user role by ID.", + "parameters": { + "id": { + "type": "string", + "description": "User role ID.", + "required": true, + "format": "int64", + "location": "path" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "response": { + "$ref": "UserRole" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "insert": { + "id": "dfareporting.userRoles.insert", + "path": "userprofiles/{profileId}/userRoles", + "httpMethod": "POST", + "description": "Inserts a new user role.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "UserRole" + }, + "response": { + "$ref": "UserRole" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "list": { + "id": "dfareporting.userRoles.list", + "path": "userprofiles/{profileId}/userRoles", + "httpMethod": "GET", + "description": "Retrieves a list of user roles, possibly filtered.", + "parameters": { + "accountUserRoleOnly": { + "type": "boolean", + "description": "Select only account level user roles not associated with any specific subaccount.", + "location": "query" + }, + "ids": { + "type": "string", + "description": "Select only user roles with the specified IDs.", + "format": "int64", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Value of the nextPageToken from the previous result page.", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + }, + "searchString": { + "type": "string", + "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"userrole*2015\" will return objects with names like \"userrole June 2015\", \"userrole April 2015\", or simply \"userrole 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"userrole\" will match objects with name \"my userrole\", \"userrole 2015\", or simply \"userrole\".", + "location": "query" + }, + "sortField": { + "type": "string", + "description": "Field by which to sort the list.", + "enum": [ + "ID", + "NAME" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "sortOrder": { + "type": "string", + "description": "Order of sorted results, default is ASCENDING.", + "enum": [ + "ASCENDING", + "DESCENDING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "subaccountId": { + "type": "string", + "description": "Select only user roles that belong to this subaccount.", + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "profileId" + ], + "response": { + "$ref": "UserRolesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "patch": { + "id": "dfareporting.userRoles.patch", + "path": "userprofiles/{profileId}/userRoles", + "httpMethod": "PATCH", + "description": "Updates an existing user role. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "User role ID.", + "required": true, + "format": "int64", + "location": "query" + }, + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId", + "id" + ], + "request": { + "$ref": "UserRole" + }, + "response": { + "$ref": "UserRole" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + }, + "update": { + "id": "dfareporting.userRoles.update", + "path": "userprofiles/{profileId}/userRoles", + "httpMethod": "PUT", + "description": "Updates an existing user role.", + "parameters": { + "profileId": { + "type": "string", + "description": "User profile ID associated with this request.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "profileId" + ], + "request": { + "$ref": "UserRole" + }, + "response": { + "$ref": "UserRole" + }, + "scopes": [ + "https://www.googleapis.com/auth/dfatrafficking" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/dfareporting/v2.2/dfareporting-gen.go b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v2.2/dfareporting-gen.go new file mode 100644 index 000000000..314b0a7c5 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/dfareporting/v2.2/dfareporting-gen.go @@ -0,0 +1,42571 @@ +// Package dfareporting provides access to the DCM/DFA Reporting And Trafficking API. +// +// See https://developers.google.com/doubleclick-advertisers/reporting/ +// +// Usage example: +// +// import "google.golang.org/api/dfareporting/v2.2" +// ... +// dfareportingService, err := dfareporting.New(oauthHttpClient) +package dfareporting // import "google.golang.org/api/dfareporting/v2.2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "dfareporting:v2.2" +const apiName = "dfareporting" +const apiVersion = "v2.2" +const basePath = "https://www.googleapis.com/dfareporting/v2.2/" + +// OAuth2 scopes used by this API. +const ( + // View and manage DoubleClick for Advertisers reports + DfareportingScope = "https://www.googleapis.com/auth/dfareporting" + + // View and manage your DoubleClick Campaign Manager's (DCM) display ad + // campaigns + DfatraffickingScope = "https://www.googleapis.com/auth/dfatrafficking" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.AccountActiveAdSummaries = NewAccountActiveAdSummariesService(s) + s.AccountPermissionGroups = NewAccountPermissionGroupsService(s) + s.AccountPermissions = NewAccountPermissionsService(s) + s.AccountUserProfiles = NewAccountUserProfilesService(s) + s.Accounts = NewAccountsService(s) + s.Ads = NewAdsService(s) + s.AdvertiserGroups = NewAdvertiserGroupsService(s) + s.Advertisers = NewAdvertisersService(s) + s.Browsers = NewBrowsersService(s) + s.CampaignCreativeAssociations = NewCampaignCreativeAssociationsService(s) + s.Campaigns = NewCampaignsService(s) + s.ChangeLogs = NewChangeLogsService(s) + s.Cities = NewCitiesService(s) + s.ConnectionTypes = NewConnectionTypesService(s) + s.ContentCategories = NewContentCategoriesService(s) + s.Countries = NewCountriesService(s) + s.CreativeAssets = NewCreativeAssetsService(s) + s.CreativeFieldValues = NewCreativeFieldValuesService(s) + s.CreativeFields = NewCreativeFieldsService(s) + s.CreativeGroups = NewCreativeGroupsService(s) + s.Creatives = NewCreativesService(s) + s.DimensionValues = NewDimensionValuesService(s) + s.DirectorySiteContacts = NewDirectorySiteContactsService(s) + s.DirectorySites = NewDirectorySitesService(s) + s.EventTags = NewEventTagsService(s) + s.Files = NewFilesService(s) + s.FloodlightActivities = NewFloodlightActivitiesService(s) + s.FloodlightActivityGroups = NewFloodlightActivityGroupsService(s) + s.FloodlightConfigurations = NewFloodlightConfigurationsService(s) + s.InventoryItems = NewInventoryItemsService(s) + s.LandingPages = NewLandingPagesService(s) + s.Metros = NewMetrosService(s) + s.MobileCarriers = NewMobileCarriersService(s) + s.OperatingSystemVersions = NewOperatingSystemVersionsService(s) + s.OperatingSystems = NewOperatingSystemsService(s) + s.OrderDocuments = NewOrderDocumentsService(s) + s.Orders = NewOrdersService(s) + s.PlacementGroups = NewPlacementGroupsService(s) + s.PlacementStrategies = NewPlacementStrategiesService(s) + s.Placements = NewPlacementsService(s) + s.PlatformTypes = NewPlatformTypesService(s) + s.PostalCodes = NewPostalCodesService(s) + s.Projects = NewProjectsService(s) + s.Regions = NewRegionsService(s) + s.RemarketingListShares = NewRemarketingListSharesService(s) + s.RemarketingLists = NewRemarketingListsService(s) + s.Reports = NewReportsService(s) + s.Sites = NewSitesService(s) + s.Sizes = NewSizesService(s) + s.Subaccounts = NewSubaccountsService(s) + s.TargetableRemarketingLists = NewTargetableRemarketingListsService(s) + s.UserProfiles = NewUserProfilesService(s) + s.UserRolePermissionGroups = NewUserRolePermissionGroupsService(s) + s.UserRolePermissions = NewUserRolePermissionsService(s) + s.UserRoles = NewUserRolesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + AccountActiveAdSummaries *AccountActiveAdSummariesService + + AccountPermissionGroups *AccountPermissionGroupsService + + AccountPermissions *AccountPermissionsService + + AccountUserProfiles *AccountUserProfilesService + + Accounts *AccountsService + + Ads *AdsService + + AdvertiserGroups *AdvertiserGroupsService + + Advertisers *AdvertisersService + + Browsers *BrowsersService + + CampaignCreativeAssociations *CampaignCreativeAssociationsService + + Campaigns *CampaignsService + + ChangeLogs *ChangeLogsService + + Cities *CitiesService + + ConnectionTypes *ConnectionTypesService + + ContentCategories *ContentCategoriesService + + Countries *CountriesService + + CreativeAssets *CreativeAssetsService + + CreativeFieldValues *CreativeFieldValuesService + + CreativeFields *CreativeFieldsService + + CreativeGroups *CreativeGroupsService + + Creatives *CreativesService + + DimensionValues *DimensionValuesService + + DirectorySiteContacts *DirectorySiteContactsService + + DirectorySites *DirectorySitesService + + EventTags *EventTagsService + + Files *FilesService + + FloodlightActivities *FloodlightActivitiesService + + FloodlightActivityGroups *FloodlightActivityGroupsService + + FloodlightConfigurations *FloodlightConfigurationsService + + InventoryItems *InventoryItemsService + + LandingPages *LandingPagesService + + Metros *MetrosService + + MobileCarriers *MobileCarriersService + + OperatingSystemVersions *OperatingSystemVersionsService + + OperatingSystems *OperatingSystemsService + + OrderDocuments *OrderDocumentsService + + Orders *OrdersService + + PlacementGroups *PlacementGroupsService + + PlacementStrategies *PlacementStrategiesService + + Placements *PlacementsService + + PlatformTypes *PlatformTypesService + + PostalCodes *PostalCodesService + + Projects *ProjectsService + + Regions *RegionsService + + RemarketingListShares *RemarketingListSharesService + + RemarketingLists *RemarketingListsService + + Reports *ReportsService + + Sites *SitesService + + Sizes *SizesService + + Subaccounts *SubaccountsService + + TargetableRemarketingLists *TargetableRemarketingListsService + + UserProfiles *UserProfilesService + + UserRolePermissionGroups *UserRolePermissionGroupsService + + UserRolePermissions *UserRolePermissionsService + + UserRoles *UserRolesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAccountActiveAdSummariesService(s *Service) *AccountActiveAdSummariesService { + rs := &AccountActiveAdSummariesService{s: s} + return rs +} + +type AccountActiveAdSummariesService struct { + s *Service +} + +func NewAccountPermissionGroupsService(s *Service) *AccountPermissionGroupsService { + rs := &AccountPermissionGroupsService{s: s} + return rs +} + +type AccountPermissionGroupsService struct { + s *Service +} + +func NewAccountPermissionsService(s *Service) *AccountPermissionsService { + rs := &AccountPermissionsService{s: s} + return rs +} + +type AccountPermissionsService struct { + s *Service +} + +func NewAccountUserProfilesService(s *Service) *AccountUserProfilesService { + rs := &AccountUserProfilesService{s: s} + return rs +} + +type AccountUserProfilesService struct { + s *Service +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + return rs +} + +type AccountsService struct { + s *Service +} + +func NewAdsService(s *Service) *AdsService { + rs := &AdsService{s: s} + return rs +} + +type AdsService struct { + s *Service +} + +func NewAdvertiserGroupsService(s *Service) *AdvertiserGroupsService { + rs := &AdvertiserGroupsService{s: s} + return rs +} + +type AdvertiserGroupsService struct { + s *Service +} + +func NewAdvertisersService(s *Service) *AdvertisersService { + rs := &AdvertisersService{s: s} + return rs +} + +type AdvertisersService struct { + s *Service +} + +func NewBrowsersService(s *Service) *BrowsersService { + rs := &BrowsersService{s: s} + return rs +} + +type BrowsersService struct { + s *Service +} + +func NewCampaignCreativeAssociationsService(s *Service) *CampaignCreativeAssociationsService { + rs := &CampaignCreativeAssociationsService{s: s} + return rs +} + +type CampaignCreativeAssociationsService struct { + s *Service +} + +func NewCampaignsService(s *Service) *CampaignsService { + rs := &CampaignsService{s: s} + return rs +} + +type CampaignsService struct { + s *Service +} + +func NewChangeLogsService(s *Service) *ChangeLogsService { + rs := &ChangeLogsService{s: s} + return rs +} + +type ChangeLogsService struct { + s *Service +} + +func NewCitiesService(s *Service) *CitiesService { + rs := &CitiesService{s: s} + return rs +} + +type CitiesService struct { + s *Service +} + +func NewConnectionTypesService(s *Service) *ConnectionTypesService { + rs := &ConnectionTypesService{s: s} + return rs +} + +type ConnectionTypesService struct { + s *Service +} + +func NewContentCategoriesService(s *Service) *ContentCategoriesService { + rs := &ContentCategoriesService{s: s} + return rs +} + +type ContentCategoriesService struct { + s *Service +} + +func NewCountriesService(s *Service) *CountriesService { + rs := &CountriesService{s: s} + return rs +} + +type CountriesService struct { + s *Service +} + +func NewCreativeAssetsService(s *Service) *CreativeAssetsService { + rs := &CreativeAssetsService{s: s} + return rs +} + +type CreativeAssetsService struct { + s *Service +} + +func NewCreativeFieldValuesService(s *Service) *CreativeFieldValuesService { + rs := &CreativeFieldValuesService{s: s} + return rs +} + +type CreativeFieldValuesService struct { + s *Service +} + +func NewCreativeFieldsService(s *Service) *CreativeFieldsService { + rs := &CreativeFieldsService{s: s} + return rs +} + +type CreativeFieldsService struct { + s *Service +} + +func NewCreativeGroupsService(s *Service) *CreativeGroupsService { + rs := &CreativeGroupsService{s: s} + return rs +} + +type CreativeGroupsService struct { + s *Service +} + +func NewCreativesService(s *Service) *CreativesService { + rs := &CreativesService{s: s} + return rs +} + +type CreativesService struct { + s *Service +} + +func NewDimensionValuesService(s *Service) *DimensionValuesService { + rs := &DimensionValuesService{s: s} + return rs +} + +type DimensionValuesService struct { + s *Service +} + +func NewDirectorySiteContactsService(s *Service) *DirectorySiteContactsService { + rs := &DirectorySiteContactsService{s: s} + return rs +} + +type DirectorySiteContactsService struct { + s *Service +} + +func NewDirectorySitesService(s *Service) *DirectorySitesService { + rs := &DirectorySitesService{s: s} + return rs +} + +type DirectorySitesService struct { + s *Service +} + +func NewEventTagsService(s *Service) *EventTagsService { + rs := &EventTagsService{s: s} + return rs +} + +type EventTagsService struct { + s *Service +} + +func NewFilesService(s *Service) *FilesService { + rs := &FilesService{s: s} + return rs +} + +type FilesService struct { + s *Service +} + +func NewFloodlightActivitiesService(s *Service) *FloodlightActivitiesService { + rs := &FloodlightActivitiesService{s: s} + return rs +} + +type FloodlightActivitiesService struct { + s *Service +} + +func NewFloodlightActivityGroupsService(s *Service) *FloodlightActivityGroupsService { + rs := &FloodlightActivityGroupsService{s: s} + return rs +} + +type FloodlightActivityGroupsService struct { + s *Service +} + +func NewFloodlightConfigurationsService(s *Service) *FloodlightConfigurationsService { + rs := &FloodlightConfigurationsService{s: s} + return rs +} + +type FloodlightConfigurationsService struct { + s *Service +} + +func NewInventoryItemsService(s *Service) *InventoryItemsService { + rs := &InventoryItemsService{s: s} + return rs +} + +type InventoryItemsService struct { + s *Service +} + +func NewLandingPagesService(s *Service) *LandingPagesService { + rs := &LandingPagesService{s: s} + return rs +} + +type LandingPagesService struct { + s *Service +} + +func NewMetrosService(s *Service) *MetrosService { + rs := &MetrosService{s: s} + return rs +} + +type MetrosService struct { + s *Service +} + +func NewMobileCarriersService(s *Service) *MobileCarriersService { + rs := &MobileCarriersService{s: s} + return rs +} + +type MobileCarriersService struct { + s *Service +} + +func NewOperatingSystemVersionsService(s *Service) *OperatingSystemVersionsService { + rs := &OperatingSystemVersionsService{s: s} + return rs +} + +type OperatingSystemVersionsService struct { + s *Service +} + +func NewOperatingSystemsService(s *Service) *OperatingSystemsService { + rs := &OperatingSystemsService{s: s} + return rs +} + +type OperatingSystemsService struct { + s *Service +} + +func NewOrderDocumentsService(s *Service) *OrderDocumentsService { + rs := &OrderDocumentsService{s: s} + return rs +} + +type OrderDocumentsService struct { + s *Service +} + +func NewOrdersService(s *Service) *OrdersService { + rs := &OrdersService{s: s} + return rs +} + +type OrdersService struct { + s *Service +} + +func NewPlacementGroupsService(s *Service) *PlacementGroupsService { + rs := &PlacementGroupsService{s: s} + return rs +} + +type PlacementGroupsService struct { + s *Service +} + +func NewPlacementStrategiesService(s *Service) *PlacementStrategiesService { + rs := &PlacementStrategiesService{s: s} + return rs +} + +type PlacementStrategiesService struct { + s *Service +} + +func NewPlacementsService(s *Service) *PlacementsService { + rs := &PlacementsService{s: s} + return rs +} + +type PlacementsService struct { + s *Service +} + +func NewPlatformTypesService(s *Service) *PlatformTypesService { + rs := &PlatformTypesService{s: s} + return rs +} + +type PlatformTypesService struct { + s *Service +} + +func NewPostalCodesService(s *Service) *PostalCodesService { + rs := &PostalCodesService{s: s} + return rs +} + +type PostalCodesService struct { + s *Service +} + +func NewProjectsService(s *Service) *ProjectsService { + rs := &ProjectsService{s: s} + return rs +} + +type ProjectsService struct { + s *Service +} + +func NewRegionsService(s *Service) *RegionsService { + rs := &RegionsService{s: s} + return rs +} + +type RegionsService struct { + s *Service +} + +func NewRemarketingListSharesService(s *Service) *RemarketingListSharesService { + rs := &RemarketingListSharesService{s: s} + return rs +} + +type RemarketingListSharesService struct { + s *Service +} + +func NewRemarketingListsService(s *Service) *RemarketingListsService { + rs := &RemarketingListsService{s: s} + return rs +} + +type RemarketingListsService 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 NewSitesService(s *Service) *SitesService { + rs := &SitesService{s: s} + return rs +} + +type SitesService struct { + s *Service +} + +func NewSizesService(s *Service) *SizesService { + rs := &SizesService{s: s} + return rs +} + +type SizesService struct { + s *Service +} + +func NewSubaccountsService(s *Service) *SubaccountsService { + rs := &SubaccountsService{s: s} + return rs +} + +type SubaccountsService struct { + s *Service +} + +func NewTargetableRemarketingListsService(s *Service) *TargetableRemarketingListsService { + rs := &TargetableRemarketingListsService{s: s} + return rs +} + +type TargetableRemarketingListsService struct { + s *Service +} + +func NewUserProfilesService(s *Service) *UserProfilesService { + rs := &UserProfilesService{s: s} + return rs +} + +type UserProfilesService struct { + s *Service +} + +func NewUserRolePermissionGroupsService(s *Service) *UserRolePermissionGroupsService { + rs := &UserRolePermissionGroupsService{s: s} + return rs +} + +type UserRolePermissionGroupsService struct { + s *Service +} + +func NewUserRolePermissionsService(s *Service) *UserRolePermissionsService { + rs := &UserRolePermissionsService{s: s} + return rs +} + +type UserRolePermissionsService struct { + s *Service +} + +func NewUserRolesService(s *Service) *UserRolesService { + rs := &UserRolesService{s: s} + return rs +} + +type UserRolesService struct { + s *Service +} + +// Account: Contains properties of a DCM account. +type Account struct { + // AccountPermissionIds: Account permissions assigned to this account. + AccountPermissionIds googleapi.Int64s `json:"accountPermissionIds,omitempty"` + + // AccountProfile: Profile for this account. This is a read-only field + // that can be left blank. + // + // Possible values: + // "ACCOUNT_PROFILE_BASIC" + // "ACCOUNT_PROFILE_STANDARD" + AccountProfile string `json:"accountProfile,omitempty"` + + // Active: Whether this account is active. + Active bool `json:"active,omitempty"` + + // ActiveAdsLimitTier: Maximum number of active ads allowed for this + // account. + // + // Possible values: + // "ACTIVE_ADS_TIER_100K" + // "ACTIVE_ADS_TIER_200K" + // "ACTIVE_ADS_TIER_300K" + // "ACTIVE_ADS_TIER_40K" + // "ACTIVE_ADS_TIER_75K" + ActiveAdsLimitTier string `json:"activeAdsLimitTier,omitempty"` + + // ActiveViewOptOut: Whether to serve creatives with Active View tags. + // If disabled, viewability data will not be available for any + // impressions. + ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"` + + // AvailablePermissionIds: User role permissions available to the user + // roles of this account. + AvailablePermissionIds googleapi.Int64s `json:"availablePermissionIds,omitempty"` + + // ComscoreVceEnabled: Whether campaigns created in this account will be + // enabled for comScore vCE by default. + ComscoreVceEnabled bool `json:"comscoreVceEnabled,omitempty"` + + // CountryId: ID of the country associated with this account. + CountryId int64 `json:"countryId,omitempty,string"` + + // CurrencyId: ID of currency associated with this account. This is a + // required field. + // Acceptable values are: + // - "1" for USD + // - "2" for GBP + // - "3" for ESP + // - "4" for SEK + // - "5" for CAD + // - "6" for JPY + // - "7" for DEM + // - "8" for AUD + // - "9" for FRF + // - "10" for ITL + // - "11" for DKK + // - "12" for NOK + // - "13" for FIM + // - "14" for ZAR + // - "15" for IEP + // - "16" for NLG + // - "17" for EUR + // - "18" for KRW + // - "19" for TWD + // - "20" for SGD + // - "21" for CNY + // - "22" for HKD + // - "23" for NZD + // - "24" for MYR + // - "25" for BRL + // - "26" for PTE + // - "27" for MXP + // - "28" for CLP + // - "29" for TRY + // - "30" for ARS + // - "31" for PEN + // - "32" for ILS + // - "33" for CHF + // - "34" for VEF + // - "35" for COP + // - "36" for GTQ + CurrencyId int64 `json:"currencyId,omitempty,string"` + + // DefaultCreativeSizeId: Default placement dimensions for this account. + DefaultCreativeSizeId int64 `json:"defaultCreativeSizeId,omitempty,string"` + + // Description: Description of this account. + Description string `json:"description,omitempty"` + + // Id: ID of this account. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#account". + Kind string `json:"kind,omitempty"` + + // Locale: Locale of this account. + // Acceptable values are: + // - "cs" (Czech) + // - "de" (German) + // - "en" (English) + // - "en-GB" (English United Kingdom) + // - "es" (Spanish) + // - "fr" (French) + // - "it" (Italian) + // - "ja" (Japanese) + // - "ko" (Korean) + // - "pl" (Polish) + // - "pt-BR" (Portuguese Brazil) + // - "ru" (Russian) + // - "sv" (Swedish) + // - "tr" (Turkish) + // - "zh-CN" (Chinese Simplified) + // - "zh-TW" (Chinese Traditional) + Locale string `json:"locale,omitempty"` + + // MaximumImageSize: Maximum image size allowed for this account. + MaximumImageSize int64 `json:"maximumImageSize,omitempty,string"` + + // Name: Name of this account. This is a required field, and must be + // less than 128 characters long and be globally unique. + Name string `json:"name,omitempty"` + + // NielsenOcrEnabled: Whether campaigns created in this account will be + // enabled for Nielsen OCR reach ratings by default. + NielsenOcrEnabled bool `json:"nielsenOcrEnabled,omitempty"` + + // ReportsConfiguration: Reporting configuration of this account. + ReportsConfiguration *ReportsConfiguration `json:"reportsConfiguration,omitempty"` + + // TeaserSizeLimit: File size limit in kilobytes of Rich Media teaser + // creatives. Must be between 1 and 10240. + TeaserSizeLimit int64 `json:"teaserSizeLimit,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "AccountPermissionIds") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Account) MarshalJSON() ([]byte, error) { + type noMethod Account + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountActiveAdSummary: Gets a summary of active ads in an account. +type AccountActiveAdSummary struct { + // AccountId: ID of the account. + AccountId int64 `json:"accountId,omitempty,string"` + + // ActiveAds: Ads that have been activated for the account + ActiveAds int64 `json:"activeAds,omitempty,string"` + + // ActiveAdsLimitTier: Maximum number of active ads allowed for the + // account. + // + // Possible values: + // "ACTIVE_ADS_TIER_100K" + // "ACTIVE_ADS_TIER_200K" + // "ACTIVE_ADS_TIER_300K" + // "ACTIVE_ADS_TIER_40K" + // "ACTIVE_ADS_TIER_75K" + ActiveAdsLimitTier string `json:"activeAdsLimitTier,omitempty"` + + // AvailableAds: Ads that can be activated for the account. + AvailableAds int64 `json:"availableAds,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#accountActiveAdSummary". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountActiveAdSummary) MarshalJSON() ([]byte, error) { + type noMethod AccountActiveAdSummary + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountPermission: AccountPermissions contains information about a +// particular account permission. Some features of DCM require an +// account permission to be present in the account. +type AccountPermission struct { + // AccountProfiles: Account profiles associated with this account + // permission. + // + // Possible values are: + // - "ACCOUNT_PROFILE_BASIC" + // - "ACCOUNT_PROFILE_STANDARD" + // + // Possible values: + // "ACCOUNT_PROFILE_BASIC" + // "ACCOUNT_PROFILE_STANDARD" + AccountProfiles []string `json:"accountProfiles,omitempty"` + + // Id: ID of this account permission. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#accountPermission". + Kind string `json:"kind,omitempty"` + + // Level: Administrative level required to enable this account + // permission. + // + // Possible values: + // "ADMINISTRATOR" + // "USER" + Level string `json:"level,omitempty"` + + // Name: Name of this account permission. + Name string `json:"name,omitempty"` + + // PermissionGroupId: Permission group of this account permission. + PermissionGroupId int64 `json:"permissionGroupId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountProfiles") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountPermission) MarshalJSON() ([]byte, error) { + type noMethod AccountPermission + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountPermissionGroup: AccountPermissionGroups contains a mapping of +// permission group IDs to names. A permission group is a grouping of +// account permissions. +type AccountPermissionGroup struct { + // Id: ID of this account permission group. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#accountPermissionGroup". + Kind string `json:"kind,omitempty"` + + // Name: Name of this account permission group. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountPermissionGroup) MarshalJSON() ([]byte, error) { + type noMethod AccountPermissionGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountPermissionGroupsListResponse: Account Permission Group List +// Response +type AccountPermissionGroupsListResponse struct { + // AccountPermissionGroups: Account permission group collection. + AccountPermissionGroups []*AccountPermissionGroup `json:"accountPermissionGroups,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#accountPermissionGroupsListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "AccountPermissionGroups") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountPermissionGroupsListResponse) MarshalJSON() ([]byte, error) { + type noMethod AccountPermissionGroupsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountPermissionsListResponse: Account Permission List Response +type AccountPermissionsListResponse struct { + // AccountPermissions: Account permission collection. + AccountPermissions []*AccountPermission `json:"accountPermissions,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#accountPermissionsListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountPermissions") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountPermissionsListResponse) MarshalJSON() ([]byte, error) { + type noMethod AccountPermissionsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountUserProfile: AccountUserProfiles contains properties of a DCM +// user profile. This resource is specifically for managing user +// profiles, whereas UserProfiles is for accessing the API. +type AccountUserProfile struct { + // AccountId: Account ID of the user profile. This is a read-only field + // that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // Active: Whether this user profile is active. This defaults to false, + // and must be set true on insert for the user profile to be usable. + Active bool `json:"active,omitempty"` + + // AdvertiserFilter: Filter that describes which advertisers are visible + // to the user profile. + AdvertiserFilter *ObjectFilter `json:"advertiserFilter,omitempty"` + + // CampaignFilter: Filter that describes which campaigns are visible to + // the user profile. + CampaignFilter *ObjectFilter `json:"campaignFilter,omitempty"` + + // Comments: Comments for this user profile. + Comments string `json:"comments,omitempty"` + + // Email: Email of the user profile. The email addresss must be linked + // to a Google Account. This field is required on insertion and is + // read-only after insertion. + Email string `json:"email,omitempty"` + + // Id: ID of the user profile. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#accountUserProfile". + Kind string `json:"kind,omitempty"` + + // Locale: Locale of the user profile. This is a required + // field. + // Acceptable values are: + // - "cs" (Czech) + // - "de" (German) + // - "en" (English) + // - "en-GB" (English United Kingdom) + // - "es" (Spanish) + // - "fr" (French) + // - "it" (Italian) + // - "ja" (Japanese) + // - "ko" (Korean) + // - "pl" (Polish) + // - "pt-BR" (Portuguese Brazil) + // - "ru" (Russian) + // - "sv" (Swedish) + // - "tr" (Turkish) + // - "zh-CN" (Chinese Simplified) + // - "zh-TW" (Chinese Traditional) + Locale string `json:"locale,omitempty"` + + // Name: Name of the user profile. This is a required field. Must be + // less than 64 characters long, must be globally unique, and cannot + // contain whitespace or any of the following characters: "&;"#%,". + Name string `json:"name,omitempty"` + + // SiteFilter: Filter that describes which sites are visible to the user + // profile. + SiteFilter *ObjectFilter `json:"siteFilter,omitempty"` + + // SubaccountId: Subaccount ID of the user profile. This is a read-only + // field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TraffickerType: Trafficker type of this user profile. + // + // Possible values: + // "EXTERNAL_TRAFFICKER" + // "INTERNAL_NON_TRAFFICKER" + // "INTERNAL_TRAFFICKER" + TraffickerType string `json:"traffickerType,omitempty"` + + // UserAccessType: User type of the user profile. This is a read-only + // field that can be left blank. + // + // Possible values: + // "INTERNAL_ADMINISTRATOR" + // "NORMAL_USER" + // "SUPER_USER" + UserAccessType string `json:"userAccessType,omitempty"` + + // UserRoleFilter: Filter that describes which user roles are visible to + // the user profile. + UserRoleFilter *ObjectFilter `json:"userRoleFilter,omitempty"` + + // UserRoleId: User role ID of the user profile. This is a required + // field. + UserRoleId int64 `json:"userRoleId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountUserProfile) MarshalJSON() ([]byte, error) { + type noMethod AccountUserProfile + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountUserProfilesListResponse: Account User Profile List Response +type AccountUserProfilesListResponse struct { + // AccountUserProfiles: Account user profile collection. + AccountUserProfiles []*AccountUserProfile `json:"accountUserProfiles,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#accountUserProfilesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountUserProfiles") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountUserProfilesListResponse) MarshalJSON() ([]byte, error) { + type noMethod AccountUserProfilesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountsListResponse: Account List Response +type AccountsListResponse struct { + // Accounts: Account collection. + Accounts []*Account `json:"accounts,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#accountsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Accounts") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountsListResponse) MarshalJSON() ([]byte, error) { + type noMethod AccountsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Activities: Represents an activity group. +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"` + + // ForceSendFields is a list of field names (e.g. "Filters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Activities) MarshalJSON() ([]byte, error) { + type noMethod Activities + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Ad: Contains properties of a DCM ad. +type Ad struct { + // AccountId: Account ID of this ad. This is a read-only field that can + // be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // Active: Whether this ad is active. + Active bool `json:"active,omitempty"` + + // AdvertiserId: Advertiser ID of this ad. This is a required field on + // insertion. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // Archived: Whether this ad is archived. + Archived bool `json:"archived,omitempty"` + + // AudienceSegmentId: Audience segment ID that is being targeted for + // this ad. Applicable when type is AD_SERVING_STANDARD_AD. + AudienceSegmentId int64 `json:"audienceSegmentId,omitempty,string"` + + // CampaignId: Campaign ID of this ad. This is a required field on + // insertion. + CampaignId int64 `json:"campaignId,omitempty,string"` + + // CampaignIdDimensionValue: Dimension value for the ID of the campaign. + // This is a read-only, auto-generated field. + CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"` + + // ClickThroughUrl: Click-through URL for this ad. This is a required + // field on insertion. Applicable when type is AD_SERVING_CLICK_TRACKER. + ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"` + + // ClickThroughUrlSuffixProperties: Click-through URL suffix properties + // for this ad. Applies to the URL in the ad or (if overriding ad + // properties) the URL in the creative. + ClickThroughUrlSuffixProperties *ClickThroughUrlSuffixProperties `json:"clickThroughUrlSuffixProperties,omitempty"` + + // Comments: Comments for this ad. + Comments string `json:"comments,omitempty"` + + // Compatibility: Compatibility of this ad. Applicable when type is + // AD_SERVING_DEFAULT_AD. WEB and WEB_INTERSTITIAL refer to rendering + // either on desktop or on mobile devices for regular or interstitial + // ads, respectively. APP and APP_INTERSTITIAL are for rendering in + // mobile apps. IN_STREAM_VIDEO refers to rendering an in-stream video + // ads developed with the VAST standard. + // + // Possible values: + // "APP" + // "APP_INTERSTITIAL" + // "IN_STREAM_VIDEO" + // "WEB" + // "WEB_INTERSTITIAL" + Compatibility string `json:"compatibility,omitempty"` + + // CreateInfo: Information about the creation of this ad.This is a + // read-only field. + CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"` + + // CreativeGroupAssignments: Creative group assignments for this ad. + // Applicable when type is AD_SERVING_CLICK_TRACKER. Only one assignment + // per creative group number is allowed for a maximum of two + // assignments. + CreativeGroupAssignments []*CreativeGroupAssignment `json:"creativeGroupAssignments,omitempty"` + + // CreativeRotation: Creative rotation for this ad. Applicable when type + // is AD_SERVING_DEFAULT_AD, AD_SERVING_STANDARD_AD, or + // AD_SERVING_TRACKING. When type is AD_SERVING_DEFAULT_AD, this field + // should have exactly one creativeAssignment. + CreativeRotation *CreativeRotation `json:"creativeRotation,omitempty"` + + // DayPartTargeting: Time and day targeting information for this ad. + // Applicable when type is AD_SERVING_STANDARD_AD. + DayPartTargeting *DayPartTargeting `json:"dayPartTargeting,omitempty"` + + // DefaultClickThroughEventTagProperties: Default click-through event + // tag properties for this ad. + DefaultClickThroughEventTagProperties *DefaultClickThroughEventTagProperties `json:"defaultClickThroughEventTagProperties,omitempty"` + + // DeliverySchedule: Delivery schedule information for this ad. + // Applicable when type is AD_SERVING_STANDARD_AD or + // AD_SERVING_TRACKING. This field along with subfields priority and + // impressionRatio are required on insertion when type is + // AD_SERVING_STANDARD_AD. + DeliverySchedule *DeliverySchedule `json:"deliverySchedule,omitempty"` + + // DynamicClickTracker: Whether this ad is a dynamic click tracker. + // Applicable when type is AD_SERVING_CLICK_TRACKER. This is a required + // field on insert, and is read-only after insert. + DynamicClickTracker bool `json:"dynamicClickTracker,omitempty"` + + // EndTime: Date and time that this ad should stop serving. Must be + // later than the start time. This is a required field on insertion. + EndTime string `json:"endTime,omitempty"` + + // EventTagOverrides: Event tag overrides for this ad. + EventTagOverrides []*EventTagOverride `json:"eventTagOverrides,omitempty"` + + // GeoTargeting: Geographical targeting information for this + // ad.Applicable when type is AD_SERVING_STANDARD_AD. + GeoTargeting *GeoTargeting `json:"geoTargeting,omitempty"` + + // Id: ID of this ad. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this ad. This is a + // read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // KeyValueTargetingExpression: Key-value targeting information for this + // ad. Applicable when type is AD_SERVING_STANDARD_AD. + KeyValueTargetingExpression *KeyValueTargetingExpression `json:"keyValueTargetingExpression,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#ad". + Kind string `json:"kind,omitempty"` + + // LastModifiedInfo: Information about the most recent modification of + // this ad. This is a read-only field. + LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"` + + // Name: Name of this ad. This is a required field and must be less than + // 256 characters long. + Name string `json:"name,omitempty"` + + // PlacementAssignments: Placement assignments for this ad. + PlacementAssignments []*PlacementAssignment `json:"placementAssignments,omitempty"` + + // RemarketingListExpression: Applicable when type is + // AD_SERVING_STANDARD_AD. Remarketing list targeting expression for + // this ad. + RemarketingListExpression *ListTargetingExpression `json:"remarketingListExpression,omitempty"` + + // Size: Size of this ad. Applicable when type is AD_SERVING_DEFAULT_AD. + Size *Size `json:"size,omitempty"` + + // SslCompliant: Whether this ad is ssl compliant. This is a read-only + // field that is auto-generated when the ad is inserted or updated. + SslCompliant bool `json:"sslCompliant,omitempty"` + + // SslRequired: Whether this ad requires ssl. This is a read-only field + // that is auto-generated when the ad is inserted or updated. + SslRequired bool `json:"sslRequired,omitempty"` + + // StartTime: Date and time that this ad should start serving. If + // creating an ad, this field must be a time in the future. This is a + // required field on insertion. + StartTime string `json:"startTime,omitempty"` + + // SubaccountId: Subaccount ID of this ad. This is a read-only field + // that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TechnologyTargeting: Technology platform targeting information for + // this ad. Applicable when type is AD_SERVING_STANDARD_AD. + TechnologyTargeting *TechnologyTargeting `json:"technologyTargeting,omitempty"` + + // Type: Type of ad. This is a required field on insertion. Note that + // default ads (AD_SERVING_DEFAULT_AD) cannot be created directly (see + // Creative resource). + // + // Possible values: + // "AD_SERVING_CLICK_TRACKER" + // "AD_SERVING_DEFAULT_AD" + // "AD_SERVING_STANDARD_AD" + // "AD_SERVING_TRACKING" + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Ad) MarshalJSON() ([]byte, error) { + type noMethod Ad + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdSlot: Ad Slot +type AdSlot struct { + // Comment: Comment for this ad slot. + Comment string `json:"comment,omitempty"` + + // Compatibility: Ad slot compatibility. WEB and WEB_INTERSTITIAL refer + // to rendering either on desktop or on mobile devices for regular or + // interstitial ads respectively. APP and APP_INTERSTITIAL are for + // rendering in mobile apps. IN_STREAM_VIDEO refers to rendering in + // in-stream video ads developed with the VAST standard. + // + // Possible values: + // "PLANNING_RENDERING_ENVIRONMENT_TYPE_APP" + // "PLANNING_RENDERING_ENVIRONMENT_TYPE_APP_INTERSTITIAL" + // "PLANNING_RENDERING_ENVIRONMENT_TYPE_IN_STREAM_VIDEO" + // "PLANNING_RENDERING_ENVIRONMENT_TYPE_WEB" + // "PLANNING_RENDERING_ENVIRONMENT_TYPE_WEB_INTERSTITIAL" + Compatibility string `json:"compatibility,omitempty"` + + // Height: Height of this ad slot. + Height int64 `json:"height,omitempty,string"` + + // LinkedPlacementId: ID of the placement from an external platform that + // is linked to this ad slot. + LinkedPlacementId int64 `json:"linkedPlacementId,omitempty,string"` + + // Name: Name of this ad slot. + Name string `json:"name,omitempty"` + + // PaymentSourceType: Payment source type of this ad slot. + // + // Possible values: + // "PLANNING_PAYMENT_SOURCE_TYPE_AGENCY_PAID" + // "PLANNING_PAYMENT_SOURCE_TYPE_PUBLISHER_PAID" + PaymentSourceType string `json:"paymentSourceType,omitempty"` + + // Primary: Primary ad slot of a roadblock inventory item. + Primary bool `json:"primary,omitempty"` + + // Width: Width of this ad slot. + Width int64 `json:"width,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Comment") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdSlot) MarshalJSON() ([]byte, error) { + type noMethod AdSlot + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdsListResponse: Ad List Response +type AdsListResponse struct { + // Ads: Ad collection. + Ads []*Ad `json:"ads,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#adsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Ads") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdsListResponse) MarshalJSON() ([]byte, error) { + type noMethod AdsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Advertiser: Contains properties of a DCM advertiser. +type Advertiser struct { + // AccountId: Account ID of this advertiser.This is a read-only field + // that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserGroupId: ID of the advertiser group this advertiser belongs + // to. You can group advertisers for reporting purposes, allowing you to + // see aggregated information for all advertisers in each group. + AdvertiserGroupId int64 `json:"advertiserGroupId,omitempty,string"` + + // ClickThroughUrlSuffix: Suffix added to click-through URL of ad + // creative associations under this advertiser. Must be less than 129 + // characters long. + ClickThroughUrlSuffix string `json:"clickThroughUrlSuffix,omitempty"` + + // DefaultClickThroughEventTagId: ID of the click-through event tag to + // apply by default to the landing pages of this advertiser's campaigns. + DefaultClickThroughEventTagId int64 `json:"defaultClickThroughEventTagId,omitempty,string"` + + // DefaultEmail: Default email address used in sender field for tag + // emails. + DefaultEmail string `json:"defaultEmail,omitempty"` + + // FloodlightConfigurationId: Floodlight configuration ID of this + // advertiser. The floodlight configuration ID will be created + // automatically, so on insert this field should be left blank. This + // field can be set to another advertiser's floodlight configuration ID + // in order to share that advertiser's floodlight configuration with + // this advertiser, so long as: + // - This advertiser's original floodlight configuration is not already + // associated with floodlight activities or floodlight activity groups. + // + // - This advertiser's original floodlight configuration is not already + // shared with another advertiser. + FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"` + + // FloodlightConfigurationIdDimensionValue: Dimension value for the ID + // of the floodlight configuration. This is a read-only, auto-generated + // field. + FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"` + + // Id: ID of this advertiser. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this advertiser. This + // is a read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#advertiser". + Kind string `json:"kind,omitempty"` + + // Name: Name of this advertiser. This is a required field and must be + // less than 256 characters long and unique among advertisers of the + // same account. + Name string `json:"name,omitempty"` + + // OriginalFloodlightConfigurationId: Original floodlight configuration + // before any sharing occurred. Set the floodlightConfigurationId of + // this advertiser to originalFloodlightConfigurationId to unshare the + // advertiser's current floodlight configuration. You cannot unshare an + // advertiser's floodlight configuration if the shared configuration has + // activities associated with any campaign or placement. + OriginalFloodlightConfigurationId int64 `json:"originalFloodlightConfigurationId,omitempty,string"` + + // Status: Status of this advertiser. + // + // Possible values: + // "APPROVED" + // "ON_HOLD" + Status string `json:"status,omitempty"` + + // SubaccountId: Subaccount ID of this advertiser.This is a read-only + // field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // Suspended: Suspension status of this advertiser. + Suspended bool `json:"suspended,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Advertiser) MarshalJSON() ([]byte, error) { + type noMethod Advertiser + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdvertiserGroup: Groups advertisers together so that reports can be +// generated for the entire group at once. +type AdvertiserGroup struct { + // AccountId: Account ID of this advertiser group. This is a read-only + // field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // Id: ID of this advertiser group. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#advertiserGroup". + Kind string `json:"kind,omitempty"` + + // Name: Name of this advertiser group. This is a required field and + // must be less than 256 characters long and unique among advertiser + // groups of the same account. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdvertiserGroup) MarshalJSON() ([]byte, error) { + type noMethod AdvertiserGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdvertiserGroupsListResponse: Advertiser Group List Response +type AdvertiserGroupsListResponse struct { + // AdvertiserGroups: Advertiser group collection. + AdvertiserGroups []*AdvertiserGroup `json:"advertiserGroups,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#advertiserGroupsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AdvertiserGroups") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdvertiserGroupsListResponse) MarshalJSON() ([]byte, error) { + type noMethod AdvertiserGroupsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AdvertisersListResponse: Advertiser List Response +type AdvertisersListResponse struct { + // Advertisers: Advertiser collection. + Advertisers []*Advertiser `json:"advertisers,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#advertisersListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Advertisers") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdvertisersListResponse) MarshalJSON() ([]byte, error) { + type noMethod AdvertisersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AudienceSegment: Audience Segment. +type AudienceSegment struct { + // Allocation: Weight allocated to this segment. Must be between 1 and + // 1000. The weight assigned will be understood in proportion to the + // weights assigned to other segments in the same segment group. + Allocation int64 `json:"allocation,omitempty"` + + // Id: ID of this audience segment. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // Name: Name of this audience segment. This is a required field and + // must be less than 65 characters long. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Allocation") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AudienceSegment) MarshalJSON() ([]byte, error) { + type noMethod AudienceSegment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AudienceSegmentGroup: Audience Segment Group. +type AudienceSegmentGroup struct { + // AudienceSegments: Audience segments assigned to this group. The + // number of segments must be between 2 and 100. + AudienceSegments []*AudienceSegment `json:"audienceSegments,omitempty"` + + // Id: ID of this audience segment group. This is a read-only, + // auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Name: Name of this audience segment group. This is a required field + // and must be less than 65 characters long. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AudienceSegments") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AudienceSegmentGroup) MarshalJSON() ([]byte, error) { + type noMethod AudienceSegmentGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Browser: Contains information about a browser that can be targeted by +// ads. +type Browser struct { + // BrowserVersionId: ID referring to this grouping of browser and + // version numbers. This is the ID used for targeting. + BrowserVersionId int64 `json:"browserVersionId,omitempty,string"` + + // DartId: DART ID of this browser. This is the ID used when generating + // reports. + DartId int64 `json:"dartId,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#browser". + Kind string `json:"kind,omitempty"` + + // MajorVersion: Major version number (leftmost number) of this browser. + // For example, for Chrome 5.0.376.86 beta, this field should be set to + // 5. An asterisk (*) may be used to target any version number, and a + // question mark (?) may be used to target cases where the version + // number cannot be identified. For example, Chrome *.* targets any + // version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets + // Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad + // server knows the browser is Firefox but can't tell which version it + // is. + MajorVersion string `json:"majorVersion,omitempty"` + + // MinorVersion: Minor version number (number after first dot on left) + // of this browser. For example, for Chrome 5.0.375.86 beta, this field + // should be set to 0. An asterisk (*) may be used to target any version + // number, and a question mark (?) may be used to target cases where the + // version number cannot be identified. For example, Chrome *.* targets + // any version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets + // Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad + // server knows the browser is Firefox but can't tell which version it + // is. + MinorVersion string `json:"minorVersion,omitempty"` + + // Name: Name of this browser. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BrowserVersionId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Browser) MarshalJSON() ([]byte, error) { + type noMethod Browser + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BrowsersListResponse: Browser List Response +type BrowsersListResponse struct { + // Browsers: Browser collection. + Browsers []*Browser `json:"browsers,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#browsersListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Browsers") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BrowsersListResponse) MarshalJSON() ([]byte, error) { + type noMethod BrowsersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Campaign: Contains properties of a DCM campaign. +type Campaign struct { + // AccountId: Account ID of this campaign. This is a read-only field + // that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdditionalCreativeOptimizationConfigurations: Additional creative + // optimization configurations for the campaign. + AdditionalCreativeOptimizationConfigurations []*CreativeOptimizationConfiguration `json:"additionalCreativeOptimizationConfigurations,omitempty"` + + // AdvertiserGroupId: Advertiser group ID of the associated advertiser. + AdvertiserGroupId int64 `json:"advertiserGroupId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this campaign. This is a required + // field. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the advertiser ID of + // this campaign. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // Archived: Whether this campaign has been archived. + Archived bool `json:"archived,omitempty"` + + // AudienceSegmentGroups: Audience segment groups assigned to this + // campaign. Cannot have more than 300 segment groups. + AudienceSegmentGroups []*AudienceSegmentGroup `json:"audienceSegmentGroups,omitempty"` + + // BillingInvoiceCode: Billing invoice code included in the DCM client + // billing invoices associated with the campaign. + BillingInvoiceCode string `json:"billingInvoiceCode,omitempty"` + + // ClickThroughUrlSuffixProperties: Click-through URL suffix override + // properties for this campaign. + ClickThroughUrlSuffixProperties *ClickThroughUrlSuffixProperties `json:"clickThroughUrlSuffixProperties,omitempty"` + + // Comment: Arbitrary comments about this campaign. Must be less than + // 256 characters long. + Comment string `json:"comment,omitempty"` + + // ComscoreVceEnabled: Whether comScore vCE reports are enabled for this + // campaign. + ComscoreVceEnabled bool `json:"comscoreVceEnabled,omitempty"` + + // CreateInfo: Information about the creation of this campaign. This is + // a read-only field. + CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"` + + // CreativeGroupIds: List of creative group IDs that are assigned to the + // campaign. + CreativeGroupIds googleapi.Int64s `json:"creativeGroupIds,omitempty"` + + // CreativeOptimizationConfiguration: Creative optimization + // configuration for the campaign. + CreativeOptimizationConfiguration *CreativeOptimizationConfiguration `json:"creativeOptimizationConfiguration,omitempty"` + + // DefaultClickThroughEventTagProperties: Click-through event tag ID + // override properties for this campaign. + DefaultClickThroughEventTagProperties *DefaultClickThroughEventTagProperties `json:"defaultClickThroughEventTagProperties,omitempty"` + + // EndDate: Date on which the campaign will stop running. On insert, the + // end date must be today or a future date. The end date must be later + // than or be the same as the start date. If, for example, you set + // 6/25/2015 as both the start and end dates, the effective campaign run + // date is just that day only, 6/25/2015. The hours, minutes, and + // seconds of the end date should not be set, as doing so will result in + // an error. This is a required field. + EndDate string `json:"endDate,omitempty"` + + // EventTagOverrides: Overrides that can be used to activate or + // deactivate advertiser event tags. + EventTagOverrides []*EventTagOverride `json:"eventTagOverrides,omitempty"` + + // ExternalId: External ID for this campaign. + ExternalId string `json:"externalId,omitempty"` + + // Id: ID of this campaign. This is a read-only auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this campaign. This + // is a read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#campaign". + Kind string `json:"kind,omitempty"` + + // LastModifiedInfo: Information about the most recent modification of + // this campaign. This is a read-only field. + LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"` + + // LookbackConfiguration: Lookback window settings for the campaign. + LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"` + + // Name: Name of this campaign. This is a required field and must be + // less than 256 characters long and unique among campaigns of the same + // advertiser. + Name string `json:"name,omitempty"` + + // NielsenOcrEnabled: Whether Nielsen reports are enabled for this + // campaign. + NielsenOcrEnabled bool `json:"nielsenOcrEnabled,omitempty"` + + // StartDate: Date on which the campaign starts running. The start date + // can be any date. The hours, minutes, and seconds of the start date + // should not be set, as doing so will result in an error. This is a + // required field. + StartDate string `json:"startDate,omitempty"` + + // SubaccountId: Subaccount ID of this campaign. This is a read-only + // field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TraffickerEmails: Campaign trafficker contact emails. + TraffickerEmails []string `json:"traffickerEmails,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Campaign) MarshalJSON() ([]byte, error) { + type noMethod Campaign + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CampaignCreativeAssociation: Identifies a creative which has been +// associated with a given campaign. +type CampaignCreativeAssociation struct { + // CreativeId: ID of the creative associated with the campaign. This is + // a required field. + CreativeId int64 `json:"creativeId,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#campaignCreativeAssociation". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreativeId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CampaignCreativeAssociation) MarshalJSON() ([]byte, error) { + type noMethod CampaignCreativeAssociation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CampaignCreativeAssociationsListResponse: Campaign Creative +// Association List Response +type CampaignCreativeAssociationsListResponse struct { + // CampaignCreativeAssociations: Campaign creative association + // collection + CampaignCreativeAssociations []*CampaignCreativeAssociation `json:"campaignCreativeAssociations,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#campaignCreativeAssociationsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "CampaignCreativeAssociations") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CampaignCreativeAssociationsListResponse) MarshalJSON() ([]byte, error) { + type noMethod CampaignCreativeAssociationsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CampaignsListResponse: Campaign List Response +type CampaignsListResponse struct { + // Campaigns: Campaign collection. + Campaigns []*Campaign `json:"campaigns,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#campaignsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Campaigns") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CampaignsListResponse) MarshalJSON() ([]byte, error) { + type noMethod CampaignsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChangeLog: Describes a change that a user has made to a resource. +type ChangeLog struct { + // AccountId: Account ID of the modified object. + AccountId int64 `json:"accountId,omitempty,string"` + + // Action: Action which caused the change. + Action string `json:"action,omitempty"` + + // ChangeTime: Time when the object was modified. + ChangeTime string `json:"changeTime,omitempty"` + + // FieldName: Field name of the object which changed. + FieldName string `json:"fieldName,omitempty"` + + // Id: ID of this change log. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#changeLog". + Kind string `json:"kind,omitempty"` + + // NewValue: New value of the object field. + NewValue string `json:"newValue,omitempty"` + + // ObjectId: ID of the object of this change log. The object could be a + // campaign, placement, ad, or other type. + ObjectId int64 `json:"objectId,omitempty,string"` + + // ObjectType: Object type of the change log. + ObjectType string `json:"objectType,omitempty"` + + // OldValue: Old value of the object field. + OldValue string `json:"oldValue,omitempty"` + + // SubaccountId: Subaccount ID of the modified object. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TransactionId: Transaction ID of this change log. When a single API + // call results in many changes, each change will have a separate ID in + // the change log but will share the same transactionId. + TransactionId int64 `json:"transactionId,omitempty,string"` + + // UserProfileId: ID of the user who modified the object. + UserProfileId int64 `json:"userProfileId,omitempty,string"` + + // UserProfileName: User profile name of the user who modified the + // object. + UserProfileName string `json:"userProfileName,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChangeLog) MarshalJSON() ([]byte, error) { + type noMethod ChangeLog + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChangeLogsListResponse: Change Log List Response +type ChangeLogsListResponse struct { + // ChangeLogs: Change log collection. + ChangeLogs []*ChangeLog `json:"changeLogs,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#changeLogsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ChangeLogs") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChangeLogsListResponse) MarshalJSON() ([]byte, error) { + type noMethod ChangeLogsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CitiesListResponse: City List Response +type CitiesListResponse struct { + // Cities: City collection. + Cities []*City `json:"cities,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#citiesListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Cities") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CitiesListResponse) MarshalJSON() ([]byte, error) { + type noMethod CitiesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// City: Contains information about a city that can be targeted by ads. +type City struct { + // CountryCode: Country code of the country to which this city belongs. + CountryCode string `json:"countryCode,omitempty"` + + // CountryDartId: DART ID of the country to which this city belongs. + CountryDartId int64 `json:"countryDartId,omitempty,string"` + + // DartId: DART ID of this city. This is the ID used for targeting and + // generating reports. + DartId int64 `json:"dartId,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#city". + Kind string `json:"kind,omitempty"` + + // MetroCode: Metro region code of the metro region (DMA) to which this + // city belongs. + MetroCode string `json:"metroCode,omitempty"` + + // MetroDmaId: ID of the metro region (DMA) to which this city belongs. + MetroDmaId int64 `json:"metroDmaId,omitempty,string"` + + // Name: Name of this city. + Name string `json:"name,omitempty"` + + // RegionCode: Region code of the region to which this city belongs. + RegionCode string `json:"regionCode,omitempty"` + + // RegionDartId: DART ID of the region to which this city belongs. + RegionDartId int64 `json:"regionDartId,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "CountryCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *City) MarshalJSON() ([]byte, error) { + type noMethod City + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ClickTag: Creative Click Tag. +type ClickTag struct { + // EventName: Advertiser event name associated with the click tag. This + // field is used by ENHANCED_BANNER, ENHANCED_IMAGE, and HTML5_BANNER + // creatives. + EventName string `json:"eventName,omitempty"` + + // Name: Parameter name for the specified click tag. For ENHANCED_IMAGE + // creative assets, this field must match the value of the creative + // asset's creativeAssetId.name field. + Name string `json:"name,omitempty"` + + // Value: Parameter value for the specified click tag. This field + // contains a click-through url. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "EventName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ClickTag) MarshalJSON() ([]byte, error) { + type noMethod ClickTag + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ClickThroughUrl: Click-through URL +type ClickThroughUrl struct { + // ComputedClickThroughUrl: Read-only convenience field representing the + // actual URL that will be used for this click-through. The URL is + // computed as follows: + // - If defaultLandingPage is enabled then the campaign's default + // landing page URL is assigned to this field. + // - If defaultLandingPage is not enabled and a landingPageId is + // specified then that landing page's URL is assigned to this field. + // - If neither of the above cases apply, then the customClickThroughUrl + // is assigned to this field. + ComputedClickThroughUrl string `json:"computedClickThroughUrl,omitempty"` + + // CustomClickThroughUrl: Custom click-through URL. Applicable if the + // defaultLandingPage field is set to false and the landingPageId field + // is left unset. + CustomClickThroughUrl string `json:"customClickThroughUrl,omitempty"` + + // DefaultLandingPage: Whether the campaign default landing page is + // used. + DefaultLandingPage bool `json:"defaultLandingPage,omitempty"` + + // LandingPageId: ID of the landing page for the click-through URL. + // Applicable if the defaultLandingPage field is set to false. + LandingPageId int64 `json:"landingPageId,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. + // "ComputedClickThroughUrl") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ClickThroughUrl) MarshalJSON() ([]byte, error) { + type noMethod ClickThroughUrl + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ClickThroughUrlSuffixProperties: Click Through URL Suffix settings. +type ClickThroughUrlSuffixProperties struct { + // ClickThroughUrlSuffix: Click-through URL suffix to apply to all ads + // in this entity's scope. Must be less than 128 characters long. + ClickThroughUrlSuffix string `json:"clickThroughUrlSuffix,omitempty"` + + // OverrideInheritedSuffix: Whether this entity should override the + // inherited click-through URL suffix with its own defined value. + OverrideInheritedSuffix bool `json:"overrideInheritedSuffix,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "ClickThroughUrlSuffix") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ClickThroughUrlSuffixProperties) MarshalJSON() ([]byte, error) { + type noMethod ClickThroughUrlSuffixProperties + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CompanionClickThroughOverride: Companion Click-through override. +type CompanionClickThroughOverride struct { + // ClickThroughUrl: Click-through URL of this companion click-through + // override. + ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"` + + // CreativeId: ID of the creative for this companion click-through + // override. + CreativeId int64 `json:"creativeId,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CompanionClickThroughOverride) MarshalJSON() ([]byte, error) { + type noMethod CompanionClickThroughOverride + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CompatibleFields: Represents a response to the queryCompatibleFields +// method. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "CrossDimensionReachReportCompatibleFields") to unconditionally + // include in API requests. By default, fields with empty values are + // omitted from API requests. However, any non-pointer, non-interface + // field appearing in ForceSendFields will be sent to the server + // regardless of whether the field is empty or not. This may be used to + // include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CompatibleFields) MarshalJSON() ([]byte, error) { + type noMethod CompatibleFields + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ConnectionType: Contains information about an internet connection +// type that can be targeted by ads. Clients can use the connection type +// to target mobile vs. broadband users. +type ConnectionType struct { + // Id: ID of this connection type. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#connectionType". + Kind string `json:"kind,omitempty"` + + // Name: Name of this connection type. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ConnectionType) MarshalJSON() ([]byte, error) { + type noMethod ConnectionType + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ConnectionTypesListResponse: Connection Type List Response +type ConnectionTypesListResponse struct { + // ConnectionTypes: Collection of connection types such as broadband and + // mobile. + ConnectionTypes []*ConnectionType `json:"connectionTypes,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#connectionTypesListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ConnectionTypes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ConnectionTypesListResponse) MarshalJSON() ([]byte, error) { + type noMethod ConnectionTypesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ContentCategoriesListResponse: Content Category List Response +type ContentCategoriesListResponse struct { + // ContentCategories: Content category collection. + ContentCategories []*ContentCategory `json:"contentCategories,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#contentCategoriesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ContentCategories") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ContentCategoriesListResponse) MarshalJSON() ([]byte, error) { + type noMethod ContentCategoriesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ContentCategory: Organizes placements according to the contents of +// their associated webpages. +type ContentCategory struct { + // AccountId: Account ID of this content category. This is a read-only + // field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // Id: ID of this content category. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#contentCategory". + Kind string `json:"kind,omitempty"` + + // Name: Name of this content category. This is a required field and + // must be less than 256 characters long and unique among content + // categories of the same account. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ContentCategory) MarshalJSON() ([]byte, error) { + type noMethod ContentCategory + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CountriesListResponse: Country List Response +type CountriesListResponse struct { + // Countries: Country collection. + Countries []*Country `json:"countries,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#countriesListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Countries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CountriesListResponse) MarshalJSON() ([]byte, error) { + type noMethod CountriesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Country: Contains information about a country that can be targeted by +// ads. +type Country struct { + // CountryCode: Country code. + CountryCode string `json:"countryCode,omitempty"` + + // DartId: DART ID of this country. This is the ID used for targeting + // and generating reports. + DartId int64 `json:"dartId,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#country". + Kind string `json:"kind,omitempty"` + + // Name: Name of this country. + Name string `json:"name,omitempty"` + + // SslEnabled: Whether ad serving supports secure servers in this + // country. + SslEnabled bool `json:"sslEnabled,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CountryCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Country) MarshalJSON() ([]byte, error) { + type noMethod Country + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Creative: Contains properties of a Creative. +type Creative struct { + // AccountId: Account ID of this creative. This field, if left unset, + // will be auto-generated for both insert and update operations. + // Applicable to all creative types. + AccountId int64 `json:"accountId,omitempty,string"` + + // Active: Whether the creative is active. Applicable to all creative + // types. + Active bool `json:"active,omitempty"` + + // AdParameters: Ad parameters user for VPAID creative. This is a + // read-only field. Applicable to the following creative types: all + // VPAID. + AdParameters string `json:"adParameters,omitempty"` + + // AdTagKeys: Keywords for a Rich Media creative. Keywords let you + // customize the creative settings of a Rich Media ad running on your + // site without having to contact the advertiser. You can use keywords + // to dynamically change the look or functionality of a creative. + // Applicable to the following creative types: all RICH_MEDIA, and all + // VPAID. + AdTagKeys []string `json:"adTagKeys,omitempty"` + + // AdvertiserId: Advertiser ID of this creative. This is a required + // field. Applicable to all creative types. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AllowScriptAccess: Whether script access is allowed for this + // creative. This is a read-only and deprecated field which will + // automatically be set to true on update. Applicable to the following + // creative types: FLASH_INPAGE. + AllowScriptAccess bool `json:"allowScriptAccess,omitempty"` + + // Archived: Whether the creative is archived. Applicable to all + // creative types. + Archived bool `json:"archived,omitempty"` + + // ArtworkType: Type of artwork used for the creative. This is a + // read-only field. Applicable to the following creative types: all + // RICH_MEDIA, and all VPAID. + // + // Possible values: + // "ARTWORK_TYPE_FLASH" + // "ARTWORK_TYPE_HTML5" + // "ARTWORK_TYPE_MIXED" + ArtworkType string `json:"artworkType,omitempty"` + + // AuthoringTool: Authoring tool for HTML5 banner creatives. This is a + // read-only field. Applicable to the following creative types: + // HTML5_BANNER. + // + // Possible values: + // "NINJA" + // "SWIFFY" + AuthoringTool string `json:"authoringTool,omitempty"` + + // AutoAdvanceImages: Whether images are automatically advanced for + // enhanced image creatives. Applicable to the following creative types: + // ENHANCED_IMAGE. + AutoAdvanceImages bool `json:"auto_advance_images,omitempty"` + + // BackgroundColor: The 6-character HTML color code, beginning with #, + // for the background of the window area where the Flash file is + // displayed. Default is white. Applicable to the following creative + // types: FLASH_INPAGE. + BackgroundColor string `json:"backgroundColor,omitempty"` + + // BackupImageClickThroughUrl: Click-through URL for backup image. + // Applicable to the following creative types: ENHANCED_BANNER, + // FLASH_INPAGE, and HTML5_BANNER. + BackupImageClickThroughUrl string `json:"backupImageClickThroughUrl,omitempty"` + + // BackupImageFeatures: List of feature dependencies that will cause a + // backup image to be served if the browser that serves the ad does not + // support them. Feature dependencies are features that a browser must + // be able to support in order to render your HTML5 creative asset + // correctly. This field is initially auto-generated to contain all + // features detected by DCM for all the assets of this creative and can + // then be modified by the client. To reset this field, copy over all + // the creativeAssets' detected features. Applicable to the following + // creative types: ENHANCED_BANNER and HTML5_BANNER. + // + // Possible values: + // "APPLICATION_CACHE" + // "AUDIO" + // "CANVAS" + // "CANVAS_TEXT" + // "CSS_ANIMATIONS" + // "CSS_BACKGROUND_SIZE" + // "CSS_BORDER_IMAGE" + // "CSS_BORDER_RADIUS" + // "CSS_BOX_SHADOW" + // "CSS_COLUMNS" + // "CSS_FLEX_BOX" + // "CSS_FONT_FACE" + // "CSS_GENERATED_CONTENT" + // "CSS_GRADIENTS" + // "CSS_HSLA" + // "CSS_MULTIPLE_BGS" + // "CSS_OPACITY" + // "CSS_REFLECTIONS" + // "CSS_RGBA" + // "CSS_TEXT_SHADOW" + // "CSS_TRANSFORMS" + // "CSS_TRANSFORMS3D" + // "CSS_TRANSITIONS" + // "DRAG_AND_DROP" + // "GEO_LOCATION" + // "HASH_CHANGE" + // "HISTORY" + // "INDEXED_DB" + // "INLINE_SVG" + // "INPUT_ATTR_AUTOCOMPLETE" + // "INPUT_ATTR_AUTOFOCUS" + // "INPUT_ATTR_LIST" + // "INPUT_ATTR_MAX" + // "INPUT_ATTR_MIN" + // "INPUT_ATTR_MULTIPLE" + // "INPUT_ATTR_PATTERN" + // "INPUT_ATTR_PLACEHOLDER" + // "INPUT_ATTR_REQUIRED" + // "INPUT_ATTR_STEP" + // "INPUT_TYPE_COLOR" + // "INPUT_TYPE_DATE" + // "INPUT_TYPE_DATETIME" + // "INPUT_TYPE_DATETIME_LOCAL" + // "INPUT_TYPE_EMAIL" + // "INPUT_TYPE_MONTH" + // "INPUT_TYPE_NUMBER" + // "INPUT_TYPE_RANGE" + // "INPUT_TYPE_SEARCH" + // "INPUT_TYPE_TEL" + // "INPUT_TYPE_TIME" + // "INPUT_TYPE_URL" + // "INPUT_TYPE_WEEK" + // "LOCAL_STORAGE" + // "POST_MESSAGE" + // "SESSION_STORAGE" + // "SMIL" + // "SVG_CLIP_PATHS" + // "SVG_FE_IMAGE" + // "SVG_FILTERS" + // "SVG_HREF" + // "TOUCH" + // "VIDEO" + // "WEBGL" + // "WEB_SOCKETS" + // "WEB_SQL_DATABASE" + // "WEB_WORKERS" + BackupImageFeatures []string `json:"backupImageFeatures,omitempty"` + + // BackupImageReportingLabel: Reporting label used for HTML5 banner + // backup image. Applicable to the following creative types: + // ENHANCED_BANNER. + BackupImageReportingLabel string `json:"backupImageReportingLabel,omitempty"` + + // BackupImageTargetWindow: Target window for backup image. Applicable + // to the following creative types: ENHANCED_BANNER, FLASH_INPAGE, and + // HTML5_BANNER. + BackupImageTargetWindow *TargetWindow `json:"backupImageTargetWindow,omitempty"` + + // ClickTags: Click tags of the creative. For ENHANCED_BANNER, + // FLASH_INPAGE, and HTML5_BANNER creatives, this is a subset of + // detected click tags for the assets associated with this creative. + // After creating a flash asset, detected click tags will be returned in + // the creativeAssetMetadata. When inserting the creative, populate the + // creative clickTags field using the creativeAssetMetadata.clickTags + // field. For ENHANCED_IMAGE creatives, there should be exactly one + // entry in this list for each image creative asset. A click tag is + // matched with a corresponding creative asset by matching the + // clickTag.name field with the creativeAsset.assetIdentifier.name + // field. Applicable to the following creative types: ENHANCED_BANNER, + // ENHANCED_IMAGE, FLASH_INPAGE, HTML5_BANNER. + ClickTags []*ClickTag `json:"clickTags,omitempty"` + + // CommercialId: Industry standard ID assigned to creative for reach and + // frequency. Applicable to the following creative types: INSTREAM_VIDEO + // and all VPAID. + CommercialId string `json:"commercialId,omitempty"` + + // CompanionCreatives: List of companion creatives assigned to an + // in-Stream videocreative. Acceptable values include IDs of existing + // flash and image creatives. Applicable to the following creative + // types: INSTREAM_VIDEO and all VPAID. + CompanionCreatives googleapi.Int64s `json:"companionCreatives,omitempty"` + + // Compatibility: Compatibilities associated with this creative. This is + // a read-only field. WEB and WEB_INTERSTITIAL refer to rendering either + // on desktop or on mobile devices for regular or interstitial ads, + // respectively. APP and APP_INTERSTITIAL are for rendering in mobile + // apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads + // developed with the VAST standard. Applicable to all creative + // types. + // + // Acceptable values are: + // - "APP" + // - "APP_INTERSTITIAL" + // - "IN_STREAM_VIDEO" + // - "WEB" + // - "WEB_INTERSTITIAL" + // + // Possible values: + // "APP" + // "APP_INTERSTITIAL" + // "IN_STREAM_VIDEO" + // "WEB" + // "WEB_INTERSTITIAL" + Compatibility []string `json:"compatibility,omitempty"` + + // ConvertFlashToHtml5: Whether Flash assets associated with the + // creative need to be automatically converted to HTML5. This flag is + // enabled by default and users can choose to disable it if they don't + // want the system to generate and use HTML5 asset for this creative. + // Applicable to the following creative types: ENHANCED_BANNER and + // FLASH_INPAGE. + ConvertFlashToHtml5 bool `json:"convertFlashToHtml5,omitempty"` + + // CounterCustomEvents: List of counter events configured for the + // creative. Applicable to the following creative types: all RICH_MEDIA, + // and all VPAID. + CounterCustomEvents []*CreativeCustomEvent `json:"counterCustomEvents,omitempty"` + + // CreativeAssets: Assets associated with a creative. Applicable to all + // but the following creative types: INTERNAL_REDIRECT, + // INTERSTITIAL_INTERNAL_REDIRECT, and REDIRECT + CreativeAssets []*CreativeAsset `json:"creativeAssets,omitempty"` + + // CreativeFieldAssignments: Creative field assignments for this + // creative. Applicable to all creative types. + CreativeFieldAssignments []*CreativeFieldAssignment `json:"creativeFieldAssignments,omitempty"` + + // CustomKeyValues: Custom key-values for a Rich Media creative. + // Key-values let you customize the creative settings of a Rich Media ad + // running on your site without having to contact the advertiser. You + // can use key-values to dynamically change the look or functionality of + // a creative. Applicable to the following creative types: all + // RICH_MEDIA, and all VPAID. + CustomKeyValues []string `json:"customKeyValues,omitempty"` + + // ExitCustomEvents: List of exit events configured for the creative. + // Applicable to the following creative types: all RICH_MEDIA, and all + // VPAID. + ExitCustomEvents []*CreativeCustomEvent `json:"exitCustomEvents,omitempty"` + + // FsCommand: OpenWindow FSCommand of this creative. This lets the SWF + // file communicate with either Flash Player or the program hosting + // Flash Player, such as a web browser. This is only triggered if + // allowScriptAccess field is true. Applicable to the following creative + // types: FLASH_INPAGE. + FsCommand *FsCommand `json:"fsCommand,omitempty"` + + // HtmlCode: HTML code for the creative. This is a required field when + // applicable. This field is ignored if htmlCodeLocked is false. + // Applicable to the following creative types: all CUSTOM, FLASH_INPAGE, + // and HTML5_BANNER, and all RICH_MEDIA. + HtmlCode string `json:"htmlCode,omitempty"` + + // HtmlCodeLocked: Whether HTML code is DCM-generated or manually + // entered. Set to true to ignore changes to htmlCode. Applicable to the + // following creative types: FLASH_INPAGE and HTML5_BANNER. + HtmlCodeLocked bool `json:"htmlCodeLocked,omitempty"` + + // Id: ID of this creative. This is a read-only, auto-generated field. + // Applicable to all creative types. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this creative. This + // is a read-only field. Applicable to all creative types. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creative". + Kind string `json:"kind,omitempty"` + + // LastModifiedInfo: Creative last modification information. This is a + // read-only field. Applicable to all creative types. + LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"` + + // LatestTraffickedCreativeId: Latest Studio trafficked creative ID + // associated with rich media and VPAID creatives. This is a read-only + // field. Applicable to the following creative types: all RICH_MEDIA, + // and all VPAID. + LatestTraffickedCreativeId int64 `json:"latestTraffickedCreativeId,omitempty,string"` + + // Name: Name of the creative. This is a required field and must be less + // than 256 characters long. Applicable to all creative types. + Name string `json:"name,omitempty"` + + // OverrideCss: Override CSS value for rich media creatives. Applicable + // to the following creative types: all RICH_MEDIA. + OverrideCss string `json:"overrideCss,omitempty"` + + // RedirectUrl: URL of hosted image or another ad tag. This is a + // required field when applicable. Applicable to the following creative + // types: INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and + // REDIRECT + RedirectUrl string `json:"redirectUrl,omitempty"` + + // RenderingId: ID of current rendering version. This is a read-only + // field. Applicable to all creative types. + RenderingId int64 `json:"renderingId,omitempty,string"` + + // RenderingIdDimensionValue: Dimension value for the rendering ID of + // this creative. This is a read-only field. Applicable to all creative + // types. + RenderingIdDimensionValue *DimensionValue `json:"renderingIdDimensionValue,omitempty"` + + // RequiredFlashPluginVersion: The minimum required Flash plugin version + // for this creative. For example, 11.2.202.235. This is a read-only + // field. Applicable to the following creative types: all RICH_MEDIA, + // and all VPAID. + RequiredFlashPluginVersion string `json:"requiredFlashPluginVersion,omitempty"` + + // RequiredFlashVersion: The internal Flash version for this creative as + // calculated by DoubleClick Studio. This is a read-only field. + // Applicable to the following creative types: FLASH_INPAGE, + // ENHANCED_BANNER, all RICH_MEDIA, and all VPAID. + RequiredFlashVersion int64 `json:"requiredFlashVersion,omitempty"` + + // Size: Size associated with this creative. When inserting or updating + // a creative either the size ID field or size width and height fields + // can be used. This is a required field when applicable; however for + // IMAGE and FLASH_INPAGE creatives, if left blank, this field will be + // automatically set using the actual size of the associated image + // assets. Applicable to the following creative types: ENHANCED_BANNER, + // ENHANCED_IMAGE, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all + // RICH_MEDIA. + Size *Size `json:"size,omitempty"` + + // Skippable: Whether the user can choose to skip the creative. + // Applicable to the following creative types: INSTREAM_VIDEO. + Skippable bool `json:"skippable,omitempty"` + + // SslCompliant: Whether the creative is SSL-compliant. This is a + // read-only field. Applicable to all creative types. + SslCompliant bool `json:"sslCompliant,omitempty"` + + // SslOverride: Whether creative should be treated as SSL compliant even + // if the system scan shows it's not. + SslOverride bool `json:"sslOverride,omitempty"` + + // StudioAdvertiserId: Studio advertiser ID associated with rich media + // and VPAID creatives. This is a read-only field. Applicable to the + // following creative types: all RICH_MEDIA, and all VPAID. + StudioAdvertiserId int64 `json:"studioAdvertiserId,omitempty,string"` + + // StudioCreativeId: Studio creative ID associated with rich media and + // VPAID creatives. This is a read-only field. Applicable to the + // following creative types: all RICH_MEDIA, and all VPAID. + StudioCreativeId int64 `json:"studioCreativeId,omitempty,string"` + + // StudioTraffickedCreativeId: Studio trafficked creative ID associated + // with rich media and VPAID creatives. This is a read-only field. + // Applicable to the following creative types: all RICH_MEDIA, and all + // VPAID. + StudioTraffickedCreativeId int64 `json:"studioTraffickedCreativeId,omitempty,string"` + + // SubaccountId: Subaccount ID of this creative. This field, if left + // unset, will be auto-generated for both insert and update operations. + // Applicable to all creative types. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // ThirdPartyBackupImageImpressionsUrl: Third-party URL used to record + // backup image impressions. Applicable to the following creative types: + // all RICH_MEDIA + ThirdPartyBackupImageImpressionsUrl string `json:"thirdPartyBackupImageImpressionsUrl,omitempty"` + + // ThirdPartyRichMediaImpressionsUrl: Third-party URL used to record + // rich media impressions. Applicable to the following creative types: + // all RICH_MEDIA + ThirdPartyRichMediaImpressionsUrl string `json:"thirdPartyRichMediaImpressionsUrl,omitempty"` + + // ThirdPartyUrls: Third-party URLs for tracking in-stream video + // creative events. Applicable to the following creative types: + // INSTREAM_VIDEO and all VPAID. + ThirdPartyUrls []*ThirdPartyTrackingUrl `json:"thirdPartyUrls,omitempty"` + + // TimerCustomEvents: List of timer events configured for the creative. + // Applicable to the following creative types: all RICH_MEDIA, and all + // VPAID. + TimerCustomEvents []*CreativeCustomEvent `json:"timerCustomEvents,omitempty"` + + // TotalFileSize: Combined size of all creative assets. This is a + // read-only field. Applicable to the following creative types: all + // RICH_MEDIA, and all VPAID. + TotalFileSize int64 `json:"totalFileSize,omitempty,string"` + + // Type: Type of this creative.This is a required field. Applicable to + // all creative types. + // + // Possible values: + // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO" + // "CUSTOM_INPAGE" + // "CUSTOM_INTERSTITIAL" + // "ENHANCED_BANNER" + // "ENHANCED_IMAGE" + // "FLASH_INPAGE" + // "HTML5_BANNER" + // "IMAGE" + // "INSTREAM_VIDEO" + // "INTERNAL_REDIRECT" + // "INTERSTITIAL_INTERNAL_REDIRECT" + // "REDIRECT" + // "RICH_MEDIA_EXPANDING" + // "RICH_MEDIA_IM_EXPAND" + // "RICH_MEDIA_INPAGE" + // "RICH_MEDIA_INPAGE_FLOATING" + // "RICH_MEDIA_INTERSTITIAL_FLOAT" + // "RICH_MEDIA_MOBILE_IN_APP" + // "RICH_MEDIA_MULTI_FLOATING" + // "RICH_MEDIA_PEEL_DOWN" + // "TRACKING_TEXT" + // "VAST_REDIRECT" + // "VPAID_LINEAR" + // "VPAID_NON_LINEAR" + Type string `json:"type,omitempty"` + + // Version: The version number helps you keep track of multiple versions + // of your creative in your reports. The version number will always be + // auto-generated during insert operations to start at 1. For tracking + // creatives the version cannot be incremented and will always remain at + // 1. For all other creative types the version can be incremented only + // by 1 during update operations. In addition, the version will be + // automatically incremented by 1 when undergoing Rich Media creative + // merging. Applicable to all creative types. + Version int64 `json:"version,omitempty"` + + // VideoDescription: Description of the video ad. Applicable to the + // following creative types: INSTREAM_VIDEO and all VPAID. + VideoDescription string `json:"videoDescription,omitempty"` + + // VideoDuration: Creative video duration in seconds. This is a + // read-only field. Applicable to the following creative types: + // INSTREAM_VIDEO, all RICH_MEDIA, and all VPAID. + VideoDuration float64 `json:"videoDuration,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Creative) MarshalJSON() ([]byte, error) { + type noMethod Creative + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeAsset: Creative Asset. +type CreativeAsset struct { + // ActionScript3: Whether ActionScript3 is enabled for the flash asset. + // This is a read-only field. Applicable to the following creative + // types: FLASH_INPAGE and ENHANCED_BANNER. + ActionScript3 bool `json:"actionScript3,omitempty"` + + // Active: Whether the video asset is active. This is a read-only field + // for VPAID_NON_LINEAR assets. Applicable to the following creative + // types: INSTREAM_VIDEO and all VPAID. + Active bool `json:"active,omitempty"` + + // Alignment: Possible alignments for an asset. This is a read-only + // field. Applicable to the following creative types: + // RICH_MEDIA_MULTI_FLOATING. + // + // Possible values: + // "ALIGNMENT_BOTTOM" + // "ALIGNMENT_LEFT" + // "ALIGNMENT_RIGHT" + // "ALIGNMENT_TOP" + Alignment string `json:"alignment,omitempty"` + + // ArtworkType: Artwork type of rich media creative. This is a read-only + // field. Applicable to the following creative types: all RICH_MEDIA. + // + // Possible values: + // "ARTWORK_TYPE_FLASH" + // "ARTWORK_TYPE_HTML5" + // "ARTWORK_TYPE_MIXED" + ArtworkType string `json:"artworkType,omitempty"` + + // AssetIdentifier: Identifier of this asset. This is the same + // identifier returned during creative asset insert operation. This is a + // required field. Applicable to all but the following creative types: + // all REDIRECT and TRACKING_TEXT. + AssetIdentifier *CreativeAssetId `json:"assetIdentifier,omitempty"` + + // BackupImageExit: Exit event configured for the backup image. + // Applicable to the following creative types: all RICH_MEDIA. + BackupImageExit *CreativeCustomEvent `json:"backupImageExit,omitempty"` + + // BitRate: Detected bit-rate for video asset. This is a read-only + // field. Applicable to the following creative types: INSTREAM_VIDEO and + // all VPAID. + BitRate int64 `json:"bitRate,omitempty"` + + // ChildAssetType: Rich media child asset type. This is a read-only + // field. Applicable to the following creative types: all VPAID. + // + // Possible values: + // "CHILD_ASSET_TYPE_DATA" + // "CHILD_ASSET_TYPE_FLASH" + // "CHILD_ASSET_TYPE_IMAGE" + // "CHILD_ASSET_TYPE_VIDEO" + ChildAssetType string `json:"childAssetType,omitempty"` + + // CollapsedSize: Size of an asset when collapsed. This is a read-only + // field. Applicable to the following creative types: all RICH_MEDIA and + // all VPAID. Additionally, applicable to assets whose displayType is + // ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN. + CollapsedSize *Size `json:"collapsedSize,omitempty"` + + // CustomStartTimeValue: Custom start time in seconds for making the + // asset visible. Applicable to the following creative types: all + // RICH_MEDIA. + CustomStartTimeValue int64 `json:"customStartTimeValue,omitempty"` + + // DetectedFeatures: List of feature dependencies for the creative asset + // that are detected by DCM. Feature dependencies are features that a + // browser must be able to support in order to render your HTML5 + // creative correctly. This is a read-only, auto-generated field. + // Applicable to the following creative types: ENHANCED_BANNER and + // HTML5_BANNER. + // + // Possible values: + // "APPLICATION_CACHE" + // "AUDIO" + // "CANVAS" + // "CANVAS_TEXT" + // "CSS_ANIMATIONS" + // "CSS_BACKGROUND_SIZE" + // "CSS_BORDER_IMAGE" + // "CSS_BORDER_RADIUS" + // "CSS_BOX_SHADOW" + // "CSS_COLUMNS" + // "CSS_FLEX_BOX" + // "CSS_FONT_FACE" + // "CSS_GENERATED_CONTENT" + // "CSS_GRADIENTS" + // "CSS_HSLA" + // "CSS_MULTIPLE_BGS" + // "CSS_OPACITY" + // "CSS_REFLECTIONS" + // "CSS_RGBA" + // "CSS_TEXT_SHADOW" + // "CSS_TRANSFORMS" + // "CSS_TRANSFORMS3D" + // "CSS_TRANSITIONS" + // "DRAG_AND_DROP" + // "GEO_LOCATION" + // "HASH_CHANGE" + // "HISTORY" + // "INDEXED_DB" + // "INLINE_SVG" + // "INPUT_ATTR_AUTOCOMPLETE" + // "INPUT_ATTR_AUTOFOCUS" + // "INPUT_ATTR_LIST" + // "INPUT_ATTR_MAX" + // "INPUT_ATTR_MIN" + // "INPUT_ATTR_MULTIPLE" + // "INPUT_ATTR_PATTERN" + // "INPUT_ATTR_PLACEHOLDER" + // "INPUT_ATTR_REQUIRED" + // "INPUT_ATTR_STEP" + // "INPUT_TYPE_COLOR" + // "INPUT_TYPE_DATE" + // "INPUT_TYPE_DATETIME" + // "INPUT_TYPE_DATETIME_LOCAL" + // "INPUT_TYPE_EMAIL" + // "INPUT_TYPE_MONTH" + // "INPUT_TYPE_NUMBER" + // "INPUT_TYPE_RANGE" + // "INPUT_TYPE_SEARCH" + // "INPUT_TYPE_TEL" + // "INPUT_TYPE_TIME" + // "INPUT_TYPE_URL" + // "INPUT_TYPE_WEEK" + // "LOCAL_STORAGE" + // "POST_MESSAGE" + // "SESSION_STORAGE" + // "SMIL" + // "SVG_CLIP_PATHS" + // "SVG_FE_IMAGE" + // "SVG_FILTERS" + // "SVG_HREF" + // "TOUCH" + // "VIDEO" + // "WEBGL" + // "WEB_SOCKETS" + // "WEB_SQL_DATABASE" + // "WEB_WORKERS" + DetectedFeatures []string `json:"detectedFeatures,omitempty"` + + // DisplayType: Type of rich media asset. This is a read-only field. + // Applicable to the following creative types: all RICH_MEDIA. + // + // Possible values: + // "ASSET_DISPLAY_TYPE_EXPANDING" + // "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH" + // "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH_EXPANDING" + // "ASSET_DISPLAY_TYPE_FLOATING" + // "ASSET_DISPLAY_TYPE_INPAGE" + // "ASSET_DISPLAY_TYPE_OVERLAY" + // "ASSET_DISPLAY_TYPE_PEEL_DOWN" + // "ASSET_DISPLAY_TYPE_VPAID_LINEAR" + // "ASSET_DISPLAY_TYPE_VPAID_NON_LINEAR" + DisplayType string `json:"displayType,omitempty"` + + // Duration: Duration in seconds for which an asset will be displayed. + // Applicable to the following creative types: INSTREAM_VIDEO and + // VPAID_LINEAR. + Duration int64 `json:"duration,omitempty"` + + // DurationType: Duration type for which an asset will be displayed. + // Applicable to the following creative types: all RICH_MEDIA. + // + // Possible values: + // "ASSET_DURATION_TYPE_AUTO" + // "ASSET_DURATION_TYPE_CUSTOM" + // "ASSET_DURATION_TYPE_NONE" + DurationType string `json:"durationType,omitempty"` + + // ExpandedDimension: Detected expanded dimension for video asset. This + // is a read-only field. Applicable to the following creative types: + // INSTREAM_VIDEO and all VPAID. + ExpandedDimension *Size `json:"expandedDimension,omitempty"` + + // FileSize: File size associated with this creative asset. This is a + // read-only field. Applicable to all but the following creative types: + // all REDIRECT and TRACKING_TEXT. + FileSize int64 `json:"fileSize,omitempty,string"` + + // FlashVersion: Flash version of the asset. This is a read-only field. + // Applicable to the following creative types: FLASH_INPAGE, + // ENHANCED_BANNER, all RICH_MEDIA, and all VPAID. + FlashVersion int64 `json:"flashVersion,omitempty"` + + // HideFlashObjects: Whether to hide Flash objects flag for an asset. + // Applicable to the following creative types: all RICH_MEDIA. + HideFlashObjects bool `json:"hideFlashObjects,omitempty"` + + // HideSelectionBoxes: Whether to hide selection boxes flag for an + // asset. Applicable to the following creative types: all RICH_MEDIA. + HideSelectionBoxes bool `json:"hideSelectionBoxes,omitempty"` + + // HorizontallyLocked: Whether the asset is horizontally locked. This is + // a read-only field. Applicable to the following creative types: all + // RICH_MEDIA. + HorizontallyLocked bool `json:"horizontallyLocked,omitempty"` + + // Id: Numeric ID of this creative asset. This is a required field and + // should not be modified. Applicable to all but the following creative + // types: all REDIRECT and TRACKING_TEXT. + Id int64 `json:"id,omitempty,string"` + + // MimeType: Detected MIME type for video asset. This is a read-only + // field. Applicable to the following creative types: INSTREAM_VIDEO and + // all VPAID. + MimeType string `json:"mimeType,omitempty"` + + // Offset: Offset position for an asset in collapsed mode. This is a + // read-only field. Applicable to the following creative types: all + // RICH_MEDIA and all VPAID. Additionally, only applicable to assets + // whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or + // ASSET_DISPLAY_TYPE_PEEL_DOWN. + Offset *OffsetPosition `json:"offset,omitempty"` + + // OriginalBackup: Whether the backup asset is original or changed by + // the user in DCM. Applicable to the following creative types: all + // RICH_MEDIA. + OriginalBackup bool `json:"originalBackup,omitempty"` + + // Position: Offset position for an asset. Applicable to the following + // creative types: all RICH_MEDIA. + Position *OffsetPosition `json:"position,omitempty"` + + // PositionLeftUnit: Offset left unit for an asset. This is a read-only + // field. Applicable to the following creative types: all RICH_MEDIA. + // + // Possible values: + // "OFFSET_UNIT_PERCENT" + // "OFFSET_UNIT_PIXEL" + // "OFFSET_UNIT_PIXEL_FROM_CENTER" + PositionLeftUnit string `json:"positionLeftUnit,omitempty"` + + // PositionTopUnit: Offset top unit for an asset. This is a read-only + // field if the asset displayType is ASSET_DISPLAY_TYPE_OVERLAY. + // Applicable to the following creative types: all RICH_MEDIA. + // + // Possible values: + // "OFFSET_UNIT_PERCENT" + // "OFFSET_UNIT_PIXEL" + // "OFFSET_UNIT_PIXEL_FROM_CENTER" + PositionTopUnit string `json:"positionTopUnit,omitempty"` + + // ProgressiveServingUrl: Progressive URL for video asset. This is a + // read-only field. Applicable to the following creative types: + // INSTREAM_VIDEO and all VPAID. + ProgressiveServingUrl string `json:"progressiveServingUrl,omitempty"` + + // Pushdown: Whether the asset pushes down other content. Applicable to + // the following creative types: all RICH_MEDIA. Additionally, only + // applicable when the asset offsets are 0, the collapsedSize.width + // matches size.width, and the collapsedSize.height is less than + // size.height. + Pushdown bool `json:"pushdown,omitempty"` + + // PushdownDuration: Pushdown duration in seconds for an asset. Must be + // between 0 and 9.99. Applicable to the following creative types: all + // RICH_MEDIA.Additionally, only applicable when the asset pushdown + // field is true, the offsets are 0, the collapsedSize.width matches + // size.width, and the collapsedSize.height is less than size.height. + PushdownDuration float64 `json:"pushdownDuration,omitempty"` + + // Role: Role of the asset in relation to creative. Applicable to all + // but the following creative types: all REDIRECT and TRACKING_TEXT. + // This is a required field. + // PRIMARY applies to ENHANCED_BANNER, FLASH_INPAGE, HTML5_BANNER, + // IMAGE, IMAGE_GALLERY, all RICH_MEDIA (which may contain multiple + // primary assets), and all VPAID creatives. + // BACKUP_IMAGE applies to ENHANCED_BANNER, FLASH_INPAGE, HTML5_BANNER, + // all RICH_MEDIA, and all VPAID creatives. + // ADDITIONAL_IMAGE and ADDITIONAL_FLASH apply to FLASH_INPAGE + // creatives. + // OTHER refers to assets from sources other than DCM, such as Studio + // uploaded assets, applicable to all RICH_MEDIA and all VPAID + // creatives. + // PARENT_VIDEO refers to videos uploaded by the user in DCM and is + // applicable to INSTREAM_VIDEO and VPAID_LINEAR + // creatives. + // TRANSCODED_VIDEO refers to videos transcoded by DCM from PARENT_VIDEO + // assets and is applicable to INSTREAM_VIDEO and VPAID_LINEAR + // creatives. + // ALTERNATE_VIDEO refers to the DCM representation of child asset + // videos from Studio, and is applicable to VPAID_LINEAR creatives. + // These cannot be added or removed within DCM. + // For VPAID_LINEAR creatives, PARENT_VIDEO, TRANSCODED_VIDEO and + // ALTERNATE_VIDEO assets that are marked active serve as backup in case + // the VPAID creative cannot be served. Only PARENT_VIDEO assets can be + // added or removed for an INSTREAM_VIDEO or VPAID_LINEAR creative. + // + // Possible values: + // "ADDITIONAL_FLASH" + // "ADDITIONAL_IMAGE" + // "ALTERNATE_VIDEO" + // "BACKUP_IMAGE" + // "OTHER" + // "PARENT_VIDEO" + // "PRIMARY" + // "TRANSCODED_VIDEO" + Role string `json:"role,omitempty"` + + // Size: Size associated with this creative asset. This is a required + // field when applicable; however for IMAGE and FLASH_INPAGE creatives, + // if left blank, this field will be automatically set using the actual + // size of the associated image asset. Applicable to the following + // creative types: ENHANCED_BANNER, ENHANCED_IMAGE, FLASH_INPAGE, + // HTML5_BANNER, IMAGE, and all RICH_MEDIA. + Size *Size `json:"size,omitempty"` + + // SslCompliant: Whether the asset is SSL-compliant. This is a read-only + // field. Applicable to all but the following creative types: all + // REDIRECT and TRACKING_TEXT. + SslCompliant bool `json:"sslCompliant,omitempty"` + + // StartTimeType: Initial wait time type before making the asset + // visible. Applicable to the following creative types: all RICH_MEDIA. + // + // Possible values: + // "ASSET_START_TIME_TYPE_CUSTOM" + // "ASSET_START_TIME_TYPE_NONE" + StartTimeType string `json:"startTimeType,omitempty"` + + // StreamingServingUrl: Streaming URL for video asset. This is a + // read-only field. Applicable to the following creative types: + // INSTREAM_VIDEO and all VPAID. + StreamingServingUrl string `json:"streamingServingUrl,omitempty"` + + // Transparency: Whether the asset is transparent. Applicable to the + // following creative types: all RICH_MEDIA. Additionally, only + // applicable to HTML5 assets. + Transparency bool `json:"transparency,omitempty"` + + // VerticallyLocked: Whether the asset is vertically locked. This is a + // read-only field. Applicable to the following creative types: all + // RICH_MEDIA. + VerticallyLocked bool `json:"verticallyLocked,omitempty"` + + // VideoDuration: Detected video duration for video asset. This is a + // read-only field. Applicable to the following creative types: + // INSTREAM_VIDEO and all VPAID. + VideoDuration float64 `json:"videoDuration,omitempty"` + + // WindowMode: Window mode options for flash assets. Applicable to the + // following creative types: FLASH_INPAGE, RICH_MEDIA_EXPANDING, + // RICH_MEDIA_IM_EXPAND, RICH_MEDIA_INPAGE, and + // RICH_MEDIA_INPAGE_FLOATING. + // + // Possible values: + // "OPAQUE" + // "TRANSPARENT" + // "WINDOW" + WindowMode string `json:"windowMode,omitempty"` + + // ZIndex: zIndex value of an asset. This is a read-only field. + // Applicable to the following creative types: all + // RICH_MEDIA.Additionally, only applicable to assets whose displayType + // is NOT one of the following types: ASSET_DISPLAY_TYPE_INPAGE or + // ASSET_DISPLAY_TYPE_OVERLAY. + ZIndex int64 `json:"zIndex,omitempty"` + + // ZipFilename: File name of zip file. This is a read-only field. + // Applicable to the following creative types: HTML5_BANNER. + ZipFilename string `json:"zipFilename,omitempty"` + + // ZipFilesize: Size of zip file. This is a read-only field. Applicable + // to the following creative types: HTML5_BANNER. + ZipFilesize string `json:"zipFilesize,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ActionScript3") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeAsset) MarshalJSON() ([]byte, error) { + type noMethod CreativeAsset + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeAssetId: Creative Asset ID. +type CreativeAssetId struct { + // Name: Name of the creative asset. This is a required field while + // inserting an asset. After insertion, this assetIdentifier is used to + // identify the uploaded asset. Characters in the name must be + // alphanumeric or one of the following: ".-_ ". Spaces are allowed. + Name string `json:"name,omitempty"` + + // Type: Type of asset to upload. This is a required field. IMAGE is + // solely used for IMAGE creatives. Other image assets should use + // HTML_IMAGE. + // + // Possible values: + // "FLASH" + // "HTML" + // "HTML_IMAGE" + // "IMAGE" + // "VIDEO" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeAssetId) MarshalJSON() ([]byte, error) { + type noMethod CreativeAssetId + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeAssetMetadata: CreativeAssets contains properties of a +// creative asset file which will be uploaded or has already been +// uploaded. Refer to the creative sample code for how to upload assets +// and insert a creative. +type CreativeAssetMetadata struct { + // AssetIdentifier: ID of the creative asset. This is a required field. + AssetIdentifier *CreativeAssetId `json:"assetIdentifier,omitempty"` + + // ClickTags: List of detected click tags for assets. This is a + // read-only auto-generated field. + ClickTags []*ClickTag `json:"clickTags,omitempty"` + + // DetectedFeatures: List of feature dependencies for the creative asset + // that are detected by DCM. Feature dependencies are features that a + // browser must be able to support in order to render your HTML5 + // creative correctly. This is a read-only, auto-generated field. + // + // Possible values: + // "APPLICATION_CACHE" + // "AUDIO" + // "CANVAS" + // "CANVAS_TEXT" + // "CSS_ANIMATIONS" + // "CSS_BACKGROUND_SIZE" + // "CSS_BORDER_IMAGE" + // "CSS_BORDER_RADIUS" + // "CSS_BOX_SHADOW" + // "CSS_COLUMNS" + // "CSS_FLEX_BOX" + // "CSS_FONT_FACE" + // "CSS_GENERATED_CONTENT" + // "CSS_GRADIENTS" + // "CSS_HSLA" + // "CSS_MULTIPLE_BGS" + // "CSS_OPACITY" + // "CSS_REFLECTIONS" + // "CSS_RGBA" + // "CSS_TEXT_SHADOW" + // "CSS_TRANSFORMS" + // "CSS_TRANSFORMS3D" + // "CSS_TRANSITIONS" + // "DRAG_AND_DROP" + // "GEO_LOCATION" + // "HASH_CHANGE" + // "HISTORY" + // "INDEXED_DB" + // "INLINE_SVG" + // "INPUT_ATTR_AUTOCOMPLETE" + // "INPUT_ATTR_AUTOFOCUS" + // "INPUT_ATTR_LIST" + // "INPUT_ATTR_MAX" + // "INPUT_ATTR_MIN" + // "INPUT_ATTR_MULTIPLE" + // "INPUT_ATTR_PATTERN" + // "INPUT_ATTR_PLACEHOLDER" + // "INPUT_ATTR_REQUIRED" + // "INPUT_ATTR_STEP" + // "INPUT_TYPE_COLOR" + // "INPUT_TYPE_DATE" + // "INPUT_TYPE_DATETIME" + // "INPUT_TYPE_DATETIME_LOCAL" + // "INPUT_TYPE_EMAIL" + // "INPUT_TYPE_MONTH" + // "INPUT_TYPE_NUMBER" + // "INPUT_TYPE_RANGE" + // "INPUT_TYPE_SEARCH" + // "INPUT_TYPE_TEL" + // "INPUT_TYPE_TIME" + // "INPUT_TYPE_URL" + // "INPUT_TYPE_WEEK" + // "LOCAL_STORAGE" + // "POST_MESSAGE" + // "SESSION_STORAGE" + // "SMIL" + // "SVG_CLIP_PATHS" + // "SVG_FE_IMAGE" + // "SVG_FILTERS" + // "SVG_HREF" + // "TOUCH" + // "VIDEO" + // "WEBGL" + // "WEB_SOCKETS" + // "WEB_SQL_DATABASE" + // "WEB_WORKERS" + DetectedFeatures []string `json:"detectedFeatures,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creativeAssetMetadata". + Kind string `json:"kind,omitempty"` + + // WarnedValidationRules: Rules validated during code generation that + // generated a warning. This is a read-only, auto-generated + // field. + // + // Possible values are: + // - "CLICK_TAG_NON_TOP_LEVEL" + // - "CLICK_TAG_MISSING" + // - "CLICK_TAG_MORE_THAN_ONE" + // - "CLICK_TAG_INVALID" + // - "ORPHANED_ASSET" + // - "PRIMARY_HTML_MISSING" + // - "EXTERNAL_FILE_REFERENCED" + // - "MRAID_REFERENCED" + // - "ADMOB_REFERENCED" + // - "FILE_TYPE_INVALID" + // - "ZIP_INVALID" + // - "LINKED_FILE_NOT_FOUND" + // - "MAX_FLASH_VERSION_11" + // - "NOT_SSL_COMPLIANT" + // - "FILE_DETAIL_EMPTY" + // - "ASSET_INVALID" + // - "GWD_PROPERTIES_INVALID" + // - "ENABLER_UNSUPPORTED_METHOD_DCM" + // - "ASSET_FORMAT_UNSUPPORTED_DCM" + // - "COMPONENT_UNSUPPORTED_DCM" + // - "HTML5_FEATURE_UNSUPPORTED' " + // + // Possible values: + // "ADMOB_REFERENCED" + // "ASSET_FORMAT_UNSUPPORTED_DCM" + // "ASSET_INVALID" + // "CLICK_TAG_INVALID" + // "CLICK_TAG_MISSING" + // "CLICK_TAG_MORE_THAN_ONE" + // "CLICK_TAG_NON_TOP_LEVEL" + // "COMPONENT_UNSUPPORTED_DCM" + // "ENABLER_UNSUPPORTED_METHOD_DCM" + // "EXTERNAL_FILE_REFERENCED" + // "FILE_DETAIL_EMPTY" + // "FILE_TYPE_INVALID" + // "GWD_PROPERTIES_INVALID" + // "HTML5_FEATURE_UNSUPPORTED" + // "LINKED_FILE_NOT_FOUND" + // "MAX_FLASH_VERSION_11" + // "MRAID_REFERENCED" + // "NOT_SSL_COMPLIANT" + // "ORPHANED_ASSET" + // "PRIMARY_HTML_MISSING" + // "ZIP_INVALID" + WarnedValidationRules []string `json:"warnedValidationRules,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AssetIdentifier") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeAssetMetadata) MarshalJSON() ([]byte, error) { + type noMethod CreativeAssetMetadata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeAssignment: Creative Assignment. +type CreativeAssignment struct { + // Active: Whether this creative assignment is active. When true, the + // creative will be included in the ad's rotation. + Active bool `json:"active,omitempty"` + + // ApplyEventTags: Whether applicable event tags should fire when this + // creative assignment is rendered. If this value is unset when the ad + // is inserted or updated, it will default to true for all creative + // types EXCEPT for INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, + // and INSTREAM_VIDEO. + ApplyEventTags bool `json:"applyEventTags,omitempty"` + + // ClickThroughUrl: Click-through URL of the creative assignment. + ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"` + + // CompanionCreativeOverrides: Companion creative overrides for this + // creative assignment. Applicable to video ads. + CompanionCreativeOverrides []*CompanionClickThroughOverride `json:"companionCreativeOverrides,omitempty"` + + // CreativeGroupAssignments: Creative group assignments for this + // creative assignment. Only one assignment per creative group number is + // allowed for a maximum of two assignments. + CreativeGroupAssignments []*CreativeGroupAssignment `json:"creativeGroupAssignments,omitempty"` + + // CreativeId: ID of the creative to be assigned. This is a required + // field. + CreativeId int64 `json:"creativeId,omitempty,string"` + + // CreativeIdDimensionValue: Dimension value for the ID of the creative. + // This is a read-only, auto-generated field. + CreativeIdDimensionValue *DimensionValue `json:"creativeIdDimensionValue,omitempty"` + + // EndTime: Date and time that the assigned creative should stop + // serving. Must be later than the start time. + EndTime string `json:"endTime,omitempty"` + + // RichMediaExitOverrides: Rich media exit overrides for this creative + // assignment. + // Applicable when the creative type is any of the following: + // - RICH_MEDIA_INPAGE + // - RICH_MEDIA_INPAGE_FLOATING + // - RICH_MEDIA_IM_EXPAND + // - RICH_MEDIA_EXPANDING + // - RICH_MEDIA_INTERSTITIAL_FLOAT + // - RICH_MEDIA_MOBILE_IN_APP + // - RICH_MEDIA_MULTI_FLOATING + // - RICH_MEDIA_PEEL_DOWN + // - ADVANCED_BANNER + // - VPAID_LINEAR + // - VPAID_NON_LINEAR + RichMediaExitOverrides []*RichMediaExitOverride `json:"richMediaExitOverrides,omitempty"` + + // Sequence: Sequence number of the creative assignment, applicable when + // the rotation type is CREATIVE_ROTATION_TYPE_SEQUENTIAL. + Sequence int64 `json:"sequence,omitempty"` + + // SslCompliant: Whether the creative to be assigned is SSL-compliant. + // This is a read-only field that is auto-generated when the ad is + // inserted or updated. + SslCompliant bool `json:"sslCompliant,omitempty"` + + // StartTime: Date and time that the assigned creative should start + // serving. + StartTime string `json:"startTime,omitempty"` + + // Weight: Weight of the creative assignment, applicable when the + // rotation type is CREATIVE_ROTATION_TYPE_RANDOM. + Weight int64 `json:"weight,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Active") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeAssignment) MarshalJSON() ([]byte, error) { + type noMethod CreativeAssignment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeCustomEvent: Creative Custom Event. +type CreativeCustomEvent struct { + // AdvertiserCustomEventName: User-entered name for the event. + AdvertiserCustomEventName string `json:"advertiserCustomEventName,omitempty"` + + // AdvertiserCustomEventType: Type of the event. This is a read-only + // field. + // + // Possible values: + // "ADVERTISER_EVENT_COUNTER" + // "ADVERTISER_EVENT_EXIT" + // "ADVERTISER_EVENT_TIMER" + AdvertiserCustomEventType string `json:"advertiserCustomEventType,omitempty"` + + // ArtworkLabel: Artwork label column, used to link events in DCM back + // to events in Studio. This is a required field and should not be + // modified after insertion. + ArtworkLabel string `json:"artworkLabel,omitempty"` + + // ArtworkType: Artwork type used by the creative.This is a read-only + // field. + // + // Possible values: + // "ARTWORK_TYPE_FLASH" + // "ARTWORK_TYPE_HTML5" + // "ARTWORK_TYPE_MIXED" + ArtworkType string `json:"artworkType,omitempty"` + + // ExitUrl: Exit URL of the event. This field is used only for exit + // events. + ExitUrl string `json:"exitUrl,omitempty"` + + // Id: ID of this event. This is a required field and should not be + // modified after insertion. + Id int64 `json:"id,omitempty,string"` + + // PopupWindowProperties: Properties for rich media popup windows. This + // field is used only for exit events. + PopupWindowProperties *PopupWindowProperties `json:"popupWindowProperties,omitempty"` + + // TargetType: Target type used by the event. + // + // Possible values: + // "TARGET_BLANK" + // "TARGET_PARENT" + // "TARGET_POPUP" + // "TARGET_SELF" + // "TARGET_TOP" + TargetType string `json:"targetType,omitempty"` + + // VideoReportingId: Reporting ID, used to differentiate multiple videos + // in a single creative. + VideoReportingId string `json:"videoReportingId,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "AdvertiserCustomEventName") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeCustomEvent) MarshalJSON() ([]byte, error) { + type noMethod CreativeCustomEvent + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeField: Contains properties of a creative field. +type CreativeField struct { + // AccountId: Account ID of this creative field. This is a read-only + // field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this creative field. This is a + // required field on insertion. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // Id: ID of this creative field. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creativeField". + Kind string `json:"kind,omitempty"` + + // Name: Name of this creative field. This is a required field and must + // be less than 256 characters long and unique among creative fields of + // the same advertiser. + Name string `json:"name,omitempty"` + + // SubaccountId: Subaccount ID of this creative field. This is a + // read-only field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeField) MarshalJSON() ([]byte, error) { + type noMethod CreativeField + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeFieldAssignment: Creative Field Assignment. +type CreativeFieldAssignment struct { + // CreativeFieldId: ID of the creative field. + CreativeFieldId int64 `json:"creativeFieldId,omitempty,string"` + + // CreativeFieldValueId: ID of the creative field value. + CreativeFieldValueId int64 `json:"creativeFieldValueId,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "CreativeFieldId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeFieldAssignment) MarshalJSON() ([]byte, error) { + type noMethod CreativeFieldAssignment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeFieldValue: Contains properties of a creative field value. +type CreativeFieldValue struct { + // Id: ID of this creative field value. This is a read-only, + // auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creativeFieldValue". + Kind string `json:"kind,omitempty"` + + // Value: Value of this creative field value. It needs to be less than + // 256 characters in length and unique per creative field. + Value string `json:"value,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeFieldValue) MarshalJSON() ([]byte, error) { + type noMethod CreativeFieldValue + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeFieldValuesListResponse: Creative Field Value List Response +type CreativeFieldValuesListResponse struct { + // CreativeFieldValues: Creative field value collection. + CreativeFieldValues []*CreativeFieldValue `json:"creativeFieldValues,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creativeFieldValuesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreativeFieldValues") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeFieldValuesListResponse) MarshalJSON() ([]byte, error) { + type noMethod CreativeFieldValuesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeFieldsListResponse: Creative Field List Response +type CreativeFieldsListResponse struct { + // CreativeFields: Creative field collection. + CreativeFields []*CreativeField `json:"creativeFields,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creativeFieldsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreativeFields") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeFieldsListResponse) MarshalJSON() ([]byte, error) { + type noMethod CreativeFieldsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeGroup: Contains properties of a creative group. +type CreativeGroup struct { + // AccountId: Account ID of this creative group. This is a read-only + // field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this creative group. This is a + // required field on insertion. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // GroupNumber: Subgroup of the creative group. Assign your creative + // groups to one of the following subgroups in order to filter or manage + // them more easily. This field is required on insertion and is + // read-only after insertion. + // Acceptable values are: + // - 1 + // - 2 + GroupNumber int64 `json:"groupNumber,omitempty"` + + // Id: ID of this creative group. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creativeGroup". + Kind string `json:"kind,omitempty"` + + // Name: Name of this creative group. This is a required field and must + // be less than 256 characters long and unique among creative groups of + // the same advertiser. + Name string `json:"name,omitempty"` + + // SubaccountId: Subaccount ID of this creative group. This is a + // read-only field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeGroup) MarshalJSON() ([]byte, error) { + type noMethod CreativeGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeGroupAssignment: Creative Group Assignment. +type CreativeGroupAssignment struct { + // CreativeGroupId: ID of the creative group to be assigned. + CreativeGroupId int64 `json:"creativeGroupId,omitempty,string"` + + // CreativeGroupNumber: Creative group number of the creative group + // assignment. + // + // Possible values: + // "CREATIVE_GROUP_ONE" + // "CREATIVE_GROUP_TWO" + CreativeGroupNumber string `json:"creativeGroupNumber,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreativeGroupId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeGroupAssignment) MarshalJSON() ([]byte, error) { + type noMethod CreativeGroupAssignment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeGroupsListResponse: Creative Group List Response +type CreativeGroupsListResponse struct { + // CreativeGroups: Creative group collection. + CreativeGroups []*CreativeGroup `json:"creativeGroups,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creativeGroupsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreativeGroups") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeGroupsListResponse) MarshalJSON() ([]byte, error) { + type noMethod CreativeGroupsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeOptimizationConfiguration: Creative optimization settings. +type CreativeOptimizationConfiguration struct { + // Id: ID of this creative optimization config. This field is + // auto-generated when the campaign is inserted or updated. It can be + // null for existing campaigns. + Id int64 `json:"id,omitempty,string"` + + // Name: Name of this creative optimization config. This is a required + // field and must be less than 129 characters long. + Name string `json:"name,omitempty"` + + // OptimizationActivitys: List of optimization activities associated + // with this configuration. + OptimizationActivitys []*OptimizationActivity `json:"optimizationActivitys,omitempty"` + + // OptimizationModel: Optimization model for this configuration. + // + // Possible values: + // "CLICK" + // "POST_CLICK" + // "POST_CLICK_AND_IMPRESSION" + // "POST_IMPRESSION" + OptimizationModel string `json:"optimizationModel,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeOptimizationConfiguration) MarshalJSON() ([]byte, error) { + type noMethod CreativeOptimizationConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeRotation: Creative Rotation. +type CreativeRotation struct { + // CreativeAssignments: Creative assignments in this creative rotation. + CreativeAssignments []*CreativeAssignment `json:"creativeAssignments,omitempty"` + + // CreativeOptimizationConfigurationId: Creative optimization + // configuration that is used by this ad. It should refer to one of the + // existing optimization configurations in the ad's campaign. If it is + // unset or set to 0, then the campaign's default optimization + // configuration will be used for this ad. + CreativeOptimizationConfigurationId int64 `json:"creativeOptimizationConfigurationId,omitempty,string"` + + // Type: Type of creative rotation. Can be used to specify whether to + // use sequential or random rotation. + // + // Possible values: + // "CREATIVE_ROTATION_TYPE_RANDOM" + // "CREATIVE_ROTATION_TYPE_SEQUENTIAL" + Type string `json:"type,omitempty"` + + // WeightCalculationStrategy: Strategy for calculating weights. Used + // with CREATIVE_ROTATION_TYPE_RANDOM. + // + // Possible values: + // "WEIGHT_STRATEGY_CUSTOM" + // "WEIGHT_STRATEGY_EQUAL" + // "WEIGHT_STRATEGY_HIGHEST_CTR" + // "WEIGHT_STRATEGY_OPTIMIZED" + WeightCalculationStrategy string `json:"weightCalculationStrategy,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreativeAssignments") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeRotation) MarshalJSON() ([]byte, error) { + type noMethod CreativeRotation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativeSettings: Creative Settings +type CreativeSettings struct { + // IFrameFooter: Header text for iFrames for this site. Must be less + // than or equal to 2000 characters long. + IFrameFooter string `json:"iFrameFooter,omitempty"` + + // IFrameHeader: Header text for iFrames for this site. Must be less + // than or equal to 2000 characters long. + IFrameHeader string `json:"iFrameHeader,omitempty"` + + // ForceSendFields is a list of field names (e.g. "IFrameFooter") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativeSettings) MarshalJSON() ([]byte, error) { + type noMethod CreativeSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreativesListResponse: Creative List Response +type CreativesListResponse struct { + // Creatives: Creative collection. + Creatives []*Creative `json:"creatives,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#creativesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Creatives") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreativesListResponse) MarshalJSON() ([]byte, error) { + type noMethod CreativesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CrossDimensionReachReportCompatibleFields: Represents fields that are +// compatible to be selected for a report of type +// "CROSS_DIMENSION_REACH". +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"` + + // ForceSendFields is a list of field names (e.g. "Breakdown") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CrossDimensionReachReportCompatibleFields) MarshalJSON() ([]byte, error) { + type noMethod CrossDimensionReachReportCompatibleFields + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomRichMediaEvents: Represents a Custom Rich Media Events group. +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"` + + // ForceSendFields is a list of field names (e.g. "FilteredEventIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomRichMediaEvents) MarshalJSON() ([]byte, error) { + type noMethod CustomRichMediaEvents + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DateRange: Represents a date range. +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. + // + // Possible values: + // "LAST_24_MONTHS" + // "LAST_30_DAYS" + // "LAST_365_DAYS" + // "LAST_7_DAYS" + // "LAST_90_DAYS" + // "MONTH_TO_DATE" + // "PREVIOUS_MONTH" + // "PREVIOUS_QUARTER" + // "PREVIOUS_WEEK" + // "PREVIOUS_YEAR" + // "QUARTER_TO_DATE" + // "TODAY" + // "WEEK_TO_DATE" + // "YEAR_TO_DATE" + // "YESTERDAY" + 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"` + + // ForceSendFields is a list of field names (e.g. "EndDate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DateRange) MarshalJSON() ([]byte, error) { + type noMethod DateRange + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DayPartTargeting: Day Part Targeting. +type DayPartTargeting struct { + // DaysOfWeek: Days of the week when the ad will serve. + // + // Acceptable values are: + // - "SUNDAY" + // - "MONDAY" + // - "TUESDAY" + // - "WEDNESDAY" + // - "THURSDAY" + // - "FRIDAY" + // - "SATURDAY" + // + // Possible values: + // "FRIDAY" + // "MONDAY" + // "SATURDAY" + // "SUNDAY" + // "THURSDAY" + // "TUESDAY" + // "WEDNESDAY" + DaysOfWeek []string `json:"daysOfWeek,omitempty"` + + // HoursOfDay: Hours of the day when the ad will serve. Must be an + // integer between 0 and 23 (inclusive), where 0 is midnight to 1 AM, + // and 23 is 11 PM to midnight. Can be specified with days of week, in + // which case the ad would serve during these hours on the specified + // days. For example, if Monday, Wednesday, Friday are the days of week + // specified and 9-10am, 3-5pm (hours 9, 15, and 16) is specified, the + // ad would serve Monday, Wednesdays, and Fridays at 9-10am and 3-5pm. + HoursOfDay []int64 `json:"hoursOfDay,omitempty"` + + // UserLocalTime: Whether or not to use the user's local time. If false, + // the America/New York time zone applies. + UserLocalTime bool `json:"userLocalTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DaysOfWeek") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DayPartTargeting) MarshalJSON() ([]byte, error) { + type noMethod DayPartTargeting + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DefaultClickThroughEventTagProperties: Properties of inheriting and +// overriding the default click-through event tag. A campaign may +// override the event tag defined at the advertiser level, and an ad may +// also override the campaign's setting further. +type DefaultClickThroughEventTagProperties struct { + // DefaultClickThroughEventTagId: ID of the click-through event tag to + // apply to all ads in this entity's scope. + DefaultClickThroughEventTagId int64 `json:"defaultClickThroughEventTagId,omitempty,string"` + + // OverrideInheritedEventTag: Whether this entity should override the + // inherited default click-through event tag with its own defined value. + OverrideInheritedEventTag bool `json:"overrideInheritedEventTag,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "DefaultClickThroughEventTagId") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DefaultClickThroughEventTagProperties) MarshalJSON() ([]byte, error) { + type noMethod DefaultClickThroughEventTagProperties + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DeliverySchedule: Delivery Schedule. +type DeliverySchedule struct { + // FrequencyCap: Limit on the number of times an individual user can be + // served the ad within a specified period of time. + FrequencyCap *FrequencyCap `json:"frequencyCap,omitempty"` + + // HardCutoff: Whether or not hard cutoff is enabled. If true, the ad + // will not serve after the end date and time. Otherwise the ad will + // continue to be served until it has reached its delivery goals. + HardCutoff bool `json:"hardCutoff,omitempty"` + + // ImpressionRatio: Impression ratio for this ad. This ratio determines + // how often each ad is served relative to the others. For example, if + // ad A has an impression ratio of 1 and ad B has an impression ratio of + // 3, then DCM will serve ad B three times as often as ad A. Must be + // between 1 and 10. + ImpressionRatio int64 `json:"impressionRatio,omitempty,string"` + + // Priority: Serving priority of an ad, with respect to other ads. The + // lower the priority number, the greater the priority with which it is + // served. + // + // Possible values: + // "AD_PRIORITY_01" + // "AD_PRIORITY_02" + // "AD_PRIORITY_03" + // "AD_PRIORITY_04" + // "AD_PRIORITY_05" + // "AD_PRIORITY_06" + // "AD_PRIORITY_07" + // "AD_PRIORITY_08" + // "AD_PRIORITY_09" + // "AD_PRIORITY_10" + // "AD_PRIORITY_11" + // "AD_PRIORITY_12" + // "AD_PRIORITY_13" + // "AD_PRIORITY_14" + // "AD_PRIORITY_15" + // "AD_PRIORITY_16" + Priority string `json:"priority,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FrequencyCap") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeliverySchedule) MarshalJSON() ([]byte, error) { + type noMethod DeliverySchedule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DfpSettings: DFP Settings +type DfpSettings struct { + // DfpNetworkCode: DFP network code for this directory site. + DfpNetworkCode string `json:"dfp_network_code,omitempty"` + + // DfpNetworkName: DFP network name for this directory site. + DfpNetworkName string `json:"dfp_network_name,omitempty"` + + // ProgrammaticPlacementAccepted: Whether this directory site accepts + // programmatic placements. + ProgrammaticPlacementAccepted bool `json:"programmaticPlacementAccepted,omitempty"` + + // PubPaidPlacementAccepted: Whether this directory site accepts + // publisher-paid tags. + PubPaidPlacementAccepted bool `json:"pubPaidPlacementAccepted,omitempty"` + + // PublisherPortalOnly: Whether this directory site is available only + // via DoubleClick Publisher Portal. + PublisherPortalOnly bool `json:"publisherPortalOnly,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DfpNetworkCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DfpSettings) MarshalJSON() ([]byte, error) { + type noMethod DfpSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Dimension: Represents a dimension. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Dimension) MarshalJSON() ([]byte, error) { + type noMethod Dimension + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionFilter: Represents a dimension filter. +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionFilter) MarshalJSON() ([]byte, error) { + type noMethod DimensionFilter + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionValue: Represents a DimensionValue resource. +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. If not specified, defaults to EXACT. If set to + // WILDCARD_EXPRESSION, '*' is allowed as a placeholder for variable + // length character sequences, and it can be escaped with a backslash. + // Note, only paid search dimensions ('dfa:paidSearch*') allow a + // matchType other than EXACT. + // + // Possible values: + // "BEGINS_WITH" + // "CONTAINS" + // "EXACT" + // "WILDCARD_EXPRESSION" + MatchType string `json:"matchType,omitempty"` + + // Value: The value of the dimension. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DimensionName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionValue) MarshalJSON() ([]byte, error) { + type noMethod DimensionValue + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionValueList: Represents the list of DimensionValue resources. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionValueList) MarshalJSON() ([]byte, error) { + type noMethod DimensionValueList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DimensionValueRequest: Represents a DimensionValuesRequest. +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DimensionValueRequest) MarshalJSON() ([]byte, error) { + type noMethod DimensionValueRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DirectorySite: DirectorySites contains properties of a website from +// the Site Directory. Sites need to be added to an account via the +// Sites resource before they can be assigned to a placement. +type DirectorySite struct { + // Active: Whether this directory site is active. + Active bool `json:"active,omitempty"` + + // ContactAssignments: Directory site contacts. + ContactAssignments []*DirectorySiteContactAssignment `json:"contactAssignments,omitempty"` + + // CountryId: Country ID of this directory site. + CountryId int64 `json:"countryId,omitempty,string"` + + // CurrencyId: Currency ID of this directory site. + // Possible values are: + // - "1" for USD + // - "2" for GBP + // - "3" for ESP + // - "4" for SEK + // - "5" for CAD + // - "6" for JPY + // - "7" for DEM + // - "8" for AUD + // - "9" for FRF + // - "10" for ITL + // - "11" for DKK + // - "12" for NOK + // - "13" for FIM + // - "14" for ZAR + // - "15" for IEP + // - "16" for NLG + // - "17" for EUR + // - "18" for KRW + // - "19" for TWD + // - "20" for SGD + // - "21" for CNY + // - "22" for HKD + // - "23" for NZD + // - "24" for MYR + // - "25" for BRL + // - "26" for PTE + // - "27" for MXP + // - "28" for CLP + // - "29" for TRY + // - "30" for ARS + // - "31" for PEN + // - "32" for ILS + // - "33" for CHF + // - "34" for VEF + // - "35" for COP + // - "36" for GTQ + CurrencyId int64 `json:"currencyId,omitempty,string"` + + // Description: Description of this directory site. + Description string `json:"description,omitempty"` + + // Id: ID of this directory site. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this directory site. + // This is a read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // InpageTagFormats: Tag types for regular placements. + // + // Acceptable values are: + // - "STANDARD" + // - "IFRAME_JAVASCRIPT_INPAGE" + // - "INTERNAL_REDIRECT_INPAGE" + // - "JAVASCRIPT_INPAGE" + // + // Possible values: + // "IFRAME_JAVASCRIPT_INPAGE" + // "INTERNAL_REDIRECT_INPAGE" + // "JAVASCRIPT_INPAGE" + // "STANDARD" + InpageTagFormats []string `json:"inpageTagFormats,omitempty"` + + // InterstitialTagFormats: Tag types for interstitial + // placements. + // + // Acceptable values are: + // - "IFRAME_JAVASCRIPT_INTERSTITIAL" + // - "INTERNAL_REDIRECT_INTERSTITIAL" + // - "JAVASCRIPT_INTERSTITIAL" + // + // Possible values: + // "IFRAME_JAVASCRIPT_INTERSTITIAL" + // "INTERNAL_REDIRECT_INTERSTITIAL" + // "JAVASCRIPT_INTERSTITIAL" + InterstitialTagFormats []string `json:"interstitialTagFormats,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#directorySite". + Kind string `json:"kind,omitempty"` + + // Name: Name of this directory site. + Name string `json:"name,omitempty"` + + // ParentId: Parent directory site ID. + ParentId int64 `json:"parentId,omitempty,string"` + + // Settings: Directory site settings. + Settings *DirectorySiteSettings `json:"settings,omitempty"` + + // Url: URL of this directory site. + Url string `json:"url,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Active") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DirectorySite) MarshalJSON() ([]byte, error) { + type noMethod DirectorySite + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DirectorySiteContact: Contains properties of a Site Directory +// contact. +type DirectorySiteContact struct { + // Address: Address of this directory site contact. + Address string `json:"address,omitempty"` + + // Email: Email address of this directory site contact. + Email string `json:"email,omitempty"` + + // FirstName: First name of this directory site contact. + FirstName string `json:"firstName,omitempty"` + + // Id: ID of this directory site contact. This is a read-only, + // auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#directorySiteContact". + Kind string `json:"kind,omitempty"` + + // LastName: Last name of this directory site contact. + LastName string `json:"lastName,omitempty"` + + // Phone: Phone number of this directory site contact. + Phone string `json:"phone,omitempty"` + + // Role: Directory site contact role. + // + // Possible values: + // "ADMIN" + // "EDIT" + // "VIEW" + Role string `json:"role,omitempty"` + + // Title: Title or designation of this directory site contact. + Title string `json:"title,omitempty"` + + // Type: Directory site contact type. + // + // Possible values: + // "BILLING" + // "OTHER" + // "SALES" + // "TECHNICAL" + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Address") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DirectorySiteContact) MarshalJSON() ([]byte, error) { + type noMethod DirectorySiteContact + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DirectorySiteContactAssignment: Directory Site Contact Assignment +type DirectorySiteContactAssignment struct { + // ContactId: ID of this directory site contact. This is a read-only, + // auto-generated field. + ContactId int64 `json:"contactId,omitempty,string"` + + // Visibility: Visibility of this directory site contact assignment. + // When set to PUBLIC this contact assignment is visible to all account + // and agency users; when set to PRIVATE it is visible only to the site. + // + // Possible values: + // "PRIVATE" + // "PUBLIC" + Visibility string `json:"visibility,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ContactId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DirectorySiteContactAssignment) MarshalJSON() ([]byte, error) { + type noMethod DirectorySiteContactAssignment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DirectorySiteContactsListResponse: Directory Site Contact List +// Response +type DirectorySiteContactsListResponse struct { + // DirectorySiteContacts: Directory site contact collection + DirectorySiteContacts []*DirectorySiteContact `json:"directorySiteContacts,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#directorySiteContactsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "DirectorySiteContacts") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DirectorySiteContactsListResponse) MarshalJSON() ([]byte, error) { + type noMethod DirectorySiteContactsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DirectorySiteSettings: Directory Site Settings +type DirectorySiteSettings struct { + // ActiveViewOptOut: Whether this directory site has disabled active + // view creatives. + ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"` + + // DfpSettings: Directory site DFP settings. + DfpSettings *DfpSettings `json:"dfp_settings,omitempty"` + + // InstreamVideoPlacementAccepted: Whether this site accepts in-stream + // video ads. + InstreamVideoPlacementAccepted bool `json:"instream_video_placement_accepted,omitempty"` + + // InterstitialPlacementAccepted: Whether this site accepts interstitial + // ads. + InterstitialPlacementAccepted bool `json:"interstitialPlacementAccepted,omitempty"` + + // NielsenOcrOptOut: Whether this directory site has disabled Nielsen + // OCR reach ratings. + NielsenOcrOptOut bool `json:"nielsenOcrOptOut,omitempty"` + + // VerificationTagOptOut: Whether this directory site has disabled + // generation of Verification ins tags. + VerificationTagOptOut bool `json:"verificationTagOptOut,omitempty"` + + // VideoActiveViewOptOut: Whether this directory site has disabled + // active view for in-stream video creatives. + VideoActiveViewOptOut bool `json:"videoActiveViewOptOut,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ActiveViewOptOut") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DirectorySiteSettings) MarshalJSON() ([]byte, error) { + type noMethod DirectorySiteSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DirectorySitesListResponse: Directory Site List Response +type DirectorySitesListResponse struct { + // DirectorySites: Directory site collection. + DirectorySites []*DirectorySite `json:"directorySites,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#directorySitesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DirectorySites") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DirectorySitesListResponse) MarshalJSON() ([]byte, error) { + type noMethod DirectorySitesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventTag: Contains properties of an event tag. +type EventTag struct { + // AccountId: Account ID of this event tag. This is a read-only field + // that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this event tag. This field or the + // campaignId field is required on insertion. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // CampaignId: Campaign ID of this event tag. This field or the + // advertiserId field is required on insertion. + CampaignId int64 `json:"campaignId,omitempty,string"` + + // CampaignIdDimensionValue: Dimension value for the ID of the campaign. + // This is a read-only, auto-generated field. + CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"` + + // EnabledByDefault: Whether this event tag should be automatically + // enabled for all of the advertiser's campaigns and ads. + EnabledByDefault bool `json:"enabledByDefault,omitempty"` + + // ExcludeFromAdxRequests: Whether to remove this event tag from ads + // that are trafficked through DoubleClick Bid Manager to Ad Exchange. + // This may be useful if the event tag uses a pixel that is unapproved + // for Ad Exchange bids on one or more networks, such as the Google + // Display Network. + ExcludeFromAdxRequests bool `json:"excludeFromAdxRequests,omitempty"` + + // Id: ID of this event tag. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#eventTag". + Kind string `json:"kind,omitempty"` + + // Name: Name of this event tag. This is a required field and must be + // less than 256 characters long. + Name string `json:"name,omitempty"` + + // SiteFilterType: Site filter type for this event tag. If no type is + // specified then the event tag will be applied to all sites. + // + // Possible values: + // "BLACKLIST" + // "WHITELIST" + SiteFilterType string `json:"siteFilterType,omitempty"` + + // SiteIds: Filter list of site IDs associated with this event tag. The + // siteFilterType determines whether this is a whitelist or blacklist + // filter. + SiteIds googleapi.Int64s `json:"siteIds,omitempty"` + + // SslCompliant: Whether this tag is SSL-compliant or not. This is a + // read-only field. + SslCompliant bool `json:"sslCompliant,omitempty"` + + // Status: Status of this event tag. Must be ENABLED for this event tag + // to fire. This is a required field. + // + // Possible values: + // "DISABLED" + // "ENABLED" + Status string `json:"status,omitempty"` + + // SubaccountId: Subaccount ID of this event tag. This is a read-only + // field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // Type: Event tag type. Can be used to specify whether to use a + // third-party pixel, a third-party JavaScript URL, or a third-party + // click-through URL for either impression or click tracking. This is a + // required field. + // + // Possible values: + // "CLICK_THROUGH_EVENT_TAG" + // "IMPRESSION_IMAGE_EVENT_TAG" + // "IMPRESSION_JAVASCRIPT_EVENT_TAG" + Type string `json:"type,omitempty"` + + // Url: Payload URL for this event tag. The URL on a click-through event + // tag should have a landing page URL appended to the end of it. This + // field is required on insertion. + Url string `json:"url,omitempty"` + + // UrlEscapeLevels: Number of times the landing page URL should be + // URL-escaped before being appended to the click-through event tag URL. + // Only applies to click-through event tags as specified by the event + // tag type. + UrlEscapeLevels int64 `json:"urlEscapeLevels,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventTag) MarshalJSON() ([]byte, error) { + type noMethod EventTag + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventTagOverride: Event tag override information. +type EventTagOverride struct { + // Enabled: Whether this override is enabled. + Enabled bool `json:"enabled,omitempty"` + + // Id: ID of this event tag override. This is a read-only, + // auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Enabled") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventTagOverride) MarshalJSON() ([]byte, error) { + type noMethod EventTagOverride + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventTagsListResponse: Event Tag List Response +type EventTagsListResponse struct { + // EventTags: Event tag collection. + EventTags []*EventTag `json:"eventTags,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#eventTagsListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "EventTags") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventTagsListResponse) MarshalJSON() ([]byte, error) { + type noMethod EventTagsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// File: Represents a File resource. A file contains the metadata 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". +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 filename of the file. + FileName string `json:"fileName,omitempty"` + + // Format: The output format of the report. Only available once the file + // is available. + // + // Possible values: + // "CSV" + // "EXCEL" + 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. + // + // Possible values: + // "CANCELLED" + // "FAILED" + // "PROCESSING" + // "REPORT_AVAILABLE" + Status string `json:"status,omitempty"` + + // Urls: The URLs where the completed report file can be downloaded. + Urls *FileUrls `json:"urls,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DateRange") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *File) MarshalJSON() ([]byte, error) { + type noMethod File + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FileUrls: The URLs where the completed report file can be downloaded. +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"` + + // ForceSendFields is a list of field names (e.g. "ApiUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileUrls) MarshalJSON() ([]byte, error) { + type noMethod FileUrls + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FileList: Represents the list of File resources. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileList) MarshalJSON() ([]byte, error) { + type noMethod FileList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Flight: Flight +type Flight struct { + // EndDate: Inventory item flight end date. + EndDate string `json:"endDate,omitempty"` + + // RateOrCost: Rate or cost of this flight. + RateOrCost int64 `json:"rateOrCost,omitempty,string"` + + // StartDate: Inventory item flight start date. + StartDate string `json:"startDate,omitempty"` + + // Units: Units of this flight. + Units int64 `json:"units,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "EndDate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Flight) MarshalJSON() ([]byte, error) { + type noMethod Flight + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightActivitiesGenerateTagResponse: Floodlight Activity +// GenerateTag Response +type FloodlightActivitiesGenerateTagResponse struct { + // FloodlightActivityTag: Generated tag for this floodlight activity. + FloodlightActivityTag string `json:"floodlightActivityTag,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#floodlightActivitiesGenerateTagResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "FloodlightActivityTag") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightActivitiesGenerateTagResponse) MarshalJSON() ([]byte, error) { + type noMethod FloodlightActivitiesGenerateTagResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightActivitiesListResponse: Floodlight Activity List Response +type FloodlightActivitiesListResponse struct { + // FloodlightActivities: Floodlight activity collection. + FloodlightActivities []*FloodlightActivity `json:"floodlightActivities,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#floodlightActivitiesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "FloodlightActivities") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightActivitiesListResponse) MarshalJSON() ([]byte, error) { + type noMethod FloodlightActivitiesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightActivity: Contains properties of a Floodlight activity. +type FloodlightActivity struct { + // AccountId: Account ID of this floodlight activity. This is a + // read-only field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this floodlight activity. If this + // field is left blank, the value will be copied over either from the + // activity group's advertiser or the existing activity's advertiser. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // CacheBustingType: Code type used for cache busting in the generated + // tag. + // + // Possible values: + // "ACTIVE_SERVER_PAGE" + // "COLD_FUSION" + // "JAVASCRIPT" + // "JSP" + // "PHP" + CacheBustingType string `json:"cacheBustingType,omitempty"` + + // CountingMethod: Counting method for conversions for this floodlight + // activity. This is a required field. + // + // Possible values: + // "ITEMS_SOLD_COUNTING" + // "SESSION_COUNTING" + // "STANDARD_COUNTING" + // "TRANSACTIONS_COUNTING" + // "UNIQUE_COUNTING" + CountingMethod string `json:"countingMethod,omitempty"` + + // DefaultTags: Dynamic floodlight tags. + DefaultTags []*FloodlightActivityDynamicTag `json:"defaultTags,omitempty"` + + // ExpectedUrl: URL where this tag will be deployed. If specified, must + // be less than 256 characters long. + ExpectedUrl string `json:"expectedUrl,omitempty"` + + // FloodlightActivityGroupId: Floodlight activity group ID of this + // floodlight activity. This is a required field. + FloodlightActivityGroupId int64 `json:"floodlightActivityGroupId,omitempty,string"` + + // FloodlightActivityGroupName: Name of the associated floodlight + // activity group. This is a read-only field. + FloodlightActivityGroupName string `json:"floodlightActivityGroupName,omitempty"` + + // FloodlightActivityGroupTagString: Tag string of the associated + // floodlight activity group. This is a read-only field. + FloodlightActivityGroupTagString string `json:"floodlightActivityGroupTagString,omitempty"` + + // FloodlightActivityGroupType: Type of the associated floodlight + // activity group. This is a read-only field. + // + // Possible values: + // "COUNTER" + // "SALE" + FloodlightActivityGroupType string `json:"floodlightActivityGroupType,omitempty"` + + // FloodlightConfigurationId: Floodlight configuration ID of this + // floodlight activity. If this field is left blank, the value will be + // copied over either from the activity group's floodlight configuration + // or from the existing activity's floodlight configuration. + FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"` + + // FloodlightConfigurationIdDimensionValue: Dimension value for the ID + // of the floodlight configuration. This is a read-only, auto-generated + // field. + FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"` + + // Hidden: Whether this activity is archived. + Hidden bool `json:"hidden,omitempty"` + + // Id: ID of this floodlight activity. This is a read-only, + // auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this floodlight + // activity. This is a read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // ImageTagEnabled: Whether the image tag is enabled for this activity. + ImageTagEnabled bool `json:"imageTagEnabled,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#floodlightActivity". + Kind string `json:"kind,omitempty"` + + // Name: Name of this floodlight activity. This is a required field. + // Must be less than 129 characters long and cannot contain quotes. + Name string `json:"name,omitempty"` + + // Notes: General notes or implementation instructions for the tag. + Notes string `json:"notes,omitempty"` + + // PublisherTags: Publisher dynamic floodlight tags. + PublisherTags []*FloodlightActivityPublisherDynamicTag `json:"publisherTags,omitempty"` + + // Secure: Whether this tag should use SSL. + Secure bool `json:"secure,omitempty"` + + // SslCompliant: Whether the floodlight activity is SSL-compliant. This + // is a read-only field, its value detected by the system from the + // floodlight tags. + SslCompliant bool `json:"sslCompliant,omitempty"` + + // SslRequired: Whether this floodlight activity must be SSL-compliant. + SslRequired bool `json:"sslRequired,omitempty"` + + // SubaccountId: Subaccount ID of this floodlight activity. This is a + // read-only field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TagFormat: Tag format type for the floodlight activity. If left + // blank, the tag format will default to HTML. + // + // Possible values: + // "HTML" + // "XHTML" + TagFormat string `json:"tagFormat,omitempty"` + + // TagString: Value of the cat= paramter in the floodlight tag, which + // the ad servers use to identify the activity. This is optional: if + // empty, a new tag string will be generated for you. This string must + // be 1 to 8 characters long, with valid characters being + // [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among + // activities of the same activity group. This field is read-only after + // insertion. + TagString string `json:"tagString,omitempty"` + + // UserDefinedVariableTypes: List of the user-defined variables used by + // this conversion tag. These map to the "u[1-20]=" in the tags. Each of + // these can have a user defined type. + // Acceptable values are: + // - "U1" + // - "U2" + // - "U3" + // - "U4" + // - "U5" + // - "U6" + // - "U7" + // - "U8" + // - "U9" + // - "U10" + // - "U11" + // - "U12" + // - "U13" + // - "U14" + // - "U15" + // - "U16" + // - "U17" + // - "U18" + // - "U19" + // - "U20" + // + // Possible values: + // "U1" + // "U10" + // "U11" + // "U12" + // "U13" + // "U14" + // "U15" + // "U16" + // "U17" + // "U18" + // "U19" + // "U2" + // "U20" + // "U3" + // "U4" + // "U5" + // "U6" + // "U7" + // "U8" + // "U9" + UserDefinedVariableTypes []string `json:"userDefinedVariableTypes,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightActivity) MarshalJSON() ([]byte, error) { + type noMethod FloodlightActivity + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightActivityDynamicTag: Dynamic Tag +type FloodlightActivityDynamicTag struct { + // Id: ID of this dynamic tag. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // Name: Name of this tag. + Name string `json:"name,omitempty"` + + // Tag: Tag code. + Tag string `json:"tag,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightActivityDynamicTag) MarshalJSON() ([]byte, error) { + type noMethod FloodlightActivityDynamicTag + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightActivityGroup: Contains properties of a Floodlight activity +// group. +type FloodlightActivityGroup struct { + // AccountId: Account ID of this floodlight activity group. This is a + // read-only field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this floodlight activity group. If + // this field is left blank, the value will be copied over either from + // the floodlight configuration's advertiser or from the existing + // activity group's advertiser. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // FloodlightConfigurationId: Floodlight configuration ID of this + // floodlight activity group. This is a required field. + FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"` + + // FloodlightConfigurationIdDimensionValue: Dimension value for the ID + // of the floodlight configuration. This is a read-only, auto-generated + // field. + FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"` + + // Id: ID of this floodlight activity group. This is a read-only, + // auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this floodlight + // activity group. This is a read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#floodlightActivityGroup". + Kind string `json:"kind,omitempty"` + + // Name: Name of this floodlight activity group. This is a required + // field. Must be less than 65 characters long and cannot contain + // quotes. + Name string `json:"name,omitempty"` + + // SubaccountId: Subaccount ID of this floodlight activity group. This + // is a read-only field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TagString: Value of the type= parameter in the floodlight tag, which + // the ad servers use to identify the activity group that the activity + // belongs to. This is optional: if empty, a new tag string will be + // generated for you. This string must be 1 to 8 characters long, with + // valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must + // also be unique among activity groups of the same floodlight + // configuration. This field is read-only after insertion. + TagString string `json:"tagString,omitempty"` + + // Type: Type of the floodlight activity group. This is a required field + // that is read-only after insertion. + // + // Possible values: + // "COUNTER" + // "SALE" + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightActivityGroup) MarshalJSON() ([]byte, error) { + type noMethod FloodlightActivityGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightActivityGroupsListResponse: Floodlight Activity Group List +// Response +type FloodlightActivityGroupsListResponse struct { + // FloodlightActivityGroups: Floodlight activity group collection. + FloodlightActivityGroups []*FloodlightActivityGroup `json:"floodlightActivityGroups,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#floodlightActivityGroupsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "FloodlightActivityGroups") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightActivityGroupsListResponse) MarshalJSON() ([]byte, error) { + type noMethod FloodlightActivityGroupsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightActivityPublisherDynamicTag: Publisher Dynamic Tag +type FloodlightActivityPublisherDynamicTag struct { + // ClickThrough: Whether this tag is applicable only for click-throughs. + ClickThrough bool `json:"clickThrough,omitempty"` + + // DirectorySiteId: Directory site ID of this dynamic tag. This is a + // write-only field that can be used as an alternative to the siteId + // field. When this resource is retrieved, only the siteId field will be + // populated. + DirectorySiteId int64 `json:"directorySiteId,omitempty,string"` + + // DynamicTag: Dynamic floodlight tag. + DynamicTag *FloodlightActivityDynamicTag `json:"dynamicTag,omitempty"` + + // SiteId: Site ID of this dynamic tag. + SiteId int64 `json:"siteId,omitempty,string"` + + // SiteIdDimensionValue: Dimension value for the ID of the site. This is + // a read-only, auto-generated field. + SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"` + + // ViewThrough: Whether this tag is applicable only for view-throughs. + ViewThrough bool `json:"viewThrough,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ClickThrough") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightActivityPublisherDynamicTag) MarshalJSON() ([]byte, error) { + type noMethod FloodlightActivityPublisherDynamicTag + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightConfiguration: Contains properties of a Floodlight +// configuration. +type FloodlightConfiguration struct { + // AccountId: Account ID of this floodlight configuration. This is a + // read-only field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of the parent advertiser of this + // floodlight configuration. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // AnalyticsDataSharingEnabled: Whether advertiser data is shared with + // Google Analytics. + AnalyticsDataSharingEnabled bool `json:"analyticsDataSharingEnabled,omitempty"` + + // ExposureToConversionEnabled: Whether the exposure-to-conversion + // report is enabled. This report shows detailed pathway information on + // up to 10 of the most recent ad exposures seen by a user before + // converting. + ExposureToConversionEnabled bool `json:"exposureToConversionEnabled,omitempty"` + + // FirstDayOfWeek: Day that will be counted as the first day of the week + // in reports. This is a required field. + // + // Possible values: + // "MONDAY" + // "SUNDAY" + FirstDayOfWeek string `json:"firstDayOfWeek,omitempty"` + + // Id: ID of this floodlight configuration. This is a read-only, + // auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this floodlight + // configuration. This is a read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // InAppAttributionTrackingEnabled: Whether in-app attribution tracking + // is enabled. + InAppAttributionTrackingEnabled bool `json:"inAppAttributionTrackingEnabled,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#floodlightConfiguration". + Kind string `json:"kind,omitempty"` + + // LookbackConfiguration: Lookback window settings for this floodlight + // configuration. + LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"` + + // NaturalSearchConversionAttributionOption: Types of attribution + // options for natural search conversions. + // + // Possible values: + // "EXCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION" + // "INCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION" + // "INCLUDE_NATURAL_SEARCH_TIERED_CONVERSION_ATTRIBUTION" + NaturalSearchConversionAttributionOption string `json:"naturalSearchConversionAttributionOption,omitempty"` + + // OmnitureSettings: Settings for DCM Omniture integration. + OmnitureSettings *OmnitureSettings `json:"omnitureSettings,omitempty"` + + // SslRequired: Whether floodlight activities owned by this + // configuration are required to be SSL-compliant. + SslRequired bool `json:"sslRequired,omitempty"` + + // StandardVariableTypes: List of standard variables enabled for this + // configuration. + // + // Acceptable values are: + // - "ORD" + // - "NUM" + // + // Possible values: + // "NUM" + // "ORD" + // "TRAN" + // "U" + StandardVariableTypes []string `json:"standardVariableTypes,omitempty"` + + // SubaccountId: Subaccount ID of this floodlight configuration. This is + // a read-only field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TagSettings: Configuration settings for dynamic and image floodlight + // tags. + TagSettings *TagSettings `json:"tagSettings,omitempty"` + + // ThirdPartyAuthenticationTokens: List of third-party authentication + // tokens enabled for this configuration. + ThirdPartyAuthenticationTokens []*ThirdPartyAuthenticationToken `json:"thirdPartyAuthenticationTokens,omitempty"` + + // UserDefinedVariableConfigurations: List of user defined variables + // enabled for this configuration. + UserDefinedVariableConfigurations []*UserDefinedVariableConfiguration `json:"userDefinedVariableConfigurations,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightConfiguration) MarshalJSON() ([]byte, error) { + type noMethod FloodlightConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightConfigurationsListResponse: Floodlight Configuration List +// Response +type FloodlightConfigurationsListResponse struct { + // FloodlightConfigurations: Floodlight configuration collection. + FloodlightConfigurations []*FloodlightConfiguration `json:"floodlightConfigurations,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#floodlightConfigurationsListResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "FloodlightConfigurations") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightConfigurationsListResponse) MarshalJSON() ([]byte, error) { + type noMethod FloodlightConfigurationsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FloodlightReportCompatibleFields: Represents fields that are +// compatible to be selected for a report of type "FlOODLIGHT". +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionFilters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FloodlightReportCompatibleFields) MarshalJSON() ([]byte, error) { + type noMethod FloodlightReportCompatibleFields + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FrequencyCap: Frequency Cap. +type FrequencyCap struct { + // Duration: Duration of time, in seconds, for this frequency cap. The + // maximum duration is 90 days in seconds, or 7,776,000. + Duration int64 `json:"duration,omitempty,string"` + + // Impressions: Number of times an individual user can be served the ad + // within the specified duration. The maximum allowed is 15. + Impressions int64 `json:"impressions,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Duration") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FrequencyCap) MarshalJSON() ([]byte, error) { + type noMethod FrequencyCap + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FsCommand: FsCommand. +type FsCommand struct { + // Left: Distance from the left of the browser.Applicable when + // positionOption is DISTANCE_FROM_TOP_LEFT_CORNER. + Left int64 `json:"left,omitempty"` + + // PositionOption: Position in the browser where the window will open. + // + // Possible values: + // "CENTERED" + // "DISTANCE_FROM_TOP_LEFT_CORNER" + PositionOption string `json:"positionOption,omitempty"` + + // Top: Distance from the top of the browser. Applicable when + // positionOption is DISTANCE_FROM_TOP_LEFT_CORNER. + Top int64 `json:"top,omitempty"` + + // WindowHeight: Height of the window. + WindowHeight int64 `json:"windowHeight,omitempty"` + + // WindowWidth: Width of the window. + WindowWidth int64 `json:"windowWidth,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Left") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FsCommand) MarshalJSON() ([]byte, error) { + type noMethod FsCommand + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GeoTargeting: Geographical Targeting. +type GeoTargeting struct { + // Cities: Cities to be targeted. For each city only dartId is required. + // The other fields are populated automatically when the ad is inserted + // or updated. If targeting a city, do not target or exclude the country + // of the city, and do not target the metro or region of the city. + Cities []*City `json:"cities,omitempty"` + + // Countries: Countries to be targeted or excluded from targeting, + // depending on the setting of the excludeCountries field. For each + // country only dartId is required. The other fields are populated + // automatically when the ad is inserted or updated. If targeting or + // excluding a country, do not target regions, cities, metros, or postal + // codes in the same country. + Countries []*Country `json:"countries,omitempty"` + + // ExcludeCountries: Whether or not to exclude the countries in the + // countries field from targeting. If false, the countries field refers + // to countries which will be targeted by the ad. + ExcludeCountries bool `json:"excludeCountries,omitempty"` + + // Metros: Metros to be targeted. For each metro only dmaId is required. + // The other fields are populated automatically when the ad is inserted + // or updated. If targeting a metro, do not target or exclude the + // country of the metro. + Metros []*Metro `json:"metros,omitempty"` + + // PostalCodes: Postal codes to be targeted. For each postal code only + // id is required. The other fields are populated automatically when the + // ad is inserted or updated. If targeting a postal code, do not target + // or exclude the country of the postal code. + PostalCodes []*PostalCode `json:"postalCodes,omitempty"` + + // Regions: Regions to be targeted. For each region only dartId is + // required. The other fields are populated automatically when the ad is + // inserted or updated. If targeting a region, do not target or exclude + // the country of the region. + Regions []*Region `json:"regions,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Cities") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoTargeting) MarshalJSON() ([]byte, error) { + type noMethod GeoTargeting + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InventoryItem: Represents a buy from the DoubleClick Planning +// inventory store. +type InventoryItem struct { + // AccountId: Account ID of this inventory item. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdSlots: Ad slots of this inventory item. If this inventory item + // represents a standalone placement, there will be exactly one ad slot. + // If this inventory item represents a placement group, there will be + // more than one ad slot, each representing one child placement in that + // placement group. + AdSlots []*AdSlot `json:"adSlots,omitempty"` + + // AdvertiserId: Advertiser ID of this inventory item. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // ContentCategoryId: Content category ID of this inventory item. + ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"` + + // EstimatedClickThroughRate: Estimated click-through rate of this + // inventory item. + EstimatedClickThroughRate int64 `json:"estimatedClickThroughRate,omitempty,string"` + + // EstimatedConversionRate: Estimated conversion rate of this inventory + // item. + EstimatedConversionRate int64 `json:"estimatedConversionRate,omitempty,string"` + + // Id: ID of this inventory item. + Id int64 `json:"id,omitempty,string"` + + // InPlan: Whether this inventory item is in plan. + InPlan bool `json:"inPlan,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#inventoryItem". + Kind string `json:"kind,omitempty"` + + // LastModifiedInfo: Information about the most recent modification of + // this inventory item. + LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"` + + // Name: Name of this inventory item. For standalone inventory items, + // this is the same name as that of its only ad slot. For group + // inventory items, this can differ from the name of any of its ad + // slots. + Name string `json:"name,omitempty"` + + // NegotiationChannelId: Negotiation channel ID of this inventory item. + NegotiationChannelId int64 `json:"negotiationChannelId,omitempty,string"` + + // OrderId: Order ID of this inventory item. + OrderId int64 `json:"orderId,omitempty,string"` + + // PlacementStrategyId: Placement strategy ID of this inventory item. + PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"` + + // Pricing: Pricing of this inventory item. + Pricing *Pricing `json:"pricing,omitempty"` + + // ProjectId: Project ID of this inventory item. + ProjectId int64 `json:"projectId,omitempty,string"` + + // RfpId: RFP ID of this inventory item. + RfpId int64 `json:"rfpId,omitempty,string"` + + // SiteId: ID of the site this inventory item is associated with. + SiteId int64 `json:"siteId,omitempty,string"` + + // SubaccountId: Subaccount ID of this inventory item. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InventoryItem) MarshalJSON() ([]byte, error) { + type noMethod InventoryItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InventoryItemsListResponse: Inventory item List Response +type InventoryItemsListResponse struct { + // InventoryItems: Inventory item collection + InventoryItems []*InventoryItem `json:"inventoryItems,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#inventoryItemsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "InventoryItems") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InventoryItemsListResponse) MarshalJSON() ([]byte, error) { + type noMethod InventoryItemsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// KeyValueTargetingExpression: Key Value Targeting Expression. +type KeyValueTargetingExpression struct { + // Expression: Keyword expression being targeted by the ad. + Expression string `json:"expression,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Expression") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *KeyValueTargetingExpression) MarshalJSON() ([]byte, error) { + type noMethod KeyValueTargetingExpression + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LandingPage: Contains information about where a user's browser is +// taken after the user clicks an ad. +type LandingPage struct { + // Default: Whether or not this landing page will be assigned to any ads + // or creatives that do not have a landing page assigned explicitly. + // Only one default landing page is allowed per campaign. + Default bool `json:"default,omitempty"` + + // Id: ID of this landing page. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#landingPage". + Kind string `json:"kind,omitempty"` + + // Name: Name of this landing page. This is a required field. It must be + // less than 256 characters long, and must be unique among landing pages + // of the same campaign. + Name string `json:"name,omitempty"` + + // Url: URL of this landing page. This is a required field. + Url string `json:"url,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Default") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LandingPage) MarshalJSON() ([]byte, error) { + type noMethod LandingPage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LandingPagesListResponse: Landing Page List Response +type LandingPagesListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#landingPagesListResponse". + Kind string `json:"kind,omitempty"` + + // LandingPages: Landing page collection + LandingPages []*LandingPage `json:"landingPages,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LandingPagesListResponse) MarshalJSON() ([]byte, error) { + type noMethod LandingPagesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LastModifiedInfo: Modification timestamp. +type LastModifiedInfo struct { + // Time: Timestamp of the last change in milliseconds since epoch. + Time int64 `json:"time,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Time") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LastModifiedInfo) MarshalJSON() ([]byte, error) { + type noMethod LastModifiedInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListPopulationClause: A group clause made up of list population terms +// representing constraints joined by ORs. +type ListPopulationClause struct { + // Terms: Terms of this list population clause. Each clause is made up + // of list population terms representing constraints and are joined by + // ORs. + Terms []*ListPopulationTerm `json:"terms,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Terms") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListPopulationClause) MarshalJSON() ([]byte, error) { + type noMethod ListPopulationClause + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListPopulationRule: Remarketing List Population Rule. +type ListPopulationRule struct { + // FloodlightActivityId: Floodlight activity ID associated with this + // rule. This field can be left blank. + FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"` + + // FloodlightActivityName: Name of floodlight activity associated with + // this rule. This is a read-only, auto-generated field. + FloodlightActivityName string `json:"floodlightActivityName,omitempty"` + + // ListPopulationClauses: Clauses that make up this list population + // rule. Clauses are joined by ANDs, and the clauses themselves are made + // up of list population terms which are joined by ORs. + ListPopulationClauses []*ListPopulationClause `json:"listPopulationClauses,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "FloodlightActivityId") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListPopulationRule) MarshalJSON() ([]byte, error) { + type noMethod ListPopulationRule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListPopulationTerm: Remarketing List Population Rule Term. +type ListPopulationTerm struct { + // Contains: Will be true if the term should check if the user is in the + // list and false if the term should check if the user is not in the + // list. This field is only relevant when type is set to + // LIST_MEMBERSHIP_TERM. False by default. + Contains bool `json:"contains,omitempty"` + + // Negation: Whether to negate the comparison result of this term during + // rule evaluation. This field is only relevant when type is left unset + // or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM. + Negation bool `json:"negation,omitempty"` + + // Operator: Comparison operator of this term. This field is only + // relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or + // REFERRER_TERM. + // + // Possible values: + // "NUM_EQUALS" + // "NUM_GREATER_THAN" + // "NUM_GREATER_THAN_EQUAL" + // "NUM_LESS_THAN" + // "NUM_LESS_THAN_EQUAL" + // "STRING_CONTAINS" + // "STRING_EQUALS" + Operator string `json:"operator,omitempty"` + + // RemarketingListId: ID of the list in question. This field is only + // relevant when type is set to LIST_MEMBERSHIP_TERM. + RemarketingListId int64 `json:"remarketingListId,omitempty,string"` + + // Type: List population term type determines the applicable fields in + // this object. If left unset or set to CUSTOM_VARIABLE_TERM, then + // variableName, variableFriendlyName, operator, value, and negation are + // applicable. If set to LIST_MEMBERSHIP_TERM then remarketingListId and + // contains are applicable. If set to REFERRER_TERM then operator, + // value, and negation are applicable. + // + // Possible values: + // "CUSTOM_VARIABLE_TERM" + // "LIST_MEMBERSHIP_TERM" + // "REFERRER_TERM" + Type string `json:"type,omitempty"` + + // Value: Literal to compare the variable to. This field is only + // relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or + // REFERRER_TERM. + Value string `json:"value,omitempty"` + + // VariableFriendlyName: Friendly name of this term's variable. This is + // a read-only, auto-generated field. This field is only relevant when + // type is left unset or set to CUSTOM_VARIABLE_TERM. + VariableFriendlyName string `json:"variableFriendlyName,omitempty"` + + // VariableName: Name of the variable (U1, U2, etc.) being compared in + // this term. This field is only relevant when type is set to null, + // CUSTOM_VARIABLE_TERM or REFERRER_TERM. + VariableName string `json:"variableName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Contains") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListPopulationTerm) MarshalJSON() ([]byte, error) { + type noMethod ListPopulationTerm + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListTargetingExpression: Remarketing List Targeting Expression. +type ListTargetingExpression struct { + // Expression: Expression describing which lists are being targeted by + // the ad. + Expression string `json:"expression,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Expression") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListTargetingExpression) MarshalJSON() ([]byte, error) { + type noMethod ListTargetingExpression + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LookbackConfiguration: Lookback configuration settings. +type LookbackConfiguration struct { + // ClickDuration: Lookback window, in days, from the last time a given + // user clicked on one of your ads. If you enter 0, clicks will not be + // considered as triggering events for floodlight tracking. If you leave + // this field blank, the default value for your account will be used. + ClickDuration int64 `json:"clickDuration,omitempty"` + + // PostImpressionActivitiesDuration: Lookback window, in days, from the + // last time a given user viewed one of your ads. If you enter 0, + // impressions will not be considered as triggering events for + // floodlight tracking. If you leave this field blank, the default value + // for your account will be used. + PostImpressionActivitiesDuration int64 `json:"postImpressionActivitiesDuration,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ClickDuration") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LookbackConfiguration) MarshalJSON() ([]byte, error) { + type noMethod LookbackConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Metric: Represents a metric. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Metric) MarshalJSON() ([]byte, error) { + type noMethod Metric + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Metro: Contains information about a metro region that can be targeted +// by ads. +type Metro struct { + // CountryCode: Country code of the country to which this metro region + // belongs. + CountryCode string `json:"countryCode,omitempty"` + + // CountryDartId: DART ID of the country to which this metro region + // belongs. + CountryDartId int64 `json:"countryDartId,omitempty,string"` + + // DartId: DART ID of this metro region. + DartId int64 `json:"dartId,omitempty,string"` + + // DmaId: DMA ID of this metro region. This is the ID used for targeting + // and generating reports, and is equivalent to metro_code. + DmaId int64 `json:"dmaId,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#metro". + Kind string `json:"kind,omitempty"` + + // MetroCode: Metro code of this metro region. This is equivalent to + // dma_id. + MetroCode string `json:"metroCode,omitempty"` + + // Name: Name of this metro region. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CountryCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Metro) MarshalJSON() ([]byte, error) { + type noMethod Metro + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MetrosListResponse: Metro List Response +type MetrosListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#metrosListResponse". + Kind string `json:"kind,omitempty"` + + // Metros: Metro collection. + Metros []*Metro `json:"metros,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MetrosListResponse) MarshalJSON() ([]byte, error) { + type noMethod MetrosListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MobileCarrier: Contains information about a mobile carrier that can +// be targeted by ads. +type MobileCarrier struct { + // CountryCode: Country code of the country to which this mobile carrier + // belongs. + CountryCode string `json:"countryCode,omitempty"` + + // CountryDartId: DART ID of the country to which this mobile carrier + // belongs. + CountryDartId int64 `json:"countryDartId,omitempty,string"` + + // Id: ID of this mobile carrier. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#mobileCarrier". + Kind string `json:"kind,omitempty"` + + // Name: Name of this mobile carrier. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CountryCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MobileCarrier) MarshalJSON() ([]byte, error) { + type noMethod MobileCarrier + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MobileCarriersListResponse: Mobile Carrier List Response +type MobileCarriersListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#mobileCarriersListResponse". + Kind string `json:"kind,omitempty"` + + // MobileCarriers: Mobile carrier collection. + MobileCarriers []*MobileCarrier `json:"mobileCarriers,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MobileCarriersListResponse) MarshalJSON() ([]byte, error) { + type noMethod MobileCarriersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ObjectFilter: Object Filter. +type ObjectFilter struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#objectFilter". + Kind string `json:"kind,omitempty"` + + // ObjectIds: Applicable when status is ASSIGNED. The user has access to + // objects with these object IDs. + ObjectIds googleapi.Int64s `json:"objectIds,omitempty"` + + // Status: Status of the filter. NONE means the user has access to none + // of the objects. ALL means the user has access to all objects. + // ASSIGNED means the user has access to the objects with IDs in the + // objectIds list. + // + // Possible values: + // "ALL" + // "ASSIGNED" + // "NONE" + Status string `json:"status,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ObjectFilter) MarshalJSON() ([]byte, error) { + type noMethod ObjectFilter + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OffsetPosition: Offset Position. +type OffsetPosition struct { + // Left: Offset distance from left side of an asset or a window. + Left int64 `json:"left,omitempty"` + + // Top: Offset distance from top side of an asset or a window. + Top int64 `json:"top,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Left") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OffsetPosition) MarshalJSON() ([]byte, error) { + type noMethod OffsetPosition + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OmnitureSettings: Omniture Integration Settings. +type OmnitureSettings struct { + // OmnitureCostDataEnabled: Whether placement cost data will be sent to + // Omniture. This property can be enabled only if + // omnitureIntegrationEnabled is true. + OmnitureCostDataEnabled bool `json:"omnitureCostDataEnabled,omitempty"` + + // OmnitureIntegrationEnabled: Whether Omniture integration is enabled. + // This property can be enabled only when the "Advanced Ad Serving" + // account setting is enabled. + OmnitureIntegrationEnabled bool `json:"omnitureIntegrationEnabled,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "OmnitureCostDataEnabled") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OmnitureSettings) MarshalJSON() ([]byte, error) { + type noMethod OmnitureSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperatingSystem: Contains information about an operating system that +// can be targeted by ads. +type OperatingSystem struct { + // DartId: DART ID of this operating system. This is the ID used for + // targeting. + DartId int64 `json:"dartId,omitempty,string"` + + // Desktop: Whether this operating system is for desktop. + Desktop bool `json:"desktop,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#operatingSystem". + Kind string `json:"kind,omitempty"` + + // Mobile: Whether this operating system is for mobile. + Mobile bool `json:"mobile,omitempty"` + + // Name: Name of this operating system. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DartId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperatingSystem) MarshalJSON() ([]byte, error) { + type noMethod OperatingSystem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperatingSystemVersion: Contains information about a particular +// version of an operating system that can be targeted by ads. +type OperatingSystemVersion struct { + // Id: ID of this operating system version. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#operatingSystemVersion". + Kind string `json:"kind,omitempty"` + + // MajorVersion: Major version (leftmost number) of this operating + // system version. + MajorVersion string `json:"majorVersion,omitempty"` + + // MinorVersion: Minor version (number after the first dot) of this + // operating system version. + MinorVersion string `json:"minorVersion,omitempty"` + + // Name: Name of this operating system version. + Name string `json:"name,omitempty"` + + // OperatingSystem: Operating system of this operating system version. + OperatingSystem *OperatingSystem `json:"operatingSystem,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperatingSystemVersion) MarshalJSON() ([]byte, error) { + type noMethod OperatingSystemVersion + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperatingSystemVersionsListResponse: Operating System Version List +// Response +type OperatingSystemVersionsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#operatingSystemVersionsListResponse". + Kind string `json:"kind,omitempty"` + + // OperatingSystemVersions: Operating system version collection. + OperatingSystemVersions []*OperatingSystemVersion `json:"operatingSystemVersions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperatingSystemVersionsListResponse) MarshalJSON() ([]byte, error) { + type noMethod OperatingSystemVersionsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperatingSystemsListResponse: Operating System List Response +type OperatingSystemsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#operatingSystemsListResponse". + Kind string `json:"kind,omitempty"` + + // OperatingSystems: Operating system collection. + OperatingSystems []*OperatingSystem `json:"operatingSystems,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperatingSystemsListResponse) MarshalJSON() ([]byte, error) { + type noMethod OperatingSystemsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OptimizationActivity: Creative optimization activity. +type OptimizationActivity struct { + // FloodlightActivityId: Floodlight activity ID of this optimization + // activity. This is a required field. + FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"` + + // FloodlightActivityIdDimensionValue: Dimension value for the ID of the + // floodlight activity. This is a read-only, auto-generated field. + FloodlightActivityIdDimensionValue *DimensionValue `json:"floodlightActivityIdDimensionValue,omitempty"` + + // Weight: Weight associated with this optimization. Must be greater + // than 1. The weight assigned will be understood in proportion to the + // weights assigned to the other optimization activities. + Weight int64 `json:"weight,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "FloodlightActivityId") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OptimizationActivity) MarshalJSON() ([]byte, error) { + type noMethod OptimizationActivity + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Order: Describes properties of a DoubleClick Planning order. +type Order struct { + // AccountId: Account ID of this order. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this order. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // ApproverUserProfileIds: IDs for users that have to approve documents + // created for this order. + ApproverUserProfileIds googleapi.Int64s `json:"approverUserProfileIds,omitempty"` + + // BuyerInvoiceId: Buyer invoice ID associated with this order. + BuyerInvoiceId string `json:"buyerInvoiceId,omitempty"` + + // BuyerOrganizationName: Name of the buyer organization. + BuyerOrganizationName string `json:"buyerOrganizationName,omitempty"` + + // Comments: Comments in this order. + Comments string `json:"comments,omitempty"` + + // Contacts: Contacts for this order. + Contacts []*OrderContact `json:"contacts,omitempty"` + + // Id: ID of this order. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#order". + Kind string `json:"kind,omitempty"` + + // LastModifiedInfo: Information about the most recent modification of + // this order. + LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"` + + // Name: Name of this order. + Name string `json:"name,omitempty"` + + // Notes: Notes of this order. + Notes string `json:"notes,omitempty"` + + // PlanningTermId: ID of the terms and conditions template used in this + // order. + PlanningTermId int64 `json:"planningTermId,omitempty,string"` + + // ProjectId: Project ID of this order. + ProjectId int64 `json:"projectId,omitempty,string"` + + // SellerOrderId: Seller order ID associated with this order. + SellerOrderId string `json:"sellerOrderId,omitempty"` + + // SellerOrganizationName: Name of the seller organization. + SellerOrganizationName string `json:"sellerOrganizationName,omitempty"` + + // SiteId: Site IDs this order is associated with. + SiteId googleapi.Int64s `json:"siteId,omitempty"` + + // SiteNames: Free-form site names this order is associated with. + SiteNames []string `json:"siteNames,omitempty"` + + // SubaccountId: Subaccount ID of this order. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TermsAndConditions: Terms and conditions of this order. + TermsAndConditions string `json:"termsAndConditions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Order) MarshalJSON() ([]byte, error) { + type noMethod Order + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OrderContact: Contact of an order. +type OrderContact struct { + // ContactInfo: Free-form information about this contact. It could be + // any information related to this contact in addition to type, title, + // name, and signature user profile ID. + ContactInfo string `json:"contactInfo,omitempty"` + + // ContactName: Name of this contact. + ContactName string `json:"contactName,omitempty"` + + // ContactTitle: Title of this contact. + ContactTitle string `json:"contactTitle,omitempty"` + + // ContactType: Type of this contact. + // + // Possible values: + // "PLANNING_ORDER_CONTACT_BUYER_BILLING_CONTACT" + // "PLANNING_ORDER_CONTACT_BUYER_CONTACT" + // "PLANNING_ORDER_CONTACT_SELLER_CONTACT" + ContactType string `json:"contactType,omitempty"` + + // SignatureUserProfileId: ID of the user profile containing the + // signature that will be embedded into order documents. + SignatureUserProfileId int64 `json:"signatureUserProfileId,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "ContactInfo") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderContact) MarshalJSON() ([]byte, error) { + type noMethod OrderContact + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OrderDocument: Contains properties of a DoubleClick Planning order +// document. +type OrderDocument struct { + // AccountId: Account ID of this order document. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this order document. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AmendedOrderDocumentId: The amended order document ID of this order + // document. An order document can be created by optionally amending + // another order document so that the change history can be preserved. + AmendedOrderDocumentId int64 `json:"amendedOrderDocumentId,omitempty,string"` + + // ApprovedByUserProfileIds: IDs of users who have approved this order + // document. + ApprovedByUserProfileIds googleapi.Int64s `json:"approvedByUserProfileIds,omitempty"` + + // Cancelled: Whether this order document is cancelled. + Cancelled bool `json:"cancelled,omitempty"` + + // CreatedInfo: Information about the creation of this order document. + CreatedInfo *LastModifiedInfo `json:"createdInfo,omitempty"` + + // EffectiveDate: Effective date of this order document. + EffectiveDate string `json:"effectiveDate,omitempty"` + + // Id: ID of this order document. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#orderDocument". + Kind string `json:"kind,omitempty"` + + // LastSentRecipients: List of email addresses that received the last + // sent document. + LastSentRecipients []string `json:"lastSentRecipients,omitempty"` + + // LastSentTime: Timestamp of the last email sent with this order + // document. + LastSentTime string `json:"lastSentTime,omitempty"` + + // OrderId: ID of the order from which this order document is created. + OrderId int64 `json:"orderId,omitempty,string"` + + // ProjectId: Project ID of this order document. + ProjectId int64 `json:"projectId,omitempty,string"` + + // Signed: Whether this order document has been signed. + Signed bool `json:"signed,omitempty"` + + // SubaccountId: Subaccount ID of this order document. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // Title: Title of this order document. + Title string `json:"title,omitempty"` + + // Type: Type of this order document + // + // Possible values: + // "PLANNING_ORDER_TYPE_CHANGE_ORDER" + // "PLANNING_ORDER_TYPE_INSERTION_ORDER" + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderDocument) MarshalJSON() ([]byte, error) { + type noMethod OrderDocument + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OrderDocumentsListResponse: Order document List Response +type OrderDocumentsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#orderDocumentsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // OrderDocuments: Order document collection + OrderDocuments []*OrderDocument `json:"orderDocuments,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrderDocumentsListResponse) MarshalJSON() ([]byte, error) { + type noMethod OrderDocumentsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OrdersListResponse: Order List Response +type OrdersListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#ordersListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Orders: Order collection. + Orders []*Order `json:"orders,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OrdersListResponse) MarshalJSON() ([]byte, error) { + type noMethod OrdersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PathToConversionReportCompatibleFields: Represents fields that are +// compatible to be selected for a report of type "PATH_TO_CONVERSION". +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"` + + // ForceSendFields is a list of field names (e.g. + // "ConversionDimensions") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PathToConversionReportCompatibleFields) MarshalJSON() ([]byte, error) { + type noMethod PathToConversionReportCompatibleFields + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Placement: Contains properties of a placement. +type Placement struct { + // AccountId: Account ID of this placement. This field can be left + // blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this placement. This field can be left + // blank. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // Archived: Whether this placement is archived. + Archived bool `json:"archived,omitempty"` + + // CampaignId: Campaign ID of this placement. This field is a required + // field on insertion. + CampaignId int64 `json:"campaignId,omitempty,string"` + + // CampaignIdDimensionValue: Dimension value for the ID of the campaign. + // This is a read-only, auto-generated field. + CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"` + + // Comment: Comments for this placement. + Comment string `json:"comment,omitempty"` + + // Compatibility: Placement compatibility. WEB and WEB_INTERSTITIAL + // refer to rendering either on desktop or on mobile devices for regular + // or interstitial ads, respectively. APP and APP_INTERSTITIAL are for + // rendering in mobile apps.IN_STREAM_VIDEO refers to rendering in + // in-stream video ads developed with the VAST standard. This field is + // required on insertion. + // + // Possible values: + // "APP" + // "APP_INTERSTITIAL" + // "IN_STREAM_VIDEO" + // "WEB" + // "WEB_INTERSTITIAL" + Compatibility string `json:"compatibility,omitempty"` + + // ContentCategoryId: ID of the content category assigned to this + // placement. + ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"` + + // CreateInfo: Information about the creation of this placement. This is + // a read-only field. + CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"` + + // DirectorySiteId: Directory site ID of this placement. On insert, you + // must set either this field or the siteId field to specify the site + // associated with this placement. This is a required field that is + // read-only after insertion. + DirectorySiteId int64 `json:"directorySiteId,omitempty,string"` + + // DirectorySiteIdDimensionValue: Dimension value for the ID of the + // directory site. This is a read-only, auto-generated field. + DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"` + + // ExternalId: External ID for this placement. + ExternalId string `json:"externalId,omitempty"` + + // Id: ID of this placement. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this placement. This + // is a read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // KeyName: Key name of this placement. This is a read-only, + // auto-generated field. + KeyName string `json:"keyName,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#placement". + Kind string `json:"kind,omitempty"` + + // LastModifiedInfo: Information about the most recent modification of + // this placement. This is a read-only field. + LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"` + + // LookbackConfiguration: Lookback window settings for this placement. + LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"` + + // Name: Name of this placement.This is a required field and must be + // less than 256 characters long. + Name string `json:"name,omitempty"` + + // PaymentApproved: Whether payment was approved for this placement. + // This is a read-only field relevant only to publisher-paid placements. + PaymentApproved bool `json:"paymentApproved,omitempty"` + + // PaymentSource: Payment source for this placement. This is a required + // field that is read-only after insertion. + // + // Possible values: + // "PLACEMENT_AGENCY_PAID" + // "PLACEMENT_PUBLISHER_PAID" + PaymentSource string `json:"paymentSource,omitempty"` + + // PlacementGroupId: ID of this placement's group, if applicable. + PlacementGroupId int64 `json:"placementGroupId,omitempty,string"` + + // PlacementGroupIdDimensionValue: Dimension value for the ID of the + // placement group. This is a read-only, auto-generated field. + PlacementGroupIdDimensionValue *DimensionValue `json:"placementGroupIdDimensionValue,omitempty"` + + // PlacementStrategyId: ID of the placement strategy assigned to this + // placement. + PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"` + + // PricingSchedule: Pricing schedule of this placement. This field is + // required on insertion, specifically subfields startDate, endDate and + // pricingType. + PricingSchedule *PricingSchedule `json:"pricingSchedule,omitempty"` + + // Primary: Whether this placement is the primary placement of a + // roadblock (placement group). You cannot change this field from true + // to false. Setting this field to true will automatically set the + // primary field on the original primary placement of the roadblock to + // false, and it will automatically set the roadblock's + // primaryPlacementId field to the ID of this placement. + Primary bool `json:"primary,omitempty"` + + // PublisherUpdateInfo: Information about the last publisher update. + // This is a read-only field. + PublisherUpdateInfo *LastModifiedInfo `json:"publisherUpdateInfo,omitempty"` + + // SiteId: Site ID associated with this placement. On insert, you must + // set either this field or the directorySiteId field to specify the + // site associated with this placement. This is a required field that is + // read-only after insertion. + SiteId int64 `json:"siteId,omitempty,string"` + + // SiteIdDimensionValue: Dimension value for the ID of the site. This is + // a read-only, auto-generated field. + SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"` + + // Size: Size associated with this placement. When inserting or updating + // a placement, only the size ID field is used. This field is required + // on insertion. + Size *Size `json:"size,omitempty"` + + // SslRequired: Whether creatives assigned to this placement must be + // SSL-compliant. + SslRequired bool `json:"sslRequired,omitempty"` + + // Status: Third-party placement status. + // + // Possible values: + // "ACKNOWLEDGE_ACCEPTANCE" + // "ACKNOWLEDGE_REJECTION" + // "DRAFT" + // "PAYMENT_ACCEPTED" + // "PAYMENT_REJECTED" + // "PENDING_REVIEW" + Status string `json:"status,omitempty"` + + // SubaccountId: Subaccount ID of this placement. This field can be left + // blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TagFormats: Tag formats to generate for this placement. This field is + // required on insertion. + // Acceptable values are: + // - "PLACEMENT_TAG_STANDARD" + // - "PLACEMENT_TAG_IFRAME_JAVASCRIPT" + // - "PLACEMENT_TAG_IFRAME_ILAYER" + // - "PLACEMENT_TAG_INTERNAL_REDIRECT" + // - "PLACEMENT_TAG_JAVASCRIPT" + // - "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT" + // - "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT" + // - "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT" + // - "PLACEMENT_TAG_CLICK_COMMANDS" + // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH" + // - "PLACEMENT_TAG_TRACKING" + // - "PLACEMENT_TAG_TRACKING_IFRAME" + // - "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + // + // Possible values: + // "PLACEMENT_TAG_CLICK_COMMANDS" + // "PLACEMENT_TAG_IFRAME_ILAYER" + // "PLACEMENT_TAG_IFRAME_JAVASCRIPT" + // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY" + // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH" + // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3" + // "PLACEMENT_TAG_INTERNAL_REDIRECT" + // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT" + // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY" + // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT" + // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT" + // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY" + // "PLACEMENT_TAG_JAVASCRIPT" + // "PLACEMENT_TAG_JAVASCRIPT_LEGACY" + // "PLACEMENT_TAG_STANDARD" + // "PLACEMENT_TAG_TRACKING" + // "PLACEMENT_TAG_TRACKING_IFRAME" + // "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + TagFormats []string `json:"tagFormats,omitempty"` + + // TagSetting: Tag settings for this placement. + TagSetting *TagSetting `json:"tagSetting,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Placement) MarshalJSON() ([]byte, error) { + type noMethod Placement + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlacementAssignment: Placement Assignment. +type PlacementAssignment struct { + // Active: Whether this placement assignment is active. When true, the + // placement will be included in the ad's rotation. + Active bool `json:"active,omitempty"` + + // PlacementId: ID of the placement to be assigned. This is a required + // field. + PlacementId int64 `json:"placementId,omitempty,string"` + + // PlacementIdDimensionValue: Dimension value for the ID of the + // placement. This is a read-only, auto-generated field. + PlacementIdDimensionValue *DimensionValue `json:"placementIdDimensionValue,omitempty"` + + // SslRequired: Whether the placement to be assigned requires SSL. This + // is a read-only field that is auto-generated when the ad is inserted + // or updated. + SslRequired bool `json:"sslRequired,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Active") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlacementAssignment) MarshalJSON() ([]byte, error) { + type noMethod PlacementAssignment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlacementGroup: Contains properties of a package or roadblock. +type PlacementGroup struct { + // AccountId: Account ID of this placement group. This is a read-only + // field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this placement group. This is a + // required field on insertion. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // Archived: Whether this placement group is archived. + Archived bool `json:"archived,omitempty"` + + // CampaignId: Campaign ID of this placement group. This field is + // required on insertion. + CampaignId int64 `json:"campaignId,omitempty,string"` + + // CampaignIdDimensionValue: Dimension value for the ID of the campaign. + // This is a read-only, auto-generated field. + CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"` + + // ChildPlacementIds: IDs of placements which are assigned to this + // placement group. This is a read-only, auto-generated field. + ChildPlacementIds googleapi.Int64s `json:"childPlacementIds,omitempty"` + + // Comment: Comments for this placement group. + Comment string `json:"comment,omitempty"` + + // ContentCategoryId: ID of the content category assigned to this + // placement group. + ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"` + + // CreateInfo: Information about the creation of this placement group. + // This is a read-only field. + CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"` + + // DirectorySiteId: Directory site ID associated with this placement + // group. On insert, you must set either this field or the site_id field + // to specify the site associated with this placement group. This is a + // required field that is read-only after insertion. + DirectorySiteId int64 `json:"directorySiteId,omitempty,string"` + + // DirectorySiteIdDimensionValue: Dimension value for the ID of the + // directory site. This is a read-only, auto-generated field. + DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"` + + // ExternalId: External ID for this placement. + ExternalId string `json:"externalId,omitempty"` + + // Id: ID of this placement group. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this placement group. + // This is a read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#placementGroup". + Kind string `json:"kind,omitempty"` + + // LastModifiedInfo: Information about the most recent modification of + // this placement group. This is a read-only field. + LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"` + + // Name: Name of this placement group. This is a required field and must + // be less than 256 characters long. + Name string `json:"name,omitempty"` + + // PlacementGroupType: Type of this placement group. A package is a + // simple group of placements that acts as a single pricing point for a + // group of tags. A roadblock is a group of placements that not only + // acts as a single pricing point, but also assumes that all the tags in + // it will be served at the same time. A roadblock requires one of its + // assigned placements to be marked as primary for reporting. This field + // is required on insertion. + // + // Possible values: + // "PLACEMENT_PACKAGE" + // "PLACEMENT_ROADBLOCK" + PlacementGroupType string `json:"placementGroupType,omitempty"` + + // PlacementStrategyId: ID of the placement strategy assigned to this + // placement group. + PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"` + + // PricingSchedule: Pricing schedule of this placement group. This field + // is required on insertion. + PricingSchedule *PricingSchedule `json:"pricingSchedule,omitempty"` + + // PrimaryPlacementId: ID of the primary placement, used to calculate + // the media cost of a roadblock (placement group). Modifying this field + // will automatically modify the primary field on all affected roadblock + // child placements. + PrimaryPlacementId int64 `json:"primaryPlacementId,omitempty,string"` + + // PrimaryPlacementIdDimensionValue: Dimension value for the ID of the + // primary placement. This is a read-only, auto-generated field. + PrimaryPlacementIdDimensionValue *DimensionValue `json:"primaryPlacementIdDimensionValue,omitempty"` + + // SiteId: Site ID associated with this placement group. On insert, you + // must set either this field or the directorySiteId field to specify + // the site associated with this placement group. This is a required + // field that is read-only after insertion. + SiteId int64 `json:"siteId,omitempty,string"` + + // SiteIdDimensionValue: Dimension value for the ID of the site. This is + // a read-only, auto-generated field. + SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"` + + // SubaccountId: Subaccount ID of this placement group. This is a + // read-only field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlacementGroup) MarshalJSON() ([]byte, error) { + type noMethod PlacementGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlacementGroupsListResponse: Placement Group List Response +type PlacementGroupsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#placementGroupsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // PlacementGroups: Placement group collection. + PlacementGroups []*PlacementGroup `json:"placementGroups,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlacementGroupsListResponse) MarshalJSON() ([]byte, error) { + type noMethod PlacementGroupsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlacementStrategiesListResponse: Placement Strategy List Response +type PlacementStrategiesListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#placementStrategiesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // PlacementStrategies: Placement strategy collection. + PlacementStrategies []*PlacementStrategy `json:"placementStrategies,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlacementStrategiesListResponse) MarshalJSON() ([]byte, error) { + type noMethod PlacementStrategiesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlacementStrategy: Contains properties of a placement strategy. +type PlacementStrategy struct { + // AccountId: Account ID of this placement strategy.This is a read-only + // field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // Id: ID of this placement strategy. This is a read-only, + // auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#placementStrategy". + Kind string `json:"kind,omitempty"` + + // Name: Name of this placement strategy. This is a required field. It + // must be less than 256 characters long and unique among placement + // strategies of the same account. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlacementStrategy) MarshalJSON() ([]byte, error) { + type noMethod PlacementStrategy + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlacementTag: Placement Tag +type PlacementTag struct { + // PlacementId: Placement ID + PlacementId int64 `json:"placementId,omitempty,string"` + + // TagDatas: Tags generated for this placement. + TagDatas []*TagData `json:"tagDatas,omitempty"` + + // ForceSendFields is a list of field names (e.g. "PlacementId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlacementTag) MarshalJSON() ([]byte, error) { + type noMethod PlacementTag + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlacementsGenerateTagsResponse: Placement GenerateTags Response +type PlacementsGenerateTagsResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#placementsGenerateTagsResponse". + Kind string `json:"kind,omitempty"` + + // PlacementTags: Set of generated tags for the specified placements. + PlacementTags []*PlacementTag `json:"placementTags,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlacementsGenerateTagsResponse) MarshalJSON() ([]byte, error) { + type noMethod PlacementsGenerateTagsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlacementsListResponse: Placement List Response +type PlacementsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#placementsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Placements: Placement collection. + Placements []*Placement `json:"placements,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlacementsListResponse) MarshalJSON() ([]byte, error) { + type noMethod PlacementsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlatformType: Contains information about a platform type that can be +// targeted by ads. +type PlatformType struct { + // Id: ID of this platform type. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#platformType". + Kind string `json:"kind,omitempty"` + + // Name: Name of this platform type. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlatformType) MarshalJSON() ([]byte, error) { + type noMethod PlatformType + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlatformTypesListResponse: Platform Type List Response +type PlatformTypesListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#platformTypesListResponse". + Kind string `json:"kind,omitempty"` + + // PlatformTypes: Platform type collection. + PlatformTypes []*PlatformType `json:"platformTypes,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlatformTypesListResponse) MarshalJSON() ([]byte, error) { + type noMethod PlatformTypesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PopupWindowProperties: Popup Window Properties. +type PopupWindowProperties struct { + // Dimension: Popup dimension for a creative. This is a read-only field. + // Applicable to the following creative types: all RICH_MEDIA and all + // VPAID + Dimension *Size `json:"dimension,omitempty"` + + // Offset: Upper-left corner coordinates of the popup window. Applicable + // if positionType is COORDINATES. + Offset *OffsetPosition `json:"offset,omitempty"` + + // PositionType: Popup window position either centered or at specific + // coordinate. + // + // Possible values: + // "CENTER" + // "COORDINATES" + PositionType string `json:"positionType,omitempty"` + + // ShowAddressBar: Whether to display the browser address bar. + ShowAddressBar bool `json:"showAddressBar,omitempty"` + + // ShowMenuBar: Whether to display the browser menu bar. + ShowMenuBar bool `json:"showMenuBar,omitempty"` + + // ShowScrollBar: Whether to display the browser scroll bar. + ShowScrollBar bool `json:"showScrollBar,omitempty"` + + // ShowStatusBar: Whether to display the browser status bar. + ShowStatusBar bool `json:"showStatusBar,omitempty"` + + // ShowToolBar: Whether to display the browser tool bar. + ShowToolBar bool `json:"showToolBar,omitempty"` + + // Title: Title of popup window. + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Dimension") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PopupWindowProperties) MarshalJSON() ([]byte, error) { + type noMethod PopupWindowProperties + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PostalCode: Contains information about a postal code that can be +// targeted by ads. +type PostalCode struct { + // Code: Postal code. This is equivalent to the id field. + Code string `json:"code,omitempty"` + + // CountryCode: Country code of the country to which this postal code + // belongs. + CountryCode string `json:"countryCode,omitempty"` + + // CountryDartId: DART ID of the country to which this postal code + // belongs. + CountryDartId int64 `json:"countryDartId,omitempty,string"` + + // Id: ID of this postal code. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#postalCode". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostalCode) MarshalJSON() ([]byte, error) { + type noMethod PostalCode + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PostalCodesListResponse: Postal Code List Response +type PostalCodesListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#postalCodesListResponse". + Kind string `json:"kind,omitempty"` + + // PostalCodes: Postal code collection. + PostalCodes []*PostalCode `json:"postalCodes,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostalCodesListResponse) MarshalJSON() ([]byte, error) { + type noMethod PostalCodesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Pricing: Pricing Information +type Pricing struct { + // CapCostType: Cap cost type of this inventory item. + // + // Possible values: + // "PLANNING_PLACEMENT_CAP_COST_TYPE_CUMULATIVE" + // "PLANNING_PLACEMENT_CAP_COST_TYPE_MONTHLY" + // "PLANNING_PLACEMENT_CAP_COST_TYPE_NONE" + CapCostType string `json:"capCostType,omitempty"` + + // EndDate: End date of this inventory item. + EndDate string `json:"endDate,omitempty"` + + // Flights: Flights of this inventory item. A flight (a.k.a. pricing + // period) represents the inventory item pricing information for a + // specific period of time. + Flights []*Flight `json:"flights,omitempty"` + + // GroupType: Group type of this inventory item if it represents a + // placement group. Is null otherwise. There are two type of placement + // groups: PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE is a simple group of + // inventory items that acts as a single pricing point for a group of + // tags. PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK is a group of inventory + // items that not only acts as a single pricing point, but also assumes + // that all the tags in it will be served at the same time. A roadblock + // requires one of its assigned inventory items to be marked as primary. + // + // Possible values: + // "PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE" + // "PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK" + GroupType string `json:"groupType,omitempty"` + + // PricingType: Pricing type of this inventory item. + // + // Possible values: + // "PLANNING_PLACEMENT_PRICING_TYPE_CLICKS" + // "PLANNING_PLACEMENT_PRICING_TYPE_CPA" + // "PLANNING_PLACEMENT_PRICING_TYPE_CPC" + // "PLANNING_PLACEMENT_PRICING_TYPE_CPM" + // "PLANNING_PLACEMENT_PRICING_TYPE_FLAT_RATE_CLICKS" + // "PLANNING_PLACEMENT_PRICING_TYPE_FLAT_RATE_IMPRESSIONS" + // "PLANNING_PLACEMENT_PRICING_TYPE_IMPRESSIONS" + PricingType string `json:"pricingType,omitempty"` + + // StartDate: Start date of this inventory item. + StartDate string `json:"startDate,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CapCostType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Pricing) MarshalJSON() ([]byte, error) { + type noMethod Pricing + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PricingSchedule: Pricing Schedule +type PricingSchedule struct { + // CapCostOption: Placement cap cost option. + // + // Possible values: + // "CAP_COST_CUMULATIVE" + // "CAP_COST_MONTHLY" + // "CAP_COST_NONE" + CapCostOption string `json:"capCostOption,omitempty"` + + // DisregardOverdelivery: Whether cap costs are ignored by ad serving. + DisregardOverdelivery bool `json:"disregardOverdelivery,omitempty"` + + // EndDate: Placement end date. This date must be later than, or the + // same day as, the placement start date, but not later than the + // campaign end date. If, for example, you set 6/25/2015 as both the + // start and end dates, the effective placement date is just that day + // only, 6/25/2015. The hours, minutes, and seconds of the end date + // should not be set, as doing so will result in an error. This field is + // required on insertion. + EndDate string `json:"endDate,omitempty"` + + // Flighted: Whether this placement is flighted. If true, pricing + // periods will be computed automatically. + Flighted bool `json:"flighted,omitempty"` + + // FloodlightActivityId: Floodlight activity ID associated with this + // placement. This field should be set when placement pricing type is + // set to PRICING_TYPE_CPA. + FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"` + + // PricingPeriods: Pricing periods for this placement. + PricingPeriods []*PricingSchedulePricingPeriod `json:"pricingPeriods,omitempty"` + + // PricingType: Placement pricing type. This field is required on + // insertion. + // + // Possible values: + // "PRICING_TYPE_CPA" + // "PRICING_TYPE_CPC" + // "PRICING_TYPE_CPM" + // "PRICING_TYPE_FLAT_RATE_CLICKS" + // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" + PricingType string `json:"pricingType,omitempty"` + + // StartDate: Placement start date. This date must be later than, or the + // same day as, the campaign start date. The hours, minutes, and seconds + // of the start date should not be set, as doing so will result in an + // error. This field is required on insertion. + StartDate string `json:"startDate,omitempty"` + + // TestingStartDate: Testing start date of this placement. The hours, + // minutes, and seconds of the start date should not be set, as doing so + // will result in an error. + TestingStartDate string `json:"testingStartDate,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CapCostOption") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PricingSchedule) MarshalJSON() ([]byte, error) { + type noMethod PricingSchedule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PricingSchedulePricingPeriod: Pricing Period +type PricingSchedulePricingPeriod struct { + // EndDate: Pricing period end date. This date must be later than, or + // the same day as, the pricing period start date, but not later than + // the placement end date. The period end date can be the same date as + // the period start date. If, for example, you set 6/25/2015 as both the + // start and end dates, the effective pricing period date is just that + // day only, 6/25/2015. The hours, minutes, and seconds of the end date + // should not be set, as doing so will result in an error. + EndDate string `json:"endDate,omitempty"` + + // PricingComment: Comments for this pricing period. + PricingComment string `json:"pricingComment,omitempty"` + + // RateOrCostNanos: Rate or cost of this pricing period. + RateOrCostNanos int64 `json:"rateOrCostNanos,omitempty,string"` + + // StartDate: Pricing period start date. This date must be later than, + // or the same day as, the placement start date. The hours, minutes, and + // seconds of the start date should not be set, as doing so will result + // in an error. + StartDate string `json:"startDate,omitempty"` + + // Units: Units of this pricing period. + Units int64 `json:"units,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "EndDate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PricingSchedulePricingPeriod) MarshalJSON() ([]byte, error) { + type noMethod PricingSchedulePricingPeriod + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Project: Contains properties of a DoubleClick Planning project. +type Project struct { + // AccountId: Account ID of this project. + AccountId int64 `json:"accountId,omitempty,string"` + + // AdvertiserId: Advertiser ID of this project. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AudienceAgeGroup: Audience age group of this project. + // + // Possible values: + // "PLANNING_AUDIENCE_AGE_18_24" + // "PLANNING_AUDIENCE_AGE_25_34" + // "PLANNING_AUDIENCE_AGE_35_44" + // "PLANNING_AUDIENCE_AGE_45_54" + // "PLANNING_AUDIENCE_AGE_55_64" + // "PLANNING_AUDIENCE_AGE_65_OR_MORE" + // "PLANNING_AUDIENCE_AGE_UNKNOWN" + AudienceAgeGroup string `json:"audienceAgeGroup,omitempty"` + + // AudienceGender: Audience gender of this project. + // + // Possible values: + // "PLANNING_AUDIENCE_GENDER_FEMALE" + // "PLANNING_AUDIENCE_GENDER_MALE" + AudienceGender string `json:"audienceGender,omitempty"` + + // Budget: Budget of this project in the currency specified by the + // current account. The value stored in this field represents only the + // non-fractional amount. For example, for USD, the smallest value that + // can be represented by this field is 1 US dollar. + Budget int64 `json:"budget,omitempty,string"` + + // ClientBillingCode: Client billing code of this project. + ClientBillingCode string `json:"clientBillingCode,omitempty"` + + // ClientName: Name of the project client. + ClientName string `json:"clientName,omitempty"` + + // EndDate: End date of the project. + EndDate string `json:"endDate,omitempty"` + + // Id: ID of this project. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#project". + Kind string `json:"kind,omitempty"` + + // LastModifiedInfo: Information about the most recent modification of + // this project. + LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"` + + // Name: Name of this project. + Name string `json:"name,omitempty"` + + // Overview: Overview of this project. + Overview string `json:"overview,omitempty"` + + // StartDate: Start date of the project. + StartDate string `json:"startDate,omitempty"` + + // SubaccountId: Subaccount ID of this project. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // TargetClicks: Number of clicks that the advertiser is targeting. + TargetClicks int64 `json:"targetClicks,omitempty,string"` + + // TargetConversions: Number of conversions that the advertiser is + // targeting. + TargetConversions int64 `json:"targetConversions,omitempty,string"` + + // TargetCpaNanos: CPA that the advertiser is targeting. + TargetCpaNanos int64 `json:"targetCpaNanos,omitempty,string"` + + // TargetCpcNanos: CPC that the advertiser is targeting. + TargetCpcNanos int64 `json:"targetCpcNanos,omitempty,string"` + + // TargetCpmNanos: CPM that the advertiser is targeting. + TargetCpmNanos int64 `json:"targetCpmNanos,omitempty,string"` + + // TargetImpressions: Number of impressions that the advertiser is + // targeting. + TargetImpressions int64 `json:"targetImpressions,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Project) MarshalJSON() ([]byte, error) { + type noMethod Project + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ProjectsListResponse: Project List Response +type ProjectsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#projectsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Projects: Project collection. + Projects []*Project `json:"projects,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProjectsListResponse) MarshalJSON() ([]byte, error) { + type noMethod ProjectsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReachReportCompatibleFields: Represents fields that are compatible to +// be selected for a report of type "REACH". +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionFilters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReachReportCompatibleFields) MarshalJSON() ([]byte, error) { + type noMethod ReachReportCompatibleFields + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Recipient: Represents a recipient. +type Recipient struct { + // DeliveryType: The delivery type for the recipient. + // + // Possible values: + // "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"` + + // ForceSendFields is a list of field names (e.g. "DeliveryType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Recipient) MarshalJSON() ([]byte, error) { + type noMethod Recipient + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Region: Contains information about a region that can be targeted by +// ads. +type Region struct { + // CountryCode: Country code of the country to which this region + // belongs. + CountryCode string `json:"countryCode,omitempty"` + + // CountryDartId: DART ID of the country to which this region belongs. + CountryDartId int64 `json:"countryDartId,omitempty,string"` + + // DartId: DART ID of this region. + DartId int64 `json:"dartId,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#region". + Kind string `json:"kind,omitempty"` + + // Name: Name of this region. + Name string `json:"name,omitempty"` + + // RegionCode: Region code. + RegionCode string `json:"regionCode,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CountryCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Region) MarshalJSON() ([]byte, error) { + type noMethod Region + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RegionsListResponse: Region List Response +type RegionsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#regionsListResponse". + Kind string `json:"kind,omitempty"` + + // Regions: Region collection. + Regions []*Region `json:"regions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RegionsListResponse) MarshalJSON() ([]byte, error) { + type noMethod RegionsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RemarketingList: Contains properties of a remarketing list. +// Remarketing enables you to create lists of users who have performed +// specific actions on a site, then target ads to members of those +// lists. This resource can be used to manage remarketing lists that are +// owned by your advertisers. To see all remarketing lists that are +// visible to your advertisers, including those that are shared to your +// advertiser or account, use the TargetableRemarketingLists resource. +type RemarketingList struct { + // AccountId: Account ID of this remarketing list. This is a read-only, + // auto-generated field that is only returned in GET requests. + AccountId int64 `json:"accountId,omitempty,string"` + + // Active: Whether this remarketing list is active. + Active bool `json:"active,omitempty"` + + // AdvertiserId: Dimension value for the advertiser ID that owns this + // remarketing list. This is a required field. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. This is a read-only, auto-generated field. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // Description: Remarketing list description. + Description string `json:"description,omitempty"` + + // Id: Remarketing list ID. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#remarketingList". + Kind string `json:"kind,omitempty"` + + // LifeSpan: Number of days that a user should remain in the remarketing + // list without an impression. + LifeSpan int64 `json:"lifeSpan,omitempty,string"` + + // ListPopulationRule: Rule used to populate the remarketing list with + // users. + ListPopulationRule *ListPopulationRule `json:"listPopulationRule,omitempty"` + + // ListSize: Number of users currently in the list. This is a read-only + // field. + ListSize int64 `json:"listSize,omitempty,string"` + + // ListSource: Product from which this remarketing list was originated. + // + // Possible values: + // "REMARKETING_LIST_SOURCE_DBM" + // "REMARKETING_LIST_SOURCE_DFA" + // "REMARKETING_LIST_SOURCE_DMP" + // "REMARKETING_LIST_SOURCE_GA" + // "REMARKETING_LIST_SOURCE_OTHER" + ListSource string `json:"listSource,omitempty"` + + // Name: Name of the remarketing list. This is a required field. Must be + // no greater than 128 characters long. + Name string `json:"name,omitempty"` + + // SubaccountId: Subaccount ID of this remarketing list. This is a + // read-only, auto-generated field that is only returned in GET + // requests. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RemarketingList) MarshalJSON() ([]byte, error) { + type noMethod RemarketingList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RemarketingListShare: Contains properties of a remarketing list's +// sharing information. Sharing allows other accounts or advertisers to +// target to your remarketing lists. This resource can be used to manage +// remarketing list sharing to other accounts and advertisers. +type RemarketingListShare struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#remarketingListShare". + Kind string `json:"kind,omitempty"` + + // RemarketingListId: Remarketing list ID. This is a read-only, + // auto-generated field. + RemarketingListId int64 `json:"remarketingListId,omitempty,string"` + + // SharedAccountIds: Accounts that the remarketing list is shared with. + SharedAccountIds googleapi.Int64s `json:"sharedAccountIds,omitempty"` + + // SharedAdvertiserIds: Advertisers that the remarketing list is shared + // with. + SharedAdvertiserIds googleapi.Int64s `json:"sharedAdvertiserIds,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RemarketingListShare) MarshalJSON() ([]byte, error) { + type noMethod RemarketingListShare + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RemarketingListsListResponse: Remarketing list response +type RemarketingListsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#remarketingListsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // RemarketingLists: Remarketing list collection. + RemarketingLists []*RemarketingList `json:"remarketingLists,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RemarketingListsListResponse) MarshalJSON() ([]byte, error) { + type noMethod RemarketingListsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Report: Represents a Report resource. +type Report struct { + // AccountId: The account ID to which this report belongs. + AccountId int64 `json:"accountId,omitempty,string"` + + // 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 filename 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. 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. + // + // Possible values: + // "CSV" + // "EXCEL" + 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 subaccount ID to which this report belongs if + // applicable. + SubAccountId int64 `json:"subAccountId,omitempty,string"` + + // Type: The type of the report. + // + // Possible values: + // "CROSS_DIMENSION_REACH" + // "FLOODLIGHT" + // "PATH_TO_CONVERSION" + // "REACH" + // "STANDARD" + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Report) MarshalJSON() ([]byte, error) { + type noMethod Report + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportCriteria: The report criteria for a report of type "STANDARD". +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"` + + // ForceSendFields is a list of field names (e.g. "Activities") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportCrossDimensionReachCriteria: The report criteria for a report +// of type "CROSS_DIMENSION_REACH". +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. + // + // Possible values: + // "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"` + + // ForceSendFields is a list of field names (e.g. "Breakdown") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportCrossDimensionReachCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportCrossDimensionReachCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportDelivery: The report's email delivery settings. +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. + // + // Possible values: + // "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"` + + // ForceSendFields is a list of field names (e.g. "EmailOwner") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportDelivery) MarshalJSON() ([]byte, error) { + type noMethod ReportDelivery + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportFloodlightCriteria: The report criteria for a report of type +// "FLOODLIGHT". +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"` + + // ForceSendFields is a list of field names (e.g. + // "CustomRichMediaEvents") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportFloodlightCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportFloodlightCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportFloodlightCriteriaReportProperties: The properties of the +// report. +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"` + + // ForceSendFields is a list of field names (e.g. + // "IncludeAttributedIPConversions") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportFloodlightCriteriaReportProperties) MarshalJSON() ([]byte, error) { + type noMethod ReportFloodlightCriteriaReportProperties + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportPathToConversionCriteria: The report criteria for a report of +// type "PATH_TO_CONVERSION". +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"` + + // ForceSendFields is a list of field names (e.g. "ActivityFilters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportPathToConversionCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportPathToConversionCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportPathToConversionCriteriaReportProperties: The properties of the +// report. +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"` + + // ForceSendFields is a list of field names (e.g. + // "ClicksLookbackWindow") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportPathToConversionCriteriaReportProperties) MarshalJSON() ([]byte, error) { + type noMethod ReportPathToConversionCriteriaReportProperties + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportReachCriteria: The report criteria for a report of type +// "REACH". +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"` + + // EnableAllDimensionCombinations: Whether to enable all reach dimension + // combinations in the report. Defaults to false. If enabled, the date + // range of the report should be within the last three months. + EnableAllDimensionCombinations bool `json:"enableAllDimensionCombinations,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"` + + // ForceSendFields is a list of field names (e.g. "Activities") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportReachCriteria) MarshalJSON() ([]byte, error) { + type noMethod ReportReachCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportSchedule: 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". +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. Note: + // - "DAILY" also requires field "every" to be set. + // - "WEEKLY" also requires fields "every" and "repeatsOnWeekDays" to be + // set. + // - "MONTHLY" also requires fields "every" and "runsOnDayOfMonth" to be + // set. + Repeats string `json:"repeats,omitempty"` + + // RepeatsOnWeekDays: List of week days "WEEKLY" on which scheduled + // reports should run. + // + // Possible values: + // "FRIDAY" + // "MONDAY" + // "SATURDAY" + // "SUNDAY" + // "THURSDAY" + // "TUESDAY" + // "WEDNESDAY" + 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. + // 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. + // + // Possible values: + // "DAY_OF_MONTH" + // "WEEK_OF_MONTH" + RunsOnDayOfMonth string `json:"runsOnDayOfMonth,omitempty"` + + // StartDate: Start date of date range for which scheduled reports + // should be run. + StartDate string `json:"startDate,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Active") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportSchedule) MarshalJSON() ([]byte, error) { + type noMethod ReportSchedule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportCompatibleFields: Represents fields that are compatible to be +// selected for a report of type "STANDARD". +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"` + + // ForceSendFields is a list of field names (e.g. "DimensionFilters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportCompatibleFields) MarshalJSON() ([]byte, error) { + type noMethod ReportCompatibleFields + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportList: Represents the list of reports. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportList) MarshalJSON() ([]byte, error) { + type noMethod ReportList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportsConfiguration: Reporting Configuration +type ReportsConfiguration struct { + // ExposureToConversionEnabled: Whether the exposure to conversion + // report is enabled. This report shows detailed pathway information on + // up to 10 of the most recent ad exposures seen by a user before + // converting. + ExposureToConversionEnabled bool `json:"exposureToConversionEnabled,omitempty"` + + // LookbackConfiguration: Default lookback windows for new advertisers + // in this account. + LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"` + + // ReportGenerationTimeZoneId: Report generation time zone ID of this + // account. This is a required field that can only be changed by a + // superuser. + // Acceptable values are: + // + // - "1" for "America/New_York" + // - "2" for "Europe/London" + // - "3" for "Europe/Paris" + // - "4" for "Africa/Johannesburg" + // - "5" for "Asia/Jerusalem" + // - "6" for "Asia/Shanghai" + // - "7" for "Asia/Hong_Kong" + // - "8" for "Asia/Tokyo" + // - "9" for "Australia/Sydney" + // - "10" for "Asia/Dubai" + // - "11" for "America/Los_Angeles" + // - "12" for "Pacific/Auckland" + // - "13" for "America/Sao_Paulo" + ReportGenerationTimeZoneId int64 `json:"reportGenerationTimeZoneId,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. + // "ExposureToConversionEnabled") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportsConfiguration) MarshalJSON() ([]byte, error) { + type noMethod ReportsConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RichMediaExitOverride: Rich Media Exit Override. +type RichMediaExitOverride struct { + // CustomExitUrl: Click-through URL to override the default exit URL. + // Applicable if the useCustomExitUrl field is set to true. + CustomExitUrl string `json:"customExitUrl,omitempty"` + + // ExitId: ID for the override to refer to a specific exit in the + // creative. + ExitId int64 `json:"exitId,omitempty,string"` + + // UseCustomExitUrl: Whether to use the custom exit URL. + UseCustomExitUrl bool `json:"useCustomExitUrl,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CustomExitUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RichMediaExitOverride) MarshalJSON() ([]byte, error) { + type noMethod RichMediaExitOverride + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Site: Contains properties of a site. +type Site struct { + // AccountId: Account ID of this site. This is a read-only field that + // can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // Approved: Whether this site is approved. + Approved bool `json:"approved,omitempty"` + + // DirectorySiteId: Directory site associated with this site. This is a + // required field that is read-only after insertion. + DirectorySiteId int64 `json:"directorySiteId,omitempty,string"` + + // DirectorySiteIdDimensionValue: Dimension value for the ID of the + // directory site. This is a read-only, auto-generated field. + DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"` + + // Id: ID of this site. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // IdDimensionValue: Dimension value for the ID of this site. This is a + // read-only, auto-generated field. + IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"` + + // KeyName: Key name of this site. This is a read-only, auto-generated + // field. + KeyName string `json:"keyName,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#site". + Kind string `json:"kind,omitempty"` + + // Name: Name of this site.This is a required field. Must be less than + // 128 characters long. If this site is under a subaccount, the name + // must be unique among sites of the same subaccount. Otherwise, this + // site is a top-level site, and the name must be unique among top-level + // sites of the same account. + Name string `json:"name,omitempty"` + + // SiteContacts: Site contacts. + SiteContacts []*SiteContact `json:"siteContacts,omitempty"` + + // SiteSettings: Site-wide settings. + SiteSettings *SiteSettings `json:"siteSettings,omitempty"` + + // SubaccountId: Subaccount ID of this site. This is a read-only field + // that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Site) MarshalJSON() ([]byte, error) { + type noMethod Site + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SiteContact: Site Contact +type SiteContact struct { + // Address: Address of this site contact. + Address string `json:"address,omitempty"` + + // ContactType: Site contact type. + // + // Possible values: + // "SALES_PERSON" + // "TRAFFICKER" + ContactType string `json:"contactType,omitempty"` + + // Email: Email address of this site contact. This is a required field. + Email string `json:"email,omitempty"` + + // FirstName: First name of this site contact. + FirstName string `json:"firstName,omitempty"` + + // Id: ID of this site contact. This is a read-only, auto-generated + // field. + Id int64 `json:"id,omitempty,string"` + + // LastName: Last name of this site contact. + LastName string `json:"lastName,omitempty"` + + // Phone: Primary phone number of this site contact. + Phone string `json:"phone,omitempty"` + + // Title: Title or designation of this site contact. + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Address") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SiteContact) MarshalJSON() ([]byte, error) { + type noMethod SiteContact + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SiteSettings: Site Settings +type SiteSettings struct { + // ActiveViewOptOut: Whether active view creatives are disabled for this + // site. + ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"` + + // CreativeSettings: Site-wide creative settings. + CreativeSettings *CreativeSettings `json:"creativeSettings,omitempty"` + + // DisableBrandSafeAds: Whether brand safe ads are disabled for this + // site. + DisableBrandSafeAds bool `json:"disableBrandSafeAds,omitempty"` + + // DisableNewCookie: Whether new cookies are disabled for this site. + DisableNewCookie bool `json:"disableNewCookie,omitempty"` + + // LookbackConfiguration: Lookback window settings for this site. + LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"` + + // TagSetting: Configuration settings for dynamic and image floodlight + // tags. + TagSetting *TagSetting `json:"tagSetting,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ActiveViewOptOut") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SiteSettings) MarshalJSON() ([]byte, error) { + type noMethod SiteSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SitesListResponse: Site List Response +type SitesListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#sitesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Sites: Site collection. + Sites []*Site `json:"sites,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SitesListResponse) MarshalJSON() ([]byte, error) { + type noMethod SitesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Size: Represents the dimensions of ads, placements, creatives, or +// creative assets. +type Size struct { + // Height: Height of this size. + Height int64 `json:"height,omitempty"` + + // Iab: IAB standard size. This is a read-only, auto-generated field. + Iab bool `json:"iab,omitempty"` + + // Id: ID of this size. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#size". + Kind string `json:"kind,omitempty"` + + // Width: Width of this size. + Width int64 `json:"width,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Size) MarshalJSON() ([]byte, error) { + type noMethod Size + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SizesListResponse: Size List Response +type SizesListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#sizesListResponse". + Kind string `json:"kind,omitempty"` + + // Sizes: Size collection. + Sizes []*Size `json:"sizes,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SizesListResponse) MarshalJSON() ([]byte, error) { + type noMethod SizesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SortedDimension: Represents a sorted dimension. +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. + // + // Possible values: + // "ASCENDING" + // "DESCENDING" + SortOrder string `json:"sortOrder,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SortedDimension) MarshalJSON() ([]byte, error) { + type noMethod SortedDimension + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Subaccount: Contains properties of a DCM subaccount. +type Subaccount struct { + // AccountId: ID of the account that contains this subaccount. This is a + // read-only field that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // AvailablePermissionIds: IDs of the available user role permissions + // for this subaccount. + AvailablePermissionIds googleapi.Int64s `json:"availablePermissionIds,omitempty"` + + // Id: ID of this subaccount. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#subaccount". + Kind string `json:"kind,omitempty"` + + // Name: Name of this subaccount. This is a required field. Must be less + // than 128 characters long and be unique among subaccounts of the same + // account. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Subaccount) MarshalJSON() ([]byte, error) { + type noMethod Subaccount + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SubaccountsListResponse: Subaccount List Response +type SubaccountsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#subaccountsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Subaccounts: Subaccount collection. + Subaccounts []*Subaccount `json:"subaccounts,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SubaccountsListResponse) MarshalJSON() ([]byte, error) { + type noMethod SubaccountsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TagData: Placement Tag Data +type TagData struct { + // AdId: Ad associated with this placement tag. + AdId int64 `json:"adId,omitempty,string"` + + // ClickTag: Tag string to record a click. + ClickTag string `json:"clickTag,omitempty"` + + // CreativeId: Creative associated with this placement tag. + CreativeId int64 `json:"creativeId,omitempty,string"` + + // Format: TagData tag format of this tag. + // + // Possible values: + // "PLACEMENT_TAG_CLICK_COMMANDS" + // "PLACEMENT_TAG_IFRAME_ILAYER" + // "PLACEMENT_TAG_IFRAME_JAVASCRIPT" + // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY" + // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH" + // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3" + // "PLACEMENT_TAG_INTERNAL_REDIRECT" + // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT" + // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY" + // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT" + // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT" + // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY" + // "PLACEMENT_TAG_JAVASCRIPT" + // "PLACEMENT_TAG_JAVASCRIPT_LEGACY" + // "PLACEMENT_TAG_STANDARD" + // "PLACEMENT_TAG_TRACKING" + // "PLACEMENT_TAG_TRACKING_IFRAME" + // "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + Format string `json:"format,omitempty"` + + // ImpressionTag: Tag string for serving an ad. + ImpressionTag string `json:"impressionTag,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AdId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TagData) MarshalJSON() ([]byte, error) { + type noMethod TagData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TagSetting: Tag Settings +type TagSetting struct { + // AdditionalKeyValues: Additional key-values to be included in tags. + // Each key-value pair must be of the form key=value, and pairs must be + // separated by a semicolon (;). Keys and values must not contain + // commas. For example, id=2;color=red is a valid value for this field. + AdditionalKeyValues string `json:"additionalKeyValues,omitempty"` + + // IncludeClickThroughUrls: Whether static landing page URLs should be + // included in the tags. This setting applies only to placements. + IncludeClickThroughUrls bool `json:"includeClickThroughUrls,omitempty"` + + // IncludeClickTracking: Whether click-tracking string should be + // included in the tags. + IncludeClickTracking bool `json:"includeClickTracking,omitempty"` + + // KeywordOption: Option specifying how keywords are embedded in ad + // tags. This setting can be used to specify whether keyword + // placeholders are inserted in placement tags for this site. Publishers + // can then add keywords to those placeholders. + // + // Possible values: + // "GENERATE_SEPARATE_TAG_FOR_EACH_KEYWORD" + // "IGNORE" + // "PLACEHOLDER_WITH_LIST_OF_KEYWORDS" + KeywordOption string `json:"keywordOption,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AdditionalKeyValues") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TagSetting) MarshalJSON() ([]byte, error) { + type noMethod TagSetting + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TagSettings: Dynamic and Image Tag Settings. +type TagSettings struct { + // DynamicTagEnabled: Whether dynamic floodlight tags are enabled. + DynamicTagEnabled bool `json:"dynamicTagEnabled,omitempty"` + + // ImageTagEnabled: Whether image tags are enabled. + ImageTagEnabled bool `json:"imageTagEnabled,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DynamicTagEnabled") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TagSettings) MarshalJSON() ([]byte, error) { + type noMethod TagSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetWindow: Target Window. +type TargetWindow struct { + // CustomHtml: User-entered value. + CustomHtml string `json:"customHtml,omitempty"` + + // TargetWindowOption: Type of browser window for which the backup image + // of the flash creative can be displayed. + // + // Possible values: + // "CURRENT_WINDOW" + // "CUSTOM" + // "NEW_WINDOW" + TargetWindowOption string `json:"targetWindowOption,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CustomHtml") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetWindow) MarshalJSON() ([]byte, error) { + type noMethod TargetWindow + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetableRemarketingList: Contains properties of a targetable +// remarketing list. Remarketing enables you to create lists of users +// who have performed specific actions on a site, then target ads to +// members of those lists. This resource is a read-only view of a +// remarketing list to be used to faciliate targeting ads to specific +// lists. Remarketing lists that are owned by your advertisers and those +// that are shared to your advertisers or account are accessible via +// this resource. To manage remarketing lists that are owned by your +// advertisers, use the RemarketingLists resource. +type TargetableRemarketingList struct { + // AccountId: Account ID of this remarketing list. This is a read-only, + // auto-generated field that is only returned in GET requests. + AccountId int64 `json:"accountId,omitempty,string"` + + // Active: Whether this targetable remarketing list is active. + Active bool `json:"active,omitempty"` + + // AdvertiserId: Dimension value for the advertiser ID that owns this + // targetable remarketing list. + AdvertiserId int64 `json:"advertiserId,omitempty,string"` + + // AdvertiserIdDimensionValue: Dimension value for the ID of the + // advertiser. + AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"` + + // Description: Targetable remarketing list description. + Description string `json:"description,omitempty"` + + // Id: Targetable remarketing list ID. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#targetableRemarketingList". + Kind string `json:"kind,omitempty"` + + // LifeSpan: Number of days that a user should remain in the targetable + // remarketing list without an impression. + LifeSpan int64 `json:"lifeSpan,omitempty,string"` + + // ListSize: Number of users currently in the list. This is a read-only + // field. + ListSize int64 `json:"listSize,omitempty,string"` + + // ListSource: Product from which this targetable remarketing list was + // originated. + // + // Possible values: + // "REMARKETING_LIST_SOURCE_DBM" + // "REMARKETING_LIST_SOURCE_DFA" + // "REMARKETING_LIST_SOURCE_DMP" + // "REMARKETING_LIST_SOURCE_GA" + // "REMARKETING_LIST_SOURCE_OTHER" + ListSource string `json:"listSource,omitempty"` + + // Name: Name of the targetable remarketing list. Is no greater than 128 + // characters long. + Name string `json:"name,omitempty"` + + // SubaccountId: Subaccount ID of this remarketing list. This is a + // read-only, auto-generated field that is only returned in GET + // requests. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetableRemarketingList) MarshalJSON() ([]byte, error) { + type noMethod TargetableRemarketingList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetableRemarketingListsListResponse: Targetable remarketing list +// response +type TargetableRemarketingListsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#targetableRemarketingListsListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // TargetableRemarketingLists: Targetable remarketing list collection. + TargetableRemarketingLists []*TargetableRemarketingList `json:"targetableRemarketingLists,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetableRemarketingListsListResponse) MarshalJSON() ([]byte, error) { + type noMethod TargetableRemarketingListsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TechnologyTargeting: Technology Targeting. +type TechnologyTargeting struct { + // Browsers: Browsers that this ad targets. For each browser either set + // browserVersionId or dartId along with the version numbers. If both + // are specified, only browserVersionId will be used.The other fields + // are populated automatically when the ad is inserted or updated. + Browsers []*Browser `json:"browsers,omitempty"` + + // ConnectionTypes: Connection types that this ad targets. For each + // connection type only id is required.The other fields are populated + // automatically when the ad is inserted or updated. + ConnectionTypes []*ConnectionType `json:"connectionTypes,omitempty"` + + // MobileCarriers: Mobile carriers that this ad targets. For each mobile + // carrier only id is required, and the other fields are populated + // automatically when the ad is inserted or updated. If targeting a + // mobile carrier, do not set targeting for any zip codes. + MobileCarriers []*MobileCarrier `json:"mobileCarriers,omitempty"` + + // OperatingSystemVersions: Operating system versions that this ad + // targets. To target all versions, use operatingSystems. For each + // operating system version, only id is required. The other fields are + // populated automatically when the ad is inserted or updated. If + // targeting an operating system version, do not set targeting for the + // corresponding operating system in operatingSystems. + OperatingSystemVersions []*OperatingSystemVersion `json:"operatingSystemVersions,omitempty"` + + // OperatingSystems: Operating systems that this ad targets. To target + // specific versions, use operatingSystemVersions. For each operating + // system only dartId is required. The other fields are populated + // automatically when the ad is inserted or updated. If targeting an + // operating system, do not set targeting for operating system versions + // for the same operating system. + OperatingSystems []*OperatingSystem `json:"operatingSystems,omitempty"` + + // PlatformTypes: Platform types that this ad targets. For example, + // desktop, mobile, or tablet. For each platform type, only id is + // required, and the other fields are populated automatically when the + // ad is inserted or updated. + PlatformTypes []*PlatformType `json:"platformTypes,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Browsers") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TechnologyTargeting) MarshalJSON() ([]byte, error) { + type noMethod TechnologyTargeting + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ThirdPartyAuthenticationToken: Third Party Authentication Token +type ThirdPartyAuthenticationToken struct { + // Name: Name of the third-party authentication token. + Name string `json:"name,omitempty"` + + // Value: Value of the third-party authentication token. This is a + // read-only, auto-generated field. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ThirdPartyAuthenticationToken) MarshalJSON() ([]byte, error) { + type noMethod ThirdPartyAuthenticationToken + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ThirdPartyTrackingUrl: Third-party Tracking URL. +type ThirdPartyTrackingUrl struct { + // ThirdPartyUrlType: Third-party URL type for in-stream video + // creatives. + // + // Possible values: + // "CLICK_TRACKING" + // "IMPRESSION" + // "RICH_MEDIA_BACKUP_IMPRESSION" + // "RICH_MEDIA_IMPRESSION" + // "RICH_MEDIA_RM_IMPRESSION" + // "SURVEY" + // "VIDEO_COMPLETE" + // "VIDEO_CUSTOM" + // "VIDEO_FIRST_QUARTILE" + // "VIDEO_FULLSCREEN" + // "VIDEO_MIDPOINT" + // "VIDEO_MUTE" + // "VIDEO_PAUSE" + // "VIDEO_REWIND" + // "VIDEO_START" + // "VIDEO_STOP" + // "VIDEO_THIRD_QUARTILE" + ThirdPartyUrlType string `json:"thirdPartyUrlType,omitempty"` + + // Url: URL for the specified third-party URL type. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ThirdPartyUrlType") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ThirdPartyTrackingUrl) MarshalJSON() ([]byte, error) { + type noMethod ThirdPartyTrackingUrl + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserDefinedVariableConfiguration: User Defined Variable +// configuration. +type UserDefinedVariableConfiguration struct { + // DataType: Data type for the variable. This is a required field. + // + // Possible values: + // "NUMBER" + // "STRING" + DataType string `json:"dataType,omitempty"` + + // ReportName: User-friendly name for the variable which will appear in + // reports. This is a required field, must be less than 64 characters + // long, and cannot contain the following characters: ""<>". + ReportName string `json:"reportName,omitempty"` + + // VariableType: Variable name in the tag. This is a required field. + // + // Possible values: + // "U1" + // "U10" + // "U11" + // "U12" + // "U13" + // "U14" + // "U15" + // "U16" + // "U17" + // "U18" + // "U19" + // "U2" + // "U20" + // "U3" + // "U4" + // "U5" + // "U6" + // "U7" + // "U8" + // "U9" + VariableType string `json:"variableType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DataType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserDefinedVariableConfiguration) MarshalJSON() ([]byte, error) { + type noMethod UserDefinedVariableConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserProfile: Represents a UserProfile resource. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserProfile) MarshalJSON() ([]byte, error) { + type noMethod UserProfile + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserProfileList: Represents the list of user profiles. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserProfileList) MarshalJSON() ([]byte, error) { + type noMethod UserProfileList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserRole: Contains properties of auser role, which is used to manage +// user access. +type UserRole struct { + // AccountId: Account ID of this user role. This is a read-only field + // that can be left blank. + AccountId int64 `json:"accountId,omitempty,string"` + + // DefaultUserRole: Whether this is a default user role. Default user + // roles are created by the system for the account/subaccount and cannot + // be modified or deleted. Each default user role comes with a basic set + // of preassigned permissions. + DefaultUserRole bool `json:"defaultUserRole,omitempty"` + + // Id: ID of this user role. This is a read-only, auto-generated field. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#userRole". + Kind string `json:"kind,omitempty"` + + // Name: Name of this user role. This is a required field. Must be less + // than 256 characters long. If this user role is under a subaccount, + // the name must be unique among sites of the same subaccount. + // Otherwise, this user role is a top-level user role, and the name must + // be unique among top-level user roles of the same account. + Name string `json:"name,omitempty"` + + // ParentUserRoleId: ID of the user role that this user role is based on + // or copied from. This is a required field. + ParentUserRoleId int64 `json:"parentUserRoleId,omitempty,string"` + + // Permissions: List of permissions associated with this user role. + Permissions []*UserRolePermission `json:"permissions,omitempty"` + + // SubaccountId: Subaccount ID of this user role. This is a read-only + // field that can be left blank. + SubaccountId int64 `json:"subaccountId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserRole) MarshalJSON() ([]byte, error) { + type noMethod UserRole + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserRolePermission: Contains properties of a user role permission. +type UserRolePermission struct { + // Availability: Levels of availability for a user role permission. + // + // Possible values: + // "ACCOUNT_ALWAYS" + // "ACCOUNT_BY_DEFAULT" + // "NOT_AVAILABLE_BY_DEFAULT" + // "SUBACCOUNT_AND_ACCOUNT_ALWAYS" + // "SUBACCOUNT_AND_ACCOUNT_BY_DEFAULT" + Availability string `json:"availability,omitempty"` + + // Id: ID of this user role permission. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#userRolePermission". + Kind string `json:"kind,omitempty"` + + // Name: Name of this user role permission. + Name string `json:"name,omitempty"` + + // PermissionGroupId: ID of the permission group that this user role + // permission belongs to. + PermissionGroupId int64 `json:"permissionGroupId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Availability") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserRolePermission) MarshalJSON() ([]byte, error) { + type noMethod UserRolePermission + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserRolePermissionGroup: Represents a grouping of related user role +// permissions. +type UserRolePermissionGroup struct { + // Id: ID of this user role permission. + Id int64 `json:"id,omitempty,string"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#userRolePermissionGroup". + Kind string `json:"kind,omitempty"` + + // Name: Name of this user role permission group. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserRolePermissionGroup) MarshalJSON() ([]byte, error) { + type noMethod UserRolePermissionGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserRolePermissionGroupsListResponse: User Role Permission Group List +// Response +type UserRolePermissionGroupsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#userRolePermissionGroupsListResponse". + Kind string `json:"kind,omitempty"` + + // UserRolePermissionGroups: User role permission group collection. + UserRolePermissionGroups []*UserRolePermissionGroup `json:"userRolePermissionGroups,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserRolePermissionGroupsListResponse) MarshalJSON() ([]byte, error) { + type noMethod UserRolePermissionGroupsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserRolePermissionsListResponse: User Role Permission List Response +type UserRolePermissionsListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#userRolePermissionsListResponse". + Kind string `json:"kind,omitempty"` + + // UserRolePermissions: User role permission collection. + UserRolePermissions []*UserRolePermission `json:"userRolePermissions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserRolePermissionsListResponse) MarshalJSON() ([]byte, error) { + type noMethod UserRolePermissionsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserRolesListResponse: User Role List Response +type UserRolesListResponse struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "dfareporting#userRolesListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Pagination token to be used for the next list + // operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // UserRoles: User role collection. + UserRoles []*UserRole `json:"userRoles,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserRolesListResponse) MarshalJSON() ([]byte, error) { + type noMethod UserRolesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "dfareporting.accountActiveAdSummaries.get": + +type AccountActiveAdSummariesGetCall struct { + s *Service + profileId int64 + summaryAccountId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the account's active ad summary by account ID. +func (r *AccountActiveAdSummariesService) Get(profileId int64, summaryAccountId int64) *AccountActiveAdSummariesGetCall { + c := &AccountActiveAdSummariesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.summaryAccountId = summaryAccountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountActiveAdSummariesGetCall) Fields(s ...googleapi.Field) *AccountActiveAdSummariesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountActiveAdSummariesGetCall) IfNoneMatch(entityTag string) *AccountActiveAdSummariesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountActiveAdSummariesGetCall) Context(ctx context.Context) *AccountActiveAdSummariesGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountActiveAdSummariesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "summaryAccountId": strconv.FormatInt(c.summaryAccountId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountActiveAdSummaries.get" call. +// Exactly one of *AccountActiveAdSummary or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AccountActiveAdSummary.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountActiveAdSummariesGetCall) Do() (*AccountActiveAdSummary, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountActiveAdSummary{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the account's active ad summary by account ID.", + // "httpMethod": "GET", + // "id": "dfareporting.accountActiveAdSummaries.get", + // "parameterOrder": [ + // "profileId", + // "summaryAccountId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "summaryAccountId": { + // "description": "Account ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}", + // "response": { + // "$ref": "AccountActiveAdSummary" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accountPermissionGroups.get": + +type AccountPermissionGroupsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one account permission group by ID. +func (r *AccountPermissionGroupsService) Get(profileId int64, id int64) *AccountPermissionGroupsGetCall { + c := &AccountPermissionGroupsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountPermissionGroupsGetCall) Fields(s ...googleapi.Field) *AccountPermissionGroupsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountPermissionGroupsGetCall) IfNoneMatch(entityTag string) *AccountPermissionGroupsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountPermissionGroupsGetCall) Context(ctx context.Context) *AccountPermissionGroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountPermissionGroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissionGroups/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountPermissionGroups.get" call. +// Exactly one of *AccountPermissionGroup or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AccountPermissionGroup.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountPermissionGroupsGetCall) Do() (*AccountPermissionGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountPermissionGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one account permission group by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.accountPermissionGroups.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Account permission group ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountPermissionGroups/{id}", + // "response": { + // "$ref": "AccountPermissionGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accountPermissionGroups.list": + +type AccountPermissionGroupsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of account permission groups. +func (r *AccountPermissionGroupsService) List(profileId int64) *AccountPermissionGroupsListCall { + c := &AccountPermissionGroupsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountPermissionGroupsListCall) Fields(s ...googleapi.Field) *AccountPermissionGroupsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountPermissionGroupsListCall) IfNoneMatch(entityTag string) *AccountPermissionGroupsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountPermissionGroupsListCall) Context(ctx context.Context) *AccountPermissionGroupsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountPermissionGroupsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissionGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountPermissionGroups.list" call. +// Exactly one of *AccountPermissionGroupsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AccountPermissionGroupsListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AccountPermissionGroupsListCall) Do() (*AccountPermissionGroupsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountPermissionGroupsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of account permission groups.", + // "httpMethod": "GET", + // "id": "dfareporting.accountPermissionGroups.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountPermissionGroups", + // "response": { + // "$ref": "AccountPermissionGroupsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accountPermissions.get": + +type AccountPermissionsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one account permission by ID. +func (r *AccountPermissionsService) Get(profileId int64, id int64) *AccountPermissionsGetCall { + c := &AccountPermissionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountPermissionsGetCall) Fields(s ...googleapi.Field) *AccountPermissionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountPermissionsGetCall) IfNoneMatch(entityTag string) *AccountPermissionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountPermissionsGetCall) Context(ctx context.Context) *AccountPermissionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountPermissionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissions/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountPermissions.get" call. +// Exactly one of *AccountPermission or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AccountPermission.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountPermissionsGetCall) Do() (*AccountPermission, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountPermission{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one account permission by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.accountPermissions.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Account permission ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountPermissions/{id}", + // "response": { + // "$ref": "AccountPermission" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accountPermissions.list": + +type AccountPermissionsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of account permissions. +func (r *AccountPermissionsService) List(profileId int64) *AccountPermissionsListCall { + c := &AccountPermissionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountPermissionsListCall) Fields(s ...googleapi.Field) *AccountPermissionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountPermissionsListCall) IfNoneMatch(entityTag string) *AccountPermissionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountPermissionsListCall) Context(ctx context.Context) *AccountPermissionsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountPermissionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountPermissions.list" call. +// Exactly one of *AccountPermissionsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AccountPermissionsListResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountPermissionsListCall) Do() (*AccountPermissionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountPermissionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of account permissions.", + // "httpMethod": "GET", + // "id": "dfareporting.accountPermissions.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountPermissions", + // "response": { + // "$ref": "AccountPermissionsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accountUserProfiles.get": + +type AccountUserProfilesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one account user profile by ID. +func (r *AccountUserProfilesService) Get(profileId int64, id int64) *AccountUserProfilesGetCall { + c := &AccountUserProfilesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountUserProfilesGetCall) Fields(s ...googleapi.Field) *AccountUserProfilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountUserProfilesGetCall) IfNoneMatch(entityTag string) *AccountUserProfilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountUserProfilesGetCall) Context(ctx context.Context) *AccountUserProfilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountUserProfilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountUserProfiles.get" call. +// Exactly one of *AccountUserProfile or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AccountUserProfile.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountUserProfilesGetCall) Do() (*AccountUserProfile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountUserProfile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one account user profile by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.accountUserProfiles.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "User profile ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountUserProfiles/{id}", + // "response": { + // "$ref": "AccountUserProfile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accountUserProfiles.insert": + +type AccountUserProfilesInsertCall struct { + s *Service + profileId int64 + accountuserprofile *AccountUserProfile + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new account user profile. +func (r *AccountUserProfilesService) Insert(profileId int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesInsertCall { + c := &AccountUserProfilesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.accountuserprofile = accountuserprofile + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountUserProfilesInsertCall) Fields(s ...googleapi.Field) *AccountUserProfilesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountUserProfilesInsertCall) Context(ctx context.Context) *AccountUserProfilesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *AccountUserProfilesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountUserProfiles.insert" call. +// Exactly one of *AccountUserProfile or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AccountUserProfile.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountUserProfilesInsertCall) Do() (*AccountUserProfile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountUserProfile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new account user profile.", + // "httpMethod": "POST", + // "id": "dfareporting.accountUserProfiles.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountUserProfiles", + // "request": { + // "$ref": "AccountUserProfile" + // }, + // "response": { + // "$ref": "AccountUserProfile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accountUserProfiles.list": + +type AccountUserProfilesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of account user profiles, possibly filtered. +func (r *AccountUserProfilesService) List(profileId int64) *AccountUserProfilesListCall { + c := &AccountUserProfilesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Active sets the optional parameter "active": Select only active user +// profiles. +func (c *AccountUserProfilesListCall) Active(active bool) *AccountUserProfilesListCall { + c.opt_["active"] = active + return c +} + +// Ids sets the optional parameter "ids": Select only user profiles with +// these IDs. +func (c *AccountUserProfilesListCall) Ids(ids int64) *AccountUserProfilesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *AccountUserProfilesListCall) MaxResults(maxResults int64) *AccountUserProfilesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *AccountUserProfilesListCall) PageToken(pageToken string) *AccountUserProfilesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name, ID or email. Wildcards (*) are +// allowed. For example, "user profile*2015" will return objects with +// names like "user profile June 2015", "user profile April 2015", or +// simply "user profile 2015". Most of the searches also add wildcards +// implicitly at the start and the end of the search string. For +// example, a search string of "user profile" will match objects with +// name "my user profile", "user profile 2015", or simply "user +// profile". +func (c *AccountUserProfilesListCall) SearchString(searchString string) *AccountUserProfilesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *AccountUserProfilesListCall) SortField(sortField string) *AccountUserProfilesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *AccountUserProfilesListCall) SortOrder(sortOrder string) *AccountUserProfilesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// SubaccountId sets the optional parameter "subaccountId": Select only +// user profiles with the specified subaccount ID. +func (c *AccountUserProfilesListCall) SubaccountId(subaccountId int64) *AccountUserProfilesListCall { + c.opt_["subaccountId"] = subaccountId + return c +} + +// UserRoleId sets the optional parameter "userRoleId": Select only user +// profiles with the specified user role ID. +func (c *AccountUserProfilesListCall) UserRoleId(userRoleId int64) *AccountUserProfilesListCall { + c.opt_["userRoleId"] = userRoleId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountUserProfilesListCall) Fields(s ...googleapi.Field) *AccountUserProfilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountUserProfilesListCall) IfNoneMatch(entityTag string) *AccountUserProfilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountUserProfilesListCall) Context(ctx context.Context) *AccountUserProfilesListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountUserProfilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["active"]; ok { + params.Set("active", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["subaccountId"]; ok { + params.Set("subaccountId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["userRoleId"]; ok { + params.Set("userRoleId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountUserProfiles.list" call. +// Exactly one of *AccountUserProfilesListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AccountUserProfilesListResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountUserProfilesListCall) Do() (*AccountUserProfilesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountUserProfilesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of account user profiles, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.accountUserProfiles.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "active": { + // "description": "Select only active user profiles.", + // "location": "query", + // "type": "boolean" + // }, + // "ids": { + // "description": "Select only user profiles with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, \"user profile*2015\" will return objects with names like \"user profile June 2015\", \"user profile April 2015\", or simply \"user profile 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"user profile\" will match objects with name \"my user profile\", \"user profile 2015\", or simply \"user profile\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "subaccountId": { + // "description": "Select only user profiles with the specified subaccount ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "userRoleId": { + // "description": "Select only user profiles with the specified user role ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountUserProfiles", + // "response": { + // "$ref": "AccountUserProfilesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accountUserProfiles.patch": + +type AccountUserProfilesPatchCall struct { + s *Service + profileId int64 + id int64 + accountuserprofile *AccountUserProfile + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing account user profile. This method supports +// patch semantics. +func (r *AccountUserProfilesService) Patch(profileId int64, id int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesPatchCall { + c := &AccountUserProfilesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.accountuserprofile = accountuserprofile + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountUserProfilesPatchCall) Fields(s ...googleapi.Field) *AccountUserProfilesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountUserProfilesPatchCall) Context(ctx context.Context) *AccountUserProfilesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AccountUserProfilesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountUserProfiles.patch" call. +// Exactly one of *AccountUserProfile or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AccountUserProfile.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountUserProfilesPatchCall) Do() (*AccountUserProfile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountUserProfile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing account user profile. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.accountUserProfiles.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "User profile ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountUserProfiles", + // "request": { + // "$ref": "AccountUserProfile" + // }, + // "response": { + // "$ref": "AccountUserProfile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accountUserProfiles.update": + +type AccountUserProfilesUpdateCall struct { + s *Service + profileId int64 + accountuserprofile *AccountUserProfile + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing account user profile. +func (r *AccountUserProfilesService) Update(profileId int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesUpdateCall { + c := &AccountUserProfilesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.accountuserprofile = accountuserprofile + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountUserProfilesUpdateCall) Fields(s ...googleapi.Field) *AccountUserProfilesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountUserProfilesUpdateCall) Context(ctx context.Context) *AccountUserProfilesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountUserProfilesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accountUserProfiles.update" call. +// Exactly one of *AccountUserProfile or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AccountUserProfile.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountUserProfilesUpdateCall) Do() (*AccountUserProfile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountUserProfile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing account user profile.", + // "httpMethod": "PUT", + // "id": "dfareporting.accountUserProfiles.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accountUserProfiles", + // "request": { + // "$ref": "AccountUserProfile" + // }, + // "response": { + // "$ref": "AccountUserProfile" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accounts.get": + +type AccountsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one account by ID. +func (r *AccountsService) Get(profileId int64, id int64) *AccountsGetCall { + c := &AccountsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accounts.get" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsGetCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one account by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.accounts.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Account ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accounts/{id}", + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accounts.list": + +type AccountsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of accounts, possibly filtered. +func (r *AccountsService) List(profileId int64) *AccountsListCall { + c := &AccountsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Active sets the optional parameter "active": Select only active +// accounts. Don't set this field to select both active and non-active +// accounts. +func (c *AccountsListCall) Active(active bool) *AccountsListCall { + c.opt_["active"] = active + return c +} + +// Ids sets the optional parameter "ids": Select only accounts with +// these IDs. +func (c *AccountsListCall) Ids(ids int64) *AccountsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *AccountsListCall) MaxResults(maxResults int64) *AccountsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "account*2015" will return objects with names like "account +// June 2015", "account April 2015", or simply "account 2015". Most of +// the searches also add wildcards implicitly at the start and the end +// of the search string. For example, a search string of "account" will +// match objects with name "my account", "account 2015", or simply +// "account". +func (c *AccountsListCall) SearchString(searchString string) *AccountsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *AccountsListCall) SortField(sortField string) *AccountsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *AccountsListCall) SortOrder(sortOrder string) *AccountsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["active"]; ok { + params.Set("active", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accounts.list" call. +// Exactly one of *AccountsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AccountsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsListCall) Do() (*AccountsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AccountsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of accounts, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.accounts.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "active": { + // "description": "Select only active accounts. Don't set this field to select both active and non-active accounts.", + // "location": "query", + // "type": "boolean" + // }, + // "ids": { + // "description": "Select only accounts with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"account*2015\" will return objects with names like \"account June 2015\", \"account April 2015\", or simply \"account 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"account\" will match objects with name \"my account\", \"account 2015\", or simply \"account\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accounts", + // "response": { + // "$ref": "AccountsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accounts.patch": + +type AccountsPatchCall struct { + s *Service + profileId int64 + id int64 + account *Account + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing account. This method supports patch +// semantics. +func (r *AccountsService) Patch(profileId int64, id int64, account *Account) *AccountsPatchCall { + c := &AccountsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.account = account + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsPatchCall) Fields(s ...googleapi.Field) *AccountsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsPatchCall) Context(ctx context.Context) *AccountsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accounts.patch" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsPatchCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing account. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.accounts.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Account ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accounts", + // "request": { + // "$ref": "Account" + // }, + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.accounts.update": + +type AccountsUpdateCall struct { + s *Service + profileId int64 + account *Account + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing account. +func (r *AccountsService) Update(profileId int64, account *Account) *AccountsUpdateCall { + c := &AccountsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.account = account + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsUpdateCall) Fields(s ...googleapi.Field) *AccountsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsUpdateCall) Context(ctx context.Context) *AccountsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.accounts.update" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsUpdateCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing account.", + // "httpMethod": "PUT", + // "id": "dfareporting.accounts.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/accounts", + // "request": { + // "$ref": "Account" + // }, + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.ads.get": + +type AdsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one ad by ID. +func (r *AdsService) Get(profileId int64, id int64) *AdsGetCall { + c := &AdsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdsGetCall) Fields(s ...googleapi.Field) *AdsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdsGetCall) IfNoneMatch(entityTag string) *AdsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdsGetCall) Context(ctx context.Context) *AdsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AdsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.ads.get" call. +// Exactly one of *Ad or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either *Ad.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AdsGetCall) Do() (*Ad, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Ad{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one ad by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.ads.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Ad ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/ads/{id}", + // "response": { + // "$ref": "Ad" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.ads.insert": + +type AdsInsertCall struct { + s *Service + profileId int64 + ad *Ad + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new ad. +func (r *AdsService) Insert(profileId int64, ad *Ad) *AdsInsertCall { + c := &AdsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.ad = ad + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdsInsertCall) Fields(s ...googleapi.Field) *AdsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdsInsertCall) Context(ctx context.Context) *AdsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *AdsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.ads.insert" call. +// Exactly one of *Ad or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either *Ad.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AdsInsertCall) Do() (*Ad, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Ad{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new ad.", + // "httpMethod": "POST", + // "id": "dfareporting.ads.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/ads", + // "request": { + // "$ref": "Ad" + // }, + // "response": { + // "$ref": "Ad" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.ads.list": + +type AdsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of ads, possibly filtered. +func (r *AdsService) List(profileId int64) *AdsListCall { + c := &AdsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Active sets the optional parameter "active": Select only active ads. +func (c *AdsListCall) Active(active bool) *AdsListCall { + c.opt_["active"] = active + return c +} + +// AdvertiserId sets the optional parameter "advertiserId": Select only +// ads with this advertiser ID. +func (c *AdsListCall) AdvertiserId(advertiserId int64) *AdsListCall { + c.opt_["advertiserId"] = advertiserId + return c +} + +// Archived sets the optional parameter "archived": Select only archived +// ads. +func (c *AdsListCall) Archived(archived bool) *AdsListCall { + c.opt_["archived"] = archived + return c +} + +// AudienceSegmentIds sets the optional parameter "audienceSegmentIds": +// Select only ads with these audience segment IDs. +func (c *AdsListCall) AudienceSegmentIds(audienceSegmentIds int64) *AdsListCall { + c.opt_["audienceSegmentIds"] = audienceSegmentIds + return c +} + +// CampaignIds sets the optional parameter "campaignIds": Select only +// ads with these campaign IDs. +func (c *AdsListCall) CampaignIds(campaignIds int64) *AdsListCall { + c.opt_["campaignIds"] = campaignIds + return c +} + +// Compatibility sets the optional parameter "compatibility": Select +// default ads with the specified compatibility. Applicable when type is +// AD_SERVING_DEFAULT_AD. WEB and WEB_INTERSTITIAL refer to rendering +// either on desktop or on mobile devices for regular or interstitial +// ads, respectively. APP and APP_INTERSTITIAL are for rendering in +// mobile apps. IN_STREAM_VIDEO refers to rendering an in-stream video +// ads developed with the VAST standard. +// +// Possible values: +// "APP" +// "APP_INTERSTITIAL" +// "IN_STREAM_VIDEO" +// "WEB" +// "WEB_INTERSTITIAL" +func (c *AdsListCall) Compatibility(compatibility string) *AdsListCall { + c.opt_["compatibility"] = compatibility + return c +} + +// CreativeIds sets the optional parameter "creativeIds": Select only +// ads with these creative IDs assigned. +func (c *AdsListCall) CreativeIds(creativeIds int64) *AdsListCall { + c.opt_["creativeIds"] = creativeIds + return c +} + +// CreativeOptimizationConfigurationIds sets the optional parameter +// "creativeOptimizationConfigurationIds": Select only ads with these +// creative optimization configuration IDs. +func (c *AdsListCall) CreativeOptimizationConfigurationIds(creativeOptimizationConfigurationIds int64) *AdsListCall { + c.opt_["creativeOptimizationConfigurationIds"] = creativeOptimizationConfigurationIds + return c +} + +// CreativeType sets the optional parameter "creativeType": Select only +// ads with the specified creativeType. +// +// Possible values: +// "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO" +// "CUSTOM_INPAGE" +// "CUSTOM_INTERSTITIAL" +// "ENHANCED_BANNER" +// "ENHANCED_IMAGE" +// "FLASH_INPAGE" +// "HTML5_BANNER" +// "IMAGE" +// "INSTREAM_VIDEO" +// "INTERNAL_REDIRECT" +// "INTERSTITIAL_INTERNAL_REDIRECT" +// "REDIRECT" +// "RICH_MEDIA_EXPANDING" +// "RICH_MEDIA_IM_EXPAND" +// "RICH_MEDIA_INPAGE" +// "RICH_MEDIA_INPAGE_FLOATING" +// "RICH_MEDIA_INTERSTITIAL_FLOAT" +// "RICH_MEDIA_MOBILE_IN_APP" +// "RICH_MEDIA_MULTI_FLOATING" +// "RICH_MEDIA_PEEL_DOWN" +// "TRACKING_TEXT" +// "VAST_REDIRECT" +// "VPAID_LINEAR" +// "VPAID_NON_LINEAR" +func (c *AdsListCall) CreativeType(creativeType string) *AdsListCall { + c.opt_["creativeType"] = creativeType + return c +} + +// DynamicClickTracker sets the optional parameter +// "dynamicClickTracker": Select only dynamic click trackers. Applicable +// when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click +// trackers. If false, select static click trackers. Leave unset to +// select both. +func (c *AdsListCall) DynamicClickTracker(dynamicClickTracker bool) *AdsListCall { + c.opt_["dynamicClickTracker"] = dynamicClickTracker + return c +} + +// Ids sets the optional parameter "ids": Select only ads with these +// IDs. +func (c *AdsListCall) Ids(ids int64) *AdsListCall { + c.opt_["ids"] = ids + return c +} + +// LandingPageIds sets the optional parameter "landingPageIds": Select +// only ads with these landing page IDs. +func (c *AdsListCall) LandingPageIds(landingPageIds int64) *AdsListCall { + c.opt_["landingPageIds"] = landingPageIds + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *AdsListCall) MaxResults(maxResults int64) *AdsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OverriddenEventTagId sets the optional parameter +// "overriddenEventTagId": Select only ads with this event tag override +// ID. +func (c *AdsListCall) OverriddenEventTagId(overriddenEventTagId int64) *AdsListCall { + c.opt_["overriddenEventTagId"] = overriddenEventTagId + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *AdsListCall) PageToken(pageToken string) *AdsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// PlacementIds sets the optional parameter "placementIds": Select only +// ads with these placement IDs assigned. +func (c *AdsListCall) PlacementIds(placementIds int64) *AdsListCall { + c.opt_["placementIds"] = placementIds + return c +} + +// RemarketingListIds sets the optional parameter "remarketingListIds": +// Select only ads whose list targeting expression use these remarketing +// list IDs. +func (c *AdsListCall) RemarketingListIds(remarketingListIds int64) *AdsListCall { + c.opt_["remarketingListIds"] = remarketingListIds + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "ad*2015" will return objects with names like "ad June +// 2015", "ad April 2015", or simply "ad 2015". Most of the searches +// also add wildcards implicitly at the start and the end of the search +// string. For example, a search string of "ad" will match objects with +// name "my ad", "ad 2015", or simply "ad". +func (c *AdsListCall) SearchString(searchString string) *AdsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SizeIds sets the optional parameter "sizeIds": Select only ads with +// these size IDs. +func (c *AdsListCall) SizeIds(sizeIds int64) *AdsListCall { + c.opt_["sizeIds"] = sizeIds + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *AdsListCall) SortField(sortField string) *AdsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *AdsListCall) SortOrder(sortOrder string) *AdsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// SslCompliant sets the optional parameter "sslCompliant": Select only +// ads that are SSL-compliant. +func (c *AdsListCall) SslCompliant(sslCompliant bool) *AdsListCall { + c.opt_["sslCompliant"] = sslCompliant + return c +} + +// SslRequired sets the optional parameter "sslRequired": Select only +// ads that require SSL. +func (c *AdsListCall) SslRequired(sslRequired bool) *AdsListCall { + c.opt_["sslRequired"] = sslRequired + return c +} + +// Type sets the optional parameter "type": Select only ads with these +// types. +// +// Possible values: +// "AD_SERVING_CLICK_TRACKER" +// "AD_SERVING_DEFAULT_AD" +// "AD_SERVING_STANDARD_AD" +// "AD_SERVING_TRACKING" +func (c *AdsListCall) Type(type_ string) *AdsListCall { + c.opt_["type"] = type_ + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdsListCall) Fields(s ...googleapi.Field) *AdsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdsListCall) IfNoneMatch(entityTag string) *AdsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdsListCall) Context(ctx context.Context) *AdsListCall { + c.ctx_ = ctx + return c +} + +func (c *AdsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["active"]; ok { + params.Set("active", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["advertiserId"]; ok { + params.Set("advertiserId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["archived"]; ok { + params.Set("archived", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["audienceSegmentIds"]; ok { + params.Set("audienceSegmentIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["campaignIds"]; ok { + params.Set("campaignIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["compatibility"]; ok { + params.Set("compatibility", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["creativeIds"]; ok { + params.Set("creativeIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["creativeOptimizationConfigurationIds"]; ok { + params.Set("creativeOptimizationConfigurationIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["creativeType"]; ok { + params.Set("creativeType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["dynamicClickTracker"]; ok { + params.Set("dynamicClickTracker", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["landingPageIds"]; ok { + params.Set("landingPageIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["overriddenEventTagId"]; ok { + params.Set("overriddenEventTagId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["placementIds"]; ok { + params.Set("placementIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["remarketingListIds"]; ok { + params.Set("remarketingListIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sizeIds"]; ok { + params.Set("sizeIds", 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)) + } + if v, ok := c.opt_["sslCompliant"]; ok { + params.Set("sslCompliant", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sslRequired"]; ok { + params.Set("sslRequired", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["type"]; ok { + params.Set("type", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.ads.list" call. +// Exactly one of *AdsListResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AdsListResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AdsListCall) Do() (*AdsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of ads, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.ads.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "active": { + // "description": "Select only active ads.", + // "location": "query", + // "type": "boolean" + // }, + // "advertiserId": { + // "description": "Select only ads with this advertiser ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "archived": { + // "description": "Select only archived ads.", + // "location": "query", + // "type": "boolean" + // }, + // "audienceSegmentIds": { + // "description": "Select only ads with these audience segment IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "campaignIds": { + // "description": "Select only ads with these campaign IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "compatibility": { + // "description": "Select default ads with the specified compatibility. Applicable when type is AD_SERVING_DEFAULT_AD. WEB and WEB_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering an in-stream video ads developed with the VAST standard.", + // "enum": [ + // "APP", + // "APP_INTERSTITIAL", + // "IN_STREAM_VIDEO", + // "WEB", + // "WEB_INTERSTITIAL" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "creativeIds": { + // "description": "Select only ads with these creative IDs assigned.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "creativeOptimizationConfigurationIds": { + // "description": "Select only ads with these creative optimization configuration IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "creativeType": { + // "description": "Select only ads with the specified creativeType.", + // "enum": [ + // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO", + // "CUSTOM_INPAGE", + // "CUSTOM_INTERSTITIAL", + // "ENHANCED_BANNER", + // "ENHANCED_IMAGE", + // "FLASH_INPAGE", + // "HTML5_BANNER", + // "IMAGE", + // "INSTREAM_VIDEO", + // "INTERNAL_REDIRECT", + // "INTERSTITIAL_INTERNAL_REDIRECT", + // "REDIRECT", + // "RICH_MEDIA_EXPANDING", + // "RICH_MEDIA_IM_EXPAND", + // "RICH_MEDIA_INPAGE", + // "RICH_MEDIA_INPAGE_FLOATING", + // "RICH_MEDIA_INTERSTITIAL_FLOAT", + // "RICH_MEDIA_MOBILE_IN_APP", + // "RICH_MEDIA_MULTI_FLOATING", + // "RICH_MEDIA_PEEL_DOWN", + // "TRACKING_TEXT", + // "VAST_REDIRECT", + // "VPAID_LINEAR", + // "VPAID_NON_LINEAR" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "dynamicClickTracker": { + // "description": "Select only dynamic click trackers. Applicable when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click trackers. If false, select static click trackers. Leave unset to select both.", + // "location": "query", + // "type": "boolean" + // }, + // "ids": { + // "description": "Select only ads with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "landingPageIds": { + // "description": "Select only ads with these landing page IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "overriddenEventTagId": { + // "description": "Select only ads with this event tag override ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "placementIds": { + // "description": "Select only ads with these placement IDs assigned.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "remarketingListIds": { + // "description": "Select only ads whose list targeting expression use these remarketing list IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"ad*2015\" will return objects with names like \"ad June 2015\", \"ad April 2015\", or simply \"ad 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"ad\" will match objects with name \"my ad\", \"ad 2015\", or simply \"ad\".", + // "location": "query", + // "type": "string" + // }, + // "sizeIds": { + // "description": "Select only ads with these size IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sslCompliant": { + // "description": "Select only ads that are SSL-compliant.", + // "location": "query", + // "type": "boolean" + // }, + // "sslRequired": { + // "description": "Select only ads that require SSL.", + // "location": "query", + // "type": "boolean" + // }, + // "type": { + // "description": "Select only ads with these types.", + // "enum": [ + // "AD_SERVING_CLICK_TRACKER", + // "AD_SERVING_DEFAULT_AD", + // "AD_SERVING_STANDARD_AD", + // "AD_SERVING_TRACKING" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/ads", + // "response": { + // "$ref": "AdsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.ads.patch": + +type AdsPatchCall struct { + s *Service + profileId int64 + id int64 + ad *Ad + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing ad. This method supports patch semantics. +func (r *AdsService) Patch(profileId int64, id int64, ad *Ad) *AdsPatchCall { + c := &AdsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.ad = ad + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdsPatchCall) Fields(s ...googleapi.Field) *AdsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdsPatchCall) Context(ctx context.Context) *AdsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AdsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.ads.patch" call. +// Exactly one of *Ad or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either *Ad.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AdsPatchCall) Do() (*Ad, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Ad{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing ad. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.ads.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Ad ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/ads", + // "request": { + // "$ref": "Ad" + // }, + // "response": { + // "$ref": "Ad" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.ads.update": + +type AdsUpdateCall struct { + s *Service + profileId int64 + ad *Ad + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing ad. +func (r *AdsService) Update(profileId int64, ad *Ad) *AdsUpdateCall { + c := &AdsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.ad = ad + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdsUpdateCall) Fields(s ...googleapi.Field) *AdsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdsUpdateCall) Context(ctx context.Context) *AdsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AdsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.ads.update" call. +// Exactly one of *Ad or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either *Ad.ServerResponse.Header +// or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AdsUpdateCall) Do() (*Ad, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Ad{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing ad.", + // "httpMethod": "PUT", + // "id": "dfareporting.ads.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/ads", + // "request": { + // "$ref": "Ad" + // }, + // "response": { + // "$ref": "Ad" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertiserGroups.delete": + +type AdvertiserGroupsDeleteCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing advertiser group. +func (r *AdvertiserGroupsService) Delete(profileId int64, id int64) *AdvertiserGroupsDeleteCall { + c := &AdvertiserGroupsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertiserGroupsDeleteCall) Fields(s ...googleapi.Field) *AdvertiserGroupsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertiserGroupsDeleteCall) Context(ctx context.Context) *AdvertiserGroupsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertiserGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertiserGroups.delete" call. +func (c *AdvertiserGroupsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing advertiser group.", + // "httpMethod": "DELETE", + // "id": "dfareporting.advertiserGroups.delete", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Advertiser group ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertiserGroups/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertiserGroups.get": + +type AdvertiserGroupsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one advertiser group by ID. +func (r *AdvertiserGroupsService) Get(profileId int64, id int64) *AdvertiserGroupsGetCall { + c := &AdvertiserGroupsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertiserGroupsGetCall) Fields(s ...googleapi.Field) *AdvertiserGroupsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdvertiserGroupsGetCall) IfNoneMatch(entityTag string) *AdvertiserGroupsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertiserGroupsGetCall) Context(ctx context.Context) *AdvertiserGroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertiserGroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertiserGroups.get" call. +// Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AdvertiserGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AdvertiserGroupsGetCall) Do() (*AdvertiserGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdvertiserGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one advertiser group by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.advertiserGroups.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Advertiser group ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertiserGroups/{id}", + // "response": { + // "$ref": "AdvertiserGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertiserGroups.insert": + +type AdvertiserGroupsInsertCall struct { + s *Service + profileId int64 + advertisergroup *AdvertiserGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new advertiser group. +func (r *AdvertiserGroupsService) Insert(profileId int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsInsertCall { + c := &AdvertiserGroupsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.advertisergroup = advertisergroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertiserGroupsInsertCall) Fields(s ...googleapi.Field) *AdvertiserGroupsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertiserGroupsInsertCall) Context(ctx context.Context) *AdvertiserGroupsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertiserGroupsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertiserGroups.insert" call. +// Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AdvertiserGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AdvertiserGroupsInsertCall) Do() (*AdvertiserGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdvertiserGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new advertiser group.", + // "httpMethod": "POST", + // "id": "dfareporting.advertiserGroups.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertiserGroups", + // "request": { + // "$ref": "AdvertiserGroup" + // }, + // "response": { + // "$ref": "AdvertiserGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertiserGroups.list": + +type AdvertiserGroupsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of advertiser groups, possibly filtered. +func (r *AdvertiserGroupsService) List(profileId int64) *AdvertiserGroupsListCall { + c := &AdvertiserGroupsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Ids sets the optional parameter "ids": Select only advertiser groups +// with these IDs. +func (c *AdvertiserGroupsListCall) Ids(ids int64) *AdvertiserGroupsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *AdvertiserGroupsListCall) MaxResults(maxResults int64) *AdvertiserGroupsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *AdvertiserGroupsListCall) PageToken(pageToken string) *AdvertiserGroupsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "advertiser*2015" will return objects with names like +// "advertiser group June 2015", "advertiser group April 2015", or +// simply "advertiser group 2015". Most of the searches also add +// wildcards implicitly at the start and the end of the search string. +// For example, a search string of "advertisergroup" will match objects +// with name "my advertisergroup", "advertisergroup 2015", or simply +// "advertisergroup". +func (c *AdvertiserGroupsListCall) SearchString(searchString string) *AdvertiserGroupsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *AdvertiserGroupsListCall) SortField(sortField string) *AdvertiserGroupsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *AdvertiserGroupsListCall) SortOrder(sortOrder string) *AdvertiserGroupsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertiserGroupsListCall) Fields(s ...googleapi.Field) *AdvertiserGroupsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdvertiserGroupsListCall) IfNoneMatch(entityTag string) *AdvertiserGroupsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertiserGroupsListCall) Context(ctx context.Context) *AdvertiserGroupsListCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertiserGroupsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertiserGroups.list" call. +// Exactly one of *AdvertiserGroupsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AdvertiserGroupsListResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AdvertiserGroupsListCall) Do() (*AdvertiserGroupsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdvertiserGroupsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of advertiser groups, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.advertiserGroups.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "ids": { + // "description": "Select only advertiser groups with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"advertiser*2015\" will return objects with names like \"advertiser group June 2015\", \"advertiser group April 2015\", or simply \"advertiser group 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"advertisergroup\" will match objects with name \"my advertisergroup\", \"advertisergroup 2015\", or simply \"advertisergroup\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertiserGroups", + // "response": { + // "$ref": "AdvertiserGroupsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertiserGroups.patch": + +type AdvertiserGroupsPatchCall struct { + s *Service + profileId int64 + id int64 + advertisergroup *AdvertiserGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing advertiser group. This method supports +// patch semantics. +func (r *AdvertiserGroupsService) Patch(profileId int64, id int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsPatchCall { + c := &AdvertiserGroupsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.advertisergroup = advertisergroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertiserGroupsPatchCall) Fields(s ...googleapi.Field) *AdvertiserGroupsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertiserGroupsPatchCall) Context(ctx context.Context) *AdvertiserGroupsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertiserGroupsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertiserGroups.patch" call. +// Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AdvertiserGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AdvertiserGroupsPatchCall) Do() (*AdvertiserGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdvertiserGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing advertiser group. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.advertiserGroups.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Advertiser group ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertiserGroups", + // "request": { + // "$ref": "AdvertiserGroup" + // }, + // "response": { + // "$ref": "AdvertiserGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertiserGroups.update": + +type AdvertiserGroupsUpdateCall struct { + s *Service + profileId int64 + advertisergroup *AdvertiserGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing advertiser group. +func (r *AdvertiserGroupsService) Update(profileId int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsUpdateCall { + c := &AdvertiserGroupsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.advertisergroup = advertisergroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertiserGroupsUpdateCall) Fields(s ...googleapi.Field) *AdvertiserGroupsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertiserGroupsUpdateCall) Context(ctx context.Context) *AdvertiserGroupsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertiserGroupsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertiserGroups.update" call. +// Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AdvertiserGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AdvertiserGroupsUpdateCall) Do() (*AdvertiserGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdvertiserGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing advertiser group.", + // "httpMethod": "PUT", + // "id": "dfareporting.advertiserGroups.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertiserGroups", + // "request": { + // "$ref": "AdvertiserGroup" + // }, + // "response": { + // "$ref": "AdvertiserGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertisers.get": + +type AdvertisersGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one advertiser by ID. +func (r *AdvertisersService) Get(profileId int64, id int64) *AdvertisersGetCall { + c := &AdvertisersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertisersGetCall) Fields(s ...googleapi.Field) *AdvertisersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdvertisersGetCall) IfNoneMatch(entityTag string) *AdvertisersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertisersGetCall) Context(ctx context.Context) *AdvertisersGetCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertisersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertisers.get" call. +// Exactly one of *Advertiser or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Advertiser.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AdvertisersGetCall) Do() (*Advertiser, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Advertiser{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one advertiser by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.advertisers.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Advertiser ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertisers/{id}", + // "response": { + // "$ref": "Advertiser" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertisers.insert": + +type AdvertisersInsertCall struct { + s *Service + profileId int64 + advertiser *Advertiser + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new advertiser. +func (r *AdvertisersService) Insert(profileId int64, advertiser *Advertiser) *AdvertisersInsertCall { + c := &AdvertisersInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.advertiser = advertiser + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertisersInsertCall) Fields(s ...googleapi.Field) *AdvertisersInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertisersInsertCall) Context(ctx context.Context) *AdvertisersInsertCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertisersInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertisers.insert" call. +// Exactly one of *Advertiser or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Advertiser.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AdvertisersInsertCall) Do() (*Advertiser, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Advertiser{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new advertiser.", + // "httpMethod": "POST", + // "id": "dfareporting.advertisers.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertisers", + // "request": { + // "$ref": "Advertiser" + // }, + // "response": { + // "$ref": "Advertiser" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertisers.list": + +type AdvertisersListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of advertisers, possibly filtered. +func (r *AdvertisersService) List(profileId int64) *AdvertisersListCall { + c := &AdvertisersListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdvertiserGroupIds sets the optional parameter "advertiserGroupIds": +// Select only advertisers with these advertiser group IDs. +func (c *AdvertisersListCall) AdvertiserGroupIds(advertiserGroupIds int64) *AdvertisersListCall { + c.opt_["advertiserGroupIds"] = advertiserGroupIds + return c +} + +// FloodlightConfigurationIds sets the optional parameter +// "floodlightConfigurationIds": Select only advertisers with these +// floodlight configuration IDs. +func (c *AdvertisersListCall) FloodlightConfigurationIds(floodlightConfigurationIds int64) *AdvertisersListCall { + c.opt_["floodlightConfigurationIds"] = floodlightConfigurationIds + return c +} + +// Ids sets the optional parameter "ids": Select only advertisers with +// these IDs. +func (c *AdvertisersListCall) Ids(ids int64) *AdvertisersListCall { + c.opt_["ids"] = ids + return c +} + +// IncludeAdvertisersWithoutGroupsOnly sets the optional parameter +// "includeAdvertisersWithoutGroupsOnly": Select only advertisers which +// do not belong to any advertiser group. +func (c *AdvertisersListCall) IncludeAdvertisersWithoutGroupsOnly(includeAdvertisersWithoutGroupsOnly bool) *AdvertisersListCall { + c.opt_["includeAdvertisersWithoutGroupsOnly"] = includeAdvertisersWithoutGroupsOnly + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *AdvertisersListCall) MaxResults(maxResults int64) *AdvertisersListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OnlyParent sets the optional parameter "onlyParent": Select only +// advertisers which use another advertiser's floodlight configuration. +func (c *AdvertisersListCall) OnlyParent(onlyParent bool) *AdvertisersListCall { + c.opt_["onlyParent"] = onlyParent + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *AdvertisersListCall) PageToken(pageToken string) *AdvertisersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "advertiser*2015" will return objects with names like +// "advertiser June 2015", "advertiser April 2015", or simply +// "advertiser 2015". Most of the searches also add wildcards implicitly +// at the start and the end of the search string. For example, a search +// string of "advertiser" will match objects with name "my advertiser", +// "advertiser 2015", or simply "advertiser". +func (c *AdvertisersListCall) SearchString(searchString string) *AdvertisersListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *AdvertisersListCall) SortField(sortField string) *AdvertisersListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *AdvertisersListCall) SortOrder(sortOrder string) *AdvertisersListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Status sets the optional parameter "status": Select only advertisers +// with the specified status. +// +// Possible values: +// "APPROVED" +// "ON_HOLD" +func (c *AdvertisersListCall) Status(status string) *AdvertisersListCall { + c.opt_["status"] = status + return c +} + +// SubaccountId sets the optional parameter "subaccountId": Select only +// advertisers with these subaccount IDs. +func (c *AdvertisersListCall) SubaccountId(subaccountId int64) *AdvertisersListCall { + c.opt_["subaccountId"] = subaccountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertisersListCall) Fields(s ...googleapi.Field) *AdvertisersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdvertisersListCall) IfNoneMatch(entityTag string) *AdvertisersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertisersListCall) Context(ctx context.Context) *AdvertisersListCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertisersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserGroupIds"]; ok { + params.Set("advertiserGroupIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["floodlightConfigurationIds"]; ok { + params.Set("floodlightConfigurationIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["includeAdvertisersWithoutGroupsOnly"]; ok { + params.Set("includeAdvertisersWithoutGroupsOnly", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["onlyParent"]; ok { + params.Set("onlyParent", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["status"]; ok { + params.Set("status", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["subaccountId"]; ok { + params.Set("subaccountId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertisers.list" call. +// Exactly one of *AdvertisersListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AdvertisersListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AdvertisersListCall) Do() (*AdvertisersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AdvertisersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of advertisers, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.advertisers.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "advertiserGroupIds": { + // "description": "Select only advertisers with these advertiser group IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "floodlightConfigurationIds": { + // "description": "Select only advertisers with these floodlight configuration IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only advertisers with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "includeAdvertisersWithoutGroupsOnly": { + // "description": "Select only advertisers which do not belong to any advertiser group.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "onlyParent": { + // "description": "Select only advertisers which use another advertiser's floodlight configuration.", + // "location": "query", + // "type": "boolean" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"advertiser*2015\" will return objects with names like \"advertiser June 2015\", \"advertiser April 2015\", or simply \"advertiser 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"advertiser\" will match objects with name \"my advertiser\", \"advertiser 2015\", or simply \"advertiser\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "status": { + // "description": "Select only advertisers with the specified status.", + // "enum": [ + // "APPROVED", + // "ON_HOLD" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "subaccountId": { + // "description": "Select only advertisers with these subaccount IDs.", + // "format": "int64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertisers", + // "response": { + // "$ref": "AdvertisersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertisers.patch": + +type AdvertisersPatchCall struct { + s *Service + profileId int64 + id int64 + advertiser *Advertiser + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing advertiser. This method supports patch +// semantics. +func (r *AdvertisersService) Patch(profileId int64, id int64, advertiser *Advertiser) *AdvertisersPatchCall { + c := &AdvertisersPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.advertiser = advertiser + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertisersPatchCall) Fields(s ...googleapi.Field) *AdvertisersPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertisersPatchCall) Context(ctx context.Context) *AdvertisersPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertisersPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertisers.patch" call. +// Exactly one of *Advertiser or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Advertiser.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AdvertisersPatchCall) Do() (*Advertiser, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Advertiser{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing advertiser. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.advertisers.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Advertiser ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertisers", + // "request": { + // "$ref": "Advertiser" + // }, + // "response": { + // "$ref": "Advertiser" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.advertisers.update": + +type AdvertisersUpdateCall struct { + s *Service + profileId int64 + advertiser *Advertiser + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing advertiser. +func (r *AdvertisersService) Update(profileId int64, advertiser *Advertiser) *AdvertisersUpdateCall { + c := &AdvertisersUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.advertiser = advertiser + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertisersUpdateCall) Fields(s ...googleapi.Field) *AdvertisersUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertisersUpdateCall) Context(ctx context.Context) *AdvertisersUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertisersUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.advertisers.update" call. +// Exactly one of *Advertiser or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Advertiser.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AdvertisersUpdateCall) Do() (*Advertiser, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Advertiser{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing advertiser.", + // "httpMethod": "PUT", + // "id": "dfareporting.advertisers.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/advertisers", + // "request": { + // "$ref": "Advertiser" + // }, + // "response": { + // "$ref": "Advertiser" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.browsers.list": + +type BrowsersListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of browsers. +func (r *BrowsersService) List(profileId int64) *BrowsersListCall { + c := &BrowsersListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BrowsersListCall) Fields(s ...googleapi.Field) *BrowsersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BrowsersListCall) IfNoneMatch(entityTag string) *BrowsersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BrowsersListCall) Context(ctx context.Context) *BrowsersListCall { + c.ctx_ = ctx + return c +} + +func (c *BrowsersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/browsers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.browsers.list" call. +// Exactly one of *BrowsersListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BrowsersListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BrowsersListCall) Do() (*BrowsersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BrowsersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of browsers.", + // "httpMethod": "GET", + // "id": "dfareporting.browsers.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/browsers", + // "response": { + // "$ref": "BrowsersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.campaignCreativeAssociations.insert": + +type CampaignCreativeAssociationsInsertCall struct { + s *Service + profileId int64 + campaignId int64 + campaigncreativeassociation *CampaignCreativeAssociation + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Associates a creative with the specified campaign. This +// method creates a default ad with dimensions matching the creative in +// the campaign if such a default ad does not exist already. +func (r *CampaignCreativeAssociationsService) Insert(profileId int64, campaignId int64, campaigncreativeassociation *CampaignCreativeAssociation) *CampaignCreativeAssociationsInsertCall { + c := &CampaignCreativeAssociationsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaignId = campaignId + c.campaigncreativeassociation = campaigncreativeassociation + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CampaignCreativeAssociationsInsertCall) Fields(s ...googleapi.Field) *CampaignCreativeAssociationsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CampaignCreativeAssociationsInsertCall) Context(ctx context.Context) *CampaignCreativeAssociationsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CampaignCreativeAssociationsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaigncreativeassociation) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "campaignId": strconv.FormatInt(c.campaignId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.campaignCreativeAssociations.insert" call. +// Exactly one of *CampaignCreativeAssociation or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *CampaignCreativeAssociation.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CampaignCreativeAssociationsInsertCall) Do() (*CampaignCreativeAssociation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CampaignCreativeAssociation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Associates a creative with the specified campaign. This method creates a default ad with dimensions matching the creative in the campaign if such a default ad does not exist already.", + // "httpMethod": "POST", + // "id": "dfareporting.campaignCreativeAssociations.insert", + // "parameterOrder": [ + // "profileId", + // "campaignId" + // ], + // "parameters": { + // "campaignId": { + // "description": "Campaign ID in this association.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations", + // "request": { + // "$ref": "CampaignCreativeAssociation" + // }, + // "response": { + // "$ref": "CampaignCreativeAssociation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.campaignCreativeAssociations.list": + +type CampaignCreativeAssociationsListCall struct { + s *Service + profileId int64 + campaignId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of creative IDs associated with the +// specified campaign. +func (r *CampaignCreativeAssociationsService) List(profileId int64, campaignId int64) *CampaignCreativeAssociationsListCall { + c := &CampaignCreativeAssociationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaignId = campaignId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *CampaignCreativeAssociationsListCall) MaxResults(maxResults int64) *CampaignCreativeAssociationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *CampaignCreativeAssociationsListCall) PageToken(pageToken string) *CampaignCreativeAssociationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *CampaignCreativeAssociationsListCall) SortOrder(sortOrder string) *CampaignCreativeAssociationsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CampaignCreativeAssociationsListCall) Fields(s ...googleapi.Field) *CampaignCreativeAssociationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CampaignCreativeAssociationsListCall) IfNoneMatch(entityTag string) *CampaignCreativeAssociationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CampaignCreativeAssociationsListCall) Context(ctx context.Context) *CampaignCreativeAssociationsListCall { + c.ctx_ = ctx + return c +} + +func (c *CampaignCreativeAssociationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "campaignId": strconv.FormatInt(c.campaignId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.campaignCreativeAssociations.list" call. +// Exactly one of *CampaignCreativeAssociationsListResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *CampaignCreativeAssociationsListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *CampaignCreativeAssociationsListCall) Do() (*CampaignCreativeAssociationsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CampaignCreativeAssociationsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of creative IDs associated with the specified campaign.", + // "httpMethod": "GET", + // "id": "dfareporting.campaignCreativeAssociations.list", + // "parameterOrder": [ + // "profileId", + // "campaignId" + // ], + // "parameters": { + // "campaignId": { + // "description": "Campaign ID in this association.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations", + // "response": { + // "$ref": "CampaignCreativeAssociationsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.campaigns.get": + +type CampaignsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one campaign by ID. +func (r *CampaignsService) Get(profileId int64, id int64) *CampaignsGetCall { + c := &CampaignsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CampaignsGetCall) Fields(s ...googleapi.Field) *CampaignsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CampaignsGetCall) IfNoneMatch(entityTag string) *CampaignsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CampaignsGetCall) Context(ctx context.Context) *CampaignsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CampaignsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.campaigns.get" call. +// Exactly one of *Campaign or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Campaign.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CampaignsGetCall) Do() (*Campaign, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Campaign{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one campaign by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.campaigns.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Campaign ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{id}", + // "response": { + // "$ref": "Campaign" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.campaigns.insert": + +type CampaignsInsertCall struct { + s *Service + profileId int64 + defaultLandingPageName string + defaultLandingPageUrl string + campaign *Campaign + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new campaign. +func (r *CampaignsService) Insert(profileId int64, defaultLandingPageName string, defaultLandingPageUrl string, campaign *Campaign) *CampaignsInsertCall { + c := &CampaignsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.defaultLandingPageName = defaultLandingPageName + c.defaultLandingPageUrl = defaultLandingPageUrl + c.campaign = campaign + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CampaignsInsertCall) Fields(s ...googleapi.Field) *CampaignsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CampaignsInsertCall) Context(ctx context.Context) *CampaignsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CampaignsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("defaultLandingPageName", fmt.Sprintf("%v", c.defaultLandingPageName)) + params.Set("defaultLandingPageUrl", fmt.Sprintf("%v", c.defaultLandingPageUrl)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.campaigns.insert" call. +// Exactly one of *Campaign or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Campaign.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CampaignsInsertCall) Do() (*Campaign, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Campaign{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new campaign.", + // "httpMethod": "POST", + // "id": "dfareporting.campaigns.insert", + // "parameterOrder": [ + // "profileId", + // "defaultLandingPageName", + // "defaultLandingPageUrl" + // ], + // "parameters": { + // "defaultLandingPageName": { + // "description": "Default landing page name for this new campaign. Must be less than 256 characters long.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "defaultLandingPageUrl": { + // "description": "Default landing page URL for this new campaign.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns", + // "request": { + // "$ref": "Campaign" + // }, + // "response": { + // "$ref": "Campaign" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.campaigns.list": + +type CampaignsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of campaigns, possibly filtered. +func (r *CampaignsService) List(profileId int64) *CampaignsListCall { + c := &CampaignsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdvertiserGroupIds sets the optional parameter "advertiserGroupIds": +// Select only campaigns whose advertisers belong to these advertiser +// groups. +func (c *CampaignsListCall) AdvertiserGroupIds(advertiserGroupIds int64) *CampaignsListCall { + c.opt_["advertiserGroupIds"] = advertiserGroupIds + return c +} + +// AdvertiserIds sets the optional parameter "advertiserIds": Select +// only campaigns that belong to these advertisers. +func (c *CampaignsListCall) AdvertiserIds(advertiserIds int64) *CampaignsListCall { + c.opt_["advertiserIds"] = advertiserIds + return c +} + +// Archived sets the optional parameter "archived": Select only archived +// campaigns. Don't set this field to select both archived and +// non-archived campaigns. +func (c *CampaignsListCall) Archived(archived bool) *CampaignsListCall { + c.opt_["archived"] = archived + return c +} + +// AtLeastOneOptimizationActivity sets the optional parameter +// "atLeastOneOptimizationActivity": Select only campaigns that have at +// least one optimization activity. +func (c *CampaignsListCall) AtLeastOneOptimizationActivity(atLeastOneOptimizationActivity bool) *CampaignsListCall { + c.opt_["atLeastOneOptimizationActivity"] = atLeastOneOptimizationActivity + return c +} + +// ExcludedIds sets the optional parameter "excludedIds": Exclude +// campaigns with these IDs. +func (c *CampaignsListCall) ExcludedIds(excludedIds int64) *CampaignsListCall { + c.opt_["excludedIds"] = excludedIds + return c +} + +// Ids sets the optional parameter "ids": Select only campaigns with +// these IDs. +func (c *CampaignsListCall) Ids(ids int64) *CampaignsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *CampaignsListCall) MaxResults(maxResults int64) *CampaignsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OverriddenEventTagId sets the optional parameter +// "overriddenEventTagId": Select only campaigns that have overridden +// this event tag ID. +func (c *CampaignsListCall) OverriddenEventTagId(overriddenEventTagId int64) *CampaignsListCall { + c.opt_["overriddenEventTagId"] = overriddenEventTagId + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *CampaignsListCall) PageToken(pageToken string) *CampaignsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for campaigns by name or ID. Wildcards (*) are allowed. For +// example, "campaign*2015" will return campaigns with names like +// "campaign June 2015", "campaign April 2015", or simply "campaign +// 2015". Most of the searches also add wildcards implicitly at the +// start and the end of the search string. For example, a search string +// of "campaign" will match campaigns with name "my campaign", "campaign +// 2015", or simply "campaign". +func (c *CampaignsListCall) SearchString(searchString string) *CampaignsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *CampaignsListCall) SortField(sortField string) *CampaignsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *CampaignsListCall) SortOrder(sortOrder string) *CampaignsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// SubaccountId sets the optional parameter "subaccountId": Select only +// campaigns that belong to this subaccount. +func (c *CampaignsListCall) SubaccountId(subaccountId int64) *CampaignsListCall { + c.opt_["subaccountId"] = subaccountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CampaignsListCall) Fields(s ...googleapi.Field) *CampaignsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CampaignsListCall) IfNoneMatch(entityTag string) *CampaignsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CampaignsListCall) Context(ctx context.Context) *CampaignsListCall { + c.ctx_ = ctx + return c +} + +func (c *CampaignsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserGroupIds"]; ok { + params.Set("advertiserGroupIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["advertiserIds"]; ok { + params.Set("advertiserIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["archived"]; ok { + params.Set("archived", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["atLeastOneOptimizationActivity"]; ok { + params.Set("atLeastOneOptimizationActivity", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["excludedIds"]; ok { + params.Set("excludedIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["overriddenEventTagId"]; ok { + params.Set("overriddenEventTagId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["subaccountId"]; ok { + params.Set("subaccountId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.campaigns.list" call. +// Exactly one of *CampaignsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CampaignsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CampaignsListCall) Do() (*CampaignsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CampaignsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of campaigns, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.campaigns.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "advertiserGroupIds": { + // "description": "Select only campaigns whose advertisers belong to these advertiser groups.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "advertiserIds": { + // "description": "Select only campaigns that belong to these advertisers.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "archived": { + // "description": "Select only archived campaigns. Don't set this field to select both archived and non-archived campaigns.", + // "location": "query", + // "type": "boolean" + // }, + // "atLeastOneOptimizationActivity": { + // "description": "Select only campaigns that have at least one optimization activity.", + // "location": "query", + // "type": "boolean" + // }, + // "excludedIds": { + // "description": "Exclude campaigns with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only campaigns with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "overriddenEventTagId": { + // "description": "Select only campaigns that have overridden this event tag ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for campaigns by name or ID. Wildcards (*) are allowed. For example, \"campaign*2015\" will return campaigns with names like \"campaign June 2015\", \"campaign April 2015\", or simply \"campaign 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"campaign\" will match campaigns with name \"my campaign\", \"campaign 2015\", or simply \"campaign\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "subaccountId": { + // "description": "Select only campaigns that belong to this subaccount.", + // "format": "int64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns", + // "response": { + // "$ref": "CampaignsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.campaigns.patch": + +type CampaignsPatchCall struct { + s *Service + profileId int64 + id int64 + campaign *Campaign + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing campaign. This method supports patch +// semantics. +func (r *CampaignsService) Patch(profileId int64, id int64, campaign *Campaign) *CampaignsPatchCall { + c := &CampaignsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.campaign = campaign + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CampaignsPatchCall) Fields(s ...googleapi.Field) *CampaignsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CampaignsPatchCall) Context(ctx context.Context) *CampaignsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CampaignsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.campaigns.patch" call. +// Exactly one of *Campaign or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Campaign.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CampaignsPatchCall) Do() (*Campaign, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Campaign{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing campaign. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.campaigns.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Campaign ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns", + // "request": { + // "$ref": "Campaign" + // }, + // "response": { + // "$ref": "Campaign" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.campaigns.update": + +type CampaignsUpdateCall struct { + s *Service + profileId int64 + campaign *Campaign + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing campaign. +func (r *CampaignsService) Update(profileId int64, campaign *Campaign) *CampaignsUpdateCall { + c := &CampaignsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaign = campaign + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CampaignsUpdateCall) Fields(s ...googleapi.Field) *CampaignsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CampaignsUpdateCall) Context(ctx context.Context) *CampaignsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CampaignsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.campaigns.update" call. +// Exactly one of *Campaign or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Campaign.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CampaignsUpdateCall) Do() (*Campaign, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Campaign{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing campaign.", + // "httpMethod": "PUT", + // "id": "dfareporting.campaigns.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns", + // "request": { + // "$ref": "Campaign" + // }, + // "response": { + // "$ref": "Campaign" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.changeLogs.get": + +type ChangeLogsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one change log by ID. +func (r *ChangeLogsService) Get(profileId int64, id int64) *ChangeLogsGetCall { + c := &ChangeLogsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChangeLogsGetCall) Fields(s ...googleapi.Field) *ChangeLogsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ChangeLogsGetCall) IfNoneMatch(entityTag string) *ChangeLogsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChangeLogsGetCall) Context(ctx context.Context) *ChangeLogsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ChangeLogsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/changeLogs/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.changeLogs.get" call. +// Exactly one of *ChangeLog or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ChangeLog.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ChangeLogsGetCall) Do() (*ChangeLog, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ChangeLog{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one change log by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.changeLogs.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Change log ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/changeLogs/{id}", + // "response": { + // "$ref": "ChangeLog" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.changeLogs.list": + +type ChangeLogsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of change logs. +func (r *ChangeLogsService) List(profileId int64) *ChangeLogsListCall { + c := &ChangeLogsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Action sets the optional parameter "action": Select only change logs +// with the specified action. +// +// Possible values: +// "ACTION_ADD" +// "ACTION_ASSIGN" +// "ACTION_ASSOCIATE" +// "ACTION_CREATE" +// "ACTION_DELETE" +// "ACTION_DISABLE" +// "ACTION_EMAIL_TAGS" +// "ACTION_ENABLE" +// "ACTION_LINK" +// "ACTION_MARK_AS_DEFAULT" +// "ACTION_PUSH" +// "ACTION_REMOVE" +// "ACTION_SEND" +// "ACTION_SHARE" +// "ACTION_UNASSIGN" +// "ACTION_UNLINK" +// "ACTION_UPDATE" +func (c *ChangeLogsListCall) Action(action string) *ChangeLogsListCall { + c.opt_["action"] = action + return c +} + +// Ids sets the optional parameter "ids": Select only change logs with +// these IDs. +func (c *ChangeLogsListCall) Ids(ids int64) *ChangeLogsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxChangeTime sets the optional parameter "maxChangeTime": Select +// only change logs whose change time is before the specified +// maxChangeTime.The time should be formatted as an RFC3339 date/time +// string. For example, for 10:54 PM on July 18th, 2015, in the +// America/New York time zone, the format is +// "2015-07-18T22:54:00-04:00". In other words, the year, month, day, +// the letter T, the hour (24-hour clock system), minute, second, and +// then the time zone offset. +func (c *ChangeLogsListCall) MaxChangeTime(maxChangeTime string) *ChangeLogsListCall { + c.opt_["maxChangeTime"] = maxChangeTime + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *ChangeLogsListCall) MaxResults(maxResults int64) *ChangeLogsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// MinChangeTime sets the optional parameter "minChangeTime": Select +// only change logs whose change time is before the specified +// minChangeTime.The time should be formatted as an RFC3339 date/time +// string. For example, for 10:54 PM on July 18th, 2015, in the +// America/New York time zone, the format is +// "2015-07-18T22:54:00-04:00". In other words, the year, month, day, +// the letter T, the hour (24-hour clock system), minute, second, and +// then the time zone offset. +func (c *ChangeLogsListCall) MinChangeTime(minChangeTime string) *ChangeLogsListCall { + c.opt_["minChangeTime"] = minChangeTime + return c +} + +// ObjectIds sets the optional parameter "objectIds": Select only change +// logs with these object IDs. +func (c *ChangeLogsListCall) ObjectIds(objectIds int64) *ChangeLogsListCall { + c.opt_["objectIds"] = objectIds + return c +} + +// ObjectType sets the optional parameter "objectType": Select only +// change logs with the specified object type. +// +// Possible values: +// "OBJECT_ACCOUNT" +// "OBJECT_ACCOUNT_BILLING_FEATURE" +// "OBJECT_AD" +// "OBJECT_ADVERTISER" +// "OBJECT_ADVERTISER_GROUP" +// "OBJECT_BILLING_ACCOUNT_GROUP" +// "OBJECT_BILLING_FEATURE" +// "OBJECT_BILLING_MINIMUM_FEE" +// "OBJECT_BILLING_PROFILE" +// "OBJECT_CAMPAIGN" +// "OBJECT_CONTENT_CATEGORY" +// "OBJECT_CREATIVE" +// "OBJECT_CREATIVE_ASSET" +// "OBJECT_CREATIVE_BUNDLE" +// "OBJECT_CREATIVE_FIELD" +// "OBJECT_CREATIVE_GROUP" +// "OBJECT_DFA_SITE" +// "OBJECT_EVENT_TAG" +// "OBJECT_FLOODLIGHT_ACTIVITY_GROUP" +// "OBJECT_FLOODLIGHT_ACTVITY" +// "OBJECT_FLOODLIGHT_CONFIGURATION" +// "OBJECT_INSTREAM_CREATIVE" +// "OBJECT_LANDING_PAGE" +// "OBJECT_MEDIA_ORDER" +// "OBJECT_PLACEMENT" +// "OBJECT_PLACEMENT_STRATEGY" +// "OBJECT_PROVIDED_LIST_CLIENT" +// "OBJECT_RATE_CARD" +// "OBJECT_REMARKETING_LIST" +// "OBJECT_RICHMEDIA_CREATIVE" +// "OBJECT_SD_SITE" +// "OBJECT_SIZE" +// "OBJECT_SUBACCOUNT" +// "OBJECT_USER_PROFILE" +// "OBJECT_USER_PROFILE_FILTER" +// "OBJECT_USER_ROLE" +func (c *ChangeLogsListCall) ObjectType(objectType string) *ChangeLogsListCall { + c.opt_["objectType"] = objectType + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *ChangeLogsListCall) PageToken(pageToken string) *ChangeLogsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Select only +// change logs whose object ID, user name, old or new values match the +// search string. +func (c *ChangeLogsListCall) SearchString(searchString string) *ChangeLogsListCall { + c.opt_["searchString"] = searchString + return c +} + +// UserProfileIds sets the optional parameter "userProfileIds": Select +// only change logs with these user profile IDs. +func (c *ChangeLogsListCall) UserProfileIds(userProfileIds int64) *ChangeLogsListCall { + c.opt_["userProfileIds"] = userProfileIds + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChangeLogsListCall) Fields(s ...googleapi.Field) *ChangeLogsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ChangeLogsListCall) IfNoneMatch(entityTag string) *ChangeLogsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChangeLogsListCall) Context(ctx context.Context) *ChangeLogsListCall { + c.ctx_ = ctx + return c +} + +func (c *ChangeLogsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["action"]; ok { + params.Set("action", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxChangeTime"]; ok { + params.Set("maxChangeTime", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["minChangeTime"]; ok { + params.Set("minChangeTime", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["objectIds"]; ok { + params.Set("objectIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["objectType"]; ok { + params.Set("objectType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["userProfileIds"]; ok { + params.Set("userProfileIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/changeLogs") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.changeLogs.list" call. +// Exactly one of *ChangeLogsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ChangeLogsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ChangeLogsListCall) Do() (*ChangeLogsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ChangeLogsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of change logs.", + // "httpMethod": "GET", + // "id": "dfareporting.changeLogs.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "action": { + // "description": "Select only change logs with the specified action.", + // "enum": [ + // "ACTION_ADD", + // "ACTION_ASSIGN", + // "ACTION_ASSOCIATE", + // "ACTION_CREATE", + // "ACTION_DELETE", + // "ACTION_DISABLE", + // "ACTION_EMAIL_TAGS", + // "ACTION_ENABLE", + // "ACTION_LINK", + // "ACTION_MARK_AS_DEFAULT", + // "ACTION_PUSH", + // "ACTION_REMOVE", + // "ACTION_SEND", + // "ACTION_SHARE", + // "ACTION_UNASSIGN", + // "ACTION_UNLINK", + // "ACTION_UPDATE" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "ids": { + // "description": "Select only change logs with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxChangeTime": { + // "description": "Select only change logs whose change time is before the specified maxChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is \"2015-07-18T22:54:00-04:00\". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "minChangeTime": { + // "description": "Select only change logs whose change time is before the specified minChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is \"2015-07-18T22:54:00-04:00\". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset.", + // "location": "query", + // "type": "string" + // }, + // "objectIds": { + // "description": "Select only change logs with these object IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "objectType": { + // "description": "Select only change logs with the specified object type.", + // "enum": [ + // "OBJECT_ACCOUNT", + // "OBJECT_ACCOUNT_BILLING_FEATURE", + // "OBJECT_AD", + // "OBJECT_ADVERTISER", + // "OBJECT_ADVERTISER_GROUP", + // "OBJECT_BILLING_ACCOUNT_GROUP", + // "OBJECT_BILLING_FEATURE", + // "OBJECT_BILLING_MINIMUM_FEE", + // "OBJECT_BILLING_PROFILE", + // "OBJECT_CAMPAIGN", + // "OBJECT_CONTENT_CATEGORY", + // "OBJECT_CREATIVE", + // "OBJECT_CREATIVE_ASSET", + // "OBJECT_CREATIVE_BUNDLE", + // "OBJECT_CREATIVE_FIELD", + // "OBJECT_CREATIVE_GROUP", + // "OBJECT_DFA_SITE", + // "OBJECT_EVENT_TAG", + // "OBJECT_FLOODLIGHT_ACTIVITY_GROUP", + // "OBJECT_FLOODLIGHT_ACTVITY", + // "OBJECT_FLOODLIGHT_CONFIGURATION", + // "OBJECT_INSTREAM_CREATIVE", + // "OBJECT_LANDING_PAGE", + // "OBJECT_MEDIA_ORDER", + // "OBJECT_PLACEMENT", + // "OBJECT_PLACEMENT_STRATEGY", + // "OBJECT_PROVIDED_LIST_CLIENT", + // "OBJECT_RATE_CARD", + // "OBJECT_REMARKETING_LIST", + // "OBJECT_RICHMEDIA_CREATIVE", + // "OBJECT_SD_SITE", + // "OBJECT_SIZE", + // "OBJECT_SUBACCOUNT", + // "OBJECT_USER_PROFILE", + // "OBJECT_USER_PROFILE_FILTER", + // "OBJECT_USER_ROLE" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Select only change logs whose object ID, user name, old or new values match the search string.", + // "location": "query", + // "type": "string" + // }, + // "userProfileIds": { + // "description": "Select only change logs with these user profile IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/changeLogs", + // "response": { + // "$ref": "ChangeLogsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.cities.list": + +type CitiesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of cities, possibly filtered. +func (r *CitiesService) List(profileId int64) *CitiesListCall { + c := &CitiesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// CountryDartIds sets the optional parameter "countryDartIds": Select +// only cities from these countries. +func (c *CitiesListCall) CountryDartIds(countryDartIds int64) *CitiesListCall { + c.opt_["countryDartIds"] = countryDartIds + return c +} + +// DartIds sets the optional parameter "dartIds": Select only cities +// with these DART IDs. +func (c *CitiesListCall) DartIds(dartIds int64) *CitiesListCall { + c.opt_["dartIds"] = dartIds + return c +} + +// NamePrefix sets the optional parameter "namePrefix": Select only +// cities with names starting with this prefix. +func (c *CitiesListCall) NamePrefix(namePrefix string) *CitiesListCall { + c.opt_["namePrefix"] = namePrefix + return c +} + +// RegionDartIds sets the optional parameter "regionDartIds": Select +// only cities from these regions. +func (c *CitiesListCall) RegionDartIds(regionDartIds int64) *CitiesListCall { + c.opt_["regionDartIds"] = regionDartIds + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CitiesListCall) Fields(s ...googleapi.Field) *CitiesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CitiesListCall) IfNoneMatch(entityTag string) *CitiesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CitiesListCall) Context(ctx context.Context) *CitiesListCall { + c.ctx_ = ctx + return c +} + +func (c *CitiesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["countryDartIds"]; ok { + params.Set("countryDartIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["dartIds"]; ok { + params.Set("dartIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["namePrefix"]; ok { + params.Set("namePrefix", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["regionDartIds"]; ok { + params.Set("regionDartIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/cities") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.cities.list" call. +// Exactly one of *CitiesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CitiesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CitiesListCall) Do() (*CitiesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CitiesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of cities, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.cities.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "countryDartIds": { + // "description": "Select only cities from these countries.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "dartIds": { + // "description": "Select only cities with these DART IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "namePrefix": { + // "description": "Select only cities with names starting with this prefix.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "regionDartIds": { + // "description": "Select only cities from these regions.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/cities", + // "response": { + // "$ref": "CitiesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.connectionTypes.get": + +type ConnectionTypesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one connection type by ID. +func (r *ConnectionTypesService) Get(profileId int64, id int64) *ConnectionTypesGetCall { + c := &ConnectionTypesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ConnectionTypesGetCall) Fields(s ...googleapi.Field) *ConnectionTypesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ConnectionTypesGetCall) IfNoneMatch(entityTag string) *ConnectionTypesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ConnectionTypesGetCall) Context(ctx context.Context) *ConnectionTypesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ConnectionTypesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/connectionTypes/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.connectionTypes.get" call. +// Exactly one of *ConnectionType or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ConnectionType.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ConnectionTypesGetCall) Do() (*ConnectionType, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ConnectionType{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one connection type by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.connectionTypes.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Connection type ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/connectionTypes/{id}", + // "response": { + // "$ref": "ConnectionType" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.connectionTypes.list": + +type ConnectionTypesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of connection types. +func (r *ConnectionTypesService) List(profileId int64) *ConnectionTypesListCall { + c := &ConnectionTypesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ConnectionTypesListCall) Fields(s ...googleapi.Field) *ConnectionTypesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ConnectionTypesListCall) IfNoneMatch(entityTag string) *ConnectionTypesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ConnectionTypesListCall) Context(ctx context.Context) *ConnectionTypesListCall { + c.ctx_ = ctx + return c +} + +func (c *ConnectionTypesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/connectionTypes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.connectionTypes.list" call. +// Exactly one of *ConnectionTypesListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ConnectionTypesListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ConnectionTypesListCall) Do() (*ConnectionTypesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ConnectionTypesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of connection types.", + // "httpMethod": "GET", + // "id": "dfareporting.connectionTypes.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/connectionTypes", + // "response": { + // "$ref": "ConnectionTypesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.contentCategories.delete": + +type ContentCategoriesDeleteCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing content category. +func (r *ContentCategoriesService) Delete(profileId int64, id int64) *ContentCategoriesDeleteCall { + c := &ContentCategoriesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ContentCategoriesDeleteCall) Fields(s ...googleapi.Field) *ContentCategoriesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ContentCategoriesDeleteCall) Context(ctx context.Context) *ContentCategoriesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ContentCategoriesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.contentCategories.delete" call. +func (c *ContentCategoriesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing content category.", + // "httpMethod": "DELETE", + // "id": "dfareporting.contentCategories.delete", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Content category ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/contentCategories/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.contentCategories.get": + +type ContentCategoriesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one content category by ID. +func (r *ContentCategoriesService) Get(profileId int64, id int64) *ContentCategoriesGetCall { + c := &ContentCategoriesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ContentCategoriesGetCall) Fields(s ...googleapi.Field) *ContentCategoriesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ContentCategoriesGetCall) IfNoneMatch(entityTag string) *ContentCategoriesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ContentCategoriesGetCall) Context(ctx context.Context) *ContentCategoriesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ContentCategoriesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.contentCategories.get" call. +// Exactly one of *ContentCategory or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ContentCategory.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ContentCategoriesGetCall) Do() (*ContentCategory, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ContentCategory{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one content category by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.contentCategories.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Content category ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/contentCategories/{id}", + // "response": { + // "$ref": "ContentCategory" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.contentCategories.insert": + +type ContentCategoriesInsertCall struct { + s *Service + profileId int64 + contentcategory *ContentCategory + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new content category. +func (r *ContentCategoriesService) Insert(profileId int64, contentcategory *ContentCategory) *ContentCategoriesInsertCall { + c := &ContentCategoriesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.contentcategory = contentcategory + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ContentCategoriesInsertCall) Fields(s ...googleapi.Field) *ContentCategoriesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ContentCategoriesInsertCall) Context(ctx context.Context) *ContentCategoriesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ContentCategoriesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.contentCategories.insert" call. +// Exactly one of *ContentCategory or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ContentCategory.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ContentCategoriesInsertCall) Do() (*ContentCategory, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ContentCategory{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new content category.", + // "httpMethod": "POST", + // "id": "dfareporting.contentCategories.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/contentCategories", + // "request": { + // "$ref": "ContentCategory" + // }, + // "response": { + // "$ref": "ContentCategory" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.contentCategories.list": + +type ContentCategoriesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of content categories, possibly filtered. +func (r *ContentCategoriesService) List(profileId int64) *ContentCategoriesListCall { + c := &ContentCategoriesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Ids sets the optional parameter "ids": Select only content categories +// with these IDs. +func (c *ContentCategoriesListCall) Ids(ids int64) *ContentCategoriesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *ContentCategoriesListCall) MaxResults(maxResults int64) *ContentCategoriesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *ContentCategoriesListCall) PageToken(pageToken string) *ContentCategoriesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "contentcategory*2015" will return objects with names like +// "contentcategory June 2015", "contentcategory April 2015", or simply +// "contentcategory 2015". Most of the searches also add wildcards +// implicitly at the start and the end of the search string. For +// example, a search string of "contentcategory" will match objects with +// name "my contentcategory", "contentcategory 2015", or simply +// "contentcategory". +func (c *ContentCategoriesListCall) SearchString(searchString string) *ContentCategoriesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *ContentCategoriesListCall) SortField(sortField string) *ContentCategoriesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *ContentCategoriesListCall) SortOrder(sortOrder string) *ContentCategoriesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ContentCategoriesListCall) Fields(s ...googleapi.Field) *ContentCategoriesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ContentCategoriesListCall) IfNoneMatch(entityTag string) *ContentCategoriesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ContentCategoriesListCall) Context(ctx context.Context) *ContentCategoriesListCall { + c.ctx_ = ctx + return c +} + +func (c *ContentCategoriesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.contentCategories.list" call. +// Exactly one of *ContentCategoriesListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ContentCategoriesListResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ContentCategoriesListCall) Do() (*ContentCategoriesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ContentCategoriesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of content categories, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.contentCategories.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "ids": { + // "description": "Select only content categories with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"contentcategory*2015\" will return objects with names like \"contentcategory June 2015\", \"contentcategory April 2015\", or simply \"contentcategory 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"contentcategory\" will match objects with name \"my contentcategory\", \"contentcategory 2015\", or simply \"contentcategory\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/contentCategories", + // "response": { + // "$ref": "ContentCategoriesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.contentCategories.patch": + +type ContentCategoriesPatchCall struct { + s *Service + profileId int64 + id int64 + contentcategory *ContentCategory + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing content category. This method supports +// patch semantics. +func (r *ContentCategoriesService) Patch(profileId int64, id int64, contentcategory *ContentCategory) *ContentCategoriesPatchCall { + c := &ContentCategoriesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.contentcategory = contentcategory + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ContentCategoriesPatchCall) Fields(s ...googleapi.Field) *ContentCategoriesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ContentCategoriesPatchCall) Context(ctx context.Context) *ContentCategoriesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ContentCategoriesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.contentCategories.patch" call. +// Exactly one of *ContentCategory or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ContentCategory.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ContentCategoriesPatchCall) Do() (*ContentCategory, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ContentCategory{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing content category. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.contentCategories.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Content category ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/contentCategories", + // "request": { + // "$ref": "ContentCategory" + // }, + // "response": { + // "$ref": "ContentCategory" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.contentCategories.update": + +type ContentCategoriesUpdateCall struct { + s *Service + profileId int64 + contentcategory *ContentCategory + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing content category. +func (r *ContentCategoriesService) Update(profileId int64, contentcategory *ContentCategory) *ContentCategoriesUpdateCall { + c := &ContentCategoriesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.contentcategory = contentcategory + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ContentCategoriesUpdateCall) Fields(s ...googleapi.Field) *ContentCategoriesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ContentCategoriesUpdateCall) Context(ctx context.Context) *ContentCategoriesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ContentCategoriesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.contentCategories.update" call. +// Exactly one of *ContentCategory or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ContentCategory.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ContentCategoriesUpdateCall) Do() (*ContentCategory, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ContentCategory{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing content category.", + // "httpMethod": "PUT", + // "id": "dfareporting.contentCategories.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/contentCategories", + // "request": { + // "$ref": "ContentCategory" + // }, + // "response": { + // "$ref": "ContentCategory" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.countries.get": + +type CountriesGetCall struct { + s *Service + profileId int64 + dartId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one country by ID. +func (r *CountriesService) Get(profileId int64, dartId int64) *CountriesGetCall { + c := &CountriesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.dartId = dartId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CountriesGetCall) Fields(s ...googleapi.Field) *CountriesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CountriesGetCall) IfNoneMatch(entityTag string) *CountriesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CountriesGetCall) Context(ctx context.Context) *CountriesGetCall { + c.ctx_ = ctx + return c +} + +func (c *CountriesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/countries/{dartId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "dartId": strconv.FormatInt(c.dartId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.countries.get" call. +// Exactly one of *Country or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Country.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CountriesGetCall) Do() (*Country, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Country{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one country by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.countries.get", + // "parameterOrder": [ + // "profileId", + // "dartId" + // ], + // "parameters": { + // "dartId": { + // "description": "Country DART ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/countries/{dartId}", + // "response": { + // "$ref": "Country" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.countries.list": + +type CountriesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of countries. +func (r *CountriesService) List(profileId int64) *CountriesListCall { + c := &CountriesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CountriesListCall) Fields(s ...googleapi.Field) *CountriesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CountriesListCall) IfNoneMatch(entityTag string) *CountriesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CountriesListCall) Context(ctx context.Context) *CountriesListCall { + c.ctx_ = ctx + return c +} + +func (c *CountriesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/countries") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.countries.list" call. +// Exactly one of *CountriesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CountriesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CountriesListCall) Do() (*CountriesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CountriesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of countries.", + // "httpMethod": "GET", + // "id": "dfareporting.countries.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/countries", + // "response": { + // "$ref": "CountriesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeAssets.insert": + +type CreativeAssetsInsertCall struct { + s *Service + profileId int64 + advertiserId int64 + creativeassetmetadata *CreativeAssetMetadata + opt_ map[string]interface{} + media_ io.Reader + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// Insert: Inserts a new creative asset. +func (r *CreativeAssetsService) Insert(profileId int64, advertiserId int64, creativeassetmetadata *CreativeAssetMetadata) *CreativeAssetsInsertCall { + c := &CreativeAssetsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.advertiserId = advertiserId + c.creativeassetmetadata = creativeassetmetadata + return c +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *CreativeAssetsInsertCall) Media(r io.Reader) *CreativeAssetsInsertCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *CreativeAssetsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *CreativeAssetsInsertCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *CreativeAssetsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *CreativeAssetsInsertCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeAssetsInsertCall) Fields(s ...googleapi.Field) *CreativeAssetsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *CreativeAssetsInsertCall) Context(ctx context.Context) *CreativeAssetsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeAssetsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativeassetmetadata) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "advertiserId": strconv.FormatInt(c.advertiserId, 10), + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeAssets.insert" call. +// Exactly one of *CreativeAssetMetadata or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CreativeAssetMetadata.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeAssetsInsertCall) Do() (*CreativeAssetMetadata, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &CreativeAssetMetadata{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new creative asset.", + // "httpMethod": "POST", + // "id": "dfareporting.creativeAssets.insert", + // "mediaUpload": { + // "accept": [ + // "*/*" + // ], + // "maxSize": "100MB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/dfareporting/v2.2/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/dfareporting/v2.2/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets" + // } + // } + // }, + // "parameterOrder": [ + // "profileId", + // "advertiserId" + // ], + // "parameters": { + // "advertiserId": { + // "description": "Advertiser ID of this creative. This is a required field.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets", + // "request": { + // "$ref": "CreativeAssetMetadata" + // }, + // "response": { + // "$ref": "CreativeAssetMetadata" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "dfareporting.creativeFieldValues.delete": + +type CreativeFieldValuesDeleteCall struct { + s *Service + profileId int64 + creativeFieldId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing creative field value. +func (r *CreativeFieldValuesService) Delete(profileId int64, creativeFieldId int64, id int64) *CreativeFieldValuesDeleteCall { + c := &CreativeFieldValuesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativeFieldId = creativeFieldId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldValuesDeleteCall) Fields(s ...googleapi.Field) *CreativeFieldValuesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldValuesDeleteCall) Context(ctx context.Context) *CreativeFieldValuesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldValuesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFieldValues.delete" call. +func (c *CreativeFieldValuesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing creative field value.", + // "httpMethod": "DELETE", + // "id": "dfareporting.creativeFieldValues.delete", + // "parameterOrder": [ + // "profileId", + // "creativeFieldId", + // "id" + // ], + // "parameters": { + // "creativeFieldId": { + // "description": "Creative field ID for this creative field value.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "id": { + // "description": "Creative Field Value ID", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFieldValues.get": + +type CreativeFieldValuesGetCall struct { + s *Service + profileId int64 + creativeFieldId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one creative field value by ID. +func (r *CreativeFieldValuesService) Get(profileId int64, creativeFieldId int64, id int64) *CreativeFieldValuesGetCall { + c := &CreativeFieldValuesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativeFieldId = creativeFieldId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldValuesGetCall) Fields(s ...googleapi.Field) *CreativeFieldValuesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativeFieldValuesGetCall) IfNoneMatch(entityTag string) *CreativeFieldValuesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldValuesGetCall) Context(ctx context.Context) *CreativeFieldValuesGetCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldValuesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFieldValues.get" call. +// Exactly one of *CreativeFieldValue or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CreativeFieldValue.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldValuesGetCall) Do() (*CreativeFieldValue, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeFieldValue{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one creative field value by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.creativeFieldValues.get", + // "parameterOrder": [ + // "profileId", + // "creativeFieldId", + // "id" + // ], + // "parameters": { + // "creativeFieldId": { + // "description": "Creative field ID for this creative field value.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "id": { + // "description": "Creative Field Value ID", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}", + // "response": { + // "$ref": "CreativeFieldValue" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFieldValues.insert": + +type CreativeFieldValuesInsertCall struct { + s *Service + profileId int64 + creativeFieldId int64 + creativefieldvalue *CreativeFieldValue + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new creative field value. +func (r *CreativeFieldValuesService) Insert(profileId int64, creativeFieldId int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesInsertCall { + c := &CreativeFieldValuesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativeFieldId = creativeFieldId + c.creativefieldvalue = creativefieldvalue + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldValuesInsertCall) Fields(s ...googleapi.Field) *CreativeFieldValuesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldValuesInsertCall) Context(ctx context.Context) *CreativeFieldValuesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldValuesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFieldValues.insert" call. +// Exactly one of *CreativeFieldValue or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CreativeFieldValue.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldValuesInsertCall) Do() (*CreativeFieldValue, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeFieldValue{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new creative field value.", + // "httpMethod": "POST", + // "id": "dfareporting.creativeFieldValues.insert", + // "parameterOrder": [ + // "profileId", + // "creativeFieldId" + // ], + // "parameters": { + // "creativeFieldId": { + // "description": "Creative field ID for this creative field value.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + // "request": { + // "$ref": "CreativeFieldValue" + // }, + // "response": { + // "$ref": "CreativeFieldValue" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFieldValues.list": + +type CreativeFieldValuesListCall struct { + s *Service + profileId int64 + creativeFieldId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of creative field values, possibly filtered. +func (r *CreativeFieldValuesService) List(profileId int64, creativeFieldId int64) *CreativeFieldValuesListCall { + c := &CreativeFieldValuesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativeFieldId = creativeFieldId + return c +} + +// Ids sets the optional parameter "ids": Select only creative field +// values with these IDs. +func (c *CreativeFieldValuesListCall) Ids(ids int64) *CreativeFieldValuesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *CreativeFieldValuesListCall) MaxResults(maxResults int64) *CreativeFieldValuesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *CreativeFieldValuesListCall) PageToken(pageToken string) *CreativeFieldValuesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for creative field values by their values. Wildcards (e.g. +// *) are not allowed. +func (c *CreativeFieldValuesListCall) SearchString(searchString string) *CreativeFieldValuesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "VALUE" +func (c *CreativeFieldValuesListCall) SortField(sortField string) *CreativeFieldValuesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *CreativeFieldValuesListCall) SortOrder(sortOrder string) *CreativeFieldValuesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldValuesListCall) Fields(s ...googleapi.Field) *CreativeFieldValuesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativeFieldValuesListCall) IfNoneMatch(entityTag string) *CreativeFieldValuesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldValuesListCall) Context(ctx context.Context) *CreativeFieldValuesListCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldValuesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFieldValues.list" call. +// Exactly one of *CreativeFieldValuesListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *CreativeFieldValuesListResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldValuesListCall) Do() (*CreativeFieldValuesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeFieldValuesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of creative field values, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.creativeFieldValues.list", + // "parameterOrder": [ + // "profileId", + // "creativeFieldId" + // ], + // "parameters": { + // "creativeFieldId": { + // "description": "Creative field ID for this creative field value.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only creative field values with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for creative field values by their values. Wildcards (e.g. *) are not allowed.", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "VALUE" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + // "response": { + // "$ref": "CreativeFieldValuesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFieldValues.patch": + +type CreativeFieldValuesPatchCall struct { + s *Service + profileId int64 + creativeFieldId int64 + id int64 + creativefieldvalue *CreativeFieldValue + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing creative field value. This method supports +// patch semantics. +func (r *CreativeFieldValuesService) Patch(profileId int64, creativeFieldId int64, id int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesPatchCall { + c := &CreativeFieldValuesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativeFieldId = creativeFieldId + c.id = id + c.creativefieldvalue = creativefieldvalue + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldValuesPatchCall) Fields(s ...googleapi.Field) *CreativeFieldValuesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldValuesPatchCall) Context(ctx context.Context) *CreativeFieldValuesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldValuesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFieldValues.patch" call. +// Exactly one of *CreativeFieldValue or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CreativeFieldValue.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldValuesPatchCall) Do() (*CreativeFieldValue, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeFieldValue{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing creative field value. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.creativeFieldValues.patch", + // "parameterOrder": [ + // "profileId", + // "creativeFieldId", + // "id" + // ], + // "parameters": { + // "creativeFieldId": { + // "description": "Creative field ID for this creative field value.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "id": { + // "description": "Creative Field Value ID", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + // "request": { + // "$ref": "CreativeFieldValue" + // }, + // "response": { + // "$ref": "CreativeFieldValue" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFieldValues.update": + +type CreativeFieldValuesUpdateCall struct { + s *Service + profileId int64 + creativeFieldId int64 + creativefieldvalue *CreativeFieldValue + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing creative field value. +func (r *CreativeFieldValuesService) Update(profileId int64, creativeFieldId int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesUpdateCall { + c := &CreativeFieldValuesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativeFieldId = creativeFieldId + c.creativefieldvalue = creativefieldvalue + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldValuesUpdateCall) Fields(s ...googleapi.Field) *CreativeFieldValuesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldValuesUpdateCall) Context(ctx context.Context) *CreativeFieldValuesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldValuesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFieldValues.update" call. +// Exactly one of *CreativeFieldValue or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CreativeFieldValue.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldValuesUpdateCall) Do() (*CreativeFieldValue, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeFieldValue{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing creative field value.", + // "httpMethod": "PUT", + // "id": "dfareporting.creativeFieldValues.update", + // "parameterOrder": [ + // "profileId", + // "creativeFieldId" + // ], + // "parameters": { + // "creativeFieldId": { + // "description": "Creative field ID for this creative field value.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues", + // "request": { + // "$ref": "CreativeFieldValue" + // }, + // "response": { + // "$ref": "CreativeFieldValue" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFields.delete": + +type CreativeFieldsDeleteCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing creative field. +func (r *CreativeFieldsService) Delete(profileId int64, id int64) *CreativeFieldsDeleteCall { + c := &CreativeFieldsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldsDeleteCall) Fields(s ...googleapi.Field) *CreativeFieldsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldsDeleteCall) Context(ctx context.Context) *CreativeFieldsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFields.delete" call. +func (c *CreativeFieldsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing creative field.", + // "httpMethod": "DELETE", + // "id": "dfareporting.creativeFields.delete", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Creative Field ID", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFields.get": + +type CreativeFieldsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one creative field by ID. +func (r *CreativeFieldsService) Get(profileId int64, id int64) *CreativeFieldsGetCall { + c := &CreativeFieldsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldsGetCall) Fields(s ...googleapi.Field) *CreativeFieldsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativeFieldsGetCall) IfNoneMatch(entityTag string) *CreativeFieldsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldsGetCall) Context(ctx context.Context) *CreativeFieldsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFields.get" call. +// Exactly one of *CreativeField or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativeField.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldsGetCall) Do() (*CreativeField, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeField{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one creative field by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.creativeFields.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Creative Field ID", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields/{id}", + // "response": { + // "$ref": "CreativeField" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFields.insert": + +type CreativeFieldsInsertCall struct { + s *Service + profileId int64 + creativefield *CreativeField + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new creative field. +func (r *CreativeFieldsService) Insert(profileId int64, creativefield *CreativeField) *CreativeFieldsInsertCall { + c := &CreativeFieldsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativefield = creativefield + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldsInsertCall) Fields(s ...googleapi.Field) *CreativeFieldsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldsInsertCall) Context(ctx context.Context) *CreativeFieldsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFields.insert" call. +// Exactly one of *CreativeField or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativeField.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldsInsertCall) Do() (*CreativeField, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeField{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new creative field.", + // "httpMethod": "POST", + // "id": "dfareporting.creativeFields.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields", + // "request": { + // "$ref": "CreativeField" + // }, + // "response": { + // "$ref": "CreativeField" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFields.list": + +type CreativeFieldsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of creative fields, possibly filtered. +func (r *CreativeFieldsService) List(profileId int64) *CreativeFieldsListCall { + c := &CreativeFieldsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdvertiserIds sets the optional parameter "advertiserIds": Select +// only creative fields that belong to these advertisers. +func (c *CreativeFieldsListCall) AdvertiserIds(advertiserIds int64) *CreativeFieldsListCall { + c.opt_["advertiserIds"] = advertiserIds + return c +} + +// Ids sets the optional parameter "ids": Select only creative fields +// with these IDs. +func (c *CreativeFieldsListCall) Ids(ids int64) *CreativeFieldsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *CreativeFieldsListCall) MaxResults(maxResults int64) *CreativeFieldsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *CreativeFieldsListCall) PageToken(pageToken string) *CreativeFieldsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for creative fields by name or ID. Wildcards (*) are +// allowed. For example, "creativefield*2015" will return creative +// fields with names like "creativefield June 2015", "creativefield +// April 2015", or simply "creativefield 2015". Most of the searches +// also add wild-cards implicitly at the start and the end of the search +// string. For example, a search string of "creativefield" will match +// creative fields with the name "my creativefield", "creativefield +// 2015", or simply "creativefield". +func (c *CreativeFieldsListCall) SearchString(searchString string) *CreativeFieldsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *CreativeFieldsListCall) SortField(sortField string) *CreativeFieldsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *CreativeFieldsListCall) SortOrder(sortOrder string) *CreativeFieldsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldsListCall) Fields(s ...googleapi.Field) *CreativeFieldsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativeFieldsListCall) IfNoneMatch(entityTag string) *CreativeFieldsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldsListCall) Context(ctx context.Context) *CreativeFieldsListCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserIds"]; ok { + params.Set("advertiserIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFields.list" call. +// Exactly one of *CreativeFieldsListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *CreativeFieldsListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldsListCall) Do() (*CreativeFieldsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeFieldsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of creative fields, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.creativeFields.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "advertiserIds": { + // "description": "Select only creative fields that belong to these advertisers.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only creative fields with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for creative fields by name or ID. Wildcards (*) are allowed. For example, \"creativefield*2015\" will return creative fields with names like \"creativefield June 2015\", \"creativefield April 2015\", or simply \"creativefield 2015\". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of \"creativefield\" will match creative fields with the name \"my creativefield\", \"creativefield 2015\", or simply \"creativefield\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields", + // "response": { + // "$ref": "CreativeFieldsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFields.patch": + +type CreativeFieldsPatchCall struct { + s *Service + profileId int64 + id int64 + creativefield *CreativeField + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing creative field. This method supports patch +// semantics. +func (r *CreativeFieldsService) Patch(profileId int64, id int64, creativefield *CreativeField) *CreativeFieldsPatchCall { + c := &CreativeFieldsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.creativefield = creativefield + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldsPatchCall) Fields(s ...googleapi.Field) *CreativeFieldsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldsPatchCall) Context(ctx context.Context) *CreativeFieldsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFields.patch" call. +// Exactly one of *CreativeField or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativeField.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldsPatchCall) Do() (*CreativeField, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeField{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing creative field. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.creativeFields.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Creative Field ID", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields", + // "request": { + // "$ref": "CreativeField" + // }, + // "response": { + // "$ref": "CreativeField" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeFields.update": + +type CreativeFieldsUpdateCall struct { + s *Service + profileId int64 + creativefield *CreativeField + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing creative field. +func (r *CreativeFieldsService) Update(profileId int64, creativefield *CreativeField) *CreativeFieldsUpdateCall { + c := &CreativeFieldsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativefield = creativefield + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeFieldsUpdateCall) Fields(s ...googleapi.Field) *CreativeFieldsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeFieldsUpdateCall) Context(ctx context.Context) *CreativeFieldsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeFieldsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeFields.update" call. +// Exactly one of *CreativeField or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativeField.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeFieldsUpdateCall) Do() (*CreativeField, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeField{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing creative field.", + // "httpMethod": "PUT", + // "id": "dfareporting.creativeFields.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeFields", + // "request": { + // "$ref": "CreativeField" + // }, + // "response": { + // "$ref": "CreativeField" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeGroups.get": + +type CreativeGroupsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one creative group by ID. +func (r *CreativeGroupsService) Get(profileId int64, id int64) *CreativeGroupsGetCall { + c := &CreativeGroupsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeGroupsGetCall) Fields(s ...googleapi.Field) *CreativeGroupsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativeGroupsGetCall) IfNoneMatch(entityTag string) *CreativeGroupsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeGroupsGetCall) Context(ctx context.Context) *CreativeGroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeGroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeGroups.get" call. +// Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativeGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeGroupsGetCall) Do() (*CreativeGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one creative group by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.creativeGroups.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Creative group ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeGroups/{id}", + // "response": { + // "$ref": "CreativeGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeGroups.insert": + +type CreativeGroupsInsertCall struct { + s *Service + profileId int64 + creativegroup *CreativeGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new creative group. +func (r *CreativeGroupsService) Insert(profileId int64, creativegroup *CreativeGroup) *CreativeGroupsInsertCall { + c := &CreativeGroupsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativegroup = creativegroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeGroupsInsertCall) Fields(s ...googleapi.Field) *CreativeGroupsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeGroupsInsertCall) Context(ctx context.Context) *CreativeGroupsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeGroupsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeGroups.insert" call. +// Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativeGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeGroupsInsertCall) Do() (*CreativeGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new creative group.", + // "httpMethod": "POST", + // "id": "dfareporting.creativeGroups.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeGroups", + // "request": { + // "$ref": "CreativeGroup" + // }, + // "response": { + // "$ref": "CreativeGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeGroups.list": + +type CreativeGroupsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of creative groups, possibly filtered. +func (r *CreativeGroupsService) List(profileId int64) *CreativeGroupsListCall { + c := &CreativeGroupsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdvertiserIds sets the optional parameter "advertiserIds": Select +// only creative groups that belong to these advertisers. +func (c *CreativeGroupsListCall) AdvertiserIds(advertiserIds int64) *CreativeGroupsListCall { + c.opt_["advertiserIds"] = advertiserIds + return c +} + +// GroupNumber sets the optional parameter "groupNumber": Select only +// creative groups that belong to this subgroup. +func (c *CreativeGroupsListCall) GroupNumber(groupNumber int64) *CreativeGroupsListCall { + c.opt_["groupNumber"] = groupNumber + return c +} + +// Ids sets the optional parameter "ids": Select only creative groups +// with these IDs. +func (c *CreativeGroupsListCall) Ids(ids int64) *CreativeGroupsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *CreativeGroupsListCall) MaxResults(maxResults int64) *CreativeGroupsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *CreativeGroupsListCall) PageToken(pageToken string) *CreativeGroupsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for creative groups by name or ID. Wildcards (*) are +// allowed. For example, "creativegroup*2015" will return creative +// groups with names like "creativegroup June 2015", "creativegroup +// April 2015", or simply "creativegroup 2015". Most of the searches +// also add wild-cards implicitly at the start and the end of the search +// string. For example, a search string of "creativegroup" will match +// creative groups with the name "my creativegroup", "creativegroup +// 2015", or simply "creativegroup". +func (c *CreativeGroupsListCall) SearchString(searchString string) *CreativeGroupsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *CreativeGroupsListCall) SortField(sortField string) *CreativeGroupsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *CreativeGroupsListCall) SortOrder(sortOrder string) *CreativeGroupsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeGroupsListCall) Fields(s ...googleapi.Field) *CreativeGroupsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativeGroupsListCall) IfNoneMatch(entityTag string) *CreativeGroupsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeGroupsListCall) Context(ctx context.Context) *CreativeGroupsListCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeGroupsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserIds"]; ok { + params.Set("advertiserIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["groupNumber"]; ok { + params.Set("groupNumber", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeGroups.list" call. +// Exactly one of *CreativeGroupsListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *CreativeGroupsListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeGroupsListCall) Do() (*CreativeGroupsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeGroupsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of creative groups, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.creativeGroups.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "advertiserIds": { + // "description": "Select only creative groups that belong to these advertisers.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "groupNumber": { + // "description": "Select only creative groups that belong to this subgroup.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "ids": { + // "description": "Select only creative groups with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for creative groups by name or ID. Wildcards (*) are allowed. For example, \"creativegroup*2015\" will return creative groups with names like \"creativegroup June 2015\", \"creativegroup April 2015\", or simply \"creativegroup 2015\". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of \"creativegroup\" will match creative groups with the name \"my creativegroup\", \"creativegroup 2015\", or simply \"creativegroup\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeGroups", + // "response": { + // "$ref": "CreativeGroupsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeGroups.patch": + +type CreativeGroupsPatchCall struct { + s *Service + profileId int64 + id int64 + creativegroup *CreativeGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing creative group. This method supports patch +// semantics. +func (r *CreativeGroupsService) Patch(profileId int64, id int64, creativegroup *CreativeGroup) *CreativeGroupsPatchCall { + c := &CreativeGroupsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.creativegroup = creativegroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeGroupsPatchCall) Fields(s ...googleapi.Field) *CreativeGroupsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeGroupsPatchCall) Context(ctx context.Context) *CreativeGroupsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeGroupsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeGroups.patch" call. +// Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativeGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeGroupsPatchCall) Do() (*CreativeGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing creative group. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.creativeGroups.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Creative group ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeGroups", + // "request": { + // "$ref": "CreativeGroup" + // }, + // "response": { + // "$ref": "CreativeGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creativeGroups.update": + +type CreativeGroupsUpdateCall struct { + s *Service + profileId int64 + creativegroup *CreativeGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing creative group. +func (r *CreativeGroupsService) Update(profileId int64, creativegroup *CreativeGroup) *CreativeGroupsUpdateCall { + c := &CreativeGroupsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creativegroup = creativegroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativeGroupsUpdateCall) Fields(s ...googleapi.Field) *CreativeGroupsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativeGroupsUpdateCall) Context(ctx context.Context) *CreativeGroupsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CreativeGroupsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creativeGroups.update" call. +// Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CreativeGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativeGroupsUpdateCall) Do() (*CreativeGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativeGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing creative group.", + // "httpMethod": "PUT", + // "id": "dfareporting.creativeGroups.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creativeGroups", + // "request": { + // "$ref": "CreativeGroup" + // }, + // "response": { + // "$ref": "CreativeGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creatives.get": + +type CreativesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one creative by ID. +func (r *CreativesService) Get(profileId int64, id int64) *CreativesGetCall { + c := &CreativesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativesGetCall) Fields(s ...googleapi.Field) *CreativesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativesGetCall) IfNoneMatch(entityTag string) *CreativesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativesGetCall) Context(ctx context.Context) *CreativesGetCall { + c.ctx_ = ctx + return c +} + +func (c *CreativesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creatives.get" call. +// Exactly one of *Creative or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Creative.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CreativesGetCall) Do() (*Creative, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Creative{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one creative by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.creatives.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Creative ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creatives/{id}", + // "response": { + // "$ref": "Creative" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creatives.insert": + +type CreativesInsertCall struct { + s *Service + profileId int64 + creative *Creative + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new creative. +func (r *CreativesService) Insert(profileId int64, creative *Creative) *CreativesInsertCall { + c := &CreativesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creative = creative + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativesInsertCall) Fields(s ...googleapi.Field) *CreativesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativesInsertCall) Context(ctx context.Context) *CreativesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CreativesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creatives.insert" call. +// Exactly one of *Creative or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Creative.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CreativesInsertCall) Do() (*Creative, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Creative{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new creative.", + // "httpMethod": "POST", + // "id": "dfareporting.creatives.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creatives", + // "request": { + // "$ref": "Creative" + // }, + // "response": { + // "$ref": "Creative" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creatives.list": + +type CreativesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of creatives, possibly filtered. +func (r *CreativesService) List(profileId int64) *CreativesListCall { + c := &CreativesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Active sets the optional parameter "active": Select only active +// creatives. Leave blank to select active and inactive creatives. +func (c *CreativesListCall) Active(active bool) *CreativesListCall { + c.opt_["active"] = active + return c +} + +// AdvertiserId sets the optional parameter "advertiserId": Select only +// creatives with this advertiser ID. +func (c *CreativesListCall) AdvertiserId(advertiserId int64) *CreativesListCall { + c.opt_["advertiserId"] = advertiserId + return c +} + +// Archived sets the optional parameter "archived": Select only archived +// creatives. Leave blank to select archived and unarchived creatives. +func (c *CreativesListCall) Archived(archived bool) *CreativesListCall { + c.opt_["archived"] = archived + return c +} + +// CampaignId sets the optional parameter "campaignId": Select only +// creatives with this campaign ID. +func (c *CreativesListCall) CampaignId(campaignId int64) *CreativesListCall { + c.opt_["campaignId"] = campaignId + return c +} + +// CompanionCreativeIds sets the optional parameter +// "companionCreativeIds": Select only in-stream video creatives with +// these companion IDs. +func (c *CreativesListCall) CompanionCreativeIds(companionCreativeIds int64) *CreativesListCall { + c.opt_["companionCreativeIds"] = companionCreativeIds + return c +} + +// CreativeFieldIds sets the optional parameter "creativeFieldIds": +// Select only creatives with these creative field IDs. +func (c *CreativesListCall) CreativeFieldIds(creativeFieldIds int64) *CreativesListCall { + c.opt_["creativeFieldIds"] = creativeFieldIds + return c +} + +// Ids sets the optional parameter "ids": Select only creatives with +// these IDs. +func (c *CreativesListCall) Ids(ids int64) *CreativesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *CreativesListCall) MaxResults(maxResults int64) *CreativesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *CreativesListCall) PageToken(pageToken string) *CreativesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// RenderingIds sets the optional parameter "renderingIds": Select only +// creatives with these rendering IDs. +func (c *CreativesListCall) RenderingIds(renderingIds int64) *CreativesListCall { + c.opt_["renderingIds"] = renderingIds + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "creative*2015" will return objects with names like +// "creative June 2015", "creative April 2015", or simply "creative +// 2015". Most of the searches also add wildcards implicitly at the +// start and the end of the search string. For example, a search string +// of "creative" will match objects with name "my creative", "creative +// 2015", or simply "creative". +func (c *CreativesListCall) SearchString(searchString string) *CreativesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SizeIds sets the optional parameter "sizeIds": Select only creatives +// with these size IDs. +func (c *CreativesListCall) SizeIds(sizeIds int64) *CreativesListCall { + c.opt_["sizeIds"] = sizeIds + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *CreativesListCall) SortField(sortField string) *CreativesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *CreativesListCall) SortOrder(sortOrder string) *CreativesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// StudioCreativeId sets the optional parameter "studioCreativeId": +// Select only creatives corresponding to this Studio creative ID. +func (c *CreativesListCall) StudioCreativeId(studioCreativeId int64) *CreativesListCall { + c.opt_["studioCreativeId"] = studioCreativeId + return c +} + +// Types sets the optional parameter "types": Select only creatives with +// these creative types. +// +// Possible values: +// "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO" +// "CUSTOM_INPAGE" +// "CUSTOM_INTERSTITIAL" +// "ENHANCED_BANNER" +// "ENHANCED_IMAGE" +// "FLASH_INPAGE" +// "HTML5_BANNER" +// "IMAGE" +// "INSTREAM_VIDEO" +// "INTERNAL_REDIRECT" +// "INTERSTITIAL_INTERNAL_REDIRECT" +// "REDIRECT" +// "RICH_MEDIA_EXPANDING" +// "RICH_MEDIA_IM_EXPAND" +// "RICH_MEDIA_INPAGE" +// "RICH_MEDIA_INPAGE_FLOATING" +// "RICH_MEDIA_INTERSTITIAL_FLOAT" +// "RICH_MEDIA_MOBILE_IN_APP" +// "RICH_MEDIA_MULTI_FLOATING" +// "RICH_MEDIA_PEEL_DOWN" +// "TRACKING_TEXT" +// "VAST_REDIRECT" +// "VPAID_LINEAR" +// "VPAID_NON_LINEAR" +func (c *CreativesListCall) Types(types string) *CreativesListCall { + c.opt_["types"] = types + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativesListCall) Fields(s ...googleapi.Field) *CreativesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CreativesListCall) IfNoneMatch(entityTag string) *CreativesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativesListCall) Context(ctx context.Context) *CreativesListCall { + c.ctx_ = ctx + return c +} + +func (c *CreativesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["active"]; ok { + params.Set("active", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["advertiserId"]; ok { + params.Set("advertiserId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["archived"]; ok { + params.Set("archived", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["campaignId"]; ok { + params.Set("campaignId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["companionCreativeIds"]; ok { + params.Set("companionCreativeIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["creativeFieldIds"]; ok { + params.Set("creativeFieldIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["renderingIds"]; ok { + params.Set("renderingIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sizeIds"]; ok { + params.Set("sizeIds", 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)) + } + if v, ok := c.opt_["studioCreativeId"]; ok { + params.Set("studioCreativeId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["types"]; ok { + params.Set("types", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creatives.list" call. +// Exactly one of *CreativesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CreativesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CreativesListCall) Do() (*CreativesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreativesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of creatives, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.creatives.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "active": { + // "description": "Select only active creatives. Leave blank to select active and inactive creatives.", + // "location": "query", + // "type": "boolean" + // }, + // "advertiserId": { + // "description": "Select only creatives with this advertiser ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "archived": { + // "description": "Select only archived creatives. Leave blank to select archived and unarchived creatives.", + // "location": "query", + // "type": "boolean" + // }, + // "campaignId": { + // "description": "Select only creatives with this campaign ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "companionCreativeIds": { + // "description": "Select only in-stream video creatives with these companion IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "creativeFieldIds": { + // "description": "Select only creatives with these creative field IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only creatives with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "renderingIds": { + // "description": "Select only creatives with these rendering IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"creative*2015\" will return objects with names like \"creative June 2015\", \"creative April 2015\", or simply \"creative 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"creative\" will match objects with name \"my creative\", \"creative 2015\", or simply \"creative\".", + // "location": "query", + // "type": "string" + // }, + // "sizeIds": { + // "description": "Select only creatives with these size IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "studioCreativeId": { + // "description": "Select only creatives corresponding to this Studio creative ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "types": { + // "description": "Select only creatives with these creative types.", + // "enum": [ + // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO", + // "CUSTOM_INPAGE", + // "CUSTOM_INTERSTITIAL", + // "ENHANCED_BANNER", + // "ENHANCED_IMAGE", + // "FLASH_INPAGE", + // "HTML5_BANNER", + // "IMAGE", + // "INSTREAM_VIDEO", + // "INTERNAL_REDIRECT", + // "INTERSTITIAL_INTERNAL_REDIRECT", + // "REDIRECT", + // "RICH_MEDIA_EXPANDING", + // "RICH_MEDIA_IM_EXPAND", + // "RICH_MEDIA_INPAGE", + // "RICH_MEDIA_INPAGE_FLOATING", + // "RICH_MEDIA_INTERSTITIAL_FLOAT", + // "RICH_MEDIA_MOBILE_IN_APP", + // "RICH_MEDIA_MULTI_FLOATING", + // "RICH_MEDIA_PEEL_DOWN", + // "TRACKING_TEXT", + // "VAST_REDIRECT", + // "VPAID_LINEAR", + // "VPAID_NON_LINEAR" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creatives", + // "response": { + // "$ref": "CreativesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creatives.patch": + +type CreativesPatchCall struct { + s *Service + profileId int64 + id int64 + creative *Creative + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing creative. This method supports patch +// semantics. +func (r *CreativesService) Patch(profileId int64, id int64, creative *Creative) *CreativesPatchCall { + c := &CreativesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.creative = creative + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativesPatchCall) Fields(s ...googleapi.Field) *CreativesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativesPatchCall) Context(ctx context.Context) *CreativesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CreativesPatchCall) doRequest(alt string) (*http.Response, 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", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creatives.patch" call. +// Exactly one of *Creative or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Creative.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CreativesPatchCall) Do() (*Creative, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Creative{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing creative. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.creatives.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Creative ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creatives", + // "request": { + // "$ref": "Creative" + // }, + // "response": { + // "$ref": "Creative" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.creatives.update": + +type CreativesUpdateCall struct { + s *Service + profileId int64 + creative *Creative + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing creative. +func (r *CreativesService) Update(profileId int64, creative *Creative) *CreativesUpdateCall { + c := &CreativesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.creative = creative + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CreativesUpdateCall) Fields(s ...googleapi.Field) *CreativesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CreativesUpdateCall) Context(ctx context.Context) *CreativesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CreativesUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.creatives.update" call. +// Exactly one of *Creative or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Creative.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CreativesUpdateCall) Do() (*Creative, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Creative{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing creative.", + // "httpMethod": "PUT", + // "id": "dfareporting.creatives.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/creatives", + // "request": { + // "$ref": "Creative" + // }, + // "response": { + // "$ref": "Creative" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.dimensionValues.query": + +type DimensionValuesQueryCall struct { + s *Service + profileId int64 + dimensionvaluerequest *DimensionValueRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DimensionValuesQueryCall) Fields(s ...googleapi.Field) *DimensionValuesQueryCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DimensionValuesQueryCall) Context(ctx context.Context) *DimensionValuesQueryCall { + c.ctx_ = ctx + return c +} + +func (c *DimensionValuesQueryCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dimensionvalues/query") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.dimensionValues.query" call. +// Exactly one of *DimensionValueList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DimensionValueList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DimensionValuesQueryCall) Do() (*DimensionValueList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DimensionValueList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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.directorySiteContacts.get": + +type DirectorySiteContactsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one directory site contact by ID. +func (r *DirectorySiteContactsService) Get(profileId int64, id int64) *DirectorySiteContactsGetCall { + c := &DirectorySiteContactsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DirectorySiteContactsGetCall) Fields(s ...googleapi.Field) *DirectorySiteContactsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DirectorySiteContactsGetCall) IfNoneMatch(entityTag string) *DirectorySiteContactsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DirectorySiteContactsGetCall) Context(ctx context.Context) *DirectorySiteContactsGetCall { + c.ctx_ = ctx + return c +} + +func (c *DirectorySiteContactsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySiteContacts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.directorySiteContacts.get" call. +// Exactly one of *DirectorySiteContact or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DirectorySiteContact.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DirectorySiteContactsGetCall) Do() (*DirectorySiteContact, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DirectorySiteContact{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one directory site contact by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.directorySiteContacts.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Directory site contact ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/directorySiteContacts/{id}", + // "response": { + // "$ref": "DirectorySiteContact" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.directorySiteContacts.list": + +type DirectorySiteContactsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of directory site contacts, possibly filtered. +func (r *DirectorySiteContactsService) List(profileId int64) *DirectorySiteContactsListCall { + c := &DirectorySiteContactsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// DirectorySiteIds sets the optional parameter "directorySiteIds": +// Select only directory site contacts with these directory site IDs. +// This is a required field. +func (c *DirectorySiteContactsListCall) DirectorySiteIds(directorySiteIds int64) *DirectorySiteContactsListCall { + c.opt_["directorySiteIds"] = directorySiteIds + return c +} + +// Ids sets the optional parameter "ids": Select only directory site +// contacts with these IDs. +func (c *DirectorySiteContactsListCall) Ids(ids int64) *DirectorySiteContactsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *DirectorySiteContactsListCall) MaxResults(maxResults int64) *DirectorySiteContactsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *DirectorySiteContactsListCall) PageToken(pageToken string) *DirectorySiteContactsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name, ID or email. Wildcards (*) are +// allowed. For example, "directory site contact*2015" will return +// objects with names like "directory site contact June 2015", +// "directory site contact April 2015", or simply "directory site +// contact 2015". Most of the searches also add wildcards implicitly at +// the start and the end of the search string. For example, a search +// string of "directory site contact" will match objects with name "my +// directory site contact", "directory site contact 2015", or simply +// "directory site contact". +func (c *DirectorySiteContactsListCall) SearchString(searchString string) *DirectorySiteContactsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *DirectorySiteContactsListCall) SortField(sortField string) *DirectorySiteContactsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *DirectorySiteContactsListCall) SortOrder(sortOrder string) *DirectorySiteContactsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DirectorySiteContactsListCall) Fields(s ...googleapi.Field) *DirectorySiteContactsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DirectorySiteContactsListCall) IfNoneMatch(entityTag string) *DirectorySiteContactsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DirectorySiteContactsListCall) Context(ctx context.Context) *DirectorySiteContactsListCall { + c.ctx_ = ctx + return c +} + +func (c *DirectorySiteContactsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["directorySiteIds"]; ok { + params.Set("directorySiteIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySiteContacts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.directorySiteContacts.list" call. +// Exactly one of *DirectorySiteContactsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *DirectorySiteContactsListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *DirectorySiteContactsListCall) Do() (*DirectorySiteContactsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DirectorySiteContactsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of directory site contacts, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.directorySiteContacts.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "directorySiteIds": { + // "description": "Select only directory site contacts with these directory site IDs. This is a required field.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only directory site contacts with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, \"directory site contact*2015\" will return objects with names like \"directory site contact June 2015\", \"directory site contact April 2015\", or simply \"directory site contact 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"directory site contact\" will match objects with name \"my directory site contact\", \"directory site contact 2015\", or simply \"directory site contact\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/directorySiteContacts", + // "response": { + // "$ref": "DirectorySiteContactsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.directorySites.get": + +type DirectorySitesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one directory site by ID. +func (r *DirectorySitesService) Get(profileId int64, id int64) *DirectorySitesGetCall { + c := &DirectorySitesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DirectorySitesGetCall) Fields(s ...googleapi.Field) *DirectorySitesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DirectorySitesGetCall) IfNoneMatch(entityTag string) *DirectorySitesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DirectorySitesGetCall) Context(ctx context.Context) *DirectorySitesGetCall { + c.ctx_ = ctx + return c +} + +func (c *DirectorySitesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.directorySites.get" call. +// Exactly one of *DirectorySite or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DirectorySite.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DirectorySitesGetCall) Do() (*DirectorySite, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DirectorySite{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one directory site by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.directorySites.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Directory site ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/directorySites/{id}", + // "response": { + // "$ref": "DirectorySite" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.directorySites.insert": + +type DirectorySitesInsertCall struct { + s *Service + profileId int64 + directorysite *DirectorySite + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new directory site. +func (r *DirectorySitesService) Insert(profileId int64, directorysite *DirectorySite) *DirectorySitesInsertCall { + c := &DirectorySitesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.directorysite = directorysite + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DirectorySitesInsertCall) Fields(s ...googleapi.Field) *DirectorySitesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DirectorySitesInsertCall) Context(ctx context.Context) *DirectorySitesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *DirectorySitesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.directorysite) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.directorySites.insert" call. +// Exactly one of *DirectorySite or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DirectorySite.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DirectorySitesInsertCall) Do() (*DirectorySite, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DirectorySite{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new directory site.", + // "httpMethod": "POST", + // "id": "dfareporting.directorySites.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/directorySites", + // "request": { + // "$ref": "DirectorySite" + // }, + // "response": { + // "$ref": "DirectorySite" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.directorySites.list": + +type DirectorySitesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of directory sites, possibly filtered. +func (r *DirectorySitesService) List(profileId int64) *DirectorySitesListCall { + c := &DirectorySitesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AcceptsInStreamVideoPlacements sets the optional parameter +// "acceptsInStreamVideoPlacements": This search filter is no longer +// supported and will have no effect on the results returned. +func (c *DirectorySitesListCall) AcceptsInStreamVideoPlacements(acceptsInStreamVideoPlacements bool) *DirectorySitesListCall { + c.opt_["acceptsInStreamVideoPlacements"] = acceptsInStreamVideoPlacements + return c +} + +// AcceptsInterstitialPlacements sets the optional parameter +// "acceptsInterstitialPlacements": This search filter is no longer +// supported and will have no effect on the results returned. +func (c *DirectorySitesListCall) AcceptsInterstitialPlacements(acceptsInterstitialPlacements bool) *DirectorySitesListCall { + c.opt_["acceptsInterstitialPlacements"] = acceptsInterstitialPlacements + return c +} + +// AcceptsPublisherPaidPlacements sets the optional parameter +// "acceptsPublisherPaidPlacements": Select only directory sites that +// accept publisher paid placements. This field can be left blank. +func (c *DirectorySitesListCall) AcceptsPublisherPaidPlacements(acceptsPublisherPaidPlacements bool) *DirectorySitesListCall { + c.opt_["acceptsPublisherPaidPlacements"] = acceptsPublisherPaidPlacements + return c +} + +// Active sets the optional parameter "active": Select only active +// directory sites. Leave blank to retrieve both active and inactive +// directory sites. +func (c *DirectorySitesListCall) Active(active bool) *DirectorySitesListCall { + c.opt_["active"] = active + return c +} + +// CountryId sets the optional parameter "countryId": Select only +// directory sites with this country ID. +func (c *DirectorySitesListCall) CountryId(countryId int64) *DirectorySitesListCall { + c.opt_["countryId"] = countryId + return c +} + +// DfpNetworkCode sets the optional parameter "dfp_network_code": Select +// only directory sites with this DFP network code. +func (c *DirectorySitesListCall) DfpNetworkCode(dfpNetworkCode string) *DirectorySitesListCall { + c.opt_["dfp_network_code"] = dfpNetworkCode + return c +} + +// Ids sets the optional parameter "ids": Select only directory sites +// with these IDs. +func (c *DirectorySitesListCall) Ids(ids int64) *DirectorySitesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *DirectorySitesListCall) MaxResults(maxResults int64) *DirectorySitesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *DirectorySitesListCall) PageToken(pageToken string) *DirectorySitesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// ParentId sets the optional parameter "parentId": Select only +// directory sites with this parent ID. +func (c *DirectorySitesListCall) ParentId(parentId int64) *DirectorySitesListCall { + c.opt_["parentId"] = parentId + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name, ID or URL. Wildcards (*) are allowed. +// For example, "directory site*2015" will return objects with names +// like "directory site June 2015", "directory site April 2015", or +// simply "directory site 2015". Most of the searches also add wildcards +// implicitly at the start and the end of the search string. For +// example, a search string of "directory site" will match objects with +// name "my directory site", "directory site 2015" or simply, "directory +// site". +func (c *DirectorySitesListCall) SearchString(searchString string) *DirectorySitesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *DirectorySitesListCall) SortField(sortField string) *DirectorySitesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *DirectorySitesListCall) SortOrder(sortOrder string) *DirectorySitesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DirectorySitesListCall) Fields(s ...googleapi.Field) *DirectorySitesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DirectorySitesListCall) IfNoneMatch(entityTag string) *DirectorySitesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DirectorySitesListCall) Context(ctx context.Context) *DirectorySitesListCall { + c.ctx_ = ctx + return c +} + +func (c *DirectorySitesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["acceptsInStreamVideoPlacements"]; ok { + params.Set("acceptsInStreamVideoPlacements", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["acceptsInterstitialPlacements"]; ok { + params.Set("acceptsInterstitialPlacements", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["acceptsPublisherPaidPlacements"]; ok { + params.Set("acceptsPublisherPaidPlacements", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["active"]; ok { + params.Set("active", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["countryId"]; ok { + params.Set("countryId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["dfp_network_code"]; ok { + params.Set("dfp_network_code", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["parentId"]; ok { + params.Set("parentId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.directorySites.list" call. +// Exactly one of *DirectorySitesListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *DirectorySitesListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DirectorySitesListCall) Do() (*DirectorySitesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DirectorySitesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of directory sites, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.directorySites.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "acceptsInStreamVideoPlacements": { + // "description": "This search filter is no longer supported and will have no effect on the results returned.", + // "location": "query", + // "type": "boolean" + // }, + // "acceptsInterstitialPlacements": { + // "description": "This search filter is no longer supported and will have no effect on the results returned.", + // "location": "query", + // "type": "boolean" + // }, + // "acceptsPublisherPaidPlacements": { + // "description": "Select only directory sites that accept publisher paid placements. This field can be left blank.", + // "location": "query", + // "type": "boolean" + // }, + // "active": { + // "description": "Select only active directory sites. Leave blank to retrieve both active and inactive directory sites.", + // "location": "query", + // "type": "boolean" + // }, + // "countryId": { + // "description": "Select only directory sites with this country ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "dfp_network_code": { + // "description": "Select only directory sites with this DFP network code.", + // "location": "query", + // "type": "string" + // }, + // "ids": { + // "description": "Select only directory sites with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "parentId": { + // "description": "Select only directory sites with this parent ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name, ID or URL. Wildcards (*) are allowed. For example, \"directory site*2015\" will return objects with names like \"directory site June 2015\", \"directory site April 2015\", or simply \"directory site 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"directory site\" will match objects with name \"my directory site\", \"directory site 2015\" or simply, \"directory site\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/directorySites", + // "response": { + // "$ref": "DirectorySitesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.eventTags.delete": + +type EventTagsDeleteCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing event tag. +func (r *EventTagsService) Delete(profileId int64, id int64) *EventTagsDeleteCall { + c := &EventTagsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventTagsDeleteCall) Fields(s ...googleapi.Field) *EventTagsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventTagsDeleteCall) Context(ctx context.Context) *EventTagsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *EventTagsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.eventTags.delete" call. +func (c *EventTagsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing event tag.", + // "httpMethod": "DELETE", + // "id": "dfareporting.eventTags.delete", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Event tag ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/eventTags/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.eventTags.get": + +type EventTagsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one event tag by ID. +func (r *EventTagsService) Get(profileId int64, id int64) *EventTagsGetCall { + c := &EventTagsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventTagsGetCall) Fields(s ...googleapi.Field) *EventTagsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EventTagsGetCall) IfNoneMatch(entityTag string) *EventTagsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventTagsGetCall) Context(ctx context.Context) *EventTagsGetCall { + c.ctx_ = ctx + return c +} + +func (c *EventTagsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.eventTags.get" call. +// Exactly one of *EventTag or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *EventTag.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EventTagsGetCall) Do() (*EventTag, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EventTag{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one event tag by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.eventTags.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Event tag ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/eventTags/{id}", + // "response": { + // "$ref": "EventTag" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.eventTags.insert": + +type EventTagsInsertCall struct { + s *Service + profileId int64 + eventtag *EventTag + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new event tag. +func (r *EventTagsService) Insert(profileId int64, eventtag *EventTag) *EventTagsInsertCall { + c := &EventTagsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.eventtag = eventtag + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventTagsInsertCall) Fields(s ...googleapi.Field) *EventTagsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventTagsInsertCall) Context(ctx context.Context) *EventTagsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *EventTagsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.eventTags.insert" call. +// Exactly one of *EventTag or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *EventTag.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EventTagsInsertCall) Do() (*EventTag, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EventTag{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new event tag.", + // "httpMethod": "POST", + // "id": "dfareporting.eventTags.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/eventTags", + // "request": { + // "$ref": "EventTag" + // }, + // "response": { + // "$ref": "EventTag" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.eventTags.list": + +type EventTagsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of event tags, possibly filtered. +func (r *EventTagsService) List(profileId int64) *EventTagsListCall { + c := &EventTagsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdId sets the optional parameter "adId": Select only event tags that +// belong to this ad. +func (c *EventTagsListCall) AdId(adId int64) *EventTagsListCall { + c.opt_["adId"] = adId + return c +} + +// AdvertiserId sets the optional parameter "advertiserId": Select only +// event tags that belong to this advertiser. +func (c *EventTagsListCall) AdvertiserId(advertiserId int64) *EventTagsListCall { + c.opt_["advertiserId"] = advertiserId + return c +} + +// CampaignId sets the optional parameter "campaignId": Select only +// event tags that belong to this campaign. +func (c *EventTagsListCall) CampaignId(campaignId int64) *EventTagsListCall { + c.opt_["campaignId"] = campaignId + return c +} + +// DefinitionsOnly sets the optional parameter "definitionsOnly": +// Examine only the specified campaign or advertiser's event tags for +// matching selector criteria. When set to false, the parent advertiser +// and parent campaign of the specified ad or campaign is examined as +// well. In addition, when set to false, the status field is examined as +// well, along with the enabledByDefault field. This parameter can not +// be set to true when adId is specified as ads do not define their own +// even tags. +func (c *EventTagsListCall) DefinitionsOnly(definitionsOnly bool) *EventTagsListCall { + c.opt_["definitionsOnly"] = definitionsOnly + return c +} + +// Enabled sets the optional parameter "enabled": Select only enabled +// event tags. What is considered enabled or disabled depends on the +// definitionsOnly parameter. When definitionsOnly is set to true, only +// the specified advertiser or campaign's event tags' enabledByDefault +// field is examined. When definitionsOnly is set to false, the +// specified ad or specified campaign's parent advertiser's or parent +// campaign's event tags' enabledByDefault and status fields are +// examined as well. +func (c *EventTagsListCall) Enabled(enabled bool) *EventTagsListCall { + c.opt_["enabled"] = enabled + return c +} + +// EventTagTypes sets the optional parameter "eventTagTypes": Select +// only event tags with the specified event tag types. Event tag types +// can be used to specify whether to use a third-party pixel, a +// third-party JavaScript URL, or a third-party click-through URL for +// either impression or click tracking. +// +// Possible values: +// "CLICK_THROUGH_EVENT_TAG" +// "IMPRESSION_IMAGE_EVENT_TAG" +// "IMPRESSION_JAVASCRIPT_EVENT_TAG" +func (c *EventTagsListCall) EventTagTypes(eventTagTypes string) *EventTagsListCall { + c.opt_["eventTagTypes"] = eventTagTypes + return c +} + +// Ids sets the optional parameter "ids": Select only event tags with +// these IDs. +func (c *EventTagsListCall) Ids(ids int64) *EventTagsListCall { + c.opt_["ids"] = ids + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "eventtag*2015" will return objects with names like +// "eventtag June 2015", "eventtag April 2015", or simply "eventtag +// 2015". Most of the searches also add wildcards implicitly at the +// start and the end of the search string. For example, a search string +// of "eventtag" will match objects with name "my eventtag", "eventtag +// 2015", or simply "eventtag". +func (c *EventTagsListCall) SearchString(searchString string) *EventTagsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *EventTagsListCall) SortField(sortField string) *EventTagsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *EventTagsListCall) SortOrder(sortOrder string) *EventTagsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventTagsListCall) Fields(s ...googleapi.Field) *EventTagsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EventTagsListCall) IfNoneMatch(entityTag string) *EventTagsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventTagsListCall) Context(ctx context.Context) *EventTagsListCall { + c.ctx_ = ctx + return c +} + +func (c *EventTagsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["adId"]; ok { + params.Set("adId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["advertiserId"]; ok { + params.Set("advertiserId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["campaignId"]; ok { + params.Set("campaignId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["definitionsOnly"]; ok { + params.Set("definitionsOnly", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["enabled"]; ok { + params.Set("enabled", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["eventTagTypes"]; ok { + params.Set("eventTagTypes", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.eventTags.list" call. +// Exactly one of *EventTagsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *EventTagsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EventTagsListCall) Do() (*EventTagsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EventTagsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of event tags, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.eventTags.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "adId": { + // "description": "Select only event tags that belong to this ad.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "advertiserId": { + // "description": "Select only event tags that belong to this advertiser.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "campaignId": { + // "description": "Select only event tags that belong to this campaign.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "definitionsOnly": { + // "description": "Examine only the specified campaign or advertiser's event tags for matching selector criteria. When set to false, the parent advertiser and parent campaign of the specified ad or campaign is examined as well. In addition, when set to false, the status field is examined as well, along with the enabledByDefault field. This parameter can not be set to true when adId is specified as ads do not define their own even tags.", + // "location": "query", + // "type": "boolean" + // }, + // "enabled": { + // "description": "Select only enabled event tags. What is considered enabled or disabled depends on the definitionsOnly parameter. When definitionsOnly is set to true, only the specified advertiser or campaign's event tags' enabledByDefault field is examined. When definitionsOnly is set to false, the specified ad or specified campaign's parent advertiser's or parent campaign's event tags' enabledByDefault and status fields are examined as well.", + // "location": "query", + // "type": "boolean" + // }, + // "eventTagTypes": { + // "description": "Select only event tags with the specified event tag types. Event tag types can be used to specify whether to use a third-party pixel, a third-party JavaScript URL, or a third-party click-through URL for either impression or click tracking.", + // "enum": [ + // "CLICK_THROUGH_EVENT_TAG", + // "IMPRESSION_IMAGE_EVENT_TAG", + // "IMPRESSION_JAVASCRIPT_EVENT_TAG" + // ], + // "enumDescriptions": [ + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only event tags with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"eventtag*2015\" will return objects with names like \"eventtag June 2015\", \"eventtag April 2015\", or simply \"eventtag 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"eventtag\" will match objects with name \"my eventtag\", \"eventtag 2015\", or simply \"eventtag\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/eventTags", + // "response": { + // "$ref": "EventTagsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.eventTags.patch": + +type EventTagsPatchCall struct { + s *Service + profileId int64 + id int64 + eventtag *EventTag + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing event tag. This method supports patch +// semantics. +func (r *EventTagsService) Patch(profileId int64, id int64, eventtag *EventTag) *EventTagsPatchCall { + c := &EventTagsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.eventtag = eventtag + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventTagsPatchCall) Fields(s ...googleapi.Field) *EventTagsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventTagsPatchCall) Context(ctx context.Context) *EventTagsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *EventTagsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.eventTags.patch" call. +// Exactly one of *EventTag or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *EventTag.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EventTagsPatchCall) Do() (*EventTag, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EventTag{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing event tag. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.eventTags.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Event tag ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/eventTags", + // "request": { + // "$ref": "EventTag" + // }, + // "response": { + // "$ref": "EventTag" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.eventTags.update": + +type EventTagsUpdateCall struct { + s *Service + profileId int64 + eventtag *EventTag + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing event tag. +func (r *EventTagsService) Update(profileId int64, eventtag *EventTag) *EventTagsUpdateCall { + c := &EventTagsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.eventtag = eventtag + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventTagsUpdateCall) Fields(s ...googleapi.Field) *EventTagsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventTagsUpdateCall) Context(ctx context.Context) *EventTagsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *EventTagsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.eventTags.update" call. +// Exactly one of *EventTag or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *EventTag.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *EventTagsUpdateCall) Do() (*EventTag, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EventTag{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing event tag.", + // "httpMethod": "PUT", + // "id": "dfareporting.eventTags.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/eventTags", + // "request": { + // "$ref": "EventTag" + // }, + // "response": { + // "$ref": "EventTag" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.files.get": + +type FilesGetCall struct { + s *Service + reportId int64 + fileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FilesGetCall) IfNoneMatch(entityTag string) *FilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FilesGetCall) Context(ctx context.Context) *FilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *FilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{reportId}/files/{fileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "reportId": strconv.FormatInt(c.reportId, 10), + "fileId": strconv.FormatInt(c.fileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *FilesGetCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "dfareporting.files.get" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FilesGetCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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'. +// +// Possible values: +// "ALL" - All files in account. +// "MINE" (default) - My files. +// "SHARED_WITH_ME" - Files shared with me. +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. +// +// Possible values: +// "ID" - Sort by file ID. +// "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field. +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'. +// +// Possible values: +// "ASCENDING" - Ascending order. +// "DESCENDING" (default) - Descending order. +func (c *FilesListCall) SortOrder(sortOrder string) *FilesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FilesListCall) Context(ctx context.Context) *FilesListCall { + c.ctx_ = ctx + return c +} + +func (c *FilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/files") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.files.list" call. +// Exactly one of *FileList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *FileList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FilesListCall) Do() (*FileList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FileList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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.floodlightActivities.delete": + +type FloodlightActivitiesDeleteCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing floodlight activity. +func (r *FloodlightActivitiesService) Delete(profileId int64, id int64) *FloodlightActivitiesDeleteCall { + c := &FloodlightActivitiesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivitiesDeleteCall) Fields(s ...googleapi.Field) *FloodlightActivitiesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivitiesDeleteCall) Context(ctx context.Context) *FloodlightActivitiesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivitiesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivities.delete" call. +func (c *FloodlightActivitiesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing floodlight activity.", + // "httpMethod": "DELETE", + // "id": "dfareporting.floodlightActivities.delete", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Floodlight activity ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivities/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivities.generatetag": + +type FloodlightActivitiesGeneratetagCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Generatetag: Generates a tag for a floodlight activity. +func (r *FloodlightActivitiesService) Generatetag(profileId int64) *FloodlightActivitiesGeneratetagCall { + c := &FloodlightActivitiesGeneratetagCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// FloodlightActivityId sets the optional parameter +// "floodlightActivityId": Floodlight activity ID for which we want to +// generate a tag. +func (c *FloodlightActivitiesGeneratetagCall) FloodlightActivityId(floodlightActivityId int64) *FloodlightActivitiesGeneratetagCall { + c.opt_["floodlightActivityId"] = floodlightActivityId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivitiesGeneratetagCall) Fields(s ...googleapi.Field) *FloodlightActivitiesGeneratetagCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivitiesGeneratetagCall) Context(ctx context.Context) *FloodlightActivitiesGeneratetagCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivitiesGeneratetagCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["floodlightActivityId"]; ok { + params.Set("floodlightActivityId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/generatetag") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivities.generatetag" call. +// Exactly one of *FloodlightActivitiesGenerateTagResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *FloodlightActivitiesGenerateTagResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivitiesGeneratetagCall) Do() (*FloodlightActivitiesGenerateTagResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivitiesGenerateTagResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generates a tag for a floodlight activity.", + // "httpMethod": "POST", + // "id": "dfareporting.floodlightActivities.generatetag", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "floodlightActivityId": { + // "description": "Floodlight activity ID for which we want to generate a tag.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivities/generatetag", + // "response": { + // "$ref": "FloodlightActivitiesGenerateTagResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivities.get": + +type FloodlightActivitiesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one floodlight activity by ID. +func (r *FloodlightActivitiesService) Get(profileId int64, id int64) *FloodlightActivitiesGetCall { + c := &FloodlightActivitiesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivitiesGetCall) Fields(s ...googleapi.Field) *FloodlightActivitiesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FloodlightActivitiesGetCall) IfNoneMatch(entityTag string) *FloodlightActivitiesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivitiesGetCall) Context(ctx context.Context) *FloodlightActivitiesGetCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivitiesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivities.get" call. +// Exactly one of *FloodlightActivity or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightActivity.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivitiesGetCall) Do() (*FloodlightActivity, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivity{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one floodlight activity by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.floodlightActivities.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Floodlight activity ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivities/{id}", + // "response": { + // "$ref": "FloodlightActivity" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivities.insert": + +type FloodlightActivitiesInsertCall struct { + s *Service + profileId int64 + floodlightactivity *FloodlightActivity + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new floodlight activity. +func (r *FloodlightActivitiesService) Insert(profileId int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesInsertCall { + c := &FloodlightActivitiesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.floodlightactivity = floodlightactivity + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivitiesInsertCall) Fields(s ...googleapi.Field) *FloodlightActivitiesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivitiesInsertCall) Context(ctx context.Context) *FloodlightActivitiesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivitiesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivities.insert" call. +// Exactly one of *FloodlightActivity or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightActivity.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivitiesInsertCall) Do() (*FloodlightActivity, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivity{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new floodlight activity.", + // "httpMethod": "POST", + // "id": "dfareporting.floodlightActivities.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivities", + // "request": { + // "$ref": "FloodlightActivity" + // }, + // "response": { + // "$ref": "FloodlightActivity" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivities.list": + +type FloodlightActivitiesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of floodlight activities, possibly filtered. +func (r *FloodlightActivitiesService) List(profileId int64) *FloodlightActivitiesListCall { + c := &FloodlightActivitiesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdvertiserId sets the optional parameter "advertiserId": Select only +// floodlight activities for the specified advertiser ID. Must specify +// either ids, advertiserId, or floodlightConfigurationId for a +// non-empty result. +func (c *FloodlightActivitiesListCall) AdvertiserId(advertiserId int64) *FloodlightActivitiesListCall { + c.opt_["advertiserId"] = advertiserId + return c +} + +// FloodlightActivityGroupIds sets the optional parameter +// "floodlightActivityGroupIds": Select only floodlight activities with +// the specified floodlight activity group IDs. +func (c *FloodlightActivitiesListCall) FloodlightActivityGroupIds(floodlightActivityGroupIds int64) *FloodlightActivitiesListCall { + c.opt_["floodlightActivityGroupIds"] = floodlightActivityGroupIds + return c +} + +// FloodlightActivityGroupName sets the optional parameter +// "floodlightActivityGroupName": Select only floodlight activities with +// the specified floodlight activity group name. +func (c *FloodlightActivitiesListCall) FloodlightActivityGroupName(floodlightActivityGroupName string) *FloodlightActivitiesListCall { + c.opt_["floodlightActivityGroupName"] = floodlightActivityGroupName + return c +} + +// FloodlightActivityGroupTagString sets the optional parameter +// "floodlightActivityGroupTagString": Select only floodlight activities +// with the specified floodlight activity group tag string. +func (c *FloodlightActivitiesListCall) FloodlightActivityGroupTagString(floodlightActivityGroupTagString string) *FloodlightActivitiesListCall { + c.opt_["floodlightActivityGroupTagString"] = floodlightActivityGroupTagString + return c +} + +// FloodlightActivityGroupType sets the optional parameter +// "floodlightActivityGroupType": Select only floodlight activities with +// the specified floodlight activity group type. +// +// Possible values: +// "COUNTER" +// "SALE" +func (c *FloodlightActivitiesListCall) FloodlightActivityGroupType(floodlightActivityGroupType string) *FloodlightActivitiesListCall { + c.opt_["floodlightActivityGroupType"] = floodlightActivityGroupType + return c +} + +// FloodlightConfigurationId sets the optional parameter +// "floodlightConfigurationId": Select only floodlight activities for +// the specified floodlight configuration ID. Must specify either ids, +// advertiserId, or floodlightConfigurationId for a non-empty result. +func (c *FloodlightActivitiesListCall) FloodlightConfigurationId(floodlightConfigurationId int64) *FloodlightActivitiesListCall { + c.opt_["floodlightConfigurationId"] = floodlightConfigurationId + return c +} + +// Ids sets the optional parameter "ids": Select only floodlight +// activities with the specified IDs. Must specify either ids, +// advertiserId, or floodlightConfigurationId for a non-empty result. +func (c *FloodlightActivitiesListCall) Ids(ids int64) *FloodlightActivitiesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *FloodlightActivitiesListCall) MaxResults(maxResults int64) *FloodlightActivitiesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *FloodlightActivitiesListCall) PageToken(pageToken string) *FloodlightActivitiesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "floodlightactivity*2015" will return objects with names +// like "floodlightactivity June 2015", "floodlightactivity April 2015", +// or simply "floodlightactivity 2015". Most of the searches also add +// wildcards implicitly at the start and the end of the search string. +// For example, a search string of "floodlightactivity" will match +// objects with name "my floodlightactivity activity", +// "floodlightactivity 2015", or simply "floodlightactivity". +func (c *FloodlightActivitiesListCall) SearchString(searchString string) *FloodlightActivitiesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *FloodlightActivitiesListCall) SortField(sortField string) *FloodlightActivitiesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *FloodlightActivitiesListCall) SortOrder(sortOrder string) *FloodlightActivitiesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// TagString sets the optional parameter "tagString": Select only +// floodlight activities with the specified tag string. +func (c *FloodlightActivitiesListCall) TagString(tagString string) *FloodlightActivitiesListCall { + c.opt_["tagString"] = tagString + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivitiesListCall) Fields(s ...googleapi.Field) *FloodlightActivitiesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FloodlightActivitiesListCall) IfNoneMatch(entityTag string) *FloodlightActivitiesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivitiesListCall) Context(ctx context.Context) *FloodlightActivitiesListCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivitiesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserId"]; ok { + params.Set("advertiserId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["floodlightActivityGroupIds"]; ok { + params.Set("floodlightActivityGroupIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["floodlightActivityGroupName"]; ok { + params.Set("floodlightActivityGroupName", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["floodlightActivityGroupTagString"]; ok { + params.Set("floodlightActivityGroupTagString", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["floodlightActivityGroupType"]; ok { + params.Set("floodlightActivityGroupType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["floodlightConfigurationId"]; ok { + params.Set("floodlightConfigurationId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["tagString"]; ok { + params.Set("tagString", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivities.list" call. +// Exactly one of *FloodlightActivitiesListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *FloodlightActivitiesListResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivitiesListCall) Do() (*FloodlightActivitiesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivitiesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of floodlight activities, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.floodlightActivities.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "advertiserId": { + // "description": "Select only floodlight activities for the specified advertiser ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "floodlightActivityGroupIds": { + // "description": "Select only floodlight activities with the specified floodlight activity group IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "floodlightActivityGroupName": { + // "description": "Select only floodlight activities with the specified floodlight activity group name.", + // "location": "query", + // "type": "string" + // }, + // "floodlightActivityGroupTagString": { + // "description": "Select only floodlight activities with the specified floodlight activity group tag string.", + // "location": "query", + // "type": "string" + // }, + // "floodlightActivityGroupType": { + // "description": "Select only floodlight activities with the specified floodlight activity group type.", + // "enum": [ + // "COUNTER", + // "SALE" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "floodlightConfigurationId": { + // "description": "Select only floodlight activities for the specified floodlight configuration ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ids": { + // "description": "Select only floodlight activities with the specified IDs. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"floodlightactivity*2015\" will return objects with names like \"floodlightactivity June 2015\", \"floodlightactivity April 2015\", or simply \"floodlightactivity 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"floodlightactivity\" will match objects with name \"my floodlightactivity activity\", \"floodlightactivity 2015\", or simply \"floodlightactivity\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "tagString": { + // "description": "Select only floodlight activities with the specified tag string.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivities", + // "response": { + // "$ref": "FloodlightActivitiesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivities.patch": + +type FloodlightActivitiesPatchCall struct { + s *Service + profileId int64 + id int64 + floodlightactivity *FloodlightActivity + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing floodlight activity. This method supports +// patch semantics. +func (r *FloodlightActivitiesService) Patch(profileId int64, id int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesPatchCall { + c := &FloodlightActivitiesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.floodlightactivity = floodlightactivity + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivitiesPatchCall) Fields(s ...googleapi.Field) *FloodlightActivitiesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivitiesPatchCall) Context(ctx context.Context) *FloodlightActivitiesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivitiesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivities.patch" call. +// Exactly one of *FloodlightActivity or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightActivity.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivitiesPatchCall) Do() (*FloodlightActivity, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivity{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing floodlight activity. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.floodlightActivities.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Floodlight activity ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivities", + // "request": { + // "$ref": "FloodlightActivity" + // }, + // "response": { + // "$ref": "FloodlightActivity" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivities.update": + +type FloodlightActivitiesUpdateCall struct { + s *Service + profileId int64 + floodlightactivity *FloodlightActivity + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing floodlight activity. +func (r *FloodlightActivitiesService) Update(profileId int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesUpdateCall { + c := &FloodlightActivitiesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.floodlightactivity = floodlightactivity + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivitiesUpdateCall) Fields(s ...googleapi.Field) *FloodlightActivitiesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivitiesUpdateCall) Context(ctx context.Context) *FloodlightActivitiesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivitiesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivities.update" call. +// Exactly one of *FloodlightActivity or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightActivity.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivitiesUpdateCall) Do() (*FloodlightActivity, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivity{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing floodlight activity.", + // "httpMethod": "PUT", + // "id": "dfareporting.floodlightActivities.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivities", + // "request": { + // "$ref": "FloodlightActivity" + // }, + // "response": { + // "$ref": "FloodlightActivity" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivityGroups.delete": + +type FloodlightActivityGroupsDeleteCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing floodlight activity group. +func (r *FloodlightActivityGroupsService) Delete(profileId int64, id int64) *FloodlightActivityGroupsDeleteCall { + c := &FloodlightActivityGroupsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivityGroupsDeleteCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivityGroupsDeleteCall) Context(ctx context.Context) *FloodlightActivityGroupsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivityGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivityGroups.delete" call. +func (c *FloodlightActivityGroupsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing floodlight activity group.", + // "httpMethod": "DELETE", + // "id": "dfareporting.floodlightActivityGroups.delete", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Floodlight activity Group ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivityGroups/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivityGroups.get": + +type FloodlightActivityGroupsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one floodlight activity group by ID. +func (r *FloodlightActivityGroupsService) Get(profileId int64, id int64) *FloodlightActivityGroupsGetCall { + c := &FloodlightActivityGroupsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivityGroupsGetCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FloodlightActivityGroupsGetCall) IfNoneMatch(entityTag string) *FloodlightActivityGroupsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivityGroupsGetCall) Context(ctx context.Context) *FloodlightActivityGroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivityGroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivityGroups.get" call. +// Exactly one of *FloodlightActivityGroup or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightActivityGroup.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivityGroupsGetCall) Do() (*FloodlightActivityGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivityGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one floodlight activity group by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.floodlightActivityGroups.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Floodlight activity Group ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivityGroups/{id}", + // "response": { + // "$ref": "FloodlightActivityGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivityGroups.insert": + +type FloodlightActivityGroupsInsertCall struct { + s *Service + profileId int64 + floodlightactivitygroup *FloodlightActivityGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new floodlight activity group. +func (r *FloodlightActivityGroupsService) Insert(profileId int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsInsertCall { + c := &FloodlightActivityGroupsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.floodlightactivitygroup = floodlightactivitygroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivityGroupsInsertCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivityGroupsInsertCall) Context(ctx context.Context) *FloodlightActivityGroupsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivityGroupsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivityGroups.insert" call. +// Exactly one of *FloodlightActivityGroup or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightActivityGroup.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivityGroupsInsertCall) Do() (*FloodlightActivityGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivityGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new floodlight activity group.", + // "httpMethod": "POST", + // "id": "dfareporting.floodlightActivityGroups.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivityGroups", + // "request": { + // "$ref": "FloodlightActivityGroup" + // }, + // "response": { + // "$ref": "FloodlightActivityGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivityGroups.list": + +type FloodlightActivityGroupsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of floodlight activity groups, possibly +// filtered. +func (r *FloodlightActivityGroupsService) List(profileId int64) *FloodlightActivityGroupsListCall { + c := &FloodlightActivityGroupsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdvertiserId sets the optional parameter "advertiserId": Select only +// floodlight activity groups with the specified advertiser ID. Must +// specify either advertiserId or floodlightConfigurationId for a +// non-empty result. +func (c *FloodlightActivityGroupsListCall) AdvertiserId(advertiserId int64) *FloodlightActivityGroupsListCall { + c.opt_["advertiserId"] = advertiserId + return c +} + +// FloodlightConfigurationId sets the optional parameter +// "floodlightConfigurationId": Select only floodlight activity groups +// with the specified floodlight configuration ID. Must specify either +// advertiserId, or floodlightConfigurationId for a non-empty result. +func (c *FloodlightActivityGroupsListCall) FloodlightConfigurationId(floodlightConfigurationId int64) *FloodlightActivityGroupsListCall { + c.opt_["floodlightConfigurationId"] = floodlightConfigurationId + return c +} + +// Ids sets the optional parameter "ids": Select only floodlight +// activity groups with the specified IDs. Must specify either +// advertiserId or floodlightConfigurationId for a non-empty result. +func (c *FloodlightActivityGroupsListCall) Ids(ids int64) *FloodlightActivityGroupsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *FloodlightActivityGroupsListCall) MaxResults(maxResults int64) *FloodlightActivityGroupsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *FloodlightActivityGroupsListCall) PageToken(pageToken string) *FloodlightActivityGroupsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "floodlightactivitygroup*2015" will return objects with +// names like "floodlightactivitygroup June 2015", +// "floodlightactivitygroup April 2015", or simply +// "floodlightactivitygroup 2015". Most of the searches also add +// wildcards implicitly at the start and the end of the search string. +// For example, a search string of "floodlightactivitygroup" will match +// objects with name "my floodlightactivitygroup activity", +// "floodlightactivitygroup 2015", or simply "floodlightactivitygroup". +func (c *FloodlightActivityGroupsListCall) SearchString(searchString string) *FloodlightActivityGroupsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *FloodlightActivityGroupsListCall) SortField(sortField string) *FloodlightActivityGroupsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *FloodlightActivityGroupsListCall) SortOrder(sortOrder string) *FloodlightActivityGroupsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Type sets the optional parameter "type": Select only floodlight +// activity groups with the specified floodlight activity group type. +// +// Possible values: +// "COUNTER" +// "SALE" +func (c *FloodlightActivityGroupsListCall) Type(type_ string) *FloodlightActivityGroupsListCall { + c.opt_["type"] = type_ + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivityGroupsListCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FloodlightActivityGroupsListCall) IfNoneMatch(entityTag string) *FloodlightActivityGroupsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivityGroupsListCall) Context(ctx context.Context) *FloodlightActivityGroupsListCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivityGroupsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserId"]; ok { + params.Set("advertiserId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["floodlightConfigurationId"]; ok { + params.Set("floodlightConfigurationId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["type"]; ok { + params.Set("type", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivityGroups.list" call. +// Exactly one of *FloodlightActivityGroupsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *FloodlightActivityGroupsListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FloodlightActivityGroupsListCall) Do() (*FloodlightActivityGroupsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivityGroupsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of floodlight activity groups, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.floodlightActivityGroups.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "advertiserId": { + // "description": "Select only floodlight activity groups with the specified advertiser ID. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "floodlightConfigurationId": { + // "description": "Select only floodlight activity groups with the specified floodlight configuration ID. Must specify either advertiserId, or floodlightConfigurationId for a non-empty result.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ids": { + // "description": "Select only floodlight activity groups with the specified IDs. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"floodlightactivitygroup*2015\" will return objects with names like \"floodlightactivitygroup June 2015\", \"floodlightactivitygroup April 2015\", or simply \"floodlightactivitygroup 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"floodlightactivitygroup\" will match objects with name \"my floodlightactivitygroup activity\", \"floodlightactivitygroup 2015\", or simply \"floodlightactivitygroup\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "type": { + // "description": "Select only floodlight activity groups with the specified floodlight activity group type.", + // "enum": [ + // "COUNTER", + // "SALE" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivityGroups", + // "response": { + // "$ref": "FloodlightActivityGroupsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivityGroups.patch": + +type FloodlightActivityGroupsPatchCall struct { + s *Service + profileId int64 + id int64 + floodlightactivitygroup *FloodlightActivityGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing floodlight activity group. This method +// supports patch semantics. +func (r *FloodlightActivityGroupsService) Patch(profileId int64, id int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsPatchCall { + c := &FloodlightActivityGroupsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.floodlightactivitygroup = floodlightactivitygroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivityGroupsPatchCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivityGroupsPatchCall) Context(ctx context.Context) *FloodlightActivityGroupsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivityGroupsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivityGroups.patch" call. +// Exactly one of *FloodlightActivityGroup or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightActivityGroup.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivityGroupsPatchCall) Do() (*FloodlightActivityGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivityGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing floodlight activity group. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.floodlightActivityGroups.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Floodlight activity Group ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivityGroups", + // "request": { + // "$ref": "FloodlightActivityGroup" + // }, + // "response": { + // "$ref": "FloodlightActivityGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightActivityGroups.update": + +type FloodlightActivityGroupsUpdateCall struct { + s *Service + profileId int64 + floodlightactivitygroup *FloodlightActivityGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing floodlight activity group. +func (r *FloodlightActivityGroupsService) Update(profileId int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsUpdateCall { + c := &FloodlightActivityGroupsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.floodlightactivitygroup = floodlightactivitygroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightActivityGroupsUpdateCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightActivityGroupsUpdateCall) Context(ctx context.Context) *FloodlightActivityGroupsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightActivityGroupsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightActivityGroups.update" call. +// Exactly one of *FloodlightActivityGroup or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightActivityGroup.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightActivityGroupsUpdateCall) Do() (*FloodlightActivityGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightActivityGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing floodlight activity group.", + // "httpMethod": "PUT", + // "id": "dfareporting.floodlightActivityGroups.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightActivityGroups", + // "request": { + // "$ref": "FloodlightActivityGroup" + // }, + // "response": { + // "$ref": "FloodlightActivityGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightConfigurations.get": + +type FloodlightConfigurationsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one floodlight configuration by ID. +func (r *FloodlightConfigurationsService) Get(profileId int64, id int64) *FloodlightConfigurationsGetCall { + c := &FloodlightConfigurationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightConfigurationsGetCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FloodlightConfigurationsGetCall) IfNoneMatch(entityTag string) *FloodlightConfigurationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightConfigurationsGetCall) Context(ctx context.Context) *FloodlightConfigurationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightConfigurationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightConfigurations.get" call. +// Exactly one of *FloodlightConfiguration or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightConfiguration.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightConfigurationsGetCall) Do() (*FloodlightConfiguration, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightConfiguration{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one floodlight configuration by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.floodlightConfigurations.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Floodlight configuration ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightConfigurations/{id}", + // "response": { + // "$ref": "FloodlightConfiguration" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightConfigurations.list": + +type FloodlightConfigurationsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of floodlight configurations, possibly +// filtered. +func (r *FloodlightConfigurationsService) List(profileId int64) *FloodlightConfigurationsListCall { + c := &FloodlightConfigurationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Ids sets the optional parameter "ids": Set of IDs of floodlight +// configurations to retrieve. Required field; otherwise an empty list +// will be returned. +func (c *FloodlightConfigurationsListCall) Ids(ids int64) *FloodlightConfigurationsListCall { + c.opt_["ids"] = ids + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightConfigurationsListCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FloodlightConfigurationsListCall) IfNoneMatch(entityTag string) *FloodlightConfigurationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightConfigurationsListCall) Context(ctx context.Context) *FloodlightConfigurationsListCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightConfigurationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightConfigurations.list" call. +// Exactly one of *FloodlightConfigurationsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *FloodlightConfigurationsListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FloodlightConfigurationsListCall) Do() (*FloodlightConfigurationsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightConfigurationsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of floodlight configurations, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.floodlightConfigurations.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "ids": { + // "description": "Set of IDs of floodlight configurations to retrieve. Required field; otherwise an empty list will be returned.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightConfigurations", + // "response": { + // "$ref": "FloodlightConfigurationsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightConfigurations.patch": + +type FloodlightConfigurationsPatchCall struct { + s *Service + profileId int64 + id int64 + floodlightconfiguration *FloodlightConfiguration + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing floodlight configuration. This method +// supports patch semantics. +func (r *FloodlightConfigurationsService) Patch(profileId int64, id int64, floodlightconfiguration *FloodlightConfiguration) *FloodlightConfigurationsPatchCall { + c := &FloodlightConfigurationsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.floodlightconfiguration = floodlightconfiguration + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightConfigurationsPatchCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightConfigurationsPatchCall) Context(ctx context.Context) *FloodlightConfigurationsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightConfigurationsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightconfiguration) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightConfigurations.patch" call. +// Exactly one of *FloodlightConfiguration or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightConfiguration.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightConfigurationsPatchCall) Do() (*FloodlightConfiguration, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightConfiguration{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing floodlight configuration. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.floodlightConfigurations.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Floodlight configuration ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightConfigurations", + // "request": { + // "$ref": "FloodlightConfiguration" + // }, + // "response": { + // "$ref": "FloodlightConfiguration" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.floodlightConfigurations.update": + +type FloodlightConfigurationsUpdateCall struct { + s *Service + profileId int64 + floodlightconfiguration *FloodlightConfiguration + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing floodlight configuration. +func (r *FloodlightConfigurationsService) Update(profileId int64, floodlightconfiguration *FloodlightConfiguration) *FloodlightConfigurationsUpdateCall { + c := &FloodlightConfigurationsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.floodlightconfiguration = floodlightconfiguration + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FloodlightConfigurationsUpdateCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FloodlightConfigurationsUpdateCall) Context(ctx context.Context) *FloodlightConfigurationsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *FloodlightConfigurationsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightconfiguration) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.floodlightConfigurations.update" call. +// Exactly one of *FloodlightConfiguration or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FloodlightConfiguration.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FloodlightConfigurationsUpdateCall) Do() (*FloodlightConfiguration, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FloodlightConfiguration{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing floodlight configuration.", + // "httpMethod": "PUT", + // "id": "dfareporting.floodlightConfigurations.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/floodlightConfigurations", + // "request": { + // "$ref": "FloodlightConfiguration" + // }, + // "response": { + // "$ref": "FloodlightConfiguration" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.inventoryItems.get": + +type InventoryItemsGetCall struct { + s *Service + profileId int64 + projectId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one inventory item by ID. +func (r *InventoryItemsService) Get(profileId int64, projectId int64, id int64) *InventoryItemsGetCall { + c := &InventoryItemsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.projectId = projectId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InventoryItemsGetCall) Fields(s ...googleapi.Field) *InventoryItemsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InventoryItemsGetCall) IfNoneMatch(entityTag string) *InventoryItemsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InventoryItemsGetCall) Context(ctx context.Context) *InventoryItemsGetCall { + c.ctx_ = ctx + return c +} + +func (c *InventoryItemsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "projectId": strconv.FormatInt(c.projectId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.inventoryItems.get" call. +// Exactly one of *InventoryItem or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *InventoryItem.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InventoryItemsGetCall) Do() (*InventoryItem, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InventoryItem{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one inventory item by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.inventoryItems.get", + // "parameterOrder": [ + // "profileId", + // "projectId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Inventory item ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID for order documents.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}", + // "response": { + // "$ref": "InventoryItem" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.inventoryItems.list": + +type InventoryItemsListCall struct { + s *Service + profileId int64 + projectId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of inventory items, possibly filtered. +func (r *InventoryItemsService) List(profileId int64, projectId int64) *InventoryItemsListCall { + c := &InventoryItemsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.projectId = projectId + return c +} + +// Ids sets the optional parameter "ids": Select only inventory items +// with these IDs. +func (c *InventoryItemsListCall) Ids(ids int64) *InventoryItemsListCall { + c.opt_["ids"] = ids + return c +} + +// InPlan sets the optional parameter "inPlan": Select only inventory +// items that are in plan. +func (c *InventoryItemsListCall) InPlan(inPlan bool) *InventoryItemsListCall { + c.opt_["inPlan"] = inPlan + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *InventoryItemsListCall) MaxResults(maxResults int64) *InventoryItemsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderId sets the optional parameter "orderId": Select only inventory +// items that belong to specified orders. +func (c *InventoryItemsListCall) OrderId(orderId int64) *InventoryItemsListCall { + c.opt_["orderId"] = orderId + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *InventoryItemsListCall) PageToken(pageToken string) *InventoryItemsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SiteId sets the optional parameter "siteId": Select only inventory +// items that are associated with these sites. +func (c *InventoryItemsListCall) SiteId(siteId int64) *InventoryItemsListCall { + c.opt_["siteId"] = siteId + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *InventoryItemsListCall) SortField(sortField string) *InventoryItemsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *InventoryItemsListCall) SortOrder(sortOrder string) *InventoryItemsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InventoryItemsListCall) Fields(s ...googleapi.Field) *InventoryItemsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InventoryItemsListCall) IfNoneMatch(entityTag string) *InventoryItemsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InventoryItemsListCall) Context(ctx context.Context) *InventoryItemsListCall { + c.ctx_ = ctx + return c +} + +func (c *InventoryItemsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["inPlan"]; ok { + params.Set("inPlan", 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_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["siteId"]; ok { + params.Set("siteId", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/inventoryItems") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "projectId": strconv.FormatInt(c.projectId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.inventoryItems.list" call. +// Exactly one of *InventoryItemsListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *InventoryItemsListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InventoryItemsListCall) Do() (*InventoryItemsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InventoryItemsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of inventory items, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.inventoryItems.list", + // "parameterOrder": [ + // "profileId", + // "projectId" + // ], + // "parameters": { + // "ids": { + // "description": "Select only inventory items with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "inPlan": { + // "description": "Select only inventory items that are in plan.", + // "location": "query", + // "type": "boolean" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "orderId": { + // "description": "Select only inventory items that belong to specified orders.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID for order documents.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "siteId": { + // "description": "Select only inventory items that are associated with these sites.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/projects/{projectId}/inventoryItems", + // "response": { + // "$ref": "InventoryItemsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.landingPages.delete": + +type LandingPagesDeleteCall struct { + s *Service + profileId int64 + campaignId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing campaign landing page. +func (r *LandingPagesService) Delete(profileId int64, campaignId int64, id int64) *LandingPagesDeleteCall { + c := &LandingPagesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaignId = campaignId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LandingPagesDeleteCall) Fields(s ...googleapi.Field) *LandingPagesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LandingPagesDeleteCall) Context(ctx context.Context) *LandingPagesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *LandingPagesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "campaignId": strconv.FormatInt(c.campaignId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.landingPages.delete" call. +func (c *LandingPagesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing campaign landing page.", + // "httpMethod": "DELETE", + // "id": "dfareporting.landingPages.delete", + // "parameterOrder": [ + // "profileId", + // "campaignId", + // "id" + // ], + // "parameters": { + // "campaignId": { + // "description": "Landing page campaign ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "id": { + // "description": "Landing page ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.landingPages.get": + +type LandingPagesGetCall struct { + s *Service + profileId int64 + campaignId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one campaign landing page by ID. +func (r *LandingPagesService) Get(profileId int64, campaignId int64, id int64) *LandingPagesGetCall { + c := &LandingPagesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaignId = campaignId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LandingPagesGetCall) Fields(s ...googleapi.Field) *LandingPagesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LandingPagesGetCall) IfNoneMatch(entityTag string) *LandingPagesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LandingPagesGetCall) Context(ctx context.Context) *LandingPagesGetCall { + c.ctx_ = ctx + return c +} + +func (c *LandingPagesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "campaignId": strconv.FormatInt(c.campaignId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.landingPages.get" call. +// Exactly one of *LandingPage or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LandingPage.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *LandingPagesGetCall) Do() (*LandingPage, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LandingPage{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one campaign landing page by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.landingPages.get", + // "parameterOrder": [ + // "profileId", + // "campaignId", + // "id" + // ], + // "parameters": { + // "campaignId": { + // "description": "Landing page campaign ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "id": { + // "description": "Landing page ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}", + // "response": { + // "$ref": "LandingPage" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.landingPages.insert": + +type LandingPagesInsertCall struct { + s *Service + profileId int64 + campaignId int64 + landingpage *LandingPage + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new landing page for the specified campaign. +func (r *LandingPagesService) Insert(profileId int64, campaignId int64, landingpage *LandingPage) *LandingPagesInsertCall { + c := &LandingPagesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaignId = campaignId + c.landingpage = landingpage + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LandingPagesInsertCall) Fields(s ...googleapi.Field) *LandingPagesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LandingPagesInsertCall) Context(ctx context.Context) *LandingPagesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *LandingPagesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "campaignId": strconv.FormatInt(c.campaignId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.landingPages.insert" call. +// Exactly one of *LandingPage or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LandingPage.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *LandingPagesInsertCall) Do() (*LandingPage, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LandingPage{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new landing page for the specified campaign.", + // "httpMethod": "POST", + // "id": "dfareporting.landingPages.insert", + // "parameterOrder": [ + // "profileId", + // "campaignId" + // ], + // "parameters": { + // "campaignId": { + // "description": "Landing page campaign ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + // "request": { + // "$ref": "LandingPage" + // }, + // "response": { + // "$ref": "LandingPage" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.landingPages.list": + +type LandingPagesListCall struct { + s *Service + profileId int64 + campaignId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of landing pages for the specified campaign. +func (r *LandingPagesService) List(profileId int64, campaignId int64) *LandingPagesListCall { + c := &LandingPagesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaignId = campaignId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LandingPagesListCall) Fields(s ...googleapi.Field) *LandingPagesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LandingPagesListCall) IfNoneMatch(entityTag string) *LandingPagesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LandingPagesListCall) Context(ctx context.Context) *LandingPagesListCall { + c.ctx_ = ctx + return c +} + +func (c *LandingPagesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "campaignId": strconv.FormatInt(c.campaignId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.landingPages.list" call. +// Exactly one of *LandingPagesListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *LandingPagesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LandingPagesListCall) Do() (*LandingPagesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LandingPagesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of landing pages for the specified campaign.", + // "httpMethod": "GET", + // "id": "dfareporting.landingPages.list", + // "parameterOrder": [ + // "profileId", + // "campaignId" + // ], + // "parameters": { + // "campaignId": { + // "description": "Landing page campaign ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + // "response": { + // "$ref": "LandingPagesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.landingPages.patch": + +type LandingPagesPatchCall struct { + s *Service + profileId int64 + campaignId int64 + id int64 + landingpage *LandingPage + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing campaign landing page. This method +// supports patch semantics. +func (r *LandingPagesService) Patch(profileId int64, campaignId int64, id int64, landingpage *LandingPage) *LandingPagesPatchCall { + c := &LandingPagesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaignId = campaignId + c.id = id + c.landingpage = landingpage + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LandingPagesPatchCall) Fields(s ...googleapi.Field) *LandingPagesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LandingPagesPatchCall) Context(ctx context.Context) *LandingPagesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *LandingPagesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "campaignId": strconv.FormatInt(c.campaignId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.landingPages.patch" call. +// Exactly one of *LandingPage or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LandingPage.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *LandingPagesPatchCall) Do() (*LandingPage, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LandingPage{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing campaign landing page. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.landingPages.patch", + // "parameterOrder": [ + // "profileId", + // "campaignId", + // "id" + // ], + // "parameters": { + // "campaignId": { + // "description": "Landing page campaign ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "id": { + // "description": "Landing page ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + // "request": { + // "$ref": "LandingPage" + // }, + // "response": { + // "$ref": "LandingPage" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.landingPages.update": + +type LandingPagesUpdateCall struct { + s *Service + profileId int64 + campaignId int64 + landingpage *LandingPage + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing campaign landing page. +func (r *LandingPagesService) Update(profileId int64, campaignId int64, landingpage *LandingPage) *LandingPagesUpdateCall { + c := &LandingPagesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.campaignId = campaignId + c.landingpage = landingpage + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LandingPagesUpdateCall) Fields(s ...googleapi.Field) *LandingPagesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LandingPagesUpdateCall) Context(ctx context.Context) *LandingPagesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *LandingPagesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "campaignId": strconv.FormatInt(c.campaignId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.landingPages.update" call. +// Exactly one of *LandingPage or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LandingPage.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *LandingPagesUpdateCall) Do() (*LandingPage, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LandingPage{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing campaign landing page.", + // "httpMethod": "PUT", + // "id": "dfareporting.landingPages.update", + // "parameterOrder": [ + // "profileId", + // "campaignId" + // ], + // "parameters": { + // "campaignId": { + // "description": "Landing page campaign ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages", + // "request": { + // "$ref": "LandingPage" + // }, + // "response": { + // "$ref": "LandingPage" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.metros.list": + +type MetrosListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of metros. +func (r *MetrosService) List(profileId int64) *MetrosListCall { + c := &MetrosListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MetrosListCall) Fields(s ...googleapi.Field) *MetrosListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MetrosListCall) IfNoneMatch(entityTag string) *MetrosListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MetrosListCall) Context(ctx context.Context) *MetrosListCall { + c.ctx_ = ctx + return c +} + +func (c *MetrosListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/metros") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.metros.list" call. +// Exactly one of *MetrosListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *MetrosListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MetrosListCall) Do() (*MetrosListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &MetrosListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of metros.", + // "httpMethod": "GET", + // "id": "dfareporting.metros.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/metros", + // "response": { + // "$ref": "MetrosListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.mobileCarriers.get": + +type MobileCarriersGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one mobile carrier by ID. +func (r *MobileCarriersService) Get(profileId int64, id int64) *MobileCarriersGetCall { + c := &MobileCarriersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MobileCarriersGetCall) Fields(s ...googleapi.Field) *MobileCarriersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MobileCarriersGetCall) IfNoneMatch(entityTag string) *MobileCarriersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MobileCarriersGetCall) Context(ctx context.Context) *MobileCarriersGetCall { + c.ctx_ = ctx + return c +} + +func (c *MobileCarriersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileCarriers/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.mobileCarriers.get" call. +// Exactly one of *MobileCarrier or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *MobileCarrier.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MobileCarriersGetCall) Do() (*MobileCarrier, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &MobileCarrier{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one mobile carrier by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.mobileCarriers.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Mobile carrier ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/mobileCarriers/{id}", + // "response": { + // "$ref": "MobileCarrier" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.mobileCarriers.list": + +type MobileCarriersListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of mobile carriers. +func (r *MobileCarriersService) List(profileId int64) *MobileCarriersListCall { + c := &MobileCarriersListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MobileCarriersListCall) Fields(s ...googleapi.Field) *MobileCarriersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MobileCarriersListCall) IfNoneMatch(entityTag string) *MobileCarriersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MobileCarriersListCall) Context(ctx context.Context) *MobileCarriersListCall { + c.ctx_ = ctx + return c +} + +func (c *MobileCarriersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileCarriers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.mobileCarriers.list" call. +// Exactly one of *MobileCarriersListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *MobileCarriersListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MobileCarriersListCall) Do() (*MobileCarriersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &MobileCarriersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of mobile carriers.", + // "httpMethod": "GET", + // "id": "dfareporting.mobileCarriers.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/mobileCarriers", + // "response": { + // "$ref": "MobileCarriersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.operatingSystemVersions.get": + +type OperatingSystemVersionsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one operating system version by ID. +func (r *OperatingSystemVersionsService) Get(profileId int64, id int64) *OperatingSystemVersionsGetCall { + c := &OperatingSystemVersionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OperatingSystemVersionsGetCall) Fields(s ...googleapi.Field) *OperatingSystemVersionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OperatingSystemVersionsGetCall) IfNoneMatch(entityTag string) *OperatingSystemVersionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OperatingSystemVersionsGetCall) Context(ctx context.Context) *OperatingSystemVersionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *OperatingSystemVersionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystemVersions/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.operatingSystemVersions.get" call. +// Exactly one of *OperatingSystemVersion or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *OperatingSystemVersion.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OperatingSystemVersionsGetCall) Do() (*OperatingSystemVersion, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperatingSystemVersion{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one operating system version by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.operatingSystemVersions.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Operating system version ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/operatingSystemVersions/{id}", + // "response": { + // "$ref": "OperatingSystemVersion" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.operatingSystemVersions.list": + +type OperatingSystemVersionsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of operating system versions. +func (r *OperatingSystemVersionsService) List(profileId int64) *OperatingSystemVersionsListCall { + c := &OperatingSystemVersionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OperatingSystemVersionsListCall) Fields(s ...googleapi.Field) *OperatingSystemVersionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OperatingSystemVersionsListCall) IfNoneMatch(entityTag string) *OperatingSystemVersionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OperatingSystemVersionsListCall) Context(ctx context.Context) *OperatingSystemVersionsListCall { + c.ctx_ = ctx + return c +} + +func (c *OperatingSystemVersionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystemVersions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.operatingSystemVersions.list" call. +// Exactly one of *OperatingSystemVersionsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *OperatingSystemVersionsListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *OperatingSystemVersionsListCall) Do() (*OperatingSystemVersionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperatingSystemVersionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of operating system versions.", + // "httpMethod": "GET", + // "id": "dfareporting.operatingSystemVersions.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/operatingSystemVersions", + // "response": { + // "$ref": "OperatingSystemVersionsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.operatingSystems.get": + +type OperatingSystemsGetCall struct { + s *Service + profileId int64 + dartId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one operating system by DART ID. +func (r *OperatingSystemsService) Get(profileId int64, dartId int64) *OperatingSystemsGetCall { + c := &OperatingSystemsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.dartId = dartId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OperatingSystemsGetCall) Fields(s ...googleapi.Field) *OperatingSystemsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OperatingSystemsGetCall) IfNoneMatch(entityTag string) *OperatingSystemsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OperatingSystemsGetCall) Context(ctx context.Context) *OperatingSystemsGetCall { + c.ctx_ = ctx + return c +} + +func (c *OperatingSystemsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystems/{dartId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "dartId": strconv.FormatInt(c.dartId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.operatingSystems.get" call. +// Exactly one of *OperatingSystem or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *OperatingSystem.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OperatingSystemsGetCall) Do() (*OperatingSystem, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperatingSystem{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one operating system by DART ID.", + // "httpMethod": "GET", + // "id": "dfareporting.operatingSystems.get", + // "parameterOrder": [ + // "profileId", + // "dartId" + // ], + // "parameters": { + // "dartId": { + // "description": "Operating system DART ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/operatingSystems/{dartId}", + // "response": { + // "$ref": "OperatingSystem" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.operatingSystems.list": + +type OperatingSystemsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of operating systems. +func (r *OperatingSystemsService) List(profileId int64) *OperatingSystemsListCall { + c := &OperatingSystemsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OperatingSystemsListCall) Fields(s ...googleapi.Field) *OperatingSystemsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OperatingSystemsListCall) IfNoneMatch(entityTag string) *OperatingSystemsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OperatingSystemsListCall) Context(ctx context.Context) *OperatingSystemsListCall { + c.ctx_ = ctx + return c +} + +func (c *OperatingSystemsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystems") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.operatingSystems.list" call. +// Exactly one of *OperatingSystemsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *OperatingSystemsListResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OperatingSystemsListCall) Do() (*OperatingSystemsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperatingSystemsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of operating systems.", + // "httpMethod": "GET", + // "id": "dfareporting.operatingSystems.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/operatingSystems", + // "response": { + // "$ref": "OperatingSystemsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.orderDocuments.get": + +type OrderDocumentsGetCall struct { + s *Service + profileId int64 + projectId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one order document by ID. +func (r *OrderDocumentsService) Get(profileId int64, projectId int64, id int64) *OrderDocumentsGetCall { + c := &OrderDocumentsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.projectId = projectId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrderDocumentsGetCall) Fields(s ...googleapi.Field) *OrderDocumentsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrderDocumentsGetCall) IfNoneMatch(entityTag string) *OrderDocumentsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrderDocumentsGetCall) Context(ctx context.Context) *OrderDocumentsGetCall { + c.ctx_ = ctx + return c +} + +func (c *OrderDocumentsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "projectId": strconv.FormatInt(c.projectId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.orderDocuments.get" call. +// Exactly one of *OrderDocument or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *OrderDocument.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrderDocumentsGetCall) Do() (*OrderDocument, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrderDocument{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one order document by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.orderDocuments.get", + // "parameterOrder": [ + // "profileId", + // "projectId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Order document ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID for order documents.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}", + // "response": { + // "$ref": "OrderDocument" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.orderDocuments.list": + +type OrderDocumentsListCall struct { + s *Service + profileId int64 + projectId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of order documents, possibly filtered. +func (r *OrderDocumentsService) List(profileId int64, projectId int64) *OrderDocumentsListCall { + c := &OrderDocumentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.projectId = projectId + return c +} + +// Approved sets the optional parameter "approved": Select only order +// documents that have been approved by at least one user. +func (c *OrderDocumentsListCall) Approved(approved bool) *OrderDocumentsListCall { + c.opt_["approved"] = approved + return c +} + +// Ids sets the optional parameter "ids": Select only order documents +// with these IDs. +func (c *OrderDocumentsListCall) Ids(ids int64) *OrderDocumentsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *OrderDocumentsListCall) MaxResults(maxResults int64) *OrderDocumentsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// OrderId sets the optional parameter "orderId": Select only order +// documents for specified orders. +func (c *OrderDocumentsListCall) OrderId(orderId int64) *OrderDocumentsListCall { + c.opt_["orderId"] = orderId + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *OrderDocumentsListCall) PageToken(pageToken string) *OrderDocumentsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for order documents by name or ID. Wildcards (*) are +// allowed. For example, "orderdocument*2015" will return order +// documents with names like "orderdocument June 2015", "orderdocument +// April 2015", or simply "orderdocument 2015". Most of the searches +// also add wildcards implicitly at the start and the end of the search +// string. For example, a search string of "orderdocument" will match +// order documents with name "my orderdocument", "orderdocument 2015", +// or simply "orderdocument". +func (c *OrderDocumentsListCall) SearchString(searchString string) *OrderDocumentsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SiteId sets the optional parameter "siteId": Select only order +// documents that are associated with these sites. +func (c *OrderDocumentsListCall) SiteId(siteId int64) *OrderDocumentsListCall { + c.opt_["siteId"] = siteId + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *OrderDocumentsListCall) SortField(sortField string) *OrderDocumentsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *OrderDocumentsListCall) SortOrder(sortOrder string) *OrderDocumentsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrderDocumentsListCall) Fields(s ...googleapi.Field) *OrderDocumentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrderDocumentsListCall) IfNoneMatch(entityTag string) *OrderDocumentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrderDocumentsListCall) Context(ctx context.Context) *OrderDocumentsListCall { + c.ctx_ = ctx + return c +} + +func (c *OrderDocumentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["approved"]; ok { + params.Set("approved", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["siteId"]; ok { + params.Set("siteId", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orderDocuments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "projectId": strconv.FormatInt(c.projectId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.orderDocuments.list" call. +// Exactly one of *OrderDocumentsListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *OrderDocumentsListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrderDocumentsListCall) Do() (*OrderDocumentsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrderDocumentsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of order documents, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.orderDocuments.list", + // "parameterOrder": [ + // "profileId", + // "projectId" + // ], + // "parameters": { + // "approved": { + // "description": "Select only order documents that have been approved by at least one user.", + // "location": "query", + // "type": "boolean" + // }, + // "ids": { + // "description": "Select only order documents with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "orderId": { + // "description": "Select only order documents for specified orders.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID for order documents.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for order documents by name or ID. Wildcards (*) are allowed. For example, \"orderdocument*2015\" will return order documents with names like \"orderdocument June 2015\", \"orderdocument April 2015\", or simply \"orderdocument 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"orderdocument\" will match order documents with name \"my orderdocument\", \"orderdocument 2015\", or simply \"orderdocument\".", + // "location": "query", + // "type": "string" + // }, + // "siteId": { + // "description": "Select only order documents that are associated with these sites.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/projects/{projectId}/orderDocuments", + // "response": { + // "$ref": "OrderDocumentsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.orders.get": + +type OrdersGetCall struct { + s *Service + profileId int64 + projectId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one order by ID. +func (r *OrdersService) Get(profileId int64, projectId int64, id int64) *OrdersGetCall { + c := &OrdersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.projectId = projectId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersGetCall) Fields(s ...googleapi.Field) *OrdersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrdersGetCall) IfNoneMatch(entityTag string) *OrdersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersGetCall) Context(ctx context.Context) *OrdersGetCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orders/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "projectId": strconv.FormatInt(c.projectId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.orders.get" call. +// Exactly one of *Order or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Order.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OrdersGetCall) Do() (*Order, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Order{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one order by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.orders.get", + // "parameterOrder": [ + // "profileId", + // "projectId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Order ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID for orders.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/projects/{projectId}/orders/{id}", + // "response": { + // "$ref": "Order" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.orders.list": + +type OrdersListCall struct { + s *Service + profileId int64 + projectId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of orders, possibly filtered. +func (r *OrdersService) List(profileId int64, projectId int64) *OrdersListCall { + c := &OrdersListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.projectId = projectId + return c +} + +// Ids sets the optional parameter "ids": Select only orders with these +// IDs. +func (c *OrdersListCall) Ids(ids int64) *OrdersListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *OrdersListCall) MaxResults(maxResults int64) *OrdersListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *OrdersListCall) PageToken(pageToken string) *OrdersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for orders by name or ID. Wildcards (*) are allowed. For +// example, "order*2015" will return orders with names like "order June +// 2015", "order April 2015", or simply "order 2015". Most of the +// searches also add wildcards implicitly at the start and the end of +// the search string. For example, a search string of "order" will match +// orders with name "my order", "order 2015", or simply "order". +func (c *OrdersListCall) SearchString(searchString string) *OrdersListCall { + c.opt_["searchString"] = searchString + return c +} + +// SiteId sets the optional parameter "siteId": Select only orders that +// are associated with these site IDs. +func (c *OrdersListCall) SiteId(siteId int64) *OrdersListCall { + c.opt_["siteId"] = siteId + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *OrdersListCall) SortField(sortField string) *OrdersListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *OrdersListCall) SortOrder(sortOrder string) *OrdersListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OrdersListCall) Fields(s ...googleapi.Field) *OrdersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OrdersListCall) IfNoneMatch(entityTag string) *OrdersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OrdersListCall) Context(ctx context.Context) *OrdersListCall { + c.ctx_ = ctx + return c +} + +func (c *OrdersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["siteId"]; ok { + params.Set("siteId", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orders") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "projectId": strconv.FormatInt(c.projectId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.orders.list" call. +// Exactly one of *OrdersListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *OrdersListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OrdersListCall) Do() (*OrdersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OrdersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of orders, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.orders.list", + // "parameterOrder": [ + // "profileId", + // "projectId" + // ], + // "parameters": { + // "ids": { + // "description": "Select only orders with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "Project ID for orders.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for orders by name or ID. Wildcards (*) are allowed. For example, \"order*2015\" will return orders with names like \"order June 2015\", \"order April 2015\", or simply \"order 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"order\" will match orders with name \"my order\", \"order 2015\", or simply \"order\".", + // "location": "query", + // "type": "string" + // }, + // "siteId": { + // "description": "Select only orders that are associated with these site IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/projects/{projectId}/orders", + // "response": { + // "$ref": "OrdersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementGroups.get": + +type PlacementGroupsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one placement group by ID. +func (r *PlacementGroupsService) Get(profileId int64, id int64) *PlacementGroupsGetCall { + c := &PlacementGroupsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementGroupsGetCall) Fields(s ...googleapi.Field) *PlacementGroupsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PlacementGroupsGetCall) IfNoneMatch(entityTag string) *PlacementGroupsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementGroupsGetCall) Context(ctx context.Context) *PlacementGroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementGroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementGroups.get" call. +// Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PlacementGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementGroupsGetCall) Do() (*PlacementGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one placement group by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.placementGroups.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Placement group ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementGroups/{id}", + // "response": { + // "$ref": "PlacementGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementGroups.insert": + +type PlacementGroupsInsertCall struct { + s *Service + profileId int64 + placementgroup *PlacementGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new placement group. +func (r *PlacementGroupsService) Insert(profileId int64, placementgroup *PlacementGroup) *PlacementGroupsInsertCall { + c := &PlacementGroupsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.placementgroup = placementgroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementGroupsInsertCall) Fields(s ...googleapi.Field) *PlacementGroupsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementGroupsInsertCall) Context(ctx context.Context) *PlacementGroupsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementGroupsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementGroups.insert" call. +// Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PlacementGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementGroupsInsertCall) Do() (*PlacementGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new placement group.", + // "httpMethod": "POST", + // "id": "dfareporting.placementGroups.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementGroups", + // "request": { + // "$ref": "PlacementGroup" + // }, + // "response": { + // "$ref": "PlacementGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementGroups.list": + +type PlacementGroupsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of placement groups, possibly filtered. +func (r *PlacementGroupsService) List(profileId int64) *PlacementGroupsListCall { + c := &PlacementGroupsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdvertiserIds sets the optional parameter "advertiserIds": Select +// only placement groups that belong to these advertisers. +func (c *PlacementGroupsListCall) AdvertiserIds(advertiserIds int64) *PlacementGroupsListCall { + c.opt_["advertiserIds"] = advertiserIds + return c +} + +// Archived sets the optional parameter "archived": Select only archived +// placements. Don't set this field to select both archived and +// non-archived placements. +func (c *PlacementGroupsListCall) Archived(archived bool) *PlacementGroupsListCall { + c.opt_["archived"] = archived + return c +} + +// CampaignIds sets the optional parameter "campaignIds": Select only +// placement groups that belong to these campaigns. +func (c *PlacementGroupsListCall) CampaignIds(campaignIds int64) *PlacementGroupsListCall { + c.opt_["campaignIds"] = campaignIds + return c +} + +// ContentCategoryIds sets the optional parameter "contentCategoryIds": +// Select only placement groups that are associated with these content +// categories. +func (c *PlacementGroupsListCall) ContentCategoryIds(contentCategoryIds int64) *PlacementGroupsListCall { + c.opt_["contentCategoryIds"] = contentCategoryIds + return c +} + +// DirectorySiteIds sets the optional parameter "directorySiteIds": +// Select only placement groups that are associated with these directory +// sites. +func (c *PlacementGroupsListCall) DirectorySiteIds(directorySiteIds int64) *PlacementGroupsListCall { + c.opt_["directorySiteIds"] = directorySiteIds + return c +} + +// Ids sets the optional parameter "ids": Select only placement groups +// with these IDs. +func (c *PlacementGroupsListCall) Ids(ids int64) *PlacementGroupsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxEndDate sets the optional parameter "maxEndDate": Select only +// placements or placement groups whose end date is on or before the +// specified maxEndDate. The date should be formatted as "yyyy-MM-dd". +func (c *PlacementGroupsListCall) MaxEndDate(maxEndDate string) *PlacementGroupsListCall { + c.opt_["maxEndDate"] = maxEndDate + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *PlacementGroupsListCall) MaxResults(maxResults int64) *PlacementGroupsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// MaxStartDate sets the optional parameter "maxStartDate": Select only +// placements or placement groups whose start date is on or before the +// specified maxStartDate. The date should be formatted as "yyyy-MM-dd". +func (c *PlacementGroupsListCall) MaxStartDate(maxStartDate string) *PlacementGroupsListCall { + c.opt_["maxStartDate"] = maxStartDate + return c +} + +// MinEndDate sets the optional parameter "minEndDate": Select only +// placements or placement groups whose end date is on or after the +// specified minEndDate. The date should be formatted as "yyyy-MM-dd". +func (c *PlacementGroupsListCall) MinEndDate(minEndDate string) *PlacementGroupsListCall { + c.opt_["minEndDate"] = minEndDate + return c +} + +// MinStartDate sets the optional parameter "minStartDate": Select only +// placements or placement groups whose start date is on or after the +// specified minStartDate. The date should be formatted as "yyyy-MM-dd". +func (c *PlacementGroupsListCall) MinStartDate(minStartDate string) *PlacementGroupsListCall { + c.opt_["minStartDate"] = minStartDate + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *PlacementGroupsListCall) PageToken(pageToken string) *PlacementGroupsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// PlacementGroupType sets the optional parameter "placementGroupType": +// Select only placement groups belonging with this group type. A +// package is a simple group of placements that acts as a single pricing +// point for a group of tags. A roadblock is a group of placements that +// not only acts as a single pricing point but also assumes that all the +// tags in it will be served at the same time. A roadblock requires one +// of its assigned placements to be marked as primary for reporting. +// +// Possible values: +// "PLACEMENT_PACKAGE" +// "PLACEMENT_ROADBLOCK" +func (c *PlacementGroupsListCall) PlacementGroupType(placementGroupType string) *PlacementGroupsListCall { + c.opt_["placementGroupType"] = placementGroupType + return c +} + +// PlacementStrategyIds sets the optional parameter +// "placementStrategyIds": Select only placement groups that are +// associated with these placement strategies. +func (c *PlacementGroupsListCall) PlacementStrategyIds(placementStrategyIds int64) *PlacementGroupsListCall { + c.opt_["placementStrategyIds"] = placementStrategyIds + return c +} + +// PricingTypes sets the optional parameter "pricingTypes": Select only +// placement groups with these pricing types. +// +// Possible values: +// "PRICING_TYPE_CPA" +// "PRICING_TYPE_CPC" +// "PRICING_TYPE_CPM" +// "PRICING_TYPE_FLAT_RATE_CLICKS" +// "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" +func (c *PlacementGroupsListCall) PricingTypes(pricingTypes string) *PlacementGroupsListCall { + c.opt_["pricingTypes"] = pricingTypes + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for placement groups by name or ID. Wildcards (*) are +// allowed. For example, "placement*2015" will return placement groups +// with names like "placement group June 2015", "placement group May +// 2015", or simply "placements 2015". Most of the searches also add +// wildcards implicitly at the start and the end of the search string. +// For example, a search string of "placementgroup" will match placement +// groups with name "my placementgroup", "placementgroup 2015", or +// simply "placementgroup". +func (c *PlacementGroupsListCall) SearchString(searchString string) *PlacementGroupsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SiteIds sets the optional parameter "siteIds": Select only placement +// groups that are associated with these sites. +func (c *PlacementGroupsListCall) SiteIds(siteIds int64) *PlacementGroupsListCall { + c.opt_["siteIds"] = siteIds + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *PlacementGroupsListCall) SortField(sortField string) *PlacementGroupsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *PlacementGroupsListCall) SortOrder(sortOrder string) *PlacementGroupsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementGroupsListCall) Fields(s ...googleapi.Field) *PlacementGroupsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PlacementGroupsListCall) IfNoneMatch(entityTag string) *PlacementGroupsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementGroupsListCall) Context(ctx context.Context) *PlacementGroupsListCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementGroupsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserIds"]; ok { + params.Set("advertiserIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["archived"]; ok { + params.Set("archived", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["campaignIds"]; ok { + params.Set("campaignIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["contentCategoryIds"]; ok { + params.Set("contentCategoryIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["directorySiteIds"]; ok { + params.Set("directorySiteIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxEndDate"]; ok { + params.Set("maxEndDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxStartDate"]; ok { + params.Set("maxStartDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["minEndDate"]; ok { + params.Set("minEndDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["minStartDate"]; ok { + params.Set("minStartDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["placementGroupType"]; ok { + params.Set("placementGroupType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["placementStrategyIds"]; ok { + params.Set("placementStrategyIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pricingTypes"]; ok { + params.Set("pricingTypes", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["siteIds"]; ok { + params.Set("siteIds", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementGroups.list" call. +// Exactly one of *PlacementGroupsListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *PlacementGroupsListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementGroupsListCall) Do() (*PlacementGroupsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementGroupsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of placement groups, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.placementGroups.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "advertiserIds": { + // "description": "Select only placement groups that belong to these advertisers.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "archived": { + // "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.", + // "location": "query", + // "type": "boolean" + // }, + // "campaignIds": { + // "description": "Select only placement groups that belong to these campaigns.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "contentCategoryIds": { + // "description": "Select only placement groups that are associated with these content categories.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "directorySiteIds": { + // "description": "Select only placement groups that are associated with these directory sites.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only placement groups with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxEndDate": { + // "description": "Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as \"yyyy-MM-dd\".", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "maxStartDate": { + // "description": "Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as \"yyyy-MM-dd\".", + // "location": "query", + // "type": "string" + // }, + // "minEndDate": { + // "description": "Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as \"yyyy-MM-dd\".", + // "location": "query", + // "type": "string" + // }, + // "minStartDate": { + // "description": "Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as \"yyyy-MM-dd\".", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "placementGroupType": { + // "description": "Select only placement groups belonging with this group type. A package is a simple group of placements that acts as a single pricing point for a group of tags. A roadblock is a group of placements that not only acts as a single pricing point but also assumes that all the tags in it will be served at the same time. A roadblock requires one of its assigned placements to be marked as primary for reporting.", + // "enum": [ + // "PLACEMENT_PACKAGE", + // "PLACEMENT_ROADBLOCK" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "placementStrategyIds": { + // "description": "Select only placement groups that are associated with these placement strategies.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "pricingTypes": { + // "description": "Select only placement groups with these pricing types.", + // "enum": [ + // "PRICING_TYPE_CPA", + // "PRICING_TYPE_CPC", + // "PRICING_TYPE_CPM", + // "PRICING_TYPE_FLAT_RATE_CLICKS", + // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for placement groups by name or ID. Wildcards (*) are allowed. For example, \"placement*2015\" will return placement groups with names like \"placement group June 2015\", \"placement group May 2015\", or simply \"placements 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"placementgroup\" will match placement groups with name \"my placementgroup\", \"placementgroup 2015\", or simply \"placementgroup\".", + // "location": "query", + // "type": "string" + // }, + // "siteIds": { + // "description": "Select only placement groups that are associated with these sites.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementGroups", + // "response": { + // "$ref": "PlacementGroupsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementGroups.patch": + +type PlacementGroupsPatchCall struct { + s *Service + profileId int64 + id int64 + placementgroup *PlacementGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing placement group. This method supports +// patch semantics. +func (r *PlacementGroupsService) Patch(profileId int64, id int64, placementgroup *PlacementGroup) *PlacementGroupsPatchCall { + c := &PlacementGroupsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.placementgroup = placementgroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementGroupsPatchCall) Fields(s ...googleapi.Field) *PlacementGroupsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementGroupsPatchCall) Context(ctx context.Context) *PlacementGroupsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementGroupsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementGroups.patch" call. +// Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PlacementGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementGroupsPatchCall) Do() (*PlacementGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing placement group. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.placementGroups.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Placement group ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementGroups", + // "request": { + // "$ref": "PlacementGroup" + // }, + // "response": { + // "$ref": "PlacementGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementGroups.update": + +type PlacementGroupsUpdateCall struct { + s *Service + profileId int64 + placementgroup *PlacementGroup + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing placement group. +func (r *PlacementGroupsService) Update(profileId int64, placementgroup *PlacementGroup) *PlacementGroupsUpdateCall { + c := &PlacementGroupsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.placementgroup = placementgroup + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementGroupsUpdateCall) Fields(s ...googleapi.Field) *PlacementGroupsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementGroupsUpdateCall) Context(ctx context.Context) *PlacementGroupsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementGroupsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementGroups.update" call. +// Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PlacementGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementGroupsUpdateCall) Do() (*PlacementGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing placement group.", + // "httpMethod": "PUT", + // "id": "dfareporting.placementGroups.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementGroups", + // "request": { + // "$ref": "PlacementGroup" + // }, + // "response": { + // "$ref": "PlacementGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementStrategies.delete": + +type PlacementStrategiesDeleteCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing placement strategy. +func (r *PlacementStrategiesService) Delete(profileId int64, id int64) *PlacementStrategiesDeleteCall { + c := &PlacementStrategiesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementStrategiesDeleteCall) Fields(s ...googleapi.Field) *PlacementStrategiesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementStrategiesDeleteCall) Context(ctx context.Context) *PlacementStrategiesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementStrategiesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementStrategies.delete" call. +func (c *PlacementStrategiesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing placement strategy.", + // "httpMethod": "DELETE", + // "id": "dfareporting.placementStrategies.delete", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Placement strategy ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementStrategies/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementStrategies.get": + +type PlacementStrategiesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one placement strategy by ID. +func (r *PlacementStrategiesService) Get(profileId int64, id int64) *PlacementStrategiesGetCall { + c := &PlacementStrategiesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementStrategiesGetCall) Fields(s ...googleapi.Field) *PlacementStrategiesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PlacementStrategiesGetCall) IfNoneMatch(entityTag string) *PlacementStrategiesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementStrategiesGetCall) Context(ctx context.Context) *PlacementStrategiesGetCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementStrategiesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementStrategies.get" call. +// Exactly one of *PlacementStrategy or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PlacementStrategy.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementStrategiesGetCall) Do() (*PlacementStrategy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementStrategy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one placement strategy by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.placementStrategies.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Placement strategy ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementStrategies/{id}", + // "response": { + // "$ref": "PlacementStrategy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementStrategies.insert": + +type PlacementStrategiesInsertCall struct { + s *Service + profileId int64 + placementstrategy *PlacementStrategy + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new placement strategy. +func (r *PlacementStrategiesService) Insert(profileId int64, placementstrategy *PlacementStrategy) *PlacementStrategiesInsertCall { + c := &PlacementStrategiesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.placementstrategy = placementstrategy + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementStrategiesInsertCall) Fields(s ...googleapi.Field) *PlacementStrategiesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementStrategiesInsertCall) Context(ctx context.Context) *PlacementStrategiesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementStrategiesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementStrategies.insert" call. +// Exactly one of *PlacementStrategy or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PlacementStrategy.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementStrategiesInsertCall) Do() (*PlacementStrategy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementStrategy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new placement strategy.", + // "httpMethod": "POST", + // "id": "dfareporting.placementStrategies.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementStrategies", + // "request": { + // "$ref": "PlacementStrategy" + // }, + // "response": { + // "$ref": "PlacementStrategy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementStrategies.list": + +type PlacementStrategiesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of placement strategies, possibly filtered. +func (r *PlacementStrategiesService) List(profileId int64) *PlacementStrategiesListCall { + c := &PlacementStrategiesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Ids sets the optional parameter "ids": Select only placement +// strategies with these IDs. +func (c *PlacementStrategiesListCall) Ids(ids int64) *PlacementStrategiesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *PlacementStrategiesListCall) MaxResults(maxResults int64) *PlacementStrategiesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *PlacementStrategiesListCall) PageToken(pageToken string) *PlacementStrategiesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "placementstrategy*2015" will return objects with names like +// "placementstrategy June 2015", "placementstrategy April 2015", or +// simply "placementstrategy 2015". Most of the searches also add +// wildcards implicitly at the start and the end of the search string. +// For example, a search string of "placementstrategy" will match +// objects with name "my placementstrategy", "placementstrategy 2015", +// or simply "placementstrategy". +func (c *PlacementStrategiesListCall) SearchString(searchString string) *PlacementStrategiesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *PlacementStrategiesListCall) SortField(sortField string) *PlacementStrategiesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *PlacementStrategiesListCall) SortOrder(sortOrder string) *PlacementStrategiesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementStrategiesListCall) Fields(s ...googleapi.Field) *PlacementStrategiesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PlacementStrategiesListCall) IfNoneMatch(entityTag string) *PlacementStrategiesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementStrategiesListCall) Context(ctx context.Context) *PlacementStrategiesListCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementStrategiesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementStrategies.list" call. +// Exactly one of *PlacementStrategiesListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PlacementStrategiesListResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementStrategiesListCall) Do() (*PlacementStrategiesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementStrategiesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of placement strategies, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.placementStrategies.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "ids": { + // "description": "Select only placement strategies with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"placementstrategy*2015\" will return objects with names like \"placementstrategy June 2015\", \"placementstrategy April 2015\", or simply \"placementstrategy 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"placementstrategy\" will match objects with name \"my placementstrategy\", \"placementstrategy 2015\", or simply \"placementstrategy\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementStrategies", + // "response": { + // "$ref": "PlacementStrategiesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementStrategies.patch": + +type PlacementStrategiesPatchCall struct { + s *Service + profileId int64 + id int64 + placementstrategy *PlacementStrategy + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing placement strategy. This method supports +// patch semantics. +func (r *PlacementStrategiesService) Patch(profileId int64, id int64, placementstrategy *PlacementStrategy) *PlacementStrategiesPatchCall { + c := &PlacementStrategiesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.placementstrategy = placementstrategy + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementStrategiesPatchCall) Fields(s ...googleapi.Field) *PlacementStrategiesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementStrategiesPatchCall) Context(ctx context.Context) *PlacementStrategiesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementStrategiesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementStrategies.patch" call. +// Exactly one of *PlacementStrategy or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PlacementStrategy.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementStrategiesPatchCall) Do() (*PlacementStrategy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementStrategy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing placement strategy. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.placementStrategies.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Placement strategy ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementStrategies", + // "request": { + // "$ref": "PlacementStrategy" + // }, + // "response": { + // "$ref": "PlacementStrategy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placementStrategies.update": + +type PlacementStrategiesUpdateCall struct { + s *Service + profileId int64 + placementstrategy *PlacementStrategy + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing placement strategy. +func (r *PlacementStrategiesService) Update(profileId int64, placementstrategy *PlacementStrategy) *PlacementStrategiesUpdateCall { + c := &PlacementStrategiesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.placementstrategy = placementstrategy + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementStrategiesUpdateCall) Fields(s ...googleapi.Field) *PlacementStrategiesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementStrategiesUpdateCall) Context(ctx context.Context) *PlacementStrategiesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementStrategiesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placementStrategies.update" call. +// Exactly one of *PlacementStrategy or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PlacementStrategy.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementStrategiesUpdateCall) Do() (*PlacementStrategy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementStrategy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing placement strategy.", + // "httpMethod": "PUT", + // "id": "dfareporting.placementStrategies.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placementStrategies", + // "request": { + // "$ref": "PlacementStrategy" + // }, + // "response": { + // "$ref": "PlacementStrategy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placements.generatetags": + +type PlacementsGeneratetagsCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Generatetags: Generates tags for a placement. +func (r *PlacementsService) Generatetags(profileId int64) *PlacementsGeneratetagsCall { + c := &PlacementsGeneratetagsCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// CampaignId sets the optional parameter "campaignId": Generate +// placements belonging to this campaign. This is a required field. +func (c *PlacementsGeneratetagsCall) CampaignId(campaignId int64) *PlacementsGeneratetagsCall { + c.opt_["campaignId"] = campaignId + return c +} + +// PlacementIds sets the optional parameter "placementIds": Generate +// tags for these placements. +func (c *PlacementsGeneratetagsCall) PlacementIds(placementIds int64) *PlacementsGeneratetagsCall { + c.opt_["placementIds"] = placementIds + return c +} + +// TagFormats sets the optional parameter "tagFormats": Tag formats to +// generate for these placements. +// +// Possible values: +// "PLACEMENT_TAG_CLICK_COMMANDS" +// "PLACEMENT_TAG_IFRAME_ILAYER" +// "PLACEMENT_TAG_IFRAME_JAVASCRIPT" +// "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY" +// "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH" +// "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3" +// "PLACEMENT_TAG_INTERNAL_REDIRECT" +// "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT" +// "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY" +// "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT" +// "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT" +// "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY" +// "PLACEMENT_TAG_JAVASCRIPT" +// "PLACEMENT_TAG_JAVASCRIPT_LEGACY" +// "PLACEMENT_TAG_STANDARD" +// "PLACEMENT_TAG_TRACKING" +// "PLACEMENT_TAG_TRACKING_IFRAME" +// "PLACEMENT_TAG_TRACKING_JAVASCRIPT" +func (c *PlacementsGeneratetagsCall) TagFormats(tagFormats string) *PlacementsGeneratetagsCall { + c.opt_["tagFormats"] = tagFormats + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementsGeneratetagsCall) Fields(s ...googleapi.Field) *PlacementsGeneratetagsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementsGeneratetagsCall) Context(ctx context.Context) *PlacementsGeneratetagsCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementsGeneratetagsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["campaignId"]; ok { + params.Set("campaignId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["placementIds"]; ok { + params.Set("placementIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["tagFormats"]; ok { + params.Set("tagFormats", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements/generatetags") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placements.generatetags" call. +// Exactly one of *PlacementsGenerateTagsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PlacementsGenerateTagsResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementsGeneratetagsCall) Do() (*PlacementsGenerateTagsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementsGenerateTagsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generates tags for a placement.", + // "httpMethod": "POST", + // "id": "dfareporting.placements.generatetags", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "campaignId": { + // "description": "Generate placements belonging to this campaign. This is a required field.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "placementIds": { + // "description": "Generate tags for these placements.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tagFormats": { + // "description": "Tag formats to generate for these placements.", + // "enum": [ + // "PLACEMENT_TAG_CLICK_COMMANDS", + // "PLACEMENT_TAG_IFRAME_ILAYER", + // "PLACEMENT_TAG_IFRAME_JAVASCRIPT", + // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY", + // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH", + // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3", + // "PLACEMENT_TAG_INTERNAL_REDIRECT", + // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT", + // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY", + // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT", + // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT", + // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY", + // "PLACEMENT_TAG_JAVASCRIPT", + // "PLACEMENT_TAG_JAVASCRIPT_LEGACY", + // "PLACEMENT_TAG_STANDARD", + // "PLACEMENT_TAG_TRACKING", + // "PLACEMENT_TAG_TRACKING_IFRAME", + // "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placements/generatetags", + // "response": { + // "$ref": "PlacementsGenerateTagsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placements.get": + +type PlacementsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one placement by ID. +func (r *PlacementsService) Get(profileId int64, id int64) *PlacementsGetCall { + c := &PlacementsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementsGetCall) Fields(s ...googleapi.Field) *PlacementsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PlacementsGetCall) IfNoneMatch(entityTag string) *PlacementsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementsGetCall) Context(ctx context.Context) *PlacementsGetCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placements.get" call. +// Exactly one of *Placement or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Placement.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PlacementsGetCall) Do() (*Placement, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Placement{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one placement by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.placements.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Placement ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placements/{id}", + // "response": { + // "$ref": "Placement" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placements.insert": + +type PlacementsInsertCall struct { + s *Service + profileId int64 + placement *Placement + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new placement. +func (r *PlacementsService) Insert(profileId int64, placement *Placement) *PlacementsInsertCall { + c := &PlacementsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.placement = placement + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementsInsertCall) Fields(s ...googleapi.Field) *PlacementsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementsInsertCall) Context(ctx context.Context) *PlacementsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placements.insert" call. +// Exactly one of *Placement or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Placement.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PlacementsInsertCall) Do() (*Placement, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Placement{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new placement.", + // "httpMethod": "POST", + // "id": "dfareporting.placements.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placements", + // "request": { + // "$ref": "Placement" + // }, + // "response": { + // "$ref": "Placement" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placements.list": + +type PlacementsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of placements, possibly filtered. +func (r *PlacementsService) List(profileId int64) *PlacementsListCall { + c := &PlacementsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdvertiserIds sets the optional parameter "advertiserIds": Select +// only placements that belong to these advertisers. +func (c *PlacementsListCall) AdvertiserIds(advertiserIds int64) *PlacementsListCall { + c.opt_["advertiserIds"] = advertiserIds + return c +} + +// Archived sets the optional parameter "archived": Select only archived +// placements. Don't set this field to select both archived and +// non-archived placements. +func (c *PlacementsListCall) Archived(archived bool) *PlacementsListCall { + c.opt_["archived"] = archived + return c +} + +// CampaignIds sets the optional parameter "campaignIds": Select only +// placements that belong to these campaigns. +func (c *PlacementsListCall) CampaignIds(campaignIds int64) *PlacementsListCall { + c.opt_["campaignIds"] = campaignIds + return c +} + +// Compatibilities sets the optional parameter "compatibilities": Select +// only placements that are associated with these compatibilities. WEB +// and WEB_INTERSTITIAL refer to rendering either on desktop or on +// mobile devices for regular or interstitial ads respectively. APP and +// APP_INTERSTITIAL are for rendering in mobile apps.IN_STREAM_VIDEO +// refers to rendering in in-stream video ads developed with the VAST +// standard. +// +// Possible values: +// "APP" +// "APP_INTERSTITIAL" +// "IN_STREAM_VIDEO" +// "WEB" +// "WEB_INTERSTITIAL" +func (c *PlacementsListCall) Compatibilities(compatibilities string) *PlacementsListCall { + c.opt_["compatibilities"] = compatibilities + return c +} + +// ContentCategoryIds sets the optional parameter "contentCategoryIds": +// Select only placements that are associated with these content +// categories. +func (c *PlacementsListCall) ContentCategoryIds(contentCategoryIds int64) *PlacementsListCall { + c.opt_["contentCategoryIds"] = contentCategoryIds + return c +} + +// DirectorySiteIds sets the optional parameter "directorySiteIds": +// Select only placements that are associated with these directory +// sites. +func (c *PlacementsListCall) DirectorySiteIds(directorySiteIds int64) *PlacementsListCall { + c.opt_["directorySiteIds"] = directorySiteIds + return c +} + +// GroupIds sets the optional parameter "groupIds": Select only +// placements that belong to these placement groups. +func (c *PlacementsListCall) GroupIds(groupIds int64) *PlacementsListCall { + c.opt_["groupIds"] = groupIds + return c +} + +// Ids sets the optional parameter "ids": Select only placements with +// these IDs. +func (c *PlacementsListCall) Ids(ids int64) *PlacementsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxEndDate sets the optional parameter "maxEndDate": Select only +// placements or placement groups whose end date is on or before the +// specified maxEndDate. The date should be formatted as "yyyy-MM-dd". +func (c *PlacementsListCall) MaxEndDate(maxEndDate string) *PlacementsListCall { + c.opt_["maxEndDate"] = maxEndDate + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *PlacementsListCall) MaxResults(maxResults int64) *PlacementsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// MaxStartDate sets the optional parameter "maxStartDate": Select only +// placements or placement groups whose start date is on or before the +// specified maxStartDate. The date should be formatted as "yyyy-MM-dd". +func (c *PlacementsListCall) MaxStartDate(maxStartDate string) *PlacementsListCall { + c.opt_["maxStartDate"] = maxStartDate + return c +} + +// MinEndDate sets the optional parameter "minEndDate": Select only +// placements or placement groups whose end date is on or after the +// specified minEndDate. The date should be formatted as "yyyy-MM-dd". +func (c *PlacementsListCall) MinEndDate(minEndDate string) *PlacementsListCall { + c.opt_["minEndDate"] = minEndDate + return c +} + +// MinStartDate sets the optional parameter "minStartDate": Select only +// placements or placement groups whose start date is on or after the +// specified minStartDate. The date should be formatted as "yyyy-MM-dd". +func (c *PlacementsListCall) MinStartDate(minStartDate string) *PlacementsListCall { + c.opt_["minStartDate"] = minStartDate + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *PlacementsListCall) PageToken(pageToken string) *PlacementsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// PaymentSource sets the optional parameter "paymentSource": Select +// only placements with this payment source. +// +// Possible values: +// "PLACEMENT_AGENCY_PAID" +// "PLACEMENT_PUBLISHER_PAID" +func (c *PlacementsListCall) PaymentSource(paymentSource string) *PlacementsListCall { + c.opt_["paymentSource"] = paymentSource + return c +} + +// PlacementStrategyIds sets the optional parameter +// "placementStrategyIds": Select only placements that are associated +// with these placement strategies. +func (c *PlacementsListCall) PlacementStrategyIds(placementStrategyIds int64) *PlacementsListCall { + c.opt_["placementStrategyIds"] = placementStrategyIds + return c +} + +// PricingTypes sets the optional parameter "pricingTypes": Select only +// placements with these pricing types. +// +// Possible values: +// "PRICING_TYPE_CPA" +// "PRICING_TYPE_CPC" +// "PRICING_TYPE_CPM" +// "PRICING_TYPE_FLAT_RATE_CLICKS" +// "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" +func (c *PlacementsListCall) PricingTypes(pricingTypes string) *PlacementsListCall { + c.opt_["pricingTypes"] = pricingTypes + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for placements by name or ID. Wildcards (*) are allowed. +// For example, "placement*2015" will return placements with names like +// "placement June 2015", "placement May 2015", or simply "placements +// 2015". Most of the searches also add wildcards implicitly at the +// start and the end of the search string. For example, a search string +// of "placement" will match placements with name "my placement", +// "placement 2015", or simply "placement". +func (c *PlacementsListCall) SearchString(searchString string) *PlacementsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SiteIds sets the optional parameter "siteIds": Select only placements +// that are associated with these sites. +func (c *PlacementsListCall) SiteIds(siteIds int64) *PlacementsListCall { + c.opt_["siteIds"] = siteIds + return c +} + +// SizeIds sets the optional parameter "sizeIds": Select only placements +// that are associated with these sizes. +func (c *PlacementsListCall) SizeIds(sizeIds int64) *PlacementsListCall { + c.opt_["sizeIds"] = sizeIds + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *PlacementsListCall) SortField(sortField string) *PlacementsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *PlacementsListCall) SortOrder(sortOrder string) *PlacementsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementsListCall) Fields(s ...googleapi.Field) *PlacementsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PlacementsListCall) IfNoneMatch(entityTag string) *PlacementsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementsListCall) Context(ctx context.Context) *PlacementsListCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserIds"]; ok { + params.Set("advertiserIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["archived"]; ok { + params.Set("archived", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["campaignIds"]; ok { + params.Set("campaignIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["compatibilities"]; ok { + params.Set("compatibilities", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["contentCategoryIds"]; ok { + params.Set("contentCategoryIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["directorySiteIds"]; ok { + params.Set("directorySiteIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["groupIds"]; ok { + params.Set("groupIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxEndDate"]; ok { + params.Set("maxEndDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxStartDate"]; ok { + params.Set("maxStartDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["minEndDate"]; ok { + params.Set("minEndDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["minStartDate"]; ok { + params.Set("minStartDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["paymentSource"]; ok { + params.Set("paymentSource", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["placementStrategyIds"]; ok { + params.Set("placementStrategyIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pricingTypes"]; ok { + params.Set("pricingTypes", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["searchString"]; ok { + params.Set("searchString", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["siteIds"]; ok { + params.Set("siteIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sizeIds"]; ok { + params.Set("sizeIds", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placements.list" call. +// Exactly one of *PlacementsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PlacementsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlacementsListCall) Do() (*PlacementsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlacementsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of placements, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.placements.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "advertiserIds": { + // "description": "Select only placements that belong to these advertisers.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "archived": { + // "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.", + // "location": "query", + // "type": "boolean" + // }, + // "campaignIds": { + // "description": "Select only placements that belong to these campaigns.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "compatibilities": { + // "description": "Select only placements that are associated with these compatibilities. WEB and WEB_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps.IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard.", + // "enum": [ + // "APP", + // "APP_INTERSTITIAL", + // "IN_STREAM_VIDEO", + // "WEB", + // "WEB_INTERSTITIAL" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "contentCategoryIds": { + // "description": "Select only placements that are associated with these content categories.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "directorySiteIds": { + // "description": "Select only placements that are associated with these directory sites.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "groupIds": { + // "description": "Select only placements that belong to these placement groups.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only placements with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxEndDate": { + // "description": "Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as \"yyyy-MM-dd\".", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "maxStartDate": { + // "description": "Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as \"yyyy-MM-dd\".", + // "location": "query", + // "type": "string" + // }, + // "minEndDate": { + // "description": "Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as \"yyyy-MM-dd\".", + // "location": "query", + // "type": "string" + // }, + // "minStartDate": { + // "description": "Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as \"yyyy-MM-dd\".", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "paymentSource": { + // "description": "Select only placements with this payment source.", + // "enum": [ + // "PLACEMENT_AGENCY_PAID", + // "PLACEMENT_PUBLISHER_PAID" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "placementStrategyIds": { + // "description": "Select only placements that are associated with these placement strategies.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "pricingTypes": { + // "description": "Select only placements with these pricing types.", + // "enum": [ + // "PRICING_TYPE_CPA", + // "PRICING_TYPE_CPC", + // "PRICING_TYPE_CPM", + // "PRICING_TYPE_FLAT_RATE_CLICKS", + // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for placements by name or ID. Wildcards (*) are allowed. For example, \"placement*2015\" will return placements with names like \"placement June 2015\", \"placement May 2015\", or simply \"placements 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"placement\" will match placements with name \"my placement\", \"placement 2015\", or simply \"placement\".", + // "location": "query", + // "type": "string" + // }, + // "siteIds": { + // "description": "Select only placements that are associated with these sites.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "sizeIds": { + // "description": "Select only placements that are associated with these sizes.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placements", + // "response": { + // "$ref": "PlacementsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placements.patch": + +type PlacementsPatchCall struct { + s *Service + profileId int64 + id int64 + placement *Placement + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing placement. This method supports patch +// semantics. +func (r *PlacementsService) Patch(profileId int64, id int64, placement *Placement) *PlacementsPatchCall { + c := &PlacementsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.placement = placement + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementsPatchCall) Fields(s ...googleapi.Field) *PlacementsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementsPatchCall) Context(ctx context.Context) *PlacementsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placements.patch" call. +// Exactly one of *Placement or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Placement.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PlacementsPatchCall) Do() (*Placement, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Placement{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing placement. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.placements.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Placement ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placements", + // "request": { + // "$ref": "Placement" + // }, + // "response": { + // "$ref": "Placement" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.placements.update": + +type PlacementsUpdateCall struct { + s *Service + profileId int64 + placement *Placement + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing placement. +func (r *PlacementsService) Update(profileId int64, placement *Placement) *PlacementsUpdateCall { + c := &PlacementsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.placement = placement + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlacementsUpdateCall) Fields(s ...googleapi.Field) *PlacementsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlacementsUpdateCall) Context(ctx context.Context) *PlacementsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *PlacementsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.placements.update" call. +// Exactly one of *Placement or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Placement.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PlacementsUpdateCall) Do() (*Placement, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Placement{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing placement.", + // "httpMethod": "PUT", + // "id": "dfareporting.placements.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/placements", + // "request": { + // "$ref": "Placement" + // }, + // "response": { + // "$ref": "Placement" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.platformTypes.get": + +type PlatformTypesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one platform type by ID. +func (r *PlatformTypesService) Get(profileId int64, id int64) *PlatformTypesGetCall { + c := &PlatformTypesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlatformTypesGetCall) Fields(s ...googleapi.Field) *PlatformTypesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PlatformTypesGetCall) IfNoneMatch(entityTag string) *PlatformTypesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlatformTypesGetCall) Context(ctx context.Context) *PlatformTypesGetCall { + c.ctx_ = ctx + return c +} + +func (c *PlatformTypesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/platformTypes/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.platformTypes.get" call. +// Exactly one of *PlatformType or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PlatformType.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PlatformTypesGetCall) Do() (*PlatformType, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlatformType{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one platform type by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.platformTypes.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Platform type ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/platformTypes/{id}", + // "response": { + // "$ref": "PlatformType" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.platformTypes.list": + +type PlatformTypesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of platform types. +func (r *PlatformTypesService) List(profileId int64) *PlatformTypesListCall { + c := &PlatformTypesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlatformTypesListCall) Fields(s ...googleapi.Field) *PlatformTypesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PlatformTypesListCall) IfNoneMatch(entityTag string) *PlatformTypesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlatformTypesListCall) Context(ctx context.Context) *PlatformTypesListCall { + c.ctx_ = ctx + return c +} + +func (c *PlatformTypesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/platformTypes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.platformTypes.list" call. +// Exactly one of *PlatformTypesListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *PlatformTypesListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlatformTypesListCall) Do() (*PlatformTypesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlatformTypesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of platform types.", + // "httpMethod": "GET", + // "id": "dfareporting.platformTypes.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/platformTypes", + // "response": { + // "$ref": "PlatformTypesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.postalCodes.get": + +type PostalCodesGetCall struct { + s *Service + profileId int64 + code string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one postal code by ID. +func (r *PostalCodesService) Get(profileId int64, code string) *PostalCodesGetCall { + c := &PostalCodesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.code = code + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostalCodesGetCall) Fields(s ...googleapi.Field) *PostalCodesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PostalCodesGetCall) IfNoneMatch(entityTag string) *PostalCodesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostalCodesGetCall) Context(ctx context.Context) *PostalCodesGetCall { + c.ctx_ = ctx + return c +} + +func (c *PostalCodesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/postalCodes/{code}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "code": c.code, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.postalCodes.get" call. +// Exactly one of *PostalCode or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PostalCode.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PostalCodesGetCall) Do() (*PostalCode, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PostalCode{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one postal code by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.postalCodes.get", + // "parameterOrder": [ + // "profileId", + // "code" + // ], + // "parameters": { + // "code": { + // "description": "Postal code ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/postalCodes/{code}", + // "response": { + // "$ref": "PostalCode" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.postalCodes.list": + +type PostalCodesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of postal codes. +func (r *PostalCodesService) List(profileId int64) *PostalCodesListCall { + c := &PostalCodesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostalCodesListCall) Fields(s ...googleapi.Field) *PostalCodesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PostalCodesListCall) IfNoneMatch(entityTag string) *PostalCodesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostalCodesListCall) Context(ctx context.Context) *PostalCodesListCall { + c.ctx_ = ctx + return c +} + +func (c *PostalCodesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/postalCodes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.postalCodes.list" call. +// Exactly one of *PostalCodesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PostalCodesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PostalCodesListCall) Do() (*PostalCodesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PostalCodesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of postal codes.", + // "httpMethod": "GET", + // "id": "dfareporting.postalCodes.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/postalCodes", + // "response": { + // "$ref": "PostalCodesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.projects.get": + +type ProjectsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one project by ID. +func (r *ProjectsService) Get(profileId int64, id int64) *ProjectsGetCall { + c := &ProjectsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.projects.get" call. +// Exactly one of *Project or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Project.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsGetCall) Do() (*Project, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Project{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one project by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.projects.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Project ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/projects/{id}", + // "response": { + // "$ref": "Project" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.projects.list": + +type ProjectsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of projects, possibly filtered. +func (r *ProjectsService) List(profileId int64) *ProjectsListCall { + c := &ProjectsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AdvertiserIds sets the optional parameter "advertiserIds": Select +// only projects with these advertiser IDs. +func (c *ProjectsListCall) AdvertiserIds(advertiserIds int64) *ProjectsListCall { + c.opt_["advertiserIds"] = advertiserIds + return c +} + +// Ids sets the optional parameter "ids": Select only projects with +// these IDs. +func (c *ProjectsListCall) Ids(ids int64) *ProjectsListCall { + c.opt_["ids"] = ids + 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": Value of the +// nextPageToken from the previous result page. +func (c *ProjectsListCall) PageToken(pageToken string) *ProjectsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for projects by name or ID. Wildcards (*) are allowed. For +// example, "project*2015" will return projects with names like "project +// June 2015", "project April 2015", or simply "project 2015". Most of +// the searches also add wildcards implicitly at the start and the end +// of the search string. For example, a search string of "project" will +// match projects with name "my project", "project 2015", or simply +// "project". +func (c *ProjectsListCall) SearchString(searchString string) *ProjectsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *ProjectsListCall) SortField(sortField string) *ProjectsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *ProjectsListCall) SortOrder(sortOrder string) *ProjectsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsListCall) Fields(s ...googleapi.Field) *ProjectsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsListCall) IfNoneMatch(entityTag string) *ProjectsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsListCall) Context(ctx context.Context) *ProjectsListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserIds"]; ok { + params.Set("advertiserIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.projects.list" call. +// Exactly one of *ProjectsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ProjectsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsListCall) Do() (*ProjectsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProjectsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of projects, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.projects.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "advertiserIds": { + // "description": "Select only projects with these advertiser IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only projects with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for projects by name or ID. Wildcards (*) are allowed. For example, \"project*2015\" will return projects with names like \"project June 2015\", \"project April 2015\", or simply \"project 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"project\" will match projects with name \"my project\", \"project 2015\", or simply \"project\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/projects", + // "response": { + // "$ref": "ProjectsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.regions.list": + +type RegionsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of regions. +func (r *RegionsService) List(profileId int64) *RegionsListCall { + c := &RegionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall { + c.ctx_ = ctx + return c +} + +func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/regions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.regions.list" call. +// Exactly one of *RegionsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *RegionsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RegionsListCall) Do() (*RegionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RegionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of regions.", + // "httpMethod": "GET", + // "id": "dfareporting.regions.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/regions", + // "response": { + // "$ref": "RegionsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.remarketingListShares.get": + +type RemarketingListSharesGetCall struct { + s *Service + profileId int64 + remarketingListId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one remarketing list share by remarketing list ID. +func (r *RemarketingListSharesService) Get(profileId int64, remarketingListId int64) *RemarketingListSharesGetCall { + c := &RemarketingListSharesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.remarketingListId = remarketingListId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RemarketingListSharesGetCall) Fields(s ...googleapi.Field) *RemarketingListSharesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RemarketingListSharesGetCall) IfNoneMatch(entityTag string) *RemarketingListSharesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RemarketingListSharesGetCall) Context(ctx context.Context) *RemarketingListSharesGetCall { + c.ctx_ = ctx + return c +} + +func (c *RemarketingListSharesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares/{remarketingListId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "remarketingListId": strconv.FormatInt(c.remarketingListId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.remarketingListShares.get" call. +// Exactly one of *RemarketingListShare or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *RemarketingListShare.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RemarketingListSharesGetCall) Do() (*RemarketingListShare, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RemarketingListShare{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one remarketing list share by remarketing list ID.", + // "httpMethod": "GET", + // "id": "dfareporting.remarketingListShares.get", + // "parameterOrder": [ + // "profileId", + // "remarketingListId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "remarketingListId": { + // "description": "Remarketing list ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/remarketingListShares/{remarketingListId}", + // "response": { + // "$ref": "RemarketingListShare" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.remarketingListShares.patch": + +type RemarketingListSharesPatchCall struct { + s *Service + profileId int64 + remarketingListId int64 + remarketinglistshare *RemarketingListShare + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing remarketing list share. This method +// supports patch semantics. +func (r *RemarketingListSharesService) Patch(profileId int64, remarketingListId int64, remarketinglistshare *RemarketingListShare) *RemarketingListSharesPatchCall { + c := &RemarketingListSharesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.remarketingListId = remarketingListId + c.remarketinglistshare = remarketinglistshare + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RemarketingListSharesPatchCall) Fields(s ...googleapi.Field) *RemarketingListSharesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RemarketingListSharesPatchCall) Context(ctx context.Context) *RemarketingListSharesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *RemarketingListSharesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglistshare) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("remarketingListId", fmt.Sprintf("%v", c.remarketingListId)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.remarketingListShares.patch" call. +// Exactly one of *RemarketingListShare or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *RemarketingListShare.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RemarketingListSharesPatchCall) Do() (*RemarketingListShare, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RemarketingListShare{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing remarketing list share. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.remarketingListShares.patch", + // "parameterOrder": [ + // "profileId", + // "remarketingListId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "remarketingListId": { + // "description": "Remarketing list ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/remarketingListShares", + // "request": { + // "$ref": "RemarketingListShare" + // }, + // "response": { + // "$ref": "RemarketingListShare" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.remarketingListShares.update": + +type RemarketingListSharesUpdateCall struct { + s *Service + profileId int64 + remarketinglistshare *RemarketingListShare + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing remarketing list share. +func (r *RemarketingListSharesService) Update(profileId int64, remarketinglistshare *RemarketingListShare) *RemarketingListSharesUpdateCall { + c := &RemarketingListSharesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.remarketinglistshare = remarketinglistshare + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RemarketingListSharesUpdateCall) Fields(s ...googleapi.Field) *RemarketingListSharesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RemarketingListSharesUpdateCall) Context(ctx context.Context) *RemarketingListSharesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *RemarketingListSharesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglistshare) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.remarketingListShares.update" call. +// Exactly one of *RemarketingListShare or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *RemarketingListShare.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RemarketingListSharesUpdateCall) Do() (*RemarketingListShare, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RemarketingListShare{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing remarketing list share.", + // "httpMethod": "PUT", + // "id": "dfareporting.remarketingListShares.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/remarketingListShares", + // "request": { + // "$ref": "RemarketingListShare" + // }, + // "response": { + // "$ref": "RemarketingListShare" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.remarketingLists.get": + +type RemarketingListsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one remarketing list by ID. +func (r *RemarketingListsService) Get(profileId int64, id int64) *RemarketingListsGetCall { + c := &RemarketingListsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RemarketingListsGetCall) Fields(s ...googleapi.Field) *RemarketingListsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RemarketingListsGetCall) IfNoneMatch(entityTag string) *RemarketingListsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RemarketingListsGetCall) Context(ctx context.Context) *RemarketingListsGetCall { + c.ctx_ = ctx + return c +} + +func (c *RemarketingListsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.remarketingLists.get" call. +// Exactly one of *RemarketingList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *RemarketingList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RemarketingListsGetCall) Do() (*RemarketingList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RemarketingList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one remarketing list by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.remarketingLists.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Remarketing list ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/remarketingLists/{id}", + // "response": { + // "$ref": "RemarketingList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.remarketingLists.insert": + +type RemarketingListsInsertCall struct { + s *Service + profileId int64 + remarketinglist *RemarketingList + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new remarketing list. +func (r *RemarketingListsService) Insert(profileId int64, remarketinglist *RemarketingList) *RemarketingListsInsertCall { + c := &RemarketingListsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.remarketinglist = remarketinglist + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RemarketingListsInsertCall) Fields(s ...googleapi.Field) *RemarketingListsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RemarketingListsInsertCall) Context(ctx context.Context) *RemarketingListsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *RemarketingListsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.remarketingLists.insert" call. +// Exactly one of *RemarketingList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *RemarketingList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RemarketingListsInsertCall) Do() (*RemarketingList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RemarketingList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new remarketing list.", + // "httpMethod": "POST", + // "id": "dfareporting.remarketingLists.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/remarketingLists", + // "request": { + // "$ref": "RemarketingList" + // }, + // "response": { + // "$ref": "RemarketingList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.remarketingLists.list": + +type RemarketingListsListCall struct { + s *Service + profileId int64 + advertiserId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of remarketing lists, possibly filtered. +func (r *RemarketingListsService) List(profileId int64, advertiserId int64) *RemarketingListsListCall { + c := &RemarketingListsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.advertiserId = advertiserId + return c +} + +// Active sets the optional parameter "active": Select only active or +// only inactive remarketing lists. +func (c *RemarketingListsListCall) Active(active bool) *RemarketingListsListCall { + c.opt_["active"] = active + return c +} + +// FloodlightActivityId sets the optional parameter +// "floodlightActivityId": Select only remarketing lists that have this +// floodlight activity ID. +func (c *RemarketingListsListCall) FloodlightActivityId(floodlightActivityId int64) *RemarketingListsListCall { + c.opt_["floodlightActivityId"] = floodlightActivityId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *RemarketingListsListCall) MaxResults(maxResults int64) *RemarketingListsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// Name sets the optional parameter "name": Allows searching for objects +// by name or ID. Wildcards (*) are allowed. For example, "remarketing +// list*2015" will return objects with names like "remarketing list June +// 2015", "remarketing list April 2015", or simply "remarketing list +// 2015". Most of the searches also add wildcards implicitly at the +// start and the end of the search string. For example, a search string +// of "remarketing list" will match objects with name "my remarketing +// list", "remarketing list 2015", or simply "remarketing list". +func (c *RemarketingListsListCall) Name(name string) *RemarketingListsListCall { + c.opt_["name"] = name + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *RemarketingListsListCall) PageToken(pageToken string) *RemarketingListsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *RemarketingListsListCall) SortField(sortField string) *RemarketingListsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *RemarketingListsListCall) SortOrder(sortOrder string) *RemarketingListsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RemarketingListsListCall) Fields(s ...googleapi.Field) *RemarketingListsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RemarketingListsListCall) IfNoneMatch(entityTag string) *RemarketingListsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RemarketingListsListCall) Context(ctx context.Context) *RemarketingListsListCall { + c.ctx_ = ctx + return c +} + +func (c *RemarketingListsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("advertiserId", fmt.Sprintf("%v", c.advertiserId)) + if v, ok := c.opt_["active"]; ok { + params.Set("active", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["floodlightActivityId"]; ok { + params.Set("floodlightActivityId", fmt.Sprintf("%v", v)) + } + 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_["sortField"]; ok { + params.Set("sortField", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortOrder"]; ok { + params.Set("sortOrder", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.remarketingLists.list" call. +// Exactly one of *RemarketingListsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *RemarketingListsListResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RemarketingListsListCall) Do() (*RemarketingListsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RemarketingListsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of remarketing lists, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.remarketingLists.list", + // "parameterOrder": [ + // "profileId", + // "advertiserId" + // ], + // "parameters": { + // "active": { + // "description": "Select only active or only inactive remarketing lists.", + // "location": "query", + // "type": "boolean" + // }, + // "advertiserId": { + // "description": "Select only remarketing lists owned by this advertiser.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "floodlightActivityId": { + // "description": "Select only remarketing lists that have this floodlight activity ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "name": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"remarketing list*2015\" will return objects with names like \"remarketing list June 2015\", \"remarketing list April 2015\", or simply \"remarketing list 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"remarketing list\" will match objects with name \"my remarketing list\", \"remarketing list 2015\", or simply \"remarketing list\".", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/remarketingLists", + // "response": { + // "$ref": "RemarketingListsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.remarketingLists.patch": + +type RemarketingListsPatchCall struct { + s *Service + profileId int64 + id int64 + remarketinglist *RemarketingList + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing remarketing list. This method supports +// patch semantics. +func (r *RemarketingListsService) Patch(profileId int64, id int64, remarketinglist *RemarketingList) *RemarketingListsPatchCall { + c := &RemarketingListsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.remarketinglist = remarketinglist + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RemarketingListsPatchCall) Fields(s ...googleapi.Field) *RemarketingListsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RemarketingListsPatchCall) Context(ctx context.Context) *RemarketingListsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *RemarketingListsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.remarketingLists.patch" call. +// Exactly one of *RemarketingList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *RemarketingList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RemarketingListsPatchCall) Do() (*RemarketingList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RemarketingList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing remarketing list. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.remarketingLists.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Remarketing list ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/remarketingLists", + // "request": { + // "$ref": "RemarketingList" + // }, + // "response": { + // "$ref": "RemarketingList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.remarketingLists.update": + +type RemarketingListsUpdateCall struct { + s *Service + profileId int64 + remarketinglist *RemarketingList + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing remarketing list. +func (r *RemarketingListsService) Update(profileId int64, remarketinglist *RemarketingList) *RemarketingListsUpdateCall { + c := &RemarketingListsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.remarketinglist = remarketinglist + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RemarketingListsUpdateCall) Fields(s ...googleapi.Field) *RemarketingListsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RemarketingListsUpdateCall) Context(ctx context.Context) *RemarketingListsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *RemarketingListsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.remarketingLists.update" call. +// Exactly one of *RemarketingList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *RemarketingList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RemarketingListsUpdateCall) Do() (*RemarketingList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RemarketingList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing remarketing list.", + // "httpMethod": "PUT", + // "id": "dfareporting.remarketingLists.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/remarketingLists", + // "request": { + // "$ref": "RemarketingList" + // }, + // "response": { + // "$ref": "RemarketingList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.reports.delete": + +type ReportsDeleteCall struct { + s *Service + profileId int64 + reportId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsDeleteCall) Fields(s ...googleapi.Field) *ReportsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsDeleteCall) Context(ctx context.Context) *ReportsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.delete" call. +func (c *ReportsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsGetCall) Fields(s ...googleapi.Field) *ReportsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsGetCall) IfNoneMatch(entityTag string) *ReportsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsGetCall) Context(ctx context.Context) *ReportsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.get" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsGetCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsInsertCall) Fields(s ...googleapi.Field) *ReportsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsInsertCall) Context(ctx context.Context) *ReportsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.insert" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsInsertCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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'. +// +// Possible values: +// "ALL" - All reports in account. +// "MINE" (default) - My reports. +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. +// +// Possible values: +// "ID" - Sort by report ID. +// "LAST_MODIFIED_TIME" (default) - Sort by 'lastModifiedTime' field. +// "NAME" - Sort by name of reports. +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'. +// +// Possible values: +// "ASCENDING" - Ascending order. +// "DESCENDING" (default) - Descending order. +func (c *ReportsListCall) SortOrder(sortOrder string) *ReportsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsListCall) Fields(s ...googleapi.Field) *ReportsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsListCall) IfNoneMatch(entityTag string) *ReportsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsListCall) Context(ctx context.Context) *ReportsListCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.list" call. +// Exactly one of *ReportList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ReportList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReportsListCall) Do() (*ReportList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ReportList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsPatchCall) Fields(s ...googleapi.Field) *ReportsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsPatchCall) Context(ctx context.Context) *ReportsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.patch" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsPatchCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsRunCall) Fields(s ...googleapi.Field) *ReportsRunCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsRunCall) Context(ctx context.Context) *ReportsRunCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsRunCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["synchronous"]; ok { + params.Set("synchronous", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/run") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.run" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ReportsRunCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsUpdateCall) Fields(s ...googleapi.Field) *ReportsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsUpdateCall) Context(ctx context.Context) *ReportsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.update" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsUpdateCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsCompatibleFieldsQueryCall) Fields(s ...googleapi.Field) *ReportsCompatibleFieldsQueryCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsCompatibleFieldsQueryCall) Context(ctx context.Context) *ReportsCompatibleFieldsQueryCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsCompatibleFieldsQueryCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/compatiblefields/query") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.compatibleFields.query" call. +// Exactly one of *CompatibleFields or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CompatibleFields.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReportsCompatibleFieldsQueryCall) Do() (*CompatibleFields, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CompatibleFields{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsFilesGetCall) Fields(s ...googleapi.Field) *ReportsFilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsFilesGetCall) IfNoneMatch(entityTag string) *ReportsFilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsFilesGetCall) Context(ctx context.Context) *ReportsFilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsFilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files/{fileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + "fileId": strconv.FormatInt(c.fileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *ReportsFilesGetCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "dfareporting.reports.files.get" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ReportsFilesGetCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "ID" - Sort by file ID. +// "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field. +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'. +// +// Possible values: +// "ASCENDING" - Ascending order. +// "DESCENDING" (default) - Descending order. +func (c *ReportsFilesListCall) SortOrder(sortOrder string) *ReportsFilesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsFilesListCall) Fields(s ...googleapi.Field) *ReportsFilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsFilesListCall) IfNoneMatch(entityTag string) *ReportsFilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsFilesListCall) Context(ctx context.Context) *ReportsFilesListCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsFilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "reportId": strconv.FormatInt(c.reportId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.reports.files.list" call. +// Exactly one of *FileList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *FileList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReportsFilesListCall) Do() (*FileList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FileList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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.sites.get": + +type SitesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one site by ID. +func (r *SitesService) Get(profileId int64, id int64) *SitesGetCall { + c := &SitesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SitesGetCall) Fields(s ...googleapi.Field) *SitesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SitesGetCall) IfNoneMatch(entityTag string) *SitesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SitesGetCall) Context(ctx context.Context) *SitesGetCall { + c.ctx_ = ctx + return c +} + +func (c *SitesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.sites.get" call. +// Exactly one of *Site or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Site.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *SitesGetCall) Do() (*Site, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Site{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one site by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.sites.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Site ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/sites/{id}", + // "response": { + // "$ref": "Site" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.sites.insert": + +type SitesInsertCall struct { + s *Service + profileId int64 + site *Site + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new site. +func (r *SitesService) Insert(profileId int64, site *Site) *SitesInsertCall { + c := &SitesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.site = site + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SitesInsertCall) Fields(s ...googleapi.Field) *SitesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SitesInsertCall) Context(ctx context.Context) *SitesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *SitesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.site) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.sites.insert" call. +// Exactly one of *Site or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Site.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *SitesInsertCall) Do() (*Site, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Site{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new site.", + // "httpMethod": "POST", + // "id": "dfareporting.sites.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/sites", + // "request": { + // "$ref": "Site" + // }, + // "response": { + // "$ref": "Site" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.sites.list": + +type SitesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of sites, possibly filtered. +func (r *SitesService) List(profileId int64) *SitesListCall { + c := &SitesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AcceptsInStreamVideoPlacements sets the optional parameter +// "acceptsInStreamVideoPlacements": This search filter is no longer +// supported and will have no effect on the results returned. +func (c *SitesListCall) AcceptsInStreamVideoPlacements(acceptsInStreamVideoPlacements bool) *SitesListCall { + c.opt_["acceptsInStreamVideoPlacements"] = acceptsInStreamVideoPlacements + return c +} + +// AcceptsInterstitialPlacements sets the optional parameter +// "acceptsInterstitialPlacements": This search filter is no longer +// supported and will have no effect on the results returned. +func (c *SitesListCall) AcceptsInterstitialPlacements(acceptsInterstitialPlacements bool) *SitesListCall { + c.opt_["acceptsInterstitialPlacements"] = acceptsInterstitialPlacements + return c +} + +// AcceptsPublisherPaidPlacements sets the optional parameter +// "acceptsPublisherPaidPlacements": Select only sites that accept +// publisher paid placements. +func (c *SitesListCall) AcceptsPublisherPaidPlacements(acceptsPublisherPaidPlacements bool) *SitesListCall { + c.opt_["acceptsPublisherPaidPlacements"] = acceptsPublisherPaidPlacements + return c +} + +// AdWordsSite sets the optional parameter "adWordsSite": Select only +// AdWords sites. +func (c *SitesListCall) AdWordsSite(adWordsSite bool) *SitesListCall { + c.opt_["adWordsSite"] = adWordsSite + return c +} + +// Approved sets the optional parameter "approved": Select only approved +// sites. +func (c *SitesListCall) Approved(approved bool) *SitesListCall { + c.opt_["approved"] = approved + return c +} + +// CampaignIds sets the optional parameter "campaignIds": Select only +// sites with these campaign IDs. +func (c *SitesListCall) CampaignIds(campaignIds int64) *SitesListCall { + c.opt_["campaignIds"] = campaignIds + return c +} + +// DirectorySiteIds sets the optional parameter "directorySiteIds": +// Select only sites with these directory site IDs. +func (c *SitesListCall) DirectorySiteIds(directorySiteIds int64) *SitesListCall { + c.opt_["directorySiteIds"] = directorySiteIds + return c +} + +// Ids sets the optional parameter "ids": Select only sites with these +// IDs. +func (c *SitesListCall) Ids(ids int64) *SitesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *SitesListCall) MaxResults(maxResults int64) *SitesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *SitesListCall) PageToken(pageToken string) *SitesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name, ID or keyName. Wildcards (*) are +// allowed. For example, "site*2015" will return objects with names like +// "site June 2015", "site April 2015", or simply "site 2015". Most of +// the searches also add wildcards implicitly at the start and the end +// of the search string. For example, a search string of "site" will +// match objects with name "my site", "site 2015", or simply "site". +func (c *SitesListCall) SearchString(searchString string) *SitesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *SitesListCall) SortField(sortField string) *SitesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *SitesListCall) SortOrder(sortOrder string) *SitesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// SubaccountId sets the optional parameter "subaccountId": Select only +// sites with this subaccount ID. +func (c *SitesListCall) SubaccountId(subaccountId int64) *SitesListCall { + c.opt_["subaccountId"] = subaccountId + return c +} + +// UnmappedSite sets the optional parameter "unmappedSite": Select only +// sites that have not been mapped to a directory site. +func (c *SitesListCall) UnmappedSite(unmappedSite bool) *SitesListCall { + c.opt_["unmappedSite"] = unmappedSite + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SitesListCall) Fields(s ...googleapi.Field) *SitesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SitesListCall) IfNoneMatch(entityTag string) *SitesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SitesListCall) Context(ctx context.Context) *SitesListCall { + c.ctx_ = ctx + return c +} + +func (c *SitesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["acceptsInStreamVideoPlacements"]; ok { + params.Set("acceptsInStreamVideoPlacements", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["acceptsInterstitialPlacements"]; ok { + params.Set("acceptsInterstitialPlacements", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["acceptsPublisherPaidPlacements"]; ok { + params.Set("acceptsPublisherPaidPlacements", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["adWordsSite"]; ok { + params.Set("adWordsSite", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["approved"]; ok { + params.Set("approved", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["campaignIds"]; ok { + params.Set("campaignIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["directorySiteIds"]; ok { + params.Set("directorySiteIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["subaccountId"]; ok { + params.Set("subaccountId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["unmappedSite"]; ok { + params.Set("unmappedSite", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.sites.list" call. +// Exactly one of *SitesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SitesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SitesListCall) Do() (*SitesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SitesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of sites, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.sites.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "acceptsInStreamVideoPlacements": { + // "description": "This search filter is no longer supported and will have no effect on the results returned.", + // "location": "query", + // "type": "boolean" + // }, + // "acceptsInterstitialPlacements": { + // "description": "This search filter is no longer supported and will have no effect on the results returned.", + // "location": "query", + // "type": "boolean" + // }, + // "acceptsPublisherPaidPlacements": { + // "description": "Select only sites that accept publisher paid placements.", + // "location": "query", + // "type": "boolean" + // }, + // "adWordsSite": { + // "description": "Select only AdWords sites.", + // "location": "query", + // "type": "boolean" + // }, + // "approved": { + // "description": "Select only approved sites.", + // "location": "query", + // "type": "boolean" + // }, + // "campaignIds": { + // "description": "Select only sites with these campaign IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "directorySiteIds": { + // "description": "Select only sites with these directory site IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "ids": { + // "description": "Select only sites with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name, ID or keyName. Wildcards (*) are allowed. For example, \"site*2015\" will return objects with names like \"site June 2015\", \"site April 2015\", or simply \"site 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"site\" will match objects with name \"my site\", \"site 2015\", or simply \"site\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "subaccountId": { + // "description": "Select only sites with this subaccount ID.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "unmappedSite": { + // "description": "Select only sites that have not been mapped to a directory site.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "userprofiles/{profileId}/sites", + // "response": { + // "$ref": "SitesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.sites.patch": + +type SitesPatchCall struct { + s *Service + profileId int64 + id int64 + site *Site + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing site. This method supports patch +// semantics. +func (r *SitesService) Patch(profileId int64, id int64, site *Site) *SitesPatchCall { + c := &SitesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.site = site + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SitesPatchCall) Fields(s ...googleapi.Field) *SitesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SitesPatchCall) Context(ctx context.Context) *SitesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *SitesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.site) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.sites.patch" call. +// Exactly one of *Site or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Site.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *SitesPatchCall) Do() (*Site, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Site{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing site. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.sites.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Site ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/sites", + // "request": { + // "$ref": "Site" + // }, + // "response": { + // "$ref": "Site" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.sites.update": + +type SitesUpdateCall struct { + s *Service + profileId int64 + site *Site + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing site. +func (r *SitesService) Update(profileId int64, site *Site) *SitesUpdateCall { + c := &SitesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.site = site + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SitesUpdateCall) Fields(s ...googleapi.Field) *SitesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SitesUpdateCall) Context(ctx context.Context) *SitesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *SitesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.site) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.sites.update" call. +// Exactly one of *Site or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Site.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *SitesUpdateCall) Do() (*Site, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Site{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing site.", + // "httpMethod": "PUT", + // "id": "dfareporting.sites.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/sites", + // "request": { + // "$ref": "Site" + // }, + // "response": { + // "$ref": "Site" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.sizes.get": + +type SizesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one size by ID. +func (r *SizesService) Get(profileId int64, id int64) *SizesGetCall { + c := &SizesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SizesGetCall) Fields(s ...googleapi.Field) *SizesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SizesGetCall) IfNoneMatch(entityTag string) *SizesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SizesGetCall) Context(ctx context.Context) *SizesGetCall { + c.ctx_ = ctx + return c +} + +func (c *SizesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.sizes.get" call. +// Exactly one of *Size or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Size.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *SizesGetCall) Do() (*Size, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Size{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one size by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.sizes.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Size ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/sizes/{id}", + // "response": { + // "$ref": "Size" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.sizes.insert": + +type SizesInsertCall struct { + s *Service + profileId int64 + size *Size + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new size. +func (r *SizesService) Insert(profileId int64, size *Size) *SizesInsertCall { + c := &SizesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.size = size + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SizesInsertCall) Fields(s ...googleapi.Field) *SizesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SizesInsertCall) Context(ctx context.Context) *SizesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *SizesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.size) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.sizes.insert" call. +// Exactly one of *Size or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Size.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *SizesInsertCall) Do() (*Size, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Size{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new size.", + // "httpMethod": "POST", + // "id": "dfareporting.sizes.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/sizes", + // "request": { + // "$ref": "Size" + // }, + // "response": { + // "$ref": "Size" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.sizes.list": + +type SizesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of sizes, possibly filtered. +func (r *SizesService) List(profileId int64) *SizesListCall { + c := &SizesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Height sets the optional parameter "height": Select only sizes with +// this height. +func (c *SizesListCall) Height(height int64) *SizesListCall { + c.opt_["height"] = height + return c +} + +// IabStandard sets the optional parameter "iabStandard": Select only +// IAB standard sizes. +func (c *SizesListCall) IabStandard(iabStandard bool) *SizesListCall { + c.opt_["iabStandard"] = iabStandard + return c +} + +// Ids sets the optional parameter "ids": Select only sizes with these +// IDs. +func (c *SizesListCall) Ids(ids int64) *SizesListCall { + c.opt_["ids"] = ids + return c +} + +// Width sets the optional parameter "width": Select only sizes with +// this width. +func (c *SizesListCall) Width(width int64) *SizesListCall { + c.opt_["width"] = width + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SizesListCall) Fields(s ...googleapi.Field) *SizesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SizesListCall) IfNoneMatch(entityTag string) *SizesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SizesListCall) Context(ctx context.Context) *SizesListCall { + c.ctx_ = ctx + return c +} + +func (c *SizesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["height"]; ok { + params.Set("height", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["iabStandard"]; ok { + params.Set("iabStandard", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["width"]; ok { + params.Set("width", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.sizes.list" call. +// Exactly one of *SizesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SizesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SizesListCall) Do() (*SizesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SizesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of sizes, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.sizes.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "height": { + // "description": "Select only sizes with this height.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "iabStandard": { + // "description": "Select only IAB standard sizes.", + // "location": "query", + // "type": "boolean" + // }, + // "ids": { + // "description": "Select only sizes with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "width": { + // "description": "Select only sizes with this width.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // } + // }, + // "path": "userprofiles/{profileId}/sizes", + // "response": { + // "$ref": "SizesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.subaccounts.get": + +type SubaccountsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one subaccount by ID. +func (r *SubaccountsService) Get(profileId int64, id int64) *SubaccountsGetCall { + c := &SubaccountsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubaccountsGetCall) Fields(s ...googleapi.Field) *SubaccountsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SubaccountsGetCall) IfNoneMatch(entityTag string) *SubaccountsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubaccountsGetCall) Context(ctx context.Context) *SubaccountsGetCall { + c.ctx_ = ctx + return c +} + +func (c *SubaccountsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.subaccounts.get" call. +// Exactly one of *Subaccount or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subaccount.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubaccountsGetCall) Do() (*Subaccount, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subaccount{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one subaccount by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.subaccounts.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Subaccount ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/subaccounts/{id}", + // "response": { + // "$ref": "Subaccount" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.subaccounts.insert": + +type SubaccountsInsertCall struct { + s *Service + profileId int64 + subaccount *Subaccount + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new subaccount. +func (r *SubaccountsService) Insert(profileId int64, subaccount *Subaccount) *SubaccountsInsertCall { + c := &SubaccountsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.subaccount = subaccount + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubaccountsInsertCall) Fields(s ...googleapi.Field) *SubaccountsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubaccountsInsertCall) Context(ctx context.Context) *SubaccountsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *SubaccountsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.subaccounts.insert" call. +// Exactly one of *Subaccount or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subaccount.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubaccountsInsertCall) Do() (*Subaccount, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subaccount{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new subaccount.", + // "httpMethod": "POST", + // "id": "dfareporting.subaccounts.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/subaccounts", + // "request": { + // "$ref": "Subaccount" + // }, + // "response": { + // "$ref": "Subaccount" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.subaccounts.list": + +type SubaccountsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Gets a list of subaccounts, possibly filtered. +func (r *SubaccountsService) List(profileId int64) *SubaccountsListCall { + c := &SubaccountsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Ids sets the optional parameter "ids": Select only subaccounts with +// these IDs. +func (c *SubaccountsListCall) Ids(ids int64) *SubaccountsListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *SubaccountsListCall) MaxResults(maxResults int64) *SubaccountsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *SubaccountsListCall) PageToken(pageToken string) *SubaccountsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "subaccount*2015" will return objects with names like +// "subaccount June 2015", "subaccount April 2015", or simply +// "subaccount 2015". Most of the searches also add wildcards implicitly +// at the start and the end of the search string. For example, a search +// string of "subaccount" will match objects with name "my subaccount", +// "subaccount 2015", or simply "subaccount". +func (c *SubaccountsListCall) SearchString(searchString string) *SubaccountsListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *SubaccountsListCall) SortField(sortField string) *SubaccountsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *SubaccountsListCall) SortOrder(sortOrder string) *SubaccountsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubaccountsListCall) Fields(s ...googleapi.Field) *SubaccountsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SubaccountsListCall) IfNoneMatch(entityTag string) *SubaccountsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubaccountsListCall) Context(ctx context.Context) *SubaccountsListCall { + c.ctx_ = ctx + return c +} + +func (c *SubaccountsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.subaccounts.list" call. +// Exactly one of *SubaccountsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SubaccountsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SubaccountsListCall) Do() (*SubaccountsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SubaccountsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a list of subaccounts, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.subaccounts.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "ids": { + // "description": "Select only subaccounts with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"subaccount*2015\" will return objects with names like \"subaccount June 2015\", \"subaccount April 2015\", or simply \"subaccount 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"subaccount\" will match objects with name \"my subaccount\", \"subaccount 2015\", or simply \"subaccount\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/subaccounts", + // "response": { + // "$ref": "SubaccountsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.subaccounts.patch": + +type SubaccountsPatchCall struct { + s *Service + profileId int64 + id int64 + subaccount *Subaccount + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing subaccount. This method supports patch +// semantics. +func (r *SubaccountsService) Patch(profileId int64, id int64, subaccount *Subaccount) *SubaccountsPatchCall { + c := &SubaccountsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.subaccount = subaccount + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubaccountsPatchCall) Fields(s ...googleapi.Field) *SubaccountsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubaccountsPatchCall) Context(ctx context.Context) *SubaccountsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *SubaccountsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.subaccounts.patch" call. +// Exactly one of *Subaccount or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subaccount.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubaccountsPatchCall) Do() (*Subaccount, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subaccount{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing subaccount. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.subaccounts.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Subaccount ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/subaccounts", + // "request": { + // "$ref": "Subaccount" + // }, + // "response": { + // "$ref": "Subaccount" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.subaccounts.update": + +type SubaccountsUpdateCall struct { + s *Service + profileId int64 + subaccount *Subaccount + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing subaccount. +func (r *SubaccountsService) Update(profileId int64, subaccount *Subaccount) *SubaccountsUpdateCall { + c := &SubaccountsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.subaccount = subaccount + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubaccountsUpdateCall) Fields(s ...googleapi.Field) *SubaccountsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubaccountsUpdateCall) Context(ctx context.Context) *SubaccountsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *SubaccountsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.subaccounts.update" call. +// Exactly one of *Subaccount or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subaccount.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubaccountsUpdateCall) Do() (*Subaccount, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subaccount{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing subaccount.", + // "httpMethod": "PUT", + // "id": "dfareporting.subaccounts.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/subaccounts", + // "request": { + // "$ref": "Subaccount" + // }, + // "response": { + // "$ref": "Subaccount" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.targetableRemarketingLists.get": + +type TargetableRemarketingListsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one remarketing list by ID. +func (r *TargetableRemarketingListsService) Get(profileId int64, id int64) *TargetableRemarketingListsGetCall { + c := &TargetableRemarketingListsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetableRemarketingListsGetCall) Fields(s ...googleapi.Field) *TargetableRemarketingListsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetableRemarketingListsGetCall) IfNoneMatch(entityTag string) *TargetableRemarketingListsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetableRemarketingListsGetCall) Context(ctx context.Context) *TargetableRemarketingListsGetCall { + c.ctx_ = ctx + return c +} + +func (c *TargetableRemarketingListsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetableRemarketingLists/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.targetableRemarketingLists.get" call. +// Exactly one of *TargetableRemarketingList or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TargetableRemarketingList.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetableRemarketingListsGetCall) Do() (*TargetableRemarketingList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetableRemarketingList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one remarketing list by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.targetableRemarketingLists.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "Remarketing list ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/targetableRemarketingLists/{id}", + // "response": { + // "$ref": "TargetableRemarketingList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.targetableRemarketingLists.list": + +type TargetableRemarketingListsListCall struct { + s *Service + profileId int64 + advertiserId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of targetable remarketing lists, possibly +// filtered. +func (r *TargetableRemarketingListsService) List(profileId int64, advertiserId int64) *TargetableRemarketingListsListCall { + c := &TargetableRemarketingListsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.advertiserId = advertiserId + return c +} + +// Active sets the optional parameter "active": Select only active or +// only inactive targetable remarketing lists. +func (c *TargetableRemarketingListsListCall) Active(active bool) *TargetableRemarketingListsListCall { + c.opt_["active"] = active + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *TargetableRemarketingListsListCall) MaxResults(maxResults int64) *TargetableRemarketingListsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// Name sets the optional parameter "name": Allows searching for objects +// by name or ID. Wildcards (*) are allowed. For example, "remarketing +// list*2015" will return objects with names like "remarketing list June +// 2015", "remarketing list April 2015", or simply "remarketing list +// 2015". Most of the searches also add wildcards implicitly at the +// start and the end of the search string. For example, a search string +// of "remarketing list" will match objects with name "my remarketing +// list", "remarketing list 2015", or simply "remarketing list". +func (c *TargetableRemarketingListsListCall) Name(name string) *TargetableRemarketingListsListCall { + c.opt_["name"] = name + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *TargetableRemarketingListsListCall) PageToken(pageToken string) *TargetableRemarketingListsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *TargetableRemarketingListsListCall) SortField(sortField string) *TargetableRemarketingListsListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *TargetableRemarketingListsListCall) SortOrder(sortOrder string) *TargetableRemarketingListsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetableRemarketingListsListCall) Fields(s ...googleapi.Field) *TargetableRemarketingListsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetableRemarketingListsListCall) IfNoneMatch(entityTag string) *TargetableRemarketingListsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TargetableRemarketingListsListCall) Context(ctx context.Context) *TargetableRemarketingListsListCall { + c.ctx_ = ctx + return c +} + +func (c *TargetableRemarketingListsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("advertiserId", fmt.Sprintf("%v", c.advertiserId)) + if v, ok := c.opt_["active"]; ok { + params.Set("active", fmt.Sprintf("%v", v)) + } + 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_["sortField"]; ok { + params.Set("sortField", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sortOrder"]; ok { + params.Set("sortOrder", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetableRemarketingLists") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.targetableRemarketingLists.list" call. +// Exactly one of *TargetableRemarketingListsListResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *TargetableRemarketingListsListResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetableRemarketingListsListCall) Do() (*TargetableRemarketingListsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TargetableRemarketingListsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of targetable remarketing lists, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.targetableRemarketingLists.list", + // "parameterOrder": [ + // "profileId", + // "advertiserId" + // ], + // "parameters": { + // "active": { + // "description": "Select only active or only inactive targetable remarketing lists.", + // "location": "query", + // "type": "boolean" + // }, + // "advertiserId": { + // "description": "Select only targetable remarketing lists targetable by these advertisers.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "name": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"remarketing list*2015\" will return objects with names like \"remarketing list June 2015\", \"remarketing list April 2015\", or simply \"remarketing list 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"remarketing list\" will match objects with name \"my remarketing list\", \"remarketing list 2015\", or simply \"remarketing list\".", + // "location": "query", + // "type": "string" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/targetableRemarketingLists", + // "response": { + // "$ref": "TargetableRemarketingListsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userProfiles.get": + +type UserProfilesGetCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserProfilesGetCall) Fields(s ...googleapi.Field) *UserProfilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserProfilesGetCall) IfNoneMatch(entityTag string) *UserProfilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserProfilesGetCall) Context(ctx context.Context) *UserProfilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *UserProfilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userProfiles.get" call. +// Exactly one of *UserProfile or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UserProfile.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserProfilesGetCall) Do() (*UserProfile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserProfile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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", + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userProfiles.list": + +type UserProfilesListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserProfilesListCall) Fields(s ...googleapi.Field) *UserProfilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserProfilesListCall) IfNoneMatch(entityTag string) *UserProfilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserProfilesListCall) Context(ctx context.Context) *UserProfilesListCall { + c.ctx_ = ctx + return c +} + +func (c *UserProfilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userProfiles.list" call. +// Exactly one of *UserProfileList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UserProfileList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UserProfilesListCall) Do() (*UserProfileList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserProfileList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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", + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRolePermissionGroups.get": + +type UserRolePermissionGroupsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one user role permission group by ID. +func (r *UserRolePermissionGroupsService) Get(profileId int64, id int64) *UserRolePermissionGroupsGetCall { + c := &UserRolePermissionGroupsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolePermissionGroupsGetCall) Fields(s ...googleapi.Field) *UserRolePermissionGroupsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserRolePermissionGroupsGetCall) IfNoneMatch(entityTag string) *UserRolePermissionGroupsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolePermissionGroupsGetCall) Context(ctx context.Context) *UserRolePermissionGroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolePermissionGroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissionGroups/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRolePermissionGroups.get" call. +// Exactly one of *UserRolePermissionGroup or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *UserRolePermissionGroup.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UserRolePermissionGroupsGetCall) Do() (*UserRolePermissionGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRolePermissionGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one user role permission group by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.userRolePermissionGroups.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "User role permission group ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRolePermissionGroups/{id}", + // "response": { + // "$ref": "UserRolePermissionGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRolePermissionGroups.list": + +type UserRolePermissionGroupsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Gets a list of all supported user role permission groups. +func (r *UserRolePermissionGroupsService) List(profileId int64) *UserRolePermissionGroupsListCall { + c := &UserRolePermissionGroupsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolePermissionGroupsListCall) Fields(s ...googleapi.Field) *UserRolePermissionGroupsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserRolePermissionGroupsListCall) IfNoneMatch(entityTag string) *UserRolePermissionGroupsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolePermissionGroupsListCall) Context(ctx context.Context) *UserRolePermissionGroupsListCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolePermissionGroupsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissionGroups") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRolePermissionGroups.list" call. +// Exactly one of *UserRolePermissionGroupsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *UserRolePermissionGroupsListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *UserRolePermissionGroupsListCall) Do() (*UserRolePermissionGroupsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRolePermissionGroupsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a list of all supported user role permission groups.", + // "httpMethod": "GET", + // "id": "dfareporting.userRolePermissionGroups.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRolePermissionGroups", + // "response": { + // "$ref": "UserRolePermissionGroupsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRolePermissions.get": + +type UserRolePermissionsGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one user role permission by ID. +func (r *UserRolePermissionsService) Get(profileId int64, id int64) *UserRolePermissionsGetCall { + c := &UserRolePermissionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolePermissionsGetCall) Fields(s ...googleapi.Field) *UserRolePermissionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserRolePermissionsGetCall) IfNoneMatch(entityTag string) *UserRolePermissionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolePermissionsGetCall) Context(ctx context.Context) *UserRolePermissionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolePermissionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissions/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRolePermissions.get" call. +// Exactly one of *UserRolePermission or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *UserRolePermission.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UserRolePermissionsGetCall) Do() (*UserRolePermission, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRolePermission{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one user role permission by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.userRolePermissions.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "User role permission ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRolePermissions/{id}", + // "response": { + // "$ref": "UserRolePermission" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRolePermissions.list": + +type UserRolePermissionsListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Gets a list of user role permissions, possibly filtered. +func (r *UserRolePermissionsService) List(profileId int64) *UserRolePermissionsListCall { + c := &UserRolePermissionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// Ids sets the optional parameter "ids": Select only user role +// permissions with these IDs. +func (c *UserRolePermissionsListCall) Ids(ids int64) *UserRolePermissionsListCall { + c.opt_["ids"] = ids + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolePermissionsListCall) Fields(s ...googleapi.Field) *UserRolePermissionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserRolePermissionsListCall) IfNoneMatch(entityTag string) *UserRolePermissionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolePermissionsListCall) Context(ctx context.Context) *UserRolePermissionsListCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolePermissionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRolePermissions.list" call. +// Exactly one of *UserRolePermissionsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *UserRolePermissionsListResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UserRolePermissionsListCall) Do() (*UserRolePermissionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRolePermissionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a list of user role permissions, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.userRolePermissions.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "ids": { + // "description": "Select only user role permissions with these IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRolePermissions", + // "response": { + // "$ref": "UserRolePermissionsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRoles.delete": + +type UserRolesDeleteCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing user role. +func (r *UserRolesService) Delete(profileId int64, id int64) *UserRolesDeleteCall { + c := &UserRolesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolesDeleteCall) Fields(s ...googleapi.Field) *UserRolesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolesDeleteCall) Context(ctx context.Context) *UserRolesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRoles.delete" call. +func (c *UserRolesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing user role.", + // "httpMethod": "DELETE", + // "id": "dfareporting.userRoles.delete", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "User role ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRoles/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRoles.get": + +type UserRolesGetCall struct { + s *Service + profileId int64 + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets one user role by ID. +func (r *UserRolesService) Get(profileId int64, id int64) *UserRolesGetCall { + c := &UserRolesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolesGetCall) Fields(s ...googleapi.Field) *UserRolesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserRolesGetCall) IfNoneMatch(entityTag string) *UserRolesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolesGetCall) Context(ctx context.Context) *UserRolesGetCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRoles.get" call. +// Exactly one of *UserRole or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *UserRole.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserRolesGetCall) Do() (*UserRole, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRole{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one user role by ID.", + // "httpMethod": "GET", + // "id": "dfareporting.userRoles.get", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "User role ID.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRoles/{id}", + // "response": { + // "$ref": "UserRole" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRoles.insert": + +type UserRolesInsertCall struct { + s *Service + profileId int64 + userrole *UserRole + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new user role. +func (r *UserRolesService) Insert(profileId int64, userrole *UserRole) *UserRolesInsertCall { + c := &UserRolesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.userrole = userrole + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolesInsertCall) Fields(s ...googleapi.Field) *UserRolesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolesInsertCall) Context(ctx context.Context) *UserRolesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRoles.insert" call. +// Exactly one of *UserRole or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *UserRole.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserRolesInsertCall) Do() (*UserRole, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRole{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new user role.", + // "httpMethod": "POST", + // "id": "dfareporting.userRoles.insert", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRoles", + // "request": { + // "$ref": "UserRole" + // }, + // "response": { + // "$ref": "UserRole" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRoles.list": + +type UserRolesListCall struct { + s *Service + profileId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of user roles, possibly filtered. +func (r *UserRolesService) List(profileId int64) *UserRolesListCall { + c := &UserRolesListCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + return c +} + +// AccountUserRoleOnly sets the optional parameter +// "accountUserRoleOnly": Select only account level user roles not +// associated with any specific subaccount. +func (c *UserRolesListCall) AccountUserRoleOnly(accountUserRoleOnly bool) *UserRolesListCall { + c.opt_["accountUserRoleOnly"] = accountUserRoleOnly + return c +} + +// Ids sets the optional parameter "ids": Select only user roles with +// the specified IDs. +func (c *UserRolesListCall) Ids(ids int64) *UserRolesListCall { + c.opt_["ids"] = ids + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of results to return. +func (c *UserRolesListCall) MaxResults(maxResults int64) *UserRolesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Value of the +// nextPageToken from the previous result page. +func (c *UserRolesListCall) PageToken(pageToken string) *UserRolesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// SearchString sets the optional parameter "searchString": Allows +// searching for objects by name or ID. Wildcards (*) are allowed. For +// example, "userrole*2015" will return objects with names like +// "userrole June 2015", "userrole April 2015", or simply "userrole +// 2015". Most of the searches also add wildcards implicitly at the +// start and the end of the search string. For example, a search string +// of "userrole" will match objects with name "my userrole", "userrole +// 2015", or simply "userrole". +func (c *UserRolesListCall) SearchString(searchString string) *UserRolesListCall { + c.opt_["searchString"] = searchString + return c +} + +// SortField sets the optional parameter "sortField": Field by which to +// sort the list. +// +// Possible values: +// "ID" +// "NAME" +func (c *UserRolesListCall) SortField(sortField string) *UserRolesListCall { + c.opt_["sortField"] = sortField + return c +} + +// SortOrder sets the optional parameter "sortOrder": Order of sorted +// results, default is ASCENDING. +// +// Possible values: +// "ASCENDING" +// "DESCENDING" +func (c *UserRolesListCall) SortOrder(sortOrder string) *UserRolesListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// SubaccountId sets the optional parameter "subaccountId": Select only +// user roles that belong to this subaccount. +func (c *UserRolesListCall) SubaccountId(subaccountId int64) *UserRolesListCall { + c.opt_["subaccountId"] = subaccountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolesListCall) Fields(s ...googleapi.Field) *UserRolesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserRolesListCall) IfNoneMatch(entityTag string) *UserRolesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolesListCall) Context(ctx context.Context) *UserRolesListCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["accountUserRoleOnly"]; ok { + params.Set("accountUserRoleOnly", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["ids"]; ok { + params.Set("ids", 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_["searchString"]; ok { + params.Set("searchString", 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)) + } + if v, ok := c.opt_["subaccountId"]; ok { + params.Set("subaccountId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRoles.list" call. +// Exactly one of *UserRolesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *UserRolesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UserRolesListCall) Do() (*UserRolesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRolesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of user roles, possibly filtered.", + // "httpMethod": "GET", + // "id": "dfareporting.userRoles.list", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "accountUserRoleOnly": { + // "description": "Select only account level user roles not associated with any specific subaccount.", + // "location": "query", + // "type": "boolean" + // }, + // "ids": { + // "description": "Select only user roles with the specified IDs.", + // "format": "int64", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "Maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Value of the nextPageToken from the previous result page.", + // "location": "query", + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "searchString": { + // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"userrole*2015\" will return objects with names like \"userrole June 2015\", \"userrole April 2015\", or simply \"userrole 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"userrole\" will match objects with name \"my userrole\", \"userrole 2015\", or simply \"userrole\".", + // "location": "query", + // "type": "string" + // }, + // "sortField": { + // "description": "Field by which to sort the list.", + // "enum": [ + // "ID", + // "NAME" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "sortOrder": { + // "description": "Order of sorted results, default is ASCENDING.", + // "enum": [ + // "ASCENDING", + // "DESCENDING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "subaccountId": { + // "description": "Select only user roles that belong to this subaccount.", + // "format": "int64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRoles", + // "response": { + // "$ref": "UserRolesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRoles.patch": + +type UserRolesPatchCall struct { + s *Service + profileId int64 + id int64 + userrole *UserRole + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing user role. This method supports patch +// semantics. +func (r *UserRolesService) Patch(profileId int64, id int64, userrole *UserRole) *UserRolesPatchCall { + c := &UserRolesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.id = id + c.userrole = userrole + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolesPatchCall) Fields(s ...googleapi.Field) *UserRolesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolesPatchCall) Context(ctx context.Context) *UserRolesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("id", fmt.Sprintf("%v", c.id)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRoles.patch" call. +// Exactly one of *UserRole or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *UserRole.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserRolesPatchCall) Do() (*UserRole, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRole{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing user role. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "dfareporting.userRoles.patch", + // "parameterOrder": [ + // "profileId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "User role ID.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRoles", + // "request": { + // "$ref": "UserRole" + // }, + // "response": { + // "$ref": "UserRole" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} + +// method id "dfareporting.userRoles.update": + +type UserRolesUpdateCall struct { + s *Service + profileId int64 + userrole *UserRole + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing user role. +func (r *UserRolesService) Update(profileId int64, userrole *UserRole) *UserRolesUpdateCall { + c := &UserRolesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.profileId = profileId + c.userrole = userrole + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserRolesUpdateCall) Fields(s ...googleapi.Field) *UserRolesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserRolesUpdateCall) Context(ctx context.Context) *UserRolesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *UserRolesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "profileId": strconv.FormatInt(c.profileId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dfareporting.userRoles.update" call. +// Exactly one of *UserRole or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *UserRole.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserRolesUpdateCall) Do() (*UserRole, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserRole{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing user role.", + // "httpMethod": "PUT", + // "id": "dfareporting.userRoles.update", + // "parameterOrder": [ + // "profileId" + // ], + // "parameters": { + // "profileId": { + // "description": "User profile ID associated with this request.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "userprofiles/{profileId}/userRoles", + // "request": { + // "$ref": "UserRole" + // }, + // "response": { + // "$ref": "UserRole" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/dfatrafficking" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/discovery/v1/discovery-api.json b/Godeps/_workspace/src/google.golang.org/api/discovery/v1/discovery-api.json new file mode 100644 index 000000000..ac553fc09 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/discovery/v1/discovery-api.json @@ -0,0 +1,682 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/jn2m36Cyj5Ei-KQXTI8Znl-wUic\"", + "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 + }, + "exponentialBackoffDefault": { + "type": "boolean", + "description": "Enable exponential backoff for suitable methods in the generated clients." + }, + "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." + }, + "useMediaDownloadService": { + "type": "boolean", + "description": "Indicates that downloads from this method should use the download service URL (i.e. \"/download\"). Only applies if the method supports media download." + } + } + }, + "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/Godeps/_workspace/src/google.golang.org/api/discovery/v1/discovery-gen.go b/Godeps/_workspace/src/google.golang.org/api/discovery/v1/discovery-gen.go new file mode 100644 index 000000000..32a0a06d3 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/discovery/v1/discovery-gen.go @@ -0,0 +1,1040 @@ +// Package discovery provides access to the APIs Discovery Service. +// +// See https://developers.google.com/discovery/ +// +// Usage example: +// +// import "google.golang.org/api/discovery/v1" +// ... +// discoveryService, err := discovery.New(oauthHttpClient) +package discovery // import "google.golang.org/api/discovery/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Apis *ApisService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DiscoveryVersion") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DirectoryList) MarshalJSON() ([]byte, error) { + type noMethod DirectoryList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DirectoryListItems) MarshalJSON() ([]byte, error) { + type noMethod DirectoryListItems + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DirectoryListItemsIcons: Links to 16x16 and 32x32 icons representing +// the API. +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"` + + // ForceSendFields is a list of field names (e.g. "X16") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DirectoryListItemsIcons) MarshalJSON() ([]byte, error) { + type noMethod DirectoryListItemsIcons + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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 map[string]JsonSchema `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"` + + // ForceSendFields is a list of field names (e.g. "Ref") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JsonSchema) MarshalJSON() ([]byte, error) { + type noMethod JsonSchema + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// JsonSchemaAnnotations: Additional information about this property. +type JsonSchemaAnnotations struct { + // Required: A list of methods for which this property is required on + // requests. + Required []string `json:"required,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Required") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JsonSchemaAnnotations) MarshalJSON() ([]byte, error) { + type noMethod JsonSchemaAnnotations + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// JsonSchemaVariant: 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. +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"` + + // ForceSendFields is a list of field names (e.g. "Discriminant") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JsonSchemaVariant) MarshalJSON() ([]byte, error) { + type noMethod JsonSchemaVariant + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type JsonSchemaVariantMap struct { + Ref string `json:"$ref,omitempty"` + + TypeValue string `json:"type_value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Ref") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JsonSchemaVariantMap) MarshalJSON() ([]byte, error) { + type noMethod JsonSchemaVariantMap + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ExponentialBackoffDefault: Enable exponential backoff for suitable + // methods in the generated clients. + ExponentialBackoffDefault bool `json:"exponentialBackoffDefault,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 map[string]RestMethod `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 map[string]JsonSchema `json:"parameters,omitempty"` + + // Protocol: The protocol described by this document. + Protocol string `json:"protocol,omitempty"` + + // Resources: The resources in this API. + Resources map[string]RestResource `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 map[string]JsonSchema `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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Auth") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RestDescription) MarshalJSON() ([]byte, error) { + type noMethod RestDescription + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RestDescriptionAuth: Authentication information. +type RestDescriptionAuth struct { + // Oauth2: OAuth 2.0 authentication information. + Oauth2 *RestDescriptionAuthOauth2 `json:"oauth2,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Oauth2") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RestDescriptionAuth) MarshalJSON() ([]byte, error) { + type noMethod RestDescriptionAuth + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RestDescriptionAuthOauth2: OAuth 2.0 authentication information. +type RestDescriptionAuthOauth2 struct { + // Scopes: Available OAuth 2.0 scopes. + Scopes *RestDescriptionAuthOauth2Scopes `json:"scopes,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Scopes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RestDescriptionAuthOauth2) MarshalJSON() ([]byte, error) { + type noMethod RestDescriptionAuthOauth2 + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RestDescriptionAuthOauth2Scopes: Available OAuth 2.0 scopes. +type RestDescriptionAuthOauth2Scopes struct { +} + +// RestDescriptionIcons: Links to 16x16 and 32x32 icons representing the +// API. +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"` + + // ForceSendFields is a list of field names (e.g. "X16") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RestDescriptionIcons) MarshalJSON() ([]byte, error) { + type noMethod RestDescriptionIcons + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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 map[string]JsonSchema `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"` + + // UseMediaDownloadService: Indicates that downloads from this method + // should use the download service URL (i.e. "/download"). Only applies + // if the method supports media download. + UseMediaDownloadService bool `json:"useMediaDownloadService,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RestMethod) MarshalJSON() ([]byte, error) { + type noMethod RestMethod + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RestMethodMediaUpload: Media upload parameters. +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"` + + // ForceSendFields is a list of field names (e.g. "Accept") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RestMethodMediaUpload) MarshalJSON() ([]byte, error) { + type noMethod RestMethodMediaUpload + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RestMethodMediaUploadProtocols: Supported upload protocols. +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"` + + // ForceSendFields is a list of field names (e.g. "Resumable") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RestMethodMediaUploadProtocols) MarshalJSON() ([]byte, error) { + type noMethod RestMethodMediaUploadProtocols + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RestMethodMediaUploadProtocolsResumable: Supports the Resumable Media +// Upload protocol. +type RestMethodMediaUploadProtocolsResumable struct { + // Multipart: True if this endpoint supports uploading multipart media. + // + // Default: true + 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"` + + // ForceSendFields is a list of field names (e.g. "Multipart") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RestMethodMediaUploadProtocolsResumable) MarshalJSON() ([]byte, error) { + type noMethod RestMethodMediaUploadProtocolsResumable + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RestMethodMediaUploadProtocolsSimple: Supports uploading as a single +// HTTP request. +type RestMethodMediaUploadProtocolsSimple struct { + // Multipart: True if this endpoint supports upload multipart media. + // + // Default: true + 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"` + + // ForceSendFields is a list of field names (e.g. "Multipart") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RestMethodMediaUploadProtocolsSimple) MarshalJSON() ([]byte, error) { + type noMethod RestMethodMediaUploadProtocolsSimple + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RestMethodRequest: The schema for the request. +type RestMethodRequest struct { + // Ref: Schema ID for the request schema. + Ref string `json:"$ref,omitempty"` + + // ParameterName: parameter name. + ParameterName string `json:"parameterName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Ref") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RestMethodRequest) MarshalJSON() ([]byte, error) { + type noMethod RestMethodRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RestMethodResponse: The schema for the response. +type RestMethodResponse struct { + // Ref: Schema ID for the response schema. + Ref string `json:"$ref,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Ref") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RestMethodResponse) MarshalJSON() ([]byte, error) { + type noMethod RestMethodResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type RestResource struct { + // Methods: Methods on this resource. + Methods map[string]RestMethod `json:"methods,omitempty"` + + // Resources: Sub-resources on this resource. + Resources map[string]RestResource `json:"resources,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Methods") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RestResource) MarshalJSON() ([]byte, error) { + type noMethod RestResource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "discovery.apis.getRest": + +type ApisGetRestCall struct { + s *Service + api string + version string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ApisGetRestCall) Fields(s ...googleapi.Field) *ApisGetRestCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ApisGetRestCall) IfNoneMatch(entityTag string) *ApisGetRestCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ApisGetRestCall) Context(ctx context.Context) *ApisGetRestCall { + c.ctx_ = ctx + return c +} + +func (c *ApisGetRestCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "apis/{api}/{version}/rest") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "api": c.api, + "version": c.version, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "discovery.apis.getRest" call. +// Exactly one of *RestDescription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *RestDescription.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ApisGetRestCall) Do() (*RestDescription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RestDescription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ApisListCall) Fields(s ...googleapi.Field) *ApisListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ApisListCall) IfNoneMatch(entityTag string) *ApisListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ApisListCall) Context(ctx context.Context) *ApisListCall { + c.ctx_ = ctx + return c +} + +func (c *ApisListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "discovery.apis.list" call. +// Exactly one of *DirectoryList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DirectoryList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ApisListCall) Do() (*DirectoryList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DirectoryList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/Godeps/_workspace/src/google.golang.org/api/dns/v1/dns-api.json b/Godeps/_workspace/src/google.golang.org/api/dns/v1/dns-api.json new file mode 100644 index 000000000..a36533455 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/dns/v1/dns-api.json @@ -0,0 +1,708 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/zoueaaoAZQGFJohVmI5skQDTvqg\"", + "discoveryVersion": "v1", + "id": "dns:v1", + "name": "dns", + "version": "v1", + "revision": "20150729", + "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/v1/projects/", + "basePath": "/dns/v1/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "dns/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/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/cloud-platform.read-only": { + "description": "View 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 (output only).", + "enum": [ + "done", + "pending" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "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 mutable string of at most 1024 characters associated 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. The name must be 1-32 characters long, must begin with a letter, end with a letter or digit, and only contain lowercase letters, digits or dashes." + }, + "nameServerSet": { + "type": "string", + "description": "Optionally specifies the NameServerSet for this ManagedZone. A NameServerSet is a set of DNS name servers that all host the same ManagedZones. Most users will leave this field unset." + }, + "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": "The identifier of a supported record type, for example, A, AAAA, MX, TXT, and so on." + } + } + }, + "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/cloud-platform.read-only", + "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/cloud-platform.read-only", + "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/cloud-platform.read-only", + "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": { + "dnsName": { + "type": "string", + "description": "Restricts the list to return only zones with this domain name.", + "location": "query" + }, + "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/cloud-platform.read-only", + "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/cloud-platform.read-only", + "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/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.clouddns.readonly", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/dns/v1/dns-gen.go b/Godeps/_workspace/src/google.golang.org/api/dns/v1/dns-gen.go new file mode 100644 index 000000000..bc91099e0 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/dns/v1/dns-gen.go @@ -0,0 +1,1841 @@ +// Package dns provides access to the Google Cloud DNS API. +// +// See https://developers.google.com/cloud-dns +// +// Usage example: +// +// import "google.golang.org/api/dns/v1" +// ... +// dnsService, err := dns.New(oauthHttpClient) +package dns // import "google.golang.org/api/dns/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "dns:v1" +const apiName = "dns" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/dns/v1/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 data across Google Cloud Platform services + CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" + + // 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 + UserAgent string // optional additional User-Agent fragment + + Changes *ChangesService + + ManagedZones *ManagedZonesService + + Projects *ProjectsService + + ResourceRecordSets *ResourceRecordSetsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 +} + +// Change: An atomic update to a collection of ResourceRecordSets. +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 (output only). + // + // Possible values: + // "done" + // "pending" + Status string `json:"status,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Additions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Change) MarshalJSON() ([]byte, error) { + type noMethod Change + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChangesListResponse: The response to a request to enumerate Changes +// to a ResourceRecordSets collection. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Changes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChangesListResponse) MarshalJSON() ([]byte, error) { + type noMethod ChangesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ManagedZone: 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. +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 mutable string of at most 1024 characters associated + // 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. The name must be 1-32 characters long, must begin with a + // letter, end with a letter or digit, and only contain lowercase + // letters, digits or dashes. + Name string `json:"name,omitempty"` + + // NameServerSet: Optionally specifies the NameServerSet for this + // ManagedZone. A NameServerSet is a set of DNS name servers that all + // host the same ManagedZones. Most users will leave this field unset. + NameServerSet string `json:"nameServerSet,omitempty"` + + // NameServers: Delegate your managed_zone to these virtual name + // servers; defined by the server (output only) + NameServers []string `json:"nameServers,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ManagedZone) MarshalJSON() ([]byte, error) { + type noMethod ManagedZone + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ManagedZonesListResponse) MarshalJSON() ([]byte, error) { + type noMethod ManagedZonesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Project: 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. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Project) MarshalJSON() ([]byte, error) { + type noMethod Project + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Quota: Limits associated with a Project. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Quota) MarshalJSON() ([]byte, error) { + type noMethod Quota + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ResourceRecordSet: A unit of data that will be returned by the DNS +// servers. +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: The identifier of a supported record type, for example, A, + // AAAA, MX, TXT, and so on. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResourceRecordSet) MarshalJSON() ([]byte, error) { + type noMethod ResourceRecordSet + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResourceRecordSetsListResponse) MarshalJSON() ([]byte, error) { + type noMethod ResourceRecordSetsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "dns.changes.create": + +type ChangesCreateCall struct { + s *Service + project string + managedZone string + change *Change + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChangesCreateCall) Fields(s ...googleapi.Field) *ChangesCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChangesCreateCall) Context(ctx context.Context) *ChangesCreateCall { + c.ctx_ = ctx + return c +} + +func (c *ChangesCreateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/changes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "managedZone": c.managedZone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dns.changes.create" call. +// Exactly one of *Change or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Change.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ChangesCreateCall) Do() (*Change, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Change{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChangesGetCall) Fields(s ...googleapi.Field) *ChangesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ChangesGetCall) IfNoneMatch(entityTag string) *ChangesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChangesGetCall) Context(ctx context.Context) *ChangesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ChangesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/changes/{changeId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "managedZone": c.managedZone, + "changeId": c.changeId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dns.changes.get" call. +// Exactly one of *Change or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Change.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ChangesGetCall) Do() (*Change, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Change{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform.read-only", + // "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "changeSequence" (default) +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChangesListCall) Fields(s ...googleapi.Field) *ChangesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ChangesListCall) IfNoneMatch(entityTag string) *ChangesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChangesListCall) Context(ctx context.Context) *ChangesListCall { + c.ctx_ = ctx + return c +} + +func (c *ChangesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/changes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "managedZone": c.managedZone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dns.changes.list" call. +// Exactly one of *ChangesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ChangesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ChangesListCall) Do() (*ChangesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ChangesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform.read-only", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagedZonesCreateCall) Fields(s ...googleapi.Field) *ManagedZonesCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagedZonesCreateCall) Context(ctx context.Context) *ManagedZonesCreateCall { + c.ctx_ = ctx + return c +} + +func (c *ManagedZonesCreateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dns.managedZones.create" call. +// Exactly one of *ManagedZone or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ManagedZone.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ManagedZonesCreateCall) Do() (*ManagedZone, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ManagedZone{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagedZonesDeleteCall) Fields(s ...googleapi.Field) *ManagedZonesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagedZonesDeleteCall) Context(ctx context.Context) *ManagedZonesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ManagedZonesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "managedZone": c.managedZone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dns.managedZones.delete" call. +func (c *ManagedZonesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagedZonesGetCall) Fields(s ...googleapi.Field) *ManagedZonesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagedZonesGetCall) IfNoneMatch(entityTag string) *ManagedZonesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagedZonesGetCall) Context(ctx context.Context) *ManagedZonesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ManagedZonesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "managedZone": c.managedZone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dns.managedZones.get" call. +// Exactly one of *ManagedZone or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ManagedZone.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ManagedZonesGetCall) Do() (*ManagedZone, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ManagedZone{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform.read-only", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// DnsName sets the optional parameter "dnsName": Restricts the list to +// return only zones with this domain name. +func (c *ManagedZonesListCall) DnsName(dnsName string) *ManagedZonesListCall { + c.opt_["dnsName"] = dnsName + 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagedZonesListCall) Fields(s ...googleapi.Field) *ManagedZonesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagedZonesListCall) IfNoneMatch(entityTag string) *ManagedZonesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagedZonesListCall) Context(ctx context.Context) *ManagedZonesListCall { + c.ctx_ = ctx + return c +} + +func (c *ManagedZonesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["dnsName"]; ok { + params.Set("dnsName", 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dns.managedZones.list" call. +// Exactly one of *ManagedZonesListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ManagedZonesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagedZonesListCall) Do() (*ManagedZonesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ManagedZonesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Enumerate ManagedZones that have been created but not yet deleted.", + // "httpMethod": "GET", + // "id": "dns.managedZones.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "dnsName": { + // "description": "Restricts the list to return only zones with this domain name.", + // "location": "query", + // "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" + // } + // }, + // "path": "{project}/managedZones", + // "response": { + // "$ref": "ManagedZonesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dns.projects.get" call. +// Exactly one of *Project or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Project.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsGetCall) Do() (*Project, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Project{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform.read-only", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ResourceRecordSetsListCall) Fields(s ...googleapi.Field) *ResourceRecordSetsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ResourceRecordSetsListCall) IfNoneMatch(entityTag string) *ResourceRecordSetsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ResourceRecordSetsListCall) Context(ctx context.Context) *ResourceRecordSetsListCall { + c.ctx_ = ctx + return c +} + +func (c *ResourceRecordSetsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/rrsets") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "managedZone": c.managedZone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dns.resourceRecordSets.list" call. +// Exactly one of *ResourceRecordSetsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ResourceRecordSetsListResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ResourceRecordSetsListCall) Do() (*ResourceRecordSetsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ResourceRecordSetsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.clouddns.readonly", + // "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/dns/v1beta1/dns-api.json b/Godeps/_workspace/src/google.golang.org/api/dns/v1beta1/dns-api.json new file mode 100644 index 000000000..8f59a5ea8 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/dns/v1beta1/dns-api.json @@ -0,0 +1,700 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/z8EvZOnlqaBoJtlcMyMinOpCnyk\"", + "discoveryVersion": "v1", + "id": "dns:v1beta1", + "name": "dns", + "version": "v1beta1", + "revision": "20150729", + "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/cloud-platform.read-only": { + "description": "View 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 (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 mutable string of at most 1024 characters associated 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. The name must be 1-32 characters long, must begin with a letter, end with a letter or digit, and only contain lowercase letters, digits or dashes." + }, + "nameServerSet": { + "type": "string", + "description": "Optionally specifies the NameServerSet for this ManagedZone. A NameServerSet is a set of DNS name servers that all host the same ManagedZones. Most users will leave this field unset." + }, + "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": "The identifier of a supported record type, for example, A, AAAA, MX, TXT, and so on." + } + } + }, + "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/cloud-platform.read-only", + "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/cloud-platform.read-only", + "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/cloud-platform.read-only", + "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": { + "dnsName": { + "type": "string", + "description": "Restricts the list to return only zones with this domain name.", + "location": "query" + }, + "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/cloud-platform.read-only", + "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/cloud-platform.read-only", + "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/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.clouddns.readonly", + "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/dns/v1beta1/dns-gen.go b/Godeps/_workspace/src/google.golang.org/api/dns/v1beta1/dns-gen.go new file mode 100644 index 000000000..dd4915bea --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/dns/v1beta1/dns-gen.go @@ -0,0 +1,1837 @@ +// Package dns provides access to the Google Cloud DNS API. +// +// See https://developers.google.com/cloud-dns +// +// Usage example: +// +// import "google.golang.org/api/dns/v1beta1" +// ... +// dnsService, err := dns.New(oauthHttpClient) +package dns // import "google.golang.org/api/dns/v1beta1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 data across Google Cloud Platform services + CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" + + // 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 + UserAgent string // optional additional User-Agent fragment + + Changes *ChangesService + + ManagedZones *ManagedZonesService + + Projects *ProjectsService + + ResourceRecordSets *ResourceRecordSetsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 +} + +// Change: An atomic update to a collection of ResourceRecordSets. +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 (output only). + Status string `json:"status,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Additions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Change) MarshalJSON() ([]byte, error) { + type noMethod Change + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChangesListResponse: The response to a request to enumerate Changes +// to a ResourceRecordSets collection. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Changes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChangesListResponse) MarshalJSON() ([]byte, error) { + type noMethod ChangesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ManagedZone: 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. +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 mutable string of at most 1024 characters associated + // 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. The name must be 1-32 characters long, must begin with a + // letter, end with a letter or digit, and only contain lowercase + // letters, digits or dashes. + Name string `json:"name,omitempty"` + + // NameServerSet: Optionally specifies the NameServerSet for this + // ManagedZone. A NameServerSet is a set of DNS name servers that all + // host the same ManagedZones. Most users will leave this field unset. + NameServerSet string `json:"nameServerSet,omitempty"` + + // NameServers: Delegate your managed_zone to these virtual name + // servers; defined by the server (output only) + NameServers []string `json:"nameServers,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ManagedZone) MarshalJSON() ([]byte, error) { + type noMethod ManagedZone + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ManagedZonesListResponse) MarshalJSON() ([]byte, error) { + type noMethod ManagedZonesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Project: 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. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Project) MarshalJSON() ([]byte, error) { + type noMethod Project + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Quota: Limits associated with a Project. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Quota) MarshalJSON() ([]byte, error) { + type noMethod Quota + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ResourceRecordSet: A unit of data that will be returned by the DNS +// servers. +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: The identifier of a supported record type, for example, A, + // AAAA, MX, TXT, and so on. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResourceRecordSet) MarshalJSON() ([]byte, error) { + type noMethod ResourceRecordSet + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResourceRecordSetsListResponse) MarshalJSON() ([]byte, error) { + type noMethod ResourceRecordSetsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "dns.changes.create": + +type ChangesCreateCall struct { + s *Service + project string + managedZone string + change *Change + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChangesCreateCall) Fields(s ...googleapi.Field) *ChangesCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChangesCreateCall) Context(ctx context.Context) *ChangesCreateCall { + c.ctx_ = ctx + return c +} + +func (c *ChangesCreateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/changes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "managedZone": c.managedZone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dns.changes.create" call. +// Exactly one of *Change or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Change.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ChangesCreateCall) Do() (*Change, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Change{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChangesGetCall) Fields(s ...googleapi.Field) *ChangesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ChangesGetCall) IfNoneMatch(entityTag string) *ChangesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChangesGetCall) Context(ctx context.Context) *ChangesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ChangesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/changes/{changeId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "managedZone": c.managedZone, + "changeId": c.changeId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dns.changes.get" call. +// Exactly one of *Change or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Change.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ChangesGetCall) Do() (*Change, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Change{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform.read-only", + // "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "changeSequence" (default) +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChangesListCall) Fields(s ...googleapi.Field) *ChangesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ChangesListCall) IfNoneMatch(entityTag string) *ChangesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChangesListCall) Context(ctx context.Context) *ChangesListCall { + c.ctx_ = ctx + return c +} + +func (c *ChangesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/changes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "managedZone": c.managedZone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dns.changes.list" call. +// Exactly one of *ChangesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ChangesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ChangesListCall) Do() (*ChangesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ChangesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform.read-only", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagedZonesCreateCall) Fields(s ...googleapi.Field) *ManagedZonesCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagedZonesCreateCall) Context(ctx context.Context) *ManagedZonesCreateCall { + c.ctx_ = ctx + return c +} + +func (c *ManagedZonesCreateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dns.managedZones.create" call. +// Exactly one of *ManagedZone or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ManagedZone.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ManagedZonesCreateCall) Do() (*ManagedZone, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ManagedZone{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagedZonesDeleteCall) Fields(s ...googleapi.Field) *ManagedZonesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagedZonesDeleteCall) Context(ctx context.Context) *ManagedZonesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ManagedZonesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "managedZone": c.managedZone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dns.managedZones.delete" call. +func (c *ManagedZonesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagedZonesGetCall) Fields(s ...googleapi.Field) *ManagedZonesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagedZonesGetCall) IfNoneMatch(entityTag string) *ManagedZonesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagedZonesGetCall) Context(ctx context.Context) *ManagedZonesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ManagedZonesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "managedZone": c.managedZone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dns.managedZones.get" call. +// Exactly one of *ManagedZone or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ManagedZone.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ManagedZonesGetCall) Do() (*ManagedZone, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ManagedZone{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform.read-only", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// DnsName sets the optional parameter "dnsName": Restricts the list to +// return only zones with this domain name. +func (c *ManagedZonesListCall) DnsName(dnsName string) *ManagedZonesListCall { + c.opt_["dnsName"] = dnsName + 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ManagedZonesListCall) Fields(s ...googleapi.Field) *ManagedZonesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ManagedZonesListCall) IfNoneMatch(entityTag string) *ManagedZonesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ManagedZonesListCall) Context(ctx context.Context) *ManagedZonesListCall { + c.ctx_ = ctx + return c +} + +func (c *ManagedZonesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["dnsName"]; ok { + params.Set("dnsName", 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dns.managedZones.list" call. +// Exactly one of *ManagedZonesListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ManagedZonesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ManagedZonesListCall) Do() (*ManagedZonesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ManagedZonesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Enumerate ManagedZones that have been created but not yet deleted.", + // "httpMethod": "GET", + // "id": "dns.managedZones.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "dnsName": { + // "description": "Restricts the list to return only zones with this domain name.", + // "location": "query", + // "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" + // } + // }, + // "path": "{project}/managedZones", + // "response": { + // "$ref": "ManagedZonesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dns.projects.get" call. +// Exactly one of *Project or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Project.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsGetCall) Do() (*Project, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Project{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform.read-only", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ResourceRecordSetsListCall) Fields(s ...googleapi.Field) *ResourceRecordSetsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ResourceRecordSetsListCall) IfNoneMatch(entityTag string) *ResourceRecordSetsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ResourceRecordSetsListCall) Context(ctx context.Context) *ResourceRecordSetsListCall { + c.ctx_ = ctx + return c +} + +func (c *ResourceRecordSetsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/rrsets") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "managedZone": c.managedZone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "dns.resourceRecordSets.list" call. +// Exactly one of *ResourceRecordSetsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ResourceRecordSetsListResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ResourceRecordSetsListCall) Do() (*ResourceRecordSetsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ResourceRecordSetsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.clouddns.readonly", + // "https://www.googleapis.com/auth/ndev.clouddns.readwrite" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/doubleclickbidmanager/v1/doubleclickbidmanager-api.json b/Godeps/_workspace/src/google.golang.org/api/doubleclickbidmanager/v1/doubleclickbidmanager-api.json new file mode 100644 index 000000000..ed98ffb97 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/doubleclickbidmanager/v1/doubleclickbidmanager-api.json @@ -0,0 +1,1806 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/mAPHdimW0pvTGXzTTcUsJfk40xQ\"", + "discoveryVersion": "v1", + "id": "doubleclickbidmanager:v1", + "name": "doubleclickbidmanager", + "canonicalName": "DoubleClick Bid Manager", + "version": "v1", + "revision": "20150925", + "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": { + "fileSpec": { + "type": "string", + "description": "File specification (column names, types, order) in which the line items will be returned. Default to EWF.", + "enum": [ + "EWF", + "SDF" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "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 or Structured Data File Format for more information on file formats." + } + } + }, + "FilterPair": { + "id": "FilterPair", + "type": "object", + "description": "Filter used to match traffic data in your report.", + "properties": { + "type": { + "type": "string", + "description": "Filter type.", + "enum": [ + "FILTER_ACTIVE_VIEW_EXPECTED_VIEWABILITY", + "FILTER_ACTIVITY_ID", + "FILTER_ADVERTISER", + "FILTER_ADVERTISER_CURRENCY", + "FILTER_ADVERTISER_TIMEZONE", + "FILTER_AD_POSITION", + "FILTER_AGE", + "FILTER_BRANDSAFE_CHANNEL_ID", + "FILTER_BROWSER", + "FILTER_CAMPAIGN_DAILY_FREQUENCY", + "FILTER_CARRIER", + "FILTER_CHANNEL_ID", + "FILTER_CITY", + "FILTER_CONVERSION_DELAY", + "FILTER_COUNTRY", + "FILTER_CREATIVE_HEIGHT", + "FILTER_CREATIVE_ID", + "FILTER_CREATIVE_SIZE", + "FILTER_CREATIVE_TYPE", + "FILTER_CREATIVE_WIDTH", + "FILTER_DATA_PROVIDER", + "FILTER_DATE", + "FILTER_DAY_OF_WEEK", + "FILTER_DMA", + "FILTER_EXCHANGE_ID", + "FILTER_FLOODLIGHT_PIXEL_ID", + "FILTER_GENDER", + "FILTER_INSERTION_ORDER", + "FILTER_INVENTORY_FORMAT", + "FILTER_INVENTORY_SOURCE", + "FILTER_INVENTORY_SOURCE_TYPE", + "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_MOBILE_GEO", + "FILTER_MONTH", + "FILTER_MRAID_SUPPORT", + "FILTER_NIELSEN_AGE", + "FILTER_NIELSEN_COUNTRY_CODE", + "FILTER_NIELSEN_DEVICE_ID", + "FILTER_NIELSEN_GENDER", + "FILTER_ORDER_ID", + "FILTER_OS", + "FILTER_PAGE_CATEGORY", + "FILTER_PAGE_LAYOUT", + "FILTER_PARTNER", + "FILTER_PARTNER_CURRENCY", + "FILTER_PUBLIC_INVENTORY", + "FILTER_QUARTER", + "FILTER_REGION", + "FILTER_REGULAR_CHANNEL_ID", + "FILTER_SITE_ID", + "FILTER_SITE_LANGUAGE", + "FILTER_TARGETED_USER_LIST", + "FILTER_TIME_OF_DAY", + "FILTER_TRUEVIEW_CONVERSION_TYPE", + "FILTER_UNKNOWN", + "FILTER_USER_LIST", + "FILTER_USER_LIST_FIRST_PARTY", + "FILTER_USER_LIST_THIRD_PARTY", + "FILTER_VIDEO_AD_POSITION_IN_STREAM", + "FILTER_VIDEO_COMPANION_SIZE", + "FILTER_VIDEO_COMPANION_TYPE", + "FILTER_VIDEO_CREATIVE_DURATION", + "FILTER_VIDEO_CREATIVE_DURATION_SKIPPABLE", + "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_ACTIVE_VIEW_EXPECTED_VIEWABILITY", + "FILTER_ACTIVITY_ID", + "FILTER_ADVERTISER", + "FILTER_ADVERTISER_CURRENCY", + "FILTER_ADVERTISER_TIMEZONE", + "FILTER_AD_POSITION", + "FILTER_AGE", + "FILTER_BRANDSAFE_CHANNEL_ID", + "FILTER_BROWSER", + "FILTER_CAMPAIGN_DAILY_FREQUENCY", + "FILTER_CARRIER", + "FILTER_CHANNEL_ID", + "FILTER_CITY", + "FILTER_CONVERSION_DELAY", + "FILTER_COUNTRY", + "FILTER_CREATIVE_HEIGHT", + "FILTER_CREATIVE_ID", + "FILTER_CREATIVE_SIZE", + "FILTER_CREATIVE_TYPE", + "FILTER_CREATIVE_WIDTH", + "FILTER_DATA_PROVIDER", + "FILTER_DATE", + "FILTER_DAY_OF_WEEK", + "FILTER_DMA", + "FILTER_EXCHANGE_ID", + "FILTER_FLOODLIGHT_PIXEL_ID", + "FILTER_GENDER", + "FILTER_INSERTION_ORDER", + "FILTER_INVENTORY_FORMAT", + "FILTER_INVENTORY_SOURCE", + "FILTER_INVENTORY_SOURCE_TYPE", + "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_MOBILE_GEO", + "FILTER_MONTH", + "FILTER_MRAID_SUPPORT", + "FILTER_NIELSEN_AGE", + "FILTER_NIELSEN_COUNTRY_CODE", + "FILTER_NIELSEN_DEVICE_ID", + "FILTER_NIELSEN_GENDER", + "FILTER_ORDER_ID", + "FILTER_OS", + "FILTER_PAGE_CATEGORY", + "FILTER_PAGE_LAYOUT", + "FILTER_PARTNER", + "FILTER_PARTNER_CURRENCY", + "FILTER_PUBLIC_INVENTORY", + "FILTER_QUARTER", + "FILTER_REGION", + "FILTER_REGULAR_CHANNEL_ID", + "FILTER_SITE_ID", + "FILTER_SITE_LANGUAGE", + "FILTER_TARGETED_USER_LIST", + "FILTER_TIME_OF_DAY", + "FILTER_TRUEVIEW_CONVERSION_TYPE", + "FILTER_UNKNOWN", + "FILTER_USER_LIST", + "FILTER_USER_LIST_FIRST_PARTY", + "FILTER_USER_LIST_THIRD_PARTY", + "FILTER_VIDEO_AD_POSITION_IN_STREAM", + "FILTER_VIDEO_COMPANION_SIZE", + "FILTER_VIDEO_COMPANION_TYPE", + "FILTER_VIDEO_CREATIVE_DURATION", + "FILTER_VIDEO_CREATIVE_DURATION_SKIPPABLE", + "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_COMSCORE_VCE_AUDIENCE_AVG_FREQUENCY", + "METRIC_COMSCORE_VCE_AUDIENCE_IMPRESSIONS", + "METRIC_COMSCORE_VCE_AUDIENCE_IMPRESSIONS_SHARE", + "METRIC_COMSCORE_VCE_AUDIENCE_REACH_PCT", + "METRIC_COMSCORE_VCE_AUDIENCE_SHARE_PCT", + "METRIC_COMSCORE_VCE_GROSS_RATING_POINTS", + "METRIC_COMSCORE_VCE_POPULATION", + "METRIC_COMSCORE_VCE_UNIQUE_AUDIENCE", + "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_CPM_FEE3_ADVERTISER", + "METRIC_CPM_FEE3_PARTNER", + "METRIC_CPM_FEE3_USD", + "METRIC_CPM_FEE4_ADVERTISER", + "METRIC_CPM_FEE4_PARTNER", + "METRIC_CPM_FEE4_USD", + "METRIC_CPM_FEE5_ADVERTISER", + "METRIC_CPM_FEE5_PARTNER", + "METRIC_CPM_FEE5_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_FEE16_ADVERTISER", + "METRIC_FEE16_PARTNER", + "METRIC_FEE16_USD", + "METRIC_FEE17_ADVERTISER", + "METRIC_FEE17_PARTNER", + "METRIC_FEE17_USD", + "METRIC_FEE18_ADVERTISER", + "METRIC_FEE18_PARTNER", + "METRIC_FEE18_USD", + "METRIC_FEE19_ADVERTISER", + "METRIC_FEE19_PARTNER", + "METRIC_FEE19_USD", + "METRIC_FEE20_ADVERTISER", + "METRIC_FEE20_PARTNER", + "METRIC_FEE20_USD", + "METRIC_FEE21_ADVERTISER", + "METRIC_FEE21_PARTNER", + "METRIC_FEE21_USD", + "METRIC_FEE22_ADVERTISER", + "METRIC_FEE22_PARTNER", + "METRIC_FEE22_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_COST_VIEWABLE_ECPM_ADVERTISER", + "METRIC_MEDIA_COST_VIEWABLE_ECPM_PARTNER", + "METRIC_MEDIA_COST_VIEWABLE_ECPM_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_MEDIA_FEE3_ADVERTISER", + "METRIC_MEDIA_FEE3_PARTNER", + "METRIC_MEDIA_FEE3_USD", + "METRIC_MEDIA_FEE4_ADVERTISER", + "METRIC_MEDIA_FEE4_PARTNER", + "METRIC_MEDIA_FEE4_USD", + "METRIC_MEDIA_FEE5_ADVERTISER", + "METRIC_MEDIA_FEE5_PARTNER", + "METRIC_MEDIA_FEE5_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_PROFIT_VIEWABLE_ECPM_ADVERTISER", + "METRIC_PROFIT_VIEWABLE_ECPM_PARTNER", + "METRIC_PROFIT_VIEWABLE_ECPM_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_REVENUE_VIEWABLE_ECPM_ADVERTISER", + "METRIC_REVENUE_VIEWABLE_ECPM_PARTNER", + "METRIC_REVENUE_VIEWABLE_ECPM_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_TEA_TRUEVIEW_IMPRESSIONS", + "METRIC_TEA_TRUEVIEW_UNIQUE_COOKIES", + "METRIC_TEA_TRUEVIEW_UNIQUE_PEOPLE", + "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_TOTAL_MEDIA_COST_VIEWABLE_ECPM_ADVERTISER", + "METRIC_TOTAL_MEDIA_COST_VIEWABLE_ECPM_PARTNER", + "METRIC_TOTAL_MEDIA_COST_VIEWABLE_ECPM_USD", + "METRIC_TRUEVIEW_CONVERSION_COST_MANY_PER_VIEW_ADVERTISER", + "METRIC_TRUEVIEW_CONVERSION_COST_MANY_PER_VIEW_PARTNER", + "METRIC_TRUEVIEW_CONVERSION_COST_MANY_PER_VIEW_USD", + "METRIC_TRUEVIEW_CONVERSION_COST_ONE_PER_VIEW_ADVERTISER", + "METRIC_TRUEVIEW_CONVERSION_COST_ONE_PER_VIEW_PARTNER", + "METRIC_TRUEVIEW_CONVERSION_COST_ONE_PER_VIEW_USD", + "METRIC_TRUEVIEW_CONVERSION_MANY_PER_VIEW", + "METRIC_TRUEVIEW_CONVERSION_ONE_PER_VIEW", + "METRIC_TRUEVIEW_CONVERSION_RATE_ONE_PER_VIEW", + "METRIC_TRUEVIEW_CONVERSION_VALUE_MANY_PER_VIEW_ADVERTISER", + "METRIC_TRUEVIEW_CONVERSION_VALUE_MANY_PER_VIEW_PARTNER", + "METRIC_TRUEVIEW_CONVERSION_VALUE_MANY_PER_VIEW_USD", + "METRIC_TRUEVIEW_CONVERSION_VALUE_ONE_PER_VIEW_ADVERTISER", + "METRIC_TRUEVIEW_CONVERSION_VALUE_ONE_PER_VIEW_PARTNER", + "METRIC_TRUEVIEW_CONVERSION_VALUE_ONE_PER_VIEW_USD", + "METRIC_TRUEVIEW_COST_CONVERSION_MANY_PER_VIEW_RATIO", + "METRIC_TRUEVIEW_COST_CONVERSION_ONE_PER_VIEW_RATIO", + "METRIC_TRUEVIEW_CPV_ADVERTISER", + "METRIC_TRUEVIEW_CPV_PARTNER", + "METRIC_TRUEVIEW_CPV_USD", + "METRIC_TRUEVIEW_EARNED_LIKES", + "METRIC_TRUEVIEW_EARNED_PLAYLIST_ADDITIONS", + "METRIC_TRUEVIEW_EARNED_SHARES", + "METRIC_TRUEVIEW_EARNED_SUBSCRIBERS", + "METRIC_TRUEVIEW_EARNED_VIEWS", + "METRIC_TRUEVIEW_IMPRESSION_SHARE", + "METRIC_TRUEVIEW_LOST_IS_BUDGET", + "METRIC_TRUEVIEW_LOST_IS_RANK", + "METRIC_TRUEVIEW_TOTAL_CONVERSION_VALUE", + "METRIC_TRUEVIEW_TOTAL_CONVERSION_VALUES_ADVERTISER", + "METRIC_TRUEVIEW_TOTAL_CONVERSION_VALUES_PARTNER", + "METRIC_TRUEVIEW_TOTAL_CONVERSION_VALUES_USD", + "METRIC_TRUEVIEW_UNIQUE_VIEWERS", + "METRIC_TRUEVIEW_VALUE_CONVERSION_MANY_PER_VIEW_RATIO", + "METRIC_TRUEVIEW_VALUE_CONVERSION_ONE_PER_VIEW_RATIO", + "METRIC_TRUEVIEW_VIEWS", + "METRIC_TRUEVIEW_VIEW_RATE", + "METRIC_TRUEVIEW_VIEW_THROUGH_CONVERSION", + "METRIC_UNIQUE_VISITORS_COOKIES", + "METRIC_UNKNOWN", + "METRIC_VIDEO_COMPANION_CLICKS", + "METRIC_VIDEO_COMPANION_IMPRESSIONS", + "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_COMSCORE_VCE", + "TYPE_CROSS_FEE", + "TYPE_CROSS_PARTNER", + "TYPE_CROSS_PARTNER_THIRD_PARTY_DATA_PROVIDER", + "TYPE_ESTIMATED_CONVERSION", + "TYPE_FEE", + "TYPE_GENERAL", + "TYPE_INVENTORY_AVAILABILITY", + "TYPE_KEYWORD", + "TYPE_NIELSEN_AUDIENCE_PROFILE", + "TYPE_NIELSEN_DAILY_REACH_BUILD", + "TYPE_NIELSEN_ONLINE_GLOBAL_MARKET", + "TYPE_NIELSEN_SITE", + "TYPE_ORDER_ID", + "TYPE_PAGE_CATEGORY", + "TYPE_PIXEL_LOAD", + "TYPE_REACH_AND_FREQUENCY", + "TYPE_THIRD_PARTY_DATA_PROVIDER", + "TYPE_TRUEVIEW", + "TYPE_TRUEVIEW_IAR", + "TYPE_VERIFICATION", + "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" + }, + "locale": { + "type": "string", + "description": "Locale of the generated reports. Valid values are cs CZECH de GERMAN en ENGLISH es SPANISH fr FRENCH it ITALIAN ja JAPANESE ko KOREAN pl POLISH pt-BR BRAZILIAN_PORTUGUESE ru RUSSIAN tr TURKISH uk UKRAINIAN zh-CN CHINA_CHINESE zh-TW TAIWAN_CHINESE\n\nAn locale string not in the list above will generate reports in English." + }, + "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/Godeps/_workspace/src/google.golang.org/api/doubleclickbidmanager/v1/doubleclickbidmanager-gen.go b/Godeps/_workspace/src/google.golang.org/api/doubleclickbidmanager/v1/doubleclickbidmanager-gen.go new file mode 100644 index 000000000..9419d0968 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/doubleclickbidmanager/v1/doubleclickbidmanager-gen.go @@ -0,0 +1,2115 @@ +// Package doubleclickbidmanager provides access to the DoubleClick Bid Manager API. +// +// See https://developers.google.com/bid-manager/ +// +// Usage example: +// +// import "google.golang.org/api/doubleclickbidmanager/v1" +// ... +// doubleclickbidmanagerService, err := doubleclickbidmanager.New(oauthHttpClient) +package doubleclickbidmanager // import "google.golang.org/api/doubleclickbidmanager/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Lineitems *LineitemsService + + Queries *QueriesService + + Reports *ReportsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 +} + +// DownloadLineItemsRequest: Request to fetch stored line items. +type DownloadLineItemsRequest struct { + // FileSpec: File specification (column names, types, order) in which + // the line items will be returned. Default to EWF. + // + // Possible values: + // "EWF" + // "SDF" + FileSpec string `json:"fileSpec,omitempty"` + + // 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. + // + // Possible values: + // "ADVERTISER_ID" + // "INSERTION_ORDER_ID" + // "LINE_ITEM_ID" + FilterType string `json:"filterType,omitempty"` + + // Format: Format in which the line items will be returned. Default to + // CSV. + // + // Possible values: + // "CSV" + Format string `json:"format,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FileSpec") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DownloadLineItemsRequest) MarshalJSON() ([]byte, error) { + type noMethod DownloadLineItemsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DownloadLineItemsResponse: Download line items response. +type DownloadLineItemsResponse struct { + // LineItems: Retrieved line items in CSV format. Refer to Entity Write + // File Format or Structured Data File Format for more information on + // file formats. + LineItems string `json:"lineItems,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "LineItems") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DownloadLineItemsResponse) MarshalJSON() ([]byte, error) { + type noMethod DownloadLineItemsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FilterPair: Filter used to match traffic data in your report. +type FilterPair struct { + // Type: Filter type. + // + // Possible values: + // "FILTER_ACTIVE_VIEW_EXPECTED_VIEWABILITY" + // "FILTER_ACTIVITY_ID" + // "FILTER_ADVERTISER" + // "FILTER_ADVERTISER_CURRENCY" + // "FILTER_ADVERTISER_TIMEZONE" + // "FILTER_AD_POSITION" + // "FILTER_AGE" + // "FILTER_BRANDSAFE_CHANNEL_ID" + // "FILTER_BROWSER" + // "FILTER_CAMPAIGN_DAILY_FREQUENCY" + // "FILTER_CARRIER" + // "FILTER_CHANNEL_ID" + // "FILTER_CITY" + // "FILTER_CONVERSION_DELAY" + // "FILTER_COUNTRY" + // "FILTER_CREATIVE_HEIGHT" + // "FILTER_CREATIVE_ID" + // "FILTER_CREATIVE_SIZE" + // "FILTER_CREATIVE_TYPE" + // "FILTER_CREATIVE_WIDTH" + // "FILTER_DATA_PROVIDER" + // "FILTER_DATE" + // "FILTER_DAY_OF_WEEK" + // "FILTER_DMA" + // "FILTER_EXCHANGE_ID" + // "FILTER_FLOODLIGHT_PIXEL_ID" + // "FILTER_GENDER" + // "FILTER_INSERTION_ORDER" + // "FILTER_INVENTORY_FORMAT" + // "FILTER_INVENTORY_SOURCE" + // "FILTER_INVENTORY_SOURCE_TYPE" + // "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_MOBILE_GEO" + // "FILTER_MONTH" + // "FILTER_MRAID_SUPPORT" + // "FILTER_NIELSEN_AGE" + // "FILTER_NIELSEN_COUNTRY_CODE" + // "FILTER_NIELSEN_DEVICE_ID" + // "FILTER_NIELSEN_GENDER" + // "FILTER_ORDER_ID" + // "FILTER_OS" + // "FILTER_PAGE_CATEGORY" + // "FILTER_PAGE_LAYOUT" + // "FILTER_PARTNER" + // "FILTER_PARTNER_CURRENCY" + // "FILTER_PUBLIC_INVENTORY" + // "FILTER_QUARTER" + // "FILTER_REGION" + // "FILTER_REGULAR_CHANNEL_ID" + // "FILTER_SITE_ID" + // "FILTER_SITE_LANGUAGE" + // "FILTER_TARGETED_USER_LIST" + // "FILTER_TIME_OF_DAY" + // "FILTER_TRUEVIEW_CONVERSION_TYPE" + // "FILTER_UNKNOWN" + // "FILTER_USER_LIST" + // "FILTER_USER_LIST_FIRST_PARTY" + // "FILTER_USER_LIST_THIRD_PARTY" + // "FILTER_VIDEO_AD_POSITION_IN_STREAM" + // "FILTER_VIDEO_COMPANION_SIZE" + // "FILTER_VIDEO_COMPANION_TYPE" + // "FILTER_VIDEO_CREATIVE_DURATION" + // "FILTER_VIDEO_CREATIVE_DURATION_SKIPPABLE" + // "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" + Type string `json:"type,omitempty"` + + // Value: Filter value. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Type") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FilterPair) MarshalJSON() ([]byte, error) { + type noMethod FilterPair + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListQueriesResponse: List queries response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListQueriesResponse) MarshalJSON() ([]byte, error) { + type noMethod ListQueriesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListReportsResponse: List reports response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListReportsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListReportsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Parameters: Parameters of a query or report. +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. + // + // Possible values: + // "FILTER_ACTIVE_VIEW_EXPECTED_VIEWABILITY" + // "FILTER_ACTIVITY_ID" + // "FILTER_ADVERTISER" + // "FILTER_ADVERTISER_CURRENCY" + // "FILTER_ADVERTISER_TIMEZONE" + // "FILTER_AD_POSITION" + // "FILTER_AGE" + // "FILTER_BRANDSAFE_CHANNEL_ID" + // "FILTER_BROWSER" + // "FILTER_CAMPAIGN_DAILY_FREQUENCY" + // "FILTER_CARRIER" + // "FILTER_CHANNEL_ID" + // "FILTER_CITY" + // "FILTER_CONVERSION_DELAY" + // "FILTER_COUNTRY" + // "FILTER_CREATIVE_HEIGHT" + // "FILTER_CREATIVE_ID" + // "FILTER_CREATIVE_SIZE" + // "FILTER_CREATIVE_TYPE" + // "FILTER_CREATIVE_WIDTH" + // "FILTER_DATA_PROVIDER" + // "FILTER_DATE" + // "FILTER_DAY_OF_WEEK" + // "FILTER_DMA" + // "FILTER_EXCHANGE_ID" + // "FILTER_FLOODLIGHT_PIXEL_ID" + // "FILTER_GENDER" + // "FILTER_INSERTION_ORDER" + // "FILTER_INVENTORY_FORMAT" + // "FILTER_INVENTORY_SOURCE" + // "FILTER_INVENTORY_SOURCE_TYPE" + // "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_MOBILE_GEO" + // "FILTER_MONTH" + // "FILTER_MRAID_SUPPORT" + // "FILTER_NIELSEN_AGE" + // "FILTER_NIELSEN_COUNTRY_CODE" + // "FILTER_NIELSEN_DEVICE_ID" + // "FILTER_NIELSEN_GENDER" + // "FILTER_ORDER_ID" + // "FILTER_OS" + // "FILTER_PAGE_CATEGORY" + // "FILTER_PAGE_LAYOUT" + // "FILTER_PARTNER" + // "FILTER_PARTNER_CURRENCY" + // "FILTER_PUBLIC_INVENTORY" + // "FILTER_QUARTER" + // "FILTER_REGION" + // "FILTER_REGULAR_CHANNEL_ID" + // "FILTER_SITE_ID" + // "FILTER_SITE_LANGUAGE" + // "FILTER_TARGETED_USER_LIST" + // "FILTER_TIME_OF_DAY" + // "FILTER_TRUEVIEW_CONVERSION_TYPE" + // "FILTER_UNKNOWN" + // "FILTER_USER_LIST" + // "FILTER_USER_LIST_FIRST_PARTY" + // "FILTER_USER_LIST_THIRD_PARTY" + // "FILTER_VIDEO_AD_POSITION_IN_STREAM" + // "FILTER_VIDEO_COMPANION_SIZE" + // "FILTER_VIDEO_COMPANION_TYPE" + // "FILTER_VIDEO_CREATIVE_DURATION" + // "FILTER_VIDEO_CREATIVE_DURATION_SKIPPABLE" + // "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" + 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. + // + // Possible values: + // "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_COMSCORE_VCE_AUDIENCE_AVG_FREQUENCY" + // "METRIC_COMSCORE_VCE_AUDIENCE_IMPRESSIONS" + // "METRIC_COMSCORE_VCE_AUDIENCE_IMPRESSIONS_SHARE" + // "METRIC_COMSCORE_VCE_AUDIENCE_REACH_PCT" + // "METRIC_COMSCORE_VCE_AUDIENCE_SHARE_PCT" + // "METRIC_COMSCORE_VCE_GROSS_RATING_POINTS" + // "METRIC_COMSCORE_VCE_POPULATION" + // "METRIC_COMSCORE_VCE_UNIQUE_AUDIENCE" + // "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_CPM_FEE3_ADVERTISER" + // "METRIC_CPM_FEE3_PARTNER" + // "METRIC_CPM_FEE3_USD" + // "METRIC_CPM_FEE4_ADVERTISER" + // "METRIC_CPM_FEE4_PARTNER" + // "METRIC_CPM_FEE4_USD" + // "METRIC_CPM_FEE5_ADVERTISER" + // "METRIC_CPM_FEE5_PARTNER" + // "METRIC_CPM_FEE5_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_FEE16_ADVERTISER" + // "METRIC_FEE16_PARTNER" + // "METRIC_FEE16_USD" + // "METRIC_FEE17_ADVERTISER" + // "METRIC_FEE17_PARTNER" + // "METRIC_FEE17_USD" + // "METRIC_FEE18_ADVERTISER" + // "METRIC_FEE18_PARTNER" + // "METRIC_FEE18_USD" + // "METRIC_FEE19_ADVERTISER" + // "METRIC_FEE19_PARTNER" + // "METRIC_FEE19_USD" + // "METRIC_FEE20_ADVERTISER" + // "METRIC_FEE20_PARTNER" + // "METRIC_FEE20_USD" + // "METRIC_FEE21_ADVERTISER" + // "METRIC_FEE21_PARTNER" + // "METRIC_FEE21_USD" + // "METRIC_FEE22_ADVERTISER" + // "METRIC_FEE22_PARTNER" + // "METRIC_FEE22_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_COST_VIEWABLE_ECPM_ADVERTISER" + // "METRIC_MEDIA_COST_VIEWABLE_ECPM_PARTNER" + // "METRIC_MEDIA_COST_VIEWABLE_ECPM_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_MEDIA_FEE3_ADVERTISER" + // "METRIC_MEDIA_FEE3_PARTNER" + // "METRIC_MEDIA_FEE3_USD" + // "METRIC_MEDIA_FEE4_ADVERTISER" + // "METRIC_MEDIA_FEE4_PARTNER" + // "METRIC_MEDIA_FEE4_USD" + // "METRIC_MEDIA_FEE5_ADVERTISER" + // "METRIC_MEDIA_FEE5_PARTNER" + // "METRIC_MEDIA_FEE5_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_PROFIT_VIEWABLE_ECPM_ADVERTISER" + // "METRIC_PROFIT_VIEWABLE_ECPM_PARTNER" + // "METRIC_PROFIT_VIEWABLE_ECPM_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_REVENUE_VIEWABLE_ECPM_ADVERTISER" + // "METRIC_REVENUE_VIEWABLE_ECPM_PARTNER" + // "METRIC_REVENUE_VIEWABLE_ECPM_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_TEA_TRUEVIEW_IMPRESSIONS" + // "METRIC_TEA_TRUEVIEW_UNIQUE_COOKIES" + // "METRIC_TEA_TRUEVIEW_UNIQUE_PEOPLE" + // "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_TOTAL_MEDIA_COST_VIEWABLE_ECPM_ADVERTISER" + // "METRIC_TOTAL_MEDIA_COST_VIEWABLE_ECPM_PARTNER" + // "METRIC_TOTAL_MEDIA_COST_VIEWABLE_ECPM_USD" + // "METRIC_TRUEVIEW_CONVERSION_COST_MANY_PER_VIEW_ADVERTISER" + // "METRIC_TRUEVIEW_CONVERSION_COST_MANY_PER_VIEW_PARTNER" + // "METRIC_TRUEVIEW_CONVERSION_COST_MANY_PER_VIEW_USD" + // "METRIC_TRUEVIEW_CONVERSION_COST_ONE_PER_VIEW_ADVERTISER" + // "METRIC_TRUEVIEW_CONVERSION_COST_ONE_PER_VIEW_PARTNER" + // "METRIC_TRUEVIEW_CONVERSION_COST_ONE_PER_VIEW_USD" + // "METRIC_TRUEVIEW_CONVERSION_MANY_PER_VIEW" + // "METRIC_TRUEVIEW_CONVERSION_ONE_PER_VIEW" + // "METRIC_TRUEVIEW_CONVERSION_RATE_ONE_PER_VIEW" + // "METRIC_TRUEVIEW_CONVERSION_VALUE_MANY_PER_VIEW_ADVERTISER" + // "METRIC_TRUEVIEW_CONVERSION_VALUE_MANY_PER_VIEW_PARTNER" + // "METRIC_TRUEVIEW_CONVERSION_VALUE_MANY_PER_VIEW_USD" + // "METRIC_TRUEVIEW_CONVERSION_VALUE_ONE_PER_VIEW_ADVERTISER" + // "METRIC_TRUEVIEW_CONVERSION_VALUE_ONE_PER_VIEW_PARTNER" + // "METRIC_TRUEVIEW_CONVERSION_VALUE_ONE_PER_VIEW_USD" + // "METRIC_TRUEVIEW_COST_CONVERSION_MANY_PER_VIEW_RATIO" + // "METRIC_TRUEVIEW_COST_CONVERSION_ONE_PER_VIEW_RATIO" + // "METRIC_TRUEVIEW_CPV_ADVERTISER" + // "METRIC_TRUEVIEW_CPV_PARTNER" + // "METRIC_TRUEVIEW_CPV_USD" + // "METRIC_TRUEVIEW_EARNED_LIKES" + // "METRIC_TRUEVIEW_EARNED_PLAYLIST_ADDITIONS" + // "METRIC_TRUEVIEW_EARNED_SHARES" + // "METRIC_TRUEVIEW_EARNED_SUBSCRIBERS" + // "METRIC_TRUEVIEW_EARNED_VIEWS" + // "METRIC_TRUEVIEW_IMPRESSION_SHARE" + // "METRIC_TRUEVIEW_LOST_IS_BUDGET" + // "METRIC_TRUEVIEW_LOST_IS_RANK" + // "METRIC_TRUEVIEW_TOTAL_CONVERSION_VALUE" + // "METRIC_TRUEVIEW_TOTAL_CONVERSION_VALUES_ADVERTISER" + // "METRIC_TRUEVIEW_TOTAL_CONVERSION_VALUES_PARTNER" + // "METRIC_TRUEVIEW_TOTAL_CONVERSION_VALUES_USD" + // "METRIC_TRUEVIEW_UNIQUE_VIEWERS" + // "METRIC_TRUEVIEW_VALUE_CONVERSION_MANY_PER_VIEW_RATIO" + // "METRIC_TRUEVIEW_VALUE_CONVERSION_ONE_PER_VIEW_RATIO" + // "METRIC_TRUEVIEW_VIEWS" + // "METRIC_TRUEVIEW_VIEW_RATE" + // "METRIC_TRUEVIEW_VIEW_THROUGH_CONVERSION" + // "METRIC_UNIQUE_VISITORS_COOKIES" + // "METRIC_UNKNOWN" + // "METRIC_VIDEO_COMPANION_CLICKS" + // "METRIC_VIDEO_COMPANION_IMPRESSIONS" + // "METRIC_VIDEO_COMPLETION_RATE" + Metrics []string `json:"metrics,omitempty"` + + // Type: Report type. + // + // Possible values: + // "TYPE_ACTIVE_GRP" + // "TYPE_AUDIENCE_COMPOSITION" + // "TYPE_AUDIENCE_PERFORMANCE" + // "TYPE_CLIENT_SAFE" + // "TYPE_COMSCORE_VCE" + // "TYPE_CROSS_FEE" + // "TYPE_CROSS_PARTNER" + // "TYPE_CROSS_PARTNER_THIRD_PARTY_DATA_PROVIDER" + // "TYPE_ESTIMATED_CONVERSION" + // "TYPE_FEE" + // "TYPE_GENERAL" + // "TYPE_INVENTORY_AVAILABILITY" + // "TYPE_KEYWORD" + // "TYPE_NIELSEN_AUDIENCE_PROFILE" + // "TYPE_NIELSEN_DAILY_REACH_BUILD" + // "TYPE_NIELSEN_ONLINE_GLOBAL_MARKET" + // "TYPE_NIELSEN_SITE" + // "TYPE_ORDER_ID" + // "TYPE_PAGE_CATEGORY" + // "TYPE_PIXEL_LOAD" + // "TYPE_REACH_AND_FREQUENCY" + // "TYPE_THIRD_PARTY_DATA_PROVIDER" + // "TYPE_TRUEVIEW" + // "TYPE_TRUEVIEW_IAR" + // "TYPE_VERIFICATION" + // "TYPE_YOUTUBE_VERTICAL" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Filters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Parameters) MarshalJSON() ([]byte, error) { + type noMethod Parameters + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Query: Represents a query. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Query) MarshalJSON() ([]byte, error) { + type noMethod Query + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// QueryMetadata: Query metadata. +type QueryMetadata struct { + // DataRange: Range of report data. + // + // Possible values: + // "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" + DataRange string `json:"dataRange,omitempty"` + + // Format: Format of the generated report. + // + // Possible values: + // "CSV" + // "EXCEL_CSV" + // "XLSX" + 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"` + + // Locale: Locale of the generated reports. Valid values are cs CZECH de + // GERMAN en ENGLISH es SPANISH fr FRENCH it ITALIAN ja JAPANESE ko + // KOREAN pl POLISH pt-BR BRAZILIAN_PORTUGUESE ru RUSSIAN tr TURKISH uk + // UKRAINIAN zh-CN CHINA_CHINESE zh-TW TAIWAN_CHINESE + // + // An locale string not in the list above will generate reports in + // English. + Locale string `json:"locale,omitempty"` + + // 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"` + + // ForceSendFields is a list of field names (e.g. "DataRange") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *QueryMetadata) MarshalJSON() ([]byte, error) { + type noMethod QueryMetadata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// QuerySchedule: Information on how frequently and when to run a query. +type QuerySchedule struct { + // EndTimeMs: Datetime to periodically run the query until. + EndTimeMs int64 `json:"endTimeMs,omitempty,string"` + + // Frequency: How often the query is run. + // + // Possible values: + // "DAILY" + // "MONTHLY" + // "ONE_TIME" + // "QUARTERLY" + // "SEMI_MONTHLY" + // "WEEKLY" + 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"` + + // ForceSendFields is a list of field names (e.g. "EndTimeMs") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *QuerySchedule) MarshalJSON() ([]byte, error) { + type noMethod QuerySchedule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Report: Represents a report. +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"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Report) MarshalJSON() ([]byte, error) { + type noMethod Report + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportFailure: An explanation of a report failure. +type ReportFailure struct { + // ErrorCode: Error code that shows why the report was not created. + // + // Possible values: + // "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" + ErrorCode string `json:"errorCode,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ErrorCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportFailure) MarshalJSON() ([]byte, error) { + type noMethod ReportFailure + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportKey: Key used to identify a report. +type ReportKey struct { + // QueryId: Query ID. + QueryId int64 `json:"queryId,omitempty,string"` + + // ReportId: Report ID. + ReportId int64 `json:"reportId,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "QueryId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportKey) MarshalJSON() ([]byte, error) { + type noMethod ReportKey + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportMetadata: Report metadata. +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"` + + // ForceSendFields is a list of field names (e.g. + // "GoogleCloudStoragePath") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportMetadata) MarshalJSON() ([]byte, error) { + type noMethod ReportMetadata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportStatus: Report status. +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. + // + // Possible values: + // "CSV" + // "EXCEL_CSV" + // "XLSX" + Format string `json:"format,omitempty"` + + // State: The state of the report. + // + // Possible values: + // "DONE" + // "FAILED" + // "RUNNING" + State string `json:"state,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Failure") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportStatus) MarshalJSON() ([]byte, error) { + type noMethod ReportStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RowStatus: Represents the upload status of a row in the request. +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"` + + // ForceSendFields is a list of field names (e.g. "Changed") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RowStatus) MarshalJSON() ([]byte, error) { + type noMethod RowStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RunQueryRequest: Request to run a stored query to generate a report. +type RunQueryRequest struct { + // DataRange: Report data range used to generate the report. + // + // Possible values: + // "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" + 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"` + + // ForceSendFields is a list of field names (e.g. "DataRange") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RunQueryRequest) MarshalJSON() ([]byte, error) { + type noMethod RunQueryRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UploadLineItemsRequest: Request to upload line items. +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. + // + // Possible values: + // "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"` + + // ForceSendFields is a list of field names (e.g. "DryRun") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UploadLineItemsRequest) MarshalJSON() ([]byte, error) { + type noMethod UploadLineItemsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UploadLineItemsResponse: Upload line items response. +type UploadLineItemsResponse struct { + // UploadStatus: Status of upload. + UploadStatus *UploadStatus `json:"uploadStatus,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "UploadStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UploadLineItemsResponse) MarshalJSON() ([]byte, error) { + type noMethod UploadLineItemsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UploadStatus: Represents the status of upload. +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"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UploadStatus) MarshalJSON() ([]byte, error) { + type noMethod UploadStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "doubleclickbidmanager.lineitems.downloadlineitems": + +type LineitemsDownloadlineitemsCall struct { + s *Service + downloadlineitemsrequest *DownloadLineItemsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LineitemsDownloadlineitemsCall) Fields(s ...googleapi.Field) *LineitemsDownloadlineitemsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LineitemsDownloadlineitemsCall) Context(ctx context.Context) *LineitemsDownloadlineitemsCall { + c.ctx_ = ctx + return c +} + +func (c *LineitemsDownloadlineitemsCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "doubleclickbidmanager.lineitems.downloadlineitems" call. +// Exactly one of *DownloadLineItemsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *DownloadLineItemsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LineitemsDownloadlineitemsCall) Do() (*DownloadLineItemsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DownloadLineItemsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LineitemsUploadlineitemsCall) Fields(s ...googleapi.Field) *LineitemsUploadlineitemsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LineitemsUploadlineitemsCall) Context(ctx context.Context) *LineitemsUploadlineitemsCall { + c.ctx_ = ctx + return c +} + +func (c *LineitemsUploadlineitemsCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "doubleclickbidmanager.lineitems.uploadlineitems" call. +// Exactly one of *UploadLineItemsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *UploadLineItemsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LineitemsUploadlineitemsCall) Do() (*UploadLineItemsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UploadLineItemsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *QueriesCreatequeryCall) Fields(s ...googleapi.Field) *QueriesCreatequeryCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *QueriesCreatequeryCall) Context(ctx context.Context) *QueriesCreatequeryCall { + c.ctx_ = ctx + return c +} + +func (c *QueriesCreatequeryCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "doubleclickbidmanager.queries.createquery" call. +// Exactly one of *Query or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Query.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *QueriesCreatequeryCall) Do() (*Query, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Query{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *QueriesDeletequeryCall) Fields(s ...googleapi.Field) *QueriesDeletequeryCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *QueriesDeletequeryCall) Context(ctx context.Context) *QueriesDeletequeryCall { + c.ctx_ = ctx + return c +} + +func (c *QueriesDeletequeryCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "query/{queryId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "queryId": strconv.FormatInt(c.queryId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "doubleclickbidmanager.queries.deletequery" call. +func (c *QueriesDeletequeryCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *QueriesGetqueryCall) Fields(s ...googleapi.Field) *QueriesGetqueryCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *QueriesGetqueryCall) IfNoneMatch(entityTag string) *QueriesGetqueryCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *QueriesGetqueryCall) Context(ctx context.Context) *QueriesGetqueryCall { + c.ctx_ = ctx + return c +} + +func (c *QueriesGetqueryCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "query/{queryId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "queryId": strconv.FormatInt(c.queryId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "doubleclickbidmanager.queries.getquery" call. +// Exactly one of *Query or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Query.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *QueriesGetqueryCall) Do() (*Query, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Query{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// Listqueries: Retrieves stored queries. +func (r *QueriesService) Listqueries() *QueriesListqueriesCall { + c := &QueriesListqueriesCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *QueriesListqueriesCall) Fields(s ...googleapi.Field) *QueriesListqueriesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *QueriesListqueriesCall) IfNoneMatch(entityTag string) *QueriesListqueriesCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *QueriesListqueriesCall) Context(ctx context.Context) *QueriesListqueriesCall { + c.ctx_ = ctx + return c +} + +func (c *QueriesListqueriesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "queries") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "doubleclickbidmanager.queries.listqueries" call. +// Exactly one of *ListQueriesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListQueriesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *QueriesListqueriesCall) Do() (*ListQueriesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListQueriesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *QueriesRunqueryCall) Fields(s ...googleapi.Field) *QueriesRunqueryCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *QueriesRunqueryCall) Context(ctx context.Context) *QueriesRunqueryCall { + c.ctx_ = ctx + return c +} + +func (c *QueriesRunqueryCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "query/{queryId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "queryId": strconv.FormatInt(c.queryId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "doubleclickbidmanager.queries.runquery" call. +func (c *QueriesRunqueryCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsListreportsCall) Fields(s ...googleapi.Field) *ReportsListreportsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsListreportsCall) IfNoneMatch(entityTag string) *ReportsListreportsCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsListreportsCall) Context(ctx context.Context) *ReportsListreportsCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsListreportsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "queries/{queryId}/reports") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "queryId": strconv.FormatInt(c.queryId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "doubleclickbidmanager.reports.listreports" call. +// Exactly one of *ListReportsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListReportsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReportsListreportsCall) Do() (*ListReportsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListReportsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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/Godeps/_workspace/src/google.golang.org/api/doubleclicksearch/v2/doubleclicksearch-api.json b/Godeps/_workspace/src/google.golang.org/api/doubleclicksearch/v2/doubleclicksearch-api.json new file mode 100644 index 000000000..4fdec893c --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/doubleclicksearch/v2/doubleclicksearch-api.json @@ -0,0 +1,1109 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/TYEElx_gLlz3G4Z0qoDLbuCjb8k\"", + "discoveryVersion": "v1", + "id": "doubleclicksearch:v2", + "name": "doubleclicksearch", + "version": "v2", + "revision": "20151006", + "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" + }, + "attributionModel": { + "type": "string", + "description": "This field is ignored." + }, + "campaignId": { + "type": "string", + "description": "DS campaign ID.", + "format": "int64" + }, + "channel": { + "type": "string", + "description": "Sales channel for the product. Acceptable values are: \n- \"local\": a physical store \n- \"online\": an online store" + }, + "clickId": { + "type": "string", + "description": "DS click ID for the conversion." + }, + "conversionId": { + "type": "string", + "description": "For offline conversions, this is an ID provided by advertisers. Advertisers can use this property to specify an ID that is meaningful to them. If an advertiser doesn't specify a conversionId, DoubleClick Search generates one. For online conversions, DS copies the dsConversionId or floodlightOrderId into this property depending on the advertiser's Floodlight instructions.", + "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" + ] + } + }, + "countMillis": { + "type": "string", + "description": "This field is ignored.", + "format": "int64" + }, + "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" + } + }, + "deviceType": { + "type": "string", + "description": "The type of device on which the conversion occurred." + }, + "dsConversionId": { + "type": "string", + "description": "ID that DoubleClick Search generates for each conversion.", + "format": "int64" + }, + "engineAccountId": { + "type": "string", + "description": "DS engine account ID.", + "format": "int64" + }, + "floodlightOrderId": { + "type": "string", + "description": "The Floodlight order ID provided by the advertiser for the conversion." + }, + "inventoryAccountId": { + "type": "string", + "description": "ID that DS generates and uses to uniquely identify the inventory account that contains the product.", + "format": "int64" + }, + "productCountry": { + "type": "string", + "description": "The country registered for the Merchant Center feed that contains the product. Use an ISO 3166 code to specify a country." + }, + "productGroupId": { + "type": "string", + "description": "DS product group ID.", + "format": "int64" + }, + "productId": { + "type": "string", + "description": "The product ID (SKU)." + }, + "productLanguage": { + "type": "string", + "description": "The language registered for the Merchant Center feed that contains the product. Use an ISO 639 code to specify a language." + }, + "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 REMOVED. Note: state DELETED is deprecated." + }, + "storeId": { + "type": "string", + "description": "The ID of the local store for which the product was advertised. Applicable only when the channel is \"local\"." + }, + "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." + } + } + }, + "ReportApiColumnSpec": { + "id": "ReportApiColumnSpec", + "type": "object", + "description": "A request object used to create a DoubleClick Search report.", + "properties": { + "columnName": { + "type": "string", + "description": "Name of a DoubleClick Search column to include in the report." + }, + "customDimensionName": { + "type": "string", + "description": "Segments a report by a custom dimension. The report must be scoped to an advertiser or lower, and the custom dimension must already be set up in DoubleClick Search. The custom dimension name, which appears in DoubleClick Search, is case sensitive.\nIf used in a conversion report, returns the value of the specified custom dimension for the given conversion, if set. This column does not segment the conversion report." + }, + "customMetricName": { + "type": "string", + "description": "Name of a custom metric to include in the report. The report must be scoped to an advertiser or lower, and the custom metric must already be set up in DoubleClick Search. The custom metric name, which appears in DoubleClick Search, is case sensitive." + }, + "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." + }, + "platformSource": { + "type": "string", + "description": "The platform that is used to provide data for the custom dimension. Acceptable values are \"floodlight\"." + }, + "productReportPerspective": { + "type": "string", + "description": "Provide different source for product items. Acceptable values are \"advertised\" and \"sold\"." + }, + "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." + } + } + }, + "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": { + "$ref": "ReportApiColumnSpec" + } + }, + "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": { + "$ref": "ReportApiColumnSpec", + "description": "Column to perform the filter on. This can be a DoubleClick Search column or a saved column." + }, + "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. Defaults to false. Deprecated, please use includeRemovedEntities instead.", + "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": { + "$ref": "ReportApiColumnSpec", + "description": "Column to perform the sort on. This can be a DoubleClick Search-defined column or a saved column." + }, + "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." + } + }, + "SavedColumn": { + "id": "SavedColumn", + "type": "object", + "description": "A saved column", + "properties": { + "kind": { + "type": "string", + "description": "Identifies this as a SavedColumn resource. Value: the fixed string doubleclicksearch#savedColumn.", + "default": "doubleclicksearch#savedColumn" + }, + "savedColumnName": { + "type": "string", + "description": "The name of the saved column." + }, + "type": { + "type": "string", + "description": "The type of data this saved column will produce." + } + } + }, + "SavedColumnList": { + "id": "SavedColumnList", + "type": "object", + "description": "A list of saved columns. Advertisers create saved columns to report on Floodlight activities, Google Analytics goals, or custom KPIs. To request reports with saved columns, you'll need the saved column names that are available from this list.", + "properties": { + "items": { + "type": "array", + "description": "The saved columns being requested.", + "items": { + "$ref": "SavedColumn" + } + }, + "kind": { + "type": "string", + "description": "Identifies this as a SavedColumnList resource. Value: the fixed string doubleclicksearch#savedColumnList.", + "default": "doubleclicksearch#savedColumnList" + } + } + }, + "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 encoded in UTF-8.", + "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" + ] + } + } + }, + "savedColumns": { + "methods": { + "list": { + "id": "doubleclicksearch.savedColumns.list", + "path": "agency/{agencyId}/advertiser/{advertiserId}/savedcolumns", + "httpMethod": "GET", + "description": "Retrieve the list of saved columns for a specified advertiser.", + "parameters": { + "advertiserId": { + "type": "string", + "description": "DS ID of the advertiser.", + "required": true, + "format": "int64", + "location": "path" + }, + "agencyId": { + "type": "string", + "description": "DS ID of the agency.", + "required": true, + "format": "int64", + "location": "path" + } + }, + "parameterOrder": [ + "agencyId", + "advertiserId" + ], + "response": { + "$ref": "SavedColumnList" + }, + "scopes": [ + "https://www.googleapis.com/auth/doubleclicksearch" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/doubleclicksearch/v2/doubleclicksearch-gen.go b/Godeps/_workspace/src/google.golang.org/api/doubleclicksearch/v2/doubleclicksearch-gen.go new file mode 100644 index 000000000..d18373db7 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/doubleclicksearch/v2/doubleclicksearch-gen.go @@ -0,0 +1,2244 @@ +// Package doubleclicksearch provides access to the DoubleClick Search API. +// +// See https://developers.google.com/doubleclick-search/ +// +// Usage example: +// +// import "google.golang.org/api/doubleclicksearch/v2" +// ... +// doubleclicksearchService, err := doubleclicksearch.New(oauthHttpClient) +package doubleclicksearch // import "google.golang.org/api/doubleclicksearch/v2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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) + s.SavedColumns = NewSavedColumnsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Conversion *ConversionService + + Reports *ReportsService + + SavedColumns *SavedColumnsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 +} + +func NewSavedColumnsService(s *Service) *SavedColumnsService { + rs := &SavedColumnsService{s: s} + return rs +} + +type SavedColumnsService struct { + s *Service +} + +// Availability: A message containing availability data relevant to +// DoubleClick Search. +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"` + + // ForceSendFields is a list of field names (e.g. "AdvertiserId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Availability) MarshalJSON() ([]byte, error) { + type noMethod Availability + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Conversion: A conversion containing data relevant to DoubleClick +// Search. +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"` + + // AttributionModel: This field is ignored. + AttributionModel string `json:"attributionModel,omitempty"` + + // CampaignId: DS campaign ID. + CampaignId int64 `json:"campaignId,omitempty,string"` + + // Channel: Sales channel for the product. Acceptable values are: + // - "local": a physical store + // - "online": an online store + Channel string `json:"channel,omitempty"` + + // ClickId: DS click ID for the conversion. + ClickId string `json:"clickId,omitempty"` + + // ConversionId: For offline conversions, this is an ID provided by + // advertisers. Advertisers can use this property to specify an ID that + // is meaningful to them. If an advertiser doesn't specify a + // conversionId, DoubleClick Search generates one. For online + // conversions, DS copies the dsConversionId or floodlightOrderId into + // this property depending on the advertiser's Floodlight instructions. + 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"` + + // CountMillis: This field is ignored. + CountMillis int64 `json:"countMillis,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"` + + // DeviceType: The type of device on which the conversion occurred. + DeviceType string `json:"deviceType,omitempty"` + + // DsConversionId: ID that DoubleClick Search generates for each + // conversion. + DsConversionId int64 `json:"dsConversionId,omitempty,string"` + + // EngineAccountId: DS engine account ID. + EngineAccountId int64 `json:"engineAccountId,omitempty,string"` + + // FloodlightOrderId: The Floodlight order ID provided by the advertiser + // for the conversion. + FloodlightOrderId string `json:"floodlightOrderId,omitempty"` + + // InventoryAccountId: ID that DS generates and uses to uniquely + // identify the inventory account that contains the product. + InventoryAccountId int64 `json:"inventoryAccountId,omitempty,string"` + + // ProductCountry: The country registered for the Merchant Center feed + // that contains the product. Use an ISO 3166 code to specify a country. + ProductCountry string `json:"productCountry,omitempty"` + + // ProductGroupId: DS product group ID. + ProductGroupId int64 `json:"productGroupId,omitempty,string"` + + // ProductId: The product ID (SKU). + ProductId string `json:"productId,omitempty"` + + // ProductLanguage: The language registered for the Merchant Center feed + // that contains the product. Use an ISO 639 code to specify a language. + ProductLanguage string `json:"productLanguage,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 + // REMOVED. Note: state DELETED is deprecated. + State string `json:"state,omitempty"` + + // StoreId: The ID of the local store for which the product was + // advertised. Applicable only when the channel is "local". + StoreId string `json:"storeId,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"` + + // ForceSendFields is a list of field names (e.g. "AdGroupId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Conversion) MarshalJSON() ([]byte, error) { + type noMethod Conversion + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ConversionList: A list of conversions. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Conversion") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ConversionList) MarshalJSON() ([]byte, error) { + type noMethod ConversionList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomDimension: A message containing the custome dimension. +type CustomDimension struct { + // Name: Custom dimension name. + Name string `json:"name,omitempty"` + + // Value: Custom dimension value. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomDimension) MarshalJSON() ([]byte, error) { + type noMethod CustomDimension + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CustomMetric: A message containing the custome metric. +type CustomMetric struct { + // Name: Custom metric name. + Name string `json:"name,omitempty"` + + // Value: Custom metric numeric value. + Value float64 `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CustomMetric) MarshalJSON() ([]byte, error) { + type noMethod CustomMetric + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Report: 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. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Files") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Report) MarshalJSON() ([]byte, error) { + type noMethod Report + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "ByteCount") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportFiles) MarshalJSON() ([]byte, error) { + type noMethod ReportFiles + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportApiColumnSpec: A request object used to create a DoubleClick +// Search report. +type ReportApiColumnSpec struct { + // ColumnName: Name of a DoubleClick Search column to include in the + // report. + ColumnName string `json:"columnName,omitempty"` + + // CustomDimensionName: Segments a report by a custom dimension. The + // report must be scoped to an advertiser or lower, and the custom + // dimension must already be set up in DoubleClick Search. The custom + // dimension name, which appears in DoubleClick Search, is case + // sensitive. + // If used in a conversion report, returns the value of the specified + // custom dimension for the given conversion, if set. This column does + // not segment the conversion report. + CustomDimensionName string `json:"customDimensionName,omitempty"` + + // CustomMetricName: Name of a custom metric to include in the report. + // The report must be scoped to an advertiser or lower, and the custom + // metric must already be set up in DoubleClick Search. The custom + // metric name, which appears in DoubleClick Search, is case sensitive. + CustomMetricName string `json:"customMetricName,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"` + + // PlatformSource: The platform that is used to provide data for the + // custom dimension. Acceptable values are "floodlight". + PlatformSource string `json:"platformSource,omitempty"` + + // ProductReportPerspective: Provide different source for product items. + // Acceptable values are "advertised" and "sold". + ProductReportPerspective string `json:"productReportPerspective,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"` + + // ForceSendFields is a list of field names (e.g. "ColumnName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportApiColumnSpec) MarshalJSON() ([]byte, error) { + type noMethod ReportApiColumnSpec + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportRequest: A request object used to create a DoubleClick Search +// report. +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 []*ReportApiColumnSpec `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. Defaults to false. Deprecated, please use + // includeRemovedEntities instead. + 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. + // + // Default: 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"` + + // ForceSendFields is a list of field names (e.g. "Columns") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportRequest) MarshalJSON() ([]byte, error) { + type noMethod ReportRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ReportRequestFilters struct { + // Column: Column to perform the filter on. This can be a DoubleClick + // Search column or a saved column. + Column *ReportApiColumnSpec `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"` + + // ForceSendFields is a list of field names (e.g. "Column") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportRequestFilters) MarshalJSON() ([]byte, error) { + type noMethod ReportRequestFilters + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ReportRequestOrderBy struct { + // Column: Column to perform the sort on. This can be a DoubleClick + // Search-defined column or a saved column. + Column *ReportApiColumnSpec `json:"column,omitempty"` + + // SortOrder: The sort direction, which is either ascending or + // descending. + SortOrder string `json:"sortOrder,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Column") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportRequestOrderBy) MarshalJSON() ([]byte, error) { + type noMethod ReportRequestOrderBy + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportRequestReportScope: 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. +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"` + + // ForceSendFields is a list of field names (e.g. "AdGroupId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportRequestReportScope) MarshalJSON() ([]byte, error) { + type noMethod ReportRequestReportScope + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReportRequestTimeRange: If metrics are requested in a report, this +// argument will be used to restrict the metrics to a specific time +// range. +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"` + + // ForceSendFields is a list of field names (e.g. + // "ChangedAttributesSinceTimestamp") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReportRequestTimeRange) MarshalJSON() ([]byte, error) { + type noMethod ReportRequestTimeRange + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ReportRow interface{} + +// SavedColumn: A saved column +type SavedColumn struct { + // Kind: Identifies this as a SavedColumn resource. Value: the fixed + // string doubleclicksearch#savedColumn. + Kind string `json:"kind,omitempty"` + + // SavedColumnName: The name of the saved column. + SavedColumnName string `json:"savedColumnName,omitempty"` + + // Type: The type of data this saved column will produce. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SavedColumn) MarshalJSON() ([]byte, error) { + type noMethod SavedColumn + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SavedColumnList: A list of saved columns. Advertisers create saved +// columns to report on Floodlight activities, Google Analytics goals, +// or custom KPIs. To request reports with saved columns, you'll need +// the saved column names that are available from this list. +type SavedColumnList struct { + // Items: The saved columns being requested. + Items []*SavedColumn `json:"items,omitempty"` + + // Kind: Identifies this as a SavedColumnList resource. Value: the fixed + // string doubleclicksearch#savedColumnList. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SavedColumnList) MarshalJSON() ([]byte, error) { + type noMethod SavedColumnList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UpdateAvailabilityRequest: The request to update availability. +type UpdateAvailabilityRequest struct { + // Availabilities: The availabilities being requested. + Availabilities []*Availability `json:"availabilities,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Availabilities") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UpdateAvailabilityRequest) MarshalJSON() ([]byte, error) { + type noMethod UpdateAvailabilityRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UpdateAvailabilityResponse: The response to a update availability +// request. +type UpdateAvailabilityResponse struct { + // Availabilities: The availabilities being returned. + Availabilities []*Availability `json:"availabilities,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Availabilities") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UpdateAvailabilityResponse) MarshalJSON() ([]byte, error) { + type noMethod UpdateAvailabilityResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ConversionGetCall) Fields(s ...googleapi.Field) *ConversionGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ConversionGetCall) IfNoneMatch(entityTag string) *ConversionGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ConversionGetCall) Context(ctx context.Context) *ConversionGetCall { + c.ctx_ = ctx + return c +} + +func (c *ConversionGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "agencyId": strconv.FormatInt(c.agencyId, 10), + "advertiserId": strconv.FormatInt(c.advertiserId, 10), + "engineAccountId": strconv.FormatInt(c.engineAccountId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "doubleclicksearch.conversion.get" call. +// Exactly one of *ConversionList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ConversionList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ConversionGetCall) Do() (*ConversionList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ConversionList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ConversionInsertCall) Fields(s ...googleapi.Field) *ConversionInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ConversionInsertCall) Context(ctx context.Context) *ConversionInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ConversionInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "doubleclicksearch.conversion.insert" call. +// Exactly one of *ConversionList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ConversionList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ConversionInsertCall) Do() (*ConversionList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ConversionList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ConversionPatchCall) Fields(s ...googleapi.Field) *ConversionPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ConversionPatchCall) Context(ctx context.Context) *ConversionPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ConversionPatchCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "doubleclicksearch.conversion.patch" call. +// Exactly one of *ConversionList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ConversionList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ConversionPatchCall) Do() (*ConversionList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ConversionList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ConversionUpdateCall) Fields(s ...googleapi.Field) *ConversionUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ConversionUpdateCall) Context(ctx context.Context) *ConversionUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ConversionUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "doubleclicksearch.conversion.update" call. +// Exactly one of *ConversionList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ConversionList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ConversionUpdateCall) Do() (*ConversionList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ConversionList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ConversionUpdateAvailabilityCall) Fields(s ...googleapi.Field) *ConversionUpdateAvailabilityCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ConversionUpdateAvailabilityCall) Context(ctx context.Context) *ConversionUpdateAvailabilityCall { + c.ctx_ = ctx + return c +} + +func (c *ConversionUpdateAvailabilityCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "doubleclicksearch.conversion.updateAvailability" call. +// Exactly one of *UpdateAvailabilityResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *UpdateAvailabilityResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ConversionUpdateAvailabilityCall) Do() (*UpdateAvailabilityResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UpdateAvailabilityResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsGenerateCall) Fields(s ...googleapi.Field) *ReportsGenerateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsGenerateCall) Context(ctx context.Context) *ReportsGenerateCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsGenerateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "doubleclicksearch.reports.generate" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsGenerateCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsGetCall) Fields(s ...googleapi.Field) *ReportsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsGetCall) IfNoneMatch(entityTag string) *ReportsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsGetCall) Context(ctx context.Context) *ReportsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{reportId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "reportId": c.reportId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "doubleclicksearch.reports.get" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsGetCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// GetFile: Downloads a report file encoded in UTF-8. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsGetFileCall) Fields(s ...googleapi.Field) *ReportsGetFileCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsGetFileCall) IfNoneMatch(entityTag string) *ReportsGetFileCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsGetFileCall) Context(ctx context.Context) *ReportsGetFileCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsGetFileCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{reportId}/files/{reportFragment}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "reportId": c.reportId, + "reportFragment": strconv.FormatInt(c.reportFragment, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *ReportsGetFileCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "doubleclicksearch.reports.getFile" call. +func (c *ReportsGetFileCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Downloads a report file encoded in UTF-8.", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsRequestCall) Fields(s ...googleapi.Field) *ReportsRequestCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsRequestCall) Context(ctx context.Context) *ReportsRequestCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsRequestCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "doubleclicksearch.reports.request" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsRequestCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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" + // ] + // } + +} + +// method id "doubleclicksearch.savedColumns.list": + +type SavedColumnsListCall struct { + s *Service + agencyId int64 + advertiserId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieve the list of saved columns for a specified advertiser. +func (r *SavedColumnsService) List(agencyId int64, advertiserId int64) *SavedColumnsListCall { + c := &SavedColumnsListCall{s: r.s, opt_: make(map[string]interface{})} + c.agencyId = agencyId + c.advertiserId = advertiserId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SavedColumnsListCall) Fields(s ...googleapi.Field) *SavedColumnsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SavedColumnsListCall) IfNoneMatch(entityTag string) *SavedColumnsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SavedColumnsListCall) Context(ctx context.Context) *SavedColumnsListCall { + c.ctx_ = ctx + return c +} + +func (c *SavedColumnsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "agency/{agencyId}/advertiser/{advertiserId}/savedcolumns") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "agencyId": strconv.FormatInt(c.agencyId, 10), + "advertiserId": strconv.FormatInt(c.advertiserId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "doubleclicksearch.savedColumns.list" call. +// Exactly one of *SavedColumnList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SavedColumnList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SavedColumnsListCall) Do() (*SavedColumnList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SavedColumnList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieve the list of saved columns for a specified advertiser.", + // "httpMethod": "GET", + // "id": "doubleclicksearch.savedColumns.list", + // "parameterOrder": [ + // "agencyId", + // "advertiserId" + // ], + // "parameters": { + // "advertiserId": { + // "description": "DS ID of the advertiser.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "agencyId": { + // "description": "DS ID of the agency.", + // "format": "int64", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "agency/{agencyId}/advertiser/{advertiserId}/savedcolumns", + // "response": { + // "$ref": "SavedColumnList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/doubleclicksearch" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/drive/v1/drive-api.json b/Godeps/_workspace/src/google.golang.org/api/drive/v1/drive-api.json new file mode 100644 index 000000000..1c4dc1e20 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/drive/v1/drive-api.json @@ -0,0 +1,417 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/yTdDeTQGX0QbumSXoV_ilLcKyf0\"", + "discoveryVersion": "v1", + "id": "drive:v1", + "name": "drive", + "version": "v1", + "revision": "20150618", + "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 and folders 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 RFC 3339 timestamp).", + "format": "date-time" + }, + "description": { + "type": "string", + "description": "A short description of the file" + }, + "downloadUrl": { + "type": "string" + }, + "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": "5120GB", + "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 true or not set, a new blob is created as head revision, and previous unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions.", + "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 true or not set, a new blob is created as head revision, and previous unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions.", + "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": "5120GB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/drive/v1/files/{id}" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/drive/v1/files/{id}" + } + } + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/drive/v1/drive-gen.go b/Godeps/_workspace/src/google.golang.org/api/drive/v1/drive-gen.go new file mode 100644 index 000000000..48fedb01f --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/drive/v1/drive-gen.go @@ -0,0 +1,1113 @@ +// Package drive provides access to the Drive API. +// +// See https://developers.google.com/drive/ +// +// Usage example: +// +// import "google.golang.org/api/drive/v1" +// ... +// driveService, err := drive.New(oauthHttpClient) +package drive // import "google.golang.org/api/drive/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 and folders 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 + UserAgent string // optional additional User-Agent fragment + + Files *FilesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewFilesService(s *Service) *FilesService { + rs := &FilesService{s: s} + return rs +} + +type FilesService struct { + s *Service +} + +// File: The metadata for a file. +type File struct { + // CreatedDate: Create time for this file (formatted RFC 3339 + // timestamp). + CreatedDate string `json:"createdDate,omitempty"` + + // Description: A short description of the file + Description string `json:"description,omitempty"` + + 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreatedDate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *File) MarshalJSON() ([]byte, error) { + type noMethod File + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FileIndexableText: Indexable text attributes for the file (can only +// be written) +type FileIndexableText struct { + // Text: The text to be indexed for this file + Text string `json:"text,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Text") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileIndexableText) MarshalJSON() ([]byte, error) { + type noMethod FileIndexableText + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FileLabels: Labels for the file. +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"` + + // ForceSendFields is a list of field names (e.g. "Hidden") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileLabels) MarshalJSON() ([]byte, error) { + type noMethod FileLabels + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileParentsCollection) MarshalJSON() ([]byte, error) { + type noMethod FileParentsCollection + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Permission: A single permission for a file. +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"` + + // ForceSendFields is a list of field names (e.g. "AdditionalRoles") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Permission) MarshalJSON() ([]byte, error) { + type noMethod Permission + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "drive.files.get": + +type FilesGetCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "BASIC" - Deprecated +// "FULL" - Deprecated +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FilesGetCall) IfNoneMatch(entityTag string) *FilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FilesGetCall) Context(ctx context.Context) *FilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *FilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.files.get" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FilesGetCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets 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 + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// 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 +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *FilesInsertCall) Media(r io.Reader) *FilesInsertCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *FilesInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *FilesInsertCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *FilesInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *FilesInsertCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesInsertCall) Fields(s ...googleapi.Field) *FilesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *FilesInsertCall) Context(ctx context.Context) *FilesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *FilesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.files.insert" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FilesInsertCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a file, and any settable metadata or blob content sent with the request.", + // "httpMethod": "POST", + // "id": "drive.files.insert", + // "mediaUpload": { + // "accept": [ + // "*/*" + // ], + // "maxSize": "5120GB", + // "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{} + ctx_ context.Context +} + +// 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 true or not set, a new blob is +// created as head revision, and previous unpinned revisions are +// preserved for a short period of time. Pinned revisions are stored +// indefinitely, using additional storage quota, up to a maximum of 200 +// revisions. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesPatchCall) Fields(s ...googleapi.Field) *FilesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FilesPatchCall) Context(ctx context.Context) *FilesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *FilesPatchCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.files.patch" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FilesPatchCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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 true or not set, a new blob is created as head revision, and previous unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions.", + // "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 + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// 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 true or not set, a new blob is +// created as head revision, and previous unpinned revisions are +// preserved for a short period of time. Pinned revisions are stored +// indefinitely, using additional storage quota, up to a maximum of 200 +// revisions. +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 +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *FilesUpdateCall) Media(r io.Reader) *FilesUpdateCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *FilesUpdateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *FilesUpdateCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *FilesUpdateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *FilesUpdateCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesUpdateCall) Fields(s ...googleapi.Field) *FilesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *FilesUpdateCall) Context(ctx context.Context) *FilesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *FilesUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{id}") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.files.update" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FilesUpdateCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates file metadata and/or content", + // "httpMethod": "PUT", + // "id": "drive.files.update", + // "mediaUpload": { + // "accept": [ + // "*/*" + // ], + // "maxSize": "5120GB", + // "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 true or not set, a new blob is created as head revision, and previous unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions.", + // "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/Godeps/_workspace/src/google.golang.org/api/drive/v2/drive-api.json b/Godeps/_workspace/src/google.golang.org/api/drive/v2/drive-api.json new file mode 100644 index 000000000..a9afe87b3 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/drive/v2/drive-api.json @@ -0,0 +1,4277 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/j3Wwh3EWBgWZwRehTCtXuS9oPH4\"", + "discoveryVersion": "v1", + "id": "drive:v2", + "name": "drive", + "version": "v2", + "revision": "20151008", + "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 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 and folders that you have opened or created with this app" + }, + "https://www.googleapis.com/auth/drive.metadata": { + "description": "View and manage metadata of files in your Google Drive" + }, + "https://www.googleapis.com/auth/drive.metadata.readonly": { + "description": "View metadata for files in your Google Drive" + }, + "https://www.googleapis.com/auth/drive.photos.readonly": { + "description": "View the photos, videos and albums in your Google Photos" + }, + "https://www.googleapis.com/auth/drive.readonly": { + "description": "View the files 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. Possible values are: \n- allowed \n- allowedWithWarning \n- incomingOnly \n- disallowed" + }, + "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" + } + } + } + }, + "folderColorPalette": { + "type": "array", + "description": "The palette of allowable folder colors as RGB hex strings.", + "items": { + "type": "string" + } + }, + "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" + }, + "languageCode": { + "type": "string", + "description": "The user's language or locale code, as defined by BCP 47, with some extensions from Unicode's LDML format (http://www.unicode.org/reports/tr35/)." + }, + "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." + }, + "quotaBytesByService": { + "type": "array", + "description": "The amount of storage quota used by different Google services.", + "items": { + "type": "object", + "properties": { + "bytesUsed": { + "type": "string", + "description": "The storage quota bytes used by the service.", + "format": "int64" + }, + "serviceName": { + "type": "string", + "description": "The service's name, e.g. DRIVE, GMAIL, or PHOTOS." + } + } + } + }, + "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" + }, + "quotaType": { + "type": "string", + "description": "The type of the user's storage quota. Possible values are: \n- LIMITED \n- UNLIMITED" + }, + "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." + }, + "hasDriveWideScope": { + "type": "boolean", + "description": "Whether the app has drive-wide scope. An app with drive-wide scope can access all files in the user's drive." + }, + "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. See Open Files for the full documentation." + }, + "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." + }, + "supportsOfflineCreate": { + "type": "boolean", + "description": "Whether this app supports creating new files when offline." + }, + "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": { + "defaultAppIds": { + "type": "array", + "description": "List of app IDs that the user has specified to use by default. The list is in reverse-priority order (lowest to highest).", + "items": { + "type": "string" + } + }, + "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 a relevant Google editor or viewer." + }, + "appDataContents": { + "type": "boolean", + "description": "Whether this file is in the Application Data folder." + }, + "canComment": { + "type": "boolean", + "description": "Whether the current user can comment on the file." + }, + "copyable": { + "type": "boolean", + "description": "Whether the file can be copied by the current user." + }, + "createdDate": { + "type": "string", + "description": "Create time for this file (formatted RFC 3339 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" + }, + "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." + }, + "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 final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files." + }, + "fileSize": { + "type": "string", + "description": "The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.", + "format": "int64" + }, + "folderColorRgb": { + "type": "string", + "description": "Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette." + }, + "fullFileExtension": { + "type": "string", + "description": "The full file extension; extracted from the title. May contain multiple concatenated extensions, such as \"tar.gz\". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files." + }, + "headRevisionId": { + "type": "string", + "description": "The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files." + }, + "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 and commenters are prevented from downloading, printing, and copying this file." + }, + "starred": { + "type": "boolean", + "description": "Whether this file is starred by the user." + }, + "trashed": { + "type": "boolean", + "description": "Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files." + }, + "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" + }, + "markedViewedByMeDate": { + "type": "string", + "description": "Deprecated.", + "format": "date-time" + }, + "md5Checksum": { + "type": "string", + "description": "An MD5 checksum for the content of this file. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files." + }, + "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 field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files." + }, + "ownedByMe": { + "type": "boolean", + "description": "Whether the file is owned by the current user." + }, + "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" + } + }, + "permissions": { + "type": "array", + "description": "The list of permissions for users with access to this file.", + "items": { + "$ref": "Permission" + } + }, + "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." + }, + "shareable": { + "type": "boolean", + "description": "Whether the file's sharing settings can be modified by the current user." + }, + "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" + }, + "sharingUser": { + "$ref": "User", + "description": "User that shared the item with the current user, if available." + }, + "spaces": { + "type": "array", + "description": "The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.", + "items": { + "type": "string" + } + }, + "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. It should conform to RFC 4648 section 5.", + "format": "byte" + }, + "mimeType": { + "type": "string", + "description": "The MIME type of the thumbnail." + } + } + }, + "thumbnailLink": { + "type": "string", + "description": "A short-lived link to the file's thumbnail. Typically lasts on the order of hours." + }, + "title": { + "type": "string", + "description": "The title of this file." + }, + "userPermission": { + "$ref": "Permission", + "description": "The permissions for the authenticated user on this file." + }, + "version": { + "type": "string", + "description": "A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.", + "format": "int64" + }, + "videoMediaMetadata": { + "type": "object", + "description": "Metadata about video media. This will only be present for video types.", + "properties": { + "durationMillis": { + "type": "string", + "description": "The duration of the video in milliseconds.", + "format": "int64" + }, + "height": { + "type": "integer", + "description": "The height of the video in pixels.", + "format": "int32" + }, + "width": { + "type": "integer", + "description": "The width of the video in pixels.", + "format": "int32" + } + } + }, + "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." + } + } + }, + "GeneratedIds": { + "id": "GeneratedIds", + "type": "object", + "description": "A list of generated IDs which can be provided in insert requests", + "properties": { + "ids": { + "type": "array", + "description": "The IDs generated for the requesting user in the specified space.", + "items": { + "type": "string" + } + }, + "kind": { + "type": "string", + "description": "This is always drive#generatedIds", + "default": "drive#generatedIds" + }, + "space": { + "type": "string", + "description": "The type of file that can be created with these IDs." + } + } + }, + "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 present when the permission type is user, group or domain." + }, + "emailAddress": { + "type": "string", + "description": "The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group." + }, + "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 the 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 the 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 attached to a file that is either public or private to an application.\nThe following limits apply to file properties: \n- Maximum of 100 properties total per file\n- Maximum of 30 private properties per app\n- Maximum of 30 public properties\n- Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.", + "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." + }, + "emailAddress": { + "type": "string", + "description": "The email address of the 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 public files the user has opened and shared files. When set to false, this counts only change IDs for owned files and any shared or public files that the user has explicitly added to a folder they own.", + "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", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.photos.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", + "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.", + "parameters": { + "appFilterExtensions": { + "type": "string", + "description": "A comma-separated list of file extensions for open with filtering. All apps within the given app query scope which can open any of the given file extensions will be included in the response. If appFilterMimeTypes are provided as well, the result is a union of the two resulting app lists.", + "default": "", + "location": "query" + }, + "appFilterMimeTypes": { + "type": "string", + "description": "A comma-separated list of MIME types for open with filtering. All apps within the given app query scope which can open any of the given MIME types will be included in the response. If appFilterExtensions are provided as well, the result is a union of the two resulting app lists.", + "default": "", + "location": "query" + }, + "languageCode": { + "type": "string", + "description": "A language or locale code, as defined by BCP 47, with some extensions from Unicode's LDML format (http://www.unicode.org/reports/tr35/).", + "location": "query" + } + }, + "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", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.photos.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 public files the user has opened and shared files. When set to false, the list only includes owned files plus any shared or public files the user has explicitly added to a folder they own.", + "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" + }, + "spaces": { + "type": "string", + "description": "A comma-separated list of spaces to query. Supported values are 'drive', 'appDataFolder' and 'photos'.", + "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", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.photos.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 public files the user has opened and shared files. When set to false, the list only includes owned files plus any shared or public files the user has explicitly added to a folder they own.", + "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" + }, + "spaces": { + "type": "string", + "description": "A comma-separated list of spaces to query. Supported values are 'drive', 'appDataFolder' and 'photos'.", + "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", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.photos.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", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.photos.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", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.photos.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" + }, + "orderBy": { + "type": "string", + "description": "A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', 'lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred', and 'title'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedDate desc,title. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored.", + "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", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.photos.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" + ] + }, + "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" + ] + }, + "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 BCP 47 codes.", + "location": "query" + }, + "pinned": { + "type": "boolean", + "description": "Whether to pin the head revision of the new copy. A file can have a maximum of 200 pinned revisions.", + "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", + "https://www.googleapis.com/auth/drive.photos.readonly" + ] + }, + "delete": { + "id": "drive.files.delete", + "path": "files/{fileId}", + "httpMethod": "DELETE", + "description": "Permanently deletes a file by ID. Skips the trash. The currently authenticated user must own the file.", + "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" + ] + }, + "emptyTrash": { + "id": "drive.files.emptyTrash", + "path": "files/trash", + "httpMethod": "DELETE", + "description": "Permanently deletes all of the user's trashed files.", + "scopes": [ + "https://www.googleapis.com/auth/drive" + ] + }, + "generateIds": { + "id": "drive.files.generateIds", + "path": "files/generateIds", + "httpMethod": "GET", + "description": "Generates a set of file IDs which can be provided in insert requests.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of IDs to return.", + "default": "10", + "format": "int32", + "minimum": "1", + "maximum": "1000", + "location": "query" + }, + "space": { + "type": "string", + "description": "The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'.", + "default": "drive", + "location": "query" + } + }, + "response": { + "$ref": "GeneratedIds" + }, + "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": { + "acknowledgeAbuse": { + "type": "boolean", + "description": "Whether the user is acknowledging the risk of downloading known malware or other abusive files.", + "default": "false", + "location": "query" + }, + "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" + }, + "revisionId": { + "type": "string", + "description": "Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.", + "location": "query" + }, + "updateViewedDate": { + "type": "boolean", + "description": "Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body.", + "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", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.photos.readonly", + "https://www.googleapis.com/auth/drive.readonly" + ], + "supportsMediaDownload": true, + "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 BCP 47 codes.", + "location": "query" + }, + "pinned": { + "type": "boolean", + "description": "Whether to pin the head revision of the uploaded file. A file can have a maximum of 200 pinned revisions.", + "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": "5120GB", + "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": { + "corpus": { + "type": "string", + "description": "The body of items (files/documents) to which the query applies.", + "enum": [ + "DEFAULT", + "DOMAIN" + ], + "enumDescriptions": [ + "The items that the user has accessed.", + "Items shared to the user's domain." + ], + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of files to return.", + "default": "100", + "format": "int32", + "minimum": "0", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', 'lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred', and 'title'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedDate desc,title. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored.", + "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" + }, + "spaces": { + "type": "string", + "description": "A comma-separated list of spaces to query. Supported values are 'drive', 'appDataFolder' and 'photos'.", + "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", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.photos.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": { + "addParents": { + "type": "string", + "description": "Comma-separated list of parent IDs to add.", + "location": "query" + }, + "convert": { + "type": "boolean", + "description": "This parameter is deprecated and has no function.", + "default": "false", + "location": "query" + }, + "fileId": { + "type": "string", + "description": "The ID of the file to update.", + "required": true, + "location": "path" + }, + "modifiedDateBehavior": { + "type": "string", + "description": "Determines the behavior in which modifiedDate is updated. This overrides setModifiedDate.", + "enum": [ + "fromBody", + "fromBodyIfNeeded", + "fromBodyOrNow", + "noChange", + "now", + "nowIfNeeded" + ], + "enumDescriptions": [ + "Set modifiedDate to the value provided in the body of the request. No change if no value was provided.", + "Set modifiedDate to the value provided in the body of the request depending on other contents of the update.", + "Set modifiedDate to the value provided in the body of the request, or to the current time if no value was provided.", + "Maintain the previous value of modifiedDate.", + "Set modifiedDate to the current time.", + "Set modifiedDate to the current time depending on contents of the update." + ], + "location": "query" + }, + "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 true or not set, a new blob is created as head revision, and previous unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions. For details on how revisions are retained, see the Drive Help Center.", + "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 BCP 47 codes.", + "location": "query" + }, + "pinned": { + "type": "boolean", + "description": "Whether to pin the new revision. A file can have a maximum of 200 pinned revisions.", + "default": "false", + "location": "query" + }, + "removeParents": { + "type": "string", + "description": "Comma-separated list of parent IDs to remove.", + "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.metadata", + "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", + "https://www.googleapis.com/auth/drive.metadata" + ] + }, + "trash": { + "id": "drive.files.trash", + "path": "files/{fileId}/trash", + "httpMethod": "POST", + "description": "Moves a file to the trash. The currently authenticated user must own the file.", + "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.appdata", + "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.appdata", + "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": { + "addParents": { + "type": "string", + "description": "Comma-separated list of parent IDs to add.", + "location": "query" + }, + "convert": { + "type": "boolean", + "description": "This parameter is deprecated and has no function.", + "default": "false", + "location": "query" + }, + "fileId": { + "type": "string", + "description": "The ID of the file to update.", + "required": true, + "location": "path" + }, + "modifiedDateBehavior": { + "type": "string", + "description": "Determines the behavior in which modifiedDate is updated. This overrides setModifiedDate.", + "enum": [ + "fromBody", + "fromBodyIfNeeded", + "fromBodyOrNow", + "noChange", + "now", + "nowIfNeeded" + ], + "enumDescriptions": [ + "Set modifiedDate to the value provided in the body of the request. No change if no value was provided.", + "Set modifiedDate to the value provided in the body of the request depending on other contents of the update.", + "Set modifiedDate to the value provided in the body of the request, or to the current time if no value was provided.", + "Maintain the previous value of modifiedDate.", + "Set modifiedDate to the current time.", + "Set modifiedDate to the current time depending on contents of the update." + ], + "location": "query" + }, + "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 true or not set, a new blob is created as head revision, and previous unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions. For details on how revisions are retained, see the Drive Help Center.", + "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 BCP 47 codes.", + "location": "query" + }, + "pinned": { + "type": "boolean", + "description": "Whether to pin the new revision. A file can have a maximum of 200 pinned revisions.", + "default": "false", + "location": "query" + }, + "removeParents": { + "type": "string", + "description": "Comma-separated list of parent IDs to remove.", + "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.metadata", + "https://www.googleapis.com/auth/drive.scripts" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "*/*" + ], + "maxSize": "5120GB", + "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": { + "acknowledgeAbuse": { + "type": "boolean", + "description": "Whether the user is acknowledging the risk of downloading known malware or other abusive files.", + "default": "false", + "location": "query" + }, + "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" + }, + "revisionId": { + "type": "string", + "description": "Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.", + "location": "query" + }, + "updateViewedDate": { + "type": "boolean", + "description": "Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body.", + "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", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.photos.readonly", + "https://www.googleapis.com/auth/drive.readonly" + ], + "supportsMediaDownload": true, + "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", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.photos.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", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.photos.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", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.photos.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", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.photos.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. This parameter is ignored and an email is sent if the role is owner.", + "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", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.photos.readonly", + "https://www.googleapis.com/auth/drive.readonly" + ] + }, + "patch": { + "id": "drive.permissions.patch", + "path": "files/{fileId}/permissions/{permissionId}", + "httpMethod": "PATCH", + "description": "Updates a permission using 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' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'.", + "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' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'.", + "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", + "https://www.googleapis.com/auth/drive.metadata" + ] + }, + "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", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.photos.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", + "https://www.googleapis.com/auth/drive.metadata" + ] + }, + "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", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.photos.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", + "https://www.googleapis.com/auth/drive.metadata" + ] + }, + "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", + "https://www.googleapis.com/auth/drive.metadata" + ] + } + } + }, + "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" + }, + "revision": { + "type": "integer", + "description": "The revision of the Realtime API data model to export. Revisions start at 1 (the initial empty data model) and are incremented with each change. If this parameter is excluded, the most recent data model will be returned.", + "format": "int32", + "minimum": "1", + "location": "query" + } + }, + "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", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.photos.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", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.photos.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/Godeps/_workspace/src/google.golang.org/api/drive/v2/drive-gen.go b/Godeps/_workspace/src/google.golang.org/api/drive/v2/drive-gen.go new file mode 100644 index 000000000..faf32201b --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/drive/v2/drive-gen.go @@ -0,0 +1,11678 @@ +// Package drive provides access to the Drive API. +// +// See https://developers.google.com/drive/ +// +// Usage example: +// +// import "google.golang.org/api/drive/v2" +// ... +// driveService, err := drive.New(oauthHttpClient) +package drive // import "google.golang.org/api/drive/v2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 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 and folders that you have opened + // or created with this app + DriveFileScope = "https://www.googleapis.com/auth/drive.file" + + // View and manage metadata of files in your Google Drive + DriveMetadataScope = "https://www.googleapis.com/auth/drive.metadata" + + // View metadata for files in your Google Drive + DriveMetadataReadonlyScope = "https://www.googleapis.com/auth/drive.metadata.readonly" + + // View the photos, videos and albums in your Google Photos + DrivePhotosReadonlyScope = "https://www.googleapis.com/auth/drive.photos.readonly" + + // View the files 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 + UserAgent string // optional additional User-Agent fragment + + 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 (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 +} + +// About: An item with user information and settings. +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. + // Possible values are: + // - allowed + // - allowedWithWarning + // - incomingOnly + // - disallowed + 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"` + + // FolderColorPalette: The palette of allowable folder colors as RGB hex + // strings. + FolderColorPalette []string `json:"folderColorPalette,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"` + + // LanguageCode: The user's language or locale code, as defined by BCP + // 47, with some extensions from Unicode's LDML format + // (http://www.unicode.org/reports/tr35/). + LanguageCode string `json:"languageCode,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"` + + // QuotaBytesByService: The amount of storage quota used by different + // Google services. + QuotaBytesByService []*AboutQuotaBytesByService `json:"quotaBytesByService,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"` + + // QuotaType: The type of the user's storage quota. Possible values are: + // + // - LIMITED + // - UNLIMITED + QuotaType string `json:"quotaType,omitempty"` + + // 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AdditionalRoleInfo") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *About) MarshalJSON() ([]byte, error) { + type noMethod About + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "RoleSets") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AboutAdditionalRoleInfo) MarshalJSON() ([]byte, error) { + type noMethod AboutAdditionalRoleInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "AdditionalRoles") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AboutAdditionalRoleInfoRoleSets) MarshalJSON() ([]byte, error) { + type noMethod AboutAdditionalRoleInfoRoleSets + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Source") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AboutExportFormats) MarshalJSON() ([]byte, error) { + type noMethod AboutExportFormats + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "FeatureName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AboutFeatures) MarshalJSON() ([]byte, error) { + type noMethod AboutFeatures + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Source") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AboutImportFormats) MarshalJSON() ([]byte, error) { + type noMethod AboutImportFormats + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Size") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AboutMaxUploadSizes) MarshalJSON() ([]byte, error) { + type noMethod AboutMaxUploadSizes + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AboutQuotaBytesByService struct { + // BytesUsed: The storage quota bytes used by the service. + BytesUsed int64 `json:"bytesUsed,omitempty,string"` + + // ServiceName: The service's name, e.g. DRIVE, GMAIL, or PHOTOS. + ServiceName string `json:"serviceName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BytesUsed") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AboutQuotaBytesByService) MarshalJSON() ([]byte, error) { + type noMethod AboutQuotaBytesByService + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// App: 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. +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"` + + // HasDriveWideScope: Whether the app has drive-wide scope. An app with + // drive-wide scope can access all files in the user's drive. + HasDriveWideScope bool `json:"hasDriveWideScope,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. See Open Files for the full documentation. + 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"` + + // SupportsOfflineCreate: Whether this app supports creating new files + // when offline. + SupportsOfflineCreate bool `json:"supportsOfflineCreate,omitempty"` + + // UseByDefault: Whether the app is selected as the default handler for + // the types it supports. + UseByDefault bool `json:"useByDefault,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Authorized") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *App) MarshalJSON() ([]byte, error) { + type noMethod App + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Category") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AppIcons) MarshalJSON() ([]byte, error) { + type noMethod AppIcons + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AppList: A list of third-party applications which the user has +// installed or given access to Google Drive. +type AppList struct { + // DefaultAppIds: List of app IDs that the user has specified to use by + // default. The list is in reverse-priority order (lowest to highest). + DefaultAppIds []string `json:"defaultAppIds,omitempty"` + + // 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DefaultAppIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AppList) MarshalJSON() ([]byte, error) { + type noMethod AppList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Change: Representation of a change to a file. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Deleted") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Change) MarshalJSON() ([]byte, error) { + type noMethod Change + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChangeList: A list of changes for a user. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChangeList) MarshalJSON() ([]byte, error) { + type noMethod ChangeList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Channel: An notification channel used to watch for resource changes. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Address") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Channel) MarshalJSON() ([]byte, error) { + type noMethod Channel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChildList: A list of children of a file. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChildList) MarshalJSON() ([]byte, error) { + type noMethod ChildList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChildReference: A reference to a folder's child. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ChildLink") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChildReference) MarshalJSON() ([]byte, error) { + type noMethod ChildReference + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Comment: A JSON representation of a comment on a file in Google +// Drive. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Anchor") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Comment) MarshalJSON() ([]byte, error) { + type noMethod Comment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentContext: The context of the file which is being commented on. +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"` + + // ForceSendFields is a list of field names (e.g. "Type") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentContext) MarshalJSON() ([]byte, error) { + type noMethod CommentContext + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentList: A JSON representation of a list of comments on a file in +// Google Drive. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentList) MarshalJSON() ([]byte, error) { + type noMethod CommentList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentReply: A JSON representation of a reply to a comment on a file +// in Google Drive. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Author") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentReply) MarshalJSON() ([]byte, error) { + type noMethod CommentReply + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentReplyList: A JSON representation of a list of replies to a +// comment on a file in Google Drive. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentReplyList) MarshalJSON() ([]byte, error) { + type noMethod CommentReplyList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// File: The metadata for a file. +type File struct { + // AlternateLink: A link for opening the file in a relevant Google + // editor or viewer. + AlternateLink string `json:"alternateLink,omitempty"` + + // AppDataContents: Whether this file is in the Application Data folder. + AppDataContents bool `json:"appDataContents,omitempty"` + + // CanComment: Whether the current user can comment on the file. + CanComment bool `json:"canComment,omitempty"` + + // Copyable: Whether the file can be copied by the current user. + Copyable bool `json:"copyable,omitempty"` + + // CreatedDate: Create time for this file (formatted RFC 3339 + // 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 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. + ExplicitlyTrashed bool `json:"explicitlyTrashed,omitempty"` + + // ExportLinks: Links for exporting Google Docs to specific formats. + ExportLinks map[string]string `json:"exportLinks,omitempty"` + + // FileExtension: The final component of fullFileExtension with trailing + // text that does not appear to be part of the extension removed. This + // field is only populated for files with content stored in Drive; it is + // not populated for Google Docs or shortcut files. + FileExtension string `json:"fileExtension,omitempty"` + + // FileSize: The size of the file in bytes. This field is only populated + // for files with content stored in Drive; it is not populated for + // Google Docs or shortcut files. + FileSize int64 `json:"fileSize,omitempty,string"` + + // FolderColorRgb: Folder color as an RGB hex string if the file is a + // folder. The list of supported colors is available in the + // folderColorPalette field of the About resource. If an unsupported + // color is specified, it will be changed to the closest color in the + // palette. + FolderColorRgb string `json:"folderColorRgb,omitempty"` + + // FullFileExtension: The full file extension; extracted from the title. + // May contain multiple concatenated extensions, such as "tar.gz". + // Removing an extension from the title does not clear this field; + // however, changing the extension on the title does update this field. + // This field is only populated for files with content stored in Drive; + // it is not populated for Google Docs or shortcut files. + FullFileExtension string `json:"fullFileExtension,omitempty"` + + // HeadRevisionId: The ID of the file's head revision. This field is + // only populated for files with content stored in Drive; it is not + // populated for Google Docs or shortcut files. + 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"` + + // MarkedViewedByMeDate: Deprecated. + MarkedViewedByMeDate string `json:"markedViewedByMeDate,omitempty"` + + // Md5Checksum: An MD5 checksum for the content of this file. This field + // is only populated for files with content stored in Drive; it is not + // populated for Google Docs or shortcut files. + 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 field is only populated for files with content stored + // in Drive; it is not populated for Google Docs or shortcut files. + OriginalFilename string `json:"originalFilename,omitempty"` + + // OwnedByMe: Whether the file is owned by the current user. + OwnedByMe bool `json:"ownedByMe,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"` + + // Permissions: The list of permissions for users with access to this + // file. + Permissions []*Permission `json:"permissions,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"` + + // Shareable: Whether the file's sharing settings can be modified by the + // current user. + Shareable bool `json:"shareable,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"` + + // SharingUser: User that shared the item with the current user, if + // available. + SharingUser *User `json:"sharingUser,omitempty"` + + // Spaces: The list of spaces which contain the file. Supported values + // are 'drive', 'appDataFolder' and 'photos'. + Spaces []string `json:"spaces,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 short-lived link to the file's thumbnail. Typically + // lasts on the order of hours. + 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"` + + // Version: A monotonically increasing version number for the file. This + // reflects every change made to the file on the server, even those not + // visible to the requesting user. + Version int64 `json:"version,omitempty,string"` + + // VideoMediaMetadata: Metadata about video media. This will only be + // present for video types. + VideoMediaMetadata *FileVideoMediaMetadata `json:"videoMediaMetadata,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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AlternateLink") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *File) MarshalJSON() ([]byte, error) { + type noMethod File + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FileImageMediaMetadata: 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. +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"` + + // ForceSendFields is a list of field names (e.g. "Aperture") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileImageMediaMetadata) MarshalJSON() ([]byte, error) { + type noMethod FileImageMediaMetadata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FileImageMediaMetadataLocation: Geographic location information +// stored in the image. +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"` + + // ForceSendFields is a list of field names (e.g. "Altitude") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileImageMediaMetadataLocation) MarshalJSON() ([]byte, error) { + type noMethod FileImageMediaMetadataLocation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FileIndexableText: Indexable text attributes for the file (can only +// be written) +type FileIndexableText struct { + // Text: The text to be indexed for this file. + Text string `json:"text,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Text") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileIndexableText) MarshalJSON() ([]byte, error) { + type noMethod FileIndexableText + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FileLabels: A group of labels for the file. +type FileLabels struct { + // Hidden: Deprecated. + Hidden bool `json:"hidden,omitempty"` + + // Restricted: Whether viewers and commenters are prevented from + // downloading, printing, and copying 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. This label applies to + // all users accessing the file; however, only owners are allowed to see + // and untrash files. + Trashed bool `json:"trashed,omitempty"` + + // Viewed: Whether this file has been viewed by this user. + Viewed bool `json:"viewed,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Hidden") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileLabels) MarshalJSON() ([]byte, error) { + type noMethod FileLabels + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FileThumbnail: Thumbnail for the file. Only accepted on upload and +// for files that are not already thumbnailed by Google. +type FileThumbnail struct { + // Image: The URL-safe Base64 encoded bytes of the thumbnail image. It + // should conform to RFC 4648 section 5. + Image string `json:"image,omitempty"` + + // MimeType: The MIME type of the thumbnail. + MimeType string `json:"mimeType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Image") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileThumbnail) MarshalJSON() ([]byte, error) { + type noMethod FileThumbnail + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FileVideoMediaMetadata: Metadata about video media. This will only be +// present for video types. +type FileVideoMediaMetadata struct { + // DurationMillis: The duration of the video in milliseconds. + DurationMillis int64 `json:"durationMillis,omitempty,string"` + + // Height: The height of the video in pixels. + Height int64 `json:"height,omitempty"` + + // Width: The width of the video in pixels. + Width int64 `json:"width,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DurationMillis") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileVideoMediaMetadata) MarshalJSON() ([]byte, error) { + type noMethod FileVideoMediaMetadata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FileList: A list of files. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FileList) MarshalJSON() ([]byte, error) { + type noMethod FileList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GeneratedIds: A list of generated IDs which can be provided in insert +// requests +type GeneratedIds struct { + // Ids: The IDs generated for the requesting user in the specified + // space. + Ids []string `json:"ids,omitempty"` + + // Kind: This is always drive#generatedIds + Kind string `json:"kind,omitempty"` + + // Space: The type of file that can be created with these IDs. + Space string `json:"space,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Ids") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeneratedIds) MarshalJSON() ([]byte, error) { + type noMethod GeneratedIds + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ParentList: A list of a file's parents. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ParentList) MarshalJSON() ([]byte, error) { + type noMethod ParentList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ParentReference: A reference to a file's parent. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ParentReference) MarshalJSON() ([]byte, error) { + type noMethod ParentReference + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Permission: A permission for a file. +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 present when the permission type is + // user, group or domain. + Domain string `json:"domain,omitempty"` + + // EmailAddress: The email address of the user or group this permission + // refers to. This is an output-only field which is present when the + // permission type is user or group. + 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 the 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 the 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AdditionalRoles") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Permission) MarshalJSON() ([]byte, error) { + type noMethod Permission + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PermissionId: An ID for a user or group as seen in Permission items. +type PermissionId struct { + // Id: The permission ID. + Id string `json:"id,omitempty"` + + // Kind: This is always drive#permissionId. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PermissionId) MarshalJSON() ([]byte, error) { + type noMethod PermissionId + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PermissionList: A list of permissions associated with a file. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PermissionList) MarshalJSON() ([]byte, error) { + type noMethod PermissionList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Property: A key-value pair attached to a file that is either public +// or private to an application. +// The following limits apply to file properties: +// - Maximum of 100 properties total per file +// - Maximum of 30 private properties per app +// - Maximum of 30 public properties +// - Maximum of 124 bytes size limit on (key + value) string in UTF-8 +// encoding for a single property. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Property) MarshalJSON() ([]byte, error) { + type noMethod Property + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PropertyList: A collection of properties, key-value pairs that are +// either public or private to an application. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PropertyList) MarshalJSON() ([]byte, error) { + type noMethod PropertyList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Revision: A revision of a file. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DownloadUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Revision) MarshalJSON() ([]byte, error) { + type noMethod Revision + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RevisionList: A list of revisions of a file. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RevisionList) MarshalJSON() ([]byte, error) { + type noMethod RevisionList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// User: The JSON template for a user. +type User struct { + // DisplayName: A plain text displayable name for this user. + DisplayName string `json:"displayName,omitempty"` + + // EmailAddress: The email address of the user. + EmailAddress string `json:"emailAddress,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"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *User) MarshalJSON() ([]byte, error) { + type noMethod User + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserPicture: The user's profile picture. +type UserPicture struct { + // Url: A URL that points to a profile picture of this user. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Url") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserPicture) MarshalJSON() ([]byte, error) { + type noMethod UserPicture + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "drive.about.get": + +type AboutGetCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 public files the user has opened and shared files. When set +// to false, this counts only change IDs for owned files and any shared +// or public files that the user has explicitly added to a folder they +// own. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AboutGetCall) Fields(s ...googleapi.Field) *AboutGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AboutGetCall) IfNoneMatch(entityTag string) *AboutGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AboutGetCall) Context(ctx context.Context) *AboutGetCall { + c.ctx_ = ctx + return c +} + +func (c *AboutGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.about.get" call. +// Exactly one of *About or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *About.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AboutGetCall) Do() (*About, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &About{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the 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 public files the user has opened and shared files. When set to false, this counts only change IDs for owned files and any shared or public files that the user has explicitly added to a folder they own.", + // "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", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.photos.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// method id "drive.apps.get": + +type AppsGetCall struct { + s *Service + appId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AppsGetCall) Fields(s ...googleapi.Field) *AppsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AppsGetCall) IfNoneMatch(entityTag string) *AppsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AppsGetCall) Context(ctx context.Context) *AppsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AppsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "apps/{appId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "appId": c.appId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.apps.get" call. +// Exactly one of *App or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *App.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AppsGetCall) Do() (*App, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &App{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets 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", + // "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{} + ctx_ context.Context +} + +// List: Lists a user's installed apps. +func (r *AppsService) List() *AppsListCall { + c := &AppsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// AppFilterExtensions sets the optional parameter +// "appFilterExtensions": A comma-separated list of file extensions for +// open with filtering. All apps within the given app query scope which +// can open any of the given file extensions will be included in the +// response. If appFilterMimeTypes are provided as well, the result is a +// union of the two resulting app lists. +func (c *AppsListCall) AppFilterExtensions(appFilterExtensions string) *AppsListCall { + c.opt_["appFilterExtensions"] = appFilterExtensions + return c +} + +// AppFilterMimeTypes sets the optional parameter "appFilterMimeTypes": +// A comma-separated list of MIME types for open with filtering. All +// apps within the given app query scope which can open any of the given +// MIME types will be included in the response. If appFilterExtensions +// are provided as well, the result is a union of the two resulting app +// lists. +func (c *AppsListCall) AppFilterMimeTypes(appFilterMimeTypes string) *AppsListCall { + c.opt_["appFilterMimeTypes"] = appFilterMimeTypes + return c +} + +// LanguageCode sets the optional parameter "languageCode": A language +// or locale code, as defined by BCP 47, with some extensions from +// Unicode's LDML format (http://www.unicode.org/reports/tr35/). +func (c *AppsListCall) LanguageCode(languageCode string) *AppsListCall { + c.opt_["languageCode"] = languageCode + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AppsListCall) Fields(s ...googleapi.Field) *AppsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AppsListCall) IfNoneMatch(entityTag string) *AppsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AppsListCall) Context(ctx context.Context) *AppsListCall { + c.ctx_ = ctx + return c +} + +func (c *AppsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["appFilterExtensions"]; ok { + params.Set("appFilterExtensions", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["appFilterMimeTypes"]; ok { + params.Set("appFilterMimeTypes", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["languageCode"]; ok { + params.Set("languageCode", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.apps.list" call. +// Exactly one of *AppList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *AppList.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AppsListCall) Do() (*AppList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AppList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists a user's installed apps.", + // "httpMethod": "GET", + // "id": "drive.apps.list", + // "parameters": { + // "appFilterExtensions": { + // "default": "", + // "description": "A comma-separated list of file extensions for open with filtering. All apps within the given app query scope which can open any of the given file extensions will be included in the response. If appFilterMimeTypes are provided as well, the result is a union of the two resulting app lists.", + // "location": "query", + // "type": "string" + // }, + // "appFilterMimeTypes": { + // "default": "", + // "description": "A comma-separated list of MIME types for open with filtering. All apps within the given app query scope which can open any of the given MIME types will be included in the response. If appFilterExtensions are provided as well, the result is a union of the two resulting app lists.", + // "location": "query", + // "type": "string" + // }, + // "languageCode": { + // "description": "A language or locale code, as defined by BCP 47, with some extensions from Unicode's LDML format (http://www.unicode.org/reports/tr35/).", + // "location": "query", + // "type": "string" + // } + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChangesGetCall) Fields(s ...googleapi.Field) *ChangesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ChangesGetCall) IfNoneMatch(entityTag string) *ChangesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChangesGetCall) Context(ctx context.Context) *ChangesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ChangesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "changes/{changeId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "changeId": c.changeId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.changes.get" call. +// Exactly one of *Change or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Change.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ChangesGetCall) Do() (*Change, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Change{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets 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", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.photos.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// method id "drive.changes.list": + +type ChangesListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 public files the user has opened and shared files. +// When set to false, the list only includes owned files plus any shared +// or public files the user has explicitly added to a folder they own. +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 +} + +// Spaces sets the optional parameter "spaces": A comma-separated list +// of spaces to query. Supported values are 'drive', 'appDataFolder' and +// 'photos'. +func (c *ChangesListCall) Spaces(spaces string) *ChangesListCall { + c.opt_["spaces"] = spaces + 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChangesListCall) Fields(s ...googleapi.Field) *ChangesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ChangesListCall) IfNoneMatch(entityTag string) *ChangesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChangesListCall) Context(ctx context.Context) *ChangesListCall { + c.ctx_ = ctx + return c +} + +func (c *ChangesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["spaces"]; ok { + params.Set("spaces", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startChangeId"]; ok { + params.Set("startChangeId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.changes.list" call. +// Exactly one of *ChangeList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ChangeList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ChangesListCall) Do() (*ChangeList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ChangeList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the 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 public files the user has opened and shared files. When set to false, the list only includes owned files plus any shared or public files the user has explicitly added to a folder they own.", + // "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" + // }, + // "spaces": { + // "description": "A comma-separated list of spaces to query. Supported values are 'drive', 'appDataFolder' and 'photos'.", + // "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", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.photos.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{} + ctx_ context.Context +} + +// 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 public files the user has opened and shared files. +// When set to false, the list only includes owned files plus any shared +// or public files the user has explicitly added to a folder they own. +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 +} + +// Spaces sets the optional parameter "spaces": A comma-separated list +// of spaces to query. Supported values are 'drive', 'appDataFolder' and +// 'photos'. +func (c *ChangesWatchCall) Spaces(spaces string) *ChangesWatchCall { + c.opt_["spaces"] = spaces + 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChangesWatchCall) Fields(s ...googleapi.Field) *ChangesWatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChangesWatchCall) Context(ctx context.Context) *ChangesWatchCall { + c.ctx_ = ctx + return c +} + +func (c *ChangesWatchCall) doRequest(alt string) (*http.Response, 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", alt) + 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_["spaces"]; ok { + params.Set("spaces", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startChangeId"]; ok { + params.Set("startChangeId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.changes.watch" call. +// Exactly one of *Channel or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Channel.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ChangesWatchCall) Do() (*Channel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Channel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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 public files the user has opened and shared files. When set to false, the list only includes owned files plus any shared or public files the user has explicitly added to a folder they own.", + // "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" + // }, + // "spaces": { + // "description": "A comma-separated list of spaces to query. Supported values are 'drive', 'appDataFolder' and 'photos'.", + // "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", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.photos.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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall { + c.ctx_ = ctx + return c +} + +func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.channels.stop" call. +func (c *ChannelsStopCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.photos.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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChildrenDeleteCall) Fields(s ...googleapi.Field) *ChildrenDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChildrenDeleteCall) Context(ctx context.Context) *ChildrenDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ChildrenDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{folderId}/children/{childId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "folderId": c.folderId, + "childId": c.childId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.children.delete" call. +func (c *ChildrenDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChildrenGetCall) Fields(s ...googleapi.Field) *ChildrenGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ChildrenGetCall) IfNoneMatch(entityTag string) *ChildrenGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChildrenGetCall) Context(ctx context.Context) *ChildrenGetCall { + c.ctx_ = ctx + return c +} + +func (c *ChildrenGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{folderId}/children/{childId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "folderId": c.folderId, + "childId": c.childId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.children.get" call. +// Exactly one of *ChildReference or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ChildReference.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ChildrenGetCall) Do() (*ChildReference, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ChildReference{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets 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", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.photos.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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChildrenInsertCall) Fields(s ...googleapi.Field) *ChildrenInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChildrenInsertCall) Context(ctx context.Context) *ChildrenInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ChildrenInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{folderId}/children") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "folderId": c.folderId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.children.insert" call. +// Exactly one of *ChildReference or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ChildReference.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ChildrenInsertCall) Do() (*ChildReference, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ChildReference{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// OrderBy sets the optional parameter "orderBy": A comma-separated list +// of sort keys. Valid keys are 'createdDate', 'folder', +// 'lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', +// 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred', and +// 'title'. Each key sorts ascending by default, but may be reversed +// with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedDate +// desc,title. Please note that there is a current limitation for users +// with approximately one million files in which the requested sort +// order is ignored. +func (c *ChildrenListCall) OrderBy(orderBy string) *ChildrenListCall { + c.opt_["orderBy"] = orderBy + 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChildrenListCall) Fields(s ...googleapi.Field) *ChildrenListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ChildrenListCall) IfNoneMatch(entityTag string) *ChildrenListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChildrenListCall) Context(ctx context.Context) *ChildrenListCall { + c.ctx_ = ctx + return c +} + +func (c *ChildrenListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["q"]; ok { + params.Set("q", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{folderId}/children") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "folderId": c.folderId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.children.list" call. +// Exactly one of *ChildList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ChildList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ChildrenListCall) Do() (*ChildList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ChildList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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" + // }, + // "orderBy": { + // "description": "A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', 'lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred', and 'title'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedDate desc,title. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored.", + // "location": "query", + // "type": "string" + // }, + // "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", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.photos.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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsDeleteCall) Fields(s ...googleapi.Field) *CommentsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsDeleteCall) Context(ctx context.Context) *CommentsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + "commentId": c.commentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.comments.delete" call. +func (c *CommentsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a 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" + // ] + // } + +} + +// method id "drive.comments.get": + +type CommentsGetCall struct { + s *Service + fileId string + commentId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsGetCall) Fields(s ...googleapi.Field) *CommentsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CommentsGetCall) IfNoneMatch(entityTag string) *CommentsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsGetCall) Context(ctx context.Context) *CommentsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["includeDeleted"]; ok { + params.Set("includeDeleted", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + "commentId": c.commentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.comments.get" call. +// Exactly one of *Comment or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Comment.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CommentsGetCall) Do() (*Comment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Comment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsInsertCall) Fields(s ...googleapi.Field) *CommentsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsInsertCall) Context(ctx context.Context) *CommentsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.comments.insert" call. +// Exactly one of *Comment or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Comment.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CommentsInsertCall) Do() (*Comment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Comment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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" + // ] + // } + +} + +// method id "drive.comments.list": + +type CommentsListCall struct { + s *Service + fileId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CommentsListCall) IfNoneMatch(entityTag string) *CommentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsListCall) Context(ctx context.Context) *CommentsListCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.comments.list" call. +// Exactly one of *CommentList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CommentList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CommentsListCall) Do() (*CommentList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CommentList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsPatchCall) Fields(s ...googleapi.Field) *CommentsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsPatchCall) Context(ctx context.Context) *CommentsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + "commentId": c.commentId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.comments.patch" call. +// Exactly one of *Comment or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Comment.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CommentsPatchCall) Do() (*Comment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Comment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsUpdateCall) Fields(s ...googleapi.Field) *CommentsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsUpdateCall) Context(ctx context.Context) *CommentsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + "commentId": c.commentId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.comments.update" call. +// Exactly one of *Comment or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Comment.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CommentsUpdateCall) Do() (*Comment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Comment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 BCP 47 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. A file can have a maximum of 200 pinned +// revisions. +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. +// +// Possible values: +// "DEFAULT" (default) - The visibility of the new file is determined +// by the user's default visibility/sharing policies. +// "PRIVATE" - The new file will be visible to only the owner. +func (c *FilesCopyCall) Visibility(visibility string) *FilesCopyCall { + c.opt_["visibility"] = visibility + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesCopyCall) Fields(s ...googleapi.Field) *FilesCopyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FilesCopyCall) Context(ctx context.Context) *FilesCopyCall { + c.ctx_ = ctx + return c +} + +func (c *FilesCopyCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/copy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.files.copy" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FilesCopyCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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 BCP 47 codes.", + // "location": "query", + // "type": "string" + // }, + // "pinned": { + // "default": "false", + // "description": "Whether to pin the head revision of the new copy. A file can have a maximum of 200 pinned revisions.", + // "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", + // "https://www.googleapis.com/auth/drive.photos.readonly" + // ] + // } + +} + +// method id "drive.files.delete": + +type FilesDeleteCall struct { + s *Service + fileId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Permanently deletes a file by ID. Skips the trash. The +// currently authenticated user must own the file. +func (r *FilesService) Delete(fileId string) *FilesDeleteCall { + c := &FilesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesDeleteCall) Fields(s ...googleapi.Field) *FilesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FilesDeleteCall) Context(ctx context.Context) *FilesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *FilesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.files.delete" call. +func (c *FilesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Permanently deletes a file by ID. Skips the trash. The currently authenticated user must own the file.", + // "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.emptyTrash": + +type FilesEmptyTrashCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// EmptyTrash: Permanently deletes all of the user's trashed files. +func (r *FilesService) EmptyTrash() *FilesEmptyTrashCall { + c := &FilesEmptyTrashCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesEmptyTrashCall) Fields(s ...googleapi.Field) *FilesEmptyTrashCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FilesEmptyTrashCall) Context(ctx context.Context) *FilesEmptyTrashCall { + c.ctx_ = ctx + return c +} + +func (c *FilesEmptyTrashCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/trash") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.files.emptyTrash" call. +func (c *FilesEmptyTrashCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Permanently deletes all of the user's trashed files.", + // "httpMethod": "DELETE", + // "id": "drive.files.emptyTrash", + // "path": "files/trash", + // "scopes": [ + // "https://www.googleapis.com/auth/drive" + // ] + // } + +} + +// method id "drive.files.generateIds": + +type FilesGenerateIdsCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// GenerateIds: Generates a set of file IDs which can be provided in +// insert requests. +func (r *FilesService) GenerateIds() *FilesGenerateIdsCall { + c := &FilesGenerateIdsCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of IDs to return. +func (c *FilesGenerateIdsCall) MaxResults(maxResults int64) *FilesGenerateIdsCall { + c.opt_["maxResults"] = maxResults + return c +} + +// Space sets the optional parameter "space": The space in which the IDs +// can be used to create new files. Supported values are 'drive' and +// 'appDataFolder'. +func (c *FilesGenerateIdsCall) Space(space string) *FilesGenerateIdsCall { + c.opt_["space"] = space + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesGenerateIdsCall) Fields(s ...googleapi.Field) *FilesGenerateIdsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FilesGenerateIdsCall) IfNoneMatch(entityTag string) *FilesGenerateIdsCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FilesGenerateIdsCall) Context(ctx context.Context) *FilesGenerateIdsCall { + c.ctx_ = ctx + return c +} + +func (c *FilesGenerateIdsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["space"]; ok { + params.Set("space", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/generateIds") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.files.generateIds" call. +// Exactly one of *GeneratedIds or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *GeneratedIds.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FilesGenerateIdsCall) Do() (*GeneratedIds, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &GeneratedIds{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generates a set of file IDs which can be provided in insert requests.", + // "httpMethod": "GET", + // "id": "drive.files.generateIds", + // "parameters": { + // "maxResults": { + // "default": "10", + // "description": "Maximum number of IDs to return.", + // "format": "int32", + // "location": "query", + // "maximum": "1000", + // "minimum": "1", + // "type": "integer" + // }, + // "space": { + // "default": "drive", + // "description": "The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "files/generateIds", + // "response": { + // "$ref": "GeneratedIds" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// AcknowledgeAbuse sets the optional parameter "acknowledgeAbuse": +// Whether the user is acknowledging the risk of downloading known +// malware or other abusive files. +func (c *FilesGetCall) AcknowledgeAbuse(acknowledgeAbuse bool) *FilesGetCall { + c.opt_["acknowledgeAbuse"] = acknowledgeAbuse + return c +} + +// Projection sets the optional parameter "projection": This parameter +// is deprecated and has no function. +// +// Possible values: +// "BASIC" - Deprecated +// "FULL" - Deprecated +func (c *FilesGetCall) Projection(projection string) *FilesGetCall { + c.opt_["projection"] = projection + return c +} + +// RevisionId sets the optional parameter "revisionId": Specifies the +// Revision ID that should be downloaded. Ignored unless alt=media is +// specified. +func (c *FilesGetCall) RevisionId(revisionId string) *FilesGetCall { + c.opt_["revisionId"] = revisionId + return c +} + +// UpdateViewedDate sets the optional parameter "updateViewedDate": +// Deprecated: Use files.update with modifiedDateBehavior=noChange, +// updateViewedDate=true and an empty request body. +func (c *FilesGetCall) UpdateViewedDate(updateViewedDate bool) *FilesGetCall { + c.opt_["updateViewedDate"] = updateViewedDate + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FilesGetCall) IfNoneMatch(entityTag string) *FilesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FilesGetCall) Context(ctx context.Context) *FilesGetCall { + c.ctx_ = ctx + return c +} + +func (c *FilesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["acknowledgeAbuse"]; ok { + params.Set("acknowledgeAbuse", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["revisionId"]; ok { + params.Set("revisionId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["updateViewedDate"]; ok { + params.Set("updateViewedDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *FilesGetCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "drive.files.get" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FilesGetCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a file's metadata by ID.", + // "httpMethod": "GET", + // "id": "drive.files.get", + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "acknowledgeAbuse": { + // "default": "false", + // "description": "Whether the user is acknowledging the risk of downloading known malware or other abusive files.", + // "location": "query", + // "type": "boolean" + // }, + // "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" + // }, + // "revisionId": { + // "description": "Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.", + // "location": "query", + // "type": "string" + // }, + // "updateViewedDate": { + // "default": "false", + // "description": "Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body.", + // "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", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.photos.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ], + // "supportsMediaDownload": true, + // "supportsSubscription": true + // } + +} + +// method id "drive.files.insert": + +type FilesInsertCall struct { + s *Service + file *File + opt_ map[string]interface{} + media_ io.Reader + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// 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 BCP 47 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. A file can have a maximum of 200 +// pinned revisions. +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. +// +// Possible values: +// "DEFAULT" (default) - The visibility of the new file is determined +// by the user's default visibility/sharing policies. +// "PRIVATE" - The new file will be visible to only the owner. +func (c *FilesInsertCall) Visibility(visibility string) *FilesInsertCall { + c.opt_["visibility"] = visibility + return c +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *FilesInsertCall) Media(r io.Reader) *FilesInsertCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *FilesInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *FilesInsertCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *FilesInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *FilesInsertCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesInsertCall) Fields(s ...googleapi.Field) *FilesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *FilesInsertCall) Context(ctx context.Context) *FilesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *FilesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.files.insert" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FilesInsertCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Insert a new file.", + // "httpMethod": "POST", + // "id": "drive.files.insert", + // "mediaUpload": { + // "accept": [ + // "*/*" + // ], + // "maxSize": "5120GB", + // "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 BCP 47 codes.", + // "location": "query", + // "type": "string" + // }, + // "pinned": { + // "default": "false", + // "description": "Whether to pin the head revision of the uploaded file. A file can have a maximum of 200 pinned revisions.", + // "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{} + ctx_ context.Context +} + +// List: Lists the user's files. +func (r *FilesService) List() *FilesListCall { + c := &FilesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Corpus sets the optional parameter "corpus": The body of items +// (files/documents) to which the query applies. +// +// Possible values: +// "DEFAULT" - The items that the user has accessed. +// "DOMAIN" - Items shared to the user's domain. +func (c *FilesListCall) Corpus(corpus string) *FilesListCall { + c.opt_["corpus"] = corpus + 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 +} + +// OrderBy sets the optional parameter "orderBy": A comma-separated list +// of sort keys. Valid keys are 'createdDate', 'folder', +// 'lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', +// 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred', and +// 'title'. Each key sorts ascending by default, but may be reversed +// with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedDate +// desc,title. Please note that there is a current limitation for users +// with approximately one million files in which the requested sort +// order is ignored. +func (c *FilesListCall) OrderBy(orderBy string) *FilesListCall { + c.opt_["orderBy"] = orderBy + 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. +// +// Possible values: +// "BASIC" - Deprecated +// "FULL" - Deprecated +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 +} + +// Spaces sets the optional parameter "spaces": A comma-separated list +// of spaces to query. Supported values are 'drive', 'appDataFolder' and +// 'photos'. +func (c *FilesListCall) Spaces(spaces string) *FilesListCall { + c.opt_["spaces"] = spaces + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FilesListCall) Context(ctx context.Context) *FilesListCall { + c.ctx_ = ctx + return c +} + +func (c *FilesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["corpus"]; ok { + params.Set("corpus", 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_["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_["spaces"]; ok { + params.Set("spaces", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.files.list" call. +// Exactly one of *FileList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *FileList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FilesListCall) Do() (*FileList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FileList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the user's files.", + // "httpMethod": "GET", + // "id": "drive.files.list", + // "parameters": { + // "corpus": { + // "description": "The body of items (files/documents) to which the query applies.", + // "enum": [ + // "DEFAULT", + // "DOMAIN" + // ], + // "enumDescriptions": [ + // "The items that the user has accessed.", + // "Items shared to the user's domain." + // ], + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Maximum number of files to return.", + // "format": "int32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "orderBy": { + // "description": "A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', 'lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred', and 'title'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedDate desc,title. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored.", + // "location": "query", + // "type": "string" + // }, + // "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" + // }, + // "spaces": { + // "description": "A comma-separated list of spaces to query. Supported values are 'drive', 'appDataFolder' and 'photos'.", + // "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", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.photos.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{} + ctx_ context.Context +} + +// 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 +} + +// AddParents sets the optional parameter "addParents": Comma-separated +// list of parent IDs to add. +func (c *FilesPatchCall) AddParents(addParents string) *FilesPatchCall { + c.opt_["addParents"] = addParents + return c +} + +// Convert sets the optional parameter "convert": This parameter is +// deprecated and has no function. +func (c *FilesPatchCall) Convert(convert bool) *FilesPatchCall { + c.opt_["convert"] = convert + return c +} + +// ModifiedDateBehavior sets the optional parameter +// "modifiedDateBehavior": Determines the behavior in which modifiedDate +// is updated. This overrides setModifiedDate. +// +// Possible values: +// "fromBody" - Set modifiedDate to the value provided in the body of +// the request. No change if no value was provided. +// "fromBodyIfNeeded" - Set modifiedDate to the value provided in the +// body of the request depending on other contents of the update. +// "fromBodyOrNow" - Set modifiedDate to the value provided in the +// body of the request, or to the current time if no value was provided. +// "noChange" - Maintain the previous value of modifiedDate. +// "now" - Set modifiedDate to the current time. +// "nowIfNeeded" - Set modifiedDate to the current time depending on +// contents of the update. +func (c *FilesPatchCall) ModifiedDateBehavior(modifiedDateBehavior string) *FilesPatchCall { + c.opt_["modifiedDateBehavior"] = modifiedDateBehavior + 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 true or not set, a new blob is +// created as head revision, and previous unpinned revisions are +// preserved for a short period of time. Pinned revisions are stored +// indefinitely, using additional storage quota, up to a maximum of 200 +// revisions. For details on how revisions are retained, see the Drive +// Help Center. +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 BCP 47 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. A file can have a maximum of 200 pinned revisions. +func (c *FilesPatchCall) Pinned(pinned bool) *FilesPatchCall { + c.opt_["pinned"] = pinned + return c +} + +// RemoveParents sets the optional parameter "removeParents": +// Comma-separated list of parent IDs to remove. +func (c *FilesPatchCall) RemoveParents(removeParents string) *FilesPatchCall { + c.opt_["removeParents"] = removeParents + 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesPatchCall) Fields(s ...googleapi.Field) *FilesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FilesPatchCall) Context(ctx context.Context) *FilesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *FilesPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["addParents"]; ok { + params.Set("addParents", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["convert"]; ok { + params.Set("convert", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["modifiedDateBehavior"]; ok { + params.Set("modifiedDateBehavior", 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_["removeParents"]; ok { + params.Set("removeParents", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.files.patch" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FilesPatchCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates file metadata and/or content. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "drive.files.patch", + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "addParents": { + // "description": "Comma-separated list of parent IDs to add.", + // "location": "query", + // "type": "string" + // }, + // "convert": { + // "default": "false", + // "description": "This parameter is deprecated and has no function.", + // "location": "query", + // "type": "boolean" + // }, + // "fileId": { + // "description": "The ID of the file to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "modifiedDateBehavior": { + // "description": "Determines the behavior in which modifiedDate is updated. This overrides setModifiedDate.", + // "enum": [ + // "fromBody", + // "fromBodyIfNeeded", + // "fromBodyOrNow", + // "noChange", + // "now", + // "nowIfNeeded" + // ], + // "enumDescriptions": [ + // "Set modifiedDate to the value provided in the body of the request. No change if no value was provided.", + // "Set modifiedDate to the value provided in the body of the request depending on other contents of the update.", + // "Set modifiedDate to the value provided in the body of the request, or to the current time if no value was provided.", + // "Maintain the previous value of modifiedDate.", + // "Set modifiedDate to the current time.", + // "Set modifiedDate to the current time depending on contents of the update." + // ], + // "location": "query", + // "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 true or not set, a new blob is created as head revision, and previous unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions. For details on how revisions are retained, see the Drive Help Center.", + // "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 BCP 47 codes.", + // "location": "query", + // "type": "string" + // }, + // "pinned": { + // "default": "false", + // "description": "Whether to pin the new revision. A file can have a maximum of 200 pinned revisions.", + // "location": "query", + // "type": "boolean" + // }, + // "removeParents": { + // "description": "Comma-separated list of parent IDs to remove.", + // "location": "query", + // "type": "string" + // }, + // "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.metadata", + // "https://www.googleapis.com/auth/drive.scripts" + // ] + // } + +} + +// method id "drive.files.touch": + +type FilesTouchCall struct { + s *Service + fileId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesTouchCall) Fields(s ...googleapi.Field) *FilesTouchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FilesTouchCall) Context(ctx context.Context) *FilesTouchCall { + c.ctx_ = ctx + return c +} + +func (c *FilesTouchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/touch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.files.touch" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FilesTouchCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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", + // "https://www.googleapis.com/auth/drive.metadata" + // ] + // } + +} + +// method id "drive.files.trash": + +type FilesTrashCall struct { + s *Service + fileId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Trash: Moves a file to the trash. The currently authenticated user +// must own the file. +func (r *FilesService) Trash(fileId string) *FilesTrashCall { + c := &FilesTrashCall{s: r.s, opt_: make(map[string]interface{})} + c.fileId = fileId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesTrashCall) Fields(s ...googleapi.Field) *FilesTrashCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FilesTrashCall) Context(ctx context.Context) *FilesTrashCall { + c.ctx_ = ctx + return c +} + +func (c *FilesTrashCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/trash") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.files.trash" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FilesTrashCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Moves a file to the trash. The currently authenticated user must own the file.", + // "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.appdata", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesUntrashCall) Fields(s ...googleapi.Field) *FilesUntrashCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FilesUntrashCall) Context(ctx context.Context) *FilesUntrashCall { + c.ctx_ = ctx + return c +} + +func (c *FilesUntrashCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/untrash") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.files.untrash" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FilesUntrashCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.appdata", + // "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 + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// 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 +} + +// AddParents sets the optional parameter "addParents": Comma-separated +// list of parent IDs to add. +func (c *FilesUpdateCall) AddParents(addParents string) *FilesUpdateCall { + c.opt_["addParents"] = addParents + return c +} + +// Convert sets the optional parameter "convert": This parameter is +// deprecated and has no function. +func (c *FilesUpdateCall) Convert(convert bool) *FilesUpdateCall { + c.opt_["convert"] = convert + return c +} + +// ModifiedDateBehavior sets the optional parameter +// "modifiedDateBehavior": Determines the behavior in which modifiedDate +// is updated. This overrides setModifiedDate. +// +// Possible values: +// "fromBody" - Set modifiedDate to the value provided in the body of +// the request. No change if no value was provided. +// "fromBodyIfNeeded" - Set modifiedDate to the value provided in the +// body of the request depending on other contents of the update. +// "fromBodyOrNow" - Set modifiedDate to the value provided in the +// body of the request, or to the current time if no value was provided. +// "noChange" - Maintain the previous value of modifiedDate. +// "now" - Set modifiedDate to the current time. +// "nowIfNeeded" - Set modifiedDate to the current time depending on +// contents of the update. +func (c *FilesUpdateCall) ModifiedDateBehavior(modifiedDateBehavior string) *FilesUpdateCall { + c.opt_["modifiedDateBehavior"] = modifiedDateBehavior + 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 true or not set, a new blob is +// created as head revision, and previous unpinned revisions are +// preserved for a short period of time. Pinned revisions are stored +// indefinitely, using additional storage quota, up to a maximum of 200 +// revisions. For details on how revisions are retained, see the Drive +// Help Center. +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 BCP 47 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. A file can have a maximum of 200 pinned revisions. +func (c *FilesUpdateCall) Pinned(pinned bool) *FilesUpdateCall { + c.opt_["pinned"] = pinned + return c +} + +// RemoveParents sets the optional parameter "removeParents": +// Comma-separated list of parent IDs to remove. +func (c *FilesUpdateCall) RemoveParents(removeParents string) *FilesUpdateCall { + c.opt_["removeParents"] = removeParents + 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 +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *FilesUpdateCall) Media(r io.Reader) *FilesUpdateCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *FilesUpdateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *FilesUpdateCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *FilesUpdateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *FilesUpdateCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesUpdateCall) Fields(s ...googleapi.Field) *FilesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *FilesUpdateCall) Context(ctx context.Context) *FilesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *FilesUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["addParents"]; ok { + params.Set("addParents", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["convert"]; ok { + params.Set("convert", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["modifiedDateBehavior"]; ok { + params.Set("modifiedDateBehavior", 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_["removeParents"]; ok { + params.Set("removeParents", 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.files.update" call. +// Exactly one of *File or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *File.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *FilesUpdateCall) Do() (*File, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &File{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates file metadata and/or content.", + // "httpMethod": "PUT", + // "id": "drive.files.update", + // "mediaUpload": { + // "accept": [ + // "*/*" + // ], + // "maxSize": "5120GB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/drive/v2/files/{fileId}" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/drive/v2/files/{fileId}" + // } + // } + // }, + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "addParents": { + // "description": "Comma-separated list of parent IDs to add.", + // "location": "query", + // "type": "string" + // }, + // "convert": { + // "default": "false", + // "description": "This parameter is deprecated and has no function.", + // "location": "query", + // "type": "boolean" + // }, + // "fileId": { + // "description": "The ID of the file to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "modifiedDateBehavior": { + // "description": "Determines the behavior in which modifiedDate is updated. This overrides setModifiedDate.", + // "enum": [ + // "fromBody", + // "fromBodyIfNeeded", + // "fromBodyOrNow", + // "noChange", + // "now", + // "nowIfNeeded" + // ], + // "enumDescriptions": [ + // "Set modifiedDate to the value provided in the body of the request. No change if no value was provided.", + // "Set modifiedDate to the value provided in the body of the request depending on other contents of the update.", + // "Set modifiedDate to the value provided in the body of the request, or to the current time if no value was provided.", + // "Maintain the previous value of modifiedDate.", + // "Set modifiedDate to the current time.", + // "Set modifiedDate to the current time depending on contents of the update." + // ], + // "location": "query", + // "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 true or not set, a new blob is created as head revision, and previous unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions. For details on how revisions are retained, see the Drive Help Center.", + // "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 BCP 47 codes.", + // "location": "query", + // "type": "string" + // }, + // "pinned": { + // "default": "false", + // "description": "Whether to pin the new revision. A file can have a maximum of 200 pinned revisions.", + // "location": "query", + // "type": "boolean" + // }, + // "removeParents": { + // "description": "Comma-separated list of parent IDs to remove.", + // "location": "query", + // "type": "string" + // }, + // "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.metadata", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// AcknowledgeAbuse sets the optional parameter "acknowledgeAbuse": +// Whether the user is acknowledging the risk of downloading known +// malware or other abusive files. +func (c *FilesWatchCall) AcknowledgeAbuse(acknowledgeAbuse bool) *FilesWatchCall { + c.opt_["acknowledgeAbuse"] = acknowledgeAbuse + return c +} + +// Projection sets the optional parameter "projection": This parameter +// is deprecated and has no function. +// +// Possible values: +// "BASIC" - Deprecated +// "FULL" - Deprecated +func (c *FilesWatchCall) Projection(projection string) *FilesWatchCall { + c.opt_["projection"] = projection + return c +} + +// RevisionId sets the optional parameter "revisionId": Specifies the +// Revision ID that should be downloaded. Ignored unless alt=media is +// specified. +func (c *FilesWatchCall) RevisionId(revisionId string) *FilesWatchCall { + c.opt_["revisionId"] = revisionId + return c +} + +// UpdateViewedDate sets the optional parameter "updateViewedDate": +// Deprecated: Use files.update with modifiedDateBehavior=noChange, +// updateViewedDate=true and an empty request body. +func (c *FilesWatchCall) UpdateViewedDate(updateViewedDate bool) *FilesWatchCall { + c.opt_["updateViewedDate"] = updateViewedDate + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FilesWatchCall) Fields(s ...googleapi.Field) *FilesWatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FilesWatchCall) Context(ctx context.Context) *FilesWatchCall { + c.ctx_ = ctx + return c +} + +func (c *FilesWatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["acknowledgeAbuse"]; ok { + params.Set("acknowledgeAbuse", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["revisionId"]; ok { + params.Set("revisionId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["updateViewedDate"]; ok { + params.Set("updateViewedDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/watch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *FilesWatchCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "drive.files.watch" call. +// Exactly one of *Channel or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Channel.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *FilesWatchCall) Do() (*Channel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Channel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Subscribe to changes on a file", + // "httpMethod": "POST", + // "id": "drive.files.watch", + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "acknowledgeAbuse": { + // "default": "false", + // "description": "Whether the user is acknowledging the risk of downloading known malware or other abusive files.", + // "location": "query", + // "type": "boolean" + // }, + // "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" + // }, + // "revisionId": { + // "description": "Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.", + // "location": "query", + // "type": "string" + // }, + // "updateViewedDate": { + // "default": "false", + // "description": "Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body.", + // "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", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.photos.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ], + // "supportsMediaDownload": true, + // "supportsSubscription": true + // } + +} + +// method id "drive.parents.delete": + +type ParentsDeleteCall struct { + s *Service + fileId string + parentId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ParentsDeleteCall) Fields(s ...googleapi.Field) *ParentsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ParentsDeleteCall) Context(ctx context.Context) *ParentsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ParentsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/parents/{parentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + "parentId": c.parentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.parents.delete" call. +func (c *ParentsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ParentsGetCall) Fields(s ...googleapi.Field) *ParentsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ParentsGetCall) IfNoneMatch(entityTag string) *ParentsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ParentsGetCall) Context(ctx context.Context) *ParentsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ParentsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/parents/{parentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + "parentId": c.parentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.parents.get" call. +// Exactly one of *ParentReference or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ParentReference.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ParentsGetCall) Do() (*ParentReference, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ParentReference{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets 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", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.photos.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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ParentsInsertCall) Fields(s ...googleapi.Field) *ParentsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ParentsInsertCall) Context(ctx context.Context) *ParentsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ParentsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/parents") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.parents.insert" call. +// Exactly one of *ParentReference or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ParentReference.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ParentsInsertCall) Do() (*ParentReference, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ParentReference{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ParentsListCall) Fields(s ...googleapi.Field) *ParentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ParentsListCall) IfNoneMatch(entityTag string) *ParentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ParentsListCall) Context(ctx context.Context) *ParentsListCall { + c.ctx_ = ctx + return c +} + +func (c *ParentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/parents") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.parents.list" call. +// Exactly one of *ParentList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ParentList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ParentsListCall) Do() (*ParentList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ParentList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.photos.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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PermissionsDeleteCall) Fields(s ...googleapi.Field) *PermissionsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PermissionsDeleteCall) Context(ctx context.Context) *PermissionsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *PermissionsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + "permissionId": c.permissionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.permissions.delete" call. +func (c *PermissionsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PermissionsGetCall) Fields(s ...googleapi.Field) *PermissionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PermissionsGetCall) IfNoneMatch(entityTag string) *PermissionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PermissionsGetCall) Context(ctx context.Context) *PermissionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *PermissionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + "permissionId": c.permissionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.permissions.get" call. +// Exactly one of *Permission or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Permission.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PermissionsGetCall) Do() (*Permission, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Permission{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets 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", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.photos.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// method id "drive.permissions.getIdForEmail": + +type PermissionsGetIdForEmailCall struct { + s *Service + email string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PermissionsGetIdForEmailCall) Fields(s ...googleapi.Field) *PermissionsGetIdForEmailCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PermissionsGetIdForEmailCall) IfNoneMatch(entityTag string) *PermissionsGetIdForEmailCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PermissionsGetIdForEmailCall) Context(ctx context.Context) *PermissionsGetIdForEmailCall { + c.ctx_ = ctx + return c +} + +func (c *PermissionsGetIdForEmailCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "permissionIds/{email}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "email": c.email, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.permissions.getIdForEmail" call. +// Exactly one of *PermissionId or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PermissionId.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PermissionsGetIdForEmailCall) Do() (*PermissionId, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionId{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.photos.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{} + ctx_ context.Context +} + +// 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. This parameter is ignored and an email is +// sent if the role is owner. +func (c *PermissionsInsertCall) SendNotificationEmails(sendNotificationEmails bool) *PermissionsInsertCall { + c.opt_["sendNotificationEmails"] = sendNotificationEmails + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PermissionsInsertCall) Fields(s ...googleapi.Field) *PermissionsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PermissionsInsertCall) Context(ctx context.Context) *PermissionsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *PermissionsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.permissions.insert" call. +// Exactly one of *Permission or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Permission.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PermissionsInsertCall) Do() (*Permission, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Permission{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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. This parameter is ignored and an email is sent if the role is owner.", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PermissionsListCall) Fields(s ...googleapi.Field) *PermissionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PermissionsListCall) IfNoneMatch(entityTag string) *PermissionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PermissionsListCall) Context(ctx context.Context) *PermissionsListCall { + c.ctx_ = ctx + return c +} + +func (c *PermissionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.permissions.list" call. +// Exactly one of *PermissionList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PermissionList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PermissionsListCall) Do() (*PermissionList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.photos.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{} + ctx_ context.Context +} + +// Patch: Updates a permission using 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' downgrades the current owners to +// writers. Does nothing if the specified role is not 'owner'. +func (c *PermissionsPatchCall) TransferOwnership(transferOwnership bool) *PermissionsPatchCall { + c.opt_["transferOwnership"] = transferOwnership + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PermissionsPatchCall) Fields(s ...googleapi.Field) *PermissionsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PermissionsPatchCall) Context(ctx context.Context) *PermissionsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *PermissionsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["transferOwnership"]; ok { + params.Set("transferOwnership", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + "permissionId": c.permissionId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.permissions.patch" call. +// Exactly one of *Permission or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Permission.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PermissionsPatchCall) Do() (*Permission, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Permission{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a permission using 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' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'.", + // "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{} + ctx_ context.Context +} + +// 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' downgrades the current owners to +// writers. Does nothing if the specified role is not 'owner'. +func (c *PermissionsUpdateCall) TransferOwnership(transferOwnership bool) *PermissionsUpdateCall { + c.opt_["transferOwnership"] = transferOwnership + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PermissionsUpdateCall) Fields(s ...googleapi.Field) *PermissionsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PermissionsUpdateCall) Context(ctx context.Context) *PermissionsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *PermissionsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["transferOwnership"]; ok { + params.Set("transferOwnership", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + "permissionId": c.permissionId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.permissions.update" call. +// Exactly one of *Permission or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Permission.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PermissionsUpdateCall) Do() (*Permission, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Permission{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'.", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PropertiesDeleteCall) Fields(s ...googleapi.Field) *PropertiesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PropertiesDeleteCall) Context(ctx context.Context) *PropertiesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *PropertiesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["visibility"]; ok { + params.Set("visibility", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties/{propertyKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + "propertyKey": c.propertyKey, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.properties.delete" call. +func (c *PropertiesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a 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", + // "https://www.googleapis.com/auth/drive.metadata" + // ] + // } + +} + +// method id "drive.properties.get": + +type PropertiesGetCall struct { + s *Service + fileId string + propertyKey string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PropertiesGetCall) Fields(s ...googleapi.Field) *PropertiesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PropertiesGetCall) IfNoneMatch(entityTag string) *PropertiesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PropertiesGetCall) Context(ctx context.Context) *PropertiesGetCall { + c.ctx_ = ctx + return c +} + +func (c *PropertiesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["visibility"]; ok { + params.Set("visibility", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties/{propertyKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + "propertyKey": c.propertyKey, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.properties.get" call. +// Exactly one of *Property or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Property.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PropertiesGetCall) Do() (*Property, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Property{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets 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", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.photos.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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PropertiesInsertCall) Fields(s ...googleapi.Field) *PropertiesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PropertiesInsertCall) Context(ctx context.Context) *PropertiesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *PropertiesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.properties.insert" call. +// Exactly one of *Property or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Property.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PropertiesInsertCall) Do() (*Property, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Property{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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", + // "https://www.googleapis.com/auth/drive.metadata" + // ] + // } + +} + +// method id "drive.properties.list": + +type PropertiesListCall struct { + s *Service + fileId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PropertiesListCall) Fields(s ...googleapi.Field) *PropertiesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PropertiesListCall) IfNoneMatch(entityTag string) *PropertiesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PropertiesListCall) Context(ctx context.Context) *PropertiesListCall { + c.ctx_ = ctx + return c +} + +func (c *PropertiesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.properties.list" call. +// Exactly one of *PropertyList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PropertyList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PropertiesListCall) Do() (*PropertyList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PropertyList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.photos.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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PropertiesPatchCall) Fields(s ...googleapi.Field) *PropertiesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PropertiesPatchCall) Context(ctx context.Context) *PropertiesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *PropertiesPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["visibility"]; ok { + params.Set("visibility", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties/{propertyKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + "propertyKey": c.propertyKey, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.properties.patch" call. +// Exactly one of *Property or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Property.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PropertiesPatchCall) Do() (*Property, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Property{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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", + // "https://www.googleapis.com/auth/drive.metadata" + // ] + // } + +} + +// method id "drive.properties.update": + +type PropertiesUpdateCall struct { + s *Service + fileId string + propertyKey string + property *Property + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PropertiesUpdateCall) Fields(s ...googleapi.Field) *PropertiesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PropertiesUpdateCall) Context(ctx context.Context) *PropertiesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *PropertiesUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["visibility"]; ok { + params.Set("visibility", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties/{propertyKey}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + "propertyKey": c.propertyKey, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.properties.update" call. +// Exactly one of *Property or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Property.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PropertiesUpdateCall) Do() (*Property, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Property{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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", + // "https://www.googleapis.com/auth/drive.metadata" + // ] + // } + +} + +// method id "drive.realtime.get": + +type RealtimeGetCall struct { + s *Service + fileId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Revision sets the optional parameter "revision": The revision of the +// Realtime API data model to export. Revisions start at 1 (the initial +// empty data model) and are incremented with each change. If this +// parameter is excluded, the most recent data model will be returned. +func (c *RealtimeGetCall) Revision(revision int64) *RealtimeGetCall { + c.opt_["revision"] = revision + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RealtimeGetCall) Fields(s ...googleapi.Field) *RealtimeGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RealtimeGetCall) IfNoneMatch(entityTag string) *RealtimeGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RealtimeGetCall) Context(ctx context.Context) *RealtimeGetCall { + c.ctx_ = ctx + return c +} + +func (c *RealtimeGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["revision"]; ok { + params.Set("revision", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/realtime") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *RealtimeGetCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "drive.realtime.get" call. +func (c *RealtimeGetCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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" + // }, + // "revision": { + // "description": "The revision of the Realtime API data model to export. Revisions start at 1 (the initial empty data model) and are incremented with each change. If this parameter is excluded, the most recent data model will be returned.", + // "format": "int32", + // "location": "query", + // "minimum": "1", + // "type": "integer" + // } + // }, + // "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 + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// 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 +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *RealtimeUpdateCall) Media(r io.Reader) *RealtimeUpdateCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *RealtimeUpdateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *RealtimeUpdateCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *RealtimeUpdateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *RealtimeUpdateCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RealtimeUpdateCall) Fields(s ...googleapi.Field) *RealtimeUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *RealtimeUpdateCall) Context(ctx context.Context) *RealtimeUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *RealtimeUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["baseRevision"]; ok { + params.Set("baseRevision", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/realtime") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + body = new(bytes.Buffer) + ctype := "application/json" + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.realtime.update" call. +func (c *RealtimeUpdateCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return err + } + defer res.Body.Close() + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RepliesDeleteCall) Fields(s ...googleapi.Field) *RepliesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RepliesDeleteCall) Context(ctx context.Context) *RepliesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *RepliesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + "commentId": c.commentId, + "replyId": c.replyId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.replies.delete" call. +func (c *RepliesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RepliesGetCall) Fields(s ...googleapi.Field) *RepliesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RepliesGetCall) IfNoneMatch(entityTag string) *RepliesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RepliesGetCall) Context(ctx context.Context) *RepliesGetCall { + c.ctx_ = ctx + return c +} + +func (c *RepliesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["includeDeleted"]; ok { + params.Set("includeDeleted", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + "commentId": c.commentId, + "replyId": c.replyId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.replies.get" call. +// Exactly one of *CommentReply or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CommentReply.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RepliesGetCall) Do() (*CommentReply, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CommentReply{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RepliesInsertCall) Fields(s ...googleapi.Field) *RepliesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RepliesInsertCall) Context(ctx context.Context) *RepliesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *RepliesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + "commentId": c.commentId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.replies.insert" call. +// Exactly one of *CommentReply or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CommentReply.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RepliesInsertCall) Do() (*CommentReply, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CommentReply{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RepliesListCall) Fields(s ...googleapi.Field) *RepliesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RepliesListCall) IfNoneMatch(entityTag string) *RepliesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RepliesListCall) Context(ctx context.Context) *RepliesListCall { + c.ctx_ = ctx + return c +} + +func (c *RepliesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + "commentId": c.commentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.replies.list" call. +// Exactly one of *CommentReplyList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CommentReplyList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RepliesListCall) Do() (*CommentReplyList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CommentReplyList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RepliesPatchCall) Fields(s ...googleapi.Field) *RepliesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RepliesPatchCall) Context(ctx context.Context) *RepliesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *RepliesPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + "commentId": c.commentId, + "replyId": c.replyId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.replies.patch" call. +// Exactly one of *CommentReply or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CommentReply.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RepliesPatchCall) Do() (*CommentReply, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CommentReply{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RepliesUpdateCall) Fields(s ...googleapi.Field) *RepliesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RepliesUpdateCall) Context(ctx context.Context) *RepliesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *RepliesUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + "commentId": c.commentId, + "replyId": c.replyId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.replies.update" call. +// Exactly one of *CommentReply or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CommentReply.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RepliesUpdateCall) Do() (*CommentReply, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CommentReply{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RevisionsDeleteCall) Fields(s ...googleapi.Field) *RevisionsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RevisionsDeleteCall) Context(ctx context.Context) *RevisionsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *RevisionsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + "revisionId": c.revisionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.revisions.delete" call. +func (c *RevisionsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RevisionsGetCall) Fields(s ...googleapi.Field) *RevisionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RevisionsGetCall) IfNoneMatch(entityTag string) *RevisionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RevisionsGetCall) Context(ctx context.Context) *RevisionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *RevisionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + "revisionId": c.revisionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.revisions.get" call. +// Exactly one of *Revision or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Revision.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RevisionsGetCall) Do() (*Revision, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Revision{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets 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", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.photos.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// method id "drive.revisions.list": + +type RevisionsListCall struct { + s *Service + fileId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RevisionsListCall) Fields(s ...googleapi.Field) *RevisionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RevisionsListCall) IfNoneMatch(entityTag string) *RevisionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RevisionsListCall) Context(ctx context.Context) *RevisionsListCall { + c.ctx_ = ctx + return c +} + +func (c *RevisionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.revisions.list" call. +// Exactly one of *RevisionList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *RevisionList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RevisionsListCall) Do() (*RevisionList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RevisionList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.photos.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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RevisionsPatchCall) Fields(s ...googleapi.Field) *RevisionsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RevisionsPatchCall) Context(ctx context.Context) *RevisionsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *RevisionsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + "revisionId": c.revisionId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.revisions.patch" call. +// Exactly one of *Revision or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Revision.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RevisionsPatchCall) Do() (*Revision, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Revision{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RevisionsUpdateCall) Fields(s ...googleapi.Field) *RevisionsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RevisionsUpdateCall) Context(ctx context.Context) *RevisionsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *RevisionsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "fileId": c.fileId, + "revisionId": c.revisionId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "drive.revisions.update" call. +// Exactly one of *Revision or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Revision.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RevisionsUpdateCall) Do() (*Revision, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Revision{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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/Godeps/_workspace/src/google.golang.org/api/examples/bigquery.go b/Godeps/_workspace/src/google.golang.org/api/examples/bigquery.go new file mode 100644 index 000000000..a707b5b96 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/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" + "log" + "math" + "math/rand" + "net/http" + "os" + "strconv" + "strings" + "time" + + bigquery "google.golang.org/api/bigquery/v2" + storage "google.golang.org/api/storage/v1" +) + +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.DevstorageReadOnlyScope, + "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 { + log.Fatalf("Unable to create Storage service: %v", err) + } + + // 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 { + log.Fatalf("Unable to create BigQuery service: %v", 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/Godeps/_workspace/src/google.golang.org/api/examples/books.go b/Godeps/_workspace/src/google.golang.org/api/examples/books.go new file mode 100644 index 000000000..6cbf0a470 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/examples/books.go @@ -0,0 +1,77 @@ +// 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" + "strconv" + "strings" + + books "google.golang.org/api/books/v1" + "google.golang.org/api/googleapi" +) + +func init() { + registerDemo("books", books.BooksScope, booksMain) +} + +// booksMain is an example that demonstrates calling the Books API. +// +// Example usage: +// go build -o go-api-demo *.go +// go-api-demo -clientid="my-clientid" -secret="my-secret" books +func booksMain(client *http.Client, argv []string) { + if len(argv) != 0 { + fmt.Fprintln(os.Stderr, "Usage: books") + return + } + + svc, err := books.New(client) + if err != nil { + log.Fatalf("Unable to create Books service: %v", err) + } + + bs, err := svc.Mylibrary.Bookshelves.List().Do() + if err != nil { + log.Fatalf("Unable to retrieve mylibrary bookshelves: %v", err) + } + + if len(bs.Items) == 0 { + log.Fatal("You have no bookshelves to explore.") + } + for _, b := range bs.Items { + // Note that sometimes VolumeCount is not populated, so it may erroneously say '0'. + log.Printf("You have %v books on bookshelf %q:", b.VolumeCount, b.Title) + + // List the volumes on this shelf. + vol, err := svc.Mylibrary.Bookshelves.Volumes.List(strconv.FormatInt(b.Id, 10)).Do() + if err != nil { + log.Fatalf("Unable to retrieve mylibrary bookshelf volumes: %v", err) + } + for _, v := range vol.Items { + var info struct { + Text bool `json:"text"` + Image bool `json:"image"` + } + // Parse the additional fields, but ignore errors, as the information is not critical. + googleapi.ConvertVariant(v.VolumeInfo.ReadingModes.(map[string]interface{}), &info) + var s []string + if info.Text { + s = append(s, "text") + } + if info.Image { + s = append(s, "image") + } + extra := fmt.Sprintf("; formats: %v", s) + if v.VolumeInfo.ImageLinks != nil { + extra += fmt.Sprintf("; thumbnail: %v", v.VolumeInfo.ImageLinks.Thumbnail) + } + log.Printf(" %q by %v%v", v.VolumeInfo.Title, strings.Join(v.VolumeInfo.Authors, ", "), extra) + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/examples/calendar.go b/Godeps/_workspace/src/google.golang.org/api/examples/calendar.go new file mode 100644 index 000000000..172020903 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/examples/calendar.go @@ -0,0 +1,73 @@ +// 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" + + calendar "google.golang.org/api/calendar/v3" +) + +func init() { + registerDemo("calendar", calendar.CalendarScope, calendarMain) +} + +// calendarMain is an example that demonstrates calling the Calendar API. +// Its purpose is to test out the ability to get maps of struct objects. +// +// Example usage: +// go build -o go-api-demo *.go +// go-api-demo -clientid="my-clientid" -secret="my-secret" calendar +func calendarMain(client *http.Client, argv []string) { + if len(argv) != 0 { + fmt.Fprintln(os.Stderr, "Usage: calendar") + return + } + + svc, err := calendar.New(client) + if err != nil { + log.Fatalf("Unable to create Calendar service: %v", err) + } + + c, err := svc.Colors.Get().Do() + if err != nil { + log.Fatalf("Unable to retrieve calendar colors: %v", err) + } + + log.Printf("Kind of colors: %v", c.Kind) + log.Printf("Colors last updated: %v", c.Updated) + + for k, v := range c.Calendar { + log.Printf("Calendar[%v]: Background=%v, Foreground=%v", k, v.Background, v.Foreground) + } + + for k, v := range c.Event { + log.Printf("Event[%v]: Background=%v, Foreground=%v", k, v.Background, v.Foreground) + } + + listRes, err := svc.CalendarList.List().Fields("items/id").Do() + if err != nil { + log.Fatalf("Unable to retrieve list of calendars: %v", err) + } + for _, v := range listRes.Items { + log.Printf("Calendar ID: %v\n", v.Id) + } + + if len(listRes.Items) > 0 { + id := listRes.Items[0].Id + res, err := svc.Events.List(id).Fields("items(updated,summary)", "summary", "nextPageToken").Do() + if err != nil { + log.Fatalf("Unable to retrieve calendar events list: %v", err) + } + for _, v := range res.Items { + log.Printf("Calendar ID %q event: %v: %q\n", id, v.Updated, v.Summary) + } + log.Printf("Calendar ID %q Summary: %v\n", id, res.Summary) + log.Printf("Calendar ID %q next page token: %v\n", id, res.NextPageToken) + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/examples/compute.go b/Godeps/_workspace/src/google.golang.org/api/examples/compute.go new file mode 100644 index 000000000..e24f498ad --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/examples/compute.go @@ -0,0 +1,93 @@ +package main + +import ( + "fmt" + "log" + "net/http" + "os" + "strings" + + compute "google.golang.org/api/compute/v1" + "google.golang.org/api/googleapi" +) + +func init() { + scopes := strings.Join([]string{ + compute.DevstorageFullControlScope, + compute.ComputeScope, + }, " ") + registerDemo("compute", scopes, 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, err := compute.New(client) + if err != nil { + log.Fatalf("Unable to create Compute service: %v", err) + } + + projectId := argv[0] + instanceName := argv[1] + + prefix := "https://www.googleapis.com/compute/v1/projects/" + projectId + imageURL := "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-v20140606" + zone := "us-central1-a" + + // Show the current images that are available. + res, err := service.Images.List(projectId).Do() + log.Printf("Got compute.Images.List, err: %#v, %v", res, err) + + instance := &compute.Instance{ + Name: instanceName, + Description: "compute sample instance", + MachineType: prefix + "/zones/" + zone + "/machineTypes/n1-standard-1", + Disks: []*compute.AttachedDisk{ + { + AutoDelete: true, + Boot: true, + Type: "PERSISTENT", + InitializeParams: &compute.AttachedDiskInitializeParams{ + DiskName: "my-root-pd", + SourceImage: imageURL, + }, + }, + }, + NetworkInterfaces: []*compute.NetworkInterface{ + &compute.NetworkInterface{ + AccessConfigs: []*compute.AccessConfig{ + &compute.AccessConfig{ + Type: "ONE_TO_ONE_NAT", + Name: "External NAT", + }, + }, + Network: prefix + "/global/networks/default", + }, + }, + ServiceAccounts: []*compute.ServiceAccount{ + { + Email: "default", + Scopes: []string{ + compute.DevstorageFullControlScope, + compute.ComputeScope, + }, + }, + }, + } + + op, err := service.Instances.Insert(projectId, zone, instance).Do() + log.Printf("Got compute.Operation, err: %#v, %v", op, err) + etag := op.Header.Get("Etag") + log.Printf("Etag=%v", etag) + + inst, err := service.Instances.Get(projectId, zone, instanceName).IfNoneMatch(etag).Do() + log.Printf("Got compute.Instance, err: %#v, %v", inst, err) + if googleapi.IsNotModified(err) { + log.Printf("Instance not modified since insert.") + } else { + log.Printf("Instance modified since insert.") + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/examples/debug.go b/Godeps/_workspace/src/google.golang.org/api/examples/debug.go new file mode 100644 index 000000000..85b3ddf87 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/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/Godeps/_workspace/src/google.golang.org/api/examples/drive.go b/Godeps/_workspace/src/google.golang.org/api/examples/drive.go new file mode 100644 index 000000000..5ff5781ed --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/examples/drive.go @@ -0,0 +1,35 @@ +package main + +import ( + "fmt" + "log" + "net/http" + "os" + + drive "google.golang.org/api/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, err := drive.New(client) + if err != nil { + log.Fatalf("Unable to create Drive service: %v", err) + } + + 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/Godeps/_workspace/src/google.golang.org/api/examples/fitness.go b/Godeps/_workspace/src/google.golang.org/api/examples/fitness.go new file mode 100644 index 000000000..6cbb08b82 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/examples/fitness.go @@ -0,0 +1,109 @@ +// 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" + "strings" + "time" + + fitness "google.golang.org/api/fitness/v1" +) + +const ( + layout = "Jan 2, 2006 at 3:04pm" // for time.Format + nanosPerMilli = 1e6 +) + +func init() { + scopes := []string{ + fitness.FitnessActivityReadScope, + fitness.FitnessActivityWriteScope, + fitness.FitnessBodyReadScope, + fitness.FitnessBodyWriteScope, + fitness.FitnessLocationReadScope, + fitness.FitnessLocationWriteScope, + } + registerDemo("fitness", strings.Join(scopes, " "), fitnessMain) +} + +// millisToTime converts Unix millis to time.Time. +func millisToTime(t int64) time.Time { + return time.Unix(0, t*nanosPerMilli) +} + +// fitnessMain is an example that demonstrates calling the Fitness API. +// +// Example usage: +// go build -o go-api-demo *.go +// go-api-demo -clientid="my-clientid" -secret="my-secret" fitness +func fitnessMain(client *http.Client, argv []string) { + if len(argv) != 0 { + fmt.Fprintln(os.Stderr, "Usage: fitness") + return + } + + svc, err := fitness.New(client) + if err != nil { + log.Fatalf("Unable to create Fitness service: %v", err) + } + + us, err := svc.Users.Sessions.List("me").Do() + if err != nil { + log.Fatalf("Unable to retrieve user's sessions: %v", err) + } + if len(us.Session) == 0 { + log.Fatal("You have no user sessions to explore.") + } + + var minTime, maxTime time.Time + for _, s := range us.Session { + start := millisToTime(s.StartTimeMillis) + end := millisToTime(s.EndTimeMillis) + if minTime.IsZero() || start.Before(minTime) { + minTime = start + } + if maxTime.IsZero() || end.After(maxTime) { + maxTime = end + } + log.Printf("Session %q, %v - %v, activity type=%v", s.Name, start.Format(layout), end.Format(layout), s.ActivityType) + } + + ds, err := svc.Users.DataSources.List("me").Do() + if err != nil { + log.Fatalf("Unable to retrieve user's data sources: %v", err) + } + if len(ds.DataSource) == 0 { + log.Fatal("You have no data sources to explore.") + } + for _, d := range ds.DataSource { + format := "integer" + if d.DataType != nil && len(d.DataType.Field) > 0 { + f := d.DataType.Field[0] + format = f.Format + log.Printf("Data source %q, name %q is of type %q", d.DataStreamName, f.Name, format) + } else { + log.Printf("Data source %q is of type %q", d.DataStreamName, d.Type) + } + setID := fmt.Sprintf("%v-%v", minTime.UnixNano(), maxTime.UnixNano()) + data, err := svc.Users.DataSources.Datasets.Get("me", d.DataStreamId, setID).Do() + if err != nil { + log.Fatalf("Unable to retrieve user's data source stream %v, %v: %v", d.DataStreamId, setID, err) + } + for _, p := range data.Point { + for _, v := range p.Value { + t := millisToTime(p.ModifiedTimeMillis).Format(layout) + if format == "integer" { + log.Printf("data at %v = %v", t, v.IntVal) + } else { + log.Printf("data at %v = %v", t, v.FpVal) + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/examples/gmail.go b/Godeps/_workspace/src/google.golang.org/api/examples/gmail.go new file mode 100644 index 000000000..f23223fd5 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/examples/gmail.go @@ -0,0 +1,140 @@ +// 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 ( + "bufio" + "fmt" + "log" + "net/http" + "os" + "sort" + "strings" + + gmail "google.golang.org/api/gmail/v1" +) + +func init() { + registerDemo("gmail", gmail.MailGoogleComScope, gmailMain) +} + +type message struct { + size int64 + gmailID string + date string // retrieved from message header + snippet string +} + +// gmailMain is an example that demonstrates calling the Gmail API. +// It iterates over all messages of a user that are larger +// than 5MB, sorts them by size, and then interactively asks the user to +// choose either to Delete, Skip, or Quit for each message. +// +// Example usage: +// go build -o go-api-demo *.go +// go-api-demo -clientid="my-clientid" -secret="my-secret" gmail +func gmailMain(client *http.Client, argv []string) { + if len(argv) != 0 { + fmt.Fprintln(os.Stderr, "Usage: gmail") + return + } + + svc, err := gmail.New(client) + if err != nil { + log.Fatalf("Unable to create Gmail service: %v", err) + } + + var total int64 + msgs := []message{} + pageToken := "" + for { + req := svc.Users.Messages.List("me").Q("larger:5M") + if pageToken != "" { + req.PageToken(pageToken) + } + r, err := req.Do() + if err != nil { + log.Fatalf("Unable to retrieve messages: %v", err) + } + + log.Printf("Processing %v messages...\n", len(r.Messages)) + for _, m := range r.Messages { + msg, err := svc.Users.Messages.Get("me", m.Id).Do() + if err != nil { + log.Fatalf("Unable to retrieve message %v: %v", m.Id, err) + } + total += msg.SizeEstimate + date := "" + for _, h := range msg.Payload.Headers { + if h.Name == "Date" { + date = h.Value + break + } + } + msgs = append(msgs, message{ + size: msg.SizeEstimate, + gmailID: msg.Id, + date: date, + snippet: msg.Snippet, + }) + } + + if r.NextPageToken == "" { + break + } + pageToken = r.NextPageToken + } + log.Printf("total: %v\n", total) + + sortBySize(msgs) + reader := bufio.NewReader(os.Stdin) + count, deleted := 0, 0 + for _, m := range msgs { + count++ + fmt.Printf("\nMessage URL: https://mail.google.com/mail/u/0/#all/%v\n", m.gmailID) + fmt.Printf("Size: %v, Date: %v, Snippet: %q\n", m.size, m.date, m.snippet) + fmt.Printf("Options: (d)elete, (s)kip, (q)uit: [s] ") + val := "" + if val, err = reader.ReadString('\n'); err != nil { + log.Fatalf("unable to scan input: %v", err) + } + val = strings.TrimSpace(val) + switch val { + case "d": // delete message + if err := svc.Users.Messages.Delete("me", m.gmailID).Do(); err != nil { + log.Fatalf("unable to delete message %v: %v", m.gmailID, err) + } + log.Printf("Deleted message %v.\n", m.gmailID) + deleted++ + case "q": // quit + log.Printf("Done. %v messages processed, %v deleted\n", count, deleted) + os.Exit(0) + default: + } + } +} + +type messageSorter struct { + msg []message + less func(i, j message) bool +} + +func sortBySize(msg []message) { + sort.Sort(messageSorter{msg, func(i, j message) bool { + return i.size > j.size + }}) +} + +func (s messageSorter) Len() int { + return len(s.msg) +} + +func (s messageSorter) Swap(i, j int) { + s.msg[i], s.msg[j] = s.msg[j], s.msg[i] +} + +func (s messageSorter) Less(i, j int) bool { + return s.less(s.msg[i], s.msg[j]) +} diff --git a/Godeps/_workspace/src/google.golang.org/api/examples/gopher.png b/Godeps/_workspace/src/google.golang.org/api/examples/gopher.png new file mode 100644 index 0000000000000000000000000000000000000000..4cf1da8969e41baef324ced3c6c840551b2a7381 GIT binary patch literal 23019 zcmXt91yEL9w>~t|eiDjwcS$HM-QC^YDIg)zC`gxtba!_MNOyNPNF#YS|IF1vXI|jM zK5MV_)CpCP6GunEM}Z&+T~b0s34&l4p1+V0!6zQx5v~w~B5x@yte{|F?_%$4Vedd9 zDJ)Fl;AC%RX=4gOpXO7Q%~h25aQUv6FNCB+{9>i;m2i+rl!U_lu%oExNMB${g^>Q5 z!%^&bDJly8_D@C#TttN5HylLCLas6)b$%d+fo^3zGNAU|o`C#PZ<4%VAnjOE9GHwKh~$-NhzMlC0~L>`g^5BMED*Mt^zRSQEF;7s zsct3#mDfS-!&s=55HcFXq8JiL3&DFq27k!OKS2RW5VqKvI`1icDb@}hSgE8+-Uf;f zqF=O;86A<-)tQKBh9&Xnu{jN44U+|#Iz5u!uzg|2TsM zYBBT~_uCMk$c&6O9=Aq{90Va~&BbTzk%74i-;W2;&-O8s@)+Ji4>iN}I^3)hQ?Lfg z*qc{BcX(bK(O*9r=H|9GH)o}O3uznnt9w71cj~vRKiK^9;l01UTy0&a_`;_9MI8QS zwR7-7CWl}o`bB`z;&!C?eI4r4J>dk|Z%LyD4La-%#s3^5M3TRqv*nP53Psa)Q;t8G ztgkTK!SSzfK;>5aFkVrN`MSn%SJKp28ZPbY*AR5pWZyAKgAC_q@pWy){pm#DK|F&J z@-vf+c7z~35eg=i{wjf9WC#+;_(E6y@$E&&Yle12f)0em4%B-C&Hy2b-r6%thm!ZSW6*bl)vVvSKee;_vh z`=DlV*4QtVihPr3HNp+~T=)TEnW&>CF09FsxEU#E_! zA)_HTE0Iq^K*9cU{sq?yxB$gYYO1wLRm;ZjhHezE9){tNzpZ+iM6*HDsi12SN zivL1|*{BoiLJR#I=au(sH@5KR-=KB{IVD=p>!QhCV{sU=kMt5&H@F*yGf zyKC}?p|7}-(m5rWaTE9!cox@|WxFnoFPGwo#{_d+&2^9Z+cZ&xL6MocakuZ>{T`BYUw`XMD?S@NySmcy`^JTDJaY> zTrNaaJy#u2i7e1l_AV7ueW$!p@M1E)NVPCk;XwJVvUvedesH0AzP*Y-wvXmRD57SU zOqaZHwqizw{zh{T399j%s!t50*62k+u3tEQQ&kMjeRiX3N_-$}3g;^<`1L{fozy$^ zDy8#SGXbQHM8}(-E^;q+Xz~)yeZrQpPiWU^-{!K*G_acLSQo}8#A_5u6e$*oAGC0m z9_6Lxwum-q-hILN*egY?LoIF|IgF6Hqdcd)l!uasE6c}yS;|yso%8lrlZbnpUEXnG zTC1L4nv8wkvPa9#ErB=lgUW;LZQi9gng(JO8U^A4+VE@MZVpF#UP9*Hg;Pag-7Z1l z9K$%ngtdUEhB4l(DY5TjnBOdWbT%k9Y)mGcw~Bq z28S|-rjs~Q_*iGyc2agyW>Qw_475IJG1TVQ)|*OJZffOf9@jS81!{fJ%+XNQ(ybCJ zNiCtAZYpWYdzsfD7b91cHf`Qjep=gCTTu6=d}|hQp|sYv*4xnB2+zE(yR_>#rX|L^ z(fj)Y9};@-97YkL7NL)GwG%eC8uxPY@Xuob@9vBEJ!W%_5v-BfcN?{@255gGuV zPU#!`8@yc0Y|EPZgIw)(f9eM0yX@2S16PE7$)8M~JfFs(JU>bpbGXniAHQhB-rab9 zCT)ul;9fAjs+>Fe_${O1BhJT2{}TVLjuKLfKZid`NUwJihogoqF#;8QcBe;?47Ux# zyL`~71A_zAg9IWRLNxHlSQ9wh#}lrc(i(D4^CS@F(uHL^Df z^e~xe4o+#LYDn5h6MSHzE9JDaX; zE{9>OA%MEzN3#sN%u)(>8g8;1i7gu+cMI#+=%^o#LWQKVF}3FV=G$g&1I4C+m5<$a z;dRVJaY%jERX>UmG#OE9g>rXQv}k7NkSfhh)y>+5Li<0&7p2h;9Sv6XFZ|&8d6NEg z^k3(HYtgkiLDK4sgc{o|#a16Gc^y3#P&RN7=!4V{i+StAYUymJB?&`Yp&E7-Ug+<<;MvPE5%;GOTh7+rCI#6^)}eP zzb$Dowz{C`cZ11@*|^!>_A+CdHb#75!gd0N9s1mSHTsHL_0i>(=mK-X5Y0l<*IMC* ztTx{IX4AaB;UOLYm28y@m0K0gJ&4cU9K{rJ;p;H}QA2x+QY9jz_(4<8Tj1_%u#$ZRE)e3mShqMUrEZKT~O zKgd5ey}#^vFTOyG`IDVj(?jZ9rO$GH&wnDu{A}b~YFw(f57WOzgN4jmuN~vz6)Q~p zlSV9;wQ

@Ex9Jo?)G{dY7}xg{@cW_3FuG-1@frF8jQXF%$B=O+TBGOB-~o8;(6& zYP`&@_ui&)4KH1^c%0%sO;4qL;9F`r_q4z6zP?<+UGj0Fei$BTnscWjF*> zd-r+5BPJtMX?TyBj{~K6xXeB`QwKA{V~JzG63!B0+H61PJnXk0yeV7g>FgnD?fdkO zRqsOW?x@3k(Vg%lYXwt&^D~Jr&6CByic96uyt|k;F)>f@aEa&l#_t#x0K!Bxk`@<% zo}T|^wB*HrPhL1kXgWiXj@a`T40f#WNAMw%i=?b5(gHFr`U_;LB7r1DKB|10 zKTLK1q%w7N-FEl0AW70bKtX61E6hdVBetkux3pqe2(o&a|Ez-k!Bn_LgAVGwNOC64 zRS->BKK9E}2~1h6Xh9Ov?}E3nRm%cwJ1jBWd++*gc}G0h-X(o7O>b#4KdPD0dux!0 zPc}eUc;7a6kEt2rhD$<0fQ-iVnp-SIhU;L!XT${mcVHijOqVgcTMI$COmud+7tF&G z42(W(BfB6!W(Y6z4?@w^e(A?6IE>SIn?oV0{}%tYd``Lfmg|-yAaJRqW%{7$uk0lp zJRZ!3B!Qm^m!Z{4TQ&us9C86_6eEm-9%6>=T;nT3!oc!!2Q++kKiF^@pv7hX@w;tSlSHYLP%>dAg(b%8Z2q^-`m4T$io_s= zLR1eavD2g>HPre=7dxq0Ro)2=&8~SW7U>go(FQZFS+iDaJriLzl2&3fUmf~*dr&6T zEsm47FH*?HN>5As>u8~FA}f+#>h$!q&|wxP3gb1Ww9=+*&0cMi%qirTpU?GOu-!>; z_!K+0Qb_gcog_^5L^Srj(jF09!X(F_h=4sumrzy&=*5| z9&U~MV`*=C1s-9t#&$1#l$DfzBqRj4J>H^vT^)8@9WA`X!tw)m{wq5hUI_W(aPF1w z-NFis)20MGybgO>2(pk)ahRp0<;}zON`=iFo6T%F3`Q`V-(x;S(s3gDUgwp(0M3ss zjrXZ}MK6o_f4O<}f0f($XAX7x!NAeHf3I{GYZ;SZ#3oIPm zUi#BLHJ}nIRynj`LOUbrdCaXhLVKgX;9wk34CSJ>=0(QQ?bz`m)iownr%r)0t9T_Rlwe=@1H(^W@mUitaDB@B{`1s?r-|iG9y}dN}c& zBD$+v@lo!HBtE%KeXPfdf5Ic=V}>B6hE3I@M$?8%*TT_7uag!P@aKT(0F>)q1kdqb zEG9{mMP!}a9sC}an%WG{MvhrG#c1raAS*+#u_&3CBKRL~Ht;|6Og$yU#wuuO;qyIQ zOl-}7qD+;TEs5u1=uR;{RJu{8*TP^z!5Pen;d zY3pB!UQ4o&u&}OLB+1ubLk=VoNRXJZ0H49EJ^3f7aScOZMCFOXEP@Rb|7V{oVuI= zxLRX628LoKc>4cPgS$SOkEG==YS)f_=UU#akk^c-<>yaxJ6YD@_F*0&yb9qY1|X;WKC6Bd`IWNY%SPhS{%m*Lwn z1X+`0s*So)a`^GLVriB8L#OH;H+Jv;opWFq=Szlkfg;{>92`#NnP_m{DSSBEN%xf# zioM;t@Z=-p|6JeiTwF979~(Q`eZ#6qBNaTz19E#wyr>*rLCpqyNL_^Q;cGX#U%Y>asnU#LeYq-%ax2Lz15FgKMN>Zyde4 zny1ZW71#is#uR5qbt_l(oN?ZFS7YGXEWt0ZyB%sIbGy

NO`iIXhdsczbwwVB_Fy zRq_fGt>gEzKrW3}^VUT*+Vt&>BGDHv2PJjW;UW2LL&L+l_4V&d#;*6L!pA2j3Mv#w zsOjm$8(j~?APMA;b8~Z3k7h^nHOV;$ezmp>x!yaV7A7l<#W7i#-iB3xYrv1&F^=Th zzAaf(FD;M>r)K$!Qs=&X356}x+DZpw607YGtSe#%g3GGGf+vM9(QivTbo2VErLr6{ zJ(eXd8E*$04#RrZJFfvj%05DTX6(EBg?oqVr;!ToR5E{ z$~DOcJFD4l4;Sjg_-Tvak9oF4`u_oRuC zs-{GMUfGOMZF57eXgIFwn>*Jf*O{@=U&5AyiLBMG2Wt55%)a$L#l*z4v_6J}AUmOd zVv&*Vy~ry1MTc(KvAMaaASmcJt$@d@clb_d%O~wvZ4{iL#VNl@Uwy7bHia`bF;OCw z+qLlT)AJ?F?0j0Vt!uc~SVD64Hr2v%g#021SGZmnK5%6WAPSbX-WDoFo!6HN{fLd- z9LuMcNfc}i@f<2^xk{cMI?r9G1uIKe!XO!Ku{WNB^Tg2QZjzNyVT?|?&#ygzwC9whoySV zO-6=B@E+^wZsp0!l}X_K?^pGefq?;M!V$+bYqkj+%LTWJfyVtsW#j|q!kjA0iCjcy zPx>$+jNq@gmj`*8|GjweLY5ytF+E*=Af7RcNw*OT3X6!yE!Axr&-nP&;_?2U)~D_u z^tV>7%iumI!RPpz8k(A#db(Z0n0(n(#5x@{$(GAhrPv&*mjh^TIg1rVHYN*{iO`h^ zacoe2k&!)*2Tg`}D}>FxymTr$j)Ll=qO#V)F-P;E`_#mE^wFIgDDN&;`{ z8H?Pcmq?lzj-hd`{8I0{=(KBXEdNS4;atDyWp2B7iV0$=-`-ShLMP%)ghns+CYBhI z$2I6U^afKTe8@5bQSsEgc&FTV(Q_se-xq(etW{I}#M54{TsAZI^Mf`uj!cPm-BqI(E-|q@*!5&E8S(-Tv1o{2Imhd~u8;9|8o3=-q09ZLqE6$7 z9f7BUu}d&zUm0kOaHLp@k>MQOzP+M?yhhUap7+5eQK#MyE@4_jOB<;9d1^hl z{bk;oRHz5;mL0knmuBYBJZx8%=gZNgl9g2bn7WKS1CV0P^-0UMUh2I?3YY!#HZcmR z#qGtOUY_#f!pfrefm5A6_Y@4M<)w|E2e`(1~Kll7fBWpZiF_GQ*8v3ilxs8e^P;cvj<$4w9=dG4y-7(;ZQXYiK`gLr0^4XgK~;uO1Zrdc1fWB4h=ztH z1oT{5ditV8NXYwl5G5t0$ImV>Fb4P>!otF6*x6$PSh5{a4eoyz@V8H)6TG1a@StU4 zLdbDBoQ-ljoLy74)be?_RCmQ8K>fiYeKyp^;eCLDj zF7Zc`qodbboALN=R=*OhNJ~jMZOx3gbu)fBwPc82v&)>i#uq$M>6SwN$hG7WBmY8m zPO|ai$B*-{xw4{9j}O*-QnNMI>WmsH4~Jinh%A0c+=Di)2U+Mu$%=I=L;AZ*vQbox2>o#~5g=u_TYRgSz@%I4LeXlbSpY_y zxb{N>r!~$rHE2lySZNtoH0~D`@m>LDBn#~p8?d>u=oe$dX!_5C0rnPi`K%ocu9sQ;Q!uEl%vMQhKjdV>ol98 z92z1uBiQ_jKUy}VoyG3W_wb1D_P6O%$R?%_sNA}}{21c>UZqmu6~?_`p#9=SMMbIh z>>tinz=0!ofX4D8Dhj4(Dh!PA=MTZRpX(IBx-ZhqE!f<;T}#oR`XIkd8VOlhQ6V9r zm^j*(AM+**L4Ds`&gfSdbim%{)0p_vRji>*6cPy)B(ZFg@)zgz3B4H?A zs}|-{izMPJ|NPHs(RD@_!fs*EK6ZY8wjC7E?7z6!TmOrtbxnsW<>WtZ-4tt>26#Us zme+Iy`&4wg2F@qTE!Ce+jl#ZvFL6vTzt|nCww__K$`82#Eq9)rdlAopxodDx#&ajt zefR0{1hDwCE$}0yQoadMQNQ9+y4EbJ&p+?wB(NW7<%OsAF$SK}QuN(6&9khpukYTR zZs3GX0dzvc&)+(orGKpL;=;~%yPI{n9Qb)H5Dyuuv0a$nxwqxe&6(p%TG^Y(dwZ#q zC!3NR8b3C>#%)I_6Y~;Vh1<5zBevFtv8(-S{6;QX+qNkuMFx%e&Md68dx zli#@H*h^S#*o9a*XH%ocw!G$`U}aS(?$qRVH1ENHr;jII*Em9*_NkLOP>ONJy0jq( z8vQ{koV>{k5EBQzbUgWVtkwp>Ry#Y}+8S5we?q?a&@<%w@WCG2iCf7OVhJoL1{+kFQ+c zIIO1?6cm2AEmEg{uAI)ioKn}fRMwG_lDbzaC-T^Q2`flSO1kO7oiaJ@j9yCPSFFJR zr{$<^gpZxdw7gZde~(5&0PQxNw9?m6+ygu)nKxmX$!gFJNl8jtvOh@z2(kn=$^5Cl z*HH~Vv9=<1T-$7Z)yUDML)*BcB4au_urd@nA?&3grEjyt)DsWCfY4pZ3 zX?_Y24X7K&83^?6>TXQvMuaM;Qu%pLH|xFcc({H=B|`$S+bzCN5AQ4dhRJ^;*n|fj z?0J&2nmX+MY(Bw83rI$2X1~9I?(ONilF9nECj0r6<_DZ!hpq1bBF~-%7j|@M)IU(%SzAG=>Fo z+lsQZ9RTWd)YL|ipwT?c;14V{BIt)P6bJH<#cKN(9Hu>X`(<9);+_b?1rxFw#|<%j z0UzG)ggo&?p1Y*UJnl>_pxqPs6!j8$$?(kR`##k4^!{59XRclu`T1dD=lAOG&{vZU z&gQU!F;uc=|LhJH?Awm$3sb7W%@GY`*+)FyXZUC z@$vEMsP_I^aCrH?mS z3Y&ED6LfZtG9|1jcN9=g=E?V|aARY{lvPRHzbFnvP%d6~sb-OqT9mw^Kp}Z0OrPe?Co-%D`vT?;tP_fDu}4T3%UMiC^R26e*R7dvNJ` zG#~dh+cd`gM-So?t$6$R*J%GWbOCn8bVEl$XNBWN4_z07k&)3ZP^U7~^}XYK zZuh8fffi#4Xx9bUC1YSW$x0_MT}nvow#p{6OG?Yl5(E@70AR27E+$?=$-pa>DdH`a zGHWHlC3B6T3J05n2)pNn#gIP@9i7#rly?_8*Q7>ySa^61%_V(Vv(kdPg98gphVR3H z{^fq;2k%?oTk+`t*s-Ba`a-XUJN*Gb}iB!jA~mA=PPZhyjx!(pU9bcZYKo%pI^)EG$6?HiI%ng^UaT#2e9e^6MNbI{;>TcBYD}`6yQJV zlp(cY*g^}BDsu4%EM?Y-Jb8D0*4s8#R(B`35(FjZmU2HoJ^%bw;{7|lmcodof&TvS zv>-s7zWcO-e_y|MFevd|0T6oVKc$j*K-}?Xln zR8+x1EpXLrY;0m~xEHggtSi62X6-cA2iu%nGrrG;Q=P{tAvsxU#rKI1NO0Nn8}}Q; zPZlmKdd}McDtv^oa-n;WFp3JPclX z$#;&jpKe}TyyvoM0m*+w9S}!~6ja9f&|bsN~aR6crUGv&1pOLPLMm zEqfOAucQNwNT`Dj_y=G+jMEPsRgLf$Ibj$Z7?3Ra+#OYWoIisD22iRIdY{%18V^dF zEII>TTmaQ?9B?kp$$ke`bzF&Pp&ln|J4tdxrN2miE+0!E;6gl)NmIa3iO?Cy$-9dB zv)x{#kYNm@AUoPWmeHU*Bh~)fW4GhQJ=PD6m9j%D3dGtP8n1_vIl@)@zc)AY){S-g z)ivPEj0zm33*orNWp4Tu((H8ke-#E~``0Jnu)KWr3J!vWN?We9bljI*NB3Mt4=z=E z^b3A>cdyM>7%O0lhTB`w74ppVKQafj1FaMWGBh-V{2uPEjobZT^a#1===zIJl4PhZ zju!CN*4B1s%7_E7W?Q_t>H}cUft+|X>_7qxBvTWU zPn(rW-gYvypdC8Lh5zoz8v6d@#~M=+-EO*{+|eT~z#6V`x>=c-WJ8fz!^%Yw0Ba7F zAxJZ#y282uy7Xtw!D27wpmFcgbH35lx<*$it}7VRYmk@#Y}oK?b1+kZWUrNrE{USs zS<;+jz(!gBSnDf@Q<#xKVp}m$h%f8tSP{Q?3=oVS*Oi|igo2J zwfB2ig{(nTpsG?zMpu76dF(mc8mKvNBaSLOP)ilnPPOp9Sqs)`r4ON<`HFd0BMt+`q7?g9pP=2c;*P|l zkI?>NM(OawhYuW9?EBH%z=Ko)v>~hCgdN{H6|aT%-*$?9^G+j~Zm&0_t0{R?@5<}n|D(RVr;$IO%(d%OA-(<;W>+q?cA^!xg?ptry$e(?es4GkUwiYF8Oi9Z6W z!^N&5aNMefe<2@RT0yG-wTXFpdWPG&>{FaQV?!F8;?9rUx^-!0&Uk7RzMU4$@L#@U zQAo0#IQfo0@Bbe8iWIv>No^wlEM|81+^-Hb$M;;Y2?%6>ZtrtiO#~3KnjV;DGmqv~ zbL_!fg?*Uz6&kyh156VP1GmSu&z)imR!f_^D+t|Lc53XYA4P$WALqT6QY8|Gc*=2@ z(&UJ0MfcyeuCZL%6nud#`E-6=dQ@rTFF$@@iHM7D0EIG<)fkcg;X*mxN6Q|#gVxi< zFwkHM7iNp+<#@j}upfbh1VOu(o-!$%=%AI>A65=v5fMd@3J0|tRR|(~0oBMDYUqvl zsqjwe)kBTdRN->uTG?PK4<3LLH6;I?GKl+FGHI_k_@4QKYO3)ZcL&N6GzwPM`f_st zP($2Lw|&&spiR3+#$V#uet03~ZF+9=%2;*qEB?YGt?O>*CX1|#tP_J8Rm8&|!6)y#> z?58OfyQZUBsnkAzOiGnao%CfjkF+@A3<`Q><>aOr=Emd_K2?tE%2T zPm9zK&OvN!Y`ek4K7Tdr_<^>^f3pgwmM7JJ4r)gEyrr#&dzI_4XqA4kdo4~~ui(n; z>0&}&HNwXhH1^>*OQ7)*ou2~nea1v>V7|t>M&v8B8}!!h@6FTm@;ulBwFsR`4HU_* z1bv^R=gIVpQUUN!172;PQH6qmK}IiMJ?I6r0s<>L_kOJaa|9)aUI^_OC=#Ih+Xu6w z`C)yLZ&JV58c0w-s48TNZYsr%mvVAq13*G(!5%bXO8_R&myxHu^YZd0_^uZ>9BpwJ z_a58fFfAmn_LVc_e!l+*)+HAp(^Lw{GrGSQ`cJnBoQz?Cg`UT4Pd@5(EQgAzrN&T^ z|H;5KTMcs=lcK7s=(Snt;^{{3L5-3vPV;{>~wO;_-`J+3JsT0iDKnQ)O$h!Fe)A8qXHP9LRA+ z3h4d1irCK*=Tw}lM4mO*pvn4Q2K_6;?+S0bRn>L3RJ%^*s?6j3IV{Js5sOR!Eky0^ z?X~WG1|iQ1jFpwu_v^Tn6zO0L!c0D|tI_csY2AtsId|yD$QiWCxhnM;mYP&@KP8~u z+!VXQ8Vyjf3*<;@LPD^v2h-mvB*|Lz^yTsweeLTOXt}wQAq7xA4Llmc!0atyQu!#9 z$W=ji!xBANm^ZJ`=(49|=Ncb|KLgypBJ5(|4{+t%KgT!JiZ#|8Wvb?6mYUr2JkGbr zfSs`iKx-b@@8dwI-fP%N%K~kD{CKI!64+qumg5vw6S?RJ2nZf795ACGF(VC5eEw%h zRdvJtF>6o0mCxtjwU8M$;!2Vnn z^|Qdl4lFRw>m~Ps^73*u-9ez)C@!1;dA#|y9L9`JNht~>Lnftp_in>P&yxAmRUtT?QL21lSZ5BssyH?i~WA?u1P+0f8Xtq6CZsfZ=TB_W~XivY6| z4&)AgOj+gR=jS`cYlz;pZYNv!4;dGK10P6{pC=WbWM$G!*4gWG`Nsb9iQr^4CQWN(bLft zy0z^S$W6iMFIuZY;|3N{m=`UGs01=p7PSWQ(Y)2*)QcbZj)eI5 zQh>Q_X`N7l7zPFOtZtOGp15#Z?oSq6T(>>7^q+wJX`3wXI{j9;fqB4tya5Y_xI*bh zXNJWgw27ABYDHRZFtyxI z$5X~mlF{pjyR&h%6@!XSc+Wtxpv#2}tl{Sr+q)6ouY-ewR=?%i&8pUb9}L>?Rrprp z=P$q$fP;Ygk!LlK5aIxIaWXD0JaD_?{K|^@AdIsLK+7)39=UK6;yHaMUd%yt{d^IX zr>LrNGedyOKupHv{-l{zq3$clWZF-ZuaiZ25?bkdSR|ZILoFV?Jwi z;rglF+Ck{_sR)&xmsXf#1;wNV2Smfk9H_*f|H1(F&ViRZH66bR^P}+> z6BDd0k=4aeF&4j=fUdWG>z;b@%-AI_u2ShrD@Inj>466T$&82%B2EciO z_cI&*xi@vq1NQS8?=TUc=V+#Ac)j33)WyXG8!5)Ga1GM?907V!DO~Av8q!WP*q*k< zK$5fO&%rUnNu|p@_{$PTQaT`-Af~+T4+w?J$KlaPc?$VwU=Km_olV zSsHNs6-EoX;rFw|HF&>a=Lpzj=@v&jup`NpfKl#}v!dPLlr!ycdwp^e<>4<{xF#Vj zP5!lGwU%Auw?!KEQSk1i?vkE3AI2Z^$&`MWaE^0RZ!md@)+j)8=dxXHPQoDKl?caW zBukYOr-}(>0v5mL#&<4_Z2W&;GUfQ_OICW+TbxV2nMVD6AYJp5U)4GbD|mB^i``E_ zpwsA55Rc$*`FWCEASY#w3)-FBYtX8B8EzWzRK0_{x`UrjleF+0j_7yZ9yCNK>tJcb zg7tm;N3B+(6$rTG#lZ~bvs49u+TJN)uH~^Tm`D!$le7?QB>~&Q9>brgEk7u)N&<6L ziuCsfvR)5CJ9L@^I4QK%$plU>T@1lsioRwzWbJGk+CC~}*syR+2NF3c9;aqn|zkqa=zL|;c4?SY{iEg!5y|`+x+)>+DU;msbdU;}l z!!p#-&ke*n5Su_w8A5E)i}X5fKmuYFAg0t<#Ke&|H=jU;O+-|bl%2hLkspB3zmIn( z8x_4oUnlkg7?2)!UADh(kJ}oVG<0D>u|IzfMw;eojsf`_R`B8Wvgouu_|6@VNk<}w zJfcJL*ROXJ`ZblC@u%$lvIu|6hs@qZyzMQbVjT)DFK77-d?PRv+W`kN1dMR>ync4# zHSZ@D;ERd+J|?}^QgXV$Bsou%zs=SjE}43&wwj`=TsYDhNHXgJo1RqiKVZTA1=8l! zr)XcvzHZCLx+S-iLW3&rOHb_|27SKRczEF(y^+q_h`E}qz)!(?39yPH`4hv-UqB{i zd5xyg=EH}Gj=y=^d_#v@OhrMp4TB64uw85IVA#&?4YR)uL4HLo2M;mmw-SIhQaA?p z4@}0dOLn~gwS=1v#5eGBd_E|eSuoPFlNl_^t*#CZ2Rg^s7;1SZS@UFc0EUHuGy{>4 zlEQ$wAIPA7lBOm;*mif!^Q^nf_X@Uu%5Y%R){vFZn*V7;>aWKKyvTS4&CZ&imYe}W zL1g^=M3BSw;G6dZ7$?Oz>Yd$yt&_5`jZ>;&aqAAAP)$%SQrcLVe6WEbp&jA7{u#d+ zX_yQr&v%Ipkx*0TiMeVcgY0Pt;HfX500wd1V+Vo}8m8qg|EbAcms=S@0x4vx(}jmBnIMIJzF|I0(tpsD8{ zz;aI+a7pBA*`y?m&Cv9q(JD8y{SjIRH#kNRfwnOMY7rc3YZvk7unV`dk6JA13F^x` z41>1>c-Pr_(VgZ=LoG}Q5?FKGFSnRkUwc*>{3{K_K@Z;8Oz~qX$j=V}@?Bp|>Zup7 zqgStnVNy%2nJ-f_2}C9Ss7lEBEdQdJv&X@qw1b0U3W%Y0GoD?%nOPym;;I}BUc=9L zem6kfZ>W9eGqRQ7#U%2J#*#?xVsY{8vKd6R^>vNI(M8yjZiPeif-*C&rHa*1x3;!k z$Q}3IyaTyfZ&O=Xk)ZA~-2;FBiXk%-Nvi^`y82IeVPVTPFJ9i5`uMbJG`TT`<80Jn zDbD@-3M(k#czSe{JmD(E_#pQ7J0TH7(OpAA({)3+-v#oBWv)*en6t2*T_={DGjo{; z^b{s+Vd2*~D29(t0QU%aE3tlS%arqXo70WP>HuNHA@fS#aNOd>#Sxvd_2Z%b{>}+` zfuSX#p0d4#y0TucVDchO#uq~+%BpsKw>g=cPmG|FJ8{Hb_Ylv5pben6!Qt=T5AyhB zcGwtl@Sv5!Du9jMA=+`nNEK5c!`#71LuZwn#8_+=f)%9GLey~_`tMCox`dpZ7}$_} z(Kjz%x{!|rayD<_}Ci)i4TGl`y^`1lix&7B8Eky2qxHb9x#HG z#z$az@T|RQ%go4l7DLPDY>-hp%X{TVt{1<+h1unA@2DwFZ-5G&{vnT40ERdCZNGV5m-~Mor`mj< zD%D>dxtMW}zL8;XGVibutXUTrgNfpl%<5 z7s&`kXxzG9SUB+SQ+MRxhF3v2H!3j^d3ba6$sa)Hfalx_kj(*L3!1VD9J2`MGwB4b zjiQngXaGUa8F-KY`?6$*1cA)kM%&W^^W)=n8#xI{d)|S+ryWp;$8di^CMgt2aM+Y9 zeKo)4v@}Uay5gj+K)c%Prn@JA*a1j6YPoAEK5X6I*_i;=VrdR`1fa+3>qc$$%WvM9 zeaaR>yl|?rNMMkS`&a3d9#3(=2`PAM+8F+$2GbaJHL0)tK~K#^KNJ}^907#uJ{lR3 z9XIR{W#{COGBIIrrVQ^nKN9Sg8XE+B3^}hcdA-~yQPrGt>Tl%V6Ijx6 z>lR_cgiuPyle~KugW5AfLiSU@mk3e-nR9x2O`JT?SB(J_|8y}X9u*h2HGx}q=Z~G^ z(~P=QFFgzE@P0fGf?2`C!C6c5Iwn2Fy~Ptk{>kr+FN8c4s<-d}wFC34=GfFyA=e)0 z#tE@6kE_k1x+4*awAQg+-;A3G_5dM>7BIzj(RFjct1(3ao&%+7xXE`1U=WjXa^eC3 zvlnpr&sWI9eBY->e(wiRQ&tvVVf|oX9}QPI7dwAY9K3}3 z!EI_*-$Q^}LKahns;=`Rp!7k0j*>DEMBb}kQ|kkg&1zSnL6XXpmSZGCl z@RMpFY61!YpsA9107)?~uUNMU7f?4u2)O?KAqI5|iaI*qIy;2`1j(wepC#upH@#NQ zn^^04YyW$>#mkT-_No}1acyGD;o)*7;otA=>knoc~j0_ER192(iff-C#Q;zW4>~d$l)M zpb@A?ZnzvT&gBhcfk=OHePeP{sd|}vLuR!|0J4XItHm-1CLNBPeL2<#dQ^!{1IWIu zZ)^;>1TzgI9ggRqULG%{0C*$(#JTYcW>&C|}ZU-}b;sFaGM87qKPDJimSM{9GXyU?Y!$QnCOt`r_mKMD5f+S>FBFm>n=Jw!1=vA> zfBs0cNpHRfsI^$TPVVT{Ap${y!;s~vn%cpmLpY5O=uxwWmK5f9>00tto`z1xw zKN~N=ah=7Y&Q9|SM0JgU}cq`U_l^m z37qk3Wb6C|1F7?hZ`AT>hh`t=dG78m9ny2sfJ+p#U_(6)jl*DpRqgmC91LD1!o!#_ z0fD3Z1MFxD%}04flw)($a2Q1wPJ{d9ORS76@yPXfZM!vp!{lkQ1`9?M(T<4K)q#5H zKakrUXFwpIR~44$kki9{QJKU2jpH#sTkF^?Y>=0xbOvkW?i2H_R@oK6=!$ zher~P5PnKQzVR0F>zmXX$lwGoJutn_9h<9n%t{F~rHAglY-Pb|ey<@flLvS(LpF1j z2zhd;>)<3NyDqFd4bp#9NHx5E3W+S`@UNhvuMSAzxjp z5F48sja`Z8cLP!gx;Vil47rX#`Iy$@Nqy77pdo{UJDmakPKh%$@1^}Pu3l}oPe|C5qTIdf){JT}cGqVf3A5sA+0&sjT zvYQ=6Qc`kXS_xYl9u;@PG@+a$VDtp?`}@~{2`g7IBrHrxKWzKQfgeIqlmqt&#Bzw> z2hs*D7g4=F47tw|PGnPwfInDN{G!WUen>)Ip4v}+$`Buy%&D%NWFTGzm!Ze{?2Ihc zuk^K_MvEs09`Zy+tTzdFDgp*BLvGNYJjej3?u(Qr_ykQ$$5aNDfe7IRnqQ=I8KH6@ zrOeuJ;xgub1UBZbTLIqzn%OSCj$!q6eZ<|C4hz2j|TDsT_5Z!zotN$uOPLu zVYbBMarRDmf{Anv;?8S*0u^5mmiYBCKLhE7CU|V<^a?ykB-PYQNW`BrP~PBSD4!fI zHcYfMoJ{XEmK(4x8`lv#LXFN2j4*D%NC5A!l*e_mBLhY1*dCQ2BJ24OsJd)NehYrR zVCMA(cCsS_csl=o9b9)H)c+g*oRPE7J`@>68Ies{A>)W-kL)5VyP`Xsh!)w|akh}m z=!C4V?2ODVWt34#3%|$j?^~aHzn}N>exBEOt_fce52erG6VX|C=5-`sgZnft;<y;KUO<78jzNSF_nf^z6e;7)Bq~&ZNK=2s|#$E&qv~ zx6%Nsq?WI*^ugm*Tz<9Z;+hup+vIbur1iZWPM(dB-yF%TJh4TB8-M&YB<&>6W0 zs@Wmb@CegfFWvrd5U7z8@llW%zUd2@53+Wz5thF z+ESM#w>ds4czE2&eppiAN4VV+79rf-)it-2kV`nBHtQE@+k_>lE8qB5*xz;3>2&atw2=9! zBj`wF&y}&>~&mgVpdi~n`D6Mh4(hq>8fn(0sKfd_ta-NN~Y;IDa&RGa?##t z?t#x6j|0Y_Fr`5d#f!7n{sPRs5h9v0_)~Us}W2|s% z2VeeBPF7&N2La5lt>3=72IUF_uOl3a&}Xg=ZZ=-rZ_T(XNNuPQa_j0EpiXcC-eTC; zIXGtLNmL{cvl{E_Olj6HWvKJ&r{+J<(EGPk^) zWw+Y__?V%=g_bqh^Dw6R&DHm79Hf)K(6ST=Z+A471Y5?vj|WRwNFp^i zN8iM_e}R2mWjn@+K-16>)isv!<%_q^eMAWN9d%Un<4O3~ZOrRUH3Z-#X(rNJAdPa; zweU1ZKp-B1ag}lR0z&uT^ma#?MfuEJ$`>z_i8oP8)R-v|)KMT#T8Ox8*zp5mk|aHN*W6;K z#ksa!`4*yOJKm)DJu4c7P}PD7rH`#|ki?T1z3VA(kaj-=sY)U39?v21z0gBPLZ8(f zBcINy*fNKn_qe>wF3gIlxP;4YiQ0Ji{lOE04L2OnZNrVZjn|9H7Z9E6*JXLo=GWHZ z`gg_WHCY5K-1_RL0IXbL`oVeMV!x&x4rTByyh%f2ED3ne{OF{zPH)Nt0R<1`? z6FY0E;+)QR{mY~*fXN7EXzl%d@2Z1WsnPjz)S?GV;J)}e#_O?3!_>uwJ477p6JME; z_#tFSIGLA3g5p%E%Bt_O=Cv!n>sMg)&e>QSiXlDy{jSAo<`R$x#*ZHn)0y_swx%<> z=oWryY~S;Q=8r$`;H?qX)_qRM0z?o$bhVVd%>>$bD-`X%dGdc0Uf!Ll7@3Wf!byXW zzr1KR+v&|B@q@KUQpmg1sQ<*JU1nTk*>J5Fnh7Q(4CF=77##zR(*KRs2Q;Yw{+}$L z!s>{6e83+$O^n%`VA7aZL4g|*N6~ikipC+FNOHzdzlQ*Vu+kpP1;{X9qDTP=DU$rg zaTq#ZeY0eSS8#$oK`rklgXKg-4V<6p>F$nh6d0-0HJ26{9$yS%(2d9iH#PLV(%3f= zP)k0_$ze(8imI!Vr#W=U^6K5v)LTG{!?k)ITpU%DK!BcSC12-N=IthwVi+?Q^vOi$!39$XuQlw z1sD>05dK5576pPt8d-=HEU1E0^sc4dcjkdt0N7GPkHG*O7yMA|N-mG#R>D96#5khATNYNUzyCSHpk@==;hjW3scI zD*W79{;W2QE#X7?-p__t&aj+NAE~UZ0;_hQm+5o+ftiGUEDqiMP_P)3youoA2b2YS z|Bd01Egd4j8Wd0)#0+?}h#w00c&6Z=y!3UFVa2$rlB+!LRa^R7*Iq(z2`G-Yj;q+zgO4d?k8h?@8eSbOLwMoil-t{%F3%g zHbPc@$i{(t8T3YdyR3rh_FNKAL}>>;zv~H$ zF_~yb^t*x1(E$&XZo=>?8Du?6>sJCY2ORup32|{vT&(l@Z2NR*F@%AhKL7RW*8$rG zV7!M^>tTZ;`5Er0Jm43hyzs8%h;pq-PjJ}=J4ACRb+(@Cj45(;es4de987?rO=pq! z4=>6Q&g}pDF7Wr#zO-Hae=q#b($YF`b$)$VT1tsfNB%%4HFecm4})>!g9plhR?oHD z6B#O>xMlH9B-%NyTs;OyN2DUazOL2m!_92_eA-PVL>O+3G=CAdm)+j$Dp+J7OXcz3 zXm6XQVCtna23~>=kDEmeU^rMp(T1kxMMNBc2Mu6_r+r>O_s_&R_@3aB5XkWGic#>K*v%6H|YztBc0kK^QG?Gu+nXRgzwp1N#; z&^YbImu#}fQZ%{KFcdn=R8JnnP+#Ba`%_wLOW*b6!+`3dIG6oz-u-h)6}`wZq%8rieK;+EDuDXoIm0iZ13k#> z@l*XYG;bwZiwGtYITGrW21U!>crJ-EId50zA?T8jAuvZNr;o8#l!0M?y4IZ$Y&-*2 z#|++xM(4ZkkHng*Rjmi#XbfcgMZ+6k5Eg!vh_L1R&9@;0gU81`bLHA%F;p76KRBST zk`4dm5B7X5v<;%gx)O9&^}Tm@C@+(hwwXzQv+Um7F($lOs{73kcg2zclSvxz5D_i_ z(-NPo3-QxFR>lbdA6m5v#no~g(55lOw1G{NvQaxzq=xjIsq2y#jJZZ?vq4S$%zHo~*%|q<`ho$$U}R*h(dN>KJ1Cng zMDL4R9?bWE`!Gqg6vvmIPF!9dF^wUU+wE<5-(=VO2;N0L$|0NzR!Vku%p5-qbU?eN zF1={FZgy>Qthmsi|fH&nXgchM|HfRM^M& z-e_$hFl1t}uSaH1xWDoWbsl8nCD6uHC~uQto3%l$a7;*tH=!>`uQ(yIB(>FXK3n2w zN0^Z&xk&n)(sX-FQ3_Ur4sB0CoIpd3zwy475-kjOmrbz;T#Y(eU+SQfdaZ?d=} zEpg{i;wTjAK;xE>nx>p>V%z91)YaLUTvOuKBH7R;B2#@neR%S+bcALd>eMt@CiwW< z@w4|{S~;xjK&Hq$sM)I+dSFNcz`R4uN;3<-#!X#j85#^|Y-fUo4DMY1L|Tu z2$`PXWaCXQ76<3Le=p2rR>jQi4?D)!e0nB|T$ZY?c2ZPZ zh+iYD{DFY4vVAa9!RXoysE7|lqRk+&>Sx}12=*~x4xjudX8AJ=V23)8sqG|7bJ>{F zVA~Q4^WKXHUlc_i6=JKfOq2v`Nvo#jGp$v0g^bAI18=pyO874s<8+xw#1x0a6=`oh z!|(QYtY#|u@WIR)`LeDeaR#8yfZvY2+M9H2wM>pnW$*~{4b@>{5T7~O^qt?Mik69T zJ{?Cd{mSyQQ?~R!b|Fdre#M_4(7SX3s}{QcLtnULbY&TeFF(xi$!o1X0KVzn=hFp$ zlZEv~k}&zS1v-#5Te>;r?{;9GSjR6FEv?7Gs97_Flb_$too8_OJ46GY{MARtIf42t zp9nhzAUAaXb)dC6P!FB}rk*`A2`v*&huuhA>fs+>OLEV7-z_u1P`-T=piM*`CIIpM zeFPj?zV015T3S!@D6eyRdWR1Db_W8c(^#hU*$YK4O;^6hpd&`S*9G`6L$Cfz>Dn6b z5!#GDBo#*{OFYWOJ1y+{ZR|Ntt9B?8@VVbbR1D-*Lby+^Ex)tAekX;c|C3^XthJDm z>jOu$R=z2x-<^)r?Fq9tgj&7}R_nfTvuedM(X{FZR6_^JC9vfxsqKYaDaqxvXk#7CS=vr7~j{|)YZ{AOrVgKmX@BS02yPB-{AsF0l!tAJ3as2DcB4}vgYO-=a**QzJ1Fkk?%Tx7~#^KqPb^ad~5gl z^v=}ChzO5S55w9IFVrTQkUA0U)zKIZW zQGINsU;lf@rHR)soW1giPN&cOlVOhj6eG=tCno7Cx2SIJ=ed~ANny0EyN->aLqKi3dvKKWunAnDxKHUds+KH{1<}A ze@&vXL2rHF<5NF`h#QVdA!pRp*Z)nlmaj&LiHWuDiV0I5e)?oLl68WpY%{$4A^}lm zzq`4&*Y=Fd5{S|%x8hn->yd{#&7zIkagT@R+E|RQiD~W|Sa3Po*#-Vfj*8Kaw6F+9 zs-5d1Q1bEyK`|IH6N^DS4S9Wi-Q!h})5(+orOCl?W@K?wjon(Pv)9wRqW%aCFEThd z`1d3&kOSrXU+{*PVlct>4jGrJ7V4qv^?Q63kAL;I_;cVcyP1&A5zn2to?f@pj#Sf= zlgc3~*3xOS2K4b#HJsXG#^PhwY1fC^zJB%b@Nl%Yc0$g`%Li2yDkv&`s+S>tB1B6E z2@y-8H|Y_qrQZ4griJb00{ z=C|eL<>&WKE1x;@Me**TpQ5SSam}ai?aWh=^G)L#>g!+XT*_7%pO^@BdvZ>aJCLDAQeAH-#xB&VUi zDg0=W_$Ov16_xScye^kvBkPr*KN%L|V`H4>pAKhcSlC(?h!evy4Azb(?xEMGh)k literal 0 HcmV?d00001 diff --git a/Godeps/_workspace/src/google.golang.org/api/examples/main.go b/Godeps/_workspace/src/google.golang.org/api/examples/main.go new file mode 100644 index 000000000..68551cc86 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/examples/main.go @@ -0,0 +1,206 @@ +// 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" + + "golang.org/x/net/context" + "golang.org/x/oauth2" + "golang.org/x/oauth2/google" +) + +// Flags +var ( + clientID = flag.String("clientid", "", "OAuth 2.0 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 2.0 Client ID from https://developers.google.com/console.") + secret = flag.String("secret", "", "OAuth 2.0 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 2.0 Client Secret from https://developers.google.com/console.") + cacheToken = flag.Bool("cachetoken", true, "cache the OAuth 2.0 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 := &oauth2.Config{ + ClientID: valueOrFileContents(*clientID, *clientIDFile), + ClientSecret: valueOrFileContents(*secret, *secretFile), + Endpoint: google.Endpoint, + Scopes: []string{demoScope[name]}, + } + + ctx := context.Background() + if *debug { + ctx = context.WithValue(ctx, oauth2.HTTPClient, &http.Client{ + Transport: &logTransport{http.DefaultTransport}, + }) + } + c := newOAuthClient(ctx, 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 *oauth2.Config) string { + hash := fnv.New32a() + hash.Write([]byte(config.ClientID)) + hash.Write([]byte(config.ClientSecret)) + hash.Write([]byte(strings.Join(config.Scopes, " "))) + fn := fmt.Sprintf("go-api-demo-tok%v", hash.Sum32()) + return filepath.Join(osUserCacheDir(), url.QueryEscape(fn)) +} + +func tokenFromFile(file string) (*oauth2.Token, error) { + if !*cacheToken { + return nil, errors.New("--cachetoken is false") + } + f, err := os.Open(file) + if err != nil { + return nil, err + } + t := new(oauth2.Token) + err = gob.NewDecoder(f).Decode(t) + return t, err +} + +func saveToken(file string, token *oauth2.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 newOAuthClient(ctx context.Context, config *oauth2.Config) *http.Client { + cacheFile := tokenCacheFile(config) + token, err := tokenFromFile(cacheFile) + if err != nil { + token = tokenFromWeb(ctx, config) + saveToken(cacheFile, token) + } else { + log.Printf("Using cached token %#v from %q", token, cacheFile) + } + + return config.Client(ctx, token) +} + +func tokenFromWeb(ctx context.Context, config *oauth2.Config) *oauth2.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) + + token, err := config.Exchange(ctx, code) + if err != nil { + log.Fatalf("Token exchange error: %v", err) + } + return 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/Godeps/_workspace/src/google.golang.org/api/examples/mapsengine.go b/Godeps/_workspace/src/google.golang.org/api/examples/mapsengine.go new file mode 100644 index 000000000..34e1ca10a --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/examples/mapsengine.go @@ -0,0 +1,93 @@ +// 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" + "strings" + "time" + + mapsengine "google.golang.org/api/mapsengine/v1" +) + +func init() { + scopes := []string{ + mapsengine.MapsengineScope, + mapsengine.MapsengineReadonlyScope, + } + registerDemo("mapsengine", strings.Join(scopes, " "), mapsengineMain) +} + +func showMapFeatures(svc *mapsengine.Service, id string) { + r, err := svc.Tables.Get(id).Version("published").Do() + if err != nil { + log.Fatalf("Unable to get map %v table: %v", id, err) + } + fmt.Printf("Map ID: %v, Name: %q, Description: %q\n", id, r.Name, r.Description) + + pageToken := "" + for { + time.Sleep(1 * time.Second) // Don't violate free rate limit + // Read the location of every Feature in a Table. + req := svc.Tables.Features.List(id).MaxResults(500).Version("published") + if pageToken != "" { + req.PageToken(pageToken) + } + r, err := req.Do() + if err != nil { + log.Fatalf("Unable to list table features: %v", err) + } + + for _, f := range r.Features { + if v, ok := f.Geometry.GeometryCollection(); ok { + fmt.Printf("%v: %v\n", f.Geometry.Type(), v) + } else if v, ok := f.Geometry.LineString(); ok { + fmt.Printf("%v: %v\n", f.Geometry.Type(), v) + } else if v, ok := f.Geometry.MultiLineString(); ok { + fmt.Printf("%v: %v\n", f.Geometry.Type(), v) + } else if v, ok := f.Geometry.MultiPoint(); ok { + fmt.Printf("%v: %v\n", f.Geometry.Type(), v) + } else if v, ok := f.Geometry.MultiPolygon(); ok { + fmt.Printf("%v: %v\n", f.Geometry.Type(), v) + } else if v, ok := f.Geometry.Point(); ok { + fmt.Printf("%v: %v\n", f.Geometry.Type(), v) + } else if v, ok := f.Geometry.Polygon(); ok { + fmt.Printf("%v: %v\n", f.Geometry.Type(), v) + } else { + log.Fatalf("Unknown GeoJsonGeometry type %q", f.Geometry.Type()) + } + } + + if r.NextPageToken == "" { + break + } + pageToken = r.NextPageToken + } +} + +// mapsengineMain is an example that demonstrates calling the Mapsengine API. +// Please see https://developers.google.com/maps-engine/documentation/hello-world#go +// for more information. +// +// Example usage: +// go build -o go-api-demo *.go +// go-api-demo -clientid="my-clientid" -secret="my-secret" mapsengine +func mapsengineMain(client *http.Client, argv []string) { + if len(argv) != 0 { + fmt.Fprintln(os.Stderr, "Usage: mapsengine") + return + } + + svc, err := mapsengine.New(client) + if err != nil { + log.Fatalf("Unable to create Mapsengine service: %v", err) + } + + showMapFeatures(svc, "14137585153106784136-16071188762309719429") + showMapFeatures(svc, "12421761926155747447-06672618218968397709") +} diff --git a/Godeps/_workspace/src/google.golang.org/api/examples/mirror.go b/Godeps/_workspace/src/google.golang.org/api/examples/mirror.go new file mode 100644 index 000000000..16f6b4c44 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/examples/mirror.go @@ -0,0 +1,97 @@ +// 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" + "strings" + "time" + + mirror "google.golang.org/api/mirror/v1" +) + +const mirrorLayout = "Jan 2, 2006 at 3:04pm" + +func init() { + scopes := []string{ + mirror.GlassLocationScope, + mirror.GlassTimelineScope, + } + registerDemo("mirror", strings.Join(scopes, " "), mirrorMain) +} + +// mirrorMain is an example that demonstrates calling the Mirror API. +// +// Example usage: +// go build -o go-api-demo *.go +// go-api-demo -clientid="my-clientid" -secret="my-secret" mirror +func mirrorMain(client *http.Client, argv []string) { + if len(argv) != 0 { + fmt.Fprintln(os.Stderr, "Usage: mirror") + return + } + + svc, err := mirror.New(client) + if err != nil { + log.Fatalf("Unable to create Mirror service: %v", err) + } + + cs, err := svc.Contacts.List().Do() + if err != nil { + log.Fatalf("Unable to retrieve glass contacts: %v", err) + } + + if len(cs.Items) == 0 { + log.Printf("You have no glass contacts. Let's add one.") + mom := &mirror.Contact{ + DisplayName: "Mom", + Id: "mom", + PhoneNumber: "123-456-7890", + SpeakableName: "mom", + } + _, err := svc.Contacts.Insert(mom).Do() + if err != nil { + log.Fatalf("Unable to add %v to glass contacts: %v", mom.DisplayName, err) + } + } + for _, c := range cs.Items { + log.Printf("Found glass contact %q, phone number: %v", c.DisplayName, c.PhoneNumber) + } + + ls, err := svc.Locations.List().Do() + if err != nil { + log.Fatalf("Unable to retrieve glass locations: %v", err) + } + + if len(ls.Items) == 0 { + log.Printf("You have no glass locations.") + } + for _, loc := range ls.Items { + t, err := time.Parse(time.RFC3339, loc.Timestamp) + if err != nil { + log.Printf("unable to parse time %q: %v", loc.Timestamp, err) + } + log.Printf("Found glass location: %q at %v, address: %v (lat=%v, lon=%v)", loc.DisplayName, t.Format(mirrorLayout), loc.Address, loc.Latitude, loc.Longitude) + } + + ts, err := svc.Timeline.List().Do() + if err != nil { + log.Fatalf("Unable to retrieve glass timeline: %v", err) + } + + if len(ts.Items) == 0 { + log.Printf("You have no glass timeline items.") + } + for _, v := range ts.Items { + t, err := time.Parse(time.RFC3339, v.Updated) + if err != nil { + log.Printf("unable to parse time %q: %v", v.Updated, err) + } + log.Printf("Found glass timeline item: %q at %v", v.Text, t.Format(mirrorLayout)) + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/examples/prediction.go b/Godeps/_workspace/src/google.golang.org/api/examples/prediction.go new file mode 100644 index 000000000..d3f26ae1d --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/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" + + "google.golang.org/api/googleapi" + prediction "google.golang.org/api/prediction/v1.6" +) + +func init() { + scopes := []string{ + prediction.DevstorageFullControlScope, + prediction.DevstorageReadOnlyScope, + prediction.DevstorageReadWriteScope, + 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{ + Input: &prediction.InputInput{ + CsvInstance: []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/Godeps/_workspace/src/google.golang.org/api/examples/pubsub.go b/Godeps/_workspace/src/google.golang.org/api/examples/pubsub.go new file mode 100644 index 000000000..299194f2e --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/examples/pubsub.go @@ -0,0 +1,319 @@ +package main + +import ( + "bufio" + "encoding/base64" + "encoding/json" + "fmt" + "log" + "net" + "net/http" + "net/textproto" + "os" + "strings" + + pubsub "google.golang.org/api/pubsub/v1beta2" +) + +const USAGE = `Available arguments are: + list_topics + create_topic + delete_topic + list_subscriptions + create_subscription + delete_subscription + connect_irc + pull_messages +` + +type IRCBot struct { + server string + port string + nick string + user string + channel string + conn net.Conn + tpReader *textproto.Reader +} + +func NewIRCBot(server, channel, nick string) *IRCBot { + return &IRCBot{ + server: server, + port: "6667", + nick: nick, + channel: channel, + conn: nil, + user: nick, + } +} + +func (bot *IRCBot) Connect() { + conn, err := net.Dial("tcp", bot.server+":"+bot.port) + if err != nil { + log.Fatal("unable to connect to IRC server ", err) + } + bot.conn = conn + log.Printf("Connected to IRC server %s (%s)\n", + bot.server, bot.conn.RemoteAddr()) + bot.tpReader = textproto.NewReader(bufio.NewReader(bot.conn)) + bot.Sendf("USER %s 8 * :%s\r\n", bot.nick, bot.nick) + bot.Sendf("NICK %s\r\n", bot.nick) + bot.Sendf("JOIN %s\r\n", bot.channel) +} + +func (bot *IRCBot) CheckConnection() { + for { + line, err := bot.ReadLine() + if err != nil { + log.Fatal("Unable to read a line during checking the connection.") + } + if parts := strings.Split(line, " "); len(parts) > 1 { + if parts[1] == "004" { + log.Println("The nick accepted.") + } else if parts[1] == "433" { + log.Fatalf("The nick is already in use: %s", line) + } else if parts[1] == "366" { + log.Println("Starting to publish messages.") + return + } + } + } +} + +func (bot *IRCBot) Sendf(format string, args ...interface{}) { + fmt.Fprintf(bot.conn, format, args...) +} + +func (bot *IRCBot) Close() { + bot.conn.Close() +} + +func (bot *IRCBot) ReadLine() (line string, err error) { + return bot.tpReader.ReadLine() +} + +func init() { + registerDemo("pubsub", pubsub.PubsubScope, pubsubMain) +} + +func pubsubUsage() { + fmt.Fprint(os.Stderr, USAGE) +} + +// Returns a fully qualified resource name for Cloud Pub/Sub. +func fqrn(res, proj, name string) string { + return fmt.Sprintf("projects/%s/%s/%s", proj, res, name) +} + +func fullTopicName(proj, topic string) string { + return fqrn("topics", proj, topic) +} + +func fullSubName(proj, topic string) string { + return fqrn("subscriptions", proj, topic) +} + +// Check the length of the arguments. +func checkArgs(argv []string, min int) { + if len(argv) < min { + pubsubUsage() + os.Exit(2) + } +} + +func listTopics(service *pubsub.Service, argv []string) { + next := "" + for { + topicsList, err := service.Projects.Topics.List(fmt.Sprintf("projects/%s", argv[0])).PageToken(next).Do() + if err != nil { + log.Fatalf("listTopics query.Do() failed: %v", err) + } + for _, topic := range topicsList.Topics { + fmt.Println(topic.Name) + } + next = topicsList.NextPageToken + if next == "" { + break + } + } +} + +func createTopic(service *pubsub.Service, argv []string) { + checkArgs(argv, 3) + topic, err := service.Projects.Topics.Create(fullTopicName(argv[0], argv[2]), &pubsub.Topic{}).Do() + if err != nil { + log.Fatalf("createTopic Create().Do() failed: %v", err) + } + fmt.Printf("Topic %s was created.\n", topic.Name) +} + +func deleteTopic(service *pubsub.Service, argv []string) { + checkArgs(argv, 3) + topicName := fullTopicName(argv[0], argv[2]) + if _, err := service.Projects.Topics.Delete(topicName).Do(); err != nil { + log.Fatalf("deleteTopic Delete().Do() failed: %v", err) + } + fmt.Printf("Topic %s was deleted.\n", topicName) +} + +func listSubscriptions(service *pubsub.Service, argv []string) { + next := "" + for { + subscriptionsList, err := service.Projects.Subscriptions.List(fmt.Sprintf("projects/%s", argv[0])).PageToken(next).Do() + if err != nil { + log.Fatalf("listSubscriptions query.Do() failed: %v", err) + } + for _, subscription := range subscriptionsList.Subscriptions { + sub_text, _ := json.MarshalIndent(subscription, "", " ") + fmt.Printf("%s\n", sub_text) + } + next = subscriptionsList.NextPageToken + if next == "" { + break + } + } +} + +func createSubscription(service *pubsub.Service, argv []string) { + checkArgs(argv, 4) + name := fullSubName(argv[0], argv[2]) + sub := &pubsub.Subscription{Topic: fullTopicName(argv[0], argv[3])} + subscription, err := service.Projects.Subscriptions.Create(name, sub).Do() + if err != nil { + log.Fatalf("createSubscription Create().Do() failed: %v", err) + } + fmt.Printf("Subscription %s was created.\n", subscription.Name) +} + +func deleteSubscription(service *pubsub.Service, argv []string) { + checkArgs(argv, 3) + name := fullSubName(argv[0], argv[2]) + if _, err := service.Projects.Subscriptions.Delete(name).Do(); err != nil { + log.Fatalf("deleteSubscription Delete().Do() failed: %v", err) + } + fmt.Printf("Subscription %s was deleted.\n", name) +} + +func connectIRC(service *pubsub.Service, argv []string) { + checkArgs(argv, 5) + topicName := fullTopicName(argv[0], argv[2]) + server := argv[3] + channel := argv[4] + nick := fmt.Sprintf("bot-%s", argv[2]) + ircbot := NewIRCBot(server, channel, nick) + ircbot.Connect() + defer ircbot.Close() + ircbot.CheckConnection() + privMark := fmt.Sprintf("PRIVMSG %s :", ircbot.channel) + for { + line, err := ircbot.ReadLine() + if err != nil { + log.Fatal("Unable to read a line from the connection.") + } + parts := strings.Split(line, " ") + if len(parts) > 0 && parts[0] == "PING" { + ircbot.Sendf("PONG %s\r\n", parts[1]) + } else { + pos := strings.Index(line, privMark) + if pos == -1 { + continue + } + privMsg := line[pos+len(privMark) : len(line)] + pubsubMessage := &pubsub.PubsubMessage{ + Data: base64.StdEncoding.EncodeToString([]byte(privMsg)), + } + publishRequest := &pubsub.PublishRequest{ + Messages: []*pubsub.PubsubMessage{pubsubMessage}, + } + if _, err := service.Projects.Topics.Publish(topicName, publishRequest).Do(); err != nil { + log.Fatalf("connectIRC Publish().Do() failed: %v", err) + } + log.Println("Published a message to the topic.") + } + } +} + +func pullMessages(service *pubsub.Service, argv []string) { + checkArgs(argv, 3) + subName := fullSubName(argv[0], argv[2]) + pullRequest := &pubsub.PullRequest{ + ReturnImmediately: false, + MaxMessages: 1, + } + for { + pullResponse, err := service.Projects.Subscriptions.Pull(subName, pullRequest).Do() + if err != nil { + log.Fatalf("pullMessages Pull().Do() failed: %v", err) + } + for _, receivedMessage := range pullResponse.ReceivedMessages { + data, err := base64.StdEncoding.DecodeString(receivedMessage.Message.Data) + if err != nil { + log.Fatalf("pullMessages DecodeString() failed: %v", err) + } + fmt.Printf("%s\n", data) + ackRequest := &pubsub.AcknowledgeRequest{ + AckIds: []string{receivedMessage.AckId}, + } + if _, err = service.Projects.Subscriptions.Acknowledge(subName, ackRequest).Do(); err != nil { + log.Printf("pullMessages Acknowledge().Do() failed: %v", err) + } + } + } +} + +// This example demonstrates calling the Cloud Pub/Sub API. As of 20 +// Aug 2014, the Cloud Pub/Sub API is only available if you're +// whitelisted. If you're interested in using it, please apply for the +// Limited Preview program at the following form: +// http://goo.gl/Wql9HL +// +// Also, before running this example, be sure to enable Cloud Pub/Sub +// service on your project in Developer Console at: +// https://console.developers.google.com/ +// +// It has 8 subcommands as follows: +// +// list_topics +// create_topic +// delete_topic +// list_subscriptions +// create_subscription +// delete_subscription +// connect_irc +// pull_messages +// +// You can use either of your alphanumerical or numerial Cloud Project +// ID for project_id. You can choose any names for topic and +// subscription as long as they follow the naming rule described at: +// https://developers.google.com/pubsub/overview#names +// +// You can list/create/delete topics/subscriptions by self-explanatory +// subcommands, as well as connect to an IRC channel and publish +// messages from the IRC channel to a specified Cloud Pub/Sub topic by +// the "connect_irc" subcommand, or continuously pull messages from a +// specified Cloud Pub/Sub subscription and display the data by the +// "pull_messages" subcommand. +func pubsubMain(client *http.Client, argv []string) { + checkArgs(argv, 2) + service, err := pubsub.New(client) + if err != nil { + log.Fatalf("Unable to create PubSub service: %v", err) + } + + m := map[string]func(service *pubsub.Service, argv []string){ + "list_topics": listTopics, + "create_topic": createTopic, + "delete_topic": deleteTopic, + "list_subscriptions": listSubscriptions, + "create_subscription": createSubscription, + "delete_subscription": deleteSubscription, + "connect_irc": connectIRC, + "pull_messages": pullMessages, + } + f, ok := m[argv[1]] + if !ok { + pubsubUsage() + os.Exit(2) + } + f(service, argv) +} diff --git a/Godeps/_workspace/src/google.golang.org/api/examples/storage.go b/Godeps/_workspace/src/google.golang.org/api/examples/storage.go new file mode 100644 index 000000000..913a66229 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/examples/storage.go @@ -0,0 +1,64 @@ +package main + +import ( + "fmt" + "io" + "io/ioutil" + "log" + "net/http" + "os" + + "google.golang.org/api/googleapi" + storage "google.golang.org/api/storage/v1" +) + +func init() { + registerDemo("storage", storage.DevstorageReadWriteScope, 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, err := storage.New(client) + if err != nil { + log.Fatalf("Unable to create Storage service: %v", err) + } + + 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) + if err != nil { + return + } + + resp, err := service.Objects.Get(bucket, filename).Download() + if err != nil { + log.Fatalf("error downloading %q: %v", filename, err) + } + defer resp.Body.Close() + + n, err := io.Copy(ioutil.Discard, resp.Body) + if err != nil { + log.Fatalf("error downloading %q: %v", filename, err) + } + + log.Printf("Downloaded %d bytes", n) + + // Test If-None-Match - should get a "HTTP 304 Not Modified" response. + obj, err := service.Objects.Get(bucket, filename).IfNoneMatch(storageObject.Etag).Do() + log.Printf("Got obj, err: %#v, %v", obj, err) + if googleapi.IsNotModified(err) { + log.Printf("Success. Object not modified since upload.") + } else { + log.Printf("Error: expected object to not be modified since upload.") + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/examples/tasks.go b/Godeps/_workspace/src/google.golang.org/api/examples/tasks.go new file mode 100644 index 000000000..146d76a18 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/examples/tasks.go @@ -0,0 +1,26 @@ +package main + +import ( + "log" + "net/http" + + tasks "google.golang.org/api/tasks/v1" +) + +func init() { + registerDemo("tasks", tasks.TasksScope, tasksMain) +} + +func tasksMain(client *http.Client, argv []string) { + taskapi, err := tasks.New(client) + if err != nil { + log.Fatalf("Unable to create Tasks service: %v", err) + } + + 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/Godeps/_workspace/src/google.golang.org/api/examples/urlshortener.go b/Godeps/_workspace/src/google.golang.org/api/examples/urlshortener.go new file mode 100644 index 000000000..ea9e10afd --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/examples/urlshortener.go @@ -0,0 +1,50 @@ +package main + +import ( + "fmt" + "log" + "net/http" + "os" + "strings" + + urlshortener "google.golang.org/api/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, err := urlshortener.New(client) + if err != nil { + log.Fatalf("Unable to create UrlShortener service: %v", err) + } + + 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/Godeps/_workspace/src/google.golang.org/api/examples/youtube.go b/Godeps/_workspace/src/google.golang.org/api/examples/youtube.go new file mode 100644 index 000000000..e660fcf4e --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/examples/youtube.go @@ -0,0 +1,65 @@ +// Copyright 2015 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" + + youtube "google.golang.org/api/youtube/v3" +) + +func init() { + registerDemo("youtube", youtube.YoutubeUploadScope, youtubeMain) +} + +// youtubeMain is an example that demonstrates calling the YouTube API. +// It is similar to the sample found on the Google Developers website: +// https://developers.google.com/youtube/v3/docs/videos/insert +// but has been modified slightly to fit into the examples framework. +// +// Example usage: +// go build -o go-api-demo +// go-api-demo -clientid="my-clientid" -secret="my-secret" youtube filename +func youtubeMain(client *http.Client, argv []string) { + if len(argv) < 1 { + fmt.Fprintln(os.Stderr, "Usage: youtube filename") + return + } + filename := argv[0] + + service, err := youtube.New(client) + if err != nil { + log.Fatalf("Unable to create YouTube service: %v", err) + } + + upload := &youtube.Video{ + Snippet: &youtube.VideoSnippet{ + Title: "Test Title", + Description: "Test Description", // can not use non-alpha-numeric characters + CategoryId: "22", + }, + Status: &youtube.VideoStatus{PrivacyStatus: "unlisted"}, + } + + // The API returns a 400 Bad Request response if tags is an empty string. + upload.Snippet.Tags = []string{"test", "upload", "api"} + + call := service.Videos.Insert("snippet,status", upload) + + file, err := os.Open(filename) + defer file.Close() + if err != nil { + log.Fatalf("Error opening %v: %v", filename, err) + } + + response, err := call.Media(file).Do() + if err != nil { + log.Fatalf("Error making YouTube API call: %v", err) + } + fmt.Printf("Upload successful! Video ID: %v\n", response.Id) +} diff --git a/Godeps/_workspace/src/google.golang.org/api/fitness/v1/fitness-api.json b/Godeps/_workspace/src/google.golang.org/api/fitness/v1/fitness-api.json new file mode 100644 index 000000000..ea73c7a86 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/fitness/v1/fitness-api.json @@ -0,0 +1,1321 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/HDPUkwKxWfeChsVb7MggQS7MZkw\"", + "discoveryVersion": "v1", + "id": "fitness:v1", + "name": "fitness", + "version": "v1", + "revision": "20150720", + "title": "Fitness", + "description": "Google Fit 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/fit/rest/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/fitness/v1/users/", + "basePath": "/fitness/v1/users/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "fitness/v1/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/fitness.activity.read": { + "description": "View your activity information in Google Fit" + }, + "https://www.googleapis.com/auth/fitness.activity.write": { + "description": "View and store your activity information in Google Fit" + }, + "https://www.googleapis.com/auth/fitness.body.read": { + "description": "View body sensor information in Google Fit" + }, + "https://www.googleapis.com/auth/fitness.body.write": { + "description": "View and store body sensor data in Google Fit" + }, + "https://www.googleapis.com/auth/fitness.location.read": { + "description": "View your stored location data in Google Fit" + }, + "https://www.googleapis.com/auth/fitness.location.write": { + "description": "View and store your location data in Google Fit" + } + } + } + }, + "schemas": { + "AggregateBucket": { + "id": "AggregateBucket", + "type": "object", + "properties": { + "activity": { + "type": "integer", + "description": "Available for Bucket.Type.ACTIVITY_TYPE, Bucket.Type.ACTIVITY_SEGMENT", + "format": "int32" + }, + "dataset": { + "type": "array", + "description": "There will be one dataset per AggregateBy in the request.", + "items": { + "$ref": "Dataset" + } + }, + "endTimeMillis": { + "type": "string", + "description": "The end time for the aggregated data, in milliseconds since epoch, inclusive.", + "format": "int64" + }, + "session": { + "$ref": "Session", + "description": "Available for Bucket.Type.SESSION" + }, + "startTimeMillis": { + "type": "string", + "description": "The start time for the aggregated data, in milliseconds since epoch, inclusive.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "The type of a bucket signifies how the data aggregation is performed in the bucket.", + "enum": [ + "activitySegment", + "activityType", + "session", + "time", + "unknown" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + } + } + }, + "AggregateBy": { + "id": "AggregateBy", + "type": "object", + "description": "The specification of which data to aggregate.", + "properties": { + "dataSourceId": { + "type": "string", + "description": "A data source ID to aggregate. Mutually exclusive of dataTypeName. Only data from the specified data source ID will be included in the aggregation. The dataset in the response will have the same data source ID." + }, + "dataTypeName": { + "type": "string", + "description": "The data type to aggregate. All data sources providing this data type will contribute data to the aggregation. The response will contain a single dataset for this data type name. The dataset will have a data source ID of derived:com.google.:com.google.android.gms:aggregated" + } + } + }, + "AggregateRequest": { + "id": "AggregateRequest", + "type": "object", + "properties": { + "aggregateBy": { + "type": "array", + "description": "The specification of data to be aggregated. At least one aggregateBy spec must be provided. All data that is specified will be aggregated using the same bucketing criteria. There will be one dataset in the response for every aggregateBy spec.", + "items": { + "$ref": "AggregateBy" + }, + "annotations": { + "required": [ + "fitness.users.dataset.aggregate" + ] + } + }, + "bucketByActivitySegment": { + "$ref": "BucketByActivity", + "description": "Specifies that data be aggregated each activity segment recored for a user. Similar to bucketByActivitySegment, but bucketing is done for each activity segment rather than all segments of the same type. Mutually exclusive of other bucketing specifications." + }, + "bucketByActivityType": { + "$ref": "BucketByActivity", + "description": "Specifies that data be aggregated by the type of activity being performed when the data was recorded. All data that was recorded during a certain activity type (for the given time range) will be aggregated into the same bucket. Data that was recorded while the user was not active will not be included in the response. Mutually exclusive of other bucketing specifications." + }, + "bucketBySession": { + "$ref": "BucketBySession", + "description": "Specifies that data be aggregated by user sessions. Data that does not fall within the time range of a session will not be included in the response. Mutually exclusive of other bucketing specifications." + }, + "bucketByTime": { + "$ref": "BucketByTime", + "description": "Specifies that data be aggregated by a single time interval. Mutually exclusive of other bucketing specifications." + }, + "endTimeMillis": { + "type": "string", + "description": "The end of a window of time. Data that intersects with this time window will be aggregated. The time is in milliseconds since epoch, inclusive.", + "format": "int64", + "annotations": { + "required": [ + "fitness.users.dataset.aggregate" + ] + } + }, + "startTimeMillis": { + "type": "string", + "description": "The start of a window of time. Data that intersects with this time window will be aggregated. The time is in milliseconds since epoch, inclusive.", + "format": "int64", + "annotations": { + "required": [ + "fitness.users.dataset.aggregate" + ] + } + } + } + }, + "AggregateResponse": { + "id": "AggregateResponse", + "type": "object", + "properties": { + "bucket": { + "type": "array", + "description": "A list of buckets containing the aggregated data.", + "items": { + "$ref": "AggregateBucket" + } + } + } + }, + "Application": { + "id": "Application", + "type": "object", + "description": "See: google3/java/com/google/android/apps/heart/platform/api/Application.java", + "properties": { + "detailsUrl": { + "type": "string", + "description": "An optional URI that can be used to link back to the application." + }, + "name": { + "type": "string", + "description": "The name of this application. This is required for REST clients, but we do not enforce uniqueness of this name. It is provided as a matter of convenience for other developers who would like to identify which REST created an Application or Data Source.", + "annotations": { + "required": [ + "fitness.users.dataSources.create", + "fitness.users.dataSources.update", + "fitness.users.sessions.update" + ] + } + }, + "packageName": { + "type": "string", + "description": "Package name for this application. This is used as a unique identifier when created by Android applications, but cannot be specified by REST clients. REST clients will have their developer project number reflected into the Data Source data stream IDs, instead of the packageName." + }, + "version": { + "type": "string", + "description": "Version of the application. You should update this field whenever the application changes in a way that affects the computation of the data." + } + } + }, + "BucketByActivity": { + "id": "BucketByActivity", + "type": "object", + "properties": { + "activityDataSourceId": { + "type": "string", + "description": "The default activity stream will be used if a specific activityDataSourceId is not specified." + }, + "minDurationMillis": { + "type": "string", + "description": "Specifies that only activity segments of duration longer than minDurationMillis are considered and used as a container for aggregated data.", + "format": "int64" + } + } + }, + "BucketBySession": { + "id": "BucketBySession", + "type": "object", + "properties": { + "minDurationMillis": { + "type": "string", + "description": "Specifies that only sessions of duration longer than minDurationMillis are considered and used as a container for aggregated data.", + "format": "int64" + } + } + }, + "BucketByTime": { + "id": "BucketByTime", + "type": "object", + "properties": { + "durationMillis": { + "type": "string", + "description": "Specifies that result buckets aggregate data by exactly durationMillis time frames. Time frames that contain no data will be included in the response with an empty dataset.", + "format": "int64" + } + } + }, + "DataPoint": { + "id": "DataPoint", + "type": "object", + "description": "Represents a single data point, generated by a particular data source. A data point holds a value for each field, an end timestamp and an optional start time. The exact semantics of each of these attributes are specified in the documentation for the particular data type.\n\nA data point can represent an instantaneous measurement, reading or input observation, as well as averages or aggregates over a time interval. Check the data type documentation to determine which is the case for a particular data type.\n\nData points always contain one value for each field of the data type.", + "properties": { + "computationTimeMillis": { + "type": "string", + "description": "Used for version checking during transformation; that is, a datapoint can only replace another datapoint that has an older computation time stamp.", + "format": "int64" + }, + "dataTypeName": { + "type": "string", + "description": "The data type defining the format of the values in this data point.", + "annotations": { + "required": [ + "fitness.users.dataSources.datasets.patch" + ] + } + }, + "endTimeNanos": { + "type": "string", + "description": "The end time of the interval represented by this data point, in nanoseconds since epoch.", + "format": "int64", + "annotations": { + "required": [ + "fitness.users.dataSources.datasets.patch" + ] + } + }, + "modifiedTimeMillis": { + "type": "string", + "description": "Indicates the last time this data point was modified. Useful only in contexts where we are listing the data changes, rather than representing the current state of the data.", + "format": "int64" + }, + "originDataSourceId": { + "type": "string", + "description": "If the data point is contained in a dataset for a derived data source, this field will be populated with the data source stream ID that created the data point originally." + }, + "rawTimestampNanos": { + "type": "string", + "description": "The raw timestamp from the original SensorEvent.", + "format": "int64" + }, + "startTimeNanos": { + "type": "string", + "description": "The start time of the interval represented by this data point, in nanoseconds since epoch.", + "format": "int64", + "annotations": { + "required": [ + "fitness.users.dataSources.datasets.patch" + ] + } + }, + "value": { + "type": "array", + "description": "Values of each data type field for the data point. It is expected that each value corresponding to a data type field will occur in the same order that the field is listed with in the data type specified in a data source.\n\nOnly one of integer and floating point fields will be populated, depending on the format enum value within data source's type field.", + "items": { + "$ref": "Value" + }, + "annotations": { + "required": [ + "fitness.users.dataSources.datasets.patch" + ] + } + } + } + }, + "DataSource": { + "id": "DataSource", + "type": "object", + "description": "Definition of a unique source of sensor data. Data sources can expose raw data coming from hardware sensors on local or companion devices. They can also expose derived data, created by transforming or merging other data sources. Multiple data sources can exist for the same data type. Every data point inserted into or read from this service has an associated data source.\n\nThe data source contains enough information to uniquely identify its data, including the hardware device and the application that collected and/or transformed the data. It also holds useful metadata, such as the hardware and application versions, and the device type.\n\nEach data source produces a unique stream of data, with a unique identifier. Not all changes to data source affect the stream identifier, so that data collected by updated versions of the same application/device can still be considered to belong to the same data stream.", + "properties": { + "application": { + "$ref": "Application", + "description": "Information about an application which feeds sensor data into the platform.", + "annotations": { + "required": [ + "fitness.users.dataSources.create", + "fitness.users.dataSources.update" + ] + } + }, + "dataStreamId": { + "type": "string", + "description": "A unique identifier for the data stream produced by this data source. The identifier includes:\n\n \n- The physical device's manufacturer, model, and serial number (UID). \n- The application's package name or name. Package name is used when the data source was created by an Android application. The developer project number is used when the data source was created by a REST client. \n- The data source's type. \n- The data source's stream name. Note that not all attributes of the data source are used as part of the stream identifier. In particular, the version of the hardware/the application isn't used. This allows us to preserve the same stream through version updates. This also means that two DataSource objects may represent the same data stream even if they're not equal.\n\nThe exact format of the data stream ID created by an Android application is: type:dataType.name:application.packageName:device.manufacturer:device.model:device.uid:dataStreamName \n\nThe exact format of the data stream ID created by a REST client is: type:dataType.name:developer project number:device.manufacturer:device.model:device.uid:dataStreamName \n\nWhen any of the optional fields that comprise of the data stream ID are blank, they will be omitted from the data stream ID. The minnimum viable data stream ID would be: type:dataType.name:developer project number\n\nFinally, the developer project number is obfuscated when read by any REST or Android client that did not create the data source. Only the data source creator will see the developer project number in clear and normal form.", + "annotations": { + "required": [ + "fitness.users.dataSources.update" + ] + } + }, + "dataStreamName": { + "type": "string", + "description": "The stream name uniquely identifies this particular data source among other data sources of the same type from the same underlying producer. Setting the stream name is optional, but should be done whenever an application exposes two streams for the same data type, or when a device has two equivalent sensors." + }, + "dataType": { + "$ref": "DataType", + "description": "The data type defines the schema for a stream of data being collected by, inserted into, or queried from the Fitness API.", + "annotations": { + "required": [ + "fitness.users.dataSources.create", + "fitness.users.dataSources.update" + ] + } + }, + "device": { + "$ref": "Device", + "description": "Representation of an integrated device (such as a phone or a wearable) that can hold sensors.", + "annotations": { + "required": [ + "fitness.users.dataSources.create", + "fitness.users.dataSources.update" + ] + } + }, + "name": { + "type": "string", + "description": "An end-user visible name for this data source." + }, + "type": { + "type": "string", + "description": "A constant describing the type of this data source. Indicates whether this data source produces raw or derived data.", + "enum": [ + "derived", + "raw" + ], + "enumDescriptions": [ + "", + "" + ], + "annotations": { + "required": [ + "fitness.users.dataSources.create", + "fitness.users.dataSources.update" + ] + } + } + } + }, + "DataType": { + "id": "DataType", + "type": "object", + "description": "See: google3/java/com/google/android/apps/heart/platform/api/DataType.java", + "properties": { + "field": { + "type": "array", + "description": "A field represents one dimension of a data type.", + "items": { + "$ref": "DataTypeField" + }, + "annotations": { + "required": [ + "fitness.users.dataSources.create", + "fitness.users.dataSources.update" + ] + } + }, + "name": { + "type": "string", + "description": "Each data type has a unique, namespaced, name. All data types in the com.google namespace are shared as part of the platform.", + "annotations": { + "required": [ + "fitness.users.dataSources.create", + "fitness.users.dataSources.update" + ] + } + } + } + }, + "DataTypeField": { + "id": "DataTypeField", + "type": "object", + "description": "In case of multi-dimensional data (such as an accelerometer with x, y, and z axes) each field represents one dimension. Each data type field has a unique name which identifies it. The field also defines the format of the data (int, float, etc.).\n\nThis message is only instantiated in code and not used for wire comms or stored in any way.", + "properties": { + "format": { + "type": "string", + "description": "The different supported formats for each field in a data type.", + "enum": [ + "floatList", + "floatPoint", + "integer", + "integerList", + "map", + "string" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ], + "annotations": { + "required": [ + "fitness.users.dataSources.create", + "fitness.users.dataSources.update" + ] + } + }, + "name": { + "type": "string", + "description": "Defines the name and format of data. Unlike data type names, field names are not namespaced, and only need to be unique within the data type.", + "annotations": { + "required": [ + "fitness.users.dataSources.create", + "fitness.users.dataSources.update" + ] + } + }, + "optional": { + "type": "boolean" + } + } + }, + "Dataset": { + "id": "Dataset", + "type": "object", + "description": "A dataset represents a projection container for data points. They do not carry any info of their own. Datasets represent a set of data points from a particular data source. A data point can be found in more than one dataset.", + "properties": { + "dataSourceId": { + "type": "string", + "description": "The data stream ID of the data source that created the points in this dataset.", + "annotations": { + "required": [ + "fitness.users.dataSources.datasets.patch" + ] + } + }, + "maxEndTimeNs": { + "type": "string", + "description": "The largest end time of all data points in this possibly partial representation of the dataset. Time is in nanoseconds from epoch. This should also match the first part of the dataset identifier.", + "format": "int64", + "annotations": { + "required": [ + "fitness.users.dataSources.datasets.patch" + ] + } + }, + "minStartTimeNs": { + "type": "string", + "description": "The smallest start time of all data points in this possibly partial representation of the dataset. Time is in nanoseconds from epoch. This should also match the first part of the dataset identifier.", + "format": "int64", + "annotations": { + "required": [ + "fitness.users.dataSources.datasets.patch" + ] + } + }, + "nextPageToken": { + "type": "string", + "description": "This token will be set when a dataset is received in response to a GET request and the dataset is too large to be included in a single response. Provide this value in a subsequent GET request to return the next page of data points within this dataset." + }, + "point": { + "type": "array", + "description": "A partial list of data points contained in the dataset, ordered by largest endTimeNanos first. This list is considered complete when retrieving a small dataset and partial when patching a dataset or retrieving a dataset that is too large to include in a single response.", + "items": { + "$ref": "DataPoint" + }, + "annotations": { + "required": [ + "fitness.users.dataSources.datasets.patch" + ] + } + } + } + }, + "Device": { + "id": "Device", + "type": "object", + "description": "Representation of an integrated device (such as a phone or a wearable) that can hold sensors. Each sensor is exposed as a data source.\n\nThe main purpose of the device information contained in this class is to identify the hardware of a particular data source. This can be useful in different ways, including: \n- Distinguishing two similar sensors on different devices (the step counter on two nexus 5 phones, for instance)\n- Display the source of data to the user (by using the device make / model)\n- Treat data differently depending on sensor type (accelerometers on a watch may give different patterns than those on a phone)\n- Build different analysis models for each device/version.", + "properties": { + "manufacturer": { + "type": "string", + "description": "Manufacturer of the product/hardware.", + "annotations": { + "required": [ + "fitness.users.dataSources.create", + "fitness.users.dataSources.update" + ] + } + }, + "model": { + "type": "string", + "description": "End-user visible model name for the device.", + "annotations": { + "required": [ + "fitness.users.dataSources.create", + "fitness.users.dataSources.update" + ] + } + }, + "type": { + "type": "string", + "description": "A constant representing the type of the device.", + "enum": [ + "chestStrap", + "phone", + "scale", + "tablet", + "unknown", + "watch" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ], + "annotations": { + "required": [ + "fitness.users.dataSources.create", + "fitness.users.dataSources.update" + ] + } + }, + "uid": { + "type": "string", + "description": "The serial number or other unique ID for the hardware. This field is obfuscated when read by any REST or Android client that did not create the data source. Only the data source creator will see the uid field in clear and normal form.", + "annotations": { + "required": [ + "fitness.users.dataSources.create", + "fitness.users.dataSources.update" + ] + } + }, + "version": { + "type": "string", + "description": "Version string for the device hardware/software.", + "annotations": { + "required": [ + "fitness.users.dataSources.create", + "fitness.users.dataSources.update" + ] + } + } + } + }, + "ListDataSourcesResponse": { + "id": "ListDataSourcesResponse", + "type": "object", + "properties": { + "dataSource": { + "type": "array", + "description": "A previously created data source.", + "items": { + "$ref": "DataSource" + } + } + } + }, + "ListSessionsResponse": { + "id": "ListSessionsResponse", + "type": "object", + "properties": { + "deletedSession": { + "type": "array", + "description": "If includeDeleted is set to true in the request, this list will contain sessions deleted with original end times that are within the startTime and endTime frame.", + "items": { + "$ref": "Session" + } + }, + "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." + }, + "session": { + "type": "array", + "description": "Sessions with an end time that is between startTime and endTime of the request.", + "items": { + "$ref": "Session" + } + } + } + }, + "MapValue": { + "id": "MapValue", + "type": "object", + "description": "Holder object for the value of an entry in a map field of a data point.\n\nA map value supports a subset of the formats that the regular Value supports.", + "properties": { + "fpVal": { + "type": "number", + "description": "Floating point value.", + "format": "double" + } + } + }, + "Session": { + "id": "Session", + "type": "object", + "description": "Sessions contain metadata, such as a user-friendly name and time interval information.", + "properties": { + "activeTimeMillis": { + "type": "string", + "description": "Session active time. While start_time_millis and end_time_millis define the full session time, the active time can be shorter and specified by active_time_millis. If the inactive time during the session is known, it should also be inserted via a com.google.activity.segment data point with a STILL activity value", + "format": "int64" + }, + "activityType": { + "type": "integer", + "description": "The type of activity this session represents.", + "format": "int32", + "annotations": { + "required": [ + "fitness.users.sessions.update" + ] + } + }, + "application": { + "$ref": "Application", + "description": "The application that created the session.", + "annotations": { + "required": [ + "fitness.users.sessions.update" + ] + } + }, + "description": { + "type": "string", + "description": "A description for this session." + }, + "endTimeMillis": { + "type": "string", + "description": "An end time, in milliseconds since epoch, inclusive.", + "format": "int64", + "annotations": { + "required": [ + "fitness.users.sessions.update" + ] + } + }, + "id": { + "type": "string", + "description": "A client-generated identifier that is unique across all sessions owned by this particular user.", + "annotations": { + "required": [ + "fitness.users.sessions.update" + ] + } + }, + "modifiedTimeMillis": { + "type": "string", + "description": "A timestamp that indicates when the session was last modified.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "A human readable name of the session.", + "annotations": { + "required": [ + "fitness.users.sessions.update" + ] + } + }, + "startTimeMillis": { + "type": "string", + "description": "A start time, in milliseconds since epoch, inclusive.", + "format": "int64", + "annotations": { + "required": [ + "fitness.users.sessions.update" + ] + } + } + } + }, + "Value": { + "id": "Value", + "type": "object", + "description": "Holder object for the value of a single field in a data point.\n\nA field value has a particular format and is only ever set to one of an integer or a floating point value.", + "properties": { + "fpVal": { + "type": "number", + "description": "Floating point value. When this is set, other values must not be set.", + "format": "double" + }, + "intVal": { + "type": "integer", + "description": "Integer value. When this is set, other values must not be set.", + "format": "int32" + }, + "mapVal": { + "type": "array", + "description": "Map value. The valid key space and units for the corresponding value of each entry should be documented as part of the data type definition. Keys should be kept small whenever possible. Data streams with large keys and high data frequency may be down sampled.", + "items": { + "$ref": "ValueMapValEntry" + } + }, + "stringVal": { + "type": "string", + "description": "String value. When this is set, other values must not be set. Strings should be kept small whenever possible. Data streams with large string values and high data frequency may be down sampled." + } + } + }, + "ValueMapValEntry": { + "id": "ValueMapValEntry", + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "$ref": "MapValue" + } + } + } + }, + "resources": { + "users": { + "resources": { + "dataSources": { + "methods": { + "create": { + "id": "fitness.users.dataSources.create", + "path": "{userId}/dataSources", + "httpMethod": "POST", + "description": "Creates a new data source that is unique across all data sources belonging to this user. The data stream ID field can be omitted and will be generated by the server with the correct format. The data stream ID is an ordered combination of some fields from the data source. In addition to the data source fields reflected into the data source ID, the developer project number that is authenticated when creating the data source is included. This developer project number is obfuscated when read by any other developer reading public data types.", + "parameters": { + "userId": { + "type": "string", + "description": "Create the data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "request": { + "$ref": "DataSource" + }, + "response": { + "$ref": "DataSource" + }, + "scopes": [ + "https://www.googleapis.com/auth/fitness.activity.write", + "https://www.googleapis.com/auth/fitness.body.write", + "https://www.googleapis.com/auth/fitness.location.write" + ] + }, + "delete": { + "id": "fitness.users.dataSources.delete", + "path": "{userId}/dataSources/{dataSourceId}", + "httpMethod": "DELETE", + "description": "Delete the data source if there are no datapoints associated with it", + "parameters": { + "dataSourceId": { + "type": "string", + "description": "The data stream ID of the data source to delete.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "Retrieve a data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "dataSourceId" + ], + "response": { + "$ref": "DataSource" + }, + "scopes": [ + "https://www.googleapis.com/auth/fitness.activity.write", + "https://www.googleapis.com/auth/fitness.body.write", + "https://www.googleapis.com/auth/fitness.location.write" + ] + }, + "get": { + "id": "fitness.users.dataSources.get", + "path": "{userId}/dataSources/{dataSourceId}", + "httpMethod": "GET", + "description": "Returns a data source identified by a data stream ID.", + "parameters": { + "dataSourceId": { + "type": "string", + "description": "The data stream ID of the data source to retrieve.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "Retrieve a data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "dataSourceId" + ], + "response": { + "$ref": "DataSource" + }, + "scopes": [ + "https://www.googleapis.com/auth/fitness.activity.read", + "https://www.googleapis.com/auth/fitness.activity.write", + "https://www.googleapis.com/auth/fitness.body.read", + "https://www.googleapis.com/auth/fitness.body.write", + "https://www.googleapis.com/auth/fitness.location.read", + "https://www.googleapis.com/auth/fitness.location.write" + ] + }, + "list": { + "id": "fitness.users.dataSources.list", + "path": "{userId}/dataSources", + "httpMethod": "GET", + "description": "Lists all data sources that are visible to the developer, using the OAuth scopes provided. The list is not exhaustive: the user may have private data sources that are only visible to other developers or calls using other scopes.", + "parameters": { + "dataTypeName": { + "type": "string", + "description": "The names of data types to include in the list. If not specified, all data sources will be returned.", + "repeated": true, + "location": "query" + }, + "userId": { + "type": "string", + "description": "List data sources for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "ListDataSourcesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/fitness.activity.read", + "https://www.googleapis.com/auth/fitness.activity.write", + "https://www.googleapis.com/auth/fitness.body.read", + "https://www.googleapis.com/auth/fitness.body.write", + "https://www.googleapis.com/auth/fitness.location.read", + "https://www.googleapis.com/auth/fitness.location.write" + ] + }, + "patch": { + "id": "fitness.users.dataSources.patch", + "path": "{userId}/dataSources/{dataSourceId}", + "httpMethod": "PATCH", + "description": "Updates a given data source. It is an error to modify the data source's data stream ID, data type, type, stream name or device information apart from the device version. Changing these fields would require a new unique data stream ID and separate data source.\n\nData sources are identified by their data stream ID. This method supports patch semantics.", + "parameters": { + "dataSourceId": { + "type": "string", + "description": "The data stream ID of the data source to update.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "Update the data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "dataSourceId" + ], + "request": { + "$ref": "DataSource" + }, + "response": { + "$ref": "DataSource" + }, + "scopes": [ + "https://www.googleapis.com/auth/fitness.activity.write", + "https://www.googleapis.com/auth/fitness.body.write", + "https://www.googleapis.com/auth/fitness.location.write" + ] + }, + "update": { + "id": "fitness.users.dataSources.update", + "path": "{userId}/dataSources/{dataSourceId}", + "httpMethod": "PUT", + "description": "Updates a given data source. It is an error to modify the data source's data stream ID, data type, type, stream name or device information apart from the device version. Changing these fields would require a new unique data stream ID and separate data source.\n\nData sources are identified by their data stream ID.", + "parameters": { + "dataSourceId": { + "type": "string", + "description": "The data stream ID of the data source to update.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "Update the data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "dataSourceId" + ], + "request": { + "$ref": "DataSource" + }, + "response": { + "$ref": "DataSource" + }, + "scopes": [ + "https://www.googleapis.com/auth/fitness.activity.write", + "https://www.googleapis.com/auth/fitness.body.write", + "https://www.googleapis.com/auth/fitness.location.write" + ] + } + }, + "resources": { + "datasets": { + "methods": { + "delete": { + "id": "fitness.users.dataSources.datasets.delete", + "path": "{userId}/dataSources/{dataSourceId}/datasets/{datasetId}", + "httpMethod": "DELETE", + "description": "Performs an inclusive delete of all data points whose start and end times have any overlap with the time range specified by the dataset ID. For most data types, the entire data point will be deleted. For data types where the time span represents a consistent value (such as com.google.activity.segment), and a data point straddles either end point of the dataset, only the overlapping portion of the data point will be deleted.", + "parameters": { + "currentTimeMillis": { + "type": "string", + "description": "The client's current time in milliseconds since epoch.", + "format": "int64", + "location": "query" + }, + "dataSourceId": { + "type": "string", + "description": "The data stream ID of the data source that created the dataset.", + "required": true, + "location": "path" + }, + "datasetId": { + "type": "string", + "description": "Dataset identifier that is a composite of the minimum data point start time and maximum data point end time represented as nanoseconds from the epoch. The ID is formatted like: \"startTime-endTime\" where startTime and endTime are 64 bit integers.", + "required": true, + "location": "path" + }, + "modifiedTimeMillis": { + "type": "string", + "description": "When the operation was performed on the client.", + "format": "int64", + "location": "query" + }, + "userId": { + "type": "string", + "description": "Delete a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "dataSourceId", + "datasetId" + ], + "scopes": [ + "https://www.googleapis.com/auth/fitness.activity.write", + "https://www.googleapis.com/auth/fitness.body.write", + "https://www.googleapis.com/auth/fitness.location.write" + ] + }, + "get": { + "id": "fitness.users.dataSources.datasets.get", + "path": "{userId}/dataSources/{dataSourceId}/datasets/{datasetId}", + "httpMethod": "GET", + "description": "Returns a dataset containing all data points whose start and end times overlap with the specified range of the dataset minimum start time and maximum end time. Specifically, any data point whose start time is less than or equal to the dataset end time and whose end time is greater than or equal to the dataset start time.", + "parameters": { + "dataSourceId": { + "type": "string", + "description": "The data stream ID of the data source that created the dataset.", + "required": true, + "location": "path" + }, + "datasetId": { + "type": "string", + "description": "Dataset identifier that is a composite of the minimum data point start time and maximum data point end time represented as nanoseconds from the epoch. The ID is formatted like: \"startTime-endTime\" where startTime and endTime are 64 bit integers.", + "required": true, + "location": "path" + }, + "limit": { + "type": "integer", + "description": "If specified, no more than this many data points will be included in the dataset. If the there are more data points in the dataset, nextPageToken will be set in the dataset response.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The continuation token, which is used to page through large datasets. To get the next page of a dataset, set this parameter to the value of nextPageToken from the previous response. Each subsequent call will yield a partial dataset with data point end timestamps that are strictly smaller than those in the previous partial response.", + "location": "query" + }, + "userId": { + "type": "string", + "description": "Retrieve a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "dataSourceId", + "datasetId" + ], + "response": { + "$ref": "Dataset" + }, + "scopes": [ + "https://www.googleapis.com/auth/fitness.activity.read", + "https://www.googleapis.com/auth/fitness.activity.write", + "https://www.googleapis.com/auth/fitness.body.read", + "https://www.googleapis.com/auth/fitness.body.write", + "https://www.googleapis.com/auth/fitness.location.read", + "https://www.googleapis.com/auth/fitness.location.write" + ] + }, + "patch": { + "id": "fitness.users.dataSources.datasets.patch", + "path": "{userId}/dataSources/{dataSourceId}/datasets/{datasetId}", + "httpMethod": "PATCH", + "description": "Adds data points to a dataset. The dataset need not be previously created. All points within the given dataset will be returned with subsquent calls to retrieve this dataset. Data points can belong to more than one dataset. This method does not use patch semantics.", + "parameters": { + "currentTimeMillis": { + "type": "string", + "description": "The client's current time in milliseconds since epoch. Note that the minStartTimeNs and maxEndTimeNs properties in the request body are in nanoseconds instead of milliseconds.", + "format": "int64", + "location": "query" + }, + "dataSourceId": { + "type": "string", + "description": "The data stream ID of the data source that created the dataset.", + "required": true, + "location": "path" + }, + "datasetId": { + "type": "string", + "description": "Dataset identifier that is a composite of the minimum data point start time and maximum data point end time represented as nanoseconds from the epoch. The ID is formatted like: \"startTime-endTime\" where startTime and endTime are 64 bit integers.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "Patch a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "dataSourceId", + "datasetId" + ], + "request": { + "$ref": "Dataset" + }, + "response": { + "$ref": "Dataset" + }, + "scopes": [ + "https://www.googleapis.com/auth/fitness.activity.write", + "https://www.googleapis.com/auth/fitness.body.write", + "https://www.googleapis.com/auth/fitness.location.write" + ] + } + } + } + } + }, + "dataset": { + "methods": { + "aggregate": { + "id": "fitness.users.dataset.aggregate", + "path": "{userId}/dataset:aggregate", + "httpMethod": "POST", + "description": "Aggregates data of a certain type or stream into buckets divided by a given type of boundary. Multiple data sets of multiple types and from multiple sources can be aggreated into exactly one bucket type per request.", + "parameters": { + "userId": { + "type": "string", + "description": "Aggregate data for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "request": { + "$ref": "AggregateRequest" + }, + "response": { + "$ref": "AggregateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/fitness.activity.write", + "https://www.googleapis.com/auth/fitness.body.write", + "https://www.googleapis.com/auth/fitness.location.write" + ] + } + } + }, + "sessions": { + "methods": { + "delete": { + "id": "fitness.users.sessions.delete", + "path": "{userId}/sessions/{sessionId}", + "httpMethod": "DELETE", + "description": "Deletes a session specified by the given session ID.", + "parameters": { + "currentTimeMillis": { + "type": "string", + "description": "The client's current time in milliseconds since epoch.", + "format": "int64", + "location": "query" + }, + "sessionId": { + "type": "string", + "description": "The ID of the session to be deleted.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "Delete a session for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "sessionId" + ], + "scopes": [ + "https://www.googleapis.com/auth/fitness.activity.write" + ] + }, + "list": { + "id": "fitness.users.sessions.list", + "path": "{userId}/sessions", + "httpMethod": "GET", + "description": "Lists sessions previously created.", + "parameters": { + "endTime": { + "type": "string", + "description": "An RFC3339 timestamp. Only sessions ending between the start and end times will be included in the response.", + "location": "query" + }, + "includeDeleted": { + "type": "boolean", + "description": "If true, deleted sessions will be returned. When set to true, sessions returned in this response will only have an ID and will not have any other fields.", + "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" + }, + "startTime": { + "type": "string", + "description": "An RFC3339 timestamp. Only sessions ending between the start and end times will be included in the response.", + "location": "query" + }, + "userId": { + "type": "string", + "description": "List sessions for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "ListSessionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/fitness.activity.read", + "https://www.googleapis.com/auth/fitness.activity.write", + "https://www.googleapis.com/auth/fitness.body.read", + "https://www.googleapis.com/auth/fitness.body.write", + "https://www.googleapis.com/auth/fitness.location.read", + "https://www.googleapis.com/auth/fitness.location.write" + ] + }, + "update": { + "id": "fitness.users.sessions.update", + "path": "{userId}/sessions/{sessionId}", + "httpMethod": "PUT", + "description": "Updates or insert a given session.", + "parameters": { + "currentTimeMillis": { + "type": "string", + "description": "The client's current time in milliseconds since epoch.", + "format": "int64", + "location": "query" + }, + "sessionId": { + "type": "string", + "description": "The ID of the session to be created.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "Create sessions for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "sessionId" + ], + "request": { + "$ref": "Session" + }, + "response": { + "$ref": "Session" + }, + "scopes": [ + "https://www.googleapis.com/auth/fitness.activity.write" + ] + } + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/fitness/v1/fitness-gen.go b/Godeps/_workspace/src/google.golang.org/api/fitness/v1/fitness-gen.go new file mode 100644 index 000000000..aa811e0a7 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/fitness/v1/fitness-gen.go @@ -0,0 +1,2893 @@ +// Package fitness provides access to the Fitness. +// +// See https://developers.google.com/fit/rest/ +// +// Usage example: +// +// import "google.golang.org/api/fitness/v1" +// ... +// fitnessService, err := fitness.New(oauthHttpClient) +package fitness // import "google.golang.org/api/fitness/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "fitness:v1" +const apiName = "fitness" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/fitness/v1/users/" + +// OAuth2 scopes used by this API. +const ( + // View your activity information in Google Fit + FitnessActivityReadScope = "https://www.googleapis.com/auth/fitness.activity.read" + + // View and store your activity information in Google Fit + FitnessActivityWriteScope = "https://www.googleapis.com/auth/fitness.activity.write" + + // View body sensor information in Google Fit + FitnessBodyReadScope = "https://www.googleapis.com/auth/fitness.body.read" + + // View and store body sensor data in Google Fit + FitnessBodyWriteScope = "https://www.googleapis.com/auth/fitness.body.write" + + // View your stored location data in Google Fit + FitnessLocationReadScope = "https://www.googleapis.com/auth/fitness.location.read" + + // View and store your location data in Google Fit + FitnessLocationWriteScope = "https://www.googleapis.com/auth/fitness.location.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.Users = NewUsersService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Users *UsersService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewUsersService(s *Service) *UsersService { + rs := &UsersService{s: s} + rs.DataSources = NewUsersDataSourcesService(s) + rs.Dataset = NewUsersDatasetService(s) + rs.Sessions = NewUsersSessionsService(s) + return rs +} + +type UsersService struct { + s *Service + + DataSources *UsersDataSourcesService + + Dataset *UsersDatasetService + + Sessions *UsersSessionsService +} + +func NewUsersDataSourcesService(s *Service) *UsersDataSourcesService { + rs := &UsersDataSourcesService{s: s} + rs.Datasets = NewUsersDataSourcesDatasetsService(s) + return rs +} + +type UsersDataSourcesService struct { + s *Service + + Datasets *UsersDataSourcesDatasetsService +} + +func NewUsersDataSourcesDatasetsService(s *Service) *UsersDataSourcesDatasetsService { + rs := &UsersDataSourcesDatasetsService{s: s} + return rs +} + +type UsersDataSourcesDatasetsService struct { + s *Service +} + +func NewUsersDatasetService(s *Service) *UsersDatasetService { + rs := &UsersDatasetService{s: s} + return rs +} + +type UsersDatasetService struct { + s *Service +} + +func NewUsersSessionsService(s *Service) *UsersSessionsService { + rs := &UsersSessionsService{s: s} + return rs +} + +type UsersSessionsService struct { + s *Service +} + +type AggregateBucket struct { + // Activity: Available for Bucket.Type.ACTIVITY_TYPE, + // Bucket.Type.ACTIVITY_SEGMENT + Activity int64 `json:"activity,omitempty"` + + // Dataset: There will be one dataset per AggregateBy in the request. + Dataset []*Dataset `json:"dataset,omitempty"` + + // EndTimeMillis: The end time for the aggregated data, in milliseconds + // since epoch, inclusive. + EndTimeMillis int64 `json:"endTimeMillis,omitempty,string"` + + // Session: Available for Bucket.Type.SESSION + Session *Session `json:"session,omitempty"` + + // StartTimeMillis: The start time for the aggregated data, in + // milliseconds since epoch, inclusive. + StartTimeMillis int64 `json:"startTimeMillis,omitempty,string"` + + // Type: The type of a bucket signifies how the data aggregation is + // performed in the bucket. + // + // Possible values: + // "activitySegment" + // "activityType" + // "session" + // "time" + // "unknown" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Activity") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AggregateBucket) MarshalJSON() ([]byte, error) { + type noMethod AggregateBucket + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AggregateBy: The specification of which data to aggregate. +type AggregateBy struct { + // DataSourceId: A data source ID to aggregate. Mutually exclusive of + // dataTypeName. Only data from the specified data source ID will be + // included in the aggregation. The dataset in the response will have + // the same data source ID. + DataSourceId string `json:"dataSourceId,omitempty"` + + // DataTypeName: The data type to aggregate. All data sources providing + // this data type will contribute data to the aggregation. The response + // will contain a single dataset for this data type name. The dataset + // will have a data source ID of + // derived:com.google.:com.google.android.gms:aggregated + DataTypeName string `json:"dataTypeName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DataSourceId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AggregateBy) MarshalJSON() ([]byte, error) { + type noMethod AggregateBy + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AggregateRequest struct { + // AggregateBy: The specification of data to be aggregated. At least one + // aggregateBy spec must be provided. All data that is specified will be + // aggregated using the same bucketing criteria. There will be one + // dataset in the response for every aggregateBy spec. + AggregateBy []*AggregateBy `json:"aggregateBy,omitempty"` + + // BucketByActivitySegment: Specifies that data be aggregated each + // activity segment recored for a user. Similar to + // bucketByActivitySegment, but bucketing is done for each activity + // segment rather than all segments of the same type. Mutually exclusive + // of other bucketing specifications. + BucketByActivitySegment *BucketByActivity `json:"bucketByActivitySegment,omitempty"` + + // BucketByActivityType: Specifies that data be aggregated by the type + // of activity being performed when the data was recorded. All data that + // was recorded during a certain activity type (for the given time + // range) will be aggregated into the same bucket. Data that was + // recorded while the user was not active will not be included in the + // response. Mutually exclusive of other bucketing specifications. + BucketByActivityType *BucketByActivity `json:"bucketByActivityType,omitempty"` + + // BucketBySession: Specifies that data be aggregated by user sessions. + // Data that does not fall within the time range of a session will not + // be included in the response. Mutually exclusive of other bucketing + // specifications. + BucketBySession *BucketBySession `json:"bucketBySession,omitempty"` + + // BucketByTime: Specifies that data be aggregated by a single time + // interval. Mutually exclusive of other bucketing specifications. + BucketByTime *BucketByTime `json:"bucketByTime,omitempty"` + + // EndTimeMillis: The end of a window of time. Data that intersects with + // this time window will be aggregated. The time is in milliseconds + // since epoch, inclusive. + EndTimeMillis int64 `json:"endTimeMillis,omitempty,string"` + + // StartTimeMillis: The start of a window of time. Data that intersects + // with this time window will be aggregated. The time is in milliseconds + // since epoch, inclusive. + StartTimeMillis int64 `json:"startTimeMillis,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "AggregateBy") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AggregateRequest) MarshalJSON() ([]byte, error) { + type noMethod AggregateRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AggregateResponse struct { + // Bucket: A list of buckets containing the aggregated data. + Bucket []*AggregateBucket `json:"bucket,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Bucket") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AggregateResponse) MarshalJSON() ([]byte, error) { + type noMethod AggregateResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Application: See: +// google3/java/com/google/android/apps/heart/platform/api/Application.ja +// va +type Application struct { + // DetailsUrl: An optional URI that can be used to link back to the + // application. + DetailsUrl string `json:"detailsUrl,omitempty"` + + // Name: The name of this application. This is required for REST + // clients, but we do not enforce uniqueness of this name. It is + // provided as a matter of convenience for other developers who would + // like to identify which REST created an Application or Data Source. + Name string `json:"name,omitempty"` + + // PackageName: Package name for this application. This is used as a + // unique identifier when created by Android applications, but cannot be + // specified by REST clients. REST clients will have their developer + // project number reflected into the Data Source data stream IDs, + // instead of the packageName. + PackageName string `json:"packageName,omitempty"` + + // Version: Version of the application. You should update this field + // whenever the application changes in a way that affects the + // computation of the data. + Version string `json:"version,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DetailsUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Application) MarshalJSON() ([]byte, error) { + type noMethod Application + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type BucketByActivity struct { + // ActivityDataSourceId: The default activity stream will be used if a + // specific activityDataSourceId is not specified. + ActivityDataSourceId string `json:"activityDataSourceId,omitempty"` + + // MinDurationMillis: Specifies that only activity segments of duration + // longer than minDurationMillis are considered and used as a container + // for aggregated data. + MinDurationMillis int64 `json:"minDurationMillis,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. + // "ActivityDataSourceId") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketByActivity) MarshalJSON() ([]byte, error) { + type noMethod BucketByActivity + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type BucketBySession struct { + // MinDurationMillis: Specifies that only sessions of duration longer + // than minDurationMillis are considered and used as a container for + // aggregated data. + MinDurationMillis int64 `json:"minDurationMillis,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "MinDurationMillis") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketBySession) MarshalJSON() ([]byte, error) { + type noMethod BucketBySession + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type BucketByTime struct { + // DurationMillis: Specifies that result buckets aggregate data by + // exactly durationMillis time frames. Time frames that contain no data + // will be included in the response with an empty dataset. + DurationMillis int64 `json:"durationMillis,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "DurationMillis") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketByTime) MarshalJSON() ([]byte, error) { + type noMethod BucketByTime + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DataPoint: Represents a single data point, generated by a particular +// data source. A data point holds a value for each field, an end +// timestamp and an optional start time. The exact semantics of each of +// these attributes are specified in the documentation for the +// particular data type. +// +// A data point can represent an instantaneous measurement, reading or +// input observation, as well as averages or aggregates over a time +// interval. Check the data type documentation to determine which is the +// case for a particular data type. +// +// Data points always contain one value for each field of the data type. +type DataPoint struct { + // ComputationTimeMillis: Used for version checking during + // transformation; that is, a datapoint can only replace another + // datapoint that has an older computation time stamp. + ComputationTimeMillis int64 `json:"computationTimeMillis,omitempty,string"` + + // DataTypeName: The data type defining the format of the values in this + // data point. + DataTypeName string `json:"dataTypeName,omitempty"` + + // EndTimeNanos: The end time of the interval represented by this data + // point, in nanoseconds since epoch. + EndTimeNanos int64 `json:"endTimeNanos,omitempty,string"` + + // ModifiedTimeMillis: Indicates the last time this data point was + // modified. Useful only in contexts where we are listing the data + // changes, rather than representing the current state of the data. + ModifiedTimeMillis int64 `json:"modifiedTimeMillis,omitempty,string"` + + // OriginDataSourceId: If the data point is contained in a dataset for a + // derived data source, this field will be populated with the data + // source stream ID that created the data point originally. + OriginDataSourceId string `json:"originDataSourceId,omitempty"` + + // RawTimestampNanos: The raw timestamp from the original SensorEvent. + RawTimestampNanos int64 `json:"rawTimestampNanos,omitempty,string"` + + // StartTimeNanos: The start time of the interval represented by this + // data point, in nanoseconds since epoch. + StartTimeNanos int64 `json:"startTimeNanos,omitempty,string"` + + // Value: Values of each data type field for the data point. It is + // expected that each value corresponding to a data type field will + // occur in the same order that the field is listed with in the data + // type specified in a data source. + // + // Only one of integer and floating point fields will be populated, + // depending on the format enum value within data source's type field. + Value []*Value `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "ComputationTimeMillis") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DataPoint) MarshalJSON() ([]byte, error) { + type noMethod DataPoint + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DataSource: Definition of a unique source of sensor data. Data +// sources can expose raw data coming from hardware sensors on local or +// companion devices. They can also expose derived data, created by +// transforming or merging other data sources. Multiple data sources can +// exist for the same data type. Every data point inserted into or read +// from this service has an associated data source. +// +// The data source contains enough information to uniquely identify its +// data, including the hardware device and the application that +// collected and/or transformed the data. It also holds useful metadata, +// such as the hardware and application versions, and the device +// type. +// +// Each data source produces a unique stream of data, with a unique +// identifier. Not all changes to data source affect the stream +// identifier, so that data collected by updated versions of the same +// application/device can still be considered to belong to the same data +// stream. +type DataSource struct { + // Application: Information about an application which feeds sensor data + // into the platform. + Application *Application `json:"application,omitempty"` + + // DataStreamId: A unique identifier for the data stream produced by + // this data source. The identifier includes: + // + // + // - The physical device's manufacturer, model, and serial number (UID). + // + // - The application's package name or name. Package name is used when + // the data source was created by an Android application. The developer + // project number is used when the data source was created by a REST + // client. + // - The data source's type. + // - The data source's stream name. Note that not all attributes of the + // data source are used as part of the stream identifier. In particular, + // the version of the hardware/the application isn't used. This allows + // us to preserve the same stream through version updates. This also + // means that two DataSource objects may represent the same data stream + // even if they're not equal. + // + // The exact format of the data stream ID created by an Android + // application is: + // type:dataType.name:application.packageName:device.manufacturer:device. + // model:device.uid:dataStreamName + // + // The exact format of the data stream ID created by a REST client is: + // type:dataType.name:developer project + // number:device.manufacturer:device.model:device.uid:dataStreamName + // + // + // When any of the optional fields that comprise of the data stream ID + // are blank, they will be omitted from the data stream ID. The minnimum + // viable data stream ID would be: type:dataType.name:developer project + // number + // + // Finally, the developer project number is obfuscated when read by any + // REST or Android client that did not create the data source. Only the + // data source creator will see the developer project number in clear + // and normal form. + DataStreamId string `json:"dataStreamId,omitempty"` + + // DataStreamName: The stream name uniquely identifies this particular + // data source among other data sources of the same type from the same + // underlying producer. Setting the stream name is optional, but should + // be done whenever an application exposes two streams for the same data + // type, or when a device has two equivalent sensors. + DataStreamName string `json:"dataStreamName,omitempty"` + + // DataType: The data type defines the schema for a stream of data being + // collected by, inserted into, or queried from the Fitness API. + DataType *DataType `json:"dataType,omitempty"` + + // Device: Representation of an integrated device (such as a phone or a + // wearable) that can hold sensors. + Device *Device `json:"device,omitempty"` + + // Name: An end-user visible name for this data source. + Name string `json:"name,omitempty"` + + // Type: A constant describing the type of this data source. Indicates + // whether this data source produces raw or derived data. + // + // Possible values: + // "derived" + // "raw" + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Application") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DataSource) MarshalJSON() ([]byte, error) { + type noMethod DataSource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DataType: See: +// google3/java/com/google/android/apps/heart/platform/api/DataType.java +type DataType struct { + // Field: A field represents one dimension of a data type. + Field []*DataTypeField `json:"field,omitempty"` + + // Name: Each data type has a unique, namespaced, name. All data types + // in the com.google namespace are shared as part of the platform. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Field") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DataType) MarshalJSON() ([]byte, error) { + type noMethod DataType + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DataTypeField: In case of multi-dimensional data (such as an +// accelerometer with x, y, and z axes) each field represents one +// dimension. Each data type field has a unique name which identifies +// it. The field also defines the format of the data (int, float, +// etc.). +// +// This message is only instantiated in code and not used for wire comms +// or stored in any way. +type DataTypeField struct { + // Format: The different supported formats for each field in a data + // type. + // + // Possible values: + // "floatList" + // "floatPoint" + // "integer" + // "integerList" + // "map" + // "string" + Format string `json:"format,omitempty"` + + // Name: Defines the name and format of data. Unlike data type names, + // field names are not namespaced, and only need to be unique within the + // data type. + Name string `json:"name,omitempty"` + + Optional bool `json:"optional,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Format") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DataTypeField) MarshalJSON() ([]byte, error) { + type noMethod DataTypeField + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Dataset: A dataset represents a projection container for data points. +// They do not carry any info of their own. Datasets represent a set of +// data points from a particular data source. A data point can be found +// in more than one dataset. +type Dataset struct { + // DataSourceId: The data stream ID of the data source that created the + // points in this dataset. + DataSourceId string `json:"dataSourceId,omitempty"` + + // MaxEndTimeNs: The largest end time of all data points in this + // possibly partial representation of the dataset. Time is in + // nanoseconds from epoch. This should also match the first part of the + // dataset identifier. + MaxEndTimeNs int64 `json:"maxEndTimeNs,omitempty,string"` + + // MinStartTimeNs: The smallest start time of all data points in this + // possibly partial representation of the dataset. Time is in + // nanoseconds from epoch. This should also match the first part of the + // dataset identifier. + MinStartTimeNs int64 `json:"minStartTimeNs,omitempty,string"` + + // NextPageToken: This token will be set when a dataset is received in + // response to a GET request and the dataset is too large to be included + // in a single response. Provide this value in a subsequent GET request + // to return the next page of data points within this dataset. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Point: A partial list of data points contained in the dataset, + // ordered by largest endTimeNanos first. This list is considered + // complete when retrieving a small dataset and partial when patching a + // dataset or retrieving a dataset that is too large to include in a + // single response. + Point []*DataPoint `json:"point,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DataSourceId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Dataset) MarshalJSON() ([]byte, error) { + type noMethod Dataset + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Device: Representation of an integrated device (such as a phone or a +// wearable) that can hold sensors. Each sensor is exposed as a data +// source. +// +// The main purpose of the device information contained in this class is +// to identify the hardware of a particular data source. This can be +// useful in different ways, including: +// - Distinguishing two similar sensors on different devices (the step +// counter on two nexus 5 phones, for instance) +// - Display the source of data to the user (by using the device make / +// model) +// - Treat data differently depending on sensor type (accelerometers on +// a watch may give different patterns than those on a phone) +// - Build different analysis models for each device/version. +type Device struct { + // Manufacturer: Manufacturer of the product/hardware. + Manufacturer string `json:"manufacturer,omitempty"` + + // Model: End-user visible model name for the device. + Model string `json:"model,omitempty"` + + // Type: A constant representing the type of the device. + // + // Possible values: + // "chestStrap" + // "phone" + // "scale" + // "tablet" + // "unknown" + // "watch" + Type string `json:"type,omitempty"` + + // Uid: The serial number or other unique ID for the hardware. This + // field is obfuscated when read by any REST or Android client that did + // not create the data source. Only the data source creator will see the + // uid field in clear and normal form. + Uid string `json:"uid,omitempty"` + + // Version: Version string for the device hardware/software. + Version string `json:"version,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Manufacturer") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Device) MarshalJSON() ([]byte, error) { + type noMethod Device + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ListDataSourcesResponse struct { + // DataSource: A previously created data source. + DataSource []*DataSource `json:"dataSource,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DataSource") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListDataSourcesResponse) MarshalJSON() ([]byte, error) { + type noMethod ListDataSourcesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ListSessionsResponse struct { + // DeletedSession: If includeDeleted is set to true in the request, this + // list will contain sessions deleted with original end times that are + // within the startTime and endTime frame. + DeletedSession []*Session `json:"deletedSession,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"` + + // Session: Sessions with an end time that is between startTime and + // endTime of the request. + Session []*Session `json:"session,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DeletedSession") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListSessionsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListSessionsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MapValue: Holder object for the value of an entry in a map field of a +// data point. +// +// A map value supports a subset of the formats that the regular Value +// supports. +type MapValue struct { + // FpVal: Floating point value. + FpVal float64 `json:"fpVal,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FpVal") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MapValue) MarshalJSON() ([]byte, error) { + type noMethod MapValue + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Session: Sessions contain metadata, such as a user-friendly name and +// time interval information. +type Session struct { + // ActiveTimeMillis: Session active time. While start_time_millis and + // end_time_millis define the full session time, the active time can be + // shorter and specified by active_time_millis. If the inactive time + // during the session is known, it should also be inserted via a + // com.google.activity.segment data point with a STILL activity value + ActiveTimeMillis int64 `json:"activeTimeMillis,omitempty,string"` + + // ActivityType: The type of activity this session represents. + ActivityType int64 `json:"activityType,omitempty"` + + // Application: The application that created the session. + Application *Application `json:"application,omitempty"` + + // Description: A description for this session. + Description string `json:"description,omitempty"` + + // EndTimeMillis: An end time, in milliseconds since epoch, inclusive. + EndTimeMillis int64 `json:"endTimeMillis,omitempty,string"` + + // Id: A client-generated identifier that is unique across all sessions + // owned by this particular user. + Id string `json:"id,omitempty"` + + // ModifiedTimeMillis: A timestamp that indicates when the session was + // last modified. + ModifiedTimeMillis int64 `json:"modifiedTimeMillis,omitempty,string"` + + // Name: A human readable name of the session. + Name string `json:"name,omitempty"` + + // StartTimeMillis: A start time, in milliseconds since epoch, + // inclusive. + StartTimeMillis int64 `json:"startTimeMillis,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ActiveTimeMillis") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Session) MarshalJSON() ([]byte, error) { + type noMethod Session + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Value: Holder object for the value of a single field in a data +// point. +// +// A field value has a particular format and is only ever set to one of +// an integer or a floating point value. +type Value struct { + // FpVal: Floating point value. When this is set, other values must not + // be set. + FpVal float64 `json:"fpVal,omitempty"` + + // IntVal: Integer value. When this is set, other values must not be + // set. + IntVal int64 `json:"intVal,omitempty"` + + // MapVal: Map value. The valid key space and units for the + // corresponding value of each entry should be documented as part of the + // data type definition. Keys should be kept small whenever possible. + // Data streams with large keys and high data frequency may be down + // sampled. + MapVal []*ValueMapValEntry `json:"mapVal,omitempty"` + + // StringVal: String value. When this is set, other values must not be + // set. Strings should be kept small whenever possible. Data streams + // with large string values and high data frequency may be down sampled. + StringVal string `json:"stringVal,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FpVal") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Value) MarshalJSON() ([]byte, error) { + type noMethod Value + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ValueMapValEntry struct { + Key string `json:"key,omitempty"` + + Value *MapValue `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ValueMapValEntry) MarshalJSON() ([]byte, error) { + type noMethod ValueMapValEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "fitness.users.dataSources.create": + +type UsersDataSourcesCreateCall struct { + s *Service + userId string + datasource *DataSource + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a new data source that is unique across all data +// sources belonging to this user. The data stream ID field can be +// omitted and will be generated by the server with the correct format. +// The data stream ID is an ordered combination of some fields from the +// data source. In addition to the data source fields reflected into the +// data source ID, the developer project number that is authenticated +// when creating the data source is included. This developer project +// number is obfuscated when read by any other developer reading public +// data types. +func (r *UsersDataSourcesService) Create(userId string, datasource *DataSource) *UsersDataSourcesCreateCall { + c := &UsersDataSourcesCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.datasource = datasource + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersDataSourcesCreateCall) Fields(s ...googleapi.Field) *UsersDataSourcesCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersDataSourcesCreateCall) Context(ctx context.Context) *UsersDataSourcesCreateCall { + c.ctx_ = ctx + return c +} + +func (c *UsersDataSourcesCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.datasource) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/dataSources") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fitness.users.dataSources.create" call. +// Exactly one of *DataSource or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DataSource.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersDataSourcesCreateCall) Do() (*DataSource, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DataSource{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new data source that is unique across all data sources belonging to this user. The data stream ID field can be omitted and will be generated by the server with the correct format. The data stream ID is an ordered combination of some fields from the data source. In addition to the data source fields reflected into the data source ID, the developer project number that is authenticated when creating the data source is included. This developer project number is obfuscated when read by any other developer reading public data types.", + // "httpMethod": "POST", + // "id": "fitness.users.dataSources.create", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "userId": { + // "description": "Create the data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/dataSources", + // "request": { + // "$ref": "DataSource" + // }, + // "response": { + // "$ref": "DataSource" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fitness.activity.write", + // "https://www.googleapis.com/auth/fitness.body.write", + // "https://www.googleapis.com/auth/fitness.location.write" + // ] + // } + +} + +// method id "fitness.users.dataSources.delete": + +type UsersDataSourcesDeleteCall struct { + s *Service + userId string + dataSourceId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Delete the data source if there are no datapoints associated +// with it +func (r *UsersDataSourcesService) Delete(userId string, dataSourceId string) *UsersDataSourcesDeleteCall { + c := &UsersDataSourcesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.dataSourceId = dataSourceId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersDataSourcesDeleteCall) Fields(s ...googleapi.Field) *UsersDataSourcesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersDataSourcesDeleteCall) Context(ctx context.Context) *UsersDataSourcesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *UsersDataSourcesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/dataSources/{dataSourceId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "dataSourceId": c.dataSourceId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fitness.users.dataSources.delete" call. +// Exactly one of *DataSource or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DataSource.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersDataSourcesDeleteCall) Do() (*DataSource, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DataSource{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Delete the data source if there are no datapoints associated with it", + // "httpMethod": "DELETE", + // "id": "fitness.users.dataSources.delete", + // "parameterOrder": [ + // "userId", + // "dataSourceId" + // ], + // "parameters": { + // "dataSourceId": { + // "description": "The data stream ID of the data source to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "Retrieve a data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/dataSources/{dataSourceId}", + // "response": { + // "$ref": "DataSource" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fitness.activity.write", + // "https://www.googleapis.com/auth/fitness.body.write", + // "https://www.googleapis.com/auth/fitness.location.write" + // ] + // } + +} + +// method id "fitness.users.dataSources.get": + +type UsersDataSourcesGetCall struct { + s *Service + userId string + dataSourceId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns a data source identified by a data stream ID. +func (r *UsersDataSourcesService) Get(userId string, dataSourceId string) *UsersDataSourcesGetCall { + c := &UsersDataSourcesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.dataSourceId = dataSourceId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersDataSourcesGetCall) Fields(s ...googleapi.Field) *UsersDataSourcesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersDataSourcesGetCall) IfNoneMatch(entityTag string) *UsersDataSourcesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersDataSourcesGetCall) Context(ctx context.Context) *UsersDataSourcesGetCall { + c.ctx_ = ctx + return c +} + +func (c *UsersDataSourcesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/dataSources/{dataSourceId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "dataSourceId": c.dataSourceId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fitness.users.dataSources.get" call. +// Exactly one of *DataSource or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DataSource.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersDataSourcesGetCall) Do() (*DataSource, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DataSource{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a data source identified by a data stream ID.", + // "httpMethod": "GET", + // "id": "fitness.users.dataSources.get", + // "parameterOrder": [ + // "userId", + // "dataSourceId" + // ], + // "parameters": { + // "dataSourceId": { + // "description": "The data stream ID of the data source to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "Retrieve a data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/dataSources/{dataSourceId}", + // "response": { + // "$ref": "DataSource" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fitness.activity.read", + // "https://www.googleapis.com/auth/fitness.activity.write", + // "https://www.googleapis.com/auth/fitness.body.read", + // "https://www.googleapis.com/auth/fitness.body.write", + // "https://www.googleapis.com/auth/fitness.location.read", + // "https://www.googleapis.com/auth/fitness.location.write" + // ] + // } + +} + +// method id "fitness.users.dataSources.list": + +type UsersDataSourcesListCall struct { + s *Service + userId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all data sources that are visible to the developer, using +// the OAuth scopes provided. The list is not exhaustive: the user may +// have private data sources that are only visible to other developers +// or calls using other scopes. +func (r *UsersDataSourcesService) List(userId string) *UsersDataSourcesListCall { + c := &UsersDataSourcesListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +// DataTypeName sets the optional parameter "dataTypeName": The names of +// data types to include in the list. If not specified, all data sources +// will be returned. +func (c *UsersDataSourcesListCall) DataTypeName(dataTypeName string) *UsersDataSourcesListCall { + c.opt_["dataTypeName"] = dataTypeName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersDataSourcesListCall) Fields(s ...googleapi.Field) *UsersDataSourcesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersDataSourcesListCall) IfNoneMatch(entityTag string) *UsersDataSourcesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersDataSourcesListCall) Context(ctx context.Context) *UsersDataSourcesListCall { + c.ctx_ = ctx + return c +} + +func (c *UsersDataSourcesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["dataTypeName"]; ok { + params.Set("dataTypeName", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/dataSources") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fitness.users.dataSources.list" call. +// Exactly one of *ListDataSourcesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListDataSourcesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UsersDataSourcesListCall) Do() (*ListDataSourcesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListDataSourcesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all data sources that are visible to the developer, using the OAuth scopes provided. The list is not exhaustive: the user may have private data sources that are only visible to other developers or calls using other scopes.", + // "httpMethod": "GET", + // "id": "fitness.users.dataSources.list", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "dataTypeName": { + // "description": "The names of data types to include in the list. If not specified, all data sources will be returned.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "userId": { + // "description": "List data sources for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/dataSources", + // "response": { + // "$ref": "ListDataSourcesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fitness.activity.read", + // "https://www.googleapis.com/auth/fitness.activity.write", + // "https://www.googleapis.com/auth/fitness.body.read", + // "https://www.googleapis.com/auth/fitness.body.write", + // "https://www.googleapis.com/auth/fitness.location.read", + // "https://www.googleapis.com/auth/fitness.location.write" + // ] + // } + +} + +// method id "fitness.users.dataSources.patch": + +type UsersDataSourcesPatchCall struct { + s *Service + userId string + dataSourceId string + datasource *DataSource + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates a given data source. It is an error to modify the data +// source's data stream ID, data type, type, stream name or device +// information apart from the device version. Changing these fields +// would require a new unique data stream ID and separate data +// source. +// +// Data sources are identified by their data stream ID. This method +// supports patch semantics. +func (r *UsersDataSourcesService) Patch(userId string, dataSourceId string, datasource *DataSource) *UsersDataSourcesPatchCall { + c := &UsersDataSourcesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.dataSourceId = dataSourceId + c.datasource = datasource + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersDataSourcesPatchCall) Fields(s ...googleapi.Field) *UsersDataSourcesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersDataSourcesPatchCall) Context(ctx context.Context) *UsersDataSourcesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *UsersDataSourcesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.datasource) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/dataSources/{dataSourceId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "dataSourceId": c.dataSourceId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fitness.users.dataSources.patch" call. +// Exactly one of *DataSource or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DataSource.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersDataSourcesPatchCall) Do() (*DataSource, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DataSource{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a given data source. It is an error to modify the data source's data stream ID, data type, type, stream name or device information apart from the device version. Changing these fields would require a new unique data stream ID and separate data source.\n\nData sources are identified by their data stream ID. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "fitness.users.dataSources.patch", + // "parameterOrder": [ + // "userId", + // "dataSourceId" + // ], + // "parameters": { + // "dataSourceId": { + // "description": "The data stream ID of the data source to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "Update the data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/dataSources/{dataSourceId}", + // "request": { + // "$ref": "DataSource" + // }, + // "response": { + // "$ref": "DataSource" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fitness.activity.write", + // "https://www.googleapis.com/auth/fitness.body.write", + // "https://www.googleapis.com/auth/fitness.location.write" + // ] + // } + +} + +// method id "fitness.users.dataSources.update": + +type UsersDataSourcesUpdateCall struct { + s *Service + userId string + dataSourceId string + datasource *DataSource + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a given data source. It is an error to modify the +// data source's data stream ID, data type, type, stream name or device +// information apart from the device version. Changing these fields +// would require a new unique data stream ID and separate data +// source. +// +// Data sources are identified by their data stream ID. +func (r *UsersDataSourcesService) Update(userId string, dataSourceId string, datasource *DataSource) *UsersDataSourcesUpdateCall { + c := &UsersDataSourcesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.dataSourceId = dataSourceId + c.datasource = datasource + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersDataSourcesUpdateCall) Fields(s ...googleapi.Field) *UsersDataSourcesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersDataSourcesUpdateCall) Context(ctx context.Context) *UsersDataSourcesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *UsersDataSourcesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.datasource) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/dataSources/{dataSourceId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "dataSourceId": c.dataSourceId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fitness.users.dataSources.update" call. +// Exactly one of *DataSource or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DataSource.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersDataSourcesUpdateCall) Do() (*DataSource, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DataSource{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a given data source. It is an error to modify the data source's data stream ID, data type, type, stream name or device information apart from the device version. Changing these fields would require a new unique data stream ID and separate data source.\n\nData sources are identified by their data stream ID.", + // "httpMethod": "PUT", + // "id": "fitness.users.dataSources.update", + // "parameterOrder": [ + // "userId", + // "dataSourceId" + // ], + // "parameters": { + // "dataSourceId": { + // "description": "The data stream ID of the data source to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "Update the data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/dataSources/{dataSourceId}", + // "request": { + // "$ref": "DataSource" + // }, + // "response": { + // "$ref": "DataSource" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fitness.activity.write", + // "https://www.googleapis.com/auth/fitness.body.write", + // "https://www.googleapis.com/auth/fitness.location.write" + // ] + // } + +} + +// method id "fitness.users.dataSources.datasets.delete": + +type UsersDataSourcesDatasetsDeleteCall struct { + s *Service + userId string + dataSourceId string + datasetId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Performs an inclusive delete of all data points whose start +// and end times have any overlap with the time range specified by the +// dataset ID. For most data types, the entire data point will be +// deleted. For data types where the time span represents a consistent +// value (such as com.google.activity.segment), and a data point +// straddles either end point of the dataset, only the overlapping +// portion of the data point will be deleted. +func (r *UsersDataSourcesDatasetsService) Delete(userId string, dataSourceId string, datasetId string) *UsersDataSourcesDatasetsDeleteCall { + c := &UsersDataSourcesDatasetsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.dataSourceId = dataSourceId + c.datasetId = datasetId + return c +} + +// CurrentTimeMillis sets the optional parameter "currentTimeMillis": +// The client's current time in milliseconds since epoch. +func (c *UsersDataSourcesDatasetsDeleteCall) CurrentTimeMillis(currentTimeMillis int64) *UsersDataSourcesDatasetsDeleteCall { + c.opt_["currentTimeMillis"] = currentTimeMillis + return c +} + +// ModifiedTimeMillis sets the optional parameter "modifiedTimeMillis": +// When the operation was performed on the client. +func (c *UsersDataSourcesDatasetsDeleteCall) ModifiedTimeMillis(modifiedTimeMillis int64) *UsersDataSourcesDatasetsDeleteCall { + c.opt_["modifiedTimeMillis"] = modifiedTimeMillis + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersDataSourcesDatasetsDeleteCall) Fields(s ...googleapi.Field) *UsersDataSourcesDatasetsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersDataSourcesDatasetsDeleteCall) Context(ctx context.Context) *UsersDataSourcesDatasetsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *UsersDataSourcesDatasetsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["currentTimeMillis"]; ok { + params.Set("currentTimeMillis", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["modifiedTimeMillis"]; ok { + params.Set("modifiedTimeMillis", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/dataSources/{dataSourceId}/datasets/{datasetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "dataSourceId": c.dataSourceId, + "datasetId": c.datasetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fitness.users.dataSources.datasets.delete" call. +func (c *UsersDataSourcesDatasetsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Performs an inclusive delete of all data points whose start and end times have any overlap with the time range specified by the dataset ID. For most data types, the entire data point will be deleted. For data types where the time span represents a consistent value (such as com.google.activity.segment), and a data point straddles either end point of the dataset, only the overlapping portion of the data point will be deleted.", + // "httpMethod": "DELETE", + // "id": "fitness.users.dataSources.datasets.delete", + // "parameterOrder": [ + // "userId", + // "dataSourceId", + // "datasetId" + // ], + // "parameters": { + // "currentTimeMillis": { + // "description": "The client's current time in milliseconds since epoch.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "dataSourceId": { + // "description": "The data stream ID of the data source that created the dataset.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "datasetId": { + // "description": "Dataset identifier that is a composite of the minimum data point start time and maximum data point end time represented as nanoseconds from the epoch. The ID is formatted like: \"startTime-endTime\" where startTime and endTime are 64 bit integers.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "modifiedTimeMillis": { + // "description": "When the operation was performed on the client.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "description": "Delete a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/dataSources/{dataSourceId}/datasets/{datasetId}", + // "scopes": [ + // "https://www.googleapis.com/auth/fitness.activity.write", + // "https://www.googleapis.com/auth/fitness.body.write", + // "https://www.googleapis.com/auth/fitness.location.write" + // ] + // } + +} + +// method id "fitness.users.dataSources.datasets.get": + +type UsersDataSourcesDatasetsGetCall struct { + s *Service + userId string + dataSourceId string + datasetId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns a dataset containing all data points whose start and end +// times overlap with the specified range of the dataset minimum start +// time and maximum end time. Specifically, any data point whose start +// time is less than or equal to the dataset end time and whose end time +// is greater than or equal to the dataset start time. +func (r *UsersDataSourcesDatasetsService) Get(userId string, dataSourceId string, datasetId string) *UsersDataSourcesDatasetsGetCall { + c := &UsersDataSourcesDatasetsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.dataSourceId = dataSourceId + c.datasetId = datasetId + return c +} + +// Limit sets the optional parameter "limit": If specified, no more than +// this many data points will be included in the dataset. If the there +// are more data points in the dataset, nextPageToken will be set in the +// dataset response. +func (c *UsersDataSourcesDatasetsGetCall) Limit(limit int64) *UsersDataSourcesDatasetsGetCall { + c.opt_["limit"] = limit + return c +} + +// PageToken sets the optional parameter "pageToken": The continuation +// token, which is used to page through large datasets. To get the next +// page of a dataset, set this parameter to the value of nextPageToken +// from the previous response. Each subsequent call will yield a partial +// dataset with data point end timestamps that are strictly smaller than +// those in the previous partial response. +func (c *UsersDataSourcesDatasetsGetCall) PageToken(pageToken string) *UsersDataSourcesDatasetsGetCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersDataSourcesDatasetsGetCall) Fields(s ...googleapi.Field) *UsersDataSourcesDatasetsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersDataSourcesDatasetsGetCall) IfNoneMatch(entityTag string) *UsersDataSourcesDatasetsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersDataSourcesDatasetsGetCall) Context(ctx context.Context) *UsersDataSourcesDatasetsGetCall { + c.ctx_ = ctx + return c +} + +func (c *UsersDataSourcesDatasetsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["limit"]; ok { + params.Set("limit", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/dataSources/{dataSourceId}/datasets/{datasetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "dataSourceId": c.dataSourceId, + "datasetId": c.datasetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fitness.users.dataSources.datasets.get" call. +// Exactly one of *Dataset or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Dataset.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersDataSourcesDatasetsGetCall) Do() (*Dataset, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Dataset{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a dataset containing all data points whose start and end times overlap with the specified range of the dataset minimum start time and maximum end time. Specifically, any data point whose start time is less than or equal to the dataset end time and whose end time is greater than or equal to the dataset start time.", + // "httpMethod": "GET", + // "id": "fitness.users.dataSources.datasets.get", + // "parameterOrder": [ + // "userId", + // "dataSourceId", + // "datasetId" + // ], + // "parameters": { + // "dataSourceId": { + // "description": "The data stream ID of the data source that created the dataset.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "datasetId": { + // "description": "Dataset identifier that is a composite of the minimum data point start time and maximum data point end time represented as nanoseconds from the epoch. The ID is formatted like: \"startTime-endTime\" where startTime and endTime are 64 bit integers.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "limit": { + // "description": "If specified, no more than this many data points will be included in the dataset. If the there are more data points in the dataset, nextPageToken will be set in the dataset response.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The continuation token, which is used to page through large datasets. To get the next page of a dataset, set this parameter to the value of nextPageToken from the previous response. Each subsequent call will yield a partial dataset with data point end timestamps that are strictly smaller than those in the previous partial response.", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "description": "Retrieve a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/dataSources/{dataSourceId}/datasets/{datasetId}", + // "response": { + // "$ref": "Dataset" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fitness.activity.read", + // "https://www.googleapis.com/auth/fitness.activity.write", + // "https://www.googleapis.com/auth/fitness.body.read", + // "https://www.googleapis.com/auth/fitness.body.write", + // "https://www.googleapis.com/auth/fitness.location.read", + // "https://www.googleapis.com/auth/fitness.location.write" + // ] + // } + +} + +// method id "fitness.users.dataSources.datasets.patch": + +type UsersDataSourcesDatasetsPatchCall struct { + s *Service + userId string + dataSourceId string + datasetId string + dataset *Dataset + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Adds data points to a dataset. The dataset need not be +// previously created. All points within the given dataset will be +// returned with subsquent calls to retrieve this dataset. Data points +// can belong to more than one dataset. This method does not use patch +// semantics. +func (r *UsersDataSourcesDatasetsService) Patch(userId string, dataSourceId string, datasetId string, dataset *Dataset) *UsersDataSourcesDatasetsPatchCall { + c := &UsersDataSourcesDatasetsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.dataSourceId = dataSourceId + c.datasetId = datasetId + c.dataset = dataset + return c +} + +// CurrentTimeMillis sets the optional parameter "currentTimeMillis": +// The client's current time in milliseconds since epoch. Note that the +// minStartTimeNs and maxEndTimeNs properties in the request body are in +// nanoseconds instead of milliseconds. +func (c *UsersDataSourcesDatasetsPatchCall) CurrentTimeMillis(currentTimeMillis int64) *UsersDataSourcesDatasetsPatchCall { + c.opt_["currentTimeMillis"] = currentTimeMillis + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersDataSourcesDatasetsPatchCall) Fields(s ...googleapi.Field) *UsersDataSourcesDatasetsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersDataSourcesDatasetsPatchCall) Context(ctx context.Context) *UsersDataSourcesDatasetsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *UsersDataSourcesDatasetsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["currentTimeMillis"]; ok { + params.Set("currentTimeMillis", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/dataSources/{dataSourceId}/datasets/{datasetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "dataSourceId": c.dataSourceId, + "datasetId": c.datasetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fitness.users.dataSources.datasets.patch" call. +// Exactly one of *Dataset or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Dataset.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersDataSourcesDatasetsPatchCall) Do() (*Dataset, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Dataset{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds data points to a dataset. The dataset need not be previously created. All points within the given dataset will be returned with subsquent calls to retrieve this dataset. Data points can belong to more than one dataset. This method does not use patch semantics.", + // "httpMethod": "PATCH", + // "id": "fitness.users.dataSources.datasets.patch", + // "parameterOrder": [ + // "userId", + // "dataSourceId", + // "datasetId" + // ], + // "parameters": { + // "currentTimeMillis": { + // "description": "The client's current time in milliseconds since epoch. Note that the minStartTimeNs and maxEndTimeNs properties in the request body are in nanoseconds instead of milliseconds.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "dataSourceId": { + // "description": "The data stream ID of the data source that created the dataset.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "datasetId": { + // "description": "Dataset identifier that is a composite of the minimum data point start time and maximum data point end time represented as nanoseconds from the epoch. The ID is formatted like: \"startTime-endTime\" where startTime and endTime are 64 bit integers.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "Patch a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/dataSources/{dataSourceId}/datasets/{datasetId}", + // "request": { + // "$ref": "Dataset" + // }, + // "response": { + // "$ref": "Dataset" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fitness.activity.write", + // "https://www.googleapis.com/auth/fitness.body.write", + // "https://www.googleapis.com/auth/fitness.location.write" + // ] + // } + +} + +// method id "fitness.users.dataset.aggregate": + +type UsersDatasetAggregateCall struct { + s *Service + userId string + aggregaterequest *AggregateRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Aggregate: Aggregates data of a certain type or stream into buckets +// divided by a given type of boundary. Multiple data sets of multiple +// types and from multiple sources can be aggreated into exactly one +// bucket type per request. +func (r *UsersDatasetService) Aggregate(userId string, aggregaterequest *AggregateRequest) *UsersDatasetAggregateCall { + c := &UsersDatasetAggregateCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.aggregaterequest = aggregaterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersDatasetAggregateCall) Fields(s ...googleapi.Field) *UsersDatasetAggregateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersDatasetAggregateCall) Context(ctx context.Context) *UsersDatasetAggregateCall { + c.ctx_ = ctx + return c +} + +func (c *UsersDatasetAggregateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.aggregaterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/dataset:aggregate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fitness.users.dataset.aggregate" call. +// Exactly one of *AggregateResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AggregateResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UsersDatasetAggregateCall) Do() (*AggregateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AggregateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Aggregates data of a certain type or stream into buckets divided by a given type of boundary. Multiple data sets of multiple types and from multiple sources can be aggreated into exactly one bucket type per request.", + // "httpMethod": "POST", + // "id": "fitness.users.dataset.aggregate", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "userId": { + // "description": "Aggregate data for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/dataset:aggregate", + // "request": { + // "$ref": "AggregateRequest" + // }, + // "response": { + // "$ref": "AggregateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fitness.activity.write", + // "https://www.googleapis.com/auth/fitness.body.write", + // "https://www.googleapis.com/auth/fitness.location.write" + // ] + // } + +} + +// method id "fitness.users.sessions.delete": + +type UsersSessionsDeleteCall struct { + s *Service + userId string + sessionId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a session specified by the given session ID. +func (r *UsersSessionsService) Delete(userId string, sessionId string) *UsersSessionsDeleteCall { + c := &UsersSessionsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.sessionId = sessionId + return c +} + +// CurrentTimeMillis sets the optional parameter "currentTimeMillis": +// The client's current time in milliseconds since epoch. +func (c *UsersSessionsDeleteCall) CurrentTimeMillis(currentTimeMillis int64) *UsersSessionsDeleteCall { + c.opt_["currentTimeMillis"] = currentTimeMillis + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersSessionsDeleteCall) Fields(s ...googleapi.Field) *UsersSessionsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersSessionsDeleteCall) Context(ctx context.Context) *UsersSessionsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *UsersSessionsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["currentTimeMillis"]; ok { + params.Set("currentTimeMillis", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/sessions/{sessionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "sessionId": c.sessionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fitness.users.sessions.delete" call. +func (c *UsersSessionsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a session specified by the given session ID.", + // "httpMethod": "DELETE", + // "id": "fitness.users.sessions.delete", + // "parameterOrder": [ + // "userId", + // "sessionId" + // ], + // "parameters": { + // "currentTimeMillis": { + // "description": "The client's current time in milliseconds since epoch.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "sessionId": { + // "description": "The ID of the session to be deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "Delete a session for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/sessions/{sessionId}", + // "scopes": [ + // "https://www.googleapis.com/auth/fitness.activity.write" + // ] + // } + +} + +// method id "fitness.users.sessions.list": + +type UsersSessionsListCall struct { + s *Service + userId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists sessions previously created. +func (r *UsersSessionsService) List(userId string) *UsersSessionsListCall { + c := &UsersSessionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +// EndTime sets the optional parameter "endTime": An RFC3339 timestamp. +// Only sessions ending between the start and end times will be included +// in the response. +func (c *UsersSessionsListCall) EndTime(endTime string) *UsersSessionsListCall { + c.opt_["endTime"] = endTime + return c +} + +// IncludeDeleted sets the optional parameter "includeDeleted": If true, +// deleted sessions will be returned. When set to true, sessions +// returned in this response will only have an ID and will not have any +// other fields. +func (c *UsersSessionsListCall) IncludeDeleted(includeDeleted bool) *UsersSessionsListCall { + c.opt_["includeDeleted"] = includeDeleted + 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 *UsersSessionsListCall) PageToken(pageToken string) *UsersSessionsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StartTime sets the optional parameter "startTime": An RFC3339 +// timestamp. Only sessions ending between the start and end times will +// be included in the response. +func (c *UsersSessionsListCall) StartTime(startTime string) *UsersSessionsListCall { + c.opt_["startTime"] = startTime + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersSessionsListCall) Fields(s ...googleapi.Field) *UsersSessionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersSessionsListCall) IfNoneMatch(entityTag string) *UsersSessionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersSessionsListCall) Context(ctx context.Context) *UsersSessionsListCall { + c.ctx_ = ctx + return c +} + +func (c *UsersSessionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["endTime"]; ok { + params.Set("endTime", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["includeDeleted"]; ok { + params.Set("includeDeleted", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startTime"]; ok { + params.Set("startTime", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/sessions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fitness.users.sessions.list" call. +// Exactly one of *ListSessionsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListSessionsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UsersSessionsListCall) Do() (*ListSessionsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListSessionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists sessions previously created.", + // "httpMethod": "GET", + // "id": "fitness.users.sessions.list", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "endTime": { + // "description": "An RFC3339 timestamp. Only sessions ending between the start and end times will be included in the response.", + // "location": "query", + // "type": "string" + // }, + // "includeDeleted": { + // "description": "If true, deleted sessions will be returned. When set to true, sessions returned in this response will only have an ID and will not have any other fields.", + // "location": "query", + // "type": "boolean" + // }, + // "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" + // }, + // "startTime": { + // "description": "An RFC3339 timestamp. Only sessions ending between the start and end times will be included in the response.", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "description": "List sessions for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/sessions", + // "response": { + // "$ref": "ListSessionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fitness.activity.read", + // "https://www.googleapis.com/auth/fitness.activity.write", + // "https://www.googleapis.com/auth/fitness.body.read", + // "https://www.googleapis.com/auth/fitness.body.write", + // "https://www.googleapis.com/auth/fitness.location.read", + // "https://www.googleapis.com/auth/fitness.location.write" + // ] + // } + +} + +// method id "fitness.users.sessions.update": + +type UsersSessionsUpdateCall struct { + s *Service + userId string + sessionId string + session *Session + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates or insert a given session. +func (r *UsersSessionsService) Update(userId string, sessionId string, session *Session) *UsersSessionsUpdateCall { + c := &UsersSessionsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.sessionId = sessionId + c.session = session + return c +} + +// CurrentTimeMillis sets the optional parameter "currentTimeMillis": +// The client's current time in milliseconds since epoch. +func (c *UsersSessionsUpdateCall) CurrentTimeMillis(currentTimeMillis int64) *UsersSessionsUpdateCall { + c.opt_["currentTimeMillis"] = currentTimeMillis + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersSessionsUpdateCall) Fields(s ...googleapi.Field) *UsersSessionsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersSessionsUpdateCall) Context(ctx context.Context) *UsersSessionsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *UsersSessionsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.session) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["currentTimeMillis"]; ok { + params.Set("currentTimeMillis", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/sessions/{sessionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "sessionId": c.sessionId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fitness.users.sessions.update" call. +// Exactly one of *Session or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Session.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersSessionsUpdateCall) Do() (*Session, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Session{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates or insert a given session.", + // "httpMethod": "PUT", + // "id": "fitness.users.sessions.update", + // "parameterOrder": [ + // "userId", + // "sessionId" + // ], + // "parameters": { + // "currentTimeMillis": { + // "description": "The client's current time in milliseconds since epoch.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "sessionId": { + // "description": "The ID of the session to be created.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "description": "Create sessions for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/sessions/{sessionId}", + // "request": { + // "$ref": "Session" + // }, + // "response": { + // "$ref": "Session" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fitness.activity.write" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/freebase/v1/freebase-api.json b/Godeps/_workspace/src/google.golang.org/api/freebase/v1/freebase-api.json new file mode 100644 index 000000000..ef981cc54 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/freebase/v1/freebase-api.json @@ -0,0 +1,412 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/b42JL4j5Mj0i9yGv-ODgLLktQPQ\"", + "discoveryVersion": "v1", + "id": "freebase:v1", + "name": "freebase", + "version": "v1", + "revision": "20141210", + "title": "Freebase Search", + "description": "Find Freebase entities using textual queries and other constraints.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/freebase-16.png", + "x32": "https://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/Godeps/_workspace/src/google.golang.org/api/freebase/v1/freebase-gen.go b/Godeps/_workspace/src/google.golang.org/api/freebase/v1/freebase-gen.go new file mode 100644 index 000000000..cbb7f914c --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/freebase/v1/freebase-gen.go @@ -0,0 +1,972 @@ +// Package freebase provides access to the Freebase Search. +// +// See https://developers.google.com/freebase/ +// +// Usage example: +// +// import "google.golang.org/api/freebase/v1" +// ... +// freebaseService, err := freebase.New(oauthHttpClient) +package freebase // import "google.golang.org/api/freebase/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Confidence") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReconcileCandidate) MarshalJSON() ([]byte, error) { + type noMethod ReconcileCandidate + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReconcileCandidateNotable: Type or profession the candidate is +// notable for. +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReconcileCandidateNotable) MarshalJSON() ([]byte, error) { + type noMethod ReconcileCandidateNotable + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Candidate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReconcileGet) MarshalJSON() ([]byte, error) { + type noMethod ReconcileGet + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReconcileGetCosts: Server costs for reconciling. +type ReconcileGetCosts struct { + // Hits: Total number of hits found. + Hits int64 `json:"hits,omitempty"` + + // Ms: Total milliseconds spent. + Ms int64 `json:"ms,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Hits") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReconcileGetCosts) MarshalJSON() ([]byte, error) { + type noMethod ReconcileGetCosts + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Location") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReconcileGetWarning) MarshalJSON() ([]byte, error) { + type noMethod ReconcileGetWarning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "freebase.reconcile": + +type ReconcileCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReconcileCall) Fields(s ...googleapi.Field) *ReconcileCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReconcileCall) IfNoneMatch(entityTag string) *ReconcileCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReconcileCall) Context(ctx context.Context) *ReconcileCall { + c.ctx_ = ctx + return c +} + +func (c *ReconcileCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "freebase.reconcile" call. +// Exactly one of *ReconcileGet or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ReconcileGet.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReconcileCall) Do() (*ReconcileGet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ReconcileGet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// Search: Search Freebase open data. +func (s *Service) Search() *SearchCall { + c := &SearchCall{s: s, opt_: make(map[string]interface{})} + return c +} + +// AsOfTime sets the optional parameter "as_of_time": A mql as_of_time +// value to use with mql_output queries. +func (c *SearchCall) AsOfTime(asOfTime string) *SearchCall { + c.opt_["as_of_time"] = asOfTime + 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. +// +// Possible values: +// "html" - Encode certain characters in the response (such as tags +// and ambersands) using html encoding. +// "off" (default) - No encoding of the response. You should not print +// the results directly on an web page without html-escaping the content +// first. +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. +// +// Possible values: +// "ac" - Compact format useful for autocomplete/suggest UIs. +// "classic" - [DEPRECATED] Same format as was returned by +// api.freebase.com. +// "entity" (default) - Basic information about the entities. +// "guids" - [DEPRECATED] Ordered list of a freebase guids. +// "ids" - Ordered list of freebase ids. +// "mids" - Ordered list of freebase mids. +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. +// +// Possible values: +// "langs" - The language codes served by the service. +// "mappings" - The property/path mappings supported by the filter and +// output request parameters. +// "predicates" - The predicates and path-terminating properties +// supported by the filter and output request parameters. +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 +} + +// MqlOutput sets the optional parameter "mql_output": The MQL query to +// run againist the results to extract more data. +func (c *SearchCall) MqlOutput(mqlOutput string) *SearchCall { + c.opt_["mql_output"] = mqlOutput + 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. +// +// Possible values: +// "entity" (default) - Use freebase and popularity entity ranking. +// "freebase" - Use freebase entity ranking. +// "schema" - Use schema ranking for properties and types. +func (c *SearchCall) Scoring(scoring string) *SearchCall { + c.opt_["scoring"] = scoring + return c +} + +// Spell sets the optional parameter "spell": Request 'did you mean' +// suggestions +// +// Possible values: +// "always" - Request spelling suggestions for any query at least +// three characters long. +// "no_results" - Request spelling suggestions if no results were +// found. +// "no_spelling" (default) - Don't request spelling 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SearchCall) Fields(s ...googleapi.Field) *SearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SearchCall) IfNoneMatch(entityTag string) *SearchCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SearchCall) Context(ctx context.Context) *SearchCall { + c.ctx_ = ctx + return c +} + +func (c *SearchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *SearchCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "freebase.search" call. +func (c *SearchCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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/Godeps/_workspace/src/google.golang.org/api/fusiontables/v1/fusiontables-api.json b/Godeps/_workspace/src/google.golang.org/api/fusiontables/v1/fusiontables-api.json new file mode 100644 index 000000000..70a5c6381 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/fusiontables/v1/fusiontables-api.json @@ -0,0 +1,1824 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/_HDQvvrmU1Cf0bBIzjf-H39NJ10\"", + "discoveryVersion": "v1", + "id": "fusiontables:v1", + "name": "fusiontables", + "version": "v1", + "revision": "20150226", + "title": "Fusion Tables API", + "description": "API for working with Fusion Tables 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/fusiontables", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/fusiontables/v1/", + "basePath": "/fusiontables/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "fusiontables/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/fusiontables": { + "description": "Manage your Fusion Tables" + }, + "https://www.googleapis.com/auth/fusiontables.readonly": { + "description": "View your Fusion Tables" + } + } + } + }, + "schemas": { + "Bucket": { + "id": "Bucket", + "type": "object", + "description": "Specifies the minimum and maximum values, the color, opacity, icon and weight of a bucket within a StyleSetting.", + "properties": { + "color": { + "type": "string", + "description": "Color of line or the interior of a polygon in #RRGGBB format." + }, + "icon": { + "type": "string", + "description": "Icon name used for a point." + }, + "max": { + "type": "number", + "description": "Maximum value in the selected column for a row to be styled according to the bucket color, opacity, icon, or weight.", + "format": "double" + }, + "min": { + "type": "number", + "description": "Minimum value in the selected column for a row to be styled according to the bucket color, opacity, icon, or weight.", + "format": "double" + }, + "opacity": { + "type": "number", + "description": "Opacity of the color: 0.0 (transparent) to 1.0 (opaque).", + "format": "double" + }, + "weight": { + "type": "integer", + "description": "Width of a line (in pixels).", + "format": "int32" + } + } + }, + "Column": { + "id": "Column", + "type": "object", + "description": "Specifies the id, name and type of a column in a table.", + "properties": { + "baseColumn": { + "type": "object", + "description": "Optional identifier of the base column. If present, this column is derived from the specified base column.", + "properties": { + "columnId": { + "type": "integer", + "description": "The id of the column in the base table from which this column is derived.", + "format": "int32" + }, + "tableIndex": { + "type": "integer", + "description": "Offset to the entry in the list of base tables in the table definition.", + "format": "int32" + } + } + }, + "columnId": { + "type": "integer", + "description": "Identifier for the column.", + "format": "int32" + }, + "description": { + "type": "string", + "description": "Optional column description." + }, + "graph_predicate": { + "type": "string", + "description": "Optional column predicate. Used to map table to graph data model (subject,predicate,object) See http://www.w3.org/TR/2014/REC-rdf11-concepts-20140225/#data-model" + }, + "kind": { + "type": "string", + "description": "Type name: a template for an individual column.", + "default": "fusiontables#column" + }, + "name": { + "type": "string", + "description": "Required name of the column.", + "annotations": { + "required": [ + "fusiontables.column.insert" + ] + } + }, + "type": { + "type": "string", + "description": "Required type of the column.", + "annotations": { + "required": [ + "fusiontables.column.insert" + ] + } + } + } + }, + "ColumnList": { + "id": "ColumnList", + "type": "object", + "description": "Represents a list of columns in a table.", + "properties": { + "items": { + "type": "array", + "description": "List of all requested columns.", + "items": { + "$ref": "Column" + } + }, + "kind": { + "type": "string", + "description": "Type name: a list of all columns.", + "default": "fusiontables#columnList" + }, + "nextPageToken": { + "type": "string", + "description": "Token used to access the next page of this result. No token is displayed if there are no more pages left." + }, + "totalItems": { + "type": "integer", + "description": "Total number of columns for the table.", + "format": "int32" + } + } + }, + "Geometry": { + "id": "Geometry", + "type": "object", + "description": "Represents a Geometry object.", + "properties": { + "geometries": { + "type": "array", + "description": "The list of geometries in this geometry collection.", + "items": { + "type": "any" + } + }, + "geometry": { + "type": "any" + }, + "type": { + "type": "string", + "description": "Type: A collection of geometries.", + "default": "GeometryCollection" + } + } + }, + "Import": { + "id": "Import", + "type": "object", + "description": "Represents an import request.", + "properties": { + "kind": { + "type": "string", + "description": "Type name: a template for an import request.", + "default": "fusiontables#import" + }, + "numRowsReceived": { + "type": "string", + "description": "The number of rows received from the import request.", + "format": "int64" + } + } + }, + "Line": { + "id": "Line", + "type": "object", + "description": "Represents a line geometry.", + "properties": { + "coordinates": { + "type": "array", + "description": "The coordinates that define the line.", + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + } + }, + "type": { + "type": "string", + "description": "Type: A line geometry.", + "default": "LineString" + } + } + }, + "LineStyle": { + "id": "LineStyle", + "type": "object", + "description": "Represents a LineStyle within a StyleSetting", + "properties": { + "strokeColor": { + "type": "string", + "description": "Color of the line in #RRGGBB format." + }, + "strokeColorStyler": { + "$ref": "StyleFunction", + "description": "Column-value, gradient or buckets styler that is used to determine the line color and opacity." + }, + "strokeOpacity": { + "type": "number", + "description": "Opacity of the line : 0.0 (transparent) to 1.0 (opaque).", + "format": "double" + }, + "strokeWeight": { + "type": "integer", + "description": "Width of the line in pixels.", + "format": "int32" + }, + "strokeWeightStyler": { + "$ref": "StyleFunction", + "description": "Column-value or bucket styler that is used to determine the width of the line." + } + } + }, + "Point": { + "id": "Point", + "type": "object", + "description": "Represents a point object.", + "properties": { + "coordinates": { + "type": "array", + "description": "The coordinates that define the point.", + "items": { + "type": "number", + "format": "double" + } + }, + "type": { + "type": "string", + "description": "Point: A point geometry.", + "default": "Point" + } + } + }, + "PointStyle": { + "id": "PointStyle", + "type": "object", + "description": "Represents a PointStyle within a StyleSetting", + "properties": { + "iconName": { + "type": "string", + "description": "Name of the icon. Use values defined in http://www.google.com/fusiontables/DataSource?dsrcid=308519" + }, + "iconStyler": { + "$ref": "StyleFunction", + "description": "Column or a bucket value from which the icon name is to be determined." + } + } + }, + "Polygon": { + "id": "Polygon", + "type": "object", + "description": "Represents a polygon object.", + "properties": { + "coordinates": { + "type": "array", + "description": "The coordinates that define the polygon.", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + } + } + }, + "type": { + "type": "string", + "description": "Type: A polygon geometry.", + "default": "Polygon" + } + } + }, + "PolygonStyle": { + "id": "PolygonStyle", + "type": "object", + "description": "Represents a PolygonStyle within a StyleSetting", + "properties": { + "fillColor": { + "type": "string", + "description": "Color of the interior of the polygon in #RRGGBB format." + }, + "fillColorStyler": { + "$ref": "StyleFunction", + "description": "Column-value, gradient, or bucket styler that is used to determine the interior color and opacity of the polygon." + }, + "fillOpacity": { + "type": "number", + "description": "Opacity of the interior of the polygon: 0.0 (transparent) to 1.0 (opaque).", + "format": "double" + }, + "strokeColor": { + "type": "string", + "description": "Color of the polygon border in #RRGGBB format." + }, + "strokeColorStyler": { + "$ref": "StyleFunction", + "description": "Column-value, gradient or buckets styler that is used to determine the border color and opacity." + }, + "strokeOpacity": { + "type": "number", + "description": "Opacity of the polygon border: 0.0 (transparent) to 1.0 (opaque).", + "format": "double" + }, + "strokeWeight": { + "type": "integer", + "description": "Width of the polyon border in pixels.", + "format": "int32" + }, + "strokeWeightStyler": { + "$ref": "StyleFunction", + "description": "Column-value or bucket styler that is used to determine the width of the polygon border." + } + } + }, + "Sqlresponse": { + "id": "Sqlresponse", + "type": "object", + "description": "Represents a response to an sql statement.", + "properties": { + "columns": { + "type": "array", + "description": "Columns in the table.", + "items": { + "type": "string" + } + }, + "kind": { + "type": "string", + "description": "Type name: a template for an individual table.", + "default": "fusiontables#sqlresponse" + }, + "rows": { + "type": "array", + "description": "The rows in the table. For each cell we print out whatever cell value (e.g., numeric, string) exists. Thus it is important that each cell contains only one value.", + "items": { + "type": "array", + "items": { + "type": "any" + } + } + } + } + }, + "StyleFunction": { + "id": "StyleFunction", + "type": "object", + "description": "Represents a StyleFunction within a StyleSetting", + "properties": { + "buckets": { + "type": "array", + "description": "Bucket function that assigns a style based on the range a column value falls into.", + "items": { + "$ref": "Bucket" + } + }, + "columnName": { + "type": "string", + "description": "Name of the column whose value is used in the style.", + "annotations": { + "required": [ + "fusiontables.style.insert" + ] + } + }, + "gradient": { + "type": "object", + "description": "Gradient function that interpolates a range of colors based on column value.", + "properties": { + "colors": { + "type": "array", + "description": "Array with two or more colors.", + "items": { + "type": "object", + "properties": { + "color": { + "type": "string", + "description": "Color in #RRGGBB format." + }, + "opacity": { + "type": "number", + "description": "Opacity of the color: 0.0 (transparent) to 1.0 (opaque).", + "format": "double" + } + } + } + }, + "max": { + "type": "number", + "description": "Higher-end of the interpolation range: rows with this value will be assigned to colors[n-1].", + "format": "double" + }, + "min": { + "type": "number", + "description": "Lower-end of the interpolation range: rows with this value will be assigned to colors[0].", + "format": "double" + } + } + }, + "kind": { + "type": "string", + "description": "Stylers can be one of three kinds: \"fusiontables#fromColumn\" if the column value is to be used as is, i.e., the column values can have colors in #RRGGBBAA format or integer line widths or icon names; \"fusiontables#gradient\" if the styling of the row is to be based on applying the gradient function on the column value; or \"fusiontables#buckets\" if the styling is to based on the bucket into which the the column value falls." + } + } + }, + "StyleSetting": { + "id": "StyleSetting", + "type": "object", + "description": "Represents a complete StyleSettings object. The primary key is a combination of the tableId and a styleId.", + "properties": { + "kind": { + "type": "string", + "description": "Type name: an individual style setting. A StyleSetting contains the style defintions for points, lines, and polygons in a table. Since a table can have any one or all of them, a style definition can have point, line and polygon style definitions.", + "default": "fusiontables#styleSetting" + }, + "markerOptions": { + "$ref": "PointStyle", + "description": "Style definition for points in the table." + }, + "name": { + "type": "string", + "description": "Optional name for the style setting." + }, + "polygonOptions": { + "$ref": "PolygonStyle", + "description": "Style definition for polygons in the table." + }, + "polylineOptions": { + "$ref": "LineStyle", + "description": "Style definition for lines in the table." + }, + "styleId": { + "type": "integer", + "description": "Identifier for the style setting (unique only within tables).", + "format": "int32" + }, + "tableId": { + "type": "string", + "description": "Identifier for the table." + } + } + }, + "StyleSettingList": { + "id": "StyleSettingList", + "type": "object", + "description": "Represents a list of styles for a given table.", + "properties": { + "items": { + "type": "array", + "description": "All requested style settings.", + "items": { + "$ref": "StyleSetting" + } + }, + "kind": { + "type": "string", + "description": "Type name: in this case, a list of style settings.", + "default": "fusiontables#styleSettingList" + }, + "nextPageToken": { + "type": "string", + "description": "Token used to access the next page of this result. No token is displayed if there are no more pages left." + }, + "totalItems": { + "type": "integer", + "description": "Total number of styles for the table.", + "format": "int32" + } + } + }, + "Table": { + "id": "Table", + "type": "object", + "description": "Represents a table. Specifies the name, whether it is exportable, description, attribution, and attribution link.", + "properties": { + "attribution": { + "type": "string", + "description": "Optional attribution assigned to the table." + }, + "attributionLink": { + "type": "string", + "description": "Optional link for attribution." + }, + "baseTableIds": { + "type": "array", + "description": "Optional base table identifier if this table is a view or merged table.", + "items": { + "type": "string" + } + }, + "columns": { + "type": "array", + "description": "Columns in the table.", + "items": { + "$ref": "Column" + }, + "annotations": { + "required": [ + "fusiontables.table.insert", + "fusiontables.table.update" + ] + } + }, + "description": { + "type": "string", + "description": "Optional description assigned to the table." + }, + "isExportable": { + "type": "boolean", + "description": "Variable for whether table is exportable.", + "annotations": { + "required": [ + "fusiontables.table.insert", + "fusiontables.table.update" + ] + } + }, + "kind": { + "type": "string", + "description": "Type name: a template for an individual table.", + "default": "fusiontables#table" + }, + "name": { + "type": "string", + "description": "Name assigned to a table.", + "annotations": { + "required": [ + "fusiontables.table.insert", + "fusiontables.table.update" + ] + } + }, + "sql": { + "type": "string", + "description": "Optional sql that encodes the table definition for derived tables." + }, + "tableId": { + "type": "string", + "description": "Encrypted unique alphanumeric identifier for the table." + } + } + }, + "TableList": { + "id": "TableList", + "type": "object", + "description": "Represents a list of tables.", + "properties": { + "items": { + "type": "array", + "description": "List of all requested tables.", + "items": { + "$ref": "Table" + } + }, + "kind": { + "type": "string", + "description": "Type name: a list of all tables.", + "default": "fusiontables#tableList" + }, + "nextPageToken": { + "type": "string", + "description": "Token used to access the next page of this result. No token is displayed if there are no more pages left." + } + } + }, + "Task": { + "id": "Task", + "type": "object", + "description": "Specifies the identifier, name, and type of a task in a table.", + "properties": { + "kind": { + "type": "string", + "description": "Type of the resource. This is always \"fusiontables#task\".", + "default": "fusiontables#task" + }, + "progress": { + "type": "string", + "description": "An indication of task progress." + }, + "started": { + "type": "boolean", + "description": "false while the table is busy with some other task. true if this background task is currently running." + }, + "taskId": { + "type": "string", + "description": "Identifier for the task.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "Type of background task. One of DELETE_ROWS Deletes one or more rows from the table. ADD_ROWS \"Adds one or more rows to a table. Includes importing data into a new table and importing more rows into an existing table. ADD_COLUMN Adds a new column to the table. CHANGE_TYPE Changes the type of a column." + } + } + }, + "TaskList": { + "id": "TaskList", + "type": "object", + "description": "Represents a list of tasks for a table.", + "properties": { + "items": { + "type": "array", + "description": "List of all requested tasks.", + "items": { + "$ref": "Task" + } + }, + "kind": { + "type": "string", + "description": "Type of the resource. This is always \"fusiontables#taskList\".", + "default": "fusiontables#taskList" + }, + "nextPageToken": { + "type": "string", + "description": "Token used to access the next page of this result. No token is displayed if there are no more pages left." + }, + "totalItems": { + "type": "integer", + "description": "Total number of tasks for the table.", + "format": "int32" + } + } + }, + "Template": { + "id": "Template", + "type": "object", + "description": "Represents the contents of InfoWindow templates.", + "properties": { + "automaticColumnNames": { + "type": "array", + "description": "List of columns from which the template is to be automatically constructed. Only one of body or automaticColumns can be specified.", + "items": { + "type": "string" + } + }, + "body": { + "type": "string", + "description": "Body of the template. It contains HTML with {column_name} to insert values from a particular column. The body is sanitized to remove certain tags, e.g., script. Only one of body or automaticColumns can be specified." + }, + "kind": { + "type": "string", + "description": "Type name: a template for the info window contents. The template can either include an HTML body or a list of columns from which the template is computed automatically.", + "default": "fusiontables#template" + }, + "name": { + "type": "string", + "description": "Optional name assigned to a template." + }, + "tableId": { + "type": "string", + "description": "Identifier for the table for which the template is defined." + }, + "templateId": { + "type": "integer", + "description": "Identifier for the template, unique within the context of a particular table.", + "format": "int32" + } + } + }, + "TemplateList": { + "id": "TemplateList", + "type": "object", + "description": "Represents a list of templates for a given table.", + "properties": { + "items": { + "type": "array", + "description": "List of all requested templates.", + "items": { + "$ref": "Template" + } + }, + "kind": { + "type": "string", + "description": "Type name: a list of all templates.", + "default": "fusiontables#templateList" + }, + "nextPageToken": { + "type": "string", + "description": "Token used to access the next page of this result. No token is displayed if there are no more pages left." + }, + "totalItems": { + "type": "integer", + "description": "Total number of templates for the table.", + "format": "int32" + } + } + } + }, + "resources": { + "column": { + "methods": { + "delete": { + "id": "fusiontables.column.delete", + "path": "tables/{tableId}/columns/{columnId}", + "httpMethod": "DELETE", + "description": "Deletes the column.", + "parameters": { + "columnId": { + "type": "string", + "description": "Name or identifier for the column being deleted.", + "required": true, + "location": "path" + }, + "tableId": { + "type": "string", + "description": "Table from which the column is being deleted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "columnId" + ], + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, + "get": { + "id": "fusiontables.column.get", + "path": "tables/{tableId}/columns/{columnId}", + "httpMethod": "GET", + "description": "Retrieves a specific column by its id.", + "parameters": { + "columnId": { + "type": "string", + "description": "Name or identifier for the column that is being requested.", + "required": true, + "location": "path" + }, + "tableId": { + "type": "string", + "description": "Table to which the column belongs.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "columnId" + ], + "response": { + "$ref": "Column" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables", + "https://www.googleapis.com/auth/fusiontables.readonly" + ] + }, + "insert": { + "id": "fusiontables.column.insert", + "path": "tables/{tableId}/columns", + "httpMethod": "POST", + "description": "Adds a new column to the table.", + "parameters": { + "tableId": { + "type": "string", + "description": "Table for which a new column is being added.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "request": { + "$ref": "Column" + }, + "response": { + "$ref": "Column" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, + "list": { + "id": "fusiontables.column.list", + "path": "tables/{tableId}/columns", + "httpMethod": "GET", + "description": "Retrieves a list of columns.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of columns to return. Optional. Default is 5.", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Continuation token specifying which result page to return. Optional.", + "location": "query" + }, + "tableId": { + "type": "string", + "description": "Table whose columns are being listed.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "response": { + "$ref": "ColumnList" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables", + "https://www.googleapis.com/auth/fusiontables.readonly" + ] + }, + "patch": { + "id": "fusiontables.column.patch", + "path": "tables/{tableId}/columns/{columnId}", + "httpMethod": "PATCH", + "description": "Updates the name or type of an existing column. This method supports patch semantics.", + "parameters": { + "columnId": { + "type": "string", + "description": "Name or identifier for the column that is being updated.", + "required": true, + "location": "path" + }, + "tableId": { + "type": "string", + "description": "Table for which the column is being updated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "columnId" + ], + "request": { + "$ref": "Column" + }, + "response": { + "$ref": "Column" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, + "update": { + "id": "fusiontables.column.update", + "path": "tables/{tableId}/columns/{columnId}", + "httpMethod": "PUT", + "description": "Updates the name or type of an existing column.", + "parameters": { + "columnId": { + "type": "string", + "description": "Name or identifier for the column that is being updated.", + "required": true, + "location": "path" + }, + "tableId": { + "type": "string", + "description": "Table for which the column is being updated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "columnId" + ], + "request": { + "$ref": "Column" + }, + "response": { + "$ref": "Column" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + } + } + }, + "query": { + "methods": { + "sql": { + "id": "fusiontables.query.sql", + "path": "query", + "httpMethod": "POST", + "description": "Executes an SQL SELECT/INSERT/UPDATE/DELETE/SHOW/DESCRIBE/CREATE statement.", + "parameters": { + "hdrs": { + "type": "boolean", + "description": "Should column names be included (in the first row)?. Default is true.", + "location": "query" + }, + "sql": { + "type": "string", + "description": "An SQL SELECT/SHOW/DESCRIBE/INSERT/UPDATE/DELETE/CREATE statement.", + "required": true, + "location": "query" + }, + "typed": { + "type": "boolean", + "description": "Should typed values be returned in the (JSON) response -- numbers for numeric values and parsed geometries for KML values? Default is true.", + "location": "query" + } + }, + "parameterOrder": [ + "sql" + ], + "response": { + "$ref": "Sqlresponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables", + "https://www.googleapis.com/auth/fusiontables.readonly" + ], + "supportsMediaDownload": true + }, + "sqlGet": { + "id": "fusiontables.query.sqlGet", + "path": "query", + "httpMethod": "GET", + "description": "Executes an SQL SELECT/SHOW/DESCRIBE statement.", + "parameters": { + "hdrs": { + "type": "boolean", + "description": "Should column names be included (in the first row)?. Default is true.", + "location": "query" + }, + "sql": { + "type": "string", + "description": "An SQL SELECT/SHOW/DESCRIBE statement.", + "required": true, + "location": "query" + }, + "typed": { + "type": "boolean", + "description": "Should typed values be returned in the (JSON) response -- numbers for numeric values and parsed geometries for KML values? Default is true.", + "location": "query" + } + }, + "parameterOrder": [ + "sql" + ], + "response": { + "$ref": "Sqlresponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables", + "https://www.googleapis.com/auth/fusiontables.readonly" + ], + "supportsMediaDownload": true + } + } + }, + "style": { + "methods": { + "delete": { + "id": "fusiontables.style.delete", + "path": "tables/{tableId}/styles/{styleId}", + "httpMethod": "DELETE", + "description": "Deletes a style.", + "parameters": { + "styleId": { + "type": "integer", + "description": "Identifier (within a table) for the style being deleted", + "required": true, + "format": "int32", + "location": "path" + }, + "tableId": { + "type": "string", + "description": "Table from which the style is being deleted", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "styleId" + ], + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, + "get": { + "id": "fusiontables.style.get", + "path": "tables/{tableId}/styles/{styleId}", + "httpMethod": "GET", + "description": "Gets a specific style.", + "parameters": { + "styleId": { + "type": "integer", + "description": "Identifier (integer) for a specific style in a table", + "required": true, + "format": "int32", + "location": "path" + }, + "tableId": { + "type": "string", + "description": "Table to which the requested style belongs", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "styleId" + ], + "response": { + "$ref": "StyleSetting" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables", + "https://www.googleapis.com/auth/fusiontables.readonly" + ] + }, + "insert": { + "id": "fusiontables.style.insert", + "path": "tables/{tableId}/styles", + "httpMethod": "POST", + "description": "Adds a new style for the table.", + "parameters": { + "tableId": { + "type": "string", + "description": "Table for which a new style is being added", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "request": { + "$ref": "StyleSetting" + }, + "response": { + "$ref": "StyleSetting" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, + "list": { + "id": "fusiontables.style.list", + "path": "tables/{tableId}/styles", + "httpMethod": "GET", + "description": "Retrieves a list of styles.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of styles to return. Optional. Default is 5.", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Continuation token specifying which result page to return. Optional.", + "location": "query" + }, + "tableId": { + "type": "string", + "description": "Table whose styles are being listed", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "response": { + "$ref": "StyleSettingList" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables", + "https://www.googleapis.com/auth/fusiontables.readonly" + ] + }, + "patch": { + "id": "fusiontables.style.patch", + "path": "tables/{tableId}/styles/{styleId}", + "httpMethod": "PATCH", + "description": "Updates an existing style. This method supports patch semantics.", + "parameters": { + "styleId": { + "type": "integer", + "description": "Identifier (within a table) for the style being updated.", + "required": true, + "format": "int32", + "location": "path" + }, + "tableId": { + "type": "string", + "description": "Table whose style is being updated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "styleId" + ], + "request": { + "$ref": "StyleSetting" + }, + "response": { + "$ref": "StyleSetting" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, + "update": { + "id": "fusiontables.style.update", + "path": "tables/{tableId}/styles/{styleId}", + "httpMethod": "PUT", + "description": "Updates an existing style.", + "parameters": { + "styleId": { + "type": "integer", + "description": "Identifier (within a table) for the style being updated.", + "required": true, + "format": "int32", + "location": "path" + }, + "tableId": { + "type": "string", + "description": "Table whose style is being updated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "styleId" + ], + "request": { + "$ref": "StyleSetting" + }, + "response": { + "$ref": "StyleSetting" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + } + } + }, + "table": { + "methods": { + "copy": { + "id": "fusiontables.table.copy", + "path": "tables/{tableId}/copy", + "httpMethod": "POST", + "description": "Copies a table.", + "parameters": { + "copyPresentation": { + "type": "boolean", + "description": "Whether to also copy tabs, styles, and templates. Default is false.", + "location": "query" + }, + "tableId": { + "type": "string", + "description": "ID of the table that is being copied.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "response": { + "$ref": "Table" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables", + "https://www.googleapis.com/auth/fusiontables.readonly" + ] + }, + "delete": { + "id": "fusiontables.table.delete", + "path": "tables/{tableId}", + "httpMethod": "DELETE", + "description": "Deletes a table.", + "parameters": { + "tableId": { + "type": "string", + "description": "ID of the table that is being deleted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, + "get": { + "id": "fusiontables.table.get", + "path": "tables/{tableId}", + "httpMethod": "GET", + "description": "Retrieves a specific table by its id.", + "parameters": { + "tableId": { + "type": "string", + "description": "Identifier(ID) for the table being requested.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "response": { + "$ref": "Table" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables", + "https://www.googleapis.com/auth/fusiontables.readonly" + ] + }, + "importRows": { + "id": "fusiontables.table.importRows", + "path": "tables/{tableId}/import", + "httpMethod": "POST", + "description": "Import more rows into a table.", + "parameters": { + "delimiter": { + "type": "string", + "description": "The delimiter used to separate cell values. This can only consist of a single character. Default is ','.", + "location": "query" + }, + "encoding": { + "type": "string", + "description": "The encoding of the content. Default is UTF-8. Use 'auto-detect' if you are unsure of the encoding.", + "location": "query" + }, + "endLine": { + "type": "integer", + "description": "The index of the last line from which to start importing, exclusive. Thus, the number of imported lines is endLine - startLine. If this parameter is not provided, the file will be imported until the last line of the file. If endLine is negative, then the imported content will exclude the last endLine lines. That is, if endline is negative, no line will be imported whose index is greater than N + endLine where N is the number of lines in the file, and the number of imported lines will be N + endLine - startLine.", + "format": "int32", + "location": "query" + }, + "isStrict": { + "type": "boolean", + "description": "Whether the CSV must have the same number of values for each row. If false, rows with fewer values will be padded with empty values. Default is true.", + "location": "query" + }, + "startLine": { + "type": "integer", + "description": "The index of the first line from which to start importing, inclusive. Default is 0.", + "format": "int32", + "location": "query" + }, + "tableId": { + "type": "string", + "description": "The table into which new rows are being imported.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "response": { + "$ref": "Import" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "application/octet-stream" + ], + "maxSize": "250MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/fusiontables/v1/tables/{tableId}/import" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/fusiontables/v1/tables/{tableId}/import" + } + } + } + }, + "importTable": { + "id": "fusiontables.table.importTable", + "path": "tables/import", + "httpMethod": "POST", + "description": "Import a new table.", + "parameters": { + "delimiter": { + "type": "string", + "description": "The delimiter used to separate cell values. This can only consist of a single character. Default is ','.", + "location": "query" + }, + "encoding": { + "type": "string", + "description": "The encoding of the content. Default is UTF-8. Use 'auto-detect' if you are unsure of the encoding.", + "location": "query" + }, + "name": { + "type": "string", + "description": "The name to be assigned to the new table.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Table" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "application/octet-stream" + ], + "maxSize": "250MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/fusiontables/v1/tables/import" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/fusiontables/v1/tables/import" + } + } + } + }, + "insert": { + "id": "fusiontables.table.insert", + "path": "tables", + "httpMethod": "POST", + "description": "Creates a new table.", + "request": { + "$ref": "Table" + }, + "response": { + "$ref": "Table" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, + "list": { + "id": "fusiontables.table.list", + "path": "tables", + "httpMethod": "GET", + "description": "Retrieves a list of tables a user owns.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of styles to return. Optional. Default is 5.", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Continuation token specifying which result page to return. Optional.", + "location": "query" + } + }, + "response": { + "$ref": "TableList" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables", + "https://www.googleapis.com/auth/fusiontables.readonly" + ] + }, + "patch": { + "id": "fusiontables.table.patch", + "path": "tables/{tableId}", + "httpMethod": "PATCH", + "description": "Updates an existing table. Unless explicitly requested, only the name, description, and attribution will be updated. This method supports patch semantics.", + "parameters": { + "replaceViewDefinition": { + "type": "boolean", + "description": "Should the view definition also be updated? The specified view definition replaces the existing one. Only a view can be updated with a new definition.", + "location": "query" + }, + "tableId": { + "type": "string", + "description": "ID of the table that is being updated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "request": { + "$ref": "Table" + }, + "response": { + "$ref": "Table" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, + "update": { + "id": "fusiontables.table.update", + "path": "tables/{tableId}", + "httpMethod": "PUT", + "description": "Updates an existing table. Unless explicitly requested, only the name, description, and attribution will be updated.", + "parameters": { + "replaceViewDefinition": { + "type": "boolean", + "description": "Should the view definition also be updated? The specified view definition replaces the existing one. Only a view can be updated with a new definition.", + "location": "query" + }, + "tableId": { + "type": "string", + "description": "ID of the table that is being updated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "request": { + "$ref": "Table" + }, + "response": { + "$ref": "Table" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + } + } + }, + "task": { + "methods": { + "delete": { + "id": "fusiontables.task.delete", + "path": "tables/{tableId}/tasks/{taskId}", + "httpMethod": "DELETE", + "description": "Deletes the task, unless already started.", + "parameters": { + "tableId": { + "type": "string", + "description": "Table from which the task is being deleted.", + "required": true, + "location": "path" + }, + "taskId": { + "type": "string", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "taskId" + ], + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, + "get": { + "id": "fusiontables.task.get", + "path": "tables/{tableId}/tasks/{taskId}", + "httpMethod": "GET", + "description": "Retrieves a specific task by its id.", + "parameters": { + "tableId": { + "type": "string", + "description": "Table to which the task belongs.", + "required": true, + "location": "path" + }, + "taskId": { + "type": "string", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "taskId" + ], + "response": { + "$ref": "Task" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables", + "https://www.googleapis.com/auth/fusiontables.readonly" + ] + }, + "list": { + "id": "fusiontables.task.list", + "path": "tables/{tableId}/tasks", + "httpMethod": "GET", + "description": "Retrieves a list of tasks.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of columns to return. Optional. Default is 5.", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "location": "query" + }, + "startIndex": { + "type": "integer", + "format": "uint32", + "location": "query" + }, + "tableId": { + "type": "string", + "description": "Table whose tasks are being listed.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "response": { + "$ref": "TaskList" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables", + "https://www.googleapis.com/auth/fusiontables.readonly" + ] + } + } + }, + "template": { + "methods": { + "delete": { + "id": "fusiontables.template.delete", + "path": "tables/{tableId}/templates/{templateId}", + "httpMethod": "DELETE", + "description": "Deletes a template", + "parameters": { + "tableId": { + "type": "string", + "description": "Table from which the template is being deleted", + "required": true, + "location": "path" + }, + "templateId": { + "type": "integer", + "description": "Identifier for the template which is being deleted", + "required": true, + "format": "int32", + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "templateId" + ], + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, + "get": { + "id": "fusiontables.template.get", + "path": "tables/{tableId}/templates/{templateId}", + "httpMethod": "GET", + "description": "Retrieves a specific template by its id", + "parameters": { + "tableId": { + "type": "string", + "description": "Table to which the template belongs", + "required": true, + "location": "path" + }, + "templateId": { + "type": "integer", + "description": "Identifier for the template that is being requested", + "required": true, + "format": "int32", + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "templateId" + ], + "response": { + "$ref": "Template" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables", + "https://www.googleapis.com/auth/fusiontables.readonly" + ] + }, + "insert": { + "id": "fusiontables.template.insert", + "path": "tables/{tableId}/templates", + "httpMethod": "POST", + "description": "Creates a new template for the table.", + "parameters": { + "tableId": { + "type": "string", + "description": "Table for which a new template is being created", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "request": { + "$ref": "Template" + }, + "response": { + "$ref": "Template" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, + "list": { + "id": "fusiontables.template.list", + "path": "tables/{tableId}/templates", + "httpMethod": "GET", + "description": "Retrieves a list of templates.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of templates to return. Optional. Default is 5.", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Continuation token specifying which results page to return. Optional.", + "location": "query" + }, + "tableId": { + "type": "string", + "description": "Identifier for the table whose templates are being requested", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "response": { + "$ref": "TemplateList" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables", + "https://www.googleapis.com/auth/fusiontables.readonly" + ] + }, + "patch": { + "id": "fusiontables.template.patch", + "path": "tables/{tableId}/templates/{templateId}", + "httpMethod": "PATCH", + "description": "Updates an existing template. This method supports patch semantics.", + "parameters": { + "tableId": { + "type": "string", + "description": "Table to which the updated template belongs", + "required": true, + "location": "path" + }, + "templateId": { + "type": "integer", + "description": "Identifier for the template that is being updated", + "required": true, + "format": "int32", + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "templateId" + ], + "request": { + "$ref": "Template" + }, + "response": { + "$ref": "Template" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, + "update": { + "id": "fusiontables.template.update", + "path": "tables/{tableId}/templates/{templateId}", + "httpMethod": "PUT", + "description": "Updates an existing template", + "parameters": { + "tableId": { + "type": "string", + "description": "Table to which the updated template belongs", + "required": true, + "location": "path" + }, + "templateId": { + "type": "integer", + "description": "Identifier for the template that is being updated", + "required": true, + "format": "int32", + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "templateId" + ], + "request": { + "$ref": "Template" + }, + "response": { + "$ref": "Template" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/fusiontables/v1/fusiontables-gen.go b/Godeps/_workspace/src/google.golang.org/api/fusiontables/v1/fusiontables-gen.go new file mode 100644 index 000000000..b8f39b4aa --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/fusiontables/v1/fusiontables-gen.go @@ -0,0 +1,5482 @@ +// Package fusiontables provides access to the Fusion Tables API. +// +// See https://developers.google.com/fusiontables +// +// Usage example: +// +// import "google.golang.org/api/fusiontables/v1" +// ... +// fusiontablesService, err := fusiontables.New(oauthHttpClient) +package fusiontables // import "google.golang.org/api/fusiontables/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "fusiontables:v1" +const apiName = "fusiontables" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/fusiontables/v1/" + +// OAuth2 scopes used by this API. +const ( + // Manage your Fusion Tables + FusiontablesScope = "https://www.googleapis.com/auth/fusiontables" + + // View your Fusion Tables + FusiontablesReadonlyScope = "https://www.googleapis.com/auth/fusiontables.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.Column = NewColumnService(s) + s.Query = NewQueryService(s) + s.Style = NewStyleService(s) + s.Table = NewTableService(s) + s.Task = NewTaskService(s) + s.Template = NewTemplateService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Column *ColumnService + + Query *QueryService + + Style *StyleService + + Table *TableService + + Task *TaskService + + Template *TemplateService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewColumnService(s *Service) *ColumnService { + rs := &ColumnService{s: s} + return rs +} + +type ColumnService struct { + s *Service +} + +func NewQueryService(s *Service) *QueryService { + rs := &QueryService{s: s} + return rs +} + +type QueryService struct { + s *Service +} + +func NewStyleService(s *Service) *StyleService { + rs := &StyleService{s: s} + return rs +} + +type StyleService struct { + s *Service +} + +func NewTableService(s *Service) *TableService { + rs := &TableService{s: s} + return rs +} + +type TableService struct { + s *Service +} + +func NewTaskService(s *Service) *TaskService { + rs := &TaskService{s: s} + return rs +} + +type TaskService struct { + s *Service +} + +func NewTemplateService(s *Service) *TemplateService { + rs := &TemplateService{s: s} + return rs +} + +type TemplateService struct { + s *Service +} + +// Bucket: Specifies the minimum and maximum values, the color, opacity, +// icon and weight of a bucket within a StyleSetting. +type Bucket struct { + // Color: Color of line or the interior of a polygon in #RRGGBB format. + Color string `json:"color,omitempty"` + + // Icon: Icon name used for a point. + Icon string `json:"icon,omitempty"` + + // Max: Maximum value in the selected column for a row to be styled + // according to the bucket color, opacity, icon, or weight. + Max float64 `json:"max,omitempty"` + + // Min: Minimum value in the selected column for a row to be styled + // according to the bucket color, opacity, icon, or weight. + Min float64 `json:"min,omitempty"` + + // Opacity: Opacity of the color: 0.0 (transparent) to 1.0 (opaque). + Opacity float64 `json:"opacity,omitempty"` + + // Weight: Width of a line (in pixels). + Weight int64 `json:"weight,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Color") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Bucket) MarshalJSON() ([]byte, error) { + type noMethod Bucket + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Column: Specifies the id, name and type of a column in a table. +type Column struct { + // BaseColumn: Optional identifier of the base column. If present, this + // column is derived from the specified base column. + BaseColumn *ColumnBaseColumn `json:"baseColumn,omitempty"` + + // ColumnId: Identifier for the column. + ColumnId int64 `json:"columnId,omitempty"` + + // Description: Optional column description. + Description string `json:"description,omitempty"` + + // GraphPredicate: Optional column predicate. Used to map table to graph + // data model (subject,predicate,object) See + // http://www.w3.org/TR/2014/REC-rdf11-concepts-20140225/#data-model + GraphPredicate string `json:"graph_predicate,omitempty"` + + // Kind: Type name: a template for an individual column. + Kind string `json:"kind,omitempty"` + + // Name: Required name of the column. + Name string `json:"name,omitempty"` + + // Type: Required type of the column. + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BaseColumn") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Column) MarshalJSON() ([]byte, error) { + type noMethod Column + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ColumnBaseColumn: Optional identifier of the base column. If present, +// this column is derived from the specified base column. +type ColumnBaseColumn struct { + // ColumnId: The id of the column in the base table from which this + // column is derived. + ColumnId int64 `json:"columnId,omitempty"` + + // TableIndex: Offset to the entry in the list of base tables in the + // table definition. + TableIndex int64 `json:"tableIndex,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ColumnId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ColumnBaseColumn) MarshalJSON() ([]byte, error) { + type noMethod ColumnBaseColumn + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ColumnList: Represents a list of columns in a table. +type ColumnList struct { + // Items: List of all requested columns. + Items []*Column `json:"items,omitempty"` + + // Kind: Type name: a list of all columns. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token used to access the next page of this result. No + // token is displayed if there are no more pages left. + NextPageToken string `json:"nextPageToken,omitempty"` + + // TotalItems: Total number of columns for the table. + TotalItems int64 `json:"totalItems,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ColumnList) MarshalJSON() ([]byte, error) { + type noMethod ColumnList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Geometry: Represents a Geometry object. +type Geometry struct { + // Geometries: The list of geometries in this geometry collection. + Geometries []interface{} `json:"geometries,omitempty"` + + Geometry interface{} `json:"geometry,omitempty"` + + // Type: Type: A collection of geometries. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Geometries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Geometry) MarshalJSON() ([]byte, error) { + type noMethod Geometry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Import: Represents an import request. +type Import struct { + // Kind: Type name: a template for an import request. + Kind string `json:"kind,omitempty"` + + // NumRowsReceived: The number of rows received from the import request. + NumRowsReceived int64 `json:"numRowsReceived,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Import) MarshalJSON() ([]byte, error) { + type noMethod Import + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Line: Represents a line geometry. +type Line struct { + // Coordinates: The coordinates that define the line. + Coordinates [][]float64 `json:"coordinates,omitempty"` + + // Type: Type: A line geometry. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Coordinates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Line) MarshalJSON() ([]byte, error) { + type noMethod Line + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LineStyle: Represents a LineStyle within a StyleSetting +type LineStyle struct { + // StrokeColor: Color of the line in #RRGGBB format. + StrokeColor string `json:"strokeColor,omitempty"` + + // StrokeColorStyler: Column-value, gradient or buckets styler that is + // used to determine the line color and opacity. + StrokeColorStyler *StyleFunction `json:"strokeColorStyler,omitempty"` + + // StrokeOpacity: Opacity of the line : 0.0 (transparent) to 1.0 + // (opaque). + StrokeOpacity float64 `json:"strokeOpacity,omitempty"` + + // StrokeWeight: Width of the line in pixels. + StrokeWeight int64 `json:"strokeWeight,omitempty"` + + // StrokeWeightStyler: Column-value or bucket styler that is used to + // determine the width of the line. + StrokeWeightStyler *StyleFunction `json:"strokeWeightStyler,omitempty"` + + // ForceSendFields is a list of field names (e.g. "StrokeColor") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LineStyle) MarshalJSON() ([]byte, error) { + type noMethod LineStyle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Point: Represents a point object. +type Point struct { + // Coordinates: The coordinates that define the point. + Coordinates []float64 `json:"coordinates,omitempty"` + + // Type: Point: A point geometry. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Coordinates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Point) MarshalJSON() ([]byte, error) { + type noMethod Point + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PointStyle: Represents a PointStyle within a StyleSetting +type PointStyle struct { + // IconName: Name of the icon. Use values defined in + // http://www.google.com/fusiontables/DataSource?dsrcid=308519 + IconName string `json:"iconName,omitempty"` + + // IconStyler: Column or a bucket value from which the icon name is to + // be determined. + IconStyler *StyleFunction `json:"iconStyler,omitempty"` + + // ForceSendFields is a list of field names (e.g. "IconName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PointStyle) MarshalJSON() ([]byte, error) { + type noMethod PointStyle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Polygon: Represents a polygon object. +type Polygon struct { + // Coordinates: The coordinates that define the polygon. + Coordinates [][][]float64 `json:"coordinates,omitempty"` + + // Type: Type: A polygon geometry. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Coordinates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Polygon) MarshalJSON() ([]byte, error) { + type noMethod Polygon + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PolygonStyle: Represents a PolygonStyle within a StyleSetting +type PolygonStyle struct { + // FillColor: Color of the interior of the polygon in #RRGGBB format. + FillColor string `json:"fillColor,omitempty"` + + // FillColorStyler: Column-value, gradient, or bucket styler that is + // used to determine the interior color and opacity of the polygon. + FillColorStyler *StyleFunction `json:"fillColorStyler,omitempty"` + + // FillOpacity: Opacity of the interior of the polygon: 0.0 + // (transparent) to 1.0 (opaque). + FillOpacity float64 `json:"fillOpacity,omitempty"` + + // StrokeColor: Color of the polygon border in #RRGGBB format. + StrokeColor string `json:"strokeColor,omitempty"` + + // StrokeColorStyler: Column-value, gradient or buckets styler that is + // used to determine the border color and opacity. + StrokeColorStyler *StyleFunction `json:"strokeColorStyler,omitempty"` + + // StrokeOpacity: Opacity of the polygon border: 0.0 (transparent) to + // 1.0 (opaque). + StrokeOpacity float64 `json:"strokeOpacity,omitempty"` + + // StrokeWeight: Width of the polyon border in pixels. + StrokeWeight int64 `json:"strokeWeight,omitempty"` + + // StrokeWeightStyler: Column-value or bucket styler that is used to + // determine the width of the polygon border. + StrokeWeightStyler *StyleFunction `json:"strokeWeightStyler,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FillColor") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PolygonStyle) MarshalJSON() ([]byte, error) { + type noMethod PolygonStyle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Sqlresponse: Represents a response to an sql statement. +type Sqlresponse struct { + // Columns: Columns in the table. + Columns []string `json:"columns,omitempty"` + + // Kind: Type name: a template for an individual table. + Kind string `json:"kind,omitempty"` + + // Rows: The rows in the table. For each cell we print out whatever cell + // value (e.g., numeric, string) exists. Thus it is important that each + // cell contains only one value. + Rows [][]interface{} `json:"rows,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Columns") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Sqlresponse) MarshalJSON() ([]byte, error) { + type noMethod Sqlresponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// StyleFunction: Represents a StyleFunction within a StyleSetting +type StyleFunction struct { + // Buckets: Bucket function that assigns a style based on the range a + // column value falls into. + Buckets []*Bucket `json:"buckets,omitempty"` + + // ColumnName: Name of the column whose value is used in the style. + ColumnName string `json:"columnName,omitempty"` + + // Gradient: Gradient function that interpolates a range of colors based + // on column value. + Gradient *StyleFunctionGradient `json:"gradient,omitempty"` + + // Kind: Stylers can be one of three kinds: "fusiontables#fromColumn" if + // the column value is to be used as is, i.e., the column values can + // have colors in #RRGGBBAA format or integer line widths or icon names; + // "fusiontables#gradient" if the styling of the row is to be based on + // applying the gradient function on the column value; or + // "fusiontables#buckets" if the styling is to based on the bucket into + // which the the column value falls. + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Buckets") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *StyleFunction) MarshalJSON() ([]byte, error) { + type noMethod StyleFunction + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// StyleFunctionGradient: Gradient function that interpolates a range of +// colors based on column value. +type StyleFunctionGradient struct { + // Colors: Array with two or more colors. + Colors []*StyleFunctionGradientColors `json:"colors,omitempty"` + + // Max: Higher-end of the interpolation range: rows with this value will + // be assigned to colors[n-1]. + Max float64 `json:"max,omitempty"` + + // Min: Lower-end of the interpolation range: rows with this value will + // be assigned to colors[0]. + Min float64 `json:"min,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Colors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *StyleFunctionGradient) MarshalJSON() ([]byte, error) { + type noMethod StyleFunctionGradient + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type StyleFunctionGradientColors struct { + // Color: Color in #RRGGBB format. + Color string `json:"color,omitempty"` + + // Opacity: Opacity of the color: 0.0 (transparent) to 1.0 (opaque). + Opacity float64 `json:"opacity,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Color") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *StyleFunctionGradientColors) MarshalJSON() ([]byte, error) { + type noMethod StyleFunctionGradientColors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// StyleSetting: Represents a complete StyleSettings object. The primary +// key is a combination of the tableId and a styleId. +type StyleSetting struct { + // Kind: Type name: an individual style setting. A StyleSetting contains + // the style defintions for points, lines, and polygons in a table. + // Since a table can have any one or all of them, a style definition can + // have point, line and polygon style definitions. + Kind string `json:"kind,omitempty"` + + // MarkerOptions: Style definition for points in the table. + MarkerOptions *PointStyle `json:"markerOptions,omitempty"` + + // Name: Optional name for the style setting. + Name string `json:"name,omitempty"` + + // PolygonOptions: Style definition for polygons in the table. + PolygonOptions *PolygonStyle `json:"polygonOptions,omitempty"` + + // PolylineOptions: Style definition for lines in the table. + PolylineOptions *LineStyle `json:"polylineOptions,omitempty"` + + // StyleId: Identifier for the style setting (unique only within + // tables). + StyleId int64 `json:"styleId,omitempty"` + + // TableId: Identifier for the table. + TableId string `json:"tableId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *StyleSetting) MarshalJSON() ([]byte, error) { + type noMethod StyleSetting + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// StyleSettingList: Represents a list of styles for a given table. +type StyleSettingList struct { + // Items: All requested style settings. + Items []*StyleSetting `json:"items,omitempty"` + + // Kind: Type name: in this case, a list of style settings. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token used to access the next page of this result. No + // token is displayed if there are no more pages left. + NextPageToken string `json:"nextPageToken,omitempty"` + + // TotalItems: Total number of styles for the table. + TotalItems int64 `json:"totalItems,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *StyleSettingList) MarshalJSON() ([]byte, error) { + type noMethod StyleSettingList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Table: Represents a table. Specifies the name, whether it is +// exportable, description, attribution, and attribution link. +type Table struct { + // Attribution: Optional attribution assigned to the table. + Attribution string `json:"attribution,omitempty"` + + // AttributionLink: Optional link for attribution. + AttributionLink string `json:"attributionLink,omitempty"` + + // BaseTableIds: Optional base table identifier if this table is a view + // or merged table. + BaseTableIds []string `json:"baseTableIds,omitempty"` + + // Columns: Columns in the table. + Columns []*Column `json:"columns,omitempty"` + + // Description: Optional description assigned to the table. + Description string `json:"description,omitempty"` + + // IsExportable: Variable for whether table is exportable. + IsExportable bool `json:"isExportable,omitempty"` + + // Kind: Type name: a template for an individual table. + Kind string `json:"kind,omitempty"` + + // Name: Name assigned to a table. + Name string `json:"name,omitempty"` + + // Sql: Optional sql that encodes the table definition for derived + // tables. + Sql string `json:"sql,omitempty"` + + // TableId: Encrypted unique alphanumeric identifier for the table. + TableId string `json:"tableId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Attribution") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Table) MarshalJSON() ([]byte, error) { + type noMethod Table + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TableList: Represents a list of tables. +type TableList struct { + // Items: List of all requested tables. + Items []*Table `json:"items,omitempty"` + + // Kind: Type name: a list of all tables. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token used to access the next page of this result. No + // token is displayed if there are no more pages left. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TableList) MarshalJSON() ([]byte, error) { + type noMethod TableList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Task: Specifies the identifier, name, and type of a task in a table. +type Task struct { + // Kind: Type of the resource. This is always "fusiontables#task". + Kind string `json:"kind,omitempty"` + + // Progress: An indication of task progress. + Progress string `json:"progress,omitempty"` + + // Started: false while the table is busy with some other task. true if + // this background task is currently running. + Started bool `json:"started,omitempty"` + + // TaskId: Identifier for the task. + TaskId int64 `json:"taskId,omitempty,string"` + + // Type: Type of background task. One of DELETE_ROWS Deletes one or + // more rows from the table. ADD_ROWS "Adds one or more rows to a table. + // Includes importing data into a new table and importing more rows into + // an existing table. ADD_COLUMN Adds a new column to the table. + // CHANGE_TYPE Changes the type of a column. + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Task) MarshalJSON() ([]byte, error) { + type noMethod Task + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TaskList: Represents a list of tasks for a table. +type TaskList struct { + // Items: List of all requested tasks. + Items []*Task `json:"items,omitempty"` + + // Kind: Type of the resource. This is always "fusiontables#taskList". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token used to access the next page of this result. No + // token is displayed if there are no more pages left. + NextPageToken string `json:"nextPageToken,omitempty"` + + // TotalItems: Total number of tasks for the table. + TotalItems int64 `json:"totalItems,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TaskList) MarshalJSON() ([]byte, error) { + type noMethod TaskList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Template: Represents the contents of InfoWindow templates. +type Template struct { + // AutomaticColumnNames: List of columns from which the template is to + // be automatically constructed. Only one of body or automaticColumns + // can be specified. + AutomaticColumnNames []string `json:"automaticColumnNames,omitempty"` + + // Body: Body of the template. It contains HTML with {column_name} to + // insert values from a particular column. The body is sanitized to + // remove certain tags, e.g., script. Only one of body or + // automaticColumns can be specified. + Body string `json:"body,omitempty"` + + // Kind: Type name: a template for the info window contents. The + // template can either include an HTML body or a list of columns from + // which the template is computed automatically. + Kind string `json:"kind,omitempty"` + + // Name: Optional name assigned to a template. + Name string `json:"name,omitempty"` + + // TableId: Identifier for the table for which the template is defined. + TableId string `json:"tableId,omitempty"` + + // TemplateId: Identifier for the template, unique within the context of + // a particular table. + TemplateId int64 `json:"templateId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "AutomaticColumnNames") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Template) MarshalJSON() ([]byte, error) { + type noMethod Template + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TemplateList: Represents a list of templates for a given table. +type TemplateList struct { + // Items: List of all requested templates. + Items []*Template `json:"items,omitempty"` + + // Kind: Type name: a list of all templates. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token used to access the next page of this result. No + // token is displayed if there are no more pages left. + NextPageToken string `json:"nextPageToken,omitempty"` + + // TotalItems: Total number of templates for the table. + TotalItems int64 `json:"totalItems,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TemplateList) MarshalJSON() ([]byte, error) { + type noMethod TemplateList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "fusiontables.column.delete": + +type ColumnDeleteCall struct { + s *Service + tableId string + columnId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the column. +func (r *ColumnService) Delete(tableId string, columnId string) *ColumnDeleteCall { + c := &ColumnDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.columnId = columnId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ColumnDeleteCall) Fields(s ...googleapi.Field) *ColumnDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ColumnDeleteCall) Context(ctx context.Context) *ColumnDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ColumnDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/columns/{columnId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "columnId": c.columnId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.column.delete" call. +func (c *ColumnDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the column.", + // "httpMethod": "DELETE", + // "id": "fusiontables.column.delete", + // "parameterOrder": [ + // "tableId", + // "columnId" + // ], + // "parameters": { + // "columnId": { + // "description": "Name or identifier for the column being deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tableId": { + // "description": "Table from which the column is being deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/columns/{columnId}", + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.column.get": + +type ColumnGetCall struct { + s *Service + tableId string + columnId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves a specific column by its id. +func (r *ColumnService) Get(tableId string, columnId string) *ColumnGetCall { + c := &ColumnGetCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.columnId = columnId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ColumnGetCall) Fields(s ...googleapi.Field) *ColumnGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ColumnGetCall) IfNoneMatch(entityTag string) *ColumnGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ColumnGetCall) Context(ctx context.Context) *ColumnGetCall { + c.ctx_ = ctx + return c +} + +func (c *ColumnGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/columns/{columnId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "columnId": c.columnId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.column.get" call. +// Exactly one of *Column or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Column.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ColumnGetCall) Do() (*Column, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Column{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a specific column by its id.", + // "httpMethod": "GET", + // "id": "fusiontables.column.get", + // "parameterOrder": [ + // "tableId", + // "columnId" + // ], + // "parameters": { + // "columnId": { + // "description": "Name or identifier for the column that is being requested.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tableId": { + // "description": "Table to which the column belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/columns/{columnId}", + // "response": { + // "$ref": "Column" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables", + // "https://www.googleapis.com/auth/fusiontables.readonly" + // ] + // } + +} + +// method id "fusiontables.column.insert": + +type ColumnInsertCall struct { + s *Service + tableId string + column *Column + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Adds a new column to the table. +func (r *ColumnService) Insert(tableId string, column *Column) *ColumnInsertCall { + c := &ColumnInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.column = column + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ColumnInsertCall) Fields(s ...googleapi.Field) *ColumnInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ColumnInsertCall) Context(ctx context.Context) *ColumnInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ColumnInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.column) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/columns") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.column.insert" call. +// Exactly one of *Column or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Column.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ColumnInsertCall) Do() (*Column, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Column{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds a new column to the table.", + // "httpMethod": "POST", + // "id": "fusiontables.column.insert", + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "tableId": { + // "description": "Table for which a new column is being added.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/columns", + // "request": { + // "$ref": "Column" + // }, + // "response": { + // "$ref": "Column" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.column.list": + +type ColumnListCall struct { + s *Service + tableId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of columns. +func (r *ColumnService) List(tableId string) *ColumnListCall { + c := &ColumnListCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of columns to return. Default is 5. +func (c *ColumnListCall) MaxResults(maxResults int64) *ColumnListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +// specifying which result page to return. +func (c *ColumnListCall) PageToken(pageToken string) *ColumnListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ColumnListCall) Fields(s ...googleapi.Field) *ColumnListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ColumnListCall) IfNoneMatch(entityTag string) *ColumnListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ColumnListCall) Context(ctx context.Context) *ColumnListCall { + c.ctx_ = ctx + return c +} + +func (c *ColumnListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/columns") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.column.list" call. +// Exactly one of *ColumnList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ColumnList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ColumnListCall) Do() (*ColumnList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ColumnList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of columns.", + // "httpMethod": "GET", + // "id": "fusiontables.column.list", + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of columns to return. Optional. Default is 5.", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Continuation token specifying which result page to return. Optional.", + // "location": "query", + // "type": "string" + // }, + // "tableId": { + // "description": "Table whose columns are being listed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/columns", + // "response": { + // "$ref": "ColumnList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables", + // "https://www.googleapis.com/auth/fusiontables.readonly" + // ] + // } + +} + +// method id "fusiontables.column.patch": + +type ColumnPatchCall struct { + s *Service + tableId string + columnId string + column *Column + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates the name or type of an existing column. This method +// supports patch semantics. +func (r *ColumnService) Patch(tableId string, columnId string, column *Column) *ColumnPatchCall { + c := &ColumnPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.columnId = columnId + c.column = column + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ColumnPatchCall) Fields(s ...googleapi.Field) *ColumnPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ColumnPatchCall) Context(ctx context.Context) *ColumnPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ColumnPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.column) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/columns/{columnId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "columnId": c.columnId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.column.patch" call. +// Exactly one of *Column or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Column.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ColumnPatchCall) Do() (*Column, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Column{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the name or type of an existing column. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "fusiontables.column.patch", + // "parameterOrder": [ + // "tableId", + // "columnId" + // ], + // "parameters": { + // "columnId": { + // "description": "Name or identifier for the column that is being updated.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tableId": { + // "description": "Table for which the column is being updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/columns/{columnId}", + // "request": { + // "$ref": "Column" + // }, + // "response": { + // "$ref": "Column" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.column.update": + +type ColumnUpdateCall struct { + s *Service + tableId string + columnId string + column *Column + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates the name or type of an existing column. +func (r *ColumnService) Update(tableId string, columnId string, column *Column) *ColumnUpdateCall { + c := &ColumnUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.columnId = columnId + c.column = column + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ColumnUpdateCall) Fields(s ...googleapi.Field) *ColumnUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ColumnUpdateCall) Context(ctx context.Context) *ColumnUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ColumnUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.column) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/columns/{columnId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "columnId": c.columnId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.column.update" call. +// Exactly one of *Column or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Column.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ColumnUpdateCall) Do() (*Column, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Column{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the name or type of an existing column.", + // "httpMethod": "PUT", + // "id": "fusiontables.column.update", + // "parameterOrder": [ + // "tableId", + // "columnId" + // ], + // "parameters": { + // "columnId": { + // "description": "Name or identifier for the column that is being updated.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tableId": { + // "description": "Table for which the column is being updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/columns/{columnId}", + // "request": { + // "$ref": "Column" + // }, + // "response": { + // "$ref": "Column" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.query.sql": + +type QuerySqlCall struct { + s *Service + sql string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Sql: Executes an SQL SELECT/INSERT/UPDATE/DELETE/SHOW/DESCRIBE/CREATE +// statement. +func (r *QueryService) Sql(sql string) *QuerySqlCall { + c := &QuerySqlCall{s: r.s, opt_: make(map[string]interface{})} + c.sql = sql + return c +} + +// Hdrs sets the optional parameter "hdrs": Should column names be +// included (in the first row)?. Default is true. +func (c *QuerySqlCall) Hdrs(hdrs bool) *QuerySqlCall { + c.opt_["hdrs"] = hdrs + return c +} + +// Typed sets the optional parameter "typed": Should typed values be +// returned in the (JSON) response -- numbers for numeric values and +// parsed geometries for KML values? Default is true. +func (c *QuerySqlCall) Typed(typed bool) *QuerySqlCall { + c.opt_["typed"] = typed + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *QuerySqlCall) Fields(s ...googleapi.Field) *QuerySqlCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *QuerySqlCall) Context(ctx context.Context) *QuerySqlCall { + c.ctx_ = ctx + return c +} + +func (c *QuerySqlCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("sql", fmt.Sprintf("%v", c.sql)) + if v, ok := c.opt_["hdrs"]; ok { + params.Set("hdrs", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["typed"]; ok { + params.Set("typed", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "query") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *QuerySqlCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "fusiontables.query.sql" call. +// Exactly one of *Sqlresponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Sqlresponse.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *QuerySqlCall) Do() (*Sqlresponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Sqlresponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Executes an SQL SELECT/INSERT/UPDATE/DELETE/SHOW/DESCRIBE/CREATE statement.", + // "httpMethod": "POST", + // "id": "fusiontables.query.sql", + // "parameterOrder": [ + // "sql" + // ], + // "parameters": { + // "hdrs": { + // "description": "Should column names be included (in the first row)?. Default is true.", + // "location": "query", + // "type": "boolean" + // }, + // "sql": { + // "description": "An SQL SELECT/SHOW/DESCRIBE/INSERT/UPDATE/DELETE/CREATE statement.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "typed": { + // "description": "Should typed values be returned in the (JSON) response -- numbers for numeric values and parsed geometries for KML values? Default is true.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "query", + // "response": { + // "$ref": "Sqlresponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables", + // "https://www.googleapis.com/auth/fusiontables.readonly" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "fusiontables.query.sqlGet": + +type QuerySqlGetCall struct { + s *Service + sql string + opt_ map[string]interface{} + ctx_ context.Context +} + +// SqlGet: Executes an SQL SELECT/SHOW/DESCRIBE statement. +func (r *QueryService) SqlGet(sql string) *QuerySqlGetCall { + c := &QuerySqlGetCall{s: r.s, opt_: make(map[string]interface{})} + c.sql = sql + return c +} + +// Hdrs sets the optional parameter "hdrs": Should column names be +// included (in the first row)?. Default is true. +func (c *QuerySqlGetCall) Hdrs(hdrs bool) *QuerySqlGetCall { + c.opt_["hdrs"] = hdrs + return c +} + +// Typed sets the optional parameter "typed": Should typed values be +// returned in the (JSON) response -- numbers for numeric values and +// parsed geometries for KML values? Default is true. +func (c *QuerySqlGetCall) Typed(typed bool) *QuerySqlGetCall { + c.opt_["typed"] = typed + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *QuerySqlGetCall) Fields(s ...googleapi.Field) *QuerySqlGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *QuerySqlGetCall) IfNoneMatch(entityTag string) *QuerySqlGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *QuerySqlGetCall) Context(ctx context.Context) *QuerySqlGetCall { + c.ctx_ = ctx + return c +} + +func (c *QuerySqlGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("sql", fmt.Sprintf("%v", c.sql)) + if v, ok := c.opt_["hdrs"]; ok { + params.Set("hdrs", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["typed"]; ok { + params.Set("typed", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "query") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *QuerySqlGetCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "fusiontables.query.sqlGet" call. +// Exactly one of *Sqlresponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Sqlresponse.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *QuerySqlGetCall) Do() (*Sqlresponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Sqlresponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Executes an SQL SELECT/SHOW/DESCRIBE statement.", + // "httpMethod": "GET", + // "id": "fusiontables.query.sqlGet", + // "parameterOrder": [ + // "sql" + // ], + // "parameters": { + // "hdrs": { + // "description": "Should column names be included (in the first row)?. Default is true.", + // "location": "query", + // "type": "boolean" + // }, + // "sql": { + // "description": "An SQL SELECT/SHOW/DESCRIBE statement.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "typed": { + // "description": "Should typed values be returned in the (JSON) response -- numbers for numeric values and parsed geometries for KML values? Default is true.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "query", + // "response": { + // "$ref": "Sqlresponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables", + // "https://www.googleapis.com/auth/fusiontables.readonly" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "fusiontables.style.delete": + +type StyleDeleteCall struct { + s *Service + tableId string + styleId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a style. +func (r *StyleService) Delete(tableId string, styleId int64) *StyleDeleteCall { + c := &StyleDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.styleId = styleId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *StyleDeleteCall) Fields(s ...googleapi.Field) *StyleDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *StyleDeleteCall) Context(ctx context.Context) *StyleDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *StyleDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/styles/{styleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "styleId": strconv.FormatInt(c.styleId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.style.delete" call. +func (c *StyleDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a style.", + // "httpMethod": "DELETE", + // "id": "fusiontables.style.delete", + // "parameterOrder": [ + // "tableId", + // "styleId" + // ], + // "parameters": { + // "styleId": { + // "description": "Identifier (within a table) for the style being deleted", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "tableId": { + // "description": "Table from which the style is being deleted", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/styles/{styleId}", + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.style.get": + +type StyleGetCall struct { + s *Service + tableId string + styleId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a specific style. +func (r *StyleService) Get(tableId string, styleId int64) *StyleGetCall { + c := &StyleGetCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.styleId = styleId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *StyleGetCall) Fields(s ...googleapi.Field) *StyleGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *StyleGetCall) IfNoneMatch(entityTag string) *StyleGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *StyleGetCall) Context(ctx context.Context) *StyleGetCall { + c.ctx_ = ctx + return c +} + +func (c *StyleGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/styles/{styleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "styleId": strconv.FormatInt(c.styleId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.style.get" call. +// Exactly one of *StyleSetting or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *StyleSetting.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *StyleGetCall) Do() (*StyleSetting, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &StyleSetting{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a specific style.", + // "httpMethod": "GET", + // "id": "fusiontables.style.get", + // "parameterOrder": [ + // "tableId", + // "styleId" + // ], + // "parameters": { + // "styleId": { + // "description": "Identifier (integer) for a specific style in a table", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "tableId": { + // "description": "Table to which the requested style belongs", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/styles/{styleId}", + // "response": { + // "$ref": "StyleSetting" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables", + // "https://www.googleapis.com/auth/fusiontables.readonly" + // ] + // } + +} + +// method id "fusiontables.style.insert": + +type StyleInsertCall struct { + s *Service + tableId string + stylesetting *StyleSetting + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Adds a new style for the table. +func (r *StyleService) Insert(tableId string, stylesetting *StyleSetting) *StyleInsertCall { + c := &StyleInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.stylesetting = stylesetting + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *StyleInsertCall) Fields(s ...googleapi.Field) *StyleInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *StyleInsertCall) Context(ctx context.Context) *StyleInsertCall { + c.ctx_ = ctx + return c +} + +func (c *StyleInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.stylesetting) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/styles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.style.insert" call. +// Exactly one of *StyleSetting or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *StyleSetting.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *StyleInsertCall) Do() (*StyleSetting, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &StyleSetting{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds a new style for the table.", + // "httpMethod": "POST", + // "id": "fusiontables.style.insert", + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "tableId": { + // "description": "Table for which a new style is being added", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/styles", + // "request": { + // "$ref": "StyleSetting" + // }, + // "response": { + // "$ref": "StyleSetting" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.style.list": + +type StyleListCall struct { + s *Service + tableId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of styles. +func (r *StyleService) List(tableId string) *StyleListCall { + c := &StyleListCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of styles to return. Default is 5. +func (c *StyleListCall) MaxResults(maxResults int64) *StyleListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +// specifying which result page to return. +func (c *StyleListCall) PageToken(pageToken string) *StyleListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *StyleListCall) Fields(s ...googleapi.Field) *StyleListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *StyleListCall) IfNoneMatch(entityTag string) *StyleListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *StyleListCall) Context(ctx context.Context) *StyleListCall { + c.ctx_ = ctx + return c +} + +func (c *StyleListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/styles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.style.list" call. +// Exactly one of *StyleSettingList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *StyleSettingList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *StyleListCall) Do() (*StyleSettingList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &StyleSettingList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of styles.", + // "httpMethod": "GET", + // "id": "fusiontables.style.list", + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of styles to return. Optional. Default is 5.", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Continuation token specifying which result page to return. Optional.", + // "location": "query", + // "type": "string" + // }, + // "tableId": { + // "description": "Table whose styles are being listed", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/styles", + // "response": { + // "$ref": "StyleSettingList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables", + // "https://www.googleapis.com/auth/fusiontables.readonly" + // ] + // } + +} + +// method id "fusiontables.style.patch": + +type StylePatchCall struct { + s *Service + tableId string + styleId int64 + stylesetting *StyleSetting + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing style. This method supports patch +// semantics. +func (r *StyleService) Patch(tableId string, styleId int64, stylesetting *StyleSetting) *StylePatchCall { + c := &StylePatchCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.styleId = styleId + c.stylesetting = stylesetting + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *StylePatchCall) Fields(s ...googleapi.Field) *StylePatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *StylePatchCall) Context(ctx context.Context) *StylePatchCall { + c.ctx_ = ctx + return c +} + +func (c *StylePatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.stylesetting) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/styles/{styleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "styleId": strconv.FormatInt(c.styleId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.style.patch" call. +// Exactly one of *StyleSetting or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *StyleSetting.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *StylePatchCall) Do() (*StyleSetting, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &StyleSetting{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing style. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "fusiontables.style.patch", + // "parameterOrder": [ + // "tableId", + // "styleId" + // ], + // "parameters": { + // "styleId": { + // "description": "Identifier (within a table) for the style being updated.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "tableId": { + // "description": "Table whose style is being updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/styles/{styleId}", + // "request": { + // "$ref": "StyleSetting" + // }, + // "response": { + // "$ref": "StyleSetting" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.style.update": + +type StyleUpdateCall struct { + s *Service + tableId string + styleId int64 + stylesetting *StyleSetting + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing style. +func (r *StyleService) Update(tableId string, styleId int64, stylesetting *StyleSetting) *StyleUpdateCall { + c := &StyleUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.styleId = styleId + c.stylesetting = stylesetting + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *StyleUpdateCall) Fields(s ...googleapi.Field) *StyleUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *StyleUpdateCall) Context(ctx context.Context) *StyleUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *StyleUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.stylesetting) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/styles/{styleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "styleId": strconv.FormatInt(c.styleId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.style.update" call. +// Exactly one of *StyleSetting or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *StyleSetting.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *StyleUpdateCall) Do() (*StyleSetting, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &StyleSetting{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing style.", + // "httpMethod": "PUT", + // "id": "fusiontables.style.update", + // "parameterOrder": [ + // "tableId", + // "styleId" + // ], + // "parameters": { + // "styleId": { + // "description": "Identifier (within a table) for the style being updated.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "tableId": { + // "description": "Table whose style is being updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/styles/{styleId}", + // "request": { + // "$ref": "StyleSetting" + // }, + // "response": { + // "$ref": "StyleSetting" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.table.copy": + +type TableCopyCall struct { + s *Service + tableId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Copy: Copies a table. +func (r *TableService) Copy(tableId string) *TableCopyCall { + c := &TableCopyCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + return c +} + +// CopyPresentation sets the optional parameter "copyPresentation": +// Whether to also copy tabs, styles, and templates. Default is false. +func (c *TableCopyCall) CopyPresentation(copyPresentation bool) *TableCopyCall { + c.opt_["copyPresentation"] = copyPresentation + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TableCopyCall) Fields(s ...googleapi.Field) *TableCopyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TableCopyCall) Context(ctx context.Context) *TableCopyCall { + c.ctx_ = ctx + return c +} + +func (c *TableCopyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["copyPresentation"]; ok { + params.Set("copyPresentation", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/copy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.table.copy" call. +// Exactly one of *Table or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Table.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TableCopyCall) Do() (*Table, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Table{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Copies a table.", + // "httpMethod": "POST", + // "id": "fusiontables.table.copy", + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "copyPresentation": { + // "description": "Whether to also copy tabs, styles, and templates. Default is false.", + // "location": "query", + // "type": "boolean" + // }, + // "tableId": { + // "description": "ID of the table that is being copied.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/copy", + // "response": { + // "$ref": "Table" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables", + // "https://www.googleapis.com/auth/fusiontables.readonly" + // ] + // } + +} + +// method id "fusiontables.table.delete": + +type TableDeleteCall struct { + s *Service + tableId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a table. +func (r *TableService) Delete(tableId string) *TableDeleteCall { + c := &TableDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TableDeleteCall) Fields(s ...googleapi.Field) *TableDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TableDeleteCall) Context(ctx context.Context) *TableDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TableDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.table.delete" call. +func (c *TableDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a table.", + // "httpMethod": "DELETE", + // "id": "fusiontables.table.delete", + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "tableId": { + // "description": "ID of the table that is being deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}", + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.table.get": + +type TableGetCall struct { + s *Service + tableId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves a specific table by its id. +func (r *TableService) Get(tableId string) *TableGetCall { + c := &TableGetCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TableGetCall) Fields(s ...googleapi.Field) *TableGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TableGetCall) IfNoneMatch(entityTag string) *TableGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TableGetCall) Context(ctx context.Context) *TableGetCall { + c.ctx_ = ctx + return c +} + +func (c *TableGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.table.get" call. +// Exactly one of *Table or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Table.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TableGetCall) Do() (*Table, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Table{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a specific table by its id.", + // "httpMethod": "GET", + // "id": "fusiontables.table.get", + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "tableId": { + // "description": "Identifier(ID) for the table being requested.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}", + // "response": { + // "$ref": "Table" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables", + // "https://www.googleapis.com/auth/fusiontables.readonly" + // ] + // } + +} + +// method id "fusiontables.table.importRows": + +type TableImportRowsCall struct { + s *Service + tableId string + opt_ map[string]interface{} + media_ io.Reader + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// ImportRows: Import more rows into a table. +func (r *TableService) ImportRows(tableId string) *TableImportRowsCall { + c := &TableImportRowsCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + return c +} + +// Delimiter sets the optional parameter "delimiter": The delimiter used +// to separate cell values. This can only consist of a single character. +// Default is ','. +func (c *TableImportRowsCall) Delimiter(delimiter string) *TableImportRowsCall { + c.opt_["delimiter"] = delimiter + return c +} + +// Encoding sets the optional parameter "encoding": The encoding of the +// content. Default is UTF-8. Use 'auto-detect' if you are unsure of the +// encoding. +func (c *TableImportRowsCall) Encoding(encoding string) *TableImportRowsCall { + c.opt_["encoding"] = encoding + return c +} + +// EndLine sets the optional parameter "endLine": The index of the last +// line from which to start importing, exclusive. Thus, the number of +// imported lines is endLine - startLine. If this parameter is not +// provided, the file will be imported until the last line of the file. +// If endLine is negative, then the imported content will exclude the +// last endLine lines. That is, if endline is negative, no line will be +// imported whose index is greater than N + endLine where N is the +// number of lines in the file, and the number of imported lines will be +// N + endLine - startLine. +func (c *TableImportRowsCall) EndLine(endLine int64) *TableImportRowsCall { + c.opt_["endLine"] = endLine + return c +} + +// IsStrict sets the optional parameter "isStrict": Whether the CSV must +// have the same number of values for each row. If false, rows with +// fewer values will be padded with empty values. Default is true. +func (c *TableImportRowsCall) IsStrict(isStrict bool) *TableImportRowsCall { + c.opt_["isStrict"] = isStrict + return c +} + +// StartLine sets the optional parameter "startLine": The index of the +// first line from which to start importing, inclusive. Default is 0. +func (c *TableImportRowsCall) StartLine(startLine int64) *TableImportRowsCall { + c.opt_["startLine"] = startLine + return c +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *TableImportRowsCall) Media(r io.Reader) *TableImportRowsCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *TableImportRowsCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *TableImportRowsCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *TableImportRowsCall) ProgressUpdater(pu googleapi.ProgressUpdater) *TableImportRowsCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TableImportRowsCall) Fields(s ...googleapi.Field) *TableImportRowsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *TableImportRowsCall) Context(ctx context.Context) *TableImportRowsCall { + c.ctx_ = ctx + return c +} + +func (c *TableImportRowsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["delimiter"]; ok { + params.Set("delimiter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["encoding"]; ok { + params.Set("encoding", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["endLine"]; ok { + params.Set("endLine", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["isStrict"]; ok { + params.Set("isStrict", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startLine"]; ok { + params.Set("startLine", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/import") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + body = new(bytes.Buffer) + ctype := "application/json" + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.table.importRows" call. +// Exactly one of *Import or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Import.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TableImportRowsCall) Do() (*Import, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &Import{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Import more rows into a table.", + // "httpMethod": "POST", + // "id": "fusiontables.table.importRows", + // "mediaUpload": { + // "accept": [ + // "application/octet-stream" + // ], + // "maxSize": "250MB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/fusiontables/v1/tables/{tableId}/import" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/fusiontables/v1/tables/{tableId}/import" + // } + // } + // }, + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "delimiter": { + // "description": "The delimiter used to separate cell values. This can only consist of a single character. Default is ','.", + // "location": "query", + // "type": "string" + // }, + // "encoding": { + // "description": "The encoding of the content. Default is UTF-8. Use 'auto-detect' if you are unsure of the encoding.", + // "location": "query", + // "type": "string" + // }, + // "endLine": { + // "description": "The index of the last line from which to start importing, exclusive. Thus, the number of imported lines is endLine - startLine. If this parameter is not provided, the file will be imported until the last line of the file. If endLine is negative, then the imported content will exclude the last endLine lines. That is, if endline is negative, no line will be imported whose index is greater than N + endLine where N is the number of lines in the file, and the number of imported lines will be N + endLine - startLine.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "isStrict": { + // "description": "Whether the CSV must have the same number of values for each row. If false, rows with fewer values will be padded with empty values. Default is true.", + // "location": "query", + // "type": "boolean" + // }, + // "startLine": { + // "description": "The index of the first line from which to start importing, inclusive. Default is 0.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "tableId": { + // "description": "The table into which new rows are being imported.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/import", + // "response": { + // "$ref": "Import" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "fusiontables.table.importTable": + +type TableImportTableCall struct { + s *Service + name string + opt_ map[string]interface{} + media_ io.Reader + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// ImportTable: Import a new table. +func (r *TableService) ImportTable(name string) *TableImportTableCall { + c := &TableImportTableCall{s: r.s, opt_: make(map[string]interface{})} + c.name = name + return c +} + +// Delimiter sets the optional parameter "delimiter": The delimiter used +// to separate cell values. This can only consist of a single character. +// Default is ','. +func (c *TableImportTableCall) Delimiter(delimiter string) *TableImportTableCall { + c.opt_["delimiter"] = delimiter + return c +} + +// Encoding sets the optional parameter "encoding": The encoding of the +// content. Default is UTF-8. Use 'auto-detect' if you are unsure of the +// encoding. +func (c *TableImportTableCall) Encoding(encoding string) *TableImportTableCall { + c.opt_["encoding"] = encoding + return c +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *TableImportTableCall) Media(r io.Reader) *TableImportTableCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *TableImportTableCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *TableImportTableCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *TableImportTableCall) ProgressUpdater(pu googleapi.ProgressUpdater) *TableImportTableCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TableImportTableCall) Fields(s ...googleapi.Field) *TableImportTableCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *TableImportTableCall) Context(ctx context.Context) *TableImportTableCall { + c.ctx_ = ctx + return c +} + +func (c *TableImportTableCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("name", fmt.Sprintf("%v", c.name)) + if v, ok := c.opt_["delimiter"]; ok { + params.Set("delimiter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["encoding"]; ok { + params.Set("encoding", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/import") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + body = new(bytes.Buffer) + ctype := "application/json" + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.table.importTable" call. +// Exactly one of *Table or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Table.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TableImportTableCall) Do() (*Table, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &Table{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Import a new table.", + // "httpMethod": "POST", + // "id": "fusiontables.table.importTable", + // "mediaUpload": { + // "accept": [ + // "application/octet-stream" + // ], + // "maxSize": "250MB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/fusiontables/v1/tables/import" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/fusiontables/v1/tables/import" + // } + // } + // }, + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "delimiter": { + // "description": "The delimiter used to separate cell values. This can only consist of a single character. Default is ','.", + // "location": "query", + // "type": "string" + // }, + // "encoding": { + // "description": "The encoding of the content. Default is UTF-8. Use 'auto-detect' if you are unsure of the encoding.", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The name to be assigned to the new table.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/import", + // "response": { + // "$ref": "Table" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "fusiontables.table.insert": + +type TableInsertCall struct { + s *Service + table *Table + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a new table. +func (r *TableService) Insert(table *Table) *TableInsertCall { + c := &TableInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.table = table + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TableInsertCall) Fields(s ...googleapi.Field) *TableInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TableInsertCall) Context(ctx context.Context) *TableInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TableInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.table.insert" call. +// Exactly one of *Table or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Table.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TableInsertCall) Do() (*Table, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Table{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new table.", + // "httpMethod": "POST", + // "id": "fusiontables.table.insert", + // "path": "tables", + // "request": { + // "$ref": "Table" + // }, + // "response": { + // "$ref": "Table" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.table.list": + +type TableListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of tables a user owns. +func (r *TableService) List() *TableListCall { + c := &TableListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of styles to return. Default is 5. +func (c *TableListCall) MaxResults(maxResults int64) *TableListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +// specifying which result page to return. +func (c *TableListCall) PageToken(pageToken string) *TableListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TableListCall) Fields(s ...googleapi.Field) *TableListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TableListCall) IfNoneMatch(entityTag string) *TableListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TableListCall) Context(ctx context.Context) *TableListCall { + c.ctx_ = ctx + return c +} + +func (c *TableListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.table.list" call. +// Exactly one of *TableList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TableList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TableListCall) Do() (*TableList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TableList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of tables a user owns.", + // "httpMethod": "GET", + // "id": "fusiontables.table.list", + // "parameters": { + // "maxResults": { + // "description": "Maximum number of styles to return. Optional. Default is 5.", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Continuation token specifying which result page to return. Optional.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "tables", + // "response": { + // "$ref": "TableList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables", + // "https://www.googleapis.com/auth/fusiontables.readonly" + // ] + // } + +} + +// method id "fusiontables.table.patch": + +type TablePatchCall struct { + s *Service + tableId string + table *Table + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing table. Unless explicitly requested, only +// the name, description, and attribution will be updated. This method +// supports patch semantics. +func (r *TableService) Patch(tableId string, table *Table) *TablePatchCall { + c := &TablePatchCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.table = table + return c +} + +// ReplaceViewDefinition sets the optional parameter +// "replaceViewDefinition": Should the view definition also be updated? +// The specified view definition replaces the existing one. Only a view +// can be updated with a new definition. +func (c *TablePatchCall) ReplaceViewDefinition(replaceViewDefinition bool) *TablePatchCall { + c.opt_["replaceViewDefinition"] = replaceViewDefinition + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablePatchCall) Fields(s ...googleapi.Field) *TablePatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablePatchCall) Context(ctx context.Context) *TablePatchCall { + c.ctx_ = ctx + return c +} + +func (c *TablePatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["replaceViewDefinition"]; ok { + params.Set("replaceViewDefinition", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.table.patch" call. +// Exactly one of *Table or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Table.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TablePatchCall) Do() (*Table, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Table{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing table. Unless explicitly requested, only the name, description, and attribution will be updated. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "fusiontables.table.patch", + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "replaceViewDefinition": { + // "description": "Should the view definition also be updated? The specified view definition replaces the existing one. Only a view can be updated with a new definition.", + // "location": "query", + // "type": "boolean" + // }, + // "tableId": { + // "description": "ID of the table that is being updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}", + // "request": { + // "$ref": "Table" + // }, + // "response": { + // "$ref": "Table" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.table.update": + +type TableUpdateCall struct { + s *Service + tableId string + table *Table + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing table. Unless explicitly requested, only +// the name, description, and attribution will be updated. +func (r *TableService) Update(tableId string, table *Table) *TableUpdateCall { + c := &TableUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.table = table + return c +} + +// ReplaceViewDefinition sets the optional parameter +// "replaceViewDefinition": Should the view definition also be updated? +// The specified view definition replaces the existing one. Only a view +// can be updated with a new definition. +func (c *TableUpdateCall) ReplaceViewDefinition(replaceViewDefinition bool) *TableUpdateCall { + c.opt_["replaceViewDefinition"] = replaceViewDefinition + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TableUpdateCall) Fields(s ...googleapi.Field) *TableUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TableUpdateCall) Context(ctx context.Context) *TableUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *TableUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["replaceViewDefinition"]; ok { + params.Set("replaceViewDefinition", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.table.update" call. +// Exactly one of *Table or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Table.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TableUpdateCall) Do() (*Table, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Table{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing table. Unless explicitly requested, only the name, description, and attribution will be updated.", + // "httpMethod": "PUT", + // "id": "fusiontables.table.update", + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "replaceViewDefinition": { + // "description": "Should the view definition also be updated? The specified view definition replaces the existing one. Only a view can be updated with a new definition.", + // "location": "query", + // "type": "boolean" + // }, + // "tableId": { + // "description": "ID of the table that is being updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}", + // "request": { + // "$ref": "Table" + // }, + // "response": { + // "$ref": "Table" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.task.delete": + +type TaskDeleteCall struct { + s *Service + tableId string + taskId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the task, unless already started. +func (r *TaskService) Delete(tableId string, taskId string) *TaskDeleteCall { + c := &TaskDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.taskId = taskId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TaskDeleteCall) Fields(s ...googleapi.Field) *TaskDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TaskDeleteCall) Context(ctx context.Context) *TaskDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TaskDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/tasks/{taskId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "taskId": c.taskId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.task.delete" call. +func (c *TaskDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the task, unless already started.", + // "httpMethod": "DELETE", + // "id": "fusiontables.task.delete", + // "parameterOrder": [ + // "tableId", + // "taskId" + // ], + // "parameters": { + // "tableId": { + // "description": "Table from which the task is being deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "taskId": { + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/tasks/{taskId}", + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.task.get": + +type TaskGetCall struct { + s *Service + tableId string + taskId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves a specific task by its id. +func (r *TaskService) Get(tableId string, taskId string) *TaskGetCall { + c := &TaskGetCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.taskId = taskId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TaskGetCall) Fields(s ...googleapi.Field) *TaskGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TaskGetCall) IfNoneMatch(entityTag string) *TaskGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TaskGetCall) Context(ctx context.Context) *TaskGetCall { + c.ctx_ = ctx + return c +} + +func (c *TaskGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/tasks/{taskId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "taskId": c.taskId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.task.get" call. +// Exactly one of *Task or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Task.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *TaskGetCall) Do() (*Task, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Task{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a specific task by its id.", + // "httpMethod": "GET", + // "id": "fusiontables.task.get", + // "parameterOrder": [ + // "tableId", + // "taskId" + // ], + // "parameters": { + // "tableId": { + // "description": "Table to which the task belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "taskId": { + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/tasks/{taskId}", + // "response": { + // "$ref": "Task" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables", + // "https://www.googleapis.com/auth/fusiontables.readonly" + // ] + // } + +} + +// method id "fusiontables.task.list": + +type TaskListCall struct { + s *Service + tableId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of tasks. +func (r *TaskService) List(tableId string) *TaskListCall { + c := &TaskListCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of columns to return. Default is 5. +func (c *TaskListCall) MaxResults(maxResults int64) *TaskListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": +func (c *TaskListCall) PageToken(pageToken string) *TaskListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StartIndex sets the optional parameter "startIndex": +func (c *TaskListCall) StartIndex(startIndex int64) *TaskListCall { + c.opt_["startIndex"] = startIndex + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TaskListCall) Fields(s ...googleapi.Field) *TaskListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TaskListCall) IfNoneMatch(entityTag string) *TaskListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TaskListCall) Context(ctx context.Context) *TaskListCall { + c.ctx_ = ctx + return c +} + +func (c *TaskListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/tasks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.task.list" call. +// Exactly one of *TaskList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *TaskList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TaskListCall) Do() (*TaskList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TaskList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of tasks.", + // "httpMethod": "GET", + // "id": "fusiontables.task.list", + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of columns to return. Optional. Default is 5.", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "location": "query", + // "type": "string" + // }, + // "startIndex": { + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "tableId": { + // "description": "Table whose tasks are being listed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/tasks", + // "response": { + // "$ref": "TaskList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables", + // "https://www.googleapis.com/auth/fusiontables.readonly" + // ] + // } + +} + +// method id "fusiontables.template.delete": + +type TemplateDeleteCall struct { + s *Service + tableId string + templateId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a template +func (r *TemplateService) Delete(tableId string, templateId int64) *TemplateDeleteCall { + c := &TemplateDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.templateId = templateId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TemplateDeleteCall) Fields(s ...googleapi.Field) *TemplateDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TemplateDeleteCall) Context(ctx context.Context) *TemplateDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TemplateDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/templates/{templateId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "templateId": strconv.FormatInt(c.templateId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.template.delete" call. +func (c *TemplateDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a template", + // "httpMethod": "DELETE", + // "id": "fusiontables.template.delete", + // "parameterOrder": [ + // "tableId", + // "templateId" + // ], + // "parameters": { + // "tableId": { + // "description": "Table from which the template is being deleted", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "templateId": { + // "description": "Identifier for the template which is being deleted", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "tables/{tableId}/templates/{templateId}", + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.template.get": + +type TemplateGetCall struct { + s *Service + tableId string + templateId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves a specific template by its id +func (r *TemplateService) Get(tableId string, templateId int64) *TemplateGetCall { + c := &TemplateGetCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.templateId = templateId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TemplateGetCall) Fields(s ...googleapi.Field) *TemplateGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TemplateGetCall) IfNoneMatch(entityTag string) *TemplateGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TemplateGetCall) Context(ctx context.Context) *TemplateGetCall { + c.ctx_ = ctx + return c +} + +func (c *TemplateGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/templates/{templateId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "templateId": strconv.FormatInt(c.templateId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.template.get" call. +// Exactly one of *Template or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Template.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TemplateGetCall) Do() (*Template, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Template{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a specific template by its id", + // "httpMethod": "GET", + // "id": "fusiontables.template.get", + // "parameterOrder": [ + // "tableId", + // "templateId" + // ], + // "parameters": { + // "tableId": { + // "description": "Table to which the template belongs", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "templateId": { + // "description": "Identifier for the template that is being requested", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "tables/{tableId}/templates/{templateId}", + // "response": { + // "$ref": "Template" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables", + // "https://www.googleapis.com/auth/fusiontables.readonly" + // ] + // } + +} + +// method id "fusiontables.template.insert": + +type TemplateInsertCall struct { + s *Service + tableId string + template *Template + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a new template for the table. +func (r *TemplateService) Insert(tableId string, template *Template) *TemplateInsertCall { + c := &TemplateInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.template = template + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TemplateInsertCall) Fields(s ...googleapi.Field) *TemplateInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TemplateInsertCall) Context(ctx context.Context) *TemplateInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TemplateInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.template) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/templates") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.template.insert" call. +// Exactly one of *Template or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Template.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TemplateInsertCall) Do() (*Template, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Template{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new template for the table.", + // "httpMethod": "POST", + // "id": "fusiontables.template.insert", + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "tableId": { + // "description": "Table for which a new template is being created", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/templates", + // "request": { + // "$ref": "Template" + // }, + // "response": { + // "$ref": "Template" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.template.list": + +type TemplateListCall struct { + s *Service + tableId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of templates. +func (r *TemplateService) List(tableId string) *TemplateListCall { + c := &TemplateListCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of templates to return. Default is 5. +func (c *TemplateListCall) MaxResults(maxResults int64) *TemplateListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +// specifying which results page to return. +func (c *TemplateListCall) PageToken(pageToken string) *TemplateListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TemplateListCall) Fields(s ...googleapi.Field) *TemplateListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TemplateListCall) IfNoneMatch(entityTag string) *TemplateListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TemplateListCall) Context(ctx context.Context) *TemplateListCall { + c.ctx_ = ctx + return c +} + +func (c *TemplateListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/templates") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.template.list" call. +// Exactly one of *TemplateList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TemplateList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TemplateListCall) Do() (*TemplateList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TemplateList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of templates.", + // "httpMethod": "GET", + // "id": "fusiontables.template.list", + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of templates to return. Optional. Default is 5.", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Continuation token specifying which results page to return. Optional.", + // "location": "query", + // "type": "string" + // }, + // "tableId": { + // "description": "Identifier for the table whose templates are being requested", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/templates", + // "response": { + // "$ref": "TemplateList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables", + // "https://www.googleapis.com/auth/fusiontables.readonly" + // ] + // } + +} + +// method id "fusiontables.template.patch": + +type TemplatePatchCall struct { + s *Service + tableId string + templateId int64 + template *Template + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing template. This method supports patch +// semantics. +func (r *TemplateService) Patch(tableId string, templateId int64, template *Template) *TemplatePatchCall { + c := &TemplatePatchCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.templateId = templateId + c.template = template + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TemplatePatchCall) Fields(s ...googleapi.Field) *TemplatePatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TemplatePatchCall) Context(ctx context.Context) *TemplatePatchCall { + c.ctx_ = ctx + return c +} + +func (c *TemplatePatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.template) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/templates/{templateId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "templateId": strconv.FormatInt(c.templateId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.template.patch" call. +// Exactly one of *Template or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Template.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TemplatePatchCall) Do() (*Template, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Template{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing template. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "fusiontables.template.patch", + // "parameterOrder": [ + // "tableId", + // "templateId" + // ], + // "parameters": { + // "tableId": { + // "description": "Table to which the updated template belongs", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "templateId": { + // "description": "Identifier for the template that is being updated", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "tables/{tableId}/templates/{templateId}", + // "request": { + // "$ref": "Template" + // }, + // "response": { + // "$ref": "Template" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.template.update": + +type TemplateUpdateCall struct { + s *Service + tableId string + templateId int64 + template *Template + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing template +func (r *TemplateService) Update(tableId string, templateId int64, template *Template) *TemplateUpdateCall { + c := &TemplateUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.templateId = templateId + c.template = template + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TemplateUpdateCall) Fields(s ...googleapi.Field) *TemplateUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TemplateUpdateCall) Context(ctx context.Context) *TemplateUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *TemplateUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.template) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/templates/{templateId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "templateId": strconv.FormatInt(c.templateId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.template.update" call. +// Exactly one of *Template or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Template.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TemplateUpdateCall) Do() (*Template, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Template{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing template", + // "httpMethod": "PUT", + // "id": "fusiontables.template.update", + // "parameterOrder": [ + // "tableId", + // "templateId" + // ], + // "parameters": { + // "tableId": { + // "description": "Table to which the updated template belongs", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "templateId": { + // "description": "Identifier for the template that is being updated", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "tables/{tableId}/templates/{templateId}", + // "request": { + // "$ref": "Template" + // }, + // "response": { + // "$ref": "Template" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/fusiontables/v2/fusiontables-api.json b/Godeps/_workspace/src/google.golang.org/api/fusiontables/v2/fusiontables-api.json new file mode 100644 index 000000000..0f6452c34 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/fusiontables/v2/fusiontables-api.json @@ -0,0 +1,1930 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/zzkCy2O-Agowk5lRoMuWDbJW1wc\"", + "discoveryVersion": "v1", + "id": "fusiontables:v2", + "name": "fusiontables", + "version": "v2", + "revision": "20150226", + "title": "Fusion Tables API", + "description": "API for working with Fusion Tables 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/fusiontables", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/fusiontables/v2/", + "basePath": "/fusiontables/v2/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "fusiontables/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/fusiontables": { + "description": "Manage your Fusion Tables" + }, + "https://www.googleapis.com/auth/fusiontables.readonly": { + "description": "View your Fusion Tables" + } + } + } + }, + "schemas": { + "Bucket": { + "id": "Bucket", + "type": "object", + "description": "Specifies the minimum and maximum values, the color, opacity, icon and weight of a bucket within a StyleSetting.", + "properties": { + "color": { + "type": "string", + "description": "Color of line or the interior of a polygon in #RRGGBB format." + }, + "icon": { + "type": "string", + "description": "Icon name used for a point." + }, + "max": { + "type": "number", + "description": "Maximum value in the selected column for a row to be styled according to the bucket color, opacity, icon, or weight.", + "format": "double" + }, + "min": { + "type": "number", + "description": "Minimum value in the selected column for a row to be styled according to the bucket color, opacity, icon, or weight.", + "format": "double" + }, + "opacity": { + "type": "number", + "description": "Opacity of the color: 0.0 (transparent) to 1.0 (opaque).", + "format": "double" + }, + "weight": { + "type": "integer", + "description": "Width of a line (in pixels).", + "format": "int32" + } + } + }, + "Column": { + "id": "Column", + "type": "object", + "description": "Specifies the details of a column in a table.", + "properties": { + "baseColumn": { + "type": "object", + "description": "Identifier of the base column. If present, this column is derived from the specified base column.", + "properties": { + "columnId": { + "type": "integer", + "description": "The id of the column in the base table from which this column is derived.", + "format": "int32" + }, + "tableIndex": { + "type": "integer", + "description": "Offset to the entry in the list of base tables in the table definition.", + "format": "int32" + } + } + }, + "columnId": { + "type": "integer", + "description": "Identifier for the column.", + "format": "int32" + }, + "columnJsonSchema": { + "type": "string", + "description": "JSON schema for interpreting JSON in this column." + }, + "columnPropertiesJson": { + "type": "string", + "description": "JSON object containing custom column properties." + }, + "description": { + "type": "string", + "description": "Column description." + }, + "formatPattern": { + "type": "string", + "description": "Format pattern.\nAcceptable values are DT_DATE_MEDIUMe.g Dec 24, 2008 DT_DATE_SHORTfor example 12/24/08 DT_DATE_TIME_MEDIUMfor example Dec 24, 2008 8:30:45 PM DT_DATE_TIME_SHORTfor example 12/24/08 8:30 PM DT_DAY_MONTH_2_DIGIT_YEARfor example 24/12/08 DT_DAY_MONTH_2_DIGIT_YEAR_TIMEfor example 24/12/08 20:30 DT_DAY_MONTH_2_DIGIT_YEAR_TIME_MERIDIANfor example 24/12/08 8:30 PM DT_DAY_MONTH_4_DIGIT_YEARfor example 24/12/2008 DT_DAY_MONTH_4_DIGIT_YEAR_TIMEfor example 24/12/2008 20:30 DT_DAY_MONTH_4_DIGIT_YEAR_TIME_MERIDIANfor example 24/12/2008 8:30 PM DT_ISO_YEAR_MONTH_DAYfor example 2008-12-24 DT_ISO_YEAR_MONTH_DAY_TIMEfor example 2008-12-24 20:30:45 DT_MONTH_DAY_4_DIGIT_YEARfor example 12/24/2008 DT_TIME_LONGfor example 8:30:45 PM UTC-6 DT_TIME_MEDIUMfor example 8:30:45 PM DT_TIME_SHORTfor example 8:30 PM DT_YEAR_ONLYfor example 2008 HIGHLIGHT_UNTYPED_CELLSHighlight cell data that does not match the data type NONENo formatting (default) NUMBER_CURRENCYfor example $1234.56 NUMBER_DEFAULTfor example 1,234.56 NUMBER_INTEGERfor example 1235 NUMBER_NO_SEPARATORfor example 1234.56 NUMBER_PERCENTfor example 123,456% NUMBER_SCIENTIFICfor example 1E3 STRING_EIGHT_LINE_IMAGEDisplays thumbnail images as tall as eight lines of text STRING_FOUR_LINE_IMAGEDisplays thumbnail images as tall as four lines of text STRING_JSON_TEXTAllows JSON editing of text in UI STRING_LINKTreats cell as a link (must start with http:// or https://) STRING_ONE_LINE_IMAGEDisplays thumbnail images as tall as one line of text STRING_VIDEO_OR_MAPDisplay a video or map thumbnail" + }, + "graphPredicate": { + "type": "string", + "description": "Column graph predicate.\nUsed to map table to graph data model (subject,predicate,object)\nSee W3C Graph-based Data Model." + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For a column, this is always fusiontables#column.", + "default": "fusiontables#column" + }, + "name": { + "type": "string", + "description": "Name of the column.", + "annotations": { + "required": [ + "fusiontables.column.insert" + ] + } + }, + "type": { + "type": "string", + "description": "Type of the column.", + "annotations": { + "required": [ + "fusiontables.column.insert" + ] + } + }, + "validValues": { + "type": "array", + "description": "List of valid values used to validate data and supply a drop-down list of values in the web application.", + "items": { + "type": "string" + } + }, + "validateData": { + "type": "boolean", + "description": "If true, data entered via the web application is validated." + } + } + }, + "ColumnList": { + "id": "ColumnList", + "type": "object", + "description": "Represents a list of columns in a table.", + "properties": { + "items": { + "type": "array", + "description": "List of all requested columns.", + "items": { + "$ref": "Column" + } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For a column list, this is always fusiontables#columnList.", + "default": "fusiontables#columnList" + }, + "nextPageToken": { + "type": "string", + "description": "Token used to access the next page of this result. No token is displayed if there are no more pages left." + }, + "totalItems": { + "type": "integer", + "description": "Total number of columns for the table.", + "format": "int32" + } + } + }, + "Geometry": { + "id": "Geometry", + "type": "object", + "description": "Represents a Geometry object.", + "properties": { + "geometries": { + "type": "array", + "description": "The list of geometries in this geometry collection.", + "items": { + "type": "any" + } + }, + "geometry": { + "type": "any" + }, + "type": { + "type": "string", + "description": "Type: A collection of geometries.", + "default": "GeometryCollection" + } + } + }, + "Import": { + "id": "Import", + "type": "object", + "description": "Represents an import request.", + "properties": { + "kind": { + "type": "string", + "description": "The kind of item this is. For an import, this is always fusiontables#import.", + "default": "fusiontables#import" + }, + "numRowsReceived": { + "type": "string", + "description": "The number of rows received from the import request.", + "format": "int64" + } + } + }, + "Line": { + "id": "Line", + "type": "object", + "description": "Represents a line geometry.", + "properties": { + "coordinates": { + "type": "array", + "description": "The coordinates that define the line.", + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + } + }, + "type": { + "type": "string", + "description": "Type: A line geometry.", + "default": "LineString" + } + } + }, + "LineStyle": { + "id": "LineStyle", + "type": "object", + "description": "Represents a LineStyle within a StyleSetting", + "properties": { + "strokeColor": { + "type": "string", + "description": "Color of the line in #RRGGBB format." + }, + "strokeColorStyler": { + "$ref": "StyleFunction", + "description": "Column-value, gradient or buckets styler that is used to determine the line color and opacity." + }, + "strokeOpacity": { + "type": "number", + "description": "Opacity of the line : 0.0 (transparent) to 1.0 (opaque).", + "format": "double" + }, + "strokeWeight": { + "type": "integer", + "description": "Width of the line in pixels.", + "format": "int32" + }, + "strokeWeightStyler": { + "$ref": "StyleFunction", + "description": "Column-value or bucket styler that is used to determine the width of the line." + } + } + }, + "Point": { + "id": "Point", + "type": "object", + "description": "Represents a point object.", + "properties": { + "coordinates": { + "type": "array", + "description": "The coordinates that define the point.", + "items": { + "type": "number", + "format": "double" + } + }, + "type": { + "type": "string", + "description": "Point: A point geometry.", + "default": "Point" + } + } + }, + "PointStyle": { + "id": "PointStyle", + "type": "object", + "description": "Represents a PointStyle within a StyleSetting", + "properties": { + "iconName": { + "type": "string", + "description": "Name of the icon. Use values defined in http://www.google.com/fusiontables/DataSource?dsrcid=308519" + }, + "iconStyler": { + "$ref": "StyleFunction", + "description": "Column or a bucket value from which the icon name is to be determined." + } + } + }, + "Polygon": { + "id": "Polygon", + "type": "object", + "description": "Represents a polygon object.", + "properties": { + "coordinates": { + "type": "array", + "description": "The coordinates that define the polygon.", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "number", + "format": "double" + } + } + } + }, + "type": { + "type": "string", + "description": "Type: A polygon geometry.", + "default": "Polygon" + } + } + }, + "PolygonStyle": { + "id": "PolygonStyle", + "type": "object", + "description": "Represents a PolygonStyle within a StyleSetting", + "properties": { + "fillColor": { + "type": "string", + "description": "Color of the interior of the polygon in #RRGGBB format." + }, + "fillColorStyler": { + "$ref": "StyleFunction", + "description": "Column-value, gradient, or bucket styler that is used to determine the interior color and opacity of the polygon." + }, + "fillOpacity": { + "type": "number", + "description": "Opacity of the interior of the polygon: 0.0 (transparent) to 1.0 (opaque).", + "format": "double" + }, + "strokeColor": { + "type": "string", + "description": "Color of the polygon border in #RRGGBB format." + }, + "strokeColorStyler": { + "$ref": "StyleFunction", + "description": "Column-value, gradient or buckets styler that is used to determine the border color and opacity." + }, + "strokeOpacity": { + "type": "number", + "description": "Opacity of the polygon border: 0.0 (transparent) to 1.0 (opaque).", + "format": "double" + }, + "strokeWeight": { + "type": "integer", + "description": "Width of the polyon border in pixels.", + "format": "int32" + }, + "strokeWeightStyler": { + "$ref": "StyleFunction", + "description": "Column-value or bucket styler that is used to determine the width of the polygon border." + } + } + }, + "Sqlresponse": { + "id": "Sqlresponse", + "type": "object", + "description": "Represents a response to a SQL statement.", + "properties": { + "columns": { + "type": "array", + "description": "Columns in the table.", + "items": { + "type": "string" + } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For responses to SQL queries, this is always fusiontables#sqlresponse.", + "default": "fusiontables#sqlresponse" + }, + "rows": { + "type": "array", + "description": "The rows in the table. For each cell we print out whatever cell value (e.g., numeric, string) exists. Thus it is important that each cell contains only one value.", + "items": { + "type": "array", + "items": { + "type": "any" + } + } + } + } + }, + "StyleFunction": { + "id": "StyleFunction", + "type": "object", + "description": "Represents a StyleFunction within a StyleSetting", + "properties": { + "buckets": { + "type": "array", + "description": "Bucket function that assigns a style based on the range a column value falls into.", + "items": { + "$ref": "Bucket" + } + }, + "columnName": { + "type": "string", + "description": "Name of the column whose value is used in the style.", + "annotations": { + "required": [ + "fusiontables.style.insert" + ] + } + }, + "gradient": { + "type": "object", + "description": "Gradient function that interpolates a range of colors based on column value.", + "properties": { + "colors": { + "type": "array", + "description": "Array with two or more colors.", + "items": { + "type": "object", + "properties": { + "color": { + "type": "string", + "description": "Color in #RRGGBB format." + }, + "opacity": { + "type": "number", + "description": "Opacity of the color: 0.0 (transparent) to 1.0 (opaque).", + "format": "double" + } + } + } + }, + "max": { + "type": "number", + "description": "Higher-end of the interpolation range: rows with this value will be assigned to colors[n-1].", + "format": "double" + }, + "min": { + "type": "number", + "description": "Lower-end of the interpolation range: rows with this value will be assigned to colors[0].", + "format": "double" + } + } + }, + "kind": { + "type": "string", + "description": "Stylers can be one of three kinds: \"fusiontables#fromColumn if the column value is to be used as is, i.e., the column values can have colors in #RRGGBBAA format or integer line widths or icon names; fusiontables#gradient if the styling of the row is to be based on applying the gradient function on the column value; or fusiontables#buckets if the styling is to based on the bucket into which the the column value falls." + } + } + }, + "StyleSetting": { + "id": "StyleSetting", + "type": "object", + "description": "Represents a complete StyleSettings object. The primary key is a combination of the tableId and a styleId.", + "properties": { + "kind": { + "type": "string", + "description": "The kind of item this is. A StyleSetting contains the style definitions for points, lines, and polygons in a table. Since a table can have any one or all of them, a style definition can have point, line and polygon style definitions.", + "default": "fusiontables#styleSetting" + }, + "markerOptions": { + "$ref": "PointStyle", + "description": "Style definition for points in the table." + }, + "name": { + "type": "string", + "description": "Optional name for the style setting." + }, + "polygonOptions": { + "$ref": "PolygonStyle", + "description": "Style definition for polygons in the table." + }, + "polylineOptions": { + "$ref": "LineStyle", + "description": "Style definition for lines in the table." + }, + "styleId": { + "type": "integer", + "description": "Identifier for the style setting (unique only within tables).", + "format": "int32" + }, + "tableId": { + "type": "string", + "description": "Identifier for the table." + } + } + }, + "StyleSettingList": { + "id": "StyleSettingList", + "type": "object", + "description": "Represents a list of styles for a given table.", + "properties": { + "items": { + "type": "array", + "description": "All requested style settings.", + "items": { + "$ref": "StyleSetting" + } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For a style list, this is always fusiontables#styleSettingList .", + "default": "fusiontables#styleSettingList" + }, + "nextPageToken": { + "type": "string", + "description": "Token used to access the next page of this result. No token is displayed if there are no more styles left." + }, + "totalItems": { + "type": "integer", + "description": "Total number of styles for the table.", + "format": "int32" + } + } + }, + "Table": { + "id": "Table", + "type": "object", + "description": "Represents a table.", + "properties": { + "attribution": { + "type": "string", + "description": "Attribution assigned to the table." + }, + "attributionLink": { + "type": "string", + "description": "Optional link for attribution." + }, + "baseTableIds": { + "type": "array", + "description": "Base table identifier if this table is a view or merged table.", + "items": { + "type": "string" + } + }, + "columnPropertiesJsonSchema": { + "type": "string", + "description": "Default JSON schema for validating all JSON column properties." + }, + "columns": { + "type": "array", + "description": "Columns in the table.", + "items": { + "$ref": "Column" + }, + "annotations": { + "required": [ + "fusiontables.table.insert", + "fusiontables.table.update" + ] + } + }, + "description": { + "type": "string", + "description": "Description assigned to the table." + }, + "isExportable": { + "type": "boolean", + "description": "Variable for whether table is exportable.", + "annotations": { + "required": [ + "fusiontables.table.insert", + "fusiontables.table.update" + ] + } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For a table, this is always fusiontables#table.", + "default": "fusiontables#table" + }, + "name": { + "type": "string", + "description": "Name assigned to a table.", + "annotations": { + "required": [ + "fusiontables.table.insert", + "fusiontables.table.update" + ] + } + }, + "sql": { + "type": "string", + "description": "SQL that encodes the table definition for derived tables." + }, + "tableId": { + "type": "string", + "description": "Encrypted unique alphanumeric identifier for the table." + }, + "tablePropertiesJson": { + "type": "string", + "description": "JSON object containing custom table properties." + }, + "tablePropertiesJsonSchema": { + "type": "string", + "description": "JSON schema for validating the JSON table properties." + } + } + }, + "TableList": { + "id": "TableList", + "type": "object", + "description": "Represents a list of tables.", + "properties": { + "items": { + "type": "array", + "description": "List of all requested tables.", + "items": { + "$ref": "Table" + } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For table list, this is always fusiontables#tableList.", + "default": "fusiontables#tableList" + }, + "nextPageToken": { + "type": "string", + "description": "Token used to access the next page of this result. No token is displayed if there are no more pages left." + } + } + }, + "Task": { + "id": "Task", + "type": "object", + "description": "A background task on a table, initiated for time- or resource-consuming operations such as changing column types or deleting all rows.", + "properties": { + "kind": { + "type": "string", + "description": "Type of the resource. This is always \"fusiontables#task\".", + "default": "fusiontables#task" + }, + "progress": { + "type": "string", + "description": "Task percentage completion." + }, + "started": { + "type": "boolean", + "description": "false while the table is busy with some other task. true if this background task is currently running." + }, + "taskId": { + "type": "string", + "description": "Identifier for the task.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "Type of background task." + } + } + }, + "TaskList": { + "id": "TaskList", + "type": "object", + "description": "Represents a list of tasks for a table.", + "properties": { + "items": { + "type": "array", + "description": "List of all requested tasks.", + "items": { + "$ref": "Task" + } + }, + "kind": { + "type": "string", + "description": "Type of the resource. This is always \"fusiontables#taskList\".", + "default": "fusiontables#taskList" + }, + "nextPageToken": { + "type": "string", + "description": "Token used to access the next page of this result. No token is displayed if there are no more pages left." + }, + "totalItems": { + "type": "integer", + "description": "Total number of tasks for the table.", + "format": "int32" + } + } + }, + "Template": { + "id": "Template", + "type": "object", + "description": "Represents the contents of InfoWindow templates.", + "properties": { + "automaticColumnNames": { + "type": "array", + "description": "List of columns from which the template is to be automatically constructed. Only one of body or automaticColumns can be specified.", + "items": { + "type": "string" + } + }, + "body": { + "type": "string", + "description": "Body of the template. It contains HTML with {column_name} to insert values from a particular column. The body is sanitized to remove certain tags, e.g., script. Only one of body or automaticColumns can be specified." + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For a template, this is always fusiontables#template.", + "default": "fusiontables#template" + }, + "name": { + "type": "string", + "description": "Optional name assigned to a template." + }, + "tableId": { + "type": "string", + "description": "Identifier for the table for which the template is defined." + }, + "templateId": { + "type": "integer", + "description": "Identifier for the template, unique within the context of a particular table.", + "format": "int32" + } + } + }, + "TemplateList": { + "id": "TemplateList", + "type": "object", + "description": "Represents a list of templates for a given table.", + "properties": { + "items": { + "type": "array", + "description": "List of all requested templates.", + "items": { + "$ref": "Template" + } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For a template list, this is always fusiontables#templateList .", + "default": "fusiontables#templateList" + }, + "nextPageToken": { + "type": "string", + "description": "Token used to access the next page of this result. No token is displayed if there are no more pages left." + }, + "totalItems": { + "type": "integer", + "description": "Total number of templates for the table.", + "format": "int32" + } + } + } + }, + "resources": { + "column": { + "methods": { + "delete": { + "id": "fusiontables.column.delete", + "path": "tables/{tableId}/columns/{columnId}", + "httpMethod": "DELETE", + "description": "Deletes the specified column.", + "parameters": { + "columnId": { + "type": "string", + "description": "Name or identifier for the column being deleted.", + "required": true, + "location": "path" + }, + "tableId": { + "type": "string", + "description": "Table from which the column is being deleted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "columnId" + ], + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, + "get": { + "id": "fusiontables.column.get", + "path": "tables/{tableId}/columns/{columnId}", + "httpMethod": "GET", + "description": "Retrieves a specific column by its ID.", + "parameters": { + "columnId": { + "type": "string", + "description": "Name or identifier for the column that is being requested.", + "required": true, + "location": "path" + }, + "tableId": { + "type": "string", + "description": "Table to which the column belongs.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "columnId" + ], + "response": { + "$ref": "Column" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables", + "https://www.googleapis.com/auth/fusiontables.readonly" + ] + }, + "insert": { + "id": "fusiontables.column.insert", + "path": "tables/{tableId}/columns", + "httpMethod": "POST", + "description": "Adds a new column to the table.", + "parameters": { + "tableId": { + "type": "string", + "description": "Table for which a new column is being added.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "request": { + "$ref": "Column" + }, + "response": { + "$ref": "Column" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, + "list": { + "id": "fusiontables.column.list", + "path": "tables/{tableId}/columns", + "httpMethod": "GET", + "description": "Retrieves a list of columns.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of columns to return. Default is 5.", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Continuation token specifying which result page to return.", + "location": "query" + }, + "tableId": { + "type": "string", + "description": "Table whose columns are being listed.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "response": { + "$ref": "ColumnList" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables", + "https://www.googleapis.com/auth/fusiontables.readonly" + ] + }, + "patch": { + "id": "fusiontables.column.patch", + "path": "tables/{tableId}/columns/{columnId}", + "httpMethod": "PATCH", + "description": "Updates the name or type of an existing column. This method supports patch semantics.", + "parameters": { + "columnId": { + "type": "string", + "description": "Name or identifier for the column that is being updated.", + "required": true, + "location": "path" + }, + "tableId": { + "type": "string", + "description": "Table for which the column is being updated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "columnId" + ], + "request": { + "$ref": "Column" + }, + "response": { + "$ref": "Column" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, + "update": { + "id": "fusiontables.column.update", + "path": "tables/{tableId}/columns/{columnId}", + "httpMethod": "PUT", + "description": "Updates the name or type of an existing column.", + "parameters": { + "columnId": { + "type": "string", + "description": "Name or identifier for the column that is being updated.", + "required": true, + "location": "path" + }, + "tableId": { + "type": "string", + "description": "Table for which the column is being updated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "columnId" + ], + "request": { + "$ref": "Column" + }, + "response": { + "$ref": "Column" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + } + } + }, + "query": { + "methods": { + "sql": { + "id": "fusiontables.query.sql", + "path": "query", + "httpMethod": "POST", + "description": "Executes a Fusion Tables SQL statement, which can be any of \n- SELECT\n- INSERT\n- UPDATE\n- DELETE\n- SHOW\n- DESCRIBE\n- CREATE statement.", + "parameters": { + "hdrs": { + "type": "boolean", + "description": "Whether column names are included in the first row. Default is true.", + "location": "query" + }, + "sql": { + "type": "string", + "description": "A Fusion Tables SQL statement, which can be any of \n- SELECT\n- INSERT\n- UPDATE\n- DELETE\n- SHOW\n- DESCRIBE\n- CREATE", + "required": true, + "location": "query" + }, + "typed": { + "type": "boolean", + "description": "Whether typed values are returned in the (JSON) response: numbers for numeric values and parsed geometries for KML values. Default is true.", + "location": "query" + } + }, + "parameterOrder": [ + "sql" + ], + "response": { + "$ref": "Sqlresponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables", + "https://www.googleapis.com/auth/fusiontables.readonly" + ], + "supportsMediaDownload": true + }, + "sqlGet": { + "id": "fusiontables.query.sqlGet", + "path": "query", + "httpMethod": "GET", + "description": "Executes a SQL statement which can be any of \n- SELECT\n- SHOW\n- DESCRIBE", + "parameters": { + "hdrs": { + "type": "boolean", + "description": "Whether column names are included (in the first row). Default is true.", + "location": "query" + }, + "sql": { + "type": "string", + "description": "A SQL statement which can be any of \n- SELECT\n- SHOW\n- DESCRIBE", + "required": true, + "location": "query" + }, + "typed": { + "type": "boolean", + "description": "Whether typed values are returned in the (JSON) response: numbers for numeric values and parsed geometries for KML values. Default is true.", + "location": "query" + } + }, + "parameterOrder": [ + "sql" + ], + "response": { + "$ref": "Sqlresponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables", + "https://www.googleapis.com/auth/fusiontables.readonly" + ], + "supportsMediaDownload": true + } + } + }, + "style": { + "methods": { + "delete": { + "id": "fusiontables.style.delete", + "path": "tables/{tableId}/styles/{styleId}", + "httpMethod": "DELETE", + "description": "Deletes a style.", + "parameters": { + "styleId": { + "type": "integer", + "description": "Identifier (within a table) for the style being deleted", + "required": true, + "format": "int32", + "location": "path" + }, + "tableId": { + "type": "string", + "description": "Table from which the style is being deleted", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "styleId" + ], + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, + "get": { + "id": "fusiontables.style.get", + "path": "tables/{tableId}/styles/{styleId}", + "httpMethod": "GET", + "description": "Gets a specific style.", + "parameters": { + "styleId": { + "type": "integer", + "description": "Identifier (integer) for a specific style in a table", + "required": true, + "format": "int32", + "location": "path" + }, + "tableId": { + "type": "string", + "description": "Table to which the requested style belongs", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "styleId" + ], + "response": { + "$ref": "StyleSetting" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables", + "https://www.googleapis.com/auth/fusiontables.readonly" + ] + }, + "insert": { + "id": "fusiontables.style.insert", + "path": "tables/{tableId}/styles", + "httpMethod": "POST", + "description": "Adds a new style for the table.", + "parameters": { + "tableId": { + "type": "string", + "description": "Table for which a new style is being added", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "request": { + "$ref": "StyleSetting" + }, + "response": { + "$ref": "StyleSetting" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, + "list": { + "id": "fusiontables.style.list", + "path": "tables/{tableId}/styles", + "httpMethod": "GET", + "description": "Retrieves a list of styles.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of styles to return. Optional. Default is 5.", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Continuation token specifying which result page to return. Optional.", + "location": "query" + }, + "tableId": { + "type": "string", + "description": "Table whose styles are being listed", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "response": { + "$ref": "StyleSettingList" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables", + "https://www.googleapis.com/auth/fusiontables.readonly" + ] + }, + "patch": { + "id": "fusiontables.style.patch", + "path": "tables/{tableId}/styles/{styleId}", + "httpMethod": "PATCH", + "description": "Updates an existing style. This method supports patch semantics.", + "parameters": { + "styleId": { + "type": "integer", + "description": "Identifier (within a table) for the style being updated.", + "required": true, + "format": "int32", + "location": "path" + }, + "tableId": { + "type": "string", + "description": "Table whose style is being updated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "styleId" + ], + "request": { + "$ref": "StyleSetting" + }, + "response": { + "$ref": "StyleSetting" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, + "update": { + "id": "fusiontables.style.update", + "path": "tables/{tableId}/styles/{styleId}", + "httpMethod": "PUT", + "description": "Updates an existing style.", + "parameters": { + "styleId": { + "type": "integer", + "description": "Identifier (within a table) for the style being updated.", + "required": true, + "format": "int32", + "location": "path" + }, + "tableId": { + "type": "string", + "description": "Table whose style is being updated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "styleId" + ], + "request": { + "$ref": "StyleSetting" + }, + "response": { + "$ref": "StyleSetting" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + } + } + }, + "table": { + "methods": { + "copy": { + "id": "fusiontables.table.copy", + "path": "tables/{tableId}/copy", + "httpMethod": "POST", + "description": "Copies a table.", + "parameters": { + "copyPresentation": { + "type": "boolean", + "description": "Whether to also copy tabs, styles, and templates. Default is false.", + "location": "query" + }, + "tableId": { + "type": "string", + "description": "ID of the table that is being copied.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "response": { + "$ref": "Table" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables", + "https://www.googleapis.com/auth/fusiontables.readonly" + ] + }, + "delete": { + "id": "fusiontables.table.delete", + "path": "tables/{tableId}", + "httpMethod": "DELETE", + "description": "Deletes a table.", + "parameters": { + "tableId": { + "type": "string", + "description": "ID of the table to be deleted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, + "get": { + "id": "fusiontables.table.get", + "path": "tables/{tableId}", + "httpMethod": "GET", + "description": "Retrieves a specific table by its ID.", + "parameters": { + "tableId": { + "type": "string", + "description": "Identifier for the table being requested.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "response": { + "$ref": "Table" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables", + "https://www.googleapis.com/auth/fusiontables.readonly" + ] + }, + "importRows": { + "id": "fusiontables.table.importRows", + "path": "tables/{tableId}/import", + "httpMethod": "POST", + "description": "Imports more rows into a table.", + "parameters": { + "delimiter": { + "type": "string", + "description": "The delimiter used to separate cell values. This can only consist of a single character. Default is ,.", + "location": "query" + }, + "encoding": { + "type": "string", + "description": "The encoding of the content. Default is UTF-8. Use auto-detect if you are unsure of the encoding.", + "location": "query" + }, + "endLine": { + "type": "integer", + "description": "The index of the line up to which data will be imported. Default is to import the entire file. If endLine is negative, it is an offset from the end of the file; the imported content will exclude the last endLine lines.", + "format": "int32", + "location": "query" + }, + "isStrict": { + "type": "boolean", + "description": "Whether the imported CSV must have the same number of values for each row. If false, rows with fewer values will be padded with empty values. Default is true.", + "location": "query" + }, + "startLine": { + "type": "integer", + "description": "The index of the first line from which to start importing, inclusive. Default is 0.", + "format": "int32", + "location": "query" + }, + "tableId": { + "type": "string", + "description": "The table into which new rows are being imported.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "response": { + "$ref": "Import" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "application/octet-stream" + ], + "maxSize": "250MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/fusiontables/v2/tables/{tableId}/import" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/fusiontables/v2/tables/{tableId}/import" + } + } + } + }, + "importTable": { + "id": "fusiontables.table.importTable", + "path": "tables/import", + "httpMethod": "POST", + "description": "Imports a new table.", + "parameters": { + "delimiter": { + "type": "string", + "description": "The delimiter used to separate cell values. This can only consist of a single character. Default is ,.", + "location": "query" + }, + "encoding": { + "type": "string", + "description": "The encoding of the content. Default is UTF-8. Use auto-detect if you are unsure of the encoding.", + "location": "query" + }, + "name": { + "type": "string", + "description": "The name to be assigned to the new table.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Table" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "application/octet-stream" + ], + "maxSize": "250MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/fusiontables/v2/tables/import" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/fusiontables/v2/tables/import" + } + } + } + }, + "insert": { + "id": "fusiontables.table.insert", + "path": "tables", + "httpMethod": "POST", + "description": "Creates a new table.", + "request": { + "$ref": "Table" + }, + "response": { + "$ref": "Table" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, + "list": { + "id": "fusiontables.table.list", + "path": "tables", + "httpMethod": "GET", + "description": "Retrieves a list of tables a user owns.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of tables to return. Default is 5.", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Continuation token specifying which result page to return.", + "location": "query" + } + }, + "response": { + "$ref": "TableList" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables", + "https://www.googleapis.com/auth/fusiontables.readonly" + ] + }, + "patch": { + "id": "fusiontables.table.patch", + "path": "tables/{tableId}", + "httpMethod": "PATCH", + "description": "Updates an existing table. Unless explicitly requested, only the name, description, and attribution will be updated. This method supports patch semantics.", + "parameters": { + "replaceViewDefinition": { + "type": "boolean", + "description": "Whether the view definition is also updated. The specified view definition replaces the existing one. Only a view can be updated with a new definition.", + "location": "query" + }, + "tableId": { + "type": "string", + "description": "ID of the table that is being updated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "request": { + "$ref": "Table" + }, + "response": { + "$ref": "Table" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, + "replaceRows": { + "id": "fusiontables.table.replaceRows", + "path": "tables/{tableId}/replace", + "httpMethod": "POST", + "description": "Replaces rows of an existing table. Current rows remain visible until all replacement rows are ready.", + "parameters": { + "delimiter": { + "type": "string", + "description": "The delimiter used to separate cell values. This can only consist of a single character. Default is ,.", + "location": "query" + }, + "encoding": { + "type": "string", + "description": "The encoding of the content. Default is UTF-8. Use 'auto-detect' if you are unsure of the encoding.", + "location": "query" + }, + "endLine": { + "type": "integer", + "description": "The index of the line up to which data will be imported. Default is to import the entire file. If endLine is negative, it is an offset from the end of the file; the imported content will exclude the last endLine lines.", + "format": "int32", + "location": "query" + }, + "isStrict": { + "type": "boolean", + "description": "Whether the imported CSV must have the same number of column values for each row. If true, throws an exception if the CSV does not have the same number of columns. If false, rows with fewer column values will be padded with empty values. Default is true.", + "location": "query" + }, + "startLine": { + "type": "integer", + "description": "The index of the first line from which to start importing, inclusive. Default is 0.", + "format": "int32", + "location": "query" + }, + "tableId": { + "type": "string", + "description": "Table whose rows will be replaced.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "response": { + "$ref": "Task" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "application/octet-stream" + ], + "maxSize": "250MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/fusiontables/v2/tables/{tableId}/replace" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/fusiontables/v2/tables/{tableId}/replace" + } + } + } + }, + "update": { + "id": "fusiontables.table.update", + "path": "tables/{tableId}", + "httpMethod": "PUT", + "description": "Updates an existing table. Unless explicitly requested, only the name, description, and attribution will be updated.", + "parameters": { + "replaceViewDefinition": { + "type": "boolean", + "description": "Whether the view definition is also updated. The specified view definition replaces the existing one. Only a view can be updated with a new definition.", + "location": "query" + }, + "tableId": { + "type": "string", + "description": "ID of the table that is being updated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "request": { + "$ref": "Table" + }, + "response": { + "$ref": "Table" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + } + } + }, + "task": { + "methods": { + "delete": { + "id": "fusiontables.task.delete", + "path": "tables/{tableId}/tasks/{taskId}", + "httpMethod": "DELETE", + "description": "Deletes a specific task by its ID, unless that task has already started running.", + "parameters": { + "tableId": { + "type": "string", + "description": "Table from which the task is being deleted.", + "required": true, + "location": "path" + }, + "taskId": { + "type": "string", + "description": "The identifier of the task to delete.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "taskId" + ], + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, + "get": { + "id": "fusiontables.task.get", + "path": "tables/{tableId}/tasks/{taskId}", + "httpMethod": "GET", + "description": "Retrieves a specific task by its ID.", + "parameters": { + "tableId": { + "type": "string", + "description": "Table to which the task belongs.", + "required": true, + "location": "path" + }, + "taskId": { + "type": "string", + "description": "The identifier of the task to get.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "taskId" + ], + "response": { + "$ref": "Task" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables", + "https://www.googleapis.com/auth/fusiontables.readonly" + ] + }, + "list": { + "id": "fusiontables.task.list", + "path": "tables/{tableId}/tasks", + "httpMethod": "GET", + "description": "Retrieves a list of tasks.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of tasks to return. Default is 5.", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Continuation token specifying which result page to return.", + "location": "query" + }, + "startIndex": { + "type": "integer", + "description": "Index of the first result returned in the current page.", + "format": "uint32", + "location": "query" + }, + "tableId": { + "type": "string", + "description": "Table whose tasks are being listed.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "response": { + "$ref": "TaskList" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables", + "https://www.googleapis.com/auth/fusiontables.readonly" + ] + } + } + }, + "template": { + "methods": { + "delete": { + "id": "fusiontables.template.delete", + "path": "tables/{tableId}/templates/{templateId}", + "httpMethod": "DELETE", + "description": "Deletes a template", + "parameters": { + "tableId": { + "type": "string", + "description": "Table from which the template is being deleted", + "required": true, + "location": "path" + }, + "templateId": { + "type": "integer", + "description": "Identifier for the template which is being deleted", + "required": true, + "format": "int32", + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "templateId" + ], + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, + "get": { + "id": "fusiontables.template.get", + "path": "tables/{tableId}/templates/{templateId}", + "httpMethod": "GET", + "description": "Retrieves a specific template by its id", + "parameters": { + "tableId": { + "type": "string", + "description": "Table to which the template belongs", + "required": true, + "location": "path" + }, + "templateId": { + "type": "integer", + "description": "Identifier for the template that is being requested", + "required": true, + "format": "int32", + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "templateId" + ], + "response": { + "$ref": "Template" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables", + "https://www.googleapis.com/auth/fusiontables.readonly" + ] + }, + "insert": { + "id": "fusiontables.template.insert", + "path": "tables/{tableId}/templates", + "httpMethod": "POST", + "description": "Creates a new template for the table.", + "parameters": { + "tableId": { + "type": "string", + "description": "Table for which a new template is being created", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "request": { + "$ref": "Template" + }, + "response": { + "$ref": "Template" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, + "list": { + "id": "fusiontables.template.list", + "path": "tables/{tableId}/templates", + "httpMethod": "GET", + "description": "Retrieves a list of templates.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of templates to return. Optional. Default is 5.", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Continuation token specifying which results page to return. Optional.", + "location": "query" + }, + "tableId": { + "type": "string", + "description": "Identifier for the table whose templates are being requested", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "tableId" + ], + "response": { + "$ref": "TemplateList" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables", + "https://www.googleapis.com/auth/fusiontables.readonly" + ] + }, + "patch": { + "id": "fusiontables.template.patch", + "path": "tables/{tableId}/templates/{templateId}", + "httpMethod": "PATCH", + "description": "Updates an existing template. This method supports patch semantics.", + "parameters": { + "tableId": { + "type": "string", + "description": "Table to which the updated template belongs", + "required": true, + "location": "path" + }, + "templateId": { + "type": "integer", + "description": "Identifier for the template that is being updated", + "required": true, + "format": "int32", + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "templateId" + ], + "request": { + "$ref": "Template" + }, + "response": { + "$ref": "Template" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + }, + "update": { + "id": "fusiontables.template.update", + "path": "tables/{tableId}/templates/{templateId}", + "httpMethod": "PUT", + "description": "Updates an existing template", + "parameters": { + "tableId": { + "type": "string", + "description": "Table to which the updated template belongs", + "required": true, + "location": "path" + }, + "templateId": { + "type": "integer", + "description": "Identifier for the template that is being updated", + "required": true, + "format": "int32", + "location": "path" + } + }, + "parameterOrder": [ + "tableId", + "templateId" + ], + "request": { + "$ref": "Template" + }, + "response": { + "$ref": "Template" + }, + "scopes": [ + "https://www.googleapis.com/auth/fusiontables" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/fusiontables/v2/fusiontables-gen.go b/Godeps/_workspace/src/google.golang.org/api/fusiontables/v2/fusiontables-gen.go new file mode 100644 index 000000000..546ea1806 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/fusiontables/v2/fusiontables-gen.go @@ -0,0 +1,5846 @@ +// Package fusiontables provides access to the Fusion Tables API. +// +// See https://developers.google.com/fusiontables +// +// Usage example: +// +// import "google.golang.org/api/fusiontables/v2" +// ... +// fusiontablesService, err := fusiontables.New(oauthHttpClient) +package fusiontables // import "google.golang.org/api/fusiontables/v2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "fusiontables:v2" +const apiName = "fusiontables" +const apiVersion = "v2" +const basePath = "https://www.googleapis.com/fusiontables/v2/" + +// OAuth2 scopes used by this API. +const ( + // Manage your Fusion Tables + FusiontablesScope = "https://www.googleapis.com/auth/fusiontables" + + // View your Fusion Tables + FusiontablesReadonlyScope = "https://www.googleapis.com/auth/fusiontables.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.Column = NewColumnService(s) + s.Query = NewQueryService(s) + s.Style = NewStyleService(s) + s.Table = NewTableService(s) + s.Task = NewTaskService(s) + s.Template = NewTemplateService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Column *ColumnService + + Query *QueryService + + Style *StyleService + + Table *TableService + + Task *TaskService + + Template *TemplateService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewColumnService(s *Service) *ColumnService { + rs := &ColumnService{s: s} + return rs +} + +type ColumnService struct { + s *Service +} + +func NewQueryService(s *Service) *QueryService { + rs := &QueryService{s: s} + return rs +} + +type QueryService struct { + s *Service +} + +func NewStyleService(s *Service) *StyleService { + rs := &StyleService{s: s} + return rs +} + +type StyleService struct { + s *Service +} + +func NewTableService(s *Service) *TableService { + rs := &TableService{s: s} + return rs +} + +type TableService struct { + s *Service +} + +func NewTaskService(s *Service) *TaskService { + rs := &TaskService{s: s} + return rs +} + +type TaskService struct { + s *Service +} + +func NewTemplateService(s *Service) *TemplateService { + rs := &TemplateService{s: s} + return rs +} + +type TemplateService struct { + s *Service +} + +// Bucket: Specifies the minimum and maximum values, the color, opacity, +// icon and weight of a bucket within a StyleSetting. +type Bucket struct { + // Color: Color of line or the interior of a polygon in #RRGGBB format. + Color string `json:"color,omitempty"` + + // Icon: Icon name used for a point. + Icon string `json:"icon,omitempty"` + + // Max: Maximum value in the selected column for a row to be styled + // according to the bucket color, opacity, icon, or weight. + Max float64 `json:"max,omitempty"` + + // Min: Minimum value in the selected column for a row to be styled + // according to the bucket color, opacity, icon, or weight. + Min float64 `json:"min,omitempty"` + + // Opacity: Opacity of the color: 0.0 (transparent) to 1.0 (opaque). + Opacity float64 `json:"opacity,omitempty"` + + // Weight: Width of a line (in pixels). + Weight int64 `json:"weight,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Color") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Bucket) MarshalJSON() ([]byte, error) { + type noMethod Bucket + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Column: Specifies the details of a column in a table. +type Column struct { + // BaseColumn: Identifier of the base column. If present, this column is + // derived from the specified base column. + BaseColumn *ColumnBaseColumn `json:"baseColumn,omitempty"` + + // ColumnId: Identifier for the column. + ColumnId int64 `json:"columnId,omitempty"` + + // ColumnJsonSchema: JSON schema for interpreting JSON in this column. + ColumnJsonSchema string `json:"columnJsonSchema,omitempty"` + + // ColumnPropertiesJson: JSON object containing custom column + // properties. + ColumnPropertiesJson string `json:"columnPropertiesJson,omitempty"` + + // Description: Column description. + Description string `json:"description,omitempty"` + + // FormatPattern: Format pattern. + // Acceptable values are DT_DATE_MEDIUMe.g Dec 24, 2008 DT_DATE_SHORTfor + // example 12/24/08 DT_DATE_TIME_MEDIUMfor example Dec 24, 2008 8:30:45 + // PM DT_DATE_TIME_SHORTfor example 12/24/08 8:30 PM + // DT_DAY_MONTH_2_DIGIT_YEARfor example 24/12/08 + // DT_DAY_MONTH_2_DIGIT_YEAR_TIMEfor example 24/12/08 20:30 + // DT_DAY_MONTH_2_DIGIT_YEAR_TIME_MERIDIANfor example 24/12/08 8:30 PM + // DT_DAY_MONTH_4_DIGIT_YEARfor example 24/12/2008 + // DT_DAY_MONTH_4_DIGIT_YEAR_TIMEfor example 24/12/2008 20:30 + // DT_DAY_MONTH_4_DIGIT_YEAR_TIME_MERIDIANfor example 24/12/2008 8:30 PM + // DT_ISO_YEAR_MONTH_DAYfor example 2008-12-24 + // DT_ISO_YEAR_MONTH_DAY_TIMEfor example 2008-12-24 20:30:45 + // DT_MONTH_DAY_4_DIGIT_YEARfor example 12/24/2008 DT_TIME_LONGfor + // example 8:30:45 PM UTC-6 DT_TIME_MEDIUMfor example 8:30:45 PM + // DT_TIME_SHORTfor example 8:30 PM DT_YEAR_ONLYfor example 2008 + // HIGHLIGHT_UNTYPED_CELLSHighlight cell data that does not match the + // data type NONENo formatting (default) NUMBER_CURRENCYfor example + // $1234.56 NUMBER_DEFAULTfor example 1,234.56 NUMBER_INTEGERfor example + // 1235 NUMBER_NO_SEPARATORfor example 1234.56 NUMBER_PERCENTfor example + // 123,456% NUMBER_SCIENTIFICfor example 1E3 + // STRING_EIGHT_LINE_IMAGEDisplays thumbnail images as tall as eight + // lines of text STRING_FOUR_LINE_IMAGEDisplays thumbnail images as tall + // as four lines of text STRING_JSON_TEXTAllows JSON editing of text in + // UI STRING_LINKTreats cell as a link (must start with http:// or + // https://) STRING_ONE_LINE_IMAGEDisplays thumbnail images as tall as + // one line of text STRING_VIDEO_OR_MAPDisplay a video or map thumbnail + FormatPattern string `json:"formatPattern,omitempty"` + + // GraphPredicate: Column graph predicate. + // Used to map table to graph data model (subject,predicate,object) + // See W3C Graph-based Data Model. + GraphPredicate string `json:"graphPredicate,omitempty"` + + // Kind: The kind of item this is. For a column, this is always + // fusiontables#column. + Kind string `json:"kind,omitempty"` + + // Name: Name of the column. + Name string `json:"name,omitempty"` + + // Type: Type of the column. + Type string `json:"type,omitempty"` + + // ValidValues: List of valid values used to validate data and supply a + // drop-down list of values in the web application. + ValidValues []string `json:"validValues,omitempty"` + + // ValidateData: If true, data entered via the web application is + // validated. + ValidateData bool `json:"validateData,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BaseColumn") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Column) MarshalJSON() ([]byte, error) { + type noMethod Column + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ColumnBaseColumn: Identifier of the base column. If present, this +// column is derived from the specified base column. +type ColumnBaseColumn struct { + // ColumnId: The id of the column in the base table from which this + // column is derived. + ColumnId int64 `json:"columnId,omitempty"` + + // TableIndex: Offset to the entry in the list of base tables in the + // table definition. + TableIndex int64 `json:"tableIndex,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ColumnId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ColumnBaseColumn) MarshalJSON() ([]byte, error) { + type noMethod ColumnBaseColumn + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ColumnList: Represents a list of columns in a table. +type ColumnList struct { + // Items: List of all requested columns. + Items []*Column `json:"items,omitempty"` + + // Kind: The kind of item this is. For a column list, this is always + // fusiontables#columnList. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token used to access the next page of this result. No + // token is displayed if there are no more pages left. + NextPageToken string `json:"nextPageToken,omitempty"` + + // TotalItems: Total number of columns for the table. + TotalItems int64 `json:"totalItems,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ColumnList) MarshalJSON() ([]byte, error) { + type noMethod ColumnList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Geometry: Represents a Geometry object. +type Geometry struct { + // Geometries: The list of geometries in this geometry collection. + Geometries []interface{} `json:"geometries,omitempty"` + + Geometry interface{} `json:"geometry,omitempty"` + + // Type: Type: A collection of geometries. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Geometries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Geometry) MarshalJSON() ([]byte, error) { + type noMethod Geometry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Import: Represents an import request. +type Import struct { + // Kind: The kind of item this is. For an import, this is always + // fusiontables#import. + Kind string `json:"kind,omitempty"` + + // NumRowsReceived: The number of rows received from the import request. + NumRowsReceived int64 `json:"numRowsReceived,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Import) MarshalJSON() ([]byte, error) { + type noMethod Import + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Line: Represents a line geometry. +type Line struct { + // Coordinates: The coordinates that define the line. + Coordinates [][]float64 `json:"coordinates,omitempty"` + + // Type: Type: A line geometry. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Coordinates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Line) MarshalJSON() ([]byte, error) { + type noMethod Line + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LineStyle: Represents a LineStyle within a StyleSetting +type LineStyle struct { + // StrokeColor: Color of the line in #RRGGBB format. + StrokeColor string `json:"strokeColor,omitempty"` + + // StrokeColorStyler: Column-value, gradient or buckets styler that is + // used to determine the line color and opacity. + StrokeColorStyler *StyleFunction `json:"strokeColorStyler,omitempty"` + + // StrokeOpacity: Opacity of the line : 0.0 (transparent) to 1.0 + // (opaque). + StrokeOpacity float64 `json:"strokeOpacity,omitempty"` + + // StrokeWeight: Width of the line in pixels. + StrokeWeight int64 `json:"strokeWeight,omitempty"` + + // StrokeWeightStyler: Column-value or bucket styler that is used to + // determine the width of the line. + StrokeWeightStyler *StyleFunction `json:"strokeWeightStyler,omitempty"` + + // ForceSendFields is a list of field names (e.g. "StrokeColor") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LineStyle) MarshalJSON() ([]byte, error) { + type noMethod LineStyle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Point: Represents a point object. +type Point struct { + // Coordinates: The coordinates that define the point. + Coordinates []float64 `json:"coordinates,omitempty"` + + // Type: Point: A point geometry. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Coordinates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Point) MarshalJSON() ([]byte, error) { + type noMethod Point + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PointStyle: Represents a PointStyle within a StyleSetting +type PointStyle struct { + // IconName: Name of the icon. Use values defined in + // http://www.google.com/fusiontables/DataSource?dsrcid=308519 + IconName string `json:"iconName,omitempty"` + + // IconStyler: Column or a bucket value from which the icon name is to + // be determined. + IconStyler *StyleFunction `json:"iconStyler,omitempty"` + + // ForceSendFields is a list of field names (e.g. "IconName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PointStyle) MarshalJSON() ([]byte, error) { + type noMethod PointStyle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Polygon: Represents a polygon object. +type Polygon struct { + // Coordinates: The coordinates that define the polygon. + Coordinates [][][]float64 `json:"coordinates,omitempty"` + + // Type: Type: A polygon geometry. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Coordinates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Polygon) MarshalJSON() ([]byte, error) { + type noMethod Polygon + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PolygonStyle: Represents a PolygonStyle within a StyleSetting +type PolygonStyle struct { + // FillColor: Color of the interior of the polygon in #RRGGBB format. + FillColor string `json:"fillColor,omitempty"` + + // FillColorStyler: Column-value, gradient, or bucket styler that is + // used to determine the interior color and opacity of the polygon. + FillColorStyler *StyleFunction `json:"fillColorStyler,omitempty"` + + // FillOpacity: Opacity of the interior of the polygon: 0.0 + // (transparent) to 1.0 (opaque). + FillOpacity float64 `json:"fillOpacity,omitempty"` + + // StrokeColor: Color of the polygon border in #RRGGBB format. + StrokeColor string `json:"strokeColor,omitempty"` + + // StrokeColorStyler: Column-value, gradient or buckets styler that is + // used to determine the border color and opacity. + StrokeColorStyler *StyleFunction `json:"strokeColorStyler,omitempty"` + + // StrokeOpacity: Opacity of the polygon border: 0.0 (transparent) to + // 1.0 (opaque). + StrokeOpacity float64 `json:"strokeOpacity,omitempty"` + + // StrokeWeight: Width of the polyon border in pixels. + StrokeWeight int64 `json:"strokeWeight,omitempty"` + + // StrokeWeightStyler: Column-value or bucket styler that is used to + // determine the width of the polygon border. + StrokeWeightStyler *StyleFunction `json:"strokeWeightStyler,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FillColor") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PolygonStyle) MarshalJSON() ([]byte, error) { + type noMethod PolygonStyle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Sqlresponse: Represents a response to a SQL statement. +type Sqlresponse struct { + // Columns: Columns in the table. + Columns []string `json:"columns,omitempty"` + + // Kind: The kind of item this is. For responses to SQL queries, this is + // always fusiontables#sqlresponse. + Kind string `json:"kind,omitempty"` + + // Rows: The rows in the table. For each cell we print out whatever cell + // value (e.g., numeric, string) exists. Thus it is important that each + // cell contains only one value. + Rows [][]interface{} `json:"rows,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Columns") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Sqlresponse) MarshalJSON() ([]byte, error) { + type noMethod Sqlresponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// StyleFunction: Represents a StyleFunction within a StyleSetting +type StyleFunction struct { + // Buckets: Bucket function that assigns a style based on the range a + // column value falls into. + Buckets []*Bucket `json:"buckets,omitempty"` + + // ColumnName: Name of the column whose value is used in the style. + ColumnName string `json:"columnName,omitempty"` + + // Gradient: Gradient function that interpolates a range of colors based + // on column value. + Gradient *StyleFunctionGradient `json:"gradient,omitempty"` + + // Kind: Stylers can be one of three kinds: "fusiontables#fromColumn if + // the column value is to be used as is, i.e., the column values can + // have colors in #RRGGBBAA format or integer line widths or icon names; + // fusiontables#gradient if the styling of the row is to be based on + // applying the gradient function on the column value; or + // fusiontables#buckets if the styling is to based on the bucket into + // which the the column value falls. + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Buckets") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *StyleFunction) MarshalJSON() ([]byte, error) { + type noMethod StyleFunction + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// StyleFunctionGradient: Gradient function that interpolates a range of +// colors based on column value. +type StyleFunctionGradient struct { + // Colors: Array with two or more colors. + Colors []*StyleFunctionGradientColors `json:"colors,omitempty"` + + // Max: Higher-end of the interpolation range: rows with this value will + // be assigned to colors[n-1]. + Max float64 `json:"max,omitempty"` + + // Min: Lower-end of the interpolation range: rows with this value will + // be assigned to colors[0]. + Min float64 `json:"min,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Colors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *StyleFunctionGradient) MarshalJSON() ([]byte, error) { + type noMethod StyleFunctionGradient + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type StyleFunctionGradientColors struct { + // Color: Color in #RRGGBB format. + Color string `json:"color,omitempty"` + + // Opacity: Opacity of the color: 0.0 (transparent) to 1.0 (opaque). + Opacity float64 `json:"opacity,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Color") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *StyleFunctionGradientColors) MarshalJSON() ([]byte, error) { + type noMethod StyleFunctionGradientColors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// StyleSetting: Represents a complete StyleSettings object. The primary +// key is a combination of the tableId and a styleId. +type StyleSetting struct { + // Kind: The kind of item this is. A StyleSetting contains the style + // definitions for points, lines, and polygons in a table. Since a table + // can have any one or all of them, a style definition can have point, + // line and polygon style definitions. + Kind string `json:"kind,omitempty"` + + // MarkerOptions: Style definition for points in the table. + MarkerOptions *PointStyle `json:"markerOptions,omitempty"` + + // Name: Optional name for the style setting. + Name string `json:"name,omitempty"` + + // PolygonOptions: Style definition for polygons in the table. + PolygonOptions *PolygonStyle `json:"polygonOptions,omitempty"` + + // PolylineOptions: Style definition for lines in the table. + PolylineOptions *LineStyle `json:"polylineOptions,omitempty"` + + // StyleId: Identifier for the style setting (unique only within + // tables). + StyleId int64 `json:"styleId,omitempty"` + + // TableId: Identifier for the table. + TableId string `json:"tableId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *StyleSetting) MarshalJSON() ([]byte, error) { + type noMethod StyleSetting + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// StyleSettingList: Represents a list of styles for a given table. +type StyleSettingList struct { + // Items: All requested style settings. + Items []*StyleSetting `json:"items,omitempty"` + + // Kind: The kind of item this is. For a style list, this is always + // fusiontables#styleSettingList . + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token used to access the next page of this result. No + // token is displayed if there are no more styles left. + NextPageToken string `json:"nextPageToken,omitempty"` + + // TotalItems: Total number of styles for the table. + TotalItems int64 `json:"totalItems,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *StyleSettingList) MarshalJSON() ([]byte, error) { + type noMethod StyleSettingList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Table: Represents a table. +type Table struct { + // Attribution: Attribution assigned to the table. + Attribution string `json:"attribution,omitempty"` + + // AttributionLink: Optional link for attribution. + AttributionLink string `json:"attributionLink,omitempty"` + + // BaseTableIds: Base table identifier if this table is a view or merged + // table. + BaseTableIds []string `json:"baseTableIds,omitempty"` + + // ColumnPropertiesJsonSchema: Default JSON schema for validating all + // JSON column properties. + ColumnPropertiesJsonSchema string `json:"columnPropertiesJsonSchema,omitempty"` + + // Columns: Columns in the table. + Columns []*Column `json:"columns,omitempty"` + + // Description: Description assigned to the table. + Description string `json:"description,omitempty"` + + // IsExportable: Variable for whether table is exportable. + IsExportable bool `json:"isExportable,omitempty"` + + // Kind: The kind of item this is. For a table, this is always + // fusiontables#table. + Kind string `json:"kind,omitempty"` + + // Name: Name assigned to a table. + Name string `json:"name,omitempty"` + + // Sql: SQL that encodes the table definition for derived tables. + Sql string `json:"sql,omitempty"` + + // TableId: Encrypted unique alphanumeric identifier for the table. + TableId string `json:"tableId,omitempty"` + + // TablePropertiesJson: JSON object containing custom table properties. + TablePropertiesJson string `json:"tablePropertiesJson,omitempty"` + + // TablePropertiesJsonSchema: JSON schema for validating the JSON table + // properties. + TablePropertiesJsonSchema string `json:"tablePropertiesJsonSchema,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Attribution") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Table) MarshalJSON() ([]byte, error) { + type noMethod Table + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TableList: Represents a list of tables. +type TableList struct { + // Items: List of all requested tables. + Items []*Table `json:"items,omitempty"` + + // Kind: The kind of item this is. For table list, this is always + // fusiontables#tableList. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token used to access the next page of this result. No + // token is displayed if there are no more pages left. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TableList) MarshalJSON() ([]byte, error) { + type noMethod TableList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Task: A background task on a table, initiated for time- or +// resource-consuming operations such as changing column types or +// deleting all rows. +type Task struct { + // Kind: Type of the resource. This is always "fusiontables#task". + Kind string `json:"kind,omitempty"` + + // Progress: Task percentage completion. + Progress string `json:"progress,omitempty"` + + // Started: false while the table is busy with some other task. true if + // this background task is currently running. + Started bool `json:"started,omitempty"` + + // TaskId: Identifier for the task. + TaskId int64 `json:"taskId,omitempty,string"` + + // Type: Type of background task. + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Task) MarshalJSON() ([]byte, error) { + type noMethod Task + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TaskList: Represents a list of tasks for a table. +type TaskList struct { + // Items: List of all requested tasks. + Items []*Task `json:"items,omitempty"` + + // Kind: Type of the resource. This is always "fusiontables#taskList". + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token used to access the next page of this result. No + // token is displayed if there are no more pages left. + NextPageToken string `json:"nextPageToken,omitempty"` + + // TotalItems: Total number of tasks for the table. + TotalItems int64 `json:"totalItems,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TaskList) MarshalJSON() ([]byte, error) { + type noMethod TaskList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Template: Represents the contents of InfoWindow templates. +type Template struct { + // AutomaticColumnNames: List of columns from which the template is to + // be automatically constructed. Only one of body or automaticColumns + // can be specified. + AutomaticColumnNames []string `json:"automaticColumnNames,omitempty"` + + // Body: Body of the template. It contains HTML with {column_name} to + // insert values from a particular column. The body is sanitized to + // remove certain tags, e.g., script. Only one of body or + // automaticColumns can be specified. + Body string `json:"body,omitempty"` + + // Kind: The kind of item this is. For a template, this is always + // fusiontables#template. + Kind string `json:"kind,omitempty"` + + // Name: Optional name assigned to a template. + Name string `json:"name,omitempty"` + + // TableId: Identifier for the table for which the template is defined. + TableId string `json:"tableId,omitempty"` + + // TemplateId: Identifier for the template, unique within the context of + // a particular table. + TemplateId int64 `json:"templateId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "AutomaticColumnNames") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Template) MarshalJSON() ([]byte, error) { + type noMethod Template + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TemplateList: Represents a list of templates for a given table. +type TemplateList struct { + // Items: List of all requested templates. + Items []*Template `json:"items,omitempty"` + + // Kind: The kind of item this is. For a template list, this is always + // fusiontables#templateList . + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token used to access the next page of this result. No + // token is displayed if there are no more pages left. + NextPageToken string `json:"nextPageToken,omitempty"` + + // TotalItems: Total number of templates for the table. + TotalItems int64 `json:"totalItems,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TemplateList) MarshalJSON() ([]byte, error) { + type noMethod TemplateList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "fusiontables.column.delete": + +type ColumnDeleteCall struct { + s *Service + tableId string + columnId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified column. +func (r *ColumnService) Delete(tableId string, columnId string) *ColumnDeleteCall { + c := &ColumnDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.columnId = columnId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ColumnDeleteCall) Fields(s ...googleapi.Field) *ColumnDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ColumnDeleteCall) Context(ctx context.Context) *ColumnDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ColumnDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/columns/{columnId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "columnId": c.columnId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.column.delete" call. +func (c *ColumnDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the specified column.", + // "httpMethod": "DELETE", + // "id": "fusiontables.column.delete", + // "parameterOrder": [ + // "tableId", + // "columnId" + // ], + // "parameters": { + // "columnId": { + // "description": "Name or identifier for the column being deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tableId": { + // "description": "Table from which the column is being deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/columns/{columnId}", + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.column.get": + +type ColumnGetCall struct { + s *Service + tableId string + columnId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves a specific column by its ID. +func (r *ColumnService) Get(tableId string, columnId string) *ColumnGetCall { + c := &ColumnGetCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.columnId = columnId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ColumnGetCall) Fields(s ...googleapi.Field) *ColumnGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ColumnGetCall) IfNoneMatch(entityTag string) *ColumnGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ColumnGetCall) Context(ctx context.Context) *ColumnGetCall { + c.ctx_ = ctx + return c +} + +func (c *ColumnGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/columns/{columnId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "columnId": c.columnId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.column.get" call. +// Exactly one of *Column or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Column.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ColumnGetCall) Do() (*Column, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Column{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a specific column by its ID.", + // "httpMethod": "GET", + // "id": "fusiontables.column.get", + // "parameterOrder": [ + // "tableId", + // "columnId" + // ], + // "parameters": { + // "columnId": { + // "description": "Name or identifier for the column that is being requested.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tableId": { + // "description": "Table to which the column belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/columns/{columnId}", + // "response": { + // "$ref": "Column" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables", + // "https://www.googleapis.com/auth/fusiontables.readonly" + // ] + // } + +} + +// method id "fusiontables.column.insert": + +type ColumnInsertCall struct { + s *Service + tableId string + column *Column + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Adds a new column to the table. +func (r *ColumnService) Insert(tableId string, column *Column) *ColumnInsertCall { + c := &ColumnInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.column = column + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ColumnInsertCall) Fields(s ...googleapi.Field) *ColumnInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ColumnInsertCall) Context(ctx context.Context) *ColumnInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ColumnInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.column) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/columns") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.column.insert" call. +// Exactly one of *Column or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Column.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ColumnInsertCall) Do() (*Column, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Column{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds a new column to the table.", + // "httpMethod": "POST", + // "id": "fusiontables.column.insert", + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "tableId": { + // "description": "Table for which a new column is being added.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/columns", + // "request": { + // "$ref": "Column" + // }, + // "response": { + // "$ref": "Column" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.column.list": + +type ColumnListCall struct { + s *Service + tableId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of columns. +func (r *ColumnService) List(tableId string) *ColumnListCall { + c := &ColumnListCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of columns to return. Default is 5. +func (c *ColumnListCall) MaxResults(maxResults int64) *ColumnListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +// specifying which result page to return. +func (c *ColumnListCall) PageToken(pageToken string) *ColumnListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ColumnListCall) Fields(s ...googleapi.Field) *ColumnListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ColumnListCall) IfNoneMatch(entityTag string) *ColumnListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ColumnListCall) Context(ctx context.Context) *ColumnListCall { + c.ctx_ = ctx + return c +} + +func (c *ColumnListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/columns") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.column.list" call. +// Exactly one of *ColumnList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ColumnList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ColumnListCall) Do() (*ColumnList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ColumnList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of columns.", + // "httpMethod": "GET", + // "id": "fusiontables.column.list", + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of columns to return. Default is 5.", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Continuation token specifying which result page to return.", + // "location": "query", + // "type": "string" + // }, + // "tableId": { + // "description": "Table whose columns are being listed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/columns", + // "response": { + // "$ref": "ColumnList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables", + // "https://www.googleapis.com/auth/fusiontables.readonly" + // ] + // } + +} + +// method id "fusiontables.column.patch": + +type ColumnPatchCall struct { + s *Service + tableId string + columnId string + column *Column + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates the name or type of an existing column. This method +// supports patch semantics. +func (r *ColumnService) Patch(tableId string, columnId string, column *Column) *ColumnPatchCall { + c := &ColumnPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.columnId = columnId + c.column = column + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ColumnPatchCall) Fields(s ...googleapi.Field) *ColumnPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ColumnPatchCall) Context(ctx context.Context) *ColumnPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ColumnPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.column) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/columns/{columnId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "columnId": c.columnId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.column.patch" call. +// Exactly one of *Column or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Column.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ColumnPatchCall) Do() (*Column, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Column{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the name or type of an existing column. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "fusiontables.column.patch", + // "parameterOrder": [ + // "tableId", + // "columnId" + // ], + // "parameters": { + // "columnId": { + // "description": "Name or identifier for the column that is being updated.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tableId": { + // "description": "Table for which the column is being updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/columns/{columnId}", + // "request": { + // "$ref": "Column" + // }, + // "response": { + // "$ref": "Column" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.column.update": + +type ColumnUpdateCall struct { + s *Service + tableId string + columnId string + column *Column + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates the name or type of an existing column. +func (r *ColumnService) Update(tableId string, columnId string, column *Column) *ColumnUpdateCall { + c := &ColumnUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.columnId = columnId + c.column = column + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ColumnUpdateCall) Fields(s ...googleapi.Field) *ColumnUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ColumnUpdateCall) Context(ctx context.Context) *ColumnUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ColumnUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.column) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/columns/{columnId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "columnId": c.columnId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.column.update" call. +// Exactly one of *Column or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Column.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ColumnUpdateCall) Do() (*Column, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Column{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the name or type of an existing column.", + // "httpMethod": "PUT", + // "id": "fusiontables.column.update", + // "parameterOrder": [ + // "tableId", + // "columnId" + // ], + // "parameters": { + // "columnId": { + // "description": "Name or identifier for the column that is being updated.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tableId": { + // "description": "Table for which the column is being updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/columns/{columnId}", + // "request": { + // "$ref": "Column" + // }, + // "response": { + // "$ref": "Column" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.query.sql": + +type QuerySqlCall struct { + s *Service + sql string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Sql: Executes a Fusion Tables SQL statement, which can be any of +// - SELECT +// - INSERT +// - UPDATE +// - DELETE +// - SHOW +// - DESCRIBE +// - CREATE statement. +func (r *QueryService) Sql(sql string) *QuerySqlCall { + c := &QuerySqlCall{s: r.s, opt_: make(map[string]interface{})} + c.sql = sql + return c +} + +// Hdrs sets the optional parameter "hdrs": Whether column names are +// included in the first row. Default is true. +func (c *QuerySqlCall) Hdrs(hdrs bool) *QuerySqlCall { + c.opt_["hdrs"] = hdrs + return c +} + +// Typed sets the optional parameter "typed": Whether typed values are +// returned in the (JSON) response: numbers for numeric values and +// parsed geometries for KML values. Default is true. +func (c *QuerySqlCall) Typed(typed bool) *QuerySqlCall { + c.opt_["typed"] = typed + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *QuerySqlCall) Fields(s ...googleapi.Field) *QuerySqlCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *QuerySqlCall) Context(ctx context.Context) *QuerySqlCall { + c.ctx_ = ctx + return c +} + +func (c *QuerySqlCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("sql", fmt.Sprintf("%v", c.sql)) + if v, ok := c.opt_["hdrs"]; ok { + params.Set("hdrs", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["typed"]; ok { + params.Set("typed", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "query") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *QuerySqlCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "fusiontables.query.sql" call. +// Exactly one of *Sqlresponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Sqlresponse.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *QuerySqlCall) Do() (*Sqlresponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Sqlresponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Executes a Fusion Tables SQL statement, which can be any of \n- SELECT\n- INSERT\n- UPDATE\n- DELETE\n- SHOW\n- DESCRIBE\n- CREATE statement.", + // "httpMethod": "POST", + // "id": "fusiontables.query.sql", + // "parameterOrder": [ + // "sql" + // ], + // "parameters": { + // "hdrs": { + // "description": "Whether column names are included in the first row. Default is true.", + // "location": "query", + // "type": "boolean" + // }, + // "sql": { + // "description": "A Fusion Tables SQL statement, which can be any of \n- SELECT\n- INSERT\n- UPDATE\n- DELETE\n- SHOW\n- DESCRIBE\n- CREATE", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "typed": { + // "description": "Whether typed values are returned in the (JSON) response: numbers for numeric values and parsed geometries for KML values. Default is true.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "query", + // "response": { + // "$ref": "Sqlresponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables", + // "https://www.googleapis.com/auth/fusiontables.readonly" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "fusiontables.query.sqlGet": + +type QuerySqlGetCall struct { + s *Service + sql string + opt_ map[string]interface{} + ctx_ context.Context +} + +// SqlGet: Executes a SQL statement which can be any of +// - SELECT +// - SHOW +// - DESCRIBE +func (r *QueryService) SqlGet(sql string) *QuerySqlGetCall { + c := &QuerySqlGetCall{s: r.s, opt_: make(map[string]interface{})} + c.sql = sql + return c +} + +// Hdrs sets the optional parameter "hdrs": Whether column names are +// included (in the first row). Default is true. +func (c *QuerySqlGetCall) Hdrs(hdrs bool) *QuerySqlGetCall { + c.opt_["hdrs"] = hdrs + return c +} + +// Typed sets the optional parameter "typed": Whether typed values are +// returned in the (JSON) response: numbers for numeric values and +// parsed geometries for KML values. Default is true. +func (c *QuerySqlGetCall) Typed(typed bool) *QuerySqlGetCall { + c.opt_["typed"] = typed + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *QuerySqlGetCall) Fields(s ...googleapi.Field) *QuerySqlGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *QuerySqlGetCall) IfNoneMatch(entityTag string) *QuerySqlGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *QuerySqlGetCall) Context(ctx context.Context) *QuerySqlGetCall { + c.ctx_ = ctx + return c +} + +func (c *QuerySqlGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("sql", fmt.Sprintf("%v", c.sql)) + if v, ok := c.opt_["hdrs"]; ok { + params.Set("hdrs", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["typed"]; ok { + params.Set("typed", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "query") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *QuerySqlGetCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "fusiontables.query.sqlGet" call. +// Exactly one of *Sqlresponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Sqlresponse.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *QuerySqlGetCall) Do() (*Sqlresponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Sqlresponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Executes a SQL statement which can be any of \n- SELECT\n- SHOW\n- DESCRIBE", + // "httpMethod": "GET", + // "id": "fusiontables.query.sqlGet", + // "parameterOrder": [ + // "sql" + // ], + // "parameters": { + // "hdrs": { + // "description": "Whether column names are included (in the first row). Default is true.", + // "location": "query", + // "type": "boolean" + // }, + // "sql": { + // "description": "A SQL statement which can be any of \n- SELECT\n- SHOW\n- DESCRIBE", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "typed": { + // "description": "Whether typed values are returned in the (JSON) response: numbers for numeric values and parsed geometries for KML values. Default is true.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "query", + // "response": { + // "$ref": "Sqlresponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables", + // "https://www.googleapis.com/auth/fusiontables.readonly" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "fusiontables.style.delete": + +type StyleDeleteCall struct { + s *Service + tableId string + styleId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a style. +func (r *StyleService) Delete(tableId string, styleId int64) *StyleDeleteCall { + c := &StyleDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.styleId = styleId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *StyleDeleteCall) Fields(s ...googleapi.Field) *StyleDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *StyleDeleteCall) Context(ctx context.Context) *StyleDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *StyleDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/styles/{styleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "styleId": strconv.FormatInt(c.styleId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.style.delete" call. +func (c *StyleDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a style.", + // "httpMethod": "DELETE", + // "id": "fusiontables.style.delete", + // "parameterOrder": [ + // "tableId", + // "styleId" + // ], + // "parameters": { + // "styleId": { + // "description": "Identifier (within a table) for the style being deleted", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "tableId": { + // "description": "Table from which the style is being deleted", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/styles/{styleId}", + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.style.get": + +type StyleGetCall struct { + s *Service + tableId string + styleId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a specific style. +func (r *StyleService) Get(tableId string, styleId int64) *StyleGetCall { + c := &StyleGetCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.styleId = styleId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *StyleGetCall) Fields(s ...googleapi.Field) *StyleGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *StyleGetCall) IfNoneMatch(entityTag string) *StyleGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *StyleGetCall) Context(ctx context.Context) *StyleGetCall { + c.ctx_ = ctx + return c +} + +func (c *StyleGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/styles/{styleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "styleId": strconv.FormatInt(c.styleId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.style.get" call. +// Exactly one of *StyleSetting or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *StyleSetting.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *StyleGetCall) Do() (*StyleSetting, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &StyleSetting{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a specific style.", + // "httpMethod": "GET", + // "id": "fusiontables.style.get", + // "parameterOrder": [ + // "tableId", + // "styleId" + // ], + // "parameters": { + // "styleId": { + // "description": "Identifier (integer) for a specific style in a table", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "tableId": { + // "description": "Table to which the requested style belongs", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/styles/{styleId}", + // "response": { + // "$ref": "StyleSetting" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables", + // "https://www.googleapis.com/auth/fusiontables.readonly" + // ] + // } + +} + +// method id "fusiontables.style.insert": + +type StyleInsertCall struct { + s *Service + tableId string + stylesetting *StyleSetting + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Adds a new style for the table. +func (r *StyleService) Insert(tableId string, stylesetting *StyleSetting) *StyleInsertCall { + c := &StyleInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.stylesetting = stylesetting + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *StyleInsertCall) Fields(s ...googleapi.Field) *StyleInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *StyleInsertCall) Context(ctx context.Context) *StyleInsertCall { + c.ctx_ = ctx + return c +} + +func (c *StyleInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.stylesetting) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/styles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.style.insert" call. +// Exactly one of *StyleSetting or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *StyleSetting.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *StyleInsertCall) Do() (*StyleSetting, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &StyleSetting{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds a new style for the table.", + // "httpMethod": "POST", + // "id": "fusiontables.style.insert", + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "tableId": { + // "description": "Table for which a new style is being added", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/styles", + // "request": { + // "$ref": "StyleSetting" + // }, + // "response": { + // "$ref": "StyleSetting" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.style.list": + +type StyleListCall struct { + s *Service + tableId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of styles. +func (r *StyleService) List(tableId string) *StyleListCall { + c := &StyleListCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of styles to return. Default is 5. +func (c *StyleListCall) MaxResults(maxResults int64) *StyleListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +// specifying which result page to return. +func (c *StyleListCall) PageToken(pageToken string) *StyleListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *StyleListCall) Fields(s ...googleapi.Field) *StyleListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *StyleListCall) IfNoneMatch(entityTag string) *StyleListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *StyleListCall) Context(ctx context.Context) *StyleListCall { + c.ctx_ = ctx + return c +} + +func (c *StyleListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/styles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.style.list" call. +// Exactly one of *StyleSettingList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *StyleSettingList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *StyleListCall) Do() (*StyleSettingList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &StyleSettingList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of styles.", + // "httpMethod": "GET", + // "id": "fusiontables.style.list", + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of styles to return. Optional. Default is 5.", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Continuation token specifying which result page to return. Optional.", + // "location": "query", + // "type": "string" + // }, + // "tableId": { + // "description": "Table whose styles are being listed", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/styles", + // "response": { + // "$ref": "StyleSettingList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables", + // "https://www.googleapis.com/auth/fusiontables.readonly" + // ] + // } + +} + +// method id "fusiontables.style.patch": + +type StylePatchCall struct { + s *Service + tableId string + styleId int64 + stylesetting *StyleSetting + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing style. This method supports patch +// semantics. +func (r *StyleService) Patch(tableId string, styleId int64, stylesetting *StyleSetting) *StylePatchCall { + c := &StylePatchCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.styleId = styleId + c.stylesetting = stylesetting + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *StylePatchCall) Fields(s ...googleapi.Field) *StylePatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *StylePatchCall) Context(ctx context.Context) *StylePatchCall { + c.ctx_ = ctx + return c +} + +func (c *StylePatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.stylesetting) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/styles/{styleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "styleId": strconv.FormatInt(c.styleId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.style.patch" call. +// Exactly one of *StyleSetting or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *StyleSetting.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *StylePatchCall) Do() (*StyleSetting, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &StyleSetting{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing style. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "fusiontables.style.patch", + // "parameterOrder": [ + // "tableId", + // "styleId" + // ], + // "parameters": { + // "styleId": { + // "description": "Identifier (within a table) for the style being updated.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "tableId": { + // "description": "Table whose style is being updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/styles/{styleId}", + // "request": { + // "$ref": "StyleSetting" + // }, + // "response": { + // "$ref": "StyleSetting" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.style.update": + +type StyleUpdateCall struct { + s *Service + tableId string + styleId int64 + stylesetting *StyleSetting + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing style. +func (r *StyleService) Update(tableId string, styleId int64, stylesetting *StyleSetting) *StyleUpdateCall { + c := &StyleUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.styleId = styleId + c.stylesetting = stylesetting + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *StyleUpdateCall) Fields(s ...googleapi.Field) *StyleUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *StyleUpdateCall) Context(ctx context.Context) *StyleUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *StyleUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.stylesetting) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/styles/{styleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "styleId": strconv.FormatInt(c.styleId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.style.update" call. +// Exactly one of *StyleSetting or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *StyleSetting.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *StyleUpdateCall) Do() (*StyleSetting, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &StyleSetting{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing style.", + // "httpMethod": "PUT", + // "id": "fusiontables.style.update", + // "parameterOrder": [ + // "tableId", + // "styleId" + // ], + // "parameters": { + // "styleId": { + // "description": "Identifier (within a table) for the style being updated.", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // }, + // "tableId": { + // "description": "Table whose style is being updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/styles/{styleId}", + // "request": { + // "$ref": "StyleSetting" + // }, + // "response": { + // "$ref": "StyleSetting" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.table.copy": + +type TableCopyCall struct { + s *Service + tableId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Copy: Copies a table. +func (r *TableService) Copy(tableId string) *TableCopyCall { + c := &TableCopyCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + return c +} + +// CopyPresentation sets the optional parameter "copyPresentation": +// Whether to also copy tabs, styles, and templates. Default is false. +func (c *TableCopyCall) CopyPresentation(copyPresentation bool) *TableCopyCall { + c.opt_["copyPresentation"] = copyPresentation + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TableCopyCall) Fields(s ...googleapi.Field) *TableCopyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TableCopyCall) Context(ctx context.Context) *TableCopyCall { + c.ctx_ = ctx + return c +} + +func (c *TableCopyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["copyPresentation"]; ok { + params.Set("copyPresentation", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/copy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.table.copy" call. +// Exactly one of *Table or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Table.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TableCopyCall) Do() (*Table, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Table{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Copies a table.", + // "httpMethod": "POST", + // "id": "fusiontables.table.copy", + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "copyPresentation": { + // "description": "Whether to also copy tabs, styles, and templates. Default is false.", + // "location": "query", + // "type": "boolean" + // }, + // "tableId": { + // "description": "ID of the table that is being copied.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/copy", + // "response": { + // "$ref": "Table" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables", + // "https://www.googleapis.com/auth/fusiontables.readonly" + // ] + // } + +} + +// method id "fusiontables.table.delete": + +type TableDeleteCall struct { + s *Service + tableId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a table. +func (r *TableService) Delete(tableId string) *TableDeleteCall { + c := &TableDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TableDeleteCall) Fields(s ...googleapi.Field) *TableDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TableDeleteCall) Context(ctx context.Context) *TableDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TableDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.table.delete" call. +func (c *TableDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a table.", + // "httpMethod": "DELETE", + // "id": "fusiontables.table.delete", + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "tableId": { + // "description": "ID of the table to be deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}", + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.table.get": + +type TableGetCall struct { + s *Service + tableId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves a specific table by its ID. +func (r *TableService) Get(tableId string) *TableGetCall { + c := &TableGetCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TableGetCall) Fields(s ...googleapi.Field) *TableGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TableGetCall) IfNoneMatch(entityTag string) *TableGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TableGetCall) Context(ctx context.Context) *TableGetCall { + c.ctx_ = ctx + return c +} + +func (c *TableGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.table.get" call. +// Exactly one of *Table or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Table.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TableGetCall) Do() (*Table, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Table{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a specific table by its ID.", + // "httpMethod": "GET", + // "id": "fusiontables.table.get", + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "tableId": { + // "description": "Identifier for the table being requested.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}", + // "response": { + // "$ref": "Table" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables", + // "https://www.googleapis.com/auth/fusiontables.readonly" + // ] + // } + +} + +// method id "fusiontables.table.importRows": + +type TableImportRowsCall struct { + s *Service + tableId string + opt_ map[string]interface{} + media_ io.Reader + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// ImportRows: Imports more rows into a table. +func (r *TableService) ImportRows(tableId string) *TableImportRowsCall { + c := &TableImportRowsCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + return c +} + +// Delimiter sets the optional parameter "delimiter": The delimiter used +// to separate cell values. This can only consist of a single character. +// Default is ,. +func (c *TableImportRowsCall) Delimiter(delimiter string) *TableImportRowsCall { + c.opt_["delimiter"] = delimiter + return c +} + +// Encoding sets the optional parameter "encoding": The encoding of the +// content. Default is UTF-8. Use auto-detect if you are unsure of the +// encoding. +func (c *TableImportRowsCall) Encoding(encoding string) *TableImportRowsCall { + c.opt_["encoding"] = encoding + return c +} + +// EndLine sets the optional parameter "endLine": The index of the line +// up to which data will be imported. Default is to import the entire +// file. If endLine is negative, it is an offset from the end of the +// file; the imported content will exclude the last endLine lines. +func (c *TableImportRowsCall) EndLine(endLine int64) *TableImportRowsCall { + c.opt_["endLine"] = endLine + return c +} + +// IsStrict sets the optional parameter "isStrict": Whether the imported +// CSV must have the same number of values for each row. If false, rows +// with fewer values will be padded with empty values. Default is true. +func (c *TableImportRowsCall) IsStrict(isStrict bool) *TableImportRowsCall { + c.opt_["isStrict"] = isStrict + return c +} + +// StartLine sets the optional parameter "startLine": The index of the +// first line from which to start importing, inclusive. Default is 0. +func (c *TableImportRowsCall) StartLine(startLine int64) *TableImportRowsCall { + c.opt_["startLine"] = startLine + return c +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *TableImportRowsCall) Media(r io.Reader) *TableImportRowsCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *TableImportRowsCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *TableImportRowsCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *TableImportRowsCall) ProgressUpdater(pu googleapi.ProgressUpdater) *TableImportRowsCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TableImportRowsCall) Fields(s ...googleapi.Field) *TableImportRowsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *TableImportRowsCall) Context(ctx context.Context) *TableImportRowsCall { + c.ctx_ = ctx + return c +} + +func (c *TableImportRowsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["delimiter"]; ok { + params.Set("delimiter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["encoding"]; ok { + params.Set("encoding", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["endLine"]; ok { + params.Set("endLine", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["isStrict"]; ok { + params.Set("isStrict", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startLine"]; ok { + params.Set("startLine", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/import") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + body = new(bytes.Buffer) + ctype := "application/json" + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.table.importRows" call. +// Exactly one of *Import or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Import.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TableImportRowsCall) Do() (*Import, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &Import{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Imports more rows into a table.", + // "httpMethod": "POST", + // "id": "fusiontables.table.importRows", + // "mediaUpload": { + // "accept": [ + // "application/octet-stream" + // ], + // "maxSize": "250MB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/fusiontables/v2/tables/{tableId}/import" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/fusiontables/v2/tables/{tableId}/import" + // } + // } + // }, + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "delimiter": { + // "description": "The delimiter used to separate cell values. This can only consist of a single character. Default is ,.", + // "location": "query", + // "type": "string" + // }, + // "encoding": { + // "description": "The encoding of the content. Default is UTF-8. Use auto-detect if you are unsure of the encoding.", + // "location": "query", + // "type": "string" + // }, + // "endLine": { + // "description": "The index of the line up to which data will be imported. Default is to import the entire file. If endLine is negative, it is an offset from the end of the file; the imported content will exclude the last endLine lines.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "isStrict": { + // "description": "Whether the imported CSV must have the same number of values for each row. If false, rows with fewer values will be padded with empty values. Default is true.", + // "location": "query", + // "type": "boolean" + // }, + // "startLine": { + // "description": "The index of the first line from which to start importing, inclusive. Default is 0.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "tableId": { + // "description": "The table into which new rows are being imported.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/import", + // "response": { + // "$ref": "Import" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "fusiontables.table.importTable": + +type TableImportTableCall struct { + s *Service + name string + opt_ map[string]interface{} + media_ io.Reader + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// ImportTable: Imports a new table. +func (r *TableService) ImportTable(name string) *TableImportTableCall { + c := &TableImportTableCall{s: r.s, opt_: make(map[string]interface{})} + c.name = name + return c +} + +// Delimiter sets the optional parameter "delimiter": The delimiter used +// to separate cell values. This can only consist of a single character. +// Default is ,. +func (c *TableImportTableCall) Delimiter(delimiter string) *TableImportTableCall { + c.opt_["delimiter"] = delimiter + return c +} + +// Encoding sets the optional parameter "encoding": The encoding of the +// content. Default is UTF-8. Use auto-detect if you are unsure of the +// encoding. +func (c *TableImportTableCall) Encoding(encoding string) *TableImportTableCall { + c.opt_["encoding"] = encoding + return c +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *TableImportTableCall) Media(r io.Reader) *TableImportTableCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *TableImportTableCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *TableImportTableCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *TableImportTableCall) ProgressUpdater(pu googleapi.ProgressUpdater) *TableImportTableCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TableImportTableCall) Fields(s ...googleapi.Field) *TableImportTableCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *TableImportTableCall) Context(ctx context.Context) *TableImportTableCall { + c.ctx_ = ctx + return c +} + +func (c *TableImportTableCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("name", fmt.Sprintf("%v", c.name)) + if v, ok := c.opt_["delimiter"]; ok { + params.Set("delimiter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["encoding"]; ok { + params.Set("encoding", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/import") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + body = new(bytes.Buffer) + ctype := "application/json" + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.table.importTable" call. +// Exactly one of *Table or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Table.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TableImportTableCall) Do() (*Table, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &Table{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Imports a new table.", + // "httpMethod": "POST", + // "id": "fusiontables.table.importTable", + // "mediaUpload": { + // "accept": [ + // "application/octet-stream" + // ], + // "maxSize": "250MB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/fusiontables/v2/tables/import" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/fusiontables/v2/tables/import" + // } + // } + // }, + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "delimiter": { + // "description": "The delimiter used to separate cell values. This can only consist of a single character. Default is ,.", + // "location": "query", + // "type": "string" + // }, + // "encoding": { + // "description": "The encoding of the content. Default is UTF-8. Use auto-detect if you are unsure of the encoding.", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The name to be assigned to the new table.", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/import", + // "response": { + // "$ref": "Table" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "fusiontables.table.insert": + +type TableInsertCall struct { + s *Service + table *Table + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a new table. +func (r *TableService) Insert(table *Table) *TableInsertCall { + c := &TableInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.table = table + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TableInsertCall) Fields(s ...googleapi.Field) *TableInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TableInsertCall) Context(ctx context.Context) *TableInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TableInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.table.insert" call. +// Exactly one of *Table or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Table.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TableInsertCall) Do() (*Table, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Table{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new table.", + // "httpMethod": "POST", + // "id": "fusiontables.table.insert", + // "path": "tables", + // "request": { + // "$ref": "Table" + // }, + // "response": { + // "$ref": "Table" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.table.list": + +type TableListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of tables a user owns. +func (r *TableService) List() *TableListCall { + c := &TableListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of tables to return. Default is 5. +func (c *TableListCall) MaxResults(maxResults int64) *TableListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +// specifying which result page to return. +func (c *TableListCall) PageToken(pageToken string) *TableListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TableListCall) Fields(s ...googleapi.Field) *TableListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TableListCall) IfNoneMatch(entityTag string) *TableListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TableListCall) Context(ctx context.Context) *TableListCall { + c.ctx_ = ctx + return c +} + +func (c *TableListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.table.list" call. +// Exactly one of *TableList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TableList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TableListCall) Do() (*TableList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TableList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of tables a user owns.", + // "httpMethod": "GET", + // "id": "fusiontables.table.list", + // "parameters": { + // "maxResults": { + // "description": "Maximum number of tables to return. Default is 5.", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Continuation token specifying which result page to return.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "tables", + // "response": { + // "$ref": "TableList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables", + // "https://www.googleapis.com/auth/fusiontables.readonly" + // ] + // } + +} + +// method id "fusiontables.table.patch": + +type TablePatchCall struct { + s *Service + tableId string + table *Table + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing table. Unless explicitly requested, only +// the name, description, and attribution will be updated. This method +// supports patch semantics. +func (r *TableService) Patch(tableId string, table *Table) *TablePatchCall { + c := &TablePatchCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.table = table + return c +} + +// ReplaceViewDefinition sets the optional parameter +// "replaceViewDefinition": Whether the view definition is also updated. +// The specified view definition replaces the existing one. Only a view +// can be updated with a new definition. +func (c *TablePatchCall) ReplaceViewDefinition(replaceViewDefinition bool) *TablePatchCall { + c.opt_["replaceViewDefinition"] = replaceViewDefinition + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablePatchCall) Fields(s ...googleapi.Field) *TablePatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablePatchCall) Context(ctx context.Context) *TablePatchCall { + c.ctx_ = ctx + return c +} + +func (c *TablePatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["replaceViewDefinition"]; ok { + params.Set("replaceViewDefinition", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.table.patch" call. +// Exactly one of *Table or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Table.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TablePatchCall) Do() (*Table, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Table{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing table. Unless explicitly requested, only the name, description, and attribution will be updated. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "fusiontables.table.patch", + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "replaceViewDefinition": { + // "description": "Whether the view definition is also updated. The specified view definition replaces the existing one. Only a view can be updated with a new definition.", + // "location": "query", + // "type": "boolean" + // }, + // "tableId": { + // "description": "ID of the table that is being updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}", + // "request": { + // "$ref": "Table" + // }, + // "response": { + // "$ref": "Table" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.table.replaceRows": + +type TableReplaceRowsCall struct { + s *Service + tableId string + opt_ map[string]interface{} + media_ io.Reader + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// ReplaceRows: Replaces rows of an existing table. Current rows remain +// visible until all replacement rows are ready. +func (r *TableService) ReplaceRows(tableId string) *TableReplaceRowsCall { + c := &TableReplaceRowsCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + return c +} + +// Delimiter sets the optional parameter "delimiter": The delimiter used +// to separate cell values. This can only consist of a single character. +// Default is ,. +func (c *TableReplaceRowsCall) Delimiter(delimiter string) *TableReplaceRowsCall { + c.opt_["delimiter"] = delimiter + return c +} + +// Encoding sets the optional parameter "encoding": The encoding of the +// content. Default is UTF-8. Use 'auto-detect' if you are unsure of the +// encoding. +func (c *TableReplaceRowsCall) Encoding(encoding string) *TableReplaceRowsCall { + c.opt_["encoding"] = encoding + return c +} + +// EndLine sets the optional parameter "endLine": The index of the line +// up to which data will be imported. Default is to import the entire +// file. If endLine is negative, it is an offset from the end of the +// file; the imported content will exclude the last endLine lines. +func (c *TableReplaceRowsCall) EndLine(endLine int64) *TableReplaceRowsCall { + c.opt_["endLine"] = endLine + return c +} + +// IsStrict sets the optional parameter "isStrict": Whether the imported +// CSV must have the same number of column values for each row. If true, +// throws an exception if the CSV does not have the same number of +// columns. If false, rows with fewer column values will be padded with +// empty values. Default is true. +func (c *TableReplaceRowsCall) IsStrict(isStrict bool) *TableReplaceRowsCall { + c.opt_["isStrict"] = isStrict + return c +} + +// StartLine sets the optional parameter "startLine": The index of the +// first line from which to start importing, inclusive. Default is 0. +func (c *TableReplaceRowsCall) StartLine(startLine int64) *TableReplaceRowsCall { + c.opt_["startLine"] = startLine + return c +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *TableReplaceRowsCall) Media(r io.Reader) *TableReplaceRowsCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *TableReplaceRowsCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *TableReplaceRowsCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *TableReplaceRowsCall) ProgressUpdater(pu googleapi.ProgressUpdater) *TableReplaceRowsCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TableReplaceRowsCall) Fields(s ...googleapi.Field) *TableReplaceRowsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *TableReplaceRowsCall) Context(ctx context.Context) *TableReplaceRowsCall { + c.ctx_ = ctx + return c +} + +func (c *TableReplaceRowsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["delimiter"]; ok { + params.Set("delimiter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["encoding"]; ok { + params.Set("encoding", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["endLine"]; ok { + params.Set("endLine", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["isStrict"]; ok { + params.Set("isStrict", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["startLine"]; ok { + params.Set("startLine", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/replace") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + body = new(bytes.Buffer) + ctype := "application/json" + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.table.replaceRows" call. +// Exactly one of *Task or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Task.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *TableReplaceRowsCall) Do() (*Task, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &Task{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Replaces rows of an existing table. Current rows remain visible until all replacement rows are ready.", + // "httpMethod": "POST", + // "id": "fusiontables.table.replaceRows", + // "mediaUpload": { + // "accept": [ + // "application/octet-stream" + // ], + // "maxSize": "250MB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/fusiontables/v2/tables/{tableId}/replace" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/fusiontables/v2/tables/{tableId}/replace" + // } + // } + // }, + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "delimiter": { + // "description": "The delimiter used to separate cell values. This can only consist of a single character. Default is ,.", + // "location": "query", + // "type": "string" + // }, + // "encoding": { + // "description": "The encoding of the content. Default is UTF-8. Use 'auto-detect' if you are unsure of the encoding.", + // "location": "query", + // "type": "string" + // }, + // "endLine": { + // "description": "The index of the line up to which data will be imported. Default is to import the entire file. If endLine is negative, it is an offset from the end of the file; the imported content will exclude the last endLine lines.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "isStrict": { + // "description": "Whether the imported CSV must have the same number of column values for each row. If true, throws an exception if the CSV does not have the same number of columns. If false, rows with fewer column values will be padded with empty values. Default is true.", + // "location": "query", + // "type": "boolean" + // }, + // "startLine": { + // "description": "The index of the first line from which to start importing, inclusive. Default is 0.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "tableId": { + // "description": "Table whose rows will be replaced.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/replace", + // "response": { + // "$ref": "Task" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "fusiontables.table.update": + +type TableUpdateCall struct { + s *Service + tableId string + table *Table + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing table. Unless explicitly requested, only +// the name, description, and attribution will be updated. +func (r *TableService) Update(tableId string, table *Table) *TableUpdateCall { + c := &TableUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.table = table + return c +} + +// ReplaceViewDefinition sets the optional parameter +// "replaceViewDefinition": Whether the view definition is also updated. +// The specified view definition replaces the existing one. Only a view +// can be updated with a new definition. +func (c *TableUpdateCall) ReplaceViewDefinition(replaceViewDefinition bool) *TableUpdateCall { + c.opt_["replaceViewDefinition"] = replaceViewDefinition + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TableUpdateCall) Fields(s ...googleapi.Field) *TableUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TableUpdateCall) Context(ctx context.Context) *TableUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *TableUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["replaceViewDefinition"]; ok { + params.Set("replaceViewDefinition", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.table.update" call. +// Exactly one of *Table or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Table.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TableUpdateCall) Do() (*Table, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Table{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing table. Unless explicitly requested, only the name, description, and attribution will be updated.", + // "httpMethod": "PUT", + // "id": "fusiontables.table.update", + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "replaceViewDefinition": { + // "description": "Whether the view definition is also updated. The specified view definition replaces the existing one. Only a view can be updated with a new definition.", + // "location": "query", + // "type": "boolean" + // }, + // "tableId": { + // "description": "ID of the table that is being updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}", + // "request": { + // "$ref": "Table" + // }, + // "response": { + // "$ref": "Table" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.task.delete": + +type TaskDeleteCall struct { + s *Service + tableId string + taskId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a specific task by its ID, unless that task has +// already started running. +func (r *TaskService) Delete(tableId string, taskId string) *TaskDeleteCall { + c := &TaskDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.taskId = taskId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TaskDeleteCall) Fields(s ...googleapi.Field) *TaskDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TaskDeleteCall) Context(ctx context.Context) *TaskDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TaskDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/tasks/{taskId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "taskId": c.taskId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.task.delete" call. +func (c *TaskDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a specific task by its ID, unless that task has already started running.", + // "httpMethod": "DELETE", + // "id": "fusiontables.task.delete", + // "parameterOrder": [ + // "tableId", + // "taskId" + // ], + // "parameters": { + // "tableId": { + // "description": "Table from which the task is being deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "taskId": { + // "description": "The identifier of the task to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/tasks/{taskId}", + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.task.get": + +type TaskGetCall struct { + s *Service + tableId string + taskId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves a specific task by its ID. +func (r *TaskService) Get(tableId string, taskId string) *TaskGetCall { + c := &TaskGetCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.taskId = taskId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TaskGetCall) Fields(s ...googleapi.Field) *TaskGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TaskGetCall) IfNoneMatch(entityTag string) *TaskGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TaskGetCall) Context(ctx context.Context) *TaskGetCall { + c.ctx_ = ctx + return c +} + +func (c *TaskGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/tasks/{taskId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "taskId": c.taskId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.task.get" call. +// Exactly one of *Task or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Task.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *TaskGetCall) Do() (*Task, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Task{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a specific task by its ID.", + // "httpMethod": "GET", + // "id": "fusiontables.task.get", + // "parameterOrder": [ + // "tableId", + // "taskId" + // ], + // "parameters": { + // "tableId": { + // "description": "Table to which the task belongs.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "taskId": { + // "description": "The identifier of the task to get.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/tasks/{taskId}", + // "response": { + // "$ref": "Task" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables", + // "https://www.googleapis.com/auth/fusiontables.readonly" + // ] + // } + +} + +// method id "fusiontables.task.list": + +type TaskListCall struct { + s *Service + tableId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of tasks. +func (r *TaskService) List(tableId string) *TaskListCall { + c := &TaskListCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of tasks to return. Default is 5. +func (c *TaskListCall) MaxResults(maxResults int64) *TaskListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +// specifying which result page to return. +func (c *TaskListCall) PageToken(pageToken string) *TaskListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StartIndex sets the optional parameter "startIndex": Index of the +// first result returned in the current page. +func (c *TaskListCall) StartIndex(startIndex int64) *TaskListCall { + c.opt_["startIndex"] = startIndex + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TaskListCall) Fields(s ...googleapi.Field) *TaskListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TaskListCall) IfNoneMatch(entityTag string) *TaskListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TaskListCall) Context(ctx context.Context) *TaskListCall { + c.ctx_ = ctx + return c +} + +func (c *TaskListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/tasks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.task.list" call. +// Exactly one of *TaskList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *TaskList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TaskListCall) Do() (*TaskList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TaskList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of tasks.", + // "httpMethod": "GET", + // "id": "fusiontables.task.list", + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of tasks to return. Default is 5.", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Continuation token specifying which result page to return.", + // "location": "query", + // "type": "string" + // }, + // "startIndex": { + // "description": "Index of the first result returned in the current page.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "tableId": { + // "description": "Table whose tasks are being listed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/tasks", + // "response": { + // "$ref": "TaskList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables", + // "https://www.googleapis.com/auth/fusiontables.readonly" + // ] + // } + +} + +// method id "fusiontables.template.delete": + +type TemplateDeleteCall struct { + s *Service + tableId string + templateId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a template +func (r *TemplateService) Delete(tableId string, templateId int64) *TemplateDeleteCall { + c := &TemplateDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.templateId = templateId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TemplateDeleteCall) Fields(s ...googleapi.Field) *TemplateDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TemplateDeleteCall) Context(ctx context.Context) *TemplateDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TemplateDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/templates/{templateId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "templateId": strconv.FormatInt(c.templateId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.template.delete" call. +func (c *TemplateDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a template", + // "httpMethod": "DELETE", + // "id": "fusiontables.template.delete", + // "parameterOrder": [ + // "tableId", + // "templateId" + // ], + // "parameters": { + // "tableId": { + // "description": "Table from which the template is being deleted", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "templateId": { + // "description": "Identifier for the template which is being deleted", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "tables/{tableId}/templates/{templateId}", + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.template.get": + +type TemplateGetCall struct { + s *Service + tableId string + templateId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves a specific template by its id +func (r *TemplateService) Get(tableId string, templateId int64) *TemplateGetCall { + c := &TemplateGetCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.templateId = templateId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TemplateGetCall) Fields(s ...googleapi.Field) *TemplateGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TemplateGetCall) IfNoneMatch(entityTag string) *TemplateGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TemplateGetCall) Context(ctx context.Context) *TemplateGetCall { + c.ctx_ = ctx + return c +} + +func (c *TemplateGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/templates/{templateId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "templateId": strconv.FormatInt(c.templateId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.template.get" call. +// Exactly one of *Template or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Template.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TemplateGetCall) Do() (*Template, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Template{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a specific template by its id", + // "httpMethod": "GET", + // "id": "fusiontables.template.get", + // "parameterOrder": [ + // "tableId", + // "templateId" + // ], + // "parameters": { + // "tableId": { + // "description": "Table to which the template belongs", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "templateId": { + // "description": "Identifier for the template that is being requested", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "tables/{tableId}/templates/{templateId}", + // "response": { + // "$ref": "Template" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables", + // "https://www.googleapis.com/auth/fusiontables.readonly" + // ] + // } + +} + +// method id "fusiontables.template.insert": + +type TemplateInsertCall struct { + s *Service + tableId string + template *Template + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a new template for the table. +func (r *TemplateService) Insert(tableId string, template *Template) *TemplateInsertCall { + c := &TemplateInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.template = template + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TemplateInsertCall) Fields(s ...googleapi.Field) *TemplateInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TemplateInsertCall) Context(ctx context.Context) *TemplateInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TemplateInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.template) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/templates") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.template.insert" call. +// Exactly one of *Template or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Template.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TemplateInsertCall) Do() (*Template, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Template{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new template for the table.", + // "httpMethod": "POST", + // "id": "fusiontables.template.insert", + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "tableId": { + // "description": "Table for which a new template is being created", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/templates", + // "request": { + // "$ref": "Template" + // }, + // "response": { + // "$ref": "Template" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.template.list": + +type TemplateListCall struct { + s *Service + tableId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of templates. +func (r *TemplateService) List(tableId string) *TemplateListCall { + c := &TemplateListCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of templates to return. Default is 5. +func (c *TemplateListCall) MaxResults(maxResults int64) *TemplateListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Continuation token +// specifying which results page to return. +func (c *TemplateListCall) PageToken(pageToken string) *TemplateListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TemplateListCall) Fields(s ...googleapi.Field) *TemplateListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TemplateListCall) IfNoneMatch(entityTag string) *TemplateListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TemplateListCall) Context(ctx context.Context) *TemplateListCall { + c.ctx_ = ctx + return c +} + +func (c *TemplateListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/templates") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.template.list" call. +// Exactly one of *TemplateList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TemplateList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TemplateListCall) Do() (*TemplateList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TemplateList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of templates.", + // "httpMethod": "GET", + // "id": "fusiontables.template.list", + // "parameterOrder": [ + // "tableId" + // ], + // "parameters": { + // "maxResults": { + // "description": "Maximum number of templates to return. Optional. Default is 5.", + // "format": "uint32", + // "location": "query", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Continuation token specifying which results page to return. Optional.", + // "location": "query", + // "type": "string" + // }, + // "tableId": { + // "description": "Identifier for the table whose templates are being requested", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{tableId}/templates", + // "response": { + // "$ref": "TemplateList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables", + // "https://www.googleapis.com/auth/fusiontables.readonly" + // ] + // } + +} + +// method id "fusiontables.template.patch": + +type TemplatePatchCall struct { + s *Service + tableId string + templateId int64 + template *Template + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an existing template. This method supports patch +// semantics. +func (r *TemplateService) Patch(tableId string, templateId int64, template *Template) *TemplatePatchCall { + c := &TemplatePatchCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.templateId = templateId + c.template = template + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TemplatePatchCall) Fields(s ...googleapi.Field) *TemplatePatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TemplatePatchCall) Context(ctx context.Context) *TemplatePatchCall { + c.ctx_ = ctx + return c +} + +func (c *TemplatePatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.template) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/templates/{templateId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "templateId": strconv.FormatInt(c.templateId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.template.patch" call. +// Exactly one of *Template or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Template.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TemplatePatchCall) Do() (*Template, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Template{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing template. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "fusiontables.template.patch", + // "parameterOrder": [ + // "tableId", + // "templateId" + // ], + // "parameters": { + // "tableId": { + // "description": "Table to which the updated template belongs", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "templateId": { + // "description": "Identifier for the template that is being updated", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "tables/{tableId}/templates/{templateId}", + // "request": { + // "$ref": "Template" + // }, + // "response": { + // "$ref": "Template" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} + +// method id "fusiontables.template.update": + +type TemplateUpdateCall struct { + s *Service + tableId string + templateId int64 + template *Template + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing template +func (r *TemplateService) Update(tableId string, templateId int64, template *Template) *TemplateUpdateCall { + c := &TemplateUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.tableId = tableId + c.templateId = templateId + c.template = template + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TemplateUpdateCall) Fields(s ...googleapi.Field) *TemplateUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TemplateUpdateCall) Context(ctx context.Context) *TemplateUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *TemplateUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.template) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/templates/{templateId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "templateId": strconv.FormatInt(c.templateId, 10), + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "fusiontables.template.update" call. +// Exactly one of *Template or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Template.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TemplateUpdateCall) Do() (*Template, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Template{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing template", + // "httpMethod": "PUT", + // "id": "fusiontables.template.update", + // "parameterOrder": [ + // "tableId", + // "templateId" + // ], + // "parameters": { + // "tableId": { + // "description": "Table to which the updated template belongs", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "templateId": { + // "description": "Identifier for the template that is being updated", + // "format": "int32", + // "location": "path", + // "required": true, + // "type": "integer" + // } + // }, + // "path": "tables/{tableId}/templates/{templateId}", + // "request": { + // "$ref": "Template" + // }, + // "response": { + // "$ref": "Template" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/fusiontables" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/games/v1/games-api.json b/Godeps/_workspace/src/google.golang.org/api/games/v1/games-api.json new file mode 100644 index 000000000..29ef29755 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/games/v1/games-api.json @@ -0,0 +1,4806 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/P7g-a3C968F6LpsV-dK3V_5H2MQ\"", + "discoveryVersion": "v1", + "id": "games:v1", + "name": "games", + "canonicalName": "Games", + "version": "v1", + "revision": "20151012", + "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/drive.appdata": { + "description": "View and manage its own configuration data in your Google Drive" + }, + "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." + }, + "experiencePoints": { + "type": "string", + "description": "Experience points which will be earned when unlocking this achievement.", + "format": "int64" + }, + "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." + }, + "enabledFeatures": { + "type": "array", + "description": "A list of features that have been enabled for the application.\nPossible values are: \n- \"SNAPSHOTS\" - Snapshots has been enabled", + "items": { + "type": "string" + } + }, + "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." + }, + "themeColor": { + "type": "string", + "description": "A hint to the client UI for what color to use as an app-themed color. The color is given as an RGB triplet (e.g. \"E0E0E0\")." + } + } + }, + "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." + } + } + }, + "Category": { + "id": "Category", + "type": "object", + "description": "This is a JSON template for data related to individual game categories.", + "properties": { + "category": { + "type": "string", + "description": "The category name." + }, + "experiencePoints": { + "type": "string", + "description": "Experience points earned in this category.", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#category.", + "default": "games#category" + } + } + }, + "CategoryListResponse": { + "id": "CategoryListResponse", + "type": "object", + "description": "This is a JSON template for a list of category data objects.", + "properties": { + "items": { + "type": "array", + "description": "The list of categories with usage data.", + "items": { + "$ref": "Category" + } + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#categoryListResponse.", + "default": "games#categoryListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Token corresponding to the next page of results." + } + } + }, + "EventBatchRecordFailure": { + "id": "EventBatchRecordFailure", + "type": "object", + "description": "This is a JSON template for a batch update failure resource.", + "properties": { + "failureCause": { + "type": "string", + "description": "The cause for the update failure.\nPossible values are: \n- \"TOO_LARGE\": A batch request was issued with more events than are allowed in a single batch. \n- \"TIME_PERIOD_EXPIRED\": A batch was sent with data too far in the past to record. \n- \"TIME_PERIOD_SHORT\": A batch was sent with a time range that was too short. \n- \"TIME_PERIOD_LONG\": A batch was sent with a time range that was too long. \n- \"ALREADY_UPDATED\": An attempt was made to record a batch of data which was already seen. \n- \"RECORD_RATE_HIGH\": An attempt was made to record data faster than the server will apply updates." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#eventBatchRecordFailure.", + "default": "games#eventBatchRecordFailure" + }, + "range": { + "$ref": "EventPeriodRange", + "description": "The time range which was rejected; empty for a request-wide failure." + } + } + }, + "EventChild": { + "id": "EventChild", + "type": "object", + "description": "This is a JSON template for an event child relationship resource.", + "properties": { + "childId": { + "type": "string", + "description": "The ID of the child event." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#eventChild.", + "default": "games#eventChild" + } + } + }, + "EventDefinition": { + "id": "EventDefinition", + "type": "object", + "description": "This is a JSON template for an event definition resource.", + "properties": { + "childEvents": { + "type": "array", + "description": "A list of events that are a child of this event.", + "items": { + "$ref": "EventChild" + } + }, + "description": { + "type": "string", + "description": "Description of what this event represents." + }, + "displayName": { + "type": "string", + "description": "The name to display for the event." + }, + "id": { + "type": "string", + "description": "The ID of the event." + }, + "imageUrl": { + "type": "string", + "description": "The base URL for the image that represents the event." + }, + "isDefaultImageUrl": { + "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#eventDefinition.", + "default": "games#eventDefinition" + }, + "visibility": { + "type": "string", + "description": "The visibility of event being tracked in this definition.\nPossible values are: \n- \"REVEALED\": This event should be visible to all users. \n- \"HIDDEN\": This event should only be shown to users that have recorded this event at least once." + } + } + }, + "EventDefinitionListResponse": { + "id": "EventDefinitionListResponse", + "type": "object", + "description": "This is a JSON template for a ListDefinitions response.", + "properties": { + "items": { + "type": "array", + "description": "The event definitions.", + "items": { + "$ref": "EventDefinition" + } + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#eventDefinitionListResponse.", + "default": "games#eventDefinitionListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The pagination token for the next page of results." + } + } + }, + "EventPeriodRange": { + "id": "EventPeriodRange", + "type": "object", + "description": "This is a JSON template for an event period time range.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#eventPeriodRange.", + "default": "games#eventPeriodRange" + }, + "periodEndMillis": { + "type": "string", + "description": "The time when this update period ends, in millis, since 1970 UTC (Unix Epoch).", + "format": "int64" + }, + "periodStartMillis": { + "type": "string", + "description": "The time when this update period begins, in millis, since 1970 UTC (Unix Epoch).", + "format": "int64" + } + } + }, + "EventPeriodUpdate": { + "id": "EventPeriodUpdate", + "type": "object", + "description": "This is a JSON template for an event period update resource.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#eventPeriodUpdate.", + "default": "games#eventPeriodUpdate" + }, + "timePeriod": { + "$ref": "EventPeriodRange", + "description": "The time period being covered by this update." + }, + "updates": { + "type": "array", + "description": "The updates being made for this time period.", + "items": { + "$ref": "EventUpdateRequest" + } + } + } + }, + "EventRecordFailure": { + "id": "EventRecordFailure", + "type": "object", + "description": "This is a JSON template for an event update failure resource.", + "properties": { + "eventId": { + "type": "string", + "description": "The ID of the event that was not updated." + }, + "failureCause": { + "type": "string", + "description": "The cause for the update failure.\nPossible values are: \n- \"NOT_FOUND\" - An attempt was made to set an event that was not defined. \n- \"INVALID_UPDATE_VALUE\" - An attempt was made to increment an event by a non-positive value." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#eventRecordFailure.", + "default": "games#eventRecordFailure" + } + } + }, + "EventRecordRequest": { + "id": "EventRecordRequest", + "type": "object", + "description": "This is a JSON template for an event period update resource.", + "properties": { + "currentTimeMillis": { + "type": "string", + "description": "The current time when this update was sent, in milliseconds, since 1970 UTC (Unix Epoch).", + "format": "int64" + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#eventRecordRequest.", + "default": "games#eventRecordRequest" + }, + "requestId": { + "type": "string", + "description": "The request ID used to identify this attempt to record events.", + "format": "int64" + }, + "timePeriods": { + "type": "array", + "description": "A list of the time period updates being made in this request.", + "items": { + "$ref": "EventPeriodUpdate" + } + } + } + }, + "EventUpdateRequest": { + "id": "EventUpdateRequest", + "type": "object", + "description": "This is a JSON template for an event period update resource.", + "properties": { + "definitionId": { + "type": "string", + "description": "The ID of the event being modified in this update." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#eventUpdateRequest.", + "default": "games#eventUpdateRequest" + }, + "updateCount": { + "type": "string", + "description": "The number of times this event occurred in this time period.", + "format": "int64" + } + } + }, + "EventUpdateResponse": { + "id": "EventUpdateResponse", + "type": "object", + "description": "This is a JSON template for an event period update resource.", + "properties": { + "batchFailures": { + "type": "array", + "description": "Any batch-wide failures which occurred applying updates.", + "items": { + "$ref": "EventBatchRecordFailure" + } + }, + "eventFailures": { + "type": "array", + "description": "Any failures updating a particular event.", + "items": { + "$ref": "EventRecordFailure" + } + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#eventUpdateResponse.", + "default": "games#eventUpdateResponse" + }, + "playerEvents": { + "type": "array", + "description": "The current status of any updated events", + "items": { + "$ref": "PlayerEvent" + } + } + } + }, + "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." + } + } + }, + "MetagameConfig": { + "id": "MetagameConfig", + "type": "object", + "description": "This is a JSON template for the metagame config resource", + "properties": { + "currentVersion": { + "type": "integer", + "description": "Current version of the metagame configuration data. When this data is updated, the version number will be increased by one.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#metagameConfig.", + "default": "games#metagameConfig" + }, + "playerLevels": { + "type": "array", + "description": "The list of player levels.", + "items": { + "$ref": "PlayerLevel" + } + } + } + }, + "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" + }, + "networkOperatorCode": { + "type": "string", + "description": "The MCC+MNC code for the client's network connection. On Android: http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperator() On iOS, see: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html" + }, + "networkOperatorName": { + "type": "string", + "description": "The name of the carrier of the client's network connection. On Android: http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperatorName() On iOS: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html#//apple_ref/occ/instp/CTCarrier/carrierName" + }, + "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 metadata about a player playing a game with the currently authenticated user.", + "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." + }, + "experienceInfo": { + "$ref": "PlayerExperienceInfo", + "description": "An object to represent Play Game experience information 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. For some players, these fields may not be present.", + "properties": { + "familyName": { + "type": "string", + "description": "The family name of this player. In some places, this is known as the last name." + }, + "givenName": { + "type": "string", + "description": "The given name of this player. In some places, this is known as the first name." + } + } + }, + "playerId": { + "type": "string", + "description": "The ID of the player." + }, + "title": { + "type": "string", + "description": "The player's title rewarded for their game activities." + } + } + }, + "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" + }, + "experiencePoints": { + "type": "string", + "description": "Experience points earned for the achievement. This field is absent for achievements that have not yet been unlocked and 0 for achievements that have been unlocked by testers but that are unpublished.", + "format": "int64" + }, + "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." + } + } + }, + "PlayerEvent": { + "id": "PlayerEvent", + "type": "object", + "description": "This is a JSON template for an event status resource.", + "properties": { + "definitionId": { + "type": "string", + "description": "The ID of the event definition." + }, + "formattedNumEvents": { + "type": "string", + "description": "The current number of times this event has occurred, as a string. The formatting of this string depends on the configuration of your event in the Play Games Developer Console." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#playerEvent.", + "default": "games#playerEvent" + }, + "numEvents": { + "type": "string", + "description": "The current number of times this event has occurred.", + "format": "int64" + }, + "playerId": { + "type": "string", + "description": "The ID of the player." + } + } + }, + "PlayerEventListResponse": { + "id": "PlayerEventListResponse", + "type": "object", + "description": "This is a JSON template for a ListByPlayer response.", + "properties": { + "items": { + "type": "array", + "description": "The player events.", + "items": { + "$ref": "PlayerEvent" + } + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#playerEventListResponse.", + "default": "games#playerEventListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The pagination token for the next page of results." + } + } + }, + "PlayerExperienceInfo": { + "id": "PlayerExperienceInfo", + "type": "object", + "description": "This is a JSON template for 1P/3P metadata about the player's experience.", + "properties": { + "currentExperiencePoints": { + "type": "string", + "description": "The current number of experience points for the player.", + "format": "int64" + }, + "currentLevel": { + "$ref": "PlayerLevel", + "description": "The current level of the player." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#playerExperienceInfo.", + "default": "games#playerExperienceInfo" + }, + "lastLevelUpTimestampMillis": { + "type": "string", + "description": "The timestamp when the player was leveled up, in millis since Unix epoch UTC.", + "format": "int64" + }, + "nextLevel": { + "$ref": "PlayerLevel", + "description": "The next level of the player. If the current level is the maximum level, this should be same as the current level." + } + } + }, + "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." + } + } + }, + "PlayerLevel": { + "id": "PlayerLevel", + "type": "object", + "description": "This is a JSON template for 1P/3P metadata about a user's level.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#playerLevel.", + "default": "games#playerLevel" + }, + "level": { + "type": "integer", + "description": "The level for the user.", + "format": "int32" + }, + "maxExperiencePoints": { + "type": "string", + "description": "The maximum experience points for this level.", + "format": "int64" + }, + "minExperiencePoints": { + "type": "string", + "description": "The minimum experience points for this level.", + "format": "int64" + } + } + }, + "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": "Indicates whether this token should be used for the production or sandbox APNS server." + } + } + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#pushTokenId.", + "default": "games#pushTokenId" + } + } + }, + "Quest": { + "id": "Quest", + "type": "object", + "description": "This is a JSON template for a Quest resource.", + "properties": { + "acceptedTimestampMillis": { + "type": "string", + "description": "The timestamp at which the user accepted the quest in milliseconds since the epoch in UTC. Only present if the player has accepted the quest.", + "format": "int64" + }, + "applicationId": { + "type": "string", + "description": "The ID of the application this quest is part of." + }, + "bannerUrl": { + "type": "string", + "description": "The banner image URL for the quest." + }, + "description": { + "type": "string", + "description": "The description of the quest." + }, + "endTimestampMillis": { + "type": "string", + "description": "The timestamp at which the quest ceases to be active in milliseconds since the epoch in UTC.", + "format": "int64" + }, + "iconUrl": { + "type": "string", + "description": "The icon image URL for the quest." + }, + "id": { + "type": "string", + "description": "The ID of the quest." + }, + "isDefaultBannerUrl": { + "type": "boolean", + "description": "Indicates whether the banner image being returned is a default image, or is game-provided." + }, + "isDefaultIconUrl": { + "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#quest.", + "default": "games#quest" + }, + "lastUpdatedTimestampMillis": { + "type": "string", + "description": "The timestamp at which the quest was last updated by the user in milliseconds since the epoch in UTC. Only present if the player has accepted the quest.", + "format": "int64" + }, + "milestones": { + "type": "array", + "description": "The quest milestones.", + "items": { + "$ref": "QuestMilestone" + } + }, + "name": { + "type": "string", + "description": "The name of the quest." + }, + "notifyTimestampMillis": { + "type": "string", + "description": "The timestamp at which the user should be notified that the quest will end soon in milliseconds since the epoch in UTC.", + "format": "int64" + }, + "startTimestampMillis": { + "type": "string", + "description": "The timestamp at which the quest becomes active in milliseconds since the epoch in UTC.", + "format": "int64" + }, + "state": { + "type": "string", + "description": "The state of the quest.\nPossible values are: \n- \"UPCOMING\": The quest is upcoming. The user can see the quest, but cannot accept it until it is open. \n- \"OPEN\": The quest is currently open and may be accepted at this time. \n- \"ACCEPTED\": The user is currently participating in this quest. \n- \"COMPLETED\": The user has completed the quest. \n- \"FAILED\": The quest was attempted but was not completed before the deadline expired. \n- \"EXPIRED\": The quest has expired and was not accepted. \n- \"DELETED\": The quest should be deleted from the local database." + } + } + }, + "QuestContribution": { + "id": "QuestContribution", + "type": "object", + "description": "This is a JSON template for a Quest Criterion Contribution resource.", + "properties": { + "formattedValue": { + "type": "string", + "description": "The formatted value of the contribution as a string. Format depends on the configuration for the associated event definition in the Play Games Developer Console." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#questContribution.", + "default": "games#questContribution" + }, + "value": { + "type": "string", + "description": "The value of the contribution.", + "format": "int64" + } + } + }, + "QuestCriterion": { + "id": "QuestCriterion", + "type": "object", + "description": "This is a JSON template for a Quest Criterion resource.", + "properties": { + "completionContribution": { + "$ref": "QuestContribution", + "description": "The total number of times the associated event must be incremented for the player to complete this quest." + }, + "currentContribution": { + "$ref": "QuestContribution", + "description": "The number of increments the player has made toward the completion count event increments required to complete the quest. This value will not exceed the completion contribution.\nThere will be no currentContribution until the player has accepted the quest." + }, + "eventId": { + "type": "string", + "description": "The ID of the event the criterion corresponds to." + }, + "initialPlayerProgress": { + "$ref": "QuestContribution", + "description": "The value of the event associated with this quest at the time that the quest was accepted. This value may change if event increments that took place before the start of quest are uploaded after the quest starts.\nThere will be no initialPlayerProgress until the player has accepted the quest." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#questCriterion.", + "default": "games#questCriterion" + } + } + }, + "QuestListResponse": { + "id": "QuestListResponse", + "type": "object", + "description": "This is a JSON template for a list of quest objects.", + "properties": { + "items": { + "type": "array", + "description": "The quests.", + "items": { + "$ref": "Quest" + } + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#questListResponse.", + "default": "games#questListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Token corresponding to the next page of results." + } + } + }, + "QuestMilestone": { + "id": "QuestMilestone", + "type": "object", + "description": "This is a JSON template for a Quest Milestone resource.", + "properties": { + "completionRewardData": { + "type": "string", + "description": "The completion reward data of the milestone, represented as a Base64-encoded string. This is a developer-specified binary blob with size between 0 and 2 KB before encoding.", + "format": "byte" + }, + "criteria": { + "type": "array", + "description": "The criteria of the milestone.", + "items": { + "$ref": "QuestCriterion" + } + }, + "id": { + "type": "string", + "description": "The milestone ID." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#questMilestone.", + "default": "games#questMilestone" + }, + "state": { + "type": "string", + "description": "The current state of the milestone.\nPossible values are: \n- \"COMPLETED_NOT_CLAIMED\" - The milestone is complete, but has not yet been claimed. \n- \"CLAIMED\" - The milestone is complete and has been claimed. \n- \"NOT_COMPLETED\" - The milestone has not yet been completed. \n- \"NOT_STARTED\" - The milestone is for a quest that has not yet been accepted." + } + } + }, + "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" + }, + "networkOperatorCode": { + "type": "string", + "description": "The MCC+MNC code for the client's network connection. On Android: http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperator() On iOS, see: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html" + }, + "networkOperatorName": { + "type": "string", + "description": "The name of the carrier of the client's network connection. On Android: http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperatorName() On iOS: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html#//apple_ref/occ/instp/CTCarrier/carrierName" + }, + "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. \n- \"REALTIME_CLIENT_DISCONNECTING\" - The client disconnects without first calling Leave. \n- \"REALTIME_SIGN_OUT\" - The user signed out of G+ while in the room. \n- \"REALTIME_GAME_CRASHED\" - The game crashed. \n- \"REALTIME_ROOM_SERVICE_CRASHED\" - RoomAndroidService crashed. \n- \"REALTIME_DIFFERENT_CLIENT_ROOM_OPERATION\" - Another client is trying to enter a room. \n- \"REALTIME_SAME_CLIENT_ROOM_OPERATION\" - The same client is trying to enter a new 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}" + }, + "signature": { + "type": "string", + "description": "Signature Values will contain URI-safe characters as defined by section 2.3 of RFC 3986." + } + } + }, + "Snapshot": { + "id": "Snapshot", + "type": "object", + "description": "This is a JSON template for an snapshot object.", + "properties": { + "coverImage": { + "$ref": "SnapshotImage", + "description": "The cover image of this snapshot. May be absent if there is no image." + }, + "description": { + "type": "string", + "description": "The description of this snapshot." + }, + "driveId": { + "type": "string", + "description": "The ID of the file underlying this snapshot in the Drive API. Only present if the snapshot is a view on a Drive file and the file is owned by the caller." + }, + "durationMillis": { + "type": "string", + "description": "The duration associated with this snapshot, in millis.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "The ID of the snapshot." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#snapshot.", + "default": "games#snapshot" + }, + "lastModifiedMillis": { + "type": "string", + "description": "The timestamp (in millis since Unix epoch) of the last modification to this snapshot.", + "format": "int64" + }, + "progressValue": { + "type": "string", + "description": "The progress value (64-bit integer set by developer) associated with this snapshot.", + "format": "int64" + }, + "title": { + "type": "string", + "description": "The title of this snapshot." + }, + "type": { + "type": "string", + "description": "The type of this snapshot.\nPossible values are: \n- \"SAVE_GAME\" - A snapshot representing a save game." + }, + "uniqueName": { + "type": "string", + "description": "The unique name provided when the snapshot was created." + } + } + }, + "SnapshotImage": { + "id": "SnapshotImage", + "type": "object", + "description": "This is a JSON template for an image of a snapshot.", + "properties": { + "height": { + "type": "integer", + "description": "The height of the image.", + "format": "int32" + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#snapshotImage.", + "default": "games#snapshotImage" + }, + "mime_type": { + "type": "string", + "description": "The MIME type of the image." + }, + "url": { + "type": "string", + "description": "The URL of the image. This URL may be invalidated at any time and should not be cached." + }, + "width": { + "type": "integer", + "description": "The width of the image.", + "format": "int32" + } + } + }, + "SnapshotListResponse": { + "id": "SnapshotListResponse", + "type": "object", + "description": "This is a JSON template for a list of snapshot objects.", + "properties": { + "items": { + "type": "array", + "description": "The snapshots.", + "items": { + "$ref": "Snapshot" + } + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#snapshotListResponse.", + "default": "games#snapshotListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "Token corresponding to the next page of results. If there are no more results, the token is omitted." + } + } + }, + "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 ID from the Google Play developer console.", + "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" + ] + } + } + }, + "events": { + "methods": { + "listByPlayer": { + "id": "games.events.listByPlayer", + "path": "events", + "httpMethod": "GET", + "description": "Returns a list showing the current progress on events in this application for the currently authenticated user.", + "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 events to return in the response, used for paging. For any response, the actual number of events to return may be less than the specified maxResults.", + "format": "int32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The token returned by the previous request.", + "location": "query" + } + }, + "response": { + "$ref": "PlayerEventListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "listDefinitions": { + "id": "games.events.listDefinitions", + "path": "eventDefinitions", + "httpMethod": "GET", + "description": "Returns a list of the event definitions in this 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 event definitions to return in the response, used for paging. For any response, the actual number of event definitions to return may be less than the specified maxResults.", + "format": "int32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The token returned by the previous request.", + "location": "query" + } + }, + "response": { + "$ref": "EventDefinitionListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "record": { + "id": "games.events.record", + "path": "events", + "httpMethod": "POST", + "description": "Records a batch of changes to the number of times events have occurred for the currently authenticated user of this application.", + "parameters": { + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + } + }, + "request": { + "$ref": "EventRecordRequest" + }, + "response": { + "$ref": "EventUpdateResponse" + }, + "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" + ] + } + } + }, + "metagame": { + "methods": { + "getMetagameConfig": { + "id": "games.metagame.getMetagameConfig", + "path": "metagameConfig", + "httpMethod": "GET", + "description": "Return the metagame configuration data for the calling application.", + "response": { + "$ref": "MetagameConfig" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "listCategoriesByPlayer": { + "id": "games.metagame.listCategoriesByPlayer", + "path": "players/{playerId}/categories/{collection}", + "httpMethod": "GET", + "description": "List play data aggregated per category for the player corresponding to playerId.", + "parameters": { + "collection": { + "type": "string", + "description": "The collection of categories for which data will be returned.", + "required": true, + "enum": [ + "all" + ], + "enumDescriptions": [ + "Retrieve data for all categories. This is the default." + ], + "location": "path" + }, + "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 category resources to return in the response, used for paging. For any response, the actual number of category resources returned may be less than the specified maxResults.", + "format": "int32", + "minimum": "1", + "maximum": "100", + "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" + } + }, + "parameterOrder": [ + "playerId", + "collection" + ], + "response": { + "$ref": "CategoryListResponse" + }, + "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": { + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "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" + } + }, + "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": [ + "connected", + "playedWith", + "played_with" + ], + "enumDescriptions": [ + "Retrieve a list of players that are also playing this game in reverse chronological order.", + "(DEPRECATED: please use played_with!) Retrieve a list of players you have played a multiplayer game (realtime or turn-based) with recently.", + "Retrieve a list of players you have played a multiplayer game (realtime or turn-based) with recently." + ], + "location": "path" + }, + "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 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": "50", + "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" + ] + } + } + }, + "questMilestones": { + "methods": { + "claim": { + "id": "games.questMilestones.claim", + "path": "quests/{questId}/milestones/{milestoneId}/claim", + "httpMethod": "PUT", + "description": "Report that a reward for the milestone corresponding to milestoneId for the quest corresponding to questId has been claimed by the currently authorized user.", + "parameters": { + "milestoneId": { + "type": "string", + "description": "The ID of the milestone.", + "required": true, + "location": "path" + }, + "questId": { + "type": "string", + "description": "The ID of the quest.", + "required": true, + "location": "path" + }, + "requestId": { + "type": "string", + "description": "A numeric ID to ensure that the request is handled correctly across retries. Your client application must generate this ID randomly.", + "required": true, + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "questId", + "milestoneId", + "requestId" + ], + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + } + } + }, + "quests": { + "methods": { + "accept": { + "id": "games.quests.accept", + "path": "quests/{questId}/accept", + "httpMethod": "POST", + "description": "Indicates that the currently authorized user will participate in the quest.", + "parameters": { + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + }, + "questId": { + "type": "string", + "description": "The ID of the quest.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "questId" + ], + "response": { + "$ref": "Quest" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "list": { + "id": "games.quests.list", + "path": "players/{playerId}/quests", + "httpMethod": "GET", + "description": "Get a list of quests for your application and 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 quest resources to return in the response, used for paging. For any response, the actual number of quest resources returned may be less than the specified maxResults. Acceptable values are 1 to 50, inclusive. (Default: 50).", + "format": "int32", + "minimum": "1", + "maximum": "50", + "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" + } + }, + "parameterOrder": [ + "playerId" + ], + "response": { + "$ref": "QuestListResponse" + }, + "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": { + "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" + ] + }, + "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": { + "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" + ], + "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": { + "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" + ], + "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": { + "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" + ], + "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": "30", + "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": "30", + "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": "30", + "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" + ] + } + } + }, + "snapshots": { + "methods": { + "get": { + "id": "games.snapshots.get", + "path": "snapshots/{snapshotId}", + "httpMethod": "GET", + "description": "Retrieves the metadata for a given snapshot ID.", + "parameters": { + "language": { + "type": "string", + "description": "The preferred language to use for strings returned by this method.", + "location": "query" + }, + "snapshotId": { + "type": "string", + "description": "The ID of the snapshot.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "snapshotId" + ], + "response": { + "$ref": "Snapshot" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive.appdata", + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "list": { + "id": "games.snapshots.list", + "path": "players/{playerId}/snapshots", + "httpMethod": "GET", + "description": "Retrieves a list of snapshots created by your application for the player corresponding to the player ID.", + "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 snapshot resources to return in the response, used for paging. For any response, the actual number of snapshot resources 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" + } + }, + "parameterOrder": [ + "playerId" + ], + "response": { + "$ref": "SnapshotListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive.appdata", + "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/Godeps/_workspace/src/google.golang.org/api/games/v1/games-gen.go b/Godeps/_workspace/src/google.golang.org/api/games/v1/games-gen.go new file mode 100644 index 000000000..b09640cf5 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/games/v1/games-gen.go @@ -0,0 +1,11723 @@ +// Package games provides access to the Google Play Game Services API. +// +// See https://developers.google.com/games/services/ +// +// Usage example: +// +// import "google.golang.org/api/games/v1" +// ... +// gamesService, err := games.New(oauthHttpClient) +package games // import "google.golang.org/api/games/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "games:v1" +const apiName = "games" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/games/v1/" + +// OAuth2 scopes used by this API. +const ( + // View and manage its own configuration data in your Google Drive + DriveAppdataScope = "https://www.googleapis.com/auth/drive.appdata" + + // 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.Events = NewEventsService(s) + s.Leaderboards = NewLeaderboardsService(s) + s.Metagame = NewMetagameService(s) + s.Players = NewPlayersService(s) + s.Pushtokens = NewPushtokensService(s) + s.QuestMilestones = NewQuestMilestonesService(s) + s.Quests = NewQuestsService(s) + s.Revisions = NewRevisionsService(s) + s.Rooms = NewRoomsService(s) + s.Scores = NewScoresService(s) + s.Snapshots = NewSnapshotsService(s) + s.TurnBasedMatches = NewTurnBasedMatchesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + AchievementDefinitions *AchievementDefinitionsService + + Achievements *AchievementsService + + Applications *ApplicationsService + + Events *EventsService + + Leaderboards *LeaderboardsService + + Metagame *MetagameService + + Players *PlayersService + + Pushtokens *PushtokensService + + QuestMilestones *QuestMilestonesService + + Quests *QuestsService + + Revisions *RevisionsService + + Rooms *RoomsService + + Scores *ScoresService + + Snapshots *SnapshotsService + + TurnBasedMatches *TurnBasedMatchesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 NewEventsService(s *Service) *EventsService { + rs := &EventsService{s: s} + return rs +} + +type EventsService struct { + s *Service +} + +func NewLeaderboardsService(s *Service) *LeaderboardsService { + rs := &LeaderboardsService{s: s} + return rs +} + +type LeaderboardsService struct { + s *Service +} + +func NewMetagameService(s *Service) *MetagameService { + rs := &MetagameService{s: s} + return rs +} + +type MetagameService 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 NewQuestMilestonesService(s *Service) *QuestMilestonesService { + rs := &QuestMilestonesService{s: s} + return rs +} + +type QuestMilestonesService struct { + s *Service +} + +func NewQuestsService(s *Service) *QuestsService { + rs := &QuestsService{s: s} + return rs +} + +type QuestsService 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 NewSnapshotsService(s *Service) *SnapshotsService { + rs := &SnapshotsService{s: s} + return rs +} + +type SnapshotsService struct { + s *Service +} + +func NewTurnBasedMatchesService(s *Service) *TurnBasedMatchesService { + rs := &TurnBasedMatchesService{s: s} + return rs +} + +type TurnBasedMatchesService struct { + s *Service +} + +// AchievementDefinition: This is a JSON template for an achievement +// definition object. +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"` + + // ExperiencePoints: Experience points which will be earned when + // unlocking this achievement. + ExperiencePoints int64 `json:"experiencePoints,omitempty,string"` + + // 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"` + + // ForceSendFields is a list of field names (e.g. "AchievementType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AchievementDefinition) MarshalJSON() ([]byte, error) { + type noMethod AchievementDefinition + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AchievementDefinitionsListResponse: This is a JSON template for a +// list of achievement definition objects. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AchievementDefinitionsListResponse) MarshalJSON() ([]byte, error) { + type noMethod AchievementDefinitionsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AchievementIncrementResponse: This is a JSON template for an +// achievement increment response +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CurrentSteps") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AchievementIncrementResponse) MarshalJSON() ([]byte, error) { + type noMethod AchievementIncrementResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AchievementRevealResponse: This is a JSON template for an achievement +// reveal response +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CurrentState") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AchievementRevealResponse) MarshalJSON() ([]byte, error) { + type noMethod AchievementRevealResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AchievementSetStepsAtLeastResponse: This is a JSON template for an +// achievement set steps at least response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CurrentSteps") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AchievementSetStepsAtLeastResponse) MarshalJSON() ([]byte, error) { + type noMethod AchievementSetStepsAtLeastResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AchievementUnlockResponse: This is a JSON template for an achievement +// unlock response +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AchievementUnlockResponse) MarshalJSON() ([]byte, error) { + type noMethod AchievementUnlockResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AchievementUpdateMultipleRequest: This is a JSON template for a list +// of achievement update requests. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AchievementUpdateMultipleRequest) MarshalJSON() ([]byte, error) { + type noMethod AchievementUpdateMultipleRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AchievementUpdateMultipleResponse: This is a JSON template for an +// achievement unlock response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AchievementUpdateMultipleResponse) MarshalJSON() ([]byte, error) { + type noMethod AchievementUpdateMultipleResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AchievementUpdateRequest: This is a JSON template for a request to +// update an achievement. +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"` + + // ForceSendFields is a list of field names (e.g. "AchievementId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AchievementUpdateRequest) MarshalJSON() ([]byte, error) { + type noMethod AchievementUpdateRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AchievementUpdateResponse: This is a JSON template for an achievement +// update response. +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"` + + // ForceSendFields is a list of field names (e.g. "AchievementId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AchievementUpdateResponse) MarshalJSON() ([]byte, error) { + type noMethod AchievementUpdateResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AggregateStats: This is a JSON template for aggregate stats. +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"` + + // ForceSendFields is a list of field names (e.g. "Count") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AggregateStats) MarshalJSON() ([]byte, error) { + type noMethod AggregateStats + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AnonymousPlayer: This is a JSON template for an anonymous player +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"` + + // ForceSendFields is a list of field names (e.g. "AvatarImageUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AnonymousPlayer) MarshalJSON() ([]byte, error) { + type noMethod AnonymousPlayer + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Application: This is a JSON template for the Application resource. +type Application struct { + // AchievementCount: The number of achievements visible to the currently + // authenticated player. + AchievementCount 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"` + + // EnabledFeatures: A list of features that have been enabled for the + // application. + // Possible values are: + // - "SNAPSHOTS" - Snapshots has been enabled + EnabledFeatures []string `json:"enabledFeatures,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"` + + // LeaderboardCount: The number of leaderboards visible to the currently + // authenticated player. + LeaderboardCount int64 `json:"leaderboard_count,omitempty"` + + // Name: The name of the application. + Name string `json:"name,omitempty"` + + // ThemeColor: A hint to the client UI for what color to use as an + // app-themed color. The color is given as an RGB triplet (e.g. + // "E0E0E0"). + ThemeColor string `json:"themeColor,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AchievementCount") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Application) MarshalJSON() ([]byte, error) { + type noMethod Application + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ApplicationCategory: This is a JSON template for an application +// category object. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ApplicationCategory) MarshalJSON() ([]byte, error) { + type noMethod ApplicationCategory + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Category: This is a JSON template for data related to individual game +// categories. +type Category struct { + // Category: The category name. + Category string `json:"category,omitempty"` + + // ExperiencePoints: Experience points earned in this category. + ExperiencePoints int64 `json:"experiencePoints,omitempty,string"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#category. + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Category") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Category) MarshalJSON() ([]byte, error) { + type noMethod Category + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CategoryListResponse: This is a JSON template for a list of category +// data objects. +type CategoryListResponse struct { + // Items: The list of categories with usage data. + Items []*Category `json:"items,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#categoryListResponse. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token corresponding to the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CategoryListResponse) MarshalJSON() ([]byte, error) { + type noMethod CategoryListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventBatchRecordFailure: This is a JSON template for a batch update +// failure resource. +type EventBatchRecordFailure struct { + // FailureCause: The cause for the update failure. + // Possible values are: + // - "TOO_LARGE": A batch request was issued with more events than are + // allowed in a single batch. + // - "TIME_PERIOD_EXPIRED": A batch was sent with data too far in the + // past to record. + // - "TIME_PERIOD_SHORT": A batch was sent with a time range that was + // too short. + // - "TIME_PERIOD_LONG": A batch was sent with a time range that was too + // long. + // - "ALREADY_UPDATED": An attempt was made to record a batch of data + // which was already seen. + // - "RECORD_RATE_HIGH": An attempt was made to record data faster than + // the server will apply updates. + FailureCause string `json:"failureCause,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#eventBatchRecordFailure. + Kind string `json:"kind,omitempty"` + + // Range: The time range which was rejected; empty for a request-wide + // failure. + Range *EventPeriodRange `json:"range,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FailureCause") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventBatchRecordFailure) MarshalJSON() ([]byte, error) { + type noMethod EventBatchRecordFailure + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventChild: This is a JSON template for an event child relationship +// resource. +type EventChild struct { + // ChildId: The ID of the child event. + ChildId string `json:"childId,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#eventChild. + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ChildId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventChild) MarshalJSON() ([]byte, error) { + type noMethod EventChild + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventDefinition: This is a JSON template for an event definition +// resource. +type EventDefinition struct { + // ChildEvents: A list of events that are a child of this event. + ChildEvents []*EventChild `json:"childEvents,omitempty"` + + // Description: Description of what this event represents. + Description string `json:"description,omitempty"` + + // DisplayName: The name to display for the event. + DisplayName string `json:"displayName,omitempty"` + + // Id: The ID of the event. + Id string `json:"id,omitempty"` + + // ImageUrl: The base URL for the image that represents the event. + ImageUrl string `json:"imageUrl,omitempty"` + + // IsDefaultImageUrl: Indicates whether the icon image being returned is + // a default image, or is game-provided. + IsDefaultImageUrl bool `json:"isDefaultImageUrl,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#eventDefinition. + Kind string `json:"kind,omitempty"` + + // Visibility: The visibility of event being tracked in this + // definition. + // Possible values are: + // - "REVEALED": This event should be visible to all users. + // - "HIDDEN": This event should only be shown to users that have + // recorded this event at least once. + Visibility string `json:"visibility,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ChildEvents") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventDefinition) MarshalJSON() ([]byte, error) { + type noMethod EventDefinition + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventDefinitionListResponse: This is a JSON template for a +// ListDefinitions response. +type EventDefinitionListResponse struct { + // Items: The event definitions. + Items []*EventDefinition `json:"items,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#eventDefinitionListResponse. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The pagination token for the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventDefinitionListResponse) MarshalJSON() ([]byte, error) { + type noMethod EventDefinitionListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventPeriodRange: This is a JSON template for an event period time +// range. +type EventPeriodRange struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#eventPeriodRange. + Kind string `json:"kind,omitempty"` + + // PeriodEndMillis: The time when this update period ends, in millis, + // since 1970 UTC (Unix Epoch). + PeriodEndMillis int64 `json:"periodEndMillis,omitempty,string"` + + // PeriodStartMillis: The time when this update period begins, in + // millis, since 1970 UTC (Unix Epoch). + PeriodStartMillis int64 `json:"periodStartMillis,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventPeriodRange) MarshalJSON() ([]byte, error) { + type noMethod EventPeriodRange + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventPeriodUpdate: This is a JSON template for an event period update +// resource. +type EventPeriodUpdate struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#eventPeriodUpdate. + Kind string `json:"kind,omitempty"` + + // TimePeriod: The time period being covered by this update. + TimePeriod *EventPeriodRange `json:"timePeriod,omitempty"` + + // Updates: The updates being made for this time period. + Updates []*EventUpdateRequest `json:"updates,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventPeriodUpdate) MarshalJSON() ([]byte, error) { + type noMethod EventPeriodUpdate + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventRecordFailure: This is a JSON template for an event update +// failure resource. +type EventRecordFailure struct { + // EventId: The ID of the event that was not updated. + EventId string `json:"eventId,omitempty"` + + // FailureCause: The cause for the update failure. + // Possible values are: + // - "NOT_FOUND" - An attempt was made to set an event that was not + // defined. + // - "INVALID_UPDATE_VALUE" - An attempt was made to increment an event + // by a non-positive value. + FailureCause string `json:"failureCause,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#eventRecordFailure. + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "EventId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventRecordFailure) MarshalJSON() ([]byte, error) { + type noMethod EventRecordFailure + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventRecordRequest: This is a JSON template for an event period +// update resource. +type EventRecordRequest struct { + // CurrentTimeMillis: The current time when this update was sent, in + // milliseconds, since 1970 UTC (Unix Epoch). + CurrentTimeMillis int64 `json:"currentTimeMillis,omitempty,string"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#eventRecordRequest. + Kind string `json:"kind,omitempty"` + + // RequestId: The request ID used to identify this attempt to record + // events. + RequestId int64 `json:"requestId,omitempty,string"` + + // TimePeriods: A list of the time period updates being made in this + // request. + TimePeriods []*EventPeriodUpdate `json:"timePeriods,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CurrentTimeMillis") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventRecordRequest) MarshalJSON() ([]byte, error) { + type noMethod EventRecordRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventUpdateRequest: This is a JSON template for an event period +// update resource. +type EventUpdateRequest struct { + // DefinitionId: The ID of the event being modified in this update. + DefinitionId string `json:"definitionId,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#eventUpdateRequest. + Kind string `json:"kind,omitempty"` + + // UpdateCount: The number of times this event occurred in this time + // period. + UpdateCount int64 `json:"updateCount,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "DefinitionId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventUpdateRequest) MarshalJSON() ([]byte, error) { + type noMethod EventUpdateRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventUpdateResponse: This is a JSON template for an event period +// update resource. +type EventUpdateResponse struct { + // BatchFailures: Any batch-wide failures which occurred applying + // updates. + BatchFailures []*EventBatchRecordFailure `json:"batchFailures,omitempty"` + + // EventFailures: Any failures updating a particular event. + EventFailures []*EventRecordFailure `json:"eventFailures,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#eventUpdateResponse. + Kind string `json:"kind,omitempty"` + + // PlayerEvents: The current status of any updated events + PlayerEvents []*PlayerEvent `json:"playerEvents,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BatchFailures") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventUpdateResponse) MarshalJSON() ([]byte, error) { + type noMethod EventUpdateResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GamesAchievementIncrement: This is a JSON template for the payload to +// request to increment an achievement. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GamesAchievementIncrement) MarshalJSON() ([]byte, error) { + type noMethod GamesAchievementIncrement + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GamesAchievementSetStepsAtLeast: This is a JSON template for the +// payload to request to increment an achievement. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GamesAchievementSetStepsAtLeast) MarshalJSON() ([]byte, error) { + type noMethod GamesAchievementSetStepsAtLeast + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ImageAsset: This is a JSON template for an image asset object. +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"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ImageAsset) MarshalJSON() ([]byte, error) { + type noMethod ImageAsset + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Instance: This is a JSON template for the Instance resource. +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"` + + // ForceSendFields is a list of field names (e.g. "AcquisitionUri") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Instance) MarshalJSON() ([]byte, error) { + type noMethod Instance + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceAndroidDetails: This is a JSON template for the Android +// instance details resource. +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"` + + // ForceSendFields is a list of field names (e.g. "EnablePiracyCheck") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceAndroidDetails) MarshalJSON() ([]byte, error) { + type noMethod InstanceAndroidDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceIosDetails: This is a JSON template for the iOS details +// resource. +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"` + + // ForceSendFields is a list of field names (e.g. "BundleIdentifier") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceIosDetails) MarshalJSON() ([]byte, error) { + type noMethod InstanceIosDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceWebDetails: This is a JSON template for the Web details +// resource. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceWebDetails) MarshalJSON() ([]byte, error) { + type noMethod InstanceWebDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Leaderboard: This is a JSON template for the Leaderboard resource. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "IconUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Leaderboard) MarshalJSON() ([]byte, error) { + type noMethod Leaderboard + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LeaderboardEntry: This is a JSON template for the Leaderboard Entry +// resource. +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"` + + // ForceSendFields is a list of field names (e.g. "FormattedScore") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LeaderboardEntry) MarshalJSON() ([]byte, error) { + type noMethod LeaderboardEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LeaderboardListResponse: This is a JSON template for a list of +// leaderboard objects. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LeaderboardListResponse) MarshalJSON() ([]byte, error) { + type noMethod LeaderboardListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LeaderboardScoreRank: This is a JSON template for a score rank in a +// leaderboard. +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"` + + // ForceSendFields is a list of field names (e.g. "FormattedNumScores") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LeaderboardScoreRank) MarshalJSON() ([]byte, error) { + type noMethod LeaderboardScoreRank + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LeaderboardScores: This is a JSON template for a ListScores response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LeaderboardScores) MarshalJSON() ([]byte, error) { + type noMethod LeaderboardScores + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MetagameConfig: This is a JSON template for the metagame config +// resource +type MetagameConfig struct { + // CurrentVersion: Current version of the metagame configuration data. + // When this data is updated, the version number will be increased by + // one. + CurrentVersion int64 `json:"currentVersion,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#metagameConfig. + Kind string `json:"kind,omitempty"` + + // PlayerLevels: The list of player levels. + PlayerLevels []*PlayerLevel `json:"playerLevels,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CurrentVersion") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MetagameConfig) MarshalJSON() ([]byte, error) { + type noMethod MetagameConfig + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// NetworkDiagnostics: This is a JSON template for network diagnostics +// reported for a client. +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"` + + // NetworkOperatorCode: The MCC+MNC code for the client's network + // connection. On Android: + // http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperator() On iOS, see: + // https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html + NetworkOperatorCode string `json:"networkOperatorCode,omitempty"` + + // NetworkOperatorName: The name of the carrier of the client's network + // connection. On Android: + // http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperatorName() On iOS: + // https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html#//apple_ref/occ/instp/CTCarrier/carrierName + NetworkOperatorName string `json:"networkOperatorName,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"` + + // ForceSendFields is a list of field names (e.g. + // "AndroidNetworkSubtype") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *NetworkDiagnostics) MarshalJSON() ([]byte, error) { + type noMethod NetworkDiagnostics + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ParticipantResult: This is a JSON template for a result for a match +// participant. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ParticipantResult) MarshalJSON() ([]byte, error) { + type noMethod ParticipantResult + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PeerChannelDiagnostics: This is a JSON template for peer channel +// diagnostics. +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"` + + // ForceSendFields is a list of field names (e.g. "BytesReceived") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PeerChannelDiagnostics) MarshalJSON() ([]byte, error) { + type noMethod PeerChannelDiagnostics + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PeerSessionDiagnostics: This is a JSON template for peer session +// diagnostics. +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"` + + // ForceSendFields is a list of field names (e.g. + // "ConnectedTimestampMillis") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PeerSessionDiagnostics) MarshalJSON() ([]byte, error) { + type noMethod PeerSessionDiagnostics + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Played: This is a JSON template for metadata about a player playing a +// game with the currently authenticated user. +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"` + + // ForceSendFields is a list of field names (e.g. "AutoMatched") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Played) MarshalJSON() ([]byte, error) { + type noMethod Played + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Player: This is a JSON template for a Player resource. +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"` + + // ExperienceInfo: An object to represent Play Game experience + // information for the player. + ExperienceInfo *PlayerExperienceInfo `json:"experienceInfo,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. For some players, these fields may not be present. + Name *PlayerName `json:"name,omitempty"` + + // PlayerId: The ID of the player. + PlayerId string `json:"playerId,omitempty"` + + // Title: The player's title rewarded for their game activities. + Title string `json:"title,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AvatarImageUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Player) MarshalJSON() ([]byte, error) { + type noMethod Player + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlayerName: An object representation of the individual components of +// the player's name. For some players, these fields may not be present. +type PlayerName struct { + // FamilyName: The family name of this player. In some places, this is + // known as the last name. + FamilyName string `json:"familyName,omitempty"` + + // GivenName: The given name of this player. In some places, this is + // known as the first name. + GivenName string `json:"givenName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FamilyName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlayerName) MarshalJSON() ([]byte, error) { + type noMethod PlayerName + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlayerAchievement: This is a JSON template for an achievement object. +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"` + + // ExperiencePoints: Experience points earned for the achievement. This + // field is absent for achievements that have not yet been unlocked and + // 0 for achievements that have been unlocked by testers but that are + // unpublished. + ExperiencePoints int64 `json:"experiencePoints,omitempty,string"` + + // 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"` + + // ForceSendFields is a list of field names (e.g. "AchievementState") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlayerAchievement) MarshalJSON() ([]byte, error) { + type noMethod PlayerAchievement + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlayerAchievementListResponse: This is a JSON template for a list of +// achievement objects. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlayerAchievementListResponse) MarshalJSON() ([]byte, error) { + type noMethod PlayerAchievementListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlayerEvent: This is a JSON template for an event status resource. +type PlayerEvent struct { + // DefinitionId: The ID of the event definition. + DefinitionId string `json:"definitionId,omitempty"` + + // FormattedNumEvents: The current number of times this event has + // occurred, as a string. The formatting of this string depends on the + // configuration of your event in the Play Games Developer Console. + FormattedNumEvents string `json:"formattedNumEvents,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#playerEvent. + Kind string `json:"kind,omitempty"` + + // NumEvents: The current number of times this event has occurred. + NumEvents int64 `json:"numEvents,omitempty,string"` + + // PlayerId: The ID of the player. + PlayerId string `json:"playerId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DefinitionId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlayerEvent) MarshalJSON() ([]byte, error) { + type noMethod PlayerEvent + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlayerEventListResponse: This is a JSON template for a ListByPlayer +// response. +type PlayerEventListResponse struct { + // Items: The player events. + Items []*PlayerEvent `json:"items,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#playerEventListResponse. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The pagination token for the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlayerEventListResponse) MarshalJSON() ([]byte, error) { + type noMethod PlayerEventListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlayerExperienceInfo: This is a JSON template for 1P/3P metadata +// about the player's experience. +type PlayerExperienceInfo struct { + // CurrentExperiencePoints: The current number of experience points for + // the player. + CurrentExperiencePoints int64 `json:"currentExperiencePoints,omitempty,string"` + + // CurrentLevel: The current level of the player. + CurrentLevel *PlayerLevel `json:"currentLevel,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#playerExperienceInfo. + Kind string `json:"kind,omitempty"` + + // LastLevelUpTimestampMillis: The timestamp when the player was leveled + // up, in millis since Unix epoch UTC. + LastLevelUpTimestampMillis int64 `json:"lastLevelUpTimestampMillis,omitempty,string"` + + // NextLevel: The next level of the player. If the current level is the + // maximum level, this should be same as the current level. + NextLevel *PlayerLevel `json:"nextLevel,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "CurrentExperiencePoints") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlayerExperienceInfo) MarshalJSON() ([]byte, error) { + type noMethod PlayerExperienceInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlayerLeaderboardScore: This is a JSON template for a player +// leaderboard score object. +type PlayerLeaderboardScore struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#playerLeaderboardScore. + Kind string `json:"kind,omitempty"` + + // LeaderboardId: The ID of the leaderboard this score is in. + LeaderboardId 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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlayerLeaderboardScore) MarshalJSON() ([]byte, error) { + type noMethod PlayerLeaderboardScore + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlayerLeaderboardScoreListResponse: This is a JSON template for a +// list of player leaderboard scores. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlayerLeaderboardScoreListResponse) MarshalJSON() ([]byte, error) { + type noMethod PlayerLeaderboardScoreListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlayerLevel: This is a JSON template for 1P/3P metadata about a +// user's level. +type PlayerLevel struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#playerLevel. + Kind string `json:"kind,omitempty"` + + // Level: The level for the user. + Level int64 `json:"level,omitempty"` + + // MaxExperiencePoints: The maximum experience points for this level. + MaxExperiencePoints int64 `json:"maxExperiencePoints,omitempty,string"` + + // MinExperiencePoints: The minimum experience points for this level. + MinExperiencePoints int64 `json:"minExperiencePoints,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlayerLevel) MarshalJSON() ([]byte, error) { + type noMethod PlayerLevel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlayerListResponse: This is a JSON template for a third party player +// list response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlayerListResponse) MarshalJSON() ([]byte, error) { + type noMethod PlayerListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlayerScore: This is a JSON template for a player score. +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"` + + // ForceSendFields is a list of field names (e.g. "FormattedScore") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlayerScore) MarshalJSON() ([]byte, error) { + type noMethod PlayerScore + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlayerScoreListResponse: This is a JSON template for a list of score +// submission statuses. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlayerScoreListResponse) MarshalJSON() ([]byte, error) { + type noMethod PlayerScoreListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlayerScoreResponse: This is a JSON template for a list of +// leaderboard entry resources. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "BeatenScoreTimeSpans") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlayerScoreResponse) MarshalJSON() ([]byte, error) { + type noMethod PlayerScoreResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlayerScoreSubmissionList: This is a JSON template for a list of +// score submission requests +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlayerScoreSubmissionList) MarshalJSON() ([]byte, error) { + type noMethod PlayerScoreSubmissionList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PushToken: This is a JSON template for a push token resource. +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"` + + // ForceSendFields is a list of field names (e.g. "ClientRevision") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PushToken) MarshalJSON() ([]byte, error) { + type noMethod PushToken + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PushTokenId: This is a JSON template for a push token ID resource. +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"` + + // ForceSendFields is a list of field names (e.g. "Ios") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PushTokenId) MarshalJSON() ([]byte, error) { + type noMethod PushTokenId + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PushTokenIdIos: A push token ID for iOS devices. +type PushTokenIdIos struct { + // ApnsDeviceToken: Device token supplied by an iOS system call to + // register for remote notifications. Encode this field as web-safe + // base64. + ApnsDeviceToken string `json:"apns_device_token,omitempty"` + + // ApnsEnvironment: Indicates whether this token should be used for the + // production or sandbox APNS server. + ApnsEnvironment string `json:"apns_environment,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ApnsDeviceToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PushTokenIdIos) MarshalJSON() ([]byte, error) { + type noMethod PushTokenIdIos + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Quest: This is a JSON template for a Quest resource. +type Quest struct { + // AcceptedTimestampMillis: The timestamp at which the user accepted the + // quest in milliseconds since the epoch in UTC. Only present if the + // player has accepted the quest. + AcceptedTimestampMillis int64 `json:"acceptedTimestampMillis,omitempty,string"` + + // ApplicationId: The ID of the application this quest is part of. + ApplicationId string `json:"applicationId,omitempty"` + + // BannerUrl: The banner image URL for the quest. + BannerUrl string `json:"bannerUrl,omitempty"` + + // Description: The description of the quest. + Description string `json:"description,omitempty"` + + // EndTimestampMillis: The timestamp at which the quest ceases to be + // active in milliseconds since the epoch in UTC. + EndTimestampMillis int64 `json:"endTimestampMillis,omitempty,string"` + + // IconUrl: The icon image URL for the quest. + IconUrl string `json:"iconUrl,omitempty"` + + // Id: The ID of the quest. + Id string `json:"id,omitempty"` + + // IsDefaultBannerUrl: Indicates whether the banner image being returned + // is a default image, or is game-provided. + IsDefaultBannerUrl bool `json:"isDefaultBannerUrl,omitempty"` + + // IsDefaultIconUrl: Indicates whether the icon image being returned is + // a default image, or is game-provided. + IsDefaultIconUrl bool `json:"isDefaultIconUrl,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#quest. + Kind string `json:"kind,omitempty"` + + // LastUpdatedTimestampMillis: The timestamp at which the quest was last + // updated by the user in milliseconds since the epoch in UTC. Only + // present if the player has accepted the quest. + LastUpdatedTimestampMillis int64 `json:"lastUpdatedTimestampMillis,omitempty,string"` + + // Milestones: The quest milestones. + Milestones []*QuestMilestone `json:"milestones,omitempty"` + + // Name: The name of the quest. + Name string `json:"name,omitempty"` + + // NotifyTimestampMillis: The timestamp at which the user should be + // notified that the quest will end soon in milliseconds since the epoch + // in UTC. + NotifyTimestampMillis int64 `json:"notifyTimestampMillis,omitempty,string"` + + // StartTimestampMillis: The timestamp at which the quest becomes active + // in milliseconds since the epoch in UTC. + StartTimestampMillis int64 `json:"startTimestampMillis,omitempty,string"` + + // State: The state of the quest. + // Possible values are: + // - "UPCOMING": The quest is upcoming. The user can see the quest, but + // cannot accept it until it is open. + // - "OPEN": The quest is currently open and may be accepted at this + // time. + // - "ACCEPTED": The user is currently participating in this quest. + // - "COMPLETED": The user has completed the quest. + // - "FAILED": The quest was attempted but was not completed before the + // deadline expired. + // - "EXPIRED": The quest has expired and was not accepted. + // - "DELETED": The quest should be deleted from the local database. + State string `json:"state,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "AcceptedTimestampMillis") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Quest) MarshalJSON() ([]byte, error) { + type noMethod Quest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// QuestContribution: This is a JSON template for a Quest Criterion +// Contribution resource. +type QuestContribution struct { + // FormattedValue: The formatted value of the contribution as a string. + // Format depends on the configuration for the associated event + // definition in the Play Games Developer Console. + FormattedValue string `json:"formattedValue,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#questContribution. + Kind string `json:"kind,omitempty"` + + // Value: The value of the contribution. + Value int64 `json:"value,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "FormattedValue") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *QuestContribution) MarshalJSON() ([]byte, error) { + type noMethod QuestContribution + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// QuestCriterion: This is a JSON template for a Quest Criterion +// resource. +type QuestCriterion struct { + // CompletionContribution: The total number of times the associated + // event must be incremented for the player to complete this quest. + CompletionContribution *QuestContribution `json:"completionContribution,omitempty"` + + // CurrentContribution: The number of increments the player has made + // toward the completion count event increments required to complete the + // quest. This value will not exceed the completion contribution. + // There will be no currentContribution until the player has accepted + // the quest. + CurrentContribution *QuestContribution `json:"currentContribution,omitempty"` + + // EventId: The ID of the event the criterion corresponds to. + EventId string `json:"eventId,omitempty"` + + // InitialPlayerProgress: The value of the event associated with this + // quest at the time that the quest was accepted. This value may change + // if event increments that took place before the start of quest are + // uploaded after the quest starts. + // There will be no initialPlayerProgress until the player has accepted + // the quest. + InitialPlayerProgress *QuestContribution `json:"initialPlayerProgress,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#questCriterion. + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "CompletionContribution") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *QuestCriterion) MarshalJSON() ([]byte, error) { + type noMethod QuestCriterion + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// QuestListResponse: This is a JSON template for a list of quest +// objects. +type QuestListResponse struct { + // Items: The quests. + Items []*Quest `json:"items,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#questListResponse. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token corresponding to the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *QuestListResponse) MarshalJSON() ([]byte, error) { + type noMethod QuestListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// QuestMilestone: This is a JSON template for a Quest Milestone +// resource. +type QuestMilestone struct { + // CompletionRewardData: The completion reward data of the milestone, + // represented as a Base64-encoded string. This is a developer-specified + // binary blob with size between 0 and 2 KB before encoding. + CompletionRewardData string `json:"completionRewardData,omitempty"` + + // Criteria: The criteria of the milestone. + Criteria []*QuestCriterion `json:"criteria,omitempty"` + + // Id: The milestone ID. + Id string `json:"id,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#questMilestone. + Kind string `json:"kind,omitempty"` + + // State: The current state of the milestone. + // Possible values are: + // - "COMPLETED_NOT_CLAIMED" - The milestone is complete, but has not + // yet been claimed. + // - "CLAIMED" - The milestone is complete and has been claimed. + // - "NOT_COMPLETED" - The milestone has not yet been completed. + // - "NOT_STARTED" - The milestone is for a quest that has not yet been + // accepted. + State string `json:"state,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "CompletionRewardData") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *QuestMilestone) MarshalJSON() ([]byte, error) { + type noMethod QuestMilestone + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RevisionCheckResponse: This is a JSON template for the result of +// checking a revision. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ApiVersion") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RevisionCheckResponse) MarshalJSON() ([]byte, error) { + type noMethod RevisionCheckResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Room: This is a JSON template for a room resource object. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ApplicationId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Room) MarshalJSON() ([]byte, error) { + type noMethod Room + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RoomAutoMatchStatus: This is a JSON template for status of room +// automatching that is in progress. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RoomAutoMatchStatus) MarshalJSON() ([]byte, error) { + type noMethod RoomAutoMatchStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RoomAutoMatchingCriteria: This is a JSON template for a room +// auto-match criteria object. +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"` + + // ForceSendFields is a list of field names (e.g. "ExclusiveBitmask") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RoomAutoMatchingCriteria) MarshalJSON() ([]byte, error) { + type noMethod RoomAutoMatchingCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RoomClientAddress: This is a JSON template for the client address +// when setting up a room. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RoomClientAddress) MarshalJSON() ([]byte, error) { + type noMethod RoomClientAddress + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RoomCreateRequest: This is a JSON template for a room creation +// request. +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"` + + // ForceSendFields is a list of field names (e.g. + // "AutoMatchingCriteria") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RoomCreateRequest) MarshalJSON() ([]byte, error) { + type noMethod RoomCreateRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RoomJoinRequest: This is a JSON template for a join room request. +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"` + + // ForceSendFields is a list of field names (e.g. "Capabilities") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RoomJoinRequest) MarshalJSON() ([]byte, error) { + type noMethod RoomJoinRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RoomLeaveDiagnostics: This is a JSON template for room leave +// diagnostics. +type RoomLeaveDiagnostics struct { + // AndroidNetworkSubtype: Android network subtype. + // http://developer.android.com/reference/android/net/NetworkInfo.html#getSubtype() + AndroidNetworkSubtype int64 `json:"androidNetworkSubtype,omitempty"` + + // AndroidNetworkType: Android network type. + // http://developer.android.com/reference/android/net/NetworkInfo.html#getType() + 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"` + + // NetworkOperatorCode: The MCC+MNC code for the client's network + // connection. On Android: + // http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperator() On iOS, see: + // https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html + NetworkOperatorCode string `json:"networkOperatorCode,omitempty"` + + // NetworkOperatorName: The name of the carrier of the client's network + // connection. On Android: + // http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperatorName() On iOS: + // https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html#//apple_ref/occ/instp/CTCarrier/carrierName + NetworkOperatorName string `json:"networkOperatorName,omitempty"` + + // PeerSession: Diagnostics about all peer sessions. + PeerSession []*PeerSessionDiagnostics `json:"peerSession,omitempty"` + + // SocketsUsed: Whether or not sockets were used. + SocketsUsed bool `json:"socketsUsed,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "AndroidNetworkSubtype") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RoomLeaveDiagnostics) MarshalJSON() ([]byte, error) { + type noMethod RoomLeaveDiagnostics + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RoomLeaveRequest: This is a JSON template for a leave room request. +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. + // + // - "REALTIME_CLIENT_DISCONNECTING" - The client disconnects without + // first calling Leave. + // - "REALTIME_SIGN_OUT" - The user signed out of G+ while in the room. + // + // - "REALTIME_GAME_CRASHED" - The game crashed. + // - "REALTIME_ROOM_SERVICE_CRASHED" - RoomAndroidService crashed. + // - "REALTIME_DIFFERENT_CLIENT_ROOM_OPERATION" - Another client is + // trying to enter a room. + // - "REALTIME_SAME_CLIENT_ROOM_OPERATION" - The same client is trying + // to enter a new room. + Reason string `json:"reason,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RoomLeaveRequest) MarshalJSON() ([]byte, error) { + type noMethod RoomLeaveRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RoomList: This is a JSON template for a list of rooms. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RoomList) MarshalJSON() ([]byte, error) { + type noMethod RoomList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RoomModification: This is a JSON template for room modification +// metadata. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RoomModification) MarshalJSON() ([]byte, error) { + type noMethod RoomModification + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RoomP2PStatus: This is a JSON template for an update on the status of +// a peer in a room. +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"` + + // ErrorReason: More detailed diagnostic message returned in event of a + // failure. + ErrorReason 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"` + + // ForceSendFields is a list of field names (e.g. + // "ConnectionSetupLatencyMillis") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RoomP2PStatus) MarshalJSON() ([]byte, error) { + type noMethod RoomP2PStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RoomP2PStatuses: This is a JSON template for an update on the status +// of peers in a room. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RoomP2PStatuses) MarshalJSON() ([]byte, error) { + type noMethod RoomP2PStatuses + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RoomParticipant: This is a JSON template for a participant in a room. +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"` + + // ForceSendFields is a list of field names (e.g. "AutoMatched") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RoomParticipant) MarshalJSON() ([]byte, error) { + type noMethod RoomParticipant + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RoomStatus: This is a JSON template for the status of a room that the +// player has joined. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AutoMatchingStatus") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RoomStatus) MarshalJSON() ([]byte, error) { + type noMethod RoomStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ScoreSubmission: This is a JSON template for a request to submit a +// score to leaderboards. +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"` + + // Signature: Signature Values will contain URI-safe characters as + // defined by section 2.3 of RFC 3986. + Signature string `json:"signature,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ScoreSubmission) MarshalJSON() ([]byte, error) { + type noMethod ScoreSubmission + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Snapshot: This is a JSON template for an snapshot object. +type Snapshot struct { + // CoverImage: The cover image of this snapshot. May be absent if there + // is no image. + CoverImage *SnapshotImage `json:"coverImage,omitempty"` + + // Description: The description of this snapshot. + Description string `json:"description,omitempty"` + + // DriveId: The ID of the file underlying this snapshot in the Drive + // API. Only present if the snapshot is a view on a Drive file and the + // file is owned by the caller. + DriveId string `json:"driveId,omitempty"` + + // DurationMillis: The duration associated with this snapshot, in + // millis. + DurationMillis int64 `json:"durationMillis,omitempty,string"` + + // Id: The ID of the snapshot. + Id string `json:"id,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#snapshot. + Kind string `json:"kind,omitempty"` + + // LastModifiedMillis: The timestamp (in millis since Unix epoch) of the + // last modification to this snapshot. + LastModifiedMillis int64 `json:"lastModifiedMillis,omitempty,string"` + + // ProgressValue: The progress value (64-bit integer set by developer) + // associated with this snapshot. + ProgressValue int64 `json:"progressValue,omitempty,string"` + + // Title: The title of this snapshot. + Title string `json:"title,omitempty"` + + // Type: The type of this snapshot. + // Possible values are: + // - "SAVE_GAME" - A snapshot representing a save game. + Type string `json:"type,omitempty"` + + // UniqueName: The unique name provided when the snapshot was created. + UniqueName string `json:"uniqueName,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CoverImage") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Snapshot) MarshalJSON() ([]byte, error) { + type noMethod Snapshot + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SnapshotImage: This is a JSON template for an image of a snapshot. +type SnapshotImage struct { + // Height: The height of the image. + Height int64 `json:"height,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#snapshotImage. + Kind string `json:"kind,omitempty"` + + // MimeType: The MIME type of the image. + MimeType string `json:"mime_type,omitempty"` + + // Url: The URL of the image. This URL may be invalidated at any time + // and should not be cached. + Url string `json:"url,omitempty"` + + // Width: The width of the image. + Width int64 `json:"width,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SnapshotImage) MarshalJSON() ([]byte, error) { + type noMethod SnapshotImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SnapshotListResponse: This is a JSON template for a list of snapshot +// objects. +type SnapshotListResponse struct { + // Items: The snapshots. + Items []*Snapshot `json:"items,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#snapshotListResponse. + Kind string `json:"kind,omitempty"` + + // NextPageToken: Token corresponding to the next page of results. If + // there are no more results, the token is omitted. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SnapshotListResponse) MarshalJSON() ([]byte, error) { + type noMethod SnapshotListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TurnBasedAutoMatchingCriteria: This is a JSON template for an +// turn-based auto-match criteria object. +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"` + + // ForceSendFields is a list of field names (e.g. "ExclusiveBitmask") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TurnBasedAutoMatchingCriteria) MarshalJSON() ([]byte, error) { + type noMethod TurnBasedAutoMatchingCriteria + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TurnBasedMatch: This is a JSON template for a turn-based match +// resource object. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ApplicationId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TurnBasedMatch) MarshalJSON() ([]byte, error) { + type noMethod TurnBasedMatch + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TurnBasedMatchCreateRequest: This is a JSON template for a turn-based +// match creation request. +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"` + + // ForceSendFields is a list of field names (e.g. + // "AutoMatchingCriteria") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TurnBasedMatchCreateRequest) MarshalJSON() ([]byte, error) { + type noMethod TurnBasedMatchCreateRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TurnBasedMatchData: This is a JSON template for a turn-based match +// data object. +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"` + + // ForceSendFields is a list of field names (e.g. "Data") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TurnBasedMatchData) MarshalJSON() ([]byte, error) { + type noMethod TurnBasedMatchData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TurnBasedMatchDataRequest: This is a JSON template for sending a +// turn-based match data object. +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"` + + // ForceSendFields is a list of field names (e.g. "Data") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TurnBasedMatchDataRequest) MarshalJSON() ([]byte, error) { + type noMethod TurnBasedMatchDataRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TurnBasedMatchList: This is a JSON template for a list of turn-based +// matches. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TurnBasedMatchList) MarshalJSON() ([]byte, error) { + type noMethod TurnBasedMatchList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TurnBasedMatchModification: This is a JSON template for turn-based +// match modification metadata. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TurnBasedMatchModification) MarshalJSON() ([]byte, error) { + type noMethod TurnBasedMatchModification + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TurnBasedMatchParticipant: This is a JSON template for a participant +// in a turn-based match. +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"` + + // ForceSendFields is a list of field names (e.g. "AutoMatched") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TurnBasedMatchParticipant) MarshalJSON() ([]byte, error) { + type noMethod TurnBasedMatchParticipant + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TurnBasedMatchRematch: This is a JSON template for a rematch +// response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TurnBasedMatchRematch) MarshalJSON() ([]byte, error) { + type noMethod TurnBasedMatchRematch + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TurnBasedMatchResults: This is a JSON template for a turn-based match +// results object. +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"` + + // ForceSendFields is a list of field names (e.g. "Data") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TurnBasedMatchResults) MarshalJSON() ([]byte, error) { + type noMethod TurnBasedMatchResults + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TurnBasedMatchSync: This is a JSON template for a list of turn-based +// matches returned from a sync. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TurnBasedMatchSync) MarshalJSON() ([]byte, error) { + type noMethod TurnBasedMatchSync + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TurnBasedMatchTurn: This is a JSON template for the object +// representing a turn. +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"` + + // ForceSendFields is a list of field names (e.g. "Data") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TurnBasedMatchTurn) MarshalJSON() ([]byte, error) { + type noMethod TurnBasedMatchTurn + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "games.achievementDefinitions.list": + +type AchievementDefinitionsListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AchievementDefinitionsListCall) Fields(s ...googleapi.Field) *AchievementDefinitionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AchievementDefinitionsListCall) IfNoneMatch(entityTag string) *AchievementDefinitionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AchievementDefinitionsListCall) Context(ctx context.Context) *AchievementDefinitionsListCall { + c.ctx_ = ctx + return c +} + +func (c *AchievementDefinitionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.achievementDefinitions.list" call. +// Exactly one of *AchievementDefinitionsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AchievementDefinitionsListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AchievementDefinitionsListCall) Do() (*AchievementDefinitionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AchievementDefinitionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AchievementsIncrementCall) Fields(s ...googleapi.Field) *AchievementsIncrementCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AchievementsIncrementCall) Context(ctx context.Context) *AchievementsIncrementCall { + c.ctx_ = ctx + return c +} + +func (c *AchievementsIncrementCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("stepsToIncrement", fmt.Sprintf("%v", c.stepsToIncrement)) + if v, ok := c.opt_["requestId"]; ok { + params.Set("requestId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/increment") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "achievementId": c.achievementId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.achievements.increment" call. +// Exactly one of *AchievementIncrementResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AchievementIncrementResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AchievementsIncrementCall) Do() (*AchievementIncrementResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AchievementIncrementResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "ALL" - List all achievements. This is the default. +// "HIDDEN" - List only hidden achievements. +// "REVEALED" - List only revealed achievements. +// "UNLOCKED" - List only unlocked achievements. +func (c *AchievementsListCall) State(state string) *AchievementsListCall { + c.opt_["state"] = state + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AchievementsListCall) Fields(s ...googleapi.Field) *AchievementsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AchievementsListCall) IfNoneMatch(entityTag string) *AchievementsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AchievementsListCall) Context(ctx context.Context) *AchievementsListCall { + c.ctx_ = ctx + return c +} + +func (c *AchievementsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/achievements") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "playerId": c.playerId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.achievements.list" call. +// Exactly one of *PlayerAchievementListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PlayerAchievementListResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AchievementsListCall) Do() (*PlayerAchievementListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlayerAchievementListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AchievementsRevealCall) Fields(s ...googleapi.Field) *AchievementsRevealCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AchievementsRevealCall) Context(ctx context.Context) *AchievementsRevealCall { + c.ctx_ = ctx + return c +} + +func (c *AchievementsRevealCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/reveal") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "achievementId": c.achievementId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.achievements.reveal" call. +// Exactly one of *AchievementRevealResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *AchievementRevealResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AchievementsRevealCall) Do() (*AchievementRevealResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AchievementRevealResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AchievementsSetStepsAtLeastCall) Fields(s ...googleapi.Field) *AchievementsSetStepsAtLeastCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AchievementsSetStepsAtLeastCall) Context(ctx context.Context) *AchievementsSetStepsAtLeastCall { + c.ctx_ = ctx + return c +} + +func (c *AchievementsSetStepsAtLeastCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("steps", fmt.Sprintf("%v", c.steps)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/setStepsAtLeast") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "achievementId": c.achievementId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.achievements.setStepsAtLeast" call. +// Exactly one of *AchievementSetStepsAtLeastResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AchievementSetStepsAtLeastResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AchievementsSetStepsAtLeastCall) Do() (*AchievementSetStepsAtLeastResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AchievementSetStepsAtLeastResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AchievementsUnlockCall) Fields(s ...googleapi.Field) *AchievementsUnlockCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AchievementsUnlockCall) Context(ctx context.Context) *AchievementsUnlockCall { + c.ctx_ = ctx + return c +} + +func (c *AchievementsUnlockCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/unlock") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "achievementId": c.achievementId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.achievements.unlock" call. +// Exactly one of *AchievementUnlockResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *AchievementUnlockResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AchievementsUnlockCall) Do() (*AchievementUnlockResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AchievementUnlockResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AchievementsUpdateMultipleCall) Fields(s ...googleapi.Field) *AchievementsUpdateMultipleCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AchievementsUpdateMultipleCall) Context(ctx context.Context) *AchievementsUpdateMultipleCall { + c.ctx_ = ctx + return c +} + +func (c *AchievementsUpdateMultipleCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.achievements.updateMultiple" call. +// Exactly one of *AchievementUpdateMultipleResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AchievementUpdateMultipleResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AchievementsUpdateMultipleCall) Do() (*AchievementUpdateMultipleResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AchievementUpdateMultipleResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "ANDROID" - Retrieve applications that can be played on Android. +// "IOS" - Retrieve applications that can be played on iOS. +// "WEB_APP" - Retrieve applications that can be played on desktop +// web. +func (c *ApplicationsGetCall) PlatformType(platformType string) *ApplicationsGetCall { + c.opt_["platformType"] = platformType + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ApplicationsGetCall) Fields(s ...googleapi.Field) *ApplicationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ApplicationsGetCall) IfNoneMatch(entityTag string) *ApplicationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ApplicationsGetCall) Context(ctx context.Context) *ApplicationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ApplicationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "applicationId": c.applicationId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.applications.get" call. +// Exactly one of *Application or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Application.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ApplicationsGetCall) Do() (*Application, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Application{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the 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 ID from the Google Play developer console.", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ApplicationsPlayedCall) Fields(s ...googleapi.Field) *ApplicationsPlayedCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ApplicationsPlayedCall) Context(ctx context.Context) *ApplicationsPlayedCall { + c.ctx_ = ctx + return c +} + +func (c *ApplicationsPlayedCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "applications/played") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.applications.played" call. +func (c *ApplicationsPlayedCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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.events.listByPlayer": + +type EventsListByPlayerCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// ListByPlayer: Returns a list showing the current progress on events +// in this application for the currently authenticated user. +func (r *EventsService) ListByPlayer() *EventsListByPlayerCall { + c := &EventsListByPlayerCall{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 *EventsListByPlayerCall) Language(language string) *EventsListByPlayerCall { + c.opt_["language"] = language + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of events to return in the response, used for paging. For any +// response, the actual number of events to return may be less than the +// specified maxResults. +func (c *EventsListByPlayerCall) MaxResults(maxResults int64) *EventsListByPlayerCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *EventsListByPlayerCall) PageToken(pageToken string) *EventsListByPlayerCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventsListByPlayerCall) Fields(s ...googleapi.Field) *EventsListByPlayerCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EventsListByPlayerCall) IfNoneMatch(entityTag string) *EventsListByPlayerCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventsListByPlayerCall) Context(ctx context.Context) *EventsListByPlayerCall { + c.ctx_ = ctx + return c +} + +func (c *EventsListByPlayerCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "events") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.events.listByPlayer" call. +// Exactly one of *PlayerEventListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PlayerEventListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EventsListByPlayerCall) Do() (*PlayerEventListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlayerEventListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a list showing the current progress on events in this application for the currently authenticated user.", + // "httpMethod": "GET", + // "id": "games.events.listByPlayer", + // "parameters": { + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of events to return in the response, used for paging. For any response, the actual number of events to return may be less than the specified maxResults.", + // "format": "int32", + // "location": "query", + // "maximum": "100", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The token returned by the previous request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "events", + // "response": { + // "$ref": "PlayerEventListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.events.listDefinitions": + +type EventsListDefinitionsCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// ListDefinitions: Returns a list of the event definitions in this +// application. +func (r *EventsService) ListDefinitions() *EventsListDefinitionsCall { + c := &EventsListDefinitionsCall{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 *EventsListDefinitionsCall) Language(language string) *EventsListDefinitionsCall { + c.opt_["language"] = language + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of event definitions to return in the response, used for +// paging. For any response, the actual number of event definitions to +// return may be less than the specified maxResults. +func (c *EventsListDefinitionsCall) MaxResults(maxResults int64) *EventsListDefinitionsCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *EventsListDefinitionsCall) PageToken(pageToken string) *EventsListDefinitionsCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventsListDefinitionsCall) Fields(s ...googleapi.Field) *EventsListDefinitionsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EventsListDefinitionsCall) IfNoneMatch(entityTag string) *EventsListDefinitionsCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventsListDefinitionsCall) Context(ctx context.Context) *EventsListDefinitionsCall { + c.ctx_ = ctx + return c +} + +func (c *EventsListDefinitionsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "eventDefinitions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.events.listDefinitions" call. +// Exactly one of *EventDefinitionListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *EventDefinitionListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EventsListDefinitionsCall) Do() (*EventDefinitionListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EventDefinitionListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a list of the event definitions in this application.", + // "httpMethod": "GET", + // "id": "games.events.listDefinitions", + // "parameters": { + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of event definitions to return in the response, used for paging. For any response, the actual number of event definitions to return may be less than the specified maxResults.", + // "format": "int32", + // "location": "query", + // "maximum": "100", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The token returned by the previous request.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "eventDefinitions", + // "response": { + // "$ref": "EventDefinitionListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.events.record": + +type EventsRecordCall struct { + s *Service + eventrecordrequest *EventRecordRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Record: Records a batch of changes to the number of times events have +// occurred for the currently authenticated user of this application. +func (r *EventsService) Record(eventrecordrequest *EventRecordRequest) *EventsRecordCall { + c := &EventsRecordCall{s: r.s, opt_: make(map[string]interface{})} + c.eventrecordrequest = eventrecordrequest + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *EventsRecordCall) Language(language string) *EventsRecordCall { + c.opt_["language"] = language + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventsRecordCall) Fields(s ...googleapi.Field) *EventsRecordCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventsRecordCall) Context(ctx context.Context) *EventsRecordCall { + c.ctx_ = ctx + return c +} + +func (c *EventsRecordCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventrecordrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "events") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.events.record" call. +// Exactly one of *EventUpdateResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *EventUpdateResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *EventsRecordCall) Do() (*EventUpdateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &EventUpdateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Records a batch of changes to the number of times events have occurred for the currently authenticated user of this application.", + // "httpMethod": "POST", + // "id": "games.events.record", + // "parameters": { + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "events", + // "request": { + // "$ref": "EventRecordRequest" + // }, + // "response": { + // "$ref": "EventUpdateResponse" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LeaderboardsGetCall) Fields(s ...googleapi.Field) *LeaderboardsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LeaderboardsGetCall) IfNoneMatch(entityTag string) *LeaderboardsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LeaderboardsGetCall) Context(ctx context.Context) *LeaderboardsGetCall { + c.ctx_ = ctx + return c +} + +func (c *LeaderboardsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "leaderboardId": c.leaderboardId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.leaderboards.get" call. +// Exactly one of *Leaderboard or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Leaderboard.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *LeaderboardsGetCall) Do() (*Leaderboard, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Leaderboard{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LeaderboardsListCall) Fields(s ...googleapi.Field) *LeaderboardsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LeaderboardsListCall) IfNoneMatch(entityTag string) *LeaderboardsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LeaderboardsListCall) Context(ctx context.Context) *LeaderboardsListCall { + c.ctx_ = ctx + return c +} + +func (c *LeaderboardsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.leaderboards.list" call. +// Exactly one of *LeaderboardListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *LeaderboardListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LeaderboardsListCall) Do() (*LeaderboardListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LeaderboardListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all the 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.metagame.getMetagameConfig": + +type MetagameGetMetagameConfigCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetMetagameConfig: Return the metagame configuration data for the +// calling application. +func (r *MetagameService) GetMetagameConfig() *MetagameGetMetagameConfigCall { + c := &MetagameGetMetagameConfigCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MetagameGetMetagameConfigCall) Fields(s ...googleapi.Field) *MetagameGetMetagameConfigCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MetagameGetMetagameConfigCall) IfNoneMatch(entityTag string) *MetagameGetMetagameConfigCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MetagameGetMetagameConfigCall) Context(ctx context.Context) *MetagameGetMetagameConfigCall { + c.ctx_ = ctx + return c +} + +func (c *MetagameGetMetagameConfigCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "metagameConfig") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.metagame.getMetagameConfig" call. +// Exactly one of *MetagameConfig or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *MetagameConfig.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MetagameGetMetagameConfigCall) Do() (*MetagameConfig, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &MetagameConfig{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return the metagame configuration data for the calling application.", + // "httpMethod": "GET", + // "id": "games.metagame.getMetagameConfig", + // "path": "metagameConfig", + // "response": { + // "$ref": "MetagameConfig" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.metagame.listCategoriesByPlayer": + +type MetagameListCategoriesByPlayerCall struct { + s *Service + playerId string + collection string + opt_ map[string]interface{} + ctx_ context.Context +} + +// ListCategoriesByPlayer: List play data aggregated per category for +// the player corresponding to playerId. +func (r *MetagameService) ListCategoriesByPlayer(playerId string, collection string) *MetagameListCategoriesByPlayerCall { + c := &MetagameListCategoriesByPlayerCall{s: r.s, opt_: make(map[string]interface{})} + c.playerId = playerId + c.collection = collection + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *MetagameListCategoriesByPlayerCall) Language(language string) *MetagameListCategoriesByPlayerCall { + c.opt_["language"] = language + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of category resources to return in the response, used for +// paging. For any response, the actual number of category resources +// returned may be less than the specified maxResults. +func (c *MetagameListCategoriesByPlayerCall) MaxResults(maxResults int64) *MetagameListCategoriesByPlayerCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *MetagameListCategoriesByPlayerCall) PageToken(pageToken string) *MetagameListCategoriesByPlayerCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MetagameListCategoriesByPlayerCall) Fields(s ...googleapi.Field) *MetagameListCategoriesByPlayerCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MetagameListCategoriesByPlayerCall) IfNoneMatch(entityTag string) *MetagameListCategoriesByPlayerCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MetagameListCategoriesByPlayerCall) Context(ctx context.Context) *MetagameListCategoriesByPlayerCall { + c.ctx_ = ctx + return c +} + +func (c *MetagameListCategoriesByPlayerCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/categories/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "playerId": c.playerId, + "collection": c.collection, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.metagame.listCategoriesByPlayer" call. +// Exactly one of *CategoryListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CategoryListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MetagameListCategoriesByPlayerCall) Do() (*CategoryListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CategoryListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List play data aggregated per category for the player corresponding to playerId.", + // "httpMethod": "GET", + // "id": "games.metagame.listCategoriesByPlayer", + // "parameterOrder": [ + // "playerId", + // "collection" + // ], + // "parameters": { + // "collection": { + // "description": "The collection of categories for which data will be returned.", + // "enum": [ + // "all" + // ], + // "enumDescriptions": [ + // "Retrieve data for all categories. This is the default." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of category resources to return in the response, used for paging. For any response, the actual number of category resources returned may be less than the specified maxResults.", + // "format": "int32", + // "location": "query", + // "maximum": "100", + // "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" + // } + // }, + // "path": "players/{playerId}/categories/{collection}", + // "response": { + // "$ref": "CategoryListResponse" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *PlayersGetCall) Language(language string) *PlayersGetCall { + c.opt_["language"] = language + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlayersGetCall) Fields(s ...googleapi.Field) *PlayersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PlayersGetCall) IfNoneMatch(entityTag string) *PlayersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlayersGetCall) Context(ctx context.Context) *PlayersGetCall { + c.ctx_ = ctx + return c +} + +func (c *PlayersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "playerId": c.playerId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.players.get" call. +// Exactly one of *Player or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Player.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *PlayersGetCall) Do() (*Player, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Player{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the 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": { + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "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" + // } + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *PlayersListCall) Language(language string) *PlayersListCall { + c.opt_["language"] = language + 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlayersListCall) Fields(s ...googleapi.Field) *PlayersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PlayersListCall) IfNoneMatch(entityTag string) *PlayersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlayersListCall) Context(ctx context.Context) *PlayersListCall { + c.ctx_ = ctx + return c +} + +func (c *PlayersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "players/me/players/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "collection": c.collection, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.players.list" call. +// Exactly one of *PlayerListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PlayerListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PlayersListCall) Do() (*PlayerListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlayerListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": [ + // "connected", + // "playedWith", + // "played_with" + // ], + // "enumDescriptions": [ + // "Retrieve a list of players that are also playing this game in reverse chronological order.", + // "(DEPRECATED: please use played_with!) Retrieve a list of players you have played a multiplayer game (realtime or turn-based) with recently.", + // "Retrieve a list of players you have played a multiplayer game (realtime or turn-based) with recently." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "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": "50", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PushtokensRemoveCall) Fields(s ...googleapi.Field) *PushtokensRemoveCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PushtokensRemoveCall) Context(ctx context.Context) *PushtokensRemoveCall { + c.ctx_ = ctx + return c +} + +func (c *PushtokensRemoveCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.pushtokenid) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.pushtokens.remove" call. +func (c *PushtokensRemoveCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PushtokensUpdateCall) Fields(s ...googleapi.Field) *PushtokensUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PushtokensUpdateCall) Context(ctx context.Context) *PushtokensUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *PushtokensUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.pushtoken) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.pushtokens.update" call. +func (c *PushtokensUpdateCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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.questMilestones.claim": + +type QuestMilestonesClaimCall struct { + s *Service + questId string + milestoneId string + requestId int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Claim: Report that a reward for the milestone corresponding to +// milestoneId for the quest corresponding to questId has been claimed +// by the currently authorized user. +func (r *QuestMilestonesService) Claim(questId string, milestoneId string, requestId int64) *QuestMilestonesClaimCall { + c := &QuestMilestonesClaimCall{s: r.s, opt_: make(map[string]interface{})} + c.questId = questId + c.milestoneId = milestoneId + c.requestId = requestId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *QuestMilestonesClaimCall) Fields(s ...googleapi.Field) *QuestMilestonesClaimCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *QuestMilestonesClaimCall) Context(ctx context.Context) *QuestMilestonesClaimCall { + c.ctx_ = ctx + return c +} + +func (c *QuestMilestonesClaimCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("requestId", fmt.Sprintf("%v", c.requestId)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "quests/{questId}/milestones/{milestoneId}/claim") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "questId": c.questId, + "milestoneId": c.milestoneId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.questMilestones.claim" call. +func (c *QuestMilestonesClaimCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Report that a reward for the milestone corresponding to milestoneId for the quest corresponding to questId has been claimed by the currently authorized user.", + // "httpMethod": "PUT", + // "id": "games.questMilestones.claim", + // "parameterOrder": [ + // "questId", + // "milestoneId", + // "requestId" + // ], + // "parameters": { + // "milestoneId": { + // "description": "The ID of the milestone.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "questId": { + // "description": "The ID of the quest.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "requestId": { + // "description": "A numeric ID to ensure that the request is handled correctly across retries. Your client application must generate this ID randomly.", + // "format": "int64", + // "location": "query", + // "required": true, + // "type": "string" + // } + // }, + // "path": "quests/{questId}/milestones/{milestoneId}/claim", + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.quests.accept": + +type QuestsAcceptCall struct { + s *Service + questId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Accept: Indicates that the currently authorized user will participate +// in the quest. +func (r *QuestsService) Accept(questId string) *QuestsAcceptCall { + c := &QuestsAcceptCall{s: r.s, opt_: make(map[string]interface{})} + c.questId = questId + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *QuestsAcceptCall) Language(language string) *QuestsAcceptCall { + c.opt_["language"] = language + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *QuestsAcceptCall) Fields(s ...googleapi.Field) *QuestsAcceptCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *QuestsAcceptCall) Context(ctx context.Context) *QuestsAcceptCall { + c.ctx_ = ctx + return c +} + +func (c *QuestsAcceptCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "quests/{questId}/accept") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "questId": c.questId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.quests.accept" call. +// Exactly one of *Quest or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Quest.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *QuestsAcceptCall) Do() (*Quest, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Quest{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Indicates that the currently authorized user will participate in the quest.", + // "httpMethod": "POST", + // "id": "games.quests.accept", + // "parameterOrder": [ + // "questId" + // ], + // "parameters": { + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // }, + // "questId": { + // "description": "The ID of the quest.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "quests/{questId}/accept", + // "response": { + // "$ref": "Quest" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.quests.list": + +type QuestsListCall struct { + s *Service + playerId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Get a list of quests for your application and the currently +// authenticated player. +func (r *QuestsService) List(playerId string) *QuestsListCall { + c := &QuestsListCall{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 *QuestsListCall) Language(language string) *QuestsListCall { + c.opt_["language"] = language + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of quest resources to return in the response, used for paging. +// For any response, the actual number of quest resources returned may +// be less than the specified maxResults. Acceptable values are 1 to 50, +// inclusive. (Default: 50). +func (c *QuestsListCall) MaxResults(maxResults int64) *QuestsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *QuestsListCall) PageToken(pageToken string) *QuestsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *QuestsListCall) Fields(s ...googleapi.Field) *QuestsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *QuestsListCall) IfNoneMatch(entityTag string) *QuestsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *QuestsListCall) Context(ctx context.Context) *QuestsListCall { + c.ctx_ = ctx + return c +} + +func (c *QuestsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/quests") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "playerId": c.playerId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.quests.list" call. +// Exactly one of *QuestListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *QuestListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *QuestsListCall) Do() (*QuestListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &QuestListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get a list of quests for your application and the currently authenticated player.", + // "httpMethod": "GET", + // "id": "games.quests.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 quest resources to return in the response, used for paging. For any response, the actual number of quest resources returned may be less than the specified maxResults. Acceptable values are 1 to 50, inclusive. (Default: 50).", + // "format": "int32", + // "location": "query", + // "maximum": "50", + // "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" + // } + // }, + // "path": "players/{playerId}/quests", + // "response": { + // "$ref": "QuestListResponse" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RevisionsCheckCall) Fields(s ...googleapi.Field) *RevisionsCheckCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RevisionsCheckCall) IfNoneMatch(entityTag string) *RevisionsCheckCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RevisionsCheckCall) Context(ctx context.Context) *RevisionsCheckCall { + c.ctx_ = ctx + return c +} + +func (c *RevisionsCheckCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("clientRevision", fmt.Sprintf("%v", c.clientRevision)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.revisions.check" call. +// Exactly one of *RevisionCheckResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *RevisionCheckResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RevisionsCheckCall) Do() (*RevisionCheckResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RevisionCheckResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Checks whether 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RoomsCreateCall) Fields(s ...googleapi.Field) *RoomsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RoomsCreateCall) Context(ctx context.Context) *RoomsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *RoomsCreateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.rooms.create" call. +// Exactly one of *Room or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Room.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *RoomsCreateCall) Do() (*Room, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Room{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *RoomsDeclineCall) Language(language string) *RoomsDeclineCall { + c.opt_["language"] = language + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RoomsDeclineCall) Fields(s ...googleapi.Field) *RoomsDeclineCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RoomsDeclineCall) Context(ctx context.Context) *RoomsDeclineCall { + c.ctx_ = ctx + return c +} + +func (c *RoomsDeclineCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/decline") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "roomId": c.roomId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.rooms.decline" call. +// Exactly one of *Room or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Room.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *RoomsDeclineCall) Do() (*Room, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Room{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": { + // "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}/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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RoomsDismissCall) Fields(s ...googleapi.Field) *RoomsDismissCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RoomsDismissCall) Context(ctx context.Context) *RoomsDismissCall { + c.ctx_ = ctx + return c +} + +func (c *RoomsDismissCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/dismiss") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "roomId": c.roomId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.rooms.dismiss" call. +func (c *RoomsDismissCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RoomsGetCall) Fields(s ...googleapi.Field) *RoomsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RoomsGetCall) IfNoneMatch(entityTag string) *RoomsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RoomsGetCall) Context(ctx context.Context) *RoomsGetCall { + c.ctx_ = ctx + return c +} + +func (c *RoomsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "roomId": c.roomId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.rooms.get" call. +// Exactly one of *Room or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Room.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *RoomsGetCall) Do() (*Room, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Room{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *RoomsJoinCall) Language(language string) *RoomsJoinCall { + c.opt_["language"] = language + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RoomsJoinCall) Fields(s ...googleapi.Field) *RoomsJoinCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RoomsJoinCall) Context(ctx context.Context) *RoomsJoinCall { + c.ctx_ = ctx + return c +} + +func (c *RoomsJoinCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/join") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "roomId": c.roomId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.rooms.join" call. +// Exactly one of *Room or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Room.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *RoomsJoinCall) Do() (*Room, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Room{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": { + // "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}/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{} + ctx_ context.Context +} + +// 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 +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *RoomsLeaveCall) Language(language string) *RoomsLeaveCall { + c.opt_["language"] = language + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RoomsLeaveCall) Fields(s ...googleapi.Field) *RoomsLeaveCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RoomsLeaveCall) Context(ctx context.Context) *RoomsLeaveCall { + c.ctx_ = ctx + return c +} + +func (c *RoomsLeaveCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/leave") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "roomId": c.roomId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.rooms.leave" call. +// Exactly one of *Room or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Room.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *RoomsLeaveCall) Do() (*Room, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Room{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": { + // "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}/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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RoomsListCall) Fields(s ...googleapi.Field) *RoomsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RoomsListCall) IfNoneMatch(entityTag string) *RoomsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RoomsListCall) Context(ctx context.Context) *RoomsListCall { + c.ctx_ = ctx + return c +} + +func (c *RoomsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.rooms.list" call. +// Exactly one of *RoomList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *RoomList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RoomsListCall) Do() (*RoomList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RoomList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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{} + ctx_ context.Context +} + +// 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 +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *RoomsReportStatusCall) Language(language string) *RoomsReportStatusCall { + c.opt_["language"] = language + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RoomsReportStatusCall) Fields(s ...googleapi.Field) *RoomsReportStatusCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RoomsReportStatusCall) Context(ctx context.Context) *RoomsReportStatusCall { + c.ctx_ = ctx + return c +} + +func (c *RoomsReportStatusCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/reportstatus") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "roomId": c.roomId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.rooms.reportStatus" call. +// Exactly one of *RoomStatus or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *RoomStatus.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RoomsReportStatusCall) Do() (*RoomStatus, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RoomStatus{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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": { + // "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}/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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "ALL" - Retrieve public and social ranks. +// "PUBLIC" - Retrieve public ranks, if the player is sharing their +// gameplay activity publicly. +// "SOCIAL" - Retrieve the social rank. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ScoresGetCall) Fields(s ...googleapi.Field) *ScoresGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ScoresGetCall) IfNoneMatch(entityTag string) *ScoresGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ScoresGetCall) Context(ctx context.Context) *ScoresGetCall { + c.ctx_ = ctx + return c +} + +func (c *ScoresGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "playerId": c.playerId, + "leaderboardId": c.leaderboardId, + "timeSpan": c.timeSpan, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.scores.get" call. +// Exactly one of *PlayerLeaderboardScoreListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PlayerLeaderboardScoreListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ScoresGetCall) Do() (*PlayerLeaderboardScoreListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlayerLeaderboardScoreListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "30", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ScoresListCall) Fields(s ...googleapi.Field) *ScoresListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ScoresListCall) IfNoneMatch(entityTag string) *ScoresListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ScoresListCall) Context(ctx context.Context) *ScoresListCall { + c.ctx_ = ctx + return c +} + +func (c *ScoresListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}/scores/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "leaderboardId": c.leaderboardId, + "collection": c.collection, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.scores.list" call. +// Exactly one of *LeaderboardScores or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *LeaderboardScores.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ScoresListCall) Do() (*LeaderboardScores, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LeaderboardScores{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the 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": "30", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ScoresListWindowCall) Fields(s ...googleapi.Field) *ScoresListWindowCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ScoresListWindowCall) IfNoneMatch(entityTag string) *ScoresListWindowCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ScoresListWindowCall) Context(ctx context.Context) *ScoresListWindowCall { + c.ctx_ = ctx + return c +} + +func (c *ScoresListWindowCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}/window/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "leaderboardId": c.leaderboardId, + "collection": c.collection, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.scores.listWindow" call. +// Exactly one of *LeaderboardScores or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *LeaderboardScores.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ScoresListWindowCall) Do() (*LeaderboardScores, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LeaderboardScores{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the 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": "30", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ScoresSubmitCall) Fields(s ...googleapi.Field) *ScoresSubmitCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ScoresSubmitCall) Context(ctx context.Context) *ScoresSubmitCall { + c.ctx_ = ctx + return c +} + +func (c *ScoresSubmitCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}/scores") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "leaderboardId": c.leaderboardId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.scores.submit" call. +// Exactly one of *PlayerScoreResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PlayerScoreResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ScoresSubmitCall) Do() (*PlayerScoreResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlayerScoreResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ScoresSubmitMultipleCall) Fields(s ...googleapi.Field) *ScoresSubmitMultipleCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ScoresSubmitMultipleCall) Context(ctx context.Context) *ScoresSubmitMultipleCall { + c.ctx_ = ctx + return c +} + +func (c *ScoresSubmitMultipleCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.scores.submitMultiple" call. +// Exactly one of *PlayerScoreListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PlayerScoreListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ScoresSubmitMultipleCall) Do() (*PlayerScoreListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlayerScoreListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.snapshots.get": + +type SnapshotsGetCall struct { + s *Service + snapshotId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves the metadata for a given snapshot ID. +func (r *SnapshotsService) Get(snapshotId string) *SnapshotsGetCall { + c := &SnapshotsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.snapshotId = snapshotId + return c +} + +// Language sets the optional parameter "language": The preferred +// language to use for strings returned by this method. +func (c *SnapshotsGetCall) Language(language string) *SnapshotsGetCall { + c.opt_["language"] = language + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SnapshotsGetCall) Fields(s ...googleapi.Field) *SnapshotsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SnapshotsGetCall) IfNoneMatch(entityTag string) *SnapshotsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SnapshotsGetCall) Context(ctx context.Context) *SnapshotsGetCall { + c.ctx_ = ctx + return c +} + +func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "snapshots/{snapshotId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "snapshotId": c.snapshotId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.snapshots.get" call. +// Exactly one of *Snapshot or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Snapshot.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SnapshotsGetCall) Do() (*Snapshot, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Snapshot{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the metadata for a given snapshot ID.", + // "httpMethod": "GET", + // "id": "games.snapshots.get", + // "parameterOrder": [ + // "snapshotId" + // ], + // "parameters": { + // "language": { + // "description": "The preferred language to use for strings returned by this method.", + // "location": "query", + // "type": "string" + // }, + // "snapshotId": { + // "description": "The ID of the snapshot.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "snapshots/{snapshotId}", + // "response": { + // "$ref": "Snapshot" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive.appdata", + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "games.snapshots.list": + +type SnapshotsListCall struct { + s *Service + playerId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves a list of snapshots created by your application for +// the player corresponding to the player ID. +func (r *SnapshotsService) List(playerId string) *SnapshotsListCall { + c := &SnapshotsListCall{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 *SnapshotsListCall) Language(language string) *SnapshotsListCall { + c.opt_["language"] = language + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of snapshot resources to return in the response, used for +// paging. For any response, the actual number of snapshot resources +// returned may be less than the specified maxResults. +func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SnapshotsListCall) Fields(s ...googleapi.Field) *SnapshotsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SnapshotsListCall) IfNoneMatch(entityTag string) *SnapshotsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SnapshotsListCall) Context(ctx context.Context) *SnapshotsListCall { + c.ctx_ = ctx + return c +} + +func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/snapshots") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "playerId": c.playerId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.snapshots.list" call. +// Exactly one of *SnapshotListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SnapshotListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SnapshotsListCall) Do() (*SnapshotListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SnapshotListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of snapshots created by your application for the player corresponding to the player ID.", + // "httpMethod": "GET", + // "id": "games.snapshots.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 snapshot resources to return in the response, used for paging. For any response, the actual number of snapshot resources 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" + // } + // }, + // "path": "players/{playerId}/snapshots", + // "response": { + // "$ref": "SnapshotListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive.appdata", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TurnBasedMatchesCancelCall) Fields(s ...googleapi.Field) *TurnBasedMatchesCancelCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TurnBasedMatchesCancelCall) Context(ctx context.Context) *TurnBasedMatchesCancelCall { + c.ctx_ = ctx + return c +} + +func (c *TurnBasedMatchesCancelCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/cancel") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "matchId": c.matchId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.turnBasedMatches.cancel" call. +func (c *TurnBasedMatchesCancelCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TurnBasedMatchesCreateCall) Fields(s ...googleapi.Field) *TurnBasedMatchesCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TurnBasedMatchesCreateCall) Context(ctx context.Context) *TurnBasedMatchesCreateCall { + c.ctx_ = ctx + return c +} + +func (c *TurnBasedMatchesCreateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.turnBasedMatches.create" call. +// Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TurnBasedMatch.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TurnBasedMatchesCreateCall) Do() (*TurnBasedMatch, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TurnBasedMatch{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TurnBasedMatchesDeclineCall) Fields(s ...googleapi.Field) *TurnBasedMatchesDeclineCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TurnBasedMatchesDeclineCall) Context(ctx context.Context) *TurnBasedMatchesDeclineCall { + c.ctx_ = ctx + return c +} + +func (c *TurnBasedMatchesDeclineCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/decline") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "matchId": c.matchId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.turnBasedMatches.decline" call. +// Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TurnBasedMatch.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TurnBasedMatchesDeclineCall) Do() (*TurnBasedMatch, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TurnBasedMatch{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TurnBasedMatchesDismissCall) Fields(s ...googleapi.Field) *TurnBasedMatchesDismissCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TurnBasedMatchesDismissCall) Context(ctx context.Context) *TurnBasedMatchesDismissCall { + c.ctx_ = ctx + return c +} + +func (c *TurnBasedMatchesDismissCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/dismiss") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "matchId": c.matchId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.turnBasedMatches.dismiss" call. +func (c *TurnBasedMatchesDismissCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TurnBasedMatchesFinishCall) Fields(s ...googleapi.Field) *TurnBasedMatchesFinishCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TurnBasedMatchesFinishCall) Context(ctx context.Context) *TurnBasedMatchesFinishCall { + c.ctx_ = ctx + return c +} + +func (c *TurnBasedMatchesFinishCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/finish") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "matchId": c.matchId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.turnBasedMatches.finish" call. +// Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TurnBasedMatch.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TurnBasedMatchesFinishCall) Do() (*TurnBasedMatch, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TurnBasedMatch{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TurnBasedMatchesGetCall) Fields(s ...googleapi.Field) *TurnBasedMatchesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TurnBasedMatchesGetCall) IfNoneMatch(entityTag string) *TurnBasedMatchesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TurnBasedMatchesGetCall) Context(ctx context.Context) *TurnBasedMatchesGetCall { + c.ctx_ = ctx + return c +} + +func (c *TurnBasedMatchesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "matchId": c.matchId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.turnBasedMatches.get" call. +// Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TurnBasedMatch.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TurnBasedMatchesGetCall) Do() (*TurnBasedMatch, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TurnBasedMatch{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TurnBasedMatchesJoinCall) Fields(s ...googleapi.Field) *TurnBasedMatchesJoinCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TurnBasedMatchesJoinCall) Context(ctx context.Context) *TurnBasedMatchesJoinCall { + c.ctx_ = ctx + return c +} + +func (c *TurnBasedMatchesJoinCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/join") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "matchId": c.matchId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.turnBasedMatches.join" call. +// Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TurnBasedMatch.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TurnBasedMatchesJoinCall) Do() (*TurnBasedMatch, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TurnBasedMatch{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TurnBasedMatchesLeaveCall) Fields(s ...googleapi.Field) *TurnBasedMatchesLeaveCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TurnBasedMatchesLeaveCall) Context(ctx context.Context) *TurnBasedMatchesLeaveCall { + c.ctx_ = ctx + return c +} + +func (c *TurnBasedMatchesLeaveCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/leave") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "matchId": c.matchId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.turnBasedMatches.leave" call. +// Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TurnBasedMatch.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TurnBasedMatchesLeaveCall) Do() (*TurnBasedMatch, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TurnBasedMatch{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TurnBasedMatchesLeaveTurnCall) Fields(s ...googleapi.Field) *TurnBasedMatchesLeaveTurnCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TurnBasedMatchesLeaveTurnCall) Context(ctx context.Context) *TurnBasedMatchesLeaveTurnCall { + c.ctx_ = ctx + return c +} + +func (c *TurnBasedMatchesLeaveTurnCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/leaveTurn") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "matchId": c.matchId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.turnBasedMatches.leaveTurn" call. +// Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TurnBasedMatch.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TurnBasedMatchesLeaveTurnCall) Do() (*TurnBasedMatch, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TurnBasedMatch{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TurnBasedMatchesListCall) Fields(s ...googleapi.Field) *TurnBasedMatchesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TurnBasedMatchesListCall) IfNoneMatch(entityTag string) *TurnBasedMatchesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TurnBasedMatchesListCall) Context(ctx context.Context) *TurnBasedMatchesListCall { + c.ctx_ = ctx + return c +} + +func (c *TurnBasedMatchesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.turnBasedMatches.list" call. +// Exactly one of *TurnBasedMatchList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TurnBasedMatchList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TurnBasedMatchesListCall) Do() (*TurnBasedMatchList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TurnBasedMatchList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TurnBasedMatchesRematchCall) Fields(s ...googleapi.Field) *TurnBasedMatchesRematchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TurnBasedMatchesRematchCall) Context(ctx context.Context) *TurnBasedMatchesRematchCall { + c.ctx_ = ctx + return c +} + +func (c *TurnBasedMatchesRematchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/rematch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "matchId": c.matchId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.turnBasedMatches.rematch" call. +// Exactly one of *TurnBasedMatchRematch or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TurnBasedMatchRematch.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TurnBasedMatchesRematchCall) Do() (*TurnBasedMatchRematch, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TurnBasedMatchRematch{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TurnBasedMatchesSyncCall) Fields(s ...googleapi.Field) *TurnBasedMatchesSyncCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TurnBasedMatchesSyncCall) IfNoneMatch(entityTag string) *TurnBasedMatchesSyncCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TurnBasedMatchesSyncCall) Context(ctx context.Context) *TurnBasedMatchesSyncCall { + c.ctx_ = ctx + return c +} + +func (c *TurnBasedMatchesSyncCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.turnBasedMatches.sync" call. +// Exactly one of *TurnBasedMatchSync or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TurnBasedMatchSync.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TurnBasedMatchesSyncCall) Do() (*TurnBasedMatchSync, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TurnBasedMatchSync{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TurnBasedMatchesTakeTurnCall) Fields(s ...googleapi.Field) *TurnBasedMatchesTakeTurnCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TurnBasedMatchesTakeTurnCall) Context(ctx context.Context) *TurnBasedMatchesTakeTurnCall { + c.ctx_ = ctx + return c +} + +func (c *TurnBasedMatchesTakeTurnCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["language"]; ok { + params.Set("language", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/turn") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "matchId": c.matchId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "games.turnBasedMatches.takeTurn" call. +// Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TurnBasedMatch.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TurnBasedMatchesTakeTurnCall) Do() (*TurnBasedMatch, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TurnBasedMatch{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/Godeps/_workspace/src/google.golang.org/api/gamesconfiguration/v1configuration/gamesconfiguration-api.json b/Godeps/_workspace/src/google.golang.org/api/gamesconfiguration/v1configuration/gamesconfiguration-api.json new file mode 100644 index 000000000..12373f510 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/gamesconfiguration/v1configuration/gamesconfiguration-api.json @@ -0,0 +1,774 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/2gN0bYpllkEYzozoMfjJq142ov0\"", + "discoveryVersion": "v1", + "id": "gamesConfiguration:v1configuration", + "name": "gamesConfiguration", + "canonicalName": "Games Configuration", + "version": "v1configuration", + "revision": "20150406", + "title": "Google Play Game Services Publishing API", + "description": "The Publishing 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/v1configuration/", + "basePath": "/games/v1configuration/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "games/v1configuration/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json" + ], + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.", + "location": "query" + }, + "userIp": { + "type": "string", + "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.", + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/androidpublisher": { + "description": "View and manage your Google Play Developer account" + } + } + } + }, + "schemas": { + "AchievementConfiguration": { + "id": "AchievementConfiguration", + "type": "object", + "description": "This is a JSON template for an achievement configuration resource.", + "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." + }, + "draft": { + "$ref": "AchievementConfigurationDetail", + "description": "The draft data of the achievement." + }, + "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." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string gamesConfiguration#achievementConfiguration.", + "default": "gamesConfiguration#achievementConfiguration" + }, + "published": { + "$ref": "AchievementConfigurationDetail", + "description": "The read-only published data of the achievement." + }, + "stepsToUnlock": { + "type": "integer", + "description": "Steps to unlock. Only applicable to incremental achievements.", + "format": "int32" + }, + "token": { + "type": "string", + "description": "The token for this resource." + } + } + }, + "AchievementConfigurationDetail": { + "id": "AchievementConfigurationDetail", + "type": "object", + "description": "This is a JSON template for an achievement configuration detail.", + "properties": { + "description": { + "$ref": "LocalizedStringBundle", + "description": "Localized strings for the achievement description." + }, + "iconUrl": { + "type": "string", + "description": "The icon url of this achievement. Writes to this field are ignored." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string gamesConfiguration#achievementConfigurationDetail.", + "default": "gamesConfiguration#achievementConfigurationDetail" + }, + "name": { + "$ref": "LocalizedStringBundle", + "description": "Localized strings for the achievement name." + }, + "pointValue": { + "type": "integer", + "description": "Point value for the achievement.", + "format": "int32" + }, + "sortRank": { + "type": "integer", + "description": "The sort rank of this achievement. Writes to this field are ignored.", + "format": "int32" + } + } + }, + "AchievementConfigurationListResponse": { + "id": "AchievementConfigurationListResponse", + "type": "object", + "description": "This is a JSON template for a ListConfigurations response.", + "properties": { + "items": { + "type": "array", + "description": "The achievement configurations.", + "items": { + "$ref": "AchievementConfiguration" + } + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#achievementConfigurationListResponse.", + "default": "gamesConfiguration#achievementConfigurationListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The pagination token for the next page of results." + } + } + }, + "GamesNumberAffixConfiguration": { + "id": "GamesNumberAffixConfiguration", + "type": "object", + "description": "This is a JSON template for a number affix resource.", + "properties": { + "few": { + "$ref": "LocalizedStringBundle", + "description": "When the language requires special treatment of \"small\" numbers (as with 2, 3, and 4 in Czech; or numbers ending 2, 3, or 4 but not 12, 13, or 14 in Polish)." + }, + "many": { + "$ref": "LocalizedStringBundle", + "description": "When the language requires special treatment of \"large\" numbers (as with numbers ending 11-99 in Maltese)." + }, + "one": { + "$ref": "LocalizedStringBundle", + "description": "When the language requires special treatment of numbers like one (as with the number 1 in English and most other languages; in Russian, any number ending in 1 but not ending in 11 is in this class)." + }, + "other": { + "$ref": "LocalizedStringBundle", + "description": "When the language does not require special treatment of the given quantity (as with all numbers in Chinese, or 42 in English)." + }, + "two": { + "$ref": "LocalizedStringBundle", + "description": "When the language requires special treatment of numbers like two (as with 2 in Welsh, or 102 in Slovenian)." + }, + "zero": { + "$ref": "LocalizedStringBundle", + "description": "When the language requires special treatment of the number 0 (as in Arabic)." + } + } + }, + "GamesNumberFormatConfiguration": { + "id": "GamesNumberFormatConfiguration", + "type": "object", + "description": "This is a JSON template for a number format resource.", + "properties": { + "currencyCode": { + "type": "string", + "description": "The curreny code string. Only used for CURRENCY format type." + }, + "numDecimalPlaces": { + "type": "integer", + "description": "The number of decimal places for number. Only used for NUMERIC format type.", + "format": "int32" + }, + "numberFormatType": { + "type": "string", + "description": "The formatting for the number.\nPossible values are: \n- \"NUMERIC\" - Numbers are formatted to have no digits or a fixed number of digits after the decimal point according to locale. An optional custom unit can be added.\n- \"TIME_DURATION\" - Numbers are formatted to hours, minutes and seconds.\n- \"CURRENCY\" - Numbers are formatted to currency according to locale." + }, + "suffix": { + "$ref": "GamesNumberAffixConfiguration", + "description": "An optional suffix for the NUMERIC format type. These strings follow the same plural rules as all Android string resources." + } + } + }, + "ImageConfiguration": { + "id": "ImageConfiguration", + "type": "object", + "description": "This is a JSON template for an image configuration resource.", + "properties": { + "imageType": { + "type": "string", + "description": "The image type for the image." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string gamesConfiguration#imageConfiguration.", + "default": "gamesConfiguration#imageConfiguration" + }, + "resourceId": { + "type": "string", + "description": "The resource ID of resource which the image belongs to." + }, + "url": { + "type": "string", + "description": "The url for this image." + } + } + }, + "LeaderboardConfiguration": { + "id": "LeaderboardConfiguration", + "type": "object", + "description": "This is a JSON template for an leaderboard configuration resource.", + "properties": { + "draft": { + "$ref": "LeaderboardConfigurationDetail", + "description": "The draft data of the leaderboard." + }, + "id": { + "type": "string", + "description": "The ID of the leaderboard." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string gamesConfiguration#leaderboardConfiguration.", + "default": "gamesConfiguration#leaderboardConfiguration" + }, + "published": { + "$ref": "LeaderboardConfigurationDetail", + "description": "The read-only published data of the leaderboard." + }, + "scoreMax": { + "type": "string", + "description": "Maximum score that can be posted to this leaderboard.", + "format": "int64" + }, + "scoreMin": { + "type": "string", + "description": "Minimum score that can be posted to this leaderboard.", + "format": "int64" + }, + "scoreOrder": { + "type": "string", + "description": "The type of the leaderboard.\nPossible values are: \n- \"LARGER_IS_BETTER\" - Larger scores posted are ranked higher. \n- \"SMALLER_IS_BETTER\" - Smaller scores posted are ranked higher." + }, + "token": { + "type": "string", + "description": "The token for this resource." + } + } + }, + "LeaderboardConfigurationDetail": { + "id": "LeaderboardConfigurationDetail", + "type": "object", + "description": "This is a JSON template for a leaderboard configuration detail.", + "properties": { + "iconUrl": { + "type": "string", + "description": "The icon url of this leaderboard. Writes to this field are ignored." + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string gamesConfiguration#leaderboardConfigurationDetail.", + "default": "gamesConfiguration#leaderboardConfigurationDetail" + }, + "name": { + "$ref": "LocalizedStringBundle", + "description": "Localized strings for the leaderboard name." + }, + "scoreFormat": { + "$ref": "GamesNumberFormatConfiguration", + "description": "The score formatting for the leaderboard." + }, + "sortRank": { + "type": "integer", + "description": "The sort rank of this leaderboard. Writes to this field are ignored.", + "format": "int32" + } + } + }, + "LeaderboardConfigurationListResponse": { + "id": "LeaderboardConfigurationListResponse", + "type": "object", + "description": "This is a JSON template for a ListConfigurations response.", + "properties": { + "items": { + "type": "array", + "description": "The leaderboard configurations.", + "items": { + "$ref": "LeaderboardConfiguration" + } + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string games#leaderboardConfigurationListResponse.", + "default": "gamesConfiguration#leaderboardConfigurationListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The pagination token for the next page of results." + } + } + }, + "LocalizedString": { + "id": "LocalizedString", + "type": "object", + "description": "This is a JSON template for a localized string resource.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string gamesConfiguration#localizedString.", + "default": "gamesConfiguration#localizedString" + }, + "locale": { + "type": "string", + "description": "The locale string." + }, + "value": { + "type": "string", + "description": "The string value." + } + } + }, + "LocalizedStringBundle": { + "id": "LocalizedStringBundle", + "type": "object", + "description": "This is a JSON template for a localized string bundle resource.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string gamesConfiguration#localizedStringBundle.", + "default": "gamesConfiguration#localizedStringBundle" + }, + "translations": { + "type": "array", + "description": "The locale strings.", + "items": { + "$ref": "LocalizedString" + } + } + } + } + }, + "resources": { + "achievementConfigurations": { + "methods": { + "delete": { + "id": "gamesConfiguration.achievementConfigurations.delete", + "path": "achievements/{achievementId}", + "httpMethod": "DELETE", + "description": "Delete the achievement configuration with the given ID.", + "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/androidpublisher" + ] + }, + "get": { + "id": "gamesConfiguration.achievementConfigurations.get", + "path": "achievements/{achievementId}", + "httpMethod": "GET", + "description": "Retrieves the metadata of the achievement configuration with the given ID.", + "parameters": { + "achievementId": { + "type": "string", + "description": "The ID of the achievement used by this method.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "achievementId" + ], + "response": { + "$ref": "AchievementConfiguration" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "insert": { + "id": "gamesConfiguration.achievementConfigurations.insert", + "path": "applications/{applicationId}/achievements", + "httpMethod": "POST", + "description": "Insert a new achievement configuration in this application.", + "parameters": { + "applicationId": { + "type": "string", + "description": "The application ID from the Google Play developer console.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "applicationId" + ], + "request": { + "$ref": "AchievementConfiguration" + }, + "response": { + "$ref": "AchievementConfiguration" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "list": { + "id": "gamesConfiguration.achievementConfigurations.list", + "path": "applications/{applicationId}/achievements", + "httpMethod": "GET", + "description": "Returns a list of the achievement configurations in this application.", + "parameters": { + "applicationId": { + "type": "string", + "description": "The application ID from the Google Play developer console.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of resource configurations to return in the response, used for paging. For any response, the actual number of 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" + } + }, + "parameterOrder": [ + "applicationId" + ], + "response": { + "$ref": "AchievementConfigurationListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "patch": { + "id": "gamesConfiguration.achievementConfigurations.patch", + "path": "achievements/{achievementId}", + "httpMethod": "PATCH", + "description": "Update the metadata of the achievement configuration with the given ID. This method supports patch semantics.", + "parameters": { + "achievementId": { + "type": "string", + "description": "The ID of the achievement used by this method.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "achievementId" + ], + "request": { + "$ref": "AchievementConfiguration" + }, + "response": { + "$ref": "AchievementConfiguration" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "update": { + "id": "gamesConfiguration.achievementConfigurations.update", + "path": "achievements/{achievementId}", + "httpMethod": "PUT", + "description": "Update the metadata of the achievement configuration with the given ID.", + "parameters": { + "achievementId": { + "type": "string", + "description": "The ID of the achievement used by this method.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "achievementId" + ], + "request": { + "$ref": "AchievementConfiguration" + }, + "response": { + "$ref": "AchievementConfiguration" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + } + } + }, + "imageConfigurations": { + "methods": { + "upload": { + "id": "gamesConfiguration.imageConfigurations.upload", + "path": "images/{resourceId}/imageType/{imageType}", + "httpMethod": "POST", + "description": "Uploads an image for a resource with the given ID and image type.", + "parameters": { + "imageType": { + "type": "string", + "description": "Selects which image in a resource for this method.", + "required": true, + "enum": [ + "ACHIEVEMENT_ICON", + "LEADERBOARD_ICON" + ], + "enumDescriptions": [ + "The icon image for an achievement resource.", + "The icon image for a leaderboard resource." + ], + "location": "path" + }, + "resourceId": { + "type": "string", + "description": "The ID of the resource used by this method.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "resourceId", + "imageType" + ], + "response": { + "$ref": "ImageConfiguration" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "image/*" + ], + "maxSize": "15MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/games/v1configuration/images/{resourceId}/imageType/{imageType}" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/games/v1configuration/images/{resourceId}/imageType/{imageType}" + } + } + } + } + } + }, + "leaderboardConfigurations": { + "methods": { + "delete": { + "id": "gamesConfiguration.leaderboardConfigurations.delete", + "path": "leaderboards/{leaderboardId}", + "httpMethod": "DELETE", + "description": "Delete the leaderboard configuration with the given ID.", + "parameters": { + "leaderboardId": { + "type": "string", + "description": "The ID of the leaderboard.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "leaderboardId" + ], + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "get": { + "id": "gamesConfiguration.leaderboardConfigurations.get", + "path": "leaderboards/{leaderboardId}", + "httpMethod": "GET", + "description": "Retrieves the metadata of the leaderboard configuration with the given ID.", + "parameters": { + "leaderboardId": { + "type": "string", + "description": "The ID of the leaderboard.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "leaderboardId" + ], + "response": { + "$ref": "LeaderboardConfiguration" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "insert": { + "id": "gamesConfiguration.leaderboardConfigurations.insert", + "path": "applications/{applicationId}/leaderboards", + "httpMethod": "POST", + "description": "Insert a new leaderboard configuration in this application.", + "parameters": { + "applicationId": { + "type": "string", + "description": "The application ID from the Google Play developer console.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "applicationId" + ], + "request": { + "$ref": "LeaderboardConfiguration" + }, + "response": { + "$ref": "LeaderboardConfiguration" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "list": { + "id": "gamesConfiguration.leaderboardConfigurations.list", + "path": "applications/{applicationId}/leaderboards", + "httpMethod": "GET", + "description": "Returns a list of the leaderboard configurations in this application.", + "parameters": { + "applicationId": { + "type": "string", + "description": "The application ID from the Google Play developer console.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of resource configurations to return in the response, used for paging. For any response, the actual number of 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" + } + }, + "parameterOrder": [ + "applicationId" + ], + "response": { + "$ref": "LeaderboardConfigurationListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "patch": { + "id": "gamesConfiguration.leaderboardConfigurations.patch", + "path": "leaderboards/{leaderboardId}", + "httpMethod": "PATCH", + "description": "Update the metadata of the leaderboard configuration with the given ID. This method supports patch semantics.", + "parameters": { + "leaderboardId": { + "type": "string", + "description": "The ID of the leaderboard.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "leaderboardId" + ], + "request": { + "$ref": "LeaderboardConfiguration" + }, + "response": { + "$ref": "LeaderboardConfiguration" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + }, + "update": { + "id": "gamesConfiguration.leaderboardConfigurations.update", + "path": "leaderboards/{leaderboardId}", + "httpMethod": "PUT", + "description": "Update the metadata of the leaderboard configuration with the given ID.", + "parameters": { + "leaderboardId": { + "type": "string", + "description": "The ID of the leaderboard.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "leaderboardId" + ], + "request": { + "$ref": "LeaderboardConfiguration" + }, + "response": { + "$ref": "LeaderboardConfiguration" + }, + "scopes": [ + "https://www.googleapis.com/auth/androidpublisher" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/gamesconfiguration/v1configuration/gamesconfiguration-gen.go b/Godeps/_workspace/src/google.golang.org/api/gamesconfiguration/v1configuration/gamesconfiguration-gen.go new file mode 100644 index 000000000..62307a37d --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/gamesconfiguration/v1configuration/gamesconfiguration-gen.go @@ -0,0 +1,2256 @@ +// Package gamesconfiguration provides access to the Google Play Game Services Publishing API. +// +// See https://developers.google.com/games/services +// +// Usage example: +// +// import "google.golang.org/api/gamesconfiguration/v1configuration" +// ... +// gamesconfigurationService, err := gamesconfiguration.New(oauthHttpClient) +package gamesconfiguration // import "google.golang.org/api/gamesconfiguration/v1configuration" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "gamesConfiguration:v1configuration" +const apiName = "gamesConfiguration" +const apiVersion = "v1configuration" +const basePath = "https://www.googleapis.com/games/v1configuration/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your Google Play Developer account + AndroidpublisherScope = "https://www.googleapis.com/auth/androidpublisher" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.AchievementConfigurations = NewAchievementConfigurationsService(s) + s.ImageConfigurations = NewImageConfigurationsService(s) + s.LeaderboardConfigurations = NewLeaderboardConfigurationsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + AchievementConfigurations *AchievementConfigurationsService + + ImageConfigurations *ImageConfigurationsService + + LeaderboardConfigurations *LeaderboardConfigurationsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAchievementConfigurationsService(s *Service) *AchievementConfigurationsService { + rs := &AchievementConfigurationsService{s: s} + return rs +} + +type AchievementConfigurationsService struct { + s *Service +} + +func NewImageConfigurationsService(s *Service) *ImageConfigurationsService { + rs := &ImageConfigurationsService{s: s} + return rs +} + +type ImageConfigurationsService struct { + s *Service +} + +func NewLeaderboardConfigurationsService(s *Service) *LeaderboardConfigurationsService { + rs := &LeaderboardConfigurationsService{s: s} + return rs +} + +type LeaderboardConfigurationsService struct { + s *Service +} + +// AchievementConfiguration: This is a JSON template for an achievement +// configuration resource. +type AchievementConfiguration 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"` + + // Draft: The draft data of the achievement. + Draft *AchievementConfigurationDetail `json:"draft,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"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string gamesConfiguration#achievementConfiguration. + Kind string `json:"kind,omitempty"` + + // Published: The read-only published data of the achievement. + Published *AchievementConfigurationDetail `json:"published,omitempty"` + + // StepsToUnlock: Steps to unlock. Only applicable to incremental + // achievements. + StepsToUnlock int64 `json:"stepsToUnlock,omitempty"` + + // Token: The token for this resource. + Token string `json:"token,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AchievementType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AchievementConfiguration) MarshalJSON() ([]byte, error) { + type noMethod AchievementConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AchievementConfigurationDetail: This is a JSON template for an +// achievement configuration detail. +type AchievementConfigurationDetail struct { + // Description: Localized strings for the achievement description. + Description *LocalizedStringBundle `json:"description,omitempty"` + + // IconUrl: The icon url of this achievement. Writes to this field are + // ignored. + IconUrl string `json:"iconUrl,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string gamesConfiguration#achievementConfigurationDetail. + Kind string `json:"kind,omitempty"` + + // Name: Localized strings for the achievement name. + Name *LocalizedStringBundle `json:"name,omitempty"` + + // PointValue: Point value for the achievement. + PointValue int64 `json:"pointValue,omitempty"` + + // SortRank: The sort rank of this achievement. Writes to this field are + // ignored. + SortRank int64 `json:"sortRank,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AchievementConfigurationDetail) MarshalJSON() ([]byte, error) { + type noMethod AchievementConfigurationDetail + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AchievementConfigurationListResponse: This is a JSON template for a +// ListConfigurations response. +type AchievementConfigurationListResponse struct { + // Items: The achievement configurations. + Items []*AchievementConfiguration `json:"items,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#achievementConfigurationListResponse. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The pagination token for the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AchievementConfigurationListResponse) MarshalJSON() ([]byte, error) { + type noMethod AchievementConfigurationListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GamesNumberAffixConfiguration: This is a JSON template for a number +// affix resource. +type GamesNumberAffixConfiguration struct { + // Few: When the language requires special treatment of "small" numbers + // (as with 2, 3, and 4 in Czech; or numbers ending 2, 3, or 4 but not + // 12, 13, or 14 in Polish). + Few *LocalizedStringBundle `json:"few,omitempty"` + + // Many: When the language requires special treatment of "large" numbers + // (as with numbers ending 11-99 in Maltese). + Many *LocalizedStringBundle `json:"many,omitempty"` + + // One: When the language requires special treatment of numbers like one + // (as with the number 1 in English and most other languages; in + // Russian, any number ending in 1 but not ending in 11 is in this + // class). + One *LocalizedStringBundle `json:"one,omitempty"` + + // Other: When the language does not require special treatment of the + // given quantity (as with all numbers in Chinese, or 42 in English). + Other *LocalizedStringBundle `json:"other,omitempty"` + + // Two: When the language requires special treatment of numbers like two + // (as with 2 in Welsh, or 102 in Slovenian). + Two *LocalizedStringBundle `json:"two,omitempty"` + + // Zero: When the language requires special treatment of the number 0 + // (as in Arabic). + Zero *LocalizedStringBundle `json:"zero,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Few") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GamesNumberAffixConfiguration) MarshalJSON() ([]byte, error) { + type noMethod GamesNumberAffixConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GamesNumberFormatConfiguration: This is a JSON template for a number +// format resource. +type GamesNumberFormatConfiguration struct { + // CurrencyCode: The curreny code string. Only used for CURRENCY format + // type. + CurrencyCode string `json:"currencyCode,omitempty"` + + // NumDecimalPlaces: The number of decimal places for number. Only used + // for NUMERIC format type. + NumDecimalPlaces int64 `json:"numDecimalPlaces,omitempty"` + + // NumberFormatType: The formatting for the number. + // Possible values are: + // - "NUMERIC" - Numbers are formatted to have no digits or a fixed + // number of digits after the decimal point according to locale. An + // optional custom unit can be added. + // - "TIME_DURATION" - Numbers are formatted to hours, minutes and + // seconds. + // - "CURRENCY" - Numbers are formatted to currency according to locale. + NumberFormatType string `json:"numberFormatType,omitempty"` + + // Suffix: An optional suffix for the NUMERIC format type. These strings + // follow the same plural rules as all Android string resources. + Suffix *GamesNumberAffixConfiguration `json:"suffix,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CurrencyCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GamesNumberFormatConfiguration) MarshalJSON() ([]byte, error) { + type noMethod GamesNumberFormatConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ImageConfiguration: This is a JSON template for an image +// configuration resource. +type ImageConfiguration struct { + // ImageType: The image type for the image. + ImageType string `json:"imageType,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string gamesConfiguration#imageConfiguration. + Kind string `json:"kind,omitempty"` + + // ResourceId: The resource ID of resource which the image belongs to. + ResourceId string `json:"resourceId,omitempty"` + + // Url: The url for this image. + Url string `json:"url,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ImageType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ImageConfiguration) MarshalJSON() ([]byte, error) { + type noMethod ImageConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LeaderboardConfiguration: This is a JSON template for an leaderboard +// configuration resource. +type LeaderboardConfiguration struct { + // Draft: The draft data of the leaderboard. + Draft *LeaderboardConfigurationDetail `json:"draft,omitempty"` + + // Id: The ID of the leaderboard. + Id string `json:"id,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string gamesConfiguration#leaderboardConfiguration. + Kind string `json:"kind,omitempty"` + + // Published: The read-only published data of the leaderboard. + Published *LeaderboardConfigurationDetail `json:"published,omitempty"` + + // ScoreMax: Maximum score that can be posted to this leaderboard. + ScoreMax int64 `json:"scoreMax,omitempty,string"` + + // ScoreMin: Minimum score that can be posted to this leaderboard. + ScoreMin int64 `json:"scoreMin,omitempty,string"` + + // ScoreOrder: The type of the leaderboard. + // Possible values are: + // - "LARGER_IS_BETTER" - Larger scores posted are ranked higher. + // - "SMALLER_IS_BETTER" - Smaller scores posted are ranked higher. + ScoreOrder string `json:"scoreOrder,omitempty"` + + // Token: The token for this resource. + Token string `json:"token,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Draft") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LeaderboardConfiguration) MarshalJSON() ([]byte, error) { + type noMethod LeaderboardConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LeaderboardConfigurationDetail: This is a JSON template for a +// leaderboard configuration detail. +type LeaderboardConfigurationDetail struct { + // IconUrl: The icon url of this leaderboard. Writes to this field are + // ignored. + IconUrl string `json:"iconUrl,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string gamesConfiguration#leaderboardConfigurationDetail. + Kind string `json:"kind,omitempty"` + + // Name: Localized strings for the leaderboard name. + Name *LocalizedStringBundle `json:"name,omitempty"` + + // ScoreFormat: The score formatting for the leaderboard. + ScoreFormat *GamesNumberFormatConfiguration `json:"scoreFormat,omitempty"` + + // SortRank: The sort rank of this leaderboard. Writes to this field are + // ignored. + SortRank int64 `json:"sortRank,omitempty"` + + // ForceSendFields is a list of field names (e.g. "IconUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LeaderboardConfigurationDetail) MarshalJSON() ([]byte, error) { + type noMethod LeaderboardConfigurationDetail + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LeaderboardConfigurationListResponse: This is a JSON template for a +// ListConfigurations response. +type LeaderboardConfigurationListResponse struct { + // Items: The leaderboard configurations. + Items []*LeaderboardConfiguration `json:"items,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string games#leaderboardConfigurationListResponse. + Kind string `json:"kind,omitempty"` + + // NextPageToken: The pagination token for the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LeaderboardConfigurationListResponse) MarshalJSON() ([]byte, error) { + type noMethod LeaderboardConfigurationListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LocalizedString: This is a JSON template for a localized string +// resource. +type LocalizedString struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string gamesConfiguration#localizedString. + Kind string `json:"kind,omitempty"` + + // Locale: The locale string. + Locale string `json:"locale,omitempty"` + + // Value: The string value. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LocalizedString) MarshalJSON() ([]byte, error) { + type noMethod LocalizedString + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LocalizedStringBundle: This is a JSON template for a localized string +// bundle resource. +type LocalizedStringBundle struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string gamesConfiguration#localizedStringBundle. + Kind string `json:"kind,omitempty"` + + // Translations: The locale strings. + Translations []*LocalizedString `json:"translations,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LocalizedStringBundle) MarshalJSON() ([]byte, error) { + type noMethod LocalizedStringBundle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "gamesConfiguration.achievementConfigurations.delete": + +type AchievementConfigurationsDeleteCall struct { + s *Service + achievementId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Delete the achievement configuration with the given ID. +func (r *AchievementConfigurationsService) Delete(achievementId string) *AchievementConfigurationsDeleteCall { + c := &AchievementConfigurationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.achievementId = achievementId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AchievementConfigurationsDeleteCall) Fields(s ...googleapi.Field) *AchievementConfigurationsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AchievementConfigurationsDeleteCall) Context(ctx context.Context) *AchievementConfigurationsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AchievementConfigurationsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "achievementId": c.achievementId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesConfiguration.achievementConfigurations.delete" call. +func (c *AchievementConfigurationsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete the achievement configuration with the given ID.", + // "httpMethod": "DELETE", + // "id": "gamesConfiguration.achievementConfigurations.delete", + // "parameterOrder": [ + // "achievementId" + // ], + // "parameters": { + // "achievementId": { + // "description": "The ID of the achievement used by this method.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "achievements/{achievementId}", + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "gamesConfiguration.achievementConfigurations.get": + +type AchievementConfigurationsGetCall struct { + s *Service + achievementId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves the metadata of the achievement configuration with the +// given ID. +func (r *AchievementConfigurationsService) Get(achievementId string) *AchievementConfigurationsGetCall { + c := &AchievementConfigurationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.achievementId = achievementId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AchievementConfigurationsGetCall) Fields(s ...googleapi.Field) *AchievementConfigurationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AchievementConfigurationsGetCall) IfNoneMatch(entityTag string) *AchievementConfigurationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AchievementConfigurationsGetCall) Context(ctx context.Context) *AchievementConfigurationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AchievementConfigurationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "achievementId": c.achievementId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesConfiguration.achievementConfigurations.get" call. +// Exactly one of *AchievementConfiguration or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *AchievementConfiguration.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AchievementConfigurationsGetCall) Do() (*AchievementConfiguration, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AchievementConfiguration{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the metadata of the achievement configuration with the given ID.", + // "httpMethod": "GET", + // "id": "gamesConfiguration.achievementConfigurations.get", + // "parameterOrder": [ + // "achievementId" + // ], + // "parameters": { + // "achievementId": { + // "description": "The ID of the achievement used by this method.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "achievements/{achievementId}", + // "response": { + // "$ref": "AchievementConfiguration" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "gamesConfiguration.achievementConfigurations.insert": + +type AchievementConfigurationsInsertCall struct { + s *Service + applicationId string + achievementconfiguration *AchievementConfiguration + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Insert a new achievement configuration in this application. +func (r *AchievementConfigurationsService) Insert(applicationId string, achievementconfiguration *AchievementConfiguration) *AchievementConfigurationsInsertCall { + c := &AchievementConfigurationsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.applicationId = applicationId + c.achievementconfiguration = achievementconfiguration + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AchievementConfigurationsInsertCall) Fields(s ...googleapi.Field) *AchievementConfigurationsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AchievementConfigurationsInsertCall) Context(ctx context.Context) *AchievementConfigurationsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *AchievementConfigurationsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.achievementconfiguration) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}/achievements") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "applicationId": c.applicationId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesConfiguration.achievementConfigurations.insert" call. +// Exactly one of *AchievementConfiguration or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *AchievementConfiguration.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AchievementConfigurationsInsertCall) Do() (*AchievementConfiguration, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AchievementConfiguration{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Insert a new achievement configuration in this application.", + // "httpMethod": "POST", + // "id": "gamesConfiguration.achievementConfigurations.insert", + // "parameterOrder": [ + // "applicationId" + // ], + // "parameters": { + // "applicationId": { + // "description": "The application ID from the Google Play developer console.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "applications/{applicationId}/achievements", + // "request": { + // "$ref": "AchievementConfiguration" + // }, + // "response": { + // "$ref": "AchievementConfiguration" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "gamesConfiguration.achievementConfigurations.list": + +type AchievementConfigurationsListCall struct { + s *Service + applicationId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Returns a list of the achievement configurations in this +// application. +func (r *AchievementConfigurationsService) List(applicationId string) *AchievementConfigurationsListCall { + c := &AchievementConfigurationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.applicationId = applicationId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of resource configurations to return in the response, used for +// paging. For any response, the actual number of resources returned may +// be less than the specified maxResults. +func (c *AchievementConfigurationsListCall) MaxResults(maxResults int64) *AchievementConfigurationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *AchievementConfigurationsListCall) PageToken(pageToken string) *AchievementConfigurationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AchievementConfigurationsListCall) Fields(s ...googleapi.Field) *AchievementConfigurationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AchievementConfigurationsListCall) IfNoneMatch(entityTag string) *AchievementConfigurationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AchievementConfigurationsListCall) Context(ctx context.Context) *AchievementConfigurationsListCall { + c.ctx_ = ctx + return c +} + +func (c *AchievementConfigurationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}/achievements") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "applicationId": c.applicationId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesConfiguration.achievementConfigurations.list" call. +// Exactly one of *AchievementConfigurationListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *AchievementConfigurationListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AchievementConfigurationsListCall) Do() (*AchievementConfigurationListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AchievementConfigurationListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a list of the achievement configurations in this application.", + // "httpMethod": "GET", + // "id": "gamesConfiguration.achievementConfigurations.list", + // "parameterOrder": [ + // "applicationId" + // ], + // "parameters": { + // "applicationId": { + // "description": "The application ID from the Google Play developer console.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of resource configurations to return in the response, used for paging. For any response, the actual number of 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": "applications/{applicationId}/achievements", + // "response": { + // "$ref": "AchievementConfigurationListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "gamesConfiguration.achievementConfigurations.patch": + +type AchievementConfigurationsPatchCall struct { + s *Service + achievementId string + achievementconfiguration *AchievementConfiguration + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Update the metadata of the achievement configuration with the +// given ID. This method supports patch semantics. +func (r *AchievementConfigurationsService) Patch(achievementId string, achievementconfiguration *AchievementConfiguration) *AchievementConfigurationsPatchCall { + c := &AchievementConfigurationsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.achievementId = achievementId + c.achievementconfiguration = achievementconfiguration + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AchievementConfigurationsPatchCall) Fields(s ...googleapi.Field) *AchievementConfigurationsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AchievementConfigurationsPatchCall) Context(ctx context.Context) *AchievementConfigurationsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AchievementConfigurationsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.achievementconfiguration) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "achievementId": c.achievementId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesConfiguration.achievementConfigurations.patch" call. +// Exactly one of *AchievementConfiguration or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *AchievementConfiguration.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AchievementConfigurationsPatchCall) Do() (*AchievementConfiguration, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AchievementConfiguration{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update the metadata of the achievement configuration with the given ID. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "gamesConfiguration.achievementConfigurations.patch", + // "parameterOrder": [ + // "achievementId" + // ], + // "parameters": { + // "achievementId": { + // "description": "The ID of the achievement used by this method.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "achievements/{achievementId}", + // "request": { + // "$ref": "AchievementConfiguration" + // }, + // "response": { + // "$ref": "AchievementConfiguration" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "gamesConfiguration.achievementConfigurations.update": + +type AchievementConfigurationsUpdateCall struct { + s *Service + achievementId string + achievementconfiguration *AchievementConfiguration + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Update the metadata of the achievement configuration with the +// given ID. +func (r *AchievementConfigurationsService) Update(achievementId string, achievementconfiguration *AchievementConfiguration) *AchievementConfigurationsUpdateCall { + c := &AchievementConfigurationsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.achievementId = achievementId + c.achievementconfiguration = achievementconfiguration + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AchievementConfigurationsUpdateCall) Fields(s ...googleapi.Field) *AchievementConfigurationsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AchievementConfigurationsUpdateCall) Context(ctx context.Context) *AchievementConfigurationsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AchievementConfigurationsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.achievementconfiguration) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "achievementId": c.achievementId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesConfiguration.achievementConfigurations.update" call. +// Exactly one of *AchievementConfiguration or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *AchievementConfiguration.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AchievementConfigurationsUpdateCall) Do() (*AchievementConfiguration, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AchievementConfiguration{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update the metadata of the achievement configuration with the given ID.", + // "httpMethod": "PUT", + // "id": "gamesConfiguration.achievementConfigurations.update", + // "parameterOrder": [ + // "achievementId" + // ], + // "parameters": { + // "achievementId": { + // "description": "The ID of the achievement used by this method.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "achievements/{achievementId}", + // "request": { + // "$ref": "AchievementConfiguration" + // }, + // "response": { + // "$ref": "AchievementConfiguration" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "gamesConfiguration.imageConfigurations.upload": + +type ImageConfigurationsUploadCall struct { + s *Service + resourceId string + imageType string + opt_ map[string]interface{} + media_ io.Reader + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// Upload: Uploads an image for a resource with the given ID and image +// type. +func (r *ImageConfigurationsService) Upload(resourceId string, imageType string) *ImageConfigurationsUploadCall { + c := &ImageConfigurationsUploadCall{s: r.s, opt_: make(map[string]interface{})} + c.resourceId = resourceId + c.imageType = imageType + return c +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *ImageConfigurationsUploadCall) Media(r io.Reader) *ImageConfigurationsUploadCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *ImageConfigurationsUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ImageConfigurationsUploadCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *ImageConfigurationsUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ImageConfigurationsUploadCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ImageConfigurationsUploadCall) Fields(s ...googleapi.Field) *ImageConfigurationsUploadCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *ImageConfigurationsUploadCall) Context(ctx context.Context) *ImageConfigurationsUploadCall { + c.ctx_ = ctx + return c +} + +func (c *ImageConfigurationsUploadCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "images/{resourceId}/imageType/{imageType}") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + body = new(bytes.Buffer) + ctype := "application/json" + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "resourceId": c.resourceId, + "imageType": c.imageType, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesConfiguration.imageConfigurations.upload" call. +// Exactly one of *ImageConfiguration or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ImageConfiguration.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ImageConfigurationsUploadCall) Do() (*ImageConfiguration, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &ImageConfiguration{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Uploads an image for a resource with the given ID and image type.", + // "httpMethod": "POST", + // "id": "gamesConfiguration.imageConfigurations.upload", + // "mediaUpload": { + // "accept": [ + // "image/*" + // ], + // "maxSize": "15MB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/games/v1configuration/images/{resourceId}/imageType/{imageType}" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/games/v1configuration/images/{resourceId}/imageType/{imageType}" + // } + // } + // }, + // "parameterOrder": [ + // "resourceId", + // "imageType" + // ], + // "parameters": { + // "imageType": { + // "description": "Selects which image in a resource for this method.", + // "enum": [ + // "ACHIEVEMENT_ICON", + // "LEADERBOARD_ICON" + // ], + // "enumDescriptions": [ + // "The icon image for an achievement resource.", + // "The icon image for a leaderboard resource." + // ], + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "resourceId": { + // "description": "The ID of the resource used by this method.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "images/{resourceId}/imageType/{imageType}", + // "response": { + // "$ref": "ImageConfiguration" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "gamesConfiguration.leaderboardConfigurations.delete": + +type LeaderboardConfigurationsDeleteCall struct { + s *Service + leaderboardId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Delete the leaderboard configuration with the given ID. +func (r *LeaderboardConfigurationsService) Delete(leaderboardId string) *LeaderboardConfigurationsDeleteCall { + c := &LeaderboardConfigurationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.leaderboardId = leaderboardId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LeaderboardConfigurationsDeleteCall) Fields(s ...googleapi.Field) *LeaderboardConfigurationsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LeaderboardConfigurationsDeleteCall) Context(ctx context.Context) *LeaderboardConfigurationsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *LeaderboardConfigurationsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "leaderboardId": c.leaderboardId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesConfiguration.leaderboardConfigurations.delete" call. +func (c *LeaderboardConfigurationsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete the leaderboard configuration with the given ID.", + // "httpMethod": "DELETE", + // "id": "gamesConfiguration.leaderboardConfigurations.delete", + // "parameterOrder": [ + // "leaderboardId" + // ], + // "parameters": { + // "leaderboardId": { + // "description": "The ID of the leaderboard.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "leaderboards/{leaderboardId}", + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "gamesConfiguration.leaderboardConfigurations.get": + +type LeaderboardConfigurationsGetCall struct { + s *Service + leaderboardId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves the metadata of the leaderboard configuration with the +// given ID. +func (r *LeaderboardConfigurationsService) Get(leaderboardId string) *LeaderboardConfigurationsGetCall { + c := &LeaderboardConfigurationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.leaderboardId = leaderboardId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LeaderboardConfigurationsGetCall) Fields(s ...googleapi.Field) *LeaderboardConfigurationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LeaderboardConfigurationsGetCall) IfNoneMatch(entityTag string) *LeaderboardConfigurationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LeaderboardConfigurationsGetCall) Context(ctx context.Context) *LeaderboardConfigurationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *LeaderboardConfigurationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "leaderboardId": c.leaderboardId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesConfiguration.leaderboardConfigurations.get" call. +// Exactly one of *LeaderboardConfiguration or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *LeaderboardConfiguration.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LeaderboardConfigurationsGetCall) Do() (*LeaderboardConfiguration, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LeaderboardConfiguration{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the metadata of the leaderboard configuration with the given ID.", + // "httpMethod": "GET", + // "id": "gamesConfiguration.leaderboardConfigurations.get", + // "parameterOrder": [ + // "leaderboardId" + // ], + // "parameters": { + // "leaderboardId": { + // "description": "The ID of the leaderboard.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "leaderboards/{leaderboardId}", + // "response": { + // "$ref": "LeaderboardConfiguration" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "gamesConfiguration.leaderboardConfigurations.insert": + +type LeaderboardConfigurationsInsertCall struct { + s *Service + applicationId string + leaderboardconfiguration *LeaderboardConfiguration + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Insert a new leaderboard configuration in this application. +func (r *LeaderboardConfigurationsService) Insert(applicationId string, leaderboardconfiguration *LeaderboardConfiguration) *LeaderboardConfigurationsInsertCall { + c := &LeaderboardConfigurationsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.applicationId = applicationId + c.leaderboardconfiguration = leaderboardconfiguration + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LeaderboardConfigurationsInsertCall) Fields(s ...googleapi.Field) *LeaderboardConfigurationsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LeaderboardConfigurationsInsertCall) Context(ctx context.Context) *LeaderboardConfigurationsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *LeaderboardConfigurationsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.leaderboardconfiguration) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}/leaderboards") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "applicationId": c.applicationId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesConfiguration.leaderboardConfigurations.insert" call. +// Exactly one of *LeaderboardConfiguration or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *LeaderboardConfiguration.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LeaderboardConfigurationsInsertCall) Do() (*LeaderboardConfiguration, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LeaderboardConfiguration{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Insert a new leaderboard configuration in this application.", + // "httpMethod": "POST", + // "id": "gamesConfiguration.leaderboardConfigurations.insert", + // "parameterOrder": [ + // "applicationId" + // ], + // "parameters": { + // "applicationId": { + // "description": "The application ID from the Google Play developer console.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "applications/{applicationId}/leaderboards", + // "request": { + // "$ref": "LeaderboardConfiguration" + // }, + // "response": { + // "$ref": "LeaderboardConfiguration" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "gamesConfiguration.leaderboardConfigurations.list": + +type LeaderboardConfigurationsListCall struct { + s *Service + applicationId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Returns a list of the leaderboard configurations in this +// application. +func (r *LeaderboardConfigurationsService) List(applicationId string) *LeaderboardConfigurationsListCall { + c := &LeaderboardConfigurationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.applicationId = applicationId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of resource configurations to return in the response, used for +// paging. For any response, the actual number of resources returned may +// be less than the specified maxResults. +func (c *LeaderboardConfigurationsListCall) MaxResults(maxResults int64) *LeaderboardConfigurationsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The token returned +// by the previous request. +func (c *LeaderboardConfigurationsListCall) PageToken(pageToken string) *LeaderboardConfigurationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LeaderboardConfigurationsListCall) Fields(s ...googleapi.Field) *LeaderboardConfigurationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LeaderboardConfigurationsListCall) IfNoneMatch(entityTag string) *LeaderboardConfigurationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LeaderboardConfigurationsListCall) Context(ctx context.Context) *LeaderboardConfigurationsListCall { + c.ctx_ = ctx + return c +} + +func (c *LeaderboardConfigurationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}/leaderboards") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "applicationId": c.applicationId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesConfiguration.leaderboardConfigurations.list" call. +// Exactly one of *LeaderboardConfigurationListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *LeaderboardConfigurationListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *LeaderboardConfigurationsListCall) Do() (*LeaderboardConfigurationListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LeaderboardConfigurationListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a list of the leaderboard configurations in this application.", + // "httpMethod": "GET", + // "id": "gamesConfiguration.leaderboardConfigurations.list", + // "parameterOrder": [ + // "applicationId" + // ], + // "parameters": { + // "applicationId": { + // "description": "The application ID from the Google Play developer console.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "description": "The maximum number of resource configurations to return in the response, used for paging. For any response, the actual number of 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": "applications/{applicationId}/leaderboards", + // "response": { + // "$ref": "LeaderboardConfigurationListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "gamesConfiguration.leaderboardConfigurations.patch": + +type LeaderboardConfigurationsPatchCall struct { + s *Service + leaderboardId string + leaderboardconfiguration *LeaderboardConfiguration + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Update the metadata of the leaderboard configuration with the +// given ID. This method supports patch semantics. +func (r *LeaderboardConfigurationsService) Patch(leaderboardId string, leaderboardconfiguration *LeaderboardConfiguration) *LeaderboardConfigurationsPatchCall { + c := &LeaderboardConfigurationsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.leaderboardId = leaderboardId + c.leaderboardconfiguration = leaderboardconfiguration + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LeaderboardConfigurationsPatchCall) Fields(s ...googleapi.Field) *LeaderboardConfigurationsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LeaderboardConfigurationsPatchCall) Context(ctx context.Context) *LeaderboardConfigurationsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *LeaderboardConfigurationsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.leaderboardconfiguration) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "leaderboardId": c.leaderboardId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesConfiguration.leaderboardConfigurations.patch" call. +// Exactly one of *LeaderboardConfiguration or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *LeaderboardConfiguration.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LeaderboardConfigurationsPatchCall) Do() (*LeaderboardConfiguration, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LeaderboardConfiguration{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update the metadata of the leaderboard configuration with the given ID. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "gamesConfiguration.leaderboardConfigurations.patch", + // "parameterOrder": [ + // "leaderboardId" + // ], + // "parameters": { + // "leaderboardId": { + // "description": "The ID of the leaderboard.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "leaderboards/{leaderboardId}", + // "request": { + // "$ref": "LeaderboardConfiguration" + // }, + // "response": { + // "$ref": "LeaderboardConfiguration" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} + +// method id "gamesConfiguration.leaderboardConfigurations.update": + +type LeaderboardConfigurationsUpdateCall struct { + s *Service + leaderboardId string + leaderboardconfiguration *LeaderboardConfiguration + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Update the metadata of the leaderboard configuration with the +// given ID. +func (r *LeaderboardConfigurationsService) Update(leaderboardId string, leaderboardconfiguration *LeaderboardConfiguration) *LeaderboardConfigurationsUpdateCall { + c := &LeaderboardConfigurationsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.leaderboardId = leaderboardId + c.leaderboardconfiguration = leaderboardconfiguration + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LeaderboardConfigurationsUpdateCall) Fields(s ...googleapi.Field) *LeaderboardConfigurationsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LeaderboardConfigurationsUpdateCall) Context(ctx context.Context) *LeaderboardConfigurationsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *LeaderboardConfigurationsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.leaderboardconfiguration) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "leaderboardId": c.leaderboardId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesConfiguration.leaderboardConfigurations.update" call. +// Exactly one of *LeaderboardConfiguration or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *LeaderboardConfiguration.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LeaderboardConfigurationsUpdateCall) Do() (*LeaderboardConfiguration, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LeaderboardConfiguration{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update the metadata of the leaderboard configuration with the given ID.", + // "httpMethod": "PUT", + // "id": "gamesConfiguration.leaderboardConfigurations.update", + // "parameterOrder": [ + // "leaderboardId" + // ], + // "parameters": { + // "leaderboardId": { + // "description": "The ID of the leaderboard.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "leaderboards/{leaderboardId}", + // "request": { + // "$ref": "LeaderboardConfiguration" + // }, + // "response": { + // "$ref": "LeaderboardConfiguration" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/androidpublisher" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/gamesmanagement/v1management/gamesmanagement-api.json b/Godeps/_workspace/src/google.golang.org/api/gamesmanagement/v1management/gamesmanagement-api.json new file mode 100644 index 000000000..27bd75950 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/gamesmanagement/v1management/gamesmanagement-api.json @@ -0,0 +1,881 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/pd3kPnOWeE_pyZMoVhvVpjurmVg\"", + "discoveryVersion": "v1", + "id": "gamesManagement:v1management", + "name": "gamesManagement", + "canonicalName": "Games Management", + "version": "v1management", + "revision": "20150707", + "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" + } + } + } + }, + "AchievementResetMultipleForAllRequest": { + "id": "AchievementResetMultipleForAllRequest", + "type": "object", + "description": "This is a JSON template for multiple achievements reset all request.", + "properties": { + "achievement_ids": { + "type": "array", + "description": "The IDs of achievements to reset.", + "items": { + "type": "string" + } + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string gamesManagement#achievementResetMultipleForAllRequest.", + "default": "gamesManagement#achievementResetMultipleForAllRequest" + } + } + }, + "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." + } + } + }, + "EventsResetMultipleForAllRequest": { + "id": "EventsResetMultipleForAllRequest", + "type": "object", + "description": "This is a JSON template for multiple events reset all request.", + "properties": { + "event_ids": { + "type": "array", + "description": "The IDs of events to reset.", + "items": { + "type": "string" + } + }, + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string gamesManagement#eventsResetMultipleForAllRequest.", + "default": "gamesManagement#eventsResetMultipleForAllRequest" + } + } + }, + "GamesPlayedResource": { + "id": "GamesPlayedResource", + "type": "object", + "description": "This is a JSON template for metadata about a player playing a game with the currently authenticated user.", + "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" + } + } + }, + "GamesPlayerExperienceInfoResource": { + "id": "GamesPlayerExperienceInfoResource", + "type": "object", + "description": "This is a JSON template for 1P/3P metadata about the player's experience.", + "properties": { + "currentExperiencePoints": { + "type": "string", + "description": "The current number of experience points for the player.", + "format": "int64" + }, + "currentLevel": { + "$ref": "GamesPlayerLevelResource", + "description": "The current level of the player." + }, + "lastLevelUpTimestampMillis": { + "type": "string", + "description": "The timestamp when the player was leveled up, in millis since Unix epoch UTC.", + "format": "int64" + }, + "nextLevel": { + "$ref": "GamesPlayerLevelResource", + "description": "The next level of the player. If the current level is the maximum level, this should be same as the current level." + } + } + }, + "GamesPlayerLevelResource": { + "id": "GamesPlayerLevelResource", + "type": "object", + "description": "This is a JSON template for 1P/3P metadata about a user's level.", + "properties": { + "level": { + "type": "integer", + "description": "The level for the user.", + "format": "int32" + }, + "maxExperiencePoints": { + "type": "string", + "description": "The maximum experience points for this level.", + "format": "int64" + }, + "minExperiencePoints": { + "type": "string", + "description": "The minimum experience points for this level.", + "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." + }, + "experienceInfo": { + "$ref": "GamesPlayerExperienceInfoResource", + "description": "An object to represent Play Game experience information 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. For some players, these fields may not be present.", + "properties": { + "familyName": { + "type": "string", + "description": "The family name of this player. In some places, this is known as the last name." + }, + "givenName": { + "type": "string", + "description": "The given name of this player. In some places, this is known as the first name." + } + } + }, + "playerId": { + "type": "string", + "description": "The ID of the player." + }, + "title": { + "type": "string", + "description": "The player's title rewarded for their game activities." + } + } + }, + "PlayerScoreResetAllResponse": { + "id": "PlayerScoreResetAllResponse", + "type": "object", + "description": "This is a JSON template for a list of leaderboard reset resources.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string gamesManagement#playerScoreResetResponse.", + "default": "gamesManagement#playerScoreResetAllResponse" + }, + "results": { + "type": "array", + "description": "The leaderboard reset results.", + "items": { + "$ref": "PlayerScoreResetResponse" + } + } + } + }, + "PlayerScoreResetResponse": { + "id": "PlayerScoreResetResponse", + "type": "object", + "description": "This is a JSON template for a list of reset leaderboard entry resources.", + "properties": { + "definitionId": { + "type": "string", + "description": "The ID of an leaderboard 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#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" + } + } + } + }, + "QuestsResetMultipleForAllRequest": { + "id": "QuestsResetMultipleForAllRequest", + "type": "object", + "description": "This is a JSON template for multiple quests reset all request.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string gamesManagement#questsResetMultipleForAllRequest.", + "default": "gamesManagement#questsResetMultipleForAllRequest" + }, + "quest_ids": { + "type": "array", + "description": "The IDs of quests to reset.", + "items": { + "type": "string" + } + } + } + }, + "ScoresResetMultipleForAllRequest": { + "id": "ScoresResetMultipleForAllRequest", + "type": "object", + "description": "This is a JSON template for multiple scores reset all request.", + "properties": { + "kind": { + "type": "string", + "description": "Uniquely identifies the type of this resource. Value is always the fixed string gamesManagement#scoresResetMultipleForAllRequest.", + "default": "gamesManagement#scoresResetMultipleForAllRequest" + }, + "leaderboard_ids": { + "type": "array", + "description": "The IDs of leaderboards to reset.", + "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" + ] + }, + "resetAllForAllPlayers": { + "id": "gamesManagement.achievements.resetAllForAllPlayers", + "path": "achievements/resetAllForAllPlayers", + "httpMethod": "POST", + "description": "Resets all draft achievements for all players. This method is only available to user accounts for your developer console.", + "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 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" + ] + }, + "resetMultipleForAllPlayers": { + "id": "gamesManagement.achievements.resetMultipleForAllPlayers", + "path": "achievements/resetMultipleForAllPlayers", + "httpMethod": "POST", + "description": "Resets achievements with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft achievements may be reset.", + "request": { + "$ref": "AchievementResetMultipleForAllRequest" + }, + "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 ID from the Google Play developer console.", + "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": "50", + "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" + ] + } + } + }, + "events": { + "methods": { + "reset": { + "id": "gamesManagement.events.reset", + "path": "events/{eventId}/reset", + "httpMethod": "POST", + "description": "Resets all player progress on the event with the given ID for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application. All quests for this player that use the event will also be reset.", + "parameters": { + "eventId": { + "type": "string", + "description": "The ID of the event.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "eventId" + ], + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "resetAll": { + "id": "gamesManagement.events.resetAll", + "path": "events/reset", + "httpMethod": "POST", + "description": "Resets all player progress on all events for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application. All quests for this player will also be reset.", + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "resetAllForAllPlayers": { + "id": "gamesManagement.events.resetAllForAllPlayers", + "path": "events/resetAllForAllPlayers", + "httpMethod": "POST", + "description": "Resets all draft events for all players. This method is only available to user accounts for your developer console. All quests that use any of these events will also be reset.", + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "resetForAllPlayers": { + "id": "gamesManagement.events.resetForAllPlayers", + "path": "events/{eventId}/resetForAllPlayers", + "httpMethod": "POST", + "description": "Resets the event with the given ID for all players. This method is only available to user accounts for your developer console. Only draft events can be reset. All quests that use the event will also be reset.", + "parameters": { + "eventId": { + "type": "string", + "description": "The ID of the event.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "eventId" + ], + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "resetMultipleForAllPlayers": { + "id": "gamesManagement.events.resetMultipleForAllPlayers", + "path": "events/resetMultipleForAllPlayers", + "httpMethod": "POST", + "description": "Resets events with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft events may be reset. All quests that use any of the events will also be reset.", + "request": { + "$ref": "EventsResetMultipleForAllRequest" + }, + "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 ID from the Google Play developer console.", + "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 ID from the Google Play developer console.", + "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" + ] + } + } + }, + "quests": { + "methods": { + "reset": { + "id": "gamesManagement.quests.reset", + "path": "quests/{questId}/reset", + "httpMethod": "POST", + "description": "Resets all player progress on the quest with the given ID for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application.", + "parameters": { + "questId": { + "type": "string", + "description": "The ID of the quest.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "questId" + ], + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "resetAll": { + "id": "gamesManagement.quests.resetAll", + "path": "quests/reset", + "httpMethod": "POST", + "description": "Resets all player progress on all quests for the currently authenticated player. 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" + ] + }, + "resetAllForAllPlayers": { + "id": "gamesManagement.quests.resetAllForAllPlayers", + "path": "quests/resetAllForAllPlayers", + "httpMethod": "POST", + "description": "Resets all draft quests for all players. This method is only available to user accounts for your developer console.", + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "resetForAllPlayers": { + "id": "gamesManagement.quests.resetForAllPlayers", + "path": "quests/{questId}/resetForAllPlayers", + "httpMethod": "POST", + "description": "Resets all player progress on the quest with the given ID for all players. This method is only available to user accounts for your developer console. Only draft quests can be reset.", + "parameters": { + "questId": { + "type": "string", + "description": "The ID of the quest.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "questId" + ], + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "resetMultipleForAllPlayers": { + "id": "gamesManagement.quests.resetMultipleForAllPlayers", + "path": "quests/resetMultipleForAllPlayers", + "httpMethod": "POST", + "description": "Resets quests with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft quests may be reset.", + "request": { + "$ref": "QuestsResetMultipleForAllRequest" + }, + "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" + ] + }, + "resetForAllPlayers": { + "id": "gamesManagement.rooms.resetForAllPlayers", + "path": "rooms/resetForAllPlayers", + "httpMethod": "POST", + "description": "Deletes rooms where the only room participants are from whitelisted tester accounts for your application. This method is only available to user accounts for your developer console.", + "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": "Resets scores for the leaderboard with the given ID 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" + ] + }, + "resetAll": { + "id": "gamesManagement.scores.resetAll", + "path": "scores/reset", + "httpMethod": "POST", + "description": "Resets all scores for all leaderboards for the currently authenticated players. This method is only accessible to whitelisted tester accounts for your application.", + "response": { + "$ref": "PlayerScoreResetAllResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + }, + "resetAllForAllPlayers": { + "id": "gamesManagement.scores.resetAllForAllPlayers", + "path": "scores/resetAllForAllPlayers", + "httpMethod": "POST", + "description": "Resets scores for all draft leaderboards for all players. This method is only available to user accounts for your developer console.", + "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": "Resets scores for the leaderboard with the given ID 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" + ] + }, + "resetMultipleForAllPlayers": { + "id": "gamesManagement.scores.resetMultipleForAllPlayers", + "path": "scores/resetMultipleForAllPlayers", + "httpMethod": "POST", + "description": "Resets scores for the leaderboards with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft leaderboards may be reset.", + "request": { + "$ref": "ScoresResetMultipleForAllRequest" + }, + "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" + ] + }, + "resetForAllPlayers": { + "id": "gamesManagement.turnBasedMatches.resetForAllPlayers", + "path": "turnbasedmatches/resetForAllPlayers", + "httpMethod": "POST", + "description": "Deletes turn-based matches where the only match participants are from whitelisted tester accounts for your application. This method is only available to user accounts for your developer console.", + "scopes": [ + "https://www.googleapis.com/auth/games", + "https://www.googleapis.com/auth/plus.login" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/gamesmanagement/v1management/gamesmanagement-gen.go b/Godeps/_workspace/src/google.golang.org/api/gamesmanagement/v1management/gamesmanagement-gen.go new file mode 100644 index 000000000..e5f85fdf6 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/gamesmanagement/v1management/gamesmanagement-gen.go @@ -0,0 +1,3044 @@ +// Package gamesmanagement provides access to the Google Play Game Services Management API. +// +// See https://developers.google.com/games/services +// +// Usage example: +// +// import "google.golang.org/api/gamesmanagement/v1management" +// ... +// gamesmanagementService, err := gamesmanagement.New(oauthHttpClient) +package gamesmanagement // import "google.golang.org/api/gamesmanagement/v1management" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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.Events = NewEventsService(s) + s.Players = NewPlayersService(s) + s.Quests = NewQuestsService(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 + UserAgent string // optional additional User-Agent fragment + + Achievements *AchievementsService + + Applications *ApplicationsService + + Events *EventsService + + Players *PlayersService + + Quests *QuestsService + + Rooms *RoomsService + + Scores *ScoresService + + TurnBasedMatches *TurnBasedMatchesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 NewEventsService(s *Service) *EventsService { + rs := &EventsService{s: s} + return rs +} + +type EventsService struct { + s *Service +} + +func NewPlayersService(s *Service) *PlayersService { + rs := &PlayersService{s: s} + return rs +} + +type PlayersService struct { + s *Service +} + +func NewQuestsService(s *Service) *QuestsService { + rs := &QuestsService{s: s} + return rs +} + +type QuestsService 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 +} + +// AchievementResetAllResponse: This is a JSON template for achievement +// reset all response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AchievementResetAllResponse) MarshalJSON() ([]byte, error) { + type noMethod AchievementResetAllResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AchievementResetMultipleForAllRequest: This is a JSON template for +// multiple achievements reset all request. +type AchievementResetMultipleForAllRequest struct { + // AchievementIds: The IDs of achievements to reset. + AchievementIds []string `json:"achievement_ids,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string + // gamesManagement#achievementResetMultipleForAllRequest. + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AchievementIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AchievementResetMultipleForAllRequest) MarshalJSON() ([]byte, error) { + type noMethod AchievementResetMultipleForAllRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AchievementResetResponse: This is a JSON template for an achievement +// reset response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CurrentState") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AchievementResetResponse) MarshalJSON() ([]byte, error) { + type noMethod AchievementResetResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventsResetMultipleForAllRequest: This is a JSON template for +// multiple events reset all request. +type EventsResetMultipleForAllRequest struct { + // EventIds: The IDs of events to reset. + EventIds []string `json:"event_ids,omitempty"` + + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string gamesManagement#eventsResetMultipleForAllRequest. + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "EventIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventsResetMultipleForAllRequest) MarshalJSON() ([]byte, error) { + type noMethod EventsResetMultipleForAllRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GamesPlayedResource: This is a JSON template for metadata about a +// player playing a game with the currently authenticated user. +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"` + + // ForceSendFields is a list of field names (e.g. "AutoMatched") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GamesPlayedResource) MarshalJSON() ([]byte, error) { + type noMethod GamesPlayedResource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GamesPlayerExperienceInfoResource: This is a JSON template for 1P/3P +// metadata about the player's experience. +type GamesPlayerExperienceInfoResource struct { + // CurrentExperiencePoints: The current number of experience points for + // the player. + CurrentExperiencePoints int64 `json:"currentExperiencePoints,omitempty,string"` + + // CurrentLevel: The current level of the player. + CurrentLevel *GamesPlayerLevelResource `json:"currentLevel,omitempty"` + + // LastLevelUpTimestampMillis: The timestamp when the player was leveled + // up, in millis since Unix epoch UTC. + LastLevelUpTimestampMillis int64 `json:"lastLevelUpTimestampMillis,omitempty,string"` + + // NextLevel: The next level of the player. If the current level is the + // maximum level, this should be same as the current level. + NextLevel *GamesPlayerLevelResource `json:"nextLevel,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "CurrentExperiencePoints") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GamesPlayerExperienceInfoResource) MarshalJSON() ([]byte, error) { + type noMethod GamesPlayerExperienceInfoResource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GamesPlayerLevelResource: This is a JSON template for 1P/3P metadata +// about a user's level. +type GamesPlayerLevelResource struct { + // Level: The level for the user. + Level int64 `json:"level,omitempty"` + + // MaxExperiencePoints: The maximum experience points for this level. + MaxExperiencePoints int64 `json:"maxExperiencePoints,omitempty,string"` + + // MinExperiencePoints: The minimum experience points for this level. + MinExperiencePoints int64 `json:"minExperiencePoints,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Level") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GamesPlayerLevelResource) MarshalJSON() ([]byte, error) { + type noMethod GamesPlayerLevelResource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// HiddenPlayer: This is a JSON template for the HiddenPlayer resource. +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"` + + // ForceSendFields is a list of field names (e.g. "HiddenTimeMillis") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HiddenPlayer) MarshalJSON() ([]byte, error) { + type noMethod HiddenPlayer + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// HiddenPlayerList: This is a JSON template for a list of hidden +// players. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HiddenPlayerList) MarshalJSON() ([]byte, error) { + type noMethod HiddenPlayerList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Player: This is a JSON template for a Player resource. +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"` + + // ExperienceInfo: An object to represent Play Game experience + // information for the player. + ExperienceInfo *GamesPlayerExperienceInfoResource `json:"experienceInfo,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. For some players, these fields may not be present. + Name *PlayerName `json:"name,omitempty"` + + // PlayerId: The ID of the player. + PlayerId string `json:"playerId,omitempty"` + + // Title: The player's title rewarded for their game activities. + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AvatarImageUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Player) MarshalJSON() ([]byte, error) { + type noMethod Player + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlayerName: An object representation of the individual components of +// the player's name. For some players, these fields may not be present. +type PlayerName struct { + // FamilyName: The family name of this player. In some places, this is + // known as the last name. + FamilyName string `json:"familyName,omitempty"` + + // GivenName: The given name of this player. In some places, this is + // known as the first name. + GivenName string `json:"givenName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FamilyName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlayerName) MarshalJSON() ([]byte, error) { + type noMethod PlayerName + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlayerScoreResetAllResponse: This is a JSON template for a list of +// leaderboard reset resources. +type PlayerScoreResetAllResponse struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string gamesManagement#playerScoreResetResponse. + Kind string `json:"kind,omitempty"` + + // Results: The leaderboard reset results. + Results []*PlayerScoreResetResponse `json:"results,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlayerScoreResetAllResponse) MarshalJSON() ([]byte, error) { + type noMethod PlayerScoreResetAllResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlayerScoreResetResponse: This is a JSON template for a list of reset +// leaderboard entry resources. +type PlayerScoreResetResponse struct { + // DefinitionId: The ID of an leaderboard 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#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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DefinitionId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlayerScoreResetResponse) MarshalJSON() ([]byte, error) { + type noMethod PlayerScoreResetResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// QuestsResetMultipleForAllRequest: This is a JSON template for +// multiple quests reset all request. +type QuestsResetMultipleForAllRequest struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string gamesManagement#questsResetMultipleForAllRequest. + Kind string `json:"kind,omitempty"` + + // QuestIds: The IDs of quests to reset. + QuestIds []string `json:"quest_ids,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *QuestsResetMultipleForAllRequest) MarshalJSON() ([]byte, error) { + type noMethod QuestsResetMultipleForAllRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ScoresResetMultipleForAllRequest: This is a JSON template for +// multiple scores reset all request. +type ScoresResetMultipleForAllRequest struct { + // Kind: Uniquely identifies the type of this resource. Value is always + // the fixed string gamesManagement#scoresResetMultipleForAllRequest. + Kind string `json:"kind,omitempty"` + + // LeaderboardIds: The IDs of leaderboards to reset. + LeaderboardIds []string `json:"leaderboard_ids,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ScoresResetMultipleForAllRequest) MarshalJSON() ([]byte, error) { + type noMethod ScoresResetMultipleForAllRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "gamesManagement.achievements.reset": + +type AchievementsResetCall struct { + s *Service + achievementId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AchievementsResetCall) Fields(s ...googleapi.Field) *AchievementsResetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AchievementsResetCall) Context(ctx context.Context) *AchievementsResetCall { + c.ctx_ = ctx + return c +} + +func (c *AchievementsResetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/reset") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "achievementId": c.achievementId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.achievements.reset" call. +// Exactly one of *AchievementResetResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *AchievementResetResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AchievementsResetCall) Do() (*AchievementResetResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AchievementResetResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AchievementsResetAllCall) Fields(s ...googleapi.Field) *AchievementsResetAllCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AchievementsResetAllCall) Context(ctx context.Context) *AchievementsResetAllCall { + c.ctx_ = ctx + return c +} + +func (c *AchievementsResetAllCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/reset") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.achievements.resetAll" call. +// Exactly one of *AchievementResetAllResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *AchievementResetAllResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AchievementsResetAllCall) Do() (*AchievementResetAllResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AchievementResetAllResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.resetAllForAllPlayers": + +type AchievementsResetAllForAllPlayersCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// ResetAllForAllPlayers: Resets all draft achievements for all players. +// This method is only available to user accounts for your developer +// console. +func (r *AchievementsService) ResetAllForAllPlayers() *AchievementsResetAllForAllPlayersCall { + c := &AchievementsResetAllForAllPlayersCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AchievementsResetAllForAllPlayersCall) Fields(s ...googleapi.Field) *AchievementsResetAllForAllPlayersCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AchievementsResetAllForAllPlayersCall) Context(ctx context.Context) *AchievementsResetAllForAllPlayersCall { + c.ctx_ = ctx + return c +} + +func (c *AchievementsResetAllForAllPlayersCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/resetAllForAllPlayers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.achievements.resetAllForAllPlayers" call. +func (c *AchievementsResetAllForAllPlayersCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Resets all draft achievements for all players. This method is only available to user accounts for your developer console.", + // "httpMethod": "POST", + // "id": "gamesManagement.achievements.resetAllForAllPlayers", + // "path": "achievements/resetAllForAllPlayers", + // "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{} + ctx_ context.Context +} + +// ResetForAllPlayers: Resets the achievement with the given ID for 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AchievementsResetForAllPlayersCall) Fields(s ...googleapi.Field) *AchievementsResetForAllPlayersCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AchievementsResetForAllPlayersCall) Context(ctx context.Context) *AchievementsResetForAllPlayersCall { + c.ctx_ = ctx + return c +} + +func (c *AchievementsResetForAllPlayersCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/resetForAllPlayers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "achievementId": c.achievementId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.achievements.resetForAllPlayers" call. +func (c *AchievementsResetForAllPlayersCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Resets the achievement with the given ID for 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.achievements.resetMultipleForAllPlayers": + +type AchievementsResetMultipleForAllPlayersCall struct { + s *Service + achievementresetmultipleforallrequest *AchievementResetMultipleForAllRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// ResetMultipleForAllPlayers: Resets achievements with the given IDs +// for all players. This method is only available to user accounts for +// your developer console. Only draft achievements may be reset. +func (r *AchievementsService) ResetMultipleForAllPlayers(achievementresetmultipleforallrequest *AchievementResetMultipleForAllRequest) *AchievementsResetMultipleForAllPlayersCall { + c := &AchievementsResetMultipleForAllPlayersCall{s: r.s, opt_: make(map[string]interface{})} + c.achievementresetmultipleforallrequest = achievementresetmultipleforallrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AchievementsResetMultipleForAllPlayersCall) Fields(s ...googleapi.Field) *AchievementsResetMultipleForAllPlayersCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AchievementsResetMultipleForAllPlayersCall) Context(ctx context.Context) *AchievementsResetMultipleForAllPlayersCall { + c.ctx_ = ctx + return c +} + +func (c *AchievementsResetMultipleForAllPlayersCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.achievementresetmultipleforallrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/resetMultipleForAllPlayers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.achievements.resetMultipleForAllPlayers" call. +func (c *AchievementsResetMultipleForAllPlayersCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Resets achievements with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft achievements may be reset.", + // "httpMethod": "POST", + // "id": "gamesManagement.achievements.resetMultipleForAllPlayers", + // "path": "achievements/resetMultipleForAllPlayers", + // "request": { + // "$ref": "AchievementResetMultipleForAllRequest" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ApplicationsListHiddenCall) Fields(s ...googleapi.Field) *ApplicationsListHiddenCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ApplicationsListHiddenCall) IfNoneMatch(entityTag string) *ApplicationsListHiddenCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ApplicationsListHiddenCall) Context(ctx context.Context) *ApplicationsListHiddenCall { + c.ctx_ = ctx + return c +} + +func (c *ApplicationsListHiddenCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}/players/hidden") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "applicationId": c.applicationId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.applications.listHidden" call. +// Exactly one of *HiddenPlayerList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *HiddenPlayerList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ApplicationsListHiddenCall) Do() (*HiddenPlayerList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &HiddenPlayerList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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 ID from the Google Play developer console.", + // "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": "50", + // "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.events.reset": + +type EventsResetCall struct { + s *Service + eventId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Reset: Resets all player progress on the event with the given ID for +// the currently authenticated player. This method is only accessible to +// whitelisted tester accounts for your application. All quests for this +// player that use the event will also be reset. +func (r *EventsService) Reset(eventId string) *EventsResetCall { + c := &EventsResetCall{s: r.s, opt_: make(map[string]interface{})} + c.eventId = eventId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventsResetCall) Fields(s ...googleapi.Field) *EventsResetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventsResetCall) Context(ctx context.Context) *EventsResetCall { + c.ctx_ = ctx + return c +} + +func (c *EventsResetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "events/{eventId}/reset") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "eventId": c.eventId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.events.reset" call. +func (c *EventsResetCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Resets all player progress on the event with the given ID for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application. All quests for this player that use the event will also be reset.", + // "httpMethod": "POST", + // "id": "gamesManagement.events.reset", + // "parameterOrder": [ + // "eventId" + // ], + // "parameters": { + // "eventId": { + // "description": "The ID of the event.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "events/{eventId}/reset", + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "gamesManagement.events.resetAll": + +type EventsResetAllCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// ResetAll: Resets all player progress on all events for the currently +// authenticated player. This method is only accessible to whitelisted +// tester accounts for your application. All quests for this player will +// also be reset. +func (r *EventsService) ResetAll() *EventsResetAllCall { + c := &EventsResetAllCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventsResetAllCall) Fields(s ...googleapi.Field) *EventsResetAllCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventsResetAllCall) Context(ctx context.Context) *EventsResetAllCall { + c.ctx_ = ctx + return c +} + +func (c *EventsResetAllCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "events/reset") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.events.resetAll" call. +func (c *EventsResetAllCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Resets all player progress on all events for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application. All quests for this player will also be reset.", + // "httpMethod": "POST", + // "id": "gamesManagement.events.resetAll", + // "path": "events/reset", + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "gamesManagement.events.resetAllForAllPlayers": + +type EventsResetAllForAllPlayersCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// ResetAllForAllPlayers: Resets all draft events for all players. This +// method is only available to user accounts for your developer console. +// All quests that use any of these events will also be reset. +func (r *EventsService) ResetAllForAllPlayers() *EventsResetAllForAllPlayersCall { + c := &EventsResetAllForAllPlayersCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventsResetAllForAllPlayersCall) Fields(s ...googleapi.Field) *EventsResetAllForAllPlayersCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventsResetAllForAllPlayersCall) Context(ctx context.Context) *EventsResetAllForAllPlayersCall { + c.ctx_ = ctx + return c +} + +func (c *EventsResetAllForAllPlayersCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "events/resetAllForAllPlayers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.events.resetAllForAllPlayers" call. +func (c *EventsResetAllForAllPlayersCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Resets all draft events for all players. This method is only available to user accounts for your developer console. All quests that use any of these events will also be reset.", + // "httpMethod": "POST", + // "id": "gamesManagement.events.resetAllForAllPlayers", + // "path": "events/resetAllForAllPlayers", + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "gamesManagement.events.resetForAllPlayers": + +type EventsResetForAllPlayersCall struct { + s *Service + eventId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// ResetForAllPlayers: Resets the event with the given ID for all +// players. This method is only available to user accounts for your +// developer console. Only draft events can be reset. All quests that +// use the event will also be reset. +func (r *EventsService) ResetForAllPlayers(eventId string) *EventsResetForAllPlayersCall { + c := &EventsResetForAllPlayersCall{s: r.s, opt_: make(map[string]interface{})} + c.eventId = eventId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventsResetForAllPlayersCall) Fields(s ...googleapi.Field) *EventsResetForAllPlayersCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventsResetForAllPlayersCall) Context(ctx context.Context) *EventsResetForAllPlayersCall { + c.ctx_ = ctx + return c +} + +func (c *EventsResetForAllPlayersCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "events/{eventId}/resetForAllPlayers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "eventId": c.eventId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.events.resetForAllPlayers" call. +func (c *EventsResetForAllPlayersCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Resets the event with the given ID for all players. This method is only available to user accounts for your developer console. Only draft events can be reset. All quests that use the event will also be reset.", + // "httpMethod": "POST", + // "id": "gamesManagement.events.resetForAllPlayers", + // "parameterOrder": [ + // "eventId" + // ], + // "parameters": { + // "eventId": { + // "description": "The ID of the event.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "events/{eventId}/resetForAllPlayers", + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "gamesManagement.events.resetMultipleForAllPlayers": + +type EventsResetMultipleForAllPlayersCall struct { + s *Service + eventsresetmultipleforallrequest *EventsResetMultipleForAllRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// ResetMultipleForAllPlayers: Resets events with the given IDs for all +// players. This method is only available to user accounts for your +// developer console. Only draft events may be reset. All quests that +// use any of the events will also be reset. +func (r *EventsService) ResetMultipleForAllPlayers(eventsresetmultipleforallrequest *EventsResetMultipleForAllRequest) *EventsResetMultipleForAllPlayersCall { + c := &EventsResetMultipleForAllPlayersCall{s: r.s, opt_: make(map[string]interface{})} + c.eventsresetmultipleforallrequest = eventsresetmultipleforallrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventsResetMultipleForAllPlayersCall) Fields(s ...googleapi.Field) *EventsResetMultipleForAllPlayersCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventsResetMultipleForAllPlayersCall) Context(ctx context.Context) *EventsResetMultipleForAllPlayersCall { + c.ctx_ = ctx + return c +} + +func (c *EventsResetMultipleForAllPlayersCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventsresetmultipleforallrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "events/resetMultipleForAllPlayers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.events.resetMultipleForAllPlayers" call. +func (c *EventsResetMultipleForAllPlayersCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Resets events with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft events may be reset. All quests that use any of the events will also be reset.", + // "httpMethod": "POST", + // "id": "gamesManagement.events.resetMultipleForAllPlayers", + // "path": "events/resetMultipleForAllPlayers", + // "request": { + // "$ref": "EventsResetMultipleForAllRequest" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlayersHideCall) Fields(s ...googleapi.Field) *PlayersHideCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlayersHideCall) Context(ctx context.Context) *PlayersHideCall { + c.ctx_ = ctx + return c +} + +func (c *PlayersHideCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}/players/hidden/{playerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "applicationId": c.applicationId, + "playerId": c.playerId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.players.hide" call. +func (c *PlayersHideCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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 ID from the Google Play developer console.", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PlayersUnhideCall) Fields(s ...googleapi.Field) *PlayersUnhideCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PlayersUnhideCall) Context(ctx context.Context) *PlayersUnhideCall { + c.ctx_ = ctx + return c +} + +func (c *PlayersUnhideCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}/players/hidden/{playerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "applicationId": c.applicationId, + "playerId": c.playerId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.players.unhide" call. +func (c *PlayersUnhideCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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 ID from the Google Play developer console.", + // "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.quests.reset": + +type QuestsResetCall struct { + s *Service + questId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Reset: Resets all player progress on the quest with the given ID for +// the currently authenticated player. This method is only accessible to +// whitelisted tester accounts for your application. +func (r *QuestsService) Reset(questId string) *QuestsResetCall { + c := &QuestsResetCall{s: r.s, opt_: make(map[string]interface{})} + c.questId = questId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *QuestsResetCall) Fields(s ...googleapi.Field) *QuestsResetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *QuestsResetCall) Context(ctx context.Context) *QuestsResetCall { + c.ctx_ = ctx + return c +} + +func (c *QuestsResetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "quests/{questId}/reset") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "questId": c.questId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.quests.reset" call. +func (c *QuestsResetCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Resets all player progress on the quest 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.quests.reset", + // "parameterOrder": [ + // "questId" + // ], + // "parameters": { + // "questId": { + // "description": "The ID of the quest.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "quests/{questId}/reset", + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "gamesManagement.quests.resetAll": + +type QuestsResetAllCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// ResetAll: Resets all player progress on all quests for the currently +// authenticated player. This method is only accessible to whitelisted +// tester accounts for your application. +func (r *QuestsService) ResetAll() *QuestsResetAllCall { + c := &QuestsResetAllCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *QuestsResetAllCall) Fields(s ...googleapi.Field) *QuestsResetAllCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *QuestsResetAllCall) Context(ctx context.Context) *QuestsResetAllCall { + c.ctx_ = ctx + return c +} + +func (c *QuestsResetAllCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "quests/reset") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.quests.resetAll" call. +func (c *QuestsResetAllCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Resets all player progress on all quests for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application.", + // "httpMethod": "POST", + // "id": "gamesManagement.quests.resetAll", + // "path": "quests/reset", + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "gamesManagement.quests.resetAllForAllPlayers": + +type QuestsResetAllForAllPlayersCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// ResetAllForAllPlayers: Resets all draft quests for all players. This +// method is only available to user accounts for your developer console. +func (r *QuestsService) ResetAllForAllPlayers() *QuestsResetAllForAllPlayersCall { + c := &QuestsResetAllForAllPlayersCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *QuestsResetAllForAllPlayersCall) Fields(s ...googleapi.Field) *QuestsResetAllForAllPlayersCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *QuestsResetAllForAllPlayersCall) Context(ctx context.Context) *QuestsResetAllForAllPlayersCall { + c.ctx_ = ctx + return c +} + +func (c *QuestsResetAllForAllPlayersCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "quests/resetAllForAllPlayers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.quests.resetAllForAllPlayers" call. +func (c *QuestsResetAllForAllPlayersCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Resets all draft quests for all players. This method is only available to user accounts for your developer console.", + // "httpMethod": "POST", + // "id": "gamesManagement.quests.resetAllForAllPlayers", + // "path": "quests/resetAllForAllPlayers", + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "gamesManagement.quests.resetForAllPlayers": + +type QuestsResetForAllPlayersCall struct { + s *Service + questId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// ResetForAllPlayers: Resets all player progress on the quest with the +// given ID for all players. This method is only available to user +// accounts for your developer console. Only draft quests can be reset. +func (r *QuestsService) ResetForAllPlayers(questId string) *QuestsResetForAllPlayersCall { + c := &QuestsResetForAllPlayersCall{s: r.s, opt_: make(map[string]interface{})} + c.questId = questId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *QuestsResetForAllPlayersCall) Fields(s ...googleapi.Field) *QuestsResetForAllPlayersCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *QuestsResetForAllPlayersCall) Context(ctx context.Context) *QuestsResetForAllPlayersCall { + c.ctx_ = ctx + return c +} + +func (c *QuestsResetForAllPlayersCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "quests/{questId}/resetForAllPlayers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "questId": c.questId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.quests.resetForAllPlayers" call. +func (c *QuestsResetForAllPlayersCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Resets all player progress on the quest with the given ID for all players. This method is only available to user accounts for your developer console. Only draft quests can be reset.", + // "httpMethod": "POST", + // "id": "gamesManagement.quests.resetForAllPlayers", + // "parameterOrder": [ + // "questId" + // ], + // "parameters": { + // "questId": { + // "description": "The ID of the quest.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "quests/{questId}/resetForAllPlayers", + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "gamesManagement.quests.resetMultipleForAllPlayers": + +type QuestsResetMultipleForAllPlayersCall struct { + s *Service + questsresetmultipleforallrequest *QuestsResetMultipleForAllRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// ResetMultipleForAllPlayers: Resets quests with the given IDs for all +// players. This method is only available to user accounts for your +// developer console. Only draft quests may be reset. +func (r *QuestsService) ResetMultipleForAllPlayers(questsresetmultipleforallrequest *QuestsResetMultipleForAllRequest) *QuestsResetMultipleForAllPlayersCall { + c := &QuestsResetMultipleForAllPlayersCall{s: r.s, opt_: make(map[string]interface{})} + c.questsresetmultipleforallrequest = questsresetmultipleforallrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *QuestsResetMultipleForAllPlayersCall) Fields(s ...googleapi.Field) *QuestsResetMultipleForAllPlayersCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *QuestsResetMultipleForAllPlayersCall) Context(ctx context.Context) *QuestsResetMultipleForAllPlayersCall { + c.ctx_ = ctx + return c +} + +func (c *QuestsResetMultipleForAllPlayersCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.questsresetmultipleforallrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "quests/resetMultipleForAllPlayers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.quests.resetMultipleForAllPlayers" call. +func (c *QuestsResetMultipleForAllPlayersCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Resets quests with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft quests may be reset.", + // "httpMethod": "POST", + // "id": "gamesManagement.quests.resetMultipleForAllPlayers", + // "path": "quests/resetMultipleForAllPlayers", + // "request": { + // "$ref": "QuestsResetMultipleForAllRequest" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RoomsResetCall) Fields(s ...googleapi.Field) *RoomsResetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RoomsResetCall) Context(ctx context.Context) *RoomsResetCall { + c.ctx_ = ctx + return c +} + +func (c *RoomsResetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/reset") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.rooms.reset" call. +func (c *RoomsResetCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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.rooms.resetForAllPlayers": + +type RoomsResetForAllPlayersCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// ResetForAllPlayers: Deletes rooms where the only room participants +// are from whitelisted tester accounts for your application. This +// method is only available to user accounts for your developer console. +func (r *RoomsService) ResetForAllPlayers() *RoomsResetForAllPlayersCall { + c := &RoomsResetForAllPlayersCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RoomsResetForAllPlayersCall) Fields(s ...googleapi.Field) *RoomsResetForAllPlayersCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RoomsResetForAllPlayersCall) Context(ctx context.Context) *RoomsResetForAllPlayersCall { + c.ctx_ = ctx + return c +} + +func (c *RoomsResetForAllPlayersCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/resetForAllPlayers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.rooms.resetForAllPlayers" call. +func (c *RoomsResetForAllPlayersCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes rooms where the only room participants are from whitelisted tester accounts for your application. This method is only available to user accounts for your developer console.", + // "httpMethod": "POST", + // "id": "gamesManagement.rooms.resetForAllPlayers", + // "path": "rooms/resetForAllPlayers", + // "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{} + ctx_ context.Context +} + +// Reset: Resets scores for the leaderboard with the given ID 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ScoresResetCall) Fields(s ...googleapi.Field) *ScoresResetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ScoresResetCall) Context(ctx context.Context) *ScoresResetCall { + c.ctx_ = ctx + return c +} + +func (c *ScoresResetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}/scores/reset") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "leaderboardId": c.leaderboardId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.scores.reset" call. +// Exactly one of *PlayerScoreResetResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *PlayerScoreResetResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ScoresResetCall) Do() (*PlayerScoreResetResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlayerScoreResetResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Resets scores for the leaderboard 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.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.resetAll": + +type ScoresResetAllCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// ResetAll: Resets all scores for all leaderboards for the currently +// authenticated players. This method is only accessible to whitelisted +// tester accounts for your application. +func (r *ScoresService) ResetAll() *ScoresResetAllCall { + c := &ScoresResetAllCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ScoresResetAllCall) Fields(s ...googleapi.Field) *ScoresResetAllCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ScoresResetAllCall) Context(ctx context.Context) *ScoresResetAllCall { + c.ctx_ = ctx + return c +} + +func (c *ScoresResetAllCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "scores/reset") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.scores.resetAll" call. +// Exactly one of *PlayerScoreResetAllResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *PlayerScoreResetAllResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ScoresResetAllCall) Do() (*PlayerScoreResetAllResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PlayerScoreResetAllResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Resets all scores for all leaderboards for the currently authenticated players. This method is only accessible to whitelisted tester accounts for your application.", + // "httpMethod": "POST", + // "id": "gamesManagement.scores.resetAll", + // "path": "scores/reset", + // "response": { + // "$ref": "PlayerScoreResetAllResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} + +// method id "gamesManagement.scores.resetAllForAllPlayers": + +type ScoresResetAllForAllPlayersCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// ResetAllForAllPlayers: Resets scores for all draft leaderboards for +// all players. This method is only available to user accounts for your +// developer console. +func (r *ScoresService) ResetAllForAllPlayers() *ScoresResetAllForAllPlayersCall { + c := &ScoresResetAllForAllPlayersCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ScoresResetAllForAllPlayersCall) Fields(s ...googleapi.Field) *ScoresResetAllForAllPlayersCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ScoresResetAllForAllPlayersCall) Context(ctx context.Context) *ScoresResetAllForAllPlayersCall { + c.ctx_ = ctx + return c +} + +func (c *ScoresResetAllForAllPlayersCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "scores/resetAllForAllPlayers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.scores.resetAllForAllPlayers" call. +func (c *ScoresResetAllForAllPlayersCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Resets scores for all draft leaderboards for all players. This method is only available to user accounts for your developer console.", + // "httpMethod": "POST", + // "id": "gamesManagement.scores.resetAllForAllPlayers", + // "path": "scores/resetAllForAllPlayers", + // "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{} + ctx_ context.Context +} + +// ResetForAllPlayers: Resets scores for the leaderboard with the given +// ID 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ScoresResetForAllPlayersCall) Fields(s ...googleapi.Field) *ScoresResetForAllPlayersCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ScoresResetForAllPlayersCall) Context(ctx context.Context) *ScoresResetForAllPlayersCall { + c.ctx_ = ctx + return c +} + +func (c *ScoresResetForAllPlayersCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}/scores/resetForAllPlayers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "leaderboardId": c.leaderboardId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.scores.resetForAllPlayers" call. +func (c *ScoresResetForAllPlayersCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Resets scores for the leaderboard with the given ID 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.scores.resetMultipleForAllPlayers": + +type ScoresResetMultipleForAllPlayersCall struct { + s *Service + scoresresetmultipleforallrequest *ScoresResetMultipleForAllRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// ResetMultipleForAllPlayers: Resets scores for the leaderboards with +// the given IDs for all players. This method is only available to user +// accounts for your developer console. Only draft leaderboards may be +// reset. +func (r *ScoresService) ResetMultipleForAllPlayers(scoresresetmultipleforallrequest *ScoresResetMultipleForAllRequest) *ScoresResetMultipleForAllPlayersCall { + c := &ScoresResetMultipleForAllPlayersCall{s: r.s, opt_: make(map[string]interface{})} + c.scoresresetmultipleforallrequest = scoresresetmultipleforallrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ScoresResetMultipleForAllPlayersCall) Fields(s ...googleapi.Field) *ScoresResetMultipleForAllPlayersCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ScoresResetMultipleForAllPlayersCall) Context(ctx context.Context) *ScoresResetMultipleForAllPlayersCall { + c.ctx_ = ctx + return c +} + +func (c *ScoresResetMultipleForAllPlayersCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.scoresresetmultipleforallrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "scores/resetMultipleForAllPlayers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.scores.resetMultipleForAllPlayers" call. +func (c *ScoresResetMultipleForAllPlayersCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Resets scores for the leaderboards with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft leaderboards may be reset.", + // "httpMethod": "POST", + // "id": "gamesManagement.scores.resetMultipleForAllPlayers", + // "path": "scores/resetMultipleForAllPlayers", + // "request": { + // "$ref": "ScoresResetMultipleForAllRequest" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TurnBasedMatchesResetCall) Fields(s ...googleapi.Field) *TurnBasedMatchesResetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TurnBasedMatchesResetCall) Context(ctx context.Context) *TurnBasedMatchesResetCall { + c.ctx_ = ctx + return c +} + +func (c *TurnBasedMatchesResetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/reset") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.turnBasedMatches.reset" call. +func (c *TurnBasedMatchesResetCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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" + // ] + // } + +} + +// method id "gamesManagement.turnBasedMatches.resetForAllPlayers": + +type TurnBasedMatchesResetForAllPlayersCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// ResetForAllPlayers: Deletes turn-based matches where the only match +// participants are from whitelisted tester accounts for your +// application. This method is only available to user accounts for your +// developer console. +func (r *TurnBasedMatchesService) ResetForAllPlayers() *TurnBasedMatchesResetForAllPlayersCall { + c := &TurnBasedMatchesResetForAllPlayersCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TurnBasedMatchesResetForAllPlayersCall) Fields(s ...googleapi.Field) *TurnBasedMatchesResetForAllPlayersCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TurnBasedMatchesResetForAllPlayersCall) Context(ctx context.Context) *TurnBasedMatchesResetForAllPlayersCall { + c.ctx_ = ctx + return c +} + +func (c *TurnBasedMatchesResetForAllPlayersCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/resetForAllPlayers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gamesManagement.turnBasedMatches.resetForAllPlayers" call. +func (c *TurnBasedMatchesResetForAllPlayersCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes turn-based matches where the only match participants are from whitelisted tester accounts for your application. This method is only available to user accounts for your developer console.", + // "httpMethod": "POST", + // "id": "gamesManagement.turnBasedMatches.resetForAllPlayers", + // "path": "turnbasedmatches/resetForAllPlayers", + // "scopes": [ + // "https://www.googleapis.com/auth/games", + // "https://www.googleapis.com/auth/plus.login" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/gan/v1beta1/gan-api.json b/Godeps/_workspace/src/google.golang.org/api/gan/v1beta1/gan-api.json new file mode 100644 index 000000000..a66341c80 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/gan/v1beta1/gan-api.json @@ -0,0 +1,1860 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"FrPV2U6xXFUq8eRv_PO3IoAURkc/sUp2RhXMaDQQQ4TJDISV0wjpOdU\"", + "discoveryVersion": "v1", + "id": "gan:v1beta1", + "name": "gan", + "version": "v1beta1", + "revision": "20130205", + "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/Godeps/_workspace/src/google.golang.org/api/gan/v1beta1/gan-gen.go b/Godeps/_workspace/src/google.golang.org/api/gan/v1beta1/gan-gen.go new file mode 100644 index 000000000..2eeb2801c --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/gan/v1beta1/gan-gen.go @@ -0,0 +1,3722 @@ +// Package gan provides access to the Google Affiliate Network API. +// +// See https://developers.google.com/affiliate-network/ +// +// Usage example: +// +// import "google.golang.org/api/gan/v1beta1" +// ... +// ganService, err := gan.New(oauthHttpClient) +package gan // import "google.golang.org/api/gan/v1beta1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Advertisers *AdvertisersService + + CcOffers *CcOffersService + + Events *EventsService + + Links *LinksService + + Publishers *PublishersService + + Reports *ReportsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 +} + +// Advertiser: An AdvertiserResource. +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.py?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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "AllowPublisherCreatedLinks") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Advertiser) MarshalJSON() ([]byte, error) { + type noMethod Advertiser + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Advertisers) MarshalJSON() ([]byte, error) { + type noMethod Advertisers + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CcOffer: 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. +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"` + + // ForceSendFields is a list of field names (e.g. + // "AdditionalCardBenefits") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CcOffer) MarshalJSON() ([]byte, error) { + type noMethod CcOffer + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Amount") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CcOfferBonusRewards) MarshalJSON() ([]byte, error) { + type noMethod CcOfferBonusRewards + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Category") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CcOfferDefaultFees) MarshalJSON() ([]byte, error) { + type noMethod CcOfferDefaultFees + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "AdditionalDetails") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CcOfferRewards) MarshalJSON() ([]byte, error) { + type noMethod CcOfferRewards + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CcOffers) MarshalJSON() ([]byte, error) { + type noMethod CcOffers + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Event: An EventResource. +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"` + + // ForceSendFields is a list of field names (e.g. "AdvertiserId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Event) MarshalJSON() ([]byte, error) { + type noMethod Event + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "CategoryId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventProducts) MarshalJSON() ([]byte, error) { + type noMethod EventProducts + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Events) MarshalJSON() ([]byte, error) { + type noMethod Events + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Link: A LinkResource. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AdvertiserId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Link) MarshalJSON() ([]byte, error) { + type noMethod Link + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LinkSpecialOffers: Special offers on the link. +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"` + + // ForceSendFields is a list of field names (e.g. "FreeGift") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LinkSpecialOffers) MarshalJSON() ([]byte, error) { + type noMethod LinkSpecialOffers + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Links) MarshalJSON() ([]byte, error) { + type noMethod Links + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Money: An ApiMoneyProto. +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"` + + // ForceSendFields is a list of field names (e.g. "Amount") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Money) MarshalJSON() ([]byte, error) { + type noMethod Money + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Publisher: A PublisherResource. +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.py?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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Classification") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Publisher) MarshalJSON() ([]byte, error) { + type noMethod Publisher + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Publishers) MarshalJSON() ([]byte, error) { + type noMethod Publishers + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Report: A ReportResource representing a report of a certain type +// either for an advertiser or publisher. +type Report struct { + // ColumnNames: The column names for the report + ColumnNames []string `json:"column_names,omitempty"` + + // EndDate: The end of the date range for this report, exclusive. + EndDate string `json:"end_date,omitempty"` + + // Kind: The kind for a report. + Kind string `json:"kind,omitempty"` + + // MatchingRowCount: The number of matching rows before paging is + // applied. + MatchingRowCount int64 `json:"matching_row_count,omitempty,string"` + + // Rows: The rows of data for the report + Rows [][]interface{} `json:"rows,omitempty"` + + // StartDate: The start of the date range for this report, inclusive. + StartDate string `json:"start_date,omitempty"` + + // TotalsRows: The totals rows for the report + TotalsRows [][]interface{} `json:"totals_rows,omitempty"` + + // Type: The report type. + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ColumnNames") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Report) MarshalJSON() ([]byte, error) { + type noMethod Report + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "gan.advertisers.get": + +type AdvertisersGetCall struct { + s *Service + role string + roleId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertisersGetCall) Fields(s ...googleapi.Field) *AdvertisersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdvertisersGetCall) IfNoneMatch(entityTag string) *AdvertisersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertisersGetCall) Context(ctx context.Context) *AdvertisersGetCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertisersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["advertiserId"]; ok { + params.Set("advertiserId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/advertiser") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "role": c.role, + "roleId": c.roleId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gan.advertisers.get" call. +// Exactly one of *Advertiser or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Advertiser.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AdvertisersGetCall) Do() (*Advertiser, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Advertiser{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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.py?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. +// +// Possible values: +// "approved" - An advertiser that has approved your application. +// "available" - An advertiser program that's accepting new +// publishers. +// "deactivated" - 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. +// "declined" - An advertiser that did not approve your application. +// "pending" - An advertiser program that you've already applied to, +// but they haven't yet decided to approve or decline your application. +func (c *AdvertisersListCall) RelationshipStatus(relationshipStatus string) *AdvertisersListCall { + c.opt_["relationshipStatus"] = relationshipStatus + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AdvertisersListCall) Fields(s ...googleapi.Field) *AdvertisersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AdvertisersListCall) IfNoneMatch(entityTag string) *AdvertisersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AdvertisersListCall) Context(ctx context.Context) *AdvertisersListCall { + c.ctx_ = ctx + return c +} + +func (c *AdvertisersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/advertisers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "role": c.role, + "roleId": c.roleId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gan.advertisers.list" call. +// Exactly one of *Advertisers or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Advertisers.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AdvertisersListCall) Do() (*Advertisers, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Advertisers{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "full" - Include all offer fields. This is the default. +// "summary" - Include only the basic fields needed to display an +// offer. +func (c *CcOffersListCall) Projection(projection string) *CcOffersListCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CcOffersListCall) Fields(s ...googleapi.Field) *CcOffersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CcOffersListCall) IfNoneMatch(entityTag string) *CcOffersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CcOffersListCall) Context(ctx context.Context) *CcOffersListCall { + c.ctx_ = ctx + return c +} + +func (c *CcOffersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "publishers/{publisher}/ccOffers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "publisher": c.publisher, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gan.ccOffers.list" call. +// Exactly one of *CcOffers or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *CcOffers.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CcOffersListCall) Do() (*CcOffers, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CcOffers{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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'. +// +// Possible values: +// "credit" - A credit increases the publisher's payout amount and +// decreases the advertiser's invoice amount. +// "debit" - A debit reduces the publisher's payout and increases the +// advertiser's invoice amount. +// "monthly_minimum" - A payment made to Google by an advertiser as a +// minimum monthly network fee. +// "other" - Catch all. Default if unset +// "slotting_fee" - A one time payment made from an advertiser to a +// publisher. +// "tier_bonus" - A payment from an advertiser to a publisher for the +// publisher maintaining a high tier level +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'. +// +// Possible values: +// "active" - Event is currently active. +// "canceled" - Event is currently 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'. +// +// Possible values: +// "action" - 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. +// "charge" - A charge event is typically a payment between an +// advertiser, publisher or Google. +// "transaction" - A conversion event, typically an e-commerce +// transaction. Some advertisers use a transaction to record other types +// of events, such as magazine subscriptions. +func (c *EventsListCall) Type(type_ string) *EventsListCall { + c.opt_["type"] = type_ + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *EventsListCall) Fields(s ...googleapi.Field) *EventsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *EventsListCall) IfNoneMatch(entityTag string) *EventsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *EventsListCall) Context(ctx context.Context) *EventsListCall { + c.ctx_ = ctx + return c +} + +func (c *EventsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/events") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "role": c.role, + "roleId": c.roleId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gan.events.list" call. +// Exactly one of *Events or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Events.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *EventsListCall) Do() (*Events, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Events{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LinksGetCall) Fields(s ...googleapi.Field) *LinksGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LinksGetCall) IfNoneMatch(entityTag string) *LinksGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LinksGetCall) Context(ctx context.Context) *LinksGetCall { + c.ctx_ = ctx + return c +} + +func (c *LinksGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/link/{linkId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "role": c.role, + "roleId": c.roleId, + "linkId": strconv.FormatInt(c.linkId, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gan.links.get" call. +// Exactly one of *Link or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Link.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *LinksGetCall) Do() (*Link, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Link{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LinksInsertCall) Fields(s ...googleapi.Field) *LinksInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LinksInsertCall) Context(ctx context.Context) *LinksInsertCall { + c.ctx_ = ctx + return c +} + +func (c *LinksInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/link") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "role": c.role, + "roleId": c.roleId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gan.links.insert" call. +// Exactly one of *Link or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Link.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *LinksInsertCall) Do() (*Link, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Link{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "advertiser" +// "publisher" +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. +// +// Possible values: +// "banner" +// "text" +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. +// +// Possible values: +// "coupon" +// "free_gift" +// "free_shipping" +// "percent_off" +// "price_cut" +func (c *LinksListCall) PromotionType(promotionType string) *LinksListCall { + c.opt_["promotionType"] = promotionType + return c +} + +// RelationshipStatus sets the optional parameter "relationshipStatus": +// The status of the relationship. +// +// Possible values: +// "approved" +// "available" +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LinksListCall) Fields(s ...googleapi.Field) *LinksListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LinksListCall) IfNoneMatch(entityTag string) *LinksListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LinksListCall) Context(ctx context.Context) *LinksListCall { + c.ctx_ = ctx + return c +} + +func (c *LinksListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/links") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "role": c.role, + "roleId": c.roleId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gan.links.list" call. +// Exactly one of *Links or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Links.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *LinksListCall) Do() (*Links, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Links{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PublishersGetCall) Fields(s ...googleapi.Field) *PublishersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PublishersGetCall) IfNoneMatch(entityTag string) *PublishersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PublishersGetCall) Context(ctx context.Context) *PublishersGetCall { + c.ctx_ = ctx + return c +} + +func (c *PublishersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["publisherId"]; ok { + params.Set("publisherId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/publisher") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "role": c.role, + "roleId": c.roleId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gan.publishers.get" call. +// Exactly one of *Publisher or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Publisher.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PublishersGetCall) Do() (*Publisher, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Publisher{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "approved" - Publishers you've approved to your program. +// "available" - Publishers available for you to recruit. +// "deactivated" - A publisher that you terminated from your program. +// Publishers also have the ability to remove themselves from your +// program. +// "declined" - A publisher that you did not approve to your program. +// "pending" - Publishers that have applied to your program. We +// recommend reviewing and deciding on pending publishers on a weekly +// basis. +func (c *PublishersListCall) RelationshipStatus(relationshipStatus string) *PublishersListCall { + c.opt_["relationshipStatus"] = relationshipStatus + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PublishersListCall) Fields(s ...googleapi.Field) *PublishersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PublishersListCall) IfNoneMatch(entityTag string) *PublishersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PublishersListCall) Context(ctx context.Context) *PublishersListCall { + c.ctx_ = ctx + return c +} + +func (c *PublishersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/publishers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "role": c.role, + "roleId": c.roleId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gan.publishers.list" call. +// Exactly one of *Publishers or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Publishers.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PublishersListCall) Do() (*Publishers, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Publishers{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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'. +// +// Possible values: +// "action" - Event type is action. +// "charge" - Event type is charge. +// "transaction" - Event type is transaction. +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'. +// +// Possible values: +// "active" - Event is currently active. +// "canceled" - Event is currently canceled. +// "invalid" - Event is currently invalid. +func (c *ReportsGetCall) Status(status string) *ReportsGetCall { + c.opt_["status"] = status + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReportsGetCall) Fields(s ...googleapi.Field) *ReportsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReportsGetCall) IfNoneMatch(entityTag string) *ReportsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReportsGetCall) Context(ctx context.Context) *ReportsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ReportsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{role}/{roleId}/report/{reportType}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "role": c.role, + "roleId": c.roleId, + "reportType": c.reportType, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gan.reports.get" call. +// Exactly one of *Report or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Report.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReportsGetCall) Do() (*Report, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Report{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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/Godeps/_workspace/src/google.golang.org/api/genomics/v1/genomics-api.json b/Godeps/_workspace/src/google.golang.org/api/genomics/v1/genomics-api.json new file mode 100644 index 000000000..1a0482d3e --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/genomics/v1/genomics-api.json @@ -0,0 +1,2781 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/bK7COdWEll7PQZwJL9pvnKDHpyY\"", + "discoveryVersion": "v1", + "id": "genomics:v1", + "name": "genomics", + "version": "v1", + "revision": "20150917", + "title": "Genomics API", + "description": "An API to store, process, explore, and share DNA sequence reads, reference-based alignments, and variant calls.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "", + "protocol": "rest", + "baseUrl": "https://genomics.googleapis.com/", + "basePath": "/", + "rootUrl": "https://genomics.googleapis.com/", + "servicePath": "", + "batchPath": "batch", + "parameters": { + "access_token": { + "type": "string", + "description": "OAuth access token.", + "location": "query" + }, + "alt": { + "type": "string", + "description": "Data format for response.", + "default": "json", + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query" + }, + "bearer_token": { + "type": "string", + "description": "OAuth bearer token.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JSONP", + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "pp": { + "type": "boolean", + "description": "Pretty-print response.", + "default": "true", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query" + }, + "upload_protocol": { + "type": "string", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query" + }, + "uploadType": { + "type": "string", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query" + }, + "$.xgafv": { + "type": "string", + "description": "V1 error format.", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/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.read_write": { + "description": "Manage your data in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/genomics": { + "description": "View and manage Genomics data" + }, + "https://www.googleapis.com/auth/genomics.readonly": { + "description": "View Genomics data" + } + } + } + }, + "schemas": { + "ListDatasetsResponse": { + "id": "ListDatasetsResponse", + "type": "object", + "description": "The dataset list response.", + "properties": { + "datasets": { + "type": "array", + "description": "The list of matching Datasets.", + "items": { + "$ref": "Dataset" + } + }, + "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. This field will be empty if there aren't any additional results." + } + } + }, + "Dataset": { + "id": "Dataset", + "type": "object", + "description": "A Dataset is a collection of genomic data.", + "properties": { + "id": { + "type": "string", + "description": "The server-generated dataset ID, unique across all datasets." + }, + "projectId": { + "type": "string", + "description": "The Google Developers Console project ID that this dataset belongs to." + }, + "name": { + "type": "string", + "description": "The dataset name." + }, + "createTime": { + "type": "string", + "description": "The time this dataset was created, in seconds from the epoch." + } + } + }, + "Empty": { + "id": "Empty", + "type": "object", + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`." + }, + "UndeleteDatasetRequest": { + "id": "UndeleteDatasetRequest", + "type": "object" + }, + "SetIamPolicyRequest": { + "id": "SetIamPolicyRequest", + "type": "object", + "description": "Request message for `SetIamPolicy` method.", + "properties": { + "policy": { + "$ref": "Policy", + "description": "REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them." + } + } + }, + "Policy": { + "id": "Policy", + "type": "object", + "description": "Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources. A `Policy` consists of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, where the members can be user accounts, Google groups, Google domains, and service accounts. A `role` is a named list of permissions defined by IAM. **Example** { \"bindings\": [ { \"role\": \"roles/owner\", \"members\": [ \"user:mike@example.com\", \"group:admins@example.com\", \"domain:google.com\", \"serviceAccount:my-other-app@appspot.gserviceaccount.com\"] }, { \"role\": \"roles/viewer\", \"members\": [\"user:sean@example.com\"] } ] } For a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam).", + "properties": { + "version": { + "type": "integer", + "description": "Version of the `Policy`. The default version is 0.", + "format": "int32" + }, + "bindings": { + "type": "array", + "description": "Associates a list of `members` to a `role`. Multiple `bindings` must not be specified for the same `role`. `bindings` with no members will result in an error.", + "items": { + "$ref": "Binding" + } + }, + "etag": { + "type": "string", + "description": "Can be used to perform a read-modify-write.", + "format": "byte" + } + } + }, + "Binding": { + "id": "Binding", + "type": "object", + "description": "Associates `members` with a `role`.", + "properties": { + "role": { + "type": "string", + "description": "Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. Required" + }, + "members": { + "type": "array", + "description": "Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following formats: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` or `joe@example.com`. * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`.", + "items": { + "type": "string" + } + } + } + }, + "GetIamPolicyRequest": { + "id": "GetIamPolicyRequest", + "type": "object", + "description": "Request message for `GetIamPolicy` method." + }, + "TestIamPermissionsRequest": { + "id": "TestIamPermissionsRequest", + "type": "object", + "description": "Request message for `TestIamPermissions` method.", + "properties": { + "permissions": { + "type": "array", + "description": "REQUIRED: The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. Allowed permissions are: * `genomics.datasets.create` * `genomics.datasets.delete` * `genomics.datasets.get` * `genomics.datasets.list` * `genomics.datasets.update` * `genomics.datasets.getIamPolicy` * `genomics.datasets.setIamPolicy`", + "items": { + "type": "string" + } + } + } + }, + "TestIamPermissionsResponse": { + "id": "TestIamPermissionsResponse", + "type": "object", + "description": "Response message for `TestIamPermissions` method.", + "properties": { + "permissions": { + "type": "array", + "description": "A subset of `TestPermissionsRequest.permissions` that the caller is allowed.", + "items": { + "type": "string" + } + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "description": "This resource represents a long-running operation that is the result of a network API call.", + "properties": { + "name": { + "type": "string", + "description": "The server-assigned name, which is only unique within the same service that originally returns it. For example: `operations/CJHU7Oi_ChDrveSpBRjfuL-qzoWAgEw`" + }, + "metadata": { + "type": "object", + "description": "An OperationMetadata object. This will always be returned with the Operation.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @ype with type URL." + } + }, + "done": { + "type": "boolean", + "description": "If the value is `false`, it means the operation is still in progress. If true, the operation is completed, and either `error` or `response` is available." + }, + "error": { + "$ref": "Status", + "description": "The error result of the operation in case of failure." + }, + "response": { + "type": "object", + "description": "If importing ReadGroupSets, an ImportReadGroupSetsResponse is returned. If importing Variants, an ImportVariantsResponse is returned. For exports, an empty response is returned.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @ype with type URL." + } + } + } + }, + "Status": { + "id": "Status", + "type": "object", + "description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). The error model is designed to be: - Simple to use and understand for most users - Flexible enough to meet unexpected needs # Overview The `Status` message contains three pieces of data: error code, error message, and error details. The error code should be an enum value of google.rpc.Code, but it may accept additional error codes if needed. The error message should be a developer-facing English message that helps developers *understand* and *resolve* the error. If a localized user-facing error message is needed, put the localized message in the error details or localize it in the client. The optional error details may contain arbitrary information about the error. There is a predefined set of error detail types in the package `google.rpc` which can be used for common error conditions. # Language mapping The `Status` message is the logical representation of the error model, but it is not necessarily the actual wire format. When the `Status` message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C. # Other uses The error model and the `Status` message can be used in a variety of environments, either with or without APIs, to provide a consistent developer experience across different environments. Example uses of this error model include: - Partial errors. If a service needs to return partial errors to the client, it may embed the `Status` in the normal response to indicate the partial errors. - Workflow errors. A typical workflow has multiple steps. Each step may have a `Status` message for error reporting purpose. - Batch operations. If a client uses batch request and batch response, the `Status` message should be used directly inside batch response, one for each error sub-response. - Asynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the `Status` message. - Logging. If some API errors are stored in logs, the message `Status` could be used directly after any stripping needed for security/privacy reasons.", + "properties": { + "code": { + "type": "integer", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "format": "int32" + }, + "message": { + "type": "string", + "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client." + }, + "details": { + "type": "array", + "description": "A list of messages that carry the error details. There will be a common set of message types for APIs to use.", + "items": { + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @ype with type URL." + } + } + } + } + }, + "ListOperationsResponse": { + "id": "ListOperationsResponse", + "type": "object", + "description": "The response message for Operations.ListOperations.", + "properties": { + "operations": { + "type": "array", + "description": "A list of operations that matches the specified filter in the request.", + "items": { + "$ref": "Operation" + } + }, + "nextPageToken": { + "type": "string", + "description": "The standard List next-page token." + } + } + }, + "CancelOperationRequest": { + "id": "CancelOperationRequest", + "type": "object", + "description": "The request message for Operations.CancelOperation." + }, + "ImportReadGroupSetsRequest": { + "id": "ImportReadGroupSetsRequest", + "type": "object", + "description": "The read group set import request.", + "properties": { + "datasetId": { + "type": "string", + "description": "Required. The ID of the dataset these read group sets will belong to. The caller must have WRITE permissions to this dataset." + }, + "referenceSetId": { + "type": "string", + "description": "The reference set to which the imported read group sets are aligned to, if any. The reference names of this reference set must be a superset of those found in the imported file headers. If no reference set id is provided, a best effort is made to associate with a matching reference set." + }, + "sourceUris": { + "type": "array", + "description": "A list of URIs pointing at [BAM files](https://samtools.github.io/hts-specs/SAMv1.pdf) in Google Cloud Storage.", + "items": { + "type": "string" + } + }, + "partitionStrategy": { + "type": "string", + "description": "The partition strategy describes how read groups are partitioned into read group sets.", + "enum": [ + "PARTITION_STRATEGY_UNSPECIFIED", + "PER_FILE_PER_SAMPLE", + "MERGE_ALL" + ] + } + } + }, + "ExportReadGroupSetRequest": { + "id": "ExportReadGroupSetRequest", + "type": "object", + "description": "The read group set export request.", + "properties": { + "projectId": { + "type": "string", + "description": "Required. The Google Developers Console project ID that owns this export." + }, + "exportUri": { + "type": "string", + "description": "Required. A Google Cloud Storage URI for the exported BAM file. The currently authenticated user must have write access to the new file. An error will be returned if the URI already contains data." + }, + "referenceNames": { + "type": "array", + "description": "The reference names to export. If this is not specified, all reference sequences, including unmapped reads, are exported. Use `*` to export only unmapped reads.", + "items": { + "type": "string" + } + } + } + }, + "SearchReadGroupSetsRequest": { + "id": "SearchReadGroupSetsRequest", + "type": "object", + "description": "The read group set search request.", + "properties": { + "datasetIds": { + "type": "array", + "description": "Restricts this query to read group sets within the given datasets. At least one ID must be provided.", + "items": { + "type": "string" + } + }, + "name": { + "type": "string", + "description": "Only return read group sets for which a substring of the name matches this string." + }, + "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." + }, + "pageSize": { + "type": "integer", + "description": "Specifies number of results to return in a single page. If unspecified, it will default to 256. The maximum value is 1024.", + "format": "int32" + } + } + }, + "SearchReadGroupSetsResponse": { + "id": "SearchReadGroupSetsResponse", + "type": "object", + "description": "The read group set search response.", + "properties": { + "readGroupSets": { + "type": "array", + "description": "The list of matching read group sets.", + "items": { + "$ref": "ReadGroupSet" + } + }, + "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. This field will be empty if there aren't any additional results." + } + } + }, + "ReadGroupSet": { + "id": "ReadGroupSet", + "type": "object", + "description": "A read group set is a logical collection of read groups, which are collections of reads produced by a sequencer. A read group set typically models reads corresponding to one sample, sequenced one way, and aligned one way. * A read group set belongs to one dataset. * A read group belongs to one read group set. * A read belongs to one read group.", + "properties": { + "id": { + "type": "string", + "description": "The server-generated read group set ID, unique for all read group sets." + }, + "datasetId": { + "type": "string", + "description": "The dataset ID." + }, + "referenceSetId": { + "type": "string", + "description": "The reference set the reads in this read group set are aligned to." + }, + "name": { + "type": "string", + "description": "The read group set name. By default this will be initialized to the sample name of the sequenced data contained in this set." + }, + "filename": { + "type": "string", + "description": "The filename of the original source file for this read group set, if any." + }, + "readGroups": { + "type": "array", + "description": "The read groups in this set. There are typically 1-10 read groups in a read group set.", + "items": { + "$ref": "ReadGroup" + } + }, + "info": { + "type": "object", + "description": "A map of additional read group set information.", + "additionalProperties": { + "type": "array", + "items": { + "type": "any" + } + } + } + } + }, + "ReadGroup": { + "id": "ReadGroup", + "type": "object", + "description": "A read group is all the data that's processed the same way by the sequencer.", + "properties": { + "id": { + "type": "string", + "description": "The server-generated read group ID, unique for all read groups. Note: This is different than the `@RG ID` field in the SAM spec. For that value, see the `name` field." + }, + "datasetId": { + "type": "string", + "description": "The ID of the dataset this read group belongs to." + }, + "name": { + "type": "string", + "description": "The read group name. This corresponds to the @RG ID field in the SAM spec." + }, + "description": { + "type": "string", + "description": "A free-form text description of this read group." + }, + "sampleId": { + "type": "string", + "description": "The sample this read group's data was generated from. Note: This is not an actual ID within this repository, but rather an identifier for a sample which may be meaningful to some external system." + }, + "experiment": { + "$ref": "Experiment", + "description": "The experiment used to generate this read group." + }, + "predictedInsertSize": { + "type": "integer", + "description": "The predicted insert size of this read group. The insert size is the length the sequenced DNA fragment from end-to-end, not including the adapters.", + "format": "int32" + }, + "programs": { + "type": "array", + "description": "The programs used to generate this read group. Programs are always identical for all read groups within a read group set. For this reason, only the first read group in a returned set will have this field populated.", + "items": { + "$ref": "Program" + } + }, + "referenceSetId": { + "type": "string", + "description": "The reference set the reads in this read group are aligned to. Required if there are any read alignments." + }, + "info": { + "type": "object", + "description": "A map of additional read group information. This must be of the form map (string key mapping to a list of string values).", + "additionalProperties": { + "type": "array", + "items": { + "type": "any" + } + } + } + } + }, + "Experiment": { + "id": "Experiment", + "type": "object", + "properties": { + "libraryId": { + "type": "string", + "description": "The library used as part of this experiment. Note: This is not an actual ID within this repository, but rather an identifier for a library which may be meaningful to some external system." + }, + "platformUnit": { + "type": "string", + "description": "The platform unit used as part of this experiment e.g. flowcell-barcode.lane for Illumina or slide for SOLiD. Corresponds to the @RG PU field in the SAM spec." + }, + "sequencingCenter": { + "type": "string", + "description": "The sequencing center used as part of this experiment." + }, + "instrumentModel": { + "type": "string", + "description": "The instrument model used as part of this experiment. This maps to sequencing technology in BAM." + } + } + }, + "Program": { + "id": "Program", + "type": "object", + "properties": { + "commandLine": { + "type": "string", + "description": "The command line used to run this program." + }, + "id": { + "type": "string", + "description": "The user specified locally unique ID of the program. Used along with `prevProgramId` to define an ordering between programs." + }, + "name": { + "type": "string", + "description": "The name of the program." + }, + "prevProgramId": { + "type": "string", + "description": "The ID of the program run before this one." + }, + "version": { + "type": "string", + "description": "The version of the program run." + } + } + }, + "ListCoverageBucketsResponse": { + "id": "ListCoverageBucketsResponse", + "type": "object", + "properties": { + "bucketWidth": { + "type": "string", + "description": "The length of each coverage bucket in base pairs. Note that buckets at the end of a reference sequence may be shorter. This value is omitted if the bucket width is infinity (the default behaviour, with no range or `targetBucketWidth`).", + "format": "int64" + }, + "coverageBuckets": { + "type": "array", + "description": "The coverage buckets. The list of buckets is sparse; a bucket with 0 overlapping reads is not returned. A bucket never crosses more than one reference sequence. Each bucket has width `bucketWidth`, unless its end is the end of the reference sequence.", + "items": { + "$ref": "CoverageBucket" + } + }, + "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. This field will be empty if there aren't any additional results." + } + } + }, + "CoverageBucket": { + "id": "CoverageBucket", + "type": "object", + "description": "A bucket over which read coverage has been precomputed. A bucket corresponds to a specific range of the reference sequence.", + "properties": { + "range": { + "$ref": "Range", + "description": "The genomic coordinate range spanned by this bucket." + }, + "meanCoverage": { + "type": "number", + "description": "The average number of reads which are aligned to each individual reference base in this bucket.", + "format": "float" + } + } + }, + "Range": { + "id": "Range", + "type": "object", + "description": "A 0-based half-open genomic coordinate range for search requests.", + "properties": { + "referenceName": { + "type": "string", + "description": "The reference sequence name, for example `chr1`, `1`, or `chrX`." + }, + "start": { + "type": "string", + "description": "The start position of the range on the reference, 0-based inclusive.", + "format": "int64" + }, + "end": { + "type": "string", + "description": "The end position of the range on the reference, 0-based exclusive.", + "format": "int64" + } + } + }, + "SearchReadsRequest": { + "id": "SearchReadsRequest", + "type": "object", + "description": "The read search request.", + "properties": { + "readGroupSetIds": { + "type": "array", + "description": "The IDs of the read groups sets within which to search for reads. All specified read group sets must be aligned against a common set of reference sequences; this defines the genomic coordinates for the query. Must specify one of `readGroupSetIds` or `readGroupIds`.", + "items": { + "type": "string" + } + }, + "readGroupIds": { + "type": "array", + "description": "The IDs of the read groups within which to search for reads. All specified read groups must belong to the same read group sets. Must specify one of `readGroupSetIds` or `readGroupIds`.", + "items": { + "type": "string" + } + }, + "referenceName": { + "type": "string", + "description": "The reference sequence name, for example `chr1`, `1`, or `chrX`. If set to *, only unmapped reads are returned." + }, + "start": { + "type": "string", + "description": "The start position of the range on the reference, 0-based inclusive. If specified, `referenceName` must also be specified.", + "format": "int64" + }, + "end": { + "type": "string", + "description": "The end position of the range on the reference, 0-based exclusive. If specified, `referenceName` must also be specified.", + "format": "int64" + }, + "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." + }, + "pageSize": { + "type": "integer", + "description": "Specifies number of results to return in a single page. If unspecified, it will default to 256. The maximum value is 2048.", + "format": "int32" + } + } + }, + "SearchReadsResponse": { + "id": "SearchReadsResponse", + "type": "object", + "description": "The read search response.", + "properties": { + "alignments": { + "type": "array", + "description": "The list of matching alignments sorted by mapped genomic coordinate, if any, ascending in position within the same reference. Unmapped reads, which have no position, are returned contiguously and are sorted in ascending lexicographic order by fragment name.", + "items": { + "$ref": "Read" + } + }, + "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. This field will be empty if there aren't any additional results." + } + } + }, + "Read": { + "id": "Read", + "type": "object", + "description": "A read alignment describes a linear alignment of a string of DNA to a reference sequence, in addition to metadata about the fragment (the molecule of DNA sequenced) and the read (the bases which were read by the sequencer). A read is equivalent to a line in a SAM file. A read belongs to exactly one read group and exactly one read group set. ### Generating a reference-aligned sequence string When interacting with mapped reads, it's often useful to produce a string representing the local alignment of the read to reference. The following pseudocode demonstrates one way of doing this: out = \"\" offset = 0 for c in read.alignment.cigar { switch c.operation { case \"ALIGNMENT_MATCH\", \"SEQUENCE_MATCH\", \"SEQUENCE_MISMATCH\": out += read.alignedSequence[offset:offset+c.operationLength] offset += c.operationLength break case \"CLIP_SOFT\", \"INSERT\": offset += c.operationLength break case \"PAD\": out += repeat(\"*\", c.operationLength) break case \"DELETE\": out += repeat(\"-\", c.operationLength) break case \"SKIP\": out += repeat(\" \", c.operationLength) break case \"CLIP_HARD\": break } } return out ### Converting to SAM's CIGAR string The following pseudocode generates a SAM CIGAR string from the `cigar` field. Note that this is a lossy conversion (`cigar.referenceSequence` is lost). cigarMap = { \"ALIGNMENT_MATCH\": \"M\", \"INSERT\": \"I\", \"DELETE\": \"D\", \"SKIP\": \"N\", \"CLIP_SOFT\": \"S\", \"CLIP_HARD\": \"H\", \"PAD\": \"P\", \"SEQUENCE_MATCH\": \"=\", \"SEQUENCE_MISMATCH\": \"X\", } cigarStr = \"\" for c in read.alignment.cigar { cigarStr += c.operationLength + cigarMap[c.operation] } return cigarStr", + "properties": { + "id": { + "type": "string", + "description": "The server-generated read ID, unique across all reads. This is different from the `fragmentName`." + }, + "readGroupId": { + "type": "string", + "description": "The ID of the read group this read belongs to. (Every read must belong to exactly one read group.)" + }, + "readGroupSetId": { + "type": "string", + "description": "The ID of the read group set this read belongs to. (Every read must belong to exactly one read group set.)" + }, + "fragmentName": { + "type": "string", + "description": "The fragment name. Equivalent to QNAME (query template name) in SAM." + }, + "properPlacement": { + "type": "boolean", + "description": "The orientation and the distance between reads from the fragment are consistent with the sequencing protocol (SAM flag 0x2)" + }, + "duplicateFragment": { + "type": "boolean", + "description": "The fragment is a PCR or optical duplicate (SAM flag 0x400)" + }, + "fragmentLength": { + "type": "integer", + "description": "The observed length of the fragment, equivalent to TLEN in SAM.", + "format": "int32" + }, + "readNumber": { + "type": "integer", + "description": "The read number in sequencing. 0-based and less than numberReads. This field replaces SAM flag 0x40 and 0x80.", + "format": "int32" + }, + "numberReads": { + "type": "integer", + "description": "The number of reads in the fragment (extension to SAM flag 0x1).", + "format": "int32" + }, + "failedVendorQualityChecks": { + "type": "boolean", + "description": "SAM flag 0x200" + }, + "alignment": { + "$ref": "LinearAlignment", + "description": "The linear alignment for this alignment record. This field will be null if the read is unmapped." + }, + "secondaryAlignment": { + "type": "boolean", + "description": "Whether this alignment is secondary. Equivalent to SAM flag 0x100. A secondary alignment represents an alternative to the primary alignment for this read. Aligners may return secondary alignments if a read can map ambiguously to multiple coordinates in the genome. By convention, each read has one and only one alignment where both `secondaryAlignment` and `supplementaryAlignment` are false." + }, + "supplementaryAlignment": { + "type": "boolean", + "description": "Whether this alignment is supplementary. Equivalent to SAM flag 0x800. Supplementary alignments are used in the representation of a chimeric alignment. In a chimeric alignment, a read is split into multiple linear alignments that map to different reference contigs. The first linear alignment in the read will be designated as the representative alignment; the remaining linear alignments will be designated as supplementary alignments. These alignments may have different mapping quality scores. In each linear alignment in a chimeric alignment, the read will be hard clipped. The `alignedSequence` and `alignedQuality` fields in the alignment record will only represent the bases for its respective linear alignment." + }, + "alignedSequence": { + "type": "string", + "description": "The bases of the read sequence contained in this alignment record, *without CIGAR operations applied*. `alignedSequence` and `alignedQuality` may be shorter than the full read sequence and quality. This will occur if the alignment is part of a chimeric alignment, or if the read was trimmed. When this occurs, the CIGAR for this read will begin/end with a hard clip operator that will indicate the length of the excised sequence." + }, + "alignedQuality": { + "type": "array", + "description": "The quality of the read sequence contained in this alignment record. `alignedSequence` and `alignedQuality` may be shorter than the full read sequence and quality. This will occur if the alignment is part of a chimeric alignment, or if the read was trimmed. When this occurs, the CIGAR for this read will begin/end with a hard clip operator that will indicate the length of the excised sequence.", + "items": { + "type": "integer", + "format": "int32" + } + }, + "nextMatePosition": { + "$ref": "Position", + "description": "The mapping of the primary alignment of the `(readNumber+1)%numberReads` read in the fragment. It replaces mate position and mate strand in SAM." + }, + "info": { + "type": "object", + "description": "A map of additional read alignment information. This must be of the form map (string key mapping to a list of string values).", + "additionalProperties": { + "type": "array", + "items": { + "type": "any" + } + } + } + } + }, + "LinearAlignment": { + "id": "LinearAlignment", + "type": "object", + "description": "A linear alignment can be represented by one CIGAR string. Describes the mapped position and local alignment of the read to the reference.", + "properties": { + "position": { + "$ref": "Position", + "description": "The position of this alignment." + }, + "mappingQuality": { + "type": "integer", + "description": "The mapping quality of this alignment. Represents how likely the read maps to this position as opposed to other locations.", + "format": "int32" + }, + "cigar": { + "type": "array", + "description": "Represents the local alignment of this sequence (alignment matches, indels, etc) against the reference.", + "items": { + "$ref": "CigarUnit" + } + } + } + }, + "Position": { + "id": "Position", + "type": "object", + "description": "An abstraction for referring to a genomic position, in relation to some already known reference. For now, represents a genomic position as a reference name, a base number on that reference (0-based), and a determination of forward or reverse strand.", + "properties": { + "referenceName": { + "type": "string", + "description": "The name of the reference in whatever reference set is being used." + }, + "position": { + "type": "string", + "description": "The 0-based offset from the start of the forward strand for that reference.", + "format": "int64" + }, + "reverseStrand": { + "type": "boolean", + "description": "Whether this position is on the reverse strand, as opposed to the forward strand." + } + } + }, + "CigarUnit": { + "id": "CigarUnit", + "type": "object", + "description": "A single CIGAR operation.", + "properties": { + "operation": { + "type": "string", + "enum": [ + "OPERATION_UNSPECIFIED", + "ALIGNMENT_MATCH", + "INSERT", + "DELETE", + "SKIP", + "CLIP_SOFT", + "CLIP_HARD", + "PAD", + "SEQUENCE_MATCH", + "SEQUENCE_MISMATCH" + ] + }, + "operationLength": { + "type": "string", + "description": "The number of genomic bases that the operation runs for. Required.", + "format": "int64" + }, + "referenceSequence": { + "type": "string", + "description": "`referenceSequence` is only used at mismatches (`SEQUENCE_MISMATCH`) and deletions (`DELETE`). Filling this field replaces SAM's MD tag. If the relevant information is not available, this field is unset." + } + } + }, + "SearchReferenceSetsRequest": { + "id": "SearchReferenceSetsRequest", + "type": "object", + "properties": { + "md5checksums": { + "type": "array", + "description": "If present, return references for which the `md5checksum` matches. See `ReferenceSet.md5checksum` for details.", + "items": { + "type": "string" + } + }, + "accessions": { + "type": "array", + "description": "If present, return references for which the accession matches any of these strings. Best to give a version number, for example `GCF_000001405.26`. If only the main accession number is given then all records with that main accession will be returned, whichever version. Note that different versions will have different sequences.", + "items": { + "type": "string" + } + }, + "assemblyId": { + "type": "string", + "description": "If present, return reference sets for which a substring of their `assemblyId` matches this string (case insensitive)." + }, + "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." + }, + "pageSize": { + "type": "integer", + "description": "Specifies the maximum number of results to return in a single page.", + "format": "int32" + } + } + }, + "SearchReferenceSetsResponse": { + "id": "SearchReferenceSetsResponse", + "type": "object", + "properties": { + "referenceSets": { + "type": "array", + "description": "The matching references sets.", + "items": { + "$ref": "ReferenceSet" + } + }, + "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. This field will be empty if there aren't any additional results." + } + } + }, + "ReferenceSet": { + "id": "ReferenceSet", + "type": "object", + "description": "A reference set is a set of references which typically comprise a reference assembly for a species, such as `GRCh38` which is representative of the human genome. A reference set defines a common coordinate space for comparing reference-aligned experimental data. A reference set contains 1 or more references.", + "properties": { + "id": { + "type": "string", + "description": "The server-generated reference set ID, unique across all reference sets." + }, + "referenceIds": { + "type": "array", + "description": "The IDs of the reference objects that are part of this set. `Reference.md5checksum` must be unique within this set.", + "items": { + "type": "string" + } + }, + "md5checksum": { + "type": "string", + "description": "Order-independent MD5 checksum which identifies this reference set. The checksum is computed by sorting all lower case hexidecimal string `reference.md5checksum` (for all reference in this set) in ascending lexicographic order, concatenating, and taking the MD5 of that value. The resulting value is represented in lower case hexadecimal format." + }, + "ncbiTaxonId": { + "type": "integer", + "description": "ID from http://www.ncbi.nlm.nih.gov/taxonomy (e.g. 9606-\u003ehuman) indicating the species which this assembly is intended to model. Note that contained references may specify a different `ncbiTaxonId`, as assemblies may contain reference sequences which do not belong to the modeled species, e.g. EBV in a human reference genome.", + "format": "int32" + }, + "description": { + "type": "string", + "description": "Free text description of this reference set." + }, + "assemblyId": { + "type": "string", + "description": "Public id of this reference set, such as `GRCh37`." + }, + "sourceUri": { + "type": "string", + "description": "The URI from which the references were obtained." + }, + "sourceAccessions": { + "type": "array", + "description": "All known corresponding accession IDs in INSDC (GenBank/ENA/DDBJ) ideally with a version number, for example `NC_000001.11`.", + "items": { + "type": "string" + } + } + } + }, + "SearchReferencesRequest": { + "id": "SearchReferencesRequest", + "type": "object", + "properties": { + "md5checksums": { + "type": "array", + "description": "If present, return references for which the `md5checksum` matches. See `Reference.md5checksum` for construction details.", + "items": { + "type": "string" + } + }, + "accessions": { + "type": "array", + "description": "If present, return references for which the accession matches this string. Best to give a version number, for example `GCF_000001405.26`. If only the main accession number is given then all records with that main accession will be returned, whichever version. Note that different versions will have different sequences.", + "items": { + "type": "string" + } + }, + "referenceSetId": { + "type": "string", + "description": "If present, return only references which belong to this reference set." + }, + "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." + }, + "pageSize": { + "type": "integer", + "description": "Specifies the maximum number of results to return in a single page.", + "format": "int32" + } + } + }, + "SearchReferencesResponse": { + "id": "SearchReferencesResponse", + "type": "object", + "properties": { + "references": { + "type": "array", + "description": "The matching references.", + "items": { + "$ref": "Reference" + } + }, + "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. This field will be empty if there aren't any additional results." + } + } + }, + "Reference": { + "id": "Reference", + "type": "object", + "description": "A reference is a canonical assembled DNA sequence, intended to act as a reference coordinate space for other genomic annotations. A single reference might represent the human chromosome 1 or mitochandrial DNA, for instance. A reference belongs to one or more reference sets.", + "properties": { + "id": { + "type": "string", + "description": "The server-generated reference ID, unique across all references." + }, + "length": { + "type": "string", + "description": "The length of this reference's sequence.", + "format": "int64" + }, + "md5checksum": { + "type": "string", + "description": "MD5 of the upper-case sequence excluding all whitespace characters (this is equivalent to SQ:M5 in SAM). This value is represented in lower case hexadecimal format." + }, + "name": { + "type": "string", + "description": "The name of this reference, for example `22`." + }, + "sourceUri": { + "type": "string", + "description": "The URI from which the sequence was obtained. Specifies a FASTA format file/string with one name, sequence pair." + }, + "sourceAccessions": { + "type": "array", + "description": "All known corresponding accession IDs in INSDC (GenBank/ENA/DDBJ) ideally with a version number, for example `GCF_000001405.26`.", + "items": { + "type": "string" + } + }, + "ncbiTaxonId": { + "type": "integer", + "description": "ID from http://www.ncbi.nlm.nih.gov/taxonomy (e.g. 9606-\u003ehuman) if not specified by the containing reference set.", + "format": "int32" + } + } + }, + "ListBasesResponse": { + "id": "ListBasesResponse", + "type": "object", + "properties": { + "offset": { + "type": "string", + "description": "The offset position (0-based) of the given `sequence` from the start of this `Reference`. This value will differ for each page in a paginated request.", + "format": "int64" + }, + "sequence": { + "type": "string", + "description": "A substring of the bases that make up this reference." + }, + "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. This field will be empty if there aren't any additional results." + } + } + }, + "ImportVariantsRequest": { + "id": "ImportVariantsRequest", + "type": "object", + "description": "The variant data import request.", + "properties": { + "variantSetId": { + "type": "string", + "description": "Required. The variant set to which variant data should be imported." + }, + "sourceUris": { + "type": "array", + "description": "A list of URIs referencing variant files in Google Cloud Storage. URIs can include wildcards [as described here](https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames). Note that recursive wildcards ('**') are not supported.", + "items": { + "type": "string" + } + }, + "format": { + "type": "string", + "description": "The format of the variant data being imported. If unspecified, defaults to to `VCF`.", + "enum": [ + "FORMAT_UNSPECIFIED", + "FORMAT_VCF", + "FORMAT_COMPLETE_GENOMICS" + ] + }, + "normalizeReferenceNames": { + "type": "boolean", + "description": "Convert reference names to the canonical representation. hg19 haploytypes (those reference names containing \"_hap\") are not modified in any way. All other reference names are modified according to the following rules: The reference name is capitalized. The \"chr\" prefix is dropped for all autosomes and sex chromsomes. For example \"chr17\" becomes \"17\" and \"chrX\" becomes \"X\". All mitochondrial chromosomes (\"chrM\", \"chrMT\", etc) become \"MT\"." + } + } + }, + "VariantSet": { + "id": "VariantSet", + "type": "object", + "description": "A variant set is a collection of call sets and variants. It contains summary statistics of those contents. A variant set belongs to a dataset.", + "properties": { + "datasetId": { + "type": "string", + "description": "The dataset to which this variant set belongs." + }, + "id": { + "type": "string", + "description": "The server-generated variant set ID, unique across all variant sets." + }, + "referenceBounds": { + "type": "array", + "description": "A list of all references used by the variants in a variant set with associated coordinate upper bounds for each one.", + "items": { + "$ref": "ReferenceBound" + } + }, + "metadata": { + "type": "array", + "description": "The metadata associated with this variant set.", + "items": { + "$ref": "VariantSetMetadata" + } + } + } + }, + "ReferenceBound": { + "id": "ReferenceBound", + "type": "object", + "description": "ReferenceBound records an upper bound for the starting coordinate of variants in a particular reference.", + "properties": { + "referenceName": { + "type": "string", + "description": "The reference the bound is associate with." + }, + "upperBound": { + "type": "string", + "description": "An upper bound (inclusive) on the starting coordinate of any variant in the reference sequence.", + "format": "int64" + } + } + }, + "VariantSetMetadata": { + "id": "VariantSetMetadata", + "type": "object", + "description": "Metadata describes a single piece of variant call metadata. These data include a top level key and either a single value string (value) or a list of key-value pairs (info.) Value and info are mutually exclusive.", + "properties": { + "key": { + "type": "string", + "description": "The top-level key." + }, + "value": { + "type": "string", + "description": "The value field for simple metadata" + }, + "id": { + "type": "string", + "description": "User-provided ID field, not enforced by this API. Two or more pieces of structured metadata with identical id and key fields are considered equivalent." + }, + "type": { + "type": "string", + "description": "The type of data. Possible types include: Integer, Float, Flag, Character, and String.", + "enum": [ + "TYPE_UNSPECIFIED", + "INTEGER", + "FLOAT", + "FLAG", + "CHARACTER", + "STRING" + ] + }, + "number": { + "type": "string", + "description": "The number of values that can be included in a field described by this metadata." + }, + "description": { + "type": "string", + "description": "A textual description of this metadata." + }, + "info": { + "type": "object", + "description": "Remaining structured metadata key-value pairs. This must be of the form map (string key mapping to a list of string values).", + "additionalProperties": { + "type": "array", + "items": { + "type": "any" + } + } + } + } + }, + "ExportVariantSetRequest": { + "id": "ExportVariantSetRequest", + "type": "object", + "description": "The variant data export request.", + "properties": { + "callSetIds": { + "type": "array", + "description": "If provided, only variant call information from the specified call sets will be exported. By default all variant calls are exported.", + "items": { + "type": "string" + } + }, + "projectId": { + "type": "string", + "description": "Required. The Google Cloud project ID that owns the destination BigQuery dataset. The caller must have WRITE access to this project. This project will also own the resulting export job." + }, + "format": { + "type": "string", + "description": "The format for the exported data.", + "enum": [ + "FORMAT_UNSPECIFIED", + "FORMAT_BIGQUERY" + ] + }, + "bigqueryDataset": { + "type": "string", + "description": "Required. The BigQuery dataset to export data to. This dataset must already exist. Note that this is distinct from the Genomics concept of \"dataset\"." + }, + "bigqueryTable": { + "type": "string", + "description": "Required. The BigQuery table to export data to. If the table doesn't exist, it will be created. If it already exists, it will be overwritten." + } + } + }, + "SearchVariantSetsRequest": { + "id": "SearchVariantSetsRequest", + "type": "object", + "description": "The search variant sets request.", + "properties": { + "datasetIds": { + "type": "array", + "description": "Exactly one dataset ID must be provided here. Only variant sets which belong to this dataset will be returned.", + "items": { + "type": "string" + } + }, + "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." + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of variant sets to return in a request.", + "format": "int32" + } + } + }, + "SearchVariantSetsResponse": { + "id": "SearchVariantSetsResponse", + "type": "object", + "description": "The search variant sets response.", + "properties": { + "variantSets": { + "type": "array", + "description": "The variant sets belonging to the requested dataset.", + "items": { + "$ref": "VariantSet" + } + }, + "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. This field will be empty if there aren't any additional results." + } + } + }, + "SearchVariantsRequest": { + "id": "SearchVariantsRequest", + "type": "object", + "description": "The variant search request.", + "properties": { + "variantSetIds": { + "type": "array", + "description": "At most one variant set ID must be provided. Only variants from this variant set will be returned. If omitted, a call set id must be included in the request.", + "items": { + "type": "string" + } + }, + "variantName": { + "type": "string", + "description": "Only return variants which have exactly this name." + }, + "callSetIds": { + "type": "array", + "description": "Only return variant calls which belong to call sets with these ids. Leaving this blank returns all variant calls. If a variant has no calls belonging to any of these call sets, it won't be returned at all. Currently, variants with no calls from any call set will never be returned.", + "items": { + "type": "string" + } + }, + "referenceName": { + "type": "string", + "description": "Required. Only return variants in this reference sequence." + }, + "start": { + "type": "string", + "description": "The beginning of the window (0-based, inclusive) for which overlapping variants should be returned. If unspecified, defaults to 0.", + "format": "int64" + }, + "end": { + "type": "string", + "description": "The end of the window, 0-based exclusive. If unspecified or 0, defaults to the length of the reference.", + "format": "int64" + }, + "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." + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of variants to return. If unspecified, defaults to 5000.", + "format": "int32" + }, + "maxCalls": { + "type": "integer", + "description": "The maximum number of calls to return. However, at least one variant will always be returned, even if it has more calls than this limit. If unspecified, defaults to 5000.", + "format": "int32" + } + } + }, + "SearchVariantsResponse": { + "id": "SearchVariantsResponse", + "type": "object", + "description": "The variant search response.", + "properties": { + "variants": { + "type": "array", + "description": "The list of matching Variants.", + "items": { + "$ref": "Variant" + } + }, + "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. This field will be empty if there aren't any additional results." + } + } + }, + "Variant": { + "id": "Variant", + "type": "object", + "description": "A variant represents a change in DNA sequence relative to a reference sequence. For example, a variant could represent a SNP or an insertion. Variants belong to a variant set. Each of the calls on a variant represent a determination of genotype with respect to that variant. For example, a call might assign probability of 0.32 to the occurrence of a SNP named rs1234 in a sample named NA12345. A call belongs to a call set, which contains related calls typically from one sample.", + "properties": { + "variantSetId": { + "type": "string", + "description": "The ID of the variant set this variant belongs to." + }, + "id": { + "type": "string", + "description": "The server-generated variant ID, unique across all variants." + }, + "names": { + "type": "array", + "description": "Names for the variant, for example a RefSNP ID.", + "items": { + "type": "string" + } + }, + "created": { + "type": "string", + "description": "The date this variant was created, in milliseconds from the epoch.", + "format": "int64" + }, + "referenceName": { + "type": "string", + "description": "The reference on which this variant occurs. (such as `chr20` or `X`)" + }, + "start": { + "type": "string", + "description": "The position at which this variant occurs (0-based). This corresponds to the first base of the string of reference bases.", + "format": "int64" + }, + "end": { + "type": "string", + "description": "The end position (0-based) of this variant. This corresponds to the first base after the last base in the reference allele. So, the length of the reference allele is (end - start). This is useful for variants that don't explicitly give alternate bases, for example large deletions.", + "format": "int64" + }, + "referenceBases": { + "type": "string", + "description": "The reference bases for this variant. They start at the given position." + }, + "alternateBases": { + "type": "array", + "description": "The bases that appear instead of the reference bases.", + "items": { + "type": "string" + } + }, + "quality": { + "type": "number", + "description": "A measure of how likely this variant is to be real. A higher value is better.", + "format": "double" + }, + "filter": { + "type": "array", + "description": "A list of filters (normally quality filters) this variant has failed. `PASS` indicates this variant has passed all filters.", + "items": { + "type": "string" + } + }, + "info": { + "type": "object", + "description": "A map of additional variant information. This must be of the form map (string key mapping to a list of string values).", + "additionalProperties": { + "type": "array", + "items": { + "type": "any" + } + } + }, + "calls": { + "type": "array", + "description": "The variant calls for this particular variant. Each one represents the determination of genotype with respect to this variant.", + "items": { + "$ref": "VariantCall" + } + } + } + }, + "VariantCall": { + "id": "VariantCall", + "type": "object", + "description": "A call represents the determination of genotype with respect to a particular variant. It may include associated information such as quality and phasing. For example, a call might assign a probability of 0.32 to the occurrence of a SNP named rs1234 in a call set with the name NA12345.", + "properties": { + "callSetId": { + "type": "string", + "description": "The ID of the call set this variant call belongs to." + }, + "callSetName": { + "type": "string", + "description": "The name of the call set this variant call belongs to." + }, + "genotype": { + "type": "array", + "description": "The genotype of this variant call. Each value represents either the value of the `referenceBases` field or a 1-based index into `alternateBases`. If a variant had a `referenceBases` value of `T` and an `alternateBases` value of `[\"A\", \"C\"]`, and the `genotype` was `[2, 1]`, that would mean the call represented the heterozygous value `CA` for this variant. If the `genotype` was instead `[0, 1]`, the represented value would be `TA`. Ordering of the genotype values is important if the `phaseset` is present. If a genotype is not called (that is, a `.` is present in the GT string) -1 is returned.", + "items": { + "type": "integer", + "format": "int32" + } + }, + "phaseset": { + "type": "string", + "description": "If this field is present, this variant call's genotype ordering implies the phase of the bases and is consistent with any other variant calls in the same reference sequence which have the same phaseset value. When importing data from VCF, if the genotype data was phased but no phase set was specified this field will be set to `*`." + }, + "genotypeLikelihood": { + "type": "array", + "description": "The genotype likelihoods for this variant call. Each array entry represents how likely a specific genotype is for this call. The value ordering is defined by the GL tag in the VCF spec. If Phred-scaled genotype likelihood scores (PL) are available and log10(P) genotype likelihood scores (GL) are not, PL scores are converted to GL scores. If both are available, PL scores are stored in `info`.", + "items": { + "type": "number", + "format": "double" + } + }, + "info": { + "type": "object", + "description": "A map of additional variant call information. This must be of the form map (string key mapping to a list of string values).", + "additionalProperties": { + "type": "array", + "items": { + "type": "any" + } + } + } + } + }, + "SearchCallSetsRequest": { + "id": "SearchCallSetsRequest", + "type": "object", + "description": "The call set search request.", + "properties": { + "variantSetIds": { + "type": "array", + "description": "Restrict the query to call sets within the given variant sets. At least one ID must be provided.", + "items": { + "type": "string" + } + }, + "name": { + "type": "string", + "description": "Only return call sets for which a substring of the name matches this string." + }, + "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." + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of call sets to return. If unspecified, defaults to 1000.", + "format": "int32" + } + } + }, + "SearchCallSetsResponse": { + "id": "SearchCallSetsResponse", + "type": "object", + "description": "The call set search response.", + "properties": { + "callSets": { + "type": "array", + "description": "The list of matching call sets.", + "items": { + "$ref": "CallSet" + } + }, + "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. This field will be empty if there aren't any additional results." + } + } + }, + "CallSet": { + "id": "CallSet", + "type": "object", + "description": "A call set is a collection of variant calls, typically for one sample. It belongs to a variant set.", + "properties": { + "id": { + "type": "string", + "description": "The server-generated call set ID, unique across all call sets." + }, + "name": { + "type": "string", + "description": "The call set name." + }, + "sampleId": { + "type": "string", + "description": "The sample ID this call set corresponds to." + }, + "variantSetIds": { + "type": "array", + "description": "The IDs of the variant sets this call set belongs to. This field must have exactly length one, as a call set belongs to a single variant set. This field is repeated for compatibility with the [GA4GH 0.5.1 API](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variants.avdl#L76).", + "items": { + "type": "string" + } + }, + "created": { + "type": "string", + "description": "The date this call set was created in milliseconds from the epoch.", + "format": "int64" + }, + "info": { + "type": "object", + "description": "A map of additional call set information. This must be of the form map (string key mapping to a list of string values).", + "additionalProperties": { + "type": "array", + "items": { + "type": "any" + } + } + } + } + }, + "ImportReadGroupSetsResponse": { + "id": "ImportReadGroupSetsResponse", + "type": "object", + "description": "The read group set import response.", + "properties": { + "readGroupSetIds": { + "type": "array", + "description": "IDs of the read group sets that were created.", + "items": { + "type": "string" + } + } + } + }, + "ImportVariantsResponse": { + "id": "ImportVariantsResponse", + "type": "object", + "description": "The variant data import response.", + "properties": { + "callSetIds": { + "type": "array", + "description": "IDs of the call sets that were created.", + "items": { + "type": "string" + } + } + } + }, + "OperationMetadata": { + "id": "OperationMetadata", + "type": "object", + "description": "Metadata describing an Operation.", + "properties": { + "projectId": { + "type": "string", + "description": "The Google Cloud Project in which the job is scoped." + }, + "createTime": { + "type": "string", + "description": "The time at which the job was submitted to the Genomics service." + }, + "request": { + "type": "object", + "description": "The original request that started the operation. Note that this will be in current version of the API. If the operation was started with v1beta2 API and a GetOperation is performed on v1 API, a v1 request will be returned.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @ype with type URL." + } + }, + "events": { + "type": "array", + "description": "Optional event messages that were generated during the job's execution. This also contains any warnings that were generated during import or export.", + "items": { + "$ref": "OperationEvent" + } + } + } + }, + "OperationEvent": { + "id": "OperationEvent", + "type": "object", + "description": "An event that occurred during an Operation.", + "properties": { + "description": { + "type": "string", + "description": "Required description of event." + } + } + } + }, + "resources": { + "datasets": { + "methods": { + "list": { + "id": "genomics.datasets.list", + "path": "v1/datasets", + "httpMethod": "GET", + "description": "Lists datasets within a project.", + "parameters": { + "projectId": { + "type": "string", + "description": "Required. The project to list datasets for.", + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of results returned by this request. If unspecified, defaults to 50. The maximum value is 1024.", + "format": "int32", + "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" + } + }, + "response": { + "$ref": "ListDatasetsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "create": { + "id": "genomics.datasets.create", + "path": "v1/datasets", + "httpMethod": "POST", + "description": "Creates a new dataset.", + "request": { + "$ref": "Dataset" + }, + "response": { + "$ref": "Dataset" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "get": { + "id": "genomics.datasets.get", + "path": "v1/datasets/{datasetId}", + "httpMethod": "GET", + "description": "Gets a dataset by ID.", + "parameters": { + "datasetId": { + "type": "string", + "description": "The ID of the dataset.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "datasetId" + ], + "response": { + "$ref": "Dataset" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "patch": { + "id": "genomics.datasets.patch", + "path": "v1/datasets/{datasetId}", + "httpMethod": "PATCH", + "description": "Updates a dataset. This method supports patch semantics.", + "parameters": { + "datasetId": { + "type": "string", + "description": "The ID of the dataset to be updated.", + "required": true, + "location": "path" + }, + "updateMask": { + "type": "string", + "description": "An optional mask specifying which fields to update. At this time, the only mutable field is name. The only acceptable value is \"name\". If unspecified, all mutable fields will be updated.", + "location": "query" + } + }, + "parameterOrder": [ + "datasetId" + ], + "request": { + "$ref": "Dataset" + }, + "response": { + "$ref": "Dataset" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "delete": { + "id": "genomics.datasets.delete", + "path": "v1/datasets/{datasetId}", + "httpMethod": "DELETE", + "description": "Deletes a dataset.", + "parameters": { + "datasetId": { + "type": "string", + "description": "The ID of the dataset to be deleted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "datasetId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "undelete": { + "id": "genomics.datasets.undelete", + "path": "v1/datasets/{datasetId}:undelete", + "httpMethod": "POST", + "description": "Undeletes a dataset by restoring a dataset which was deleted via this API. This operation is only possible for a week after the deletion occurred.", + "parameters": { + "datasetId": { + "type": "string", + "description": "The ID of the dataset to be undeleted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "datasetId" + ], + "request": { + "$ref": "UndeleteDatasetRequest" + }, + "response": { + "$ref": "Dataset" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "setIamPolicy": { + "id": "genomics.datasets.setIamPolicy", + "path": "v1/{+resource}:setIamPolicy", + "httpMethod": "POST", + "description": "Sets the access control policy on the specified dataset. Replaces any existing policy. See Setting a Policy for more information.", + "parameters": { + "resource": { + "type": "string", + "description": "REQUIRED: The resource for which policy is being specified. Format is `datasets/`.", + "required": true, + "pattern": "^datasets/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "resource" + ], + "request": { + "$ref": "SetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "getIamPolicy": { + "id": "genomics.datasets.getIamPolicy", + "path": "v1/{+resource}:getIamPolicy", + "httpMethod": "POST", + "description": "Gets the access control policy for the dataset. Is empty if the policy or the resource does not exist. See Getting a Policy for more information.", + "parameters": { + "resource": { + "type": "string", + "description": "REQUIRED: The resource for which policy is being specified. Format is `datasets/`.", + "required": true, + "pattern": "^datasets/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "resource" + ], + "request": { + "$ref": "GetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "testIamPermissions": { + "id": "genomics.datasets.testIamPermissions", + "path": "v1/{+resource}:testIamPermissions", + "httpMethod": "POST", + "description": "Returns permissions that a caller has on the specified resource. See Testing Permissions for more information.", + "parameters": { + "resource": { + "type": "string", + "description": "REQUIRED: The resource for which policy is being specified. Format is `datasets/`.", + "required": true, + "pattern": "^datasets/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "resource" + ], + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + } + } + }, + "operations": { + "methods": { + "get": { + "id": "genomics.operations.get", + "path": "v1/{+name}", + "httpMethod": "GET", + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + "parameters": { + "name": { + "type": "string", + "description": "The name of the operation resource.", + "required": true, + "pattern": "^operations/.*$", + "location": "path" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "list": { + "id": "genomics.operations.list", + "path": "v1/{+name}", + "httpMethod": "GET", + "description": "Lists operations that match the specified filter in the request.", + "parameters": { + "name": { + "type": "string", + "description": "The name of the operation collection.", + "required": true, + "pattern": "^operations$", + "location": "path" + }, + "filter": { + "type": "string", + "description": "A string for filtering Operations. The following filter fields are supported: * projectId: Required. Corresponds to OperationMetadata.projectId. * createTime: The time this job was created, in seconds from the [epoch](http://en.wikipedia.org/wiki/Unix_time). Can use `\u003e=` and/or `= 1432140000` * `projectId = my-project AND createTime \u003e= 1432140000 AND createTime \u003c= 1432150000 AND status = RUNNING`", + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of results to return. If unspecified, defaults to 256. The maximum value is 2048.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The standard list page token.", + "location": "query" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "ListOperationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "cancel": { + "id": "genomics.operations.cancel", + "path": "v1/{+name}:cancel", + "httpMethod": "POST", + "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. Clients may use Operations.GetOperation or Operations.ListOperations to check whether the cancellation succeeded or the operation completed despite cancellation.", + "parameters": { + "name": { + "type": "string", + "description": "The name of the operation resource to be cancelled.", + "required": true, + "pattern": "^operations/.*$", + "location": "path" + } + }, + "parameterOrder": [ + "name" + ], + "request": { + "$ref": "CancelOperationRequest" + }, + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "delete": { + "id": "genomics.operations.delete", + "path": "v1/{+name}", + "httpMethod": "DELETE", + "description": "This method is not implemented. To cancel an operation, please use Operations.CancelOperation.", + "parameters": { + "name": { + "type": "string", + "description": "The name of the operation resource to be deleted.", + "required": true, + "pattern": "^operations/.*$", + "location": "path" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + } + } + }, + "readgroupsets": { + "methods": { + "import": { + "id": "genomics.readgroupsets.import", + "path": "v1/readgroupsets:import", + "httpMethod": "POST", + "description": "Creates read group sets by asynchronously importing the provided information. The caller must have WRITE permissions to the dataset. ## Notes on [BAM](https://samtools.github.io/hts-specs/SAMv1.pdf) import - Tags will be converted to strings - tag types are not preserved - Comments (`@CO`) in the input file header will not be preserved - Original header order of references (`@SQ`) will not be preserved - Any reverse stranded unmapped reads will be reverse complemented, and their qualities (and \"BQ\" tag, if any) will be reversed - Unmapped reads will be stripped of positional information (reference name and position)", + "request": { + "$ref": "ImportReadGroupSetsRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.read_write", + "https://www.googleapis.com/auth/genomics" + ] + }, + "export": { + "id": "genomics.readgroupsets.export", + "path": "v1/readgroupsets/{readGroupSetId}:export", + "httpMethod": "POST", + "description": "Exports a read group set to a BAM file in Google Cloud Storage. Note that currently there may be some differences between exported BAM files and the original BAM file at the time of import. See [ImportReadGroupSets](google.genomics.v1.ReadServiceV1.ImportReadGroupSets) for caveats.", + "parameters": { + "readGroupSetId": { + "type": "string", + "description": "Required. The ID of the read group set to export.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "readGroupSetId" + ], + "request": { + "$ref": "ExportReadGroupSetRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.read_write", + "https://www.googleapis.com/auth/genomics" + ] + }, + "search": { + "id": "genomics.readgroupsets.search", + "path": "v1/readgroupsets/search", + "httpMethod": "POST", + "description": "Searches for read group sets matching the criteria. Implements [GlobalAllianceApi.searchReadGroupSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L135).", + "request": { + "$ref": "SearchReadGroupSetsRequest" + }, + "response": { + "$ref": "SearchReadGroupSetsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "patch": { + "id": "genomics.readgroupsets.patch", + "path": "v1/readgroupsets/{readGroupSetId}", + "httpMethod": "PATCH", + "description": "Updates a read group set. This method supports patch semantics.", + "parameters": { + "readGroupSetId": { + "type": "string", + "description": "The ID of the read group set to be updated. The caller must have WRITE permissions to the dataset associated with this read group set.", + "required": true, + "location": "path" + }, + "updateMask": { + "type": "string", + "description": "An optional mask specifying which fields to update. At this time, mutable fields are referenceSetId and name. Acceptable values are \"referenceSetId\" and \"name\". If unspecified, all mutable fields will be updated.", + "location": "query" + } + }, + "parameterOrder": [ + "readGroupSetId" + ], + "request": { + "$ref": "ReadGroupSet" + }, + "response": { + "$ref": "ReadGroupSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "delete": { + "id": "genomics.readgroupsets.delete", + "path": "v1/readgroupsets/{readGroupSetId}", + "httpMethod": "DELETE", + "description": "Deletes a read group set.", + "parameters": { + "readGroupSetId": { + "type": "string", + "description": "The ID of the read group set to be deleted. The caller must have WRITE permissions to the dataset associated with this read group set.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "readGroupSetId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "get": { + "id": "genomics.readgroupsets.get", + "path": "v1/readgroupsets/{readGroupSetId}", + "httpMethod": "GET", + "description": "Gets a read group set by ID.", + "parameters": { + "readGroupSetId": { + "type": "string", + "description": "The ID of the read group set.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "readGroupSetId" + ], + "response": { + "$ref": "ReadGroupSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + } + }, + "resources": { + "coveragebuckets": { + "methods": { + "list": { + "id": "genomics.readgroupsets.coveragebuckets.list", + "path": "v1/readgroupsets/{readGroupSetId}/coveragebuckets", + "httpMethod": "GET", + "description": "Lists fixed width coverage buckets for a read group set, each of which correspond to a range of a reference sequence. Each bucket summarizes coverage information across its corresponding genomic range. Coverage is defined as the number of reads which are aligned to a given base in the reference sequence. Coverage buckets are available at several precomputed bucket widths, enabling retrieval of various coverage 'zoom levels'. The caller must have READ permissions for the target read group set.", + "parameters": { + "readGroupSetId": { + "type": "string", + "description": "Required. The ID of the read group set over which coverage is requested.", + "required": true, + "location": "path" + }, + "referenceName": { + "type": "string", + "description": "The name of the reference to query, within the reference set associated with this query. Optional.", + "location": "query" + }, + "start": { + "type": "string", + "description": "The start position of the range on the reference, 0-based inclusive. If specified, `referenceName` must also be specified. Defaults to 0.", + "format": "int64", + "location": "query" + }, + "end": { + "type": "string", + "description": "The end position of the range on the reference, 0-based exclusive. If specified, `referenceName` must also be specified. If unset or 0, defaults to the length of the reference.", + "format": "int64", + "location": "query" + }, + "targetBucketWidth": { + "type": "string", + "description": "The desired width of each reported coverage bucket in base pairs. This will be rounded down to the nearest precomputed bucket width; the value of which is returned as `bucketWidth` in the response. Defaults to infinity (each bucket spans an entire reference sequence) or the length of the target range, if specified. The smallest precomputed `bucketWidth` is currently 2048 base pairs; this is subject to change.", + "format": "int64", + "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" + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of results to return in a single page. If unspecified, defaults to 1024. The maximum value is 2048.", + "format": "int32", + "location": "query" + } + }, + "parameterOrder": [ + "readGroupSetId" + ], + "response": { + "$ref": "ListCoverageBucketsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + } + } + } + } + }, + "reads": { + "methods": { + "search": { + "id": "genomics.reads.search", + "path": "v1/reads/search", + "httpMethod": "POST", + "description": "Gets a list of reads for one or more read group sets. Reads search operates over a genomic coordinate space of reference sequence & position defined over the reference sequences to which the requested read group sets are aligned. If a target positional range is specified, search returns all reads whose alignment to the reference genome overlap the range. A query which specifies only read group set IDs yields all reads in those read group sets, including unmapped reads. All reads returned (including reads on subsequent pages) are ordered by genomic coordinate (reference sequence & position). Reads with equivalent genomic coordinates are returned in a deterministic order. Implements [GlobalAllianceApi.searchReads](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L85).", + "request": { + "$ref": "SearchReadsRequest" + }, + "response": { + "$ref": "SearchReadsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + } + } + }, + "referencesets": { + "methods": { + "search": { + "id": "genomics.referencesets.search", + "path": "v1/referencesets/search", + "httpMethod": "POST", + "description": "Searches for reference sets which match the given criteria. Implements [GlobalAllianceApi.searchReferenceSets](http://ga4gh.org/documentation/api/v0.5.1/ga4gh_api.html#/schema/org.ga4gh.searchReferenceSets).", + "request": { + "$ref": "SearchReferenceSetsRequest" + }, + "response": { + "$ref": "SearchReferenceSetsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "get": { + "id": "genomics.referencesets.get", + "path": "v1/referencesets/{referenceSetId}", + "httpMethod": "GET", + "description": "Gets a reference set. Implements [GlobalAllianceApi.getReferenceSet](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L83).", + "parameters": { + "referenceSetId": { + "type": "string", + "description": "The ID of the reference set.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "referenceSetId" + ], + "response": { + "$ref": "ReferenceSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + } + } + }, + "references": { + "methods": { + "search": { + "id": "genomics.references.search", + "path": "v1/references/search", + "httpMethod": "POST", + "description": "Searches for references which match the given criteria. Implements [GlobalAllianceApi.searchReferences](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L146).", + "request": { + "$ref": "SearchReferencesRequest" + }, + "response": { + "$ref": "SearchReferencesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "get": { + "id": "genomics.references.get", + "path": "v1/references/{referenceId}", + "httpMethod": "GET", + "description": "Gets a reference. Implements [GlobalAllianceApi.getReference](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L158).", + "parameters": { + "referenceId": { + "type": "string", + "description": "The ID of the reference.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "referenceId" + ], + "response": { + "$ref": "Reference" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + } + }, + "resources": { + "bases": { + "methods": { + "list": { + "id": "genomics.references.bases.list", + "path": "v1/references/{referenceId}/bases", + "httpMethod": "GET", + "description": "Lists the bases in a reference, optionally restricted to a range. Implements [GlobalAllianceApi.getReferenceBases](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L221).", + "parameters": { + "referenceId": { + "type": "string", + "description": "The ID of the reference.", + "required": true, + "location": "path" + }, + "start": { + "type": "string", + "description": "The start position (0-based) of this query. Defaults to 0.", + "format": "int64", + "location": "query" + }, + "end": { + "type": "string", + "description": "The end position (0-based, exclusive) of this query. Defaults to the length of this reference.", + "format": "int64", + "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" + }, + "pageSize": { + "type": "integer", + "description": "Specifies the maximum number of bases to return in a single page.", + "format": "int32", + "location": "query" + } + }, + "parameterOrder": [ + "referenceId" + ], + "response": { + "$ref": "ListBasesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + } + } + } + } + }, + "variants": { + "methods": { + "import": { + "id": "genomics.variants.import", + "path": "v1/variants:import", + "httpMethod": "POST", + "description": "Creates variant data by asynchronously importing the provided information. The variants for import will be merged with any existing variant that matches its reference sequence, start, end, reference bases, and alternative bases. If no such variant exists, a new one will be created. When variants are merged, the call information from the new variant is added to the existing variant, and other fields (such as key/value pairs) are discarded. In particular, this means for merged VCF variants that have conflicting INFO fields, some data will be arbitrarily discarded. As a special case, for single-sample VCF files, QUAL and FILTER fields will be moved to the call level; these are sometimes interpreted in a call-specific context. Imported VCF headers are appended to the metadata already in a variant set.", + "request": { + "$ref": "ImportVariantsRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.read_write", + "https://www.googleapis.com/auth/genomics" + ] + }, + "search": { + "id": "genomics.variants.search", + "path": "v1/variants/search", + "httpMethod": "POST", + "description": "Gets a list of variants matching the criteria. Implements [GlobalAllianceApi.searchVariants](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L126).", + "request": { + "$ref": "SearchVariantsRequest" + }, + "response": { + "$ref": "SearchVariantsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "create": { + "id": "genomics.variants.create", + "path": "v1/variants", + "httpMethod": "POST", + "description": "Creates a new variant.", + "request": { + "$ref": "Variant" + }, + "response": { + "$ref": "Variant" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "patch": { + "id": "genomics.variants.patch", + "path": "v1/variants/{variantId}", + "httpMethod": "PATCH", + "description": "Updates a variant. This method supports patch semantics. Returns the modified variant without its calls.", + "parameters": { + "variantId": { + "type": "string", + "description": "The ID of the variant to be updated.", + "required": true, + "location": "path" + }, + "updateMask": { + "type": "string", + "description": "An optional mask specifying which fields to update. At this time, mutable fields are names and info. Acceptable values are \"names\" and \"info\". If unspecified, all mutable fields will be updated.", + "location": "query" + } + }, + "parameterOrder": [ + "variantId" + ], + "request": { + "$ref": "Variant" + }, + "response": { + "$ref": "Variant" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "delete": { + "id": "genomics.variants.delete", + "path": "v1/variants/{variantId}", + "httpMethod": "DELETE", + "description": "Deletes a variant.", + "parameters": { + "variantId": { + "type": "string", + "description": "The ID of the variant to be deleted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "variantId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "get": { + "id": "genomics.variants.get", + "path": "v1/variants/{variantId}", + "httpMethod": "GET", + "description": "Gets a variant by ID.", + "parameters": { + "variantId": { + "type": "string", + "description": "The ID of the variant.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "variantId" + ], + "response": { + "$ref": "Variant" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + } + } + }, + "variantsets": { + "methods": { + "create": { + "id": "genomics.variantsets.create", + "path": "v1/variantsets", + "httpMethod": "POST", + "description": "Creates a new variant set. The provided variant set must have a valid `datasetId` set - all other fields are optional. Note that the `id` field will be ignored, as this is assigned by the server.", + "request": { + "$ref": "VariantSet" + }, + "response": { + "$ref": "VariantSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "export": { + "id": "genomics.variantsets.export", + "path": "v1/variantsets/{variantSetId}:export", + "httpMethod": "POST", + "description": "Exports variant set data to an external destination.", + "parameters": { + "variantSetId": { + "type": "string", + "description": "Required. The ID of the variant set that contains variant data which should be exported. The caller must have READ access to this variant set.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "variantSetId" + ], + "request": { + "$ref": "ExportVariantSetRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "get": { + "id": "genomics.variantsets.get", + "path": "v1/variantsets/{variantSetId}", + "httpMethod": "GET", + "description": "Gets a variant set by ID.", + "parameters": { + "variantSetId": { + "type": "string", + "description": "Required. The ID of the variant set.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "variantSetId" + ], + "response": { + "$ref": "VariantSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "search": { + "id": "genomics.variantsets.search", + "path": "v1/variantsets/search", + "httpMethod": "POST", + "description": "Returns a list of all variant sets matching search criteria. Implements [GlobalAllianceApi.searchVariantSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L49).", + "request": { + "$ref": "SearchVariantSetsRequest" + }, + "response": { + "$ref": "SearchVariantSetsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "delete": { + "id": "genomics.variantsets.delete", + "path": "v1/variantsets/{variantSetId}", + "httpMethod": "DELETE", + "description": "Deletes the contents of a variant set. The variant set object is not deleted.", + "parameters": { + "variantSetId": { + "type": "string", + "description": "The ID of the variant set to be deleted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "variantSetId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "patch": { + "id": "genomics.variantsets.patch", + "path": "v1/variantsets/{variantSetId}", + "httpMethod": "PATCH", + "description": "Updates a variant set. This method supports patch semantics.", + "parameters": { + "variantSetId": { + "type": "string", + "description": "The ID of the variant to be updated (must already exist).", + "required": true, + "location": "path" + }, + "updateMask": { + "type": "string", + "description": "An optional mask specifying which fields to update. At this time, the only mutable field is metadata. The only acceptable value is \"metadata\". If unspecified, all mutable fields will be updated.", + "location": "query" + } + }, + "parameterOrder": [ + "variantSetId" + ], + "request": { + "$ref": "VariantSet" + }, + "response": { + "$ref": "VariantSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + } + } + }, + "callsets": { + "methods": { + "search": { + "id": "genomics.callsets.search", + "path": "v1/callsets/search", + "httpMethod": "POST", + "description": "Gets a list of call sets matching the criteria. Implements [GlobalAllianceApi.searchCallSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L178).", + "request": { + "$ref": "SearchCallSetsRequest" + }, + "response": { + "$ref": "SearchCallSetsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "create": { + "id": "genomics.callsets.create", + "path": "v1/callsets", + "httpMethod": "POST", + "description": "Creates a new call set.", + "request": { + "$ref": "CallSet" + }, + "response": { + "$ref": "CallSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "patch": { + "id": "genomics.callsets.patch", + "path": "v1/callsets/{callSetId}", + "httpMethod": "PATCH", + "description": "Updates a call set. This method supports patch semantics.", + "parameters": { + "callSetId": { + "type": "string", + "description": "The ID of the call set to be updated.", + "required": true, + "location": "path" + }, + "updateMask": { + "type": "string", + "description": "An optional mask specifying which fields to update. At this time, the only mutable field is name. The only acceptable value is \"name\". If unspecified, all mutable fields will be updated.", + "location": "query" + } + }, + "parameterOrder": [ + "callSetId" + ], + "request": { + "$ref": "CallSet" + }, + "response": { + "$ref": "CallSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "delete": { + "id": "genomics.callsets.delete", + "path": "v1/callsets/{callSetId}", + "httpMethod": "DELETE", + "description": "Deletes a call set.", + "parameters": { + "callSetId": { + "type": "string", + "description": "The ID of the call set to be deleted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "callSetId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "get": { + "id": "genomics.callsets.get", + "path": "v1/callsets/{callSetId}", + "httpMethod": "GET", + "description": "Gets a call set by ID.", + "parameters": { + "callSetId": { + "type": "string", + "description": "The ID of the call set.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "callSetId" + ], + "response": { + "$ref": "CallSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/genomics/v1/genomics-gen.go b/Godeps/_workspace/src/google.golang.org/api/genomics/v1/genomics-gen.go new file mode 100644 index 000000000..061a11162 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/genomics/v1/genomics-gen.go @@ -0,0 +1,7958 @@ +// Package genomics provides access to the Genomics API. +// +// Usage example: +// +// import "google.golang.org/api/genomics/v1" +// ... +// genomicsService, err := genomics.New(oauthHttpClient) +package genomics // import "google.golang.org/api/genomics/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "genomics:v1" +const apiName = "genomics" +const apiVersion = "v1" +const basePath = "https://genomics.googleapis.com/" + +// 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 in Google Cloud Storage + DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write" + + // View and manage Genomics data + GenomicsScope = "https://www.googleapis.com/auth/genomics" + + // View Genomics data + GenomicsReadonlyScope = "https://www.googleapis.com/auth/genomics.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.Callsets = NewCallsetsService(s) + s.Datasets = NewDatasetsService(s) + s.Operations = NewOperationsService(s) + s.Readgroupsets = NewReadgroupsetsService(s) + s.Reads = NewReadsService(s) + s.References = NewReferencesService(s) + s.Referencesets = NewReferencesetsService(s) + s.Variants = NewVariantsService(s) + s.Variantsets = NewVariantsetsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Callsets *CallsetsService + + Datasets *DatasetsService + + Operations *OperationsService + + Readgroupsets *ReadgroupsetsService + + Reads *ReadsService + + References *ReferencesService + + Referencesets *ReferencesetsService + + Variants *VariantsService + + Variantsets *VariantsetsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewCallsetsService(s *Service) *CallsetsService { + rs := &CallsetsService{s: s} + return rs +} + +type CallsetsService struct { + s *Service +} + +func NewDatasetsService(s *Service) *DatasetsService { + rs := &DatasetsService{s: s} + return rs +} + +type DatasetsService struct { + s *Service +} + +func NewOperationsService(s *Service) *OperationsService { + rs := &OperationsService{s: s} + return rs +} + +type OperationsService struct { + s *Service +} + +func NewReadgroupsetsService(s *Service) *ReadgroupsetsService { + rs := &ReadgroupsetsService{s: s} + rs.Coveragebuckets = NewReadgroupsetsCoveragebucketsService(s) + return rs +} + +type ReadgroupsetsService struct { + s *Service + + Coveragebuckets *ReadgroupsetsCoveragebucketsService +} + +func NewReadgroupsetsCoveragebucketsService(s *Service) *ReadgroupsetsCoveragebucketsService { + rs := &ReadgroupsetsCoveragebucketsService{s: s} + return rs +} + +type ReadgroupsetsCoveragebucketsService struct { + s *Service +} + +func NewReadsService(s *Service) *ReadsService { + rs := &ReadsService{s: s} + return rs +} + +type ReadsService struct { + s *Service +} + +func NewReferencesService(s *Service) *ReferencesService { + rs := &ReferencesService{s: s} + rs.Bases = NewReferencesBasesService(s) + return rs +} + +type ReferencesService struct { + s *Service + + Bases *ReferencesBasesService +} + +func NewReferencesBasesService(s *Service) *ReferencesBasesService { + rs := &ReferencesBasesService{s: s} + return rs +} + +type ReferencesBasesService struct { + s *Service +} + +func NewReferencesetsService(s *Service) *ReferencesetsService { + rs := &ReferencesetsService{s: s} + return rs +} + +type ReferencesetsService struct { + s *Service +} + +func NewVariantsService(s *Service) *VariantsService { + rs := &VariantsService{s: s} + return rs +} + +type VariantsService struct { + s *Service +} + +func NewVariantsetsService(s *Service) *VariantsetsService { + rs := &VariantsetsService{s: s} + return rs +} + +type VariantsetsService struct { + s *Service +} + +// Binding: Associates `members` with a `role`. +type Binding struct { + // Members: Specifies the identities requesting access for a Cloud + // Platform resource. `members` can have the following formats: * + // `allUsers`: A special identifier that represents anyone who is on the + // internet; with or without a Google account. * + // `allAuthenticatedUsers`: A special identifier that represents anyone + // who is authenticated with a Google account or a service account. * + // `user:{emailid}`: An email address that represents a specific Google + // account. For example, `alice@gmail.com` or `joe@example.com`. * + // `serviceAccount:{emailid}`: An email address that represents a + // service account. For example, + // `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An + // email address that represents a Google group. For example, + // `admins@example.com`. * `domain:{domain}`: A Google Apps domain name + // that represents all the users of that domain. For example, + // `google.com` or `example.com`. + Members []string `json:"members,omitempty"` + + // Role: Role that is assigned to `members`. For example, + // `roles/viewer`, `roles/editor`, or `roles/owner`. Required + Role string `json:"role,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Members") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Binding) MarshalJSON() ([]byte, error) { + type noMethod Binding + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CallSet: A call set is a collection of variant calls, typically for +// one sample. It belongs to a variant set. +type CallSet struct { + // Created: The date this call set was created in milliseconds from the + // epoch. + Created int64 `json:"created,omitempty,string"` + + // Id: The server-generated call set ID, unique across all call sets. + Id string `json:"id,omitempty"` + + // Info: A map of additional call set information. This must be of the + // form map (string key mapping to a list of string values). + Info *CallSetInfo `json:"info,omitempty"` + + // Name: The call set name. + Name string `json:"name,omitempty"` + + // SampleId: The sample ID this call set corresponds to. + SampleId string `json:"sampleId,omitempty"` + + // VariantSetIds: The IDs of the variant sets this call set belongs to. + // This field must have exactly length one, as a call set belongs to a + // single variant set. This field is repeated for compatibility with the + // [GA4GH 0.5.1 + // API](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/a + // vro/variants.avdl#L76). + VariantSetIds []string `json:"variantSetIds,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Created") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CallSet) MarshalJSON() ([]byte, error) { + type noMethod CallSet + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CallSetInfo: A map of additional call set information. This must be +// of the form map (string key mapping to a list of string values). +type CallSetInfo struct { +} + +// CancelOperationRequest: The request message for +// Operations.CancelOperation. +type CancelOperationRequest struct { +} + +// CigarUnit: A single CIGAR operation. +type CigarUnit struct { + // Possible values: + // "OPERATION_UNSPECIFIED" + // "ALIGNMENT_MATCH" + // "INSERT" + // "DELETE" + // "SKIP" + // "CLIP_SOFT" + // "CLIP_HARD" + // "PAD" + // "SEQUENCE_MATCH" + // "SEQUENCE_MISMATCH" + Operation string `json:"operation,omitempty"` + + // OperationLength: The number of genomic bases that the operation runs + // for. Required. + OperationLength int64 `json:"operationLength,omitempty,string"` + + // ReferenceSequence: `referenceSequence` is only used at mismatches + // (`SEQUENCE_MISMATCH`) and deletions (`DELETE`). Filling this field + // replaces SAM's MD tag. If the relevant information is not available, + // this field is unset. + ReferenceSequence string `json:"referenceSequence,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Operation") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CigarUnit) MarshalJSON() ([]byte, error) { + type noMethod CigarUnit + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CoverageBucket: A bucket over which read coverage has been +// precomputed. A bucket corresponds to a specific range of the +// reference sequence. +type CoverageBucket struct { + // MeanCoverage: The average number of reads which are aligned to each + // individual reference base in this bucket. + MeanCoverage float64 `json:"meanCoverage,omitempty"` + + // Range: The genomic coordinate range spanned by this bucket. + Range *Range `json:"range,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MeanCoverage") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CoverageBucket) MarshalJSON() ([]byte, error) { + type noMethod CoverageBucket + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Dataset: A Dataset is a collection of genomic data. +type Dataset struct { + // CreateTime: The time this dataset was created, in seconds from the + // epoch. + CreateTime string `json:"createTime,omitempty"` + + // Id: The server-generated dataset ID, unique across all datasets. + Id string `json:"id,omitempty"` + + // Name: The dataset name. + Name string `json:"name,omitempty"` + + // ProjectId: The Google Developers Console project ID that this dataset + // belongs to. + ProjectId string `json:"projectId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Dataset) MarshalJSON() ([]byte, error) { + type noMethod Dataset + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Empty: A generic empty message that you can re-use to avoid defining +// duplicated empty messages in your APIs. A typical example is to use +// it as the request or the response type of an API method. For +// instance: service Foo { rpc Bar(google.protobuf.Empty) returns +// (google.protobuf.Empty); } The JSON representation for `Empty` is +// empty JSON object `{}`. +type Empty struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +type Experiment struct { + // InstrumentModel: The instrument model used as part of this + // experiment. This maps to sequencing technology in BAM. + InstrumentModel string `json:"instrumentModel,omitempty"` + + // LibraryId: The library used as part of this experiment. Note: This is + // not an actual ID within this repository, but rather an identifier for + // a library which may be meaningful to some external system. + LibraryId string `json:"libraryId,omitempty"` + + // PlatformUnit: The platform unit used as part of this experiment e.g. + // flowcell-barcode.lane for Illumina or slide for SOLiD. Corresponds to + // the @RG PU field in the SAM spec. + PlatformUnit string `json:"platformUnit,omitempty"` + + // SequencingCenter: The sequencing center used as part of this + // experiment. + SequencingCenter string `json:"sequencingCenter,omitempty"` + + // ForceSendFields is a list of field names (e.g. "InstrumentModel") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Experiment) MarshalJSON() ([]byte, error) { + type noMethod Experiment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ExportReadGroupSetRequest: The read group set export request. +type ExportReadGroupSetRequest struct { + // ExportUri: Required. A Google Cloud Storage URI for the exported BAM + // file. The currently authenticated user must have write access to the + // new file. An error will be returned if the URI already contains data. + ExportUri string `json:"exportUri,omitempty"` + + // ProjectId: Required. The Google Developers Console project ID that + // owns this export. + ProjectId string `json:"projectId,omitempty"` + + // ReferenceNames: The reference names to export. If this is not + // specified, all reference sequences, including unmapped reads, are + // exported. Use `*` to export only unmapped reads. + ReferenceNames []string `json:"referenceNames,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ExportUri") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ExportReadGroupSetRequest) MarshalJSON() ([]byte, error) { + type noMethod ExportReadGroupSetRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ExportVariantSetRequest: The variant data export request. +type ExportVariantSetRequest struct { + // BigqueryDataset: Required. The BigQuery dataset to export data to. + // This dataset must already exist. Note that this is distinct from the + // Genomics concept of "dataset". + BigqueryDataset string `json:"bigqueryDataset,omitempty"` + + // BigqueryTable: Required. The BigQuery table to export data to. If the + // table doesn't exist, it will be created. If it already exists, it + // will be overwritten. + BigqueryTable string `json:"bigqueryTable,omitempty"` + + // CallSetIds: If provided, only variant call information from the + // specified call sets will be exported. By default all variant calls + // are exported. + CallSetIds []string `json:"callSetIds,omitempty"` + + // Format: The format for the exported data. + // + // Possible values: + // "FORMAT_UNSPECIFIED" + // "FORMAT_BIGQUERY" + Format string `json:"format,omitempty"` + + // ProjectId: Required. The Google Cloud project ID that owns the + // destination BigQuery dataset. The caller must have WRITE access to + // this project. This project will also own the resulting export job. + ProjectId string `json:"projectId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BigqueryDataset") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ExportVariantSetRequest) MarshalJSON() ([]byte, error) { + type noMethod ExportVariantSetRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GetIamPolicyRequest: Request message for `GetIamPolicy` method. +type GetIamPolicyRequest struct { +} + +// ImportReadGroupSetsRequest: The read group set import request. +type ImportReadGroupSetsRequest struct { + // DatasetId: Required. The ID of the dataset these read group sets will + // belong to. The caller must have WRITE permissions to this dataset. + DatasetId string `json:"datasetId,omitempty"` + + // PartitionStrategy: The partition strategy describes how read groups + // are partitioned into read group sets. + // + // Possible values: + // "PARTITION_STRATEGY_UNSPECIFIED" + // "PER_FILE_PER_SAMPLE" + // "MERGE_ALL" + PartitionStrategy string `json:"partitionStrategy,omitempty"` + + // ReferenceSetId: The reference set to which the imported read group + // sets are aligned to, if any. The reference names of this reference + // set must be a superset of those found in the imported file headers. + // If no reference set id is provided, a best effort is made to + // associate with a matching reference set. + ReferenceSetId string `json:"referenceSetId,omitempty"` + + // SourceUris: A list of URIs pointing at [BAM + // files](https://samtools.github.io/hts-specs/SAMv1.pdf) in Google + // Cloud Storage. + SourceUris []string `json:"sourceUris,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DatasetId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ImportReadGroupSetsRequest) MarshalJSON() ([]byte, error) { + type noMethod ImportReadGroupSetsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ImportReadGroupSetsResponse: The read group set import response. +type ImportReadGroupSetsResponse struct { + // ReadGroupSetIds: IDs of the read group sets that were created. + ReadGroupSetIds []string `json:"readGroupSetIds,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ReadGroupSetIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ImportReadGroupSetsResponse) MarshalJSON() ([]byte, error) { + type noMethod ImportReadGroupSetsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ImportVariantsRequest: The variant data import request. +type ImportVariantsRequest struct { + // Format: The format of the variant data being imported. If + // unspecified, defaults to to `VCF`. + // + // Possible values: + // "FORMAT_UNSPECIFIED" + // "FORMAT_VCF" + // "FORMAT_COMPLETE_GENOMICS" + Format string `json:"format,omitempty"` + + // NormalizeReferenceNames: Convert reference names to the canonical + // representation. hg19 haploytypes (those reference names containing + // "_hap") are not modified in any way. All other reference names are + // modified according to the following rules: The reference name is + // capitalized. The "chr" prefix is dropped for all autosomes and sex + // chromsomes. For example "chr17" becomes "17" and "chrX" becomes "X". + // All mitochondrial chromosomes ("chrM", "chrMT", etc) become "MT". + NormalizeReferenceNames bool `json:"normalizeReferenceNames,omitempty"` + + // SourceUris: A list of URIs referencing variant files in Google Cloud + // Storage. URIs can include wildcards [as described + // here](https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNa + // mes). Note that recursive wildcards ('**') are not supported. + SourceUris []string `json:"sourceUris,omitempty"` + + // VariantSetId: Required. The variant set to which variant data should + // be imported. + VariantSetId string `json:"variantSetId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Format") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ImportVariantsRequest) MarshalJSON() ([]byte, error) { + type noMethod ImportVariantsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ImportVariantsResponse: The variant data import response. +type ImportVariantsResponse struct { + // CallSetIds: IDs of the call sets that were created. + CallSetIds []string `json:"callSetIds,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CallSetIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ImportVariantsResponse) MarshalJSON() ([]byte, error) { + type noMethod ImportVariantsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LinearAlignment: A linear alignment can be represented by one CIGAR +// string. Describes the mapped position and local alignment of the read +// to the reference. +type LinearAlignment struct { + // Cigar: Represents the local alignment of this sequence (alignment + // matches, indels, etc) against the reference. + Cigar []*CigarUnit `json:"cigar,omitempty"` + + // MappingQuality: The mapping quality of this alignment. Represents how + // likely the read maps to this position as opposed to other locations. + MappingQuality int64 `json:"mappingQuality,omitempty"` + + // Position: The position of this alignment. + Position *Position `json:"position,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Cigar") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LinearAlignment) MarshalJSON() ([]byte, error) { + type noMethod LinearAlignment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ListBasesResponse struct { + // 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. This field will be empty if there + // aren't any additional results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Offset: The offset position (0-based) of the given `sequence` from + // the start of this `Reference`. This value will differ for each page + // in a paginated request. + Offset int64 `json:"offset,omitempty,string"` + + // Sequence: A substring of the bases that make up this reference. + Sequence string `json:"sequence,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListBasesResponse) MarshalJSON() ([]byte, error) { + type noMethod ListBasesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ListCoverageBucketsResponse struct { + // BucketWidth: The length of each coverage bucket in base pairs. Note + // that buckets at the end of a reference sequence may be shorter. This + // value is omitted if the bucket width is infinity (the default + // behaviour, with no range or `targetBucketWidth`). + BucketWidth int64 `json:"bucketWidth,omitempty,string"` + + // CoverageBuckets: The coverage buckets. The list of buckets is sparse; + // a bucket with 0 overlapping reads is not returned. A bucket never + // crosses more than one reference sequence. Each bucket has width + // `bucketWidth`, unless its end is the end of the reference sequence. + CoverageBuckets []*CoverageBucket `json:"coverageBuckets,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. This field will be empty if there + // aren't any additional results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BucketWidth") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListCoverageBucketsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListCoverageBucketsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListDatasetsResponse: The dataset list response. +type ListDatasetsResponse struct { + // Datasets: The list of matching Datasets. + Datasets []*Dataset `json:"datasets,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. This field will be empty if there + // aren't any additional results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Datasets") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListDatasetsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListDatasetsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListOperationsResponse: The response message for +// Operations.ListOperations. +type ListOperationsResponse struct { + // NextPageToken: The standard List next-page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Operations: A list of operations that matches the specified filter in + // the request. + Operations []*Operation `json:"operations,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListOperationsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Operation: This resource represents a long-running operation that is +// the result of a network API call. +type Operation struct { + // Done: If the value is `false`, it means the operation is still in + // progress. If true, the operation is completed, and either `error` or + // `response` is available. + Done bool `json:"done,omitempty"` + + // Error: The error result of the operation in case of failure. + Error *Status `json:"error,omitempty"` + + // Metadata: An OperationMetadata object. This will always be returned + // with the Operation. + Metadata OperationMetadata `json:"metadata,omitempty"` + + // Name: The server-assigned name, which is only unique within the same + // service that originally returns it. For example: + // `operations/CJHU7Oi_ChDrveSpBRjfuL-qzoWAgEw` + Name string `json:"name,omitempty"` + + // Response: If importing ReadGroupSets, an ImportReadGroupSetsResponse + // is returned. If importing Variants, an ImportVariantsResponse is + // returned. For exports, an empty response is returned. + Response OperationResponse `json:"response,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Done") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Operation) MarshalJSON() ([]byte, error) { + type noMethod Operation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationMetadata interface{} + +type OperationResponse interface{} + +// OperationEvent: An event that occurred during an Operation. +type OperationEvent struct { + // Description: Required description of event. + Description string `json:"description,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationEvent) MarshalJSON() ([]byte, error) { + type noMethod OperationEvent + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationMetadata1: Metadata describing an Operation. +type OperationMetadata1 struct { + // CreateTime: The time at which the job was submitted to the Genomics + // service. + CreateTime string `json:"createTime,omitempty"` + + // Events: Optional event messages that were generated during the job's + // execution. This also contains any warnings that were generated during + // import or export. + Events []*OperationEvent `json:"events,omitempty"` + + // ProjectId: The Google Cloud Project in which the job is scoped. + ProjectId string `json:"projectId,omitempty"` + + // Request: The original request that started the operation. Note that + // this will be in current version of the API. If the operation was + // started with v1beta2 API and a GetOperation is performed on v1 API, a + // v1 request will be returned. + Request OperationMetadataRequest `json:"request,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationMetadata1) MarshalJSON() ([]byte, error) { + type noMethod OperationMetadata1 + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationMetadataRequest interface{} + +// Policy: Defines an Identity and Access Management (IAM) policy. It is +// used to specify access control policies for Cloud Platform resources. +// A `Policy` consists of a list of `bindings`. A `Binding` binds a list +// of `members` to a `role`, where the members can be user accounts, +// Google groups, Google domains, and service accounts. A `role` is a +// named list of permissions defined by IAM. **Example** { "bindings": [ +// { "role": "roles/owner", "members": [ "user:mike@example.com", +// "group:admins@example.com", "domain:google.com", +// "serviceAccount:my-other-app@appspot.gserviceaccount.com"] }, { +// "role": "roles/viewer", "members": ["user:sean@example.com"] } ] } +// For a description of IAM and its features, see the [IAM developer's +// guide](https://cloud.google.com/iam). +type Policy struct { + // Bindings: Associates a list of `members` to a `role`. Multiple + // `bindings` must not be specified for the same `role`. `bindings` with + // no members will result in an error. + Bindings []*Binding `json:"bindings,omitempty"` + + // Etag: Can be used to perform a read-modify-write. + Etag string `json:"etag,omitempty"` + + // Version: Version of the `Policy`. The default version is 0. + Version int64 `json:"version,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Bindings") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Policy) MarshalJSON() ([]byte, error) { + type noMethod Policy + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Position: An abstraction for referring to a genomic position, in +// relation to some already known reference. For now, represents a +// genomic position as a reference name, a base number on that reference +// (0-based), and a determination of forward or reverse strand. +type Position struct { + // Position: The 0-based offset from the start of the forward strand for + // that reference. + Position int64 `json:"position,omitempty,string"` + + // ReferenceName: The name of the reference in whatever reference set is + // being used. + ReferenceName string `json:"referenceName,omitempty"` + + // ReverseStrand: Whether this position is on the reverse strand, as + // opposed to the forward strand. + ReverseStrand bool `json:"reverseStrand,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Position") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Position) MarshalJSON() ([]byte, error) { + type noMethod Position + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Program struct { + // CommandLine: The command line used to run this program. + CommandLine string `json:"commandLine,omitempty"` + + // Id: The user specified locally unique ID of the program. Used along + // with `prevProgramId` to define an ordering between programs. + Id string `json:"id,omitempty"` + + // Name: The name of the program. + Name string `json:"name,omitempty"` + + // PrevProgramId: The ID of the program run before this one. + PrevProgramId string `json:"prevProgramId,omitempty"` + + // Version: The version of the program run. + Version string `json:"version,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CommandLine") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Program) MarshalJSON() ([]byte, error) { + type noMethod Program + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Range: A 0-based half-open genomic coordinate range for search +// requests. +type Range struct { + // End: The end position of the range on the reference, 0-based + // exclusive. + End int64 `json:"end,omitempty,string"` + + // ReferenceName: The reference sequence name, for example `chr1`, `1`, + // or `chrX`. + ReferenceName string `json:"referenceName,omitempty"` + + // Start: The start position of the range on the reference, 0-based + // inclusive. + Start int64 `json:"start,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "End") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Range) MarshalJSON() ([]byte, error) { + type noMethod Range + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Read: A read alignment describes a linear alignment of a string of +// DNA to a reference sequence, in addition to metadata about the +// fragment (the molecule of DNA sequenced) and the read (the bases +// which were read by the sequencer). A read is equivalent to a line in +// a SAM file. A read belongs to exactly one read group and exactly one +// read group set. ### Generating a reference-aligned sequence string +// When interacting with mapped reads, it's often useful to produce a +// string representing the local alignment of the read to reference. The +// following pseudocode demonstrates one way of doing this: out = "" +// offset = 0 for c in read.alignment.cigar { switch c.operation { case +// "ALIGNMENT_MATCH", "SEQUENCE_MATCH", "SEQUENCE_MISMATCH": out += +// read.alignedSequence[offset:offset+c.operationLength] offset += +// c.operationLength break case "CLIP_SOFT", "INSERT": offset += +// c.operationLength break case "PAD": out += repeat("*", +// c.operationLength) break case "DELETE": out += repeat("-", +// c.operationLength) break case "SKIP": out += repeat(" ", +// c.operationLength) break case "CLIP_HARD": break } } return out ### +// Converting to SAM's CIGAR string The following pseudocode generates a +// SAM CIGAR string from the `cigar` field. Note that this is a lossy +// conversion (`cigar.referenceSequence` is lost). cigarMap = { +// "ALIGNMENT_MATCH": "M", "INSERT": "I", "DELETE": "D", "SKIP": "N", +// "CLIP_SOFT": "S", "CLIP_HARD": "H", "PAD": "P", "SEQUENCE_MATCH": +// "=", "SEQUENCE_MISMATCH": "X", } cigarStr = "" for c in +// read.alignment.cigar { cigarStr += c.operationLength + +// cigarMap[c.operation] } return cigarStr +type Read struct { + // AlignedQuality: The quality of the read sequence contained in this + // alignment record. `alignedSequence` and `alignedQuality` may be + // shorter than the full read sequence and quality. This will occur if + // the alignment is part of a chimeric alignment, or if the read was + // trimmed. When this occurs, the CIGAR for this read will begin/end + // with a hard clip operator that will indicate the length of the + // excised sequence. + AlignedQuality []int64 `json:"alignedQuality,omitempty"` + + // AlignedSequence: The bases of the read sequence contained in this + // alignment record, *without CIGAR operations applied*. + // `alignedSequence` and `alignedQuality` may be shorter than the full + // read sequence and quality. This will occur if the alignment is part + // of a chimeric alignment, or if the read was trimmed. When this + // occurs, the CIGAR for this read will begin/end with a hard clip + // operator that will indicate the length of the excised sequence. + AlignedSequence string `json:"alignedSequence,omitempty"` + + // Alignment: The linear alignment for this alignment record. This field + // will be null if the read is unmapped. + Alignment *LinearAlignment `json:"alignment,omitempty"` + + // DuplicateFragment: The fragment is a PCR or optical duplicate (SAM + // flag 0x400) + DuplicateFragment bool `json:"duplicateFragment,omitempty"` + + // FailedVendorQualityChecks: SAM flag 0x200 + FailedVendorQualityChecks bool `json:"failedVendorQualityChecks,omitempty"` + + // FragmentLength: The observed length of the fragment, equivalent to + // TLEN in SAM. + FragmentLength int64 `json:"fragmentLength,omitempty"` + + // FragmentName: The fragment name. Equivalent to QNAME (query template + // name) in SAM. + FragmentName string `json:"fragmentName,omitempty"` + + // Id: The server-generated read ID, unique across all reads. This is + // different from the `fragmentName`. + Id string `json:"id,omitempty"` + + // Info: A map of additional read alignment information. This must be of + // the form map (string key mapping to a list of string values). + Info *ReadInfo `json:"info,omitempty"` + + // NextMatePosition: The mapping of the primary alignment of the + // `(readNumber+1)%numberReads` read in the fragment. It replaces mate + // position and mate strand in SAM. + NextMatePosition *Position `json:"nextMatePosition,omitempty"` + + // NumberReads: The number of reads in the fragment (extension to SAM + // flag 0x1). + NumberReads int64 `json:"numberReads,omitempty"` + + // ProperPlacement: The orientation and the distance between reads from + // the fragment are consistent with the sequencing protocol (SAM flag + // 0x2) + ProperPlacement bool `json:"properPlacement,omitempty"` + + // ReadGroupId: The ID of the read group this read belongs to. (Every + // read must belong to exactly one read group.) + ReadGroupId string `json:"readGroupId,omitempty"` + + // ReadGroupSetId: The ID of the read group set this read belongs to. + // (Every read must belong to exactly one read group set.) + ReadGroupSetId string `json:"readGroupSetId,omitempty"` + + // ReadNumber: The read number in sequencing. 0-based and less than + // numberReads. This field replaces SAM flag 0x40 and 0x80. + ReadNumber int64 `json:"readNumber,omitempty"` + + // SecondaryAlignment: Whether this alignment is secondary. Equivalent + // to SAM flag 0x100. A secondary alignment represents an alternative to + // the primary alignment for this read. Aligners may return secondary + // alignments if a read can map ambiguously to multiple coordinates in + // the genome. By convention, each read has one and only one alignment + // where both `secondaryAlignment` and `supplementaryAlignment` are + // false. + SecondaryAlignment bool `json:"secondaryAlignment,omitempty"` + + // SupplementaryAlignment: Whether this alignment is supplementary. + // Equivalent to SAM flag 0x800. Supplementary alignments are used in + // the representation of a chimeric alignment. In a chimeric alignment, + // a read is split into multiple linear alignments that map to different + // reference contigs. The first linear alignment in the read will be + // designated as the representative alignment; the remaining linear + // alignments will be designated as supplementary alignments. These + // alignments may have different mapping quality scores. In each linear + // alignment in a chimeric alignment, the read will be hard clipped. The + // `alignedSequence` and `alignedQuality` fields in the alignment record + // will only represent the bases for its respective linear alignment. + SupplementaryAlignment bool `json:"supplementaryAlignment,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AlignedQuality") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Read) MarshalJSON() ([]byte, error) { + type noMethod Read + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReadInfo: A map of additional read alignment information. This must +// be of the form map (string key mapping to a list of string values). +type ReadInfo struct { +} + +// ReadGroup: A read group is all the data that's processed the same way +// by the sequencer. +type ReadGroup struct { + // DatasetId: The ID of the dataset this read group belongs to. + DatasetId string `json:"datasetId,omitempty"` + + // Description: A free-form text description of this read group. + Description string `json:"description,omitempty"` + + // Experiment: The experiment used to generate this read group. + Experiment *Experiment `json:"experiment,omitempty"` + + // Id: The server-generated read group ID, unique for all read groups. + // Note: This is different than the `@RG ID` field in the SAM spec. For + // that value, see the `name` field. + Id string `json:"id,omitempty"` + + // Info: A map of additional read group information. This must be of the + // form map (string key mapping to a list of string values). + Info *ReadGroupInfo `json:"info,omitempty"` + + // Name: The read group name. This corresponds to the @RG ID field in + // the SAM spec. + Name string `json:"name,omitempty"` + + // PredictedInsertSize: The predicted insert size of this read group. + // The insert size is the length the sequenced DNA fragment from + // end-to-end, not including the adapters. + PredictedInsertSize int64 `json:"predictedInsertSize,omitempty"` + + // Programs: The programs used to generate this read group. Programs are + // always identical for all read groups within a read group set. For + // this reason, only the first read group in a returned set will have + // this field populated. + Programs []*Program `json:"programs,omitempty"` + + // ReferenceSetId: The reference set the reads in this read group are + // aligned to. Required if there are any read alignments. + ReferenceSetId string `json:"referenceSetId,omitempty"` + + // SampleId: The sample this read group's data was generated from. Note: + // This is not an actual ID within this repository, but rather an + // identifier for a sample which may be meaningful to some external + // system. + SampleId string `json:"sampleId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DatasetId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReadGroup) MarshalJSON() ([]byte, error) { + type noMethod ReadGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReadGroupInfo: A map of additional read group information. This must +// be of the form map (string key mapping to a list of string values). +type ReadGroupInfo struct { +} + +// ReadGroupSet: A read group set is a logical collection of read +// groups, which are collections of reads produced by a sequencer. A +// read group set typically models reads corresponding to one sample, +// sequenced one way, and aligned one way. * A read group set belongs to +// one dataset. * A read group belongs to one read group set. * A read +// belongs to one read group. +type ReadGroupSet struct { + // DatasetId: The dataset ID. + DatasetId string `json:"datasetId,omitempty"` + + // Filename: The filename of the original source file for this read + // group set, if any. + Filename string `json:"filename,omitempty"` + + // Id: The server-generated read group set ID, unique for all read group + // sets. + Id string `json:"id,omitempty"` + + // Info: A map of additional read group set information. + Info *ReadGroupSetInfo `json:"info,omitempty"` + + // Name: The read group set name. By default this will be initialized to + // the sample name of the sequenced data contained in this set. + Name string `json:"name,omitempty"` + + // ReadGroups: The read groups in this set. There are typically 1-10 + // read groups in a read group set. + ReadGroups []*ReadGroup `json:"readGroups,omitempty"` + + // ReferenceSetId: The reference set the reads in this read group set + // are aligned to. + ReferenceSetId string `json:"referenceSetId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DatasetId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReadGroupSet) MarshalJSON() ([]byte, error) { + type noMethod ReadGroupSet + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReadGroupSetInfo: A map of additional read group set information. +type ReadGroupSetInfo struct { +} + +// Reference: A reference is a canonical assembled DNA sequence, +// intended to act as a reference coordinate space for other genomic +// annotations. A single reference might represent the human chromosome +// 1 or mitochandrial DNA, for instance. A reference belongs to one or +// more reference sets. +type Reference struct { + // Id: The server-generated reference ID, unique across all references. + Id string `json:"id,omitempty"` + + // Length: The length of this reference's sequence. + Length int64 `json:"length,omitempty,string"` + + // Md5checksum: MD5 of the upper-case sequence excluding all whitespace + // characters (this is equivalent to SQ:M5 in SAM). This value is + // represented in lower case hexadecimal format. + Md5checksum string `json:"md5checksum,omitempty"` + + // Name: The name of this reference, for example `22`. + Name string `json:"name,omitempty"` + + // NcbiTaxonId: ID from http://www.ncbi.nlm.nih.gov/taxonomy (e.g. + // 9606->human) if not specified by the containing reference set. + NcbiTaxonId int64 `json:"ncbiTaxonId,omitempty"` + + // SourceAccessions: All known corresponding accession IDs in INSDC + // (GenBank/ENA/DDBJ) ideally with a version number, for example + // `GCF_000001405.26`. + SourceAccessions []string `json:"sourceAccessions,omitempty"` + + // SourceUri: The URI from which the sequence was obtained. Specifies a + // FASTA format file/string with one name, sequence pair. + SourceUri string `json:"sourceUri,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Reference) MarshalJSON() ([]byte, error) { + type noMethod Reference + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReferenceBound: ReferenceBound records an upper bound for the +// starting coordinate of variants in a particular reference. +type ReferenceBound struct { + // ReferenceName: The reference the bound is associate with. + ReferenceName string `json:"referenceName,omitempty"` + + // UpperBound: An upper bound (inclusive) on the starting coordinate of + // any variant in the reference sequence. + UpperBound int64 `json:"upperBound,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "ReferenceName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReferenceBound) MarshalJSON() ([]byte, error) { + type noMethod ReferenceBound + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReferenceSet: A reference set is a set of references which typically +// comprise a reference assembly for a species, such as `GRCh38` which +// is representative of the human genome. A reference set defines a +// common coordinate space for comparing reference-aligned experimental +// data. A reference set contains 1 or more references. +type ReferenceSet struct { + // AssemblyId: Public id of this reference set, such as `GRCh37`. + AssemblyId string `json:"assemblyId,omitempty"` + + // Description: Free text description of this reference set. + Description string `json:"description,omitempty"` + + // Id: The server-generated reference set ID, unique across all + // reference sets. + Id string `json:"id,omitempty"` + + // Md5checksum: Order-independent MD5 checksum which identifies this + // reference set. The checksum is computed by sorting all lower case + // hexidecimal string `reference.md5checksum` (for all reference in this + // set) in ascending lexicographic order, concatenating, and taking the + // MD5 of that value. The resulting value is represented in lower case + // hexadecimal format. + Md5checksum string `json:"md5checksum,omitempty"` + + // NcbiTaxonId: ID from http://www.ncbi.nlm.nih.gov/taxonomy (e.g. + // 9606->human) indicating the species which this assembly is intended + // to model. Note that contained references may specify a different + // `ncbiTaxonId`, as assemblies may contain reference sequences which do + // not belong to the modeled species, e.g. EBV in a human reference + // genome. + NcbiTaxonId int64 `json:"ncbiTaxonId,omitempty"` + + // ReferenceIds: The IDs of the reference objects that are part of this + // set. `Reference.md5checksum` must be unique within this set. + ReferenceIds []string `json:"referenceIds,omitempty"` + + // SourceAccessions: All known corresponding accession IDs in INSDC + // (GenBank/ENA/DDBJ) ideally with a version number, for example + // `NC_000001.11`. + SourceAccessions []string `json:"sourceAccessions,omitempty"` + + // SourceUri: The URI from which the references were obtained. + SourceUri string `json:"sourceUri,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AssemblyId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReferenceSet) MarshalJSON() ([]byte, error) { + type noMethod ReferenceSet + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SearchCallSetsRequest: The call set search request. +type SearchCallSetsRequest struct { + // Name: Only return call sets for which a substring of the name matches + // this string. + Name string `json:"name,omitempty"` + + // PageSize: The maximum number of call sets to return. If unspecified, + // defaults to 1000. + PageSize int64 `json:"pageSize,omitempty"` + + // 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. + PageToken string `json:"pageToken,omitempty"` + + // VariantSetIds: Restrict the query to call sets within the given + // variant sets. At least one ID must be provided. + VariantSetIds []string `json:"variantSetIds,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchCallSetsRequest) MarshalJSON() ([]byte, error) { + type noMethod SearchCallSetsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SearchCallSetsResponse: The call set search response. +type SearchCallSetsResponse struct { + // CallSets: The list of matching call sets. + CallSets []*CallSet `json:"callSets,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. This field will be empty if there + // aren't any additional results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CallSets") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchCallSetsResponse) MarshalJSON() ([]byte, error) { + type noMethod SearchCallSetsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SearchReadGroupSetsRequest: The read group set search request. +type SearchReadGroupSetsRequest struct { + // DatasetIds: Restricts this query to read group sets within the given + // datasets. At least one ID must be provided. + DatasetIds []string `json:"datasetIds,omitempty"` + + // Name: Only return read group sets for which a substring of the name + // matches this string. + Name string `json:"name,omitempty"` + + // PageSize: Specifies number of results to return in a single page. If + // unspecified, it will default to 256. The maximum value is 1024. + PageSize int64 `json:"pageSize,omitempty"` + + // 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. + PageToken string `json:"pageToken,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DatasetIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchReadGroupSetsRequest) MarshalJSON() ([]byte, error) { + type noMethod SearchReadGroupSetsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SearchReadGroupSetsResponse: The read group set search response. +type SearchReadGroupSetsResponse struct { + // 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. This field will be empty if there + // aren't any additional results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ReadGroupSets: The list of matching read group sets. + ReadGroupSets []*ReadGroupSet `json:"readGroupSets,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchReadGroupSetsResponse) MarshalJSON() ([]byte, error) { + type noMethod SearchReadGroupSetsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SearchReadsRequest: The read search request. +type SearchReadsRequest struct { + // End: The end position of the range on the reference, 0-based + // exclusive. If specified, `referenceName` must also be specified. + End int64 `json:"end,omitempty,string"` + + // PageSize: Specifies number of results to return in a single page. If + // unspecified, it will default to 256. The maximum value is 2048. + PageSize int64 `json:"pageSize,omitempty"` + + // 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. + PageToken string `json:"pageToken,omitempty"` + + // ReadGroupIds: The IDs of the read groups within which to search for + // reads. All specified read groups must belong to the same read group + // sets. Must specify one of `readGroupSetIds` or `readGroupIds`. + ReadGroupIds []string `json:"readGroupIds,omitempty"` + + // ReadGroupSetIds: The IDs of the read groups sets within which to + // search for reads. All specified read group sets must be aligned + // against a common set of reference sequences; this defines the genomic + // coordinates for the query. Must specify one of `readGroupSetIds` or + // `readGroupIds`. + ReadGroupSetIds []string `json:"readGroupSetIds,omitempty"` + + // ReferenceName: The reference sequence name, for example `chr1`, `1`, + // or `chrX`. If set to *, only unmapped reads are returned. + ReferenceName string `json:"referenceName,omitempty"` + + // Start: The start position of the range on the reference, 0-based + // inclusive. If specified, `referenceName` must also be specified. + Start int64 `json:"start,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "End") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchReadsRequest) MarshalJSON() ([]byte, error) { + type noMethod SearchReadsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SearchReadsResponse: The read search response. +type SearchReadsResponse struct { + // Alignments: The list of matching alignments sorted by mapped genomic + // coordinate, if any, ascending in position within the same reference. + // Unmapped reads, which have no position, are returned contiguously and + // are sorted in ascending lexicographic order by fragment name. + Alignments []*Read `json:"alignments,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. This field will be empty if there + // aren't any additional results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Alignments") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchReadsResponse) MarshalJSON() ([]byte, error) { + type noMethod SearchReadsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type SearchReferenceSetsRequest struct { + // Accessions: If present, return references for which the accession + // matches any of these strings. Best to give a version number, for + // example `GCF_000001405.26`. If only the main accession number is + // given then all records with that main accession will be returned, + // whichever version. Note that different versions will have different + // sequences. + Accessions []string `json:"accessions,omitempty"` + + // AssemblyId: If present, return reference sets for which a substring + // of their `assemblyId` matches this string (case insensitive). + AssemblyId string `json:"assemblyId,omitempty"` + + // Md5checksums: If present, return references for which the + // `md5checksum` matches. See `ReferenceSet.md5checksum` for details. + Md5checksums []string `json:"md5checksums,omitempty"` + + // PageSize: Specifies the maximum number of results to return in a + // single page. + PageSize int64 `json:"pageSize,omitempty"` + + // 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. + PageToken string `json:"pageToken,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Accessions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchReferenceSetsRequest) MarshalJSON() ([]byte, error) { + type noMethod SearchReferenceSetsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type SearchReferenceSetsResponse struct { + // 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. This field will be empty if there + // aren't any additional results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ReferenceSets: The matching references sets. + ReferenceSets []*ReferenceSet `json:"referenceSets,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchReferenceSetsResponse) MarshalJSON() ([]byte, error) { + type noMethod SearchReferenceSetsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type SearchReferencesRequest struct { + // Accessions: If present, return references for which the accession + // matches this string. Best to give a version number, for example + // `GCF_000001405.26`. If only the main accession number is given then + // all records with that main accession will be returned, whichever + // version. Note that different versions will have different sequences. + Accessions []string `json:"accessions,omitempty"` + + // Md5checksums: If present, return references for which the + // `md5checksum` matches. See `Reference.md5checksum` for construction + // details. + Md5checksums []string `json:"md5checksums,omitempty"` + + // PageSize: Specifies the maximum number of results to return in a + // single page. + PageSize int64 `json:"pageSize,omitempty"` + + // 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. + PageToken string `json:"pageToken,omitempty"` + + // ReferenceSetId: If present, return only references which belong to + // this reference set. + ReferenceSetId string `json:"referenceSetId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Accessions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchReferencesRequest) MarshalJSON() ([]byte, error) { + type noMethod SearchReferencesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type SearchReferencesResponse struct { + // 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. This field will be empty if there + // aren't any additional results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // References: The matching references. + References []*Reference `json:"references,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchReferencesResponse) MarshalJSON() ([]byte, error) { + type noMethod SearchReferencesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SearchVariantSetsRequest: The search variant sets request. +type SearchVariantSetsRequest struct { + // DatasetIds: Exactly one dataset ID must be provided here. Only + // variant sets which belong to this dataset will be returned. + DatasetIds []string `json:"datasetIds,omitempty"` + + // PageSize: The maximum number of variant sets to return in a request. + PageSize int64 `json:"pageSize,omitempty"` + + // 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. + PageToken string `json:"pageToken,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DatasetIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchVariantSetsRequest) MarshalJSON() ([]byte, error) { + type noMethod SearchVariantSetsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SearchVariantSetsResponse: The search variant sets response. +type SearchVariantSetsResponse struct { + // 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. This field will be empty if there + // aren't any additional results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // VariantSets: The variant sets belonging to the requested dataset. + VariantSets []*VariantSet `json:"variantSets,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchVariantSetsResponse) MarshalJSON() ([]byte, error) { + type noMethod SearchVariantSetsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SearchVariantsRequest: The variant search request. +type SearchVariantsRequest struct { + // CallSetIds: Only return variant calls which belong to call sets with + // these ids. Leaving this blank returns all variant calls. If a variant + // has no calls belonging to any of these call sets, it won't be + // returned at all. Currently, variants with no calls from any call set + // will never be returned. + CallSetIds []string `json:"callSetIds,omitempty"` + + // End: The end of the window, 0-based exclusive. If unspecified or 0, + // defaults to the length of the reference. + End int64 `json:"end,omitempty,string"` + + // MaxCalls: The maximum number of calls to return. However, at least + // one variant will always be returned, even if it has more calls than + // this limit. If unspecified, defaults to 5000. + MaxCalls int64 `json:"maxCalls,omitempty"` + + // PageSize: The maximum number of variants to return. If unspecified, + // defaults to 5000. + PageSize int64 `json:"pageSize,omitempty"` + + // 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. + PageToken string `json:"pageToken,omitempty"` + + // ReferenceName: Required. Only return variants in this reference + // sequence. + ReferenceName string `json:"referenceName,omitempty"` + + // Start: The beginning of the window (0-based, inclusive) for which + // overlapping variants should be returned. If unspecified, defaults to + // 0. + Start int64 `json:"start,omitempty,string"` + + // VariantName: Only return variants which have exactly this name. + VariantName string `json:"variantName,omitempty"` + + // VariantSetIds: At most one variant set ID must be provided. Only + // variants from this variant set will be returned. If omitted, a call + // set id must be included in the request. + VariantSetIds []string `json:"variantSetIds,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CallSetIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchVariantsRequest) MarshalJSON() ([]byte, error) { + type noMethod SearchVariantsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SearchVariantsResponse: The variant search response. +type SearchVariantsResponse struct { + // 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. This field will be empty if there + // aren't any additional results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Variants: The list of matching Variants. + Variants []*Variant `json:"variants,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchVariantsResponse) MarshalJSON() ([]byte, error) { + type noMethod SearchVariantsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SetIamPolicyRequest: Request message for `SetIamPolicy` method. +type SetIamPolicyRequest struct { + // Policy: REQUIRED: The complete policy to be applied to the + // `resource`. The size of the policy is limited to a few 10s of KB. An + // empty policy is a valid policy but certain Cloud Platform services + // (such as Projects) might reject them. + Policy *Policy `json:"policy,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Policy") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { + type noMethod SetIamPolicyRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Status: The `Status` type defines a logical error model that is +// suitable for different programming environments, including REST APIs +// and RPC APIs. It is used by [gRPC](https://github.com/grpc). The +// error model is designed to be: - Simple to use and understand for +// most users - Flexible enough to meet unexpected needs # Overview The +// `Status` message contains three pieces of data: error code, error +// message, and error details. The error code should be an enum value of +// google.rpc.Code, but it may accept additional error codes if needed. +// The error message should be a developer-facing English message that +// helps developers *understand* and *resolve* the error. If a localized +// user-facing error message is needed, put the localized message in the +// error details or localize it in the client. The optional error +// details may contain arbitrary information about the error. There is a +// predefined set of error detail types in the package `google.rpc` +// which can be used for common error conditions. # Language mapping The +// `Status` message is the logical representation of the error model, +// but it is not necessarily the actual wire format. When the `Status` +// message is exposed in different client libraries and different wire +// protocols, it can be mapped differently. For example, it will likely +// be mapped to some exceptions in Java, but more likely mapped to some +// error codes in C. # Other uses The error model and the `Status` +// message can be used in a variety of environments, either with or +// without APIs, to provide a consistent developer experience across +// different environments. Example uses of this error model include: - +// Partial errors. If a service needs to return partial errors to the +// client, it may embed the `Status` in the normal response to indicate +// the partial errors. - Workflow errors. A typical workflow has +// multiple steps. Each step may have a `Status` message for error +// reporting purpose. - Batch operations. If a client uses batch request +// and batch response, the `Status` message should be used directly +// inside batch response, one for each error sub-response. - +// Asynchronous operations. If an API call embeds asynchronous operation +// results in its response, the status of those operations should be +// represented directly using the `Status` message. - Logging. If some +// API errors are stored in logs, the message `Status` could be used +// directly after any stripping needed for security/privacy reasons. +type Status struct { + // Code: The status code, which should be an enum value of + // google.rpc.Code. + Code int64 `json:"code,omitempty"` + + // Details: A list of messages that carry the error details. There will + // be a common set of message types for APIs to use. + Details []StatusDetails `json:"details,omitempty"` + + // Message: A developer-facing error message, which should be in + // English. Any user-facing error message should be localized and sent + // in the google.rpc.Status.details field, or localized by the client. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Status) MarshalJSON() ([]byte, error) { + type noMethod Status + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type StatusDetails interface{} + +// TestIamPermissionsRequest: Request message for `TestIamPermissions` +// method. +type TestIamPermissionsRequest struct { + // Permissions: REQUIRED: The set of permissions to check for the + // 'resource'. Permissions with wildcards (such as '*' or 'storage.*') + // are not allowed. Allowed permissions are: * + // `genomics.datasets.create` * `genomics.datasets.delete` * + // `genomics.datasets.get` * `genomics.datasets.list` * + // `genomics.datasets.update` * `genomics.datasets.getIamPolicy` * + // `genomics.datasets.setIamPolicy` + Permissions []string `json:"permissions,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Permissions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) { + type noMethod TestIamPermissionsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TestIamPermissionsResponse: Response message for `TestIamPermissions` +// method. +type TestIamPermissionsResponse struct { + // Permissions: A subset of `TestPermissionsRequest.permissions` that + // the caller is allowed. + Permissions []string `json:"permissions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Permissions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { + type noMethod TestIamPermissionsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type UndeleteDatasetRequest struct { +} + +// Variant: A variant represents a change in DNA sequence relative to a +// reference sequence. For example, a variant could represent a SNP or +// an insertion. Variants belong to a variant set. Each of the calls on +// a variant represent a determination of genotype with respect to that +// variant. For example, a call might assign probability of 0.32 to the +// occurrence of a SNP named rs1234 in a sample named NA12345. A call +// belongs to a call set, which contains related calls typically from +// one sample. +type Variant struct { + // AlternateBases: The bases that appear instead of the reference bases. + AlternateBases []string `json:"alternateBases,omitempty"` + + // Calls: The variant calls for this particular variant. Each one + // represents the determination of genotype with respect to this + // variant. + Calls []*VariantCall `json:"calls,omitempty"` + + // Created: The date this variant was created, in milliseconds from the + // epoch. + Created int64 `json:"created,omitempty,string"` + + // End: The end position (0-based) of this variant. This corresponds to + // the first base after the last base in the reference allele. So, the + // length of the reference allele is (end - start). This is useful for + // variants that don't explicitly give alternate bases, for example + // large deletions. + End int64 `json:"end,omitempty,string"` + + // Filter: A list of filters (normally quality filters) this variant has + // failed. `PASS` indicates this variant has passed all filters. + Filter []string `json:"filter,omitempty"` + + // Id: The server-generated variant ID, unique across all variants. + Id string `json:"id,omitempty"` + + // Info: A map of additional variant information. This must be of the + // form map (string key mapping to a list of string values). + Info *VariantInfo `json:"info,omitempty"` + + // Names: Names for the variant, for example a RefSNP ID. + Names []string `json:"names,omitempty"` + + // Quality: A measure of how likely this variant is to be real. A higher + // value is better. + Quality float64 `json:"quality,omitempty"` + + // ReferenceBases: The reference bases for this variant. They start at + // the given position. + ReferenceBases string `json:"referenceBases,omitempty"` + + // ReferenceName: The reference on which this variant occurs. (such as + // `chr20` or `X`) + ReferenceName string `json:"referenceName,omitempty"` + + // Start: The position at which this variant occurs (0-based). This + // corresponds to the first base of the string of reference bases. + Start int64 `json:"start,omitempty,string"` + + // VariantSetId: The ID of the variant set this variant belongs to. + VariantSetId string `json:"variantSetId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AlternateBases") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Variant) MarshalJSON() ([]byte, error) { + type noMethod Variant + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VariantInfo: A map of additional variant information. This must be of +// the form map (string key mapping to a list of string values). +type VariantInfo struct { +} + +// VariantCall: A call represents the determination of genotype with +// respect to a particular variant. It may include associated +// information such as quality and phasing. For example, a call might +// assign a probability of 0.32 to the occurrence of a SNP named rs1234 +// in a call set with the name NA12345. +type VariantCall struct { + // CallSetId: The ID of the call set this variant call belongs to. + CallSetId string `json:"callSetId,omitempty"` + + // CallSetName: The name of the call set this variant call belongs to. + CallSetName string `json:"callSetName,omitempty"` + + // Genotype: The genotype of this variant call. Each value represents + // either the value of the `referenceBases` field or a 1-based index + // into `alternateBases`. If a variant had a `referenceBases` value of + // `T` and an `alternateBases` value of `["A", "C"]`, and the `genotype` + // was `[2, 1]`, that would mean the call represented the heterozygous + // value `CA` for this variant. If the `genotype` was instead `[0, 1]`, + // the represented value would be `TA`. Ordering of the genotype values + // is important if the `phaseset` is present. If a genotype is not + // called (that is, a `.` is present in the GT string) -1 is returned. + Genotype []int64 `json:"genotype,omitempty"` + + // GenotypeLikelihood: The genotype likelihoods for this variant call. + // Each array entry represents how likely a specific genotype is for + // this call. The value ordering is defined by the GL tag in the VCF + // spec. If Phred-scaled genotype likelihood scores (PL) are available + // and log10(P) genotype likelihood scores (GL) are not, PL scores are + // converted to GL scores. If both are available, PL scores are stored + // in `info`. + GenotypeLikelihood []float64 `json:"genotypeLikelihood,omitempty"` + + // Info: A map of additional variant call information. This must be of + // the form map (string key mapping to a list of string values). + Info *VariantCallInfo `json:"info,omitempty"` + + // Phaseset: If this field is present, this variant call's genotype + // ordering implies the phase of the bases and is consistent with any + // other variant calls in the same reference sequence which have the + // same phaseset value. When importing data from VCF, if the genotype + // data was phased but no phase set was specified this field will be set + // to `*`. + Phaseset string `json:"phaseset,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CallSetId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VariantCall) MarshalJSON() ([]byte, error) { + type noMethod VariantCall + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VariantCallInfo: A map of additional variant call information. This +// must be of the form map (string key mapping to a list of string +// values). +type VariantCallInfo struct { +} + +// VariantSet: A variant set is a collection of call sets and variants. +// It contains summary statistics of those contents. A variant set +// belongs to a dataset. +type VariantSet struct { + // DatasetId: The dataset to which this variant set belongs. + DatasetId string `json:"datasetId,omitempty"` + + // Id: The server-generated variant set ID, unique across all variant + // sets. + Id string `json:"id,omitempty"` + + // Metadata: The metadata associated with this variant set. + Metadata []*VariantSetMetadata `json:"metadata,omitempty"` + + // ReferenceBounds: A list of all references used by the variants in a + // variant set with associated coordinate upper bounds for each one. + ReferenceBounds []*ReferenceBound `json:"referenceBounds,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DatasetId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VariantSet) MarshalJSON() ([]byte, error) { + type noMethod VariantSet + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VariantSetMetadata: Metadata describes a single piece of variant call +// metadata. These data include a top level key and either a single +// value string (value) or a list of key-value pairs (info.) Value and +// info are mutually exclusive. +type VariantSetMetadata struct { + // Description: A textual description of this metadata. + Description string `json:"description,omitempty"` + + // Id: User-provided ID field, not enforced by this API. Two or more + // pieces of structured metadata with identical id and key fields are + // considered equivalent. + Id string `json:"id,omitempty"` + + // Info: Remaining structured metadata key-value pairs. This must be of + // the form map (string key mapping to a list of string values). + Info *VariantSetMetadataInfo `json:"info,omitempty"` + + // Key: The top-level key. + Key string `json:"key,omitempty"` + + // Number: The number of values that can be included in a field + // described by this metadata. + Number string `json:"number,omitempty"` + + // Type: The type of data. Possible types include: Integer, Float, Flag, + // Character, and String. + // + // Possible values: + // "TYPE_UNSPECIFIED" + // "INTEGER" + // "FLOAT" + // "FLAG" + // "CHARACTER" + // "STRING" + Type string `json:"type,omitempty"` + + // Value: The value field for simple metadata + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VariantSetMetadata) MarshalJSON() ([]byte, error) { + type noMethod VariantSetMetadata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VariantSetMetadataInfo: Remaining structured metadata key-value +// pairs. This must be of the form map (string key mapping to a list of +// string values). +type VariantSetMetadataInfo struct { +} + +// method id "genomics.callsets.create": + +type CallsetsCreateCall struct { + s *Service + callset *CallSet + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a new call set. +func (r *CallsetsService) Create(callset *CallSet) *CallsetsCreateCall { + c := &CallsetsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.callset = callset + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CallsetsCreateCall) Fields(s ...googleapi.Field) *CallsetsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CallsetsCreateCall) Context(ctx context.Context) *CallsetsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *CallsetsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.callset) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/callsets") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.callsets.create" call. +// Exactly one of *CallSet or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *CallSet.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CallsetsCreateCall) Do() (*CallSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CallSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new call set.", + // "httpMethod": "POST", + // "id": "genomics.callsets.create", + // "path": "v1/callsets", + // "request": { + // "$ref": "CallSet" + // }, + // "response": { + // "$ref": "CallSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.callsets.delete": + +type CallsetsDeleteCall struct { + s *Service + callSetId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a call set. +func (r *CallsetsService) Delete(callSetId string) *CallsetsDeleteCall { + c := &CallsetsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.callSetId = callSetId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CallsetsDeleteCall) Fields(s ...googleapi.Field) *CallsetsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CallsetsDeleteCall) Context(ctx context.Context) *CallsetsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *CallsetsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/callsets/{callSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "callSetId": c.callSetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.callsets.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CallsetsDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a call set.", + // "httpMethod": "DELETE", + // "id": "genomics.callsets.delete", + // "parameterOrder": [ + // "callSetId" + // ], + // "parameters": { + // "callSetId": { + // "description": "The ID of the call set to be deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/callsets/{callSetId}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.callsets.get": + +type CallsetsGetCall struct { + s *Service + callSetId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a call set by ID. +func (r *CallsetsService) Get(callSetId string) *CallsetsGetCall { + c := &CallsetsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.callSetId = callSetId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CallsetsGetCall) Fields(s ...googleapi.Field) *CallsetsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CallsetsGetCall) IfNoneMatch(entityTag string) *CallsetsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CallsetsGetCall) Context(ctx context.Context) *CallsetsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CallsetsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/callsets/{callSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "callSetId": c.callSetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.callsets.get" call. +// Exactly one of *CallSet or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *CallSet.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CallsetsGetCall) Do() (*CallSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CallSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a call set by ID.", + // "httpMethod": "GET", + // "id": "genomics.callsets.get", + // "parameterOrder": [ + // "callSetId" + // ], + // "parameters": { + // "callSetId": { + // "description": "The ID of the call set.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/callsets/{callSetId}", + // "response": { + // "$ref": "CallSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.callsets.patch": + +type CallsetsPatchCall struct { + s *Service + callSetId string + callset *CallSet + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates a call set. This method supports patch semantics. +func (r *CallsetsService) Patch(callSetId string, callset *CallSet) *CallsetsPatchCall { + c := &CallsetsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.callSetId = callSetId + c.callset = callset + return c +} + +// UpdateMask sets the optional parameter "updateMask": An optional mask +// specifying which fields to update. At this time, the only mutable +// field is name. The only acceptable value is "name". If unspecified, +// all mutable fields will be updated. +func (c *CallsetsPatchCall) UpdateMask(updateMask string) *CallsetsPatchCall { + c.opt_["updateMask"] = updateMask + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CallsetsPatchCall) Fields(s ...googleapi.Field) *CallsetsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CallsetsPatchCall) Context(ctx context.Context) *CallsetsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CallsetsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.callset) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["updateMask"]; ok { + params.Set("updateMask", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/callsets/{callSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "callSetId": c.callSetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.callsets.patch" call. +// Exactly one of *CallSet or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *CallSet.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CallsetsPatchCall) Do() (*CallSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CallSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a call set. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "genomics.callsets.patch", + // "parameterOrder": [ + // "callSetId" + // ], + // "parameters": { + // "callSetId": { + // "description": "The ID of the call set to be updated.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "An optional mask specifying which fields to update. At this time, the only mutable field is name. The only acceptable value is \"name\". If unspecified, all mutable fields will be updated.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/callsets/{callSetId}", + // "request": { + // "$ref": "CallSet" + // }, + // "response": { + // "$ref": "CallSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.callsets.search": + +type CallsetsSearchCall struct { + s *Service + searchcallsetsrequest *SearchCallSetsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Search: Gets a list of call sets matching the criteria. Implements +// [GlobalAllianceApi.searchCallSets](https://github.com/ga4gh/schemas/bl +// ob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L178). +func (r *CallsetsService) Search(searchcallsetsrequest *SearchCallSetsRequest) *CallsetsSearchCall { + c := &CallsetsSearchCall{s: r.s, opt_: make(map[string]interface{})} + c.searchcallsetsrequest = searchcallsetsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CallsetsSearchCall) Fields(s ...googleapi.Field) *CallsetsSearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CallsetsSearchCall) Context(ctx context.Context) *CallsetsSearchCall { + c.ctx_ = ctx + return c +} + +func (c *CallsetsSearchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchcallsetsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/callsets/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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.callsets.search" call. +// Exactly one of *SearchCallSetsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SearchCallSetsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CallsetsSearchCall) Do() (*SearchCallSetsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SearchCallSetsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a list of call sets matching the criteria. Implements [GlobalAllianceApi.searchCallSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L178).", + // "httpMethod": "POST", + // "id": "genomics.callsets.search", + // "path": "v1/callsets/search", + // "request": { + // "$ref": "SearchCallSetsRequest" + // }, + // "response": { + // "$ref": "SearchCallSetsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.datasets.create": + +type DatasetsCreateCall struct { + s *Service + dataset *Dataset + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a new dataset. +func (r *DatasetsService) Create(dataset *Dataset) *DatasetsCreateCall { + c := &DatasetsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.dataset = dataset + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsCreateCall) Fields(s ...googleapi.Field) *DatasetsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsCreateCall) Context(ctx context.Context) *DatasetsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsCreateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/datasets") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.datasets.create" call. +// Exactly one of *Dataset or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Dataset.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *DatasetsCreateCall) Do() (*Dataset, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Dataset{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new dataset.", + // "httpMethod": "POST", + // "id": "genomics.datasets.create", + // "path": "v1/datasets", + // "request": { + // "$ref": "Dataset" + // }, + // "response": { + // "$ref": "Dataset" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.datasets.delete": + +type DatasetsDeleteCall struct { + s *Service + datasetId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a dataset. +func (r *DatasetsService) Delete(datasetId string) *DatasetsDeleteCall { + c := &DatasetsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.datasetId = datasetId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsDeleteCall) Fields(s ...googleapi.Field) *DatasetsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsDeleteCall) Context(ctx context.Context) *DatasetsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/datasets/{datasetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "datasetId": c.datasetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.datasets.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *DatasetsDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a dataset.", + // "httpMethod": "DELETE", + // "id": "genomics.datasets.delete", + // "parameterOrder": [ + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "The ID of the dataset to be deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/datasets/{datasetId}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.datasets.get": + +type DatasetsGetCall struct { + s *Service + datasetId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a dataset by ID. +func (r *DatasetsService) Get(datasetId string) *DatasetsGetCall { + c := &DatasetsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.datasetId = datasetId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsGetCall) Fields(s ...googleapi.Field) *DatasetsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DatasetsGetCall) IfNoneMatch(entityTag string) *DatasetsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsGetCall) Context(ctx context.Context) *DatasetsGetCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/datasets/{datasetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "datasetId": c.datasetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.datasets.get" call. +// Exactly one of *Dataset or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Dataset.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *DatasetsGetCall) Do() (*Dataset, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Dataset{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a dataset by ID.", + // "httpMethod": "GET", + // "id": "genomics.datasets.get", + // "parameterOrder": [ + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "The ID of the dataset.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/datasets/{datasetId}", + // "response": { + // "$ref": "Dataset" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.datasets.getIamPolicy": + +type DatasetsGetIamPolicyCall struct { + s *Service + resource string + getiampolicyrequest *GetIamPolicyRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetIamPolicy: Gets the access control policy for the dataset. Is +// empty if the policy or the resource does not exist. See Getting a +// Policy for more information. +func (r *DatasetsService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *DatasetsGetIamPolicyCall { + c := &DatasetsGetIamPolicyCall{s: r.s, opt_: make(map[string]interface{})} + c.resource = resource + c.getiampolicyrequest = getiampolicyrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsGetIamPolicyCall) Fields(s ...googleapi.Field) *DatasetsGetIamPolicyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsGetIamPolicyCall) Context(ctx context.Context) *DatasetsGetIamPolicyCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.datasets.getIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *DatasetsGetIamPolicyCall) Do() (*Policy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the access control policy for the dataset. Is empty if the policy or the resource does not exist. See Getting a Policy for more information.", + // "httpMethod": "POST", + // "id": "genomics.datasets.getIamPolicy", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which policy is being specified. Format is `datasets/`.", + // "location": "path", + // "pattern": "^datasets/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:getIamPolicy", + // "request": { + // "$ref": "GetIamPolicyRequest" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.datasets.list": + +type DatasetsListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists datasets within a project. +func (r *DatasetsService) List() *DatasetsListCall { + c := &DatasetsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results returned by this request. If unspecified, defaults to 50. +// The maximum value is 1024. +func (c *DatasetsListCall) PageSize(pageSize int64) *DatasetsListCall { + c.opt_["pageSize"] = pageSize + 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 *DatasetsListCall) PageToken(pageToken string) *DatasetsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// ProjectId sets the optional parameter "projectId": Required. The +// project to list datasets for. +func (c *DatasetsListCall) ProjectId(projectId string) *DatasetsListCall { + c.opt_["projectId"] = projectId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsListCall) Fields(s ...googleapi.Field) *DatasetsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DatasetsListCall) IfNoneMatch(entityTag string) *DatasetsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsListCall) Context(ctx context.Context) *DatasetsListCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projectId"]; ok { + params.Set("projectId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/datasets") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.datasets.list" call. +// Exactly one of *ListDatasetsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListDatasetsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DatasetsListCall) Do() (*ListDatasetsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListDatasetsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists datasets within a project.", + // "httpMethod": "GET", + // "id": "genomics.datasets.list", + // "parameters": { + // "pageSize": { + // "description": "The maximum number of results returned by this request. If unspecified, defaults to 50. The maximum value is 1024.", + // "format": "int32", + // "location": "query", + // "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" + // }, + // "projectId": { + // "description": "Required. The project to list datasets for.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/datasets", + // "response": { + // "$ref": "ListDatasetsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.datasets.patch": + +type DatasetsPatchCall struct { + s *Service + datasetId string + dataset *Dataset + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates a dataset. This method supports patch semantics. +func (r *DatasetsService) Patch(datasetId string, dataset *Dataset) *DatasetsPatchCall { + c := &DatasetsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.datasetId = datasetId + c.dataset = dataset + return c +} + +// UpdateMask sets the optional parameter "updateMask": An optional mask +// specifying which fields to update. At this time, the only mutable +// field is name. The only acceptable value is "name". If unspecified, +// all mutable fields will be updated. +func (c *DatasetsPatchCall) UpdateMask(updateMask string) *DatasetsPatchCall { + c.opt_["updateMask"] = updateMask + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsPatchCall) Fields(s ...googleapi.Field) *DatasetsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsPatchCall) Context(ctx context.Context) *DatasetsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["updateMask"]; ok { + params.Set("updateMask", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/datasets/{datasetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "datasetId": c.datasetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.datasets.patch" call. +// Exactly one of *Dataset or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Dataset.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *DatasetsPatchCall) Do() (*Dataset, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Dataset{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a dataset. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "genomics.datasets.patch", + // "parameterOrder": [ + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "The ID of the dataset to be updated.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "An optional mask specifying which fields to update. At this time, the only mutable field is name. The only acceptable value is \"name\". If unspecified, all mutable fields will be updated.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/datasets/{datasetId}", + // "request": { + // "$ref": "Dataset" + // }, + // "response": { + // "$ref": "Dataset" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.datasets.setIamPolicy": + +type DatasetsSetIamPolicyCall struct { + s *Service + resource string + setiampolicyrequest *SetIamPolicyRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetIamPolicy: Sets the access control policy on the specified +// dataset. Replaces any existing policy. See Setting a Policy for more +// information. +func (r *DatasetsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *DatasetsSetIamPolicyCall { + c := &DatasetsSetIamPolicyCall{s: r.s, opt_: make(map[string]interface{})} + c.resource = resource + c.setiampolicyrequest = setiampolicyrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsSetIamPolicyCall) Fields(s ...googleapi.Field) *DatasetsSetIamPolicyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsSetIamPolicyCall) Context(ctx context.Context) *DatasetsSetIamPolicyCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.datasets.setIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *DatasetsSetIamPolicyCall) Do() (*Policy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the access control policy on the specified dataset. Replaces any existing policy. See Setting a Policy for more information.", + // "httpMethod": "POST", + // "id": "genomics.datasets.setIamPolicy", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which policy is being specified. Format is `datasets/`.", + // "location": "path", + // "pattern": "^datasets/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:setIamPolicy", + // "request": { + // "$ref": "SetIamPolicyRequest" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.datasets.testIamPermissions": + +type DatasetsTestIamPermissionsCall struct { + s *Service + resource string + testiampermissionsrequest *TestIamPermissionsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// TestIamPermissions: Returns permissions that a caller has on the +// specified resource. See Testing Permissions for more information. +func (r *DatasetsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *DatasetsTestIamPermissionsCall { + c := &DatasetsTestIamPermissionsCall{s: r.s, opt_: make(map[string]interface{})} + c.resource = resource + c.testiampermissionsrequest = testiampermissionsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsTestIamPermissionsCall) Fields(s ...googleapi.Field) *DatasetsTestIamPermissionsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsTestIamPermissionsCall) Context(ctx context.Context) *DatasetsTestIamPermissionsCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.datasets.testIamPermissions" call. +// Exactly one of *TestIamPermissionsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TestIamPermissionsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DatasetsTestIamPermissionsCall) Do() (*TestIamPermissionsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TestIamPermissionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns permissions that a caller has on the specified resource. See Testing Permissions for more information.", + // "httpMethod": "POST", + // "id": "genomics.datasets.testIamPermissions", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which policy is being specified. Format is `datasets/`.", + // "location": "path", + // "pattern": "^datasets/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:testIamPermissions", + // "request": { + // "$ref": "TestIamPermissionsRequest" + // }, + // "response": { + // "$ref": "TestIamPermissionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.datasets.undelete": + +type DatasetsUndeleteCall struct { + s *Service + datasetId string + undeletedatasetrequest *UndeleteDatasetRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Undelete: Undeletes a dataset by restoring a dataset which was +// deleted via this API. This operation is only possible for a week +// after the deletion occurred. +func (r *DatasetsService) Undelete(datasetId string, undeletedatasetrequest *UndeleteDatasetRequest) *DatasetsUndeleteCall { + c := &DatasetsUndeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.datasetId = datasetId + c.undeletedatasetrequest = undeletedatasetrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsUndeleteCall) Fields(s ...googleapi.Field) *DatasetsUndeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsUndeleteCall) Context(ctx context.Context) *DatasetsUndeleteCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsUndeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletedatasetrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/datasets/{datasetId}:undelete") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "datasetId": c.datasetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.datasets.undelete" call. +// Exactly one of *Dataset or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Dataset.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *DatasetsUndeleteCall) Do() (*Dataset, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Dataset{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Undeletes a dataset by restoring a dataset which was deleted via this API. This operation is only possible for a week after the deletion occurred.", + // "httpMethod": "POST", + // "id": "genomics.datasets.undelete", + // "parameterOrder": [ + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "The ID of the dataset to be undeleted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/datasets/{datasetId}:undelete", + // "request": { + // "$ref": "UndeleteDatasetRequest" + // }, + // "response": { + // "$ref": "Dataset" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.operations.cancel": + +type OperationsCancelCall struct { + s *Service + name string + canceloperationrequest *CancelOperationRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Cancel: Starts asynchronous cancellation on a long-running operation. +// The server makes a best effort to cancel the operation, but success +// is not guaranteed. Clients may use Operations.GetOperation or +// Operations.ListOperations to check whether the cancellation succeeded +// or the operation completed despite cancellation. +func (r *OperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *OperationsCancelCall { + c := &OperationsCancelCall{s: r.s, opt_: make(map[string]interface{})} + c.name = name + c.canceloperationrequest = canceloperationrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OperationsCancelCall) Fields(s ...googleapi.Field) *OperationsCancelCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OperationsCancelCall) Context(ctx context.Context) *OperationsCancelCall { + c.ctx_ = ctx + return c +} + +func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.operations.cancel" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OperationsCancelCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. Clients may use Operations.GetOperation or Operations.ListOperations to check whether the cancellation succeeded or the operation completed despite cancellation.", + // "httpMethod": "POST", + // "id": "genomics.operations.cancel", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The name of the operation resource to be cancelled.", + // "location": "path", + // "pattern": "^operations/.*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}:cancel", + // "request": { + // "$ref": "CancelOperationRequest" + // }, + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.operations.delete": + +type OperationsDeleteCall struct { + s *Service + name string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: This method is not implemented. To cancel an operation, +// please use Operations.CancelOperation. +func (r *OperationsService) Delete(name string) *OperationsDeleteCall { + c := &OperationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OperationsDeleteCall) Fields(s ...googleapi.Field) *OperationsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OperationsDeleteCall) Context(ctx context.Context) *OperationsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.operations.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *OperationsDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "This method is not implemented. To cancel an operation, please use Operations.CancelOperation.", + // "httpMethod": "DELETE", + // "id": "genomics.operations.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The name of the operation resource to be deleted.", + // "location": "path", + // "pattern": "^operations/.*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.operations.get": + +type OperationsGetCall struct { + s *Service + name string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the latest state of a long-running operation. Clients can +// use this method to poll the operation result at intervals as +// recommended by the API service. +func (r *OperationsService) Get(name string) *OperationsGetCall { + c := &OperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.operations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OperationsGetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + // "httpMethod": "GET", + // "id": "genomics.operations.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The name of the operation resource.", + // "location": "path", + // "pattern": "^operations/.*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.operations.list": + +type OperationsListCall struct { + s *Service + name string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists operations that match the specified filter in the +// request. +func (r *OperationsService) List(name string) *OperationsListCall { + c := &OperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.name = name + return c +} + +// Filter sets the optional parameter "filter": A string for filtering +// Operations. The following filter fields are supported: * projectId: +// Required. Corresponds to OperationMetadata.projectId. * createTime: +// The time this job was created, in seconds from the +// [epoch](http://en.wikipedia.org/wiki/Unix_time). Can use `>=` and/or +// `= 1432140000` * `projectId = my-project AND createTime >= 1432140000 +// AND createTime <= 1432150000 AND status = RUNNING` +func (c *OperationsListCall) Filter(filter string) *OperationsListCall { + c.opt_["filter"] = filter + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return. If unspecified, defaults to 256. The maximum +// value is 2048. +func (c *OperationsListCall) PageSize(pageSize int64) *OperationsListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.operations.list" call. +// Exactly one of *ListOperationsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListOperationsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OperationsListCall) Do() (*ListOperationsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListOperationsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists operations that match the specified filter in the request.", + // "httpMethod": "GET", + // "id": "genomics.operations.list", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "filter": { + // "description": "A string for filtering Operations. The following filter fields are supported: * projectId: Required. Corresponds to OperationMetadata.projectId. * createTime: The time this job was created, in seconds from the [epoch](http://en.wikipedia.org/wiki/Unix_time). Can use `\u003e=` and/or `= 1432140000` * `projectId = my-project AND createTime \u003e= 1432140000 AND createTime \u003c= 1432150000 AND status = RUNNING`", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The name of the operation collection.", + // "location": "path", + // "pattern": "^operations$", + // "required": true, + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of results to return. If unspecified, defaults to 256. The maximum value is 2048.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The standard list page token.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "ListOperationsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.readgroupsets.delete": + +type ReadgroupsetsDeleteCall struct { + s *Service + readGroupSetId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a read group set. +func (r *ReadgroupsetsService) Delete(readGroupSetId string) *ReadgroupsetsDeleteCall { + c := &ReadgroupsetsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.readGroupSetId = readGroupSetId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReadgroupsetsDeleteCall) Fields(s ...googleapi.Field) *ReadgroupsetsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReadgroupsetsDeleteCall) Context(ctx context.Context) *ReadgroupsetsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ReadgroupsetsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/readgroupsets/{readGroupSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "readGroupSetId": c.readGroupSetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.readgroupsets.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReadgroupsetsDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a read group set.", + // "httpMethod": "DELETE", + // "id": "genomics.readgroupsets.delete", + // "parameterOrder": [ + // "readGroupSetId" + // ], + // "parameters": { + // "readGroupSetId": { + // "description": "The ID of the read group set to be deleted. The caller must have WRITE permissions to the dataset associated with this read group set.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/readgroupsets/{readGroupSetId}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.readgroupsets.export": + +type ReadgroupsetsExportCall struct { + s *Service + readGroupSetId string + exportreadgroupsetrequest *ExportReadGroupSetRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Export: Exports a read group set to a BAM file in Google Cloud +// Storage. Note that currently there may be some differences between +// exported BAM files and the original BAM file at the time of import. +// See +// [ImportReadGroupSets](google.genomics.v1.ReadServiceV1.ImportReadGroup +// Sets) for caveats. +func (r *ReadgroupsetsService) Export(readGroupSetId string, exportreadgroupsetrequest *ExportReadGroupSetRequest) *ReadgroupsetsExportCall { + c := &ReadgroupsetsExportCall{s: r.s, opt_: make(map[string]interface{})} + c.readGroupSetId = readGroupSetId + c.exportreadgroupsetrequest = exportreadgroupsetrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReadgroupsetsExportCall) Fields(s ...googleapi.Field) *ReadgroupsetsExportCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReadgroupsetsExportCall) Context(ctx context.Context) *ReadgroupsetsExportCall { + c.ctx_ = ctx + return c +} + +func (c *ReadgroupsetsExportCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportreadgroupsetrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/readgroupsets/{readGroupSetId}:export") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "readGroupSetId": c.readGroupSetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.readgroupsets.export" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReadgroupsetsExportCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Exports a read group set to a BAM file in Google Cloud Storage. Note that currently there may be some differences between exported BAM files and the original BAM file at the time of import. See [ImportReadGroupSets](google.genomics.v1.ReadServiceV1.ImportReadGroupSets) for caveats.", + // "httpMethod": "POST", + // "id": "genomics.readgroupsets.export", + // "parameterOrder": [ + // "readGroupSetId" + // ], + // "parameters": { + // "readGroupSetId": { + // "description": "Required. The ID of the read group set to export.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/readgroupsets/{readGroupSetId}:export", + // "request": { + // "$ref": "ExportReadGroupSetRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/devstorage.read_write", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.readgroupsets.get": + +type ReadgroupsetsGetCall struct { + s *Service + readGroupSetId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a read group set by ID. +func (r *ReadgroupsetsService) Get(readGroupSetId string) *ReadgroupsetsGetCall { + c := &ReadgroupsetsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.readGroupSetId = readGroupSetId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReadgroupsetsGetCall) Fields(s ...googleapi.Field) *ReadgroupsetsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReadgroupsetsGetCall) IfNoneMatch(entityTag string) *ReadgroupsetsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReadgroupsetsGetCall) Context(ctx context.Context) *ReadgroupsetsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ReadgroupsetsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/readgroupsets/{readGroupSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "readGroupSetId": c.readGroupSetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.readgroupsets.get" call. +// Exactly one of *ReadGroupSet or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ReadGroupSet.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReadgroupsetsGetCall) Do() (*ReadGroupSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ReadGroupSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a read group set by ID.", + // "httpMethod": "GET", + // "id": "genomics.readgroupsets.get", + // "parameterOrder": [ + // "readGroupSetId" + // ], + // "parameters": { + // "readGroupSetId": { + // "description": "The ID of the read group set.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/readgroupsets/{readGroupSetId}", + // "response": { + // "$ref": "ReadGroupSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.readgroupsets.import": + +type ReadgroupsetsImportCall struct { + s *Service + importreadgroupsetsrequest *ImportReadGroupSetsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Import: Creates read group sets by asynchronously importing the +// provided information. The caller must have WRITE permissions to the +// dataset. ## Notes on +// [BAM](https://samtools.github.io/hts-specs/SAMv1.pdf) import - Tags +// will be converted to strings - tag types are not preserved - Comments +// (`@CO`) in the input file header will not be preserved - Original +// header order of references (`@SQ`) will not be preserved - Any +// reverse stranded unmapped reads will be reverse complemented, and +// their qualities (and "BQ" tag, if any) will be reversed - Unmapped +// reads will be stripped of positional information (reference name and +// position) +func (r *ReadgroupsetsService) Import(importreadgroupsetsrequest *ImportReadGroupSetsRequest) *ReadgroupsetsImportCall { + c := &ReadgroupsetsImportCall{s: r.s, opt_: make(map[string]interface{})} + c.importreadgroupsetsrequest = importreadgroupsetsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReadgroupsetsImportCall) Fields(s ...googleapi.Field) *ReadgroupsetsImportCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReadgroupsetsImportCall) Context(ctx context.Context) *ReadgroupsetsImportCall { + c.ctx_ = ctx + return c +} + +func (c *ReadgroupsetsImportCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.importreadgroupsetsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/readgroupsets:import") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.readgroupsets.import" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReadgroupsetsImportCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates read group sets by asynchronously importing the provided information. The caller must have WRITE permissions to the dataset. ## Notes on [BAM](https://samtools.github.io/hts-specs/SAMv1.pdf) import - Tags will be converted to strings - tag types are not preserved - Comments (`@CO`) in the input file header will not be preserved - Original header order of references (`@SQ`) will not be preserved - Any reverse stranded unmapped reads will be reverse complemented, and their qualities (and \"BQ\" tag, if any) will be reversed - Unmapped reads will be stripped of positional information (reference name and position)", + // "httpMethod": "POST", + // "id": "genomics.readgroupsets.import", + // "path": "v1/readgroupsets:import", + // "request": { + // "$ref": "ImportReadGroupSetsRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/devstorage.read_write", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.readgroupsets.patch": + +type ReadgroupsetsPatchCall struct { + s *Service + readGroupSetId string + readgroupset *ReadGroupSet + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates a read group set. This method supports patch +// semantics. +func (r *ReadgroupsetsService) Patch(readGroupSetId string, readgroupset *ReadGroupSet) *ReadgroupsetsPatchCall { + c := &ReadgroupsetsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.readGroupSetId = readGroupSetId + c.readgroupset = readgroupset + return c +} + +// UpdateMask sets the optional parameter "updateMask": An optional mask +// specifying which fields to update. At this time, mutable fields are +// referenceSetId and name. Acceptable values are "referenceSetId" and +// "name". If unspecified, all mutable fields will be updated. +func (c *ReadgroupsetsPatchCall) UpdateMask(updateMask string) *ReadgroupsetsPatchCall { + c.opt_["updateMask"] = updateMask + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReadgroupsetsPatchCall) Fields(s ...googleapi.Field) *ReadgroupsetsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReadgroupsetsPatchCall) Context(ctx context.Context) *ReadgroupsetsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ReadgroupsetsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.readgroupset) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["updateMask"]; ok { + params.Set("updateMask", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/readgroupsets/{readGroupSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "readGroupSetId": c.readGroupSetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.readgroupsets.patch" call. +// Exactly one of *ReadGroupSet or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ReadGroupSet.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReadgroupsetsPatchCall) Do() (*ReadGroupSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ReadGroupSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a read group set. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "genomics.readgroupsets.patch", + // "parameterOrder": [ + // "readGroupSetId" + // ], + // "parameters": { + // "readGroupSetId": { + // "description": "The ID of the read group set to be updated. The caller must have WRITE permissions to the dataset associated with this read group set.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "An optional mask specifying which fields to update. At this time, mutable fields are referenceSetId and name. Acceptable values are \"referenceSetId\" and \"name\". If unspecified, all mutable fields will be updated.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/readgroupsets/{readGroupSetId}", + // "request": { + // "$ref": "ReadGroupSet" + // }, + // "response": { + // "$ref": "ReadGroupSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.readgroupsets.search": + +type ReadgroupsetsSearchCall struct { + s *Service + searchreadgroupsetsrequest *SearchReadGroupSetsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Search: Searches for read group sets matching the criteria. +// Implements +// [GlobalAllianceApi.searchReadGroupSets](https://github.com/ga4gh/schem +// as/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L135). +func (r *ReadgroupsetsService) Search(searchreadgroupsetsrequest *SearchReadGroupSetsRequest) *ReadgroupsetsSearchCall { + c := &ReadgroupsetsSearchCall{s: r.s, opt_: make(map[string]interface{})} + c.searchreadgroupsetsrequest = searchreadgroupsetsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReadgroupsetsSearchCall) Fields(s ...googleapi.Field) *ReadgroupsetsSearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReadgroupsetsSearchCall) Context(ctx context.Context) *ReadgroupsetsSearchCall { + c.ctx_ = ctx + return c +} + +func (c *ReadgroupsetsSearchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchreadgroupsetsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/readgroupsets/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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.readgroupsets.search" call. +// Exactly one of *SearchReadGroupSetsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *SearchReadGroupSetsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReadgroupsetsSearchCall) Do() (*SearchReadGroupSetsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SearchReadGroupSetsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Searches for read group sets matching the criteria. Implements [GlobalAllianceApi.searchReadGroupSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L135).", + // "httpMethod": "POST", + // "id": "genomics.readgroupsets.search", + // "path": "v1/readgroupsets/search", + // "request": { + // "$ref": "SearchReadGroupSetsRequest" + // }, + // "response": { + // "$ref": "SearchReadGroupSetsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.readgroupsets.coveragebuckets.list": + +type ReadgroupsetsCoveragebucketsListCall struct { + s *Service + readGroupSetId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists fixed width coverage buckets for a read group set, each +// of which correspond to a range of a reference sequence. Each bucket +// summarizes coverage information across its corresponding genomic +// range. Coverage is defined as the number of reads which are aligned +// to a given base in the reference sequence. Coverage buckets are +// available at several precomputed bucket widths, enabling retrieval of +// various coverage 'zoom levels'. The caller must have READ permissions +// for the target read group set. +func (r *ReadgroupsetsCoveragebucketsService) List(readGroupSetId string) *ReadgroupsetsCoveragebucketsListCall { + c := &ReadgroupsetsCoveragebucketsListCall{s: r.s, opt_: make(map[string]interface{})} + c.readGroupSetId = readGroupSetId + return c +} + +// End sets the optional parameter "end": The end position of the range +// on the reference, 0-based exclusive. If specified, `referenceName` +// must also be specified. If unset or 0, defaults to the length of the +// reference. +func (c *ReadgroupsetsCoveragebucketsListCall) End(end int64) *ReadgroupsetsCoveragebucketsListCall { + c.opt_["end"] = end + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single page. If unspecified, defaults to +// 1024. The maximum value is 2048. +func (c *ReadgroupsetsCoveragebucketsListCall) PageSize(pageSize int64) *ReadgroupsetsCoveragebucketsListCall { + c.opt_["pageSize"] = pageSize + 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 *ReadgroupsetsCoveragebucketsListCall) PageToken(pageToken string) *ReadgroupsetsCoveragebucketsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// ReferenceName sets the optional parameter "referenceName": The name +// of the reference to query, within the reference set associated with +// this query. +func (c *ReadgroupsetsCoveragebucketsListCall) ReferenceName(referenceName string) *ReadgroupsetsCoveragebucketsListCall { + c.opt_["referenceName"] = referenceName + return c +} + +// Start sets the optional parameter "start": The start position of the +// range on the reference, 0-based inclusive. If specified, +// `referenceName` must also be specified. Defaults to 0. +func (c *ReadgroupsetsCoveragebucketsListCall) Start(start int64) *ReadgroupsetsCoveragebucketsListCall { + c.opt_["start"] = start + return c +} + +// TargetBucketWidth sets the optional parameter "targetBucketWidth": +// The desired width of each reported coverage bucket in base pairs. +// This will be rounded down to the nearest precomputed bucket width; +// the value of which is returned as `bucketWidth` in the response. +// Defaults to infinity (each bucket spans an entire reference sequence) +// or the length of the target range, if specified. The smallest +// precomputed `bucketWidth` is currently 2048 base pairs; this is +// subject to change. +func (c *ReadgroupsetsCoveragebucketsListCall) TargetBucketWidth(targetBucketWidth int64) *ReadgroupsetsCoveragebucketsListCall { + c.opt_["targetBucketWidth"] = targetBucketWidth + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReadgroupsetsCoveragebucketsListCall) Fields(s ...googleapi.Field) *ReadgroupsetsCoveragebucketsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReadgroupsetsCoveragebucketsListCall) IfNoneMatch(entityTag string) *ReadgroupsetsCoveragebucketsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReadgroupsetsCoveragebucketsListCall) Context(ctx context.Context) *ReadgroupsetsCoveragebucketsListCall { + c.ctx_ = ctx + return c +} + +func (c *ReadgroupsetsCoveragebucketsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["end"]; ok { + params.Set("end", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["referenceName"]; ok { + params.Set("referenceName", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start"]; ok { + params.Set("start", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["targetBucketWidth"]; ok { + params.Set("targetBucketWidth", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/readgroupsets/{readGroupSetId}/coveragebuckets") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "readGroupSetId": c.readGroupSetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.readgroupsets.coveragebuckets.list" call. +// Exactly one of *ListCoverageBucketsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListCoverageBucketsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReadgroupsetsCoveragebucketsListCall) Do() (*ListCoverageBucketsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListCoverageBucketsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists fixed width coverage buckets for a read group set, each of which correspond to a range of a reference sequence. Each bucket summarizes coverage information across its corresponding genomic range. Coverage is defined as the number of reads which are aligned to a given base in the reference sequence. Coverage buckets are available at several precomputed bucket widths, enabling retrieval of various coverage 'zoom levels'. The caller must have READ permissions for the target read group set.", + // "httpMethod": "GET", + // "id": "genomics.readgroupsets.coveragebuckets.list", + // "parameterOrder": [ + // "readGroupSetId" + // ], + // "parameters": { + // "end": { + // "description": "The end position of the range on the reference, 0-based exclusive. If specified, `referenceName` must also be specified. If unset or 0, defaults to the length of the reference.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of results to return in a single page. If unspecified, defaults to 1024. The maximum value is 2048.", + // "format": "int32", + // "location": "query", + // "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" + // }, + // "readGroupSetId": { + // "description": "Required. The ID of the read group set over which coverage is requested.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "referenceName": { + // "description": "The name of the reference to query, within the reference set associated with this query. Optional.", + // "location": "query", + // "type": "string" + // }, + // "start": { + // "description": "The start position of the range on the reference, 0-based inclusive. If specified, `referenceName` must also be specified. Defaults to 0.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "targetBucketWidth": { + // "description": "The desired width of each reported coverage bucket in base pairs. This will be rounded down to the nearest precomputed bucket width; the value of which is returned as `bucketWidth` in the response. Defaults to infinity (each bucket spans an entire reference sequence) or the length of the target range, if specified. The smallest precomputed `bucketWidth` is currently 2048 base pairs; this is subject to change.", + // "format": "int64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/readgroupsets/{readGroupSetId}/coveragebuckets", + // "response": { + // "$ref": "ListCoverageBucketsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.reads.search": + +type ReadsSearchCall struct { + s *Service + searchreadsrequest *SearchReadsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Search: Gets a list of reads for one or more read group sets. Reads +// search operates over a genomic coordinate space of reference sequence +// & position defined over the reference sequences to which the +// requested read group sets are aligned. If a target positional range +// is specified, search returns all reads whose alignment to the +// reference genome overlap the range. A query which specifies only read +// group set IDs yields all reads in those read group sets, including +// unmapped reads. All reads returned (including reads on subsequent +// pages) are ordered by genomic coordinate (reference sequence & +// position). Reads with equivalent genomic coordinates are returned in +// a deterministic order. Implements +// [GlobalAllianceApi.searchReads](https://github.com/ga4gh/schemas/blob/ +// v0.5.1/src/main/resources/avro/readmethods.avdl#L85). +func (r *ReadsService) Search(searchreadsrequest *SearchReadsRequest) *ReadsSearchCall { + c := &ReadsSearchCall{s: r.s, opt_: make(map[string]interface{})} + c.searchreadsrequest = searchreadsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReadsSearchCall) Fields(s ...googleapi.Field) *ReadsSearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReadsSearchCall) Context(ctx context.Context) *ReadsSearchCall { + c.ctx_ = ctx + return c +} + +func (c *ReadsSearchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchreadsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/reads/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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.reads.search" call. +// Exactly one of *SearchReadsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SearchReadsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReadsSearchCall) Do() (*SearchReadsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SearchReadsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a list of reads for one or more read group sets. Reads search operates over a genomic coordinate space of reference sequence \u0026 position defined over the reference sequences to which the requested read group sets are aligned. If a target positional range is specified, search returns all reads whose alignment to the reference genome overlap the range. A query which specifies only read group set IDs yields all reads in those read group sets, including unmapped reads. All reads returned (including reads on subsequent pages) are ordered by genomic coordinate (reference sequence \u0026 position). Reads with equivalent genomic coordinates are returned in a deterministic order. Implements [GlobalAllianceApi.searchReads](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L85).", + // "httpMethod": "POST", + // "id": "genomics.reads.search", + // "path": "v1/reads/search", + // "request": { + // "$ref": "SearchReadsRequest" + // }, + // "response": { + // "$ref": "SearchReadsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.references.get": + +type ReferencesGetCall struct { + s *Service + referenceId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a reference. Implements +// [GlobalAllianceApi.getReference](https://github.com/ga4gh/schemas/blob +// /v0.5.1/src/main/resources/avro/referencemethods.avdl#L158). +func (r *ReferencesService) Get(referenceId string) *ReferencesGetCall { + c := &ReferencesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.referenceId = referenceId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReferencesGetCall) Fields(s ...googleapi.Field) *ReferencesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReferencesGetCall) IfNoneMatch(entityTag string) *ReferencesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReferencesGetCall) Context(ctx context.Context) *ReferencesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ReferencesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/references/{referenceId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "referenceId": c.referenceId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.references.get" call. +// Exactly one of *Reference or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Reference.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReferencesGetCall) Do() (*Reference, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Reference{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a reference. Implements [GlobalAllianceApi.getReference](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L158).", + // "httpMethod": "GET", + // "id": "genomics.references.get", + // "parameterOrder": [ + // "referenceId" + // ], + // "parameters": { + // "referenceId": { + // "description": "The ID of the reference.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/references/{referenceId}", + // "response": { + // "$ref": "Reference" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.references.search": + +type ReferencesSearchCall struct { + s *Service + searchreferencesrequest *SearchReferencesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Search: Searches for references which match the given criteria. +// Implements +// [GlobalAllianceApi.searchReferences](https://github.com/ga4gh/schemas/ +// blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L146). +func (r *ReferencesService) Search(searchreferencesrequest *SearchReferencesRequest) *ReferencesSearchCall { + c := &ReferencesSearchCall{s: r.s, opt_: make(map[string]interface{})} + c.searchreferencesrequest = searchreferencesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReferencesSearchCall) Fields(s ...googleapi.Field) *ReferencesSearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReferencesSearchCall) Context(ctx context.Context) *ReferencesSearchCall { + c.ctx_ = ctx + return c +} + +func (c *ReferencesSearchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchreferencesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/references/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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.references.search" call. +// Exactly one of *SearchReferencesResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *SearchReferencesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReferencesSearchCall) Do() (*SearchReferencesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SearchReferencesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Searches for references which match the given criteria. Implements [GlobalAllianceApi.searchReferences](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L146).", + // "httpMethod": "POST", + // "id": "genomics.references.search", + // "path": "v1/references/search", + // "request": { + // "$ref": "SearchReferencesRequest" + // }, + // "response": { + // "$ref": "SearchReferencesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.references.bases.list": + +type ReferencesBasesListCall struct { + s *Service + referenceId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the bases in a reference, optionally restricted to a +// range. Implements +// [GlobalAllianceApi.getReferenceBases](https://github.com/ga4gh/schemas +// /blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L221). +func (r *ReferencesBasesService) List(referenceId string) *ReferencesBasesListCall { + c := &ReferencesBasesListCall{s: r.s, opt_: make(map[string]interface{})} + c.referenceId = referenceId + return c +} + +// End sets the optional parameter "end": The end position (0-based, +// exclusive) of this query. Defaults to the length of this reference. +func (c *ReferencesBasesListCall) End(end int64) *ReferencesBasesListCall { + c.opt_["end"] = end + return c +} + +// PageSize sets the optional parameter "pageSize": Specifies the +// maximum number of bases to return in a single page. +func (c *ReferencesBasesListCall) PageSize(pageSize int64) *ReferencesBasesListCall { + c.opt_["pageSize"] = pageSize + 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 *ReferencesBasesListCall) PageToken(pageToken string) *ReferencesBasesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Start sets the optional parameter "start": The start position +// (0-based) of this query. Defaults to 0. +func (c *ReferencesBasesListCall) Start(start int64) *ReferencesBasesListCall { + c.opt_["start"] = start + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReferencesBasesListCall) Fields(s ...googleapi.Field) *ReferencesBasesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReferencesBasesListCall) IfNoneMatch(entityTag string) *ReferencesBasesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReferencesBasesListCall) Context(ctx context.Context) *ReferencesBasesListCall { + c.ctx_ = ctx + return c +} + +func (c *ReferencesBasesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["end"]; ok { + params.Set("end", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start"]; ok { + params.Set("start", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/references/{referenceId}/bases") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "referenceId": c.referenceId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.references.bases.list" call. +// Exactly one of *ListBasesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListBasesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReferencesBasesListCall) Do() (*ListBasesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListBasesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the bases in a reference, optionally restricted to a range. Implements [GlobalAllianceApi.getReferenceBases](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L221).", + // "httpMethod": "GET", + // "id": "genomics.references.bases.list", + // "parameterOrder": [ + // "referenceId" + // ], + // "parameters": { + // "end": { + // "description": "The end position (0-based, exclusive) of this query. Defaults to the length of this reference.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "Specifies the maximum number of bases to return in a single page.", + // "format": "int32", + // "location": "query", + // "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" + // }, + // "referenceId": { + // "description": "The ID of the reference.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "start": { + // "description": "The start position (0-based) of this query. Defaults to 0.", + // "format": "int64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/references/{referenceId}/bases", + // "response": { + // "$ref": "ListBasesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.referencesets.get": + +type ReferencesetsGetCall struct { + s *Service + referenceSetId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a reference set. Implements +// [GlobalAllianceApi.getReferenceSet](https://github.com/ga4gh/schemas/b +// lob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L83). +func (r *ReferencesetsService) Get(referenceSetId string) *ReferencesetsGetCall { + c := &ReferencesetsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.referenceSetId = referenceSetId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReferencesetsGetCall) Fields(s ...googleapi.Field) *ReferencesetsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReferencesetsGetCall) IfNoneMatch(entityTag string) *ReferencesetsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReferencesetsGetCall) Context(ctx context.Context) *ReferencesetsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ReferencesetsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/referencesets/{referenceSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "referenceSetId": c.referenceSetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.referencesets.get" call. +// Exactly one of *ReferenceSet or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ReferenceSet.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReferencesetsGetCall) Do() (*ReferenceSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ReferenceSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a reference set. Implements [GlobalAllianceApi.getReferenceSet](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L83).", + // "httpMethod": "GET", + // "id": "genomics.referencesets.get", + // "parameterOrder": [ + // "referenceSetId" + // ], + // "parameters": { + // "referenceSetId": { + // "description": "The ID of the reference set.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/referencesets/{referenceSetId}", + // "response": { + // "$ref": "ReferenceSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.referencesets.search": + +type ReferencesetsSearchCall struct { + s *Service + searchreferencesetsrequest *SearchReferenceSetsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Search: Searches for reference sets which match the given criteria. +// Implements +// [GlobalAllianceApi.searchReferenceSets](http://ga4gh.org/documentation +// /api/v0.5.1/ga4gh_api.html#/schema/org.ga4gh.searchReferenceSets). +func (r *ReferencesetsService) Search(searchreferencesetsrequest *SearchReferenceSetsRequest) *ReferencesetsSearchCall { + c := &ReferencesetsSearchCall{s: r.s, opt_: make(map[string]interface{})} + c.searchreferencesetsrequest = searchreferencesetsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReferencesetsSearchCall) Fields(s ...googleapi.Field) *ReferencesetsSearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReferencesetsSearchCall) Context(ctx context.Context) *ReferencesetsSearchCall { + c.ctx_ = ctx + return c +} + +func (c *ReferencesetsSearchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchreferencesetsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/referencesets/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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.referencesets.search" call. +// Exactly one of *SearchReferenceSetsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *SearchReferenceSetsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReferencesetsSearchCall) Do() (*SearchReferenceSetsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SearchReferenceSetsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Searches for reference sets which match the given criteria. Implements [GlobalAllianceApi.searchReferenceSets](http://ga4gh.org/documentation/api/v0.5.1/ga4gh_api.html#/schema/org.ga4gh.searchReferenceSets).", + // "httpMethod": "POST", + // "id": "genomics.referencesets.search", + // "path": "v1/referencesets/search", + // "request": { + // "$ref": "SearchReferenceSetsRequest" + // }, + // "response": { + // "$ref": "SearchReferenceSetsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.variants.create": + +type VariantsCreateCall struct { + s *Service + variant *Variant + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a new variant. +func (r *VariantsService) Create(variant *Variant) *VariantsCreateCall { + c := &VariantsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.variant = variant + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VariantsCreateCall) Fields(s ...googleapi.Field) *VariantsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VariantsCreateCall) Context(ctx context.Context) *VariantsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *VariantsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.variant) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/variants") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.variants.create" call. +// Exactly one of *Variant or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Variant.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *VariantsCreateCall) Do() (*Variant, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Variant{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new variant.", + // "httpMethod": "POST", + // "id": "genomics.variants.create", + // "path": "v1/variants", + // "request": { + // "$ref": "Variant" + // }, + // "response": { + // "$ref": "Variant" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.variants.delete": + +type VariantsDeleteCall struct { + s *Service + variantId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a variant. +func (r *VariantsService) Delete(variantId string) *VariantsDeleteCall { + c := &VariantsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.variantId = variantId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VariantsDeleteCall) Fields(s ...googleapi.Field) *VariantsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VariantsDeleteCall) Context(ctx context.Context) *VariantsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *VariantsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/variants/{variantId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "variantId": c.variantId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.variants.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *VariantsDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a variant.", + // "httpMethod": "DELETE", + // "id": "genomics.variants.delete", + // "parameterOrder": [ + // "variantId" + // ], + // "parameters": { + // "variantId": { + // "description": "The ID of the variant to be deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/variants/{variantId}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.variants.get": + +type VariantsGetCall struct { + s *Service + variantId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a variant by ID. +func (r *VariantsService) Get(variantId string) *VariantsGetCall { + c := &VariantsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.variantId = variantId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VariantsGetCall) Fields(s ...googleapi.Field) *VariantsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *VariantsGetCall) IfNoneMatch(entityTag string) *VariantsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VariantsGetCall) Context(ctx context.Context) *VariantsGetCall { + c.ctx_ = ctx + return c +} + +func (c *VariantsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/variants/{variantId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "variantId": c.variantId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.variants.get" call. +// Exactly one of *Variant or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Variant.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *VariantsGetCall) Do() (*Variant, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Variant{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a variant by ID.", + // "httpMethod": "GET", + // "id": "genomics.variants.get", + // "parameterOrder": [ + // "variantId" + // ], + // "parameters": { + // "variantId": { + // "description": "The ID of the variant.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/variants/{variantId}", + // "response": { + // "$ref": "Variant" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.variants.import": + +type VariantsImportCall struct { + s *Service + importvariantsrequest *ImportVariantsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Import: Creates variant data by asynchronously importing the provided +// information. The variants for import will be merged with any existing +// variant that matches its reference sequence, start, end, reference +// bases, and alternative bases. If no such variant exists, a new one +// will be created. When variants are merged, the call information from +// the new variant is added to the existing variant, and other fields +// (such as key/value pairs) are discarded. In particular, this means +// for merged VCF variants that have conflicting INFO fields, some data +// will be arbitrarily discarded. As a special case, for single-sample +// VCF files, QUAL and FILTER fields will be moved to the call level; +// these are sometimes interpreted in a call-specific context. Imported +// VCF headers are appended to the metadata already in a variant set. +func (r *VariantsService) Import(importvariantsrequest *ImportVariantsRequest) *VariantsImportCall { + c := &VariantsImportCall{s: r.s, opt_: make(map[string]interface{})} + c.importvariantsrequest = importvariantsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VariantsImportCall) Fields(s ...googleapi.Field) *VariantsImportCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VariantsImportCall) Context(ctx context.Context) *VariantsImportCall { + c.ctx_ = ctx + return c +} + +func (c *VariantsImportCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.importvariantsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/variants:import") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.variants.import" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *VariantsImportCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates variant data by asynchronously importing the provided information. The variants for import will be merged with any existing variant that matches its reference sequence, start, end, reference bases, and alternative bases. If no such variant exists, a new one will be created. When variants are merged, the call information from the new variant is added to the existing variant, and other fields (such as key/value pairs) are discarded. In particular, this means for merged VCF variants that have conflicting INFO fields, some data will be arbitrarily discarded. As a special case, for single-sample VCF files, QUAL and FILTER fields will be moved to the call level; these are sometimes interpreted in a call-specific context. Imported VCF headers are appended to the metadata already in a variant set.", + // "httpMethod": "POST", + // "id": "genomics.variants.import", + // "path": "v1/variants:import", + // "request": { + // "$ref": "ImportVariantsRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/devstorage.read_write", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.variants.patch": + +type VariantsPatchCall struct { + s *Service + variantId string + variant *Variant + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates a variant. This method supports patch semantics. +// Returns the modified variant without its calls. +func (r *VariantsService) Patch(variantId string, variant *Variant) *VariantsPatchCall { + c := &VariantsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.variantId = variantId + c.variant = variant + return c +} + +// UpdateMask sets the optional parameter "updateMask": An optional mask +// specifying which fields to update. At this time, mutable fields are +// names and info. Acceptable values are "names" and "info". If +// unspecified, all mutable fields will be updated. +func (c *VariantsPatchCall) UpdateMask(updateMask string) *VariantsPatchCall { + c.opt_["updateMask"] = updateMask + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VariantsPatchCall) Fields(s ...googleapi.Field) *VariantsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VariantsPatchCall) Context(ctx context.Context) *VariantsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *VariantsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.variant) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["updateMask"]; ok { + params.Set("updateMask", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/variants/{variantId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "variantId": c.variantId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.variants.patch" call. +// Exactly one of *Variant or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Variant.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *VariantsPatchCall) Do() (*Variant, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Variant{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a variant. This method supports patch semantics. Returns the modified variant without its calls.", + // "httpMethod": "PATCH", + // "id": "genomics.variants.patch", + // "parameterOrder": [ + // "variantId" + // ], + // "parameters": { + // "updateMask": { + // "description": "An optional mask specifying which fields to update. At this time, mutable fields are names and info. Acceptable values are \"names\" and \"info\". If unspecified, all mutable fields will be updated.", + // "location": "query", + // "type": "string" + // }, + // "variantId": { + // "description": "The ID of the variant to be updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/variants/{variantId}", + // "request": { + // "$ref": "Variant" + // }, + // "response": { + // "$ref": "Variant" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.variants.search": + +type VariantsSearchCall struct { + s *Service + searchvariantsrequest *SearchVariantsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Search: Gets a list of variants matching the criteria. Implements +// [GlobalAllianceApi.searchVariants](https://github.com/ga4gh/schemas/bl +// ob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L126). +func (r *VariantsService) Search(searchvariantsrequest *SearchVariantsRequest) *VariantsSearchCall { + c := &VariantsSearchCall{s: r.s, opt_: make(map[string]interface{})} + c.searchvariantsrequest = searchvariantsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VariantsSearchCall) Fields(s ...googleapi.Field) *VariantsSearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VariantsSearchCall) Context(ctx context.Context) *VariantsSearchCall { + c.ctx_ = ctx + return c +} + +func (c *VariantsSearchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchvariantsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/variants/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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.variants.search" call. +// Exactly one of *SearchVariantsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SearchVariantsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *VariantsSearchCall) Do() (*SearchVariantsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SearchVariantsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a list of variants matching the criteria. Implements [GlobalAllianceApi.searchVariants](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L126).", + // "httpMethod": "POST", + // "id": "genomics.variants.search", + // "path": "v1/variants/search", + // "request": { + // "$ref": "SearchVariantsRequest" + // }, + // "response": { + // "$ref": "SearchVariantsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.variantsets.create": + +type VariantsetsCreateCall struct { + s *Service + variantset *VariantSet + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a new variant set. The provided variant set must have +// a valid `datasetId` set - all other fields are optional. Note that +// the `id` field will be ignored, as this is assigned by the server. +func (r *VariantsetsService) Create(variantset *VariantSet) *VariantsetsCreateCall { + c := &VariantsetsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.variantset = variantset + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VariantsetsCreateCall) Fields(s ...googleapi.Field) *VariantsetsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VariantsetsCreateCall) Context(ctx context.Context) *VariantsetsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *VariantsetsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.variantset) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/variantsets") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.variantsets.create" call. +// Exactly one of *VariantSet or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *VariantSet.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *VariantsetsCreateCall) Do() (*VariantSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &VariantSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new variant set. The provided variant set must have a valid `datasetId` set - all other fields are optional. Note that the `id` field will be ignored, as this is assigned by the server.", + // "httpMethod": "POST", + // "id": "genomics.variantsets.create", + // "path": "v1/variantsets", + // "request": { + // "$ref": "VariantSet" + // }, + // "response": { + // "$ref": "VariantSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.variantsets.delete": + +type VariantsetsDeleteCall struct { + s *Service + variantSetId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the contents of a variant set. The variant set object +// is not deleted. +func (r *VariantsetsService) Delete(variantSetId string) *VariantsetsDeleteCall { + c := &VariantsetsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.variantSetId = variantSetId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VariantsetsDeleteCall) Fields(s ...googleapi.Field) *VariantsetsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VariantsetsDeleteCall) Context(ctx context.Context) *VariantsetsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *VariantsetsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/variantsets/{variantSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "variantSetId": c.variantSetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.variantsets.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *VariantsetsDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the contents of a variant set. The variant set object is not deleted.", + // "httpMethod": "DELETE", + // "id": "genomics.variantsets.delete", + // "parameterOrder": [ + // "variantSetId" + // ], + // "parameters": { + // "variantSetId": { + // "description": "The ID of the variant set to be deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/variantsets/{variantSetId}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.variantsets.export": + +type VariantsetsExportCall struct { + s *Service + variantSetId string + exportvariantsetrequest *ExportVariantSetRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Export: Exports variant set data to an external destination. +func (r *VariantsetsService) Export(variantSetId string, exportvariantsetrequest *ExportVariantSetRequest) *VariantsetsExportCall { + c := &VariantsetsExportCall{s: r.s, opt_: make(map[string]interface{})} + c.variantSetId = variantSetId + c.exportvariantsetrequest = exportvariantsetrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VariantsetsExportCall) Fields(s ...googleapi.Field) *VariantsetsExportCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VariantsetsExportCall) Context(ctx context.Context) *VariantsetsExportCall { + c.ctx_ = ctx + return c +} + +func (c *VariantsetsExportCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportvariantsetrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/variantsets/{variantSetId}:export") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "variantSetId": c.variantSetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.variantsets.export" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *VariantsetsExportCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Exports variant set data to an external destination.", + // "httpMethod": "POST", + // "id": "genomics.variantsets.export", + // "parameterOrder": [ + // "variantSetId" + // ], + // "parameters": { + // "variantSetId": { + // "description": "Required. The ID of the variant set that contains variant data which should be exported. The caller must have READ access to this variant set.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/variantsets/{variantSetId}:export", + // "request": { + // "$ref": "ExportVariantSetRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.variantsets.get": + +type VariantsetsGetCall struct { + s *Service + variantSetId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a variant set by ID. +func (r *VariantsetsService) Get(variantSetId string) *VariantsetsGetCall { + c := &VariantsetsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.variantSetId = variantSetId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VariantsetsGetCall) Fields(s ...googleapi.Field) *VariantsetsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *VariantsetsGetCall) IfNoneMatch(entityTag string) *VariantsetsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VariantsetsGetCall) Context(ctx context.Context) *VariantsetsGetCall { + c.ctx_ = ctx + return c +} + +func (c *VariantsetsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/variantsets/{variantSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "variantSetId": c.variantSetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.variantsets.get" call. +// Exactly one of *VariantSet or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *VariantSet.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *VariantsetsGetCall) Do() (*VariantSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &VariantSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a variant set by ID.", + // "httpMethod": "GET", + // "id": "genomics.variantsets.get", + // "parameterOrder": [ + // "variantSetId" + // ], + // "parameters": { + // "variantSetId": { + // "description": "Required. The ID of the variant set.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/variantsets/{variantSetId}", + // "response": { + // "$ref": "VariantSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.variantsets.patch": + +type VariantsetsPatchCall struct { + s *Service + variantSetId string + variantset *VariantSet + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates a variant set. This method supports patch semantics. +func (r *VariantsetsService) Patch(variantSetId string, variantset *VariantSet) *VariantsetsPatchCall { + c := &VariantsetsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.variantSetId = variantSetId + c.variantset = variantset + return c +} + +// UpdateMask sets the optional parameter "updateMask": An optional mask +// specifying which fields to update. At this time, the only mutable +// field is metadata. The only acceptable value is "metadata". If +// unspecified, all mutable fields will be updated. +func (c *VariantsetsPatchCall) UpdateMask(updateMask string) *VariantsetsPatchCall { + c.opt_["updateMask"] = updateMask + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VariantsetsPatchCall) Fields(s ...googleapi.Field) *VariantsetsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VariantsetsPatchCall) Context(ctx context.Context) *VariantsetsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *VariantsetsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.variantset) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["updateMask"]; ok { + params.Set("updateMask", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/variantsets/{variantSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "variantSetId": c.variantSetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.variantsets.patch" call. +// Exactly one of *VariantSet or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *VariantSet.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *VariantsetsPatchCall) Do() (*VariantSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &VariantSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a variant set. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "genomics.variantsets.patch", + // "parameterOrder": [ + // "variantSetId" + // ], + // "parameters": { + // "updateMask": { + // "description": "An optional mask specifying which fields to update. At this time, the only mutable field is metadata. The only acceptable value is \"metadata\". If unspecified, all mutable fields will be updated.", + // "location": "query", + // "type": "string" + // }, + // "variantSetId": { + // "description": "The ID of the variant to be updated (must already exist).", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/variantsets/{variantSetId}", + // "request": { + // "$ref": "VariantSet" + // }, + // "response": { + // "$ref": "VariantSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.variantsets.search": + +type VariantsetsSearchCall struct { + s *Service + searchvariantsetsrequest *SearchVariantSetsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Search: Returns a list of all variant sets matching search criteria. +// Implements +// [GlobalAllianceApi.searchVariantSets](https://github.com/ga4gh/schemas +// /blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L49). +func (r *VariantsetsService) Search(searchvariantsetsrequest *SearchVariantSetsRequest) *VariantsetsSearchCall { + c := &VariantsetsSearchCall{s: r.s, opt_: make(map[string]interface{})} + c.searchvariantsetsrequest = searchvariantsetsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VariantsetsSearchCall) Fields(s ...googleapi.Field) *VariantsetsSearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VariantsetsSearchCall) Context(ctx context.Context) *VariantsetsSearchCall { + c.ctx_ = ctx + return c +} + +func (c *VariantsetsSearchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchvariantsetsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/variantsets/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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.variantsets.search" call. +// Exactly one of *SearchVariantSetsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *SearchVariantSetsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *VariantsetsSearchCall) Do() (*SearchVariantSetsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SearchVariantSetsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a list of all variant sets matching search criteria. Implements [GlobalAllianceApi.searchVariantSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L49).", + // "httpMethod": "POST", + // "id": "genomics.variantsets.search", + // "path": "v1/variantsets/search", + // "request": { + // "$ref": "SearchVariantSetsRequest" + // }, + // "response": { + // "$ref": "SearchVariantSetsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/genomics/v1beta2/genomics-api.json b/Godeps/_workspace/src/google.golang.org/api/genomics/v1beta2/genomics-api.json new file mode 100644 index 000000000..25b81537b --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/genomics/v1beta2/genomics-api.json @@ -0,0 +1,3859 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/r3Yw5MfzaLpocptE3LE-pmOG6uY\"", + "discoveryVersion": "v1", + "id": "genomics:v1beta2", + "name": "genomics", + "version": "v1beta2", + "revision": "20150812", + "title": "Genomics API", + "description": "Provides access to Genomics 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/genomics/v1beta2/reference", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/genomics/v1beta2/", + "basePath": "/genomics/v1beta2/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "genomics/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/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.read_write": { + "description": "Manage your data in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/genomics": { + "description": "View and manage Genomics data" + }, + "https://www.googleapis.com/auth/genomics.readonly": { + "description": "View Genomics data" + } + } + } + }, + "schemas": { + "AlignReadGroupSetsRequest": { + "id": "AlignReadGroupSetsRequest", + "type": "object", + "description": "The read group set align request.", + "properties": { + "bamSourceUris": { + "type": "array", + "description": "The BAM source files for alignment. Exactly one of readGroupSetId, bamSourceUris, interleavedFastqSource or pairedFastqSource must be provided. The caller must have READ permissions for these files.", + "items": { + "type": "string" + } + }, + "datasetId": { + "type": "string", + "description": "Required. The ID of the dataset the newly aligned read group sets will belong to. The caller must have WRITE permissions to this dataset." + }, + "interleavedFastqSource": { + "$ref": "InterleavedFastqSource", + "description": "The interleaved FASTQ source files for alignment, where both members of each pair of reads are found on consecutive records within the same FASTQ file. Exactly one of readGroupSetId, bamSourceUris, interleavedFastqSource or pairedFastqSource must be provided." + }, + "pairedFastqSource": { + "$ref": "PairedFastqSource", + "description": "The paired end FASTQ source files for alignment, where each member of a pair of reads are found in separate files. Exactly one of readGroupSetId, bamSourceUris, interleavedFastqSource or pairedFastqSource must be provided." + }, + "readGroupSetId": { + "type": "string", + "description": "The ID of the read group set which will be aligned. A new read group set will be generated to hold the aligned data, the originals will not be modified. The caller must have READ permissions for this read group set. Exactly one of readGroupSetId, bamSourceUris, interleavedFastqSource or pairedFastqSource must be provided." + } + } + }, + "AlignReadGroupSetsResponse": { + "id": "AlignReadGroupSetsResponse", + "type": "object", + "description": "The read group set align response.", + "properties": { + "jobId": { + "type": "string", + "description": "A job ID that can be used to get status information." + } + } + }, + "Annotation": { + "id": "Annotation", + "type": "object", + "description": "An annotation describes a region of reference genome. The value of an annotation may be one of several canonical types, supplemented by arbitrary info tags. A variant annotation is represented by one or more of these canonical types. An annotation is not inherently associated with a specific sample or individual (though a client could choose to use annotations in this way). Example canonical annotation types are 'Gene' and 'Variant'.", + "properties": { + "annotationSetId": { + "type": "string", + "description": "The ID of the containing annotation set." + }, + "id": { + "type": "string", + "description": "The generated unique ID for this annotation." + }, + "info": { + "type": "object", + "description": "A string which maps to an array of values.", + "additionalProperties": { + "type": "array", + "description": "A string which maps to an array of values.", + "items": { + "type": "string" + } + } + }, + "name": { + "type": "string", + "description": "The display name of this annotation." + }, + "position": { + "$ref": "RangePosition", + "description": "The position of this annotation on the reference sequence." + }, + "transcript": { + "$ref": "Transcript", + "description": "A transcript value represents the assertion that a particular region of the reference genome may be transcribed as RNA. An alternative splicing pattern would be represented as a separate transcript object. This field is only set for annotations of type TRANSCRIPT." + }, + "type": { + "type": "string", + "description": "The data type for this annotation. Must match the containing annotation set's type.", + "enum": [ + "GENE", + "GENERIC", + "TRANSCRIPT", + "VARIANT" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "variant": { + "$ref": "VariantAnnotation", + "description": "A variant annotation, which describes the effect of a variant on the genome, the coding sequence, and/or higher level consequences at the organism level e.g. pathogenicity. This field is only set for annotations of type VARIANT." + } + } + }, + "AnnotationSet": { + "id": "AnnotationSet", + "type": "object", + "description": "An annotation set is a logical grouping of annotations that share consistent type information and provenance. Examples of annotation sets include 'all genes from refseq', and 'all variant annotations from ClinVar'.", + "properties": { + "datasetId": { + "type": "string", + "description": "The ID of the containing dataset." + }, + "id": { + "type": "string", + "description": "The generated unique ID for this annotation set." + }, + "info": { + "type": "object", + "description": "A string which maps to an array of values.", + "additionalProperties": { + "type": "array", + "description": "A string which maps to an array of values.", + "items": { + "type": "string" + } + } + }, + "name": { + "type": "string", + "description": "The display name for this annotation set." + }, + "referenceSetId": { + "type": "string", + "description": "The ID of the reference set that defines the coordinate space for this set's annotations." + }, + "sourceUri": { + "type": "string", + "description": "The source URI describing the file from which this annotation set was generated, if any." + }, + "type": { + "type": "string", + "description": "The type of annotations contained within this set.", + "enum": [ + "GENE", + "GENERIC", + "TRANSCRIPT", + "VARIANT" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "BatchAnnotationsResponse": { + "id": "BatchAnnotationsResponse", + "type": "object", + "properties": { + "entries": { + "type": "array", + "description": "The resulting per-annotation entries, ordered consistently with the original request.", + "items": { + "$ref": "BatchAnnotationsResponseEntry" + } + } + } + }, + "BatchAnnotationsResponseEntry": { + "id": "BatchAnnotationsResponseEntry", + "type": "object", + "properties": { + "annotation": { + "$ref": "Annotation", + "description": "The annotation, if any." + }, + "status": { + "$ref": "BatchAnnotationsResponseEntryStatus", + "description": "The resulting status for this annotation operation." + } + } + }, + "BatchAnnotationsResponseEntryStatus": { + "id": "BatchAnnotationsResponseEntryStatus", + "type": "object", + "description": "", + "properties": { + "code": { + "type": "integer", + "description": "The HTTP status code for this operation.", + "format": "int32" + }, + "message": { + "type": "string", + "description": "Error message for this status, if any." + } + } + }, + "BatchCreateAnnotationsRequest": { + "id": "BatchCreateAnnotationsRequest", + "type": "object", + "properties": { + "annotations": { + "type": "array", + "description": "The annotations to be created. At most 4096 can be specified in a single request.", + "items": { + "$ref": "Annotation" + } + } + } + }, + "Call": { + "id": "Call", + "type": "object", + "description": "A call represents the determination of genotype with respect to a particular variant. It may include associated information such as quality and phasing. For example, a call might assign a probability of 0.32 to the occurrence of a SNP named rs1234 in a call set with the name NA12345.", + "properties": { + "callSetId": { + "type": "string", + "description": "The ID of the call set this variant call belongs to." + }, + "callSetName": { + "type": "string", + "description": "The name of the call set this variant call belongs to." + }, + "genotype": { + "type": "array", + "description": "The genotype of this variant call. Each value represents either the value of the referenceBases field or a 1-based index into alternateBases. If a variant had a referenceBases value of T and an alternateBases value of [\"A\", \"C\"], and the genotype was [2, 1], that would mean the call represented the heterozygous value CA for this variant. If the genotype was instead [0, 1], the represented value would be TA. Ordering of the genotype values is important if the phaseset is present. If a genotype is not called (that is, a . is present in the GT string) -1 is returned.", + "items": { + "type": "integer", + "format": "int32" + } + }, + "genotypeLikelihood": { + "type": "array", + "description": "The genotype likelihoods for this variant call. Each array entry represents how likely a specific genotype is for this call. The value ordering is defined by the GL tag in the VCF spec. If Phred-scaled genotype likelihood scores (PL) are available and log10(P) genotype likelihood scores (GL) are not, PL scores are converted to GL scores. If both are available, PL scores are stored in info.", + "items": { + "type": "number", + "format": "double" + } + }, + "info": { + "type": "object", + "description": "A string which maps to an array of values.", + "additionalProperties": { + "type": "array", + "description": "A string which maps to an array of values.", + "items": { + "type": "string" + } + } + }, + "phaseset": { + "type": "string", + "description": "If this field is present, this variant call's genotype ordering implies the phase of the bases and is consistent with any other variant calls in the same reference sequence which have the same phaseset value. When importing data from VCF, if the genotype data was phased but no phase set was specified this field will be set to *." + } + } + }, + "CallReadGroupSetsRequest": { + "id": "CallReadGroupSetsRequest", + "type": "object", + "description": "The read group set call request.", + "properties": { + "datasetId": { + "type": "string", + "description": "Required. The ID of the dataset the called variants will belong to. The caller must have WRITE permissions to this dataset." + }, + "readGroupSetId": { + "type": "string", + "description": "The IDs of the read group sets which will be called. The caller must have READ permissions for these read group sets. One of readGroupSetId or sourceUris must be provided." + }, + "sourceUris": { + "type": "array", + "description": "A list of URIs pointing at BAM files in Google Cloud Storage which will be called. FASTQ files are not allowed. The caller must have READ permissions for these files. One of readGroupSetId or sourceUris must be provided.", + "items": { + "type": "string" + } + } + } + }, + "CallReadGroupSetsResponse": { + "id": "CallReadGroupSetsResponse", + "type": "object", + "description": "The read group set call response.", + "properties": { + "jobId": { + "type": "string", + "description": "A job ID that can be used to get status information." + } + } + }, + "CallSet": { + "id": "CallSet", + "type": "object", + "description": "A call set is a collection of variant calls, typically for one sample. It belongs to a variant set.", + "properties": { + "created": { + "type": "string", + "description": "The date this call set was created in milliseconds from the epoch.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "The Google generated ID of the call set, immutable." + }, + "info": { + "type": "object", + "description": "A string which maps to an array of values.", + "additionalProperties": { + "type": "array", + "description": "A string which maps to an array of values.", + "items": { + "type": "string" + } + } + }, + "name": { + "type": "string", + "description": "The call set name." + }, + "sampleId": { + "type": "string", + "description": "The sample ID this call set corresponds to." + }, + "variantSetIds": { + "type": "array", + "description": "The IDs of the variant sets this call set belongs to.", + "items": { + "type": "string" + } + } + } + }, + "CigarUnit": { + "id": "CigarUnit", + "type": "object", + "description": "A single CIGAR operation.", + "properties": { + "operation": { + "type": "string", + "enum": [ + "ALIGNMENT_MATCH", + "CLIP_HARD", + "CLIP_SOFT", + "DELETE", + "INSERT", + "OPERATION_UNSPECIFIED", + "PAD", + "SEQUENCE_MATCH", + "SEQUENCE_MISMATCH", + "SKIP" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "operationLength": { + "type": "string", + "description": "The number of bases that the operation runs for. Required.", + "format": "int64" + }, + "referenceSequence": { + "type": "string", + "description": "referenceSequence is only used at mismatches (SEQUENCE_MISMATCH) and deletions (DELETE). Filling this field replaces SAM's MD tag. If the relevant information is not available, this field is unset." + } + } + }, + "CoverageBucket": { + "id": "CoverageBucket", + "type": "object", + "description": "A bucket over which read coverage has been precomputed. A bucket corresponds to a specific range of the reference sequence.", + "properties": { + "meanCoverage": { + "type": "number", + "description": "The average number of reads which are aligned to each individual reference base in this bucket.", + "format": "float" + }, + "range": { + "$ref": "Range", + "description": "The genomic coordinate range spanned by this bucket." + } + } + }, + "Dataset": { + "id": "Dataset", + "type": "object", + "description": "A Dataset is a collection of genomic data.", + "properties": { + "createTime": { + "type": "string", + "description": "The time this dataset was created, in seconds from the epoch.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "The Google generated ID of the dataset, immutable." + }, + "isPublic": { + "type": "boolean", + "description": "Flag indicating whether or not a dataset is publicly viewable. If a dataset is not public, it inherits viewing permissions from its project." + }, + "name": { + "type": "string", + "description": "The dataset name." + }, + "projectNumber": { + "type": "string", + "description": "The Google Developers Console project number that this dataset belongs to.", + "format": "int64" + } + } + }, + "ExperimentalCreateJobRequest": { + "id": "ExperimentalCreateJobRequest", + "type": "object", + "description": "The job creation request.", + "properties": { + "align": { + "type": "boolean", + "description": "Specifies whether or not to run the alignment pipeline. Either align or callVariants must be set." + }, + "callVariants": { + "type": "boolean", + "description": "Specifies whether or not to run the variant calling pipeline. Either align or callVariants must be set." + }, + "gcsOutputPath": { + "type": "string", + "description": "Specifies where to copy the results of certain pipelines. This should be in the form of gs://bucket/path." + }, + "pairedSourceUris": { + "type": "array", + "description": "A list of Google Cloud Storage URIs of paired end .fastq files to operate upon. If specified, this represents the second file of each paired .fastq file. The first file of each pair should be specified in sourceUris.", + "items": { + "type": "string" + } + }, + "projectNumber": { + "type": "string", + "description": "Required. The Google Cloud Project ID with which to associate the request.", + "format": "int64" + }, + "sourceUris": { + "type": "array", + "description": "A list of Google Cloud Storage URIs of data files to operate upon. These can be .bam, interleaved .fastq, or paired .fastq. If specifying paired .fastq files, the first of each pair of files should be listed here, and the second of each pair should be listed in pairedSourceUris.", + "items": { + "type": "string" + } + } + } + }, + "ExperimentalCreateJobResponse": { + "id": "ExperimentalCreateJobResponse", + "type": "object", + "description": "The job creation response.", + "properties": { + "jobId": { + "type": "string", + "description": "A job ID that can be used to get status information." + } + } + }, + "ExportReadGroupSetsRequest": { + "id": "ExportReadGroupSetsRequest", + "type": "object", + "description": "The read group set export request.", + "properties": { + "exportUri": { + "type": "string", + "description": "Required. A Google Cloud Storage URI for the exported BAM file. The currently authenticated user must have write access to the new file. An error will be returned if the URI already contains data." + }, + "projectNumber": { + "type": "string", + "description": "Required. The Google Developers Console project number that owns this export.", + "format": "int64" + }, + "readGroupSetIds": { + "type": "array", + "description": "Required. The IDs of the read group sets to export.", + "items": { + "type": "string" + } + }, + "referenceNames": { + "type": "array", + "description": "The reference names to export. If this is not specified, all reference sequences, including unmapped reads, are exported. Use * to export only unmapped reads.", + "items": { + "type": "string" + } + } + } + }, + "ExportReadGroupSetsResponse": { + "id": "ExportReadGroupSetsResponse", + "type": "object", + "description": "The read group set export response.", + "properties": { + "jobId": { + "type": "string", + "description": "A job ID that can be used to get status information." + } + } + }, + "ExportVariantSetRequest": { + "id": "ExportVariantSetRequest", + "type": "object", + "description": "The variant data export request.", + "properties": { + "bigqueryDataset": { + "type": "string", + "description": "Required. The BigQuery dataset to export data to. This dataset must already exist. Note that this is distinct from the Genomics concept of \"dataset\"." + }, + "bigqueryTable": { + "type": "string", + "description": "Required. The BigQuery table to export data to. If the table doesn't exist, it will be created. If it already exists, it will be overwritten." + }, + "callSetIds": { + "type": "array", + "description": "If provided, only variant call information from the specified call sets will be exported. By default all variant calls are exported.", + "items": { + "type": "string" + } + }, + "format": { + "type": "string", + "description": "The format for the exported data.", + "enum": [ + "BIGQUERY" + ], + "enumDescriptions": [ + "" + ] + }, + "projectNumber": { + "type": "string", + "description": "Required. The Google Cloud project number that owns the destination BigQuery dataset. The caller must have WRITE access to this project. This project will also own the resulting export job.", + "format": "int64" + } + } + }, + "ExportVariantSetResponse": { + "id": "ExportVariantSetResponse", + "type": "object", + "description": "The variant data export response.", + "properties": { + "jobId": { + "type": "string", + "description": "A job ID that can be used to get status information." + } + } + }, + "ExternalId": { + "id": "ExternalId", + "type": "object", + "description": "", + "properties": { + "id": { + "type": "string", + "description": "The id used by the source of this data." + }, + "sourceName": { + "type": "string", + "description": "The name of the source of this data." + } + } + }, + "FastqMetadata": { + "id": "FastqMetadata", + "type": "object", + "properties": { + "libraryName": { + "type": "string", + "description": "Optionally specifies the library name for alignment from FASTQ." + }, + "platformName": { + "type": "string", + "description": "Optionally specifies the platform name for alignment from FASTQ. For example: CAPILLARY, LS454, ILLUMINA, SOLID, HELICOS, IONTORRENT, PACBIO." + }, + "platformUnit": { + "type": "string", + "description": "Optionally specifies the platform unit for alignment from FASTQ. For example: flowcell-barcode.lane for Illumina or slide for SOLID." + }, + "readGroupName": { + "type": "string", + "description": "Optionally specifies the read group name for alignment from FASTQ." + }, + "sampleName": { + "type": "string", + "description": "Optionally specifies the sample name for alignment from FASTQ." + } + } + }, + "ImportReadGroupSetsRequest": { + "id": "ImportReadGroupSetsRequest", + "type": "object", + "description": "The read group set import request.", + "properties": { + "datasetId": { + "type": "string", + "description": "Required. The ID of the dataset these read group sets will belong to. The caller must have WRITE permissions to this dataset." + }, + "partitionStrategy": { + "type": "string", + "description": "The partition strategy describes how read groups are partitioned into read group sets.", + "enum": [ + "MERGE_ALL", + "PER_FILE_PER_SAMPLE" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "referenceSetId": { + "type": "string", + "description": "The reference set to which the imported read group sets are aligned to, if any. The reference names of this reference set must be a superset of those found in the imported file headers. If no reference set id is provided, a best effort is made to associate with a matching reference set." + }, + "sourceUris": { + "type": "array", + "description": "A list of URIs pointing at BAM files in Google Cloud Storage.", + "items": { + "type": "string" + } + } + } + }, + "ImportReadGroupSetsResponse": { + "id": "ImportReadGroupSetsResponse", + "type": "object", + "description": "The read group set import response.", + "properties": { + "jobId": { + "type": "string", + "description": "A job ID that can be used to get status information." + } + } + }, + "ImportVariantsRequest": { + "id": "ImportVariantsRequest", + "type": "object", + "description": "The variant data import request.", + "properties": { + "format": { + "type": "string", + "description": "The format of the variant data being imported. If unspecified, defaults to to \"VCF\".", + "enum": [ + "COMPLETE_GENOMICS", + "VCF" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "normalizeReferenceNames": { + "type": "boolean", + "description": "Convert reference names to the canonical representation. hg19 haploytypes (those reference names containing \"_hap\") are not modified in any way. All other reference names are modified according to the following rules: The reference name is capitalized. The \"chr\" prefix is dropped for all autosomes and sex chromsomes. For example \"chr17\" becomes \"17\" and \"chrX\" becomes \"X\". All mitochondrial chromosomes (\"chrM\", \"chrMT\", etc) become \"MT\"." + }, + "sourceUris": { + "type": "array", + "description": "A list of URIs referencing variant files in Google Cloud Storage. URIs can include wildcards as described here. Note that recursive wildcards ('**') are not supported.", + "items": { + "type": "string" + } + } + } + }, + "ImportVariantsResponse": { + "id": "ImportVariantsResponse", + "type": "object", + "description": "The variant data import response.", + "properties": { + "jobId": { + "type": "string", + "description": "A job ID that can be used to get status information." + } + } + }, + "Int32Value": { + "id": "Int32Value", + "type": "object", + "description": "Wrapper message for `int32`.\n\nThe JSON representation for `Int32Value` is JSON number.", + "properties": { + "value": { + "type": "integer", + "description": "The int32 value.", + "format": "int32" + } + } + }, + "InterleavedFastqSource": { + "id": "InterleavedFastqSource", + "type": "object", + "description": "Describes an interleaved FASTQ file source for alignment.", + "properties": { + "metadata": { + "$ref": "FastqMetadata", + "description": "Optionally specifies the metadata to be associated with the final aligned read group set." + }, + "sourceUris": { + "type": "array", + "description": "A list of URIs pointing at interleaved FASTQ files in Google Cloud Storage which will be aligned. The caller must have READ permissions for these files.", + "items": { + "type": "string" + } + } + } + }, + "Job": { + "id": "Job", + "type": "object", + "description": "A Job represents an ongoing process that can be monitored for status information.", + "properties": { + "created": { + "type": "string", + "description": "The date this job was created, in milliseconds from the epoch.", + "format": "int64" + }, + "detailedStatus": { + "type": "string", + "description": "A more detailed description of this job's current status." + }, + "errors": { + "type": "array", + "description": "Any errors that occurred during processing.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "The job ID." + }, + "importedIds": { + "type": "array", + "description": "If this Job represents an import, this field will contain the IDs of the objects that were successfully imported.", + "items": { + "type": "string" + } + }, + "projectNumber": { + "type": "string", + "description": "The Google Developers Console project number to which this job belongs.", + "format": "int64" + }, + "request": { + "$ref": "JobRequest", + "description": "A summarized representation of the original service request." + }, + "status": { + "type": "string", + "description": "The status of this job.", + "enum": [ + "CANCELED", + "FAILURE", + "NEW", + "PENDING", + "RUNNING", + "SUCCESS", + "UNKNOWN_STATUS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "warnings": { + "type": "array", + "description": "Any warnings that occurred during processing.", + "items": { + "type": "string" + } + } + } + }, + "JobRequest": { + "id": "JobRequest", + "type": "object", + "description": "A summary representation of the service request that spawned the job.", + "properties": { + "destination": { + "type": "array", + "description": "The data destination of the request, for example, a Google BigQuery Table or Dataset ID.", + "items": { + "type": "string" + } + }, + "source": { + "type": "array", + "description": "The data source of the request, for example, a Google Cloud Storage object path or Readset ID.", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "description": "The original request type.", + "enum": [ + "ALIGN_READSETS", + "CALL_READSETS", + "EXPERIMENTAL_CREATE_JOB", + "EXPORT_READSETS", + "EXPORT_VARIANTS", + "IMPORT_READSETS", + "IMPORT_VARIANTS", + "UNKNOWN_TYPE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "KeyValue": { + "id": "KeyValue", + "type": "object", + "description": "Used to hold basic key value information.", + "properties": { + "key": { + "type": "string", + "description": "A string which maps to an array of values." + }, + "value": { + "type": "array", + "description": "The string values.", + "items": { + "type": "string" + } + } + } + }, + "LinearAlignment": { + "id": "LinearAlignment", + "type": "object", + "description": "A linear alignment can be represented by one CIGAR string. Describes the mapped position and local alignment of the read to the reference.", + "properties": { + "cigar": { + "type": "array", + "description": "Represents the local alignment of this sequence (alignment matches, indels, etc) against the reference.", + "items": { + "$ref": "CigarUnit" + } + }, + "mappingQuality": { + "type": "integer", + "description": "The mapping quality of this alignment. Represents how likely the read maps to this position as opposed to other locations.", + "format": "int32" + }, + "position": { + "$ref": "Position", + "description": "The position of this alignment." + } + } + }, + "ListBasesResponse": { + "id": "ListBasesResponse", + "type": "object", + "properties": { + "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. This field will be empty if there aren't any additional results." + }, + "offset": { + "type": "string", + "description": "The offset position (0-based) of the given sequence from the start of this Reference. This value will differ for each page in a paginated request.", + "format": "int64" + }, + "sequence": { + "type": "string", + "description": "A substring of the bases that make up this reference." + } + } + }, + "ListCoverageBucketsResponse": { + "id": "ListCoverageBucketsResponse", + "type": "object", + "properties": { + "bucketWidth": { + "type": "string", + "description": "The length of each coverage bucket in base pairs. Note that buckets at the end of a reference sequence may be shorter. This value is omitted if the bucket width is infinity (the default behaviour, with no range or targetBucketWidth).", + "format": "int64" + }, + "coverageBuckets": { + "type": "array", + "description": "The coverage buckets. The list of buckets is sparse; a bucket with 0 overlapping reads is not returned. A bucket never crosses more than one reference sequence. Each bucket has width bucketWidth, unless its end is the end of the reference sequence.", + "items": { + "$ref": "CoverageBucket" + } + }, + "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. This field will be empty if there aren't any additional results." + } + } + }, + "ListDatasetsResponse": { + "id": "ListDatasetsResponse", + "type": "object", + "description": "The dataset list response.", + "properties": { + "datasets": { + "type": "array", + "description": "The list of matching Datasets.", + "items": { + "$ref": "Dataset" + } + }, + "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. This field will be empty if there aren't any additional results." + } + } + }, + "MergeVariantsRequest": { + "id": "MergeVariantsRequest", + "type": "object", + "properties": { + "variants": { + "type": "array", + "description": "The variants to be merged with existing variants.", + "items": { + "$ref": "Variant" + } + } + } + }, + "Metadata": { + "id": "Metadata", + "type": "object", + "description": "Metadata describes a single piece of variant call metadata. These data include a top level key and either a single value string (value) or a list of key-value pairs (info.) Value and info are mutually exclusive.", + "properties": { + "description": { + "type": "string", + "description": "A textual description of this metadata." + }, + "id": { + "type": "string", + "description": "User-provided ID field, not enforced by this API. Two or more pieces of structured metadata with identical id and key fields are considered equivalent." + }, + "info": { + "type": "object", + "description": "A string which maps to an array of values.", + "additionalProperties": { + "type": "array", + "description": "A string which maps to an array of values.", + "items": { + "type": "string" + } + } + }, + "key": { + "type": "string", + "description": "The top-level key." + }, + "number": { + "type": "string", + "description": "The number of values that can be included in a field described by this metadata." + }, + "type": { + "type": "string", + "description": "The type of data. Possible types include: Integer, Float, Flag, Character, and String.", + "enum": [ + "CHARACTER", + "FLAG", + "FLOAT", + "INTEGER", + "STRING", + "UNKNOWN_TYPE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "value": { + "type": "string", + "description": "The value field for simple metadata" + } + } + }, + "PairedFastqSource": { + "id": "PairedFastqSource", + "type": "object", + "description": "Describes a paired-end FASTQ file source for alignment.", + "properties": { + "firstSourceUris": { + "type": "array", + "description": "A list of URIs pointing at paired end FASTQ files in Google Cloud Storage which will be aligned. The first of each paired file should be specified here, in an order that matches the second of each paired file specified in secondSourceUris. For example: firstSourceUris: [file1_1.fq, file2_1.fq], secondSourceUris: [file1_2.fq, file2_2.fq]. The caller must have READ permissions for these files.", + "items": { + "type": "string" + } + }, + "metadata": { + "$ref": "FastqMetadata", + "description": "Optionally specifies the metadata to be associated with the final aligned read group set." + }, + "secondSourceUris": { + "type": "array", + "description": "A list of URIs pointing at paired end FASTQ files in Google Cloud Storage which will be aligned. The second of each paired file should be specified here, in an order that matches the first of each paired file specified in firstSourceUris. For example: firstSourceUris: [file1_1.fq, file2_1.fq], secondSourceUris: [file1_2.fq, file2_2.fq]. The caller must have READ permissions for these files.", + "items": { + "type": "string" + } + } + } + }, + "Position": { + "id": "Position", + "type": "object", + "description": "An abstraction for referring to a genomic position, in relation to some already known reference. For now, represents a genomic position as a reference name, a base number on that reference (0-based), and a determination of forward or reverse strand.", + "properties": { + "position": { + "type": "string", + "description": "The 0-based offset from the start of the forward strand for that reference.", + "format": "int64" + }, + "referenceName": { + "type": "string", + "description": "The name of the reference in whatever reference set is being used." + }, + "reverseStrand": { + "type": "boolean", + "description": "Whether this position is on the reverse strand, as opposed to the forward strand." + } + } + }, + "QueryRange": { + "id": "QueryRange", + "type": "object", + "description": "A 0-based half-open genomic coordinate range for search requests.", + "properties": { + "end": { + "type": "string", + "description": "The end position of the range on the reference, 0-based exclusive. If specified, referenceId or referenceName must also be specified. If unset or 0, defaults to the length of the reference.", + "format": "int64" + }, + "referenceId": { + "type": "string", + "description": "The ID of the reference to query. At most one of referenceId and referenceName should be specified." + }, + "referenceName": { + "type": "string", + "description": "The name of the reference to query, within the reference set associated with this query. At most one of referenceId and referenceName pshould be specified." + }, + "start": { + "type": "string", + "description": "The start position of the range on the reference, 0-based inclusive. If specified, referenceId or referenceName must also be specified. Defaults to 0.", + "format": "int64" + } + } + }, + "Range": { + "id": "Range", + "type": "object", + "description": "A 0-based half-open genomic coordinate range over a reference sequence.", + "properties": { + "end": { + "type": "string", + "description": "The end position of the range on the reference, 0-based exclusive. If specified, referenceName must also be specified.", + "format": "int64" + }, + "referenceName": { + "type": "string", + "description": "The reference sequence name, for example chr1, 1, or chrX." + }, + "start": { + "type": "string", + "description": "The start position of the range on the reference, 0-based inclusive. If specified, referenceName must also be specified.", + "format": "int64" + } + } + }, + "RangePosition": { + "id": "RangePosition", + "type": "object", + "description": "A 0-based half-open genomic coordinate range over a reference sequence, for representing the position of a genomic resource.", + "properties": { + "end": { + "type": "string", + "description": "The end position of the range on the reference, 0-based exclusive.", + "format": "int64" + }, + "referenceId": { + "type": "string", + "description": "The ID of the Google Genomics reference associated with this range." + }, + "referenceName": { + "type": "string", + "description": "The display name corresponding to the reference specified by referenceId, for example chr1, 1, or chrX." + }, + "reverseStrand": { + "type": "boolean", + "description": "Whether this range refers to the reverse strand, as opposed to the forward strand. Note that regardless of this field, the start/end position of the range always refer to the forward strand." + }, + "start": { + "type": "string", + "description": "The start position of the range on the reference, 0-based inclusive.", + "format": "int64" + } + } + }, + "Read": { + "id": "Read", + "type": "object", + "description": "A read alignment describes a linear alignment of a string of DNA to a reference sequence, in addition to metadata about the fragment (the molecule of DNA sequenced) and the read (the bases which were read by the sequencer). A read is equivalent to a line in a SAM file. A read belongs to exactly one read group and exactly one read group set. Generating a reference-aligned sequence string When interacting with mapped reads, it's often useful to produce a string representing the local alignment of the read to reference. The following pseudocode demonstrates one way of doing this:\nout = \"\" offset = 0 for c in read.alignment.cigar { switch c.operation { case \"ALIGNMENT_MATCH\", \"SEQUENCE_MATCH\", \"SEQUENCE_MISMATCH\": out += read.alignedSequence[offset:offset+c.operationLength] offset += c.operationLength break case \"CLIP_SOFT\", \"INSERT\": offset += c.operationLength break case \"PAD\": out += repeat(\"*\", c.operationLength) break case \"DELETE\": out += repeat(\"-\", c.operationLength) break case \"SKIP\": out += repeat(\" \", c.operationLength) break case \"CLIP_HARD\": break } } return out\nConverting to SAM's CIGAR string The following pseudocode generates a SAM CIGAR string from the cigar field. Note that this is a lossy conversion (cigar.referenceSequence is lost).\ncigarMap = { \"ALIGNMENT_MATCH\": \"M\", \"INSERT\": \"I\", \"DELETE\": \"D\", \"SKIP\": \"N\", \"CLIP_SOFT\": \"S\", \"CLIP_HARD\": \"H\", \"PAD\": \"P\", \"SEQUENCE_MATCH\": \"=\", \"SEQUENCE_MISMATCH\": \"X\", } cigarStr = \"\" for c in read.alignment.cigar { cigarStr += c.operationLength + cigarMap[c.operation] } return cigarStr", + "properties": { + "alignedQuality": { + "type": "array", + "description": "The quality of the read sequence contained in this alignment record. alignedSequence and alignedQuality may be shorter than the full read sequence and quality. This will occur if the alignment is part of a chimeric alignment, or if the read was trimmed. When this occurs, the CIGAR for this read will begin/end with a hard clip operator that will indicate the length of the excised sequence.", + "items": { + "type": "integer", + "format": "int32" + } + }, + "alignedSequence": { + "type": "string", + "description": "The bases of the read sequence contained in this alignment record, without CIGAR operations applied. alignedSequence and alignedQuality may be shorter than the full read sequence and quality. This will occur if the alignment is part of a chimeric alignment, or if the read was trimmed. When this occurs, the CIGAR for this read will begin/end with a hard clip operator that will indicate the length of the excised sequence." + }, + "alignment": { + "$ref": "LinearAlignment", + "description": "The linear alignment for this alignment record. This field will be unset if the read is unmapped." + }, + "duplicateFragment": { + "type": "boolean", + "description": "The fragment is a PCR or optical duplicate (SAM flag 0x400)" + }, + "failedVendorQualityChecks": { + "type": "boolean", + "description": "SAM flag 0x200" + }, + "fragmentLength": { + "type": "integer", + "description": "The observed length of the fragment, equivalent to TLEN in SAM.", + "format": "int32" + }, + "fragmentName": { + "type": "string", + "description": "The fragment name. Equivalent to QNAME (query template name) in SAM." + }, + "id": { + "type": "string", + "description": "The unique ID for this read. This is a generated unique ID, not to be confused with fragmentName." + }, + "info": { + "type": "object", + "description": "A string which maps to an array of values.", + "additionalProperties": { + "type": "array", + "description": "A string which maps to an array of values.", + "items": { + "type": "string" + } + } + }, + "nextMatePosition": { + "$ref": "Position", + "description": "The position of the primary alignment of the (readNumber+1)%numberReads read in the fragment. It replaces mate position and mate strand in SAM. This field will be unset if that read is unmapped or if the fragment only has a single read." + }, + "numberReads": { + "type": "integer", + "description": "The number of reads in the fragment (extension to SAM flag 0x1).", + "format": "int32" + }, + "properPlacement": { + "type": "boolean", + "description": "The orientation and the distance between reads from the fragment are consistent with the sequencing protocol (SAM flag 0x2)" + }, + "readGroupId": { + "type": "string", + "description": "The ID of the read group this read belongs to. (Every read must belong to exactly one read group.)" + }, + "readGroupSetId": { + "type": "string", + "description": "The ID of the read group set this read belongs to. (Every read must belong to exactly one read group set.)" + }, + "readNumber": { + "type": "integer", + "description": "The read number in sequencing. 0-based and less than numberReads. This field replaces SAM flag 0x40 and 0x80.", + "format": "int32" + }, + "secondaryAlignment": { + "type": "boolean", + "description": "Whether this alignment is secondary. Equivalent to SAM flag 0x100. A secondary alignment represents an alternative to the primary alignment for this read. Aligners may return secondary alignments if a read can map ambiguously to multiple coordinates in the genome. By convention, each read has one and only one alignment where both secondaryAlignment and supplementaryAlignment are false." + }, + "supplementaryAlignment": { + "type": "boolean", + "description": "Whether this alignment is supplementary. Equivalent to SAM flag 0x800. Supplementary alignments are used in the representation of a chimeric alignment. In a chimeric alignment, a read is split into multiple linear alignments that map to different reference contigs. The first linear alignment in the read will be designated as the representative alignment; the remaining linear alignments will be designated as supplementary alignments. These alignments may have different mapping quality scores. In each linear alignment in a chimeric alignment, the read will be hard clipped. The alignedSequence and alignedQuality fields in the alignment record will only represent the bases for its respective linear alignment." + } + } + }, + "ReadGroup": { + "id": "ReadGroup", + "type": "object", + "description": "A read group is all the data that's processed the same way by the sequencer.", + "properties": { + "datasetId": { + "type": "string", + "description": "The ID of the dataset this read group belongs to." + }, + "description": { + "type": "string", + "description": "A free-form text description of this read group." + }, + "experiment": { + "$ref": "ReadGroupExperiment", + "description": "The experiment used to generate this read group." + }, + "id": { + "type": "string", + "description": "The generated unique read group ID. Note: This is different than the @RG ID field in the SAM spec. For that value, see the name field." + }, + "info": { + "type": "object", + "description": "A string which maps to an array of values.", + "additionalProperties": { + "type": "array", + "description": "A string which maps to an array of values.", + "items": { + "type": "string" + } + } + }, + "name": { + "type": "string", + "description": "The read group name. This corresponds to the @RG ID field in the SAM spec." + }, + "predictedInsertSize": { + "type": "integer", + "description": "The predicted insert size of this read group. The insert size is the length the sequenced DNA fragment from end-to-end, not including the adapters.", + "format": "int32" + }, + "programs": { + "type": "array", + "description": "The programs used to generate this read group. Programs are always identical for all read groups within a read group set. For this reason, only the first read group in a returned set will have this field populated.", + "items": { + "$ref": "ReadGroupProgram" + } + }, + "referenceSetId": { + "type": "string", + "description": "The reference set the reads in this read group are aligned to. Required if there are any read alignments." + }, + "sampleId": { + "type": "string", + "description": "The sample this read group's data was generated from. Note: This is not an actual ID within this repository, but rather an identifier for a sample which may be meaningful to some external system." + } + } + }, + "ReadGroupExperiment": { + "id": "ReadGroupExperiment", + "type": "object", + "properties": { + "instrumentModel": { + "type": "string", + "description": "The instrument model used as part of this experiment. This maps to sequencing technology in BAM." + }, + "libraryId": { + "type": "string", + "description": "The library used as part of this experiment. Note: This is not an actual ID within this repository, but rather an identifier for a library which may be meaningful to some external system." + }, + "platformUnit": { + "type": "string", + "description": "The platform unit used as part of this experiment e.g. flowcell-barcode.lane for Illumina or slide for SOLiD. Corresponds to the" + }, + "sequencingCenter": { + "type": "string", + "description": "The sequencing center used as part of this experiment." + } + } + }, + "ReadGroupProgram": { + "id": "ReadGroupProgram", + "type": "object", + "properties": { + "commandLine": { + "type": "string", + "description": "The command line used to run this program." + }, + "id": { + "type": "string", + "description": "The user specified locally unique ID of the program. Used along with prevProgramId to define an ordering between programs." + }, + "name": { + "type": "string", + "description": "The name of the program." + }, + "prevProgramId": { + "type": "string", + "description": "The ID of the program run before this one." + }, + "version": { + "type": "string", + "description": "The version of the program run." + } + } + }, + "ReadGroupSet": { + "id": "ReadGroupSet", + "type": "object", + "description": "A read group set is a logical collection of read groups, which are collections of reads produced by a sequencer. A read group set typically models reads corresponding to one sample, sequenced one way, and aligned one way. \n- A read group set belongs to one dataset.\n- A read group belongs to one read group set.\n- A read belongs to one read group.", + "properties": { + "datasetId": { + "type": "string", + "description": "The dataset ID." + }, + "filename": { + "type": "string", + "description": "The filename of the original source file for this read group set, if any." + }, + "id": { + "type": "string", + "description": "The read group set ID." + }, + "info": { + "type": "object", + "description": "A string which maps to an array of values.", + "additionalProperties": { + "type": "array", + "description": "A string which maps to an array of values.", + "items": { + "type": "string" + } + } + }, + "name": { + "type": "string", + "description": "The read group set name. By default this will be initialized to the sample name of the sequenced data contained in this set." + }, + "readGroups": { + "type": "array", + "description": "The read groups in this set. There are typically 1-10 read groups in a read group set.", + "items": { + "$ref": "ReadGroup" + } + }, + "referenceSetId": { + "type": "string", + "description": "The reference set the reads in this read group set are aligned to." + } + } + }, + "Reference": { + "id": "Reference", + "type": "object", + "description": "A reference is a canonical assembled DNA sequence, intended to act as a reference coordinate space for other genomic annotations. A single reference might represent the human chromosome 1 or mitochandrial DNA, for instance. A reference belongs to one or more reference sets.", + "properties": { + "id": { + "type": "string", + "description": "The Google generated immutable ID of the reference." + }, + "length": { + "type": "string", + "description": "The length of this reference's sequence.", + "format": "int64" + }, + "md5checksum": { + "type": "string", + "description": "MD5 of the upper-case sequence excluding all whitespace characters (this is equivalent to SQ:M5 in SAM). This value is represented in lower case hexadecimal format." + }, + "name": { + "type": "string", + "description": "The name of this reference, for example 22." + }, + "ncbiTaxonId": { + "type": "integer", + "description": "ID from http://www.ncbi.nlm.nih.gov/taxonomy (e.g. 9606-\u003ehuman) if not specified by the containing reference set.", + "format": "int32" + }, + "sourceAccessions": { + "type": "array", + "description": "All known corresponding accession IDs in INSDC (GenBank/ENA/DDBJ) ideally with a version number, for example GCF_000001405.26.", + "items": { + "type": "string" + } + }, + "sourceURI": { + "type": "string", + "description": "The URI from which the sequence was obtained. Specifies a FASTA format file/string with one name, sequence pair." + } + } + }, + "ReferenceBound": { + "id": "ReferenceBound", + "type": "object", + "description": "ReferenceBound records an upper bound for the starting coordinate of variants in a particular reference.", + "properties": { + "referenceName": { + "type": "string", + "description": "The reference the bound is associate with." + }, + "upperBound": { + "type": "string", + "description": "An upper bound (inclusive) on the starting coordinate of any variant in the reference sequence.", + "format": "int64" + } + } + }, + "ReferenceSet": { + "id": "ReferenceSet", + "type": "object", + "description": "A reference set is a set of references which typically comprise a reference assembly for a species, such as GRCh38 which is representative of the human genome. A reference set defines a common coordinate space for comparing reference-aligned experimental data. A reference set contains 1 or more references.", + "properties": { + "assemblyId": { + "type": "string", + "description": "Public id of this reference set, such as GRCh37." + }, + "description": { + "type": "string", + "description": "Free text description of this reference set." + }, + "id": { + "type": "string", + "description": "The Google generated immutable ID of the reference set." + }, + "md5checksum": { + "type": "string", + "description": "Order-independent MD5 checksum which identifies this reference set. The checksum is computed by sorting all lower case hexidecimal string reference.md5checksum (for all reference in this set) in ascending lexicographic order, concatenating, and taking the MD5 of that value. The resulting value is represented in lower case hexadecimal format." + }, + "ncbiTaxonId": { + "type": "integer", + "description": "ID from http://www.ncbi.nlm.nih.gov/taxonomy (e.g. 9606-\u003ehuman) indicating the species which this assembly is intended to model. Note that contained references may specify a different ncbiTaxonId, as assemblies may contain reference sequences which do not belong to the modeled species, e.g. EBV in a human reference genome.", + "format": "int32" + }, + "referenceIds": { + "type": "array", + "description": "The IDs of the reference objects that are part of this set. Reference.md5checksum must be unique within this set.", + "items": { + "type": "string" + } + }, + "sourceAccessions": { + "type": "array", + "description": "All known corresponding accession IDs in INSDC (GenBank/ENA/DDBJ) ideally with a version number, for example NC_000001.11.", + "items": { + "type": "string" + } + }, + "sourceURI": { + "type": "string", + "description": "The URI from which the references were obtained." + } + } + }, + "SearchAnnotationSetsRequest": { + "id": "SearchAnnotationSetsRequest", + "type": "object", + "properties": { + "datasetIds": { + "type": "array", + "description": "The dataset IDs to search within. Caller must have READ access to these datasets.", + "items": { + "type": "string" + } + }, + "name": { + "type": "string", + "description": "Only return annotations sets for which a substring of the name matches this string (case insensitive)." + }, + "pageSize": { + "type": "integer", + "description": "Specifies number of results to return in a single page. If unspecified, it will default to 128. The maximum value is 1024.", + "format": "int32" + }, + "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." + }, + "referenceSetId": { + "type": "string", + "description": "If specified, only annotation sets associated with the given reference set are returned." + }, + "types": { + "type": "array", + "description": "If specified, only annotation sets that have any of these types are returned.", + "items": { + "type": "string", + "enum": [ + "GENE", + "GENERIC", + "TRANSCRIPT", + "VARIANT" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + } + }, + "SearchAnnotationSetsResponse": { + "id": "SearchAnnotationSetsResponse", + "type": "object", + "properties": { + "annotationSets": { + "type": "array", + "description": "The matching annotation sets.", + "items": { + "$ref": "AnnotationSet" + } + }, + "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. This field will be empty if there aren't any additional results." + } + } + }, + "SearchAnnotationsRequest": { + "id": "SearchAnnotationsRequest", + "type": "object", + "properties": { + "annotationSetIds": { + "type": "array", + "description": "The annotation sets to search within. The caller must have READ access to these annotation sets. Required. All queried annotation sets must have the same type.", + "items": { + "type": "string" + } + }, + "pageSize": { + "type": "integer", + "description": "Specifies number of results to return in a single page. If unspecified, it will default to 256. The maximum value is 2048.", + "format": "int32" + }, + "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." + }, + "range": { + "$ref": "QueryRange", + "description": "If specified, this query matches only annotations that overlap this range." + } + } + }, + "SearchAnnotationsResponse": { + "id": "SearchAnnotationsResponse", + "type": "object", + "properties": { + "annotations": { + "type": "array", + "description": "The matching annotations.", + "items": { + "$ref": "Annotation" + } + }, + "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. This field will be empty if there aren't any additional results." + } + } + }, + "SearchCallSetsRequest": { + "id": "SearchCallSetsRequest", + "type": "object", + "description": "The call set search request.", + "properties": { + "name": { + "type": "string", + "description": "Only return call sets for which a substring of the name matches this string." + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of call sets to return. If unspecified, defaults to 1000.", + "format": "int32" + }, + "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." + }, + "variantSetIds": { + "type": "array", + "description": "Restrict the query to call sets within the given variant sets. At least one ID must be provided.", + "items": { + "type": "string" + } + } + } + }, + "SearchCallSetsResponse": { + "id": "SearchCallSetsResponse", + "type": "object", + "description": "The call set search response.", + "properties": { + "callSets": { + "type": "array", + "description": "The list of matching call sets.", + "items": { + "$ref": "CallSet" + } + }, + "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. This field will be empty if there aren't any additional results." + } + } + }, + "SearchJobsRequest": { + "id": "SearchJobsRequest", + "type": "object", + "description": "The jobs search request.", + "properties": { + "createdAfter": { + "type": "string", + "description": "If specified, only jobs created on or after this date, given in milliseconds since Unix epoch, will be returned.", + "format": "int64" + }, + "createdBefore": { + "type": "string", + "description": "If specified, only jobs created prior to this date, given in milliseconds since Unix epoch, will be returned.", + "format": "int64" + }, + "pageSize": { + "type": "integer", + "description": "Specifies the number of results to return in a single page. Defaults to 128. The maximum value is 256.", + "format": "int32" + }, + "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 the nextPageToken from the previous response." + }, + "projectNumber": { + "type": "string", + "description": "Required. Only return jobs which belong to this Google Developers Console project.", + "format": "int64" + }, + "status": { + "type": "array", + "description": "Only return jobs which have a matching status.", + "items": { + "type": "string", + "enum": [ + "CANCELED", + "FAILURE", + "NEW", + "PENDING", + "RUNNING", + "SUCCESS", + "UNKNOWN_STATUS" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + } + } + } + }, + "SearchJobsResponse": { + "id": "SearchJobsResponse", + "type": "object", + "description": "The job search response.", + "properties": { + "jobs": { + "type": "array", + "description": "The list of jobs results, ordered newest to oldest.", + "items": { + "$ref": "Job" + } + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token which is used to page through large result sets. Provide this value is a subsequent request to return the next page of results. This field will be empty if there are no more results." + } + } + }, + "SearchReadGroupSetsRequest": { + "id": "SearchReadGroupSetsRequest", + "type": "object", + "description": "The read group set search request.", + "properties": { + "datasetIds": { + "type": "array", + "description": "Restricts this query to read group sets within the given datasets. At least one ID must be provided.", + "items": { + "type": "string" + } + }, + "name": { + "type": "string", + "description": "Only return read group sets for which a substring of the name matches this string." + }, + "pageSize": { + "type": "integer", + "description": "Specifies number of results to return in a single page. If unspecified, it will default to 256. The maximum value is 1024.", + "format": "int32" + }, + "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." + } + } + }, + "SearchReadGroupSetsResponse": { + "id": "SearchReadGroupSetsResponse", + "type": "object", + "description": "The read group set search response.", + "properties": { + "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. This field will be empty if there aren't any additional results." + }, + "readGroupSets": { + "type": "array", + "description": "The list of matching read group sets.", + "items": { + "$ref": "ReadGroupSet" + } + } + } + }, + "SearchReadsRequest": { + "id": "SearchReadsRequest", + "type": "object", + "description": "The read search request.", + "properties": { + "end": { + "type": "string", + "description": "The end position of the range on the reference, 0-based exclusive. If specified, referenceName must also be specified.", + "format": "int64" + }, + "pageSize": { + "type": "integer", + "description": "Specifies number of results to return in a single page. If unspecified, it will default to 256. The maximum value is 2048.", + "format": "int32" + }, + "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." + }, + "readGroupIds": { + "type": "array", + "description": "The IDs of the read groups within which to search for reads. All specified read groups must belong to the same read group sets. Must specify one of readGroupSetIds or readGroupIds.", + "items": { + "type": "string" + } + }, + "readGroupSetIds": { + "type": "array", + "description": "The IDs of the read groups sets within which to search for reads. All specified read group sets must be aligned against a common set of reference sequences; this defines the genomic coordinates for the query. Must specify one of readGroupSetIds or readGroupIds.", + "items": { + "type": "string" + } + }, + "referenceName": { + "type": "string", + "description": "The reference sequence name, for example chr1, 1, or chrX. If set to *, only unmapped reads are returned." + }, + "start": { + "type": "string", + "description": "The start position of the range on the reference, 0-based inclusive. If specified, referenceName must also be specified.", + "format": "int64" + } + } + }, + "SearchReadsResponse": { + "id": "SearchReadsResponse", + "type": "object", + "description": "The read search response.", + "properties": { + "alignments": { + "type": "array", + "description": "The list of matching alignments sorted by mapped genomic coordinate, if any, ascending in position within the same reference. Unmapped reads, which have no position, are returned contiguously and are sorted in ascending lexicographic order by fragment name.", + "items": { + "$ref": "Read" + } + }, + "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. This field will be empty if there aren't any additional results." + } + } + }, + "SearchReferenceSetsRequest": { + "id": "SearchReferenceSetsRequest", + "type": "object", + "description": "", + "properties": { + "accessions": { + "type": "array", + "description": "If present, return references for which the accession matches any of these strings. Best to give a version number, for example GCF_000001405.26. If only the main accession number is given then all records with that main accession will be returned, whichever version. Note that different versions will have different sequences.", + "items": { + "type": "string" + } + }, + "assemblyId": { + "type": "string", + "description": "If present, return reference sets for which a substring of their assemblyId matches this string (case insensitive)." + }, + "md5checksums": { + "type": "array", + "description": "If present, return references for which the md5checksum matches. See ReferenceSet.md5checksum for details.", + "items": { + "type": "string" + } + }, + "pageSize": { + "type": "integer", + "description": "Specifies the maximum number of results to return in a single page.", + "format": "int32" + }, + "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." + } + } + }, + "SearchReferenceSetsResponse": { + "id": "SearchReferenceSetsResponse", + "type": "object", + "properties": { + "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. This field will be empty if there aren't any additional results." + }, + "referenceSets": { + "type": "array", + "description": "The matching references sets.", + "items": { + "$ref": "ReferenceSet" + } + } + } + }, + "SearchReferencesRequest": { + "id": "SearchReferencesRequest", + "type": "object", + "description": "", + "properties": { + "accessions": { + "type": "array", + "description": "If present, return references for which the accession matches this string. Best to give a version number, for example GCF_000001405.26. If only the main accession number is given then all records with that main accession will be returned, whichever version. Note that different versions will have different sequences.", + "items": { + "type": "string" + } + }, + "md5checksums": { + "type": "array", + "description": "If present, return references for which the md5checksum matches. See Reference.md5checksum for construction details.", + "items": { + "type": "string" + } + }, + "pageSize": { + "type": "integer", + "description": "Specifies the maximum number of results to return in a single page.", + "format": "int32" + }, + "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." + }, + "referenceSetId": { + "type": "string", + "description": "If present, return only references which belong to this reference set." + } + } + }, + "SearchReferencesResponse": { + "id": "SearchReferencesResponse", + "type": "object", + "properties": { + "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. This field will be empty if there aren't any additional results." + }, + "references": { + "type": "array", + "description": "The matching references.", + "items": { + "$ref": "Reference" + } + } + } + }, + "SearchVariantSetsRequest": { + "id": "SearchVariantSetsRequest", + "type": "object", + "description": "The search variant sets request.", + "properties": { + "datasetIds": { + "type": "array", + "description": "Exactly one dataset ID must be provided here. Only variant sets which belong to this dataset will be returned.", + "items": { + "type": "string" + } + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of variant sets to return in a request.", + "format": "int32" + }, + "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." + } + } + }, + "SearchVariantSetsResponse": { + "id": "SearchVariantSetsResponse", + "type": "object", + "description": "The search variant sets response.", + "properties": { + "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. This field will be empty if there aren't any additional results." + }, + "variantSets": { + "type": "array", + "description": "The variant sets belonging to the requested dataset.", + "items": { + "$ref": "VariantSet" + } + } + } + }, + "SearchVariantsRequest": { + "id": "SearchVariantsRequest", + "type": "object", + "description": "The variant search request.", + "properties": { + "callSetIds": { + "type": "array", + "description": "Only return variant calls which belong to call sets with these ids. Leaving this blank returns all variant calls. If a variant has no calls belonging to any of these call sets, it won't be returned at all. Currently, variants with no calls from any call set will never be returned.", + "items": { + "type": "string" + } + }, + "end": { + "type": "string", + "description": "The end of the window, 0-based exclusive. If unspecified or 0, defaults to the length of the reference.", + "format": "int64" + }, + "maxCalls": { + "type": "integer", + "description": "The maximum number of calls to return. However, at least one variant will always be returned, even if it has more calls than this limit. If unspecified, defaults to 5000.", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of variants to return. If unspecified, defaults to 5000.", + "format": "int32" + }, + "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." + }, + "referenceName": { + "type": "string", + "description": "Required. Only return variants in this reference sequence." + }, + "start": { + "type": "string", + "description": "The beginning of the window (0-based, inclusive) for which overlapping variants should be returned. If unspecified, defaults to 0.", + "format": "int64" + }, + "variantName": { + "type": "string", + "description": "Only return variants which have exactly this name." + }, + "variantSetIds": { + "type": "array", + "description": "At most one variant set ID must be provided. Only variants from this variant set will be returned. If omitted, a call set id must be included in the request.", + "items": { + "type": "string" + } + } + } + }, + "SearchVariantsResponse": { + "id": "SearchVariantsResponse", + "type": "object", + "description": "The variant search response.", + "properties": { + "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. This field will be empty if there aren't any additional results." + }, + "variants": { + "type": "array", + "description": "The list of matching Variants.", + "items": { + "$ref": "Variant" + } + } + } + }, + "Transcript": { + "id": "Transcript", + "type": "object", + "description": "A transcript represents the assertion that a particular region of the reference genome may be transcribed as RNA.", + "properties": { + "codingSequence": { + "$ref": "TranscriptCodingSequence", + "description": "The range of the coding sequence for this transcript, if any. To determine the exact ranges of coding sequence, intersect this range with those of the exons, if any. If there are any exons, the codingSequence must start and end within them.\n\nNote that in some cases, the reference genome will not exactly match the observed mRNA transcript e.g. due to variance in the source genome from reference. In these cases, exon.frame will not necessarily match the expected reference reading frame and coding exon reference bases cannot necessarily be concatenated to produce the original transcript mRNA." + }, + "exons": { + "type": "array", + "description": "The exons that compose this transcript. This field should be unset for genomes where transcript splicing does not occur, for example prokaryotes.\n\n\nIntrons are regions of the transcript that are not included in the spliced RNA product. Though not explicitly modeled here, intron ranges can be deduced; all regions of this transcript that are not exons are introns.\n\n\nExonic sequences do not necessarily code for a translational product (amino acids). Only the regions of exons bounded by the codingSequence correspond to coding DNA sequence.\n\n\nExons are ordered by start position and may not overlap.", + "items": { + "$ref": "TranscriptExon" + } + }, + "geneId": { + "type": "string", + "description": "The annotation ID of the gene from which this transcript is transcribed." + } + } + }, + "TranscriptCodingSequence": { + "id": "TranscriptCodingSequence", + "type": "object", + "properties": { + "end": { + "type": "string", + "description": "The end of the coding sequence on this annotation's reference sequence, 0-based exclusive. Note that this position is relative to the reference start, and not the containing annotation start.", + "format": "int64" + }, + "start": { + "type": "string", + "description": "The start of the coding sequence on this annotation's reference sequence, 0-based inclusive. Note that this position is relative to the reference start, and not the containing annotation start.", + "format": "int64" + } + } + }, + "TranscriptExon": { + "id": "TranscriptExon", + "type": "object", + "properties": { + "end": { + "type": "string", + "description": "The end position of the exon on this annotation's reference sequence, 0-based exclusive. Note that this is relative to the reference start, and not the containing annotation start.", + "format": "int64" + }, + "frame": { + "$ref": "Int32Value", + "description": "The frame of this exon. Contains a value of 0, 1, or 2, which indicates the offset of the first coding base of the exon within the reading frame of the coding DNA sequence, if any. This field is dependent on the strandedness of this annotation (see Annotation.position.reverseStrand). For forward stranded annotations, this offset is relative to the exon.start. For reverse strand annotations, this offset is relative to the exon.end-1.\n\nUnset if this exon does not intersect the coding sequence. Upon creation of a transcript, the frame must be populated for all or none of the coding exons." + }, + "start": { + "type": "string", + "description": "The start position of the exon on this annotation's reference sequence, 0-based inclusive. Note that this is relative to the reference start, and not the containing annotation start.", + "format": "int64" + } + } + }, + "Variant": { + "id": "Variant", + "type": "object", + "description": "A variant represents a change in DNA sequence relative to a reference sequence. For example, a variant could represent a SNP or an insertion. Variants belong to a variant set. Each of the calls on a variant represent a determination of genotype with respect to that variant. For example, a call might assign probability of 0.32 to the occurrence of a SNP named rs1234 in a sample named NA12345. A call belongs to a call set, which contains related calls typically from one sample.", + "properties": { + "alternateBases": { + "type": "array", + "description": "The bases that appear instead of the reference bases.", + "items": { + "type": "string" + } + }, + "calls": { + "type": "array", + "description": "The variant calls for this particular variant. Each one represents the determination of genotype with respect to this variant.", + "items": { + "$ref": "Call" + } + }, + "created": { + "type": "string", + "description": "The date this variant was created, in milliseconds from the epoch.", + "format": "int64" + }, + "end": { + "type": "string", + "description": "The end position (0-based) of this variant. This corresponds to the first base after the last base in the reference allele. So, the length of the reference allele is (end - start). This is useful for variants that don't explicitly give alternate bases, for example large deletions.", + "format": "int64" + }, + "filter": { + "type": "array", + "description": "A list of filters (normally quality filters) this variant has failed. PASS indicates this variant has passed all filters.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "The Google generated ID of the variant, immutable." + }, + "info": { + "type": "object", + "description": "A string which maps to an array of values.", + "additionalProperties": { + "type": "array", + "description": "A string which maps to an array of values.", + "items": { + "type": "string" + } + } + }, + "names": { + "type": "array", + "description": "Names for the variant, for example a RefSNP ID.", + "items": { + "type": "string" + } + }, + "quality": { + "type": "number", + "description": "A measure of how likely this variant is to be real. A higher value is better.", + "format": "double" + }, + "referenceBases": { + "type": "string", + "description": "The reference bases for this variant. They start at the given position." + }, + "referenceName": { + "type": "string", + "description": "The reference on which this variant occurs. (such as chr20 or X)" + }, + "start": { + "type": "string", + "description": "The position at which this variant occurs (0-based). This corresponds to the first base of the string of reference bases.", + "format": "int64" + }, + "variantSetId": { + "type": "string", + "description": "The ID of the variant set this variant belongs to." + } + } + }, + "VariantAnnotation": { + "id": "VariantAnnotation", + "type": "object", + "description": "A Variant annotation.", + "properties": { + "alternateBases": { + "type": "string", + "description": "The alternate allele for this variant. If multiple alternate alleles exist at this location, create a separate variant for each one, as they may represent distinct conditions." + }, + "clinicalSignificance": { + "type": "string", + "description": "Describes the clinical significance of a variant. It is adapted from the ClinVar controlled vocabulary for clinical significance described at: http://www.ncbi.nlm.nih.gov/clinvar/docs/clinsig/", + "enum": [ + "ASSOCIATION", + "BENIGN", + "CLINICAL_SIGNIFICANCE_UNSPECIFIED", + "CONFERS_SENSITIVITY", + "DRUG_RESPONSE", + "HISTOCOMPATIBILITY", + "LIKELY_BENIGN", + "LIKELY_PATHOGENIC", + "MULTIPLE_REPORTED", + "OTHER", + "PATHOGENIC", + "PROTECTIVE", + "RISK_FACTOR", + "UNCERTAIN" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "conditions": { + "type": "array", + "description": "The set of conditions associated with this variant. A condition describes the way a variant influences human health.", + "items": { + "$ref": "VariantAnnotationCondition" + } + }, + "effect": { + "type": "string", + "description": "Effect of the variant on the coding sequence.", + "enum": [ + "EFFECT_UNSPECIFIED", + "FRAMESHIFT", + "FRAME_PRESERVING_INDEL", + "NONSYNONYMOUS_SNP", + "OTHER", + "SPLICE_SITE_DISRUPTION", + "STOP_GAIN", + "STOP_LOSS", + "SYNONYMOUS_SNP" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "geneId": { + "type": "string", + "description": "Google annotation ID of the gene affected by this variant. This should be provided when the variant is created." + }, + "transcriptIds": { + "type": "array", + "description": "Google annotation IDs of the transcripts affected by this variant. These should be provided when the variant is created.", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "description": "Type has been adapted from ClinVar's list of variant types.", + "enum": [ + "CNV", + "DELETION", + "INSERTION", + "OTHER", + "SNP", + "STRUCTURAL", + "SUBSTITUTION", + "TYPE_UNSPECIFIED" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "VariantAnnotationCondition": { + "id": "VariantAnnotationCondition", + "type": "object", + "description": "", + "properties": { + "conceptId": { + "type": "string", + "description": "The MedGen concept id associated with this gene. Search for these IDs at http://www.ncbi.nlm.nih.gov/medgen/" + }, + "externalIds": { + "type": "array", + "description": "The set of external IDs for this condition.", + "items": { + "$ref": "ExternalId" + } + }, + "names": { + "type": "array", + "description": "A set of names for the condition.", + "items": { + "type": "string" + } + }, + "omimId": { + "type": "string", + "description": "The OMIM id for this condition. Search for these IDs at http://omim.org/" + } + } + }, + "VariantSet": { + "id": "VariantSet", + "type": "object", + "description": "A variant set is a collection of call sets and variants. It contains summary statistics of those contents. A variant set belongs to a dataset.", + "properties": { + "datasetId": { + "type": "string", + "description": "The dataset to which this variant set belongs. Immutable." + }, + "id": { + "type": "string", + "description": "The Google-generated ID of the variant set. Immutable." + }, + "metadata": { + "type": "array", + "description": "The metadata associated with this variant set.", + "items": { + "$ref": "Metadata" + } + }, + "referenceBounds": { + "type": "array", + "description": "A list of all references used by the variants in a variant set with associated coordinate upper bounds for each one.", + "items": { + "$ref": "ReferenceBound" + } + } + } + } + }, + "resources": { + "annotationSets": { + "methods": { + "create": { + "id": "genomics.annotationSets.create", + "path": "annotationSets", + "httpMethod": "POST", + "description": "Creates a new annotation set. Caller must have WRITE permission for the associated dataset.", + "request": { + "$ref": "AnnotationSet" + }, + "response": { + "$ref": "AnnotationSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "delete": { + "id": "genomics.annotationSets.delete", + "path": "annotationSets/{annotationSetId}", + "httpMethod": "DELETE", + "description": "Deletes an annotation set. Caller must have WRITE permission for the associated annotation set.", + "parameters": { + "annotationSetId": { + "type": "string", + "description": "The ID of the annotation set to be deleted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "annotationSetId" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "get": { + "id": "genomics.annotationSets.get", + "path": "annotationSets/{annotationSetId}", + "httpMethod": "GET", + "description": "Gets an annotation set. Caller must have READ permission for the associated dataset.", + "parameters": { + "annotationSetId": { + "type": "string", + "description": "The ID of the annotation set to be retrieved.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "annotationSetId" + ], + "response": { + "$ref": "AnnotationSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "patch": { + "id": "genomics.annotationSets.patch", + "path": "annotationSets/{annotationSetId}", + "httpMethod": "PATCH", + "description": "Updates an annotation set. The update must respect all mutability restrictions and other invariants described on the annotation set resource. Caller must have WRITE permission for the associated dataset. This method supports patch semantics.", + "parameters": { + "annotationSetId": { + "type": "string", + "description": "The ID of the annotation set to be updated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "annotationSetId" + ], + "request": { + "$ref": "AnnotationSet" + }, + "response": { + "$ref": "AnnotationSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "search": { + "id": "genomics.annotationSets.search", + "path": "annotationSets/search", + "httpMethod": "POST", + "description": "Searches for annotation sets that match the given criteria. Results are returned in a deterministic order. Caller must have READ permission for the queried datasets.", + "request": { + "$ref": "SearchAnnotationSetsRequest" + }, + "response": { + "$ref": "SearchAnnotationSetsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "update": { + "id": "genomics.annotationSets.update", + "path": "annotationSets/{annotationSetId}", + "httpMethod": "PUT", + "description": "Updates an annotation set. The update must respect all mutability restrictions and other invariants described on the annotation set resource. Caller must have WRITE permission for the associated dataset.", + "parameters": { + "annotationSetId": { + "type": "string", + "description": "The ID of the annotation set to be updated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "annotationSetId" + ], + "request": { + "$ref": "AnnotationSet" + }, + "response": { + "$ref": "AnnotationSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + } + } + }, + "annotations": { + "methods": { + "batchCreate": { + "id": "genomics.annotations.batchCreate", + "path": "annotations:batchCreate", + "httpMethod": "POST", + "description": "Creates one or more new annotations atomically. All annotations must belong to the same annotation set. Caller must have WRITE permission for this annotation set. For optimal performance, batch positionally adjacent annotations together.\n\n\nIf the request has a systemic issue, such as an attempt to write to an inaccessible annotation set, the entire RPC will fail accordingly. For lesser data issues, when possible an error will be isolated to the corresponding batch entry in the response; the remaining well formed annotations will be created normally.", + "request": { + "$ref": "BatchCreateAnnotationsRequest" + }, + "response": { + "$ref": "BatchAnnotationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "create": { + "id": "genomics.annotations.create", + "path": "annotations", + "httpMethod": "POST", + "description": "Creates a new annotation. Caller must have WRITE permission for the associated annotation set.", + "request": { + "$ref": "Annotation" + }, + "response": { + "$ref": "Annotation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "delete": { + "id": "genomics.annotations.delete", + "path": "annotations/{annotationId}", + "httpMethod": "DELETE", + "description": "Deletes an annotation. Caller must have WRITE permission for the associated annotation set.", + "parameters": { + "annotationId": { + "type": "string", + "description": "The ID of the annotation set to be deleted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "annotationId" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "get": { + "id": "genomics.annotations.get", + "path": "annotations/{annotationId}", + "httpMethod": "GET", + "description": "Gets an annotation. Caller must have READ permission for the associated annotation set.", + "parameters": { + "annotationId": { + "type": "string", + "description": "The ID of the annotation set to be retrieved.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "annotationId" + ], + "response": { + "$ref": "Annotation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "patch": { + "id": "genomics.annotations.patch", + "path": "annotations/{annotationId}", + "httpMethod": "PATCH", + "description": "Updates an annotation. The update must respect all mutability restrictions and other invariants described on the annotation resource. Caller must have WRITE permission for the associated dataset. This method supports patch semantics.", + "parameters": { + "annotationId": { + "type": "string", + "description": "The ID of the annotation set to be updated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "annotationId" + ], + "request": { + "$ref": "Annotation" + }, + "response": { + "$ref": "Annotation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "search": { + "id": "genomics.annotations.search", + "path": "annotations/search", + "httpMethod": "POST", + "description": "Searches for annotations that match the given criteria. Results are returned ordered by start position. Annotations that have matching start positions are ordered deterministically. Caller must have READ permission for the queried annotation sets.", + "request": { + "$ref": "SearchAnnotationsRequest" + }, + "response": { + "$ref": "SearchAnnotationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "update": { + "id": "genomics.annotations.update", + "path": "annotations/{annotationId}", + "httpMethod": "PUT", + "description": "Updates an annotation. The update must respect all mutability restrictions and other invariants described on the annotation resource. Caller must have WRITE permission for the associated dataset.", + "parameters": { + "annotationId": { + "type": "string", + "description": "The ID of the annotation set to be updated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "annotationId" + ], + "request": { + "$ref": "Annotation" + }, + "response": { + "$ref": "Annotation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + } + } + }, + "callsets": { + "methods": { + "create": { + "id": "genomics.callsets.create", + "path": "callsets", + "httpMethod": "POST", + "description": "Creates a new call set.", + "request": { + "$ref": "CallSet" + }, + "response": { + "$ref": "CallSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "delete": { + "id": "genomics.callsets.delete", + "path": "callsets/{callSetId}", + "httpMethod": "DELETE", + "description": "Deletes a call set.", + "parameters": { + "callSetId": { + "type": "string", + "description": "The ID of the call set to be deleted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "callSetId" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "get": { + "id": "genomics.callsets.get", + "path": "callsets/{callSetId}", + "httpMethod": "GET", + "description": "Gets a call set by ID.", + "parameters": { + "callSetId": { + "type": "string", + "description": "The ID of the call set.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "callSetId" + ], + "response": { + "$ref": "CallSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "patch": { + "id": "genomics.callsets.patch", + "path": "callsets/{callSetId}", + "httpMethod": "PATCH", + "description": "Updates a call set. This method supports patch semantics.", + "parameters": { + "callSetId": { + "type": "string", + "description": "The ID of the call set to be updated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "callSetId" + ], + "request": { + "$ref": "CallSet" + }, + "response": { + "$ref": "CallSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "search": { + "id": "genomics.callsets.search", + "path": "callsets/search", + "httpMethod": "POST", + "description": "Gets a list of call sets matching the criteria.\n\nImplements GlobalAllianceApi.searchCallSets.", + "request": { + "$ref": "SearchCallSetsRequest" + }, + "response": { + "$ref": "SearchCallSetsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "update": { + "id": "genomics.callsets.update", + "path": "callsets/{callSetId}", + "httpMethod": "PUT", + "description": "Updates a call set.", + "parameters": { + "callSetId": { + "type": "string", + "description": "The ID of the call set to be updated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "callSetId" + ], + "request": { + "$ref": "CallSet" + }, + "response": { + "$ref": "CallSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + } + } + }, + "datasets": { + "methods": { + "create": { + "id": "genomics.datasets.create", + "path": "datasets", + "httpMethod": "POST", + "description": "Creates a new dataset.", + "request": { + "$ref": "Dataset" + }, + "response": { + "$ref": "Dataset" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "delete": { + "id": "genomics.datasets.delete", + "path": "datasets/{datasetId}", + "httpMethod": "DELETE", + "description": "Deletes a dataset.", + "parameters": { + "datasetId": { + "type": "string", + "description": "The ID of the dataset to be deleted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "datasetId" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "get": { + "id": "genomics.datasets.get", + "path": "datasets/{datasetId}", + "httpMethod": "GET", + "description": "Gets a dataset by ID.", + "parameters": { + "datasetId": { + "type": "string", + "description": "The ID of the dataset.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "datasetId" + ], + "response": { + "$ref": "Dataset" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "list": { + "id": "genomics.datasets.list", + "path": "datasets", + "httpMethod": "GET", + "description": "Lists datasets within a project.", + "parameters": { + "pageSize": { + "type": "integer", + "description": "The maximum number of results returned by this request. If unspecified, defaults to 50.", + "format": "int32", + "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" + }, + "projectNumber": { + "type": "string", + "description": "Required. The project to list datasets for.", + "format": "int64", + "location": "query" + } + }, + "response": { + "$ref": "ListDatasetsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "patch": { + "id": "genomics.datasets.patch", + "path": "datasets/{datasetId}", + "httpMethod": "PATCH", + "description": "Updates a dataset. This method supports patch semantics.", + "parameters": { + "datasetId": { + "type": "string", + "description": "The ID of the dataset to be updated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "datasetId" + ], + "request": { + "$ref": "Dataset" + }, + "response": { + "$ref": "Dataset" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "undelete": { + "id": "genomics.datasets.undelete", + "path": "datasets/{datasetId}/undelete", + "httpMethod": "POST", + "description": "Undeletes a dataset by restoring a dataset which was deleted via this API. This operation is only possible for a week after the deletion occurred.", + "parameters": { + "datasetId": { + "type": "string", + "description": "The ID of the dataset to be undeleted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "datasetId" + ], + "response": { + "$ref": "Dataset" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "update": { + "id": "genomics.datasets.update", + "path": "datasets/{datasetId}", + "httpMethod": "PUT", + "description": "Updates a dataset.", + "parameters": { + "datasetId": { + "type": "string", + "description": "The ID of the dataset to be updated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "datasetId" + ], + "request": { + "$ref": "Dataset" + }, + "response": { + "$ref": "Dataset" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + } + } + }, + "experimental": { + "resources": { + "jobs": { + "methods": { + "create": { + "id": "genomics.experimental.jobs.create", + "path": "experimental/jobs/create", + "httpMethod": "POST", + "description": "Creates and asynchronously runs an ad-hoc job. This is an experimental call and may be removed or changed at any time.", + "request": { + "$ref": "ExperimentalCreateJobRequest" + }, + "response": { + "$ref": "ExperimentalCreateJobResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.read_write", + "https://www.googleapis.com/auth/genomics" + ] + } + } + } + } + }, + "jobs": { + "methods": { + "cancel": { + "id": "genomics.jobs.cancel", + "path": "jobs/{jobId}/cancel", + "httpMethod": "POST", + "description": "Cancels a job by ID. Note that it is possible for partial results to be generated and stored for cancelled jobs.", + "parameters": { + "jobId": { + "type": "string", + "description": "Required. The ID of the job.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "jobId" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "get": { + "id": "genomics.jobs.get", + "path": "jobs/{jobId}", + "httpMethod": "GET", + "description": "Gets a job by ID.", + "parameters": { + "jobId": { + "type": "string", + "description": "Required. The ID of the job.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "jobId" + ], + "response": { + "$ref": "Job" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "search": { + "id": "genomics.jobs.search", + "path": "jobs/search", + "httpMethod": "POST", + "description": "Gets a list of jobs matching the criteria.", + "request": { + "$ref": "SearchJobsRequest" + }, + "response": { + "$ref": "SearchJobsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + } + } + }, + "readgroupsets": { + "methods": { + "align": { + "id": "genomics.readgroupsets.align", + "path": "readgroupsets/align", + "httpMethod": "POST", + "description": "Aligns read data from existing read group sets or files from Google Cloud Storage. See the alignment and variant calling documentation for more details.", + "request": { + "$ref": "AlignReadGroupSetsRequest" + }, + "response": { + "$ref": "AlignReadGroupSetsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.read_write", + "https://www.googleapis.com/auth/genomics" + ] + }, + "call": { + "id": "genomics.readgroupsets.call", + "path": "readgroupsets/call", + "httpMethod": "POST", + "description": "Calls variants on read data from existing read group sets or files from Google Cloud Storage. See the alignment and variant calling documentation for more details.", + "request": { + "$ref": "CallReadGroupSetsRequest" + }, + "response": { + "$ref": "CallReadGroupSetsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.read_write", + "https://www.googleapis.com/auth/genomics" + ] + }, + "delete": { + "id": "genomics.readgroupsets.delete", + "path": "readgroupsets/{readGroupSetId}", + "httpMethod": "DELETE", + "description": "Deletes a read group set.", + "parameters": { + "readGroupSetId": { + "type": "string", + "description": "The ID of the read group set to be deleted. The caller must have WRITE permissions to the dataset associated with this read group set.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "readGroupSetId" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "export": { + "id": "genomics.readgroupsets.export", + "path": "readgroupsets/export", + "httpMethod": "POST", + "description": "Exports read group sets to a BAM file in Google Cloud Storage.\n\nNote that currently there may be some differences between exported BAM files and the original BAM file at the time of import. See ImportReadGroupSets for details.", + "request": { + "$ref": "ExportReadGroupSetsRequest" + }, + "response": { + "$ref": "ExportReadGroupSetsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.read_write", + "https://www.googleapis.com/auth/genomics" + ] + }, + "get": { + "id": "genomics.readgroupsets.get", + "path": "readgroupsets/{readGroupSetId}", + "httpMethod": "GET", + "description": "Gets a read group set by ID.", + "parameters": { + "readGroupSetId": { + "type": "string", + "description": "The ID of the read group set.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "readGroupSetId" + ], + "response": { + "$ref": "ReadGroupSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "import": { + "id": "genomics.readgroupsets.import", + "path": "readgroupsets/import", + "httpMethod": "POST", + "description": "Creates read group sets by asynchronously importing the provided information. The caller must have WRITE permissions to the dataset.\n\nNotes on BAM import: \n- Tags will be converted to strings - tag types are not preserved\n- Comments (@CO) in the input file header are not imported\n- Original order of reference headers is not preserved\n- Any reverse stranded unmapped reads will be reverse complemented, and their qualities (and \"BQ\" tag, if any) will be reversed\n- Unmapped reads will be stripped of positional information (referenceName and position)", + "request": { + "$ref": "ImportReadGroupSetsRequest" + }, + "response": { + "$ref": "ImportReadGroupSetsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.read_write", + "https://www.googleapis.com/auth/genomics" + ] + }, + "patch": { + "id": "genomics.readgroupsets.patch", + "path": "readgroupsets/{readGroupSetId}", + "httpMethod": "PATCH", + "description": "Updates a read group set. This method supports patch semantics.", + "parameters": { + "readGroupSetId": { + "type": "string", + "description": "The ID of the read group set to be updated. The caller must have WRITE permissions to the dataset associated with this read group set.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "readGroupSetId" + ], + "request": { + "$ref": "ReadGroupSet" + }, + "response": { + "$ref": "ReadGroupSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "search": { + "id": "genomics.readgroupsets.search", + "path": "readgroupsets/search", + "httpMethod": "POST", + "description": "Searches for read group sets matching the criteria.\n\nImplements GlobalAllianceApi.searchReadGroupSets.", + "request": { + "$ref": "SearchReadGroupSetsRequest" + }, + "response": { + "$ref": "SearchReadGroupSetsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "update": { + "id": "genomics.readgroupsets.update", + "path": "readgroupsets/{readGroupSetId}", + "httpMethod": "PUT", + "description": "Updates a read group set.", + "parameters": { + "readGroupSetId": { + "type": "string", + "description": "The ID of the read group set to be updated. The caller must have WRITE permissions to the dataset associated with this read group set.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "readGroupSetId" + ], + "request": { + "$ref": "ReadGroupSet" + }, + "response": { + "$ref": "ReadGroupSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + } + }, + "resources": { + "coveragebuckets": { + "methods": { + "list": { + "id": "genomics.readgroupsets.coveragebuckets.list", + "path": "readgroupsets/{readGroupSetId}/coveragebuckets", + "httpMethod": "GET", + "description": "Lists fixed width coverage buckets for a read group set, each of which correspond to a range of a reference sequence. Each bucket summarizes coverage information across its corresponding genomic range.\n\nCoverage is defined as the number of reads which are aligned to a given base in the reference sequence. Coverage buckets are available at several precomputed bucket widths, enabling retrieval of various coverage 'zoom levels'. The caller must have READ permissions for the target read group set.", + "parameters": { + "pageSize": { + "type": "integer", + "description": "The maximum number of results to return in a single page. If unspecified, defaults to 1024. The maximum value is 2048.", + "format": "int32", + "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" + }, + "range.end": { + "type": "string", + "description": "The end position of the range on the reference, 0-based exclusive. If specified, referenceName must also be specified.", + "format": "int64", + "location": "query" + }, + "range.referenceName": { + "type": "string", + "description": "The reference sequence name, for example chr1, 1, or chrX.", + "location": "query" + }, + "range.start": { + "type": "string", + "description": "The start position of the range on the reference, 0-based inclusive. If specified, referenceName must also be specified.", + "format": "int64", + "location": "query" + }, + "readGroupSetId": { + "type": "string", + "description": "Required. The ID of the read group set over which coverage is requested.", + "required": true, + "location": "path" + }, + "targetBucketWidth": { + "type": "string", + "description": "The desired width of each reported coverage bucket in base pairs. This will be rounded down to the nearest precomputed bucket width; the value of which is returned as bucketWidth in the response. Defaults to infinity (each bucket spans an entire reference sequence) or the length of the target range, if specified. The smallest precomputed bucketWidth is currently 2048 base pairs; this is subject to change.", + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "readGroupSetId" + ], + "response": { + "$ref": "ListCoverageBucketsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + } + } + } + } + }, + "reads": { + "methods": { + "search": { + "id": "genomics.reads.search", + "path": "reads/search", + "httpMethod": "POST", + "description": "Gets a list of reads for one or more read group sets. Reads search operates over a genomic coordinate space of reference sequence & position defined over the reference sequences to which the requested read group sets are aligned.\n\nIf a target positional range is specified, search returns all reads whose alignment to the reference genome overlap the range. A query which specifies only read group set IDs yields all reads in those read group sets, including unmapped reads.\n\nAll reads returned (including reads on subsequent pages) are ordered by genomic coordinate (reference sequence & position). Reads with equivalent genomic coordinates are returned in a deterministic order.\n\nImplements GlobalAllianceApi.searchReads.", + "request": { + "$ref": "SearchReadsRequest" + }, + "response": { + "$ref": "SearchReadsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + } + } + }, + "references": { + "methods": { + "get": { + "id": "genomics.references.get", + "path": "references/{referenceId}", + "httpMethod": "GET", + "description": "Gets a reference.\n\nImplements GlobalAllianceApi.getReference.", + "parameters": { + "referenceId": { + "type": "string", + "description": "The ID of the reference.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "referenceId" + ], + "response": { + "$ref": "Reference" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "search": { + "id": "genomics.references.search", + "path": "references/search", + "httpMethod": "POST", + "description": "Searches for references which match the given criteria.\n\nImplements GlobalAllianceApi.searchReferences.", + "request": { + "$ref": "SearchReferencesRequest" + }, + "response": { + "$ref": "SearchReferencesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + } + }, + "resources": { + "bases": { + "methods": { + "list": { + "id": "genomics.references.bases.list", + "path": "references/{referenceId}/bases", + "httpMethod": "GET", + "description": "Lists the bases in a reference, optionally restricted to a range.\n\nImplements GlobalAllianceApi.getReferenceBases.", + "parameters": { + "end": { + "type": "string", + "description": "The end position (0-based, exclusive) of this query. Defaults to the length of this reference.", + "format": "int64", + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "Specifies the maximum number of bases to return in a single page.", + "format": "int32", + "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" + }, + "referenceId": { + "type": "string", + "description": "The ID of the reference.", + "required": true, + "location": "path" + }, + "start": { + "type": "string", + "description": "The start position (0-based) of this query. Defaults to 0.", + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "referenceId" + ], + "response": { + "$ref": "ListBasesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + } + } + } + } + }, + "referencesets": { + "methods": { + "get": { + "id": "genomics.referencesets.get", + "path": "referencesets/{referenceSetId}", + "httpMethod": "GET", + "description": "Gets a reference set.\n\nImplements GlobalAllianceApi.getReferenceSet.", + "parameters": { + "referenceSetId": { + "type": "string", + "description": "The ID of the reference set.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "referenceSetId" + ], + "response": { + "$ref": "ReferenceSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "search": { + "id": "genomics.referencesets.search", + "path": "referencesets/search", + "httpMethod": "POST", + "description": "Searches for reference sets which match the given criteria.\n\nImplements GlobalAllianceApi.searchReferenceSets.", + "request": { + "$ref": "SearchReferenceSetsRequest" + }, + "response": { + "$ref": "SearchReferenceSetsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + } + } + }, + "variants": { + "methods": { + "create": { + "id": "genomics.variants.create", + "path": "variants", + "httpMethod": "POST", + "description": "Creates a new variant.", + "request": { + "$ref": "Variant" + }, + "response": { + "$ref": "Variant" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "delete": { + "id": "genomics.variants.delete", + "path": "variants/{variantId}", + "httpMethod": "DELETE", + "description": "Deletes a variant.", + "parameters": { + "variantId": { + "type": "string", + "description": "The ID of the variant to be deleted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "variantId" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "get": { + "id": "genomics.variants.get", + "path": "variants/{variantId}", + "httpMethod": "GET", + "description": "Gets a variant by ID.", + "parameters": { + "variantId": { + "type": "string", + "description": "The ID of the variant.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "variantId" + ], + "response": { + "$ref": "Variant" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "search": { + "id": "genomics.variants.search", + "path": "variants/search", + "httpMethod": "POST", + "description": "Gets a list of variants matching the criteria.\n\nImplements GlobalAllianceApi.searchVariants.", + "request": { + "$ref": "SearchVariantsRequest" + }, + "response": { + "$ref": "SearchVariantsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "update": { + "id": "genomics.variants.update", + "path": "variants/{variantId}", + "httpMethod": "PUT", + "description": "Updates a variant's names and info fields. All other modifications are silently ignored. Returns the modified variant without its calls.", + "parameters": { + "variantId": { + "type": "string", + "description": "The ID of the variant to be updated.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "variantId" + ], + "request": { + "$ref": "Variant" + }, + "response": { + "$ref": "Variant" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + } + } + }, + "variantsets": { + "methods": { + "create": { + "id": "genomics.variantsets.create", + "path": "variantsets", + "httpMethod": "POST", + "description": "Creates a new variant set (only necessary in v1).\n\nThe provided variant set must have a valid datasetId set - all other fields are optional. Note that the id field will be ignored, as this is assigned by the server.", + "request": { + "$ref": "VariantSet" + }, + "response": { + "$ref": "VariantSet" + } + }, + "delete": { + "id": "genomics.variantsets.delete", + "path": "variantsets/{variantSetId}", + "httpMethod": "DELETE", + "description": "Deletes the contents of a variant set. The variant set object is not deleted.", + "parameters": { + "variantSetId": { + "type": "string", + "description": "The ID of the variant set to be deleted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "variantSetId" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "export": { + "id": "genomics.variantsets.export", + "path": "variantsets/{variantSetId}/export", + "httpMethod": "POST", + "description": "Exports variant set data to an external destination.", + "parameters": { + "variantSetId": { + "type": "string", + "description": "Required. The ID of the variant set that contains variant data which should be exported. The caller must have READ access to this variant set.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "variantSetId" + ], + "request": { + "$ref": "ExportVariantSetRequest" + }, + "response": { + "$ref": "ExportVariantSetResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "get": { + "id": "genomics.variantsets.get", + "path": "variantsets/{variantSetId}", + "httpMethod": "GET", + "description": "Gets a variant set by ID.", + "parameters": { + "variantSetId": { + "type": "string", + "description": "Required. The ID of the variant set.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "variantSetId" + ], + "response": { + "$ref": "VariantSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "importVariants": { + "id": "genomics.variantsets.importVariants", + "path": "variantsets/{variantSetId}/importVariants", + "httpMethod": "POST", + "description": "Creates variant data by asynchronously importing the provided information.\n\nThe variants for import will be merged with any existing data and each other according to the behavior of mergeVariants. In particular, this means for merged VCF variants that have conflicting INFO fields, some data will be arbitrarily discarded. As a special case, for single-sample VCF files, QUAL and FILTER fields will be moved to the call level; these are sometimes interpreted in a call-specific context. Imported VCF headers are appended to the metadata already in a variant set.", + "parameters": { + "variantSetId": { + "type": "string", + "description": "Required. The variant set to which variant data should be imported.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "variantSetId" + ], + "request": { + "$ref": "ImportVariantsRequest" + }, + "response": { + "$ref": "ImportVariantsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.read_write", + "https://www.googleapis.com/auth/genomics" + ] + }, + "mergeVariants": { + "id": "genomics.variantsets.mergeVariants", + "path": "variantsets/{variantSetId}/mergeVariants", + "httpMethod": "POST", + "description": "Merges the given variants with existing variants. Each variant will be merged with an existing variant that matches its reference sequence, start, end, reference bases, and alternative bases. If no such variant exists, a new one will be created.\n\nWhen variants are merged, the call information from the new variant is added to the existing variant, and other fields (such as key/value pairs) are discarded.", + "parameters": { + "variantSetId": { + "type": "string", + "description": "The destination variant set.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "variantSetId" + ], + "request": { + "$ref": "MergeVariantsRequest" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "patch": { + "id": "genomics.variantsets.patch", + "path": "variantsets/{variantSetId}", + "httpMethod": "PATCH", + "description": "Updates a variant set's metadata. All other modifications are silently ignored. This method supports patch semantics.", + "parameters": { + "variantSetId": { + "type": "string", + "description": "The ID of the variant to be updated (must already exist).", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "variantSetId" + ], + "request": { + "$ref": "VariantSet" + }, + "response": { + "$ref": "VariantSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + }, + "search": { + "id": "genomics.variantsets.search", + "path": "variantsets/search", + "httpMethod": "POST", + "description": "Returns a list of all variant sets matching search criteria.\n\nImplements GlobalAllianceApi.searchVariantSets.", + "request": { + "$ref": "SearchVariantSetsRequest" + }, + "response": { + "$ref": "SearchVariantSetsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics", + "https://www.googleapis.com/auth/genomics.readonly" + ] + }, + "update": { + "id": "genomics.variantsets.update", + "path": "variantsets/{variantSetId}", + "httpMethod": "PUT", + "description": "Updates a variant set's metadata. All other modifications are silently ignored.", + "parameters": { + "variantSetId": { + "type": "string", + "description": "The ID of the variant to be updated (must already exist).", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "variantSetId" + ], + "request": { + "$ref": "VariantSet" + }, + "response": { + "$ref": "VariantSet" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/genomics/v1beta2/genomics-gen.go b/Godeps/_workspace/src/google.golang.org/api/genomics/v1beta2/genomics-gen.go new file mode 100644 index 000000000..55e7edfa6 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/genomics/v1beta2/genomics-gen.go @@ -0,0 +1,10476 @@ +// Package genomics provides access to the Genomics API. +// +// See https://developers.google.com/genomics/v1beta2/reference +// +// Usage example: +// +// import "google.golang.org/api/genomics/v1beta2" +// ... +// genomicsService, err := genomics.New(oauthHttpClient) +package genomics // import "google.golang.org/api/genomics/v1beta2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "genomics:v1beta2" +const apiName = "genomics" +const apiVersion = "v1beta2" +const basePath = "https://www.googleapis.com/genomics/v1beta2/" + +// 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 in Google Cloud Storage + DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write" + + // View and manage Genomics data + GenomicsScope = "https://www.googleapis.com/auth/genomics" + + // View Genomics data + GenomicsReadonlyScope = "https://www.googleapis.com/auth/genomics.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.AnnotationSets = NewAnnotationSetsService(s) + s.Annotations = NewAnnotationsService(s) + s.Callsets = NewCallsetsService(s) + s.Datasets = NewDatasetsService(s) + s.Experimental = NewExperimentalService(s) + s.Jobs = NewJobsService(s) + s.Readgroupsets = NewReadgroupsetsService(s) + s.Reads = NewReadsService(s) + s.References = NewReferencesService(s) + s.Referencesets = NewReferencesetsService(s) + s.Variants = NewVariantsService(s) + s.Variantsets = NewVariantsetsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + AnnotationSets *AnnotationSetsService + + Annotations *AnnotationsService + + Callsets *CallsetsService + + Datasets *DatasetsService + + Experimental *ExperimentalService + + Jobs *JobsService + + Readgroupsets *ReadgroupsetsService + + Reads *ReadsService + + References *ReferencesService + + Referencesets *ReferencesetsService + + Variants *VariantsService + + Variantsets *VariantsetsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAnnotationSetsService(s *Service) *AnnotationSetsService { + rs := &AnnotationSetsService{s: s} + return rs +} + +type AnnotationSetsService struct { + s *Service +} + +func NewAnnotationsService(s *Service) *AnnotationsService { + rs := &AnnotationsService{s: s} + return rs +} + +type AnnotationsService struct { + s *Service +} + +func NewCallsetsService(s *Service) *CallsetsService { + rs := &CallsetsService{s: s} + return rs +} + +type CallsetsService struct { + s *Service +} + +func NewDatasetsService(s *Service) *DatasetsService { + rs := &DatasetsService{s: s} + return rs +} + +type DatasetsService struct { + s *Service +} + +func NewExperimentalService(s *Service) *ExperimentalService { + rs := &ExperimentalService{s: s} + rs.Jobs = NewExperimentalJobsService(s) + return rs +} + +type ExperimentalService struct { + s *Service + + Jobs *ExperimentalJobsService +} + +func NewExperimentalJobsService(s *Service) *ExperimentalJobsService { + rs := &ExperimentalJobsService{s: s} + return rs +} + +type ExperimentalJobsService struct { + s *Service +} + +func NewJobsService(s *Service) *JobsService { + rs := &JobsService{s: s} + return rs +} + +type JobsService struct { + s *Service +} + +func NewReadgroupsetsService(s *Service) *ReadgroupsetsService { + rs := &ReadgroupsetsService{s: s} + rs.Coveragebuckets = NewReadgroupsetsCoveragebucketsService(s) + return rs +} + +type ReadgroupsetsService struct { + s *Service + + Coveragebuckets *ReadgroupsetsCoveragebucketsService +} + +func NewReadgroupsetsCoveragebucketsService(s *Service) *ReadgroupsetsCoveragebucketsService { + rs := &ReadgroupsetsCoveragebucketsService{s: s} + return rs +} + +type ReadgroupsetsCoveragebucketsService struct { + s *Service +} + +func NewReadsService(s *Service) *ReadsService { + rs := &ReadsService{s: s} + return rs +} + +type ReadsService struct { + s *Service +} + +func NewReferencesService(s *Service) *ReferencesService { + rs := &ReferencesService{s: s} + rs.Bases = NewReferencesBasesService(s) + return rs +} + +type ReferencesService struct { + s *Service + + Bases *ReferencesBasesService +} + +func NewReferencesBasesService(s *Service) *ReferencesBasesService { + rs := &ReferencesBasesService{s: s} + return rs +} + +type ReferencesBasesService struct { + s *Service +} + +func NewReferencesetsService(s *Service) *ReferencesetsService { + rs := &ReferencesetsService{s: s} + return rs +} + +type ReferencesetsService struct { + s *Service +} + +func NewVariantsService(s *Service) *VariantsService { + rs := &VariantsService{s: s} + return rs +} + +type VariantsService struct { + s *Service +} + +func NewVariantsetsService(s *Service) *VariantsetsService { + rs := &VariantsetsService{s: s} + return rs +} + +type VariantsetsService struct { + s *Service +} + +// AlignReadGroupSetsRequest: The read group set align request. +type AlignReadGroupSetsRequest struct { + // BamSourceUris: The BAM source files for alignment. Exactly one of + // readGroupSetId, bamSourceUris, interleavedFastqSource or + // pairedFastqSource must be provided. The caller must have READ + // permissions for these files. + BamSourceUris []string `json:"bamSourceUris,omitempty"` + + // DatasetId: Required. The ID of the dataset the newly aligned read + // group sets will belong to. The caller must have WRITE permissions to + // this dataset. + DatasetId string `json:"datasetId,omitempty"` + + // InterleavedFastqSource: The interleaved FASTQ source files for + // alignment, where both members of each pair of reads are found on + // consecutive records within the same FASTQ file. Exactly one of + // readGroupSetId, bamSourceUris, interleavedFastqSource or + // pairedFastqSource must be provided. + InterleavedFastqSource *InterleavedFastqSource `json:"interleavedFastqSource,omitempty"` + + // PairedFastqSource: The paired end FASTQ source files for alignment, + // where each member of a pair of reads are found in separate files. + // Exactly one of readGroupSetId, bamSourceUris, interleavedFastqSource + // or pairedFastqSource must be provided. + PairedFastqSource *PairedFastqSource `json:"pairedFastqSource,omitempty"` + + // ReadGroupSetId: The ID of the read group set which will be aligned. A + // new read group set will be generated to hold the aligned data, the + // originals will not be modified. The caller must have READ permissions + // for this read group set. Exactly one of readGroupSetId, + // bamSourceUris, interleavedFastqSource or pairedFastqSource must be + // provided. + ReadGroupSetId string `json:"readGroupSetId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BamSourceUris") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AlignReadGroupSetsRequest) MarshalJSON() ([]byte, error) { + type noMethod AlignReadGroupSetsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AlignReadGroupSetsResponse: The read group set align response. +type AlignReadGroupSetsResponse struct { + // JobId: A job ID that can be used to get status information. + JobId string `json:"jobId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "JobId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AlignReadGroupSetsResponse) MarshalJSON() ([]byte, error) { + type noMethod AlignReadGroupSetsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Annotation: An annotation describes a region of reference genome. The +// value of an annotation may be one of several canonical types, +// supplemented by arbitrary info tags. A variant annotation is +// represented by one or more of these canonical types. An annotation is +// not inherently associated with a specific sample or individual +// (though a client could choose to use annotations in this way). +// Example canonical annotation types are 'Gene' and 'Variant'. +type Annotation struct { + // AnnotationSetId: The ID of the containing annotation set. + AnnotationSetId string `json:"annotationSetId,omitempty"` + + // Id: The generated unique ID for this annotation. + Id string `json:"id,omitempty"` + + // Info: A string which maps to an array of values. + Info map[string][]string `json:"info,omitempty"` + + // Name: The display name of this annotation. + Name string `json:"name,omitempty"` + + // Position: The position of this annotation on the reference sequence. + Position *RangePosition `json:"position,omitempty"` + + // Transcript: A transcript value represents the assertion that a + // particular region of the reference genome may be transcribed as RNA. + // An alternative splicing pattern would be represented as a separate + // transcript object. This field is only set for annotations of type + // TRANSCRIPT. + Transcript *Transcript `json:"transcript,omitempty"` + + // Type: The data type for this annotation. Must match the containing + // annotation set's type. + // + // Possible values: + // "GENE" + // "GENERIC" + // "TRANSCRIPT" + // "VARIANT" + Type string `json:"type,omitempty"` + + // Variant: A variant annotation, which describes the effect of a + // variant on the genome, the coding sequence, and/or higher level + // consequences at the organism level e.g. pathogenicity. This field is + // only set for annotations of type VARIANT. + Variant *VariantAnnotation `json:"variant,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AnnotationSetId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Annotation) MarshalJSON() ([]byte, error) { + type noMethod Annotation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AnnotationSet: An annotation set is a logical grouping of annotations +// that share consistent type information and provenance. Examples of +// annotation sets include 'all genes from refseq', and 'all variant +// annotations from ClinVar'. +type AnnotationSet struct { + // DatasetId: The ID of the containing dataset. + DatasetId string `json:"datasetId,omitempty"` + + // Id: The generated unique ID for this annotation set. + Id string `json:"id,omitempty"` + + // Info: A string which maps to an array of values. + Info map[string][]string `json:"info,omitempty"` + + // Name: The display name for this annotation set. + Name string `json:"name,omitempty"` + + // ReferenceSetId: The ID of the reference set that defines the + // coordinate space for this set's annotations. + ReferenceSetId string `json:"referenceSetId,omitempty"` + + // SourceUri: The source URI describing the file from which this + // annotation set was generated, if any. + SourceUri string `json:"sourceUri,omitempty"` + + // Type: The type of annotations contained within this set. + // + // Possible values: + // "GENE" + // "GENERIC" + // "TRANSCRIPT" + // "VARIANT" + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DatasetId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AnnotationSet) MarshalJSON() ([]byte, error) { + type noMethod AnnotationSet + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type BatchAnnotationsResponse struct { + // Entries: The resulting per-annotation entries, ordered consistently + // with the original request. + Entries []*BatchAnnotationsResponseEntry `json:"entries,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Entries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BatchAnnotationsResponse) MarshalJSON() ([]byte, error) { + type noMethod BatchAnnotationsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type BatchAnnotationsResponseEntry struct { + // Annotation: The annotation, if any. + Annotation *Annotation `json:"annotation,omitempty"` + + // Status: The resulting status for this annotation operation. + Status *BatchAnnotationsResponseEntryStatus `json:"status,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Annotation") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BatchAnnotationsResponseEntry) MarshalJSON() ([]byte, error) { + type noMethod BatchAnnotationsResponseEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type BatchAnnotationsResponseEntryStatus struct { + // Code: The HTTP status code for this operation. + Code int64 `json:"code,omitempty"` + + // Message: Error message for this status, if any. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BatchAnnotationsResponseEntryStatus) MarshalJSON() ([]byte, error) { + type noMethod BatchAnnotationsResponseEntryStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type BatchCreateAnnotationsRequest struct { + // Annotations: The annotations to be created. At most 4096 can be + // specified in a single request. + Annotations []*Annotation `json:"annotations,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Annotations") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BatchCreateAnnotationsRequest) MarshalJSON() ([]byte, error) { + type noMethod BatchCreateAnnotationsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Call: A call represents the determination of genotype with respect to +// a particular variant. It may include associated information such as +// quality and phasing. For example, a call might assign a probability +// of 0.32 to the occurrence of a SNP named rs1234 in a call set with +// the name NA12345. +type Call struct { + // CallSetId: The ID of the call set this variant call belongs to. + CallSetId string `json:"callSetId,omitempty"` + + // CallSetName: The name of the call set this variant call belongs to. + CallSetName string `json:"callSetName,omitempty"` + + // Genotype: The genotype of this variant call. Each value represents + // either the value of the referenceBases field or a 1-based index into + // alternateBases. If a variant had a referenceBases value of T and an + // alternateBases value of ["A", "C"], and the genotype was [2, 1], that + // would mean the call represented the heterozygous value CA for this + // variant. If the genotype was instead [0, 1], the represented value + // would be TA. Ordering of the genotype values is important if the + // phaseset is present. If a genotype is not called (that is, a . is + // present in the GT string) -1 is returned. + Genotype []int64 `json:"genotype,omitempty"` + + // GenotypeLikelihood: The genotype likelihoods for this variant call. + // Each array entry represents how likely a specific genotype is for + // this call. The value ordering is defined by the GL tag in the VCF + // spec. If Phred-scaled genotype likelihood scores (PL) are available + // and log10(P) genotype likelihood scores (GL) are not, PL scores are + // converted to GL scores. If both are available, PL scores are stored + // in info. + GenotypeLikelihood []float64 `json:"genotypeLikelihood,omitempty"` + + // Info: A string which maps to an array of values. + Info map[string][]string `json:"info,omitempty"` + + // Phaseset: If this field is present, this variant call's genotype + // ordering implies the phase of the bases and is consistent with any + // other variant calls in the same reference sequence which have the + // same phaseset value. When importing data from VCF, if the genotype + // data was phased but no phase set was specified this field will be set + // to *. + Phaseset string `json:"phaseset,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CallSetId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Call) MarshalJSON() ([]byte, error) { + type noMethod Call + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CallReadGroupSetsRequest: The read group set call request. +type CallReadGroupSetsRequest struct { + // DatasetId: Required. The ID of the dataset the called variants will + // belong to. The caller must have WRITE permissions to this dataset. + DatasetId string `json:"datasetId,omitempty"` + + // ReadGroupSetId: The IDs of the read group sets which will be called. + // The caller must have READ permissions for these read group sets. One + // of readGroupSetId or sourceUris must be provided. + ReadGroupSetId string `json:"readGroupSetId,omitempty"` + + // SourceUris: A list of URIs pointing at BAM files in Google Cloud + // Storage which will be called. FASTQ files are not allowed. The caller + // must have READ permissions for these files. One of readGroupSetId or + // sourceUris must be provided. + SourceUris []string `json:"sourceUris,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DatasetId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CallReadGroupSetsRequest) MarshalJSON() ([]byte, error) { + type noMethod CallReadGroupSetsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CallReadGroupSetsResponse: The read group set call response. +type CallReadGroupSetsResponse struct { + // JobId: A job ID that can be used to get status information. + JobId string `json:"jobId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "JobId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CallReadGroupSetsResponse) MarshalJSON() ([]byte, error) { + type noMethod CallReadGroupSetsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CallSet: A call set is a collection of variant calls, typically for +// one sample. It belongs to a variant set. +type CallSet struct { + // Created: The date this call set was created in milliseconds from the + // epoch. + Created int64 `json:"created,omitempty,string"` + + // Id: The Google generated ID of the call set, immutable. + Id string `json:"id,omitempty"` + + // Info: A string which maps to an array of values. + Info map[string][]string `json:"info,omitempty"` + + // Name: The call set name. + Name string `json:"name,omitempty"` + + // SampleId: The sample ID this call set corresponds to. + SampleId string `json:"sampleId,omitempty"` + + // VariantSetIds: The IDs of the variant sets this call set belongs to. + VariantSetIds []string `json:"variantSetIds,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Created") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CallSet) MarshalJSON() ([]byte, error) { + type noMethod CallSet + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CigarUnit: A single CIGAR operation. +type CigarUnit struct { + // Possible values: + // "ALIGNMENT_MATCH" + // "CLIP_HARD" + // "CLIP_SOFT" + // "DELETE" + // "INSERT" + // "OPERATION_UNSPECIFIED" + // "PAD" + // "SEQUENCE_MATCH" + // "SEQUENCE_MISMATCH" + // "SKIP" + Operation string `json:"operation,omitempty"` + + // OperationLength: The number of bases that the operation runs for. + // Required. + OperationLength int64 `json:"operationLength,omitempty,string"` + + // ReferenceSequence: referenceSequence is only used at mismatches + // (SEQUENCE_MISMATCH) and deletions (DELETE). Filling this field + // replaces SAM's MD tag. If the relevant information is not available, + // this field is unset. + ReferenceSequence string `json:"referenceSequence,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Operation") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CigarUnit) MarshalJSON() ([]byte, error) { + type noMethod CigarUnit + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CoverageBucket: A bucket over which read coverage has been +// precomputed. A bucket corresponds to a specific range of the +// reference sequence. +type CoverageBucket struct { + // MeanCoverage: The average number of reads which are aligned to each + // individual reference base in this bucket. + MeanCoverage float64 `json:"meanCoverage,omitempty"` + + // Range: The genomic coordinate range spanned by this bucket. + Range *Range `json:"range,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MeanCoverage") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CoverageBucket) MarshalJSON() ([]byte, error) { + type noMethod CoverageBucket + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Dataset: A Dataset is a collection of genomic data. +type Dataset struct { + // CreateTime: The time this dataset was created, in seconds from the + // epoch. + CreateTime int64 `json:"createTime,omitempty,string"` + + // Id: The Google generated ID of the dataset, immutable. + Id string `json:"id,omitempty"` + + // IsPublic: Flag indicating whether or not a dataset is publicly + // viewable. If a dataset is not public, it inherits viewing permissions + // from its project. + IsPublic *bool `json:"isPublic,omitempty"` + + // Name: The dataset name. + Name string `json:"name,omitempty"` + + // ProjectNumber: The Google Developers Console project number that this + // dataset belongs to. + ProjectNumber int64 `json:"projectNumber,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Dataset) MarshalJSON() ([]byte, error) { + type noMethod Dataset + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ExperimentalCreateJobRequest: The job creation request. +type ExperimentalCreateJobRequest struct { + // Align: Specifies whether or not to run the alignment pipeline. Either + // align or callVariants must be set. + Align bool `json:"align,omitempty"` + + // CallVariants: Specifies whether or not to run the variant calling + // pipeline. Either align or callVariants must be set. + CallVariants bool `json:"callVariants,omitempty"` + + // GcsOutputPath: Specifies where to copy the results of certain + // pipelines. This should be in the form of gs://bucket/path. + GcsOutputPath string `json:"gcsOutputPath,omitempty"` + + // PairedSourceUris: A list of Google Cloud Storage URIs of paired end + // .fastq files to operate upon. If specified, this represents the + // second file of each paired .fastq file. The first file of each pair + // should be specified in sourceUris. + PairedSourceUris []string `json:"pairedSourceUris,omitempty"` + + // ProjectNumber: Required. The Google Cloud Project ID with which to + // associate the request. + ProjectNumber int64 `json:"projectNumber,omitempty,string"` + + // SourceUris: A list of Google Cloud Storage URIs of data files to + // operate upon. These can be .bam, interleaved .fastq, or paired + // .fastq. If specifying paired .fastq files, the first of each pair of + // files should be listed here, and the second of each pair should be + // listed in pairedSourceUris. + SourceUris []string `json:"sourceUris,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Align") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ExperimentalCreateJobRequest) MarshalJSON() ([]byte, error) { + type noMethod ExperimentalCreateJobRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ExperimentalCreateJobResponse: The job creation response. +type ExperimentalCreateJobResponse struct { + // JobId: A job ID that can be used to get status information. + JobId string `json:"jobId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "JobId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ExperimentalCreateJobResponse) MarshalJSON() ([]byte, error) { + type noMethod ExperimentalCreateJobResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ExportReadGroupSetsRequest: The read group set export request. +type ExportReadGroupSetsRequest struct { + // ExportUri: Required. A Google Cloud Storage URI for the exported BAM + // file. The currently authenticated user must have write access to the + // new file. An error will be returned if the URI already contains data. + ExportUri string `json:"exportUri,omitempty"` + + // ProjectNumber: Required. The Google Developers Console project number + // that owns this export. + ProjectNumber int64 `json:"projectNumber,omitempty,string"` + + // ReadGroupSetIds: Required. The IDs of the read group sets to export. + ReadGroupSetIds []string `json:"readGroupSetIds,omitempty"` + + // ReferenceNames: The reference names to export. If this is not + // specified, all reference sequences, including unmapped reads, are + // exported. Use * to export only unmapped reads. + ReferenceNames []string `json:"referenceNames,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ExportUri") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ExportReadGroupSetsRequest) MarshalJSON() ([]byte, error) { + type noMethod ExportReadGroupSetsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ExportReadGroupSetsResponse: The read group set export response. +type ExportReadGroupSetsResponse struct { + // JobId: A job ID that can be used to get status information. + JobId string `json:"jobId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "JobId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ExportReadGroupSetsResponse) MarshalJSON() ([]byte, error) { + type noMethod ExportReadGroupSetsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ExportVariantSetRequest: The variant data export request. +type ExportVariantSetRequest struct { + // BigqueryDataset: Required. The BigQuery dataset to export data to. + // This dataset must already exist. Note that this is distinct from the + // Genomics concept of "dataset". + BigqueryDataset string `json:"bigqueryDataset,omitempty"` + + // BigqueryTable: Required. The BigQuery table to export data to. If the + // table doesn't exist, it will be created. If it already exists, it + // will be overwritten. + BigqueryTable string `json:"bigqueryTable,omitempty"` + + // CallSetIds: If provided, only variant call information from the + // specified call sets will be exported. By default all variant calls + // are exported. + CallSetIds []string `json:"callSetIds,omitempty"` + + // Format: The format for the exported data. + // + // Possible values: + // "BIGQUERY" + Format string `json:"format,omitempty"` + + // ProjectNumber: Required. The Google Cloud project number that owns + // the destination BigQuery dataset. The caller must have WRITE access + // to this project. This project will also own the resulting export job. + ProjectNumber int64 `json:"projectNumber,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "BigqueryDataset") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ExportVariantSetRequest) MarshalJSON() ([]byte, error) { + type noMethod ExportVariantSetRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ExportVariantSetResponse: The variant data export response. +type ExportVariantSetResponse struct { + // JobId: A job ID that can be used to get status information. + JobId string `json:"jobId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "JobId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ExportVariantSetResponse) MarshalJSON() ([]byte, error) { + type noMethod ExportVariantSetResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ExternalId struct { + // Id: The id used by the source of this data. + Id string `json:"id,omitempty"` + + // SourceName: The name of the source of this data. + SourceName string `json:"sourceName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ExternalId) MarshalJSON() ([]byte, error) { + type noMethod ExternalId + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type FastqMetadata struct { + // LibraryName: Optionally specifies the library name for alignment from + // FASTQ. + LibraryName string `json:"libraryName,omitempty"` + + // PlatformName: Optionally specifies the platform name for alignment + // from FASTQ. For example: CAPILLARY, LS454, ILLUMINA, SOLID, HELICOS, + // IONTORRENT, PACBIO. + PlatformName string `json:"platformName,omitempty"` + + // PlatformUnit: Optionally specifies the platform unit for alignment + // from FASTQ. For example: flowcell-barcode.lane for Illumina or slide + // for SOLID. + PlatformUnit string `json:"platformUnit,omitempty"` + + // ReadGroupName: Optionally specifies the read group name for alignment + // from FASTQ. + ReadGroupName string `json:"readGroupName,omitempty"` + + // SampleName: Optionally specifies the sample name for alignment from + // FASTQ. + SampleName string `json:"sampleName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "LibraryName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FastqMetadata) MarshalJSON() ([]byte, error) { + type noMethod FastqMetadata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ImportReadGroupSetsRequest: The read group set import request. +type ImportReadGroupSetsRequest struct { + // DatasetId: Required. The ID of the dataset these read group sets will + // belong to. The caller must have WRITE permissions to this dataset. + DatasetId string `json:"datasetId,omitempty"` + + // PartitionStrategy: The partition strategy describes how read groups + // are partitioned into read group sets. + // + // Possible values: + // "MERGE_ALL" + // "PER_FILE_PER_SAMPLE" + PartitionStrategy string `json:"partitionStrategy,omitempty"` + + // ReferenceSetId: The reference set to which the imported read group + // sets are aligned to, if any. The reference names of this reference + // set must be a superset of those found in the imported file headers. + // If no reference set id is provided, a best effort is made to + // associate with a matching reference set. + ReferenceSetId string `json:"referenceSetId,omitempty"` + + // SourceUris: A list of URIs pointing at BAM files in Google Cloud + // Storage. + SourceUris []string `json:"sourceUris,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DatasetId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ImportReadGroupSetsRequest) MarshalJSON() ([]byte, error) { + type noMethod ImportReadGroupSetsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ImportReadGroupSetsResponse: The read group set import response. +type ImportReadGroupSetsResponse struct { + // JobId: A job ID that can be used to get status information. + JobId string `json:"jobId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "JobId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ImportReadGroupSetsResponse) MarshalJSON() ([]byte, error) { + type noMethod ImportReadGroupSetsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ImportVariantsRequest: The variant data import request. +type ImportVariantsRequest struct { + // Format: The format of the variant data being imported. If + // unspecified, defaults to to "VCF". + // + // Possible values: + // "COMPLETE_GENOMICS" + // "VCF" + Format string `json:"format,omitempty"` + + // NormalizeReferenceNames: Convert reference names to the canonical + // representation. hg19 haploytypes (those reference names containing + // "_hap") are not modified in any way. All other reference names are + // modified according to the following rules: The reference name is + // capitalized. The "chr" prefix is dropped for all autosomes and sex + // chromsomes. For example "chr17" becomes "17" and "chrX" becomes "X". + // All mitochondrial chromosomes ("chrM", "chrMT", etc) become "MT". + NormalizeReferenceNames bool `json:"normalizeReferenceNames,omitempty"` + + // SourceUris: A list of URIs referencing variant files in Google Cloud + // Storage. URIs can include wildcards as described here. Note that + // recursive wildcards ('**') are not supported. + SourceUris []string `json:"sourceUris,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Format") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ImportVariantsRequest) MarshalJSON() ([]byte, error) { + type noMethod ImportVariantsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ImportVariantsResponse: The variant data import response. +type ImportVariantsResponse struct { + // JobId: A job ID that can be used to get status information. + JobId string `json:"jobId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "JobId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ImportVariantsResponse) MarshalJSON() ([]byte, error) { + type noMethod ImportVariantsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Int32Value: Wrapper message for `int32`. +// +// The JSON representation for `Int32Value` is JSON number. +type Int32Value struct { + // Value: The int32 value. + Value int64 `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Value") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Int32Value) MarshalJSON() ([]byte, error) { + type noMethod Int32Value + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InterleavedFastqSource: Describes an interleaved FASTQ file source +// for alignment. +type InterleavedFastqSource struct { + // Metadata: Optionally specifies the metadata to be associated with the + // final aligned read group set. + Metadata *FastqMetadata `json:"metadata,omitempty"` + + // SourceUris: A list of URIs pointing at interleaved FASTQ files in + // Google Cloud Storage which will be aligned. The caller must have READ + // permissions for these files. + SourceUris []string `json:"sourceUris,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Metadata") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InterleavedFastqSource) MarshalJSON() ([]byte, error) { + type noMethod InterleavedFastqSource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Job: A Job represents an ongoing process that can be monitored for +// status information. +type Job struct { + // Created: The date this job was created, in milliseconds from the + // epoch. + Created int64 `json:"created,omitempty,string"` + + // DetailedStatus: A more detailed description of this job's current + // status. + DetailedStatus string `json:"detailedStatus,omitempty"` + + // Errors: Any errors that occurred during processing. + Errors []string `json:"errors,omitempty"` + + // Id: The job ID. + Id string `json:"id,omitempty"` + + // ImportedIds: If this Job represents an import, this field will + // contain the IDs of the objects that were successfully imported. + ImportedIds []string `json:"importedIds,omitempty"` + + // ProjectNumber: The Google Developers Console project number to which + // this job belongs. + ProjectNumber int64 `json:"projectNumber,omitempty,string"` + + // Request: A summarized representation of the original service request. + Request *JobRequest `json:"request,omitempty"` + + // Status: The status of this job. + // + // Possible values: + // "CANCELED" + // "FAILURE" + // "NEW" + // "PENDING" + // "RUNNING" + // "SUCCESS" + // "UNKNOWN_STATUS" + Status string `json:"status,omitempty"` + + // Warnings: Any warnings that occurred during processing. + Warnings []string `json:"warnings,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Created") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Job) MarshalJSON() ([]byte, error) { + type noMethod Job + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// JobRequest: A summary representation of the service request that +// spawned the job. +type JobRequest struct { + // Destination: The data destination of the request, for example, a + // Google BigQuery Table or Dataset ID. + Destination []string `json:"destination,omitempty"` + + // Source: The data source of the request, for example, a Google Cloud + // Storage object path or Readset ID. + Source []string `json:"source,omitempty"` + + // Type: The original request type. + // + // Possible values: + // "ALIGN_READSETS" + // "CALL_READSETS" + // "EXPERIMENTAL_CREATE_JOB" + // "EXPORT_READSETS" + // "EXPORT_VARIANTS" + // "IMPORT_READSETS" + // "IMPORT_VARIANTS" + // "UNKNOWN_TYPE" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Destination") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JobRequest) MarshalJSON() ([]byte, error) { + type noMethod JobRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// KeyValue: Used to hold basic key value information. +type KeyValue struct { + // Key: A string which maps to an array of values. + Key string `json:"key,omitempty"` + + // Value: The string values. + Value []string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *KeyValue) MarshalJSON() ([]byte, error) { + type noMethod KeyValue + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LinearAlignment: A linear alignment can be represented by one CIGAR +// string. Describes the mapped position and local alignment of the read +// to the reference. +type LinearAlignment struct { + // Cigar: Represents the local alignment of this sequence (alignment + // matches, indels, etc) against the reference. + Cigar []*CigarUnit `json:"cigar,omitempty"` + + // MappingQuality: The mapping quality of this alignment. Represents how + // likely the read maps to this position as opposed to other locations. + MappingQuality int64 `json:"mappingQuality,omitempty"` + + // Position: The position of this alignment. + Position *Position `json:"position,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Cigar") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LinearAlignment) MarshalJSON() ([]byte, error) { + type noMethod LinearAlignment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ListBasesResponse struct { + // 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. This field will be empty if there + // aren't any additional results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Offset: The offset position (0-based) of the given sequence from the + // start of this Reference. This value will differ for each page in a + // paginated request. + Offset int64 `json:"offset,omitempty,string"` + + // Sequence: A substring of the bases that make up this reference. + Sequence string `json:"sequence,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListBasesResponse) MarshalJSON() ([]byte, error) { + type noMethod ListBasesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ListCoverageBucketsResponse struct { + // BucketWidth: The length of each coverage bucket in base pairs. Note + // that buckets at the end of a reference sequence may be shorter. This + // value is omitted if the bucket width is infinity (the default + // behaviour, with no range or targetBucketWidth). + BucketWidth int64 `json:"bucketWidth,omitempty,string"` + + // CoverageBuckets: The coverage buckets. The list of buckets is sparse; + // a bucket with 0 overlapping reads is not returned. A bucket never + // crosses more than one reference sequence. Each bucket has width + // bucketWidth, unless its end is the end of the reference sequence. + CoverageBuckets []*CoverageBucket `json:"coverageBuckets,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. This field will be empty if there + // aren't any additional results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BucketWidth") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListCoverageBucketsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListCoverageBucketsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListDatasetsResponse: The dataset list response. +type ListDatasetsResponse struct { + // Datasets: The list of matching Datasets. + Datasets []*Dataset `json:"datasets,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. This field will be empty if there + // aren't any additional results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Datasets") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListDatasetsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListDatasetsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type MergeVariantsRequest struct { + // Variants: The variants to be merged with existing variants. + Variants []*Variant `json:"variants,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Variants") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MergeVariantsRequest) MarshalJSON() ([]byte, error) { + type noMethod MergeVariantsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Metadata: Metadata describes a single piece of variant call metadata. +// These data include a top level key and either a single value string +// (value) or a list of key-value pairs (info.) Value and info are +// mutually exclusive. +type Metadata struct { + // Description: A textual description of this metadata. + Description string `json:"description,omitempty"` + + // Id: User-provided ID field, not enforced by this API. Two or more + // pieces of structured metadata with identical id and key fields are + // considered equivalent. + Id string `json:"id,omitempty"` + + // Info: A string which maps to an array of values. + Info map[string][]string `json:"info,omitempty"` + + // Key: The top-level key. + Key string `json:"key,omitempty"` + + // Number: The number of values that can be included in a field + // described by this metadata. + Number string `json:"number,omitempty"` + + // Type: The type of data. Possible types include: Integer, Float, Flag, + // Character, and String. + // + // Possible values: + // "CHARACTER" + // "FLAG" + // "FLOAT" + // "INTEGER" + // "STRING" + // "UNKNOWN_TYPE" + Type string `json:"type,omitempty"` + + // Value: The value field for simple metadata + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Metadata) MarshalJSON() ([]byte, error) { + type noMethod Metadata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PairedFastqSource: Describes a paired-end FASTQ file source for +// alignment. +type PairedFastqSource struct { + // FirstSourceUris: A list of URIs pointing at paired end FASTQ files in + // Google Cloud Storage which will be aligned. The first of each paired + // file should be specified here, in an order that matches the second of + // each paired file specified in secondSourceUris. For example: + // firstSourceUris: [file1_1.fq, file2_1.fq], secondSourceUris: + // [file1_2.fq, file2_2.fq]. The caller must have READ permissions for + // these files. + FirstSourceUris []string `json:"firstSourceUris,omitempty"` + + // Metadata: Optionally specifies the metadata to be associated with the + // final aligned read group set. + Metadata *FastqMetadata `json:"metadata,omitempty"` + + // SecondSourceUris: A list of URIs pointing at paired end FASTQ files + // in Google Cloud Storage which will be aligned. The second of each + // paired file should be specified here, in an order that matches the + // first of each paired file specified in firstSourceUris. For example: + // firstSourceUris: [file1_1.fq, file2_1.fq], secondSourceUris: + // [file1_2.fq, file2_2.fq]. The caller must have READ permissions for + // these files. + SecondSourceUris []string `json:"secondSourceUris,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FirstSourceUris") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PairedFastqSource) MarshalJSON() ([]byte, error) { + type noMethod PairedFastqSource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Position: An abstraction for referring to a genomic position, in +// relation to some already known reference. For now, represents a +// genomic position as a reference name, a base number on that reference +// (0-based), and a determination of forward or reverse strand. +type Position struct { + // Position: The 0-based offset from the start of the forward strand for + // that reference. + Position int64 `json:"position,omitempty,string"` + + // ReferenceName: The name of the reference in whatever reference set is + // being used. + ReferenceName string `json:"referenceName,omitempty"` + + // ReverseStrand: Whether this position is on the reverse strand, as + // opposed to the forward strand. + ReverseStrand bool `json:"reverseStrand,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Position") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Position) MarshalJSON() ([]byte, error) { + type noMethod Position + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// QueryRange: A 0-based half-open genomic coordinate range for search +// requests. +type QueryRange struct { + // End: The end position of the range on the reference, 0-based + // exclusive. If specified, referenceId or referenceName must also be + // specified. If unset or 0, defaults to the length of the reference. + End int64 `json:"end,omitempty,string"` + + // ReferenceId: The ID of the reference to query. At most one of + // referenceId and referenceName should be specified. + ReferenceId string `json:"referenceId,omitempty"` + + // ReferenceName: The name of the reference to query, within the + // reference set associated with this query. At most one of referenceId + // and referenceName pshould be specified. + ReferenceName string `json:"referenceName,omitempty"` + + // Start: The start position of the range on the reference, 0-based + // inclusive. If specified, referenceId or referenceName must also be + // specified. Defaults to 0. + Start int64 `json:"start,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "End") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *QueryRange) MarshalJSON() ([]byte, error) { + type noMethod QueryRange + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Range: A 0-based half-open genomic coordinate range over a reference +// sequence. +type Range struct { + // End: The end position of the range on the reference, 0-based + // exclusive. If specified, referenceName must also be specified. + End int64 `json:"end,omitempty,string"` + + // ReferenceName: The reference sequence name, for example chr1, 1, or + // chrX. + ReferenceName string `json:"referenceName,omitempty"` + + // Start: The start position of the range on the reference, 0-based + // inclusive. If specified, referenceName must also be specified. + Start int64 `json:"start,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "End") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Range) MarshalJSON() ([]byte, error) { + type noMethod Range + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RangePosition: A 0-based half-open genomic coordinate range over a +// reference sequence, for representing the position of a genomic +// resource. +type RangePosition struct { + // End: The end position of the range on the reference, 0-based + // exclusive. + End int64 `json:"end,omitempty,string"` + + // ReferenceId: The ID of the Google Genomics reference associated with + // this range. + ReferenceId string `json:"referenceId,omitempty"` + + // ReferenceName: The display name corresponding to the reference + // specified by referenceId, for example chr1, 1, or chrX. + ReferenceName string `json:"referenceName,omitempty"` + + // ReverseStrand: Whether this range refers to the reverse strand, as + // opposed to the forward strand. Note that regardless of this field, + // the start/end position of the range always refer to the forward + // strand. + ReverseStrand bool `json:"reverseStrand,omitempty"` + + // Start: The start position of the range on the reference, 0-based + // inclusive. + Start int64 `json:"start,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "End") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RangePosition) MarshalJSON() ([]byte, error) { + type noMethod RangePosition + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Read: A read alignment describes a linear alignment of a string of +// DNA to a reference sequence, in addition to metadata about the +// fragment (the molecule of DNA sequenced) and the read (the bases +// which were read by the sequencer). A read is equivalent to a line in +// a SAM file. A read belongs to exactly one read group and exactly one +// read group set. Generating a reference-aligned sequence string When +// interacting with mapped reads, it's often useful to produce a string +// representing the local alignment of the read to reference. The +// following pseudocode demonstrates one way of doing this: +// out = "" offset = 0 for c in read.alignment.cigar { switch +// c.operation { case "ALIGNMENT_MATCH", "SEQUENCE_MATCH", +// "SEQUENCE_MISMATCH": out += +// read.alignedSequence[offset:offset+c.operationLength] offset += +// c.operationLength break case "CLIP_SOFT", "INSERT": offset += +// c.operationLength break case "PAD": out += repeat("*", +// c.operationLength) break case "DELETE": out += repeat("-", +// c.operationLength) break case "SKIP": out += repeat(" ", +// c.operationLength) break case "CLIP_HARD": break } } return +// out +// Converting to SAM's CIGAR string The following pseudocode generates a +// SAM CIGAR string from the cigar field. Note that this is a lossy +// conversion (cigar.referenceSequence is lost). +// cigarMap = { "ALIGNMENT_MATCH": "M", "INSERT": "I", "DELETE": "D", +// "SKIP": "N", "CLIP_SOFT": "S", "CLIP_HARD": "H", "PAD": "P", +// "SEQUENCE_MATCH": "=", "SEQUENCE_MISMATCH": "X", } cigarStr = "" for +// c in read.alignment.cigar { cigarStr += c.operationLength + +// cigarMap[c.operation] } return cigarStr +type Read struct { + // AlignedQuality: The quality of the read sequence contained in this + // alignment record. alignedSequence and alignedQuality may be shorter + // than the full read sequence and quality. This will occur if the + // alignment is part of a chimeric alignment, or if the read was + // trimmed. When this occurs, the CIGAR for this read will begin/end + // with a hard clip operator that will indicate the length of the + // excised sequence. + AlignedQuality []int64 `json:"alignedQuality,omitempty"` + + // AlignedSequence: The bases of the read sequence contained in this + // alignment record, without CIGAR operations applied. alignedSequence + // and alignedQuality may be shorter than the full read sequence and + // quality. This will occur if the alignment is part of a chimeric + // alignment, or if the read was trimmed. When this occurs, the CIGAR + // for this read will begin/end with a hard clip operator that will + // indicate the length of the excised sequence. + AlignedSequence string `json:"alignedSequence,omitempty"` + + // Alignment: The linear alignment for this alignment record. This field + // will be unset if the read is unmapped. + Alignment *LinearAlignment `json:"alignment,omitempty"` + + // DuplicateFragment: The fragment is a PCR or optical duplicate (SAM + // flag 0x400) + DuplicateFragment bool `json:"duplicateFragment,omitempty"` + + // FailedVendorQualityChecks: SAM flag 0x200 + FailedVendorQualityChecks bool `json:"failedVendorQualityChecks,omitempty"` + + // FragmentLength: The observed length of the fragment, equivalent to + // TLEN in SAM. + FragmentLength int64 `json:"fragmentLength,omitempty"` + + // FragmentName: The fragment name. Equivalent to QNAME (query template + // name) in SAM. + FragmentName string `json:"fragmentName,omitempty"` + + // Id: The unique ID for this read. This is a generated unique ID, not + // to be confused with fragmentName. + Id string `json:"id,omitempty"` + + // Info: A string which maps to an array of values. + Info map[string][]string `json:"info,omitempty"` + + // NextMatePosition: The position of the primary alignment of the + // (readNumber+1)%numberReads read in the fragment. It replaces mate + // position and mate strand in SAM. This field will be unset if that + // read is unmapped or if the fragment only has a single read. + NextMatePosition *Position `json:"nextMatePosition,omitempty"` + + // NumberReads: The number of reads in the fragment (extension to SAM + // flag 0x1). + NumberReads int64 `json:"numberReads,omitempty"` + + // ProperPlacement: The orientation and the distance between reads from + // the fragment are consistent with the sequencing protocol (SAM flag + // 0x2) + ProperPlacement bool `json:"properPlacement,omitempty"` + + // ReadGroupId: The ID of the read group this read belongs to. (Every + // read must belong to exactly one read group.) + ReadGroupId string `json:"readGroupId,omitempty"` + + // ReadGroupSetId: The ID of the read group set this read belongs to. + // (Every read must belong to exactly one read group set.) + ReadGroupSetId string `json:"readGroupSetId,omitempty"` + + // ReadNumber: The read number in sequencing. 0-based and less than + // numberReads. This field replaces SAM flag 0x40 and 0x80. + ReadNumber int64 `json:"readNumber,omitempty"` + + // SecondaryAlignment: Whether this alignment is secondary. Equivalent + // to SAM flag 0x100. A secondary alignment represents an alternative to + // the primary alignment for this read. Aligners may return secondary + // alignments if a read can map ambiguously to multiple coordinates in + // the genome. By convention, each read has one and only one alignment + // where both secondaryAlignment and supplementaryAlignment are false. + SecondaryAlignment bool `json:"secondaryAlignment,omitempty"` + + // SupplementaryAlignment: Whether this alignment is supplementary. + // Equivalent to SAM flag 0x800. Supplementary alignments are used in + // the representation of a chimeric alignment. In a chimeric alignment, + // a read is split into multiple linear alignments that map to different + // reference contigs. The first linear alignment in the read will be + // designated as the representative alignment; the remaining linear + // alignments will be designated as supplementary alignments. These + // alignments may have different mapping quality scores. In each linear + // alignment in a chimeric alignment, the read will be hard clipped. The + // alignedSequence and alignedQuality fields in the alignment record + // will only represent the bases for its respective linear alignment. + SupplementaryAlignment bool `json:"supplementaryAlignment,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AlignedQuality") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Read) MarshalJSON() ([]byte, error) { + type noMethod Read + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReadGroup: A read group is all the data that's processed the same way +// by the sequencer. +type ReadGroup struct { + // DatasetId: The ID of the dataset this read group belongs to. + DatasetId string `json:"datasetId,omitempty"` + + // Description: A free-form text description of this read group. + Description string `json:"description,omitempty"` + + // Experiment: The experiment used to generate this read group. + Experiment *ReadGroupExperiment `json:"experiment,omitempty"` + + // Id: The generated unique read group ID. Note: This is different than + // the @RG ID field in the SAM spec. For that value, see the name field. + Id string `json:"id,omitempty"` + + // Info: A string which maps to an array of values. + Info map[string][]string `json:"info,omitempty"` + + // Name: The read group name. This corresponds to the @RG ID field in + // the SAM spec. + Name string `json:"name,omitempty"` + + // PredictedInsertSize: The predicted insert size of this read group. + // The insert size is the length the sequenced DNA fragment from + // end-to-end, not including the adapters. + PredictedInsertSize int64 `json:"predictedInsertSize,omitempty"` + + // Programs: The programs used to generate this read group. Programs are + // always identical for all read groups within a read group set. For + // this reason, only the first read group in a returned set will have + // this field populated. + Programs []*ReadGroupProgram `json:"programs,omitempty"` + + // ReferenceSetId: The reference set the reads in this read group are + // aligned to. Required if there are any read alignments. + ReferenceSetId string `json:"referenceSetId,omitempty"` + + // SampleId: The sample this read group's data was generated from. Note: + // This is not an actual ID within this repository, but rather an + // identifier for a sample which may be meaningful to some external + // system. + SampleId string `json:"sampleId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DatasetId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReadGroup) MarshalJSON() ([]byte, error) { + type noMethod ReadGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ReadGroupExperiment struct { + // InstrumentModel: The instrument model used as part of this + // experiment. This maps to sequencing technology in BAM. + InstrumentModel string `json:"instrumentModel,omitempty"` + + // LibraryId: The library used as part of this experiment. Note: This is + // not an actual ID within this repository, but rather an identifier for + // a library which may be meaningful to some external system. + LibraryId string `json:"libraryId,omitempty"` + + // PlatformUnit: The platform unit used as part of this experiment e.g. + // flowcell-barcode.lane for Illumina or slide for SOLiD. Corresponds to + // the + PlatformUnit string `json:"platformUnit,omitempty"` + + // SequencingCenter: The sequencing center used as part of this + // experiment. + SequencingCenter string `json:"sequencingCenter,omitempty"` + + // ForceSendFields is a list of field names (e.g. "InstrumentModel") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReadGroupExperiment) MarshalJSON() ([]byte, error) { + type noMethod ReadGroupExperiment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ReadGroupProgram struct { + // CommandLine: The command line used to run this program. + CommandLine string `json:"commandLine,omitempty"` + + // Id: The user specified locally unique ID of the program. Used along + // with prevProgramId to define an ordering between programs. + Id string `json:"id,omitempty"` + + // Name: The name of the program. + Name string `json:"name,omitempty"` + + // PrevProgramId: The ID of the program run before this one. + PrevProgramId string `json:"prevProgramId,omitempty"` + + // Version: The version of the program run. + Version string `json:"version,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CommandLine") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReadGroupProgram) MarshalJSON() ([]byte, error) { + type noMethod ReadGroupProgram + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReadGroupSet: A read group set is a logical collection of read +// groups, which are collections of reads produced by a sequencer. A +// read group set typically models reads corresponding to one sample, +// sequenced one way, and aligned one way. +// - A read group set belongs to one dataset. +// - A read group belongs to one read group set. +// - A read belongs to one read group. +type ReadGroupSet struct { + // DatasetId: The dataset ID. + DatasetId string `json:"datasetId,omitempty"` + + // Filename: The filename of the original source file for this read + // group set, if any. + Filename string `json:"filename,omitempty"` + + // Id: The read group set ID. + Id string `json:"id,omitempty"` + + // Info: A string which maps to an array of values. + Info map[string][]string `json:"info,omitempty"` + + // Name: The read group set name. By default this will be initialized to + // the sample name of the sequenced data contained in this set. + Name string `json:"name,omitempty"` + + // ReadGroups: The read groups in this set. There are typically 1-10 + // read groups in a read group set. + ReadGroups []*ReadGroup `json:"readGroups,omitempty"` + + // ReferenceSetId: The reference set the reads in this read group set + // are aligned to. + ReferenceSetId string `json:"referenceSetId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DatasetId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReadGroupSet) MarshalJSON() ([]byte, error) { + type noMethod ReadGroupSet + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Reference: A reference is a canonical assembled DNA sequence, +// intended to act as a reference coordinate space for other genomic +// annotations. A single reference might represent the human chromosome +// 1 or mitochandrial DNA, for instance. A reference belongs to one or +// more reference sets. +type Reference struct { + // Id: The Google generated immutable ID of the reference. + Id string `json:"id,omitempty"` + + // Length: The length of this reference's sequence. + Length int64 `json:"length,omitempty,string"` + + // Md5checksum: MD5 of the upper-case sequence excluding all whitespace + // characters (this is equivalent to SQ:M5 in SAM). This value is + // represented in lower case hexadecimal format. + Md5checksum string `json:"md5checksum,omitempty"` + + // Name: The name of this reference, for example 22. + Name string `json:"name,omitempty"` + + // NcbiTaxonId: ID from http://www.ncbi.nlm.nih.gov/taxonomy (e.g. + // 9606->human) if not specified by the containing reference set. + NcbiTaxonId int64 `json:"ncbiTaxonId,omitempty"` + + // SourceAccessions: All known corresponding accession IDs in INSDC + // (GenBank/ENA/DDBJ) ideally with a version number, for example + // GCF_000001405.26. + SourceAccessions []string `json:"sourceAccessions,omitempty"` + + // SourceURI: The URI from which the sequence was obtained. Specifies a + // FASTA format file/string with one name, sequence pair. + SourceURI string `json:"sourceURI,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Reference) MarshalJSON() ([]byte, error) { + type noMethod Reference + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReferenceBound: ReferenceBound records an upper bound for the +// starting coordinate of variants in a particular reference. +type ReferenceBound struct { + // ReferenceName: The reference the bound is associate with. + ReferenceName string `json:"referenceName,omitempty"` + + // UpperBound: An upper bound (inclusive) on the starting coordinate of + // any variant in the reference sequence. + UpperBound int64 `json:"upperBound,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "ReferenceName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReferenceBound) MarshalJSON() ([]byte, error) { + type noMethod ReferenceBound + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReferenceSet: A reference set is a set of references which typically +// comprise a reference assembly for a species, such as GRCh38 which is +// representative of the human genome. A reference set defines a common +// coordinate space for comparing reference-aligned experimental data. A +// reference set contains 1 or more references. +type ReferenceSet struct { + // AssemblyId: Public id of this reference set, such as GRCh37. + AssemblyId string `json:"assemblyId,omitempty"` + + // Description: Free text description of this reference set. + Description string `json:"description,omitempty"` + + // Id: The Google generated immutable ID of the reference set. + Id string `json:"id,omitempty"` + + // Md5checksum: Order-independent MD5 checksum which identifies this + // reference set. The checksum is computed by sorting all lower case + // hexidecimal string reference.md5checksum (for all reference in this + // set) in ascending lexicographic order, concatenating, and taking the + // MD5 of that value. The resulting value is represented in lower case + // hexadecimal format. + Md5checksum string `json:"md5checksum,omitempty"` + + // NcbiTaxonId: ID from http://www.ncbi.nlm.nih.gov/taxonomy (e.g. + // 9606->human) indicating the species which this assembly is intended + // to model. Note that contained references may specify a different + // ncbiTaxonId, as assemblies may contain reference sequences which do + // not belong to the modeled species, e.g. EBV in a human reference + // genome. + NcbiTaxonId int64 `json:"ncbiTaxonId,omitempty"` + + // ReferenceIds: The IDs of the reference objects that are part of this + // set. Reference.md5checksum must be unique within this set. + ReferenceIds []string `json:"referenceIds,omitempty"` + + // SourceAccessions: All known corresponding accession IDs in INSDC + // (GenBank/ENA/DDBJ) ideally with a version number, for example + // NC_000001.11. + SourceAccessions []string `json:"sourceAccessions,omitempty"` + + // SourceURI: The URI from which the references were obtained. + SourceURI string `json:"sourceURI,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AssemblyId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReferenceSet) MarshalJSON() ([]byte, error) { + type noMethod ReferenceSet + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type SearchAnnotationSetsRequest struct { + // DatasetIds: The dataset IDs to search within. Caller must have READ + // access to these datasets. + DatasetIds []string `json:"datasetIds,omitempty"` + + // Name: Only return annotations sets for which a substring of the name + // matches this string (case insensitive). + Name string `json:"name,omitempty"` + + // PageSize: Specifies number of results to return in a single page. If + // unspecified, it will default to 128. The maximum value is 1024. + PageSize int64 `json:"pageSize,omitempty"` + + // 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. + PageToken string `json:"pageToken,omitempty"` + + // ReferenceSetId: If specified, only annotation sets associated with + // the given reference set are returned. + ReferenceSetId string `json:"referenceSetId,omitempty"` + + // Types: If specified, only annotation sets that have any of these + // types are returned. + // + // Possible values: + // "GENE" + // "GENERIC" + // "TRANSCRIPT" + // "VARIANT" + Types []string `json:"types,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DatasetIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchAnnotationSetsRequest) MarshalJSON() ([]byte, error) { + type noMethod SearchAnnotationSetsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type SearchAnnotationSetsResponse struct { + // AnnotationSets: The matching annotation sets. + AnnotationSets []*AnnotationSet `json:"annotationSets,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. This field will be empty if there + // aren't any additional results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AnnotationSets") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchAnnotationSetsResponse) MarshalJSON() ([]byte, error) { + type noMethod SearchAnnotationSetsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type SearchAnnotationsRequest struct { + // AnnotationSetIds: The annotation sets to search within. The caller + // must have READ access to these annotation sets. Required. All queried + // annotation sets must have the same type. + AnnotationSetIds []string `json:"annotationSetIds,omitempty"` + + // PageSize: Specifies number of results to return in a single page. If + // unspecified, it will default to 256. The maximum value is 2048. + PageSize int64 `json:"pageSize,omitempty"` + + // 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. + PageToken string `json:"pageToken,omitempty"` + + // Range: If specified, this query matches only annotations that overlap + // this range. + Range *QueryRange `json:"range,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AnnotationSetIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchAnnotationsRequest) MarshalJSON() ([]byte, error) { + type noMethod SearchAnnotationsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type SearchAnnotationsResponse struct { + // Annotations: The matching annotations. + Annotations []*Annotation `json:"annotations,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. This field will be empty if there + // aren't any additional results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Annotations") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchAnnotationsResponse) MarshalJSON() ([]byte, error) { + type noMethod SearchAnnotationsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SearchCallSetsRequest: The call set search request. +type SearchCallSetsRequest struct { + // Name: Only return call sets for which a substring of the name matches + // this string. + Name string `json:"name,omitempty"` + + // PageSize: The maximum number of call sets to return. If unspecified, + // defaults to 1000. + PageSize int64 `json:"pageSize,omitempty"` + + // 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. + PageToken string `json:"pageToken,omitempty"` + + // VariantSetIds: Restrict the query to call sets within the given + // variant sets. At least one ID must be provided. + VariantSetIds []string `json:"variantSetIds,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchCallSetsRequest) MarshalJSON() ([]byte, error) { + type noMethod SearchCallSetsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SearchCallSetsResponse: The call set search response. +type SearchCallSetsResponse struct { + // CallSets: The list of matching call sets. + CallSets []*CallSet `json:"callSets,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. This field will be empty if there + // aren't any additional results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CallSets") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchCallSetsResponse) MarshalJSON() ([]byte, error) { + type noMethod SearchCallSetsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SearchJobsRequest: The jobs search request. +type SearchJobsRequest struct { + // CreatedAfter: If specified, only jobs created on or after this date, + // given in milliseconds since Unix epoch, will be returned. + CreatedAfter int64 `json:"createdAfter,omitempty,string"` + + // CreatedBefore: If specified, only jobs created prior to this date, + // given in milliseconds since Unix epoch, will be returned. + CreatedBefore int64 `json:"createdBefore,omitempty,string"` + + // PageSize: Specifies the number of results to return in a single page. + // Defaults to 128. The maximum value is 256. + PageSize int64 `json:"pageSize,omitempty"` + + // 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 the nextPageToken from the previous response. + PageToken string `json:"pageToken,omitempty"` + + // ProjectNumber: Required. Only return jobs which belong to this Google + // Developers Console project. + ProjectNumber int64 `json:"projectNumber,omitempty,string"` + + // Status: Only return jobs which have a matching status. + // + // Possible values: + // "CANCELED" + // "FAILURE" + // "NEW" + // "PENDING" + // "RUNNING" + // "SUCCESS" + // "UNKNOWN_STATUS" + Status []string `json:"status,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CreatedAfter") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchJobsRequest) MarshalJSON() ([]byte, error) { + type noMethod SearchJobsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SearchJobsResponse: The job search response. +type SearchJobsResponse struct { + // Jobs: The list of jobs results, ordered newest to oldest. + Jobs []*Job `json:"jobs,omitempty"` + + // NextPageToken: The continuation token which is used to page through + // large result sets. Provide this value is a subsequent request to + // return the next page of results. This field will be empty if there + // are no more results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Jobs") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchJobsResponse) MarshalJSON() ([]byte, error) { + type noMethod SearchJobsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SearchReadGroupSetsRequest: The read group set search request. +type SearchReadGroupSetsRequest struct { + // DatasetIds: Restricts this query to read group sets within the given + // datasets. At least one ID must be provided. + DatasetIds []string `json:"datasetIds,omitempty"` + + // Name: Only return read group sets for which a substring of the name + // matches this string. + Name string `json:"name,omitempty"` + + // PageSize: Specifies number of results to return in a single page. If + // unspecified, it will default to 256. The maximum value is 1024. + PageSize int64 `json:"pageSize,omitempty"` + + // 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. + PageToken string `json:"pageToken,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DatasetIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchReadGroupSetsRequest) MarshalJSON() ([]byte, error) { + type noMethod SearchReadGroupSetsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SearchReadGroupSetsResponse: The read group set search response. +type SearchReadGroupSetsResponse struct { + // 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. This field will be empty if there + // aren't any additional results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ReadGroupSets: The list of matching read group sets. + ReadGroupSets []*ReadGroupSet `json:"readGroupSets,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchReadGroupSetsResponse) MarshalJSON() ([]byte, error) { + type noMethod SearchReadGroupSetsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SearchReadsRequest: The read search request. +type SearchReadsRequest struct { + // End: The end position of the range on the reference, 0-based + // exclusive. If specified, referenceName must also be specified. + End int64 `json:"end,omitempty,string"` + + // PageSize: Specifies number of results to return in a single page. If + // unspecified, it will default to 256. The maximum value is 2048. + PageSize int64 `json:"pageSize,omitempty"` + + // 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. + PageToken string `json:"pageToken,omitempty"` + + // ReadGroupIds: The IDs of the read groups within which to search for + // reads. All specified read groups must belong to the same read group + // sets. Must specify one of readGroupSetIds or readGroupIds. + ReadGroupIds []string `json:"readGroupIds,omitempty"` + + // ReadGroupSetIds: The IDs of the read groups sets within which to + // search for reads. All specified read group sets must be aligned + // against a common set of reference sequences; this defines the genomic + // coordinates for the query. Must specify one of readGroupSetIds or + // readGroupIds. + ReadGroupSetIds []string `json:"readGroupSetIds,omitempty"` + + // ReferenceName: The reference sequence name, for example chr1, 1, or + // chrX. If set to *, only unmapped reads are returned. + ReferenceName string `json:"referenceName,omitempty"` + + // Start: The start position of the range on the reference, 0-based + // inclusive. If specified, referenceName must also be specified. + Start int64 `json:"start,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "End") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchReadsRequest) MarshalJSON() ([]byte, error) { + type noMethod SearchReadsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SearchReadsResponse: The read search response. +type SearchReadsResponse struct { + // Alignments: The list of matching alignments sorted by mapped genomic + // coordinate, if any, ascending in position within the same reference. + // Unmapped reads, which have no position, are returned contiguously and + // are sorted in ascending lexicographic order by fragment name. + Alignments []*Read `json:"alignments,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. This field will be empty if there + // aren't any additional results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Alignments") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchReadsResponse) MarshalJSON() ([]byte, error) { + type noMethod SearchReadsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type SearchReferenceSetsRequest struct { + // Accessions: If present, return references for which the accession + // matches any of these strings. Best to give a version number, for + // example GCF_000001405.26. If only the main accession number is given + // then all records with that main accession will be returned, whichever + // version. Note that different versions will have different sequences. + Accessions []string `json:"accessions,omitempty"` + + // AssemblyId: If present, return reference sets for which a substring + // of their assemblyId matches this string (case insensitive). + AssemblyId string `json:"assemblyId,omitempty"` + + // Md5checksums: If present, return references for which the md5checksum + // matches. See ReferenceSet.md5checksum for details. + Md5checksums []string `json:"md5checksums,omitempty"` + + // PageSize: Specifies the maximum number of results to return in a + // single page. + PageSize int64 `json:"pageSize,omitempty"` + + // 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. + PageToken string `json:"pageToken,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Accessions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchReferenceSetsRequest) MarshalJSON() ([]byte, error) { + type noMethod SearchReferenceSetsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type SearchReferenceSetsResponse struct { + // 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. This field will be empty if there + // aren't any additional results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ReferenceSets: The matching references sets. + ReferenceSets []*ReferenceSet `json:"referenceSets,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchReferenceSetsResponse) MarshalJSON() ([]byte, error) { + type noMethod SearchReferenceSetsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type SearchReferencesRequest struct { + // Accessions: If present, return references for which the accession + // matches this string. Best to give a version number, for example + // GCF_000001405.26. If only the main accession number is given then all + // records with that main accession will be returned, whichever version. + // Note that different versions will have different sequences. + Accessions []string `json:"accessions,omitempty"` + + // Md5checksums: If present, return references for which the md5checksum + // matches. See Reference.md5checksum for construction details. + Md5checksums []string `json:"md5checksums,omitempty"` + + // PageSize: Specifies the maximum number of results to return in a + // single page. + PageSize int64 `json:"pageSize,omitempty"` + + // 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. + PageToken string `json:"pageToken,omitempty"` + + // ReferenceSetId: If present, return only references which belong to + // this reference set. + ReferenceSetId string `json:"referenceSetId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Accessions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchReferencesRequest) MarshalJSON() ([]byte, error) { + type noMethod SearchReferencesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type SearchReferencesResponse struct { + // 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. This field will be empty if there + // aren't any additional results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // References: The matching references. + References []*Reference `json:"references,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchReferencesResponse) MarshalJSON() ([]byte, error) { + type noMethod SearchReferencesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SearchVariantSetsRequest: The search variant sets request. +type SearchVariantSetsRequest struct { + // DatasetIds: Exactly one dataset ID must be provided here. Only + // variant sets which belong to this dataset will be returned. + DatasetIds []string `json:"datasetIds,omitempty"` + + // PageSize: The maximum number of variant sets to return in a request. + PageSize int64 `json:"pageSize,omitempty"` + + // 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. + PageToken string `json:"pageToken,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DatasetIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchVariantSetsRequest) MarshalJSON() ([]byte, error) { + type noMethod SearchVariantSetsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SearchVariantSetsResponse: The search variant sets response. +type SearchVariantSetsResponse struct { + // 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. This field will be empty if there + // aren't any additional results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // VariantSets: The variant sets belonging to the requested dataset. + VariantSets []*VariantSet `json:"variantSets,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchVariantSetsResponse) MarshalJSON() ([]byte, error) { + type noMethod SearchVariantSetsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SearchVariantsRequest: The variant search request. +type SearchVariantsRequest struct { + // CallSetIds: Only return variant calls which belong to call sets with + // these ids. Leaving this blank returns all variant calls. If a variant + // has no calls belonging to any of these call sets, it won't be + // returned at all. Currently, variants with no calls from any call set + // will never be returned. + CallSetIds []string `json:"callSetIds,omitempty"` + + // End: The end of the window, 0-based exclusive. If unspecified or 0, + // defaults to the length of the reference. + End int64 `json:"end,omitempty,string"` + + // MaxCalls: The maximum number of calls to return. However, at least + // one variant will always be returned, even if it has more calls than + // this limit. If unspecified, defaults to 5000. + MaxCalls int64 `json:"maxCalls,omitempty"` + + // PageSize: The maximum number of variants to return. If unspecified, + // defaults to 5000. + PageSize int64 `json:"pageSize,omitempty"` + + // 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. + PageToken string `json:"pageToken,omitempty"` + + // ReferenceName: Required. Only return variants in this reference + // sequence. + ReferenceName string `json:"referenceName,omitempty"` + + // Start: The beginning of the window (0-based, inclusive) for which + // overlapping variants should be returned. If unspecified, defaults to + // 0. + Start int64 `json:"start,omitempty,string"` + + // VariantName: Only return variants which have exactly this name. + VariantName string `json:"variantName,omitempty"` + + // VariantSetIds: At most one variant set ID must be provided. Only + // variants from this variant set will be returned. If omitted, a call + // set id must be included in the request. + VariantSetIds []string `json:"variantSetIds,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CallSetIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchVariantsRequest) MarshalJSON() ([]byte, error) { + type noMethod SearchVariantsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SearchVariantsResponse: The variant search response. +type SearchVariantsResponse struct { + // 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. This field will be empty if there + // aren't any additional results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Variants: The list of matching Variants. + Variants []*Variant `json:"variants,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchVariantsResponse) MarshalJSON() ([]byte, error) { + type noMethod SearchVariantsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Transcript: A transcript represents the assertion that a particular +// region of the reference genome may be transcribed as RNA. +type Transcript struct { + // CodingSequence: The range of the coding sequence for this transcript, + // if any. To determine the exact ranges of coding sequence, intersect + // this range with those of the exons, if any. If there are any exons, + // the codingSequence must start and end within them. + // + // Note that in some cases, the reference genome will not exactly match + // the observed mRNA transcript e.g. due to variance in the source + // genome from reference. In these cases, exon.frame will not + // necessarily match the expected reference reading frame and coding + // exon reference bases cannot necessarily be concatenated to produce + // the original transcript mRNA. + CodingSequence *TranscriptCodingSequence `json:"codingSequence,omitempty"` + + // Exons: The exons that compose this transcript. This field should be + // unset for genomes where transcript splicing does not occur, for + // example prokaryotes. + // + // + // Introns are regions of the transcript that are not included in the + // spliced RNA product. Though not explicitly modeled here, intron + // ranges can be deduced; all regions of this transcript that are not + // exons are introns. + // + // + // Exonic sequences do not necessarily code for a translational product + // (amino acids). Only the regions of exons bounded by the + // codingSequence correspond to coding DNA sequence. + // + // + // Exons are ordered by start position and may not overlap. + Exons []*TranscriptExon `json:"exons,omitempty"` + + // GeneId: The annotation ID of the gene from which this transcript is + // transcribed. + GeneId string `json:"geneId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CodingSequence") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Transcript) MarshalJSON() ([]byte, error) { + type noMethod Transcript + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TranscriptCodingSequence struct { + // End: The end of the coding sequence on this annotation's reference + // sequence, 0-based exclusive. Note that this position is relative to + // the reference start, and not the containing annotation start. + End int64 `json:"end,omitempty,string"` + + // Start: The start of the coding sequence on this annotation's + // reference sequence, 0-based inclusive. Note that this position is + // relative to the reference start, and not the containing annotation + // start. + Start int64 `json:"start,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "End") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TranscriptCodingSequence) MarshalJSON() ([]byte, error) { + type noMethod TranscriptCodingSequence + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TranscriptExon struct { + // End: The end position of the exon on this annotation's reference + // sequence, 0-based exclusive. Note that this is relative to the + // reference start, and not the containing annotation start. + End int64 `json:"end,omitempty,string"` + + // Frame: The frame of this exon. Contains a value of 0, 1, or 2, which + // indicates the offset of the first coding base of the exon within the + // reading frame of the coding DNA sequence, if any. This field is + // dependent on the strandedness of this annotation (see + // Annotation.position.reverseStrand). For forward stranded annotations, + // this offset is relative to the exon.start. For reverse strand + // annotations, this offset is relative to the exon.end-1. + // + // Unset if this exon does not intersect the coding sequence. Upon + // creation of a transcript, the frame must be populated for all or none + // of the coding exons. + Frame *Int32Value `json:"frame,omitempty"` + + // Start: The start position of the exon on this annotation's reference + // sequence, 0-based inclusive. Note that this is relative to the + // reference start, and not the containing annotation start. + Start int64 `json:"start,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "End") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TranscriptExon) MarshalJSON() ([]byte, error) { + type noMethod TranscriptExon + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Variant: A variant represents a change in DNA sequence relative to a +// reference sequence. For example, a variant could represent a SNP or +// an insertion. Variants belong to a variant set. Each of the calls on +// a variant represent a determination of genotype with respect to that +// variant. For example, a call might assign probability of 0.32 to the +// occurrence of a SNP named rs1234 in a sample named NA12345. A call +// belongs to a call set, which contains related calls typically from +// one sample. +type Variant struct { + // AlternateBases: The bases that appear instead of the reference bases. + AlternateBases []string `json:"alternateBases,omitempty"` + + // Calls: The variant calls for this particular variant. Each one + // represents the determination of genotype with respect to this + // variant. + Calls []*Call `json:"calls,omitempty"` + + // Created: The date this variant was created, in milliseconds from the + // epoch. + Created int64 `json:"created,omitempty,string"` + + // End: The end position (0-based) of this variant. This corresponds to + // the first base after the last base in the reference allele. So, the + // length of the reference allele is (end - start). This is useful for + // variants that don't explicitly give alternate bases, for example + // large deletions. + End int64 `json:"end,omitempty,string"` + + // Filter: A list of filters (normally quality filters) this variant has + // failed. PASS indicates this variant has passed all filters. + Filter []string `json:"filter,omitempty"` + + // Id: The Google generated ID of the variant, immutable. + Id string `json:"id,omitempty"` + + // Info: A string which maps to an array of values. + Info map[string][]string `json:"info,omitempty"` + + // Names: Names for the variant, for example a RefSNP ID. + Names []string `json:"names,omitempty"` + + // Quality: A measure of how likely this variant is to be real. A higher + // value is better. + Quality float64 `json:"quality,omitempty"` + + // ReferenceBases: The reference bases for this variant. They start at + // the given position. + ReferenceBases string `json:"referenceBases,omitempty"` + + // ReferenceName: The reference on which this variant occurs. (such as + // chr20 or X) + ReferenceName string `json:"referenceName,omitempty"` + + // Start: The position at which this variant occurs (0-based). This + // corresponds to the first base of the string of reference bases. + Start int64 `json:"start,omitempty,string"` + + // VariantSetId: The ID of the variant set this variant belongs to. + VariantSetId string `json:"variantSetId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AlternateBases") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Variant) MarshalJSON() ([]byte, error) { + type noMethod Variant + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VariantAnnotation: A Variant annotation. +type VariantAnnotation struct { + // AlternateBases: The alternate allele for this variant. If multiple + // alternate alleles exist at this location, create a separate variant + // for each one, as they may represent distinct conditions. + AlternateBases string `json:"alternateBases,omitempty"` + + // ClinicalSignificance: Describes the clinical significance of a + // variant. It is adapted from the ClinVar controlled vocabulary for + // clinical significance described at: + // http://www.ncbi.nlm.nih.gov/clinvar/docs/clinsig/ + // + // Possible values: + // "ASSOCIATION" + // "BENIGN" + // "CLINICAL_SIGNIFICANCE_UNSPECIFIED" + // "CONFERS_SENSITIVITY" + // "DRUG_RESPONSE" + // "HISTOCOMPATIBILITY" + // "LIKELY_BENIGN" + // "LIKELY_PATHOGENIC" + // "MULTIPLE_REPORTED" + // "OTHER" + // "PATHOGENIC" + // "PROTECTIVE" + // "RISK_FACTOR" + // "UNCERTAIN" + ClinicalSignificance string `json:"clinicalSignificance,omitempty"` + + // Conditions: The set of conditions associated with this variant. A + // condition describes the way a variant influences human health. + Conditions []*VariantAnnotationCondition `json:"conditions,omitempty"` + + // Effect: Effect of the variant on the coding sequence. + // + // Possible values: + // "EFFECT_UNSPECIFIED" + // "FRAMESHIFT" + // "FRAME_PRESERVING_INDEL" + // "NONSYNONYMOUS_SNP" + // "OTHER" + // "SPLICE_SITE_DISRUPTION" + // "STOP_GAIN" + // "STOP_LOSS" + // "SYNONYMOUS_SNP" + Effect string `json:"effect,omitempty"` + + // GeneId: Google annotation ID of the gene affected by this variant. + // This should be provided when the variant is created. + GeneId string `json:"geneId,omitempty"` + + // TranscriptIds: Google annotation IDs of the transcripts affected by + // this variant. These should be provided when the variant is created. + TranscriptIds []string `json:"transcriptIds,omitempty"` + + // Type: Type has been adapted from ClinVar's list of variant types. + // + // Possible values: + // "CNV" + // "DELETION" + // "INSERTION" + // "OTHER" + // "SNP" + // "STRUCTURAL" + // "SUBSTITUTION" + // "TYPE_UNSPECIFIED" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AlternateBases") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VariantAnnotation) MarshalJSON() ([]byte, error) { + type noMethod VariantAnnotation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type VariantAnnotationCondition struct { + // ConceptId: The MedGen concept id associated with this gene. Search + // for these IDs at http://www.ncbi.nlm.nih.gov/medgen/ + ConceptId string `json:"conceptId,omitempty"` + + // ExternalIds: The set of external IDs for this condition. + ExternalIds []*ExternalId `json:"externalIds,omitempty"` + + // Names: A set of names for the condition. + Names []string `json:"names,omitempty"` + + // OmimId: The OMIM id for this condition. Search for these IDs at + // http://omim.org/ + OmimId string `json:"omimId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ConceptId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VariantAnnotationCondition) MarshalJSON() ([]byte, error) { + type noMethod VariantAnnotationCondition + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VariantSet: A variant set is a collection of call sets and variants. +// It contains summary statistics of those contents. A variant set +// belongs to a dataset. +type VariantSet struct { + // DatasetId: The dataset to which this variant set belongs. Immutable. + DatasetId string `json:"datasetId,omitempty"` + + // Id: The Google-generated ID of the variant set. Immutable. + Id string `json:"id,omitempty"` + + // Metadata: The metadata associated with this variant set. + Metadata []*Metadata `json:"metadata,omitempty"` + + // ReferenceBounds: A list of all references used by the variants in a + // variant set with associated coordinate upper bounds for each one. + ReferenceBounds []*ReferenceBound `json:"referenceBounds,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DatasetId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VariantSet) MarshalJSON() ([]byte, error) { + type noMethod VariantSet + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "genomics.annotationSets.create": + +type AnnotationSetsCreateCall struct { + s *Service + annotationset *AnnotationSet + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a new annotation set. Caller must have WRITE +// permission for the associated dataset. +func (r *AnnotationSetsService) Create(annotationset *AnnotationSet) *AnnotationSetsCreateCall { + c := &AnnotationSetsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.annotationset = annotationset + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AnnotationSetsCreateCall) Fields(s ...googleapi.Field) *AnnotationSetsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AnnotationSetsCreateCall) Context(ctx context.Context) *AnnotationSetsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *AnnotationSetsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.annotationset) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "annotationSets") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.annotationSets.create" call. +// Exactly one of *AnnotationSet or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AnnotationSet.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AnnotationSetsCreateCall) Do() (*AnnotationSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AnnotationSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new annotation set. Caller must have WRITE permission for the associated dataset.", + // "httpMethod": "POST", + // "id": "genomics.annotationSets.create", + // "path": "annotationSets", + // "request": { + // "$ref": "AnnotationSet" + // }, + // "response": { + // "$ref": "AnnotationSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.annotationSets.delete": + +type AnnotationSetsDeleteCall struct { + s *Service + annotationSetId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an annotation set. Caller must have WRITE permission +// for the associated annotation set. +func (r *AnnotationSetsService) Delete(annotationSetId string) *AnnotationSetsDeleteCall { + c := &AnnotationSetsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.annotationSetId = annotationSetId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AnnotationSetsDeleteCall) Fields(s ...googleapi.Field) *AnnotationSetsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AnnotationSetsDeleteCall) Context(ctx context.Context) *AnnotationSetsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AnnotationSetsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "annotationSets/{annotationSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "annotationSetId": c.annotationSetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.annotationSets.delete" call. +func (c *AnnotationSetsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an annotation set. Caller must have WRITE permission for the associated annotation set.", + // "httpMethod": "DELETE", + // "id": "genomics.annotationSets.delete", + // "parameterOrder": [ + // "annotationSetId" + // ], + // "parameters": { + // "annotationSetId": { + // "description": "The ID of the annotation set to be deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "annotationSets/{annotationSetId}", + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.annotationSets.get": + +type AnnotationSetsGetCall struct { + s *Service + annotationSetId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets an annotation set. Caller must have READ permission for the +// associated dataset. +func (r *AnnotationSetsService) Get(annotationSetId string) *AnnotationSetsGetCall { + c := &AnnotationSetsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.annotationSetId = annotationSetId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AnnotationSetsGetCall) Fields(s ...googleapi.Field) *AnnotationSetsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AnnotationSetsGetCall) IfNoneMatch(entityTag string) *AnnotationSetsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AnnotationSetsGetCall) Context(ctx context.Context) *AnnotationSetsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AnnotationSetsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "annotationSets/{annotationSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "annotationSetId": c.annotationSetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.annotationSets.get" call. +// Exactly one of *AnnotationSet or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AnnotationSet.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AnnotationSetsGetCall) Do() (*AnnotationSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AnnotationSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets an annotation set. Caller must have READ permission for the associated dataset.", + // "httpMethod": "GET", + // "id": "genomics.annotationSets.get", + // "parameterOrder": [ + // "annotationSetId" + // ], + // "parameters": { + // "annotationSetId": { + // "description": "The ID of the annotation set to be retrieved.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "annotationSets/{annotationSetId}", + // "response": { + // "$ref": "AnnotationSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.annotationSets.patch": + +type AnnotationSetsPatchCall struct { + s *Service + annotationSetId string + annotationset *AnnotationSet + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an annotation set. The update must respect all +// mutability restrictions and other invariants described on the +// annotation set resource. Caller must have WRITE permission for the +// associated dataset. This method supports patch semantics. +func (r *AnnotationSetsService) Patch(annotationSetId string, annotationset *AnnotationSet) *AnnotationSetsPatchCall { + c := &AnnotationSetsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.annotationSetId = annotationSetId + c.annotationset = annotationset + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AnnotationSetsPatchCall) Fields(s ...googleapi.Field) *AnnotationSetsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AnnotationSetsPatchCall) Context(ctx context.Context) *AnnotationSetsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AnnotationSetsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.annotationset) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "annotationSets/{annotationSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "annotationSetId": c.annotationSetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.annotationSets.patch" call. +// Exactly one of *AnnotationSet or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AnnotationSet.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AnnotationSetsPatchCall) Do() (*AnnotationSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AnnotationSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an annotation set. The update must respect all mutability restrictions and other invariants described on the annotation set resource. Caller must have WRITE permission for the associated dataset. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "genomics.annotationSets.patch", + // "parameterOrder": [ + // "annotationSetId" + // ], + // "parameters": { + // "annotationSetId": { + // "description": "The ID of the annotation set to be updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "annotationSets/{annotationSetId}", + // "request": { + // "$ref": "AnnotationSet" + // }, + // "response": { + // "$ref": "AnnotationSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.annotationSets.search": + +type AnnotationSetsSearchCall struct { + s *Service + searchannotationsetsrequest *SearchAnnotationSetsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Search: Searches for annotation sets that match the given criteria. +// Results are returned in a deterministic order. Caller must have READ +// permission for the queried datasets. +func (r *AnnotationSetsService) Search(searchannotationsetsrequest *SearchAnnotationSetsRequest) *AnnotationSetsSearchCall { + c := &AnnotationSetsSearchCall{s: r.s, opt_: make(map[string]interface{})} + c.searchannotationsetsrequest = searchannotationsetsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AnnotationSetsSearchCall) Fields(s ...googleapi.Field) *AnnotationSetsSearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AnnotationSetsSearchCall) Context(ctx context.Context) *AnnotationSetsSearchCall { + c.ctx_ = ctx + return c +} + +func (c *AnnotationSetsSearchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchannotationsetsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "annotationSets/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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.annotationSets.search" call. +// Exactly one of *SearchAnnotationSetsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *SearchAnnotationSetsResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AnnotationSetsSearchCall) Do() (*SearchAnnotationSetsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SearchAnnotationSetsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Searches for annotation sets that match the given criteria. Results are returned in a deterministic order. Caller must have READ permission for the queried datasets.", + // "httpMethod": "POST", + // "id": "genomics.annotationSets.search", + // "path": "annotationSets/search", + // "request": { + // "$ref": "SearchAnnotationSetsRequest" + // }, + // "response": { + // "$ref": "SearchAnnotationSetsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.annotationSets.update": + +type AnnotationSetsUpdateCall struct { + s *Service + annotationSetId string + annotationset *AnnotationSet + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an annotation set. The update must respect all +// mutability restrictions and other invariants described on the +// annotation set resource. Caller must have WRITE permission for the +// associated dataset. +func (r *AnnotationSetsService) Update(annotationSetId string, annotationset *AnnotationSet) *AnnotationSetsUpdateCall { + c := &AnnotationSetsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.annotationSetId = annotationSetId + c.annotationset = annotationset + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AnnotationSetsUpdateCall) Fields(s ...googleapi.Field) *AnnotationSetsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AnnotationSetsUpdateCall) Context(ctx context.Context) *AnnotationSetsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AnnotationSetsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.annotationset) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "annotationSets/{annotationSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "annotationSetId": c.annotationSetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.annotationSets.update" call. +// Exactly one of *AnnotationSet or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AnnotationSet.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AnnotationSetsUpdateCall) Do() (*AnnotationSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AnnotationSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an annotation set. The update must respect all mutability restrictions and other invariants described on the annotation set resource. Caller must have WRITE permission for the associated dataset.", + // "httpMethod": "PUT", + // "id": "genomics.annotationSets.update", + // "parameterOrder": [ + // "annotationSetId" + // ], + // "parameters": { + // "annotationSetId": { + // "description": "The ID of the annotation set to be updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "annotationSets/{annotationSetId}", + // "request": { + // "$ref": "AnnotationSet" + // }, + // "response": { + // "$ref": "AnnotationSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.annotations.batchCreate": + +type AnnotationsBatchCreateCall struct { + s *Service + batchcreateannotationsrequest *BatchCreateAnnotationsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// BatchCreate: Creates one or more new annotations atomically. All +// annotations must belong to the same annotation set. Caller must have +// WRITE permission for this annotation set. For optimal performance, +// batch positionally adjacent annotations together. +// +// +// If the request has a systemic issue, such as an attempt to write to +// an inaccessible annotation set, the entire RPC will fail accordingly. +// For lesser data issues, when possible an error will be isolated to +// the corresponding batch entry in the response; the remaining well +// formed annotations will be created normally. +func (r *AnnotationsService) BatchCreate(batchcreateannotationsrequest *BatchCreateAnnotationsRequest) *AnnotationsBatchCreateCall { + c := &AnnotationsBatchCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.batchcreateannotationsrequest = batchcreateannotationsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AnnotationsBatchCreateCall) Fields(s ...googleapi.Field) *AnnotationsBatchCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AnnotationsBatchCreateCall) Context(ctx context.Context) *AnnotationsBatchCreateCall { + c.ctx_ = ctx + return c +} + +func (c *AnnotationsBatchCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreateannotationsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "annotations:batchCreate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.annotations.batchCreate" call. +// Exactly one of *BatchAnnotationsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *BatchAnnotationsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AnnotationsBatchCreateCall) Do() (*BatchAnnotationsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BatchAnnotationsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates one or more new annotations atomically. All annotations must belong to the same annotation set. Caller must have WRITE permission for this annotation set. For optimal performance, batch positionally adjacent annotations together.\n\n\nIf the request has a systemic issue, such as an attempt to write to an inaccessible annotation set, the entire RPC will fail accordingly. For lesser data issues, when possible an error will be isolated to the corresponding batch entry in the response; the remaining well formed annotations will be created normally.", + // "httpMethod": "POST", + // "id": "genomics.annotations.batchCreate", + // "path": "annotations:batchCreate", + // "request": { + // "$ref": "BatchCreateAnnotationsRequest" + // }, + // "response": { + // "$ref": "BatchAnnotationsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.annotations.create": + +type AnnotationsCreateCall struct { + s *Service + annotation *Annotation + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a new annotation. Caller must have WRITE permission +// for the associated annotation set. +func (r *AnnotationsService) Create(annotation *Annotation) *AnnotationsCreateCall { + c := &AnnotationsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.annotation = annotation + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AnnotationsCreateCall) Fields(s ...googleapi.Field) *AnnotationsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AnnotationsCreateCall) Context(ctx context.Context) *AnnotationsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *AnnotationsCreateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.annotations.create" call. +// Exactly one of *Annotation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Annotation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AnnotationsCreateCall) Do() (*Annotation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Annotation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new annotation. Caller must have WRITE permission for the associated annotation set.", + // "httpMethod": "POST", + // "id": "genomics.annotations.create", + // "path": "annotations", + // "request": { + // "$ref": "Annotation" + // }, + // "response": { + // "$ref": "Annotation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.annotations.delete": + +type AnnotationsDeleteCall struct { + s *Service + annotationId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an annotation. Caller must have WRITE permission for +// the associated annotation set. +func (r *AnnotationsService) Delete(annotationId string) *AnnotationsDeleteCall { + c := &AnnotationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.annotationId = annotationId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AnnotationsDeleteCall) Fields(s ...googleapi.Field) *AnnotationsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AnnotationsDeleteCall) Context(ctx context.Context) *AnnotationsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AnnotationsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "annotations/{annotationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "annotationId": c.annotationId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.annotations.delete" call. +func (c *AnnotationsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an annotation. Caller must have WRITE permission for the associated annotation set.", + // "httpMethod": "DELETE", + // "id": "genomics.annotations.delete", + // "parameterOrder": [ + // "annotationId" + // ], + // "parameters": { + // "annotationId": { + // "description": "The ID of the annotation set to be deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "annotations/{annotationId}", + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.annotations.get": + +type AnnotationsGetCall struct { + s *Service + annotationId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets an annotation. Caller must have READ permission for the +// associated annotation set. +func (r *AnnotationsService) Get(annotationId string) *AnnotationsGetCall { + c := &AnnotationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.annotationId = annotationId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AnnotationsGetCall) Fields(s ...googleapi.Field) *AnnotationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AnnotationsGetCall) IfNoneMatch(entityTag string) *AnnotationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AnnotationsGetCall) Context(ctx context.Context) *AnnotationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AnnotationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "annotations/{annotationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "annotationId": c.annotationId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.annotations.get" call. +// Exactly one of *Annotation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Annotation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AnnotationsGetCall) Do() (*Annotation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Annotation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets an annotation. Caller must have READ permission for the associated annotation set.", + // "httpMethod": "GET", + // "id": "genomics.annotations.get", + // "parameterOrder": [ + // "annotationId" + // ], + // "parameters": { + // "annotationId": { + // "description": "The ID of the annotation set to be retrieved.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "annotations/{annotationId}", + // "response": { + // "$ref": "Annotation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.annotations.patch": + +type AnnotationsPatchCall struct { + s *Service + annotationId string + annotation *Annotation + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates an annotation. The update must respect all mutability +// restrictions and other invariants described on the annotation +// resource. Caller must have WRITE permission for the associated +// dataset. This method supports patch semantics. +func (r *AnnotationsService) Patch(annotationId string, annotation *Annotation) *AnnotationsPatchCall { + c := &AnnotationsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.annotationId = annotationId + c.annotation = annotation + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AnnotationsPatchCall) Fields(s ...googleapi.Field) *AnnotationsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AnnotationsPatchCall) Context(ctx context.Context) *AnnotationsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AnnotationsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "annotations/{annotationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "annotationId": c.annotationId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.annotations.patch" call. +// Exactly one of *Annotation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Annotation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AnnotationsPatchCall) Do() (*Annotation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Annotation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an annotation. The update must respect all mutability restrictions and other invariants described on the annotation resource. Caller must have WRITE permission for the associated dataset. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "genomics.annotations.patch", + // "parameterOrder": [ + // "annotationId" + // ], + // "parameters": { + // "annotationId": { + // "description": "The ID of the annotation set to be updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "annotations/{annotationId}", + // "request": { + // "$ref": "Annotation" + // }, + // "response": { + // "$ref": "Annotation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.annotations.search": + +type AnnotationsSearchCall struct { + s *Service + searchannotationsrequest *SearchAnnotationsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Search: Searches for annotations that match the given criteria. +// Results are returned ordered by start position. Annotations that have +// matching start positions are ordered deterministically. Caller must +// have READ permission for the queried annotation sets. +func (r *AnnotationsService) Search(searchannotationsrequest *SearchAnnotationsRequest) *AnnotationsSearchCall { + c := &AnnotationsSearchCall{s: r.s, opt_: make(map[string]interface{})} + c.searchannotationsrequest = searchannotationsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AnnotationsSearchCall) Fields(s ...googleapi.Field) *AnnotationsSearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AnnotationsSearchCall) Context(ctx context.Context) *AnnotationsSearchCall { + c.ctx_ = ctx + return c +} + +func (c *AnnotationsSearchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchannotationsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "annotations/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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.annotations.search" call. +// Exactly one of *SearchAnnotationsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *SearchAnnotationsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AnnotationsSearchCall) Do() (*SearchAnnotationsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SearchAnnotationsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Searches for annotations that match the given criteria. Results are returned ordered by start position. Annotations that have matching start positions are ordered deterministically. Caller must have READ permission for the queried annotation sets.", + // "httpMethod": "POST", + // "id": "genomics.annotations.search", + // "path": "annotations/search", + // "request": { + // "$ref": "SearchAnnotationsRequest" + // }, + // "response": { + // "$ref": "SearchAnnotationsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.annotations.update": + +type AnnotationsUpdateCall struct { + s *Service + annotationId string + annotation *Annotation + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an annotation. The update must respect all mutability +// restrictions and other invariants described on the annotation +// resource. Caller must have WRITE permission for the associated +// dataset. +func (r *AnnotationsService) Update(annotationId string, annotation *Annotation) *AnnotationsUpdateCall { + c := &AnnotationsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.annotationId = annotationId + c.annotation = annotation + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AnnotationsUpdateCall) Fields(s ...googleapi.Field) *AnnotationsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AnnotationsUpdateCall) Context(ctx context.Context) *AnnotationsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AnnotationsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "annotations/{annotationId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "annotationId": c.annotationId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.annotations.update" call. +// Exactly one of *Annotation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Annotation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AnnotationsUpdateCall) Do() (*Annotation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Annotation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an annotation. The update must respect all mutability restrictions and other invariants described on the annotation resource. Caller must have WRITE permission for the associated dataset.", + // "httpMethod": "PUT", + // "id": "genomics.annotations.update", + // "parameterOrder": [ + // "annotationId" + // ], + // "parameters": { + // "annotationId": { + // "description": "The ID of the annotation set to be updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "annotations/{annotationId}", + // "request": { + // "$ref": "Annotation" + // }, + // "response": { + // "$ref": "Annotation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.callsets.create": + +type CallsetsCreateCall struct { + s *Service + callset *CallSet + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a new call set. +func (r *CallsetsService) Create(callset *CallSet) *CallsetsCreateCall { + c := &CallsetsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.callset = callset + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CallsetsCreateCall) Fields(s ...googleapi.Field) *CallsetsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CallsetsCreateCall) Context(ctx context.Context) *CallsetsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *CallsetsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.callset) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "callsets") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.callsets.create" call. +// Exactly one of *CallSet or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *CallSet.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CallsetsCreateCall) Do() (*CallSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CallSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new call set.", + // "httpMethod": "POST", + // "id": "genomics.callsets.create", + // "path": "callsets", + // "request": { + // "$ref": "CallSet" + // }, + // "response": { + // "$ref": "CallSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.callsets.delete": + +type CallsetsDeleteCall struct { + s *Service + callSetId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a call set. +func (r *CallsetsService) Delete(callSetId string) *CallsetsDeleteCall { + c := &CallsetsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.callSetId = callSetId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CallsetsDeleteCall) Fields(s ...googleapi.Field) *CallsetsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CallsetsDeleteCall) Context(ctx context.Context) *CallsetsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *CallsetsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "callsets/{callSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "callSetId": c.callSetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.callsets.delete" call. +func (c *CallsetsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a call set.", + // "httpMethod": "DELETE", + // "id": "genomics.callsets.delete", + // "parameterOrder": [ + // "callSetId" + // ], + // "parameters": { + // "callSetId": { + // "description": "The ID of the call set to be deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "callsets/{callSetId}", + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.callsets.get": + +type CallsetsGetCall struct { + s *Service + callSetId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a call set by ID. +func (r *CallsetsService) Get(callSetId string) *CallsetsGetCall { + c := &CallsetsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.callSetId = callSetId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CallsetsGetCall) Fields(s ...googleapi.Field) *CallsetsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CallsetsGetCall) IfNoneMatch(entityTag string) *CallsetsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CallsetsGetCall) Context(ctx context.Context) *CallsetsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CallsetsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "callsets/{callSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "callSetId": c.callSetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.callsets.get" call. +// Exactly one of *CallSet or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *CallSet.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CallsetsGetCall) Do() (*CallSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CallSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a call set by ID.", + // "httpMethod": "GET", + // "id": "genomics.callsets.get", + // "parameterOrder": [ + // "callSetId" + // ], + // "parameters": { + // "callSetId": { + // "description": "The ID of the call set.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "callsets/{callSetId}", + // "response": { + // "$ref": "CallSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.callsets.patch": + +type CallsetsPatchCall struct { + s *Service + callSetId string + callset *CallSet + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates a call set. This method supports patch semantics. +func (r *CallsetsService) Patch(callSetId string, callset *CallSet) *CallsetsPatchCall { + c := &CallsetsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.callSetId = callSetId + c.callset = callset + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CallsetsPatchCall) Fields(s ...googleapi.Field) *CallsetsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CallsetsPatchCall) Context(ctx context.Context) *CallsetsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CallsetsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.callset) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "callsets/{callSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "callSetId": c.callSetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.callsets.patch" call. +// Exactly one of *CallSet or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *CallSet.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CallsetsPatchCall) Do() (*CallSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CallSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a call set. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "genomics.callsets.patch", + // "parameterOrder": [ + // "callSetId" + // ], + // "parameters": { + // "callSetId": { + // "description": "The ID of the call set to be updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "callsets/{callSetId}", + // "request": { + // "$ref": "CallSet" + // }, + // "response": { + // "$ref": "CallSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.callsets.search": + +type CallsetsSearchCall struct { + s *Service + searchcallsetsrequest *SearchCallSetsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Search: Gets a list of call sets matching the criteria. +// +// Implements GlobalAllianceApi.searchCallSets. +func (r *CallsetsService) Search(searchcallsetsrequest *SearchCallSetsRequest) *CallsetsSearchCall { + c := &CallsetsSearchCall{s: r.s, opt_: make(map[string]interface{})} + c.searchcallsetsrequest = searchcallsetsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CallsetsSearchCall) Fields(s ...googleapi.Field) *CallsetsSearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CallsetsSearchCall) Context(ctx context.Context) *CallsetsSearchCall { + c.ctx_ = ctx + return c +} + +func (c *CallsetsSearchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchcallsetsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "callsets/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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.callsets.search" call. +// Exactly one of *SearchCallSetsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SearchCallSetsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CallsetsSearchCall) Do() (*SearchCallSetsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SearchCallSetsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a list of call sets matching the criteria.\n\nImplements GlobalAllianceApi.searchCallSets.", + // "httpMethod": "POST", + // "id": "genomics.callsets.search", + // "path": "callsets/search", + // "request": { + // "$ref": "SearchCallSetsRequest" + // }, + // "response": { + // "$ref": "SearchCallSetsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.callsets.update": + +type CallsetsUpdateCall struct { + s *Service + callSetId string + callset *CallSet + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a call set. +func (r *CallsetsService) Update(callSetId string, callset *CallSet) *CallsetsUpdateCall { + c := &CallsetsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.callSetId = callSetId + c.callset = callset + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CallsetsUpdateCall) Fields(s ...googleapi.Field) *CallsetsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CallsetsUpdateCall) Context(ctx context.Context) *CallsetsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CallsetsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.callset) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "callsets/{callSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "callSetId": c.callSetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.callsets.update" call. +// Exactly one of *CallSet or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *CallSet.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CallsetsUpdateCall) Do() (*CallSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CallSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a call set.", + // "httpMethod": "PUT", + // "id": "genomics.callsets.update", + // "parameterOrder": [ + // "callSetId" + // ], + // "parameters": { + // "callSetId": { + // "description": "The ID of the call set to be updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "callsets/{callSetId}", + // "request": { + // "$ref": "CallSet" + // }, + // "response": { + // "$ref": "CallSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.datasets.create": + +type DatasetsCreateCall struct { + s *Service + dataset *Dataset + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a new dataset. +func (r *DatasetsService) Create(dataset *Dataset) *DatasetsCreateCall { + c := &DatasetsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.dataset = dataset + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsCreateCall) Fields(s ...googleapi.Field) *DatasetsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsCreateCall) Context(ctx context.Context) *DatasetsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsCreateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "datasets") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.datasets.create" call. +// Exactly one of *Dataset or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Dataset.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *DatasetsCreateCall) Do() (*Dataset, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Dataset{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new dataset.", + // "httpMethod": "POST", + // "id": "genomics.datasets.create", + // "path": "datasets", + // "request": { + // "$ref": "Dataset" + // }, + // "response": { + // "$ref": "Dataset" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.datasets.delete": + +type DatasetsDeleteCall struct { + s *Service + datasetId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a dataset. +func (r *DatasetsService) Delete(datasetId string) *DatasetsDeleteCall { + c := &DatasetsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.datasetId = datasetId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsDeleteCall) Fields(s ...googleapi.Field) *DatasetsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsDeleteCall) Context(ctx context.Context) *DatasetsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "datasets/{datasetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "datasetId": c.datasetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.datasets.delete" call. +func (c *DatasetsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a dataset.", + // "httpMethod": "DELETE", + // "id": "genomics.datasets.delete", + // "parameterOrder": [ + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "The ID of the dataset to be deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "datasets/{datasetId}", + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.datasets.get": + +type DatasetsGetCall struct { + s *Service + datasetId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a dataset by ID. +func (r *DatasetsService) Get(datasetId string) *DatasetsGetCall { + c := &DatasetsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.datasetId = datasetId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsGetCall) Fields(s ...googleapi.Field) *DatasetsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DatasetsGetCall) IfNoneMatch(entityTag string) *DatasetsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsGetCall) Context(ctx context.Context) *DatasetsGetCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "datasets/{datasetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "datasetId": c.datasetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.datasets.get" call. +// Exactly one of *Dataset or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Dataset.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *DatasetsGetCall) Do() (*Dataset, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Dataset{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a dataset by ID.", + // "httpMethod": "GET", + // "id": "genomics.datasets.get", + // "parameterOrder": [ + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "The ID of the dataset.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "datasets/{datasetId}", + // "response": { + // "$ref": "Dataset" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.datasets.list": + +type DatasetsListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists datasets within a project. +func (r *DatasetsService) List() *DatasetsListCall { + c := &DatasetsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results returned by this request. If unspecified, defaults to 50. +func (c *DatasetsListCall) PageSize(pageSize int64) *DatasetsListCall { + c.opt_["pageSize"] = pageSize + 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 *DatasetsListCall) PageToken(pageToken string) *DatasetsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// ProjectNumber sets the optional parameter "projectNumber": Required. +// The project to list datasets for. +func (c *DatasetsListCall) ProjectNumber(projectNumber int64) *DatasetsListCall { + c.opt_["projectNumber"] = projectNumber + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsListCall) Fields(s ...googleapi.Field) *DatasetsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DatasetsListCall) IfNoneMatch(entityTag string) *DatasetsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsListCall) Context(ctx context.Context) *DatasetsListCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projectNumber"]; ok { + params.Set("projectNumber", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "datasets") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.datasets.list" call. +// Exactly one of *ListDatasetsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListDatasetsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DatasetsListCall) Do() (*ListDatasetsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListDatasetsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists datasets within a project.", + // "httpMethod": "GET", + // "id": "genomics.datasets.list", + // "parameters": { + // "pageSize": { + // "description": "The maximum number of results returned by this request. If unspecified, defaults to 50.", + // "format": "int32", + // "location": "query", + // "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" + // }, + // "projectNumber": { + // "description": "Required. The project to list datasets for.", + // "format": "int64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "datasets", + // "response": { + // "$ref": "ListDatasetsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.datasets.patch": + +type DatasetsPatchCall struct { + s *Service + datasetId string + dataset *Dataset + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates a dataset. This method supports patch semantics. +func (r *DatasetsService) Patch(datasetId string, dataset *Dataset) *DatasetsPatchCall { + c := &DatasetsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.datasetId = datasetId + c.dataset = dataset + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsPatchCall) Fields(s ...googleapi.Field) *DatasetsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsPatchCall) Context(ctx context.Context) *DatasetsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "datasets/{datasetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "datasetId": c.datasetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.datasets.patch" call. +// Exactly one of *Dataset or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Dataset.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *DatasetsPatchCall) Do() (*Dataset, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Dataset{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a dataset. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "genomics.datasets.patch", + // "parameterOrder": [ + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "The ID of the dataset to be updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "datasets/{datasetId}", + // "request": { + // "$ref": "Dataset" + // }, + // "response": { + // "$ref": "Dataset" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.datasets.undelete": + +type DatasetsUndeleteCall struct { + s *Service + datasetId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Undelete: Undeletes a dataset by restoring a dataset which was +// deleted via this API. This operation is only possible for a week +// after the deletion occurred. +func (r *DatasetsService) Undelete(datasetId string) *DatasetsUndeleteCall { + c := &DatasetsUndeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.datasetId = datasetId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsUndeleteCall) Fields(s ...googleapi.Field) *DatasetsUndeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsUndeleteCall) Context(ctx context.Context) *DatasetsUndeleteCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsUndeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "datasets/{datasetId}/undelete") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "datasetId": c.datasetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.datasets.undelete" call. +// Exactly one of *Dataset or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Dataset.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *DatasetsUndeleteCall) Do() (*Dataset, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Dataset{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Undeletes a dataset by restoring a dataset which was deleted via this API. This operation is only possible for a week after the deletion occurred.", + // "httpMethod": "POST", + // "id": "genomics.datasets.undelete", + // "parameterOrder": [ + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "The ID of the dataset to be undeleted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "datasets/{datasetId}/undelete", + // "response": { + // "$ref": "Dataset" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.datasets.update": + +type DatasetsUpdateCall struct { + s *Service + datasetId string + dataset *Dataset + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a dataset. +func (r *DatasetsService) Update(datasetId string, dataset *Dataset) *DatasetsUpdateCall { + c := &DatasetsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.datasetId = datasetId + c.dataset = dataset + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatasetsUpdateCall) Fields(s ...googleapi.Field) *DatasetsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatasetsUpdateCall) Context(ctx context.Context) *DatasetsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *DatasetsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "datasets/{datasetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "datasetId": c.datasetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.datasets.update" call. +// Exactly one of *Dataset or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Dataset.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *DatasetsUpdateCall) Do() (*Dataset, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Dataset{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a dataset.", + // "httpMethod": "PUT", + // "id": "genomics.datasets.update", + // "parameterOrder": [ + // "datasetId" + // ], + // "parameters": { + // "datasetId": { + // "description": "The ID of the dataset to be updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "datasets/{datasetId}", + // "request": { + // "$ref": "Dataset" + // }, + // "response": { + // "$ref": "Dataset" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.experimental.jobs.create": + +type ExperimentalJobsCreateCall struct { + s *Service + experimentalcreatejobrequest *ExperimentalCreateJobRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates and asynchronously runs an ad-hoc job. This is an +// experimental call and may be removed or changed at any time. +func (r *ExperimentalJobsService) Create(experimentalcreatejobrequest *ExperimentalCreateJobRequest) *ExperimentalJobsCreateCall { + c := &ExperimentalJobsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.experimentalcreatejobrequest = experimentalcreatejobrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ExperimentalJobsCreateCall) Fields(s ...googleapi.Field) *ExperimentalJobsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ExperimentalJobsCreateCall) Context(ctx context.Context) *ExperimentalJobsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *ExperimentalJobsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.experimentalcreatejobrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "experimental/jobs/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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.experimental.jobs.create" call. +// Exactly one of *ExperimentalCreateJobResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ExperimentalCreateJobResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ExperimentalJobsCreateCall) Do() (*ExperimentalCreateJobResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ExperimentalCreateJobResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates and asynchronously runs an ad-hoc job. This is an experimental call and may be removed or changed at any time.", + // "httpMethod": "POST", + // "id": "genomics.experimental.jobs.create", + // "path": "experimental/jobs/create", + // "request": { + // "$ref": "ExperimentalCreateJobRequest" + // }, + // "response": { + // "$ref": "ExperimentalCreateJobResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/devstorage.read_write", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.jobs.cancel": + +type JobsCancelCall struct { + s *Service + jobId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Cancel: Cancels a job by ID. Note that it is possible for partial +// results to be generated and stored for cancelled jobs. +func (r *JobsService) Cancel(jobId string) *JobsCancelCall { + c := &JobsCancelCall{s: r.s, opt_: make(map[string]interface{})} + c.jobId = jobId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *JobsCancelCall) Fields(s ...googleapi.Field) *JobsCancelCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *JobsCancelCall) Context(ctx context.Context) *JobsCancelCall { + c.ctx_ = ctx + return c +} + +func (c *JobsCancelCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "jobs/{jobId}/cancel") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "jobId": c.jobId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.jobs.cancel" call. +func (c *JobsCancelCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Cancels a job by ID. Note that it is possible for partial results to be generated and stored for cancelled jobs.", + // "httpMethod": "POST", + // "id": "genomics.jobs.cancel", + // "parameterOrder": [ + // "jobId" + // ], + // "parameters": { + // "jobId": { + // "description": "Required. The ID of the job.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "jobs/{jobId}/cancel", + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.jobs.get": + +type JobsGetCall struct { + s *Service + jobId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a job by ID. +func (r *JobsService) Get(jobId string) *JobsGetCall { + c := &JobsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.jobId = jobId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *JobsGetCall) Fields(s ...googleapi.Field) *JobsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *JobsGetCall) IfNoneMatch(entityTag string) *JobsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *JobsGetCall) Context(ctx context.Context) *JobsGetCall { + c.ctx_ = ctx + return c +} + +func (c *JobsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "jobs/{jobId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "jobId": c.jobId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.jobs.get" call. +// Exactly one of *Job or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Job.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *JobsGetCall) Do() (*Job, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Job{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a job by ID.", + // "httpMethod": "GET", + // "id": "genomics.jobs.get", + // "parameterOrder": [ + // "jobId" + // ], + // "parameters": { + // "jobId": { + // "description": "Required. The ID of the job.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "jobs/{jobId}", + // "response": { + // "$ref": "Job" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.jobs.search": + +type JobsSearchCall struct { + s *Service + searchjobsrequest *SearchJobsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Search: Gets a list of jobs matching the criteria. +func (r *JobsService) Search(searchjobsrequest *SearchJobsRequest) *JobsSearchCall { + c := &JobsSearchCall{s: r.s, opt_: make(map[string]interface{})} + c.searchjobsrequest = searchjobsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *JobsSearchCall) Fields(s ...googleapi.Field) *JobsSearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *JobsSearchCall) Context(ctx context.Context) *JobsSearchCall { + c.ctx_ = ctx + return c +} + +func (c *JobsSearchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchjobsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "jobs/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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.jobs.search" call. +// Exactly one of *SearchJobsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SearchJobsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *JobsSearchCall) Do() (*SearchJobsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SearchJobsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a list of jobs matching the criteria.", + // "httpMethod": "POST", + // "id": "genomics.jobs.search", + // "path": "jobs/search", + // "request": { + // "$ref": "SearchJobsRequest" + // }, + // "response": { + // "$ref": "SearchJobsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.readgroupsets.align": + +type ReadgroupsetsAlignCall struct { + s *Service + alignreadgroupsetsrequest *AlignReadGroupSetsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Align: Aligns read data from existing read group sets or files from +// Google Cloud Storage. See the alignment and variant calling +// documentation for more details. +func (r *ReadgroupsetsService) Align(alignreadgroupsetsrequest *AlignReadGroupSetsRequest) *ReadgroupsetsAlignCall { + c := &ReadgroupsetsAlignCall{s: r.s, opt_: make(map[string]interface{})} + c.alignreadgroupsetsrequest = alignreadgroupsetsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReadgroupsetsAlignCall) Fields(s ...googleapi.Field) *ReadgroupsetsAlignCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReadgroupsetsAlignCall) Context(ctx context.Context) *ReadgroupsetsAlignCall { + c.ctx_ = ctx + return c +} + +func (c *ReadgroupsetsAlignCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.alignreadgroupsetsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "readgroupsets/align") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.readgroupsets.align" call. +// Exactly one of *AlignReadGroupSetsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *AlignReadGroupSetsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReadgroupsetsAlignCall) Do() (*AlignReadGroupSetsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AlignReadGroupSetsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Aligns read data from existing read group sets or files from Google Cloud Storage. See the alignment and variant calling documentation for more details.", + // "httpMethod": "POST", + // "id": "genomics.readgroupsets.align", + // "path": "readgroupsets/align", + // "request": { + // "$ref": "AlignReadGroupSetsRequest" + // }, + // "response": { + // "$ref": "AlignReadGroupSetsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/devstorage.read_write", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.readgroupsets.call": + +type ReadgroupsetsCallCall struct { + s *Service + callreadgroupsetsrequest *CallReadGroupSetsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Call: Calls variants on read data from existing read group sets or +// files from Google Cloud Storage. See the alignment and variant +// calling documentation for more details. +func (r *ReadgroupsetsService) Call(callreadgroupsetsrequest *CallReadGroupSetsRequest) *ReadgroupsetsCallCall { + c := &ReadgroupsetsCallCall{s: r.s, opt_: make(map[string]interface{})} + c.callreadgroupsetsrequest = callreadgroupsetsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReadgroupsetsCallCall) Fields(s ...googleapi.Field) *ReadgroupsetsCallCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReadgroupsetsCallCall) Context(ctx context.Context) *ReadgroupsetsCallCall { + c.ctx_ = ctx + return c +} + +func (c *ReadgroupsetsCallCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.callreadgroupsetsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "readgroupsets/call") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.readgroupsets.call" call. +// Exactly one of *CallReadGroupSetsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *CallReadGroupSetsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReadgroupsetsCallCall) Do() (*CallReadGroupSetsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CallReadGroupSetsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Calls variants on read data from existing read group sets or files from Google Cloud Storage. See the alignment and variant calling documentation for more details.", + // "httpMethod": "POST", + // "id": "genomics.readgroupsets.call", + // "path": "readgroupsets/call", + // "request": { + // "$ref": "CallReadGroupSetsRequest" + // }, + // "response": { + // "$ref": "CallReadGroupSetsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/devstorage.read_write", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.readgroupsets.delete": + +type ReadgroupsetsDeleteCall struct { + s *Service + readGroupSetId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a read group set. +func (r *ReadgroupsetsService) Delete(readGroupSetId string) *ReadgroupsetsDeleteCall { + c := &ReadgroupsetsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.readGroupSetId = readGroupSetId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReadgroupsetsDeleteCall) Fields(s ...googleapi.Field) *ReadgroupsetsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReadgroupsetsDeleteCall) Context(ctx context.Context) *ReadgroupsetsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ReadgroupsetsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "readgroupsets/{readGroupSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "readGroupSetId": c.readGroupSetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.readgroupsets.delete" call. +func (c *ReadgroupsetsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a read group set.", + // "httpMethod": "DELETE", + // "id": "genomics.readgroupsets.delete", + // "parameterOrder": [ + // "readGroupSetId" + // ], + // "parameters": { + // "readGroupSetId": { + // "description": "The ID of the read group set to be deleted. The caller must have WRITE permissions to the dataset associated with this read group set.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "readgroupsets/{readGroupSetId}", + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.readgroupsets.export": + +type ReadgroupsetsExportCall struct { + s *Service + exportreadgroupsetsrequest *ExportReadGroupSetsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Export: Exports read group sets to a BAM file in Google Cloud +// Storage. +// +// Note that currently there may be some differences between exported +// BAM files and the original BAM file at the time of import. See +// ImportReadGroupSets for details. +func (r *ReadgroupsetsService) Export(exportreadgroupsetsrequest *ExportReadGroupSetsRequest) *ReadgroupsetsExportCall { + c := &ReadgroupsetsExportCall{s: r.s, opt_: make(map[string]interface{})} + c.exportreadgroupsetsrequest = exportreadgroupsetsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReadgroupsetsExportCall) Fields(s ...googleapi.Field) *ReadgroupsetsExportCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReadgroupsetsExportCall) Context(ctx context.Context) *ReadgroupsetsExportCall { + c.ctx_ = ctx + return c +} + +func (c *ReadgroupsetsExportCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportreadgroupsetsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "readgroupsets/export") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.readgroupsets.export" call. +// Exactly one of *ExportReadGroupSetsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ExportReadGroupSetsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReadgroupsetsExportCall) Do() (*ExportReadGroupSetsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ExportReadGroupSetsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Exports read group sets to a BAM file in Google Cloud Storage.\n\nNote that currently there may be some differences between exported BAM files and the original BAM file at the time of import. See ImportReadGroupSets for details.", + // "httpMethod": "POST", + // "id": "genomics.readgroupsets.export", + // "path": "readgroupsets/export", + // "request": { + // "$ref": "ExportReadGroupSetsRequest" + // }, + // "response": { + // "$ref": "ExportReadGroupSetsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/devstorage.read_write", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.readgroupsets.get": + +type ReadgroupsetsGetCall struct { + s *Service + readGroupSetId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a read group set by ID. +func (r *ReadgroupsetsService) Get(readGroupSetId string) *ReadgroupsetsGetCall { + c := &ReadgroupsetsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.readGroupSetId = readGroupSetId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReadgroupsetsGetCall) Fields(s ...googleapi.Field) *ReadgroupsetsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReadgroupsetsGetCall) IfNoneMatch(entityTag string) *ReadgroupsetsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReadgroupsetsGetCall) Context(ctx context.Context) *ReadgroupsetsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ReadgroupsetsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "readgroupsets/{readGroupSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "readGroupSetId": c.readGroupSetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.readgroupsets.get" call. +// Exactly one of *ReadGroupSet or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ReadGroupSet.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReadgroupsetsGetCall) Do() (*ReadGroupSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ReadGroupSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a read group set by ID.", + // "httpMethod": "GET", + // "id": "genomics.readgroupsets.get", + // "parameterOrder": [ + // "readGroupSetId" + // ], + // "parameters": { + // "readGroupSetId": { + // "description": "The ID of the read group set.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "readgroupsets/{readGroupSetId}", + // "response": { + // "$ref": "ReadGroupSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.readgroupsets.import": + +type ReadgroupsetsImportCall struct { + s *Service + importreadgroupsetsrequest *ImportReadGroupSetsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Import: Creates read group sets by asynchronously importing the +// provided information. The caller must have WRITE permissions to the +// dataset. +// +// Notes on BAM import: +// - Tags will be converted to strings - tag types are not preserved +// - Comments (@CO) in the input file header are not imported +// - Original order of reference headers is not preserved +// - Any reverse stranded unmapped reads will be reverse complemented, +// and their qualities (and "BQ" tag, if any) will be reversed +// - Unmapped reads will be stripped of positional information +// (referenceName and position) +func (r *ReadgroupsetsService) Import(importreadgroupsetsrequest *ImportReadGroupSetsRequest) *ReadgroupsetsImportCall { + c := &ReadgroupsetsImportCall{s: r.s, opt_: make(map[string]interface{})} + c.importreadgroupsetsrequest = importreadgroupsetsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReadgroupsetsImportCall) Fields(s ...googleapi.Field) *ReadgroupsetsImportCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReadgroupsetsImportCall) Context(ctx context.Context) *ReadgroupsetsImportCall { + c.ctx_ = ctx + return c +} + +func (c *ReadgroupsetsImportCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.importreadgroupsetsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "readgroupsets/import") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.readgroupsets.import" call. +// Exactly one of *ImportReadGroupSetsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ImportReadGroupSetsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReadgroupsetsImportCall) Do() (*ImportReadGroupSetsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ImportReadGroupSetsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates read group sets by asynchronously importing the provided information. The caller must have WRITE permissions to the dataset.\n\nNotes on BAM import: \n- Tags will be converted to strings - tag types are not preserved\n- Comments (@CO) in the input file header are not imported\n- Original order of reference headers is not preserved\n- Any reverse stranded unmapped reads will be reverse complemented, and their qualities (and \"BQ\" tag, if any) will be reversed\n- Unmapped reads will be stripped of positional information (referenceName and position)", + // "httpMethod": "POST", + // "id": "genomics.readgroupsets.import", + // "path": "readgroupsets/import", + // "request": { + // "$ref": "ImportReadGroupSetsRequest" + // }, + // "response": { + // "$ref": "ImportReadGroupSetsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/devstorage.read_write", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.readgroupsets.patch": + +type ReadgroupsetsPatchCall struct { + s *Service + readGroupSetId string + readgroupset *ReadGroupSet + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates a read group set. This method supports patch +// semantics. +func (r *ReadgroupsetsService) Patch(readGroupSetId string, readgroupset *ReadGroupSet) *ReadgroupsetsPatchCall { + c := &ReadgroupsetsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.readGroupSetId = readGroupSetId + c.readgroupset = readgroupset + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReadgroupsetsPatchCall) Fields(s ...googleapi.Field) *ReadgroupsetsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReadgroupsetsPatchCall) Context(ctx context.Context) *ReadgroupsetsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ReadgroupsetsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.readgroupset) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "readgroupsets/{readGroupSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "readGroupSetId": c.readGroupSetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.readgroupsets.patch" call. +// Exactly one of *ReadGroupSet or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ReadGroupSet.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReadgroupsetsPatchCall) Do() (*ReadGroupSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ReadGroupSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a read group set. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "genomics.readgroupsets.patch", + // "parameterOrder": [ + // "readGroupSetId" + // ], + // "parameters": { + // "readGroupSetId": { + // "description": "The ID of the read group set to be updated. The caller must have WRITE permissions to the dataset associated with this read group set.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "readgroupsets/{readGroupSetId}", + // "request": { + // "$ref": "ReadGroupSet" + // }, + // "response": { + // "$ref": "ReadGroupSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.readgroupsets.search": + +type ReadgroupsetsSearchCall struct { + s *Service + searchreadgroupsetsrequest *SearchReadGroupSetsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Search: Searches for read group sets matching the +// criteria. +// +// Implements GlobalAllianceApi.searchReadGroupSets. +func (r *ReadgroupsetsService) Search(searchreadgroupsetsrequest *SearchReadGroupSetsRequest) *ReadgroupsetsSearchCall { + c := &ReadgroupsetsSearchCall{s: r.s, opt_: make(map[string]interface{})} + c.searchreadgroupsetsrequest = searchreadgroupsetsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReadgroupsetsSearchCall) Fields(s ...googleapi.Field) *ReadgroupsetsSearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReadgroupsetsSearchCall) Context(ctx context.Context) *ReadgroupsetsSearchCall { + c.ctx_ = ctx + return c +} + +func (c *ReadgroupsetsSearchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchreadgroupsetsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "readgroupsets/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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.readgroupsets.search" call. +// Exactly one of *SearchReadGroupSetsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *SearchReadGroupSetsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReadgroupsetsSearchCall) Do() (*SearchReadGroupSetsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SearchReadGroupSetsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Searches for read group sets matching the criteria.\n\nImplements GlobalAllianceApi.searchReadGroupSets.", + // "httpMethod": "POST", + // "id": "genomics.readgroupsets.search", + // "path": "readgroupsets/search", + // "request": { + // "$ref": "SearchReadGroupSetsRequest" + // }, + // "response": { + // "$ref": "SearchReadGroupSetsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.readgroupsets.update": + +type ReadgroupsetsUpdateCall struct { + s *Service + readGroupSetId string + readgroupset *ReadGroupSet + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a read group set. +func (r *ReadgroupsetsService) Update(readGroupSetId string, readgroupset *ReadGroupSet) *ReadgroupsetsUpdateCall { + c := &ReadgroupsetsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.readGroupSetId = readGroupSetId + c.readgroupset = readgroupset + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReadgroupsetsUpdateCall) Fields(s ...googleapi.Field) *ReadgroupsetsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReadgroupsetsUpdateCall) Context(ctx context.Context) *ReadgroupsetsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ReadgroupsetsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.readgroupset) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "readgroupsets/{readGroupSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "readGroupSetId": c.readGroupSetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.readgroupsets.update" call. +// Exactly one of *ReadGroupSet or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ReadGroupSet.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReadgroupsetsUpdateCall) Do() (*ReadGroupSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ReadGroupSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a read group set.", + // "httpMethod": "PUT", + // "id": "genomics.readgroupsets.update", + // "parameterOrder": [ + // "readGroupSetId" + // ], + // "parameters": { + // "readGroupSetId": { + // "description": "The ID of the read group set to be updated. The caller must have WRITE permissions to the dataset associated with this read group set.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "readgroupsets/{readGroupSetId}", + // "request": { + // "$ref": "ReadGroupSet" + // }, + // "response": { + // "$ref": "ReadGroupSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.readgroupsets.coveragebuckets.list": + +type ReadgroupsetsCoveragebucketsListCall struct { + s *Service + readGroupSetId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists fixed width coverage buckets for a read group set, each +// of which correspond to a range of a reference sequence. Each bucket +// summarizes coverage information across its corresponding genomic +// range. +// +// Coverage is defined as the number of reads which are aligned to a +// given base in the reference sequence. Coverage buckets are available +// at several precomputed bucket widths, enabling retrieval of various +// coverage 'zoom levels'. The caller must have READ permissions for the +// target read group set. +func (r *ReadgroupsetsCoveragebucketsService) List(readGroupSetId string) *ReadgroupsetsCoveragebucketsListCall { + c := &ReadgroupsetsCoveragebucketsListCall{s: r.s, opt_: make(map[string]interface{})} + c.readGroupSetId = readGroupSetId + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return in a single page. If unspecified, defaults to +// 1024. The maximum value is 2048. +func (c *ReadgroupsetsCoveragebucketsListCall) PageSize(pageSize int64) *ReadgroupsetsCoveragebucketsListCall { + c.opt_["pageSize"] = pageSize + 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 *ReadgroupsetsCoveragebucketsListCall) PageToken(pageToken string) *ReadgroupsetsCoveragebucketsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// RangeEnd sets the optional parameter "range.end": The end position of +// the range on the reference, 0-based exclusive. If specified, +// referenceName must also be specified. +func (c *ReadgroupsetsCoveragebucketsListCall) RangeEnd(rangeEnd int64) *ReadgroupsetsCoveragebucketsListCall { + c.opt_["range.end"] = rangeEnd + return c +} + +// RangeReferenceName sets the optional parameter "range.referenceName": +// The reference sequence name, for example chr1, 1, or chrX. +func (c *ReadgroupsetsCoveragebucketsListCall) RangeReferenceName(rangeReferenceName string) *ReadgroupsetsCoveragebucketsListCall { + c.opt_["range.referenceName"] = rangeReferenceName + return c +} + +// RangeStart sets the optional parameter "range.start": The start +// position of the range on the reference, 0-based inclusive. If +// specified, referenceName must also be specified. +func (c *ReadgroupsetsCoveragebucketsListCall) RangeStart(rangeStart int64) *ReadgroupsetsCoveragebucketsListCall { + c.opt_["range.start"] = rangeStart + return c +} + +// TargetBucketWidth sets the optional parameter "targetBucketWidth": +// The desired width of each reported coverage bucket in base pairs. +// This will be rounded down to the nearest precomputed bucket width; +// the value of which is returned as bucketWidth in the response. +// Defaults to infinity (each bucket spans an entire reference sequence) +// or the length of the target range, if specified. The smallest +// precomputed bucketWidth is currently 2048 base pairs; this is subject +// to change. +func (c *ReadgroupsetsCoveragebucketsListCall) TargetBucketWidth(targetBucketWidth int64) *ReadgroupsetsCoveragebucketsListCall { + c.opt_["targetBucketWidth"] = targetBucketWidth + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReadgroupsetsCoveragebucketsListCall) Fields(s ...googleapi.Field) *ReadgroupsetsCoveragebucketsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReadgroupsetsCoveragebucketsListCall) IfNoneMatch(entityTag string) *ReadgroupsetsCoveragebucketsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReadgroupsetsCoveragebucketsListCall) Context(ctx context.Context) *ReadgroupsetsCoveragebucketsListCall { + c.ctx_ = ctx + return c +} + +func (c *ReadgroupsetsCoveragebucketsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["range.end"]; ok { + params.Set("range.end", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["range.referenceName"]; ok { + params.Set("range.referenceName", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["range.start"]; ok { + params.Set("range.start", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["targetBucketWidth"]; ok { + params.Set("targetBucketWidth", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "readgroupsets/{readGroupSetId}/coveragebuckets") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "readGroupSetId": c.readGroupSetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.readgroupsets.coveragebuckets.list" call. +// Exactly one of *ListCoverageBucketsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListCoverageBucketsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReadgroupsetsCoveragebucketsListCall) Do() (*ListCoverageBucketsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListCoverageBucketsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists fixed width coverage buckets for a read group set, each of which correspond to a range of a reference sequence. Each bucket summarizes coverage information across its corresponding genomic range.\n\nCoverage is defined as the number of reads which are aligned to a given base in the reference sequence. Coverage buckets are available at several precomputed bucket widths, enabling retrieval of various coverage 'zoom levels'. The caller must have READ permissions for the target read group set.", + // "httpMethod": "GET", + // "id": "genomics.readgroupsets.coveragebuckets.list", + // "parameterOrder": [ + // "readGroupSetId" + // ], + // "parameters": { + // "pageSize": { + // "description": "The maximum number of results to return in a single page. If unspecified, defaults to 1024. The maximum value is 2048.", + // "format": "int32", + // "location": "query", + // "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" + // }, + // "range.end": { + // "description": "The end position of the range on the reference, 0-based exclusive. If specified, referenceName must also be specified.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "range.referenceName": { + // "description": "The reference sequence name, for example chr1, 1, or chrX.", + // "location": "query", + // "type": "string" + // }, + // "range.start": { + // "description": "The start position of the range on the reference, 0-based inclusive. If specified, referenceName must also be specified.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "readGroupSetId": { + // "description": "Required. The ID of the read group set over which coverage is requested.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "targetBucketWidth": { + // "description": "The desired width of each reported coverage bucket in base pairs. This will be rounded down to the nearest precomputed bucket width; the value of which is returned as bucketWidth in the response. Defaults to infinity (each bucket spans an entire reference sequence) or the length of the target range, if specified. The smallest precomputed bucketWidth is currently 2048 base pairs; this is subject to change.", + // "format": "int64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "readgroupsets/{readGroupSetId}/coveragebuckets", + // "response": { + // "$ref": "ListCoverageBucketsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.reads.search": + +type ReadsSearchCall struct { + s *Service + searchreadsrequest *SearchReadsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Search: Gets a list of reads for one or more read group sets. Reads +// search operates over a genomic coordinate space of reference sequence +// & position defined over the reference sequences to which the +// requested read group sets are aligned. +// +// If a target positional range is specified, search returns all reads +// whose alignment to the reference genome overlap the range. A query +// which specifies only read group set IDs yields all reads in those +// read group sets, including unmapped reads. +// +// All reads returned (including reads on subsequent pages) are ordered +// by genomic coordinate (reference sequence & position). Reads with +// equivalent genomic coordinates are returned in a deterministic +// order. +// +// Implements GlobalAllianceApi.searchReads. +func (r *ReadsService) Search(searchreadsrequest *SearchReadsRequest) *ReadsSearchCall { + c := &ReadsSearchCall{s: r.s, opt_: make(map[string]interface{})} + c.searchreadsrequest = searchreadsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReadsSearchCall) Fields(s ...googleapi.Field) *ReadsSearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReadsSearchCall) Context(ctx context.Context) *ReadsSearchCall { + c.ctx_ = ctx + return c +} + +func (c *ReadsSearchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchreadsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "reads/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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.reads.search" call. +// Exactly one of *SearchReadsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SearchReadsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReadsSearchCall) Do() (*SearchReadsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SearchReadsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a list of reads for one or more read group sets. Reads search operates over a genomic coordinate space of reference sequence \u0026 position defined over the reference sequences to which the requested read group sets are aligned.\n\nIf a target positional range is specified, search returns all reads whose alignment to the reference genome overlap the range. A query which specifies only read group set IDs yields all reads in those read group sets, including unmapped reads.\n\nAll reads returned (including reads on subsequent pages) are ordered by genomic coordinate (reference sequence \u0026 position). Reads with equivalent genomic coordinates are returned in a deterministic order.\n\nImplements GlobalAllianceApi.searchReads.", + // "httpMethod": "POST", + // "id": "genomics.reads.search", + // "path": "reads/search", + // "request": { + // "$ref": "SearchReadsRequest" + // }, + // "response": { + // "$ref": "SearchReadsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.references.get": + +type ReferencesGetCall struct { + s *Service + referenceId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a reference. +// +// Implements GlobalAllianceApi.getReference. +func (r *ReferencesService) Get(referenceId string) *ReferencesGetCall { + c := &ReferencesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.referenceId = referenceId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReferencesGetCall) Fields(s ...googleapi.Field) *ReferencesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReferencesGetCall) IfNoneMatch(entityTag string) *ReferencesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReferencesGetCall) Context(ctx context.Context) *ReferencesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ReferencesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "references/{referenceId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "referenceId": c.referenceId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.references.get" call. +// Exactly one of *Reference or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Reference.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReferencesGetCall) Do() (*Reference, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Reference{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a reference.\n\nImplements GlobalAllianceApi.getReference.", + // "httpMethod": "GET", + // "id": "genomics.references.get", + // "parameterOrder": [ + // "referenceId" + // ], + // "parameters": { + // "referenceId": { + // "description": "The ID of the reference.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "references/{referenceId}", + // "response": { + // "$ref": "Reference" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.references.search": + +type ReferencesSearchCall struct { + s *Service + searchreferencesrequest *SearchReferencesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Search: Searches for references which match the given +// criteria. +// +// Implements GlobalAllianceApi.searchReferences. +func (r *ReferencesService) Search(searchreferencesrequest *SearchReferencesRequest) *ReferencesSearchCall { + c := &ReferencesSearchCall{s: r.s, opt_: make(map[string]interface{})} + c.searchreferencesrequest = searchreferencesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReferencesSearchCall) Fields(s ...googleapi.Field) *ReferencesSearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReferencesSearchCall) Context(ctx context.Context) *ReferencesSearchCall { + c.ctx_ = ctx + return c +} + +func (c *ReferencesSearchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchreferencesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "references/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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.references.search" call. +// Exactly one of *SearchReferencesResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *SearchReferencesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReferencesSearchCall) Do() (*SearchReferencesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SearchReferencesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Searches for references which match the given criteria.\n\nImplements GlobalAllianceApi.searchReferences.", + // "httpMethod": "POST", + // "id": "genomics.references.search", + // "path": "references/search", + // "request": { + // "$ref": "SearchReferencesRequest" + // }, + // "response": { + // "$ref": "SearchReferencesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.references.bases.list": + +type ReferencesBasesListCall struct { + s *Service + referenceId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the bases in a reference, optionally restricted to a +// range. +// +// Implements GlobalAllianceApi.getReferenceBases. +func (r *ReferencesBasesService) List(referenceId string) *ReferencesBasesListCall { + c := &ReferencesBasesListCall{s: r.s, opt_: make(map[string]interface{})} + c.referenceId = referenceId + return c +} + +// End sets the optional parameter "end": The end position (0-based, +// exclusive) of this query. Defaults to the length of this reference. +func (c *ReferencesBasesListCall) End(end int64) *ReferencesBasesListCall { + c.opt_["end"] = end + return c +} + +// PageSize sets the optional parameter "pageSize": Specifies the +// maximum number of bases to return in a single page. +func (c *ReferencesBasesListCall) PageSize(pageSize int64) *ReferencesBasesListCall { + c.opt_["pageSize"] = pageSize + 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 *ReferencesBasesListCall) PageToken(pageToken string) *ReferencesBasesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Start sets the optional parameter "start": The start position +// (0-based) of this query. Defaults to 0. +func (c *ReferencesBasesListCall) Start(start int64) *ReferencesBasesListCall { + c.opt_["start"] = start + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReferencesBasesListCall) Fields(s ...googleapi.Field) *ReferencesBasesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReferencesBasesListCall) IfNoneMatch(entityTag string) *ReferencesBasesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReferencesBasesListCall) Context(ctx context.Context) *ReferencesBasesListCall { + c.ctx_ = ctx + return c +} + +func (c *ReferencesBasesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["end"]; ok { + params.Set("end", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["start"]; ok { + params.Set("start", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "references/{referenceId}/bases") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "referenceId": c.referenceId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.references.bases.list" call. +// Exactly one of *ListBasesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListBasesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReferencesBasesListCall) Do() (*ListBasesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListBasesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the bases in a reference, optionally restricted to a range.\n\nImplements GlobalAllianceApi.getReferenceBases.", + // "httpMethod": "GET", + // "id": "genomics.references.bases.list", + // "parameterOrder": [ + // "referenceId" + // ], + // "parameters": { + // "end": { + // "description": "The end position (0-based, exclusive) of this query. Defaults to the length of this reference.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "Specifies the maximum number of bases to return in a single page.", + // "format": "int32", + // "location": "query", + // "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" + // }, + // "referenceId": { + // "description": "The ID of the reference.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "start": { + // "description": "The start position (0-based) of this query. Defaults to 0.", + // "format": "int64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "references/{referenceId}/bases", + // "response": { + // "$ref": "ListBasesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.referencesets.get": + +type ReferencesetsGetCall struct { + s *Service + referenceSetId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a reference set. +// +// Implements GlobalAllianceApi.getReferenceSet. +func (r *ReferencesetsService) Get(referenceSetId string) *ReferencesetsGetCall { + c := &ReferencesetsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.referenceSetId = referenceSetId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReferencesetsGetCall) Fields(s ...googleapi.Field) *ReferencesetsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReferencesetsGetCall) IfNoneMatch(entityTag string) *ReferencesetsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReferencesetsGetCall) Context(ctx context.Context) *ReferencesetsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ReferencesetsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "referencesets/{referenceSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "referenceSetId": c.referenceSetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.referencesets.get" call. +// Exactly one of *ReferenceSet or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ReferenceSet.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ReferencesetsGetCall) Do() (*ReferenceSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ReferenceSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a reference set.\n\nImplements GlobalAllianceApi.getReferenceSet.", + // "httpMethod": "GET", + // "id": "genomics.referencesets.get", + // "parameterOrder": [ + // "referenceSetId" + // ], + // "parameters": { + // "referenceSetId": { + // "description": "The ID of the reference set.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "referencesets/{referenceSetId}", + // "response": { + // "$ref": "ReferenceSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.referencesets.search": + +type ReferencesetsSearchCall struct { + s *Service + searchreferencesetsrequest *SearchReferenceSetsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Search: Searches for reference sets which match the given +// criteria. +// +// Implements GlobalAllianceApi.searchReferenceSets. +func (r *ReferencesetsService) Search(searchreferencesetsrequest *SearchReferenceSetsRequest) *ReferencesetsSearchCall { + c := &ReferencesetsSearchCall{s: r.s, opt_: make(map[string]interface{})} + c.searchreferencesetsrequest = searchreferencesetsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReferencesetsSearchCall) Fields(s ...googleapi.Field) *ReferencesetsSearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReferencesetsSearchCall) Context(ctx context.Context) *ReferencesetsSearchCall { + c.ctx_ = ctx + return c +} + +func (c *ReferencesetsSearchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchreferencesetsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "referencesets/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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.referencesets.search" call. +// Exactly one of *SearchReferenceSetsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *SearchReferenceSetsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReferencesetsSearchCall) Do() (*SearchReferenceSetsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SearchReferenceSetsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Searches for reference sets which match the given criteria.\n\nImplements GlobalAllianceApi.searchReferenceSets.", + // "httpMethod": "POST", + // "id": "genomics.referencesets.search", + // "path": "referencesets/search", + // "request": { + // "$ref": "SearchReferenceSetsRequest" + // }, + // "response": { + // "$ref": "SearchReferenceSetsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.variants.create": + +type VariantsCreateCall struct { + s *Service + variant *Variant + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a new variant. +func (r *VariantsService) Create(variant *Variant) *VariantsCreateCall { + c := &VariantsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.variant = variant + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VariantsCreateCall) Fields(s ...googleapi.Field) *VariantsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VariantsCreateCall) Context(ctx context.Context) *VariantsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *VariantsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.variant) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "variants") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.variants.create" call. +// Exactly one of *Variant or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Variant.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *VariantsCreateCall) Do() (*Variant, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Variant{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new variant.", + // "httpMethod": "POST", + // "id": "genomics.variants.create", + // "path": "variants", + // "request": { + // "$ref": "Variant" + // }, + // "response": { + // "$ref": "Variant" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.variants.delete": + +type VariantsDeleteCall struct { + s *Service + variantId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a variant. +func (r *VariantsService) Delete(variantId string) *VariantsDeleteCall { + c := &VariantsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.variantId = variantId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VariantsDeleteCall) Fields(s ...googleapi.Field) *VariantsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VariantsDeleteCall) Context(ctx context.Context) *VariantsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *VariantsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "variants/{variantId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "variantId": c.variantId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.variants.delete" call. +func (c *VariantsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a variant.", + // "httpMethod": "DELETE", + // "id": "genomics.variants.delete", + // "parameterOrder": [ + // "variantId" + // ], + // "parameters": { + // "variantId": { + // "description": "The ID of the variant to be deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "variants/{variantId}", + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.variants.get": + +type VariantsGetCall struct { + s *Service + variantId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a variant by ID. +func (r *VariantsService) Get(variantId string) *VariantsGetCall { + c := &VariantsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.variantId = variantId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VariantsGetCall) Fields(s ...googleapi.Field) *VariantsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *VariantsGetCall) IfNoneMatch(entityTag string) *VariantsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VariantsGetCall) Context(ctx context.Context) *VariantsGetCall { + c.ctx_ = ctx + return c +} + +func (c *VariantsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "variants/{variantId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "variantId": c.variantId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.variants.get" call. +// Exactly one of *Variant or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Variant.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *VariantsGetCall) Do() (*Variant, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Variant{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a variant by ID.", + // "httpMethod": "GET", + // "id": "genomics.variants.get", + // "parameterOrder": [ + // "variantId" + // ], + // "parameters": { + // "variantId": { + // "description": "The ID of the variant.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "variants/{variantId}", + // "response": { + // "$ref": "Variant" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.variants.search": + +type VariantsSearchCall struct { + s *Service + searchvariantsrequest *SearchVariantsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Search: Gets a list of variants matching the criteria. +// +// Implements GlobalAllianceApi.searchVariants. +func (r *VariantsService) Search(searchvariantsrequest *SearchVariantsRequest) *VariantsSearchCall { + c := &VariantsSearchCall{s: r.s, opt_: make(map[string]interface{})} + c.searchvariantsrequest = searchvariantsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VariantsSearchCall) Fields(s ...googleapi.Field) *VariantsSearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VariantsSearchCall) Context(ctx context.Context) *VariantsSearchCall { + c.ctx_ = ctx + return c +} + +func (c *VariantsSearchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchvariantsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "variants/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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.variants.search" call. +// Exactly one of *SearchVariantsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SearchVariantsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *VariantsSearchCall) Do() (*SearchVariantsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SearchVariantsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a list of variants matching the criteria.\n\nImplements GlobalAllianceApi.searchVariants.", + // "httpMethod": "POST", + // "id": "genomics.variants.search", + // "path": "variants/search", + // "request": { + // "$ref": "SearchVariantsRequest" + // }, + // "response": { + // "$ref": "SearchVariantsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.variants.update": + +type VariantsUpdateCall struct { + s *Service + variantId string + variant *Variant + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a variant's names and info fields. All other +// modifications are silently ignored. Returns the modified variant +// without its calls. +func (r *VariantsService) Update(variantId string, variant *Variant) *VariantsUpdateCall { + c := &VariantsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.variantId = variantId + c.variant = variant + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VariantsUpdateCall) Fields(s ...googleapi.Field) *VariantsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VariantsUpdateCall) Context(ctx context.Context) *VariantsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *VariantsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.variant) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "variants/{variantId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "variantId": c.variantId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.variants.update" call. +// Exactly one of *Variant or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Variant.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *VariantsUpdateCall) Do() (*Variant, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Variant{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a variant's names and info fields. All other modifications are silently ignored. Returns the modified variant without its calls.", + // "httpMethod": "PUT", + // "id": "genomics.variants.update", + // "parameterOrder": [ + // "variantId" + // ], + // "parameters": { + // "variantId": { + // "description": "The ID of the variant to be updated.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "variants/{variantId}", + // "request": { + // "$ref": "Variant" + // }, + // "response": { + // "$ref": "Variant" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.variantsets.create": + +type VariantsetsCreateCall struct { + s *Service + variantset *VariantSet + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a new variant set (only necessary in v1). +// +// The provided variant set must have a valid datasetId set - all other +// fields are optional. Note that the id field will be ignored, as this +// is assigned by the server. +func (r *VariantsetsService) Create(variantset *VariantSet) *VariantsetsCreateCall { + c := &VariantsetsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.variantset = variantset + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VariantsetsCreateCall) Fields(s ...googleapi.Field) *VariantsetsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VariantsetsCreateCall) Context(ctx context.Context) *VariantsetsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *VariantsetsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.variantset) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "variantsets") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.variantsets.create" call. +// Exactly one of *VariantSet or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *VariantSet.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *VariantsetsCreateCall) Do() (*VariantSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &VariantSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new variant set (only necessary in v1).\n\nThe provided variant set must have a valid datasetId set - all other fields are optional. Note that the id field will be ignored, as this is assigned by the server.", + // "httpMethod": "POST", + // "id": "genomics.variantsets.create", + // "path": "variantsets", + // "request": { + // "$ref": "VariantSet" + // }, + // "response": { + // "$ref": "VariantSet" + // } + // } + +} + +// method id "genomics.variantsets.delete": + +type VariantsetsDeleteCall struct { + s *Service + variantSetId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the contents of a variant set. The variant set object +// is not deleted. +func (r *VariantsetsService) Delete(variantSetId string) *VariantsetsDeleteCall { + c := &VariantsetsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.variantSetId = variantSetId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VariantsetsDeleteCall) Fields(s ...googleapi.Field) *VariantsetsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VariantsetsDeleteCall) Context(ctx context.Context) *VariantsetsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *VariantsetsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "variantsets/{variantSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "variantSetId": c.variantSetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.variantsets.delete" call. +func (c *VariantsetsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the contents of a variant set. The variant set object is not deleted.", + // "httpMethod": "DELETE", + // "id": "genomics.variantsets.delete", + // "parameterOrder": [ + // "variantSetId" + // ], + // "parameters": { + // "variantSetId": { + // "description": "The ID of the variant set to be deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "variantsets/{variantSetId}", + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.variantsets.export": + +type VariantsetsExportCall struct { + s *Service + variantSetId string + exportvariantsetrequest *ExportVariantSetRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Export: Exports variant set data to an external destination. +func (r *VariantsetsService) Export(variantSetId string, exportvariantsetrequest *ExportVariantSetRequest) *VariantsetsExportCall { + c := &VariantsetsExportCall{s: r.s, opt_: make(map[string]interface{})} + c.variantSetId = variantSetId + c.exportvariantsetrequest = exportvariantsetrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VariantsetsExportCall) Fields(s ...googleapi.Field) *VariantsetsExportCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VariantsetsExportCall) Context(ctx context.Context) *VariantsetsExportCall { + c.ctx_ = ctx + return c +} + +func (c *VariantsetsExportCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportvariantsetrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "variantsets/{variantSetId}/export") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "variantSetId": c.variantSetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.variantsets.export" call. +// Exactly one of *ExportVariantSetResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ExportVariantSetResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *VariantsetsExportCall) Do() (*ExportVariantSetResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ExportVariantSetResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Exports variant set data to an external destination.", + // "httpMethod": "POST", + // "id": "genomics.variantsets.export", + // "parameterOrder": [ + // "variantSetId" + // ], + // "parameters": { + // "variantSetId": { + // "description": "Required. The ID of the variant set that contains variant data which should be exported. The caller must have READ access to this variant set.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "variantsets/{variantSetId}/export", + // "request": { + // "$ref": "ExportVariantSetRequest" + // }, + // "response": { + // "$ref": "ExportVariantSetResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/bigquery", + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.variantsets.get": + +type VariantsetsGetCall struct { + s *Service + variantSetId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a variant set by ID. +func (r *VariantsetsService) Get(variantSetId string) *VariantsetsGetCall { + c := &VariantsetsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.variantSetId = variantSetId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VariantsetsGetCall) Fields(s ...googleapi.Field) *VariantsetsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *VariantsetsGetCall) IfNoneMatch(entityTag string) *VariantsetsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VariantsetsGetCall) Context(ctx context.Context) *VariantsetsGetCall { + c.ctx_ = ctx + return c +} + +func (c *VariantsetsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "variantsets/{variantSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "variantSetId": c.variantSetId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.variantsets.get" call. +// Exactly one of *VariantSet or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *VariantSet.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *VariantsetsGetCall) Do() (*VariantSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &VariantSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a variant set by ID.", + // "httpMethod": "GET", + // "id": "genomics.variantsets.get", + // "parameterOrder": [ + // "variantSetId" + // ], + // "parameters": { + // "variantSetId": { + // "description": "Required. The ID of the variant set.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "variantsets/{variantSetId}", + // "response": { + // "$ref": "VariantSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.variantsets.importVariants": + +type VariantsetsImportVariantsCall struct { + s *Service + variantSetId string + importvariantsrequest *ImportVariantsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// ImportVariants: Creates variant data by asynchronously importing the +// provided information. +// +// The variants for import will be merged with any existing data and +// each other according to the behavior of mergeVariants. In particular, +// this means for merged VCF variants that have conflicting INFO fields, +// some data will be arbitrarily discarded. As a special case, for +// single-sample VCF files, QUAL and FILTER fields will be moved to the +// call level; these are sometimes interpreted in a call-specific +// context. Imported VCF headers are appended to the metadata already in +// a variant set. +func (r *VariantsetsService) ImportVariants(variantSetId string, importvariantsrequest *ImportVariantsRequest) *VariantsetsImportVariantsCall { + c := &VariantsetsImportVariantsCall{s: r.s, opt_: make(map[string]interface{})} + c.variantSetId = variantSetId + c.importvariantsrequest = importvariantsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VariantsetsImportVariantsCall) Fields(s ...googleapi.Field) *VariantsetsImportVariantsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VariantsetsImportVariantsCall) Context(ctx context.Context) *VariantsetsImportVariantsCall { + c.ctx_ = ctx + return c +} + +func (c *VariantsetsImportVariantsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.importvariantsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "variantsets/{variantSetId}/importVariants") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "variantSetId": c.variantSetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.variantsets.importVariants" call. +// Exactly one of *ImportVariantsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ImportVariantsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *VariantsetsImportVariantsCall) Do() (*ImportVariantsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ImportVariantsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates variant data by asynchronously importing the provided information.\n\nThe variants for import will be merged with any existing data and each other according to the behavior of mergeVariants. In particular, this means for merged VCF variants that have conflicting INFO fields, some data will be arbitrarily discarded. As a special case, for single-sample VCF files, QUAL and FILTER fields will be moved to the call level; these are sometimes interpreted in a call-specific context. Imported VCF headers are appended to the metadata already in a variant set.", + // "httpMethod": "POST", + // "id": "genomics.variantsets.importVariants", + // "parameterOrder": [ + // "variantSetId" + // ], + // "parameters": { + // "variantSetId": { + // "description": "Required. The variant set to which variant data should be imported.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "variantsets/{variantSetId}/importVariants", + // "request": { + // "$ref": "ImportVariantsRequest" + // }, + // "response": { + // "$ref": "ImportVariantsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/devstorage.read_write", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.variantsets.mergeVariants": + +type VariantsetsMergeVariantsCall struct { + s *Service + variantSetId string + mergevariantsrequest *MergeVariantsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// MergeVariants: Merges the given variants with existing variants. Each +// variant will be merged with an existing variant that matches its +// reference sequence, start, end, reference bases, and alternative +// bases. If no such variant exists, a new one will be created. +// +// When variants are merged, the call information from the new variant +// is added to the existing variant, and other fields (such as key/value +// pairs) are discarded. +func (r *VariantsetsService) MergeVariants(variantSetId string, mergevariantsrequest *MergeVariantsRequest) *VariantsetsMergeVariantsCall { + c := &VariantsetsMergeVariantsCall{s: r.s, opt_: make(map[string]interface{})} + c.variantSetId = variantSetId + c.mergevariantsrequest = mergevariantsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VariantsetsMergeVariantsCall) Fields(s ...googleapi.Field) *VariantsetsMergeVariantsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VariantsetsMergeVariantsCall) Context(ctx context.Context) *VariantsetsMergeVariantsCall { + c.ctx_ = ctx + return c +} + +func (c *VariantsetsMergeVariantsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.mergevariantsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "variantsets/{variantSetId}/mergeVariants") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "variantSetId": c.variantSetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.variantsets.mergeVariants" call. +func (c *VariantsetsMergeVariantsCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Merges the given variants with existing variants. Each variant will be merged with an existing variant that matches its reference sequence, start, end, reference bases, and alternative bases. If no such variant exists, a new one will be created.\n\nWhen variants are merged, the call information from the new variant is added to the existing variant, and other fields (such as key/value pairs) are discarded.", + // "httpMethod": "POST", + // "id": "genomics.variantsets.mergeVariants", + // "parameterOrder": [ + // "variantSetId" + // ], + // "parameters": { + // "variantSetId": { + // "description": "The destination variant set.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "variantsets/{variantSetId}/mergeVariants", + // "request": { + // "$ref": "MergeVariantsRequest" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.variantsets.patch": + +type VariantsetsPatchCall struct { + s *Service + variantSetId string + variantset *VariantSet + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates a variant set's metadata. All other modifications are +// silently ignored. This method supports patch semantics. +func (r *VariantsetsService) Patch(variantSetId string, variantset *VariantSet) *VariantsetsPatchCall { + c := &VariantsetsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.variantSetId = variantSetId + c.variantset = variantset + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VariantsetsPatchCall) Fields(s ...googleapi.Field) *VariantsetsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VariantsetsPatchCall) Context(ctx context.Context) *VariantsetsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *VariantsetsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.variantset) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "variantsets/{variantSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "variantSetId": c.variantSetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.variantsets.patch" call. +// Exactly one of *VariantSet or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *VariantSet.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *VariantsetsPatchCall) Do() (*VariantSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &VariantSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a variant set's metadata. All other modifications are silently ignored. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "genomics.variantsets.patch", + // "parameterOrder": [ + // "variantSetId" + // ], + // "parameters": { + // "variantSetId": { + // "description": "The ID of the variant to be updated (must already exist).", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "variantsets/{variantSetId}", + // "request": { + // "$ref": "VariantSet" + // }, + // "response": { + // "$ref": "VariantSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} + +// method id "genomics.variantsets.search": + +type VariantsetsSearchCall struct { + s *Service + searchvariantsetsrequest *SearchVariantSetsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Search: Returns a list of all variant sets matching search +// criteria. +// +// Implements GlobalAllianceApi.searchVariantSets. +func (r *VariantsetsService) Search(searchvariantsetsrequest *SearchVariantSetsRequest) *VariantsetsSearchCall { + c := &VariantsetsSearchCall{s: r.s, opt_: make(map[string]interface{})} + c.searchvariantsetsrequest = searchvariantsetsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VariantsetsSearchCall) Fields(s ...googleapi.Field) *VariantsetsSearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VariantsetsSearchCall) Context(ctx context.Context) *VariantsetsSearchCall { + c.ctx_ = ctx + return c +} + +func (c *VariantsetsSearchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchvariantsetsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "variantsets/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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.variantsets.search" call. +// Exactly one of *SearchVariantSetsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *SearchVariantSetsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *VariantsetsSearchCall) Do() (*SearchVariantSetsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SearchVariantSetsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a list of all variant sets matching search criteria.\n\nImplements GlobalAllianceApi.searchVariantSets.", + // "httpMethod": "POST", + // "id": "genomics.variantsets.search", + // "path": "variantsets/search", + // "request": { + // "$ref": "SearchVariantSetsRequest" + // }, + // "response": { + // "$ref": "SearchVariantSetsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics", + // "https://www.googleapis.com/auth/genomics.readonly" + // ] + // } + +} + +// method id "genomics.variantsets.update": + +type VariantsetsUpdateCall struct { + s *Service + variantSetId string + variantset *VariantSet + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a variant set's metadata. All other modifications are +// silently ignored. +func (r *VariantsetsService) Update(variantSetId string, variantset *VariantSet) *VariantsetsUpdateCall { + c := &VariantsetsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.variantSetId = variantSetId + c.variantset = variantset + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *VariantsetsUpdateCall) Fields(s ...googleapi.Field) *VariantsetsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *VariantsetsUpdateCall) Context(ctx context.Context) *VariantsetsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *VariantsetsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.variantset) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "variantsets/{variantSetId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "variantSetId": c.variantSetId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "genomics.variantsets.update" call. +// Exactly one of *VariantSet or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *VariantSet.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *VariantsetsUpdateCall) Do() (*VariantSet, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &VariantSet{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a variant set's metadata. All other modifications are silently ignored.", + // "httpMethod": "PUT", + // "id": "genomics.variantsets.update", + // "parameterOrder": [ + // "variantSetId" + // ], + // "parameters": { + // "variantSetId": { + // "description": "The ID of the variant to be updated (must already exist).", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "variantsets/{variantSetId}", + // "request": { + // "$ref": "VariantSet" + // }, + // "response": { + // "$ref": "VariantSet" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/genomics" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/gmail/v1/gmail-api.json b/Godeps/_workspace/src/google.golang.org/api/gmail/v1/gmail-api.json new file mode 100644 index 000000000..34d57f8e5 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/gmail/v1/gmail-api.json @@ -0,0 +1,2009 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/hPQpcOx1jxdLJJoNmiYxoTv2oFc\"", + "discoveryVersion": "v1", + "id": "gmail:v1", + "name": "gmail", + "version": "v1", + "revision": "20150805", + "title": "Gmail API", + "description": "The Gmail REST API.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/googlemail-16.png", + "x32": "https://www.google.com/images/icons/product/googlemail-32.png" + }, + "documentationLink": "https://developers.google.com/gmail/api/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/gmail/v1/users/", + "basePath": "/gmail/v1/users/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "gmail/v1/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://mail.google.com/": { + "description": "View and manage your mail" + }, + "https://www.googleapis.com/auth/gmail.compose": { + "description": "Manage drafts and send emails" + }, + "https://www.googleapis.com/auth/gmail.insert": { + "description": "Insert mail into your mailbox" + }, + "https://www.googleapis.com/auth/gmail.labels": { + "description": "Manage mailbox labels" + }, + "https://www.googleapis.com/auth/gmail.modify": { + "description": "View and modify but not delete your email" + }, + "https://www.googleapis.com/auth/gmail.readonly": { + "description": "View your emails messages and settings" + }, + "https://www.googleapis.com/auth/gmail.send": { + "description": "Send email on your behalf" + } + } + } + }, + "schemas": { + "Draft": { + "id": "Draft", + "type": "object", + "description": "A draft email in the user's mailbox.", + "properties": { + "id": { + "type": "string", + "description": "The immutable ID of the draft.", + "annotations": { + "required": [ + "gmail.users.drafts.send" + ] + } + }, + "message": { + "$ref": "Message", + "description": "The message content of the draft." + } + } + }, + "History": { + "id": "History", + "type": "object", + "description": "A record of a change to the user's mailbox. Each history change may affect multiple messages in multiple ways.", + "properties": { + "id": { + "type": "string", + "description": "The mailbox sequence ID.", + "format": "uint64" + }, + "labelsAdded": { + "type": "array", + "description": "Labels added to messages in this history record.", + "items": { + "$ref": "HistoryLabelAdded" + } + }, + "labelsRemoved": { + "type": "array", + "description": "Labels removed from messages in this history record.", + "items": { + "$ref": "HistoryLabelRemoved" + } + }, + "messages": { + "type": "array", + "description": "List of messages changed in this history record. The fields for specific change types, such as messagesAdded may duplicate messages in this field. We recommend using the specific change-type fields instead of this.", + "items": { + "$ref": "Message" + } + }, + "messagesAdded": { + "type": "array", + "description": "Messages added to the mailbox in this history record.", + "items": { + "$ref": "HistoryMessageAdded" + } + }, + "messagesDeleted": { + "type": "array", + "description": "Messages deleted (not Trashed) from the mailbox in this history record.", + "items": { + "$ref": "HistoryMessageDeleted" + } + } + } + }, + "HistoryLabelAdded": { + "id": "HistoryLabelAdded", + "type": "object", + "properties": { + "labelIds": { + "type": "array", + "description": "Label IDs added to the message.", + "items": { + "type": "string" + } + }, + "message": { + "$ref": "Message" + } + } + }, + "HistoryLabelRemoved": { + "id": "HistoryLabelRemoved", + "type": "object", + "properties": { + "labelIds": { + "type": "array", + "description": "Label IDs removed from the message.", + "items": { + "type": "string" + } + }, + "message": { + "$ref": "Message" + } + } + }, + "HistoryMessageAdded": { + "id": "HistoryMessageAdded", + "type": "object", + "properties": { + "message": { + "$ref": "Message" + } + } + }, + "HistoryMessageDeleted": { + "id": "HistoryMessageDeleted", + "type": "object", + "properties": { + "message": { + "$ref": "Message" + } + } + }, + "Label": { + "id": "Label", + "type": "object", + "description": "Labels are used to categorize messages and threads within the user's mailbox.", + "properties": { + "id": { + "type": "string", + "description": "The immutable ID of the label.", + "annotations": { + "required": [ + "gmail.users.labels.update" + ] + } + }, + "labelListVisibility": { + "type": "string", + "description": "The visibility of the label in the label list in the Gmail web interface.", + "enum": [ + "labelHide", + "labelShow", + "labelShowIfUnread" + ], + "enumDescriptions": [ + "", + "", + "" + ], + "annotations": { + "required": [ + "gmail.users.labels.create", + "gmail.users.labels.update" + ] + } + }, + "messageListVisibility": { + "type": "string", + "description": "The visibility of the label in the message list in the Gmail web interface.", + "enum": [ + "hide", + "show" + ], + "enumDescriptions": [ + "", + "" + ], + "annotations": { + "required": [ + "gmail.users.labels.create", + "gmail.users.labels.update" + ] + } + }, + "messagesTotal": { + "type": "integer", + "description": "The total number of messages with the label.", + "format": "int32" + }, + "messagesUnread": { + "type": "integer", + "description": "The number of unread messages with the label.", + "format": "int32" + }, + "name": { + "type": "string", + "description": "The display name of the label.", + "annotations": { + "required": [ + "gmail.users.labels.create", + "gmail.users.labels.update" + ] + } + }, + "threadsTotal": { + "type": "integer", + "description": "The total number of threads with the label.", + "format": "int32" + }, + "threadsUnread": { + "type": "integer", + "description": "The number of unread threads with the label.", + "format": "int32" + }, + "type": { + "type": "string", + "description": "The owner type for the label. User labels are created by the user and can be modified and deleted by the user and can be applied to any message or thread. System labels are internally created and cannot be added, modified, or deleted. System labels may be able to be applied to or removed from messages and threads under some circumstances but this is not guaranteed. For example, users can apply and remove the INBOX and UNREAD labels from messages and threads, but cannot apply or remove the DRAFTS or SENT labels from messages or threads.", + "enum": [ + "system", + "user" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "ListDraftsResponse": { + "id": "ListDraftsResponse", + "type": "object", + "properties": { + "drafts": { + "type": "array", + "description": "List of drafts.", + "items": { + "$ref": "Draft" + } + }, + "nextPageToken": { + "type": "string", + "description": "Token to retrieve the next page of results in the list." + }, + "resultSizeEstimate": { + "type": "integer", + "description": "Estimated total number of results.", + "format": "uint32" + } + } + }, + "ListHistoryResponse": { + "id": "ListHistoryResponse", + "type": "object", + "properties": { + "history": { + "type": "array", + "description": "List of history records. Any messages contained in the response will typically only have id and threadId fields populated.", + "items": { + "$ref": "History" + } + }, + "historyId": { + "type": "string", + "description": "The ID of the mailbox's current history record.", + "format": "uint64" + }, + "nextPageToken": { + "type": "string", + "description": "Page token to retrieve the next page of results in the list." + } + } + }, + "ListLabelsResponse": { + "id": "ListLabelsResponse", + "type": "object", + "properties": { + "labels": { + "type": "array", + "description": "List of labels.", + "items": { + "$ref": "Label" + } + } + } + }, + "ListMessagesResponse": { + "id": "ListMessagesResponse", + "type": "object", + "properties": { + "messages": { + "type": "array", + "description": "List of messages.", + "items": { + "$ref": "Message" + } + }, + "nextPageToken": { + "type": "string", + "description": "Token to retrieve the next page of results in the list." + }, + "resultSizeEstimate": { + "type": "integer", + "description": "Estimated total number of results.", + "format": "uint32" + } + } + }, + "ListThreadsResponse": { + "id": "ListThreadsResponse", + "type": "object", + "properties": { + "nextPageToken": { + "type": "string", + "description": "Page token to retrieve the next page of results in the list." + }, + "resultSizeEstimate": { + "type": "integer", + "description": "Estimated total number of results.", + "format": "uint32" + }, + "threads": { + "type": "array", + "description": "List of threads.", + "items": { + "$ref": "Thread" + } + } + } + }, + "Message": { + "id": "Message", + "type": "object", + "description": "An email message.", + "properties": { + "historyId": { + "type": "string", + "description": "The ID of the last history record that modified this message.", + "format": "uint64" + }, + "id": { + "type": "string", + "description": "The immutable ID of the message." + }, + "internalDate": { + "type": "string", + "description": "The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header.", + "format": "int64" + }, + "labelIds": { + "type": "array", + "description": "List of IDs of labels applied to this message.", + "items": { + "type": "string" + } + }, + "payload": { + "$ref": "MessagePart", + "description": "The parsed email structure in the message parts." + }, + "raw": { + "type": "string", + "description": "The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied.", + "format": "byte", + "annotations": { + "required": [ + "gmail.users.drafts.create", + "gmail.users.drafts.update", + "gmail.users.messages.insert", + "gmail.users.messages.send" + ] + } + }, + "sizeEstimate": { + "type": "integer", + "description": "Estimated size in bytes of the message.", + "format": "int32" + }, + "snippet": { + "type": "string", + "description": "A short part of the message text." + }, + "threadId": { + "type": "string", + "description": "The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met: \n- The requested threadId must be specified on the Message or Draft.Message you supply with your request. \n- The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. \n- The Subject headers must match." + } + } + }, + "MessagePart": { + "id": "MessagePart", + "type": "object", + "description": "A single MIME message part.", + "properties": { + "body": { + "$ref": "MessagePartBody", + "description": "The message part body for this part, which may be empty for container MIME message parts." + }, + "filename": { + "type": "string", + "description": "The filename of the attachment. Only present if this message part represents an attachment." + }, + "headers": { + "type": "array", + "description": "List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject.", + "items": { + "$ref": "MessagePartHeader" + } + }, + "mimeType": { + "type": "string", + "description": "The MIME type of the message part." + }, + "partId": { + "type": "string", + "description": "The immutable ID of the message part." + }, + "parts": { + "type": "array", + "description": "The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521.", + "items": { + "$ref": "MessagePart" + } + } + } + }, + "MessagePartBody": { + "id": "MessagePartBody", + "type": "object", + "description": "The body of a single MIME message part.", + "properties": { + "attachmentId": { + "type": "string", + "description": "When present, contains the ID of an external attachment that can be retrieved in a separate messages.attachments.get request. When not present, the entire content of the message part body is contained in the data field." + }, + "data": { + "type": "string", + "description": "The body data of a MIME message part. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment.", + "format": "byte" + }, + "size": { + "type": "integer", + "description": "Total number of bytes in the body of the message part.", + "format": "int32" + } + } + }, + "MessagePartHeader": { + "id": "MessagePartHeader", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the header before the : separator. For example, To." + }, + "value": { + "type": "string", + "description": "The value of the header after the : separator. For example, someuser@example.com." + } + } + }, + "ModifyMessageRequest": { + "id": "ModifyMessageRequest", + "type": "object", + "properties": { + "addLabelIds": { + "type": "array", + "description": "A list of IDs of labels to add to this message.", + "items": { + "type": "string" + } + }, + "removeLabelIds": { + "type": "array", + "description": "A list IDs of labels to remove from this message.", + "items": { + "type": "string" + } + } + } + }, + "ModifyThreadRequest": { + "id": "ModifyThreadRequest", + "type": "object", + "properties": { + "addLabelIds": { + "type": "array", + "description": "A list of IDs of labels to add to this thread.", + "items": { + "type": "string" + } + }, + "removeLabelIds": { + "type": "array", + "description": "A list of IDs of labels to remove from this thread.", + "items": { + "type": "string" + } + } + } + }, + "Profile": { + "id": "Profile", + "type": "object", + "description": "Profile for a Gmail user.", + "properties": { + "emailAddress": { + "type": "string", + "description": "The user's email address." + }, + "historyId": { + "type": "string", + "description": "The ID of the mailbox's current history record.", + "format": "uint64" + }, + "messagesTotal": { + "type": "integer", + "description": "The total number of messages in the mailbox.", + "format": "int32" + }, + "threadsTotal": { + "type": "integer", + "description": "The total number of threads in the mailbox.", + "format": "int32" + } + } + }, + "Thread": { + "id": "Thread", + "type": "object", + "description": "A collection of messages representing a conversation.", + "properties": { + "historyId": { + "type": "string", + "description": "The ID of the last history record that modified this thread.", + "format": "uint64" + }, + "id": { + "type": "string", + "description": "The unique ID of the thread." + }, + "messages": { + "type": "array", + "description": "The list of messages in the thread.", + "items": { + "$ref": "Message" + } + }, + "snippet": { + "type": "string", + "description": "A short part of the message text." + } + } + }, + "WatchRequest": { + "id": "WatchRequest", + "type": "object", + "description": "Set up or update a new push notification watch on this user's mailbox.", + "properties": { + "labelFilterAction": { + "type": "string", + "description": "Filtering behavior of labelIds list specified.", + "enum": [ + "exclude", + "include" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "labelIds": { + "type": "array", + "description": "List of label_ids to restrict notifications about. By default, if unspecified, all changes are pushed out. If specified then dictates which labels are required for a push notification to be generated.", + "items": { + "type": "string" + } + }, + "topicName": { + "type": "string", + "description": "A fully qualified Google Cloud Pub/Sub API topic name to publish the events to. This topic name **must** already exist in Cloud Pub/Sub and you **must** have already granted gmail \"publish\" permission on it. For example, \"projects/my-project-identifier/topics/my-topic-name\" (using the new Cloud Pub/Sub \"v1beta2\" topic naming format).\n\nNote that the \"my-project-identifier\" portion must exactly match your Google developer project id (the one executing this watch request)." + } + } + }, + "WatchResponse": { + "id": "WatchResponse", + "type": "object", + "description": "Push notification watch response.", + "properties": { + "expiration": { + "type": "string", + "description": "When Gmail will stop sending notifications for mailbox updates (epoch millis). Call watch again before this time to renew the watch.", + "format": "int64" + }, + "historyId": { + "type": "string", + "description": "The ID of the mailbox's current history record.", + "format": "uint64" + } + } + } + }, + "resources": { + "users": { + "methods": { + "getProfile": { + "id": "gmail.users.getProfile", + "path": "{userId}/profile", + "httpMethod": "GET", + "description": "Gets the current user's Gmail profile.", + "parameters": { + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "Profile" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.compose", + "https://www.googleapis.com/auth/gmail.modify", + "https://www.googleapis.com/auth/gmail.readonly" + ] + }, + "stop": { + "id": "gmail.users.stop", + "path": "{userId}/stop", + "httpMethod": "POST", + "description": "Stop receiving push notifications for the given user mailbox.", + "parameters": { + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.modify", + "https://www.googleapis.com/auth/gmail.readonly" + ] + }, + "watch": { + "id": "gmail.users.watch", + "path": "{userId}/watch", + "httpMethod": "POST", + "description": "Set up or update a push notification watch on the given user mailbox.", + "parameters": { + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "request": { + "$ref": "WatchRequest" + }, + "response": { + "$ref": "WatchResponse" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.modify", + "https://www.googleapis.com/auth/gmail.readonly" + ] + } + }, + "resources": { + "drafts": { + "methods": { + "create": { + "id": "gmail.users.drafts.create", + "path": "{userId}/drafts", + "httpMethod": "POST", + "description": "Creates a new draft with the DRAFT label.", + "parameters": { + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "request": { + "$ref": "Draft" + }, + "response": { + "$ref": "Draft" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.compose", + "https://www.googleapis.com/auth/gmail.modify" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "message/rfc822" + ], + "maxSize": "35MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/gmail/v1/users/{userId}/drafts" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/gmail/v1/users/{userId}/drafts" + } + } + } + }, + "delete": { + "id": "gmail.users.drafts.delete", + "path": "{userId}/drafts/{id}", + "httpMethod": "DELETE", + "description": "Immediately and permanently deletes the specified draft. Does not simply trash it.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the draft to delete.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "id" + ], + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.compose", + "https://www.googleapis.com/auth/gmail.modify" + ] + }, + "get": { + "id": "gmail.users.drafts.get", + "path": "{userId}/drafts/{id}", + "httpMethod": "GET", + "description": "Gets the specified draft.", + "parameters": { + "format": { + "type": "string", + "description": "The format to return the draft in.", + "default": "full", + "enum": [ + "full", + "metadata", + "minimal", + "raw" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ], + "location": "query" + }, + "id": { + "type": "string", + "description": "The ID of the draft to retrieve.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "id" + ], + "response": { + "$ref": "Draft" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.compose", + "https://www.googleapis.com/auth/gmail.modify", + "https://www.googleapis.com/auth/gmail.readonly" + ] + }, + "list": { + "id": "gmail.users.drafts.list", + "path": "{userId}/drafts", + "httpMethod": "GET", + "description": "Lists the drafts in the user's mailbox.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of drafts to return.", + "default": "100", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Page token to retrieve a specific page of results in the list.", + "location": "query" + }, + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "ListDraftsResponse" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.compose", + "https://www.googleapis.com/auth/gmail.modify", + "https://www.googleapis.com/auth/gmail.readonly" + ] + }, + "send": { + "id": "gmail.users.drafts.send", + "path": "{userId}/drafts/send", + "httpMethod": "POST", + "description": "Sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers.", + "parameters": { + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "request": { + "$ref": "Draft" + }, + "response": { + "$ref": "Message" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.compose", + "https://www.googleapis.com/auth/gmail.modify" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "message/rfc822" + ], + "maxSize": "35MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/gmail/v1/users/{userId}/drafts/send" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/gmail/v1/users/{userId}/drafts/send" + } + } + } + }, + "update": { + "id": "gmail.users.drafts.update", + "path": "{userId}/drafts/{id}", + "httpMethod": "PUT", + "description": "Replaces a draft's content.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the draft to update.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "id" + ], + "request": { + "$ref": "Draft" + }, + "response": { + "$ref": "Draft" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.compose", + "https://www.googleapis.com/auth/gmail.modify" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "message/rfc822" + ], + "maxSize": "35MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/gmail/v1/users/{userId}/drafts/{id}" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/gmail/v1/users/{userId}/drafts/{id}" + } + } + } + } + } + }, + "history": { + "methods": { + "list": { + "id": "gmail.users.history.list", + "path": "{userId}/history", + "httpMethod": "GET", + "description": "Lists the history of all changes to the given mailbox. History results are returned in chronological order (increasing historyId).", + "parameters": { + "labelId": { + "type": "string", + "description": "Only return messages with a label matching the ID.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maximum number of history records to return.", + "default": "100", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Page token to retrieve a specific page of results in the list.", + "location": "query" + }, + "startHistoryId": { + "type": "string", + "description": "Required. Returns history records after the specified startHistoryId. The supplied startHistoryId should be obtained from the historyId of a message, thread, or previous list response. History IDs increase chronologically but are not contiguous with random gaps in between valid IDs. Supplying an invalid or out of date startHistoryId typically returns an HTTP 404 error code. A historyId is typically valid for at least a week, but in some rare circumstances may be valid for only a few hours. If you receive an HTTP 404 error response, your application should perform a full sync. If you receive no nextPageToken in the response, there are no updates to retrieve and you can store the returned historyId for a future request.", + "format": "uint64", + "location": "query" + }, + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "ListHistoryResponse" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.modify", + "https://www.googleapis.com/auth/gmail.readonly" + ] + } + } + }, + "labels": { + "methods": { + "create": { + "id": "gmail.users.labels.create", + "path": "{userId}/labels", + "httpMethod": "POST", + "description": "Creates a new label.", + "parameters": { + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "request": { + "$ref": "Label" + }, + "response": { + "$ref": "Label" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.labels", + "https://www.googleapis.com/auth/gmail.modify" + ] + }, + "delete": { + "id": "gmail.users.labels.delete", + "path": "{userId}/labels/{id}", + "httpMethod": "DELETE", + "description": "Immediately and permanently deletes the specified label and removes it from any messages and threads that it is applied to.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the label to delete.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "id" + ], + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.labels", + "https://www.googleapis.com/auth/gmail.modify" + ] + }, + "get": { + "id": "gmail.users.labels.get", + "path": "{userId}/labels/{id}", + "httpMethod": "GET", + "description": "Gets the specified label.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the label to retrieve.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "id" + ], + "response": { + "$ref": "Label" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.labels", + "https://www.googleapis.com/auth/gmail.modify", + "https://www.googleapis.com/auth/gmail.readonly" + ] + }, + "list": { + "id": "gmail.users.labels.list", + "path": "{userId}/labels", + "httpMethod": "GET", + "description": "Lists all labels in the user's mailbox.", + "parameters": { + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "ListLabelsResponse" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.labels", + "https://www.googleapis.com/auth/gmail.modify", + "https://www.googleapis.com/auth/gmail.readonly" + ] + }, + "patch": { + "id": "gmail.users.labels.patch", + "path": "{userId}/labels/{id}", + "httpMethod": "PATCH", + "description": "Updates the specified label. This method supports patch semantics.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the label to update.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "id" + ], + "request": { + "$ref": "Label" + }, + "response": { + "$ref": "Label" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.labels", + "https://www.googleapis.com/auth/gmail.modify" + ] + }, + "update": { + "id": "gmail.users.labels.update", + "path": "{userId}/labels/{id}", + "httpMethod": "PUT", + "description": "Updates the specified label.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the label to update.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "id" + ], + "request": { + "$ref": "Label" + }, + "response": { + "$ref": "Label" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.labels", + "https://www.googleapis.com/auth/gmail.modify" + ] + } + } + }, + "messages": { + "methods": { + "delete": { + "id": "gmail.users.messages.delete", + "path": "{userId}/messages/{id}", + "httpMethod": "DELETE", + "description": "Immediately and permanently deletes the specified message. This operation cannot be undone. Prefer messages.trash instead.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the message to delete.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "id" + ], + "scopes": [ + "https://mail.google.com/" + ] + }, + "get": { + "id": "gmail.users.messages.get", + "path": "{userId}/messages/{id}", + "httpMethod": "GET", + "description": "Gets the specified message.", + "parameters": { + "format": { + "type": "string", + "description": "The format to return the message in.", + "default": "full", + "enum": [ + "full", + "metadata", + "minimal", + "raw" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ], + "location": "query" + }, + "id": { + "type": "string", + "description": "The ID of the message to retrieve.", + "required": true, + "location": "path" + }, + "metadataHeaders": { + "type": "string", + "description": "When given and format is METADATA, only include headers specified.", + "repeated": true, + "location": "query" + }, + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "id" + ], + "response": { + "$ref": "Message" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.modify", + "https://www.googleapis.com/auth/gmail.readonly" + ] + }, + "import": { + "id": "gmail.users.messages.import", + "path": "{userId}/messages/import", + "httpMethod": "POST", + "description": "Imports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. Does not send a message.", + "parameters": { + "deleted": { + "type": "boolean", + "description": "Mark the email as permanently deleted (not TRASH) and only visible in Google Apps Vault to a Vault administrator. Only used for Google Apps for Work accounts.", + "default": "false", + "location": "query" + }, + "internalDateSource": { + "type": "string", + "description": "Source for Gmail's internal date of the message.", + "default": "dateHeader", + "enum": [ + "dateHeader", + "receivedTime" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "neverMarkSpam": { + "type": "boolean", + "description": "Ignore the Gmail spam classifier decision and never mark this email as SPAM in the mailbox.", + "default": "false", + "location": "query" + }, + "processForCalendar": { + "type": "boolean", + "description": "Process calendar invites in the email and add any extracted meetings to the Google Calendar for this user.", + "default": "false", + "location": "query" + }, + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "request": { + "$ref": "Message" + }, + "response": { + "$ref": "Message" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.insert", + "https://www.googleapis.com/auth/gmail.modify" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "message/rfc822" + ], + "maxSize": "35MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/gmail/v1/users/{userId}/messages/import" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/gmail/v1/users/{userId}/messages/import" + } + } + } + }, + "insert": { + "id": "gmail.users.messages.insert", + "path": "{userId}/messages", + "httpMethod": "POST", + "description": "Directly inserts a message into only this user's mailbox similar to IMAP APPEND, bypassing most scanning and classification. Does not send a message.", + "parameters": { + "deleted": { + "type": "boolean", + "description": "Mark the email as permanently deleted (not TRASH) and only visible in Google Apps Vault to a Vault administrator. Only used for Google Apps for Work accounts.", + "default": "false", + "location": "query" + }, + "internalDateSource": { + "type": "string", + "description": "Source for Gmail's internal date of the message.", + "default": "receivedTime", + "enum": [ + "dateHeader", + "receivedTime" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "request": { + "$ref": "Message" + }, + "response": { + "$ref": "Message" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.insert", + "https://www.googleapis.com/auth/gmail.modify" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "message/rfc822" + ], + "maxSize": "35MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/gmail/v1/users/{userId}/messages" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/gmail/v1/users/{userId}/messages" + } + } + } + }, + "list": { + "id": "gmail.users.messages.list", + "path": "{userId}/messages", + "httpMethod": "GET", + "description": "Lists the messages in the user's mailbox.", + "parameters": { + "includeSpamTrash": { + "type": "boolean", + "description": "Include messages from SPAM and TRASH in the results.", + "default": "false", + "location": "query" + }, + "labelIds": { + "type": "string", + "description": "Only return messages with labels that match all of the specified label IDs.", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of messages to return.", + "default": "100", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Page token to retrieve a specific page of results in the list.", + "location": "query" + }, + "q": { + "type": "string", + "description": "Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, \"from:someuser@example.com rfc822msgid: is:unread\".", + "location": "query" + }, + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "ListMessagesResponse" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.modify", + "https://www.googleapis.com/auth/gmail.readonly" + ] + }, + "modify": { + "id": "gmail.users.messages.modify", + "path": "{userId}/messages/{id}/modify", + "httpMethod": "POST", + "description": "Modifies the labels on the specified message.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the message to modify.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "id" + ], + "request": { + "$ref": "ModifyMessageRequest" + }, + "response": { + "$ref": "Message" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.modify" + ] + }, + "send": { + "id": "gmail.users.messages.send", + "path": "{userId}/messages/send", + "httpMethod": "POST", + "description": "Sends the specified message to the recipients in the To, Cc, and Bcc headers.", + "parameters": { + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "request": { + "$ref": "Message" + }, + "response": { + "$ref": "Message" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.compose", + "https://www.googleapis.com/auth/gmail.modify", + "https://www.googleapis.com/auth/gmail.send" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "message/rfc822" + ], + "maxSize": "35MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/gmail/v1/users/{userId}/messages/send" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/gmail/v1/users/{userId}/messages/send" + } + } + } + }, + "trash": { + "id": "gmail.users.messages.trash", + "path": "{userId}/messages/{id}/trash", + "httpMethod": "POST", + "description": "Moves the specified message to the trash.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the message to Trash.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "id" + ], + "response": { + "$ref": "Message" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.modify" + ] + }, + "untrash": { + "id": "gmail.users.messages.untrash", + "path": "{userId}/messages/{id}/untrash", + "httpMethod": "POST", + "description": "Removes the specified message from the trash.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the message to remove from Trash.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "id" + ], + "response": { + "$ref": "Message" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.modify" + ] + } + }, + "resources": { + "attachments": { + "methods": { + "get": { + "id": "gmail.users.messages.attachments.get", + "path": "{userId}/messages/{messageId}/attachments/{id}", + "httpMethod": "GET", + "description": "Gets the specified message attachment.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the attachment.", + "required": true, + "location": "path" + }, + "messageId": { + "type": "string", + "description": "The ID of the message containing the attachment.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "messageId", + "id" + ], + "response": { + "$ref": "MessagePartBody" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.modify", + "https://www.googleapis.com/auth/gmail.readonly" + ] + } + } + } + } + }, + "threads": { + "methods": { + "delete": { + "id": "gmail.users.threads.delete", + "path": "{userId}/threads/{id}", + "httpMethod": "DELETE", + "description": "Immediately and permanently deletes the specified thread. This operation cannot be undone. Prefer threads.trash instead.", + "parameters": { + "id": { + "type": "string", + "description": "ID of the Thread to delete.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "id" + ], + "scopes": [ + "https://mail.google.com/" + ] + }, + "get": { + "id": "gmail.users.threads.get", + "path": "{userId}/threads/{id}", + "httpMethod": "GET", + "description": "Gets the specified thread.", + "parameters": { + "format": { + "type": "string", + "description": "The format to return the messages in.", + "default": "full", + "enum": [ + "full", + "metadata", + "minimal" + ], + "enumDescriptions": [ + "", + "", + "" + ], + "location": "query" + }, + "id": { + "type": "string", + "description": "The ID of the thread to retrieve.", + "required": true, + "location": "path" + }, + "metadataHeaders": { + "type": "string", + "description": "When given and format is METADATA, only include headers specified.", + "repeated": true, + "location": "query" + }, + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "id" + ], + "response": { + "$ref": "Thread" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.modify", + "https://www.googleapis.com/auth/gmail.readonly" + ] + }, + "list": { + "id": "gmail.users.threads.list", + "path": "{userId}/threads", + "httpMethod": "GET", + "description": "Lists the threads in the user's mailbox.", + "parameters": { + "includeSpamTrash": { + "type": "boolean", + "description": "Include threads from SPAM and TRASH in the results.", + "default": "false", + "location": "query" + }, + "labelIds": { + "type": "string", + "description": "Only return threads with labels that match all of the specified label IDs.", + "repeated": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of threads to return.", + "default": "100", + "format": "uint32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Page token to retrieve a specific page of results in the list.", + "location": "query" + }, + "q": { + "type": "string", + "description": "Only return threads matching the specified query. Supports the same query format as the Gmail search box. For example, \"from:someuser@example.com rfc822msgid: is:unread\".", + "location": "query" + }, + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId" + ], + "response": { + "$ref": "ListThreadsResponse" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.modify", + "https://www.googleapis.com/auth/gmail.readonly" + ] + }, + "modify": { + "id": "gmail.users.threads.modify", + "path": "{userId}/threads/{id}/modify", + "httpMethod": "POST", + "description": "Modifies the labels applied to the thread. This applies to all messages in the thread.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the thread to modify.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "id" + ], + "request": { + "$ref": "ModifyThreadRequest" + }, + "response": { + "$ref": "Thread" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.modify" + ] + }, + "trash": { + "id": "gmail.users.threads.trash", + "path": "{userId}/threads/{id}/trash", + "httpMethod": "POST", + "description": "Moves the specified thread to the trash.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the thread to Trash.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "id" + ], + "response": { + "$ref": "Thread" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.modify" + ] + }, + "untrash": { + "id": "gmail.users.threads.untrash", + "path": "{userId}/threads/{id}/untrash", + "httpMethod": "POST", + "description": "Removes the specified thread from the trash.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the thread to remove from Trash.", + "required": true, + "location": "path" + }, + "userId": { + "type": "string", + "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + "default": "me", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "userId", + "id" + ], + "response": { + "$ref": "Thread" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.googleapis.com/auth/gmail.modify" + ] + } + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/gmail/v1/gmail-gen.go b/Godeps/_workspace/src/google.golang.org/api/gmail/v1/gmail-gen.go new file mode 100644 index 000000000..4856c6dd7 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/gmail/v1/gmail-gen.go @@ -0,0 +1,6026 @@ +// Package gmail provides access to the Gmail API. +// +// See https://developers.google.com/gmail/api/ +// +// Usage example: +// +// import "google.golang.org/api/gmail/v1" +// ... +// gmailService, err := gmail.New(oauthHttpClient) +package gmail // import "google.golang.org/api/gmail/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "gmail:v1" +const apiName = "gmail" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/gmail/v1/users/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your mail + MailGoogleComScope = "https://mail.google.com/" + + // Manage drafts and send emails + GmailComposeScope = "https://www.googleapis.com/auth/gmail.compose" + + // Insert mail into your mailbox + GmailInsertScope = "https://www.googleapis.com/auth/gmail.insert" + + // Manage mailbox labels + GmailLabelsScope = "https://www.googleapis.com/auth/gmail.labels" + + // View and modify but not delete your email + GmailModifyScope = "https://www.googleapis.com/auth/gmail.modify" + + // View your emails messages and settings + GmailReadonlyScope = "https://www.googleapis.com/auth/gmail.readonly" + + // Send email on your behalf + GmailSendScope = "https://www.googleapis.com/auth/gmail.send" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Users = NewUsersService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Users *UsersService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewUsersService(s *Service) *UsersService { + rs := &UsersService{s: s} + rs.Drafts = NewUsersDraftsService(s) + rs.History = NewUsersHistoryService(s) + rs.Labels = NewUsersLabelsService(s) + rs.Messages = NewUsersMessagesService(s) + rs.Threads = NewUsersThreadsService(s) + return rs +} + +type UsersService struct { + s *Service + + Drafts *UsersDraftsService + + History *UsersHistoryService + + Labels *UsersLabelsService + + Messages *UsersMessagesService + + Threads *UsersThreadsService +} + +func NewUsersDraftsService(s *Service) *UsersDraftsService { + rs := &UsersDraftsService{s: s} + return rs +} + +type UsersDraftsService struct { + s *Service +} + +func NewUsersHistoryService(s *Service) *UsersHistoryService { + rs := &UsersHistoryService{s: s} + return rs +} + +type UsersHistoryService struct { + s *Service +} + +func NewUsersLabelsService(s *Service) *UsersLabelsService { + rs := &UsersLabelsService{s: s} + return rs +} + +type UsersLabelsService struct { + s *Service +} + +func NewUsersMessagesService(s *Service) *UsersMessagesService { + rs := &UsersMessagesService{s: s} + rs.Attachments = NewUsersMessagesAttachmentsService(s) + return rs +} + +type UsersMessagesService struct { + s *Service + + Attachments *UsersMessagesAttachmentsService +} + +func NewUsersMessagesAttachmentsService(s *Service) *UsersMessagesAttachmentsService { + rs := &UsersMessagesAttachmentsService{s: s} + return rs +} + +type UsersMessagesAttachmentsService struct { + s *Service +} + +func NewUsersThreadsService(s *Service) *UsersThreadsService { + rs := &UsersThreadsService{s: s} + return rs +} + +type UsersThreadsService struct { + s *Service +} + +// Draft: A draft email in the user's mailbox. +type Draft struct { + // Id: The immutable ID of the draft. + Id string `json:"id,omitempty"` + + // Message: The message content of the draft. + Message *Message `json:"message,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Draft) MarshalJSON() ([]byte, error) { + type noMethod Draft + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// History: A record of a change to the user's mailbox. Each history +// change may affect multiple messages in multiple ways. +type History struct { + // Id: The mailbox sequence ID. + Id uint64 `json:"id,omitempty,string"` + + // LabelsAdded: Labels added to messages in this history record. + LabelsAdded []*HistoryLabelAdded `json:"labelsAdded,omitempty"` + + // LabelsRemoved: Labels removed from messages in this history record. + LabelsRemoved []*HistoryLabelRemoved `json:"labelsRemoved,omitempty"` + + // Messages: List of messages changed in this history record. The fields + // for specific change types, such as messagesAdded may duplicate + // messages in this field. We recommend using the specific change-type + // fields instead of this. + Messages []*Message `json:"messages,omitempty"` + + // MessagesAdded: Messages added to the mailbox in this history record. + MessagesAdded []*HistoryMessageAdded `json:"messagesAdded,omitempty"` + + // MessagesDeleted: Messages deleted (not Trashed) from the mailbox in + // this history record. + MessagesDeleted []*HistoryMessageDeleted `json:"messagesDeleted,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *History) MarshalJSON() ([]byte, error) { + type noMethod History + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type HistoryLabelAdded struct { + // LabelIds: Label IDs added to the message. + LabelIds []string `json:"labelIds,omitempty"` + + Message *Message `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "LabelIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HistoryLabelAdded) MarshalJSON() ([]byte, error) { + type noMethod HistoryLabelAdded + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type HistoryLabelRemoved struct { + // LabelIds: Label IDs removed from the message. + LabelIds []string `json:"labelIds,omitempty"` + + Message *Message `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "LabelIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HistoryLabelRemoved) MarshalJSON() ([]byte, error) { + type noMethod HistoryLabelRemoved + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type HistoryMessageAdded struct { + Message *Message `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Message") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HistoryMessageAdded) MarshalJSON() ([]byte, error) { + type noMethod HistoryMessageAdded + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type HistoryMessageDeleted struct { + Message *Message `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Message") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HistoryMessageDeleted) MarshalJSON() ([]byte, error) { + type noMethod HistoryMessageDeleted + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Label: Labels are used to categorize messages and threads within the +// user's mailbox. +type Label struct { + // Id: The immutable ID of the label. + Id string `json:"id,omitempty"` + + // LabelListVisibility: The visibility of the label in the label list in + // the Gmail web interface. + // + // Possible values: + // "labelHide" + // "labelShow" + // "labelShowIfUnread" + LabelListVisibility string `json:"labelListVisibility,omitempty"` + + // MessageListVisibility: The visibility of the label in the message + // list in the Gmail web interface. + // + // Possible values: + // "hide" + // "show" + MessageListVisibility string `json:"messageListVisibility,omitempty"` + + // MessagesTotal: The total number of messages with the label. + MessagesTotal int64 `json:"messagesTotal,omitempty"` + + // MessagesUnread: The number of unread messages with the label. + MessagesUnread int64 `json:"messagesUnread,omitempty"` + + // Name: The display name of the label. + Name string `json:"name,omitempty"` + + // ThreadsTotal: The total number of threads with the label. + ThreadsTotal int64 `json:"threadsTotal,omitempty"` + + // ThreadsUnread: The number of unread threads with the label. + ThreadsUnread int64 `json:"threadsUnread,omitempty"` + + // Type: The owner type for the label. User labels are created by the + // user and can be modified and deleted by the user and can be applied + // to any message or thread. System labels are internally created and + // cannot be added, modified, or deleted. System labels may be able to + // be applied to or removed from messages and threads under some + // circumstances but this is not guaranteed. For example, users can + // apply and remove the INBOX and UNREAD labels from messages and + // threads, but cannot apply or remove the DRAFTS or SENT labels from + // messages or threads. + // + // Possible values: + // "system" + // "user" + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Label) MarshalJSON() ([]byte, error) { + type noMethod Label + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ListDraftsResponse struct { + // Drafts: List of drafts. + Drafts []*Draft `json:"drafts,omitempty"` + + // NextPageToken: Token to retrieve the next page of results in the + // list. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ResultSizeEstimate: Estimated total number of results. + ResultSizeEstimate int64 `json:"resultSizeEstimate,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Drafts") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListDraftsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListDraftsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ListHistoryResponse struct { + // History: List of history records. Any messages contained in the + // response will typically only have id and threadId fields populated. + History []*History `json:"history,omitempty"` + + // HistoryId: The ID of the mailbox's current history record. + HistoryId uint64 `json:"historyId,omitempty,string"` + + // NextPageToken: Page token to retrieve the next page of results in the + // list. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "History") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListHistoryResponse) MarshalJSON() ([]byte, error) { + type noMethod ListHistoryResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ListLabelsResponse struct { + // Labels: List of labels. + Labels []*Label `json:"labels,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Labels") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListLabelsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListLabelsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ListMessagesResponse struct { + // Messages: List of messages. + Messages []*Message `json:"messages,omitempty"` + + // NextPageToken: Token to retrieve the next page of results in the + // list. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ResultSizeEstimate: Estimated total number of results. + ResultSizeEstimate int64 `json:"resultSizeEstimate,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Messages") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListMessagesResponse) MarshalJSON() ([]byte, error) { + type noMethod ListMessagesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ListThreadsResponse struct { + // NextPageToken: Page token to retrieve the next page of results in the + // list. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ResultSizeEstimate: Estimated total number of results. + ResultSizeEstimate int64 `json:"resultSizeEstimate,omitempty"` + + // Threads: List of threads. + Threads []*Thread `json:"threads,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListThreadsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListThreadsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Message: An email message. +type Message struct { + // HistoryId: The ID of the last history record that modified this + // message. + HistoryId uint64 `json:"historyId,omitempty,string"` + + // Id: The immutable ID of the message. + Id string `json:"id,omitempty"` + + // InternalDate: The internal message creation timestamp (epoch ms), + // which determines ordering in the inbox. For normal SMTP-received + // email, this represents the time the message was originally accepted + // by Google, which is more reliable than the Date header. However, for + // API-migrated mail, it can be configured by client to be based on the + // Date header. + InternalDate int64 `json:"internalDate,omitempty,string"` + + // LabelIds: List of IDs of labels applied to this message. + LabelIds []string `json:"labelIds,omitempty"` + + // Payload: The parsed email structure in the message parts. + Payload *MessagePart `json:"payload,omitempty"` + + // Raw: The entire email message in an RFC 2822 formatted and base64url + // encoded string. Returned in messages.get and drafts.get responses + // when the format=RAW parameter is supplied. + Raw string `json:"raw,omitempty"` + + // SizeEstimate: Estimated size in bytes of the message. + SizeEstimate int64 `json:"sizeEstimate,omitempty"` + + // Snippet: A short part of the message text. + Snippet string `json:"snippet,omitempty"` + + // ThreadId: The ID of the thread the message belongs to. To add a + // message or draft to a thread, the following criteria must be met: + // - The requested threadId must be specified on the Message or + // Draft.Message you supply with your request. + // - The References and In-Reply-To headers must be set in compliance + // with the RFC 2822 standard. + // - The Subject headers must match. + ThreadId string `json:"threadId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "HistoryId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Message) MarshalJSON() ([]byte, error) { + type noMethod Message + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MessagePart: A single MIME message part. +type MessagePart struct { + // Body: The message part body for this part, which may be empty for + // container MIME message parts. + Body *MessagePartBody `json:"body,omitempty"` + + // Filename: The filename of the attachment. Only present if this + // message part represents an attachment. + Filename string `json:"filename,omitempty"` + + // Headers: List of headers on this message part. For the top-level + // message part, representing the entire message payload, it will + // contain the standard RFC 2822 email headers such as To, From, and + // Subject. + Headers []*MessagePartHeader `json:"headers,omitempty"` + + // MimeType: The MIME type of the message part. + MimeType string `json:"mimeType,omitempty"` + + // PartId: The immutable ID of the message part. + PartId string `json:"partId,omitempty"` + + // Parts: The child MIME message parts of this part. This only applies + // to container MIME message parts, for example multipart/*. For non- + // container MIME message part types, such as text/plain, this field is + // empty. For more information, see RFC 1521. + Parts []*MessagePart `json:"parts,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Body") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MessagePart) MarshalJSON() ([]byte, error) { + type noMethod MessagePart + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MessagePartBody: The body of a single MIME message part. +type MessagePartBody struct { + // AttachmentId: When present, contains the ID of an external attachment + // that can be retrieved in a separate messages.attachments.get request. + // When not present, the entire content of the message part body is + // contained in the data field. + AttachmentId string `json:"attachmentId,omitempty"` + + // Data: The body data of a MIME message part. May be empty for MIME + // container types that have no message body or when the body data is + // sent as a separate attachment. An attachment ID is present if the + // body data is contained in a separate attachment. + Data string `json:"data,omitempty"` + + // Size: Total number of bytes in the body of the message part. + Size int64 `json:"size,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AttachmentId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MessagePartBody) MarshalJSON() ([]byte, error) { + type noMethod MessagePartBody + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type MessagePartHeader struct { + // Name: The name of the header before the : separator. For example, To. + Name string `json:"name,omitempty"` + + // Value: The value of the header after the : separator. For example, + // someuser@example.com. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MessagePartHeader) MarshalJSON() ([]byte, error) { + type noMethod MessagePartHeader + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ModifyMessageRequest struct { + // AddLabelIds: A list of IDs of labels to add to this message. + AddLabelIds []string `json:"addLabelIds,omitempty"` + + // RemoveLabelIds: A list IDs of labels to remove from this message. + RemoveLabelIds []string `json:"removeLabelIds,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AddLabelIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ModifyMessageRequest) MarshalJSON() ([]byte, error) { + type noMethod ModifyMessageRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ModifyThreadRequest struct { + // AddLabelIds: A list of IDs of labels to add to this thread. + AddLabelIds []string `json:"addLabelIds,omitempty"` + + // RemoveLabelIds: A list of IDs of labels to remove from this thread. + RemoveLabelIds []string `json:"removeLabelIds,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AddLabelIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ModifyThreadRequest) MarshalJSON() ([]byte, error) { + type noMethod ModifyThreadRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Profile: Profile for a Gmail user. +type Profile struct { + // EmailAddress: The user's email address. + EmailAddress string `json:"emailAddress,omitempty"` + + // HistoryId: The ID of the mailbox's current history record. + HistoryId uint64 `json:"historyId,omitempty,string"` + + // MessagesTotal: The total number of messages in the mailbox. + MessagesTotal int64 `json:"messagesTotal,omitempty"` + + // ThreadsTotal: The total number of threads in the mailbox. + ThreadsTotal int64 `json:"threadsTotal,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "EmailAddress") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Profile) MarshalJSON() ([]byte, error) { + type noMethod Profile + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Thread: A collection of messages representing a conversation. +type Thread struct { + // HistoryId: The ID of the last history record that modified this + // thread. + HistoryId uint64 `json:"historyId,omitempty,string"` + + // Id: The unique ID of the thread. + Id string `json:"id,omitempty"` + + // Messages: The list of messages in the thread. + Messages []*Message `json:"messages,omitempty"` + + // Snippet: A short part of the message text. + Snippet string `json:"snippet,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "HistoryId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Thread) MarshalJSON() ([]byte, error) { + type noMethod Thread + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// WatchRequest: Set up or update a new push notification watch on this +// user's mailbox. +type WatchRequest struct { + // LabelFilterAction: Filtering behavior of labelIds list specified. + // + // Possible values: + // "exclude" + // "include" + LabelFilterAction string `json:"labelFilterAction,omitempty"` + + // LabelIds: List of label_ids to restrict notifications about. By + // default, if unspecified, all changes are pushed out. If specified + // then dictates which labels are required for a push notification to be + // generated. + LabelIds []string `json:"labelIds,omitempty"` + + // TopicName: A fully qualified Google Cloud Pub/Sub API topic name to + // publish the events to. This topic name **must** already exist in + // Cloud Pub/Sub and you **must** have already granted gmail "publish" + // permission on it. For example, + // "projects/my-project-identifier/topics/my-topic-name" (using the new + // Cloud Pub/Sub "v1beta2" topic naming format). + // + // Note that the "my-project-identifier" portion must exactly match your + // Google developer project id (the one executing this watch request). + TopicName string `json:"topicName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "LabelFilterAction") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *WatchRequest) MarshalJSON() ([]byte, error) { + type noMethod WatchRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// WatchResponse: Push notification watch response. +type WatchResponse struct { + // Expiration: When Gmail will stop sending notifications for mailbox + // updates (epoch millis). Call watch again before this time to renew + // the watch. + Expiration int64 `json:"expiration,omitempty,string"` + + // HistoryId: The ID of the mailbox's current history record. + HistoryId uint64 `json:"historyId,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Expiration") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *WatchResponse) MarshalJSON() ([]byte, error) { + type noMethod WatchResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "gmail.users.getProfile": + +type UsersGetProfileCall struct { + s *Service + userId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetProfile: Gets the current user's Gmail profile. +func (r *UsersService) GetProfile(userId string) *UsersGetProfileCall { + c := &UsersGetProfileCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersGetProfileCall) Fields(s ...googleapi.Field) *UsersGetProfileCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersGetProfileCall) IfNoneMatch(entityTag string) *UsersGetProfileCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersGetProfileCall) Context(ctx context.Context) *UsersGetProfileCall { + c.ctx_ = ctx + return c +} + +func (c *UsersGetProfileCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/profile") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.getProfile" call. +// Exactly one of *Profile or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Profile.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersGetProfileCall) Do() (*Profile, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Profile{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the current user's Gmail profile.", + // "httpMethod": "GET", + // "id": "gmail.users.getProfile", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/profile", + // "response": { + // "$ref": "Profile" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.compose", + // "https://www.googleapis.com/auth/gmail.modify", + // "https://www.googleapis.com/auth/gmail.readonly" + // ] + // } + +} + +// method id "gmail.users.stop": + +type UsersStopCall struct { + s *Service + userId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Stop: Stop receiving push notifications for the given user mailbox. +func (r *UsersService) Stop(userId string) *UsersStopCall { + c := &UsersStopCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersStopCall) Fields(s ...googleapi.Field) *UsersStopCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersStopCall) Context(ctx context.Context) *UsersStopCall { + c.ctx_ = ctx + return c +} + +func (c *UsersStopCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/stop") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.stop" call. +func (c *UsersStopCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Stop receiving push notifications for the given user mailbox.", + // "httpMethod": "POST", + // "id": "gmail.users.stop", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/stop", + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.modify", + // "https://www.googleapis.com/auth/gmail.readonly" + // ] + // } + +} + +// method id "gmail.users.watch": + +type UsersWatchCall struct { + s *Service + userId string + watchrequest *WatchRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Watch: Set up or update a push notification watch on the given user +// mailbox. +func (r *UsersService) Watch(userId string, watchrequest *WatchRequest) *UsersWatchCall { + c := &UsersWatchCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.watchrequest = watchrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersWatchCall) Fields(s ...googleapi.Field) *UsersWatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersWatchCall) Context(ctx context.Context) *UsersWatchCall { + c.ctx_ = ctx + return c +} + +func (c *UsersWatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.watchrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/watch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.watch" call. +// Exactly one of *WatchResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *WatchResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UsersWatchCall) Do() (*WatchResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &WatchResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Set up or update a push notification watch on the given user mailbox.", + // "httpMethod": "POST", + // "id": "gmail.users.watch", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/watch", + // "request": { + // "$ref": "WatchRequest" + // }, + // "response": { + // "$ref": "WatchResponse" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.modify", + // "https://www.googleapis.com/auth/gmail.readonly" + // ] + // } + +} + +// method id "gmail.users.drafts.create": + +type UsersDraftsCreateCall struct { + s *Service + userId string + draft *Draft + opt_ map[string]interface{} + media_ io.Reader + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// Create: Creates a new draft with the DRAFT label. +func (r *UsersDraftsService) Create(userId string, draft *Draft) *UsersDraftsCreateCall { + c := &UsersDraftsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.draft = draft + return c +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *UsersDraftsCreateCall) Media(r io.Reader) *UsersDraftsCreateCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *UsersDraftsCreateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *UsersDraftsCreateCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *UsersDraftsCreateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *UsersDraftsCreateCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersDraftsCreateCall) Fields(s ...googleapi.Field) *UsersDraftsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *UsersDraftsCreateCall) Context(ctx context.Context) *UsersDraftsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *UsersDraftsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.draft) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/drafts") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.drafts.create" call. +// Exactly one of *Draft or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Draft.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersDraftsCreateCall) Do() (*Draft, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &Draft{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new draft with the DRAFT label.", + // "httpMethod": "POST", + // "id": "gmail.users.drafts.create", + // "mediaUpload": { + // "accept": [ + // "message/rfc822" + // ], + // "maxSize": "35MB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/gmail/v1/users/{userId}/drafts" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/gmail/v1/users/{userId}/drafts" + // } + // } + // }, + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/drafts", + // "request": { + // "$ref": "Draft" + // }, + // "response": { + // "$ref": "Draft" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.compose", + // "https://www.googleapis.com/auth/gmail.modify" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "gmail.users.drafts.delete": + +type UsersDraftsDeleteCall struct { + s *Service + userId string + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Immediately and permanently deletes the specified draft. Does +// not simply trash it. +func (r *UsersDraftsService) Delete(userId string, id string) *UsersDraftsDeleteCall { + c := &UsersDraftsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersDraftsDeleteCall) Fields(s ...googleapi.Field) *UsersDraftsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersDraftsDeleteCall) Context(ctx context.Context) *UsersDraftsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *UsersDraftsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/drafts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.drafts.delete" call. +func (c *UsersDraftsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Immediately and permanently deletes the specified draft. Does not simply trash it.", + // "httpMethod": "DELETE", + // "id": "gmail.users.drafts.delete", + // "parameterOrder": [ + // "userId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the draft to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/drafts/{id}", + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.compose", + // "https://www.googleapis.com/auth/gmail.modify" + // ] + // } + +} + +// method id "gmail.users.drafts.get": + +type UsersDraftsGetCall struct { + s *Service + userId string + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the specified draft. +func (r *UsersDraftsService) Get(userId string, id string) *UsersDraftsGetCall { + c := &UsersDraftsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.id = id + return c +} + +// Format sets the optional parameter "format": The format to return the +// draft in. +// +// Possible values: +// "full" (default) +// "metadata" +// "minimal" +// "raw" +func (c *UsersDraftsGetCall) Format(format string) *UsersDraftsGetCall { + c.opt_["format"] = format + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersDraftsGetCall) Fields(s ...googleapi.Field) *UsersDraftsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersDraftsGetCall) IfNoneMatch(entityTag string) *UsersDraftsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersDraftsGetCall) Context(ctx context.Context) *UsersDraftsGetCall { + c.ctx_ = ctx + return c +} + +func (c *UsersDraftsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["format"]; ok { + params.Set("format", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/drafts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.drafts.get" call. +// Exactly one of *Draft or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Draft.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersDraftsGetCall) Do() (*Draft, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Draft{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the specified draft.", + // "httpMethod": "GET", + // "id": "gmail.users.drafts.get", + // "parameterOrder": [ + // "userId", + // "id" + // ], + // "parameters": { + // "format": { + // "default": "full", + // "description": "The format to return the draft in.", + // "enum": [ + // "full", + // "metadata", + // "minimal", + // "raw" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "id": { + // "description": "The ID of the draft to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/drafts/{id}", + // "response": { + // "$ref": "Draft" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.compose", + // "https://www.googleapis.com/auth/gmail.modify", + // "https://www.googleapis.com/auth/gmail.readonly" + // ] + // } + +} + +// method id "gmail.users.drafts.list": + +type UsersDraftsListCall struct { + s *Service + userId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the drafts in the user's mailbox. +func (r *UsersDraftsService) List(userId string) *UsersDraftsListCall { + c := &UsersDraftsListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of drafts to return. +func (c *UsersDraftsListCall) MaxResults(maxResults int64) *UsersDraftsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Page token to +// retrieve a specific page of results in the list. +func (c *UsersDraftsListCall) PageToken(pageToken string) *UsersDraftsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersDraftsListCall) Fields(s ...googleapi.Field) *UsersDraftsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersDraftsListCall) IfNoneMatch(entityTag string) *UsersDraftsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersDraftsListCall) Context(ctx context.Context) *UsersDraftsListCall { + c.ctx_ = ctx + return c +} + +func (c *UsersDraftsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/drafts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.drafts.list" call. +// Exactly one of *ListDraftsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListDraftsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UsersDraftsListCall) Do() (*ListDraftsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListDraftsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the drafts in the user's mailbox.", + // "httpMethod": "GET", + // "id": "gmail.users.drafts.list", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "maxResults": { + // "default": "100", + // "description": "Maximum number of drafts to return.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Page token to retrieve a specific page of results in the list.", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/drafts", + // "response": { + // "$ref": "ListDraftsResponse" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.compose", + // "https://www.googleapis.com/auth/gmail.modify", + // "https://www.googleapis.com/auth/gmail.readonly" + // ] + // } + +} + +// method id "gmail.users.drafts.send": + +type UsersDraftsSendCall struct { + s *Service + userId string + draft *Draft + opt_ map[string]interface{} + media_ io.Reader + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// Send: Sends the specified, existing draft to the recipients in the +// To, Cc, and Bcc headers. +func (r *UsersDraftsService) Send(userId string, draft *Draft) *UsersDraftsSendCall { + c := &UsersDraftsSendCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.draft = draft + return c +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *UsersDraftsSendCall) Media(r io.Reader) *UsersDraftsSendCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *UsersDraftsSendCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *UsersDraftsSendCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *UsersDraftsSendCall) ProgressUpdater(pu googleapi.ProgressUpdater) *UsersDraftsSendCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersDraftsSendCall) Fields(s ...googleapi.Field) *UsersDraftsSendCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *UsersDraftsSendCall) Context(ctx context.Context) *UsersDraftsSendCall { + c.ctx_ = ctx + return c +} + +func (c *UsersDraftsSendCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.draft) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/drafts/send") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.drafts.send" call. +// Exactly one of *Message or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Message.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersDraftsSendCall) Do() (*Message, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &Message{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers.", + // "httpMethod": "POST", + // "id": "gmail.users.drafts.send", + // "mediaUpload": { + // "accept": [ + // "message/rfc822" + // ], + // "maxSize": "35MB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/gmail/v1/users/{userId}/drafts/send" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/gmail/v1/users/{userId}/drafts/send" + // } + // } + // }, + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/drafts/send", + // "request": { + // "$ref": "Draft" + // }, + // "response": { + // "$ref": "Message" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.compose", + // "https://www.googleapis.com/auth/gmail.modify" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "gmail.users.drafts.update": + +type UsersDraftsUpdateCall struct { + s *Service + userId string + id string + draft *Draft + opt_ map[string]interface{} + media_ io.Reader + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// Update: Replaces a draft's content. +func (r *UsersDraftsService) Update(userId string, id string, draft *Draft) *UsersDraftsUpdateCall { + c := &UsersDraftsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.id = id + c.draft = draft + return c +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *UsersDraftsUpdateCall) Media(r io.Reader) *UsersDraftsUpdateCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *UsersDraftsUpdateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *UsersDraftsUpdateCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *UsersDraftsUpdateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *UsersDraftsUpdateCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersDraftsUpdateCall) Fields(s ...googleapi.Field) *UsersDraftsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *UsersDraftsUpdateCall) Context(ctx context.Context) *UsersDraftsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *UsersDraftsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.draft) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/drafts/{id}") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "id": c.id, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.drafts.update" call. +// Exactly one of *Draft or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Draft.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersDraftsUpdateCall) Do() (*Draft, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &Draft{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Replaces a draft's content.", + // "httpMethod": "PUT", + // "id": "gmail.users.drafts.update", + // "mediaUpload": { + // "accept": [ + // "message/rfc822" + // ], + // "maxSize": "35MB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/gmail/v1/users/{userId}/drafts/{id}" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/gmail/v1/users/{userId}/drafts/{id}" + // } + // } + // }, + // "parameterOrder": [ + // "userId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the draft to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/drafts/{id}", + // "request": { + // "$ref": "Draft" + // }, + // "response": { + // "$ref": "Draft" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.compose", + // "https://www.googleapis.com/auth/gmail.modify" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "gmail.users.history.list": + +type UsersHistoryListCall struct { + s *Service + userId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the history of all changes to the given mailbox. History +// results are returned in chronological order (increasing historyId). +func (r *UsersHistoryService) List(userId string) *UsersHistoryListCall { + c := &UsersHistoryListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +// LabelId sets the optional parameter "labelId": Only return messages +// with a label matching the ID. +func (c *UsersHistoryListCall) LabelId(labelId string) *UsersHistoryListCall { + c.opt_["labelId"] = labelId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of history records to return. +func (c *UsersHistoryListCall) MaxResults(maxResults int64) *UsersHistoryListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Page token to +// retrieve a specific page of results in the list. +func (c *UsersHistoryListCall) PageToken(pageToken string) *UsersHistoryListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// StartHistoryId sets the optional parameter "startHistoryId": +// Required. Returns history records after the specified startHistoryId. +// The supplied startHistoryId should be obtained from the historyId of +// a message, thread, or previous list response. History IDs increase +// chronologically but are not contiguous with random gaps in between +// valid IDs. Supplying an invalid or out of date startHistoryId +// typically returns an HTTP 404 error code. A historyId is typically +// valid for at least a week, but in some rare circumstances may be +// valid for only a few hours. If you receive an HTTP 404 error +// response, your application should perform a full sync. If you receive +// no nextPageToken in the response, there are no updates to retrieve +// and you can store the returned historyId for a future request. +func (c *UsersHistoryListCall) StartHistoryId(startHistoryId uint64) *UsersHistoryListCall { + c.opt_["startHistoryId"] = startHistoryId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersHistoryListCall) Fields(s ...googleapi.Field) *UsersHistoryListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersHistoryListCall) IfNoneMatch(entityTag string) *UsersHistoryListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersHistoryListCall) Context(ctx context.Context) *UsersHistoryListCall { + c.ctx_ = ctx + return c +} + +func (c *UsersHistoryListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["labelId"]; ok { + params.Set("labelId", 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_["startHistoryId"]; ok { + params.Set("startHistoryId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/history") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.history.list" call. +// Exactly one of *ListHistoryResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListHistoryResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UsersHistoryListCall) Do() (*ListHistoryResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListHistoryResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the history of all changes to the given mailbox. History results are returned in chronological order (increasing historyId).", + // "httpMethod": "GET", + // "id": "gmail.users.history.list", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "labelId": { + // "description": "Only return messages with a label matching the ID.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "The maximum number of history records to return.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Page token to retrieve a specific page of results in the list.", + // "location": "query", + // "type": "string" + // }, + // "startHistoryId": { + // "description": "Required. Returns history records after the specified startHistoryId. The supplied startHistoryId should be obtained from the historyId of a message, thread, or previous list response. History IDs increase chronologically but are not contiguous with random gaps in between valid IDs. Supplying an invalid or out of date startHistoryId typically returns an HTTP 404 error code. A historyId is typically valid for at least a week, but in some rare circumstances may be valid for only a few hours. If you receive an HTTP 404 error response, your application should perform a full sync. If you receive no nextPageToken in the response, there are no updates to retrieve and you can store the returned historyId for a future request.", + // "format": "uint64", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/history", + // "response": { + // "$ref": "ListHistoryResponse" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.modify", + // "https://www.googleapis.com/auth/gmail.readonly" + // ] + // } + +} + +// method id "gmail.users.labels.create": + +type UsersLabelsCreateCall struct { + s *Service + userId string + label *Label + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a new label. +func (r *UsersLabelsService) Create(userId string, label *Label) *UsersLabelsCreateCall { + c := &UsersLabelsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.label = label + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersLabelsCreateCall) Fields(s ...googleapi.Field) *UsersLabelsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersLabelsCreateCall) Context(ctx context.Context) *UsersLabelsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *UsersLabelsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.label) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/labels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.labels.create" call. +// Exactly one of *Label or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Label.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersLabelsCreateCall) Do() (*Label, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Label{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new label.", + // "httpMethod": "POST", + // "id": "gmail.users.labels.create", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/labels", + // "request": { + // "$ref": "Label" + // }, + // "response": { + // "$ref": "Label" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.labels", + // "https://www.googleapis.com/auth/gmail.modify" + // ] + // } + +} + +// method id "gmail.users.labels.delete": + +type UsersLabelsDeleteCall struct { + s *Service + userId string + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Immediately and permanently deletes the specified label and +// removes it from any messages and threads that it is applied to. +func (r *UsersLabelsService) Delete(userId string, id string) *UsersLabelsDeleteCall { + c := &UsersLabelsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersLabelsDeleteCall) Fields(s ...googleapi.Field) *UsersLabelsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersLabelsDeleteCall) Context(ctx context.Context) *UsersLabelsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *UsersLabelsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/labels/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.labels.delete" call. +func (c *UsersLabelsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Immediately and permanently deletes the specified label and removes it from any messages and threads that it is applied to.", + // "httpMethod": "DELETE", + // "id": "gmail.users.labels.delete", + // "parameterOrder": [ + // "userId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the label to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/labels/{id}", + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.labels", + // "https://www.googleapis.com/auth/gmail.modify" + // ] + // } + +} + +// method id "gmail.users.labels.get": + +type UsersLabelsGetCall struct { + s *Service + userId string + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the specified label. +func (r *UsersLabelsService) Get(userId string, id string) *UsersLabelsGetCall { + c := &UsersLabelsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersLabelsGetCall) Fields(s ...googleapi.Field) *UsersLabelsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersLabelsGetCall) IfNoneMatch(entityTag string) *UsersLabelsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersLabelsGetCall) Context(ctx context.Context) *UsersLabelsGetCall { + c.ctx_ = ctx + return c +} + +func (c *UsersLabelsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/labels/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.labels.get" call. +// Exactly one of *Label or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Label.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersLabelsGetCall) Do() (*Label, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Label{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the specified label.", + // "httpMethod": "GET", + // "id": "gmail.users.labels.get", + // "parameterOrder": [ + // "userId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the label to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/labels/{id}", + // "response": { + // "$ref": "Label" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.labels", + // "https://www.googleapis.com/auth/gmail.modify", + // "https://www.googleapis.com/auth/gmail.readonly" + // ] + // } + +} + +// method id "gmail.users.labels.list": + +type UsersLabelsListCall struct { + s *Service + userId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all labels in the user's mailbox. +func (r *UsersLabelsService) List(userId string) *UsersLabelsListCall { + c := &UsersLabelsListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersLabelsListCall) Fields(s ...googleapi.Field) *UsersLabelsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersLabelsListCall) IfNoneMatch(entityTag string) *UsersLabelsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersLabelsListCall) Context(ctx context.Context) *UsersLabelsListCall { + c.ctx_ = ctx + return c +} + +func (c *UsersLabelsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/labels") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.labels.list" call. +// Exactly one of *ListLabelsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLabelsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UsersLabelsListCall) Do() (*ListLabelsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListLabelsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all labels in the user's mailbox.", + // "httpMethod": "GET", + // "id": "gmail.users.labels.list", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/labels", + // "response": { + // "$ref": "ListLabelsResponse" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.labels", + // "https://www.googleapis.com/auth/gmail.modify", + // "https://www.googleapis.com/auth/gmail.readonly" + // ] + // } + +} + +// method id "gmail.users.labels.patch": + +type UsersLabelsPatchCall struct { + s *Service + userId string + id string + label *Label + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates the specified label. This method supports patch +// semantics. +func (r *UsersLabelsService) Patch(userId string, id string, label *Label) *UsersLabelsPatchCall { + c := &UsersLabelsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.id = id + c.label = label + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersLabelsPatchCall) Fields(s ...googleapi.Field) *UsersLabelsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersLabelsPatchCall) Context(ctx context.Context) *UsersLabelsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *UsersLabelsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.label) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/labels/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.labels.patch" call. +// Exactly one of *Label or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Label.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersLabelsPatchCall) Do() (*Label, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Label{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the specified label. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "gmail.users.labels.patch", + // "parameterOrder": [ + // "userId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the label to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/labels/{id}", + // "request": { + // "$ref": "Label" + // }, + // "response": { + // "$ref": "Label" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.labels", + // "https://www.googleapis.com/auth/gmail.modify" + // ] + // } + +} + +// method id "gmail.users.labels.update": + +type UsersLabelsUpdateCall struct { + s *Service + userId string + id string + label *Label + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates the specified label. +func (r *UsersLabelsService) Update(userId string, id string, label *Label) *UsersLabelsUpdateCall { + c := &UsersLabelsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.id = id + c.label = label + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersLabelsUpdateCall) Fields(s ...googleapi.Field) *UsersLabelsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersLabelsUpdateCall) Context(ctx context.Context) *UsersLabelsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *UsersLabelsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.label) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/labels/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.labels.update" call. +// Exactly one of *Label or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Label.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersLabelsUpdateCall) Do() (*Label, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Label{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the specified label.", + // "httpMethod": "PUT", + // "id": "gmail.users.labels.update", + // "parameterOrder": [ + // "userId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the label to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/labels/{id}", + // "request": { + // "$ref": "Label" + // }, + // "response": { + // "$ref": "Label" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.labels", + // "https://www.googleapis.com/auth/gmail.modify" + // ] + // } + +} + +// method id "gmail.users.messages.delete": + +type UsersMessagesDeleteCall struct { + s *Service + userId string + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Immediately and permanently deletes the specified message. +// This operation cannot be undone. Prefer messages.trash instead. +func (r *UsersMessagesService) Delete(userId string, id string) *UsersMessagesDeleteCall { + c := &UsersMessagesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersMessagesDeleteCall) Fields(s ...googleapi.Field) *UsersMessagesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersMessagesDeleteCall) Context(ctx context.Context) *UsersMessagesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *UsersMessagesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/messages/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.messages.delete" call. +func (c *UsersMessagesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Immediately and permanently deletes the specified message. This operation cannot be undone. Prefer messages.trash instead.", + // "httpMethod": "DELETE", + // "id": "gmail.users.messages.delete", + // "parameterOrder": [ + // "userId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the message to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/messages/{id}", + // "scopes": [ + // "https://mail.google.com/" + // ] + // } + +} + +// method id "gmail.users.messages.get": + +type UsersMessagesGetCall struct { + s *Service + userId string + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the specified message. +func (r *UsersMessagesService) Get(userId string, id string) *UsersMessagesGetCall { + c := &UsersMessagesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.id = id + return c +} + +// Format sets the optional parameter "format": The format to return the +// message in. +// +// Possible values: +// "full" (default) +// "metadata" +// "minimal" +// "raw" +func (c *UsersMessagesGetCall) Format(format string) *UsersMessagesGetCall { + c.opt_["format"] = format + return c +} + +// MetadataHeaders sets the optional parameter "metadataHeaders": When +// given and format is METADATA, only include headers specified. +func (c *UsersMessagesGetCall) MetadataHeaders(metadataHeaders string) *UsersMessagesGetCall { + c.opt_["metadataHeaders"] = metadataHeaders + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersMessagesGetCall) Fields(s ...googleapi.Field) *UsersMessagesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersMessagesGetCall) IfNoneMatch(entityTag string) *UsersMessagesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersMessagesGetCall) Context(ctx context.Context) *UsersMessagesGetCall { + c.ctx_ = ctx + return c +} + +func (c *UsersMessagesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["format"]; ok { + params.Set("format", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["metadataHeaders"]; ok { + params.Set("metadataHeaders", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/messages/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.messages.get" call. +// Exactly one of *Message or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Message.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersMessagesGetCall) Do() (*Message, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Message{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the specified message.", + // "httpMethod": "GET", + // "id": "gmail.users.messages.get", + // "parameterOrder": [ + // "userId", + // "id" + // ], + // "parameters": { + // "format": { + // "default": "full", + // "description": "The format to return the message in.", + // "enum": [ + // "full", + // "metadata", + // "minimal", + // "raw" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "id": { + // "description": "The ID of the message to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "metadataHeaders": { + // "description": "When given and format is METADATA, only include headers specified.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/messages/{id}", + // "response": { + // "$ref": "Message" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.modify", + // "https://www.googleapis.com/auth/gmail.readonly" + // ] + // } + +} + +// method id "gmail.users.messages.import": + +type UsersMessagesImportCall struct { + s *Service + userId string + message *Message + opt_ map[string]interface{} + media_ io.Reader + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// Import: Imports a message into only this user's mailbox, with +// standard email delivery scanning and classification similar to +// receiving via SMTP. Does not send a message. +func (r *UsersMessagesService) Import(userId string, message *Message) *UsersMessagesImportCall { + c := &UsersMessagesImportCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.message = message + return c +} + +// Deleted sets the optional parameter "deleted": Mark the email as +// permanently deleted (not TRASH) and only visible in Google Apps Vault +// to a Vault administrator. Only used for Google Apps for Work +// accounts. +func (c *UsersMessagesImportCall) Deleted(deleted bool) *UsersMessagesImportCall { + c.opt_["deleted"] = deleted + return c +} + +// InternalDateSource sets the optional parameter "internalDateSource": +// Source for Gmail's internal date of the message. +// +// Possible values: +// "dateHeader" (default) +// "receivedTime" +func (c *UsersMessagesImportCall) InternalDateSource(internalDateSource string) *UsersMessagesImportCall { + c.opt_["internalDateSource"] = internalDateSource + return c +} + +// NeverMarkSpam sets the optional parameter "neverMarkSpam": Ignore the +// Gmail spam classifier decision and never mark this email as SPAM in +// the mailbox. +func (c *UsersMessagesImportCall) NeverMarkSpam(neverMarkSpam bool) *UsersMessagesImportCall { + c.opt_["neverMarkSpam"] = neverMarkSpam + return c +} + +// ProcessForCalendar sets the optional parameter "processForCalendar": +// Process calendar invites in the email and add any extracted meetings +// to the Google Calendar for this user. +func (c *UsersMessagesImportCall) ProcessForCalendar(processForCalendar bool) *UsersMessagesImportCall { + c.opt_["processForCalendar"] = processForCalendar + return c +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *UsersMessagesImportCall) Media(r io.Reader) *UsersMessagesImportCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *UsersMessagesImportCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *UsersMessagesImportCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *UsersMessagesImportCall) ProgressUpdater(pu googleapi.ProgressUpdater) *UsersMessagesImportCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersMessagesImportCall) Fields(s ...googleapi.Field) *UsersMessagesImportCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *UsersMessagesImportCall) Context(ctx context.Context) *UsersMessagesImportCall { + c.ctx_ = ctx + return c +} + +func (c *UsersMessagesImportCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.message) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["deleted"]; ok { + params.Set("deleted", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["internalDateSource"]; ok { + params.Set("internalDateSource", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["neverMarkSpam"]; ok { + params.Set("neverMarkSpam", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["processForCalendar"]; ok { + params.Set("processForCalendar", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/messages/import") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.messages.import" call. +// Exactly one of *Message or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Message.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersMessagesImportCall) Do() (*Message, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &Message{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Imports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. Does not send a message.", + // "httpMethod": "POST", + // "id": "gmail.users.messages.import", + // "mediaUpload": { + // "accept": [ + // "message/rfc822" + // ], + // "maxSize": "35MB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/gmail/v1/users/{userId}/messages/import" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/gmail/v1/users/{userId}/messages/import" + // } + // } + // }, + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "deleted": { + // "default": "false", + // "description": "Mark the email as permanently deleted (not TRASH) and only visible in Google Apps Vault to a Vault administrator. Only used for Google Apps for Work accounts.", + // "location": "query", + // "type": "boolean" + // }, + // "internalDateSource": { + // "default": "dateHeader", + // "description": "Source for Gmail's internal date of the message.", + // "enum": [ + // "dateHeader", + // "receivedTime" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "neverMarkSpam": { + // "default": "false", + // "description": "Ignore the Gmail spam classifier decision and never mark this email as SPAM in the mailbox.", + // "location": "query", + // "type": "boolean" + // }, + // "processForCalendar": { + // "default": "false", + // "description": "Process calendar invites in the email and add any extracted meetings to the Google Calendar for this user.", + // "location": "query", + // "type": "boolean" + // }, + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/messages/import", + // "request": { + // "$ref": "Message" + // }, + // "response": { + // "$ref": "Message" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.insert", + // "https://www.googleapis.com/auth/gmail.modify" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "gmail.users.messages.insert": + +type UsersMessagesInsertCall struct { + s *Service + userId string + message *Message + opt_ map[string]interface{} + media_ io.Reader + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// Insert: Directly inserts a message into only this user's mailbox +// similar to IMAP APPEND, bypassing most scanning and classification. +// Does not send a message. +func (r *UsersMessagesService) Insert(userId string, message *Message) *UsersMessagesInsertCall { + c := &UsersMessagesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.message = message + return c +} + +// Deleted sets the optional parameter "deleted": Mark the email as +// permanently deleted (not TRASH) and only visible in Google Apps Vault +// to a Vault administrator. Only used for Google Apps for Work +// accounts. +func (c *UsersMessagesInsertCall) Deleted(deleted bool) *UsersMessagesInsertCall { + c.opt_["deleted"] = deleted + return c +} + +// InternalDateSource sets the optional parameter "internalDateSource": +// Source for Gmail's internal date of the message. +// +// Possible values: +// "dateHeader" +// "receivedTime" (default) +func (c *UsersMessagesInsertCall) InternalDateSource(internalDateSource string) *UsersMessagesInsertCall { + c.opt_["internalDateSource"] = internalDateSource + return c +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *UsersMessagesInsertCall) Media(r io.Reader) *UsersMessagesInsertCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *UsersMessagesInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *UsersMessagesInsertCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *UsersMessagesInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *UsersMessagesInsertCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersMessagesInsertCall) Fields(s ...googleapi.Field) *UsersMessagesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *UsersMessagesInsertCall) Context(ctx context.Context) *UsersMessagesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *UsersMessagesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.message) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["deleted"]; ok { + params.Set("deleted", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["internalDateSource"]; ok { + params.Set("internalDateSource", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/messages") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.messages.insert" call. +// Exactly one of *Message or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Message.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersMessagesInsertCall) Do() (*Message, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &Message{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Directly inserts a message into only this user's mailbox similar to IMAP APPEND, bypassing most scanning and classification. Does not send a message.", + // "httpMethod": "POST", + // "id": "gmail.users.messages.insert", + // "mediaUpload": { + // "accept": [ + // "message/rfc822" + // ], + // "maxSize": "35MB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/gmail/v1/users/{userId}/messages" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/gmail/v1/users/{userId}/messages" + // } + // } + // }, + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "deleted": { + // "default": "false", + // "description": "Mark the email as permanently deleted (not TRASH) and only visible in Google Apps Vault to a Vault administrator. Only used for Google Apps for Work accounts.", + // "location": "query", + // "type": "boolean" + // }, + // "internalDateSource": { + // "default": "receivedTime", + // "description": "Source for Gmail's internal date of the message.", + // "enum": [ + // "dateHeader", + // "receivedTime" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/messages", + // "request": { + // "$ref": "Message" + // }, + // "response": { + // "$ref": "Message" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.insert", + // "https://www.googleapis.com/auth/gmail.modify" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "gmail.users.messages.list": + +type UsersMessagesListCall struct { + s *Service + userId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the messages in the user's mailbox. +func (r *UsersMessagesService) List(userId string) *UsersMessagesListCall { + c := &UsersMessagesListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +// IncludeSpamTrash sets the optional parameter "includeSpamTrash": +// Include messages from SPAM and TRASH in the results. +func (c *UsersMessagesListCall) IncludeSpamTrash(includeSpamTrash bool) *UsersMessagesListCall { + c.opt_["includeSpamTrash"] = includeSpamTrash + return c +} + +// LabelIds sets the optional parameter "labelIds": Only return messages +// with labels that match all of the specified label IDs. +func (c *UsersMessagesListCall) LabelIds(labelIds string) *UsersMessagesListCall { + c.opt_["labelIds"] = labelIds + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of messages to return. +func (c *UsersMessagesListCall) MaxResults(maxResults int64) *UsersMessagesListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Page token to +// retrieve a specific page of results in the list. +func (c *UsersMessagesListCall) PageToken(pageToken string) *UsersMessagesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Q sets the optional parameter "q": Only return messages matching the +// specified query. Supports the same query format as the Gmail search +// box. For example, "from:someuser@example.com rfc822msgid: is:unread". +func (c *UsersMessagesListCall) Q(q string) *UsersMessagesListCall { + c.opt_["q"] = q + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersMessagesListCall) Fields(s ...googleapi.Field) *UsersMessagesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersMessagesListCall) IfNoneMatch(entityTag string) *UsersMessagesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersMessagesListCall) Context(ctx context.Context) *UsersMessagesListCall { + c.ctx_ = ctx + return c +} + +func (c *UsersMessagesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["includeSpamTrash"]; ok { + params.Set("includeSpamTrash", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["labelIds"]; ok { + params.Set("labelIds", 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_["q"]; ok { + params.Set("q", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/messages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.messages.list" call. +// Exactly one of *ListMessagesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListMessagesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UsersMessagesListCall) Do() (*ListMessagesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListMessagesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the messages in the user's mailbox.", + // "httpMethod": "GET", + // "id": "gmail.users.messages.list", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "includeSpamTrash": { + // "default": "false", + // "description": "Include messages from SPAM and TRASH in the results.", + // "location": "query", + // "type": "boolean" + // }, + // "labelIds": { + // "description": "Only return messages with labels that match all of the specified label IDs.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Maximum number of messages to return.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Page token to retrieve a specific page of results in the list.", + // "location": "query", + // "type": "string" + // }, + // "q": { + // "description": "Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, \"from:someuser@example.com rfc822msgid: is:unread\".", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/messages", + // "response": { + // "$ref": "ListMessagesResponse" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.modify", + // "https://www.googleapis.com/auth/gmail.readonly" + // ] + // } + +} + +// method id "gmail.users.messages.modify": + +type UsersMessagesModifyCall struct { + s *Service + userId string + id string + modifymessagerequest *ModifyMessageRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Modify: Modifies the labels on the specified message. +func (r *UsersMessagesService) Modify(userId string, id string, modifymessagerequest *ModifyMessageRequest) *UsersMessagesModifyCall { + c := &UsersMessagesModifyCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.id = id + c.modifymessagerequest = modifymessagerequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersMessagesModifyCall) Fields(s ...googleapi.Field) *UsersMessagesModifyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersMessagesModifyCall) Context(ctx context.Context) *UsersMessagesModifyCall { + c.ctx_ = ctx + return c +} + +func (c *UsersMessagesModifyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifymessagerequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/messages/{id}/modify") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.messages.modify" call. +// Exactly one of *Message or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Message.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersMessagesModifyCall) Do() (*Message, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Message{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Modifies the labels on the specified message.", + // "httpMethod": "POST", + // "id": "gmail.users.messages.modify", + // "parameterOrder": [ + // "userId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the message to modify.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/messages/{id}/modify", + // "request": { + // "$ref": "ModifyMessageRequest" + // }, + // "response": { + // "$ref": "Message" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.modify" + // ] + // } + +} + +// method id "gmail.users.messages.send": + +type UsersMessagesSendCall struct { + s *Service + userId string + message *Message + opt_ map[string]interface{} + media_ io.Reader + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// Send: Sends the specified message to the recipients in the To, Cc, +// and Bcc headers. +func (r *UsersMessagesService) Send(userId string, message *Message) *UsersMessagesSendCall { + c := &UsersMessagesSendCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.message = message + return c +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *UsersMessagesSendCall) Media(r io.Reader) *UsersMessagesSendCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *UsersMessagesSendCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *UsersMessagesSendCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *UsersMessagesSendCall) ProgressUpdater(pu googleapi.ProgressUpdater) *UsersMessagesSendCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersMessagesSendCall) Fields(s ...googleapi.Field) *UsersMessagesSendCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *UsersMessagesSendCall) Context(ctx context.Context) *UsersMessagesSendCall { + c.ctx_ = ctx + return c +} + +func (c *UsersMessagesSendCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.message) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/messages/send") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.messages.send" call. +// Exactly one of *Message or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Message.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersMessagesSendCall) Do() (*Message, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &Message{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sends the specified message to the recipients in the To, Cc, and Bcc headers.", + // "httpMethod": "POST", + // "id": "gmail.users.messages.send", + // "mediaUpload": { + // "accept": [ + // "message/rfc822" + // ], + // "maxSize": "35MB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/gmail/v1/users/{userId}/messages/send" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/gmail/v1/users/{userId}/messages/send" + // } + // } + // }, + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/messages/send", + // "request": { + // "$ref": "Message" + // }, + // "response": { + // "$ref": "Message" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.compose", + // "https://www.googleapis.com/auth/gmail.modify", + // "https://www.googleapis.com/auth/gmail.send" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "gmail.users.messages.trash": + +type UsersMessagesTrashCall struct { + s *Service + userId string + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Trash: Moves the specified message to the trash. +func (r *UsersMessagesService) Trash(userId string, id string) *UsersMessagesTrashCall { + c := &UsersMessagesTrashCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersMessagesTrashCall) Fields(s ...googleapi.Field) *UsersMessagesTrashCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersMessagesTrashCall) Context(ctx context.Context) *UsersMessagesTrashCall { + c.ctx_ = ctx + return c +} + +func (c *UsersMessagesTrashCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/messages/{id}/trash") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.messages.trash" call. +// Exactly one of *Message or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Message.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersMessagesTrashCall) Do() (*Message, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Message{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Moves the specified message to the trash.", + // "httpMethod": "POST", + // "id": "gmail.users.messages.trash", + // "parameterOrder": [ + // "userId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the message to Trash.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/messages/{id}/trash", + // "response": { + // "$ref": "Message" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.modify" + // ] + // } + +} + +// method id "gmail.users.messages.untrash": + +type UsersMessagesUntrashCall struct { + s *Service + userId string + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Untrash: Removes the specified message from the trash. +func (r *UsersMessagesService) Untrash(userId string, id string) *UsersMessagesUntrashCall { + c := &UsersMessagesUntrashCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersMessagesUntrashCall) Fields(s ...googleapi.Field) *UsersMessagesUntrashCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersMessagesUntrashCall) Context(ctx context.Context) *UsersMessagesUntrashCall { + c.ctx_ = ctx + return c +} + +func (c *UsersMessagesUntrashCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/messages/{id}/untrash") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.messages.untrash" call. +// Exactly one of *Message or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Message.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersMessagesUntrashCall) Do() (*Message, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Message{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Removes the specified message from the trash.", + // "httpMethod": "POST", + // "id": "gmail.users.messages.untrash", + // "parameterOrder": [ + // "userId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the message to remove from Trash.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/messages/{id}/untrash", + // "response": { + // "$ref": "Message" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.modify" + // ] + // } + +} + +// method id "gmail.users.messages.attachments.get": + +type UsersMessagesAttachmentsGetCall struct { + s *Service + userId string + messageId string + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the specified message attachment. +func (r *UsersMessagesAttachmentsService) Get(userId string, messageId string, id string) *UsersMessagesAttachmentsGetCall { + c := &UsersMessagesAttachmentsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.messageId = messageId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersMessagesAttachmentsGetCall) Fields(s ...googleapi.Field) *UsersMessagesAttachmentsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersMessagesAttachmentsGetCall) IfNoneMatch(entityTag string) *UsersMessagesAttachmentsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersMessagesAttachmentsGetCall) Context(ctx context.Context) *UsersMessagesAttachmentsGetCall { + c.ctx_ = ctx + return c +} + +func (c *UsersMessagesAttachmentsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/messages/{messageId}/attachments/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "messageId": c.messageId, + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.messages.attachments.get" call. +// Exactly one of *MessagePartBody or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *MessagePartBody.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UsersMessagesAttachmentsGetCall) Do() (*MessagePartBody, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &MessagePartBody{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the specified message attachment.", + // "httpMethod": "GET", + // "id": "gmail.users.messages.attachments.get", + // "parameterOrder": [ + // "userId", + // "messageId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the attachment.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "messageId": { + // "description": "The ID of the message containing the attachment.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/messages/{messageId}/attachments/{id}", + // "response": { + // "$ref": "MessagePartBody" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.modify", + // "https://www.googleapis.com/auth/gmail.readonly" + // ] + // } + +} + +// method id "gmail.users.threads.delete": + +type UsersThreadsDeleteCall struct { + s *Service + userId string + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Immediately and permanently deletes the specified thread. +// This operation cannot be undone. Prefer threads.trash instead. +func (r *UsersThreadsService) Delete(userId string, id string) *UsersThreadsDeleteCall { + c := &UsersThreadsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersThreadsDeleteCall) Fields(s ...googleapi.Field) *UsersThreadsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersThreadsDeleteCall) Context(ctx context.Context) *UsersThreadsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *UsersThreadsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/threads/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.threads.delete" call. +func (c *UsersThreadsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Immediately and permanently deletes the specified thread. This operation cannot be undone. Prefer threads.trash instead.", + // "httpMethod": "DELETE", + // "id": "gmail.users.threads.delete", + // "parameterOrder": [ + // "userId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "ID of the Thread to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/threads/{id}", + // "scopes": [ + // "https://mail.google.com/" + // ] + // } + +} + +// method id "gmail.users.threads.get": + +type UsersThreadsGetCall struct { + s *Service + userId string + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the specified thread. +func (r *UsersThreadsService) Get(userId string, id string) *UsersThreadsGetCall { + c := &UsersThreadsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.id = id + return c +} + +// Format sets the optional parameter "format": The format to return the +// messages in. +// +// Possible values: +// "full" (default) +// "metadata" +// "minimal" +func (c *UsersThreadsGetCall) Format(format string) *UsersThreadsGetCall { + c.opt_["format"] = format + return c +} + +// MetadataHeaders sets the optional parameter "metadataHeaders": When +// given and format is METADATA, only include headers specified. +func (c *UsersThreadsGetCall) MetadataHeaders(metadataHeaders string) *UsersThreadsGetCall { + c.opt_["metadataHeaders"] = metadataHeaders + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersThreadsGetCall) Fields(s ...googleapi.Field) *UsersThreadsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersThreadsGetCall) IfNoneMatch(entityTag string) *UsersThreadsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersThreadsGetCall) Context(ctx context.Context) *UsersThreadsGetCall { + c.ctx_ = ctx + return c +} + +func (c *UsersThreadsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["format"]; ok { + params.Set("format", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["metadataHeaders"]; ok { + params.Set("metadataHeaders", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/threads/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.threads.get" call. +// Exactly one of *Thread or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Thread.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersThreadsGetCall) Do() (*Thread, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Thread{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the specified thread.", + // "httpMethod": "GET", + // "id": "gmail.users.threads.get", + // "parameterOrder": [ + // "userId", + // "id" + // ], + // "parameters": { + // "format": { + // "default": "full", + // "description": "The format to return the messages in.", + // "enum": [ + // "full", + // "metadata", + // "minimal" + // ], + // "enumDescriptions": [ + // "", + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "id": { + // "description": "The ID of the thread to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "metadataHeaders": { + // "description": "When given and format is METADATA, only include headers specified.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/threads/{id}", + // "response": { + // "$ref": "Thread" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.modify", + // "https://www.googleapis.com/auth/gmail.readonly" + // ] + // } + +} + +// method id "gmail.users.threads.list": + +type UsersThreadsListCall struct { + s *Service + userId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the threads in the user's mailbox. +func (r *UsersThreadsService) List(userId string) *UsersThreadsListCall { + c := &UsersThreadsListCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + return c +} + +// IncludeSpamTrash sets the optional parameter "includeSpamTrash": +// Include threads from SPAM and TRASH in the results. +func (c *UsersThreadsListCall) IncludeSpamTrash(includeSpamTrash bool) *UsersThreadsListCall { + c.opt_["includeSpamTrash"] = includeSpamTrash + return c +} + +// LabelIds sets the optional parameter "labelIds": Only return threads +// with labels that match all of the specified label IDs. +func (c *UsersThreadsListCall) LabelIds(labelIds string) *UsersThreadsListCall { + c.opt_["labelIds"] = labelIds + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of threads to return. +func (c *UsersThreadsListCall) MaxResults(maxResults int64) *UsersThreadsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Page token to +// retrieve a specific page of results in the list. +func (c *UsersThreadsListCall) PageToken(pageToken string) *UsersThreadsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Q sets the optional parameter "q": Only return threads matching the +// specified query. Supports the same query format as the Gmail search +// box. For example, "from:someuser@example.com rfc822msgid: is:unread". +func (c *UsersThreadsListCall) Q(q string) *UsersThreadsListCall { + c.opt_["q"] = q + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersThreadsListCall) Fields(s ...googleapi.Field) *UsersThreadsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersThreadsListCall) IfNoneMatch(entityTag string) *UsersThreadsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersThreadsListCall) Context(ctx context.Context) *UsersThreadsListCall { + c.ctx_ = ctx + return c +} + +func (c *UsersThreadsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["includeSpamTrash"]; ok { + params.Set("includeSpamTrash", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["labelIds"]; ok { + params.Set("labelIds", 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_["q"]; ok { + params.Set("q", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/threads") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.threads.list" call. +// Exactly one of *ListThreadsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListThreadsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UsersThreadsListCall) Do() (*ListThreadsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListThreadsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the threads in the user's mailbox.", + // "httpMethod": "GET", + // "id": "gmail.users.threads.list", + // "parameterOrder": [ + // "userId" + // ], + // "parameters": { + // "includeSpamTrash": { + // "default": "false", + // "description": "Include threads from SPAM and TRASH in the results.", + // "location": "query", + // "type": "boolean" + // }, + // "labelIds": { + // "description": "Only return threads with labels that match all of the specified label IDs.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "Maximum number of threads to return.", + // "format": "uint32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Page token to retrieve a specific page of results in the list.", + // "location": "query", + // "type": "string" + // }, + // "q": { + // "description": "Only return threads matching the specified query. Supports the same query format as the Gmail search box. For example, \"from:someuser@example.com rfc822msgid: is:unread\".", + // "location": "query", + // "type": "string" + // }, + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/threads", + // "response": { + // "$ref": "ListThreadsResponse" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.modify", + // "https://www.googleapis.com/auth/gmail.readonly" + // ] + // } + +} + +// method id "gmail.users.threads.modify": + +type UsersThreadsModifyCall struct { + s *Service + userId string + id string + modifythreadrequest *ModifyThreadRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Modify: Modifies the labels applied to the thread. This applies to +// all messages in the thread. +func (r *UsersThreadsService) Modify(userId string, id string, modifythreadrequest *ModifyThreadRequest) *UsersThreadsModifyCall { + c := &UsersThreadsModifyCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.id = id + c.modifythreadrequest = modifythreadrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersThreadsModifyCall) Fields(s ...googleapi.Field) *UsersThreadsModifyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersThreadsModifyCall) Context(ctx context.Context) *UsersThreadsModifyCall { + c.ctx_ = ctx + return c +} + +func (c *UsersThreadsModifyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifythreadrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/threads/{id}/modify") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.threads.modify" call. +// Exactly one of *Thread or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Thread.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersThreadsModifyCall) Do() (*Thread, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Thread{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Modifies the labels applied to the thread. This applies to all messages in the thread.", + // "httpMethod": "POST", + // "id": "gmail.users.threads.modify", + // "parameterOrder": [ + // "userId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the thread to modify.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/threads/{id}/modify", + // "request": { + // "$ref": "ModifyThreadRequest" + // }, + // "response": { + // "$ref": "Thread" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.modify" + // ] + // } + +} + +// method id "gmail.users.threads.trash": + +type UsersThreadsTrashCall struct { + s *Service + userId string + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Trash: Moves the specified thread to the trash. +func (r *UsersThreadsService) Trash(userId string, id string) *UsersThreadsTrashCall { + c := &UsersThreadsTrashCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersThreadsTrashCall) Fields(s ...googleapi.Field) *UsersThreadsTrashCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersThreadsTrashCall) Context(ctx context.Context) *UsersThreadsTrashCall { + c.ctx_ = ctx + return c +} + +func (c *UsersThreadsTrashCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/threads/{id}/trash") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.threads.trash" call. +// Exactly one of *Thread or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Thread.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersThreadsTrashCall) Do() (*Thread, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Thread{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Moves the specified thread to the trash.", + // "httpMethod": "POST", + // "id": "gmail.users.threads.trash", + // "parameterOrder": [ + // "userId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the thread to Trash.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/threads/{id}/trash", + // "response": { + // "$ref": "Thread" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.modify" + // ] + // } + +} + +// method id "gmail.users.threads.untrash": + +type UsersThreadsUntrashCall struct { + s *Service + userId string + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Untrash: Removes the specified thread from the trash. +func (r *UsersThreadsService) Untrash(userId string, id string) *UsersThreadsUntrashCall { + c := &UsersThreadsUntrashCall{s: r.s, opt_: make(map[string]interface{})} + c.userId = userId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersThreadsUntrashCall) Fields(s ...googleapi.Field) *UsersThreadsUntrashCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersThreadsUntrashCall) Context(ctx context.Context) *UsersThreadsUntrashCall { + c.ctx_ = ctx + return c +} + +func (c *UsersThreadsUntrashCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{userId}/threads/{id}/untrash") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "gmail.users.threads.untrash" call. +// Exactly one of *Thread or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Thread.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UsersThreadsUntrashCall) Do() (*Thread, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Thread{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Removes the specified thread from the trash.", + // "httpMethod": "POST", + // "id": "gmail.users.threads.untrash", + // "parameterOrder": [ + // "userId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the thread to remove from Trash.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "userId": { + // "default": "me", + // "description": "The user's email address. The special value me can be used to indicate the authenticated user.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{userId}/threads/{id}/untrash", + // "response": { + // "$ref": "Thread" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.googleapis.com/auth/gmail.modify" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/docurls.go b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/docurls.go new file mode 100644 index 000000000..dee5bfe7a --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/docurls.go @@ -0,0 +1,156 @@ +// Copyright 2015 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 + +// canonicalDocsURL is a map from auto-generated documentation URL (originating from +// "documentationLink") to a valid (possibly through 301 redirect[s]) URL. +// If the auto-generated URL is not valid, then it maps to "" and will not +// be added to the auto-generated API comments. +// Note that this map is currently updated manually. +var canonicalDocsURL = map[string]string{ + "https://cloud.google.com/compute/docs/instance-groups/manager/#applying_rolling_updates_using_the_updater_servicerollingUpdates/cancel": "https://cloud.google.com/compute/docs/instance-groups/manager/#cancelrollingupdate", + "https://cloud.google.com/compute/docs/instance-groups/manager/#applying_rolling_updates_using_the_updater_servicerollingUpdates/get": "https://cloud.google.com/compute/docs/instance-groups/manager/#getlistrollingupdate", + "https://cloud.google.com/compute/docs/instance-groups/manager/#applying_rolling_updates_using_the_updater_servicerollingUpdates/insert": "https://cloud.google.com/compute/docs/instance-groups/manager/#starting_an_update", + "https://cloud.google.com/compute/docs/instance-groups/manager/#applying_rolling_updates_using_the_updater_servicerollingUpdates/list": "https://cloud.google.com/compute/docs/instance-groups/manager/#getlistrollingupdate", + "https://cloud.google.com/compute/docs/instance-groups/manager/#applying_rolling_updates_using_the_updater_servicerollingUpdates/listInstanceUpdates": "https://cloud.google.com/compute/docs/instance-groups/manager/#getlistrollingupdate", + "https://cloud.google.com/compute/docs/instance-groups/manager/#applying_rolling_updates_using_the_updater_servicerollingUpdates/pause": "https://cloud.google.com/compute/docs/instance-groups/manager/#pausing_a_rolling_update", + "https://cloud.google.com/compute/docs/instance-groups/manager/#applying_rolling_updates_using_the_updater_servicerollingUpdates/resume": "https://cloud.google.com/compute/docs/instance-groups/manager/#continuerollingupdate", + "https://cloud.google.com/compute/docs/instance-groups/manager/#applying_rolling_updates_using_the_updater_servicerollingUpdates/rollback": "https://cloud.google.com/compute/docs/instance-groups/manager/#rollingbackupdate", + + "https://developers.google.com/compute/docs/reference/latest/addresses/aggregatedList": "https://cloud.google.com/compute/docs/reference/latest/addresses/aggregatedList", + "https://developers.google.com/compute/docs/reference/latest/addresses/delete": "https://cloud.google.com/compute/docs/reference/latest/addresses/delete", + "https://developers.google.com/compute/docs/reference/latest/addresses/get": "https://cloud.google.com/compute/docs/reference/latest/addresses/get", + "https://developers.google.com/compute/docs/reference/latest/addresses/insert": "https://cloud.google.com/compute/docs/reference/latest/addresses/insert", + "https://developers.google.com/compute/docs/reference/latest/addresses/list": "https://cloud.google.com/compute/docs/reference/latest/addresses/list", + "https://developers.google.com/compute/docs/reference/latest/backendServices/delete": "https://cloud.google.com/compute/docs/reference/latest/backendServices/delete", + "https://developers.google.com/compute/docs/reference/latest/backendServices/get": "https://cloud.google.com/compute/docs/reference/latest/backendServices/get", + "https://developers.google.com/compute/docs/reference/latest/backendServices/getHealth": "https://cloud.google.com/compute/docs/reference/latest/backendServices/getHealth", + "https://developers.google.com/compute/docs/reference/latest/backendServices/insert": "https://cloud.google.com/compute/docs/reference/latest/backendServices/insert", + "https://developers.google.com/compute/docs/reference/latest/backendServices/list": "https://cloud.google.com/compute/docs/reference/latest/backendServices/list", + "https://developers.google.com/compute/docs/reference/latest/backendServices/patch": "https://cloud.google.com/compute/docs/reference/latest/backendServices/patch", + "https://developers.google.com/compute/docs/reference/latest/backendServices/update": "https://cloud.google.com/compute/docs/reference/latest/backendServices/update", + "https://developers.google.com/compute/docs/reference/latest/diskTypes/aggregatedList": "https://cloud.google.com/compute/docs/reference/latest/diskTypes/aggregatedList", + "https://developers.google.com/compute/docs/reference/latest/diskTypes/get": "https://cloud.google.com/compute/docs/reference/latest/diskTypes/get", + "https://developers.google.com/compute/docs/reference/latest/diskTypes/list": "https://cloud.google.com/compute/docs/reference/latest/diskTypes/list", + "https://developers.google.com/compute/docs/reference/latest/disks/aggregatedList": "https://cloud.google.com/compute/docs/reference/latest/disks/aggregatedList", + "https://developers.google.com/compute/docs/reference/latest/disks/createSnapshot": "https://cloud.google.com/compute/docs/reference/latest/disks/createSnapshot", + "https://developers.google.com/compute/docs/reference/latest/disks/delete": "https://cloud.google.com/compute/docs/reference/latest/disks/delete", + "https://developers.google.com/compute/docs/reference/latest/disks/get": "https://cloud.google.com/compute/docs/reference/latest/disks/get", + "https://developers.google.com/compute/docs/reference/latest/disks/insert": "https://cloud.google.com/compute/docs/reference/latest/disks/insert", + "https://developers.google.com/compute/docs/reference/latest/disks/list": "https://cloud.google.com/compute/docs/reference/latest/disks/list", + "https://developers.google.com/compute/docs/reference/latest/firewalls/delete": "https://cloud.google.com/compute/docs/reference/latest/firewalls/delete", + "https://developers.google.com/compute/docs/reference/latest/firewalls/get": "https://cloud.google.com/compute/docs/reference/latest/firewalls/get", + "https://developers.google.com/compute/docs/reference/latest/firewalls/insert": "https://cloud.google.com/compute/docs/reference/latest/firewalls/insert", + "https://developers.google.com/compute/docs/reference/latest/firewalls/list": "https://cloud.google.com/compute/docs/reference/latest/firewalls/list", + "https://developers.google.com/compute/docs/reference/latest/firewalls/patch": "https://cloud.google.com/compute/docs/reference/latest/firewalls/patch", + "https://developers.google.com/compute/docs/reference/latest/firewalls/update": "https://cloud.google.com/compute/docs/reference/latest/firewalls/update", + "https://developers.google.com/compute/docs/reference/latest/forwardingRules/aggregatedList": "https://cloud.google.com/compute/docs/reference/latest/forwardingRules/aggregatedList", + "https://developers.google.com/compute/docs/reference/latest/forwardingRules/delete": "https://cloud.google.com/compute/docs/reference/latest/forwardingRules/delete", + "https://developers.google.com/compute/docs/reference/latest/forwardingRules/get": "https://cloud.google.com/compute/docs/reference/latest/forwardingRules/get", + "https://developers.google.com/compute/docs/reference/latest/forwardingRules/insert": "https://cloud.google.com/compute/docs/reference/latest/forwardingRules/insert", + "https://developers.google.com/compute/docs/reference/latest/forwardingRules/list": "https://cloud.google.com/compute/docs/reference/latest/forwardingRules/list", + "https://developers.google.com/compute/docs/reference/latest/forwardingRules/setTarget": "https://cloud.google.com/compute/docs/reference/latest/forwardingRules/setTarget", + "https://developers.google.com/compute/docs/reference/latest/globalAddresses/delete": "https://cloud.google.com/compute/docs/reference/latest/globalAddresses/delete", + "https://developers.google.com/compute/docs/reference/latest/globalAddresses/get": "https://cloud.google.com/compute/docs/reference/latest/globalAddresses/get", + "https://developers.google.com/compute/docs/reference/latest/globalAddresses/insert": "https://cloud.google.com/compute/docs/reference/latest/globalAddresses/insert", + "https://developers.google.com/compute/docs/reference/latest/globalAddresses/list": "https://cloud.google.com/compute/docs/reference/latest/globalAddresses/list", + "https://developers.google.com/compute/docs/reference/latest/globalForwardingRules/delete": "https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/delete", + "https://developers.google.com/compute/docs/reference/latest/globalForwardingRules/get": "https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/get", + "https://developers.google.com/compute/docs/reference/latest/globalForwardingRules/insert": "https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/insert", + "https://developers.google.com/compute/docs/reference/latest/globalForwardingRules/list": "https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/list", + "https://developers.google.com/compute/docs/reference/latest/globalForwardingRules/setTarget": "https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/setTarget", + "https://developers.google.com/compute/docs/reference/latest/globalOperations/aggregatedList": "https://cloud.google.com/compute/docs/reference/latest/globalOperations/aggregatedList", + "https://developers.google.com/compute/docs/reference/latest/globalOperations/delete": "https://cloud.google.com/compute/docs/reference/latest/globalOperations/delete", + "https://developers.google.com/compute/docs/reference/latest/globalOperations/get": "https://cloud.google.com/compute/docs/reference/latest/globalOperations/get", + "https://developers.google.com/compute/docs/reference/latest/globalOperations/list": "https://cloud.google.com/compute/docs/reference/latest/globalOperations/list", + "https://developers.google.com/compute/docs/reference/latest/httpHealthChecks/delete": "https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/delete", + "https://developers.google.com/compute/docs/reference/latest/httpHealthChecks/get": "https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/get", + "https://developers.google.com/compute/docs/reference/latest/httpHealthChecks/insert": "https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/insert", + "https://developers.google.com/compute/docs/reference/latest/httpHealthChecks/list": "https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/list", + "https://developers.google.com/compute/docs/reference/latest/httpHealthChecks/patch": "https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/patch", + "https://developers.google.com/compute/docs/reference/latest/httpHealthChecks/update": "https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/update", + "https://developers.google.com/compute/docs/reference/latest/images/delete": "https://cloud.google.com/compute/docs/reference/latest/images/delete", + "https://developers.google.com/compute/docs/reference/latest/images/deprecate": "https://cloud.google.com/compute/docs/reference/latest/images/deprecate", + "https://developers.google.com/compute/docs/reference/latest/images/get": "https://cloud.google.com/compute/docs/reference/latest/images/get", + "https://developers.google.com/compute/docs/reference/latest/images/insert": "https://cloud.google.com/compute/docs/reference/latest/images/insert", + "https://developers.google.com/compute/docs/reference/latest/images/list": "https://cloud.google.com/compute/docs/reference/latest/images/list", + "https://developers.google.com/compute/docs/reference/latest/instanceTemplates/delete": "https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/delete", + "https://developers.google.com/compute/docs/reference/latest/instanceTemplates/get": "https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/get", + "https://developers.google.com/compute/docs/reference/latest/instanceTemplates/insert": "https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/insert", + "https://developers.google.com/compute/docs/reference/latest/instanceTemplates/list": "https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/list", + "https://developers.google.com/compute/docs/reference/latest/instances/addAccessConfig": "https://cloud.google.com/compute/docs/reference/latest/instances/addAccessConfig", + "https://developers.google.com/compute/docs/reference/latest/instances/aggregatedList": "https://cloud.google.com/compute/docs/reference/latest/instances/aggregatedList", + "https://developers.google.com/compute/docs/reference/latest/instances/attachDisk": "https://cloud.google.com/compute/docs/reference/latest/instances/attachDisk", + "https://developers.google.com/compute/docs/reference/latest/instances/delete": "https://cloud.google.com/compute/docs/reference/latest/instances/delete", + "https://developers.google.com/compute/docs/reference/latest/instances/deleteAccessConfig": "https://cloud.google.com/compute/docs/reference/latest/instances/deleteAccessConfig", + "https://developers.google.com/compute/docs/reference/latest/instances/detachDisk": "https://cloud.google.com/compute/docs/reference/latest/instances/detachDisk", + "https://developers.google.com/compute/docs/reference/latest/instances/get": "https://cloud.google.com/compute/docs/reference/latest/instances/get", + "https://developers.google.com/compute/docs/reference/latest/instances/getSerialPortOutput": "https://cloud.google.com/compute/docs/reference/latest/instances/getSerialPortOutput", + "https://developers.google.com/compute/docs/reference/latest/instances/insert": "https://cloud.google.com/compute/docs/reference/latest/instances/insert", + "https://developers.google.com/compute/docs/reference/latest/instances/list": "https://cloud.google.com/compute/docs/reference/latest/instances/list", + "https://developers.google.com/compute/docs/reference/latest/instances/reset": "https://cloud.google.com/compute/docs/reference/latest/instances/reset", + "https://developers.google.com/compute/docs/reference/latest/instances/setDiskAutoDelete": "https://cloud.google.com/compute/docs/reference/latest/instances/setDiskAutoDelete", + "https://developers.google.com/compute/docs/reference/latest/instances/setMetadata": "https://cloud.google.com/compute/docs/reference/latest/instances/setMetadata", + "https://developers.google.com/compute/docs/reference/latest/instances/setScheduling": "https://cloud.google.com/compute/docs/reference/latest/instances/setScheduling", + "https://developers.google.com/compute/docs/reference/latest/instances/setTags": "https://cloud.google.com/compute/docs/reference/latest/instances/setTags", + "https://developers.google.com/compute/docs/reference/latest/instances/start": "https://cloud.google.com/compute/docs/reference/latest/instances/start", + "https://developers.google.com/compute/docs/reference/latest/instances/stop": "https://cloud.google.com/compute/docs/reference/latest/instances/stop", + "https://developers.google.com/compute/docs/reference/latest/licenses/get": "https://cloud.google.com/compute/docs/reference/latest/licenses/get", + "https://developers.google.com/compute/docs/reference/latest/machineTypes/aggregatedList": "https://cloud.google.com/compute/docs/reference/latest/machineTypes/aggregatedList", + "https://developers.google.com/compute/docs/reference/latest/machineTypes/get": "https://cloud.google.com/compute/docs/reference/latest/machineTypes/get", + "https://developers.google.com/compute/docs/reference/latest/machineTypes/list": "https://cloud.google.com/compute/docs/reference/latest/machineTypes/list", + "https://developers.google.com/compute/docs/reference/latest/networks/delete": "https://cloud.google.com/compute/docs/reference/latest/networks/delete", + "https://developers.google.com/compute/docs/reference/latest/networks/get": "https://cloud.google.com/compute/docs/reference/latest/networks/get", + "https://developers.google.com/compute/docs/reference/latest/networks/insert": "https://cloud.google.com/compute/docs/reference/latest/networks/insert", + "https://developers.google.com/compute/docs/reference/latest/networks/list": "https://cloud.google.com/compute/docs/reference/latest/networks/list", + "https://developers.google.com/compute/docs/reference/latest/projects/get": "https://cloud.google.com/compute/docs/reference/latest/projects/get", + "https://developers.google.com/compute/docs/reference/latest/projects/setCommonInstanceMetadata": "https://cloud.google.com/compute/docs/reference/latest/projects/setCommonInstanceMetadata", + "https://developers.google.com/compute/docs/reference/latest/projects/setUsageExportBucket": "https://cloud.google.com/compute/docs/reference/latest/projects/setUsageExportBucket", + "https://developers.google.com/compute/docs/reference/latest/regionOperations/delete": "https://cloud.google.com/compute/docs/reference/latest/regionOperations/delete", + "https://developers.google.com/compute/docs/reference/latest/regionOperations/get": "https://cloud.google.com/compute/docs/reference/latest/regionOperations/get", + "https://developers.google.com/compute/docs/reference/latest/regionOperations/list": "https://cloud.google.com/compute/docs/reference/latest/regionOperations/list", + "https://developers.google.com/compute/docs/reference/latest/regions/get": "https://cloud.google.com/compute/docs/reference/latest/regions/get", + "https://developers.google.com/compute/docs/reference/latest/regions/list": "https://cloud.google.com/compute/docs/reference/latest/regions/list", + "https://developers.google.com/compute/docs/reference/latest/routes/delete": "https://cloud.google.com/compute/docs/reference/latest/routes/delete", + "https://developers.google.com/compute/docs/reference/latest/routes/get": "https://cloud.google.com/compute/docs/reference/latest/routes/get", + "https://developers.google.com/compute/docs/reference/latest/routes/insert": "https://cloud.google.com/compute/docs/reference/latest/routes/insert", + "https://developers.google.com/compute/docs/reference/latest/routes/list": "https://cloud.google.com/compute/docs/reference/latest/routes/list", + "https://developers.google.com/compute/docs/reference/latest/snapshots/delete": "https://cloud.google.com/compute/docs/reference/latest/snapshots/delete", + "https://developers.google.com/compute/docs/reference/latest/snapshots/get": "https://cloud.google.com/compute/docs/reference/latest/snapshots/get", + "https://developers.google.com/compute/docs/reference/latest/snapshots/list": "https://cloud.google.com/compute/docs/reference/latest/snapshots/list", + "https://developers.google.com/compute/docs/reference/latest/targetHttpProxies/delete": "https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/delete", + "https://developers.google.com/compute/docs/reference/latest/targetHttpProxies/get": "https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/get", + "https://developers.google.com/compute/docs/reference/latest/targetHttpProxies/insert": "https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/insert", + "https://developers.google.com/compute/docs/reference/latest/targetHttpProxies/list": "https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/list", + "https://developers.google.com/compute/docs/reference/latest/targetHttpProxies/setUrlMap": "https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/setUrlMap", + "https://developers.google.com/compute/docs/reference/latest/targetInstances/aggregatedList": "https://cloud.google.com/compute/docs/reference/latest/targetInstances/aggregatedList", + "https://developers.google.com/compute/docs/reference/latest/targetInstances/delete": "https://cloud.google.com/compute/docs/reference/latest/targetInstances/delete", + "https://developers.google.com/compute/docs/reference/latest/targetInstances/get": "https://cloud.google.com/compute/docs/reference/latest/targetInstances/get", + "https://developers.google.com/compute/docs/reference/latest/targetInstances/insert": "https://cloud.google.com/compute/docs/reference/latest/targetInstances/insert", + "https://developers.google.com/compute/docs/reference/latest/targetInstances/list": "https://cloud.google.com/compute/docs/reference/latest/targetInstances/list", + "https://developers.google.com/compute/docs/reference/latest/targetPools/addHealthCheck": "https://cloud.google.com/compute/docs/reference/latest/targetPools/addHealthCheck", + "https://developers.google.com/compute/docs/reference/latest/targetPools/addInstance": "https://cloud.google.com/compute/docs/reference/latest/targetPools/addInstance", + "https://developers.google.com/compute/docs/reference/latest/targetPools/aggregatedList": "https://cloud.google.com/compute/docs/reference/latest/targetPools/aggregatedList", + "https://developers.google.com/compute/docs/reference/latest/targetPools/delete": "https://cloud.google.com/compute/docs/reference/latest/targetPools/delete", + "https://developers.google.com/compute/docs/reference/latest/targetPools/get": "https://cloud.google.com/compute/docs/reference/latest/targetPools/get", + "https://developers.google.com/compute/docs/reference/latest/targetPools/getHealth": "https://cloud.google.com/compute/docs/reference/latest/targetPools/getHealth", + "https://developers.google.com/compute/docs/reference/latest/targetPools/insert": "https://cloud.google.com/compute/docs/reference/latest/targetPools/insert", + "https://developers.google.com/compute/docs/reference/latest/targetPools/list": "https://cloud.google.com/compute/docs/reference/latest/targetPools/list", + "https://developers.google.com/compute/docs/reference/latest/targetPools/removeHealthCheck": "https://cloud.google.com/compute/docs/reference/latest/targetPools/removeHealthCheck", + "https://developers.google.com/compute/docs/reference/latest/targetPools/removeInstance": "https://cloud.google.com/compute/docs/reference/latest/targetPools/removeInstance", + "https://developers.google.com/compute/docs/reference/latest/targetPools/setBackup": "https://cloud.google.com/compute/docs/reference/latest/targetPools/setBackup", + "https://developers.google.com/compute/docs/reference/latest/urlMaps/delete": "https://cloud.google.com/compute/docs/reference/latest/urlMaps/delete", + "https://developers.google.com/compute/docs/reference/latest/urlMaps/get": "https://cloud.google.com/compute/docs/reference/latest/urlMaps/get", + "https://developers.google.com/compute/docs/reference/latest/urlMaps/insert": "https://cloud.google.com/compute/docs/reference/latest/urlMaps/insert", + "https://developers.google.com/compute/docs/reference/latest/urlMaps/list": "https://cloud.google.com/compute/docs/reference/latest/urlMaps/list", + "https://developers.google.com/compute/docs/reference/latest/urlMaps/patch": "https://cloud.google.com/compute/docs/reference/latest/urlMaps/patch", + "https://developers.google.com/compute/docs/reference/latest/urlMaps/update": "https://cloud.google.com/compute/docs/reference/latest/urlMaps/update", + "https://developers.google.com/compute/docs/reference/latest/urlMaps/validate": "https://cloud.google.com/compute/docs/reference/latest/urlMaps/validate", + "https://developers.google.com/compute/docs/reference/latest/zoneOperations/delete": "https://cloud.google.com/compute/docs/reference/latest/zoneOperations/delete", + "https://developers.google.com/compute/docs/reference/latest/zoneOperations/get": "https://cloud.google.com/compute/docs/reference/latest/zoneOperations/get", + "https://developers.google.com/compute/docs/reference/latest/zoneOperations/list": "https://cloud.google.com/compute/docs/reference/latest/zoneOperations/list", + "https://developers.google.com/compute/docs/reference/latest/zones/get": "https://cloud.google.com/compute/docs/reference/latest/zones/get", + "https://developers.google.com/compute/docs/reference/latest/zones/list": "https://cloud.google.com/compute/docs/reference/latest/zones/list", +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/gen.go b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/gen.go new file mode 100644 index 000000000..37fed7598 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/gen.go @@ -0,0 +1,2326 @@ +// 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" + "regexp" + "sort" + "strconv" + "strings" + "unicode" +) + +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).") + apiPackageBase = flag.String("api_pkg_base", "google.golang.org/api", "Go package prefix to use for all generated APIs.") + + contextHTTPPkg = flag.String("ctxhttp_pkg", "golang.org/x/net/context/ctxhttp", "Go package path of the 'ctxhttp' package.") + contextPkg = flag.String("context_pkg", "golang.org/x/net/context", "Go package path of the 'context' package.") + googleapiPkg = flag.String("googleapi_pkg", "google.golang.org/api/googleapi", "Go package path of the 'api/googleapi' support package.") + internalPkg = flag.String("internal_pkg", "google.golang.org/api/internal", "Go package path of the 'api/internal' 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 + responseTypes map[string]bool + + p func(format string, args ...interface{}) // print raw + pn func(format string, args ...interface{}) // print with 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"` +} + +func (all *AllAPIs) addAPI(api string) { + parts := strings.Split(api, ":") + if len(parts) != 2 { + panicf("malformed API name: %q", api) + } + apiName := parts[0] + apiVersion := parts[1] + all.Items = append(all.Items, &API{ + ID: api, + Name: apiName, + Version: apiVersion, + DiscoveryLink: fmt.Sprintf("./apis/%s/%s/rest", apiName, apiVersion), + }) +} + +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 *jsonFile != "" { + // Return true early, before calling a.JSONFile() + // which will require a GOPATH be set. This is for + // integration with Google's build system genrules + // where there is no GOPATH. + return true + } + // Skip this API if we're in cached mode and the files don't exist on disk. + if *useCache { + if _, err := os.Stat(a.JSONFile()); os.IsNotExist(err) { + return false + } + } + return *apiToGenerate == "*" || *apiToGenerate == a.ID +} + +func getAPIs() []*API { + if *jsonFile != "" { + return getAPIsFromFile() + } + var all AllAPIs + var disco []byte + apiListFile := filepath.Join(genDirRoot(), "api-list.json") + if *useCache { + if !*publicOnly { + log.Fatalf("-cached=true not compatible with -publiconly=false") + } + var err error + disco, err = ioutil.ReadFile(apiListFile) + if err != nil { + log.Fatal(err) + } + } else { + disco = slurpURL(*apisURL) + if *publicOnly { + if err := writeFile(apiListFile, disco); err != nil { + log.Fatal(err) + } + } + } + if err := json.Unmarshal(disco, &all); err != nil { + log.Fatalf("error decoding JSON in %s: %v", *apisURL, err) + } + if !*publicOnly && *apiToGenerate != "*" { + all.addAPI(*apiToGenerate) + } + if *apiToGenerate == "*" { + // Force generation of compute:beta which doesn't appear in the + // directory for some reason, but they've asked us to include it. + all.addAPI("compute:beta") + } + 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) || basicallyEqual(existing, contents)) { + return nil + } + outdir := filepath.Dir(file) + if err = os.MkdirAll(outdir, 0755); err != nil { + return fmt.Errorf("failed to Mkdir %s: %v", outdir, err) + } + return ioutil.WriteFile(file, contents, 0644) +} + +var ignoreLines = regexp.MustCompile(`(?m)^\s+"(?:etag|revision)": ".+\n`) + +// basicallyEqual reports whether a and b are equal except for boring +// differences like ETag updates. +func basicallyEqual(a, b []byte) bool { + return ignoreLines.Match(a) && ignoreLines.Match(b) && + bytes.Equal(ignoreLines.ReplaceAll(a, nil), ignoreLines.ReplaceAll(b, nil)) +} + +func slurpURL(urlStr string) []byte { + if *useCache { + log.Fatalf("Invalid use of slurpURL in cached mode for URL %s", urlStr) + } + 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) + } + 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 +} + +// oddVersionRE matches unusual API names like directory_v1. +var oddVersionRE = regexp.MustCompile(`^(.+)_(v[\d\.]+)$`) + +// renameVersion conditionally rewrites the provided version such +// that the final path component of the import path doesn't look +// like a Go identifier. This keeps the consistency that import paths +// for the generated Go packages look like: +// google.golang.org/api/NAME/v +// and have package NAME. +// See https://github.com/google/google-api-go-client/issues/78 +func renameVersion(version string) string { + if version == "alpha" || version == "beta" { + return "v0." + version + } + if m := oddVersionRE.FindStringSubmatch(version); m != nil { + return m[1] + "/" + m[2] + } + return version +} + +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 genDirRoot() string { + if *genDir != "" { + return *genDir + } + paths := filepath.SplitList(os.Getenv("GOPATH")) + if len(paths) == 0 { + log.Fatalf("No GOPATH set.") + } + return filepath.Join(paths[0], "src", "google.golang.org", "api") +} + +func (a *API) SourceDir() string { + return filepath.Join(genDirRoot(), a.Package(), renameVersion(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("%s/%s/%s", *apiPackageBase, a.Package(), renameVersion(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 + } + if *useCache { + slurp, err := ioutil.ReadFile(a.JSONFile()) + if err != nil { + log.Fatal(err) + } + return slurp + } + return slurpURL(a.DiscoveryURL()) +} + +func (a *API) JSONFile() string { + return filepath.Join(a.SourceDir(), a.Package()+"-api.json") +} + +func (a *API) WriteGeneratedCode() error { + genfilename := *output + if genfilename == "" { + if err := writeFile(a.JSONFile(), a.jsonBytes()); err != nil { + return err + } + outdir := a.SourceDir() + err := os.MkdirAll(outdir, 0755) + if err != nil { + return fmt.Errorf("failed to Mkdir %s: %v", outdir, err) + } + pkg := a.Package() + genfilename = filepath.Join(outdir, pkg+"-gen.go") + } + + code, err := a.GenerateCode() + errw := writeFile(genfilename, code) + if err == nil { + err = errw + } + return err +} + +var docsLink string + +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 + } + // Because the Discovery JSON may not have all the fields populated that the actual + // API JSON has (e.g. rootUrl and servicePath), the API should be repopulated from + // the JSON here. + if err := json.Unmarshal(jsonBytes, a); err != nil { + return nil, err + } + + // Buffer the output in memory, for gofmt'ing later. + 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")) + docsLink = jstr(m, "documentationLink") + if docsLink != "" { + p("//\n") + p("// See %s\n", docsLink) + } + 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 // import %q\n", pkg, a.Target()) + p("\n") + p("import (\n") + for _, pkg := range []string{ + "bytes", + "encoding/json", + "errors", + "fmt", + "io", + "net/http", + "net/url", + "strconv", + "strings", + *contextHTTPPkg, + *contextPkg, + *googleapiPkg, + *internalPkg, + } { + 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("var _ = internal.MarshalJSON") + pn("var _ = context.Canceled") + pn("var _ = ctxhttp.Do") + 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") + pn("\tUserAgent string // optional additional User-Agent fragment") + + for _, res := range reslist { + p("\n\t%s\t*%s\n", res.GoField(), res.GoType()) + } + p("}\n") + pn("\nfunc (s *Service) userAgent() string {") + pn(` if s.UserAgent == "" { return googleapi.UserAgent }`) + pn(` return googleapi.UserAgent + " " + s.UserAgent`) + pn("}\n") + + for _, res := range reslist { + res.generateType() + } + + a.PopulateSchemas() + + a.responseTypes = make(map[string]bool) + for _, meth := range a.APIMethods() { + meth.cacheResponseTypes(a) + } + for _, res := range reslist { + res.cacheResponseTypes(a) + } + + for _, name := range a.sortedSchemaNames() { + a.schemas[name].writeSchemaCode(a) + } + + 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) { + const https = "https://" + if !strings.HasPrefix(urlStr, https) { + log.Fatalf("Unexpected oauth2 scope %q doesn't start with %q", urlStr, https) + } + ident := validGoIdentifer(depunct(urlStr[len(https):], true)) + "Scope" + return ident + } + 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 + goReturnType string // lazily populated by GoReturnType +} + +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) Default() string { + return jstr(p.m, "default") +} + +func (p *Property) Description() string { + return jstr(p.m, "description") +} + +func (p *Property) Enum() ([]string, bool) { + if enums := jstrlist(p.m, "enum"); enums != nil { + return enums, true + } + // Check if this has an array of string enums. + if items := jobj(p.m, "items"); items != nil { + if enums := jstrlist(items, "enum"); enums != nil && jstr(items, "type") == "string" { + return enums, true + } + } + return nil, false +} + +func (p *Property) EnumDescriptions() []string { + if desc := jstrlist(p.m, "enumDescriptions"); desc != nil { + return desc + } + // Check if this has an array of string enum descriptions. + if items := jobj(p.m, "items"); items != nil { + if desc := jstrlist(items, "enumDescriptions"); desc != nil { + return desc + } + } + return nil +} + +func (p *Property) Pattern() (string, bool) { + if s, ok := p.m["pattern"].(string); ok { + return s, true + } + return "", false +} + +// A FieldName uniquely identifies a field within a Schema struct for an API. +type fieldName struct { + api string // The ID of an API. + schema string // The Go name of a Schema struct. + field string // The Go name of a field. +} + +// pointerFields is a list of fields that should use a pointer type. +// This makes it possible to distinguish between a field being unset vs having +// an empty value. +var pointerFields = []fieldName{ + {api: "cloudmonitoring:v2beta2", schema: "Point", field: "BoolValue"}, + {api: "cloudmonitoring:v2beta2", schema: "Point", field: "DoubleValue"}, + {api: "cloudmonitoring:v2beta2", schema: "Point", field: "Int64Value"}, + {api: "cloudmonitoring:v2beta2", schema: "Point", field: "StringValue"}, + {api: "compute:v1", schema: "MetadataItems", field: "Value"}, + {api: "content:v2", schema: "AccountUser", field: "Admin"}, + {api: "datastore:v1beta2", schema: "Property", field: "BlobKeyValue"}, + {api: "datastore:v1beta2", schema: "Property", field: "BlobValue"}, + {api: "datastore:v1beta2", schema: "Property", field: "BooleanValue"}, + {api: "datastore:v1beta2", schema: "Property", field: "DateTimeValue"}, + {api: "datastore:v1beta2", schema: "Property", field: "DoubleValue"}, + {api: "datastore:v1beta2", schema: "Property", field: "Indexed"}, + {api: "datastore:v1beta2", schema: "Property", field: "IntegerValue"}, + {api: "datastore:v1beta2", schema: "Property", field: "StringValue"}, + {api: "genomics:v1beta2", schema: "Dataset", field: "IsPublic"}, + {api: "tasks:v1", schema: "Task", field: "Completed"}, + {api: "youtube:v3", schema: "ChannelSectionSnippet", field: "Position"}, +} + +// forcePointerType reports whether p should be represented as a pointer type in its parent schema struct. +func (p *Property) forcePointerType() bool { + if p.UnfortunateDefault() { + return true + } + + name := fieldName{api: p.s.api.ID, schema: p.s.GoName(), field: p.GoName()} + for _, pf := range pointerFields { + if pf == name { + return true + } + } + return false +} + +// UnfortunateDefault reports whether p may be set to a zero value, but has a non-zero default. +func (p *Property) UnfortunateDefault() bool { + switch p.Type().AsGo() { + default: + return false + + case "bool": + return p.Default() == "true" + + case "string": + if p.Default() == "" { + return false + } + // String fields are considered to "allow" a zero value if either: + // (a) they are an enum, and one of the permitted enum values is the empty string, or + // (b) they have a validation pattern which matches the empty string. + pattern, hasPat := p.Pattern() + enum, hasEnum := p.Enum() + if hasPat && hasEnum { + log.Printf("Encountered enum property which also has a pattern: %#v", p) + return false // don't know how to handle this, so ignore. + } + return (hasPat && emptyPattern(pattern)) || + (hasEnum && emptyEnum(enum)) + + case "float64", "int64", "uint64", "int32", "uint32": + if p.Default() == "" { + return false + } + if f, err := strconv.ParseFloat(p.Default(), 64); err == nil { + return f != 0.0 + } + // The default value has an unexpected form. Whatever it is, it's non-zero. + return true + } +} + +// emptyPattern reports whether a pattern matches the empty string. +func emptyPattern(pattern string) bool { + if re, err := regexp.Compile(pattern); err == nil { + return re.MatchString("") + } + log.Printf("Encountered bad pattern: %s", pattern) + return false +} + +// emptyEnum reports whether a property enum list contains the empty string. +func emptyEnum(enum []string) bool { + for _, val := range enum { + if val == "" { + return true + } + } + return false +} + +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 typ, ok := t.MapType(); ok { + return typ + } + isAny := t.IsAny() + if t.IsStruct() || isAny { + 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))) + } + if isAny { + return s.GoName() // interface type; no pointer. + } + if v := jobj(s.m, "variant"); v != nil { + return s.GoName() + } + 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) IsAny() bool { + if t.apiType() == "object" { + props := jobj(t.m, "additionalProperties") + if props != nil && jstr(props, "type") == "any" { + return true + } + } + return false +} + +func (t *Type) Reference() (apiName string, ok bool) { + apiName = jstr(t.m, "$ref") + ok = apiName != "" + return +} + +func (t *Type) IsMap() bool { + _, ok := t.MapType() + return ok +} + +// MapType checks if the current node is a map and if true, it returns the Go type for the map, such as map[string]string. +func (t *Type) MapType() (typ string, ok bool) { + props := jobj(t.m, "additionalProperties") + if props == nil { + return "", false + } + s := jstr(props, "type") + if s == "any" { + return "", false + } + if s == "string" { + return "map[string]string", true + } + if s != "array" { + if s == "" { // Check for reference + s = jstr(props, "$ref") + if s != "" { + return "map[string]" + s, true + } + } + if s == "any" { + return "map[string]interface{}", true + } + log.Printf("Warning: found map to type %q which is not implemented yet.", s) + return "", false + } + items := jobj(props, "items") + if items == nil { + return "", false + } + s = jstr(items, "type") + if s != "string" { + if s == "" { // Check for reference + s = jstr(items, "$ref") + if s != "" { + return "map[string][]" + s, true + } + } + log.Printf("Warning: found map of arrays of type %q which is not implemented yet.", s) + return "", false + } + return "map[string][]string", true +} + +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 == "" { + if name, ok := s.Type().MapType(); ok { + s.goName = name + } else { + s.goName = s.api.GetName(initialCap(s.apiName)) + } + } + return s.goName +} + +// GoReturnType returns the Go type to use as the return type. +// If a type is a struct, it will return *StructType, +// for a map it will return map[string]ValueType, +// for (not yet supported) slices it will return []ValueType. +func (s *Schema) GoReturnType() string { + if s.goReturnType == "" { + if s.Type().IsMap() { + s.goReturnType = s.GoName() + } else { + s.goReturnType = "*" + s.GoName() + } + } + return s.goReturnType +} + +func (s *Schema) writeSchemaCode(api *API) { + if s.Type().IsAny() { + s.api.p("\ntype %s interface{}\n", s.GoName()) + return + } + if s.Type().IsStruct() && !s.Type().IsMap() { + s.writeSchemaStruct(api) + 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() { + apitype := jstr(s.m, "type") + typ := mustSimpleTypeConvert(apitype, jstr(s.m, "format")) + s.api.p("\ntype %s %s\n", s.GoName(), typ) + return + } + + if 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) writeVariant(api *API, v map[string]interface{}) { + s.api.p("\ntype %s map[string]interface{}\n\n", s.GoName()) + + // Write out the "Type" method that identifies the variant type. + s.api.p("func (t %s) Type() string {\n", s.GoName()) + s.api.p(" return googleapi.VariantType(t)\n") + s.api.p("}\n\n") + + // Write out helper methods to convert each possible variant. + for _, m := range jobjlist(v, "map") { + val := jstr(m, "type_value") + reftype := jstr(m, "$ref") + if val == "" && reftype == "" { + log.Printf("TODO variant %s ref %s not yet supported.", val, reftype) + continue + } + + _, ok := api.schemas[reftype] + if !ok { + log.Printf("TODO variant %s ref %s not yet supported.", val, reftype) + continue + } + + s.api.p("func (t %s) %s() (r %s, ok bool) {\n", s.GoName(), initialCap(val), reftype) + s.api.p(" if t.Type() != %q {\n", initialCap(val)) + s.api.p(" return r, false\n") + s.api.p(" }\n") + s.api.p(" ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)\n") + s.api.p(" return r, ok\n") + s.api.p("}\n\n") + } +} + +func (s *Schema) Description() string { + return jstr(s.m, "description") +} + +func (s *Schema) writeSchemaStruct(api *API) { + if v := jobj(s.m, "variant"); v != nil { + s.writeVariant(api, v) + return + } + s.api.p("\n") + des := s.Description() + if des != "" { + s.api.p("%s", asComment("", fmt.Sprintf("%s: %s", s.GoName(), des))) + } + s.api.p("type %s struct {\n", s.GoName()) + + np := new(namePool) + forceSendName := np.Get("ForceSendFields") + if s.isResponseType() { + np.Get("ServerResponse") // reserve the name + } + + firstFieldName := "" // used to store a struct field name for use in documentation. + for i, p := range s.properties() { + if i > 0 { + s.api.p("\n") + } + pname := np.Get(p.GoName()) + des := p.Description() + if des != "" { + s.api.p("%s", asComment("\t", fmt.Sprintf("%s: %s", pname, des))) + } + addFieldValueComments(s.api.p, p, "\t", des != "") + + var extraOpt string + if p.Type().isIntAsString() { + extraOpt += ",string" + } + + typ := p.Type().AsGo() + if p.forcePointerType() { + typ = "*" + typ + } + + s.api.p("\t%s %s `json:\"%s,omitempty%s\"`\n", pname, typ, p.APIName(), extraOpt) + if firstFieldName == "" { + firstFieldName = pname + } + } + + if s.isResponseType() { + if firstFieldName != "" { + s.api.p("\n") + } + s.api.p("%s", asComment("\t", "ServerResponse contains the HTTP response code and headers from the server.")) + s.api.p("\tgoogleapi.ServerResponse `json:\"-\"`\n") + } + + if firstFieldName == "" { + // There were no fields in the struct, so there is no point + // adding any custom JSON marshaling code. + s.api.pn("}") + return + } + + commentFmtStr := "%s is a list of field names (e.g. %q) to " + + "unconditionally include in API requests. By default, fields " + + "with empty values are omitted from API requests. However, " + + "any non-pointer, non-interface field appearing in %s will " + + "be sent to the server regardless of whether the field is " + + "empty or not. This may be used to include empty fields in " + + "Patch requests." + comment := fmt.Sprintf(commentFmtStr, forceSendName, firstFieldName, forceSendName) + s.api.p("\n") + s.api.p("%s", asComment("\t", comment)) + + s.api.pn("\t%s []string `json:\"-\"`", forceSendName) + s.api.pn("}") + s.writeSchemaMarshal(forceSendName) + return +} + +// writeSchemaMarshal writes a custom MarshalJSON function for s, which allows +// fields to be explicitly transmitted by listing them in the field identified +// by forceSendFieldName. +func (s *Schema) writeSchemaMarshal(forceSendFieldName string) { + s.api.pn("func (s *%s) MarshalJSON() ([]byte, error) {", s.GoName()) + s.api.pn("\ttype noMethod %s", s.GoName()) + // pass schema as methodless type to prevent subsequent calls to MarshalJSON from recursing indefinitely. + s.api.pn("\traw := noMethod(*s)") + s.api.pn("\treturn internal.MarshalJSON(raw, s.%s)", forceSendFieldName) + s.api.pn("}") +} + +// isResponseType returns true for all types that are used as a response. +func (s *Schema) isResponseType() bool { + return s.api.responseTypes["*"+s.goName] +} + +// 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) cacheResponseTypes(api *API) { + for _, meth := range r.Methods() { + meth.cacheResponseTypes(api) + } + for _, res := range r.resources { + res.cacheResponseTypes(api) + } +} + +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) supportsMediaUpload() bool { + return jobj(m.m, "mediaUpload") != nil +} + +func (m *Method) mediaUploadPath() string { + return jstr(jobj(jobj(jobj(m.m, "mediaUpload"), "protocols"), "simple"), "path") +} + +func (m *Method) supportsMediaDownload() bool { + if m.supportsMediaUpload() { + // storage.objects.insert claims support for download in + // addition to upload but attempting to do so fails. + // This situation doesn't apply to any other methods. + return false + } + if v, ok := m.m["supportsMediaDownload"].(bool); ok { + return v + } + return false +} + +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) cacheResponseTypes(api *API) { + if retType := responseType(api, meth.m); retType != "" && strings.HasPrefix(retType, "*") { + api.responseTypes[retType] = true + } +} + +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()) + + retType := responseType(a, meth.m) + retTypeComma := retType + 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.supportsMediaUpload() { + p("\tmedia_ io.Reader\n") + p("\tresumable_ googleapi.SizeReaderAt\n") + p("\tmediaType_ string\n") + p("\tprotocol_ string\n") + } + p("\tctx_ context.Context\n") + p("}\n") + + p("\n%s", asComment("", methodName+": "+jstr(meth.m, "description"))) + if res != nil { + if url := canonicalDocsURL[fmt.Sprintf("%v%v/%v", docsLink, res.name, meth.name)]; url != "" { + pn("// For details, see %v", url) + } + } + + 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))) + addFieldValueComments(p, opt, "", true) + 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.supportsMediaUpload() { + pn("\n// Media specifies the media to upload in a single chunk.") + pn("// At most one of Media and ResumableMedia may be set.") + pn("func (c *%s) Media(r io.Reader) *%s {", callName, callName) + pn("c.media_ = r") + pn(`c.protocol_ = "multipart"`) + pn("return c") + pn("}") + pn("\n// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx.") + pn("// At most one of Media and ResumableMedia may be set.") + pn(`// mediaType identifies the MIME media type of the upload, such as "image/png".`) + pn(`// If mediaType is "", it will be auto-detected.`) + pn(`// The provided ctx will supersede any context previously provided to `) + pn(`// the Context method.`) + pn("func (c *%s) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *%s {", callName, callName) + pn("c.ctx_ = ctx") + pn("c.resumable_ = io.NewSectionReader(r, 0, size)") + pn("c.mediaType_ = mediaType") + pn(`c.protocol_ = "resumable"`) + pn("return c") + pn("}") + pn("\n// ProgressUpdater provides a callback function that will be called after every chunk.") + pn("// It should be a low-latency function in order to not slow down the upload operation.") + pn("// This should only be called when using ResumableMedia (as opposed to Media).") + pn("func (c *%s) ProgressUpdater(pu googleapi.ProgressUpdater) *%s {", callName, callName) + pn(`c.opt_["progressUpdater"] = pu`) + pn("return c") + pn("}") + } + + pn("\n// Fields allows partial responses to be retrieved.") + pn("// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse") + pn("// for more information.") + pn("func (c *%s) Fields(s ...googleapi.Field) *%s {", callName, callName) + pn(`c.opt_["fields"] = googleapi.CombineFields(s)`) + pn("return c") + pn("}") + httpMethod := jstr(meth.m, "httpMethod") + if httpMethod == "GET" { + // Note that non-GET responses are excluded from supporting If-None-Match. + // See https://github.com/google/google-api-go-client/issues/107 for more info. + comment := "IfNoneMatch sets the optional parameter which makes the operation fail if " + + "the object's ETag matches the given value. This is useful for getting updates " + + "only after the object has changed since the last request. " + + "Use googleapi.IsNotModified to check whether the response error from Do " + + "is the result of In-None-Match." + p("\n%s", asComment("", comment)) + pn("func (c *%s) IfNoneMatch(entityTag string) *%s {", callName, callName) + pn(`c.opt_["ifNoneMatch"] = entityTag`) + pn("return c") + pn("}") + } + + doMethod := "Do method" + if meth.supportsMediaDownload() { + doMethod = "Do and Download methods" + } + pn("\n// Context sets the context to be used in this call's %s.", doMethod) + pn("// Any pending HTTP request will be aborted if the provided context") + pn("// is canceled.") + if meth.supportsMediaUpload() { + pn("// This context will supersede any context previously provided to ") + pn("// the ResumableMedia method.") + } + pn("func (c *%s) Context(ctx context.Context) *%s {", callName, callName) + pn(`c.ctx_ = ctx`) + pn("return c") + pn("}") + + pn("\nfunc (c *%s) doRequest(alt string) (*http.Response, error) {", callName) + pn("var body io.Reader = nil") + hasContentType := false + 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 nil, err }") + pn(`ctype := "application/json"`) + hasContentType = true + } + pn("params := make(url.Values)") + pn(`params.Set("alt", alt)`) + 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) + } + opts := meth.OptParams() + opts = append(opts, &Param{name: "fields"}) + for _, p := range opts { + 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.supportsMediaUpload() { + pn("if c.media_ != nil || c.resumable_ != nil {") + // Hack guess, since we get a 404 otherwise: + //pn("urls = googleapi.ResolveRelative(%q, %q)", a.apiBaseURL(), meth.mediaUploadPath()) + // 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", c.protocol_)`) + pn("}") + } + pn("urls += \"?\" + params.Encode()") + if meth.supportsMediaUpload() && httpMethod != "GET" { + if !hasContentType { // Support mediaUpload but no ctype set. + pn("body = new(bytes.Buffer)") + pn(`ctype := "application/json"`) + hasContentType = true + } + pn(`if c.protocol_ != "resumable" {`) + pn(` var cancel func()`) + pn(" cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype)") + pn(" if cancel != nil { defer cancel() }") + pn("}") + } + 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 '/'. + argsForLocation := args.forLocation("path") + if len(argsForLocation) > 0 { + pn(`googleapi.Expand(req.URL, map[string]string{`) + for _, arg := range argsForLocation { + pn(`"%s": %s,`, arg.apiname, arg.exprAsString("c.")) + } + pn(`})`) + } else { + // Just call SetOpaque since we aren't calling Expand + pn(`googleapi.SetOpaque(req.URL)`) + } + + if meth.supportsMediaUpload() { + pn(`if c.protocol_ == "resumable" {`) + pn(` if c.mediaType_ == "" {`) + pn(" c.mediaType_ = googleapi.DetectMediaType(c.resumable_)") + pn(" }") + pn(` req.Header.Set("X-Upload-Content-Type", c.mediaType_)`) + pn(` req.Header.Set("Content-Type", "application/json; charset=utf-8")`) + pn("} else {") + pn(` req.Header.Set("Content-Type", ctype)`) + pn("}") + } else if hasContentType { + pn(`req.Header.Set("Content-Type", ctype)`) + } + pn(`req.Header.Set("User-Agent", c.s.userAgent())`) + if httpMethod == "GET" { + pn(`if v, ok := c.opt_["ifNoneMatch"]; ok {`) + pn(" req.Header.Set(\"If-None-Match\", fmt.Sprintf(\"%%v\", v))") + pn("}") + } + pn("if c.ctx_ != nil {") + pn(" return ctxhttp.Do(c.ctx_, c.s.client, req)") + pn("}") + pn("return c.s.client.Do(req)") + pn("}") + + if meth.supportsMediaDownload() { + pn("\n// Download fetches the API endpoint's \"media\" value, instead of the normal") + pn("// API response value. If the returned error is nil, the Response is guaranteed to") + pn("// have a 2xx status code. Callers must close the Response.Body as usual.") + pn("func (c *%s) Download() (*http.Response, error) {", callName) + pn(`res, err := c.doRequest("media")`) + pn("if err != nil { return nil, err }") + pn("if err := googleapi.CheckMediaResponse(res); err != nil {") + pn("res.Body.Close()") + pn("return nil, err") + pn("}") + pn("return res, nil") + pn("}") + } + + mapRetType := strings.HasPrefix(retTypeComma, "map[") + pn("\n// Do executes the %q call.", jstr(meth.m, "id")) + if retTypeComma != "" && !mapRetType { + commentFmtStr := "Exactly one of %v or error will be non-nil. " + + "Any non-2xx status code is an error. " + + "Response headers are in either %v.ServerResponse.Header " + + "or (if a response was returned at all) in error.(*googleapi.Error).Header. " + + "Use googleapi.IsNotModified to check whether the returned error was because " + + "http.StatusNotModified was returned." + comment := fmt.Sprintf(commentFmtStr, retType, retType) + p("%s", asComment("", comment)) + } + pn("func (c *%s) Do() (%serror) {", callName, retTypeComma) + nilRet := "" + if retTypeComma != "" { + nilRet = "nil, " + } + pn(`res, err := c.doRequest("json")`) + if retTypeComma != "" && !mapRetType { + pn("if res != nil && res.StatusCode == http.StatusNotModified {") + pn(" if res.Body != nil { res.Body.Close() }") + pn(" return nil, &googleapi.Error{") + pn(" Code: res.StatusCode,") + pn(" Header: res.Header,") + pn(" }") + pn("}") + } + pn("if err != nil { return %serr }", nilRet) + pn("defer googleapi.CloseBody(res)") + pn("if err := googleapi.CheckResponse(res); err != nil { return %serr }", nilRet) + if meth.supportsMediaUpload() { + pn("var progressUpdater_ googleapi.ProgressUpdater") + pn("if v, ok := c.opt_[\"progressUpdater\"]; ok {") + pn(" if pu, ok := v.(googleapi.ProgressUpdater); ok {") + pn(" progressUpdater_ = pu") + pn(" }") + pn("}") + pn(`if c.protocol_ == "resumable" {`) + pn(` loc := res.Header.Get("Location")`) + pn(" rx := &googleapi.ResumableUpload{") + pn(" Client: c.s.client,") + pn(" UserAgent: c.s.userAgent(),") + pn(" URI: loc,") + pn(" Media: c.resumable_,") + pn(" MediaType: c.mediaType_,") + pn(" ContentLength: c.resumable_.Size(),") + pn(" Callback: progressUpdater_,") + pn(" }") + pn(" res, err = rx.Upload(c.ctx_)") + pn(" if err != nil { return %serr }", nilRet) + pn(" defer res.Body.Close()") + pn("}") + } + if retTypeComma == "" { + pn("return nil") + } else { + if mapRetType { + pn("var ret %s", responseType(a, meth.m)) + } else { + pn("ret := &%s{", responseTypeLiteral(a, meth.m)) + pn(" ServerResponse: googleapi.ServerResponse{") + pn(" Header: res.Header,") + pn(" HTTPStatusCode: res.StatusCode,") + pn(" },") + pn("}") + } + 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("}") +} + +// A Field provides methods that describe the characteristics of a Param or Property. +type Field interface { + Default() string + Enum() ([]string, bool) + EnumDescriptions() []string + UnfortunateDefault() bool +} + +type Param struct { + method *Method + name string + m map[string]interface{} + callFieldName string // empty means to use the default +} + +func (p *Param) Default() string { + return jstr(p.m, "default") +} + +func (p *Param) Enum() ([]string, bool) { + if e := jstrlist(p.m, "enum"); e != nil { + return e, true + } + return nil, false +} + +func (p *Param) EnumDescriptions() []string { + return jstrlist(p.m, "enumDescriptions") +} + +func (p *Param) UnfortunateDefault() bool { + // We do not do anything special for Params with unfortunate defaults. + return false +} + +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) exprAsString(prefix string) string { + switch a.gotype { + case "[]string": + log.Printf("TODO(bradfitz): only including the first parameter in path query.") + return prefix + a.goname + `[0]` + case "string": + return 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() +} + +var urlRE = regexp.MustCompile(`^http\S+$`) + +func asComment(pfx, c string) string { + var buf bytes.Buffer + const maxLen = 70 + r := strings.NewReplacer( + "\n", "\n"+pfx+"// ", + "`\"", `"`, + "\"`", `"`, + ) + for len(c) > 0 { + line := c + if len(line) < maxLen { + fmt.Fprintf(&buf, "%s// %s\n", pfx, r.Replace(line)) + break + } + // Don't break URLs. + if !urlRE.MatchString(line[:maxLen]) { + line = line[:maxLen] + } + si := strings.LastIndex(line, " ") + if nl := strings.Index(line, "\n"); nl != -1 && nl < si { + si = nl + } + if si != -1 { + line = line[:si] + } + fmt.Fprintf(&buf, "%s// %s\n", pfx, r.Replace(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.GoReturnType() + } + return "*" + ref + } + } + return "" +} + +// Strips the leading '*' from a type name so that it can be used to create a literal. +func responseTypeLiteral(api *API, m map[string]interface{}) string { + v := responseType(api, m) + if strings.HasPrefix(v, "*") { + return v[1:] + } + return v +} + +// 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. Multiple '_' are preserved. +func depunct(ident string, needCap bool) string { + var buf bytes.Buffer + preserve_ := false + for i, c := range ident { + if c == '_' { + if preserve_ || strings.HasPrefix(ident[i:], "__") { + preserve_ = true + } else { + needCap = true + continue + } + } else { + preserve_ = false + } + 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 jobjlist(m map[string]interface{}, key string) []map[string]interface{} { + si, ok := m[key].([]interface{}) + if !ok { + return nil + } + var sl []map[string]interface{} + for _, si := range si { + sl = append(sl, si.(map[string]interface{})) + } + return sl +} + +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 +} + +func addFieldValueComments(p func(format string, args ...interface{}), field Field, indent string, blankLine bool) { + var lines []string + + if enum, ok := field.Enum(); ok { + desc := field.EnumDescriptions() + lines = append(lines, asComment(indent, "Possible values:")) + defval := field.Default() + for i, v := range enum { + more := "" + if v == defval { + more = " (default)" + } + if len(desc) > i && desc[i] != "" { + more = more + " - " + desc[i] + } + lines = append(lines, asComment(indent, ` "`+v+`"`+more)) + } + } else if field.UnfortunateDefault() { + lines = append(lines, asComment("\t", fmt.Sprintf("Default: %s", field.Default()))) + } + if blankLine && len(lines) > 0 { + p(indent + "//\n") + } + for _, l := range lines { + p("%s", l) + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/gen_test.go b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/gen_test.go new file mode 100644 index 000000000..44ca3311a --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/gen_test.go @@ -0,0 +1,175 @@ +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{ + "any", + "arrayofarray-1", + "arrayofenum", + "arrayofmapofobjects", + "arrayofmapofstrings", + "blogger-3", + "getwithoutbody", + "mapofany", + "mapofarrayofobjects", + "mapofobjects", + "mapofstrings-1", + "quotednum", + "resource-named-service", // blogger/v3/blogger-api.json + s/BlogUserInfo/Service/ + "unfortunatedefaults", + "variants", + "wrapnewlines", + } + 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()) + } + } +} + +func TestScope(t *testing.T) { + tests := [][]string{ + { + "https://www.googleapis.com/auth/somescope", + "SomescopeScope", + }, + { + "https://mail.google.com/somescope", + "MailGoogleComSomescopeScope", + }, + { + "https://mail.google.com/", + "MailGoogleComScope", + }, + } + for _, test := range tests { + if got := scopeIdentifierFromURL(test[0]); got != test[1] { + t.Errorf("scopeIdentifierFromURL(%q) got %q, want %q", test[0], got, test[1]) + } + } +} + +func TestDepunct(t *testing.T) { + tests := []struct { + needCap bool + in, want string + }{ + { + needCap: true, + in: "part__description", + want: "Part__description", + }, + { + needCap: true, + in: "Part_description", + want: "PartDescription", + }, + { + needCap: false, + in: "part_description", + want: "partDescription", + }, + { + needCap: false, + in: "part-description", + want: "partDescription", + }, + { + needCap: false, + in: "part.description", + want: "partDescription", + }, + { + needCap: false, + in: "part$description", + want: "partDescription", + }, + { + needCap: false, + in: "part/description", + want: "partDescription", + }, + { + needCap: true, + in: "Part__description_name", + want: "Part__descriptionName", + }, + { + needCap: true, + in: "Part_description_name", + want: "PartDescriptionName", + }, + { + needCap: true, + in: "Part__description__name", + want: "Part__description__name", + }, + { + needCap: true, + in: "Part_description__name", + want: "PartDescription__name", + }, + } + for _, test := range tests { + if got := depunct(test.in, test.needCap); got != test.want { + t.Errorf("depunct(%q,%v) = %q; want %q", test.in, test.needCap, got, test.want) + } + } +} + +func TestRenameVersion(t *testing.T) { + tests := []struct { + version, want string + }{ + { + version: "directory_v1", + want: "directory/v1", + }, + { + version: "email_migration_v1", + want: "email_migration/v1", + }, + { + version: "my_api_v1.2", + want: "my_api/v1.2", + }, + } + for _, test := range tests { + if got := renameVersion(test.version); got != test.want { + t.Errorf("renameVersion(%q) = %q; want %q", test.version, got, test.want) + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/storage_test.go b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/storage_test.go new file mode 100644 index 000000000..1cfc437ea --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/storage_test.go @@ -0,0 +1,323 @@ +package main + +import ( + "fmt" + "io/ioutil" + "net/http" + "net/http/httptest" + "strings" + "testing" + "testing/iotest" + + "golang.org/x/net/context" + storage "google.golang.org/api/storage/v1" +) + +type myHandler struct { + location string + r *http.Request + body []byte + err error +} + +func (h *myHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { + h.r = r + if h.location != "" { + w.Header().Set("Location", h.location) + } + h.body, h.err = ioutil.ReadAll(r.Body) + fmt.Fprintf(w, "{}") +} + +func TestMedia(t *testing.T) { + handler := &myHandler{} + server := httptest.NewServer(handler) + defer server.Close() + + client := &http.Client{} + s, err := storage.New(client) + if err != nil { + t.Fatalf("unable to create service: %v", err) + } + s.BasePath = server.URL + + const body = "fake media data" + f := strings.NewReader(body) + o := &storage.Object{ + Bucket: "mybucket", + Name: "filename", + ContentType: "plain/text", + ContentEncoding: "utf-8", + ContentLanguage: "en", + } + _, err = s.Objects.Insert("mybucket", o).Media(f).Do() + if err != nil { + t.Fatalf("unable to insert object: %v", err) + } + g := handler.r + if w := "POST"; g.Method != w { + t.Errorf("Method = %q; want %q", g.Method, w) + } + if w := "HTTP/1.1"; g.Proto != w { + t.Errorf("Proto = %q; want %q", g.Proto, w) + } + if w := 1; g.ProtoMajor != w { + t.Errorf("ProtoMajor = %v; want %v", g.ProtoMajor, w) + } + if w := 1; g.ProtoMinor != w { + t.Errorf("ProtoMinor = %v; want %v", g.ProtoMinor, w) + } + if w, k := "google-api-go-client/0.5", "User-Agent"; len(g.Header[k]) != 1 || g.Header[k][0] != w { + t.Errorf("header %q = %#v; want %q", k, g.Header[k], w) + } + if w, k := "multipart/related; boundary=", "Content-Type"; len(g.Header[k]) != 1 || !strings.HasPrefix(g.Header[k][0], w) { + t.Errorf("header %q = %#v; want %q", k, g.Header[k], w) + } + if w, k := "gzip", "Accept-Encoding"; len(g.Header[k]) != 1 || g.Header[k][0] != w { + t.Errorf("header %q = %#v; want %q", k, g.Header[k], w) + } + if w := int64(-1); g.ContentLength != w { + t.Errorf("ContentLength = %v; want %v", g.ContentLength, w) + } + if w := "chunked"; len(g.TransferEncoding) != 1 || g.TransferEncoding[0] != w { + t.Errorf("TransferEncoding = %#v; want %q", g.TransferEncoding, w) + } + if w := strings.TrimPrefix(s.BasePath, "http://"); g.Host != w { + t.Errorf("Host = %q; want %q", g.Host, w) + } + if g.Form != nil { + t.Errorf("Form = %#v; want nil", g.Form) + } + if g.PostForm != nil { + t.Errorf("PostForm = %#v; want nil", g.PostForm) + } + if g.MultipartForm != nil { + t.Errorf("MultipartForm = %#v; want nil", g.MultipartForm) + } + if w := s.BasePath + "/b/mybucket/o?alt=json&uploadType=multipart"; g.RequestURI != w { + t.Errorf("RequestURI = %q; want %q", g.RequestURI, w) + } + if w := "\r\n\r\n" + body + "\r\n"; !strings.Contains(string(handler.body), w) { + t.Errorf("Body = %q, want substring %q", handler.body, w) + } + if handler.err != nil { + t.Errorf("handler err = %v, want nil", handler.err) + } +} + +func TestResumableMedia(t *testing.T) { + handler := &myHandler{} + server := httptest.NewServer(handler) + defer server.Close() + + handler.location = server.URL + client := &http.Client{} + s, err := storage.New(client) + if err != nil { + t.Fatalf("unable to create service: %v", err) + } + s.BasePath = server.URL + + const data = "fake resumable media data" + f := strings.NewReader(data) + o := &storage.Object{ + Bucket: "mybucket", + Name: "filename", + ContentType: "plain/text", + ContentEncoding: "utf-8", + ContentLanguage: "en", + } + // If all goes well, this will cause two POST requests to be sent to our fake GCS server: + // 1. Resumable upload session initiation request, to which server will respond with 200 OK and Location header. + // 2. Upload of the first and only chunk, with Content-Range header set to specify entire content. + // The test below verifies the content and headers of this second POST request. + _, err = s.Objects.Insert("mybucket", o).Name("filename").ResumableMedia(context.Background(), f, int64(len(data)), "text/plain").Do() + if err != nil { + t.Fatalf("unable to insert object: %v", err) + } + g := handler.r + if w := "POST"; g.Method != w { + t.Errorf("Method = %q; want %q", g.Method, w) + } + if w := "HTTP/1.1"; g.Proto != w { + t.Errorf("Proto = %q; want %q", g.Proto, w) + } + if w := 1; g.ProtoMajor != w { + t.Errorf("ProtoMajor = %v; want %v", g.ProtoMajor, w) + } + if w := 1; g.ProtoMinor != w { + t.Errorf("ProtoMinor = %v; want %v", g.ProtoMinor, w) + } + if w, k := "google-api-go-client/0.5", "User-Agent"; len(g.Header[k]) != 1 || g.Header[k][0] != w { + t.Errorf("header %q = %#v; want %q", k, g.Header[k], w) + } + if w, k := "text/plain", "Content-Type"; len(g.Header[k]) != 1 || g.Header[k][0] != w { + t.Errorf("header %q = %#v; want %v", k, g.Header[k], w) + } + if w, k := fmt.Sprintf("bytes 0-%v/%v", len(data)-1, len(data)), "Content-Range"; len(g.Header[k]) != 1 || g.Header[k][0] != w { + t.Errorf("header %q = %#v; want %v", k, g.Header[k], w) + } + if w, k := "gzip", "Accept-Encoding"; len(g.Header[k]) != 1 || g.Header[k][0] != w { + t.Errorf("header %q = %#v; want %q", k, g.Header[k], w) + } + if w := int64(len(data)); g.ContentLength != w { + t.Errorf("ContentLength = %v; want %v", g.ContentLength, w) + } + if s := string(handler.body); s != data { + t.Errorf("body = %q; want %q", s, data) + } + if len(g.TransferEncoding) != 0 { + t.Errorf("TransferEncoding = %#v; want nil", g.TransferEncoding) + } + if g.Form != nil { + t.Errorf("Form = %#v; want nil", g.Form) + } + if g.PostForm != nil { + t.Errorf("PostForm = %#v; want nil", g.PostForm) + } + if g.MultipartForm != nil { + t.Errorf("MultipartForm = %#v; want nil", g.MultipartForm) + } + if handler.err != nil { + t.Errorf("handler err = %v, want nil", handler.err) + } +} + +func TestNoMedia(t *testing.T) { + handler := &myHandler{} + server := httptest.NewServer(handler) + defer server.Close() + + client := &http.Client{} + s, err := storage.New(client) + if err != nil { + t.Fatalf("unable to create service: %v", err) + } + s.BasePath = server.URL + + o := &storage.Object{ + Bucket: "mybucket", + Name: "filename", + ContentType: "plain/text", + ContentEncoding: "utf-8", + ContentLanguage: "en", + } + _, err = s.Objects.Insert("mybucket", o).Do() + if err != nil { + t.Fatalf("unable to insert object: %v", err) + } + g := handler.r + if w := "POST"; g.Method != w { + t.Errorf("Method = %q; want %q", g.Method, w) + } + if w := "HTTP/1.1"; g.Proto != w { + t.Errorf("Proto = %q; want %q", g.Proto, w) + } + if w := 1; g.ProtoMajor != w { + t.Errorf("ProtoMajor = %v; want %v", g.ProtoMajor, w) + } + if w := 1; g.ProtoMinor != w { + t.Errorf("ProtoMinor = %v; want %v", g.ProtoMinor, w) + } + if w, k := "google-api-go-client/0.5", "User-Agent"; len(g.Header[k]) != 1 || g.Header[k][0] != w { + t.Errorf("header %q = %#v; want %q", k, g.Header[k], w) + } + if w, k := "application/json", "Content-Type"; len(g.Header[k]) != 1 || g.Header[k][0] != w { + t.Errorf("header %q = %#v; want %q", k, g.Header[k], w) + } + if w, k := "gzip", "Accept-Encoding"; len(g.Header[k]) != 1 || g.Header[k][0] != w { + t.Errorf("header %q = %#v; want %q", k, g.Header[k], w) + } + if w := int64(116); g.ContentLength != w { + t.Errorf("ContentLength = %v; want %v", g.ContentLength, w) + } + if len(g.TransferEncoding) != 0 { + t.Errorf("TransferEncoding = %#v; want []string{}", g.TransferEncoding) + } + if w := strings.TrimPrefix(s.BasePath, "http://"); g.Host != w { + t.Errorf("Host = %q; want %q", g.Host, w) + } + if g.Form != nil { + t.Errorf("Form = %#v; want nil", g.Form) + } + if g.PostForm != nil { + t.Errorf("PostForm = %#v; want nil", g.PostForm) + } + if g.MultipartForm != nil { + t.Errorf("MultipartForm = %#v; want nil", g.MultipartForm) + } + if w := s.BasePath + "/b/mybucket/o?alt=json"; g.RequestURI != w { + t.Errorf("RequestURI = %q; want %q", g.RequestURI, w) + } + if w := `{"bucket":"mybucket","contentEncoding":"utf-8","contentLanguage":"en","contentType":"plain/text","name":"filename"}` + "\n"; string(handler.body) != w { + t.Errorf("Body = %q, want %q", handler.body, w) + } + if handler.err != nil { + t.Errorf("handler err = %v, want nil", handler.err) + } +} + +func TestMediaErrHandling(t *testing.T) { + handler := &myHandler{} + server := httptest.NewServer(handler) + defer server.Close() + + client := &http.Client{} + s, err := storage.New(client) + if err != nil { + t.Fatalf("unable to create service: %v", err) + } + s.BasePath = server.URL + + const body = "fake media data" + f := strings.NewReader(body) + // The combination of TimeoutReader and OneByteReader causes the first byte to + // be successfully delivered, but then a timeout error is reported. This + // allows us to test the goroutine within the getMediaType function. + r := iotest.TimeoutReader(iotest.OneByteReader(f)) + o := &storage.Object{ + Bucket: "mybucket", + Name: "filename", + ContentType: "plain/text", + ContentEncoding: "utf-8", + ContentLanguage: "en", + } + _, err = s.Objects.Insert("mybucket", o).Media(r).Do() + if err == nil || !strings.Contains(err.Error(), "timeout") { + t.Errorf("expected timeout error, got %v", err) + } + if handler.err != nil { + t.Errorf("handler err = %v, want nil", handler.err) + } +} + +func TestUserAgent(t *testing.T) { + handler := &myHandler{} + server := httptest.NewServer(handler) + defer server.Close() + + client := &http.Client{} + s, err := storage.New(client) + if err != nil { + t.Fatalf("unable to create service: %v", err) + } + s.BasePath = server.URL + s.UserAgent = "myagent/1.0" + + f := strings.NewReader("fake media data") + o := &storage.Object{ + Bucket: "mybucket", + Name: "filename", + ContentType: "plain/text", + ContentEncoding: "utf-8", + ContentLanguage: "en", + } + _, err = s.Objects.Insert("mybucket", o).Media(f).Do() + if err != nil { + t.Fatalf("unable to insert object: %v", err) + } + g := handler.r + if w, k := "google-api-go-client/0.5 myagent/1.0", "User-Agent"; len(g.Header[k]) != 1 || g.Header[k][0] != w { + t.Errorf("header %q = %#v; want %q", k, g.Header[k], w) + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/any.json b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/any.json new file mode 100644 index 000000000..405109ad3 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/any.json @@ -0,0 +1,1018 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/WoU1Y-TPU2mFiyKWAKMijLjE-Hc\"", + "discoveryVersion": "v1", + "id": "logging:v1beta3", + "name": "logging", + "version": "v1beta3", + "revision": "20150326", + "title": "Google Cloud Logging API", + "description": "Google Cloud Logging API lets you create logs, ingest log entries, and manage log sinks.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "", + "protocol": "rest", + "baseUrl": "https://logging.googleapis.com/", + "basePath": "", + "rootUrl": "https://logging.googleapis.com/", + "servicePath": "", + "batchPath": "batch", + "parameters": { + "access_token": { + "type": "string", + "description": "OAuth access token.", + "location": "query" + }, + "alt": { + "type": "string", + "description": "Data format for response.", + "default": "json", + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query" + }, + "bearer_token": { + "type": "string", + "description": "OAuth bearer token.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JSONP", + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "pp": { + "type": "boolean", + "description": "Pretty-print response.", + "default": "true", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query" + }, + "$.xgafv": { + "type": "string", + "description": "V1 error format.", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "schemas": { + "ListLogsResponse": { + "id": "ListLogsResponse", + "type": "object", + "description": "Result returned from ListLogs.", + "properties": { + "logs": { + "type": "array", + "description": "A list of log resources.", + "items": { + "$ref": "Log" + } + }, + "nextPageToken": { + "type": "string", + "description": "If there are more results, then `nextPageToken` is returned in the response. To get the next batch of logs, use the value of `nextPageToken` as `pageToken` in the next call of `ListLogs`. If `nextPageToken` is empty, then there are no more results." + } + } + }, + "Log": { + "id": "Log", + "type": "object", + "description": "A log object.", + "properties": { + "name": { + "type": "string", + "description": "REQUIRED: The log's name name. Example: `\"compute.googleapis.com/activity_log\"`." + }, + "displayName": { + "type": "string", + "description": "Name used when displaying the log to the user (for example, in a UI). Example: `\"activity_log\"`" + }, + "payloadType": { + "type": "string", + "description": "Type URL describing the expected payload type for the log." + } + } + }, + "Empty": { + "id": "Empty", + "type": "object", + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }" + }, + "WriteLogEntriesRequest": { + "id": "WriteLogEntriesRequest", + "type": "object", + "description": "The parameters to WriteLogEntries.", + "properties": { + "commonLabels": { + "type": "object", + "description": "Metadata labels that apply to all entries in this request. If one of the log entries contains a (key, value) with the same key that is in `commonLabels`, then the entry's (key, value) overrides the one in `commonLabels`.", + "additionalProperties": { + "type": "string" + } + }, + "entries": { + "type": "array", + "description": "Log entries to insert.", + "items": { + "$ref": "LogEntry" + } + } + } + }, + "LogEntry": { + "id": "LogEntry", + "type": "object", + "description": "An individual entry in a log.", + "properties": { + "metadata": { + "$ref": "LogEntryMetadata", + "description": "Information about the log entry." + }, + "protoPayload": { + "type": "object", + "description": "The log entry payload, represented as a protocol buffer that is expressed as a JSON object. You can only pass `protoPayload` values that belong to a set of approved types.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @ype with type URL." + } + }, + "textPayload": { + "type": "string", + "description": "The log entry payload, represented as a text string." + }, + "structPayload": { + "type": "object", + "description": "The log entry payload, represented as a structure that is expressed as a JSON object.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + } + }, + "insertId": { + "type": "string", + "description": "A unique ID for the log entry. If you provide this field, the logging service considers other log entries in the same log with the same ID as duplicates which can be removed." + }, + "log": { + "type": "string", + "description": "The log to which this entry belongs. When a log entry is ingested, the value of this field is set by the logging system." + } + } + }, + "LogEntryMetadata": { + "id": "LogEntryMetadata", + "type": "object", + "description": "Additional data that is associated with a log entry, set by the service creating the log entry.", + "properties": { + "timestamp": { + "type": "string", + "description": "The time the event described by the log entry occurred. Timestamps must be later than January 1, 1970." + }, + "severity": { + "type": "string", + "description": "The severity of the log entry.", + "default": "EMERGENCY", + "enum": [ + "DEFAULT", + "DEBUG", + "INFO", + "NOTICE", + "WARNING", + "ERROR", + "CRITICAL", + "ALERT", + "EMERGENCY" + ], + "enumDescriptions": [ + "This is the DEFAULT description", + "This is the DEBUG description", + "This is the INFO description", + "This is the NOTICE description", + "This is the WARNING description", + "This is the ERROR description", + "This is the CRITICAL description", + "This is the ALERT description", + "This is the EMERGENCY description" + ] + }, + "projectId": { + "type": "string", + "description": "The project ID of the Google Cloud Platform service that created the log entry." + }, + "serviceName": { + "type": "string", + "description": "The API name of the Google Cloud Platform service that created the log entry. For example, `\"compute.googleapis.com\"`." + }, + "region": { + "type": "string", + "description": "The region name of the Google Cloud Platform service that created the log entry. For example, `\"us-central1\"`." + }, + "zone": { + "type": "string", + "description": "The zone of the Google Cloud Platform service that created the log entry. For example, `\"us-central1-a\"`." + }, + "userId": { + "type": "string", + "description": "The fully-qualified email address of the authenticated user that performed or requested the action represented by the log entry. If the log entry does not apply to an action taken by an authenticated user, then the field should be empty." + }, + "labels": { + "type": "object", + "description": "A set of (key, value) data that provides additional information about the log entry. If the log entry is from one of the Google Cloud Platform sources listed below, the indicated (key, value) information must be provided: Google App Engine, service_name `appengine.googleapis.com`: \"appengine.googleapis.com/module_id\", \"appengine.googleapis.com/version_id\", and one of: \"appengine.googleapis.com/replica_index\", \"appengine.googleapis.com/clone_id\", or else provide the following Compute Engine labels: Google Compute Engine, service_name `compute.googleapis.com`: \"compute.googleapis.com/resource_type\", \"instance\" \"compute.googleapis.com/resource_id\",", + "additionalProperties": { + "type": "string" + } + } + } + }, + "WriteLogEntriesResponse": { + "id": "WriteLogEntriesResponse", + "type": "object", + "description": "Result returned from WriteLogEntries. empty" + }, + "ListLogServicesResponse": { + "id": "ListLogServicesResponse", + "type": "object", + "description": "Result returned from `ListLogServicesRequest`.", + "properties": { + "logServices": { + "type": "array", + "description": "A list of log services.", + "items": { + "$ref": "LogService" + } + }, + "nextPageToken": { + "type": "string", + "description": "If there are more results, then `nextPageToken` is returned in the response. To get the next batch of services, use the value of `nextPageToken` as `pageToken` in the next call of `ListLogServices`. If `nextPageToken` is empty, then there are no more results." + } + } + }, + "LogService": { + "id": "LogService", + "type": "object", + "description": "A log service object.", + "properties": { + "name": { + "type": "string", + "description": "The service's name." + }, + "indexKeys": { + "type": "array", + "description": "Label keys used when labeling log entries for this service. The order of the keys is significant, with higher priority keys coming earlier in the list.", + "items": { + "type": "string" + } + } + } + }, + "ListLogServiceIndexesResponse": { + "id": "ListLogServiceIndexesResponse", + "type": "object", + "description": "Result returned from ListLogServiceIndexesRequest.", + "properties": { + "serviceIndexPrefixes": { + "type": "array", + "description": "A list of log service index prefixes.", + "items": { + "type": "string" + } + }, + "nextPageToken": { + "type": "string", + "description": "If there are more results, then `nextPageToken` is returned in the response. To get the next batch of indexes, use the value of `nextPageToken` as `pageToken` in the next call of `ListLogServiceIndexess`. If `nextPageToken` is empty, then there are no more results." + } + } + }, + "ListLogSinksResponse": { + "id": "ListLogSinksResponse", + "type": "object", + "description": "Result returned from `ListLogSinks`.", + "properties": { + "sinks": { + "type": "array", + "description": "The requested log sinks. If any of the returned `LogSink` objects have an empty `destination` field, then call `logServices.sinks.get` to retrieve the complete `LogSink` object.", + "items": { + "$ref": "LogSink" + } + } + } + }, + "LogSink": { + "id": "LogSink", + "type": "object", + "description": "An object that describes where a log may be written.", + "properties": { + "name": { + "type": "string", + "description": "The name of this sink. This is a client-assigned identifier for the resource. This is ignored by UpdateLogSink and UpdateLogServicesSink." + }, + "destination": { + "type": "string", + "description": "The resource to send log entries to. The supported sink resource types are: + Google Cloud Storage: `storage.googleapis.com/BUCKET` or `BUCKET.storage.googleapis.com/` + Google BigQuery: `bigquery.googleapis.com/projects/PROJECT/datasets/DATASET` Currently the Cloud Logging API supports at most one sink for each resource type per log or log service resource." + }, + "errors": { + "type": "array", + "description": "_Output only._ All active errors found for this sink.", + "items": { + "$ref": "LogError" + } + } + } + }, + "LogError": { + "id": "LogError", + "type": "object", + "description": "A problem in a sink or the sink's configuration.", + "properties": { + "resource": { + "type": "string", + "description": "The resource associated with the error. It may be different from the sink destination. For example, the sink may point to a BigQuery dataset, but the error may refer to a table resource inside the dataset." + }, + "status": { + "$ref": "Status", + "description": "The description of the last error observed." + }, + "timeNanos": { + "type": "string", + "description": "The last time the error was observed, in nanoseconds since the Unix epoch.", + "format": "int64" + } + } + }, + "Status": { + "id": "Status", + "type": "object", + "description": "Represents the RPC error status for Google APIs. See http://go/errormodel for details.", + "properties": { + "code": { + "type": "integer", + "description": "The status code, which should be an enum value of [google.rpc.Code][].", + "format": "int32" + }, + "message": { + "type": "string", + "description": "A developer-facing error message, which should be in English. The user-facing error message should be localized and stored in the [google.rpc.Status.details][google.rpc.Status.details] field." + }, + "details": { + "type": "array", + "description": "A list of messages that carry the error details. There will be a common set of message types for APIs to use.", + "items": { + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @ype with type URL." + } + } + } + } + }, + "ListLogServiceSinksResponse": { + "id": "ListLogServiceSinksResponse", + "type": "object", + "description": "Result returned from `ListLogServiceSinks`.", + "properties": { + "sinks": { + "type": "array", + "description": "The requested log service sinks. If any of the returned `LogSink` objects have an empty `destination` field, then call `logServices.sinks.get` to retrieve the complete `LogSink` object.", + "items": { + "$ref": "LogSink" + } + } + } + } + }, + "resources": { + "projects": { + "resources": { + "logs": { + "methods": { + "list": { + "id": "logging.projects.logs.list", + "path": "v1beta3/projects/{projectsId}/logs", + "httpMethod": "GET", + "description": "Lists log resources belonging to the specified project.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `projectName`. The project name for which to list the log resources.", + "required": true, + "location": "path" + }, + "serviceName": { + "type": "string", + "description": "A service name for which to list logs. Only logs containing entries whose metadata includes this service name are returned. If `serviceName` and `serviceIndexPrefix` are both empty, then all log names are returned. To list all log names, regardless of service, leave both the `serviceName` and `serviceIndexPrefix` empty. To list log names containing entries with a particular service name (or explicitly empty service name) set `serviceName` to the desired value and `serviceIndexPrefix` to `\"/\"`.", + "location": "query" + }, + "serviceIndexPrefix": { + "type": "string", + "description": "A log service index prefix for which to list logs. Only logs containing entries whose metadata that includes these label values (associated with index keys) are returned. The prefix is a slash separated list of values, and need not specify all index labels. An empty index (or a single slash) matches all log service indexes.", + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "An opaque token, returned as `nextPageToken` by a prior `ListLogs` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogs` operation is continued.", + "location": "query" + } + }, + "parameterOrder": [ + "projectsId" + ], + "response": { + "$ref": "ListLogsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "id": "logging.projects.logs.delete", + "path": "v1beta3/projects/{projectsId}/logs/{logsId}", + "httpMethod": "DELETE", + "description": "Deletes the specified log resource and all log entries contained in it.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `logName`. The log resource to delete.", + "required": true, + "location": "path" + }, + "logsId": { + "type": "string", + "description": "Part of `logName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "logsId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + }, + "resources": { + "entries": { + "methods": { + "write": { + "id": "logging.projects.logs.entries.write", + "path": "v1beta3/projects/{projectsId}/logs/{logsId}/entries:write", + "httpMethod": "POST", + "description": "Creates one or more log entries in a log. You must supply a list of `LogEntry` objects, named `entries`. Each `LogEntry` object must contain a payload object and a `LogEntryMetadata` object that describes the entry. You must fill in all the fields of the entry, metadata, and payload. You can also supply a map, `commonLabels`, that supplies default (key, value) data for the `entries[].metadata.labels` maps, saving you the trouble of creating identical copies for each entry.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `logName`. The name of the log resource into which to insert the log entries.", + "required": true, + "location": "path" + }, + "logsId": { + "type": "string", + "description": "Part of `logName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "logsId" + ], + "request": { + "$ref": "WriteLogEntriesRequest" + }, + "response": { + "$ref": "WriteLogEntriesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "sinks": { + "methods": { + "list": { + "id": "logging.projects.logs.sinks.list", + "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks", + "httpMethod": "GET", + "description": "Lists log sinks associated with the specified log.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `logName`. The log for which to list sinks.", + "required": true, + "location": "path" + }, + "logsId": { + "type": "string", + "description": "Part of `logName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "logsId" + ], + "response": { + "$ref": "ListLogSinksResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "id": "logging.projects.logs.sinks.get", + "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}", + "httpMethod": "GET", + "description": "Gets the specified log sink resource.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `sinkName`. The name of the sink resource to return.", + "required": true, + "location": "path" + }, + "logsId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + }, + "sinksId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "logsId", + "sinksId" + ], + "response": { + "$ref": "LogSink" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "create": { + "id": "logging.projects.logs.sinks.create", + "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks", + "httpMethod": "POST", + "description": "Creates the specified log sink resource.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `logName`. The log in which to create a sink resource.", + "required": true, + "location": "path" + }, + "logsId": { + "type": "string", + "description": "Part of `logName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "logsId" + ], + "request": { + "$ref": "LogSink" + }, + "response": { + "$ref": "LogSink" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "update": { + "id": "logging.projects.logs.sinks.update", + "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}", + "httpMethod": "PUT", + "description": "Creates or updates the specified log sink resource.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `sinkName`. The name of the sink to update.", + "required": true, + "location": "path" + }, + "logsId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + }, + "sinksId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "logsId", + "sinksId" + ], + "request": { + "$ref": "LogSink" + }, + "response": { + "$ref": "LogSink" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "id": "logging.projects.logs.sinks.delete", + "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}", + "httpMethod": "DELETE", + "description": "Deletes the specified log sink resource.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `sinkName`. The name of the sink to delete.", + "required": true, + "location": "path" + }, + "logsId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + }, + "sinksId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "logsId", + "sinksId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + }, + "logServices": { + "methods": { + "list": { + "id": "logging.projects.logServices.list", + "path": "v1beta3/projects/{projectsId}/logServices", + "httpMethod": "GET", + "description": "Lists log services associated with log entries ingested for a project.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `projectName`. The project resource whose services are to be listed.", + "required": true, + "location": "path" + }, + "log": { + "type": "string", + "description": "The name of the log resource whose services are to be listed. log for which to list services. When empty, all services are listed.", + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of `LogService` objects to return in one operation.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "An opaque token, returned as `nextPageToken` by a prior `ListLogServices` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogServices` operation is continued.", + "location": "query" + } + }, + "parameterOrder": [ + "projectsId" + ], + "response": { + "$ref": "ListLogServicesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + }, + "resources": { + "indexes": { + "methods": { + "list": { + "id": "logging.projects.logServices.indexes.list", + "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/indexes", + "httpMethod": "GET", + "description": "Lists log service indexes associated with a log service.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `serviceName`. A log service resource of the form `/projects/*/logServices/*`. The service indexes of the log service are returned. Example: `\"/projects/myProj/logServices/appengine.googleapis.com\"`.", + "required": true, + "location": "path" + }, + "logServicesId": { + "type": "string", + "description": "Part of `serviceName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + }, + "indexPrefix": { + "type": "string", + "description": "Restricts the indexes returned to be those with a specified prefix. The prefix has the form `\"/label_value/label_value/...\"`, in order corresponding to the [`LogService indexKeys`][google.logging.v1.LogService.index_keys]. Non-empty prefixes must begin with `/` . Example prefixes: + `\"/myModule/\"` retrieves App Engine versions associated with `myModule`. The trailing slash terminates the value. + `\"/myModule\"` retrieves App Engine modules with names beginning with `myModule`. + `\"\"` retrieves all indexes.", + "location": "query" + }, + "depth": { + "type": "integer", + "description": "A limit to the number of levels of the index hierarchy that are expanded. If `depth` is 0, it defaults to the level specified by the prefix field (the number of slash separators). The default empty prefix implies a `depth` of 1. It is an error for `depth` to be any non-zero value less than the number of components in `indexPrefix`.", + "format": "int32", + "location": "query" + }, + "log": { + "type": "string", + "description": "A log resource like `/projects/project_id/logs/log_name`, identifying the log for which to list service indexes.", + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of log service index resources to return in one operation.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "An opaque token, returned as `nextPageToken` by a prior `ListLogServiceIndexes` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogServiceIndexes` operation is continued.", + "location": "query" + } + }, + "parameterOrder": [ + "projectsId", + "logServicesId" + ], + "response": { + "$ref": "ListLogServiceIndexesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "sinks": { + "methods": { + "list": { + "id": "logging.projects.logServices.sinks.list", + "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks", + "httpMethod": "GET", + "description": "Lists log service sinks associated with the specified service.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `serviceName`. The name of the service for which to list sinks.", + "required": true, + "location": "path" + }, + "logServicesId": { + "type": "string", + "description": "Part of `serviceName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "logServicesId" + ], + "response": { + "$ref": "ListLogServiceSinksResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "id": "logging.projects.logServices.sinks.get", + "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}", + "httpMethod": "GET", + "description": "Gets the specified log service sink resource.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `sinkName`. The name of the sink to return.", + "required": true, + "location": "path" + }, + "logServicesId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + }, + "sinksId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "logServicesId", + "sinksId" + ], + "response": { + "$ref": "LogSink" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "create": { + "id": "logging.projects.logServices.sinks.create", + "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks", + "httpMethod": "POST", + "description": "Creates the specified log service sink resource.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `serviceName`. The name of the service in which to create a sink.", + "required": true, + "location": "path" + }, + "logServicesId": { + "type": "string", + "description": "Part of `serviceName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "logServicesId" + ], + "request": { + "$ref": "LogSink" + }, + "response": { + "$ref": "LogSink" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "update": { + "id": "logging.projects.logServices.sinks.update", + "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}", + "httpMethod": "PUT", + "description": "Creates or update the specified log service sink resource.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `sinkName`. The name of the sink to update.", + "required": true, + "location": "path" + }, + "logServicesId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + }, + "sinksId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "logServicesId", + "sinksId" + ], + "request": { + "$ref": "LogSink" + }, + "response": { + "$ref": "LogSink" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "id": "logging.projects.logServices.sinks.delete", + "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}", + "httpMethod": "DELETE", + "description": "Deletes the specified log service sink.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `sinkName`. The name of the sink to delete.", + "required": true, + "location": "path" + }, + "logServicesId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + }, + "sinksId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "logServicesId", + "sinksId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/any.want b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/any.want new file mode 100644 index 000000000..7d08519ca --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/any.want @@ -0,0 +1,2875 @@ +// Package logging provides access to the Google Cloud Logging API. +// +// Usage example: +// +// import "google.golang.org/api/logging/v1beta3" +// ... +// loggingService, err := logging.New(oauthHttpClient) +package logging // import "google.golang.org/api/logging/v1beta3" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "logging:v1beta3" +const apiName = "logging" +const apiVersion = "v1beta3" +const basePath = "https://logging.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your data across Google Cloud Platform services + CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Projects *ProjectsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewProjectsService(s *Service) *ProjectsService { + rs := &ProjectsService{s: s} + rs.LogServices = NewProjectsLogServicesService(s) + rs.Logs = NewProjectsLogsService(s) + return rs +} + +type ProjectsService struct { + s *Service + + LogServices *ProjectsLogServicesService + + Logs *ProjectsLogsService +} + +func NewProjectsLogServicesService(s *Service) *ProjectsLogServicesService { + rs := &ProjectsLogServicesService{s: s} + rs.Indexes = NewProjectsLogServicesIndexesService(s) + rs.Sinks = NewProjectsLogServicesSinksService(s) + return rs +} + +type ProjectsLogServicesService struct { + s *Service + + Indexes *ProjectsLogServicesIndexesService + + Sinks *ProjectsLogServicesSinksService +} + +func NewProjectsLogServicesIndexesService(s *Service) *ProjectsLogServicesIndexesService { + rs := &ProjectsLogServicesIndexesService{s: s} + return rs +} + +type ProjectsLogServicesIndexesService struct { + s *Service +} + +func NewProjectsLogServicesSinksService(s *Service) *ProjectsLogServicesSinksService { + rs := &ProjectsLogServicesSinksService{s: s} + return rs +} + +type ProjectsLogServicesSinksService struct { + s *Service +} + +func NewProjectsLogsService(s *Service) *ProjectsLogsService { + rs := &ProjectsLogsService{s: s} + rs.Entries = NewProjectsLogsEntriesService(s) + rs.Sinks = NewProjectsLogsSinksService(s) + return rs +} + +type ProjectsLogsService struct { + s *Service + + Entries *ProjectsLogsEntriesService + + Sinks *ProjectsLogsSinksService +} + +func NewProjectsLogsEntriesService(s *Service) *ProjectsLogsEntriesService { + rs := &ProjectsLogsEntriesService{s: s} + return rs +} + +type ProjectsLogsEntriesService struct { + s *Service +} + +func NewProjectsLogsSinksService(s *Service) *ProjectsLogsSinksService { + rs := &ProjectsLogsSinksService{s: s} + return rs +} + +type ProjectsLogsSinksService struct { + s *Service +} + +// Empty: A generic empty message that you can re-use to avoid defining +// duplicated empty messages in your APIs. A typical example is to use +// it as the request or the response type of an API method. For +// instance: service Foo { rpc Bar(google.protobuf.Empty) returns +// (google.protobuf.Empty); } +type Empty struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// ListLogServiceIndexesResponse: Result returned from +// ListLogServiceIndexesRequest. +type ListLogServiceIndexesResponse struct { + // NextPageToken: If there are more results, then `nextPageToken` is + // returned in the response. To get the next batch of indexes, use the + // value of `nextPageToken` as `pageToken` in the next call of + // `ListLogServiceIndexess`. If `nextPageToken` is empty, then there are + // no more results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServiceIndexPrefixes: A list of log service index prefixes. + ServiceIndexPrefixes []string `json:"serviceIndexPrefixes,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListLogServiceIndexesResponse) MarshalJSON() ([]byte, error) { + type noMethod ListLogServiceIndexesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListLogServiceSinksResponse: Result returned from +// `ListLogServiceSinks`. +type ListLogServiceSinksResponse struct { + // Sinks: The requested log service sinks. If any of the returned + // `LogSink` objects have an empty `destination` field, then call + // `logServices.sinks.get` to retrieve the complete `LogSink` object. + Sinks []*LogSink `json:"sinks,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Sinks") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListLogServiceSinksResponse) MarshalJSON() ([]byte, error) { + type noMethod ListLogServiceSinksResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListLogServicesResponse: Result returned from +// `ListLogServicesRequest`. +type ListLogServicesResponse struct { + // LogServices: A list of log services. + LogServices []*LogService `json:"logServices,omitempty"` + + // NextPageToken: If there are more results, then `nextPageToken` is + // returned in the response. To get the next batch of services, use the + // value of `nextPageToken` as `pageToken` in the next call of + // `ListLogServices`. If `nextPageToken` is empty, then there are no + // more results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "LogServices") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListLogServicesResponse) MarshalJSON() ([]byte, error) { + type noMethod ListLogServicesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListLogSinksResponse: Result returned from `ListLogSinks`. +type ListLogSinksResponse struct { + // Sinks: The requested log sinks. If any of the returned `LogSink` + // objects have an empty `destination` field, then call + // `logServices.sinks.get` to retrieve the complete `LogSink` object. + Sinks []*LogSink `json:"sinks,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Sinks") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListLogSinksResponse) MarshalJSON() ([]byte, error) { + type noMethod ListLogSinksResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListLogsResponse: Result returned from ListLogs. +type ListLogsResponse struct { + // Logs: A list of log resources. + Logs []*Log `json:"logs,omitempty"` + + // NextPageToken: If there are more results, then `nextPageToken` is + // returned in the response. To get the next batch of logs, use the + // value of `nextPageToken` as `pageToken` in the next call of + // `ListLogs`. If `nextPageToken` is empty, then there are no more + // results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Logs") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListLogsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListLogsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Log: A log object. +type Log struct { + // DisplayName: Name used when displaying the log to the user (for + // example, in a UI). Example: "activity_log" + DisplayName string `json:"displayName,omitempty"` + + // Name: REQUIRED: The log's name name. Example: + // "compute.googleapis.com/activity_log". + Name string `json:"name,omitempty"` + + // PayloadType: Type URL describing the expected payload type for the + // log. + PayloadType string `json:"payloadType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Log) MarshalJSON() ([]byte, error) { + type noMethod Log + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LogEntry: An individual entry in a log. +type LogEntry struct { + // InsertId: A unique ID for the log entry. If you provide this field, + // the logging service considers other log entries in the same log with + // the same ID as duplicates which can be removed. + InsertId string `json:"insertId,omitempty"` + + // Log: The log to which this entry belongs. When a log entry is + // ingested, the value of this field is set by the logging system. + Log string `json:"log,omitempty"` + + // Metadata: Information about the log entry. + Metadata *LogEntryMetadata `json:"metadata,omitempty"` + + // ProtoPayload: The log entry payload, represented as a protocol buffer + // that is expressed as a JSON object. You can only pass `protoPayload` + // values that belong to a set of approved types. + ProtoPayload LogEntryProtoPayload `json:"protoPayload,omitempty"` + + // StructPayload: The log entry payload, represented as a structure that + // is expressed as a JSON object. + StructPayload LogEntryStructPayload `json:"structPayload,omitempty"` + + // TextPayload: The log entry payload, represented as a text string. + TextPayload string `json:"textPayload,omitempty"` + + // ForceSendFields is a list of field names (e.g. "InsertId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LogEntry) MarshalJSON() ([]byte, error) { + type noMethod LogEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type LogEntryProtoPayload interface{} + +type LogEntryStructPayload interface{} + +// LogEntryMetadata: Additional data that is associated with a log +// entry, set by the service creating the log entry. +type LogEntryMetadata struct { + // Labels: A set of (key, value) data that provides additional + // information about the log entry. If the log entry is from one of the + // Google Cloud Platform sources listed below, the indicated (key, + // value) information must be provided: Google App Engine, service_name + // `appengine.googleapis.com`: "appengine.googleapis.com/module_id", + // "appengine.googleapis.com/version_id", and one of: + // "appengine.googleapis.com/replica_index", + // "appengine.googleapis.com/clone_id", or else provide the following + // Compute Engine labels: Google Compute Engine, service_name + // `compute.googleapis.com`: "compute.googleapis.com/resource_type", + // "instance" "compute.googleapis.com/resource_id", + Labels map[string]string `json:"labels,omitempty"` + + // ProjectId: The project ID of the Google Cloud Platform service that + // created the log entry. + ProjectId string `json:"projectId,omitempty"` + + // Region: The region name of the Google Cloud Platform service that + // created the log entry. For example, "us-central1". + Region string `json:"region,omitempty"` + + // ServiceName: The API name of the Google Cloud Platform service that + // created the log entry. For example, "compute.googleapis.com". + ServiceName string `json:"serviceName,omitempty"` + + // Severity: The severity of the log entry. + // + // Possible values: + // "DEFAULT" - This is the DEFAULT description + // "DEBUG" - This is the DEBUG description + // "INFO" - This is the INFO description + // "NOTICE" - This is the NOTICE description + // "WARNING" - This is the WARNING description + // "ERROR" - This is the ERROR description + // "CRITICAL" - This is the CRITICAL description + // "ALERT" - This is the ALERT description + // "EMERGENCY" (default) - This is the EMERGENCY description + Severity string `json:"severity,omitempty"` + + // Timestamp: The time the event described by the log entry occurred. + // Timestamps must be later than January 1, 1970. + Timestamp string `json:"timestamp,omitempty"` + + // UserId: The fully-qualified email address of the authenticated user + // that performed or requested the action represented by the log entry. + // If the log entry does not apply to an action taken by an + // authenticated user, then the field should be empty. + UserId string `json:"userId,omitempty"` + + // Zone: The zone of the Google Cloud Platform service that created the + // log entry. For example, "us-central1-a". + Zone string `json:"zone,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Labels") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LogEntryMetadata) MarshalJSON() ([]byte, error) { + type noMethod LogEntryMetadata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LogError: A problem in a sink or the sink's configuration. +type LogError struct { + // Resource: The resource associated with the error. It may be different + // from the sink destination. For example, the sink may point to a + // BigQuery dataset, but the error may refer to a table resource inside + // the dataset. + Resource string `json:"resource,omitempty"` + + // Status: The description of the last error observed. + Status *Status `json:"status,omitempty"` + + // TimeNanos: The last time the error was observed, in nanoseconds since + // the Unix epoch. + TimeNanos int64 `json:"timeNanos,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Resource") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LogError) MarshalJSON() ([]byte, error) { + type noMethod LogError + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LogService: A log service object. +type LogService struct { + // IndexKeys: Label keys used when labeling log entries for this + // service. The order of the keys is significant, with higher priority + // keys coming earlier in the list. + IndexKeys []string `json:"indexKeys,omitempty"` + + // Name: The service's name. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "IndexKeys") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LogService) MarshalJSON() ([]byte, error) { + type noMethod LogService + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LogSink: An object that describes where a log may be written. +type LogSink struct { + // Destination: The resource to send log entries to. The supported sink + // resource types are: + Google Cloud Storage: + // `storage.googleapis.com/BUCKET` or `BUCKET.storage.googleapis.com/` + + // Google BigQuery: + // `bigquery.googleapis.com/projects/PROJECT/datasets/DATASET` Currently + // the Cloud Logging API supports at most one sink for each resource + // type per log or log service resource. + Destination string `json:"destination,omitempty"` + + // Errors: _Output only._ All active errors found for this sink. + Errors []*LogError `json:"errors,omitempty"` + + // Name: The name of this sink. This is a client-assigned identifier for + // the resource. This is ignored by UpdateLogSink and + // UpdateLogServicesSink. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Destination") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LogSink) MarshalJSON() ([]byte, error) { + type noMethod LogSink + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Status: Represents the RPC error status for Google APIs. See +// http://go/errormodel for details. +type Status struct { + // Code: The status code, which should be an enum value of + // [google.rpc.Code][]. + Code int64 `json:"code,omitempty"` + + // Details: A list of messages that carry the error details. There will + // be a common set of message types for APIs to use. + Details []StatusDetails `json:"details,omitempty"` + + // Message: A developer-facing error message, which should be in + // English. The user-facing error message should be localized and stored + // in the [google.rpc.Status.details][google.rpc.Status.details] field. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Status) MarshalJSON() ([]byte, error) { + type noMethod Status + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type StatusDetails interface{} + +// WriteLogEntriesRequest: The parameters to WriteLogEntries. +type WriteLogEntriesRequest struct { + // CommonLabels: Metadata labels that apply to all entries in this + // request. If one of the log entries contains a (key, value) with the + // same key that is in `commonLabels`, then the entry's (key, value) + // overrides the one in `commonLabels`. + CommonLabels map[string]string `json:"commonLabels,omitempty"` + + // Entries: Log entries to insert. + Entries []*LogEntry `json:"entries,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CommonLabels") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *WriteLogEntriesRequest) MarshalJSON() ([]byte, error) { + type noMethod WriteLogEntriesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// WriteLogEntriesResponse: Result returned from WriteLogEntries. empty +type WriteLogEntriesResponse struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// method id "logging.projects.logServices.list": + +type ProjectsLogServicesListCall struct { + s *Service + projectsId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists log services associated with log entries ingested for a +// project. +func (r *ProjectsLogServicesService) List(projectsId string) *ProjectsLogServicesListCall { + c := &ProjectsLogServicesListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + return c +} + +// Log sets the optional parameter "log": The name of the log resource +// whose services are to be listed. log for which to list services. When +// empty, all services are listed. +func (c *ProjectsLogServicesListCall) Log(log string) *ProjectsLogServicesListCall { + c.opt_["log"] = log + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of `LogService` objects to return in one operation. +func (c *ProjectsLogServicesListCall) PageSize(pageSize int64) *ProjectsLogServicesListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": An opaque token, +// returned as `nextPageToken` by a prior `ListLogServices` operation. +// If `pageToken` is supplied, then the other fields of this request are +// ignored, and instead the previous `ListLogServices` operation is +// continued. +func (c *ProjectsLogServicesListCall) PageToken(pageToken string) *ProjectsLogServicesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogServicesListCall) Fields(s ...googleapi.Field) *ProjectsLogServicesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLogServicesListCall) IfNoneMatch(entityTag string) *ProjectsLogServicesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogServicesListCall) Context(ctx context.Context) *ProjectsLogServicesListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogServicesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["log"]; ok { + params.Set("log", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logServices.list" call. +// Exactly one of *ListLogServicesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLogServicesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLogServicesListCall) Do() (*ListLogServicesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListLogServicesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists log services associated with log entries ingested for a project.", + // "httpMethod": "GET", + // "id": "logging.projects.logServices.list", + // "parameterOrder": [ + // "projectsId" + // ], + // "parameters": { + // "log": { + // "description": "The name of the log resource whose services are to be listed. log for which to list services. When empty, all services are listed.", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of `LogService` objects to return in one operation.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "An opaque token, returned as `nextPageToken` by a prior `ListLogServices` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogServices` operation is continued.", + // "location": "query", + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `projectName`. The project resource whose services are to be listed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logServices", + // "response": { + // "$ref": "ListLogServicesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "logging.projects.logServices.indexes.list": + +type ProjectsLogServicesIndexesListCall struct { + s *Service + projectsId string + logServicesId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists log service indexes associated with a log service. +func (r *ProjectsLogServicesIndexesService) List(projectsId string, logServicesId string) *ProjectsLogServicesIndexesListCall { + c := &ProjectsLogServicesIndexesListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logServicesId = logServicesId + return c +} + +// Depth sets the optional parameter "depth": A limit to the number of +// levels of the index hierarchy that are expanded. If `depth` is 0, it +// defaults to the level specified by the prefix field (the number of +// slash separators). The default empty prefix implies a `depth` of 1. +// It is an error for `depth` to be any non-zero value less than the +// number of components in `indexPrefix`. +func (c *ProjectsLogServicesIndexesListCall) Depth(depth int64) *ProjectsLogServicesIndexesListCall { + c.opt_["depth"] = depth + return c +} + +// IndexPrefix sets the optional parameter "indexPrefix": Restricts the +// indexes returned to be those with a specified prefix. The prefix has +// the form "/label_value/label_value/...", in order corresponding to +// the [`LogService +// indexKeys`][google.logging.v1.LogService.index_keys]. Non-empty +// prefixes must begin with `/` . Example prefixes: + "/myModule/" +// retrieves App Engine versions associated with `myModule`. The +// trailing slash terminates the value. + "/myModule" retrieves App +// Engine modules with names beginning with `myModule`. + "" retrieves +// all indexes. +func (c *ProjectsLogServicesIndexesListCall) IndexPrefix(indexPrefix string) *ProjectsLogServicesIndexesListCall { + c.opt_["indexPrefix"] = indexPrefix + return c +} + +// Log sets the optional parameter "log": A log resource like +// `/projects/project_id/logs/log_name`, identifying the log for which +// to list service indexes. +func (c *ProjectsLogServicesIndexesListCall) Log(log string) *ProjectsLogServicesIndexesListCall { + c.opt_["log"] = log + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of log service index resources to return in one operation. +func (c *ProjectsLogServicesIndexesListCall) PageSize(pageSize int64) *ProjectsLogServicesIndexesListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": An opaque token, +// returned as `nextPageToken` by a prior `ListLogServiceIndexes` +// operation. If `pageToken` is supplied, then the other fields of this +// request are ignored, and instead the previous `ListLogServiceIndexes` +// operation is continued. +func (c *ProjectsLogServicesIndexesListCall) PageToken(pageToken string) *ProjectsLogServicesIndexesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogServicesIndexesListCall) Fields(s ...googleapi.Field) *ProjectsLogServicesIndexesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLogServicesIndexesListCall) IfNoneMatch(entityTag string) *ProjectsLogServicesIndexesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogServicesIndexesListCall) Context(ctx context.Context) *ProjectsLogServicesIndexesListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogServicesIndexesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["depth"]; ok { + params.Set("depth", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["indexPrefix"]; ok { + params.Set("indexPrefix", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["log"]; ok { + params.Set("log", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/indexes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "logServicesId": c.logServicesId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logServices.indexes.list" call. +// Exactly one of *ListLogServiceIndexesResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListLogServiceIndexesResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLogServicesIndexesListCall) Do() (*ListLogServiceIndexesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListLogServiceIndexesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists log service indexes associated with a log service.", + // "httpMethod": "GET", + // "id": "logging.projects.logServices.indexes.list", + // "parameterOrder": [ + // "projectsId", + // "logServicesId" + // ], + // "parameters": { + // "depth": { + // "description": "A limit to the number of levels of the index hierarchy that are expanded. If `depth` is 0, it defaults to the level specified by the prefix field (the number of slash separators). The default empty prefix implies a `depth` of 1. It is an error for `depth` to be any non-zero value less than the number of components in `indexPrefix`.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "indexPrefix": { + // "description": "Restricts the indexes returned to be those with a specified prefix. The prefix has the form `\"/label_value/label_value/...\"`, in order corresponding to the [`LogService indexKeys`][google.logging.v1.LogService.index_keys]. Non-empty prefixes must begin with `/` . Example prefixes: + `\"/myModule/\"` retrieves App Engine versions associated with `myModule`. The trailing slash terminates the value. + `\"/myModule\"` retrieves App Engine modules with names beginning with `myModule`. + `\"\"` retrieves all indexes.", + // "location": "query", + // "type": "string" + // }, + // "log": { + // "description": "A log resource like `/projects/project_id/logs/log_name`, identifying the log for which to list service indexes.", + // "location": "query", + // "type": "string" + // }, + // "logServicesId": { + // "description": "Part of `serviceName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of log service index resources to return in one operation.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "An opaque token, returned as `nextPageToken` by a prior `ListLogServiceIndexes` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogServiceIndexes` operation is continued.", + // "location": "query", + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `serviceName`. A log service resource of the form `/projects/*/logServices/*`. The service indexes of the log service are returned. Example: `\"/projects/myProj/logServices/appengine.googleapis.com\"`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/indexes", + // "response": { + // "$ref": "ListLogServiceIndexesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "logging.projects.logServices.sinks.create": + +type ProjectsLogServicesSinksCreateCall struct { + s *Service + projectsId string + logServicesId string + logsink *LogSink + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates the specified log service sink resource. +func (r *ProjectsLogServicesSinksService) Create(projectsId string, logServicesId string, logsink *LogSink) *ProjectsLogServicesSinksCreateCall { + c := &ProjectsLogServicesSinksCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logServicesId = logServicesId + c.logsink = logsink + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogServicesSinksCreateCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogServicesSinksCreateCall) Context(ctx context.Context) *ProjectsLogServicesSinksCreateCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogServicesSinksCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "logServicesId": c.logServicesId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logServices.sinks.create" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLogServicesSinksCreateCall) Do() (*LogSink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LogSink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates the specified log service sink resource.", + // "httpMethod": "POST", + // "id": "logging.projects.logServices.sinks.create", + // "parameterOrder": [ + // "projectsId", + // "logServicesId" + // ], + // "parameters": { + // "logServicesId": { + // "description": "Part of `serviceName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `serviceName`. The name of the service in which to create a sink.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks", + // "request": { + // "$ref": "LogSink" + // }, + // "response": { + // "$ref": "LogSink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "logging.projects.logServices.sinks.delete": + +type ProjectsLogServicesSinksDeleteCall struct { + s *Service + projectsId string + logServicesId string + sinksId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified log service sink. +func (r *ProjectsLogServicesSinksService) Delete(projectsId string, logServicesId string, sinksId string) *ProjectsLogServicesSinksDeleteCall { + c := &ProjectsLogServicesSinksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logServicesId = logServicesId + c.sinksId = sinksId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogServicesSinksDeleteCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogServicesSinksDeleteCall) Context(ctx context.Context) *ProjectsLogServicesSinksDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogServicesSinksDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "logServicesId": c.logServicesId, + "sinksId": c.sinksId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logServices.sinks.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLogServicesSinksDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified log service sink.", + // "httpMethod": "DELETE", + // "id": "logging.projects.logServices.sinks.delete", + // "parameterOrder": [ + // "projectsId", + // "logServicesId", + // "sinksId" + // ], + // "parameters": { + // "logServicesId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `sinkName`. The name of the sink to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sinksId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "logging.projects.logServices.sinks.get": + +type ProjectsLogServicesSinksGetCall struct { + s *Service + projectsId string + logServicesId string + sinksId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the specified log service sink resource. +func (r *ProjectsLogServicesSinksService) Get(projectsId string, logServicesId string, sinksId string) *ProjectsLogServicesSinksGetCall { + c := &ProjectsLogServicesSinksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logServicesId = logServicesId + c.sinksId = sinksId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogServicesSinksGetCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLogServicesSinksGetCall) IfNoneMatch(entityTag string) *ProjectsLogServicesSinksGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogServicesSinksGetCall) Context(ctx context.Context) *ProjectsLogServicesSinksGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogServicesSinksGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "logServicesId": c.logServicesId, + "sinksId": c.sinksId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logServices.sinks.get" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLogServicesSinksGetCall) Do() (*LogSink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LogSink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the specified log service sink resource.", + // "httpMethod": "GET", + // "id": "logging.projects.logServices.sinks.get", + // "parameterOrder": [ + // "projectsId", + // "logServicesId", + // "sinksId" + // ], + // "parameters": { + // "logServicesId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `sinkName`. The name of the sink to return.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sinksId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}", + // "response": { + // "$ref": "LogSink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "logging.projects.logServices.sinks.list": + +type ProjectsLogServicesSinksListCall struct { + s *Service + projectsId string + logServicesId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists log service sinks associated with the specified service. +func (r *ProjectsLogServicesSinksService) List(projectsId string, logServicesId string) *ProjectsLogServicesSinksListCall { + c := &ProjectsLogServicesSinksListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logServicesId = logServicesId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogServicesSinksListCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLogServicesSinksListCall) IfNoneMatch(entityTag string) *ProjectsLogServicesSinksListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogServicesSinksListCall) Context(ctx context.Context) *ProjectsLogServicesSinksListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogServicesSinksListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "logServicesId": c.logServicesId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logServices.sinks.list" call. +// Exactly one of *ListLogServiceSinksResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListLogServiceSinksResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLogServicesSinksListCall) Do() (*ListLogServiceSinksResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListLogServiceSinksResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists log service sinks associated with the specified service.", + // "httpMethod": "GET", + // "id": "logging.projects.logServices.sinks.list", + // "parameterOrder": [ + // "projectsId", + // "logServicesId" + // ], + // "parameters": { + // "logServicesId": { + // "description": "Part of `serviceName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `serviceName`. The name of the service for which to list sinks.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks", + // "response": { + // "$ref": "ListLogServiceSinksResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "logging.projects.logServices.sinks.update": + +type ProjectsLogServicesSinksUpdateCall struct { + s *Service + projectsId string + logServicesId string + sinksId string + logsink *LogSink + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Creates or update the specified log service sink resource. +func (r *ProjectsLogServicesSinksService) Update(projectsId string, logServicesId string, sinksId string, logsink *LogSink) *ProjectsLogServicesSinksUpdateCall { + c := &ProjectsLogServicesSinksUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logServicesId = logServicesId + c.sinksId = sinksId + c.logsink = logsink + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogServicesSinksUpdateCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogServicesSinksUpdateCall) Context(ctx context.Context) *ProjectsLogServicesSinksUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogServicesSinksUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "logServicesId": c.logServicesId, + "sinksId": c.sinksId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logServices.sinks.update" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLogServicesSinksUpdateCall) Do() (*LogSink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LogSink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates or update the specified log service sink resource.", + // "httpMethod": "PUT", + // "id": "logging.projects.logServices.sinks.update", + // "parameterOrder": [ + // "projectsId", + // "logServicesId", + // "sinksId" + // ], + // "parameters": { + // "logServicesId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `sinkName`. The name of the sink to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sinksId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}", + // "request": { + // "$ref": "LogSink" + // }, + // "response": { + // "$ref": "LogSink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "logging.projects.logs.delete": + +type ProjectsLogsDeleteCall struct { + s *Service + projectsId string + logsId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified log resource and all log entries +// contained in it. +func (r *ProjectsLogsService) Delete(projectsId string, logsId string) *ProjectsLogsDeleteCall { + c := &ProjectsLogsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logsId = logsId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLogsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogsDeleteCall) Context(ctx context.Context) *ProjectsLogsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "logsId": c.logsId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logs.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLogsDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified log resource and all log entries contained in it.", + // "httpMethod": "DELETE", + // "id": "logging.projects.logs.delete", + // "parameterOrder": [ + // "projectsId", + // "logsId" + // ], + // "parameters": { + // "logsId": { + // "description": "Part of `logName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `logName`. The log resource to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logs/{logsId}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "logging.projects.logs.list": + +type ProjectsLogsListCall struct { + s *Service + projectsId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists log resources belonging to the specified project. +func (r *ProjectsLogsService) List(projectsId string) *ProjectsLogsListCall { + c := &ProjectsLogsListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return. +func (c *ProjectsLogsListCall) PageSize(pageSize int64) *ProjectsLogsListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": An opaque token, +// returned as `nextPageToken` by a prior `ListLogs` operation. If +// `pageToken` is supplied, then the other fields of this request are +// ignored, and instead the previous `ListLogs` operation is continued. +func (c *ProjectsLogsListCall) PageToken(pageToken string) *ProjectsLogsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// ServiceIndexPrefix sets the optional parameter "serviceIndexPrefix": +// A log service index prefix for which to list logs. Only logs +// containing entries whose metadata that includes these label values +// (associated with index keys) are returned. The prefix is a slash +// separated list of values, and need not specify all index labels. An +// empty index (or a single slash) matches all log service indexes. +func (c *ProjectsLogsListCall) ServiceIndexPrefix(serviceIndexPrefix string) *ProjectsLogsListCall { + c.opt_["serviceIndexPrefix"] = serviceIndexPrefix + return c +} + +// ServiceName sets the optional parameter "serviceName": A service name +// for which to list logs. Only logs containing entries whose metadata +// includes this service name are returned. If `serviceName` and +// `serviceIndexPrefix` are both empty, then all log names are returned. +// To list all log names, regardless of service, leave both the +// `serviceName` and `serviceIndexPrefix` empty. To list log names +// containing entries with a particular service name (or explicitly +// empty service name) set `serviceName` to the desired value and +// `serviceIndexPrefix` to "/". +func (c *ProjectsLogsListCall) ServiceName(serviceName string) *ProjectsLogsListCall { + c.opt_["serviceName"] = serviceName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogsListCall) Fields(s ...googleapi.Field) *ProjectsLogsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLogsListCall) IfNoneMatch(entityTag string) *ProjectsLogsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogsListCall) Context(ctx context.Context) *ProjectsLogsListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["serviceIndexPrefix"]; ok { + params.Set("serviceIndexPrefix", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["serviceName"]; ok { + params.Set("serviceName", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logs.list" call. +// Exactly one of *ListLogsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLogsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLogsListCall) Do() (*ListLogsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListLogsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists log resources belonging to the specified project.", + // "httpMethod": "GET", + // "id": "logging.projects.logs.list", + // "parameterOrder": [ + // "projectsId" + // ], + // "parameters": { + // "pageSize": { + // "description": "The maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "An opaque token, returned as `nextPageToken` by a prior `ListLogs` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogs` operation is continued.", + // "location": "query", + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `projectName`. The project name for which to list the log resources.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "serviceIndexPrefix": { + // "description": "A log service index prefix for which to list logs. Only logs containing entries whose metadata that includes these label values (associated with index keys) are returned. The prefix is a slash separated list of values, and need not specify all index labels. An empty index (or a single slash) matches all log service indexes.", + // "location": "query", + // "type": "string" + // }, + // "serviceName": { + // "description": "A service name for which to list logs. Only logs containing entries whose metadata includes this service name are returned. If `serviceName` and `serviceIndexPrefix` are both empty, then all log names are returned. To list all log names, regardless of service, leave both the `serviceName` and `serviceIndexPrefix` empty. To list log names containing entries with a particular service name (or explicitly empty service name) set `serviceName` to the desired value and `serviceIndexPrefix` to `\"/\"`.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logs", + // "response": { + // "$ref": "ListLogsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "logging.projects.logs.entries.write": + +type ProjectsLogsEntriesWriteCall struct { + s *Service + projectsId string + logsId string + writelogentriesrequest *WriteLogEntriesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Write: Creates one or more log entries in a log. You must supply a +// list of `LogEntry` objects, named `entries`. Each `LogEntry` object +// must contain a payload object and a `LogEntryMetadata` object that +// describes the entry. You must fill in all the fields of the entry, +// metadata, and payload. You can also supply a map, `commonLabels`, +// that supplies default (key, value) data for the +// `entries[].metadata.labels` maps, saving you the trouble of creating +// identical copies for each entry. +func (r *ProjectsLogsEntriesService) Write(projectsId string, logsId string, writelogentriesrequest *WriteLogEntriesRequest) *ProjectsLogsEntriesWriteCall { + c := &ProjectsLogsEntriesWriteCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logsId = logsId + c.writelogentriesrequest = writelogentriesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogsEntriesWriteCall) Fields(s ...googleapi.Field) *ProjectsLogsEntriesWriteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogsEntriesWriteCall) Context(ctx context.Context) *ProjectsLogsEntriesWriteCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogsEntriesWriteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.writelogentriesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/entries:write") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "logsId": c.logsId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logs.entries.write" call. +// Exactly one of *WriteLogEntriesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *WriteLogEntriesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLogsEntriesWriteCall) Do() (*WriteLogEntriesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &WriteLogEntriesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates one or more log entries in a log. You must supply a list of `LogEntry` objects, named `entries`. Each `LogEntry` object must contain a payload object and a `LogEntryMetadata` object that describes the entry. You must fill in all the fields of the entry, metadata, and payload. You can also supply a map, `commonLabels`, that supplies default (key, value) data for the `entries[].metadata.labels` maps, saving you the trouble of creating identical copies for each entry.", + // "httpMethod": "POST", + // "id": "logging.projects.logs.entries.write", + // "parameterOrder": [ + // "projectsId", + // "logsId" + // ], + // "parameters": { + // "logsId": { + // "description": "Part of `logName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `logName`. The name of the log resource into which to insert the log entries.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logs/{logsId}/entries:write", + // "request": { + // "$ref": "WriteLogEntriesRequest" + // }, + // "response": { + // "$ref": "WriteLogEntriesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "logging.projects.logs.sinks.create": + +type ProjectsLogsSinksCreateCall struct { + s *Service + projectsId string + logsId string + logsink *LogSink + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates the specified log sink resource. +func (r *ProjectsLogsSinksService) Create(projectsId string, logsId string, logsink *LogSink) *ProjectsLogsSinksCreateCall { + c := &ProjectsLogsSinksCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logsId = logsId + c.logsink = logsink + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogsSinksCreateCall) Fields(s ...googleapi.Field) *ProjectsLogsSinksCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogsSinksCreateCall) Context(ctx context.Context) *ProjectsLogsSinksCreateCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogsSinksCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "logsId": c.logsId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logs.sinks.create" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLogsSinksCreateCall) Do() (*LogSink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LogSink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates the specified log sink resource.", + // "httpMethod": "POST", + // "id": "logging.projects.logs.sinks.create", + // "parameterOrder": [ + // "projectsId", + // "logsId" + // ], + // "parameters": { + // "logsId": { + // "description": "Part of `logName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `logName`. The log in which to create a sink resource.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks", + // "request": { + // "$ref": "LogSink" + // }, + // "response": { + // "$ref": "LogSink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "logging.projects.logs.sinks.delete": + +type ProjectsLogsSinksDeleteCall struct { + s *Service + projectsId string + logsId string + sinksId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified log sink resource. +func (r *ProjectsLogsSinksService) Delete(projectsId string, logsId string, sinksId string) *ProjectsLogsSinksDeleteCall { + c := &ProjectsLogsSinksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logsId = logsId + c.sinksId = sinksId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogsSinksDeleteCall) Fields(s ...googleapi.Field) *ProjectsLogsSinksDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogsSinksDeleteCall) Context(ctx context.Context) *ProjectsLogsSinksDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogsSinksDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "logsId": c.logsId, + "sinksId": c.sinksId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logs.sinks.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLogsSinksDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified log sink resource.", + // "httpMethod": "DELETE", + // "id": "logging.projects.logs.sinks.delete", + // "parameterOrder": [ + // "projectsId", + // "logsId", + // "sinksId" + // ], + // "parameters": { + // "logsId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `sinkName`. The name of the sink to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sinksId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "logging.projects.logs.sinks.get": + +type ProjectsLogsSinksGetCall struct { + s *Service + projectsId string + logsId string + sinksId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the specified log sink resource. +func (r *ProjectsLogsSinksService) Get(projectsId string, logsId string, sinksId string) *ProjectsLogsSinksGetCall { + c := &ProjectsLogsSinksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logsId = logsId + c.sinksId = sinksId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogsSinksGetCall) Fields(s ...googleapi.Field) *ProjectsLogsSinksGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLogsSinksGetCall) IfNoneMatch(entityTag string) *ProjectsLogsSinksGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogsSinksGetCall) Context(ctx context.Context) *ProjectsLogsSinksGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogsSinksGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "logsId": c.logsId, + "sinksId": c.sinksId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logs.sinks.get" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLogsSinksGetCall) Do() (*LogSink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LogSink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the specified log sink resource.", + // "httpMethod": "GET", + // "id": "logging.projects.logs.sinks.get", + // "parameterOrder": [ + // "projectsId", + // "logsId", + // "sinksId" + // ], + // "parameters": { + // "logsId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `sinkName`. The name of the sink resource to return.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sinksId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}", + // "response": { + // "$ref": "LogSink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "logging.projects.logs.sinks.list": + +type ProjectsLogsSinksListCall struct { + s *Service + projectsId string + logsId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists log sinks associated with the specified log. +func (r *ProjectsLogsSinksService) List(projectsId string, logsId string) *ProjectsLogsSinksListCall { + c := &ProjectsLogsSinksListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logsId = logsId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogsSinksListCall) Fields(s ...googleapi.Field) *ProjectsLogsSinksListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLogsSinksListCall) IfNoneMatch(entityTag string) *ProjectsLogsSinksListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogsSinksListCall) Context(ctx context.Context) *ProjectsLogsSinksListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogsSinksListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "logsId": c.logsId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logs.sinks.list" call. +// Exactly one of *ListLogSinksResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLogSinksResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLogsSinksListCall) Do() (*ListLogSinksResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListLogSinksResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists log sinks associated with the specified log.", + // "httpMethod": "GET", + // "id": "logging.projects.logs.sinks.list", + // "parameterOrder": [ + // "projectsId", + // "logsId" + // ], + // "parameters": { + // "logsId": { + // "description": "Part of `logName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `logName`. The log for which to list sinks.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks", + // "response": { + // "$ref": "ListLogSinksResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "logging.projects.logs.sinks.update": + +type ProjectsLogsSinksUpdateCall struct { + s *Service + projectsId string + logsId string + sinksId string + logsink *LogSink + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Creates or updates the specified log sink resource. +func (r *ProjectsLogsSinksService) Update(projectsId string, logsId string, sinksId string, logsink *LogSink) *ProjectsLogsSinksUpdateCall { + c := &ProjectsLogsSinksUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logsId = logsId + c.sinksId = sinksId + c.logsink = logsink + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogsSinksUpdateCall) Fields(s ...googleapi.Field) *ProjectsLogsSinksUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogsSinksUpdateCall) Context(ctx context.Context) *ProjectsLogsSinksUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogsSinksUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "logsId": c.logsId, + "sinksId": c.sinksId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logs.sinks.update" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLogsSinksUpdateCall) Do() (*LogSink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LogSink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates or updates the specified log sink resource.", + // "httpMethod": "PUT", + // "id": "logging.projects.logs.sinks.update", + // "parameterOrder": [ + // "projectsId", + // "logsId", + // "sinksId" + // ], + // "parameters": { + // "logsId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `sinkName`. The name of the sink to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sinksId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}", + // "request": { + // "$ref": "LogSink" + // }, + // "response": { + // "$ref": "LogSink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofarray-1.json b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofarray-1.json new file mode 100644 index 000000000..81cefae3e --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/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/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofarray-1.want b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofarray-1.want new file mode 100644 index 000000000..c019e7f81 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofarray-1.want @@ -0,0 +1,91 @@ +// Package arrayofarray provides access to the Example API. +// +// Usage example: +// +// import "google.golang.org/api/arrayofarray/v1" +// ... +// arrayofarrayService, err := arrayofarray.New(oauthHttpClient) +package arrayofarray // import "google.golang.org/api/arrayofarray/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +// GeoJsonMultiPolygon: Multi Polygon +type GeoJsonMultiPolygon struct { + // Coordinates: Coordinate arrays. + Coordinates [][][][]float64 `json:"coordinates,omitempty"` + + // Type: Identifies this object as a multi-polygon. + // + // Possible values: + // "MultiPolygon" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Coordinates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoJsonMultiPolygon) MarshalJSON() ([]byte, error) { + type noMethod GeoJsonMultiPolygon + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofenum.json b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofenum.json new file mode 100644 index 000000000..f9f914812 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofenum.json @@ -0,0 +1,191 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"", + "discoveryVersion": "v1", + "id": "arrayofenum:v1", + "name": "arrayofenum", + "version": "v1", + "title": "Example API", + "description": "The Example API demonstrates an array of enums.", + "ownerDomain": "google.com", + "ownerName": "Google", + "protocol": "rest", + "schemas": { + "Container": { + "id": "Container", + "type": "object", + "description": "Represents a Google Tag Manager Container.", + "properties": { + "accountId": { + "type": "string", + "description": "GTM Account ID." + }, + "containerId": { + "type": "string", + "description": "This is a long description that has URLs in it that shouldn't break. 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" + }, + "domainName": { + "type": "array", + "description": "Optional list of domain names associated with the Container.", + "items": { + "type": "string" + } + }, + "enabledBuiltInVariable": { + "type": "array", + "description": "List of enabled built-in variables. Valid values include: pageUrl, pageHostname, pagePath, referrer, event, clickElement, clickClasses, clickId, clickTarget, clickUrl, clickText, formElement, formClasses, formId, formTarget, formUrl, formText, errorMessage, errorUrl, errorLine, newHistoryFragment, oldHistoryFragment, newHistoryState, oldHistoryState, historySource, containerVersion, debugMode, randomNumber, containerId.", + "items": { + "type": "string", + "enum": [ + "advertiserId", + "advertisingTrackingEnabled", + "appId", + "appName", + "appVersionCode", + "appVersionName", + "clickClasses", + "clickElement", + "clickId", + "clickTarget", + "clickText", + "clickUrl", + "containerId", + "containerVersion", + "debugMode", + "deviceName", + "errorLine", + "errorMessage", + "errorUrl", + "event", + "formClasses", + "formElement", + "formId", + "formTarget", + "formText", + "formUrl", + "historySource", + "language", + "newHistoryFragment", + "newHistoryState", + "oldHistoryFragment", + "oldHistoryState", + "osVersion", + "pageHostname", + "pagePath", + "pageUrl", + "platform", + "randomNumber", + "referrer", + "resolution", + "sdkVersion" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "fingerprint": { + "type": "string", + "description": "The fingerprint of the GTM Container as computed at storage time. This value is recomputed whenever the account is modified." + }, + "name": { + "type": "string", + "description": "Container display name.", + "annotations": { + "required": [ + "tagmanager.accounts.containers.create" + ] + } + }, + "notes": { + "type": "string", + "description": "Container Notes." + }, + "publicId": { + "type": "string", + "description": "Container Public ID." + }, + "timeZoneCountryId": { + "type": "string", + "description": "Container Country ID.", + "annotations": { + "required": [ + "tagmanager.accounts.containers.create" + ] + } + }, + "timeZoneId": { + "type": "string", + "description": "Container Time Zone ID.", + "annotations": { + "required": [ + "tagmanager.accounts.containers.create" + ] + } + }, + "usageContext": { + "type": "array", + "description": "List of Usage Contexts for the Container. Valid values include: web, android, ios.", + "items": { + "type": "string", + "enum": [ + "android", + "ios", + "web" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "annotations": { + "required": [ + "tagmanager.accounts.containers.create" + ] + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofenum.want b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofenum.want new file mode 100644 index 000000000..b85132c5e --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofenum.want @@ -0,0 +1,176 @@ +// Package arrayofenum provides access to the Example API. +// +// Usage example: +// +// import "google.golang.org/api/arrayofenum/v1" +// ... +// arrayofenumService, err := arrayofenum.New(oauthHttpClient) +package arrayofenum // import "google.golang.org/api/arrayofenum/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "arrayofenum:v1" +const apiName = "arrayofenum" +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 + UserAgent string // optional additional User-Agent fragment +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +// Container: Represents a Google Tag Manager Container. +type Container struct { + // AccountId: GTM Account ID. + AccountId string `json:"accountId,omitempty"` + + // ContainerId: This is a long description that has URLs in it that + // shouldn't break. + // 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 + ContainerId string `json:"containerId,omitempty"` + + // DomainName: Optional list of domain names associated with the + // Container. + DomainName []string `json:"domainName,omitempty"` + + // EnabledBuiltInVariable: List of enabled built-in variables. Valid + // values include: pageUrl, pageHostname, pagePath, referrer, event, + // clickElement, clickClasses, clickId, clickTarget, clickUrl, + // clickText, formElement, formClasses, formId, formTarget, formUrl, + // formText, errorMessage, errorUrl, errorLine, newHistoryFragment, + // oldHistoryFragment, newHistoryState, oldHistoryState, historySource, + // containerVersion, debugMode, randomNumber, containerId. + // + // Possible values: + // "advertiserId" + // "advertisingTrackingEnabled" + // "appId" + // "appName" + // "appVersionCode" + // "appVersionName" + // "clickClasses" + // "clickElement" + // "clickId" + // "clickTarget" + // "clickText" + // "clickUrl" + // "containerId" + // "containerVersion" + // "debugMode" + // "deviceName" + // "errorLine" + // "errorMessage" + // "errorUrl" + // "event" + // "formClasses" + // "formElement" + // "formId" + // "formTarget" + // "formText" + // "formUrl" + // "historySource" + // "language" + // "newHistoryFragment" + // "newHistoryState" + // "oldHistoryFragment" + // "oldHistoryState" + // "osVersion" + // "pageHostname" + // "pagePath" + // "pageUrl" + // "platform" + // "randomNumber" + // "referrer" + // "resolution" + // "sdkVersion" + EnabledBuiltInVariable []string `json:"enabledBuiltInVariable,omitempty"` + + // Fingerprint: The fingerprint of the GTM Container as computed at + // storage time. This value is recomputed whenever the account is + // modified. + Fingerprint string `json:"fingerprint,omitempty"` + + // Name: Container display name. + Name string `json:"name,omitempty"` + + // Notes: Container Notes. + Notes string `json:"notes,omitempty"` + + // PublicId: Container Public ID. + PublicId string `json:"publicId,omitempty"` + + // TimeZoneCountryId: Container Country ID. + TimeZoneCountryId string `json:"timeZoneCountryId,omitempty"` + + // TimeZoneId: Container Time Zone ID. + TimeZoneId string `json:"timeZoneId,omitempty"` + + // UsageContext: List of Usage Contexts for the Container. Valid values + // include: web, android, ios. + // + // Possible values: + // "android" + // "ios" + // "web" + UsageContext []string `json:"usageContext,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Container) MarshalJSON() ([]byte, error) { + type noMethod Container + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofmapofobjects.json b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofmapofobjects.json new file mode 100644 index 000000000..1d373619c --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofmapofobjects.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": { + "$ref": "Property", + "description": "Error level followed by a detailed error message." + } + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofmapofobjects.want b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofmapofobjects.want new file mode 100644 index 000000000..e5761f683 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofmapofobjects.want @@ -0,0 +1,84 @@ +// Package arrayofmapofstrings provides access to the Example API. +// +// Usage example: +// +// import "google.golang.org/api/arrayofmapofstrings/v1" +// ... +// arrayofmapofstringsService, err := arrayofmapofstrings.New(oauthHttpClient) +package arrayofmapofstrings // import "google.golang.org/api/arrayofmapofstrings/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +type Analyze struct { + // Errors: List of errors with the data. + Errors []map[string]Property `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Analyze) MarshalJSON() ([]byte, error) { + type noMethod Analyze + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofmapofstrings.json b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofmapofstrings.json new file mode 100644 index 000000000..65b338b11 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/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/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofmapofstrings.want b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofmapofstrings.want new file mode 100644 index 000000000..81675d30d --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/arrayofmapofstrings.want @@ -0,0 +1,84 @@ +// Package arrayofmapofstrings provides access to the Example API. +// +// Usage example: +// +// import "google.golang.org/api/arrayofmapofstrings/v1" +// ... +// arrayofmapofstringsService, err := arrayofmapofstrings.New(oauthHttpClient) +package arrayofmapofstrings // import "google.golang.org/api/arrayofmapofstrings/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +type Analyze struct { + // Errors: List of errors with the data. + Errors []map[string]string `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Analyze) MarshalJSON() ([]byte, error) { + type noMethod Analyze + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/blogger-3.json b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/blogger-3.json new file mode 100644 index 000000000..53caa8364 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/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/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/blogger-3.want b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/blogger-3.want new file mode 100644 index 000000000..8886eee7f --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/blogger-3.want @@ -0,0 +1,6191 @@ +// Package blogger provides access to the Blogger API. +// +// See https://developers.google.com/blogger/docs/3.0/getting_started +// +// Usage example: +// +// import "google.golang.org/api/blogger/v3" +// ... +// bloggerService, err := blogger.New(oauthHttpClient) +package blogger // import "google.golang.org/api/blogger/v3" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + BlogUserInfos *BlogUserInfosService + + Blogs *BlogsService + + Comments *CommentsService + + PageViews *PageViewsService + + Pages *PagesService + + PostUserInfos *PostUserInfosService + + Posts *PostsService + + Users *UsersService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CustomMetaData") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Blog) MarshalJSON() ([]byte, error) { + type noMethod Blog + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BlogLocale: The locale this Blog is set to. +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"` + + // ForceSendFields is a list of field names (e.g. "Country") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BlogLocale) MarshalJSON() ([]byte, error) { + type noMethod BlogLocale + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BlogPages: The container of pages in this blog. +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"` + + // ForceSendFields is a list of field names (e.g. "SelfLink") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BlogPages) MarshalJSON() ([]byte, error) { + type noMethod BlogPages + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BlogPosts: The container of posts in this blog. +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"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BlogPosts) MarshalJSON() ([]byte, error) { + type noMethod BlogPosts + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BlogUserInfos") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BlogList) MarshalJSON() ([]byte, error) { + type noMethod BlogList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "BlogId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BlogPerUserInfo) MarshalJSON() ([]byte, error) { + type noMethod BlogPerUserInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type BlogUserInfo struct { + // Blog: The Blog resource. + Blog *Blog `json:"blog,omitempty"` + + // BlogUserInfo: Information about a User for the Blog. + BlogUserInfo *BlogPerUserInfo `json:"blog_user_info,omitempty"` + + // Kind: The kind of this entity. Always blogger#blogUserInfo + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Blog") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BlogUserInfo) MarshalJSON() ([]byte, error) { + type noMethod BlogUserInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Author") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Comment) MarshalJSON() ([]byte, error) { + type noMethod Comment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentAuthor: The author of this Comment. +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"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentAuthor) MarshalJSON() ([]byte, error) { + type noMethod CommentAuthor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentAuthorImage: The comment creator's avatar. +type CommentAuthorImage struct { + // Url: The comment creator's avatar URL. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Url") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentAuthorImage) MarshalJSON() ([]byte, error) { + type noMethod CommentAuthorImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentBlog: Data about the blog containing this comment. +type CommentBlog struct { + // Id: The identifier of the blog containing this comment. + Id string `json:"id,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentBlog) MarshalJSON() ([]byte, error) { + type noMethod CommentBlog + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentInReplyTo: Data about the comment this is in reply to. +type CommentInReplyTo struct { + // Id: The identified of the parent of this comment. + Id string `json:"id,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentInReplyTo) MarshalJSON() ([]byte, error) { + type noMethod CommentInReplyTo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentPost: Data about the post containing this comment. +type CommentPost struct { + // Id: The identifier of the post containing this comment. + Id string `json:"id,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentPost) MarshalJSON() ([]byte, error) { + type noMethod CommentPost + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentList) MarshalJSON() ([]byte, error) { + type noMethod CommentList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Author") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Page) MarshalJSON() ([]byte, error) { + type noMethod Page + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PageAuthor: The author of this Page. +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"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PageAuthor) MarshalJSON() ([]byte, error) { + type noMethod PageAuthor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PageAuthorImage: The page author's avatar. +type PageAuthorImage struct { + // Url: The page author's avatar URL. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Url") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PageAuthorImage) MarshalJSON() ([]byte, error) { + type noMethod PageAuthorImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PageBlog: Data about the blog containing this Page. +type PageBlog struct { + // Id: The identifier of the blog containing this page. + Id string `json:"id,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PageBlog) MarshalJSON() ([]byte, error) { + type noMethod PageBlog + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PageList) MarshalJSON() ([]byte, error) { + type noMethod PageList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BlogId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Pageviews) MarshalJSON() ([]byte, error) { + type noMethod Pageviews + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Count") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PageviewsCounts) MarshalJSON() ([]byte, error) { + type noMethod PageviewsCounts + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Author") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Post) MarshalJSON() ([]byte, error) { + type noMethod Post + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PostAuthor: The author of this Post. +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"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostAuthor) MarshalJSON() ([]byte, error) { + type noMethod PostAuthor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PostAuthorImage: The Post author's avatar. +type PostAuthorImage struct { + // Url: The Post author's avatar URL. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Url") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostAuthorImage) MarshalJSON() ([]byte, error) { + type noMethod PostAuthorImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PostBlog: Data about the blog containing this Post. +type PostBlog struct { + // Id: The identifier of the Blog that contains this Post. + Id string `json:"id,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostBlog) MarshalJSON() ([]byte, error) { + type noMethod PostBlog + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PostImages struct { + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Url") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostImages) MarshalJSON() ([]byte, error) { + type noMethod PostImages + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PostLocation: The location for geotagged posts. +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"` + + // ForceSendFields is a list of field names (e.g. "Lat") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostLocation) MarshalJSON() ([]byte, error) { + type noMethod PostLocation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PostReplies: The container of comments on this Post. +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"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostReplies) MarshalJSON() ([]byte, error) { + type noMethod PostReplies + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostList) MarshalJSON() ([]byte, error) { + type noMethod PostList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "BlogId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostPerUserInfo) MarshalJSON() ([]byte, error) { + type noMethod PostPerUserInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // PostUserInfo: Information about a User for the Post. + PostUserInfo *PostPerUserInfo `json:"post_user_info,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostUserInfo) MarshalJSON() ([]byte, error) { + type noMethod PostUserInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostUserInfosList) MarshalJSON() ([]byte, error) { + type noMethod PostUserInfosList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "About") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *User) MarshalJSON() ([]byte, error) { + type noMethod User + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserBlogs: The container of blogs for this user. +type UserBlogs struct { + // SelfLink: The URL of the Blogs for this user. + SelfLink string `json:"selfLink,omitempty"` + + // ForceSendFields is a list of field names (e.g. "SelfLink") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserBlogs) MarshalJSON() ([]byte, error) { + type noMethod UserBlogs + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserLocale: This user's locale +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"` + + // ForceSendFields is a list of field names (e.g. "Country") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserLocale) MarshalJSON() ([]byte, error) { + type noMethod UserLocale + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "blogger.blogUserInfos.get": + +type BlogUserInfosGetCall struct { + s *Service + userId string + blogId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BlogUserInfosGetCall) Fields(s ...googleapi.Field) *BlogUserInfosGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BlogUserInfosGetCall) IfNoneMatch(entityTag string) *BlogUserInfosGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BlogUserInfosGetCall) Context(ctx context.Context) *BlogUserInfosGetCall { + c.ctx_ = ctx + return c +} + +func (c *BlogUserInfosGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxPosts"]; ok { + params.Set("maxPosts", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.blogUserInfos.get" call. +// Exactly one of *BlogUserInfo or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *BlogUserInfo.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *BlogUserInfosGetCall) Do() (*BlogUserInfo, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BlogUserInfo{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BlogsGetCall) Fields(s ...googleapi.Field) *BlogsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BlogsGetCall) IfNoneMatch(entityTag string) *BlogsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BlogsGetCall) Context(ctx context.Context) *BlogsGetCall { + c.ctx_ = ctx + return c +} + +func (c *BlogsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxPosts"]; ok { + params.Set("maxPosts", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.blogs.get" call. +// Exactly one of *Blog or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Blog.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *BlogsGetCall) Do() (*Blog, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Blog{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BlogsGetByUrlCall) Fields(s ...googleapi.Field) *BlogsGetByUrlCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BlogsGetByUrlCall) IfNoneMatch(entityTag string) *BlogsGetByUrlCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BlogsGetByUrlCall) Context(ctx context.Context) *BlogsGetByUrlCall { + c.ctx_ = ctx + return c +} + +func (c *BlogsGetByUrlCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("url", fmt.Sprintf("%v", c.url)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.blogs.getByUrl" call. +// Exactly one of *Blog or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Blog.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *BlogsGetByUrlCall) Do() (*Blog, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Blog{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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": +// +// Possible values: +// "ADMIN" - Admin level detail +// "AUTHOR" - Author level detail +// "READER" - Admin level detail +func (c *BlogsListByUserCall) View(view string) *BlogsListByUserCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BlogsListByUserCall) Fields(s ...googleapi.Field) *BlogsListByUserCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BlogsListByUserCall) IfNoneMatch(entityTag string) *BlogsListByUserCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BlogsListByUserCall) Context(ctx context.Context) *BlogsListByUserCall { + c.ctx_ = ctx + return c +} + +func (c *BlogsListByUserCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.blogs.listByUser" call. +// Exactly one of *BlogList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *BlogList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *BlogsListByUserCall) Do() (*BlogList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BlogList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsApproveCall) Fields(s ...googleapi.Field) *CommentsApproveCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsApproveCall) Context(ctx context.Context) *CommentsApproveCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsApproveCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/approve") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + "commentId": c.commentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.comments.approve" call. +// Exactly one of *Comment or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Comment.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CommentsApproveCall) Do() (*Comment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Comment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsDeleteCall) Fields(s ...googleapi.Field) *CommentsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsDeleteCall) Context(ctx context.Context) *CommentsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + "commentId": c.commentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.comments.delete" call. +func (c *CommentsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsGetCall) Fields(s ...googleapi.Field) *CommentsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CommentsGetCall) IfNoneMatch(entityTag string) *CommentsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsGetCall) Context(ctx context.Context) *CommentsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + "commentId": c.commentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.comments.get" call. +// Exactly one of *Comment or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Comment.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CommentsGetCall) Do() (*Comment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Comment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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": +// +// Possible values: +// "emptied" - Comments that have had their content removed +// "live" - Comments that are publicly visible +// "pending" - Comments that are awaiting administrator approval +// "spam" - Comments marked as spam by the administrator +func (c *CommentsListCall) Statuses(statuses string) *CommentsListCall { + c.opt_["statuses"] = statuses + return c +} + +// View sets the optional parameter "view": +// +// Possible values: +// "ADMIN" - Admin level detail +// "AUTHOR" - Author level detail +// "READER" - Admin level detail +func (c *CommentsListCall) View(view string) *CommentsListCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CommentsListCall) IfNoneMatch(entityTag string) *CommentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsListCall) Context(ctx context.Context) *CommentsListCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.comments.list" call. +// Exactly one of *CommentList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CommentList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CommentsListCall) Do() (*CommentList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CommentList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsListByBlogCall) Fields(s ...googleapi.Field) *CommentsListByBlogCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CommentsListByBlogCall) IfNoneMatch(entityTag string) *CommentsListByBlogCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsListByBlogCall) Context(ctx context.Context) *CommentsListByBlogCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsListByBlogCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.comments.listByBlog" call. +// Exactly one of *CommentList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CommentList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CommentsListByBlogCall) Do() (*CommentList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CommentList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsMarkAsSpamCall) Fields(s ...googleapi.Field) *CommentsMarkAsSpamCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsMarkAsSpamCall) Context(ctx context.Context) *CommentsMarkAsSpamCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsMarkAsSpamCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/spam") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + "commentId": c.commentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.comments.markAsSpam" call. +// Exactly one of *Comment or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Comment.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CommentsMarkAsSpamCall) Do() (*Comment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Comment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsRemoveContentCall) Fields(s ...googleapi.Field) *CommentsRemoveContentCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsRemoveContentCall) Context(ctx context.Context) *CommentsRemoveContentCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsRemoveContentCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/removecontent") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + "commentId": c.commentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.comments.removeContent" call. +// Exactly one of *Comment or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Comment.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CommentsRemoveContentCall) Do() (*Comment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Comment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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": +// +// Possible values: +// "30DAYS" - Page view counts from the last thirty days. +// "7DAYS" - Page view counts from the last seven days. +// "all" - Total page view counts from all time. +func (c *PageViewsGetCall) Range(range_ string) *PageViewsGetCall { + c.opt_["range"] = range_ + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PageViewsGetCall) Fields(s ...googleapi.Field) *PageViewsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PageViewsGetCall) IfNoneMatch(entityTag string) *PageViewsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PageViewsGetCall) Context(ctx context.Context) *PageViewsGetCall { + c.ctx_ = ctx + return c +} + +func (c *PageViewsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["range"]; ok { + params.Set("range", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pageviews") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.pageViews.get" call. +// Exactly one of *Pageviews or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Pageviews.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PageViewsGetCall) Do() (*Pageviews, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Pageviews{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PagesDeleteCall) Fields(s ...googleapi.Field) *PagesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PagesDeleteCall) Context(ctx context.Context) *PagesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *PagesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "pageId": c.pageId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.pages.delete" call. +func (c *PagesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a 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{} + ctx_ context.Context +} + +// 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": +// +// Possible values: +// "ADMIN" - Admin level detail +// "AUTHOR" - Author level detail +// "READER" - Admin level detail +func (c *PagesGetCall) View(view string) *PagesGetCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PagesGetCall) Fields(s ...googleapi.Field) *PagesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PagesGetCall) IfNoneMatch(entityTag string) *PagesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PagesGetCall) Context(ctx context.Context) *PagesGetCall { + c.ctx_ = ctx + return c +} + +func (c *PagesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "pageId": c.pageId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.pages.get" call. +// Exactly one of *Page or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Page.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PagesGetCall) Do() (*Page, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Page{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PagesInsertCall) Fields(s ...googleapi.Field) *PagesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PagesInsertCall) Context(ctx context.Context) *PagesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *PagesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.pages.insert" call. +// Exactly one of *Page or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Page.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PagesInsertCall) Do() (*Page, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Page{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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": +// +// Possible values: +// "draft" - Draft (unpublished) Pages +// "imported" - Pages that have had their content removed +// "live" - Pages that are publicly visible +func (c *PagesListCall) Statuses(statuses string) *PagesListCall { + c.opt_["statuses"] = statuses + return c +} + +// View sets the optional parameter "view": +// +// Possible values: +// "ADMIN" - Admin level detail +// "AUTHOR" - Author level detail +// "READER" - Admin level detail +func (c *PagesListCall) View(view string) *PagesListCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PagesListCall) Fields(s ...googleapi.Field) *PagesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PagesListCall) IfNoneMatch(entityTag string) *PagesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PagesListCall) Context(ctx context.Context) *PagesListCall { + c.ctx_ = ctx + return c +} + +func (c *PagesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.pages.list" call. +// Exactly one of *PageList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *PageList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PagesListCall) Do() (*PageList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PageList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PagesPatchCall) Fields(s ...googleapi.Field) *PagesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PagesPatchCall) Context(ctx context.Context) *PagesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *PagesPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "pageId": c.pageId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.pages.patch" call. +// Exactly one of *Page or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Page.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PagesPatchCall) Do() (*Page, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Page{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PagesUpdateCall) Fields(s ...googleapi.Field) *PagesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PagesUpdateCall) Context(ctx context.Context) *PagesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *PagesUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "pageId": c.pageId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.pages.update" call. +// Exactly one of *Page or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Page.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PagesUpdateCall) Do() (*Page, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Page{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostUserInfosGetCall) Fields(s ...googleapi.Field) *PostUserInfosGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PostUserInfosGetCall) IfNoneMatch(entityTag string) *PostUserInfosGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostUserInfosGetCall) Context(ctx context.Context) *PostUserInfosGetCall { + c.ctx_ = ctx + return c +} + +func (c *PostUserInfosGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxComments"]; ok { + params.Set("maxComments", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "blogId": c.blogId, + "postId": c.postId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.postUserInfos.get" call. +// Exactly one of *PostUserInfo or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PostUserInfo.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PostUserInfosGetCall) Do() (*PostUserInfo, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PostUserInfo{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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 +// +// Possible values: +// "published" - Order by the date the post was published +// "updated" - Order by the date the post was last updated +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": +// +// Possible values: +// "draft" - Draft posts +// "live" - Published posts +// "scheduled" - Posts that are scheduled to publish in future. +func (c *PostUserInfosListCall) Statuses(statuses string) *PostUserInfosListCall { + c.opt_["statuses"] = statuses + return c +} + +// View sets the optional parameter "view": +// +// Possible values: +// "ADMIN" - Admin level detail +// "AUTHOR" - Author level detail +// "READER" - Reader level detail +func (c *PostUserInfosListCall) View(view string) *PostUserInfosListCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostUserInfosListCall) Fields(s ...googleapi.Field) *PostUserInfosListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PostUserInfosListCall) IfNoneMatch(entityTag string) *PostUserInfosListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostUserInfosListCall) Context(ctx context.Context) *PostUserInfosListCall { + c.ctx_ = ctx + return c +} + +func (c *PostUserInfosListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}/posts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.postUserInfos.list" call. +// Exactly one of *PostUserInfosList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PostUserInfosList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PostUserInfosListCall) Do() (*PostUserInfosList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PostUserInfosList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsDeleteCall) Fields(s ...googleapi.Field) *PostsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsDeleteCall) Context(ctx context.Context) *PostsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *PostsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.delete" call. +func (c *PostsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a 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{} + ctx_ context.Context +} + +// 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": +// +// Possible values: +// "ADMIN" - Admin level detail +// "AUTHOR" - Author level detail +// "READER" - Admin level detail +func (c *PostsGetCall) View(view string) *PostsGetCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsGetCall) Fields(s ...googleapi.Field) *PostsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PostsGetCall) IfNoneMatch(entityTag string) *PostsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsGetCall) Context(ctx context.Context) *PostsGetCall { + c.ctx_ = ctx + return c +} + +func (c *PostsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.get" call. +// Exactly one of *Post or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Post.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PostsGetCall) Do() (*Post, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Post{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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": +// +// Possible values: +// "ADMIN" - Admin level detail +// "AUTHOR" - Author level detail +// "READER" - Admin level detail +func (c *PostsGetByPathCall) View(view string) *PostsGetByPathCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsGetByPathCall) Fields(s ...googleapi.Field) *PostsGetByPathCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PostsGetByPathCall) IfNoneMatch(entityTag string) *PostsGetByPathCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsGetByPathCall) Context(ctx context.Context) *PostsGetByPathCall { + c.ctx_ = ctx + return c +} + +func (c *PostsGetByPathCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/bypath") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.getByPath" call. +// Exactly one of *Post or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Post.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PostsGetByPathCall) Do() (*Post, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Post{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsInsertCall) Fields(s ...googleapi.Field) *PostsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsInsertCall) Context(ctx context.Context) *PostsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *PostsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["isDraft"]; ok { + params.Set("isDraft", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.insert" call. +// Exactly one of *Post or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Post.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PostsInsertCall) Do() (*Post, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Post{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +// +// Possible values: +// "published" - Order by the date the post was published +// "updated" - Order by the date the post was last updated +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": +// +// Possible values: +// "draft" - Draft posts +// "live" - Published posts +// "scheduled" - Posts that are scheduled to publish in future. +func (c *PostsListCall) Statuses(statuses string) *PostsListCall { + c.opt_["statuses"] = statuses + return c +} + +// View sets the optional parameter "view": +// +// Possible values: +// "ADMIN" - Admin level detail +// "AUTHOR" - Author level detail +// "READER" - Reader level detail +func (c *PostsListCall) View(view string) *PostsListCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsListCall) Fields(s ...googleapi.Field) *PostsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PostsListCall) IfNoneMatch(entityTag string) *PostsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsListCall) Context(ctx context.Context) *PostsListCall { + c.ctx_ = ctx + return c +} + +func (c *PostsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.list" call. +// Exactly one of *PostList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *PostList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PostsListCall) Do() (*PostList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PostList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsPatchCall) Fields(s ...googleapi.Field) *PostsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsPatchCall) Context(ctx context.Context) *PostsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *PostsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.patch" call. +// Exactly one of *Post or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Post.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PostsPatchCall) Do() (*Post, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Post{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsPublishCall) Fields(s ...googleapi.Field) *PostsPublishCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsPublishCall) Context(ctx context.Context) *PostsPublishCall { + c.ctx_ = ctx + return c +} + +func (c *PostsPublishCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["publishDate"]; ok { + params.Set("publishDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/publish") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.publish" call. +// Exactly one of *Post or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Post.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PostsPublishCall) Do() (*Post, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Post{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsRevertCall) Fields(s ...googleapi.Field) *PostsRevertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsRevertCall) Context(ctx context.Context) *PostsRevertCall { + c.ctx_ = ctx + return c +} + +func (c *PostsRevertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/revert") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.revert" call. +// Exactly one of *Post or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Post.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PostsRevertCall) Do() (*Post, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Post{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +// +// Possible values: +// "published" - Order by the date the post was published +// "updated" - Order by the date the post was last updated +func (c *PostsSearchCall) OrderBy(orderBy string) *PostsSearchCall { + c.opt_["orderBy"] = orderBy + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsSearchCall) Fields(s ...googleapi.Field) *PostsSearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PostsSearchCall) IfNoneMatch(entityTag string) *PostsSearchCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsSearchCall) Context(ctx context.Context) *PostsSearchCall { + c.ctx_ = ctx + return c +} + +func (c *PostsSearchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/search") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.search" call. +// Exactly one of *PostList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *PostList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PostsSearchCall) Do() (*PostList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PostList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsUpdateCall) Fields(s ...googleapi.Field) *PostsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsUpdateCall) Context(ctx context.Context) *PostsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *PostsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.update" call. +// Exactly one of *Post or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Post.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PostsUpdateCall) Do() (*Post, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Post{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall { + c.ctx_ = ctx + return c +} + +func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.users.get" call. +// Exactly one of *User or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *User.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *UsersGetCall) Do() (*User, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &User{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/getwithoutbody.json b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/getwithoutbody.json new file mode 100644 index 000000000..b23b25741 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/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/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/getwithoutbody.want b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/getwithoutbody.want new file mode 100644 index 000000000..2f4d0809c --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/getwithoutbody.want @@ -0,0 +1,302 @@ +// Package getwithoutbody provides access to the Example API. +// +// Usage example: +// +// import "google.golang.org/api/getwithoutbody/v1" +// ... +// getwithoutbodyService, err := getwithoutbody.New(oauthHttpClient) +package getwithoutbody // import "google.golang.org/api/getwithoutbody/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + MetricDescriptors *MetricDescriptorsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewMetricDescriptorsService(s *Service) *MetricDescriptorsService { + rs := &MetricDescriptorsService{s: s} + return rs +} + +type MetricDescriptorsService struct { + s *Service +} + +// ListMetricRequest: The request of +// getwithoutbody.metricDescriptors.list. +type ListMetricRequest struct { + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "getwithoutbody#listMetricRequest". + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListMetricRequest) MarshalJSON() ([]byte, error) { + type noMethod ListMetricRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListMetricResponse: The response of +// getwithoutbody.metricDescriptors.list. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListMetricResponse) MarshalJSON() ([]byte, error) { + type noMethod ListMetricResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "getwithoutbody.metricDescriptors.list": + +type MetricDescriptorsListCall struct { + s *Service + project string + listmetricrequest *ListMetricRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MetricDescriptorsListCall) Fields(s ...googleapi.Field) *MetricDescriptorsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MetricDescriptorsListCall) IfNoneMatch(entityTag string) *MetricDescriptorsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MetricDescriptorsListCall) Context(ctx context.Context) *MetricDescriptorsListCall { + c.ctx_ = ctx + return c +} + +func (c *MetricDescriptorsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/metricDescriptors") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "getwithoutbody.metricDescriptors.list" call. +// Exactly one of *ListMetricResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListMetricResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MetricDescriptorsListCall) Do() (*ListMetricResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListMetricResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofany.json b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofany.json new file mode 100644 index 000000000..8253ef15f --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofany.json @@ -0,0 +1,51 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"", + "discoveryVersion": "v1", + "id": "mapofany:v1", + "name": "mapofany", + "version": "v1", + "title": "Example API", + "description": "The Example API demonstrates an associative array.", + "ownerDomain": "google.com", + "ownerName": "Google", + "protocol": "rest", + "schemas": { + "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": { + "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." + } + } + } + } + } + }, + "JsonObject": { + "id": "JsonObject", + "type": "object", + "description": "Represents a single JSON object.", + "additionalProperties": { + "$ref": "JsonValue" + } + }, + "JsonValue": { + "id": "JsonValue", + "type": "any" + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofany.want b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofany.want new file mode 100644 index 000000000..526eb942f --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofany.want @@ -0,0 +1,110 @@ +// Package mapofany provides access to the Example API. +// +// Usage example: +// +// import "google.golang.org/api/mapofany/v1" +// ... +// mapofanyService, err := mapofany.New(oauthHttpClient) +package mapofany // import "google.golang.org/api/mapofany/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "mapofany:v1" +const apiName = "mapofany" +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 + UserAgent string // optional additional User-Agent fragment +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +type JsonValue interface{} + +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TableDataInsertAllRequest) MarshalJSON() ([]byte, error) { + type noMethod TableDataInsertAllRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TableDataInsertAllRequestRows struct { + // 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 map[string]JsonValue `json:"json,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Json") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TableDataInsertAllRequestRows) MarshalJSON() ([]byte, error) { + type noMethod TableDataInsertAllRequestRows + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofarrayofobjects.json b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofarrayofobjects.json new file mode 100644 index 000000000..5ab065e2d --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofarrayofobjects.json @@ -0,0 +1,72 @@ +{ + "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." + }, + "tags": { + "type": "object", + "description": "A map of additional information.", + "additionalProperties": { + "type": "array", + "description": "A string which maps to an array of values.", + "items": { + "$ref": "Property" + } + } + } + } + }, + "GetMapResponse": { + "id": "GetMapResponse", + "type": "object", + "description": "Response of getting a map.", + "additionalProperties": { + "type": "string" + } + } + }, + "resources": { + "atlas": { + "methods": { + "getMap": { + "id": "mapofstrings.getMap", + "path": "map", + "httpMethod": "GET", + "description": "Get a map.", + "response": { + "$ref": "GetMapResponse" + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofarrayofobjects.want b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofarrayofobjects.want new file mode 100644 index 000000000..adbe1fe32 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofarrayofobjects.want @@ -0,0 +1,195 @@ +// Package additionalprops provides access to the Example API. +// +// Usage example: +// +// import "google.golang.org/api/additionalprops/v1" +// ... +// additionalpropsService, err := additionalprops.New(oauthHttpClient) +package additionalprops // import "google.golang.org/api/additionalprops/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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} + s.Atlas = NewAtlasService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Atlas *AtlasService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAtlasService(s *Service) *AtlasService { + rs := &AtlasService{s: s} + return rs +} + +type AtlasService struct { + s *Service +} + +// TimeseriesDescriptor: The descriptions of a time series. +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"` + + // Tags: A map of additional information. + Tags map[string][]Property `json:"tags,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Labels") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TimeseriesDescriptor) MarshalJSON() ([]byte, error) { + type noMethod TimeseriesDescriptor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "mapofstrings.getMap": + +type AtlasGetMapCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetMap: Get a map. +func (r *AtlasService) GetMap() *AtlasGetMapCall { + c := &AtlasGetMapCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AtlasGetMapCall) Fields(s ...googleapi.Field) *AtlasGetMapCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AtlasGetMapCall) IfNoneMatch(entityTag string) *AtlasGetMapCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AtlasGetMapCall) Context(ctx context.Context) *AtlasGetMapCall { + c.ctx_ = ctx + return c +} + +func (c *AtlasGetMapCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "map") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapofstrings.getMap" call. +func (c *AtlasGetMapCall) Do() (map[string]string, error) { + res, err := c.doRequest("json") + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret map[string]string + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get a map.", + // "httpMethod": "GET", + // "id": "mapofstrings.getMap", + // "path": "map", + // "response": { + // "$ref": "GetMapResponse" + // } + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofobjects.json b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofobjects.json new file mode 100644 index 000000000..e447c0f9b --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofobjects.json @@ -0,0 +1,30 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"", + "discoveryVersion": "v1", + "id": "additionalpropsobjs:v1", + "name": "additionalpropsobjs", + "version": "v1", + "title": "Example API", + "description": "The Example API demonstrates an associative array.", + "ownerDomain": "google.com", + "ownerName": "Google", + "protocol": "rest", + "schemas": { + "Entity": { + "id": "Entity", + "type": "object", + "externalTypeName": "apphosting.client.datastoreservice.proto.Entity", + "properties": { + "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 \"\"." + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofobjects.want b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofobjects.want new file mode 100644 index 000000000..ba9dad837 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofobjects.want @@ -0,0 +1,84 @@ +// Package additionalpropsobjs provides access to the Example API. +// +// Usage example: +// +// import "google.golang.org/api/additionalpropsobjs/v1" +// ... +// additionalpropsobjsService, err := additionalpropsobjs.New(oauthHttpClient) +package additionalpropsobjs // import "google.golang.org/api/additionalpropsobjs/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "additionalpropsobjs:v1" +const apiName = "additionalpropsobjs" +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 + UserAgent string // optional additional User-Agent fragment +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +type Entity struct { + // Properties: The entity's properties. + Properties map[string]Property `json:"properties,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Properties") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Entity) MarshalJSON() ([]byte, error) { + type noMethod Entity + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofstrings-1.json b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofstrings-1.json new file mode 100644 index 000000000..d766ed1b7 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofstrings-1.json @@ -0,0 +1,72 @@ +{ + "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." + }, + "tags": { + "type": "object", + "description": "A map of additional information.", + "additionalProperties": { + "type": "array", + "description": "A string which maps to an array of values.", + "items": { + "type": "string" + } + } + } + } + }, + "GetMapResponse": { + "id": "GetMapResponse", + "type": "object", + "description": "Response of getting a map.", + "additionalProperties": { + "type": "string" + } + } + }, + "resources": { + "atlas": { + "methods": { + "getMap": { + "id": "mapofstrings.getMap", + "path": "map", + "httpMethod": "GET", + "description": "Get a map.", + "response": { + "$ref": "GetMapResponse" + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofstrings-1.want b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofstrings-1.want new file mode 100644 index 000000000..e405ff5dd --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/mapofstrings-1.want @@ -0,0 +1,195 @@ +// Package additionalprops provides access to the Example API. +// +// Usage example: +// +// import "google.golang.org/api/additionalprops/v1" +// ... +// additionalpropsService, err := additionalprops.New(oauthHttpClient) +package additionalprops // import "google.golang.org/api/additionalprops/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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} + s.Atlas = NewAtlasService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Atlas *AtlasService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAtlasService(s *Service) *AtlasService { + rs := &AtlasService{s: s} + return rs +} + +type AtlasService struct { + s *Service +} + +// TimeseriesDescriptor: The descriptions of a time series. +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"` + + // Tags: A map of additional information. + Tags map[string][]string `json:"tags,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Labels") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TimeseriesDescriptor) MarshalJSON() ([]byte, error) { + type noMethod TimeseriesDescriptor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "mapofstrings.getMap": + +type AtlasGetMapCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetMap: Get a map. +func (r *AtlasService) GetMap() *AtlasGetMapCall { + c := &AtlasGetMapCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AtlasGetMapCall) Fields(s ...googleapi.Field) *AtlasGetMapCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AtlasGetMapCall) IfNoneMatch(entityTag string) *AtlasGetMapCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AtlasGetMapCall) Context(ctx context.Context) *AtlasGetMapCall { + c.ctx_ = ctx + return c +} + +func (c *AtlasGetMapCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "map") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapofstrings.getMap" call. +func (c *AtlasGetMapCall) Do() (map[string]string, error) { + res, err := c.doRequest("json") + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret map[string]string + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get a map.", + // "httpMethod": "GET", + // "id": "mapofstrings.getMap", + // "path": "map", + // "response": { + // "$ref": "GetMapResponse" + // } + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/quotednum.json b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/quotednum.json new file mode 100644 index 000000000..738555e65 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/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/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/quotednum.want b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/quotednum.want new file mode 100644 index 000000000..6bb89a889 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/quotednum.want @@ -0,0 +1,94 @@ +// Package adexchangebuyer provides access to the Ad Exchange Buyer API. +// +// See https://developers.google.com/ad-exchange/buyer-rest +// +// Usage example: +// +// import "google.golang.org/api/adexchangebuyer/v1.1" +// ... +// adexchangebuyerService, err := adexchangebuyer.New(oauthHttpClient) +package adexchangebuyer // import "google.golang.org/api/adexchangebuyer/v1.1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +// Creative: A creative and its classification data. +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"` + + // ForceSendFields is a list of field names (e.g. "AdvertiserId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Creative) MarshalJSON() ([]byte, error) { + type noMethod Creative + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/resource-named-service.json b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/resource-named-service.json new file mode 100644 index 000000000..53b7b1648 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/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/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/resource-named-service.want b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/resource-named-service.want new file mode 100644 index 000000000..19d3656d8 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/resource-named-service.want @@ -0,0 +1,6191 @@ +// Package blogger provides access to the Blogger API. +// +// See https://developers.google.com/blogger/docs/3.0/getting_started +// +// Usage example: +// +// import "google.golang.org/api/blogger/v3" +// ... +// bloggerService, err := blogger.New(oauthHttpClient) +package blogger // import "google.golang.org/api/blogger/v3" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + BlogUserInfos *BlogUserInfosService + + Blogs *BlogsService + + Comments *CommentsService + + PageViews *PageViewsService + + Pages *PagesService + + PostUserInfos *PostUserInfosService + + Posts *PostsService + + Users *UsersService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CustomMetaData") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Blog) MarshalJSON() ([]byte, error) { + type noMethod Blog + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BlogLocale: The locale this Blog is set to. +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"` + + // ForceSendFields is a list of field names (e.g. "Country") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BlogLocale) MarshalJSON() ([]byte, error) { + type noMethod BlogLocale + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BlogPages: The container of pages in this blog. +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"` + + // ForceSendFields is a list of field names (e.g. "SelfLink") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BlogPages) MarshalJSON() ([]byte, error) { + type noMethod BlogPages + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BlogPosts: The container of posts in this blog. +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"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BlogPosts) MarshalJSON() ([]byte, error) { + type noMethod BlogPosts + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BlogUserInfos") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BlogList) MarshalJSON() ([]byte, error) { + type noMethod BlogList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "BlogId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BlogPerUserInfo) MarshalJSON() ([]byte, error) { + type noMethod BlogPerUserInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Author") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Comment) MarshalJSON() ([]byte, error) { + type noMethod Comment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentAuthor: The author of this Comment. +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"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentAuthor) MarshalJSON() ([]byte, error) { + type noMethod CommentAuthor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentAuthorImage: The comment creator's avatar. +type CommentAuthorImage struct { + // Url: The comment creator's avatar URL. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Url") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentAuthorImage) MarshalJSON() ([]byte, error) { + type noMethod CommentAuthorImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentBlog: Data about the blog containing this comment. +type CommentBlog struct { + // Id: The identifier of the blog containing this comment. + Id string `json:"id,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentBlog) MarshalJSON() ([]byte, error) { + type noMethod CommentBlog + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentInReplyTo: Data about the comment this is in reply to. +type CommentInReplyTo struct { + // Id: The identified of the parent of this comment. + Id string `json:"id,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentInReplyTo) MarshalJSON() ([]byte, error) { + type noMethod CommentInReplyTo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentPost: Data about the post containing this comment. +type CommentPost struct { + // Id: The identifier of the post containing this comment. + Id string `json:"id,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentPost) MarshalJSON() ([]byte, error) { + type noMethod CommentPost + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentList) MarshalJSON() ([]byte, error) { + type noMethod CommentList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Author") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Page) MarshalJSON() ([]byte, error) { + type noMethod Page + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PageAuthor: The author of this Page. +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"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PageAuthor) MarshalJSON() ([]byte, error) { + type noMethod PageAuthor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PageAuthorImage: The page author's avatar. +type PageAuthorImage struct { + // Url: The page author's avatar URL. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Url") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PageAuthorImage) MarshalJSON() ([]byte, error) { + type noMethod PageAuthorImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PageBlog: Data about the blog containing this Page. +type PageBlog struct { + // Id: The identifier of the blog containing this page. + Id string `json:"id,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PageBlog) MarshalJSON() ([]byte, error) { + type noMethod PageBlog + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PageList) MarshalJSON() ([]byte, error) { + type noMethod PageList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BlogId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Pageviews) MarshalJSON() ([]byte, error) { + type noMethod Pageviews + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Count") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PageviewsCounts) MarshalJSON() ([]byte, error) { + type noMethod PageviewsCounts + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Author") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Post) MarshalJSON() ([]byte, error) { + type noMethod Post + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PostAuthor: The author of this Post. +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"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostAuthor) MarshalJSON() ([]byte, error) { + type noMethod PostAuthor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PostAuthorImage: The Post author's avatar. +type PostAuthorImage struct { + // Url: The Post author's avatar URL. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Url") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostAuthorImage) MarshalJSON() ([]byte, error) { + type noMethod PostAuthorImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PostBlog: Data about the blog containing this Post. +type PostBlog struct { + // Id: The identifier of the Blog that contains this Post. + Id string `json:"id,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostBlog) MarshalJSON() ([]byte, error) { + type noMethod PostBlog + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PostImages struct { + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Url") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostImages) MarshalJSON() ([]byte, error) { + type noMethod PostImages + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PostLocation: The location for geotagged posts. +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"` + + // ForceSendFields is a list of field names (e.g. "Lat") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostLocation) MarshalJSON() ([]byte, error) { + type noMethod PostLocation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PostReplies: The container of comments on this Post. +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"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostReplies) MarshalJSON() ([]byte, error) { + type noMethod PostReplies + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostList) MarshalJSON() ([]byte, error) { + type noMethod PostList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "BlogId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostPerUserInfo) MarshalJSON() ([]byte, error) { + type noMethod PostPerUserInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // PostUserInfo: Information about a User for the Post. + PostUserInfo *PostPerUserInfo `json:"post_user_info,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostUserInfo) MarshalJSON() ([]byte, error) { + type noMethod PostUserInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PostUserInfosList) MarshalJSON() ([]byte, error) { + type noMethod PostUserInfosList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Service1 struct { + // Blog: The Blog resource. + Blog *Blog `json:"blog,omitempty"` + + // BlogUserInfo: Information about a User for the Blog. + BlogUserInfo *BlogPerUserInfo `json:"blog_user_info,omitempty"` + + // Kind: The kind of this entity. Always blogger#blogUserInfo + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Blog") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Service1) MarshalJSON() ([]byte, error) { + type noMethod Service1 + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "About") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *User) MarshalJSON() ([]byte, error) { + type noMethod User + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserBlogs: The container of blogs for this user. +type UserBlogs struct { + // SelfLink: The URL of the Blogs for this user. + SelfLink string `json:"selfLink,omitempty"` + + // ForceSendFields is a list of field names (e.g. "SelfLink") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserBlogs) MarshalJSON() ([]byte, error) { + type noMethod UserBlogs + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserLocale: This user's locale +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"` + + // ForceSendFields is a list of field names (e.g. "Country") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserLocale) MarshalJSON() ([]byte, error) { + type noMethod UserLocale + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "blogger.blogUserInfos.get": + +type BlogUserInfosGetCall struct { + s *Service + userId string + blogId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BlogUserInfosGetCall) Fields(s ...googleapi.Field) *BlogUserInfosGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BlogUserInfosGetCall) IfNoneMatch(entityTag string) *BlogUserInfosGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BlogUserInfosGetCall) Context(ctx context.Context) *BlogUserInfosGetCall { + c.ctx_ = ctx + return c +} + +func (c *BlogUserInfosGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxPosts"]; ok { + params.Set("maxPosts", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.blogUserInfos.get" call. +// Exactly one of *Service1 or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Service1.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *BlogUserInfosGetCall) Do() (*Service1, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Service1{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BlogsGetCall) Fields(s ...googleapi.Field) *BlogsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BlogsGetCall) IfNoneMatch(entityTag string) *BlogsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BlogsGetCall) Context(ctx context.Context) *BlogsGetCall { + c.ctx_ = ctx + return c +} + +func (c *BlogsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxPosts"]; ok { + params.Set("maxPosts", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.blogs.get" call. +// Exactly one of *Blog or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Blog.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *BlogsGetCall) Do() (*Blog, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Blog{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BlogsGetByUrlCall) Fields(s ...googleapi.Field) *BlogsGetByUrlCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BlogsGetByUrlCall) IfNoneMatch(entityTag string) *BlogsGetByUrlCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BlogsGetByUrlCall) Context(ctx context.Context) *BlogsGetByUrlCall { + c.ctx_ = ctx + return c +} + +func (c *BlogsGetByUrlCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("url", fmt.Sprintf("%v", c.url)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.blogs.getByUrl" call. +// Exactly one of *Blog or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Blog.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *BlogsGetByUrlCall) Do() (*Blog, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Blog{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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": +// +// Possible values: +// "ADMIN" - Admin level detail +// "AUTHOR" - Author level detail +// "READER" - Admin level detail +func (c *BlogsListByUserCall) View(view string) *BlogsListByUserCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BlogsListByUserCall) Fields(s ...googleapi.Field) *BlogsListByUserCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BlogsListByUserCall) IfNoneMatch(entityTag string) *BlogsListByUserCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BlogsListByUserCall) Context(ctx context.Context) *BlogsListByUserCall { + c.ctx_ = ctx + return c +} + +func (c *BlogsListByUserCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.blogs.listByUser" call. +// Exactly one of *BlogList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *BlogList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *BlogsListByUserCall) Do() (*BlogList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BlogList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsApproveCall) Fields(s ...googleapi.Field) *CommentsApproveCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsApproveCall) Context(ctx context.Context) *CommentsApproveCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsApproveCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/approve") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + "commentId": c.commentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.comments.approve" call. +// Exactly one of *Comment or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Comment.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CommentsApproveCall) Do() (*Comment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Comment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsDeleteCall) Fields(s ...googleapi.Field) *CommentsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsDeleteCall) Context(ctx context.Context) *CommentsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + "commentId": c.commentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.comments.delete" call. +func (c *CommentsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsGetCall) Fields(s ...googleapi.Field) *CommentsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CommentsGetCall) IfNoneMatch(entityTag string) *CommentsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsGetCall) Context(ctx context.Context) *CommentsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + "commentId": c.commentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.comments.get" call. +// Exactly one of *Comment or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Comment.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CommentsGetCall) Do() (*Comment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Comment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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": +// +// Possible values: +// "emptied" - Comments that have had their content removed +// "live" - Comments that are publicly visible +// "pending" - Comments that are awaiting administrator approval +// "spam" - Comments marked as spam by the administrator +func (c *CommentsListCall) Statuses(statuses string) *CommentsListCall { + c.opt_["statuses"] = statuses + return c +} + +// View sets the optional parameter "view": +// +// Possible values: +// "ADMIN" - Admin level detail +// "AUTHOR" - Author level detail +// "READER" - Admin level detail +func (c *CommentsListCall) View(view string) *CommentsListCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CommentsListCall) IfNoneMatch(entityTag string) *CommentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsListCall) Context(ctx context.Context) *CommentsListCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.comments.list" call. +// Exactly one of *CommentList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CommentList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CommentsListCall) Do() (*CommentList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CommentList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsListByBlogCall) Fields(s ...googleapi.Field) *CommentsListByBlogCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CommentsListByBlogCall) IfNoneMatch(entityTag string) *CommentsListByBlogCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsListByBlogCall) Context(ctx context.Context) *CommentsListByBlogCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsListByBlogCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.comments.listByBlog" call. +// Exactly one of *CommentList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CommentList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CommentsListByBlogCall) Do() (*CommentList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CommentList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsMarkAsSpamCall) Fields(s ...googleapi.Field) *CommentsMarkAsSpamCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsMarkAsSpamCall) Context(ctx context.Context) *CommentsMarkAsSpamCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsMarkAsSpamCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/spam") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + "commentId": c.commentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.comments.markAsSpam" call. +// Exactly one of *Comment or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Comment.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CommentsMarkAsSpamCall) Do() (*Comment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Comment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsRemoveContentCall) Fields(s ...googleapi.Field) *CommentsRemoveContentCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsRemoveContentCall) Context(ctx context.Context) *CommentsRemoveContentCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsRemoveContentCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/comments/{commentId}/removecontent") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + "commentId": c.commentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.comments.removeContent" call. +// Exactly one of *Comment or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Comment.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CommentsRemoveContentCall) Do() (*Comment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Comment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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": +// +// Possible values: +// "30DAYS" - Page view counts from the last thirty days. +// "7DAYS" - Page view counts from the last seven days. +// "all" - Total page view counts from all time. +func (c *PageViewsGetCall) Range(range_ string) *PageViewsGetCall { + c.opt_["range"] = range_ + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PageViewsGetCall) Fields(s ...googleapi.Field) *PageViewsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PageViewsGetCall) IfNoneMatch(entityTag string) *PageViewsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PageViewsGetCall) Context(ctx context.Context) *PageViewsGetCall { + c.ctx_ = ctx + return c +} + +func (c *PageViewsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["range"]; ok { + params.Set("range", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pageviews") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.pageViews.get" call. +// Exactly one of *Pageviews or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Pageviews.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PageViewsGetCall) Do() (*Pageviews, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Pageviews{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PagesDeleteCall) Fields(s ...googleapi.Field) *PagesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PagesDeleteCall) Context(ctx context.Context) *PagesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *PagesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "pageId": c.pageId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.pages.delete" call. +func (c *PagesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a 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{} + ctx_ context.Context +} + +// 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": +// +// Possible values: +// "ADMIN" - Admin level detail +// "AUTHOR" - Author level detail +// "READER" - Admin level detail +func (c *PagesGetCall) View(view string) *PagesGetCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PagesGetCall) Fields(s ...googleapi.Field) *PagesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PagesGetCall) IfNoneMatch(entityTag string) *PagesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PagesGetCall) Context(ctx context.Context) *PagesGetCall { + c.ctx_ = ctx + return c +} + +func (c *PagesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "pageId": c.pageId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.pages.get" call. +// Exactly one of *Page or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Page.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PagesGetCall) Do() (*Page, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Page{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PagesInsertCall) Fields(s ...googleapi.Field) *PagesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PagesInsertCall) Context(ctx context.Context) *PagesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *PagesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.pages.insert" call. +// Exactly one of *Page or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Page.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PagesInsertCall) Do() (*Page, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Page{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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": +// +// Possible values: +// "draft" - Draft (unpublished) Pages +// "imported" - Pages that have had their content removed +// "live" - Pages that are publicly visible +func (c *PagesListCall) Statuses(statuses string) *PagesListCall { + c.opt_["statuses"] = statuses + return c +} + +// View sets the optional parameter "view": +// +// Possible values: +// "ADMIN" - Admin level detail +// "AUTHOR" - Author level detail +// "READER" - Admin level detail +func (c *PagesListCall) View(view string) *PagesListCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PagesListCall) Fields(s ...googleapi.Field) *PagesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PagesListCall) IfNoneMatch(entityTag string) *PagesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PagesListCall) Context(ctx context.Context) *PagesListCall { + c.ctx_ = ctx + return c +} + +func (c *PagesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.pages.list" call. +// Exactly one of *PageList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *PageList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PagesListCall) Do() (*PageList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PageList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PagesPatchCall) Fields(s ...googleapi.Field) *PagesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PagesPatchCall) Context(ctx context.Context) *PagesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *PagesPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "pageId": c.pageId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.pages.patch" call. +// Exactly one of *Page or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Page.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PagesPatchCall) Do() (*Page, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Page{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PagesUpdateCall) Fields(s ...googleapi.Field) *PagesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PagesUpdateCall) Context(ctx context.Context) *PagesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *PagesUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "pageId": c.pageId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.pages.update" call. +// Exactly one of *Page or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Page.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PagesUpdateCall) Do() (*Page, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Page{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostUserInfosGetCall) Fields(s ...googleapi.Field) *PostUserInfosGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PostUserInfosGetCall) IfNoneMatch(entityTag string) *PostUserInfosGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostUserInfosGetCall) Context(ctx context.Context) *PostUserInfosGetCall { + c.ctx_ = ctx + return c +} + +func (c *PostUserInfosGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxComments"]; ok { + params.Set("maxComments", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "blogId": c.blogId, + "postId": c.postId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.postUserInfos.get" call. +// Exactly one of *PostUserInfo or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PostUserInfo.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PostUserInfosGetCall) Do() (*PostUserInfo, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PostUserInfo{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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 +// +// Possible values: +// "published" - Order by the date the post was published +// "updated" - Order by the date the post was last updated +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": +// +// Possible values: +// "draft" - Draft posts +// "live" - Published posts +// "scheduled" - Posts that are scheduled to publish in future. +func (c *PostUserInfosListCall) Statuses(statuses string) *PostUserInfosListCall { + c.opt_["statuses"] = statuses + return c +} + +// View sets the optional parameter "view": +// +// Possible values: +// "ADMIN" - Admin level detail +// "AUTHOR" - Author level detail +// "READER" - Reader level detail +func (c *PostUserInfosListCall) View(view string) *PostUserInfosListCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostUserInfosListCall) Fields(s ...googleapi.Field) *PostUserInfosListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PostUserInfosListCall) IfNoneMatch(entityTag string) *PostUserInfosListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostUserInfosListCall) Context(ctx context.Context) *PostUserInfosListCall { + c.ctx_ = ctx + return c +} + +func (c *PostUserInfosListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}/blogs/{blogId}/posts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.postUserInfos.list" call. +// Exactly one of *PostUserInfosList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PostUserInfosList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PostUserInfosListCall) Do() (*PostUserInfosList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PostUserInfosList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsDeleteCall) Fields(s ...googleapi.Field) *PostsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsDeleteCall) Context(ctx context.Context) *PostsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *PostsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.delete" call. +func (c *PostsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a 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{} + ctx_ context.Context +} + +// 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": +// +// Possible values: +// "ADMIN" - Admin level detail +// "AUTHOR" - Author level detail +// "READER" - Admin level detail +func (c *PostsGetCall) View(view string) *PostsGetCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsGetCall) Fields(s ...googleapi.Field) *PostsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PostsGetCall) IfNoneMatch(entityTag string) *PostsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsGetCall) Context(ctx context.Context) *PostsGetCall { + c.ctx_ = ctx + return c +} + +func (c *PostsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.get" call. +// Exactly one of *Post or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Post.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PostsGetCall) Do() (*Post, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Post{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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": +// +// Possible values: +// "ADMIN" - Admin level detail +// "AUTHOR" - Author level detail +// "READER" - Admin level detail +func (c *PostsGetByPathCall) View(view string) *PostsGetByPathCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsGetByPathCall) Fields(s ...googleapi.Field) *PostsGetByPathCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PostsGetByPathCall) IfNoneMatch(entityTag string) *PostsGetByPathCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsGetByPathCall) Context(ctx context.Context) *PostsGetByPathCall { + c.ctx_ = ctx + return c +} + +func (c *PostsGetByPathCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/bypath") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.getByPath" call. +// Exactly one of *Post or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Post.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PostsGetByPathCall) Do() (*Post, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Post{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsInsertCall) Fields(s ...googleapi.Field) *PostsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsInsertCall) Context(ctx context.Context) *PostsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *PostsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["isDraft"]; ok { + params.Set("isDraft", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.insert" call. +// Exactly one of *Post or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Post.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PostsInsertCall) Do() (*Post, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Post{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +// +// Possible values: +// "published" - Order by the date the post was published +// "updated" - Order by the date the post was last updated +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": +// +// Possible values: +// "draft" - Draft posts +// "live" - Published posts +// "scheduled" - Posts that are scheduled to publish in future. +func (c *PostsListCall) Statuses(statuses string) *PostsListCall { + c.opt_["statuses"] = statuses + return c +} + +// View sets the optional parameter "view": +// +// Possible values: +// "ADMIN" - Admin level detail +// "AUTHOR" - Author level detail +// "READER" - Reader level detail +func (c *PostsListCall) View(view string) *PostsListCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsListCall) Fields(s ...googleapi.Field) *PostsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PostsListCall) IfNoneMatch(entityTag string) *PostsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsListCall) Context(ctx context.Context) *PostsListCall { + c.ctx_ = ctx + return c +} + +func (c *PostsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.list" call. +// Exactly one of *PostList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *PostList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PostsListCall) Do() (*PostList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PostList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsPatchCall) Fields(s ...googleapi.Field) *PostsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsPatchCall) Context(ctx context.Context) *PostsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *PostsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.patch" call. +// Exactly one of *Post or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Post.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PostsPatchCall) Do() (*Post, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Post{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsPublishCall) Fields(s ...googleapi.Field) *PostsPublishCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsPublishCall) Context(ctx context.Context) *PostsPublishCall { + c.ctx_ = ctx + return c +} + +func (c *PostsPublishCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["publishDate"]; ok { + params.Set("publishDate", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/publish") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.publish" call. +// Exactly one of *Post or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Post.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PostsPublishCall) Do() (*Post, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Post{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsRevertCall) Fields(s ...googleapi.Field) *PostsRevertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsRevertCall) Context(ctx context.Context) *PostsRevertCall { + c.ctx_ = ctx + return c +} + +func (c *PostsRevertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}/revert") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.revert" call. +// Exactly one of *Post or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Post.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PostsRevertCall) Do() (*Post, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Post{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +// +// Possible values: +// "published" - Order by the date the post was published +// "updated" - Order by the date the post was last updated +func (c *PostsSearchCall) OrderBy(orderBy string) *PostsSearchCall { + c.opt_["orderBy"] = orderBy + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsSearchCall) Fields(s ...googleapi.Field) *PostsSearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PostsSearchCall) IfNoneMatch(entityTag string) *PostsSearchCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsSearchCall) Context(ctx context.Context) *PostsSearchCall { + c.ctx_ = ctx + return c +} + +func (c *PostsSearchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/search") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.search" call. +// Exactly one of *PostList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *PostList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PostsSearchCall) Do() (*PostList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PostList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PostsUpdateCall) Fields(s ...googleapi.Field) *PostsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PostsUpdateCall) Context(ctx context.Context) *PostsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *PostsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/posts/{postId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "blogId": c.blogId, + "postId": c.postId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.posts.update" call. +// Exactly one of *Post or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Post.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PostsUpdateCall) Do() (*Post, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Post{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall { + c.ctx_ = ctx + return c +} + +func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "blogger.users.get" call. +// Exactly one of *User or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *User.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *UsersGetCall) Do() (*User, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &User{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/unfortunatedefaults.json b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/unfortunatedefaults.json new file mode 100644 index 000000000..82df35089 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/unfortunatedefaults.json @@ -0,0 +1,158 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"", + "discoveryVersion": "v1", + "id": "wrapnewlines:v1", + "name": "wrapnewlines", + "version": "v1", + "title": "Example API", + "description": "The Example API demonstrates wrapping of descriptions containing newlines.", + "ownerDomain": "google.com", + "ownerName": "Google", + "protocol": "rest", + "schemas": { + "Thing": { + "id": "Thing", + "type": "object", + "description": "don't care", + "properties": { + "bool_empty_default_a":{ + "type": "boolean", + "description": "\nNonempty default: no\nUnfortunate default: no", + "default": "false" + }, + "bool_empty_default_b":{ + "type": "boolean", + "description": "\nNonempty default: no\nUnfortunate default: no" + }, + "bool_nonempty_default":{ + "type": "boolean", + "description": "\nNonempty default: yes\nUnfortunate default: yes", + "default": "true" + }, + "string_nonempty_default_doesnt_accept_empty": { + "type": "string", + "description": "\nNonempty default: yes\nAccepts empty value: no\nUnfortunate default: no", + "default": "nonempty" + }, + "string_nonempty_default_enum_accepts_empty": { + "type": "string", + "description": "\nNonempty default: yes\nAccepts empty value: yes (enum)\nUnfortunate default: yes", + "default": "nonempty", + "enum": [ + "", + "nonempty", + "aaa" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "string_nonempty_default_enum_doesnt_accept_empty": { + "type": "string", + "description": "\nNonempty default: yes\nAccepts empty value: no (enum)\nUnfortunate default: no", + "default": "nonempty", + "enum": [ + "nonempty", + "aaa" + ], + "enumDescriptions": [ + "" + ] + }, + "string_nonempty_default_pattern_accepts_empty": { + "type": "string", + "description": "\nNonempty default: yes\nAccepts empty value: yes (pattern)\nUnfortunate default: yes", + "default": "nonempty", + "pattern": ".?" + }, + "string_nonempty_default_pattern_doesnt_accept_empty": { + "type": "string", + "description": "\nNonempty default: yes\nAccepts empty value: no (pattern)\nUnfortunate default: no", + "default": "nonempty", + "pattern": "." + }, + "string_empty_default_doesnt_accept_empty": { + "type": "string", + "description": "\nNonempty default: no\nAccepts empty value: no\nUnfortunate default: no", + "default": "" + }, + "string_empty_default_enum_accepts_empty": { + "type": "string", + "description": "\nNonempty default: no\nAccepts empty value: yes (enum)\nUnfortunate default: no", + "default": "", + "enum": [ + "", + "value" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "string_empty_default_enum_doesnt_accept_empty": { + "type": "string", + "description": "\nNonempty default: no\nAccepts empty value: no (enum)\nUnfortunate default: no", + "default": "", + "enum": [ + "value" + ], + "enumDescriptions": [ + "" + ] + }, + "string_empty_default_pattern_accepts_empty": { + "type": "string", + "description": "\nNonempty default: no\nAccepts empty value: yes (pattern)\nUnfortunate default: no", + "default": "", + "pattern": ".?" + }, + "string_empty_default_pattern_doesnt_accept_empty": { + "type": "string", + "description": "\nNonempty default: no\nAccepts empty value: no (pattern)\nUnfortunate default: no", + "default": "", + "pattern": "." + }, + "numeric_empty_default_a":{ + "type": "string", + "format": "int64", + "description": "\nNonempty default: no\nUnfortunate default: no", + "default": "" + }, + "numeric_empty_default_b":{ + "type": "string", + "format": "int64", + "description": "\nNonempty default: no\nUnfortunate default: no" + }, + "numeric_empty_default_c":{ + "type": "string", + "format": "int64", + "description": "\nNonempty default: no\nUnfortunate default: no", + "default": "0" + }, + "numeric_empty_default_d":{ + "type": "number", + "description": "\nNonempty default: no\nUnfortunate default: no", + "default": "0.0" + }, + "numeric_empty_default_e":{ + "type": "number", + "description": "\nNonempty default: no\nUnfortunate default: no", + "default": "-0.0" + }, + "numeric_nonempty_default_a":{ + "type": "string", + "format": "int64", + "description": "\nNonempty default: yes\nUnfortunate default: yes\nstring encoded, so will not be represented as pointer.", + "default": "1" + }, + "numeric_nonempty_default_b":{ + "type": "number", + "description": "\nNonempty default: yes\nUnfortunate default: yes", + "default": "0.001" + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/unfortunatedefaults.want b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/unfortunatedefaults.want new file mode 100644 index 000000000..2a9da97d0 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/unfortunatedefaults.want @@ -0,0 +1,217 @@ +// Package wrapnewlines provides access to the Example API. +// +// Usage example: +// +// import "google.golang.org/api/wrapnewlines/v1" +// ... +// wrapnewlinesService, err := wrapnewlines.New(oauthHttpClient) +package wrapnewlines // import "google.golang.org/api/wrapnewlines/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "wrapnewlines:v1" +const apiName = "wrapnewlines" +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 + UserAgent string // optional additional User-Agent fragment +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +// Thing: don't care +type Thing struct { + // BoolEmptyDefaultA: + // Nonempty default: no + // Unfortunate default: no + BoolEmptyDefaultA bool `json:"bool_empty_default_a,omitempty"` + + // BoolEmptyDefaultB: + // Nonempty default: no + // Unfortunate default: no + BoolEmptyDefaultB bool `json:"bool_empty_default_b,omitempty"` + + // BoolNonemptyDefault: + // Nonempty default: yes + // Unfortunate default: yes + // + // Default: true + BoolNonemptyDefault *bool `json:"bool_nonempty_default,omitempty"` + + // NumericEmptyDefaultA: + // Nonempty default: no + // Unfortunate default: no + NumericEmptyDefaultA int64 `json:"numeric_empty_default_a,omitempty,string"` + + // NumericEmptyDefaultB: + // Nonempty default: no + // Unfortunate default: no + NumericEmptyDefaultB int64 `json:"numeric_empty_default_b,omitempty,string"` + + // NumericEmptyDefaultC: + // Nonempty default: no + // Unfortunate default: no + NumericEmptyDefaultC int64 `json:"numeric_empty_default_c,omitempty,string"` + + // NumericEmptyDefaultD: + // Nonempty default: no + // Unfortunate default: no + NumericEmptyDefaultD float64 `json:"numeric_empty_default_d,omitempty"` + + // NumericEmptyDefaultE: + // Nonempty default: no + // Unfortunate default: no + NumericEmptyDefaultE float64 `json:"numeric_empty_default_e,omitempty"` + + // NumericNonemptyDefaultA: + // Nonempty default: yes + // Unfortunate default: yes + // string encoded, so will not be represented as pointer. + // + // Default: 1 + NumericNonemptyDefaultA *int64 `json:"numeric_nonempty_default_a,omitempty,string"` + + // NumericNonemptyDefaultB: + // Nonempty default: yes + // Unfortunate default: yes + // + // Default: 0.001 + NumericNonemptyDefaultB *float64 `json:"numeric_nonempty_default_b,omitempty"` + + // StringEmptyDefaultDoesntAcceptEmpty: + // Nonempty default: no + // Accepts empty value: no + // Unfortunate default: no + StringEmptyDefaultDoesntAcceptEmpty string `json:"string_empty_default_doesnt_accept_empty,omitempty"` + + // StringEmptyDefaultEnumAcceptsEmpty: + // Nonempty default: no + // Accepts empty value: yes (enum) + // Unfortunate default: no + // + // Possible values: + // "" (default) + // "value" + StringEmptyDefaultEnumAcceptsEmpty string `json:"string_empty_default_enum_accepts_empty,omitempty"` + + // StringEmptyDefaultEnumDoesntAcceptEmpty: + // Nonempty default: no + // Accepts empty value: no (enum) + // Unfortunate default: no + // + // Possible values: + // "value" + StringEmptyDefaultEnumDoesntAcceptEmpty string `json:"string_empty_default_enum_doesnt_accept_empty,omitempty"` + + // StringEmptyDefaultPatternAcceptsEmpty: + // Nonempty default: no + // Accepts empty value: yes (pattern) + // Unfortunate default: no + StringEmptyDefaultPatternAcceptsEmpty string `json:"string_empty_default_pattern_accepts_empty,omitempty"` + + // StringEmptyDefaultPatternDoesntAcceptEmpty: + // Nonempty default: no + // Accepts empty value: no (pattern) + // Unfortunate default: no + StringEmptyDefaultPatternDoesntAcceptEmpty string `json:"string_empty_default_pattern_doesnt_accept_empty,omitempty"` + + // StringNonemptyDefaultDoesntAcceptEmpty: + // Nonempty default: yes + // Accepts empty value: no + // Unfortunate default: no + StringNonemptyDefaultDoesntAcceptEmpty string `json:"string_nonempty_default_doesnt_accept_empty,omitempty"` + + // StringNonemptyDefaultEnumAcceptsEmpty: + // Nonempty default: yes + // Accepts empty value: yes (enum) + // Unfortunate default: yes + // + // Possible values: + // "" + // "nonempty" (default) + // "aaa" + StringNonemptyDefaultEnumAcceptsEmpty *string `json:"string_nonempty_default_enum_accepts_empty,omitempty"` + + // StringNonemptyDefaultEnumDoesntAcceptEmpty: + // Nonempty default: yes + // Accepts empty value: no (enum) + // Unfortunate default: no + // + // Possible values: + // "nonempty" (default) + // "aaa" + StringNonemptyDefaultEnumDoesntAcceptEmpty string `json:"string_nonempty_default_enum_doesnt_accept_empty,omitempty"` + + // StringNonemptyDefaultPatternAcceptsEmpty: + // Nonempty default: yes + // Accepts empty value: yes (pattern) + // Unfortunate default: yes + // + // Default: nonempty + StringNonemptyDefaultPatternAcceptsEmpty *string `json:"string_nonempty_default_pattern_accepts_empty,omitempty"` + + // StringNonemptyDefaultPatternDoesntAcceptEmpty: + // Nonempty default: yes + // Accepts empty value: no (pattern) + // Unfortunate default: no + StringNonemptyDefaultPatternDoesntAcceptEmpty string `json:"string_nonempty_default_pattern_doesnt_accept_empty,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BoolEmptyDefaultA") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Thing) MarshalJSON() ([]byte, error) { + type noMethod Thing + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/variants.json b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/variants.json new file mode 100644 index 000000000..ae2fbb99f --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/variants.json @@ -0,0 +1,418 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"", + "discoveryVersion": "v1", + "id": "additionalpropsobjs:v1", + "name": "additionalpropsobjs", + "version": "v1", + "title": "Example API", + "description": "The Example API demonstrates an associative array.", + "ownerDomain": "google.com", + "ownerName": "Google", + "protocol": "rest", + "schemas": { + "GeoJsonGeometry": { + "id": "GeoJsonGeometry", + "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": "A heterogenous collection of GeoJsonGeometry objects.", + "properties": { + "geometries": { + "type": "array", + "description": "An array of geometry objects. There must be at least 2 different types of geometries in the array.", + "items": { + "$ref": "GeoJsonGeometry" + } + }, + "type": { + "type": "string", + "description": "Identifies this object as a GeoJsonGeometryCollection.", + "enum": [ + "GeometryCollection" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "GeoJsonLineString": { + "id": "GeoJsonLineString", + "type": "object", + "properties": { + "coordinates": { + "type": "array", + "description": "An array of two or more positions, representing a line.", + "items": { + "$ref": "GeoJsonPosition" + } + }, + "type": { + "type": "string", + "description": "Identifies this object as a GeoJsonLineString.", + "enum": [ + "LineString" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "GeoJsonMultiLineString": { + "id": "GeoJsonMultiLineString", + "type": "object", + "description": "Multi Line String", + "properties": { + "coordinates": { + "type": "array", + "description": "An array of at least two GeoJsonLineString coordinate arrays.", + "items": { + "type": "array", + "items": { + "$ref": "GeoJsonPosition" + } + } + }, + "type": { + "type": "string", + "description": "Identifies this object as a GeoJsonMultiLineString.", + "enum": [ + "MultiLineString" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "GeoJsonMultiPoint": { + "id": "GeoJsonMultiPoint", + "type": "object", + "properties": { + "coordinates": { + "type": "array", + "description": "An array of at least two GeoJsonPoint coordinate arrays.", + "items": { + "$ref": "GeoJsonPosition" + } + }, + "type": { + "type": "string", + "description": "Identifies this object as a GeoJsonMultiPoint.", + "enum": [ + "MultiPoint" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "GeoJsonMultiPolygon": { + "id": "GeoJsonMultiPolygon", + "type": "object", + "properties": { + "coordinates": { + "type": "array", + "description": "An array of at least two GeoJsonPolygon coordinate arrays.", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "GeoJsonPosition" + } + } + } + }, + "type": { + "type": "string", + "description": "Identifies this object as a GeoJsonMultiPolygon.", + "enum": [ + "MultiPolygon" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "GeoJsonPoint": { + "id": "GeoJsonPoint", + "type": "object", + "properties": { + "coordinates": { + "$ref": "GeoJsonPosition", + "description": "A single GeoJsonPosition, specifying the location of the point." + }, + "type": { + "type": "string", + "description": "Identifies this object as a GeoJsonPoint.", + "enum": [ + "Point" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "GeoJsonPolygon": { + "id": "GeoJsonPolygon", + "type": "object", + "properties": { + "coordinates": { + "type": "array", + "description": "An array of LinearRings, each of which is an array of four or more GeoJsonPositions. The first and last coordinates in each LinearRing must be the same. For polygons with multiple rings, the first LinearRing is the external ring, with subsequent rings being interior rings (i.e. hole). All LinearRings must contain GeoJsonPositions in counter-clockwise order.", + "items": { + "type": "array", + "items": { + "$ref": "GeoJsonPosition" + } + } + }, + "type": { + "type": "string", + "description": "Identifies this object as a GeoJsonPolygon.", + "enum": [ + "Polygon" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "GeoJsonPosition": { + "id": "GeoJsonPosition", + "type": "array", + "description": "A position represents a geographical position as an array containing a longitude and a latitude, and optionally an altitude, in that order. All Geometry objects make use of positions to represent geometries as nested arrays. The structure of the array is governed by the type of the geometry.", + "items": { + "type": "number", + "format": "double" + } + }, + "MapFolder": { + "id": "MapFolder", + "type": "object", + "properties": { + "contents": { + "type": "array", + "items": { + "$ref": "MapItem" + } + }, + "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" + } + }, + "expandable": { + "type": "boolean", + "description": "The expandability setting of this MapFolder. If true, the folder can be expanded." + }, + "key": { + "type": "string", + "description": "A user defined alias for this MapFolder, specific to this Map." + }, + "name": { + "type": "string", + "description": "The name of this MapFolder.", + "annotations": { + "required": [ + "mapsengine.maps.create", + "mapsengine.maps.patch" + ] + } + }, + "type": { + "type": "string", + "description": "Identifies this object as a MapFolder.", + "enum": [ + "folder" + ], + "enumDescriptions": [ + "" + ], + "annotations": { + "required": [ + "mapsengine.maps.create", + "mapsengine.maps.patch" + ] + } + }, + "visibility": { + "type": "string", + "description": "The visibility setting of this MapFolder. One of \"defaultOn\" or \"defaultOff\"." + } + } + }, + "MapItem": { + "id": "MapItem", + "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": { + "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" + } + }, + "kmlUrl": { + "type": "string", + "description": "The URL to the KML file represented by this MapKmlLink.", + "annotations": { + "required": [ + "mapsengine.maps.create", + "mapsengine.maps.patch" + ] + } + }, + "name": { + "type": "string", + "description": "The name of this MapKmlLink.", + "annotations": { + "required": [ + "mapsengine.maps.create", + "mapsengine.maps.patch" + ] + } + }, + "type": { + "type": "string", + "description": "Identifies this object as a MapKmlLink.", + "enum": [ + "kmlLink" + ], + "enumDescriptions": [ + "" + ], + "annotations": { + "required": [ + "mapsengine.maps.create", + "mapsengine.maps.patch" + ] + } + }, + "visibility": { + "type": "string", + "description": "The visibility setting of this MapKmlLink. One of \"defaultOn\" or \"defaultOff\"." + } + } + }, + "MapLayer": { + "id": "MapLayer", + "type": "object", + "properties": { + "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" + } + }, + "id": { + "type": "string", + "description": "The ID of this MapLayer. This ID can be used to request more details about the layer.", + "annotations": { + "required": [ + "mapsengine.maps.create", + "mapsengine.maps.patch" + ] + } + }, + "key": { + "type": "string", + "description": "A user defined alias for this MapLayer, specific to this Map." + }, + "name": { + "type": "string", + "description": "The name of this MapLayer." + }, + "type": { + "type": "string", + "description": "Identifies this object as a MapLayer.", + "enum": [ + "layer" + ], + "enumDescriptions": [ + "" + ], + "annotations": { + "required": [ + "mapsengine.maps.create", + "mapsengine.maps.patch" + ] + } + }, + "visibility": { + "type": "string", + "description": "The visibility setting of this MapLayer. One of \"defaultOn\" or \"defaultOff\"." + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/variants.want b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/variants.want new file mode 100644 index 000000000..04048e598 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/variants.want @@ -0,0 +1,465 @@ +// Package additionalpropsobjs provides access to the Example API. +// +// Usage example: +// +// import "google.golang.org/api/additionalpropsobjs/v1" +// ... +// additionalpropsobjsService, err := additionalpropsobjs.New(oauthHttpClient) +package additionalpropsobjs // import "google.golang.org/api/additionalpropsobjs/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "additionalpropsobjs:v1" +const apiName = "additionalpropsobjs" +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 + UserAgent string // optional additional User-Agent fragment +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +type GeoJsonGeometry map[string]interface{} + +func (t GeoJsonGeometry) Type() string { + return googleapi.VariantType(t) +} + +func (t GeoJsonGeometry) GeometryCollection() (r GeoJsonGeometryCollection, ok bool) { + if t.Type() != "GeometryCollection" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +func (t GeoJsonGeometry) LineString() (r GeoJsonLineString, ok bool) { + if t.Type() != "LineString" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +func (t GeoJsonGeometry) MultiLineString() (r GeoJsonMultiLineString, ok bool) { + if t.Type() != "MultiLineString" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +func (t GeoJsonGeometry) MultiPoint() (r GeoJsonMultiPoint, ok bool) { + if t.Type() != "MultiPoint" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +func (t GeoJsonGeometry) MultiPolygon() (r GeoJsonMultiPolygon, ok bool) { + if t.Type() != "MultiPolygon" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +func (t GeoJsonGeometry) Point() (r GeoJsonPoint, ok bool) { + if t.Type() != "Point" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +func (t GeoJsonGeometry) Polygon() (r GeoJsonPolygon, ok bool) { + if t.Type() != "Polygon" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +// GeoJsonGeometryCollection: A heterogenous collection of +// GeoJsonGeometry objects. +type GeoJsonGeometryCollection struct { + // Geometries: An array of geometry objects. There must be at least 2 + // different types of geometries in the array. + Geometries []GeoJsonGeometry `json:"geometries,omitempty"` + + // Type: Identifies this object as a GeoJsonGeometryCollection. + // + // Possible values: + // "GeometryCollection" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Geometries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoJsonGeometryCollection) MarshalJSON() ([]byte, error) { + type noMethod GeoJsonGeometryCollection + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GeoJsonLineString struct { + // Coordinates: An array of two or more positions, representing a line. + Coordinates [][]float64 `json:"coordinates,omitempty"` + + // Type: Identifies this object as a GeoJsonLineString. + // + // Possible values: + // "LineString" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Coordinates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoJsonLineString) MarshalJSON() ([]byte, error) { + type noMethod GeoJsonLineString + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GeoJsonMultiLineString: Multi Line String +type GeoJsonMultiLineString struct { + // Coordinates: An array of at least two GeoJsonLineString coordinate + // arrays. + Coordinates [][][]float64 `json:"coordinates,omitempty"` + + // Type: Identifies this object as a GeoJsonMultiLineString. + // + // Possible values: + // "MultiLineString" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Coordinates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoJsonMultiLineString) MarshalJSON() ([]byte, error) { + type noMethod GeoJsonMultiLineString + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GeoJsonMultiPoint struct { + // Coordinates: An array of at least two GeoJsonPoint coordinate arrays. + Coordinates [][]float64 `json:"coordinates,omitempty"` + + // Type: Identifies this object as a GeoJsonMultiPoint. + // + // Possible values: + // "MultiPoint" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Coordinates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoJsonMultiPoint) MarshalJSON() ([]byte, error) { + type noMethod GeoJsonMultiPoint + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GeoJsonMultiPolygon struct { + // Coordinates: An array of at least two GeoJsonPolygon coordinate + // arrays. + Coordinates [][][][]float64 `json:"coordinates,omitempty"` + + // Type: Identifies this object as a GeoJsonMultiPolygon. + // + // Possible values: + // "MultiPolygon" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Coordinates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoJsonMultiPolygon) MarshalJSON() ([]byte, error) { + type noMethod GeoJsonMultiPolygon + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GeoJsonPoint struct { + // Coordinates: A single GeoJsonPosition, specifying the location of the + // point. + Coordinates []float64 `json:"coordinates,omitempty"` + + // Type: Identifies this object as a GeoJsonPoint. + // + // Possible values: + // "Point" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Coordinates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoJsonPoint) MarshalJSON() ([]byte, error) { + type noMethod GeoJsonPoint + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GeoJsonPolygon struct { + // Coordinates: An array of LinearRings, each of which is an array of + // four or more GeoJsonPositions. The first and last coordinates in each + // LinearRing must be the same. For polygons with multiple rings, the + // first LinearRing is the external ring, with subsequent rings being + // interior rings (i.e. hole). All LinearRings must contain + // GeoJsonPositions in counter-clockwise order. + Coordinates [][][]float64 `json:"coordinates,omitempty"` + + // Type: Identifies this object as a GeoJsonPolygon. + // + // Possible values: + // "Polygon" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Coordinates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoJsonPolygon) MarshalJSON() ([]byte, error) { + type noMethod GeoJsonPolygon + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type MapFolder struct { + 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"` + + // Expandable: The expandability setting of this MapFolder. If true, the + // folder can be expanded. + Expandable bool `json:"expandable,omitempty"` + + // Key: A user defined alias for this MapFolder, specific to this Map. + Key string `json:"key,omitempty"` + + // Name: The name of this MapFolder. + Name string `json:"name,omitempty"` + + // Type: Identifies this object as a MapFolder. + // + // Possible values: + // "folder" + Type string `json:"type,omitempty"` + + // Visibility: The visibility setting of this MapFolder. One of + // "defaultOn" or "defaultOff". + Visibility string `json:"visibility,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Contents") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MapFolder) MarshalJSON() ([]byte, error) { + type noMethod MapFolder + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type MapItem map[string]interface{} + +func (t MapItem) Type() string { + return googleapi.VariantType(t) +} + +func (t MapItem) Folder() (r MapFolder, ok bool) { + if t.Type() != "Folder" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +func (t MapItem) KmlLink() (r MapKmlLink, ok bool) { + if t.Type() != "KmlLink" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +func (t MapItem) Layer() (r MapLayer, ok bool) { + if t.Type() != "Layer" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +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 MapKmlLink. + KmlUrl string `json:"kmlUrl,omitempty"` + + // Name: The name of this MapKmlLink. + Name string `json:"name,omitempty"` + + // Type: Identifies this object as a MapKmlLink. + // + // Possible values: + // "kmlLink" + Type string `json:"type,omitempty"` + + // Visibility: The visibility setting of this MapKmlLink. One of + // "defaultOn" or "defaultOff". + Visibility string `json:"visibility,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DefaultViewport") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MapKmlLink) MarshalJSON() ([]byte, error) { + type noMethod MapKmlLink + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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 MapLayer. This ID can be used to request more + // details about the layer. + Id string `json:"id,omitempty"` + + // Key: A user defined alias for this MapLayer, specific to this Map. + Key string `json:"key,omitempty"` + + // Name: The name of this MapLayer. + Name string `json:"name,omitempty"` + + // Type: Identifies this object as a MapLayer. + // + // Possible values: + // "layer" + Type string `json:"type,omitempty"` + + // Visibility: The visibility setting of this MapLayer. One of + // "defaultOn" or "defaultOff". + Visibility string `json:"visibility,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DefaultViewport") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MapLayer) MarshalJSON() ([]byte, error) { + type noMethod MapLayer + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/wrapnewlines.json b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/wrapnewlines.json new file mode 100644 index 000000000..30ce124dc --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/wrapnewlines.json @@ -0,0 +1,30 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"kEk3sFj6Ef5_yR1-H3bAO6qw9mI/3m5rB86FE5KuW1K3jAl88AxCreg\"", + "discoveryVersion": "v1", + "id": "wrapnewlines:v1", + "name": "wrapnewlines", + "version": "v1", + "title": "Example API", + "description": "The Example API demonstrates wrapping of descriptions containing newlines.", + "ownerDomain": "google.com", + "ownerName": "Google", + "protocol": "rest", + "schemas": { + "Thing": { + "id": "Thing", + "type": "object", + "description": "don't care", + "properties": { + "oneline": { + "type": "string", + "description": "First sentence. Second sentence. Description is long enough to be wrapped." + }, + "twoline": { + "type": "string", + "description": "First sentence.\nSecond sentence. Description is long enough to be wrapped." + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/wrapnewlines.want b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/wrapnewlines.want new file mode 100644 index 000000000..55fbcb0c0 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/google-api-go-generator/testdata/wrapnewlines.want @@ -0,0 +1,90 @@ +// Package wrapnewlines provides access to the Example API. +// +// Usage example: +// +// import "google.golang.org/api/wrapnewlines/v1" +// ... +// wrapnewlinesService, err := wrapnewlines.New(oauthHttpClient) +package wrapnewlines // import "google.golang.org/api/wrapnewlines/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "wrapnewlines:v1" +const apiName = "wrapnewlines" +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 + UserAgent string // optional additional User-Agent fragment +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +// Thing: don't care +type Thing struct { + // Oneline: First sentence. Second sentence. Description is long enough + // to be wrapped. + Oneline string `json:"oneline,omitempty"` + + // Twoline: First sentence. + // Second sentence. Description is long enough to be wrapped. + Twoline string `json:"twoline,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Oneline") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Thing) MarshalJSON() ([]byte, error) { + type noMethod Thing + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} diff --git a/Godeps/_workspace/src/google.golang.org/api/googleapi/googleapi.go b/Godeps/_workspace/src/google.golang.org/api/googleapi/googleapi.go new file mode 100644 index 000000000..04d4424ce --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/googleapi/googleapi.go @@ -0,0 +1,592 @@ +// 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 "google.golang.org/api/googleapi" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "io" + "io/ioutil" + "mime/multipart" + "net/http" + "net/textproto" + "net/url" + "regexp" + "strconv" + "strings" + "sync" + "time" + + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi/internal/uritemplates" +) + +// 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 +} + +// A SizeReaderAt is a ReaderAt with a Size method. +// An io.SectionReader implements SizeReaderAt. +type SizeReaderAt interface { + io.ReaderAt + Size() int64 +} + +// ServerResponse is embedded in each Do response and +// provides the HTTP status code and header sent by the server. +type ServerResponse struct { + // HTTPStatusCode is the server's response status code. + // When using a resource method's Do call, this will always be in the 2xx range. + HTTPStatusCode int + // Header contains the response header fields from the server. + Header http.Header +} + +const ( + Version = "0.5" + + // statusResumeIncomplete is the code returned by the Google uploader when the transfer is not yet complete. + statusResumeIncomplete = 308 + + // UserAgent is the header string used to identify this package. + UserAgent = "google-api-go-client/" + Version + + // uploadPause determines the delay between failed upload attempts + uploadPause = 1 * time.Second +) + +// 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 + // Header contains the response header fields from the server. + Header http.Header + + Errors []ErrorItem +} + +// ErrorItem is a detailed error code & message from the Google API frontend. +type ErrorItem struct { + // Reason is the typed error code. For example: "some_example". + Reason string `json:"reason"` + // Message is the human-readable description of the error. + Message string `json:"message"` +} + +func (e *Error) Error() string { + if len(e.Errors) == 0 && e.Message == "" { + return fmt.Sprintf("googleapi: got HTTP response code %d with body: %v", e.Code, e.Body) + } + var buf bytes.Buffer + fmt.Fprintf(&buf, "googleapi: Error %d: ", e.Code) + if e.Message != "" { + fmt.Fprintf(&buf, "%s", e.Message) + } + if len(e.Errors) == 0 { + return strings.TrimSpace(buf.String()) + } + if len(e.Errors) == 1 && e.Errors[0].Message == e.Message { + fmt.Fprintf(&buf, ", %s", e.Errors[0].Reason) + return buf.String() + } + fmt.Fprintln(&buf, "\nMore details:") + for _, v := range e.Errors { + fmt.Fprintf(&buf, "Reason: %s, Message: %s\n", v.Reason, v.Message) + } + return buf.String() +} + +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), + Header: res.Header, + } +} + +// IsNotModified reports whether err is the result of the +// server replying with http.StatusNotModified. +// Such error values are sometimes returned by "Do" methods +// on calls when If-None-Match is used. +func IsNotModified(err error) bool { + if err == nil { + return false + } + ae, ok := err.(*Error) + return ok && ae.Code == http.StatusNotModified +} + +// CheckMediaResponse returns an error (of type *Error) if the response +// status code is not 2xx. Unlike CheckResponse it does not assume the +// body is a JSON error document. +func CheckMediaResponse(res *http.Response) error { + if res.StatusCode >= 200 && res.StatusCode <= 299 { + return nil + } + slurp, _ := ioutil.ReadAll(io.LimitReader(res.Body, 1<<20)) + res.Body.Close() + 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() + } + + pr, pw := io.Pipe() + typ := "application/octet-stream" + buf, err := ioutil.ReadAll(io.LimitReader(media, 512)) + if err != nil { + pw.CloseWithError(fmt.Errorf("error reading media: %v", err)) + return pr, typ + } + typ = http.DetectContentType(buf) + mr := io.MultiReader(bytes.NewReader(buf), media) + go func() { + _, err = io.Copy(pw, mr) + if err != nil { + pw.CloseWithError(fmt.Errorf("error reading media: %v", err)) + return + } + pw.Close() + }() + return pr, typ +} + +// DetectMediaType detects and returns the content type of the provided media. +// If the type can not be determined, "application/octet-stream" is returned. +func DetectMediaType(media io.ReaderAt) string { + if typer, ok := media.(ContentTyper); ok { + return typer.ContentType() + } + + typ := "application/octet-stream" + buf := make([]byte, 1024) + n, err := media.ReadAt(buf, 0) + buf = buf[:n] + if err == nil || err == io.EOF { + typ = http.DetectContentType(buf) + } + return typ +} + +type Lengther interface { + Len() int +} + +// endingWithErrorReader from r until it returns an error. If the +// final error from r is io.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 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) (cancel func(), ok bool) { + if media == nil { + return + } + // Get the media type, which might return a different reader instance. + var mediaType string + media, mediaType = getMediaType(media) + + body, bodyType := *bodyp, *ctypep + + pr, pw := io.Pipe() + mpw := multipart.NewWriter(pw) + *bodyp = pr + *ctypep = "multipart/related; boundary=" + mpw.Boundary() + go func() { + w, err := mpw.CreatePart(typeHeader(bodyType)) + if err != nil { + mpw.Close() + pw.CloseWithError(fmt.Errorf("googleapi: body CreatePart failed: %v", err)) + return + } + _, err = io.Copy(w, body) + if err != nil { + mpw.Close() + pw.CloseWithError(fmt.Errorf("googleapi: body Copy failed: %v", err)) + return + } + + w, err = mpw.CreatePart(typeHeader(mediaType)) + if err != nil { + mpw.Close() + pw.CloseWithError(fmt.Errorf("googleapi: media CreatePart failed: %v", err)) + return + } + _, err = io.Copy(w, media) + if err != nil { + mpw.Close() + pw.CloseWithError(fmt.Errorf("googleapi: media Copy failed: %v", err)) + return + } + mpw.Close() + pw.Close() + }() + cancel = func() { pw.CloseWithError(errAborted) } + return cancel, true +} + +var errAborted = errors.New("googleapi: upload aborted") + +// ProgressUpdater is a function that is called upon every progress update of a resumable upload. +// This is the only part of a resumable upload (from googleapi) that is usable by the developer. +// The remaining usable pieces of resumable uploads is exposed in each auto-generated API. +type ProgressUpdater func(current, total int64) + +// ResumableUpload is used by the generated APIs to provide resumable uploads. +// It is not used by developers directly. +type ResumableUpload struct { + Client *http.Client + // URI is the resumable resource destination provided by the server after specifying "&uploadType=resumable". + URI string + UserAgent string // User-Agent for header of the request + // Media is the object being uploaded. + Media io.ReaderAt + // MediaType defines the media type, e.g. "image/jpeg". + MediaType string + // ContentLength is the full size of the object being uploaded. + ContentLength int64 + + mu sync.Mutex // guards progress + progress int64 // number of bytes uploaded so far + started bool // whether the upload has been started + + // Callback is an optional function that will be called upon every progress update. + Callback ProgressUpdater +} + +var ( + // rangeRE matches the transfer status response from the server. $1 is the last byte index uploaded. + rangeRE = regexp.MustCompile(`^bytes=0\-(\d+)$`) + // chunkSize is the size of the chunks created during a resumable upload and should be a power of two. + // 1<<18 is the minimum size supported by the Google uploader, and there is no maximum. + chunkSize int64 = 1 << 18 +) + +// Progress returns the number of bytes uploaded at this point. +func (rx *ResumableUpload) Progress() int64 { + rx.mu.Lock() + defer rx.mu.Unlock() + return rx.progress +} + +func (rx *ResumableUpload) transferStatus(ctx context.Context) (int64, *http.Response, error) { + req, _ := http.NewRequest("POST", rx.URI, nil) + req.ContentLength = 0 + req.Header.Set("User-Agent", rx.UserAgent) + req.Header.Set("Content-Range", fmt.Sprintf("bytes */%v", rx.ContentLength)) + res, err := ctxhttp.Do(ctx, rx.Client, req) + if err != nil || res.StatusCode != statusResumeIncomplete { + return 0, res, err + } + var start int64 + if m := rangeRE.FindStringSubmatch(res.Header.Get("Range")); len(m) == 2 { + start, err = strconv.ParseInt(m[1], 10, 64) + if err != nil { + return 0, nil, fmt.Errorf("unable to parse range size %v", m[1]) + } + start += 1 // Start at the next byte + } + return start, res, nil +} + +type chunk struct { + body io.Reader + size int64 + err error +} + +func (rx *ResumableUpload) transferChunks(ctx context.Context) (*http.Response, error) { + var start int64 + var err error + res := &http.Response{} + if rx.started { + start, res, err = rx.transferStatus(ctx) + if err != nil || res.StatusCode != statusResumeIncomplete { + return res, err + } + } + rx.started = true + + for { + select { // Check for cancellation + case <-ctx.Done(): + res.StatusCode = http.StatusRequestTimeout + return res, ctx.Err() + default: + } + reqSize := rx.ContentLength - start + if reqSize > chunkSize { + reqSize = chunkSize + } + r := io.NewSectionReader(rx.Media, start, reqSize) + req, _ := http.NewRequest("POST", rx.URI, r) + req.ContentLength = reqSize + req.Header.Set("Content-Range", fmt.Sprintf("bytes %v-%v/%v", start, start+reqSize-1, rx.ContentLength)) + req.Header.Set("Content-Type", rx.MediaType) + req.Header.Set("User-Agent", rx.UserAgent) + res, err = ctxhttp.Do(ctx, rx.Client, req) + start += reqSize + if err == nil && (res.StatusCode == statusResumeIncomplete || res.StatusCode == http.StatusOK) { + rx.mu.Lock() + rx.progress = start // keep track of number of bytes sent so far + rx.mu.Unlock() + if rx.Callback != nil { + rx.Callback(start, rx.ContentLength) + } + } + if err != nil || res.StatusCode != statusResumeIncomplete { + break + } + } + return res, err +} + +var sleep = time.Sleep // override in unit tests + +// Upload starts the process of a resumable upload with a cancellable context. +// It retries indefinitely (with a pause of uploadPause between attempts) until cancelled. +// It is called from the auto-generated API code and is not visible to the user. +// rx is private to the auto-generated API code. +func (rx *ResumableUpload) Upload(ctx context.Context) (*http.Response, error) { + var res *http.Response + var err error + for { + res, err = rx.transferChunks(ctx) + if err != nil || res.StatusCode == http.StatusCreated || res.StatusCode == http.StatusOK { + return res, err + } + select { // Check for cancellation + case <-ctx.Done(): + res.StatusCode = http.StatusRequestTimeout + return res, ctx.Err() + default: + } + sleep(uploadPause) + } + return res, err +} + +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 + } +} + +// Expand subsitutes any {encoded} strings in the URL passed in using +// the map supplied. +// +// This calls SetOpaque to avoid encoding of the parameters in the URL path. +func Expand(u *url.URL, expansions map[string]string) { + expanded, err := uritemplates.Expand(u.Path, expansions) + if err == nil { + u.Path = expanded + SetOpaque(u) + } +} + +// 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() + +} + +// VariantType returns the type name of the given variant. +// If the map doesn't contain the named key or the value is not a []interface{}, "" is returned. +// This is used to support "variant" APIs that can return one of a number of different types. +func VariantType(t map[string]interface{}) string { + s, _ := t["type"].(string) + return s +} + +// ConvertVariant uses the JSON encoder/decoder to fill in the struct 'dst' with the fields found in variant 'v'. +// This is used to support "variant" APIs that can return one of a number of different types. +// It reports whether the conversion was successful. +func ConvertVariant(v map[string]interface{}, dst interface{}) bool { + var buf bytes.Buffer + err := json.NewEncoder(&buf).Encode(v) + if err != nil { + return false + } + return json.Unmarshal(buf.Bytes(), dst) == nil +} + +// A Field names a field to be retrieved with a partial response. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// +// Partial responses can dramatically reduce the amount of data that must be sent to your application. +// In order to request partial responses, you can specify the full list of fields +// that your application needs by adding the Fields option to your request. +// +// Field strings use camelCase with leading lower-case characters to identify fields within the response. +// +// For example, if your response has a "NextPageToken" and a slice of "Items" with "Id" fields, +// you could request just those fields like this: +// +// svc.Events.List().Fields("nextPageToken", "items/id").Do() +// +// or if you were also interested in each Item's "Updated" field, you can combine them like this: +// +// svc.Events.List().Fields("nextPageToken", "items(id,updated)").Do() +// +// More information about field formatting can be found here: +// https://developers.google.com/+/api/#fields-syntax +// +// Another way to find field names is through the Google API explorer: +// https://developers.google.com/apis-explorer/#p/ +type Field string + +// CombineFields combines fields into a single string. +func CombineFields(s []Field) string { + r := make([]string, len(s)) + for i, v := range s { + r[i] = string(v) + } + return strings.Join(r, ",") +} diff --git a/Godeps/_workspace/src/google.golang.org/api/googleapi/googleapi_test.go b/Godeps/_workspace/src/google.golang.org/api/googleapi/googleapi_test.go new file mode 100644 index 000000000..601d67c86 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/googleapi/googleapi_test.go @@ -0,0 +1,599 @@ +// 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" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/url" + "os" + "reflect" + "regexp" + "strconv" + "strings" + "testing" + "time" + + "golang.org/x/net/context" +) + +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 ExpandTest struct { + in string + expansions map[string]string + want string +} + +var expandTests = []ExpandTest{ + // no expansions + { + "http://www.golang.org/", + map[string]string{}, + "http://www.golang.org/", + }, + // one expansion, no escaping + { + "http://www.golang.org/{bucket}/delete", + map[string]string{ + "bucket": "red", + }, + "http://www.golang.org/red/delete", + }, + // one expansion, with hex escapes + { + "http://www.golang.org/{bucket}/delete", + map[string]string{ + "bucket": "red/blue", + }, + "http://www.golang.org/red%2Fblue/delete", + }, + // one expansion, with space + { + "http://www.golang.org/{bucket}/delete", + map[string]string{ + "bucket": "red or blue", + }, + "http://www.golang.org/red%20or%20blue/delete", + }, + // expansion not found + { + "http://www.golang.org/{object}/delete", + map[string]string{ + "bucket": "red or blue", + }, + "http://www.golang.org//delete", + }, + // multiple expansions + { + "http://www.golang.org/{one}/{two}/{three}/get", + map[string]string{ + "one": "ONE", + "two": "TWO", + "three": "THREE", + }, + "http://www.golang.org/ONE/TWO/THREE/get", + }, + // utf-8 characters + { + "http://www.golang.org/{bucket}/get", + map[string]string{ + "bucket": "£100", + }, + "http://www.golang.org/%C2%A3100/get", + }, + // punctuations + { + "http://www.golang.org/{bucket}/get", + map[string]string{ + "bucket": `/\@:,.`, + }, + "http://www.golang.org/%2F%5C%40%3A%2C./get", + }, + // mis-matched brackets + { + "http://www.golang.org/{bucket/get", + map[string]string{ + "bucket": "red", + }, + "http://www.golang.org/{bucket/get", + }, + // "+" prefix for suppressing escape + // See also: http://tools.ietf.org/html/rfc6570#section-3.2.3 + { + "http://www.golang.org/{+topic}", + map[string]string{ + "topic": "/topics/myproject/mytopic", + }, + // The double slashes here look weird, but it's intentional + "http://www.golang.org//topics/myproject/mytopic", + }, +} + +func TestExpand(t *testing.T) { + for i, test := range expandTests { + u := url.URL{ + Path: test.in, + } + Expand(&u, test.expansions) + got := u.Path + if got != test.want { + t.Errorf("got %q expected %q in test %d", got, test.want, i+1) + } + } +} + +type CheckResponseTest struct { + in *http.Response + bodyText string + want error + errText string +} + +var checkResponseTests = []CheckResponseTest{ + { + &http.Response{ + StatusCode: http.StatusOK, + }, + "", + nil, + "", + }, + { + &http.Response{ + StatusCode: http.StatusInternalServerError, + }, + `{"error":{}}`, + &Error{ + Code: http.StatusInternalServerError, + Body: `{"error":{}}`, + }, + `googleapi: got HTTP response code 500 with body: {"error":{}}`, + }, + { + &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."}}`, + }, + "googleapi: Error 404: 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"}`, + }, + `googleapi: got HTTP response code 400 with body: {"error":"invalid_token","error_description":"Invalid Value"}`, + }, + { + &http.Response{ + StatusCode: http.StatusBadRequest, + }, + `{"error":{"errors":[{"domain":"usageLimits","reason":"keyInvalid","message":"Bad Request"}],"code":400,"message":"Bad Request"}}`, + &Error{ + Code: http.StatusBadRequest, + Errors: []ErrorItem{ + { + Reason: "keyInvalid", + Message: "Bad Request", + }, + }, + Body: `{"error":{"errors":[{"domain":"usageLimits","reason":"keyInvalid","message":"Bad Request"}],"code":400,"message":"Bad Request"}}`, + Message: "Bad Request", + }, + "googleapi: Error 400: Bad Request, keyInvalid", + }, +} + +func TestCheckResponse(t *testing.T) { + for _, test := range checkResponseTests { + res := test.in + if test.bodyText != "" { + res.Body = ioutil.NopCloser(strings.NewReader(test.bodyText)) + } + g := CheckResponse(res) + if !reflect.DeepEqual(g, test.want) { + t.Errorf("CheckResponse: got %v, want %v", g, test.want) + gotJson, err := json.Marshal(g) + if err != nil { + t.Error(err) + } + wantJson, err := json.Marshal(test.want) + if err != nil { + t.Error(err) + } + t.Errorf("json(got): %q\njson(want): %q", string(gotJson), string(wantJson)) + } + if g != nil && g.Error() != test.errText { + t.Errorf("CheckResponse: unexpected error message.\nGot: %q\nwant: %q", g, test.errText) + } + } +} + +type VariantPoint struct { + Type string + Coordinates []float64 +} + +type VariantTest struct { + in map[string]interface{} + result bool + want VariantPoint +} + +var coords = []interface{}{1.0, 2.0} + +var variantTests = []VariantTest{ + { + in: map[string]interface{}{ + "type": "Point", + "coordinates": coords, + }, + result: true, + want: VariantPoint{ + Type: "Point", + Coordinates: []float64{1.0, 2.0}, + }, + }, + { + in: map[string]interface{}{ + "type": "Point", + "bogus": coords, + }, + result: true, + want: VariantPoint{ + Type: "Point", + }, + }, +} + +func TestVariantType(t *testing.T) { + for _, test := range variantTests { + if g := VariantType(test.in); g != test.want.Type { + t.Errorf("VariantType(%v): got %v, want %v", test.in, g, test.want.Type) + } + } +} + +func TestConvertVariant(t *testing.T) { + for _, test := range variantTests { + g := VariantPoint{} + r := ConvertVariant(test.in, &g) + if r != test.result { + t.Errorf("ConvertVariant(%v): got %v, want %v", test.in, r, test.result) + } + if !reflect.DeepEqual(g, test.want) { + t.Errorf("ConvertVariant(%v): got %v, want %v", test.in, g, test.want) + } + } +} + +type unexpectedReader struct{} + +func (unexpectedReader) Read([]byte) (int, error) { + return 0, fmt.Errorf("unexpected read in test.") +} + +var contentRangeRE = regexp.MustCompile(`^bytes (\d+)\-(\d+)/(\d+)$`) + +func (t *testTransport) RoundTrip(req *http.Request) (*http.Response, error) { + t.req = req + if rng := req.Header.Get("Content-Range"); rng != "" && !strings.HasPrefix(rng, "bytes */") { // Read the data + m := contentRangeRE.FindStringSubmatch(rng) + if len(m) != 4 { + return nil, fmt.Errorf("unable to parse content range: %v", rng) + } + start, err := strconv.ParseInt(m[1], 10, 64) + if err != nil { + return nil, fmt.Errorf("unable to parse content range: %v", rng) + } + end, err := strconv.ParseInt(m[2], 10, 64) + if err != nil { + return nil, fmt.Errorf("unable to parse content range: %v", rng) + } + totalSize, err := strconv.ParseInt(m[3], 10, 64) + if err != nil { + return nil, fmt.Errorf("unable to parse content range: %v", rng) + } + partialSize := end - start + 1 + t.buf, err = ioutil.ReadAll(req.Body) + if err != nil || int64(len(t.buf)) != partialSize { + return nil, fmt.Errorf("unable to read %v bytes from request data, n=%v: %v", partialSize, len(t.buf), err) + } + if totalSize == end+1 { + t.statusCode = 200 // signify completion of transfer + } + } + f := ioutil.NopCloser(unexpectedReader{}) + res := &http.Response{ + Body: f, + StatusCode: t.statusCode, + Header: http.Header{}, + } + if t.rangeVal != "" { + res.Header.Set("Range", t.rangeVal) + } + return res, nil +} + +type testTransport struct { + req *http.Request + statusCode int + rangeVal string + want int64 + buf []byte +} + +var statusTests = []*testTransport{ + &testTransport{statusCode: 308, want: 0}, + &testTransport{statusCode: 308, rangeVal: "bytes=0-0", want: 1}, + &testTransport{statusCode: 308, rangeVal: "bytes=0-42", want: 43}, +} + +func TestTransferStatus(t *testing.T) { + ctx := context.Background() + for _, tr := range statusTests { + rx := &ResumableUpload{ + Client: &http.Client{Transport: tr}, + } + g, _, err := rx.transferStatus(ctx) + if err != nil { + t.Error(err) + } + if g != tr.want { + t.Errorf("transferStatus got %v, want %v", g, tr.want) + } + } +} + +func (t *interruptedTransport) RoundTrip(req *http.Request) (*http.Response, error) { + t.req = req + if rng := req.Header.Get("Content-Range"); rng != "" && !strings.HasPrefix(rng, "bytes */") { + t.interruptCount += 1 + if t.interruptCount%7 == 0 { // Respond with a "service unavailable" error + res := &http.Response{ + StatusCode: http.StatusServiceUnavailable, + Header: http.Header{}, + } + t.rangeVal = fmt.Sprintf("bytes=0-%v", len(t.buf)-1) // Set the response for next time + return res, nil + } + m := contentRangeRE.FindStringSubmatch(rng) + if len(m) != 4 { + return nil, fmt.Errorf("unable to parse content range: %v", rng) + } + start, err := strconv.ParseInt(m[1], 10, 64) + if err != nil { + return nil, fmt.Errorf("unable to parse content range: %v", rng) + } + end, err := strconv.ParseInt(m[2], 10, 64) + if err != nil { + return nil, fmt.Errorf("unable to parse content range: %v", rng) + } + totalSize, err := strconv.ParseInt(m[3], 10, 64) + if err != nil { + return nil, fmt.Errorf("unable to parse content range: %v", rng) + } + partialSize := end - start + 1 + buf, err := ioutil.ReadAll(req.Body) + if err != nil || int64(len(buf)) != partialSize { + return nil, fmt.Errorf("unable to read %v bytes from request data, n=%v: %v", partialSize, len(buf), err) + } + t.buf = append(t.buf, buf...) + if totalSize == end+1 { + t.statusCode = 200 // signify completion of transfer + } + } + f := ioutil.NopCloser(unexpectedReader{}) + res := &http.Response{ + Body: f, + StatusCode: t.statusCode, + Header: http.Header{}, + } + if t.rangeVal != "" { + res.Header.Set("Range", t.rangeVal) + } + return res, nil +} + +type interruptedTransport struct { + req *http.Request + statusCode int + rangeVal string + interruptCount int + buf []byte + progressBuf string +} + +func (tr *interruptedTransport) ProgressUpdate(current, total int64) { + tr.progressBuf += fmt.Sprintf("%v, %v\n", current, total) +} + +func TestInterruptedTransferChunks(t *testing.T) { + f, err := os.Open("googleapi.go") + if err != nil { + t.Fatalf("unable to open googleapi.go: %v", err) + } + defer f.Close() + slurp, err := ioutil.ReadAll(f) + if err != nil { + t.Fatalf("unable to slurp file: %v", err) + } + st, err := f.Stat() + if err != nil { + t.Fatalf("unable to stat googleapi.go: %v", err) + } + tr := &interruptedTransport{ + statusCode: 308, + buf: make([]byte, 0, st.Size()), + } + oldChunkSize := chunkSize + defer func() { chunkSize = oldChunkSize }() + chunkSize = 100 // override to process small chunks for test. + + sleep = func(time.Duration) {} // override time.Sleep + rx := &ResumableUpload{ + Client: &http.Client{Transport: tr}, + Media: f, + MediaType: "text/plain", + ContentLength: st.Size(), + Callback: tr.ProgressUpdate, + } + res, err := rx.Upload(context.Background()) + if err != nil || res == nil || res.StatusCode != http.StatusOK { + if res == nil { + t.Errorf("transferChunks not successful, res=nil: %v", err) + } else { + t.Errorf("transferChunks not successful, statusCode=%v: %v", res.StatusCode, err) + } + } + if len(tr.buf) != len(slurp) || bytes.Compare(tr.buf, slurp) != 0 { + t.Errorf("transferred file corrupted:\ngot %s\nwant %s", tr.buf, slurp) + } + w := "" + for i := chunkSize; i <= st.Size(); i += chunkSize { + w += fmt.Sprintf("%v, %v\n", i, st.Size()) + } + if st.Size()%chunkSize != 0 { + w += fmt.Sprintf("%v, %v\n", st.Size(), st.Size()) + } + if tr.progressBuf != w { + t.Errorf("progress update error, got %v, want %v", tr.progressBuf, w) + } +} + +func TestCancelUpload(t *testing.T) { + f, err := os.Open("googleapi.go") + if err != nil { + t.Fatalf("unable to open googleapi.go: %v", err) + } + defer f.Close() + st, err := f.Stat() + if err != nil { + t.Fatalf("unable to stat googleapi.go: %v", err) + } + tr := &interruptedTransport{ + statusCode: 308, + buf: make([]byte, 0, st.Size()), + } + oldChunkSize := chunkSize + defer func() { chunkSize = oldChunkSize }() + chunkSize = 100 // override to process small chunks for test. + + sleep = func(time.Duration) {} // override time.Sleep + rx := &ResumableUpload{ + Client: &http.Client{Transport: tr}, + Media: f, + MediaType: "text/plain", + ContentLength: st.Size(), + Callback: tr.ProgressUpdate, + } + ctx, cancelFunc := context.WithCancel(context.Background()) + cancelFunc() // stop the upload that hasn't started yet + res, err := rx.Upload(ctx) + if err == nil || res == nil || res.StatusCode != http.StatusRequestTimeout { + if res == nil { + t.Errorf("transferChunks not successful, got res=nil, err=%v, want StatusRequestTimeout", err) + } else { + t.Errorf("transferChunks not successful, got statusCode=%v, err=%v, want StatusRequestTimeout", res.StatusCode, err) + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/googleapi/internal/uritemplates/LICENSE b/Godeps/_workspace/src/google.golang.org/api/googleapi/internal/uritemplates/LICENSE new file mode 100644 index 000000000..de9c88cb6 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/googleapi/internal/uritemplates/LICENSE @@ -0,0 +1,18 @@ +Copyright (c) 2013 Joshua Tacoma + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Godeps/_workspace/src/google.golang.org/api/googleapi/internal/uritemplates/uritemplates.go b/Godeps/_workspace/src/google.golang.org/api/googleapi/internal/uritemplates/uritemplates.go new file mode 100644 index 000000000..8a84813fe --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/googleapi/internal/uritemplates/uritemplates.go @@ -0,0 +1,359 @@ +// Copyright 2013 Joshua Tacoma. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package uritemplates is a level 4 implementation of RFC 6570 (URI +// Template, http://tools.ietf.org/html/rfc6570). +// +// To use uritemplates, parse a template string and expand it with a value +// map: +// +// template, _ := uritemplates.Parse("https://api.github.com/repos{/user,repo}") +// values := make(map[string]interface{}) +// values["user"] = "jtacoma" +// values["repo"] = "uritemplates" +// expanded, _ := template.ExpandString(values) +// fmt.Printf(expanded) +// +package uritemplates + +import ( + "bytes" + "errors" + "fmt" + "reflect" + "regexp" + "strconv" + "strings" +) + +var ( + unreserved = regexp.MustCompile("[^A-Za-z0-9\\-._~]") + reserved = regexp.MustCompile("[^A-Za-z0-9\\-._~:/?#[\\]@!$&'()*+,;=]") + validname = regexp.MustCompile("^([A-Za-z0-9_\\.]|%[0-9A-Fa-f][0-9A-Fa-f])+$") + hex = []byte("0123456789ABCDEF") +) + +func pctEncode(src []byte) []byte { + dst := make([]byte, len(src)*3) + for i, b := range src { + buf := dst[i*3 : i*3+3] + buf[0] = 0x25 + buf[1] = hex[b/16] + buf[2] = hex[b%16] + } + return dst +} + +func escape(s string, allowReserved bool) (escaped string) { + if allowReserved { + escaped = string(reserved.ReplaceAllFunc([]byte(s), pctEncode)) + } else { + escaped = string(unreserved.ReplaceAllFunc([]byte(s), pctEncode)) + } + return escaped +} + +// A UriTemplate is a parsed representation of a URI template. +type UriTemplate struct { + raw string + parts []templatePart +} + +// Parse parses a URI template string into a UriTemplate object. +func Parse(rawtemplate string) (template *UriTemplate, err error) { + template = new(UriTemplate) + template.raw = rawtemplate + split := strings.Split(rawtemplate, "{") + template.parts = make([]templatePart, len(split)*2-1) + for i, s := range split { + if i == 0 { + if strings.Contains(s, "}") { + err = errors.New("unexpected }") + break + } + template.parts[i].raw = s + } else { + subsplit := strings.Split(s, "}") + if len(subsplit) != 2 { + err = errors.New("malformed template") + break + } + expression := subsplit[0] + template.parts[i*2-1], err = parseExpression(expression) + if err != nil { + break + } + template.parts[i*2].raw = subsplit[1] + } + } + if err != nil { + template = nil + } + return template, err +} + +type templatePart struct { + raw string + terms []templateTerm + first string + sep string + named bool + ifemp string + allowReserved bool +} + +type templateTerm struct { + name string + explode bool + truncate int +} + +func parseExpression(expression string) (result templatePart, err error) { + switch expression[0] { + case '+': + result.sep = "," + result.allowReserved = true + expression = expression[1:] + case '.': + result.first = "." + result.sep = "." + expression = expression[1:] + case '/': + result.first = "/" + result.sep = "/" + expression = expression[1:] + case ';': + result.first = ";" + result.sep = ";" + result.named = true + expression = expression[1:] + case '?': + result.first = "?" + result.sep = "&" + result.named = true + result.ifemp = "=" + expression = expression[1:] + case '&': + result.first = "&" + result.sep = "&" + result.named = true + result.ifemp = "=" + expression = expression[1:] + case '#': + result.first = "#" + result.sep = "," + result.allowReserved = true + expression = expression[1:] + default: + result.sep = "," + } + rawterms := strings.Split(expression, ",") + result.terms = make([]templateTerm, len(rawterms)) + for i, raw := range rawterms { + result.terms[i], err = parseTerm(raw) + if err != nil { + break + } + } + return result, err +} + +func parseTerm(term string) (result templateTerm, err error) { + if strings.HasSuffix(term, "*") { + result.explode = true + term = term[:len(term)-1] + } + split := strings.Split(term, ":") + if len(split) == 1 { + result.name = term + } else if len(split) == 2 { + result.name = split[0] + var parsed int64 + parsed, err = strconv.ParseInt(split[1], 10, 0) + result.truncate = int(parsed) + } else { + err = errors.New("multiple colons in same term") + } + if !validname.MatchString(result.name) { + err = errors.New("not a valid name: " + result.name) + } + if result.explode && result.truncate > 0 { + err = errors.New("both explode and prefix modifers on same term") + } + return result, err +} + +// Expand expands a URI template with a set of values to produce a string. +func (self *UriTemplate) Expand(value interface{}) (string, error) { + values, ismap := value.(map[string]interface{}) + if !ismap { + if m, ismap := struct2map(value); !ismap { + return "", errors.New("expected map[string]interface{}, struct, or pointer to struct.") + } else { + return self.Expand(m) + } + } + var buf bytes.Buffer + for _, p := range self.parts { + err := p.expand(&buf, values) + if err != nil { + return "", err + } + } + return buf.String(), nil +} + +func (self *templatePart) expand(buf *bytes.Buffer, values map[string]interface{}) error { + if len(self.raw) > 0 { + buf.WriteString(self.raw) + return nil + } + var zeroLen = buf.Len() + buf.WriteString(self.first) + var firstLen = buf.Len() + for _, term := range self.terms { + value, exists := values[term.name] + if !exists { + continue + } + if buf.Len() != firstLen { + buf.WriteString(self.sep) + } + switch v := value.(type) { + case string: + self.expandString(buf, term, v) + case []interface{}: + self.expandArray(buf, term, v) + case map[string]interface{}: + if term.truncate > 0 { + return errors.New("cannot truncate a map expansion") + } + self.expandMap(buf, term, v) + default: + if m, ismap := struct2map(value); ismap { + if term.truncate > 0 { + return errors.New("cannot truncate a map expansion") + } + self.expandMap(buf, term, m) + } else { + str := fmt.Sprintf("%v", value) + self.expandString(buf, term, str) + } + } + } + if buf.Len() == firstLen { + original := buf.Bytes()[:zeroLen] + buf.Reset() + buf.Write(original) + } + return nil +} + +func (self *templatePart) expandName(buf *bytes.Buffer, name string, empty bool) { + if self.named { + buf.WriteString(name) + if empty { + buf.WriteString(self.ifemp) + } else { + buf.WriteString("=") + } + } +} + +func (self *templatePart) expandString(buf *bytes.Buffer, t templateTerm, s string) { + if len(s) > t.truncate && t.truncate > 0 { + s = s[:t.truncate] + } + self.expandName(buf, t.name, len(s) == 0) + buf.WriteString(escape(s, self.allowReserved)) +} + +func (self *templatePart) expandArray(buf *bytes.Buffer, t templateTerm, a []interface{}) { + if len(a) == 0 { + return + } else if !t.explode { + self.expandName(buf, t.name, false) + } + for i, value := range a { + if t.explode && i > 0 { + buf.WriteString(self.sep) + } else if i > 0 { + buf.WriteString(",") + } + var s string + switch v := value.(type) { + case string: + s = v + default: + s = fmt.Sprintf("%v", v) + } + if len(s) > t.truncate && t.truncate > 0 { + s = s[:t.truncate] + } + if self.named && t.explode { + self.expandName(buf, t.name, len(s) == 0) + } + buf.WriteString(escape(s, self.allowReserved)) + } +} + +func (self *templatePart) expandMap(buf *bytes.Buffer, t templateTerm, m map[string]interface{}) { + if len(m) == 0 { + return + } + if !t.explode { + self.expandName(buf, t.name, len(m) == 0) + } + var firstLen = buf.Len() + for k, value := range m { + if firstLen != buf.Len() { + if t.explode { + buf.WriteString(self.sep) + } else { + buf.WriteString(",") + } + } + var s string + switch v := value.(type) { + case string: + s = v + default: + s = fmt.Sprintf("%v", v) + } + if t.explode { + buf.WriteString(escape(k, self.allowReserved)) + buf.WriteRune('=') + buf.WriteString(escape(s, self.allowReserved)) + } else { + buf.WriteString(escape(k, self.allowReserved)) + buf.WriteRune(',') + buf.WriteString(escape(s, self.allowReserved)) + } + } +} + +func struct2map(v interface{}) (map[string]interface{}, bool) { + value := reflect.ValueOf(v) + switch value.Type().Kind() { + case reflect.Ptr: + return struct2map(value.Elem().Interface()) + case reflect.Struct: + m := make(map[string]interface{}) + for i := 0; i < value.NumField(); i++ { + tag := value.Type().Field(i).Tag + var name string + if strings.Contains(string(tag), ":") { + name = tag.Get("uri") + } else { + name = strings.TrimSpace(string(tag)) + } + if len(name) == 0 { + name = value.Type().Field(i).Name + } + m[name] = value.Field(i).Interface() + } + return m, true + } + return nil, false +} diff --git a/Godeps/_workspace/src/google.golang.org/api/googleapi/internal/uritemplates/utils.go b/Godeps/_workspace/src/google.golang.org/api/googleapi/internal/uritemplates/utils.go new file mode 100644 index 000000000..399ef4623 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/googleapi/internal/uritemplates/utils.go @@ -0,0 +1,13 @@ +package uritemplates + +func Expand(path string, expansions map[string]string) (string, error) { + template, err := Parse(path) + if err != nil { + return "", err + } + values := make(map[string]interface{}) + for k, v := range expansions { + values[k] = v + } + return template.Expand(values) +} diff --git a/Godeps/_workspace/src/google.golang.org/api/googleapi/transport/apikey.go b/Godeps/_workspace/src/google.golang.org/api/googleapi/transport/apikey.go new file mode 100644 index 000000000..eca1ea250 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/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/Godeps/_workspace/src/google.golang.org/api/googleapi/types.go b/Godeps/_workspace/src/google.golang.org/api/googleapi/types.go new file mode 100644 index 000000000..a02b4b071 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/googleapi/types.go @@ -0,0 +1,182 @@ +// 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) + }) +} + +/* + * Helper routines for simplifying the creation of optional fields of basic type. + */ + +// Bool is a helper routine that allocates a new bool value +// to store v and returns a pointer to it. +func Bool(v bool) *bool { return &v } + +// Int32 is a helper routine that allocates a new int32 value +// to store v and returns a pointer to it. +func Int32(v int32) *int32 { return &v } + +// Int64 is a helper routine that allocates a new int64 value +// to store v and returns a pointer to it. +func Int64(v int64) *int64 { return &v } + +// Float64 is a helper routine that allocates a new float64 value +// to store v and returns a pointer to it. +func Float64(v float64) *float64 { return &v } + +// Uint32 is a helper routine that allocates a new uint32 value +// to store v and returns a pointer to it. +func Uint32(v uint32) *uint32 { return &v } + +// Uint64 is a helper routine that allocates a new uint64 value +// to store v and returns a pointer to it. +func Uint64(v uint64) *uint64 { return &v } + +// String is a helper routine that allocates a new string value +// to store v and returns a pointer to it. +func String(v string) *string { return &v } diff --git a/Godeps/_workspace/src/google.golang.org/api/googleapi/types_test.go b/Godeps/_workspace/src/google.golang.org/api/googleapi/types_test.go new file mode 100644 index 000000000..a6b204515 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/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/Godeps/_workspace/src/google.golang.org/api/groupsmigration/v1/groupsmigration-api.json b/Godeps/_workspace/src/google.golang.org/api/groupsmigration/v1/groupsmigration-api.json new file mode 100644 index 000000000..0b6a2daab --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/groupsmigration/v1/groupsmigration-api.json @@ -0,0 +1,143 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/8sBrpk7dyPsmoiW1fArUb0ZoCGY\"", + "discoveryVersion": "v1", + "id": "groupsmigration:v1", + "name": "groupsmigration", + "canonicalName": "Groups Migration", + "version": "v1", + "revision": "20140416", + "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" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/apps.groups.migration": { + "description": "Manage messages in groups on your domain" + } + } + } + }, + "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" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.groups.migration" + ], + "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/Godeps/_workspace/src/google.golang.org/api/groupsmigration/v1/groupsmigration-gen.go b/Godeps/_workspace/src/google.golang.org/api/groupsmigration/v1/groupsmigration-gen.go new file mode 100644 index 000000000..7fdd6d9a9 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/groupsmigration/v1/groupsmigration-gen.go @@ -0,0 +1,323 @@ +// Package groupsmigration provides access to the Groups Migration API. +// +// See https://developers.google.com/google-apps/groups-migration/ +// +// Usage example: +// +// import "google.golang.org/api/groupsmigration/v1" +// ... +// groupsmigrationService, err := groupsmigration.New(oauthHttpClient) +package groupsmigration // import "google.golang.org/api/groupsmigration/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "groupsmigration:v1" +const apiName = "groupsmigration" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/groups/v1/groups/" + +// OAuth2 scopes used by this API. +const ( + // Manage messages in groups on your domain + AppsGroupsMigrationScope = "https://www.googleapis.com/auth/apps.groups.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.Archive = NewArchiveService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Archive *ArchiveService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewArchiveService(s *Service) *ArchiveService { + rs := &ArchiveService{s: s} + return rs +} + +type ArchiveService struct { + s *Service +} + +// Groups: JSON response template for groups migration API. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Groups) MarshalJSON() ([]byte, error) { + type noMethod Groups + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "groupsmigration.archive.insert": + +type ArchiveInsertCall struct { + s *Service + groupId string + opt_ map[string]interface{} + media_ io.Reader + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// 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 +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *ArchiveInsertCall) Media(r io.Reader) *ArchiveInsertCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *ArchiveInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ArchiveInsertCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *ArchiveInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ArchiveInsertCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ArchiveInsertCall) Fields(s ...googleapi.Field) *ArchiveInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *ArchiveInsertCall) Context(ctx context.Context) *ArchiveInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ArchiveInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{groupId}/archive") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + body = new(bytes.Buffer) + ctype := "application/json" + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "groupId": c.groupId, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "groupsmigration.archive.insert" call. +// Exactly one of *Groups or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Groups.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ArchiveInsertCall) Do() (*Groups, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &Groups{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.groups.migration" + // ], + // "supportsMediaUpload": true + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/groupssettings/v1/groupssettings-api.json b/Godeps/_workspace/src/google.golang.org/api/groupssettings/v1/groupssettings-api.json new file mode 100644 index 000000000..b8143c56e --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/groupssettings/v1/groupssettings-api.json @@ -0,0 +1,284 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"FrPV2U6xXFUq8eRv_PO3IoAURkc/-WzKihq8ROq_FQdrGtr_UG9N-4Y\"", + "discoveryVersion": "v1", + "id": "groupssettings:v1", + "name": "groupssettings", + "version": "v1", + "revision": "20140428", + "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/Godeps/_workspace/src/google.golang.org/api/groupssettings/v1/groupssettings-gen.go b/Godeps/_workspace/src/google.golang.org/api/groupssettings/v1/groupssettings-gen.go new file mode 100644 index 000000000..7dd71d5f2 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/groupssettings/v1/groupssettings-gen.go @@ -0,0 +1,588 @@ +// Package groupssettings provides access to the Groups Settings API. +// +// See https://developers.google.com/google-apps/groups-settings/get_started +// +// Usage example: +// +// import "google.golang.org/api/groupssettings/v1" +// ... +// groupssettingsService, err := groupssettings.New(oauthHttpClient) +package groupssettings // import "google.golang.org/api/groupssettings/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Groups *GroupsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewGroupsService(s *Service) *GroupsService { + rs := &GroupsService{s: s} + return rs +} + +type GroupsService struct { + s *Service +} + +// Groups: JSON template for Group resource +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "AllowExternalMembers") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Groups) MarshalJSON() ([]byte, error) { + type noMethod Groups + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "groupsSettings.groups.get": + +type GroupsGetCall struct { + s *Service + groupUniqueId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsGetCall) Fields(s ...googleapi.Field) *GroupsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GroupsGetCall) IfNoneMatch(entityTag string) *GroupsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsGetCall) Context(ctx context.Context) *GroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{groupUniqueId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "groupUniqueId": c.groupUniqueId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "groupsSettings.groups.get" call. +// Exactly one of *Groups or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Groups.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *GroupsGetCall) Do() (*Groups, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Groups{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets one 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsPatchCall) Fields(s ...googleapi.Field) *GroupsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsPatchCall) Context(ctx context.Context) *GroupsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{groupUniqueId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "groupUniqueId": c.groupUniqueId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "groupsSettings.groups.patch" call. +// Exactly one of *Groups or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Groups.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *GroupsPatchCall) Do() (*Groups, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Groups{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GroupsUpdateCall) Fields(s ...googleapi.Field) *GroupsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GroupsUpdateCall) Context(ctx context.Context) *GroupsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *GroupsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{groupUniqueId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "groupUniqueId": c.groupUniqueId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "groupsSettings.groups.update" call. +// Exactly one of *Groups or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Groups.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *GroupsUpdateCall) Do() (*Groups, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Groups{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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/Godeps/_workspace/src/google.golang.org/api/identitytoolkit/v3/identitytoolkit-api.json b/Godeps/_workspace/src/google.golang.org/api/identitytoolkit/v3/identitytoolkit-api.json new file mode 100644 index 000000000..29248b56e --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/identitytoolkit/v3/identitytoolkit-api.json @@ -0,0 +1,1020 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/VJrCHXHaMQfXi6fEi9qa_MKwS3Y\"", + "discoveryVersion": "v1", + "id": "identitytoolkit:v3", + "name": "identitytoolkit", + "canonicalName": "Identity Toolkit", + "version": "v3", + "revision": "20151008", + "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." + }, + "captchaRequired": { + "type": "boolean", + "description": "True if captcha is required." + }, + "forExistingProvider": { + "type": "boolean", + "description": "True if the authUri is for user's existing provider." + }, + "kind": { + "type": "string", + "description": "The fixed string identitytoolkit#CreateAuthUriResponse\".", + "default": "identitytoolkit#CreateAuthUriResponse" + }, + "providerId": { + "type": "string", + "description": "The provider ID of the auth URI." + }, + "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." + } + } + }, + "GetRecaptchaParamResponse": { + "id": "GetRecaptchaParamResponse", + "type": "object", + "description": "Response of getting recaptcha param.", + "properties": { + "kind": { + "type": "string", + "description": "The fixed string \"identitytoolkit#GetRecaptchaParamResponse\".", + "default": "identitytoolkit#GetRecaptchaParamResponse" + }, + "recaptchaSiteKey": { + "type": "string", + "description": "Site key registered at recaptcha." + }, + "recaptchaStoken": { + "type": "string", + "description": "The stoken field for the recaptcha widget, used to request captcha challenge." + } + } + }, + "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." + }, + "oauthConsumerKey": { + "type": "string", + "description": "The developer's consumer key for OpenId OAuth Extension" + }, + "oauthScope": { + "type": "string", + "description": "Additional oauth scopes, beyond the basid user profile, that the user would be prompted to grant" + }, + "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" + } + } + } + }, + "IdentitytoolkitRelyingpartyGetPublicKeysResponse": { + "id": "IdentitytoolkitRelyingpartyGetPublicKeysResponse", + "type": "object", + "description": "Respone of getting public keys.", + "additionalProperties": { + "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." + }, + "disableUser": { + "type": "boolean", + "description": "Whether to disable the user." + }, + "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." + }, + "validSince": { + "type": "string", + "description": "Timestamp in seconds for valid login token.", + "format": "int64" + } + } + }, + "IdentitytoolkitRelyingpartyUploadAccountRequest": { + "id": "IdentitytoolkitRelyingpartyUploadAccountRequest", + "type": "object", + "description": "Request to upload user account in batch.", + "properties": { + "hashAlgorithm": { + "type": "string", + "description": "The password hash algorithm." + }, + "memoryCost": { + "type": "integer", + "description": "Memory cost for hash calculation. Used by scrypt similar algorithms.", + "format": "int32" + }, + "rounds": { + "type": "integer", + "description": "Rounds for hash calculation. Used by scrypt and similar algorithms.", + "format": "int32" + }, + "saltSeparator": { + "type": "string", + "description": "The salt separator.", + "format": "byte" + }, + "signerKey": { + "type": "string", + "description": "The key for to hash the password.", + "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." + }, + "returnRefreshToken": { + "type": "boolean", + "description": "Whether to return refresh tokens." + } + } + }, + "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" + }, + "newEmail": { + "type": "string", + "description": "The new email the user attempts to change to." + }, + "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": { + "disabled": { + "type": "boolean", + "description": "Whether the user is disabled." + }, + "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" + }, + "validSince": { + "type": "string", + "description": "Timestamp in seconds for valid login token.", + "format": "int64" + }, + "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." + }, + "needEmail": { + "type": "boolean", + "description": "Whether need client to supply email to complete the federated login flow." + }, + "nickName": { + "type": "string", + "description": "The nick name of the user." + }, + "oauthAccessToken": { + "type": "string", + "description": "The OAuth2 access token." + }, + "oauthAuthorizationCode": { + "type": "string", + "description": "The OAuth2 authorization code." + }, + "oauthExpireIn": { + "type": "integer", + "description": "The lifetime in seconds of the OAuth2 access token.", + "format": "int32" + }, + "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." + }, + "oauthAccessToken": { + "type": "string", + "description": "The OAuth2 access token." + }, + "oauthAuthorizationCode": { + "type": "string", + "description": "The OAuth2 authorization code." + }, + "oauthExpireIn": { + "type": "integer", + "description": "The lifetime in seconds of the OAuth2 access token.", + "format": "int32" + }, + "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" + } + }, + "getPublicKeys": { + "id": "identitytoolkit.relyingparty.getPublicKeys", + "path": "publicKeys", + "httpMethod": "GET", + "description": "Get token signing public key.", + "response": { + "$ref": "IdentitytoolkitRelyingpartyGetPublicKeysResponse" + } + }, + "getRecaptchaParam": { + "id": "identitytoolkit.relyingparty.getRecaptchaParam", + "path": "getRecaptchaParam", + "httpMethod": "GET", + "description": "Get recaptcha secure param.", + "response": { + "$ref": "GetRecaptchaParamResponse" + } + }, + "resetPassword": { + "id": "identitytoolkit.relyingparty.resetPassword", + "path": "resetPassword", + "httpMethod": "POST", + "description": "Reset password 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/Godeps/_workspace/src/google.golang.org/api/identitytoolkit/v3/identitytoolkit-gen.go b/Godeps/_workspace/src/google.golang.org/api/identitytoolkit/v3/identitytoolkit-gen.go new file mode 100644 index 000000000..4e76940b1 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/identitytoolkit/v3/identitytoolkit-gen.go @@ -0,0 +1,2291 @@ +// Package identitytoolkit provides access to the Google Identity Toolkit API. +// +// See https://developers.google.com/identity-toolkit/v3/ +// +// Usage example: +// +// import "google.golang.org/api/identitytoolkit/v3" +// ... +// identitytoolkitService, err := identitytoolkit.New(oauthHttpClient) +package identitytoolkit // import "google.golang.org/api/identitytoolkit/v3" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Relyingparty *RelyingpartyService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewRelyingpartyService(s *Service) *RelyingpartyService { + rs := &RelyingpartyService{s: s} + return rs +} + +type RelyingpartyService struct { + s *Service +} + +// CreateAuthUriResponse: Response of creating the IDP authentication +// URL. +type CreateAuthUriResponse struct { + // AuthUri: The URI used by the IDP to authenticate the user. + AuthUri string `json:"authUri,omitempty"` + + // CaptchaRequired: True if captcha is required. + CaptchaRequired bool `json:"captchaRequired,omitempty"` + + // ForExistingProvider: True if the authUri is for user's existing + // provider. + ForExistingProvider bool `json:"forExistingProvider,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"` + + // Registered: Whether the user is registered if the identifier is an + // email. + Registered bool `json:"registered,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AuthUri") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreateAuthUriResponse) MarshalJSON() ([]byte, error) { + type noMethod CreateAuthUriResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DeleteAccountResponse: Respone of deleting account. +type DeleteAccountResponse struct { + // Kind: The fixed string "identitytoolkit#DeleteAccountResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeleteAccountResponse) MarshalJSON() ([]byte, error) { + type noMethod DeleteAccountResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DownloadAccountResponse: Respone of downloading accounts in batch. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DownloadAccountResponse) MarshalJSON() ([]byte, error) { + type noMethod DownloadAccountResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GetAccountInfoResponse: Response of getting account information. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GetAccountInfoResponse) MarshalJSON() ([]byte, error) { + type noMethod GetAccountInfoResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GetOobConfirmationCodeResponse: Response of getting a code for user +// confirmation (reset password, change email etc.). +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GetOobConfirmationCodeResponse) MarshalJSON() ([]byte, error) { + type noMethod GetOobConfirmationCodeResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GetRecaptchaParamResponse: Response of getting recaptcha param. +type GetRecaptchaParamResponse struct { + // Kind: The fixed string "identitytoolkit#GetRecaptchaParamResponse". + Kind string `json:"kind,omitempty"` + + // RecaptchaSiteKey: Site key registered at recaptcha. + RecaptchaSiteKey string `json:"recaptchaSiteKey,omitempty"` + + // RecaptchaStoken: The stoken field for the recaptcha widget, used to + // request captcha challenge. + RecaptchaStoken string `json:"recaptchaStoken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GetRecaptchaParamResponse) MarshalJSON() ([]byte, error) { + type noMethod GetRecaptchaParamResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// IdentitytoolkitRelyingpartyCreateAuthUriRequest: Request to get the +// IDP authentication URL. +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"` + + // OauthConsumerKey: The developer's consumer key for OpenId OAuth + // Extension + OauthConsumerKey string `json:"oauthConsumerKey,omitempty"` + + // OauthScope: Additional oauth scopes, beyond the basid user profile, + // that the user would be prompted to grant + OauthScope string `json:"oauthScope,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"` + + // ForceSendFields is a list of field names (e.g. "AppId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *IdentitytoolkitRelyingpartyCreateAuthUriRequest) MarshalJSON() ([]byte, error) { + type noMethod IdentitytoolkitRelyingpartyCreateAuthUriRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// IdentitytoolkitRelyingpartyDeleteAccountRequest: Request to delete +// account. +type IdentitytoolkitRelyingpartyDeleteAccountRequest struct { + // LocalId: The local ID of the user. + LocalId string `json:"localId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "LocalId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *IdentitytoolkitRelyingpartyDeleteAccountRequest) MarshalJSON() ([]byte, error) { + type noMethod IdentitytoolkitRelyingpartyDeleteAccountRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// IdentitytoolkitRelyingpartyDownloadAccountRequest: Request to +// download user account in batch. +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"` + + // ForceSendFields is a list of field names (e.g. "MaxResults") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *IdentitytoolkitRelyingpartyDownloadAccountRequest) MarshalJSON() ([]byte, error) { + type noMethod IdentitytoolkitRelyingpartyDownloadAccountRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// IdentitytoolkitRelyingpartyGetAccountInfoRequest: Request to get the +// account information. +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"` + + // ForceSendFields is a list of field names (e.g. "Email") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *IdentitytoolkitRelyingpartyGetAccountInfoRequest) MarshalJSON() ([]byte, error) { + type noMethod IdentitytoolkitRelyingpartyGetAccountInfoRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// IdentitytoolkitRelyingpartyResetPasswordRequest: Request to reset the +// password. +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"` + + // ForceSendFields is a list of field names (e.g. "Email") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *IdentitytoolkitRelyingpartyResetPasswordRequest) MarshalJSON() ([]byte, error) { + type noMethod IdentitytoolkitRelyingpartyResetPasswordRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// IdentitytoolkitRelyingpartySetAccountInfoRequest: Request to set the +// account information. +type IdentitytoolkitRelyingpartySetAccountInfoRequest struct { + // CaptchaChallenge: The captcha challenge. + CaptchaChallenge string `json:"captchaChallenge,omitempty"` + + // CaptchaResponse: Response to the captcha. + CaptchaResponse string `json:"captchaResponse,omitempty"` + + // DisableUser: Whether to disable the user. + DisableUser bool `json:"disableUser,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"` + + // ValidSince: Timestamp in seconds for valid login token. + ValidSince int64 `json:"validSince,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "CaptchaChallenge") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *IdentitytoolkitRelyingpartySetAccountInfoRequest) MarshalJSON() ([]byte, error) { + type noMethod IdentitytoolkitRelyingpartySetAccountInfoRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// IdentitytoolkitRelyingpartyUploadAccountRequest: Request to upload +// user account in batch. +type IdentitytoolkitRelyingpartyUploadAccountRequest struct { + // HashAlgorithm: The password hash algorithm. + HashAlgorithm string `json:"hashAlgorithm,omitempty"` + + // MemoryCost: Memory cost for hash calculation. Used by scrypt similar + // algorithms. + MemoryCost int64 `json:"memoryCost,omitempty"` + + // Rounds: Rounds for hash calculation. Used by scrypt and similar + // algorithms. + Rounds int64 `json:"rounds,omitempty"` + + // SaltSeparator: The salt separator. + SaltSeparator string `json:"saltSeparator,omitempty"` + + // SignerKey: The key for to hash the password. + SignerKey string `json:"signerKey,omitempty"` + + // Users: The account info to be stored. + Users []*UserInfo `json:"users,omitempty"` + + // ForceSendFields is a list of field names (e.g. "HashAlgorithm") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *IdentitytoolkitRelyingpartyUploadAccountRequest) MarshalJSON() ([]byte, error) { + type noMethod IdentitytoolkitRelyingpartyUploadAccountRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// IdentitytoolkitRelyingpartyVerifyAssertionRequest: Request to verify +// the IDP assertion. +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"` + + // ReturnRefreshToken: Whether to return refresh tokens. + ReturnRefreshToken bool `json:"returnRefreshToken,omitempty"` + + // ForceSendFields is a list of field names (e.g. "PendingIdToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *IdentitytoolkitRelyingpartyVerifyAssertionRequest) MarshalJSON() ([]byte, error) { + type noMethod IdentitytoolkitRelyingpartyVerifyAssertionRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// IdentitytoolkitRelyingpartyVerifyPasswordRequest: Request to verify +// the password. +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"` + + // ForceSendFields is a list of field names (e.g. "CaptchaChallenge") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *IdentitytoolkitRelyingpartyVerifyPasswordRequest) MarshalJSON() ([]byte, error) { + type noMethod IdentitytoolkitRelyingpartyVerifyPasswordRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Relyingparty: Request of getting a code for user confirmation (reset +// password, change email etc.) +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"` + + // ForceSendFields is a list of field names (e.g. "CaptchaResp") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Relyingparty) MarshalJSON() ([]byte, error) { + type noMethod Relyingparty + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ResetPasswordResponse: Response of resetting the password. +type ResetPasswordResponse struct { + // Email: The user's email. + Email string `json:"email,omitempty"` + + // Kind: The fixed string "identitytoolkit#ResetPasswordResponse". + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Email") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResetPasswordResponse) MarshalJSON() ([]byte, error) { + type noMethod ResetPasswordResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SetAccountInfoResponse: Respone of setting the account information. +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"` + + // NewEmail: The new email the user attempts to change to. + NewEmail string `json:"newEmail,omitempty"` + + // ProviderUserInfo: The user's profiles at the associated IdPs. + ProviderUserInfo []*SetAccountInfoResponseProviderUserInfo `json:"providerUserInfo,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SetAccountInfoResponse) MarshalJSON() ([]byte, error) { + type noMethod SetAccountInfoResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SetAccountInfoResponseProviderUserInfo) MarshalJSON() ([]byte, error) { + type noMethod SetAccountInfoResponseProviderUserInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UploadAccountResponse: Respone of uploading accounts in batch. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Error") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UploadAccountResponse) MarshalJSON() ([]byte, error) { + type noMethod UploadAccountResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Index") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UploadAccountResponseError) MarshalJSON() ([]byte, error) { + type noMethod UploadAccountResponseError + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserInfo: Template for an individual account info. +type UserInfo struct { + // Disabled: Whether the user is disabled. + Disabled bool `json:"disabled,omitempty"` + + // 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"` + + // ValidSince: Timestamp in seconds for valid login token. + ValidSince int64 `json:"validSince,omitempty,string"` + + // Version: Version of the user's password. + Version int64 `json:"version,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Disabled") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserInfo) MarshalJSON() ([]byte, error) { + type noMethod UserInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserInfoProviderUserInfo) MarshalJSON() ([]byte, error) { + type noMethod UserInfoProviderUserInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VerifyAssertionResponse: Response of verifying the IDP assertion. +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"` + + // NeedEmail: Whether need client to supply email to complete the + // federated login flow. + NeedEmail bool `json:"needEmail,omitempty"` + + // NickName: The nick name of the user. + NickName string `json:"nickName,omitempty"` + + // OauthAccessToken: The OAuth2 access token. + OauthAccessToken string `json:"oauthAccessToken,omitempty"` + + // OauthAuthorizationCode: The OAuth2 authorization code. + OauthAuthorizationCode string `json:"oauthAuthorizationCode,omitempty"` + + // OauthExpireIn: The lifetime in seconds of the OAuth2 access token. + OauthExpireIn int64 `json:"oauthExpireIn,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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Action") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VerifyAssertionResponse) MarshalJSON() ([]byte, error) { + type noMethod VerifyAssertionResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VerifyPasswordResponse: Request of verifying the password. +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"` + + // OauthAccessToken: The OAuth2 access token. + OauthAccessToken string `json:"oauthAccessToken,omitempty"` + + // OauthAuthorizationCode: The OAuth2 authorization code. + OauthAuthorizationCode string `json:"oauthAuthorizationCode,omitempty"` + + // OauthExpireIn: The lifetime in seconds of the OAuth2 access token. + OauthExpireIn int64 `json:"oauthExpireIn,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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VerifyPasswordResponse) MarshalJSON() ([]byte, error) { + type noMethod VerifyPasswordResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "identitytoolkit.relyingparty.createAuthUri": + +type RelyingpartyCreateAuthUriCall struct { + s *Service + identitytoolkitrelyingpartycreateauthurirequest *IdentitytoolkitRelyingpartyCreateAuthUriRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RelyingpartyCreateAuthUriCall) Fields(s ...googleapi.Field) *RelyingpartyCreateAuthUriCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RelyingpartyCreateAuthUriCall) Context(ctx context.Context) *RelyingpartyCreateAuthUriCall { + c.ctx_ = ctx + return c +} + +func (c *RelyingpartyCreateAuthUriCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "identitytoolkit.relyingparty.createAuthUri" call. +// Exactly one of *CreateAuthUriResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CreateAuthUriResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RelyingpartyCreateAuthUriCall) Do() (*CreateAuthUriResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreateAuthUriResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RelyingpartyDeleteAccountCall) Fields(s ...googleapi.Field) *RelyingpartyDeleteAccountCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RelyingpartyDeleteAccountCall) Context(ctx context.Context) *RelyingpartyDeleteAccountCall { + c.ctx_ = ctx + return c +} + +func (c *RelyingpartyDeleteAccountCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "identitytoolkit.relyingparty.deleteAccount" call. +// Exactly one of *DeleteAccountResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DeleteAccountResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RelyingpartyDeleteAccountCall) Do() (*DeleteAccountResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DeleteAccountResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RelyingpartyDownloadAccountCall) Fields(s ...googleapi.Field) *RelyingpartyDownloadAccountCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RelyingpartyDownloadAccountCall) Context(ctx context.Context) *RelyingpartyDownloadAccountCall { + c.ctx_ = ctx + return c +} + +func (c *RelyingpartyDownloadAccountCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "identitytoolkit.relyingparty.downloadAccount" call. +// Exactly one of *DownloadAccountResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DownloadAccountResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RelyingpartyDownloadAccountCall) Do() (*DownloadAccountResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DownloadAccountResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RelyingpartyGetAccountInfoCall) Fields(s ...googleapi.Field) *RelyingpartyGetAccountInfoCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RelyingpartyGetAccountInfoCall) Context(ctx context.Context) *RelyingpartyGetAccountInfoCall { + c.ctx_ = ctx + return c +} + +func (c *RelyingpartyGetAccountInfoCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "identitytoolkit.relyingparty.getAccountInfo" call. +// Exactly one of *GetAccountInfoResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GetAccountInfoResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RelyingpartyGetAccountInfoCall) Do() (*GetAccountInfoResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &GetAccountInfoResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RelyingpartyGetOobConfirmationCodeCall) Fields(s ...googleapi.Field) *RelyingpartyGetOobConfirmationCodeCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RelyingpartyGetOobConfirmationCodeCall) Context(ctx context.Context) *RelyingpartyGetOobConfirmationCodeCall { + c.ctx_ = ctx + return c +} + +func (c *RelyingpartyGetOobConfirmationCodeCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "identitytoolkit.relyingparty.getOobConfirmationCode" call. +// Exactly one of *GetOobConfirmationCodeResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *GetOobConfirmationCodeResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RelyingpartyGetOobConfirmationCodeCall) Do() (*GetOobConfirmationCodeResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &GetOobConfirmationCodeResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.getPublicKeys": + +type RelyingpartyGetPublicKeysCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetPublicKeys: Get token signing public key. +func (r *RelyingpartyService) GetPublicKeys() *RelyingpartyGetPublicKeysCall { + c := &RelyingpartyGetPublicKeysCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RelyingpartyGetPublicKeysCall) Fields(s ...googleapi.Field) *RelyingpartyGetPublicKeysCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RelyingpartyGetPublicKeysCall) IfNoneMatch(entityTag string) *RelyingpartyGetPublicKeysCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RelyingpartyGetPublicKeysCall) Context(ctx context.Context) *RelyingpartyGetPublicKeysCall { + c.ctx_ = ctx + return c +} + +func (c *RelyingpartyGetPublicKeysCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "publicKeys") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "identitytoolkit.relyingparty.getPublicKeys" call. +func (c *RelyingpartyGetPublicKeysCall) Do() (map[string]string, error) { + res, err := c.doRequest("json") + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret map[string]string + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get token signing public key.", + // "httpMethod": "GET", + // "id": "identitytoolkit.relyingparty.getPublicKeys", + // "path": "publicKeys", + // "response": { + // "$ref": "IdentitytoolkitRelyingpartyGetPublicKeysResponse" + // } + // } + +} + +// method id "identitytoolkit.relyingparty.getRecaptchaParam": + +type RelyingpartyGetRecaptchaParamCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetRecaptchaParam: Get recaptcha secure param. +func (r *RelyingpartyService) GetRecaptchaParam() *RelyingpartyGetRecaptchaParamCall { + c := &RelyingpartyGetRecaptchaParamCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RelyingpartyGetRecaptchaParamCall) Fields(s ...googleapi.Field) *RelyingpartyGetRecaptchaParamCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RelyingpartyGetRecaptchaParamCall) IfNoneMatch(entityTag string) *RelyingpartyGetRecaptchaParamCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RelyingpartyGetRecaptchaParamCall) Context(ctx context.Context) *RelyingpartyGetRecaptchaParamCall { + c.ctx_ = ctx + return c +} + +func (c *RelyingpartyGetRecaptchaParamCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "getRecaptchaParam") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "identitytoolkit.relyingparty.getRecaptchaParam" call. +// Exactly one of *GetRecaptchaParamResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GetRecaptchaParamResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RelyingpartyGetRecaptchaParamCall) Do() (*GetRecaptchaParamResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &GetRecaptchaParamResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get recaptcha secure param.", + // "httpMethod": "GET", + // "id": "identitytoolkit.relyingparty.getRecaptchaParam", + // "path": "getRecaptchaParam", + // "response": { + // "$ref": "GetRecaptchaParamResponse" + // } + // } + +} + +// method id "identitytoolkit.relyingparty.resetPassword": + +type RelyingpartyResetPasswordCall struct { + s *Service + identitytoolkitrelyingpartyresetpasswordrequest *IdentitytoolkitRelyingpartyResetPasswordRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// ResetPassword: Reset password 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RelyingpartyResetPasswordCall) Fields(s ...googleapi.Field) *RelyingpartyResetPasswordCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RelyingpartyResetPasswordCall) Context(ctx context.Context) *RelyingpartyResetPasswordCall { + c.ctx_ = ctx + return c +} + +func (c *RelyingpartyResetPasswordCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "identitytoolkit.relyingparty.resetPassword" call. +// Exactly one of *ResetPasswordResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ResetPasswordResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RelyingpartyResetPasswordCall) Do() (*ResetPasswordResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ResetPasswordResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Reset password 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RelyingpartySetAccountInfoCall) Fields(s ...googleapi.Field) *RelyingpartySetAccountInfoCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RelyingpartySetAccountInfoCall) Context(ctx context.Context) *RelyingpartySetAccountInfoCall { + c.ctx_ = ctx + return c +} + +func (c *RelyingpartySetAccountInfoCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "identitytoolkit.relyingparty.setAccountInfo" call. +// Exactly one of *SetAccountInfoResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SetAccountInfoResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RelyingpartySetAccountInfoCall) Do() (*SetAccountInfoResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SetAccountInfoResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RelyingpartyUploadAccountCall) Fields(s ...googleapi.Field) *RelyingpartyUploadAccountCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RelyingpartyUploadAccountCall) Context(ctx context.Context) *RelyingpartyUploadAccountCall { + c.ctx_ = ctx + return c +} + +func (c *RelyingpartyUploadAccountCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "identitytoolkit.relyingparty.uploadAccount" call. +// Exactly one of *UploadAccountResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *UploadAccountResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RelyingpartyUploadAccountCall) Do() (*UploadAccountResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UploadAccountResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RelyingpartyVerifyAssertionCall) Fields(s ...googleapi.Field) *RelyingpartyVerifyAssertionCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RelyingpartyVerifyAssertionCall) Context(ctx context.Context) *RelyingpartyVerifyAssertionCall { + c.ctx_ = ctx + return c +} + +func (c *RelyingpartyVerifyAssertionCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "identitytoolkit.relyingparty.verifyAssertion" call. +// Exactly one of *VerifyAssertionResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *VerifyAssertionResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RelyingpartyVerifyAssertionCall) Do() (*VerifyAssertionResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &VerifyAssertionResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RelyingpartyVerifyPasswordCall) Fields(s ...googleapi.Field) *RelyingpartyVerifyPasswordCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RelyingpartyVerifyPasswordCall) Context(ctx context.Context) *RelyingpartyVerifyPasswordCall { + c.ctx_ = ctx + return c +} + +func (c *RelyingpartyVerifyPasswordCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "identitytoolkit.relyingparty.verifyPassword" call. +// Exactly one of *VerifyPasswordResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *VerifyPasswordResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RelyingpartyVerifyPasswordCall) Do() (*VerifyPasswordResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &VerifyPasswordResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Verifies the user entered password.", + // "httpMethod": "POST", + // "id": "identitytoolkit.relyingparty.verifyPassword", + // "path": "verifyPassword", + // "request": { + // "$ref": "IdentitytoolkitRelyingpartyVerifyPasswordRequest" + // }, + // "response": { + // "$ref": "VerifyPasswordResponse" + // } + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/internal/json.go b/Godeps/_workspace/src/google.golang.org/api/internal/json.go new file mode 100644 index 000000000..64eb0a161 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/internal/json.go @@ -0,0 +1,173 @@ +// Copyright 2015 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 internal contains common code shared by all Google API libraries which is not exported to users of the libraries. +package internal + +import ( + "encoding/json" + "fmt" + "reflect" + "strings" +) + +// MarshalJSON returns a JSON encoding of schema containing only selected fields. +// A field is selected if: +// * it has a non-empty value, or +// * its field name is present in forceSendFields, and +// * it is not a nil pointer or nil interface. +// The JSON key for each selected field is taken from the field's json: struct tag. +func MarshalJSON(schema interface{}, forceSendFields []string) ([]byte, error) { + if len(forceSendFields) == 0 { + return json.Marshal(schema) + } + + mustInclude := make(map[string]struct{}) + for _, f := range forceSendFields { + mustInclude[f] = struct{}{} + } + + dataMap, err := schemaToMap(schema, mustInclude) + if err != nil { + return nil, err + } + return json.Marshal(dataMap) +} + +func schemaToMap(schema interface{}, mustInclude map[string]struct{}) (map[string]interface{}, error) { + m := make(map[string]interface{}) + s := reflect.ValueOf(schema) + st := s.Type() + + for i := 0; i < s.NumField(); i++ { + jsonTag := st.Field(i).Tag.Get("json") + if jsonTag == "" { + continue + } + tag, err := parseJSONTag(jsonTag) + if err != nil { + return nil, err + } + if tag.ignore { + continue + } + + v := s.Field(i) + f := st.Field(i) + if !includeField(v, f, mustInclude) { + continue + } + + // nil maps are treated as empty maps. + if f.Type.Kind() == reflect.Map && v.IsNil() { + m[tag.apiName] = map[string]string{} + continue + } + + // nil slices are treated as empty slices. + if f.Type.Kind() == reflect.Slice && v.IsNil() { + m[tag.apiName] = []bool{} + continue + } + + if tag.stringFormat { + m[tag.apiName] = formatAsString(v, f.Type.Kind()) + } else { + m[tag.apiName] = v.Interface() + } + } + return m, nil +} + +// formatAsString returns a string representation of v, dereferencing it first if possible. +func formatAsString(v reflect.Value, kind reflect.Kind) string { + if kind == reflect.Ptr && !v.IsNil() { + v = v.Elem() + } + + return fmt.Sprintf("%v", v.Interface()) +} + +// jsonTag represents a restricted version of the struct tag format used by encoding/json. +// It is used to describe the JSON encoding of fields in a Schema struct. +type jsonTag struct { + apiName string + stringFormat bool + ignore bool +} + +// parseJSONTag parses a restricted version of the struct tag format used by encoding/json. +// The format of the tag must match that generated by the Schema.writeSchemaStruct method +// in the api generator. +func parseJSONTag(val string) (jsonTag, error) { + if val == "-" { + return jsonTag{ignore: true}, nil + } + + var tag jsonTag + + i := strings.Index(val, ",") + if i == -1 || val[:i] == "" { + return tag, fmt.Errorf("malformed json tag: %s", val) + } + + tag = jsonTag{ + apiName: val[:i], + } + + switch val[i+1:] { + case "omitempty": + case "omitempty,string": + tag.stringFormat = true + default: + return tag, fmt.Errorf("malformed json tag: %s", val) + } + + return tag, nil +} + +// Reports whether the struct field "f" with value "v" should be included in JSON output. +func includeField(v reflect.Value, f reflect.StructField, mustInclude map[string]struct{}) bool { + // The regular JSON encoding of a nil pointer is "null", which means "delete this field". + // Therefore, we could enable field deletion by honoring pointer fields' presence in the mustInclude set. + // However, many fields are not pointers, so there would be no way to delete these fields. + // Rather than partially supporting field deletion, we ignore mustInclude for nil pointer fields. + // Deletion will be handled by a separate mechanism. + if f.Type.Kind() == reflect.Ptr && v.IsNil() { + return false + } + + // The "any" type is represented as an interface{}. If this interface + // is nil, there is no reasonable representation to send. We ignore + // these fields, for the same reasons as given above for pointers. + if f.Type.Kind() == reflect.Interface && v.IsNil() { + return false + } + + _, ok := mustInclude[f.Name] + return ok || !isEmptyValue(v) +} + +// isEmptyValue reports whether v is the empty value for its type. This +// implementation is based on that of the encoding/json package, but its +// correctness does not depend on it being identical. What's important is that +// this function return false in situations where v should not be sent as part +// of a PATCH operation. +func isEmptyValue(v reflect.Value) bool { + switch v.Kind() { + case reflect.Array, reflect.Map, reflect.Slice, reflect.String: + return v.Len() == 0 + case reflect.Bool: + return !v.Bool() + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return v.Int() == 0 + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return v.Uint() == 0 + case reflect.Float32, reflect.Float64: + return v.Float() == 0 + case reflect.Interface, reflect.Ptr: + return v.IsNil() + } + return false +} diff --git a/Godeps/_workspace/src/google.golang.org/api/internal/json_test.go b/Godeps/_workspace/src/google.golang.org/api/internal/json_test.go new file mode 100644 index 000000000..9d6e1f46a --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/internal/json_test.go @@ -0,0 +1,367 @@ +// Copyright 2015 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 internal + +import ( + "encoding/json" + "reflect" + "testing" + + "google.golang.org/api/googleapi" +) + +type schema struct { + // Basic types + B bool `json:"b,omitempty"` + F float64 `json:"f,omitempty"` + I int64 `json:"i,omitempty"` + Istr int64 `json:"istr,omitempty,string"` + Str string `json:"str,omitempty"` + + // Pointers to basic types + PB *bool `json:"pb,omitempty"` + PF *float64 `json:"pf,omitempty"` + PI *int64 `json:"pi,omitempty"` + PIStr *int64 `json:"pistr,omitempty,string"` + PStr *string `json:"pstr,omitempty"` + + // Other types + Int64s googleapi.Int64s `json:"i64s,omitempty"` + S []int `json:"s,omitempty"` + M map[string]string `json:"m,omitempty"` + Any interface{} `json:"any,omitempty"` + Child *child `json:"child,omitempty"` + + ForceSendFields []string `json:"-"` +} + +type child struct { + B bool `json:"childbool,omitempty"` +} + +type testCase struct { + s schema + want string +} + +func TestBasics(t *testing.T) { + for _, tc := range []testCase{ + { + s: schema{}, + want: `{}`, + }, + { + s: schema{ + ForceSendFields: []string{"B", "F", "I", "Istr", "Str", "PB", "PF", "PI", "PIStr", "PStr"}, + }, + want: `{"b":false,"f":0.0,"i":0,"istr":"0","str":""}`, + }, + { + s: schema{ + B: true, + F: 1.2, + I: 1, + Istr: 2, + Str: "a", + PB: googleapi.Bool(true), + PF: googleapi.Float64(1.2), + PI: googleapi.Int64(int64(1)), + PIStr: googleapi.Int64(int64(2)), + PStr: googleapi.String("a"), + }, + want: `{"b":true,"f":1.2,"i":1,"istr":"2","str":"a","pb":true,"pf":1.2,"pi":1,"pistr":"2","pstr":"a"}`, + }, + { + s: schema{ + B: false, + F: 0.0, + I: 0, + Istr: 0, + Str: "", + PB: googleapi.Bool(false), + PF: googleapi.Float64(0.0), + PI: googleapi.Int64(int64(0)), + PIStr: googleapi.Int64(int64(0)), + PStr: googleapi.String(""), + }, + want: `{"pb":false,"pf":0.0,"pi":0,"pistr":"0","pstr":""}`, + }, + { + s: schema{ + B: false, + F: 0.0, + I: 0, + Istr: 0, + Str: "", + PB: googleapi.Bool(false), + PF: googleapi.Float64(0.0), + PI: googleapi.Int64(int64(0)), + PIStr: googleapi.Int64(int64(0)), + PStr: googleapi.String(""), + ForceSendFields: []string{"B", "F", "I", "Istr", "Str", "PB", "PF", "PI", "PIStr", "PStr"}, + }, + want: `{"b":false,"f":0.0,"i":0,"istr":"0","str":"","pb":false,"pf":0.0,"pi":0,"pistr":"0","pstr":""}`, + }, + } { + checkMarshalJSON(t, tc) + } +} + +func TestSliceFields(t *testing.T) { + for _, tc := range []testCase{ + { + s: schema{}, + want: `{}`, + }, + { + s: schema{S: []int{}, Int64s: googleapi.Int64s{}}, + want: `{}`, + }, + { + s: schema{S: []int{1}, Int64s: googleapi.Int64s{1}}, + want: `{"s":[1],"i64s":["1"]}`, + }, + { + s: schema{ + ForceSendFields: []string{"S", "Int64s"}, + }, + want: `{"s":[],"i64s":[]}`, + }, + { + s: schema{ + S: []int{}, + Int64s: googleapi.Int64s{}, + ForceSendFields: []string{"S", "Int64s"}, + }, + want: `{"s":[],"i64s":[]}`, + }, + { + s: schema{ + S: []int{1}, + Int64s: googleapi.Int64s{1}, + ForceSendFields: []string{"S", "Int64s"}, + }, + want: `{"s":[1],"i64s":["1"]}`, + }, + } { + checkMarshalJSON(t, tc) + } +} + +func TestMapField(t *testing.T) { + for _, tc := range []testCase{ + { + s: schema{}, + want: `{}`, + }, + { + s: schema{M: make(map[string]string)}, + want: `{}`, + }, + { + s: schema{M: map[string]string{"a": "b"}}, + want: `{"m":{"a":"b"}}`, + }, + { + s: schema{ + ForceSendFields: []string{"M"}, + }, + want: `{"m":{}}`, + }, + { + s: schema{ + M: make(map[string]string), + ForceSendFields: []string{"M"}, + }, + want: `{"m":{}}`, + }, + { + s: schema{ + M: map[string]string{"a": "b"}, + ForceSendFields: []string{"M"}, + }, + want: `{"m":{"a":"b"}}`, + }, + } { + checkMarshalJSON(t, tc) + } +} + +type anyType struct { + Field int +} + +func (a anyType) MarshalJSON() ([]byte, error) { + return []byte(`"anyType value"`), nil +} + +func TestAnyField(t *testing.T) { + // ForceSendFields has no effect on nil interfaces and interfaces that contain nil pointers. + var nilAny *anyType + for _, tc := range []testCase{ + { + s: schema{}, + want: `{}`, + }, + { + s: schema{Any: nilAny}, + want: `{"any": null}`, + }, + { + s: schema{Any: &anyType{}}, + want: `{"any":"anyType value"}`, + }, + { + s: schema{Any: anyType{}}, + want: `{"any":"anyType value"}`, + }, + { + s: schema{ + ForceSendFields: []string{"Any"}, + }, + want: `{}`, + }, + { + s: schema{ + Any: nilAny, + ForceSendFields: []string{"Any"}, + }, + want: `{"any": null}`, + }, + { + s: schema{ + Any: &anyType{}, + ForceSendFields: []string{"Any"}, + }, + want: `{"any":"anyType value"}`, + }, + { + s: schema{ + Any: anyType{}, + ForceSendFields: []string{"Any"}, + }, + want: `{"any":"anyType value"}`, + }, + } { + checkMarshalJSON(t, tc) + } +} + +func TestSubschema(t *testing.T) { + // Subschemas are always stored as pointers, so ForceSendFields has no effect on them. + for _, tc := range []testCase{ + { + s: schema{}, + want: `{}`, + }, + { + s: schema{ + ForceSendFields: []string{"Child"}, + }, + want: `{}`, + }, + { + s: schema{Child: &child{}}, + want: `{"child":{}}`, + }, + { + s: schema{ + Child: &child{}, + ForceSendFields: []string{"Child"}, + }, + want: `{"child":{}}`, + }, + { + s: schema{Child: &child{B: true}}, + want: `{"child":{"childbool":true}}`, + }, + + { + s: schema{ + Child: &child{B: true}, + ForceSendFields: []string{"Child"}, + }, + want: `{"child":{"childbool":true}}`, + }, + } { + checkMarshalJSON(t, tc) + } +} + +// checkMarshalJSON verifies that calling schemaToMap on tc.s yields a result which is equivalent to tc.want. +func checkMarshalJSON(t *testing.T, tc testCase) { + doCheckMarshalJSON(t, tc.s, tc.s.ForceSendFields, tc.want) + if len(tc.s.ForceSendFields) == 0 { + // verify that the code path used when ForceSendFields + // is non-empty produces the same output as the fast + // path that is used when it is empty. + doCheckMarshalJSON(t, tc.s, []string{"dummy"}, tc.want) + } +} + +func doCheckMarshalJSON(t *testing.T, s schema, forceSendFields []string, wantJSON string) { + encoded, err := MarshalJSON(s, forceSendFields) + if err != nil { + t.Fatalf("encoding json:\n got err: %v", err) + } + + // The expected and obtained JSON can differ in field ordering, so unmarshal before comparing. + var got interface{} + var want interface{} + err = json.Unmarshal(encoded, &got) + if err != nil { + t.Fatalf("decoding json:\n got err: %v", err) + } + err = json.Unmarshal([]byte(wantJSON), &want) + if err != nil { + t.Fatalf("decoding json:\n got err: %v", err) + } + if !reflect.DeepEqual(got, want) { + t.Errorf("schemaToMap:\ngot :%s\nwant:%s", got, want) + } +} + +func TestParseJSONTag(t *testing.T) { + for _, tc := range []struct { + tag string + want jsonTag + }{ + { + tag: "-", + want: jsonTag{ignore: true}, + }, { + tag: "name,omitempty", + want: jsonTag{apiName: "name"}, + }, { + tag: "name,omitempty,string", + want: jsonTag{apiName: "name", stringFormat: true}, + }, + } { + got, err := parseJSONTag(tc.tag) + if err != nil { + t.Fatalf("parsing json:\n got err: %v\ntag: %q", err, tc.tag) + } + if !reflect.DeepEqual(got, tc.want) { + t.Errorf("parseJSONTage:\ngot :%s\nwant:%s", got, tc.want) + } + } +} +func TestParseMalformedJSONTag(t *testing.T) { + for _, tag := range []string{ + "", + "name", + "name,", + "name,blah", + "name,blah,string", + ",omitempty", + ",omitempty,string", + "name,omitempty,string,blah", + } { + _, err := parseJSONTag(tag) + if err == nil { + t.Fatalf("parsing json: expected err, got nil for tag: %v", tag) + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/lib/codereview/codereview.cfg b/Godeps/_workspace/src/google.golang.org/api/lib/codereview/codereview.cfg new file mode 100644 index 000000000..2801ebf8d --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/lib/codereview/codereview.cfg @@ -0,0 +1 @@ +defaultcc: golang-codereviews@googlegroups.com diff --git a/Godeps/_workspace/src/google.golang.org/api/licensing/v1/licensing-api.json b/Godeps/_workspace/src/google.golang.org/api/licensing/v1/licensing-api.json new file mode 100644 index 000000000..b1cfd1847 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/licensing/v1/licensing-api.json @@ -0,0 +1,457 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/chZbfEJA0-TN8tTaZIdtXJErZX4\"", + "discoveryVersion": "v1", + "id": "licensing:v1", + "name": "licensing", + "version": "v1", + "revision": "20140122", + "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" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/apps.licensing": { + "description": "View and manage Google Apps licenses for your domain" + } + } + } + }, + "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" + ], + "scopes": [ + "https://www.googleapis.com/auth/apps.licensing" + ] + }, + "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" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.licensing" + ] + }, + "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" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.licensing" + ] + }, + "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" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.licensing" + ] + }, + "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" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.licensing" + ] + }, + "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" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.licensing" + ] + }, + "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" + }, + "scopes": [ + "https://www.googleapis.com/auth/apps.licensing" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/licensing/v1/licensing-gen.go b/Godeps/_workspace/src/google.golang.org/api/licensing/v1/licensing-gen.go new file mode 100644 index 000000000..823dd62cc --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/licensing/v1/licensing-gen.go @@ -0,0 +1,1212 @@ +// Package licensing provides access to the Enterprise License Manager API. +// +// See https://developers.google.com/google-apps/licensing/ +// +// Usage example: +// +// import "google.golang.org/api/licensing/v1" +// ... +// licensingService, err := licensing.New(oauthHttpClient) +package licensing // import "google.golang.org/api/licensing/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "licensing:v1" +const apiName = "licensing" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/apps/licensing/v1/product/" + +// OAuth2 scopes used by this API. +const ( + // View and manage Google Apps licenses for your domain + AppsLicensingScope = "https://www.googleapis.com/auth/apps.licensing" +) + +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 + UserAgent string // optional additional User-Agent fragment + + LicenseAssignments *LicenseAssignmentsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewLicenseAssignmentsService(s *Service) *LicenseAssignmentsService { + rs := &LicenseAssignmentsService{s: s} + return rs +} + +type LicenseAssignmentsService struct { + s *Service +} + +// LicenseAssignment: Template for LiscenseAssignment Resource +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etags") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LicenseAssignment) MarshalJSON() ([]byte, error) { + type noMethod LicenseAssignment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LicenseAssignmentInsert: Template for LicenseAssignment Insert +// request +type LicenseAssignmentInsert struct { + // UserId: Email id of the user + UserId string `json:"userId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "UserId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LicenseAssignmentInsert) MarshalJSON() ([]byte, error) { + type noMethod LicenseAssignmentInsert + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LicenseAssignmentList: LicesnseAssignment List for a given +// product/sku for a customer. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LicenseAssignmentList) MarshalJSON() ([]byte, error) { + type noMethod LicenseAssignmentList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "licensing.licenseAssignments.delete": + +type LicenseAssignmentsDeleteCall struct { + s *Service + productId string + skuId string + userId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LicenseAssignmentsDeleteCall) Fields(s ...googleapi.Field) *LicenseAssignmentsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LicenseAssignmentsDeleteCall) Context(ctx context.Context) *LicenseAssignmentsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *LicenseAssignmentsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{productId}/sku/{skuId}/user/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "productId": c.productId, + "skuId": c.skuId, + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "licensing.licenseAssignments.delete" call. +func (c *LicenseAssignmentsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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}", + // "scopes": [ + // "https://www.googleapis.com/auth/apps.licensing" + // ] + // } + +} + +// method id "licensing.licenseAssignments.get": + +type LicenseAssignmentsGetCall struct { + s *Service + productId string + skuId string + userId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LicenseAssignmentsGetCall) Fields(s ...googleapi.Field) *LicenseAssignmentsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LicenseAssignmentsGetCall) IfNoneMatch(entityTag string) *LicenseAssignmentsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LicenseAssignmentsGetCall) Context(ctx context.Context) *LicenseAssignmentsGetCall { + c.ctx_ = ctx + return c +} + +func (c *LicenseAssignmentsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{productId}/sku/{skuId}/user/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "productId": c.productId, + "skuId": c.skuId, + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "licensing.licenseAssignments.get" call. +// Exactly one of *LicenseAssignment or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *LicenseAssignment.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LicenseAssignmentsGetCall) Do() (*LicenseAssignment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LicenseAssignment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.licensing" + // ] + // } + +} + +// method id "licensing.licenseAssignments.insert": + +type LicenseAssignmentsInsertCall struct { + s *Service + productId string + skuId string + licenseassignmentinsert *LicenseAssignmentInsert + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LicenseAssignmentsInsertCall) Fields(s ...googleapi.Field) *LicenseAssignmentsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LicenseAssignmentsInsertCall) Context(ctx context.Context) *LicenseAssignmentsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *LicenseAssignmentsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{productId}/sku/{skuId}/user") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "productId": c.productId, + "skuId": c.skuId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "licensing.licenseAssignments.insert" call. +// Exactly one of *LicenseAssignment or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *LicenseAssignment.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LicenseAssignmentsInsertCall) Do() (*LicenseAssignment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LicenseAssignment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.licensing" + // ] + // } + +} + +// method id "licensing.licenseAssignments.listForProduct": + +type LicenseAssignmentsListForProductCall struct { + s *Service + productId string + customerId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LicenseAssignmentsListForProductCall) Fields(s ...googleapi.Field) *LicenseAssignmentsListForProductCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LicenseAssignmentsListForProductCall) IfNoneMatch(entityTag string) *LicenseAssignmentsListForProductCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LicenseAssignmentsListForProductCall) Context(ctx context.Context) *LicenseAssignmentsListForProductCall { + c.ctx_ = ctx + return c +} + +func (c *LicenseAssignmentsListForProductCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{productId}/users") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "productId": c.productId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "licensing.licenseAssignments.listForProduct" call. +// Exactly one of *LicenseAssignmentList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *LicenseAssignmentList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LicenseAssignmentsListForProductCall) Do() (*LicenseAssignmentList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LicenseAssignmentList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.licensing" + // ] + // } + +} + +// method id "licensing.licenseAssignments.listForProductAndSku": + +type LicenseAssignmentsListForProductAndSkuCall struct { + s *Service + productId string + skuId string + customerId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LicenseAssignmentsListForProductAndSkuCall) Fields(s ...googleapi.Field) *LicenseAssignmentsListForProductAndSkuCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LicenseAssignmentsListForProductAndSkuCall) IfNoneMatch(entityTag string) *LicenseAssignmentsListForProductAndSkuCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LicenseAssignmentsListForProductAndSkuCall) Context(ctx context.Context) *LicenseAssignmentsListForProductAndSkuCall { + c.ctx_ = ctx + return c +} + +func (c *LicenseAssignmentsListForProductAndSkuCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{productId}/sku/{skuId}/users") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "productId": c.productId, + "skuId": c.skuId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "licensing.licenseAssignments.listForProductAndSku" call. +// Exactly one of *LicenseAssignmentList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *LicenseAssignmentList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LicenseAssignmentsListForProductAndSkuCall) Do() (*LicenseAssignmentList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LicenseAssignmentList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.licensing" + // ] + // } + +} + +// method id "licensing.licenseAssignments.patch": + +type LicenseAssignmentsPatchCall struct { + s *Service + productId string + skuId string + userId string + licenseassignment *LicenseAssignment + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LicenseAssignmentsPatchCall) Fields(s ...googleapi.Field) *LicenseAssignmentsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LicenseAssignmentsPatchCall) Context(ctx context.Context) *LicenseAssignmentsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *LicenseAssignmentsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{productId}/sku/{skuId}/user/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "productId": c.productId, + "skuId": c.skuId, + "userId": c.userId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "licensing.licenseAssignments.patch" call. +// Exactly one of *LicenseAssignment or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *LicenseAssignment.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LicenseAssignmentsPatchCall) Do() (*LicenseAssignment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LicenseAssignment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.licensing" + // ] + // } + +} + +// method id "licensing.licenseAssignments.update": + +type LicenseAssignmentsUpdateCall struct { + s *Service + productId string + skuId string + userId string + licenseassignment *LicenseAssignment + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LicenseAssignmentsUpdateCall) Fields(s ...googleapi.Field) *LicenseAssignmentsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LicenseAssignmentsUpdateCall) Context(ctx context.Context) *LicenseAssignmentsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *LicenseAssignmentsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{productId}/sku/{skuId}/user/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "productId": c.productId, + "skuId": c.skuId, + "userId": c.userId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "licensing.licenseAssignments.update" call. +// Exactly one of *LicenseAssignment or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *LicenseAssignment.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LicenseAssignmentsUpdateCall) Do() (*LicenseAssignment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LicenseAssignment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.licensing" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/logging/v1beta3/logging-api.json b/Godeps/_workspace/src/google.golang.org/api/logging/v1beta3/logging-api.json new file mode 100644 index 000000000..477e51b10 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/logging/v1beta3/logging-api.json @@ -0,0 +1,1691 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/l7KAWGWj5NIeNmaEXus4dk2p56U\"", + "discoveryVersion": "v1", + "id": "logging:v1beta3", + "name": "logging", + "version": "v1beta3", + "revision": "20151007", + "title": "Google Cloud Logging API", + "description": "Google Cloud Logging API lets you create logs, ingest log entries, and manage log sinks.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/logging/docs/", + "protocol": "rest", + "baseUrl": "https://logging.googleapis.com/", + "basePath": "/", + "rootUrl": "https://logging.googleapis.com/", + "servicePath": "", + "batchPath": "batch", + "parameters": { + "access_token": { + "type": "string", + "description": "OAuth access token.", + "location": "query" + }, + "alt": { + "type": "string", + "description": "Data format for response.", + "default": "json", + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query" + }, + "bearer_token": { + "type": "string", + "description": "OAuth bearer token.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JSONP", + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "pp": { + "type": "boolean", + "description": "Pretty-print response.", + "default": "true", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query" + }, + "upload_protocol": { + "type": "string", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query" + }, + "uploadType": { + "type": "string", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query" + }, + "$.xgafv": { + "type": "string", + "description": "V1 error format.", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/logging.admin": { + "description": "Administrate log data for your projects" + }, + "https://www.googleapis.com/auth/logging.read": { + "description": "View log data for your projects" + }, + "https://www.googleapis.com/auth/logging.write": { + "description": "Submit log data for your projects" + } + } + } + }, + "schemas": { + "ListLogsResponse": { + "id": "ListLogsResponse", + "type": "object", + "description": "Result returned from ListLogs.", + "properties": { + "logs": { + "type": "array", + "description": "A list of log descriptions matching the criteria.", + "items": { + "$ref": "Log" + } + }, + "nextPageToken": { + "type": "string", + "description": "If there are more results, then `nextPageToken` is returned in the response. To get the next batch of logs, use the value of `nextPageToken` as `pageToken` in the next call of `ListLogs`. If `nextPageToken` is empty, then there are no more results." + } + } + }, + "Log": { + "id": "Log", + "type": "object", + "description": "_Output only._ Describes a log, which is a named stream of log entries.", + "properties": { + "name": { + "type": "string", + "description": "The resource name of the log. Example: `\"/projects/my-gcp-project-id/logs/LOG_NAME\"`, where `LOG_NAME` is the URL-encoded given name of the log. The log includes those log entries whose `LogEntry.log` field contains this given name. To avoid name collisions, it is a best practice to prefix the given log name with the service name, but this is not required. Examples of log given names: `\"appengine.googleapis.com/request_log\"`, `\"apache-access\"`." + }, + "displayName": { + "type": "string", + "description": "_Optional._ The common name of the log. Example: `\"request_log\"`." + }, + "payloadType": { + "type": "string", + "description": "_Optional_. A URI representing the expected payload type for log entries." + } + } + }, + "Empty": { + "id": "Empty", + "type": "object", + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`." + }, + "WriteLogEntriesRequest": { + "id": "WriteLogEntriesRequest", + "type": "object", + "description": "The parameters to WriteLogEntries.", + "properties": { + "commonLabels": { + "type": "object", + "description": "Metadata labels that apply to all log entries in this request, so that you don't have to repeat them in each log entry's `metadata.labels` field. If any of the log entries contains a (key, value) with the same key that is in `commonLabels`, then the entry's (key, value) overrides the one in `commonLabels`.", + "additionalProperties": { + "type": "string" + } + }, + "entries": { + "type": "array", + "description": "Log entries to insert.", + "items": { + "$ref": "LogEntry" + } + } + } + }, + "LogEntry": { + "id": "LogEntry", + "type": "object", + "description": "An individual entry in a log.", + "properties": { + "metadata": { + "$ref": "LogEntryMetadata", + "description": "Information about the log entry." + }, + "protoPayload": { + "type": "object", + "description": "The log entry payload, represented as a protocol buffer that is expressed as a JSON object. You can only pass `protoPayload` values that belong to a set of approved types.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @ype with type URL." + } + }, + "textPayload": { + "type": "string", + "description": "The log entry payload, represented as a text string." + }, + "structPayload": { + "type": "object", + "description": "The log entry payload, represented as a structure that is expressed as a JSON object.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object." + } + }, + "insertId": { + "type": "string", + "description": "A unique ID for the log entry. If you provide this field, the logging service considers other log entries in the same log with the same ID as duplicates which can be removed." + }, + "log": { + "type": "string", + "description": "The log to which this entry belongs. When a log entry is ingested, the value of this field is set by the logging system." + }, + "httpRequest": { + "$ref": "HttpRequest", + "description": "Information about the HTTP request associated with this log entry, if applicable." + } + } + }, + "LogEntryMetadata": { + "id": "LogEntryMetadata", + "type": "object", + "description": "Additional data that is associated with a log entry, set by the service creating the log entry.", + "properties": { + "timestamp": { + "type": "string", + "description": "The time the event described by the log entry occurred. Timestamps must be later than January 1, 1970." + }, + "severity": { + "type": "string", + "description": "The severity of the log entry.", + "enum": [ + "DEFAULT", + "DEBUG", + "INFO", + "NOTICE", + "WARNING", + "ERROR", + "CRITICAL", + "ALERT", + "EMERGENCY" + ] + }, + "projectId": { + "type": "string", + "description": "The project ID of the Google Cloud Platform service that created the log entry." + }, + "serviceName": { + "type": "string", + "description": "The API name of the Google Cloud Platform service that created the log entry. For example, `\"compute.googleapis.com\"`." + }, + "region": { + "type": "string", + "description": "The region name of the Google Cloud Platform service that created the log entry. For example, `\"us-central1\"`." + }, + "zone": { + "type": "string", + "description": "The zone of the Google Cloud Platform service that created the log entry. For example, `\"us-central1-a\"`." + }, + "userId": { + "type": "string", + "description": "The fully-qualified email address of the authenticated user that performed or requested the action represented by the log entry. If the log entry does not apply to an action taken by an authenticated user, then the field should be empty." + }, + "labels": { + "type": "object", + "description": "A set of (key, value) data that provides additional information about the log entry. If the log entry is from one of the Google Cloud Platform sources listed below, the indicated (key, value) information must be provided: Google App Engine, service_name `appengine.googleapis.com`: \"appengine.googleapis.com/module_id\", \"appengine.googleapis.com/version_id\", and one of: \"appengine.googleapis.com/replica_index\", \"appengine.googleapis.com/clone_id\", or else provide the following Compute Engine labels: Google Compute Engine, service_name `compute.googleapis.com`: \"compute.googleapis.com/resource_type\", \"instance\" \"compute.googleapis.com/resource_id\",", + "additionalProperties": { + "type": "string" + } + } + } + }, + "HttpRequest": { + "id": "HttpRequest", + "type": "object", + "description": "A common proto for logging HTTP requests.", + "properties": { + "requestMethod": { + "type": "string", + "description": "Request method, such as `GET`, `HEAD`, `PUT` or `POST`." + }, + "requestUrl": { + "type": "string", + "description": "Contains the scheme (http|https), the host name, the path and the query portion of the URL that was requested." + }, + "requestSize": { + "type": "string", + "description": "Size of the HTTP request message in bytes, including request headers and the request body.", + "format": "int64" + }, + "status": { + "type": "integer", + "description": "A response code indicates the status of response, e.g., 200.", + "format": "int32" + }, + "responseSize": { + "type": "string", + "description": "Size of the HTTP response message in bytes sent back to the client, including response headers and response body.", + "format": "int64" + }, + "userAgent": { + "type": "string", + "description": "User agent sent by the client, e.g., \"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)\"." + }, + "remoteIp": { + "type": "string", + "description": "IP address of the client who issues the HTTP request. Could be either IPv4 or IPv6." + }, + "referer": { + "type": "string", + "description": "Referer (a.k.a. referrer) URL of request, as defined in http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html." + }, + "cacheHit": { + "type": "boolean", + "description": "Whether or not an entity was served from cache (with or without validation)." + }, + "validatedWithOriginServer": { + "type": "boolean", + "description": "Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if cache_hit is True." + } + } + }, + "WriteLogEntriesResponse": { + "id": "WriteLogEntriesResponse", + "type": "object", + "description": "Result returned from WriteLogEntries. empty" + }, + "ListLogServicesResponse": { + "id": "ListLogServicesResponse", + "type": "object", + "description": "Result returned from `ListLogServicesRequest`.", + "properties": { + "logServices": { + "type": "array", + "description": "A list of log services.", + "items": { + "$ref": "LogService" + } + }, + "nextPageToken": { + "type": "string", + "description": "If there are more results, then `nextPageToken` is returned in the response. To get the next batch of services, use the value of `nextPageToken` as `pageToken` in the next call of `ListLogServices`. If `nextPageToken` is empty, then there are no more results." + } + } + }, + "LogService": { + "id": "LogService", + "type": "object", + "description": "_Output only._ Describes a service that writes log entries.", + "properties": { + "name": { + "type": "string", + "description": "The service's name. Example: `\"appengine.googleapis.com\"`. Log names beginning with this string are reserved for this service. This value can appear in the `LogEntry.metadata.serviceName` field of log entries associated with this log service." + }, + "indexKeys": { + "type": "array", + "description": "A list of the names of the keys used to index and label individual log entries from this service. The first two keys are used as the primary and secondary index, respectively. Additional keys may be used to label the entries. For example, App Engine indexes its entries by module and by version, so its `indexKeys` field is the following: [ \"appengine.googleapis.com/module_id\", \"appengine.googleapis.com/version_id\" ]", + "items": { + "type": "string" + } + } + } + }, + "ListLogServiceIndexesResponse": { + "id": "ListLogServiceIndexesResponse", + "type": "object", + "description": "Result returned from ListLogServiceIndexesRequest.", + "properties": { + "serviceIndexPrefixes": { + "type": "array", + "description": "A list of log service index values. Each index value has the form `\"/value1/value2/...\"`, where `value1` is a value in the primary index, `value2` is a value in the secondary index, and so forth.", + "items": { + "type": "string" + } + }, + "nextPageToken": { + "type": "string", + "description": "If there are more results, then `nextPageToken` is returned in the response. To get the next batch of indexes, use the value of `nextPageToken` as `pageToken` in the next call of `ListLogServiceIndexes`. If `nextPageToken` is empty, then there are no more results." + } + } + }, + "ListLogSinksResponse": { + "id": "ListLogSinksResponse", + "type": "object", + "description": "Result returned from `ListLogSinks`.", + "properties": { + "sinks": { + "type": "array", + "description": "The requested log sinks. If a returned `LogSink` object has an empty `destination` field, the client can retrieve the complete `LogSink` object by calling `log.sinks.get`.", + "items": { + "$ref": "LogSink" + } + } + } + }, + "LogSink": { + "id": "LogSink", + "type": "object", + "description": "Describes where log entries are written outside of Cloud Logging.", + "properties": { + "name": { + "type": "string", + "description": "The client-assigned name of this sink. For example, `\"my-syslog-sink\"`. The name must be unique among the sinks of a similar kind in the project." + }, + "destination": { + "type": "string", + "description": "The resource name of the destination. Cloud Logging writes designated log entries to this destination. For example, `\"storage.googleapis.com/my-output-bucket\"`." + }, + "filter": { + "type": "string", + "description": "An advanced logs filter. If present, only log entries matching the filter are written. Only project sinks use this field; log sinks and log service sinks must not include a filter." + }, + "errors": { + "type": "array", + "description": "_Output only._ If any errors occur when invoking a sink method, then this field contains descriptions of the errors.", + "items": { + "$ref": "LogError" + } + } + } + }, + "LogError": { + "id": "LogError", + "type": "object", + "description": "Describes a problem with a logging resource or operation.", + "properties": { + "resource": { + "type": "string", + "description": "A resource name associated with this error. For example, the name of a Cloud Storage bucket that has insufficient permissions to be a destination for log entries." + }, + "status": { + "$ref": "Status", + "description": "The error description, including a classification code, an error message, and other details." + }, + "timeNanos": { + "type": "string", + "description": "The time the error was observed, in nanoseconds since the Unix epoch.", + "format": "int64" + } + } + }, + "Status": { + "id": "Status", + "type": "object", + "description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). The error model is designed to be: - Simple to use and understand for most users - Flexible enough to meet unexpected needs # Overview The `Status` message contains three pieces of data: error code, error message, and error details. The error code should be an enum value of google.rpc.Code, but it may accept additional error codes if needed. The error message should be a developer-facing English message that helps developers *understand* and *resolve* the error. If a localized user-facing error message is needed, put the localized message in the error details or localize it in the client. The optional error details may contain arbitrary information about the error. There is a predefined set of error detail types in the package `google.rpc` which can be used for common error conditions. # Language mapping The `Status` message is the logical representation of the error model, but it is not necessarily the actual wire format. When the `Status` message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C. # Other uses The error model and the `Status` message can be used in a variety of environments, either with or without APIs, to provide a consistent developer experience across different environments. Example uses of this error model include: - Partial errors. If a service needs to return partial errors to the client, it may embed the `Status` in the normal response to indicate the partial errors. - Workflow errors. A typical workflow has multiple steps. Each step may have a `Status` message for error reporting purpose. - Batch operations. If a client uses batch request and batch response, the `Status` message should be used directly inside batch response, one for each error sub-response. - Asynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the `Status` message. - Logging. If some API errors are stored in logs, the message `Status` could be used directly after any stripping needed for security/privacy reasons.", + "properties": { + "code": { + "type": "integer", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "format": "int32" + }, + "message": { + "type": "string", + "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client." + }, + "details": { + "type": "array", + "description": "A list of messages that carry the error details. There will be a common set of message types for APIs to use.", + "items": { + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @ype with type URL." + } + } + } + } + }, + "ListLogServiceSinksResponse": { + "id": "ListLogServiceSinksResponse", + "type": "object", + "description": "Result returned from `ListLogServiceSinks`.", + "properties": { + "sinks": { + "type": "array", + "description": "The requested log service sinks. If a returned `LogSink` object has an empty `destination` field, the client can retrieve the complete `LogSink` object by calling `logServices.sinks.get`.", + "items": { + "$ref": "LogSink" + } + } + } + }, + "ListSinksResponse": { + "id": "ListSinksResponse", + "type": "object", + "description": "Result returned from `ListSinks`.", + "properties": { + "sinks": { + "type": "array", + "description": "The requested sinks. If a returned `LogSink` object has an empty `destination` field, the client can retrieve the complete `LogSink` object by calling `projects.sinks.get`.", + "items": { + "$ref": "LogSink" + } + } + } + }, + "ListLogMetricsResponse": { + "id": "ListLogMetricsResponse", + "type": "object", + "description": "Result returned from ListLogMetrics.", + "properties": { + "metrics": { + "type": "array", + "description": "The list of metrics that was requested.", + "items": { + "$ref": "LogMetric" + } + }, + "nextPageToken": { + "type": "string", + "description": "If there are more results, then `nextPageToken` is returned in the response. To get the next batch of entries, use the value of `nextPageToken` as `pageToken` in the next call of `ListLogMetrics`. If `nextPageToken` is empty, then there are no more results." + } + } + }, + "LogMetric": { + "id": "LogMetric", + "type": "object", + "description": "Describes a collected, logs-based metric. The value of the metric is the number of log entries in the project that match the advanced logs filter in the `filter` field.", + "properties": { + "name": { + "type": "string", + "description": "The client-assigned name for this metric, such as `\"severe_errors\"`. Metric names are limited to 1000 characters and can include only the following characters: `-A-Za-z0-9_.,+!*',()%/\\`. The slash character `/` implies a hierarchy of name pieces, and cannot be the first character of the name." + }, + "description": { + "type": "string", + "description": "A description of this metric." + }, + "filter": { + "type": "string", + "description": "An [advanced logs filter](/logging/docs/view/advanced_filters). Example: `\"log:syslog AND metadata.severity\u003e=ERROR\"`." + } + } + }, + "RequestLog": { + "id": "RequestLog", + "type": "object", + "description": "Complete log information about a single request to an application.", + "properties": { + "appId": { + "type": "string", + "description": "Identifies the application that handled this request." + }, + "moduleId": { + "type": "string", + "description": "Identifies the module of the application that handled this request." + }, + "versionId": { + "type": "string", + "description": "Version of the application that handled this request." + }, + "requestId": { + "type": "string", + "description": "Globally unique identifier for a request, based on request start time. Request IDs for requests which started later will compare greater as binary strings than those for requests which started earlier.", + "format": "byte" + }, + "ip": { + "type": "string", + "description": "Origin IP address." + }, + "startTime": { + "type": "string", + "description": "Time at which request was known to have begun processing." + }, + "endTime": { + "type": "string", + "description": "Time at which request was known to end processing." + }, + "latency": { + "type": "string", + "description": "Latency of the request." + }, + "megaCycles": { + "type": "string", + "description": "Number of CPU megacycles used to process request.", + "format": "int64" + }, + "method": { + "type": "string", + "description": "Request method, such as `GET`, `HEAD`, `PUT`, `POST`, or `DELETE`." + }, + "resource": { + "type": "string", + "description": "Contains the path and query portion of the URL that was requested. For example, if the URL was \"http://example.com/app?name=val\", the resource would be \"/app?name=val\". Any trailing fragment (separated by a '#' character) will not be included." + }, + "httpVersion": { + "type": "string", + "description": "HTTP version of request." + }, + "status": { + "type": "integer", + "description": "Response status of request.", + "format": "int32" + }, + "responseSize": { + "type": "string", + "description": "Size in bytes sent back to client by request.", + "format": "int64" + }, + "referrer": { + "type": "string", + "description": "Referrer URL of request." + }, + "userAgent": { + "type": "string", + "description": "User agent used for making request." + }, + "nickname": { + "type": "string", + "description": "A string that identifies a logged-in user who made this request, or empty if the user is not logged in. Most likely, this is the part of the user's email before the '@' sign. The field value is the same for different requests from the same user, but different users may have a similar name. This information is also available to the application via Users API. This field will be populated starting with App Engine 1.9.21." + }, + "urlMapEntry": { + "type": "string", + "description": "File or class within URL mapping used for request. Useful for tracking down the source code which was responsible for managing request. Especially for multiply mapped handlers." + }, + "host": { + "type": "string", + "description": "The Internet host and port number of the resource being requested." + }, + "cost": { + "type": "number", + "description": "An indication of the relative cost of serving this request.", + "format": "double" + }, + "taskQueueName": { + "type": "string", + "description": "Queue name of the request (for an offline request)." + }, + "taskName": { + "type": "string", + "description": "Task name of the request (for an offline request)." + }, + "wasLoadingRequest": { + "type": "boolean", + "description": "Was this request a loading request for this instance?" + }, + "pendingTime": { + "type": "string", + "description": "Time this request spent in the pending request queue, if it was pending at all." + }, + "instanceIndex": { + "type": "integer", + "description": "If the instance that processed this request was individually addressable (i.e. belongs to a manually scaled module), this is the index of the instance.", + "format": "int32" + }, + "finished": { + "type": "boolean", + "description": "If true, represents a finished request. Otherwise, the request is active." + }, + "instanceId": { + "type": "string", + "description": "An opaque identifier for the instance that handled the request.", + "format": "byte" + }, + "line": { + "type": "array", + "description": "List of log lines emitted by the application while serving this request, if requested.", + "items": { + "$ref": "LogLine" + } + }, + "appEngineRelease": { + "type": "string", + "description": "App Engine release version string." + }, + "traceId": { + "type": "string", + "description": "Cloud Trace identifier of the trace for this request." + }, + "sourceReference": { + "type": "array", + "description": "Source code for the application that handled this request. There can be more than one source reference per deployed application if source code is distributed among multiple repositories.", + "items": { + "$ref": "SourceReference" + } + } + } + }, + "LogLine": { + "id": "LogLine", + "type": "object", + "description": "Application log line emitted while processing a request.", + "properties": { + "time": { + "type": "string", + "description": "Time when log entry was made. May be inaccurate." + }, + "severity": { + "type": "string", + "description": "Severity of log.", + "enum": [ + "DEFAULT", + "DEBUG", + "INFO", + "NOTICE", + "WARNING", + "ERROR", + "CRITICAL", + "ALERT", + "EMERGENCY" + ] + }, + "logMessage": { + "type": "string", + "description": "App provided log message." + }, + "sourceLocation": { + "$ref": "SourceLocation", + "description": "Line of code that generated this log message." + } + } + }, + "SourceLocation": { + "id": "SourceLocation", + "type": "object", + "description": "Specifies a location in a source file.", + "properties": { + "file": { + "type": "string", + "description": "Source file name. May or may not be a fully qualified name, depending on the runtime environment." + }, + "line": { + "type": "string", + "description": "Line within the source file.", + "format": "int64" + }, + "functionName": { + "type": "string", + "description": "Human-readable name of the function or method being invoked, with optional context such as the class or package name, for use in contexts such as the logs viewer where file:line number is less meaningful. This may vary by language, for example: in Java: qual.if.ied.Class.method in Go: dir/package.func in Python: function ..." + } + } + }, + "SourceReference": { + "id": "SourceReference", + "type": "object", + "description": "A reference to a particular snapshot of the source tree used to build and deploy an application.", + "properties": { + "repository": { + "type": "string", + "description": "Optional. A URI string identifying the repository. Example: \"https://github.com/GoogleCloudPlatform/kubernetes.git\"" + }, + "revisionId": { + "type": "string", + "description": "The canonical (and persistent) identifier of the deployed revision. Example (git): \"0035781c50ec7aa23385dc841529ce8a4b70db1b\"" + } + } + } + }, + "resources": { + "projects": { + "resources": { + "logs": { + "methods": { + "list": { + "id": "logging.projects.logs.list", + "path": "v1beta3/projects/{projectsId}/logs", + "httpMethod": "GET", + "description": "Lists the logs in the project. Only logs that have entries are listed.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `projectName`. The resource name of the project whose logs are requested. If both `serviceName` and `serviceIndexPrefix` are empty, then all logs with entries in this project are listed.", + "required": true, + "location": "path" + }, + "serviceName": { + "type": "string", + "description": "If not empty, this field must be a log service name such as `\"compute.googleapis.com\"`. Only logs associated with that that log service are listed.", + "location": "query" + }, + "serviceIndexPrefix": { + "type": "string", + "description": "The purpose of this field is to restrict the listed logs to those with entries of a certain kind. If `serviceName` is the name of a log service, then this field may contain values for the log service's indexes. Only logs that have entries whose indexes include the values are listed. The format for this field is `\"/val1/val2.../valN\"`, where `val1` is a value for the first index, `val2` for the second index, etc. An empty value (a single slash) for an index matches all values, and you can omit values for later indexes entirely.", + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of results to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "An opaque token, returned as `nextPageToken` by a prior `ListLogs` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogs` operation is continued.", + "location": "query" + } + }, + "parameterOrder": [ + "projectsId" + ], + "response": { + "$ref": "ListLogsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + }, + "delete": { + "id": "logging.projects.logs.delete", + "path": "v1beta3/projects/{projectsId}/logs/{logsId}", + "httpMethod": "DELETE", + "description": "Deletes a log and all its log entries. The log will reappear if it receives new entries.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `logName`. The resource name of the log to be deleted.", + "required": true, + "location": "path" + }, + "logsId": { + "type": "string", + "description": "Part of `logName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "logsId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + } + }, + "resources": { + "entries": { + "methods": { + "write": { + "id": "logging.projects.logs.entries.write", + "path": "v1beta3/projects/{projectsId}/logs/{logsId}/entries:write", + "httpMethod": "POST", + "description": "Writes log entries to Cloud Logging. Each entry consists of a `LogEntry` object. You must fill in all the fields of the object, including one of the payload fields. You may supply a map, `commonLabels`, that holds default (key, value) data for the `entries[].metadata.labels` map in each entry, saving you the trouble of creating identical copies for each entry.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `logName`. The resource name of the log that will receive the log entries.", + "required": true, + "location": "path" + }, + "logsId": { + "type": "string", + "description": "Part of `logName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "logsId" + ], + "request": { + "$ref": "WriteLogEntriesRequest" + }, + "response": { + "$ref": "WriteLogEntriesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.write" + ] + } + } + }, + "sinks": { + "methods": { + "list": { + "id": "logging.projects.logs.sinks.list", + "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks", + "httpMethod": "GET", + "description": "Lists log sinks associated with a log.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `logName`. The log whose sinks are wanted. For example, `\"compute.google.com/syslog\"`.", + "required": true, + "location": "path" + }, + "logsId": { + "type": "string", + "description": "Part of `logName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "logsId" + ], + "response": { + "$ref": "ListLogSinksResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + }, + "get": { + "id": "logging.projects.logs.sinks.get", + "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}", + "httpMethod": "GET", + "description": "Gets a log sink.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `sinkName`. The resource name of the log sink to return.", + "required": true, + "location": "path" + }, + "logsId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + }, + "sinksId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "logsId", + "sinksId" + ], + "response": { + "$ref": "LogSink" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + }, + "create": { + "id": "logging.projects.logs.sinks.create", + "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks", + "httpMethod": "POST", + "description": "Creates a log sink. All log entries for a specified log are written to the destination.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `logName`. The resource name of the log to which to the sink is bound.", + "required": true, + "location": "path" + }, + "logsId": { + "type": "string", + "description": "Part of `logName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "logsId" + ], + "request": { + "$ref": "LogSink" + }, + "response": { + "$ref": "LogSink" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "update": { + "id": "logging.projects.logs.sinks.update", + "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}", + "httpMethod": "PUT", + "description": "Updates a log sink. If the sink does not exist, it is created.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `sinkName`. The resource name of the sink to update.", + "required": true, + "location": "path" + }, + "logsId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + }, + "sinksId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "logsId", + "sinksId" + ], + "request": { + "$ref": "LogSink" + }, + "response": { + "$ref": "LogSink" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "delete": { + "id": "logging.projects.logs.sinks.delete", + "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}", + "httpMethod": "DELETE", + "description": "Deletes a log sink. After deletion, no new log entries are written to the destination.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `sinkName`. The resource name of the log sink to delete.", + "required": true, + "location": "path" + }, + "logsId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + }, + "sinksId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "logsId", + "sinksId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + } + } + } + } + }, + "logServices": { + "methods": { + "list": { + "id": "logging.projects.logServices.list", + "path": "v1beta3/projects/{projectsId}/logServices", + "httpMethod": "GET", + "description": "Lists the log services that have log entries in this project.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `projectName`. The resource name of the project whose services are to be listed.", + "required": true, + "location": "path" + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of `LogService` objects to return in one operation.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "An opaque token, returned as `nextPageToken` by a prior `ListLogServices` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogServices` operation is continued.", + "location": "query" + } + }, + "parameterOrder": [ + "projectsId" + ], + "response": { + "$ref": "ListLogServicesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + } + }, + "resources": { + "indexes": { + "methods": { + "list": { + "id": "logging.projects.logServices.indexes.list", + "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/indexes", + "httpMethod": "GET", + "description": "Lists the current index values for a log service.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `serviceName`. The resource name of a log service whose service indexes are requested. Example: `\"projects/my-project-id/logServices/appengine.googleapis.com\"`.", + "required": true, + "location": "path" + }, + "logServicesId": { + "type": "string", + "description": "Part of `serviceName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + }, + "indexPrefix": { + "type": "string", + "description": "Restricts the index values returned to be those with a specified prefix for each index key. This field has the form `\"/prefix1/prefix2/...\"`, in order corresponding to the `LogService indexKeys`. Non-empty prefixes must begin with `/`. For example, App Engine's two keys are the module ID and the version ID. Following is the effect of using various values for `indexPrefix`: + `\"/Mod/\"` retrieves `/Mod/10` and `/Mod/11` but not `/ModA/10`. + `\"/Mod` retrieves `/Mod/10`, `/Mod/11` and `/ModA/10` but not `/XXX/33`. + `\"/Mod/1\"` retrieves `/Mod/10` and `/Mod/11` but not `/ModA/10`. + `\"/Mod/10/\"` retrieves `/Mod/10` only. + An empty prefix or `\"/\"` retrieves all values.", + "location": "query" + }, + "depth": { + "type": "integer", + "description": "A non-negative integer that limits the number of levels of the index hierarchy that are returned. If `depth` is 1 (default), only the first index key value is returned. If `depth` is 2, both primary and secondary key values are returned. If `depth` is 0, the depth is the number of slash-separators in the `indexPrefix` field, not counting a slash appearing as the last character of the prefix. If the `indexPrefix` field is empty, the default depth is 1. It is an error for `depth` to be any positive value less than the number of components in `indexPrefix`.", + "format": "int32", + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of log service index resources to return in one operation.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "An opaque token, returned as `nextPageToken` by a prior `ListLogServiceIndexes` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogServiceIndexes` operation is continued.", + "location": "query" + } + }, + "parameterOrder": [ + "projectsId", + "logServicesId" + ], + "response": { + "$ref": "ListLogServiceIndexesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + } + } + }, + "sinks": { + "methods": { + "list": { + "id": "logging.projects.logServices.sinks.list", + "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks", + "httpMethod": "GET", + "description": "Lists log service sinks associated with a log service.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `serviceName`. The log service whose sinks are wanted.", + "required": true, + "location": "path" + }, + "logServicesId": { + "type": "string", + "description": "Part of `serviceName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "logServicesId" + ], + "response": { + "$ref": "ListLogServiceSinksResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + }, + "get": { + "id": "logging.projects.logServices.sinks.get", + "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}", + "httpMethod": "GET", + "description": "Gets a log service sink.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `sinkName`. The resource name of the log service sink to return.", + "required": true, + "location": "path" + }, + "logServicesId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + }, + "sinksId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "logServicesId", + "sinksId" + ], + "response": { + "$ref": "LogSink" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + }, + "create": { + "id": "logging.projects.logServices.sinks.create", + "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks", + "httpMethod": "POST", + "description": "Creates a log service sink. All log entries from a specified log service are written to the destination.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `serviceName`. The resource name of the log service to which the sink is bound.", + "required": true, + "location": "path" + }, + "logServicesId": { + "type": "string", + "description": "Part of `serviceName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "logServicesId" + ], + "request": { + "$ref": "LogSink" + }, + "response": { + "$ref": "LogSink" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "update": { + "id": "logging.projects.logServices.sinks.update", + "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}", + "httpMethod": "PUT", + "description": "Updates a log service sink. If the sink does not exist, it is created.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `sinkName`. The resource name of the log service sink to update.", + "required": true, + "location": "path" + }, + "logServicesId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + }, + "sinksId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "logServicesId", + "sinksId" + ], + "request": { + "$ref": "LogSink" + }, + "response": { + "$ref": "LogSink" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "delete": { + "id": "logging.projects.logServices.sinks.delete", + "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}", + "httpMethod": "DELETE", + "description": "Deletes a log service sink. After deletion, no new log entries are written to the destination.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `sinkName`. The resource name of the log service sink to delete.", + "required": true, + "location": "path" + }, + "logServicesId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + }, + "sinksId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "logServicesId", + "sinksId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + } + } + } + } + }, + "sinks": { + "methods": { + "list": { + "id": "logging.projects.sinks.list", + "path": "v1beta3/projects/{projectsId}/sinks", + "httpMethod": "GET", + "description": "Lists project sinks associated with a project.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `projectName`. The project whose sinks are wanted.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId" + ], + "response": { + "$ref": "ListSinksResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + }, + "get": { + "id": "logging.projects.sinks.get", + "path": "v1beta3/projects/{projectsId}/sinks/{sinksId}", + "httpMethod": "GET", + "description": "Gets a project sink.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `sinkName`. The resource name of the project sink to return.", + "required": true, + "location": "path" + }, + "sinksId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "sinksId" + ], + "response": { + "$ref": "LogSink" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + }, + "create": { + "id": "logging.projects.sinks.create", + "path": "v1beta3/projects/{projectsId}/sinks", + "httpMethod": "POST", + "description": "Creates a project sink. A logs filter determines which log entries are written to the destination.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `projectName`. The resource name of the project to which the sink is bound.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId" + ], + "request": { + "$ref": "LogSink" + }, + "response": { + "$ref": "LogSink" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "update": { + "id": "logging.projects.sinks.update", + "path": "v1beta3/projects/{projectsId}/sinks/{sinksId}", + "httpMethod": "PUT", + "description": "Updates a project sink. If the sink does not exist, it is created. The destination, filter, or both may be updated.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `sinkName`. The resource name of the project sink to update.", + "required": true, + "location": "path" + }, + "sinksId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "sinksId" + ], + "request": { + "$ref": "LogSink" + }, + "response": { + "$ref": "LogSink" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "delete": { + "id": "logging.projects.sinks.delete", + "path": "v1beta3/projects/{projectsId}/sinks/{sinksId}", + "httpMethod": "DELETE", + "description": "Deletes a project sink. After deletion, no new log entries are written to the destination.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `sinkName`. The resource name of the project sink to delete.", + "required": true, + "location": "path" + }, + "sinksId": { + "type": "string", + "description": "Part of `sinkName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "sinksId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + } + } + }, + "metrics": { + "methods": { + "list": { + "id": "logging.projects.metrics.list", + "path": "v1beta3/projects/{projectsId}/metrics", + "httpMethod": "GET", + "description": "List log metrics associated with the specified project.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `projectName`. The resource name for the project whose metrics are wanted.", + "required": true, + "location": "path" + }, + "pageToken": { + "type": "string", + "description": "An opaque token, returned as `nextPageToken` by a prior `ListLogMetrics` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogMetrics` operation is continued.", + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of `LogMetric` objects to return in one operation.", + "format": "int32", + "location": "query" + } + }, + "parameterOrder": [ + "projectsId" + ], + "response": { + "$ref": "ListLogMetricsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + }, + "get": { + "id": "logging.projects.metrics.get", + "path": "v1beta3/projects/{projectsId}/metrics/{metricsId}", + "httpMethod": "GET", + "description": "Get the specified log metric resource.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `metricName`. The resource name of the desired metric.", + "required": true, + "location": "path" + }, + "metricsId": { + "type": "string", + "description": "Part of `metricName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "metricsId" + ], + "response": { + "$ref": "LogMetric" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read" + ] + }, + "create": { + "id": "logging.projects.metrics.create", + "path": "v1beta3/projects/{projectsId}/metrics", + "httpMethod": "POST", + "description": "Create the specified log metric resource.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `projectName`. The resource name of the project in which to create the metric.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId" + ], + "request": { + "$ref": "LogMetric" + }, + "response": { + "$ref": "LogMetric" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "update": { + "id": "logging.projects.metrics.update", + "path": "v1beta3/projects/{projectsId}/metrics/{metricsId}", + "httpMethod": "PUT", + "description": "Create or update the specified log metric resource.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `metricName`. The resource name of the metric to update.", + "required": true, + "location": "path" + }, + "metricsId": { + "type": "string", + "description": "Part of `metricName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "metricsId" + ], + "request": { + "$ref": "LogMetric" + }, + "response": { + "$ref": "LogMetric" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + }, + "delete": { + "id": "logging.projects.metrics.delete", + "path": "v1beta3/projects/{projectsId}/metrics/{metricsId}", + "httpMethod": "DELETE", + "description": "Deletes the specified log metric.", + "parameters": { + "projectsId": { + "type": "string", + "description": "Part of `metricName`. The resource name of the metric to delete.", + "required": true, + "location": "path" + }, + "metricsId": { + "type": "string", + "description": "Part of `metricName`. See documentation of `projectsId`.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectsId", + "metricsId" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/logging.admin" + ] + } + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/logging/v1beta3/logging-gen.go b/Godeps/_workspace/src/google.golang.org/api/logging/v1beta3/logging-gen.go new file mode 100644 index 000000000..d35200435 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/logging/v1beta3/logging-gen.go @@ -0,0 +1,4709 @@ +// Package logging provides access to the Google Cloud Logging API. +// +// See https://cloud.google.com/logging/docs/ +// +// Usage example: +// +// import "google.golang.org/api/logging/v1beta3" +// ... +// loggingService, err := logging.New(oauthHttpClient) +package logging // import "google.golang.org/api/logging/v1beta3" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "logging:v1beta3" +const apiName = "logging" +const apiVersion = "v1beta3" +const basePath = "https://logging.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your data across Google Cloud Platform services + CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" + + // View your data across Google Cloud Platform services + CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" + + // Administrate log data for your projects + LoggingAdminScope = "https://www.googleapis.com/auth/logging.admin" + + // View log data for your projects + LoggingReadScope = "https://www.googleapis.com/auth/logging.read" + + // Submit log data for your projects + LoggingWriteScope = "https://www.googleapis.com/auth/logging.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.Projects = NewProjectsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Projects *ProjectsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewProjectsService(s *Service) *ProjectsService { + rs := &ProjectsService{s: s} + rs.LogServices = NewProjectsLogServicesService(s) + rs.Logs = NewProjectsLogsService(s) + rs.Metrics = NewProjectsMetricsService(s) + rs.Sinks = NewProjectsSinksService(s) + return rs +} + +type ProjectsService struct { + s *Service + + LogServices *ProjectsLogServicesService + + Logs *ProjectsLogsService + + Metrics *ProjectsMetricsService + + Sinks *ProjectsSinksService +} + +func NewProjectsLogServicesService(s *Service) *ProjectsLogServicesService { + rs := &ProjectsLogServicesService{s: s} + rs.Indexes = NewProjectsLogServicesIndexesService(s) + rs.Sinks = NewProjectsLogServicesSinksService(s) + return rs +} + +type ProjectsLogServicesService struct { + s *Service + + Indexes *ProjectsLogServicesIndexesService + + Sinks *ProjectsLogServicesSinksService +} + +func NewProjectsLogServicesIndexesService(s *Service) *ProjectsLogServicesIndexesService { + rs := &ProjectsLogServicesIndexesService{s: s} + return rs +} + +type ProjectsLogServicesIndexesService struct { + s *Service +} + +func NewProjectsLogServicesSinksService(s *Service) *ProjectsLogServicesSinksService { + rs := &ProjectsLogServicesSinksService{s: s} + return rs +} + +type ProjectsLogServicesSinksService struct { + s *Service +} + +func NewProjectsLogsService(s *Service) *ProjectsLogsService { + rs := &ProjectsLogsService{s: s} + rs.Entries = NewProjectsLogsEntriesService(s) + rs.Sinks = NewProjectsLogsSinksService(s) + return rs +} + +type ProjectsLogsService struct { + s *Service + + Entries *ProjectsLogsEntriesService + + Sinks *ProjectsLogsSinksService +} + +func NewProjectsLogsEntriesService(s *Service) *ProjectsLogsEntriesService { + rs := &ProjectsLogsEntriesService{s: s} + return rs +} + +type ProjectsLogsEntriesService struct { + s *Service +} + +func NewProjectsLogsSinksService(s *Service) *ProjectsLogsSinksService { + rs := &ProjectsLogsSinksService{s: s} + return rs +} + +type ProjectsLogsSinksService struct { + s *Service +} + +func NewProjectsMetricsService(s *Service) *ProjectsMetricsService { + rs := &ProjectsMetricsService{s: s} + return rs +} + +type ProjectsMetricsService struct { + s *Service +} + +func NewProjectsSinksService(s *Service) *ProjectsSinksService { + rs := &ProjectsSinksService{s: s} + return rs +} + +type ProjectsSinksService struct { + s *Service +} + +// Empty: A generic empty message that you can re-use to avoid defining +// duplicated empty messages in your APIs. A typical example is to use +// it as the request or the response type of an API method. For +// instance: service Foo { rpc Bar(google.protobuf.Empty) returns +// (google.protobuf.Empty); } The JSON representation for `Empty` is +// empty JSON object `{}`. +type Empty struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// HttpRequest: A common proto for logging HTTP requests. +type HttpRequest struct { + // CacheHit: Whether or not an entity was served from cache (with or + // without validation). + CacheHit bool `json:"cacheHit,omitempty"` + + // Referer: Referer (a.k.a. referrer) URL of request, as defined in + // http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html. + Referer string `json:"referer,omitempty"` + + // RemoteIp: IP address of the client who issues the HTTP request. Could + // be either IPv4 or IPv6. + RemoteIp string `json:"remoteIp,omitempty"` + + // RequestMethod: Request method, such as `GET`, `HEAD`, `PUT` or + // `POST`. + RequestMethod string `json:"requestMethod,omitempty"` + + // RequestSize: Size of the HTTP request message in bytes, including + // request headers and the request body. + RequestSize int64 `json:"requestSize,omitempty,string"` + + // RequestUrl: Contains the scheme (http|https), the host name, the path + // and the query portion of the URL that was requested. + RequestUrl string `json:"requestUrl,omitempty"` + + // ResponseSize: Size of the HTTP response message in bytes sent back to + // the client, including response headers and response body. + ResponseSize int64 `json:"responseSize,omitempty,string"` + + // Status: A response code indicates the status of response, e.g., 200. + Status int64 `json:"status,omitempty"` + + // UserAgent: User agent sent by the client, e.g., "Mozilla/4.0 + // (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)". + UserAgent string `json:"userAgent,omitempty"` + + // ValidatedWithOriginServer: Whether or not the response was validated + // with the origin server before being served from cache. This field is + // only meaningful if cache_hit is True. + ValidatedWithOriginServer bool `json:"validatedWithOriginServer,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CacheHit") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HttpRequest) MarshalJSON() ([]byte, error) { + type noMethod HttpRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListLogMetricsResponse: Result returned from ListLogMetrics. +type ListLogMetricsResponse struct { + // Metrics: The list of metrics that was requested. + Metrics []*LogMetric `json:"metrics,omitempty"` + + // NextPageToken: If there are more results, then `nextPageToken` is + // returned in the response. To get the next batch of entries, use the + // value of `nextPageToken` as `pageToken` in the next call of + // `ListLogMetrics`. If `nextPageToken` is empty, then there are no more + // results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Metrics") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListLogMetricsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListLogMetricsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListLogServiceIndexesResponse: Result returned from +// ListLogServiceIndexesRequest. +type ListLogServiceIndexesResponse struct { + // NextPageToken: If there are more results, then `nextPageToken` is + // returned in the response. To get the next batch of indexes, use the + // value of `nextPageToken` as `pageToken` in the next call of + // `ListLogServiceIndexes`. If `nextPageToken` is empty, then there are + // no more results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServiceIndexPrefixes: A list of log service index values. Each index + // value has the form "/value1/value2/...", where `value1` is a value + // in the primary index, `value2` is a value in the secondary index, and + // so forth. + ServiceIndexPrefixes []string `json:"serviceIndexPrefixes,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListLogServiceIndexesResponse) MarshalJSON() ([]byte, error) { + type noMethod ListLogServiceIndexesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListLogServiceSinksResponse: Result returned from +// `ListLogServiceSinks`. +type ListLogServiceSinksResponse struct { + // Sinks: The requested log service sinks. If a returned `LogSink` + // object has an empty `destination` field, the client can retrieve the + // complete `LogSink` object by calling `logServices.sinks.get`. + Sinks []*LogSink `json:"sinks,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Sinks") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListLogServiceSinksResponse) MarshalJSON() ([]byte, error) { + type noMethod ListLogServiceSinksResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListLogServicesResponse: Result returned from +// `ListLogServicesRequest`. +type ListLogServicesResponse struct { + // LogServices: A list of log services. + LogServices []*LogService `json:"logServices,omitempty"` + + // NextPageToken: If there are more results, then `nextPageToken` is + // returned in the response. To get the next batch of services, use the + // value of `nextPageToken` as `pageToken` in the next call of + // `ListLogServices`. If `nextPageToken` is empty, then there are no + // more results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "LogServices") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListLogServicesResponse) MarshalJSON() ([]byte, error) { + type noMethod ListLogServicesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListLogSinksResponse: Result returned from `ListLogSinks`. +type ListLogSinksResponse struct { + // Sinks: The requested log sinks. If a returned `LogSink` object has an + // empty `destination` field, the client can retrieve the complete + // `LogSink` object by calling `log.sinks.get`. + Sinks []*LogSink `json:"sinks,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Sinks") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListLogSinksResponse) MarshalJSON() ([]byte, error) { + type noMethod ListLogSinksResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListLogsResponse: Result returned from ListLogs. +type ListLogsResponse struct { + // Logs: A list of log descriptions matching the criteria. + Logs []*Log `json:"logs,omitempty"` + + // NextPageToken: If there are more results, then `nextPageToken` is + // returned in the response. To get the next batch of logs, use the + // value of `nextPageToken` as `pageToken` in the next call of + // `ListLogs`. If `nextPageToken` is empty, then there are no more + // results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Logs") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListLogsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListLogsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListSinksResponse: Result returned from `ListSinks`. +type ListSinksResponse struct { + // Sinks: The requested sinks. If a returned `LogSink` object has an + // empty `destination` field, the client can retrieve the complete + // `LogSink` object by calling `projects.sinks.get`. + Sinks []*LogSink `json:"sinks,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Sinks") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListSinksResponse) MarshalJSON() ([]byte, error) { + type noMethod ListSinksResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Log: _Output only._ Describes a log, which is a named stream of log +// entries. +type Log struct { + // DisplayName: _Optional._ The common name of the log. Example: + // "request_log". + DisplayName string `json:"displayName,omitempty"` + + // Name: The resource name of the log. Example: + // "/projects/my-gcp-project-id/logs/LOG_NAME", where `LOG_NAME` is + // the URL-encoded given name of the log. The log includes those log + // entries whose `LogEntry.log` field contains this given name. To avoid + // name collisions, it is a best practice to prefix the given log name + // with the service name, but this is not required. Examples of log + // given names: "appengine.googleapis.com/request_log", + // "apache-access". + Name string `json:"name,omitempty"` + + // PayloadType: _Optional_. A URI representing the expected payload type + // for log entries. + PayloadType string `json:"payloadType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Log) MarshalJSON() ([]byte, error) { + type noMethod Log + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LogEntry: An individual entry in a log. +type LogEntry struct { + // HttpRequest: Information about the HTTP request associated with this + // log entry, if applicable. + HttpRequest *HttpRequest `json:"httpRequest,omitempty"` + + // InsertId: A unique ID for the log entry. If you provide this field, + // the logging service considers other log entries in the same log with + // the same ID as duplicates which can be removed. + InsertId string `json:"insertId,omitempty"` + + // Log: The log to which this entry belongs. When a log entry is + // ingested, the value of this field is set by the logging system. + Log string `json:"log,omitempty"` + + // Metadata: Information about the log entry. + Metadata *LogEntryMetadata `json:"metadata,omitempty"` + + // ProtoPayload: The log entry payload, represented as a protocol buffer + // that is expressed as a JSON object. You can only pass `protoPayload` + // values that belong to a set of approved types. + ProtoPayload LogEntryProtoPayload `json:"protoPayload,omitempty"` + + // StructPayload: The log entry payload, represented as a structure that + // is expressed as a JSON object. + StructPayload LogEntryStructPayload `json:"structPayload,omitempty"` + + // TextPayload: The log entry payload, represented as a text string. + TextPayload string `json:"textPayload,omitempty"` + + // ForceSendFields is a list of field names (e.g. "HttpRequest") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LogEntry) MarshalJSON() ([]byte, error) { + type noMethod LogEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type LogEntryProtoPayload interface{} + +type LogEntryStructPayload interface{} + +// LogEntryMetadata: Additional data that is associated with a log +// entry, set by the service creating the log entry. +type LogEntryMetadata struct { + // Labels: A set of (key, value) data that provides additional + // information about the log entry. If the log entry is from one of the + // Google Cloud Platform sources listed below, the indicated (key, + // value) information must be provided: Google App Engine, service_name + // `appengine.googleapis.com`: "appengine.googleapis.com/module_id", + // "appengine.googleapis.com/version_id", and one of: + // "appengine.googleapis.com/replica_index", + // "appengine.googleapis.com/clone_id", or else provide the following + // Compute Engine labels: Google Compute Engine, service_name + // `compute.googleapis.com`: "compute.googleapis.com/resource_type", + // "instance" "compute.googleapis.com/resource_id", + Labels map[string]string `json:"labels,omitempty"` + + // ProjectId: The project ID of the Google Cloud Platform service that + // created the log entry. + ProjectId string `json:"projectId,omitempty"` + + // Region: The region name of the Google Cloud Platform service that + // created the log entry. For example, "us-central1". + Region string `json:"region,omitempty"` + + // ServiceName: The API name of the Google Cloud Platform service that + // created the log entry. For example, "compute.googleapis.com". + ServiceName string `json:"serviceName,omitempty"` + + // Severity: The severity of the log entry. + // + // Possible values: + // "DEFAULT" + // "DEBUG" + // "INFO" + // "NOTICE" + // "WARNING" + // "ERROR" + // "CRITICAL" + // "ALERT" + // "EMERGENCY" + Severity string `json:"severity,omitempty"` + + // Timestamp: The time the event described by the log entry occurred. + // Timestamps must be later than January 1, 1970. + Timestamp string `json:"timestamp,omitempty"` + + // UserId: The fully-qualified email address of the authenticated user + // that performed or requested the action represented by the log entry. + // If the log entry does not apply to an action taken by an + // authenticated user, then the field should be empty. + UserId string `json:"userId,omitempty"` + + // Zone: The zone of the Google Cloud Platform service that created the + // log entry. For example, "us-central1-a". + Zone string `json:"zone,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Labels") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LogEntryMetadata) MarshalJSON() ([]byte, error) { + type noMethod LogEntryMetadata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LogError: Describes a problem with a logging resource or operation. +type LogError struct { + // Resource: A resource name associated with this error. For example, + // the name of a Cloud Storage bucket that has insufficient permissions + // to be a destination for log entries. + Resource string `json:"resource,omitempty"` + + // Status: The error description, including a classification code, an + // error message, and other details. + Status *Status `json:"status,omitempty"` + + // TimeNanos: The time the error was observed, in nanoseconds since the + // Unix epoch. + TimeNanos int64 `json:"timeNanos,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Resource") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LogError) MarshalJSON() ([]byte, error) { + type noMethod LogError + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LogLine: Application log line emitted while processing a request. +type LogLine struct { + // LogMessage: App provided log message. + LogMessage string `json:"logMessage,omitempty"` + + // Severity: Severity of log. + // + // Possible values: + // "DEFAULT" + // "DEBUG" + // "INFO" + // "NOTICE" + // "WARNING" + // "ERROR" + // "CRITICAL" + // "ALERT" + // "EMERGENCY" + Severity string `json:"severity,omitempty"` + + // SourceLocation: Line of code that generated this log message. + SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` + + // Time: Time when log entry was made. May be inaccurate. + Time string `json:"time,omitempty"` + + // ForceSendFields is a list of field names (e.g. "LogMessage") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LogLine) MarshalJSON() ([]byte, error) { + type noMethod LogLine + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LogMetric: Describes a collected, logs-based metric. The value of the +// metric is the number of log entries in the project that match the +// advanced logs filter in the `filter` field. +type LogMetric struct { + // Description: A description of this metric. + Description string `json:"description,omitempty"` + + // Filter: An [advanced logs + // filter](/logging/docs/view/advanced_filters). Example: "log:syslog + // AND metadata.severity>=ERROR". + Filter string `json:"filter,omitempty"` + + // Name: The client-assigned name for this metric, such as + // "severe_errors". Metric names are limited to 1000 characters and + // can include only the following characters: `-A-Za-z0-9_.,+!*',()%/\`. + // The slash character `/` implies a hierarchy of name pieces, and + // cannot be the first character of the name. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LogMetric) MarshalJSON() ([]byte, error) { + type noMethod LogMetric + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LogService: _Output only._ Describes a service that writes log +// entries. +type LogService struct { + // IndexKeys: A list of the names of the keys used to index and label + // individual log entries from this service. The first two keys are used + // as the primary and secondary index, respectively. Additional keys may + // be used to label the entries. For example, App Engine indexes its + // entries by module and by version, so its `indexKeys` field is the + // following: [ "appengine.googleapis.com/module_id", + // "appengine.googleapis.com/version_id" ] + IndexKeys []string `json:"indexKeys,omitempty"` + + // Name: The service's name. Example: "appengine.googleapis.com". Log + // names beginning with this string are reserved for this service. This + // value can appear in the `LogEntry.metadata.serviceName` field of log + // entries associated with this log service. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "IndexKeys") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LogService) MarshalJSON() ([]byte, error) { + type noMethod LogService + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LogSink: Describes where log entries are written outside of Cloud +// Logging. +type LogSink struct { + // Destination: The resource name of the destination. Cloud Logging + // writes designated log entries to this destination. For example, + // "storage.googleapis.com/my-output-bucket". + Destination string `json:"destination,omitempty"` + + // Errors: _Output only._ If any errors occur when invoking a sink + // method, then this field contains descriptions of the errors. + Errors []*LogError `json:"errors,omitempty"` + + // Filter: An advanced logs filter. If present, only log entries + // matching the filter are written. Only project sinks use this field; + // log sinks and log service sinks must not include a filter. + Filter string `json:"filter,omitempty"` + + // Name: The client-assigned name of this sink. For example, + // "my-syslog-sink". The name must be unique among the sinks of a + // similar kind in the project. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Destination") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LogSink) MarshalJSON() ([]byte, error) { + type noMethod LogSink + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RequestLog: Complete log information about a single request to an +// application. +type RequestLog struct { + // AppEngineRelease: App Engine release version string. + AppEngineRelease string `json:"appEngineRelease,omitempty"` + + // AppId: Identifies the application that handled this request. + AppId string `json:"appId,omitempty"` + + // Cost: An indication of the relative cost of serving this request. + Cost float64 `json:"cost,omitempty"` + + // EndTime: Time at which request was known to end processing. + EndTime string `json:"endTime,omitempty"` + + // Finished: If true, represents a finished request. Otherwise, the + // request is active. + Finished bool `json:"finished,omitempty"` + + // Host: The Internet host and port number of the resource being + // requested. + Host string `json:"host,omitempty"` + + // HttpVersion: HTTP version of request. + HttpVersion string `json:"httpVersion,omitempty"` + + // InstanceId: An opaque identifier for the instance that handled the + // request. + InstanceId string `json:"instanceId,omitempty"` + + // InstanceIndex: If the instance that processed this request was + // individually addressable (i.e. belongs to a manually scaled module), + // this is the index of the instance. + InstanceIndex int64 `json:"instanceIndex,omitempty"` + + // Ip: Origin IP address. + Ip string `json:"ip,omitempty"` + + // Latency: Latency of the request. + Latency string `json:"latency,omitempty"` + + // Line: List of log lines emitted by the application while serving this + // request, if requested. + Line []*LogLine `json:"line,omitempty"` + + // MegaCycles: Number of CPU megacycles used to process request. + MegaCycles int64 `json:"megaCycles,omitempty,string"` + + // Method: Request method, such as `GET`, `HEAD`, `PUT`, `POST`, or + // `DELETE`. + Method string `json:"method,omitempty"` + + // ModuleId: Identifies the module of the application that handled this + // request. + ModuleId string `json:"moduleId,omitempty"` + + // Nickname: A string that identifies a logged-in user who made this + // request, or empty if the user is not logged in. Most likely, this is + // the part of the user's email before the '@' sign. The field value is + // the same for different requests from the same user, but different + // users may have a similar name. This information is also available to + // the application via Users API. This field will be populated starting + // with App Engine 1.9.21. + Nickname string `json:"nickname,omitempty"` + + // PendingTime: Time this request spent in the pending request queue, if + // it was pending at all. + PendingTime string `json:"pendingTime,omitempty"` + + // Referrer: Referrer URL of request. + Referrer string `json:"referrer,omitempty"` + + // RequestId: Globally unique identifier for a request, based on request + // start time. Request IDs for requests which started later will compare + // greater as binary strings than those for requests which started + // earlier. + RequestId string `json:"requestId,omitempty"` + + // Resource: Contains the path and query portion of the URL that was + // requested. For example, if the URL was + // "http://example.com/app?name=val", the resource would be + // "/app?name=val". Any trailing fragment (separated by a '#' character) + // will not be included. + Resource string `json:"resource,omitempty"` + + // ResponseSize: Size in bytes sent back to client by request. + ResponseSize int64 `json:"responseSize,omitempty,string"` + + // SourceReference: Source code for the application that handled this + // request. There can be more than one source reference per deployed + // application if source code is distributed among multiple + // repositories. + SourceReference []*SourceReference `json:"sourceReference,omitempty"` + + // StartTime: Time at which request was known to have begun processing. + StartTime string `json:"startTime,omitempty"` + + // Status: Response status of request. + Status int64 `json:"status,omitempty"` + + // TaskName: Task name of the request (for an offline request). + TaskName string `json:"taskName,omitempty"` + + // TaskQueueName: Queue name of the request (for an offline request). + TaskQueueName string `json:"taskQueueName,omitempty"` + + // TraceId: Cloud Trace identifier of the trace for this request. + TraceId string `json:"traceId,omitempty"` + + // UrlMapEntry: File or class within URL mapping used for request. + // Useful for tracking down the source code which was responsible for + // managing request. Especially for multiply mapped handlers. + UrlMapEntry string `json:"urlMapEntry,omitempty"` + + // UserAgent: User agent used for making request. + UserAgent string `json:"userAgent,omitempty"` + + // VersionId: Version of the application that handled this request. + VersionId string `json:"versionId,omitempty"` + + // WasLoadingRequest: Was this request a loading request for this + // instance? + WasLoadingRequest bool `json:"wasLoadingRequest,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AppEngineRelease") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RequestLog) MarshalJSON() ([]byte, error) { + type noMethod RequestLog + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SourceLocation: Specifies a location in a source file. +type SourceLocation struct { + // File: Source file name. May or may not be a fully qualified name, + // depending on the runtime environment. + File string `json:"file,omitempty"` + + // FunctionName: Human-readable name of the function or method being + // invoked, with optional context such as the class or package name, for + // use in contexts such as the logs viewer where file:line number is + // less meaningful. This may vary by language, for example: in Java: + // qual.if.ied.Class.method in Go: dir/package.func in Python: function + // ... + FunctionName string `json:"functionName,omitempty"` + + // Line: Line within the source file. + Line int64 `json:"line,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "File") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SourceLocation) MarshalJSON() ([]byte, error) { + type noMethod SourceLocation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SourceReference: A reference to a particular snapshot of the source +// tree used to build and deploy an application. +type SourceReference struct { + // Repository: Optional. A URI string identifying the repository. + // Example: "https://github.com/GoogleCloudPlatform/kubernetes.git" + Repository string `json:"repository,omitempty"` + + // RevisionId: The canonical (and persistent) identifier of the deployed + // revision. Example (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b" + RevisionId string `json:"revisionId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Repository") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SourceReference) MarshalJSON() ([]byte, error) { + type noMethod SourceReference + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Status: The `Status` type defines a logical error model that is +// suitable for different programming environments, including REST APIs +// and RPC APIs. It is used by [gRPC](https://github.com/grpc). The +// error model is designed to be: - Simple to use and understand for +// most users - Flexible enough to meet unexpected needs # Overview The +// `Status` message contains three pieces of data: error code, error +// message, and error details. The error code should be an enum value of +// google.rpc.Code, but it may accept additional error codes if needed. +// The error message should be a developer-facing English message that +// helps developers *understand* and *resolve* the error. If a localized +// user-facing error message is needed, put the localized message in the +// error details or localize it in the client. The optional error +// details may contain arbitrary information about the error. There is a +// predefined set of error detail types in the package `google.rpc` +// which can be used for common error conditions. # Language mapping The +// `Status` message is the logical representation of the error model, +// but it is not necessarily the actual wire format. When the `Status` +// message is exposed in different client libraries and different wire +// protocols, it can be mapped differently. For example, it will likely +// be mapped to some exceptions in Java, but more likely mapped to some +// error codes in C. # Other uses The error model and the `Status` +// message can be used in a variety of environments, either with or +// without APIs, to provide a consistent developer experience across +// different environments. Example uses of this error model include: - +// Partial errors. If a service needs to return partial errors to the +// client, it may embed the `Status` in the normal response to indicate +// the partial errors. - Workflow errors. A typical workflow has +// multiple steps. Each step may have a `Status` message for error +// reporting purpose. - Batch operations. If a client uses batch request +// and batch response, the `Status` message should be used directly +// inside batch response, one for each error sub-response. - +// Asynchronous operations. If an API call embeds asynchronous operation +// results in its response, the status of those operations should be +// represented directly using the `Status` message. - Logging. If some +// API errors are stored in logs, the message `Status` could be used +// directly after any stripping needed for security/privacy reasons. +type Status struct { + // Code: The status code, which should be an enum value of + // google.rpc.Code. + Code int64 `json:"code,omitempty"` + + // Details: A list of messages that carry the error details. There will + // be a common set of message types for APIs to use. + Details []StatusDetails `json:"details,omitempty"` + + // Message: A developer-facing error message, which should be in + // English. Any user-facing error message should be localized and sent + // in the google.rpc.Status.details field, or localized by the client. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Status) MarshalJSON() ([]byte, error) { + type noMethod Status + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type StatusDetails interface{} + +// WriteLogEntriesRequest: The parameters to WriteLogEntries. +type WriteLogEntriesRequest struct { + // CommonLabels: Metadata labels that apply to all log entries in this + // request, so that you don't have to repeat them in each log entry's + // `metadata.labels` field. If any of the log entries contains a (key, + // value) with the same key that is in `commonLabels`, then the entry's + // (key, value) overrides the one in `commonLabels`. + CommonLabels map[string]string `json:"commonLabels,omitempty"` + + // Entries: Log entries to insert. + Entries []*LogEntry `json:"entries,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CommonLabels") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *WriteLogEntriesRequest) MarshalJSON() ([]byte, error) { + type noMethod WriteLogEntriesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// WriteLogEntriesResponse: Result returned from WriteLogEntries. empty +type WriteLogEntriesResponse struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// method id "logging.projects.logServices.list": + +type ProjectsLogServicesListCall struct { + s *Service + projectsId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the log services that have log entries in this project. +func (r *ProjectsLogServicesService) List(projectsId string) *ProjectsLogServicesListCall { + c := &ProjectsLogServicesListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of `LogService` objects to return in one operation. +func (c *ProjectsLogServicesListCall) PageSize(pageSize int64) *ProjectsLogServicesListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": An opaque token, +// returned as `nextPageToken` by a prior `ListLogServices` operation. +// If `pageToken` is supplied, then the other fields of this request are +// ignored, and instead the previous `ListLogServices` operation is +// continued. +func (c *ProjectsLogServicesListCall) PageToken(pageToken string) *ProjectsLogServicesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogServicesListCall) Fields(s ...googleapi.Field) *ProjectsLogServicesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLogServicesListCall) IfNoneMatch(entityTag string) *ProjectsLogServicesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogServicesListCall) Context(ctx context.Context) *ProjectsLogServicesListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogServicesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logServices.list" call. +// Exactly one of *ListLogServicesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLogServicesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLogServicesListCall) Do() (*ListLogServicesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListLogServicesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the log services that have log entries in this project.", + // "httpMethod": "GET", + // "id": "logging.projects.logServices.list", + // "parameterOrder": [ + // "projectsId" + // ], + // "parameters": { + // "pageSize": { + // "description": "The maximum number of `LogService` objects to return in one operation.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "An opaque token, returned as `nextPageToken` by a prior `ListLogServices` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogServices` operation is continued.", + // "location": "query", + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `projectName`. The resource name of the project whose services are to be listed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logServices", + // "response": { + // "$ref": "ListLogServicesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" + // ] + // } + +} + +// method id "logging.projects.logServices.indexes.list": + +type ProjectsLogServicesIndexesListCall struct { + s *Service + projectsId string + logServicesId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the current index values for a log service. +func (r *ProjectsLogServicesIndexesService) List(projectsId string, logServicesId string) *ProjectsLogServicesIndexesListCall { + c := &ProjectsLogServicesIndexesListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logServicesId = logServicesId + return c +} + +// Depth sets the optional parameter "depth": A non-negative integer +// that limits the number of levels of the index hierarchy that are +// returned. If `depth` is 1 (default), only the first index key value +// is returned. If `depth` is 2, both primary and secondary key values +// are returned. If `depth` is 0, the depth is the number of +// slash-separators in the `indexPrefix` field, not counting a slash +// appearing as the last character of the prefix. If the `indexPrefix` +// field is empty, the default depth is 1. It is an error for `depth` to +// be any positive value less than the number of components in +// `indexPrefix`. +func (c *ProjectsLogServicesIndexesListCall) Depth(depth int64) *ProjectsLogServicesIndexesListCall { + c.opt_["depth"] = depth + return c +} + +// IndexPrefix sets the optional parameter "indexPrefix": Restricts the +// index values returned to be those with a specified prefix for each +// index key. This field has the form "/prefix1/prefix2/...", in order +// corresponding to the `LogService indexKeys`. Non-empty prefixes must +// begin with `/`. For example, App Engine's two keys are the module ID +// and the version ID. Following is the effect of using various values +// for `indexPrefix`: + "/Mod/" retrieves `/Mod/10` and `/Mod/11` but +// not `/ModA/10`. + "/Mod` retrieves `/Mod/10`, `/Mod/11` and +// `/ModA/10` but not `/XXX/33`. + "/Mod/1" retrieves `/Mod/10` and +// `/Mod/11` but not `/ModA/10`. + "/Mod/10/" retrieves `/Mod/10` +// only. + An empty prefix or "/" retrieves all values. +func (c *ProjectsLogServicesIndexesListCall) IndexPrefix(indexPrefix string) *ProjectsLogServicesIndexesListCall { + c.opt_["indexPrefix"] = indexPrefix + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of log service index resources to return in one operation. +func (c *ProjectsLogServicesIndexesListCall) PageSize(pageSize int64) *ProjectsLogServicesIndexesListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": An opaque token, +// returned as `nextPageToken` by a prior `ListLogServiceIndexes` +// operation. If `pageToken` is supplied, then the other fields of this +// request are ignored, and instead the previous `ListLogServiceIndexes` +// operation is continued. +func (c *ProjectsLogServicesIndexesListCall) PageToken(pageToken string) *ProjectsLogServicesIndexesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogServicesIndexesListCall) Fields(s ...googleapi.Field) *ProjectsLogServicesIndexesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLogServicesIndexesListCall) IfNoneMatch(entityTag string) *ProjectsLogServicesIndexesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogServicesIndexesListCall) Context(ctx context.Context) *ProjectsLogServicesIndexesListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogServicesIndexesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["depth"]; ok { + params.Set("depth", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["indexPrefix"]; ok { + params.Set("indexPrefix", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/indexes") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "logServicesId": c.logServicesId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logServices.indexes.list" call. +// Exactly one of *ListLogServiceIndexesResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListLogServiceIndexesResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLogServicesIndexesListCall) Do() (*ListLogServiceIndexesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListLogServiceIndexesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the current index values for a log service.", + // "httpMethod": "GET", + // "id": "logging.projects.logServices.indexes.list", + // "parameterOrder": [ + // "projectsId", + // "logServicesId" + // ], + // "parameters": { + // "depth": { + // "description": "A non-negative integer that limits the number of levels of the index hierarchy that are returned. If `depth` is 1 (default), only the first index key value is returned. If `depth` is 2, both primary and secondary key values are returned. If `depth` is 0, the depth is the number of slash-separators in the `indexPrefix` field, not counting a slash appearing as the last character of the prefix. If the `indexPrefix` field is empty, the default depth is 1. It is an error for `depth` to be any positive value less than the number of components in `indexPrefix`.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "indexPrefix": { + // "description": "Restricts the index values returned to be those with a specified prefix for each index key. This field has the form `\"/prefix1/prefix2/...\"`, in order corresponding to the `LogService indexKeys`. Non-empty prefixes must begin with `/`. For example, App Engine's two keys are the module ID and the version ID. Following is the effect of using various values for `indexPrefix`: + `\"/Mod/\"` retrieves `/Mod/10` and `/Mod/11` but not `/ModA/10`. + `\"/Mod` retrieves `/Mod/10`, `/Mod/11` and `/ModA/10` but not `/XXX/33`. + `\"/Mod/1\"` retrieves `/Mod/10` and `/Mod/11` but not `/ModA/10`. + `\"/Mod/10/\"` retrieves `/Mod/10` only. + An empty prefix or `\"/\"` retrieves all values.", + // "location": "query", + // "type": "string" + // }, + // "logServicesId": { + // "description": "Part of `serviceName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of log service index resources to return in one operation.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "An opaque token, returned as `nextPageToken` by a prior `ListLogServiceIndexes` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogServiceIndexes` operation is continued.", + // "location": "query", + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `serviceName`. The resource name of a log service whose service indexes are requested. Example: `\"projects/my-project-id/logServices/appengine.googleapis.com\"`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/indexes", + // "response": { + // "$ref": "ListLogServiceIndexesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" + // ] + // } + +} + +// method id "logging.projects.logServices.sinks.create": + +type ProjectsLogServicesSinksCreateCall struct { + s *Service + projectsId string + logServicesId string + logsink *LogSink + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a log service sink. All log entries from a specified +// log service are written to the destination. +func (r *ProjectsLogServicesSinksService) Create(projectsId string, logServicesId string, logsink *LogSink) *ProjectsLogServicesSinksCreateCall { + c := &ProjectsLogServicesSinksCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logServicesId = logServicesId + c.logsink = logsink + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogServicesSinksCreateCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogServicesSinksCreateCall) Context(ctx context.Context) *ProjectsLogServicesSinksCreateCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogServicesSinksCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "logServicesId": c.logServicesId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logServices.sinks.create" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLogServicesSinksCreateCall) Do() (*LogSink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LogSink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a log service sink. All log entries from a specified log service are written to the destination.", + // "httpMethod": "POST", + // "id": "logging.projects.logServices.sinks.create", + // "parameterOrder": [ + // "projectsId", + // "logServicesId" + // ], + // "parameters": { + // "logServicesId": { + // "description": "Part of `serviceName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `serviceName`. The resource name of the log service to which the sink is bound.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks", + // "request": { + // "$ref": "LogSink" + // }, + // "response": { + // "$ref": "LogSink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.projects.logServices.sinks.delete": + +type ProjectsLogServicesSinksDeleteCall struct { + s *Service + projectsId string + logServicesId string + sinksId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a log service sink. After deletion, no new log +// entries are written to the destination. +func (r *ProjectsLogServicesSinksService) Delete(projectsId string, logServicesId string, sinksId string) *ProjectsLogServicesSinksDeleteCall { + c := &ProjectsLogServicesSinksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logServicesId = logServicesId + c.sinksId = sinksId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogServicesSinksDeleteCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogServicesSinksDeleteCall) Context(ctx context.Context) *ProjectsLogServicesSinksDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogServicesSinksDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "logServicesId": c.logServicesId, + "sinksId": c.sinksId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logServices.sinks.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLogServicesSinksDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a log service sink. After deletion, no new log entries are written to the destination.", + // "httpMethod": "DELETE", + // "id": "logging.projects.logServices.sinks.delete", + // "parameterOrder": [ + // "projectsId", + // "logServicesId", + // "sinksId" + // ], + // "parameters": { + // "logServicesId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `sinkName`. The resource name of the log service sink to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sinksId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.projects.logServices.sinks.get": + +type ProjectsLogServicesSinksGetCall struct { + s *Service + projectsId string + logServicesId string + sinksId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a log service sink. +func (r *ProjectsLogServicesSinksService) Get(projectsId string, logServicesId string, sinksId string) *ProjectsLogServicesSinksGetCall { + c := &ProjectsLogServicesSinksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logServicesId = logServicesId + c.sinksId = sinksId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogServicesSinksGetCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLogServicesSinksGetCall) IfNoneMatch(entityTag string) *ProjectsLogServicesSinksGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogServicesSinksGetCall) Context(ctx context.Context) *ProjectsLogServicesSinksGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogServicesSinksGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "logServicesId": c.logServicesId, + "sinksId": c.sinksId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logServices.sinks.get" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLogServicesSinksGetCall) Do() (*LogSink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LogSink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a log service sink.", + // "httpMethod": "GET", + // "id": "logging.projects.logServices.sinks.get", + // "parameterOrder": [ + // "projectsId", + // "logServicesId", + // "sinksId" + // ], + // "parameters": { + // "logServicesId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `sinkName`. The resource name of the log service sink to return.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sinksId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}", + // "response": { + // "$ref": "LogSink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" + // ] + // } + +} + +// method id "logging.projects.logServices.sinks.list": + +type ProjectsLogServicesSinksListCall struct { + s *Service + projectsId string + logServicesId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists log service sinks associated with a log service. +func (r *ProjectsLogServicesSinksService) List(projectsId string, logServicesId string) *ProjectsLogServicesSinksListCall { + c := &ProjectsLogServicesSinksListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logServicesId = logServicesId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogServicesSinksListCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLogServicesSinksListCall) IfNoneMatch(entityTag string) *ProjectsLogServicesSinksListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogServicesSinksListCall) Context(ctx context.Context) *ProjectsLogServicesSinksListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogServicesSinksListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "logServicesId": c.logServicesId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logServices.sinks.list" call. +// Exactly one of *ListLogServiceSinksResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListLogServiceSinksResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLogServicesSinksListCall) Do() (*ListLogServiceSinksResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListLogServiceSinksResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists log service sinks associated with a log service.", + // "httpMethod": "GET", + // "id": "logging.projects.logServices.sinks.list", + // "parameterOrder": [ + // "projectsId", + // "logServicesId" + // ], + // "parameters": { + // "logServicesId": { + // "description": "Part of `serviceName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `serviceName`. The log service whose sinks are wanted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks", + // "response": { + // "$ref": "ListLogServiceSinksResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" + // ] + // } + +} + +// method id "logging.projects.logServices.sinks.update": + +type ProjectsLogServicesSinksUpdateCall struct { + s *Service + projectsId string + logServicesId string + sinksId string + logsink *LogSink + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a log service sink. If the sink does not exist, it is +// created. +func (r *ProjectsLogServicesSinksService) Update(projectsId string, logServicesId string, sinksId string, logsink *LogSink) *ProjectsLogServicesSinksUpdateCall { + c := &ProjectsLogServicesSinksUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logServicesId = logServicesId + c.sinksId = sinksId + c.logsink = logsink + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogServicesSinksUpdateCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogServicesSinksUpdateCall) Context(ctx context.Context) *ProjectsLogServicesSinksUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogServicesSinksUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "logServicesId": c.logServicesId, + "sinksId": c.sinksId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logServices.sinks.update" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLogServicesSinksUpdateCall) Do() (*LogSink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LogSink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a log service sink. If the sink does not exist, it is created.", + // "httpMethod": "PUT", + // "id": "logging.projects.logServices.sinks.update", + // "parameterOrder": [ + // "projectsId", + // "logServicesId", + // "sinksId" + // ], + // "parameters": { + // "logServicesId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `sinkName`. The resource name of the log service sink to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sinksId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}", + // "request": { + // "$ref": "LogSink" + // }, + // "response": { + // "$ref": "LogSink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.projects.logs.delete": + +type ProjectsLogsDeleteCall struct { + s *Service + projectsId string + logsId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a log and all its log entries. The log will reappear +// if it receives new entries. +func (r *ProjectsLogsService) Delete(projectsId string, logsId string) *ProjectsLogsDeleteCall { + c := &ProjectsLogsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logsId = logsId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLogsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogsDeleteCall) Context(ctx context.Context) *ProjectsLogsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "logsId": c.logsId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logs.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLogsDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a log and all its log entries. The log will reappear if it receives new entries.", + // "httpMethod": "DELETE", + // "id": "logging.projects.logs.delete", + // "parameterOrder": [ + // "projectsId", + // "logsId" + // ], + // "parameters": { + // "logsId": { + // "description": "Part of `logName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `logName`. The resource name of the log to be deleted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logs/{logsId}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.projects.logs.list": + +type ProjectsLogsListCall struct { + s *Service + projectsId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the logs in the project. Only logs that have entries are +// listed. +func (r *ProjectsLogsService) List(projectsId string) *ProjectsLogsListCall { + c := &ProjectsLogsListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of results to return. +func (c *ProjectsLogsListCall) PageSize(pageSize int64) *ProjectsLogsListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": An opaque token, +// returned as `nextPageToken` by a prior `ListLogs` operation. If +// `pageToken` is supplied, then the other fields of this request are +// ignored, and instead the previous `ListLogs` operation is continued. +func (c *ProjectsLogsListCall) PageToken(pageToken string) *ProjectsLogsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// ServiceIndexPrefix sets the optional parameter "serviceIndexPrefix": +// The purpose of this field is to restrict the listed logs to those +// with entries of a certain kind. If `serviceName` is the name of a log +// service, then this field may contain values for the log service's +// indexes. Only logs that have entries whose indexes include the values +// are listed. The format for this field is "/val1/val2.../valN", +// where `val1` is a value for the first index, `val2` for the second +// index, etc. An empty value (a single slash) for an index matches all +// values, and you can omit values for later indexes entirely. +func (c *ProjectsLogsListCall) ServiceIndexPrefix(serviceIndexPrefix string) *ProjectsLogsListCall { + c.opt_["serviceIndexPrefix"] = serviceIndexPrefix + return c +} + +// ServiceName sets the optional parameter "serviceName": If not empty, +// this field must be a log service name such as +// "compute.googleapis.com". Only logs associated with that that log +// service are listed. +func (c *ProjectsLogsListCall) ServiceName(serviceName string) *ProjectsLogsListCall { + c.opt_["serviceName"] = serviceName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogsListCall) Fields(s ...googleapi.Field) *ProjectsLogsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLogsListCall) IfNoneMatch(entityTag string) *ProjectsLogsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogsListCall) Context(ctx context.Context) *ProjectsLogsListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["serviceIndexPrefix"]; ok { + params.Set("serviceIndexPrefix", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["serviceName"]; ok { + params.Set("serviceName", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logs.list" call. +// Exactly one of *ListLogsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLogsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLogsListCall) Do() (*ListLogsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListLogsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the logs in the project. Only logs that have entries are listed.", + // "httpMethod": "GET", + // "id": "logging.projects.logs.list", + // "parameterOrder": [ + // "projectsId" + // ], + // "parameters": { + // "pageSize": { + // "description": "The maximum number of results to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "An opaque token, returned as `nextPageToken` by a prior `ListLogs` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogs` operation is continued.", + // "location": "query", + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `projectName`. The resource name of the project whose logs are requested. If both `serviceName` and `serviceIndexPrefix` are empty, then all logs with entries in this project are listed.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "serviceIndexPrefix": { + // "description": "The purpose of this field is to restrict the listed logs to those with entries of a certain kind. If `serviceName` is the name of a log service, then this field may contain values for the log service's indexes. Only logs that have entries whose indexes include the values are listed. The format for this field is `\"/val1/val2.../valN\"`, where `val1` is a value for the first index, `val2` for the second index, etc. An empty value (a single slash) for an index matches all values, and you can omit values for later indexes entirely.", + // "location": "query", + // "type": "string" + // }, + // "serviceName": { + // "description": "If not empty, this field must be a log service name such as `\"compute.googleapis.com\"`. Only logs associated with that that log service are listed.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logs", + // "response": { + // "$ref": "ListLogsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" + // ] + // } + +} + +// method id "logging.projects.logs.entries.write": + +type ProjectsLogsEntriesWriteCall struct { + s *Service + projectsId string + logsId string + writelogentriesrequest *WriteLogEntriesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Write: Writes log entries to Cloud Logging. Each entry consists of a +// `LogEntry` object. You must fill in all the fields of the object, +// including one of the payload fields. You may supply a map, +// `commonLabels`, that holds default (key, value) data for the +// `entries[].metadata.labels` map in each entry, saving you the trouble +// of creating identical copies for each entry. +func (r *ProjectsLogsEntriesService) Write(projectsId string, logsId string, writelogentriesrequest *WriteLogEntriesRequest) *ProjectsLogsEntriesWriteCall { + c := &ProjectsLogsEntriesWriteCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logsId = logsId + c.writelogentriesrequest = writelogentriesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogsEntriesWriteCall) Fields(s ...googleapi.Field) *ProjectsLogsEntriesWriteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogsEntriesWriteCall) Context(ctx context.Context) *ProjectsLogsEntriesWriteCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogsEntriesWriteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.writelogentriesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/entries:write") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "logsId": c.logsId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logs.entries.write" call. +// Exactly one of *WriteLogEntriesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *WriteLogEntriesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLogsEntriesWriteCall) Do() (*WriteLogEntriesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &WriteLogEntriesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Writes log entries to Cloud Logging. Each entry consists of a `LogEntry` object. You must fill in all the fields of the object, including one of the payload fields. You may supply a map, `commonLabels`, that holds default (key, value) data for the `entries[].metadata.labels` map in each entry, saving you the trouble of creating identical copies for each entry.", + // "httpMethod": "POST", + // "id": "logging.projects.logs.entries.write", + // "parameterOrder": [ + // "projectsId", + // "logsId" + // ], + // "parameters": { + // "logsId": { + // "description": "Part of `logName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `logName`. The resource name of the log that will receive the log entries.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logs/{logsId}/entries:write", + // "request": { + // "$ref": "WriteLogEntriesRequest" + // }, + // "response": { + // "$ref": "WriteLogEntriesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.write" + // ] + // } + +} + +// method id "logging.projects.logs.sinks.create": + +type ProjectsLogsSinksCreateCall struct { + s *Service + projectsId string + logsId string + logsink *LogSink + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a log sink. All log entries for a specified log are +// written to the destination. +func (r *ProjectsLogsSinksService) Create(projectsId string, logsId string, logsink *LogSink) *ProjectsLogsSinksCreateCall { + c := &ProjectsLogsSinksCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logsId = logsId + c.logsink = logsink + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogsSinksCreateCall) Fields(s ...googleapi.Field) *ProjectsLogsSinksCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogsSinksCreateCall) Context(ctx context.Context) *ProjectsLogsSinksCreateCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogsSinksCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "logsId": c.logsId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logs.sinks.create" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLogsSinksCreateCall) Do() (*LogSink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LogSink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a log sink. All log entries for a specified log are written to the destination.", + // "httpMethod": "POST", + // "id": "logging.projects.logs.sinks.create", + // "parameterOrder": [ + // "projectsId", + // "logsId" + // ], + // "parameters": { + // "logsId": { + // "description": "Part of `logName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `logName`. The resource name of the log to which to the sink is bound.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks", + // "request": { + // "$ref": "LogSink" + // }, + // "response": { + // "$ref": "LogSink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.projects.logs.sinks.delete": + +type ProjectsLogsSinksDeleteCall struct { + s *Service + projectsId string + logsId string + sinksId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a log sink. After deletion, no new log entries are +// written to the destination. +func (r *ProjectsLogsSinksService) Delete(projectsId string, logsId string, sinksId string) *ProjectsLogsSinksDeleteCall { + c := &ProjectsLogsSinksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logsId = logsId + c.sinksId = sinksId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogsSinksDeleteCall) Fields(s ...googleapi.Field) *ProjectsLogsSinksDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogsSinksDeleteCall) Context(ctx context.Context) *ProjectsLogsSinksDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogsSinksDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "logsId": c.logsId, + "sinksId": c.sinksId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logs.sinks.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLogsSinksDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a log sink. After deletion, no new log entries are written to the destination.", + // "httpMethod": "DELETE", + // "id": "logging.projects.logs.sinks.delete", + // "parameterOrder": [ + // "projectsId", + // "logsId", + // "sinksId" + // ], + // "parameters": { + // "logsId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `sinkName`. The resource name of the log sink to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sinksId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.projects.logs.sinks.get": + +type ProjectsLogsSinksGetCall struct { + s *Service + projectsId string + logsId string + sinksId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a log sink. +func (r *ProjectsLogsSinksService) Get(projectsId string, logsId string, sinksId string) *ProjectsLogsSinksGetCall { + c := &ProjectsLogsSinksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logsId = logsId + c.sinksId = sinksId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogsSinksGetCall) Fields(s ...googleapi.Field) *ProjectsLogsSinksGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLogsSinksGetCall) IfNoneMatch(entityTag string) *ProjectsLogsSinksGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogsSinksGetCall) Context(ctx context.Context) *ProjectsLogsSinksGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogsSinksGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "logsId": c.logsId, + "sinksId": c.sinksId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logs.sinks.get" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLogsSinksGetCall) Do() (*LogSink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LogSink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a log sink.", + // "httpMethod": "GET", + // "id": "logging.projects.logs.sinks.get", + // "parameterOrder": [ + // "projectsId", + // "logsId", + // "sinksId" + // ], + // "parameters": { + // "logsId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `sinkName`. The resource name of the log sink to return.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sinksId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}", + // "response": { + // "$ref": "LogSink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" + // ] + // } + +} + +// method id "logging.projects.logs.sinks.list": + +type ProjectsLogsSinksListCall struct { + s *Service + projectsId string + logsId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists log sinks associated with a log. +func (r *ProjectsLogsSinksService) List(projectsId string, logsId string) *ProjectsLogsSinksListCall { + c := &ProjectsLogsSinksListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logsId = logsId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogsSinksListCall) Fields(s ...googleapi.Field) *ProjectsLogsSinksListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLogsSinksListCall) IfNoneMatch(entityTag string) *ProjectsLogsSinksListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogsSinksListCall) Context(ctx context.Context) *ProjectsLogsSinksListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogsSinksListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "logsId": c.logsId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logs.sinks.list" call. +// Exactly one of *ListLogSinksResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLogSinksResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLogsSinksListCall) Do() (*ListLogSinksResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListLogSinksResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists log sinks associated with a log.", + // "httpMethod": "GET", + // "id": "logging.projects.logs.sinks.list", + // "parameterOrder": [ + // "projectsId", + // "logsId" + // ], + // "parameters": { + // "logsId": { + // "description": "Part of `logName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `logName`. The log whose sinks are wanted. For example, `\"compute.google.com/syslog\"`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks", + // "response": { + // "$ref": "ListLogSinksResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" + // ] + // } + +} + +// method id "logging.projects.logs.sinks.update": + +type ProjectsLogsSinksUpdateCall struct { + s *Service + projectsId string + logsId string + sinksId string + logsink *LogSink + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a log sink. If the sink does not exist, it is +// created. +func (r *ProjectsLogsSinksService) Update(projectsId string, logsId string, sinksId string, logsink *LogSink) *ProjectsLogsSinksUpdateCall { + c := &ProjectsLogsSinksUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logsId = logsId + c.sinksId = sinksId + c.logsink = logsink + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLogsSinksUpdateCall) Fields(s ...googleapi.Field) *ProjectsLogsSinksUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsLogsSinksUpdateCall) Context(ctx context.Context) *ProjectsLogsSinksUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsLogsSinksUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "logsId": c.logsId, + "sinksId": c.sinksId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.logs.sinks.update" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLogsSinksUpdateCall) Do() (*LogSink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LogSink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a log sink. If the sink does not exist, it is created.", + // "httpMethod": "PUT", + // "id": "logging.projects.logs.sinks.update", + // "parameterOrder": [ + // "projectsId", + // "logsId", + // "sinksId" + // ], + // "parameters": { + // "logsId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `sinkName`. The resource name of the sink to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sinksId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}", + // "request": { + // "$ref": "LogSink" + // }, + // "response": { + // "$ref": "LogSink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.projects.metrics.create": + +type ProjectsMetricsCreateCall struct { + s *Service + projectsId string + logmetric *LogMetric + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Create the specified log metric resource. +func (r *ProjectsMetricsService) Create(projectsId string, logmetric *LogMetric) *ProjectsMetricsCreateCall { + c := &ProjectsMetricsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logmetric = logmetric + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsMetricsCreateCall) Fields(s ...googleapi.Field) *ProjectsMetricsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsMetricsCreateCall) Context(ctx context.Context) *ProjectsMetricsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsMetricsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logmetric) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/metrics") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.metrics.create" call. +// Exactly one of *LogMetric or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogMetric.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsMetricsCreateCall) Do() (*LogMetric, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LogMetric{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create the specified log metric resource.", + // "httpMethod": "POST", + // "id": "logging.projects.metrics.create", + // "parameterOrder": [ + // "projectsId" + // ], + // "parameters": { + // "projectsId": { + // "description": "Part of `projectName`. The resource name of the project in which to create the metric.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/metrics", + // "request": { + // "$ref": "LogMetric" + // }, + // "response": { + // "$ref": "LogMetric" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.projects.metrics.delete": + +type ProjectsMetricsDeleteCall struct { + s *Service + projectsId string + metricsId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified log metric. +func (r *ProjectsMetricsService) Delete(projectsId string, metricsId string) *ProjectsMetricsDeleteCall { + c := &ProjectsMetricsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.metricsId = metricsId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsMetricsDeleteCall) Fields(s ...googleapi.Field) *ProjectsMetricsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsMetricsDeleteCall) Context(ctx context.Context) *ProjectsMetricsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsMetricsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/metrics/{metricsId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "metricsId": c.metricsId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.metrics.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsMetricsDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified log metric.", + // "httpMethod": "DELETE", + // "id": "logging.projects.metrics.delete", + // "parameterOrder": [ + // "projectsId", + // "metricsId" + // ], + // "parameters": { + // "metricsId": { + // "description": "Part of `metricName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `metricName`. The resource name of the metric to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/metrics/{metricsId}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.projects.metrics.get": + +type ProjectsMetricsGetCall struct { + s *Service + projectsId string + metricsId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Get the specified log metric resource. +func (r *ProjectsMetricsService) Get(projectsId string, metricsId string) *ProjectsMetricsGetCall { + c := &ProjectsMetricsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.metricsId = metricsId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsMetricsGetCall) Fields(s ...googleapi.Field) *ProjectsMetricsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsMetricsGetCall) IfNoneMatch(entityTag string) *ProjectsMetricsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsMetricsGetCall) Context(ctx context.Context) *ProjectsMetricsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsMetricsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/metrics/{metricsId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "metricsId": c.metricsId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.metrics.get" call. +// Exactly one of *LogMetric or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogMetric.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsMetricsGetCall) Do() (*LogMetric, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LogMetric{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get the specified log metric resource.", + // "httpMethod": "GET", + // "id": "logging.projects.metrics.get", + // "parameterOrder": [ + // "projectsId", + // "metricsId" + // ], + // "parameters": { + // "metricsId": { + // "description": "Part of `metricName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `metricName`. The resource name of the desired metric.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/metrics/{metricsId}", + // "response": { + // "$ref": "LogMetric" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" + // ] + // } + +} + +// method id "logging.projects.metrics.list": + +type ProjectsMetricsListCall struct { + s *Service + projectsId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List log metrics associated with the specified project. +func (r *ProjectsMetricsService) List(projectsId string) *ProjectsMetricsListCall { + c := &ProjectsMetricsListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of `LogMetric` objects to return in one operation. +func (c *ProjectsMetricsListCall) PageSize(pageSize int64) *ProjectsMetricsListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": An opaque token, +// returned as `nextPageToken` by a prior `ListLogMetrics` operation. If +// `pageToken` is supplied, then the other fields of this request are +// ignored, and instead the previous `ListLogMetrics` operation is +// continued. +func (c *ProjectsMetricsListCall) PageToken(pageToken string) *ProjectsMetricsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsMetricsListCall) Fields(s ...googleapi.Field) *ProjectsMetricsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsMetricsListCall) IfNoneMatch(entityTag string) *ProjectsMetricsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsMetricsListCall) Context(ctx context.Context) *ProjectsMetricsListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsMetricsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/metrics") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.metrics.list" call. +// Exactly one of *ListLogMetricsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLogMetricsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsMetricsListCall) Do() (*ListLogMetricsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListLogMetricsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List log metrics associated with the specified project.", + // "httpMethod": "GET", + // "id": "logging.projects.metrics.list", + // "parameterOrder": [ + // "projectsId" + // ], + // "parameters": { + // "pageSize": { + // "description": "The maximum number of `LogMetric` objects to return in one operation.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "An opaque token, returned as `nextPageToken` by a prior `ListLogMetrics` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogMetrics` operation is continued.", + // "location": "query", + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `projectName`. The resource name for the project whose metrics are wanted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/metrics", + // "response": { + // "$ref": "ListLogMetricsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" + // ] + // } + +} + +// method id "logging.projects.metrics.update": + +type ProjectsMetricsUpdateCall struct { + s *Service + projectsId string + metricsId string + logmetric *LogMetric + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Create or update the specified log metric resource. +func (r *ProjectsMetricsService) Update(projectsId string, metricsId string, logmetric *LogMetric) *ProjectsMetricsUpdateCall { + c := &ProjectsMetricsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.metricsId = metricsId + c.logmetric = logmetric + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsMetricsUpdateCall) Fields(s ...googleapi.Field) *ProjectsMetricsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsMetricsUpdateCall) Context(ctx context.Context) *ProjectsMetricsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsMetricsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logmetric) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/metrics/{metricsId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "metricsId": c.metricsId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.metrics.update" call. +// Exactly one of *LogMetric or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LogMetric.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsMetricsUpdateCall) Do() (*LogMetric, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LogMetric{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create or update the specified log metric resource.", + // "httpMethod": "PUT", + // "id": "logging.projects.metrics.update", + // "parameterOrder": [ + // "projectsId", + // "metricsId" + // ], + // "parameters": { + // "metricsId": { + // "description": "Part of `metricName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectsId": { + // "description": "Part of `metricName`. The resource name of the metric to update.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/metrics/{metricsId}", + // "request": { + // "$ref": "LogMetric" + // }, + // "response": { + // "$ref": "LogMetric" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.projects.sinks.create": + +type ProjectsSinksCreateCall struct { + s *Service + projectsId string + logsink *LogSink + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a project sink. A logs filter determines which log +// entries are written to the destination. +func (r *ProjectsSinksService) Create(projectsId string, logsink *LogSink) *ProjectsSinksCreateCall { + c := &ProjectsSinksCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.logsink = logsink + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSinksCreateCall) Fields(s ...googleapi.Field) *ProjectsSinksCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSinksCreateCall) Context(ctx context.Context) *ProjectsSinksCreateCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSinksCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/sinks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.sinks.create" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsSinksCreateCall) Do() (*LogSink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LogSink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a project sink. A logs filter determines which log entries are written to the destination.", + // "httpMethod": "POST", + // "id": "logging.projects.sinks.create", + // "parameterOrder": [ + // "projectsId" + // ], + // "parameters": { + // "projectsId": { + // "description": "Part of `projectName`. The resource name of the project to which the sink is bound.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/sinks", + // "request": { + // "$ref": "LogSink" + // }, + // "response": { + // "$ref": "LogSink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.projects.sinks.delete": + +type ProjectsSinksDeleteCall struct { + s *Service + projectsId string + sinksId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a project sink. After deletion, no new log entries +// are written to the destination. +func (r *ProjectsSinksService) Delete(projectsId string, sinksId string) *ProjectsSinksDeleteCall { + c := &ProjectsSinksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.sinksId = sinksId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSinksDeleteCall) Fields(s ...googleapi.Field) *ProjectsSinksDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSinksDeleteCall) Context(ctx context.Context) *ProjectsSinksDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSinksDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/sinks/{sinksId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "sinksId": c.sinksId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.sinks.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsSinksDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a project sink. After deletion, no new log entries are written to the destination.", + // "httpMethod": "DELETE", + // "id": "logging.projects.sinks.delete", + // "parameterOrder": [ + // "projectsId", + // "sinksId" + // ], + // "parameters": { + // "projectsId": { + // "description": "Part of `sinkName`. The resource name of the project sink to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sinksId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/sinks/{sinksId}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} + +// method id "logging.projects.sinks.get": + +type ProjectsSinksGetCall struct { + s *Service + projectsId string + sinksId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a project sink. +func (r *ProjectsSinksService) Get(projectsId string, sinksId string) *ProjectsSinksGetCall { + c := &ProjectsSinksGetCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.sinksId = sinksId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSinksGetCall) Fields(s ...googleapi.Field) *ProjectsSinksGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsSinksGetCall) IfNoneMatch(entityTag string) *ProjectsSinksGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSinksGetCall) Context(ctx context.Context) *ProjectsSinksGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSinksGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/sinks/{sinksId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "sinksId": c.sinksId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.sinks.get" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsSinksGetCall) Do() (*LogSink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LogSink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a project sink.", + // "httpMethod": "GET", + // "id": "logging.projects.sinks.get", + // "parameterOrder": [ + // "projectsId", + // "sinksId" + // ], + // "parameters": { + // "projectsId": { + // "description": "Part of `sinkName`. The resource name of the project sink to return.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sinksId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/sinks/{sinksId}", + // "response": { + // "$ref": "LogSink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" + // ] + // } + +} + +// method id "logging.projects.sinks.list": + +type ProjectsSinksListCall struct { + s *Service + projectsId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists project sinks associated with a project. +func (r *ProjectsSinksService) List(projectsId string) *ProjectsSinksListCall { + c := &ProjectsSinksListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSinksListCall) Fields(s ...googleapi.Field) *ProjectsSinksListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsSinksListCall) IfNoneMatch(entityTag string) *ProjectsSinksListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSinksListCall) Context(ctx context.Context) *ProjectsSinksListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSinksListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/sinks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.sinks.list" call. +// Exactly one of *ListSinksResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListSinksResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsSinksListCall) Do() (*ListSinksResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListSinksResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists project sinks associated with a project.", + // "httpMethod": "GET", + // "id": "logging.projects.sinks.list", + // "parameterOrder": [ + // "projectsId" + // ], + // "parameters": { + // "projectsId": { + // "description": "Part of `projectName`. The project whose sinks are wanted.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/sinks", + // "response": { + // "$ref": "ListSinksResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/logging.admin", + // "https://www.googleapis.com/auth/logging.read" + // ] + // } + +} + +// method id "logging.projects.sinks.update": + +type ProjectsSinksUpdateCall struct { + s *Service + projectsId string + sinksId string + logsink *LogSink + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a project sink. If the sink does not exist, it is +// created. The destination, filter, or both may be updated. +func (r *ProjectsSinksService) Update(projectsId string, sinksId string, logsink *LogSink) *ProjectsSinksUpdateCall { + c := &ProjectsSinksUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.projectsId = projectsId + c.sinksId = sinksId + c.logsink = logsink + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSinksUpdateCall) Fields(s ...googleapi.Field) *ProjectsSinksUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSinksUpdateCall) Context(ctx context.Context) *ProjectsSinksUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSinksUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/sinks/{sinksId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectsId": c.projectsId, + "sinksId": c.sinksId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "logging.projects.sinks.update" call. +// Exactly one of *LogSink or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *LogSink.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsSinksUpdateCall) Do() (*LogSink, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LogSink{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a project sink. If the sink does not exist, it is created. The destination, filter, or both may be updated.", + // "httpMethod": "PUT", + // "id": "logging.projects.sinks.update", + // "parameterOrder": [ + // "projectsId", + // "sinksId" + // ], + // "parameters": { + // "projectsId": { + // "description": "Part of `sinkName`. The resource name of the project sink to update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sinksId": { + // "description": "Part of `sinkName`. See documentation of `projectsId`.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta3/projects/{projectsId}/sinks/{sinksId}", + // "request": { + // "$ref": "LogSink" + // }, + // "response": { + // "$ref": "LogSink" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/logging.admin" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/logging/v2beta1/logging-api.json b/Godeps/_workspace/src/google.golang.org/api/logging/v2beta1/logging-api.json new file mode 100644 index 000000000..405d24425 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/logging/v2beta1/logging-api.json @@ -0,0 +1,318 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/Dl8jzEbCLfW8aU_OmsbXBqEUy5Y\"", + "discoveryVersion": "v1", + "id": "logging:v2beta1", + "name": "logging", + "version": "v2beta1", + "revision": "20151007", + "title": "Google Cloud Logging API", + "description": "Google Cloud Logging API lets you create logs, ingest log entries, and manage log sinks.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/logging/docs/", + "protocol": "rest", + "baseUrl": "https://logging.googleapis.com/", + "basePath": "/", + "rootUrl": "https://logging.googleapis.com/", + "servicePath": "", + "batchPath": "batch", + "parameters": { + "access_token": { + "type": "string", + "description": "OAuth access token.", + "location": "query" + }, + "alt": { + "type": "string", + "description": "Data format for response.", + "default": "json", + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query" + }, + "bearer_token": { + "type": "string", + "description": "OAuth bearer token.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JSONP", + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "pp": { + "type": "boolean", + "description": "Pretty-print response.", + "default": "true", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query" + }, + "upload_protocol": { + "type": "string", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query" + }, + "uploadType": { + "type": "string", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query" + }, + "$.xgafv": { + "type": "string", + "description": "V1 error format.", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" + } + }, + "schemas": { + "RequestLog": { + "id": "RequestLog", + "type": "object", + "description": "Complete log information about a single request to an application.", + "properties": { + "appId": { + "type": "string", + "description": "Identifies the application that handled this request." + }, + "moduleId": { + "type": "string", + "description": "Identifies the module of the application that handled this request." + }, + "versionId": { + "type": "string", + "description": "Version of the application that handled this request." + }, + "requestId": { + "type": "string", + "description": "Globally unique identifier for a request, based on request start time. Request IDs for requests which started later will compare greater as binary strings than those for requests which started earlier.", + "format": "byte" + }, + "ip": { + "type": "string", + "description": "Origin IP address." + }, + "startTime": { + "type": "string", + "description": "Time at which request was known to have begun processing." + }, + "endTime": { + "type": "string", + "description": "Time at which request was known to end processing." + }, + "latency": { + "type": "string", + "description": "Latency of the request." + }, + "megaCycles": { + "type": "string", + "description": "Number of CPU megacycles used to process request.", + "format": "int64" + }, + "method": { + "type": "string", + "description": "Request method, such as `GET`, `HEAD`, `PUT`, `POST`, or `DELETE`." + }, + "resource": { + "type": "string", + "description": "Contains the path and query portion of the URL that was requested. For example, if the URL was \"http://example.com/app?name=val\", the resource would be \"/app?name=val\". Any trailing fragment (separated by a '#' character) will not be included." + }, + "httpVersion": { + "type": "string", + "description": "HTTP version of request." + }, + "status": { + "type": "integer", + "description": "Response status of request.", + "format": "int32" + }, + "responseSize": { + "type": "string", + "description": "Size in bytes sent back to client by request.", + "format": "int64" + }, + "referrer": { + "type": "string", + "description": "Referrer URL of request." + }, + "userAgent": { + "type": "string", + "description": "User agent used for making request." + }, + "nickname": { + "type": "string", + "description": "A string that identifies a logged-in user who made this request, or empty if the user is not logged in. Most likely, this is the part of the user's email before the '@' sign. The field value is the same for different requests from the same user, but different users may have a similar name. This information is also available to the application via Users API. This field will be populated starting with App Engine 1.9.21." + }, + "urlMapEntry": { + "type": "string", + "description": "File or class within URL mapping used for request. Useful for tracking down the source code which was responsible for managing request. Especially for multiply mapped handlers." + }, + "host": { + "type": "string", + "description": "The Internet host and port number of the resource being requested." + }, + "cost": { + "type": "number", + "description": "An indication of the relative cost of serving this request.", + "format": "double" + }, + "taskQueueName": { + "type": "string", + "description": "Queue name of the request (for an offline request)." + }, + "taskName": { + "type": "string", + "description": "Task name of the request (for an offline request)." + }, + "wasLoadingRequest": { + "type": "boolean", + "description": "Was this request a loading request for this instance?" + }, + "pendingTime": { + "type": "string", + "description": "Time this request spent in the pending request queue, if it was pending at all." + }, + "instanceIndex": { + "type": "integer", + "description": "If the instance that processed this request was individually addressable (i.e. belongs to a manually scaled module), this is the index of the instance.", + "format": "int32" + }, + "finished": { + "type": "boolean", + "description": "If true, represents a finished request. Otherwise, the request is active." + }, + "instanceId": { + "type": "string", + "description": "An opaque identifier for the instance that handled the request.", + "format": "byte" + }, + "line": { + "type": "array", + "description": "List of log lines emitted by the application while serving this request, if requested.", + "items": { + "$ref": "LogLine" + } + }, + "appEngineRelease": { + "type": "string", + "description": "App Engine release version string." + }, + "traceId": { + "type": "string", + "description": "Cloud Trace identifier of the trace for this request." + }, + "sourceReference": { + "type": "array", + "description": "Source code for the application that handled this request. There can be more than one source reference per deployed application if source code is distributed among multiple repositories.", + "items": { + "$ref": "SourceReference" + } + } + } + }, + "LogLine": { + "id": "LogLine", + "type": "object", + "description": "Application log line emitted while processing a request.", + "properties": { + "time": { + "type": "string", + "description": "Time when log entry was made. May be inaccurate." + }, + "severity": { + "type": "string", + "description": "Severity of log.", + "enum": [ + "DEFAULT", + "DEBUG", + "INFO", + "NOTICE", + "WARNING", + "ERROR", + "CRITICAL", + "ALERT", + "EMERGENCY" + ] + }, + "logMessage": { + "type": "string", + "description": "App provided log message." + }, + "sourceLocation": { + "$ref": "SourceLocation", + "description": "Line of code that generated this log message." + } + } + }, + "SourceLocation": { + "id": "SourceLocation", + "type": "object", + "description": "Specifies a location in a source file.", + "properties": { + "file": { + "type": "string", + "description": "Source file name. May or may not be a fully qualified name, depending on the runtime environment." + }, + "line": { + "type": "string", + "description": "Line within the source file.", + "format": "int64" + }, + "functionName": { + "type": "string", + "description": "Human-readable name of the function or method being invoked, with optional context such as the class or package name, for use in contexts such as the logs viewer where file:line number is less meaningful. This may vary by language, for example: in Java: qual.if.ied.Class.method in Go: dir/package.func in Python: function ..." + } + } + }, + "SourceReference": { + "id": "SourceReference", + "type": "object", + "description": "A reference to a particular snapshot of the source tree used to build and deploy an application.", + "properties": { + "repository": { + "type": "string", + "description": "Optional. A URI string identifying the repository. Example: \"https://github.com/GoogleCloudPlatform/kubernetes.git\"" + }, + "revisionId": { + "type": "string", + "description": "The canonical (and persistent) identifier of the deployed revision. Example (git): \"0035781c50ec7aa23385dc841529ce8a4b70db1b\"" + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/logging/v2beta1/logging-gen.go b/Godeps/_workspace/src/google.golang.org/api/logging/v2beta1/logging-gen.go new file mode 100644 index 000000000..2bd0c0402 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/logging/v2beta1/logging-gen.go @@ -0,0 +1,304 @@ +// Package logging provides access to the Google Cloud Logging API. +// +// See https://cloud.google.com/logging/docs/ +// +// Usage example: +// +// import "google.golang.org/api/logging/v2beta1" +// ... +// loggingService, err := logging.New(oauthHttpClient) +package logging // import "google.golang.org/api/logging/v2beta1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "logging:v2beta1" +const apiName = "logging" +const apiVersion = "v2beta1" +const basePath = "https://logging.googleapis.com/" + +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 + UserAgent string // optional additional User-Agent fragment +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +// LogLine: Application log line emitted while processing a request. +type LogLine struct { + // LogMessage: App provided log message. + LogMessage string `json:"logMessage,omitempty"` + + // Severity: Severity of log. + // + // Possible values: + // "DEFAULT" + // "DEBUG" + // "INFO" + // "NOTICE" + // "WARNING" + // "ERROR" + // "CRITICAL" + // "ALERT" + // "EMERGENCY" + Severity string `json:"severity,omitempty"` + + // SourceLocation: Line of code that generated this log message. + SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` + + // Time: Time when log entry was made. May be inaccurate. + Time string `json:"time,omitempty"` + + // ForceSendFields is a list of field names (e.g. "LogMessage") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LogLine) MarshalJSON() ([]byte, error) { + type noMethod LogLine + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RequestLog: Complete log information about a single request to an +// application. +type RequestLog struct { + // AppEngineRelease: App Engine release version string. + AppEngineRelease string `json:"appEngineRelease,omitempty"` + + // AppId: Identifies the application that handled this request. + AppId string `json:"appId,omitempty"` + + // Cost: An indication of the relative cost of serving this request. + Cost float64 `json:"cost,omitempty"` + + // EndTime: Time at which request was known to end processing. + EndTime string `json:"endTime,omitempty"` + + // Finished: If true, represents a finished request. Otherwise, the + // request is active. + Finished bool `json:"finished,omitempty"` + + // Host: The Internet host and port number of the resource being + // requested. + Host string `json:"host,omitempty"` + + // HttpVersion: HTTP version of request. + HttpVersion string `json:"httpVersion,omitempty"` + + // InstanceId: An opaque identifier for the instance that handled the + // request. + InstanceId string `json:"instanceId,omitempty"` + + // InstanceIndex: If the instance that processed this request was + // individually addressable (i.e. belongs to a manually scaled module), + // this is the index of the instance. + InstanceIndex int64 `json:"instanceIndex,omitempty"` + + // Ip: Origin IP address. + Ip string `json:"ip,omitempty"` + + // Latency: Latency of the request. + Latency string `json:"latency,omitempty"` + + // Line: List of log lines emitted by the application while serving this + // request, if requested. + Line []*LogLine `json:"line,omitempty"` + + // MegaCycles: Number of CPU megacycles used to process request. + MegaCycles int64 `json:"megaCycles,omitempty,string"` + + // Method: Request method, such as `GET`, `HEAD`, `PUT`, `POST`, or + // `DELETE`. + Method string `json:"method,omitempty"` + + // ModuleId: Identifies the module of the application that handled this + // request. + ModuleId string `json:"moduleId,omitempty"` + + // Nickname: A string that identifies a logged-in user who made this + // request, or empty if the user is not logged in. Most likely, this is + // the part of the user's email before the '@' sign. The field value is + // the same for different requests from the same user, but different + // users may have a similar name. This information is also available to + // the application via Users API. This field will be populated starting + // with App Engine 1.9.21. + Nickname string `json:"nickname,omitempty"` + + // PendingTime: Time this request spent in the pending request queue, if + // it was pending at all. + PendingTime string `json:"pendingTime,omitempty"` + + // Referrer: Referrer URL of request. + Referrer string `json:"referrer,omitempty"` + + // RequestId: Globally unique identifier for a request, based on request + // start time. Request IDs for requests which started later will compare + // greater as binary strings than those for requests which started + // earlier. + RequestId string `json:"requestId,omitempty"` + + // Resource: Contains the path and query portion of the URL that was + // requested. For example, if the URL was + // "http://example.com/app?name=val", the resource would be + // "/app?name=val". Any trailing fragment (separated by a '#' character) + // will not be included. + Resource string `json:"resource,omitempty"` + + // ResponseSize: Size in bytes sent back to client by request. + ResponseSize int64 `json:"responseSize,omitempty,string"` + + // SourceReference: Source code for the application that handled this + // request. There can be more than one source reference per deployed + // application if source code is distributed among multiple + // repositories. + SourceReference []*SourceReference `json:"sourceReference,omitempty"` + + // StartTime: Time at which request was known to have begun processing. + StartTime string `json:"startTime,omitempty"` + + // Status: Response status of request. + Status int64 `json:"status,omitempty"` + + // TaskName: Task name of the request (for an offline request). + TaskName string `json:"taskName,omitempty"` + + // TaskQueueName: Queue name of the request (for an offline request). + TaskQueueName string `json:"taskQueueName,omitempty"` + + // TraceId: Cloud Trace identifier of the trace for this request. + TraceId string `json:"traceId,omitempty"` + + // UrlMapEntry: File or class within URL mapping used for request. + // Useful for tracking down the source code which was responsible for + // managing request. Especially for multiply mapped handlers. + UrlMapEntry string `json:"urlMapEntry,omitempty"` + + // UserAgent: User agent used for making request. + UserAgent string `json:"userAgent,omitempty"` + + // VersionId: Version of the application that handled this request. + VersionId string `json:"versionId,omitempty"` + + // WasLoadingRequest: Was this request a loading request for this + // instance? + WasLoadingRequest bool `json:"wasLoadingRequest,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AppEngineRelease") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RequestLog) MarshalJSON() ([]byte, error) { + type noMethod RequestLog + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SourceLocation: Specifies a location in a source file. +type SourceLocation struct { + // File: Source file name. May or may not be a fully qualified name, + // depending on the runtime environment. + File string `json:"file,omitempty"` + + // FunctionName: Human-readable name of the function or method being + // invoked, with optional context such as the class or package name, for + // use in contexts such as the logs viewer where file:line number is + // less meaningful. This may vary by language, for example: in Java: + // qual.if.ied.Class.method in Go: dir/package.func in Python: function + // ... + FunctionName string `json:"functionName,omitempty"` + + // Line: Line within the source file. + Line int64 `json:"line,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "File") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SourceLocation) MarshalJSON() ([]byte, error) { + type noMethod SourceLocation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SourceReference: A reference to a particular snapshot of the source +// tree used to build and deploy an application. +type SourceReference struct { + // Repository: Optional. A URI string identifying the repository. + // Example: "https://github.com/GoogleCloudPlatform/kubernetes.git" + Repository string `json:"repository,omitempty"` + + // RevisionId: The canonical (and persistent) identifier of the deployed + // revision. Example (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b" + RevisionId string `json:"revisionId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Repository") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SourceReference) MarshalJSON() ([]byte, error) { + type noMethod SourceReference + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} diff --git a/Godeps/_workspace/src/google.golang.org/api/manager/v1beta2/manager-api.json b/Godeps/_workspace/src/google.golang.org/api/manager/v1beta2/manager-api.json new file mode 100644 index 000000000..daff54165 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/manager/v1beta2/manager-api.json @@ -0,0 +1,1171 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/E9BDi4qTzFW-I9oO8ahZRyv1jkM\"", + "discoveryVersion": "v1", + "id": "manager:v1beta2", + "name": "manager", + "version": "v1beta2", + "revision": "20140915", + "title": "Deployment Manager API", + "description": "The Deployment Manager API allows users to declaratively configure, deploy and run complex solutions on the Google Cloud Platform.", + "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/deployment-manager/", + "labels": [ + "limited_availability" + ], + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/manager/v1beta2/projects/", + "basePath": "/manager/v1beta2/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "manager/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/appengine.admin": { + "description": "View and manage your applications deployed on Google App Engine" + }, + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/compute": { + "description": "View and manage your Google Compute Engine resources" + }, + "https://www.googleapis.com/auth/devstorage.read_write": { + "description": "Manage your data in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/ndev.cloudman": { + "description": "View and manage your Google Cloud Platform management resources and deployment status information" + }, + "https://www.googleapis.com/auth/ndev.cloudman.readonly": { + "description": "View your Google Cloud Platform management resources and deployment status information" + } + } + } + }, + "schemas": { + "AccessConfig": { + "id": "AccessConfig", + "type": "object", + "description": "A Compute Engine network accessConfig. Identical to the accessConfig on corresponding Compute Engine resource.", + "properties": { + "name": { + "type": "string", + "description": "Name of this access configuration." + }, + "natIp": { + "type": "string", + "description": "An external IP address associated with this instance." + }, + "type": { + "type": "string", + "description": "Type of this access configuration file. (Currently only ONE_TO_ONE_NAT is legal.)" + } + } + }, + "Action": { + "id": "Action", + "type": "object", + "description": "An Action encapsulates a set of commands as a single runnable module with additional information needed during run-time.", + "properties": { + "commands": { + "type": "array", + "description": "A list of commands to run sequentially for this action.", + "items": { + "type": "string" + } + }, + "timeoutMs": { + "type": "integer", + "description": "The timeout in milliseconds for this action to run.", + "format": "int32" + } + } + }, + "AllowedRule": { + "id": "AllowedRule", + "type": "object", + "description": "An allowed port resource.", + "properties": { + "IPProtocol": { + "type": "string", + "description": "?tcp?, ?udp? or ?icmp?" + }, + "ports": { + "type": "array", + "description": "List of ports or port ranges (Example inputs include: [\"22\"], [?33?, \"12345-12349\"].", + "items": { + "type": "string" + } + } + } + }, + "AutoscalingModule": { + "id": "AutoscalingModule", + "type": "object", + "properties": { + "coolDownPeriodSec": { + "type": "integer", + "format": "int32" + }, + "description": { + "type": "string" + }, + "maxNumReplicas": { + "type": "integer", + "format": "int32" + }, + "minNumReplicas": { + "type": "integer", + "format": "int32" + }, + "signalType": { + "type": "string" + }, + "targetModule": { + "type": "string" + }, + "targetUtilization": { + "type": "number", + "description": "target_utilization should be in range [0,1].", + "format": "double" + } + } + }, + "AutoscalingModuleStatus": { + "id": "AutoscalingModuleStatus", + "type": "object", + "properties": { + "autoscalingConfigUrl": { + "type": "string", + "description": "[Output Only] The URL of the corresponding Autoscaling configuration." + } + } + }, + "DeployState": { + "id": "DeployState", + "type": "object", + "description": "[Output Only] The current state of a replica or module.", + "properties": { + "details": { + "type": "string", + "description": "[Output Only] Human readable details about the current state." + }, + "status": { + "type": "string", + "description": "[Output Only] The status of the deployment. Possible values include: \n- UNKNOWN\n- DEPLOYING\n- DEPLOYED\n- DEPLOYMENT_FAILED\n- DELETING\n- DELETED\n- DELETE_FAILED" + } + } + }, + "Deployment": { + "id": "Deployment", + "type": "object", + "description": "A deployment represents a physical instantiation of a Template.", + "properties": { + "creationDate": { + "type": "string", + "description": "[Output Only] The time when this deployment was created." + }, + "description": { + "type": "string", + "description": "A user-supplied description of this Deployment." + }, + "modules": { + "type": "object", + "description": "[Output Only] List of status for the modules in this deployment.", + "additionalProperties": { + "$ref": "ModuleStatus", + "description": "Name of the module." + } + }, + "name": { + "type": "string", + "description": "Name of this deployment. The name must conform to the following regular expression: [a-zA-Z0-9-_]{1,64}" + }, + "overrides": { + "type": "array", + "description": "The set of parameter overrides to apply to the corresponding Template before deploying.", + "items": { + "$ref": "ParamOverride" + } + }, + "state": { + "$ref": "DeployState", + "description": "[Output Only] Current status of this deployment." + }, + "templateName": { + "type": "string", + "description": "The name of the Template on which this deployment is based." + } + } + }, + "DeploymentsListResponse": { + "id": "DeploymentsListResponse", + "type": "object", + "properties": { + "nextPageToken": { + "type": "string" + }, + "resources": { + "type": "array", + "items": { + "$ref": "Deployment" + } + } + } + }, + "DiskAttachment": { + "id": "DiskAttachment", + "type": "object", + "description": "How to attach a disk to a Replica.", + "properties": { + "deviceName": { + "type": "string", + "description": "The device name of this disk." + }, + "index": { + "type": "integer", + "description": "A zero-based index to assign to this disk, where 0 is reserved for the boot disk. If not specified, this is assigned by the server.", + "format": "uint32" + } + } + }, + "EnvVariable": { + "id": "EnvVariable", + "type": "object", + "description": "An environment variable.", + "properties": { + "hidden": { + "type": "boolean", + "description": "Whether this variable is hidden or visible." + }, + "value": { + "type": "string", + "description": "Value of the environment variable." + } + } + }, + "ExistingDisk": { + "id": "ExistingDisk", + "type": "object", + "description": "A pre-existing persistent disk that will be attached to every Replica in the Pool.", + "properties": { + "attachment": { + "$ref": "DiskAttachment", + "description": "Optional. How the disk will be attached to the Replica." + }, + "source": { + "type": "string", + "description": "The fully-qualified URL of the Persistent Disk resource. It must be in the same zone as the Pool." + } + } + }, + "FirewallModule": { + "id": "FirewallModule", + "type": "object", + "description": "A Firewall resource", + "properties": { + "allowed": { + "type": "array", + "description": "The allowed ports or port ranges.", + "items": { + "$ref": "AllowedRule" + } + }, + "description": { + "type": "string", + "description": "The description of the firewall (optional)" + }, + "network": { + "type": "string", + "description": "The NetworkModule to which this firewall should apply. If not specified, or if specified as 'default', this firewall will be applied to the 'default' network." + }, + "sourceRanges": { + "type": "array", + "description": "Source IP ranges to apply this firewall to, see the GCE Spec for details on syntax", + "items": { + "type": "string" + } + }, + "sourceTags": { + "type": "array", + "description": "Source Tags to apply this firewall to, see the GCE Spec for details on syntax", + "items": { + "type": "string" + } + }, + "targetTags": { + "type": "array", + "description": "Target Tags to apply this firewall to, see the GCE Spec for details on syntax", + "items": { + "type": "string" + } + } + } + }, + "FirewallModuleStatus": { + "id": "FirewallModuleStatus", + "type": "object", + "properties": { + "firewallUrl": { + "type": "string", + "description": "[Output Only] The URL of the corresponding Firewall resource." + } + } + }, + "HealthCheckModule": { + "id": "HealthCheckModule", + "type": "object", + "properties": { + "checkIntervalSec": { + "type": "integer", + "format": "int32" + }, + "description": { + "type": "string" + }, + "healthyThreshold": { + "type": "integer", + "format": "int32" + }, + "host": { + "type": "string" + }, + "path": { + "type": "string" + }, + "port": { + "type": "integer", + "format": "int32" + }, + "timeoutSec": { + "type": "integer", + "format": "int32" + }, + "unhealthyThreshold": { + "type": "integer", + "format": "int32" + } + } + }, + "HealthCheckModuleStatus": { + "id": "HealthCheckModuleStatus", + "type": "object", + "properties": { + "healthCheckUrl": { + "type": "string", + "description": "[Output Only] The HealthCheck URL." + } + } + }, + "LbModule": { + "id": "LbModule", + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "healthChecks": { + "type": "array", + "items": { + "type": "string" + } + }, + "ipAddress": { + "type": "string" + }, + "ipProtocol": { + "type": "string" + }, + "portRange": { + "type": "string" + }, + "sessionAffinity": { + "type": "string" + }, + "targetModules": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "LbModuleStatus": { + "id": "LbModuleStatus", + "type": "object", + "properties": { + "forwardingRuleUrl": { + "type": "string", + "description": "[Output Only] The URL of the corresponding ForwardingRule in GCE." + }, + "targetPoolUrl": { + "type": "string", + "description": "[Output Only] The URL of the corresponding TargetPool resource in GCE." + } + } + }, + "Metadata": { + "id": "Metadata", + "type": "object", + "description": "A Compute Engine metadata entry. Identical to the metadata on the corresponding Compute Engine resource.", + "properties": { + "fingerPrint": { + "type": "string", + "description": "The fingerprint of the metadata." + }, + "items": { + "type": "array", + "description": "A list of metadata items.", + "items": { + "$ref": "MetadataItem" + } + } + } + }, + "MetadataItem": { + "id": "MetadataItem", + "type": "object", + "description": "A Compute Engine metadata item, defined as a key:value pair. Identical to the metadata on the corresponding Compute Engine resource.", + "properties": { + "key": { + "type": "string", + "description": "A metadata key." + }, + "value": { + "type": "string", + "description": "A metadata value." + } + } + }, + "Module": { + "id": "Module", + "type": "object", + "description": "A module in a configuration. A module represents a single homogeneous, possibly replicated task.", + "properties": { + "autoscalingModule": { + "$ref": "AutoscalingModule" + }, + "firewallModule": { + "$ref": "FirewallModule" + }, + "healthCheckModule": { + "$ref": "HealthCheckModule" + }, + "lbModule": { + "$ref": "LbModule" + }, + "networkModule": { + "$ref": "NetworkModule" + }, + "replicaPoolModule": { + "$ref": "ReplicaPoolModule" + }, + "type": { + "type": "string", + "description": "The type of this module. Valid values (\"AUTOSCALING\", \"FIREWALL\", \"HEALTH_CHECK\", \"LOAD_BALANCING\", \"NETWORK\", \"REPLICA_POOL\")" + } + } + }, + "ModuleStatus": { + "id": "ModuleStatus", + "type": "object", + "description": "[Output Only] Aggregate status for a module.", + "properties": { + "autoscalingModuleStatus": { + "$ref": "AutoscalingModuleStatus", + "description": "[Output Only] The status of the AutoscalingModule, set for type AUTOSCALING." + }, + "firewallModuleStatus": { + "$ref": "FirewallModuleStatus", + "description": "[Output Only] The status of the FirewallModule, set for type FIREWALL." + }, + "healthCheckModuleStatus": { + "$ref": "HealthCheckModuleStatus", + "description": "[Output Only] The status of the HealthCheckModule, set for type HEALTH_CHECK." + }, + "lbModuleStatus": { + "$ref": "LbModuleStatus", + "description": "[Output Only] The status of the LbModule, set for type LOAD_BALANCING." + }, + "networkModuleStatus": { + "$ref": "NetworkModuleStatus", + "description": "[Output Only] The status of the NetworkModule, set for type NETWORK." + }, + "replicaPoolModuleStatus": { + "$ref": "ReplicaPoolModuleStatus", + "description": "[Output Only] The status of the ReplicaPoolModule, set for type VM." + }, + "state": { + "$ref": "DeployState", + "description": "[Output Only] The current state of the module." + }, + "type": { + "type": "string", + "description": "[Output Only] The type of the module." + } + } + }, + "NetworkInterface": { + "id": "NetworkInterface", + "type": "object", + "description": "A Compute Engine NetworkInterface resource. Identical to the NetworkInterface on the corresponding Compute Engine resource.", + "properties": { + "accessConfigs": { + "type": "array", + "description": "An array of configurations for this interface. This specifies how this interface is configured to interact with other network services", + "items": { + "$ref": "AccessConfig" + } + }, + "name": { + "type": "string", + "description": "Name of the interface." + }, + "network": { + "type": "string", + "description": "The name of the NetworkModule to which this interface applies. If not specified, or specified as 'default', this will use the 'default' network." + }, + "networkIp": { + "type": "string", + "description": "An optional IPV4 internal network address to assign to the instance for this network interface." + } + } + }, + "NetworkModule": { + "id": "NetworkModule", + "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." + }, + "description": { + "type": "string", + "description": "The description of the network." + }, + "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 typicall the first usable address in that range. If not specified, the default value is the first usable address in IPv4Range." + } + } + }, + "NetworkModuleStatus": { + "id": "NetworkModuleStatus", + "type": "object", + "properties": { + "networkUrl": { + "type": "string", + "description": "[Output Only] The URL of the corresponding Network resource." + } + } + }, + "NewDisk": { + "id": "NewDisk", + "type": "object", + "description": "A Persistent Disk resource that will be created and attached to each Replica in the Pool. Each Replica will have a unique persistent disk that is created and attached to that Replica.", + "properties": { + "attachment": { + "$ref": "DiskAttachment", + "description": "How the disk will be attached to the Replica." + }, + "autoDelete": { + "type": "boolean", + "description": "If true, then this disk will be deleted when the instance is deleted." + }, + "boot": { + "type": "boolean", + "description": "If true, indicates that this is the root persistent disk." + }, + "initializeParams": { + "$ref": "NewDiskInitializeParams", + "description": "Create the new disk using these parameters. The name of the disk will be \u003cinstance_name\u003e-\u003cfive_random_charactersgt;." + } + } + }, + "NewDiskInitializeParams": { + "id": "NewDiskInitializeParams", + "type": "object", + "description": "Initialization parameters for creating a new disk.", + "properties": { + "diskSizeGb": { + "type": "string", + "description": "The size of the created disk in gigabytes.", + "format": "int64" + }, + "diskType": { + "type": "string", + "description": "Name of the disk type resource describing which disk type to use to create the disk. For example 'pd-ssd' or 'pd-standard'. Default is 'pd-standard'" + }, + "sourceImage": { + "type": "string", + "description": "The fully-qualified URL of a source image to use to create this disk." + } + } + }, + "ParamOverride": { + "id": "ParamOverride", + "type": "object", + "description": "A specification for overriding parameters in a Template that corresponds to the Deployment.", + "properties": { + "path": { + "type": "string", + "description": "A JSON Path expression that specifies which parameter should be overridden." + }, + "value": { + "type": "string", + "description": "The new value to assign to the overridden parameter." + } + } + }, + "ReplicaPoolModule": { + "id": "ReplicaPoolModule", + "type": "object", + "properties": { + "envVariables": { + "type": "object", + "description": "A list of environment variables.", + "additionalProperties": { + "$ref": "EnvVariable", + "description": "Name of the environment variable. The name must conform to the following regular expression: [a-zA-Z_]+[a-zA-Z0-9_]+." + } + }, + "healthChecks": { + "type": "array", + "description": "The Health Checks to configure for the ReplicaPoolModule", + "items": { + "type": "string" + } + }, + "numReplicas": { + "type": "integer", + "description": "Number of replicas in this module.", + "format": "int32" + }, + "replicaPoolParams": { + "$ref": "ReplicaPoolParams", + "description": "Information for a ReplicaPoolModule." + }, + "resourceView": { + "type": "string", + "description": "[Output Only] The name of the Resource View associated with a ReplicaPoolModule. This field will be generated by the service." + } + } + }, + "ReplicaPoolModuleStatus": { + "id": "ReplicaPoolModuleStatus", + "type": "object", + "properties": { + "replicaPoolUrl": { + "type": "string", + "description": "[Output Only] The URL of the associated ReplicaPool resource." + }, + "resourceViewUrl": { + "type": "string", + "description": "[Output Only] The URL of the Resource Group associated with this ReplicaPool." + } + } + }, + "ReplicaPoolParams": { + "id": "ReplicaPoolParams", + "type": "object", + "description": "Configuration information for a ReplicaPools resource. Specifying an item within will determine the ReplicaPools API version used for a ReplicaPoolModule. Only one may be specified.", + "properties": { + "v1beta1": { + "$ref": "ReplicaPoolParamsV1Beta1", + "description": "ReplicaPoolParams specifications for use with ReplicaPools v1beta1." + } + } + }, + "ReplicaPoolParamsV1Beta1": { + "id": "ReplicaPoolParamsV1Beta1", + "type": "object", + "description": "Configuration information for a ReplicaPools v1beta1 API resource. Directly maps to ReplicaPool InitTemplate.", + "properties": { + "autoRestart": { + "type": "boolean", + "description": "Whether these replicas should be restarted if they experience a failure. The default value is true." + }, + "baseInstanceName": { + "type": "string", + "description": "The base name for instances within this ReplicaPool." + }, + "canIpForward": { + "type": "boolean", + "description": "Enables IP Forwarding" + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource." + }, + "disksToAttach": { + "type": "array", + "description": "A list of existing Persistent Disk resources to attach to each replica in the pool. Each disk will be attached in read-only mode to every replica.", + "items": { + "$ref": "ExistingDisk" + } + }, + "disksToCreate": { + "type": "array", + "description": "A list of Disk resources to create and attach to each Replica in the Pool. Currently, you can only define one disk and it must be a root persistent disk. Note that Replica Pool will create a root persistent disk for each replica.", + "items": { + "$ref": "NewDisk" + } + }, + "initAction": { + "type": "string", + "description": "Name of the Action to be run during initialization of a ReplicaPoolModule." + }, + "machineType": { + "type": "string", + "description": "The machine type for this instance. Either a complete URL, or the resource name (e.g. n1-standard-1)." + }, + "metadata": { + "$ref": "Metadata", + "description": "The metadata key/value pairs assigned to this instance." + }, + "networkInterfaces": { + "type": "array", + "description": "A list of network interfaces for the instance. Currently only one interface is supported by Google Compute Engine.", + "items": { + "$ref": "NetworkInterface" + } + }, + "onHostMaintenance": { + "type": "string" + }, + "serviceAccounts": { + "type": "array", + "description": "A list of Service Accounts to enable for this instance.", + "items": { + "$ref": "ServiceAccount" + } + }, + "tags": { + "$ref": "Tag", + "description": "A list of tags to apply to the Google Compute Engine instance to identify resources." + }, + "zone": { + "type": "string", + "description": "The zone for this ReplicaPool." + } + } + }, + "ServiceAccount": { + "id": "ServiceAccount", + "type": "object", + "description": "A Compute Engine service account, identical to the Compute Engine resource.", + "properties": { + "email": { + "type": "string", + "description": "Service account email address." + }, + "scopes": { + "type": "array", + "description": "List of OAuth2 scopes to obtain for the service account.", + "items": { + "type": "string" + } + } + } + }, + "Tag": { + "id": "Tag", + "type": "object", + "description": "A Compute Engine Instance tag, identical to the tags on the corresponding Compute Engine Instance resource.", + "properties": { + "fingerPrint": { + "type": "string", + "description": "The fingerprint of the tag." + }, + "items": { + "type": "array", + "description": "Items contained in this tag.", + "items": { + "type": "string" + } + } + } + }, + "Template": { + "id": "Template", + "type": "object", + "description": "A Template represents a complete configuration for a Deployment.", + "properties": { + "actions": { + "type": "object", + "description": "Action definitions for use in Module intents in this Template.", + "additionalProperties": { + "$ref": "Action", + "description": "The name of this action, used when specifying Actions in Module definitions." + } + }, + "description": { + "type": "string", + "description": "A user-supplied description of this Template." + }, + "modules": { + "type": "object", + "description": "A list of modules for this Template.", + "additionalProperties": { + "$ref": "Module", + "description": "Name of the module. The name must conform to the following regular expression: [a-zA-Z0-9-_]{1,64}" + } + }, + "name": { + "type": "string", + "description": "Name of this Template. The name must conform to the expression: [a-zA-Z0-9-_]{1,64}" + } + } + }, + "TemplatesListResponse": { + "id": "TemplatesListResponse", + "type": "object", + "properties": { + "nextPageToken": { + "type": "string" + }, + "resources": { + "type": "array", + "items": { + "$ref": "Template" + } + } + } + } + }, + "resources": { + "deployments": { + "methods": { + "delete": { + "id": "manager.deployments.delete", + "path": "{projectId}/regions/{region}/deployments/{deploymentName}", + "httpMethod": "DELETE", + "description": "", + "parameters": { + "deploymentName": { + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "required": true, + "location": "path" + }, + "region": { + "type": "string", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "region", + "deploymentName" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "get": { + "id": "manager.deployments.get", + "path": "{projectId}/regions/{region}/deployments/{deploymentName}", + "httpMethod": "GET", + "description": "", + "parameters": { + "deploymentName": { + "type": "string", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "required": true, + "location": "path" + }, + "region": { + "type": "string", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "region", + "deploymentName" + ], + "response": { + "$ref": "Deployment" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "insert": { + "id": "manager.deployments.insert", + "path": "{projectId}/regions/{region}/deployments", + "httpMethod": "POST", + "description": "", + "parameters": { + "projectId": { + "type": "string", + "required": true, + "location": "path" + }, + "region": { + "type": "string", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "region" + ], + "request": { + "$ref": "Deployment" + }, + "response": { + "$ref": "Deployment" + }, + "scopes": [ + "https://www.googleapis.com/auth/appengine.admin", + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/devstorage.read_write", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "list": { + "id": "manager.deployments.list", + "path": "{projectId}/regions/{region}/deployments", + "httpMethod": "GET", + "description": "", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned. Acceptable values are 0 to 100, inclusive. (Default: 50)", + "default": "50", + "format": "int32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request.", + "location": "query" + }, + "projectId": { + "type": "string", + "required": true, + "location": "path" + }, + "region": { + "type": "string", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "region" + ], + "response": { + "$ref": "DeploymentsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + } + } + }, + "templates": { + "methods": { + "delete": { + "id": "manager.templates.delete", + "path": "{projectId}/templates/{templateName}", + "httpMethod": "DELETE", + "description": "", + "parameters": { + "projectId": { + "type": "string", + "required": true, + "location": "path" + }, + "templateName": { + "type": "string", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "templateName" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "get": { + "id": "manager.templates.get", + "path": "{projectId}/templates/{templateName}", + "httpMethod": "GET", + "description": "", + "parameters": { + "projectId": { + "type": "string", + "required": true, + "location": "path" + }, + "templateName": { + "type": "string", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "templateName" + ], + "response": { + "$ref": "Template" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "insert": { + "id": "manager.templates.insert", + "path": "{projectId}/templates", + "httpMethod": "POST", + "description": "", + "parameters": { + "projectId": { + "type": "string", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId" + ], + "request": { + "$ref": "Template" + }, + "response": { + "$ref": "Template" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "list": { + "id": "manager.templates.list", + "path": "{projectId}/templates", + "httpMethod": "GET", + "description": "", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned. Acceptable values are 0 to 100, inclusive. (Default: 50)", + "default": "50", + "format": "int32", + "minimum": "0", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request.", + "location": "query" + }, + "projectId": { + "type": "string", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "TemplatesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/manager/v1beta2/manager-gen.go b/Godeps/_workspace/src/google.golang.org/api/manager/v1beta2/manager-gen.go new file mode 100644 index 000000000..a85931fd7 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/manager/v1beta2/manager-gen.go @@ -0,0 +1,2235 @@ +// Package manager provides access to the Deployment Manager API. +// +// See https://developers.google.com/deployment-manager/ +// +// Usage example: +// +// import "google.golang.org/api/manager/v1beta2" +// ... +// managerService, err := manager.New(oauthHttpClient) +package manager // import "google.golang.org/api/manager/v1beta2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "manager:v1beta2" +const apiName = "manager" +const apiVersion = "v1beta2" +const basePath = "https://www.googleapis.com/manager/v1beta2/projects/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your applications deployed on Google App Engine + AppengineAdminScope = "https://www.googleapis.com/auth/appengine.admin" + + // View and manage your data across Google Cloud Platform services + CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" + + // View your data across Google Cloud Platform services + CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" + + // View and manage your Google Compute Engine resources + ComputeScope = "https://www.googleapis.com/auth/compute" + + // Manage your data in Google Cloud Storage + DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write" + + // View and manage your Google Cloud Platform management resources and + // deployment status information + NdevCloudmanScope = "https://www.googleapis.com/auth/ndev.cloudman" + + // View your Google Cloud Platform management resources and deployment + // status information + NdevCloudmanReadonlyScope = "https://www.googleapis.com/auth/ndev.cloudman.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.Deployments = NewDeploymentsService(s) + s.Templates = NewTemplatesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Deployments *DeploymentsService + + Templates *TemplatesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewDeploymentsService(s *Service) *DeploymentsService { + rs := &DeploymentsService{s: s} + return rs +} + +type DeploymentsService struct { + s *Service +} + +func NewTemplatesService(s *Service) *TemplatesService { + rs := &TemplatesService{s: s} + return rs +} + +type TemplatesService struct { + s *Service +} + +// AccessConfig: A Compute Engine network accessConfig. Identical to the +// accessConfig on corresponding Compute Engine resource. +type AccessConfig struct { + // Name: Name of this access configuration. + Name string `json:"name,omitempty"` + + // NatIp: An external IP address associated with this instance. + NatIp string `json:"natIp,omitempty"` + + // Type: Type of this access configuration file. (Currently only + // ONE_TO_ONE_NAT is legal.) + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccessConfig) MarshalJSON() ([]byte, error) { + type noMethod AccessConfig + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Action: An Action encapsulates a set of commands as a single runnable +// module with additional information needed during run-time. +type Action struct { + // Commands: A list of commands to run sequentially for this action. + Commands []string `json:"commands,omitempty"` + + // TimeoutMs: The timeout in milliseconds for this action to run. + TimeoutMs int64 `json:"timeoutMs,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Commands") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Action) MarshalJSON() ([]byte, error) { + type noMethod Action + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AllowedRule: An allowed port resource. +type AllowedRule struct { + // IPProtocol: ?tcp?, ?udp? or ?icmp? + IPProtocol string `json:"IPProtocol,omitempty"` + + // Ports: List of ports or port ranges (Example inputs include: ["22"], + // [?33?, "12345-12349"]. + Ports []string `json:"ports,omitempty"` + + // ForceSendFields is a list of field names (e.g. "IPProtocol") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AllowedRule) MarshalJSON() ([]byte, error) { + type noMethod AllowedRule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AutoscalingModule struct { + CoolDownPeriodSec int64 `json:"coolDownPeriodSec,omitempty"` + + Description string `json:"description,omitempty"` + + MaxNumReplicas int64 `json:"maxNumReplicas,omitempty"` + + MinNumReplicas int64 `json:"minNumReplicas,omitempty"` + + SignalType string `json:"signalType,omitempty"` + + TargetModule string `json:"targetModule,omitempty"` + + // TargetUtilization: target_utilization should be in range [0,1]. + TargetUtilization float64 `json:"targetUtilization,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CoolDownPeriodSec") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalingModule) MarshalJSON() ([]byte, error) { + type noMethod AutoscalingModule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AutoscalingModuleStatus struct { + // AutoscalingConfigUrl: [Output Only] The URL of the corresponding + // Autoscaling configuration. + AutoscalingConfigUrl string `json:"autoscalingConfigUrl,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "AutoscalingConfigUrl") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalingModuleStatus) MarshalJSON() ([]byte, error) { + type noMethod AutoscalingModuleStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DeployState: [Output Only] The current state of a replica or module. +type DeployState struct { + // Details: [Output Only] Human readable details about the current + // state. + Details string `json:"details,omitempty"` + + // Status: [Output Only] The status of the deployment. Possible values + // include: + // - UNKNOWN + // - DEPLOYING + // - DEPLOYED + // - DEPLOYMENT_FAILED + // - DELETING + // - DELETED + // - DELETE_FAILED + Status string `json:"status,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Details") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeployState) MarshalJSON() ([]byte, error) { + type noMethod DeployState + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Deployment: A deployment represents a physical instantiation of a +// Template. +type Deployment struct { + // CreationDate: [Output Only] The time when this deployment was + // created. + CreationDate string `json:"creationDate,omitempty"` + + // Description: A user-supplied description of this Deployment. + Description string `json:"description,omitempty"` + + // Modules: [Output Only] List of status for the modules in this + // deployment. + Modules map[string]ModuleStatus `json:"modules,omitempty"` + + // Name: Name of this deployment. The name must conform to the following + // regular expression: [a-zA-Z0-9-_]{1,64} + Name string `json:"name,omitempty"` + + // Overrides: The set of parameter overrides to apply to the + // corresponding Template before deploying. + Overrides []*ParamOverride `json:"overrides,omitempty"` + + // State: [Output Only] Current status of this deployment. + State *DeployState `json:"state,omitempty"` + + // TemplateName: The name of the Template on which this deployment is + // based. + TemplateName string `json:"templateName,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationDate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Deployment) MarshalJSON() ([]byte, error) { + type noMethod Deployment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type DeploymentsListResponse struct { + NextPageToken string `json:"nextPageToken,omitempty"` + + Resources []*Deployment `json:"resources,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeploymentsListResponse) MarshalJSON() ([]byte, error) { + type noMethod DeploymentsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DiskAttachment: How to attach a disk to a Replica. +type DiskAttachment struct { + // DeviceName: The device name of this disk. + 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, this is assigned by the server. + Index int64 `json:"index,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DeviceName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DiskAttachment) MarshalJSON() ([]byte, error) { + type noMethod DiskAttachment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EnvVariable: An environment variable. +type EnvVariable struct { + // Hidden: Whether this variable is hidden or visible. + Hidden bool `json:"hidden,omitempty"` + + // Value: Value of the environment variable. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Hidden") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EnvVariable) MarshalJSON() ([]byte, error) { + type noMethod EnvVariable + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ExistingDisk: A pre-existing persistent disk that will be attached to +// every Replica in the Pool. +type ExistingDisk struct { + // Attachment: Optional. How the disk will be attached to the Replica. + Attachment *DiskAttachment `json:"attachment,omitempty"` + + // Source: The fully-qualified URL of the Persistent Disk resource. It + // must be in the same zone as the Pool. + Source string `json:"source,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Attachment") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ExistingDisk) MarshalJSON() ([]byte, error) { + type noMethod ExistingDisk + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FirewallModule: A Firewall resource +type FirewallModule struct { + // Allowed: The allowed ports or port ranges. + Allowed []*AllowedRule `json:"allowed,omitempty"` + + // Description: The description of the firewall (optional) + Description string `json:"description,omitempty"` + + // Network: The NetworkModule to which this firewall should apply. If + // not specified, or if specified as 'default', this firewall will be + // applied to the 'default' network. + Network string `json:"network,omitempty"` + + // SourceRanges: Source IP ranges to apply this firewall to, see the GCE + // Spec for details on syntax + SourceRanges []string `json:"sourceRanges,omitempty"` + + // SourceTags: Source Tags to apply this firewall to, see the GCE Spec + // for details on syntax + SourceTags []string `json:"sourceTags,omitempty"` + + // TargetTags: Target Tags to apply this firewall to, see the GCE Spec + // for details on syntax + TargetTags []string `json:"targetTags,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Allowed") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FirewallModule) MarshalJSON() ([]byte, error) { + type noMethod FirewallModule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type FirewallModuleStatus struct { + // FirewallUrl: [Output Only] The URL of the corresponding Firewall + // resource. + FirewallUrl string `json:"firewallUrl,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FirewallUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FirewallModuleStatus) MarshalJSON() ([]byte, error) { + type noMethod FirewallModuleStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type HealthCheckModule struct { + CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"` + + Description string `json:"description,omitempty"` + + HealthyThreshold int64 `json:"healthyThreshold,omitempty"` + + Host string `json:"host,omitempty"` + + Path string `json:"path,omitempty"` + + Port int64 `json:"port,omitempty"` + + TimeoutSec int64 `json:"timeoutSec,omitempty"` + + UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HealthCheckModule) MarshalJSON() ([]byte, error) { + type noMethod HealthCheckModule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type HealthCheckModuleStatus struct { + // HealthCheckUrl: [Output Only] The HealthCheck URL. + HealthCheckUrl string `json:"healthCheckUrl,omitempty"` + + // ForceSendFields is a list of field names (e.g. "HealthCheckUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HealthCheckModuleStatus) MarshalJSON() ([]byte, error) { + type noMethod HealthCheckModuleStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type LbModule struct { + Description string `json:"description,omitempty"` + + HealthChecks []string `json:"healthChecks,omitempty"` + + IpAddress string `json:"ipAddress,omitempty"` + + IpProtocol string `json:"ipProtocol,omitempty"` + + PortRange string `json:"portRange,omitempty"` + + SessionAffinity string `json:"sessionAffinity,omitempty"` + + TargetModules []string `json:"targetModules,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LbModule) MarshalJSON() ([]byte, error) { + type noMethod LbModule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type LbModuleStatus struct { + // ForwardingRuleUrl: [Output Only] The URL of the corresponding + // ForwardingRule in GCE. + ForwardingRuleUrl string `json:"forwardingRuleUrl,omitempty"` + + // TargetPoolUrl: [Output Only] The URL of the corresponding TargetPool + // resource in GCE. + TargetPoolUrl string `json:"targetPoolUrl,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ForwardingRuleUrl") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LbModuleStatus) MarshalJSON() ([]byte, error) { + type noMethod LbModuleStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Metadata: A Compute Engine metadata entry. Identical to the metadata +// on the corresponding Compute Engine resource. +type Metadata struct { + // FingerPrint: The fingerprint of the metadata. + FingerPrint string `json:"fingerPrint,omitempty"` + + // Items: A list of metadata items. + Items []*MetadataItem `json:"items,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FingerPrint") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Metadata) MarshalJSON() ([]byte, error) { + type noMethod Metadata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MetadataItem: A Compute Engine metadata item, defined as a key:value +// pair. Identical to the metadata on the corresponding Compute Engine +// resource. +type MetadataItem struct { + // Key: A metadata key. + Key string `json:"key,omitempty"` + + // Value: A metadata value. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MetadataItem) MarshalJSON() ([]byte, error) { + type noMethod MetadataItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Module: A module in a configuration. A module represents a single +// homogeneous, possibly replicated task. +type Module struct { + AutoscalingModule *AutoscalingModule `json:"autoscalingModule,omitempty"` + + FirewallModule *FirewallModule `json:"firewallModule,omitempty"` + + HealthCheckModule *HealthCheckModule `json:"healthCheckModule,omitempty"` + + LbModule *LbModule `json:"lbModule,omitempty"` + + NetworkModule *NetworkModule `json:"networkModule,omitempty"` + + ReplicaPoolModule *ReplicaPoolModule `json:"replicaPoolModule,omitempty"` + + // Type: The type of this module. Valid values ("AUTOSCALING", + // "FIREWALL", "HEALTH_CHECK", "LOAD_BALANCING", "NETWORK", + // "REPLICA_POOL") + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AutoscalingModule") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Module) MarshalJSON() ([]byte, error) { + type noMethod Module + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ModuleStatus: [Output Only] Aggregate status for a module. +type ModuleStatus struct { + // AutoscalingModuleStatus: [Output Only] The status of the + // AutoscalingModule, set for type AUTOSCALING. + AutoscalingModuleStatus *AutoscalingModuleStatus `json:"autoscalingModuleStatus,omitempty"` + + // FirewallModuleStatus: [Output Only] The status of the FirewallModule, + // set for type FIREWALL. + FirewallModuleStatus *FirewallModuleStatus `json:"firewallModuleStatus,omitempty"` + + // HealthCheckModuleStatus: [Output Only] The status of the + // HealthCheckModule, set for type HEALTH_CHECK. + HealthCheckModuleStatus *HealthCheckModuleStatus `json:"healthCheckModuleStatus,omitempty"` + + // LbModuleStatus: [Output Only] The status of the LbModule, set for + // type LOAD_BALANCING. + LbModuleStatus *LbModuleStatus `json:"lbModuleStatus,omitempty"` + + // NetworkModuleStatus: [Output Only] The status of the NetworkModule, + // set for type NETWORK. + NetworkModuleStatus *NetworkModuleStatus `json:"networkModuleStatus,omitempty"` + + // ReplicaPoolModuleStatus: [Output Only] The status of the + // ReplicaPoolModule, set for type VM. + ReplicaPoolModuleStatus *ReplicaPoolModuleStatus `json:"replicaPoolModuleStatus,omitempty"` + + // State: [Output Only] The current state of the module. + State *DeployState `json:"state,omitempty"` + + // Type: [Output Only] The type of the module. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "AutoscalingModuleStatus") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ModuleStatus) MarshalJSON() ([]byte, error) { + type noMethod ModuleStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// NetworkInterface: A Compute Engine NetworkInterface resource. +// Identical to the NetworkInterface on the corresponding Compute Engine +// resource. +type NetworkInterface struct { + // AccessConfigs: An array of configurations for this interface. This + // specifies how this interface is configured to interact with other + // network services + AccessConfigs []*AccessConfig `json:"accessConfigs,omitempty"` + + // Name: Name of the interface. + Name string `json:"name,omitempty"` + + // Network: The name of the NetworkModule to which this interface + // applies. If not specified, or specified as 'default', this will use + // the 'default' network. + Network string `json:"network,omitempty"` + + // NetworkIp: An optional IPV4 internal network address to assign to the + // instance for this network interface. + NetworkIp string `json:"networkIp,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AccessConfigs") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *NetworkInterface) MarshalJSON() ([]byte, error) { + type noMethod NetworkInterface + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type NetworkModule 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. + IPv4Range string `json:"IPv4Range,omitempty"` + + // Description: The description of the network. + 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 typicall 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"` + + // ForceSendFields is a list of field names (e.g. "IPv4Range") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *NetworkModule) MarshalJSON() ([]byte, error) { + type noMethod NetworkModule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type NetworkModuleStatus struct { + // NetworkUrl: [Output Only] The URL of the corresponding Network + // resource. + NetworkUrl string `json:"networkUrl,omitempty"` + + // ForceSendFields is a list of field names (e.g. "NetworkUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *NetworkModuleStatus) MarshalJSON() ([]byte, error) { + type noMethod NetworkModuleStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// NewDisk: A Persistent Disk resource that will be created and attached +// to each Replica in the Pool. Each Replica will have a unique +// persistent disk that is created and attached to that Replica. +type NewDisk struct { + // Attachment: How the disk will be attached to the Replica. + Attachment *DiskAttachment `json:"attachment,omitempty"` + + // AutoDelete: If true, then this disk will be deleted when the instance + // is deleted. + AutoDelete bool `json:"autoDelete,omitempty"` + + // Boot: If true, indicates that this is the root persistent disk. + Boot bool `json:"boot,omitempty"` + + // InitializeParams: Create the new disk using these parameters. The + // name of the disk will be -" + // ">=" + // "contains" + // "endsWith" + // "startsWith" + Operator string `json:"operator,omitempty"` + + // Value: Value to be evaluated against attribute. + Value interface{} `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Column") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Filter) MarshalJSON() ([]byte, error) { + type noMethod Filter + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GeoJsonGeometry map[string]interface{} + +func (t GeoJsonGeometry) Type() string { + return googleapi.VariantType(t) +} + +func (t GeoJsonGeometry) GeometryCollection() (r GeoJsonGeometryCollection, ok bool) { + if t.Type() != "GeometryCollection" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +func (t GeoJsonGeometry) LineString() (r GeoJsonLineString, ok bool) { + if t.Type() != "LineString" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +func (t GeoJsonGeometry) MultiLineString() (r GeoJsonMultiLineString, ok bool) { + if t.Type() != "MultiLineString" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +func (t GeoJsonGeometry) MultiPoint() (r GeoJsonMultiPoint, ok bool) { + if t.Type() != "MultiPoint" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +func (t GeoJsonGeometry) MultiPolygon() (r GeoJsonMultiPolygon, ok bool) { + if t.Type() != "MultiPolygon" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +func (t GeoJsonGeometry) Point() (r GeoJsonPoint, ok bool) { + if t.Type() != "Point" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +func (t GeoJsonGeometry) Polygon() (r GeoJsonPolygon, ok bool) { + if t.Type() != "Polygon" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +// GeoJsonGeometryCollection: A heterogenous collection of +// GeoJsonGeometry objects. +type GeoJsonGeometryCollection struct { + // Geometries: An array of geometry objects. There must be at least 2 + // different types of geometries in the array. + Geometries []GeoJsonGeometry `json:"geometries,omitempty"` + + // Type: Identifies this object as a GeoJsonGeometryCollection. + // + // Possible values: + // "GeometryCollection" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Geometries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoJsonGeometryCollection) MarshalJSON() ([]byte, error) { + type noMethod GeoJsonGeometryCollection + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GeoJsonLineString struct { + // Coordinates: An array of two or more positions, representing a line. + Coordinates [][]float64 `json:"coordinates,omitempty"` + + // Type: Identifies this object as a GeoJsonLineString. + // + // Possible values: + // "LineString" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Coordinates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoJsonLineString) MarshalJSON() ([]byte, error) { + type noMethod GeoJsonLineString + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GeoJsonMultiLineString: Multi Line String +type GeoJsonMultiLineString struct { + // Coordinates: An array of at least two GeoJsonLineString coordinate + // arrays. + Coordinates [][][]float64 `json:"coordinates,omitempty"` + + // Type: Identifies this object as a GeoJsonMultiLineString. + // + // Possible values: + // "MultiLineString" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Coordinates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoJsonMultiLineString) MarshalJSON() ([]byte, error) { + type noMethod GeoJsonMultiLineString + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GeoJsonMultiPoint struct { + // Coordinates: An array of at least two GeoJsonPoint coordinate arrays. + Coordinates [][]float64 `json:"coordinates,omitempty"` + + // Type: Identifies this object as a GeoJsonMultiPoint. + // + // Possible values: + // "MultiPoint" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Coordinates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoJsonMultiPoint) MarshalJSON() ([]byte, error) { + type noMethod GeoJsonMultiPoint + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GeoJsonMultiPolygon struct { + // Coordinates: An array of at least two GeoJsonPolygon coordinate + // arrays. + Coordinates [][][][]float64 `json:"coordinates,omitempty"` + + // Type: Identifies this object as a GeoJsonMultiPolygon. + // + // Possible values: + // "MultiPolygon" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Coordinates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoJsonMultiPolygon) MarshalJSON() ([]byte, error) { + type noMethod GeoJsonMultiPolygon + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GeoJsonPoint struct { + // Coordinates: A single GeoJsonPosition, specifying the location of the + // point. + Coordinates []float64 `json:"coordinates,omitempty"` + + // Type: Identifies this object as a GeoJsonPoint. + // + // Possible values: + // "Point" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Coordinates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoJsonPoint) MarshalJSON() ([]byte, error) { + type noMethod GeoJsonPoint + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GeoJsonPolygon struct { + // Coordinates: An array of LinearRings. A LinearRing is a + // GeoJsonLineString which is closed (that is, the first and last + // GeoJsonPositions are equal), and which contains at least four + // GeoJsonPositions. For polygons with multiple rings, the first + // LinearRing is the exterior ring, and any subsequent rings are + // interior rings (that is, holes). + Coordinates [][][]float64 `json:"coordinates,omitempty"` + + // Type: Identifies this object as a GeoJsonPolygon. + // + // Possible values: + // "Polygon" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Coordinates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoJsonPolygon) MarshalJSON() ([]byte, error) { + type noMethod GeoJsonPolygon + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GeoJsonProperties interface{} + +// Icon: An icon is a user-uploaded image that can be used to style +// point geometries. +type Icon struct { + // Description: The description of this Icon, supplied by the author. + Description string `json:"description,omitempty"` + + // Id: An ID used to refer to this Icon. + Id string `json:"id,omitempty"` + + // Name: The name of this Icon, supplied by the author. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Icon) MarshalJSON() ([]byte, error) { + type noMethod Icon + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// IconStyle: Style for icon, this is part of point style. +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"` + + // ScaledShape: A scalable shape. + ScaledShape *ScaledShape `json:"scaledShape,omitempty"` + + // ScalingFunction: The function used to scale shapes. Required when a + // scaledShape is specified. + ScalingFunction *ScalingFunction `json:"scalingFunction,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *IconStyle) MarshalJSON() ([]byte, error) { + type noMethod IconStyle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// IconsListResponse: The response returned by a call to icons.List. +type IconsListResponse struct { + // Icons: Resources returned. + Icons []*Icon `json:"icons,omitempty"` + + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Icons") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *IconsListResponse) MarshalJSON() ([]byte, error) { + type noMethod IconsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LabelStyle: Text label style. +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'. + // + // Possible values: + // "italic" + // "normal" + FontStyle string `json:"fontStyle,omitempty"` + + // FontWeight: Font weight of the label, defaults to 'normal'. + // + // Possible values: + // "bold" + // "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"` + + // ForceSendFields is a list of field names (e.g. "Color") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LabelStyle) MarshalJSON() ([]byte, error) { + type noMethod LabelStyle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Layer: A Layer combines multiple datasources, with styling +// information, for presentation on a map. +type Layer struct { + // Bbox: A rectangular bounding box which contains all of the data in + // this Layer. The box is expressed as \"west, south, east, north\". The + // numbers represent latitude and longitude 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"` + + // CreatorEmail: The email address of the creator of this layer. This is + // only returned on GET requests and not LIST requests. + CreatorEmail string `json:"creatorEmail,omitempty"` + + // DatasourceType: Deprecated: The type of the datasources used to build + // this Layer. Note: This has been replaced by layerType, but is still + // available for now to maintain backward compatibility. + // + // Possible values: + // "image" + // "table" + DatasourceType string `json:"datasourceType,omitempty"` + + // Datasources: An array of datasources used to build this layer. If + // layerType is "image", or layerType is not specified and + // datasourceType is "image", then each element in this array is a + // reference to an Image or RasterCollection. If layerType is "vector", + // or layerType is not specified and datasourceType is "table" then each + // element in this array is a reference to a Vector Table. Note: + // Datasources are returned in response to a get request but not a list + // request. After requesting a list of layers, you'll need to send a get + // request to retrieve the datasources for each layer. + Datasources []*Datasource `json:"datasources,omitempty"` + + // Description: The description of this Layer, supplied by the author. + Description string `json:"description,omitempty"` + + // DraftAccessList: Deprecated: 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. Note: Google Maps Engine no longer + // uses access lists. Instead, each asset has its own list of + // permissions. For backward compatibility, the API still accepts access + // lists for projects that are already using access lists. If you + // created a GME account/project after July 14th, 2014, you will not be + // able to send API requests that include access lists. Note: This is an + // input field only. It is not returned in response to a list or get + // request. + DraftAccessList string `json:"draftAccessList,omitempty"` + + // Etag: The ETag, used to refer to the current version of the asset. + Etag string `json:"etag,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"` + + // LastModifierEmail: The email address of the last modifier of this + // layer. This is only returned on GET requests and not LIST requests. + LastModifierEmail string `json:"lastModifierEmail,omitempty"` + + // LayerType: The type of the datasources used to build this Layer. This + // should be used instead of datasourceType. At least one of layerType + // and datasourceType and must be specified, but layerType takes + // precedence. + // + // Possible values: + // "image" + // "vector" + LayerType string `json:"layerType,omitempty"` + + // Name: The name of this Layer, supplied by the author. + Name string `json:"name,omitempty"` + + // ProcessingStatus: The processing status of this layer. + // + // Possible values: + // "complete" + // "failed" + // "notReady" + // "processing" + // "ready" + ProcessingStatus string `json:"processingStatus,omitempty"` + + // ProjectId: The ID of the project that this Layer is in. + ProjectId string `json:"projectId,omitempty"` + + // PublishedAccessList: Deprecated: 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. Note: Google Maps Engine no longer uses access lists. + // Instead, each asset has its own list of permissions. For backward + // compatibility, the API still accepts access lists for projects that + // are already using access lists. If you created a GME account/project + // after July 14th, 2014, you will not be able to send API requests that + // include access lists. Note: This is an input field only. It is not + // returned in response to a list or get request. + PublishedAccessList string `json:"publishedAccessList,omitempty"` + + // PublishingStatus: The publishing status of this layer. + // + // Possible values: + // "notPublished" + // "published" + PublishingStatus string `json:"publishingStatus,omitempty"` + + // Style: The styling information for a vector layer. Note: Style + // information is returned in response to a get request but not a list + // request. After requesting a list of layers, you'll need to send a get + // request to retrieve the VectorStyles for each layer. + Style *VectorStyle `json:"style,omitempty"` + + // Tags: Tags of this Layer. + Tags []string `json:"tags,omitempty"` + + // WritersCanEditPermissions: If true, WRITERs of the asset are able to + // edit the asset permissions. + WritersCanEditPermissions bool `json:"writersCanEditPermissions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Bbox") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Layer) MarshalJSON() ([]byte, error) { + type noMethod Layer + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LayersListResponse: The response returned by a call to layers.List. +// Note: The list response does not include all the fields available in +// a layer. Refer to the layer resource description for details of the +// fields that are not included. You'll need to send a get request to +// retrieve the additional fields for each layer. +type LayersListResponse struct { + // Layers: Resources returned. + Layers []*Layer `json:"layers,omitempty"` + + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Layers") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LayersListResponse) MarshalJSON() ([]byte, error) { + type noMethod LayersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LineStyle: Style for lines. +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"` + + // ForceSendFields is a list of field names (e.g. "Border") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LineStyle) MarshalJSON() ([]byte, error) { + type noMethod LineStyle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LineStyleStroke: Stroke of the line. +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"` + + // ForceSendFields is a list of field names (e.g. "Color") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LineStyleStroke) MarshalJSON() ([]byte, error) { + type noMethod LineStyleStroke + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Map: A Map is a collection of Layers, optionally contained within +// folders. +type Map struct { + // Bbox: A rectangular bounding box which contains all of the data in + // this Map. The box is expressed as \"west, south, east, north\". 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"` + + // CreatorEmail: The email address of the creator of this map. This is + // only returned on GET requests and not LIST requests. + CreatorEmail string `json:"creatorEmail,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"` + + // DraftAccessList: Deprecated: 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. Note: Google Maps Engine no longer + // uses access lists. Instead, each asset has its own list of + // permissions. For backward compatibility, the API still accepts access + // lists for projects that are already using access lists. If you + // created a GME account/project after July 14th, 2014, you will not be + // able to send API requests that include access lists. Note: This is an + // input field only. It is not returned in response to a list or get + // request. + DraftAccessList string `json:"draftAccessList,omitempty"` + + // Etag: The ETag, used to refer to the current version of the asset. + Etag string `json:"etag,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"` + + // LastModifierEmail: The email address of the last modifier of this + // map. This is only returned on GET requests and not LIST requests. + LastModifierEmail string `json:"lastModifierEmail,omitempty"` + + // Name: The name of this Map, supplied by the author. + Name string `json:"name,omitempty"` + + // ProcessingStatus: The processing status of this map. Map processing + // is automatically started once a map becomes ready for processing. + // + // Possible values: + // "complete" + // "failed" + // "notReady" + // "processing" + // "ready" + ProcessingStatus string `json:"processingStatus,omitempty"` + + // ProjectId: The ID of the project that this Map is in. + ProjectId string `json:"projectId,omitempty"` + + // PublishedAccessList: Deprecated: 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. Note: Google Maps Engine no longer uses access lists. + // Instead, each asset has its own list of permissions. For backward + // compatibility, the API still accepts access lists for projects that + // are already using access lists. If you created a GME account/project + // after July 14th, 2014, you will not be able to send API requests that + // include access lists. This is an input field only. It is not returned + // in response to a list or get request. + PublishedAccessList string `json:"publishedAccessList,omitempty"` + + // PublishingStatus: The publishing status of this map. + // + // Possible values: + // "notPublished" + // "published" + PublishingStatus string `json:"publishingStatus,omitempty"` + + // Tags: Tags of this Map. + Tags []string `json:"tags,omitempty"` + + // Versions: Deprecated: An array containing the available versions of + // this Map. Currently may only contain "published". The + // publishingStatus field should be used instead. + Versions []string `json:"versions,omitempty"` + + // WritersCanEditPermissions: If true, WRITERs of the asset are able to + // edit the asset permissions. + WritersCanEditPermissions bool `json:"writersCanEditPermissions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Bbox") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Map) MarshalJSON() ([]byte, error) { + type noMethod Map + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type MapFolder struct { + 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"` + + // Expandable: The expandability setting of this MapFolder. If true, the + // folder can be expanded. + Expandable bool `json:"expandable,omitempty"` + + // Key: A user defined alias for this MapFolder, specific to this Map. + Key string `json:"key,omitempty"` + + // Name: The name of this MapFolder. + Name string `json:"name,omitempty"` + + // Type: Identifies this object as a MapFolder. + // + // Possible values: + // "folder" + Type string `json:"type,omitempty"` + + // Visibility: The visibility setting of this MapFolder. One of + // "defaultOn" or "defaultOff". + Visibility string `json:"visibility,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Contents") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MapFolder) MarshalJSON() ([]byte, error) { + type noMethod MapFolder + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type MapItem map[string]interface{} + +func (t MapItem) Type() string { + return googleapi.VariantType(t) +} + +func (t MapItem) Folder() (r MapFolder, ok bool) { + if t.Type() != "Folder" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +func (t MapItem) KmlLink() (r MapKmlLink, ok bool) { + if t.Type() != "KmlLink" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +func (t MapItem) Layer() (r MapLayer, ok bool) { + if t.Type() != "Layer" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +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 MapKmlLink. + KmlUrl string `json:"kmlUrl,omitempty"` + + // Name: The name of this MapKmlLink. + Name string `json:"name,omitempty"` + + // Type: Identifies this object as a MapKmlLink. + // + // Possible values: + // "kmlLink" + Type string `json:"type,omitempty"` + + // Visibility: The visibility setting of this MapKmlLink. One of + // "defaultOn" or "defaultOff". + Visibility string `json:"visibility,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DefaultViewport") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MapKmlLink) MarshalJSON() ([]byte, error) { + type noMethod MapKmlLink + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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 MapLayer. This ID can be used to request more + // details about the layer. + Id string `json:"id,omitempty"` + + // Key: A user defined alias for this MapLayer, specific to this Map. + Key string `json:"key,omitempty"` + + // Name: The name of this MapLayer. + Name string `json:"name,omitempty"` + + // Type: Identifies this object as a MapLayer. + // + // Possible values: + // "layer" + Type string `json:"type,omitempty"` + + // Visibility: The visibility setting of this MapLayer. One of + // "defaultOn" or "defaultOff". + Visibility string `json:"visibility,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DefaultViewport") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MapLayer) MarshalJSON() ([]byte, error) { + type noMethod MapLayer + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MapsListResponse: The response returned by a call to maps.List. +type MapsListResponse struct { + // Maps: Resources returned. + Maps []*Map `json:"maps,omitempty"` + + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Maps") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MapsListResponse) MarshalJSON() ([]byte, error) { + type noMethod MapsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Parent: A list of the parents of an asset. +type Parent struct { + // Id: The ID of this parent. + Id string `json:"id,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Parent) MarshalJSON() ([]byte, error) { + type noMethod Parent + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ParentsListResponse: The response returned by a call to parents.List. +type ParentsListResponse struct { + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Parents: The parent assets. + Parents []*Parent `json:"parents,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ParentsListResponse) MarshalJSON() ([]byte, error) { + type noMethod ParentsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Permission: A permission defines the user or group that has access to +// an asset, and the type of access they have. +type Permission struct { + // Discoverable: Indicates whether a public asset is listed and can be + // found via a web search (value true), or is visible only to people who + // have a link to the asset (value false). + Discoverable bool `json:"discoverable,omitempty"` + + // Id: The unique identifier of the permission. This could be the email + // address of the user or group this permission refers to, or the string + // "anyone" for public permissions. + Id string `json:"id,omitempty"` + + // Role: The type of access granted to this user or group. + // + // Possible values: + // "owner" + // "reader" + // "viewer" + // "writer" + Role string `json:"role,omitempty"` + + // Type: The account type. + // + // Possible values: + // "anyone" + // "group" + // "user" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Discoverable") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Permission) MarshalJSON() ([]byte, error) { + type noMethod Permission + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PermissionsBatchDeleteRequest: The request sent to +// mapsengine.permissions.batchDelete. +type PermissionsBatchDeleteRequest struct { + // Ids: An array of permission ids to be removed. This could be the + // email address of the user or group this permission refers to, or the + // string "anyone" for public permissions. + Ids []string `json:"ids,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Ids") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PermissionsBatchDeleteRequest) MarshalJSON() ([]byte, error) { + type noMethod PermissionsBatchDeleteRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PermissionsBatchDeleteResponse: The response returned by a call to +// mapsengine.permissions.batchDelete. +type PermissionsBatchDeleteResponse struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// PermissionsBatchUpdateRequest: The request sent to +// mapsengine.permissions.batchUpdate. +type PermissionsBatchUpdateRequest struct { + // Permissions: The permissions to be inserted or updated. + Permissions []*Permission `json:"permissions,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Permissions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PermissionsBatchUpdateRequest) MarshalJSON() ([]byte, error) { + type noMethod PermissionsBatchUpdateRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PermissionsBatchUpdateResponse: The response returned by a call to +// mapsengine.permissions.batchUpdate. +type PermissionsBatchUpdateResponse struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +type PermissionsListResponse struct { + // Permissions: The set of permissions associated with this asset. + Permissions []*Permission `json:"permissions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Permissions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PermissionsListResponse) MarshalJSON() ([]byte, error) { + type noMethod PermissionsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PointStyle: Style for points. +type PointStyle struct { + // Icon: Icon for the point; if it isn't null, exactly one of 'name', + // 'id' or 'scaledShape' must be set. + Icon *IconStyle `json:"icon,omitempty"` + + // Label: Label style for the point. + Label *LabelStyle `json:"label,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Icon") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PointStyle) MarshalJSON() ([]byte, error) { + type noMethod PointStyle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PolygonStyle: Style for polygons. +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"` + + // Label: Label style for the polygon. + Label *LabelStyle `json:"label,omitempty"` + + // Stroke: Border of the polygon. 0 < border.width <= 10. + Stroke *Border `json:"stroke,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Fill") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PolygonStyle) MarshalJSON() ([]byte, error) { + type noMethod PolygonStyle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ProcessResponse: The response returned by a call to any asset's +// Process method. +type ProcessResponse struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// Project: A project groups a collection of resources. +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Project) MarshalJSON() ([]byte, error) { + type noMethod Project + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ProjectsListResponse: The response returned by a call to +// projects.List. +type ProjectsListResponse struct { + // Projects: Projects returned. + Projects []*Project `json:"projects,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Projects") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProjectsListResponse) MarshalJSON() ([]byte, error) { + type noMethod ProjectsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PublishResponse: The response returned by a call to any asset's +// Publish method. +type PublishResponse struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// PublishedLayer: The published version of a layer. +type PublishedLayer struct { + // Description: The description of this Layer, supplied by the author. + Description string `json:"description,omitempty"` + + // Id: A globally unique ID, used to refer to this Layer. + Id string `json:"id,omitempty"` + + // LayerType: The type of the datasources used to build this Layer. This + // should be used instead of datasourceType. At least one of layerType + // and datasourceType and must be specified, but layerType takes + // precedence. + // + // Possible values: + // "image" + // "vector" + LayerType string `json:"layerType,omitempty"` + + // Name: The name of this Layer, supplied by the author. + Name string `json:"name,omitempty"` + + // ProjectId: The ID of the project that this Layer is in. + ProjectId string `json:"projectId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PublishedLayer) MarshalJSON() ([]byte, error) { + type noMethod PublishedLayer + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PublishedLayersListResponse: The response returned by a call to +// layers.List.published. +type PublishedLayersListResponse struct { + // Layers: Resources returned. + Layers []*PublishedLayer `json:"layers,omitempty"` + + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Layers") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PublishedLayersListResponse) MarshalJSON() ([]byte, error) { + type noMethod PublishedLayersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PublishedMap: The published version of a map asset. +type PublishedMap struct { + // Contents: The contents of this Map. + 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"` + + // 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"` + + // 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Contents") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PublishedMap) MarshalJSON() ([]byte, error) { + type noMethod PublishedMap + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PublishedMapsListResponse: The response returned by a call to +// maps.List.published. +type PublishedMapsListResponse struct { + // Maps: Resources returned. + Maps []*PublishedMap `json:"maps,omitempty"` + + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Maps") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PublishedMapsListResponse) MarshalJSON() ([]byte, error) { + type noMethod PublishedMapsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Raster: A geo-referenced raster. +type Raster 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: A rectangular bounding box which contains all of the data in + // this Raster. The box is expressed as \"west, south, east, north\". + // 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"` + + // CreatorEmail: The email address of the creator of this raster. This + // is only returned on GET requests and not LIST requests. + CreatorEmail string `json:"creatorEmail,omitempty"` + + // Description: The description of this Raster, supplied by the author. + Description string `json:"description,omitempty"` + + // DraftAccessList: Deprecated: 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. Note: Google Maps Engine no longer + // uses access lists. Instead, each asset has its own list of + // permissions. For backward compatibility, the API still accepts access + // lists for projects that are already using access lists. If you + // created a GME account/project after July 14th, 2014, you will not be + // able to send API requests that include access lists. Note: This is an + // input field only. It is not returned in response to a list or get + // request. + DraftAccessList string `json:"draftAccessList,omitempty"` + + // Etag: The ETag, used to refer to the current version of the asset. + Etag string `json:"etag,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"` + + // LastModifierEmail: The email address of the last modifier of this + // raster. This is only returned on GET requests and not LIST requests. + LastModifierEmail string `json:"lastModifierEmail,omitempty"` + + // MaskType: The mask processing type of this Raster. + 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. + // + // Possible values: + // "complete" + // "failed" + // "notReady" + // "processing" + // "ready" + 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. + // + // Possible values: + // "image" + RasterType string `json:"rasterType,omitempty"` + + // Tags: Tags of this Raster. + Tags []string `json:"tags,omitempty"` + + // WritersCanEditPermissions: If true, WRITERs of the asset are able to + // edit the asset permissions. + WritersCanEditPermissions bool `json:"writersCanEditPermissions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AcquisitionTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Raster) MarshalJSON() ([]byte, error) { + type noMethod Raster + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RasterCollection: A raster collection groups multiple Raster +// resources for inclusion in a Layer. +type RasterCollection struct { + // Attribution: The name of the attribution to be used for this + // RasterCollection. Note: Attribution is returned in response to a get + // request but not a list request. After requesting a list of raster + // collections, you'll need to send a get request to retrieve the + // attribution for each raster collection. + Attribution string `json:"attribution,omitempty"` + + // Bbox: A rectangular bounding box which contains all of the data in + // this RasterCollection. The box is expressed as \"west, south, east, + // north\". The numbers represent latitude and longitude 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"` + + // CreatorEmail: The email address of the creator of this raster + // collection. This is only returned on GET requests and not LIST + // requests. + CreatorEmail string `json:"creatorEmail,omitempty"` + + // Description: The description of this RasterCollection, supplied by + // the author. + Description string `json:"description,omitempty"` + + // DraftAccessList: Deprecated: 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. Note: Google Maps Engine no longer + // uses access lists. Instead, each asset has its own list of + // permissions. For backward compatibility, the API still accepts access + // lists for projects that are already using access lists. If you + // created a GME account/project after July 14th, 2014, you will not be + // able to send API requests that include access lists. Note: This is an + // input field only. It is not returned in response to a list or get + // request. + DraftAccessList string `json:"draftAccessList,omitempty"` + + // Etag: The ETag, used to refer to the current version of the asset. + Etag string `json:"etag,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"` + + // LastModifierEmail: The email address of the last modifier of this + // raster collection. This is only returned on GET requests and not LIST + // requests. + LastModifierEmail string `json:"lastModifierEmail,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"` + + // ProcessingStatus: The processing status of this RasterCollection. + // + // Possible values: + // "complete" + // "failed" + // "notReady" + // "processing" + // "ready" + ProcessingStatus string `json:"processingStatus,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. + // + // Possible values: + // "image" + RasterType string `json:"rasterType,omitempty"` + + // Tags: Tags of this RasterCollection. + Tags []string `json:"tags,omitempty"` + + // WritersCanEditPermissions: If true, WRITERs of the asset are able to + // edit the asset permissions. + WritersCanEditPermissions bool `json:"writersCanEditPermissions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Attribution") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RasterCollection) MarshalJSON() ([]byte, error) { + type noMethod RasterCollection + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RasterCollectionsListResponse: The response returned by a call to +// raster_collections.List. Note: The list response does not include all +// the fields available in a raster collection. Refer to the +// RasterCollection resource description for details of the fields that +// are not included. You'll need to send a get request to retrieve the +// additional fields for each raster collection. +type RasterCollectionsListResponse struct { + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // RasterCollections: Resources returned. + RasterCollections []*RasterCollection `json:"rasterCollections,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RasterCollectionsListResponse) MarshalJSON() ([]byte, error) { + type noMethod RasterCollectionsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RasterCollectionsRaster: A raster resource. +type RasterCollectionsRaster struct { + // Bbox: A rectangular bounding box which contains all of the data in + // this Raster. The box is expressed as \"west, south, east, north\". + // 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"` + + // ForceSendFields is a list of field names (e.g. "Bbox") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RasterCollectionsRaster) MarshalJSON() ([]byte, error) { + type noMethod RasterCollectionsRaster + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RasterCollectionsRasterBatchDeleteRequest: The request sent to +// rasterCollections.Rasters.BatchDelete. +type RasterCollectionsRasterBatchDeleteRequest struct { + // Ids: An array of Raster asset IDs to be removed from this + // RasterCollection. + Ids []string `json:"ids,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Ids") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RasterCollectionsRasterBatchDeleteRequest) MarshalJSON() ([]byte, error) { + type noMethod RasterCollectionsRasterBatchDeleteRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RasterCollectionsRastersBatchDeleteResponse: The response returned by +// a call to rasterCollections.rasters.batchDelete. +type RasterCollectionsRastersBatchDeleteResponse struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// RasterCollectionsRastersBatchInsertRequest: The request sent to +// rasterCollections.Rasters.BatchInsert. +type RasterCollectionsRastersBatchInsertRequest struct { + // Ids: An array of Raster asset IDs to be added to this + // RasterCollection. + Ids []string `json:"ids,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Ids") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RasterCollectionsRastersBatchInsertRequest) MarshalJSON() ([]byte, error) { + type noMethod RasterCollectionsRastersBatchInsertRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RasterCollectionsRastersBatchInsertResponse: The response returned by +// a call to rasterCollections.rasters.batchInsert. +type RasterCollectionsRastersBatchInsertResponse struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// RasterCollectionsRastersListResponse: The response returned by a call +// to rasterCollections.rasters.List. +type RasterCollectionsRastersListResponse struct { + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Rasters: Resources returned. + Rasters []*RasterCollectionsRaster `json:"rasters,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RasterCollectionsRastersListResponse) MarshalJSON() ([]byte, error) { + type noMethod RasterCollectionsRastersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RastersListResponse: The response returned by a call to rasters.List. +type RastersListResponse struct { + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Rasters: Resources returned. + Rasters []*Raster `json:"rasters,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RastersListResponse) MarshalJSON() ([]byte, error) { + type noMethod RastersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ScaledShape: Parameters for styling points as scaled shapes. +type ScaledShape struct { + // Border: Border color/width of the shape. If not specified the shape + // won't have a border. + Border *Border `json:"border,omitempty"` + + // Fill: The fill color of the shape. If not specified the shape will be + // transparent (although the borders may not be). + Fill *Color `json:"fill,omitempty"` + + // Shape: Name of the shape. + // + // Possible values: + // "circle" + Shape string `json:"shape,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Border") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ScaledShape) MarshalJSON() ([]byte, error) { + type noMethod ScaledShape + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ScalingFunction: Parameters for scaling scaled shapes. +type ScalingFunction struct { + // Column: Name of the numeric column used to scale a shape. + Column string `json:"column,omitempty"` + + // ScalingType: The type of scaling function to use. Defaults to SQRT. + // Currently only linear and square root scaling are supported. + // + // Possible values: + // "linear" + // "sqrt" + ScalingType string `json:"scalingType,omitempty"` + + // SizeRange: The range of shape sizes, in pixels. For circles, the size + // corresponds to the diameter. + SizeRange *SizeRange `json:"sizeRange,omitempty"` + + // ValueRange: The range of values to display across the size range. + ValueRange *ValueRange `json:"valueRange,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Column") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ScalingFunction) MarshalJSON() ([]byte, error) { + type noMethod ScalingFunction + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Schema: A schema indicating the properties which may be associated +// with features within a Table, and the types of those properties. +type Schema struct { + // Columns: An array of TableColumn objects. The first object in the + // array must be named geometry and be of type points, lineStrings, + // polygons, or mixedGeometry. + Columns []*TableColumn `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"` + + // ForceSendFields is a list of field names (e.g. "Columns") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Schema) MarshalJSON() ([]byte, error) { + type noMethod Schema + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SizeRange: Scaled shape size range in pixels. For circles, size +// corresponds to diameter. +type SizeRange struct { + // Max: Maximum size, in pixels. + Max float64 `json:"max,omitempty"` + + // Min: Minimum size, in pixels. + Min float64 `json:"min,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Max") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SizeRange) MarshalJSON() ([]byte, error) { + type noMethod SizeRange + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Table: A collection of geographic features, and associated metadata. +type Table struct { + // Bbox: A rectangular bounding box which contains all of the data in + // this Table. The box is expressed as \"west, south, east, north\". The + // numbers represent latitude and longitude in decimal degrees. + 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"` + + // CreatorEmail: The email address of the creator of this table. This is + // only returned on GET requests and not LIST requests. + CreatorEmail string `json:"creatorEmail,omitempty"` + + // Description: The description of this table, supplied by the author. + Description string `json:"description,omitempty"` + + // DraftAccessList: Deprecated: 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. Note: Google Maps Engine no longer + // uses access lists. Instead, each asset has its own list of + // permissions. For backward compatibility, the API still accepts access + // lists for projects that are already using access lists. If you + // created a GME account/project after July 14th, 2014, you will not be + // able to send API requests that include access lists. Note: This is an + // input field only. It is not returned in response to a list or get + // request. + DraftAccessList string `json:"draftAccessList,omitempty"` + + // Etag: The ETag, used to refer to the current version of the asset. + Etag string `json:"etag,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"` + + // LastModifierEmail: The email address of the last modifier of this + // table. This is only returned on GET requests and not LIST requests. + LastModifierEmail string `json:"lastModifierEmail,omitempty"` + + // Name: The name of this table, supplied by the author. + Name string `json:"name,omitempty"` + + // ProcessingStatus: The processing status of this table. + // + // Possible values: + // "complete" + // "failed" + // "notReady" + // "processing" + // "ready" + ProcessingStatus string `json:"processingStatus,omitempty"` + + // ProjectId: The ID of the project to which the table belongs. + ProjectId string `json:"projectId,omitempty"` + + // PublishedAccessList: Deprecated: 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. Note: Google Maps Engine no longer uses access lists. + // Instead, each asset has its own list of permissions. For backward + // compatibility, the API still accepts access lists for projects that + // are already using access lists. If you created a GME account/project + // after July 14th, 2014, you will not be able to send API requests that + // include access lists. Note: This is an input field only. It is not + // returned in response to a list or get request. + PublishedAccessList string `json:"publishedAccessList,omitempty"` + + // Schema: The schema for this table. Note: The schema is returned in + // response to a get request but not a list request. After requesting a + // list of tables, you'll need to send a get request to retrieve the + // schema for each 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"` + + // WritersCanEditPermissions: If true, WRITERs of the asset are able to + // edit the asset permissions. + WritersCanEditPermissions bool `json:"writersCanEditPermissions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Bbox") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Table) MarshalJSON() ([]byte, error) { + type noMethod Table + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TableColumn struct { + // Name: The column name. + Name string `json:"name,omitempty"` + + // Type: The type of data stored in this column. + // + // Possible values: + // "datetime" + // "double" + // "integer" + // "lineStrings" + // "mixedGeometry" + // "points" + // "polygons" + // "string" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TableColumn) MarshalJSON() ([]byte, error) { + type noMethod TableColumn + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TablesListResponse: The response returned by a call to tables.List. +// Note: The list response does not include all the fields available in +// a table. Refer to the table resource description for details of the +// fields that are not included. You'll need to send a get request to +// retrieve the additional fields for each table. +type TablesListResponse struct { + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Tables: Resources returned. + Tables []*Table `json:"tables,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TablesListResponse) MarshalJSON() ([]byte, error) { + type noMethod TablesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ValueRange: Range of values used for scaling shapes. The min/max +// values will be drawn as shapes with the min/max size. +type ValueRange struct { + // Max: Maximum value. + Max float64 `json:"max,omitempty"` + + // Min: Minimum value. + Min float64 `json:"min,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Max") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ValueRange) MarshalJSON() ([]byte, error) { + type noMethod ValueRange + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VectorStyle: A vector style contains styling information for vector +// layer. +type VectorStyle struct { + 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. + // + // Possible values: + // "displayRule" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DisplayRules") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VectorStyle) MarshalJSON() ([]byte, error) { + type noMethod VectorStyle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ZoomLevels: Zoom level range. Zoom levels are restricted between 0 +// and 24, inclusive. +type ZoomLevels struct { + // Max: Maximum zoom level. + Max int64 `json:"max,omitempty"` + + // Min: Minimum zoom level. + Min int64 `json:"min,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Max") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ZoomLevels) MarshalJSON() ([]byte, error) { + type noMethod ZoomLevels + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "mapsengine.assets.get": + +type AssetsGetCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AssetsGetCall) Fields(s ...googleapi.Field) *AssetsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AssetsGetCall) IfNoneMatch(entityTag string) *AssetsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AssetsGetCall) Context(ctx context.Context) *AssetsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AssetsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "assets/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.assets.get" call. +// Exactly one of *Asset or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Asset.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AssetsGetCall) Do() (*Asset, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Asset{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Asset" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Role sets the optional parameter "role": The role parameter indicates +// that the response should only contain assets where the current user +// has the specified level of access. +// +// Possible values: +// "owner" - The user can read, write and administer the asset. +// "reader" - The user can read the asset. +// "writer" - The user can read and write the asset. +func (c *AssetsListCall) Role(role string) *AssetsListCall { + c.opt_["role"] = role + return c +} + +// Search sets the optional parameter "search": An unstructured search +// string used to filter the set of results based on asset metadata. +func (c *AssetsListCall) Search(search string) *AssetsListCall { + c.opt_["search"] = search + return c +} + +// Tags sets the optional parameter "tags": A comma separated list of +// tags. Returned assets will contain all the tags from the list. +func (c *AssetsListCall) Tags(tags string) *AssetsListCall { + c.opt_["tags"] = tags + return c +} + +// Type sets the optional parameter "type": A comma separated list of +// asset types. Returned assets will have one of the types from the +// provided list. Supported values are 'map', 'layer', +// 'rasterCollection' and 'table'. +func (c *AssetsListCall) Type(type_ string) *AssetsListCall { + c.opt_["type"] = type_ + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AssetsListCall) Fields(s ...googleapi.Field) *AssetsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AssetsListCall) IfNoneMatch(entityTag string) *AssetsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AssetsListCall) Context(ctx context.Context) *AssetsListCall { + c.ctx_ = ctx + return c +} + +func (c *AssetsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["role"]; ok { + params.Set("role", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["search"]; ok { + params.Set("search", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["tags"]; ok { + params.Set("tags", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["type"]; ok { + params.Set("type", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.assets.list" call. +// Exactly one of *AssetsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AssetsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AssetsListCall) Do() (*AssetsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AssetsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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" + // }, + // "role": { + // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.", + // "enum": [ + // "owner", + // "reader", + // "writer" + // ], + // "enumDescriptions": [ + // "The user can read, write and administer the asset.", + // "The user can read the asset.", + // "The user can read and write the asset." + // ], + // "location": "query", + // "type": "string" + // }, + // "search": { + // "description": "An unstructured search string used to filter the set of results based on asset metadata.", + // "location": "query", + // "type": "string" + // }, + // "tags": { + // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.", + // "location": "query", + // "type": "string" + // }, + // "type": { + // "description": "A comma separated list of asset types. Returned assets will have one of the types from the provided list. Supported values are 'map', 'layer', 'rasterCollection' and 'table'.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "assets", + // "response": { + // "$ref": "AssetsListResponse" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AssetsParentsListCall) Fields(s ...googleapi.Field) *AssetsParentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AssetsParentsListCall) IfNoneMatch(entityTag string) *AssetsParentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AssetsParentsListCall) Context(ctx context.Context) *AssetsParentsListCall { + c.ctx_ = ctx + return c +} + +func (c *AssetsParentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "assets/{id}/parents") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.assets.parents.list" call. +// Exactly one of *ParentsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ParentsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AssetsParentsListCall) Do() (*ParentsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ParentsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.assets.permissions.list": + +type AssetsPermissionsListCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Return all of the permissions for the specified asset. +func (r *AssetsPermissionsService) List(id string) *AssetsPermissionsListCall { + c := &AssetsPermissionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AssetsPermissionsListCall) Fields(s ...googleapi.Field) *AssetsPermissionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AssetsPermissionsListCall) IfNoneMatch(entityTag string) *AssetsPermissionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AssetsPermissionsListCall) Context(ctx context.Context) *AssetsPermissionsListCall { + c.ctx_ = ctx + return c +} + +func (c *AssetsPermissionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "assets/{id}/permissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.assets.permissions.list" call. +// Exactly one of *PermissionsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PermissionsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AssetsPermissionsListCall) Do() (*PermissionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all of the permissions for the specified asset.", + // "httpMethod": "GET", + // "id": "mapsengine.assets.permissions.list", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset whose permissions will be listed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "assets/{id}/permissions", + // "response": { + // "$ref": "PermissionsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.layers.cancelProcessing": + +type LayersCancelProcessingCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// CancelProcessing: Cancel processing on a layer asset. +func (r *LayersService) CancelProcessing(id string) *LayersCancelProcessingCall { + c := &LayersCancelProcessingCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersCancelProcessingCall) Fields(s ...googleapi.Field) *LayersCancelProcessingCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersCancelProcessingCall) Context(ctx context.Context) *LayersCancelProcessingCall { + c.ctx_ = ctx + return c +} + +func (c *LayersCancelProcessingCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/cancelProcessing") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.cancelProcessing" call. +// Exactly one of *ProcessResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ProcessResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersCancelProcessingCall) Do() (*ProcessResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProcessResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Cancel processing on a layer asset.", + // "httpMethod": "POST", + // "id": "mapsengine.layers.cancelProcessing", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the layer.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "layers/{id}/cancelProcessing", + // "response": { + // "$ref": "ProcessResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.layers.create": + +type LayersCreateCall struct { + s *Service + layer *Layer + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersCreateCall) Fields(s ...googleapi.Field) *LayersCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersCreateCall) Context(ctx context.Context) *LayersCreateCall { + c.ctx_ = ctx + return c +} + +func (c *LayersCreateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["process"]; ok { + params.Set("process", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.create" call. +// Exactly one of *Layer or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Layer.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *LayersCreateCall) Do() (*Layer, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Layer{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.delete": + +type LayersDeleteCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Delete a layer. +func (r *LayersService) Delete(id string) *LayersDeleteCall { + c := &LayersDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersDeleteCall) Fields(s ...googleapi.Field) *LayersDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersDeleteCall) Context(ctx context.Context) *LayersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *LayersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.delete" call. +func (c *LayersDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a layer.", + // "httpMethod": "DELETE", + // "id": "mapsengine.layers.delete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the layer. Only the layer creator or project owner are permitted to delete. If the layer is published, or included in a map, the request will fail. Unpublish the layer, and remove it from all maps prior to deleting.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "layers/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.layers.get": + +type LayersGetCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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": Deprecated: The +// version parameter indicates which version of the layer should be +// returned. When version is set to published, the published version of +// the layer will be returned. Please use the layers.getPublished +// endpoint instead. +// +// Possible values: +// "draft" - The draft version. +// "published" - The published version. +func (c *LayersGetCall) Version(version string) *LayersGetCall { + c.opt_["version"] = version + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersGetCall) Fields(s ...googleapi.Field) *LayersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LayersGetCall) IfNoneMatch(entityTag string) *LayersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersGetCall) Context(ctx context.Context) *LayersGetCall { + c.ctx_ = ctx + return c +} + +func (c *LayersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["version"]; ok { + params.Set("version", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.get" call. +// Exactly one of *Layer or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Layer.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *LayersGetCall) Do() (*Layer, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Layer{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": { + // "description": "Deprecated: The version parameter indicates which version of the layer should be returned. When version is set to published, the published version of the layer will be returned. Please use the layers.getPublished endpoint instead.", + // "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.getPublished": + +type LayersGetPublishedCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetPublished: Return the published metadata for a particular layer. +func (r *LayersService) GetPublished(id string) *LayersGetPublishedCall { + c := &LayersGetPublishedCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersGetPublishedCall) Fields(s ...googleapi.Field) *LayersGetPublishedCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LayersGetPublishedCall) IfNoneMatch(entityTag string) *LayersGetPublishedCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersGetPublishedCall) Context(ctx context.Context) *LayersGetPublishedCall { + c.ctx_ = ctx + return c +} + +func (c *LayersGetPublishedCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/published") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.getPublished" call. +// Exactly one of *PublishedLayer or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PublishedLayer.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersGetPublishedCall) Do() (*PublishedLayer, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PublishedLayer{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return the published metadata for a particular layer.", + // "httpMethod": "GET", + // "id": "mapsengine.layers.getPublished", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the layer.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "layers/{id}/published", + // "response": { + // "$ref": "PublishedLayer" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// ProcessingStatus sets the optional parameter "processingStatus": +// +// Possible values: +// "complete" - The layer has completed processing. +// "failed" - The layer has failed processing. +// "notReady" - The layer is not ready for processing. +// "processing" - The layer is processing. +// "ready" - The layer is ready for processing. +func (c *LayersListCall) ProcessingStatus(processingStatus string) *LayersListCall { + c.opt_["processingStatus"] = processingStatus + 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 +} + +// Role sets the optional parameter "role": The role parameter indicates +// that the response should only contain assets where the current user +// has the specified level of access. +// +// Possible values: +// "owner" - The user can read, write and administer the asset. +// "reader" - The user can read the asset. +// "writer" - The user can read and write the asset. +func (c *LayersListCall) Role(role string) *LayersListCall { + c.opt_["role"] = role + return c +} + +// Search sets the optional parameter "search": An unstructured search +// string used to filter the set of results based on asset metadata. +func (c *LayersListCall) Search(search string) *LayersListCall { + c.opt_["search"] = search + return c +} + +// Tags sets the optional parameter "tags": A comma separated list of +// tags. Returned assets will contain all the tags from the list. +func (c *LayersListCall) Tags(tags string) *LayersListCall { + c.opt_["tags"] = tags + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersListCall) Fields(s ...googleapi.Field) *LayersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LayersListCall) IfNoneMatch(entityTag string) *LayersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersListCall) Context(ctx context.Context) *LayersListCall { + c.ctx_ = ctx + return c +} + +func (c *LayersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["processingStatus"]; ok { + params.Set("processingStatus", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projectId"]; ok { + params.Set("projectId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["role"]; ok { + params.Set("role", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["search"]; ok { + params.Set("search", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["tags"]; ok { + params.Set("tags", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.list" call. +// Exactly one of *LayersListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *LayersListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersListCall) Do() (*LayersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LayersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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" + // }, + // "processingStatus": { + // "enum": [ + // "complete", + // "failed", + // "notReady", + // "processing", + // "ready" + // ], + // "enumDescriptions": [ + // "The layer has completed processing.", + // "The layer has failed processing.", + // "The layer is not ready for processing.", + // "The layer is processing.", + // "The layer is ready for processing." + // ], + // "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" + // }, + // "role": { + // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.", + // "enum": [ + // "owner", + // "reader", + // "writer" + // ], + // "enumDescriptions": [ + // "The user can read, write and administer the asset.", + // "The user can read the asset.", + // "The user can read and write the asset." + // ], + // "location": "query", + // "type": "string" + // }, + // "search": { + // "description": "An unstructured search string used to filter the set of results based on asset metadata.", + // "location": "query", + // "type": "string" + // }, + // "tags": { + // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.", + // "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.listPublished": + +type LayersListPublishedCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// ListPublished: Return all published layers readable by the current +// user. +func (r *LayersService) ListPublished() *LayersListPublishedCall { + c := &LayersListPublishedCall{s: r.s, opt_: make(map[string]interface{})} + 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 *LayersListPublishedCall) MaxResults(maxResults int64) *LayersListPublishedCall { + 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 *LayersListPublishedCall) PageToken(pageToken string) *LayersListPublishedCall { + 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 *LayersListPublishedCall) ProjectId(projectId string) *LayersListPublishedCall { + c.opt_["projectId"] = projectId + return c +} + +// Search sets the optional parameter "search": An unstructured search +// string used to filter the set of results based on asset metadata. +func (c *LayersListPublishedCall) Search(search string) *LayersListPublishedCall { + c.opt_["search"] = search + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersListPublishedCall) Fields(s ...googleapi.Field) *LayersListPublishedCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LayersListPublishedCall) IfNoneMatch(entityTag string) *LayersListPublishedCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersListPublishedCall) Context(ctx context.Context) *LayersListPublishedCall { + c.ctx_ = ctx + return c +} + +func (c *LayersListPublishedCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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_["projectId"]; ok { + params.Set("projectId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["search"]; ok { + params.Set("search", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/published") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.listPublished" call. +// Exactly one of *PublishedLayersListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *PublishedLayersListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersListPublishedCall) Do() (*PublishedLayersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PublishedLayersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all published layers readable by the current user.", + // "httpMethod": "GET", + // "id": "mapsengine.layers.listPublished", + // "parameters": { + // "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" + // }, + // "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" + // }, + // "search": { + // "description": "An unstructured search string used to filter the set of results based on asset metadata.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "layers/published", + // "response": { + // "$ref": "PublishedLayersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.layers.patch": + +type LayersPatchCall struct { + s *Service + id string + layer *Layer + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Mutate a layer asset. +func (r *LayersService) Patch(id string, layer *Layer) *LayersPatchCall { + c := &LayersPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.layer = layer + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersPatchCall) Fields(s ...googleapi.Field) *LayersPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersPatchCall) Context(ctx context.Context) *LayersPatchCall { + c.ctx_ = ctx + return c +} + +func (c *LayersPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.patch" call. +func (c *LayersPatchCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Mutate a layer asset.", + // "httpMethod": "PATCH", + // "id": "mapsengine.layers.patch", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the layer.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "layers/{id}", + // "request": { + // "$ref": "Layer" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.layers.process": + +type LayersProcessCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersProcessCall) Fields(s ...googleapi.Field) *LayersProcessCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersProcessCall) Context(ctx context.Context) *LayersProcessCall { + c.ctx_ = ctx + return c +} + +func (c *LayersProcessCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/process") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.process" call. +// Exactly one of *ProcessResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ProcessResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersProcessCall) Do() (*ProcessResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProcessResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Force sets the optional parameter "force": If set to true, the API +// will allow publication of the layer even if it's out of date. If not +// true, you'll need to reprocess any out-of-date layer before +// publishing. +func (c *LayersPublishCall) Force(force bool) *LayersPublishCall { + c.opt_["force"] = force + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersPublishCall) Fields(s ...googleapi.Field) *LayersPublishCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersPublishCall) Context(ctx context.Context) *LayersPublishCall { + c.ctx_ = ctx + return c +} + +func (c *LayersPublishCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["force"]; ok { + params.Set("force", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/publish") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.publish" call. +// Exactly one of *PublishResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PublishResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersPublishCall) Do() (*PublishResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PublishResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Publish a layer asset.", + // "httpMethod": "POST", + // "id": "mapsengine.layers.publish", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "force": { + // "description": "If set to true, the API will allow publication of the layer even if it's out of date. If not true, you'll need to reprocess any out-of-date layer before publishing.", + // "location": "query", + // "type": "boolean" + // }, + // "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.unpublish": + +type LayersUnpublishCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Unpublish: Unpublish a layer asset. +func (r *LayersService) Unpublish(id string) *LayersUnpublishCall { + c := &LayersUnpublishCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersUnpublishCall) Fields(s ...googleapi.Field) *LayersUnpublishCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersUnpublishCall) Context(ctx context.Context) *LayersUnpublishCall { + c.ctx_ = ctx + return c +} + +func (c *LayersUnpublishCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/unpublish") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.unpublish" call. +// Exactly one of *PublishResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PublishResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersUnpublishCall) Do() (*PublishResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PublishResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Unpublish a layer asset.", + // "httpMethod": "POST", + // "id": "mapsengine.layers.unpublish", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the layer.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "layers/{id}/unpublish", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersParentsListCall) Fields(s ...googleapi.Field) *LayersParentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LayersParentsListCall) IfNoneMatch(entityTag string) *LayersParentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersParentsListCall) Context(ctx context.Context) *LayersParentsListCall { + c.ctx_ = ctx + return c +} + +func (c *LayersParentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/parents") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.parents.list" call. +// Exactly one of *ParentsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ParentsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersParentsListCall) Do() (*ParentsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ParentsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.layers.permissions.batchDelete": + +type LayersPermissionsBatchDeleteCall struct { + s *Service + id string + permissionsbatchdeleterequest *PermissionsBatchDeleteRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// BatchDelete: Remove permission entries from an already existing +// asset. +func (r *LayersPermissionsService) BatchDelete(id string, permissionsbatchdeleterequest *PermissionsBatchDeleteRequest) *LayersPermissionsBatchDeleteCall { + c := &LayersPermissionsBatchDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.permissionsbatchdeleterequest = permissionsbatchdeleterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersPermissionsBatchDeleteCall) Fields(s ...googleapi.Field) *LayersPermissionsBatchDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersPermissionsBatchDeleteCall) Context(ctx context.Context) *LayersPermissionsBatchDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *LayersPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchdeleterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/permissions/batchDelete") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.permissions.batchDelete" call. +// Exactly one of *PermissionsBatchDeleteResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PermissionsBatchDeleteResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersPermissionsBatchDeleteCall) Do() (*PermissionsBatchDeleteResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsBatchDeleteResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Remove permission entries from an already existing asset.", + // "httpMethod": "POST", + // "id": "mapsengine.layers.permissions.batchDelete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset from which permissions will be removed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "layers/{id}/permissions/batchDelete", + // "request": { + // "$ref": "PermissionsBatchDeleteRequest" + // }, + // "response": { + // "$ref": "PermissionsBatchDeleteResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.layers.permissions.batchUpdate": + +type LayersPermissionsBatchUpdateCall struct { + s *Service + id string + permissionsbatchupdaterequest *PermissionsBatchUpdateRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// BatchUpdate: Add or update permission entries to an already existing +// asset. +// +// An asset can hold up to 20 different permission entries. Each +// batchInsert request is atomic. +func (r *LayersPermissionsService) BatchUpdate(id string, permissionsbatchupdaterequest *PermissionsBatchUpdateRequest) *LayersPermissionsBatchUpdateCall { + c := &LayersPermissionsBatchUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.permissionsbatchupdaterequest = permissionsbatchupdaterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersPermissionsBatchUpdateCall) Fields(s ...googleapi.Field) *LayersPermissionsBatchUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersPermissionsBatchUpdateCall) Context(ctx context.Context) *LayersPermissionsBatchUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *LayersPermissionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchupdaterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/permissions/batchUpdate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.permissions.batchUpdate" call. +// Exactly one of *PermissionsBatchUpdateResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PermissionsBatchUpdateResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersPermissionsBatchUpdateCall) Do() (*PermissionsBatchUpdateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsBatchUpdateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add or update permission entries to an already existing asset.\n\nAn asset can hold up to 20 different permission entries. Each batchInsert request is atomic.", + // "httpMethod": "POST", + // "id": "mapsengine.layers.permissions.batchUpdate", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset to which permissions will be added.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "layers/{id}/permissions/batchUpdate", + // "request": { + // "$ref": "PermissionsBatchUpdateRequest" + // }, + // "response": { + // "$ref": "PermissionsBatchUpdateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.layers.permissions.list": + +type LayersPermissionsListCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Return all of the permissions for the specified asset. +func (r *LayersPermissionsService) List(id string) *LayersPermissionsListCall { + c := &LayersPermissionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersPermissionsListCall) Fields(s ...googleapi.Field) *LayersPermissionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LayersPermissionsListCall) IfNoneMatch(entityTag string) *LayersPermissionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersPermissionsListCall) Context(ctx context.Context) *LayersPermissionsListCall { + c.ctx_ = ctx + return c +} + +func (c *LayersPermissionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/permissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.permissions.list" call. +// Exactly one of *PermissionsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PermissionsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersPermissionsListCall) Do() (*PermissionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all of the permissions for the specified asset.", + // "httpMethod": "GET", + // "id": "mapsengine.layers.permissions.list", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset whose permissions will be listed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "layers/{id}/permissions", + // "response": { + // "$ref": "PermissionsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.maps.create": + +type MapsCreateCall struct { + s *Service + map_ *Map + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Create a map asset. +func (r *MapsService) Create(map_ *Map) *MapsCreateCall { + c := &MapsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.map_ = map_ + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MapsCreateCall) Fields(s ...googleapi.Field) *MapsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MapsCreateCall) Context(ctx context.Context) *MapsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *MapsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.map_) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "maps") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.maps.create" call. +// Exactly one of *Map or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Map.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *MapsCreateCall) Do() (*Map, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Map{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a map asset.", + // "httpMethod": "POST", + // "id": "mapsengine.maps.create", + // "path": "maps", + // "request": { + // "$ref": "Map" + // }, + // "response": { + // "$ref": "Map" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.maps.delete": + +type MapsDeleteCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Delete a map. +func (r *MapsService) Delete(id string) *MapsDeleteCall { + c := &MapsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MapsDeleteCall) Fields(s ...googleapi.Field) *MapsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MapsDeleteCall) Context(ctx context.Context) *MapsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *MapsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.maps.delete" call. +func (c *MapsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a map.", + // "httpMethod": "DELETE", + // "id": "mapsengine.maps.delete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the map. Only the map creator or project owner are permitted to delete. If the map is published the request will fail. Unpublish the map prior to deleting.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "maps/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.maps.get": + +type MapsGetCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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": Deprecated: The +// version parameter indicates which version of the map should be +// returned. When version is set to published, the published version of +// the map will be returned. Please use the maps.getPublished endpoint +// instead. +// +// Possible values: +// "draft" - The draft version. +// "published" - The published version. +func (c *MapsGetCall) Version(version string) *MapsGetCall { + c.opt_["version"] = version + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MapsGetCall) Fields(s ...googleapi.Field) *MapsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MapsGetCall) IfNoneMatch(entityTag string) *MapsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MapsGetCall) Context(ctx context.Context) *MapsGetCall { + c.ctx_ = ctx + return c +} + +func (c *MapsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["version"]; ok { + params.Set("version", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.maps.get" call. +// Exactly one of *Map or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Map.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *MapsGetCall) Do() (*Map, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Map{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": { + // "description": "Deprecated: The version parameter indicates which version of the map should be returned. When version is set to published, the published version of the map will be returned. Please use the maps.getPublished endpoint instead.", + // "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.getPublished": + +type MapsGetPublishedCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetPublished: Return the published metadata for a particular map. +func (r *MapsService) GetPublished(id string) *MapsGetPublishedCall { + c := &MapsGetPublishedCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MapsGetPublishedCall) Fields(s ...googleapi.Field) *MapsGetPublishedCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MapsGetPublishedCall) IfNoneMatch(entityTag string) *MapsGetPublishedCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MapsGetPublishedCall) Context(ctx context.Context) *MapsGetPublishedCall { + c.ctx_ = ctx + return c +} + +func (c *MapsGetPublishedCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}/published") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.maps.getPublished" call. +// Exactly one of *PublishedMap or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PublishedMap.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MapsGetPublishedCall) Do() (*PublishedMap, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PublishedMap{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return the published metadata for a particular map.", + // "httpMethod": "GET", + // "id": "mapsengine.maps.getPublished", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the map.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "maps/{id}/published", + // "response": { + // "$ref": "PublishedMap" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// ProcessingStatus sets the optional parameter "processingStatus": +// +// Possible values: +// "complete" - The map has completed processing. +// "failed" - The map has failed processing. +// "notReady" - The map is not ready for processing. +// "processing" - The map is processing. +func (c *MapsListCall) ProcessingStatus(processingStatus string) *MapsListCall { + c.opt_["processingStatus"] = processingStatus + 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 +} + +// Role sets the optional parameter "role": The role parameter indicates +// that the response should only contain assets where the current user +// has the specified level of access. +// +// Possible values: +// "owner" - The user can read, write and administer the asset. +// "reader" - The user can read the asset. +// "writer" - The user can read and write the asset. +func (c *MapsListCall) Role(role string) *MapsListCall { + c.opt_["role"] = role + return c +} + +// Search sets the optional parameter "search": An unstructured search +// string used to filter the set of results based on asset metadata. +func (c *MapsListCall) Search(search string) *MapsListCall { + c.opt_["search"] = search + return c +} + +// Tags sets the optional parameter "tags": A comma separated list of +// tags. Returned assets will contain all the tags from the list. +func (c *MapsListCall) Tags(tags string) *MapsListCall { + c.opt_["tags"] = tags + return c +} + +// Version sets the optional parameter "version": Deprecated: The +// version parameter indicates which version of the maps should be +// returned. When version is set to published this parameter will filter +// the result set to include only maps that are published. Please use +// the maps.listPublished endpoint instead. +// +// Possible values: +// "draft" - The draft version. +// "published" - The published version. +func (c *MapsListCall) Version(version string) *MapsListCall { + c.opt_["version"] = version + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MapsListCall) Fields(s ...googleapi.Field) *MapsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MapsListCall) IfNoneMatch(entityTag string) *MapsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MapsListCall) Context(ctx context.Context) *MapsListCall { + c.ctx_ = ctx + return c +} + +func (c *MapsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["processingStatus"]; ok { + params.Set("processingStatus", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projectId"]; ok { + params.Set("projectId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["role"]; ok { + params.Set("role", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["search"]; ok { + params.Set("search", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["tags"]; ok { + params.Set("tags", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["version"]; ok { + params.Set("version", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "maps") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.maps.list" call. +// Exactly one of *MapsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *MapsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MapsListCall) Do() (*MapsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &MapsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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" + // }, + // "processingStatus": { + // "enum": [ + // "complete", + // "failed", + // "notReady", + // "processing" + // ], + // "enumDescriptions": [ + // "The map has completed processing.", + // "The map has failed processing.", + // "The map is not ready for processing.", + // "The map is processing." + // ], + // "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" + // }, + // "role": { + // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.", + // "enum": [ + // "owner", + // "reader", + // "writer" + // ], + // "enumDescriptions": [ + // "The user can read, write and administer the asset.", + // "The user can read the asset.", + // "The user can read and write the asset." + // ], + // "location": "query", + // "type": "string" + // }, + // "search": { + // "description": "An unstructured search string used to filter the set of results based on asset metadata.", + // "location": "query", + // "type": "string" + // }, + // "tags": { + // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.", + // "location": "query", + // "type": "string" + // }, + // "version": { + // "description": "Deprecated: The version parameter indicates which version of the maps should be returned. When version is set to published this parameter will filter the result set to include only maps that are published. Please use the maps.listPublished endpoint instead.", + // "enum": [ + // "draft", + // "published" + // ], + // "enumDescriptions": [ + // "The draft version.", + // "The published version." + // ], + // "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.maps.listPublished": + +type MapsListPublishedCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// ListPublished: Return all published maps readable by the current +// user. +func (r *MapsService) ListPublished() *MapsListPublishedCall { + c := &MapsListPublishedCall{s: r.s, opt_: make(map[string]interface{})} + 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 *MapsListPublishedCall) MaxResults(maxResults int64) *MapsListPublishedCall { + 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 *MapsListPublishedCall) PageToken(pageToken string) *MapsListPublishedCall { + 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 *MapsListPublishedCall) ProjectId(projectId string) *MapsListPublishedCall { + c.opt_["projectId"] = projectId + return c +} + +// Search sets the optional parameter "search": An unstructured search +// string used to filter the set of results based on asset metadata. +func (c *MapsListPublishedCall) Search(search string) *MapsListPublishedCall { + c.opt_["search"] = search + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MapsListPublishedCall) Fields(s ...googleapi.Field) *MapsListPublishedCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MapsListPublishedCall) IfNoneMatch(entityTag string) *MapsListPublishedCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MapsListPublishedCall) Context(ctx context.Context) *MapsListPublishedCall { + c.ctx_ = ctx + return c +} + +func (c *MapsListPublishedCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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_["projectId"]; ok { + params.Set("projectId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["search"]; ok { + params.Set("search", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "maps/published") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.maps.listPublished" call. +// Exactly one of *PublishedMapsListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *PublishedMapsListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MapsListPublishedCall) Do() (*PublishedMapsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PublishedMapsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all published maps readable by the current user.", + // "httpMethod": "GET", + // "id": "mapsengine.maps.listPublished", + // "parameters": { + // "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" + // }, + // "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" + // }, + // "search": { + // "description": "An unstructured search string used to filter the set of results based on asset metadata.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "maps/published", + // "response": { + // "$ref": "PublishedMapsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.maps.patch": + +type MapsPatchCall struct { + s *Service + id string + map_ *Map + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Mutate a map asset. +func (r *MapsService) Patch(id string, map_ *Map) *MapsPatchCall { + c := &MapsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.map_ = map_ + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MapsPatchCall) Fields(s ...googleapi.Field) *MapsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MapsPatchCall) Context(ctx context.Context) *MapsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *MapsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.map_) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.maps.patch" call. +func (c *MapsPatchCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Mutate a map asset.", + // "httpMethod": "PATCH", + // "id": "mapsengine.maps.patch", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the map.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "maps/{id}", + // "request": { + // "$ref": "Map" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.maps.publish": + +type MapsPublishCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Publish: Publish a map asset. +func (r *MapsService) Publish(id string) *MapsPublishCall { + c := &MapsPublishCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Force sets the optional parameter "force": If set to true, the API +// will allow publication of the map even if it's out of date. If false, +// the map must have a processingStatus of complete before publishing. +func (c *MapsPublishCall) Force(force bool) *MapsPublishCall { + c.opt_["force"] = force + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MapsPublishCall) Fields(s ...googleapi.Field) *MapsPublishCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MapsPublishCall) Context(ctx context.Context) *MapsPublishCall { + c.ctx_ = ctx + return c +} + +func (c *MapsPublishCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["force"]; ok { + params.Set("force", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}/publish") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.maps.publish" call. +// Exactly one of *PublishResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PublishResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MapsPublishCall) Do() (*PublishResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PublishResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Publish a map asset.", + // "httpMethod": "POST", + // "id": "mapsengine.maps.publish", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "force": { + // "description": "If set to true, the API will allow publication of the map even if it's out of date. If false, the map must have a processingStatus of complete before publishing.", + // "location": "query", + // "type": "boolean" + // }, + // "id": { + // "description": "The ID of the map.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "maps/{id}/publish", + // "response": { + // "$ref": "PublishResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.maps.unpublish": + +type MapsUnpublishCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Unpublish: Unpublish a map asset. +func (r *MapsService) Unpublish(id string) *MapsUnpublishCall { + c := &MapsUnpublishCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MapsUnpublishCall) Fields(s ...googleapi.Field) *MapsUnpublishCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MapsUnpublishCall) Context(ctx context.Context) *MapsUnpublishCall { + c.ctx_ = ctx + return c +} + +func (c *MapsUnpublishCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}/unpublish") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.maps.unpublish" call. +// Exactly one of *PublishResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PublishResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MapsUnpublishCall) Do() (*PublishResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PublishResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Unpublish a map asset.", + // "httpMethod": "POST", + // "id": "mapsengine.maps.unpublish", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the map.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "maps/{id}/unpublish", + // "response": { + // "$ref": "PublishResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.maps.permissions.batchDelete": + +type MapsPermissionsBatchDeleteCall struct { + s *Service + id string + permissionsbatchdeleterequest *PermissionsBatchDeleteRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// BatchDelete: Remove permission entries from an already existing +// asset. +func (r *MapsPermissionsService) BatchDelete(id string, permissionsbatchdeleterequest *PermissionsBatchDeleteRequest) *MapsPermissionsBatchDeleteCall { + c := &MapsPermissionsBatchDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.permissionsbatchdeleterequest = permissionsbatchdeleterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MapsPermissionsBatchDeleteCall) Fields(s ...googleapi.Field) *MapsPermissionsBatchDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MapsPermissionsBatchDeleteCall) Context(ctx context.Context) *MapsPermissionsBatchDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *MapsPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchdeleterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}/permissions/batchDelete") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.maps.permissions.batchDelete" call. +// Exactly one of *PermissionsBatchDeleteResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PermissionsBatchDeleteResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MapsPermissionsBatchDeleteCall) Do() (*PermissionsBatchDeleteResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsBatchDeleteResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Remove permission entries from an already existing asset.", + // "httpMethod": "POST", + // "id": "mapsengine.maps.permissions.batchDelete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset from which permissions will be removed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "maps/{id}/permissions/batchDelete", + // "request": { + // "$ref": "PermissionsBatchDeleteRequest" + // }, + // "response": { + // "$ref": "PermissionsBatchDeleteResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.maps.permissions.batchUpdate": + +type MapsPermissionsBatchUpdateCall struct { + s *Service + id string + permissionsbatchupdaterequest *PermissionsBatchUpdateRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// BatchUpdate: Add or update permission entries to an already existing +// asset. +// +// An asset can hold up to 20 different permission entries. Each +// batchInsert request is atomic. +func (r *MapsPermissionsService) BatchUpdate(id string, permissionsbatchupdaterequest *PermissionsBatchUpdateRequest) *MapsPermissionsBatchUpdateCall { + c := &MapsPermissionsBatchUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.permissionsbatchupdaterequest = permissionsbatchupdaterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MapsPermissionsBatchUpdateCall) Fields(s ...googleapi.Field) *MapsPermissionsBatchUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MapsPermissionsBatchUpdateCall) Context(ctx context.Context) *MapsPermissionsBatchUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *MapsPermissionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchupdaterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}/permissions/batchUpdate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.maps.permissions.batchUpdate" call. +// Exactly one of *PermissionsBatchUpdateResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PermissionsBatchUpdateResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MapsPermissionsBatchUpdateCall) Do() (*PermissionsBatchUpdateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsBatchUpdateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add or update permission entries to an already existing asset.\n\nAn asset can hold up to 20 different permission entries. Each batchInsert request is atomic.", + // "httpMethod": "POST", + // "id": "mapsengine.maps.permissions.batchUpdate", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset to which permissions will be added.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "maps/{id}/permissions/batchUpdate", + // "request": { + // "$ref": "PermissionsBatchUpdateRequest" + // }, + // "response": { + // "$ref": "PermissionsBatchUpdateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.maps.permissions.list": + +type MapsPermissionsListCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Return all of the permissions for the specified asset. +func (r *MapsPermissionsService) List(id string) *MapsPermissionsListCall { + c := &MapsPermissionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MapsPermissionsListCall) Fields(s ...googleapi.Field) *MapsPermissionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MapsPermissionsListCall) IfNoneMatch(entityTag string) *MapsPermissionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MapsPermissionsListCall) Context(ctx context.Context) *MapsPermissionsListCall { + c.ctx_ = ctx + return c +} + +func (c *MapsPermissionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}/permissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.maps.permissions.list" call. +// Exactly one of *PermissionsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PermissionsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MapsPermissionsListCall) Do() (*PermissionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all of the permissions for the specified asset.", + // "httpMethod": "GET", + // "id": "mapsengine.maps.permissions.list", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset whose permissions will be listed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "maps/{id}/permissions", + // "response": { + // "$ref": "PermissionsListResponse" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsListCall) Fields(s ...googleapi.Field) *ProjectsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsListCall) IfNoneMatch(entityTag string) *ProjectsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsListCall) Context(ctx context.Context) *ProjectsListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.projects.list" call. +// Exactly one of *ProjectsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ProjectsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsListCall) Do() (*ProjectsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProjectsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.projects.icons.create": + +type ProjectsIconsCreateCall struct { + s *Service + projectId string + icon *Icon + opt_ map[string]interface{} + media_ io.Reader + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// Create: Create an icon. +func (r *ProjectsIconsService) Create(projectId string, icon *Icon) *ProjectsIconsCreateCall { + c := &ProjectsIconsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.icon = icon + return c +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *ProjectsIconsCreateCall) Media(r io.Reader) *ProjectsIconsCreateCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *ProjectsIconsCreateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ProjectsIconsCreateCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *ProjectsIconsCreateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ProjectsIconsCreateCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsIconsCreateCall) Fields(s ...googleapi.Field) *ProjectsIconsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *ProjectsIconsCreateCall) Context(ctx context.Context) *ProjectsIconsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsIconsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.icon) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/icons") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.projects.icons.create" call. +// Exactly one of *Icon or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Icon.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsIconsCreateCall) Do() (*Icon, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &Icon{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create an icon.", + // "httpMethod": "POST", + // "id": "mapsengine.projects.icons.create", + // "mediaUpload": { + // "accept": [ + // "*/*" + // ], + // "maxSize": "100KB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/mapsengine/exp2/projects/{projectId}/icons" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/mapsengine/exp2/projects/{projectId}/icons" + // } + // } + // }, + // "parameterOrder": [ + // "projectId" + // ], + // "parameters": { + // "projectId": { + // "description": "The ID of the project.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/icons", + // "request": { + // "$ref": "Icon" + // }, + // "response": { + // "$ref": "Icon" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "mapsengine.projects.icons.get": + +type ProjectsIconsGetCall struct { + s *Service + projectId string + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Return an icon or its associated metadata +func (r *ProjectsIconsService) Get(projectId string, id string) *ProjectsIconsGetCall { + c := &ProjectsIconsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsIconsGetCall) Fields(s ...googleapi.Field) *ProjectsIconsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsIconsGetCall) IfNoneMatch(entityTag string) *ProjectsIconsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsIconsGetCall) Context(ctx context.Context) *ProjectsIconsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsIconsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/icons/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *ProjectsIconsGetCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "mapsengine.projects.icons.get" call. +// Exactly one of *Icon or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Icon.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsIconsGetCall) Do() (*Icon, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Icon{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return an icon or its associated metadata", + // "httpMethod": "GET", + // "id": "mapsengine.projects.icons.get", + // "parameterOrder": [ + // "projectId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the icon.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "The ID of the project.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/icons/{id}", + // "response": { + // "$ref": "Icon" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "mapsengine.projects.icons.list": + +type ProjectsIconsListCall struct { + s *Service + projectId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Return all icons in the current project +func (r *ProjectsIconsService) List(projectId string) *ProjectsIconsListCall { + c := &ProjectsIconsListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + 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 *ProjectsIconsListCall) MaxResults(maxResults int64) *ProjectsIconsListCall { + 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 *ProjectsIconsListCall) PageToken(pageToken string) *ProjectsIconsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsIconsListCall) Fields(s ...googleapi.Field) *ProjectsIconsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsIconsListCall) IfNoneMatch(entityTag string) *ProjectsIconsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsIconsListCall) Context(ctx context.Context) *ProjectsIconsListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsIconsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/icons") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.projects.icons.list" call. +// Exactly one of *IconsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *IconsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsIconsListCall) Do() (*IconsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &IconsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all icons in the current project", + // "httpMethod": "GET", + // "id": "mapsengine.projects.icons.list", + // "parameterOrder": [ + // "projectId" + // ], + // "parameters": { + // "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" + // }, + // "projectId": { + // "description": "The ID of the project.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/icons", + // "response": { + // "$ref": "IconsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.rasterCollections.cancelProcessing": + +type RasterCollectionsCancelProcessingCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// CancelProcessing: Cancel processing on a raster collection asset. +func (r *RasterCollectionsService) CancelProcessing(id string) *RasterCollectionsCancelProcessingCall { + c := &RasterCollectionsCancelProcessingCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsCancelProcessingCall) Fields(s ...googleapi.Field) *RasterCollectionsCancelProcessingCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsCancelProcessingCall) Context(ctx context.Context) *RasterCollectionsCancelProcessingCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsCancelProcessingCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/cancelProcessing") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.cancelProcessing" call. +// Exactly one of *ProcessResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ProcessResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RasterCollectionsCancelProcessingCall) Do() (*ProcessResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProcessResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Cancel processing on a raster collection asset.", + // "httpMethod": "POST", + // "id": "mapsengine.rasterCollections.cancelProcessing", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the raster collection.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasterCollections/{id}/cancelProcessing", + // "response": { + // "$ref": "ProcessResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasterCollections.create": + +type RasterCollectionsCreateCall struct { + s *Service + rastercollection *RasterCollection + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsCreateCall) Fields(s ...googleapi.Field) *RasterCollectionsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsCreateCall) Context(ctx context.Context) *RasterCollectionsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsCreateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.create" call. +// Exactly one of *RasterCollection or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *RasterCollection.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RasterCollectionsCreateCall) Do() (*RasterCollection, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RasterCollection{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.delete": + +type RasterCollectionsDeleteCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Delete a raster collection. +func (r *RasterCollectionsService) Delete(id string) *RasterCollectionsDeleteCall { + c := &RasterCollectionsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsDeleteCall) Fields(s ...googleapi.Field) *RasterCollectionsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsDeleteCall) Context(ctx context.Context) *RasterCollectionsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.delete" call. +func (c *RasterCollectionsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a raster collection.", + // "httpMethod": "DELETE", + // "id": "mapsengine.rasterCollections.delete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the raster collection. Only the raster collection creator or project owner are permitted to delete. If the rastor collection is included in a layer, the request will fail. Remove the raster collection from all layers prior to deleting.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasterCollections/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasterCollections.get": + +type RasterCollectionsGetCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsGetCall) Fields(s ...googleapi.Field) *RasterCollectionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RasterCollectionsGetCall) IfNoneMatch(entityTag string) *RasterCollectionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsGetCall) Context(ctx context.Context) *RasterCollectionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.get" call. +// Exactly one of *RasterCollection or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *RasterCollection.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RasterCollectionsGetCall) Do() (*RasterCollection, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RasterCollection{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// ProcessingStatus sets the optional parameter "processingStatus": +// +// Possible values: +// "complete" - The raster collection has completed processing. +// "failed" - The raster collection has failed processing. +// "notReady" - The raster collection is not ready for processing. +// "processing" - The raster collection is processing. +// "ready" - The raster collection is ready for processing. +func (c *RasterCollectionsListCall) ProcessingStatus(processingStatus string) *RasterCollectionsListCall { + c.opt_["processingStatus"] = processingStatus + 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 +} + +// Role sets the optional parameter "role": The role parameter indicates +// that the response should only contain assets where the current user +// has the specified level of access. +// +// Possible values: +// "owner" - The user can read, write and administer the asset. +// "reader" - The user can read the asset. +// "writer" - The user can read and write the asset. +func (c *RasterCollectionsListCall) Role(role string) *RasterCollectionsListCall { + c.opt_["role"] = role + return c +} + +// Search sets the optional parameter "search": An unstructured search +// string used to filter the set of results based on asset metadata. +func (c *RasterCollectionsListCall) Search(search string) *RasterCollectionsListCall { + c.opt_["search"] = search + return c +} + +// Tags sets the optional parameter "tags": A comma separated list of +// tags. Returned assets will contain all the tags from the list. +func (c *RasterCollectionsListCall) Tags(tags string) *RasterCollectionsListCall { + c.opt_["tags"] = tags + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsListCall) Fields(s ...googleapi.Field) *RasterCollectionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RasterCollectionsListCall) IfNoneMatch(entityTag string) *RasterCollectionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsListCall) Context(ctx context.Context) *RasterCollectionsListCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["processingStatus"]; ok { + params.Set("processingStatus", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projectId"]; ok { + params.Set("projectId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["role"]; ok { + params.Set("role", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["search"]; ok { + params.Set("search", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["tags"]; ok { + params.Set("tags", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.list" call. +// Exactly one of *RasterCollectionsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *RasterCollectionsListResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RasterCollectionsListCall) Do() (*RasterCollectionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RasterCollectionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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" + // }, + // "processingStatus": { + // "enum": [ + // "complete", + // "failed", + // "notReady", + // "processing", + // "ready" + // ], + // "enumDescriptions": [ + // "The raster collection has completed processing.", + // "The raster collection has failed processing.", + // "The raster collection is not ready for processing.", + // "The raster collection is processing.", + // "The raster collection is ready for processing." + // ], + // "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" + // }, + // "role": { + // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.", + // "enum": [ + // "owner", + // "reader", + // "writer" + // ], + // "enumDescriptions": [ + // "The user can read, write and administer the asset.", + // "The user can read the asset.", + // "The user can read and write the asset." + // ], + // "location": "query", + // "type": "string" + // }, + // "search": { + // "description": "An unstructured search string used to filter the set of results based on asset metadata.", + // "location": "query", + // "type": "string" + // }, + // "tags": { + // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.", + // "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.patch": + +type RasterCollectionsPatchCall struct { + s *Service + id string + rastercollection *RasterCollection + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Mutate a raster collection asset. +func (r *RasterCollectionsService) Patch(id string, rastercollection *RasterCollection) *RasterCollectionsPatchCall { + c := &RasterCollectionsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.rastercollection = rastercollection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsPatchCall) Fields(s ...googleapi.Field) *RasterCollectionsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsPatchCall) Context(ctx context.Context) *RasterCollectionsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.patch" call. +func (c *RasterCollectionsPatchCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Mutate a raster collection asset.", + // "httpMethod": "PATCH", + // "id": "mapsengine.rasterCollections.patch", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the raster collection.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasterCollections/{id}", + // "request": { + // "$ref": "RasterCollection" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasterCollections.process": + +type RasterCollectionsProcessCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Process: Process a raster collection asset. +func (r *RasterCollectionsService) Process(id string) *RasterCollectionsProcessCall { + c := &RasterCollectionsProcessCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsProcessCall) Fields(s ...googleapi.Field) *RasterCollectionsProcessCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsProcessCall) Context(ctx context.Context) *RasterCollectionsProcessCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsProcessCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/process") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.process" call. +// Exactly one of *ProcessResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ProcessResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RasterCollectionsProcessCall) Do() (*ProcessResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProcessResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Process a raster collection asset.", + // "httpMethod": "POST", + // "id": "mapsengine.rasterCollections.process", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the raster collection.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasterCollections/{id}/process", + // "response": { + // "$ref": "ProcessResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasterCollections.parents.list": + +type RasterCollectionsParentsListCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsParentsListCall) Fields(s ...googleapi.Field) *RasterCollectionsParentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RasterCollectionsParentsListCall) IfNoneMatch(entityTag string) *RasterCollectionsParentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsParentsListCall) Context(ctx context.Context) *RasterCollectionsParentsListCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsParentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/parents") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.parents.list" call. +// Exactly one of *ParentsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ParentsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RasterCollectionsParentsListCall) Do() (*ParentsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ParentsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.permissions.batchDelete": + +type RasterCollectionsPermissionsBatchDeleteCall struct { + s *Service + id string + permissionsbatchdeleterequest *PermissionsBatchDeleteRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// BatchDelete: Remove permission entries from an already existing +// asset. +func (r *RasterCollectionsPermissionsService) BatchDelete(id string, permissionsbatchdeleterequest *PermissionsBatchDeleteRequest) *RasterCollectionsPermissionsBatchDeleteCall { + c := &RasterCollectionsPermissionsBatchDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.permissionsbatchdeleterequest = permissionsbatchdeleterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsPermissionsBatchDeleteCall) Fields(s ...googleapi.Field) *RasterCollectionsPermissionsBatchDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsPermissionsBatchDeleteCall) Context(ctx context.Context) *RasterCollectionsPermissionsBatchDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchdeleterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/permissions/batchDelete") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.permissions.batchDelete" call. +// Exactly one of *PermissionsBatchDeleteResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PermissionsBatchDeleteResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RasterCollectionsPermissionsBatchDeleteCall) Do() (*PermissionsBatchDeleteResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsBatchDeleteResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Remove permission entries from an already existing asset.", + // "httpMethod": "POST", + // "id": "mapsengine.rasterCollections.permissions.batchDelete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset from which permissions will be removed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasterCollections/{id}/permissions/batchDelete", + // "request": { + // "$ref": "PermissionsBatchDeleteRequest" + // }, + // "response": { + // "$ref": "PermissionsBatchDeleteResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasterCollections.permissions.batchUpdate": + +type RasterCollectionsPermissionsBatchUpdateCall struct { + s *Service + id string + permissionsbatchupdaterequest *PermissionsBatchUpdateRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// BatchUpdate: Add or update permission entries to an already existing +// asset. +// +// An asset can hold up to 20 different permission entries. Each +// batchInsert request is atomic. +func (r *RasterCollectionsPermissionsService) BatchUpdate(id string, permissionsbatchupdaterequest *PermissionsBatchUpdateRequest) *RasterCollectionsPermissionsBatchUpdateCall { + c := &RasterCollectionsPermissionsBatchUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.permissionsbatchupdaterequest = permissionsbatchupdaterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsPermissionsBatchUpdateCall) Fields(s ...googleapi.Field) *RasterCollectionsPermissionsBatchUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsPermissionsBatchUpdateCall) Context(ctx context.Context) *RasterCollectionsPermissionsBatchUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsPermissionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchupdaterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/permissions/batchUpdate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.permissions.batchUpdate" call. +// Exactly one of *PermissionsBatchUpdateResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PermissionsBatchUpdateResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RasterCollectionsPermissionsBatchUpdateCall) Do() (*PermissionsBatchUpdateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsBatchUpdateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add or update permission entries to an already existing asset.\n\nAn asset can hold up to 20 different permission entries. Each batchInsert request is atomic.", + // "httpMethod": "POST", + // "id": "mapsengine.rasterCollections.permissions.batchUpdate", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset to which permissions will be added.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasterCollections/{id}/permissions/batchUpdate", + // "request": { + // "$ref": "PermissionsBatchUpdateRequest" + // }, + // "response": { + // "$ref": "PermissionsBatchUpdateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasterCollections.permissions.list": + +type RasterCollectionsPermissionsListCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Return all of the permissions for the specified asset. +func (r *RasterCollectionsPermissionsService) List(id string) *RasterCollectionsPermissionsListCall { + c := &RasterCollectionsPermissionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsPermissionsListCall) Fields(s ...googleapi.Field) *RasterCollectionsPermissionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RasterCollectionsPermissionsListCall) IfNoneMatch(entityTag string) *RasterCollectionsPermissionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsPermissionsListCall) Context(ctx context.Context) *RasterCollectionsPermissionsListCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsPermissionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/permissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.permissions.list" call. +// Exactly one of *PermissionsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PermissionsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RasterCollectionsPermissionsListCall) Do() (*PermissionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all of the permissions for the specified asset.", + // "httpMethod": "GET", + // "id": "mapsengine.rasterCollections.permissions.list", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset whose permissions will be listed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasterCollections/{id}/permissions", + // "response": { + // "$ref": "PermissionsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.rasterCollections.rasters.batchDelete": + +type RasterCollectionsRastersBatchDeleteCall struct { + s *Service + id string + rastercollectionsrasterbatchdeleterequest *RasterCollectionsRasterBatchDeleteRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// BatchDelete: Remove rasters from an existing raster collection. +// +// Up to 50 rasters can be included in a single batchDelete request. +// Each batchDelete request is atomic. +func (r *RasterCollectionsRastersService) BatchDelete(id string, rastercollectionsrasterbatchdeleterequest *RasterCollectionsRasterBatchDeleteRequest) *RasterCollectionsRastersBatchDeleteCall { + c := &RasterCollectionsRastersBatchDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.rastercollectionsrasterbatchdeleterequest = rastercollectionsrasterbatchdeleterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsRastersBatchDeleteCall) Fields(s ...googleapi.Field) *RasterCollectionsRastersBatchDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsRastersBatchDeleteCall) Context(ctx context.Context) *RasterCollectionsRastersBatchDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsRastersBatchDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.rastercollectionsrasterbatchdeleterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/rasters/batchDelete") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.rasters.batchDelete" call. +// Exactly one of *RasterCollectionsRastersBatchDeleteResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *RasterCollectionsRastersBatchDeleteResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *RasterCollectionsRastersBatchDeleteCall) Do() (*RasterCollectionsRastersBatchDeleteResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RasterCollectionsRastersBatchDeleteResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Remove rasters from an existing raster collection.\n\nUp to 50 rasters can be included in a single batchDelete request. Each batchDelete request is atomic.", + // "httpMethod": "POST", + // "id": "mapsengine.rasterCollections.rasters.batchDelete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the raster collection to which these rasters belong.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasterCollections/{id}/rasters/batchDelete", + // "request": { + // "$ref": "RasterCollectionsRasterBatchDeleteRequest" + // }, + // "response": { + // "$ref": "RasterCollectionsRastersBatchDeleteResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasterCollections.rasters.batchInsert": + +type RasterCollectionsRastersBatchInsertCall struct { + s *Service + id string + rastercollectionsrastersbatchinsertrequest *RasterCollectionsRastersBatchInsertRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// BatchInsert: Add rasters to an existing raster collection. Rasters +// must be successfully processed in order to be added to a raster +// collection. +// +// Up to 50 rasters can be included in a single batchInsert request. +// Each batchInsert request is atomic. +func (r *RasterCollectionsRastersService) BatchInsert(id string, rastercollectionsrastersbatchinsertrequest *RasterCollectionsRastersBatchInsertRequest) *RasterCollectionsRastersBatchInsertCall { + c := &RasterCollectionsRastersBatchInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.rastercollectionsrastersbatchinsertrequest = rastercollectionsrastersbatchinsertrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsRastersBatchInsertCall) Fields(s ...googleapi.Field) *RasterCollectionsRastersBatchInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsRastersBatchInsertCall) Context(ctx context.Context) *RasterCollectionsRastersBatchInsertCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsRastersBatchInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.rastercollectionsrastersbatchinsertrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/rasters/batchInsert") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.rasters.batchInsert" call. +// Exactly one of *RasterCollectionsRastersBatchInsertResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *RasterCollectionsRastersBatchInsertResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *RasterCollectionsRastersBatchInsertCall) Do() (*RasterCollectionsRastersBatchInsertResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RasterCollectionsRastersBatchInsertResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add rasters to an existing raster collection. Rasters must be successfully processed in order to be added to a raster collection.\n\nUp to 50 rasters can be included in a single batchInsert request. Each batchInsert request is atomic.", + // "httpMethod": "POST", + // "id": "mapsengine.rasterCollections.rasters.batchInsert", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the raster collection to which these rasters belong.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasterCollections/{id}/rasters/batchInsert", + // "request": { + // "$ref": "RasterCollectionsRastersBatchInsertRequest" + // }, + // "response": { + // "$ref": "RasterCollectionsRastersBatchInsertResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasterCollections.rasters.list": + +type RasterCollectionsRastersListCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Role sets the optional parameter "role": The role parameter indicates +// that the response should only contain assets where the current user +// has the specified level of access. +// +// Possible values: +// "owner" - The user can read, write and administer the asset. +// "reader" - The user can read the asset. +// "writer" - The user can read and write the asset. +func (c *RasterCollectionsRastersListCall) Role(role string) *RasterCollectionsRastersListCall { + c.opt_["role"] = role + return c +} + +// Search sets the optional parameter "search": An unstructured search +// string used to filter the set of results based on asset metadata. +func (c *RasterCollectionsRastersListCall) Search(search string) *RasterCollectionsRastersListCall { + c.opt_["search"] = search + return c +} + +// Tags sets the optional parameter "tags": A comma separated list of +// tags. Returned assets will contain all the tags from the list. +func (c *RasterCollectionsRastersListCall) Tags(tags string) *RasterCollectionsRastersListCall { + c.opt_["tags"] = tags + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsRastersListCall) Fields(s ...googleapi.Field) *RasterCollectionsRastersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RasterCollectionsRastersListCall) IfNoneMatch(entityTag string) *RasterCollectionsRastersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsRastersListCall) Context(ctx context.Context) *RasterCollectionsRastersListCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsRastersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["role"]; ok { + params.Set("role", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["search"]; ok { + params.Set("search", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["tags"]; ok { + params.Set("tags", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/rasters") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.rasters.list" call. +// Exactly one of *RasterCollectionsRastersListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *RasterCollectionsRastersListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *RasterCollectionsRastersListCall) Do() (*RasterCollectionsRastersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RasterCollectionsRastersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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" + // }, + // "role": { + // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.", + // "enum": [ + // "owner", + // "reader", + // "writer" + // ], + // "enumDescriptions": [ + // "The user can read, write and administer the asset.", + // "The user can read the asset.", + // "The user can read and write the asset." + // ], + // "location": "query", + // "type": "string" + // }, + // "search": { + // "description": "An unstructured search string used to filter the set of results based on asset metadata.", + // "location": "query", + // "type": "string" + // }, + // "tags": { + // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "rasterCollections/{id}/rasters", + // "response": { + // "$ref": "RasterCollectionsRastersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.rasters.delete": + +type RastersDeleteCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Delete a raster. +func (r *RastersService) Delete(id string) *RastersDeleteCall { + c := &RastersDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RastersDeleteCall) Fields(s ...googleapi.Field) *RastersDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RastersDeleteCall) Context(ctx context.Context) *RastersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *RastersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasters.delete" call. +func (c *RastersDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a raster.", + // "httpMethod": "DELETE", + // "id": "mapsengine.rasters.delete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the raster. Only the raster creator or project owner are permitted to delete. If the raster is included in a layer or mosaic, the request will fail. Remove it from all parents prior to deleting.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasters/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasters.get": + +type RastersGetCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RastersGetCall) Fields(s ...googleapi.Field) *RastersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RastersGetCall) IfNoneMatch(entityTag string) *RastersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RastersGetCall) Context(ctx context.Context) *RastersGetCall { + c.ctx_ = ctx + return c +} + +func (c *RastersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasters.get" call. +// Exactly one of *Raster or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Raster.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *RastersGetCall) Do() (*Raster, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Raster{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Raster" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.rasters.list": + +type RastersListCall struct { + s *Service + projectId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Return all rasters readable by the current user. +func (r *RastersService) List(projectId string) *RastersListCall { + c := &RastersListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + 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 *RastersListCall) Bbox(bbox string) *RastersListCall { + 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 *RastersListCall) CreatedAfter(createdAfter string) *RastersListCall { + 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 *RastersListCall) CreatedBefore(createdBefore string) *RastersListCall { + 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 *RastersListCall) CreatorEmail(creatorEmail string) *RastersListCall { + 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 *RastersListCall) MaxResults(maxResults int64) *RastersListCall { + 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 *RastersListCall) ModifiedAfter(modifiedAfter string) *RastersListCall { + 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 *RastersListCall) ModifiedBefore(modifiedBefore string) *RastersListCall { + 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 *RastersListCall) PageToken(pageToken string) *RastersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// ProcessingStatus sets the optional parameter "processingStatus": +// +// Possible values: +// "complete" - The raster has completed processing. +// "failed" - The raster has failed processing. +// "notReady" - The raster is not ready for processing. +// "processing" - The raster is processing. +// "ready" - The raster is ready for processing. +func (c *RastersListCall) ProcessingStatus(processingStatus string) *RastersListCall { + c.opt_["processingStatus"] = processingStatus + return c +} + +// Role sets the optional parameter "role": The role parameter indicates +// that the response should only contain assets where the current user +// has the specified level of access. +// +// Possible values: +// "owner" - The user can read, write and administer the asset. +// "reader" - The user can read the asset. +// "writer" - The user can read and write the asset. +func (c *RastersListCall) Role(role string) *RastersListCall { + c.opt_["role"] = role + return c +} + +// Search sets the optional parameter "search": An unstructured search +// string used to filter the set of results based on asset metadata. +func (c *RastersListCall) Search(search string) *RastersListCall { + c.opt_["search"] = search + return c +} + +// Tags sets the optional parameter "tags": A comma separated list of +// tags. Returned assets will contain all the tags from the list. +func (c *RastersListCall) Tags(tags string) *RastersListCall { + c.opt_["tags"] = tags + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RastersListCall) Fields(s ...googleapi.Field) *RastersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RastersListCall) IfNoneMatch(entityTag string) *RastersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RastersListCall) Context(ctx context.Context) *RastersListCall { + c.ctx_ = ctx + return c +} + +func (c *RastersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("projectId", fmt.Sprintf("%v", c.projectId)) + 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_["processingStatus"]; ok { + params.Set("processingStatus", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["role"]; ok { + params.Set("role", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["search"]; ok { + params.Set("search", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["tags"]; ok { + params.Set("tags", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasters") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasters.list" call. +// Exactly one of *RastersListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *RastersListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RastersListCall) Do() (*RastersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RastersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all rasters readable by the current user.", + // "httpMethod": "GET", + // "id": "mapsengine.rasters.list", + // "parameterOrder": [ + // "projectId" + // ], + // "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" + // }, + // "processingStatus": { + // "enum": [ + // "complete", + // "failed", + // "notReady", + // "processing", + // "ready" + // ], + // "enumDescriptions": [ + // "The raster has completed processing.", + // "The raster has failed processing.", + // "The raster is not ready for processing.", + // "The raster is processing.", + // "The raster is ready for processing." + // ], + // "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", + // "required": true, + // "type": "string" + // }, + // "role": { + // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.", + // "enum": [ + // "owner", + // "reader", + // "writer" + // ], + // "enumDescriptions": [ + // "The user can read, write and administer the asset.", + // "The user can read the asset.", + // "The user can read and write the asset." + // ], + // "location": "query", + // "type": "string" + // }, + // "search": { + // "description": "An unstructured search string used to filter the set of results based on asset metadata.", + // "location": "query", + // "type": "string" + // }, + // "tags": { + // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "rasters", + // "response": { + // "$ref": "RastersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.rasters.patch": + +type RastersPatchCall struct { + s *Service + id string + raster *Raster + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Mutate a raster asset. +func (r *RastersService) Patch(id string, raster *Raster) *RastersPatchCall { + c := &RastersPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.raster = raster + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RastersPatchCall) Fields(s ...googleapi.Field) *RastersPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RastersPatchCall) Context(ctx context.Context) *RastersPatchCall { + c.ctx_ = ctx + return c +} + +func (c *RastersPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.raster) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasters.patch" call. +func (c *RastersPatchCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Mutate a raster asset.", + // "httpMethod": "PATCH", + // "id": "mapsengine.rasters.patch", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the raster.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasters/{id}", + // "request": { + // "$ref": "Raster" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasters.process": + +type RastersProcessCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Process: Process a raster asset. +func (r *RastersService) Process(id string) *RastersProcessCall { + c := &RastersProcessCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RastersProcessCall) Fields(s ...googleapi.Field) *RastersProcessCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RastersProcessCall) Context(ctx context.Context) *RastersProcessCall { + c.ctx_ = ctx + return c +} + +func (c *RastersProcessCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}/process") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasters.process" call. +// Exactly one of *ProcessResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ProcessResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RastersProcessCall) Do() (*ProcessResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProcessResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Process a raster asset.", + // "httpMethod": "POST", + // "id": "mapsengine.rasters.process", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the raster.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasters/{id}/process", + // "response": { + // "$ref": "ProcessResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasters.upload": + +type RastersUploadCall struct { + s *Service + raster *Raster + opt_ map[string]interface{} + ctx_ context.Context +} + +// Upload: Create a skeleton raster asset for upload. +func (r *RastersService) Upload(raster *Raster) *RastersUploadCall { + c := &RastersUploadCall{s: r.s, opt_: make(map[string]interface{})} + c.raster = raster + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RastersUploadCall) Fields(s ...googleapi.Field) *RastersUploadCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RastersUploadCall) Context(ctx context.Context) *RastersUploadCall { + c.ctx_ = ctx + return c +} + +func (c *RastersUploadCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.raster) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasters.upload" call. +// Exactly one of *Raster or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Raster.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *RastersUploadCall) Do() (*Raster, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Raster{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a skeleton raster asset for upload.", + // "httpMethod": "POST", + // "id": "mapsengine.rasters.upload", + // "path": "rasters/upload", + // "request": { + // "$ref": "Raster" + // }, + // "response": { + // "$ref": "Raster" + // }, + // "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 + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// 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 +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *RastersFilesInsertCall) Media(r io.Reader) *RastersFilesInsertCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *RastersFilesInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *RastersFilesInsertCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *RastersFilesInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *RastersFilesInsertCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RastersFilesInsertCall) Fields(s ...googleapi.Field) *RastersFilesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *RastersFilesInsertCall) Context(ctx context.Context) *RastersFilesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *RastersFilesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("filename", fmt.Sprintf("%v", c.filename)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}/files") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + body = new(bytes.Buffer) + ctype := "application/json" + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasters.files.insert" call. +func (c *RastersFilesInsertCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return err + } + defer res.Body.Close() + } + return nil + // { + // "description": "Upload a file to a raster asset.", + // "httpMethod": "POST", + // "id": "mapsengine.rasters.files.insert", + // "mediaUpload": { + // "accept": [ + // "*/*" + // ], + // "maxSize": "10GB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/mapsengine/exp2/rasters/{id}/files" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/mapsengine/exp2/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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RastersParentsListCall) Fields(s ...googleapi.Field) *RastersParentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RastersParentsListCall) IfNoneMatch(entityTag string) *RastersParentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RastersParentsListCall) Context(ctx context.Context) *RastersParentsListCall { + c.ctx_ = ctx + return c +} + +func (c *RastersParentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}/parents") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasters.parents.list" call. +// Exactly one of *ParentsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ParentsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RastersParentsListCall) Do() (*ParentsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ParentsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.rasters.permissions.batchDelete": + +type RastersPermissionsBatchDeleteCall struct { + s *Service + id string + permissionsbatchdeleterequest *PermissionsBatchDeleteRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// BatchDelete: Remove permission entries from an already existing +// asset. +func (r *RastersPermissionsService) BatchDelete(id string, permissionsbatchdeleterequest *PermissionsBatchDeleteRequest) *RastersPermissionsBatchDeleteCall { + c := &RastersPermissionsBatchDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.permissionsbatchdeleterequest = permissionsbatchdeleterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RastersPermissionsBatchDeleteCall) Fields(s ...googleapi.Field) *RastersPermissionsBatchDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RastersPermissionsBatchDeleteCall) Context(ctx context.Context) *RastersPermissionsBatchDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *RastersPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchdeleterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}/permissions/batchDelete") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasters.permissions.batchDelete" call. +// Exactly one of *PermissionsBatchDeleteResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PermissionsBatchDeleteResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RastersPermissionsBatchDeleteCall) Do() (*PermissionsBatchDeleteResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsBatchDeleteResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Remove permission entries from an already existing asset.", + // "httpMethod": "POST", + // "id": "mapsengine.rasters.permissions.batchDelete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset from which permissions will be removed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasters/{id}/permissions/batchDelete", + // "request": { + // "$ref": "PermissionsBatchDeleteRequest" + // }, + // "response": { + // "$ref": "PermissionsBatchDeleteResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasters.permissions.batchUpdate": + +type RastersPermissionsBatchUpdateCall struct { + s *Service + id string + permissionsbatchupdaterequest *PermissionsBatchUpdateRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// BatchUpdate: Add or update permission entries to an already existing +// asset. +// +// An asset can hold up to 20 different permission entries. Each +// batchInsert request is atomic. +func (r *RastersPermissionsService) BatchUpdate(id string, permissionsbatchupdaterequest *PermissionsBatchUpdateRequest) *RastersPermissionsBatchUpdateCall { + c := &RastersPermissionsBatchUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.permissionsbatchupdaterequest = permissionsbatchupdaterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RastersPermissionsBatchUpdateCall) Fields(s ...googleapi.Field) *RastersPermissionsBatchUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RastersPermissionsBatchUpdateCall) Context(ctx context.Context) *RastersPermissionsBatchUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *RastersPermissionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchupdaterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}/permissions/batchUpdate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasters.permissions.batchUpdate" call. +// Exactly one of *PermissionsBatchUpdateResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PermissionsBatchUpdateResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RastersPermissionsBatchUpdateCall) Do() (*PermissionsBatchUpdateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsBatchUpdateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add or update permission entries to an already existing asset.\n\nAn asset can hold up to 20 different permission entries. Each batchInsert request is atomic.", + // "httpMethod": "POST", + // "id": "mapsengine.rasters.permissions.batchUpdate", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset to which permissions will be added.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasters/{id}/permissions/batchUpdate", + // "request": { + // "$ref": "PermissionsBatchUpdateRequest" + // }, + // "response": { + // "$ref": "PermissionsBatchUpdateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasters.permissions.list": + +type RastersPermissionsListCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Return all of the permissions for the specified asset. +func (r *RastersPermissionsService) List(id string) *RastersPermissionsListCall { + c := &RastersPermissionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RastersPermissionsListCall) Fields(s ...googleapi.Field) *RastersPermissionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RastersPermissionsListCall) IfNoneMatch(entityTag string) *RastersPermissionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RastersPermissionsListCall) Context(ctx context.Context) *RastersPermissionsListCall { + c.ctx_ = ctx + return c +} + +func (c *RastersPermissionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}/permissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasters.permissions.list" call. +// Exactly one of *PermissionsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PermissionsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RastersPermissionsListCall) Do() (*PermissionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all of the permissions for the specified asset.", + // "httpMethod": "GET", + // "id": "mapsengine.rasters.permissions.list", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset whose permissions will be listed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasters/{id}/permissions", + // "response": { + // "$ref": "PermissionsListResponse" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesCreateCall) Fields(s ...googleapi.Field) *TablesCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesCreateCall) Context(ctx context.Context) *TablesCreateCall { + c.ctx_ = ctx + return c +} + +func (c *TablesCreateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.create" call. +// Exactly one of *Table or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Table.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TablesCreateCall) Do() (*Table, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Table{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.delete": + +type TablesDeleteCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Delete a table. +func (r *TablesService) Delete(id string) *TablesDeleteCall { + c := &TablesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesDeleteCall) Fields(s ...googleapi.Field) *TablesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesDeleteCall) Context(ctx context.Context) *TablesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TablesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.delete" call. +func (c *TablesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a table.", + // "httpMethod": "DELETE", + // "id": "mapsengine.tables.delete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the table. Only the table creator or project owner are permitted to delete. If the table is included in a layer, the request will fail. Remove it from all layers prior to deleting.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.tables.get": + +type TablesGetCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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": +// +// Possible values: +// "draft" - The draft version. +// "published" - The published version. +func (c *TablesGetCall) Version(version string) *TablesGetCall { + c.opt_["version"] = version + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesGetCall) Fields(s ...googleapi.Field) *TablesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TablesGetCall) IfNoneMatch(entityTag string) *TablesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesGetCall) Context(ctx context.Context) *TablesGetCall { + c.ctx_ = ctx + return c +} + +func (c *TablesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["version"]; ok { + params.Set("version", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.get" call. +// Exactly one of *Table or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Table.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TablesGetCall) Do() (*Table, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Table{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// ProcessingStatus sets the optional parameter "processingStatus": +// +// Possible values: +// "complete" - The table has completed processing. +// "failed" - The table has failed processing. +// "notReady" - The table is not ready for processing. +// "processing" - The table is processing. +// "ready" - The table is ready for processing. +func (c *TablesListCall) ProcessingStatus(processingStatus string) *TablesListCall { + c.opt_["processingStatus"] = processingStatus + 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 +} + +// Role sets the optional parameter "role": The role parameter indicates +// that the response should only contain assets where the current user +// has the specified level of access. +// +// Possible values: +// "owner" - The user can read, write and administer the asset. +// "reader" - The user can read the asset. +// "writer" - The user can read and write the asset. +func (c *TablesListCall) Role(role string) *TablesListCall { + c.opt_["role"] = role + return c +} + +// Search sets the optional parameter "search": An unstructured search +// string used to filter the set of results based on asset metadata. +func (c *TablesListCall) Search(search string) *TablesListCall { + c.opt_["search"] = search + return c +} + +// Tags sets the optional parameter "tags": A comma separated list of +// tags. Returned assets will contain all the tags from the list. +func (c *TablesListCall) Tags(tags string) *TablesListCall { + c.opt_["tags"] = tags + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesListCall) Fields(s ...googleapi.Field) *TablesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TablesListCall) IfNoneMatch(entityTag string) *TablesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesListCall) Context(ctx context.Context) *TablesListCall { + c.ctx_ = ctx + return c +} + +func (c *TablesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["processingStatus"]; ok { + params.Set("processingStatus", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projectId"]; ok { + params.Set("projectId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["role"]; ok { + params.Set("role", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["search"]; ok { + params.Set("search", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["tags"]; ok { + params.Set("tags", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.list" call. +// Exactly one of *TablesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TablesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TablesListCall) Do() (*TablesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TablesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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" + // }, + // "processingStatus": { + // "enum": [ + // "complete", + // "failed", + // "notReady", + // "processing", + // "ready" + // ], + // "enumDescriptions": [ + // "The table has completed processing.", + // "The table has failed processing.", + // "The table is not ready for processing.", + // "The table is processing.", + // "The table is ready for processing." + // ], + // "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" + // }, + // "role": { + // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.", + // "enum": [ + // "owner", + // "reader", + // "writer" + // ], + // "enumDescriptions": [ + // "The user can read, write and administer the asset.", + // "The user can read the asset.", + // "The user can read and write the asset." + // ], + // "location": "query", + // "type": "string" + // }, + // "search": { + // "description": "An unstructured search string used to filter the set of results based on asset metadata.", + // "location": "query", + // "type": "string" + // }, + // "tags": { + // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.", + // "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.patch": + +type TablesPatchCall struct { + s *Service + id string + table *Table + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Mutate a table asset. +func (r *TablesService) Patch(id string, table *Table) *TablesPatchCall { + c := &TablesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.table = table + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesPatchCall) Fields(s ...googleapi.Field) *TablesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesPatchCall) Context(ctx context.Context) *TablesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *TablesPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.patch" call. +func (c *TablesPatchCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Mutate a table asset.", + // "httpMethod": "PATCH", + // "id": "mapsengine.tables.patch", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the table.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{id}", + // "request": { + // "$ref": "Table" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.tables.process": + +type TablesProcessCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Process: Process a table asset. +func (r *TablesService) Process(id string) *TablesProcessCall { + c := &TablesProcessCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesProcessCall) Fields(s ...googleapi.Field) *TablesProcessCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesProcessCall) Context(ctx context.Context) *TablesProcessCall { + c.ctx_ = ctx + return c +} + +func (c *TablesProcessCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/process") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.process" call. +// Exactly one of *ProcessResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ProcessResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TablesProcessCall) Do() (*ProcessResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProcessResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Process a table asset.", + // "httpMethod": "POST", + // "id": "mapsengine.tables.process", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the table.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{id}/process", + // "response": { + // "$ref": "ProcessResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.tables.upload": + +type TablesUploadCall struct { + s *Service + table *Table + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesUploadCall) Fields(s ...googleapi.Field) *TablesUploadCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesUploadCall) Context(ctx context.Context) *TablesUploadCall { + c.ctx_ = ctx + return c +} + +func (c *TablesUploadCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.upload" call. +// Exactly one of *Table or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Table.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TablesUploadCall) Do() (*Table, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Table{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesFeaturesBatchDeleteCall) Fields(s ...googleapi.Field) *TablesFeaturesBatchDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesFeaturesBatchDeleteCall) Context(ctx context.Context) *TablesFeaturesBatchDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TablesFeaturesBatchDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.featuresbatchdeleterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/features/batchDelete") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.features.batchDelete" call. +func (c *TablesFeaturesBatchDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesFeaturesBatchInsertCall) Fields(s ...googleapi.Field) *TablesFeaturesBatchInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesFeaturesBatchInsertCall) Context(ctx context.Context) *TablesFeaturesBatchInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TablesFeaturesBatchInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.featuresbatchinsertrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/features/batchInsert") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.features.batchInsert" call. +func (c *TablesFeaturesBatchInsertCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesFeaturesBatchPatchCall) Fields(s ...googleapi.Field) *TablesFeaturesBatchPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesFeaturesBatchPatchCall) Context(ctx context.Context) *TablesFeaturesBatchPatchCall { + c.ctx_ = ctx + return c +} + +func (c *TablesFeaturesBatchPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.featuresbatchpatchrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/features/batchPatch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.features.batchPatch" call. +func (c *TablesFeaturesBatchPatchCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "draft" - The draft version. +// "published" - The published version. +func (c *TablesFeaturesGetCall) Version(version string) *TablesFeaturesGetCall { + c.opt_["version"] = version + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesFeaturesGetCall) Fields(s ...googleapi.Field) *TablesFeaturesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TablesFeaturesGetCall) IfNoneMatch(entityTag string) *TablesFeaturesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesFeaturesGetCall) Context(ctx context.Context) *TablesFeaturesGetCall { + c.ctx_ = ctx + return c +} + +func (c *TablesFeaturesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/features/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.features.get" call. +// Exactly one of *Feature or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Feature.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TablesFeaturesGetCall) Do() (*Feature, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Feature{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. The +// maximum supported value is 1000. +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. +// +// Possible values: +// "draft" - The draft version. +// "published" - The published version. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesFeaturesListCall) Fields(s ...googleapi.Field) *TablesFeaturesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TablesFeaturesListCall) IfNoneMatch(entityTag string) *TablesFeaturesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesFeaturesListCall) Context(ctx context.Context) *TablesFeaturesListCall { + c.ctx_ = ctx + return c +} + +func (c *TablesFeaturesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/features") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.features.list" call. +// Exactly one of *FeaturesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FeaturesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TablesFeaturesListCall) Do() (*FeaturesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FeaturesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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. The maximum supported value is 1000.", + // "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 + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// 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 +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *TablesFilesInsertCall) Media(r io.Reader) *TablesFilesInsertCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *TablesFilesInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *TablesFilesInsertCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *TablesFilesInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *TablesFilesInsertCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesFilesInsertCall) Fields(s ...googleapi.Field) *TablesFilesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *TablesFilesInsertCall) Context(ctx context.Context) *TablesFilesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TablesFilesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("filename", fmt.Sprintf("%v", c.filename)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/files") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + body = new(bytes.Buffer) + ctype := "application/json" + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.files.insert" call. +func (c *TablesFilesInsertCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return err + } + defer res.Body.Close() + } + return nil + // { + // "description": "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/exp2/tables/{id}/files" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/mapsengine/exp2/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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesParentsListCall) Fields(s ...googleapi.Field) *TablesParentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TablesParentsListCall) IfNoneMatch(entityTag string) *TablesParentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesParentsListCall) Context(ctx context.Context) *TablesParentsListCall { + c.ctx_ = ctx + return c +} + +func (c *TablesParentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/parents") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.parents.list" call. +// Exactly one of *ParentsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ParentsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TablesParentsListCall) Do() (*ParentsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ParentsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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" + // ] + // } + +} + +// method id "mapsengine.tables.permissions.batchDelete": + +type TablesPermissionsBatchDeleteCall struct { + s *Service + id string + permissionsbatchdeleterequest *PermissionsBatchDeleteRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// BatchDelete: Remove permission entries from an already existing +// asset. +func (r *TablesPermissionsService) BatchDelete(id string, permissionsbatchdeleterequest *PermissionsBatchDeleteRequest) *TablesPermissionsBatchDeleteCall { + c := &TablesPermissionsBatchDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.permissionsbatchdeleterequest = permissionsbatchdeleterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesPermissionsBatchDeleteCall) Fields(s ...googleapi.Field) *TablesPermissionsBatchDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesPermissionsBatchDeleteCall) Context(ctx context.Context) *TablesPermissionsBatchDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TablesPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchdeleterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/permissions/batchDelete") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.permissions.batchDelete" call. +// Exactly one of *PermissionsBatchDeleteResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PermissionsBatchDeleteResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TablesPermissionsBatchDeleteCall) Do() (*PermissionsBatchDeleteResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsBatchDeleteResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Remove permission entries from an already existing asset.", + // "httpMethod": "POST", + // "id": "mapsengine.tables.permissions.batchDelete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset from which permissions will be removed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{id}/permissions/batchDelete", + // "request": { + // "$ref": "PermissionsBatchDeleteRequest" + // }, + // "response": { + // "$ref": "PermissionsBatchDeleteResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.tables.permissions.batchUpdate": + +type TablesPermissionsBatchUpdateCall struct { + s *Service + id string + permissionsbatchupdaterequest *PermissionsBatchUpdateRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// BatchUpdate: Add or update permission entries to an already existing +// asset. +// +// An asset can hold up to 20 different permission entries. Each +// batchInsert request is atomic. +func (r *TablesPermissionsService) BatchUpdate(id string, permissionsbatchupdaterequest *PermissionsBatchUpdateRequest) *TablesPermissionsBatchUpdateCall { + c := &TablesPermissionsBatchUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.permissionsbatchupdaterequest = permissionsbatchupdaterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesPermissionsBatchUpdateCall) Fields(s ...googleapi.Field) *TablesPermissionsBatchUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesPermissionsBatchUpdateCall) Context(ctx context.Context) *TablesPermissionsBatchUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *TablesPermissionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchupdaterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/permissions/batchUpdate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.permissions.batchUpdate" call. +// Exactly one of *PermissionsBatchUpdateResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PermissionsBatchUpdateResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TablesPermissionsBatchUpdateCall) Do() (*PermissionsBatchUpdateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsBatchUpdateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add or update permission entries to an already existing asset.\n\nAn asset can hold up to 20 different permission entries. Each batchInsert request is atomic.", + // "httpMethod": "POST", + // "id": "mapsengine.tables.permissions.batchUpdate", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset to which permissions will be added.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{id}/permissions/batchUpdate", + // "request": { + // "$ref": "PermissionsBatchUpdateRequest" + // }, + // "response": { + // "$ref": "PermissionsBatchUpdateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.tables.permissions.list": + +type TablesPermissionsListCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Return all of the permissions for the specified asset. +func (r *TablesPermissionsService) List(id string) *TablesPermissionsListCall { + c := &TablesPermissionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesPermissionsListCall) Fields(s ...googleapi.Field) *TablesPermissionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TablesPermissionsListCall) IfNoneMatch(entityTag string) *TablesPermissionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesPermissionsListCall) Context(ctx context.Context) *TablesPermissionsListCall { + c.ctx_ = ctx + return c +} + +func (c *TablesPermissionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/permissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.permissions.list" call. +// Exactly one of *PermissionsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PermissionsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TablesPermissionsListCall) Do() (*PermissionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all of the permissions for the specified asset.", + // "httpMethod": "GET", + // "id": "mapsengine.tables.permissions.list", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset whose permissions will be listed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{id}/permissions", + // "response": { + // "$ref": "PermissionsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/mapsengine/v1/mapsengine-api.json b/Godeps/_workspace/src/google.golang.org/api/mapsengine/v1/mapsengine-api.json new file mode 100644 index 000000000..864791d22 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/mapsengine/v1/mapsengine-api.json @@ -0,0 +1,5352 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/xRQmfo4WYHt7ESOziu0ToVNCLZc\"", + "discoveryVersion": "v1", + "id": "mapsengine:v1", + "name": "mapsengine", + "canonicalName": "Maps Engine", + "version": "v1", + "revision": "20150120", + "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": "https://www.google.com/images/icons/product/maps_engine-16.png", + "x32": "https://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 My Maps data" + }, + "https://www.googleapis.com/auth/mapsengine.readonly": { + "description": "View your Google My Maps 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.", + "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" + } + } + }, + "Asset": { + "id": "Asset", + "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": "A rectangular bounding box which contains all of the data in this asset. The box is expressed as \\\"west, south, east, north\\\". 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" + }, + "creatorEmail": { + "type": "string", + "description": "The email address of the creator of this asset. This is only returned on GET requests and not LIST requests." + }, + "description": { + "type": "string", + "description": "The asset's description." + }, + "etag": { + "type": "string", + "description": "The ETag, used to refer to the current version of the asset." + }, + "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" + }, + "lastModifierEmail": { + "type": "string", + "description": "The email address of the last modifier of this asset. This is only returned on GET requests and not LIST requests." + }, + "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": [ + "", + "", + "", + "", + "" + ] + }, + "writersCanEditPermissions": { + "type": "boolean", + "description": "If true, WRITERs of the asset are able to edit the asset permissions." + } + } + }, + "AssetsListResponse": { + "id": "AssetsListResponse", + "type": "object", + "description": "The response returned by a call to resources.List.", + "properties": { + "assets": { + "type": "array", + "description": "Assets returned.", + "items": { + "$ref": "Asset" + } + }, + "nextPageToken": { + "type": "string", + "description": "Next page token.", + "format": "byte" + } + } + }, + "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", + "mapsengine.layers.patch" + ] + } + }, + "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", + "mapsengine.layers.patch" + ] + } + } + } + }, + "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", + "mapsengine.layers.patch" + ] + } + }, + "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." + } + } + }, + "Datasources": { + "id": "Datasources", + "type": "array", + "items": { + "$ref": "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", + "mapsengine.layers.patch" + ] + } + } + } + }, + "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" + } + }, + "normalizeGeometries": { + "type": "boolean", + "description": "If true, the server will normalize feature geometries. It is assumed that the South Pole is exterior to any polygons given. See here for a list of normalizations. If false, all feature geometries must be given already normalized. The points in all LinearRings must be listed in counter-clockwise order, and LinearRings may not intersect.", + "default": "true" + } + } + }, + "FeaturesBatchPatchRequest": { + "id": "FeaturesBatchPatchRequest", + "type": "object", + "description": "The request sent to features.BatchPatch.", + "properties": { + "features": { + "type": "array", + "items": { + "$ref": "Feature" + } + }, + "normalizeGeometries": { + "type": "boolean", + "description": "If true, the server will normalize feature geometries. It is assumed that the South Pole is exterior to any polygons given. See here for a list of normalizations. If false, all feature geometries must be given already normalized. The points in all LinearRings must be listed in counter-clockwise order, and LinearRings may not intersect.", + "default": "true" + } + } + }, + "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", + "mapsengine.layers.patch" + ] + } + }, + "operator": { + "type": "string", + "description": "Operation used to evaluate the filter.", + "enum": [ + "!=", + "\u003c", + "\u003c=", + "==", + "\u003e", + "\u003e=", + "contains", + "endsWith", + "startsWith" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "annotations": { + "required": [ + "mapsengine.layers.create", + "mapsengine.layers.patch" + ] + } + }, + "value": { + "type": "any", + "description": "Value to be evaluated against attribute.", + "annotations": { + "required": [ + "mapsengine.layers.create", + "mapsengine.layers.patch" + ] + } + } + } + }, + "GeoJsonGeometry": { + "id": "GeoJsonGeometry", + "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": "A heterogenous collection of GeoJsonGeometry objects.", + "properties": { + "geometries": { + "type": "array", + "description": "An array of geometry objects. There must be at least 2 different types of geometries in the array.", + "items": { + "$ref": "GeoJsonGeometry" + } + }, + "type": { + "type": "string", + "description": "Identifies this object as a GeoJsonGeometryCollection.", + "enum": [ + "GeometryCollection" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "GeoJsonLineString": { + "id": "GeoJsonLineString", + "type": "object", + "properties": { + "coordinates": { + "type": "array", + "description": "An array of two or more positions, representing a line.", + "items": { + "$ref": "GeoJsonPosition" + } + }, + "type": { + "type": "string", + "description": "Identifies this object as a GeoJsonLineString.", + "enum": [ + "LineString" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "GeoJsonMultiLineString": { + "id": "GeoJsonMultiLineString", + "type": "object", + "description": "Multi Line String", + "properties": { + "coordinates": { + "type": "array", + "description": "An array of at least two GeoJsonLineString coordinate arrays.", + "items": { + "type": "array", + "items": { + "$ref": "GeoJsonPosition" + } + } + }, + "type": { + "type": "string", + "description": "Identifies this object as a GeoJsonMultiLineString.", + "enum": [ + "MultiLineString" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "GeoJsonMultiPoint": { + "id": "GeoJsonMultiPoint", + "type": "object", + "properties": { + "coordinates": { + "type": "array", + "description": "An array of at least two GeoJsonPoint coordinate arrays.", + "items": { + "$ref": "GeoJsonPosition" + } + }, + "type": { + "type": "string", + "description": "Identifies this object as a GeoJsonMultiPoint.", + "enum": [ + "MultiPoint" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "GeoJsonMultiPolygon": { + "id": "GeoJsonMultiPolygon", + "type": "object", + "properties": { + "coordinates": { + "type": "array", + "description": "An array of at least two GeoJsonPolygon coordinate arrays.", + "items": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "GeoJsonPosition" + } + } + } + }, + "type": { + "type": "string", + "description": "Identifies this object as a GeoJsonMultiPolygon.", + "enum": [ + "MultiPolygon" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "GeoJsonPoint": { + "id": "GeoJsonPoint", + "type": "object", + "properties": { + "coordinates": { + "$ref": "GeoJsonPosition", + "description": "A single GeoJsonPosition, specifying the location of the point." + }, + "type": { + "type": "string", + "description": "Identifies this object as a GeoJsonPoint.", + "enum": [ + "Point" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "GeoJsonPolygon": { + "id": "GeoJsonPolygon", + "type": "object", + "properties": { + "coordinates": { + "type": "array", + "description": "An array of LinearRings. A LinearRing is a GeoJsonLineString which is closed (that is, the first and last GeoJsonPositions are equal), and which contains at least four GeoJsonPositions. For polygons with multiple rings, the first LinearRing is the exterior ring, and any subsequent rings are interior rings (that is, holes).", + "items": { + "type": "array", + "items": { + "$ref": "GeoJsonPosition" + } + } + }, + "type": { + "type": "string", + "description": "Identifies this object as a GeoJsonPolygon.", + "enum": [ + "Polygon" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "GeoJsonPosition": { + "id": "GeoJsonPosition", + "type": "array", + "description": "A position represents a geographical position as an array containing a longitude and a latitude, and optionally an altitude, in that order. All Geometry objects make use of positions to represent geometries as nested arrays. The structure of the array is governed by the type of the geometry.", + "items": { + "type": "number", + "format": "double" + } + }, + "GeoJsonProperties": { + "id": "GeoJsonProperties", + "type": "object", + "description": "The properties associated with a feature.", + "additionalProperties": { + "type": "any", + "description": "An arbitrary key-value pair. The key must be the name of a column in the table's schema, and the type of the value must correspond to the type specified in the schema." + } + }, + "Icon": { + "id": "Icon", + "type": "object", + "description": "An icon is a user-uploaded image that can be used to style point geometries.", + "properties": { + "description": { + "type": "string", + "description": "The description of this Icon, supplied by the author." + }, + "id": { + "type": "string", + "description": "An ID used to refer to this Icon." + }, + "name": { + "type": "string", + "description": "The name of this Icon, supplied by the author.", + "annotations": { + "required": [ + "mapsengine.projects.icons.create" + ] + } + } + } + }, + "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'." + }, + "scaledShape": { + "$ref": "ScaledShape", + "description": "A scalable shape." + }, + "scalingFunction": { + "$ref": "ScalingFunction", + "description": "The function used to scale shapes. Required when a scaledShape is specified." + } + } + }, + "IconsListResponse": { + "id": "IconsListResponse", + "type": "object", + "description": "The response returned by a call to icons.List.", + "properties": { + "icons": { + "type": "array", + "description": "Resources returned.", + "items": { + "$ref": "Icon" + } + }, + "nextPageToken": { + "type": "string", + "description": "Next page token." + } + } + }, + "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", + "mapsengine.layers.patch" + ] + } + }, + "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": "A rectangular bounding box which contains all of the data in this Layer. The box is expressed as \\\"west, south, east, north\\\". The numbers represent latitude and longitude 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" + }, + "creatorEmail": { + "type": "string", + "description": "The email address of the creator of this layer. This is only returned on GET requests and not LIST requests." + }, + "datasourceType": { + "type": "string", + "description": "Deprecated: The type of the datasources used to build this Layer. Note: This has been replaced by layerType, but is still available for now to maintain backward compatibility.", + "enum": [ + "image", + "table" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "datasources": { + "$ref": "Datasources", + "description": "An array of datasources used to build this layer. If layerType is \"image\", or layerType is not specified and datasourceType is \"image\", then each element in this array is a reference to an Image or RasterCollection. If layerType is \"vector\", or layerType is not specified and datasourceType is \"table\" then each element in this array is a reference to a Vector Table." + }, + "description": { + "type": "string", + "description": "The description of this Layer, supplied by the author." + }, + "draftAccessList": { + "type": "string", + "description": "Deprecated: 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. Note: Google Maps Engine no longer uses access lists. Instead, each asset has its own list of permissions. For backward compatibility, the API still accepts access lists for projects that are already using access lists. If you created a GME account/project after July 14th, 2014, you will not be able to send API requests that include access lists. Note: This is an input field only. It is not returned in response to a list or get request." + }, + "etag": { + "type": "string", + "description": "The ETag, used to refer to the current version of the asset." + }, + "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" + }, + "lastModifierEmail": { + "type": "string", + "description": "The email address of the last modifier of this layer. This is only returned on GET requests and not LIST requests." + }, + "layerType": { + "type": "string", + "description": "The type of the datasources used to build this Layer. This should be used instead of datasourceType. At least one of layerType and datasourceType and must be specified, but layerType takes precedence.", + "enum": [ + "image", + "vector" + ], + "enumDescriptions": [ + "", + "" + ], + "annotations": { + "required": [ + "mapsengine.layers.create" + ] + } + }, + "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": "Deprecated: 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. Note: Google Maps Engine no longer uses access lists. Instead, each asset has its own list of permissions. For backward compatibility, the API still accepts access lists for projects that are already using access lists. If you created a GME account/project after July 14th, 2014, you will not be able to send API requests that include access lists. Note: This is an input field only. It is not returned in response to a list or get request." + }, + "publishingStatus": { + "type": "string", + "description": "The publishing status of this layer.", + "enum": [ + "notPublished", + "published" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "style": { + "$ref": "VectorStyle", + "description": "The styling information for a vector layer. Note: Style information is returned in response to a get request but not a list request. After requesting a list of layers, you'll need to send a get request to retrieve the VectorStyles for each layer." + }, + "tags": { + "$ref": "Tags", + "description": "Tags of this Layer." + }, + "writersCanEditPermissions": { + "type": "boolean", + "description": "If true, WRITERs of the asset are able to edit the asset permissions." + } + } + }, + "LayersListResponse": { + "id": "LayersListResponse", + "type": "object", + "description": "The response returned by a call to layers.List. Note: The list response does not include all the fields available in a layer. Refer to the layer resource description for details of the fields that are not included. You'll need to send a get request to retrieve the additional fields for each layer.", + "properties": { + "layers": { + "type": "array", + "description": "Resources returned.", + "items": { + "$ref": "Layer" + } + }, + "nextPageToken": { + "type": "string", + "description": "Next page token.", + "format": "byte" + } + } + }, + "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", + "mapsengine.layers.patch" + ] + } + }, + "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", + "mapsengine.layers.patch" + ] + } + } + } + } + } + }, + "Map": { + "id": "Map", + "type": "object", + "description": "A Map is a collection of Layers, optionally contained within folders.", + "properties": { + "bbox": { + "type": "array", + "description": "A rectangular bounding box which contains all of the data in this Map. The box is expressed as \\\"west, south, east, north\\\". The numbers represent latitude and longitude in decimal degrees.", + "items": { + "type": "number", + "format": "double" + } + }, + "contents": { + "$ref": "MapContents", + "description": "The contents of this Map." + }, + "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" + }, + "creatorEmail": { + "type": "string", + "description": "The email address of the creator of this map. This is only returned on GET requests and not LIST requests." + }, + "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." + }, + "description": { + "type": "string", + "description": "The description of this Map, supplied by the author." + }, + "draftAccessList": { + "type": "string", + "description": "Deprecated: 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. Note: Google Maps Engine no longer uses access lists. Instead, each asset has its own list of permissions. For backward compatibility, the API still accepts access lists for projects that are already using access lists. If you created a GME account/project after July 14th, 2014, you will not be able to send API requests that include access lists. Note: This is an input field only. It is not returned in response to a list or get request." + }, + "etag": { + "type": "string", + "description": "The ETag, used to refer to the current version of the asset." + }, + "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" + }, + "lastModifierEmail": { + "type": "string", + "description": "The email address of the last modifier of this map. This is only returned on GET requests and not LIST requests." + }, + "name": { + "type": "string", + "description": "The name of this Map, supplied by the author.", + "annotations": { + "required": [ + "mapsengine.maps.create" + ] + } + }, + "processingStatus": { + "type": "string", + "description": "The processing status of this map. Map processing is automatically started once a map becomes ready for processing.", + "enum": [ + "complete", + "failed", + "notReady", + "processing", + "ready" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "projectId": { + "type": "string", + "description": "The ID of the project that this Map is in.", + "annotations": { + "required": [ + "mapsengine.maps.create" + ] + } + }, + "publishedAccessList": { + "type": "string", + "description": "Deprecated: 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. Note: Google Maps Engine no longer uses access lists. Instead, each asset has its own list of permissions. For backward compatibility, the API still accepts access lists for projects that are already using access lists. If you created a GME account/project after July 14th, 2014, you will not be able to send API requests that include access lists. This is an input field only. It is not returned in response to a list or get request." + }, + "publishingStatus": { + "type": "string", + "description": "The publishing status of this map.", + "enum": [ + "notPublished", + "published" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "tags": { + "$ref": "Tags", + "description": "Tags of this Map." + }, + "versions": { + "type": "array", + "description": "Deprecated: An array containing the available versions of this Map. Currently may only contain \"published\". The publishingStatus field should be used instead.", + "items": { + "type": "string", + "default": "published" + } + }, + "writersCanEditPermissions": { + "type": "boolean", + "description": "If true, WRITERs of the asset are able to edit the asset permissions." + } + } + }, + "MapContents": { + "id": "MapContents", + "type": "array", + "items": { + "$ref": "MapItem" + } + }, + "MapFolder": { + "id": "MapFolder", + "type": "object", + "properties": { + "contents": { + "type": "array", + "items": { + "$ref": "MapItem" + } + }, + "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" + } + }, + "expandable": { + "type": "boolean", + "description": "The expandability setting of this MapFolder. If true, the folder can be expanded." + }, + "key": { + "type": "string", + "description": "A user defined alias for this MapFolder, specific to this Map." + }, + "name": { + "type": "string", + "description": "The name of this MapFolder.", + "annotations": { + "required": [ + "mapsengine.maps.create", + "mapsengine.maps.patch" + ] + } + }, + "type": { + "type": "string", + "description": "Identifies this object as a MapFolder.", + "enum": [ + "folder" + ], + "enumDescriptions": [ + "" + ], + "annotations": { + "required": [ + "mapsengine.maps.create", + "mapsengine.maps.patch" + ] + } + }, + "visibility": { + "type": "string", + "description": "The visibility setting of this MapFolder. One of \"defaultOn\" or \"defaultOff\"." + } + } + }, + "MapItem": { + "id": "MapItem", + "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": { + "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" + } + }, + "kmlUrl": { + "type": "string", + "description": "The URL to the KML file represented by this MapKmlLink.", + "annotations": { + "required": [ + "mapsengine.maps.create", + "mapsengine.maps.patch" + ] + } + }, + "name": { + "type": "string", + "description": "The name of this MapKmlLink.", + "annotations": { + "required": [ + "mapsengine.maps.create", + "mapsengine.maps.patch" + ] + } + }, + "type": { + "type": "string", + "description": "Identifies this object as a MapKmlLink.", + "enum": [ + "kmlLink" + ], + "enumDescriptions": [ + "" + ], + "annotations": { + "required": [ + "mapsengine.maps.create", + "mapsengine.maps.patch" + ] + } + }, + "visibility": { + "type": "string", + "description": "The visibility setting of this MapKmlLink. One of \"defaultOn\" or \"defaultOff\"." + } + } + }, + "MapLayer": { + "id": "MapLayer", + "type": "object", + "properties": { + "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" + } + }, + "id": { + "type": "string", + "description": "The ID of this MapLayer. This ID can be used to request more details about the layer.", + "annotations": { + "required": [ + "mapsengine.maps.create", + "mapsengine.maps.patch" + ] + } + }, + "key": { + "type": "string", + "description": "A user defined alias for this MapLayer, specific to this Map." + }, + "name": { + "type": "string", + "description": "The name of this MapLayer." + }, + "type": { + "type": "string", + "description": "Identifies this object as a MapLayer.", + "enum": [ + "layer" + ], + "enumDescriptions": [ + "" + ], + "annotations": { + "required": [ + "mapsengine.maps.create", + "mapsengine.maps.patch" + ] + } + }, + "visibility": { + "type": "string", + "description": "The visibility setting of this MapLayer. 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.", + "format": "byte" + } + } + }, + "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": "The parent assets.", + "items": { + "$ref": "Parent" + } + } + } + }, + "Permission": { + "id": "Permission", + "type": "object", + "description": "A permission defines the user or group that has access to an asset, and the type of access they have.", + "properties": { + "discoverable": { + "type": "boolean", + "description": "Indicates whether a public asset is listed and can be found via a web search (value true), or is visible only to people who have a link to the asset (value false)." + }, + "id": { + "type": "string", + "description": "The unique identifier of the permission. This could be the email address of the user or group this permission refers to, or the string \"anyone\" for public permissions.", + "annotations": { + "required": [ + "mapsengine.layers.permissions.batchUpdate", + "mapsengine.maps.permissions.batchUpdate", + "mapsengine.rasterCollections.permissions.batchUpdate", + "mapsengine.tables.permissions.batchUpdate" + ] + } + }, + "role": { + "type": "string", + "description": "The type of access granted to this user or group.", + "enum": [ + "owner", + "reader", + "viewer", + "writer" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ], + "annotations": { + "required": [ + "mapsengine.layers.permissions.batchUpdate", + "mapsengine.maps.permissions.batchUpdate", + "mapsengine.rasterCollections.permissions.batchUpdate", + "mapsengine.tables.permissions.batchUpdate" + ] + } + }, + "type": { + "type": "string", + "description": "The account type.", + "enum": [ + "anyone", + "group", + "user" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "PermissionsBatchDeleteRequest": { + "id": "PermissionsBatchDeleteRequest", + "type": "object", + "description": "The request sent to mapsengine.permissions.batchDelete.", + "properties": { + "ids": { + "type": "array", + "description": "An array of permission ids to be removed. This could be the email address of the user or group this permission refers to, or the string \"anyone\" for public permissions.", + "items": { + "type": "string" + }, + "annotations": { + "required": [ + "mapsengine.layers.permissions.batchDelete", + "mapsengine.maps.permissions.batchDelete", + "mapsengine.rasterCollections.permissions.batchDelete", + "mapsengine.tables.permissions.batchDelete" + ] + } + } + } + }, + "PermissionsBatchDeleteResponse": { + "id": "PermissionsBatchDeleteResponse", + "type": "object", + "description": "The response returned by a call to mapsengine.permissions.batchDelete." + }, + "PermissionsBatchUpdateRequest": { + "id": "PermissionsBatchUpdateRequest", + "type": "object", + "description": "The request sent to mapsengine.permissions.batchUpdate.", + "properties": { + "permissions": { + "type": "array", + "description": "The permissions to be inserted or updated.", + "items": { + "$ref": "Permission" + }, + "annotations": { + "required": [ + "mapsengine.layers.permissions.batchUpdate", + "mapsengine.maps.permissions.batchUpdate", + "mapsengine.rasterCollections.permissions.batchUpdate", + "mapsengine.tables.permissions.batchUpdate" + ] + } + } + } + }, + "PermissionsBatchUpdateResponse": { + "id": "PermissionsBatchUpdateResponse", + "type": "object", + "description": "The response returned by a call to mapsengine.permissions.batchUpdate." + }, + "PermissionsListResponse": { + "id": "PermissionsListResponse", + "type": "object", + "properties": { + "permissions": { + "type": "array", + "description": "The set of permissions associated with this asset.", + "items": { + "$ref": "Permission" + } + } + } + }, + "PointStyle": { + "id": "PointStyle", + "type": "object", + "description": "Style for points.", + "properties": { + "icon": { + "$ref": "IconStyle", + "description": "Icon for the point; if it isn't null, exactly one of 'name', 'id' or 'scaledShape' must be set.", + "annotations": { + "required": [ + "mapsengine.layers.create", + "mapsengine.layers.patch" + ] + } + }, + "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." + }, + "label": { + "$ref": "LabelStyle", + "description": "Label style for the polygon." + }, + "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 Maps Engine project groups a collection of resources.", + "properties": { + "id": { + "type": "string", + "description": "An ID used to refer to this Maps Engine project." + }, + "name": { + "type": "string", + "description": "A user provided name for this Maps Engine 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." + }, + "PublishedLayer": { + "id": "PublishedLayer", + "type": "object", + "description": "The published version of a layer.", + "properties": { + "description": { + "type": "string", + "description": "The description of this Layer, supplied by the author." + }, + "id": { + "type": "string", + "description": "A globally unique ID, used to refer to this Layer." + }, + "layerType": { + "type": "string", + "description": "The type of the datasources used to build this Layer. This should be used instead of datasourceType. At least one of layerType and datasourceType and must be specified, but layerType takes precedence.", + "enum": [ + "image", + "vector" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "name": { + "type": "string", + "description": "The name of this Layer, supplied by the author." + }, + "projectId": { + "type": "string", + "description": "The ID of the project that this Layer is in." + } + } + }, + "PublishedLayersListResponse": { + "id": "PublishedLayersListResponse", + "type": "object", + "description": "The response returned by a call to layers.List.published.", + "properties": { + "layers": { + "type": "array", + "description": "Resources returned.", + "items": { + "$ref": "PublishedLayer" + } + }, + "nextPageToken": { + "type": "string", + "description": "Next page token.", + "format": "byte" + } + } + }, + "PublishedMap": { + "id": "PublishedMap", + "type": "object", + "description": "The published version of a map asset.", + "properties": { + "contents": { + "$ref": "MapContents", + "description": "The contents of this Map." + }, + "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." + }, + "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." + }, + "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." + } + } + }, + "PublishedMapsListResponse": { + "id": "PublishedMapsListResponse", + "type": "object", + "description": "The response returned by a call to maps.List.published.", + "properties": { + "maps": { + "type": "array", + "description": "Resources returned.", + "items": { + "$ref": "PublishedMap" + } + }, + "nextPageToken": { + "type": "string", + "description": "Next page token.", + "format": "byte" + } + } + }, + "Raster": { + "id": "Raster", + "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." + }, + "bbox": { + "type": "array", + "description": "A rectangular bounding box which contains all of the data in this Raster. The box is expressed as \\\"west, south, east, north\\\". 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" + }, + "creatorEmail": { + "type": "string", + "description": "The email address of the creator of this raster. This is only returned on GET requests and not LIST requests." + }, + "description": { + "type": "string", + "description": "The description of this Raster, supplied by the author." + }, + "draftAccessList": { + "type": "string", + "description": "Deprecated: 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. Note: Google Maps Engine no longer uses access lists. Instead, each asset has its own list of permissions. For backward compatibility, the API still accepts access lists for projects that are already using access lists. If you created a GME account/project after July 14th, 2014, you will not be able to send API requests that include access lists. Note: This is an input field only. It is not returned in response to a list or get request." + }, + "etag": { + "type": "string", + "description": "The ETag, used to refer to the current version of the asset." + }, + "files": { + "type": "array", + "description": "The files associated with this Raster.", + "items": { + "$ref": "File" + }, + "annotations": { + "required": [ + "mapsengine.rasters.upload" + ] + } + }, + "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" + }, + "lastModifierEmail": { + "type": "string", + "description": "The email address of the last modifier of this raster. This is only returned on GET requests and not LIST requests." + }, + "maskType": { + "type": "string", + "description": "The mask processing type of this Raster.", + "default": "autoMask" + }, + "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.", + "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.", + "enum": [ + "image" + ], + "enumDescriptions": [ + "" + ], + "annotations": { + "required": [ + "mapsengine.rasters.upload" + ] + } + }, + "tags": { + "$ref": "Tags", + "description": "Tags of this Raster." + }, + "writersCanEditPermissions": { + "type": "boolean", + "description": "If true, WRITERs of the asset are able to edit the asset permissions." + } + } + }, + "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. Note: Attribution is returned in response to a get request but not a list request. After requesting a list of raster collections, you'll need to send a get request to retrieve the attribution for each raster collection." + }, + "bbox": { + "type": "array", + "description": "A rectangular bounding box which contains all of the data in this RasterCollection. The box is expressed as \\\"west, south, east, north\\\". The numbers represent latitude and longitude 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" + }, + "creatorEmail": { + "type": "string", + "description": "The email address of the creator of this raster collection. This is only returned on GET requests and not LIST requests." + }, + "description": { + "type": "string", + "description": "The description of this RasterCollection, supplied by the author." + }, + "draftAccessList": { + "type": "string", + "description": "Deprecated: 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. Note: Google Maps Engine no longer uses access lists. Instead, each asset has its own list of permissions. For backward compatibility, the API still accepts access lists for projects that are already using access lists. If you created a GME account/project after July 14th, 2014, you will not be able to send API requests that include access lists. Note: This is an input field only. It is not returned in response to a list or get request." + }, + "etag": { + "type": "string", + "description": "The ETag, used to refer to the current version of the asset." + }, + "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" + }, + "lastModifierEmail": { + "type": "string", + "description": "The email address of the last modifier of this raster collection. This is only returned on GET requests and not LIST requests." + }, + "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" + ] + } + }, + "processingStatus": { + "type": "string", + "description": "The processing status of this RasterCollection.", + "enum": [ + "complete", + "failed", + "notReady", + "processing", + "ready" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "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": { + "$ref": "Tags", + "description": "Tags of this RasterCollection." + }, + "writersCanEditPermissions": { + "type": "boolean", + "description": "If true, WRITERs of the asset are able to edit the asset permissions." + } + } + }, + "RasterCollectionsListResponse": { + "id": "RasterCollectionsListResponse", + "type": "object", + "description": "The response returned by a call to raster_collections.List. Note: The list response does not include all the fields available in a raster collection. Refer to the RasterCollection resource description for details of the fields that are not included. You'll need to send a get request to retrieve the additional fields for each raster collection.", + "properties": { + "nextPageToken": { + "type": "string", + "description": "Next page token.", + "format": "byte" + }, + "rasterCollections": { + "type": "array", + "description": "Resources returned.", + "items": { + "$ref": "RasterCollection" + } + } + } + }, + "RasterCollectionsRaster": { + "id": "RasterCollectionsRaster", + "type": "object", + "description": "A raster resource.", + "properties": { + "bbox": { + "type": "array", + "description": "A rectangular bounding box which contains all of the data in this Raster. The box is expressed as \\\"west, south, east, north\\\". 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" + } + } + } + }, + "RasterCollectionsRasterBatchDeleteRequest": { + "id": "RasterCollectionsRasterBatchDeleteRequest", + "type": "object", + "description": "The request sent to rasterCollections.Rasters.BatchDelete.", + "properties": { + "ids": { + "type": "array", + "description": "An array of Raster asset IDs to be removed from this RasterCollection.", + "items": { + "type": "string" + } + } + } + }, + "RasterCollectionsRastersBatchDeleteResponse": { + "id": "RasterCollectionsRastersBatchDeleteResponse", + "type": "object", + "description": "The response returned by a call to rasterCollections.rasters.batchDelete." + }, + "RasterCollectionsRastersBatchInsertRequest": { + "id": "RasterCollectionsRastersBatchInsertRequest", + "type": "object", + "description": "The request sent to rasterCollections.Rasters.BatchInsert.", + "properties": { + "ids": { + "type": "array", + "description": "An array of Raster asset IDs to be added to this RasterCollection.", + "items": { + "type": "string" + } + } + } + }, + "RasterCollectionsRastersBatchInsertResponse": { + "id": "RasterCollectionsRastersBatchInsertResponse", + "type": "object", + "description": "The response returned by a call to rasterCollections.rasters.batchInsert." + }, + "RasterCollectionsRastersListResponse": { + "id": "RasterCollectionsRastersListResponse", + "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": "RasterCollectionsRaster" + } + } + } + }, + "RastersListResponse": { + "id": "RastersListResponse", + "type": "object", + "description": "The response returned by a call to rasters.List.", + "properties": { + "nextPageToken": { + "type": "string", + "description": "Next page token." + }, + "rasters": { + "type": "array", + "description": "Resources returned.", + "items": { + "$ref": "Raster" + } + } + } + }, + "ScaledShape": { + "id": "ScaledShape", + "type": "object", + "description": "Parameters for styling points as scaled shapes.", + "properties": { + "border": { + "$ref": "Border", + "description": "Border color/width of the shape. If not specified the shape won't have a border." + }, + "fill": { + "$ref": "Color", + "description": "The fill color of the shape. If not specified the shape will be transparent (although the borders may not be)." + }, + "shape": { + "type": "string", + "description": "Name of the shape.", + "enum": [ + "circle" + ], + "enumDescriptions": [ + "" + ], + "annotations": { + "required": [ + "mapsengine.layers.create", + "mapsengine.layers.patch" + ] + } + } + } + }, + "ScalingFunction": { + "id": "ScalingFunction", + "type": "object", + "description": "Parameters for scaling scaled shapes.", + "properties": { + "column": { + "type": "string", + "description": "Name of the numeric column used to scale a shape.", + "annotations": { + "required": [ + "mapsengine.layers.create", + "mapsengine.layers.patch" + ] + } + }, + "scalingType": { + "type": "string", + "description": "The type of scaling function to use. Defaults to SQRT. Currently only linear and square root scaling are supported.", + "enum": [ + "linear", + "sqrt" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "sizeRange": { + "$ref": "SizeRange", + "description": "The range of shape sizes, in pixels. For circles, the size corresponds to the diameter.", + "annotations": { + "required": [ + "mapsengine.layers.create", + "mapsengine.layers.patch" + ] + } + }, + "valueRange": { + "$ref": "ValueRange", + "description": "The range of values to display across the size range.", + "annotations": { + "required": [ + "mapsengine.layers.create", + "mapsengine.layers.patch" + ] + } + } + } + }, + "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 TableColumn objects. The first object in the array must be named geometry and be of type points, lineStrings, polygons, or mixedGeometry.", + "items": { + "$ref": "TableColumn" + }, + "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." + } + } + }, + "SizeRange": { + "id": "SizeRange", + "type": "object", + "description": "Scaled shape size range in pixels. For circles, size corresponds to diameter.", + "properties": { + "max": { + "type": "number", + "description": "Maximum size, in pixels.", + "format": "double", + "annotations": { + "required": [ + "mapsengine.layers.create", + "mapsengine.layers.patch" + ] + } + }, + "min": { + "type": "number", + "description": "Minimum size, in pixels.", + "format": "double", + "annotations": { + "required": [ + "mapsengine.layers.create", + "mapsengine.layers.patch" + ] + } + } + } + }, + "Table": { + "id": "Table", + "type": "object", + "description": "A collection of geographic features, and associated metadata.", + "properties": { + "bbox": { + "type": "array", + "description": "A rectangular bounding box which contains all of the data in this Table. The box is expressed as \\\"west, south, east, north\\\". The numbers represent latitude and longitude in decimal degrees.", + "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" + }, + "creatorEmail": { + "type": "string", + "description": "The email address of the creator of this table. This is only returned on GET requests and not LIST requests." + }, + "description": { + "type": "string", + "description": "The description of this table, supplied by the author." + }, + "draftAccessList": { + "type": "string", + "description": "Deprecated: 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. Note: Google Maps Engine no longer uses access lists. Instead, each asset has its own list of permissions. For backward compatibility, the API still accepts access lists for projects that are already using access lists. If you created a GME account/project after July 14th, 2014, you will not be able to send API requests that include access lists. Note: This is an input field only. It is not returned in response to a list or get request." + }, + "etag": { + "type": "string", + "description": "The ETag, used to refer to the current version of the asset." + }, + "files": { + "type": "array", + "description": "The files associated with this table.", + "items": { + "$ref": "File" + }, + "annotations": { + "required": [ + "mapsengine.tables.upload" + ] + } + }, + "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" + }, + "lastModifierEmail": { + "type": "string", + "description": "The email address of the last modifier of this table. This is only returned on GET requests and not LIST requests." + }, + "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.", + "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": "Deprecated: 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. Note: Google Maps Engine no longer uses access lists. Instead, each asset has its own list of permissions. For backward compatibility, the API still accepts access lists for projects that are already using access lists. If you created a GME account/project after July 14th, 2014, you will not be able to send API requests that include access lists. Note: This is an input field only. It is not returned in response to a list or get request." + }, + "schema": { + "$ref": "Schema", + "description": "The schema for this table. Note: The schema is returned in response to a get request but not a list request. After requesting a list of tables, you'll need to send a get request to retrieve the schema for each table.", + "annotations": { + "required": [ + "mapsengine.tables.create" + ] + } + }, + "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": { + "$ref": "Tags", + "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." + }, + "writersCanEditPermissions": { + "type": "boolean", + "description": "If true, WRITERs of the asset are able to edit the asset permissions." + } + } + }, + "TableColumn": { + "id": "TableColumn", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The column name.", + "annotations": { + "required": [ + "mapsengine.tables.create" + ] + } + }, + "type": { + "type": "string", + "description": "The type of data stored in this column.", + "enum": [ + "datetime", + "double", + "integer", + "lineStrings", + "mixedGeometry", + "points", + "polygons", + "string" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ], + "annotations": { + "required": [ + "mapsengine.tables.create" + ] + } + } + } + }, + "TablesListResponse": { + "id": "TablesListResponse", + "type": "object", + "description": "The response returned by a call to tables.List. Note: The list response does not include all the fields available in a table. Refer to the table resource description for details of the fields that are not included. You'll need to send a get request to retrieve the additional fields for each table.", + "properties": { + "nextPageToken": { + "type": "string", + "description": "Next page token.", + "format": "byte" + }, + "tables": { + "type": "array", + "description": "Resources returned.", + "items": { + "$ref": "Table" + } + } + } + }, + "Tags": { + "id": "Tags", + "type": "array", + "items": { + "type": "string" + } + }, + "ValueRange": { + "id": "ValueRange", + "type": "object", + "description": "Range of values used for scaling shapes. The min/max values will be drawn as shapes with the min/max size.", + "properties": { + "max": { + "type": "number", + "description": "Maximum value.", + "format": "double", + "annotations": { + "required": [ + "mapsengine.layers.create", + "mapsengine.layers.patch" + ] + } + }, + "min": { + "type": "number", + "description": "Minimum value.", + "format": "double", + "annotations": { + "required": [ + "mapsengine.layers.create", + "mapsengine.layers.patch" + ] + } + } + } + }, + "VectorStyle": { + "id": "VectorStyle", + "type": "object", + "description": "A vector style contains styling information for vector layer.", + "properties": { + "displayRules": { + "type": "array", + "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", + "mapsengine.layers.patch" + ] + } + } + } + }, + "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", + "mapsengine.layers.patch" + ] + } + }, + "min": { + "type": "integer", + "description": "Minimum zoom level.", + "format": "int32", + "annotations": { + "required": [ + "mapsengine.layers.create", + "mapsengine.layers.patch" + ] + } + } + } + } + }, + "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": "Asset" + }, + "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" + }, + "role": { + "type": "string", + "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.", + "enum": [ + "owner", + "reader", + "writer" + ], + "enumDescriptions": [ + "The user can read, write and administer the asset.", + "The user can read the asset.", + "The user can read and write the asset." + ], + "location": "query" + }, + "search": { + "type": "string", + "description": "An unstructured search string used to filter the set of results based on asset metadata.", + "location": "query" + }, + "tags": { + "type": "string", + "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.", + "location": "query" + }, + "type": { + "type": "string", + "description": "A comma separated list of asset types. Returned assets will have one of the types from the provided list. Supported values are 'map', 'layer', 'rasterCollection' and 'table'.", + "location": "query" + } + }, + "response": { + "$ref": "AssetsListResponse" + }, + "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" + ] + } + } + }, + "permissions": { + "methods": { + "list": { + "id": "mapsengine.assets.permissions.list", + "path": "assets/{id}/permissions", + "httpMethod": "GET", + "description": "Return all of the permissions for the specified asset.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the asset whose permissions will be listed.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "PermissionsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + } + } + } + } + }, + "layers": { + "methods": { + "cancelProcessing": { + "id": "mapsengine.layers.cancelProcessing", + "path": "layers/{id}/cancelProcessing", + "httpMethod": "POST", + "description": "Cancel processing on 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" + ] + }, + "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" + ] + }, + "delete": { + "id": "mapsengine.layers.delete", + "path": "layers/{id}", + "httpMethod": "DELETE", + "description": "Delete a layer.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the layer. Only the layer creator or project owner are permitted to delete. If the layer is published, or included in a map, the request will fail. Unpublish the layer, and remove it from all maps prior to deleting.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "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", + "description": "Deprecated: The version parameter indicates which version of the layer should be returned. When version is set to published, the published version of the layer will be returned. Please use the layers.getPublished endpoint instead.", + "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" + ] + }, + "getPublished": { + "id": "mapsengine.layers.getPublished", + "path": "layers/{id}/published", + "httpMethod": "GET", + "description": "Return the published metadata for a particular layer.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the layer.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "PublishedLayer" + }, + "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" + }, + "processingStatus": { + "type": "string", + "enum": [ + "complete", + "failed", + "notReady", + "processing", + "ready" + ], + "enumDescriptions": [ + "The layer has completed processing.", + "The layer has failed processing.", + "The layer is not ready for processing.", + "The layer is processing.", + "The layer is ready for processing." + ], + "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" + }, + "role": { + "type": "string", + "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.", + "enum": [ + "owner", + "reader", + "writer" + ], + "enumDescriptions": [ + "The user can read, write and administer the asset.", + "The user can read the asset.", + "The user can read and write the asset." + ], + "location": "query" + }, + "search": { + "type": "string", + "description": "An unstructured search string used to filter the set of results based on asset metadata.", + "location": "query" + }, + "tags": { + "type": "string", + "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.", + "location": "query" + } + }, + "response": { + "$ref": "LayersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + }, + "listPublished": { + "id": "mapsengine.layers.listPublished", + "path": "layers/published", + "httpMethod": "GET", + "description": "Return all published layers readable by the current user.", + "parameters": { + "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" + }, + "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": "PublishedLayersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + }, + "patch": { + "id": "mapsengine.layers.patch", + "path": "layers/{id}", + "httpMethod": "PATCH", + "description": "Mutate a layer asset.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the layer.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "Layer" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "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": { + "force": { + "type": "boolean", + "description": "If set to true, the API will allow publication of the layer even if it's out of date. If not true, you'll need to reprocess any out-of-date layer before publishing.", + "location": "query" + }, + "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" + ] + }, + "unpublish": { + "id": "mapsengine.layers.unpublish", + "path": "layers/{id}/unpublish", + "httpMethod": "POST", + "description": "Unpublish 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" + ] + } + } + }, + "permissions": { + "methods": { + "batchDelete": { + "id": "mapsengine.layers.permissions.batchDelete", + "path": "layers/{id}/permissions/batchDelete", + "httpMethod": "POST", + "description": "Remove permission entries from an already existing asset.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the asset from which permissions will be removed.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "PermissionsBatchDeleteRequest" + }, + "response": { + "$ref": "PermissionsBatchDeleteResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "batchUpdate": { + "id": "mapsengine.layers.permissions.batchUpdate", + "path": "layers/{id}/permissions/batchUpdate", + "httpMethod": "POST", + "description": "Add or update permission entries to an already existing asset.\n\nAn asset can hold up to 20 different permission entries. Each batchInsert request is atomic.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the asset to which permissions will be added.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "PermissionsBatchUpdateRequest" + }, + "response": { + "$ref": "PermissionsBatchUpdateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "list": { + "id": "mapsengine.layers.permissions.list", + "path": "layers/{id}/permissions", + "httpMethod": "GET", + "description": "Return all of the permissions for the specified asset.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the asset whose permissions will be listed.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "PermissionsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + } + } + } + } + }, + "maps": { + "methods": { + "create": { + "id": "mapsengine.maps.create", + "path": "maps", + "httpMethod": "POST", + "description": "Create a map asset.", + "request": { + "$ref": "Map" + }, + "response": { + "$ref": "Map" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "delete": { + "id": "mapsengine.maps.delete", + "path": "maps/{id}", + "httpMethod": "DELETE", + "description": "Delete a map.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the map. Only the map creator or project owner are permitted to delete. If the map is published the request will fail. Unpublish the map prior to deleting.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "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", + "description": "Deprecated: The version parameter indicates which version of the map should be returned. When version is set to published, the published version of the map will be returned. Please use the maps.getPublished endpoint instead.", + "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" + ] + }, + "getPublished": { + "id": "mapsengine.maps.getPublished", + "path": "maps/{id}/published", + "httpMethod": "GET", + "description": "Return the published metadata for a particular map.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the map.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "PublishedMap" + }, + "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" + }, + "processingStatus": { + "type": "string", + "enum": [ + "complete", + "failed", + "notReady", + "processing" + ], + "enumDescriptions": [ + "The map has completed processing.", + "The map has failed processing.", + "The map is not ready for processing.", + "The map is processing." + ], + "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" + }, + "role": { + "type": "string", + "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.", + "enum": [ + "owner", + "reader", + "writer" + ], + "enumDescriptions": [ + "The user can read, write and administer the asset.", + "The user can read the asset.", + "The user can read and write the asset." + ], + "location": "query" + }, + "search": { + "type": "string", + "description": "An unstructured search string used to filter the set of results based on asset metadata.", + "location": "query" + }, + "tags": { + "type": "string", + "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.", + "location": "query" + } + }, + "response": { + "$ref": "MapsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + }, + "listPublished": { + "id": "mapsengine.maps.listPublished", + "path": "maps/published", + "httpMethod": "GET", + "description": "Return all published maps readable by the current user.", + "parameters": { + "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" + }, + "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": "PublishedMapsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + }, + "patch": { + "id": "mapsengine.maps.patch", + "path": "maps/{id}", + "httpMethod": "PATCH", + "description": "Mutate a map asset.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the map.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "Map" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "publish": { + "id": "mapsengine.maps.publish", + "path": "maps/{id}/publish", + "httpMethod": "POST", + "description": "Publish a map asset.", + "parameters": { + "force": { + "type": "boolean", + "description": "If set to true, the API will allow publication of the map even if it's out of date. If false, the map must have a processingStatus of complete before publishing.", + "location": "query" + }, + "id": { + "type": "string", + "description": "The ID of the map.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "PublishResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "unpublish": { + "id": "mapsengine.maps.unpublish", + "path": "maps/{id}/unpublish", + "httpMethod": "POST", + "description": "Unpublish a map asset.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the map.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "PublishResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + } + }, + "resources": { + "permissions": { + "methods": { + "batchDelete": { + "id": "mapsengine.maps.permissions.batchDelete", + "path": "maps/{id}/permissions/batchDelete", + "httpMethod": "POST", + "description": "Remove permission entries from an already existing asset.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the asset from which permissions will be removed.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "PermissionsBatchDeleteRequest" + }, + "response": { + "$ref": "PermissionsBatchDeleteResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "batchUpdate": { + "id": "mapsengine.maps.permissions.batchUpdate", + "path": "maps/{id}/permissions/batchUpdate", + "httpMethod": "POST", + "description": "Add or update permission entries to an already existing asset.\n\nAn asset can hold up to 20 different permission entries. Each batchInsert request is atomic.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the asset to which permissions will be added.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "PermissionsBatchUpdateRequest" + }, + "response": { + "$ref": "PermissionsBatchUpdateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "list": { + "id": "mapsengine.maps.permissions.list", + "path": "maps/{id}/permissions", + "httpMethod": "GET", + "description": "Return all of the permissions for the specified asset.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the asset whose permissions will be listed.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "PermissionsListResponse" + }, + "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" + ] + } + }, + "resources": { + "icons": { + "methods": { + "create": { + "id": "mapsengine.projects.icons.create", + "path": "projects/{projectId}/icons", + "httpMethod": "POST", + "description": "Create an icon.", + "parameters": { + "projectId": { + "type": "string", + "description": "The ID of the project.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId" + ], + "request": { + "$ref": "Icon" + }, + "response": { + "$ref": "Icon" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "*/*" + ], + "maxSize": "100KB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/mapsengine/v1/projects/{projectId}/icons" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/mapsengine/v1/projects/{projectId}/icons" + } + } + } + }, + "get": { + "id": "mapsengine.projects.icons.get", + "path": "projects/{projectId}/icons/{id}", + "httpMethod": "GET", + "description": "Return an icon or its associated metadata", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the icon.", + "required": true, + "location": "path" + }, + "projectId": { + "type": "string", + "description": "The ID of the project.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId", + "id" + ], + "response": { + "$ref": "Icon" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ], + "supportsMediaDownload": true + }, + "list": { + "id": "mapsengine.projects.icons.list", + "path": "projects/{projectId}/icons", + "httpMethod": "GET", + "description": "Return all icons in the current project", + "parameters": { + "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" + }, + "projectId": { + "type": "string", + "description": "The ID of the project.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "IconsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + } + } + } + } + }, + "rasterCollections": { + "methods": { + "cancelProcessing": { + "id": "mapsengine.rasterCollections.cancelProcessing", + "path": "rasterCollections/{id}/cancelProcessing", + "httpMethod": "POST", + "description": "Cancel processing on a raster collection asset.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the raster collection.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "ProcessResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "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" + ] + }, + "delete": { + "id": "mapsengine.rasterCollections.delete", + "path": "rasterCollections/{id}", + "httpMethod": "DELETE", + "description": "Delete a raster collection.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the raster collection. Only the raster collection creator or project owner are permitted to delete. If the rastor collection is included in a layer, the request will fail. Remove the raster collection from all layers prior to deleting.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "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" + }, + "processingStatus": { + "type": "string", + "enum": [ + "complete", + "failed", + "notReady", + "processing", + "ready" + ], + "enumDescriptions": [ + "The raster collection has completed processing.", + "The raster collection has failed processing.", + "The raster collection is not ready for processing.", + "The raster collection is processing.", + "The raster collection is ready for processing." + ], + "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" + }, + "role": { + "type": "string", + "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.", + "enum": [ + "owner", + "reader", + "writer" + ], + "enumDescriptions": [ + "The user can read, write and administer the asset.", + "The user can read the asset.", + "The user can read and write the asset." + ], + "location": "query" + }, + "search": { + "type": "string", + "description": "An unstructured search string used to filter the set of results based on asset metadata.", + "location": "query" + }, + "tags": { + "type": "string", + "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.", + "location": "query" + } + }, + "response": { + "$ref": "RasterCollectionsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + }, + "patch": { + "id": "mapsengine.rasterCollections.patch", + "path": "rasterCollections/{id}", + "httpMethod": "PATCH", + "description": "Mutate a raster collection asset.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the raster collection.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "RasterCollection" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "process": { + "id": "mapsengine.rasterCollections.process", + "path": "rasterCollections/{id}/process", + "httpMethod": "POST", + "description": "Process a raster collection asset.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the raster collection.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "ProcessResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + } + }, + "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" + ] + } + } + }, + "permissions": { + "methods": { + "batchDelete": { + "id": "mapsengine.rasterCollections.permissions.batchDelete", + "path": "rasterCollections/{id}/permissions/batchDelete", + "httpMethod": "POST", + "description": "Remove permission entries from an already existing asset.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the asset from which permissions will be removed.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "PermissionsBatchDeleteRequest" + }, + "response": { + "$ref": "PermissionsBatchDeleteResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "batchUpdate": { + "id": "mapsengine.rasterCollections.permissions.batchUpdate", + "path": "rasterCollections/{id}/permissions/batchUpdate", + "httpMethod": "POST", + "description": "Add or update permission entries to an already existing asset.\n\nAn asset can hold up to 20 different permission entries. Each batchInsert request is atomic.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the asset to which permissions will be added.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "PermissionsBatchUpdateRequest" + }, + "response": { + "$ref": "PermissionsBatchUpdateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "list": { + "id": "mapsengine.rasterCollections.permissions.list", + "path": "rasterCollections/{id}/permissions", + "httpMethod": "GET", + "description": "Return all of the permissions for the specified asset.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the asset whose permissions will be listed.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "PermissionsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + } + } + }, + "rasters": { + "methods": { + "batchDelete": { + "id": "mapsengine.rasterCollections.rasters.batchDelete", + "path": "rasterCollections/{id}/rasters/batchDelete", + "httpMethod": "POST", + "description": "Remove rasters from an existing raster collection.\n\nUp to 50 rasters can be included in a single batchDelete request. Each batchDelete request is atomic.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the raster collection to which these rasters belong.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "RasterCollectionsRasterBatchDeleteRequest" + }, + "response": { + "$ref": "RasterCollectionsRastersBatchDeleteResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "batchInsert": { + "id": "mapsengine.rasterCollections.rasters.batchInsert", + "path": "rasterCollections/{id}/rasters/batchInsert", + "httpMethod": "POST", + "description": "Add rasters to an existing raster collection. Rasters must be successfully processed in order to be added to a raster collection.\n\nUp to 50 rasters can be included in a single batchInsert request. Each batchInsert request is atomic.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the raster collection to which these rasters belong.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "RasterCollectionsRastersBatchInsertRequest" + }, + "response": { + "$ref": "RasterCollectionsRastersBatchInsertResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "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" + }, + "role": { + "type": "string", + "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.", + "enum": [ + "owner", + "reader", + "writer" + ], + "enumDescriptions": [ + "The user can read, write and administer the asset.", + "The user can read the asset.", + "The user can read and write the asset." + ], + "location": "query" + }, + "search": { + "type": "string", + "description": "An unstructured search string used to filter the set of results based on asset metadata.", + "location": "query" + }, + "tags": { + "type": "string", + "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "RasterCollectionsRastersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + } + } + } + } + }, + "rasters": { + "methods": { + "delete": { + "id": "mapsengine.rasters.delete", + "path": "rasters/{id}", + "httpMethod": "DELETE", + "description": "Delete a raster.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the raster. Only the raster creator or project owner are permitted to delete. If the raster is included in a layer or mosaic, the request will fail. Remove it from all parents prior to deleting.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "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": "Raster" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + }, + "list": { + "id": "mapsengine.rasters.list", + "path": "rasters", + "httpMethod": "GET", + "description": "Return all rasters 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" + }, + "processingStatus": { + "type": "string", + "enum": [ + "complete", + "failed", + "notReady", + "processing", + "ready" + ], + "enumDescriptions": [ + "The raster has completed processing.", + "The raster has failed processing.", + "The raster is not ready for processing.", + "The raster is processing.", + "The raster is ready for processing." + ], + "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.", + "required": true, + "location": "query" + }, + "role": { + "type": "string", + "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.", + "enum": [ + "owner", + "reader", + "writer" + ], + "enumDescriptions": [ + "The user can read, write and administer the asset.", + "The user can read the asset.", + "The user can read and write the asset." + ], + "location": "query" + }, + "search": { + "type": "string", + "description": "An unstructured search string used to filter the set of results based on asset metadata.", + "location": "query" + }, + "tags": { + "type": "string", + "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.", + "location": "query" + } + }, + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "RastersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + }, + "patch": { + "id": "mapsengine.rasters.patch", + "path": "rasters/{id}", + "httpMethod": "PATCH", + "description": "Mutate a raster asset.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the raster.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "Raster" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "process": { + "id": "mapsengine.rasters.process", + "path": "rasters/{id}/process", + "httpMethod": "POST", + "description": "Process a raster asset.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the raster.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "ProcessResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "upload": { + "id": "mapsengine.rasters.upload", + "path": "rasters/upload", + "httpMethod": "POST", + "description": "Create a skeleton raster asset for upload.", + "request": { + "$ref": "Raster" + }, + "response": { + "$ref": "Raster" + }, + "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": "10GB", + "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" + ] + } + } + }, + "permissions": { + "methods": { + "batchDelete": { + "id": "mapsengine.rasters.permissions.batchDelete", + "path": "rasters/{id}/permissions/batchDelete", + "httpMethod": "POST", + "description": "Remove permission entries from an already existing asset.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the asset from which permissions will be removed.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "PermissionsBatchDeleteRequest" + }, + "response": { + "$ref": "PermissionsBatchDeleteResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "batchUpdate": { + "id": "mapsengine.rasters.permissions.batchUpdate", + "path": "rasters/{id}/permissions/batchUpdate", + "httpMethod": "POST", + "description": "Add or update permission entries to an already existing asset.\n\nAn asset can hold up to 20 different permission entries. Each batchInsert request is atomic.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the asset to which permissions will be added.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "PermissionsBatchUpdateRequest" + }, + "response": { + "$ref": "PermissionsBatchUpdateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "list": { + "id": "mapsengine.rasters.permissions.list", + "path": "rasters/{id}/permissions", + "httpMethod": "GET", + "description": "Return all of the permissions for the specified asset.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the asset whose permissions will be listed.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "PermissionsListResponse" + }, + "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" + ] + }, + "delete": { + "id": "mapsengine.tables.delete", + "path": "tables/{id}", + "httpMethod": "DELETE", + "description": "Delete a table.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the table. Only the table creator or project owner are permitted to delete. If the table is included in a layer, the request will fail. Remove it from all layers prior to deleting.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "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" + }, + "processingStatus": { + "type": "string", + "enum": [ + "complete", + "failed", + "notReady", + "processing", + "ready" + ], + "enumDescriptions": [ + "The table has completed processing.", + "The table has failed processing.", + "The table is not ready for processing.", + "The table is processing.", + "The table is ready for processing." + ], + "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" + }, + "role": { + "type": "string", + "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.", + "enum": [ + "owner", + "reader", + "writer" + ], + "enumDescriptions": [ + "The user can read, write and administer the asset.", + "The user can read the asset.", + "The user can read and write the asset." + ], + "location": "query" + }, + "search": { + "type": "string", + "description": "An unstructured search string used to filter the set of results based on asset metadata.", + "location": "query" + }, + "tags": { + "type": "string", + "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.", + "location": "query" + } + }, + "response": { + "$ref": "TablesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + }, + "patch": { + "id": "mapsengine.tables.patch", + "path": "tables/{id}", + "httpMethod": "PATCH", + "description": "Mutate a table asset.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the table.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "Table" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "process": { + "id": "mapsengine.tables.process", + "path": "tables/{id}/process", + "httpMethod": "POST", + "description": "Process a table asset.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the table.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "ProcessResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "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. The maximum supported value is 1000.", + "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" + ] + } + } + }, + "permissions": { + "methods": { + "batchDelete": { + "id": "mapsengine.tables.permissions.batchDelete", + "path": "tables/{id}/permissions/batchDelete", + "httpMethod": "POST", + "description": "Remove permission entries from an already existing asset.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the asset from which permissions will be removed.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "PermissionsBatchDeleteRequest" + }, + "response": { + "$ref": "PermissionsBatchDeleteResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "batchUpdate": { + "id": "mapsengine.tables.permissions.batchUpdate", + "path": "tables/{id}/permissions/batchUpdate", + "httpMethod": "POST", + "description": "Add or update permission entries to an already existing asset.\n\nAn asset can hold up to 20 different permission entries. Each batchInsert request is atomic.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the asset to which permissions will be added.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "request": { + "$ref": "PermissionsBatchUpdateRequest" + }, + "response": { + "$ref": "PermissionsBatchUpdateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine" + ] + }, + "list": { + "id": "mapsengine.tables.permissions.list", + "path": "tables/{id}/permissions", + "httpMethod": "GET", + "description": "Return all of the permissions for the specified asset.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the asset whose permissions will be listed.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "PermissionsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/mapsengine", + "https://www.googleapis.com/auth/mapsengine.readonly" + ] + } + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/mapsengine/v1/mapsengine-gen.go b/Godeps/_workspace/src/google.golang.org/api/mapsengine/v1/mapsengine-gen.go new file mode 100644 index 000000000..c5599aaa8 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/mapsengine/v1/mapsengine-gen.go @@ -0,0 +1,14552 @@ +// Package mapsengine provides access to the Google Maps Engine API. +// +// See https://developers.google.com/maps-engine/ +// +// Usage example: +// +// import "google.golang.org/api/mapsengine/v1" +// ... +// mapsengineService, err := mapsengine.New(oauthHttpClient) +package mapsengine // import "google.golang.org/api/mapsengine/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 My Maps data + MapsengineScope = "https://www.googleapis.com/auth/mapsengine" + + // View your Google My Maps 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 + UserAgent string // optional additional User-Agent fragment + + Assets *AssetsService + + Layers *LayersService + + Maps *MapsService + + Projects *ProjectsService + + RasterCollections *RasterCollectionsService + + Rasters *RastersService + + Tables *TablesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAssetsService(s *Service) *AssetsService { + rs := &AssetsService{s: s} + rs.Parents = NewAssetsParentsService(s) + rs.Permissions = NewAssetsPermissionsService(s) + return rs +} + +type AssetsService struct { + s *Service + + Parents *AssetsParentsService + + Permissions *AssetsPermissionsService +} + +func NewAssetsParentsService(s *Service) *AssetsParentsService { + rs := &AssetsParentsService{s: s} + return rs +} + +type AssetsParentsService struct { + s *Service +} + +func NewAssetsPermissionsService(s *Service) *AssetsPermissionsService { + rs := &AssetsPermissionsService{s: s} + return rs +} + +type AssetsPermissionsService struct { + s *Service +} + +func NewLayersService(s *Service) *LayersService { + rs := &LayersService{s: s} + rs.Parents = NewLayersParentsService(s) + rs.Permissions = NewLayersPermissionsService(s) + return rs +} + +type LayersService struct { + s *Service + + Parents *LayersParentsService + + Permissions *LayersPermissionsService +} + +func NewLayersParentsService(s *Service) *LayersParentsService { + rs := &LayersParentsService{s: s} + return rs +} + +type LayersParentsService struct { + s *Service +} + +func NewLayersPermissionsService(s *Service) *LayersPermissionsService { + rs := &LayersPermissionsService{s: s} + return rs +} + +type LayersPermissionsService struct { + s *Service +} + +func NewMapsService(s *Service) *MapsService { + rs := &MapsService{s: s} + rs.Permissions = NewMapsPermissionsService(s) + return rs +} + +type MapsService struct { + s *Service + + Permissions *MapsPermissionsService +} + +func NewMapsPermissionsService(s *Service) *MapsPermissionsService { + rs := &MapsPermissionsService{s: s} + return rs +} + +type MapsPermissionsService struct { + s *Service +} + +func NewProjectsService(s *Service) *ProjectsService { + rs := &ProjectsService{s: s} + rs.Icons = NewProjectsIconsService(s) + return rs +} + +type ProjectsService struct { + s *Service + + Icons *ProjectsIconsService +} + +func NewProjectsIconsService(s *Service) *ProjectsIconsService { + rs := &ProjectsIconsService{s: s} + return rs +} + +type ProjectsIconsService struct { + s *Service +} + +func NewRasterCollectionsService(s *Service) *RasterCollectionsService { + rs := &RasterCollectionsService{s: s} + rs.Parents = NewRasterCollectionsParentsService(s) + rs.Permissions = NewRasterCollectionsPermissionsService(s) + rs.Rasters = NewRasterCollectionsRastersService(s) + return rs +} + +type RasterCollectionsService struct { + s *Service + + Parents *RasterCollectionsParentsService + + Permissions *RasterCollectionsPermissionsService + + Rasters *RasterCollectionsRastersService +} + +func NewRasterCollectionsParentsService(s *Service) *RasterCollectionsParentsService { + rs := &RasterCollectionsParentsService{s: s} + return rs +} + +type RasterCollectionsParentsService struct { + s *Service +} + +func NewRasterCollectionsPermissionsService(s *Service) *RasterCollectionsPermissionsService { + rs := &RasterCollectionsPermissionsService{s: s} + return rs +} + +type RasterCollectionsPermissionsService 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) + rs.Permissions = NewRastersPermissionsService(s) + return rs +} + +type RastersService struct { + s *Service + + Files *RastersFilesService + + Parents *RastersParentsService + + Permissions *RastersPermissionsService +} + +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 NewRastersPermissionsService(s *Service) *RastersPermissionsService { + rs := &RastersPermissionsService{s: s} + return rs +} + +type RastersPermissionsService struct { + s *Service +} + +func NewTablesService(s *Service) *TablesService { + rs := &TablesService{s: s} + rs.Features = NewTablesFeaturesService(s) + rs.Files = NewTablesFilesService(s) + rs.Parents = NewTablesParentsService(s) + rs.Permissions = NewTablesPermissionsService(s) + return rs +} + +type TablesService struct { + s *Service + + Features *TablesFeaturesService + + Files *TablesFilesService + + Parents *TablesParentsService + + Permissions *TablesPermissionsService +} + +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 +} + +func NewTablesPermissionsService(s *Service) *TablesPermissionsService { + rs := &TablesPermissionsService{s: s} + return rs +} + +type TablesPermissionsService struct { + s *Service +} + +// AcquisitionTime: Acquisition time represents acquired time of a +// raster. +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. + // + // Possible values: + // "day" + // "hour" + // "minute" + // "month" + // "second" + // "year" + 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"` + + // ForceSendFields is a list of field names (e.g. "End") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AcquisitionTime) MarshalJSON() ([]byte, error) { + type noMethod AcquisitionTime + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Asset: 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. +// +// More detailed information about an asset can be obtained by querying +// the asset's particular endpoint. +type Asset struct { + // Bbox: A rectangular bounding box which contains all of the data in + // this asset. The box is expressed as \"west, south, east, north\". 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"` + + // CreatorEmail: The email address of the creator of this asset. This is + // only returned on GET requests and not LIST requests. + CreatorEmail string `json:"creatorEmail,omitempty"` + + // Description: The asset's description. + Description string `json:"description,omitempty"` + + // Etag: The ETag, used to refer to the current version of the asset. + Etag string `json:"etag,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"` + + // LastModifierEmail: The email address of the last modifier of this + // asset. This is only returned on GET requests and not LIST requests. + LastModifierEmail string `json:"lastModifierEmail,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. + // + // Possible values: + // "layer" + // "map" + // "raster" + // "rasterCollection" + // "table" + Type string `json:"type,omitempty"` + + // WritersCanEditPermissions: If true, WRITERs of the asset are able to + // edit the asset permissions. + WritersCanEditPermissions bool `json:"writersCanEditPermissions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Bbox") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Asset) MarshalJSON() ([]byte, error) { + type noMethod Asset + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AssetsListResponse: The response returned by a call to +// resources.List. +type AssetsListResponse struct { + // Assets: Assets returned. + Assets []*Asset `json:"assets,omitempty"` + + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Assets") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AssetsListResponse) MarshalJSON() ([]byte, error) { + type noMethod AssetsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Border: Border in line style. Both color and width are required. +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"` + + // ForceSendFields is a list of field names (e.g. "Color") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Border) MarshalJSON() ([]byte, error) { + type noMethod Border + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Color: Basic color used in styling. +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"` + + // ForceSendFields is a list of field names (e.g. "Color") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Color) MarshalJSON() ([]byte, error) { + type noMethod Color + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Datasource struct { + // Id: The ID of a datasource. + Id string `json:"id,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Datasource) MarshalJSON() ([]byte, error) { + type noMethod Datasource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DisplayRule: A display rule of the vector style. +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"` + + // ForceSendFields is a list of field names (e.g. "Filters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DisplayRule) MarshalJSON() ([]byte, error) { + type noMethod DisplayRule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Feature: A feature within a table. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Geometry") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Feature) MarshalJSON() ([]byte, error) { + type noMethod Feature + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FeatureInfo: A feature info contains information about individual +// feature. +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"` + + // ForceSendFields is a list of field names (e.g. "Content") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FeatureInfo) MarshalJSON() ([]byte, error) { + type noMethod FeatureInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FeaturesBatchDeleteRequest: The request sent to features.BatchDelete. +type FeaturesBatchDeleteRequest struct { + GxIds []string `json:"gx_ids,omitempty"` + + PrimaryKeys []string `json:"primaryKeys,omitempty"` + + // ForceSendFields is a list of field names (e.g. "GxIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FeaturesBatchDeleteRequest) MarshalJSON() ([]byte, error) { + type noMethod FeaturesBatchDeleteRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FeaturesBatchInsertRequest: The request sent to features.Insert. +type FeaturesBatchInsertRequest struct { + Features []*Feature `json:"features,omitempty"` + + // NormalizeGeometries: If true, the server will normalize feature + // geometries. It is assumed that the South Pole is exterior to any + // polygons given. See here for a list of normalizations. If false, all + // feature geometries must be given already normalized. The points in + // all LinearRings must be listed in counter-clockwise order, and + // LinearRings may not intersect. + // + // Default: true + NormalizeGeometries *bool `json:"normalizeGeometries,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Features") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FeaturesBatchInsertRequest) MarshalJSON() ([]byte, error) { + type noMethod FeaturesBatchInsertRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FeaturesBatchPatchRequest: The request sent to features.BatchPatch. +type FeaturesBatchPatchRequest struct { + Features []*Feature `json:"features,omitempty"` + + // NormalizeGeometries: If true, the server will normalize feature + // geometries. It is assumed that the South Pole is exterior to any + // polygons given. See here for a list of normalizations. If false, all + // feature geometries must be given already normalized. The points in + // all LinearRings must be listed in counter-clockwise order, and + // LinearRings may not intersect. + // + // Default: true + NormalizeGeometries *bool `json:"normalizeGeometries,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Features") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FeaturesBatchPatchRequest) MarshalJSON() ([]byte, error) { + type noMethod FeaturesBatchPatchRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FeaturesListResponse: The response returned by a call to +// features.List. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "AllowedQueriesPerSecond") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FeaturesListResponse) MarshalJSON() ([]byte, error) { + type noMethod FeaturesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// File: A single File, which is a component of an Asset. +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. + // + // Possible values: + // "canceled" + // "complete" + // "failed" + // "inProgress" + UploadStatus string `json:"uploadStatus,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Filename") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *File) MarshalJSON() ([]byte, error) { + type noMethod File + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Filter: Conditions for filtering features. +type Filter struct { + // Column: The column name to filter on. + Column string `json:"column,omitempty"` + + // Operator: Operation used to evaluate the filter. + // + // Possible values: + // "!=" + // "<" + // "<=" + // "==" + // ">" + // ">=" + // "contains" + // "endsWith" + // "startsWith" + Operator string `json:"operator,omitempty"` + + // Value: Value to be evaluated against attribute. + Value interface{} `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Column") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Filter) MarshalJSON() ([]byte, error) { + type noMethod Filter + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GeoJsonGeometry map[string]interface{} + +func (t GeoJsonGeometry) Type() string { + return googleapi.VariantType(t) +} + +func (t GeoJsonGeometry) GeometryCollection() (r GeoJsonGeometryCollection, ok bool) { + if t.Type() != "GeometryCollection" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +func (t GeoJsonGeometry) LineString() (r GeoJsonLineString, ok bool) { + if t.Type() != "LineString" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +func (t GeoJsonGeometry) MultiLineString() (r GeoJsonMultiLineString, ok bool) { + if t.Type() != "MultiLineString" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +func (t GeoJsonGeometry) MultiPoint() (r GeoJsonMultiPoint, ok bool) { + if t.Type() != "MultiPoint" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +func (t GeoJsonGeometry) MultiPolygon() (r GeoJsonMultiPolygon, ok bool) { + if t.Type() != "MultiPolygon" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +func (t GeoJsonGeometry) Point() (r GeoJsonPoint, ok bool) { + if t.Type() != "Point" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +func (t GeoJsonGeometry) Polygon() (r GeoJsonPolygon, ok bool) { + if t.Type() != "Polygon" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +// GeoJsonGeometryCollection: A heterogenous collection of +// GeoJsonGeometry objects. +type GeoJsonGeometryCollection struct { + // Geometries: An array of geometry objects. There must be at least 2 + // different types of geometries in the array. + Geometries []GeoJsonGeometry `json:"geometries,omitempty"` + + // Type: Identifies this object as a GeoJsonGeometryCollection. + // + // Possible values: + // "GeometryCollection" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Geometries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoJsonGeometryCollection) MarshalJSON() ([]byte, error) { + type noMethod GeoJsonGeometryCollection + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GeoJsonLineString struct { + // Coordinates: An array of two or more positions, representing a line. + Coordinates [][]float64 `json:"coordinates,omitempty"` + + // Type: Identifies this object as a GeoJsonLineString. + // + // Possible values: + // "LineString" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Coordinates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoJsonLineString) MarshalJSON() ([]byte, error) { + type noMethod GeoJsonLineString + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GeoJsonMultiLineString: Multi Line String +type GeoJsonMultiLineString struct { + // Coordinates: An array of at least two GeoJsonLineString coordinate + // arrays. + Coordinates [][][]float64 `json:"coordinates,omitempty"` + + // Type: Identifies this object as a GeoJsonMultiLineString. + // + // Possible values: + // "MultiLineString" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Coordinates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoJsonMultiLineString) MarshalJSON() ([]byte, error) { + type noMethod GeoJsonMultiLineString + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GeoJsonMultiPoint struct { + // Coordinates: An array of at least two GeoJsonPoint coordinate arrays. + Coordinates [][]float64 `json:"coordinates,omitempty"` + + // Type: Identifies this object as a GeoJsonMultiPoint. + // + // Possible values: + // "MultiPoint" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Coordinates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoJsonMultiPoint) MarshalJSON() ([]byte, error) { + type noMethod GeoJsonMultiPoint + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GeoJsonMultiPolygon struct { + // Coordinates: An array of at least two GeoJsonPolygon coordinate + // arrays. + Coordinates [][][][]float64 `json:"coordinates,omitempty"` + + // Type: Identifies this object as a GeoJsonMultiPolygon. + // + // Possible values: + // "MultiPolygon" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Coordinates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoJsonMultiPolygon) MarshalJSON() ([]byte, error) { + type noMethod GeoJsonMultiPolygon + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GeoJsonPoint struct { + // Coordinates: A single GeoJsonPosition, specifying the location of the + // point. + Coordinates []float64 `json:"coordinates,omitempty"` + + // Type: Identifies this object as a GeoJsonPoint. + // + // Possible values: + // "Point" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Coordinates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoJsonPoint) MarshalJSON() ([]byte, error) { + type noMethod GeoJsonPoint + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GeoJsonPolygon struct { + // Coordinates: An array of LinearRings. A LinearRing is a + // GeoJsonLineString which is closed (that is, the first and last + // GeoJsonPositions are equal), and which contains at least four + // GeoJsonPositions. For polygons with multiple rings, the first + // LinearRing is the exterior ring, and any subsequent rings are + // interior rings (that is, holes). + Coordinates [][][]float64 `json:"coordinates,omitempty"` + + // Type: Identifies this object as a GeoJsonPolygon. + // + // Possible values: + // "Polygon" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Coordinates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoJsonPolygon) MarshalJSON() ([]byte, error) { + type noMethod GeoJsonPolygon + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type GeoJsonProperties interface{} + +// Icon: An icon is a user-uploaded image that can be used to style +// point geometries. +type Icon struct { + // Description: The description of this Icon, supplied by the author. + Description string `json:"description,omitempty"` + + // Id: An ID used to refer to this Icon. + Id string `json:"id,omitempty"` + + // Name: The name of this Icon, supplied by the author. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Icon) MarshalJSON() ([]byte, error) { + type noMethod Icon + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// IconStyle: Style for icon, this is part of point style. +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"` + + // ScaledShape: A scalable shape. + ScaledShape *ScaledShape `json:"scaledShape,omitempty"` + + // ScalingFunction: The function used to scale shapes. Required when a + // scaledShape is specified. + ScalingFunction *ScalingFunction `json:"scalingFunction,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *IconStyle) MarshalJSON() ([]byte, error) { + type noMethod IconStyle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// IconsListResponse: The response returned by a call to icons.List. +type IconsListResponse struct { + // Icons: Resources returned. + Icons []*Icon `json:"icons,omitempty"` + + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Icons") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *IconsListResponse) MarshalJSON() ([]byte, error) { + type noMethod IconsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LabelStyle: Text label style. +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'. + // + // Possible values: + // "italic" + // "normal" + FontStyle string `json:"fontStyle,omitempty"` + + // FontWeight: Font weight of the label, defaults to 'normal'. + // + // Possible values: + // "bold" + // "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"` + + // ForceSendFields is a list of field names (e.g. "Color") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LabelStyle) MarshalJSON() ([]byte, error) { + type noMethod LabelStyle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Layer: A Layer combines multiple datasources, with styling +// information, for presentation on a map. +type Layer struct { + // Bbox: A rectangular bounding box which contains all of the data in + // this Layer. The box is expressed as \"west, south, east, north\". The + // numbers represent latitude and longitude 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"` + + // CreatorEmail: The email address of the creator of this layer. This is + // only returned on GET requests and not LIST requests. + CreatorEmail string `json:"creatorEmail,omitempty"` + + // DatasourceType: Deprecated: The type of the datasources used to build + // this Layer. Note: This has been replaced by layerType, but is still + // available for now to maintain backward compatibility. + // + // Possible values: + // "image" + // "table" + DatasourceType string `json:"datasourceType,omitempty"` + + // Datasources: An array of datasources used to build this layer. If + // layerType is "image", or layerType is not specified and + // datasourceType is "image", then each element in this array is a + // reference to an Image or RasterCollection. If layerType is "vector", + // or layerType is not specified and 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: Deprecated: 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. Note: Google Maps Engine no longer + // uses access lists. Instead, each asset has its own list of + // permissions. For backward compatibility, the API still accepts access + // lists for projects that are already using access lists. If you + // created a GME account/project after July 14th, 2014, you will not be + // able to send API requests that include access lists. Note: This is an + // input field only. It is not returned in response to a list or get + // request. + DraftAccessList string `json:"draftAccessList,omitempty"` + + // Etag: The ETag, used to refer to the current version of the asset. + Etag string `json:"etag,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"` + + // LastModifierEmail: The email address of the last modifier of this + // layer. This is only returned on GET requests and not LIST requests. + LastModifierEmail string `json:"lastModifierEmail,omitempty"` + + // LayerType: The type of the datasources used to build this Layer. This + // should be used instead of datasourceType. At least one of layerType + // and datasourceType and must be specified, but layerType takes + // precedence. + // + // Possible values: + // "image" + // "vector" + LayerType string `json:"layerType,omitempty"` + + // Name: The name of this Layer, supplied by the author. + Name string `json:"name,omitempty"` + + // ProcessingStatus: The processing status of this layer. + // + // Possible values: + // "complete" + // "failed" + // "notReady" + // "processing" + // "ready" + ProcessingStatus string `json:"processingStatus,omitempty"` + + // ProjectId: The ID of the project that this Layer is in. + ProjectId string `json:"projectId,omitempty"` + + // PublishedAccessList: Deprecated: 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. Note: Google Maps Engine no longer uses access lists. + // Instead, each asset has its own list of permissions. For backward + // compatibility, the API still accepts access lists for projects that + // are already using access lists. If you created a GME account/project + // after July 14th, 2014, you will not be able to send API requests that + // include access lists. Note: This is an input field only. It is not + // returned in response to a list or get request. + PublishedAccessList string `json:"publishedAccessList,omitempty"` + + // PublishingStatus: The publishing status of this layer. + // + // Possible values: + // "notPublished" + // "published" + PublishingStatus string `json:"publishingStatus,omitempty"` + + // Style: The styling information for a vector layer. Note: Style + // information is returned in response to a get request but not a list + // request. After requesting a list of layers, you'll need to send a get + // request to retrieve the VectorStyles for each layer. + Style *VectorStyle `json:"style,omitempty"` + + // Tags: Tags of this Layer. + Tags []string `json:"tags,omitempty"` + + // WritersCanEditPermissions: If true, WRITERs of the asset are able to + // edit the asset permissions. + WritersCanEditPermissions bool `json:"writersCanEditPermissions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Bbox") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Layer) MarshalJSON() ([]byte, error) { + type noMethod Layer + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LayersListResponse: The response returned by a call to layers.List. +// Note: The list response does not include all the fields available in +// a layer. Refer to the layer resource description for details of the +// fields that are not included. You'll need to send a get request to +// retrieve the additional fields for each layer. +type LayersListResponse struct { + // Layers: Resources returned. + Layers []*Layer `json:"layers,omitempty"` + + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Layers") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LayersListResponse) MarshalJSON() ([]byte, error) { + type noMethod LayersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LineStyle: Style for lines. +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"` + + // ForceSendFields is a list of field names (e.g. "Border") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LineStyle) MarshalJSON() ([]byte, error) { + type noMethod LineStyle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LineStyleStroke: Stroke of the line. +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"` + + // ForceSendFields is a list of field names (e.g. "Color") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LineStyleStroke) MarshalJSON() ([]byte, error) { + type noMethod LineStyleStroke + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Map: A Map is a collection of Layers, optionally contained within +// folders. +type Map struct { + // Bbox: A rectangular bounding box which contains all of the data in + // this Map. The box is expressed as \"west, south, east, north\". 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"` + + // CreatorEmail: The email address of the creator of this map. This is + // only returned on GET requests and not LIST requests. + CreatorEmail string `json:"creatorEmail,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"` + + // DraftAccessList: Deprecated: 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. Note: Google Maps Engine no longer + // uses access lists. Instead, each asset has its own list of + // permissions. For backward compatibility, the API still accepts access + // lists for projects that are already using access lists. If you + // created a GME account/project after July 14th, 2014, you will not be + // able to send API requests that include access lists. Note: This is an + // input field only. It is not returned in response to a list or get + // request. + DraftAccessList string `json:"draftAccessList,omitempty"` + + // Etag: The ETag, used to refer to the current version of the asset. + Etag string `json:"etag,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"` + + // LastModifierEmail: The email address of the last modifier of this + // map. This is only returned on GET requests and not LIST requests. + LastModifierEmail string `json:"lastModifierEmail,omitempty"` + + // Name: The name of this Map, supplied by the author. + Name string `json:"name,omitempty"` + + // ProcessingStatus: The processing status of this map. Map processing + // is automatically started once a map becomes ready for processing. + // + // Possible values: + // "complete" + // "failed" + // "notReady" + // "processing" + // "ready" + ProcessingStatus string `json:"processingStatus,omitempty"` + + // ProjectId: The ID of the project that this Map is in. + ProjectId string `json:"projectId,omitempty"` + + // PublishedAccessList: Deprecated: 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. Note: Google Maps Engine no longer uses access lists. + // Instead, each asset has its own list of permissions. For backward + // compatibility, the API still accepts access lists for projects that + // are already using access lists. If you created a GME account/project + // after July 14th, 2014, you will not be able to send API requests that + // include access lists. This is an input field only. It is not returned + // in response to a list or get request. + PublishedAccessList string `json:"publishedAccessList,omitempty"` + + // PublishingStatus: The publishing status of this map. + // + // Possible values: + // "notPublished" + // "published" + PublishingStatus string `json:"publishingStatus,omitempty"` + + // Tags: Tags of this Map. + Tags []string `json:"tags,omitempty"` + + // Versions: Deprecated: An array containing the available versions of + // this Map. Currently may only contain "published". The + // publishingStatus field should be used instead. + Versions []string `json:"versions,omitempty"` + + // WritersCanEditPermissions: If true, WRITERs of the asset are able to + // edit the asset permissions. + WritersCanEditPermissions bool `json:"writersCanEditPermissions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Bbox") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Map) MarshalJSON() ([]byte, error) { + type noMethod Map + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type MapFolder struct { + 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"` + + // Expandable: The expandability setting of this MapFolder. If true, the + // folder can be expanded. + Expandable bool `json:"expandable,omitempty"` + + // Key: A user defined alias for this MapFolder, specific to this Map. + Key string `json:"key,omitempty"` + + // Name: The name of this MapFolder. + Name string `json:"name,omitempty"` + + // Type: Identifies this object as a MapFolder. + // + // Possible values: + // "folder" + Type string `json:"type,omitempty"` + + // Visibility: The visibility setting of this MapFolder. One of + // "defaultOn" or "defaultOff". + Visibility string `json:"visibility,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Contents") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MapFolder) MarshalJSON() ([]byte, error) { + type noMethod MapFolder + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type MapItem map[string]interface{} + +func (t MapItem) Type() string { + return googleapi.VariantType(t) +} + +func (t MapItem) Folder() (r MapFolder, ok bool) { + if t.Type() != "Folder" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +func (t MapItem) KmlLink() (r MapKmlLink, ok bool) { + if t.Type() != "KmlLink" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +func (t MapItem) Layer() (r MapLayer, ok bool) { + if t.Type() != "Layer" { + return r, false + } + ok = googleapi.ConvertVariant(map[string]interface{}(t), &r) + return r, ok +} + +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 MapKmlLink. + KmlUrl string `json:"kmlUrl,omitempty"` + + // Name: The name of this MapKmlLink. + Name string `json:"name,omitempty"` + + // Type: Identifies this object as a MapKmlLink. + // + // Possible values: + // "kmlLink" + Type string `json:"type,omitempty"` + + // Visibility: The visibility setting of this MapKmlLink. One of + // "defaultOn" or "defaultOff". + Visibility string `json:"visibility,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DefaultViewport") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MapKmlLink) MarshalJSON() ([]byte, error) { + type noMethod MapKmlLink + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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 MapLayer. This ID can be used to request more + // details about the layer. + Id string `json:"id,omitempty"` + + // Key: A user defined alias for this MapLayer, specific to this Map. + Key string `json:"key,omitempty"` + + // Name: The name of this MapLayer. + Name string `json:"name,omitempty"` + + // Type: Identifies this object as a MapLayer. + // + // Possible values: + // "layer" + Type string `json:"type,omitempty"` + + // Visibility: The visibility setting of this MapLayer. One of + // "defaultOn" or "defaultOff". + Visibility string `json:"visibility,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DefaultViewport") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MapLayer) MarshalJSON() ([]byte, error) { + type noMethod MapLayer + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MapsListResponse: The response returned by a call to maps.List. +type MapsListResponse struct { + // Maps: Resources returned. + Maps []*Map `json:"maps,omitempty"` + + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Maps") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MapsListResponse) MarshalJSON() ([]byte, error) { + type noMethod MapsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Parent: A list of the parents of an asset. +type Parent struct { + // Id: The ID of this parent. + Id string `json:"id,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Parent) MarshalJSON() ([]byte, error) { + type noMethod Parent + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ParentsListResponse: The response returned by a call to parents.List. +type ParentsListResponse struct { + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Parents: The parent assets. + Parents []*Parent `json:"parents,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ParentsListResponse) MarshalJSON() ([]byte, error) { + type noMethod ParentsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Permission: A permission defines the user or group that has access to +// an asset, and the type of access they have. +type Permission struct { + // Discoverable: Indicates whether a public asset is listed and can be + // found via a web search (value true), or is visible only to people who + // have a link to the asset (value false). + Discoverable bool `json:"discoverable,omitempty"` + + // Id: The unique identifier of the permission. This could be the email + // address of the user or group this permission refers to, or the string + // "anyone" for public permissions. + Id string `json:"id,omitempty"` + + // Role: The type of access granted to this user or group. + // + // Possible values: + // "owner" + // "reader" + // "viewer" + // "writer" + Role string `json:"role,omitempty"` + + // Type: The account type. + // + // Possible values: + // "anyone" + // "group" + // "user" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Discoverable") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Permission) MarshalJSON() ([]byte, error) { + type noMethod Permission + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PermissionsBatchDeleteRequest: The request sent to +// mapsengine.permissions.batchDelete. +type PermissionsBatchDeleteRequest struct { + // Ids: An array of permission ids to be removed. This could be the + // email address of the user or group this permission refers to, or the + // string "anyone" for public permissions. + Ids []string `json:"ids,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Ids") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PermissionsBatchDeleteRequest) MarshalJSON() ([]byte, error) { + type noMethod PermissionsBatchDeleteRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PermissionsBatchDeleteResponse: The response returned by a call to +// mapsengine.permissions.batchDelete. +type PermissionsBatchDeleteResponse struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// PermissionsBatchUpdateRequest: The request sent to +// mapsengine.permissions.batchUpdate. +type PermissionsBatchUpdateRequest struct { + // Permissions: The permissions to be inserted or updated. + Permissions []*Permission `json:"permissions,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Permissions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PermissionsBatchUpdateRequest) MarshalJSON() ([]byte, error) { + type noMethod PermissionsBatchUpdateRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PermissionsBatchUpdateResponse: The response returned by a call to +// mapsengine.permissions.batchUpdate. +type PermissionsBatchUpdateResponse struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +type PermissionsListResponse struct { + // Permissions: The set of permissions associated with this asset. + Permissions []*Permission `json:"permissions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Permissions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PermissionsListResponse) MarshalJSON() ([]byte, error) { + type noMethod PermissionsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PointStyle: Style for points. +type PointStyle struct { + // Icon: Icon for the point; if it isn't null, exactly one of 'name', + // 'id' or 'scaledShape' must be set. + Icon *IconStyle `json:"icon,omitempty"` + + // Label: Label style for the point. + Label *LabelStyle `json:"label,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Icon") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PointStyle) MarshalJSON() ([]byte, error) { + type noMethod PointStyle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PolygonStyle: Style for polygons. +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"` + + // Label: Label style for the polygon. + Label *LabelStyle `json:"label,omitempty"` + + // Stroke: Border of the polygon. 0 < border.width <= 10. + Stroke *Border `json:"stroke,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Fill") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PolygonStyle) MarshalJSON() ([]byte, error) { + type noMethod PolygonStyle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ProcessResponse: The response returned by a call to any asset's +// Process method. +type ProcessResponse struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// Project: A Maps Engine project groups a collection of resources. +type Project struct { + // Id: An ID used to refer to this Maps Engine project. + Id string `json:"id,omitempty"` + + // Name: A user provided name for this Maps Engine project. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Project) MarshalJSON() ([]byte, error) { + type noMethod Project + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ProjectsListResponse: The response returned by a call to +// projects.List. +type ProjectsListResponse struct { + // Projects: Projects returned. + Projects []*Project `json:"projects,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Projects") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ProjectsListResponse) MarshalJSON() ([]byte, error) { + type noMethod ProjectsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PublishResponse: The response returned by a call to any asset's +// Publish method. +type PublishResponse struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// PublishedLayer: The published version of a layer. +type PublishedLayer struct { + // Description: The description of this Layer, supplied by the author. + Description string `json:"description,omitempty"` + + // Id: A globally unique ID, used to refer to this Layer. + Id string `json:"id,omitempty"` + + // LayerType: The type of the datasources used to build this Layer. This + // should be used instead of datasourceType. At least one of layerType + // and datasourceType and must be specified, but layerType takes + // precedence. + // + // Possible values: + // "image" + // "vector" + LayerType string `json:"layerType,omitempty"` + + // Name: The name of this Layer, supplied by the author. + Name string `json:"name,omitempty"` + + // ProjectId: The ID of the project that this Layer is in. + ProjectId string `json:"projectId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PublishedLayer) MarshalJSON() ([]byte, error) { + type noMethod PublishedLayer + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PublishedLayersListResponse: The response returned by a call to +// layers.List.published. +type PublishedLayersListResponse struct { + // Layers: Resources returned. + Layers []*PublishedLayer `json:"layers,omitempty"` + + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Layers") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PublishedLayersListResponse) MarshalJSON() ([]byte, error) { + type noMethod PublishedLayersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PublishedMap: The published version of a map asset. +type PublishedMap struct { + // Contents: The contents of this Map. + 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"` + + // 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"` + + // 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Contents") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PublishedMap) MarshalJSON() ([]byte, error) { + type noMethod PublishedMap + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PublishedMapsListResponse: The response returned by a call to +// maps.List.published. +type PublishedMapsListResponse struct { + // Maps: Resources returned. + Maps []*PublishedMap `json:"maps,omitempty"` + + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Maps") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PublishedMapsListResponse) MarshalJSON() ([]byte, error) { + type noMethod PublishedMapsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Raster: A geo-referenced raster. +type Raster 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: A rectangular bounding box which contains all of the data in + // this Raster. The box is expressed as \"west, south, east, north\". + // 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"` + + // CreatorEmail: The email address of the creator of this raster. This + // is only returned on GET requests and not LIST requests. + CreatorEmail string `json:"creatorEmail,omitempty"` + + // Description: The description of this Raster, supplied by the author. + Description string `json:"description,omitempty"` + + // DraftAccessList: Deprecated: 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. Note: Google Maps Engine no longer + // uses access lists. Instead, each asset has its own list of + // permissions. For backward compatibility, the API still accepts access + // lists for projects that are already using access lists. If you + // created a GME account/project after July 14th, 2014, you will not be + // able to send API requests that include access lists. Note: This is an + // input field only. It is not returned in response to a list or get + // request. + DraftAccessList string `json:"draftAccessList,omitempty"` + + // Etag: The ETag, used to refer to the current version of the asset. + Etag string `json:"etag,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"` + + // LastModifierEmail: The email address of the last modifier of this + // raster. This is only returned on GET requests and not LIST requests. + LastModifierEmail string `json:"lastModifierEmail,omitempty"` + + // MaskType: The mask processing type of this Raster. + 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. + // + // Possible values: + // "complete" + // "failed" + // "notReady" + // "processing" + // "ready" + 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. + // + // Possible values: + // "image" + RasterType string `json:"rasterType,omitempty"` + + // Tags: Tags of this Raster. + Tags []string `json:"tags,omitempty"` + + // WritersCanEditPermissions: If true, WRITERs of the asset are able to + // edit the asset permissions. + WritersCanEditPermissions bool `json:"writersCanEditPermissions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AcquisitionTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Raster) MarshalJSON() ([]byte, error) { + type noMethod Raster + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RasterCollection: A raster collection groups multiple Raster +// resources for inclusion in a Layer. +type RasterCollection struct { + // Attribution: The name of the attribution to be used for this + // RasterCollection. Note: Attribution is returned in response to a get + // request but not a list request. After requesting a list of raster + // collections, you'll need to send a get request to retrieve the + // attribution for each raster collection. + Attribution string `json:"attribution,omitempty"` + + // Bbox: A rectangular bounding box which contains all of the data in + // this RasterCollection. The box is expressed as \"west, south, east, + // north\". The numbers represent latitude and longitude 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"` + + // CreatorEmail: The email address of the creator of this raster + // collection. This is only returned on GET requests and not LIST + // requests. + CreatorEmail string `json:"creatorEmail,omitempty"` + + // Description: The description of this RasterCollection, supplied by + // the author. + Description string `json:"description,omitempty"` + + // DraftAccessList: Deprecated: 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. Note: Google Maps Engine no longer + // uses access lists. Instead, each asset has its own list of + // permissions. For backward compatibility, the API still accepts access + // lists for projects that are already using access lists. If you + // created a GME account/project after July 14th, 2014, you will not be + // able to send API requests that include access lists. Note: This is an + // input field only. It is not returned in response to a list or get + // request. + DraftAccessList string `json:"draftAccessList,omitempty"` + + // Etag: The ETag, used to refer to the current version of the asset. + Etag string `json:"etag,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"` + + // LastModifierEmail: The email address of the last modifier of this + // raster collection. This is only returned on GET requests and not LIST + // requests. + LastModifierEmail string `json:"lastModifierEmail,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"` + + // ProcessingStatus: The processing status of this RasterCollection. + // + // Possible values: + // "complete" + // "failed" + // "notReady" + // "processing" + // "ready" + ProcessingStatus string `json:"processingStatus,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. + // + // Possible values: + // "image" + RasterType string `json:"rasterType,omitempty"` + + // Tags: Tags of this RasterCollection. + Tags []string `json:"tags,omitempty"` + + // WritersCanEditPermissions: If true, WRITERs of the asset are able to + // edit the asset permissions. + WritersCanEditPermissions bool `json:"writersCanEditPermissions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Attribution") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RasterCollection) MarshalJSON() ([]byte, error) { + type noMethod RasterCollection + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RasterCollectionsListResponse: The response returned by a call to +// raster_collections.List. Note: The list response does not include all +// the fields available in a raster collection. Refer to the +// RasterCollection resource description for details of the fields that +// are not included. You'll need to send a get request to retrieve the +// additional fields for each raster collection. +type RasterCollectionsListResponse struct { + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // RasterCollections: Resources returned. + RasterCollections []*RasterCollection `json:"rasterCollections,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RasterCollectionsListResponse) MarshalJSON() ([]byte, error) { + type noMethod RasterCollectionsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RasterCollectionsRaster: A raster resource. +type RasterCollectionsRaster struct { + // Bbox: A rectangular bounding box which contains all of the data in + // this Raster. The box is expressed as \"west, south, east, north\". + // 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"` + + // ForceSendFields is a list of field names (e.g. "Bbox") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RasterCollectionsRaster) MarshalJSON() ([]byte, error) { + type noMethod RasterCollectionsRaster + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RasterCollectionsRasterBatchDeleteRequest: The request sent to +// rasterCollections.Rasters.BatchDelete. +type RasterCollectionsRasterBatchDeleteRequest struct { + // Ids: An array of Raster asset IDs to be removed from this + // RasterCollection. + Ids []string `json:"ids,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Ids") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RasterCollectionsRasterBatchDeleteRequest) MarshalJSON() ([]byte, error) { + type noMethod RasterCollectionsRasterBatchDeleteRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RasterCollectionsRastersBatchDeleteResponse: The response returned by +// a call to rasterCollections.rasters.batchDelete. +type RasterCollectionsRastersBatchDeleteResponse struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// RasterCollectionsRastersBatchInsertRequest: The request sent to +// rasterCollections.Rasters.BatchInsert. +type RasterCollectionsRastersBatchInsertRequest struct { + // Ids: An array of Raster asset IDs to be added to this + // RasterCollection. + Ids []string `json:"ids,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Ids") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RasterCollectionsRastersBatchInsertRequest) MarshalJSON() ([]byte, error) { + type noMethod RasterCollectionsRastersBatchInsertRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RasterCollectionsRastersBatchInsertResponse: The response returned by +// a call to rasterCollections.rasters.batchInsert. +type RasterCollectionsRastersBatchInsertResponse struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// RasterCollectionsRastersListResponse: The response returned by a call +// to rasterCollections.rasters.List. +type RasterCollectionsRastersListResponse struct { + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Rasters: Resources returned. + Rasters []*RasterCollectionsRaster `json:"rasters,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RasterCollectionsRastersListResponse) MarshalJSON() ([]byte, error) { + type noMethod RasterCollectionsRastersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RastersListResponse: The response returned by a call to rasters.List. +type RastersListResponse struct { + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Rasters: Resources returned. + Rasters []*Raster `json:"rasters,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RastersListResponse) MarshalJSON() ([]byte, error) { + type noMethod RastersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ScaledShape: Parameters for styling points as scaled shapes. +type ScaledShape struct { + // Border: Border color/width of the shape. If not specified the shape + // won't have a border. + Border *Border `json:"border,omitempty"` + + // Fill: The fill color of the shape. If not specified the shape will be + // transparent (although the borders may not be). + Fill *Color `json:"fill,omitempty"` + + // Shape: Name of the shape. + // + // Possible values: + // "circle" + Shape string `json:"shape,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Border") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ScaledShape) MarshalJSON() ([]byte, error) { + type noMethod ScaledShape + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ScalingFunction: Parameters for scaling scaled shapes. +type ScalingFunction struct { + // Column: Name of the numeric column used to scale a shape. + Column string `json:"column,omitempty"` + + // ScalingType: The type of scaling function to use. Defaults to SQRT. + // Currently only linear and square root scaling are supported. + // + // Possible values: + // "linear" + // "sqrt" + ScalingType string `json:"scalingType,omitempty"` + + // SizeRange: The range of shape sizes, in pixels. For circles, the size + // corresponds to the diameter. + SizeRange *SizeRange `json:"sizeRange,omitempty"` + + // ValueRange: The range of values to display across the size range. + ValueRange *ValueRange `json:"valueRange,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Column") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ScalingFunction) MarshalJSON() ([]byte, error) { + type noMethod ScalingFunction + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Schema: A schema indicating the properties which may be associated +// with features within a Table, and the types of those properties. +type Schema struct { + // Columns: An array of TableColumn objects. The first object in the + // array must be named geometry and be of type points, lineStrings, + // polygons, or mixedGeometry. + Columns []*TableColumn `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"` + + // ForceSendFields is a list of field names (e.g. "Columns") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Schema) MarshalJSON() ([]byte, error) { + type noMethod Schema + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SizeRange: Scaled shape size range in pixels. For circles, size +// corresponds to diameter. +type SizeRange struct { + // Max: Maximum size, in pixels. + Max float64 `json:"max,omitempty"` + + // Min: Minimum size, in pixels. + Min float64 `json:"min,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Max") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SizeRange) MarshalJSON() ([]byte, error) { + type noMethod SizeRange + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Table: A collection of geographic features, and associated metadata. +type Table struct { + // Bbox: A rectangular bounding box which contains all of the data in + // this Table. The box is expressed as \"west, south, east, north\". The + // numbers represent latitude and longitude in decimal degrees. + 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"` + + // CreatorEmail: The email address of the creator of this table. This is + // only returned on GET requests and not LIST requests. + CreatorEmail string `json:"creatorEmail,omitempty"` + + // Description: The description of this table, supplied by the author. + Description string `json:"description,omitempty"` + + // DraftAccessList: Deprecated: 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. Note: Google Maps Engine no longer + // uses access lists. Instead, each asset has its own list of + // permissions. For backward compatibility, the API still accepts access + // lists for projects that are already using access lists. If you + // created a GME account/project after July 14th, 2014, you will not be + // able to send API requests that include access lists. Note: This is an + // input field only. It is not returned in response to a list or get + // request. + DraftAccessList string `json:"draftAccessList,omitempty"` + + // Etag: The ETag, used to refer to the current version of the asset. + Etag string `json:"etag,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"` + + // LastModifierEmail: The email address of the last modifier of this + // table. This is only returned on GET requests and not LIST requests. + LastModifierEmail string `json:"lastModifierEmail,omitempty"` + + // Name: The name of this table, supplied by the author. + Name string `json:"name,omitempty"` + + // ProcessingStatus: The processing status of this table. + // + // Possible values: + // "complete" + // "failed" + // "notReady" + // "processing" + // "ready" + ProcessingStatus string `json:"processingStatus,omitempty"` + + // ProjectId: The ID of the project to which the table belongs. + ProjectId string `json:"projectId,omitempty"` + + // PublishedAccessList: Deprecated: 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. Note: Google Maps Engine no longer uses access lists. + // Instead, each asset has its own list of permissions. For backward + // compatibility, the API still accepts access lists for projects that + // are already using access lists. If you created a GME account/project + // after July 14th, 2014, you will not be able to send API requests that + // include access lists. Note: This is an input field only. It is not + // returned in response to a list or get request. + PublishedAccessList string `json:"publishedAccessList,omitempty"` + + // Schema: The schema for this table. Note: The schema is returned in + // response to a get request but not a list request. After requesting a + // list of tables, you'll need to send a get request to retrieve the + // schema for each 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"` + + // WritersCanEditPermissions: If true, WRITERs of the asset are able to + // edit the asset permissions. + WritersCanEditPermissions bool `json:"writersCanEditPermissions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Bbox") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Table) MarshalJSON() ([]byte, error) { + type noMethod Table + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TableColumn struct { + // Name: The column name. + Name string `json:"name,omitempty"` + + // Type: The type of data stored in this column. + // + // Possible values: + // "datetime" + // "double" + // "integer" + // "lineStrings" + // "mixedGeometry" + // "points" + // "polygons" + // "string" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TableColumn) MarshalJSON() ([]byte, error) { + type noMethod TableColumn + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TablesListResponse: The response returned by a call to tables.List. +// Note: The list response does not include all the fields available in +// a table. Refer to the table resource description for details of the +// fields that are not included. You'll need to send a get request to +// retrieve the additional fields for each table. +type TablesListResponse struct { + // NextPageToken: Next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Tables: Resources returned. + Tables []*Table `json:"tables,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TablesListResponse) MarshalJSON() ([]byte, error) { + type noMethod TablesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ValueRange: Range of values used for scaling shapes. The min/max +// values will be drawn as shapes with the min/max size. +type ValueRange struct { + // Max: Maximum value. + Max float64 `json:"max,omitempty"` + + // Min: Minimum value. + Min float64 `json:"min,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Max") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ValueRange) MarshalJSON() ([]byte, error) { + type noMethod ValueRange + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VectorStyle: A vector style contains styling information for vector +// layer. +type VectorStyle struct { + 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. + // + // Possible values: + // "displayRule" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DisplayRules") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VectorStyle) MarshalJSON() ([]byte, error) { + type noMethod VectorStyle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ZoomLevels: Zoom level range. Zoom levels are restricted between 0 +// and 24, inclusive. +type ZoomLevels struct { + // Max: Maximum zoom level. + Max int64 `json:"max,omitempty"` + + // Min: Minimum zoom level. + Min int64 `json:"min,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Max") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ZoomLevels) MarshalJSON() ([]byte, error) { + type noMethod ZoomLevels + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "mapsengine.assets.get": + +type AssetsGetCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AssetsGetCall) Fields(s ...googleapi.Field) *AssetsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AssetsGetCall) IfNoneMatch(entityTag string) *AssetsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AssetsGetCall) Context(ctx context.Context) *AssetsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AssetsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "assets/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.assets.get" call. +// Exactly one of *Asset or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Asset.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AssetsGetCall) Do() (*Asset, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Asset{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Asset" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Role sets the optional parameter "role": The role parameter indicates +// that the response should only contain assets where the current user +// has the specified level of access. +// +// Possible values: +// "owner" - The user can read, write and administer the asset. +// "reader" - The user can read the asset. +// "writer" - The user can read and write the asset. +func (c *AssetsListCall) Role(role string) *AssetsListCall { + c.opt_["role"] = role + return c +} + +// Search sets the optional parameter "search": An unstructured search +// string used to filter the set of results based on asset metadata. +func (c *AssetsListCall) Search(search string) *AssetsListCall { + c.opt_["search"] = search + return c +} + +// Tags sets the optional parameter "tags": A comma separated list of +// tags. Returned assets will contain all the tags from the list. +func (c *AssetsListCall) Tags(tags string) *AssetsListCall { + c.opt_["tags"] = tags + return c +} + +// Type sets the optional parameter "type": A comma separated list of +// asset types. Returned assets will have one of the types from the +// provided list. Supported values are 'map', 'layer', +// 'rasterCollection' and 'table'. +func (c *AssetsListCall) Type(type_ string) *AssetsListCall { + c.opt_["type"] = type_ + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AssetsListCall) Fields(s ...googleapi.Field) *AssetsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AssetsListCall) IfNoneMatch(entityTag string) *AssetsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AssetsListCall) Context(ctx context.Context) *AssetsListCall { + c.ctx_ = ctx + return c +} + +func (c *AssetsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["role"]; ok { + params.Set("role", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["search"]; ok { + params.Set("search", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["tags"]; ok { + params.Set("tags", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["type"]; ok { + params.Set("type", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.assets.list" call. +// Exactly one of *AssetsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AssetsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AssetsListCall) Do() (*AssetsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AssetsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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" + // }, + // "role": { + // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.", + // "enum": [ + // "owner", + // "reader", + // "writer" + // ], + // "enumDescriptions": [ + // "The user can read, write and administer the asset.", + // "The user can read the asset.", + // "The user can read and write the asset." + // ], + // "location": "query", + // "type": "string" + // }, + // "search": { + // "description": "An unstructured search string used to filter the set of results based on asset metadata.", + // "location": "query", + // "type": "string" + // }, + // "tags": { + // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.", + // "location": "query", + // "type": "string" + // }, + // "type": { + // "description": "A comma separated list of asset types. Returned assets will have one of the types from the provided list. Supported values are 'map', 'layer', 'rasterCollection' and 'table'.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "assets", + // "response": { + // "$ref": "AssetsListResponse" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AssetsParentsListCall) Fields(s ...googleapi.Field) *AssetsParentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AssetsParentsListCall) IfNoneMatch(entityTag string) *AssetsParentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AssetsParentsListCall) Context(ctx context.Context) *AssetsParentsListCall { + c.ctx_ = ctx + return c +} + +func (c *AssetsParentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "assets/{id}/parents") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.assets.parents.list" call. +// Exactly one of *ParentsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ParentsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AssetsParentsListCall) Do() (*ParentsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ParentsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.assets.permissions.list": + +type AssetsPermissionsListCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Return all of the permissions for the specified asset. +func (r *AssetsPermissionsService) List(id string) *AssetsPermissionsListCall { + c := &AssetsPermissionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AssetsPermissionsListCall) Fields(s ...googleapi.Field) *AssetsPermissionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AssetsPermissionsListCall) IfNoneMatch(entityTag string) *AssetsPermissionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AssetsPermissionsListCall) Context(ctx context.Context) *AssetsPermissionsListCall { + c.ctx_ = ctx + return c +} + +func (c *AssetsPermissionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "assets/{id}/permissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.assets.permissions.list" call. +// Exactly one of *PermissionsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PermissionsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AssetsPermissionsListCall) Do() (*PermissionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all of the permissions for the specified asset.", + // "httpMethod": "GET", + // "id": "mapsengine.assets.permissions.list", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset whose permissions will be listed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "assets/{id}/permissions", + // "response": { + // "$ref": "PermissionsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.layers.cancelProcessing": + +type LayersCancelProcessingCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// CancelProcessing: Cancel processing on a layer asset. +func (r *LayersService) CancelProcessing(id string) *LayersCancelProcessingCall { + c := &LayersCancelProcessingCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersCancelProcessingCall) Fields(s ...googleapi.Field) *LayersCancelProcessingCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersCancelProcessingCall) Context(ctx context.Context) *LayersCancelProcessingCall { + c.ctx_ = ctx + return c +} + +func (c *LayersCancelProcessingCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/cancelProcessing") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.cancelProcessing" call. +// Exactly one of *ProcessResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ProcessResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersCancelProcessingCall) Do() (*ProcessResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProcessResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Cancel processing on a layer asset.", + // "httpMethod": "POST", + // "id": "mapsengine.layers.cancelProcessing", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the layer.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "layers/{id}/cancelProcessing", + // "response": { + // "$ref": "ProcessResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.layers.create": + +type LayersCreateCall struct { + s *Service + layer *Layer + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersCreateCall) Fields(s ...googleapi.Field) *LayersCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersCreateCall) Context(ctx context.Context) *LayersCreateCall { + c.ctx_ = ctx + return c +} + +func (c *LayersCreateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["process"]; ok { + params.Set("process", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.create" call. +// Exactly one of *Layer or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Layer.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *LayersCreateCall) Do() (*Layer, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Layer{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.delete": + +type LayersDeleteCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Delete a layer. +func (r *LayersService) Delete(id string) *LayersDeleteCall { + c := &LayersDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersDeleteCall) Fields(s ...googleapi.Field) *LayersDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersDeleteCall) Context(ctx context.Context) *LayersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *LayersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.delete" call. +func (c *LayersDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a layer.", + // "httpMethod": "DELETE", + // "id": "mapsengine.layers.delete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the layer. Only the layer creator or project owner are permitted to delete. If the layer is published, or included in a map, the request will fail. Unpublish the layer, and remove it from all maps prior to deleting.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "layers/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.layers.get": + +type LayersGetCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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": Deprecated: The +// version parameter indicates which version of the layer should be +// returned. When version is set to published, the published version of +// the layer will be returned. Please use the layers.getPublished +// endpoint instead. +// +// Possible values: +// "draft" - The draft version. +// "published" - The published version. +func (c *LayersGetCall) Version(version string) *LayersGetCall { + c.opt_["version"] = version + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersGetCall) Fields(s ...googleapi.Field) *LayersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LayersGetCall) IfNoneMatch(entityTag string) *LayersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersGetCall) Context(ctx context.Context) *LayersGetCall { + c.ctx_ = ctx + return c +} + +func (c *LayersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["version"]; ok { + params.Set("version", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.get" call. +// Exactly one of *Layer or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Layer.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *LayersGetCall) Do() (*Layer, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Layer{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": { + // "description": "Deprecated: The version parameter indicates which version of the layer should be returned. When version is set to published, the published version of the layer will be returned. Please use the layers.getPublished endpoint instead.", + // "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.getPublished": + +type LayersGetPublishedCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetPublished: Return the published metadata for a particular layer. +func (r *LayersService) GetPublished(id string) *LayersGetPublishedCall { + c := &LayersGetPublishedCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersGetPublishedCall) Fields(s ...googleapi.Field) *LayersGetPublishedCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LayersGetPublishedCall) IfNoneMatch(entityTag string) *LayersGetPublishedCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersGetPublishedCall) Context(ctx context.Context) *LayersGetPublishedCall { + c.ctx_ = ctx + return c +} + +func (c *LayersGetPublishedCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/published") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.getPublished" call. +// Exactly one of *PublishedLayer or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PublishedLayer.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersGetPublishedCall) Do() (*PublishedLayer, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PublishedLayer{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return the published metadata for a particular layer.", + // "httpMethod": "GET", + // "id": "mapsengine.layers.getPublished", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the layer.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "layers/{id}/published", + // "response": { + // "$ref": "PublishedLayer" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// ProcessingStatus sets the optional parameter "processingStatus": +// +// Possible values: +// "complete" - The layer has completed processing. +// "failed" - The layer has failed processing. +// "notReady" - The layer is not ready for processing. +// "processing" - The layer is processing. +// "ready" - The layer is ready for processing. +func (c *LayersListCall) ProcessingStatus(processingStatus string) *LayersListCall { + c.opt_["processingStatus"] = processingStatus + 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 +} + +// Role sets the optional parameter "role": The role parameter indicates +// that the response should only contain assets where the current user +// has the specified level of access. +// +// Possible values: +// "owner" - The user can read, write and administer the asset. +// "reader" - The user can read the asset. +// "writer" - The user can read and write the asset. +func (c *LayersListCall) Role(role string) *LayersListCall { + c.opt_["role"] = role + return c +} + +// Search sets the optional parameter "search": An unstructured search +// string used to filter the set of results based on asset metadata. +func (c *LayersListCall) Search(search string) *LayersListCall { + c.opt_["search"] = search + return c +} + +// Tags sets the optional parameter "tags": A comma separated list of +// tags. Returned assets will contain all the tags from the list. +func (c *LayersListCall) Tags(tags string) *LayersListCall { + c.opt_["tags"] = tags + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersListCall) Fields(s ...googleapi.Field) *LayersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LayersListCall) IfNoneMatch(entityTag string) *LayersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersListCall) Context(ctx context.Context) *LayersListCall { + c.ctx_ = ctx + return c +} + +func (c *LayersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["processingStatus"]; ok { + params.Set("processingStatus", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projectId"]; ok { + params.Set("projectId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["role"]; ok { + params.Set("role", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["search"]; ok { + params.Set("search", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["tags"]; ok { + params.Set("tags", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.list" call. +// Exactly one of *LayersListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *LayersListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersListCall) Do() (*LayersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LayersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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" + // }, + // "processingStatus": { + // "enum": [ + // "complete", + // "failed", + // "notReady", + // "processing", + // "ready" + // ], + // "enumDescriptions": [ + // "The layer has completed processing.", + // "The layer has failed processing.", + // "The layer is not ready for processing.", + // "The layer is processing.", + // "The layer is ready for processing." + // ], + // "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" + // }, + // "role": { + // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.", + // "enum": [ + // "owner", + // "reader", + // "writer" + // ], + // "enumDescriptions": [ + // "The user can read, write and administer the asset.", + // "The user can read the asset.", + // "The user can read and write the asset." + // ], + // "location": "query", + // "type": "string" + // }, + // "search": { + // "description": "An unstructured search string used to filter the set of results based on asset metadata.", + // "location": "query", + // "type": "string" + // }, + // "tags": { + // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.", + // "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.listPublished": + +type LayersListPublishedCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// ListPublished: Return all published layers readable by the current +// user. +func (r *LayersService) ListPublished() *LayersListPublishedCall { + c := &LayersListPublishedCall{s: r.s, opt_: make(map[string]interface{})} + 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 *LayersListPublishedCall) MaxResults(maxResults int64) *LayersListPublishedCall { + 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 *LayersListPublishedCall) PageToken(pageToken string) *LayersListPublishedCall { + 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 *LayersListPublishedCall) ProjectId(projectId string) *LayersListPublishedCall { + c.opt_["projectId"] = projectId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersListPublishedCall) Fields(s ...googleapi.Field) *LayersListPublishedCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LayersListPublishedCall) IfNoneMatch(entityTag string) *LayersListPublishedCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersListPublishedCall) Context(ctx context.Context) *LayersListPublishedCall { + c.ctx_ = ctx + return c +} + +func (c *LayersListPublishedCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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_["projectId"]; ok { + params.Set("projectId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/published") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.listPublished" call. +// Exactly one of *PublishedLayersListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *PublishedLayersListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersListPublishedCall) Do() (*PublishedLayersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PublishedLayersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all published layers readable by the current user.", + // "httpMethod": "GET", + // "id": "mapsengine.layers.listPublished", + // "parameters": { + // "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" + // }, + // "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/published", + // "response": { + // "$ref": "PublishedLayersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.layers.patch": + +type LayersPatchCall struct { + s *Service + id string + layer *Layer + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Mutate a layer asset. +func (r *LayersService) Patch(id string, layer *Layer) *LayersPatchCall { + c := &LayersPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.layer = layer + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersPatchCall) Fields(s ...googleapi.Field) *LayersPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersPatchCall) Context(ctx context.Context) *LayersPatchCall { + c.ctx_ = ctx + return c +} + +func (c *LayersPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.patch" call. +func (c *LayersPatchCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Mutate a layer asset.", + // "httpMethod": "PATCH", + // "id": "mapsengine.layers.patch", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the layer.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "layers/{id}", + // "request": { + // "$ref": "Layer" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.layers.process": + +type LayersProcessCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersProcessCall) Fields(s ...googleapi.Field) *LayersProcessCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersProcessCall) Context(ctx context.Context) *LayersProcessCall { + c.ctx_ = ctx + return c +} + +func (c *LayersProcessCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/process") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.process" call. +// Exactly one of *ProcessResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ProcessResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersProcessCall) Do() (*ProcessResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProcessResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Force sets the optional parameter "force": If set to true, the API +// will allow publication of the layer even if it's out of date. If not +// true, you'll need to reprocess any out-of-date layer before +// publishing. +func (c *LayersPublishCall) Force(force bool) *LayersPublishCall { + c.opt_["force"] = force + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersPublishCall) Fields(s ...googleapi.Field) *LayersPublishCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersPublishCall) Context(ctx context.Context) *LayersPublishCall { + c.ctx_ = ctx + return c +} + +func (c *LayersPublishCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["force"]; ok { + params.Set("force", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/publish") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.publish" call. +// Exactly one of *PublishResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PublishResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersPublishCall) Do() (*PublishResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PublishResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Publish a layer asset.", + // "httpMethod": "POST", + // "id": "mapsengine.layers.publish", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "force": { + // "description": "If set to true, the API will allow publication of the layer even if it's out of date. If not true, you'll need to reprocess any out-of-date layer before publishing.", + // "location": "query", + // "type": "boolean" + // }, + // "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.unpublish": + +type LayersUnpublishCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Unpublish: Unpublish a layer asset. +func (r *LayersService) Unpublish(id string) *LayersUnpublishCall { + c := &LayersUnpublishCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersUnpublishCall) Fields(s ...googleapi.Field) *LayersUnpublishCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersUnpublishCall) Context(ctx context.Context) *LayersUnpublishCall { + c.ctx_ = ctx + return c +} + +func (c *LayersUnpublishCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/unpublish") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.unpublish" call. +// Exactly one of *PublishResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PublishResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersUnpublishCall) Do() (*PublishResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PublishResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Unpublish a layer asset.", + // "httpMethod": "POST", + // "id": "mapsengine.layers.unpublish", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the layer.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "layers/{id}/unpublish", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersParentsListCall) Fields(s ...googleapi.Field) *LayersParentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LayersParentsListCall) IfNoneMatch(entityTag string) *LayersParentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersParentsListCall) Context(ctx context.Context) *LayersParentsListCall { + c.ctx_ = ctx + return c +} + +func (c *LayersParentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/parents") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.parents.list" call. +// Exactly one of *ParentsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ParentsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersParentsListCall) Do() (*ParentsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ParentsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.layers.permissions.batchDelete": + +type LayersPermissionsBatchDeleteCall struct { + s *Service + id string + permissionsbatchdeleterequest *PermissionsBatchDeleteRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// BatchDelete: Remove permission entries from an already existing +// asset. +func (r *LayersPermissionsService) BatchDelete(id string, permissionsbatchdeleterequest *PermissionsBatchDeleteRequest) *LayersPermissionsBatchDeleteCall { + c := &LayersPermissionsBatchDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.permissionsbatchdeleterequest = permissionsbatchdeleterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersPermissionsBatchDeleteCall) Fields(s ...googleapi.Field) *LayersPermissionsBatchDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersPermissionsBatchDeleteCall) Context(ctx context.Context) *LayersPermissionsBatchDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *LayersPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchdeleterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/permissions/batchDelete") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.permissions.batchDelete" call. +// Exactly one of *PermissionsBatchDeleteResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PermissionsBatchDeleteResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersPermissionsBatchDeleteCall) Do() (*PermissionsBatchDeleteResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsBatchDeleteResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Remove permission entries from an already existing asset.", + // "httpMethod": "POST", + // "id": "mapsengine.layers.permissions.batchDelete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset from which permissions will be removed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "layers/{id}/permissions/batchDelete", + // "request": { + // "$ref": "PermissionsBatchDeleteRequest" + // }, + // "response": { + // "$ref": "PermissionsBatchDeleteResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.layers.permissions.batchUpdate": + +type LayersPermissionsBatchUpdateCall struct { + s *Service + id string + permissionsbatchupdaterequest *PermissionsBatchUpdateRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// BatchUpdate: Add or update permission entries to an already existing +// asset. +// +// An asset can hold up to 20 different permission entries. Each +// batchInsert request is atomic. +func (r *LayersPermissionsService) BatchUpdate(id string, permissionsbatchupdaterequest *PermissionsBatchUpdateRequest) *LayersPermissionsBatchUpdateCall { + c := &LayersPermissionsBatchUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.permissionsbatchupdaterequest = permissionsbatchupdaterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersPermissionsBatchUpdateCall) Fields(s ...googleapi.Field) *LayersPermissionsBatchUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersPermissionsBatchUpdateCall) Context(ctx context.Context) *LayersPermissionsBatchUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *LayersPermissionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchupdaterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/permissions/batchUpdate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.permissions.batchUpdate" call. +// Exactly one of *PermissionsBatchUpdateResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PermissionsBatchUpdateResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersPermissionsBatchUpdateCall) Do() (*PermissionsBatchUpdateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsBatchUpdateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add or update permission entries to an already existing asset.\n\nAn asset can hold up to 20 different permission entries. Each batchInsert request is atomic.", + // "httpMethod": "POST", + // "id": "mapsengine.layers.permissions.batchUpdate", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset to which permissions will be added.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "layers/{id}/permissions/batchUpdate", + // "request": { + // "$ref": "PermissionsBatchUpdateRequest" + // }, + // "response": { + // "$ref": "PermissionsBatchUpdateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.layers.permissions.list": + +type LayersPermissionsListCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Return all of the permissions for the specified asset. +func (r *LayersPermissionsService) List(id string) *LayersPermissionsListCall { + c := &LayersPermissionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LayersPermissionsListCall) Fields(s ...googleapi.Field) *LayersPermissionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LayersPermissionsListCall) IfNoneMatch(entityTag string) *LayersPermissionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LayersPermissionsListCall) Context(ctx context.Context) *LayersPermissionsListCall { + c.ctx_ = ctx + return c +} + +func (c *LayersPermissionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "layers/{id}/permissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.layers.permissions.list" call. +// Exactly one of *PermissionsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PermissionsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LayersPermissionsListCall) Do() (*PermissionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all of the permissions for the specified asset.", + // "httpMethod": "GET", + // "id": "mapsengine.layers.permissions.list", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset whose permissions will be listed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "layers/{id}/permissions", + // "response": { + // "$ref": "PermissionsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.maps.create": + +type MapsCreateCall struct { + s *Service + map_ *Map + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Create a map asset. +func (r *MapsService) Create(map_ *Map) *MapsCreateCall { + c := &MapsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.map_ = map_ + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MapsCreateCall) Fields(s ...googleapi.Field) *MapsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MapsCreateCall) Context(ctx context.Context) *MapsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *MapsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.map_) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "maps") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.maps.create" call. +// Exactly one of *Map or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Map.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *MapsCreateCall) Do() (*Map, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Map{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a map asset.", + // "httpMethod": "POST", + // "id": "mapsengine.maps.create", + // "path": "maps", + // "request": { + // "$ref": "Map" + // }, + // "response": { + // "$ref": "Map" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.maps.delete": + +type MapsDeleteCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Delete a map. +func (r *MapsService) Delete(id string) *MapsDeleteCall { + c := &MapsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MapsDeleteCall) Fields(s ...googleapi.Field) *MapsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MapsDeleteCall) Context(ctx context.Context) *MapsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *MapsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.maps.delete" call. +func (c *MapsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a map.", + // "httpMethod": "DELETE", + // "id": "mapsengine.maps.delete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the map. Only the map creator or project owner are permitted to delete. If the map is published the request will fail. Unpublish the map prior to deleting.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "maps/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.maps.get": + +type MapsGetCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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": Deprecated: The +// version parameter indicates which version of the map should be +// returned. When version is set to published, the published version of +// the map will be returned. Please use the maps.getPublished endpoint +// instead. +// +// Possible values: +// "draft" - The draft version. +// "published" - The published version. +func (c *MapsGetCall) Version(version string) *MapsGetCall { + c.opt_["version"] = version + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MapsGetCall) Fields(s ...googleapi.Field) *MapsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MapsGetCall) IfNoneMatch(entityTag string) *MapsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MapsGetCall) Context(ctx context.Context) *MapsGetCall { + c.ctx_ = ctx + return c +} + +func (c *MapsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["version"]; ok { + params.Set("version", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.maps.get" call. +// Exactly one of *Map or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Map.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *MapsGetCall) Do() (*Map, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Map{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": { + // "description": "Deprecated: The version parameter indicates which version of the map should be returned. When version is set to published, the published version of the map will be returned. Please use the maps.getPublished endpoint instead.", + // "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.getPublished": + +type MapsGetPublishedCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetPublished: Return the published metadata for a particular map. +func (r *MapsService) GetPublished(id string) *MapsGetPublishedCall { + c := &MapsGetPublishedCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MapsGetPublishedCall) Fields(s ...googleapi.Field) *MapsGetPublishedCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MapsGetPublishedCall) IfNoneMatch(entityTag string) *MapsGetPublishedCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MapsGetPublishedCall) Context(ctx context.Context) *MapsGetPublishedCall { + c.ctx_ = ctx + return c +} + +func (c *MapsGetPublishedCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}/published") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.maps.getPublished" call. +// Exactly one of *PublishedMap or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PublishedMap.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MapsGetPublishedCall) Do() (*PublishedMap, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PublishedMap{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return the published metadata for a particular map.", + // "httpMethod": "GET", + // "id": "mapsengine.maps.getPublished", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the map.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "maps/{id}/published", + // "response": { + // "$ref": "PublishedMap" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// ProcessingStatus sets the optional parameter "processingStatus": +// +// Possible values: +// "complete" - The map has completed processing. +// "failed" - The map has failed processing. +// "notReady" - The map is not ready for processing. +// "processing" - The map is processing. +func (c *MapsListCall) ProcessingStatus(processingStatus string) *MapsListCall { + c.opt_["processingStatus"] = processingStatus + 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 +} + +// Role sets the optional parameter "role": The role parameter indicates +// that the response should only contain assets where the current user +// has the specified level of access. +// +// Possible values: +// "owner" - The user can read, write and administer the asset. +// "reader" - The user can read the asset. +// "writer" - The user can read and write the asset. +func (c *MapsListCall) Role(role string) *MapsListCall { + c.opt_["role"] = role + return c +} + +// Search sets the optional parameter "search": An unstructured search +// string used to filter the set of results based on asset metadata. +func (c *MapsListCall) Search(search string) *MapsListCall { + c.opt_["search"] = search + return c +} + +// Tags sets the optional parameter "tags": A comma separated list of +// tags. Returned assets will contain all the tags from the list. +func (c *MapsListCall) Tags(tags string) *MapsListCall { + c.opt_["tags"] = tags + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MapsListCall) Fields(s ...googleapi.Field) *MapsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MapsListCall) IfNoneMatch(entityTag string) *MapsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MapsListCall) Context(ctx context.Context) *MapsListCall { + c.ctx_ = ctx + return c +} + +func (c *MapsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["processingStatus"]; ok { + params.Set("processingStatus", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projectId"]; ok { + params.Set("projectId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["role"]; ok { + params.Set("role", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["search"]; ok { + params.Set("search", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["tags"]; ok { + params.Set("tags", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.maps.list" call. +// Exactly one of *MapsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *MapsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MapsListCall) Do() (*MapsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &MapsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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" + // }, + // "processingStatus": { + // "enum": [ + // "complete", + // "failed", + // "notReady", + // "processing" + // ], + // "enumDescriptions": [ + // "The map has completed processing.", + // "The map has failed processing.", + // "The map is not ready for processing.", + // "The map is processing." + // ], + // "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" + // }, + // "role": { + // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.", + // "enum": [ + // "owner", + // "reader", + // "writer" + // ], + // "enumDescriptions": [ + // "The user can read, write and administer the asset.", + // "The user can read the asset.", + // "The user can read and write the asset." + // ], + // "location": "query", + // "type": "string" + // }, + // "search": { + // "description": "An unstructured search string used to filter the set of results based on asset metadata.", + // "location": "query", + // "type": "string" + // }, + // "tags": { + // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.", + // "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.maps.listPublished": + +type MapsListPublishedCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// ListPublished: Return all published maps readable by the current +// user. +func (r *MapsService) ListPublished() *MapsListPublishedCall { + c := &MapsListPublishedCall{s: r.s, opt_: make(map[string]interface{})} + 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 *MapsListPublishedCall) MaxResults(maxResults int64) *MapsListPublishedCall { + 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 *MapsListPublishedCall) PageToken(pageToken string) *MapsListPublishedCall { + 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 *MapsListPublishedCall) ProjectId(projectId string) *MapsListPublishedCall { + c.opt_["projectId"] = projectId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MapsListPublishedCall) Fields(s ...googleapi.Field) *MapsListPublishedCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MapsListPublishedCall) IfNoneMatch(entityTag string) *MapsListPublishedCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MapsListPublishedCall) Context(ctx context.Context) *MapsListPublishedCall { + c.ctx_ = ctx + return c +} + +func (c *MapsListPublishedCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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_["projectId"]; ok { + params.Set("projectId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "maps/published") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.maps.listPublished" call. +// Exactly one of *PublishedMapsListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *PublishedMapsListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MapsListPublishedCall) Do() (*PublishedMapsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PublishedMapsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all published maps readable by the current user.", + // "httpMethod": "GET", + // "id": "mapsengine.maps.listPublished", + // "parameters": { + // "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" + // }, + // "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/published", + // "response": { + // "$ref": "PublishedMapsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.maps.patch": + +type MapsPatchCall struct { + s *Service + id string + map_ *Map + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Mutate a map asset. +func (r *MapsService) Patch(id string, map_ *Map) *MapsPatchCall { + c := &MapsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.map_ = map_ + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MapsPatchCall) Fields(s ...googleapi.Field) *MapsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MapsPatchCall) Context(ctx context.Context) *MapsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *MapsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.map_) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.maps.patch" call. +func (c *MapsPatchCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Mutate a map asset.", + // "httpMethod": "PATCH", + // "id": "mapsengine.maps.patch", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the map.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "maps/{id}", + // "request": { + // "$ref": "Map" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.maps.publish": + +type MapsPublishCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Publish: Publish a map asset. +func (r *MapsService) Publish(id string) *MapsPublishCall { + c := &MapsPublishCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Force sets the optional parameter "force": If set to true, the API +// will allow publication of the map even if it's out of date. If false, +// the map must have a processingStatus of complete before publishing. +func (c *MapsPublishCall) Force(force bool) *MapsPublishCall { + c.opt_["force"] = force + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MapsPublishCall) Fields(s ...googleapi.Field) *MapsPublishCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MapsPublishCall) Context(ctx context.Context) *MapsPublishCall { + c.ctx_ = ctx + return c +} + +func (c *MapsPublishCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["force"]; ok { + params.Set("force", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}/publish") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.maps.publish" call. +// Exactly one of *PublishResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PublishResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MapsPublishCall) Do() (*PublishResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PublishResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Publish a map asset.", + // "httpMethod": "POST", + // "id": "mapsengine.maps.publish", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "force": { + // "description": "If set to true, the API will allow publication of the map even if it's out of date. If false, the map must have a processingStatus of complete before publishing.", + // "location": "query", + // "type": "boolean" + // }, + // "id": { + // "description": "The ID of the map.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "maps/{id}/publish", + // "response": { + // "$ref": "PublishResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.maps.unpublish": + +type MapsUnpublishCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Unpublish: Unpublish a map asset. +func (r *MapsService) Unpublish(id string) *MapsUnpublishCall { + c := &MapsUnpublishCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MapsUnpublishCall) Fields(s ...googleapi.Field) *MapsUnpublishCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MapsUnpublishCall) Context(ctx context.Context) *MapsUnpublishCall { + c.ctx_ = ctx + return c +} + +func (c *MapsUnpublishCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}/unpublish") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.maps.unpublish" call. +// Exactly one of *PublishResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PublishResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MapsUnpublishCall) Do() (*PublishResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PublishResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Unpublish a map asset.", + // "httpMethod": "POST", + // "id": "mapsengine.maps.unpublish", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the map.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "maps/{id}/unpublish", + // "response": { + // "$ref": "PublishResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.maps.permissions.batchDelete": + +type MapsPermissionsBatchDeleteCall struct { + s *Service + id string + permissionsbatchdeleterequest *PermissionsBatchDeleteRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// BatchDelete: Remove permission entries from an already existing +// asset. +func (r *MapsPermissionsService) BatchDelete(id string, permissionsbatchdeleterequest *PermissionsBatchDeleteRequest) *MapsPermissionsBatchDeleteCall { + c := &MapsPermissionsBatchDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.permissionsbatchdeleterequest = permissionsbatchdeleterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MapsPermissionsBatchDeleteCall) Fields(s ...googleapi.Field) *MapsPermissionsBatchDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MapsPermissionsBatchDeleteCall) Context(ctx context.Context) *MapsPermissionsBatchDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *MapsPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchdeleterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}/permissions/batchDelete") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.maps.permissions.batchDelete" call. +// Exactly one of *PermissionsBatchDeleteResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PermissionsBatchDeleteResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MapsPermissionsBatchDeleteCall) Do() (*PermissionsBatchDeleteResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsBatchDeleteResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Remove permission entries from an already existing asset.", + // "httpMethod": "POST", + // "id": "mapsengine.maps.permissions.batchDelete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset from which permissions will be removed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "maps/{id}/permissions/batchDelete", + // "request": { + // "$ref": "PermissionsBatchDeleteRequest" + // }, + // "response": { + // "$ref": "PermissionsBatchDeleteResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.maps.permissions.batchUpdate": + +type MapsPermissionsBatchUpdateCall struct { + s *Service + id string + permissionsbatchupdaterequest *PermissionsBatchUpdateRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// BatchUpdate: Add or update permission entries to an already existing +// asset. +// +// An asset can hold up to 20 different permission entries. Each +// batchInsert request is atomic. +func (r *MapsPermissionsService) BatchUpdate(id string, permissionsbatchupdaterequest *PermissionsBatchUpdateRequest) *MapsPermissionsBatchUpdateCall { + c := &MapsPermissionsBatchUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.permissionsbatchupdaterequest = permissionsbatchupdaterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MapsPermissionsBatchUpdateCall) Fields(s ...googleapi.Field) *MapsPermissionsBatchUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MapsPermissionsBatchUpdateCall) Context(ctx context.Context) *MapsPermissionsBatchUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *MapsPermissionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchupdaterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}/permissions/batchUpdate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.maps.permissions.batchUpdate" call. +// Exactly one of *PermissionsBatchUpdateResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PermissionsBatchUpdateResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MapsPermissionsBatchUpdateCall) Do() (*PermissionsBatchUpdateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsBatchUpdateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add or update permission entries to an already existing asset.\n\nAn asset can hold up to 20 different permission entries. Each batchInsert request is atomic.", + // "httpMethod": "POST", + // "id": "mapsengine.maps.permissions.batchUpdate", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset to which permissions will be added.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "maps/{id}/permissions/batchUpdate", + // "request": { + // "$ref": "PermissionsBatchUpdateRequest" + // }, + // "response": { + // "$ref": "PermissionsBatchUpdateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.maps.permissions.list": + +type MapsPermissionsListCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Return all of the permissions for the specified asset. +func (r *MapsPermissionsService) List(id string) *MapsPermissionsListCall { + c := &MapsPermissionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MapsPermissionsListCall) Fields(s ...googleapi.Field) *MapsPermissionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MapsPermissionsListCall) IfNoneMatch(entityTag string) *MapsPermissionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MapsPermissionsListCall) Context(ctx context.Context) *MapsPermissionsListCall { + c.ctx_ = ctx + return c +} + +func (c *MapsPermissionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "maps/{id}/permissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.maps.permissions.list" call. +// Exactly one of *PermissionsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PermissionsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *MapsPermissionsListCall) Do() (*PermissionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all of the permissions for the specified asset.", + // "httpMethod": "GET", + // "id": "mapsengine.maps.permissions.list", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset whose permissions will be listed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "maps/{id}/permissions", + // "response": { + // "$ref": "PermissionsListResponse" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsListCall) Fields(s ...googleapi.Field) *ProjectsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsListCall) IfNoneMatch(entityTag string) *ProjectsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsListCall) Context(ctx context.Context) *ProjectsListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.projects.list" call. +// Exactly one of *ProjectsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ProjectsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsListCall) Do() (*ProjectsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProjectsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.projects.icons.create": + +type ProjectsIconsCreateCall struct { + s *Service + projectId string + icon *Icon + opt_ map[string]interface{} + media_ io.Reader + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// Create: Create an icon. +func (r *ProjectsIconsService) Create(projectId string, icon *Icon) *ProjectsIconsCreateCall { + c := &ProjectsIconsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.icon = icon + return c +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *ProjectsIconsCreateCall) Media(r io.Reader) *ProjectsIconsCreateCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *ProjectsIconsCreateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ProjectsIconsCreateCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *ProjectsIconsCreateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ProjectsIconsCreateCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsIconsCreateCall) Fields(s ...googleapi.Field) *ProjectsIconsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *ProjectsIconsCreateCall) Context(ctx context.Context) *ProjectsIconsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsIconsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.icon) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/icons") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.projects.icons.create" call. +// Exactly one of *Icon or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Icon.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsIconsCreateCall) Do() (*Icon, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &Icon{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create an icon.", + // "httpMethod": "POST", + // "id": "mapsengine.projects.icons.create", + // "mediaUpload": { + // "accept": [ + // "*/*" + // ], + // "maxSize": "100KB", + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/mapsengine/v1/projects/{projectId}/icons" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/mapsengine/v1/projects/{projectId}/icons" + // } + // } + // }, + // "parameterOrder": [ + // "projectId" + // ], + // "parameters": { + // "projectId": { + // "description": "The ID of the project.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/icons", + // "request": { + // "$ref": "Icon" + // }, + // "response": { + // "$ref": "Icon" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ], + // "supportsMediaUpload": true + // } + +} + +// method id "mapsengine.projects.icons.get": + +type ProjectsIconsGetCall struct { + s *Service + projectId string + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Return an icon or its associated metadata +func (r *ProjectsIconsService) Get(projectId string, id string) *ProjectsIconsGetCall { + c := &ProjectsIconsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsIconsGetCall) Fields(s ...googleapi.Field) *ProjectsIconsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsIconsGetCall) IfNoneMatch(entityTag string) *ProjectsIconsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsIconsGetCall) Context(ctx context.Context) *ProjectsIconsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsIconsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/icons/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *ProjectsIconsGetCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "mapsengine.projects.icons.get" call. +// Exactly one of *Icon or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Icon.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsIconsGetCall) Do() (*Icon, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Icon{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return an icon or its associated metadata", + // "httpMethod": "GET", + // "id": "mapsengine.projects.icons.get", + // "parameterOrder": [ + // "projectId", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the icon.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "The ID of the project.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/icons/{id}", + // "response": { + // "$ref": "Icon" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ], + // "supportsMediaDownload": true + // } + +} + +// method id "mapsengine.projects.icons.list": + +type ProjectsIconsListCall struct { + s *Service + projectId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Return all icons in the current project +func (r *ProjectsIconsService) List(projectId string) *ProjectsIconsListCall { + c := &ProjectsIconsListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + 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 *ProjectsIconsListCall) MaxResults(maxResults int64) *ProjectsIconsListCall { + 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 *ProjectsIconsListCall) PageToken(pageToken string) *ProjectsIconsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsIconsListCall) Fields(s ...googleapi.Field) *ProjectsIconsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsIconsListCall) IfNoneMatch(entityTag string) *ProjectsIconsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsIconsListCall) Context(ctx context.Context) *ProjectsIconsListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsIconsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/icons") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.projects.icons.list" call. +// Exactly one of *IconsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *IconsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsIconsListCall) Do() (*IconsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &IconsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all icons in the current project", + // "httpMethod": "GET", + // "id": "mapsengine.projects.icons.list", + // "parameterOrder": [ + // "projectId" + // ], + // "parameters": { + // "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" + // }, + // "projectId": { + // "description": "The ID of the project.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{projectId}/icons", + // "response": { + // "$ref": "IconsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.rasterCollections.cancelProcessing": + +type RasterCollectionsCancelProcessingCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// CancelProcessing: Cancel processing on a raster collection asset. +func (r *RasterCollectionsService) CancelProcessing(id string) *RasterCollectionsCancelProcessingCall { + c := &RasterCollectionsCancelProcessingCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsCancelProcessingCall) Fields(s ...googleapi.Field) *RasterCollectionsCancelProcessingCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsCancelProcessingCall) Context(ctx context.Context) *RasterCollectionsCancelProcessingCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsCancelProcessingCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/cancelProcessing") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.cancelProcessing" call. +// Exactly one of *ProcessResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ProcessResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RasterCollectionsCancelProcessingCall) Do() (*ProcessResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProcessResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Cancel processing on a raster collection asset.", + // "httpMethod": "POST", + // "id": "mapsengine.rasterCollections.cancelProcessing", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the raster collection.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasterCollections/{id}/cancelProcessing", + // "response": { + // "$ref": "ProcessResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasterCollections.create": + +type RasterCollectionsCreateCall struct { + s *Service + rastercollection *RasterCollection + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsCreateCall) Fields(s ...googleapi.Field) *RasterCollectionsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsCreateCall) Context(ctx context.Context) *RasterCollectionsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsCreateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.create" call. +// Exactly one of *RasterCollection or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *RasterCollection.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RasterCollectionsCreateCall) Do() (*RasterCollection, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RasterCollection{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.delete": + +type RasterCollectionsDeleteCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Delete a raster collection. +func (r *RasterCollectionsService) Delete(id string) *RasterCollectionsDeleteCall { + c := &RasterCollectionsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsDeleteCall) Fields(s ...googleapi.Field) *RasterCollectionsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsDeleteCall) Context(ctx context.Context) *RasterCollectionsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.delete" call. +func (c *RasterCollectionsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a raster collection.", + // "httpMethod": "DELETE", + // "id": "mapsengine.rasterCollections.delete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the raster collection. Only the raster collection creator or project owner are permitted to delete. If the rastor collection is included in a layer, the request will fail. Remove the raster collection from all layers prior to deleting.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasterCollections/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasterCollections.get": + +type RasterCollectionsGetCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsGetCall) Fields(s ...googleapi.Field) *RasterCollectionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RasterCollectionsGetCall) IfNoneMatch(entityTag string) *RasterCollectionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsGetCall) Context(ctx context.Context) *RasterCollectionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.get" call. +// Exactly one of *RasterCollection or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *RasterCollection.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RasterCollectionsGetCall) Do() (*RasterCollection, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RasterCollection{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// ProcessingStatus sets the optional parameter "processingStatus": +// +// Possible values: +// "complete" - The raster collection has completed processing. +// "failed" - The raster collection has failed processing. +// "notReady" - The raster collection is not ready for processing. +// "processing" - The raster collection is processing. +// "ready" - The raster collection is ready for processing. +func (c *RasterCollectionsListCall) ProcessingStatus(processingStatus string) *RasterCollectionsListCall { + c.opt_["processingStatus"] = processingStatus + 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 +} + +// Role sets the optional parameter "role": The role parameter indicates +// that the response should only contain assets where the current user +// has the specified level of access. +// +// Possible values: +// "owner" - The user can read, write and administer the asset. +// "reader" - The user can read the asset. +// "writer" - The user can read and write the asset. +func (c *RasterCollectionsListCall) Role(role string) *RasterCollectionsListCall { + c.opt_["role"] = role + return c +} + +// Search sets the optional parameter "search": An unstructured search +// string used to filter the set of results based on asset metadata. +func (c *RasterCollectionsListCall) Search(search string) *RasterCollectionsListCall { + c.opt_["search"] = search + return c +} + +// Tags sets the optional parameter "tags": A comma separated list of +// tags. Returned assets will contain all the tags from the list. +func (c *RasterCollectionsListCall) Tags(tags string) *RasterCollectionsListCall { + c.opt_["tags"] = tags + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsListCall) Fields(s ...googleapi.Field) *RasterCollectionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RasterCollectionsListCall) IfNoneMatch(entityTag string) *RasterCollectionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsListCall) Context(ctx context.Context) *RasterCollectionsListCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["processingStatus"]; ok { + params.Set("processingStatus", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projectId"]; ok { + params.Set("projectId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["role"]; ok { + params.Set("role", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["search"]; ok { + params.Set("search", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["tags"]; ok { + params.Set("tags", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.list" call. +// Exactly one of *RasterCollectionsListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *RasterCollectionsListResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RasterCollectionsListCall) Do() (*RasterCollectionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RasterCollectionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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" + // }, + // "processingStatus": { + // "enum": [ + // "complete", + // "failed", + // "notReady", + // "processing", + // "ready" + // ], + // "enumDescriptions": [ + // "The raster collection has completed processing.", + // "The raster collection has failed processing.", + // "The raster collection is not ready for processing.", + // "The raster collection is processing.", + // "The raster collection is ready for processing." + // ], + // "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" + // }, + // "role": { + // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.", + // "enum": [ + // "owner", + // "reader", + // "writer" + // ], + // "enumDescriptions": [ + // "The user can read, write and administer the asset.", + // "The user can read the asset.", + // "The user can read and write the asset." + // ], + // "location": "query", + // "type": "string" + // }, + // "search": { + // "description": "An unstructured search string used to filter the set of results based on asset metadata.", + // "location": "query", + // "type": "string" + // }, + // "tags": { + // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.", + // "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.patch": + +type RasterCollectionsPatchCall struct { + s *Service + id string + rastercollection *RasterCollection + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Mutate a raster collection asset. +func (r *RasterCollectionsService) Patch(id string, rastercollection *RasterCollection) *RasterCollectionsPatchCall { + c := &RasterCollectionsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.rastercollection = rastercollection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsPatchCall) Fields(s ...googleapi.Field) *RasterCollectionsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsPatchCall) Context(ctx context.Context) *RasterCollectionsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.patch" call. +func (c *RasterCollectionsPatchCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Mutate a raster collection asset.", + // "httpMethod": "PATCH", + // "id": "mapsengine.rasterCollections.patch", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the raster collection.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasterCollections/{id}", + // "request": { + // "$ref": "RasterCollection" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasterCollections.process": + +type RasterCollectionsProcessCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Process: Process a raster collection asset. +func (r *RasterCollectionsService) Process(id string) *RasterCollectionsProcessCall { + c := &RasterCollectionsProcessCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsProcessCall) Fields(s ...googleapi.Field) *RasterCollectionsProcessCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsProcessCall) Context(ctx context.Context) *RasterCollectionsProcessCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsProcessCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/process") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.process" call. +// Exactly one of *ProcessResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ProcessResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RasterCollectionsProcessCall) Do() (*ProcessResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProcessResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Process a raster collection asset.", + // "httpMethod": "POST", + // "id": "mapsengine.rasterCollections.process", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the raster collection.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasterCollections/{id}/process", + // "response": { + // "$ref": "ProcessResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasterCollections.parents.list": + +type RasterCollectionsParentsListCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsParentsListCall) Fields(s ...googleapi.Field) *RasterCollectionsParentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RasterCollectionsParentsListCall) IfNoneMatch(entityTag string) *RasterCollectionsParentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsParentsListCall) Context(ctx context.Context) *RasterCollectionsParentsListCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsParentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/parents") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.parents.list" call. +// Exactly one of *ParentsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ParentsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RasterCollectionsParentsListCall) Do() (*ParentsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ParentsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.permissions.batchDelete": + +type RasterCollectionsPermissionsBatchDeleteCall struct { + s *Service + id string + permissionsbatchdeleterequest *PermissionsBatchDeleteRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// BatchDelete: Remove permission entries from an already existing +// asset. +func (r *RasterCollectionsPermissionsService) BatchDelete(id string, permissionsbatchdeleterequest *PermissionsBatchDeleteRequest) *RasterCollectionsPermissionsBatchDeleteCall { + c := &RasterCollectionsPermissionsBatchDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.permissionsbatchdeleterequest = permissionsbatchdeleterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsPermissionsBatchDeleteCall) Fields(s ...googleapi.Field) *RasterCollectionsPermissionsBatchDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsPermissionsBatchDeleteCall) Context(ctx context.Context) *RasterCollectionsPermissionsBatchDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchdeleterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/permissions/batchDelete") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.permissions.batchDelete" call. +// Exactly one of *PermissionsBatchDeleteResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PermissionsBatchDeleteResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RasterCollectionsPermissionsBatchDeleteCall) Do() (*PermissionsBatchDeleteResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsBatchDeleteResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Remove permission entries from an already existing asset.", + // "httpMethod": "POST", + // "id": "mapsengine.rasterCollections.permissions.batchDelete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset from which permissions will be removed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasterCollections/{id}/permissions/batchDelete", + // "request": { + // "$ref": "PermissionsBatchDeleteRequest" + // }, + // "response": { + // "$ref": "PermissionsBatchDeleteResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasterCollections.permissions.batchUpdate": + +type RasterCollectionsPermissionsBatchUpdateCall struct { + s *Service + id string + permissionsbatchupdaterequest *PermissionsBatchUpdateRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// BatchUpdate: Add or update permission entries to an already existing +// asset. +// +// An asset can hold up to 20 different permission entries. Each +// batchInsert request is atomic. +func (r *RasterCollectionsPermissionsService) BatchUpdate(id string, permissionsbatchupdaterequest *PermissionsBatchUpdateRequest) *RasterCollectionsPermissionsBatchUpdateCall { + c := &RasterCollectionsPermissionsBatchUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.permissionsbatchupdaterequest = permissionsbatchupdaterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsPermissionsBatchUpdateCall) Fields(s ...googleapi.Field) *RasterCollectionsPermissionsBatchUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsPermissionsBatchUpdateCall) Context(ctx context.Context) *RasterCollectionsPermissionsBatchUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsPermissionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchupdaterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/permissions/batchUpdate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.permissions.batchUpdate" call. +// Exactly one of *PermissionsBatchUpdateResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PermissionsBatchUpdateResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RasterCollectionsPermissionsBatchUpdateCall) Do() (*PermissionsBatchUpdateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsBatchUpdateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add or update permission entries to an already existing asset.\n\nAn asset can hold up to 20 different permission entries. Each batchInsert request is atomic.", + // "httpMethod": "POST", + // "id": "mapsengine.rasterCollections.permissions.batchUpdate", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset to which permissions will be added.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasterCollections/{id}/permissions/batchUpdate", + // "request": { + // "$ref": "PermissionsBatchUpdateRequest" + // }, + // "response": { + // "$ref": "PermissionsBatchUpdateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasterCollections.permissions.list": + +type RasterCollectionsPermissionsListCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Return all of the permissions for the specified asset. +func (r *RasterCollectionsPermissionsService) List(id string) *RasterCollectionsPermissionsListCall { + c := &RasterCollectionsPermissionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsPermissionsListCall) Fields(s ...googleapi.Field) *RasterCollectionsPermissionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RasterCollectionsPermissionsListCall) IfNoneMatch(entityTag string) *RasterCollectionsPermissionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsPermissionsListCall) Context(ctx context.Context) *RasterCollectionsPermissionsListCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsPermissionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/permissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.permissions.list" call. +// Exactly one of *PermissionsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PermissionsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RasterCollectionsPermissionsListCall) Do() (*PermissionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all of the permissions for the specified asset.", + // "httpMethod": "GET", + // "id": "mapsengine.rasterCollections.permissions.list", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset whose permissions will be listed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasterCollections/{id}/permissions", + // "response": { + // "$ref": "PermissionsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.rasterCollections.rasters.batchDelete": + +type RasterCollectionsRastersBatchDeleteCall struct { + s *Service + id string + rastercollectionsrasterbatchdeleterequest *RasterCollectionsRasterBatchDeleteRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// BatchDelete: Remove rasters from an existing raster collection. +// +// Up to 50 rasters can be included in a single batchDelete request. +// Each batchDelete request is atomic. +func (r *RasterCollectionsRastersService) BatchDelete(id string, rastercollectionsrasterbatchdeleterequest *RasterCollectionsRasterBatchDeleteRequest) *RasterCollectionsRastersBatchDeleteCall { + c := &RasterCollectionsRastersBatchDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.rastercollectionsrasterbatchdeleterequest = rastercollectionsrasterbatchdeleterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsRastersBatchDeleteCall) Fields(s ...googleapi.Field) *RasterCollectionsRastersBatchDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsRastersBatchDeleteCall) Context(ctx context.Context) *RasterCollectionsRastersBatchDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsRastersBatchDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.rastercollectionsrasterbatchdeleterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/rasters/batchDelete") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.rasters.batchDelete" call. +// Exactly one of *RasterCollectionsRastersBatchDeleteResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *RasterCollectionsRastersBatchDeleteResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *RasterCollectionsRastersBatchDeleteCall) Do() (*RasterCollectionsRastersBatchDeleteResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RasterCollectionsRastersBatchDeleteResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Remove rasters from an existing raster collection.\n\nUp to 50 rasters can be included in a single batchDelete request. Each batchDelete request is atomic.", + // "httpMethod": "POST", + // "id": "mapsengine.rasterCollections.rasters.batchDelete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the raster collection to which these rasters belong.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasterCollections/{id}/rasters/batchDelete", + // "request": { + // "$ref": "RasterCollectionsRasterBatchDeleteRequest" + // }, + // "response": { + // "$ref": "RasterCollectionsRastersBatchDeleteResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasterCollections.rasters.batchInsert": + +type RasterCollectionsRastersBatchInsertCall struct { + s *Service + id string + rastercollectionsrastersbatchinsertrequest *RasterCollectionsRastersBatchInsertRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// BatchInsert: Add rasters to an existing raster collection. Rasters +// must be successfully processed in order to be added to a raster +// collection. +// +// Up to 50 rasters can be included in a single batchInsert request. +// Each batchInsert request is atomic. +func (r *RasterCollectionsRastersService) BatchInsert(id string, rastercollectionsrastersbatchinsertrequest *RasterCollectionsRastersBatchInsertRequest) *RasterCollectionsRastersBatchInsertCall { + c := &RasterCollectionsRastersBatchInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.rastercollectionsrastersbatchinsertrequest = rastercollectionsrastersbatchinsertrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsRastersBatchInsertCall) Fields(s ...googleapi.Field) *RasterCollectionsRastersBatchInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsRastersBatchInsertCall) Context(ctx context.Context) *RasterCollectionsRastersBatchInsertCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsRastersBatchInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.rastercollectionsrastersbatchinsertrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/rasters/batchInsert") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.rasters.batchInsert" call. +// Exactly one of *RasterCollectionsRastersBatchInsertResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *RasterCollectionsRastersBatchInsertResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *RasterCollectionsRastersBatchInsertCall) Do() (*RasterCollectionsRastersBatchInsertResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RasterCollectionsRastersBatchInsertResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add rasters to an existing raster collection. Rasters must be successfully processed in order to be added to a raster collection.\n\nUp to 50 rasters can be included in a single batchInsert request. Each batchInsert request is atomic.", + // "httpMethod": "POST", + // "id": "mapsengine.rasterCollections.rasters.batchInsert", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the raster collection to which these rasters belong.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasterCollections/{id}/rasters/batchInsert", + // "request": { + // "$ref": "RasterCollectionsRastersBatchInsertRequest" + // }, + // "response": { + // "$ref": "RasterCollectionsRastersBatchInsertResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasterCollections.rasters.list": + +type RasterCollectionsRastersListCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Role sets the optional parameter "role": The role parameter indicates +// that the response should only contain assets where the current user +// has the specified level of access. +// +// Possible values: +// "owner" - The user can read, write and administer the asset. +// "reader" - The user can read the asset. +// "writer" - The user can read and write the asset. +func (c *RasterCollectionsRastersListCall) Role(role string) *RasterCollectionsRastersListCall { + c.opt_["role"] = role + return c +} + +// Search sets the optional parameter "search": An unstructured search +// string used to filter the set of results based on asset metadata. +func (c *RasterCollectionsRastersListCall) Search(search string) *RasterCollectionsRastersListCall { + c.opt_["search"] = search + return c +} + +// Tags sets the optional parameter "tags": A comma separated list of +// tags. Returned assets will contain all the tags from the list. +func (c *RasterCollectionsRastersListCall) Tags(tags string) *RasterCollectionsRastersListCall { + c.opt_["tags"] = tags + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RasterCollectionsRastersListCall) Fields(s ...googleapi.Field) *RasterCollectionsRastersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RasterCollectionsRastersListCall) IfNoneMatch(entityTag string) *RasterCollectionsRastersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RasterCollectionsRastersListCall) Context(ctx context.Context) *RasterCollectionsRastersListCall { + c.ctx_ = ctx + return c +} + +func (c *RasterCollectionsRastersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["role"]; ok { + params.Set("role", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["search"]; ok { + params.Set("search", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["tags"]; ok { + params.Set("tags", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasterCollections/{id}/rasters") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasterCollections.rasters.list" call. +// Exactly one of *RasterCollectionsRastersListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *RasterCollectionsRastersListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *RasterCollectionsRastersListCall) Do() (*RasterCollectionsRastersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RasterCollectionsRastersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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" + // }, + // "role": { + // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.", + // "enum": [ + // "owner", + // "reader", + // "writer" + // ], + // "enumDescriptions": [ + // "The user can read, write and administer the asset.", + // "The user can read the asset.", + // "The user can read and write the asset." + // ], + // "location": "query", + // "type": "string" + // }, + // "search": { + // "description": "An unstructured search string used to filter the set of results based on asset metadata.", + // "location": "query", + // "type": "string" + // }, + // "tags": { + // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "rasterCollections/{id}/rasters", + // "response": { + // "$ref": "RasterCollectionsRastersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.rasters.delete": + +type RastersDeleteCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Delete a raster. +func (r *RastersService) Delete(id string) *RastersDeleteCall { + c := &RastersDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RastersDeleteCall) Fields(s ...googleapi.Field) *RastersDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RastersDeleteCall) Context(ctx context.Context) *RastersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *RastersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasters.delete" call. +func (c *RastersDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a raster.", + // "httpMethod": "DELETE", + // "id": "mapsengine.rasters.delete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the raster. Only the raster creator or project owner are permitted to delete. If the raster is included in a layer or mosaic, the request will fail. Remove it from all parents prior to deleting.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasters/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasters.get": + +type RastersGetCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RastersGetCall) Fields(s ...googleapi.Field) *RastersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RastersGetCall) IfNoneMatch(entityTag string) *RastersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RastersGetCall) Context(ctx context.Context) *RastersGetCall { + c.ctx_ = ctx + return c +} + +func (c *RastersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasters.get" call. +// Exactly one of *Raster or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Raster.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *RastersGetCall) Do() (*Raster, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Raster{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Raster" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.rasters.list": + +type RastersListCall struct { + s *Service + projectId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Return all rasters readable by the current user. +func (r *RastersService) List(projectId string) *RastersListCall { + c := &RastersListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + 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 *RastersListCall) Bbox(bbox string) *RastersListCall { + 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 *RastersListCall) CreatedAfter(createdAfter string) *RastersListCall { + 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 *RastersListCall) CreatedBefore(createdBefore string) *RastersListCall { + 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 *RastersListCall) CreatorEmail(creatorEmail string) *RastersListCall { + 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 *RastersListCall) MaxResults(maxResults int64) *RastersListCall { + 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 *RastersListCall) ModifiedAfter(modifiedAfter string) *RastersListCall { + 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 *RastersListCall) ModifiedBefore(modifiedBefore string) *RastersListCall { + 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 *RastersListCall) PageToken(pageToken string) *RastersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// ProcessingStatus sets the optional parameter "processingStatus": +// +// Possible values: +// "complete" - The raster has completed processing. +// "failed" - The raster has failed processing. +// "notReady" - The raster is not ready for processing. +// "processing" - The raster is processing. +// "ready" - The raster is ready for processing. +func (c *RastersListCall) ProcessingStatus(processingStatus string) *RastersListCall { + c.opt_["processingStatus"] = processingStatus + return c +} + +// Role sets the optional parameter "role": The role parameter indicates +// that the response should only contain assets where the current user +// has the specified level of access. +// +// Possible values: +// "owner" - The user can read, write and administer the asset. +// "reader" - The user can read the asset. +// "writer" - The user can read and write the asset. +func (c *RastersListCall) Role(role string) *RastersListCall { + c.opt_["role"] = role + return c +} + +// Search sets the optional parameter "search": An unstructured search +// string used to filter the set of results based on asset metadata. +func (c *RastersListCall) Search(search string) *RastersListCall { + c.opt_["search"] = search + return c +} + +// Tags sets the optional parameter "tags": A comma separated list of +// tags. Returned assets will contain all the tags from the list. +func (c *RastersListCall) Tags(tags string) *RastersListCall { + c.opt_["tags"] = tags + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RastersListCall) Fields(s ...googleapi.Field) *RastersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RastersListCall) IfNoneMatch(entityTag string) *RastersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RastersListCall) Context(ctx context.Context) *RastersListCall { + c.ctx_ = ctx + return c +} + +func (c *RastersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("projectId", fmt.Sprintf("%v", c.projectId)) + 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_["processingStatus"]; ok { + params.Set("processingStatus", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["role"]; ok { + params.Set("role", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["search"]; ok { + params.Set("search", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["tags"]; ok { + params.Set("tags", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasters") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasters.list" call. +// Exactly one of *RastersListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *RastersListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RastersListCall) Do() (*RastersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RastersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all rasters readable by the current user.", + // "httpMethod": "GET", + // "id": "mapsengine.rasters.list", + // "parameterOrder": [ + // "projectId" + // ], + // "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" + // }, + // "processingStatus": { + // "enum": [ + // "complete", + // "failed", + // "notReady", + // "processing", + // "ready" + // ], + // "enumDescriptions": [ + // "The raster has completed processing.", + // "The raster has failed processing.", + // "The raster is not ready for processing.", + // "The raster is processing.", + // "The raster is ready for processing." + // ], + // "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", + // "required": true, + // "type": "string" + // }, + // "role": { + // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.", + // "enum": [ + // "owner", + // "reader", + // "writer" + // ], + // "enumDescriptions": [ + // "The user can read, write and administer the asset.", + // "The user can read the asset.", + // "The user can read and write the asset." + // ], + // "location": "query", + // "type": "string" + // }, + // "search": { + // "description": "An unstructured search string used to filter the set of results based on asset metadata.", + // "location": "query", + // "type": "string" + // }, + // "tags": { + // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "rasters", + // "response": { + // "$ref": "RastersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} + +// method id "mapsengine.rasters.patch": + +type RastersPatchCall struct { + s *Service + id string + raster *Raster + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Mutate a raster asset. +func (r *RastersService) Patch(id string, raster *Raster) *RastersPatchCall { + c := &RastersPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.raster = raster + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RastersPatchCall) Fields(s ...googleapi.Field) *RastersPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RastersPatchCall) Context(ctx context.Context) *RastersPatchCall { + c.ctx_ = ctx + return c +} + +func (c *RastersPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.raster) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasters.patch" call. +func (c *RastersPatchCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Mutate a raster asset.", + // "httpMethod": "PATCH", + // "id": "mapsengine.rasters.patch", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the raster.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasters/{id}", + // "request": { + // "$ref": "Raster" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasters.process": + +type RastersProcessCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Process: Process a raster asset. +func (r *RastersService) Process(id string) *RastersProcessCall { + c := &RastersProcessCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RastersProcessCall) Fields(s ...googleapi.Field) *RastersProcessCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RastersProcessCall) Context(ctx context.Context) *RastersProcessCall { + c.ctx_ = ctx + return c +} + +func (c *RastersProcessCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}/process") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasters.process" call. +// Exactly one of *ProcessResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ProcessResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RastersProcessCall) Do() (*ProcessResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProcessResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Process a raster asset.", + // "httpMethod": "POST", + // "id": "mapsengine.rasters.process", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the raster.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasters/{id}/process", + // "response": { + // "$ref": "ProcessResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasters.upload": + +type RastersUploadCall struct { + s *Service + raster *Raster + opt_ map[string]interface{} + ctx_ context.Context +} + +// Upload: Create a skeleton raster asset for upload. +func (r *RastersService) Upload(raster *Raster) *RastersUploadCall { + c := &RastersUploadCall{s: r.s, opt_: make(map[string]interface{})} + c.raster = raster + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RastersUploadCall) Fields(s ...googleapi.Field) *RastersUploadCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RastersUploadCall) Context(ctx context.Context) *RastersUploadCall { + c.ctx_ = ctx + return c +} + +func (c *RastersUploadCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.raster) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasters.upload" call. +// Exactly one of *Raster or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Raster.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *RastersUploadCall) Do() (*Raster, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Raster{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a skeleton raster asset for upload.", + // "httpMethod": "POST", + // "id": "mapsengine.rasters.upload", + // "path": "rasters/upload", + // "request": { + // "$ref": "Raster" + // }, + // "response": { + // "$ref": "Raster" + // }, + // "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 + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// 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 +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *RastersFilesInsertCall) Media(r io.Reader) *RastersFilesInsertCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *RastersFilesInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *RastersFilesInsertCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *RastersFilesInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *RastersFilesInsertCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RastersFilesInsertCall) Fields(s ...googleapi.Field) *RastersFilesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *RastersFilesInsertCall) Context(ctx context.Context) *RastersFilesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *RastersFilesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("filename", fmt.Sprintf("%v", c.filename)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}/files") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + body = new(bytes.Buffer) + ctype := "application/json" + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasters.files.insert" call. +func (c *RastersFilesInsertCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return err + } + defer res.Body.Close() + } + return nil + // { + // "description": "Upload a file to a raster asset.", + // "httpMethod": "POST", + // "id": "mapsengine.rasters.files.insert", + // "mediaUpload": { + // "accept": [ + // "*/*" + // ], + // "maxSize": "10GB", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RastersParentsListCall) Fields(s ...googleapi.Field) *RastersParentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RastersParentsListCall) IfNoneMatch(entityTag string) *RastersParentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RastersParentsListCall) Context(ctx context.Context) *RastersParentsListCall { + c.ctx_ = ctx + return c +} + +func (c *RastersParentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}/parents") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasters.parents.list" call. +// Exactly one of *ParentsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ParentsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RastersParentsListCall) Do() (*ParentsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ParentsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.rasters.permissions.batchDelete": + +type RastersPermissionsBatchDeleteCall struct { + s *Service + id string + permissionsbatchdeleterequest *PermissionsBatchDeleteRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// BatchDelete: Remove permission entries from an already existing +// asset. +func (r *RastersPermissionsService) BatchDelete(id string, permissionsbatchdeleterequest *PermissionsBatchDeleteRequest) *RastersPermissionsBatchDeleteCall { + c := &RastersPermissionsBatchDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.permissionsbatchdeleterequest = permissionsbatchdeleterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RastersPermissionsBatchDeleteCall) Fields(s ...googleapi.Field) *RastersPermissionsBatchDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RastersPermissionsBatchDeleteCall) Context(ctx context.Context) *RastersPermissionsBatchDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *RastersPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchdeleterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}/permissions/batchDelete") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasters.permissions.batchDelete" call. +// Exactly one of *PermissionsBatchDeleteResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PermissionsBatchDeleteResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RastersPermissionsBatchDeleteCall) Do() (*PermissionsBatchDeleteResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsBatchDeleteResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Remove permission entries from an already existing asset.", + // "httpMethod": "POST", + // "id": "mapsengine.rasters.permissions.batchDelete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset from which permissions will be removed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasters/{id}/permissions/batchDelete", + // "request": { + // "$ref": "PermissionsBatchDeleteRequest" + // }, + // "response": { + // "$ref": "PermissionsBatchDeleteResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasters.permissions.batchUpdate": + +type RastersPermissionsBatchUpdateCall struct { + s *Service + id string + permissionsbatchupdaterequest *PermissionsBatchUpdateRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// BatchUpdate: Add or update permission entries to an already existing +// asset. +// +// An asset can hold up to 20 different permission entries. Each +// batchInsert request is atomic. +func (r *RastersPermissionsService) BatchUpdate(id string, permissionsbatchupdaterequest *PermissionsBatchUpdateRequest) *RastersPermissionsBatchUpdateCall { + c := &RastersPermissionsBatchUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.permissionsbatchupdaterequest = permissionsbatchupdaterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RastersPermissionsBatchUpdateCall) Fields(s ...googleapi.Field) *RastersPermissionsBatchUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RastersPermissionsBatchUpdateCall) Context(ctx context.Context) *RastersPermissionsBatchUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *RastersPermissionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchupdaterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}/permissions/batchUpdate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasters.permissions.batchUpdate" call. +// Exactly one of *PermissionsBatchUpdateResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PermissionsBatchUpdateResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RastersPermissionsBatchUpdateCall) Do() (*PermissionsBatchUpdateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsBatchUpdateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add or update permission entries to an already existing asset.\n\nAn asset can hold up to 20 different permission entries. Each batchInsert request is atomic.", + // "httpMethod": "POST", + // "id": "mapsengine.rasters.permissions.batchUpdate", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset to which permissions will be added.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasters/{id}/permissions/batchUpdate", + // "request": { + // "$ref": "PermissionsBatchUpdateRequest" + // }, + // "response": { + // "$ref": "PermissionsBatchUpdateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.rasters.permissions.list": + +type RastersPermissionsListCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Return all of the permissions for the specified asset. +func (r *RastersPermissionsService) List(id string) *RastersPermissionsListCall { + c := &RastersPermissionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RastersPermissionsListCall) Fields(s ...googleapi.Field) *RastersPermissionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RastersPermissionsListCall) IfNoneMatch(entityTag string) *RastersPermissionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RastersPermissionsListCall) Context(ctx context.Context) *RastersPermissionsListCall { + c.ctx_ = ctx + return c +} + +func (c *RastersPermissionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "rasters/{id}/permissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.rasters.permissions.list" call. +// Exactly one of *PermissionsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PermissionsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RastersPermissionsListCall) Do() (*PermissionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all of the permissions for the specified asset.", + // "httpMethod": "GET", + // "id": "mapsengine.rasters.permissions.list", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset whose permissions will be listed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "rasters/{id}/permissions", + // "response": { + // "$ref": "PermissionsListResponse" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesCreateCall) Fields(s ...googleapi.Field) *TablesCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesCreateCall) Context(ctx context.Context) *TablesCreateCall { + c.ctx_ = ctx + return c +} + +func (c *TablesCreateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.create" call. +// Exactly one of *Table or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Table.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TablesCreateCall) Do() (*Table, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Table{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.delete": + +type TablesDeleteCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Delete a table. +func (r *TablesService) Delete(id string) *TablesDeleteCall { + c := &TablesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesDeleteCall) Fields(s ...googleapi.Field) *TablesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesDeleteCall) Context(ctx context.Context) *TablesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TablesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.delete" call. +func (c *TablesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a table.", + // "httpMethod": "DELETE", + // "id": "mapsengine.tables.delete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the table. Only the table creator or project owner are permitted to delete. If the table is included in a layer, the request will fail. Remove it from all layers prior to deleting.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{id}", + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.tables.get": + +type TablesGetCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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": +// +// Possible values: +// "draft" - The draft version. +// "published" - The published version. +func (c *TablesGetCall) Version(version string) *TablesGetCall { + c.opt_["version"] = version + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesGetCall) Fields(s ...googleapi.Field) *TablesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TablesGetCall) IfNoneMatch(entityTag string) *TablesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesGetCall) Context(ctx context.Context) *TablesGetCall { + c.ctx_ = ctx + return c +} + +func (c *TablesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["version"]; ok { + params.Set("version", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.get" call. +// Exactly one of *Table or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Table.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TablesGetCall) Do() (*Table, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Table{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// ProcessingStatus sets the optional parameter "processingStatus": +// +// Possible values: +// "complete" - The table has completed processing. +// "failed" - The table has failed processing. +// "notReady" - The table is not ready for processing. +// "processing" - The table is processing. +// "ready" - The table is ready for processing. +func (c *TablesListCall) ProcessingStatus(processingStatus string) *TablesListCall { + c.opt_["processingStatus"] = processingStatus + 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 +} + +// Role sets the optional parameter "role": The role parameter indicates +// that the response should only contain assets where the current user +// has the specified level of access. +// +// Possible values: +// "owner" - The user can read, write and administer the asset. +// "reader" - The user can read the asset. +// "writer" - The user can read and write the asset. +func (c *TablesListCall) Role(role string) *TablesListCall { + c.opt_["role"] = role + return c +} + +// Search sets the optional parameter "search": An unstructured search +// string used to filter the set of results based on asset metadata. +func (c *TablesListCall) Search(search string) *TablesListCall { + c.opt_["search"] = search + return c +} + +// Tags sets the optional parameter "tags": A comma separated list of +// tags. Returned assets will contain all the tags from the list. +func (c *TablesListCall) Tags(tags string) *TablesListCall { + c.opt_["tags"] = tags + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesListCall) Fields(s ...googleapi.Field) *TablesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TablesListCall) IfNoneMatch(entityTag string) *TablesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesListCall) Context(ctx context.Context) *TablesListCall { + c.ctx_ = ctx + return c +} + +func (c *TablesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["processingStatus"]; ok { + params.Set("processingStatus", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projectId"]; ok { + params.Set("projectId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["role"]; ok { + params.Set("role", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["search"]; ok { + params.Set("search", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["tags"]; ok { + params.Set("tags", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.list" call. +// Exactly one of *TablesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TablesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TablesListCall) Do() (*TablesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TablesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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" + // }, + // "processingStatus": { + // "enum": [ + // "complete", + // "failed", + // "notReady", + // "processing", + // "ready" + // ], + // "enumDescriptions": [ + // "The table has completed processing.", + // "The table has failed processing.", + // "The table is not ready for processing.", + // "The table is processing.", + // "The table is ready for processing." + // ], + // "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" + // }, + // "role": { + // "description": "The role parameter indicates that the response should only contain assets where the current user has the specified level of access.", + // "enum": [ + // "owner", + // "reader", + // "writer" + // ], + // "enumDescriptions": [ + // "The user can read, write and administer the asset.", + // "The user can read the asset.", + // "The user can read and write the asset." + // ], + // "location": "query", + // "type": "string" + // }, + // "search": { + // "description": "An unstructured search string used to filter the set of results based on asset metadata.", + // "location": "query", + // "type": "string" + // }, + // "tags": { + // "description": "A comma separated list of tags. Returned assets will contain all the tags from the list.", + // "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.patch": + +type TablesPatchCall struct { + s *Service + id string + table *Table + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Mutate a table asset. +func (r *TablesService) Patch(id string, table *Table) *TablesPatchCall { + c := &TablesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.table = table + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesPatchCall) Fields(s ...googleapi.Field) *TablesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesPatchCall) Context(ctx context.Context) *TablesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *TablesPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.patch" call. +func (c *TablesPatchCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Mutate a table asset.", + // "httpMethod": "PATCH", + // "id": "mapsengine.tables.patch", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the table.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{id}", + // "request": { + // "$ref": "Table" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.tables.process": + +type TablesProcessCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Process: Process a table asset. +func (r *TablesService) Process(id string) *TablesProcessCall { + c := &TablesProcessCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesProcessCall) Fields(s ...googleapi.Field) *TablesProcessCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesProcessCall) Context(ctx context.Context) *TablesProcessCall { + c.ctx_ = ctx + return c +} + +func (c *TablesProcessCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/process") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.process" call. +// Exactly one of *ProcessResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ProcessResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TablesProcessCall) Do() (*ProcessResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ProcessResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Process a table asset.", + // "httpMethod": "POST", + // "id": "mapsengine.tables.process", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the table.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{id}/process", + // "response": { + // "$ref": "ProcessResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.tables.upload": + +type TablesUploadCall struct { + s *Service + table *Table + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesUploadCall) Fields(s ...googleapi.Field) *TablesUploadCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesUploadCall) Context(ctx context.Context) *TablesUploadCall { + c.ctx_ = ctx + return c +} + +func (c *TablesUploadCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.upload" call. +// Exactly one of *Table or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Table.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TablesUploadCall) Do() (*Table, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Table{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesFeaturesBatchDeleteCall) Fields(s ...googleapi.Field) *TablesFeaturesBatchDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesFeaturesBatchDeleteCall) Context(ctx context.Context) *TablesFeaturesBatchDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TablesFeaturesBatchDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.featuresbatchdeleterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/features/batchDelete") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.features.batchDelete" call. +func (c *TablesFeaturesBatchDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesFeaturesBatchInsertCall) Fields(s ...googleapi.Field) *TablesFeaturesBatchInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesFeaturesBatchInsertCall) Context(ctx context.Context) *TablesFeaturesBatchInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TablesFeaturesBatchInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.featuresbatchinsertrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/features/batchInsert") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.features.batchInsert" call. +func (c *TablesFeaturesBatchInsertCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesFeaturesBatchPatchCall) Fields(s ...googleapi.Field) *TablesFeaturesBatchPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesFeaturesBatchPatchCall) Context(ctx context.Context) *TablesFeaturesBatchPatchCall { + c.ctx_ = ctx + return c +} + +func (c *TablesFeaturesBatchPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.featuresbatchpatchrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/features/batchPatch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.features.batchPatch" call. +func (c *TablesFeaturesBatchPatchCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "draft" - The draft version. +// "published" - The published version. +func (c *TablesFeaturesGetCall) Version(version string) *TablesFeaturesGetCall { + c.opt_["version"] = version + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesFeaturesGetCall) Fields(s ...googleapi.Field) *TablesFeaturesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TablesFeaturesGetCall) IfNoneMatch(entityTag string) *TablesFeaturesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesFeaturesGetCall) Context(ctx context.Context) *TablesFeaturesGetCall { + c.ctx_ = ctx + return c +} + +func (c *TablesFeaturesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/features/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tableId": c.tableId, + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.features.get" call. +// Exactly one of *Feature or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Feature.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TablesFeaturesGetCall) Do() (*Feature, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Feature{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. The +// maximum supported value is 1000. +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. +// +// Possible values: +// "draft" - The draft version. +// "published" - The published version. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesFeaturesListCall) Fields(s ...googleapi.Field) *TablesFeaturesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TablesFeaturesListCall) IfNoneMatch(entityTag string) *TablesFeaturesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesFeaturesListCall) Context(ctx context.Context) *TablesFeaturesListCall { + c.ctx_ = ctx + return c +} + +func (c *TablesFeaturesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/features") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.features.list" call. +// Exactly one of *FeaturesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FeaturesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TablesFeaturesListCall) Do() (*FeaturesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FeaturesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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. The maximum supported value is 1000.", + // "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 + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// 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 +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *TablesFilesInsertCall) Media(r io.Reader) *TablesFilesInsertCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *TablesFilesInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *TablesFilesInsertCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *TablesFilesInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *TablesFilesInsertCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesFilesInsertCall) Fields(s ...googleapi.Field) *TablesFilesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *TablesFilesInsertCall) Context(ctx context.Context) *TablesFilesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TablesFilesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("filename", fmt.Sprintf("%v", c.filename)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/files") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + body = new(bytes.Buffer) + ctype := "application/json" + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.files.insert" call. +func (c *TablesFilesInsertCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return err + } + defer res.Body.Close() + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesParentsListCall) Fields(s ...googleapi.Field) *TablesParentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TablesParentsListCall) IfNoneMatch(entityTag string) *TablesParentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesParentsListCall) Context(ctx context.Context) *TablesParentsListCall { + c.ctx_ = ctx + return c +} + +func (c *TablesParentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/parents") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.parents.list" call. +// Exactly one of *ParentsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ParentsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TablesParentsListCall) Do() (*ParentsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ParentsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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" + // ] + // } + +} + +// method id "mapsengine.tables.permissions.batchDelete": + +type TablesPermissionsBatchDeleteCall struct { + s *Service + id string + permissionsbatchdeleterequest *PermissionsBatchDeleteRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// BatchDelete: Remove permission entries from an already existing +// asset. +func (r *TablesPermissionsService) BatchDelete(id string, permissionsbatchdeleterequest *PermissionsBatchDeleteRequest) *TablesPermissionsBatchDeleteCall { + c := &TablesPermissionsBatchDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.permissionsbatchdeleterequest = permissionsbatchdeleterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesPermissionsBatchDeleteCall) Fields(s ...googleapi.Field) *TablesPermissionsBatchDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesPermissionsBatchDeleteCall) Context(ctx context.Context) *TablesPermissionsBatchDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TablesPermissionsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchdeleterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/permissions/batchDelete") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.permissions.batchDelete" call. +// Exactly one of *PermissionsBatchDeleteResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PermissionsBatchDeleteResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TablesPermissionsBatchDeleteCall) Do() (*PermissionsBatchDeleteResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsBatchDeleteResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Remove permission entries from an already existing asset.", + // "httpMethod": "POST", + // "id": "mapsengine.tables.permissions.batchDelete", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset from which permissions will be removed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{id}/permissions/batchDelete", + // "request": { + // "$ref": "PermissionsBatchDeleteRequest" + // }, + // "response": { + // "$ref": "PermissionsBatchDeleteResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.tables.permissions.batchUpdate": + +type TablesPermissionsBatchUpdateCall struct { + s *Service + id string + permissionsbatchupdaterequest *PermissionsBatchUpdateRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// BatchUpdate: Add or update permission entries to an already existing +// asset. +// +// An asset can hold up to 20 different permission entries. Each +// batchInsert request is atomic. +func (r *TablesPermissionsService) BatchUpdate(id string, permissionsbatchupdaterequest *PermissionsBatchUpdateRequest) *TablesPermissionsBatchUpdateCall { + c := &TablesPermissionsBatchUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + c.permissionsbatchupdaterequest = permissionsbatchupdaterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesPermissionsBatchUpdateCall) Fields(s ...googleapi.Field) *TablesPermissionsBatchUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesPermissionsBatchUpdateCall) Context(ctx context.Context) *TablesPermissionsBatchUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *TablesPermissionsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.permissionsbatchupdaterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/permissions/batchUpdate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.permissions.batchUpdate" call. +// Exactly one of *PermissionsBatchUpdateResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PermissionsBatchUpdateResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TablesPermissionsBatchUpdateCall) Do() (*PermissionsBatchUpdateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsBatchUpdateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add or update permission entries to an already existing asset.\n\nAn asset can hold up to 20 different permission entries. Each batchInsert request is atomic.", + // "httpMethod": "POST", + // "id": "mapsengine.tables.permissions.batchUpdate", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset to which permissions will be added.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{id}/permissions/batchUpdate", + // "request": { + // "$ref": "PermissionsBatchUpdateRequest" + // }, + // "response": { + // "$ref": "PermissionsBatchUpdateResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine" + // ] + // } + +} + +// method id "mapsengine.tables.permissions.list": + +type TablesPermissionsListCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Return all of the permissions for the specified asset. +func (r *TablesPermissionsService) List(id string) *TablesPermissionsListCall { + c := &TablesPermissionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TablesPermissionsListCall) Fields(s ...googleapi.Field) *TablesPermissionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TablesPermissionsListCall) IfNoneMatch(entityTag string) *TablesPermissionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TablesPermissionsListCall) Context(ctx context.Context) *TablesPermissionsListCall { + c.ctx_ = ctx + return c +} + +func (c *TablesPermissionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{id}/permissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mapsengine.tables.permissions.list" call. +// Exactly one of *PermissionsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PermissionsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TablesPermissionsListCall) Do() (*PermissionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PermissionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Return all of the permissions for the specified asset.", + // "httpMethod": "GET", + // "id": "mapsengine.tables.permissions.list", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the asset whose permissions will be listed.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "tables/{id}/permissions", + // "response": { + // "$ref": "PermissionsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/mapsengine", + // "https://www.googleapis.com/auth/mapsengine.readonly" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/mirror/v1/mirror-api.json b/Godeps/_workspace/src/google.golang.org/api/mirror/v1/mirror-api.json new file mode 100644 index 000000000..221add301 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/mirror/v1/mirror-api.json @@ -0,0 +1,1390 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/VW0KvFHTdSFgeNX5qCIVR7JEmkg\"", + "discoveryVersion": "v1", + "id": "mirror:v1", + "name": "mirror", + "version": "v1", + "revision": "20141209", + "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." + }, + "contextual_command": { + "type": "string", + "description": "The ContextualMenus.Command associated with this MenuItem (e.g. READ_ALOUD). The voice label for this command will be displayed in the voice menu and the touch label will be displayed in the touch menu. Note that the default menu value's display name will be overriden if you specify this property. Values that do not correspond to a ContextualMenus.Command name will be ignored." + }, + "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." + } + } + }, + "Setting": { + "id": "Setting", + "type": "object", + "description": "A setting for Glass.", + "properties": { + "id": { + "type": "string", + "description": "The setting's ID. The following IDs are valid: \n- locale - The key to the user’s language/locale (BCP 47 identifier) that Glassware should use to render localized content. \n- timezone - The key to the user’s current time zone region as defined in the tz database. Example: America/Los_Angeles." + }, + "kind": { + "type": "string", + "description": "The type of resource. This is always mirror#setting.", + "default": "mirror#setting" + }, + "value": { + "type": "string", + "description": "The setting value, as a string." + } + } + }, + "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. \n- settings - Settings 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" + ] + } + } + }, + "settings": { + "methods": { + "get": { + "id": "mirror.settings.get", + "path": "settings/{id}", + "httpMethod": "GET", + "description": "Gets a single setting by ID.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the setting. The following IDs are valid: \n- locale - The key to the user’s language/locale (BCP 47 identifier) that Glassware should use to render localized content. \n- timezone - The key to the user’s current time zone region as defined in the tz database. Example: America/Los_Angeles.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "Setting" + }, + "scopes": [ + "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/Godeps/_workspace/src/google.golang.org/api/mirror/v1/mirror-gen.go b/Godeps/_workspace/src/google.golang.org/api/mirror/v1/mirror-gen.go new file mode 100644 index 000000000..57b074d97 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/mirror/v1/mirror-gen.go @@ -0,0 +1,4282 @@ +// Package mirror provides access to the Google Mirror API. +// +// See https://developers.google.com/glass +// +// Usage example: +// +// import "google.golang.org/api/mirror/v1" +// ... +// mirrorService, err := mirror.New(oauthHttpClient) +package mirror // import "google.golang.org/api/mirror/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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.Settings = NewSettingsService(s) + s.Subscriptions = NewSubscriptionsService(s) + s.Timeline = NewTimelineService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Accounts *AccountsService + + Contacts *ContactsService + + Locations *LocationsService + + Settings *SettingsService + + Subscriptions *SubscriptionsService + + Timeline *TimelineService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 NewSettingsService(s *Service) *SettingsService { + rs := &SettingsService{s: s} + return rs +} + +type SettingsService 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 +} + +// Account: Represents an account passed into the Account Manager on +// Glass. +type Account struct { + AuthTokens []*AuthToken `json:"authTokens,omitempty"` + + Features []string `json:"features,omitempty"` + + Password string `json:"password,omitempty"` + + UserData []*UserData `json:"userData,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AuthTokens") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Account) MarshalJSON() ([]byte, error) { + type noMethod Account + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Attachment: Represents media content, such as a photo, that can be +// attached to a timeline item. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ContentType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Attachment) MarshalJSON() ([]byte, error) { + type noMethod Attachment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AttachmentsListResponse: A list of Attachments. This is the response +// from the server to GET requests on the attachments collection. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AttachmentsListResponse) MarshalJSON() ([]byte, error) { + type noMethod AttachmentsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type AuthToken struct { + AuthToken string `json:"authToken,omitempty"` + + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AuthToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AuthToken) MarshalJSON() ([]byte, error) { + type noMethod AuthToken + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Command: A single menu command that is part of a Contact. +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"` + + // ForceSendFields is a list of field names (e.g. "Type") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Command) MarshalJSON() ([]byte, error) { + type noMethod Command + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Contact: A person or group that can be used as a creator or a +// contact. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AcceptCommands") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Contact) MarshalJSON() ([]byte, error) { + type noMethod Contact + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ContactsListResponse: A list of Contacts representing contacts. This +// is the response from the server to GET requests on the contacts +// collection. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ContactsListResponse) MarshalJSON() ([]byte, error) { + type noMethod ContactsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Location: A geographic location that can be associated with a +// timeline item. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Accuracy") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Location) MarshalJSON() ([]byte, error) { + type noMethod Location + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LocationsListResponse: A list of Locations. This is the response from +// the server to GET requests on the locations collection. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LocationsListResponse) MarshalJSON() ([]byte, error) { + type noMethod LocationsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MenuItem: A custom menu item that can be presented to the user by a +// timeline item. +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"` + + // ContextualCommand: The ContextualMenus.Command associated with this + // MenuItem (e.g. READ_ALOUD). The voice label for this command will be + // displayed in the voice menu and the touch label will be displayed in + // the touch menu. Note that the default menu value's display name will + // be overriden if you specify this property. Values that do not + // correspond to a ContextualMenus.Command name will be ignored. + ContextualCommand string `json:"contextual_command,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"` + + // ForceSendFields is a list of field names (e.g. "Action") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MenuItem) MarshalJSON() ([]byte, error) { + type noMethod MenuItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MenuValue: A single value that is part of a MenuItem. +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"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MenuValue) MarshalJSON() ([]byte, error) { + type noMethod MenuValue + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Notification: A notification delivered by the API. +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"` + + // ForceSendFields is a list of field names (e.g. "Collection") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Notification) MarshalJSON() ([]byte, error) { + type noMethod Notification + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// NotificationConfig: Controls how notifications for a timeline item +// are presented to the user. +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"` + + // ForceSendFields is a list of field names (e.g. "DeliveryTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *NotificationConfig) MarshalJSON() ([]byte, error) { + type noMethod NotificationConfig + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Setting: A setting for Glass. +type Setting struct { + // Id: The setting's ID. The following IDs are valid: + // - locale - The key to the user’s language/locale (BCP 47 + // identifier) that Glassware should use to render localized content. + // + // - timezone - The key to the user’s current time zone region as + // defined in the tz database. Example: America/Los_Angeles. + Id string `json:"id,omitempty"` + + // Kind: The type of resource. This is always mirror#setting. + Kind string `json:"kind,omitempty"` + + // Value: The setting value, as a string. + Value string `json:"value,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Setting) MarshalJSON() ([]byte, error) { + type noMethod Setting + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Subscription: A subscription to events on a collection. +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. + // - settings - Settings 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CallbackUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Subscription) MarshalJSON() ([]byte, error) { + type noMethod Subscription + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SubscriptionsListResponse: A list of Subscriptions. This is the +// response from the server to GET requests on the subscription +// collection. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SubscriptionsListResponse) MarshalJSON() ([]byte, error) { + type noMethod SubscriptionsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TimelineItem: Each item in the user's timeline is represented as a +// TimelineItem JSON structure, described below. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Attachments") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TimelineItem) MarshalJSON() ([]byte, error) { + type noMethod TimelineItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TimelineListResponse: A list of timeline items. This is the response +// from the server to GET requests on the timeline collection. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TimelineListResponse) MarshalJSON() ([]byte, error) { + type noMethod TimelineListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserAction: Represents an action taken by the user that triggered a +// notification. +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"` + + // ForceSendFields is a list of field names (e.g. "Payload") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserAction) MarshalJSON() ([]byte, error) { + type noMethod UserAction + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type UserData struct { + Key string `json:"key,omitempty"` + + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserData) MarshalJSON() ([]byte, error) { + type noMethod UserData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "mirror.accounts.insert": + +type AccountsInsertCall struct { + s *Service + userToken string + accountType string + accountName string + account *Account + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsInsertCall) Fields(s ...googleapi.Field) *AccountsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsInsertCall) Context(ctx context.Context) *AccountsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{userToken}/{accountType}/{accountName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userToken": c.userToken, + "accountType": c.accountType, + "accountName": c.accountName, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mirror.accounts.insert" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsInsertCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ContactsDeleteCall) Fields(s ...googleapi.Field) *ContactsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ContactsDeleteCall) Context(ctx context.Context) *ContactsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ContactsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "contacts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mirror.contacts.delete" call. +func (c *ContactsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ContactsGetCall) Fields(s ...googleapi.Field) *ContactsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ContactsGetCall) IfNoneMatch(entityTag string) *ContactsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ContactsGetCall) Context(ctx context.Context) *ContactsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ContactsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "contacts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mirror.contacts.get" call. +// Exactly one of *Contact or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Contact.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ContactsGetCall) Do() (*Contact, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Contact{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ContactsInsertCall) Fields(s ...googleapi.Field) *ContactsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ContactsInsertCall) Context(ctx context.Context) *ContactsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ContactsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mirror.contacts.insert" call. +// Exactly one of *Contact or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Contact.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ContactsInsertCall) Do() (*Contact, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Contact{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ContactsListCall) Fields(s ...googleapi.Field) *ContactsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ContactsListCall) IfNoneMatch(entityTag string) *ContactsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ContactsListCall) Context(ctx context.Context) *ContactsListCall { + c.ctx_ = ctx + return c +} + +func (c *ContactsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "contacts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mirror.contacts.list" call. +// Exactly one of *ContactsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ContactsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ContactsListCall) Do() (*ContactsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ContactsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ContactsPatchCall) Fields(s ...googleapi.Field) *ContactsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ContactsPatchCall) Context(ctx context.Context) *ContactsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ContactsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "contacts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mirror.contacts.patch" call. +// Exactly one of *Contact or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Contact.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ContactsPatchCall) Do() (*Contact, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Contact{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ContactsUpdateCall) Fields(s ...googleapi.Field) *ContactsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ContactsUpdateCall) Context(ctx context.Context) *ContactsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ContactsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "contacts/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mirror.contacts.update" call. +// Exactly one of *Contact or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Contact.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ContactsUpdateCall) Do() (*Contact, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Contact{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LocationsGetCall) Fields(s ...googleapi.Field) *LocationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LocationsGetCall) IfNoneMatch(entityTag string) *LocationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LocationsGetCall) Context(ctx context.Context) *LocationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *LocationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "locations/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mirror.locations.get" call. +// Exactly one of *Location or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Location.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *LocationsGetCall) Do() (*Location, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Location{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LocationsListCall) Fields(s ...googleapi.Field) *LocationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LocationsListCall) IfNoneMatch(entityTag string) *LocationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LocationsListCall) Context(ctx context.Context) *LocationsListCall { + c.ctx_ = ctx + return c +} + +func (c *LocationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "locations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mirror.locations.list" call. +// Exactly one of *LocationsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *LocationsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LocationsListCall) Do() (*LocationsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LocationsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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.settings.get": + +type SettingsGetCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a single setting by ID. +func (r *SettingsService) Get(id string) *SettingsGetCall { + c := &SettingsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SettingsGetCall) Fields(s ...googleapi.Field) *SettingsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SettingsGetCall) IfNoneMatch(entityTag string) *SettingsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SettingsGetCall) Context(ctx context.Context) *SettingsGetCall { + c.ctx_ = ctx + return c +} + +func (c *SettingsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "settings/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mirror.settings.get" call. +// Exactly one of *Setting or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Setting.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *SettingsGetCall) Do() (*Setting, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Setting{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a single setting by ID.", + // "httpMethod": "GET", + // "id": "mirror.settings.get", + // "parameterOrder": [ + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the setting. The following IDs are valid: \n- locale - The key to the user’s language/locale (BCP 47 identifier) that Glassware should use to render localized content. \n- timezone - The key to the user’s current time zone region as defined in the tz database. Example: America/Los_Angeles.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "settings/{id}", + // "response": { + // "$ref": "Setting" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/glass.timeline" + // ] + // } + +} + +// method id "mirror.subscriptions.delete": + +type SubscriptionsDeleteCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsDeleteCall) Fields(s ...googleapi.Field) *SubscriptionsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsDeleteCall) Context(ctx context.Context) *SubscriptionsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mirror.subscriptions.delete" call. +func (c *SubscriptionsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsInsertCall) Fields(s ...googleapi.Field) *SubscriptionsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsInsertCall) Context(ctx context.Context) *SubscriptionsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mirror.subscriptions.insert" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubscriptionsInsertCall) Do() (*Subscription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsListCall) Fields(s ...googleapi.Field) *SubscriptionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SubscriptionsListCall) IfNoneMatch(entityTag string) *SubscriptionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsListCall) Context(ctx context.Context) *SubscriptionsListCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mirror.subscriptions.list" call. +// Exactly one of *SubscriptionsListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *SubscriptionsListResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SubscriptionsListCall) Do() (*SubscriptionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SubscriptionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsUpdateCall) Fields(s ...googleapi.Field) *SubscriptionsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsUpdateCall) Context(ctx context.Context) *SubscriptionsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mirror.subscriptions.update" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubscriptionsUpdateCall) Do() (*Subscription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TimelineDeleteCall) Fields(s ...googleapi.Field) *TimelineDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TimelineDeleteCall) Context(ctx context.Context) *TimelineDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TimelineDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mirror.timeline.delete" call. +func (c *TimelineDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TimelineGetCall) Fields(s ...googleapi.Field) *TimelineGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TimelineGetCall) IfNoneMatch(entityTag string) *TimelineGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TimelineGetCall) Context(ctx context.Context) *TimelineGetCall { + c.ctx_ = ctx + return c +} + +func (c *TimelineGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mirror.timeline.get" call. +// Exactly one of *TimelineItem or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TimelineItem.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TimelineGetCall) Do() (*TimelineItem, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TimelineItem{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets 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 + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// 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 +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *TimelineInsertCall) Media(r io.Reader) *TimelineInsertCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *TimelineInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *TimelineInsertCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *TimelineInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *TimelineInsertCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TimelineInsertCall) Fields(s ...googleapi.Field) *TimelineInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *TimelineInsertCall) Context(ctx context.Context) *TimelineInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TimelineInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "timeline") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mirror.timeline.insert" call. +// Exactly one of *TimelineItem or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TimelineItem.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TimelineInsertCall) Do() (*TimelineItem, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &TimelineItem{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "displayTime" - Results will be ordered by displayTime (default). +// This is the same ordering as is used in the timeline on the device. +// "writeTime" - Results will be ordered by the time at which they +// were last written to the data store. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TimelineListCall) Fields(s ...googleapi.Field) *TimelineListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TimelineListCall) IfNoneMatch(entityTag string) *TimelineListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TimelineListCall) Context(ctx context.Context) *TimelineListCall { + c.ctx_ = ctx + return c +} + +func (c *TimelineListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mirror.timeline.list" call. +// Exactly one of *TimelineListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TimelineListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TimelineListCall) Do() (*TimelineListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TimelineListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TimelinePatchCall) Fields(s ...googleapi.Field) *TimelinePatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TimelinePatchCall) Context(ctx context.Context) *TimelinePatchCall { + c.ctx_ = ctx + return c +} + +func (c *TimelinePatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mirror.timeline.patch" call. +// Exactly one of *TimelineItem or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TimelineItem.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TimelinePatchCall) Do() (*TimelineItem, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TimelineItem{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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 + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// 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 +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *TimelineUpdateCall) Media(r io.Reader) *TimelineUpdateCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *TimelineUpdateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *TimelineUpdateCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *TimelineUpdateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *TimelineUpdateCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TimelineUpdateCall) Fields(s ...googleapi.Field) *TimelineUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *TimelineUpdateCall) Context(ctx context.Context) *TimelineUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *TimelineUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{id}") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mirror.timeline.update" call. +// Exactly one of *TimelineItem or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TimelineItem.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TimelineUpdateCall) Do() (*TimelineItem, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &TimelineItem{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TimelineAttachmentsDeleteCall) Fields(s ...googleapi.Field) *TimelineAttachmentsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TimelineAttachmentsDeleteCall) Context(ctx context.Context) *TimelineAttachmentsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TimelineAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{itemId}/attachments/{attachmentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "itemId": c.itemId, + "attachmentId": c.attachmentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mirror.timeline.attachments.delete" call. +func (c *TimelineAttachmentsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TimelineAttachmentsGetCall) Fields(s ...googleapi.Field) *TimelineAttachmentsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TimelineAttachmentsGetCall) IfNoneMatch(entityTag string) *TimelineAttachmentsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TimelineAttachmentsGetCall) Context(ctx context.Context) *TimelineAttachmentsGetCall { + c.ctx_ = ctx + return c +} + +func (c *TimelineAttachmentsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{itemId}/attachments/{attachmentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "itemId": c.itemId, + "attachmentId": c.attachmentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *TimelineAttachmentsGetCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "mirror.timeline.attachments.get" call. +// Exactly one of *Attachment or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Attachment.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TimelineAttachmentsGetCall) Do() (*Attachment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Attachment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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 + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// 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 +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *TimelineAttachmentsInsertCall) Media(r io.Reader) *TimelineAttachmentsInsertCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *TimelineAttachmentsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *TimelineAttachmentsInsertCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *TimelineAttachmentsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *TimelineAttachmentsInsertCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TimelineAttachmentsInsertCall) Fields(s ...googleapi.Field) *TimelineAttachmentsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *TimelineAttachmentsInsertCall) Context(ctx context.Context) *TimelineAttachmentsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TimelineAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{itemId}/attachments") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + body = new(bytes.Buffer) + ctype := "application/json" + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "itemId": c.itemId, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mirror.timeline.attachments.insert" call. +// Exactly one of *Attachment or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Attachment.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TimelineAttachmentsInsertCall) Do() (*Attachment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &Attachment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TimelineAttachmentsListCall) Fields(s ...googleapi.Field) *TimelineAttachmentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TimelineAttachmentsListCall) IfNoneMatch(entityTag string) *TimelineAttachmentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TimelineAttachmentsListCall) Context(ctx context.Context) *TimelineAttachmentsListCall { + c.ctx_ = ctx + return c +} + +func (c *TimelineAttachmentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{itemId}/attachments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "itemId": c.itemId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "mirror.timeline.attachments.list" call. +// Exactly one of *AttachmentsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AttachmentsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TimelineAttachmentsListCall) Do() (*AttachmentsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AttachmentsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a list of 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/Godeps/_workspace/src/google.golang.org/api/oauth2/v1/oauth2-api.json b/Godeps/_workspace/src/google.golang.org/api/oauth2/v1/oauth2-api.json new file mode 100644 index 000000000..c7142e8cc --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/oauth2/v1/oauth2-api.json @@ -0,0 +1,407 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/E7VrRWc2416Btp9uIQ42rmbOltA\"", + "discoveryVersion": "v1", + "id": "oauth2:v1", + "name": "oauth2", + "version": "v1", + "revision": "20150714", + "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 your basic profile info" + } + } + } + }, + "schemas": { + "Jwk": { + "id": "Jwk", + "type": "object", + "properties": { + "keys": { + "type": "array", + "items": { + "type": "object", + "properties": { + "alg": { + "type": "string", + "default": "RS256" + }, + "e": { + "type": "string" + }, + "kid": { + "type": "string" + }, + "kty": { + "type": "string", + "default": "RSA" + }, + "n": { + "type": "string" + }, + "use": { + "type": "string", + "default": "sig" + } + } + } + } + } + }, + "Raw": { + "id": "Raw", + "type": "object", + "properties": { + "keyvalues": { + "type": "array", + "items": { + "type": "object", + "properties": { + "algorithm": { + "type": "string", + "default": "RSA" + }, + "exponent": { + "type": "string" + }, + "keyid": { + "type": "string" + }, + "modulus": { + "type": "string" + } + } + } + } + } + }, + "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 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 obfuscated 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" + } + } + }, + "X509": { + "id": "X509", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "methods": { + "getCertForOpenIdConnect": { + "id": "oauth2.getCertForOpenIdConnect", + "path": "oauth2/v1/certs", + "httpMethod": "GET", + "response": { + "$ref": "X509" + } + }, + "getCertForOpenIdConnectRaw": { + "id": "oauth2.getCertForOpenIdConnectRaw", + "path": "oauth2/v1/raw_public_keys", + "httpMethod": "GET", + "response": { + "$ref": "Raw" + } + }, + "getRobotJwk": { + "id": "oauth2.getRobotJwk", + "path": "service_accounts/v1/jwk/{robotEmail}", + "httpMethod": "GET", + "parameters": { + "robotEmail": { + "type": "string", + "description": "The email of robot account.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "robotEmail" + ], + "response": { + "$ref": "Jwk" + } + }, + "getRobotMetadataRaw": { + "id": "oauth2.getRobotMetadataRaw", + "path": "service_accounts/v1/metadata/raw/{robotEmail}", + "httpMethod": "GET", + "parameters": { + "robotEmail": { + "type": "string", + "description": "The email of robot account.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "robotEmail" + ], + "response": { + "$ref": "Raw" + } + }, + "getRobotMetadataX509": { + "id": "oauth2.getRobotMetadataX509", + "path": "service_accounts/v1/metadata/x509/{robotEmail}", + "httpMethod": "GET", + "parameters": { + "robotEmail": { + "type": "string", + "description": "The email of robot account.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "robotEmail" + ], + "response": { + "$ref": "X509" + } + }, + "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/Godeps/_workspace/src/google.golang.org/api/oauth2/v1/oauth2-gen.go b/Godeps/_workspace/src/google.golang.org/api/oauth2/v1/oauth2-gen.go new file mode 100644 index 000000000..e0c083132 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/oauth2/v1/oauth2-gen.go @@ -0,0 +1,1229 @@ +// Package oauth2 provides access to the Google OAuth2 API. +// +// See https://developers.google.com/accounts/docs/OAuth2 +// +// Usage example: +// +// import "google.golang.org/api/oauth2/v1" +// ... +// oauth2Service, err := oauth2.New(oauthHttpClient) +package oauth2 // import "google.golang.org/api/oauth2/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 your basic profile info + 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 + UserAgent string // optional additional User-Agent fragment + + Userinfo *UserinfoService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 Jwk struct { + Keys []*JwkKeys `json:"keys,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Keys") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Jwk) MarshalJSON() ([]byte, error) { + type noMethod Jwk + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type JwkKeys struct { + Alg string `json:"alg,omitempty"` + + E string `json:"e,omitempty"` + + Kid string `json:"kid,omitempty"` + + Kty string `json:"kty,omitempty"` + + N string `json:"n,omitempty"` + + Use string `json:"use,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Alg") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JwkKeys) MarshalJSON() ([]byte, error) { + type noMethod JwkKeys + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Raw struct { + Keyvalues []*RawKeyvalues `json:"keyvalues,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Keyvalues") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Raw) MarshalJSON() ([]byte, error) { + type noMethod Raw + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type RawKeyvalues struct { + Algorithm string `json:"algorithm,omitempty"` + + Exponent string `json:"exponent,omitempty"` + + Keyid string `json:"keyid,omitempty"` + + Modulus string `json:"modulus,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Algorithm") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RawKeyvalues) MarshalJSON() ([]byte, error) { + type noMethod RawKeyvalues + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Tokeninfo struct { + // AccessType: The access type granted with this token. It can be + // offline or online. + AccessType 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"` + + // EmailVerified: Boolean flag which is true if the email address is + // verified. Present only if the email scope is present in the request. + EmailVerified bool `json:"email_verified,omitempty"` + + // ExpiresIn: The expiry time of the token, as number of seconds left + // until expiry. + ExpiresIn int64 `json:"expires_in,omitempty"` + + // IssuedAt: The issue time of the token, as number of seconds. + IssuedAt int64 `json:"issued_at,omitempty"` + + // IssuedTo: To whom was the token issued to. In general the same as + // audience. + IssuedTo 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"` + + // UserId: The obfuscated user id. + UserId string `json:"user_id,omitempty"` + + // VerifiedEmail: Boolean flag which is true if the email address is + // verified. Present only if the email scope is present in the request. + VerifiedEmail bool `json:"verified_email,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccessType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Tokeninfo) MarshalJSON() ([]byte, error) { + type noMethod Tokeninfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Userinfoplus struct { + // Email: The user's email address. + Email string `json:"email,omitempty"` + + // FamilyName: The user's last name. + FamilyName string `json:"family_name,omitempty"` + + // Gender: The user's gender. + Gender string `json:"gender,omitempty"` + + // GivenName: The user's first name. + GivenName 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 obfuscated 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"` + + // VerifiedEmail: 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 + VerifiedEmail *bool `json:"verified_email,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Email") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Userinfoplus) MarshalJSON() ([]byte, error) { + type noMethod Userinfoplus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "oauth2.getCertForOpenIdConnect": + +type GetCertForOpenIdConnectCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetCertForOpenIdConnect: +func (s *Service) GetCertForOpenIdConnect() *GetCertForOpenIdConnectCall { + c := &GetCertForOpenIdConnectCall{s: s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GetCertForOpenIdConnectCall) Fields(s ...googleapi.Field) *GetCertForOpenIdConnectCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GetCertForOpenIdConnectCall) IfNoneMatch(entityTag string) *GetCertForOpenIdConnectCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GetCertForOpenIdConnectCall) Context(ctx context.Context) *GetCertForOpenIdConnectCall { + c.ctx_ = ctx + return c +} + +func (c *GetCertForOpenIdConnectCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "oauth2/v1/certs") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "oauth2.getCertForOpenIdConnect" call. +func (c *GetCertForOpenIdConnectCall) Do() (map[string]string, error) { + res, err := c.doRequest("json") + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret map[string]string + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "GET", + // "id": "oauth2.getCertForOpenIdConnect", + // "path": "oauth2/v1/certs", + // "response": { + // "$ref": "X509" + // } + // } + +} + +// method id "oauth2.getCertForOpenIdConnectRaw": + +type GetCertForOpenIdConnectRawCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetCertForOpenIdConnectRaw: +func (s *Service) GetCertForOpenIdConnectRaw() *GetCertForOpenIdConnectRawCall { + c := &GetCertForOpenIdConnectRawCall{s: s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GetCertForOpenIdConnectRawCall) Fields(s ...googleapi.Field) *GetCertForOpenIdConnectRawCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GetCertForOpenIdConnectRawCall) IfNoneMatch(entityTag string) *GetCertForOpenIdConnectRawCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GetCertForOpenIdConnectRawCall) Context(ctx context.Context) *GetCertForOpenIdConnectRawCall { + c.ctx_ = ctx + return c +} + +func (c *GetCertForOpenIdConnectRawCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "oauth2/v1/raw_public_keys") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "oauth2.getCertForOpenIdConnectRaw" call. +// Exactly one of *Raw or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Raw.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *GetCertForOpenIdConnectRawCall) Do() (*Raw, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Raw{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "GET", + // "id": "oauth2.getCertForOpenIdConnectRaw", + // "path": "oauth2/v1/raw_public_keys", + // "response": { + // "$ref": "Raw" + // } + // } + +} + +// method id "oauth2.getRobotJwk": + +type GetRobotJwkCall struct { + s *Service + robotEmail string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetRobotJwk: +func (s *Service) GetRobotJwk(robotEmail string) *GetRobotJwkCall { + c := &GetRobotJwkCall{s: s, opt_: make(map[string]interface{})} + c.robotEmail = robotEmail + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GetRobotJwkCall) Fields(s ...googleapi.Field) *GetRobotJwkCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GetRobotJwkCall) IfNoneMatch(entityTag string) *GetRobotJwkCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GetRobotJwkCall) Context(ctx context.Context) *GetRobotJwkCall { + c.ctx_ = ctx + return c +} + +func (c *GetRobotJwkCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "service_accounts/v1/jwk/{robotEmail}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "robotEmail": c.robotEmail, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "oauth2.getRobotJwk" call. +// Exactly one of *Jwk or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Jwk.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *GetRobotJwkCall) Do() (*Jwk, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Jwk{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "GET", + // "id": "oauth2.getRobotJwk", + // "parameterOrder": [ + // "robotEmail" + // ], + // "parameters": { + // "robotEmail": { + // "description": "The email of robot account.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "service_accounts/v1/jwk/{robotEmail}", + // "response": { + // "$ref": "Jwk" + // } + // } + +} + +// method id "oauth2.getRobotMetadataRaw": + +type GetRobotMetadataRawCall struct { + s *Service + robotEmail string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetRobotMetadataRaw: +func (s *Service) GetRobotMetadataRaw(robotEmail string) *GetRobotMetadataRawCall { + c := &GetRobotMetadataRawCall{s: s, opt_: make(map[string]interface{})} + c.robotEmail = robotEmail + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GetRobotMetadataRawCall) Fields(s ...googleapi.Field) *GetRobotMetadataRawCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GetRobotMetadataRawCall) IfNoneMatch(entityTag string) *GetRobotMetadataRawCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GetRobotMetadataRawCall) Context(ctx context.Context) *GetRobotMetadataRawCall { + c.ctx_ = ctx + return c +} + +func (c *GetRobotMetadataRawCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "service_accounts/v1/metadata/raw/{robotEmail}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "robotEmail": c.robotEmail, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "oauth2.getRobotMetadataRaw" call. +// Exactly one of *Raw or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Raw.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *GetRobotMetadataRawCall) Do() (*Raw, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Raw{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "GET", + // "id": "oauth2.getRobotMetadataRaw", + // "parameterOrder": [ + // "robotEmail" + // ], + // "parameters": { + // "robotEmail": { + // "description": "The email of robot account.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "service_accounts/v1/metadata/raw/{robotEmail}", + // "response": { + // "$ref": "Raw" + // } + // } + +} + +// method id "oauth2.getRobotMetadataX509": + +type GetRobotMetadataX509Call struct { + s *Service + robotEmail string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetRobotMetadataX509: +func (s *Service) GetRobotMetadataX509(robotEmail string) *GetRobotMetadataX509Call { + c := &GetRobotMetadataX509Call{s: s, opt_: make(map[string]interface{})} + c.robotEmail = robotEmail + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GetRobotMetadataX509Call) Fields(s ...googleapi.Field) *GetRobotMetadataX509Call { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GetRobotMetadataX509Call) IfNoneMatch(entityTag string) *GetRobotMetadataX509Call { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GetRobotMetadataX509Call) Context(ctx context.Context) *GetRobotMetadataX509Call { + c.ctx_ = ctx + return c +} + +func (c *GetRobotMetadataX509Call) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "service_accounts/v1/metadata/x509/{robotEmail}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "robotEmail": c.robotEmail, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "oauth2.getRobotMetadataX509" call. +func (c *GetRobotMetadataX509Call) Do() (map[string]string, error) { + res, err := c.doRequest("json") + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var ret map[string]string + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "GET", + // "id": "oauth2.getRobotMetadataX509", + // "parameterOrder": [ + // "robotEmail" + // ], + // "parameters": { + // "robotEmail": { + // "description": "The email of robot account.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "service_accounts/v1/metadata/x509/{robotEmail}", + // "response": { + // "$ref": "X509" + // } + // } + +} + +// method id "oauth2.tokeninfo": + +type TokeninfoCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// Tokeninfo: Get token info +func (s *Service) Tokeninfo() *TokeninfoCall { + c := &TokeninfoCall{s: s, opt_: make(map[string]interface{})} + return c +} + +// AccessToken sets the optional parameter "access_token": The oauth2 +// access token +func (c *TokeninfoCall) AccessToken(accessToken string) *TokeninfoCall { + c.opt_["access_token"] = accessToken + return c +} + +// IdToken sets the optional parameter "id_token": The ID token +func (c *TokeninfoCall) IdToken(idToken string) *TokeninfoCall { + c.opt_["id_token"] = idToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TokeninfoCall) Fields(s ...googleapi.Field) *TokeninfoCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TokeninfoCall) Context(ctx context.Context) *TokeninfoCall { + c.ctx_ = ctx + return c +} + +func (c *TokeninfoCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "oauth2.tokeninfo" call. +// Exactly one of *Tokeninfo or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Tokeninfo.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TokeninfoCall) Do() (*Tokeninfo, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Tokeninfo{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// Get: Get user info +func (r *UserinfoService) Get() *UserinfoGetCall { + c := &UserinfoGetCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserinfoGetCall) Fields(s ...googleapi.Field) *UserinfoGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserinfoGetCall) IfNoneMatch(entityTag string) *UserinfoGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserinfoGetCall) Context(ctx context.Context) *UserinfoGetCall { + c.ctx_ = ctx + return c +} + +func (c *UserinfoGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "oauth2/v1/userinfo") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "oauth2.userinfo.get" call. +// Exactly one of *Userinfoplus or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Userinfoplus.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserinfoGetCall) Do() (*Userinfoplus, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Userinfoplus{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// Get: Get user info +func (r *UserinfoV2MeService) Get() *UserinfoV2MeGetCall { + c := &UserinfoV2MeGetCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserinfoV2MeGetCall) Fields(s ...googleapi.Field) *UserinfoV2MeGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserinfoV2MeGetCall) IfNoneMatch(entityTag string) *UserinfoV2MeGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserinfoV2MeGetCall) Context(ctx context.Context) *UserinfoV2MeGetCall { + c.ctx_ = ctx + return c +} + +func (c *UserinfoV2MeGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userinfo/v2/me") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "oauth2.userinfo.v2.me.get" call. +// Exactly one of *Userinfoplus or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Userinfoplus.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserinfoV2MeGetCall) Do() (*Userinfoplus, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Userinfoplus{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/Godeps/_workspace/src/google.golang.org/api/oauth2/v2/oauth2-api.json b/Godeps/_workspace/src/google.golang.org/api/oauth2/v2/oauth2-api.json new file mode 100644 index 000000000..1b59fae26 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/oauth2/v2/oauth2-api.json @@ -0,0 +1,294 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/I-Kz7nVLqL3C3aFzaPv8bMiNptU\"", + "discoveryVersion": "v1", + "id": "oauth2:v2", + "name": "oauth2", + "version": "v2", + "revision": "20150319", + "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 your basic profile info" + } + } + } + }, + "schemas": { + "Jwk": { + "id": "Jwk", + "type": "object", + "properties": { + "keys": { + "type": "array", + "items": { + "type": "object", + "properties": { + "alg": { + "type": "string", + "default": "RS256" + }, + "e": { + "type": "string" + }, + "kid": { + "type": "string" + }, + "kty": { + "type": "string", + "default": "RSA" + }, + "n": { + "type": "string" + }, + "use": { + "type": "string", + "default": "sig" + } + } + } + } + } + }, + "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." + }, + "token_handle": { + "type": "string", + "description": "The token handle associated with this token." + }, + "user_id": { + "type": "string", + "description": "The 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 obfuscated 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": { + "getCertForOpenIdConnect": { + "id": "oauth2.getCertForOpenIdConnect", + "path": "oauth2/v2/certs", + "httpMethod": "GET", + "response": { + "$ref": "Jwk" + } + }, + "tokeninfo": { + "id": "oauth2.tokeninfo", + "path": "oauth2/v2/tokeninfo", + "httpMethod": "POST", + "parameters": { + "access_token": { + "type": "string", + "location": "query" + }, + "id_token": { + "type": "string", + "location": "query" + }, + "token_handle": { + "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/Godeps/_workspace/src/google.golang.org/api/oauth2/v2/oauth2-gen.go b/Godeps/_workspace/src/google.golang.org/api/oauth2/v2/oauth2-gen.go new file mode 100644 index 000000000..e9e83dae0 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/oauth2/v2/oauth2-gen.go @@ -0,0 +1,747 @@ +// Package oauth2 provides access to the Google OAuth2 API. +// +// See https://developers.google.com/accounts/docs/OAuth2 +// +// Usage example: +// +// import "google.golang.org/api/oauth2/v2" +// ... +// oauth2Service, err := oauth2.New(oauthHttpClient) +package oauth2 // import "google.golang.org/api/oauth2/v2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 your basic profile info + 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 + UserAgent string // optional additional User-Agent fragment + + Userinfo *UserinfoService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 Jwk struct { + Keys []*JwkKeys `json:"keys,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Keys") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Jwk) MarshalJSON() ([]byte, error) { + type noMethod Jwk + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type JwkKeys struct { + Alg string `json:"alg,omitempty"` + + E string `json:"e,omitempty"` + + Kid string `json:"kid,omitempty"` + + Kty string `json:"kty,omitempty"` + + N string `json:"n,omitempty"` + + Use string `json:"use,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Alg") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *JwkKeys) MarshalJSON() ([]byte, error) { + type noMethod JwkKeys + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Tokeninfo struct { + // AccessType: The access type granted with this token. It can be + // offline or online. + AccessType 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"` + + // ExpiresIn: The expiry time of the token, as number of seconds left + // until expiry. + ExpiresIn int64 `json:"expires_in,omitempty"` + + // IssuedTo: To whom was the token issued to. In general the same as + // audience. + IssuedTo string `json:"issued_to,omitempty"` + + // Scope: The space separated list of scopes granted to this token. + Scope string `json:"scope,omitempty"` + + // TokenHandle: The token handle associated with this token. + TokenHandle string `json:"token_handle,omitempty"` + + // UserId: The obfuscated user id. + UserId string `json:"user_id,omitempty"` + + // VerifiedEmail: Boolean flag which is true if the email address is + // verified. Present only if the email scope is present in the request. + VerifiedEmail bool `json:"verified_email,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccessType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Tokeninfo) MarshalJSON() ([]byte, error) { + type noMethod Tokeninfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Userinfoplus struct { + // Email: The user's email address. + Email string `json:"email,omitempty"` + + // FamilyName: The user's last name. + FamilyName string `json:"family_name,omitempty"` + + // Gender: The user's gender. + Gender string `json:"gender,omitempty"` + + // GivenName: The user's first name. + GivenName 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 obfuscated 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"` + + // VerifiedEmail: 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 + VerifiedEmail *bool `json:"verified_email,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Email") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Userinfoplus) MarshalJSON() ([]byte, error) { + type noMethod Userinfoplus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "oauth2.getCertForOpenIdConnect": + +type GetCertForOpenIdConnectCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetCertForOpenIdConnect: +func (s *Service) GetCertForOpenIdConnect() *GetCertForOpenIdConnectCall { + c := &GetCertForOpenIdConnectCall{s: s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GetCertForOpenIdConnectCall) Fields(s ...googleapi.Field) *GetCertForOpenIdConnectCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GetCertForOpenIdConnectCall) IfNoneMatch(entityTag string) *GetCertForOpenIdConnectCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GetCertForOpenIdConnectCall) Context(ctx context.Context) *GetCertForOpenIdConnectCall { + c.ctx_ = ctx + return c +} + +func (c *GetCertForOpenIdConnectCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "oauth2/v2/certs") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "oauth2.getCertForOpenIdConnect" call. +// Exactly one of *Jwk or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Jwk.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *GetCertForOpenIdConnectCall) Do() (*Jwk, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Jwk{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "GET", + // "id": "oauth2.getCertForOpenIdConnect", + // "path": "oauth2/v2/certs", + // "response": { + // "$ref": "Jwk" + // } + // } + +} + +// method id "oauth2.tokeninfo": + +type TokeninfoCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// Tokeninfo: +func (s *Service) Tokeninfo() *TokeninfoCall { + c := &TokeninfoCall{s: s, opt_: make(map[string]interface{})} + return c +} + +// AccessToken sets the optional parameter "access_token": +func (c *TokeninfoCall) AccessToken(accessToken string) *TokeninfoCall { + c.opt_["access_token"] = accessToken + return c +} + +// IdToken sets the optional parameter "id_token": +func (c *TokeninfoCall) IdToken(idToken string) *TokeninfoCall { + c.opt_["id_token"] = idToken + return c +} + +// TokenHandle sets the optional parameter "token_handle": +func (c *TokeninfoCall) TokenHandle(tokenHandle string) *TokeninfoCall { + c.opt_["token_handle"] = tokenHandle + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TokeninfoCall) Fields(s ...googleapi.Field) *TokeninfoCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TokeninfoCall) Context(ctx context.Context) *TokeninfoCall { + c.ctx_ = ctx + return c +} + +func (c *TokeninfoCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["token_handle"]; ok { + params.Set("token_handle", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "oauth2.tokeninfo" call. +// Exactly one of *Tokeninfo or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Tokeninfo.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TokeninfoCall) Do() (*Tokeninfo, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Tokeninfo{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "httpMethod": "POST", + // "id": "oauth2.tokeninfo", + // "parameters": { + // "access_token": { + // "location": "query", + // "type": "string" + // }, + // "id_token": { + // "location": "query", + // "type": "string" + // }, + // "token_handle": { + // "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{} + ctx_ context.Context +} + +// Get: +func (r *UserinfoService) Get() *UserinfoGetCall { + c := &UserinfoGetCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserinfoGetCall) Fields(s ...googleapi.Field) *UserinfoGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserinfoGetCall) IfNoneMatch(entityTag string) *UserinfoGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserinfoGetCall) Context(ctx context.Context) *UserinfoGetCall { + c.ctx_ = ctx + return c +} + +func (c *UserinfoGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "oauth2/v2/userinfo") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "oauth2.userinfo.get" call. +// Exactly one of *Userinfoplus or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Userinfoplus.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserinfoGetCall) Do() (*Userinfoplus, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Userinfoplus{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "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{} + ctx_ context.Context +} + +// Get: +func (r *UserinfoV2MeService) Get() *UserinfoV2MeGetCall { + c := &UserinfoV2MeGetCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserinfoV2MeGetCall) Fields(s ...googleapi.Field) *UserinfoV2MeGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserinfoV2MeGetCall) IfNoneMatch(entityTag string) *UserinfoV2MeGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserinfoV2MeGetCall) Context(ctx context.Context) *UserinfoV2MeGetCall { + c.ctx_ = ctx + return c +} + +func (c *UserinfoV2MeGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "userinfo/v2/me") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "oauth2.userinfo.v2.me.get" call. +// Exactly one of *Userinfoplus or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Userinfoplus.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UserinfoV2MeGetCall) Do() (*Userinfoplus, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Userinfoplus{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "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/Godeps/_workspace/src/google.golang.org/api/pagespeedonline/v1/pagespeedonline-api.json b/Godeps/_workspace/src/google.golang.org/api/pagespeedonline/v1/pagespeedonline-api.json new file mode 100644 index 000000000..c7b0153a1 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/pagespeedonline/v1/pagespeedonline-api.json @@ -0,0 +1,415 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/53c1pDum-m_4xRbboeMr9HDsJSk\"", + "discoveryVersion": "v1", + "id": "pagespeedonline:v1", + "name": "pagespeedonline", + "version": "v1", + "revision": "20150317", + "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": "https://www.google.com/images/icons/product/pagespeed-16.png", + "x32": "https://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 PageSpeed results. Contains a ruleResults entry for each PageSpeed 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 PageSpeed 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 PageSpeed 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 PageSpeed used to generate these results.", + "properties": { + "major": { + "type": "integer", + "description": "The major version number of PageSpeed used to generate these results.", + "format": "int32" + }, + "minor": { + "type": "integer", + "description": "The minor version number of PageSpeed used to generate these results.", + "format": "int32" + } + } + } + } + } + }, + "resources": { + "pagespeedapi": { + "methods": { + "runpagespeed": { + "id": "pagespeedonline.pagespeedapi.runpagespeed", + "path": "runPagespeed", + "httpMethod": "GET", + "description": "Runs PageSpeed analysis on the page at the specified URL, and returns a PageSpeed 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 PageSpeed 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" + }, + "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/Godeps/_workspace/src/google.golang.org/api/pagespeedonline/v1/pagespeedonline-gen.go b/Godeps/_workspace/src/google.golang.org/api/pagespeedonline/v1/pagespeedonline-gen.go new file mode 100644 index 000000000..b5181d0ba --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/pagespeedonline/v1/pagespeedonline-gen.go @@ -0,0 +1,509 @@ +// Package pagespeedonline provides access to the PageSpeed Insights API. +// +// See https://developers.google.com/speed/docs/insights/v1/getting_started +// +// Usage example: +// +// import "google.golang.org/api/pagespeedonline/v1" +// ... +// pagespeedonlineService, err := pagespeedonline.New(oauthHttpClient) +package pagespeedonline // import "google.golang.org/api/pagespeedonline/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Pagespeedapi *PagespeedapiService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewPagespeedapiService(s *Service) *PagespeedapiService { + rs := &PagespeedapiService{s: s} + return rs +} + +type PagespeedapiService struct { + s *Service +} + +type Result struct { + // FormattedResults: Localized PageSpeed results. Contains a ruleResults + // entry for each PageSpeed 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 PageSpeed 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 PageSpeed used to generate these results. + Version *ResultVersion `json:"version,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "FormattedResults") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Result) MarshalJSON() ([]byte, error) { + type noMethod Result + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ResultFormattedResults: Localized PageSpeed results. Contains a +// ruleResults entry for each PageSpeed rule instantiated and run by the +// server. +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 PageSpeed rule instantiated and run by the server. + RuleResults *ResultFormattedResultsRuleResults `json:"ruleResults,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Locale") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResultFormattedResults) MarshalJSON() ([]byte, error) { + type noMethod ResultFormattedResults + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ResultFormattedResultsRuleResults: Dictionary of formatted rule +// results, with one entry for each PageSpeed rule instantiated and run +// by the server. +type ResultFormattedResultsRuleResults struct { +} + +// ResultPageStats: Summary statistics for the page, such as number of +// JavaScript bytes, number of HTML bytes, etc. +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"` + + // ForceSendFields is a list of field names (e.g. "CssResponseBytes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResultPageStats) MarshalJSON() ([]byte, error) { + type noMethod ResultPageStats + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ResultScreenshot: Base64-encoded screenshot of the page that was +// analyzed. +type ResultScreenshot struct { + // Data: Image data base64 encoded. + Data string `json:"data,omitempty"` + + // Height: Height of screenshot in pixels. + Height int64 `json:"height,omitempty"` + + // MimeType: Mime type of image data. E.g. "image/jpeg". + MimeType string `json:"mime_type,omitempty"` + + // Width: Width of screenshot in pixels. + Width int64 `json:"width,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Data") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResultScreenshot) MarshalJSON() ([]byte, error) { + type noMethod ResultScreenshot + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ResultVersion: The version of PageSpeed used to generate these +// results. +type ResultVersion struct { + // Major: The major version number of PageSpeed used to generate these + // results. + Major int64 `json:"major,omitempty"` + + // Minor: The minor version number of PageSpeed used to generate these + // results. + Minor int64 `json:"minor,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Major") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResultVersion) MarshalJSON() ([]byte, error) { + type noMethod ResultVersion + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "pagespeedonline.pagespeedapi.runpagespeed": + +type PagespeedapiRunpagespeedCall struct { + s *Service + url string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Runpagespeed: Runs PageSpeed analysis on the page at the specified +// URL, and returns a PageSpeed 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 +} + +// FilterThirdPartyResources sets the optional parameter +// "filter_third_party_resources": Indicates if third party resources +// should be filtered out before PageSpeed analysis. +func (c *PagespeedapiRunpagespeedCall) FilterThirdPartyResources(filterThirdPartyResources bool) *PagespeedapiRunpagespeedCall { + c.opt_["filter_third_party_resources"] = filterThirdPartyResources + 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 PageSpeed 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 +} + +// Strategy sets the optional parameter "strategy": The analysis +// strategy to use +// +// Possible values: +// "desktop" - Fetch and analyze the URL for desktop browsers +// "mobile" - Fetch and analyze the URL for mobile devices +func (c *PagespeedapiRunpagespeedCall) Strategy(strategy string) *PagespeedapiRunpagespeedCall { + c.opt_["strategy"] = strategy + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PagespeedapiRunpagespeedCall) Fields(s ...googleapi.Field) *PagespeedapiRunpagespeedCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PagespeedapiRunpagespeedCall) IfNoneMatch(entityTag string) *PagespeedapiRunpagespeedCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PagespeedapiRunpagespeedCall) Context(ctx context.Context) *PagespeedapiRunpagespeedCall { + c.ctx_ = ctx + return c +} + +func (c *PagespeedapiRunpagespeedCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["strategy"]; ok { + params.Set("strategy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pagespeedonline.pagespeedapi.runpagespeed" call. +// Exactly one of *Result or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Result.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *PagespeedapiRunpagespeedCall) Do() (*Result, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Result{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Runs PageSpeed analysis on the page at the specified URL, and returns a PageSpeed 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 PageSpeed 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" + // }, + // "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/Godeps/_workspace/src/google.golang.org/api/pagespeedonline/v2/pagespeedonline-api.json b/Godeps/_workspace/src/google.golang.org/api/pagespeedonline/v2/pagespeedonline-api.json new file mode 100644 index 000000000..8cf13f05b --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/pagespeedonline/v2/pagespeedonline-api.json @@ -0,0 +1,490 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/jQUdXXqYUml2RtPh0PKouCPciII\"", + "discoveryVersion": "v1", + "id": "pagespeedonline:v2", + "name": "pagespeedonline", + "version": "v2", + "revision": "20150317", + "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": "https://www.google.com/images/icons/product/pagespeed-16.png", + "x32": "https://www.google.com/images/icons/product/pagespeed-32.png" + }, + "documentationLink": "https://developers.google.com/speed/docs/insights/v2/getting-started", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/pagespeedonline/v2/", + "basePath": "/pagespeedonline/v2/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "pagespeedonline/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" + } + }, + "schemas": { + "PagespeedApiFormatStringV2": { + "id": "PagespeedApiFormatStringV2", + "type": "object", + "properties": { + "args": { + "type": "array", + "description": "List of arguments for the format string.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "The placeholder key for this arg, as a string." + }, + "rects": { + "type": "array", + "description": "The screen rectangles being referred to, with dimensions measured in CSS pixels. This is only ever used for SNAPSHOT_RECT arguments. If this is absent for a SNAPSHOT_RECT argument, it means that that argument refers to the entire snapshot.", + "items": { + "type": "object", + "properties": { + "height": { + "type": "integer", + "description": "The height of the rect.", + "format": "int32" + }, + "left": { + "type": "integer", + "description": "The left coordinate of the rect, in page coordinates.", + "format": "int32" + }, + "top": { + "type": "integer", + "description": "The top coordinate of the rect, in page coordinates.", + "format": "int32" + }, + "width": { + "type": "integer", + "description": "The width of the rect.", + "format": "int32" + } + } + } + }, + "secondary_rects": { + "type": "array", + "description": "Secondary screen rectangles being referred to, with dimensions measured in CSS pixels. This is only ever used for SNAPSHOT_RECT arguments.", + "items": { + "type": "object", + "properties": { + "height": { + "type": "integer", + "description": "The height of the rect.", + "format": "int32" + }, + "left": { + "type": "integer", + "description": "The left coordinate of the rect, in page coordinates.", + "format": "int32" + }, + "top": { + "type": "integer", + "description": "The top coordinate of the rect, in page coordinates.", + "format": "int32" + }, + "width": { + "type": "integer", + "description": "The width of the rect.", + "format": "int32" + } + } + } + }, + "type": { + "type": "string", + "description": "Type of argument. One of URL, STRING_LITERAL, INT_LITERAL, BYTES, DURATION, VERBATIM_STRING, PERCENTAGE, HYPERLINK, or SNAPSHOT_RECT." + }, + "value": { + "type": "string", + "description": "Argument value, as a localized string." + } + } + } + }, + "format": { + "type": "string", + "description": "A localized format string with {{FOO}} placeholders, where 'FOO' is the key of the argument whose value should be substituted. For HYPERLINK arguments, the format string will instead contain {{BEGIN_FOO}} and {{END_FOO}} for the argument with key 'FOO'." + } + } + }, + "PagespeedApiImageV2": { + "id": "PagespeedApiImageV2", + "type": "object", + "properties": { + "data": { + "type": "string", + "description": "Image data base64 encoded.", + "format": "byte" + }, + "height": { + "type": "integer", + "description": "Height of screenshot in pixels.", + "format": "int32" + }, + "key": { + "type": "string", + "description": "Unique string key, if any, identifying this image." + }, + "mime_type": { + "type": "string", + "description": "Mime type of image data (e.g. \"image/jpeg\")." + }, + "page_rect": { + "type": "object", + "description": "The region of the page that is captured by this image, with dimensions measured in CSS pixels.", + "properties": { + "height": { + "type": "integer", + "description": "The height of the rect.", + "format": "int32" + }, + "left": { + "type": "integer", + "description": "The left coordinate of the rect, in page coordinates.", + "format": "int32" + }, + "top": { + "type": "integer", + "description": "The top coordinate of the rect, in page coordinates.", + "format": "int32" + }, + "width": { + "type": "integer", + "description": "The width of the rect.", + "format": "int32" + } + } + }, + "width": { + "type": "integer", + "description": "Width of screenshot in pixels.", + "format": "int32" + } + } + }, + "Result": { + "id": "Result", + "type": "object", + "properties": { + "formattedResults": { + "type": "object", + "description": "Localized PageSpeed results. Contains a ruleResults entry for each PageSpeed 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 PageSpeed 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": { + "groups": { + "type": "array", + "description": "List of rule groups that this rule belongs to. Each entry in the list is one of \"SPEED\" or \"USABILITY\".", + "items": { + "type": "string" + } + }, + "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" + }, + "summary": { + "$ref": "PagespeedApiFormatStringV2", + "description": "A brief summary description for the rule, indicating at a high level what should be done to follow the rule and what benefit can be gained by doing so." + }, + "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": { + "$ref": "PagespeedApiFormatStringV2", + "description": "Heading to be displayed with the list of URLs." + }, + "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": { + "$ref": "PagespeedApiFormatStringV2" + } + }, + "result": { + "$ref": "PagespeedApiFormatStringV2", + "description": "A format string that gives information about the URL, and a list of arguments for that format string." + } + } + } + } + } + } + } + } + } + } + } + }, + "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" + }, + "ruleGroups": { + "type": "object", + "description": "A map with one entry for each rule group in these results.", + "additionalProperties": { + "type": "object", + "description": "The name of this rule group: one of \"SPEED\" or \"USABILITY\".", + "properties": { + "score": { + "type": "integer", + "description": "The score (0-100) for this rule group, which indicates how much better a page could be in that category (e.g. how much faster, or how much more usable). A high score indicates little room for improvement, while a lower score indicates more room for improvement.", + "format": "int32" + } + } + } + }, + "screenshot": { + "$ref": "PagespeedApiImageV2", + "description": "Base64-encoded screenshot of the page that was analyzed." + }, + "title": { + "type": "string", + "description": "Title of the page, as displayed in the browser's title bar." + }, + "version": { + "type": "object", + "description": "The version of PageSpeed used to generate these results.", + "properties": { + "major": { + "type": "integer", + "description": "The major version number of PageSpeed used to generate these results.", + "format": "int32" + }, + "minor": { + "type": "integer", + "description": "The minor version number of PageSpeed used to generate these results.", + "format": "int32" + } + } + } + } + } + }, + "resources": { + "pagespeedapi": { + "methods": { + "runpagespeed": { + "id": "pagespeedonline.pagespeedapi.runpagespeed", + "path": "runPagespeed", + "httpMethod": "GET", + "description": "Runs PageSpeed analysis on the page at the specified URL, and returns PageSpeed scores, 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 PageSpeed 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" + }, + "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/Godeps/_workspace/src/google.golang.org/api/pagespeedonline/v2/pagespeedonline-gen.go b/Godeps/_workspace/src/google.golang.org/api/pagespeedonline/v2/pagespeedonline-gen.go new file mode 100644 index 000000000..f498f72b5 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/pagespeedonline/v2/pagespeedonline-gen.go @@ -0,0 +1,667 @@ +// Package pagespeedonline provides access to the PageSpeed Insights API. +// +// See https://developers.google.com/speed/docs/insights/v2/getting-started +// +// Usage example: +// +// import "google.golang.org/api/pagespeedonline/v2" +// ... +// pagespeedonlineService, err := pagespeedonline.New(oauthHttpClient) +package pagespeedonline // import "google.golang.org/api/pagespeedonline/v2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "pagespeedonline:v2" +const apiName = "pagespeedonline" +const apiVersion = "v2" +const basePath = "https://www.googleapis.com/pagespeedonline/v2/" + +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 + UserAgent string // optional additional User-Agent fragment + + Pagespeedapi *PagespeedapiService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewPagespeedapiService(s *Service) *PagespeedapiService { + rs := &PagespeedapiService{s: s} + return rs +} + +type PagespeedapiService struct { + s *Service +} + +type PagespeedApiFormatStringV2 struct { + // Args: List of arguments for the format string. + Args []*PagespeedApiFormatStringV2Args `json:"args,omitempty"` + + // Format: A localized format string with {{FOO}} placeholders, where + // 'FOO' is the key of the argument whose value should be substituted. + // For HYPERLINK arguments, the format string will instead contain + // {{BEGIN_FOO}} and {{END_FOO}} for the argument with key 'FOO'. + Format string `json:"format,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Args") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PagespeedApiFormatStringV2) MarshalJSON() ([]byte, error) { + type noMethod PagespeedApiFormatStringV2 + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PagespeedApiFormatStringV2Args struct { + // Key: The placeholder key for this arg, as a string. + Key string `json:"key,omitempty"` + + // Rects: The screen rectangles being referred to, with dimensions + // measured in CSS pixels. This is only ever used for SNAPSHOT_RECT + // arguments. If this is absent for a SNAPSHOT_RECT argument, it means + // that that argument refers to the entire snapshot. + Rects []*PagespeedApiFormatStringV2ArgsRects `json:"rects,omitempty"` + + // SecondaryRects: Secondary screen rectangles being referred to, with + // dimensions measured in CSS pixels. This is only ever used for + // SNAPSHOT_RECT arguments. + SecondaryRects []*PagespeedApiFormatStringV2ArgsSecondaryRects `json:"secondary_rects,omitempty"` + + // Type: Type of argument. One of URL, STRING_LITERAL, INT_LITERAL, + // BYTES, DURATION, VERBATIM_STRING, PERCENTAGE, HYPERLINK, or + // SNAPSHOT_RECT. + Type string `json:"type,omitempty"` + + // Value: Argument value, as a localized string. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PagespeedApiFormatStringV2Args) MarshalJSON() ([]byte, error) { + type noMethod PagespeedApiFormatStringV2Args + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PagespeedApiFormatStringV2ArgsRects struct { + // Height: The height of the rect. + Height int64 `json:"height,omitempty"` + + // Left: The left coordinate of the rect, in page coordinates. + Left int64 `json:"left,omitempty"` + + // Top: The top coordinate of the rect, in page coordinates. + Top int64 `json:"top,omitempty"` + + // Width: The width of the rect. + Width int64 `json:"width,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PagespeedApiFormatStringV2ArgsRects) MarshalJSON() ([]byte, error) { + type noMethod PagespeedApiFormatStringV2ArgsRects + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PagespeedApiFormatStringV2ArgsSecondaryRects struct { + // Height: The height of the rect. + Height int64 `json:"height,omitempty"` + + // Left: The left coordinate of the rect, in page coordinates. + Left int64 `json:"left,omitempty"` + + // Top: The top coordinate of the rect, in page coordinates. + Top int64 `json:"top,omitempty"` + + // Width: The width of the rect. + Width int64 `json:"width,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PagespeedApiFormatStringV2ArgsSecondaryRects) MarshalJSON() ([]byte, error) { + type noMethod PagespeedApiFormatStringV2ArgsSecondaryRects + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PagespeedApiImageV2 struct { + // Data: Image data base64 encoded. + Data string `json:"data,omitempty"` + + // Height: Height of screenshot in pixels. + Height int64 `json:"height,omitempty"` + + // Key: Unique string key, if any, identifying this image. + Key string `json:"key,omitempty"` + + // MimeType: Mime type of image data (e.g. "image/jpeg"). + MimeType string `json:"mime_type,omitempty"` + + // PageRect: The region of the page that is captured by this image, with + // dimensions measured in CSS pixels. + PageRect *PagespeedApiImageV2PageRect `json:"page_rect,omitempty"` + + // Width: Width of screenshot in pixels. + Width int64 `json:"width,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Data") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PagespeedApiImageV2) MarshalJSON() ([]byte, error) { + type noMethod PagespeedApiImageV2 + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PagespeedApiImageV2PageRect: The region of the page that is captured +// by this image, with dimensions measured in CSS pixels. +type PagespeedApiImageV2PageRect struct { + // Height: The height of the rect. + Height int64 `json:"height,omitempty"` + + // Left: The left coordinate of the rect, in page coordinates. + Left int64 `json:"left,omitempty"` + + // Top: The top coordinate of the rect, in page coordinates. + Top int64 `json:"top,omitempty"` + + // Width: The width of the rect. + Width int64 `json:"width,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PagespeedApiImageV2PageRect) MarshalJSON() ([]byte, error) { + type noMethod PagespeedApiImageV2PageRect + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Result struct { + // FormattedResults: Localized PageSpeed results. Contains a ruleResults + // entry for each PageSpeed 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"` + + // RuleGroups: A map with one entry for each rule group in these + // results. + RuleGroups *ResultRuleGroups `json:"ruleGroups,omitempty"` + + // Screenshot: Base64-encoded screenshot of the page that was analyzed. + Screenshot *PagespeedApiImageV2 `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 PageSpeed used to generate these results. + Version *ResultVersion `json:"version,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "FormattedResults") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Result) MarshalJSON() ([]byte, error) { + type noMethod Result + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ResultFormattedResults: Localized PageSpeed results. Contains a +// ruleResults entry for each PageSpeed rule instantiated and run by the +// server. +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 PageSpeed rule instantiated and run by the server. + RuleResults *ResultFormattedResultsRuleResults `json:"ruleResults,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Locale") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResultFormattedResults) MarshalJSON() ([]byte, error) { + type noMethod ResultFormattedResults + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ResultFormattedResultsRuleResults: Dictionary of formatted rule +// results, with one entry for each PageSpeed rule instantiated and run +// by the server. +type ResultFormattedResultsRuleResults struct { +} + +// ResultPageStats: Summary statistics for the page, such as number of +// JavaScript bytes, number of HTML bytes, etc. +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"` + + // ForceSendFields is a list of field names (e.g. "CssResponseBytes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResultPageStats) MarshalJSON() ([]byte, error) { + type noMethod ResultPageStats + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ResultRuleGroups: A map with one entry for each rule group in these +// results. +type ResultRuleGroups struct { +} + +// ResultVersion: The version of PageSpeed used to generate these +// results. +type ResultVersion struct { + // Major: The major version number of PageSpeed used to generate these + // results. + Major int64 `json:"major,omitempty"` + + // Minor: The minor version number of PageSpeed used to generate these + // results. + Minor int64 `json:"minor,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Major") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResultVersion) MarshalJSON() ([]byte, error) { + type noMethod ResultVersion + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "pagespeedonline.pagespeedapi.runpagespeed": + +type PagespeedapiRunpagespeedCall struct { + s *Service + url string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Runpagespeed: Runs PageSpeed analysis on the page at the specified +// URL, and returns PageSpeed scores, 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 +} + +// FilterThirdPartyResources sets the optional parameter +// "filter_third_party_resources": Indicates if third party resources +// should be filtered out before PageSpeed analysis. +func (c *PagespeedapiRunpagespeedCall) FilterThirdPartyResources(filterThirdPartyResources bool) *PagespeedapiRunpagespeedCall { + c.opt_["filter_third_party_resources"] = filterThirdPartyResources + 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 PageSpeed 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 +} + +// Strategy sets the optional parameter "strategy": The analysis +// strategy to use +// +// Possible values: +// "desktop" - Fetch and analyze the URL for desktop browsers +// "mobile" - Fetch and analyze the URL for mobile devices +func (c *PagespeedapiRunpagespeedCall) Strategy(strategy string) *PagespeedapiRunpagespeedCall { + c.opt_["strategy"] = strategy + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PagespeedapiRunpagespeedCall) Fields(s ...googleapi.Field) *PagespeedapiRunpagespeedCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PagespeedapiRunpagespeedCall) IfNoneMatch(entityTag string) *PagespeedapiRunpagespeedCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PagespeedapiRunpagespeedCall) Context(ctx context.Context) *PagespeedapiRunpagespeedCall { + c.ctx_ = ctx + return c +} + +func (c *PagespeedapiRunpagespeedCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["strategy"]; ok { + params.Set("strategy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pagespeedonline.pagespeedapi.runpagespeed" call. +// Exactly one of *Result or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Result.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *PagespeedapiRunpagespeedCall) Do() (*Result, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Result{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Runs PageSpeed analysis on the page at the specified URL, and returns PageSpeed scores, 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 PageSpeed 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" + // }, + // "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/Godeps/_workspace/src/google.golang.org/api/partners/v2/partners-api.json b/Godeps/_workspace/src/google.golang.org/api/partners/v2/partners-api.json new file mode 100644 index 000000000..21c3ca6ae --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/partners/v2/partners-api.json @@ -0,0 +1,1378 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/Z1ZjKJtkBj9ZEYgBJhjBFfjbM3I\"", + "discoveryVersion": "v1", + "id": "partners:v2", + "name": "partners", + "version": "v2", + "revision": "20150915", + "title": "Google Partners API", + "description": "Lets advertisers search certified companies and create contact leads with them, and also audits the usage of clients.", + "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/partners/", + "protocol": "rest", + "baseUrl": "https://partners.googleapis.com/", + "basePath": "/", + "rootUrl": "https://partners.googleapis.com/", + "servicePath": "", + "batchPath": "batch", + "parameters": { + "access_token": { + "type": "string", + "description": "OAuth access token.", + "location": "query" + }, + "alt": { + "type": "string", + "description": "Data format for response.", + "default": "json", + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query" + }, + "bearer_token": { + "type": "string", + "description": "OAuth bearer token.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JSONP", + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "pp": { + "type": "boolean", + "description": "Pretty-print response.", + "default": "true", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query" + }, + "upload_protocol": { + "type": "string", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query" + }, + "uploadType": { + "type": "string", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query" + }, + "$.xgafv": { + "type": "string", + "description": "V1 error format.", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" + } + }, + "schemas": { + "LogUserEventRequest": { + "id": "LogUserEventRequest", + "type": "object", + "description": "Request message for LogUserEvent.", + "properties": { + "requestMetadata": { + "$ref": "RequestMetadata", + "description": "Current request metadata." + }, + "eventAction": { + "type": "string", + "description": "The action that occurred.", + "enum": [ + "EVENT_ACTION_UNSPECIFIED", + "SMB_CLICKED_FIND_A_PARTNER_BUTTON_BOTTOM", + "SMB_CLICKED_FIND_A_PARTNER_BUTTON_TOP", + "AGENCY_CLICKED_JOIN_NOW_BUTTON_BOTTOM", + "AGENCY_CLICKED_JOIN_NOW_BUTTON_TOP", + "SMB_CANCELED_PARTNER_CONTACT_FORM", + "SMB_CLICKED_CONTACT_A_PARTNER", + "SMB_COMPLETED_PARTNER_CONTACT_FORM", + "SMB_ENTERED_EMAIL_IN_CONTACT_PARTNER_FORM", + "SMB_ENTERED_NAME_IN_CONTACT_PARTNER_FORM", + "SMB_ENTERED_PHONE_IN_CONTACT_PARTNER_FORM", + "SMB_FAILED_RECAPTCHA_IN_CONTACT_PARTNER_FORM", + "PARTNER_VIEWED_BY_SMB", + "SMB_CANCELED_PARTNER_CONTACT_FORM_ON_GPS", + "SMB_CHANGED_A_SEARCH_PARAMETER_TOP", + "SMB_CLICKED_CONTACT_A_PARTNER_ON_GPS", + "SMB_CLICKED_SHOW_MORE_PARTNERS_BUTTON_BOTTOM", + "SMB_COMPLETED_PARTNER_CONTACT_FORM_ON_GPS", + "SMB_NO_PARTNERS_AVAILABLE_WITH_SEARCH_CRITERIA", + "SMB_PERFORMED_SEARCH_ON_GPS", + "SMB_VIEWED_A_PARTNER_ON_GPS", + "SMB_CANCELED_PARTNER_CONTACT_FORM_ON_PROFILE_PAGE", + "SMB_CLICKED_CONTACT_A_PARTNER_ON_PROFILE_PAGE", + "SMB_CLICKED_PARTNER_WEBSITE", + "SMB_COMPLETED_PARTNER_CONTACT_FORM_ON_PROFILE_PAGE", + "SMB_VIEWED_A_PARTNER_PROFILE", + "AGENCY_CLICKED_ACCEPT_TOS_BUTTON", + "AGENCY_CHANGED_TOS_COUNTRY", + "AGENCY_ADDED_ADDRESS_IN_MY_PROFILE_PORTAL", + "AGENCY_ADDED_PHONE_NUMBER_IN_MY_PROFILE_PORTAL", + "AGENCY_CHANGED_PRIMARY_ACCOUNT_ASSOCIATION", + "AGENCY_CHANGED_PRIMARY_COUNTRY_ASSOCIATION", + "AGENCY_CLICKED_AFFILIATE_BUTTON_IN_MY_PROFILE_IN_PORTAL", + "AGENCY_CLICKED_GIVE_EDIT_ACCESS_IN_MY_PROFILE_PORTAL", + "AGENCY_CLICKED_LOG_OUT_IN_MY_PROFILE_PORTAL", + "AGENCY_CLICKED_MY_PROFILE_LEFT_NAV_IN_PORTAL", + "AGENCY_CLICKED_SAVE_AND_CONTINUE_AT_BOT_OF_COMPLETE_PROFILE", + "AGENCY_CLICKED_UNAFFILIATE_IN_MY_PROFILE_PORTAL", + "AGENCY_FILLED_OUT_COMP_AFFILIATION_IN_MY_PROFILE_PORTAL", + "AGENCY_SUCCESSFULLY_CONNECTED_WITH_COMPANY_IN_MY_PROFILE", + "AGENCY_CLICKED_CREATE_MCC_IN_MY_PROFILE_PORTAL", + "AGENCY_DIDNT_HAVE_AN_MCC_ASSOCIATED_ON_COMPLETE_PROFILE", + "AGENCY_HAD_AN_MCC_ASSOCIATED_ON_COMPLETE_PROFILE", + "AGENCY_ADDED_JOB_FUNCTION_IN_MY_PROFILE_PORTAL", + "AGENCY_LOOKED_AT_JOB_FUNCTION_DROP_DOWN", + "AGENCY_SELECTED_ACCOUNT_MANAGER_AS_JOB_FUNCTION", + "AGENCY_SELECTED_ACCOUNT_PLANNER_AS_JOB_FUNCTION", + "AGENCY_SELECTED_ANALYTICS_AS_JOB_FUNCTION", + "AGENCY_SELECTED_CREATIVE_AS_JOB_FUNCTION", + "AGENCY_SELECTED_MEDIA_BUYER_AS_JOB_FUNCTION", + "AGENCY_SELECTED_MEDIA_PLANNER_AS_JOB_FUNCTION", + "AGENCY_SELECTED_OTHER_AS_JOB_FUNCTION", + "AGENCY_SELECTED_PRODUCTION_AS_JOB_FUNCTION", + "AGENCY_SELECTED_SEO_AS_JOB_FUNCTION", + "AGENCY_SELECTED_SALES_REP_AS_JOB_FUNCTION", + "AGENCY_SELECTED_SEARCH_SPECIALIST_AS_JOB_FUNCTION", + "AGENCY_ADDED_CHANNELS_IN_MY_PROFILE_PORTAL", + "AGENCY_LOOKED_AT_ADD_CHANNEL_DROP_DOWN", + "AGENCY_SELECTED_CROSS_CHANNEL_FROM_ADD_CHANNEL", + "AGENCY_SELECTED_DISPLAY_FROM_ADD_CHANNEL", + "AGENCY_SELECTED_MOBILE_FROM_ADD_CHANNEL", + "AGENCY_SELECTED_SEARCH_FROM_ADD_CHANNEL", + "AGENCY_SELECTED_SOCIAL_FROM_ADD_CHANNEL", + "AGENCY_SELECTED_TOOLS_FROM_ADD_CHANNEL", + "AGENCY_SELECTED_YOUTUBE_FROM_ADD_CHANNEL", + "AGENCY_ADDED_INDUSTRIES_IN_MY_PROFILE_PORTAL", + "AGENCY_CHANGED_ADD_INDUSTRIES_DROP_DOWN", + "AGENCY_ADDED_MARKETS_IN_MY_PROFILE_PORTAL", + "AGENCY_CHANGED_ADD_MARKETS_DROP_DOWN", + "AGENCY_CHECKED_RECIEVE_MAIL_PROMOTIONS_MYPROFILE", + "AGENCY_CHECKED_RECIEVE_MAIL_PROMOTIONS_SIGNUP", + "AGENCY_SELECTED_OPT_IN_BETA_TESTS_AND_MKT_RESEARCH", + "AGENCY_SELECTED_OPT_IN_BETA_TESTS_IN_MY_PROFILE_PORTAL", + "AGENCY_SELECTED_OPT_IN_NEWS_IN_MY_PROFILE_PORTAL", + "AGENCY_SELECTED_OPT_IN_NEWS_INVITATIONS_AND_PROMOS", + "AGENCY_SELECTED_OPT_IN_PERFORMANCE_SUG_IN_MY_PROFILE_PORTAL", + "AGENCY_SELECTED_OPT_IN_PERFORMANCE_SUGGESTIONS", + "AGENCY_SELECTED_OPT_IN_SELECT_ALL_EMAIL_NOTIFICATIONS", + "AGENCY_SELECTED_SELECT_ALL_OPT_INS_IN_MY_PROFILE_PORTAL", + "AGENCY_CLICKED_BACK_BUTTON_ON_CONNECT_WITH_COMPANY", + "AGENCY_CLICKED_CONTINUE_TO_OVERVIEW_ON_CONNECT_WITH_COMPANY", + "AGECNY_CLICKED_CREATE_MCC_CONNECT_WITH_COMPANY_NOT_FOUND", + "AGECNY_CLICKED_GIVE_EDIT_ACCESS_CONNECT_WITH_COMPANY_NOT_FOUND", + "AGECNY_CLICKED_LOG_OUT_CONNECT_WITH_COMPANY_NOT_FOUND", + "AGENCY_CLICKED_SKIP_FOR_NOW_ON_CONNECT_WITH_COMPANY_PAGE", + "AGENCY_CLOSED_CONNECTED_TO_COMPANY_X_BUTTON_WRONG_COMPANY", + "AGENCY_COMPLETED_FIELD_CONNECT_WITH_COMPANY", + "AGECNY_FOUND_COMPANY_TO_CONNECT_WITH", + "AGENCY_SUCCESSFULLY_CREATED_COMPANY", + "AGENCY_ADDED_NEW_COMPANY_LOCATION", + "AGENCY_CLICKED_COMMUNITY_JOIN_NOW_LINK_IN_PORTAL_NOTIFICATIONS", + "AGENCY_CLICKED_CONNECT_TO_COMPANY_LINK_IN_PORTAL_NOTIFICATIONS", + "AGENCY_CLICKED_GET_CERTIFIED_LINK_IN_PORTAL_NOTIFICATIONS", + "AGENCY_CLICKED_GET_VIDEO_ADS_CERTIFIED_LINK_IN_PORTAL_NOTIFICATIONS", + "AGENCY_CLICKED_LINK_TO_MCC_LINK_IN_PORTAL_NOTIFICATIONS", + "AGENCY_CLICKED_INSIGHT_CONTENT_IN_PORTAL", + "AGENCY_CLICKED_INSIGHTS_VIEW_NOW_PITCH_DECKS_IN_PORTAL", + "AGENCY_CLICKED_INSIGHTS_LEFT_NAV_IN_PORTAL", + "AGENCY_CLICKED_INSIGHTS_UPLOAD_CONTENT", + "AGENCY_CLICKED_INSIGHTS_VIEWED_DEPRECATED", + "AGENCY_CLICKED_COMMUNITY_LEFT_NAV_IN_PORTAL", + "AGENCY_CLICKED_JOIN_COMMUNITY_BUTTON_COMMUNITY_PORTAL", + "AGENCY_CLICKED_CERTIFICATIONS_LEFT_NAV_IN_PORTAL", + "AGENCY_CLICKED_CERTIFICATIONS_PRODUCT_LEFT_NAV_IN_PORTAL", + "AGENCY_CLICKED_PARTNER_STATUS_LEFT_NAV_IN_PORTAL", + "AGENCY_CLICKED_PARTNER_STATUS_PRODUCT_LEFT_NAV_IN_PORTAL", + "AGENCY_CLICKED_OFFERS_LEFT_NAV_IN_PORTAL", + "AGENCY_CLICKED_SEND_BUTTON_ON_OFFERS_PAGE", + "AGENCY_CLICKED_EXAM_DETAILS_ON_CERT_ADWORDS_PAGE", + "AGENCY_CLICKED_SEE_EXAMS_CERTIFICATION_MAIN_PAGE", + "AGENCY_CLICKED_TAKE_EXAM_ON_CERT_EXAM_PAGE", + "AGENCY_OPENED_LAST_ADMIN_DIALOG", + "AGENCY_OPENED_DIALOG_WITH_NO_USERS", + "AGENCY_PROMOTED_USER_TO_ADMIN", + "AGENCY_UNAFFILIATED", + "AGENCY_CHANGED_ROLES", + "SMB_CLICKED_COMPANY_NAME_LINK_TO_PROFILE", + "SMB_VIEWED_ADWORDS_CERTIFICATE", + "SMB_CLICKED_ADWORDS_CERTIFICATE_HELP_ICON", + "SMB_VIEWED_ANALYTICS_CERTIFICATE", + "SMB_VIEWED_DOUBLECLICK_CERTIFICATE", + "SMB_VIEWED_VIDEO_ADS_CERTIFICATE", + "SMB_VIEWED_SHOPPING_CERTIFICATE", + "SMB_CLICKED_VIDEO_ADS_CERTIFICATE_HELP_ICON", + "CLICKED_HELP_AT_BOTTOM", + "CLICKED_HELP_AT_TOP", + "CLIENT_ERROR", + "AGENCY_CLICKED_LEFT_NAV_STORIES", + "CLICKED", + "SMB_VIEWED_MOBILE_CERTIFICATE", + "AGENCY_FAILED_COMPANY_VERIFICATION", + "VISITED_LANDING", + "VISITED_GPS", + "VISITED_AGENCY_PORTAL", + "CANCELLED_INDIVIDUAL_SIGN_UP", + "CANCELLED_COMPANY_SIGN_UP", + "AGENCY_CLICKED_SIGN_IN_BUTTON_TOP", + "AGENCY_CLICKED_SAVE_AND_CONTINUE_AT_BOT_OF_INCOMPLETE_PROFILE", + "AGENCY_UNSELECTED_OPT_IN_NEWS_INVITATIONS_AND_PROMOS", + "AGENCY_UNSELECTED_OPT_IN_BETA_TESTS_AND_MKT_RESEARCH", + "AGENCY_UNSELECTED_OPT_IN_PERFORMANCE_SUGGESTIONS", + "AGENCY_SELECTED_OPT_OUT_UNSELECT_ALL_EMAIL_NOTIFICATIONS", + "AGENCY_LINKED_INDIVIDUAL_MCC", + "AGENCY_SUGGESTED_TO_USER", + "AGENCY_IGNORED_SUGGESTED_AGENCIES_AND_SEARCHED", + "AGENCY_PICKED_SUGGESTED_AGENCY", + "AGENCY_SEARCHED_FOR_AGENCIES", + "AGENCY_PICKED_SEARCHED_AGENCY", + "AGENCY_DISMISSED_AFFILIATION_WIDGET", + "AGENCY_CLICKED_INSIGHTS_DOWNLOAD_CONTENT", + "AGENCY_PROGRESS_INSIGHTS_VIEW_CONTENT", + "AGENCY_CLICKED_CANCEL_ACCEPT_TOS_BUTTON", + "SMB_ENTERED_WEBSITE_IN_CONTACT_PARTNER_FORM" + ] + }, + "eventCategory": { + "type": "string", + "description": "The category the action belongs to.", + "enum": [ + "EVENT_CATEGORY_UNSPECIFIED", + "GOOGLE_PARTNER_SEARCH", + "GOOGLE_PARTNER_SIGNUP_FLOW", + "GOOGLE_PARTNER_PORTAL", + "GOOGLE_PARTNER_PORTAL_MY_PROFILE", + "GOOGLE_PARTNER_PORTAL_CERTIFICATIONS", + "GOOGLE_PARTNER_PORTAL_COMMUNITY", + "GOOGLE_PARTNER_PORTAL_INSIGHTS", + "GOOGLE_PARTNER_PORTAL_CLIENTS", + "GOOGLE_PARTNER_PUBLIC_USER_PROFILE", + "GOOGLE_PARTNER_PANEL", + "GOOGLE_PARTNER_PORTAL_LAST_ADMIN_DIALOG", + "GOOGLE_PARTNER_CLIENT", + "GOOGLE_PARTNER_PORTAL_COMPANY_PROFILE", + "EXTERNAL_LINKS", + "GOOGLE_PARTNER_LANDING" + ] + }, + "eventScope": { + "type": "string", + "description": "The scope of the event.", + "enum": [ + "EVENT_SCOPE_UNSPECIFIED", + "VISITOR", + "SESSION", + "PAGE" + ] + }, + "eventDatas": { + "type": "array", + "description": "List of event data for the event.", + "items": { + "$ref": "EventData" + } + }, + "url": { + "type": "string", + "description": "The URL where the event occurred." + }, + "lead": { + "$ref": "Lead", + "description": "Advertiser lead information." + } + } + }, + "RequestMetadata": { + "id": "RequestMetadata", + "type": "object", + "description": "Common data that is in each API request.", + "properties": { + "userOverrides": { + "$ref": "UserOverrides", + "description": "Values to use instead of the user's respective defaults for the current request. These are only honored by whitelisted products." + }, + "locale": { + "type": "string", + "description": "Locale to use for the current request." + }, + "partnersSessionId": { + "type": "string", + "description": "Google Partners session ID." + }, + "experimentIds": { + "type": "array", + "description": "Experiment IDs the current request belongs to.", + "items": { + "type": "string" + } + }, + "trafficSource": { + "$ref": "TrafficSource", + "description": "Source of traffic for the current request." + } + } + }, + "UserOverrides": { + "id": "UserOverrides", + "type": "object", + "description": "Values to use instead of the user's respective defaults. These are only honored by whitelisted products.", + "properties": { + "ipAddress": { + "type": "string", + "description": "IP address to use instead of the user's geo-located IP address." + }, + "userId": { + "type": "string", + "description": "Logged-in user ID to impersonate instead of the user's ID." + } + } + }, + "TrafficSource": { + "id": "TrafficSource", + "type": "object", + "description": "Source of traffic for the current request.", + "properties": { + "trafficSourceId": { + "type": "string", + "description": "Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us." + }, + "trafficSubId": { + "type": "string", + "description": "Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us." + } + } + }, + "EventData": { + "id": "EventData", + "type": "object", + "description": "Key value data pair for an event.", + "properties": { + "key": { + "type": "string", + "description": "Data type.", + "enum": [ + "EVENT_DATA_TYPE_UNSPECIFIED", + "ACTION", + "AGENCY_ID", + "AGENCY_NAME", + "AGENCY_PHONE_NUMBER", + "AGENCY_WEBSITE", + "BUDGET", + "CENTER_POINT", + "CERTIFICATION", + "COMMENT", + "COUNTRY", + "CURRENCY", + "CURRENTLY_VIEWED_AGENCY_ID", + "DISTANCE", + "DISTANCE_TYPE", + "EXAM", + "HISTORY_TOKEN", + "IDENTIFIER", + "INDUSTRY", + "INSIGHT_TAG", + "LANGUAGE", + "LOCATION", + "MARKETING_OPT_IN", + "QUERY", + "SEARCH_START_INDEX", + "SERVICE", + "SHOW_VOW", + "SOLUTION", + "TRAFFIC_SOURCE_ID", + "TRAFFIC_SUB_ID", + "VIEW_PORT", + "WEBSITE", + "DETAILS", + "EXPERIMENT_ID", + "GPS_MOTIVATION", + "URL", + "ELEMENT_FOCUS", + "PROGRESS" + ] + }, + "values": { + "type": "array", + "description": "Data values.", + "items": { + "type": "string" + } + } + } + }, + "Lead": { + "id": "Lead", + "type": "object", + "description": "A lead resource that represents an advertiser contact for a `Company`. These are usually generated via Google Partner Search (the advertiser portal).", + "properties": { + "id": { + "type": "string", + "description": "ID of the lead." + }, + "type": { + "type": "string", + "description": "Type of lead.", + "enum": [ + "LEAD_TYPE_UNSPECIFIED", + "LT_GPS" + ] + }, + "email": { + "type": "string", + "description": "Email address of lead source." + }, + "givenName": { + "type": "string", + "description": "First name of lead source." + }, + "familyName": { + "type": "string", + "description": "Last name of lead source." + }, + "websiteUrl": { + "type": "string", + "description": "Website URL of lead source." + }, + "phoneNumber": { + "type": "string", + "description": "Phone number of lead source." + }, + "comments": { + "type": "string", + "description": "Comments lead source gave." + }, + "gpsMotivations": { + "type": "array", + "description": "List of reasons for using Google Partner Search and creating a lead.", + "enumDescriptions": [ + "Unchosen.", + "Advertiser needs help with their advertising.", + "Advertiser needs help with their website.", + "Advertiser does not have a website." + ], + "items": { + "type": "string", + "enum": [ + "GPS_MOTIVATION_UNSPECIFIED", + "GPSM_HELP_WITH_ADVERTISING", + "GPSM_HELP_WITH_WEBSITE", + "GPSM_NO_WEBSITE" + ] + } + }, + "minMonthlyBudget": { + "$ref": "Money", + "description": "The minimum monthly budget lead source is willing to spend." + } + } + }, + "Money": { + "id": "Money", + "type": "object", + "description": "Represents an amount of money with its currency type.", + "properties": { + "currencyCode": { + "type": "string", + "description": "The 3-letter currency code defined in ISO 4217." + }, + "units": { + "type": "string", + "description": "The whole units of the amount. For example if `currencyCode` is `\"USD\"`, then 1 unit is one US dollar.", + "format": "int64" + }, + "nanos": { + "type": "integer", + "description": "Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.", + "format": "int32" + } + } + }, + "LogUserEventResponse": { + "id": "LogUserEventResponse", + "type": "object", + "description": "Response message for LogUserEvent.", + "properties": { + "responseMetadata": { + "$ref": "ResponseMetadata", + "description": "Current response metadata." + } + } + }, + "ResponseMetadata": { + "id": "ResponseMetadata", + "type": "object", + "description": "Common data that is in each API response.", + "properties": { + "debugInfo": { + "$ref": "DebugInfo", + "description": "Debug information about this request." + } + } + }, + "DebugInfo": { + "id": "DebugInfo", + "type": "object", + "description": "Debug information about this request.", + "properties": { + "serverInfo": { + "type": "string", + "description": "Info about the server that serviced this request." + }, + "serviceUrl": { + "type": "string", + "description": "URL of the service that handled this request." + }, + "serverTraceInfo": { + "type": "string", + "description": "Server-side debug stack trace." + } + } + }, + "LogMessageRequest": { + "id": "LogMessageRequest", + "type": "object", + "description": "Request message for LogClientMessage.", + "properties": { + "requestMetadata": { + "$ref": "RequestMetadata", + "description": "Current request metadata." + }, + "level": { + "type": "string", + "description": "Message level of client message.", + "enum": [ + "MESSAGE_LEVEL_UNSPECIFIED", + "ML_FINE", + "ML_INFO", + "ML_WARNING", + "ML_SEVERE" + ] + }, + "details": { + "type": "string", + "description": "Details about the client message." + }, + "clientInfo": { + "type": "object", + "description": "Map of client info, such as URL, browser navigator, browser platform, etc.", + "additionalProperties": { + "type": "string" + } + } + } + }, + "LogMessageResponse": { + "id": "LogMessageResponse", + "type": "object", + "description": "Response message for LogClientMessage.", + "properties": { + "responseMetadata": { + "$ref": "ResponseMetadata", + "description": "Current response metadata." + } + } + }, + "ListUserStatesResponse": { + "id": "ListUserStatesResponse", + "type": "object", + "description": "Response message for ListUserStates.", + "properties": { + "responseMetadata": { + "$ref": "ResponseMetadata", + "description": "Current response metadata." + }, + "userStates": { + "type": "array", + "description": "User's states.", + "enumDescriptions": [ + "Unchosen.", + "User must pass reCaptcha to contact a Partner via Google Partner Search." + ], + "items": { + "type": "string", + "enum": [ + "USER_STATE_UNSPECIFIED", + "US_REQUIRES_RECAPTCHA_FOR_GPS_CONTACT" + ] + } + } + } + }, + "GetCompanyResponse": { + "id": "GetCompanyResponse", + "type": "object", + "description": "Response message for GetCompany.", + "properties": { + "responseMetadata": { + "$ref": "ResponseMetadata", + "description": "Current response metadata." + }, + "company": { + "$ref": "Company", + "description": "The company." + } + } + }, + "Company": { + "id": "Company", + "type": "object", + "description": "A company resource in the Google Partners API. Once certified, it qualifies for being searched by advertisers.", + "properties": { + "id": { + "type": "string", + "description": "The ID of the company." + }, + "name": { + "type": "string", + "description": "The name of the company." + }, + "localizedInfos": { + "type": "array", + "description": "The list of localized info for the company.", + "items": { + "$ref": "LocalizedCompanyInfo" + } + }, + "locations": { + "type": "array", + "description": "The list of company locations.", + "items": { + "$ref": "Location" + } + }, + "convertedMinMonthlyBudget": { + "$ref": "Money", + "description": "The minimum monthly budget that the company accepts for partner business, converted to the requested currency code." + }, + "originalMinMonthlyBudget": { + "$ref": "Money", + "description": "The unconverted minimum monthly budget that the company accepts for partner business." + }, + "publicProfile": { + "$ref": "PublicProfile", + "description": "Basic information from the company's public profile." + }, + "certificationStatuses": { + "type": "array", + "description": "The list of Google Partners certification statuses for the company.", + "items": { + "$ref": "CertificationStatus" + } + }, + "ranks": { + "type": "array", + "description": "Information related to the ranking of the company within the list of companies.", + "items": { + "$ref": "Rank" + } + }, + "websiteUrl": { + "type": "string", + "description": "URL of the company's website." + }, + "industries": { + "type": "array", + "description": "Industries the company can help with.", + "enumDescriptions": [ + "Unchosen.", + "The automotive industry.", + "The business-to-business industry.", + "The consumer packaged goods industry.", + "The education industry.", + "The finance industry.", + "The healthcare industry.", + "The media and entertainment industry.", + "The retail industry.", + "The technology industry.", + "The travel industry." + ], + "items": { + "type": "string", + "enum": [ + "INDUSTRY_UNSPECIFIED", + "I_AUTOMOTIVE", + "I_BUSINESS_TO_BUSINESS", + "I_CONSUMER_PACKAGED_GOODS", + "I_EDUCATION", + "I_FINANCE", + "I_HEALTHCARE", + "I_MEDIA_AND_ENTERTAINMENT", + "I_RETAIL", + "I_TECHNOLOGY", + "I_TRAVEL" + ] + } + }, + "services": { + "type": "array", + "description": "Services the company can help with.", + "enumDescriptions": [ + "Unchosen.", + "Help with advanced AdWords support.", + "Help with advertising on Google.", + "Help with an enhanced website.", + "Help with an online marketing plan.", + "Help with mobile and video ads." + ], + "items": { + "type": "string", + "enum": [ + "SERVICE_UNSPECIFIED", + "S_ADVANCED_ADWORDS_SUPPORT", + "S_ADVERTISING_ON_GOOGLE", + "S_AN_ENHANCED_WEBSITE", + "S_AN_ONLINE_MARKETING_PLAN", + "S_MOBILE_AND_VIDEO_ADS" + ] + } + } + } + }, + "LocalizedCompanyInfo": { + "id": "LocalizedCompanyInfo", + "type": "object", + "description": "The localized company information.", + "properties": { + "languageCode": { + "type": "string", + "description": "Language code of the localized company info, as defined by BCP 47 (IETF BCP 47, \"Tags for Identifying Languages\")." + }, + "displayName": { + "type": "string", + "description": "Localized display name." + }, + "overview": { + "type": "string", + "description": "Localized brief description that the company uses to advertise themselves." + }, + "countryCodes": { + "type": "array", + "description": "List of country codes for the localized company info.", + "items": { + "type": "string" + } + } + } + }, + "Location": { + "id": "Location", + "type": "object", + "description": "A location with address and geographic coordinates.", + "properties": { + "address": { + "type": "string", + "description": "The complete address of the location." + }, + "latLng": { + "$ref": "LatLng", + "description": "The latitude and longitude of the location, in degrees." + } + } + }, + "LatLng": { + "id": "LatLng", + "type": "object", + "description": "An object representing a latitude/longitude pair. This is expressed as a pair of doubles representing degrees latitude and degrees longitude. Unless specified otherwise, this must conform to the WGS84 standard. Values must be within normalized ranges. Example of normalization code in Python: def NormalizeLongitude(longitude): \"\"\"Wrapsdecimal degrees longitude to [-180.0, 180.0].\"\"\" q, r = divmod(longitude, 360.0) if r \u003e 180.0 or (r == 180.0 and q \u003c= -1.0): return r - 360.0 return r def NormalizeLatLng(latitude, longitude): \"\"\"Wraps decimal degrees latitude and longitude to [-180.0, 180.0] and [-90.0, 90.0], respectively.\"\"\" r = latitude % 360.0 if r = 270.0: return r - 360, NormalizeLongitude(longitude) else: return 180 - r, NormalizeLongitude(longitude + 180.0) assert 180.0 == NormalizeLongitude(180.0) assert -180.0 == NormalizeLongitude(-180.0) assert -179.0 == NormalizeLongitude(181.0) assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0) assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0) assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0) assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0) assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0) assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0) assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0) assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0) assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0) assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)", + "properties": { + "latitude": { + "type": "number", + "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].", + "format": "double" + }, + "longitude": { + "type": "number", + "description": "The longitude in degrees. It must be in the range [-180.0, +180.0].", + "format": "double" + } + } + }, + "PublicProfile": { + "id": "PublicProfile", + "type": "object", + "description": "Basic information from a public profile.", + "properties": { + "id": { + "type": "string", + "description": "The ID which can be used to retrieve more details about the public profile." + }, + "displayName": { + "type": "string", + "description": "The display name of the public profile." + }, + "url": { + "type": "string", + "description": "The URL of the public profile." + }, + "displayImageUrl": { + "type": "string", + "description": "The URL to the main display image of the public profile." + } + } + }, + "CertificationStatus": { + "id": "CertificationStatus", + "type": "object", + "description": "Google Partners certification status.", + "properties": { + "type": { + "type": "string", + "description": "The type of the certification.", + "enum": [ + "CERTIFICATION_TYPE_UNSPECIFIED", + "CT_ADWORDS", + "CT_YOUTUBE", + "CT_VIDEOADS", + "CT_ANALYTICS", + "CT_DOUBLECLICK", + "CT_SHOPPING", + "CT_MOBILE" + ] + }, + "examStatuses": { + "type": "array", + "description": "List of certification exam statuses.", + "items": { + "$ref": "CertificationExamStatus" + } + }, + "isCertified": { + "type": "boolean", + "description": "Whether certification is passing." + } + } + }, + "CertificationExamStatus": { + "id": "CertificationExamStatus", + "type": "object", + "description": "Status for a Google Partners certification exam.", + "properties": { + "type": { + "type": "string", + "description": "The type of certification exam.", + "enum": [ + "CERTIFICATION_EXAM_TYPE_UNSPECIFIED", + "CET_ADWORDS_ADVANCED_SEARCH", + "CET_ADWORDS_ADVANCED_DISPLAY", + "CET_VIDEO_ADS", + "CET_ANALYTICS", + "CET_DOUBLECLICK", + "CET_SHOPPING", + "CET_MOBILE" + ] + }, + "numberUsersPass": { + "type": "integer", + "description": "The number of people who have passed the certification exam.", + "format": "int32" + } + } + }, + "Rank": { + "id": "Rank", + "type": "object", + "description": "Information related to ranking of results.", + "properties": { + "type": { + "type": "string", + "description": "The type of rank.", + "enum": [ + "RANK_TYPE_UNSPECIFIED", + "RT_FINAL_SCORE" + ] + }, + "value": { + "type": "number", + "description": "The numerical value of the rank.", + "format": "double" + } + } + }, + "ListCompaniesResponse": { + "id": "ListCompaniesResponse", + "type": "object", + "description": "Response message for ListCompanies.", + "properties": { + "responseMetadata": { + "$ref": "ResponseMetadata", + "description": "Current response metadata." + }, + "companies": { + "type": "array", + "description": "The list of companies.", + "items": { + "$ref": "Company" + } + }, + "nextPageToken": { + "type": "string", + "description": "A token to retrieve next page of results. Pass this value in the `ListCompaniesRequest.page_token` field in the subsequent call to ListCompanies to retrieve the next page of results." + } + } + }, + "CreateLeadRequest": { + "id": "CreateLeadRequest", + "type": "object", + "description": "Request message for CreateLead.", + "properties": { + "requestMetadata": { + "$ref": "RequestMetadata", + "description": "Current request metadata." + }, + "lead": { + "$ref": "Lead", + "description": "The lead resource. The `LeadType` must not be `LEAD_TYPE_UNSPECIFIED` and either `email` or `phone_number` must be provided." + }, + "recaptchaChallenge": { + "$ref": "RecaptchaChallenge", + "description": "reCaptcha challenge info." + } + } + }, + "RecaptchaChallenge": { + "id": "RecaptchaChallenge", + "type": "object", + "description": "reCaptcha challenge info.", + "properties": { + "id": { + "type": "string", + "description": "The ID of the reCaptcha challenge." + }, + "response": { + "type": "string", + "description": "The response to the reCaptcha challenge." + } + } + }, + "CreateLeadResponse": { + "id": "CreateLeadResponse", + "type": "object", + "description": "Response message for CreateLead. Debug information about this request.", + "properties": { + "responseMetadata": { + "$ref": "ResponseMetadata", + "description": "Current response metadata." + }, + "lead": { + "$ref": "Lead", + "description": "Lead that was created depending on the outcome of reCaptcha validation." + }, + "recaptchaStatus": { + "type": "string", + "description": "The outcome of reCaptcha validation.", + "enum": [ + "RECAPTCHA_STATUS_UNSPECIFIED", + "RS_NOT_NEEDED", + "RS_PASSED", + "RS_FAILED" + ] + } + } + } + }, + "resources": { + "userEvents": { + "methods": { + "log": { + "id": "partners.userEvents.log", + "path": "v2/userEvents:log", + "httpMethod": "POST", + "description": "Logs a user event.", + "request": { + "$ref": "LogUserEventRequest" + }, + "response": { + "$ref": "LogUserEventResponse" + } + } + } + }, + "clientMessages": { + "methods": { + "log": { + "id": "partners.clientMessages.log", + "path": "v2/clientMessages:log", + "httpMethod": "POST", + "description": "Logs a generic message from the client, such as `Failed to render component`, `Profile page is running slow`, `More than 500 users have accessed this result.`, etc.", + "request": { + "$ref": "LogMessageRequest" + }, + "response": { + "$ref": "LogMessageResponse" + } + } + } + }, + "userStates": { + "methods": { + "list": { + "id": "partners.userStates.list", + "path": "v2/userStates", + "httpMethod": "GET", + "description": "Lists states for current user.", + "parameters": { + "requestMetadata.userOverrides.ipAddress": { + "type": "string", + "description": "IP address to use instead of the user's geo-located IP address.", + "location": "query" + }, + "requestMetadata.userOverrides.userId": { + "type": "string", + "description": "Logged-in user ID to impersonate instead of the user's ID.", + "location": "query" + }, + "requestMetadata.locale": { + "type": "string", + "description": "Locale to use for the current request.", + "location": "query" + }, + "requestMetadata.partnersSessionId": { + "type": "string", + "description": "Google Partners session ID.", + "location": "query" + }, + "requestMetadata.experimentIds": { + "type": "string", + "description": "Experiment IDs the current request belongs to.", + "repeated": true, + "location": "query" + }, + "requestMetadata.trafficSource.trafficSourceId": { + "type": "string", + "description": "Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us.", + "location": "query" + }, + "requestMetadata.trafficSource.trafficSubId": { + "type": "string", + "description": "Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us.", + "location": "query" + } + }, + "response": { + "$ref": "ListUserStatesResponse" + } + } + } + }, + "companies": { + "methods": { + "get": { + "id": "partners.companies.get", + "path": "v2/companies/{companyId}", + "httpMethod": "GET", + "description": "Gets a company.", + "parameters": { + "companyId": { + "type": "string", + "description": "The ID of the company to retrieve.", + "required": true, + "location": "path" + }, + "requestMetadata.userOverrides.ipAddress": { + "type": "string", + "description": "IP address to use instead of the user's geo-located IP address.", + "location": "query" + }, + "requestMetadata.userOverrides.userId": { + "type": "string", + "description": "Logged-in user ID to impersonate instead of the user's ID.", + "location": "query" + }, + "requestMetadata.locale": { + "type": "string", + "description": "Locale to use for the current request.", + "location": "query" + }, + "requestMetadata.partnersSessionId": { + "type": "string", + "description": "Google Partners session ID.", + "location": "query" + }, + "requestMetadata.experimentIds": { + "type": "string", + "description": "Experiment IDs the current request belongs to.", + "repeated": true, + "location": "query" + }, + "requestMetadata.trafficSource.trafficSourceId": { + "type": "string", + "description": "Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us.", + "location": "query" + }, + "requestMetadata.trafficSource.trafficSubId": { + "type": "string", + "description": "Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us.", + "location": "query" + }, + "view": { + "type": "string", + "description": "The view of `Company` resource to be returned. This must not be `COMPANY_VIEW_UNSPECIFIED`.", + "enum": [ + "COMPANY_VIEW_UNSPECIFIED", + "CV_GOOGLE_PARTNER_SEARCH" + ], + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "How to order addresses within the returned company. Currently, only `address` and `address desc` is supported which will sorted by closest to farthest in distance from given address and farthest to closest distance from given address respectively.", + "location": "query" + }, + "currencyCode": { + "type": "string", + "description": "If the company's budget is in a different currency code than this one, then the converted budget is converted to this currency code.", + "location": "query" + }, + "address": { + "type": "string", + "description": "The address to use for sorting the company's addresses by proximity. If not given, the geo-located address of the request is used. Used when order_by is set.", + "location": "query" + } + }, + "parameterOrder": [ + "companyId" + ], + "response": { + "$ref": "GetCompanyResponse" + } + }, + "list": { + "id": "partners.companies.list", + "path": "v2/companies", + "httpMethod": "GET", + "description": "Lists companies.", + "parameters": { + "requestMetadata.userOverrides.ipAddress": { + "type": "string", + "description": "IP address to use instead of the user's geo-located IP address.", + "location": "query" + }, + "requestMetadata.userOverrides.userId": { + "type": "string", + "description": "Logged-in user ID to impersonate instead of the user's ID.", + "location": "query" + }, + "requestMetadata.locale": { + "type": "string", + "description": "Locale to use for the current request.", + "location": "query" + }, + "requestMetadata.partnersSessionId": { + "type": "string", + "description": "Google Partners session ID.", + "location": "query" + }, + "requestMetadata.experimentIds": { + "type": "string", + "description": "Experiment IDs the current request belongs to.", + "repeated": true, + "location": "query" + }, + "requestMetadata.trafficSource.trafficSourceId": { + "type": "string", + "description": "Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us.", + "location": "query" + }, + "requestMetadata.trafficSource.trafficSubId": { + "type": "string", + "description": "Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us.", + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "Requested page size. Server may return fewer companies than requested. If unspecified, server picks an appropriate default.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A token identifying a page of results that the server returns. Typically, this is the value of `ListCompaniesResponse.next_page_token` returned from the previous call to ListCompanies.", + "location": "query" + }, + "companyName": { + "type": "string", + "description": "Company name to search for.", + "location": "query" + }, + "view": { + "type": "string", + "description": "The view of the `Company` resource to be returned. This must not be `COMPANY_VIEW_UNSPECIFIED`.", + "enum": [ + "COMPANY_VIEW_UNSPECIFIED", + "CV_GOOGLE_PARTNER_SEARCH" + ], + "location": "query" + }, + "minMonthlyBudget.currencyCode": { + "type": "string", + "description": "The 3-letter currency code defined in ISO 4217.", + "location": "query" + }, + "minMonthlyBudget.units": { + "type": "string", + "description": "The whole units of the amount. For example if `currencyCode` is `\"USD\"`, then 1 unit is one US dollar.", + "format": "int64", + "location": "query" + }, + "minMonthlyBudget.nanos": { + "type": "integer", + "description": "Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.", + "format": "int32", + "location": "query" + }, + "maxMonthlyBudget.currencyCode": { + "type": "string", + "description": "The 3-letter currency code defined in ISO 4217.", + "location": "query" + }, + "maxMonthlyBudget.units": { + "type": "string", + "description": "The whole units of the amount. For example if `currencyCode` is `\"USD\"`, then 1 unit is one US dollar.", + "format": "int64", + "location": "query" + }, + "maxMonthlyBudget.nanos": { + "type": "integer", + "description": "Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.", + "format": "int32", + "location": "query" + }, + "industries": { + "type": "string", + "description": "List of industries the company can help with.", + "enum": [ + "INDUSTRY_UNSPECIFIED", + "I_AUTOMOTIVE", + "I_BUSINESS_TO_BUSINESS", + "I_CONSUMER_PACKAGED_GOODS", + "I_EDUCATION", + "I_FINANCE", + "I_HEALTHCARE", + "I_MEDIA_AND_ENTERTAINMENT", + "I_RETAIL", + "I_TECHNOLOGY", + "I_TRAVEL" + ], + "repeated": true, + "location": "query" + }, + "services": { + "type": "string", + "description": "List of services the company can help with.", + "enum": [ + "SERVICE_UNSPECIFIED", + "S_ADVANCED_ADWORDS_SUPPORT", + "S_ADVERTISING_ON_GOOGLE", + "S_AN_ENHANCED_WEBSITE", + "S_AN_ONLINE_MARKETING_PLAN", + "S_MOBILE_AND_VIDEO_ADS" + ], + "repeated": true, + "location": "query" + }, + "languageCodes": { + "type": "string", + "description": "List of language codes that company can support. Only primary language subtags are accepted as defined by BCP 47 (IETF BCP 47, \"Tags for Identifying Languages\").", + "repeated": true, + "location": "query" + }, + "address": { + "type": "string", + "description": "The address to use when searching for companies. If not given, the geo-located address of the request is used.", + "location": "query" + }, + "orderBy": { + "type": "string", + "description": "How to order addresses within the returned companies. Currently, only `address` and `address desc` is supported which will sorted by closest to farthest in distance from given address and farthest to closest distance from given address respectively.", + "location": "query" + }, + "gpsMotivations": { + "type": "string", + "description": "List of reasons for using Google Partner Search to get companies.", + "enum": [ + "GPS_MOTIVATION_UNSPECIFIED", + "GPSM_HELP_WITH_ADVERTISING", + "GPSM_HELP_WITH_WEBSITE", + "GPSM_NO_WEBSITE" + ], + "repeated": true, + "location": "query" + }, + "websiteUrl": { + "type": "string", + "description": "Website URL that will help to find a better matched company. .", + "location": "query" + } + }, + "response": { + "$ref": "ListCompaniesResponse" + } + } + }, + "resources": { + "leads": { + "methods": { + "create": { + "id": "partners.companies.leads.create", + "path": "v2/companies/{companyId}/leads", + "httpMethod": "POST", + "description": "Creates an advertiser lead for the given company ID.", + "parameters": { + "companyId": { + "type": "string", + "description": "The ID of the company to contact.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "companyId" + ], + "request": { + "$ref": "CreateLeadRequest" + }, + "response": { + "$ref": "CreateLeadResponse" + } + } + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/partners/v2/partners-gen.go b/Godeps/_workspace/src/google.golang.org/api/partners/v2/partners-gen.go new file mode 100644 index 000000000..14f153055 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/partners/v2/partners-gen.go @@ -0,0 +1,2653 @@ +// Package partners provides access to the Google Partners API. +// +// See https://developers.google.com/partners/ +// +// Usage example: +// +// import "google.golang.org/api/partners/v2" +// ... +// partnersService, err := partners.New(oauthHttpClient) +package partners // import "google.golang.org/api/partners/v2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "partners:v2" +const apiName = "partners" +const apiVersion = "v2" +const basePath = "https://partners.googleapis.com/" + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.ClientMessages = NewClientMessagesService(s) + s.Companies = NewCompaniesService(s) + s.UserEvents = NewUserEventsService(s) + s.UserStates = NewUserStatesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + ClientMessages *ClientMessagesService + + Companies *CompaniesService + + UserEvents *UserEventsService + + UserStates *UserStatesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewClientMessagesService(s *Service) *ClientMessagesService { + rs := &ClientMessagesService{s: s} + return rs +} + +type ClientMessagesService struct { + s *Service +} + +func NewCompaniesService(s *Service) *CompaniesService { + rs := &CompaniesService{s: s} + rs.Leads = NewCompaniesLeadsService(s) + return rs +} + +type CompaniesService struct { + s *Service + + Leads *CompaniesLeadsService +} + +func NewCompaniesLeadsService(s *Service) *CompaniesLeadsService { + rs := &CompaniesLeadsService{s: s} + return rs +} + +type CompaniesLeadsService struct { + s *Service +} + +func NewUserEventsService(s *Service) *UserEventsService { + rs := &UserEventsService{s: s} + return rs +} + +type UserEventsService struct { + s *Service +} + +func NewUserStatesService(s *Service) *UserStatesService { + rs := &UserStatesService{s: s} + return rs +} + +type UserStatesService struct { + s *Service +} + +// CertificationExamStatus: Status for a Google Partners certification +// exam. +type CertificationExamStatus struct { + // NumberUsersPass: The number of people who have passed the + // certification exam. + NumberUsersPass int64 `json:"numberUsersPass,omitempty"` + + // Type: The type of certification exam. + // + // Possible values: + // "CERTIFICATION_EXAM_TYPE_UNSPECIFIED" + // "CET_ADWORDS_ADVANCED_SEARCH" + // "CET_ADWORDS_ADVANCED_DISPLAY" + // "CET_VIDEO_ADS" + // "CET_ANALYTICS" + // "CET_DOUBLECLICK" + // "CET_SHOPPING" + // "CET_MOBILE" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "NumberUsersPass") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CertificationExamStatus) MarshalJSON() ([]byte, error) { + type noMethod CertificationExamStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CertificationStatus: Google Partners certification status. +type CertificationStatus struct { + // ExamStatuses: List of certification exam statuses. + ExamStatuses []*CertificationExamStatus `json:"examStatuses,omitempty"` + + // IsCertified: Whether certification is passing. + IsCertified bool `json:"isCertified,omitempty"` + + // Type: The type of the certification. + // + // Possible values: + // "CERTIFICATION_TYPE_UNSPECIFIED" + // "CT_ADWORDS" + // "CT_YOUTUBE" + // "CT_VIDEOADS" + // "CT_ANALYTICS" + // "CT_DOUBLECLICK" + // "CT_SHOPPING" + // "CT_MOBILE" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ExamStatuses") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CertificationStatus) MarshalJSON() ([]byte, error) { + type noMethod CertificationStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Company: A company resource in the Google Partners API. Once +// certified, it qualifies for being searched by advertisers. +type Company struct { + // CertificationStatuses: The list of Google Partners certification + // statuses for the company. + CertificationStatuses []*CertificationStatus `json:"certificationStatuses,omitempty"` + + // ConvertedMinMonthlyBudget: The minimum monthly budget that the + // company accepts for partner business, converted to the requested + // currency code. + ConvertedMinMonthlyBudget *Money `json:"convertedMinMonthlyBudget,omitempty"` + + // Id: The ID of the company. + Id string `json:"id,omitempty"` + + // Industries: Industries the company can help with. + // + // Possible values: + // "INDUSTRY_UNSPECIFIED" - Unchosen. + // "I_AUTOMOTIVE" - The automotive industry. + // "I_BUSINESS_TO_BUSINESS" - The business-to-business industry. + // "I_CONSUMER_PACKAGED_GOODS" - The consumer packaged goods industry. + // "I_EDUCATION" - The education industry. + // "I_FINANCE" - The finance industry. + // "I_HEALTHCARE" - The healthcare industry. + // "I_MEDIA_AND_ENTERTAINMENT" - The media and entertainment industry. + // "I_RETAIL" - The retail industry. + // "I_TECHNOLOGY" - The technology industry. + // "I_TRAVEL" - The travel industry. + Industries []string `json:"industries,omitempty"` + + // LocalizedInfos: The list of localized info for the company. + LocalizedInfos []*LocalizedCompanyInfo `json:"localizedInfos,omitempty"` + + // Locations: The list of company locations. + Locations []*Location `json:"locations,omitempty"` + + // Name: The name of the company. + Name string `json:"name,omitempty"` + + // OriginalMinMonthlyBudget: The unconverted minimum monthly budget that + // the company accepts for partner business. + OriginalMinMonthlyBudget *Money `json:"originalMinMonthlyBudget,omitempty"` + + // PublicProfile: Basic information from the company's public profile. + PublicProfile *PublicProfile `json:"publicProfile,omitempty"` + + // Ranks: Information related to the ranking of the company within the + // list of companies. + Ranks []*Rank `json:"ranks,omitempty"` + + // Services: Services the company can help with. + // + // Possible values: + // "SERVICE_UNSPECIFIED" - Unchosen. + // "S_ADVANCED_ADWORDS_SUPPORT" - Help with advanced AdWords support. + // "S_ADVERTISING_ON_GOOGLE" - Help with advertising on Google. + // "S_AN_ENHANCED_WEBSITE" - Help with an enhanced website. + // "S_AN_ONLINE_MARKETING_PLAN" - Help with an online marketing plan. + // "S_MOBILE_AND_VIDEO_ADS" - Help with mobile and video ads. + Services []string `json:"services,omitempty"` + + // WebsiteUrl: URL of the company's website. + WebsiteUrl string `json:"websiteUrl,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "CertificationStatuses") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Company) MarshalJSON() ([]byte, error) { + type noMethod Company + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreateLeadRequest: Request message for CreateLead. +type CreateLeadRequest struct { + // Lead: The lead resource. The `LeadType` must not be + // `LEAD_TYPE_UNSPECIFIED` and either `email` or `phone_number` must be + // provided. + Lead *Lead `json:"lead,omitempty"` + + // RecaptchaChallenge: reCaptcha challenge info. + RecaptchaChallenge *RecaptchaChallenge `json:"recaptchaChallenge,omitempty"` + + // RequestMetadata: Current request metadata. + RequestMetadata *RequestMetadata `json:"requestMetadata,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Lead") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreateLeadRequest) MarshalJSON() ([]byte, error) { + type noMethod CreateLeadRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreateLeadResponse: Response message for CreateLead. Debug +// information about this request. +type CreateLeadResponse struct { + // Lead: Lead that was created depending on the outcome of reCaptcha + // validation. + Lead *Lead `json:"lead,omitempty"` + + // RecaptchaStatus: The outcome of reCaptcha validation. + // + // Possible values: + // "RECAPTCHA_STATUS_UNSPECIFIED" + // "RS_NOT_NEEDED" + // "RS_PASSED" + // "RS_FAILED" + RecaptchaStatus string `json:"recaptchaStatus,omitempty"` + + // ResponseMetadata: Current response metadata. + ResponseMetadata *ResponseMetadata `json:"responseMetadata,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Lead") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreateLeadResponse) MarshalJSON() ([]byte, error) { + type noMethod CreateLeadResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DebugInfo: Debug information about this request. +type DebugInfo struct { + // ServerInfo: Info about the server that serviced this request. + ServerInfo string `json:"serverInfo,omitempty"` + + // ServerTraceInfo: Server-side debug stack trace. + ServerTraceInfo string `json:"serverTraceInfo,omitempty"` + + // ServiceUrl: URL of the service that handled this request. + ServiceUrl string `json:"serviceUrl,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ServerInfo") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DebugInfo) MarshalJSON() ([]byte, error) { + type noMethod DebugInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventData: Key value data pair for an event. +type EventData struct { + // Key: Data type. + // + // Possible values: + // "EVENT_DATA_TYPE_UNSPECIFIED" + // "ACTION" + // "AGENCY_ID" + // "AGENCY_NAME" + // "AGENCY_PHONE_NUMBER" + // "AGENCY_WEBSITE" + // "BUDGET" + // "CENTER_POINT" + // "CERTIFICATION" + // "COMMENT" + // "COUNTRY" + // "CURRENCY" + // "CURRENTLY_VIEWED_AGENCY_ID" + // "DISTANCE" + // "DISTANCE_TYPE" + // "EXAM" + // "HISTORY_TOKEN" + // "IDENTIFIER" + // "INDUSTRY" + // "INSIGHT_TAG" + // "LANGUAGE" + // "LOCATION" + // "MARKETING_OPT_IN" + // "QUERY" + // "SEARCH_START_INDEX" + // "SERVICE" + // "SHOW_VOW" + // "SOLUTION" + // "TRAFFIC_SOURCE_ID" + // "TRAFFIC_SUB_ID" + // "VIEW_PORT" + // "WEBSITE" + // "DETAILS" + // "EXPERIMENT_ID" + // "GPS_MOTIVATION" + // "URL" + // "ELEMENT_FOCUS" + // "PROGRESS" + Key string `json:"key,omitempty"` + + // Values: Data values. + Values []string `json:"values,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventData) MarshalJSON() ([]byte, error) { + type noMethod EventData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GetCompanyResponse: Response message for GetCompany. +type GetCompanyResponse struct { + // Company: The company. + Company *Company `json:"company,omitempty"` + + // ResponseMetadata: Current response metadata. + ResponseMetadata *ResponseMetadata `json:"responseMetadata,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Company") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GetCompanyResponse) MarshalJSON() ([]byte, error) { + type noMethod GetCompanyResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LatLng: An object representing a latitude/longitude pair. This is +// expressed as a pair of doubles representing degrees latitude and +// degrees longitude. Unless specified otherwise, this must conform to +// the WGS84 standard. Values must be within normalized ranges. Example +// of normalization code in Python: def NormalizeLongitude(longitude): +// """Wrapsdecimal degrees longitude to [-180.0, 180.0].""" q, r = +// divmod(longitude, 360.0) if r > 180.0 or (r == 180.0 and q <= -1.0): +// return r - 360.0 return r def NormalizeLatLng(latitude, longitude): +// """Wraps decimal degrees latitude and longitude to [-180.0, 180.0] +// and [-90.0, 90.0], respectively.""" r = latitude % 360.0 if r = +// 270.0: return r - 360, NormalizeLongitude(longitude) else: return 180 +// - r, NormalizeLongitude(longitude + 180.0) assert 180.0 == +// NormalizeLongitude(180.0) assert -180.0 == NormalizeLongitude(-180.0) +// assert -179.0 == NormalizeLongitude(181.0) assert (0.0, 0.0) == +// NormalizeLatLng(360.0, 0.0) assert (0.0, 0.0) == +// NormalizeLatLng(-360.0, 0.0) assert (85.0, 180.0) == +// NormalizeLatLng(95.0, 0.0) assert (-85.0, -170.0) == +// NormalizeLatLng(-95.0, 10.0) assert (90.0, 10.0) == +// NormalizeLatLng(90.0, 10.0) assert (-90.0, -10.0) == +// NormalizeLatLng(-90.0, -10.0) assert (0.0, -170.0) == +// NormalizeLatLng(-180.0, 10.0) assert (0.0, -170.0) == +// NormalizeLatLng(180.0, 10.0) assert (-90.0, 10.0) == +// NormalizeLatLng(270.0, 10.0) assert (90.0, 10.0) == +// NormalizeLatLng(-270.0, 10.0) +type LatLng struct { + // Latitude: The latitude in degrees. It must be in the range [-90.0, + // +90.0]. + Latitude float64 `json:"latitude,omitempty"` + + // Longitude: The longitude in degrees. It must be in the range [-180.0, + // +180.0]. + Longitude float64 `json:"longitude,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Latitude") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LatLng) MarshalJSON() ([]byte, error) { + type noMethod LatLng + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Lead: A lead resource that represents an advertiser contact for a +// `Company`. These are usually generated via Google Partner Search (the +// advertiser portal). +type Lead struct { + // Comments: Comments lead source gave. + Comments string `json:"comments,omitempty"` + + // Email: Email address of lead source. + Email string `json:"email,omitempty"` + + // FamilyName: Last name of lead source. + FamilyName string `json:"familyName,omitempty"` + + // GivenName: First name of lead source. + GivenName string `json:"givenName,omitempty"` + + // GpsMotivations: List of reasons for using Google Partner Search and + // creating a lead. + // + // Possible values: + // "GPS_MOTIVATION_UNSPECIFIED" - Unchosen. + // "GPSM_HELP_WITH_ADVERTISING" - Advertiser needs help with their + // advertising. + // "GPSM_HELP_WITH_WEBSITE" - Advertiser needs help with their + // website. + // "GPSM_NO_WEBSITE" - Advertiser does not have a website. + GpsMotivations []string `json:"gpsMotivations,omitempty"` + + // Id: ID of the lead. + Id string `json:"id,omitempty"` + + // MinMonthlyBudget: The minimum monthly budget lead source is willing + // to spend. + MinMonthlyBudget *Money `json:"minMonthlyBudget,omitempty"` + + // PhoneNumber: Phone number of lead source. + PhoneNumber string `json:"phoneNumber,omitempty"` + + // Type: Type of lead. + // + // Possible values: + // "LEAD_TYPE_UNSPECIFIED" + // "LT_GPS" + Type string `json:"type,omitempty"` + + // WebsiteUrl: Website URL of lead source. + WebsiteUrl string `json:"websiteUrl,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Comments") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Lead) MarshalJSON() ([]byte, error) { + type noMethod Lead + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListCompaniesResponse: Response message for ListCompanies. +type ListCompaniesResponse struct { + // Companies: The list of companies. + Companies []*Company `json:"companies,omitempty"` + + // NextPageToken: A token to retrieve next page of results. Pass this + // value in the `ListCompaniesRequest.page_token` field in the + // subsequent call to ListCompanies to retrieve the next page of + // results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ResponseMetadata: Current response metadata. + ResponseMetadata *ResponseMetadata `json:"responseMetadata,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Companies") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListCompaniesResponse) MarshalJSON() ([]byte, error) { + type noMethod ListCompaniesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListUserStatesResponse: Response message for ListUserStates. +type ListUserStatesResponse struct { + // ResponseMetadata: Current response metadata. + ResponseMetadata *ResponseMetadata `json:"responseMetadata,omitempty"` + + // UserStates: User's states. + // + // Possible values: + // "USER_STATE_UNSPECIFIED" - Unchosen. + // "US_REQUIRES_RECAPTCHA_FOR_GPS_CONTACT" - User must pass reCaptcha + // to contact a Partner via Google Partner Search. + UserStates []string `json:"userStates,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ResponseMetadata") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListUserStatesResponse) MarshalJSON() ([]byte, error) { + type noMethod ListUserStatesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LocalizedCompanyInfo: The localized company information. +type LocalizedCompanyInfo struct { + // CountryCodes: List of country codes for the localized company info. + CountryCodes []string `json:"countryCodes,omitempty"` + + // DisplayName: Localized display name. + DisplayName string `json:"displayName,omitempty"` + + // LanguageCode: Language code of the localized company info, as defined + // by BCP 47 (IETF BCP 47, "Tags for Identifying Languages"). + LanguageCode string `json:"languageCode,omitempty"` + + // Overview: Localized brief description that the company uses to + // advertise themselves. + Overview string `json:"overview,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CountryCodes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LocalizedCompanyInfo) MarshalJSON() ([]byte, error) { + type noMethod LocalizedCompanyInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Location: A location with address and geographic coordinates. +type Location struct { + // Address: The complete address of the location. + Address string `json:"address,omitempty"` + + // LatLng: The latitude and longitude of the location, in degrees. + LatLng *LatLng `json:"latLng,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Address") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Location) MarshalJSON() ([]byte, error) { + type noMethod Location + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LogMessageRequest: Request message for LogClientMessage. +type LogMessageRequest struct { + // ClientInfo: Map of client info, such as URL, browser navigator, + // browser platform, etc. + ClientInfo map[string]string `json:"clientInfo,omitempty"` + + // Details: Details about the client message. + Details string `json:"details,omitempty"` + + // Level: Message level of client message. + // + // Possible values: + // "MESSAGE_LEVEL_UNSPECIFIED" + // "ML_FINE" + // "ML_INFO" + // "ML_WARNING" + // "ML_SEVERE" + Level string `json:"level,omitempty"` + + // RequestMetadata: Current request metadata. + RequestMetadata *RequestMetadata `json:"requestMetadata,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ClientInfo") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LogMessageRequest) MarshalJSON() ([]byte, error) { + type noMethod LogMessageRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LogMessageResponse: Response message for LogClientMessage. +type LogMessageResponse struct { + // ResponseMetadata: Current response metadata. + ResponseMetadata *ResponseMetadata `json:"responseMetadata,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ResponseMetadata") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LogMessageResponse) MarshalJSON() ([]byte, error) { + type noMethod LogMessageResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LogUserEventRequest: Request message for LogUserEvent. +type LogUserEventRequest struct { + // EventAction: The action that occurred. + // + // Possible values: + // "EVENT_ACTION_UNSPECIFIED" + // "SMB_CLICKED_FIND_A_PARTNER_BUTTON_BOTTOM" + // "SMB_CLICKED_FIND_A_PARTNER_BUTTON_TOP" + // "AGENCY_CLICKED_JOIN_NOW_BUTTON_BOTTOM" + // "AGENCY_CLICKED_JOIN_NOW_BUTTON_TOP" + // "SMB_CANCELED_PARTNER_CONTACT_FORM" + // "SMB_CLICKED_CONTACT_A_PARTNER" + // "SMB_COMPLETED_PARTNER_CONTACT_FORM" + // "SMB_ENTERED_EMAIL_IN_CONTACT_PARTNER_FORM" + // "SMB_ENTERED_NAME_IN_CONTACT_PARTNER_FORM" + // "SMB_ENTERED_PHONE_IN_CONTACT_PARTNER_FORM" + // "SMB_FAILED_RECAPTCHA_IN_CONTACT_PARTNER_FORM" + // "PARTNER_VIEWED_BY_SMB" + // "SMB_CANCELED_PARTNER_CONTACT_FORM_ON_GPS" + // "SMB_CHANGED_A_SEARCH_PARAMETER_TOP" + // "SMB_CLICKED_CONTACT_A_PARTNER_ON_GPS" + // "SMB_CLICKED_SHOW_MORE_PARTNERS_BUTTON_BOTTOM" + // "SMB_COMPLETED_PARTNER_CONTACT_FORM_ON_GPS" + // "SMB_NO_PARTNERS_AVAILABLE_WITH_SEARCH_CRITERIA" + // "SMB_PERFORMED_SEARCH_ON_GPS" + // "SMB_VIEWED_A_PARTNER_ON_GPS" + // "SMB_CANCELED_PARTNER_CONTACT_FORM_ON_PROFILE_PAGE" + // "SMB_CLICKED_CONTACT_A_PARTNER_ON_PROFILE_PAGE" + // "SMB_CLICKED_PARTNER_WEBSITE" + // "SMB_COMPLETED_PARTNER_CONTACT_FORM_ON_PROFILE_PAGE" + // "SMB_VIEWED_A_PARTNER_PROFILE" + // "AGENCY_CLICKED_ACCEPT_TOS_BUTTON" + // "AGENCY_CHANGED_TOS_COUNTRY" + // "AGENCY_ADDED_ADDRESS_IN_MY_PROFILE_PORTAL" + // "AGENCY_ADDED_PHONE_NUMBER_IN_MY_PROFILE_PORTAL" + // "AGENCY_CHANGED_PRIMARY_ACCOUNT_ASSOCIATION" + // "AGENCY_CHANGED_PRIMARY_COUNTRY_ASSOCIATION" + // "AGENCY_CLICKED_AFFILIATE_BUTTON_IN_MY_PROFILE_IN_PORTAL" + // "AGENCY_CLICKED_GIVE_EDIT_ACCESS_IN_MY_PROFILE_PORTAL" + // "AGENCY_CLICKED_LOG_OUT_IN_MY_PROFILE_PORTAL" + // "AGENCY_CLICKED_MY_PROFILE_LEFT_NAV_IN_PORTAL" + // "AGENCY_CLICKED_SAVE_AND_CONTINUE_AT_BOT_OF_COMPLETE_PROFILE" + // "AGENCY_CLICKED_UNAFFILIATE_IN_MY_PROFILE_PORTAL" + // "AGENCY_FILLED_OUT_COMP_AFFILIATION_IN_MY_PROFILE_PORTAL" + // "AGENCY_SUCCESSFULLY_CONNECTED_WITH_COMPANY_IN_MY_PROFILE" + // "AGENCY_CLICKED_CREATE_MCC_IN_MY_PROFILE_PORTAL" + // "AGENCY_DIDNT_HAVE_AN_MCC_ASSOCIATED_ON_COMPLETE_PROFILE" + // "AGENCY_HAD_AN_MCC_ASSOCIATED_ON_COMPLETE_PROFILE" + // "AGENCY_ADDED_JOB_FUNCTION_IN_MY_PROFILE_PORTAL" + // "AGENCY_LOOKED_AT_JOB_FUNCTION_DROP_DOWN" + // "AGENCY_SELECTED_ACCOUNT_MANAGER_AS_JOB_FUNCTION" + // "AGENCY_SELECTED_ACCOUNT_PLANNER_AS_JOB_FUNCTION" + // "AGENCY_SELECTED_ANALYTICS_AS_JOB_FUNCTION" + // "AGENCY_SELECTED_CREATIVE_AS_JOB_FUNCTION" + // "AGENCY_SELECTED_MEDIA_BUYER_AS_JOB_FUNCTION" + // "AGENCY_SELECTED_MEDIA_PLANNER_AS_JOB_FUNCTION" + // "AGENCY_SELECTED_OTHER_AS_JOB_FUNCTION" + // "AGENCY_SELECTED_PRODUCTION_AS_JOB_FUNCTION" + // "AGENCY_SELECTED_SEO_AS_JOB_FUNCTION" + // "AGENCY_SELECTED_SALES_REP_AS_JOB_FUNCTION" + // "AGENCY_SELECTED_SEARCH_SPECIALIST_AS_JOB_FUNCTION" + // "AGENCY_ADDED_CHANNELS_IN_MY_PROFILE_PORTAL" + // "AGENCY_LOOKED_AT_ADD_CHANNEL_DROP_DOWN" + // "AGENCY_SELECTED_CROSS_CHANNEL_FROM_ADD_CHANNEL" + // "AGENCY_SELECTED_DISPLAY_FROM_ADD_CHANNEL" + // "AGENCY_SELECTED_MOBILE_FROM_ADD_CHANNEL" + // "AGENCY_SELECTED_SEARCH_FROM_ADD_CHANNEL" + // "AGENCY_SELECTED_SOCIAL_FROM_ADD_CHANNEL" + // "AGENCY_SELECTED_TOOLS_FROM_ADD_CHANNEL" + // "AGENCY_SELECTED_YOUTUBE_FROM_ADD_CHANNEL" + // "AGENCY_ADDED_INDUSTRIES_IN_MY_PROFILE_PORTAL" + // "AGENCY_CHANGED_ADD_INDUSTRIES_DROP_DOWN" + // "AGENCY_ADDED_MARKETS_IN_MY_PROFILE_PORTAL" + // "AGENCY_CHANGED_ADD_MARKETS_DROP_DOWN" + // "AGENCY_CHECKED_RECIEVE_MAIL_PROMOTIONS_MYPROFILE" + // "AGENCY_CHECKED_RECIEVE_MAIL_PROMOTIONS_SIGNUP" + // "AGENCY_SELECTED_OPT_IN_BETA_TESTS_AND_MKT_RESEARCH" + // "AGENCY_SELECTED_OPT_IN_BETA_TESTS_IN_MY_PROFILE_PORTAL" + // "AGENCY_SELECTED_OPT_IN_NEWS_IN_MY_PROFILE_PORTAL" + // "AGENCY_SELECTED_OPT_IN_NEWS_INVITATIONS_AND_PROMOS" + // "AGENCY_SELECTED_OPT_IN_PERFORMANCE_SUG_IN_MY_PROFILE_PORTAL" + // "AGENCY_SELECTED_OPT_IN_PERFORMANCE_SUGGESTIONS" + // "AGENCY_SELECTED_OPT_IN_SELECT_ALL_EMAIL_NOTIFICATIONS" + // "AGENCY_SELECTED_SELECT_ALL_OPT_INS_IN_MY_PROFILE_PORTAL" + // "AGENCY_CLICKED_BACK_BUTTON_ON_CONNECT_WITH_COMPANY" + // "AGENCY_CLICKED_CONTINUE_TO_OVERVIEW_ON_CONNECT_WITH_COMPANY" + // "AGECNY_CLICKED_CREATE_MCC_CONNECT_WITH_COMPANY_NOT_FOUND" + // "AGECNY_CLICKED_GIVE_EDIT_ACCESS_CONNECT_WITH_COMPANY_NOT_FOUND" + // "AGECNY_CLICKED_LOG_OUT_CONNECT_WITH_COMPANY_NOT_FOUND" + // "AGENCY_CLICKED_SKIP_FOR_NOW_ON_CONNECT_WITH_COMPANY_PAGE" + // "AGENCY_CLOSED_CONNECTED_TO_COMPANY_X_BUTTON_WRONG_COMPANY" + // "AGENCY_COMPLETED_FIELD_CONNECT_WITH_COMPANY" + // "AGECNY_FOUND_COMPANY_TO_CONNECT_WITH" + // "AGENCY_SUCCESSFULLY_CREATED_COMPANY" + // "AGENCY_ADDED_NEW_COMPANY_LOCATION" + // "AGENCY_CLICKED_COMMUNITY_JOIN_NOW_LINK_IN_PORTAL_NOTIFICATIONS" + // "AGENCY_CLICKED_CONNECT_TO_COMPANY_LINK_IN_PORTAL_NOTIFICATIONS" + // "AGENCY_CLICKED_GET_CERTIFIED_LINK_IN_PORTAL_NOTIFICATIONS" + // + // "AGENCY_CLICKED_GET_VIDEO_ADS_CERTIFIED_LINK_IN_PORTAL_NOTIFICATIONS" + // "AGENCY_CLICKED_LINK_TO_MCC_LINK_IN_PORTAL_NOTIFICATIONS" + // "AGENCY_CLICKED_INSIGHT_CONTENT_IN_PORTAL" + // "AGENCY_CLICKED_INSIGHTS_VIEW_NOW_PITCH_DECKS_IN_PORTAL" + // "AGENCY_CLICKED_INSIGHTS_LEFT_NAV_IN_PORTAL" + // "AGENCY_CLICKED_INSIGHTS_UPLOAD_CONTENT" + // "AGENCY_CLICKED_INSIGHTS_VIEWED_DEPRECATED" + // "AGENCY_CLICKED_COMMUNITY_LEFT_NAV_IN_PORTAL" + // "AGENCY_CLICKED_JOIN_COMMUNITY_BUTTON_COMMUNITY_PORTAL" + // "AGENCY_CLICKED_CERTIFICATIONS_LEFT_NAV_IN_PORTAL" + // "AGENCY_CLICKED_CERTIFICATIONS_PRODUCT_LEFT_NAV_IN_PORTAL" + // "AGENCY_CLICKED_PARTNER_STATUS_LEFT_NAV_IN_PORTAL" + // "AGENCY_CLICKED_PARTNER_STATUS_PRODUCT_LEFT_NAV_IN_PORTAL" + // "AGENCY_CLICKED_OFFERS_LEFT_NAV_IN_PORTAL" + // "AGENCY_CLICKED_SEND_BUTTON_ON_OFFERS_PAGE" + // "AGENCY_CLICKED_EXAM_DETAILS_ON_CERT_ADWORDS_PAGE" + // "AGENCY_CLICKED_SEE_EXAMS_CERTIFICATION_MAIN_PAGE" + // "AGENCY_CLICKED_TAKE_EXAM_ON_CERT_EXAM_PAGE" + // "AGENCY_OPENED_LAST_ADMIN_DIALOG" + // "AGENCY_OPENED_DIALOG_WITH_NO_USERS" + // "AGENCY_PROMOTED_USER_TO_ADMIN" + // "AGENCY_UNAFFILIATED" + // "AGENCY_CHANGED_ROLES" + // "SMB_CLICKED_COMPANY_NAME_LINK_TO_PROFILE" + // "SMB_VIEWED_ADWORDS_CERTIFICATE" + // "SMB_CLICKED_ADWORDS_CERTIFICATE_HELP_ICON" + // "SMB_VIEWED_ANALYTICS_CERTIFICATE" + // "SMB_VIEWED_DOUBLECLICK_CERTIFICATE" + // "SMB_VIEWED_VIDEO_ADS_CERTIFICATE" + // "SMB_VIEWED_SHOPPING_CERTIFICATE" + // "SMB_CLICKED_VIDEO_ADS_CERTIFICATE_HELP_ICON" + // "CLICKED_HELP_AT_BOTTOM" + // "CLICKED_HELP_AT_TOP" + // "CLIENT_ERROR" + // "AGENCY_CLICKED_LEFT_NAV_STORIES" + // "CLICKED" + // "SMB_VIEWED_MOBILE_CERTIFICATE" + // "AGENCY_FAILED_COMPANY_VERIFICATION" + // "VISITED_LANDING" + // "VISITED_GPS" + // "VISITED_AGENCY_PORTAL" + // "CANCELLED_INDIVIDUAL_SIGN_UP" + // "CANCELLED_COMPANY_SIGN_UP" + // "AGENCY_CLICKED_SIGN_IN_BUTTON_TOP" + // "AGENCY_CLICKED_SAVE_AND_CONTINUE_AT_BOT_OF_INCOMPLETE_PROFILE" + // "AGENCY_UNSELECTED_OPT_IN_NEWS_INVITATIONS_AND_PROMOS" + // "AGENCY_UNSELECTED_OPT_IN_BETA_TESTS_AND_MKT_RESEARCH" + // "AGENCY_UNSELECTED_OPT_IN_PERFORMANCE_SUGGESTIONS" + // "AGENCY_SELECTED_OPT_OUT_UNSELECT_ALL_EMAIL_NOTIFICATIONS" + // "AGENCY_LINKED_INDIVIDUAL_MCC" + // "AGENCY_SUGGESTED_TO_USER" + // "AGENCY_IGNORED_SUGGESTED_AGENCIES_AND_SEARCHED" + // "AGENCY_PICKED_SUGGESTED_AGENCY" + // "AGENCY_SEARCHED_FOR_AGENCIES" + // "AGENCY_PICKED_SEARCHED_AGENCY" + // "AGENCY_DISMISSED_AFFILIATION_WIDGET" + // "AGENCY_CLICKED_INSIGHTS_DOWNLOAD_CONTENT" + // "AGENCY_PROGRESS_INSIGHTS_VIEW_CONTENT" + // "AGENCY_CLICKED_CANCEL_ACCEPT_TOS_BUTTON" + // "SMB_ENTERED_WEBSITE_IN_CONTACT_PARTNER_FORM" + EventAction string `json:"eventAction,omitempty"` + + // EventCategory: The category the action belongs to. + // + // Possible values: + // "EVENT_CATEGORY_UNSPECIFIED" + // "GOOGLE_PARTNER_SEARCH" + // "GOOGLE_PARTNER_SIGNUP_FLOW" + // "GOOGLE_PARTNER_PORTAL" + // "GOOGLE_PARTNER_PORTAL_MY_PROFILE" + // "GOOGLE_PARTNER_PORTAL_CERTIFICATIONS" + // "GOOGLE_PARTNER_PORTAL_COMMUNITY" + // "GOOGLE_PARTNER_PORTAL_INSIGHTS" + // "GOOGLE_PARTNER_PORTAL_CLIENTS" + // "GOOGLE_PARTNER_PUBLIC_USER_PROFILE" + // "GOOGLE_PARTNER_PANEL" + // "GOOGLE_PARTNER_PORTAL_LAST_ADMIN_DIALOG" + // "GOOGLE_PARTNER_CLIENT" + // "GOOGLE_PARTNER_PORTAL_COMPANY_PROFILE" + // "EXTERNAL_LINKS" + // "GOOGLE_PARTNER_LANDING" + EventCategory string `json:"eventCategory,omitempty"` + + // EventDatas: List of event data for the event. + EventDatas []*EventData `json:"eventDatas,omitempty"` + + // EventScope: The scope of the event. + // + // Possible values: + // "EVENT_SCOPE_UNSPECIFIED" + // "VISITOR" + // "SESSION" + // "PAGE" + EventScope string `json:"eventScope,omitempty"` + + // Lead: Advertiser lead information. + Lead *Lead `json:"lead,omitempty"` + + // RequestMetadata: Current request metadata. + RequestMetadata *RequestMetadata `json:"requestMetadata,omitempty"` + + // Url: The URL where the event occurred. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "EventAction") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LogUserEventRequest) MarshalJSON() ([]byte, error) { + type noMethod LogUserEventRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LogUserEventResponse: Response message for LogUserEvent. +type LogUserEventResponse struct { + // ResponseMetadata: Current response metadata. + ResponseMetadata *ResponseMetadata `json:"responseMetadata,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ResponseMetadata") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LogUserEventResponse) MarshalJSON() ([]byte, error) { + type noMethod LogUserEventResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Money: Represents an amount of money with its currency type. +type Money struct { + // CurrencyCode: The 3-letter currency code defined in ISO 4217. + CurrencyCode string `json:"currencyCode,omitempty"` + + // Nanos: Number of nano (10^-9) units of the amount. The value must be + // between -999,999,999 and +999,999,999 inclusive. If `units` is + // positive, `nanos` must be positive or zero. If `units` is zero, + // `nanos` can be positive, zero, or negative. If `units` is negative, + // `nanos` must be negative or zero. For example $-1.75 is represented + // as `units`=-1 and `nanos`=-750,000,000. + Nanos int64 `json:"nanos,omitempty"` + + // Units: The whole units of the amount. For example if `currencyCode` + // is "USD", then 1 unit is one US dollar. + Units int64 `json:"units,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "CurrencyCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Money) MarshalJSON() ([]byte, error) { + type noMethod Money + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PublicProfile: Basic information from a public profile. +type PublicProfile struct { + // DisplayImageUrl: The URL to the main display image of the public + // profile. + DisplayImageUrl string `json:"displayImageUrl,omitempty"` + + // DisplayName: The display name of the public profile. + DisplayName string `json:"displayName,omitempty"` + + // Id: The ID which can be used to retrieve more details about the + // public profile. + Id string `json:"id,omitempty"` + + // Url: The URL of the public profile. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DisplayImageUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PublicProfile) MarshalJSON() ([]byte, error) { + type noMethod PublicProfile + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Rank: Information related to ranking of results. +type Rank struct { + // Type: The type of rank. + // + // Possible values: + // "RANK_TYPE_UNSPECIFIED" + // "RT_FINAL_SCORE" + Type string `json:"type,omitempty"` + + // Value: The numerical value of the rank. + Value float64 `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Type") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Rank) MarshalJSON() ([]byte, error) { + type noMethod Rank + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RecaptchaChallenge: reCaptcha challenge info. +type RecaptchaChallenge struct { + // Id: The ID of the reCaptcha challenge. + Id string `json:"id,omitempty"` + + // Response: The response to the reCaptcha challenge. + Response string `json:"response,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RecaptchaChallenge) MarshalJSON() ([]byte, error) { + type noMethod RecaptchaChallenge + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RequestMetadata: Common data that is in each API request. +type RequestMetadata struct { + // ExperimentIds: Experiment IDs the current request belongs to. + ExperimentIds []string `json:"experimentIds,omitempty"` + + // Locale: Locale to use for the current request. + Locale string `json:"locale,omitempty"` + + // PartnersSessionId: Google Partners session ID. + PartnersSessionId string `json:"partnersSessionId,omitempty"` + + // TrafficSource: Source of traffic for the current request. + TrafficSource *TrafficSource `json:"trafficSource,omitempty"` + + // UserOverrides: Values to use instead of the user's respective + // defaults for the current request. These are only honored by + // whitelisted products. + UserOverrides *UserOverrides `json:"userOverrides,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ExperimentIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RequestMetadata) MarshalJSON() ([]byte, error) { + type noMethod RequestMetadata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ResponseMetadata: Common data that is in each API response. +type ResponseMetadata struct { + // DebugInfo: Debug information about this request. + DebugInfo *DebugInfo `json:"debugInfo,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DebugInfo") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResponseMetadata) MarshalJSON() ([]byte, error) { + type noMethod ResponseMetadata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TrafficSource: Source of traffic for the current request. +type TrafficSource struct { + // TrafficSourceId: Identifier to indicate where the traffic comes from. + // An identifier has multiple letters created by a team which redirected + // the traffic to us. + TrafficSourceId string `json:"trafficSourceId,omitempty"` + + // TrafficSubId: Second level identifier to indicate where the traffic + // comes from. An identifier has multiple letters created by a team + // which redirected the traffic to us. + TrafficSubId string `json:"trafficSubId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "TrafficSourceId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TrafficSource) MarshalJSON() ([]byte, error) { + type noMethod TrafficSource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserOverrides: Values to use instead of the user's respective +// defaults. These are only honored by whitelisted products. +type UserOverrides struct { + // IpAddress: IP address to use instead of the user's geo-located IP + // address. + IpAddress string `json:"ipAddress,omitempty"` + + // UserId: Logged-in user ID to impersonate instead of the user's ID. + UserId string `json:"userId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "IpAddress") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserOverrides) MarshalJSON() ([]byte, error) { + type noMethod UserOverrides + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "partners.clientMessages.log": + +type ClientMessagesLogCall struct { + s *Service + logmessagerequest *LogMessageRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Log: Logs a generic message from the client, such as `Failed to +// render component`, `Profile page is running slow`, `More than 500 +// users have accessed this result.`, etc. +func (r *ClientMessagesService) Log(logmessagerequest *LogMessageRequest) *ClientMessagesLogCall { + c := &ClientMessagesLogCall{s: r.s, opt_: make(map[string]interface{})} + c.logmessagerequest = logmessagerequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ClientMessagesLogCall) Fields(s ...googleapi.Field) *ClientMessagesLogCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ClientMessagesLogCall) Context(ctx context.Context) *ClientMessagesLogCall { + c.ctx_ = ctx + return c +} + +func (c *ClientMessagesLogCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logmessagerequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/clientMessages:log") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "partners.clientMessages.log" call. +// Exactly one of *LogMessageResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *LogMessageResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ClientMessagesLogCall) Do() (*LogMessageResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LogMessageResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Logs a generic message from the client, such as `Failed to render component`, `Profile page is running slow`, `More than 500 users have accessed this result.`, etc.", + // "httpMethod": "POST", + // "id": "partners.clientMessages.log", + // "path": "v2/clientMessages:log", + // "request": { + // "$ref": "LogMessageRequest" + // }, + // "response": { + // "$ref": "LogMessageResponse" + // } + // } + +} + +// method id "partners.companies.get": + +type CompaniesGetCall struct { + s *Service + companyId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a company. +func (r *CompaniesService) Get(companyId string) *CompaniesGetCall { + c := &CompaniesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.companyId = companyId + return c +} + +// Address sets the optional parameter "address": The address to use for +// sorting the company's addresses by proximity. If not given, the +// geo-located address of the request is used. Used when order_by is +// set. +func (c *CompaniesGetCall) Address(address string) *CompaniesGetCall { + c.opt_["address"] = address + return c +} + +// CurrencyCode sets the optional parameter "currencyCode": If the +// company's budget is in a different currency code than this one, then +// the converted budget is converted to this currency code. +func (c *CompaniesGetCall) CurrencyCode(currencyCode string) *CompaniesGetCall { + c.opt_["currencyCode"] = currencyCode + return c +} + +// OrderBy sets the optional parameter "orderBy": How to order addresses +// within the returned company. Currently, only `address` and `address +// desc` is supported which will sorted by closest to farthest in +// distance from given address and farthest to closest distance from +// given address respectively. +func (c *CompaniesGetCall) OrderBy(orderBy string) *CompaniesGetCall { + c.opt_["orderBy"] = orderBy + return c +} + +// RequestMetadataExperimentIds sets the optional parameter +// "requestMetadata.experimentIds": Experiment IDs the current request +// belongs to. +func (c *CompaniesGetCall) RequestMetadataExperimentIds(requestMetadataExperimentIds string) *CompaniesGetCall { + c.opt_["requestMetadata.experimentIds"] = requestMetadataExperimentIds + return c +} + +// RequestMetadataLocale sets the optional parameter +// "requestMetadata.locale": Locale to use for the current request. +func (c *CompaniesGetCall) RequestMetadataLocale(requestMetadataLocale string) *CompaniesGetCall { + c.opt_["requestMetadata.locale"] = requestMetadataLocale + return c +} + +// RequestMetadataPartnersSessionId sets the optional parameter +// "requestMetadata.partnersSessionId": Google Partners session ID. +func (c *CompaniesGetCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *CompaniesGetCall { + c.opt_["requestMetadata.partnersSessionId"] = requestMetadataPartnersSessionId + return c +} + +// RequestMetadataTrafficSourceTrafficSourceId sets the optional +// parameter "requestMetadata.trafficSource.trafficSourceId": Identifier +// to indicate where the traffic comes from. An identifier has multiple +// letters created by a team which redirected the traffic to us. +func (c *CompaniesGetCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *CompaniesGetCall { + c.opt_["requestMetadata.trafficSource.trafficSourceId"] = requestMetadataTrafficSourceTrafficSourceId + return c +} + +// RequestMetadataTrafficSourceTrafficSubId sets the optional parameter +// "requestMetadata.trafficSource.trafficSubId": Second level identifier +// to indicate where the traffic comes from. An identifier has multiple +// letters created by a team which redirected the traffic to us. +func (c *CompaniesGetCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *CompaniesGetCall { + c.opt_["requestMetadata.trafficSource.trafficSubId"] = requestMetadataTrafficSourceTrafficSubId + return c +} + +// RequestMetadataUserOverridesIpAddress sets the optional parameter +// "requestMetadata.userOverrides.ipAddress": IP address to use instead +// of the user's geo-located IP address. +func (c *CompaniesGetCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *CompaniesGetCall { + c.opt_["requestMetadata.userOverrides.ipAddress"] = requestMetadataUserOverridesIpAddress + return c +} + +// RequestMetadataUserOverridesUserId sets the optional parameter +// "requestMetadata.userOverrides.userId": Logged-in user ID to +// impersonate instead of the user's ID. +func (c *CompaniesGetCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *CompaniesGetCall { + c.opt_["requestMetadata.userOverrides.userId"] = requestMetadataUserOverridesUserId + return c +} + +// View sets the optional parameter "view": The view of `Company` +// resource to be returned. This must not be `COMPANY_VIEW_UNSPECIFIED`. +// +// Possible values: +// "COMPANY_VIEW_UNSPECIFIED" +// "CV_GOOGLE_PARTNER_SEARCH" +func (c *CompaniesGetCall) View(view string) *CompaniesGetCall { + c.opt_["view"] = view + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CompaniesGetCall) Fields(s ...googleapi.Field) *CompaniesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CompaniesGetCall) IfNoneMatch(entityTag string) *CompaniesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CompaniesGetCall) Context(ctx context.Context) *CompaniesGetCall { + c.ctx_ = ctx + return c +} + +func (c *CompaniesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["address"]; ok { + params.Set("address", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["currencyCode"]; ok { + params.Set("currencyCode", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["requestMetadata.experimentIds"]; ok { + params.Set("requestMetadata.experimentIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["requestMetadata.locale"]; ok { + params.Set("requestMetadata.locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["requestMetadata.partnersSessionId"]; ok { + params.Set("requestMetadata.partnersSessionId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["requestMetadata.trafficSource.trafficSourceId"]; ok { + params.Set("requestMetadata.trafficSource.trafficSourceId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["requestMetadata.trafficSource.trafficSubId"]; ok { + params.Set("requestMetadata.trafficSource.trafficSubId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["requestMetadata.userOverrides.ipAddress"]; ok { + params.Set("requestMetadata.userOverrides.ipAddress", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["requestMetadata.userOverrides.userId"]; ok { + params.Set("requestMetadata.userOverrides.userId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/companies/{companyId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "companyId": c.companyId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "partners.companies.get" call. +// Exactly one of *GetCompanyResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GetCompanyResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CompaniesGetCall) Do() (*GetCompanyResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &GetCompanyResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a company.", + // "httpMethod": "GET", + // "id": "partners.companies.get", + // "parameterOrder": [ + // "companyId" + // ], + // "parameters": { + // "address": { + // "description": "The address to use for sorting the company's addresses by proximity. If not given, the geo-located address of the request is used. Used when order_by is set.", + // "location": "query", + // "type": "string" + // }, + // "companyId": { + // "description": "The ID of the company to retrieve.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "currencyCode": { + // "description": "If the company's budget is in a different currency code than this one, then the converted budget is converted to this currency code.", + // "location": "query", + // "type": "string" + // }, + // "orderBy": { + // "description": "How to order addresses within the returned company. Currently, only `address` and `address desc` is supported which will sorted by closest to farthest in distance from given address and farthest to closest distance from given address respectively.", + // "location": "query", + // "type": "string" + // }, + // "requestMetadata.experimentIds": { + // "description": "Experiment IDs the current request belongs to.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "requestMetadata.locale": { + // "description": "Locale to use for the current request.", + // "location": "query", + // "type": "string" + // }, + // "requestMetadata.partnersSessionId": { + // "description": "Google Partners session ID.", + // "location": "query", + // "type": "string" + // }, + // "requestMetadata.trafficSource.trafficSourceId": { + // "description": "Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us.", + // "location": "query", + // "type": "string" + // }, + // "requestMetadata.trafficSource.trafficSubId": { + // "description": "Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us.", + // "location": "query", + // "type": "string" + // }, + // "requestMetadata.userOverrides.ipAddress": { + // "description": "IP address to use instead of the user's geo-located IP address.", + // "location": "query", + // "type": "string" + // }, + // "requestMetadata.userOverrides.userId": { + // "description": "Logged-in user ID to impersonate instead of the user's ID.", + // "location": "query", + // "type": "string" + // }, + // "view": { + // "description": "The view of `Company` resource to be returned. This must not be `COMPANY_VIEW_UNSPECIFIED`.", + // "enum": [ + // "COMPANY_VIEW_UNSPECIFIED", + // "CV_GOOGLE_PARTNER_SEARCH" + // ], + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/companies/{companyId}", + // "response": { + // "$ref": "GetCompanyResponse" + // } + // } + +} + +// method id "partners.companies.list": + +type CompaniesListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists companies. +func (r *CompaniesService) List() *CompaniesListCall { + c := &CompaniesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Address sets the optional parameter "address": The address to use +// when searching for companies. If not given, the geo-located address +// of the request is used. +func (c *CompaniesListCall) Address(address string) *CompaniesListCall { + c.opt_["address"] = address + return c +} + +// CompanyName sets the optional parameter "companyName": Company name +// to search for. +func (c *CompaniesListCall) CompanyName(companyName string) *CompaniesListCall { + c.opt_["companyName"] = companyName + return c +} + +// GpsMotivations sets the optional parameter "gpsMotivations": List of +// reasons for using Google Partner Search to get companies. +// +// Possible values: +// "GPS_MOTIVATION_UNSPECIFIED" +// "GPSM_HELP_WITH_ADVERTISING" +// "GPSM_HELP_WITH_WEBSITE" +// "GPSM_NO_WEBSITE" +func (c *CompaniesListCall) GpsMotivations(gpsMotivations string) *CompaniesListCall { + c.opt_["gpsMotivations"] = gpsMotivations + return c +} + +// Industries sets the optional parameter "industries": List of +// industries the company can help with. +// +// Possible values: +// "INDUSTRY_UNSPECIFIED" +// "I_AUTOMOTIVE" +// "I_BUSINESS_TO_BUSINESS" +// "I_CONSUMER_PACKAGED_GOODS" +// "I_EDUCATION" +// "I_FINANCE" +// "I_HEALTHCARE" +// "I_MEDIA_AND_ENTERTAINMENT" +// "I_RETAIL" +// "I_TECHNOLOGY" +// "I_TRAVEL" +func (c *CompaniesListCall) Industries(industries string) *CompaniesListCall { + c.opt_["industries"] = industries + return c +} + +// LanguageCodes sets the optional parameter "languageCodes": List of +// language codes that company can support. Only primary language +// subtags are accepted as defined by BCP 47 (IETF BCP 47, "Tags for +// Identifying Languages"). +func (c *CompaniesListCall) LanguageCodes(languageCodes string) *CompaniesListCall { + c.opt_["languageCodes"] = languageCodes + return c +} + +// MaxMonthlyBudgetCurrencyCode sets the optional parameter +// "maxMonthlyBudget.currencyCode": The 3-letter currency code defined +// in ISO 4217. +func (c *CompaniesListCall) MaxMonthlyBudgetCurrencyCode(maxMonthlyBudgetCurrencyCode string) *CompaniesListCall { + c.opt_["maxMonthlyBudget.currencyCode"] = maxMonthlyBudgetCurrencyCode + return c +} + +// MaxMonthlyBudgetNanos sets the optional parameter +// "maxMonthlyBudget.nanos": Number of nano (10^-9) units of the amount. +// The value must be between -999,999,999 and +999,999,999 inclusive. If +// `units` is positive, `nanos` must be positive or zero. If `units` is +// zero, `nanos` can be positive, zero, or negative. If `units` is +// negative, `nanos` must be negative or zero. For example $-1.75 is +// represented as `units`=-1 and `nanos`=-750,000,000. +func (c *CompaniesListCall) MaxMonthlyBudgetNanos(maxMonthlyBudgetNanos int64) *CompaniesListCall { + c.opt_["maxMonthlyBudget.nanos"] = maxMonthlyBudgetNanos + return c +} + +// MaxMonthlyBudgetUnits sets the optional parameter +// "maxMonthlyBudget.units": The whole units of the amount. For example +// if `currencyCode` is "USD", then 1 unit is one US dollar. +func (c *CompaniesListCall) MaxMonthlyBudgetUnits(maxMonthlyBudgetUnits int64) *CompaniesListCall { + c.opt_["maxMonthlyBudget.units"] = maxMonthlyBudgetUnits + return c +} + +// MinMonthlyBudgetCurrencyCode sets the optional parameter +// "minMonthlyBudget.currencyCode": The 3-letter currency code defined +// in ISO 4217. +func (c *CompaniesListCall) MinMonthlyBudgetCurrencyCode(minMonthlyBudgetCurrencyCode string) *CompaniesListCall { + c.opt_["minMonthlyBudget.currencyCode"] = minMonthlyBudgetCurrencyCode + return c +} + +// MinMonthlyBudgetNanos sets the optional parameter +// "minMonthlyBudget.nanos": Number of nano (10^-9) units of the amount. +// The value must be between -999,999,999 and +999,999,999 inclusive. If +// `units` is positive, `nanos` must be positive or zero. If `units` is +// zero, `nanos` can be positive, zero, or negative. If `units` is +// negative, `nanos` must be negative or zero. For example $-1.75 is +// represented as `units`=-1 and `nanos`=-750,000,000. +func (c *CompaniesListCall) MinMonthlyBudgetNanos(minMonthlyBudgetNanos int64) *CompaniesListCall { + c.opt_["minMonthlyBudget.nanos"] = minMonthlyBudgetNanos + return c +} + +// MinMonthlyBudgetUnits sets the optional parameter +// "minMonthlyBudget.units": The whole units of the amount. For example +// if `currencyCode` is "USD", then 1 unit is one US dollar. +func (c *CompaniesListCall) MinMonthlyBudgetUnits(minMonthlyBudgetUnits int64) *CompaniesListCall { + c.opt_["minMonthlyBudget.units"] = minMonthlyBudgetUnits + return c +} + +// OrderBy sets the optional parameter "orderBy": How to order addresses +// within the returned companies. Currently, only `address` and `address +// desc` is supported which will sorted by closest to farthest in +// distance from given address and farthest to closest distance from +// given address respectively. +func (c *CompaniesListCall) OrderBy(orderBy string) *CompaniesListCall { + c.opt_["orderBy"] = orderBy + return c +} + +// PageSize sets the optional parameter "pageSize": Requested page size. +// Server may return fewer companies than requested. If unspecified, +// server picks an appropriate default. +func (c *CompaniesListCall) PageSize(pageSize int64) *CompaniesListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": A token +// identifying a page of results that the server returns. Typically, +// this is the value of `ListCompaniesResponse.next_page_token` returned +// from the previous call to ListCompanies. +func (c *CompaniesListCall) PageToken(pageToken string) *CompaniesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// RequestMetadataExperimentIds sets the optional parameter +// "requestMetadata.experimentIds": Experiment IDs the current request +// belongs to. +func (c *CompaniesListCall) RequestMetadataExperimentIds(requestMetadataExperimentIds string) *CompaniesListCall { + c.opt_["requestMetadata.experimentIds"] = requestMetadataExperimentIds + return c +} + +// RequestMetadataLocale sets the optional parameter +// "requestMetadata.locale": Locale to use for the current request. +func (c *CompaniesListCall) RequestMetadataLocale(requestMetadataLocale string) *CompaniesListCall { + c.opt_["requestMetadata.locale"] = requestMetadataLocale + return c +} + +// RequestMetadataPartnersSessionId sets the optional parameter +// "requestMetadata.partnersSessionId": Google Partners session ID. +func (c *CompaniesListCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *CompaniesListCall { + c.opt_["requestMetadata.partnersSessionId"] = requestMetadataPartnersSessionId + return c +} + +// RequestMetadataTrafficSourceTrafficSourceId sets the optional +// parameter "requestMetadata.trafficSource.trafficSourceId": Identifier +// to indicate where the traffic comes from. An identifier has multiple +// letters created by a team which redirected the traffic to us. +func (c *CompaniesListCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *CompaniesListCall { + c.opt_["requestMetadata.trafficSource.trafficSourceId"] = requestMetadataTrafficSourceTrafficSourceId + return c +} + +// RequestMetadataTrafficSourceTrafficSubId sets the optional parameter +// "requestMetadata.trafficSource.trafficSubId": Second level identifier +// to indicate where the traffic comes from. An identifier has multiple +// letters created by a team which redirected the traffic to us. +func (c *CompaniesListCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *CompaniesListCall { + c.opt_["requestMetadata.trafficSource.trafficSubId"] = requestMetadataTrafficSourceTrafficSubId + return c +} + +// RequestMetadataUserOverridesIpAddress sets the optional parameter +// "requestMetadata.userOverrides.ipAddress": IP address to use instead +// of the user's geo-located IP address. +func (c *CompaniesListCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *CompaniesListCall { + c.opt_["requestMetadata.userOverrides.ipAddress"] = requestMetadataUserOverridesIpAddress + return c +} + +// RequestMetadataUserOverridesUserId sets the optional parameter +// "requestMetadata.userOverrides.userId": Logged-in user ID to +// impersonate instead of the user's ID. +func (c *CompaniesListCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *CompaniesListCall { + c.opt_["requestMetadata.userOverrides.userId"] = requestMetadataUserOverridesUserId + return c +} + +// Services sets the optional parameter "services": List of services the +// company can help with. +// +// Possible values: +// "SERVICE_UNSPECIFIED" +// "S_ADVANCED_ADWORDS_SUPPORT" +// "S_ADVERTISING_ON_GOOGLE" +// "S_AN_ENHANCED_WEBSITE" +// "S_AN_ONLINE_MARKETING_PLAN" +// "S_MOBILE_AND_VIDEO_ADS" +func (c *CompaniesListCall) Services(services string) *CompaniesListCall { + c.opt_["services"] = services + return c +} + +// View sets the optional parameter "view": The view of the `Company` +// resource to be returned. This must not be `COMPANY_VIEW_UNSPECIFIED`. +// +// Possible values: +// "COMPANY_VIEW_UNSPECIFIED" +// "CV_GOOGLE_PARTNER_SEARCH" +func (c *CompaniesListCall) View(view string) *CompaniesListCall { + c.opt_["view"] = view + return c +} + +// WebsiteUrl sets the optional parameter "websiteUrl": Website URL that +// will help to find a better matched company. . +func (c *CompaniesListCall) WebsiteUrl(websiteUrl string) *CompaniesListCall { + c.opt_["websiteUrl"] = websiteUrl + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CompaniesListCall) Fields(s ...googleapi.Field) *CompaniesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CompaniesListCall) IfNoneMatch(entityTag string) *CompaniesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CompaniesListCall) Context(ctx context.Context) *CompaniesListCall { + c.ctx_ = ctx + return c +} + +func (c *CompaniesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["address"]; ok { + params.Set("address", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["companyName"]; ok { + params.Set("companyName", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["gpsMotivations"]; ok { + params.Set("gpsMotivations", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["industries"]; ok { + params.Set("industries", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["languageCodes"]; ok { + params.Set("languageCodes", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxMonthlyBudget.currencyCode"]; ok { + params.Set("maxMonthlyBudget.currencyCode", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxMonthlyBudget.nanos"]; ok { + params.Set("maxMonthlyBudget.nanos", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["maxMonthlyBudget.units"]; ok { + params.Set("maxMonthlyBudget.units", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["minMonthlyBudget.currencyCode"]; ok { + params.Set("minMonthlyBudget.currencyCode", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["minMonthlyBudget.nanos"]; ok { + params.Set("minMonthlyBudget.nanos", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["minMonthlyBudget.units"]; ok { + params.Set("minMonthlyBudget.units", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["orderBy"]; ok { + params.Set("orderBy", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["requestMetadata.experimentIds"]; ok { + params.Set("requestMetadata.experimentIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["requestMetadata.locale"]; ok { + params.Set("requestMetadata.locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["requestMetadata.partnersSessionId"]; ok { + params.Set("requestMetadata.partnersSessionId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["requestMetadata.trafficSource.trafficSourceId"]; ok { + params.Set("requestMetadata.trafficSource.trafficSourceId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["requestMetadata.trafficSource.trafficSubId"]; ok { + params.Set("requestMetadata.trafficSource.trafficSubId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["requestMetadata.userOverrides.ipAddress"]; ok { + params.Set("requestMetadata.userOverrides.ipAddress", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["requestMetadata.userOverrides.userId"]; ok { + params.Set("requestMetadata.userOverrides.userId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["services"]; ok { + params.Set("services", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["view"]; ok { + params.Set("view", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["websiteUrl"]; ok { + params.Set("websiteUrl", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/companies") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "partners.companies.list" call. +// Exactly one of *ListCompaniesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListCompaniesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CompaniesListCall) Do() (*ListCompaniesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListCompaniesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists companies.", + // "httpMethod": "GET", + // "id": "partners.companies.list", + // "parameters": { + // "address": { + // "description": "The address to use when searching for companies. If not given, the geo-located address of the request is used.", + // "location": "query", + // "type": "string" + // }, + // "companyName": { + // "description": "Company name to search for.", + // "location": "query", + // "type": "string" + // }, + // "gpsMotivations": { + // "description": "List of reasons for using Google Partner Search to get companies.", + // "enum": [ + // "GPS_MOTIVATION_UNSPECIFIED", + // "GPSM_HELP_WITH_ADVERTISING", + // "GPSM_HELP_WITH_WEBSITE", + // "GPSM_NO_WEBSITE" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "industries": { + // "description": "List of industries the company can help with.", + // "enum": [ + // "INDUSTRY_UNSPECIFIED", + // "I_AUTOMOTIVE", + // "I_BUSINESS_TO_BUSINESS", + // "I_CONSUMER_PACKAGED_GOODS", + // "I_EDUCATION", + // "I_FINANCE", + // "I_HEALTHCARE", + // "I_MEDIA_AND_ENTERTAINMENT", + // "I_RETAIL", + // "I_TECHNOLOGY", + // "I_TRAVEL" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "languageCodes": { + // "description": "List of language codes that company can support. Only primary language subtags are accepted as defined by BCP 47 (IETF BCP 47, \"Tags for Identifying Languages\").", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "maxMonthlyBudget.currencyCode": { + // "description": "The 3-letter currency code defined in ISO 4217.", + // "location": "query", + // "type": "string" + // }, + // "maxMonthlyBudget.nanos": { + // "description": "Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "maxMonthlyBudget.units": { + // "description": "The whole units of the amount. For example if `currencyCode` is `\"USD\"`, then 1 unit is one US dollar.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "minMonthlyBudget.currencyCode": { + // "description": "The 3-letter currency code defined in ISO 4217.", + // "location": "query", + // "type": "string" + // }, + // "minMonthlyBudget.nanos": { + // "description": "Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "minMonthlyBudget.units": { + // "description": "The whole units of the amount. For example if `currencyCode` is `\"USD\"`, then 1 unit is one US dollar.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "orderBy": { + // "description": "How to order addresses within the returned companies. Currently, only `address` and `address desc` is supported which will sorted by closest to farthest in distance from given address and farthest to closest distance from given address respectively.", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "Requested page size. Server may return fewer companies than requested. If unspecified, server picks an appropriate default.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A token identifying a page of results that the server returns. Typically, this is the value of `ListCompaniesResponse.next_page_token` returned from the previous call to ListCompanies.", + // "location": "query", + // "type": "string" + // }, + // "requestMetadata.experimentIds": { + // "description": "Experiment IDs the current request belongs to.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "requestMetadata.locale": { + // "description": "Locale to use for the current request.", + // "location": "query", + // "type": "string" + // }, + // "requestMetadata.partnersSessionId": { + // "description": "Google Partners session ID.", + // "location": "query", + // "type": "string" + // }, + // "requestMetadata.trafficSource.trafficSourceId": { + // "description": "Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us.", + // "location": "query", + // "type": "string" + // }, + // "requestMetadata.trafficSource.trafficSubId": { + // "description": "Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us.", + // "location": "query", + // "type": "string" + // }, + // "requestMetadata.userOverrides.ipAddress": { + // "description": "IP address to use instead of the user's geo-located IP address.", + // "location": "query", + // "type": "string" + // }, + // "requestMetadata.userOverrides.userId": { + // "description": "Logged-in user ID to impersonate instead of the user's ID.", + // "location": "query", + // "type": "string" + // }, + // "services": { + // "description": "List of services the company can help with.", + // "enum": [ + // "SERVICE_UNSPECIFIED", + // "S_ADVANCED_ADWORDS_SUPPORT", + // "S_ADVERTISING_ON_GOOGLE", + // "S_AN_ENHANCED_WEBSITE", + // "S_AN_ONLINE_MARKETING_PLAN", + // "S_MOBILE_AND_VIDEO_ADS" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "view": { + // "description": "The view of the `Company` resource to be returned. This must not be `COMPANY_VIEW_UNSPECIFIED`.", + // "enum": [ + // "COMPANY_VIEW_UNSPECIFIED", + // "CV_GOOGLE_PARTNER_SEARCH" + // ], + // "location": "query", + // "type": "string" + // }, + // "websiteUrl": { + // "description": "Website URL that will help to find a better matched company. .", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/companies", + // "response": { + // "$ref": "ListCompaniesResponse" + // } + // } + +} + +// method id "partners.companies.leads.create": + +type CompaniesLeadsCreateCall struct { + s *Service + companyId string + createleadrequest *CreateLeadRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates an advertiser lead for the given company ID. +func (r *CompaniesLeadsService) Create(companyId string, createleadrequest *CreateLeadRequest) *CompaniesLeadsCreateCall { + c := &CompaniesLeadsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.companyId = companyId + c.createleadrequest = createleadrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CompaniesLeadsCreateCall) Fields(s ...googleapi.Field) *CompaniesLeadsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CompaniesLeadsCreateCall) Context(ctx context.Context) *CompaniesLeadsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *CompaniesLeadsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.createleadrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/companies/{companyId}/leads") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "companyId": c.companyId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "partners.companies.leads.create" call. +// Exactly one of *CreateLeadResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *CreateLeadResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *CompaniesLeadsCreateCall) Do() (*CreateLeadResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreateLeadResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an advertiser lead for the given company ID.", + // "httpMethod": "POST", + // "id": "partners.companies.leads.create", + // "parameterOrder": [ + // "companyId" + // ], + // "parameters": { + // "companyId": { + // "description": "The ID of the company to contact.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/companies/{companyId}/leads", + // "request": { + // "$ref": "CreateLeadRequest" + // }, + // "response": { + // "$ref": "CreateLeadResponse" + // } + // } + +} + +// method id "partners.userEvents.log": + +type UserEventsLogCall struct { + s *Service + logusereventrequest *LogUserEventRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Log: Logs a user event. +func (r *UserEventsService) Log(logusereventrequest *LogUserEventRequest) *UserEventsLogCall { + c := &UserEventsLogCall{s: r.s, opt_: make(map[string]interface{})} + c.logusereventrequest = logusereventrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserEventsLogCall) Fields(s ...googleapi.Field) *UserEventsLogCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserEventsLogCall) Context(ctx context.Context) *UserEventsLogCall { + c.ctx_ = ctx + return c +} + +func (c *UserEventsLogCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.logusereventrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/userEvents:log") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "partners.userEvents.log" call. +// Exactly one of *LogUserEventResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *LogUserEventResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UserEventsLogCall) Do() (*LogUserEventResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LogUserEventResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Logs a user event.", + // "httpMethod": "POST", + // "id": "partners.userEvents.log", + // "path": "v2/userEvents:log", + // "request": { + // "$ref": "LogUserEventRequest" + // }, + // "response": { + // "$ref": "LogUserEventResponse" + // } + // } + +} + +// method id "partners.userStates.list": + +type UserStatesListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists states for current user. +func (r *UserStatesService) List() *UserStatesListCall { + c := &UserStatesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// RequestMetadataExperimentIds sets the optional parameter +// "requestMetadata.experimentIds": Experiment IDs the current request +// belongs to. +func (c *UserStatesListCall) RequestMetadataExperimentIds(requestMetadataExperimentIds string) *UserStatesListCall { + c.opt_["requestMetadata.experimentIds"] = requestMetadataExperimentIds + return c +} + +// RequestMetadataLocale sets the optional parameter +// "requestMetadata.locale": Locale to use for the current request. +func (c *UserStatesListCall) RequestMetadataLocale(requestMetadataLocale string) *UserStatesListCall { + c.opt_["requestMetadata.locale"] = requestMetadataLocale + return c +} + +// RequestMetadataPartnersSessionId sets the optional parameter +// "requestMetadata.partnersSessionId": Google Partners session ID. +func (c *UserStatesListCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *UserStatesListCall { + c.opt_["requestMetadata.partnersSessionId"] = requestMetadataPartnersSessionId + return c +} + +// RequestMetadataTrafficSourceTrafficSourceId sets the optional +// parameter "requestMetadata.trafficSource.trafficSourceId": Identifier +// to indicate where the traffic comes from. An identifier has multiple +// letters created by a team which redirected the traffic to us. +func (c *UserStatesListCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *UserStatesListCall { + c.opt_["requestMetadata.trafficSource.trafficSourceId"] = requestMetadataTrafficSourceTrafficSourceId + return c +} + +// RequestMetadataTrafficSourceTrafficSubId sets the optional parameter +// "requestMetadata.trafficSource.trafficSubId": Second level identifier +// to indicate where the traffic comes from. An identifier has multiple +// letters created by a team which redirected the traffic to us. +func (c *UserStatesListCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *UserStatesListCall { + c.opt_["requestMetadata.trafficSource.trafficSubId"] = requestMetadataTrafficSourceTrafficSubId + return c +} + +// RequestMetadataUserOverridesIpAddress sets the optional parameter +// "requestMetadata.userOverrides.ipAddress": IP address to use instead +// of the user's geo-located IP address. +func (c *UserStatesListCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *UserStatesListCall { + c.opt_["requestMetadata.userOverrides.ipAddress"] = requestMetadataUserOverridesIpAddress + return c +} + +// RequestMetadataUserOverridesUserId sets the optional parameter +// "requestMetadata.userOverrides.userId": Logged-in user ID to +// impersonate instead of the user's ID. +func (c *UserStatesListCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *UserStatesListCall { + c.opt_["requestMetadata.userOverrides.userId"] = requestMetadataUserOverridesUserId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UserStatesListCall) Fields(s ...googleapi.Field) *UserStatesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UserStatesListCall) IfNoneMatch(entityTag string) *UserStatesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UserStatesListCall) Context(ctx context.Context) *UserStatesListCall { + c.ctx_ = ctx + return c +} + +func (c *UserStatesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["requestMetadata.experimentIds"]; ok { + params.Set("requestMetadata.experimentIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["requestMetadata.locale"]; ok { + params.Set("requestMetadata.locale", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["requestMetadata.partnersSessionId"]; ok { + params.Set("requestMetadata.partnersSessionId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["requestMetadata.trafficSource.trafficSourceId"]; ok { + params.Set("requestMetadata.trafficSource.trafficSourceId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["requestMetadata.trafficSource.trafficSubId"]; ok { + params.Set("requestMetadata.trafficSource.trafficSubId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["requestMetadata.userOverrides.ipAddress"]; ok { + params.Set("requestMetadata.userOverrides.ipAddress", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["requestMetadata.userOverrides.userId"]; ok { + params.Set("requestMetadata.userOverrides.userId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/userStates") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "partners.userStates.list" call. +// Exactly one of *ListUserStatesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListUserStatesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UserStatesListCall) Do() (*ListUserStatesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListUserStatesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists states for current user.", + // "httpMethod": "GET", + // "id": "partners.userStates.list", + // "parameters": { + // "requestMetadata.experimentIds": { + // "description": "Experiment IDs the current request belongs to.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "requestMetadata.locale": { + // "description": "Locale to use for the current request.", + // "location": "query", + // "type": "string" + // }, + // "requestMetadata.partnersSessionId": { + // "description": "Google Partners session ID.", + // "location": "query", + // "type": "string" + // }, + // "requestMetadata.trafficSource.trafficSourceId": { + // "description": "Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us.", + // "location": "query", + // "type": "string" + // }, + // "requestMetadata.trafficSource.trafficSubId": { + // "description": "Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us.", + // "location": "query", + // "type": "string" + // }, + // "requestMetadata.userOverrides.ipAddress": { + // "description": "IP address to use instead of the user's geo-located IP address.", + // "location": "query", + // "type": "string" + // }, + // "requestMetadata.userOverrides.userId": { + // "description": "Logged-in user ID to impersonate instead of the user's ID.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/userStates", + // "response": { + // "$ref": "ListUserStatesResponse" + // } + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/playmoviespartner/v1/playmoviespartner-api.json b/Godeps/_workspace/src/google.golang.org/api/playmoviespartner/v1/playmoviespartner-api.json new file mode 100644 index 000000000..db8ec7a51 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/playmoviespartner/v1/playmoviespartner-api.json @@ -0,0 +1,1131 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/Noghpi7BSoFye2xNzlRkY-iDh3I\"", + "discoveryVersion": "v1", + "id": "playmoviespartner:v1", + "name": "playmoviespartner", + "version": "v1", + "revision": "20150812", + "title": "Google Play Movies Partner API", + "description": "Lets Google Play Movies Partners get the delivery status of their titles.", + "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/playmoviespartner/", + "protocol": "rest", + "baseUrl": "https://playmoviespartner.googleapis.com/", + "basePath": "/", + "rootUrl": "https://playmoviespartner.googleapis.com/", + "servicePath": "", + "batchPath": "batch", + "parameters": { + "access_token": { + "type": "string", + "description": "OAuth access token.", + "location": "query" + }, + "alt": { + "type": "string", + "description": "Data format for response.", + "default": "json", + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query" + }, + "bearer_token": { + "type": "string", + "description": "OAuth bearer token.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JSONP", + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "pp": { + "type": "boolean", + "description": "Pretty-print response.", + "default": "true", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query" + }, + "upload_protocol": { + "type": "string", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query" + }, + "uploadType": { + "type": "string", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query" + }, + "$.xgafv": { + "type": "string", + "description": "V1 error format.", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/playmovies_partner.readonly": { + "description": "View the digital assets you publish on Google Play Movies and TV" + } + } + } + }, + "schemas": { + "ListAvailsResponse": { + "id": "ListAvailsResponse", + "type": "object", + "description": "Response to the 'ListAvails' method.", + "properties": { + "avails": { + "type": "array", + "description": "List of Avails that match the request criteria.", + "items": { + "$ref": "Avail" + } + }, + "nextPageToken": { + "type": "string", + "description": "See _List methods rules_ for info about this field." + } + } + }, + "Avail": { + "id": "Avail", + "type": "object", + "description": "An Avail describes the Availability Window of a specific Edit in a given country, which means the period Google is allowed to sell or rent the Edit. Avails are exposed in EMA format Version 1.6b (available at http://www.movielabs.com/md/avails/) Studios can see the Avails for the Titles they own. Post-production houses cannot see any Avails.", + "properties": { + "displayName": { + "type": "string", + "description": "The name of the studio that owns the Edit referred in the Avail. This is the equivalent of `studio_name` in other resources, but it follows the EMA nomenclature. Example: \"Google Films\"." + }, + "storeLanguage": { + "type": "string", + "description": "Spoken language of the intended audience. Language shall be encoded in accordance with RFC 5646. Example: \"fr\"." + }, + "territory": { + "type": "string", + "description": "ISO 3166-1 alpha-2 country code for the country or territory of this Avail. For Avails, we use Territory in lieu of Country to comply with EMA specifications. But please note that Territory and Country identify the same thing. Example: \"US\"." + }, + "workType": { + "type": "string", + "description": "Work type as enumerated in EMA.", + "enum": [ + "TITLE_TYPE_UNSPECIFIED", + "MOVIE", + "SEASON", + "EPISODE" + ] + }, + "seriesTitleInternalAlias": { + "type": "string", + "description": "Title used by involved parties to refer to this series. Only available on TV Avails. Example: \"Googlers, The\"." + }, + "seasonNumber": { + "type": "string", + "description": "The number assigned to the season within a series. Only available on TV Avails. Example: \"1\"." + }, + "episodeNumber": { + "type": "string", + "description": "The number assigned to the episode within a season. Only available on TV Avails. Example: \"3\"." + }, + "seasonTitleInternalAlias": { + "type": "string", + "description": "Title used by involved parties to refer to this season. Only available on TV Avails. Example: \"Googlers, The\"." + }, + "episodeTitleInternalAlias": { + "type": "string", + "description": "OPTIONAL.TV Only. Title used by involved parties to refer to this episode. Only available on TV Avails. Example: \"Coding at Google\"." + }, + "titleInternalAlias": { + "type": "string", + "description": "Title used by involved parties to refer to this content. Example: \"Googlers, The\". Only available on Movie Avails." + }, + "licenseType": { + "type": "string", + "description": "Type of transaction.", + "enum": [ + "LICENSE_TYPE_UNSPECIFIED", + "EST", + "VOD", + "SVOD" + ] + }, + "formatProfile": { + "type": "string", + "description": "Indicates the format profile covered by the transaction.", + "enum": [ + "FORMAT_PROFILE_UNSPECIFIED", + "SD", + "HD" + ] + }, + "start": { + "type": "string", + "description": "Start of term in YYYY-MM-DD format in the timezone of the country of the Avail. Example: \"2013-05-14\"." + }, + "end": { + "type": "string", + "description": "End of term in YYYY-MM-DD format in the timezone of the country of the Avail. \"Open\" if no end date is available. Example: \"2019-02-17\"" + }, + "priceType": { + "type": "string", + "description": "Type of pricing that should be applied to this Avail based on how the partner classify them. Example: \"Tier\", \"WSP\", \"SRP\", or \"Category\"." + }, + "priceValue": { + "type": "string", + "description": "Value to be applied to the pricing type. Example: \"4\" or \"2.99\"" + }, + "contentId": { + "type": "string", + "description": "Title Identifier. This should be the Title Level EIDR. Example: \"10.5240/1489-49A2-3956-4B2D-FE16-5\"." + }, + "productId": { + "type": "string", + "description": "Edit Identifier. This should be the Edit Level EIDR. Example: \"10.2340/1489-49A2-3956-4B2D-FE16-6\"" + }, + "encodeId": { + "type": "string", + "description": "Manifestation Identifier. This should be the Manifestation Level EIDR. Example: \"10.2340/1489-49A2-3956-4B2D-FE16-7\"" + }, + "seriesAltId": { + "type": "string", + "description": "Other identifier referring to the series, as defined by partner. Only available on TV avails. Example: \"rs_googlers\"." + }, + "seasonAltId": { + "type": "string", + "description": "Other identifier referring to the season, as defined by partner. Only available on TV avails. Example: \"rs_googlers_s1\"." + }, + "episodeAltId": { + "type": "string", + "description": "Other identifier referring to the episode, as defined by partner. Only available on TV avails. Example: \"rs_googlers_s1_3\"." + }, + "altId": { + "type": "string", + "description": "Other identifier referring to the Edit, as defined by partner. Example: \"GOOGLER_2006\"" + }, + "suppressionLiftDate": { + "type": "string", + "description": "First date an Edit could be publically announced as becoming available at a specific future date in territory of Avail. *Not* the Avail start date or pre-order start date. Format is YYYY-MM-DD. Only available for pre-orders. Example: \"2012-12-10\"" + }, + "releaseDate": { + "type": "string", + "description": "Release date of the Title in earliest released territory. Typically it is just the year, but it is free-form as per EMA spec. Examples: \"1979\", \"Oct 2014\"" + }, + "ratingSystem": { + "type": "string", + "description": "Rating system applied to the version of title within territory of Avail. Rating systems should be formatted as per [EMA ratings spec](http://www.movielabs.com/md/ratings/) Example: \"MPAA\"" + }, + "ratingValue": { + "type": "string", + "description": "Value representing the rating. Ratings should be formatted as per http://www.movielabs.com/md/ratings/ Example: \"PG\"" + }, + "ratingReason": { + "type": "string", + "description": "Value representing the rating reason. Rating reasons should be formatted as per [EMA ratings spec](http://www.movielabs.com/md/ratings/) and comma-separated for inclusion of multiple reasons. Example: \"L, S, V\"" + }, + "captionIncluded": { + "type": "boolean", + "description": "Communicating if caption file will be delivered." + }, + "captionExemption": { + "type": "string", + "description": "Communicating an exempt category as defined by FCC regulations. It is not required for non-US Avails. Example: \"1\"" + }, + "videoId": { + "type": "string", + "description": "Google-generated ID identifying the video linked to this Avail, once delivered. Not part of EMA Specs. Example: 'gtry456_xc'" + }, + "pphNames": { + "type": "array", + "description": "Name of the post-production houses that manage the Avail. Not part of EMA Specs.", + "items": { + "type": "string" + } + } + } + }, + "Order": { + "id": "Order", + "type": "object", + "description": "An Order tracks the fulfillment of an Edit when delivered using the legacy, non-component-based delivery. Each Order is uniquely identified by an `order_id`, which is generated by Google. Externally, Orders can also be identified by partners using its `custom_id` (when provided).", + "properties": { + "orderId": { + "type": "string", + "description": "ID internally generated by Google to uniquely identify an Order. Example: 'abcde12_x'" + }, + "customId": { + "type": "string", + "description": "ID that can be used to externally identify an Order. This ID is provided by partners when submitting the Avails. Example: 'GOOGLER_2006'" + }, + "videoId": { + "type": "string", + "description": "Google-generated ID identifying the video linked to this Order, once delivered. Example: 'gtry456_xc'." + }, + "countries": { + "type": "array", + "description": "Countries where the Order is available, using the \"ISO 3166-1 alpha-2\" format (example: \"US\").", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "description": "Type of the Edit linked to the Order.", + "enum": [ + "TITLE_TYPE_UNSPECIFIED", + "MOVIE", + "SEASON", + "EPISODE" + ] + }, + "name": { + "type": "string", + "description": "Default Edit name, usually in the language of the country of origin. Example: \"Googlers, The\"." + }, + "episodeName": { + "type": "string", + "description": "Default Episode name, usually in the language of the country of origin. Only available for TV Edits Example: \"Googlers, The - Pilot\"." + }, + "seasonName": { + "type": "string", + "description": "Default Season name, usually in the language of the country of origin. Only available for TV Edits Example: \"Googlers, The - A Brave New World\"." + }, + "showName": { + "type": "string", + "description": "Default Show name, usually in the language of the country of origin. Only available for TV Edits Example: \"Googlers, The\"." + }, + "status": { + "type": "string", + "description": "High-level status of the order.", + "enum": [ + "STATUS_UNSPECIFIED", + "STATUS_APPROVED", + "STATUS_FAILED", + "STATUS_PROCESSING", + "STATUS_UNFULFILLED", + "STATUS_NOT_AVAILABLE" + ] + }, + "statusDetail": { + "type": "string", + "description": "Detailed status of the order", + "enum": [ + "ORDER_STATUS_UNSPECIFIED", + "ORDER_STATUS_QC_APPROVED", + "ORDER_STATUS_QC_REJECTION", + "ORDER_STATUS_INTERNAL_FIX", + "ORDER_STATUS_OPEN_ORDER", + "ORDER_STATUS_NOT_AVAILABLE", + "ORDER_STATUS_AWAITING_REDELIVERY", + "ORDER_STATUS_READY_FOR_QC" + ] + }, + "rejectionNote": { + "type": "string", + "description": "Field explaining why an Order has been rejected. Example: \"Trailer audio is 2ch mono, please re-deliver in stereo\"." + }, + "orderedTime": { + "type": "string", + "description": "Timestamp when the Order was created." + }, + "approvedTime": { + "type": "string", + "description": "Timestamp when the Order was approved." + }, + "receivedTime": { + "type": "string", + "description": "Timestamp when the Order was fulfilled." + }, + "earliestAvailStartTime": { + "type": "string", + "description": "Timestamp of the earliest start date of the Avails linked to this Order." + }, + "priority": { + "type": "number", + "description": "Order priority, as defined by Google. The higher the value, the higher the priority. Example: 90", + "format": "double" + }, + "legacyPriority": { + "type": "string", + "description": "Legacy Order priority, as defined by Google. Example: 'P0'" + }, + "channelId": { + "type": "string", + "description": "YouTube Channel ID that should be used to fulfill the Order. Example: \"UCRG64darCZhb\"." + }, + "channelName": { + "type": "string", + "description": "YouTube Channel Name that should be used to fulfill the Order. Example: \"Google_channel\"." + }, + "studioName": { + "type": "string", + "description": "Name of the studio that owns the Edit ordered." + }, + "pphName": { + "type": "string", + "description": "Name of the post-production house that manages the Edit ordered." + }, + "normalizedPriority": { + "type": "string", + "description": "A simpler representation of the priority.", + "enum": [ + "NORMALIZED_PRIORITY_UNSPECIFIED", + "LOW_PRIORITY", + "HIGH_PRIORITY" + ] + } + } + }, + "ListOrdersResponse": { + "id": "ListOrdersResponse", + "type": "object", + "description": "Response to the 'ListOrders' method.", + "properties": { + "orders": { + "type": "array", + "description": "List of Orders that match the request criteria.", + "items": { + "$ref": "Order" + } + }, + "nextPageToken": { + "type": "string", + "description": "See _List methods rules_ for info about this field." + } + } + }, + "ExperienceLocale": { + "id": "ExperienceLocale", + "type": "object", + "description": "An ExperienceLocale tracks the fulfillment of a Title in a country using a specific language, when delivered using component-based delivery. For example, a Title in Switzerland might have 3 ExperienceLocales: they both share the same country (\"CH\"), but each has different languages (\"de\", \"fr\", and \"it\"). Each ExperienceLocale is uniquely identified by an `el_id`, which is generated by Google. Externally, an ExperienceLocale can also be identified by partners using its EIDR IDs, AltCutID or `custom_id` (when provided).", + "properties": { + "elId": { + "type": "string", + "description": "ID internally generated by Google to uniquely identify a ExperienceLocale. Example: 'KRZiVjY9h7t'" + }, + "country": { + "type": "string", + "description": "Country where the ExperienceLocale is available, using the \"ISO 3166-1 alpha-2\" format. Example: \"US\"." + }, + "language": { + "type": "string", + "description": "Language of the ExperienceLocale, using the \"BCP 47\" format. Examples: \"en\", \"en-US\", \"es\", \"es-419\"." + }, + "videoId": { + "type": "string", + "description": "Video ID, as defined by Google, linked to the feature video in the ExperienceLocale. Example: 'gtry456_xc'." + }, + "trailerId": { + "type": "string", + "description": "Trailer ID, as defined by Google, linked to the trailer video in the ExperienceLocale. Example: 'gtry457_tr'." + }, + "titleLevelEidr": { + "type": "string", + "description": "Title-level EIDR ID. Example: \"10.5240/1489-49A2-3956-4B2D-FE16-5\"." + }, + "editLevelEidr": { + "type": "string", + "description": "Edit-level EIDR ID. Example: \"10.5240/1489-49A2-3956-4B2D-FE16-6\"." + }, + "altCutId": { + "type": "string", + "description": "Alternative Cut ID, sometimes available in lieu of the main Edit-level EIDR ID. This is not an EIDR ID, but a Partner-provided ID. Example: \"206346_79838\"." + }, + "customIds": { + "type": "array", + "description": "List of custom IDs (defined by the partner) linked to this ExperienceLocale. Example: \"R86241\"", + "items": { + "type": "string" + } + }, + "presentationId": { + "type": "string", + "description": "PresentationID as defined in the EMA specs." + }, + "inventoryId": { + "type": "string", + "description": "InventoryID as defined in the EMA specs." + }, + "playableSequenceId": { + "type": "string", + "description": "PlayableSequenceID as defined in the EMA specs." + }, + "type": { + "type": "string", + "description": "Type of the Edit linked to the ExperienceLocale.", + "enum": [ + "TITLE_TYPE_UNSPECIFIED", + "MOVIE", + "SEASON", + "EPISODE" + ] + }, + "name": { + "type": "string", + "description": "Default Edit name, usually in the language of the country of origin. Example: \"Googlers, The\"." + }, + "status": { + "type": "string", + "description": "High-level status of the ExperienceLocale.", + "enum": [ + "STATUS_UNSPECIFIED", + "STATUS_APPROVED", + "STATUS_FAILED", + "STATUS_PROCESSING", + "STATUS_UNFULFILLED", + "STATUS_NOT_AVAILABLE" + ] + }, + "priority": { + "type": "number", + "description": "ExperienceLocale priority, as defined by Google. The higher the value, the higher the priority. Example: 90", + "format": "double" + }, + "createdTime": { + "type": "string", + "description": "Timestamp when the ExperienceLocale was created." + }, + "approvedTime": { + "type": "string", + "description": "Timestamp when the ExperienceLocale was approved." + }, + "earliestAvailStartTime": { + "type": "string", + "description": "Timestamp of the earliest start date of the Avails linked to this ExperienceLocale." + }, + "channelId": { + "type": "string", + "description": "YouTube Channel ID linked to the ExperienceLocale. Example: \"UCRG64darCZhb\"." + }, + "studioName": { + "type": "string", + "description": "Name of the studio that owns the ExperienceLocale." + }, + "pphNames": { + "type": "array", + "description": "Name of the post-production houses that manage the ExperienceLocale.", + "items": { + "type": "string" + } + }, + "normalizedPriority": { + "type": "string", + "description": "A simpler representation of the priority.", + "enum": [ + "NORMALIZED_PRIORITY_UNSPECIFIED", + "LOW_PRIORITY", + "HIGH_PRIORITY" + ] + } + } + }, + "ListExperienceLocalesResponse": { + "id": "ListExperienceLocalesResponse", + "type": "object", + "description": "Response to the 'ListExperienceLocales' method.", + "properties": { + "experienceLocales": { + "type": "array", + "description": "List of ExperienceLocales that match the request criteria.", + "items": { + "$ref": "ExperienceLocale" + } + }, + "nextPageToken": { + "type": "string", + "description": "See _List methods rules_ for info about this field." + } + } + }, + "StoreInfo": { + "id": "StoreInfo", + "type": "object", + "description": "Information about a playable sequence (video) associated with an Edit and available at the Google Play Store. Internally, each StoreInfo is uniquely identified by a `video_id` and `country`. Externally, Title-level EIDR or Edit-level EIDR, if provided, can also be used to identify a specific title or edit in a country.", + "properties": { + "videoId": { + "type": "string", + "description": "Google-generated ID identifying the video linked to the Edit. Example: 'gtry456_xc'" + }, + "seasonId": { + "type": "string", + "description": "Google-generated ID identifying the season linked to the Edit. Only available for TV Edits. Example: 'ster23ex'" + }, + "showId": { + "type": "string", + "description": "Google-generated ID identifying the show linked to the Edit. Only available for TV Edits. Example: 'et2hsue_x'" + }, + "country": { + "type": "string", + "description": "Country where Edit is available in ISO 3166-1 alpha-2 country code. Example: \"US\"." + }, + "liveTime": { + "type": "string", + "description": "Timestamp when the Edit went live on the Store." + }, + "type": { + "type": "string", + "description": "Edit type, like Movie, Episode or Season.", + "enum": [ + "TITLE_TYPE_UNSPECIFIED", + "MOVIE", + "SEASON", + "EPISODE" + ] + }, + "name": { + "type": "string", + "description": "Default Edit name, usually in the language of the country of origin. Example: \"Googlers, The\"." + }, + "titleLevelEidr": { + "type": "string", + "description": "Title-level EIDR ID. Example: \"10.5240/1489-49A2-3956-4B2D-FE16-5\"." + }, + "editLevelEidr": { + "type": "string", + "description": "Edit-level EIDR ID. Example: \"10.5240/1489-49A2-3956-4B2D-FE16-6\"." + }, + "seasonName": { + "type": "string", + "description": "Default Season name, usually in the language of the country of origin. Only available for TV Edits Example: \"Googlers, The - A Brave New World\"." + }, + "showName": { + "type": "string", + "description": "Default Show name, usually in the language of the country of origin. Only available for TV Edits Example: \"Googlers, The\"." + }, + "seasonNumber": { + "type": "string", + "description": "The number assigned to the season within a show. Only available on TV Edits. Example: \"1\"." + }, + "episodeNumber": { + "type": "string", + "description": "The number assigned to the episode within a season. Only available on TV Edits. Example: \"1\"." + }, + "hasSdOffer": { + "type": "boolean", + "description": "Whether the Edit has a SD offer." + }, + "hasHdOffer": { + "type": "boolean", + "description": "Whether the Edit has a HD offer." + }, + "hasVodOffer": { + "type": "boolean", + "description": "Whether the Edit has a VOD offer." + }, + "hasEstOffer": { + "type": "boolean", + "description": "Whether the Edit has a EST offer." + }, + "hasAudio51": { + "type": "boolean", + "description": "Whether the Edit has a 5.1 channel audio track." + }, + "audioTracks": { + "type": "array", + "description": "Audio tracks available for this Edit.", + "items": { + "type": "string" + } + }, + "subtitles": { + "type": "array", + "description": "Subtitles available for this Edit.", + "items": { + "type": "string" + } + }, + "hasInfoCards": { + "type": "boolean", + "description": "Whether the Edit has info cards." + }, + "mid": { + "type": "string", + "description": "Knowledge Graph ID associated to this Edit, if available. This ID links the Edit to its knowledge entity, externally accessible at http://freebase.com. In the absense of Title EIDR or Edit EIDR, this ID helps link together multiple Edits across countries. Example: '/m/0ffx29'" + }, + "trailerId": { + "type": "string", + "description": "Google-generated ID identifying the trailer linked to the Edit. Example: 'bhd_4e_cx'" + }, + "studioName": { + "type": "string", + "description": "Name of the studio that owns the Edit ordered." + }, + "pphNames": { + "type": "array", + "description": "Name of the post-production houses that manage the Edit.", + "items": { + "type": "string" + } + } + } + }, + "ListStoreInfosResponse": { + "id": "ListStoreInfosResponse", + "type": "object", + "description": "Response to the 'ListStoreInfos' method.", + "properties": { + "storeInfos": { + "type": "array", + "description": "List of StoreInfos that match the request criteria.", + "items": { + "$ref": "StoreInfo" + } + }, + "nextPageToken": { + "type": "string", + "description": "See 'List methods rules' for info about this field." + } + } + } + }, + "resources": { + "accounts": { + "resources": { + "avails": { + "methods": { + "list": { + "id": "playmoviespartner.accounts.avails.list", + "path": "v1/accounts/{accountId}/avails", + "httpMethod": "GET", + "description": "List Avails owned or managed by the partner. See _Authentication and Authorization rules_ and _List methods rules_ for more information about this method.", + "parameters": { + "accountId": { + "type": "string", + "description": "REQUIRED. See _General rules_ for more information about this field.", + "required": true, + "location": "path" + }, + "pageSize": { + "type": "integer", + "description": "See _List methods rules_ for info about this field.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "See _List methods rules_ for info about this field.", + "location": "query" + }, + "pphNames": { + "type": "string", + "description": "See _List methods rules_ for info about this field.", + "repeated": true, + "location": "query" + }, + "studioNames": { + "type": "string", + "description": "See _List methods rules_ for info about this field.", + "repeated": true, + "location": "query" + }, + "title": { + "type": "string", + "description": "Filter Avails that match a case-insensitive substring of the default Title name.", + "location": "query" + }, + "territories": { + "type": "string", + "description": "Filter Avails that match (case-insensitive) any of the given country codes, using the \"ISO 3166-1 alpha-2\" format (examples: \"US\", \"us\", \"Us\").", + "repeated": true, + "location": "query" + }, + "altId": { + "type": "string", + "description": "Filter Avails that match a case-insensitive, partner-specific custom id.", + "location": "query" + }, + "videoIds": { + "type": "string", + "description": "Filter Avails that match any of the given `video_id`s.", + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "ListAvailsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/playmovies_partner.readonly" + ] + } + } + }, + "orders": { + "methods": { + "get": { + "id": "playmoviespartner.accounts.orders.get", + "path": "v1/accounts/{accountId}/orders/{orderId}", + "httpMethod": "GET", + "description": "Get an Order given its id. See _Authentication and Authorization rules_ and _Get methods rules_ for more information about this method.", + "parameters": { + "accountId": { + "type": "string", + "description": "REQUIRED. See _General rules_ for more information about this field.", + "required": true, + "location": "path" + }, + "orderId": { + "type": "string", + "description": "REQUIRED. Order ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "orderId" + ], + "response": { + "$ref": "Order" + }, + "scopes": [ + "https://www.googleapis.com/auth/playmovies_partner.readonly" + ] + }, + "list": { + "id": "playmoviespartner.accounts.orders.list", + "path": "v1/accounts/{accountId}/orders", + "httpMethod": "GET", + "description": "List Orders owned or managed by the partner. See _Authentication and Authorization rules_ and _List methods rules_ for more information about this method.", + "parameters": { + "accountId": { + "type": "string", + "description": "REQUIRED. See _General rules_ for more information about this field.", + "required": true, + "location": "path" + }, + "pageSize": { + "type": "integer", + "description": "See _List methods rules_ for info about this field.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "See _List methods rules_ for info about this field.", + "location": "query" + }, + "pphNames": { + "type": "string", + "description": "See _List methods rules_ for info about this field.", + "repeated": true, + "location": "query" + }, + "studioNames": { + "type": "string", + "description": "See _List methods rules_ for info about this field.", + "repeated": true, + "location": "query" + }, + "name": { + "type": "string", + "description": "Filter Orders that match a title name (case-insensitive, sub-string match).", + "location": "query" + }, + "status": { + "type": "string", + "description": "Filter Orders that match one of the given status.", + "enum": [ + "STATUS_UNSPECIFIED", + "STATUS_APPROVED", + "STATUS_FAILED", + "STATUS_PROCESSING", + "STATUS_UNFULFILLED", + "STATUS_NOT_AVAILABLE" + ], + "repeated": true, + "location": "query" + }, + "customId": { + "type": "string", + "description": "Filter Orders that match a case-insensitive, partner-specific custom id.", + "location": "query" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "ListOrdersResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/playmovies_partner.readonly" + ] + } + } + }, + "experienceLocales": { + "methods": { + "get": { + "id": "playmoviespartner.accounts.experienceLocales.get", + "path": "v1/accounts/{accountId}/experienceLocales/{elId}", + "httpMethod": "GET", + "description": "Get an ExperienceLocale given its id. See _Authentication and Authorization rules_ and _Get methods rules_ for more information about this method.", + "parameters": { + "accountId": { + "type": "string", + "description": "REQUIRED. See _General rules_ for more information about this field.", + "required": true, + "location": "path" + }, + "elId": { + "type": "string", + "description": "REQUIRED. ExperienceLocale ID, as defined by Google.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "elId" + ], + "response": { + "$ref": "ExperienceLocale" + }, + "scopes": [ + "https://www.googleapis.com/auth/playmovies_partner.readonly" + ] + }, + "list": { + "id": "playmoviespartner.accounts.experienceLocales.list", + "path": "v1/accounts/{accountId}/experienceLocales", + "httpMethod": "GET", + "description": "List ExperienceLocales owned or managed by the partner. See _Authentication and Authorization rules_ and _List methods rules_ for more information about this method.", + "parameters": { + "accountId": { + "type": "string", + "description": "REQUIRED. See _General rules_ for more information about this field.", + "required": true, + "location": "path" + }, + "pageSize": { + "type": "integer", + "description": "See _List methods rules_ for info about this field.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "See _List methods rules_ for info about this field.", + "location": "query" + }, + "pphNames": { + "type": "string", + "description": "See _List methods rules_ for info about this field.", + "repeated": true, + "location": "query" + }, + "studioNames": { + "type": "string", + "description": "See _List methods rules_ for info about this field.", + "repeated": true, + "location": "query" + }, + "titleLevelEidr": { + "type": "string", + "description": "Filter ExperienceLocales that match a given title-level EIDR.", + "location": "query" + }, + "editLevelEidr": { + "type": "string", + "description": "Filter ExperienceLocales that match a given edit-level EIDR.", + "location": "query" + }, + "status": { + "type": "string", + "description": "Filter ExperienceLocales that match one of the given status.", + "enum": [ + "STATUS_UNSPECIFIED", + "STATUS_APPROVED", + "STATUS_FAILED", + "STATUS_PROCESSING", + "STATUS_UNFULFILLED", + "STATUS_NOT_AVAILABLE" + ], + "repeated": true, + "location": "query" + }, + "customId": { + "type": "string", + "description": "Filter ExperienceLocales that match a case-insensitive, partner-specific custom id.", + "location": "query" + }, + "altCutId": { + "type": "string", + "description": "Filter ExperienceLocales that match a case-insensitive, partner-specific Alternative Cut ID.", + "location": "query" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "ListExperienceLocalesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/playmovies_partner.readonly" + ] + } + } + }, + "storeInfos": { + "methods": { + "list": { + "id": "playmoviespartner.accounts.storeInfos.list", + "path": "v1/accounts/{accountId}/storeInfos", + "httpMethod": "GET", + "description": "List StoreInfos owned or managed by the partner. See _Authentication and Authorization rules_ and _List methods rules_ for more information about this method.", + "parameters": { + "accountId": { + "type": "string", + "description": "REQUIRED. See _General rules_ for more information about this field.", + "required": true, + "location": "path" + }, + "pageSize": { + "type": "integer", + "description": "See _List methods rules_ for info about this field.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "See _List methods rules_ for info about this field.", + "location": "query" + }, + "pphNames": { + "type": "string", + "description": "See _List methods rules_ for info about this field.", + "repeated": true, + "location": "query" + }, + "studioNames": { + "type": "string", + "description": "See _List methods rules_ for info about this field.", + "repeated": true, + "location": "query" + }, + "videoId": { + "type": "string", + "description": "Filter StoreInfos that match a given `video_id`. NOTE: this field is deprecated and will be removed on V2; `video_ids` should be used instead.", + "location": "query" + }, + "countries": { + "type": "string", + "description": "Filter StoreInfos that match (case-insensitive) any of the given country codes, using the \"ISO 3166-1 alpha-2\" format (examples: \"US\", \"us\", \"Us\").", + "repeated": true, + "location": "query" + }, + "name": { + "type": "string", + "description": "Filter StoreInfos that match a case-insensitive substring of the default name.", + "location": "query" + }, + "videoIds": { + "type": "string", + "description": "Filter StoreInfos that match any of the given `video_id`s.", + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "ListStoreInfosResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/playmovies_partner.readonly" + ] + } + }, + "resources": { + "country": { + "methods": { + "get": { + "id": "playmoviespartner.accounts.storeInfos.country.get", + "path": "v1/accounts/{accountId}/storeInfos/{videoId}/country/{country}", + "httpMethod": "GET", + "description": "Get a StoreInfo given its video id and country. See _Authentication and Authorization rules_ and _Get methods rules_ for more information about this method.", + "parameters": { + "accountId": { + "type": "string", + "description": "REQUIRED. See _General rules_ for more information about this field.", + "required": true, + "location": "path" + }, + "videoId": { + "type": "string", + "description": "REQUIRED. Video ID.", + "required": true, + "location": "path" + }, + "country": { + "type": "string", + "description": "REQUIRED. Edit country.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "videoId", + "country" + ], + "response": { + "$ref": "StoreInfo" + }, + "scopes": [ + "https://www.googleapis.com/auth/playmovies_partner.readonly" + ] + } + } + } + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/playmoviespartner/v1/playmoviespartner-gen.go b/Godeps/_workspace/src/google.golang.org/api/playmoviespartner/v1/playmoviespartner-gen.go new file mode 100644 index 000000000..82945dc76 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/playmoviespartner/v1/playmoviespartner-gen.go @@ -0,0 +1,2299 @@ +// Package playmoviespartner provides access to the Google Play Movies Partner API. +// +// See https://developers.google.com/playmoviespartner/ +// +// Usage example: +// +// import "google.golang.org/api/playmoviespartner/v1" +// ... +// playmoviespartnerService, err := playmoviespartner.New(oauthHttpClient) +package playmoviespartner // import "google.golang.org/api/playmoviespartner/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "playmoviespartner:v1" +const apiName = "playmoviespartner" +const apiVersion = "v1" +const basePath = "https://playmoviespartner.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // View the digital assets you publish on Google Play Movies and TV + PlaymoviesPartnerReadonlyScope = "https://www.googleapis.com/auth/playmovies_partner.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) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Accounts *AccountsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + rs.Avails = NewAccountsAvailsService(s) + rs.ExperienceLocales = NewAccountsExperienceLocalesService(s) + rs.Orders = NewAccountsOrdersService(s) + rs.StoreInfos = NewAccountsStoreInfosService(s) + return rs +} + +type AccountsService struct { + s *Service + + Avails *AccountsAvailsService + + ExperienceLocales *AccountsExperienceLocalesService + + Orders *AccountsOrdersService + + StoreInfos *AccountsStoreInfosService +} + +func NewAccountsAvailsService(s *Service) *AccountsAvailsService { + rs := &AccountsAvailsService{s: s} + return rs +} + +type AccountsAvailsService struct { + s *Service +} + +func NewAccountsExperienceLocalesService(s *Service) *AccountsExperienceLocalesService { + rs := &AccountsExperienceLocalesService{s: s} + return rs +} + +type AccountsExperienceLocalesService struct { + s *Service +} + +func NewAccountsOrdersService(s *Service) *AccountsOrdersService { + rs := &AccountsOrdersService{s: s} + return rs +} + +type AccountsOrdersService struct { + s *Service +} + +func NewAccountsStoreInfosService(s *Service) *AccountsStoreInfosService { + rs := &AccountsStoreInfosService{s: s} + rs.Country = NewAccountsStoreInfosCountryService(s) + return rs +} + +type AccountsStoreInfosService struct { + s *Service + + Country *AccountsStoreInfosCountryService +} + +func NewAccountsStoreInfosCountryService(s *Service) *AccountsStoreInfosCountryService { + rs := &AccountsStoreInfosCountryService{s: s} + return rs +} + +type AccountsStoreInfosCountryService struct { + s *Service +} + +// Avail: An Avail describes the Availability Window of a specific Edit +// in a given country, which means the period Google is allowed to sell +// or rent the Edit. Avails are exposed in EMA format Version 1.6b +// (available at http://www.movielabs.com/md/avails/) Studios can see +// the Avails for the Titles they own. Post-production houses cannot see +// any Avails. +type Avail struct { + // AltId: Other identifier referring to the Edit, as defined by partner. + // Example: "GOOGLER_2006" + AltId string `json:"altId,omitempty"` + + // CaptionExemption: Communicating an exempt category as defined by FCC + // regulations. It is not required for non-US Avails. Example: "1" + CaptionExemption string `json:"captionExemption,omitempty"` + + // CaptionIncluded: Communicating if caption file will be delivered. + CaptionIncluded bool `json:"captionIncluded,omitempty"` + + // ContentId: Title Identifier. This should be the Title Level EIDR. + // Example: "10.5240/1489-49A2-3956-4B2D-FE16-5". + ContentId string `json:"contentId,omitempty"` + + // DisplayName: The name of the studio that owns the Edit referred in + // the Avail. This is the equivalent of `studio_name` in other + // resources, but it follows the EMA nomenclature. Example: "Google + // Films". + DisplayName string `json:"displayName,omitempty"` + + // EncodeId: Manifestation Identifier. This should be the Manifestation + // Level EIDR. Example: "10.2340/1489-49A2-3956-4B2D-FE16-7" + EncodeId string `json:"encodeId,omitempty"` + + // End: End of term in YYYY-MM-DD format in the timezone of the country + // of the Avail. "Open" if no end date is available. Example: + // "2019-02-17" + End string `json:"end,omitempty"` + + // EpisodeAltId: Other identifier referring to the episode, as defined + // by partner. Only available on TV avails. Example: "rs_googlers_s1_3". + EpisodeAltId string `json:"episodeAltId,omitempty"` + + // EpisodeNumber: The number assigned to the episode within a season. + // Only available on TV Avails. Example: "3". + EpisodeNumber string `json:"episodeNumber,omitempty"` + + // EpisodeTitleInternalAlias: OPTIONAL.TV Only. Title used by involved + // parties to refer to this episode. Only available on TV Avails. + // Example: "Coding at Google". + EpisodeTitleInternalAlias string `json:"episodeTitleInternalAlias,omitempty"` + + // FormatProfile: Indicates the format profile covered by the + // transaction. + // + // Possible values: + // "FORMAT_PROFILE_UNSPECIFIED" + // "SD" + // "HD" + FormatProfile string `json:"formatProfile,omitempty"` + + // LicenseType: Type of transaction. + // + // Possible values: + // "LICENSE_TYPE_UNSPECIFIED" + // "EST" + // "VOD" + // "SVOD" + LicenseType string `json:"licenseType,omitempty"` + + // PphNames: Name of the post-production houses that manage the Avail. + // Not part of EMA Specs. + PphNames []string `json:"pphNames,omitempty"` + + // PriceType: Type of pricing that should be applied to this Avail based + // on how the partner classify them. Example: "Tier", "WSP", "SRP", or + // "Category". + PriceType string `json:"priceType,omitempty"` + + // PriceValue: Value to be applied to the pricing type. Example: "4" or + // "2.99" + PriceValue string `json:"priceValue,omitempty"` + + // ProductId: Edit Identifier. This should be the Edit Level EIDR. + // Example: "10.2340/1489-49A2-3956-4B2D-FE16-6" + ProductId string `json:"productId,omitempty"` + + // RatingReason: Value representing the rating reason. Rating reasons + // should be formatted as per [EMA ratings + // spec](http://www.movielabs.com/md/ratings/) and comma-separated for + // inclusion of multiple reasons. Example: "L, S, V" + RatingReason string `json:"ratingReason,omitempty"` + + // RatingSystem: Rating system applied to the version of title within + // territory of Avail. Rating systems should be formatted as per [EMA + // ratings spec](http://www.movielabs.com/md/ratings/) Example: "MPAA" + RatingSystem string `json:"ratingSystem,omitempty"` + + // RatingValue: Value representing the rating. Ratings should be + // formatted as per http://www.movielabs.com/md/ratings/ Example: "PG" + RatingValue string `json:"ratingValue,omitempty"` + + // ReleaseDate: Release date of the Title in earliest released + // territory. Typically it is just the year, but it is free-form as per + // EMA spec. Examples: "1979", "Oct 2014" + ReleaseDate string `json:"releaseDate,omitempty"` + + // SeasonAltId: Other identifier referring to the season, as defined by + // partner. Only available on TV avails. Example: "rs_googlers_s1". + SeasonAltId string `json:"seasonAltId,omitempty"` + + // SeasonNumber: The number assigned to the season within a series. Only + // available on TV Avails. Example: "1". + SeasonNumber string `json:"seasonNumber,omitempty"` + + // SeasonTitleInternalAlias: Title used by involved parties to refer to + // this season. Only available on TV Avails. Example: "Googlers, The". + SeasonTitleInternalAlias string `json:"seasonTitleInternalAlias,omitempty"` + + // SeriesAltId: Other identifier referring to the series, as defined by + // partner. Only available on TV avails. Example: "rs_googlers". + SeriesAltId string `json:"seriesAltId,omitempty"` + + // SeriesTitleInternalAlias: Title used by involved parties to refer to + // this series. Only available on TV Avails. Example: "Googlers, The". + SeriesTitleInternalAlias string `json:"seriesTitleInternalAlias,omitempty"` + + // Start: Start of term in YYYY-MM-DD format in the timezone of the + // country of the Avail. Example: "2013-05-14". + Start string `json:"start,omitempty"` + + // StoreLanguage: Spoken language of the intended audience. Language + // shall be encoded in accordance with RFC 5646. Example: "fr". + StoreLanguage string `json:"storeLanguage,omitempty"` + + // SuppressionLiftDate: First date an Edit could be publically announced + // as becoming available at a specific future date in territory of + // Avail. *Not* the Avail start date or pre-order start date. Format is + // YYYY-MM-DD. Only available for pre-orders. Example: "2012-12-10" + SuppressionLiftDate string `json:"suppressionLiftDate,omitempty"` + + // Territory: ISO 3166-1 alpha-2 country code for the country or + // territory of this Avail. For Avails, we use Territory in lieu of + // Country to comply with EMA specifications. But please note that + // Territory and Country identify the same thing. Example: "US". + Territory string `json:"territory,omitempty"` + + // TitleInternalAlias: Title used by involved parties to refer to this + // content. Example: "Googlers, The". Only available on Movie Avails. + TitleInternalAlias string `json:"titleInternalAlias,omitempty"` + + // VideoId: Google-generated ID identifying the video linked to this + // Avail, once delivered. Not part of EMA Specs. Example: 'gtry456_xc' + VideoId string `json:"videoId,omitempty"` + + // WorkType: Work type as enumerated in EMA. + // + // Possible values: + // "TITLE_TYPE_UNSPECIFIED" + // "MOVIE" + // "SEASON" + // "EPISODE" + WorkType string `json:"workType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AltId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Avail) MarshalJSON() ([]byte, error) { + type noMethod Avail + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ExperienceLocale: An ExperienceLocale tracks the fulfillment of a +// Title in a country using a specific language, when delivered using +// component-based delivery. For example, a Title in Switzerland might +// have 3 ExperienceLocales: they both share the same country ("CH"), +// but each has different languages ("de", "fr", and "it"). Each +// ExperienceLocale is uniquely identified by an `el_id`, which is +// generated by Google. Externally, an ExperienceLocale can also be +// identified by partners using its EIDR IDs, AltCutID or `custom_id` +// (when provided). +type ExperienceLocale struct { + // AltCutId: Alternative Cut ID, sometimes available in lieu of the main + // Edit-level EIDR ID. This is not an EIDR ID, but a Partner-provided + // ID. Example: "206346_79838". + AltCutId string `json:"altCutId,omitempty"` + + // ApprovedTime: Timestamp when the ExperienceLocale was approved. + ApprovedTime string `json:"approvedTime,omitempty"` + + // ChannelId: YouTube Channel ID linked to the ExperienceLocale. + // Example: "UCRG64darCZhb". + ChannelId string `json:"channelId,omitempty"` + + // Country: Country where the ExperienceLocale is available, using the + // "ISO 3166-1 alpha-2" format. Example: "US". + Country string `json:"country,omitempty"` + + // CreatedTime: Timestamp when the ExperienceLocale was created. + CreatedTime string `json:"createdTime,omitempty"` + + // CustomIds: List of custom IDs (defined by the partner) linked to this + // ExperienceLocale. Example: "R86241" + CustomIds []string `json:"customIds,omitempty"` + + // EarliestAvailStartTime: Timestamp of the earliest start date of the + // Avails linked to this ExperienceLocale. + EarliestAvailStartTime string `json:"earliestAvailStartTime,omitempty"` + + // EditLevelEidr: Edit-level EIDR ID. Example: + // "10.5240/1489-49A2-3956-4B2D-FE16-6". + EditLevelEidr string `json:"editLevelEidr,omitempty"` + + // ElId: ID internally generated by Google to uniquely identify a + // ExperienceLocale. Example: 'KRZiVjY9h7t' + ElId string `json:"elId,omitempty"` + + // InventoryId: InventoryID as defined in the EMA specs. + InventoryId string `json:"inventoryId,omitempty"` + + // Language: Language of the ExperienceLocale, using the "BCP 47" + // format. Examples: "en", "en-US", "es", "es-419". + Language string `json:"language,omitempty"` + + // Name: Default Edit name, usually in the language of the country of + // origin. Example: "Googlers, The". + Name string `json:"name,omitempty"` + + // NormalizedPriority: A simpler representation of the priority. + // + // Possible values: + // "NORMALIZED_PRIORITY_UNSPECIFIED" + // "LOW_PRIORITY" + // "HIGH_PRIORITY" + NormalizedPriority string `json:"normalizedPriority,omitempty"` + + // PlayableSequenceId: PlayableSequenceID as defined in the EMA specs. + PlayableSequenceId string `json:"playableSequenceId,omitempty"` + + // PphNames: Name of the post-production houses that manage the + // ExperienceLocale. + PphNames []string `json:"pphNames,omitempty"` + + // PresentationId: PresentationID as defined in the EMA specs. + PresentationId string `json:"presentationId,omitempty"` + + // Priority: ExperienceLocale priority, as defined by Google. The higher + // the value, the higher the priority. Example: 90 + Priority float64 `json:"priority,omitempty"` + + // Status: High-level status of the ExperienceLocale. + // + // Possible values: + // "STATUS_UNSPECIFIED" + // "STATUS_APPROVED" + // "STATUS_FAILED" + // "STATUS_PROCESSING" + // "STATUS_UNFULFILLED" + // "STATUS_NOT_AVAILABLE" + Status string `json:"status,omitempty"` + + // StudioName: Name of the studio that owns the ExperienceLocale. + StudioName string `json:"studioName,omitempty"` + + // TitleLevelEidr: Title-level EIDR ID. Example: + // "10.5240/1489-49A2-3956-4B2D-FE16-5". + TitleLevelEidr string `json:"titleLevelEidr,omitempty"` + + // TrailerId: Trailer ID, as defined by Google, linked to the trailer + // video in the ExperienceLocale. Example: 'gtry457_tr'. + TrailerId string `json:"trailerId,omitempty"` + + // Type: Type of the Edit linked to the ExperienceLocale. + // + // Possible values: + // "TITLE_TYPE_UNSPECIFIED" + // "MOVIE" + // "SEASON" + // "EPISODE" + Type string `json:"type,omitempty"` + + // VideoId: Video ID, as defined by Google, linked to the feature video + // in the ExperienceLocale. Example: 'gtry456_xc'. + VideoId string `json:"videoId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AltCutId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ExperienceLocale) MarshalJSON() ([]byte, error) { + type noMethod ExperienceLocale + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListAvailsResponse: Response to the 'ListAvails' method. +type ListAvailsResponse struct { + // Avails: List of Avails that match the request criteria. + Avails []*Avail `json:"avails,omitempty"` + + // NextPageToken: See _List methods rules_ for info about this field. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Avails") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListAvailsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListAvailsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListExperienceLocalesResponse: Response to the +// 'ListExperienceLocales' method. +type ListExperienceLocalesResponse struct { + // ExperienceLocales: List of ExperienceLocales that match the request + // criteria. + ExperienceLocales []*ExperienceLocale `json:"experienceLocales,omitempty"` + + // NextPageToken: See _List methods rules_ for info about this field. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ExperienceLocales") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListExperienceLocalesResponse) MarshalJSON() ([]byte, error) { + type noMethod ListExperienceLocalesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListOrdersResponse: Response to the 'ListOrders' method. +type ListOrdersResponse struct { + // NextPageToken: See _List methods rules_ for info about this field. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Orders: List of Orders that match the request criteria. + Orders []*Order `json:"orders,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListOrdersResponse) MarshalJSON() ([]byte, error) { + type noMethod ListOrdersResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListStoreInfosResponse: Response to the 'ListStoreInfos' method. +type ListStoreInfosResponse struct { + // NextPageToken: See 'List methods rules' for info about this field. + NextPageToken string `json:"nextPageToken,omitempty"` + + // StoreInfos: List of StoreInfos that match the request criteria. + StoreInfos []*StoreInfo `json:"storeInfos,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListStoreInfosResponse) MarshalJSON() ([]byte, error) { + type noMethod ListStoreInfosResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Order: An Order tracks the fulfillment of an Edit when delivered +// using the legacy, non-component-based delivery. Each Order is +// uniquely identified by an `order_id`, which is generated by Google. +// Externally, Orders can also be identified by partners using its +// `custom_id` (when provided). +type Order struct { + // ApprovedTime: Timestamp when the Order was approved. + ApprovedTime string `json:"approvedTime,omitempty"` + + // ChannelId: YouTube Channel ID that should be used to fulfill the + // Order. Example: "UCRG64darCZhb". + ChannelId string `json:"channelId,omitempty"` + + // ChannelName: YouTube Channel Name that should be used to fulfill the + // Order. Example: "Google_channel". + ChannelName string `json:"channelName,omitempty"` + + // Countries: Countries where the Order is available, using the "ISO + // 3166-1 alpha-2" format (example: "US"). + Countries []string `json:"countries,omitempty"` + + // CustomId: ID that can be used to externally identify an Order. This + // ID is provided by partners when submitting the Avails. Example: + // 'GOOGLER_2006' + CustomId string `json:"customId,omitempty"` + + // EarliestAvailStartTime: Timestamp of the earliest start date of the + // Avails linked to this Order. + EarliestAvailStartTime string `json:"earliestAvailStartTime,omitempty"` + + // EpisodeName: Default Episode name, usually in the language of the + // country of origin. Only available for TV Edits Example: "Googlers, + // The - Pilot". + EpisodeName string `json:"episodeName,omitempty"` + + // LegacyPriority: Legacy Order priority, as defined by Google. Example: + // 'P0' + LegacyPriority string `json:"legacyPriority,omitempty"` + + // Name: Default Edit name, usually in the language of the country of + // origin. Example: "Googlers, The". + Name string `json:"name,omitempty"` + + // NormalizedPriority: A simpler representation of the priority. + // + // Possible values: + // "NORMALIZED_PRIORITY_UNSPECIFIED" + // "LOW_PRIORITY" + // "HIGH_PRIORITY" + NormalizedPriority string `json:"normalizedPriority,omitempty"` + + // OrderId: ID internally generated by Google to uniquely identify an + // Order. Example: 'abcde12_x' + OrderId string `json:"orderId,omitempty"` + + // OrderedTime: Timestamp when the Order was created. + OrderedTime string `json:"orderedTime,omitempty"` + + // PphName: Name of the post-production house that manages the Edit + // ordered. + PphName string `json:"pphName,omitempty"` + + // Priority: Order priority, as defined by Google. The higher the value, + // the higher the priority. Example: 90 + Priority float64 `json:"priority,omitempty"` + + // ReceivedTime: Timestamp when the Order was fulfilled. + ReceivedTime string `json:"receivedTime,omitempty"` + + // RejectionNote: Field explaining why an Order has been rejected. + // Example: "Trailer audio is 2ch mono, please re-deliver in stereo". + RejectionNote string `json:"rejectionNote,omitempty"` + + // SeasonName: Default Season name, usually in the language of the + // country of origin. Only available for TV Edits Example: "Googlers, + // The - A Brave New World". + SeasonName string `json:"seasonName,omitempty"` + + // ShowName: Default Show name, usually in the language of the country + // of origin. Only available for TV Edits Example: "Googlers, The". + ShowName string `json:"showName,omitempty"` + + // Status: High-level status of the order. + // + // Possible values: + // "STATUS_UNSPECIFIED" + // "STATUS_APPROVED" + // "STATUS_FAILED" + // "STATUS_PROCESSING" + // "STATUS_UNFULFILLED" + // "STATUS_NOT_AVAILABLE" + Status string `json:"status,omitempty"` + + // StatusDetail: Detailed status of the order + // + // Possible values: + // "ORDER_STATUS_UNSPECIFIED" + // "ORDER_STATUS_QC_APPROVED" + // "ORDER_STATUS_QC_REJECTION" + // "ORDER_STATUS_INTERNAL_FIX" + // "ORDER_STATUS_OPEN_ORDER" + // "ORDER_STATUS_NOT_AVAILABLE" + // "ORDER_STATUS_AWAITING_REDELIVERY" + // "ORDER_STATUS_READY_FOR_QC" + StatusDetail string `json:"statusDetail,omitempty"` + + // StudioName: Name of the studio that owns the Edit ordered. + StudioName string `json:"studioName,omitempty"` + + // Type: Type of the Edit linked to the Order. + // + // Possible values: + // "TITLE_TYPE_UNSPECIFIED" + // "MOVIE" + // "SEASON" + // "EPISODE" + Type string `json:"type,omitempty"` + + // VideoId: Google-generated ID identifying the video linked to this + // Order, once delivered. Example: 'gtry456_xc'. + VideoId string `json:"videoId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ApprovedTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Order) MarshalJSON() ([]byte, error) { + type noMethod Order + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// StoreInfo: Information about a playable sequence (video) associated +// with an Edit and available at the Google Play Store. Internally, each +// StoreInfo is uniquely identified by a `video_id` and `country`. +// Externally, Title-level EIDR or Edit-level EIDR, if provided, can +// also be used to identify a specific title or edit in a country. +type StoreInfo struct { + // AudioTracks: Audio tracks available for this Edit. + AudioTracks []string `json:"audioTracks,omitempty"` + + // Country: Country where Edit is available in ISO 3166-1 alpha-2 + // country code. Example: "US". + Country string `json:"country,omitempty"` + + // EditLevelEidr: Edit-level EIDR ID. Example: + // "10.5240/1489-49A2-3956-4B2D-FE16-6". + EditLevelEidr string `json:"editLevelEidr,omitempty"` + + // EpisodeNumber: The number assigned to the episode within a season. + // Only available on TV Edits. Example: "1". + EpisodeNumber string `json:"episodeNumber,omitempty"` + + // HasAudio51: Whether the Edit has a 5.1 channel audio track. + HasAudio51 bool `json:"hasAudio51,omitempty"` + + // HasEstOffer: Whether the Edit has a EST offer. + HasEstOffer bool `json:"hasEstOffer,omitempty"` + + // HasHdOffer: Whether the Edit has a HD offer. + HasHdOffer bool `json:"hasHdOffer,omitempty"` + + // HasInfoCards: Whether the Edit has info cards. + HasInfoCards bool `json:"hasInfoCards,omitempty"` + + // HasSdOffer: Whether the Edit has a SD offer. + HasSdOffer bool `json:"hasSdOffer,omitempty"` + + // HasVodOffer: Whether the Edit has a VOD offer. + HasVodOffer bool `json:"hasVodOffer,omitempty"` + + // LiveTime: Timestamp when the Edit went live on the Store. + LiveTime string `json:"liveTime,omitempty"` + + // Mid: Knowledge Graph ID associated to this Edit, if available. This + // ID links the Edit to its knowledge entity, externally accessible at + // http://freebase.com. In the absense of Title EIDR or Edit EIDR, this + // ID helps link together multiple Edits across countries. Example: + // '/m/0ffx29' + Mid string `json:"mid,omitempty"` + + // Name: Default Edit name, usually in the language of the country of + // origin. Example: "Googlers, The". + Name string `json:"name,omitempty"` + + // PphNames: Name of the post-production houses that manage the Edit. + PphNames []string `json:"pphNames,omitempty"` + + // SeasonId: Google-generated ID identifying the season linked to the + // Edit. Only available for TV Edits. Example: 'ster23ex' + SeasonId string `json:"seasonId,omitempty"` + + // SeasonName: Default Season name, usually in the language of the + // country of origin. Only available for TV Edits Example: "Googlers, + // The - A Brave New World". + SeasonName string `json:"seasonName,omitempty"` + + // SeasonNumber: The number assigned to the season within a show. Only + // available on TV Edits. Example: "1". + SeasonNumber string `json:"seasonNumber,omitempty"` + + // ShowId: Google-generated ID identifying the show linked to the Edit. + // Only available for TV Edits. Example: 'et2hsue_x' + ShowId string `json:"showId,omitempty"` + + // ShowName: Default Show name, usually in the language of the country + // of origin. Only available for TV Edits Example: "Googlers, The". + ShowName string `json:"showName,omitempty"` + + // StudioName: Name of the studio that owns the Edit ordered. + StudioName string `json:"studioName,omitempty"` + + // Subtitles: Subtitles available for this Edit. + Subtitles []string `json:"subtitles,omitempty"` + + // TitleLevelEidr: Title-level EIDR ID. Example: + // "10.5240/1489-49A2-3956-4B2D-FE16-5". + TitleLevelEidr string `json:"titleLevelEidr,omitempty"` + + // TrailerId: Google-generated ID identifying the trailer linked to the + // Edit. Example: 'bhd_4e_cx' + TrailerId string `json:"trailerId,omitempty"` + + // Type: Edit type, like Movie, Episode or Season. + // + // Possible values: + // "TITLE_TYPE_UNSPECIFIED" + // "MOVIE" + // "SEASON" + // "EPISODE" + Type string `json:"type,omitempty"` + + // VideoId: Google-generated ID identifying the video linked to the + // Edit. Example: 'gtry456_xc' + VideoId string `json:"videoId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AudioTracks") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *StoreInfo) MarshalJSON() ([]byte, error) { + type noMethod StoreInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "playmoviespartner.accounts.avails.list": + +type AccountsAvailsListCall struct { + s *Service + accountId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List Avails owned or managed by the partner. See +// _Authentication and Authorization rules_ and _List methods rules_ for +// more information about this method. +func (r *AccountsAvailsService) List(accountId string) *AccountsAvailsListCall { + c := &AccountsAvailsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// AltId sets the optional parameter "altId": Filter Avails that match a +// case-insensitive, partner-specific custom id. +func (c *AccountsAvailsListCall) AltId(altId string) *AccountsAvailsListCall { + c.opt_["altId"] = altId + return c +} + +// PageSize sets the optional parameter "pageSize": See _List methods +// rules_ for info about this field. +func (c *AccountsAvailsListCall) PageSize(pageSize int64) *AccountsAvailsListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": See _List methods +// rules_ for info about this field. +func (c *AccountsAvailsListCall) PageToken(pageToken string) *AccountsAvailsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// PphNames sets the optional parameter "pphNames": See _List methods +// rules_ for info about this field. +func (c *AccountsAvailsListCall) PphNames(pphNames string) *AccountsAvailsListCall { + c.opt_["pphNames"] = pphNames + return c +} + +// StudioNames sets the optional parameter "studioNames": See _List +// methods rules_ for info about this field. +func (c *AccountsAvailsListCall) StudioNames(studioNames string) *AccountsAvailsListCall { + c.opt_["studioNames"] = studioNames + return c +} + +// Territories sets the optional parameter "territories": Filter Avails +// that match (case-insensitive) any of the given country codes, using +// the "ISO 3166-1 alpha-2" format (examples: "US", "us", "Us"). +func (c *AccountsAvailsListCall) Territories(territories string) *AccountsAvailsListCall { + c.opt_["territories"] = territories + return c +} + +// Title sets the optional parameter "title": Filter Avails that match a +// case-insensitive substring of the default Title name. +func (c *AccountsAvailsListCall) Title(title string) *AccountsAvailsListCall { + c.opt_["title"] = title + return c +} + +// VideoIds sets the optional parameter "videoIds": Filter Avails that +// match any of the given `video_id`s. +func (c *AccountsAvailsListCall) VideoIds(videoIds string) *AccountsAvailsListCall { + c.opt_["videoIds"] = videoIds + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsAvailsListCall) Fields(s ...googleapi.Field) *AccountsAvailsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsAvailsListCall) IfNoneMatch(entityTag string) *AccountsAvailsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsAvailsListCall) Context(ctx context.Context) *AccountsAvailsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsAvailsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["altId"]; ok { + params.Set("altId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pphNames"]; ok { + params.Set("pphNames", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["studioNames"]; ok { + params.Set("studioNames", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["territories"]; ok { + params.Set("territories", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["title"]; ok { + params.Set("title", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["videoIds"]; ok { + params.Set("videoIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accounts/{accountId}/avails") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "playmoviespartner.accounts.avails.list" call. +// Exactly one of *ListAvailsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListAvailsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsAvailsListCall) Do() (*ListAvailsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListAvailsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List Avails owned or managed by the partner. See _Authentication and Authorization rules_ and _List methods rules_ for more information about this method.", + // "httpMethod": "GET", + // "id": "playmoviespartner.accounts.avails.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "REQUIRED. See _General rules_ for more information about this field.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "altId": { + // "description": "Filter Avails that match a case-insensitive, partner-specific custom id.", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "See _List methods rules_ for info about this field.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "See _List methods rules_ for info about this field.", + // "location": "query", + // "type": "string" + // }, + // "pphNames": { + // "description": "See _List methods rules_ for info about this field.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "studioNames": { + // "description": "See _List methods rules_ for info about this field.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "territories": { + // "description": "Filter Avails that match (case-insensitive) any of the given country codes, using the \"ISO 3166-1 alpha-2\" format (examples: \"US\", \"us\", \"Us\").", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "title": { + // "description": "Filter Avails that match a case-insensitive substring of the default Title name.", + // "location": "query", + // "type": "string" + // }, + // "videoIds": { + // "description": "Filter Avails that match any of the given `video_id`s.", + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "v1/accounts/{accountId}/avails", + // "response": { + // "$ref": "ListAvailsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playmovies_partner.readonly" + // ] + // } + +} + +// method id "playmoviespartner.accounts.experienceLocales.get": + +type AccountsExperienceLocalesGetCall struct { + s *Service + accountId string + elId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Get an ExperienceLocale given its id. See _Authentication and +// Authorization rules_ and _Get methods rules_ for more information +// about this method. +func (r *AccountsExperienceLocalesService) Get(accountId string, elId string) *AccountsExperienceLocalesGetCall { + c := &AccountsExperienceLocalesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.elId = elId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsExperienceLocalesGetCall) Fields(s ...googleapi.Field) *AccountsExperienceLocalesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsExperienceLocalesGetCall) IfNoneMatch(entityTag string) *AccountsExperienceLocalesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsExperienceLocalesGetCall) Context(ctx context.Context) *AccountsExperienceLocalesGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsExperienceLocalesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accounts/{accountId}/experienceLocales/{elId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "elId": c.elId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "playmoviespartner.accounts.experienceLocales.get" call. +// Exactly one of *ExperienceLocale or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ExperienceLocale.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsExperienceLocalesGetCall) Do() (*ExperienceLocale, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ExperienceLocale{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get an ExperienceLocale given its id. See _Authentication and Authorization rules_ and _Get methods rules_ for more information about this method.", + // "httpMethod": "GET", + // "id": "playmoviespartner.accounts.experienceLocales.get", + // "parameterOrder": [ + // "accountId", + // "elId" + // ], + // "parameters": { + // "accountId": { + // "description": "REQUIRED. See _General rules_ for more information about this field.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "elId": { + // "description": "REQUIRED. ExperienceLocale ID, as defined by Google.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/accounts/{accountId}/experienceLocales/{elId}", + // "response": { + // "$ref": "ExperienceLocale" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playmovies_partner.readonly" + // ] + // } + +} + +// method id "playmoviespartner.accounts.experienceLocales.list": + +type AccountsExperienceLocalesListCall struct { + s *Service + accountId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List ExperienceLocales owned or managed by the partner. See +// _Authentication and Authorization rules_ and _List methods rules_ for +// more information about this method. +func (r *AccountsExperienceLocalesService) List(accountId string) *AccountsExperienceLocalesListCall { + c := &AccountsExperienceLocalesListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// AltCutId sets the optional parameter "altCutId": Filter +// ExperienceLocales that match a case-insensitive, partner-specific +// Alternative Cut ID. +func (c *AccountsExperienceLocalesListCall) AltCutId(altCutId string) *AccountsExperienceLocalesListCall { + c.opt_["altCutId"] = altCutId + return c +} + +// CustomId sets the optional parameter "customId": Filter +// ExperienceLocales that match a case-insensitive, partner-specific +// custom id. +func (c *AccountsExperienceLocalesListCall) CustomId(customId string) *AccountsExperienceLocalesListCall { + c.opt_["customId"] = customId + return c +} + +// EditLevelEidr sets the optional parameter "editLevelEidr": Filter +// ExperienceLocales that match a given edit-level EIDR. +func (c *AccountsExperienceLocalesListCall) EditLevelEidr(editLevelEidr string) *AccountsExperienceLocalesListCall { + c.opt_["editLevelEidr"] = editLevelEidr + return c +} + +// PageSize sets the optional parameter "pageSize": See _List methods +// rules_ for info about this field. +func (c *AccountsExperienceLocalesListCall) PageSize(pageSize int64) *AccountsExperienceLocalesListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": See _List methods +// rules_ for info about this field. +func (c *AccountsExperienceLocalesListCall) PageToken(pageToken string) *AccountsExperienceLocalesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// PphNames sets the optional parameter "pphNames": See _List methods +// rules_ for info about this field. +func (c *AccountsExperienceLocalesListCall) PphNames(pphNames string) *AccountsExperienceLocalesListCall { + c.opt_["pphNames"] = pphNames + return c +} + +// Status sets the optional parameter "status": Filter ExperienceLocales +// that match one of the given status. +// +// Possible values: +// "STATUS_UNSPECIFIED" +// "STATUS_APPROVED" +// "STATUS_FAILED" +// "STATUS_PROCESSING" +// "STATUS_UNFULFILLED" +// "STATUS_NOT_AVAILABLE" +func (c *AccountsExperienceLocalesListCall) Status(status string) *AccountsExperienceLocalesListCall { + c.opt_["status"] = status + return c +} + +// StudioNames sets the optional parameter "studioNames": See _List +// methods rules_ for info about this field. +func (c *AccountsExperienceLocalesListCall) StudioNames(studioNames string) *AccountsExperienceLocalesListCall { + c.opt_["studioNames"] = studioNames + return c +} + +// TitleLevelEidr sets the optional parameter "titleLevelEidr": Filter +// ExperienceLocales that match a given title-level EIDR. +func (c *AccountsExperienceLocalesListCall) TitleLevelEidr(titleLevelEidr string) *AccountsExperienceLocalesListCall { + c.opt_["titleLevelEidr"] = titleLevelEidr + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsExperienceLocalesListCall) Fields(s ...googleapi.Field) *AccountsExperienceLocalesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsExperienceLocalesListCall) IfNoneMatch(entityTag string) *AccountsExperienceLocalesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsExperienceLocalesListCall) Context(ctx context.Context) *AccountsExperienceLocalesListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsExperienceLocalesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["altCutId"]; ok { + params.Set("altCutId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["customId"]; ok { + params.Set("customId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["editLevelEidr"]; ok { + params.Set("editLevelEidr", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pphNames"]; ok { + params.Set("pphNames", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["status"]; ok { + params.Set("status", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["studioNames"]; ok { + params.Set("studioNames", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["titleLevelEidr"]; ok { + params.Set("titleLevelEidr", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accounts/{accountId}/experienceLocales") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "playmoviespartner.accounts.experienceLocales.list" call. +// Exactly one of *ListExperienceLocalesResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListExperienceLocalesResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsExperienceLocalesListCall) Do() (*ListExperienceLocalesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListExperienceLocalesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List ExperienceLocales owned or managed by the partner. See _Authentication and Authorization rules_ and _List methods rules_ for more information about this method.", + // "httpMethod": "GET", + // "id": "playmoviespartner.accounts.experienceLocales.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "REQUIRED. See _General rules_ for more information about this field.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "altCutId": { + // "description": "Filter ExperienceLocales that match a case-insensitive, partner-specific Alternative Cut ID.", + // "location": "query", + // "type": "string" + // }, + // "customId": { + // "description": "Filter ExperienceLocales that match a case-insensitive, partner-specific custom id.", + // "location": "query", + // "type": "string" + // }, + // "editLevelEidr": { + // "description": "Filter ExperienceLocales that match a given edit-level EIDR.", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "See _List methods rules_ for info about this field.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "See _List methods rules_ for info about this field.", + // "location": "query", + // "type": "string" + // }, + // "pphNames": { + // "description": "See _List methods rules_ for info about this field.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "status": { + // "description": "Filter ExperienceLocales that match one of the given status.", + // "enum": [ + // "STATUS_UNSPECIFIED", + // "STATUS_APPROVED", + // "STATUS_FAILED", + // "STATUS_PROCESSING", + // "STATUS_UNFULFILLED", + // "STATUS_NOT_AVAILABLE" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "studioNames": { + // "description": "See _List methods rules_ for info about this field.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "titleLevelEidr": { + // "description": "Filter ExperienceLocales that match a given title-level EIDR.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/accounts/{accountId}/experienceLocales", + // "response": { + // "$ref": "ListExperienceLocalesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playmovies_partner.readonly" + // ] + // } + +} + +// method id "playmoviespartner.accounts.orders.get": + +type AccountsOrdersGetCall struct { + s *Service + accountId string + orderId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Get an Order given its id. See _Authentication and Authorization +// rules_ and _Get methods rules_ for more information about this +// method. +func (r *AccountsOrdersService) Get(accountId string, orderId string) *AccountsOrdersGetCall { + c := &AccountsOrdersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.orderId = orderId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsOrdersGetCall) Fields(s ...googleapi.Field) *AccountsOrdersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsOrdersGetCall) IfNoneMatch(entityTag string) *AccountsOrdersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsOrdersGetCall) Context(ctx context.Context) *AccountsOrdersGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsOrdersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accounts/{accountId}/orders/{orderId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "orderId": c.orderId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "playmoviespartner.accounts.orders.get" call. +// Exactly one of *Order or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Order.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsOrdersGetCall) Do() (*Order, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Order{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get an Order given its id. See _Authentication and Authorization rules_ and _Get methods rules_ for more information about this method.", + // "httpMethod": "GET", + // "id": "playmoviespartner.accounts.orders.get", + // "parameterOrder": [ + // "accountId", + // "orderId" + // ], + // "parameters": { + // "accountId": { + // "description": "REQUIRED. See _General rules_ for more information about this field.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "orderId": { + // "description": "REQUIRED. Order ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/accounts/{accountId}/orders/{orderId}", + // "response": { + // "$ref": "Order" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playmovies_partner.readonly" + // ] + // } + +} + +// method id "playmoviespartner.accounts.orders.list": + +type AccountsOrdersListCall struct { + s *Service + accountId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List Orders owned or managed by the partner. See +// _Authentication and Authorization rules_ and _List methods rules_ for +// more information about this method. +func (r *AccountsOrdersService) List(accountId string) *AccountsOrdersListCall { + c := &AccountsOrdersListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// CustomId sets the optional parameter "customId": Filter Orders that +// match a case-insensitive, partner-specific custom id. +func (c *AccountsOrdersListCall) CustomId(customId string) *AccountsOrdersListCall { + c.opt_["customId"] = customId + return c +} + +// Name sets the optional parameter "name": Filter Orders that match a +// title name (case-insensitive, sub-string match). +func (c *AccountsOrdersListCall) Name(name string) *AccountsOrdersListCall { + c.opt_["name"] = name + return c +} + +// PageSize sets the optional parameter "pageSize": See _List methods +// rules_ for info about this field. +func (c *AccountsOrdersListCall) PageSize(pageSize int64) *AccountsOrdersListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": See _List methods +// rules_ for info about this field. +func (c *AccountsOrdersListCall) PageToken(pageToken string) *AccountsOrdersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// PphNames sets the optional parameter "pphNames": See _List methods +// rules_ for info about this field. +func (c *AccountsOrdersListCall) PphNames(pphNames string) *AccountsOrdersListCall { + c.opt_["pphNames"] = pphNames + return c +} + +// Status sets the optional parameter "status": Filter Orders that match +// one of the given status. +// +// Possible values: +// "STATUS_UNSPECIFIED" +// "STATUS_APPROVED" +// "STATUS_FAILED" +// "STATUS_PROCESSING" +// "STATUS_UNFULFILLED" +// "STATUS_NOT_AVAILABLE" +func (c *AccountsOrdersListCall) Status(status string) *AccountsOrdersListCall { + c.opt_["status"] = status + return c +} + +// StudioNames sets the optional parameter "studioNames": See _List +// methods rules_ for info about this field. +func (c *AccountsOrdersListCall) StudioNames(studioNames string) *AccountsOrdersListCall { + c.opt_["studioNames"] = studioNames + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsOrdersListCall) Fields(s ...googleapi.Field) *AccountsOrdersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsOrdersListCall) IfNoneMatch(entityTag string) *AccountsOrdersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsOrdersListCall) Context(ctx context.Context) *AccountsOrdersListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsOrdersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["customId"]; ok { + params.Set("customId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["name"]; ok { + params.Set("name", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pphNames"]; ok { + params.Set("pphNames", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["status"]; ok { + params.Set("status", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["studioNames"]; ok { + params.Set("studioNames", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accounts/{accountId}/orders") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "playmoviespartner.accounts.orders.list" call. +// Exactly one of *ListOrdersResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListOrdersResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsOrdersListCall) Do() (*ListOrdersResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListOrdersResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List Orders owned or managed by the partner. See _Authentication and Authorization rules_ and _List methods rules_ for more information about this method.", + // "httpMethod": "GET", + // "id": "playmoviespartner.accounts.orders.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "REQUIRED. See _General rules_ for more information about this field.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "customId": { + // "description": "Filter Orders that match a case-insensitive, partner-specific custom id.", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "Filter Orders that match a title name (case-insensitive, sub-string match).", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "See _List methods rules_ for info about this field.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "See _List methods rules_ for info about this field.", + // "location": "query", + // "type": "string" + // }, + // "pphNames": { + // "description": "See _List methods rules_ for info about this field.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "status": { + // "description": "Filter Orders that match one of the given status.", + // "enum": [ + // "STATUS_UNSPECIFIED", + // "STATUS_APPROVED", + // "STATUS_FAILED", + // "STATUS_PROCESSING", + // "STATUS_UNFULFILLED", + // "STATUS_NOT_AVAILABLE" + // ], + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "studioNames": { + // "description": "See _List methods rules_ for info about this field.", + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "v1/accounts/{accountId}/orders", + // "response": { + // "$ref": "ListOrdersResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playmovies_partner.readonly" + // ] + // } + +} + +// method id "playmoviespartner.accounts.storeInfos.list": + +type AccountsStoreInfosListCall struct { + s *Service + accountId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List StoreInfos owned or managed by the partner. See +// _Authentication and Authorization rules_ and _List methods rules_ for +// more information about this method. +func (r *AccountsStoreInfosService) List(accountId string) *AccountsStoreInfosListCall { + c := &AccountsStoreInfosListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// Countries sets the optional parameter "countries": Filter StoreInfos +// that match (case-insensitive) any of the given country codes, using +// the "ISO 3166-1 alpha-2" format (examples: "US", "us", "Us"). +func (c *AccountsStoreInfosListCall) Countries(countries string) *AccountsStoreInfosListCall { + c.opt_["countries"] = countries + return c +} + +// Name sets the optional parameter "name": Filter StoreInfos that match +// a case-insensitive substring of the default name. +func (c *AccountsStoreInfosListCall) Name(name string) *AccountsStoreInfosListCall { + c.opt_["name"] = name + return c +} + +// PageSize sets the optional parameter "pageSize": See _List methods +// rules_ for info about this field. +func (c *AccountsStoreInfosListCall) PageSize(pageSize int64) *AccountsStoreInfosListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": See _List methods +// rules_ for info about this field. +func (c *AccountsStoreInfosListCall) PageToken(pageToken string) *AccountsStoreInfosListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// PphNames sets the optional parameter "pphNames": See _List methods +// rules_ for info about this field. +func (c *AccountsStoreInfosListCall) PphNames(pphNames string) *AccountsStoreInfosListCall { + c.opt_["pphNames"] = pphNames + return c +} + +// StudioNames sets the optional parameter "studioNames": See _List +// methods rules_ for info about this field. +func (c *AccountsStoreInfosListCall) StudioNames(studioNames string) *AccountsStoreInfosListCall { + c.opt_["studioNames"] = studioNames + return c +} + +// VideoId sets the optional parameter "videoId": Filter StoreInfos that +// match a given `video_id`. NOTE: this field is deprecated and will be +// removed on V2; `video_ids` should be used instead. +func (c *AccountsStoreInfosListCall) VideoId(videoId string) *AccountsStoreInfosListCall { + c.opt_["videoId"] = videoId + return c +} + +// VideoIds sets the optional parameter "videoIds": Filter StoreInfos +// that match any of the given `video_id`s. +func (c *AccountsStoreInfosListCall) VideoIds(videoIds string) *AccountsStoreInfosListCall { + c.opt_["videoIds"] = videoIds + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsStoreInfosListCall) Fields(s ...googleapi.Field) *AccountsStoreInfosListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsStoreInfosListCall) IfNoneMatch(entityTag string) *AccountsStoreInfosListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsStoreInfosListCall) Context(ctx context.Context) *AccountsStoreInfosListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsStoreInfosListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["countries"]; ok { + params.Set("countries", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["name"]; ok { + params.Set("name", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pphNames"]; ok { + params.Set("pphNames", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["studioNames"]; ok { + params.Set("studioNames", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["videoId"]; ok { + params.Set("videoId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["videoIds"]; ok { + params.Set("videoIds", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accounts/{accountId}/storeInfos") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "playmoviespartner.accounts.storeInfos.list" call. +// Exactly one of *ListStoreInfosResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListStoreInfosResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsStoreInfosListCall) Do() (*ListStoreInfosResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListStoreInfosResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List StoreInfos owned or managed by the partner. See _Authentication and Authorization rules_ and _List methods rules_ for more information about this method.", + // "httpMethod": "GET", + // "id": "playmoviespartner.accounts.storeInfos.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "REQUIRED. See _General rules_ for more information about this field.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "countries": { + // "description": "Filter StoreInfos that match (case-insensitive) any of the given country codes, using the \"ISO 3166-1 alpha-2\" format (examples: \"US\", \"us\", \"Us\").", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "name": { + // "description": "Filter StoreInfos that match a case-insensitive substring of the default name.", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "See _List methods rules_ for info about this field.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "See _List methods rules_ for info about this field.", + // "location": "query", + // "type": "string" + // }, + // "pphNames": { + // "description": "See _List methods rules_ for info about this field.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "studioNames": { + // "description": "See _List methods rules_ for info about this field.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "videoId": { + // "description": "Filter StoreInfos that match a given `video_id`. NOTE: this field is deprecated and will be removed on V2; `video_ids` should be used instead.", + // "location": "query", + // "type": "string" + // }, + // "videoIds": { + // "description": "Filter StoreInfos that match any of the given `video_id`s.", + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "v1/accounts/{accountId}/storeInfos", + // "response": { + // "$ref": "ListStoreInfosResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playmovies_partner.readonly" + // ] + // } + +} + +// method id "playmoviespartner.accounts.storeInfos.country.get": + +type AccountsStoreInfosCountryGetCall struct { + s *Service + accountId string + videoId string + country string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Get a StoreInfo given its video id and country. See +// _Authentication and Authorization rules_ and _Get methods rules_ for +// more information about this method. +func (r *AccountsStoreInfosCountryService) Get(accountId string, videoId string, country string) *AccountsStoreInfosCountryGetCall { + c := &AccountsStoreInfosCountryGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.videoId = videoId + c.country = country + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsStoreInfosCountryGetCall) Fields(s ...googleapi.Field) *AccountsStoreInfosCountryGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsStoreInfosCountryGetCall) IfNoneMatch(entityTag string) *AccountsStoreInfosCountryGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsStoreInfosCountryGetCall) Context(ctx context.Context) *AccountsStoreInfosCountryGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsStoreInfosCountryGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accounts/{accountId}/storeInfos/{videoId}/country/{country}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "videoId": c.videoId, + "country": c.country, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "playmoviespartner.accounts.storeInfos.country.get" call. +// Exactly one of *StoreInfo or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *StoreInfo.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsStoreInfosCountryGetCall) Do() (*StoreInfo, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &StoreInfo{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get a StoreInfo given its video id and country. See _Authentication and Authorization rules_ and _Get methods rules_ for more information about this method.", + // "httpMethod": "GET", + // "id": "playmoviespartner.accounts.storeInfos.country.get", + // "parameterOrder": [ + // "accountId", + // "videoId", + // "country" + // ], + // "parameters": { + // "accountId": { + // "description": "REQUIRED. See _General rules_ for more information about this field.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "country": { + // "description": "REQUIRED. Edit country.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "videoId": { + // "description": "REQUIRED. Video ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/accounts/{accountId}/storeInfos/{videoId}/country/{country}", + // "response": { + // "$ref": "StoreInfo" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/playmovies_partner.readonly" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/plus/v1/plus-api.json b/Godeps/_workspace/src/google.golang.org/api/plus/v1/plus-api.json new file mode 100644 index 000000000..b7fe391e7 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/plus/v1/plus-api.json @@ -0,0 +1,2021 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/lgRkloFO1UVq7VPz42VZJlIBWaI\"", + "discoveryVersion": "v1", + "id": "plus:v1", + "name": "plus", + "version": "v1", + "revision": "20151014", + "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 your basic profile info" + } + } + } + }, + "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": { + "clientSpecificActorInfo": { + "type": "object", + "description": "Actor info specific to particular clients.", + "properties": { + "youtubeActorInfo": { + "type": "object", + "description": "Actor info specific to YouTube clients.", + "properties": { + "channelId": { + "type": "string", + "description": "ID of the YouTube channel owned by the Actor." + } + } + } + } + }, + "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." + }, + "verification": { + "type": "object", + "description": "Verification status of actor.", + "properties": { + "adHocVerified": { + "type": "string", + "description": "Verification for one-time or manual processes." + } + } + } + } + }, + "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": { + "clientSpecificActorInfo": { + "type": "object", + "description": "Actor info specific to particular clients.", + "properties": { + "youtubeActorInfo": { + "type": "object", + "description": "Actor info specific to YouTube clients.", + "properties": { + "channelId": { + "type": "string", + "description": "ID of the YouTube channel owned by the Actor." + } + } + } + } + }, + "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." + }, + "verification": { + "type": "object", + "description": "Verification status of actor.", + "properties": { + "adHocVerified": { + "type": "string", + "description": "Verification for one-time or manual processes." + } + } + } + } + }, + "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": { + "clientSpecificActorInfo": { + "type": "object", + "description": "Actor info specific to particular clients.", + "properties": { + "youtubeActorInfo": { + "type": "object", + "description": "Actor info specific to YouTube clients.", + "properties": { + "channelId": { + "type": "string", + "description": "ID of the YouTube channel owned by the Actor." + } + } + } + } + }, + "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." + }, + "verification": { + "type": "object", + "description": "Verification status of actor.", + "properties": { + "adHocVerified": { + "type": "string", + "description": "Verification for one-time or manual processes." + } + } + } + } + }, + "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 object. Your app can choose how to identify objects. The object.id is required if you are writing an action that does not have a corresponding web page or object.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 object 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" + }, + "object": { + "$ref": "ItemScope", + "description": "The object on which the action was performed. Specifying this is equivalent with specifying \"target\". Note that responses from the server will use the \"target\" field instead for backward-compatibility with older clients.", + "annotations": { + "required": [ + "plus.moments.insert" + ] + } + }, + "result": { + "$ref": "ItemScope", + "description": "The object generated by performing the action on the object. For example, a user writes a review of a restaurant, the object 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 schema.org type for the type of moment to write. For example, http://schema.org/AddAction. Note that responses from the server will use the Google schema type instead for backward-compatibility with older clients. 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": "(this field is not currently used)" + }, + "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": { + "isDefault": { + "type": "boolean", + "description": "Whether the person's profile photo is the default one" + }, + "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." + }, + "id": { + "type": "string", + "description": "The id 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 action 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 actions 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" + ] + } + } + }, + "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/Godeps/_workspace/src/google.golang.org/api/plus/v1/plus-gen.go b/Godeps/_workspace/src/google.golang.org/api/plus/v1/plus-gen.go new file mode 100644 index 000000000..ae03c405b --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/plus/v1/plus-gen.go @@ -0,0 +1,4040 @@ +// Package plus provides access to the Google+ API. +// +// See https://developers.google.com/+/api/ +// +// Usage example: +// +// import "google.golang.org/api/plus/v1" +// ... +// plusService, err := plus.New(oauthHttpClient) +package plus // import "google.golang.org/api/plus/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 your basic profile info + 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 + UserAgent string // optional additional User-Agent fragment + + Activities *ActivitiesService + + Comments *CommentsService + + Moments *MomentsService + + People *PeopleService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewActivitiesService(s *Service) *ActivitiesService { + rs := &ActivitiesService{s: s} + return rs +} + +type ActivitiesService struct { + s *Service +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Acl) MarshalJSON() ([]byte, error) { + type noMethod Acl + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Access") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Activity) MarshalJSON() ([]byte, error) { + type noMethod Activity + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityActor: The person who performed this activity. +type ActivityActor struct { + // ClientSpecificActorInfo: Actor info specific to particular clients. + ClientSpecificActorInfo *ActivityActorClientSpecificActorInfo `json:"clientSpecificActorInfo,omitempty"` + + // 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"` + + // Verification: Verification status of actor. + Verification *ActivityActorVerification `json:"verification,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "ClientSpecificActorInfo") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityActor) MarshalJSON() ([]byte, error) { + type noMethod ActivityActor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityActorClientSpecificActorInfo: Actor info specific to +// particular clients. +type ActivityActorClientSpecificActorInfo struct { + // YoutubeActorInfo: Actor info specific to YouTube clients. + YoutubeActorInfo *ActivityActorClientSpecificActorInfoYoutubeActorInfo `json:"youtubeActorInfo,omitempty"` + + // ForceSendFields is a list of field names (e.g. "YoutubeActorInfo") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityActorClientSpecificActorInfo) MarshalJSON() ([]byte, error) { + type noMethod ActivityActorClientSpecificActorInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityActorClientSpecificActorInfoYoutubeActorInfo: Actor info +// specific to YouTube clients. +type ActivityActorClientSpecificActorInfoYoutubeActorInfo struct { + // ChannelId: ID of the YouTube channel owned by the Actor. + ChannelId string `json:"channelId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ChannelId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityActorClientSpecificActorInfoYoutubeActorInfo) MarshalJSON() ([]byte, error) { + type noMethod ActivityActorClientSpecificActorInfoYoutubeActorInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityActorImage: The image representation of the actor. +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"` + + // ForceSendFields is a list of field names (e.g. "Url") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityActorImage) MarshalJSON() ([]byte, error) { + type noMethod ActivityActorImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityActorName: An object representation of the individual +// components of name. +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"` + + // ForceSendFields is a list of field names (e.g. "FamilyName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityActorName) MarshalJSON() ([]byte, error) { + type noMethod ActivityActorName + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityActorVerification: Verification status of actor. +type ActivityActorVerification struct { + // AdHocVerified: Verification for one-time or manual processes. + AdHocVerified string `json:"adHocVerified,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AdHocVerified") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityActorVerification) MarshalJSON() ([]byte, error) { + type noMethod ActivityActorVerification + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObject: The object of this activity. +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"` + + // ForceSendFields is a list of field names (e.g. "Actor") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObject) MarshalJSON() ([]byte, error) { + type noMethod ActivityObject + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObjectActor: 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. +type ActivityObjectActor struct { + // ClientSpecificActorInfo: Actor info specific to particular clients. + ClientSpecificActorInfo *ActivityObjectActorClientSpecificActorInfo `json:"clientSpecificActorInfo,omitempty"` + + // 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"` + + // Verification: Verification status of actor. + Verification *ActivityObjectActorVerification `json:"verification,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "ClientSpecificActorInfo") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectActor) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectActor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObjectActorClientSpecificActorInfo: Actor info specific to +// particular clients. +type ActivityObjectActorClientSpecificActorInfo struct { + // YoutubeActorInfo: Actor info specific to YouTube clients. + YoutubeActorInfo *ActivityObjectActorClientSpecificActorInfoYoutubeActorInfo `json:"youtubeActorInfo,omitempty"` + + // ForceSendFields is a list of field names (e.g. "YoutubeActorInfo") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectActorClientSpecificActorInfo) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectActorClientSpecificActorInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObjectActorClientSpecificActorInfoYoutubeActorInfo: Actor +// info specific to YouTube clients. +type ActivityObjectActorClientSpecificActorInfoYoutubeActorInfo struct { + // ChannelId: ID of the YouTube channel owned by the Actor. + ChannelId string `json:"channelId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ChannelId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectActorClientSpecificActorInfoYoutubeActorInfo) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectActorClientSpecificActorInfoYoutubeActorInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObjectActorImage: The image representation of the original +// actor. +type ActivityObjectActorImage struct { + // Url: A URL that points to a thumbnail photo of the original actor. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Url") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectActorImage) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectActorImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObjectActorVerification: Verification status of actor. +type ActivityObjectActorVerification struct { + // AdHocVerified: Verification for one-time or manual processes. + AdHocVerified string `json:"adHocVerified,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AdHocVerified") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectActorVerification) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectActorVerification + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Content") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectAttachments) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectAttachments + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObjectAttachmentsEmbed: If the attachment is a video, the +// embeddable link. +type ActivityObjectAttachmentsEmbed struct { + // Type: Media type of the link. + Type string `json:"type,omitempty"` + + // Url: URL of the link. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Type") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectAttachmentsEmbed) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectAttachmentsEmbed + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObjectAttachmentsFullImage: The full image URL for photo +// attachments. +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"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectAttachmentsFullImage) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectAttachmentsFullImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObjectAttachmentsImage: The preview image for photos or +// videos. +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"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectAttachmentsImage) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectAttachmentsImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectAttachmentsThumbnails) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectAttachmentsThumbnails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObjectAttachmentsThumbnailsImage: Image resource. +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"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectAttachmentsThumbnailsImage) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectAttachmentsThumbnailsImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObjectPlusoners: People who +1'd this activity. +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"` + + // ForceSendFields is a list of field names (e.g. "SelfLink") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectPlusoners) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectPlusoners + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObjectReplies: Comments in reply to this activity. +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"` + + // ForceSendFields is a list of field names (e.g. "SelfLink") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectReplies) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectReplies + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObjectResharers: People who reshared this activity. +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"` + + // ForceSendFields is a list of field names (e.g. "SelfLink") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectResharers) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectResharers + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityProvider: The service provider that initially published this +// activity. +type ActivityProvider struct { + // Title: Name of the service provider. + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Title") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityProvider) MarshalJSON() ([]byte, error) { + type noMethod ActivityProvider + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityFeed) MarshalJSON() ([]byte, error) { + type noMethod ActivityFeed + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Actor") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Comment) MarshalJSON() ([]byte, error) { + type noMethod Comment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentActor: The person who posted this comment. +type CommentActor struct { + // ClientSpecificActorInfo: Actor info specific to particular clients. + ClientSpecificActorInfo *CommentActorClientSpecificActorInfo `json:"clientSpecificActorInfo,omitempty"` + + // 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"` + + // Verification: Verification status of actor. + Verification *CommentActorVerification `json:"verification,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "ClientSpecificActorInfo") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentActor) MarshalJSON() ([]byte, error) { + type noMethod CommentActor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentActorClientSpecificActorInfo: Actor info specific to +// particular clients. +type CommentActorClientSpecificActorInfo struct { + // YoutubeActorInfo: Actor info specific to YouTube clients. + YoutubeActorInfo *CommentActorClientSpecificActorInfoYoutubeActorInfo `json:"youtubeActorInfo,omitempty"` + + // ForceSendFields is a list of field names (e.g. "YoutubeActorInfo") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentActorClientSpecificActorInfo) MarshalJSON() ([]byte, error) { + type noMethod CommentActorClientSpecificActorInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentActorClientSpecificActorInfoYoutubeActorInfo: Actor info +// specific to YouTube clients. +type CommentActorClientSpecificActorInfoYoutubeActorInfo struct { + // ChannelId: ID of the YouTube channel owned by the Actor. + ChannelId string `json:"channelId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ChannelId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentActorClientSpecificActorInfoYoutubeActorInfo) MarshalJSON() ([]byte, error) { + type noMethod CommentActorClientSpecificActorInfoYoutubeActorInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentActorImage: The image representation of this actor. +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"` + + // ForceSendFields is a list of field names (e.g. "Url") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentActorImage) MarshalJSON() ([]byte, error) { + type noMethod CommentActorImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentActorVerification: Verification status of actor. +type CommentActorVerification struct { + // AdHocVerified: Verification for one-time or manual processes. + AdHocVerified string `json:"adHocVerified,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AdHocVerified") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentActorVerification) MarshalJSON() ([]byte, error) { + type noMethod CommentActorVerification + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentInReplyTo) MarshalJSON() ([]byte, error) { + type noMethod CommentInReplyTo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentObject: The object of this comment. +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"` + + // ForceSendFields is a list of field names (e.g. "Content") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentObject) MarshalJSON() ([]byte, error) { + type noMethod CommentObject + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentPlusoners: People who +1'd this comment. +type CommentPlusoners struct { + // TotalItems: Total number of people who +1'd this comment. + TotalItems int64 `json:"totalItems,omitempty"` + + // ForceSendFields is a list of field names (e.g. "TotalItems") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentPlusoners) MarshalJSON() ([]byte, error) { + type noMethod CommentPlusoners + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentFeed) MarshalJSON() ([]byte, error) { + type noMethod CommentFeed + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // AssociatedMedia: The encoding. + AssociatedMedia []*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 object. Your app can choose how to identify + // objects. The object.id is required if you are writing an action that + // does not have a corresponding web page or object.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 object + // 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"` + + // ForceSendFields is a list of field names (e.g. "About") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ItemScope) MarshalJSON() ([]byte, error) { + type noMethod ItemScope + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type Moment struct { + // Id: The moment ID. + Id string `json:"id,omitempty"` + + // Kind: Identifies this resource as a moment. + Kind string `json:"kind,omitempty"` + + // Object: The object on which the action was performed. Specifying this + // is equivalent with specifying "target". Note that responses from the + // server will use the "target" field instead for backward-compatibility + // with older clients. + Object *ItemScope `json:"object,omitempty"` + + // Result: The object generated by performing the action on the object. + // For example, a user writes a review of a restaurant, the object 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 schema.org type for the type of moment to write. For + // example, http://schema.org/AddAction. Note that responses from the + // server will use the Google schema type instead for + // backward-compatibility with older clients. For example, + // http://schemas.google.com/AddActivity. + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Moment) MarshalJSON() ([]byte, error) { + type noMethod Moment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MomentsFeed) MarshalJSON() ([]byte, error) { + type noMethod MomentsFeed + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PeopleFeed) MarshalJSON() ([]byte, error) { + type noMethod PeopleFeed + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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: (this field is not currently used) + 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AboutMe") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Person) MarshalJSON() ([]byte, error) { + type noMethod Person + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PersonAgeRange: 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. +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"` + + // ForceSendFields is a list of field names (e.g. "Max") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PersonAgeRange) MarshalJSON() ([]byte, error) { + type noMethod PersonAgeRange + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PersonCover: The cover photo content. +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"` + + // ForceSendFields is a list of field names (e.g. "CoverInfo") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PersonCover) MarshalJSON() ([]byte, error) { + type noMethod PersonCover + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PersonCoverCoverInfo: Extra information about the cover photo. +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"` + + // ForceSendFields is a list of field names (e.g. "LeftImageOffset") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PersonCoverCoverInfo) MarshalJSON() ([]byte, error) { + type noMethod PersonCoverCoverInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PersonCoverCoverPhoto: The person's primary cover image. +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"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PersonCoverCoverPhoto) MarshalJSON() ([]byte, error) { + type noMethod PersonCoverCoverPhoto + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Type") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PersonEmails) MarshalJSON() ([]byte, error) { + type noMethod PersonEmails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PersonImage: The representation of the person's profile photo. +type PersonImage struct { + // IsDefault: Whether the person's profile photo is the default one + IsDefault bool `json:"isDefault,omitempty"` + + // 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"` + + // ForceSendFields is a list of field names (e.g. "IsDefault") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PersonImage) MarshalJSON() ([]byte, error) { + type noMethod PersonImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PersonName: An object representation of the individual components of +// a person's name. +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"` + + // ForceSendFields is a list of field names (e.g. "FamilyName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PersonName) MarshalJSON() ([]byte, error) { + type noMethod PersonName + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Department") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PersonOrganizations) MarshalJSON() ([]byte, error) { + type noMethod PersonOrganizations + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Primary") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PersonPlacesLived) MarshalJSON() ([]byte, error) { + type noMethod PersonPlacesLived + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Label") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PersonUrls) MarshalJSON() ([]byte, error) { + type noMethod PersonUrls + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // Id: The id of the place. + Id string `json:"id,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"` + + // ForceSendFields is a list of field names (e.g. "Address") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Place) MarshalJSON() ([]byte, error) { + type noMethod Place + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlaceAddress: The physical address of the place. +type PlaceAddress struct { + // Formatted: The formatted address for display. + Formatted string `json:"formatted,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Formatted") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlaceAddress) MarshalJSON() ([]byte, error) { + type noMethod PlaceAddress + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlacePosition: The position of the place. +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"` + + // ForceSendFields is a list of field names (e.g. "Latitude") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlacePosition) MarshalJSON() ([]byte, error) { + type noMethod PlacePosition + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlusAclentryResource) MarshalJSON() ([]byte, error) { + type noMethod PlusAclentryResource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "plus.activities.get": + +type ActivitiesGetCall struct { + s *Service + activityId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ActivitiesGetCall) Fields(s ...googleapi.Field) *ActivitiesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ActivitiesGetCall) IfNoneMatch(entityTag string) *ActivitiesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ActivitiesGetCall) Context(ctx context.Context) *ActivitiesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ActivitiesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "activities/{activityId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "activityId": c.activityId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plus.activities.get" call. +// Exactly one of *Activity or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Activity.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ActivitiesGetCall) Do() (*Activity, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Activity{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ActivitiesListCall) Fields(s ...googleapi.Field) *ActivitiesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ActivitiesListCall) IfNoneMatch(entityTag string) *ActivitiesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ActivitiesListCall) Context(ctx context.Context) *ActivitiesListCall { + c.ctx_ = ctx + return c +} + +func (c *ActivitiesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/activities/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "collection": c.collection, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plus.activities.list" call. +// Exactly one of *ActivityFeed or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ActivityFeed.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ActivitiesListCall) Do() (*ActivityFeed, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ActivityFeed{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "best" - Sort activities by relevance to the user, most relevant +// first. +// "recent" (default) - Sort activities by published date, most recent +// first. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ActivitiesSearchCall) Fields(s ...googleapi.Field) *ActivitiesSearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ActivitiesSearchCall) IfNoneMatch(entityTag string) *ActivitiesSearchCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ActivitiesSearchCall) Context(ctx context.Context) *ActivitiesSearchCall { + c.ctx_ = ctx + return c +} + +func (c *ActivitiesSearchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "activities") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plus.activities.search" call. +// Exactly one of *ActivityFeed or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ActivityFeed.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ActivitiesSearchCall) Do() (*ActivityFeed, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ActivityFeed{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsGetCall) Fields(s ...googleapi.Field) *CommentsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CommentsGetCall) IfNoneMatch(entityTag string) *CommentsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsGetCall) Context(ctx context.Context) *CommentsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "commentId": c.commentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plus.comments.get" call. +// Exactly one of *Comment or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Comment.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CommentsGetCall) Do() (*Comment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Comment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "ascending" (default) - Sort oldest comments first. +// "descending" - Sort newest comments first. +func (c *CommentsListCall) SortOrder(sortOrder string) *CommentsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CommentsListCall) IfNoneMatch(entityTag string) *CommentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsListCall) Context(ctx context.Context) *CommentsListCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "activities/{activityId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "activityId": c.activityId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plus.comments.list" call. +// Exactly one of *CommentFeed or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CommentFeed.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CommentsListCall) Do() (*CommentFeed, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CommentFeed{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// Insert: Record a moment representing a user's action 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MomentsInsertCall) Fields(s ...googleapi.Field) *MomentsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MomentsInsertCall) Context(ctx context.Context) *MomentsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *MomentsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["debug"]; ok { + params.Set("debug", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/moments/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "collection": c.collection, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plus.moments.insert" call. +// Exactly one of *Moment or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Moment.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *MomentsInsertCall) Do() (*Moment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Moment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Record a moment representing a user's action 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 actions 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MomentsListCall) Fields(s ...googleapi.Field) *MomentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *MomentsListCall) IfNoneMatch(entityTag string) *MomentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *MomentsListCall) Context(ctx context.Context) *MomentsListCall { + c.ctx_ = ctx + return c +} + +func (c *MomentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/moments/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "collection": c.collection, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plus.moments.list" call. +// Exactly one of *MomentsFeed or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *MomentsFeed.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MomentsListCall) Do() (*MomentsFeed, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &MomentsFeed{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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.people.get": + +type PeopleGetCall struct { + s *Service + userId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PeopleGetCall) Fields(s ...googleapi.Field) *PeopleGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PeopleGetCall) IfNoneMatch(entityTag string) *PeopleGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PeopleGetCall) Context(ctx context.Context) *PeopleGetCall { + c.ctx_ = ctx + return c +} + +func (c *PeopleGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plus.people.get" call. +// Exactly one of *Person or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Person.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *PeopleGetCall) Do() (*Person, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Person{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "alphabetical" - Order the people by their display name. +// "best" - Order people based on the relevence to the viewer. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PeopleListCall) Fields(s ...googleapi.Field) *PeopleListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PeopleListCall) IfNoneMatch(entityTag string) *PeopleListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PeopleListCall) Context(ctx context.Context) *PeopleListCall { + c.ctx_ = ctx + return c +} + +func (c *PeopleListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/people/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "collection": c.collection, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plus.people.list" call. +// Exactly one of *PeopleFeed or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PeopleFeed.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PeopleListCall) Do() (*PeopleFeed, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PeopleFeed{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PeopleListByActivityCall) Fields(s ...googleapi.Field) *PeopleListByActivityCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PeopleListByActivityCall) IfNoneMatch(entityTag string) *PeopleListByActivityCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PeopleListByActivityCall) Context(ctx context.Context) *PeopleListByActivityCall { + c.ctx_ = ctx + return c +} + +func (c *PeopleListByActivityCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "activities/{activityId}/people/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "activityId": c.activityId, + "collection": c.collection, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plus.people.listByActivity" call. +// Exactly one of *PeopleFeed or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PeopleFeed.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PeopleListByActivityCall) Do() (*PeopleFeed, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PeopleFeed{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PeopleSearchCall) Fields(s ...googleapi.Field) *PeopleSearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PeopleSearchCall) IfNoneMatch(entityTag string) *PeopleSearchCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PeopleSearchCall) Context(ctx context.Context) *PeopleSearchCall { + c.ctx_ = ctx + return c +} + +func (c *PeopleSearchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plus.people.search" call. +// Exactly one of *PeopleFeed or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PeopleFeed.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PeopleSearchCall) Do() (*PeopleFeed, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PeopleFeed{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/Godeps/_workspace/src/google.golang.org/api/plusdomains/v1/plusdomains-api.json b/Godeps/_workspace/src/google.golang.org/api/plusdomains/v1/plusdomains-api.json new file mode 100644 index 000000000..61e134cce --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/plusdomains/v1/plusdomains-api.json @@ -0,0 +1,2241 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/JiNeLDZwZ4CDisO5kxxp-UNdJ28\"", + "discoveryVersion": "v1", + "id": "plusDomains:v1", + "name": "plusDomains", + "version": "v1", + "revision": "20151014", + "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. People and pages you add to your circles will be notified. Others may see this information publicly. People you add to circles can use Hangouts with you." + }, + "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 your basic profile info" + } + } + } + }, + "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": { + "clientSpecificActorInfo": { + "type": "object", + "description": "Actor info specific to particular clients.", + "properties": { + "youtubeActorInfo": { + "type": "object", + "description": "Actor info specific to YouTube clients.", + "properties": { + "channelId": { + "type": "string", + "description": "ID of the YouTube channel owned by the Actor." + } + } + } + } + }, + "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." + }, + "verification": { + "type": "object", + "description": "Verification status of actor.", + "properties": { + "adHocVerified": { + "type": "string", + "description": "Verification for one-time or manual processes." + } + } + } + } + }, + "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": { + "clientSpecificActorInfo": { + "type": "object", + "description": "Actor info specific to particular clients.", + "properties": { + "youtubeActorInfo": { + "type": "object", + "description": "Actor info specific to YouTube clients.", + "properties": { + "channelId": { + "type": "string", + "description": "ID of the YouTube channel owned by the Actor." + } + } + } + } + }, + "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." + }, + "verification": { + "type": "object", + "description": "Verification status of actor.", + "properties": { + "adHocVerified": { + "type": "string", + "description": "Verification for one-time or manual processes." + } + } + } + } + }, + "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": { + "clientSpecificActorInfo": { + "type": "object", + "description": "Actor info specific to particular clients.", + "properties": { + "youtubeActorInfo": { + "type": "object", + "description": "Actor info specific to YouTube clients.", + "properties": { + "channelId": { + "type": "string", + "description": "ID of the YouTube channel owned by the Actor." + } + } + } + } + }, + "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." + }, + "verification": { + "type": "object", + "description": "Verification status of actor.", + "properties": { + "adHocVerified": { + "type": "string", + "description": "Verification for one-time or manual processes." + } + } + } + } + }, + "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": "(this field is not currently used)" + }, + "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": { + "isDefault": { + "type": "boolean", + "description": "Whether the person's profile photo is the default one" + }, + "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." + }, + "id": { + "type": "string", + "description": "The id 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.me", + "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/Godeps/_workspace/src/google.golang.org/api/plusdomains/v1/plusdomains-gen.go b/Godeps/_workspace/src/google.golang.org/api/plusdomains/v1/plusdomains-gen.go new file mode 100644 index 000000000..e19859c2b --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/plusdomains/v1/plusdomains-gen.go @@ -0,0 +1,5263 @@ +// Package plusdomains provides access to the Google+ Domains API. +// +// See https://developers.google.com/+/domains/ +// +// Usage example: +// +// import "google.golang.org/api/plusdomains/v1" +// ... +// plusdomainsService, err := plusdomains.New(oauthHttpClient) +package plusdomains // import "google.golang.org/api/plusdomains/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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. People and pages you + // add to your circles will be notified. Others may see this information + // publicly. People you add to circles can use Hangouts with you. + 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 your basic profile info + 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 + UserAgent string // optional additional User-Agent fragment + + Activities *ActivitiesService + + Audiences *AudiencesService + + Circles *CirclesService + + Comments *CommentsService + + Media *MediaService + + People *PeopleService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewActivitiesService(s *Service) *ActivitiesService { + rs := &ActivitiesService{s: s} + return rs +} + +type ActivitiesService struct { + s *Service +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Acl) MarshalJSON() ([]byte, error) { + type noMethod Acl + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Access") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Activity) MarshalJSON() ([]byte, error) { + type noMethod Activity + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityActor: The person who performed this activity. +type ActivityActor struct { + // ClientSpecificActorInfo: Actor info specific to particular clients. + ClientSpecificActorInfo *ActivityActorClientSpecificActorInfo `json:"clientSpecificActorInfo,omitempty"` + + // 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"` + + // Verification: Verification status of actor. + Verification *ActivityActorVerification `json:"verification,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "ClientSpecificActorInfo") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityActor) MarshalJSON() ([]byte, error) { + type noMethod ActivityActor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityActorClientSpecificActorInfo: Actor info specific to +// particular clients. +type ActivityActorClientSpecificActorInfo struct { + // YoutubeActorInfo: Actor info specific to YouTube clients. + YoutubeActorInfo *ActivityActorClientSpecificActorInfoYoutubeActorInfo `json:"youtubeActorInfo,omitempty"` + + // ForceSendFields is a list of field names (e.g. "YoutubeActorInfo") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityActorClientSpecificActorInfo) MarshalJSON() ([]byte, error) { + type noMethod ActivityActorClientSpecificActorInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityActorClientSpecificActorInfoYoutubeActorInfo: Actor info +// specific to YouTube clients. +type ActivityActorClientSpecificActorInfoYoutubeActorInfo struct { + // ChannelId: ID of the YouTube channel owned by the Actor. + ChannelId string `json:"channelId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ChannelId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityActorClientSpecificActorInfoYoutubeActorInfo) MarshalJSON() ([]byte, error) { + type noMethod ActivityActorClientSpecificActorInfoYoutubeActorInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityActorImage: The image representation of the actor. +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"` + + // ForceSendFields is a list of field names (e.g. "Url") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityActorImage) MarshalJSON() ([]byte, error) { + type noMethod ActivityActorImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityActorName: An object representation of the individual +// components of name. +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"` + + // ForceSendFields is a list of field names (e.g. "FamilyName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityActorName) MarshalJSON() ([]byte, error) { + type noMethod ActivityActorName + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityActorVerification: Verification status of actor. +type ActivityActorVerification struct { + // AdHocVerified: Verification for one-time or manual processes. + AdHocVerified string `json:"adHocVerified,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AdHocVerified") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityActorVerification) MarshalJSON() ([]byte, error) { + type noMethod ActivityActorVerification + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObject: The object of this activity. +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"` + + // ForceSendFields is a list of field names (e.g. "Actor") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObject) MarshalJSON() ([]byte, error) { + type noMethod ActivityObject + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObjectActor: 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. +type ActivityObjectActor struct { + // ClientSpecificActorInfo: Actor info specific to particular clients. + ClientSpecificActorInfo *ActivityObjectActorClientSpecificActorInfo `json:"clientSpecificActorInfo,omitempty"` + + // 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"` + + // Verification: Verification status of actor. + Verification *ActivityObjectActorVerification `json:"verification,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "ClientSpecificActorInfo") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectActor) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectActor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObjectActorClientSpecificActorInfo: Actor info specific to +// particular clients. +type ActivityObjectActorClientSpecificActorInfo struct { + // YoutubeActorInfo: Actor info specific to YouTube clients. + YoutubeActorInfo *ActivityObjectActorClientSpecificActorInfoYoutubeActorInfo `json:"youtubeActorInfo,omitempty"` + + // ForceSendFields is a list of field names (e.g. "YoutubeActorInfo") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectActorClientSpecificActorInfo) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectActorClientSpecificActorInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObjectActorClientSpecificActorInfoYoutubeActorInfo: Actor +// info specific to YouTube clients. +type ActivityObjectActorClientSpecificActorInfoYoutubeActorInfo struct { + // ChannelId: ID of the YouTube channel owned by the Actor. + ChannelId string `json:"channelId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ChannelId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectActorClientSpecificActorInfoYoutubeActorInfo) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectActorClientSpecificActorInfoYoutubeActorInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObjectActorImage: The image representation of the original +// actor. +type ActivityObjectActorImage struct { + // Url: A URL that points to a thumbnail photo of the original actor. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Url") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectActorImage) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectActorImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObjectActorVerification: Verification status of actor. +type ActivityObjectActorVerification struct { + // AdHocVerified: Verification for one-time or manual processes. + AdHocVerified string `json:"adHocVerified,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AdHocVerified") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectActorVerification) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectActorVerification + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Content") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectAttachments) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectAttachments + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObjectAttachmentsEmbed: If the attachment is a video, the +// embeddable link. +type ActivityObjectAttachmentsEmbed struct { + // Type: Media type of the link. + Type string `json:"type,omitempty"` + + // Url: URL of the link. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Type") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectAttachmentsEmbed) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectAttachmentsEmbed + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObjectAttachmentsFullImage: The full image URL for photo +// attachments. +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"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectAttachmentsFullImage) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectAttachmentsFullImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObjectAttachmentsImage: The preview image for photos or +// videos. +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"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectAttachmentsImage) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectAttachmentsImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ActivityObjectAttachmentsPreviewThumbnails struct { + // Url: URL of the thumbnail image. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Url") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectAttachmentsPreviewThumbnails) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectAttachmentsPreviewThumbnails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectAttachmentsThumbnails) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectAttachmentsThumbnails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObjectAttachmentsThumbnailsImage: Image resource. +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"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectAttachmentsThumbnailsImage) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectAttachmentsThumbnailsImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObjectPlusoners: People who +1'd this activity. +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"` + + // ForceSendFields is a list of field names (e.g. "SelfLink") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectPlusoners) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectPlusoners + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObjectReplies: Comments in reply to this activity. +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"` + + // ForceSendFields is a list of field names (e.g. "SelfLink") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectReplies) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectReplies + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObjectResharers: People who reshared this activity. +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"` + + // ForceSendFields is a list of field names (e.g. "SelfLink") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectResharers) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectResharers + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityObjectStatusForViewer: Status of the activity as seen by the +// viewer. +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"` + + // ForceSendFields is a list of field names (e.g. "CanComment") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityObjectStatusForViewer) MarshalJSON() ([]byte, error) { + type noMethod ActivityObjectStatusForViewer + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityProvider: The service provider that initially published this +// activity. +type ActivityProvider struct { + // Title: Name of the service provider. + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Title") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityProvider) MarshalJSON() ([]byte, error) { + type noMethod ActivityProvider + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityFeed) MarshalJSON() ([]byte, error) { + type noMethod ActivityFeed + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Audience) MarshalJSON() ([]byte, error) { + type noMethod Audience + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AudiencesFeed) MarshalJSON() ([]byte, error) { + type noMethod AudiencesFeed + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Circle) MarshalJSON() ([]byte, error) { + type noMethod Circle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CirclePeople: The people in this circle. +type CirclePeople struct { + // TotalItems: The total number of people in this circle. + TotalItems int64 `json:"totalItems,omitempty"` + + // ForceSendFields is a list of field names (e.g. "TotalItems") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CirclePeople) MarshalJSON() ([]byte, error) { + type noMethod CirclePeople + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CircleFeed) MarshalJSON() ([]byte, error) { + type noMethod CircleFeed + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Actor") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Comment) MarshalJSON() ([]byte, error) { + type noMethod Comment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentActor: The person who posted this comment. +type CommentActor struct { + // ClientSpecificActorInfo: Actor info specific to particular clients. + ClientSpecificActorInfo *CommentActorClientSpecificActorInfo `json:"clientSpecificActorInfo,omitempty"` + + // 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"` + + // Verification: Verification status of actor. + Verification *CommentActorVerification `json:"verification,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "ClientSpecificActorInfo") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentActor) MarshalJSON() ([]byte, error) { + type noMethod CommentActor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentActorClientSpecificActorInfo: Actor info specific to +// particular clients. +type CommentActorClientSpecificActorInfo struct { + // YoutubeActorInfo: Actor info specific to YouTube clients. + YoutubeActorInfo *CommentActorClientSpecificActorInfoYoutubeActorInfo `json:"youtubeActorInfo,omitempty"` + + // ForceSendFields is a list of field names (e.g. "YoutubeActorInfo") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentActorClientSpecificActorInfo) MarshalJSON() ([]byte, error) { + type noMethod CommentActorClientSpecificActorInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentActorClientSpecificActorInfoYoutubeActorInfo: Actor info +// specific to YouTube clients. +type CommentActorClientSpecificActorInfoYoutubeActorInfo struct { + // ChannelId: ID of the YouTube channel owned by the Actor. + ChannelId string `json:"channelId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ChannelId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentActorClientSpecificActorInfoYoutubeActorInfo) MarshalJSON() ([]byte, error) { + type noMethod CommentActorClientSpecificActorInfoYoutubeActorInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentActorImage: The image representation of this actor. +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"` + + // ForceSendFields is a list of field names (e.g. "Url") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentActorImage) MarshalJSON() ([]byte, error) { + type noMethod CommentActorImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentActorVerification: Verification status of actor. +type CommentActorVerification struct { + // AdHocVerified: Verification for one-time or manual processes. + AdHocVerified string `json:"adHocVerified,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AdHocVerified") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentActorVerification) MarshalJSON() ([]byte, error) { + type noMethod CommentActorVerification + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentInReplyTo) MarshalJSON() ([]byte, error) { + type noMethod CommentInReplyTo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentObject: The object of this comment. +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"` + + // ForceSendFields is a list of field names (e.g. "Content") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentObject) MarshalJSON() ([]byte, error) { + type noMethod CommentObject + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentPlusoners: People who +1'd this comment. +type CommentPlusoners struct { + // TotalItems: Total number of people who +1'd this comment. + TotalItems int64 `json:"totalItems,omitempty"` + + // ForceSendFields is a list of field names (e.g. "TotalItems") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentPlusoners) MarshalJSON() ([]byte, error) { + type noMethod CommentPlusoners + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentFeed) MarshalJSON() ([]byte, error) { + type noMethod CommentFeed + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Author") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Media) MarshalJSON() ([]byte, error) { + type noMethod Media + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MediaAuthor: The person who uploaded this media. +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"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MediaAuthor) MarshalJSON() ([]byte, error) { + type noMethod MediaAuthor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MediaAuthorImage: The author's Google profile image. +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"` + + // ForceSendFields is a list of field names (e.g. "Url") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MediaAuthorImage) MarshalJSON() ([]byte, error) { + type noMethod MediaAuthorImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MediaExif: Exif information of the media item. +type MediaExif struct { + // Time: The time the media was captured. Formatted as an RFC 3339 + // timestamp. + Time string `json:"time,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Time") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MediaExif) MarshalJSON() ([]byte, error) { + type noMethod MediaExif + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PeopleFeed) MarshalJSON() ([]byte, error) { + type noMethod PeopleFeed + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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: (this field is not currently used) + 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AboutMe") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Person) MarshalJSON() ([]byte, error) { + type noMethod Person + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PersonCover: The cover photo content. +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"` + + // ForceSendFields is a list of field names (e.g. "CoverInfo") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PersonCover) MarshalJSON() ([]byte, error) { + type noMethod PersonCover + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PersonCoverCoverInfo: Extra information about the cover photo. +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"` + + // ForceSendFields is a list of field names (e.g. "LeftImageOffset") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PersonCoverCoverInfo) MarshalJSON() ([]byte, error) { + type noMethod PersonCoverCoverInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PersonCoverCoverPhoto: The person's primary cover image. +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"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PersonCoverCoverPhoto) MarshalJSON() ([]byte, error) { + type noMethod PersonCoverCoverPhoto + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Type") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PersonEmails) MarshalJSON() ([]byte, error) { + type noMethod PersonEmails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PersonImage: The representation of the person's profile photo. +type PersonImage struct { + // IsDefault: Whether the person's profile photo is the default one + IsDefault bool `json:"isDefault,omitempty"` + + // 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"` + + // ForceSendFields is a list of field names (e.g. "IsDefault") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PersonImage) MarshalJSON() ([]byte, error) { + type noMethod PersonImage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PersonName: An object representation of the individual components of +// a person's name. +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"` + + // ForceSendFields is a list of field names (e.g. "FamilyName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PersonName) MarshalJSON() ([]byte, error) { + type noMethod PersonName + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Department") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PersonOrganizations) MarshalJSON() ([]byte, error) { + type noMethod PersonOrganizations + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Primary") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PersonPlacesLived) MarshalJSON() ([]byte, error) { + type noMethod PersonPlacesLived + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Label") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PersonUrls) MarshalJSON() ([]byte, error) { + type noMethod PersonUrls + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // Id: The id of the place. + Id string `json:"id,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"` + + // ForceSendFields is a list of field names (e.g. "Address") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Place) MarshalJSON() ([]byte, error) { + type noMethod Place + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlaceAddress: The physical address of the place. +type PlaceAddress struct { + // Formatted: The formatted address for display. + Formatted string `json:"formatted,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Formatted") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlaceAddress) MarshalJSON() ([]byte, error) { + type noMethod PlaceAddress + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlacePosition: The position of the place. +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"` + + // ForceSendFields is a list of field names (e.g. "Latitude") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlacePosition) MarshalJSON() ([]byte, error) { + type noMethod PlacePosition + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlusDomainsAclentryResource) MarshalJSON() ([]byte, error) { + type noMethod PlusDomainsAclentryResource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Videostream) MarshalJSON() ([]byte, error) { + type noMethod Videostream + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "plusDomains.activities.get": + +type ActivitiesGetCall struct { + s *Service + activityId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ActivitiesGetCall) Fields(s ...googleapi.Field) *ActivitiesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ActivitiesGetCall) IfNoneMatch(entityTag string) *ActivitiesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ActivitiesGetCall) Context(ctx context.Context) *ActivitiesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ActivitiesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "activities/{activityId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "activityId": c.activityId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plusDomains.activities.get" call. +// Exactly one of *Activity or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Activity.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ActivitiesGetCall) Do() (*Activity, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Activity{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ActivitiesInsertCall) Fields(s ...googleapi.Field) *ActivitiesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ActivitiesInsertCall) Context(ctx context.Context) *ActivitiesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ActivitiesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["preview"]; ok { + params.Set("preview", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/activities") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plusDomains.activities.insert" call. +// Exactly one of *Activity or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Activity.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ActivitiesInsertCall) Do() (*Activity, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Activity{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ActivitiesListCall) Fields(s ...googleapi.Field) *ActivitiesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ActivitiesListCall) IfNoneMatch(entityTag string) *ActivitiesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ActivitiesListCall) Context(ctx context.Context) *ActivitiesListCall { + c.ctx_ = ctx + return c +} + +func (c *ActivitiesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/activities/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "collection": c.collection, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plusDomains.activities.list" call. +// Exactly one of *ActivityFeed or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ActivityFeed.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ActivitiesListCall) Do() (*ActivityFeed, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ActivityFeed{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AudiencesListCall) Fields(s ...googleapi.Field) *AudiencesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AudiencesListCall) IfNoneMatch(entityTag string) *AudiencesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AudiencesListCall) Context(ctx context.Context) *AudiencesListCall { + c.ctx_ = ctx + return c +} + +func (c *AudiencesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/audiences") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plusDomains.audiences.list" call. +// Exactly one of *AudiencesFeed or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AudiencesFeed.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AudiencesListCall) Do() (*AudiencesFeed, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &AudiencesFeed{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CirclesAddPeopleCall) Fields(s ...googleapi.Field) *CirclesAddPeopleCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CirclesAddPeopleCall) Context(ctx context.Context) *CirclesAddPeopleCall { + c.ctx_ = ctx + return c +} + +func (c *CirclesAddPeopleCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "circles/{circleId}/people") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "circleId": c.circleId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plusDomains.circles.addPeople" call. +// Exactly one of *Circle or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Circle.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CirclesAddPeopleCall) Do() (*Circle, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Circle{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CirclesGetCall) Fields(s ...googleapi.Field) *CirclesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CirclesGetCall) IfNoneMatch(entityTag string) *CirclesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CirclesGetCall) Context(ctx context.Context) *CirclesGetCall { + c.ctx_ = ctx + return c +} + +func (c *CirclesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "circles/{circleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "circleId": c.circleId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plusDomains.circles.get" call. +// Exactly one of *Circle or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Circle.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CirclesGetCall) Do() (*Circle, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Circle{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CirclesInsertCall) Fields(s ...googleapi.Field) *CirclesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CirclesInsertCall) Context(ctx context.Context) *CirclesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CirclesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/circles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plusDomains.circles.insert" call. +// Exactly one of *Circle or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Circle.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CirclesInsertCall) Do() (*Circle, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Circle{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CirclesListCall) Fields(s ...googleapi.Field) *CirclesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CirclesListCall) IfNoneMatch(entityTag string) *CirclesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CirclesListCall) Context(ctx context.Context) *CirclesListCall { + c.ctx_ = ctx + return c +} + +func (c *CirclesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/circles") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plusDomains.circles.list" call. +// Exactly one of *CircleFeed or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CircleFeed.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CirclesListCall) Do() (*CircleFeed, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CircleFeed{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CirclesPatchCall) Fields(s ...googleapi.Field) *CirclesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CirclesPatchCall) Context(ctx context.Context) *CirclesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CirclesPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "circles/{circleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "circleId": c.circleId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plusDomains.circles.patch" call. +// Exactly one of *Circle or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Circle.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CirclesPatchCall) Do() (*Circle, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Circle{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CirclesRemoveCall) Fields(s ...googleapi.Field) *CirclesRemoveCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CirclesRemoveCall) Context(ctx context.Context) *CirclesRemoveCall { + c.ctx_ = ctx + return c +} + +func (c *CirclesRemoveCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "circles/{circleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "circleId": c.circleId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plusDomains.circles.remove" call. +func (c *CirclesRemoveCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CirclesRemovePeopleCall) Fields(s ...googleapi.Field) *CirclesRemovePeopleCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CirclesRemovePeopleCall) Context(ctx context.Context) *CirclesRemovePeopleCall { + c.ctx_ = ctx + return c +} + +func (c *CirclesRemovePeopleCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "circles/{circleId}/people") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "circleId": c.circleId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plusDomains.circles.removePeople" call. +func (c *CirclesRemovePeopleCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CirclesUpdateCall) Fields(s ...googleapi.Field) *CirclesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CirclesUpdateCall) Context(ctx context.Context) *CirclesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CirclesUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "circles/{circleId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "circleId": c.circleId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plusDomains.circles.update" call. +// Exactly one of *Circle or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Circle.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CirclesUpdateCall) Do() (*Circle, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Circle{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsGetCall) Fields(s ...googleapi.Field) *CommentsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CommentsGetCall) IfNoneMatch(entityTag string) *CommentsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsGetCall) Context(ctx context.Context) *CommentsGetCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "comments/{commentId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "commentId": c.commentId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plusDomains.comments.get" call. +// Exactly one of *Comment or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Comment.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CommentsGetCall) Do() (*Comment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Comment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsInsertCall) Fields(s ...googleapi.Field) *CommentsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsInsertCall) Context(ctx context.Context) *CommentsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "activities/{activityId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "activityId": c.activityId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plusDomains.comments.insert" call. +// Exactly one of *Comment or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Comment.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *CommentsInsertCall) Do() (*Comment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Comment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "ascending" (default) - Sort oldest comments first. +// "descending" - Sort newest comments first. +func (c *CommentsListCall) SortOrder(sortOrder string) *CommentsListCall { + c.opt_["sortOrder"] = sortOrder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CommentsListCall) IfNoneMatch(entityTag string) *CommentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CommentsListCall) Context(ctx context.Context) *CommentsListCall { + c.ctx_ = ctx + return c +} + +func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "activities/{activityId}/comments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "activityId": c.activityId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plusDomains.comments.list" call. +// Exactly one of *CommentFeed or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *CommentFeed.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CommentsListCall) Do() (*CommentFeed, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CommentFeed{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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 + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// 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 +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *MediaInsertCall) Media(r io.Reader) *MediaInsertCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *MediaInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *MediaInsertCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *MediaInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *MediaInsertCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *MediaInsertCall) Fields(s ...googleapi.Field) *MediaInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *MediaInsertCall) Context(ctx context.Context) *MediaInsertCall { + c.ctx_ = ctx + return c +} + +func (c *MediaInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/media/{collection}") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "collection": c.collection, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plusDomains.media.insert" call. +// Exactly one of *Media or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Media.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *MediaInsertCall) Do() (*Media, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &Media{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.me", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PeopleGetCall) Fields(s ...googleapi.Field) *PeopleGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PeopleGetCall) IfNoneMatch(entityTag string) *PeopleGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PeopleGetCall) Context(ctx context.Context) *PeopleGetCall { + c.ctx_ = ctx + return c +} + +func (c *PeopleGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plusDomains.people.get" call. +// Exactly one of *Person or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Person.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *PeopleGetCall) Do() (*Person, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Person{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "alphabetical" - Order the people by their display name. +// "best" - Order people based on the relevence to the viewer. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PeopleListCall) Fields(s ...googleapi.Field) *PeopleListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PeopleListCall) IfNoneMatch(entityTag string) *PeopleListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PeopleListCall) Context(ctx context.Context) *PeopleListCall { + c.ctx_ = ctx + return c +} + +func (c *PeopleListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "people/{userId}/people/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "userId": c.userId, + "collection": c.collection, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plusDomains.people.list" call. +// Exactly one of *PeopleFeed or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PeopleFeed.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PeopleListCall) Do() (*PeopleFeed, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PeopleFeed{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PeopleListByActivityCall) Fields(s ...googleapi.Field) *PeopleListByActivityCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PeopleListByActivityCall) IfNoneMatch(entityTag string) *PeopleListByActivityCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PeopleListByActivityCall) Context(ctx context.Context) *PeopleListByActivityCall { + c.ctx_ = ctx + return c +} + +func (c *PeopleListByActivityCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "activities/{activityId}/people/{collection}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "activityId": c.activityId, + "collection": c.collection, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plusDomains.people.listByActivity" call. +// Exactly one of *PeopleFeed or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PeopleFeed.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PeopleListByActivityCall) Do() (*PeopleFeed, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PeopleFeed{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PeopleListByCircleCall) Fields(s ...googleapi.Field) *PeopleListByCircleCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PeopleListByCircleCall) IfNoneMatch(entityTag string) *PeopleListByCircleCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PeopleListByCircleCall) Context(ctx context.Context) *PeopleListByCircleCall { + c.ctx_ = ctx + return c +} + +func (c *PeopleListByCircleCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "circles/{circleId}/people") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "circleId": c.circleId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "plusDomains.people.listByCircle" call. +// Exactly one of *PeopleFeed or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PeopleFeed.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PeopleListByCircleCall) Do() (*PeopleFeed, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PeopleFeed{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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/Godeps/_workspace/src/google.golang.org/api/prediction/v1.2/prediction-api.json b/Godeps/_workspace/src/google.golang.org/api/prediction/v1.2/prediction-api.json new file mode 100644 index 000000000..83b7b2d60 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/prediction/v1.2/prediction-api.json @@ -0,0 +1,354 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"FrPV2U6xXFUq8eRv_PO3IoAURkc/vqbJcfoFrtPpK9W2dvUTdM5aWmI\"", + "discoveryVersion": "v1", + "id": "prediction:v1.2", + "name": "prediction", + "version": "v1.2", + "revision": "20140522", + "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/Godeps/_workspace/src/google.golang.org/api/prediction/v1.2/prediction-gen.go b/Godeps/_workspace/src/google.golang.org/api/prediction/v1.2/prediction-gen.go new file mode 100644 index 000000000..13c1baea9 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/prediction/v1.2/prediction-gen.go @@ -0,0 +1,982 @@ +// Package prediction provides access to the Prediction API. +// +// See https://developers.google.com/prediction/docs/developer-guide +// +// Usage example: +// +// import "google.golang.org/api/prediction/v1.2" +// ... +// predictionService, err := prediction.New(oauthHttpClient) +package prediction // import "google.golang.org/api/prediction/v1.2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control" + + // View your data in Google Cloud Storage + DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only" + + // Manage your data in Google Cloud Storage + DevstorageReadWriteScope = "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 + UserAgent string // optional additional User-Agent fragment + + Hostedmodels *HostedmodelsService + + Training *TrainingService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Input") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Input) MarshalJSON() ([]byte, error) { + type noMethod Input + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InputInput struct { + CsvInstance []interface{} `json:"csvInstance,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CsvInstance") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InputInput) MarshalJSON() ([]byte, error) { + type noMethod InputInput + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Output) MarshalJSON() ([]byte, error) { + type noMethod Output + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OutputOutputMulti struct { + Label string `json:"label,omitempty"` + + Score float64 `json:"score,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Label") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OutputOutputMulti) MarshalJSON() ([]byte, error) { + type noMethod OutputOutputMulti + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Training) MarshalJSON() ([]byte, error) { + type noMethod Training + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TrainingModelInfo struct { + ClassificationAccuracy float64 `json:"classificationAccuracy,omitempty"` + + MeanSquaredError float64 `json:"meanSquaredError,omitempty"` + + ModelType string `json:"modelType,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "ClassificationAccuracy") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TrainingModelInfo) MarshalJSON() ([]byte, error) { + type noMethod TrainingModelInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "ClassLabel") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Update) MarshalJSON() ([]byte, error) { + type noMethod Update + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "prediction.predict": + +type PredictCall struct { + s *Service + data string + input *Input + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PredictCall) Fields(s ...googleapi.Field) *PredictCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PredictCall) Context(ctx context.Context) *PredictCall { + c.ctx_ = ctx + return c +} + +func (c *PredictCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "training/{data}/predict") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "data": c.data, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "prediction.predict" call. +// Exactly one of *Output or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Output.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *PredictCall) Do() (*Output, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Output{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HostedmodelsPredictCall) Fields(s ...googleapi.Field) *HostedmodelsPredictCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HostedmodelsPredictCall) Context(ctx context.Context) *HostedmodelsPredictCall { + c.ctx_ = ctx + return c +} + +func (c *HostedmodelsPredictCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "hostedmodels/{hostedModelName}/predict") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "hostedModelName": c.hostedModelName, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "prediction.hostedmodels.predict" call. +// Exactly one of *Output or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Output.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *HostedmodelsPredictCall) Do() (*Output, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Output{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TrainingDeleteCall) Fields(s ...googleapi.Field) *TrainingDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TrainingDeleteCall) Context(ctx context.Context) *TrainingDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TrainingDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "training/{data}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "data": c.data, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "prediction.training.delete" call. +func (c *TrainingDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a trained model", + // "httpMethod": "DELETE", + // "id": "prediction.training.delete", + // "parameterOrder": [ + // "data" + // ], + // "parameters": { + // "data": { + // "description": "mybucket/mydata resource in Google Storage", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "training/{data}", + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.training.get": + +type TrainingGetCall struct { + s *Service + data string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TrainingGetCall) Fields(s ...googleapi.Field) *TrainingGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TrainingGetCall) IfNoneMatch(entityTag string) *TrainingGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TrainingGetCall) Context(ctx context.Context) *TrainingGetCall { + c.ctx_ = ctx + return c +} + +func (c *TrainingGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "training/{data}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "data": c.data, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "prediction.training.get" call. +// Exactly one of *Training or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Training.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TrainingGetCall) Do() (*Training, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Training{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TrainingInsertCall) Fields(s ...googleapi.Field) *TrainingInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TrainingInsertCall) Context(ctx context.Context) *TrainingInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TrainingInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["data"]; ok { + params.Set("data", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "prediction.training.insert" call. +// Exactly one of *Training or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Training.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TrainingInsertCall) Do() (*Training, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Training{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TrainingUpdateCall) Fields(s ...googleapi.Field) *TrainingUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TrainingUpdateCall) Context(ctx context.Context) *TrainingUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *TrainingUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "training/{data}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "data": c.data, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "prediction.training.update" call. +// Exactly one of *Training or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Training.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TrainingUpdateCall) Do() (*Training, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Training{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/Godeps/_workspace/src/google.golang.org/api/prediction/v1.3/prediction-api.json b/Godeps/_workspace/src/google.golang.org/api/prediction/v1.3/prediction-api.json new file mode 100644 index 000000000..612b45439 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/prediction/v1.3/prediction-api.json @@ -0,0 +1,412 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"FrPV2U6xXFUq8eRv_PO3IoAURkc/AH0kDxitXVy6ezxE7JaWy7alDdY\"", + "discoveryVersion": "v1", + "id": "prediction:v1.3", + "name": "prediction", + "version": "v1.3", + "revision": "20140522", + "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/Godeps/_workspace/src/google.golang.org/api/prediction/v1.3/prediction-gen.go b/Godeps/_workspace/src/google.golang.org/api/prediction/v1.3/prediction-gen.go new file mode 100644 index 000000000..8e3353ef2 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/prediction/v1.3/prediction-gen.go @@ -0,0 +1,1042 @@ +// Package prediction provides access to the Prediction API. +// +// See https://developers.google.com/prediction/docs/developer-guide +// +// Usage example: +// +// import "google.golang.org/api/prediction/v1.3" +// ... +// predictionService, err := prediction.New(oauthHttpClient) +package prediction // import "google.golang.org/api/prediction/v1.3" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control" + + // View your data in Google Cloud Storage + DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only" + + // Manage your data in Google Cloud Storage + DevstorageReadWriteScope = "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 + UserAgent string // optional additional User-Agent fragment + + Hostedmodels *HostedmodelsService + + Training *TrainingService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Input") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Input) MarshalJSON() ([]byte, error) { + type noMethod Input + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InputInput: Input to the model for a prediction +type InputInput struct { + // CsvInstance: A list of input features, these can be strings or + // doubles. + CsvInstance []interface{} `json:"csvInstance,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CsvInstance") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InputInput) MarshalJSON() ([]byte, error) { + type noMethod InputInput + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Output) MarshalJSON() ([]byte, error) { + type noMethod Output + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OutputOutputMulti struct { + // Label: The class label. + Label string `json:"label,omitempty"` + + // Score: The probability of the class. + Score float64 `json:"score,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Label") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OutputOutputMulti) MarshalJSON() ([]byte, error) { + type noMethod OutputOutputMulti + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Training) MarshalJSON() ([]byte, error) { + type noMethod Training + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TrainingModelInfo: Model metadata. +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"` + + // ForceSendFields is a list of field names (e.g. + // "ClassWeightedAccuracy") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TrainingModelInfo) MarshalJSON() ([]byte, error) { + type noMethod TrainingModelInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TrainingModelInfoConfusionMatrix: 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]. +type TrainingModelInfoConfusionMatrix struct { +} + +// TrainingModelInfoConfusionMatrixRowTotals: A list of the confusion +// matrix row totals +type TrainingModelInfoConfusionMatrixRowTotals struct { +} + +// TrainingUtility: Class label (string). +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"` + + // ForceSendFields is a list of field names (e.g. "ClassLabel") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Update) MarshalJSON() ([]byte, error) { + type noMethod Update + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "prediction.hostedmodels.predict": + +type HostedmodelsPredictCall struct { + s *Service + hostedModelName string + input *Input + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HostedmodelsPredictCall) Fields(s ...googleapi.Field) *HostedmodelsPredictCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HostedmodelsPredictCall) Context(ctx context.Context) *HostedmodelsPredictCall { + c.ctx_ = ctx + return c +} + +func (c *HostedmodelsPredictCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "hostedmodels/{hostedModelName}/predict") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "hostedModelName": c.hostedModelName, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "prediction.hostedmodels.predict" call. +// Exactly one of *Output or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Output.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *HostedmodelsPredictCall) Do() (*Output, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Output{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TrainingDeleteCall) Fields(s ...googleapi.Field) *TrainingDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TrainingDeleteCall) Context(ctx context.Context) *TrainingDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TrainingDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "training/{data}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "data": c.data, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "prediction.training.delete" call. +func (c *TrainingDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a trained model", + // "httpMethod": "DELETE", + // "id": "prediction.training.delete", + // "parameterOrder": [ + // "data" + // ], + // "parameters": { + // "data": { + // "description": "mybucket/mydata resource in Google Storage", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "training/{data}", + // "scopes": [ + // "https://www.googleapis.com/auth/prediction" + // ] + // } + +} + +// method id "prediction.training.get": + +type TrainingGetCall struct { + s *Service + data string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TrainingGetCall) Fields(s ...googleapi.Field) *TrainingGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TrainingGetCall) IfNoneMatch(entityTag string) *TrainingGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TrainingGetCall) Context(ctx context.Context) *TrainingGetCall { + c.ctx_ = ctx + return c +} + +func (c *TrainingGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "training/{data}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "data": c.data, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "prediction.training.get" call. +// Exactly one of *Training or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Training.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TrainingGetCall) Do() (*Training, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Training{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TrainingInsertCall) Fields(s ...googleapi.Field) *TrainingInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TrainingInsertCall) Context(ctx context.Context) *TrainingInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TrainingInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "prediction.training.insert" call. +// Exactly one of *Training or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Training.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TrainingInsertCall) Do() (*Training, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Training{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TrainingPredictCall) Fields(s ...googleapi.Field) *TrainingPredictCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TrainingPredictCall) Context(ctx context.Context) *TrainingPredictCall { + c.ctx_ = ctx + return c +} + +func (c *TrainingPredictCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "training/{data}/predict") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "data": c.data, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "prediction.training.predict" call. +// Exactly one of *Output or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Output.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TrainingPredictCall) Do() (*Output, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Output{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TrainingUpdateCall) Fields(s ...googleapi.Field) *TrainingUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TrainingUpdateCall) Context(ctx context.Context) *TrainingUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *TrainingUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "training/{data}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "data": c.data, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "prediction.training.update" call. +// Exactly one of *Training or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Training.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TrainingUpdateCall) Do() (*Training, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Training{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/Godeps/_workspace/src/google.golang.org/api/prediction/v1.4/prediction-api.json b/Godeps/_workspace/src/google.golang.org/api/prediction/v1.4/prediction-api.json new file mode 100644 index 000000000..93dc2e154 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/prediction/v1.4/prediction-api.json @@ -0,0 +1,437 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"FrPV2U6xXFUq8eRv_PO3IoAURkc/vTEPhd5Iea8_7PtKnWKo1lkHwg8\"", + "discoveryVersion": "v1", + "id": "prediction:v1.4", + "name": "prediction", + "version": "v1.4", + "revision": "20140522", + "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/Godeps/_workspace/src/google.golang.org/api/prediction/v1.4/prediction-gen.go b/Godeps/_workspace/src/google.golang.org/api/prediction/v1.4/prediction-gen.go new file mode 100644 index 000000000..fefad8726 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/prediction/v1.4/prediction-gen.go @@ -0,0 +1,1080 @@ +// Package prediction provides access to the Prediction API. +// +// See https://developers.google.com/prediction/docs/developer-guide +// +// Usage example: +// +// import "google.golang.org/api/prediction/v1.4" +// ... +// predictionService, err := prediction.New(oauthHttpClient) +package prediction // import "google.golang.org/api/prediction/v1.4" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control" + + // View your data in Google Cloud Storage + DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only" + + // Manage your data in Google Cloud Storage + DevstorageReadWriteScope = "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 + UserAgent string // optional additional User-Agent fragment + + Hostedmodels *HostedmodelsService + + Trainedmodels *TrainedmodelsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Input") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Input) MarshalJSON() ([]byte, error) { + type noMethod Input + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InputInput: Input to the model for a prediction +type InputInput struct { + // CsvInstance: A list of input features, these can be strings or + // doubles. + CsvInstance []interface{} `json:"csvInstance,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CsvInstance") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InputInput) MarshalJSON() ([]byte, error) { + type noMethod InputInput + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Output) MarshalJSON() ([]byte, error) { + type noMethod Output + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OutputOutputMulti struct { + // Label: The class label. + Label string `json:"label,omitempty"` + + // Score: The probability of the class label. + Score float64 `json:"score,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Label") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OutputOutputMulti) MarshalJSON() ([]byte, error) { + type noMethod OutputOutputMulti + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DataAnalysis") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Training) MarshalJSON() ([]byte, error) { + type noMethod Training + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TrainingDataAnalysis: Data Analysis. +type TrainingDataAnalysis struct { + Warnings []string `json:"warnings,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Warnings") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TrainingDataAnalysis) MarshalJSON() ([]byte, error) { + type noMethod TrainingDataAnalysis + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TrainingModelInfo: Model metadata. +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"` + + // ForceSendFields is a list of field names (e.g. + // "ClassWeightedAccuracy") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TrainingModelInfo) MarshalJSON() ([]byte, error) { + type noMethod TrainingModelInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TrainingModelInfoConfusionMatrix: 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]. +type TrainingModelInfoConfusionMatrix struct { +} + +// TrainingModelInfoConfusionMatrixRowTotals: A list of the confusion +// matrix row totals +type TrainingModelInfoConfusionMatrixRowTotals struct { +} + +// TrainingUtility: Class label (string). +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"` + + // ForceSendFields is a list of field names (e.g. "CsvInstance") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Update) MarshalJSON() ([]byte, error) { + type noMethod Update + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "prediction.hostedmodels.predict": + +type HostedmodelsPredictCall struct { + s *Service + hostedModelName string + input *Input + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HostedmodelsPredictCall) Fields(s ...googleapi.Field) *HostedmodelsPredictCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *HostedmodelsPredictCall) Context(ctx context.Context) *HostedmodelsPredictCall { + c.ctx_ = ctx + return c +} + +func (c *HostedmodelsPredictCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "hostedmodels/{hostedModelName}/predict") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "hostedModelName": c.hostedModelName, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "prediction.hostedmodels.predict" call. +// Exactly one of *Output or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Output.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *HostedmodelsPredictCall) Do() (*Output, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Output{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TrainedmodelsDeleteCall) Fields(s ...googleapi.Field) *TrainedmodelsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TrainedmodelsDeleteCall) Context(ctx context.Context) *TrainedmodelsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TrainedmodelsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "trainedmodels/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "prediction.trainedmodels.delete" call. +func (c *TrainedmodelsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a trained model.", + // "httpMethod": "DELETE", + // "id": "prediction.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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TrainedmodelsGetCall) Fields(s ...googleapi.Field) *TrainedmodelsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TrainedmodelsGetCall) IfNoneMatch(entityTag string) *TrainedmodelsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TrainedmodelsGetCall) Context(ctx context.Context) *TrainedmodelsGetCall { + c.ctx_ = ctx + return c +} + +func (c *TrainedmodelsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "trainedmodels/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "prediction.trainedmodels.get" call. +// Exactly one of *Training or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Training.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TrainedmodelsGetCall) Do() (*Training, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Training{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TrainedmodelsInsertCall) Fields(s ...googleapi.Field) *TrainedmodelsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TrainedmodelsInsertCall) Context(ctx context.Context) *TrainedmodelsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TrainedmodelsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "prediction.trainedmodels.insert" call. +// Exactly one of *Training or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Training.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TrainedmodelsInsertCall) Do() (*Training, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Training{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TrainedmodelsPredictCall) Fields(s ...googleapi.Field) *TrainedmodelsPredictCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TrainedmodelsPredictCall) Context(ctx context.Context) *TrainedmodelsPredictCall { + c.ctx_ = ctx + return c +} + +func (c *TrainedmodelsPredictCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "trainedmodels/{id}/predict") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "prediction.trainedmodels.predict" call. +// Exactly one of *Output or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Output.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TrainedmodelsPredictCall) Do() (*Output, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Output{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TrainedmodelsUpdateCall) Fields(s ...googleapi.Field) *TrainedmodelsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TrainedmodelsUpdateCall) Context(ctx context.Context) *TrainedmodelsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *TrainedmodelsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "trainedmodels/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "prediction.trainedmodels.update" call. +// Exactly one of *Training or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Training.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TrainedmodelsUpdateCall) Do() (*Training, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Training{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/Godeps/_workspace/src/google.golang.org/api/proximitybeacon/v1beta1/proximitybeacon-api.json b/Godeps/_workspace/src/google.golang.org/api/proximitybeacon/v1beta1/proximitybeacon-api.json new file mode 100644 index 000000000..0552939d9 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/proximitybeacon/v1beta1/proximitybeacon-api.json @@ -0,0 +1,822 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/qiwkKULZKsE5qLcb8g90X8kbnl8\"", + "discoveryVersion": "v1", + "id": "proximitybeacon:v1beta1", + "name": "proximitybeacon", + "version": "v1beta1", + "revision": "20150729", + "title": "Google Proximity Beacon API", + "description": "This API provides services to register, manage, index, and search beacons.", + "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/beacons/proximity/", + "protocol": "rest", + "baseUrl": "https://proximitybeacon.googleapis.com/", + "basePath": "/", + "rootUrl": "https://proximitybeacon.googleapis.com/", + "servicePath": "", + "batchPath": "batch", + "parameters": { + "access_token": { + "type": "string", + "description": "OAuth access token.", + "location": "query" + }, + "alt": { + "type": "string", + "description": "Data format for response.", + "default": "json", + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query" + }, + "bearer_token": { + "type": "string", + "description": "OAuth bearer token.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JSONP", + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "pp": { + "type": "boolean", + "description": "Pretty-print response.", + "default": "true", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query" + }, + "upload_protocol": { + "type": "string", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query" + }, + "uploadType": { + "type": "string", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query" + }, + "$.xgafv": { + "type": "string", + "description": "V1 error format.", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" + } + }, + "schemas": { + "Beacon": { + "id": "Beacon", + "type": "object", + "description": "Details of a beacon device.", + "properties": { + "beaconName": { + "type": "string", + "description": "Resource name of this beacon. A beacon name has the format \"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone, `1` for iBeacon, or `5` for AltBeacon. This field must be left empty when registering. After reading a beacon, clients can use the name for future operations." + }, + "advertisedId": { + "$ref": "AdvertisedId", + "description": "The identifier of a beacon as advertised by it. This field must be populated when registering. It may be empty when updating a beacon record because it is ignored in updates." + }, + "status": { + "type": "string", + "description": "Current status of the beacon. Required.", + "enum": [ + "STATUS_UNSPECIFIED", + "ACTIVE", + "DECOMMISSIONED", + "INACTIVE" + ] + }, + "placeId": { + "type": "string", + "description": "The [Google Places API](/places/place-id) Place ID of the place where the beacon is deployed. This is given when the beacon is registered or updated, not automatically detected in any way. Optional." + }, + "latLng": { + "$ref": "LatLng", + "description": "The location of the beacon, expressed as a latitude and longitude pair. This location is given when the beacon is registered or updated. It does not necessarily indicate the actual current location of the beacon. Optional." + }, + "indoorLevel": { + "$ref": "IndoorLevel", + "description": "The indoor level information for this beacon, if known. As returned by the Google Maps API. Optional." + }, + "expectedStability": { + "type": "string", + "description": "Expected location stability. This is set when the beacon is registered or updated, not automatically detected in any way. Optional.", + "enum": [ + "STABILITY_UNSPECIFIED", + "STABLE", + "PORTABLE", + "MOBILE", + "ROVING" + ] + }, + "description": { + "type": "string", + "description": "Free text used to identify and describe the beacon. Maximum length 140 characters. Optional." + }, + "properties": { + "type": "object", + "description": "Properties of the beacon device, for example battery type or firmware version. Optional.", + "additionalProperties": { + "type": "string" + } + } + } + }, + "AdvertisedId": { + "id": "AdvertisedId", + "type": "object", + "description": "Defines a unique identifier of a beacon as broadcast by the device.", + "properties": { + "type": { + "type": "string", + "description": "Specifies the identifier type. Required.", + "enum": [ + "TYPE_UNSPECIFIED", + "EDDYSTONE", + "IBEACON", + "ALTBEACON" + ] + }, + "id": { + "type": "string", + "description": "The actual beacon identifier, as broadcast by the beacon hardware. Must be [base64](http://tools.ietf.org/html/rfc4648#section-4) encoded in HTTP requests, and will be so encoded (with padding) in responses. The base64 encoding should be of the binary byte-stream and not any textual (such as hex) representation thereof. Required.", + "format": "byte" + } + } + }, + "LatLng": { + "id": "LatLng", + "type": "object", + "description": "An object representing a latitude/longitude pair. This is expressed as a pair of doubles representing degrees latitude and degrees longitude. Unless specified otherwise, this must conform to the WGS84 standard. Values must be within normalized ranges. Example of normalization code in Python: def NormalizeLongitude(longitude): \"\"\"Wrapsdecimal degrees longitude to [-180.0, 180.0].\"\"\" q, r = divmod(longitude, 360.0) if r \u003e 180.0 or (r == 180.0 and q \u003c= -1.0): return r - 360.0 return r def NormalizeLatLng(latitude, longitude): \"\"\"Wraps decimal degrees latitude and longitude to [-180.0, 180.0] and [-90.0, 90.0], respectively.\"\"\" r = latitude % 360.0 if r = 270.0: return r - 360, NormalizeLongitude(longitude) else: return 180 - r, NormalizeLongitude(longitude + 180.0) assert 180.0 == NormalizeLongitude(180.0) assert -180.0 == NormalizeLongitude(-180.0) assert -179.0 == NormalizeLongitude(181.0) assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0) assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0) assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0) assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0) assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0) assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0) assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0) assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0) assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0) assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)", + "properties": { + "latitude": { + "type": "number", + "description": "The latitude in degrees. It must be in the range [-90.0, +90.0].", + "format": "double" + }, + "longitude": { + "type": "number", + "description": "The longitude in degrees. It must be in the range [-180.0, +180.0].", + "format": "double" + } + } + }, + "IndoorLevel": { + "id": "IndoorLevel", + "type": "object", + "description": "Indoor level, a human-readable string as returned by Google Maps APIs, useful to indicate which floor of a building a beacon is located on.", + "properties": { + "name": { + "type": "string", + "description": "The name of this level." + } + } + }, + "Empty": { + "id": "Empty", + "type": "object", + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`." + }, + "ListBeaconsResponse": { + "id": "ListBeaconsResponse", + "type": "object", + "description": "Response that contains list beacon results and pagination help.", + "properties": { + "beacons": { + "type": "array", + "description": "The beacons that matched the search criteria.", + "items": { + "$ref": "Beacon" + } + }, + "nextPageToken": { + "type": "string", + "description": "An opaque pagination token that the client may provide in their next request to retrieve the next page of results." + }, + "totalCount": { + "type": "string", + "description": "Estimate of the total number of beacons matched by the query. Higher values may be less accurate.", + "format": "int64" + } + } + }, + "BeaconAttachment": { + "id": "BeaconAttachment", + "type": "object", + "description": "Project-specific data associated with a beacon.", + "properties": { + "attachmentName": { + "type": "string", + "description": "Resource name of this attachment. Attachment names have the format: beacons/beacon_id/attachments/attachment_id. Leave this empty on creation." + }, + "namespacedType": { + "type": "string", + "description": "Specifies what kind of attachment this is. Tells a client how to interpret the `data` field. Format is namespace/type. Namespace provides type separation between clients. Type describes the type of `data`, for use by the client when parsing the `data` field. Required." + }, + "data": { + "type": "string", + "description": "An opaque data container for client-provided data. Must be [base64](http://tools.ietf.org/html/rfc4648#section-4) encoded in HTTP requests, and will be so encoded (with padding) in responses. Required.", + "format": "byte" + } + } + }, + "ListBeaconAttachmentsResponse": { + "id": "ListBeaconAttachmentsResponse", + "type": "object", + "description": "Response to ListBeaconAttachments that contains the requested attachments.", + "properties": { + "attachments": { + "type": "array", + "description": "The attachments that corresponded to the request params.", + "items": { + "$ref": "BeaconAttachment" + } + } + } + }, + "DeleteAttachmentsResponse": { + "id": "DeleteAttachmentsResponse", + "type": "object", + "description": "Response for a request to delete attachments.", + "properties": { + "numDeleted": { + "type": "integer", + "description": "The number of attachments that were deleted.", + "format": "int32" + } + } + }, + "ListNamespacesResponse": { + "id": "ListNamespacesResponse", + "type": "object", + "description": "Response to ListNamespacesRequest that contains all the project's namespaces.", + "properties": { + "namespaces": { + "type": "array", + "description": "The attachments that corresponded to the request params.", + "items": { + "$ref": "Namespace" + } + } + } + }, + "Namespace": { + "id": "Namespace", + "type": "object", + "description": "An attachment namespace defines read and write access for all the attachments created under it. Each namespace is globally unique, and owned by one project which is the only project that can create attachments under it.", + "properties": { + "namespaceName": { + "type": "string", + "description": "Resource name of this namespace. Namespaces names have the format: namespaces/namespace." + }, + "servingVisibility": { + "type": "string", + "description": "Specifies what clients may receive attachments under this namespace via `beaconinfo.getforobserved`.", + "enum": [ + "VISIBILITY_UNSPECIFIED", + "UNLISTED", + "PUBLIC" + ] + } + } + }, + "ListDiagnosticsResponse": { + "id": "ListDiagnosticsResponse", + "type": "object", + "description": "Response that contains the requested diagnostics.", + "properties": { + "diagnostics": { + "type": "array", + "description": "The diagnostics matching the given request.", + "items": { + "$ref": "Diagnostics" + } + }, + "nextPageToken": { + "type": "string", + "description": "Token that can be used for pagination. Returned only if the request matches more beacons than can be returned in this response." + } + } + }, + "Diagnostics": { + "id": "Diagnostics", + "type": "object", + "description": "Diagnostics for a single beacon.", + "properties": { + "beaconName": { + "type": "string", + "description": "Resource name of the beacon." + }, + "estimatedLowBatteryDate": { + "$ref": "Date", + "description": "The date when the battery is expected to be low. If the value is missing then there is no estimate for when the battery will be low. This value is only an estimate, not an exact date." + }, + "alerts": { + "type": "array", + "description": "An unordered list of Alerts that the beacon has.", + "enumDescriptions": [ + "Invalid value. Should never appear.", + "The beacon has been reported in a location different than its registered location. This may indicate that the beacon has been moved. This signal is not 100% accurate, but indicates that further investigation is worth while.", + "The battery level for the beacon is low enough that, given the beacon's current use, its battery will run out with in the next 60 days. This indicates that the battery should be replaced soon." + ], + "items": { + "type": "string", + "enum": [ + "ALERT_UNSPECIFIED", + "WRONG_LOCATION", + "LOW_BATTERY" + ] + } + } + } + }, + "Date": { + "id": "Date", + "type": "object", + "description": "Represents a whole calendar date, e.g. date of birth. The time of day and time zone are either specified elsewhere or are not significant. The date is relative to the Proleptic Gregorian Calendar. The day may be 0 to represent a year and month where the day is not significant, e.g. credit card expiration date. The year may be 0 to represent a month and day independent of year, e.g. anniversary date. Related types are [google.type.TimeOfDay][] and `google.protobuf.Timestamp`.", + "properties": { + "year": { + "type": "integer", + "description": "Year of date. Must be from 1 to 9,999, or 0 if specifying a date without a year.", + "format": "int32" + }, + "month": { + "type": "integer", + "description": "Month of year of date. Must be from 1 to 12.", + "format": "int32" + }, + "day": { + "type": "integer", + "description": "Day of month. Must be from 1 to 31 and valid for the year and month, or 0 if specifying a year/month where the day is not sigificant.", + "format": "int32" + } + } + }, + "GetInfoForObservedBeaconsRequest": { + "id": "GetInfoForObservedBeaconsRequest", + "type": "object", + "description": "Request for beacon and attachment information about beacons that a mobile client has encountered \"in the wild\".", + "properties": { + "observations": { + "type": "array", + "description": "The beacons that the client has encountered. At least one must be given.", + "items": { + "$ref": "Observation" + } + }, + "namespacedTypes": { + "type": "array", + "description": "Specifies what kind of attachments to include in the response. When given, the response will include only attachments of the given types. When empty, no attachments will be returned. Must be in the format namespace/type. Accepts `*` to specify all types in all namespaces. Optional.", + "items": { + "type": "string" + } + } + } + }, + "Observation": { + "id": "Observation", + "type": "object", + "description": "Represents one beacon observed once.", + "properties": { + "advertisedId": { + "$ref": "AdvertisedId", + "description": "The ID advertised by the beacon the client has encountered. Required." + }, + "telemetry": { + "type": "string", + "description": "The array of telemetry bytes received from the beacon. The server is responsible for parsing it. This field may frequently be empty, as with a beacon that transmits telemetry only occasionally.", + "format": "byte" + }, + "timestampMs": { + "type": "string", + "description": "Time when the beacon was observed. Being sourced from a mobile device, this time may be suspect." + } + } + }, + "GetInfoForObservedBeaconsResponse": { + "id": "GetInfoForObservedBeaconsResponse", + "type": "object", + "description": "Information about the requested beacons, optionally including attachment data.", + "properties": { + "beacons": { + "type": "array", + "description": "Public information about beacons. May be empty if the request matched no beacons.", + "items": { + "$ref": "BeaconInfo" + } + } + } + }, + "BeaconInfo": { + "id": "BeaconInfo", + "type": "object", + "description": "A subset of beacon information served via the `beaconinfo.getforobserved` method, which you call when users of your app encounter your beacons.", + "properties": { + "advertisedId": { + "$ref": "AdvertisedId", + "description": "The ID advertised by the beacon." + }, + "beaconName": { + "type": "string", + "description": "The name under which the beacon is registered." + }, + "description": { + "type": "string", + "description": "Free text used to identify or describe the beacon in a registered establishment. For example: \"entrance\", \"room 101\", etc. May be empty." + }, + "attachments": { + "type": "array", + "description": "Attachments matching the type(s) requested. May be empty if no attachment types were requested, or if none matched.", + "items": { + "$ref": "AttachmentInfo" + } + } + } + }, + "AttachmentInfo": { + "id": "AttachmentInfo", + "type": "object", + "description": "A subset of attachment information served via the `beaconinfo.getforobserved` method, used when your users encounter your beacons.", + "properties": { + "namespacedType": { + "type": "string", + "description": "Specifies what kind of attachment this is. Tells a client how to interpret the `data` field. Format is namespace/type, for example scrupulous-wombat-12345/welcome-message" + }, + "data": { + "type": "string", + "description": "An opaque data container for client-provided data.", + "format": "byte" + } + } + } + }, + "resources": { + "beacons": { + "methods": { + "register": { + "id": "proximitybeacon.beacons.register", + "path": "v1beta1/beacons:register", + "httpMethod": "POST", + "description": "Registers a previously unregistered beacon given its `advertisedId`. These IDs are unique within the system. An ID can be registered only once.", + "request": { + "$ref": "Beacon" + }, + "response": { + "$ref": "Beacon" + } + }, + "decommission": { + "id": "proximitybeacon.beacons.decommission", + "path": "v1beta1/{+beaconName}:decommission", + "httpMethod": "POST", + "description": "Decommissions the specified beacon in the service. This beacon will no longer be returned from `beaconinfo.getforobserved`. This operation is permanent -- you will not be able to re-register a beacon with this ID again.", + "parameters": { + "beaconName": { + "type": "string", + "description": "Beacon that should be decommissioned. Required.", + "required": true, + "pattern": "^beacons/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "beaconName" + ], + "response": { + "$ref": "Empty" + } + }, + "get": { + "id": "proximitybeacon.beacons.get", + "path": "v1beta1/{+beaconName}", + "httpMethod": "GET", + "description": "Returns detailed information about the specified beacon.", + "parameters": { + "beaconName": { + "type": "string", + "description": "Beacon that is requested.", + "required": true, + "pattern": "^beacons/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "beaconName" + ], + "response": { + "$ref": "Beacon" + } + }, + "list": { + "id": "proximitybeacon.beacons.list", + "path": "v1beta1/beacons", + "httpMethod": "GET", + "description": "Searches the beacon registry for beacons that match the given search criteria. Only those beacons that the client has permission to list will be returned.", + "parameters": { + "q": { + "type": "string", + "description": "Filter query string that supports the following field filters: * `description:\"\"` For example: `description:\"Room 3\"` Returns beacons whose description matches tokens in the string \"Room 3\" (not necessarily that exact string). The string must be double-quoted. * `status:` For example: `status:active` Returns beacons whose status matches the given value. Values must be one of the Beacon.Status enum values (case insensitive). Accepts multiple filters which will be combined with OR logic. * `stability:` For example: `stability:mobile` Returns beacons whose expected stability matches the given value. Values must be one of the Beacon.Stability enum values (case insensitive). Accepts multiple filters which will be combined with OR logic. * `place_id:\"\"` For example: `place_id:\"ChIJVSZzVR8FdkgRXGmmm6SslKw=\"` Returns beacons explicitly registered at the given place, expressed as a Place ID obtained from [Google Places API](/places/place-id). Does not match places inside the given place. Does not consider the beacon's actual location (which may be different from its registered place). Accepts multiple filters that will be combined with OR logic. The place ID must be double-quoted. * `registration_time[|=]` For example: `registration_time\u003e=1433116800` Returns beacons whose registration time matches the given filter. Supports the operators: , =. Timestamp must be expressed as an integer number of seconds since midnight January 1, 1970 UTC. Accepts at most two filters that will be combined with AND logic, to support \"between\" semantics. If more than two are supplied, the latter ones are ignored. * `lat: lng: radius:` For example: `lat:51.1232343 lng:-1.093852 radius:1000` Returns beacons whose registered location is within the given circle. When any of these fields are given, all are required. Latitude and longitude must be decimal degrees between -90.0 and 90.0 and between -180.0 and 180.0 respectively. Radius must be an integer number of meters less than 1,000,000 (1000 km). * `property:\"=\"` For example: `property:\"battery-type=CR2032\"` Returns beacons which have a property of the given name and value. Supports multiple filters which will be combined with OR logic. The entire name=value string must be double-quoted as one string. * `attachment_type:\"\"` For example: `attachment_type:\"my-namespace/my-type\"` Returns beacons having at least one attachment of the given namespaced type. Supports \"any within this namespace\" via the partial wildcard syntax: \"my-namespace/*\". Supports multiple filters which will be combined with OR logic. The string must be double-quoted. Multiple filters on the same field are combined with OR logic (except registration_time which is combined with AND logic). Multiple filters on different fields are combined with AND logic. Filters should be separated by spaces. As with any HTTP query string parameter, the whole filter expression must be URL-encoded. Example REST request: `GET /v1beta1/beacons?q=status:active%20lat:51.123%20lng:-1.095%20radius:1000`", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A pagination token obtained from a previous request to list beacons.", + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "The maximum number of records to return for this request, up to a server-defined upper limit.", + "format": "int32", + "location": "query" + } + }, + "response": { + "$ref": "ListBeaconsResponse" + } + }, + "update": { + "id": "proximitybeacon.beacons.update", + "path": "v1beta1/{+beaconName}", + "httpMethod": "PUT", + "description": "Updates the information about the specified beacon. **Any field that you do not populate in the submitted beacon will be permanently erased**, so you should follow the \"read, modify, write\" pattern to avoid inadvertently destroying data. Changes to the beacon status via this method will be silently ignored. To update beacon status, use the separate methods on this API for (de)activation and decommissioning.", + "parameters": { + "beaconName": { + "type": "string", + "description": "Resource name of this beacon. A beacon name has the format \"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone, `1` for iBeacon, or `5` for AltBeacon. This field must be left empty when registering. After reading a beacon, clients can use the name for future operations.", + "required": true, + "pattern": "^beacons/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "beaconName" + ], + "request": { + "$ref": "Beacon" + }, + "response": { + "$ref": "Beacon" + } + }, + "activate": { + "id": "proximitybeacon.beacons.activate", + "path": "v1beta1/{+beaconName}:activate", + "httpMethod": "POST", + "description": "(Re)activates a beacon. A beacon that is active will return information and attachment data when queried via `beaconinfo.getforobserved`. Calling this method on an already active beacon will do nothing (but will return a successful response code).", + "parameters": { + "beaconName": { + "type": "string", + "description": "The beacon to activate. Required.", + "required": true, + "pattern": "^beacons/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "beaconName" + ], + "response": { + "$ref": "Empty" + } + }, + "deactivate": { + "id": "proximitybeacon.beacons.deactivate", + "path": "v1beta1/{+beaconName}:deactivate", + "httpMethod": "POST", + "description": "Deactivates a beacon. Once deactivated, the API will not return information nor attachment data for the beacon when queried via `beaconinfo.getforobserved`. Calling this method on an already inactive beacon will do nothing (but will return a successful response code).", + "parameters": { + "beaconName": { + "type": "string", + "description": "The beacon name of this beacon.", + "required": true, + "pattern": "^beacons/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "beaconName" + ], + "response": { + "$ref": "Empty" + } + } + }, + "resources": { + "attachments": { + "methods": { + "create": { + "id": "proximitybeacon.beacons.attachments.create", + "path": "v1beta1/{+beaconName}/attachments", + "httpMethod": "POST", + "description": "Associates the given data with the specified beacon. Attachment data must contain two parts: \n- A namespaced type. \n- The actual attachment data itself. The namespaced type consists of two parts, the namespace and the type. The namespace must be one of the values returned by the `namespaces` endpoint, while the type can be a string of any characters except for the forward slash (`/`) up to 100 characters in length. Attachment data can be up to 1024 bytes long.", + "parameters": { + "beaconName": { + "type": "string", + "description": "The beacon on which the attachment should be created. Required.", + "required": true, + "pattern": "^beacons/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "beaconName" + ], + "request": { + "$ref": "BeaconAttachment" + }, + "response": { + "$ref": "BeaconAttachment" + } + }, + "list": { + "id": "proximitybeacon.beacons.attachments.list", + "path": "v1beta1/{+beaconName}/attachments", + "httpMethod": "GET", + "description": "Returns the attachments for the specified beacon that match the specified namespaced-type pattern. To control which namespaced types are returned, you add the `namespacedType` query parameter to the request. You must either use `*/*`, to return all attachments, or the namespace must be one of the ones returned from the `namespaces` endpoint.", + "parameters": { + "beaconName": { + "type": "string", + "description": "The beacon whose attachments are to be fetched. Required.", + "required": true, + "pattern": "^beacons/[^/]*$", + "location": "path" + }, + "namespacedType": { + "type": "string", + "description": "Specifies the namespace and type of attachment to include in response in namespace/type format. Accepts `*/*` to specify \"all types in all namespaces\".", + "location": "query" + } + }, + "parameterOrder": [ + "beaconName" + ], + "response": { + "$ref": "ListBeaconAttachmentsResponse" + } + }, + "delete": { + "id": "proximitybeacon.beacons.attachments.delete", + "path": "v1beta1/{+attachmentName}", + "httpMethod": "DELETE", + "description": "Deletes the specified attachment for the given beacon. Each attachment has a unique attachment name (`attachmentName`) which is returned when you fetch the attachment data via this API. You specify this with the delete request to control which attachment is removed. This operation cannot be undone.", + "parameters": { + "attachmentName": { + "type": "string", + "description": "The attachment name (`attachmentName`) of the attachment to remove. For example: `beacons/3!893737abc9/attachments/c5e937-af0-494-959-ec49d12738` Required.", + "required": true, + "pattern": "^beacons/[^/]*/attachments/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "attachmentName" + ], + "response": { + "$ref": "Empty" + } + }, + "batchDelete": { + "id": "proximitybeacon.beacons.attachments.batchDelete", + "path": "v1beta1/{+beaconName}/attachments:batchDelete", + "httpMethod": "POST", + "description": "Deletes multiple attachments on a given beacon. This operation is permanent and cannot be undone. You can optionally specify `namespacedType` to choose which attachments should be deleted. If you do not specify `namespacedType`, all your attachments on the given beacon will be deleted. You also may explicitly specify `*/*` to delete all.", + "parameters": { + "beaconName": { + "type": "string", + "description": "The beacon whose attachments are to be deleted. Required.", + "required": true, + "pattern": "^beacons/[^/]*$", + "location": "path" + }, + "namespacedType": { + "type": "string", + "description": "Specifies the namespace and type of attachments to delete in `namespace/type` format. Accepts `*/*` to specify \"all types in all namespaces\". Optional.", + "location": "query" + } + }, + "parameterOrder": [ + "beaconName" + ], + "response": { + "$ref": "DeleteAttachmentsResponse" + } + } + } + }, + "diagnostics": { + "methods": { + "list": { + "id": "proximitybeacon.beacons.diagnostics.list", + "path": "v1beta1/{+beaconName}/diagnostics", + "httpMethod": "GET", + "description": "List the diagnostics for a single beacon. You can also list diagnostics for all the beacons owned by your Google Developers Console project by using the beacon name `beacons/-`.", + "parameters": { + "beaconName": { + "type": "string", + "description": "Beacon that the diagnostics are for.", + "required": true, + "pattern": "^beacons/[^/]*$", + "location": "path" + }, + "pageSize": { + "type": "integer", + "description": "Specifies the maximum number of results to return. Defaults to 10. Maximum 1000. Optional.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Requests results that occur after the `page_token`, obtained from the response to a previous request. Optional.", + "location": "query" + }, + "alertFilter": { + "type": "string", + "description": "Requests only beacons that have the given alert. For example, to find beacons that have low batteries use `alert_filter=LOW_BATTERY`.", + "enum": [ + "ALERT_UNSPECIFIED", + "WRONG_LOCATION", + "LOW_BATTERY" + ], + "location": "query" + } + }, + "parameterOrder": [ + "beaconName" + ], + "response": { + "$ref": "ListDiagnosticsResponse" + } + } + } + } + } + }, + "namespaces": { + "methods": { + "list": { + "id": "proximitybeacon.namespaces.list", + "path": "v1beta1/namespaces", + "httpMethod": "GET", + "description": "Lists all attachment namespaces owned by your Google Developers Console project. Attachment data associated with a beacon must include a namespaced type, and the namespace must be owned by your project.", + "response": { + "$ref": "ListNamespacesResponse" + } + } + } + }, + "beaconinfo": { + "methods": { + "getforobserved": { + "id": "proximitybeacon.beaconinfo.getforobserved", + "path": "v1beta1/beaconinfo:getforobserved", + "httpMethod": "POST", + "description": "Given one or more beacon observations, returns any beacon information and attachments accessible to your application.", + "request": { + "$ref": "GetInfoForObservedBeaconsRequest" + }, + "response": { + "$ref": "GetInfoForObservedBeaconsResponse" + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/proximitybeacon/v1beta1/proximitybeacon-gen.go b/Godeps/_workspace/src/google.golang.org/api/proximitybeacon/v1beta1/proximitybeacon-gen.go new file mode 100644 index 000000000..331b1ebe1 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/proximitybeacon/v1beta1/proximitybeacon-gen.go @@ -0,0 +1,2590 @@ +// Package proximitybeacon provides access to the Google Proximity Beacon API. +// +// See https://developers.google.com/beacons/proximity/ +// +// Usage example: +// +// import "google.golang.org/api/proximitybeacon/v1beta1" +// ... +// proximitybeaconService, err := proximitybeacon.New(oauthHttpClient) +package proximitybeacon // import "google.golang.org/api/proximitybeacon/v1beta1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "proximitybeacon:v1beta1" +const apiName = "proximitybeacon" +const apiVersion = "v1beta1" +const basePath = "https://proximitybeacon.googleapis.com/" + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Beaconinfo = NewBeaconinfoService(s) + s.Beacons = NewBeaconsService(s) + s.Namespaces = NewNamespacesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Beaconinfo *BeaconinfoService + + Beacons *BeaconsService + + Namespaces *NamespacesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewBeaconinfoService(s *Service) *BeaconinfoService { + rs := &BeaconinfoService{s: s} + return rs +} + +type BeaconinfoService struct { + s *Service +} + +func NewBeaconsService(s *Service) *BeaconsService { + rs := &BeaconsService{s: s} + rs.Attachments = NewBeaconsAttachmentsService(s) + rs.Diagnostics = NewBeaconsDiagnosticsService(s) + return rs +} + +type BeaconsService struct { + s *Service + + Attachments *BeaconsAttachmentsService + + Diagnostics *BeaconsDiagnosticsService +} + +func NewBeaconsAttachmentsService(s *Service) *BeaconsAttachmentsService { + rs := &BeaconsAttachmentsService{s: s} + return rs +} + +type BeaconsAttachmentsService struct { + s *Service +} + +func NewBeaconsDiagnosticsService(s *Service) *BeaconsDiagnosticsService { + rs := &BeaconsDiagnosticsService{s: s} + return rs +} + +type BeaconsDiagnosticsService struct { + s *Service +} + +func NewNamespacesService(s *Service) *NamespacesService { + rs := &NamespacesService{s: s} + return rs +} + +type NamespacesService struct { + s *Service +} + +// AdvertisedId: Defines a unique identifier of a beacon as broadcast by +// the device. +type AdvertisedId struct { + // Id: The actual beacon identifier, as broadcast by the beacon + // hardware. Must be + // [base64](http://tools.ietf.org/html/rfc4648#section-4) encoded in + // HTTP requests, and will be so encoded (with padding) in responses. + // The base64 encoding should be of the binary byte-stream and not any + // textual (such as hex) representation thereof. Required. + Id string `json:"id,omitempty"` + + // Type: Specifies the identifier type. Required. + // + // Possible values: + // "TYPE_UNSPECIFIED" + // "EDDYSTONE" + // "IBEACON" + // "ALTBEACON" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AdvertisedId) MarshalJSON() ([]byte, error) { + type noMethod AdvertisedId + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AttachmentInfo: A subset of attachment information served via the +// `beaconinfo.getforobserved` method, used when your users encounter +// your beacons. +type AttachmentInfo struct { + // Data: An opaque data container for client-provided data. + Data string `json:"data,omitempty"` + + // NamespacedType: Specifies what kind of attachment this is. Tells a + // client how to interpret the `data` field. Format is namespace/type, + // for example scrupulous-wombat-12345/welcome-message + NamespacedType string `json:"namespacedType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Data") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AttachmentInfo) MarshalJSON() ([]byte, error) { + type noMethod AttachmentInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Beacon: Details of a beacon device. +type Beacon struct { + // AdvertisedId: The identifier of a beacon as advertised by it. This + // field must be populated when registering. It may be empty when + // updating a beacon record because it is ignored in updates. + AdvertisedId *AdvertisedId `json:"advertisedId,omitempty"` + + // BeaconName: Resource name of this beacon. A beacon name has the + // format "beacons/N!beaconId" where the beaconId is the base16 ID + // broadcast by the beacon and N is a code for the beacon's type. + // Possible values are `3` for Eddystone, `1` for iBeacon, or `5` for + // AltBeacon. This field must be left empty when registering. After + // reading a beacon, clients can use the name for future operations. + BeaconName string `json:"beaconName,omitempty"` + + // Description: Free text used to identify and describe the beacon. + // Maximum length 140 characters. Optional. + Description string `json:"description,omitempty"` + + // ExpectedStability: Expected location stability. This is set when the + // beacon is registered or updated, not automatically detected in any + // way. Optional. + // + // Possible values: + // "STABILITY_UNSPECIFIED" + // "STABLE" + // "PORTABLE" + // "MOBILE" + // "ROVING" + ExpectedStability string `json:"expectedStability,omitempty"` + + // IndoorLevel: The indoor level information for this beacon, if known. + // As returned by the Google Maps API. Optional. + IndoorLevel *IndoorLevel `json:"indoorLevel,omitempty"` + + // LatLng: The location of the beacon, expressed as a latitude and + // longitude pair. This location is given when the beacon is registered + // or updated. It does not necessarily indicate the actual current + // location of the beacon. Optional. + LatLng *LatLng `json:"latLng,omitempty"` + + // PlaceId: The [Google Places API](/places/place-id) Place ID of the + // place where the beacon is deployed. This is given when the beacon is + // registered or updated, not automatically detected in any way. + // Optional. + PlaceId string `json:"placeId,omitempty"` + + // Properties: Properties of the beacon device, for example battery type + // or firmware version. Optional. + Properties map[string]string `json:"properties,omitempty"` + + // Status: Current status of the beacon. Required. + // + // Possible values: + // "STATUS_UNSPECIFIED" + // "ACTIVE" + // "DECOMMISSIONED" + // "INACTIVE" + Status string `json:"status,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AdvertisedId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Beacon) MarshalJSON() ([]byte, error) { + type noMethod Beacon + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BeaconAttachment: Project-specific data associated with a beacon. +type BeaconAttachment struct { + // AttachmentName: Resource name of this attachment. Attachment names + // have the format: beacons/beacon_id/attachments/attachment_id. Leave + // this empty on creation. + AttachmentName string `json:"attachmentName,omitempty"` + + // Data: An opaque data container for client-provided data. Must be + // [base64](http://tools.ietf.org/html/rfc4648#section-4) encoded in + // HTTP requests, and will be so encoded (with padding) in responses. + // Required. + Data string `json:"data,omitempty"` + + // NamespacedType: Specifies what kind of attachment this is. Tells a + // client how to interpret the `data` field. Format is namespace/type. + // Namespace provides type separation between clients. Type describes + // the type of `data`, for use by the client when parsing the `data` + // field. Required. + NamespacedType string `json:"namespacedType,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AttachmentName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BeaconAttachment) MarshalJSON() ([]byte, error) { + type noMethod BeaconAttachment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BeaconInfo: A subset of beacon information served via the +// `beaconinfo.getforobserved` method, which you call when users of your +// app encounter your beacons. +type BeaconInfo struct { + // AdvertisedId: The ID advertised by the beacon. + AdvertisedId *AdvertisedId `json:"advertisedId,omitempty"` + + // Attachments: Attachments matching the type(s) requested. May be empty + // if no attachment types were requested, or if none matched. + Attachments []*AttachmentInfo `json:"attachments,omitempty"` + + // BeaconName: The name under which the beacon is registered. + BeaconName string `json:"beaconName,omitempty"` + + // Description: Free text used to identify or describe the beacon in a + // registered establishment. For example: "entrance", "room 101", etc. + // May be empty. + Description string `json:"description,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AdvertisedId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BeaconInfo) MarshalJSON() ([]byte, error) { + type noMethod BeaconInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Date: Represents a whole calendar date, e.g. date of birth. The time +// of day and time zone are either specified elsewhere or are not +// significant. The date is relative to the Proleptic Gregorian +// Calendar. The day may be 0 to represent a year and month where the +// day is not significant, e.g. credit card expiration date. The year +// may be 0 to represent a month and day independent of year, e.g. +// anniversary date. Related types are [google.type.TimeOfDay][] and +// `google.protobuf.Timestamp`. +type Date struct { + // Day: Day of month. Must be from 1 to 31 and valid for the year and + // month, or 0 if specifying a year/month where the day is not + // sigificant. + Day int64 `json:"day,omitempty"` + + // Month: Month of year of date. Must be from 1 to 12. + Month int64 `json:"month,omitempty"` + + // Year: Year of date. Must be from 1 to 9,999, or 0 if specifying a + // date without a year. + Year int64 `json:"year,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Day") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Date) MarshalJSON() ([]byte, error) { + type noMethod Date + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DeleteAttachmentsResponse: Response for a request to delete +// attachments. +type DeleteAttachmentsResponse struct { + // NumDeleted: The number of attachments that were deleted. + NumDeleted int64 `json:"numDeleted,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NumDeleted") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeleteAttachmentsResponse) MarshalJSON() ([]byte, error) { + type noMethod DeleteAttachmentsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Diagnostics: Diagnostics for a single beacon. +type Diagnostics struct { + // Alerts: An unordered list of Alerts that the beacon has. + // + // Possible values: + // "ALERT_UNSPECIFIED" - Invalid value. Should never appear. + // "WRONG_LOCATION" - The beacon has been reported in a location + // different than its registered location. This may indicate that the + // beacon has been moved. This signal is not 100% accurate, but + // indicates that further investigation is worth while. + // "LOW_BATTERY" - The battery level for the beacon is low enough + // that, given the beacon's current use, its battery will run out with + // in the next 60 days. This indicates that the battery should be + // replaced soon. + Alerts []string `json:"alerts,omitempty"` + + // BeaconName: Resource name of the beacon. + BeaconName string `json:"beaconName,omitempty"` + + // EstimatedLowBatteryDate: The date when the battery is expected to be + // low. If the value is missing then there is no estimate for when the + // battery will be low. This value is only an estimate, not an exact + // date. + EstimatedLowBatteryDate *Date `json:"estimatedLowBatteryDate,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Alerts") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Diagnostics) MarshalJSON() ([]byte, error) { + type noMethod Diagnostics + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Empty: A generic empty message that you can re-use to avoid defining +// duplicated empty messages in your APIs. A typical example is to use +// it as the request or the response type of an API method. For +// instance: service Foo { rpc Bar(google.protobuf.Empty) returns +// (google.protobuf.Empty); } The JSON representation for `Empty` is +// empty JSON object `{}`. +type Empty struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// GetInfoForObservedBeaconsRequest: Request for beacon and attachment +// information about beacons that a mobile client has encountered "in +// the wild". +type GetInfoForObservedBeaconsRequest struct { + // NamespacedTypes: Specifies what kind of attachments to include in the + // response. When given, the response will include only attachments of + // the given types. When empty, no attachments will be returned. Must be + // in the format namespace/type. Accepts `*` to specify all types in all + // namespaces. Optional. + NamespacedTypes []string `json:"namespacedTypes,omitempty"` + + // Observations: The beacons that the client has encountered. At least + // one must be given. + Observations []*Observation `json:"observations,omitempty"` + + // ForceSendFields is a list of field names (e.g. "NamespacedTypes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GetInfoForObservedBeaconsRequest) MarshalJSON() ([]byte, error) { + type noMethod GetInfoForObservedBeaconsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GetInfoForObservedBeaconsResponse: Information about the requested +// beacons, optionally including attachment data. +type GetInfoForObservedBeaconsResponse struct { + // Beacons: Public information about beacons. May be empty if the + // request matched no beacons. + Beacons []*BeaconInfo `json:"beacons,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Beacons") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GetInfoForObservedBeaconsResponse) MarshalJSON() ([]byte, error) { + type noMethod GetInfoForObservedBeaconsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// IndoorLevel: Indoor level, a human-readable string as returned by +// Google Maps APIs, useful to indicate which floor of a building a +// beacon is located on. +type IndoorLevel struct { + // Name: The name of this level. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *IndoorLevel) MarshalJSON() ([]byte, error) { + type noMethod IndoorLevel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LatLng: An object representing a latitude/longitude pair. This is +// expressed as a pair of doubles representing degrees latitude and +// degrees longitude. Unless specified otherwise, this must conform to +// the WGS84 standard. Values must be within normalized ranges. Example +// of normalization code in Python: def NormalizeLongitude(longitude): +// """Wrapsdecimal degrees longitude to [-180.0, 180.0].""" q, r = +// divmod(longitude, 360.0) if r > 180.0 or (r == 180.0 and q <= -1.0): +// return r - 360.0 return r def NormalizeLatLng(latitude, longitude): +// """Wraps decimal degrees latitude and longitude to [-180.0, 180.0] +// and [-90.0, 90.0], respectively.""" r = latitude % 360.0 if r = +// 270.0: return r - 360, NormalizeLongitude(longitude) else: return 180 +// - r, NormalizeLongitude(longitude + 180.0) assert 180.0 == +// NormalizeLongitude(180.0) assert -180.0 == NormalizeLongitude(-180.0) +// assert -179.0 == NormalizeLongitude(181.0) assert (0.0, 0.0) == +// NormalizeLatLng(360.0, 0.0) assert (0.0, 0.0) == +// NormalizeLatLng(-360.0, 0.0) assert (85.0, 180.0) == +// NormalizeLatLng(95.0, 0.0) assert (-85.0, -170.0) == +// NormalizeLatLng(-95.0, 10.0) assert (90.0, 10.0) == +// NormalizeLatLng(90.0, 10.0) assert (-90.0, -10.0) == +// NormalizeLatLng(-90.0, -10.0) assert (0.0, -170.0) == +// NormalizeLatLng(-180.0, 10.0) assert (0.0, -170.0) == +// NormalizeLatLng(180.0, 10.0) assert (-90.0, 10.0) == +// NormalizeLatLng(270.0, 10.0) assert (90.0, 10.0) == +// NormalizeLatLng(-270.0, 10.0) +type LatLng struct { + // Latitude: The latitude in degrees. It must be in the range [-90.0, + // +90.0]. + Latitude float64 `json:"latitude,omitempty"` + + // Longitude: The longitude in degrees. It must be in the range [-180.0, + // +180.0]. + Longitude float64 `json:"longitude,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Latitude") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LatLng) MarshalJSON() ([]byte, error) { + type noMethod LatLng + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListBeaconAttachmentsResponse: Response to ListBeaconAttachments that +// contains the requested attachments. +type ListBeaconAttachmentsResponse struct { + // Attachments: The attachments that corresponded to the request params. + Attachments []*BeaconAttachment `json:"attachments,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Attachments") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListBeaconAttachmentsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListBeaconAttachmentsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListBeaconsResponse: Response that contains list beacon results and +// pagination help. +type ListBeaconsResponse struct { + // Beacons: The beacons that matched the search criteria. + Beacons []*Beacon `json:"beacons,omitempty"` + + // NextPageToken: An opaque pagination token that the client may provide + // in their next request to retrieve the next page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // TotalCount: Estimate of the total number of beacons matched by the + // query. Higher values may be less accurate. + TotalCount int64 `json:"totalCount,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Beacons") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListBeaconsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListBeaconsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListDiagnosticsResponse: Response that contains the requested +// diagnostics. +type ListDiagnosticsResponse struct { + // Diagnostics: The diagnostics matching the given request. + Diagnostics []*Diagnostics `json:"diagnostics,omitempty"` + + // NextPageToken: Token that can be used for pagination. Returned only + // if the request matches more beacons than can be returned in this + // response. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Diagnostics") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListDiagnosticsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListDiagnosticsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListNamespacesResponse: Response to ListNamespacesRequest that +// contains all the project's namespaces. +type ListNamespacesResponse struct { + // Namespaces: The attachments that corresponded to the request params. + Namespaces []*Namespace `json:"namespaces,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Namespaces") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListNamespacesResponse) MarshalJSON() ([]byte, error) { + type noMethod ListNamespacesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Namespace: An attachment namespace defines read and write access for +// all the attachments created under it. Each namespace is globally +// unique, and owned by one project which is the only project that can +// create attachments under it. +type Namespace struct { + // NamespaceName: Resource name of this namespace. Namespaces names have + // the format: namespaces/namespace. + NamespaceName string `json:"namespaceName,omitempty"` + + // ServingVisibility: Specifies what clients may receive attachments + // under this namespace via `beaconinfo.getforobserved`. + // + // Possible values: + // "VISIBILITY_UNSPECIFIED" + // "UNLISTED" + // "PUBLIC" + ServingVisibility string `json:"servingVisibility,omitempty"` + + // ForceSendFields is a list of field names (e.g. "NamespaceName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Namespace) MarshalJSON() ([]byte, error) { + type noMethod Namespace + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Observation: Represents one beacon observed once. +type Observation struct { + // AdvertisedId: The ID advertised by the beacon the client has + // encountered. Required. + AdvertisedId *AdvertisedId `json:"advertisedId,omitempty"` + + // Telemetry: The array of telemetry bytes received from the beacon. The + // server is responsible for parsing it. This field may frequently be + // empty, as with a beacon that transmits telemetry only occasionally. + Telemetry string `json:"telemetry,omitempty"` + + // TimestampMs: Time when the beacon was observed. Being sourced from a + // mobile device, this time may be suspect. + TimestampMs string `json:"timestampMs,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AdvertisedId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Observation) MarshalJSON() ([]byte, error) { + type noMethod Observation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "proximitybeacon.beaconinfo.getforobserved": + +type BeaconinfoGetforobservedCall struct { + s *Service + getinfoforobservedbeaconsrequest *GetInfoForObservedBeaconsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Getforobserved: Given one or more beacon observations, returns any +// beacon information and attachments accessible to your application. +func (r *BeaconinfoService) Getforobserved(getinfoforobservedbeaconsrequest *GetInfoForObservedBeaconsRequest) *BeaconinfoGetforobservedCall { + c := &BeaconinfoGetforobservedCall{s: r.s, opt_: make(map[string]interface{})} + c.getinfoforobservedbeaconsrequest = getinfoforobservedbeaconsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BeaconinfoGetforobservedCall) Fields(s ...googleapi.Field) *BeaconinfoGetforobservedCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BeaconinfoGetforobservedCall) Context(ctx context.Context) *BeaconinfoGetforobservedCall { + c.ctx_ = ctx + return c +} + +func (c *BeaconinfoGetforobservedCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.getinfoforobservedbeaconsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/beaconinfo:getforobserved") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "proximitybeacon.beaconinfo.getforobserved" call. +// Exactly one of *GetInfoForObservedBeaconsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *GetInfoForObservedBeaconsResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *BeaconinfoGetforobservedCall) Do() (*GetInfoForObservedBeaconsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &GetInfoForObservedBeaconsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Given one or more beacon observations, returns any beacon information and attachments accessible to your application.", + // "httpMethod": "POST", + // "id": "proximitybeacon.beaconinfo.getforobserved", + // "path": "v1beta1/beaconinfo:getforobserved", + // "request": { + // "$ref": "GetInfoForObservedBeaconsRequest" + // }, + // "response": { + // "$ref": "GetInfoForObservedBeaconsResponse" + // } + // } + +} + +// method id "proximitybeacon.beacons.activate": + +type BeaconsActivateCall struct { + s *Service + beaconName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Activate: (Re)activates a beacon. A beacon that is active will return +// information and attachment data when queried via +// `beaconinfo.getforobserved`. Calling this method on an already active +// beacon will do nothing (but will return a successful response code). +func (r *BeaconsService) Activate(beaconName string) *BeaconsActivateCall { + c := &BeaconsActivateCall{s: r.s, opt_: make(map[string]interface{})} + c.beaconName = beaconName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BeaconsActivateCall) Fields(s ...googleapi.Field) *BeaconsActivateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BeaconsActivateCall) Context(ctx context.Context) *BeaconsActivateCall { + c.ctx_ = ctx + return c +} + +func (c *BeaconsActivateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+beaconName}:activate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "beaconName": c.beaconName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "proximitybeacon.beacons.activate" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BeaconsActivateCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "(Re)activates a beacon. A beacon that is active will return information and attachment data when queried via `beaconinfo.getforobserved`. Calling this method on an already active beacon will do nothing (but will return a successful response code).", + // "httpMethod": "POST", + // "id": "proximitybeacon.beacons.activate", + // "parameterOrder": [ + // "beaconName" + // ], + // "parameters": { + // "beaconName": { + // "description": "The beacon to activate. Required.", + // "location": "path", + // "pattern": "^beacons/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/{+beaconName}:activate", + // "response": { + // "$ref": "Empty" + // } + // } + +} + +// method id "proximitybeacon.beacons.deactivate": + +type BeaconsDeactivateCall struct { + s *Service + beaconName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Deactivate: Deactivates a beacon. Once deactivated, the API will not +// return information nor attachment data for the beacon when queried +// via `beaconinfo.getforobserved`. Calling this method on an already +// inactive beacon will do nothing (but will return a successful +// response code). +func (r *BeaconsService) Deactivate(beaconName string) *BeaconsDeactivateCall { + c := &BeaconsDeactivateCall{s: r.s, opt_: make(map[string]interface{})} + c.beaconName = beaconName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BeaconsDeactivateCall) Fields(s ...googleapi.Field) *BeaconsDeactivateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BeaconsDeactivateCall) Context(ctx context.Context) *BeaconsDeactivateCall { + c.ctx_ = ctx + return c +} + +func (c *BeaconsDeactivateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+beaconName}:deactivate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "beaconName": c.beaconName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "proximitybeacon.beacons.deactivate" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BeaconsDeactivateCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deactivates a beacon. Once deactivated, the API will not return information nor attachment data for the beacon when queried via `beaconinfo.getforobserved`. Calling this method on an already inactive beacon will do nothing (but will return a successful response code).", + // "httpMethod": "POST", + // "id": "proximitybeacon.beacons.deactivate", + // "parameterOrder": [ + // "beaconName" + // ], + // "parameters": { + // "beaconName": { + // "description": "The beacon name of this beacon.", + // "location": "path", + // "pattern": "^beacons/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/{+beaconName}:deactivate", + // "response": { + // "$ref": "Empty" + // } + // } + +} + +// method id "proximitybeacon.beacons.decommission": + +type BeaconsDecommissionCall struct { + s *Service + beaconName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Decommission: Decommissions the specified beacon in the service. This +// beacon will no longer be returned from `beaconinfo.getforobserved`. +// This operation is permanent -- you will not be able to re-register a +// beacon with this ID again. +func (r *BeaconsService) Decommission(beaconName string) *BeaconsDecommissionCall { + c := &BeaconsDecommissionCall{s: r.s, opt_: make(map[string]interface{})} + c.beaconName = beaconName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BeaconsDecommissionCall) Fields(s ...googleapi.Field) *BeaconsDecommissionCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BeaconsDecommissionCall) Context(ctx context.Context) *BeaconsDecommissionCall { + c.ctx_ = ctx + return c +} + +func (c *BeaconsDecommissionCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+beaconName}:decommission") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "beaconName": c.beaconName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "proximitybeacon.beacons.decommission" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BeaconsDecommissionCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Decommissions the specified beacon in the service. This beacon will no longer be returned from `beaconinfo.getforobserved`. This operation is permanent -- you will not be able to re-register a beacon with this ID again.", + // "httpMethod": "POST", + // "id": "proximitybeacon.beacons.decommission", + // "parameterOrder": [ + // "beaconName" + // ], + // "parameters": { + // "beaconName": { + // "description": "Beacon that should be decommissioned. Required.", + // "location": "path", + // "pattern": "^beacons/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/{+beaconName}:decommission", + // "response": { + // "$ref": "Empty" + // } + // } + +} + +// method id "proximitybeacon.beacons.get": + +type BeaconsGetCall struct { + s *Service + beaconName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns detailed information about the specified beacon. +func (r *BeaconsService) Get(beaconName string) *BeaconsGetCall { + c := &BeaconsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.beaconName = beaconName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BeaconsGetCall) Fields(s ...googleapi.Field) *BeaconsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BeaconsGetCall) IfNoneMatch(entityTag string) *BeaconsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BeaconsGetCall) Context(ctx context.Context) *BeaconsGetCall { + c.ctx_ = ctx + return c +} + +func (c *BeaconsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+beaconName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "beaconName": c.beaconName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "proximitybeacon.beacons.get" call. +// Exactly one of *Beacon or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Beacon.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BeaconsGetCall) Do() (*Beacon, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Beacon{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns detailed information about the specified beacon.", + // "httpMethod": "GET", + // "id": "proximitybeacon.beacons.get", + // "parameterOrder": [ + // "beaconName" + // ], + // "parameters": { + // "beaconName": { + // "description": "Beacon that is requested.", + // "location": "path", + // "pattern": "^beacons/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/{+beaconName}", + // "response": { + // "$ref": "Beacon" + // } + // } + +} + +// method id "proximitybeacon.beacons.list": + +type BeaconsListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Searches the beacon registry for beacons that match the given +// search criteria. Only those beacons that the client has permission to +// list will be returned. +func (r *BeaconsService) List() *BeaconsListCall { + c := &BeaconsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of records to return for this request, up to a server-defined upper +// limit. +func (c *BeaconsListCall) PageSize(pageSize int64) *BeaconsListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": A pagination token +// obtained from a previous request to list beacons. +func (c *BeaconsListCall) PageToken(pageToken string) *BeaconsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Q sets the optional parameter "q": Filter query string that supports +// the following field filters: * `description:"" For example: +// `description:"Room 3" Returns beacons whose description matches +// tokens in the string "Room 3" (not necessarily that exact string). +// The string must be double-quoted. * `status:` For example: +// `status:active` Returns beacons whose status matches the given value. +// Values must be one of the Beacon.Status enum values (case +// insensitive). Accepts multiple filters which will be combined with OR +// logic. * `stability:` For example: `stability:mobile` Returns beacons +// whose expected stability matches the given value. Values must be one +// of the Beacon.Stability enum values (case insensitive). Accepts +// multiple filters which will be combined with OR logic. * +// `place_id:"" For example: `place_id:"ChIJVSZzVR8FdkgRXGmmm6SslKw=" +// Returns beacons explicitly registered at the given place, expressed +// as a Place ID obtained from [Google Places API](/places/place-id). +// Does not match places inside the given place. Does not consider the +// beacon's actual location (which may be different from its registered +// place). Accepts multiple filters that will be combined with OR logic. +// The place ID must be double-quoted. * `registration_time[|=]` For +// example: `registration_time>=1433116800` Returns beacons whose +// registration time matches the given filter. Supports the operators: , +// =. Timestamp must be expressed as an integer number of seconds since +// midnight January 1, 1970 UTC. Accepts at most two filters that will +// be combined with AND logic, to support "between" semantics. If more +// than two are supplied, the latter ones are ignored. * `lat: lng: +// radius:` For example: `lat:51.1232343 lng:-1.093852 radius:1000` +// Returns beacons whose registered location is within the given circle. +// When any of these fields are given, all are required. Latitude and +// longitude must be decimal degrees between -90.0 and 90.0 and between +// -180.0 and 180.0 respectively. Radius must be an integer number of +// meters less than 1,000,000 (1000 km). * `property:"=" For example: +// `property:"battery-type=CR2032" Returns beacons which have a +// property of the given name and value. Supports multiple filters which +// will be combined with OR logic. The entire name=value string must be +// double-quoted as one string. * `attachment_type:"" For example: +// `attachment_type:"my-namespace/my-type" Returns beacons having at +// least one attachment of the given namespaced type. Supports "any +// within this namespace" via the partial wildcard syntax: +// "my-namespace/*". Supports multiple filters which will be combined +// with OR logic. The string must be double-quoted. Multiple filters on +// the same field are combined with OR logic (except registration_time +// which is combined with AND logic). Multiple filters on different +// fields are combined with AND logic. Filters should be separated by +// spaces. As with any HTTP query string parameter, the whole filter +// expression must be URL-encoded. Example REST request: `GET +// /v1beta1/beacons?q=status:active%20lat:51.123%20lng:-1.095%20radius:10 +// 00` +func (c *BeaconsListCall) Q(q string) *BeaconsListCall { + c.opt_["q"] = q + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BeaconsListCall) Fields(s ...googleapi.Field) *BeaconsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BeaconsListCall) IfNoneMatch(entityTag string) *BeaconsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BeaconsListCall) Context(ctx context.Context) *BeaconsListCall { + c.ctx_ = ctx + return c +} + +func (c *BeaconsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["q"]; ok { + params.Set("q", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/beacons") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "proximitybeacon.beacons.list" call. +// Exactly one of *ListBeaconsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListBeaconsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BeaconsListCall) Do() (*ListBeaconsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListBeaconsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Searches the beacon registry for beacons that match the given search criteria. Only those beacons that the client has permission to list will be returned.", + // "httpMethod": "GET", + // "id": "proximitybeacon.beacons.list", + // "parameters": { + // "pageSize": { + // "description": "The maximum number of records to return for this request, up to a server-defined upper limit.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A pagination token obtained from a previous request to list beacons.", + // "location": "query", + // "type": "string" + // }, + // "q": { + // "description": "Filter query string that supports the following field filters: * `description:\"\"` For example: `description:\"Room 3\"` Returns beacons whose description matches tokens in the string \"Room 3\" (not necessarily that exact string). The string must be double-quoted. * `status:` For example: `status:active` Returns beacons whose status matches the given value. Values must be one of the Beacon.Status enum values (case insensitive). Accepts multiple filters which will be combined with OR logic. * `stability:` For example: `stability:mobile` Returns beacons whose expected stability matches the given value. Values must be one of the Beacon.Stability enum values (case insensitive). Accepts multiple filters which will be combined with OR logic. * `place_id:\"\"` For example: `place_id:\"ChIJVSZzVR8FdkgRXGmmm6SslKw=\"` Returns beacons explicitly registered at the given place, expressed as a Place ID obtained from [Google Places API](/places/place-id). Does not match places inside the given place. Does not consider the beacon's actual location (which may be different from its registered place). Accepts multiple filters that will be combined with OR logic. The place ID must be double-quoted. * `registration_time[|=]` For example: `registration_time\u003e=1433116800` Returns beacons whose registration time matches the given filter. Supports the operators: , =. Timestamp must be expressed as an integer number of seconds since midnight January 1, 1970 UTC. Accepts at most two filters that will be combined with AND logic, to support \"between\" semantics. If more than two are supplied, the latter ones are ignored. * `lat: lng: radius:` For example: `lat:51.1232343 lng:-1.093852 radius:1000` Returns beacons whose registered location is within the given circle. When any of these fields are given, all are required. Latitude and longitude must be decimal degrees between -90.0 and 90.0 and between -180.0 and 180.0 respectively. Radius must be an integer number of meters less than 1,000,000 (1000 km). * `property:\"=\"` For example: `property:\"battery-type=CR2032\"` Returns beacons which have a property of the given name and value. Supports multiple filters which will be combined with OR logic. The entire name=value string must be double-quoted as one string. * `attachment_type:\"\"` For example: `attachment_type:\"my-namespace/my-type\"` Returns beacons having at least one attachment of the given namespaced type. Supports \"any within this namespace\" via the partial wildcard syntax: \"my-namespace/*\". Supports multiple filters which will be combined with OR logic. The string must be double-quoted. Multiple filters on the same field are combined with OR logic (except registration_time which is combined with AND logic). Multiple filters on different fields are combined with AND logic. Filters should be separated by spaces. As with any HTTP query string parameter, the whole filter expression must be URL-encoded. Example REST request: `GET /v1beta1/beacons?q=status:active%20lat:51.123%20lng:-1.095%20radius:1000`", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1beta1/beacons", + // "response": { + // "$ref": "ListBeaconsResponse" + // } + // } + +} + +// method id "proximitybeacon.beacons.register": + +type BeaconsRegisterCall struct { + s *Service + beacon *Beacon + opt_ map[string]interface{} + ctx_ context.Context +} + +// Register: Registers a previously unregistered beacon given its +// `advertisedId`. These IDs are unique within the system. An ID can be +// registered only once. +func (r *BeaconsService) Register(beacon *Beacon) *BeaconsRegisterCall { + c := &BeaconsRegisterCall{s: r.s, opt_: make(map[string]interface{})} + c.beacon = beacon + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BeaconsRegisterCall) Fields(s ...googleapi.Field) *BeaconsRegisterCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BeaconsRegisterCall) Context(ctx context.Context) *BeaconsRegisterCall { + c.ctx_ = ctx + return c +} + +func (c *BeaconsRegisterCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.beacon) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/beacons: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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "proximitybeacon.beacons.register" call. +// Exactly one of *Beacon or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Beacon.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BeaconsRegisterCall) Do() (*Beacon, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Beacon{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Registers a previously unregistered beacon given its `advertisedId`. These IDs are unique within the system. An ID can be registered only once.", + // "httpMethod": "POST", + // "id": "proximitybeacon.beacons.register", + // "path": "v1beta1/beacons:register", + // "request": { + // "$ref": "Beacon" + // }, + // "response": { + // "$ref": "Beacon" + // } + // } + +} + +// method id "proximitybeacon.beacons.update": + +type BeaconsUpdateCall struct { + s *Service + beaconName string + beacon *Beacon + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates the information about the specified beacon. **Any +// field that you do not populate in the submitted beacon will be +// permanently erased**, so you should follow the "read, modify, write" +// pattern to avoid inadvertently destroying data. Changes to the beacon +// status via this method will be silently ignored. To update beacon +// status, use the separate methods on this API for (de)activation and +// decommissioning. +func (r *BeaconsService) Update(beaconName string, beacon *Beacon) *BeaconsUpdateCall { + c := &BeaconsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.beaconName = beaconName + c.beacon = beacon + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BeaconsUpdateCall) Fields(s ...googleapi.Field) *BeaconsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BeaconsUpdateCall) Context(ctx context.Context) *BeaconsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *BeaconsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.beacon) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+beaconName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "beaconName": c.beaconName, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "proximitybeacon.beacons.update" call. +// Exactly one of *Beacon or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Beacon.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BeaconsUpdateCall) Do() (*Beacon, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Beacon{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the information about the specified beacon. **Any field that you do not populate in the submitted beacon will be permanently erased**, so you should follow the \"read, modify, write\" pattern to avoid inadvertently destroying data. Changes to the beacon status via this method will be silently ignored. To update beacon status, use the separate methods on this API for (de)activation and decommissioning.", + // "httpMethod": "PUT", + // "id": "proximitybeacon.beacons.update", + // "parameterOrder": [ + // "beaconName" + // ], + // "parameters": { + // "beaconName": { + // "description": "Resource name of this beacon. A beacon name has the format \"beacons/N!beaconId\" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone, `1` for iBeacon, or `5` for AltBeacon. This field must be left empty when registering. After reading a beacon, clients can use the name for future operations.", + // "location": "path", + // "pattern": "^beacons/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/{+beaconName}", + // "request": { + // "$ref": "Beacon" + // }, + // "response": { + // "$ref": "Beacon" + // } + // } + +} + +// method id "proximitybeacon.beacons.attachments.batchDelete": + +type BeaconsAttachmentsBatchDeleteCall struct { + s *Service + beaconName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// BatchDelete: Deletes multiple attachments on a given beacon. This +// operation is permanent and cannot be undone. You can optionally +// specify `namespacedType` to choose which attachments should be +// deleted. If you do not specify `namespacedType`, all your attachments +// on the given beacon will be deleted. You also may explicitly specify +// `*/*` to delete all. +func (r *BeaconsAttachmentsService) BatchDelete(beaconName string) *BeaconsAttachmentsBatchDeleteCall { + c := &BeaconsAttachmentsBatchDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.beaconName = beaconName + return c +} + +// NamespacedType sets the optional parameter "namespacedType": +// Specifies the namespace and type of attachments to delete in +// `namespace/type` format. Accepts `*/*` to specify "all types in all +// namespaces". +func (c *BeaconsAttachmentsBatchDeleteCall) NamespacedType(namespacedType string) *BeaconsAttachmentsBatchDeleteCall { + c.opt_["namespacedType"] = namespacedType + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BeaconsAttachmentsBatchDeleteCall) Fields(s ...googleapi.Field) *BeaconsAttachmentsBatchDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BeaconsAttachmentsBatchDeleteCall) Context(ctx context.Context) *BeaconsAttachmentsBatchDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *BeaconsAttachmentsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["namespacedType"]; ok { + params.Set("namespacedType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+beaconName}/attachments:batchDelete") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "beaconName": c.beaconName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "proximitybeacon.beacons.attachments.batchDelete" call. +// Exactly one of *DeleteAttachmentsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *DeleteAttachmentsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BeaconsAttachmentsBatchDeleteCall) Do() (*DeleteAttachmentsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DeleteAttachmentsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes multiple attachments on a given beacon. This operation is permanent and cannot be undone. You can optionally specify `namespacedType` to choose which attachments should be deleted. If you do not specify `namespacedType`, all your attachments on the given beacon will be deleted. You also may explicitly specify `*/*` to delete all.", + // "httpMethod": "POST", + // "id": "proximitybeacon.beacons.attachments.batchDelete", + // "parameterOrder": [ + // "beaconName" + // ], + // "parameters": { + // "beaconName": { + // "description": "The beacon whose attachments are to be deleted. Required.", + // "location": "path", + // "pattern": "^beacons/[^/]*$", + // "required": true, + // "type": "string" + // }, + // "namespacedType": { + // "description": "Specifies the namespace and type of attachments to delete in `namespace/type` format. Accepts `*/*` to specify \"all types in all namespaces\". Optional.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1beta1/{+beaconName}/attachments:batchDelete", + // "response": { + // "$ref": "DeleteAttachmentsResponse" + // } + // } + +} + +// method id "proximitybeacon.beacons.attachments.create": + +type BeaconsAttachmentsCreateCall struct { + s *Service + beaconName string + beaconattachment *BeaconAttachment + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Associates the given data with the specified beacon. +// Attachment data must contain two parts: +// - A namespaced type. +// - The actual attachment data itself. The namespaced type consists of +// two parts, the namespace and the type. The namespace must be one of +// the values returned by the `namespaces` endpoint, while the type can +// be a string of any characters except for the forward slash (`/`) up +// to 100 characters in length. Attachment data can be up to 1024 bytes +// long. +func (r *BeaconsAttachmentsService) Create(beaconName string, beaconattachment *BeaconAttachment) *BeaconsAttachmentsCreateCall { + c := &BeaconsAttachmentsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.beaconName = beaconName + c.beaconattachment = beaconattachment + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BeaconsAttachmentsCreateCall) Fields(s ...googleapi.Field) *BeaconsAttachmentsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BeaconsAttachmentsCreateCall) Context(ctx context.Context) *BeaconsAttachmentsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *BeaconsAttachmentsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.beaconattachment) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+beaconName}/attachments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "beaconName": c.beaconName, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "proximitybeacon.beacons.attachments.create" call. +// Exactly one of *BeaconAttachment or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BeaconAttachment.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BeaconsAttachmentsCreateCall) Do() (*BeaconAttachment, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BeaconAttachment{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Associates the given data with the specified beacon. Attachment data must contain two parts: \n- A namespaced type. \n- The actual attachment data itself. The namespaced type consists of two parts, the namespace and the type. The namespace must be one of the values returned by the `namespaces` endpoint, while the type can be a string of any characters except for the forward slash (`/`) up to 100 characters in length. Attachment data can be up to 1024 bytes long.", + // "httpMethod": "POST", + // "id": "proximitybeacon.beacons.attachments.create", + // "parameterOrder": [ + // "beaconName" + // ], + // "parameters": { + // "beaconName": { + // "description": "The beacon on which the attachment should be created. Required.", + // "location": "path", + // "pattern": "^beacons/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/{+beaconName}/attachments", + // "request": { + // "$ref": "BeaconAttachment" + // }, + // "response": { + // "$ref": "BeaconAttachment" + // } + // } + +} + +// method id "proximitybeacon.beacons.attachments.delete": + +type BeaconsAttachmentsDeleteCall struct { + s *Service + attachmentName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the specified attachment for the given beacon. Each +// attachment has a unique attachment name (`attachmentName`) which is +// returned when you fetch the attachment data via this API. You specify +// this with the delete request to control which attachment is removed. +// This operation cannot be undone. +func (r *BeaconsAttachmentsService) Delete(attachmentName string) *BeaconsAttachmentsDeleteCall { + c := &BeaconsAttachmentsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.attachmentName = attachmentName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BeaconsAttachmentsDeleteCall) Fields(s ...googleapi.Field) *BeaconsAttachmentsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BeaconsAttachmentsDeleteCall) Context(ctx context.Context) *BeaconsAttachmentsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *BeaconsAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+attachmentName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "attachmentName": c.attachmentName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "proximitybeacon.beacons.attachments.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BeaconsAttachmentsDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified attachment for the given beacon. Each attachment has a unique attachment name (`attachmentName`) which is returned when you fetch the attachment data via this API. You specify this with the delete request to control which attachment is removed. This operation cannot be undone.", + // "httpMethod": "DELETE", + // "id": "proximitybeacon.beacons.attachments.delete", + // "parameterOrder": [ + // "attachmentName" + // ], + // "parameters": { + // "attachmentName": { + // "description": "The attachment name (`attachmentName`) of the attachment to remove. For example: `beacons/3!893737abc9/attachments/c5e937-af0-494-959-ec49d12738` Required.", + // "location": "path", + // "pattern": "^beacons/[^/]*/attachments/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1/{+attachmentName}", + // "response": { + // "$ref": "Empty" + // } + // } + +} + +// method id "proximitybeacon.beacons.attachments.list": + +type BeaconsAttachmentsListCall struct { + s *Service + beaconName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Returns the attachments for the specified beacon that match the +// specified namespaced-type pattern. To control which namespaced types +// are returned, you add the `namespacedType` query parameter to the +// request. You must either use `*/*`, to return all attachments, or the +// namespace must be one of the ones returned from the `namespaces` +// endpoint. +func (r *BeaconsAttachmentsService) List(beaconName string) *BeaconsAttachmentsListCall { + c := &BeaconsAttachmentsListCall{s: r.s, opt_: make(map[string]interface{})} + c.beaconName = beaconName + return c +} + +// NamespacedType sets the optional parameter "namespacedType": +// Specifies the namespace and type of attachment to include in response +// in namespace/type format. Accepts `*/*` to specify "all types in all +// namespaces". +func (c *BeaconsAttachmentsListCall) NamespacedType(namespacedType string) *BeaconsAttachmentsListCall { + c.opt_["namespacedType"] = namespacedType + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BeaconsAttachmentsListCall) Fields(s ...googleapi.Field) *BeaconsAttachmentsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BeaconsAttachmentsListCall) IfNoneMatch(entityTag string) *BeaconsAttachmentsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BeaconsAttachmentsListCall) Context(ctx context.Context) *BeaconsAttachmentsListCall { + c.ctx_ = ctx + return c +} + +func (c *BeaconsAttachmentsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["namespacedType"]; ok { + params.Set("namespacedType", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+beaconName}/attachments") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "beaconName": c.beaconName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "proximitybeacon.beacons.attachments.list" call. +// Exactly one of *ListBeaconAttachmentsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListBeaconAttachmentsResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BeaconsAttachmentsListCall) Do() (*ListBeaconAttachmentsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListBeaconAttachmentsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the attachments for the specified beacon that match the specified namespaced-type pattern. To control which namespaced types are returned, you add the `namespacedType` query parameter to the request. You must either use `*/*`, to return all attachments, or the namespace must be one of the ones returned from the `namespaces` endpoint.", + // "httpMethod": "GET", + // "id": "proximitybeacon.beacons.attachments.list", + // "parameterOrder": [ + // "beaconName" + // ], + // "parameters": { + // "beaconName": { + // "description": "The beacon whose attachments are to be fetched. Required.", + // "location": "path", + // "pattern": "^beacons/[^/]*$", + // "required": true, + // "type": "string" + // }, + // "namespacedType": { + // "description": "Specifies the namespace and type of attachment to include in response in namespace/type format. Accepts `*/*` to specify \"all types in all namespaces\".", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1beta1/{+beaconName}/attachments", + // "response": { + // "$ref": "ListBeaconAttachmentsResponse" + // } + // } + +} + +// method id "proximitybeacon.beacons.diagnostics.list": + +type BeaconsDiagnosticsListCall struct { + s *Service + beaconName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List the diagnostics for a single beacon. You can also list +// diagnostics for all the beacons owned by your Google Developers +// Console project by using the beacon name `beacons/-`. +func (r *BeaconsDiagnosticsService) List(beaconName string) *BeaconsDiagnosticsListCall { + c := &BeaconsDiagnosticsListCall{s: r.s, opt_: make(map[string]interface{})} + c.beaconName = beaconName + return c +} + +// AlertFilter sets the optional parameter "alertFilter": Requests only +// beacons that have the given alert. For example, to find beacons that +// have low batteries use `alert_filter=LOW_BATTERY`. +// +// Possible values: +// "ALERT_UNSPECIFIED" +// "WRONG_LOCATION" +// "LOW_BATTERY" +func (c *BeaconsDiagnosticsListCall) AlertFilter(alertFilter string) *BeaconsDiagnosticsListCall { + c.opt_["alertFilter"] = alertFilter + return c +} + +// PageSize sets the optional parameter "pageSize": Specifies the +// maximum number of results to return. Defaults to 10. Maximum 1000. +func (c *BeaconsDiagnosticsListCall) PageSize(pageSize int64) *BeaconsDiagnosticsListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": Requests results +// that occur after the `page_token`, obtained from the response to a +// previous request. +func (c *BeaconsDiagnosticsListCall) PageToken(pageToken string) *BeaconsDiagnosticsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BeaconsDiagnosticsListCall) Fields(s ...googleapi.Field) *BeaconsDiagnosticsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BeaconsDiagnosticsListCall) IfNoneMatch(entityTag string) *BeaconsDiagnosticsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BeaconsDiagnosticsListCall) Context(ctx context.Context) *BeaconsDiagnosticsListCall { + c.ctx_ = ctx + return c +} + +func (c *BeaconsDiagnosticsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["alertFilter"]; ok { + params.Set("alertFilter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+beaconName}/diagnostics") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "beaconName": c.beaconName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "proximitybeacon.beacons.diagnostics.list" call. +// Exactly one of *ListDiagnosticsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListDiagnosticsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BeaconsDiagnosticsListCall) Do() (*ListDiagnosticsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListDiagnosticsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the diagnostics for a single beacon. You can also list diagnostics for all the beacons owned by your Google Developers Console project by using the beacon name `beacons/-`.", + // "httpMethod": "GET", + // "id": "proximitybeacon.beacons.diagnostics.list", + // "parameterOrder": [ + // "beaconName" + // ], + // "parameters": { + // "alertFilter": { + // "description": "Requests only beacons that have the given alert. For example, to find beacons that have low batteries use `alert_filter=LOW_BATTERY`.", + // "enum": [ + // "ALERT_UNSPECIFIED", + // "WRONG_LOCATION", + // "LOW_BATTERY" + // ], + // "location": "query", + // "type": "string" + // }, + // "beaconName": { + // "description": "Beacon that the diagnostics are for.", + // "location": "path", + // "pattern": "^beacons/[^/]*$", + // "required": true, + // "type": "string" + // }, + // "pageSize": { + // "description": "Specifies the maximum number of results to return. Defaults to 10. Maximum 1000. Optional.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Requests results that occur after the `page_token`, obtained from the response to a previous request. Optional.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1beta1/{+beaconName}/diagnostics", + // "response": { + // "$ref": "ListDiagnosticsResponse" + // } + // } + +} + +// method id "proximitybeacon.namespaces.list": + +type NamespacesListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all attachment namespaces owned by your Google Developers +// Console project. Attachment data associated with a beacon must +// include a namespaced type, and the namespace must be owned by your +// project. +func (r *NamespacesService) List() *NamespacesListCall { + c := &NamespacesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *NamespacesListCall) Fields(s ...googleapi.Field) *NamespacesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *NamespacesListCall) IfNoneMatch(entityTag string) *NamespacesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *NamespacesListCall) Context(ctx context.Context) *NamespacesListCall { + c.ctx_ = ctx + return c +} + +func (c *NamespacesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/namespaces") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "proximitybeacon.namespaces.list" call. +// Exactly one of *ListNamespacesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListNamespacesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *NamespacesListCall) Do() (*ListNamespacesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListNamespacesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all attachment namespaces owned by your Google Developers Console project. Attachment data associated with a beacon must include a namespaced type, and the namespace must be owned by your project.", + // "httpMethod": "GET", + // "id": "proximitybeacon.namespaces.list", + // "path": "v1beta1/namespaces", + // "response": { + // "$ref": "ListNamespacesResponse" + // } + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/pubsub/v1/pubsub-api.json b/Godeps/_workspace/src/google.golang.org/api/pubsub/v1/pubsub-api.json new file mode 100644 index 000000000..9ad14a775 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/pubsub/v1/pubsub-api.json @@ -0,0 +1,1036 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/5PwJv4HxhbjrzfsQfToP7wx4-Xk\"", + "discoveryVersion": "v1", + "id": "pubsub:v1", + "name": "pubsub", + "version": "v1", + "revision": "20150526", + "title": "Google Cloud Pub/Sub API", + "description": "Provides reliable, many-to-many, asynchronous messaging between applications.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/pubsub/docs", + "protocol": "rest", + "baseUrl": "https://pubsub.googleapis.com/", + "basePath": "/", + "rootUrl": "https://pubsub.googleapis.com/", + "servicePath": "", + "batchPath": "batch", + "parameters": { + "access_token": { + "type": "string", + "description": "OAuth access token.", + "location": "query" + }, + "alt": { + "type": "string", + "description": "Data format for response.", + "default": "json", + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query" + }, + "bearer_token": { + "type": "string", + "description": "OAuth bearer token.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JSONP", + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "pp": { + "type": "boolean", + "description": "Pretty-print response.", + "default": "true", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query" + }, + "upload_protocol": { + "type": "string", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query" + }, + "uploadType": { + "type": "string", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query" + }, + "$.xgafv": { + "type": "string", + "description": "V1 error format.", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/pubsub": { + "description": "View and manage Pub/Sub topics and subscriptions" + } + } + } + }, + "schemas": { + "SetIamPolicyRequest": { + "id": "SetIamPolicyRequest", + "type": "object", + "description": "Request message for `SetIamPolicy` method.", + "properties": { + "policy": { + "$ref": "Policy", + "description": "REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them." + } + } + }, + "Policy": { + "id": "Policy", + "type": "object", + "description": "Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources. A `Policy` consists of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, where the members can be user accounts, Google groups, Google domains, and service accounts. A `role` is a named list of permissions defined by IAM. **Example** { \"bindings\": [ { \"role\": \"roles/owner\", \"members\": [ \"user:mike@example.com\", \"group:admins@example.com\", \"domain:google.com\", \"serviceAccount:my-other-app@appspot.gserviceaccount.com\"] }, { \"role\": \"roles/viewer\", \"members\": [\"user:sean@example.com\"] } ] } For a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam).", + "properties": { + "version": { + "type": "integer", + "description": "Version of the `Policy`. The default version is 0.", + "format": "int32" + }, + "bindings": { + "type": "array", + "description": "Associates a list of `members` to a `role`. Multiple `bindings` must not be specified for the same `role`. `bindings` with no members will result in an error.", + "items": { + "$ref": "Binding" + } + }, + "etag": { + "type": "string", + "description": "Can be used to perform a read-modify-write.", + "format": "byte" + } + } + }, + "Binding": { + "id": "Binding", + "type": "object", + "description": "Associates `members` with a `role`.", + "properties": { + "role": { + "type": "string", + "description": "Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. Required" + }, + "members": { + "type": "array", + "description": "Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following formats: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` or `joe@example.com`. * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`.", + "items": { + "type": "string" + } + } + } + }, + "TestIamPermissionsRequest": { + "id": "TestIamPermissionsRequest", + "type": "object", + "description": "Request message for `TestIamPermissions` method.", + "properties": { + "permissions": { + "type": "array", + "description": "The set of permissions to check for the `resource`. Permissions with wildcards (such as '*' or 'storage.*') are not allowed.", + "items": { + "type": "string" + } + } + } + }, + "TestIamPermissionsResponse": { + "id": "TestIamPermissionsResponse", + "type": "object", + "description": "Response message for `TestIamPermissions` method.", + "properties": { + "permissions": { + "type": "array", + "description": "A subset of `TestPermissionsRequest.permissions` that the caller is allowed.", + "items": { + "type": "string" + } + } + } + }, + "Topic": { + "id": "Topic", + "type": "object", + "description": "A topic resource.", + "properties": { + "name": { + "type": "string", + "description": "The name of the topic. It must have the format `\"projects/{project}/topics/{topic}\"`. `{topic}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `\"goog\"`." + } + } + }, + "PublishRequest": { + "id": "PublishRequest", + "type": "object", + "description": "Request for the Publish method.", + "properties": { + "messages": { + "type": "array", + "description": "The messages to publish.", + "items": { + "$ref": "PubsubMessage" + } + } + } + }, + "PubsubMessage": { + "id": "PubsubMessage", + "type": "object", + "description": "A message data and its attributes. The message payload must not be empty; it must contain either a non-empty data field, or at least one attribute.", + "properties": { + "data": { + "type": "string", + "description": "The message payload. For JSON requests, the value of this field must be base64-encoded.", + "format": "byte" + }, + "attributes": { + "type": "object", + "description": "Optional attributes for this message.", + "additionalProperties": { + "type": "string" + } + }, + "messageId": { + "type": "string", + "description": "ID of this message assigned by the server at publication time. Guaranteed to be unique within the topic. This value may be read by a subscriber that receives a `PubsubMessage` via a `Pull` call or a push delivery. It must not be populated by a publisher in a `Publish` call." + } + } + }, + "PublishResponse": { + "id": "PublishResponse", + "type": "object", + "description": "Response for the `Publish` method.", + "properties": { + "messageIds": { + "type": "array", + "description": "The server-assigned ID of each published message, in the same order as the messages in the request. IDs are guaranteed to be unique within the topic.", + "items": { + "type": "string" + } + } + } + }, + "ListTopicsResponse": { + "id": "ListTopicsResponse", + "type": "object", + "description": "Response for the `ListTopics` method.", + "properties": { + "topics": { + "type": "array", + "description": "The resulting topics.", + "items": { + "$ref": "Topic" + } + }, + "nextPageToken": { + "type": "string", + "description": "If not empty, indicates that there may be more topics that match the request; this value should be passed in a new `ListTopicsRequest`." + } + } + }, + "ListTopicSubscriptionsResponse": { + "id": "ListTopicSubscriptionsResponse", + "type": "object", + "description": "Response for the `ListTopicSubscriptions` method.", + "properties": { + "subscriptions": { + "type": "array", + "description": "The names of the subscriptions that match the request.", + "items": { + "type": "string" + } + }, + "nextPageToken": { + "type": "string", + "description": "If not empty, indicates that there may be more subscriptions that match the request; this value should be passed in a new `ListTopicSubscriptionsRequest` to get more subscriptions." + } + } + }, + "Empty": { + "id": "Empty", + "type": "object", + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`." + }, + "Subscription": { + "id": "Subscription", + "type": "object", + "description": "A subscription resource.", + "properties": { + "name": { + "type": "string", + "description": "The name of the subscription. It must have the format `\"projects/{project}/subscriptions/{subscription}\"`. `{subscription}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `\"goog\"`." + }, + "topic": { + "type": "string", + "description": "The name of the topic from which this subscription is receiving messages. The value of this field will be `_deleted-topic_` if the topic has been deleted." + }, + "pushConfig": { + "$ref": "PushConfig", + "description": "If push delivery is used with this subscription, this field is used to configure it. An empty `pushConfig` signifies that the subscriber will pull and ack messages using API methods." + }, + "ackDeadlineSeconds": { + "type": "integer", + "description": "This value is the maximum time after a subscriber receives a message before the subscriber should acknowledge the message. After message delivery but before the ack deadline expires and before the message is acknowledged, it is an outstanding message and will not be delivered again during that time (on a best-effort basis). For pull delivery this value is used as the initial value for the ack deadline. To override this value for a given message, call `ModifyAckDeadline` with the corresponding `ack_id`. For push delivery, this value is also used to set the request timeout for the call to the push endpoint. If the subscriber never acknowledges the message, the Pub/Sub system will eventually redeliver the message. If this parameter is not set, the default value of 10 seconds is used.", + "format": "int32" + } + } + }, + "PushConfig": { + "id": "PushConfig", + "type": "object", + "description": "Configuration for a push delivery endpoint.", + "properties": { + "pushEndpoint": { + "type": "string", + "description": "A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use \"https://example.com/push\"." + }, + "attributes": { + "type": "object", + "description": "Endpoint configuration attributes. Every endpoint has a set of API supported attributes that can be used to control different aspects of the message delivery. The currently supported attribute is `x-goog-version`, which you can use to change the format of the push message. This attribute indicates the version of the data expected by the endpoint. This controls the shape of the envelope (i.e. its fields and metadata). The endpoint version is based on the version of the Pub/Sub API. If not present during the `CreateSubscription` call, it will default to the version of the API used to make such call. If not present during a `ModifyPushConfig` call, its value will not be changed. `GetSubscription` calls will always return a valid version, even if the subscription was created without this attribute. The possible values for this attribute are: * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.", + "additionalProperties": { + "type": "string" + } + } + } + }, + "ListSubscriptionsResponse": { + "id": "ListSubscriptionsResponse", + "type": "object", + "description": "Response for the `ListSubscriptions` method.", + "properties": { + "subscriptions": { + "type": "array", + "description": "The subscriptions that match the request.", + "items": { + "$ref": "Subscription" + } + }, + "nextPageToken": { + "type": "string", + "description": "If not empty, indicates that there may be more subscriptions that match the request; this value should be passed in a new `ListSubscriptionsRequest` to get more subscriptions." + } + } + }, + "ModifyAckDeadlineRequest": { + "id": "ModifyAckDeadlineRequest", + "type": "object", + "description": "Request for the ModifyAckDeadline method.", + "properties": { + "ackIds": { + "type": "array", + "description": "List of acknowledgment IDs.", + "items": { + "type": "string" + } + }, + "ackDeadlineSeconds": { + "type": "integer", + "description": "The new ack deadline with respect to the time this request was sent to the Pub/Sub system. Must be \u003e= 0. For example, if the value is 10, the new ack deadline will expire 10 seconds after the `ModifyAckDeadline` call was made. Specifying zero may immediately make the message available for another pull request.", + "format": "int32" + } + } + }, + "AcknowledgeRequest": { + "id": "AcknowledgeRequest", + "type": "object", + "description": "Request for the Acknowledge method.", + "properties": { + "ackIds": { + "type": "array", + "description": "The acknowledgment ID for the messages being acknowledged that was returned by the Pub/Sub system in the `Pull` response. Must not be empty.", + "items": { + "type": "string" + } + } + } + }, + "PullRequest": { + "id": "PullRequest", + "type": "object", + "description": "Request for the `Pull` method.", + "properties": { + "returnImmediately": { + "type": "boolean", + "description": "If this is specified as true the system will respond immediately even if it is not able to return a message in the `Pull` response. Otherwise the system is allowed to wait until at least one message is available rather than returning no messages. The client may cancel the request if it does not wish to wait any longer for the response." + }, + "maxMessages": { + "type": "integer", + "description": "The maximum number of messages returned for this request. The Pub/Sub system may return fewer than the number specified.", + "format": "int32" + } + } + }, + "PullResponse": { + "id": "PullResponse", + "type": "object", + "description": "Response for the `Pull` method.", + "properties": { + "receivedMessages": { + "type": "array", + "description": "Received Pub/Sub messages. The Pub/Sub system will return zero messages if there are no more available in the backlog. The Pub/Sub system may return fewer than the `maxMessages` requested even if there are more messages available in the backlog.", + "items": { + "$ref": "ReceivedMessage" + } + } + } + }, + "ReceivedMessage": { + "id": "ReceivedMessage", + "type": "object", + "description": "A message and its corresponding acknowledgment ID.", + "properties": { + "ackId": { + "type": "string", + "description": "This ID can be used to acknowledge the received message." + }, + "message": { + "$ref": "PubsubMessage", + "description": "The message." + } + } + }, + "ModifyPushConfigRequest": { + "id": "ModifyPushConfigRequest", + "type": "object", + "description": "Request for the ModifyPushConfig method.", + "properties": { + "pushConfig": { + "$ref": "PushConfig", + "description": "The push configuration for future deliveries. An empty `pushConfig` indicates that the Pub/Sub system should stop pushing messages from the given subscription and allow messages to be pulled and acknowledged - effectively pausing the subscription if `Pull` is not called." + } + } + } + }, + "resources": { + "projects": { + "resources": { + "topics": { + "methods": { + "setIamPolicy": { + "id": "pubsub.projects.topics.setIamPolicy", + "path": "v1/{+resource}:setIamPolicy", + "httpMethod": "POST", + "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", + "parameters": { + "resource": { + "type": "string", + "description": "REQUIRED: The resource for which policy is being specified. `resource` is usually specified as a path, such as, `projects/{project}/zones/{zone}/disks/{disk}`.", + "required": true, + "pattern": "^projects/[^/]*/topics/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "resource" + ], + "request": { + "$ref": "SetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "getIamPolicy": { + "id": "pubsub.projects.topics.getIamPolicy", + "path": "v1/{+resource}:getIamPolicy", + "httpMethod": "GET", + "description": "Gets the access control policy for a `resource`. Is empty if the policy or the resource does not exist.", + "parameters": { + "resource": { + "type": "string", + "description": "REQUIRED: The resource for which policy is being requested. Resource is usually specified as a path, such as, `projects/{project}`.", + "required": true, + "pattern": "^projects/[^/]*/topics/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "testIamPermissions": { + "id": "pubsub.projects.topics.testIamPermissions", + "path": "v1/{+resource}:testIamPermissions", + "httpMethod": "POST", + "description": "Returns permissions that a caller has on the specified resource.", + "parameters": { + "resource": { + "type": "string", + "description": "REQUIRED: The resource for which policy detail is being requested. `resource` is usually specified as a path, such as, `projects/{project}`.", + "required": true, + "pattern": "^projects/[^/]*/topics/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "resource" + ], + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "create": { + "id": "pubsub.projects.topics.create", + "path": "v1/{+name}", + "httpMethod": "PUT", + "description": "Creates the given topic with the given name.", + "parameters": { + "name": { + "type": "string", + "description": "The name of the topic. It must have the format `\"projects/{project}/topics/{topic}\"`. `{topic}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `\"goog\"`.", + "required": true, + "pattern": "^projects/[^/]*/topics/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "name" + ], + "request": { + "$ref": "Topic" + }, + "response": { + "$ref": "Topic" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "publish": { + "id": "pubsub.projects.topics.publish", + "path": "v1/{+topic}:publish", + "httpMethod": "POST", + "description": "Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic does not exist. The message payload must not be empty; it must contain either a non-empty data field, or at least one attribute.", + "parameters": { + "topic": { + "type": "string", + "description": "The messages in the request will be published on this topic.", + "required": true, + "pattern": "^projects/[^/]*/topics/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "topic" + ], + "request": { + "$ref": "PublishRequest" + }, + "response": { + "$ref": "PublishResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "get": { + "id": "pubsub.projects.topics.get", + "path": "v1/{+topic}", + "httpMethod": "GET", + "description": "Gets the configuration of a topic.", + "parameters": { + "topic": { + "type": "string", + "description": "The name of the topic to get.", + "required": true, + "pattern": "^projects/[^/]*/topics/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "topic" + ], + "response": { + "$ref": "Topic" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "list": { + "id": "pubsub.projects.topics.list", + "path": "v1/{+project}/topics", + "httpMethod": "GET", + "description": "Lists matching topics.", + "parameters": { + "project": { + "type": "string", + "description": "The name of the cloud project that topics belong to.", + "required": true, + "pattern": "^projects/[^/]*$", + "location": "path" + }, + "pageSize": { + "type": "integer", + "description": "Maximum number of topics to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value returned by the last `ListTopicsResponse`; indicates that this is a continuation of a prior `ListTopics` call, and that the system should return the next page of data.", + "location": "query" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "ListTopicsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "delete": { + "id": "pubsub.projects.topics.delete", + "path": "v1/{+topic}", + "httpMethod": "DELETE", + "description": "Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a topic is deleted, a new topic may be created with the same name; this is an entirely new topic with none of the old configuration or subscriptions. Existing subscriptions to this topic are not deleted, but their `topic` field is set to `_deleted-topic_`.", + "parameters": { + "topic": { + "type": "string", + "description": "Name of the topic to delete.", + "required": true, + "pattern": "^projects/[^/]*/topics/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "topic" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + } + }, + "resources": { + "subscriptions": { + "methods": { + "list": { + "id": "pubsub.projects.topics.subscriptions.list", + "path": "v1/{+topic}/subscriptions", + "httpMethod": "GET", + "description": "Lists the name of the subscriptions for this topic.", + "parameters": { + "topic": { + "type": "string", + "description": "The name of the topic that subscriptions are attached to.", + "required": true, + "pattern": "^projects/[^/]*/topics/[^/]*$", + "location": "path" + }, + "pageSize": { + "type": "integer", + "description": "Maximum number of subscription names to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value returned by the last `ListTopicSubscriptionsResponse`; indicates that this is a continuation of a prior `ListTopicSubscriptions` call, and that the system should return the next page of data.", + "location": "query" + } + }, + "parameterOrder": [ + "topic" + ], + "response": { + "$ref": "ListTopicSubscriptionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + } + } + } + } + }, + "subscriptions": { + "methods": { + "setIamPolicy": { + "id": "pubsub.projects.subscriptions.setIamPolicy", + "path": "v1/{+resource}:setIamPolicy", + "httpMethod": "POST", + "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", + "parameters": { + "resource": { + "type": "string", + "description": "REQUIRED: The resource for which policy is being specified. `resource` is usually specified as a path, such as, `projects/{project}/zones/{zone}/disks/{disk}`.", + "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "resource" + ], + "request": { + "$ref": "SetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "getIamPolicy": { + "id": "pubsub.projects.subscriptions.getIamPolicy", + "path": "v1/{+resource}:getIamPolicy", + "httpMethod": "GET", + "description": "Gets the access control policy for a `resource`. Is empty if the policy or the resource does not exist.", + "parameters": { + "resource": { + "type": "string", + "description": "REQUIRED: The resource for which policy is being requested. Resource is usually specified as a path, such as, `projects/{project}`.", + "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "testIamPermissions": { + "id": "pubsub.projects.subscriptions.testIamPermissions", + "path": "v1/{+resource}:testIamPermissions", + "httpMethod": "POST", + "description": "Returns permissions that a caller has on the specified resource.", + "parameters": { + "resource": { + "type": "string", + "description": "REQUIRED: The resource for which policy detail is being requested. `resource` is usually specified as a path, such as, `projects/{project}`.", + "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "resource" + ], + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "create": { + "id": "pubsub.projects.subscriptions.create", + "path": "v1/{+name}", + "httpMethod": "PUT", + "description": "Creates a subscription to a given topic for a given subscriber. If the subscription already exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns `NOT_FOUND`. If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic.", + "parameters": { + "name": { + "type": "string", + "description": "The name of the subscription. It must have the format `\"projects/{project}/subscriptions/{subscription}\"`. `{subscription}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `\"goog\"`.", + "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "name" + ], + "request": { + "$ref": "Subscription" + }, + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "get": { + "id": "pubsub.projects.subscriptions.get", + "path": "v1/{+subscription}", + "httpMethod": "GET", + "description": "Gets the configuration details of a subscription.", + "parameters": { + "subscription": { + "type": "string", + "description": "The name of the subscription to get.", + "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "subscription" + ], + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "list": { + "id": "pubsub.projects.subscriptions.list", + "path": "v1/{+project}/subscriptions", + "httpMethod": "GET", + "description": "Lists matching subscriptions.", + "parameters": { + "project": { + "type": "string", + "description": "The name of the cloud project that subscriptions belong to.", + "required": true, + "pattern": "^projects/[^/]*$", + "location": "path" + }, + "pageSize": { + "type": "integer", + "description": "Maximum number of subscriptions to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value returned by the last `ListSubscriptionsResponse`; indicates that this is a continuation of a prior `ListSubscriptions` call, and that the system should return the next page of data.", + "location": "query" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "ListSubscriptionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "delete": { + "id": "pubsub.projects.subscriptions.delete", + "path": "v1/{+subscription}", + "httpMethod": "DELETE", + "description": "Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to `Pull` after deletion will return `NOT_FOUND`. After a subscription is deleted, a new one may be created with the same name, but the new one has no association with the old subscription, or its topic unless the same topic is specified.", + "parameters": { + "subscription": { + "type": "string", + "description": "The subscription to delete.", + "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "subscription" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "modifyAckDeadline": { + "id": "pubsub.projects.subscriptions.modifyAckDeadline", + "path": "v1/{+subscription}:modifyAckDeadline", + "httpMethod": "POST", + "description": "Modifies the ack deadline for a specific message. This method is useful to indicate that more time is needed to process a message by the subscriber, or to make the message available for redelivery if the processing was interrupted.", + "parameters": { + "subscription": { + "type": "string", + "description": "The name of the subscription.", + "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "subscription" + ], + "request": { + "$ref": "ModifyAckDeadlineRequest" + }, + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "acknowledge": { + "id": "pubsub.projects.subscriptions.acknowledge", + "path": "v1/{+subscription}:acknowledge", + "httpMethod": "POST", + "description": "Acknowledges the messages associated with the `ack_ids` in the `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages from the subscription. Acknowledging a message whose ack deadline has expired may succeed, but such a message may be redelivered later. Acknowledging a message more than once will not result in an error.", + "parameters": { + "subscription": { + "type": "string", + "description": "The subscription whose message is being acknowledged.", + "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "subscription" + ], + "request": { + "$ref": "AcknowledgeRequest" + }, + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "pull": { + "id": "pubsub.projects.subscriptions.pull", + "path": "v1/{+subscription}:pull", + "httpMethod": "POST", + "description": "Pulls messages from the server. Returns an empty list if there are no messages available in the backlog. The server may return `UNAVAILABLE` if there are too many concurrent pull requests pending for the given subscription.", + "parameters": { + "subscription": { + "type": "string", + "description": "The subscription from which messages should be pulled.", + "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "subscription" + ], + "request": { + "$ref": "PullRequest" + }, + "response": { + "$ref": "PullResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "modifyPushConfig": { + "id": "pubsub.projects.subscriptions.modifyPushConfig", + "path": "v1/{+subscription}:modifyPushConfig", + "httpMethod": "POST", + "description": "Modifies the `PushConfig` for a specified subscription. This may be used to change a push subscription to a pull one (signified by an empty `PushConfig`) or vice versa, or change the endpoint URL and other attributes of a push subscription. Messages will accumulate for delivery continuously through the call regardless of changes to the `PushConfig`.", + "parameters": { + "subscription": { + "type": "string", + "description": "The name of the subscription.", + "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "subscription" + ], + "request": { + "$ref": "ModifyPushConfigRequest" + }, + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + } + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/pubsub/v1/pubsub-gen.go b/Godeps/_workspace/src/google.golang.org/api/pubsub/v1/pubsub-gen.go new file mode 100644 index 000000000..a452d8bef --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/pubsub/v1/pubsub-gen.go @@ -0,0 +1,3382 @@ +// Package pubsub provides access to the Google Cloud Pub/Sub API. +// +// See https://cloud.google.com/pubsub/docs +// +// Usage example: +// +// import "google.golang.org/api/pubsub/v1" +// ... +// pubsubService, err := pubsub.New(oauthHttpClient) +package pubsub // import "google.golang.org/api/pubsub/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "pubsub:v1" +const apiName = "pubsub" +const apiVersion = "v1" +const basePath = "https://pubsub.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your data across Google Cloud Platform services + CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" + + // View and manage Pub/Sub topics and subscriptions + PubsubScope = "https://www.googleapis.com/auth/pubsub" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Projects *ProjectsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewProjectsService(s *Service) *ProjectsService { + rs := &ProjectsService{s: s} + rs.Subscriptions = NewProjectsSubscriptionsService(s) + rs.Topics = NewProjectsTopicsService(s) + return rs +} + +type ProjectsService struct { + s *Service + + Subscriptions *ProjectsSubscriptionsService + + Topics *ProjectsTopicsService +} + +func NewProjectsSubscriptionsService(s *Service) *ProjectsSubscriptionsService { + rs := &ProjectsSubscriptionsService{s: s} + return rs +} + +type ProjectsSubscriptionsService struct { + s *Service +} + +func NewProjectsTopicsService(s *Service) *ProjectsTopicsService { + rs := &ProjectsTopicsService{s: s} + rs.Subscriptions = NewProjectsTopicsSubscriptionsService(s) + return rs +} + +type ProjectsTopicsService struct { + s *Service + + Subscriptions *ProjectsTopicsSubscriptionsService +} + +func NewProjectsTopicsSubscriptionsService(s *Service) *ProjectsTopicsSubscriptionsService { + rs := &ProjectsTopicsSubscriptionsService{s: s} + return rs +} + +type ProjectsTopicsSubscriptionsService struct { + s *Service +} + +// AcknowledgeRequest: Request for the Acknowledge method. +type AcknowledgeRequest struct { + // AckIds: The acknowledgment ID for the messages being acknowledged + // that was returned by the Pub/Sub system in the `Pull` response. Must + // not be empty. + AckIds []string `json:"ackIds,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AckIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AcknowledgeRequest) MarshalJSON() ([]byte, error) { + type noMethod AcknowledgeRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Binding: Associates `members` with a `role`. +type Binding struct { + // Members: Specifies the identities requesting access for a Cloud + // Platform resource. `members` can have the following formats: * + // `allUsers`: A special identifier that represents anyone who is on the + // internet; with or without a Google account. * + // `allAuthenticatedUsers`: A special identifier that represents anyone + // who is authenticated with a Google account or a service account. * + // `user:{emailid}`: An email address that represents a specific Google + // account. For example, `alice@gmail.com` or `joe@example.com`. * + // `serviceAccount:{emailid}`: An email address that represents a + // service account. For example, + // `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An + // email address that represents a Google group. For example, + // `admins@example.com`. * `domain:{domain}`: A Google Apps domain name + // that represents all the users of that domain. For example, + // `google.com` or `example.com`. + Members []string `json:"members,omitempty"` + + // Role: Role that is assigned to `members`. For example, + // `roles/viewer`, `roles/editor`, or `roles/owner`. Required + Role string `json:"role,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Members") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Binding) MarshalJSON() ([]byte, error) { + type noMethod Binding + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Empty: A generic empty message that you can re-use to avoid defining +// duplicated empty messages in your APIs. A typical example is to use +// it as the request or the response type of an API method. For +// instance: service Foo { rpc Bar(google.protobuf.Empty) returns +// (google.protobuf.Empty); } The JSON representation for `Empty` is +// empty JSON object `{}`. +type Empty struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// ListSubscriptionsResponse: Response for the `ListSubscriptions` +// method. +type ListSubscriptionsResponse struct { + // NextPageToken: If not empty, indicates that there may be more + // subscriptions that match the request; this value should be passed in + // a new `ListSubscriptionsRequest` to get more subscriptions. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Subscriptions: The subscriptions that match the request. + Subscriptions []*Subscription `json:"subscriptions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListSubscriptionsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListSubscriptionsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListTopicSubscriptionsResponse: Response for the +// `ListTopicSubscriptions` method. +type ListTopicSubscriptionsResponse struct { + // NextPageToken: If not empty, indicates that there may be more + // subscriptions that match the request; this value should be passed in + // a new `ListTopicSubscriptionsRequest` to get more subscriptions. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Subscriptions: The names of the subscriptions that match the request. + Subscriptions []string `json:"subscriptions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListTopicSubscriptionsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListTopicSubscriptionsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListTopicsResponse: Response for the `ListTopics` method. +type ListTopicsResponse struct { + // NextPageToken: If not empty, indicates that there may be more topics + // that match the request; this value should be passed in a new + // `ListTopicsRequest`. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Topics: The resulting topics. + Topics []*Topic `json:"topics,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListTopicsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListTopicsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ModifyAckDeadlineRequest: Request for the ModifyAckDeadline method. +type ModifyAckDeadlineRequest struct { + // AckDeadlineSeconds: The new ack deadline with respect to the time + // this request was sent to the Pub/Sub system. Must be >= 0. For + // example, if the value is 10, the new ack deadline will expire 10 + // seconds after the `ModifyAckDeadline` call was made. Specifying zero + // may immediately make the message available for another pull request. + AckDeadlineSeconds int64 `json:"ackDeadlineSeconds,omitempty"` + + // AckIds: List of acknowledgment IDs. + AckIds []string `json:"ackIds,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AckDeadlineSeconds") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ModifyAckDeadlineRequest) MarshalJSON() ([]byte, error) { + type noMethod ModifyAckDeadlineRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ModifyPushConfigRequest: Request for the ModifyPushConfig method. +type ModifyPushConfigRequest struct { + // PushConfig: The push configuration for future deliveries. An empty + // `pushConfig` indicates that the Pub/Sub system should stop pushing + // messages from the given subscription and allow messages to be pulled + // and acknowledged - effectively pausing the subscription if `Pull` is + // not called. + PushConfig *PushConfig `json:"pushConfig,omitempty"` + + // ForceSendFields is a list of field names (e.g. "PushConfig") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ModifyPushConfigRequest) MarshalJSON() ([]byte, error) { + type noMethod ModifyPushConfigRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Policy: Defines an Identity and Access Management (IAM) policy. It is +// used to specify access control policies for Cloud Platform resources. +// A `Policy` consists of a list of `bindings`. A `Binding` binds a list +// of `members` to a `role`, where the members can be user accounts, +// Google groups, Google domains, and service accounts. A `role` is a +// named list of permissions defined by IAM. **Example** { "bindings": [ +// { "role": "roles/owner", "members": [ "user:mike@example.com", +// "group:admins@example.com", "domain:google.com", +// "serviceAccount:my-other-app@appspot.gserviceaccount.com"] }, { +// "role": "roles/viewer", "members": ["user:sean@example.com"] } ] } +// For a description of IAM and its features, see the [IAM developer's +// guide](https://cloud.google.com/iam). +type Policy struct { + // Bindings: Associates a list of `members` to a `role`. Multiple + // `bindings` must not be specified for the same `role`. `bindings` with + // no members will result in an error. + Bindings []*Binding `json:"bindings,omitempty"` + + // Etag: Can be used to perform a read-modify-write. + Etag string `json:"etag,omitempty"` + + // Version: Version of the `Policy`. The default version is 0. + Version int64 `json:"version,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Bindings") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Policy) MarshalJSON() ([]byte, error) { + type noMethod Policy + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PublishRequest: Request for the Publish method. +type PublishRequest struct { + // Messages: The messages to publish. + Messages []*PubsubMessage `json:"messages,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Messages") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PublishRequest) MarshalJSON() ([]byte, error) { + type noMethod PublishRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PublishResponse: Response for the `Publish` method. +type PublishResponse struct { + // MessageIds: The server-assigned ID of each published message, in the + // same order as the messages in the request. IDs are guaranteed to be + // unique within the topic. + MessageIds []string `json:"messageIds,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "MessageIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PublishResponse) MarshalJSON() ([]byte, error) { + type noMethod PublishResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PubsubMessage: A message data and its attributes. The message payload +// must not be empty; it must contain either a non-empty data field, or +// at least one attribute. +type PubsubMessage struct { + // Attributes: Optional attributes for this message. + Attributes map[string]string `json:"attributes,omitempty"` + + // Data: The message payload. For JSON requests, the value of this field + // must be base64-encoded. + Data string `json:"data,omitempty"` + + // MessageId: ID of this message assigned by the server at publication + // time. Guaranteed to be unique within the topic. This value may be + // read by a subscriber that receives a `PubsubMessage` via a `Pull` + // call or a push delivery. It must not be populated by a publisher in a + // `Publish` call. + MessageId string `json:"messageId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Attributes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PubsubMessage) MarshalJSON() ([]byte, error) { + type noMethod PubsubMessage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PullRequest: Request for the `Pull` method. +type PullRequest struct { + // MaxMessages: The maximum number of messages returned for this + // request. The Pub/Sub system may return fewer than the number + // specified. + MaxMessages int64 `json:"maxMessages,omitempty"` + + // ReturnImmediately: If this is specified as true the system will + // respond immediately even if it is not able to return a message in the + // `Pull` response. Otherwise the system is allowed to wait until at + // least one message is available rather than returning no messages. The + // client may cancel the request if it does not wish to wait any longer + // for the response. + ReturnImmediately bool `json:"returnImmediately,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MaxMessages") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PullRequest) MarshalJSON() ([]byte, error) { + type noMethod PullRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PullResponse: Response for the `Pull` method. +type PullResponse struct { + // ReceivedMessages: Received Pub/Sub messages. The Pub/Sub system will + // return zero messages if there are no more available in the backlog. + // The Pub/Sub system may return fewer than the `maxMessages` requested + // even if there are more messages available in the backlog. + ReceivedMessages []*ReceivedMessage `json:"receivedMessages,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ReceivedMessages") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PullResponse) MarshalJSON() ([]byte, error) { + type noMethod PullResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PushConfig: Configuration for a push delivery endpoint. +type PushConfig struct { + // Attributes: Endpoint configuration attributes. Every endpoint has a + // set of API supported attributes that can be used to control different + // aspects of the message delivery. The currently supported attribute is + // `x-goog-version`, which you can use to change the format of the push + // message. This attribute indicates the version of the data expected by + // the endpoint. This controls the shape of the envelope (i.e. its + // fields and metadata). The endpoint version is based on the version of + // the Pub/Sub API. If not present during the `CreateSubscription` call, + // it will default to the version of the API used to make such call. If + // not present during a `ModifyPushConfig` call, its value will not be + // changed. `GetSubscription` calls will always return a valid version, + // even if the subscription was created without this attribute. The + // possible values for this attribute are: * `v1beta1`: uses the push + // format defined in the v1beta1 Pub/Sub API. * `v1` or `v1beta2`: uses + // the push format defined in the v1 Pub/Sub API. + Attributes map[string]string `json:"attributes,omitempty"` + + // PushEndpoint: A URL locating the endpoint to which messages should be + // pushed. For example, a Webhook endpoint might use + // "https://example.com/push". + PushEndpoint string `json:"pushEndpoint,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Attributes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PushConfig) MarshalJSON() ([]byte, error) { + type noMethod PushConfig + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReceivedMessage: A message and its corresponding acknowledgment ID. +type ReceivedMessage struct { + // AckId: This ID can be used to acknowledge the received message. + AckId string `json:"ackId,omitempty"` + + // Message: The message. + Message *PubsubMessage `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AckId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReceivedMessage) MarshalJSON() ([]byte, error) { + type noMethod ReceivedMessage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SetIamPolicyRequest: Request message for `SetIamPolicy` method. +type SetIamPolicyRequest struct { + // Policy: REQUIRED: The complete policy to be applied to the + // `resource`. The size of the policy is limited to a few 10s of KB. An + // empty policy is a valid policy but certain Cloud Platform services + // (such as Projects) might reject them. + Policy *Policy `json:"policy,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Policy") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { + type noMethod SetIamPolicyRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Subscription: A subscription resource. +type Subscription struct { + // AckDeadlineSeconds: This value is the maximum time after a subscriber + // receives a message before the subscriber should acknowledge the + // message. After message delivery but before the ack deadline expires + // and before the message is acknowledged, it is an outstanding message + // and will not be delivered again during that time (on a best-effort + // basis). For pull delivery this value is used as the initial value for + // the ack deadline. To override this value for a given message, call + // `ModifyAckDeadline` with the corresponding `ack_id`. For push + // delivery, this value is also used to set the request timeout for the + // call to the push endpoint. If the subscriber never acknowledges the + // message, the Pub/Sub system will eventually redeliver the message. If + // this parameter is not set, the default value of 10 seconds is used. + AckDeadlineSeconds int64 `json:"ackDeadlineSeconds,omitempty"` + + // Name: The name of the subscription. It must have the format + // "projects/{project}/subscriptions/{subscription}". `{subscription}` + // must start with a letter, and contain only letters (`[A-Za-z]`), + // numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), + // tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 + // and 255 characters in length, and it must not start with "goog". + Name string `json:"name,omitempty"` + + // PushConfig: If push delivery is used with this subscription, this + // field is used to configure it. An empty `pushConfig` signifies that + // the subscriber will pull and ack messages using API methods. + PushConfig *PushConfig `json:"pushConfig,omitempty"` + + // Topic: The name of the topic from which this subscription is + // receiving messages. The value of this field will be `_deleted-topic_` + // if the topic has been deleted. + Topic string `json:"topic,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AckDeadlineSeconds") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Subscription) MarshalJSON() ([]byte, error) { + type noMethod Subscription + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TestIamPermissionsRequest: Request message for `TestIamPermissions` +// method. +type TestIamPermissionsRequest struct { + // Permissions: The set of permissions to check for the `resource`. + // Permissions with wildcards (such as '*' or 'storage.*') are not + // allowed. + Permissions []string `json:"permissions,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Permissions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) { + type noMethod TestIamPermissionsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TestIamPermissionsResponse: Response message for `TestIamPermissions` +// method. +type TestIamPermissionsResponse struct { + // Permissions: A subset of `TestPermissionsRequest.permissions` that + // the caller is allowed. + Permissions []string `json:"permissions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Permissions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { + type noMethod TestIamPermissionsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Topic: A topic resource. +type Topic struct { + // Name: The name of the topic. It must have the format + // "projects/{project}/topics/{topic}". `{topic}` must start with a + // letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), + // dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus + // (`+`) or percent signs (`%`). It must be between 3 and 255 characters + // in length, and it must not start with "goog". + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Topic) MarshalJSON() ([]byte, error) { + type noMethod Topic + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "pubsub.projects.subscriptions.acknowledge": + +type ProjectsSubscriptionsAcknowledgeCall struct { + s *Service + subscription string + acknowledgerequest *AcknowledgeRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Acknowledge: Acknowledges the messages associated with the `ack_ids` +// in the `AcknowledgeRequest`. The Pub/Sub system can remove the +// relevant messages from the subscription. Acknowledging a message +// whose ack deadline has expired may succeed, but such a message may be +// redelivered later. Acknowledging a message more than once will not +// result in an error. +func (r *ProjectsSubscriptionsService) Acknowledge(subscription string, acknowledgerequest *AcknowledgeRequest) *ProjectsSubscriptionsAcknowledgeCall { + c := &ProjectsSubscriptionsAcknowledgeCall{s: r.s, opt_: make(map[string]interface{})} + c.subscription = subscription + c.acknowledgerequest = acknowledgerequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSubscriptionsAcknowledgeCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsAcknowledgeCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSubscriptionsAcknowledgeCall) Context(ctx context.Context) *ProjectsSubscriptionsAcknowledgeCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSubscriptionsAcknowledgeCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.acknowledgerequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+subscription}:acknowledge") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "subscription": c.subscription, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.subscriptions.acknowledge" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsSubscriptionsAcknowledgeCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Acknowledges the messages associated with the `ack_ids` in the `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages from the subscription. Acknowledging a message whose ack deadline has expired may succeed, but such a message may be redelivered later. Acknowledging a message more than once will not result in an error.", + // "httpMethod": "POST", + // "id": "pubsub.projects.subscriptions.acknowledge", + // "parameterOrder": [ + // "subscription" + // ], + // "parameters": { + // "subscription": { + // "description": "The subscription whose message is being acknowledged.", + // "location": "path", + // "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+subscription}:acknowledge", + // "request": { + // "$ref": "AcknowledgeRequest" + // }, + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.subscriptions.create": + +type ProjectsSubscriptionsCreateCall struct { + s *Service + name string + subscription *Subscription + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a subscription to a given topic for a given +// subscriber. If the subscription already exists, returns +// `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns +// `NOT_FOUND`. If the name is not provided in the request, the server +// will assign a random name for this subscription on the same project +// as the topic. +func (r *ProjectsSubscriptionsService) Create(name string, subscription *Subscription) *ProjectsSubscriptionsCreateCall { + c := &ProjectsSubscriptionsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.name = name + c.subscription = subscription + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSubscriptionsCreateCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSubscriptionsCreateCall) Context(ctx context.Context) *ProjectsSubscriptionsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSubscriptionsCreateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.subscriptions.create" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsSubscriptionsCreateCall) Do() (*Subscription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a subscription to a given topic for a given subscriber. If the subscription already exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns `NOT_FOUND`. If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic.", + // "httpMethod": "PUT", + // "id": "pubsub.projects.subscriptions.create", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The name of the subscription. It must have the format `\"projects/{project}/subscriptions/{subscription}\"`. `{subscription}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `\"goog\"`.", + // "location": "path", + // "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "request": { + // "$ref": "Subscription" + // }, + // "response": { + // "$ref": "Subscription" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.subscriptions.delete": + +type ProjectsSubscriptionsDeleteCall struct { + s *Service + subscription string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing subscription. All pending messages in the +// subscription are immediately dropped. Calls to `Pull` after deletion +// will return `NOT_FOUND`. After a subscription is deleted, a new one +// may be created with the same name, but the new one has no association +// with the old subscription, or its topic unless the same topic is +// specified. +func (r *ProjectsSubscriptionsService) Delete(subscription string) *ProjectsSubscriptionsDeleteCall { + c := &ProjectsSubscriptionsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.subscription = subscription + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSubscriptionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSubscriptionsDeleteCall) Context(ctx context.Context) *ProjectsSubscriptionsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+subscription}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "subscription": c.subscription, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.subscriptions.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsSubscriptionsDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to `Pull` after deletion will return `NOT_FOUND`. After a subscription is deleted, a new one may be created with the same name, but the new one has no association with the old subscription, or its topic unless the same topic is specified.", + // "httpMethod": "DELETE", + // "id": "pubsub.projects.subscriptions.delete", + // "parameterOrder": [ + // "subscription" + // ], + // "parameters": { + // "subscription": { + // "description": "The subscription to delete.", + // "location": "path", + // "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+subscription}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.subscriptions.get": + +type ProjectsSubscriptionsGetCall struct { + s *Service + subscription string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the configuration details of a subscription. +func (r *ProjectsSubscriptionsService) Get(subscription string) *ProjectsSubscriptionsGetCall { + c := &ProjectsSubscriptionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.subscription = subscription + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSubscriptionsGetCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsSubscriptionsGetCall) IfNoneMatch(entityTag string) *ProjectsSubscriptionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSubscriptionsGetCall) Context(ctx context.Context) *ProjectsSubscriptionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSubscriptionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+subscription}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "subscription": c.subscription, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.subscriptions.get" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsSubscriptionsGetCall) Do() (*Subscription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the configuration details of a subscription.", + // "httpMethod": "GET", + // "id": "pubsub.projects.subscriptions.get", + // "parameterOrder": [ + // "subscription" + // ], + // "parameters": { + // "subscription": { + // "description": "The name of the subscription to get.", + // "location": "path", + // "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+subscription}", + // "response": { + // "$ref": "Subscription" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.subscriptions.getIamPolicy": + +type ProjectsSubscriptionsGetIamPolicyCall struct { + s *Service + resource string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetIamPolicy: Gets the access control policy for a `resource`. Is +// empty if the policy or the resource does not exist. +func (r *ProjectsSubscriptionsService) GetIamPolicy(resource string) *ProjectsSubscriptionsGetIamPolicyCall { + c := &ProjectsSubscriptionsGetIamPolicyCall{s: r.s, opt_: make(map[string]interface{})} + c.resource = resource + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSubscriptionsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsGetIamPolicyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsSubscriptionsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsSubscriptionsGetIamPolicyCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSubscriptionsGetIamPolicyCall) Context(ctx context.Context) *ProjectsSubscriptionsGetIamPolicyCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSubscriptionsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.subscriptions.getIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsSubscriptionsGetIamPolicyCall) Do() (*Policy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the access control policy for a `resource`. Is empty if the policy or the resource does not exist.", + // "httpMethod": "GET", + // "id": "pubsub.projects.subscriptions.getIamPolicy", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which policy is being requested. Resource is usually specified as a path, such as, `projects/{project}`.", + // "location": "path", + // "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:getIamPolicy", + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.subscriptions.list": + +type ProjectsSubscriptionsListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists matching subscriptions. +func (r *ProjectsSubscriptionsService) List(project string) *ProjectsSubscriptionsListCall { + c := &ProjectsSubscriptionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// subscriptions to return. +func (c *ProjectsSubscriptionsListCall) PageSize(pageSize int64) *ProjectsSubscriptionsListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListSubscriptionsResponse`; indicates that this is a +// continuation of a prior `ListSubscriptions` call, and that the system +// should return the next page of data. +func (c *ProjectsSubscriptionsListCall) PageToken(pageToken string) *ProjectsSubscriptionsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSubscriptionsListCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsSubscriptionsListCall) IfNoneMatch(entityTag string) *ProjectsSubscriptionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSubscriptionsListCall) Context(ctx context.Context) *ProjectsSubscriptionsListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSubscriptionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+project}/subscriptions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.subscriptions.list" call. +// Exactly one of *ListSubscriptionsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListSubscriptionsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsSubscriptionsListCall) Do() (*ListSubscriptionsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListSubscriptionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists matching subscriptions.", + // "httpMethod": "GET", + // "id": "pubsub.projects.subscriptions.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "pageSize": { + // "description": "Maximum number of subscriptions to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last `ListSubscriptionsResponse`; indicates that this is a continuation of a prior `ListSubscriptions` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The name of the cloud project that subscriptions belong to.", + // "location": "path", + // "pattern": "^projects/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+project}/subscriptions", + // "response": { + // "$ref": "ListSubscriptionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.subscriptions.modifyAckDeadline": + +type ProjectsSubscriptionsModifyAckDeadlineCall struct { + s *Service + subscription string + modifyackdeadlinerequest *ModifyAckDeadlineRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// ModifyAckDeadline: Modifies the ack deadline for a specific message. +// This method is useful to indicate that more time is needed to process +// a message by the subscriber, or to make the message available for +// redelivery if the processing was interrupted. +func (r *ProjectsSubscriptionsService) ModifyAckDeadline(subscription string, modifyackdeadlinerequest *ModifyAckDeadlineRequest) *ProjectsSubscriptionsModifyAckDeadlineCall { + c := &ProjectsSubscriptionsModifyAckDeadlineCall{s: r.s, opt_: make(map[string]interface{})} + c.subscription = subscription + c.modifyackdeadlinerequest = modifyackdeadlinerequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSubscriptionsModifyAckDeadlineCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsModifyAckDeadlineCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSubscriptionsModifyAckDeadlineCall) Context(ctx context.Context) *ProjectsSubscriptionsModifyAckDeadlineCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSubscriptionsModifyAckDeadlineCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifyackdeadlinerequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+subscription}:modifyAckDeadline") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "subscription": c.subscription, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.subscriptions.modifyAckDeadline" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsSubscriptionsModifyAckDeadlineCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Modifies the ack deadline for a specific message. This method is useful to indicate that more time is needed to process a message by the subscriber, or to make the message available for redelivery if the processing was interrupted.", + // "httpMethod": "POST", + // "id": "pubsub.projects.subscriptions.modifyAckDeadline", + // "parameterOrder": [ + // "subscription" + // ], + // "parameters": { + // "subscription": { + // "description": "The name of the subscription.", + // "location": "path", + // "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+subscription}:modifyAckDeadline", + // "request": { + // "$ref": "ModifyAckDeadlineRequest" + // }, + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.subscriptions.modifyPushConfig": + +type ProjectsSubscriptionsModifyPushConfigCall struct { + s *Service + subscription string + modifypushconfigrequest *ModifyPushConfigRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// ModifyPushConfig: Modifies the `PushConfig` for a specified +// subscription. This may be used to change a push subscription to a +// pull one (signified by an empty `PushConfig`) or vice versa, or +// change the endpoint URL and other attributes of a push subscription. +// Messages will accumulate for delivery continuously through the call +// regardless of changes to the `PushConfig`. +func (r *ProjectsSubscriptionsService) ModifyPushConfig(subscription string, modifypushconfigrequest *ModifyPushConfigRequest) *ProjectsSubscriptionsModifyPushConfigCall { + c := &ProjectsSubscriptionsModifyPushConfigCall{s: r.s, opt_: make(map[string]interface{})} + c.subscription = subscription + c.modifypushconfigrequest = modifypushconfigrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSubscriptionsModifyPushConfigCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsModifyPushConfigCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSubscriptionsModifyPushConfigCall) Context(ctx context.Context) *ProjectsSubscriptionsModifyPushConfigCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSubscriptionsModifyPushConfigCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifypushconfigrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+subscription}:modifyPushConfig") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "subscription": c.subscription, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.subscriptions.modifyPushConfig" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsSubscriptionsModifyPushConfigCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Modifies the `PushConfig` for a specified subscription. This may be used to change a push subscription to a pull one (signified by an empty `PushConfig`) or vice versa, or change the endpoint URL and other attributes of a push subscription. Messages will accumulate for delivery continuously through the call regardless of changes to the `PushConfig`.", + // "httpMethod": "POST", + // "id": "pubsub.projects.subscriptions.modifyPushConfig", + // "parameterOrder": [ + // "subscription" + // ], + // "parameters": { + // "subscription": { + // "description": "The name of the subscription.", + // "location": "path", + // "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+subscription}:modifyPushConfig", + // "request": { + // "$ref": "ModifyPushConfigRequest" + // }, + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.subscriptions.pull": + +type ProjectsSubscriptionsPullCall struct { + s *Service + subscription string + pullrequest *PullRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Pull: Pulls messages from the server. Returns an empty list if there +// are no messages available in the backlog. The server may return +// `UNAVAILABLE` if there are too many concurrent pull requests pending +// for the given subscription. +func (r *ProjectsSubscriptionsService) Pull(subscription string, pullrequest *PullRequest) *ProjectsSubscriptionsPullCall { + c := &ProjectsSubscriptionsPullCall{s: r.s, opt_: make(map[string]interface{})} + c.subscription = subscription + c.pullrequest = pullrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSubscriptionsPullCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsPullCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSubscriptionsPullCall) Context(ctx context.Context) *ProjectsSubscriptionsPullCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSubscriptionsPullCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.pullrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+subscription}:pull") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "subscription": c.subscription, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.subscriptions.pull" call. +// Exactly one of *PullResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PullResponse.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsSubscriptionsPullCall) Do() (*PullResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PullResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Pulls messages from the server. Returns an empty list if there are no messages available in the backlog. The server may return `UNAVAILABLE` if there are too many concurrent pull requests pending for the given subscription.", + // "httpMethod": "POST", + // "id": "pubsub.projects.subscriptions.pull", + // "parameterOrder": [ + // "subscription" + // ], + // "parameters": { + // "subscription": { + // "description": "The subscription from which messages should be pulled.", + // "location": "path", + // "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+subscription}:pull", + // "request": { + // "$ref": "PullRequest" + // }, + // "response": { + // "$ref": "PullResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.subscriptions.setIamPolicy": + +type ProjectsSubscriptionsSetIamPolicyCall struct { + s *Service + resource string + setiampolicyrequest *SetIamPolicyRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetIamPolicy: Sets the access control policy on the specified +// resource. Replaces any existing policy. +func (r *ProjectsSubscriptionsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsSubscriptionsSetIamPolicyCall { + c := &ProjectsSubscriptionsSetIamPolicyCall{s: r.s, opt_: make(map[string]interface{})} + c.resource = resource + c.setiampolicyrequest = setiampolicyrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSubscriptionsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsSetIamPolicyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSubscriptionsSetIamPolicyCall) Context(ctx context.Context) *ProjectsSubscriptionsSetIamPolicyCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSubscriptionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.subscriptions.setIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsSubscriptionsSetIamPolicyCall) Do() (*Policy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", + // "httpMethod": "POST", + // "id": "pubsub.projects.subscriptions.setIamPolicy", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which policy is being specified. `resource` is usually specified as a path, such as, `projects/{project}/zones/{zone}/disks/{disk}`.", + // "location": "path", + // "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:setIamPolicy", + // "request": { + // "$ref": "SetIamPolicyRequest" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.subscriptions.testIamPermissions": + +type ProjectsSubscriptionsTestIamPermissionsCall struct { + s *Service + resource string + testiampermissionsrequest *TestIamPermissionsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// TestIamPermissions: Returns permissions that a caller has on the +// specified resource. +func (r *ProjectsSubscriptionsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsSubscriptionsTestIamPermissionsCall { + c := &ProjectsSubscriptionsTestIamPermissionsCall{s: r.s, opt_: make(map[string]interface{})} + c.resource = resource + c.testiampermissionsrequest = testiampermissionsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSubscriptionsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsTestIamPermissionsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSubscriptionsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsSubscriptionsTestIamPermissionsCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSubscriptionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.subscriptions.testIamPermissions" call. +// Exactly one of *TestIamPermissionsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TestIamPermissionsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsSubscriptionsTestIamPermissionsCall) Do() (*TestIamPermissionsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TestIamPermissionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns permissions that a caller has on the specified resource.", + // "httpMethod": "POST", + // "id": "pubsub.projects.subscriptions.testIamPermissions", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which policy detail is being requested. `resource` is usually specified as a path, such as, `projects/{project}`.", + // "location": "path", + // "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:testIamPermissions", + // "request": { + // "$ref": "TestIamPermissionsRequest" + // }, + // "response": { + // "$ref": "TestIamPermissionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.topics.create": + +type ProjectsTopicsCreateCall struct { + s *Service + name string + topic *Topic + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates the given topic with the given name. +func (r *ProjectsTopicsService) Create(name string, topic *Topic) *ProjectsTopicsCreateCall { + c := &ProjectsTopicsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.name = name + c.topic = topic + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsTopicsCreateCall) Fields(s ...googleapi.Field) *ProjectsTopicsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsTopicsCreateCall) Context(ctx context.Context) *ProjectsTopicsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsTopicsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.topic) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.topics.create" call. +// Exactly one of *Topic or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Topic.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsTopicsCreateCall) Do() (*Topic, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Topic{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates the given topic with the given name.", + // "httpMethod": "PUT", + // "id": "pubsub.projects.topics.create", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The name of the topic. It must have the format `\"projects/{project}/topics/{topic}\"`. `{topic}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `\"goog\"`.", + // "location": "path", + // "pattern": "^projects/[^/]*/topics/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "request": { + // "$ref": "Topic" + // }, + // "response": { + // "$ref": "Topic" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.topics.delete": + +type ProjectsTopicsDeleteCall struct { + s *Service + topic string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the topic with the given name. Returns `NOT_FOUND` if +// the topic does not exist. After a topic is deleted, a new topic may +// be created with the same name; this is an entirely new topic with +// none of the old configuration or subscriptions. Existing +// subscriptions to this topic are not deleted, but their `topic` field +// is set to `_deleted-topic_`. +func (r *ProjectsTopicsService) Delete(topic string) *ProjectsTopicsDeleteCall { + c := &ProjectsTopicsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.topic = topic + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsTopicsDeleteCall) Fields(s ...googleapi.Field) *ProjectsTopicsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsTopicsDeleteCall) Context(ctx context.Context) *ProjectsTopicsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsTopicsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+topic}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "topic": c.topic, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.topics.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsTopicsDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a topic is deleted, a new topic may be created with the same name; this is an entirely new topic with none of the old configuration or subscriptions. Existing subscriptions to this topic are not deleted, but their `topic` field is set to `_deleted-topic_`.", + // "httpMethod": "DELETE", + // "id": "pubsub.projects.topics.delete", + // "parameterOrder": [ + // "topic" + // ], + // "parameters": { + // "topic": { + // "description": "Name of the topic to delete.", + // "location": "path", + // "pattern": "^projects/[^/]*/topics/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+topic}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.topics.get": + +type ProjectsTopicsGetCall struct { + s *Service + topic string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the configuration of a topic. +func (r *ProjectsTopicsService) Get(topic string) *ProjectsTopicsGetCall { + c := &ProjectsTopicsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.topic = topic + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsTopicsGetCall) Fields(s ...googleapi.Field) *ProjectsTopicsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsTopicsGetCall) IfNoneMatch(entityTag string) *ProjectsTopicsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsTopicsGetCall) Context(ctx context.Context) *ProjectsTopicsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsTopicsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+topic}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "topic": c.topic, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.topics.get" call. +// Exactly one of *Topic or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Topic.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsTopicsGetCall) Do() (*Topic, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Topic{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the configuration of a topic.", + // "httpMethod": "GET", + // "id": "pubsub.projects.topics.get", + // "parameterOrder": [ + // "topic" + // ], + // "parameters": { + // "topic": { + // "description": "The name of the topic to get.", + // "location": "path", + // "pattern": "^projects/[^/]*/topics/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+topic}", + // "response": { + // "$ref": "Topic" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.topics.getIamPolicy": + +type ProjectsTopicsGetIamPolicyCall struct { + s *Service + resource string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetIamPolicy: Gets the access control policy for a `resource`. Is +// empty if the policy or the resource does not exist. +func (r *ProjectsTopicsService) GetIamPolicy(resource string) *ProjectsTopicsGetIamPolicyCall { + c := &ProjectsTopicsGetIamPolicyCall{s: r.s, opt_: make(map[string]interface{})} + c.resource = resource + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsTopicsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsTopicsGetIamPolicyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsTopicsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsTopicsGetIamPolicyCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsTopicsGetIamPolicyCall) Context(ctx context.Context) *ProjectsTopicsGetIamPolicyCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsTopicsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.topics.getIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsTopicsGetIamPolicyCall) Do() (*Policy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the access control policy for a `resource`. Is empty if the policy or the resource does not exist.", + // "httpMethod": "GET", + // "id": "pubsub.projects.topics.getIamPolicy", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which policy is being requested. Resource is usually specified as a path, such as, `projects/{project}`.", + // "location": "path", + // "pattern": "^projects/[^/]*/topics/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:getIamPolicy", + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.topics.list": + +type ProjectsTopicsListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists matching topics. +func (r *ProjectsTopicsService) List(project string) *ProjectsTopicsListCall { + c := &ProjectsTopicsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// topics to return. +func (c *ProjectsTopicsListCall) PageSize(pageSize int64) *ProjectsTopicsListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListTopicsResponse`; indicates that this is a +// continuation of a prior `ListTopics` call, and that the system should +// return the next page of data. +func (c *ProjectsTopicsListCall) PageToken(pageToken string) *ProjectsTopicsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsTopicsListCall) Fields(s ...googleapi.Field) *ProjectsTopicsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsTopicsListCall) IfNoneMatch(entityTag string) *ProjectsTopicsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsTopicsListCall) Context(ctx context.Context) *ProjectsTopicsListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsTopicsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+project}/topics") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.topics.list" call. +// Exactly one of *ListTopicsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListTopicsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsTopicsListCall) Do() (*ListTopicsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListTopicsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists matching topics.", + // "httpMethod": "GET", + // "id": "pubsub.projects.topics.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "pageSize": { + // "description": "Maximum number of topics to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last `ListTopicsResponse`; indicates that this is a continuation of a prior `ListTopics` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The name of the cloud project that topics belong to.", + // "location": "path", + // "pattern": "^projects/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+project}/topics", + // "response": { + // "$ref": "ListTopicsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.topics.publish": + +type ProjectsTopicsPublishCall struct { + s *Service + topic string + publishrequest *PublishRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Publish: Adds one or more messages to the topic. Returns `NOT_FOUND` +// if the topic does not exist. The message payload must not be empty; +// it must contain either a non-empty data field, or at least one +// attribute. +func (r *ProjectsTopicsService) Publish(topic string, publishrequest *PublishRequest) *ProjectsTopicsPublishCall { + c := &ProjectsTopicsPublishCall{s: r.s, opt_: make(map[string]interface{})} + c.topic = topic + c.publishrequest = publishrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsTopicsPublishCall) Fields(s ...googleapi.Field) *ProjectsTopicsPublishCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsTopicsPublishCall) Context(ctx context.Context) *ProjectsTopicsPublishCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsTopicsPublishCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.publishrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+topic}:publish") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "topic": c.topic, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.topics.publish" call. +// Exactly one of *PublishResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PublishResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsTopicsPublishCall) Do() (*PublishResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PublishResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic does not exist. The message payload must not be empty; it must contain either a non-empty data field, or at least one attribute.", + // "httpMethod": "POST", + // "id": "pubsub.projects.topics.publish", + // "parameterOrder": [ + // "topic" + // ], + // "parameters": { + // "topic": { + // "description": "The messages in the request will be published on this topic.", + // "location": "path", + // "pattern": "^projects/[^/]*/topics/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+topic}:publish", + // "request": { + // "$ref": "PublishRequest" + // }, + // "response": { + // "$ref": "PublishResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.topics.setIamPolicy": + +type ProjectsTopicsSetIamPolicyCall struct { + s *Service + resource string + setiampolicyrequest *SetIamPolicyRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetIamPolicy: Sets the access control policy on the specified +// resource. Replaces any existing policy. +func (r *ProjectsTopicsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsTopicsSetIamPolicyCall { + c := &ProjectsTopicsSetIamPolicyCall{s: r.s, opt_: make(map[string]interface{})} + c.resource = resource + c.setiampolicyrequest = setiampolicyrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsTopicsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsTopicsSetIamPolicyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsTopicsSetIamPolicyCall) Context(ctx context.Context) *ProjectsTopicsSetIamPolicyCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsTopicsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.topics.setIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsTopicsSetIamPolicyCall) Do() (*Policy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", + // "httpMethod": "POST", + // "id": "pubsub.projects.topics.setIamPolicy", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which policy is being specified. `resource` is usually specified as a path, such as, `projects/{project}/zones/{zone}/disks/{disk}`.", + // "location": "path", + // "pattern": "^projects/[^/]*/topics/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:setIamPolicy", + // "request": { + // "$ref": "SetIamPolicyRequest" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.topics.testIamPermissions": + +type ProjectsTopicsTestIamPermissionsCall struct { + s *Service + resource string + testiampermissionsrequest *TestIamPermissionsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// TestIamPermissions: Returns permissions that a caller has on the +// specified resource. +func (r *ProjectsTopicsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsTopicsTestIamPermissionsCall { + c := &ProjectsTopicsTestIamPermissionsCall{s: r.s, opt_: make(map[string]interface{})} + c.resource = resource + c.testiampermissionsrequest = testiampermissionsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsTopicsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsTopicsTestIamPermissionsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsTopicsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsTopicsTestIamPermissionsCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsTopicsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.topics.testIamPermissions" call. +// Exactly one of *TestIamPermissionsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TestIamPermissionsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsTopicsTestIamPermissionsCall) Do() (*TestIamPermissionsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TestIamPermissionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns permissions that a caller has on the specified resource.", + // "httpMethod": "POST", + // "id": "pubsub.projects.topics.testIamPermissions", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which policy detail is being requested. `resource` is usually specified as a path, such as, `projects/{project}`.", + // "location": "path", + // "pattern": "^projects/[^/]*/topics/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+resource}:testIamPermissions", + // "request": { + // "$ref": "TestIamPermissionsRequest" + // }, + // "response": { + // "$ref": "TestIamPermissionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.topics.subscriptions.list": + +type ProjectsTopicsSubscriptionsListCall struct { + s *Service + topic string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the name of the subscriptions for this topic. +func (r *ProjectsTopicsSubscriptionsService) List(topic string) *ProjectsTopicsSubscriptionsListCall { + c := &ProjectsTopicsSubscriptionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.topic = topic + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// subscription names to return. +func (c *ProjectsTopicsSubscriptionsListCall) PageSize(pageSize int64) *ProjectsTopicsSubscriptionsListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListTopicSubscriptionsResponse`; indicates that this is +// a continuation of a prior `ListTopicSubscriptions` call, and that the +// system should return the next page of data. +func (c *ProjectsTopicsSubscriptionsListCall) PageToken(pageToken string) *ProjectsTopicsSubscriptionsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsTopicsSubscriptionsListCall) Fields(s ...googleapi.Field) *ProjectsTopicsSubscriptionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsTopicsSubscriptionsListCall) IfNoneMatch(entityTag string) *ProjectsTopicsSubscriptionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsTopicsSubscriptionsListCall) Context(ctx context.Context) *ProjectsTopicsSubscriptionsListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsTopicsSubscriptionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+topic}/subscriptions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "topic": c.topic, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.topics.subscriptions.list" call. +// Exactly one of *ListTopicSubscriptionsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListTopicSubscriptionsResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsTopicsSubscriptionsListCall) Do() (*ListTopicSubscriptionsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListTopicSubscriptionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the name of the subscriptions for this topic.", + // "httpMethod": "GET", + // "id": "pubsub.projects.topics.subscriptions.list", + // "parameterOrder": [ + // "topic" + // ], + // "parameters": { + // "pageSize": { + // "description": "Maximum number of subscription names to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last `ListTopicSubscriptionsResponse`; indicates that this is a continuation of a prior `ListTopicSubscriptions` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, + // "topic": { + // "description": "The name of the topic that subscriptions are attached to.", + // "location": "path", + // "pattern": "^projects/[^/]*/topics/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+topic}/subscriptions", + // "response": { + // "$ref": "ListTopicSubscriptionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/pubsub/v1beta1/pubsub-api.json b/Godeps/_workspace/src/google.golang.org/api/pubsub/v1beta1/pubsub-api.json new file mode 100644 index 000000000..78188f8a5 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/pubsub/v1beta1/pubsub-api.json @@ -0,0 +1,699 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/WREiw9MY3aTruirkUtn50QBMhss\"", + "discoveryVersion": "v1", + "id": "pubsub:v1beta1", + "name": "pubsub", + "version": "v1beta1", + "revision": "20150813", + "title": "Google Cloud Pub/Sub API", + "description": "Provides reliable, many-to-many, asynchronous messaging between applications.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/search-16.gif", + "x32": "https://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://developers.google.com/pubsub/v1beta1", + "labels": [ + "limited_availability" + ], + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/pubsub/v1beta1/", + "basePath": "/pubsub/v1beta1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "pubsub/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/pubsub": { + "description": "View and manage Pub/Sub topics and subscriptions" + } + } + } + }, + "schemas": { + "AcknowledgeRequest": { + "id": "AcknowledgeRequest", + "type": "object", + "description": "Request for the Acknowledge method.", + "properties": { + "ackId": { + "type": "array", + "description": "The acknowledgment ID for the message being acknowledged. This was returned by the Pub/Sub system in the Pull response.", + "items": { + "type": "string" + } + }, + "subscription": { + "type": "string", + "description": "The subscription whose message is being acknowledged." + } + } + }, + "Label": { + "id": "Label", + "type": "object", + "description": "A key-value pair applied to a given object.", + "properties": { + "key": { + "type": "string", + "description": "The key of a label is a syntactically valid URL (as per RFC 1738) with the \"scheme\" and initial slashes omitted and with the additional restrictions noted below. Each key should be globally unique. The \"host\" portion is called the \"namespace\" and is not necessarily resolvable to a network endpoint. Instead, the namespace indicates what system or entity defines the semantics of the label. Namespaces do not restrict the set of objects to which a label may be associated.\n\nKeys are defined by the following grammar:\n\nkey = hostname \"/\" kpath kpath = ksegment *[ \"/\" ksegment ] ksegment = alphadigit | *[ alphadigit | \"-\" | \"_\" | \".\" ]\n\nwhere \"hostname\" and \"alphadigit\" are defined as in RFC 1738.\n\nExample key: spanner.google.com/universe" + }, + "numValue": { + "type": "string", + "description": "An integer value.", + "format": "int64" + }, + "strValue": { + "type": "string", + "description": "A string value." + } + } + }, + "ListSubscriptionsResponse": { + "id": "ListSubscriptionsResponse", + "type": "object", + "description": "Response for the ListSubscriptions method.", + "properties": { + "nextPageToken": { + "type": "string", + "description": "If not empty, indicates that there are more subscriptions that match the request and this value should be passed to the next ListSubscriptionsRequest to continue." + }, + "subscription": { + "type": "array", + "description": "The subscriptions that match the request.", + "items": { + "$ref": "Subscription" + } + } + } + }, + "ListTopicsResponse": { + "id": "ListTopicsResponse", + "type": "object", + "description": "Response for the ListTopics method.", + "properties": { + "nextPageToken": { + "type": "string", + "description": "If not empty, indicates that there are more topics that match the request, and this value should be passed to the next ListTopicsRequest to continue." + }, + "topic": { + "type": "array", + "description": "The resulting topics.", + "items": { + "$ref": "Topic" + } + } + } + }, + "ModifyAckDeadlineRequest": { + "id": "ModifyAckDeadlineRequest", + "type": "object", + "description": "Request for the ModifyAckDeadline method.", + "properties": { + "ackDeadlineSeconds": { + "type": "integer", + "description": "The new ack deadline with respect to the time this request was sent to the Pub/Sub system. Must be \u003e= 0. For example, if the value is 10, the new ack deadline will expire 10 seconds after the ModifyAckDeadline call was made. Specifying zero may immediately make the message available for another pull request.", + "format": "int32" + }, + "ackId": { + "type": "string", + "description": "The acknowledgment ID. Either this or ack_ids must be populated, not both." + }, + "ackIds": { + "type": "array", + "description": "List of acknowledgment IDs. Either this field or ack_id should be populated, not both.", + "items": { + "type": "string" + } + }, + "subscription": { + "type": "string", + "description": "Next Index: 5 The name of the subscription from which messages are being pulled." + } + } + }, + "ModifyPushConfigRequest": { + "id": "ModifyPushConfigRequest", + "type": "object", + "description": "Request for the ModifyPushConfig method.", + "properties": { + "pushConfig": { + "$ref": "PushConfig", + "description": "An empty push_config indicates that the Pub/Sub system should pause pushing messages from the given subscription." + }, + "subscription": { + "type": "string", + "description": "The name of the subscription." + } + } + }, + "PublishBatchRequest": { + "id": "PublishBatchRequest", + "type": "object", + "description": "Request for the PublishBatch method.", + "properties": { + "messages": { + "type": "array", + "description": "The messages to publish.", + "items": { + "$ref": "PubsubMessage" + } + }, + "topic": { + "type": "string", + "description": "The messages in the request will be published on this topic." + } + } + }, + "PublishBatchResponse": { + "id": "PublishBatchResponse", + "type": "object", + "description": "Response for the PublishBatch method.", + "properties": { + "messageIds": { + "type": "array", + "description": "The server-assigned ID of each published message, in the same order as the messages in the request. IDs are guaranteed to be unique within the topic.", + "items": { + "type": "string" + } + } + } + }, + "PublishRequest": { + "id": "PublishRequest", + "type": "object", + "description": "Request for the Publish method.", + "properties": { + "message": { + "$ref": "PubsubMessage", + "description": "The message to publish." + }, + "topic": { + "type": "string", + "description": "The message in the request will be published on this topic." + } + } + }, + "PubsubEvent": { + "id": "PubsubEvent", + "type": "object", + "description": "An event indicating a received message or truncation event.", + "properties": { + "deleted": { + "type": "boolean", + "description": "Indicates that this subscription has been deleted. (Note that pull subscribers will always receive NOT_FOUND in response in their pull request on the subscription, rather than seeing this boolean.)" + }, + "message": { + "$ref": "PubsubMessage", + "description": "A received message." + }, + "subscription": { + "type": "string", + "description": "The subscription that received the event." + }, + "truncated": { + "type": "boolean", + "description": "Indicates that this subscription has been truncated." + } + } + }, + "PubsubMessage": { + "id": "PubsubMessage", + "type": "object", + "description": "A message data and its labels.", + "properties": { + "data": { + "type": "string", + "description": "The message payload.", + "format": "byte" + }, + "label": { + "type": "array", + "description": "Optional list of labels for this message. Keys in this collection must be unique.", + "items": { + "$ref": "Label" + } + }, + "messageId": { + "type": "string", + "description": "ID of this message assigned by the server at publication time. Guaranteed to be unique within the topic. This value may be read by a subscriber that receives a PubsubMessage via a Pull call or a push delivery. It must not be populated by a publisher in a Publish call." + } + } + }, + "PullBatchRequest": { + "id": "PullBatchRequest", + "type": "object", + "description": "Request for the PullBatch method.", + "properties": { + "maxEvents": { + "type": "integer", + "description": "The maximum number of PubsubEvents returned for this request. The Pub/Sub system may return fewer than the number of events specified.", + "format": "int32" + }, + "returnImmediately": { + "type": "boolean", + "description": "If this is specified as true the system will respond immediately even if it is not able to return a message in the Pull response. Otherwise the system is allowed to wait until at least one message is available rather than returning no messages. The client may cancel the request if it does not wish to wait any longer for the response." + }, + "subscription": { + "type": "string", + "description": "The subscription from which messages should be pulled." + } + } + }, + "PullBatchResponse": { + "id": "PullBatchResponse", + "type": "object", + "description": "Response for the PullBatch method.", + "properties": { + "pullResponses": { + "type": "array", + "description": "Received Pub/Sub messages or status events. The Pub/Sub system will return zero messages if there are no more messages available in the backlog. The Pub/Sub system may return fewer than the max_events requested even if there are more messages available in the backlog.", + "items": { + "$ref": "PullResponse" + } + } + } + }, + "PullRequest": { + "id": "PullRequest", + "type": "object", + "description": "Request for the Pull method.", + "properties": { + "returnImmediately": { + "type": "boolean", + "description": "If this is specified as true the system will respond immediately even if it is not able to return a message in the Pull response. Otherwise the system is allowed to wait until at least one message is available rather than returning FAILED_PRECONDITION. The client may cancel the request if it does not wish to wait any longer for the response." + }, + "subscription": { + "type": "string", + "description": "The subscription from which a message should be pulled." + } + } + }, + "PullResponse": { + "id": "PullResponse", + "type": "object", + "description": "Either a PubsubMessage or a truncation event. One of these two must be populated.", + "properties": { + "ackId": { + "type": "string", + "description": "This ID must be used to acknowledge the received event or message." + }, + "pubsubEvent": { + "$ref": "PubsubEvent", + "description": "A pubsub message or truncation event." + } + } + }, + "PushConfig": { + "id": "PushConfig", + "type": "object", + "description": "Configuration for a push delivery endpoint.", + "properties": { + "pushEndpoint": { + "type": "string", + "description": "A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use \"https://example.com/push\"." + } + } + }, + "Subscription": { + "id": "Subscription", + "type": "object", + "description": "A subscription resource.", + "properties": { + "ackDeadlineSeconds": { + "type": "integer", + "description": "For either push or pull delivery, the value is the maximum time after a subscriber receives a message before the subscriber should acknowledge or Nack the message. If the Ack deadline for a message passes without an Ack or a Nack, the Pub/Sub system will eventually redeliver the message. If a subscriber acknowledges after the deadline, the Pub/Sub system may accept the Ack, but it is possible that the message has been already delivered again. Multiple Acks to the message are allowed and will succeed.\n\nFor push delivery, this value is used to set the request timeout for the call to the push endpoint.\n\nFor pull delivery, this value is used as the initial value for the Ack deadline. It may be overridden for each message using its corresponding ack_id with ModifyAckDeadline. While a message is outstanding (i.e. it has been delivered to a pull subscriber and the subscriber has not yet Acked or Nacked), the Pub/Sub system will not deliver that message to another pull subscriber (on a best-effort basis).", + "format": "int32" + }, + "name": { + "type": "string", + "description": "Name of the subscription." + }, + "pushConfig": { + "$ref": "PushConfig", + "description": "If push delivery is used with this subscription, this field is used to configure it." + }, + "topic": { + "type": "string", + "description": "The name of the topic from which this subscription is receiving messages." + } + } + }, + "Topic": { + "id": "Topic", + "type": "object", + "description": "A topic resource.", + "properties": { + "name": { + "type": "string", + "description": "Name of the topic." + } + } + } + }, + "resources": { + "subscriptions": { + "methods": { + "acknowledge": { + "id": "pubsub.subscriptions.acknowledge", + "path": "subscriptions/acknowledge", + "httpMethod": "POST", + "description": "Acknowledges a particular received message: the Pub/Sub system can remove the given message from the subscription. Acknowledging a message whose Ack deadline has expired may succeed, but the message could have been already redelivered. Acknowledging a message more than once will not result in an error. This is only used for messages received via pull.", + "request": { + "$ref": "AcknowledgeRequest" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "create": { + "id": "pubsub.subscriptions.create", + "path": "subscriptions", + "httpMethod": "POST", + "description": "Creates a subscription on a given topic for a given subscriber. If the subscription already exists, returns ALREADY_EXISTS. If the corresponding topic doesn't exist, returns NOT_FOUND.\n\nIf the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic.", + "request": { + "$ref": "Subscription" + }, + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "delete": { + "id": "pubsub.subscriptions.delete", + "path": "subscriptions/{+subscription}", + "httpMethod": "DELETE", + "description": "Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to Pull after deletion will return NOT_FOUND.", + "parameters": { + "subscription": { + "type": "string", + "description": "The subscription to delete.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "subscription" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "get": { + "id": "pubsub.subscriptions.get", + "path": "subscriptions/{+subscription}", + "httpMethod": "GET", + "description": "Gets the configuration details of a subscription.", + "parameters": { + "subscription": { + "type": "string", + "description": "The name of the subscription to get.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "subscription" + ], + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "list": { + "id": "pubsub.subscriptions.list", + "path": "subscriptions", + "httpMethod": "GET", + "description": "Lists matching subscriptions.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of subscriptions to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value obtained in the last ListSubscriptionsResponse for continuation.", + "location": "query" + }, + "query": { + "type": "string", + "description": "A valid label query expression.", + "location": "query" + } + }, + "response": { + "$ref": "ListSubscriptionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "modifyAckDeadline": { + "id": "pubsub.subscriptions.modifyAckDeadline", + "path": "subscriptions/modifyAckDeadline", + "httpMethod": "POST", + "description": "Modifies the Ack deadline for a message received from a pull request.", + "request": { + "$ref": "ModifyAckDeadlineRequest" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "modifyPushConfig": { + "id": "pubsub.subscriptions.modifyPushConfig", + "path": "subscriptions/modifyPushConfig", + "httpMethod": "POST", + "description": "Modifies the PushConfig for a specified subscription. This method can be used to suspend the flow of messages to an endpoint by clearing the PushConfig field in the request. Messages will be accumulated for delivery even if no push configuration is defined or while the configuration is modified.", + "request": { + "$ref": "ModifyPushConfigRequest" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "pull": { + "id": "pubsub.subscriptions.pull", + "path": "subscriptions/pull", + "httpMethod": "POST", + "description": "Pulls a single message from the server. If return_immediately is true, and no messages are available in the subscription, this method returns FAILED_PRECONDITION. The system is free to return an UNAVAILABLE error if no messages are available in a reasonable amount of time (to reduce system load).", + "request": { + "$ref": "PullRequest" + }, + "response": { + "$ref": "PullResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "pullBatch": { + "id": "pubsub.subscriptions.pullBatch", + "path": "subscriptions/pullBatch", + "httpMethod": "POST", + "description": "Pulls messages from the server. Returns an empty list if there are no messages available in the backlog. The system is free to return UNAVAILABLE if there are too many pull requests outstanding for the given subscription.", + "request": { + "$ref": "PullBatchRequest" + }, + "response": { + "$ref": "PullBatchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + } + } + }, + "topics": { + "methods": { + "create": { + "id": "pubsub.topics.create", + "path": "topics", + "httpMethod": "POST", + "description": "Creates the given topic with the given name.", + "request": { + "$ref": "Topic" + }, + "response": { + "$ref": "Topic" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "delete": { + "id": "pubsub.topics.delete", + "path": "topics/{+topic}", + "httpMethod": "DELETE", + "description": "Deletes the topic with the given name. Returns NOT_FOUND if the topic does not exist. After a topic is deleted, a new topic may be created with the same name.", + "parameters": { + "topic": { + "type": "string", + "description": "Name of the topic to delete.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "topic" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "get": { + "id": "pubsub.topics.get", + "path": "topics/{+topic}", + "httpMethod": "GET", + "description": "Gets the configuration of a topic. Since the topic only has the name attribute, this method is only useful to check the existence of a topic. If other attributes are added in the future, they will be returned here.", + "parameters": { + "topic": { + "type": "string", + "description": "The name of the topic to get.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "topic" + ], + "response": { + "$ref": "Topic" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "list": { + "id": "pubsub.topics.list", + "path": "topics", + "httpMethod": "GET", + "description": "Lists matching topics.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of topics to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value obtained in the last ListTopicsResponse for continuation.", + "location": "query" + }, + "query": { + "type": "string", + "description": "A valid label query expression.", + "location": "query" + } + }, + "response": { + "$ref": "ListTopicsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "publish": { + "id": "pubsub.topics.publish", + "path": "topics/publish", + "httpMethod": "POST", + "description": "Adds a message to the topic. Returns NOT_FOUND if the topic does not exist.", + "request": { + "$ref": "PublishRequest" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "publishBatch": { + "id": "pubsub.topics.publishBatch", + "path": "topics/publishBatch", + "httpMethod": "POST", + "description": "Adds one or more messages to the topic. Returns NOT_FOUND if the topic does not exist.", + "request": { + "$ref": "PublishBatchRequest" + }, + "response": { + "$ref": "PublishBatchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/pubsub/v1beta1/pubsub-gen.go b/Godeps/_workspace/src/google.golang.org/api/pubsub/v1beta1/pubsub-gen.go new file mode 100644 index 000000000..a7cf31ac3 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/pubsub/v1beta1/pubsub-gen.go @@ -0,0 +1,2301 @@ +// Package pubsub provides access to the Google Cloud Pub/Sub API. +// +// See https://developers.google.com/pubsub/v1beta1 +// +// Usage example: +// +// import "google.golang.org/api/pubsub/v1beta1" +// ... +// pubsubService, err := pubsub.New(oauthHttpClient) +package pubsub // import "google.golang.org/api/pubsub/v1beta1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "pubsub:v1beta1" +const apiName = "pubsub" +const apiVersion = "v1beta1" +const basePath = "https://www.googleapis.com/pubsub/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" + + // View and manage Pub/Sub topics and subscriptions + PubsubScope = "https://www.googleapis.com/auth/pubsub" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Subscriptions = NewSubscriptionsService(s) + s.Topics = NewTopicsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Subscriptions *SubscriptionsService + + Topics *TopicsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewSubscriptionsService(s *Service) *SubscriptionsService { + rs := &SubscriptionsService{s: s} + return rs +} + +type SubscriptionsService struct { + s *Service +} + +func NewTopicsService(s *Service) *TopicsService { + rs := &TopicsService{s: s} + return rs +} + +type TopicsService struct { + s *Service +} + +// AcknowledgeRequest: Request for the Acknowledge method. +type AcknowledgeRequest struct { + // AckId: The acknowledgment ID for the message being acknowledged. This + // was returned by the Pub/Sub system in the Pull response. + AckId []string `json:"ackId,omitempty"` + + // Subscription: The subscription whose message is being acknowledged. + Subscription string `json:"subscription,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AckId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AcknowledgeRequest) MarshalJSON() ([]byte, error) { + type noMethod AcknowledgeRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Label: A key-value pair applied to a given object. +type Label struct { + // Key: The key of a label is a syntactically valid URL (as per RFC + // 1738) with the "scheme" and initial slashes omitted and with the + // additional restrictions noted below. Each key should be globally + // unique. The "host" portion is called the "namespace" and is not + // necessarily resolvable to a network endpoint. Instead, the namespace + // indicates what system or entity defines the semantics of the label. + // Namespaces do not restrict the set of objects to which a label may be + // associated. + // + // Keys are defined by the following grammar: + // + // key = hostname "/" kpath kpath = ksegment *[ "/" ksegment ] ksegment + // = alphadigit | *[ alphadigit | "-" | "_" | "." ] + // + // where "hostname" and "alphadigit" are defined as in RFC + // 1738. + // + // Example key: spanner.google.com/universe + Key string `json:"key,omitempty"` + + // NumValue: An integer value. + NumValue int64 `json:"numValue,omitempty,string"` + + // StrValue: A string value. + StrValue string `json:"strValue,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Label) MarshalJSON() ([]byte, error) { + type noMethod Label + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListSubscriptionsResponse: Response for the ListSubscriptions method. +type ListSubscriptionsResponse struct { + // NextPageToken: If not empty, indicates that there are more + // subscriptions that match the request and this value should be passed + // to the next ListSubscriptionsRequest to continue. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Subscription: The subscriptions that match the request. + Subscription []*Subscription `json:"subscription,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListSubscriptionsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListSubscriptionsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListTopicsResponse: Response for the ListTopics method. +type ListTopicsResponse struct { + // NextPageToken: If not empty, indicates that there are more topics + // that match the request, and this value should be passed to the next + // ListTopicsRequest to continue. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Topic: The resulting topics. + Topic []*Topic `json:"topic,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListTopicsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListTopicsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ModifyAckDeadlineRequest: Request for the ModifyAckDeadline method. +type ModifyAckDeadlineRequest struct { + // AckDeadlineSeconds: The new ack deadline with respect to the time + // this request was sent to the Pub/Sub system. Must be >= 0. For + // example, if the value is 10, the new ack deadline will expire 10 + // seconds after the ModifyAckDeadline call was made. Specifying zero + // may immediately make the message available for another pull request. + AckDeadlineSeconds int64 `json:"ackDeadlineSeconds,omitempty"` + + // AckId: The acknowledgment ID. Either this or ack_ids must be + // populated, not both. + AckId string `json:"ackId,omitempty"` + + // AckIds: List of acknowledgment IDs. Either this field or ack_id + // should be populated, not both. + AckIds []string `json:"ackIds,omitempty"` + + // Subscription: Next Index: 5 The name of the subscription from which + // messages are being pulled. + Subscription string `json:"subscription,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AckDeadlineSeconds") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ModifyAckDeadlineRequest) MarshalJSON() ([]byte, error) { + type noMethod ModifyAckDeadlineRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ModifyPushConfigRequest: Request for the ModifyPushConfig method. +type ModifyPushConfigRequest struct { + // PushConfig: An empty push_config indicates that the Pub/Sub system + // should pause pushing messages from the given subscription. + PushConfig *PushConfig `json:"pushConfig,omitempty"` + + // Subscription: The name of the subscription. + Subscription string `json:"subscription,omitempty"` + + // ForceSendFields is a list of field names (e.g. "PushConfig") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ModifyPushConfigRequest) MarshalJSON() ([]byte, error) { + type noMethod ModifyPushConfigRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PublishBatchRequest: Request for the PublishBatch method. +type PublishBatchRequest struct { + // Messages: The messages to publish. + Messages []*PubsubMessage `json:"messages,omitempty"` + + // Topic: The messages in the request will be published on this topic. + Topic string `json:"topic,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Messages") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PublishBatchRequest) MarshalJSON() ([]byte, error) { + type noMethod PublishBatchRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PublishBatchResponse: Response for the PublishBatch method. +type PublishBatchResponse struct { + // MessageIds: The server-assigned ID of each published message, in the + // same order as the messages in the request. IDs are guaranteed to be + // unique within the topic. + MessageIds []string `json:"messageIds,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "MessageIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PublishBatchResponse) MarshalJSON() ([]byte, error) { + type noMethod PublishBatchResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PublishRequest: Request for the Publish method. +type PublishRequest struct { + // Message: The message to publish. + Message *PubsubMessage `json:"message,omitempty"` + + // Topic: The message in the request will be published on this topic. + Topic string `json:"topic,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Message") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PublishRequest) MarshalJSON() ([]byte, error) { + type noMethod PublishRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PubsubEvent: An event indicating a received message or truncation +// event. +type PubsubEvent struct { + // Deleted: Indicates that this subscription has been deleted. (Note + // that pull subscribers will always receive NOT_FOUND in response in + // their pull request on the subscription, rather than seeing this + // boolean.) + Deleted bool `json:"deleted,omitempty"` + + // Message: A received message. + Message *PubsubMessage `json:"message,omitempty"` + + // Subscription: The subscription that received the event. + Subscription string `json:"subscription,omitempty"` + + // Truncated: Indicates that this subscription has been truncated. + Truncated bool `json:"truncated,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Deleted") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PubsubEvent) MarshalJSON() ([]byte, error) { + type noMethod PubsubEvent + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PubsubMessage: A message data and its labels. +type PubsubMessage struct { + // Data: The message payload. + Data string `json:"data,omitempty"` + + // Label: Optional list of labels for this message. Keys in this + // collection must be unique. + Label []*Label `json:"label,omitempty"` + + // MessageId: ID of this message assigned by the server at publication + // time. Guaranteed to be unique within the topic. This value may be + // read by a subscriber that receives a PubsubMessage via a Pull call or + // a push delivery. It must not be populated by a publisher in a Publish + // call. + MessageId string `json:"messageId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Data") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PubsubMessage) MarshalJSON() ([]byte, error) { + type noMethod PubsubMessage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PullBatchRequest: Request for the PullBatch method. +type PullBatchRequest struct { + // MaxEvents: The maximum number of PubsubEvents returned for this + // request. The Pub/Sub system may return fewer than the number of + // events specified. + MaxEvents int64 `json:"maxEvents,omitempty"` + + // ReturnImmediately: If this is specified as true the system will + // respond immediately even if it is not able to return a message in the + // Pull response. Otherwise the system is allowed to wait until at least + // one message is available rather than returning no messages. The + // client may cancel the request if it does not wish to wait any longer + // for the response. + ReturnImmediately bool `json:"returnImmediately,omitempty"` + + // Subscription: The subscription from which messages should be pulled. + Subscription string `json:"subscription,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MaxEvents") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PullBatchRequest) MarshalJSON() ([]byte, error) { + type noMethod PullBatchRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PullBatchResponse: Response for the PullBatch method. +type PullBatchResponse struct { + // PullResponses: Received Pub/Sub messages or status events. The + // Pub/Sub system will return zero messages if there are no more + // messages available in the backlog. The Pub/Sub system may return + // fewer than the max_events requested even if there are more messages + // available in the backlog. + PullResponses []*PullResponse `json:"pullResponses,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "PullResponses") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PullBatchResponse) MarshalJSON() ([]byte, error) { + type noMethod PullBatchResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PullRequest: Request for the Pull method. +type PullRequest struct { + // ReturnImmediately: If this is specified as true the system will + // respond immediately even if it is not able to return a message in the + // Pull response. Otherwise the system is allowed to wait until at least + // one message is available rather than returning FAILED_PRECONDITION. + // The client may cancel the request if it does not wish to wait any + // longer for the response. + ReturnImmediately bool `json:"returnImmediately,omitempty"` + + // Subscription: The subscription from which a message should be pulled. + Subscription string `json:"subscription,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ReturnImmediately") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PullRequest) MarshalJSON() ([]byte, error) { + type noMethod PullRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PullResponse: Either a PubsubMessage or a truncation event. One of +// these two must be populated. +type PullResponse struct { + // AckId: This ID must be used to acknowledge the received event or + // message. + AckId string `json:"ackId,omitempty"` + + // PubsubEvent: A pubsub message or truncation event. + PubsubEvent *PubsubEvent `json:"pubsubEvent,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AckId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PullResponse) MarshalJSON() ([]byte, error) { + type noMethod PullResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PushConfig: Configuration for a push delivery endpoint. +type PushConfig struct { + // PushEndpoint: A URL locating the endpoint to which messages should be + // pushed. For example, a Webhook endpoint might use + // "https://example.com/push". + PushEndpoint string `json:"pushEndpoint,omitempty"` + + // ForceSendFields is a list of field names (e.g. "PushEndpoint") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PushConfig) MarshalJSON() ([]byte, error) { + type noMethod PushConfig + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Subscription: A subscription resource. +type Subscription struct { + // AckDeadlineSeconds: For either push or pull delivery, the value is + // the maximum time after a subscriber receives a message before the + // subscriber should acknowledge or Nack the message. If the Ack + // deadline for a message passes without an Ack or a Nack, the Pub/Sub + // system will eventually redeliver the message. If a subscriber + // acknowledges after the deadline, the Pub/Sub system may accept the + // Ack, but it is possible that the message has been already delivered + // again. Multiple Acks to the message are allowed and will + // succeed. + // + // For push delivery, this value is used to set the request timeout for + // the call to the push endpoint. + // + // For pull delivery, this value is used as the initial value for the + // Ack deadline. It may be overridden for each message using its + // corresponding ack_id with ModifyAckDeadline. While a message is + // outstanding (i.e. it has been delivered to a pull subscriber and the + // subscriber has not yet Acked or Nacked), the Pub/Sub system will not + // deliver that message to another pull subscriber (on a best-effort + // basis). + AckDeadlineSeconds int64 `json:"ackDeadlineSeconds,omitempty"` + + // Name: Name of the subscription. + Name string `json:"name,omitempty"` + + // PushConfig: If push delivery is used with this subscription, this + // field is used to configure it. + PushConfig *PushConfig `json:"pushConfig,omitempty"` + + // Topic: The name of the topic from which this subscription is + // receiving messages. + Topic string `json:"topic,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AckDeadlineSeconds") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Subscription) MarshalJSON() ([]byte, error) { + type noMethod Subscription + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Topic: A topic resource. +type Topic struct { + // Name: Name of the topic. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Topic) MarshalJSON() ([]byte, error) { + type noMethod Topic + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "pubsub.subscriptions.acknowledge": + +type SubscriptionsAcknowledgeCall struct { + s *Service + acknowledgerequest *AcknowledgeRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Acknowledge: Acknowledges a particular received message: the Pub/Sub +// system can remove the given message from the subscription. +// Acknowledging a message whose Ack deadline has expired may succeed, +// but the message could have been already redelivered. Acknowledging a +// message more than once will not result in an error. This is only used +// for messages received via pull. +func (r *SubscriptionsService) Acknowledge(acknowledgerequest *AcknowledgeRequest) *SubscriptionsAcknowledgeCall { + c := &SubscriptionsAcknowledgeCall{s: r.s, opt_: make(map[string]interface{})} + c.acknowledgerequest = acknowledgerequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsAcknowledgeCall) Fields(s ...googleapi.Field) *SubscriptionsAcknowledgeCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsAcknowledgeCall) Context(ctx context.Context) *SubscriptionsAcknowledgeCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsAcknowledgeCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.acknowledgerequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions/acknowledge") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.subscriptions.acknowledge" call. +func (c *SubscriptionsAcknowledgeCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Acknowledges a particular received message: the Pub/Sub system can remove the given message from the subscription. Acknowledging a message whose Ack deadline has expired may succeed, but the message could have been already redelivered. Acknowledging a message more than once will not result in an error. This is only used for messages received via pull.", + // "httpMethod": "POST", + // "id": "pubsub.subscriptions.acknowledge", + // "path": "subscriptions/acknowledge", + // "request": { + // "$ref": "AcknowledgeRequest" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.subscriptions.create": + +type SubscriptionsCreateCall struct { + s *Service + subscription *Subscription + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a subscription on a given topic for a given +// subscriber. If the subscription already exists, returns +// ALREADY_EXISTS. If the corresponding topic doesn't exist, returns +// NOT_FOUND. +// +// If the name is not provided in the request, the server will assign a +// random name for this subscription on the same project as the topic. +func (r *SubscriptionsService) Create(subscription *Subscription) *SubscriptionsCreateCall { + c := &SubscriptionsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.subscription = subscription + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsCreateCall) Fields(s ...googleapi.Field) *SubscriptionsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsCreateCall) Context(ctx context.Context) *SubscriptionsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsCreateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.subscriptions.create" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubscriptionsCreateCall) Do() (*Subscription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a subscription on a given topic for a given subscriber. If the subscription already exists, returns ALREADY_EXISTS. If the corresponding topic doesn't exist, returns NOT_FOUND.\n\nIf the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic.", + // "httpMethod": "POST", + // "id": "pubsub.subscriptions.create", + // "path": "subscriptions", + // "request": { + // "$ref": "Subscription" + // }, + // "response": { + // "$ref": "Subscription" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.subscriptions.delete": + +type SubscriptionsDeleteCall struct { + s *Service + subscription string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing subscription. All pending messages in the +// subscription are immediately dropped. Calls to Pull after deletion +// will return NOT_FOUND. +func (r *SubscriptionsService) Delete(subscription string) *SubscriptionsDeleteCall { + c := &SubscriptionsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.subscription = subscription + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsDeleteCall) Fields(s ...googleapi.Field) *SubscriptionsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsDeleteCall) Context(ctx context.Context) *SubscriptionsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions/{+subscription}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "subscription": c.subscription, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.subscriptions.delete" call. +func (c *SubscriptionsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to Pull after deletion will return NOT_FOUND.", + // "httpMethod": "DELETE", + // "id": "pubsub.subscriptions.delete", + // "parameterOrder": [ + // "subscription" + // ], + // "parameters": { + // "subscription": { + // "description": "The subscription to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "subscriptions/{+subscription}", + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.subscriptions.get": + +type SubscriptionsGetCall struct { + s *Service + subscription string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the configuration details of a subscription. +func (r *SubscriptionsService) Get(subscription string) *SubscriptionsGetCall { + c := &SubscriptionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.subscription = subscription + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsGetCall) Fields(s ...googleapi.Field) *SubscriptionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SubscriptionsGetCall) IfNoneMatch(entityTag string) *SubscriptionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsGetCall) Context(ctx context.Context) *SubscriptionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions/{+subscription}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "subscription": c.subscription, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.subscriptions.get" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubscriptionsGetCall) Do() (*Subscription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the configuration details of a subscription.", + // "httpMethod": "GET", + // "id": "pubsub.subscriptions.get", + // "parameterOrder": [ + // "subscription" + // ], + // "parameters": { + // "subscription": { + // "description": "The name of the subscription to get.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "subscriptions/{+subscription}", + // "response": { + // "$ref": "Subscription" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.subscriptions.list": + +type SubscriptionsListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists matching subscriptions. +func (r *SubscriptionsService) List() *SubscriptionsListCall { + c := &SubscriptionsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of subscriptions to return. +func (c *SubscriptionsListCall) MaxResults(maxResults int64) *SubscriptionsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The value obtained +// in the last ListSubscriptionsResponse for continuation. +func (c *SubscriptionsListCall) PageToken(pageToken string) *SubscriptionsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Query sets the optional parameter "query": A valid label query +// expression. +func (c *SubscriptionsListCall) Query(query string) *SubscriptionsListCall { + c.opt_["query"] = query + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsListCall) Fields(s ...googleapi.Field) *SubscriptionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SubscriptionsListCall) IfNoneMatch(entityTag string) *SubscriptionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsListCall) Context(ctx context.Context) *SubscriptionsListCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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_["query"]; ok { + params.Set("query", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.subscriptions.list" call. +// Exactly one of *ListSubscriptionsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListSubscriptionsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SubscriptionsListCall) Do() (*ListSubscriptionsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListSubscriptionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists matching subscriptions.", + // "httpMethod": "GET", + // "id": "pubsub.subscriptions.list", + // "parameters": { + // "maxResults": { + // "description": "Maximum number of subscriptions to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value obtained in the last ListSubscriptionsResponse for continuation.", + // "location": "query", + // "type": "string" + // }, + // "query": { + // "description": "A valid label query expression.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "subscriptions", + // "response": { + // "$ref": "ListSubscriptionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.subscriptions.modifyAckDeadline": + +type SubscriptionsModifyAckDeadlineCall struct { + s *Service + modifyackdeadlinerequest *ModifyAckDeadlineRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// ModifyAckDeadline: Modifies the Ack deadline for a message received +// from a pull request. +func (r *SubscriptionsService) ModifyAckDeadline(modifyackdeadlinerequest *ModifyAckDeadlineRequest) *SubscriptionsModifyAckDeadlineCall { + c := &SubscriptionsModifyAckDeadlineCall{s: r.s, opt_: make(map[string]interface{})} + c.modifyackdeadlinerequest = modifyackdeadlinerequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsModifyAckDeadlineCall) Fields(s ...googleapi.Field) *SubscriptionsModifyAckDeadlineCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsModifyAckDeadlineCall) Context(ctx context.Context) *SubscriptionsModifyAckDeadlineCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsModifyAckDeadlineCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifyackdeadlinerequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions/modifyAckDeadline") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.subscriptions.modifyAckDeadline" call. +func (c *SubscriptionsModifyAckDeadlineCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Modifies the Ack deadline for a message received from a pull request.", + // "httpMethod": "POST", + // "id": "pubsub.subscriptions.modifyAckDeadline", + // "path": "subscriptions/modifyAckDeadline", + // "request": { + // "$ref": "ModifyAckDeadlineRequest" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.subscriptions.modifyPushConfig": + +type SubscriptionsModifyPushConfigCall struct { + s *Service + modifypushconfigrequest *ModifyPushConfigRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// ModifyPushConfig: Modifies the PushConfig for a specified +// subscription. This method can be used to suspend the flow of messages +// to an endpoint by clearing the PushConfig field in the request. +// Messages will be accumulated for delivery even if no push +// configuration is defined or while the configuration is modified. +func (r *SubscriptionsService) ModifyPushConfig(modifypushconfigrequest *ModifyPushConfigRequest) *SubscriptionsModifyPushConfigCall { + c := &SubscriptionsModifyPushConfigCall{s: r.s, opt_: make(map[string]interface{})} + c.modifypushconfigrequest = modifypushconfigrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsModifyPushConfigCall) Fields(s ...googleapi.Field) *SubscriptionsModifyPushConfigCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsModifyPushConfigCall) Context(ctx context.Context) *SubscriptionsModifyPushConfigCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsModifyPushConfigCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifypushconfigrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions/modifyPushConfig") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.subscriptions.modifyPushConfig" call. +func (c *SubscriptionsModifyPushConfigCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Modifies the PushConfig for a specified subscription. This method can be used to suspend the flow of messages to an endpoint by clearing the PushConfig field in the request. Messages will be accumulated for delivery even if no push configuration is defined or while the configuration is modified.", + // "httpMethod": "POST", + // "id": "pubsub.subscriptions.modifyPushConfig", + // "path": "subscriptions/modifyPushConfig", + // "request": { + // "$ref": "ModifyPushConfigRequest" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.subscriptions.pull": + +type SubscriptionsPullCall struct { + s *Service + pullrequest *PullRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Pull: Pulls a single message from the server. If return_immediately +// is true, and no messages are available in the subscription, this +// method returns FAILED_PRECONDITION. The system is free to return an +// UNAVAILABLE error if no messages are available in a reasonable amount +// of time (to reduce system load). +func (r *SubscriptionsService) Pull(pullrequest *PullRequest) *SubscriptionsPullCall { + c := &SubscriptionsPullCall{s: r.s, opt_: make(map[string]interface{})} + c.pullrequest = pullrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsPullCall) Fields(s ...googleapi.Field) *SubscriptionsPullCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsPullCall) Context(ctx context.Context) *SubscriptionsPullCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsPullCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.pullrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions/pull") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.subscriptions.pull" call. +// Exactly one of *PullResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PullResponse.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubscriptionsPullCall) Do() (*PullResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PullResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Pulls a single message from the server. If return_immediately is true, and no messages are available in the subscription, this method returns FAILED_PRECONDITION. The system is free to return an UNAVAILABLE error if no messages are available in a reasonable amount of time (to reduce system load).", + // "httpMethod": "POST", + // "id": "pubsub.subscriptions.pull", + // "path": "subscriptions/pull", + // "request": { + // "$ref": "PullRequest" + // }, + // "response": { + // "$ref": "PullResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.subscriptions.pullBatch": + +type SubscriptionsPullBatchCall struct { + s *Service + pullbatchrequest *PullBatchRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// PullBatch: Pulls messages from the server. Returns an empty list if +// there are no messages available in the backlog. The system is free to +// return UNAVAILABLE if there are too many pull requests outstanding +// for the given subscription. +func (r *SubscriptionsService) PullBatch(pullbatchrequest *PullBatchRequest) *SubscriptionsPullBatchCall { + c := &SubscriptionsPullBatchCall{s: r.s, opt_: make(map[string]interface{})} + c.pullbatchrequest = pullbatchrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsPullBatchCall) Fields(s ...googleapi.Field) *SubscriptionsPullBatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsPullBatchCall) Context(ctx context.Context) *SubscriptionsPullBatchCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsPullBatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.pullbatchrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions/pullBatch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.subscriptions.pullBatch" call. +// Exactly one of *PullBatchResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PullBatchResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SubscriptionsPullBatchCall) Do() (*PullBatchResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PullBatchResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Pulls messages from the server. Returns an empty list if there are no messages available in the backlog. The system is free to return UNAVAILABLE if there are too many pull requests outstanding for the given subscription.", + // "httpMethod": "POST", + // "id": "pubsub.subscriptions.pullBatch", + // "path": "subscriptions/pullBatch", + // "request": { + // "$ref": "PullBatchRequest" + // }, + // "response": { + // "$ref": "PullBatchResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.topics.create": + +type TopicsCreateCall struct { + s *Service + topic *Topic + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates the given topic with the given name. +func (r *TopicsService) Create(topic *Topic) *TopicsCreateCall { + c := &TopicsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.topic = topic + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TopicsCreateCall) Fields(s ...googleapi.Field) *TopicsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TopicsCreateCall) Context(ctx context.Context) *TopicsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *TopicsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.topic) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "topics") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.topics.create" call. +// Exactly one of *Topic or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Topic.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TopicsCreateCall) Do() (*Topic, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Topic{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates the given topic with the given name.", + // "httpMethod": "POST", + // "id": "pubsub.topics.create", + // "path": "topics", + // "request": { + // "$ref": "Topic" + // }, + // "response": { + // "$ref": "Topic" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.topics.delete": + +type TopicsDeleteCall struct { + s *Service + topic string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the topic with the given name. Returns NOT_FOUND if +// the topic does not exist. After a topic is deleted, a new topic may +// be created with the same name. +func (r *TopicsService) Delete(topic string) *TopicsDeleteCall { + c := &TopicsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.topic = topic + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TopicsDeleteCall) Fields(s ...googleapi.Field) *TopicsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TopicsDeleteCall) Context(ctx context.Context) *TopicsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TopicsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "topics/{+topic}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "topic": c.topic, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.topics.delete" call. +func (c *TopicsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes the topic with the given name. Returns NOT_FOUND if the topic does not exist. After a topic is deleted, a new topic may be created with the same name.", + // "httpMethod": "DELETE", + // "id": "pubsub.topics.delete", + // "parameterOrder": [ + // "topic" + // ], + // "parameters": { + // "topic": { + // "description": "Name of the topic to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "topics/{+topic}", + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.topics.get": + +type TopicsGetCall struct { + s *Service + topic string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the configuration of a topic. Since the topic only has the +// name attribute, this method is only useful to check the existence of +// a topic. If other attributes are added in the future, they will be +// returned here. +func (r *TopicsService) Get(topic string) *TopicsGetCall { + c := &TopicsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.topic = topic + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TopicsGetCall) Fields(s ...googleapi.Field) *TopicsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TopicsGetCall) IfNoneMatch(entityTag string) *TopicsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TopicsGetCall) Context(ctx context.Context) *TopicsGetCall { + c.ctx_ = ctx + return c +} + +func (c *TopicsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "topics/{+topic}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "topic": c.topic, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.topics.get" call. +// Exactly one of *Topic or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Topic.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TopicsGetCall) Do() (*Topic, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Topic{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the configuration of a topic. Since the topic only has the name attribute, this method is only useful to check the existence of a topic. If other attributes are added in the future, they will be returned here.", + // "httpMethod": "GET", + // "id": "pubsub.topics.get", + // "parameterOrder": [ + // "topic" + // ], + // "parameters": { + // "topic": { + // "description": "The name of the topic to get.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "topics/{+topic}", + // "response": { + // "$ref": "Topic" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.topics.list": + +type TopicsListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists matching topics. +func (r *TopicsService) List() *TopicsListCall { + c := &TopicsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of topics to return. +func (c *TopicsListCall) MaxResults(maxResults int64) *TopicsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The value obtained +// in the last ListTopicsResponse for continuation. +func (c *TopicsListCall) PageToken(pageToken string) *TopicsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Query sets the optional parameter "query": A valid label query +// expression. +func (c *TopicsListCall) Query(query string) *TopicsListCall { + c.opt_["query"] = query + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TopicsListCall) Fields(s ...googleapi.Field) *TopicsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TopicsListCall) IfNoneMatch(entityTag string) *TopicsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TopicsListCall) Context(ctx context.Context) *TopicsListCall { + c.ctx_ = ctx + return c +} + +func (c *TopicsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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_["query"]; ok { + params.Set("query", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "topics") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.topics.list" call. +// Exactly one of *ListTopicsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListTopicsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TopicsListCall) Do() (*ListTopicsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListTopicsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists matching topics.", + // "httpMethod": "GET", + // "id": "pubsub.topics.list", + // "parameters": { + // "maxResults": { + // "description": "Maximum number of topics to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value obtained in the last ListTopicsResponse for continuation.", + // "location": "query", + // "type": "string" + // }, + // "query": { + // "description": "A valid label query expression.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "topics", + // "response": { + // "$ref": "ListTopicsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.topics.publish": + +type TopicsPublishCall struct { + s *Service + publishrequest *PublishRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Publish: Adds a message to the topic. Returns NOT_FOUND if the topic +// does not exist. +func (r *TopicsService) Publish(publishrequest *PublishRequest) *TopicsPublishCall { + c := &TopicsPublishCall{s: r.s, opt_: make(map[string]interface{})} + c.publishrequest = publishrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TopicsPublishCall) Fields(s ...googleapi.Field) *TopicsPublishCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TopicsPublishCall) Context(ctx context.Context) *TopicsPublishCall { + c.ctx_ = ctx + return c +} + +func (c *TopicsPublishCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.publishrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "topics/publish") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.topics.publish" call. +func (c *TopicsPublishCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Adds a message to the topic. Returns NOT_FOUND if the topic does not exist.", + // "httpMethod": "POST", + // "id": "pubsub.topics.publish", + // "path": "topics/publish", + // "request": { + // "$ref": "PublishRequest" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.topics.publishBatch": + +type TopicsPublishBatchCall struct { + s *Service + publishbatchrequest *PublishBatchRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// PublishBatch: Adds one or more messages to the topic. Returns +// NOT_FOUND if the topic does not exist. +func (r *TopicsService) PublishBatch(publishbatchrequest *PublishBatchRequest) *TopicsPublishBatchCall { + c := &TopicsPublishBatchCall{s: r.s, opt_: make(map[string]interface{})} + c.publishbatchrequest = publishbatchrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TopicsPublishBatchCall) Fields(s ...googleapi.Field) *TopicsPublishBatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TopicsPublishBatchCall) Context(ctx context.Context) *TopicsPublishBatchCall { + c.ctx_ = ctx + return c +} + +func (c *TopicsPublishBatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.publishbatchrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "topics/publishBatch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.topics.publishBatch" call. +// Exactly one of *PublishBatchResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PublishBatchResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TopicsPublishBatchCall) Do() (*PublishBatchResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PublishBatchResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds one or more messages to the topic. Returns NOT_FOUND if the topic does not exist.", + // "httpMethod": "POST", + // "id": "pubsub.topics.publishBatch", + // "path": "topics/publishBatch", + // "request": { + // "$ref": "PublishBatchRequest" + // }, + // "response": { + // "$ref": "PublishBatchResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/pubsub/v1beta1a/pubsub-api.json b/Godeps/_workspace/src/google.golang.org/api/pubsub/v1beta1a/pubsub-api.json new file mode 100644 index 000000000..541bfb61c --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/pubsub/v1beta1a/pubsub-api.json @@ -0,0 +1,757 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/QdYDjcUqG0q-JcD5cct0JnvA9Ps\"", + "discoveryVersion": "v1", + "id": "pubsub:v1beta1a", + "name": "pubsub", + "version": "v1beta1a", + "revision": "20150427", + "title": "Google Cloud Pub/Sub API", + "description": "Provides reliable, many-to-many, asynchronous messaging between applications.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/pubsub/docs", + "protocol": "rest", + "baseUrl": "https://pubsub.googleapis.com/", + "basePath": "/", + "rootUrl": "https://pubsub.googleapis.com/", + "servicePath": "", + "batchPath": "batch", + "parameters": { + "access_token": { + "type": "string", + "description": "OAuth access token.", + "location": "query" + }, + "alt": { + "type": "string", + "description": "Data format for response.", + "default": "json", + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query" + }, + "bearer_token": { + "type": "string", + "description": "OAuth bearer token.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JSONP", + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "pp": { + "type": "boolean", + "description": "Pretty-print response.", + "default": "true", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query" + }, + "upload_protocol": { + "type": "string", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query" + }, + "uploadType": { + "type": "string", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query" + }, + "$.xgafv": { + "type": "string", + "description": "V1 error format.", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/pubsub": { + "description": "View and manage Pub/Sub topics and subscriptions" + } + } + } + }, + "schemas": { + "Topic": { + "id": "Topic", + "type": "object", + "description": "A topic resource.", + "properties": { + "name": { + "type": "string", + "description": "Name of the topic." + } + } + }, + "PublishRequest": { + "id": "PublishRequest", + "type": "object", + "description": "Request for the Publish method.", + "properties": { + "topic": { + "type": "string", + "description": "The message in the request will be published on this topic." + }, + "message": { + "$ref": "PubsubMessage", + "description": "The message to publish." + } + } + }, + "PubsubMessage": { + "id": "PubsubMessage", + "type": "object", + "description": "A message data and its labels.", + "properties": { + "data": { + "type": "string", + "description": "The message payload.", + "format": "byte" + }, + "label": { + "type": "array", + "description": "Optional list of labels for this message. Keys in this collection must be unique.", + "items": { + "$ref": "Label" + } + }, + "messageId": { + "type": "string", + "description": "ID of this message assigned by the server at publication time. Guaranteed to be unique within the topic. This value may be read by a subscriber that receives a PubsubMessage via a Pull call or a push delivery. It must not be populated by a publisher in a Publish call." + } + } + }, + "Label": { + "id": "Label", + "type": "object", + "description": "A key-value pair applied to a given object.", + "properties": { + "key": { + "type": "string", + "description": "The key of a label is a syntactically valid URL (as per RFC 1738) with the \"scheme\" and initial slashes omitted and with the additional restrictions noted below. Each key should be globally unique. The \"host\" portion is called the \"namespace\" and is not necessarily resolvable to a network endpoint. Instead, the namespace indicates what system or entity defines the semantics of the label. Namespaces do not restrict the set of objects to which a label may be associated. Keys are defined by the following grammar: key = hostname \"/\" kpath kpath = ksegment *[ \"/\" ksegment ] ksegment = alphadigit | *[ alphadigit | \"-\" | \"_\" | \".\" ] where \"hostname\" and \"alphadigit\" are defined as in RFC 1738. Example key: spanner.google.com/universe" + }, + "strValue": { + "type": "string", + "description": "A string value." + }, + "numValue": { + "type": "string", + "description": "An integer value.", + "format": "int64" + } + } + }, + "Empty": { + "id": "Empty", + "type": "object", + "description": "An empty message that you can re-use to avoid defining duplicated empty messages in your project. A typical example is to use it as argument or the return value of a service API. For instance: service Foo { rpc Bar (proto2.Empty) returns (proto2.Empty) { }; }; BEGIN GOOGLE-INTERNAL The difference between this one and net/rpc/empty-message.proto is that 1) The generated message here is in proto2 C++ API. 2) The proto2.Empty has minimum dependencies (no message_set or net/rpc dependencies) END GOOGLE-INTERNAL" + }, + "PublishBatchRequest": { + "id": "PublishBatchRequest", + "type": "object", + "description": "Request for the PublishBatch method.", + "properties": { + "topic": { + "type": "string", + "description": "The messages in the request will be published on this topic." + }, + "messages": { + "type": "array", + "description": "The messages to publish.", + "items": { + "$ref": "PubsubMessage" + } + } + } + }, + "PublishBatchResponse": { + "id": "PublishBatchResponse", + "type": "object", + "description": "Response for the PublishBatch method.", + "properties": { + "messageIds": { + "type": "array", + "description": "The server-assigned ID of each published message, in the same order as the messages in the request. IDs are guaranteed to be unique within the topic.", + "items": { + "type": "string" + } + } + } + }, + "ListTopicsResponse": { + "id": "ListTopicsResponse", + "type": "object", + "description": "Response for the ListTopics method.", + "properties": { + "topic": { + "type": "array", + "description": "The resulting topics.", + "items": { + "$ref": "Topic" + } + }, + "nextPageToken": { + "type": "string", + "description": "If not empty, indicates that there are more topics that match the request, and this value should be passed to the next ListTopicsRequest to continue." + } + } + }, + "Subscription": { + "id": "Subscription", + "type": "object", + "description": "A subscription resource.", + "properties": { + "name": { + "type": "string", + "description": "Name of the subscription." + }, + "topic": { + "type": "string", + "description": "The name of the topic from which this subscription is receiving messages." + }, + "pushConfig": { + "$ref": "PushConfig", + "description": "If push delivery is used with this subscription, this field is used to configure it." + }, + "ackDeadlineSeconds": { + "type": "integer", + "description": "For either push or pull delivery, the value is the maximum time after a subscriber receives a message before the subscriber should acknowledge or Nack the message. If the Ack deadline for a message passes without an Ack or a Nack, the Pub/Sub system will eventually redeliver the message. If a subscriber acknowledges after the deadline, the Pub/Sub system may accept the Ack, but it is possible that the message has been already delivered again. Multiple Acks to the message are allowed and will succeed. For push delivery, this value is used to set the request timeout for the call to the push endpoint. For pull delivery, this value is used as the initial value for the Ack deadline. It may be overridden for each message using its corresponding ack_id with ModifyAckDeadline. While a message is outstanding (i.e. it has been delivered to a pull subscriber and the subscriber has not yet Acked or Nacked), the Pub/Sub system will not deliver that message to another pull subscriber (on a best-effort basis).", + "format": "int32" + } + } + }, + "PushConfig": { + "id": "PushConfig", + "type": "object", + "description": "Configuration for a push delivery endpoint.", + "properties": { + "pushEndpoint": { + "type": "string", + "description": "A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use \"https://example.com/push\"." + } + } + }, + "ListSubscriptionsResponse": { + "id": "ListSubscriptionsResponse", + "type": "object", + "description": "Response for the ListSubscriptions method.", + "properties": { + "subscription": { + "type": "array", + "description": "The subscriptions that match the request.", + "items": { + "$ref": "Subscription" + } + }, + "nextPageToken": { + "type": "string", + "description": "If not empty, indicates that there are more subscriptions that match the request and this value should be passed to the next ListSubscriptionsRequest to continue." + } + } + }, + "ModifyPushConfigRequest": { + "id": "ModifyPushConfigRequest", + "type": "object", + "description": "Request for the ModifyPushConfig method.", + "properties": { + "subscription": { + "type": "string", + "description": "The name of the subscription." + }, + "pushConfig": { + "$ref": "PushConfig", + "description": "An empty push_config indicates that the Pub/Sub system should pause pushing messages from the given subscription." + } + } + }, + "PullRequest": { + "id": "PullRequest", + "type": "object", + "description": "Request for the Pull method.", + "properties": { + "subscription": { + "type": "string", + "description": "The subscription from which a message should be pulled." + }, + "returnImmediately": { + "type": "boolean", + "description": "If this is specified as true the system will respond immediately even if it is not able to return a message in the Pull response. Otherwise the system is allowed to wait until at least one message is available rather than returning FAILED_PRECONDITION. The client may cancel the request if it does not wish to wait any longer for the response." + } + } + }, + "PullResponse": { + "id": "PullResponse", + "type": "object", + "description": "Either a PubsubMessage or a truncation event. One of these two must be populated.", + "properties": { + "ackId": { + "type": "string", + "description": "This ID must be used to acknowledge the received event or message." + }, + "pubsubEvent": { + "$ref": "PubsubEvent", + "description": "A pubsub message or truncation event." + } + } + }, + "PubsubEvent": { + "id": "PubsubEvent", + "type": "object", + "description": "An event indicating a received message or truncation event.", + "properties": { + "subscription": { + "type": "string", + "description": "The subscription that received the event." + }, + "message": { + "$ref": "PubsubMessage", + "description": "A received message." + }, + "truncated": { + "type": "boolean", + "description": "Indicates that this subscription has been truncated." + }, + "deleted": { + "type": "boolean", + "description": "Indicates that this subscription has been deleted. (Note that pull subscribers will always receive NOT_FOUND in response in their pull request on the subscription, rather than seeing this boolean.)" + } + } + }, + "PullBatchRequest": { + "id": "PullBatchRequest", + "type": "object", + "description": "Request for the PullBatch method.", + "properties": { + "subscription": { + "type": "string", + "description": "The subscription from which messages should be pulled." + }, + "returnImmediately": { + "type": "boolean", + "description": "If this is specified as true the system will respond immediately even if it is not able to return a message in the Pull response. Otherwise the system is allowed to wait until at least one message is available rather than returning no messages. The client may cancel the request if it does not wish to wait any longer for the response." + }, + "maxEvents": { + "type": "integer", + "description": "The maximum number of PubsubEvents returned for this request. The Pub/Sub system may return fewer than the number of events specified.", + "format": "int32" + } + } + }, + "PullBatchResponse": { + "id": "PullBatchResponse", + "type": "object", + "description": "Response for the PullBatch method.", + "properties": { + "pullResponses": { + "type": "array", + "description": "Received Pub/Sub messages or status events. The Pub/Sub system will return zero messages if there are no more messages available in the backlog. The Pub/Sub system may return fewer than the max_events requested even if there are more messages available in the backlog.", + "items": { + "$ref": "PullResponse" + } + } + } + }, + "ModifyAckDeadlineRequest": { + "id": "ModifyAckDeadlineRequest", + "type": "object", + "description": "Request for the ModifyAckDeadline method.", + "properties": { + "subscription": { + "type": "string", + "description": "Next Index: 5 The name of the subscription from which messages are being pulled." + }, + "ackId": { + "type": "string", + "description": "The acknowledgment ID. Either this or ack_ids must be populated, not both." + }, + "ackIds": { + "type": "array", + "description": "List of acknowledgment IDs. Either this field or ack_id should be populated, not both.", + "items": { + "type": "string" + } + }, + "ackDeadlineSeconds": { + "type": "integer", + "description": "The new ack deadline with respect to the time this request was sent to the Pub/Sub system. Must be \u003e= 0. For example, if the value is 10, the new ack deadline will expire 10 seconds after the ModifyAckDeadline call was made. Specifying zero may immediately make the message available for another pull request.", + "format": "int32" + } + } + }, + "AcknowledgeRequest": { + "id": "AcknowledgeRequest", + "type": "object", + "description": "Request for the Acknowledge method.", + "properties": { + "subscription": { + "type": "string", + "description": "The subscription whose message is being acknowledged." + }, + "ackId": { + "type": "array", + "description": "The acknowledgment ID for the message being acknowledged. This was returned by the Pub/Sub system in the Pull response.", + "items": { + "type": "string" + } + } + } + } + }, + "resources": { + "topics": { + "methods": { + "create": { + "id": "pubsub.topics.create", + "path": "v1beta1a/topics", + "httpMethod": "POST", + "description": "Creates the given topic with the given name.", + "request": { + "$ref": "Topic" + }, + "response": { + "$ref": "Topic" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "publish": { + "id": "pubsub.topics.publish", + "path": "v1beta1a/topics/publish", + "httpMethod": "POST", + "description": "Adds a message to the topic. Returns NOT_FOUND if the topic does not exist.", + "request": { + "$ref": "PublishRequest" + }, + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "publishBatch": { + "id": "pubsub.topics.publishBatch", + "path": "v1beta1a/topics/publishBatch", + "httpMethod": "POST", + "description": "Adds one or more messages to the topic. Returns NOT_FOUND if the topic does not exist.", + "request": { + "$ref": "PublishBatchRequest" + }, + "response": { + "$ref": "PublishBatchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "get": { + "id": "pubsub.topics.get", + "path": "v1beta1a/topics/{+topic}", + "httpMethod": "GET", + "description": "Gets the configuration of a topic. Since the topic only has the name attribute, this method is only useful to check the existence of a topic. If other attributes are added in the future, they will be returned here.", + "parameters": { + "topic": { + "type": "string", + "description": "The name of the topic to get.", + "required": true, + "pattern": "^.*$", + "location": "path" + } + }, + "parameterOrder": [ + "topic" + ], + "response": { + "$ref": "Topic" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "list": { + "id": "pubsub.topics.list", + "path": "v1beta1a/topics", + "httpMethod": "GET", + "description": "Lists matching topics.", + "parameters": { + "query": { + "type": "string", + "description": "A valid label query expression.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of topics to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value obtained in the last ListTopicsResponse for continuation.", + "location": "query" + } + }, + "response": { + "$ref": "ListTopicsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "delete": { + "id": "pubsub.topics.delete", + "path": "v1beta1a/topics/{+topic}", + "httpMethod": "DELETE", + "description": "Deletes the topic with the given name. Returns NOT_FOUND if the topic does not exist. After a topic is deleted, a new topic may be created with the same name.", + "parameters": { + "topic": { + "type": "string", + "description": "Name of the topic to delete.", + "required": true, + "pattern": "^.*$", + "location": "path" + } + }, + "parameterOrder": [ + "topic" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + } + } + }, + "subscriptions": { + "methods": { + "create": { + "id": "pubsub.subscriptions.create", + "path": "v1beta1a/subscriptions", + "httpMethod": "POST", + "description": "Creates a subscription on a given topic for a given subscriber. If the subscription already exists, returns ALREADY_EXISTS. If the corresponding topic doesn't exist, returns NOT_FOUND. If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic.", + "request": { + "$ref": "Subscription" + }, + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "get": { + "id": "pubsub.subscriptions.get", + "path": "v1beta1a/subscriptions/{+subscription}", + "httpMethod": "GET", + "description": "Gets the configuration details of a subscription.", + "parameters": { + "subscription": { + "type": "string", + "description": "The name of the subscription to get.", + "required": true, + "pattern": "^.*$", + "location": "path" + } + }, + "parameterOrder": [ + "subscription" + ], + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "list": { + "id": "pubsub.subscriptions.list", + "path": "v1beta1a/subscriptions", + "httpMethod": "GET", + "description": "Lists matching subscriptions.", + "parameters": { + "query": { + "type": "string", + "description": "A valid label query expression.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of subscriptions to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value obtained in the last ListSubscriptionsResponse for continuation.", + "location": "query" + } + }, + "response": { + "$ref": "ListSubscriptionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "delete": { + "id": "pubsub.subscriptions.delete", + "path": "v1beta1a/subscriptions/{+subscription}", + "httpMethod": "DELETE", + "description": "Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to Pull after deletion will return NOT_FOUND.", + "parameters": { + "subscription": { + "type": "string", + "description": "The subscription to delete.", + "required": true, + "pattern": "^.*$", + "location": "path" + } + }, + "parameterOrder": [ + "subscription" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "modifyPushConfig": { + "id": "pubsub.subscriptions.modifyPushConfig", + "path": "v1beta1a/subscriptions/modifyPushConfig", + "httpMethod": "POST", + "description": "Modifies the PushConfig for a specified subscription. This method can be used to suspend the flow of messages to an endpoint by clearing the PushConfig field in the request. Messages will be accumulated for delivery even if no push configuration is defined or while the configuration is modified.", + "request": { + "$ref": "ModifyPushConfigRequest" + }, + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "pull": { + "id": "pubsub.subscriptions.pull", + "path": "v1beta1a/subscriptions/pull", + "httpMethod": "POST", + "description": "Pulls a single message from the server. If return_immediately is true, and no messages are available in the subscription, this method returns FAILED_PRECONDITION. The system is free to return an UNAVAILABLE error if no messages are available in a reasonable amount of time (to reduce system load).", + "request": { + "$ref": "PullRequest" + }, + "response": { + "$ref": "PullResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "pullBatch": { + "id": "pubsub.subscriptions.pullBatch", + "path": "v1beta1a/subscriptions/pullBatch", + "httpMethod": "POST", + "description": "Pulls messages from the server. Returns an empty list if there are no messages available in the backlog. The system is free to return UNAVAILABLE if there are too many pull requests outstanding for the given subscription.", + "request": { + "$ref": "PullBatchRequest" + }, + "response": { + "$ref": "PullBatchResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "modifyAckDeadline": { + "id": "pubsub.subscriptions.modifyAckDeadline", + "path": "v1beta1a/subscriptions/modifyAckDeadline", + "httpMethod": "POST", + "description": "Modifies the Ack deadline for a message received from a pull request.", + "request": { + "$ref": "ModifyAckDeadlineRequest" + }, + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "acknowledge": { + "id": "pubsub.subscriptions.acknowledge", + "path": "v1beta1a/subscriptions/acknowledge", + "httpMethod": "POST", + "description": "Acknowledges a particular received message: the Pub/Sub system can remove the given message from the subscription. Acknowledging a message whose Ack deadline has expired may succeed, but the message could have been already redelivered. Acknowledging a message more than once will not result in an error. This is only used for messages received via pull.", + "request": { + "$ref": "AcknowledgeRequest" + }, + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/pubsub/v1beta1a/pubsub-gen.go b/Godeps/_workspace/src/google.golang.org/api/pubsub/v1beta1a/pubsub-gen.go new file mode 100644 index 000000000..598daab4c --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/pubsub/v1beta1a/pubsub-gen.go @@ -0,0 +1,2469 @@ +// Package pubsub provides access to the Google Cloud Pub/Sub API. +// +// See https://cloud.google.com/pubsub/docs +// +// Usage example: +// +// import "google.golang.org/api/pubsub/v1beta1a" +// ... +// pubsubService, err := pubsub.New(oauthHttpClient) +package pubsub // import "google.golang.org/api/pubsub/v1beta1a" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "pubsub:v1beta1a" +const apiName = "pubsub" +const apiVersion = "v1beta1a" +const basePath = "https://pubsub.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your data across Google Cloud Platform services + CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" + + // View and manage Pub/Sub topics and subscriptions + PubsubScope = "https://www.googleapis.com/auth/pubsub" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Subscriptions = NewSubscriptionsService(s) + s.Topics = NewTopicsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Subscriptions *SubscriptionsService + + Topics *TopicsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewSubscriptionsService(s *Service) *SubscriptionsService { + rs := &SubscriptionsService{s: s} + return rs +} + +type SubscriptionsService struct { + s *Service +} + +func NewTopicsService(s *Service) *TopicsService { + rs := &TopicsService{s: s} + return rs +} + +type TopicsService struct { + s *Service +} + +// AcknowledgeRequest: Request for the Acknowledge method. +type AcknowledgeRequest struct { + // AckId: The acknowledgment ID for the message being acknowledged. This + // was returned by the Pub/Sub system in the Pull response. + AckId []string `json:"ackId,omitempty"` + + // Subscription: The subscription whose message is being acknowledged. + Subscription string `json:"subscription,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AckId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AcknowledgeRequest) MarshalJSON() ([]byte, error) { + type noMethod AcknowledgeRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Empty: An empty message that you can re-use to avoid defining +// duplicated empty messages in your project. A typical example is to +// use it as argument or the return value of a service API. For +// instance: service Foo { rpc Bar (proto2.Empty) returns (proto2.Empty) +// { }; }; BEGIN GOOGLE-INTERNAL The difference between this one and +// net/rpc/empty-message.proto is that 1) The generated message here is +// in proto2 C++ API. 2) The proto2.Empty has minimum dependencies (no +// message_set or net/rpc dependencies) END GOOGLE-INTERNAL +type Empty struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// Label: A key-value pair applied to a given object. +type Label struct { + // Key: The key of a label is a syntactically valid URL (as per RFC + // 1738) with the "scheme" and initial slashes omitted and with the + // additional restrictions noted below. Each key should be globally + // unique. The "host" portion is called the "namespace" and is not + // necessarily resolvable to a network endpoint. Instead, the namespace + // indicates what system or entity defines the semantics of the label. + // Namespaces do not restrict the set of objects to which a label may be + // associated. Keys are defined by the following grammar: key = hostname + // "/" kpath kpath = ksegment *[ "/" ksegment ] ksegment = alphadigit | + // *[ alphadigit | "-" | "_" | "." ] where "hostname" and "alphadigit" + // are defined as in RFC 1738. Example key: spanner.google.com/universe + Key string `json:"key,omitempty"` + + // NumValue: An integer value. + NumValue int64 `json:"numValue,omitempty,string"` + + // StrValue: A string value. + StrValue string `json:"strValue,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Label) MarshalJSON() ([]byte, error) { + type noMethod Label + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListSubscriptionsResponse: Response for the ListSubscriptions method. +type ListSubscriptionsResponse struct { + // NextPageToken: If not empty, indicates that there are more + // subscriptions that match the request and this value should be passed + // to the next ListSubscriptionsRequest to continue. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Subscription: The subscriptions that match the request. + Subscription []*Subscription `json:"subscription,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListSubscriptionsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListSubscriptionsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListTopicsResponse: Response for the ListTopics method. +type ListTopicsResponse struct { + // NextPageToken: If not empty, indicates that there are more topics + // that match the request, and this value should be passed to the next + // ListTopicsRequest to continue. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Topic: The resulting topics. + Topic []*Topic `json:"topic,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListTopicsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListTopicsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ModifyAckDeadlineRequest: Request for the ModifyAckDeadline method. +type ModifyAckDeadlineRequest struct { + // AckDeadlineSeconds: The new ack deadline with respect to the time + // this request was sent to the Pub/Sub system. Must be >= 0. For + // example, if the value is 10, the new ack deadline will expire 10 + // seconds after the ModifyAckDeadline call was made. Specifying zero + // may immediately make the message available for another pull request. + AckDeadlineSeconds int64 `json:"ackDeadlineSeconds,omitempty"` + + // AckId: The acknowledgment ID. Either this or ack_ids must be + // populated, not both. + AckId string `json:"ackId,omitempty"` + + // AckIds: List of acknowledgment IDs. Either this field or ack_id + // should be populated, not both. + AckIds []string `json:"ackIds,omitempty"` + + // Subscription: Next Index: 5 The name of the subscription from which + // messages are being pulled. + Subscription string `json:"subscription,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AckDeadlineSeconds") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ModifyAckDeadlineRequest) MarshalJSON() ([]byte, error) { + type noMethod ModifyAckDeadlineRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ModifyPushConfigRequest: Request for the ModifyPushConfig method. +type ModifyPushConfigRequest struct { + // PushConfig: An empty push_config indicates that the Pub/Sub system + // should pause pushing messages from the given subscription. + PushConfig *PushConfig `json:"pushConfig,omitempty"` + + // Subscription: The name of the subscription. + Subscription string `json:"subscription,omitempty"` + + // ForceSendFields is a list of field names (e.g. "PushConfig") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ModifyPushConfigRequest) MarshalJSON() ([]byte, error) { + type noMethod ModifyPushConfigRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PublishBatchRequest: Request for the PublishBatch method. +type PublishBatchRequest struct { + // Messages: The messages to publish. + Messages []*PubsubMessage `json:"messages,omitempty"` + + // Topic: The messages in the request will be published on this topic. + Topic string `json:"topic,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Messages") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PublishBatchRequest) MarshalJSON() ([]byte, error) { + type noMethod PublishBatchRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PublishBatchResponse: Response for the PublishBatch method. +type PublishBatchResponse struct { + // MessageIds: The server-assigned ID of each published message, in the + // same order as the messages in the request. IDs are guaranteed to be + // unique within the topic. + MessageIds []string `json:"messageIds,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "MessageIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PublishBatchResponse) MarshalJSON() ([]byte, error) { + type noMethod PublishBatchResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PublishRequest: Request for the Publish method. +type PublishRequest struct { + // Message: The message to publish. + Message *PubsubMessage `json:"message,omitempty"` + + // Topic: The message in the request will be published on this topic. + Topic string `json:"topic,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Message") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PublishRequest) MarshalJSON() ([]byte, error) { + type noMethod PublishRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PubsubEvent: An event indicating a received message or truncation +// event. +type PubsubEvent struct { + // Deleted: Indicates that this subscription has been deleted. (Note + // that pull subscribers will always receive NOT_FOUND in response in + // their pull request on the subscription, rather than seeing this + // boolean.) + Deleted bool `json:"deleted,omitempty"` + + // Message: A received message. + Message *PubsubMessage `json:"message,omitempty"` + + // Subscription: The subscription that received the event. + Subscription string `json:"subscription,omitempty"` + + // Truncated: Indicates that this subscription has been truncated. + Truncated bool `json:"truncated,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Deleted") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PubsubEvent) MarshalJSON() ([]byte, error) { + type noMethod PubsubEvent + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PubsubMessage: A message data and its labels. +type PubsubMessage struct { + // Data: The message payload. + Data string `json:"data,omitempty"` + + // Label: Optional list of labels for this message. Keys in this + // collection must be unique. + Label []*Label `json:"label,omitempty"` + + // MessageId: ID of this message assigned by the server at publication + // time. Guaranteed to be unique within the topic. This value may be + // read by a subscriber that receives a PubsubMessage via a Pull call or + // a push delivery. It must not be populated by a publisher in a Publish + // call. + MessageId string `json:"messageId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Data") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PubsubMessage) MarshalJSON() ([]byte, error) { + type noMethod PubsubMessage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PullBatchRequest: Request for the PullBatch method. +type PullBatchRequest struct { + // MaxEvents: The maximum number of PubsubEvents returned for this + // request. The Pub/Sub system may return fewer than the number of + // events specified. + MaxEvents int64 `json:"maxEvents,omitempty"` + + // ReturnImmediately: If this is specified as true the system will + // respond immediately even if it is not able to return a message in the + // Pull response. Otherwise the system is allowed to wait until at least + // one message is available rather than returning no messages. The + // client may cancel the request if it does not wish to wait any longer + // for the response. + ReturnImmediately bool `json:"returnImmediately,omitempty"` + + // Subscription: The subscription from which messages should be pulled. + Subscription string `json:"subscription,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MaxEvents") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PullBatchRequest) MarshalJSON() ([]byte, error) { + type noMethod PullBatchRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PullBatchResponse: Response for the PullBatch method. +type PullBatchResponse struct { + // PullResponses: Received Pub/Sub messages or status events. The + // Pub/Sub system will return zero messages if there are no more + // messages available in the backlog. The Pub/Sub system may return + // fewer than the max_events requested even if there are more messages + // available in the backlog. + PullResponses []*PullResponse `json:"pullResponses,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "PullResponses") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PullBatchResponse) MarshalJSON() ([]byte, error) { + type noMethod PullBatchResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PullRequest: Request for the Pull method. +type PullRequest struct { + // ReturnImmediately: If this is specified as true the system will + // respond immediately even if it is not able to return a message in the + // Pull response. Otherwise the system is allowed to wait until at least + // one message is available rather than returning FAILED_PRECONDITION. + // The client may cancel the request if it does not wish to wait any + // longer for the response. + ReturnImmediately bool `json:"returnImmediately,omitempty"` + + // Subscription: The subscription from which a message should be pulled. + Subscription string `json:"subscription,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ReturnImmediately") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PullRequest) MarshalJSON() ([]byte, error) { + type noMethod PullRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PullResponse: Either a PubsubMessage or a truncation event. One of +// these two must be populated. +type PullResponse struct { + // AckId: This ID must be used to acknowledge the received event or + // message. + AckId string `json:"ackId,omitempty"` + + // PubsubEvent: A pubsub message or truncation event. + PubsubEvent *PubsubEvent `json:"pubsubEvent,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AckId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PullResponse) MarshalJSON() ([]byte, error) { + type noMethod PullResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PushConfig: Configuration for a push delivery endpoint. +type PushConfig struct { + // PushEndpoint: A URL locating the endpoint to which messages should be + // pushed. For example, a Webhook endpoint might use + // "https://example.com/push". + PushEndpoint string `json:"pushEndpoint,omitempty"` + + // ForceSendFields is a list of field names (e.g. "PushEndpoint") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PushConfig) MarshalJSON() ([]byte, error) { + type noMethod PushConfig + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Subscription: A subscription resource. +type Subscription struct { + // AckDeadlineSeconds: For either push or pull delivery, the value is + // the maximum time after a subscriber receives a message before the + // subscriber should acknowledge or Nack the message. If the Ack + // deadline for a message passes without an Ack or a Nack, the Pub/Sub + // system will eventually redeliver the message. If a subscriber + // acknowledges after the deadline, the Pub/Sub system may accept the + // Ack, but it is possible that the message has been already delivered + // again. Multiple Acks to the message are allowed and will succeed. For + // push delivery, this value is used to set the request timeout for the + // call to the push endpoint. For pull delivery, this value is used as + // the initial value for the Ack deadline. It may be overridden for each + // message using its corresponding ack_id with ModifyAckDeadline. While + // a message is outstanding (i.e. it has been delivered to a pull + // subscriber and the subscriber has not yet Acked or Nacked), the + // Pub/Sub system will not deliver that message to another pull + // subscriber (on a best-effort basis). + AckDeadlineSeconds int64 `json:"ackDeadlineSeconds,omitempty"` + + // Name: Name of the subscription. + Name string `json:"name,omitempty"` + + // PushConfig: If push delivery is used with this subscription, this + // field is used to configure it. + PushConfig *PushConfig `json:"pushConfig,omitempty"` + + // Topic: The name of the topic from which this subscription is + // receiving messages. + Topic string `json:"topic,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AckDeadlineSeconds") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Subscription) MarshalJSON() ([]byte, error) { + type noMethod Subscription + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Topic: A topic resource. +type Topic struct { + // Name: Name of the topic. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Topic) MarshalJSON() ([]byte, error) { + type noMethod Topic + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "pubsub.subscriptions.acknowledge": + +type SubscriptionsAcknowledgeCall struct { + s *Service + acknowledgerequest *AcknowledgeRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Acknowledge: Acknowledges a particular received message: the Pub/Sub +// system can remove the given message from the subscription. +// Acknowledging a message whose Ack deadline has expired may succeed, +// but the message could have been already redelivered. Acknowledging a +// message more than once will not result in an error. This is only used +// for messages received via pull. +func (r *SubscriptionsService) Acknowledge(acknowledgerequest *AcknowledgeRequest) *SubscriptionsAcknowledgeCall { + c := &SubscriptionsAcknowledgeCall{s: r.s, opt_: make(map[string]interface{})} + c.acknowledgerequest = acknowledgerequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsAcknowledgeCall) Fields(s ...googleapi.Field) *SubscriptionsAcknowledgeCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsAcknowledgeCall) Context(ctx context.Context) *SubscriptionsAcknowledgeCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsAcknowledgeCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.acknowledgerequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1a/subscriptions/acknowledge") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.subscriptions.acknowledge" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *SubscriptionsAcknowledgeCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Acknowledges a particular received message: the Pub/Sub system can remove the given message from the subscription. Acknowledging a message whose Ack deadline has expired may succeed, but the message could have been already redelivered. Acknowledging a message more than once will not result in an error. This is only used for messages received via pull.", + // "httpMethod": "POST", + // "id": "pubsub.subscriptions.acknowledge", + // "path": "v1beta1a/subscriptions/acknowledge", + // "request": { + // "$ref": "AcknowledgeRequest" + // }, + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.subscriptions.create": + +type SubscriptionsCreateCall struct { + s *Service + subscription *Subscription + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a subscription on a given topic for a given +// subscriber. If the subscription already exists, returns +// ALREADY_EXISTS. If the corresponding topic doesn't exist, returns +// NOT_FOUND. If the name is not provided in the request, the server +// will assign a random name for this subscription on the same project +// as the topic. +func (r *SubscriptionsService) Create(subscription *Subscription) *SubscriptionsCreateCall { + c := &SubscriptionsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.subscription = subscription + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsCreateCall) Fields(s ...googleapi.Field) *SubscriptionsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsCreateCall) Context(ctx context.Context) *SubscriptionsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsCreateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1a/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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.subscriptions.create" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubscriptionsCreateCall) Do() (*Subscription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a subscription on a given topic for a given subscriber. If the subscription already exists, returns ALREADY_EXISTS. If the corresponding topic doesn't exist, returns NOT_FOUND. If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic.", + // "httpMethod": "POST", + // "id": "pubsub.subscriptions.create", + // "path": "v1beta1a/subscriptions", + // "request": { + // "$ref": "Subscription" + // }, + // "response": { + // "$ref": "Subscription" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.subscriptions.delete": + +type SubscriptionsDeleteCall struct { + s *Service + subscription string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing subscription. All pending messages in the +// subscription are immediately dropped. Calls to Pull after deletion +// will return NOT_FOUND. +func (r *SubscriptionsService) Delete(subscription string) *SubscriptionsDeleteCall { + c := &SubscriptionsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.subscription = subscription + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsDeleteCall) Fields(s ...googleapi.Field) *SubscriptionsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsDeleteCall) Context(ctx context.Context) *SubscriptionsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1a/subscriptions/{+subscription}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "subscription": c.subscription, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.subscriptions.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *SubscriptionsDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to Pull after deletion will return NOT_FOUND.", + // "httpMethod": "DELETE", + // "id": "pubsub.subscriptions.delete", + // "parameterOrder": [ + // "subscription" + // ], + // "parameters": { + // "subscription": { + // "description": "The subscription to delete.", + // "location": "path", + // "pattern": "^.*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1a/subscriptions/{+subscription}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.subscriptions.get": + +type SubscriptionsGetCall struct { + s *Service + subscription string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the configuration details of a subscription. +func (r *SubscriptionsService) Get(subscription string) *SubscriptionsGetCall { + c := &SubscriptionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.subscription = subscription + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsGetCall) Fields(s ...googleapi.Field) *SubscriptionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SubscriptionsGetCall) IfNoneMatch(entityTag string) *SubscriptionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsGetCall) Context(ctx context.Context) *SubscriptionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1a/subscriptions/{+subscription}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "subscription": c.subscription, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.subscriptions.get" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubscriptionsGetCall) Do() (*Subscription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the configuration details of a subscription.", + // "httpMethod": "GET", + // "id": "pubsub.subscriptions.get", + // "parameterOrder": [ + // "subscription" + // ], + // "parameters": { + // "subscription": { + // "description": "The name of the subscription to get.", + // "location": "path", + // "pattern": "^.*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1a/subscriptions/{+subscription}", + // "response": { + // "$ref": "Subscription" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.subscriptions.list": + +type SubscriptionsListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists matching subscriptions. +func (r *SubscriptionsService) List() *SubscriptionsListCall { + c := &SubscriptionsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of subscriptions to return. +func (c *SubscriptionsListCall) MaxResults(maxResults int64) *SubscriptionsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The value obtained +// in the last ListSubscriptionsResponse for continuation. +func (c *SubscriptionsListCall) PageToken(pageToken string) *SubscriptionsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Query sets the optional parameter "query": A valid label query +// expression. +func (c *SubscriptionsListCall) Query(query string) *SubscriptionsListCall { + c.opt_["query"] = query + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsListCall) Fields(s ...googleapi.Field) *SubscriptionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SubscriptionsListCall) IfNoneMatch(entityTag string) *SubscriptionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsListCall) Context(ctx context.Context) *SubscriptionsListCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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_["query"]; ok { + params.Set("query", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1a/subscriptions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.subscriptions.list" call. +// Exactly one of *ListSubscriptionsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListSubscriptionsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SubscriptionsListCall) Do() (*ListSubscriptionsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListSubscriptionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists matching subscriptions.", + // "httpMethod": "GET", + // "id": "pubsub.subscriptions.list", + // "parameters": { + // "maxResults": { + // "description": "Maximum number of subscriptions to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value obtained in the last ListSubscriptionsResponse for continuation.", + // "location": "query", + // "type": "string" + // }, + // "query": { + // "description": "A valid label query expression.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1beta1a/subscriptions", + // "response": { + // "$ref": "ListSubscriptionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.subscriptions.modifyAckDeadline": + +type SubscriptionsModifyAckDeadlineCall struct { + s *Service + modifyackdeadlinerequest *ModifyAckDeadlineRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// ModifyAckDeadline: Modifies the Ack deadline for a message received +// from a pull request. +func (r *SubscriptionsService) ModifyAckDeadline(modifyackdeadlinerequest *ModifyAckDeadlineRequest) *SubscriptionsModifyAckDeadlineCall { + c := &SubscriptionsModifyAckDeadlineCall{s: r.s, opt_: make(map[string]interface{})} + c.modifyackdeadlinerequest = modifyackdeadlinerequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsModifyAckDeadlineCall) Fields(s ...googleapi.Field) *SubscriptionsModifyAckDeadlineCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsModifyAckDeadlineCall) Context(ctx context.Context) *SubscriptionsModifyAckDeadlineCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsModifyAckDeadlineCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifyackdeadlinerequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1a/subscriptions/modifyAckDeadline") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.subscriptions.modifyAckDeadline" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *SubscriptionsModifyAckDeadlineCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Modifies the Ack deadline for a message received from a pull request.", + // "httpMethod": "POST", + // "id": "pubsub.subscriptions.modifyAckDeadline", + // "path": "v1beta1a/subscriptions/modifyAckDeadline", + // "request": { + // "$ref": "ModifyAckDeadlineRequest" + // }, + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.subscriptions.modifyPushConfig": + +type SubscriptionsModifyPushConfigCall struct { + s *Service + modifypushconfigrequest *ModifyPushConfigRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// ModifyPushConfig: Modifies the PushConfig for a specified +// subscription. This method can be used to suspend the flow of messages +// to an endpoint by clearing the PushConfig field in the request. +// Messages will be accumulated for delivery even if no push +// configuration is defined or while the configuration is modified. +func (r *SubscriptionsService) ModifyPushConfig(modifypushconfigrequest *ModifyPushConfigRequest) *SubscriptionsModifyPushConfigCall { + c := &SubscriptionsModifyPushConfigCall{s: r.s, opt_: make(map[string]interface{})} + c.modifypushconfigrequest = modifypushconfigrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsModifyPushConfigCall) Fields(s ...googleapi.Field) *SubscriptionsModifyPushConfigCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsModifyPushConfigCall) Context(ctx context.Context) *SubscriptionsModifyPushConfigCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsModifyPushConfigCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifypushconfigrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1a/subscriptions/modifyPushConfig") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.subscriptions.modifyPushConfig" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *SubscriptionsModifyPushConfigCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Modifies the PushConfig for a specified subscription. This method can be used to suspend the flow of messages to an endpoint by clearing the PushConfig field in the request. Messages will be accumulated for delivery even if no push configuration is defined or while the configuration is modified.", + // "httpMethod": "POST", + // "id": "pubsub.subscriptions.modifyPushConfig", + // "path": "v1beta1a/subscriptions/modifyPushConfig", + // "request": { + // "$ref": "ModifyPushConfigRequest" + // }, + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.subscriptions.pull": + +type SubscriptionsPullCall struct { + s *Service + pullrequest *PullRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Pull: Pulls a single message from the server. If return_immediately +// is true, and no messages are available in the subscription, this +// method returns FAILED_PRECONDITION. The system is free to return an +// UNAVAILABLE error if no messages are available in a reasonable amount +// of time (to reduce system load). +func (r *SubscriptionsService) Pull(pullrequest *PullRequest) *SubscriptionsPullCall { + c := &SubscriptionsPullCall{s: r.s, opt_: make(map[string]interface{})} + c.pullrequest = pullrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsPullCall) Fields(s ...googleapi.Field) *SubscriptionsPullCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsPullCall) Context(ctx context.Context) *SubscriptionsPullCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsPullCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.pullrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1a/subscriptions/pull") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.subscriptions.pull" call. +// Exactly one of *PullResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PullResponse.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubscriptionsPullCall) Do() (*PullResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PullResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Pulls a single message from the server. If return_immediately is true, and no messages are available in the subscription, this method returns FAILED_PRECONDITION. The system is free to return an UNAVAILABLE error if no messages are available in a reasonable amount of time (to reduce system load).", + // "httpMethod": "POST", + // "id": "pubsub.subscriptions.pull", + // "path": "v1beta1a/subscriptions/pull", + // "request": { + // "$ref": "PullRequest" + // }, + // "response": { + // "$ref": "PullResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.subscriptions.pullBatch": + +type SubscriptionsPullBatchCall struct { + s *Service + pullbatchrequest *PullBatchRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// PullBatch: Pulls messages from the server. Returns an empty list if +// there are no messages available in the backlog. The system is free to +// return UNAVAILABLE if there are too many pull requests outstanding +// for the given subscription. +func (r *SubscriptionsService) PullBatch(pullbatchrequest *PullBatchRequest) *SubscriptionsPullBatchCall { + c := &SubscriptionsPullBatchCall{s: r.s, opt_: make(map[string]interface{})} + c.pullbatchrequest = pullbatchrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsPullBatchCall) Fields(s ...googleapi.Field) *SubscriptionsPullBatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsPullBatchCall) Context(ctx context.Context) *SubscriptionsPullBatchCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsPullBatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.pullbatchrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1a/subscriptions/pullBatch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.subscriptions.pullBatch" call. +// Exactly one of *PullBatchResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PullBatchResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SubscriptionsPullBatchCall) Do() (*PullBatchResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PullBatchResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Pulls messages from the server. Returns an empty list if there are no messages available in the backlog. The system is free to return UNAVAILABLE if there are too many pull requests outstanding for the given subscription.", + // "httpMethod": "POST", + // "id": "pubsub.subscriptions.pullBatch", + // "path": "v1beta1a/subscriptions/pullBatch", + // "request": { + // "$ref": "PullBatchRequest" + // }, + // "response": { + // "$ref": "PullBatchResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.topics.create": + +type TopicsCreateCall struct { + s *Service + topic *Topic + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates the given topic with the given name. +func (r *TopicsService) Create(topic *Topic) *TopicsCreateCall { + c := &TopicsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.topic = topic + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TopicsCreateCall) Fields(s ...googleapi.Field) *TopicsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TopicsCreateCall) Context(ctx context.Context) *TopicsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *TopicsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.topic) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1a/topics") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.topics.create" call. +// Exactly one of *Topic or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Topic.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TopicsCreateCall) Do() (*Topic, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Topic{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates the given topic with the given name.", + // "httpMethod": "POST", + // "id": "pubsub.topics.create", + // "path": "v1beta1a/topics", + // "request": { + // "$ref": "Topic" + // }, + // "response": { + // "$ref": "Topic" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.topics.delete": + +type TopicsDeleteCall struct { + s *Service + topic string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the topic with the given name. Returns NOT_FOUND if +// the topic does not exist. After a topic is deleted, a new topic may +// be created with the same name. +func (r *TopicsService) Delete(topic string) *TopicsDeleteCall { + c := &TopicsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.topic = topic + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TopicsDeleteCall) Fields(s ...googleapi.Field) *TopicsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TopicsDeleteCall) Context(ctx context.Context) *TopicsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TopicsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1a/topics/{+topic}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "topic": c.topic, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.topics.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TopicsDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the topic with the given name. Returns NOT_FOUND if the topic does not exist. After a topic is deleted, a new topic may be created with the same name.", + // "httpMethod": "DELETE", + // "id": "pubsub.topics.delete", + // "parameterOrder": [ + // "topic" + // ], + // "parameters": { + // "topic": { + // "description": "Name of the topic to delete.", + // "location": "path", + // "pattern": "^.*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1a/topics/{+topic}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.topics.get": + +type TopicsGetCall struct { + s *Service + topic string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the configuration of a topic. Since the topic only has the +// name attribute, this method is only useful to check the existence of +// a topic. If other attributes are added in the future, they will be +// returned here. +func (r *TopicsService) Get(topic string) *TopicsGetCall { + c := &TopicsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.topic = topic + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TopicsGetCall) Fields(s ...googleapi.Field) *TopicsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TopicsGetCall) IfNoneMatch(entityTag string) *TopicsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TopicsGetCall) Context(ctx context.Context) *TopicsGetCall { + c.ctx_ = ctx + return c +} + +func (c *TopicsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1a/topics/{+topic}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "topic": c.topic, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.topics.get" call. +// Exactly one of *Topic or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Topic.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TopicsGetCall) Do() (*Topic, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Topic{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the configuration of a topic. Since the topic only has the name attribute, this method is only useful to check the existence of a topic. If other attributes are added in the future, they will be returned here.", + // "httpMethod": "GET", + // "id": "pubsub.topics.get", + // "parameterOrder": [ + // "topic" + // ], + // "parameters": { + // "topic": { + // "description": "The name of the topic to get.", + // "location": "path", + // "pattern": "^.*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta1a/topics/{+topic}", + // "response": { + // "$ref": "Topic" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.topics.list": + +type TopicsListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists matching topics. +func (r *TopicsService) List() *TopicsListCall { + c := &TopicsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum number +// of topics to return. +func (c *TopicsListCall) MaxResults(maxResults int64) *TopicsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": The value obtained +// in the last ListTopicsResponse for continuation. +func (c *TopicsListCall) PageToken(pageToken string) *TopicsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Query sets the optional parameter "query": A valid label query +// expression. +func (c *TopicsListCall) Query(query string) *TopicsListCall { + c.opt_["query"] = query + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TopicsListCall) Fields(s ...googleapi.Field) *TopicsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TopicsListCall) IfNoneMatch(entityTag string) *TopicsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TopicsListCall) Context(ctx context.Context) *TopicsListCall { + c.ctx_ = ctx + return c +} + +func (c *TopicsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.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_["query"]; ok { + params.Set("query", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1a/topics") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.topics.list" call. +// Exactly one of *ListTopicsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListTopicsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TopicsListCall) Do() (*ListTopicsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListTopicsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists matching topics.", + // "httpMethod": "GET", + // "id": "pubsub.topics.list", + // "parameters": { + // "maxResults": { + // "description": "Maximum number of topics to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value obtained in the last ListTopicsResponse for continuation.", + // "location": "query", + // "type": "string" + // }, + // "query": { + // "description": "A valid label query expression.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1beta1a/topics", + // "response": { + // "$ref": "ListTopicsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.topics.publish": + +type TopicsPublishCall struct { + s *Service + publishrequest *PublishRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Publish: Adds a message to the topic. Returns NOT_FOUND if the topic +// does not exist. +func (r *TopicsService) Publish(publishrequest *PublishRequest) *TopicsPublishCall { + c := &TopicsPublishCall{s: r.s, opt_: make(map[string]interface{})} + c.publishrequest = publishrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TopicsPublishCall) Fields(s ...googleapi.Field) *TopicsPublishCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TopicsPublishCall) Context(ctx context.Context) *TopicsPublishCall { + c.ctx_ = ctx + return c +} + +func (c *TopicsPublishCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.publishrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1a/topics/publish") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.topics.publish" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TopicsPublishCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds a message to the topic. Returns NOT_FOUND if the topic does not exist.", + // "httpMethod": "POST", + // "id": "pubsub.topics.publish", + // "path": "v1beta1a/topics/publish", + // "request": { + // "$ref": "PublishRequest" + // }, + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.topics.publishBatch": + +type TopicsPublishBatchCall struct { + s *Service + publishbatchrequest *PublishBatchRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// PublishBatch: Adds one or more messages to the topic. Returns +// NOT_FOUND if the topic does not exist. +func (r *TopicsService) PublishBatch(publishbatchrequest *PublishBatchRequest) *TopicsPublishBatchCall { + c := &TopicsPublishBatchCall{s: r.s, opt_: make(map[string]interface{})} + c.publishbatchrequest = publishbatchrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TopicsPublishBatchCall) Fields(s ...googleapi.Field) *TopicsPublishBatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TopicsPublishBatchCall) Context(ctx context.Context) *TopicsPublishBatchCall { + c.ctx_ = ctx + return c +} + +func (c *TopicsPublishBatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.publishbatchrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1a/topics/publishBatch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.topics.publishBatch" call. +// Exactly one of *PublishBatchResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PublishBatchResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TopicsPublishBatchCall) Do() (*PublishBatchResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PublishBatchResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds one or more messages to the topic. Returns NOT_FOUND if the topic does not exist.", + // "httpMethod": "POST", + // "id": "pubsub.topics.publishBatch", + // "path": "v1beta1a/topics/publishBatch", + // "request": { + // "$ref": "PublishBatchRequest" + // }, + // "response": { + // "$ref": "PublishBatchResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/pubsub/v1beta2/pubsub-api.json b/Godeps/_workspace/src/google.golang.org/api/pubsub/v1beta2/pubsub-api.json new file mode 100644 index 000000000..077da571a --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/pubsub/v1beta2/pubsub-api.json @@ -0,0 +1,1040 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/bZNz6VUa9sqtr0UjT-GTq4xvg0E\"", + "discoveryVersion": "v1", + "id": "pubsub:v1beta2", + "name": "pubsub", + "version": "v1beta2", + "revision": "20150526", + "title": "Google Cloud Pub/Sub API", + "description": "Provides reliable, many-to-many, asynchronous messaging between applications.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/pubsub/docs", + "protocol": "rest", + "baseUrl": "https://pubsub.googleapis.com/", + "basePath": "/", + "rootUrl": "https://pubsub.googleapis.com/", + "servicePath": "", + "batchPath": "batch", + "parameters": { + "access_token": { + "type": "string", + "description": "OAuth access token.", + "location": "query" + }, + "alt": { + "type": "string", + "description": "Data format for response.", + "default": "json", + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query" + }, + "bearer_token": { + "type": "string", + "description": "OAuth bearer token.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JSONP", + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "pp": { + "type": "boolean", + "description": "Pretty-print response.", + "default": "true", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query" + }, + "upload_protocol": { + "type": "string", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query" + }, + "uploadType": { + "type": "string", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query" + }, + "$.xgafv": { + "type": "string", + "description": "V1 error format.", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/pubsub": { + "description": "View and manage Pub/Sub topics and subscriptions" + } + } + } + }, + "schemas": { + "SetIamPolicyRequest": { + "id": "SetIamPolicyRequest", + "type": "object", + "description": "Request message for `SetIamPolicy` method.", + "properties": { + "policy": { + "$ref": "Policy", + "description": "REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them." + } + } + }, + "Policy": { + "id": "Policy", + "type": "object", + "description": "Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources. A `Policy` consists of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, where the members can be user accounts, Google groups, Google domains, and service accounts. A `role` is a named list of permissions defined by IAM. **Example** { \"bindings\": [ { \"role\": \"roles/owner\", \"members\": [ \"user:mike@example.com\", \"group:admins@example.com\", \"domain:google.com\", \"serviceAccount:my-other-app@appspot.gserviceaccount.com\"] }, { \"role\": \"roles/viewer\", \"members\": [\"user:sean@example.com\"] } ] } For a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam).", + "properties": { + "version": { + "type": "integer", + "description": "Version of the `Policy`. The default version is 0.", + "format": "int32" + }, + "bindings": { + "type": "array", + "description": "Associates a list of `members` to a `role`. Multiple `bindings` must not be specified for the same `role`. `bindings` with no members will result in an error.", + "items": { + "$ref": "Binding" + } + }, + "etag": { + "type": "string", + "description": "Can be used to perform a read-modify-write.", + "format": "byte" + } + } + }, + "Binding": { + "id": "Binding", + "type": "object", + "description": "Associates `members` with a `role`.", + "properties": { + "role": { + "type": "string", + "description": "Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. Required" + }, + "members": { + "type": "array", + "description": "Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following formats: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` or `joe@example.com`. * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`.", + "items": { + "type": "string" + } + } + } + }, + "TestIamPermissionsRequest": { + "id": "TestIamPermissionsRequest", + "type": "object", + "description": "Request message for `TestIamPermissions` method.", + "properties": { + "permissions": { + "type": "array", + "description": "The set of permissions to check for the `resource`. Permissions with wildcards (such as '*' or 'storage.*') are not allowed.", + "items": { + "type": "string" + } + } + } + }, + "TestIamPermissionsResponse": { + "id": "TestIamPermissionsResponse", + "type": "object", + "description": "Response message for `TestIamPermissions` method.", + "properties": { + "permissions": { + "type": "array", + "description": "A subset of `TestPermissionsRequest.permissions` that the caller is allowed.", + "items": { + "type": "string" + } + } + } + }, + "Topic": { + "id": "Topic", + "type": "object", + "description": "A topic resource.", + "properties": { + "name": { + "type": "string", + "description": "The name of the topic. It must have the format `\"projects/{project}/topics/{topic}\"`. `{topic}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `\"goog\"`." + } + } + }, + "PublishRequest": { + "id": "PublishRequest", + "type": "object", + "description": "Request for the Publish method.", + "properties": { + "messages": { + "type": "array", + "description": "The messages to publish.", + "items": { + "$ref": "PubsubMessage" + } + } + } + }, + "PubsubMessage": { + "id": "PubsubMessage", + "type": "object", + "description": "A message data and its attributes. The message payload must not be empty; it must contain either a non-empty data field, or at least one attribute.", + "properties": { + "data": { + "type": "string", + "description": "The message payload. For JSON requests, the value of this field must be base64-encoded.", + "format": "byte" + }, + "attributes": { + "type": "object", + "description": "Optional attributes for this message.", + "additionalProperties": { + "type": "string" + } + }, + "messageId": { + "type": "string", + "description": "ID of this message assigned by the server at publication time. Guaranteed to be unique within the topic. This value may be read by a subscriber that receives a `PubsubMessage` via a `Pull` call or a push delivery. It must not be populated by a publisher in a `Publish` call." + } + } + }, + "PublishResponse": { + "id": "PublishResponse", + "type": "object", + "description": "Response for the `Publish` method.", + "properties": { + "messageIds": { + "type": "array", + "description": "The server-assigned ID of each published message, in the same order as the messages in the request. IDs are guaranteed to be unique within the topic.", + "items": { + "type": "string" + } + } + } + }, + "ListTopicsResponse": { + "id": "ListTopicsResponse", + "type": "object", + "description": "Response for the `ListTopics` method.", + "properties": { + "topics": { + "type": "array", + "description": "The resulting topics.", + "items": { + "$ref": "Topic" + } + }, + "nextPageToken": { + "type": "string", + "description": "If not empty, indicates that there may be more topics that match the request; this value should be passed in a new `ListTopicsRequest`." + } + } + }, + "ListTopicSubscriptionsResponse": { + "id": "ListTopicSubscriptionsResponse", + "type": "object", + "description": "Response for the `ListTopicSubscriptions` method.", + "properties": { + "subscriptions": { + "type": "array", + "description": "The names of the subscriptions that match the request.", + "items": { + "type": "string" + } + }, + "nextPageToken": { + "type": "string", + "description": "If not empty, indicates that there may be more subscriptions that match the request; this value should be passed in a new `ListTopicSubscriptionsRequest` to get more subscriptions." + } + } + }, + "Empty": { + "id": "Empty", + "type": "object", + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`." + }, + "Subscription": { + "id": "Subscription", + "type": "object", + "description": "A subscription resource.", + "properties": { + "name": { + "type": "string", + "description": "The name of the subscription. It must have the format `\"projects/{project}/subscriptions/{subscription}\"`. `{subscription}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `\"goog\"`." + }, + "topic": { + "type": "string", + "description": "The name of the topic from which this subscription is receiving messages. The value of this field will be `_deleted-topic_` if the topic has been deleted." + }, + "pushConfig": { + "$ref": "PushConfig", + "description": "If push delivery is used with this subscription, this field is used to configure it. An empty `pushConfig` signifies that the subscriber will pull and ack messages using API methods." + }, + "ackDeadlineSeconds": { + "type": "integer", + "description": "This value is the maximum time after a subscriber receives a message before the subscriber should acknowledge the message. After message delivery but before the ack deadline expires and before the message is acknowledged, it is an outstanding message and will not be delivered again during that time (on a best-effort basis). For pull delivery this value is used as the initial value for the ack deadline. To override this value for a given message, call `ModifyAckDeadline` with the corresponding `ack_id`. For push delivery, this value is also used to set the request timeout for the call to the push endpoint. If the subscriber never acknowledges the message, the Pub/Sub system will eventually redeliver the message. If this parameter is not set, the default value of 10 seconds is used.", + "format": "int32" + } + } + }, + "PushConfig": { + "id": "PushConfig", + "type": "object", + "description": "Configuration for a push delivery endpoint.", + "properties": { + "pushEndpoint": { + "type": "string", + "description": "A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use \"https://example.com/push\"." + }, + "attributes": { + "type": "object", + "description": "Endpoint configuration attributes. Every endpoint has a set of API supported attributes that can be used to control different aspects of the message delivery. The currently supported attribute is `x-goog-version`, which you can use to change the format of the push message. This attribute indicates the version of the data expected by the endpoint. This controls the shape of the envelope (i.e. its fields and metadata). The endpoint version is based on the version of the Pub/Sub API. If not present during the `CreateSubscription` call, it will default to the version of the API used to make such call. If not present during a `ModifyPushConfig` call, its value will not be changed. `GetSubscription` calls will always return a valid version, even if the subscription was created without this attribute. The possible values for this attribute are: * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.", + "additionalProperties": { + "type": "string" + } + } + } + }, + "ListSubscriptionsResponse": { + "id": "ListSubscriptionsResponse", + "type": "object", + "description": "Response for the `ListSubscriptions` method.", + "properties": { + "subscriptions": { + "type": "array", + "description": "The subscriptions that match the request.", + "items": { + "$ref": "Subscription" + } + }, + "nextPageToken": { + "type": "string", + "description": "If not empty, indicates that there may be more subscriptions that match the request; this value should be passed in a new `ListSubscriptionsRequest` to get more subscriptions." + } + } + }, + "ModifyAckDeadlineRequest": { + "id": "ModifyAckDeadlineRequest", + "type": "object", + "description": "Request for the ModifyAckDeadline method.", + "properties": { + "ackId": { + "type": "string", + "description": "The acknowledgment ID. Either this or ack_ids must be populated, but not both." + }, + "ackIds": { + "type": "array", + "description": "List of acknowledgment IDs.", + "items": { + "type": "string" + } + }, + "ackDeadlineSeconds": { + "type": "integer", + "description": "The new ack deadline with respect to the time this request was sent to the Pub/Sub system. Must be \u003e= 0. For example, if the value is 10, the new ack deadline will expire 10 seconds after the `ModifyAckDeadline` call was made. Specifying zero may immediately make the message available for another pull request.", + "format": "int32" + } + } + }, + "AcknowledgeRequest": { + "id": "AcknowledgeRequest", + "type": "object", + "description": "Request for the Acknowledge method.", + "properties": { + "ackIds": { + "type": "array", + "description": "The acknowledgment ID for the messages being acknowledged that was returned by the Pub/Sub system in the `Pull` response. Must not be empty.", + "items": { + "type": "string" + } + } + } + }, + "PullRequest": { + "id": "PullRequest", + "type": "object", + "description": "Request for the `Pull` method.", + "properties": { + "returnImmediately": { + "type": "boolean", + "description": "If this is specified as true the system will respond immediately even if it is not able to return a message in the `Pull` response. Otherwise the system is allowed to wait until at least one message is available rather than returning no messages. The client may cancel the request if it does not wish to wait any longer for the response." + }, + "maxMessages": { + "type": "integer", + "description": "The maximum number of messages returned for this request. The Pub/Sub system may return fewer than the number specified.", + "format": "int32" + } + } + }, + "PullResponse": { + "id": "PullResponse", + "type": "object", + "description": "Response for the `Pull` method.", + "properties": { + "receivedMessages": { + "type": "array", + "description": "Received Pub/Sub messages. The Pub/Sub system will return zero messages if there are no more available in the backlog. The Pub/Sub system may return fewer than the `maxMessages` requested even if there are more messages available in the backlog.", + "items": { + "$ref": "ReceivedMessage" + } + } + } + }, + "ReceivedMessage": { + "id": "ReceivedMessage", + "type": "object", + "description": "A message and its corresponding acknowledgment ID.", + "properties": { + "ackId": { + "type": "string", + "description": "This ID can be used to acknowledge the received message." + }, + "message": { + "$ref": "PubsubMessage", + "description": "The message." + } + } + }, + "ModifyPushConfigRequest": { + "id": "ModifyPushConfigRequest", + "type": "object", + "description": "Request for the ModifyPushConfig method.", + "properties": { + "pushConfig": { + "$ref": "PushConfig", + "description": "The push configuration for future deliveries. An empty `pushConfig` indicates that the Pub/Sub system should stop pushing messages from the given subscription and allow messages to be pulled and acknowledged - effectively pausing the subscription if `Pull` is not called." + } + } + } + }, + "resources": { + "projects": { + "resources": { + "topics": { + "methods": { + "setIamPolicy": { + "id": "pubsub.projects.topics.setIamPolicy", + "path": "v1beta2/{+resource}:setIamPolicy", + "httpMethod": "POST", + "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", + "parameters": { + "resource": { + "type": "string", + "description": "REQUIRED: The resource for which policy is being specified. `resource` is usually specified as a path, such as, `projects/{project}/zones/{zone}/disks/{disk}`.", + "required": true, + "pattern": "^projects/[^/]*/topics/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "resource" + ], + "request": { + "$ref": "SetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "getIamPolicy": { + "id": "pubsub.projects.topics.getIamPolicy", + "path": "v1beta2/{+resource}:getIamPolicy", + "httpMethod": "GET", + "description": "Gets the access control policy for a `resource`. Is empty if the policy or the resource does not exist.", + "parameters": { + "resource": { + "type": "string", + "description": "REQUIRED: The resource for which policy is being requested. Resource is usually specified as a path, such as, `projects/{project}`.", + "required": true, + "pattern": "^projects/[^/]*/topics/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "testIamPermissions": { + "id": "pubsub.projects.topics.testIamPermissions", + "path": "v1beta2/{+resource}:testIamPermissions", + "httpMethod": "POST", + "description": "Returns permissions that a caller has on the specified resource.", + "parameters": { + "resource": { + "type": "string", + "description": "REQUIRED: The resource for which policy detail is being requested. `resource` is usually specified as a path, such as, `projects/{project}`.", + "required": true, + "pattern": "^projects/[^/]*/topics/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "resource" + ], + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "create": { + "id": "pubsub.projects.topics.create", + "path": "v1beta2/{+name}", + "httpMethod": "PUT", + "description": "Creates the given topic with the given name.", + "parameters": { + "name": { + "type": "string", + "description": "The name of the topic. It must have the format `\"projects/{project}/topics/{topic}\"`. `{topic}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `\"goog\"`.", + "required": true, + "pattern": "^projects/[^/]*/topics/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "name" + ], + "request": { + "$ref": "Topic" + }, + "response": { + "$ref": "Topic" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "publish": { + "id": "pubsub.projects.topics.publish", + "path": "v1beta2/{+topic}:publish", + "httpMethod": "POST", + "description": "Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic does not exist. The message payload must not be empty; it must contain either a non-empty data field, or at least one attribute.", + "parameters": { + "topic": { + "type": "string", + "description": "The messages in the request will be published on this topic.", + "required": true, + "pattern": "^projects/[^/]*/topics/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "topic" + ], + "request": { + "$ref": "PublishRequest" + }, + "response": { + "$ref": "PublishResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "get": { + "id": "pubsub.projects.topics.get", + "path": "v1beta2/{+topic}", + "httpMethod": "GET", + "description": "Gets the configuration of a topic.", + "parameters": { + "topic": { + "type": "string", + "description": "The name of the topic to get.", + "required": true, + "pattern": "^projects/[^/]*/topics/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "topic" + ], + "response": { + "$ref": "Topic" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "list": { + "id": "pubsub.projects.topics.list", + "path": "v1beta2/{+project}/topics", + "httpMethod": "GET", + "description": "Lists matching topics.", + "parameters": { + "project": { + "type": "string", + "description": "The name of the cloud project that topics belong to.", + "required": true, + "pattern": "^projects/[^/]*$", + "location": "path" + }, + "pageSize": { + "type": "integer", + "description": "Maximum number of topics to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value returned by the last `ListTopicsResponse`; indicates that this is a continuation of a prior `ListTopics` call, and that the system should return the next page of data.", + "location": "query" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "ListTopicsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "delete": { + "id": "pubsub.projects.topics.delete", + "path": "v1beta2/{+topic}", + "httpMethod": "DELETE", + "description": "Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a topic is deleted, a new topic may be created with the same name; this is an entirely new topic with none of the old configuration or subscriptions. Existing subscriptions to this topic are not deleted, but their `topic` field is set to `_deleted-topic_`.", + "parameters": { + "topic": { + "type": "string", + "description": "Name of the topic to delete.", + "required": true, + "pattern": "^projects/[^/]*/topics/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "topic" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + } + }, + "resources": { + "subscriptions": { + "methods": { + "list": { + "id": "pubsub.projects.topics.subscriptions.list", + "path": "v1beta2/{+topic}/subscriptions", + "httpMethod": "GET", + "description": "Lists the name of the subscriptions for this topic.", + "parameters": { + "topic": { + "type": "string", + "description": "The name of the topic that subscriptions are attached to.", + "required": true, + "pattern": "^projects/[^/]*/topics/[^/]*$", + "location": "path" + }, + "pageSize": { + "type": "integer", + "description": "Maximum number of subscription names to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value returned by the last `ListTopicSubscriptionsResponse`; indicates that this is a continuation of a prior `ListTopicSubscriptions` call, and that the system should return the next page of data.", + "location": "query" + } + }, + "parameterOrder": [ + "topic" + ], + "response": { + "$ref": "ListTopicSubscriptionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + } + } + } + } + }, + "subscriptions": { + "methods": { + "setIamPolicy": { + "id": "pubsub.projects.subscriptions.setIamPolicy", + "path": "v1beta2/{+resource}:setIamPolicy", + "httpMethod": "POST", + "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", + "parameters": { + "resource": { + "type": "string", + "description": "REQUIRED: The resource for which policy is being specified. `resource` is usually specified as a path, such as, `projects/{project}/zones/{zone}/disks/{disk}`.", + "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "resource" + ], + "request": { + "$ref": "SetIamPolicyRequest" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "getIamPolicy": { + "id": "pubsub.projects.subscriptions.getIamPolicy", + "path": "v1beta2/{+resource}:getIamPolicy", + "httpMethod": "GET", + "description": "Gets the access control policy for a `resource`. Is empty if the policy or the resource does not exist.", + "parameters": { + "resource": { + "type": "string", + "description": "REQUIRED: The resource for which policy is being requested. Resource is usually specified as a path, such as, `projects/{project}`.", + "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "resource" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "testIamPermissions": { + "id": "pubsub.projects.subscriptions.testIamPermissions", + "path": "v1beta2/{+resource}:testIamPermissions", + "httpMethod": "POST", + "description": "Returns permissions that a caller has on the specified resource.", + "parameters": { + "resource": { + "type": "string", + "description": "REQUIRED: The resource for which policy detail is being requested. `resource` is usually specified as a path, such as, `projects/{project}`.", + "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "resource" + ], + "request": { + "$ref": "TestIamPermissionsRequest" + }, + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "create": { + "id": "pubsub.projects.subscriptions.create", + "path": "v1beta2/{+name}", + "httpMethod": "PUT", + "description": "Creates a subscription to a given topic for a given subscriber. If the subscription already exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns `NOT_FOUND`. If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic.", + "parameters": { + "name": { + "type": "string", + "description": "The name of the subscription. It must have the format `\"projects/{project}/subscriptions/{subscription}\"`. `{subscription}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `\"goog\"`.", + "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "name" + ], + "request": { + "$ref": "Subscription" + }, + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "get": { + "id": "pubsub.projects.subscriptions.get", + "path": "v1beta2/{+subscription}", + "httpMethod": "GET", + "description": "Gets the configuration details of a subscription.", + "parameters": { + "subscription": { + "type": "string", + "description": "The name of the subscription to get.", + "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "subscription" + ], + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "list": { + "id": "pubsub.projects.subscriptions.list", + "path": "v1beta2/{+project}/subscriptions", + "httpMethod": "GET", + "description": "Lists matching subscriptions.", + "parameters": { + "project": { + "type": "string", + "description": "The name of the cloud project that subscriptions belong to.", + "required": true, + "pattern": "^projects/[^/]*$", + "location": "path" + }, + "pageSize": { + "type": "integer", + "description": "Maximum number of subscriptions to return.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The value returned by the last `ListSubscriptionsResponse`; indicates that this is a continuation of a prior `ListSubscriptions` call, and that the system should return the next page of data.", + "location": "query" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "ListSubscriptionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "delete": { + "id": "pubsub.projects.subscriptions.delete", + "path": "v1beta2/{+subscription}", + "httpMethod": "DELETE", + "description": "Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to `Pull` after deletion will return `NOT_FOUND`. After a subscription is deleted, a new one may be created with the same name, but the new one has no association with the old subscription, or its topic unless the same topic is specified.", + "parameters": { + "subscription": { + "type": "string", + "description": "The subscription to delete.", + "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "subscription" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "modifyAckDeadline": { + "id": "pubsub.projects.subscriptions.modifyAckDeadline", + "path": "v1beta2/{+subscription}:modifyAckDeadline", + "httpMethod": "POST", + "description": "Modifies the ack deadline for a specific message. This method is useful to indicate that more time is needed to process a message by the subscriber, or to make the message available for redelivery if the processing was interrupted.", + "parameters": { + "subscription": { + "type": "string", + "description": "The name of the subscription.", + "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "subscription" + ], + "request": { + "$ref": "ModifyAckDeadlineRequest" + }, + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "acknowledge": { + "id": "pubsub.projects.subscriptions.acknowledge", + "path": "v1beta2/{+subscription}:acknowledge", + "httpMethod": "POST", + "description": "Acknowledges the messages associated with the `ack_ids` in the `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages from the subscription. Acknowledging a message whose ack deadline has expired may succeed, but such a message may be redelivered later. Acknowledging a message more than once will not result in an error.", + "parameters": { + "subscription": { + "type": "string", + "description": "The subscription whose message is being acknowledged.", + "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "subscription" + ], + "request": { + "$ref": "AcknowledgeRequest" + }, + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "pull": { + "id": "pubsub.projects.subscriptions.pull", + "path": "v1beta2/{+subscription}:pull", + "httpMethod": "POST", + "description": "Pulls messages from the server. Returns an empty list if there are no messages available in the backlog. The server may return `UNAVAILABLE` if there are too many concurrent pull requests pending for the given subscription.", + "parameters": { + "subscription": { + "type": "string", + "description": "The subscription from which messages should be pulled.", + "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "subscription" + ], + "request": { + "$ref": "PullRequest" + }, + "response": { + "$ref": "PullResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + }, + "modifyPushConfig": { + "id": "pubsub.projects.subscriptions.modifyPushConfig", + "path": "v1beta2/{+subscription}:modifyPushConfig", + "httpMethod": "POST", + "description": "Modifies the `PushConfig` for a specified subscription. This may be used to change a push subscription to a pull one (signified by an empty `PushConfig`) or vice versa, or change the endpoint URL and other attributes of a push subscription. Messages will accumulate for delivery continuously through the call regardless of changes to the `PushConfig`.", + "parameters": { + "subscription": { + "type": "string", + "description": "The name of the subscription.", + "required": true, + "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + "location": "path" + } + }, + "parameterOrder": [ + "subscription" + ], + "request": { + "$ref": "ModifyPushConfigRequest" + }, + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/pubsub" + ] + } + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/pubsub/v1beta2/pubsub-gen.go b/Godeps/_workspace/src/google.golang.org/api/pubsub/v1beta2/pubsub-gen.go new file mode 100644 index 000000000..7a7691b6d --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/pubsub/v1beta2/pubsub-gen.go @@ -0,0 +1,3386 @@ +// Package pubsub provides access to the Google Cloud Pub/Sub API. +// +// See https://cloud.google.com/pubsub/docs +// +// Usage example: +// +// import "google.golang.org/api/pubsub/v1beta2" +// ... +// pubsubService, err := pubsub.New(oauthHttpClient) +package pubsub // import "google.golang.org/api/pubsub/v1beta2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "pubsub:v1beta2" +const apiName = "pubsub" +const apiVersion = "v1beta2" +const basePath = "https://pubsub.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your data across Google Cloud Platform services + CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" + + // View and manage Pub/Sub topics and subscriptions + PubsubScope = "https://www.googleapis.com/auth/pubsub" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Projects = NewProjectsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Projects *ProjectsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewProjectsService(s *Service) *ProjectsService { + rs := &ProjectsService{s: s} + rs.Subscriptions = NewProjectsSubscriptionsService(s) + rs.Topics = NewProjectsTopicsService(s) + return rs +} + +type ProjectsService struct { + s *Service + + Subscriptions *ProjectsSubscriptionsService + + Topics *ProjectsTopicsService +} + +func NewProjectsSubscriptionsService(s *Service) *ProjectsSubscriptionsService { + rs := &ProjectsSubscriptionsService{s: s} + return rs +} + +type ProjectsSubscriptionsService struct { + s *Service +} + +func NewProjectsTopicsService(s *Service) *ProjectsTopicsService { + rs := &ProjectsTopicsService{s: s} + rs.Subscriptions = NewProjectsTopicsSubscriptionsService(s) + return rs +} + +type ProjectsTopicsService struct { + s *Service + + Subscriptions *ProjectsTopicsSubscriptionsService +} + +func NewProjectsTopicsSubscriptionsService(s *Service) *ProjectsTopicsSubscriptionsService { + rs := &ProjectsTopicsSubscriptionsService{s: s} + return rs +} + +type ProjectsTopicsSubscriptionsService struct { + s *Service +} + +// AcknowledgeRequest: Request for the Acknowledge method. +type AcknowledgeRequest struct { + // AckIds: The acknowledgment ID for the messages being acknowledged + // that was returned by the Pub/Sub system in the `Pull` response. Must + // not be empty. + AckIds []string `json:"ackIds,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AckIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AcknowledgeRequest) MarshalJSON() ([]byte, error) { + type noMethod AcknowledgeRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Binding: Associates `members` with a `role`. +type Binding struct { + // Members: Specifies the identities requesting access for a Cloud + // Platform resource. `members` can have the following formats: * + // `allUsers`: A special identifier that represents anyone who is on the + // internet; with or without a Google account. * + // `allAuthenticatedUsers`: A special identifier that represents anyone + // who is authenticated with a Google account or a service account. * + // `user:{emailid}`: An email address that represents a specific Google + // account. For example, `alice@gmail.com` or `joe@example.com`. * + // `serviceAccount:{emailid}`: An email address that represents a + // service account. For example, + // `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An + // email address that represents a Google group. For example, + // `admins@example.com`. * `domain:{domain}`: A Google Apps domain name + // that represents all the users of that domain. For example, + // `google.com` or `example.com`. + Members []string `json:"members,omitempty"` + + // Role: Role that is assigned to `members`. For example, + // `roles/viewer`, `roles/editor`, or `roles/owner`. Required + Role string `json:"role,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Members") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Binding) MarshalJSON() ([]byte, error) { + type noMethod Binding + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Empty: A generic empty message that you can re-use to avoid defining +// duplicated empty messages in your APIs. A typical example is to use +// it as the request or the response type of an API method. For +// instance: service Foo { rpc Bar(google.protobuf.Empty) returns +// (google.protobuf.Empty); } The JSON representation for `Empty` is +// empty JSON object `{}`. +type Empty struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// ListSubscriptionsResponse: Response for the `ListSubscriptions` +// method. +type ListSubscriptionsResponse struct { + // NextPageToken: If not empty, indicates that there may be more + // subscriptions that match the request; this value should be passed in + // a new `ListSubscriptionsRequest` to get more subscriptions. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Subscriptions: The subscriptions that match the request. + Subscriptions []*Subscription `json:"subscriptions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListSubscriptionsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListSubscriptionsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListTopicSubscriptionsResponse: Response for the +// `ListTopicSubscriptions` method. +type ListTopicSubscriptionsResponse struct { + // NextPageToken: If not empty, indicates that there may be more + // subscriptions that match the request; this value should be passed in + // a new `ListTopicSubscriptionsRequest` to get more subscriptions. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Subscriptions: The names of the subscriptions that match the request. + Subscriptions []string `json:"subscriptions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListTopicSubscriptionsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListTopicSubscriptionsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListTopicsResponse: Response for the `ListTopics` method. +type ListTopicsResponse struct { + // NextPageToken: If not empty, indicates that there may be more topics + // that match the request; this value should be passed in a new + // `ListTopicsRequest`. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Topics: The resulting topics. + Topics []*Topic `json:"topics,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListTopicsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListTopicsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ModifyAckDeadlineRequest: Request for the ModifyAckDeadline method. +type ModifyAckDeadlineRequest struct { + // AckDeadlineSeconds: The new ack deadline with respect to the time + // this request was sent to the Pub/Sub system. Must be >= 0. For + // example, if the value is 10, the new ack deadline will expire 10 + // seconds after the `ModifyAckDeadline` call was made. Specifying zero + // may immediately make the message available for another pull request. + AckDeadlineSeconds int64 `json:"ackDeadlineSeconds,omitempty"` + + // AckId: The acknowledgment ID. Either this or ack_ids must be + // populated, but not both. + AckId string `json:"ackId,omitempty"` + + // AckIds: List of acknowledgment IDs. + AckIds []string `json:"ackIds,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AckDeadlineSeconds") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ModifyAckDeadlineRequest) MarshalJSON() ([]byte, error) { + type noMethod ModifyAckDeadlineRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ModifyPushConfigRequest: Request for the ModifyPushConfig method. +type ModifyPushConfigRequest struct { + // PushConfig: The push configuration for future deliveries. An empty + // `pushConfig` indicates that the Pub/Sub system should stop pushing + // messages from the given subscription and allow messages to be pulled + // and acknowledged - effectively pausing the subscription if `Pull` is + // not called. + PushConfig *PushConfig `json:"pushConfig,omitempty"` + + // ForceSendFields is a list of field names (e.g. "PushConfig") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ModifyPushConfigRequest) MarshalJSON() ([]byte, error) { + type noMethod ModifyPushConfigRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Policy: Defines an Identity and Access Management (IAM) policy. It is +// used to specify access control policies for Cloud Platform resources. +// A `Policy` consists of a list of `bindings`. A `Binding` binds a list +// of `members` to a `role`, where the members can be user accounts, +// Google groups, Google domains, and service accounts. A `role` is a +// named list of permissions defined by IAM. **Example** { "bindings": [ +// { "role": "roles/owner", "members": [ "user:mike@example.com", +// "group:admins@example.com", "domain:google.com", +// "serviceAccount:my-other-app@appspot.gserviceaccount.com"] }, { +// "role": "roles/viewer", "members": ["user:sean@example.com"] } ] } +// For a description of IAM and its features, see the [IAM developer's +// guide](https://cloud.google.com/iam). +type Policy struct { + // Bindings: Associates a list of `members` to a `role`. Multiple + // `bindings` must not be specified for the same `role`. `bindings` with + // no members will result in an error. + Bindings []*Binding `json:"bindings,omitempty"` + + // Etag: Can be used to perform a read-modify-write. + Etag string `json:"etag,omitempty"` + + // Version: Version of the `Policy`. The default version is 0. + Version int64 `json:"version,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Bindings") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Policy) MarshalJSON() ([]byte, error) { + type noMethod Policy + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PublishRequest: Request for the Publish method. +type PublishRequest struct { + // Messages: The messages to publish. + Messages []*PubsubMessage `json:"messages,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Messages") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PublishRequest) MarshalJSON() ([]byte, error) { + type noMethod PublishRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PublishResponse: Response for the `Publish` method. +type PublishResponse struct { + // MessageIds: The server-assigned ID of each published message, in the + // same order as the messages in the request. IDs are guaranteed to be + // unique within the topic. + MessageIds []string `json:"messageIds,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "MessageIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PublishResponse) MarshalJSON() ([]byte, error) { + type noMethod PublishResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PubsubMessage: A message data and its attributes. The message payload +// must not be empty; it must contain either a non-empty data field, or +// at least one attribute. +type PubsubMessage struct { + // Attributes: Optional attributes for this message. + Attributes map[string]string `json:"attributes,omitempty"` + + // Data: The message payload. For JSON requests, the value of this field + // must be base64-encoded. + Data string `json:"data,omitempty"` + + // MessageId: ID of this message assigned by the server at publication + // time. Guaranteed to be unique within the topic. This value may be + // read by a subscriber that receives a `PubsubMessage` via a `Pull` + // call or a push delivery. It must not be populated by a publisher in a + // `Publish` call. + MessageId string `json:"messageId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Attributes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PubsubMessage) MarshalJSON() ([]byte, error) { + type noMethod PubsubMessage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PullRequest: Request for the `Pull` method. +type PullRequest struct { + // MaxMessages: The maximum number of messages returned for this + // request. The Pub/Sub system may return fewer than the number + // specified. + MaxMessages int64 `json:"maxMessages,omitempty"` + + // ReturnImmediately: If this is specified as true the system will + // respond immediately even if it is not able to return a message in the + // `Pull` response. Otherwise the system is allowed to wait until at + // least one message is available rather than returning no messages. The + // client may cancel the request if it does not wish to wait any longer + // for the response. + ReturnImmediately bool `json:"returnImmediately,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MaxMessages") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PullRequest) MarshalJSON() ([]byte, error) { + type noMethod PullRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PullResponse: Response for the `Pull` method. +type PullResponse struct { + // ReceivedMessages: Received Pub/Sub messages. The Pub/Sub system will + // return zero messages if there are no more available in the backlog. + // The Pub/Sub system may return fewer than the `maxMessages` requested + // even if there are more messages available in the backlog. + ReceivedMessages []*ReceivedMessage `json:"receivedMessages,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ReceivedMessages") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PullResponse) MarshalJSON() ([]byte, error) { + type noMethod PullResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PushConfig: Configuration for a push delivery endpoint. +type PushConfig struct { + // Attributes: Endpoint configuration attributes. Every endpoint has a + // set of API supported attributes that can be used to control different + // aspects of the message delivery. The currently supported attribute is + // `x-goog-version`, which you can use to change the format of the push + // message. This attribute indicates the version of the data expected by + // the endpoint. This controls the shape of the envelope (i.e. its + // fields and metadata). The endpoint version is based on the version of + // the Pub/Sub API. If not present during the `CreateSubscription` call, + // it will default to the version of the API used to make such call. If + // not present during a `ModifyPushConfig` call, its value will not be + // changed. `GetSubscription` calls will always return a valid version, + // even if the subscription was created without this attribute. The + // possible values for this attribute are: * `v1beta1`: uses the push + // format defined in the v1beta1 Pub/Sub API. * `v1` or `v1beta2`: uses + // the push format defined in the v1 Pub/Sub API. + Attributes map[string]string `json:"attributes,omitempty"` + + // PushEndpoint: A URL locating the endpoint to which messages should be + // pushed. For example, a Webhook endpoint might use + // "https://example.com/push". + PushEndpoint string `json:"pushEndpoint,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Attributes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PushConfig) MarshalJSON() ([]byte, error) { + type noMethod PushConfig + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReceivedMessage: A message and its corresponding acknowledgment ID. +type ReceivedMessage struct { + // AckId: This ID can be used to acknowledge the received message. + AckId string `json:"ackId,omitempty"` + + // Message: The message. + Message *PubsubMessage `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AckId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReceivedMessage) MarshalJSON() ([]byte, error) { + type noMethod ReceivedMessage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SetIamPolicyRequest: Request message for `SetIamPolicy` method. +type SetIamPolicyRequest struct { + // Policy: REQUIRED: The complete policy to be applied to the + // `resource`. The size of the policy is limited to a few 10s of KB. An + // empty policy is a valid policy but certain Cloud Platform services + // (such as Projects) might reject them. + Policy *Policy `json:"policy,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Policy") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { + type noMethod SetIamPolicyRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Subscription: A subscription resource. +type Subscription struct { + // AckDeadlineSeconds: This value is the maximum time after a subscriber + // receives a message before the subscriber should acknowledge the + // message. After message delivery but before the ack deadline expires + // and before the message is acknowledged, it is an outstanding message + // and will not be delivered again during that time (on a best-effort + // basis). For pull delivery this value is used as the initial value for + // the ack deadline. To override this value for a given message, call + // `ModifyAckDeadline` with the corresponding `ack_id`. For push + // delivery, this value is also used to set the request timeout for the + // call to the push endpoint. If the subscriber never acknowledges the + // message, the Pub/Sub system will eventually redeliver the message. If + // this parameter is not set, the default value of 10 seconds is used. + AckDeadlineSeconds int64 `json:"ackDeadlineSeconds,omitempty"` + + // Name: The name of the subscription. It must have the format + // "projects/{project}/subscriptions/{subscription}". `{subscription}` + // must start with a letter, and contain only letters (`[A-Za-z]`), + // numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), + // tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 + // and 255 characters in length, and it must not start with "goog". + Name string `json:"name,omitempty"` + + // PushConfig: If push delivery is used with this subscription, this + // field is used to configure it. An empty `pushConfig` signifies that + // the subscriber will pull and ack messages using API methods. + PushConfig *PushConfig `json:"pushConfig,omitempty"` + + // Topic: The name of the topic from which this subscription is + // receiving messages. The value of this field will be `_deleted-topic_` + // if the topic has been deleted. + Topic string `json:"topic,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AckDeadlineSeconds") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Subscription) MarshalJSON() ([]byte, error) { + type noMethod Subscription + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TestIamPermissionsRequest: Request message for `TestIamPermissions` +// method. +type TestIamPermissionsRequest struct { + // Permissions: The set of permissions to check for the `resource`. + // Permissions with wildcards (such as '*' or 'storage.*') are not + // allowed. + Permissions []string `json:"permissions,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Permissions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) { + type noMethod TestIamPermissionsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TestIamPermissionsResponse: Response message for `TestIamPermissions` +// method. +type TestIamPermissionsResponse struct { + // Permissions: A subset of `TestPermissionsRequest.permissions` that + // the caller is allowed. + Permissions []string `json:"permissions,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Permissions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { + type noMethod TestIamPermissionsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Topic: A topic resource. +type Topic struct { + // Name: The name of the topic. It must have the format + // "projects/{project}/topics/{topic}". `{topic}` must start with a + // letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), + // dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus + // (`+`) or percent signs (`%`). It must be between 3 and 255 characters + // in length, and it must not start with "goog". + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Topic) MarshalJSON() ([]byte, error) { + type noMethod Topic + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "pubsub.projects.subscriptions.acknowledge": + +type ProjectsSubscriptionsAcknowledgeCall struct { + s *Service + subscription string + acknowledgerequest *AcknowledgeRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Acknowledge: Acknowledges the messages associated with the `ack_ids` +// in the `AcknowledgeRequest`. The Pub/Sub system can remove the +// relevant messages from the subscription. Acknowledging a message +// whose ack deadline has expired may succeed, but such a message may be +// redelivered later. Acknowledging a message more than once will not +// result in an error. +func (r *ProjectsSubscriptionsService) Acknowledge(subscription string, acknowledgerequest *AcknowledgeRequest) *ProjectsSubscriptionsAcknowledgeCall { + c := &ProjectsSubscriptionsAcknowledgeCall{s: r.s, opt_: make(map[string]interface{})} + c.subscription = subscription + c.acknowledgerequest = acknowledgerequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSubscriptionsAcknowledgeCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsAcknowledgeCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSubscriptionsAcknowledgeCall) Context(ctx context.Context) *ProjectsSubscriptionsAcknowledgeCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSubscriptionsAcknowledgeCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.acknowledgerequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+subscription}:acknowledge") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "subscription": c.subscription, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.subscriptions.acknowledge" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsSubscriptionsAcknowledgeCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Acknowledges the messages associated with the `ack_ids` in the `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages from the subscription. Acknowledging a message whose ack deadline has expired may succeed, but such a message may be redelivered later. Acknowledging a message more than once will not result in an error.", + // "httpMethod": "POST", + // "id": "pubsub.projects.subscriptions.acknowledge", + // "parameterOrder": [ + // "subscription" + // ], + // "parameters": { + // "subscription": { + // "description": "The subscription whose message is being acknowledged.", + // "location": "path", + // "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta2/{+subscription}:acknowledge", + // "request": { + // "$ref": "AcknowledgeRequest" + // }, + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.subscriptions.create": + +type ProjectsSubscriptionsCreateCall struct { + s *Service + name string + subscription *Subscription + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a subscription to a given topic for a given +// subscriber. If the subscription already exists, returns +// `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns +// `NOT_FOUND`. If the name is not provided in the request, the server +// will assign a random name for this subscription on the same project +// as the topic. +func (r *ProjectsSubscriptionsService) Create(name string, subscription *Subscription) *ProjectsSubscriptionsCreateCall { + c := &ProjectsSubscriptionsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.name = name + c.subscription = subscription + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSubscriptionsCreateCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSubscriptionsCreateCall) Context(ctx context.Context) *ProjectsSubscriptionsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSubscriptionsCreateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.subscriptions.create" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsSubscriptionsCreateCall) Do() (*Subscription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a subscription to a given topic for a given subscriber. If the subscription already exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns `NOT_FOUND`. If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic.", + // "httpMethod": "PUT", + // "id": "pubsub.projects.subscriptions.create", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The name of the subscription. It must have the format `\"projects/{project}/subscriptions/{subscription}\"`. `{subscription}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `\"goog\"`.", + // "location": "path", + // "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta2/{+name}", + // "request": { + // "$ref": "Subscription" + // }, + // "response": { + // "$ref": "Subscription" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.subscriptions.delete": + +type ProjectsSubscriptionsDeleteCall struct { + s *Service + subscription string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes an existing subscription. All pending messages in the +// subscription are immediately dropped. Calls to `Pull` after deletion +// will return `NOT_FOUND`. After a subscription is deleted, a new one +// may be created with the same name, but the new one has no association +// with the old subscription, or its topic unless the same topic is +// specified. +func (r *ProjectsSubscriptionsService) Delete(subscription string) *ProjectsSubscriptionsDeleteCall { + c := &ProjectsSubscriptionsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.subscription = subscription + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSubscriptionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSubscriptionsDeleteCall) Context(ctx context.Context) *ProjectsSubscriptionsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+subscription}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "subscription": c.subscription, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.subscriptions.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsSubscriptionsDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to `Pull` after deletion will return `NOT_FOUND`. After a subscription is deleted, a new one may be created with the same name, but the new one has no association with the old subscription, or its topic unless the same topic is specified.", + // "httpMethod": "DELETE", + // "id": "pubsub.projects.subscriptions.delete", + // "parameterOrder": [ + // "subscription" + // ], + // "parameters": { + // "subscription": { + // "description": "The subscription to delete.", + // "location": "path", + // "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta2/{+subscription}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.subscriptions.get": + +type ProjectsSubscriptionsGetCall struct { + s *Service + subscription string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the configuration details of a subscription. +func (r *ProjectsSubscriptionsService) Get(subscription string) *ProjectsSubscriptionsGetCall { + c := &ProjectsSubscriptionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.subscription = subscription + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSubscriptionsGetCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsSubscriptionsGetCall) IfNoneMatch(entityTag string) *ProjectsSubscriptionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSubscriptionsGetCall) Context(ctx context.Context) *ProjectsSubscriptionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSubscriptionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+subscription}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "subscription": c.subscription, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.subscriptions.get" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsSubscriptionsGetCall) Do() (*Subscription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the configuration details of a subscription.", + // "httpMethod": "GET", + // "id": "pubsub.projects.subscriptions.get", + // "parameterOrder": [ + // "subscription" + // ], + // "parameters": { + // "subscription": { + // "description": "The name of the subscription to get.", + // "location": "path", + // "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta2/{+subscription}", + // "response": { + // "$ref": "Subscription" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.subscriptions.getIamPolicy": + +type ProjectsSubscriptionsGetIamPolicyCall struct { + s *Service + resource string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetIamPolicy: Gets the access control policy for a `resource`. Is +// empty if the policy or the resource does not exist. +func (r *ProjectsSubscriptionsService) GetIamPolicy(resource string) *ProjectsSubscriptionsGetIamPolicyCall { + c := &ProjectsSubscriptionsGetIamPolicyCall{s: r.s, opt_: make(map[string]interface{})} + c.resource = resource + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSubscriptionsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsGetIamPolicyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsSubscriptionsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsSubscriptionsGetIamPolicyCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSubscriptionsGetIamPolicyCall) Context(ctx context.Context) *ProjectsSubscriptionsGetIamPolicyCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSubscriptionsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.subscriptions.getIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsSubscriptionsGetIamPolicyCall) Do() (*Policy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the access control policy for a `resource`. Is empty if the policy or the resource does not exist.", + // "httpMethod": "GET", + // "id": "pubsub.projects.subscriptions.getIamPolicy", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which policy is being requested. Resource is usually specified as a path, such as, `projects/{project}`.", + // "location": "path", + // "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta2/{+resource}:getIamPolicy", + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.subscriptions.list": + +type ProjectsSubscriptionsListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists matching subscriptions. +func (r *ProjectsSubscriptionsService) List(project string) *ProjectsSubscriptionsListCall { + c := &ProjectsSubscriptionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// subscriptions to return. +func (c *ProjectsSubscriptionsListCall) PageSize(pageSize int64) *ProjectsSubscriptionsListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListSubscriptionsResponse`; indicates that this is a +// continuation of a prior `ListSubscriptions` call, and that the system +// should return the next page of data. +func (c *ProjectsSubscriptionsListCall) PageToken(pageToken string) *ProjectsSubscriptionsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSubscriptionsListCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsSubscriptionsListCall) IfNoneMatch(entityTag string) *ProjectsSubscriptionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSubscriptionsListCall) Context(ctx context.Context) *ProjectsSubscriptionsListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSubscriptionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+project}/subscriptions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.subscriptions.list" call. +// Exactly one of *ListSubscriptionsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListSubscriptionsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsSubscriptionsListCall) Do() (*ListSubscriptionsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListSubscriptionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists matching subscriptions.", + // "httpMethod": "GET", + // "id": "pubsub.projects.subscriptions.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "pageSize": { + // "description": "Maximum number of subscriptions to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last `ListSubscriptionsResponse`; indicates that this is a continuation of a prior `ListSubscriptions` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The name of the cloud project that subscriptions belong to.", + // "location": "path", + // "pattern": "^projects/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta2/{+project}/subscriptions", + // "response": { + // "$ref": "ListSubscriptionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.subscriptions.modifyAckDeadline": + +type ProjectsSubscriptionsModifyAckDeadlineCall struct { + s *Service + subscription string + modifyackdeadlinerequest *ModifyAckDeadlineRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// ModifyAckDeadline: Modifies the ack deadline for a specific message. +// This method is useful to indicate that more time is needed to process +// a message by the subscriber, or to make the message available for +// redelivery if the processing was interrupted. +func (r *ProjectsSubscriptionsService) ModifyAckDeadline(subscription string, modifyackdeadlinerequest *ModifyAckDeadlineRequest) *ProjectsSubscriptionsModifyAckDeadlineCall { + c := &ProjectsSubscriptionsModifyAckDeadlineCall{s: r.s, opt_: make(map[string]interface{})} + c.subscription = subscription + c.modifyackdeadlinerequest = modifyackdeadlinerequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSubscriptionsModifyAckDeadlineCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsModifyAckDeadlineCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSubscriptionsModifyAckDeadlineCall) Context(ctx context.Context) *ProjectsSubscriptionsModifyAckDeadlineCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSubscriptionsModifyAckDeadlineCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifyackdeadlinerequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+subscription}:modifyAckDeadline") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "subscription": c.subscription, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.subscriptions.modifyAckDeadline" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsSubscriptionsModifyAckDeadlineCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Modifies the ack deadline for a specific message. This method is useful to indicate that more time is needed to process a message by the subscriber, or to make the message available for redelivery if the processing was interrupted.", + // "httpMethod": "POST", + // "id": "pubsub.projects.subscriptions.modifyAckDeadline", + // "parameterOrder": [ + // "subscription" + // ], + // "parameters": { + // "subscription": { + // "description": "The name of the subscription.", + // "location": "path", + // "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta2/{+subscription}:modifyAckDeadline", + // "request": { + // "$ref": "ModifyAckDeadlineRequest" + // }, + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.subscriptions.modifyPushConfig": + +type ProjectsSubscriptionsModifyPushConfigCall struct { + s *Service + subscription string + modifypushconfigrequest *ModifyPushConfigRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// ModifyPushConfig: Modifies the `PushConfig` for a specified +// subscription. This may be used to change a push subscription to a +// pull one (signified by an empty `PushConfig`) or vice versa, or +// change the endpoint URL and other attributes of a push subscription. +// Messages will accumulate for delivery continuously through the call +// regardless of changes to the `PushConfig`. +func (r *ProjectsSubscriptionsService) ModifyPushConfig(subscription string, modifypushconfigrequest *ModifyPushConfigRequest) *ProjectsSubscriptionsModifyPushConfigCall { + c := &ProjectsSubscriptionsModifyPushConfigCall{s: r.s, opt_: make(map[string]interface{})} + c.subscription = subscription + c.modifypushconfigrequest = modifypushconfigrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSubscriptionsModifyPushConfigCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsModifyPushConfigCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSubscriptionsModifyPushConfigCall) Context(ctx context.Context) *ProjectsSubscriptionsModifyPushConfigCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSubscriptionsModifyPushConfigCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifypushconfigrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+subscription}:modifyPushConfig") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "subscription": c.subscription, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.subscriptions.modifyPushConfig" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsSubscriptionsModifyPushConfigCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Modifies the `PushConfig` for a specified subscription. This may be used to change a push subscription to a pull one (signified by an empty `PushConfig`) or vice versa, or change the endpoint URL and other attributes of a push subscription. Messages will accumulate for delivery continuously through the call regardless of changes to the `PushConfig`.", + // "httpMethod": "POST", + // "id": "pubsub.projects.subscriptions.modifyPushConfig", + // "parameterOrder": [ + // "subscription" + // ], + // "parameters": { + // "subscription": { + // "description": "The name of the subscription.", + // "location": "path", + // "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta2/{+subscription}:modifyPushConfig", + // "request": { + // "$ref": "ModifyPushConfigRequest" + // }, + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.subscriptions.pull": + +type ProjectsSubscriptionsPullCall struct { + s *Service + subscription string + pullrequest *PullRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Pull: Pulls messages from the server. Returns an empty list if there +// are no messages available in the backlog. The server may return +// `UNAVAILABLE` if there are too many concurrent pull requests pending +// for the given subscription. +func (r *ProjectsSubscriptionsService) Pull(subscription string, pullrequest *PullRequest) *ProjectsSubscriptionsPullCall { + c := &ProjectsSubscriptionsPullCall{s: r.s, opt_: make(map[string]interface{})} + c.subscription = subscription + c.pullrequest = pullrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSubscriptionsPullCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsPullCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSubscriptionsPullCall) Context(ctx context.Context) *ProjectsSubscriptionsPullCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSubscriptionsPullCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.pullrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+subscription}:pull") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "subscription": c.subscription, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.subscriptions.pull" call. +// Exactly one of *PullResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PullResponse.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsSubscriptionsPullCall) Do() (*PullResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PullResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Pulls messages from the server. Returns an empty list if there are no messages available in the backlog. The server may return `UNAVAILABLE` if there are too many concurrent pull requests pending for the given subscription.", + // "httpMethod": "POST", + // "id": "pubsub.projects.subscriptions.pull", + // "parameterOrder": [ + // "subscription" + // ], + // "parameters": { + // "subscription": { + // "description": "The subscription from which messages should be pulled.", + // "location": "path", + // "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta2/{+subscription}:pull", + // "request": { + // "$ref": "PullRequest" + // }, + // "response": { + // "$ref": "PullResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.subscriptions.setIamPolicy": + +type ProjectsSubscriptionsSetIamPolicyCall struct { + s *Service + resource string + setiampolicyrequest *SetIamPolicyRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetIamPolicy: Sets the access control policy on the specified +// resource. Replaces any existing policy. +func (r *ProjectsSubscriptionsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsSubscriptionsSetIamPolicyCall { + c := &ProjectsSubscriptionsSetIamPolicyCall{s: r.s, opt_: make(map[string]interface{})} + c.resource = resource + c.setiampolicyrequest = setiampolicyrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSubscriptionsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsSetIamPolicyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSubscriptionsSetIamPolicyCall) Context(ctx context.Context) *ProjectsSubscriptionsSetIamPolicyCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSubscriptionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.subscriptions.setIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsSubscriptionsSetIamPolicyCall) Do() (*Policy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", + // "httpMethod": "POST", + // "id": "pubsub.projects.subscriptions.setIamPolicy", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which policy is being specified. `resource` is usually specified as a path, such as, `projects/{project}/zones/{zone}/disks/{disk}`.", + // "location": "path", + // "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta2/{+resource}:setIamPolicy", + // "request": { + // "$ref": "SetIamPolicyRequest" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.subscriptions.testIamPermissions": + +type ProjectsSubscriptionsTestIamPermissionsCall struct { + s *Service + resource string + testiampermissionsrequest *TestIamPermissionsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// TestIamPermissions: Returns permissions that a caller has on the +// specified resource. +func (r *ProjectsSubscriptionsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsSubscriptionsTestIamPermissionsCall { + c := &ProjectsSubscriptionsTestIamPermissionsCall{s: r.s, opt_: make(map[string]interface{})} + c.resource = resource + c.testiampermissionsrequest = testiampermissionsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsSubscriptionsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsSubscriptionsTestIamPermissionsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsSubscriptionsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsSubscriptionsTestIamPermissionsCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSubscriptionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.subscriptions.testIamPermissions" call. +// Exactly one of *TestIamPermissionsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TestIamPermissionsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsSubscriptionsTestIamPermissionsCall) Do() (*TestIamPermissionsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TestIamPermissionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns permissions that a caller has on the specified resource.", + // "httpMethod": "POST", + // "id": "pubsub.projects.subscriptions.testIamPermissions", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which policy detail is being requested. `resource` is usually specified as a path, such as, `projects/{project}`.", + // "location": "path", + // "pattern": "^projects/[^/]*/subscriptions/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta2/{+resource}:testIamPermissions", + // "request": { + // "$ref": "TestIamPermissionsRequest" + // }, + // "response": { + // "$ref": "TestIamPermissionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.topics.create": + +type ProjectsTopicsCreateCall struct { + s *Service + name string + topic *Topic + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates the given topic with the given name. +func (r *ProjectsTopicsService) Create(name string, topic *Topic) *ProjectsTopicsCreateCall { + c := &ProjectsTopicsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.name = name + c.topic = topic + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsTopicsCreateCall) Fields(s ...googleapi.Field) *ProjectsTopicsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsTopicsCreateCall) Context(ctx context.Context) *ProjectsTopicsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsTopicsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.topic) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.topics.create" call. +// Exactly one of *Topic or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Topic.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsTopicsCreateCall) Do() (*Topic, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Topic{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates the given topic with the given name.", + // "httpMethod": "PUT", + // "id": "pubsub.projects.topics.create", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The name of the topic. It must have the format `\"projects/{project}/topics/{topic}\"`. `{topic}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `\"goog\"`.", + // "location": "path", + // "pattern": "^projects/[^/]*/topics/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta2/{+name}", + // "request": { + // "$ref": "Topic" + // }, + // "response": { + // "$ref": "Topic" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.topics.delete": + +type ProjectsTopicsDeleteCall struct { + s *Service + topic string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the topic with the given name. Returns `NOT_FOUND` if +// the topic does not exist. After a topic is deleted, a new topic may +// be created with the same name; this is an entirely new topic with +// none of the old configuration or subscriptions. Existing +// subscriptions to this topic are not deleted, but their `topic` field +// is set to `_deleted-topic_`. +func (r *ProjectsTopicsService) Delete(topic string) *ProjectsTopicsDeleteCall { + c := &ProjectsTopicsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.topic = topic + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsTopicsDeleteCall) Fields(s ...googleapi.Field) *ProjectsTopicsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsTopicsDeleteCall) Context(ctx context.Context) *ProjectsTopicsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsTopicsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+topic}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "topic": c.topic, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.topics.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsTopicsDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a topic is deleted, a new topic may be created with the same name; this is an entirely new topic with none of the old configuration or subscriptions. Existing subscriptions to this topic are not deleted, but their `topic` field is set to `_deleted-topic_`.", + // "httpMethod": "DELETE", + // "id": "pubsub.projects.topics.delete", + // "parameterOrder": [ + // "topic" + // ], + // "parameters": { + // "topic": { + // "description": "Name of the topic to delete.", + // "location": "path", + // "pattern": "^projects/[^/]*/topics/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta2/{+topic}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.topics.get": + +type ProjectsTopicsGetCall struct { + s *Service + topic string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the configuration of a topic. +func (r *ProjectsTopicsService) Get(topic string) *ProjectsTopicsGetCall { + c := &ProjectsTopicsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.topic = topic + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsTopicsGetCall) Fields(s ...googleapi.Field) *ProjectsTopicsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsTopicsGetCall) IfNoneMatch(entityTag string) *ProjectsTopicsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsTopicsGetCall) Context(ctx context.Context) *ProjectsTopicsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsTopicsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+topic}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "topic": c.topic, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.topics.get" call. +// Exactly one of *Topic or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Topic.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsTopicsGetCall) Do() (*Topic, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Topic{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the configuration of a topic.", + // "httpMethod": "GET", + // "id": "pubsub.projects.topics.get", + // "parameterOrder": [ + // "topic" + // ], + // "parameters": { + // "topic": { + // "description": "The name of the topic to get.", + // "location": "path", + // "pattern": "^projects/[^/]*/topics/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta2/{+topic}", + // "response": { + // "$ref": "Topic" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.topics.getIamPolicy": + +type ProjectsTopicsGetIamPolicyCall struct { + s *Service + resource string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetIamPolicy: Gets the access control policy for a `resource`. Is +// empty if the policy or the resource does not exist. +func (r *ProjectsTopicsService) GetIamPolicy(resource string) *ProjectsTopicsGetIamPolicyCall { + c := &ProjectsTopicsGetIamPolicyCall{s: r.s, opt_: make(map[string]interface{})} + c.resource = resource + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsTopicsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsTopicsGetIamPolicyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsTopicsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsTopicsGetIamPolicyCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsTopicsGetIamPolicyCall) Context(ctx context.Context) *ProjectsTopicsGetIamPolicyCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsTopicsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.topics.getIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsTopicsGetIamPolicyCall) Do() (*Policy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the access control policy for a `resource`. Is empty if the policy or the resource does not exist.", + // "httpMethod": "GET", + // "id": "pubsub.projects.topics.getIamPolicy", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which policy is being requested. Resource is usually specified as a path, such as, `projects/{project}`.", + // "location": "path", + // "pattern": "^projects/[^/]*/topics/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta2/{+resource}:getIamPolicy", + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.topics.list": + +type ProjectsTopicsListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists matching topics. +func (r *ProjectsTopicsService) List(project string) *ProjectsTopicsListCall { + c := &ProjectsTopicsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// topics to return. +func (c *ProjectsTopicsListCall) PageSize(pageSize int64) *ProjectsTopicsListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListTopicsResponse`; indicates that this is a +// continuation of a prior `ListTopics` call, and that the system should +// return the next page of data. +func (c *ProjectsTopicsListCall) PageToken(pageToken string) *ProjectsTopicsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsTopicsListCall) Fields(s ...googleapi.Field) *ProjectsTopicsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsTopicsListCall) IfNoneMatch(entityTag string) *ProjectsTopicsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsTopicsListCall) Context(ctx context.Context) *ProjectsTopicsListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsTopicsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+project}/topics") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.topics.list" call. +// Exactly one of *ListTopicsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListTopicsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsTopicsListCall) Do() (*ListTopicsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListTopicsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists matching topics.", + // "httpMethod": "GET", + // "id": "pubsub.projects.topics.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "pageSize": { + // "description": "Maximum number of topics to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last `ListTopicsResponse`; indicates that this is a continuation of a prior `ListTopics` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The name of the cloud project that topics belong to.", + // "location": "path", + // "pattern": "^projects/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta2/{+project}/topics", + // "response": { + // "$ref": "ListTopicsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.topics.publish": + +type ProjectsTopicsPublishCall struct { + s *Service + topic string + publishrequest *PublishRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Publish: Adds one or more messages to the topic. Returns `NOT_FOUND` +// if the topic does not exist. The message payload must not be empty; +// it must contain either a non-empty data field, or at least one +// attribute. +func (r *ProjectsTopicsService) Publish(topic string, publishrequest *PublishRequest) *ProjectsTopicsPublishCall { + c := &ProjectsTopicsPublishCall{s: r.s, opt_: make(map[string]interface{})} + c.topic = topic + c.publishrequest = publishrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsTopicsPublishCall) Fields(s ...googleapi.Field) *ProjectsTopicsPublishCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsTopicsPublishCall) Context(ctx context.Context) *ProjectsTopicsPublishCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsTopicsPublishCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.publishrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+topic}:publish") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "topic": c.topic, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.topics.publish" call. +// Exactly one of *PublishResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *PublishResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsTopicsPublishCall) Do() (*PublishResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PublishResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic does not exist. The message payload must not be empty; it must contain either a non-empty data field, or at least one attribute.", + // "httpMethod": "POST", + // "id": "pubsub.projects.topics.publish", + // "parameterOrder": [ + // "topic" + // ], + // "parameters": { + // "topic": { + // "description": "The messages in the request will be published on this topic.", + // "location": "path", + // "pattern": "^projects/[^/]*/topics/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta2/{+topic}:publish", + // "request": { + // "$ref": "PublishRequest" + // }, + // "response": { + // "$ref": "PublishResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.topics.setIamPolicy": + +type ProjectsTopicsSetIamPolicyCall struct { + s *Service + resource string + setiampolicyrequest *SetIamPolicyRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetIamPolicy: Sets the access control policy on the specified +// resource. Replaces any existing policy. +func (r *ProjectsTopicsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsTopicsSetIamPolicyCall { + c := &ProjectsTopicsSetIamPolicyCall{s: r.s, opt_: make(map[string]interface{})} + c.resource = resource + c.setiampolicyrequest = setiampolicyrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsTopicsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsTopicsSetIamPolicyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsTopicsSetIamPolicyCall) Context(ctx context.Context) *ProjectsTopicsSetIamPolicyCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsTopicsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.topics.setIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsTopicsSetIamPolicyCall) Do() (*Policy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", + // "httpMethod": "POST", + // "id": "pubsub.projects.topics.setIamPolicy", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which policy is being specified. `resource` is usually specified as a path, such as, `projects/{project}/zones/{zone}/disks/{disk}`.", + // "location": "path", + // "pattern": "^projects/[^/]*/topics/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta2/{+resource}:setIamPolicy", + // "request": { + // "$ref": "SetIamPolicyRequest" + // }, + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.topics.testIamPermissions": + +type ProjectsTopicsTestIamPermissionsCall struct { + s *Service + resource string + testiampermissionsrequest *TestIamPermissionsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// TestIamPermissions: Returns permissions that a caller has on the +// specified resource. +func (r *ProjectsTopicsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsTopicsTestIamPermissionsCall { + c := &ProjectsTopicsTestIamPermissionsCall{s: r.s, opt_: make(map[string]interface{})} + c.resource = resource + c.testiampermissionsrequest = testiampermissionsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsTopicsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsTopicsTestIamPermissionsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsTopicsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsTopicsTestIamPermissionsCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsTopicsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.topics.testIamPermissions" call. +// Exactly one of *TestIamPermissionsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TestIamPermissionsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsTopicsTestIamPermissionsCall) Do() (*TestIamPermissionsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TestIamPermissionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns permissions that a caller has on the specified resource.", + // "httpMethod": "POST", + // "id": "pubsub.projects.topics.testIamPermissions", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "resource": { + // "description": "REQUIRED: The resource for which policy detail is being requested. `resource` is usually specified as a path, such as, `projects/{project}`.", + // "location": "path", + // "pattern": "^projects/[^/]*/topics/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta2/{+resource}:testIamPermissions", + // "request": { + // "$ref": "TestIamPermissionsRequest" + // }, + // "response": { + // "$ref": "TestIamPermissionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} + +// method id "pubsub.projects.topics.subscriptions.list": + +type ProjectsTopicsSubscriptionsListCall struct { + s *Service + topic string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the name of the subscriptions for this topic. +func (r *ProjectsTopicsSubscriptionsService) List(topic string) *ProjectsTopicsSubscriptionsListCall { + c := &ProjectsTopicsSubscriptionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.topic = topic + return c +} + +// PageSize sets the optional parameter "pageSize": Maximum number of +// subscription names to return. +func (c *ProjectsTopicsSubscriptionsListCall) PageSize(pageSize int64) *ProjectsTopicsSubscriptionsListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": The value returned +// by the last `ListTopicSubscriptionsResponse`; indicates that this is +// a continuation of a prior `ListTopicSubscriptions` call, and that the +// system should return the next page of data. +func (c *ProjectsTopicsSubscriptionsListCall) PageToken(pageToken string) *ProjectsTopicsSubscriptionsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsTopicsSubscriptionsListCall) Fields(s ...googleapi.Field) *ProjectsTopicsSubscriptionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsTopicsSubscriptionsListCall) IfNoneMatch(entityTag string) *ProjectsTopicsSubscriptionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ProjectsTopicsSubscriptionsListCall) Context(ctx context.Context) *ProjectsTopicsSubscriptionsListCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsTopicsSubscriptionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+topic}/subscriptions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "topic": c.topic, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "pubsub.projects.topics.subscriptions.list" call. +// Exactly one of *ListTopicSubscriptionsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListTopicSubscriptionsResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsTopicsSubscriptionsListCall) Do() (*ListTopicSubscriptionsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListTopicSubscriptionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the name of the subscriptions for this topic.", + // "httpMethod": "GET", + // "id": "pubsub.projects.topics.subscriptions.list", + // "parameterOrder": [ + // "topic" + // ], + // "parameters": { + // "pageSize": { + // "description": "Maximum number of subscription names to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The value returned by the last `ListTopicSubscriptionsResponse`; indicates that this is a continuation of a prior `ListTopicSubscriptions` call, and that the system should return the next page of data.", + // "location": "query", + // "type": "string" + // }, + // "topic": { + // "description": "The name of the topic that subscriptions are attached to.", + // "location": "path", + // "pattern": "^projects/[^/]*/topics/[^/]*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1beta2/{+topic}/subscriptions", + // "response": { + // "$ref": "ListTopicSubscriptionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/pubsub" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/qpxexpress/v1/qpxexpress-api.json b/Godeps/_workspace/src/google.golang.org/api/qpxexpress/v1/qpxexpress-api.json new file mode 100644 index 000000000..c863e0f5e --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/qpxexpress/v1/qpxexpress-api.json @@ -0,0 +1,895 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"FrPV2U6xXFUq8eRv_PO3IoAURkc/oRXkfQJbU2CyvfsUv40EHopWGd0\"", + "discoveryVersion": "v1", + "id": "qpxExpress:v1", + "name": "qpxExpress", + "canonicalName": "QPX Express", + "version": "v1", + "revision": "20140321", + "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/Godeps/_workspace/src/google.golang.org/api/qpxexpress/v1/qpxexpress-gen.go b/Godeps/_workspace/src/google.golang.org/api/qpxexpress/v1/qpxexpress-gen.go new file mode 100644 index 000000000..d15e7a1a4 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/qpxexpress/v1/qpxexpress-gen.go @@ -0,0 +1,1155 @@ +// Package qpxexpress provides access to the QPX Express API. +// +// See http://developers.google.com/qpx-express +// +// Usage example: +// +// import "google.golang.org/api/qpxexpress/v1" +// ... +// qpxexpressService, err := qpxexpress.New(oauthHttpClient) +package qpxexpress // import "google.golang.org/api/qpxexpress/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Trips *TripsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewTripsService(s *Service) *TripsService { + rs := &TripsService{s: s} + return rs +} + +type TripsService struct { + s *Service +} + +// AircraftData: The make, model, and type of an aircraft. +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"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AircraftData) MarshalJSON() ([]byte, error) { + type noMethod AircraftData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AirportData: An airport. +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"` + + // ForceSendFields is a list of field names (e.g. "City") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AirportData) MarshalJSON() ([]byte, error) { + type noMethod AirportData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BagDescriptor: Information about an item of baggage. +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"` + + // ForceSendFields is a list of field names (e.g. "CommercialName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BagDescriptor) MarshalJSON() ([]byte, error) { + type noMethod BagDescriptor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CarrierData: Information about a carrier (ie. an airline, bus line, +// railroad, etc) that might be useful to display to an end-user. +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"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CarrierData) MarshalJSON() ([]byte, error) { + type noMethod CarrierData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CityData: Information about a city that might be useful to an +// end-user; typically the city of an airport. +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"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CityData) MarshalJSON() ([]byte, error) { + type noMethod CityData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Data: Detailed information about components found in the solutions of +// this response, including a trip's airport, city, taxes, airline, and +// aircraft. +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"` + + // ForceSendFields is a list of field names (e.g. "Aircraft") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Data) MarshalJSON() ([]byte, error) { + type noMethod Data + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FareInfo: 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.) +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"` + + // ForceSendFields is a list of field names (e.g. "BasisCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FareInfo) MarshalJSON() ([]byte, error) { + type noMethod FareInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FlightInfo: 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. +type FlightInfo struct { + Carrier string `json:"carrier,omitempty"` + + // Number: The flight number. + Number string `json:"number,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Carrier") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FlightInfo) MarshalJSON() ([]byte, error) { + type noMethod FlightInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FreeBaggageAllowance: Information about free baggage allowed on one +// segment of a trip. +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"` + + // ForceSendFields is a list of field names (e.g. "BagDescriptor") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FreeBaggageAllowance) MarshalJSON() ([]byte, error) { + type noMethod FreeBaggageAllowance + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LegInfo: 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.) +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"` + + // ForceSendFields is a list of field names (e.g. "Aircraft") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LegInfo) MarshalJSON() ([]byte, error) { + type noMethod LegInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PassengerCounts: The number and type of passengers. Unfortunately the +// definition of an infant, child, adult, and senior citizen varies +// across carriers and reservation systems. +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"` + + // ForceSendFields is a list of field names (e.g. "AdultCount") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PassengerCounts) MarshalJSON() ([]byte, error) { + type noMethod PassengerCounts + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PricingInfo: 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. +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"` + + // ForceSendFields is a list of field names (e.g. "BaseFareTotal") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PricingInfo) MarshalJSON() ([]byte, error) { + type noMethod PricingInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SegmentInfo: 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). +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"` + + // ForceSendFields is a list of field names (e.g. "BookingCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SegmentInfo) MarshalJSON() ([]byte, error) { + type noMethod SegmentInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SegmentPricing: The price of this segment. +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"` + + // ForceSendFields is a list of field names (e.g. "FareId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SegmentPricing) MarshalJSON() ([]byte, error) { + type noMethod SegmentPricing + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SliceInfo: 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: +// | Origin | Destination | Departure Date | | BOS | LAX | March 10, +// 2007 | | LAX | SYD | March 17, 2007 | | SYD | BOS | March 22, 2007 +// | +// then this is a three slice trip. +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"` + + // ForceSendFields is a list of field names (e.g. "Duration") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SliceInfo) MarshalJSON() ([]byte, error) { + type noMethod SliceInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SliceInput: Criteria a desired slice must satisfy. +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"` + + // ForceSendFields is a list of field names (e.g. "Alliance") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SliceInput) MarshalJSON() ([]byte, error) { + type noMethod SliceInput + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TaxData: Tax data. +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TaxData) MarshalJSON() ([]byte, error) { + type noMethod TaxData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TaxInfo: Tax information. +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"` + + // ForceSendFields is a list of field names (e.g. "ChargeType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TaxInfo) MarshalJSON() ([]byte, error) { + type noMethod TaxInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TimeOfDayRange: Two times in a single day defining a time range. +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"` + + // ForceSendFields is a list of field names (e.g. "EarliestTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TimeOfDayRange) MarshalJSON() ([]byte, error) { + type noMethod TimeOfDayRange + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TripOption: Trip information. +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"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TripOption) MarshalJSON() ([]byte, error) { + type noMethod TripOption + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TripOptionsRequest: A QPX Express search request, which will yield +// one or more solutions. +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"` + + // ForceSendFields is a list of field names (e.g. "MaxPrice") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TripOptionsRequest) MarshalJSON() ([]byte, error) { + type noMethod TripOptionsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TripOptionsResponse: A QPX Express search response. +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"` + + // ForceSendFields is a list of field names (e.g. "Data") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TripOptionsResponse) MarshalJSON() ([]byte, error) { + type noMethod TripOptionsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TripsSearchRequest: A QPX Express search request. +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"` + + // ForceSendFields is a list of field names (e.g. "Request") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TripsSearchRequest) MarshalJSON() ([]byte, error) { + type noMethod TripsSearchRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TripsSearchResponse: A QPX Express search response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TripsSearchResponse) MarshalJSON() ([]byte, error) { + type noMethod TripsSearchResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "qpxExpress.trips.search": + +type TripsSearchCall struct { + s *Service + tripssearchrequest *TripsSearchRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TripsSearchCall) Fields(s ...googleapi.Field) *TripsSearchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TripsSearchCall) Context(ctx context.Context) *TripsSearchCall { + c.ctx_ = ctx + return c +} + +func (c *TripsSearchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "qpxExpress.trips.search" call. +// Exactly one of *TripsSearchResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TripsSearchResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TripsSearchCall) Do() (*TripsSearchResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TripsSearchResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a list of flights.", + // "httpMethod": "POST", + // "id": "qpxExpress.trips.search", + // "path": "search", + // "request": { + // "$ref": "TripsSearchRequest" + // }, + // "response": { + // "$ref": "TripsSearchResponse" + // } + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/replicapool/v1beta1/replicapool-api.json b/Godeps/_workspace/src/google.golang.org/api/replicapool/v1beta1/replicapool-api.json new file mode 100644 index 000000000..7d82f2664 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/replicapool/v1beta1/replicapool-api.json @@ -0,0 +1,1116 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/3LBsJh0TU5kp5gt4okT0XAt0lsw\"", + "discoveryVersion": "v1", + "id": "replicapool:v1beta1", + "name": "replicapool", + "version": "v1beta1", + "revision": "20150708", + "title": "Replica Pool API", + "description": "The Replica Pool API allows users to declaratively provision and manage groups of Google Compute Engine instances based on a common template.", + "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/compute/docs/replica-pool/", + "labels": [ + "limited_availability" + ], + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/replicapool/v1beta1/projects/", + "basePath": "/replicapool/v1beta1/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "replicapool/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/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/ndev.cloudman": { + "description": "View and manage your Google Cloud Platform management resources and deployment status information" + }, + "https://www.googleapis.com/auth/ndev.cloudman.readonly": { + "description": "View your Google Cloud Platform management resources and deployment status information" + }, + "https://www.googleapis.com/auth/replicapool": { + "description": "View and manage replica pools" + }, + "https://www.googleapis.com/auth/replicapool.readonly": { + "description": "View replica pools" + } + } + } + }, + "schemas": { + "AccessConfig": { + "id": "AccessConfig", + "type": "object", + "description": "A Compute Engine network accessConfig. Identical to the accessConfig on corresponding Compute Engine resource.", + "properties": { + "name": { + "type": "string", + "description": "Name of this access configuration." + }, + "natIp": { + "type": "string", + "description": "An external IP address associated with this instance." + }, + "type": { + "type": "string", + "description": "Type of this access configuration file. Currently only ONE_TO_ONE_NAT is supported." + } + } + }, + "Action": { + "id": "Action", + "type": "object", + "description": "An action that gets executed during initialization of the replicas.", + "properties": { + "commands": { + "type": "array", + "description": "A list of commands to run, one per line. If any command fails, the whole action is considered a failure and no further actions are run. This also marks the virtual machine or replica as a failure.", + "items": { + "type": "string" + } + }, + "envVariables": { + "type": "array", + "description": "A list of environment variables to use for the commands in this action.", + "items": { + "$ref": "EnvVariable" + } + }, + "timeoutMilliSeconds": { + "type": "integer", + "description": "If an action's commands on a particular replica do not finish in the specified timeoutMilliSeconds, the replica is considered to be in a FAILING state. No efforts are made to stop any processes that were spawned or created as the result of running the action's commands. The default is the max allowed value, 1 hour (i.e. 3600000 milliseconds).", + "format": "int32" + } + } + }, + "DiskAttachment": { + "id": "DiskAttachment", + "type": "object", + "description": "Specifies how to attach a disk to a Replica.", + "properties": { + "deviceName": { + "type": "string", + "description": "The device name of this disk." + }, + "index": { + "type": "integer", + "description": "A zero-based index to assign to this disk, where 0 is reserved for the boot disk. If not specified, this is assigned by the server.", + "format": "uint32" + } + } + }, + "EnvVariable": { + "id": "EnvVariable", + "type": "object", + "description": "An environment variable to set for an action.", + "properties": { + "hidden": { + "type": "boolean", + "description": "Deprecated, do not use." + }, + "name": { + "type": "string", + "description": "The name of the environment variable." + }, + "value": { + "type": "string", + "description": "The value of the variable." + } + } + }, + "ExistingDisk": { + "id": "ExistingDisk", + "type": "object", + "description": "A pre-existing persistent disk that will be attached to every Replica in the Pool in READ_ONLY mode.", + "properties": { + "attachment": { + "$ref": "DiskAttachment", + "description": "How the disk will be attached to the Replica." + }, + "source": { + "type": "string", + "description": "The name of the Persistent Disk resource. The Persistent Disk resource must be in the same zone as the Pool." + } + } + }, + "HealthCheck": { + "id": "HealthCheck", + "type": "object", + "properties": { + "checkIntervalSec": { + "type": "integer", + "description": "How often (in seconds) to make HTTP requests for this healthcheck. The default value is 5 seconds.", + "format": "int32" + }, + "description": { + "type": "string", + "description": "The description for this health check." + }, + "healthyThreshold": { + "type": "integer", + "description": "The number of consecutive health check requests that need to succeed before the replica is considered healthy again. 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 localhost IP 127.0.0.1 will be used." + }, + "name": { + "type": "string", + "description": "The name of this health check." + }, + "path": { + "type": "string", + "description": "The localhost request path to send this health check, in the format /path/to/use. For example, /healthcheck." + }, + "port": { + "type": "integer", + "description": "The TCP port for the health check requests.", + "format": "int32" + }, + "timeoutSec": { + "type": "integer", + "description": "How long (in seconds) to wait before a timeout failure for this healthcheck. The default value is 5 seconds.", + "format": "int32" + }, + "unhealthyThreshold": { + "type": "integer", + "description": "The number of consecutive health check requests that need to fail in order to consider the replica unhealthy. The default value is 2.", + "format": "int32" + } + } + }, + "Label": { + "id": "Label", + "type": "object", + "description": "A label to apply to this replica pool.", + "properties": { + "key": { + "type": "string", + "description": "The key for this label." + }, + "value": { + "type": "string", + "description": "The value of this label." + } + } + }, + "Metadata": { + "id": "Metadata", + "type": "object", + "description": "A Compute Engine metadata entry. Identical to the metadata on the corresponding Compute Engine resource.", + "properties": { + "fingerPrint": { + "type": "string", + "description": "The fingerprint of the metadata. Required for updating the metadata entries for this instance." + }, + "items": { + "type": "array", + "description": "A list of metadata items.", + "items": { + "$ref": "MetadataItem" + } + } + } + }, + "MetadataItem": { + "id": "MetadataItem", + "type": "object", + "description": "A Compute Engine metadata item, defined as a key:value pair. Identical to the metadata on the corresponding Compute Engine resource.", + "properties": { + "key": { + "type": "string", + "description": "A metadata key." + }, + "value": { + "type": "string", + "description": "A metadata value." + } + } + }, + "NetworkInterface": { + "id": "NetworkInterface", + "type": "object", + "description": "A Compute Engine NetworkInterface resource. Identical to the NetworkInterface on the corresponding Compute Engine resource.", + "properties": { + "accessConfigs": { + "type": "array", + "description": "An array of configurations for this interface. This specifies how this interface is configured to interact with other network services.", + "items": { + "$ref": "AccessConfig" + } + }, + "network": { + "type": "string", + "description": "Name the Network resource to which this interface applies." + }, + "networkIp": { + "type": "string", + "description": "An optional IPV4 internal network address to assign to the instance for this network interface." + } + } + }, + "NewDisk": { + "id": "NewDisk", + "type": "object", + "description": "A Persistent Disk resource that will be created and attached to each Replica in the Pool. Each Replica will have a unique persistent disk that is created and attached to that Replica in READ_WRITE mode.", + "properties": { + "attachment": { + "$ref": "DiskAttachment", + "description": "How the disk will be attached to the Replica." + }, + "autoDelete": { + "type": "boolean", + "description": "If true, then this disk will be deleted when the instance is deleted. The default value is true." + }, + "boot": { + "type": "boolean", + "description": "If true, indicates that this is the root persistent disk." + }, + "initializeParams": { + "$ref": "NewDiskInitializeParams", + "description": "Create the new disk using these parameters. The name of the disk will be \u003cinstance_name\u003e-\u003cfour_random_charactersgt;." + } + } + }, + "NewDiskInitializeParams": { + "id": "NewDiskInitializeParams", + "type": "object", + "description": "Initialization parameters for creating a new disk.", + "properties": { + "diskSizeGb": { + "type": "string", + "description": "The size of the created disk in gigabytes.", + "format": "int64" + }, + "diskType": { + "type": "string", + "description": "Name of the disk type resource describing which disk type to use to create the disk. For example 'pd-ssd' or 'pd-standard'. Default is 'pd-standard'" + }, + "sourceImage": { + "type": "string", + "description": "The name or fully-qualified URL of a source image to use to create this disk. If you provide a name of the source image, Replica Pool will look for an image with that name in your project. If you are specifying an image provided by Compute Engine, you will need to provide the full URL with the correct project, such as:\nhttp://www.googleapis.com/compute/v1/projects/debian-cloud/ global/images/debian-wheezy-7-vYYYYMMDD" + } + } + }, + "Pool": { + "id": "Pool", + "type": "object", + "properties": { + "autoRestart": { + "type": "boolean", + "description": "Whether replicas in this pool should be restarted if they experience a failure. The default value is true." + }, + "baseInstanceName": { + "type": "string", + "description": "The base instance name to use for the replicas in this pool. This must match the regex [a-z]([-a-z0-9]*[a-z0-9])?. If specified, the instances in this replica pool will be named in the format \u003cbase-instance-name\u003e-\u003cID\u003e. The \u003cID\u003e postfix will be a four character alphanumeric identifier generated by the service.\n\nIf this is not specified by the user, a random base instance name is generated by the service." + }, + "currentNumReplicas": { + "type": "integer", + "description": "[Output Only] The current number of replicas in the pool.", + "format": "int32" + }, + "description": { + "type": "string", + "description": "An optional description of the replica pool." + }, + "healthChecks": { + "type": "array", + "description": "Deprecated. Please use template[].healthChecks instead.", + "items": { + "$ref": "HealthCheck" + } + }, + "initialNumReplicas": { + "type": "integer", + "description": "The initial number of replicas this pool should have. You must provide a value greater than or equal to 0.", + "format": "int32" + }, + "labels": { + "type": "array", + "description": "A list of labels to attach to this replica pool and all created virtual machines in this replica pool.", + "items": { + "$ref": "Label" + } + }, + "name": { + "type": "string", + "description": "The name of the replica pool. Must follow the regex [a-z]([-a-z0-9]*[a-z0-9])? and be 1-28 characters long." + }, + "numReplicas": { + "type": "integer", + "description": "Deprecated! Use initial_num_replicas instead.", + "format": "int32" + }, + "resourceViews": { + "type": "array", + "description": "The list of resource views that should be updated with all the replicas that are managed by this pool.", + "items": { + "type": "string" + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] A self-link to the replica pool." + }, + "targetPool": { + "type": "string", + "description": "Deprecated, please use target_pools instead." + }, + "targetPools": { + "type": "array", + "description": "A list of target pools to update with the replicas that are managed by this pool. If specified, the replicas in this replica pool will be added to the specified target pools for load balancing purposes. The replica pool must live in the same region as the specified target pools. These values must be the target pool resource names, and not fully qualified URLs.", + "items": { + "type": "string" + } + }, + "template": { + "$ref": "Template", + "description": "The template to use when creating replicas in this pool. This template is used during initial instance creation of the pool, when growing the pool in size, or when a replica restarts." + }, + "type": { + "type": "string", + "description": "Deprecated! Do not set." + } + } + }, + "PoolsDeleteRequest": { + "id": "PoolsDeleteRequest", + "type": "object", + "properties": { + "abandonInstances": { + "type": "array", + "description": "If there are instances you would like to keep, you can specify them here. These instances won't be deleted, but the associated replica objects will be removed.", + "items": { + "type": "string" + } + } + } + }, + "PoolsListResponse": { + "id": "PoolsListResponse", + "type": "object", + "properties": { + "nextPageToken": { + "type": "string" + }, + "resources": { + "type": "array", + "items": { + "$ref": "Pool" + } + } + } + }, + "Replica": { + "id": "Replica", + "type": "object", + "description": "An individual Replica within a Pool. Replicas are automatically created by the replica pool, using the template provided by the user. You cannot directly create replicas.", + "properties": { + "name": { + "type": "string", + "description": "[Output Only] The name of the Replica object." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The self-link of the Replica." + }, + "status": { + "$ref": "ReplicaStatus", + "description": "[Output Only] Last known status of the Replica." + } + } + }, + "ReplicaStatus": { + "id": "ReplicaStatus", + "type": "object", + "description": "The current status of a Replica.", + "properties": { + "details": { + "type": "string", + "description": "[Output Only] Human-readable details about the current state of the replica" + }, + "state": { + "type": "string", + "description": "[Output Only] The state of the Replica." + }, + "templateVersion": { + "type": "string", + "description": "[Output Only] The template used to build the replica." + }, + "vmLink": { + "type": "string", + "description": "[Output Only] Link to the virtual machine that this Replica represents." + }, + "vmStartTime": { + "type": "string", + "description": "[Output Only] The time that this Replica got to the RUNNING state, in RFC 3339 format. If the start time is unknown, UNKNOWN is returned." + } + } + }, + "ReplicasDeleteRequest": { + "id": "ReplicasDeleteRequest", + "type": "object", + "properties": { + "abandonInstance": { + "type": "boolean", + "description": "Whether the instance resource represented by this replica should be deleted or abandoned. If abandoned, the replica will be deleted but the virtual machine instance will remain. By default, this is set to false and the instance will be deleted along with the replica." + } + } + }, + "ReplicasListResponse": { + "id": "ReplicasListResponse", + "type": "object", + "properties": { + "nextPageToken": { + "type": "string" + }, + "resources": { + "type": "array", + "items": { + "$ref": "Replica" + } + } + } + }, + "ServiceAccount": { + "id": "ServiceAccount", + "type": "object", + "description": "A Compute Engine service account, identical to the Compute Engine resource.", + "properties": { + "email": { + "type": "string", + "description": "The service account email address, for example: 123845678986@project.gserviceaccount.com" + }, + "scopes": { + "type": "array", + "description": "The list of OAuth2 scopes to obtain for the service account, for example: https://www.googleapis.com/auth/devstorage.full_control", + "items": { + "type": "string" + } + } + } + }, + "Tag": { + "id": "Tag", + "type": "object", + "description": "A Compute Engine Instance tag, identical to the tags on the corresponding Compute Engine Instance resource.", + "properties": { + "fingerPrint": { + "type": "string", + "description": "The fingerprint of the tag. Required for updating the list of tags." + }, + "items": { + "type": "array", + "description": "Items contained in this tag.", + "items": { + "type": "string" + } + } + } + }, + "Template": { + "id": "Template", + "type": "object", + "description": "The template used for creating replicas in the pool.", + "properties": { + "action": { + "$ref": "Action", + "description": "An action to run during initialization of your replicas. An action is run as shell commands which are executed one after the other in the same bash shell, so any state established by one command is inherited by later commands." + }, + "healthChecks": { + "type": "array", + "description": "A list of HTTP Health Checks to configure for this replica pool and all virtual machines in this replica pool.", + "items": { + "$ref": "HealthCheck" + } + }, + "version": { + "type": "string", + "description": "A free-form string describing the version of this template. You can provide any versioning string you would like. For example, version1 or template-v1." + }, + "vmParams": { + "$ref": "VmParams", + "description": "The virtual machine parameters to use for creating replicas. You can define settings such as the machine type and the image of replicas in this pool. This is required if replica type is SMART_VM." + } + } + }, + "VmParams": { + "id": "VmParams", + "type": "object", + "description": "Parameters for creating a Compute Engine Instance resource. Most fields are identical to the corresponding Compute Engine resource.", + "properties": { + "baseInstanceName": { + "type": "string", + "description": "Deprecated. Please use baseInstanceName instead." + }, + "canIpForward": { + "type": "boolean", + "description": "Enables IP Forwarding, which allows this instance to receive packets destined for a different IP address, and send packets with a different source IP. See IP Forwarding for more information." + }, + "description": { + "type": "string", + "description": "An optional textual description of the instance." + }, + "disksToAttach": { + "type": "array", + "description": "A list of existing Persistent Disk resources to attach to each replica in the pool. Each disk will be attached in read-only mode to every replica.", + "items": { + "$ref": "ExistingDisk" + } + }, + "disksToCreate": { + "type": "array", + "description": "A list of Disk resources to create and attach to each Replica in the Pool. Currently, you can only define one disk and it must be a root persistent disk. Note that Replica Pool will create a root persistent disk for each replica.", + "items": { + "$ref": "NewDisk" + } + }, + "machineType": { + "type": "string", + "description": "The machine type for this instance. The resource name (e.g. n1-standard-1)." + }, + "metadata": { + "$ref": "Metadata", + "description": "The metadata key/value pairs assigned to this instance." + }, + "networkInterfaces": { + "type": "array", + "description": "A list of network interfaces for the instance. Currently only one interface is supported by Google Compute Engine, ONE_TO_ONE_NAT.", + "items": { + "$ref": "NetworkInterface" + } + }, + "onHostMaintenance": { + "type": "string" + }, + "serviceAccounts": { + "type": "array", + "description": "A list of Service Accounts to enable for this instance.", + "items": { + "$ref": "ServiceAccount" + } + }, + "tags": { + "$ref": "Tag", + "description": "A list of tags to apply to the Google Compute Engine instance to identify resources." + } + } + } + }, + "resources": { + "pools": { + "methods": { + "delete": { + "id": "replicapool.pools.delete", + "path": "{projectName}/zones/{zone}/pools/{poolName}", + "httpMethod": "POST", + "description": "Deletes a replica pool.", + "parameters": { + "poolName": { + "type": "string", + "description": "The name of the replica pool for this request.", + "required": true, + "location": "path" + }, + "projectName": { + "type": "string", + "description": "The project ID for this replica pool.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The zone for this replica pool.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectName", + "zone", + "poolName" + ], + "request": { + "$ref": "PoolsDeleteRequest" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/replicapool" + ] + }, + "get": { + "id": "replicapool.pools.get", + "path": "{projectName}/zones/{zone}/pools/{poolName}", + "httpMethod": "GET", + "description": "Gets information about a single replica pool.", + "parameters": { + "poolName": { + "type": "string", + "description": "The name of the replica pool for this request.", + "required": true, + "location": "path" + }, + "projectName": { + "type": "string", + "description": "The project ID for this replica pool.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The zone for this replica pool.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectName", + "zone", + "poolName" + ], + "response": { + "$ref": "Pool" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly", + "https://www.googleapis.com/auth/replicapool", + "https://www.googleapis.com/auth/replicapool.readonly" + ] + }, + "insert": { + "id": "replicapool.pools.insert", + "path": "{projectName}/zones/{zone}/pools", + "httpMethod": "POST", + "description": "Inserts a new replica pool.", + "parameters": { + "projectName": { + "type": "string", + "description": "The project ID for this replica pool.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The zone for this replica pool.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectName", + "zone" + ], + "request": { + "$ref": "Pool" + }, + "response": { + "$ref": "Pool" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/replicapool" + ] + }, + "list": { + "id": "replicapool.pools.list", + "path": "{projectName}/zones/{zone}/pools", + "httpMethod": "GET", + "description": "List all replica pools.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned. Acceptable values are 0 to 100, inclusive. (Default: 50)", + "default": "500", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Set this to the nextPageToken value returned by a previous list request to obtain the next page of results from the previous list request.", + "location": "query" + }, + "projectName": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The zone for this replica pool.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectName", + "zone" + ], + "response": { + "$ref": "PoolsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly", + "https://www.googleapis.com/auth/replicapool", + "https://www.googleapis.com/auth/replicapool.readonly" + ] + }, + "resize": { + "id": "replicapool.pools.resize", + "path": "{projectName}/zones/{zone}/pools/{poolName}/resize", + "httpMethod": "POST", + "description": "Resize a pool. This is an asynchronous operation, and multiple overlapping resize requests can be made. Replica Pools will use the information from the last resize request.", + "parameters": { + "numReplicas": { + "type": "integer", + "description": "The desired number of replicas to resize to. If this number is larger than the existing number of replicas, new replicas will be added. If the number is smaller, then existing replicas will be deleted.", + "format": "int32", + "location": "query" + }, + "poolName": { + "type": "string", + "description": "The name of the replica pool for this request.", + "required": true, + "location": "path" + }, + "projectName": { + "type": "string", + "description": "The project ID for this replica pool.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The zone for this replica pool.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectName", + "zone", + "poolName" + ], + "response": { + "$ref": "Pool" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/replicapool" + ] + }, + "updatetemplate": { + "id": "replicapool.pools.updatetemplate", + "path": "{projectName}/zones/{zone}/pools/{poolName}/updateTemplate", + "httpMethod": "POST", + "description": "Update the template used by the pool.", + "parameters": { + "poolName": { + "type": "string", + "description": "The name of the replica pool for this request.", + "required": true, + "location": "path" + }, + "projectName": { + "type": "string", + "description": "The project ID for this replica pool.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The zone for this replica pool.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectName", + "zone", + "poolName" + ], + "request": { + "$ref": "Template" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/replicapool" + ] + } + } + }, + "replicas": { + "methods": { + "delete": { + "id": "replicapool.replicas.delete", + "path": "{projectName}/zones/{zone}/pools/{poolName}/replicas/{replicaName}", + "httpMethod": "POST", + "description": "Deletes a replica from the pool.", + "parameters": { + "poolName": { + "type": "string", + "description": "The replica pool name for this request.", + "required": true, + "location": "path" + }, + "projectName": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "location": "path" + }, + "replicaName": { + "type": "string", + "description": "The name of the replica for this request.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The zone where the replica lives.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectName", + "zone", + "poolName", + "replicaName" + ], + "request": { + "$ref": "ReplicasDeleteRequest" + }, + "response": { + "$ref": "Replica" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/replicapool" + ] + }, + "get": { + "id": "replicapool.replicas.get", + "path": "{projectName}/zones/{zone}/pools/{poolName}/replicas/{replicaName}", + "httpMethod": "GET", + "description": "Gets information about a specific replica.", + "parameters": { + "poolName": { + "type": "string", + "description": "The replica pool name for this request.", + "required": true, + "location": "path" + }, + "projectName": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "location": "path" + }, + "replicaName": { + "type": "string", + "description": "The name of the replica for this request.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The zone where the replica lives.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectName", + "zone", + "poolName", + "replicaName" + ], + "response": { + "$ref": "Replica" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly", + "https://www.googleapis.com/auth/replicapool", + "https://www.googleapis.com/auth/replicapool.readonly" + ] + }, + "list": { + "id": "replicapool.replicas.list", + "path": "{projectName}/zones/{zone}/pools/{poolName}/replicas", + "httpMethod": "GET", + "description": "Lists all replicas in a pool.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned. Acceptable values are 0 to 100, inclusive. (Default: 50)", + "default": "500", + "format": "int32", + "minimum": "0", + "maximum": "1000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Set this to the nextPageToken value returned by a previous list request to obtain the next page of results from the previous list request.", + "location": "query" + }, + "poolName": { + "type": "string", + "description": "The replica pool name for this request.", + "required": true, + "location": "path" + }, + "projectName": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The zone where the replica pool lives.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectName", + "zone", + "poolName" + ], + "response": { + "$ref": "ReplicasListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly", + "https://www.googleapis.com/auth/replicapool", + "https://www.googleapis.com/auth/replicapool.readonly" + ] + }, + "restart": { + "id": "replicapool.replicas.restart", + "path": "{projectName}/zones/{zone}/pools/{poolName}/replicas/{replicaName}/restart", + "httpMethod": "POST", + "description": "Restarts a replica in a pool.", + "parameters": { + "poolName": { + "type": "string", + "description": "The replica pool name for this request.", + "required": true, + "location": "path" + }, + "projectName": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "location": "path" + }, + "replicaName": { + "type": "string", + "description": "The name of the replica for this request.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The zone where the replica lives.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectName", + "zone", + "poolName", + "replicaName" + ], + "response": { + "$ref": "Replica" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/replicapool" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/replicapool/v1beta1/replicapool-gen.go b/Godeps/_workspace/src/google.golang.org/api/replicapool/v1beta1/replicapool-gen.go new file mode 100644 index 000000000..d847cb394 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/replicapool/v1beta1/replicapool-gen.go @@ -0,0 +1,2383 @@ +// Package replicapool provides access to the Replica Pool API. +// +// See https://developers.google.com/compute/docs/replica-pool/ +// +// Usage example: +// +// import "google.golang.org/api/replicapool/v1beta1" +// ... +// replicapoolService, err := replicapool.New(oauthHttpClient) +package replicapool // import "google.golang.org/api/replicapool/v1beta1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "replicapool:v1beta1" +const apiName = "replicapool" +const apiVersion = "v1beta1" +const basePath = "https://www.googleapis.com/replicapool/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 data across Google Cloud Platform services + CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" + + // View and manage your Google Cloud Platform management resources and + // deployment status information + NdevCloudmanScope = "https://www.googleapis.com/auth/ndev.cloudman" + + // View your Google Cloud Platform management resources and deployment + // status information + NdevCloudmanReadonlyScope = "https://www.googleapis.com/auth/ndev.cloudman.readonly" + + // View and manage replica pools + ReplicapoolScope = "https://www.googleapis.com/auth/replicapool" + + // View replica pools + ReplicapoolReadonlyScope = "https://www.googleapis.com/auth/replicapool.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.Pools = NewPoolsService(s) + s.Replicas = NewReplicasService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Pools *PoolsService + + Replicas *ReplicasService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewPoolsService(s *Service) *PoolsService { + rs := &PoolsService{s: s} + return rs +} + +type PoolsService struct { + s *Service +} + +func NewReplicasService(s *Service) *ReplicasService { + rs := &ReplicasService{s: s} + return rs +} + +type ReplicasService struct { + s *Service +} + +// AccessConfig: A Compute Engine network accessConfig. Identical to the +// accessConfig on corresponding Compute Engine resource. +type AccessConfig struct { + // Name: Name of this access configuration. + Name string `json:"name,omitempty"` + + // NatIp: An external IP address associated with this instance. + NatIp string `json:"natIp,omitempty"` + + // Type: Type of this access configuration file. Currently only + // ONE_TO_ONE_NAT is supported. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccessConfig) MarshalJSON() ([]byte, error) { + type noMethod AccessConfig + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Action: An action that gets executed during initialization of the +// replicas. +type Action struct { + // Commands: A list of commands to run, one per line. If any command + // fails, the whole action is considered a failure and no further + // actions are run. This also marks the virtual machine or replica as a + // failure. + Commands []string `json:"commands,omitempty"` + + // EnvVariables: A list of environment variables to use for the commands + // in this action. + EnvVariables []*EnvVariable `json:"envVariables,omitempty"` + + // TimeoutMilliSeconds: If an action's commands on a particular replica + // do not finish in the specified timeoutMilliSeconds, the replica is + // considered to be in a FAILING state. No efforts are made to stop any + // processes that were spawned or created as the result of running the + // action's commands. The default is the max allowed value, 1 hour (i.e. + // 3600000 milliseconds). + TimeoutMilliSeconds int64 `json:"timeoutMilliSeconds,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Commands") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Action) MarshalJSON() ([]byte, error) { + type noMethod Action + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DiskAttachment: Specifies how to attach a disk to a Replica. +type DiskAttachment struct { + // DeviceName: The device name of this disk. + 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, this is assigned by the server. + Index int64 `json:"index,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DeviceName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DiskAttachment) MarshalJSON() ([]byte, error) { + type noMethod DiskAttachment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EnvVariable: An environment variable to set for an action. +type EnvVariable struct { + // Hidden: Deprecated, do not use. + Hidden bool `json:"hidden,omitempty"` + + // Name: The name of the environment variable. + Name string `json:"name,omitempty"` + + // Value: The value of the variable. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Hidden") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EnvVariable) MarshalJSON() ([]byte, error) { + type noMethod EnvVariable + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ExistingDisk: A pre-existing persistent disk that will be attached to +// every Replica in the Pool in READ_ONLY mode. +type ExistingDisk struct { + // Attachment: How the disk will be attached to the Replica. + Attachment *DiskAttachment `json:"attachment,omitempty"` + + // Source: The name of the Persistent Disk resource. The Persistent Disk + // resource must be in the same zone as the Pool. + Source string `json:"source,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Attachment") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ExistingDisk) MarshalJSON() ([]byte, error) { + type noMethod ExistingDisk + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type HealthCheck struct { + // CheckIntervalSec: How often (in seconds) to make HTTP requests for + // this healthcheck. The default value is 5 seconds. + CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"` + + // Description: The description for this health check. + Description string `json:"description,omitempty"` + + // HealthyThreshold: The number of consecutive health check requests + // that need to succeed before the replica is considered healthy again. + // 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 localhost IP 127.0.0.1 will be + // used. + Host string `json:"host,omitempty"` + + // Name: The name of this health check. + Name string `json:"name,omitempty"` + + // Path: The localhost request path to send this health check, in the + // format /path/to/use. For example, /healthcheck. + Path string `json:"path,omitempty"` + + // Port: The TCP port for the health check requests. + Port int64 `json:"port,omitempty"` + + // TimeoutSec: How long (in seconds) to wait before a timeout failure + // for this healthcheck. The default value is 5 seconds. + TimeoutSec int64 `json:"timeoutSec,omitempty"` + + // UnhealthyThreshold: The number of consecutive health check requests + // that need to fail in order to consider the replica unhealthy. The + // default value is 2. + UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HealthCheck) MarshalJSON() ([]byte, error) { + type noMethod HealthCheck + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Label: A label to apply to this replica pool. +type Label struct { + // Key: The key for this label. + Key string `json:"key,omitempty"` + + // Value: The value of this label. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Label) MarshalJSON() ([]byte, error) { + type noMethod Label + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Metadata: A Compute Engine metadata entry. Identical to the metadata +// on the corresponding Compute Engine resource. +type Metadata struct { + // FingerPrint: The fingerprint of the metadata. Required for updating + // the metadata entries for this instance. + FingerPrint string `json:"fingerPrint,omitempty"` + + // Items: A list of metadata items. + Items []*MetadataItem `json:"items,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FingerPrint") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Metadata) MarshalJSON() ([]byte, error) { + type noMethod Metadata + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MetadataItem: A Compute Engine metadata item, defined as a key:value +// pair. Identical to the metadata on the corresponding Compute Engine +// resource. +type MetadataItem struct { + // Key: A metadata key. + Key string `json:"key,omitempty"` + + // Value: A metadata value. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MetadataItem) MarshalJSON() ([]byte, error) { + type noMethod MetadataItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// NetworkInterface: A Compute Engine NetworkInterface resource. +// Identical to the NetworkInterface on the corresponding Compute Engine +// resource. +type NetworkInterface struct { + // AccessConfigs: An array of configurations for this interface. This + // specifies how this interface is configured to interact with other + // network services. + AccessConfigs []*AccessConfig `json:"accessConfigs,omitempty"` + + // Network: Name the Network resource to which this interface applies. + Network string `json:"network,omitempty"` + + // NetworkIp: An optional IPV4 internal network address to assign to the + // instance for this network interface. + NetworkIp string `json:"networkIp,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AccessConfigs") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *NetworkInterface) MarshalJSON() ([]byte, error) { + type noMethod NetworkInterface + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// NewDisk: A Persistent Disk resource that will be created and attached +// to each Replica in the Pool. Each Replica will have a unique +// persistent disk that is created and attached to that Replica in +// READ_WRITE mode. +type NewDisk struct { + // Attachment: How the disk will be attached to the Replica. + Attachment *DiskAttachment `json:"attachment,omitempty"` + + // AutoDelete: If true, then this disk will be deleted when the instance + // is deleted. The default value is true. + AutoDelete bool `json:"autoDelete,omitempty"` + + // Boot: If true, indicates that this is the root persistent disk. + Boot bool `json:"boot,omitempty"` + + // InitializeParams: Create the new disk using these parameters. The + // name of the disk will be --. The postfix will be a four + // character alphanumeric identifier generated by the service. + // + // If this is not specified by the user, a random base instance name is + // generated by the service. + BaseInstanceName string `json:"baseInstanceName,omitempty"` + + // CurrentNumReplicas: [Output Only] The current number of replicas in + // the pool. + CurrentNumReplicas int64 `json:"currentNumReplicas,omitempty"` + + // Description: An optional description of the replica pool. + Description string `json:"description,omitempty"` + + // HealthChecks: Deprecated. Please use template[].healthChecks instead. + HealthChecks []*HealthCheck `json:"healthChecks,omitempty"` + + // InitialNumReplicas: The initial number of replicas this pool should + // have. You must provide a value greater than or equal to 0. + InitialNumReplicas int64 `json:"initialNumReplicas,omitempty"` + + // Labels: A list of labels to attach to this replica pool and all + // created virtual machines in this replica pool. + Labels []*Label `json:"labels,omitempty"` + + // Name: The name of the replica pool. Must follow the regex + // [a-z]([-a-z0-9]*[a-z0-9])? and be 1-28 characters long. + Name string `json:"name,omitempty"` + + // NumReplicas: Deprecated! Use initial_num_replicas instead. + NumReplicas int64 `json:"numReplicas,omitempty"` + + // ResourceViews: The list of resource views that should be updated with + // all the replicas that are managed by this pool. + ResourceViews []string `json:"resourceViews,omitempty"` + + // SelfLink: [Output Only] A self-link to the replica pool. + SelfLink string `json:"selfLink,omitempty"` + + // TargetPool: Deprecated, please use target_pools instead. + TargetPool string `json:"targetPool,omitempty"` + + // TargetPools: A list of target pools to update with the replicas that + // are managed by this pool. If specified, the replicas in this replica + // pool will be added to the specified target pools for load balancing + // purposes. The replica pool must live in the same region as the + // specified target pools. These values must be the target pool resource + // names, and not fully qualified URLs. + TargetPools []string `json:"targetPools,omitempty"` + + // Template: The template to use when creating replicas in this pool. + // This template is used during initial instance creation of the pool, + // when growing the pool in size, or when a replica restarts. + Template *Template `json:"template,omitempty"` + + // Type: Deprecated! Do not set. + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AutoRestart") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Pool) MarshalJSON() ([]byte, error) { + type noMethod Pool + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PoolsDeleteRequest struct { + // AbandonInstances: If there are instances you would like to keep, you + // can specify them here. These instances won't be deleted, but the + // associated replica objects will be removed. + AbandonInstances []string `json:"abandonInstances,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AbandonInstances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PoolsDeleteRequest) MarshalJSON() ([]byte, error) { + type noMethod PoolsDeleteRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PoolsListResponse struct { + NextPageToken string `json:"nextPageToken,omitempty"` + + Resources []*Pool `json:"resources,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PoolsListResponse) MarshalJSON() ([]byte, error) { + type noMethod PoolsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Replica: An individual Replica within a Pool. Replicas are +// automatically created by the replica pool, using the template +// provided by the user. You cannot directly create replicas. +type Replica struct { + // Name: [Output Only] The name of the Replica object. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] The self-link of the Replica. + SelfLink string `json:"selfLink,omitempty"` + + // Status: [Output Only] Last known status of the Replica. + Status *ReplicaStatus `json:"status,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Replica) MarshalJSON() ([]byte, error) { + type noMethod Replica + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReplicaStatus: The current status of a Replica. +type ReplicaStatus struct { + // Details: [Output Only] Human-readable details about the current state + // of the replica + Details string `json:"details,omitempty"` + + // State: [Output Only] The state of the Replica. + State string `json:"state,omitempty"` + + // TemplateVersion: [Output Only] The template used to build the + // replica. + TemplateVersion string `json:"templateVersion,omitempty"` + + // VmLink: [Output Only] Link to the virtual machine that this Replica + // represents. + VmLink string `json:"vmLink,omitempty"` + + // VmStartTime: [Output Only] The time that this Replica got to the + // RUNNING state, in RFC 3339 format. If the start time is unknown, + // UNKNOWN is returned. + VmStartTime string `json:"vmStartTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Details") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReplicaStatus) MarshalJSON() ([]byte, error) { + type noMethod ReplicaStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ReplicasDeleteRequest struct { + // AbandonInstance: Whether the instance resource represented by this + // replica should be deleted or abandoned. If abandoned, the replica + // will be deleted but the virtual machine instance will remain. By + // default, this is set to false and the instance will be deleted along + // with the replica. + AbandonInstance bool `json:"abandonInstance,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AbandonInstance") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReplicasDeleteRequest) MarshalJSON() ([]byte, error) { + type noMethod ReplicasDeleteRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ReplicasListResponse struct { + NextPageToken string `json:"nextPageToken,omitempty"` + + Resources []*Replica `json:"resources,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReplicasListResponse) MarshalJSON() ([]byte, error) { + type noMethod ReplicasListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ServiceAccount: A Compute Engine service account, identical to the +// Compute Engine resource. +type ServiceAccount struct { + // Email: The service account email address, for example: + // 123845678986@project.gserviceaccount.com + Email string `json:"email,omitempty"` + + // Scopes: The list of OAuth2 scopes to obtain for the service account, + // for example: https://www.googleapis.com/auth/devstorage.full_control + Scopes []string `json:"scopes,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Email") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ServiceAccount) MarshalJSON() ([]byte, error) { + type noMethod ServiceAccount + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Tag: A Compute Engine Instance tag, identical to the tags on the +// corresponding Compute Engine Instance resource. +type Tag struct { + // FingerPrint: The fingerprint of the tag. Required for updating the + // list of tags. + FingerPrint string `json:"fingerPrint,omitempty"` + + // Items: Items contained in this tag. + Items []string `json:"items,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FingerPrint") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Tag) MarshalJSON() ([]byte, error) { + type noMethod Tag + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Template: The template used for creating replicas in the pool. +type Template struct { + // Action: An action to run during initialization of your replicas. An + // action is run as shell commands which are executed one after the + // other in the same bash shell, so any state established by one command + // is inherited by later commands. + Action *Action `json:"action,omitempty"` + + // HealthChecks: A list of HTTP Health Checks to configure for this + // replica pool and all virtual machines in this replica pool. + HealthChecks []*HealthCheck `json:"healthChecks,omitempty"` + + // Version: A free-form string describing the version of this template. + // You can provide any versioning string you would like. For example, + // version1 or template-v1. + Version string `json:"version,omitempty"` + + // VmParams: The virtual machine parameters to use for creating + // replicas. You can define settings such as the machine type and the + // image of replicas in this pool. This is required if replica type is + // SMART_VM. + VmParams *VmParams `json:"vmParams,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Action") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Template) MarshalJSON() ([]byte, error) { + type noMethod Template + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VmParams: Parameters for creating a Compute Engine Instance resource. +// Most fields are identical to the corresponding Compute Engine +// resource. +type VmParams struct { + // BaseInstanceName: Deprecated. Please use baseInstanceName instead. + BaseInstanceName string `json:"baseInstanceName,omitempty"` + + // CanIpForward: Enables IP Forwarding, which allows this instance to + // receive packets destined for a different IP address, and send packets + // with a different source IP. See IP Forwarding for more information. + CanIpForward bool `json:"canIpForward,omitempty"` + + // Description: An optional textual description of the instance. + Description string `json:"description,omitempty"` + + // DisksToAttach: A list of existing Persistent Disk resources to attach + // to each replica in the pool. Each disk will be attached in read-only + // mode to every replica. + DisksToAttach []*ExistingDisk `json:"disksToAttach,omitempty"` + + // DisksToCreate: A list of Disk resources to create and attach to each + // Replica in the Pool. Currently, you can only define one disk and it + // must be a root persistent disk. Note that Replica Pool will create a + // root persistent disk for each replica. + DisksToCreate []*NewDisk `json:"disksToCreate,omitempty"` + + // MachineType: The machine type for this instance. The resource name + // (e.g. n1-standard-1). + MachineType string `json:"machineType,omitempty"` + + // Metadata: The metadata key/value pairs assigned to this instance. + Metadata *Metadata `json:"metadata,omitempty"` + + // NetworkInterfaces: A list of network interfaces for the instance. + // Currently only one interface is supported by Google Compute Engine, + // ONE_TO_ONE_NAT. + NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"` + + OnHostMaintenance string `json:"onHostMaintenance,omitempty"` + + // ServiceAccounts: A list of Service Accounts to enable for this + // instance. + ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"` + + // Tags: A list of tags to apply to the Google Compute Engine instance + // to identify resources. + Tags *Tag `json:"tags,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BaseInstanceName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VmParams) MarshalJSON() ([]byte, error) { + type noMethod VmParams + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "replicapool.pools.delete": + +type PoolsDeleteCall struct { + s *Service + projectName string + zone string + poolName string + poolsdeleterequest *PoolsDeleteRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a replica pool. +func (r *PoolsService) Delete(projectName string, zone string, poolName string, poolsdeleterequest *PoolsDeleteRequest) *PoolsDeleteCall { + c := &PoolsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.projectName = projectName + c.zone = zone + c.poolName = poolName + c.poolsdeleterequest = poolsdeleterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PoolsDeleteCall) Fields(s ...googleapi.Field) *PoolsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PoolsDeleteCall) Context(ctx context.Context) *PoolsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *PoolsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.poolsdeleterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/zones/{zone}/pools/{poolName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectName": c.projectName, + "zone": c.zone, + "poolName": c.poolName, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapool.pools.delete" call. +func (c *PoolsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a replica pool.", + // "httpMethod": "POST", + // "id": "replicapool.pools.delete", + // "parameterOrder": [ + // "projectName", + // "zone", + // "poolName" + // ], + // "parameters": { + // "poolName": { + // "description": "The name of the replica pool for this request.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectName": { + // "description": "The project ID for this replica pool.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The zone for this replica pool.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectName}/zones/{zone}/pools/{poolName}", + // "request": { + // "$ref": "PoolsDeleteRequest" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/replicapool" + // ] + // } + +} + +// method id "replicapool.pools.get": + +type PoolsGetCall struct { + s *Service + projectName string + zone string + poolName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets information about a single replica pool. +func (r *PoolsService) Get(projectName string, zone string, poolName string) *PoolsGetCall { + c := &PoolsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.projectName = projectName + c.zone = zone + c.poolName = poolName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PoolsGetCall) Fields(s ...googleapi.Field) *PoolsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PoolsGetCall) IfNoneMatch(entityTag string) *PoolsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PoolsGetCall) Context(ctx context.Context) *PoolsGetCall { + c.ctx_ = ctx + return c +} + +func (c *PoolsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/zones/{zone}/pools/{poolName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectName": c.projectName, + "zone": c.zone, + "poolName": c.poolName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapool.pools.get" call. +// Exactly one of *Pool or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Pool.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PoolsGetCall) Do() (*Pool, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Pool{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets information about a single replica pool.", + // "httpMethod": "GET", + // "id": "replicapool.pools.get", + // "parameterOrder": [ + // "projectName", + // "zone", + // "poolName" + // ], + // "parameters": { + // "poolName": { + // "description": "The name of the replica pool for this request.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectName": { + // "description": "The project ID for this replica pool.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The zone for this replica pool.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectName}/zones/{zone}/pools/{poolName}", + // "response": { + // "$ref": "Pool" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly", + // "https://www.googleapis.com/auth/replicapool", + // "https://www.googleapis.com/auth/replicapool.readonly" + // ] + // } + +} + +// method id "replicapool.pools.insert": + +type PoolsInsertCall struct { + s *Service + projectName string + zone string + pool *Pool + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a new replica pool. +func (r *PoolsService) Insert(projectName string, zone string, pool *Pool) *PoolsInsertCall { + c := &PoolsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.projectName = projectName + c.zone = zone + c.pool = pool + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PoolsInsertCall) Fields(s ...googleapi.Field) *PoolsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PoolsInsertCall) Context(ctx context.Context) *PoolsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *PoolsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.pool) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/zones/{zone}/pools") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectName": c.projectName, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapool.pools.insert" call. +// Exactly one of *Pool or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Pool.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PoolsInsertCall) Do() (*Pool, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Pool{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a new replica pool.", + // "httpMethod": "POST", + // "id": "replicapool.pools.insert", + // "parameterOrder": [ + // "projectName", + // "zone" + // ], + // "parameters": { + // "projectName": { + // "description": "The project ID for this replica pool.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The zone for this replica pool.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectName}/zones/{zone}/pools", + // "request": { + // "$ref": "Pool" + // }, + // "response": { + // "$ref": "Pool" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/replicapool" + // ] + // } + +} + +// method id "replicapool.pools.list": + +type PoolsListCall struct { + s *Service + projectName string + zone string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List all replica pools. +func (r *PoolsService) List(projectName string, zone string) *PoolsListCall { + c := &PoolsListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectName = projectName + c.zone = zone + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Acceptable values are 0 to 100, inclusive. +// (Default: 50) +func (c *PoolsListCall) MaxResults(maxResults int64) *PoolsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Set this to the +// nextPageToken value returned by a previous list request to obtain the +// next page of results from the previous list request. +func (c *PoolsListCall) PageToken(pageToken string) *PoolsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PoolsListCall) Fields(s ...googleapi.Field) *PoolsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *PoolsListCall) IfNoneMatch(entityTag string) *PoolsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PoolsListCall) Context(ctx context.Context) *PoolsListCall { + c.ctx_ = ctx + return c +} + +func (c *PoolsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/zones/{zone}/pools") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectName": c.projectName, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapool.pools.list" call. +// Exactly one of *PoolsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PoolsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PoolsListCall) Do() (*PoolsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PoolsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all replica pools.", + // "httpMethod": "GET", + // "id": "replicapool.pools.list", + // "parameterOrder": [ + // "projectName", + // "zone" + // ], + // "parameters": { + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned. Acceptable values are 0 to 100, inclusive. (Default: 50)", + // "format": "int32", + // "location": "query", + // "maximum": "1000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Set this to the nextPageToken value returned by a previous list request to obtain the next page of results from the previous list request.", + // "location": "query", + // "type": "string" + // }, + // "projectName": { + // "description": "The project ID for this request.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The zone for this replica pool.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectName}/zones/{zone}/pools", + // "response": { + // "$ref": "PoolsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly", + // "https://www.googleapis.com/auth/replicapool", + // "https://www.googleapis.com/auth/replicapool.readonly" + // ] + // } + +} + +// method id "replicapool.pools.resize": + +type PoolsResizeCall struct { + s *Service + projectName string + zone string + poolName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Resize: Resize a pool. This is an asynchronous operation, and +// multiple overlapping resize requests can be made. Replica Pools will +// use the information from the last resize request. +func (r *PoolsService) Resize(projectName string, zone string, poolName string) *PoolsResizeCall { + c := &PoolsResizeCall{s: r.s, opt_: make(map[string]interface{})} + c.projectName = projectName + c.zone = zone + c.poolName = poolName + return c +} + +// NumReplicas sets the optional parameter "numReplicas": The desired +// number of replicas to resize to. If this number is larger than the +// existing number of replicas, new replicas will be added. If the +// number is smaller, then existing replicas will be deleted. +func (c *PoolsResizeCall) NumReplicas(numReplicas int64) *PoolsResizeCall { + c.opt_["numReplicas"] = numReplicas + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PoolsResizeCall) Fields(s ...googleapi.Field) *PoolsResizeCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PoolsResizeCall) Context(ctx context.Context) *PoolsResizeCall { + c.ctx_ = ctx + return c +} + +func (c *PoolsResizeCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["numReplicas"]; ok { + params.Set("numReplicas", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/zones/{zone}/pools/{poolName}/resize") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectName": c.projectName, + "zone": c.zone, + "poolName": c.poolName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapool.pools.resize" call. +// Exactly one of *Pool or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Pool.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *PoolsResizeCall) Do() (*Pool, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Pool{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Resize a pool. This is an asynchronous operation, and multiple overlapping resize requests can be made. Replica Pools will use the information from the last resize request.", + // "httpMethod": "POST", + // "id": "replicapool.pools.resize", + // "parameterOrder": [ + // "projectName", + // "zone", + // "poolName" + // ], + // "parameters": { + // "numReplicas": { + // "description": "The desired number of replicas to resize to. If this number is larger than the existing number of replicas, new replicas will be added. If the number is smaller, then existing replicas will be deleted.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "poolName": { + // "description": "The name of the replica pool for this request.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectName": { + // "description": "The project ID for this replica pool.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The zone for this replica pool.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectName}/zones/{zone}/pools/{poolName}/resize", + // "response": { + // "$ref": "Pool" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/replicapool" + // ] + // } + +} + +// method id "replicapool.pools.updatetemplate": + +type PoolsUpdatetemplateCall struct { + s *Service + projectName string + zone string + poolName string + template *Template + opt_ map[string]interface{} + ctx_ context.Context +} + +// Updatetemplate: Update the template used by the pool. +func (r *PoolsService) Updatetemplate(projectName string, zone string, poolName string, template *Template) *PoolsUpdatetemplateCall { + c := &PoolsUpdatetemplateCall{s: r.s, opt_: make(map[string]interface{})} + c.projectName = projectName + c.zone = zone + c.poolName = poolName + c.template = template + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PoolsUpdatetemplateCall) Fields(s ...googleapi.Field) *PoolsUpdatetemplateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PoolsUpdatetemplateCall) Context(ctx context.Context) *PoolsUpdatetemplateCall { + c.ctx_ = ctx + return c +} + +func (c *PoolsUpdatetemplateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.template) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/zones/{zone}/pools/{poolName}/updateTemplate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectName": c.projectName, + "zone": c.zone, + "poolName": c.poolName, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapool.pools.updatetemplate" call. +func (c *PoolsUpdatetemplateCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Update the template used by the pool.", + // "httpMethod": "POST", + // "id": "replicapool.pools.updatetemplate", + // "parameterOrder": [ + // "projectName", + // "zone", + // "poolName" + // ], + // "parameters": { + // "poolName": { + // "description": "The name of the replica pool for this request.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectName": { + // "description": "The project ID for this replica pool.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The zone for this replica pool.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectName}/zones/{zone}/pools/{poolName}/updateTemplate", + // "request": { + // "$ref": "Template" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/replicapool" + // ] + // } + +} + +// method id "replicapool.replicas.delete": + +type ReplicasDeleteCall struct { + s *Service + projectName string + zone string + poolName string + replicaName string + replicasdeleterequest *ReplicasDeleteRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a replica from the pool. +func (r *ReplicasService) Delete(projectName string, zone string, poolName string, replicaName string, replicasdeleterequest *ReplicasDeleteRequest) *ReplicasDeleteCall { + c := &ReplicasDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.projectName = projectName + c.zone = zone + c.poolName = poolName + c.replicaName = replicaName + c.replicasdeleterequest = replicasdeleterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReplicasDeleteCall) Fields(s ...googleapi.Field) *ReplicasDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReplicasDeleteCall) Context(ctx context.Context) *ReplicasDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ReplicasDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.replicasdeleterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/zones/{zone}/pools/{poolName}/replicas/{replicaName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectName": c.projectName, + "zone": c.zone, + "poolName": c.poolName, + "replicaName": c.replicaName, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapool.replicas.delete" call. +// Exactly one of *Replica or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Replica.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReplicasDeleteCall) Do() (*Replica, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Replica{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a replica from the pool.", + // "httpMethod": "POST", + // "id": "replicapool.replicas.delete", + // "parameterOrder": [ + // "projectName", + // "zone", + // "poolName", + // "replicaName" + // ], + // "parameters": { + // "poolName": { + // "description": "The replica pool name for this request.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectName": { + // "description": "The project ID for this request.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "replicaName": { + // "description": "The name of the replica for this request.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The zone where the replica lives.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectName}/zones/{zone}/pools/{poolName}/replicas/{replicaName}", + // "request": { + // "$ref": "ReplicasDeleteRequest" + // }, + // "response": { + // "$ref": "Replica" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/replicapool" + // ] + // } + +} + +// method id "replicapool.replicas.get": + +type ReplicasGetCall struct { + s *Service + projectName string + zone string + poolName string + replicaName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets information about a specific replica. +func (r *ReplicasService) Get(projectName string, zone string, poolName string, replicaName string) *ReplicasGetCall { + c := &ReplicasGetCall{s: r.s, opt_: make(map[string]interface{})} + c.projectName = projectName + c.zone = zone + c.poolName = poolName + c.replicaName = replicaName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReplicasGetCall) Fields(s ...googleapi.Field) *ReplicasGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReplicasGetCall) IfNoneMatch(entityTag string) *ReplicasGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReplicasGetCall) Context(ctx context.Context) *ReplicasGetCall { + c.ctx_ = ctx + return c +} + +func (c *ReplicasGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/zones/{zone}/pools/{poolName}/replicas/{replicaName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectName": c.projectName, + "zone": c.zone, + "poolName": c.poolName, + "replicaName": c.replicaName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapool.replicas.get" call. +// Exactly one of *Replica or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Replica.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReplicasGetCall) Do() (*Replica, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Replica{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets information about a specific replica.", + // "httpMethod": "GET", + // "id": "replicapool.replicas.get", + // "parameterOrder": [ + // "projectName", + // "zone", + // "poolName", + // "replicaName" + // ], + // "parameters": { + // "poolName": { + // "description": "The replica pool name for this request.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectName": { + // "description": "The project ID for this request.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "replicaName": { + // "description": "The name of the replica for this request.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The zone where the replica lives.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectName}/zones/{zone}/pools/{poolName}/replicas/{replicaName}", + // "response": { + // "$ref": "Replica" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly", + // "https://www.googleapis.com/auth/replicapool", + // "https://www.googleapis.com/auth/replicapool.readonly" + // ] + // } + +} + +// method id "replicapool.replicas.list": + +type ReplicasListCall struct { + s *Service + projectName string + zone string + poolName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all replicas in a pool. +func (r *ReplicasService) List(projectName string, zone string, poolName string) *ReplicasListCall { + c := &ReplicasListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectName = projectName + c.zone = zone + c.poolName = poolName + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Acceptable values are 0 to 100, inclusive. +// (Default: 50) +func (c *ReplicasListCall) MaxResults(maxResults int64) *ReplicasListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Set this to the +// nextPageToken value returned by a previous list request to obtain the +// next page of results from the previous list request. +func (c *ReplicasListCall) PageToken(pageToken string) *ReplicasListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReplicasListCall) Fields(s ...googleapi.Field) *ReplicasListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ReplicasListCall) IfNoneMatch(entityTag string) *ReplicasListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReplicasListCall) Context(ctx context.Context) *ReplicasListCall { + c.ctx_ = ctx + return c +} + +func (c *ReplicasListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/zones/{zone}/pools/{poolName}/replicas") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectName": c.projectName, + "zone": c.zone, + "poolName": c.poolName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapool.replicas.list" call. +// Exactly one of *ReplicasListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ReplicasListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ReplicasListCall) Do() (*ReplicasListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ReplicasListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all replicas in a pool.", + // "httpMethod": "GET", + // "id": "replicapool.replicas.list", + // "parameterOrder": [ + // "projectName", + // "zone", + // "poolName" + // ], + // "parameters": { + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned. Acceptable values are 0 to 100, inclusive. (Default: 50)", + // "format": "int32", + // "location": "query", + // "maximum": "1000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Set this to the nextPageToken value returned by a previous list request to obtain the next page of results from the previous list request.", + // "location": "query", + // "type": "string" + // }, + // "poolName": { + // "description": "The replica pool name for this request.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectName": { + // "description": "The project ID for this request.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The zone where the replica pool lives.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectName}/zones/{zone}/pools/{poolName}/replicas", + // "response": { + // "$ref": "ReplicasListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly", + // "https://www.googleapis.com/auth/replicapool", + // "https://www.googleapis.com/auth/replicapool.readonly" + // ] + // } + +} + +// method id "replicapool.replicas.restart": + +type ReplicasRestartCall struct { + s *Service + projectName string + zone string + poolName string + replicaName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Restart: Restarts a replica in a pool. +func (r *ReplicasService) Restart(projectName string, zone string, poolName string, replicaName string) *ReplicasRestartCall { + c := &ReplicasRestartCall{s: r.s, opt_: make(map[string]interface{})} + c.projectName = projectName + c.zone = zone + c.poolName = poolName + c.replicaName = replicaName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ReplicasRestartCall) Fields(s ...googleapi.Field) *ReplicasRestartCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ReplicasRestartCall) Context(ctx context.Context) *ReplicasRestartCall { + c.ctx_ = ctx + return c +} + +func (c *ReplicasRestartCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/zones/{zone}/pools/{poolName}/replicas/{replicaName}/restart") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectName": c.projectName, + "zone": c.zone, + "poolName": c.poolName, + "replicaName": c.replicaName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapool.replicas.restart" call. +// Exactly one of *Replica or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Replica.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ReplicasRestartCall) Do() (*Replica, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Replica{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Restarts a replica in a pool.", + // "httpMethod": "POST", + // "id": "replicapool.replicas.restart", + // "parameterOrder": [ + // "projectName", + // "zone", + // "poolName", + // "replicaName" + // ], + // "parameters": { + // "poolName": { + // "description": "The replica pool name for this request.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "projectName": { + // "description": "The project ID for this request.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "replicaName": { + // "description": "The name of the replica for this request.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The zone where the replica lives.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectName}/zones/{zone}/pools/{poolName}/replicas/{replicaName}/restart", + // "response": { + // "$ref": "Replica" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/replicapool" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/replicapool/v1beta2/replicapool-api.json b/Godeps/_workspace/src/google.golang.org/api/replicapool/v1beta2/replicapool-api.json new file mode 100644 index 000000000..8f54118a2 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/replicapool/v1beta2/replicapool-api.json @@ -0,0 +1,1064 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/67X4oa_z2X9akk2jDtoTiNGUkaE\"", + "discoveryVersion": "v1", + "id": "replicapool:v1beta2", + "name": "replicapool", + "version": "v1beta2", + "revision": "20150708", + "title": "Google Compute Engine Instance Group Manager API", + "description": "The Google Compute Engine Instance Group Manager API provides groups of homogenous Compute Engine Instances.", + "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/compute/docs/instance-groups/manager/v1beta2", + "labels": [ + "limited_availability" + ], + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/replicapool/v1beta2/projects/", + "basePath": "/replicapool/v1beta2/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "replicapool/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/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/compute": { + "description": "View and manage your Google Compute Engine resources" + }, + "https://www.googleapis.com/auth/compute.readonly": { + "description": "View your Google Compute Engine resources" + } + } + } + }, + "schemas": { + "InstanceGroupManager": { + "id": "InstanceGroupManager", + "type": "object", + "description": "An Instance Group Manager resource.", + "properties": { + "autoHealingPolicies": { + "type": "array", + "description": "The autohealing policy for this managed instance group. You can specify only one value.", + "items": { + "$ref": "ReplicaPoolAutoHealingPolicy" + } + }, + "baseInstanceName": { + "type": "string", + "description": "The base instance name to use for instances in this group. The value must be a valid RFC1035 name. Supported characters are lowercase letters, numbers, and hyphens (-). Instances are named by appending a hyphen and a random four-character string to the base instance name." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output only] The time the instance group manager was created, in RFC3339 text format." + }, + "currentSize": { + "type": "integer", + "description": "[Output only] The number of instances that currently exist and are a part of this group. This includes instances that are starting but are not yet RUNNING, and instances that are in the process of being deleted or abandoned.", + "format": "int32" + }, + "description": { + "type": "string", + "description": "An optional textual description of the instance group manager." + }, + "fingerprint": { + "type": "string", + "description": "[Output only] Fingerprint of the instance group manager. This field is used for optimistic locking. An up-to-date fingerprint must be provided in order to modify the Instance Group Manager resource.", + "format": "byte" + }, + "group": { + "type": "string", + "description": "[Output only] The full URL of the instance group created by the manager. This group contains all of the instances being managed, and cannot contain non-managed instances." + }, + "id": { + "type": "string", + "description": "[Output only] A server-assigned unique identifier for the resource.", + "format": "uint64" + }, + "instanceTemplate": { + "type": "string", + "description": "The full URL to an instance template from which all new instances will be created." + }, + "kind": { + "type": "string", + "description": "[Output only] The resource type. Always replicapool#instanceGroupManager.", + "default": "replicapool#instanceGroupManager" + }, + "name": { + "type": "string", + "description": "The name of the instance group manager. Must be 1-63 characters long and comply with RFC1035. Supported characters include lowercase letters, numbers, and hyphens." + }, + "selfLink": { + "type": "string", + "description": "[Output only] The fully qualified URL for this resource." + }, + "targetPools": { + "type": "array", + "description": "The full URL of all target pools to which new instances in the group are added. Updating the target pool values does not affect existing instances.", + "items": { + "type": "string" + } + }, + "targetSize": { + "type": "integer", + "description": "[Output only] The number of instances that the manager is attempting to maintain. Deleting or abandoning instances affects this number, as does resizing the group.", + "format": "int32" + } + } + }, + "InstanceGroupManagerList": { + "id": "InstanceGroupManagerList", + "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": "InstanceGroupManager" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "replicapool#instanceGroupManagerList" + }, + "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)." + } + } + }, + "InstanceGroupManagersAbandonInstancesRequest": { + "id": "InstanceGroupManagersAbandonInstancesRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "The names of one or more instances to abandon. For example:\n{ 'instances': [ 'instance-c3po', 'instance-r2d2' ] }", + "items": { + "type": "string" + } + } + } + }, + "InstanceGroupManagersDeleteInstancesRequest": { + "id": "InstanceGroupManagersDeleteInstancesRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "Names of instances to delete.\n\nExample: 'instance-foo', 'instance-bar'", + "items": { + "type": "string" + } + } + } + }, + "InstanceGroupManagersRecreateInstancesRequest": { + "id": "InstanceGroupManagersRecreateInstancesRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "The names of one or more instances to recreate. For example:\n{ 'instances': [ 'instance-c3po', 'instance-r2d2' ] }", + "items": { + "type": "string" + } + } + } + }, + "InstanceGroupManagersSetInstanceTemplateRequest": { + "id": "InstanceGroupManagersSetInstanceTemplateRequest", + "type": "object", + "properties": { + "instanceTemplate": { + "type": "string", + "description": "The full URL to an Instance Template from which all new instances will be created." + } + } + }, + "InstanceGroupManagersSetTargetPoolsRequest": { + "id": "InstanceGroupManagersSetTargetPoolsRequest", + "type": "object", + "properties": { + "fingerprint": { + "type": "string", + "description": "The current fingerprint of the Instance Group Manager resource. If this does not match the server-side fingerprint of the resource, then the request will be rejected.", + "format": "byte" + }, + "targetPools": { + "type": "array", + "description": "A list of fully-qualified URLs to existing Target Pool resources. New instances in the Instance Group Manager will be added to the specified target pools; existing instances are not affected.", + "items": { + "type": "string" + } + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "description": "An operation resource, used to manage asynchronous API requests.", + "properties": { + "clientOperationId": { + "type": "string", + "description": "[Output only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] The time that this operation was requested, in RFC3339 text format." + }, + "endTime": { + "type": "string", + "description": "[Output Only] The time that this operation was completed, in RFC3339 text format." + }, + "error": { + "type": "object", + "description": "[Output Only] If errors occurred during processing of this operation, this field will be populated.", + "properties": { + "errors": { + "type": "array", + "description": "[Output Only] The array of errors encountered while processing this operation.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The error type identifier for this error." + }, + "location": { + "type": "string", + "description": "[Output Only] Indicates the field in the request which caused the error. This property is optional." + }, + "message": { + "type": "string", + "description": "[Output Only] An optional, human-readable error message." + } + } + } + } + } + }, + "httpErrorMessage": { + "type": "string", + "description": "[Output only] If operation fails, the HTTP error message returned." + }, + "httpErrorStatusCode": { + "type": "integer", + "description": "[Output only] If operation fails, the HTTP error status code returned.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource, generated by the server.", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "[Output Only] The time that this operation was requested, in RFC3339 text format." + }, + "kind": { + "type": "string", + "description": "[Output only] Type of the resource.", + "default": "replicapool#operation" + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource." + }, + "operationType": { + "type": "string", + "description": "[Output only] Type of the operation. Operations include insert, update, and delete." + }, + "progress": { + "type": "integer", + "description": "[Output only] 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.", + "format": "int32" + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where the operation resides. Only available when performing regional operations." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined fully-qualified URL for this resource." + }, + "startTime": { + "type": "string", + "description": "[Output Only] The time that this operation was started by the server, in RFC3339 text format." + }, + "status": { + "type": "string", + "description": "[Output Only] Status of the operation.", + "enum": [ + "DONE", + "PENDING", + "RUNNING" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "statusMessage": { + "type": "string", + "description": "[Output Only] An optional textual description of the current status of the operation." + }, + "targetId": { + "type": "string", + "description": "[Output Only] Unique target ID which identifies a particular incarnation of the target.", + "format": "uint64" + }, + "targetLink": { + "type": "string", + "description": "[Output only] URL of the resource the operation is mutating." + }, + "user": { + "type": "string", + "description": "[Output Only] User who requested the operation, for example: user@example.com." + }, + "warnings": { + "type": "array", + "description": "[Output Only] If there are issues with this operation, a warning is returned.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output only] 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", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output only] Metadata for this warning in key:value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] Metadata key for this warning." + }, + "value": { + "type": "string", + "description": "[Output Only] Metadata value for this warning." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output only] Optional human-readable details for this warning." + } + } + } + }, + "zone": { + "type": "string", + "description": "[Output Only] URL of the zone where the operation resides. Only available when performing per-zone operations." + } + } + }, + "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": "replicapool#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)." + } + } + }, + "ReplicaPoolAutoHealingPolicy": { + "id": "ReplicaPoolAutoHealingPolicy", + "type": "object", + "properties": { + "actionType": { + "type": "string", + "description": "The action to perform when an instance becomes unhealthy. Possible values are RECREATE or REBOOT. RECREATE replaces an unhealthy instance with a new instance that is based on the instance template for this managed instance group. REBOOT performs a soft reboot on an instance. If the instance cannot reboot, the instance performs a hard restart.", + "enum": [ + "REBOOT", + "RECREATE" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "healthCheck": { + "type": "string", + "description": "The URL for the HealthCheck that signals autohealing." + } + } + } + }, + "resources": { + "instanceGroupManagers": { + "methods": { + "abandonInstances": { + "id": "replicapool.instanceGroupManagers.abandonInstances", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances", + "httpMethod": "POST", + "description": "Removes the specified instances from the managed instance group, and from any target pools of which they were members, without deleting the instances.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the instance group manager.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "The Google Developers Console 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": "The name of the zone in which the instance group manager resides.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersAbandonInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "delete": { + "id": "replicapool.instanceGroupManagers.delete", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}", + "httpMethod": "DELETE", + "description": "Deletes the instance group manager and all instances contained within. If you'd like to delete the manager without deleting the instances, you must first abandon the instances to remove them from the group.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "Name of the Instance Group Manager resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "The Google Developers Console 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": "The name of the zone in which the instance group manager resides.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "deleteInstances": { + "id": "replicapool.instanceGroupManagers.deleteInstances", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances", + "httpMethod": "POST", + "description": "Deletes the specified instances. The instances are deleted, then removed from the instance group and any target pools of which they were a member. The targetSize of the instance group manager is reduced by the number of instances deleted.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the instance group manager.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "The Google Developers Console 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": "The name of the zone in which the instance group manager resides.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersDeleteInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "replicapool.instanceGroupManagers.get", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}", + "httpMethod": "GET", + "description": "Returns the specified Instance Group Manager resource.", + "parameters": { + "instanceGroupManager": { + "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": "The Google Developers Console 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": "The name of the zone in which the instance group manager resides.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "response": { + "$ref": "InstanceGroupManager" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "replicapool.instanceGroupManagers.insert", + "path": "{project}/zones/{zone}/instanceGroupManagers", + "httpMethod": "POST", + "description": "Creates an instance group manager, as well as the instance group and the specified number of instances.", + "parameters": { + "project": { + "type": "string", + "description": "The Google Developers Console 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" + }, + "size": { + "type": "integer", + "description": "Number of instances that should exist.", + "required": true, + "format": "int32", + "minimum": "0", + "location": "query" + }, + "zone": { + "type": "string", + "description": "The name of the zone in which the instance group manager resides.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "size" + ], + "request": { + "$ref": "InstanceGroupManager" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "replicapool.instanceGroupManagers.list", + "path": "{project}/zones/{zone}/instanceGroupManagers", + "httpMethod": "GET", + "description": "Retrieves the list of Instance Group Manager 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": "The Google Developers Console 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": "The name of the zone in which the instance group manager resides.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "InstanceGroupManagerList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "recreateInstances": { + "id": "replicapool.instanceGroupManagers.recreateInstances", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances", + "httpMethod": "POST", + "description": "Recreates the specified instances. The instances are deleted, then recreated using the instance group manager's current instance template.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the instance group manager.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "The Google Developers Console 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": "The name of the zone in which the instance group manager resides.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersRecreateInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "resize": { + "id": "replicapool.instanceGroupManagers.resize", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize", + "httpMethod": "POST", + "description": "Resizes the managed instance group up or down. If resized up, new instances are created using the current instance template. If resized down, instances are removed in the order outlined in Resizing a managed instance group.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the instance group manager.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "The Google Developers Console 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" + }, + "size": { + "type": "integer", + "description": "Number of instances that should exist in this Instance Group Manager.", + "required": true, + "format": "int32", + "minimum": "0", + "location": "query" + }, + "zone": { + "type": "string", + "description": "The name of the zone in which the instance group manager resides.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager", + "size" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "setInstanceTemplate": { + "id": "replicapool.instanceGroupManagers.setInstanceTemplate", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate", + "httpMethod": "POST", + "description": "Sets the instance template to use when creating new instances in this group. Existing instances are not affected.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the instance group manager.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "The Google Developers Console 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": "The name of the zone in which the instance group manager resides.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersSetInstanceTemplateRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "setTargetPools": { + "id": "replicapool.instanceGroupManagers.setTargetPools", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools", + "httpMethod": "POST", + "description": "Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the instance group manager.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "The Google Developers Console 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": "The name of the zone in which the instance group manager resides.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersSetTargetPoolsRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "zoneOperations": { + "methods": { + "get": { + "id": "replicapool.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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "replicapool.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/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/replicapool/v1beta2/replicapool-gen.go b/Godeps/_workspace/src/google.golang.org/api/replicapool/v1beta2/replicapool-gen.go new file mode 100644 index 000000000..ee09d3d3b --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/replicapool/v1beta2/replicapool-gen.go @@ -0,0 +1,2512 @@ +// Package replicapool provides access to the Google Compute Engine Instance Group Manager API. +// +// See https://developers.google.com/compute/docs/instance-groups/manager/v1beta2 +// +// Usage example: +// +// import "google.golang.org/api/replicapool/v1beta2" +// ... +// replicapoolService, err := replicapool.New(oauthHttpClient) +package replicapool // import "google.golang.org/api/replicapool/v1beta2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "replicapool:v1beta2" +const apiName = "replicapool" +const apiVersion = "v1beta2" +const basePath = "https://www.googleapis.com/replicapool/v1beta2/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 data across Google Cloud Platform services + CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" + + // 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" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.InstanceGroupManagers = NewInstanceGroupManagersService(s) + s.ZoneOperations = NewZoneOperationsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + InstanceGroupManagers *InstanceGroupManagersService + + ZoneOperations *ZoneOperationsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewInstanceGroupManagersService(s *Service) *InstanceGroupManagersService { + rs := &InstanceGroupManagersService{s: s} + return rs +} + +type InstanceGroupManagersService struct { + s *Service +} + +func NewZoneOperationsService(s *Service) *ZoneOperationsService { + rs := &ZoneOperationsService{s: s} + return rs +} + +type ZoneOperationsService struct { + s *Service +} + +// InstanceGroupManager: An Instance Group Manager resource. +type InstanceGroupManager struct { + // AutoHealingPolicies: The autohealing policy for this managed instance + // group. You can specify only one value. + AutoHealingPolicies []*ReplicaPoolAutoHealingPolicy `json:"autoHealingPolicies,omitempty"` + + // BaseInstanceName: The base instance name to use for instances in this + // group. The value must be a valid RFC1035 name. Supported characters + // are lowercase letters, numbers, and hyphens (-). Instances are named + // by appending a hyphen and a random four-character string to the base + // instance name. + BaseInstanceName string `json:"baseInstanceName,omitempty"` + + // CreationTimestamp: [Output only] The time the instance group manager + // was created, in RFC3339 text format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // CurrentSize: [Output only] The number of instances that currently + // exist and are a part of this group. This includes instances that are + // starting but are not yet RUNNING, and instances that are in the + // process of being deleted or abandoned. + CurrentSize int64 `json:"currentSize,omitempty"` + + // Description: An optional textual description of the instance group + // manager. + Description string `json:"description,omitempty"` + + // Fingerprint: [Output only] Fingerprint of the instance group manager. + // This field is used for optimistic locking. An up-to-date fingerprint + // must be provided in order to modify the Instance Group Manager + // resource. + Fingerprint string `json:"fingerprint,omitempty"` + + // Group: [Output only] The full URL of the instance group created by + // the manager. This group contains all of the instances being managed, + // and cannot contain non-managed instances. + Group string `json:"group,omitempty"` + + // Id: [Output only] A server-assigned unique identifier for the + // resource. + Id uint64 `json:"id,omitempty,string"` + + // InstanceTemplate: The full URL to an instance template from which all + // new instances will be created. + InstanceTemplate string `json:"instanceTemplate,omitempty"` + + // Kind: [Output only] The resource type. Always + // replicapool#instanceGroupManager. + Kind string `json:"kind,omitempty"` + + // Name: The name of the instance group manager. Must be 1-63 characters + // long and comply with RFC1035. Supported characters include lowercase + // letters, numbers, and hyphens. + Name string `json:"name,omitempty"` + + // SelfLink: [Output only] The fully qualified URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // TargetPools: The full URL of all target pools to which new instances + // in the group are added. Updating the target pool values does not + // affect existing instances. + TargetPools []string `json:"targetPools,omitempty"` + + // TargetSize: [Output only] The number of instances that the manager is + // attempting to maintain. Deleting or abandoning instances affects this + // number, as does resizing the group. + TargetSize int64 `json:"targetSize,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManager) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManager + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagerList 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 []*InstanceGroupManager `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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagerList) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagerList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersAbandonInstancesRequest struct { + // Instances: The names of one or more instances to abandon. For + // example: + // { 'instances': [ 'instance-c3po', 'instance-r2d2' ] } + Instances []string `json:"instances,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersAbandonInstancesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersDeleteInstancesRequest struct { + // Instances: Names of instances to delete. + // + // Example: 'instance-foo', 'instance-bar' + Instances []string `json:"instances,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersDeleteInstancesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersRecreateInstancesRequest struct { + // Instances: The names of one or more instances to recreate. For + // example: + // { 'instances': [ 'instance-c3po', 'instance-r2d2' ] } + Instances []string `json:"instances,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersRecreateInstancesRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersRecreateInstancesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersSetInstanceTemplateRequest struct { + // InstanceTemplate: The full URL to an Instance Template from which all + // new instances will be created. + InstanceTemplate string `json:"instanceTemplate,omitempty"` + + // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersSetInstanceTemplateRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersSetInstanceTemplateRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersSetTargetPoolsRequest struct { + // Fingerprint: The current fingerprint of the Instance Group Manager + // resource. If this does not match the server-side fingerprint of the + // resource, then the request will be rejected. + Fingerprint string `json:"fingerprint,omitempty"` + + // TargetPools: A list of fully-qualified URLs to existing Target Pool + // resources. New instances in the Instance Group Manager will be added + // to the specified target pools; existing instances are not affected. + TargetPools []string `json:"targetPools,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Fingerprint") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersSetTargetPoolsRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Operation: An operation resource, used to manage asynchronous API +// requests. +type Operation struct { + // ClientOperationId: [Output only] An optional identifier specified by + // the client when the mutation was initiated. Must be unique for all + // operation resources in the project. + ClientOperationId string `json:"clientOperationId,omitempty"` + + // CreationTimestamp: [Output Only] The time that this operation was + // requested, in RFC3339 text format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // EndTime: [Output Only] The time that this operation was completed, in + // RFC3339 text format. + EndTime string `json:"endTime,omitempty"` + + // Error: [Output Only] If errors occurred during processing of this + // operation, this field will be populated. + Error *OperationError `json:"error,omitempty"` + + // HttpErrorMessage: [Output only] If operation fails, the HTTP error + // message returned. + HttpErrorMessage string `json:"httpErrorMessage,omitempty"` + + // HttpErrorStatusCode: [Output only] If operation fails, the HTTP error + // status code returned. + HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"` + + // Id: [Output Only] Unique identifier for the resource, generated by + // the server. + Id uint64 `json:"id,omitempty,string"` + + // InsertTime: [Output Only] The time that this operation was requested, + // in RFC3339 text format. + InsertTime string `json:"insertTime,omitempty"` + + // Kind: [Output only] Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: [Output Only] Name of the resource. + Name string `json:"name,omitempty"` + + // OperationType: [Output only] Type of the operation. Operations + // include insert, update, and delete. + OperationType string `json:"operationType,omitempty"` + + // Progress: [Output only] 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. + Progress int64 `json:"progress,omitempty"` + + // Region: [Output Only] URL of the region where the operation resides. + // Only available when performing regional operations. + Region string `json:"region,omitempty"` + + // SelfLink: [Output Only] Server-defined fully-qualified URL for this + // resource. + SelfLink string `json:"selfLink,omitempty"` + + // StartTime: [Output Only] The time that this operation was started by + // the server, in RFC3339 text format. + StartTime string `json:"startTime,omitempty"` + + // Status: [Output Only] Status of the operation. + // + // Possible values: + // "DONE" + // "PENDING" + // "RUNNING" + Status string `json:"status,omitempty"` + + // StatusMessage: [Output Only] An optional textual description of the + // current status of the operation. + StatusMessage string `json:"statusMessage,omitempty"` + + // TargetId: [Output Only] Unique target ID which identifies a + // particular incarnation of the target. + TargetId uint64 `json:"targetId,omitempty,string"` + + // TargetLink: [Output only] URL of the resource the operation is + // mutating. + TargetLink string `json:"targetLink,omitempty"` + + // User: [Output Only] User who requested the operation, for example: + // user@example.com. + User string `json:"user,omitempty"` + + // Warnings: [Output Only] If there are issues with this operation, a + // warning is returned. + Warnings []*OperationWarnings `json:"warnings,omitempty"` + + // Zone: [Output Only] URL of the zone where the operation resides. Only + // available when performing per-zone operations. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ClientOperationId") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Operation) MarshalJSON() ([]byte, error) { + type noMethod Operation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationError: [Output Only] If errors occurred during processing of +// this operation, this field will be populated. +type OperationError struct { + // Errors: [Output Only] The array of errors encountered while + // processing this operation. + Errors []*OperationErrorErrors `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationError) MarshalJSON() ([]byte, error) { + type noMethod OperationError + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationErrorErrors struct { + // Code: [Output Only] The error type identifier for this error. + Code string `json:"code,omitempty"` + + // Location: [Output Only] Indicates the field in the request which + // caused the error. This property is optional. + Location string `json:"location,omitempty"` + + // Message: [Output Only] An optional, human-readable error message. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) { + type noMethod OperationErrorErrors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationWarnings struct { + // Code: [Output only] The warning type identifier for this warning. + // + // Possible values: + // "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" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output only] Metadata for this warning in key:value format. + Data []*OperationWarningsData `json:"data,omitempty"` + + // Message: [Output only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationWarnings) MarshalJSON() ([]byte, error) { + type noMethod OperationWarnings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationWarningsData struct { + // Key: [Output Only] Metadata key for this warning. + Key string `json:"key,omitempty"` + + // Value: [Output Only] Metadata value for this warning. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationWarningsData) MarshalJSON() ([]byte, error) { + type noMethod OperationWarningsData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationList) MarshalJSON() ([]byte, error) { + type noMethod OperationList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ReplicaPoolAutoHealingPolicy struct { + // ActionType: The action to perform when an instance becomes unhealthy. + // Possible values are RECREATE or REBOOT. RECREATE replaces an + // unhealthy instance with a new instance that is based on the instance + // template for this managed instance group. REBOOT performs a soft + // reboot on an instance. If the instance cannot reboot, the instance + // performs a hard restart. + // + // Possible values: + // "REBOOT" + // "RECREATE" + ActionType string `json:"actionType,omitempty"` + + // HealthCheck: The URL for the HealthCheck that signals autohealing. + HealthCheck string `json:"healthCheck,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ActionType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReplicaPoolAutoHealingPolicy) MarshalJSON() ([]byte, error) { + type noMethod ReplicaPoolAutoHealingPolicy + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "replicapool.instanceGroupManagers.abandonInstances": + +type InstanceGroupManagersAbandonInstancesCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// AbandonInstances: Removes the specified instances from the managed +// instance group, and from any target pools of which they were members, +// without deleting the instances. +func (r *InstanceGroupManagersService) AbandonInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest) *InstanceGroupManagersAbandonInstancesCall { + c := &InstanceGroupManagersAbandonInstancesCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanagersabandoninstancesrequest = instancegroupmanagersabandoninstancesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAbandonInstancesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *InstanceGroupManagersAbandonInstancesCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersabandoninstancesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapool.instanceGroupManagers.abandonInstances" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagersAbandonInstancesCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Removes the specified instances from the managed instance group, and from any target pools of which they were members, without deleting the instances.", + // "httpMethod": "POST", + // "id": "replicapool.instanceGroupManagers.abandonInstances", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the instance group manager.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The Google Developers Console 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": "The name of the zone in which the instance group manager resides.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances", + // "request": { + // "$ref": "InstanceGroupManagersAbandonInstancesRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "replicapool.instanceGroupManagers.delete": + +type InstanceGroupManagersDeleteCall struct { + s *Service + project string + zone string + instanceGroupManager string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the instance group manager and all instances +// contained within. If you'd like to delete the manager without +// deleting the instances, you must first abandon the instances to +// remove them from the group. +func (r *InstanceGroupManagersService) Delete(project string, zone string, instanceGroupManager string) *InstanceGroupManagersDeleteCall { + c := &InstanceGroupManagersDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersDeleteCall) Context(ctx context.Context) *InstanceGroupManagersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapool.instanceGroupManagers.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagersDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the instance group manager and all instances contained within. If you'd like to delete the manager without deleting the instances, you must first abandon the instances to remove them from the group.", + // "httpMethod": "DELETE", + // "id": "replicapool.instanceGroupManagers.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "Name of the Instance Group Manager resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The Google Developers Console 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": "The name of the zone in which the instance group manager resides.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "replicapool.instanceGroupManagers.deleteInstances": + +type InstanceGroupManagersDeleteInstancesCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// DeleteInstances: Deletes the specified instances. The instances are +// deleted, then removed from the instance group and any target pools of +// which they were a member. The targetSize of the instance group +// manager is reduced by the number of instances deleted. +func (r *InstanceGroupManagersService) DeleteInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest) *InstanceGroupManagersDeleteInstancesCall { + c := &InstanceGroupManagersDeleteInstancesCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanagersdeleteinstancesrequest = instancegroupmanagersdeleteinstancesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteInstancesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *InstanceGroupManagersDeleteInstancesCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteinstancesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapool.instanceGroupManagers.deleteInstances" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagersDeleteInstancesCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified instances. The instances are deleted, then removed from the instance group and any target pools of which they were a member. The targetSize of the instance group manager is reduced by the number of instances deleted.", + // "httpMethod": "POST", + // "id": "replicapool.instanceGroupManagers.deleteInstances", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the instance group manager.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The Google Developers Console 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": "The name of the zone in which the instance group manager resides.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances", + // "request": { + // "$ref": "InstanceGroupManagersDeleteInstancesRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "replicapool.instanceGroupManagers.get": + +type InstanceGroupManagersGetCall struct { + s *Service + project string + zone string + instanceGroupManager string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the specified Instance Group Manager resource. +func (r *InstanceGroupManagersService) Get(project string, zone string, instanceGroupManager string) *InstanceGroupManagersGetCall { + c := &InstanceGroupManagersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *InstanceGroupManagersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *InstanceGroupManagersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersGetCall) Context(ctx context.Context) *InstanceGroupManagersGetCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapool.instanceGroupManagers.get" call. +// Exactly one of *InstanceGroupManager or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *InstanceGroupManager.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstanceGroupManagersGetCall) Do() (*InstanceGroupManager, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceGroupManager{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified Instance Group Manager resource.", + // "httpMethod": "GET", + // "id": "replicapool.instanceGroupManagers.get", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "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": "The Google Developers Console 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": "The name of the zone in which the instance group manager resides.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}", + // "response": { + // "$ref": "InstanceGroupManager" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "replicapool.instanceGroupManagers.insert": + +type InstanceGroupManagersInsertCall struct { + s *Service + project string + zone string + size int64 + instancegroupmanager *InstanceGroupManager + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates an instance group manager, as well as the instance +// group and the specified number of instances. +func (r *InstanceGroupManagersService) Insert(project string, zone string, size int64, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersInsertCall { + c := &InstanceGroupManagersInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.size = size + c.instancegroupmanager = instancegroupmanager + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *InstanceGroupManagersInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersInsertCall) Context(ctx context.Context) *InstanceGroupManagersInsertCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + params.Set("size", fmt.Sprintf("%v", c.size)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapool.instanceGroupManagers.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagersInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an instance group manager, as well as the instance group and the specified number of instances.", + // "httpMethod": "POST", + // "id": "replicapool.instanceGroupManagers.insert", + // "parameterOrder": [ + // "project", + // "zone", + // "size" + // ], + // "parameters": { + // "project": { + // "description": "The Google Developers Console 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" + // }, + // "size": { + // "description": "Number of instances that should exist.", + // "format": "int32", + // "location": "query", + // "minimum": "0", + // "required": true, + // "type": "integer" + // }, + // "zone": { + // "description": "The name of the zone in which the instance group manager resides.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers", + // "request": { + // "$ref": "InstanceGroupManager" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "replicapool.instanceGroupManagers.list": + +type InstanceGroupManagersListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Retrieves the list of Instance Group Manager resources +// contained within the specified zone. +func (r *InstanceGroupManagersService) List(project string, zone string) *InstanceGroupManagersListCall { + c := &InstanceGroupManagersListCall{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 *InstanceGroupManagersListCall) Filter(filter string) *InstanceGroupManagersListCall { + 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 *InstanceGroupManagersListCall) MaxResults(maxResults int64) *InstanceGroupManagersListCall { + 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 *InstanceGroupManagersListCall) PageToken(pageToken string) *InstanceGroupManagersListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstanceGroupManagersListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersListCall) Context(ctx context.Context) *InstanceGroupManagersListCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapool.instanceGroupManagers.list" call. +// Exactly one of *InstanceGroupManagerList or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *InstanceGroupManagerList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstanceGroupManagersListCall) Do() (*InstanceGroupManagerList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceGroupManagerList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of Instance Group Manager resources contained within the specified zone.", + // "httpMethod": "GET", + // "id": "replicapool.instanceGroupManagers.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": "The Google Developers Console 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": "The name of the zone in which the instance group manager resides.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers", + // "response": { + // "$ref": "InstanceGroupManagerList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "replicapool.instanceGroupManagers.recreateInstances": + +type InstanceGroupManagersRecreateInstancesCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// RecreateInstances: Recreates the specified instances. The instances +// are deleted, then recreated using the instance group manager's +// current instance template. +func (r *InstanceGroupManagersService) RecreateInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest) *InstanceGroupManagersRecreateInstancesCall { + c := &InstanceGroupManagersRecreateInstancesCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanagersrecreateinstancesrequest = instancegroupmanagersrecreateinstancesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersRecreateInstancesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *InstanceGroupManagersRecreateInstancesCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersrecreateinstancesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapool.instanceGroupManagers.recreateInstances" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagersRecreateInstancesCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Recreates the specified instances. The instances are deleted, then recreated using the instance group manager's current instance template.", + // "httpMethod": "POST", + // "id": "replicapool.instanceGroupManagers.recreateInstances", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the instance group manager.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The Google Developers Console 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": "The name of the zone in which the instance group manager resides.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances", + // "request": { + // "$ref": "InstanceGroupManagersRecreateInstancesRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "replicapool.instanceGroupManagers.resize": + +type InstanceGroupManagersResizeCall struct { + s *Service + project string + zone string + instanceGroupManager string + size int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Resize: Resizes the managed instance group up or down. If resized up, +// new instances are created using the current instance template. If +// resized down, instances are removed in the order outlined in Resizing +// a managed instance group. +func (r *InstanceGroupManagersService) Resize(project string, zone string, instanceGroupManager string, size int64) *InstanceGroupManagersResizeCall { + c := &InstanceGroupManagersResizeCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.size = size + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersResizeCall) Context(ctx context.Context) *InstanceGroupManagersResizeCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("size", fmt.Sprintf("%v", c.size)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapool.instanceGroupManagers.resize" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagersResizeCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Resizes the managed instance group up or down. If resized up, new instances are created using the current instance template. If resized down, instances are removed in the order outlined in Resizing a managed instance group.", + // "httpMethod": "POST", + // "id": "replicapool.instanceGroupManagers.resize", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager", + // "size" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the instance group manager.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The Google Developers Console 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" + // }, + // "size": { + // "description": "Number of instances that should exist in this Instance Group Manager.", + // "format": "int32", + // "location": "query", + // "minimum": "0", + // "required": true, + // "type": "integer" + // }, + // "zone": { + // "description": "The name of the zone in which the instance group manager resides.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "replicapool.instanceGroupManagers.setInstanceTemplate": + +type InstanceGroupManagersSetInstanceTemplateCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetInstanceTemplate: Sets the instance template to use when creating +// new instances in this group. Existing instances are not affected. +func (r *InstanceGroupManagersService) SetInstanceTemplate(project string, zone string, instanceGroupManager string, instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest) *InstanceGroupManagersSetInstanceTemplateCall { + c := &InstanceGroupManagersSetInstanceTemplateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanagerssetinstancetemplaterequest = instancegroupmanagerssetinstancetemplaterequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetInstanceTemplateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *InstanceGroupManagersSetInstanceTemplateCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetinstancetemplaterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapool.instanceGroupManagers.setInstanceTemplate" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagersSetInstanceTemplateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the instance template to use when creating new instances in this group. Existing instances are not affected.", + // "httpMethod": "POST", + // "id": "replicapool.instanceGroupManagers.setInstanceTemplate", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the instance group manager.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The Google Developers Console 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": "The name of the zone in which the instance group manager resides.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate", + // "request": { + // "$ref": "InstanceGroupManagersSetInstanceTemplateRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "replicapool.instanceGroupManagers.setTargetPools": + +type InstanceGroupManagersSetTargetPoolsCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetTargetPools: Modifies the target pools to which all new instances +// in this group are assigned. Existing instances in the group are not +// affected. +func (r *InstanceGroupManagersService) SetTargetPools(project string, zone string, instanceGroupManager string, instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest) *InstanceGroupManagersSetTargetPoolsCall { + c := &InstanceGroupManagersSetTargetPoolsCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanagerssettargetpoolsrequest = instancegroupmanagerssettargetpoolsrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetTargetPoolsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *InstanceGroupManagersSetTargetPoolsCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssettargetpoolsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapool.instanceGroupManagers.setTargetPools" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupManagersSetTargetPoolsCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.", + // "httpMethod": "POST", + // "id": "replicapool.instanceGroupManagers.setTargetPools", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the instance group manager.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The Google Developers Console 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": "The name of the zone in which the instance group manager resides.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools", + // "request": { + // "$ref": "InstanceGroupManagersSetTargetPoolsRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "replicapool.zoneOperations.get": + +type ZoneOperationsGetCall struct { + s *Service + project string + zone string + operation string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneOperationsGetCall) Fields(s ...googleapi.Field) *ZoneOperationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ZoneOperationsGetCall) IfNoneMatch(entityTag string) *ZoneOperationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneOperationsGetCall) Context(ctx context.Context) *ZoneOperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapool.zoneOperations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ZoneOperationsGetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified zone-specific operation resource.", + // "httpMethod": "GET", + // "id": "replicapool.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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "replicapool.zoneOperations.list": + +type ZoneOperationsListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneOperationsListCall) Fields(s ...googleapi.Field) *ZoneOperationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ZoneOperationsListCall) IfNoneMatch(entityTag string) *ZoneOperationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneOperationsListCall) Context(ctx context.Context) *ZoneOperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneOperationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapool.zoneOperations.list" call. +// Exactly one of *OperationList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *OperationList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ZoneOperationsListCall) Do() (*OperationList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperationList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of operation resources contained within the specified zone.", + // "httpMethod": "GET", + // "id": "replicapool.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/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/replicapoolupdater/v1beta1/replicapoolupdater-api.json b/Godeps/_workspace/src/google.golang.org/api/replicapoolupdater/v1beta1/replicapoolupdater-api.json new file mode 100644 index 000000000..a6fbcc059 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/replicapoolupdater/v1beta1/replicapoolupdater-api.json @@ -0,0 +1,932 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/a9_NhKO1DW_f-K-sZ0-h8ToME8I\"", + "discoveryVersion": "v1", + "id": "replicapoolupdater:v1beta1", + "name": "replicapoolupdater", + "version": "v1beta1", + "revision": "20150904", + "title": "Google Compute Engine Instance Group Updater API", + "description": "The Google Compute Engine Instance Group Updater API provides services for updating groups of Compute Engine Instances.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/compute/docs/instance-groups/manager/#applying_rolling_updates_using_the_updater_service", + "labels": [ + "limited_availability" + ], + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/replicapoolupdater/v1beta1/projects/", + "basePath": "/replicapoolupdater/v1beta1/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "replicapoolupdater/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/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/replicapool": { + "description": "View and manage replica pools" + }, + "https://www.googleapis.com/auth/replicapool.readonly": { + "description": "View replica pools" + } + } + } + }, + "schemas": { + "InstanceUpdate": { + "id": "InstanceUpdate", + "type": "object", + "description": "Update of a single instance.", + "properties": { + "error": { + "type": "object", + "description": "Errors that occurred during the instance update.", + "properties": { + "errors": { + "type": "array", + "description": "[Output Only] The array of errors encountered while processing this operation.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The error type identifier for this error." + }, + "location": { + "type": "string", + "description": "[Output Only] Indicates the field in the request that caused the error. This property is optional." + }, + "message": { + "type": "string", + "description": "[Output Only] An optional, human-readable error message." + } + } + } + } + } + }, + "instance": { + "type": "string", + "description": "Fully-qualified URL of the instance being updated." + }, + "status": { + "type": "string", + "description": "Status of the instance update. Possible values are: \n- \"PENDING\": The instance update is pending execution. \n- \"ROLLING_FORWARD\": The instance update is going forward. \n- \"ROLLING_BACK\": The instance update is being rolled back. \n- \"PAUSED\": The instance update is temporarily paused (inactive). \n- \"ROLLED_OUT\": The instance update is finished, the instance is running the new template. \n- \"ROLLED_BACK\": The instance update is finished, the instance has been reverted to the previous template. \n- \"CANCELLED\": The instance update is paused and no longer can be resumed, undefined in which template the instance is running." + } + } + }, + "InstanceUpdateList": { + "id": "InstanceUpdateList", + "type": "object", + "description": "Response returned by ListInstanceUpdates method.", + "properties": { + "items": { + "type": "array", + "description": "Collection of requested instance updates.", + "items": { + "$ref": "InstanceUpdate" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource.", + "default": "replicapoolupdater#instanceUpdateList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The fully qualified URL for the resource." + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "description": "An operation resource, used to manage asynchronous API requests.", + "properties": { + "clientOperationId": { + "type": "string" + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "endTime": { + "type": "string" + }, + "error": { + "type": "object", + "description": "[Output Only] If errors occurred during processing of this operation, this field will be populated.", + "properties": { + "errors": { + "type": "array", + "description": "[Output Only] The array of errors encountered while processing this operation.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The error type identifier for this error." + }, + "location": { + "type": "string", + "description": "[Output Only] Indicates the field in the request that caused the error. This property is optional." + }, + "message": { + "type": "string", + "description": "[Output Only] An optional, human-readable error message." + } + } + } + } + } + }, + "httpErrorMessage": { + "type": "string" + }, + "httpErrorStatusCode": { + "type": "integer", + "format": "int32" + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "[Output Only] The time that this operation was requested. This is in RFC 3339 format." + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always replicapoolupdater#operation for Operation resources.", + "default": "replicapoolupdater#operation" + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource." + }, + "operationType": { + "type": "string" + }, + "progress": { + "type": "integer", + "format": "int32" + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where the operation resides." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server defined URL for the resource." + }, + "startTime": { + "type": "string", + "description": "[Output Only] The time that this operation was started by the server. This is in RFC 3339 format." + }, + "status": { + "type": "string", + "description": "[Output Only] Status of the operation. Can be one of the following: \"PENDING\", \"RUNNING\", or \"DONE\"." + }, + "statusMessage": { + "type": "string", + "description": "[Output Only] An optional textual description of the current status of the operation." + }, + "targetId": { + "type": "string", + "description": "[Output Only] Unique target id which identifies a particular incarnation of the target.", + "format": "uint64" + }, + "targetLink": { + "type": "string", + "description": "[Output Only] URL of the resource the operation is mutating." + }, + "user": { + "type": "string" + }, + "warnings": { + "type": "array", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output only] The warning type identifier for this warning." + }, + "data": { + "type": "array", + "description": "[Output only] Metadata for this warning in key:value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] Metadata key for this warning." + }, + "value": { + "type": "string", + "description": "[Output Only] Metadata value for this warning." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output only] Optional human-readable details for this warning." + } + } + } + }, + "zone": { + "type": "string", + "description": "[Output Only] URL of the zone where the operation resides." + } + } + }, + "OperationList": { + "id": "OperationList", + "type": "object", + "description": "Contains a list of Operation resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "[Output Only] The Operation resources.", + "items": { + "$ref": "Operation" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of resource. Always replicapoolupdater#operations for Operations resource.", + "default": "replicapoolupdater#operationList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncate." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "RollingUpdate": { + "id": "RollingUpdate", + "type": "object", + "description": "The following represents a resource describing a single update (rollout) of a group of instances to the given template.", + "properties": { + "actionType": { + "type": "string", + "description": "Specifies the action to take for each instance within the instance group. This can be RECREATE which will recreate each instance and is only available for managed instance groups. It can also be REBOOT which performs a soft reboot for each instance and is only available for regular (non-managed) instance groups." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "error": { + "type": "object", + "description": "[Output Only] Errors that occurred during the rolling update.", + "properties": { + "errors": { + "type": "array", + "description": "[Output Only] The array of errors encountered while processing this operation.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The error type identifier for this error." + }, + "location": { + "type": "string", + "description": "[Output Only] Indicates the field in the request that caused the error. This property is optional." + }, + "message": { + "type": "string", + "description": "[Output Only] An optional, human-readable error message." + } + } + } + } + } + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "instanceGroup": { + "type": "string", + "description": "Fully-qualified URL of an instance group being updated. Exactly one of instanceGroupManager and instanceGroup must be set." + }, + "instanceGroupManager": { + "type": "string", + "description": "Fully-qualified URL of an instance group manager being updated. Exactly one of instanceGroupManager and instanceGroup must be set." + }, + "instanceTemplate": { + "type": "string", + "description": "Fully-qualified URL of an instance template to apply." + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource.", + "default": "replicapoolupdater#rollingUpdate" + }, + "oldInstanceTemplate": { + "type": "string", + "description": "Fully-qualified URL of the instance template encountered while starting the update." + }, + "policy": { + "type": "object", + "description": "Parameters of the update process.", + "properties": { + "autoPauseAfterInstances": { + "type": "integer", + "description": "Number of instances to update before the updater pauses the rolling update.", + "format": "int32" + }, + "instanceStartupTimeoutSec": { + "type": "integer", + "description": "The maximum amount of time that the updater waits for a HEALTHY state after all of the update steps are complete. If the HEALTHY state is not received before the deadline, the instance update is considered a failure.", + "format": "int32" + }, + "maxNumConcurrentInstances": { + "type": "integer", + "description": "The maximum number of instances that can be updated simultaneously. An instance update is considered complete only after the instance is restarted and initialized.", + "format": "int32" + }, + "maxNumFailedInstances": { + "type": "integer", + "description": "The maximum number of instance updates that can fail before the group update is considered a failure. An instance update is considered failed if any of its update actions (e.g. Stop call on Instance resource in Rolling Reboot) failed with permanent failure, or if the instance is in an UNHEALTHY state after it finishes all of the update actions.", + "format": "int32" + }, + "minInstanceUpdateTimeSec": { + "type": "integer", + "description": "The minimum amount of time that the updater spends to update each instance. Update time is the time it takes to complete all update actions (e.g. Stop call on Instance resource in Rolling Reboot), reboot, and initialize. If the instance update finishes early, the updater pauses for the remainder of the time before it starts the next instance update.", + "format": "int32" + } + } + }, + "progress": { + "type": "integer", + "description": "[Output Only] 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 update will be complete. This number should be monotonically increasing as the update progresses.", + "format": "int32" + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The fully qualified URL for the resource." + }, + "status": { + "type": "string", + "description": "[Output Only] Status of the update. Possible values are: \n- \"ROLLING_FORWARD\": The update is going forward. \n- \"ROLLING_BACK\": The update is being rolled back. \n- \"PAUSED\": The update is temporarily paused (inactive). \n- \"ROLLED_OUT\": The update is finished, all instances have been updated successfully. \n- \"ROLLED_BACK\": The update is finished, all instances have been reverted to the previous template. \n- \"CANCELLED\": The update is paused and no longer can be resumed, undefined how many instances are running in which template." + }, + "statusMessage": { + "type": "string", + "description": "[Output Only] An optional textual description of the current status of the update." + }, + "user": { + "type": "string", + "description": "[Output Only] User who requested the update, for example: user@example.com." + } + } + }, + "RollingUpdateList": { + "id": "RollingUpdateList", + "type": "object", + "description": "Response returned by List method.", + "properties": { + "items": { + "type": "array", + "description": "Collection of requested updates.", + "items": { + "$ref": "RollingUpdate" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource.", + "default": "replicapoolupdater#rollingUpdateList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The fully qualified URL for the resource." + } + } + } + }, + "resources": { + "rollingUpdates": { + "methods": { + "cancel": { + "id": "replicapoolupdater.rollingUpdates.cancel", + "path": "{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/cancel", + "httpMethod": "POST", + "description": "Cancels an update. The update must be PAUSED before it can be cancelled. This has no effect if the update is already CANCELLED.", + "parameters": { + "project": { + "type": "string", + "description": "The Google Developers Console 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" + }, + "rollingUpdate": { + "type": "string", + "description": "The name of the update.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone in which the update's target resides.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "rollingUpdate" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/replicapool" + ] + }, + "get": { + "id": "replicapoolupdater.rollingUpdates.get", + "path": "{project}/zones/{zone}/rollingUpdates/{rollingUpdate}", + "httpMethod": "GET", + "description": "Returns information about an update.", + "parameters": { + "project": { + "type": "string", + "description": "The Google Developers Console 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" + }, + "rollingUpdate": { + "type": "string", + "description": "The name of the update.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone in which the update's target resides.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "rollingUpdate" + ], + "response": { + "$ref": "RollingUpdate" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/replicapool", + "https://www.googleapis.com/auth/replicapool.readonly" + ] + }, + "insert": { + "id": "replicapoolupdater.rollingUpdates.insert", + "path": "{project}/zones/{zone}/rollingUpdates", + "httpMethod": "POST", + "description": "Inserts and starts a new update.", + "parameters": { + "project": { + "type": "string", + "description": "The Google Developers Console 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": "The name of the zone in which the update's target resides.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "request": { + "$ref": "RollingUpdate" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/replicapool" + ] + }, + "list": { + "id": "replicapoolupdater.rollingUpdates.list", + "path": "{project}/zones/{zone}/rollingUpdates", + "httpMethod": "GET", + "description": "Lists recent updates for a given managed instance group, in reverse chronological order and paginated format.", + "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": "The Google Developers Console 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": "The name of the zone in which the update's target resides.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "RollingUpdateList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/replicapool", + "https://www.googleapis.com/auth/replicapool.readonly" + ] + }, + "listInstanceUpdates": { + "id": "replicapoolupdater.rollingUpdates.listInstanceUpdates", + "path": "{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/instanceUpdates", + "httpMethod": "GET", + "description": "Lists the current status for each instance within a given update.", + "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": "The Google Developers Console 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" + }, + "rollingUpdate": { + "type": "string", + "description": "The name of the update.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone in which the update's target resides.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "rollingUpdate" + ], + "response": { + "$ref": "InstanceUpdateList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/replicapool", + "https://www.googleapis.com/auth/replicapool.readonly" + ] + }, + "pause": { + "id": "replicapoolupdater.rollingUpdates.pause", + "path": "{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/pause", + "httpMethod": "POST", + "description": "Pauses the update in state from ROLLING_FORWARD or ROLLING_BACK. Has no effect if invoked when the state of the update is PAUSED.", + "parameters": { + "project": { + "type": "string", + "description": "The Google Developers Console 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" + }, + "rollingUpdate": { + "type": "string", + "description": "The name of the update.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone in which the update's target resides.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "rollingUpdate" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/replicapool" + ] + }, + "resume": { + "id": "replicapoolupdater.rollingUpdates.resume", + "path": "{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/resume", + "httpMethod": "POST", + "description": "Continues an update in PAUSED state. Has no effect if invoked when the state of the update is ROLLED_OUT.", + "parameters": { + "project": { + "type": "string", + "description": "The Google Developers Console 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" + }, + "rollingUpdate": { + "type": "string", + "description": "The name of the update.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone in which the update's target resides.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "rollingUpdate" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/replicapool" + ] + }, + "rollback": { + "id": "replicapoolupdater.rollingUpdates.rollback", + "path": "{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/rollback", + "httpMethod": "POST", + "description": "Rolls back the update in state from ROLLING_FORWARD or PAUSED. Has no effect if invoked when the state of the update is ROLLED_BACK.", + "parameters": { + "project": { + "type": "string", + "description": "The Google Developers Console 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" + }, + "rollingUpdate": { + "type": "string", + "description": "The name of the update.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone in which the update's target resides.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "rollingUpdate" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/replicapool" + ] + } + } + }, + "zoneOperations": { + "methods": { + "get": { + "id": "replicapoolupdater.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, + "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, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "operation" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/replicapool" + ] + }, + "list": { + "id": "replicapoolupdater.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, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "OperationList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/replicapool" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/replicapoolupdater/v1beta1/replicapoolupdater-gen.go b/Godeps/_workspace/src/google.golang.org/api/replicapoolupdater/v1beta1/replicapoolupdater-gen.go new file mode 100644 index 000000000..e65cbac3e --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/replicapoolupdater/v1beta1/replicapoolupdater-gen.go @@ -0,0 +1,2247 @@ +// Package replicapoolupdater provides access to the Google Compute Engine Instance Group Updater API. +// +// See https://cloud.google.com/compute/docs/instance-groups/manager/#applying_rolling_updates_using_the_updater_service +// +// Usage example: +// +// import "google.golang.org/api/replicapoolupdater/v1beta1" +// ... +// replicapoolupdaterService, err := replicapoolupdater.New(oauthHttpClient) +package replicapoolupdater // import "google.golang.org/api/replicapoolupdater/v1beta1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "replicapoolupdater:v1beta1" +const apiName = "replicapoolupdater" +const apiVersion = "v1beta1" +const basePath = "https://www.googleapis.com/replicapoolupdater/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 data across Google Cloud Platform services + CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" + + // View and manage replica pools + ReplicapoolScope = "https://www.googleapis.com/auth/replicapool" + + // View replica pools + ReplicapoolReadonlyScope = "https://www.googleapis.com/auth/replicapool.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.RollingUpdates = NewRollingUpdatesService(s) + s.ZoneOperations = NewZoneOperationsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + RollingUpdates *RollingUpdatesService + + ZoneOperations *ZoneOperationsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewRollingUpdatesService(s *Service) *RollingUpdatesService { + rs := &RollingUpdatesService{s: s} + return rs +} + +type RollingUpdatesService struct { + s *Service +} + +func NewZoneOperationsService(s *Service) *ZoneOperationsService { + rs := &ZoneOperationsService{s: s} + return rs +} + +type ZoneOperationsService struct { + s *Service +} + +// InstanceUpdate: Update of a single instance. +type InstanceUpdate struct { + // Error: Errors that occurred during the instance update. + Error *InstanceUpdateError `json:"error,omitempty"` + + // Instance: Fully-qualified URL of the instance being updated. + Instance string `json:"instance,omitempty"` + + // Status: Status of the instance update. Possible values are: + // - "PENDING": The instance update is pending execution. + // - "ROLLING_FORWARD": The instance update is going forward. + // - "ROLLING_BACK": The instance update is being rolled back. + // - "PAUSED": The instance update is temporarily paused (inactive). + // - "ROLLED_OUT": The instance update is finished, the instance is + // running the new template. + // - "ROLLED_BACK": The instance update is finished, the instance has + // been reverted to the previous template. + // - "CANCELLED": The instance update is paused and no longer can be + // resumed, undefined in which template the instance is running. + Status string `json:"status,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Error") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceUpdate) MarshalJSON() ([]byte, error) { + type noMethod InstanceUpdate + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceUpdateError: Errors that occurred during the instance update. +type InstanceUpdateError struct { + // Errors: [Output Only] The array of errors encountered while + // processing this operation. + Errors []*InstanceUpdateErrorErrors `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceUpdateError) MarshalJSON() ([]byte, error) { + type noMethod InstanceUpdateError + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceUpdateErrorErrors struct { + // Code: [Output Only] The error type identifier for this error. + Code string `json:"code,omitempty"` + + // Location: [Output Only] Indicates the field in the request that + // caused the error. This property is optional. + Location string `json:"location,omitempty"` + + // Message: [Output Only] An optional, human-readable error message. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceUpdateErrorErrors) MarshalJSON() ([]byte, error) { + type noMethod InstanceUpdateErrorErrors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceUpdateList: Response returned by ListInstanceUpdates method. +type InstanceUpdateList struct { + // Items: Collection of requested instance updates. + Items []*InstanceUpdate `json:"items,omitempty"` + + // Kind: [Output Only] Type of the resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] The fully qualified URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceUpdateList) MarshalJSON() ([]byte, error) { + type noMethod InstanceUpdateList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Operation: An operation resource, used to manage asynchronous API +// requests. +type Operation struct { + ClientOperationId string `json:"clientOperationId,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + EndTime string `json:"endTime,omitempty"` + + // Error: [Output Only] If errors occurred during processing of this + // operation, this field will be populated. + Error *OperationError `json:"error,omitempty"` + + HttpErrorMessage string `json:"httpErrorMessage,omitempty"` + + HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // InsertTime: [Output Only] The time that this operation was requested. + // This is in RFC 3339 format. + InsertTime string `json:"insertTime,omitempty"` + + // Kind: [Output Only] Type of the resource. Always + // replicapoolupdater#operation for Operation resources. + Kind string `json:"kind,omitempty"` + + // Name: [Output Only] Name of the resource. + Name string `json:"name,omitempty"` + + OperationType string `json:"operationType,omitempty"` + + Progress int64 `json:"progress,omitempty"` + + // Region: [Output Only] URL of the region where the operation resides. + Region string `json:"region,omitempty"` + + // SelfLink: [Output Only] Server defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // StartTime: [Output Only] The time that this operation was started by + // the server. This is in RFC 3339 format. + StartTime string `json:"startTime,omitempty"` + + // Status: [Output Only] Status of the operation. Can be one of the + // following: "PENDING", "RUNNING", or "DONE". + Status string `json:"status,omitempty"` + + // StatusMessage: [Output Only] An optional textual description of the + // current status of the operation. + StatusMessage string `json:"statusMessage,omitempty"` + + // TargetId: [Output Only] Unique target id which identifies a + // particular incarnation of the target. + TargetId uint64 `json:"targetId,omitempty,string"` + + // TargetLink: [Output Only] URL of the resource the operation is + // mutating. + TargetLink string `json:"targetLink,omitempty"` + + User string `json:"user,omitempty"` + + Warnings []*OperationWarnings `json:"warnings,omitempty"` + + // Zone: [Output Only] URL of the zone where the operation resides. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ClientOperationId") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Operation) MarshalJSON() ([]byte, error) { + type noMethod Operation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationError: [Output Only] If errors occurred during processing of +// this operation, this field will be populated. +type OperationError struct { + // Errors: [Output Only] The array of errors encountered while + // processing this operation. + Errors []*OperationErrorErrors `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationError) MarshalJSON() ([]byte, error) { + type noMethod OperationError + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationErrorErrors struct { + // Code: [Output Only] The error type identifier for this error. + Code string `json:"code,omitempty"` + + // Location: [Output Only] Indicates the field in the request that + // caused the error. This property is optional. + Location string `json:"location,omitempty"` + + // Message: [Output Only] An optional, human-readable error message. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) { + type noMethod OperationErrorErrors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationWarnings struct { + // Code: [Output only] The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: [Output only] Metadata for this warning in key:value format. + Data []*OperationWarningsData `json:"data,omitempty"` + + // Message: [Output only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationWarnings) MarshalJSON() ([]byte, error) { + type noMethod OperationWarnings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationWarningsData struct { + // Key: [Output Only] Metadata key for this warning. + Key string `json:"key,omitempty"` + + // Value: [Output Only] Metadata value for this warning. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationWarningsData) MarshalJSON() ([]byte, error) { + type noMethod OperationWarningsData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationList: Contains a list of Operation resources. +type OperationList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: [Output Only] The Operation resources. + Items []*Operation `json:"items,omitempty"` + + // Kind: [Output Only] Type of resource. Always + // replicapoolupdater#operations for Operations resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncate. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationList) MarshalJSON() ([]byte, error) { + type noMethod OperationList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RollingUpdate: The following represents a resource describing a +// single update (rollout) of a group of instances to the given +// template. +type RollingUpdate struct { + // ActionType: Specifies the action to take for each instance within the + // instance group. This can be RECREATE which will recreate each + // instance and is only available for managed instance groups. It can + // also be REBOOT which performs a soft reboot for each instance and is + // only available for regular (non-managed) instance groups. + ActionType string `json:"actionType,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + 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"` + + // Error: [Output Only] Errors that occurred during the rolling update. + Error *RollingUpdateError `json:"error,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // InstanceGroup: Fully-qualified URL of an instance group being + // updated. Exactly one of instanceGroupManager and instanceGroup must + // be set. + InstanceGroup string `json:"instanceGroup,omitempty"` + + // InstanceGroupManager: Fully-qualified URL of an instance group + // manager being updated. Exactly one of instanceGroupManager and + // instanceGroup must be set. + InstanceGroupManager string `json:"instanceGroupManager,omitempty"` + + // InstanceTemplate: Fully-qualified URL of an instance template to + // apply. + InstanceTemplate string `json:"instanceTemplate,omitempty"` + + // Kind: [Output Only] Type of the resource. + Kind string `json:"kind,omitempty"` + + // OldInstanceTemplate: Fully-qualified URL of the instance template + // encountered while starting the update. + OldInstanceTemplate string `json:"oldInstanceTemplate,omitempty"` + + // Policy: Parameters of the update process. + Policy *RollingUpdatePolicy `json:"policy,omitempty"` + + // Progress: [Output Only] 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 update will be complete. This number should be monotonically + // increasing as the update progresses. + Progress int64 `json:"progress,omitempty"` + + // SelfLink: [Output Only] The fully qualified URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // Status: [Output Only] Status of the update. Possible values are: + // - "ROLLING_FORWARD": The update is going forward. + // - "ROLLING_BACK": The update is being rolled back. + // - "PAUSED": The update is temporarily paused (inactive). + // - "ROLLED_OUT": The update is finished, all instances have been + // updated successfully. + // - "ROLLED_BACK": The update is finished, all instances have been + // reverted to the previous template. + // - "CANCELLED": The update is paused and no longer can be resumed, + // undefined how many instances are running in which template. + Status string `json:"status,omitempty"` + + // StatusMessage: [Output Only] An optional textual description of the + // current status of the update. + StatusMessage string `json:"statusMessage,omitempty"` + + // User: [Output Only] User who requested the update, for example: + // user@example.com. + User string `json:"user,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ActionType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RollingUpdate) MarshalJSON() ([]byte, error) { + type noMethod RollingUpdate + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RollingUpdateError: [Output Only] Errors that occurred during the +// rolling update. +type RollingUpdateError struct { + // Errors: [Output Only] The array of errors encountered while + // processing this operation. + Errors []*RollingUpdateErrorErrors `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RollingUpdateError) MarshalJSON() ([]byte, error) { + type noMethod RollingUpdateError + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type RollingUpdateErrorErrors struct { + // Code: [Output Only] The error type identifier for this error. + Code string `json:"code,omitempty"` + + // Location: [Output Only] Indicates the field in the request that + // caused the error. This property is optional. + Location string `json:"location,omitempty"` + + // Message: [Output Only] An optional, human-readable error message. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RollingUpdateErrorErrors) MarshalJSON() ([]byte, error) { + type noMethod RollingUpdateErrorErrors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RollingUpdatePolicy: Parameters of the update process. +type RollingUpdatePolicy struct { + // AutoPauseAfterInstances: Number of instances to update before the + // updater pauses the rolling update. + AutoPauseAfterInstances int64 `json:"autoPauseAfterInstances,omitempty"` + + // InstanceStartupTimeoutSec: The maximum amount of time that the + // updater waits for a HEALTHY state after all of the update steps are + // complete. If the HEALTHY state is not received before the deadline, + // the instance update is considered a failure. + InstanceStartupTimeoutSec int64 `json:"instanceStartupTimeoutSec,omitempty"` + + // MaxNumConcurrentInstances: The maximum number of instances that can + // be updated simultaneously. An instance update is considered complete + // only after the instance is restarted and initialized. + MaxNumConcurrentInstances int64 `json:"maxNumConcurrentInstances,omitempty"` + + // MaxNumFailedInstances: The maximum number of instance updates that + // can fail before the group update is considered a failure. An instance + // update is considered failed if any of its update actions (e.g. Stop + // call on Instance resource in Rolling Reboot) failed with permanent + // failure, or if the instance is in an UNHEALTHY state after it + // finishes all of the update actions. + MaxNumFailedInstances int64 `json:"maxNumFailedInstances,omitempty"` + + // MinInstanceUpdateTimeSec: The minimum amount of time that the updater + // spends to update each instance. Update time is the time it takes to + // complete all update actions (e.g. Stop call on Instance resource in + // Rolling Reboot), reboot, and initialize. If the instance update + // finishes early, the updater pauses for the remainder of the time + // before it starts the next instance update. + MinInstanceUpdateTimeSec int64 `json:"minInstanceUpdateTimeSec,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "AutoPauseAfterInstances") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RollingUpdatePolicy) MarshalJSON() ([]byte, error) { + type noMethod RollingUpdatePolicy + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RollingUpdateList: Response returned by List method. +type RollingUpdateList struct { + // Items: Collection of requested updates. + Items []*RollingUpdate `json:"items,omitempty"` + + // Kind: [Output Only] Type of the resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used to continue a truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] The fully qualified URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RollingUpdateList) MarshalJSON() ([]byte, error) { + type noMethod RollingUpdateList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "replicapoolupdater.rollingUpdates.cancel": + +type RollingUpdatesCancelCall struct { + s *Service + project string + zone string + rollingUpdate string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Cancel: Cancels an update. The update must be PAUSED before it can be +// cancelled. This has no effect if the update is already CANCELLED. +// For details, see https://cloud.google.com/compute/docs/instance-groups/manager/#cancelrollingupdate +func (r *RollingUpdatesService) Cancel(project string, zone string, rollingUpdate string) *RollingUpdatesCancelCall { + c := &RollingUpdatesCancelCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.rollingUpdate = rollingUpdate + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RollingUpdatesCancelCall) Fields(s ...googleapi.Field) *RollingUpdatesCancelCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RollingUpdatesCancelCall) Context(ctx context.Context) *RollingUpdatesCancelCall { + c.ctx_ = ctx + return c +} + +func (c *RollingUpdatesCancelCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/cancel") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "rollingUpdate": c.rollingUpdate, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapoolupdater.rollingUpdates.cancel" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RollingUpdatesCancelCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Cancels an update. The update must be PAUSED before it can be cancelled. This has no effect if the update is already CANCELLED.", + // "httpMethod": "POST", + // "id": "replicapoolupdater.rollingUpdates.cancel", + // "parameterOrder": [ + // "project", + // "zone", + // "rollingUpdate" + // ], + // "parameters": { + // "project": { + // "description": "The Google Developers Console 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" + // }, + // "rollingUpdate": { + // "description": "The name of the update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone in which the update's target resides.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/cancel", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/replicapool" + // ] + // } + +} + +// method id "replicapoolupdater.rollingUpdates.get": + +type RollingUpdatesGetCall struct { + s *Service + project string + zone string + rollingUpdate string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns information about an update. +// For details, see https://cloud.google.com/compute/docs/instance-groups/manager/#getlistrollingupdate +func (r *RollingUpdatesService) Get(project string, zone string, rollingUpdate string) *RollingUpdatesGetCall { + c := &RollingUpdatesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.rollingUpdate = rollingUpdate + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RollingUpdatesGetCall) Fields(s ...googleapi.Field) *RollingUpdatesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RollingUpdatesGetCall) IfNoneMatch(entityTag string) *RollingUpdatesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RollingUpdatesGetCall) Context(ctx context.Context) *RollingUpdatesGetCall { + c.ctx_ = ctx + return c +} + +func (c *RollingUpdatesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/rollingUpdates/{rollingUpdate}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "rollingUpdate": c.rollingUpdate, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapoolupdater.rollingUpdates.get" call. +// Exactly one of *RollingUpdate or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *RollingUpdate.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RollingUpdatesGetCall) Do() (*RollingUpdate, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RollingUpdate{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns information about an update.", + // "httpMethod": "GET", + // "id": "replicapoolupdater.rollingUpdates.get", + // "parameterOrder": [ + // "project", + // "zone", + // "rollingUpdate" + // ], + // "parameters": { + // "project": { + // "description": "The Google Developers Console 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" + // }, + // "rollingUpdate": { + // "description": "The name of the update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone in which the update's target resides.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/rollingUpdates/{rollingUpdate}", + // "response": { + // "$ref": "RollingUpdate" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/replicapool", + // "https://www.googleapis.com/auth/replicapool.readonly" + // ] + // } + +} + +// method id "replicapoolupdater.rollingUpdates.insert": + +type RollingUpdatesInsertCall struct { + s *Service + project string + zone string + rollingupdate *RollingUpdate + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts and starts a new update. +// For details, see https://cloud.google.com/compute/docs/instance-groups/manager/#starting_an_update +func (r *RollingUpdatesService) Insert(project string, zone string, rollingupdate *RollingUpdate) *RollingUpdatesInsertCall { + c := &RollingUpdatesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.rollingupdate = rollingupdate + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RollingUpdatesInsertCall) Fields(s ...googleapi.Field) *RollingUpdatesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RollingUpdatesInsertCall) Context(ctx context.Context) *RollingUpdatesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *RollingUpdatesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollingupdate) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/rollingUpdates") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapoolupdater.rollingUpdates.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RollingUpdatesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts and starts a new update.", + // "httpMethod": "POST", + // "id": "replicapoolupdater.rollingUpdates.insert", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "The Google Developers Console 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": "The name of the zone in which the update's target resides.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/rollingUpdates", + // "request": { + // "$ref": "RollingUpdate" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/replicapool" + // ] + // } + +} + +// method id "replicapoolupdater.rollingUpdates.list": + +type RollingUpdatesListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists recent updates for a given managed instance group, in +// reverse chronological order and paginated format. +// For details, see https://cloud.google.com/compute/docs/instance-groups/manager/#getlistrollingupdate +func (r *RollingUpdatesService) List(project string, zone string) *RollingUpdatesListCall { + c := &RollingUpdatesListCall{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 *RollingUpdatesListCall) Filter(filter string) *RollingUpdatesListCall { + 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 *RollingUpdatesListCall) MaxResults(maxResults int64) *RollingUpdatesListCall { + 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 *RollingUpdatesListCall) PageToken(pageToken string) *RollingUpdatesListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RollingUpdatesListCall) Fields(s ...googleapi.Field) *RollingUpdatesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RollingUpdatesListCall) IfNoneMatch(entityTag string) *RollingUpdatesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RollingUpdatesListCall) Context(ctx context.Context) *RollingUpdatesListCall { + c.ctx_ = ctx + return c +} + +func (c *RollingUpdatesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/rollingUpdates") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapoolupdater.rollingUpdates.list" call. +// Exactly one of *RollingUpdateList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *RollingUpdateList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RollingUpdatesListCall) Do() (*RollingUpdateList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RollingUpdateList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists recent updates for a given managed instance group, in reverse chronological order and paginated format.", + // "httpMethod": "GET", + // "id": "replicapoolupdater.rollingUpdates.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": "The Google Developers Console 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": "The name of the zone in which the update's target resides.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/rollingUpdates", + // "response": { + // "$ref": "RollingUpdateList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/replicapool", + // "https://www.googleapis.com/auth/replicapool.readonly" + // ] + // } + +} + +// method id "replicapoolupdater.rollingUpdates.listInstanceUpdates": + +type RollingUpdatesListInstanceUpdatesCall struct { + s *Service + project string + zone string + rollingUpdate string + opt_ map[string]interface{} + ctx_ context.Context +} + +// ListInstanceUpdates: Lists the current status for each instance +// within a given update. +// For details, see https://cloud.google.com/compute/docs/instance-groups/manager/#getlistrollingupdate +func (r *RollingUpdatesService) ListInstanceUpdates(project string, zone string, rollingUpdate string) *RollingUpdatesListInstanceUpdatesCall { + c := &RollingUpdatesListInstanceUpdatesCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.rollingUpdate = rollingUpdate + return c +} + +// Filter sets the optional parameter "filter": Filter expression for +// filtering listed resources. +func (c *RollingUpdatesListInstanceUpdatesCall) Filter(filter string) *RollingUpdatesListInstanceUpdatesCall { + 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 *RollingUpdatesListInstanceUpdatesCall) MaxResults(maxResults int64) *RollingUpdatesListInstanceUpdatesCall { + 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 *RollingUpdatesListInstanceUpdatesCall) PageToken(pageToken string) *RollingUpdatesListInstanceUpdatesCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RollingUpdatesListInstanceUpdatesCall) Fields(s ...googleapi.Field) *RollingUpdatesListInstanceUpdatesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RollingUpdatesListInstanceUpdatesCall) IfNoneMatch(entityTag string) *RollingUpdatesListInstanceUpdatesCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RollingUpdatesListInstanceUpdatesCall) Context(ctx context.Context) *RollingUpdatesListInstanceUpdatesCall { + c.ctx_ = ctx + return c +} + +func (c *RollingUpdatesListInstanceUpdatesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/instanceUpdates") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "rollingUpdate": c.rollingUpdate, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapoolupdater.rollingUpdates.listInstanceUpdates" call. +// Exactly one of *InstanceUpdateList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *InstanceUpdateList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RollingUpdatesListInstanceUpdatesCall) Do() (*InstanceUpdateList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceUpdateList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the current status for each instance within a given update.", + // "httpMethod": "GET", + // "id": "replicapoolupdater.rollingUpdates.listInstanceUpdates", + // "parameterOrder": [ + // "project", + // "zone", + // "rollingUpdate" + // ], + // "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": "The Google Developers Console 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" + // }, + // "rollingUpdate": { + // "description": "The name of the update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone in which the update's target resides.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/instanceUpdates", + // "response": { + // "$ref": "InstanceUpdateList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/replicapool", + // "https://www.googleapis.com/auth/replicapool.readonly" + // ] + // } + +} + +// method id "replicapoolupdater.rollingUpdates.pause": + +type RollingUpdatesPauseCall struct { + s *Service + project string + zone string + rollingUpdate string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Pause: Pauses the update in state from ROLLING_FORWARD or +// ROLLING_BACK. Has no effect if invoked when the state of the update +// is PAUSED. +// For details, see https://cloud.google.com/compute/docs/instance-groups/manager/#pausing_a_rolling_update +func (r *RollingUpdatesService) Pause(project string, zone string, rollingUpdate string) *RollingUpdatesPauseCall { + c := &RollingUpdatesPauseCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.rollingUpdate = rollingUpdate + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RollingUpdatesPauseCall) Fields(s ...googleapi.Field) *RollingUpdatesPauseCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RollingUpdatesPauseCall) Context(ctx context.Context) *RollingUpdatesPauseCall { + c.ctx_ = ctx + return c +} + +func (c *RollingUpdatesPauseCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/pause") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "rollingUpdate": c.rollingUpdate, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapoolupdater.rollingUpdates.pause" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RollingUpdatesPauseCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Pauses the update in state from ROLLING_FORWARD or ROLLING_BACK. Has no effect if invoked when the state of the update is PAUSED.", + // "httpMethod": "POST", + // "id": "replicapoolupdater.rollingUpdates.pause", + // "parameterOrder": [ + // "project", + // "zone", + // "rollingUpdate" + // ], + // "parameters": { + // "project": { + // "description": "The Google Developers Console 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" + // }, + // "rollingUpdate": { + // "description": "The name of the update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone in which the update's target resides.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/pause", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/replicapool" + // ] + // } + +} + +// method id "replicapoolupdater.rollingUpdates.resume": + +type RollingUpdatesResumeCall struct { + s *Service + project string + zone string + rollingUpdate string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Resume: Continues an update in PAUSED state. Has no effect if invoked +// when the state of the update is ROLLED_OUT. +// For details, see https://cloud.google.com/compute/docs/instance-groups/manager/#continuerollingupdate +func (r *RollingUpdatesService) Resume(project string, zone string, rollingUpdate string) *RollingUpdatesResumeCall { + c := &RollingUpdatesResumeCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.rollingUpdate = rollingUpdate + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RollingUpdatesResumeCall) Fields(s ...googleapi.Field) *RollingUpdatesResumeCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RollingUpdatesResumeCall) Context(ctx context.Context) *RollingUpdatesResumeCall { + c.ctx_ = ctx + return c +} + +func (c *RollingUpdatesResumeCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/resume") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "rollingUpdate": c.rollingUpdate, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapoolupdater.rollingUpdates.resume" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RollingUpdatesResumeCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Continues an update in PAUSED state. Has no effect if invoked when the state of the update is ROLLED_OUT.", + // "httpMethod": "POST", + // "id": "replicapoolupdater.rollingUpdates.resume", + // "parameterOrder": [ + // "project", + // "zone", + // "rollingUpdate" + // ], + // "parameters": { + // "project": { + // "description": "The Google Developers Console 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" + // }, + // "rollingUpdate": { + // "description": "The name of the update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone in which the update's target resides.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/resume", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/replicapool" + // ] + // } + +} + +// method id "replicapoolupdater.rollingUpdates.rollback": + +type RollingUpdatesRollbackCall struct { + s *Service + project string + zone string + rollingUpdate string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Rollback: Rolls back the update in state from ROLLING_FORWARD or +// PAUSED. Has no effect if invoked when the state of the update is +// ROLLED_BACK. +// For details, see https://cloud.google.com/compute/docs/instance-groups/manager/#rollingbackupdate +func (r *RollingUpdatesService) Rollback(project string, zone string, rollingUpdate string) *RollingUpdatesRollbackCall { + c := &RollingUpdatesRollbackCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.rollingUpdate = rollingUpdate + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RollingUpdatesRollbackCall) Fields(s ...googleapi.Field) *RollingUpdatesRollbackCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RollingUpdatesRollbackCall) Context(ctx context.Context) *RollingUpdatesRollbackCall { + c.ctx_ = ctx + return c +} + +func (c *RollingUpdatesRollbackCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/rollback") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "rollingUpdate": c.rollingUpdate, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapoolupdater.rollingUpdates.rollback" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RollingUpdatesRollbackCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Rolls back the update in state from ROLLING_FORWARD or PAUSED. Has no effect if invoked when the state of the update is ROLLED_BACK.", + // "httpMethod": "POST", + // "id": "replicapoolupdater.rollingUpdates.rollback", + // "parameterOrder": [ + // "project", + // "zone", + // "rollingUpdate" + // ], + // "parameters": { + // "project": { + // "description": "The Google Developers Console 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" + // }, + // "rollingUpdate": { + // "description": "The name of the update.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone in which the update's target resides.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/rollback", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/replicapool" + // ] + // } + +} + +// method id "replicapoolupdater.zoneOperations.get": + +type ZoneOperationsGetCall struct { + s *Service + project string + zone string + operation string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneOperationsGetCall) Fields(s ...googleapi.Field) *ZoneOperationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ZoneOperationsGetCall) IfNoneMatch(entityTag string) *ZoneOperationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneOperationsGetCall) Context(ctx context.Context) *ZoneOperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapoolupdater.zoneOperations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ZoneOperationsGetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified zone-specific operation resource.", + // "httpMethod": "GET", + // "id": "replicapoolupdater.zoneOperations.get", + // "parameterOrder": [ + // "project", + // "zone", + // "operation" + // ], + // "parameters": { + // "operation": { + // "description": "Name of the operation resource to return.", + // "location": "path", + // "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", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/operations/{operation}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/replicapool" + // ] + // } + +} + +// method id "replicapoolupdater.zoneOperations.list": + +type ZoneOperationsListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneOperationsListCall) Fields(s ...googleapi.Field) *ZoneOperationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ZoneOperationsListCall) IfNoneMatch(entityTag string) *ZoneOperationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneOperationsListCall) Context(ctx context.Context) *ZoneOperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneOperationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "replicapoolupdater.zoneOperations.list" call. +// Exactly one of *OperationList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *OperationList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ZoneOperationsListCall) Do() (*OperationList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperationList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of Operation resources contained within the specified zone.", + // "httpMethod": "GET", + // "id": "replicapoolupdater.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", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/operations", + // "response": { + // "$ref": "OperationList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/replicapool" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/reseller/v1/reseller-api.json b/Godeps/_workspace/src/google.golang.org/api/reseller/v1/reseller-api.json new file mode 100644 index 000000000..ef4a1cd0b --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/reseller/v1/reseller-api.json @@ -0,0 +1,828 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/PnLFTM2U5cy1zCZ4AhS9GnZG4B0\"", + "discoveryVersion": "v1", + "id": "reseller:v1", + "name": "reseller", + "version": "v1", + "revision": "20150603", + "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" + }, + "licensedNumberOfSeats": { + "type": "integer", + "description": "Read-only field containing the current number of licensed seats for FLEXIBLE Google-Apps subscriptions and secondary subscriptions such as Google-Vault and Drive-storage.", + "format": "int32" + }, + "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": { + "billingMethod": { + "type": "string", + "description": "Billing method of this subscription." + }, + "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." + }, + "suspensionReasons": { + "type": "array", + "description": "Suspension Reasons", + "items": { + "type": "string" + } + }, + "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": { + "activate": { + "id": "reseller.subscriptions.activate", + "path": "customers/{customerId}/subscriptions/{subscriptionId}/activate", + "httpMethod": "POST", + "description": "Activates a subscription previously suspended by the reseller", + "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" + ] + }, + "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", + "transfer_to_direct" + ], + "enumDescriptions": [ + "Cancels the subscription immediately", + "Downgrades a Google Apps for Business subscription to Google Apps", + "Suspends the subscriptions for 4 days before cancelling it", + "Transfers a subscription directly to Google" + ], + "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" + ] + }, + "suspend": { + "id": "reseller.subscriptions.suspend", + "path": "customers/{customerId}/subscriptions/{subscriptionId}/suspend", + "httpMethod": "POST", + "description": "Suspends an active 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/Godeps/_workspace/src/google.golang.org/api/reseller/v1/reseller-gen.go b/Godeps/_workspace/src/google.golang.org/api/reseller/v1/reseller-gen.go new file mode 100644 index 000000000..054cfdcee --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/reseller/v1/reseller-gen.go @@ -0,0 +1,2347 @@ +// Package reseller provides access to the Enterprise Apps Reseller API. +// +// See https://developers.google.com/google-apps/reseller/ +// +// Usage example: +// +// import "google.golang.org/api/reseller/v1" +// ... +// resellerService, err := reseller.New(oauthHttpClient) +package reseller // import "google.golang.org/api/reseller/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Customers *CustomersService + + Subscriptions *SubscriptionsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 +} + +// Address: JSON template for address of a customer. +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"` + + // ForceSendFields is a list of field names (e.g. "AddressLine1") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Address) MarshalJSON() ([]byte, error) { + type noMethod Address + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChangePlanRequest: JSON template for the ChangePlan rpc request. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChangePlanRequest) MarshalJSON() ([]byte, error) { + type noMethod ChangePlanRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Customer: JSON template for a customer. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AlternateEmail") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Customer) MarshalJSON() ([]byte, error) { + type noMethod Customer + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RenewalSettings: JSON template for a subscription renewal settings. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RenewalSettings) MarshalJSON() ([]byte, error) { + type noMethod RenewalSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Seats: JSON template for subscription seats. +type Seats struct { + // Kind: Identifies the resource as a subscription change plan request. + Kind string `json:"kind,omitempty"` + + // LicensedNumberOfSeats: Read-only field containing the current number + // of licensed seats for FLEXIBLE Google-Apps subscriptions and + // secondary subscriptions such as Google-Vault and Drive-storage. + LicensedNumberOfSeats int64 `json:"licensedNumberOfSeats,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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Seats) MarshalJSON() ([]byte, error) { + type noMethod Seats + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Subscription: JSON template for a subscription. +type Subscription struct { + // BillingMethod: Billing method of this subscription. + BillingMethod string `json:"billingMethod,omitempty"` + + // 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"` + + // SuspensionReasons: Suspension Reasons + SuspensionReasons []string `json:"suspensionReasons,omitempty"` + + // TransferInfo: Transfer related information for the subscription. + TransferInfo *SubscriptionTransferInfo `json:"transferInfo,omitempty"` + + // TrialSettings: Trial Settings of the subscription. + TrialSettings *SubscriptionTrialSettings `json:"trialSettings,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BillingMethod") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Subscription) MarshalJSON() ([]byte, error) { + type noMethod Subscription + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SubscriptionPlan: Plan details of the subscription +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"` + + // ForceSendFields is a list of field names (e.g. "CommitmentInterval") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SubscriptionPlan) MarshalJSON() ([]byte, error) { + type noMethod SubscriptionPlan + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SubscriptionPlanCommitmentInterval: Interval of the commitment if it +// is a commitment plan. +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"` + + // ForceSendFields is a list of field names (e.g. "EndTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SubscriptionPlanCommitmentInterval) MarshalJSON() ([]byte, error) { + type noMethod SubscriptionPlanCommitmentInterval + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SubscriptionTransferInfo: Transfer related information for the +// subscription. +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"` + + // ForceSendFields is a list of field names (e.g. + // "MinimumTransferableSeats") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SubscriptionTransferInfo) MarshalJSON() ([]byte, error) { + type noMethod SubscriptionTransferInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SubscriptionTrialSettings: Trial Settings of the subscription. +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"` + + // ForceSendFields is a list of field names (e.g. "IsInTrial") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SubscriptionTrialSettings) MarshalJSON() ([]byte, error) { + type noMethod SubscriptionTrialSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Subscriptions: JSON template for a subscription list. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Subscriptions) MarshalJSON() ([]byte, error) { + type noMethod Subscriptions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "reseller.customers.get": + +type CustomersGetCall struct { + s *Service + customerId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomersGetCall) Fields(s ...googleapi.Field) *CustomersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CustomersGetCall) IfNoneMatch(entityTag string) *CustomersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomersGetCall) Context(ctx context.Context) *CustomersGetCall { + c.ctx_ = ctx + return c +} + +func (c *CustomersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.customers.get" call. +// Exactly one of *Customer or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Customer.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CustomersGetCall) Do() (*Customer, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Customer{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomersInsertCall) Fields(s ...googleapi.Field) *CustomersInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomersInsertCall) Context(ctx context.Context) *CustomersInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CustomersInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["customerAuthToken"]; ok { + params.Set("customerAuthToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.customers.insert" call. +// Exactly one of *Customer or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Customer.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CustomersInsertCall) Do() (*Customer, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Customer{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomersPatchCall) Fields(s ...googleapi.Field) *CustomersPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomersPatchCall) Context(ctx context.Context) *CustomersPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CustomersPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.customers.patch" call. +// Exactly one of *Customer or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Customer.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CustomersPatchCall) Do() (*Customer, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Customer{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomersUpdateCall) Fields(s ...googleapi.Field) *CustomersUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomersUpdateCall) Context(ctx context.Context) *CustomersUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CustomersUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.customers.update" call. +// Exactly one of *Customer or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Customer.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CustomersUpdateCall) Do() (*Customer, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Customer{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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.activate": + +type SubscriptionsActivateCall struct { + s *Service + customerId string + subscriptionId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Activate: Activates a subscription previously suspended by the +// reseller +func (r *SubscriptionsService) Activate(customerId string, subscriptionId string) *SubscriptionsActivateCall { + c := &SubscriptionsActivateCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.subscriptionId = subscriptionId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsActivateCall) Fields(s ...googleapi.Field) *SubscriptionsActivateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsActivateCall) Context(ctx context.Context) *SubscriptionsActivateCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsActivateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}/activate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "subscriptionId": c.subscriptionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.subscriptions.activate" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubscriptionsActivateCall) Do() (*Subscription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Activates a subscription previously suspended by the reseller", + // "httpMethod": "POST", + // "id": "reseller.subscriptions.activate", + // "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}/activate", + // "response": { + // "$ref": "Subscription" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsChangePlanCall) Fields(s ...googleapi.Field) *SubscriptionsChangePlanCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsChangePlanCall) Context(ctx context.Context) *SubscriptionsChangePlanCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsChangePlanCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}/changePlan") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "subscriptionId": c.subscriptionId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.subscriptions.changePlan" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubscriptionsChangePlanCall) Do() (*Subscription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsChangeRenewalSettingsCall) Fields(s ...googleapi.Field) *SubscriptionsChangeRenewalSettingsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsChangeRenewalSettingsCall) Context(ctx context.Context) *SubscriptionsChangeRenewalSettingsCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsChangeRenewalSettingsCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}/changeRenewalSettings") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "subscriptionId": c.subscriptionId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.subscriptions.changeRenewalSettings" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubscriptionsChangeRenewalSettingsCall) Do() (*Subscription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsChangeSeatsCall) Fields(s ...googleapi.Field) *SubscriptionsChangeSeatsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsChangeSeatsCall) Context(ctx context.Context) *SubscriptionsChangeSeatsCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsChangeSeatsCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}/changeSeats") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "subscriptionId": c.subscriptionId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.subscriptions.changeSeats" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubscriptionsChangeSeatsCall) Do() (*Subscription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsDeleteCall) Fields(s ...googleapi.Field) *SubscriptionsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsDeleteCall) Context(ctx context.Context) *SubscriptionsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("deletionType", fmt.Sprintf("%v", c.deletionType)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "subscriptionId": c.subscriptionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.subscriptions.delete" call. +func (c *SubscriptionsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Cancels/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", + // "transfer_to_direct" + // ], + // "enumDescriptions": [ + // "Cancels the subscription immediately", + // "Downgrades a Google Apps for Business subscription to Google Apps", + // "Suspends the subscriptions for 4 days before cancelling it", + // "Transfers a subscription directly to Google" + // ], + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsGetCall) Fields(s ...googleapi.Field) *SubscriptionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SubscriptionsGetCall) IfNoneMatch(entityTag string) *SubscriptionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsGetCall) Context(ctx context.Context) *SubscriptionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "subscriptionId": c.subscriptionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.subscriptions.get" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubscriptionsGetCall) Do() (*Subscription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsInsertCall) Fields(s ...googleapi.Field) *SubscriptionsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsInsertCall) Context(ctx context.Context) *SubscriptionsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["customerAuthToken"]; ok { + params.Set("customerAuthToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.subscriptions.insert" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubscriptionsInsertCall) Do() (*Subscription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsListCall) Fields(s ...googleapi.Field) *SubscriptionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SubscriptionsListCall) IfNoneMatch(entityTag string) *SubscriptionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsListCall) Context(ctx context.Context) *SubscriptionsListCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.subscriptions.list" call. +// Exactly one of *Subscriptions or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscriptions.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SubscriptionsListCall) Do() (*Subscriptions, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscriptions{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsStartPaidServiceCall) Fields(s ...googleapi.Field) *SubscriptionsStartPaidServiceCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsStartPaidServiceCall) Context(ctx context.Context) *SubscriptionsStartPaidServiceCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsStartPaidServiceCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}/startPaidService") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "subscriptionId": c.subscriptionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.subscriptions.startPaidService" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubscriptionsStartPaidServiceCall) Do() (*Subscription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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" + // ] + // } + +} + +// method id "reseller.subscriptions.suspend": + +type SubscriptionsSuspendCall struct { + s *Service + customerId string + subscriptionId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Suspend: Suspends an active subscription +func (r *SubscriptionsService) Suspend(customerId string, subscriptionId string) *SubscriptionsSuspendCall { + c := &SubscriptionsSuspendCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.subscriptionId = subscriptionId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsSuspendCall) Fields(s ...googleapi.Field) *SubscriptionsSuspendCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsSuspendCall) Context(ctx context.Context) *SubscriptionsSuspendCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsSuspendCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}/suspend") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "subscriptionId": c.subscriptionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.subscriptions.suspend" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubscriptionsSuspendCall) Do() (*Subscription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Suspends an active subscription", + // "httpMethod": "POST", + // "id": "reseller.subscriptions.suspend", + // "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}/suspend", + // "response": { + // "$ref": "Subscription" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.order" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/reseller/v1sandbox/reseller-api.json b/Godeps/_workspace/src/google.golang.org/api/reseller/v1sandbox/reseller-api.json new file mode 100644 index 000000000..921fa1186 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/reseller/v1sandbox/reseller-api.json @@ -0,0 +1,828 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/Cbmd7CRXSYNWgkRD3A5YJaaBrgY\"", + "discoveryVersion": "v1", + "id": "reseller:v1sandbox", + "name": "reseller", + "version": "v1sandbox", + "revision": "20150603", + "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" + }, + "licensedNumberOfSeats": { + "type": "integer", + "description": "Read-only field containing the current number of licensed seats for FLEXIBLE Google-Apps subscriptions and secondary subscriptions such as Google-Vault and Drive-storage.", + "format": "int32" + }, + "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": { + "billingMethod": { + "type": "string", + "description": "Billing method of this subscription." + }, + "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." + }, + "suspensionReasons": { + "type": "array", + "description": "Suspension Reasons", + "items": { + "type": "string" + } + }, + "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": { + "activate": { + "id": "reseller.subscriptions.activate", + "path": "customers/{customerId}/subscriptions/{subscriptionId}/activate", + "httpMethod": "POST", + "description": "Activates a subscription previously suspended by the reseller", + "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" + ] + }, + "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", + "transfer_to_direct" + ], + "enumDescriptions": [ + "Cancels the subscription immediately", + "Downgrades a Google Apps for Business subscription to Google Apps", + "Suspends the subscriptions for 4 days before cancelling it", + "Transfers a subscription directly to Google" + ], + "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" + ] + }, + "suspend": { + "id": "reseller.subscriptions.suspend", + "path": "customers/{customerId}/subscriptions/{subscriptionId}/suspend", + "httpMethod": "POST", + "description": "Suspends an active 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/Godeps/_workspace/src/google.golang.org/api/reseller/v1sandbox/reseller-gen.go b/Godeps/_workspace/src/google.golang.org/api/reseller/v1sandbox/reseller-gen.go new file mode 100644 index 000000000..cf3ac85b9 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/reseller/v1sandbox/reseller-gen.go @@ -0,0 +1,2347 @@ +// Package reseller provides access to the Enterprise Apps Reseller API. +// +// See https://developers.google.com/google-apps/reseller/ +// +// Usage example: +// +// import "google.golang.org/api/reseller/v1sandbox" +// ... +// resellerService, err := reseller.New(oauthHttpClient) +package reseller // import "google.golang.org/api/reseller/v1sandbox" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Customers *CustomersService + + Subscriptions *SubscriptionsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 +} + +// Address: JSON template for address of a customer. +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"` + + // ForceSendFields is a list of field names (e.g. "AddressLine1") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Address) MarshalJSON() ([]byte, error) { + type noMethod Address + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChangePlanRequest: JSON template for the ChangePlan rpc request. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChangePlanRequest) MarshalJSON() ([]byte, error) { + type noMethod ChangePlanRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Customer: JSON template for a customer. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AlternateEmail") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Customer) MarshalJSON() ([]byte, error) { + type noMethod Customer + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RenewalSettings: JSON template for a subscription renewal settings. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RenewalSettings) MarshalJSON() ([]byte, error) { + type noMethod RenewalSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Seats: JSON template for subscription seats. +type Seats struct { + // Kind: Identifies the resource as a subscription change plan request. + Kind string `json:"kind,omitempty"` + + // LicensedNumberOfSeats: Read-only field containing the current number + // of licensed seats for FLEXIBLE Google-Apps subscriptions and + // secondary subscriptions such as Google-Vault and Drive-storage. + LicensedNumberOfSeats int64 `json:"licensedNumberOfSeats,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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Seats) MarshalJSON() ([]byte, error) { + type noMethod Seats + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Subscription: JSON template for a subscription. +type Subscription struct { + // BillingMethod: Billing method of this subscription. + BillingMethod string `json:"billingMethod,omitempty"` + + // 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"` + + // SuspensionReasons: Suspension Reasons + SuspensionReasons []string `json:"suspensionReasons,omitempty"` + + // TransferInfo: Transfer related information for the subscription. + TransferInfo *SubscriptionTransferInfo `json:"transferInfo,omitempty"` + + // TrialSettings: Trial Settings of the subscription. + TrialSettings *SubscriptionTrialSettings `json:"trialSettings,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BillingMethod") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Subscription) MarshalJSON() ([]byte, error) { + type noMethod Subscription + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SubscriptionPlan: Plan details of the subscription +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"` + + // ForceSendFields is a list of field names (e.g. "CommitmentInterval") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SubscriptionPlan) MarshalJSON() ([]byte, error) { + type noMethod SubscriptionPlan + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SubscriptionPlanCommitmentInterval: Interval of the commitment if it +// is a commitment plan. +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"` + + // ForceSendFields is a list of field names (e.g. "EndTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SubscriptionPlanCommitmentInterval) MarshalJSON() ([]byte, error) { + type noMethod SubscriptionPlanCommitmentInterval + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SubscriptionTransferInfo: Transfer related information for the +// subscription. +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"` + + // ForceSendFields is a list of field names (e.g. + // "MinimumTransferableSeats") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SubscriptionTransferInfo) MarshalJSON() ([]byte, error) { + type noMethod SubscriptionTransferInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SubscriptionTrialSettings: Trial Settings of the subscription. +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"` + + // ForceSendFields is a list of field names (e.g. "IsInTrial") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SubscriptionTrialSettings) MarshalJSON() ([]byte, error) { + type noMethod SubscriptionTrialSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Subscriptions: JSON template for a subscription list. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Subscriptions) MarshalJSON() ([]byte, error) { + type noMethod Subscriptions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "reseller.customers.get": + +type CustomersGetCall struct { + s *Service + customerId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomersGetCall) Fields(s ...googleapi.Field) *CustomersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *CustomersGetCall) IfNoneMatch(entityTag string) *CustomersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomersGetCall) Context(ctx context.Context) *CustomersGetCall { + c.ctx_ = ctx + return c +} + +func (c *CustomersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.customers.get" call. +// Exactly one of *Customer or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Customer.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CustomersGetCall) Do() (*Customer, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Customer{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomersInsertCall) Fields(s ...googleapi.Field) *CustomersInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomersInsertCall) Context(ctx context.Context) *CustomersInsertCall { + c.ctx_ = ctx + return c +} + +func (c *CustomersInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["customerAuthToken"]; ok { + params.Set("customerAuthToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.customers.insert" call. +// Exactly one of *Customer or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Customer.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CustomersInsertCall) Do() (*Customer, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Customer{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomersPatchCall) Fields(s ...googleapi.Field) *CustomersPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomersPatchCall) Context(ctx context.Context) *CustomersPatchCall { + c.ctx_ = ctx + return c +} + +func (c *CustomersPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.customers.patch" call. +// Exactly one of *Customer or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Customer.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CustomersPatchCall) Do() (*Customer, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Customer{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *CustomersUpdateCall) Fields(s ...googleapi.Field) *CustomersUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *CustomersUpdateCall) Context(ctx context.Context) *CustomersUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *CustomersUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.customers.update" call. +// Exactly one of *Customer or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Customer.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *CustomersUpdateCall) Do() (*Customer, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Customer{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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.activate": + +type SubscriptionsActivateCall struct { + s *Service + customerId string + subscriptionId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Activate: Activates a subscription previously suspended by the +// reseller +func (r *SubscriptionsService) Activate(customerId string, subscriptionId string) *SubscriptionsActivateCall { + c := &SubscriptionsActivateCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.subscriptionId = subscriptionId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsActivateCall) Fields(s ...googleapi.Field) *SubscriptionsActivateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsActivateCall) Context(ctx context.Context) *SubscriptionsActivateCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsActivateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}/activate") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "subscriptionId": c.subscriptionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.subscriptions.activate" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubscriptionsActivateCall) Do() (*Subscription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Activates a subscription previously suspended by the reseller", + // "httpMethod": "POST", + // "id": "reseller.subscriptions.activate", + // "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}/activate", + // "response": { + // "$ref": "Subscription" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsChangePlanCall) Fields(s ...googleapi.Field) *SubscriptionsChangePlanCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsChangePlanCall) Context(ctx context.Context) *SubscriptionsChangePlanCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsChangePlanCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}/changePlan") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "subscriptionId": c.subscriptionId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.subscriptions.changePlan" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubscriptionsChangePlanCall) Do() (*Subscription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsChangeRenewalSettingsCall) Fields(s ...googleapi.Field) *SubscriptionsChangeRenewalSettingsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsChangeRenewalSettingsCall) Context(ctx context.Context) *SubscriptionsChangeRenewalSettingsCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsChangeRenewalSettingsCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}/changeRenewalSettings") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "subscriptionId": c.subscriptionId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.subscriptions.changeRenewalSettings" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubscriptionsChangeRenewalSettingsCall) Do() (*Subscription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsChangeSeatsCall) Fields(s ...googleapi.Field) *SubscriptionsChangeSeatsCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsChangeSeatsCall) Context(ctx context.Context) *SubscriptionsChangeSeatsCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsChangeSeatsCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}/changeSeats") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "subscriptionId": c.subscriptionId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.subscriptions.changeSeats" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubscriptionsChangeSeatsCall) Do() (*Subscription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsDeleteCall) Fields(s ...googleapi.Field) *SubscriptionsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsDeleteCall) Context(ctx context.Context) *SubscriptionsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("deletionType", fmt.Sprintf("%v", c.deletionType)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "subscriptionId": c.subscriptionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.subscriptions.delete" call. +func (c *SubscriptionsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Cancels/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", + // "transfer_to_direct" + // ], + // "enumDescriptions": [ + // "Cancels the subscription immediately", + // "Downgrades a Google Apps for Business subscription to Google Apps", + // "Suspends the subscriptions for 4 days before cancelling it", + // "Transfers a subscription directly to Google" + // ], + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsGetCall) Fields(s ...googleapi.Field) *SubscriptionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SubscriptionsGetCall) IfNoneMatch(entityTag string) *SubscriptionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsGetCall) Context(ctx context.Context) *SubscriptionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "subscriptionId": c.subscriptionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.subscriptions.get" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubscriptionsGetCall) Do() (*Subscription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsInsertCall) Fields(s ...googleapi.Field) *SubscriptionsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsInsertCall) Context(ctx context.Context) *SubscriptionsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["customerAuthToken"]; ok { + params.Set("customerAuthToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.subscriptions.insert" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubscriptionsInsertCall) Do() (*Subscription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsListCall) Fields(s ...googleapi.Field) *SubscriptionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SubscriptionsListCall) IfNoneMatch(entityTag string) *SubscriptionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsListCall) Context(ctx context.Context) *SubscriptionsListCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.subscriptions.list" call. +// Exactly one of *Subscriptions or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscriptions.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SubscriptionsListCall) Do() (*Subscriptions, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscriptions{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsStartPaidServiceCall) Fields(s ...googleapi.Field) *SubscriptionsStartPaidServiceCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsStartPaidServiceCall) Context(ctx context.Context) *SubscriptionsStartPaidServiceCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsStartPaidServiceCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}/startPaidService") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "subscriptionId": c.subscriptionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.subscriptions.startPaidService" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubscriptionsStartPaidServiceCall) Do() (*Subscription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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" + // ] + // } + +} + +// method id "reseller.subscriptions.suspend": + +type SubscriptionsSuspendCall struct { + s *Service + customerId string + subscriptionId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Suspend: Suspends an active subscription +func (r *SubscriptionsService) Suspend(customerId string, subscriptionId string) *SubscriptionsSuspendCall { + c := &SubscriptionsSuspendCall{s: r.s, opt_: make(map[string]interface{})} + c.customerId = customerId + c.subscriptionId = subscriptionId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SubscriptionsSuspendCall) Fields(s ...googleapi.Field) *SubscriptionsSuspendCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SubscriptionsSuspendCall) Context(ctx context.Context) *SubscriptionsSuspendCall { + c.ctx_ = ctx + return c +} + +func (c *SubscriptionsSuspendCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}/suspend") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "customerId": c.customerId, + "subscriptionId": c.subscriptionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "reseller.subscriptions.suspend" call. +// Exactly one of *Subscription or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Subscription.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SubscriptionsSuspendCall) Do() (*Subscription, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Subscription{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Suspends an active subscription", + // "httpMethod": "POST", + // "id": "reseller.subscriptions.suspend", + // "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}/suspend", + // "response": { + // "$ref": "Subscription" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/apps.order" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/resourceviews/v1beta1/resourceviews-api.json b/Godeps/_workspace/src/google.golang.org/api/resourceviews/v1beta1/resourceviews-api.json new file mode 100644 index 000000000..81ae0151f --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/resourceviews/v1beta1/resourceviews-api.json @@ -0,0 +1,920 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/zGXHhFNf_BjX91GfOIqcxzMz9hQ\"", + "discoveryVersion": "v1", + "id": "resourceviews:v1beta1", + "name": "resourceviews", + "version": "v1beta1", + "revision": "20150708", + "title": "Resource Views API", + "description": "The Resource View API allows users to create and manage logical sets of Google Compute Engine instances.", + "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/compute/", + "labels": [ + "limited_availability" + ], + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/resourceviews/v1beta1/projects/", + "basePath": "/resourceviews/v1beta1/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "resourceviews/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/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" + }, + "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/ndev.cloudman": { + "description": "View and manage your Google Cloud Platform management resources and deployment status information" + }, + "https://www.googleapis.com/auth/ndev.cloudman.readonly": { + "description": "View your Google Cloud Platform management resources and deployment status information" + } + } + } + }, + "schemas": { + "Label": { + "id": "Label", + "type": "object", + "description": "The Label to be applied to the resource views.", + "properties": { + "key": { + "type": "string", + "description": "Key of the label." + }, + "value": { + "type": "string", + "description": "Value of the label." + } + } + }, + "RegionViewsAddResourcesRequest": { + "id": "RegionViewsAddResourcesRequest", + "type": "object", + "description": "The request to add resources to the resource view.", + "properties": { + "resources": { + "type": "array", + "description": "The list of resources to be added.", + "items": { + "type": "string" + } + } + } + }, + "RegionViewsInsertResponse": { + "id": "RegionViewsInsertResponse", + "type": "object", + "description": "The response to a resource view insert request.", + "properties": { + "resource": { + "$ref": "ResourceView", + "description": "The resource view object inserted." + } + } + }, + "RegionViewsListResourcesResponse": { + "id": "RegionViewsListResourcesResponse", + "type": "object", + "description": "The response to the list resource request.", + "properties": { + "members": { + "type": "array", + "description": "The resources in the view.", + "items": { + "type": "string" + } + }, + "nextPageToken": { + "type": "string", + "description": "A token used for pagination." + } + } + }, + "RegionViewsListResponse": { + "id": "RegionViewsListResponse", + "type": "object", + "description": "The response to the list resource view request.", + "properties": { + "nextPageToken": { + "type": "string", + "description": "A token used for pagination." + }, + "resourceViews": { + "type": "array", + "description": "The list of resource views that meet the criteria.", + "items": { + "$ref": "ResourceView" + } + } + } + }, + "RegionViewsRemoveResourcesRequest": { + "id": "RegionViewsRemoveResourcesRequest", + "type": "object", + "description": "The request to remove resources from the resource view.", + "properties": { + "resources": { + "type": "array", + "description": "The list of resources to be removed.", + "items": { + "type": "string" + } + } + } + }, + "ResourceView": { + "id": "ResourceView", + "type": "object", + "description": "The resource view object.", + "properties": { + "creationTime": { + "type": "string", + "description": "The creation time of the resource view." + }, + "description": { + "type": "string", + "description": "The detailed description of the resource view." + }, + "id": { + "type": "string", + "description": "[Output Only] The ID of the resource view." + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "resourceviews#resourceView" + }, + "labels": { + "type": "array", + "description": "The labels for events.", + "items": { + "$ref": "Label" + } + }, + "lastModified": { + "type": "string", + "description": "The last modified time of the view. Not supported yet." + }, + "members": { + "type": "array", + "description": "A list of all resources in the resource view.", + "items": { + "type": "string" + } + }, + "name": { + "type": "string", + "description": "The name of the resource view." + }, + "numMembers": { + "type": "integer", + "description": "The total number of resources in the resource view.", + "format": "uint32" + }, + "selfLink": { + "type": "string", + "description": "[Output Only] A self-link to the resource view." + } + } + }, + "ZoneViewsAddResourcesRequest": { + "id": "ZoneViewsAddResourcesRequest", + "type": "object", + "description": "The request to add resources to the resource view.", + "properties": { + "resources": { + "type": "array", + "description": "The list of resources to be added.", + "items": { + "type": "string" + } + } + } + }, + "ZoneViewsInsertResponse": { + "id": "ZoneViewsInsertResponse", + "type": "object", + "description": "The response to an insert request.", + "properties": { + "resource": { + "$ref": "ResourceView", + "description": "The resource view object that has been inserted." + } + } + }, + "ZoneViewsListResourcesResponse": { + "id": "ZoneViewsListResourcesResponse", + "type": "object", + "description": "The response to a list resource request.", + "properties": { + "members": { + "type": "array", + "description": "The full URL of resources in the view.", + "items": { + "type": "string" + } + }, + "nextPageToken": { + "type": "string", + "description": "A token used for pagination." + } + } + }, + "ZoneViewsListResponse": { + "id": "ZoneViewsListResponse", + "type": "object", + "description": "The response to a list request.", + "properties": { + "nextPageToken": { + "type": "string", + "description": "A token used for pagination." + }, + "resourceViews": { + "type": "array", + "description": "The result that contains all resource views that meet the criteria.", + "items": { + "$ref": "ResourceView" + } + } + } + }, + "ZoneViewsRemoveResourcesRequest": { + "id": "ZoneViewsRemoveResourcesRequest", + "type": "object", + "description": "The request to remove resources from the resource view.", + "properties": { + "resources": { + "type": "array", + "description": "The list of resources to be removed.", + "items": { + "type": "string" + } + } + } + } + }, + "resources": { + "regionViews": { + "methods": { + "addresources": { + "id": "resourceviews.regionViews.addresources", + "path": "{projectName}/regions/{region}/resourceViews/{resourceViewName}/addResources", + "httpMethod": "POST", + "description": "Add resources to the view.", + "parameters": { + "projectName": { + "type": "string", + "description": "The project name of the resource view.", + "required": true, + "location": "path" + }, + "region": { + "type": "string", + "description": "The region name of the resource view.", + "required": true, + "location": "path" + }, + "resourceViewName": { + "type": "string", + "description": "The name of the resource view.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectName", + "region", + "resourceViewName" + ], + "request": { + "$ref": "RegionViewsAddResourcesRequest" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "delete": { + "id": "resourceviews.regionViews.delete", + "path": "{projectName}/regions/{region}/resourceViews/{resourceViewName}", + "httpMethod": "DELETE", + "description": "Delete a resource view.", + "parameters": { + "projectName": { + "type": "string", + "description": "The project name of the resource view.", + "required": true, + "location": "path" + }, + "region": { + "type": "string", + "description": "The region name of the resource view.", + "required": true, + "location": "path" + }, + "resourceViewName": { + "type": "string", + "description": "The name of the resource view.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectName", + "region", + "resourceViewName" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "get": { + "id": "resourceviews.regionViews.get", + "path": "{projectName}/regions/{region}/resourceViews/{resourceViewName}", + "httpMethod": "GET", + "description": "Get the information of a resource view.", + "parameters": { + "projectName": { + "type": "string", + "description": "The project name of the resource view.", + "required": true, + "location": "path" + }, + "region": { + "type": "string", + "description": "The region name of the resource view.", + "required": true, + "location": "path" + }, + "resourceViewName": { + "type": "string", + "description": "The name of the resource view.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectName", + "region", + "resourceViewName" + ], + "response": { + "$ref": "ResourceView" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "insert": { + "id": "resourceviews.regionViews.insert", + "path": "{projectName}/regions/{region}/resourceViews", + "httpMethod": "POST", + "description": "Create a resource view.", + "parameters": { + "projectName": { + "type": "string", + "description": "The project name of the resource view.", + "required": true, + "location": "path" + }, + "region": { + "type": "string", + "description": "The region name of the resource view.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectName", + "region" + ], + "request": { + "$ref": "ResourceView" + }, + "response": { + "$ref": "RegionViewsInsertResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "list": { + "id": "resourceviews.regionViews.list", + "path": "{projectName}/regions/{region}/resourceViews", + "httpMethod": "GET", + "description": "List resource views.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000)", + "default": "5000", + "format": "int32", + "minimum": "0", + "maximum": "5000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request.", + "location": "query" + }, + "projectName": { + "type": "string", + "description": "The project name of the resource view.", + "required": true, + "location": "path" + }, + "region": { + "type": "string", + "description": "The region name of the resource view.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectName", + "region" + ], + "response": { + "$ref": "RegionViewsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "listresources": { + "id": "resourceviews.regionViews.listresources", + "path": "{projectName}/regions/{region}/resourceViews/{resourceViewName}/resources", + "httpMethod": "POST", + "description": "List the resources in the view.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000)", + "default": "5000", + "format": "int32", + "minimum": "0", + "maximum": "5000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request.", + "location": "query" + }, + "projectName": { + "type": "string", + "description": "The project name of the resource view.", + "required": true, + "location": "path" + }, + "region": { + "type": "string", + "description": "The region name of the resource view.", + "required": true, + "location": "path" + }, + "resourceViewName": { + "type": "string", + "description": "The name of the resource view.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectName", + "region", + "resourceViewName" + ], + "response": { + "$ref": "RegionViewsListResourcesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "removeresources": { + "id": "resourceviews.regionViews.removeresources", + "path": "{projectName}/regions/{region}/resourceViews/{resourceViewName}/removeResources", + "httpMethod": "POST", + "description": "Remove resources from the view.", + "parameters": { + "projectName": { + "type": "string", + "description": "The project name of the resource view.", + "required": true, + "location": "path" + }, + "region": { + "type": "string", + "description": "The region name of the resource view.", + "required": true, + "location": "path" + }, + "resourceViewName": { + "type": "string", + "description": "The name of the resource view.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectName", + "region", + "resourceViewName" + ], + "request": { + "$ref": "RegionViewsRemoveResourcesRequest" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + } + } + }, + "zoneViews": { + "methods": { + "addresources": { + "id": "resourceviews.zoneViews.addresources", + "path": "{projectName}/zones/{zone}/resourceViews/{resourceViewName}/addResources", + "httpMethod": "POST", + "description": "Add resources to the view.", + "parameters": { + "projectName": { + "type": "string", + "description": "The project name of the resource view.", + "required": true, + "location": "path" + }, + "resourceViewName": { + "type": "string", + "description": "The name of the resource view.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The zone name of the resource view.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectName", + "zone", + "resourceViewName" + ], + "request": { + "$ref": "ZoneViewsAddResourcesRequest" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "delete": { + "id": "resourceviews.zoneViews.delete", + "path": "{projectName}/zones/{zone}/resourceViews/{resourceViewName}", + "httpMethod": "DELETE", + "description": "Delete a resource view.", + "parameters": { + "projectName": { + "type": "string", + "description": "The project name of the resource view.", + "required": true, + "location": "path" + }, + "resourceViewName": { + "type": "string", + "description": "The name of the resource view.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The zone name of the resource view.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectName", + "zone", + "resourceViewName" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "get": { + "id": "resourceviews.zoneViews.get", + "path": "{projectName}/zones/{zone}/resourceViews/{resourceViewName}", + "httpMethod": "GET", + "description": "Get the information of a zonal resource view.", + "parameters": { + "projectName": { + "type": "string", + "description": "The project name of the resource view.", + "required": true, + "location": "path" + }, + "resourceViewName": { + "type": "string", + "description": "The name of the resource view.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The zone name of the resource view.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectName", + "zone", + "resourceViewName" + ], + "response": { + "$ref": "ResourceView" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "insert": { + "id": "resourceviews.zoneViews.insert", + "path": "{projectName}/zones/{zone}/resourceViews", + "httpMethod": "POST", + "description": "Create a resource view.", + "parameters": { + "projectName": { + "type": "string", + "description": "The project name of the resource view.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The zone name of the resource view.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectName", + "zone" + ], + "request": { + "$ref": "ResourceView" + }, + "response": { + "$ref": "ZoneViewsInsertResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "list": { + "id": "resourceviews.zoneViews.list", + "path": "{projectName}/zones/{zone}/resourceViews", + "httpMethod": "GET", + "description": "List resource views.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000)", + "default": "5000", + "format": "int32", + "minimum": "0", + "maximum": "5000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request.", + "location": "query" + }, + "projectName": { + "type": "string", + "description": "The project name of the resource view.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The zone name of the resource view.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectName", + "zone" + ], + "response": { + "$ref": "ZoneViewsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "listresources": { + "id": "resourceviews.zoneViews.listresources", + "path": "{projectName}/zones/{zone}/resourceViews/{resourceViewName}/resources", + "httpMethod": "POST", + "description": "List the resources of the resource view.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000)", + "default": "5000", + "format": "int32", + "minimum": "0", + "maximum": "5000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request.", + "location": "query" + }, + "projectName": { + "type": "string", + "description": "The project name of the resource view.", + "required": true, + "location": "path" + }, + "resourceViewName": { + "type": "string", + "description": "The name of the resource view.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The zone name of the resource view.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectName", + "zone", + "resourceViewName" + ], + "response": { + "$ref": "ZoneViewsListResourcesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "removeresources": { + "id": "resourceviews.zoneViews.removeresources", + "path": "{projectName}/zones/{zone}/resourceViews/{resourceViewName}/removeResources", + "httpMethod": "POST", + "description": "Remove resources from the view.", + "parameters": { + "projectName": { + "type": "string", + "description": "The project name of the resource view.", + "required": true, + "location": "path" + }, + "resourceViewName": { + "type": "string", + "description": "The name of the resource view.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The zone name of the resource view.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectName", + "zone", + "resourceViewName" + ], + "request": { + "$ref": "ZoneViewsRemoveResourcesRequest" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/resourceviews/v1beta1/resourceviews-gen.go b/Godeps/_workspace/src/google.golang.org/api/resourceviews/v1beta1/resourceviews-gen.go new file mode 100644 index 000000000..7341b0967 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/resourceviews/v1beta1/resourceviews-gen.go @@ -0,0 +1,2405 @@ +// Package resourceviews provides access to the Resource Views API. +// +// See https://developers.google.com/compute/ +// +// Usage example: +// +// import "google.golang.org/api/resourceviews/v1beta1" +// ... +// resourceviewsService, err := resourceviews.New(oauthHttpClient) +package resourceviews // import "google.golang.org/api/resourceviews/v1beta1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "resourceviews:v1beta1" +const apiName = "resourceviews" +const apiVersion = "v1beta1" +const basePath = "https://www.googleapis.com/resourceviews/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 data across Google Cloud Platform services + CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" + + // 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 and manage your Google Cloud Platform management resources and + // deployment status information + NdevCloudmanScope = "https://www.googleapis.com/auth/ndev.cloudman" + + // View your Google Cloud Platform management resources and deployment + // status information + NdevCloudmanReadonlyScope = "https://www.googleapis.com/auth/ndev.cloudman.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.RegionViews = NewRegionViewsService(s) + s.ZoneViews = NewZoneViewsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + RegionViews *RegionViewsService + + ZoneViews *ZoneViewsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewRegionViewsService(s *Service) *RegionViewsService { + rs := &RegionViewsService{s: s} + return rs +} + +type RegionViewsService struct { + s *Service +} + +func NewZoneViewsService(s *Service) *ZoneViewsService { + rs := &ZoneViewsService{s: s} + return rs +} + +type ZoneViewsService struct { + s *Service +} + +// Label: The Label to be applied to the resource views. +type Label struct { + // Key: Key of the label. + Key string `json:"key,omitempty"` + + // Value: Value of the label. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Label) MarshalJSON() ([]byte, error) { + type noMethod Label + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RegionViewsAddResourcesRequest: The request to add resources to the +// resource view. +type RegionViewsAddResourcesRequest struct { + // Resources: The list of resources to be added. + Resources []string `json:"resources,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Resources") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RegionViewsAddResourcesRequest) MarshalJSON() ([]byte, error) { + type noMethod RegionViewsAddResourcesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RegionViewsInsertResponse: The response to a resource view insert +// request. +type RegionViewsInsertResponse struct { + // Resource: The resource view object inserted. + Resource *ResourceView `json:"resource,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Resource") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RegionViewsInsertResponse) MarshalJSON() ([]byte, error) { + type noMethod RegionViewsInsertResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RegionViewsListResourcesResponse: The response to the list resource +// request. +type RegionViewsListResourcesResponse struct { + // Members: The resources in the view. + Members []string `json:"members,omitempty"` + + // NextPageToken: A token used for pagination. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Members") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RegionViewsListResourcesResponse) MarshalJSON() ([]byte, error) { + type noMethod RegionViewsListResourcesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RegionViewsListResponse: The response to the list resource view +// request. +type RegionViewsListResponse struct { + // NextPageToken: A token used for pagination. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ResourceViews: The list of resource views that meet the criteria. + ResourceViews []*ResourceView `json:"resourceViews,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RegionViewsListResponse) MarshalJSON() ([]byte, error) { + type noMethod RegionViewsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RegionViewsRemoveResourcesRequest: The request to remove resources +// from the resource view. +type RegionViewsRemoveResourcesRequest struct { + // Resources: The list of resources to be removed. + Resources []string `json:"resources,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Resources") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RegionViewsRemoveResourcesRequest) MarshalJSON() ([]byte, error) { + type noMethod RegionViewsRemoveResourcesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ResourceView: The resource view object. +type ResourceView struct { + // CreationTime: The creation time of the resource view. + CreationTime string `json:"creationTime,omitempty"` + + // Description: The detailed description of the resource view. + Description string `json:"description,omitempty"` + + // Id: [Output Only] The ID of the resource view. + Id string `json:"id,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Labels: The labels for events. + Labels []*Label `json:"labels,omitempty"` + + // LastModified: The last modified time of the view. Not supported yet. + LastModified string `json:"lastModified,omitempty"` + + // Members: A list of all resources in the resource view. + Members []string `json:"members,omitempty"` + + // Name: The name of the resource view. + Name string `json:"name,omitempty"` + + // NumMembers: The total number of resources in the resource view. + NumMembers int64 `json:"numMembers,omitempty"` + + // SelfLink: [Output Only] A self-link to the resource view. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResourceView) MarshalJSON() ([]byte, error) { + type noMethod ResourceView + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ZoneViewsAddResourcesRequest: The request to add resources to the +// resource view. +type ZoneViewsAddResourcesRequest struct { + // Resources: The list of resources to be added. + Resources []string `json:"resources,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Resources") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ZoneViewsAddResourcesRequest) MarshalJSON() ([]byte, error) { + type noMethod ZoneViewsAddResourcesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ZoneViewsInsertResponse: The response to an insert request. +type ZoneViewsInsertResponse struct { + // Resource: The resource view object that has been inserted. + Resource *ResourceView `json:"resource,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Resource") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ZoneViewsInsertResponse) MarshalJSON() ([]byte, error) { + type noMethod ZoneViewsInsertResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ZoneViewsListResourcesResponse: The response to a list resource +// request. +type ZoneViewsListResourcesResponse struct { + // Members: The full URL of resources in the view. + Members []string `json:"members,omitempty"` + + // NextPageToken: A token used for pagination. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Members") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ZoneViewsListResourcesResponse) MarshalJSON() ([]byte, error) { + type noMethod ZoneViewsListResourcesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ZoneViewsListResponse: The response to a list request. +type ZoneViewsListResponse struct { + // NextPageToken: A token used for pagination. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ResourceViews: The result that contains all resource views that meet + // the criteria. + ResourceViews []*ResourceView `json:"resourceViews,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ZoneViewsListResponse) MarshalJSON() ([]byte, error) { + type noMethod ZoneViewsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ZoneViewsRemoveResourcesRequest: The request to remove resources from +// the resource view. +type ZoneViewsRemoveResourcesRequest struct { + // Resources: The list of resources to be removed. + Resources []string `json:"resources,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Resources") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ZoneViewsRemoveResourcesRequest) MarshalJSON() ([]byte, error) { + type noMethod ZoneViewsRemoveResourcesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "resourceviews.regionViews.addresources": + +type RegionViewsAddresourcesCall struct { + s *Service + projectName string + region string + resourceViewName string + regionviewsaddresourcesrequest *RegionViewsAddResourcesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Addresources: Add resources to the view. +func (r *RegionViewsService) Addresources(projectName string, region string, resourceViewName string, regionviewsaddresourcesrequest *RegionViewsAddResourcesRequest) *RegionViewsAddresourcesCall { + c := &RegionViewsAddresourcesCall{s: r.s, opt_: make(map[string]interface{})} + c.projectName = projectName + c.region = region + c.resourceViewName = resourceViewName + c.regionviewsaddresourcesrequest = regionviewsaddresourcesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionViewsAddresourcesCall) Fields(s ...googleapi.Field) *RegionViewsAddresourcesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RegionViewsAddresourcesCall) Context(ctx context.Context) *RegionViewsAddresourcesCall { + c.ctx_ = ctx + return c +} + +func (c *RegionViewsAddresourcesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionviewsaddresourcesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/regions/{region}/resourceViews/{resourceViewName}/addResources") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectName": c.projectName, + "region": c.region, + "resourceViewName": c.resourceViewName, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "resourceviews.regionViews.addresources" call. +func (c *RegionViewsAddresourcesCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Add resources to the view.", + // "httpMethod": "POST", + // "id": "resourceviews.regionViews.addresources", + // "parameterOrder": [ + // "projectName", + // "region", + // "resourceViewName" + // ], + // "parameters": { + // "projectName": { + // "description": "The project name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "The region name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "resourceViewName": { + // "description": "The name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectName}/regions/{region}/resourceViews/{resourceViewName}/addResources", + // "request": { + // "$ref": "RegionViewsAddResourcesRequest" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/ndev.cloudman" + // ] + // } + +} + +// method id "resourceviews.regionViews.delete": + +type RegionViewsDeleteCall struct { + s *Service + projectName string + region string + resourceViewName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Delete a resource view. +func (r *RegionViewsService) Delete(projectName string, region string, resourceViewName string) *RegionViewsDeleteCall { + c := &RegionViewsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.projectName = projectName + c.region = region + c.resourceViewName = resourceViewName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionViewsDeleteCall) Fields(s ...googleapi.Field) *RegionViewsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RegionViewsDeleteCall) Context(ctx context.Context) *RegionViewsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *RegionViewsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/regions/{region}/resourceViews/{resourceViewName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectName": c.projectName, + "region": c.region, + "resourceViewName": c.resourceViewName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "resourceviews.regionViews.delete" call. +func (c *RegionViewsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a resource view.", + // "httpMethod": "DELETE", + // "id": "resourceviews.regionViews.delete", + // "parameterOrder": [ + // "projectName", + // "region", + // "resourceViewName" + // ], + // "parameters": { + // "projectName": { + // "description": "The project name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "The region name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "resourceViewName": { + // "description": "The name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectName}/regions/{region}/resourceViews/{resourceViewName}", + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/ndev.cloudman" + // ] + // } + +} + +// method id "resourceviews.regionViews.get": + +type RegionViewsGetCall struct { + s *Service + projectName string + region string + resourceViewName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Get the information of a resource view. +func (r *RegionViewsService) Get(projectName string, region string, resourceViewName string) *RegionViewsGetCall { + c := &RegionViewsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.projectName = projectName + c.region = region + c.resourceViewName = resourceViewName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionViewsGetCall) Fields(s ...googleapi.Field) *RegionViewsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RegionViewsGetCall) IfNoneMatch(entityTag string) *RegionViewsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RegionViewsGetCall) Context(ctx context.Context) *RegionViewsGetCall { + c.ctx_ = ctx + return c +} + +func (c *RegionViewsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/regions/{region}/resourceViews/{resourceViewName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectName": c.projectName, + "region": c.region, + "resourceViewName": c.resourceViewName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "resourceviews.regionViews.get" call. +// Exactly one of *ResourceView or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ResourceView.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RegionViewsGetCall) Do() (*ResourceView, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ResourceView{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get the information of a resource view.", + // "httpMethod": "GET", + // "id": "resourceviews.regionViews.get", + // "parameterOrder": [ + // "projectName", + // "region", + // "resourceViewName" + // ], + // "parameters": { + // "projectName": { + // "description": "The project name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "The region name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "resourceViewName": { + // "description": "The name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectName}/regions/{region}/resourceViews/{resourceViewName}", + // "response": { + // "$ref": "ResourceView" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "resourceviews.regionViews.insert": + +type RegionViewsInsertCall struct { + s *Service + projectName string + region string + resourceview *ResourceView + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Create a resource view. +func (r *RegionViewsService) Insert(projectName string, region string, resourceview *ResourceView) *RegionViewsInsertCall { + c := &RegionViewsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.projectName = projectName + c.region = region + c.resourceview = resourceview + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionViewsInsertCall) Fields(s ...googleapi.Field) *RegionViewsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RegionViewsInsertCall) Context(ctx context.Context) *RegionViewsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *RegionViewsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourceview) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/regions/{region}/resourceViews") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectName": c.projectName, + "region": c.region, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "resourceviews.regionViews.insert" call. +// Exactly one of *RegionViewsInsertResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *RegionViewsInsertResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RegionViewsInsertCall) Do() (*RegionViewsInsertResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RegionViewsInsertResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a resource view.", + // "httpMethod": "POST", + // "id": "resourceviews.regionViews.insert", + // "parameterOrder": [ + // "projectName", + // "region" + // ], + // "parameters": { + // "projectName": { + // "description": "The project name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "The region name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectName}/regions/{region}/resourceViews", + // "request": { + // "$ref": "ResourceView" + // }, + // "response": { + // "$ref": "RegionViewsInsertResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/ndev.cloudman" + // ] + // } + +} + +// method id "resourceviews.regionViews.list": + +type RegionViewsListCall struct { + s *Service + projectName string + region string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List resource views. +func (r *RegionViewsService) List(projectName string, region string) *RegionViewsListCall { + c := &RegionViewsListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectName = projectName + c.region = region + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Acceptable values are 0 to 5000, inclusive. +// (Default: 5000) +func (c *RegionViewsListCall) MaxResults(maxResults int64) *RegionViewsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a +// nextPageToken returned by a previous list request. This token can be +// used to request the next page of results from a previous list +// request. +func (c *RegionViewsListCall) PageToken(pageToken string) *RegionViewsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionViewsListCall) Fields(s ...googleapi.Field) *RegionViewsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RegionViewsListCall) IfNoneMatch(entityTag string) *RegionViewsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RegionViewsListCall) Context(ctx context.Context) *RegionViewsListCall { + c.ctx_ = ctx + return c +} + +func (c *RegionViewsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/regions/{region}/resourceViews") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectName": c.projectName, + "region": c.region, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "resourceviews.regionViews.list" call. +// Exactly one of *RegionViewsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *RegionViewsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RegionViewsListCall) Do() (*RegionViewsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RegionViewsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List resource views.", + // "httpMethod": "GET", + // "id": "resourceviews.regionViews.list", + // "parameterOrder": [ + // "projectName", + // "region" + // ], + // "parameters": { + // "maxResults": { + // "default": "5000", + // "description": "Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000)", + // "format": "int32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "projectName": { + // "description": "The project name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "The region name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectName}/regions/{region}/resourceViews", + // "response": { + // "$ref": "RegionViewsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "resourceviews.regionViews.listresources": + +type RegionViewsListresourcesCall struct { + s *Service + projectName string + region string + resourceViewName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Listresources: List the resources in the view. +func (r *RegionViewsService) Listresources(projectName string, region string, resourceViewName string) *RegionViewsListresourcesCall { + c := &RegionViewsListresourcesCall{s: r.s, opt_: make(map[string]interface{})} + c.projectName = projectName + c.region = region + c.resourceViewName = resourceViewName + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Acceptable values are 0 to 5000, inclusive. +// (Default: 5000) +func (c *RegionViewsListresourcesCall) MaxResults(maxResults int64) *RegionViewsListresourcesCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a +// nextPageToken returned by a previous list request. This token can be +// used to request the next page of results from a previous list +// request. +func (c *RegionViewsListresourcesCall) PageToken(pageToken string) *RegionViewsListresourcesCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionViewsListresourcesCall) Fields(s ...googleapi.Field) *RegionViewsListresourcesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RegionViewsListresourcesCall) Context(ctx context.Context) *RegionViewsListresourcesCall { + c.ctx_ = ctx + return c +} + +func (c *RegionViewsListresourcesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/regions/{region}/resourceViews/{resourceViewName}/resources") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectName": c.projectName, + "region": c.region, + "resourceViewName": c.resourceViewName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "resourceviews.regionViews.listresources" call. +// Exactly one of *RegionViewsListResourcesResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *RegionViewsListResourcesResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RegionViewsListresourcesCall) Do() (*RegionViewsListResourcesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RegionViewsListResourcesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the resources in the view.", + // "httpMethod": "POST", + // "id": "resourceviews.regionViews.listresources", + // "parameterOrder": [ + // "projectName", + // "region", + // "resourceViewName" + // ], + // "parameters": { + // "maxResults": { + // "default": "5000", + // "description": "Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000)", + // "format": "int32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "projectName": { + // "description": "The project name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "The region name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "resourceViewName": { + // "description": "The name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectName}/regions/{region}/resourceViews/{resourceViewName}/resources", + // "response": { + // "$ref": "RegionViewsListResourcesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "resourceviews.regionViews.removeresources": + +type RegionViewsRemoveresourcesCall struct { + s *Service + projectName string + region string + resourceViewName string + regionviewsremoveresourcesrequest *RegionViewsRemoveResourcesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Removeresources: Remove resources from the view. +func (r *RegionViewsService) Removeresources(projectName string, region string, resourceViewName string, regionviewsremoveresourcesrequest *RegionViewsRemoveResourcesRequest) *RegionViewsRemoveresourcesCall { + c := &RegionViewsRemoveresourcesCall{s: r.s, opt_: make(map[string]interface{})} + c.projectName = projectName + c.region = region + c.resourceViewName = resourceViewName + c.regionviewsremoveresourcesrequest = regionviewsremoveresourcesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *RegionViewsRemoveresourcesCall) Fields(s ...googleapi.Field) *RegionViewsRemoveresourcesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *RegionViewsRemoveresourcesCall) Context(ctx context.Context) *RegionViewsRemoveresourcesCall { + c.ctx_ = ctx + return c +} + +func (c *RegionViewsRemoveresourcesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionviewsremoveresourcesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/regions/{region}/resourceViews/{resourceViewName}/removeResources") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectName": c.projectName, + "region": c.region, + "resourceViewName": c.resourceViewName, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "resourceviews.regionViews.removeresources" call. +func (c *RegionViewsRemoveresourcesCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Remove resources from the view.", + // "httpMethod": "POST", + // "id": "resourceviews.regionViews.removeresources", + // "parameterOrder": [ + // "projectName", + // "region", + // "resourceViewName" + // ], + // "parameters": { + // "projectName": { + // "description": "The project name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "region": { + // "description": "The region name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "resourceViewName": { + // "description": "The name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectName}/regions/{region}/resourceViews/{resourceViewName}/removeResources", + // "request": { + // "$ref": "RegionViewsRemoveResourcesRequest" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/ndev.cloudman" + // ] + // } + +} + +// method id "resourceviews.zoneViews.addresources": + +type ZoneViewsAddresourcesCall struct { + s *Service + projectName string + zone string + resourceViewName string + zoneviewsaddresourcesrequest *ZoneViewsAddResourcesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Addresources: Add resources to the view. +func (r *ZoneViewsService) Addresources(projectName string, zone string, resourceViewName string, zoneviewsaddresourcesrequest *ZoneViewsAddResourcesRequest) *ZoneViewsAddresourcesCall { + c := &ZoneViewsAddresourcesCall{s: r.s, opt_: make(map[string]interface{})} + c.projectName = projectName + c.zone = zone + c.resourceViewName = resourceViewName + c.zoneviewsaddresourcesrequest = zoneviewsaddresourcesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneViewsAddresourcesCall) Fields(s ...googleapi.Field) *ZoneViewsAddresourcesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneViewsAddresourcesCall) Context(ctx context.Context) *ZoneViewsAddresourcesCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneViewsAddresourcesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.zoneviewsaddresourcesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/zones/{zone}/resourceViews/{resourceViewName}/addResources") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectName": c.projectName, + "zone": c.zone, + "resourceViewName": c.resourceViewName, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "resourceviews.zoneViews.addresources" call. +func (c *ZoneViewsAddresourcesCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Add resources to the view.", + // "httpMethod": "POST", + // "id": "resourceviews.zoneViews.addresources", + // "parameterOrder": [ + // "projectName", + // "zone", + // "resourceViewName" + // ], + // "parameters": { + // "projectName": { + // "description": "The project name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "resourceViewName": { + // "description": "The name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The zone name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectName}/zones/{zone}/resourceViews/{resourceViewName}/addResources", + // "request": { + // "$ref": "ZoneViewsAddResourcesRequest" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/ndev.cloudman" + // ] + // } + +} + +// method id "resourceviews.zoneViews.delete": + +type ZoneViewsDeleteCall struct { + s *Service + projectName string + zone string + resourceViewName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Delete a resource view. +func (r *ZoneViewsService) Delete(projectName string, zone string, resourceViewName string) *ZoneViewsDeleteCall { + c := &ZoneViewsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.projectName = projectName + c.zone = zone + c.resourceViewName = resourceViewName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneViewsDeleteCall) Fields(s ...googleapi.Field) *ZoneViewsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneViewsDeleteCall) Context(ctx context.Context) *ZoneViewsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneViewsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/zones/{zone}/resourceViews/{resourceViewName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectName": c.projectName, + "zone": c.zone, + "resourceViewName": c.resourceViewName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "resourceviews.zoneViews.delete" call. +func (c *ZoneViewsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a resource view.", + // "httpMethod": "DELETE", + // "id": "resourceviews.zoneViews.delete", + // "parameterOrder": [ + // "projectName", + // "zone", + // "resourceViewName" + // ], + // "parameters": { + // "projectName": { + // "description": "The project name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "resourceViewName": { + // "description": "The name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The zone name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectName}/zones/{zone}/resourceViews/{resourceViewName}", + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/ndev.cloudman" + // ] + // } + +} + +// method id "resourceviews.zoneViews.get": + +type ZoneViewsGetCall struct { + s *Service + projectName string + zone string + resourceViewName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Get the information of a zonal resource view. +func (r *ZoneViewsService) Get(projectName string, zone string, resourceViewName string) *ZoneViewsGetCall { + c := &ZoneViewsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.projectName = projectName + c.zone = zone + c.resourceViewName = resourceViewName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneViewsGetCall) Fields(s ...googleapi.Field) *ZoneViewsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ZoneViewsGetCall) IfNoneMatch(entityTag string) *ZoneViewsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneViewsGetCall) Context(ctx context.Context) *ZoneViewsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneViewsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/zones/{zone}/resourceViews/{resourceViewName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectName": c.projectName, + "zone": c.zone, + "resourceViewName": c.resourceViewName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "resourceviews.zoneViews.get" call. +// Exactly one of *ResourceView or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ResourceView.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ZoneViewsGetCall) Do() (*ResourceView, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ResourceView{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get the information of a zonal resource view.", + // "httpMethod": "GET", + // "id": "resourceviews.zoneViews.get", + // "parameterOrder": [ + // "projectName", + // "zone", + // "resourceViewName" + // ], + // "parameters": { + // "projectName": { + // "description": "The project name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "resourceViewName": { + // "description": "The name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The zone name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectName}/zones/{zone}/resourceViews/{resourceViewName}", + // "response": { + // "$ref": "ResourceView" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "resourceviews.zoneViews.insert": + +type ZoneViewsInsertCall struct { + s *Service + projectName string + zone string + resourceview *ResourceView + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Create a resource view. +func (r *ZoneViewsService) Insert(projectName string, zone string, resourceview *ResourceView) *ZoneViewsInsertCall { + c := &ZoneViewsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.projectName = projectName + c.zone = zone + c.resourceview = resourceview + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneViewsInsertCall) Fields(s ...googleapi.Field) *ZoneViewsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneViewsInsertCall) Context(ctx context.Context) *ZoneViewsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneViewsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourceview) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/zones/{zone}/resourceViews") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectName": c.projectName, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "resourceviews.zoneViews.insert" call. +// Exactly one of *ZoneViewsInsertResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ZoneViewsInsertResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ZoneViewsInsertCall) Do() (*ZoneViewsInsertResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ZoneViewsInsertResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a resource view.", + // "httpMethod": "POST", + // "id": "resourceviews.zoneViews.insert", + // "parameterOrder": [ + // "projectName", + // "zone" + // ], + // "parameters": { + // "projectName": { + // "description": "The project name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The zone name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectName}/zones/{zone}/resourceViews", + // "request": { + // "$ref": "ResourceView" + // }, + // "response": { + // "$ref": "ZoneViewsInsertResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/ndev.cloudman" + // ] + // } + +} + +// method id "resourceviews.zoneViews.list": + +type ZoneViewsListCall struct { + s *Service + projectName string + zone string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List resource views. +func (r *ZoneViewsService) List(projectName string, zone string) *ZoneViewsListCall { + c := &ZoneViewsListCall{s: r.s, opt_: make(map[string]interface{})} + c.projectName = projectName + c.zone = zone + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Acceptable values are 0 to 5000, inclusive. +// (Default: 5000) +func (c *ZoneViewsListCall) MaxResults(maxResults int64) *ZoneViewsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a +// nextPageToken returned by a previous list request. This token can be +// used to request the next page of results from a previous list +// request. +func (c *ZoneViewsListCall) PageToken(pageToken string) *ZoneViewsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneViewsListCall) Fields(s ...googleapi.Field) *ZoneViewsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ZoneViewsListCall) IfNoneMatch(entityTag string) *ZoneViewsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneViewsListCall) Context(ctx context.Context) *ZoneViewsListCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneViewsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/zones/{zone}/resourceViews") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectName": c.projectName, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "resourceviews.zoneViews.list" call. +// Exactly one of *ZoneViewsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ZoneViewsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ZoneViewsListCall) Do() (*ZoneViewsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ZoneViewsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List resource views.", + // "httpMethod": "GET", + // "id": "resourceviews.zoneViews.list", + // "parameterOrder": [ + // "projectName", + // "zone" + // ], + // "parameters": { + // "maxResults": { + // "default": "5000", + // "description": "Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000)", + // "format": "int32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "projectName": { + // "description": "The project name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The zone name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectName}/zones/{zone}/resourceViews", + // "response": { + // "$ref": "ZoneViewsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "resourceviews.zoneViews.listresources": + +type ZoneViewsListresourcesCall struct { + s *Service + projectName string + zone string + resourceViewName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Listresources: List the resources of the resource view. +func (r *ZoneViewsService) Listresources(projectName string, zone string, resourceViewName string) *ZoneViewsListresourcesCall { + c := &ZoneViewsListresourcesCall{s: r.s, opt_: make(map[string]interface{})} + c.projectName = projectName + c.zone = zone + c.resourceViewName = resourceViewName + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Acceptable values are 0 to 5000, inclusive. +// (Default: 5000) +func (c *ZoneViewsListresourcesCall) MaxResults(maxResults int64) *ZoneViewsListresourcesCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a +// nextPageToken returned by a previous list request. This token can be +// used to request the next page of results from a previous list +// request. +func (c *ZoneViewsListresourcesCall) PageToken(pageToken string) *ZoneViewsListresourcesCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneViewsListresourcesCall) Fields(s ...googleapi.Field) *ZoneViewsListresourcesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneViewsListresourcesCall) Context(ctx context.Context) *ZoneViewsListresourcesCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneViewsListresourcesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/zones/{zone}/resourceViews/{resourceViewName}/resources") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectName": c.projectName, + "zone": c.zone, + "resourceViewName": c.resourceViewName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "resourceviews.zoneViews.listresources" call. +// Exactly one of *ZoneViewsListResourcesResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ZoneViewsListResourcesResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ZoneViewsListresourcesCall) Do() (*ZoneViewsListResourcesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ZoneViewsListResourcesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the resources of the resource view.", + // "httpMethod": "POST", + // "id": "resourceviews.zoneViews.listresources", + // "parameterOrder": [ + // "projectName", + // "zone", + // "resourceViewName" + // ], + // "parameters": { + // "maxResults": { + // "default": "5000", + // "description": "Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000)", + // "format": "int32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "projectName": { + // "description": "The project name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "resourceViewName": { + // "description": "The name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The zone name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectName}/zones/{zone}/resourceViews/{resourceViewName}/resources", + // "response": { + // "$ref": "ZoneViewsListResourcesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "resourceviews.zoneViews.removeresources": + +type ZoneViewsRemoveresourcesCall struct { + s *Service + projectName string + zone string + resourceViewName string + zoneviewsremoveresourcesrequest *ZoneViewsRemoveResourcesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Removeresources: Remove resources from the view. +func (r *ZoneViewsService) Removeresources(projectName string, zone string, resourceViewName string, zoneviewsremoveresourcesrequest *ZoneViewsRemoveResourcesRequest) *ZoneViewsRemoveresourcesCall { + c := &ZoneViewsRemoveresourcesCall{s: r.s, opt_: make(map[string]interface{})} + c.projectName = projectName + c.zone = zone + c.resourceViewName = resourceViewName + c.zoneviewsremoveresourcesrequest = zoneviewsremoveresourcesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneViewsRemoveresourcesCall) Fields(s ...googleapi.Field) *ZoneViewsRemoveresourcesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneViewsRemoveresourcesCall) Context(ctx context.Context) *ZoneViewsRemoveresourcesCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneViewsRemoveresourcesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.zoneviewsremoveresourcesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/zones/{zone}/resourceViews/{resourceViewName}/removeResources") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectName": c.projectName, + "zone": c.zone, + "resourceViewName": c.resourceViewName, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "resourceviews.zoneViews.removeresources" call. +func (c *ZoneViewsRemoveresourcesCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Remove resources from the view.", + // "httpMethod": "POST", + // "id": "resourceviews.zoneViews.removeresources", + // "parameterOrder": [ + // "projectName", + // "zone", + // "resourceViewName" + // ], + // "parameters": { + // "projectName": { + // "description": "The project name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "resourceViewName": { + // "description": "The name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The zone name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{projectName}/zones/{zone}/resourceViews/{resourceViewName}/removeResources", + // "request": { + // "$ref": "ZoneViewsRemoveResourcesRequest" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/ndev.cloudman" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/resourceviews/v1beta2/resourceviews-api.json b/Godeps/_workspace/src/google.golang.org/api/resourceviews/v1beta2/resourceviews-api.json new file mode 100644 index 000000000..68d5d7371 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/resourceviews/v1beta2/resourceviews-api.json @@ -0,0 +1,1052 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/Q2Fm4OHaHKaTfeWzlGIBAoc7BO8\"", + "discoveryVersion": "v1", + "id": "resourceviews:v1beta2", + "name": "resourceviews", + "version": "v1beta2", + "revision": "20150708", + "title": "Google Compute Engine Instance Groups API", + "description": "The Resource View API allows users to create and manage logical sets of Google Compute Engine instances.", + "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/compute/", + "labels": [ + "limited_availability" + ], + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/resourceviews/v1beta2/projects/", + "basePath": "/resourceviews/v1beta2/projects/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "resourceviews/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/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" + }, + "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/ndev.cloudman": { + "description": "View and manage your Google Cloud Platform management resources and deployment status information" + }, + "https://www.googleapis.com/auth/ndev.cloudman.readonly": { + "description": "View your Google Cloud Platform management resources and deployment status information" + } + } + } + }, + "schemas": { + "Label": { + "id": "Label", + "type": "object", + "description": "The Label to be applied to the resource views.", + "properties": { + "key": { + "type": "string", + "description": "Key of the label." + }, + "value": { + "type": "string", + "description": "Value of the label." + } + } + }, + "ListResourceResponseItem": { + "id": "ListResourceResponseItem", + "type": "object", + "description": "The list response item that contains the resource and end points information.", + "properties": { + "endpoints": { + "type": "object", + "description": "The list of service end points on the resource.", + "additionalProperties": { + "type": "array", + "description": "The name of the service end point.", + "items": { + "type": "integer", + "format": "int32" + } + } + }, + "resource": { + "type": "string", + "description": "The full URL of the resource." + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "description": "An operation resource, used to manage asynchronous API requests.", + "properties": { + "clientOperationId": { + "type": "string", + "description": "[Output only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] The time that this operation was requested, in RFC3339 text format." + }, + "endTime": { + "type": "string", + "description": "[Output Only] The time that this operation was completed, in RFC3339 text format." + }, + "error": { + "type": "object", + "description": "[Output Only] If errors occurred during processing of this operation, this field will be populated.", + "properties": { + "errors": { + "type": "array", + "description": "[Output Only] The array of errors encountered while processing this operation.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The error type identifier for this error." + }, + "location": { + "type": "string", + "description": "[Output Only] Indicates the field in the request which caused the error. This property is optional." + }, + "message": { + "type": "string", + "description": "[Output Only] An optional, human-readable error message." + } + } + } + } + } + }, + "httpErrorMessage": { + "type": "string", + "description": "[Output only] If operation fails, the HTTP error message returned." + }, + "httpErrorStatusCode": { + "type": "integer", + "description": "[Output only] If operation fails, the HTTP error status code returned.", + "format": "int32" + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource, generated by the server.", + "format": "uint64" + }, + "insertTime": { + "type": "string", + "description": "[Output Only] The time that this operation was requested, in RFC3339 text format." + }, + "kind": { + "type": "string", + "description": "[Output only] Type of the resource.", + "default": "resourceviews#operation" + }, + "name": { + "type": "string", + "description": "[Output Only] Name of the resource." + }, + "operationType": { + "type": "string", + "description": "[Output only] Type of the operation. Operations include insert, update, and delete." + }, + "progress": { + "type": "integer", + "description": "[Output only] 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.", + "format": "int32" + }, + "region": { + "type": "string", + "description": "[Output Only] URL of the region where the operation resides. Only available when performing regional operations." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined fully-qualified URL for this resource." + }, + "startTime": { + "type": "string", + "description": "[Output Only] The time that this operation was started by the server, in RFC3339 text format." + }, + "status": { + "type": "string", + "description": "[Output Only] Status of the operation." + }, + "statusMessage": { + "type": "string", + "description": "[Output Only] An optional textual description of the current status of the operation." + }, + "targetId": { + "type": "string", + "description": "[Output Only] Unique target ID which identifies a particular incarnation of the target.", + "format": "uint64" + }, + "targetLink": { + "type": "string", + "description": "[Output only] URL of the resource the operation is mutating." + }, + "user": { + "type": "string", + "description": "[Output Only] User who requested the operation, for example: user@example.com." + }, + "warnings": { + "type": "array", + "description": "[Output Only] If there are issues with this operation, a warning is returned.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output only] The warning type identifier for this warning." + }, + "data": { + "type": "array", + "description": "[Output only] Metadata for this warning in key:value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] Metadata key for this warning." + }, + "value": { + "type": "string", + "description": "[Output Only] Metadata value for this warning." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output only] Optional human-readable details for this warning." + } + } + } + }, + "zone": { + "type": "string", + "description": "[Output Only] URL of the zone where the operation resides. Only available when performing per-zone operations." + } + } + }, + "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": "resourceviews#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)." + } + } + }, + "ResourceView": { + "id": "ResourceView", + "type": "object", + "description": "The resource view object.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "The creation time of the resource view." + }, + "description": { + "type": "string", + "description": "The detailed description of the resource view." + }, + "endpoints": { + "type": "array", + "description": "Services endpoint information.", + "items": { + "$ref": "ServiceEndpoint" + } + }, + "fingerprint": { + "type": "string", + "description": "The fingerprint of the service endpoint information." + }, + "id": { + "type": "string", + "description": "[Output Only] The ID of the resource view." + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "resourceviews#resourceView" + }, + "labels": { + "type": "array", + "description": "The labels for events.", + "items": { + "$ref": "Label" + } + }, + "name": { + "type": "string", + "description": "The name of the resource view." + }, + "network": { + "type": "string", + "description": "The URL of a Compute Engine network to which the resources in the view belong." + }, + "resources": { + "type": "array", + "description": "A list of all resources in the resource view.", + "items": { + "type": "string" + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] A self-link to the resource view." + }, + "size": { + "type": "integer", + "description": "The total number of resources in the resource view.", + "format": "uint32" + } + } + }, + "ServiceEndpoint": { + "id": "ServiceEndpoint", + "type": "object", + "description": "The service endpoint that may be started in a VM.", + "properties": { + "name": { + "type": "string", + "description": "The name of the service endpoint." + }, + "port": { + "type": "integer", + "description": "The port of the service endpoint.", + "format": "int32" + } + } + }, + "ZoneViewsAddResourcesRequest": { + "id": "ZoneViewsAddResourcesRequest", + "type": "object", + "description": "The request to add resources to the resource view.", + "properties": { + "resources": { + "type": "array", + "description": "The list of resources to be added.", + "items": { + "type": "string" + } + } + } + }, + "ZoneViewsGetServiceResponse": { + "id": "ZoneViewsGetServiceResponse", + "type": "object", + "properties": { + "endpoints": { + "type": "array", + "description": "The service information.", + "items": { + "$ref": "ServiceEndpoint" + } + }, + "fingerprint": { + "type": "string", + "description": "The fingerprint of the service information." + } + } + }, + "ZoneViewsList": { + "id": "ZoneViewsList", + "type": "object", + "description": "The response to a list request.", + "properties": { + "items": { + "type": "array", + "description": "The result that contains all resource views that meet the criteria.", + "items": { + "$ref": "ResourceView" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "resourceviews#zoneViewsList" + }, + "nextPageToken": { + "type": "string", + "description": "A token used for pagination." + }, + "selfLink": { + "type": "string", + "description": "Server defined URL for this resource (output only)." + } + } + }, + "ZoneViewsListResourcesResponse": { + "id": "ZoneViewsListResourcesResponse", + "type": "object", + "description": "The response to a list resource request.", + "properties": { + "items": { + "type": "array", + "description": "The formatted JSON that is requested by the user.", + "items": { + "$ref": "ListResourceResponseItem" + } + }, + "network": { + "type": "string", + "description": "The URL of a Compute Engine network to which the resources in the view belong." + }, + "nextPageToken": { + "type": "string", + "description": "A token used for pagination." + } + } + }, + "ZoneViewsRemoveResourcesRequest": { + "id": "ZoneViewsRemoveResourcesRequest", + "type": "object", + "description": "The request to remove resources from the resource view.", + "properties": { + "resources": { + "type": "array", + "description": "The list of resources to be removed.", + "items": { + "type": "string" + } + } + } + }, + "ZoneViewsSetServiceRequest": { + "id": "ZoneViewsSetServiceRequest", + "type": "object", + "properties": { + "endpoints": { + "type": "array", + "description": "The service information to be updated.", + "items": { + "$ref": "ServiceEndpoint" + } + }, + "fingerprint": { + "type": "string", + "description": "Fingerprint of the service information; a hash of the contents. This field is used for optimistic locking when updating the service entries." + }, + "resourceName": { + "type": "string", + "description": "The name of the resource if user wants to update the service information of the resource." + } + } + } + }, + "resources": { + "zoneOperations": { + "methods": { + "get": { + "id": "resourceviews.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/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "list": { + "id": "resourceviews.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/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + } + } + }, + "zoneViews": { + "methods": { + "addResources": { + "id": "resourceviews.zoneViews.addResources", + "path": "{project}/zones/{zone}/resourceViews/{resourceView}/addResources", + "httpMethod": "POST", + "description": "Add resources to the view.", + "parameters": { + "project": { + "type": "string", + "description": "The project name of the resource view.", + "required": true, + "location": "path" + }, + "resourceView": { + "type": "string", + "description": "The name of the resource view.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The zone name of the resource view.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "resourceView" + ], + "request": { + "$ref": "ZoneViewsAddResourcesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "delete": { + "id": "resourceviews.zoneViews.delete", + "path": "{project}/zones/{zone}/resourceViews/{resourceView}", + "httpMethod": "DELETE", + "description": "Delete a resource view.", + "parameters": { + "project": { + "type": "string", + "description": "The project name of the resource view.", + "required": true, + "location": "path" + }, + "resourceView": { + "type": "string", + "description": "The name of the resource view.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The zone name of the resource view.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "resourceView" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "get": { + "id": "resourceviews.zoneViews.get", + "path": "{project}/zones/{zone}/resourceViews/{resourceView}", + "httpMethod": "GET", + "description": "Get the information of a zonal resource view.", + "parameters": { + "project": { + "type": "string", + "description": "The project name of the resource view.", + "required": true, + "location": "path" + }, + "resourceView": { + "type": "string", + "description": "The name of the resource view.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The zone name of the resource view.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "resourceView" + ], + "response": { + "$ref": "ResourceView" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "getService": { + "id": "resourceviews.zoneViews.getService", + "path": "{project}/zones/{zone}/resourceViews/{resourceView}/getService", + "httpMethod": "POST", + "description": "Get the service information of a resource view or a resource.", + "parameters": { + "project": { + "type": "string", + "description": "The project name of the resource view.", + "required": true, + "location": "path" + }, + "resourceName": { + "type": "string", + "description": "The name of the resource if user wants to get the service information of the resource.", + "location": "query" + }, + "resourceView": { + "type": "string", + "description": "The name of the resource view.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The zone name of the resource view.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "resourceView" + ], + "response": { + "$ref": "ZoneViewsGetServiceResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "insert": { + "id": "resourceviews.zoneViews.insert", + "path": "{project}/zones/{zone}/resourceViews", + "httpMethod": "POST", + "description": "Create a resource view.", + "parameters": { + "project": { + "type": "string", + "description": "The project name of the resource view.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The zone name of the resource view.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "request": { + "$ref": "ResourceView" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "list": { + "id": "resourceviews.zoneViews.list", + "path": "{project}/zones/{zone}/resourceViews", + "httpMethod": "GET", + "description": "List resource views.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000)", + "default": "5000", + "format": "int32", + "minimum": "0", + "maximum": "5000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project name of the resource view.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The zone name of the resource view.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "ZoneViewsList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "listResources": { + "id": "resourceviews.zoneViews.listResources", + "path": "{project}/zones/{zone}/resourceViews/{resourceView}/resources", + "httpMethod": "GET", + "description": "List the resources of the resource view.", + "parameters": { + "format": { + "type": "string", + "description": "The requested format of the return value. It can be URL or URL_PORT. A JSON object will be included in the response based on the format. The default format is NONE, which results in no JSON in the response.", + "enum": [ + "NONE", + "URL", + "URL_PORT" + ], + "enumDescriptions": [ + "", + "", + "" + ], + "location": "query" + }, + "listState": { + "type": "string", + "description": "The state of the instance to list. By default, it lists all instances.", + "default": "ALL", + "enum": [ + "ALL", + "RUNNING" + ], + "enumDescriptions": [ + "", + "" + ], + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000)", + "default": "5000", + "format": "int32", + "minimum": "0", + "maximum": "5000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project name of the resource view.", + "required": true, + "location": "path" + }, + "resourceView": { + "type": "string", + "description": "The name of the resource view.", + "required": true, + "location": "path" + }, + "serviceName": { + "type": "string", + "description": "The service name to return in the response. It is optional and if it is not set, all the service end points will be returned.", + "location": "query" + }, + "zone": { + "type": "string", + "description": "The zone name of the resource view.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "resourceView" + ], + "response": { + "$ref": "ZoneViewsListResourcesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly", + "https://www.googleapis.com/auth/ndev.cloudman", + "https://www.googleapis.com/auth/ndev.cloudman.readonly" + ] + }, + "removeResources": { + "id": "resourceviews.zoneViews.removeResources", + "path": "{project}/zones/{zone}/resourceViews/{resourceView}/removeResources", + "httpMethod": "POST", + "description": "Remove resources from the view.", + "parameters": { + "project": { + "type": "string", + "description": "The project name of the resource view.", + "required": true, + "location": "path" + }, + "resourceView": { + "type": "string", + "description": "The name of the resource view.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The zone name of the resource view.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "resourceView" + ], + "request": { + "$ref": "ZoneViewsRemoveResourcesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + }, + "setService": { + "id": "resourceviews.zoneViews.setService", + "path": "{project}/zones/{zone}/resourceViews/{resourceView}/setService", + "httpMethod": "POST", + "description": "Update the service information of a resource view or a resource.", + "parameters": { + "project": { + "type": "string", + "description": "The project name of the resource view.", + "required": true, + "location": "path" + }, + "resourceView": { + "type": "string", + "description": "The name of the resource view.", + "required": true, + "location": "path" + }, + "zone": { + "type": "string", + "description": "The zone name of the resource view.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "resourceView" + ], + "request": { + "$ref": "ZoneViewsSetServiceRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/ndev.cloudman" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/resourceviews/v1beta2/resourceviews-gen.go b/Godeps/_workspace/src/google.golang.org/api/resourceviews/v1beta2/resourceviews-gen.go new file mode 100644 index 000000000..24676cdad --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/resourceviews/v1beta2/resourceviews-gen.go @@ -0,0 +1,2457 @@ +// Package resourceviews provides access to the Google Compute Engine Instance Groups API. +// +// See https://developers.google.com/compute/ +// +// Usage example: +// +// import "google.golang.org/api/resourceviews/v1beta2" +// ... +// resourceviewsService, err := resourceviews.New(oauthHttpClient) +package resourceviews // import "google.golang.org/api/resourceviews/v1beta2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "resourceviews:v1beta2" +const apiName = "resourceviews" +const apiVersion = "v1beta2" +const basePath = "https://www.googleapis.com/resourceviews/v1beta2/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 data across Google Cloud Platform services + CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" + + // 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 and manage your Google Cloud Platform management resources and + // deployment status information + NdevCloudmanScope = "https://www.googleapis.com/auth/ndev.cloudman" + + // View your Google Cloud Platform management resources and deployment + // status information + NdevCloudmanReadonlyScope = "https://www.googleapis.com/auth/ndev.cloudman.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.ZoneOperations = NewZoneOperationsService(s) + s.ZoneViews = NewZoneViewsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + ZoneOperations *ZoneOperationsService + + ZoneViews *ZoneViewsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewZoneOperationsService(s *Service) *ZoneOperationsService { + rs := &ZoneOperationsService{s: s} + return rs +} + +type ZoneOperationsService struct { + s *Service +} + +func NewZoneViewsService(s *Service) *ZoneViewsService { + rs := &ZoneViewsService{s: s} + return rs +} + +type ZoneViewsService struct { + s *Service +} + +// Label: The Label to be applied to the resource views. +type Label struct { + // Key: Key of the label. + Key string `json:"key,omitempty"` + + // Value: Value of the label. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Label) MarshalJSON() ([]byte, error) { + type noMethod Label + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListResourceResponseItem: The list response item that contains the +// resource and end points information. +type ListResourceResponseItem struct { + // Endpoints: The list of service end points on the resource. + Endpoints *ListResourceResponseItemEndpoints `json:"endpoints,omitempty"` + + // Resource: The full URL of the resource. + Resource string `json:"resource,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Endpoints") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListResourceResponseItem) MarshalJSON() ([]byte, error) { + type noMethod ListResourceResponseItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListResourceResponseItemEndpoints: The list of service end points on +// the resource. +type ListResourceResponseItemEndpoints struct { +} + +// Operation: An operation resource, used to manage asynchronous API +// requests. +type Operation struct { + // ClientOperationId: [Output only] An optional identifier specified by + // the client when the mutation was initiated. Must be unique for all + // operation resources in the project. + ClientOperationId string `json:"clientOperationId,omitempty"` + + // CreationTimestamp: [Output Only] The time that this operation was + // requested, in RFC3339 text format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // EndTime: [Output Only] The time that this operation was completed, in + // RFC3339 text format. + EndTime string `json:"endTime,omitempty"` + + // Error: [Output Only] If errors occurred during processing of this + // operation, this field will be populated. + Error *OperationError `json:"error,omitempty"` + + // HttpErrorMessage: [Output only] If operation fails, the HTTP error + // message returned. + HttpErrorMessage string `json:"httpErrorMessage,omitempty"` + + // HttpErrorStatusCode: [Output only] If operation fails, the HTTP error + // status code returned. + HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"` + + // Id: [Output Only] Unique identifier for the resource, generated by + // the server. + Id uint64 `json:"id,omitempty,string"` + + // InsertTime: [Output Only] The time that this operation was requested, + // in RFC3339 text format. + InsertTime string `json:"insertTime,omitempty"` + + // Kind: [Output only] Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: [Output Only] Name of the resource. + Name string `json:"name,omitempty"` + + // OperationType: [Output only] Type of the operation. Operations + // include insert, update, and delete. + OperationType string `json:"operationType,omitempty"` + + // Progress: [Output only] 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. + Progress int64 `json:"progress,omitempty"` + + // Region: [Output Only] URL of the region where the operation resides. + // Only available when performing regional operations. + Region string `json:"region,omitempty"` + + // SelfLink: [Output Only] Server-defined fully-qualified URL for this + // resource. + SelfLink string `json:"selfLink,omitempty"` + + // StartTime: [Output Only] The time that this operation was started by + // the server, in RFC3339 text format. + StartTime string `json:"startTime,omitempty"` + + // Status: [Output Only] Status of the operation. + Status string `json:"status,omitempty"` + + // StatusMessage: [Output Only] An optional textual description of the + // current status of the operation. + StatusMessage string `json:"statusMessage,omitempty"` + + // TargetId: [Output Only] Unique target ID which identifies a + // particular incarnation of the target. + TargetId uint64 `json:"targetId,omitempty,string"` + + // TargetLink: [Output only] URL of the resource the operation is + // mutating. + TargetLink string `json:"targetLink,omitempty"` + + // User: [Output Only] User who requested the operation, for example: + // user@example.com. + User string `json:"user,omitempty"` + + // Warnings: [Output Only] If there are issues with this operation, a + // warning is returned. + Warnings []*OperationWarnings `json:"warnings,omitempty"` + + // Zone: [Output Only] URL of the zone where the operation resides. Only + // available when performing per-zone operations. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ClientOperationId") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Operation) MarshalJSON() ([]byte, error) { + type noMethod Operation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationError: [Output Only] If errors occurred during processing of +// this operation, this field will be populated. +type OperationError struct { + // Errors: [Output Only] The array of errors encountered while + // processing this operation. + Errors []*OperationErrorErrors `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationError) MarshalJSON() ([]byte, error) { + type noMethod OperationError + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationErrorErrors struct { + // Code: [Output Only] The error type identifier for this error. + Code string `json:"code,omitempty"` + + // Location: [Output Only] Indicates the field in the request which + // caused the error. This property is optional. + Location string `json:"location,omitempty"` + + // Message: [Output Only] An optional, human-readable error message. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) { + type noMethod OperationErrorErrors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationWarnings struct { + // Code: [Output only] The warning type identifier for this warning. + Code string `json:"code,omitempty"` + + // Data: [Output only] Metadata for this warning in key:value format. + Data []*OperationWarningsData `json:"data,omitempty"` + + // Message: [Output only] Optional human-readable details for this + // warning. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationWarnings) MarshalJSON() ([]byte, error) { + type noMethod OperationWarnings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationWarningsData struct { + // Key: [Output Only] Metadata key for this warning. + Key string `json:"key,omitempty"` + + // Value: [Output Only] Metadata value for this warning. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationWarningsData) MarshalJSON() ([]byte, error) { + type noMethod OperationWarningsData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationList) MarshalJSON() ([]byte, error) { + type noMethod OperationList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ResourceView: The resource view object. +type ResourceView struct { + // CreationTimestamp: The creation time of the resource view. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: The detailed description of the resource view. + Description string `json:"description,omitempty"` + + // Endpoints: Services endpoint information. + Endpoints []*ServiceEndpoint `json:"endpoints,omitempty"` + + // Fingerprint: The fingerprint of the service endpoint information. + Fingerprint string `json:"fingerprint,omitempty"` + + // Id: [Output Only] The ID of the resource view. + Id string `json:"id,omitempty"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Labels: The labels for events. + Labels []*Label `json:"labels,omitempty"` + + // Name: The name of the resource view. + Name string `json:"name,omitempty"` + + // Network: The URL of a Compute Engine network to which the resources + // in the view belong. + Network string `json:"network,omitempty"` + + // Resources: A list of all resources in the resource view. + Resources []string `json:"resources,omitempty"` + + // SelfLink: [Output Only] A self-link to the resource view. + SelfLink string `json:"selfLink,omitempty"` + + // Size: The total number of resources in the resource view. + Size int64 `json:"size,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ResourceView) MarshalJSON() ([]byte, error) { + type noMethod ResourceView + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ServiceEndpoint: The service endpoint that may be started in a VM. +type ServiceEndpoint struct { + // Name: The name of the service endpoint. + Name string `json:"name,omitempty"` + + // Port: The port of the service endpoint. + Port int64 `json:"port,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ServiceEndpoint) MarshalJSON() ([]byte, error) { + type noMethod ServiceEndpoint + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ZoneViewsAddResourcesRequest: The request to add resources to the +// resource view. +type ZoneViewsAddResourcesRequest struct { + // Resources: The list of resources to be added. + Resources []string `json:"resources,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Resources") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ZoneViewsAddResourcesRequest) MarshalJSON() ([]byte, error) { + type noMethod ZoneViewsAddResourcesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ZoneViewsGetServiceResponse struct { + // Endpoints: The service information. + Endpoints []*ServiceEndpoint `json:"endpoints,omitempty"` + + // Fingerprint: The fingerprint of the service information. + Fingerprint string `json:"fingerprint,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Endpoints") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ZoneViewsGetServiceResponse) MarshalJSON() ([]byte, error) { + type noMethod ZoneViewsGetServiceResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ZoneViewsList: The response to a list request. +type ZoneViewsList struct { + // Items: The result that contains all resource views that meet the + // criteria. + Items []*ResourceView `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: A token used for pagination. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: Server defined URL for this resource (output only). + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ZoneViewsList) MarshalJSON() ([]byte, error) { + type noMethod ZoneViewsList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ZoneViewsListResourcesResponse: The response to a list resource +// request. +type ZoneViewsListResourcesResponse struct { + // Items: The formatted JSON that is requested by the user. + Items []*ListResourceResponseItem `json:"items,omitempty"` + + // Network: The URL of a Compute Engine network to which the resources + // in the view belong. + Network string `json:"network,omitempty"` + + // NextPageToken: A token used for pagination. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ZoneViewsListResourcesResponse) MarshalJSON() ([]byte, error) { + type noMethod ZoneViewsListResourcesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ZoneViewsRemoveResourcesRequest: The request to remove resources from +// the resource view. +type ZoneViewsRemoveResourcesRequest struct { + // Resources: The list of resources to be removed. + Resources []string `json:"resources,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Resources") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ZoneViewsRemoveResourcesRequest) MarshalJSON() ([]byte, error) { + type noMethod ZoneViewsRemoveResourcesRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ZoneViewsSetServiceRequest struct { + // Endpoints: The service information to be updated. + Endpoints []*ServiceEndpoint `json:"endpoints,omitempty"` + + // Fingerprint: Fingerprint of the service information; a hash of the + // contents. This field is used for optimistic locking when updating the + // service entries. + Fingerprint string `json:"fingerprint,omitempty"` + + // ResourceName: The name of the resource if user wants to update the + // service information of the resource. + ResourceName string `json:"resourceName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Endpoints") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ZoneViewsSetServiceRequest) MarshalJSON() ([]byte, error) { + type noMethod ZoneViewsSetServiceRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "resourceviews.zoneOperations.get": + +type ZoneOperationsGetCall struct { + s *Service + project string + zone string + operation string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneOperationsGetCall) Fields(s ...googleapi.Field) *ZoneOperationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ZoneOperationsGetCall) IfNoneMatch(entityTag string) *ZoneOperationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneOperationsGetCall) Context(ctx context.Context) *ZoneOperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "resourceviews.zoneOperations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ZoneOperationsGetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the specified zone-specific operation resource.", + // "httpMethod": "GET", + // "id": "resourceviews.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/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "resourceviews.zoneOperations.list": + +type ZoneOperationsListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneOperationsListCall) Fields(s ...googleapi.Field) *ZoneOperationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ZoneOperationsListCall) IfNoneMatch(entityTag string) *ZoneOperationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneOperationsListCall) Context(ctx context.Context) *ZoneOperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneOperationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "resourceviews.zoneOperations.list" call. +// Exactly one of *OperationList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *OperationList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ZoneOperationsListCall) Do() (*OperationList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperationList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of operation resources contained within the specified zone.", + // "httpMethod": "GET", + // "id": "resourceviews.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/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "resourceviews.zoneViews.addResources": + +type ZoneViewsAddResourcesCall struct { + s *Service + project string + zone string + resourceView string + zoneviewsaddresourcesrequest *ZoneViewsAddResourcesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// AddResources: Add resources to the view. +func (r *ZoneViewsService) AddResources(project string, zone string, resourceView string, zoneviewsaddresourcesrequest *ZoneViewsAddResourcesRequest) *ZoneViewsAddResourcesCall { + c := &ZoneViewsAddResourcesCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.resourceView = resourceView + c.zoneviewsaddresourcesrequest = zoneviewsaddresourcesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneViewsAddResourcesCall) Fields(s ...googleapi.Field) *ZoneViewsAddResourcesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneViewsAddResourcesCall) Context(ctx context.Context) *ZoneViewsAddResourcesCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneViewsAddResourcesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.zoneviewsaddresourcesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/resourceViews/{resourceView}/addResources") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "resourceView": c.resourceView, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "resourceviews.zoneViews.addResources" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ZoneViewsAddResourcesCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Add resources to the view.", + // "httpMethod": "POST", + // "id": "resourceviews.zoneViews.addResources", + // "parameterOrder": [ + // "project", + // "zone", + // "resourceView" + // ], + // "parameters": { + // "project": { + // "description": "The project name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "resourceView": { + // "description": "The name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The zone name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/resourceViews/{resourceView}/addResources", + // "request": { + // "$ref": "ZoneViewsAddResourcesRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/ndev.cloudman" + // ] + // } + +} + +// method id "resourceviews.zoneViews.delete": + +type ZoneViewsDeleteCall struct { + s *Service + project string + zone string + resourceView string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Delete a resource view. +func (r *ZoneViewsService) Delete(project string, zone string, resourceView string) *ZoneViewsDeleteCall { + c := &ZoneViewsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.resourceView = resourceView + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneViewsDeleteCall) Fields(s ...googleapi.Field) *ZoneViewsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneViewsDeleteCall) Context(ctx context.Context) *ZoneViewsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneViewsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/resourceViews/{resourceView}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "resourceView": c.resourceView, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "resourceviews.zoneViews.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ZoneViewsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Delete a resource view.", + // "httpMethod": "DELETE", + // "id": "resourceviews.zoneViews.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "resourceView" + // ], + // "parameters": { + // "project": { + // "description": "The project name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "resourceView": { + // "description": "The name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The zone name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/resourceViews/{resourceView}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/ndev.cloudman" + // ] + // } + +} + +// method id "resourceviews.zoneViews.get": + +type ZoneViewsGetCall struct { + s *Service + project string + zone string + resourceView string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Get the information of a zonal resource view. +func (r *ZoneViewsService) Get(project string, zone string, resourceView string) *ZoneViewsGetCall { + c := &ZoneViewsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.resourceView = resourceView + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneViewsGetCall) Fields(s ...googleapi.Field) *ZoneViewsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ZoneViewsGetCall) IfNoneMatch(entityTag string) *ZoneViewsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneViewsGetCall) Context(ctx context.Context) *ZoneViewsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneViewsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/resourceViews/{resourceView}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "resourceView": c.resourceView, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "resourceviews.zoneViews.get" call. +// Exactly one of *ResourceView or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ResourceView.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ZoneViewsGetCall) Do() (*ResourceView, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ResourceView{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get the information of a zonal resource view.", + // "httpMethod": "GET", + // "id": "resourceviews.zoneViews.get", + // "parameterOrder": [ + // "project", + // "zone", + // "resourceView" + // ], + // "parameters": { + // "project": { + // "description": "The project name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "resourceView": { + // "description": "The name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The zone name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/resourceViews/{resourceView}", + // "response": { + // "$ref": "ResourceView" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "resourceviews.zoneViews.getService": + +type ZoneViewsGetServiceCall struct { + s *Service + project string + zone string + resourceView string + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetService: Get the service information of a resource view or a +// resource. +func (r *ZoneViewsService) GetService(project string, zone string, resourceView string) *ZoneViewsGetServiceCall { + c := &ZoneViewsGetServiceCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.resourceView = resourceView + return c +} + +// ResourceName sets the optional parameter "resourceName": The name of +// the resource if user wants to get the service information of the +// resource. +func (c *ZoneViewsGetServiceCall) ResourceName(resourceName string) *ZoneViewsGetServiceCall { + c.opt_["resourceName"] = resourceName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneViewsGetServiceCall) Fields(s ...googleapi.Field) *ZoneViewsGetServiceCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneViewsGetServiceCall) Context(ctx context.Context) *ZoneViewsGetServiceCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneViewsGetServiceCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["resourceName"]; ok { + params.Set("resourceName", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/resourceViews/{resourceView}/getService") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "resourceView": c.resourceView, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "resourceviews.zoneViews.getService" call. +// Exactly one of *ZoneViewsGetServiceResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ZoneViewsGetServiceResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ZoneViewsGetServiceCall) Do() (*ZoneViewsGetServiceResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ZoneViewsGetServiceResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Get the service information of a resource view or a resource.", + // "httpMethod": "POST", + // "id": "resourceviews.zoneViews.getService", + // "parameterOrder": [ + // "project", + // "zone", + // "resourceView" + // ], + // "parameters": { + // "project": { + // "description": "The project name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "resourceName": { + // "description": "The name of the resource if user wants to get the service information of the resource.", + // "location": "query", + // "type": "string" + // }, + // "resourceView": { + // "description": "The name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The zone name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/resourceViews/{resourceView}/getService", + // "response": { + // "$ref": "ZoneViewsGetServiceResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/ndev.cloudman" + // ] + // } + +} + +// method id "resourceviews.zoneViews.insert": + +type ZoneViewsInsertCall struct { + s *Service + project string + zone string + resourceview *ResourceView + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Create a resource view. +func (r *ZoneViewsService) Insert(project string, zone string, resourceview *ResourceView) *ZoneViewsInsertCall { + c := &ZoneViewsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.resourceview = resourceview + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneViewsInsertCall) Fields(s ...googleapi.Field) *ZoneViewsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneViewsInsertCall) Context(ctx context.Context) *ZoneViewsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneViewsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourceview) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/resourceViews") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "resourceviews.zoneViews.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ZoneViewsInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Create a resource view.", + // "httpMethod": "POST", + // "id": "resourceviews.zoneViews.insert", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "The project name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The zone name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/resourceViews", + // "request": { + // "$ref": "ResourceView" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/ndev.cloudman" + // ] + // } + +} + +// method id "resourceviews.zoneViews.list": + +type ZoneViewsListCall struct { + s *Service + project string + zone string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List resource views. +func (r *ZoneViewsService) List(project string, zone string) *ZoneViewsListCall { + c := &ZoneViewsListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Acceptable values are 0 to 5000, inclusive. +// (Default: 5000) +func (c *ZoneViewsListCall) MaxResults(maxResults int64) *ZoneViewsListCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a +// nextPageToken returned by a previous list request. This token can be +// used to request the next page of results from a previous list +// request. +func (c *ZoneViewsListCall) PageToken(pageToken string) *ZoneViewsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneViewsListCall) Fields(s ...googleapi.Field) *ZoneViewsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ZoneViewsListCall) IfNoneMatch(entityTag string) *ZoneViewsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneViewsListCall) Context(ctx context.Context) *ZoneViewsListCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneViewsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/resourceViews") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "resourceviews.zoneViews.list" call. +// Exactly one of *ZoneViewsList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ZoneViewsList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ZoneViewsListCall) Do() (*ZoneViewsList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ZoneViewsList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List resource views.", + // "httpMethod": "GET", + // "id": "resourceviews.zoneViews.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "maxResults": { + // "default": "5000", + // "description": "Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000)", + // "format": "int32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The project name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The zone name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/resourceViews", + // "response": { + // "$ref": "ZoneViewsList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "resourceviews.zoneViews.listResources": + +type ZoneViewsListResourcesCall struct { + s *Service + project string + zone string + resourceView string + opt_ map[string]interface{} + ctx_ context.Context +} + +// ListResources: List the resources of the resource view. +func (r *ZoneViewsService) ListResources(project string, zone string, resourceView string) *ZoneViewsListResourcesCall { + c := &ZoneViewsListResourcesCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.resourceView = resourceView + return c +} + +// Format sets the optional parameter "format": The requested format of +// the return value. It can be URL or URL_PORT. A JSON object will be +// included in the response based on the format. The default format is +// NONE, which results in no JSON in the response. +// +// Possible values: +// "NONE" +// "URL" +// "URL_PORT" +func (c *ZoneViewsListResourcesCall) Format(format string) *ZoneViewsListResourcesCall { + c.opt_["format"] = format + return c +} + +// ListState sets the optional parameter "listState": The state of the +// instance to list. By default, it lists all instances. +// +// Possible values: +// "ALL" (default) +// "RUNNING" +func (c *ZoneViewsListResourcesCall) ListState(listState string) *ZoneViewsListResourcesCall { + c.opt_["listState"] = listState + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. Acceptable values are 0 to 5000, inclusive. +// (Default: 5000) +func (c *ZoneViewsListResourcesCall) MaxResults(maxResults int64) *ZoneViewsListResourcesCall { + c.opt_["maxResults"] = maxResults + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a +// nextPageToken returned by a previous list request. This token can be +// used to request the next page of results from a previous list +// request. +func (c *ZoneViewsListResourcesCall) PageToken(pageToken string) *ZoneViewsListResourcesCall { + c.opt_["pageToken"] = pageToken + return c +} + +// ServiceName sets the optional parameter "serviceName": The service +// name to return in the response. It is optional and if it is not set, +// all the service end points will be returned. +func (c *ZoneViewsListResourcesCall) ServiceName(serviceName string) *ZoneViewsListResourcesCall { + c.opt_["serviceName"] = serviceName + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneViewsListResourcesCall) Fields(s ...googleapi.Field) *ZoneViewsListResourcesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ZoneViewsListResourcesCall) IfNoneMatch(entityTag string) *ZoneViewsListResourcesCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneViewsListResourcesCall) Context(ctx context.Context) *ZoneViewsListResourcesCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneViewsListResourcesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["format"]; ok { + params.Set("format", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["listState"]; ok { + params.Set("listState", 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_["serviceName"]; ok { + params.Set("serviceName", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/resourceViews/{resourceView}/resources") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "resourceView": c.resourceView, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "resourceviews.zoneViews.listResources" call. +// Exactly one of *ZoneViewsListResourcesResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ZoneViewsListResourcesResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ZoneViewsListResourcesCall) Do() (*ZoneViewsListResourcesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ZoneViewsListResourcesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List the resources of the resource view.", + // "httpMethod": "GET", + // "id": "resourceviews.zoneViews.listResources", + // "parameterOrder": [ + // "project", + // "zone", + // "resourceView" + // ], + // "parameters": { + // "format": { + // "description": "The requested format of the return value. It can be URL or URL_PORT. A JSON object will be included in the response based on the format. The default format is NONE, which results in no JSON in the response.", + // "enum": [ + // "NONE", + // "URL", + // "URL_PORT" + // ], + // "enumDescriptions": [ + // "", + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "listState": { + // "default": "ALL", + // "description": "The state of the instance to list. By default, it lists all instances.", + // "enum": [ + // "ALL", + // "RUNNING" + // ], + // "enumDescriptions": [ + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "5000", + // "description": "Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000)", + // "format": "int32", + // "location": "query", + // "maximum": "5000", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The project name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "resourceView": { + // "description": "The name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "serviceName": { + // "description": "The service name to return in the response. It is optional and if it is not set, all the service end points will be returned.", + // "location": "query", + // "type": "string" + // }, + // "zone": { + // "description": "The zone name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/resourceViews/{resourceView}/resources", + // "response": { + // "$ref": "ZoneViewsListResourcesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly", + // "https://www.googleapis.com/auth/ndev.cloudman", + // "https://www.googleapis.com/auth/ndev.cloudman.readonly" + // ] + // } + +} + +// method id "resourceviews.zoneViews.removeResources": + +type ZoneViewsRemoveResourcesCall struct { + s *Service + project string + zone string + resourceView string + zoneviewsremoveresourcesrequest *ZoneViewsRemoveResourcesRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// RemoveResources: Remove resources from the view. +func (r *ZoneViewsService) RemoveResources(project string, zone string, resourceView string, zoneviewsremoveresourcesrequest *ZoneViewsRemoveResourcesRequest) *ZoneViewsRemoveResourcesCall { + c := &ZoneViewsRemoveResourcesCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.resourceView = resourceView + c.zoneviewsremoveresourcesrequest = zoneviewsremoveresourcesrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneViewsRemoveResourcesCall) Fields(s ...googleapi.Field) *ZoneViewsRemoveResourcesCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneViewsRemoveResourcesCall) Context(ctx context.Context) *ZoneViewsRemoveResourcesCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneViewsRemoveResourcesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.zoneviewsremoveresourcesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/resourceViews/{resourceView}/removeResources") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "resourceView": c.resourceView, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "resourceviews.zoneViews.removeResources" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ZoneViewsRemoveResourcesCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Remove resources from the view.", + // "httpMethod": "POST", + // "id": "resourceviews.zoneViews.removeResources", + // "parameterOrder": [ + // "project", + // "zone", + // "resourceView" + // ], + // "parameters": { + // "project": { + // "description": "The project name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "resourceView": { + // "description": "The name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The zone name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/resourceViews/{resourceView}/removeResources", + // "request": { + // "$ref": "ZoneViewsRemoveResourcesRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/ndev.cloudman" + // ] + // } + +} + +// method id "resourceviews.zoneViews.setService": + +type ZoneViewsSetServiceCall struct { + s *Service + project string + zone string + resourceView string + zoneviewssetservicerequest *ZoneViewsSetServiceRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// SetService: Update the service information of a resource view or a +// resource. +func (r *ZoneViewsService) SetService(project string, zone string, resourceView string, zoneviewssetservicerequest *ZoneViewsSetServiceRequest) *ZoneViewsSetServiceCall { + c := &ZoneViewsSetServiceCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.zone = zone + c.resourceView = resourceView + c.zoneviewssetservicerequest = zoneviewssetservicerequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ZoneViewsSetServiceCall) Fields(s ...googleapi.Field) *ZoneViewsSetServiceCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ZoneViewsSetServiceCall) Context(ctx context.Context) *ZoneViewsSetServiceCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneViewsSetServiceCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.zoneviewssetservicerequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/resourceViews/{resourceView}/setService") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "resourceView": c.resourceView, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "resourceviews.zoneViews.setService" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ZoneViewsSetServiceCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update the service information of a resource view or a resource.", + // "httpMethod": "POST", + // "id": "resourceviews.zoneViews.setService", + // "parameterOrder": [ + // "project", + // "zone", + // "resourceView" + // ], + // "parameters": { + // "project": { + // "description": "The project name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "resourceView": { + // "description": "The name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The zone name of the resource view.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/resourceViews/{resourceView}/setService", + // "request": { + // "$ref": "ZoneViewsSetServiceRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/ndev.cloudman" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/script/v1/script-api.json b/Godeps/_workspace/src/google.golang.org/api/script/v1/script-api.json new file mode 100644 index 000000000..ffbbba04a --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/script/v1/script-api.json @@ -0,0 +1,319 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/naX8yNJ_bY3dR5Ft8Kwm0spj_ao\"", + "discoveryVersion": "v1", + "id": "script:v1", + "name": "script", + "version": "v1", + "revision": "20150922", + "title": "Google Apps Script Execution API", + "description": "An API for executing Google Apps Script projects.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://developers.google.com/apps-script/execution/rest/v1/run", + "protocol": "rest", + "baseUrl": "https://script.googleapis.com/", + "basePath": "/", + "rootUrl": "https://script.googleapis.com/", + "servicePath": "", + "batchPath": "batch", + "parameters": { + "access_token": { + "type": "string", + "description": "OAuth access token.", + "location": "query" + }, + "alt": { + "type": "string", + "description": "Data format for response.", + "default": "json", + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query" + }, + "bearer_token": { + "type": "string", + "description": "OAuth bearer token.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JSONP", + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "pp": { + "type": "boolean", + "description": "Pretty-print response.", + "default": "true", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query" + }, + "upload_protocol": { + "type": "string", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query" + }, + "uploadType": { + "type": "string", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query" + }, + "$.xgafv": { + "type": "string", + "description": "V1 error format.", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://mail.google.com/": { + "description": "View and manage your mail" + }, + "https://www.google.com/calendar/feeds": { + "description": "Manage your calendars" + }, + "https://www.google.com/m8/feeds": { + "description": "Manage your contacts" + }, + "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.user": { + "description": "View and manage the provisioning of users on your domain" + }, + "https://www.googleapis.com/auth/drive": { + "description": "View and manage the files in your Google Drive" + }, + "https://www.googleapis.com/auth/forms": { + "description": "View and manage your forms in Google Drive" + }, + "https://www.googleapis.com/auth/forms.currentonly": { + "description": "View and manage forms that this application has been installed in" + }, + "https://www.googleapis.com/auth/groups": { + "description": "View and manage your Google Groups" + }, + "https://www.googleapis.com/auth/userinfo.email": { + "description": "View your email address" + } + } + } + }, + "schemas": { + "ExecutionRequest": { + "id": "ExecutionRequest", + "type": "object", + "description": "A request to run the function in a script. The script is identified by the specified `script_id`. Executing a function on a script will return results based on the implementation of the script.", + "properties": { + "function": { + "type": "string", + "description": "The name of the function to execute in the given script. The name does not include parentheses or parameters." + }, + "parameters": { + "type": "array", + "description": "The parameters to be passed to the function being executed. The type for each parameter should match the expected type in Apps Script. Parameters cannot be Apps Script-specific objects (such as a `Document` or `Calendar`); they can only be primitive types such as a `string`, `number`, `array`, `object`, or `boolean`. Optional.", + "items": { + "type": "any" + } + }, + "sessionState": { + "type": "string", + "description": "This field is not used." + }, + "devMode": { + "type": "boolean", + "description": "If `true` and the user is an owner of the script, the script runs at the most recently saved version rather than the version deployed for use with the Execution API. Optional; default is `false`." + } + } + }, + "Operation": { + "id": "Operation", + "type": "object", + "description": "The response will not arrive until the function finishes executing. The maximum runtime is listed in the guide to [limitations in Apps Script](https://developers.google.com/apps-script/guides/services/quotas#current_limitations).\nIf the script function returns successfully, the `response` field will contain an `ExecutionResponse` object with the function's return value in the object's `result` field.\n\nIf the script function (or Apps Script itself) throws an exception, the `error` field will contain a `Status` object. The `Status` object's `details` field will contain an array with a single `ExecutionError` object that provides information about the nature of the error.\n\nIf the `run` call itself fails (for example, because of a malformed request or an authorization error), the method will return an HTTP response code in the 4XX range with a different format for the response body. Client libraries will automatically convert a 4XX response into an exception class.", + "properties": { + "name": { + "type": "string", + "description": "This field is not used." + }, + "metadata": { + "type": "object", + "description": "This field is not used.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @ype with type URL." + } + }, + "done": { + "type": "boolean", + "description": "This field is not used." + }, + "error": { + "$ref": "Status", + "description": "If a `run` call succeeds but the script function (or Apps Script itself) throws an exception, this field will contain a `Status` object. The `Status` object's `details` field will contain an array with a single `ExecutionError` object that provides information about the nature of the error." + }, + "response": { + "type": "object", + "description": "If the script function returns successfully, this field will contain an `ExecutionResponse` object with the function's return value as the object's `result` field.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @ype with type URL." + } + } + } + }, + "Status": { + "id": "Status", + "type": "object", + "description": "If a `run` call succeeds but the script function (or Apps Script itself) throws an exception, the response body's `error` field will contain this `Status` object.", + "properties": { + "code": { + "type": "integer", + "description": "The status code, which should be an enum value of google.rpc.Code.", + "format": "int32" + }, + "message": { + "type": "string", + "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client." + }, + "details": { + "type": "array", + "description": "An array that contains a single `ExecutionError` object that provides information about the nature of the error.", + "items": { + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @ype with type URL." + } + } + } + } + }, + "ExecutionError": { + "id": "ExecutionError", + "type": "object", + "description": "An object that provides information about the nature of an error in the Apps Script Execution API. If an `run` call succeeds but the script function (or Apps Script itself) throws an exception, the response body's `error` field will contain a `Status` object. The `Status` object's `details` field will contain an array with a single one of these `ExecutionError` objects.", + "properties": { + "scriptStackTraceElements": { + "type": "array", + "description": "An array of objects that provide a stack trace through the script to show where the execution failed, with the deepest call first.", + "items": { + "$ref": "ScriptStackTraceElement" + } + }, + "errorMessage": { + "type": "string", + "description": "The error message thrown by Apps Script, usually localized into the user's language." + }, + "errorType": { + "type": "string", + "description": "The error type, for example `TypeError` or `ReferenceError`. If the error type is unavailable, this field is not included." + } + } + }, + "ScriptStackTraceElement": { + "id": "ScriptStackTraceElement", + "type": "object", + "description": "A stack trace through the script that shows where the execution failed.", + "properties": { + "function": { + "type": "string", + "description": "The name of the function that failed." + }, + "lineNumber": { + "type": "integer", + "description": "The line number where the script failed.", + "format": "int32" + } + } + }, + "ExecutionResponse": { + "id": "ExecutionResponse", + "type": "object", + "description": "An object that provides the return value of a function executed through the Apps Script Execution API. If an `run` call succeeds and the script function returns successfully, the response body's `response` field will contain this `ExecutionResponse` object.", + "properties": { + "result": { + "type": "any", + "description": "The return value of the script function. The type will match the type returned in Apps Script. Functions called through the Execution API cannot return Apps Script-specific objects (such as a `Document` or `Calendar`); they can only return primitive types such as a `string`, `number`, `array`, `object`, or `boolean`." + } + } + } + }, + "resources": { + "scripts": { + "methods": { + "run": { + "id": "script.scripts.run", + "path": "v1/scripts/{scriptId}:run", + "httpMethod": "POST", + "description": "Runs a function in an Apps Script project that has been deployed for use with the Apps Script Execution API. This method requires authorization with an OAuth 2.0 token that includes at least one of the scopes listed in the [Authentication](#authentication) section; script projects that do not require authorization cannot be executed through this API. To find the correct scopes to include in the authentication token, open the project in the script editor, then select **File \u003e Project properties** and click the **Scopes** tab.", + "parameters": { + "scriptId": { + "type": "string", + "description": "The project key of the script to be executed. To find the project key, open the project in the script editor, then select **File \u003e Project properties**.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "scriptId" + ], + "request": { + "$ref": "ExecutionRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://mail.google.com/", + "https://www.google.com/calendar/feeds", + "https://www.google.com/m8/feeds", + "https://www.googleapis.com/auth/admin.directory.group", + "https://www.googleapis.com/auth/admin.directory.user", + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/forms", + "https://www.googleapis.com/auth/forms.currentonly", + "https://www.googleapis.com/auth/groups", + "https://www.googleapis.com/auth/userinfo.email" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/script/v1/script-gen.go b/Godeps/_workspace/src/google.golang.org/api/script/v1/script-gen.go new file mode 100644 index 000000000..1f78d327d --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/script/v1/script-gen.go @@ -0,0 +1,480 @@ +// Package script provides access to the Google Apps Script Execution API. +// +// See https://developers.google.com/apps-script/execution/rest/v1/run +// +// Usage example: +// +// import "google.golang.org/api/script/v1" +// ... +// scriptService, err := script.New(oauthHttpClient) +package script // import "google.golang.org/api/script/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "script:v1" +const apiName = "script" +const apiVersion = "v1" +const basePath = "https://script.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your mail + MailGoogleComScope = "https://mail.google.com/" + + // Manage your calendars + WwwGoogleComCalendarFeedsScope = "https://www.google.com/calendar/feeds" + + // Manage your contacts + WwwGoogleComM8FeedsScope = "https://www.google.com/m8/feeds" + + // View and manage the provisioning of groups on your domain + AdminDirectoryGroupScope = "https://www.googleapis.com/auth/admin.directory.group" + + // View and manage the provisioning of users on your domain + AdminDirectoryUserScope = "https://www.googleapis.com/auth/admin.directory.user" + + // View and manage the files in your Google Drive + DriveScope = "https://www.googleapis.com/auth/drive" + + // View and manage your forms in Google Drive + FormsScope = "https://www.googleapis.com/auth/forms" + + // View and manage forms that this application has been installed in + FormsCurrentonlyScope = "https://www.googleapis.com/auth/forms.currentonly" + + // View and manage your Google Groups + GroupsScope = "https://www.googleapis.com/auth/groups" + + // 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.Scripts = NewScriptsService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Scripts *ScriptsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewScriptsService(s *Service) *ScriptsService { + rs := &ScriptsService{s: s} + return rs +} + +type ScriptsService struct { + s *Service +} + +// ExecutionError: An object that provides information about the nature +// of an error in the Apps Script Execution API. If an `run` call +// succeeds but the script function (or Apps Script itself) throws an +// exception, the response body's `error` field will contain a `Status` +// object. The `Status` object's `details` field will contain an array +// with a single one of these `ExecutionError` objects. +type ExecutionError struct { + // ErrorMessage: The error message thrown by Apps Script, usually + // localized into the user's language. + ErrorMessage string `json:"errorMessage,omitempty"` + + // ErrorType: The error type, for example `TypeError` or + // `ReferenceError`. If the error type is unavailable, this field is not + // included. + ErrorType string `json:"errorType,omitempty"` + + // ScriptStackTraceElements: An array of objects that provide a stack + // trace through the script to show where the execution failed, with the + // deepest call first. + ScriptStackTraceElements []*ScriptStackTraceElement `json:"scriptStackTraceElements,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ErrorMessage") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ExecutionError) MarshalJSON() ([]byte, error) { + type noMethod ExecutionError + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ExecutionRequest: A request to run the function in a script. The +// script is identified by the specified `script_id`. Executing a +// function on a script will return results based on the implementation +// of the script. +type ExecutionRequest struct { + // DevMode: If `true` and the user is an owner of the script, the script + // runs at the most recently saved version rather than the version + // deployed for use with the Execution API. Optional; default is + // `false`. + DevMode bool `json:"devMode,omitempty"` + + // Function: The name of the function to execute in the given script. + // The name does not include parentheses or parameters. + Function string `json:"function,omitempty"` + + // Parameters: The parameters to be passed to the function being + // executed. The type for each parameter should match the expected type + // in Apps Script. Parameters cannot be Apps Script-specific objects + // (such as a `Document` or `Calendar`); they can only be primitive + // types such as a `string`, `number`, `array`, `object`, or `boolean`. + // Optional. + Parameters []interface{} `json:"parameters,omitempty"` + + // SessionState: This field is not used. + SessionState string `json:"sessionState,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DevMode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ExecutionRequest) MarshalJSON() ([]byte, error) { + type noMethod ExecutionRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ExecutionResponse: An object that provides the return value of a +// function executed through the Apps Script Execution API. If an `run` +// call succeeds and the script function returns successfully, the +// response body's `response` field will contain this +// `ExecutionResponse` object. +type ExecutionResponse struct { + // Result: The return value of the script function. The type will match + // the type returned in Apps Script. Functions called through the + // Execution API cannot return Apps Script-specific objects (such as a + // `Document` or `Calendar`); they can only return primitive types such + // as a `string`, `number`, `array`, `object`, or `boolean`. + Result interface{} `json:"result,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Result") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ExecutionResponse) MarshalJSON() ([]byte, error) { + type noMethod ExecutionResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Operation: The response will not arrive until the function finishes +// executing. The maximum runtime is listed in the guide to [limitations +// in Apps +// Script](https://developers.google.com/apps-script/guides/services/quot +// as#current_limitations). +// If the script function returns successfully, the `response` field +// will contain an `ExecutionResponse` object with the function's return +// value in the object's `result` field. +// +// If the script function (or Apps Script itself) throws an exception, +// the `error` field will contain a `Status` object. The `Status` +// object's `details` field will contain an array with a single +// `ExecutionError` object that provides information about the nature of +// the error. +// +// If the `run` call itself fails (for example, because of a malformed +// request or an authorization error), the method will return an HTTP +// response code in the 4XX range with a different format for the +// response body. Client libraries will automatically convert a 4XX +// response into an exception class. +type Operation struct { + // Done: This field is not used. + Done bool `json:"done,omitempty"` + + // Error: If a `run` call succeeds but the script function (or Apps + // Script itself) throws an exception, this field will contain a + // `Status` object. The `Status` object's `details` field will contain + // an array with a single `ExecutionError` object that provides + // information about the nature of the error. + Error *Status `json:"error,omitempty"` + + // Metadata: This field is not used. + Metadata OperationMetadata `json:"metadata,omitempty"` + + // Name: This field is not used. + Name string `json:"name,omitempty"` + + // Response: If the script function returns successfully, this field + // will contain an `ExecutionResponse` object with the function's return + // value as the object's `result` field. + Response OperationResponse `json:"response,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Done") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Operation) MarshalJSON() ([]byte, error) { + type noMethod Operation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationMetadata interface{} + +type OperationResponse interface{} + +// ScriptStackTraceElement: A stack trace through the script that shows +// where the execution failed. +type ScriptStackTraceElement struct { + // Function: The name of the function that failed. + Function string `json:"function,omitempty"` + + // LineNumber: The line number where the script failed. + LineNumber int64 `json:"lineNumber,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Function") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ScriptStackTraceElement) MarshalJSON() ([]byte, error) { + type noMethod ScriptStackTraceElement + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Status: If a `run` call succeeds but the script function (or Apps +// Script itself) throws an exception, the response body's `error` field +// will contain this `Status` object. +type Status struct { + // Code: The status code, which should be an enum value of + // google.rpc.Code. + Code int64 `json:"code,omitempty"` + + // Details: An array that contains a single `ExecutionError` object that + // provides information about the nature of the error. + Details []StatusDetails `json:"details,omitempty"` + + // Message: A developer-facing error message, which should be in + // English. Any user-facing error message should be localized and sent + // in the google.rpc.Status.details field, or localized by the client. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Status) MarshalJSON() ([]byte, error) { + type noMethod Status + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type StatusDetails interface{} + +// method id "script.scripts.run": + +type ScriptsRunCall struct { + s *Service + scriptId string + executionrequest *ExecutionRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Run: Runs a function in an Apps Script project that has been deployed +// for use with the Apps Script Execution API. This method requires +// authorization with an OAuth 2.0 token that includes at least one of +// the scopes listed in the [Authentication](#authentication) section; +// script projects that do not require authorization cannot be executed +// through this API. To find the correct scopes to include in the +// authentication token, open the project in the script editor, then +// select **File > Project properties** and click the **Scopes** tab. +func (r *ScriptsService) Run(scriptId string, executionrequest *ExecutionRequest) *ScriptsRunCall { + c := &ScriptsRunCall{s: r.s, opt_: make(map[string]interface{})} + c.scriptId = scriptId + c.executionrequest = executionrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ScriptsRunCall) Fields(s ...googleapi.Field) *ScriptsRunCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ScriptsRunCall) Context(ctx context.Context) *ScriptsRunCall { + c.ctx_ = ctx + return c +} + +func (c *ScriptsRunCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.executionrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/scripts/{scriptId}:run") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "scriptId": c.scriptId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "script.scripts.run" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ScriptsRunCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Runs a function in an Apps Script project that has been deployed for use with the Apps Script Execution API. This method requires authorization with an OAuth 2.0 token that includes at least one of the scopes listed in the [Authentication](#authentication) section; script projects that do not require authorization cannot be executed through this API. To find the correct scopes to include in the authentication token, open the project in the script editor, then select **File \u003e Project properties** and click the **Scopes** tab.", + // "httpMethod": "POST", + // "id": "script.scripts.run", + // "parameterOrder": [ + // "scriptId" + // ], + // "parameters": { + // "scriptId": { + // "description": "The project key of the script to be executed. To find the project key, open the project in the script editor, then select **File \u003e Project properties**.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/scripts/{scriptId}:run", + // "request": { + // "$ref": "ExecutionRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://mail.google.com/", + // "https://www.google.com/calendar/feeds", + // "https://www.google.com/m8/feeds", + // "https://www.googleapis.com/auth/admin.directory.group", + // "https://www.googleapis.com/auth/admin.directory.user", + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/forms", + // "https://www.googleapis.com/auth/forms.currentonly", + // "https://www.googleapis.com/auth/groups", + // "https://www.googleapis.com/auth/userinfo.email" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/siteverification/v1/siteverification-api.json b/Godeps/_workspace/src/google.golang.org/api/siteverification/v1/siteverification-api.json new file mode 100644 index 000000000..af2132e67 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/siteverification/v1/siteverification-api.json @@ -0,0 +1,321 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"FrPV2U6xXFUq8eRv_PO3IoAURkc/RwYHc_wr_RI-M8LU9rCXtGC2FOg\"", + "discoveryVersion": "v1", + "id": "siteVerification:v1", + "name": "siteVerification", + "version": "v1", + "revision": "20131007", + "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/Godeps/_workspace/src/google.golang.org/api/siteverification/v1/siteverification-gen.go b/Godeps/_workspace/src/google.golang.org/api/siteverification/v1/siteverification-gen.go new file mode 100644 index 000000000..a0fa3bb20 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/siteverification/v1/siteverification-gen.go @@ -0,0 +1,1066 @@ +// Package siteverification provides access to the Google Site Verification API. +// +// See https://developers.google.com/site-verification/ +// +// Usage example: +// +// import "google.golang.org/api/siteverification/v1" +// ... +// siteverificationService, err := siteverification.New(oauthHttpClient) +package siteverification // import "google.golang.org/api/siteverification/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + SiteverificationVerifyOnlyScope = "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 + UserAgent string // optional additional User-Agent fragment + + WebResource *WebResourceService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Site") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SiteVerificationWebResourceGettokenRequest) MarshalJSON() ([]byte, error) { + type noMethod SiteVerificationWebResourceGettokenRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SiteVerificationWebResourceGettokenRequestSite: The site for which a +// verification token will be generated. +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"` + + // ForceSendFields is a list of field names (e.g. "Identifier") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SiteVerificationWebResourceGettokenRequestSite) MarshalJSON() ([]byte, error) { + type noMethod SiteVerificationWebResourceGettokenRequestSite + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Method") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SiteVerificationWebResourceGettokenResponse) MarshalJSON() ([]byte, error) { + type noMethod SiteVerificationWebResourceGettokenResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type SiteVerificationWebResourceListResponse struct { + // Items: The list of sites that are owned by the authenticated user. + Items []*SiteVerificationWebResourceResource `json:"items,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SiteVerificationWebResourceListResponse) MarshalJSON() ([]byte, error) { + type noMethod SiteVerificationWebResourceListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SiteVerificationWebResourceResource) MarshalJSON() ([]byte, error) { + type noMethod SiteVerificationWebResourceResource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SiteVerificationWebResourceResourceSite: The address and type of a +// site that is verified or will be verified. +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"` + + // ForceSendFields is a list of field names (e.g. "Identifier") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SiteVerificationWebResourceResourceSite) MarshalJSON() ([]byte, error) { + type noMethod SiteVerificationWebResourceResourceSite + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "siteVerification.webResource.delete": + +type WebResourceDeleteCall struct { + s *Service + id string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *WebResourceDeleteCall) Fields(s ...googleapi.Field) *WebResourceDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *WebResourceDeleteCall) Context(ctx context.Context) *WebResourceDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *WebResourceDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "webResource/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "siteVerification.webResource.delete" call. +func (c *WebResourceDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *WebResourceGetCall) Fields(s ...googleapi.Field) *WebResourceGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *WebResourceGetCall) IfNoneMatch(entityTag string) *WebResourceGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *WebResourceGetCall) Context(ctx context.Context) *WebResourceGetCall { + c.ctx_ = ctx + return c +} + +func (c *WebResourceGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "webResource/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "siteVerification.webResource.get" call. +// Exactly one of *SiteVerificationWebResourceResource or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *SiteVerificationWebResourceResource.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *WebResourceGetCall) Do() (*SiteVerificationWebResourceResource, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SiteVerificationWebResourceResource{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *WebResourceGetTokenCall) Fields(s ...googleapi.Field) *WebResourceGetTokenCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *WebResourceGetTokenCall) Context(ctx context.Context) *WebResourceGetTokenCall { + c.ctx_ = ctx + return c +} + +func (c *WebResourceGetTokenCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "siteVerification.webResource.getToken" call. +// Exactly one of *SiteVerificationWebResourceGettokenResponse or error +// will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *SiteVerificationWebResourceGettokenResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *WebResourceGetTokenCall) Do() (*SiteVerificationWebResourceGettokenResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SiteVerificationWebResourceGettokenResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *WebResourceInsertCall) Fields(s ...googleapi.Field) *WebResourceInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *WebResourceInsertCall) Context(ctx context.Context) *WebResourceInsertCall { + c.ctx_ = ctx + return c +} + +func (c *WebResourceInsertCall) doRequest(alt string) (*http.Response, 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", alt) + params.Set("verificationMethod", fmt.Sprintf("%v", c.verificationMethod)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "siteVerification.webResource.insert" call. +// Exactly one of *SiteVerificationWebResourceResource or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *SiteVerificationWebResourceResource.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *WebResourceInsertCall) Do() (*SiteVerificationWebResourceResource, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SiteVerificationWebResourceResource{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *WebResourceListCall) Fields(s ...googleapi.Field) *WebResourceListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *WebResourceListCall) IfNoneMatch(entityTag string) *WebResourceListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *WebResourceListCall) Context(ctx context.Context) *WebResourceListCall { + c.ctx_ = ctx + return c +} + +func (c *WebResourceListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "webResource") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "siteVerification.webResource.list" call. +// Exactly one of *SiteVerificationWebResourceListResponse or error will +// be non-nil. Any non-2xx status code is an error. Response headers are +// in either +// *SiteVerificationWebResourceListResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *WebResourceListCall) Do() (*SiteVerificationWebResourceListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SiteVerificationWebResourceListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *WebResourcePatchCall) Fields(s ...googleapi.Field) *WebResourcePatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *WebResourcePatchCall) Context(ctx context.Context) *WebResourcePatchCall { + c.ctx_ = ctx + return c +} + +func (c *WebResourcePatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "webResource/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "siteVerification.webResource.patch" call. +// Exactly one of *SiteVerificationWebResourceResource or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *SiteVerificationWebResourceResource.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *WebResourcePatchCall) Do() (*SiteVerificationWebResourceResource, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SiteVerificationWebResourceResource{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *WebResourceUpdateCall) Fields(s ...googleapi.Field) *WebResourceUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *WebResourceUpdateCall) Context(ctx context.Context) *WebResourceUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *WebResourceUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "webResource/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "id": c.id, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "siteVerification.webResource.update" call. +// Exactly one of *SiteVerificationWebResourceResource or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *SiteVerificationWebResourceResource.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *WebResourceUpdateCall) Do() (*SiteVerificationWebResourceResource, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SiteVerificationWebResourceResource{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/Godeps/_workspace/src/google.golang.org/api/spectrum/v1explorer/spectrum-api.json b/Godeps/_workspace/src/google.golang.org/api/spectrum/v1explorer/spectrum-api.json new file mode 100644 index 000000000..6878b4fc7 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/spectrum/v1explorer/spectrum-api.json @@ -0,0 +1,992 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/MBdb_2wPLVZ-z9ZaAuo8xEjfMbY\"", + "discoveryVersion": "v1", + "id": "spectrum:v1explorer", + "name": "spectrum", + "version": "v1explorer", + "revision": "20150112", + "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/Godeps/_workspace/src/google.golang.org/api/spectrum/v1explorer/spectrum-gen.go b/Godeps/_workspace/src/google.golang.org/api/spectrum/v1explorer/spectrum-gen.go new file mode 100644 index 000000000..6b50d68aa --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/spectrum/v1explorer/spectrum-gen.go @@ -0,0 +1,2200 @@ +// Package spectrum provides access to the Google Spectrum Database API. +// +// See http://developers.google.com/spectrum +// +// Usage example: +// +// import "google.golang.org/api/spectrum/v1explorer" +// ... +// spectrumService, err := spectrum.New(oauthHttpClient) +package spectrum // import "google.golang.org/api/spectrum/v1explorer" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Paws *PawsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewPawsService(s *Service) *PawsService { + rs := &PawsService{s: s} + return rs +} + +type PawsService struct { + s *Service +} + +// AntennaCharacteristics: 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. +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"` + + // ForceSendFields is a list of field names (e.g. "Height") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AntennaCharacteristics) MarshalJSON() ([]byte, error) { + type noMethod AntennaCharacteristics + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DatabaseSpec: This message contains the name and URI of a database. +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"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DatabaseSpec) MarshalJSON() ([]byte, error) { + type noMethod DatabaseSpec + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DbUpdateSpec: This message is provided by the database to notify +// devices of an upcoming change to the database URI. +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"` + + // ForceSendFields is a list of field names (e.g. "Databases") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DbUpdateSpec) MarshalJSON() ([]byte, error) { + type noMethod DbUpdateSpec + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DeviceCapabilities: 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. +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"` + + // ForceSendFields is a list of field names (e.g. "FrequencyRanges") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeviceCapabilities) MarshalJSON() ([]byte, error) { + type noMethod DeviceCapabilities + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DeviceDescriptor: 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. +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"` + + // ForceSendFields is a list of field names (e.g. + // "EtsiEnDeviceCategory") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeviceDescriptor) MarshalJSON() ([]byte, error) { + type noMethod DeviceDescriptor + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DeviceOwner: This parameter contains device-owner information +// required as part of device registration. The regulatory domains may +// require additional parameters. +// +// All contact information must be expressed using the structure defined +// by the vCard format specification. Only the contact fields of vCard +// are supported: +// - fn: Full name of an individual +// - org: Name of the organization +// - adr: Address fields +// - tel: Telephone numbers +// - email: Email addresses +// +// Note that the vCard specification defines maximum lengths for each +// field. +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"` + + // ForceSendFields is a list of field names (e.g. "Operator") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeviceOwner) MarshalJSON() ([]byte, error) { + type noMethod DeviceOwner + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DeviceValidity: The device validity element describes whether a +// particular device is valid to operate in the regulatory domain. +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"` + + // ForceSendFields is a list of field names (e.g. "DeviceDesc") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DeviceValidity) MarshalJSON() ([]byte, error) { + type noMethod DeviceValidity + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// EventTime: The start and stop times of an event. This is used to +// indicate the time period for which a spectrum profile is valid. +// +// Both times are expressed using the format, YYYY-MM-DDThh:mm:ssZ, as +// defined in RFC3339. The times must be expressed using UTC. +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"` + + // ForceSendFields is a list of field names (e.g. "StartTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *EventTime) MarshalJSON() ([]byte, error) { + type noMethod EventTime + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FrequencyRange: A specific range of frequencies together with the +// associated maximum power level and channel identifier. +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"` + + // ForceSendFields is a list of field names (e.g. "ChannelId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FrequencyRange) MarshalJSON() ([]byte, error) { + type noMethod FrequencyRange + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GeoLocation: This parameter is used to specify the geolocation of the +// device. +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"` + + // ForceSendFields is a list of field names (e.g. "Confidence") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoLocation) MarshalJSON() ([]byte, error) { + type noMethod GeoLocation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GeoLocationEllipse: A "point" with uncertainty is represented using +// the Ellipse shape. +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"` + + // ForceSendFields is a list of field names (e.g. "Center") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoLocationEllipse) MarshalJSON() ([]byte, error) { + type noMethod GeoLocationEllipse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GeoLocationPoint: A single geolocation on the globe. +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"` + + // ForceSendFields is a list of field names (e.g. "Latitude") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoLocationPoint) MarshalJSON() ([]byte, error) { + type noMethod GeoLocationPoint + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GeoLocationPolygon: A region is represented using the polygonal +// shape. +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"` + + // ForceSendFields is a list of field names (e.g. "Exterior") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoLocationPolygon) MarshalJSON() ([]byte, error) { + type noMethod GeoLocationPolygon + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GeoSpectrumSchedule: The schedule of spectrum profiles available at a +// particular geolocation. +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"` + + // ForceSendFields is a list of field names (e.g. "Location") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoSpectrumSchedule) MarshalJSON() ([]byte, error) { + type noMethod GeoSpectrumSchedule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PawsGetSpectrumBatchRequest: The request message for a batch +// available spectrum query protocol. +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"` + + // ForceSendFields is a list of field names (e.g. "Antenna") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PawsGetSpectrumBatchRequest) MarshalJSON() ([]byte, error) { + type noMethod PawsGetSpectrumBatchRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PawsGetSpectrumBatchResponse: The response message for the batch +// available spectrum query contains a schedule of available spectrum +// for the device at multiple locations. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DatabaseChange") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PawsGetSpectrumBatchResponse) MarshalJSON() ([]byte, error) { + type noMethod PawsGetSpectrumBatchResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PawsGetSpectrumRequest: The request message for the available +// spectrum query protocol which must include the device's geolocation. +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"` + + // ForceSendFields is a list of field names (e.g. "Antenna") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PawsGetSpectrumRequest) MarshalJSON() ([]byte, error) { + type noMethod PawsGetSpectrumRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PawsGetSpectrumResponse: The response message for the available +// spectrum query which contains a schedule of available spectrum for +// the device. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DatabaseChange") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PawsGetSpectrumResponse) MarshalJSON() ([]byte, error) { + type noMethod PawsGetSpectrumResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PawsInitRequest: The initialization request message allows the master +// device to initiate exchange of capabilities with the database. +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"` + + // ForceSendFields is a list of field names (e.g. "DeviceDesc") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PawsInitRequest) MarshalJSON() ([]byte, error) { + type noMethod PawsInitRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PawsInitResponse: The initialization response message communicates +// database parameters to the requesting device. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DatabaseChange") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PawsInitResponse) MarshalJSON() ([]byte, error) { + type noMethod PawsInitResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PawsNotifySpectrumUseRequest: The spectrum-use notification message +// which must contain the geolocation of the Device and parameters +// required by the regulatory domain. +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"` + + // ForceSendFields is a list of field names (e.g. "DeviceDesc") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PawsNotifySpectrumUseRequest) MarshalJSON() ([]byte, error) { + type noMethod PawsNotifySpectrumUseRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PawsNotifySpectrumUseResponse: An empty response to the notification. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PawsNotifySpectrumUseResponse) MarshalJSON() ([]byte, error) { + type noMethod PawsNotifySpectrumUseResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PawsRegisterRequest: The registration request message contains the +// required registration parameters. +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"` + + // ForceSendFields is a list of field names (e.g. "Antenna") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PawsRegisterRequest) MarshalJSON() ([]byte, error) { + type noMethod PawsRegisterRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PawsRegisterResponse: The registration response message simply +// acknowledges receipt of the request and is otherwise empty. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DatabaseChange") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PawsRegisterResponse) MarshalJSON() ([]byte, error) { + type noMethod PawsRegisterResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PawsVerifyDeviceRequest: The device validation request message. +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"` + + // ForceSendFields is a list of field names (e.g. "DeviceDescs") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PawsVerifyDeviceRequest) MarshalJSON() ([]byte, error) { + type noMethod PawsVerifyDeviceRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PawsVerifyDeviceResponse: The device validation response message. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DatabaseChange") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PawsVerifyDeviceResponse) MarshalJSON() ([]byte, error) { + type noMethod PawsVerifyDeviceResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RulesetInfo: This contains parameters for the ruleset of a regulatory +// domain that is communicated using the initialization and +// available-spectrum processes. +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"` + + // ForceSendFields is a list of field names (e.g. "Authority") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RulesetInfo) MarshalJSON() ([]byte, error) { + type noMethod RulesetInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SpectrumMessage: Available spectrum can be logically characterized by +// a list of frequency ranges and permissible power levels for each +// range. +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"` + + // ForceSendFields is a list of field names (e.g. "Bandwidth") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SpectrumMessage) MarshalJSON() ([]byte, error) { + type noMethod SpectrumMessage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SpectrumSchedule: The spectrum schedule element combines an event +// time with spectrum profile to define a time period in which the +// profile is valid. +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"` + + // ForceSendFields is a list of field names (e.g. "EventTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SpectrumSchedule) MarshalJSON() ([]byte, error) { + type noMethod SpectrumSchedule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Vcard: A vCard-in-JSON message that contains only the fields needed +// for PAWS: +// - fn: Full name of an individual +// - org: Name of the organization +// - adr: Address fields +// - tel: Telephone numbers +// - email: Email addresses +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"` + + // ForceSendFields is a list of field names (e.g. "Adr") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Vcard) MarshalJSON() ([]byte, error) { + type noMethod Vcard + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VcardAddress: The structure used to represent a street address. +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"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VcardAddress) MarshalJSON() ([]byte, error) { + type noMethod VcardAddress + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VcardTelephone: The structure used to represent a telephone number. +type VcardTelephone struct { + // Uri: A nested telephone URI of the form: tel:+1-123-456-7890. + Uri string `json:"uri,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Uri") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VcardTelephone) MarshalJSON() ([]byte, error) { + type noMethod VcardTelephone + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// VcardTypedText: The structure used to represent an organization and +// an email address. +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"` + + // ForceSendFields is a list of field names (e.g. "Text") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VcardTypedText) MarshalJSON() ([]byte, error) { + type noMethod VcardTypedText + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "spectrum.paws.getSpectrum": + +type PawsGetSpectrumCall struct { + s *Service + pawsgetspectrumrequest *PawsGetSpectrumRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PawsGetSpectrumCall) Fields(s ...googleapi.Field) *PawsGetSpectrumCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PawsGetSpectrumCall) Context(ctx context.Context) *PawsGetSpectrumCall { + c.ctx_ = ctx + return c +} + +func (c *PawsGetSpectrumCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "spectrum.paws.getSpectrum" call. +// Exactly one of *PawsGetSpectrumResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PawsGetSpectrumResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PawsGetSpectrumCall) Do() (*PawsGetSpectrumResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PawsGetSpectrumResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PawsGetSpectrumBatchCall) Fields(s ...googleapi.Field) *PawsGetSpectrumBatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PawsGetSpectrumBatchCall) Context(ctx context.Context) *PawsGetSpectrumBatchCall { + c.ctx_ = ctx + return c +} + +func (c *PawsGetSpectrumBatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "spectrum.paws.getSpectrumBatch" call. +// Exactly one of *PawsGetSpectrumBatchResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PawsGetSpectrumBatchResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PawsGetSpectrumBatchCall) Do() (*PawsGetSpectrumBatchResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PawsGetSpectrumBatchResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PawsInitCall) Fields(s ...googleapi.Field) *PawsInitCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PawsInitCall) Context(ctx context.Context) *PawsInitCall { + c.ctx_ = ctx + return c +} + +func (c *PawsInitCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "spectrum.paws.init" call. +// Exactly one of *PawsInitResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PawsInitResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PawsInitCall) Do() (*PawsInitResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PawsInitResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PawsNotifySpectrumUseCall) Fields(s ...googleapi.Field) *PawsNotifySpectrumUseCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PawsNotifySpectrumUseCall) Context(ctx context.Context) *PawsNotifySpectrumUseCall { + c.ctx_ = ctx + return c +} + +func (c *PawsNotifySpectrumUseCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "spectrum.paws.notifySpectrumUse" call. +// Exactly one of *PawsNotifySpectrumUseResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PawsNotifySpectrumUseResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PawsNotifySpectrumUseCall) Do() (*PawsNotifySpectrumUseResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PawsNotifySpectrumUseResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PawsRegisterCall) Fields(s ...googleapi.Field) *PawsRegisterCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PawsRegisterCall) Context(ctx context.Context) *PawsRegisterCall { + c.ctx_ = ctx + return c +} + +func (c *PawsRegisterCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "spectrum.paws.register" call. +// Exactly one of *PawsRegisterResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *PawsRegisterResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PawsRegisterCall) Do() (*PawsRegisterResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PawsRegisterResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *PawsVerifyDeviceCall) Fields(s ...googleapi.Field) *PawsVerifyDeviceCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *PawsVerifyDeviceCall) Context(ctx context.Context) *PawsVerifyDeviceCall { + c.ctx_ = ctx + return c +} + +func (c *PawsVerifyDeviceCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "spectrum.paws.verifyDevice" call. +// Exactly one of *PawsVerifyDeviceResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *PawsVerifyDeviceResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *PawsVerifyDeviceCall) Do() (*PawsVerifyDeviceResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PawsVerifyDeviceResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/Godeps/_workspace/src/google.golang.org/api/sqladmin/v1beta3/sqladmin-api.json b/Godeps/_workspace/src/google.golang.org/api/sqladmin/v1beta3/sqladmin-api.json new file mode 100644 index 000000000..97bfdea54 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/sqladmin/v1beta3/sqladmin-api.json @@ -0,0 +1,1966 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/gwo7J97ILJAQ8gO-rmiOBs_ZkKc\"", + "discoveryVersion": "v1", + "id": "sqladmin:v1beta3", + "name": "sqladmin", + "canonicalName": "SQL Admin", + "version": "v1beta3", + "revision": "20150330", + "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://cloud.google.com/sql/docs/reference/latest", + "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 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 coordinates." + }, + "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. For more information, see Configuring MySQL Flags in the Google Cloud SQL documentation, as well as the official MySQL documentation for server options and system variables." + }, + "value": { + "type": "string", + "description": "The value of the flag. Booleans should be set to on for true and off 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. Can be MYSQL_5_5 or MYSQL_5_6. Defaults to MYSQL_5_5. The databaseVersion cannot be changed after instance creation." + }, + "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" + ] + } + }, + "instanceType": { + "type": "string", + "description": "The instance type. This can be one of the following.\nCLOUD_SQL_INSTANCE: Regular Cloud SQL instance.\nREAD_REPLICA_INSTANCE: Cloud SQL instance acting as a read-replica." + }, + "ipAddresses": { + "type": "array", + "description": "The assigned IP addresses for the instance.", + "items": { + "$ref": "IpMapping" + } + }, + "ipv6Address": { + "type": "string", + "description": "The IPv6 address assigned to the instance." + }, + "kind": { + "type": "string", + "description": "This is always sql#instance.", + "default": "sql#instance" + }, + "masterInstanceName": { + "type": "string", + "description": "The name of the instance which will act as master in the replication setup." + }, + "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-central, asia-east1 or europe-west1. Defaults to us-central. The region can not be changed after instance creation." + }, + "replicaNames": { + "type": "array", + "description": "The replicas of the instance.", + "items": { + "type": "string" + } + }, + "serverCaCert": { + "$ref": "SslCert", + "description": "SSL configuration." + }, + "serviceAccountEmailAddress": { + "type": "string", + "description": "The service account email address assigned to the instance." + }, + "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." + } + } + }, + "InstancesPromoteReplicaResponse": { + "id": "InstancesPromoteReplicaResponse", + "type": "object", + "description": "Database promote read replica response.", + "properties": { + "kind": { + "type": "string", + "description": "This is always sql#instancesPromoteReplica.", + "default": "sql#instancesPromoteReplica" + }, + "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." + } + } + }, + "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." + }, + "kind": { + "type": "string", + "description": "This is always sql#ipConfiguration.", + "default": "sql#ipConfiguration" + }, + "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 App Engine 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 App Engine 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" + } + }, + "databaseReplicationEnabled": { + "type": "boolean", + "description": "Configuration specific to read replica instance. Indicates whether replication is enabled or not." + }, + "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 App Engine app or GCE zone for better performance." + }, + "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 information about a specified backup run for a Cloud SQL instance.", + "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 start time of the four-hour backup window. The backup can occur any time in the window. The time is 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/cloud-platform", + "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 Cloud SQL instance.", + "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/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + } + } + }, + "flags": { + "methods": { + "list": { + "id": "sql.flags.list", + "path": "flags", + "httpMethod": "GET", + "description": "Lists all database flags that can be set for Google Cloud SQL instances.", + "response": { + "$ref": "FlagsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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 a 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/cloud-platform", + "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/cloud-platform", + "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 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/cloud-platform", + "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 stored in a Google Cloud Storage bucket.", + "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/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "list": { + "id": "sql.instances.list", + "path": "projects/{project}/instances", + "httpMethod": "GET", + "description": "Lists instances for a given project, in alphabetical order by 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/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "patch": { + "id": "sql.instances.patch", + "path": "projects/{project}/instances/{instance}", + "httpMethod": "PATCH", + "description": "Updates the settings of a Cloud SQL instance. 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/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "promoteReplica": { + "id": "sql.instances.promoteReplica", + "path": "projects/{project}/instances/{instance}/promoteReplica", + "httpMethod": "POST", + "description": "Promotes the read replica instance to be a stand-alone Cloud SQL instance.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL read replica instance name.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "ID of the project that contains the read replica.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "response": { + "$ref": "InstancesPromoteReplicaResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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 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": "InstancesResetSslConfigResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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/cloud-platform", + "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 start time of the four-hour backup window. The backup can occur any time in the window. The time is 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/cloud-platform", + "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 of the specified 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" + ], + "request": { + "$ref": "InstanceSetRootPasswordRequest" + }, + "response": { + "$ref": "InstancesSetRootPasswordResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "update": { + "id": "sql.instances.update", + "path": "projects/{project}/instances/{instance}", + "httpMethod": "PUT", + "description": "Updates the settings of 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" + ], + "etagRequired": true, + "request": { + "$ref": "DatabaseInstance" + }, + "response": { + "$ref": "InstancesUpdateResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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 information about a specific operation that was performed on a Cloud SQL 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/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "list": { + "id": "sql.operations.list", + "path": "projects/{project}/instances/{instance}/operations", + "httpMethod": "GET", + "description": "Lists all operations that have been performed on a Cloud SQL instance.", + "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/cloud-platform", + "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 an SSL certificate from 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" + }, + "sha1Fingerprint": { + "type": "string", + "description": "Sha1 FingerPrint.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance", + "sha1Fingerprint" + ], + "response": { + "$ref": "SslCertsDeleteResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "get": { + "id": "sql.sslCerts.get", + "path": "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", + "httpMethod": "GET", + "description": "Retrieves an SSL certificate as specified by its SHA-1 fingerprint.", + "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/cloud-platform", + "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 the certificate, the associated private key, and the server certificate authority.", + "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/cloud-platform", + "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 defined for 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 for which to list Cloud SQL instances.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "response": { + "$ref": "SslCertsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + } + } + }, + "tiers": { + "methods": { + "list": { + "id": "sql.tiers.list", + "path": "projects/{project}/tiers", + "httpMethod": "GET", + "description": "Lists service tiers that can be used to create Google Cloud SQL instances.", + "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/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/sqladmin/v1beta3/sqladmin-gen.go b/Godeps/_workspace/src/google.golang.org/api/sqladmin/v1beta3/sqladmin-gen.go new file mode 100644 index 000000000..c1dfbdc7d --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/sqladmin/v1beta3/sqladmin-gen.go @@ -0,0 +1,4894 @@ +// Package sqladmin provides access to the Cloud SQL Administration API. +// +// See https://cloud.google.com/sql/docs/reference/latest +// +// Usage example: +// +// import "google.golang.org/api/sqladmin/v1beta3" +// ... +// sqladminService, err := sqladmin.New(oauthHttpClient) +package sqladmin // import "google.golang.org/api/sqladmin/v1beta3" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + BackupRuns *BackupRunsService + + Flags *FlagsService + + Instances *InstancesService + + Operations *OperationsService + + SslCerts *SslCertsService + + Tiers *TiersService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 +} + +// BackupConfiguration: Database instance backup configuration. +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"` + + // ForceSendFields is a list of field names (e.g. "BinaryLogEnabled") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BackupConfiguration) MarshalJSON() ([]byte, error) { + type noMethod BackupConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BackupRun: A database instance backup run resource. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BackupConfiguration") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BackupRun) MarshalJSON() ([]byte, error) { + type noMethod BackupRun + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BackupRunsListResponse: Backup run list results. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BackupRunsListResponse) MarshalJSON() ([]byte, error) { + type noMethod BackupRunsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BinLogCoordinates: Binary log coordinates. +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"` + + // ForceSendFields is a list of field names (e.g. "BinLogFileName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BinLogCoordinates) MarshalJSON() ([]byte, error) { + type noMethod BinLogCoordinates + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CloneContext: Database instance clone context. +type CloneContext struct { + // BinLogCoordinates: Binary log coordinates, if specified, indentify + // 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 coordinates. + 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"` + + // ForceSendFields is a list of field names (e.g. "BinLogCoordinates") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CloneContext) MarshalJSON() ([]byte, error) { + type noMethod CloneContext + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DatabaseFlags: MySQL flags for Cloud SQL instances. +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. + // For more information, see Configuring MySQL Flags in the Google Cloud + // SQL documentation, as well as the official MySQL documentation for + // server options and system variables. + Name string `json:"name,omitempty"` + + // Value: The value of the flag. Booleans should be set to on for true + // and off for false. This field must be omitted if the flag doesn't + // take a value. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DatabaseFlags) MarshalJSON() ([]byte, error) { + type noMethod DatabaseFlags + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DatabaseInstance: A Cloud SQL instance resource. +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. Can be + // MYSQL_5_5 or MYSQL_5_6. Defaults to MYSQL_5_5. The databaseVersion + // cannot be changed after instance creation. + 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"` + + // InstanceType: The instance type. This can be one of the + // following. + // CLOUD_SQL_INSTANCE: Regular Cloud SQL + // instance. + // READ_REPLICA_INSTANCE: Cloud SQL instance acting as a read-replica. + InstanceType string `json:"instanceType,omitempty"` + + // IpAddresses: The assigned IP addresses for the instance. + IpAddresses []*IpMapping `json:"ipAddresses,omitempty"` + + // Ipv6Address: The IPv6 address assigned to the instance. + Ipv6Address string `json:"ipv6Address,omitempty"` + + // Kind: This is always sql#instance. + Kind string `json:"kind,omitempty"` + + // MasterInstanceName: The name of the instance which will act as master + // in the replication setup. + MasterInstanceName string `json:"masterInstanceName,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-central, asia-east1 or + // europe-west1. Defaults to us-central. The region can not be changed + // after instance creation. + Region string `json:"region,omitempty"` + + // ReplicaNames: The replicas of the instance. + ReplicaNames []string `json:"replicaNames,omitempty"` + + // ServerCaCert: SSL configuration. + ServerCaCert *SslCert `json:"serverCaCert,omitempty"` + + // ServiceAccountEmailAddress: The service account email address + // assigned to the instance. + ServiceAccountEmailAddress string `json:"serviceAccountEmailAddress,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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CurrentDiskSize") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DatabaseInstance) MarshalJSON() ([]byte, error) { + type noMethod DatabaseInstance + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ExportContext: Database instance export context. +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"` + + // ForceSendFields is a list of field names (e.g. "Database") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ExportContext) MarshalJSON() ([]byte, error) { + type noMethod ExportContext + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Flag: A Google Cloud SQL service flag resource. +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"` + + // ForceSendFields is a list of field names (e.g. "AllowedStringValues") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Flag) MarshalJSON() ([]byte, error) { + type noMethod Flag + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FlagsListResponse: Flags list response. +type FlagsListResponse struct { + // Items: List of flags. + Items []*Flag `json:"items,omitempty"` + + // Kind: This is always sql#flagsList. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FlagsListResponse) MarshalJSON() ([]byte, error) { + type noMethod FlagsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ImportContext: Database instance import context. +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"` + + // ForceSendFields is a list of field names (e.g. "Database") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ImportContext) MarshalJSON() ([]byte, error) { + type noMethod ImportContext + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceOperation: 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. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "EndTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceOperation) MarshalJSON() ([]byte, error) { + type noMethod InstanceOperation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceSetRootPasswordRequest: Database instance set root password +// request. +type InstanceSetRootPasswordRequest struct { + // SetRootPasswordContext: Set Root Password Context. + SetRootPasswordContext *SetRootPasswordContext `json:"setRootPasswordContext,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "SetRootPasswordContext") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceSetRootPasswordRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceSetRootPasswordRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstancesCloneRequest: Database instance clone request. +type InstancesCloneRequest struct { + // CloneContext: Contains details about the clone operation. + CloneContext *CloneContext `json:"cloneContext,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CloneContext") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesCloneRequest) MarshalJSON() ([]byte, error) { + type noMethod InstancesCloneRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstancesCloneResponse: Database instance clone response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesCloneResponse) MarshalJSON() ([]byte, error) { + type noMethod InstancesCloneResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstancesDeleteResponse: Database instance delete response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesDeleteResponse) MarshalJSON() ([]byte, error) { + type noMethod InstancesDeleteResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstancesExportRequest: Database instance export request. +type InstancesExportRequest struct { + // ExportContext: Contains details about the export operation. + ExportContext *ExportContext `json:"exportContext,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ExportContext") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesExportRequest) MarshalJSON() ([]byte, error) { + type noMethod InstancesExportRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstancesExportResponse: Database instance export response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesExportResponse) MarshalJSON() ([]byte, error) { + type noMethod InstancesExportResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstancesImportRequest: Database instance import request. +type InstancesImportRequest struct { + // ImportContext: Contains details about the import operation. + ImportContext *ImportContext `json:"importContext,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ImportContext") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesImportRequest) MarshalJSON() ([]byte, error) { + type noMethod InstancesImportRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstancesImportResponse: Database instance import response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesImportResponse) MarshalJSON() ([]byte, error) { + type noMethod InstancesImportResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstancesInsertResponse: Database instance insert response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesInsertResponse) MarshalJSON() ([]byte, error) { + type noMethod InstancesInsertResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstancesListResponse: Database instances list response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesListResponse) MarshalJSON() ([]byte, error) { + type noMethod InstancesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstancesPromoteReplicaResponse: Database promote read replica +// response. +type InstancesPromoteReplicaResponse struct { + // Kind: This is always sql#instancesPromoteReplica. + 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesPromoteReplicaResponse) MarshalJSON() ([]byte, error) { + type noMethod InstancesPromoteReplicaResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstancesResetSslConfigResponse: Database instance resetSslConfig +// response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesResetSslConfigResponse) MarshalJSON() ([]byte, error) { + type noMethod InstancesResetSslConfigResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstancesRestartResponse: Database instance restart response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesRestartResponse) MarshalJSON() ([]byte, error) { + type noMethod InstancesRestartResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstancesRestoreBackupResponse: Database instance restore backup +// response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesRestoreBackupResponse) MarshalJSON() ([]byte, error) { + type noMethod InstancesRestoreBackupResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstancesSetRootPasswordResponse: Database instance set root password +// response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesSetRootPasswordResponse) MarshalJSON() ([]byte, error) { + type noMethod InstancesSetRootPasswordResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstancesUpdateResponse: Database instance update response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesUpdateResponse) MarshalJSON() ([]byte, error) { + type noMethod InstancesUpdateResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// IpConfiguration: IP Management configuration. +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"` + + // Kind: This is always sql#ipConfiguration. + Kind string `json:"kind,omitempty"` + + // RequireSsl: Whether the mysqld should default to 'REQUIRE X509' for + // users connecting over IP. + RequireSsl bool `json:"requireSsl,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AuthorizedNetworks") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *IpConfiguration) MarshalJSON() ([]byte, error) { + type noMethod IpConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// IpMapping: Database instance IP Mapping. +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"` + + // ForceSendFields is a list of field names (e.g. "IpAddress") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *IpMapping) MarshalJSON() ([]byte, error) { + type noMethod IpMapping + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LocationPreference: 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. +type LocationPreference struct { + // FollowGaeApplication: The App Engine 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"` + + // ForceSendFields is a list of field names (e.g. + // "FollowGaeApplication") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LocationPreference) MarshalJSON() ([]byte, error) { + type noMethod LocationPreference + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationError: Database instance operation error. +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"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationError) MarshalJSON() ([]byte, error) { + type noMethod OperationError + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationsListResponse: Database instance list operations response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationsListResponse) MarshalJSON() ([]byte, error) { + type noMethod OperationsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SetRootPasswordContext: Database instance set root password context. +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"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SetRootPasswordContext) MarshalJSON() ([]byte, error) { + type noMethod SetRootPasswordContext + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Settings: Database instance settings. +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 App Engine 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"` + + // DatabaseReplicationEnabled: Configuration specific to read replica + // instance. Indicates whether replication is enabled or not. + DatabaseReplicationEnabled bool `json:"databaseReplicationEnabled,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 App Engine + // app or GCE zone for better performance. + 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"` + + // ForceSendFields is a list of field names (e.g. "ActivationPolicy") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Settings) MarshalJSON() ([]byte, error) { + type noMethod Settings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SslCert: SslCerts Resource +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Cert") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SslCert) MarshalJSON() ([]byte, error) { + type noMethod SslCert + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SslCertDetail: SslCertDetail. +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"` + + // ForceSendFields is a list of field names (e.g. "CertInfo") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SslCertDetail) MarshalJSON() ([]byte, error) { + type noMethod SslCertDetail + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SslCertsDeleteResponse: SslCert delete response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SslCertsDeleteResponse) MarshalJSON() ([]byte, error) { + type noMethod SslCertsDeleteResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SslCertsInsertRequest: SslCerts insert request. +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"` + + // ForceSendFields is a list of field names (e.g. "CommonName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SslCertsInsertRequest) MarshalJSON() ([]byte, error) { + type noMethod SslCertsInsertRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SslCertsInsertResponse: SslCert insert response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ClientCert") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SslCertsInsertResponse) MarshalJSON() ([]byte, error) { + type noMethod SslCertsInsertResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SslCertsListResponse: SslCerts list response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SslCertsListResponse) MarshalJSON() ([]byte, error) { + type noMethod SslCertsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Tier: A Google Cloud SQL service tier resource. +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"` + + // ForceSendFields is a list of field names (e.g. "DiskQuota") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Tier) MarshalJSON() ([]byte, error) { + type noMethod Tier + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TiersListResponse: Tiers list response. +type TiersListResponse struct { + // Items: List of tiers. + Items []*Tier `json:"items,omitempty"` + + // Kind: This is always sql#tiersList. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TiersListResponse) MarshalJSON() ([]byte, error) { + type noMethod TiersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "sql.backupRuns.get": + +type BackupRunsGetCall struct { + s *Service + project string + instance string + backupConfiguration string + dueTime string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves information about a specified backup run for a Cloud +// SQL instance. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BackupRunsGetCall) Fields(s ...googleapi.Field) *BackupRunsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BackupRunsGetCall) IfNoneMatch(entityTag string) *BackupRunsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BackupRunsGetCall) Context(ctx context.Context) *BackupRunsGetCall { + c.ctx_ = ctx + return c +} + +func (c *BackupRunsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("dueTime", fmt.Sprintf("%v", c.dueTime)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/backupRuns/{backupConfiguration}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + "backupConfiguration": c.backupConfiguration, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.backupRuns.get" call. +// Exactly one of *BackupRun or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *BackupRun.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *BackupRunsGetCall) Do() (*BackupRun, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BackupRun{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves information about a specified backup run for a Cloud SQL instance.", + // "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 start time of the four-hour backup window. The backup can occur any time in the window. The time is 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// List: Lists all backup runs associated with a Cloud SQL instance. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BackupRunsListCall) Fields(s ...googleapi.Field) *BackupRunsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BackupRunsListCall) IfNoneMatch(entityTag string) *BackupRunsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BackupRunsListCall) Context(ctx context.Context) *BackupRunsListCall { + c.ctx_ = ctx + return c +} + +func (c *BackupRunsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/backupRuns") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.backupRuns.list" call. +// Exactly one of *BackupRunsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BackupRunsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BackupRunsListCall) Do() (*BackupRunsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BackupRunsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all backup runs associated with a Cloud SQL instance.", + // "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/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.flags.list": + +type FlagsListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all database flags that can be set for Google Cloud SQL +// instances. +func (r *FlagsService) List() *FlagsListCall { + c := &FlagsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FlagsListCall) Fields(s ...googleapi.Field) *FlagsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FlagsListCall) IfNoneMatch(entityTag string) *FlagsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FlagsListCall) Context(ctx context.Context) *FlagsListCall { + c.ctx_ = ctx + return c +} + +func (c *FlagsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "flags") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.flags.list" call. +// Exactly one of *FlagsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FlagsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FlagsListCall) Do() (*FlagsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FlagsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all database flags that can be set for Google Cloud SQL instances.", + // "httpMethod": "GET", + // "id": "sql.flags.list", + // "path": "flags", + // "response": { + // "$ref": "FlagsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Clone: Creates a Cloud SQL instance as a clone of a 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesCloneCall) Fields(s ...googleapi.Field) *InstancesCloneCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesCloneCall) Context(ctx context.Context) *InstancesCloneCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesCloneCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/clone") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.clone" call. +// Exactly one of *InstancesCloneResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *InstancesCloneResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstancesCloneCall) Do() (*InstancesCloneResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstancesCloneResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a Cloud SQL instance as a clone of a 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.delete" call. +// Exactly one of *InstancesDeleteResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *InstancesDeleteResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstancesDeleteCall) Do() (*InstancesDeleteResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstancesDeleteResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesExportCall) Fields(s ...googleapi.Field) *InstancesExportCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesExportCall) Context(ctx context.Context) *InstancesExportCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesExportCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/export") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.export" call. +// Exactly one of *InstancesExportResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *InstancesExportResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstancesExportCall) Do() (*InstancesExportResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstancesExportResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// Get: Retrieves 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.get" call. +// Exactly one of *DatabaseInstance or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DatabaseInstance.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstancesGetCall) Do() (*DatabaseInstance, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DatabaseInstance{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Import: Imports data into a Cloud SQL instance from a MySQL dump file +// stored in a Google Cloud Storage bucket. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesImportCall) Fields(s ...googleapi.Field) *InstancesImportCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesImportCall) Context(ctx context.Context) *InstancesImportCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesImportCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/import") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.import" call. +// Exactly one of *InstancesImportResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *InstancesImportResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstancesImportCall) Do() (*InstancesImportResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstancesImportResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Imports data into a Cloud SQL instance from a MySQL dump file stored in a Google Cloud Storage bucket.", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.insert" call. +// Exactly one of *InstancesInsertResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *InstancesInsertResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstancesInsertCall) Do() (*InstancesInsertResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstancesInsertResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.list": + +type InstancesListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists instances for a given project, in alphabetical order by +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.list" call. +// Exactly one of *InstancesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *InstancesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstancesListCall) Do() (*InstancesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstancesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists instances for a given project, in alphabetical order by 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Patch: Updates the settings of a Cloud SQL instance. 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesPatchCall) Fields(s ...googleapi.Field) *InstancesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesPatchCall) Context(ctx context.Context) *InstancesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.patch" call. +// Exactly one of *InstancesUpdateResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *InstancesUpdateResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstancesPatchCall) Do() (*InstancesUpdateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstancesUpdateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the settings of a Cloud SQL instance. 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/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.promoteReplica": + +type InstancesPromoteReplicaCall struct { + s *Service + project string + instance string + opt_ map[string]interface{} + ctx_ context.Context +} + +// PromoteReplica: Promotes the read replica instance to be a +// stand-alone Cloud SQL instance. +func (r *InstancesService) PromoteReplica(project string, instance string) *InstancesPromoteReplicaCall { + c := &InstancesPromoteReplicaCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesPromoteReplicaCall) Fields(s ...googleapi.Field) *InstancesPromoteReplicaCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesPromoteReplicaCall) Context(ctx context.Context) *InstancesPromoteReplicaCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesPromoteReplicaCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/promoteReplica") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.promoteReplica" call. +// Exactly one of *InstancesPromoteReplicaResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *InstancesPromoteReplicaResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstancesPromoteReplicaCall) Do() (*InstancesPromoteReplicaResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstancesPromoteReplicaResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Promotes the read replica instance to be a stand-alone Cloud SQL instance.", + // "httpMethod": "POST", + // "id": "sql.instances.promoteReplica", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL read replica instance name.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "ID of the project that contains the read replica.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/promoteReplica", + // "response": { + // "$ref": "InstancesPromoteReplicaResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "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{} + ctx_ context.Context +} + +// ResetSslConfig: Deletes all client certificates and generates a new +// server SSL certificate for a Cloud SQL instance. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesResetSslConfigCall) Fields(s ...googleapi.Field) *InstancesResetSslConfigCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesResetSslConfigCall) Context(ctx context.Context) *InstancesResetSslConfigCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesResetSslConfigCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/resetSslConfig") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.resetSslConfig" call. +// Exactly one of *InstancesResetSslConfigResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *InstancesResetSslConfigResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstancesResetSslConfigCall) Do() (*InstancesResetSslConfigResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstancesResetSslConfigResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes all client certificates and generates a new server SSL certificate for a Cloud SQL instance.", + // "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesRestartCall) Fields(s ...googleapi.Field) *InstancesRestartCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesRestartCall) Context(ctx context.Context) *InstancesRestartCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesRestartCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/restart") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.restart" call. +// Exactly one of *InstancesRestartResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *InstancesRestartResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstancesRestartCall) Do() (*InstancesRestartResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstancesRestartResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesRestoreBackupCall) Fields(s ...googleapi.Field) *InstancesRestoreBackupCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesRestoreBackupCall) Context(ctx context.Context) *InstancesRestoreBackupCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesRestoreBackupCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("backupConfiguration", fmt.Sprintf("%v", c.backupConfigurationid)) + params.Set("dueTime", fmt.Sprintf("%v", c.dueTime)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/restoreBackup") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.restoreBackup" call. +// Exactly one of *InstancesRestoreBackupResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *InstancesRestoreBackupResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstancesRestoreBackupCall) Do() (*InstancesRestoreBackupResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstancesRestoreBackupResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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 start time of the four-hour backup window. The backup can occur any time in the window. The time is 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// SetRootPassword: Sets the password for the root user of the specified +// Cloud SQL instance. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesSetRootPasswordCall) Fields(s ...googleapi.Field) *InstancesSetRootPasswordCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesSetRootPasswordCall) Context(ctx context.Context) *InstancesSetRootPasswordCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesSetRootPasswordCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/setRootPassword") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.setRootPassword" call. +// Exactly one of *InstancesSetRootPasswordResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *InstancesSetRootPasswordResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstancesSetRootPasswordCall) Do() (*InstancesSetRootPasswordResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstancesSetRootPasswordResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the password for the root user of the specified Cloud SQL instance.", + // "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Update: Updates the settings of a Cloud SQL instance. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesUpdateCall) Fields(s ...googleapi.Field) *InstancesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesUpdateCall) Context(ctx context.Context) *InstancesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.update" call. +// Exactly one of *InstancesUpdateResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *InstancesUpdateResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstancesUpdateCall) Do() (*InstancesUpdateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstancesUpdateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the settings of a Cloud SQL instance.", + // "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Retrieves information about a specific operation that was +// performed on a Cloud SQL 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.operations.get" call. +// Exactly one of *InstanceOperation or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *InstanceOperation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OperationsGetCall) Do() (*InstanceOperation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstanceOperation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves information about a specific operation that was performed on a Cloud SQL 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// List: Lists all operations that have been performed on a Cloud SQL +// instance. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.operations.list" call. +// Exactly one of *OperationsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *OperationsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OperationsListCall) Do() (*OperationsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperationsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all operations that have been performed on a Cloud SQL instance.", + // "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes an SSL certificate from a Cloud SQL instance. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SslCertsDeleteCall) Fields(s ...googleapi.Field) *SslCertsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SslCertsDeleteCall) Context(ctx context.Context) *SslCertsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *SslCertsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + "sha1Fingerprint": c.sha1Fingerprint, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.sslCerts.delete" call. +// Exactly one of *SslCertsDeleteResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SslCertsDeleteResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SslCertsDeleteCall) Do() (*SslCertsDeleteResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SslCertsDeleteResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes an SSL certificate from a Cloud SQL instance.", + // "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Retrieves an SSL certificate as specified by its SHA-1 +// fingerprint. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SslCertsGetCall) Fields(s ...googleapi.Field) *SslCertsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SslCertsGetCall) IfNoneMatch(entityTag string) *SslCertsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SslCertsGetCall) Context(ctx context.Context) *SslCertsGetCall { + c.ctx_ = ctx + return c +} + +func (c *SslCertsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + "sha1Fingerprint": c.sha1Fingerprint, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.sslCerts.get" call. +// Exactly one of *SslCert or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *SslCert.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *SslCertsGetCall) Do() (*SslCert, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SslCert{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves an SSL certificate as specified by its SHA-1 fingerprint.", + // "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Insert: Creates an SSL certificate and returns the certificate, the +// associated private key, and the server certificate authority. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SslCertsInsertCall) Fields(s ...googleapi.Field) *SslCertsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SslCertsInsertCall) Context(ctx context.Context) *SslCertsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *SslCertsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.sslCerts.insert" call. +// Exactly one of *SslCertsInsertResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SslCertsInsertResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SslCertsInsertCall) Do() (*SslCertsInsertResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SslCertsInsertResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an SSL certificate and returns the certificate, the associated private key, and the server certificate authority.", + // "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// List: Lists all of the current SSL certificates defined for a Cloud +// SQL 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SslCertsListCall) Fields(s ...googleapi.Field) *SslCertsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SslCertsListCall) IfNoneMatch(entityTag string) *SslCertsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SslCertsListCall) Context(ctx context.Context) *SslCertsListCall { + c.ctx_ = ctx + return c +} + +func (c *SslCertsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.sslCerts.list" call. +// Exactly one of *SslCertsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SslCertsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SslCertsListCall) Do() (*SslCertsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SslCertsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all of the current SSL certificates defined for a Cloud SQL 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/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.tiers.list": + +type TiersListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists service tiers that can be used to create Google Cloud SQL +// instances. +func (r *TiersService) List(project string) *TiersListCall { + c := &TiersListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TiersListCall) Fields(s ...googleapi.Field) *TiersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TiersListCall) IfNoneMatch(entityTag string) *TiersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TiersListCall) Context(ctx context.Context) *TiersListCall { + c.ctx_ = ctx + return c +} + +func (c *TiersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/tiers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.tiers.list" call. +// Exactly one of *TiersListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TiersListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TiersListCall) Do() (*TiersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TiersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists service tiers that can be used to create Google Cloud SQL instances.", + // "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/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/sqladmin/v1beta4/sqladmin-api.json b/Godeps/_workspace/src/google.golang.org/api/sqladmin/v1beta4/sqladmin-api.json new file mode 100644 index 000000000..d3b835946 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/sqladmin/v1beta4/sqladmin-api.json @@ -0,0 +1,2658 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/dmM5e1LsyAJYfrXQoy2C4h3tVuA\"", + "discoveryVersion": "v1", + "id": "sqladmin:v1beta4", + "name": "sqladmin", + "canonicalName": "SQL Admin", + "version": "v1beta4", + "revision": "20151013", + "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://cloud.google.com/sql/docs/reference/latest", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/sql/v1beta4/", + "basePath": "/sql/v1beta4/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "sql/v1beta4/", + "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": { + "AclEntry": { + "id": "AclEntry", + "type": "object", + "description": "An entry for an Access Control list.", + "properties": { + "expirationTime": { + "type": "string", + "description": "The time when this access control entry expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.", + "format": "date-time" + }, + "kind": { + "type": "string", + "description": "This is always sql#aclEntry.", + "default": "sql#aclEntry" + }, + "name": { + "type": "string", + "description": "An optional label to identify this entry." + }, + "value": { + "type": "string", + "description": "The whitelisted value for the access control list." + } + } + }, + "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." + }, + "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": { + "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." + }, + "id": { + "type": "string", + "description": "A unique identifier for this backup run. Note that this is unique only within the scope of a particular Cloud SQL instance.", + "format": "int64" + }, + "instance": { + "type": "string", + "description": "Name of the database instance." + }, + "kind": { + "type": "string", + "description": "This is always sql#backupRun.", + "default": "sql#backupRun" + }, + "selfLink": { + "type": "string", + "description": "The URI of this resource." + }, + "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." + }, + "windowStartTime": { + "type": "string", + "description": "The start time of the backup window during which this the backup was attempted in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.", + "format": "date-time" + } + } + }, + "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" + } + } + }, + "Database": { + "id": "Database", + "type": "object", + "description": "A database resource inside a Cloud SQL instance.", + "properties": { + "charset": { + "type": "string", + "description": "The MySQL charset value." + }, + "collation": { + "type": "string", + "description": "The MySQL collation value." + }, + "etag": { + "type": "string", + "description": "HTTP 1.1 Entity tag for the resource." + }, + "instance": { + "type": "string", + "description": "The name of the Cloud SQL instance. This does not include the project ID.", + "annotations": { + "required": [ + "sql.databases.insert" + ] + } + }, + "kind": { + "type": "string", + "description": "This is always sql#database.", + "default": "sql#database" + }, + "name": { + "type": "string", + "description": "The name of the database in the Cloud SQL instance. This does not include the project ID or instance name.", + "annotations": { + "required": [ + "sql.databases.insert" + ] + } + }, + "project": { + "type": "string", + "description": "The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable.", + "annotations": { + "required": [ + "sql.databases.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "The URI of this resource." + } + } + }, + "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. For more information, see Configuring MySQL Flags in the Google Cloud SQL documentation, as well as the official MySQL documentation for server options and system variables." + }, + "value": { + "type": "string", + "description": "The value of the flag. Booleans should be set to on for true and off 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. Can be MYSQL_5_5 or MYSQL_5_6. Defaults to MYSQL_5_5. The databaseVersion can not be changed after instance creation." + }, + "etag": { + "type": "string", + "description": "HTTP 1.1 Entity tag for the resource." + }, + "instanceType": { + "type": "string", + "description": "The instance type. This can be one of the following.\nCLOUD_SQL_INSTANCE: A Cloud SQL instance that is not replicating from a master.\nON_PREMISES_INSTANCE: An instance running on the customer's premises.\nREAD_REPLICA_INSTANCE: A Cloud SQL instance configured as a read-replica." + }, + "ipAddresses": { + "type": "array", + "description": "The assigned IP addresses for the instance.", + "items": { + "$ref": "IpMapping" + } + }, + "ipv6Address": { + "type": "string", + "description": "The IPv6 address assigned to the instance." + }, + "kind": { + "type": "string", + "description": "This is always sql#instance.", + "default": "sql#instance" + }, + "masterInstanceName": { + "type": "string", + "description": "The name of the instance which will act as master in the replication setup." + }, + "maxDiskSize": { + "type": "string", + "description": "The maximum disk size of the instance in bytes.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "Name of the Cloud SQL instance. This does not include the project ID.", + "annotations": { + "required": [ + "sql.instances.insert" + ] + } + }, + "onPremisesConfiguration": { + "$ref": "OnPremisesConfiguration", + "description": "Configuration specific to on-premises instances." + }, + "project": { + "type": "string", + "description": "The project ID of the project containing the Cloud SQL instance. The Google apps domain is prefixed if applicable." + }, + "region": { + "type": "string", + "description": "The geographical region. Can be us-central, asia-east1 or europe-west1. Defaults to us-central. The region can not be changed after instance creation." + }, + "replicaConfiguration": { + "$ref": "ReplicaConfiguration", + "description": "Configuration specific to read-replicas replicating from on-premises masters." + }, + "replicaNames": { + "type": "array", + "description": "The replicas of the instance.", + "items": { + "type": "string" + } + }, + "selfLink": { + "type": "string", + "description": "The URI of this resource." + }, + "serverCaCert": { + "$ref": "SslCert", + "description": "SSL configuration." + }, + "serviceAccountEmailAddress": { + "type": "string", + "description": "The service account email address assigned to the instance." + }, + "settings": { + "$ref": "Settings", + "description": "The user settings.", + "annotations": { + "required": [ + "sql.instances.insert", + "sql.instances.update" + ] + } + }, + "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.\nFAILED: The instance creation failed.\nUNKNOWN_STATE: The state of the instance is unknown." + } + } + }, + "DatabasesListResponse": { + "id": "DatabasesListResponse", + "type": "object", + "description": "Database list response.", + "properties": { + "items": { + "type": "array", + "description": "List of database resources in the instance.", + "items": { + "$ref": "Database" + } + }, + "kind": { + "type": "string", + "description": "This is always sql#databasesList.", + "default": "sql#databasesList" + } + } + }, + "ExportContext": { + "id": "ExportContext", + "type": "object", + "description": "Database instance export context.", + "properties": { + "csvExportOptions": { + "type": "object", + "description": "Options for exporting data as CSV.", + "properties": { + "selectQuery": { + "type": "string", + "description": "The select query used to extract the data." + } + } + }, + "databases": { + "type": "array", + "description": "Databases (for example, guestbook) from which the export is made. If fileType is SQL and no database is specified, all databases are exported. If fileType is CSV, you can optionally specify at most one database to export. If csvExportOptions.selectQuery also specifies the database, this field will be ignored.", + "items": { + "type": "string" + } + }, + "fileType": { + "type": "string", + "description": "The file type for the specified uri.\nSQL: The file contains SQL statements.\nCSV: The file contains CSV data." + }, + "kind": { + "type": "string", + "description": "This is always sql#exportContext.", + "default": "sql#exportContext" + }, + "sqlExportOptions": { + "type": "object", + "description": "Options for exporting data as SQL statements.", + "properties": { + "schemaOnly": { + "type": "boolean", + "description": "Export only schemas." + }, + "tables": { + "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. The URI is in the form gs://bucketName/fileName. If the file already exists, the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed." + } + } + }, + "FailoverContext": { + "id": "FailoverContext", + "type": "object", + "description": "Database instance failover context.", + "properties": { + "kind": { + "type": "string", + "description": "This is always sql#failoverContext.", + "default": "sql#failoverContext" + }, + "settingsVersion": { + "type": "string", + "description": "The current settings version of this instance. Request will be rejected if this version doesn't match the current settings version.", + "format": "int64" + } + } + }, + "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. Can be MYSQL_5_5, MYSQL_5_6, or both.", + "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": { + "csvImportOptions": { + "type": "object", + "description": "Options for importing data as CSV.", + "properties": { + "columns": { + "type": "array", + "description": "The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.", + "items": { + "type": "string" + } + }, + "table": { + "type": "string", + "description": "The table to which CSV data is imported." + } + } + }, + "database": { + "type": "string", + "description": "The database (for example, guestbook) to which the import is made. If fileType is SQL and no database is specified, it is assumed that the database is specified in the file to be imported. If fileType is CSV, it must be specified." + }, + "fileType": { + "type": "string", + "description": "The file type for the specified uri.\nSQL: The file contains SQL statements.\nCSV: The file contains CSV data." + }, + "kind": { + "type": "string", + "description": "This is always sql#importContext.", + "default": "sql#importContext" + }, + "uri": { + "type": "string", + "description": "A path to the 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 supported when fileType is SQL." + } + } + }, + "InstancesCloneRequest": { + "id": "InstancesCloneRequest", + "type": "object", + "description": "Database instance clone request.", + "properties": { + "cloneContext": { + "$ref": "CloneContext", + "description": "Contains details about the clone operation." + } + } + }, + "InstancesExportRequest": { + "id": "InstancesExportRequest", + "type": "object", + "description": "Database instance export request.", + "properties": { + "exportContext": { + "$ref": "ExportContext", + "description": "Contains details about the export operation." + } + } + }, + "InstancesFailoverRequest": { + "id": "InstancesFailoverRequest", + "type": "object", + "description": "Instance failover request.", + "properties": { + "failoverContext": { + "$ref": "FailoverContext", + "description": "Failover Context." + } + } + }, + "InstancesImportRequest": { + "id": "InstancesImportRequest", + "type": "object", + "description": "Database instance import request.", + "properties": { + "importContext": { + "$ref": "ImportContext", + "description": "Contains details about the import 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." + } + } + }, + "InstancesRestoreBackupRequest": { + "id": "InstancesRestoreBackupRequest", + "type": "object", + "description": "Database instance restore backup request.", + "properties": { + "restoreBackupContext": { + "$ref": "RestoreBackupContext", + "description": "Parameters required to perform the restore backup 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": { + "$ref": "AclEntry" + } + }, + "ipv4Enabled": { + "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.)." + } + } + }, + "MySqlReplicaConfiguration": { + "id": "MySqlReplicaConfiguration", + "type": "object", + "description": "Read-replica configuration specific to MySQL databases.", + "properties": { + "caCertificate": { + "type": "string", + "description": "PEM representation of the trusted CA's x509 certificate." + }, + "clientCertificate": { + "type": "string", + "description": "PEM representation of the slave's x509 certificate." + }, + "clientKey": { + "type": "string", + "description": "PEM representation of the slave's private key. The corresponsing public key is encoded in the client's certificate." + }, + "connectRetryInterval": { + "type": "integer", + "description": "Seconds to wait between connect retries. MySQL's default is 60 seconds.", + "format": "int32" + }, + "dumpFilePath": { + "type": "string", + "description": "Path to a SQL dump file in Google Cloud Storage from which the slave instance is to be created. The URI is in the form gs://bucketName/fileName. Compressed gzip files (.gz) are also supported. Dumps should have the binlog co-ordinates from which replication should begin. This can be accomplished by setting --master-data to 1 when using mysqldump." + }, + "kind": { + "type": "string", + "description": "This is always sql#mysqlReplicaConfiguration.", + "default": "sql#mysqlReplicaConfiguration" + }, + "masterHeartbeatPeriod": { + "type": "string", + "description": "Interval in milliseconds between replication heartbeats.", + "format": "int64" + }, + "password": { + "type": "string", + "description": "The password for the replication connection." + }, + "sslCipher": { + "type": "string", + "description": "A list of permissible ciphers to use for SSL encryption." + }, + "username": { + "type": "string", + "description": "The username for the replication connection." + }, + "verifyServerCertificate": { + "type": "boolean", + "description": "Whether or not to check the master's Common Name value in the certificate that it sends during the SSL handshake." + } + } + }, + "OnPremisesConfiguration": { + "id": "OnPremisesConfiguration", + "type": "object", + "description": "On-premises instance configuration.", + "properties": { + "hostPort": { + "type": "string", + "description": "The host and port of the on-premises instance in host:port format" + }, + "kind": { + "type": "string", + "description": "This is always sql#onPremisesConfiguration.", + "default": "sql#onPremisesConfiguration" + } + } + }, + "Operation": { + "id": "Operation", + "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" + }, + "error": { + "$ref": "OperationErrors", + "description": "If errors occurred during processing of this operation, this field will be populated." + }, + "exportContext": { + "$ref": "ExportContext", + "description": "The context for export operation, if applicable." + }, + "importContext": { + "$ref": "ImportContext", + "description": "The context for import operation, if applicable." + }, + "insertTime": { + "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" + }, + "kind": { + "type": "string", + "description": "This is always sql#operation.", + "default": "sql#operation" + }, + "name": { + "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, CREATE_USER, DELETE_USER, CREATE_DATABASE, DELETE_DATABASE ." + }, + "selfLink": { + "type": "string", + "description": "The URI of this resource." + }, + "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" + }, + "status": { + "type": "string", + "description": "The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN." + }, + "targetId": { + "type": "string", + "description": "Name of the database instance related to this operation." + }, + "targetLink": { + "type": "string", + "description": "The URI of the instance related to the operation." + }, + "targetProject": { + "type": "string", + "description": "The project ID of the target instance related to this operation." + }, + "user": { + "type": "string", + "description": "The email address of the user who initiated this 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" + }, + "message": { + "type": "string", + "description": "Additional information about the error encountered." + } + } + }, + "OperationErrors": { + "id": "OperationErrors", + "type": "object", + "description": "Database instance operation errors list wrapper.", + "properties": { + "errors": { + "type": "array", + "description": "The list of errors encountered while processing this operation.", + "items": { + "$ref": "OperationError" + } + }, + "kind": { + "type": "string", + "description": "This is always sql#operationErrors.", + "default": "sql#operationErrors" + } + } + }, + "OperationsListResponse": { + "id": "OperationsListResponse", + "type": "object", + "description": "Database instance list operations response.", + "properties": { + "items": { + "type": "array", + "description": "List of operation resources.", + "items": { + "$ref": "Operation" + } + }, + "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." + } + } + }, + "ReplicaConfiguration": { + "id": "ReplicaConfiguration", + "type": "object", + "description": "Read-replica configuration for connecting to the master.", + "properties": { + "failoverTarget": { + "type": "boolean", + "description": "Specifies if the replica is the failover target. If the field is set to true the replica will be designated as a failover replica. In case the master instance fails, the replica instance will be promoted as the new master instance.\nOnly one replica can be specified as failover target, and the replica has to be in different zone with the master instance." + }, + "kind": { + "type": "string", + "description": "This is always sql#replicaConfiguration.", + "default": "sql#replicaConfiguration" + }, + "mysqlReplicaConfiguration": { + "$ref": "MySqlReplicaConfiguration", + "description": "MySQL specific configuration when replicating from a MySQL on-premises master. Replication configuration information such as the username, password, certificates, and keys are not stored in the instance metadata. The configuration information is used only to set up the replication connection and is stored by MySQL in a file named master.info in the data directory." + } + } + }, + "RestoreBackupContext": { + "id": "RestoreBackupContext", + "type": "object", + "description": "Database instance restore from backup context.", + "properties": { + "backupRunId": { + "type": "string", + "description": "The ID of the backup run to restore from.", + "format": "int64", + "annotations": { + "required": [ + "sql.instances.restoreBackup" + ] + } + }, + "instanceId": { + "type": "string", + "description": "The ID of the instance that the backup was taken from." + }, + "kind": { + "type": "string", + "description": "This is always sql#restoreBackupContext.", + "default": "sql#restoreBackupContext" + } + } + }, + "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 App Engine app IDs that can access this instance.", + "items": { + "type": "string" + } + }, + "backupConfiguration": { + "$ref": "BackupConfiguration", + "description": "The daily backup configuration for the instance." + }, + "crashSafeReplicationEnabled": { + "type": "boolean", + "description": "Configuration specific to read replica instances. Indicates whether database flags for crash-safe replication are enabled." + }, + "dataDiskSizeGb": { + "type": "string", + "description": "The size of data disk for the performance instance, specified in GB. Setting this value for non-performance instances will result in an error.", + "format": "int64" + }, + "databaseFlags": { + "type": "array", + "description": "The database flags passed to the instance at startup.", + "items": { + "$ref": "DatabaseFlags" + } + }, + "databaseReplicationEnabled": { + "type": "boolean", + "description": "Configuration specific to read replica instances. Indicates whether replication is enabled or not." + }, + "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 App Engine app or GCE zone for better performance." + }, + "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": "The time when the certificate was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z", + "format": "date-time" + }, + "expirationTime": { + "type": "string", + "description": "The time when the certificate expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.", + "format": "date-time" + }, + "instance": { + "type": "string", + "description": "Name of the database instance." + }, + "kind": { + "type": "string", + "description": "This is always sql#sslCert.", + "default": "sql#sslCert" + }, + "selfLink": { + "type": "string", + "description": "The URI of this resource." + }, + "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." + } + } + }, + "SslCertsCreateEphemeralRequest": { + "id": "SslCertsCreateEphemeralRequest", + "type": "object", + "description": "SslCerts create ephemeral certificate request.", + "properties": { + "public_key": { + "type": "string", + "description": "PEM encoded public key to include in the signed certificate." + } + } + }, + "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" + } + } + }, + "User": { + "id": "User", + "type": "object", + "description": "A Cloud SQL user resource.", + "properties": { + "etag": { + "type": "string", + "description": "HTTP 1.1 Entity tag for the resource." + }, + "host": { + "type": "string", + "description": "The host name from which the user can connect. For insert operations, host defaults to an empty string. For update operations, host is specified as part of the request URL. The host name is not mutable with this API." + }, + "instance": { + "type": "string", + "description": "The name of the Cloud SQL instance. This does not include the project ID. Can be omitted for update since it is already specified on the URL." + }, + "kind": { + "type": "string", + "description": "This is always sql#user.", + "default": "sql#user" + }, + "name": { + "type": "string", + "description": "The name of the user in the Cloud SQL instance. Can be omitted for update since it is already specified on the URL." + }, + "password": { + "type": "string", + "description": "The password for the user." + }, + "project": { + "type": "string", + "description": "The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable. Can be omitted for update since it is already specified on the URL." + } + } + }, + "UsersListResponse": { + "id": "UsersListResponse", + "type": "object", + "description": "User list response.", + "properties": { + "items": { + "type": "array", + "description": "List of user resources in the instance.", + "items": { + "$ref": "User" + } + }, + "kind": { + "type": "string", + "description": "This is always sql#usersList.", + "default": "sql#usersList" + }, + "nextPageToken": { + "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." + } + } + } + }, + "resources": { + "backupRuns": { + "methods": { + "delete": { + "id": "sql.backupRuns.delete", + "path": "projects/{project}/instances/{instance}/backupRuns/{id}", + "httpMethod": "DELETE", + "description": "Deletes the backup taken by a backup run.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of the Backup Run to delete. To find a Backup Run ID, use the list method.", + "required": true, + "format": "int64", + "location": "path" + }, + "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", + "id" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "get": { + "id": "sql.backupRuns.get", + "path": "projects/{project}/instances/{instance}/backupRuns/{id}", + "httpMethod": "GET", + "description": "Retrieves a resource containing information about a backup run.", + "parameters": { + "id": { + "type": "string", + "description": "The ID of this Backup Run.", + "required": true, + "format": "int64", + "location": "path" + }, + "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", + "id" + ], + "response": { + "$ref": "BackupRun" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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": { + "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" + ], + "response": { + "$ref": "BackupRunsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + } + } + }, + "databases": { + "methods": { + "delete": { + "id": "sql.databases.delete", + "path": "projects/{project}/instances/{instance}/databases/{database}", + "httpMethod": "DELETE", + "description": "Deletes a resource containing information about a database inside a Cloud SQL instance.", + "parameters": { + "database": { + "type": "string", + "description": "Name of the database to be deleted in the instance.", + "required": true, + "location": "path" + }, + "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", + "database" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "get": { + "id": "sql.databases.get", + "path": "projects/{project}/instances/{instance}/databases/{database}", + "httpMethod": "GET", + "description": "Retrieves a resource containing information about a database inside a Cloud SQL instance.", + "parameters": { + "database": { + "type": "string", + "description": "Name of the database in the instance.", + "required": true, + "location": "path" + }, + "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", + "database" + ], + "response": { + "$ref": "Database" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "insert": { + "id": "sql.databases.insert", + "path": "projects/{project}/instances/{instance}/databases", + "httpMethod": "POST", + "description": "Inserts a resource containing information about a database inside 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" + ], + "request": { + "$ref": "Database" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "list": { + "id": "sql.databases.list", + "path": "projects/{project}/instances/{instance}/databases", + "httpMethod": "GET", + "description": "Lists databases in the specified 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 for which to list Cloud SQL instances.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "response": { + "$ref": "DatabasesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "patch": { + "id": "sql.databases.patch", + "path": "projects/{project}/instances/{instance}/databases/{database}", + "httpMethod": "PATCH", + "description": "Updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics.", + "parameters": { + "database": { + "type": "string", + "description": "Name of the database to be updated in the instance.", + "required": true, + "location": "path" + }, + "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", + "database" + ], + "request": { + "$ref": "Database" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "update": { + "id": "sql.databases.update", + "path": "projects/{project}/instances/{instance}/databases/{database}", + "httpMethod": "PUT", + "description": "Updates a resource containing information about a database inside a Cloud SQL instance.", + "parameters": { + "database": { + "type": "string", + "description": "Name of the database to be updated in the instance.", + "required": true, + "location": "path" + }, + "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", + "database" + ], + "request": { + "$ref": "Database" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + } + } + }, + "instances": { + "methods": { + "clone": { + "id": "sql.instances.clone", + "path": "projects/{project}/instances/{instance}/clone", + "httpMethod": "POST", + "description": "Creates a Cloud SQL instance as a clone of the source instance.", + "parameters": { + "instance": { + "type": "string", + "description": "The ID of the Cloud SQL instance to be cloned (source). This does not include the project ID.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "Project ID of the source as well as the clone Cloud SQL instance.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "request": { + "$ref": "InstancesCloneRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "failover": { + "id": "sql.instances.failover", + "path": "projects/{project}/instances/{instance}/failover", + "httpMethod": "POST", + "description": "Failover the instance to its failover replica 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": "ID of the project that contains the read replica.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "request": { + "$ref": "InstancesFailoverRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "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/cloud-platform", + "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": "Operation" + }, + "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": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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/cloud-platform", + "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": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "promoteReplica": { + "id": "sql.instances.promoteReplica", + "path": "projects/{project}/instances/{instance}/promoteReplica", + "httpMethod": "POST", + "description": "Promotes the read replica instance to be a stand-alone Cloud SQL instance.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL read replica instance name.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "ID of the project that contains the read replica.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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": { + "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": "InstancesRestoreBackupRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "startReplica": { + "id": "sql.instances.startReplica", + "path": "projects/{project}/instances/{instance}/startReplica", + "httpMethod": "POST", + "description": "Starts the replication in the read replica instance.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL read replica instance name.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "ID of the project that contains the read replica.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "stopReplica": { + "id": "sql.instances.stopReplica", + "path": "projects/{project}/instances/{instance}/stopReplica", + "httpMethod": "POST", + "description": "Stops the replication in the read replica instance.", + "parameters": { + "instance": { + "type": "string", + "description": "Cloud SQL read replica instance name.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "ID of the project that contains the read replica.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + } + } + }, + "operations": { + "methods": { + "get": { + "id": "sql.operations.get", + "path": "projects/{project}/operations/{operation}", + "httpMethod": "GET", + "description": "Retrieves an instance operation that has been performed on an instance.", + "parameters": { + "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", + "operation" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "list": { + "id": "sql.operations.list", + "path": "projects/{project}/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": "query" + }, + "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/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + } + } + }, + "sslCerts": { + "methods": { + "createEphemeral": { + "id": "sql.sslCerts.createEphemeral", + "path": "projects/{project}/instances/{instance}/createEphemeral", + "httpMethod": "POST", + "description": "Generates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certificate to authenticate as themselves when connecting to the database.", + "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 Cloud SQL project.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance" + ], + "request": { + "$ref": "SslCertsCreateEphemeralRequest" + }, + "response": { + "$ref": "SslCert" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "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": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "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/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + } + } + }, + "users": { + "methods": { + "delete": { + "id": "sql.users.delete", + "path": "projects/{project}/instances/{instance}/users", + "httpMethod": "DELETE", + "description": "Deletes a user from a Cloud SQL instance.", + "parameters": { + "host": { + "type": "string", + "description": "Host of the user in the instance.", + "required": true, + "location": "query" + }, + "instance": { + "type": "string", + "description": "Database instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "name": { + "type": "string", + "description": "Name of the user in the instance.", + "required": true, + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance", + "host", + "name" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "insert": { + "id": "sql.users.insert", + "path": "projects/{project}/instances/{instance}/users", + "httpMethod": "POST", + "description": "Creates a new user in 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" + ], + "request": { + "$ref": "User" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "list": { + "id": "sql.users.list", + "path": "projects/{project}/instances/{instance}/users", + "httpMethod": "GET", + "description": "Lists users in the specified 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": "UsersListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + }, + "update": { + "id": "sql.users.update", + "path": "projects/{project}/instances/{instance}/users", + "httpMethod": "PUT", + "description": "Updates an existing user in a Cloud SQL instance.", + "parameters": { + "host": { + "type": "string", + "description": "Host of the user in the instance.", + "required": true, + "location": "query" + }, + "instance": { + "type": "string", + "description": "Database instance ID. This does not include the project ID.", + "required": true, + "location": "path" + }, + "name": { + "type": "string", + "description": "Name of the user in the instance.", + "required": true, + "location": "query" + }, + "project": { + "type": "string", + "description": "Project ID of the project that contains the instance.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "instance", + "host", + "name" + ], + "request": { + "$ref": "User" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/sqlservice.admin" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/sqladmin/v1beta4/sqladmin-gen.go b/Godeps/_workspace/src/google.golang.org/api/sqladmin/v1beta4/sqladmin-gen.go new file mode 100644 index 000000000..cf4e14750 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/sqladmin/v1beta4/sqladmin-gen.go @@ -0,0 +1,7017 @@ +// Package sqladmin provides access to the Cloud SQL Administration API. +// +// See https://cloud.google.com/sql/docs/reference/latest +// +// Usage example: +// +// import "google.golang.org/api/sqladmin/v1beta4" +// ... +// sqladminService, err := sqladmin.New(oauthHttpClient) +package sqladmin // import "google.golang.org/api/sqladmin/v1beta4" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "sqladmin:v1beta4" +const apiName = "sqladmin" +const apiVersion = "v1beta4" +const basePath = "https://www.googleapis.com/sql/v1beta4/" + +// 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.Databases = NewDatabasesService(s) + s.Flags = NewFlagsService(s) + s.Instances = NewInstancesService(s) + s.Operations = NewOperationsService(s) + s.SslCerts = NewSslCertsService(s) + s.Tiers = NewTiersService(s) + s.Users = NewUsersService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + BackupRuns *BackupRunsService + + Databases *DatabasesService + + Flags *FlagsService + + Instances *InstancesService + + Operations *OperationsService + + SslCerts *SslCertsService + + Tiers *TiersService + + Users *UsersService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewBackupRunsService(s *Service) *BackupRunsService { + rs := &BackupRunsService{s: s} + return rs +} + +type BackupRunsService struct { + s *Service +} + +func NewDatabasesService(s *Service) *DatabasesService { + rs := &DatabasesService{s: s} + return rs +} + +type DatabasesService 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 +} + +func NewUsersService(s *Service) *UsersService { + rs := &UsersService{s: s} + return rs +} + +type UsersService struct { + s *Service +} + +// AclEntry: An entry for an Access Control list. +type AclEntry struct { + // ExpirationTime: The time when this access control entry expires in + // RFC 3339 format, for example 2012-11-15T16:19:00.094Z. + ExpirationTime string `json:"expirationTime,omitempty"` + + // Kind: This is always sql#aclEntry. + Kind string `json:"kind,omitempty"` + + // Name: An optional label to identify this entry. + Name string `json:"name,omitempty"` + + // Value: The whitelisted value for the access control list. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ExpirationTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AclEntry) MarshalJSON() ([]byte, error) { + type noMethod AclEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BackupConfiguration: Database instance backup configuration. +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"` + + // 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"` + + // ForceSendFields is a list of field names (e.g. "BinaryLogEnabled") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BackupConfiguration) MarshalJSON() ([]byte, error) { + type noMethod BackupConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BackupRun: A database instance backup run resource. +type BackupRun struct { + // 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"` + + // Id: A unique identifier for this backup run. Note that this is unique + // only within the scope of a particular Cloud SQL instance. + Id int64 `json:"id,omitempty,string"` + + // Instance: Name of the database instance. + Instance string `json:"instance,omitempty"` + + // Kind: This is always sql#backupRun. + Kind string `json:"kind,omitempty"` + + // SelfLink: The URI of this resource. + SelfLink string `json:"selfLink,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"` + + // WindowStartTime: The start time of the backup window during which + // this the backup was attempted in RFC 3339 format, for example + // 2012-11-15T16:19:00.094Z. + WindowStartTime string `json:"windowStartTime,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "EndTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BackupRun) MarshalJSON() ([]byte, error) { + type noMethod BackupRun + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BackupRunsListResponse: Backup run list results. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BackupRunsListResponse) MarshalJSON() ([]byte, error) { + type noMethod BackupRunsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BinLogCoordinates: Binary log coordinates. +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"` + + // ForceSendFields is a list of field names (e.g. "BinLogFileName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BinLogCoordinates) MarshalJSON() ([]byte, error) { + type noMethod BinLogCoordinates + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CloneContext: Database instance clone context. +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"` + + // ForceSendFields is a list of field names (e.g. "BinLogCoordinates") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CloneContext) MarshalJSON() ([]byte, error) { + type noMethod CloneContext + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Database: A database resource inside a Cloud SQL instance. +type Database struct { + // Charset: The MySQL charset value. + Charset string `json:"charset,omitempty"` + + // Collation: The MySQL collation value. + Collation string `json:"collation,omitempty"` + + // Etag: HTTP 1.1 Entity tag for the resource. + Etag string `json:"etag,omitempty"` + + // Instance: The name of the Cloud SQL instance. This does not include + // the project ID. + Instance string `json:"instance,omitempty"` + + // Kind: This is always sql#database. + Kind string `json:"kind,omitempty"` + + // Name: The name of the database in the Cloud SQL instance. This does + // not include the project ID or instance name. + Name string `json:"name,omitempty"` + + // Project: The project ID of the project containing the Cloud SQL + // database. The Google apps domain is prefixed if applicable. + Project string `json:"project,omitempty"` + + // SelfLink: The URI of this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Charset") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Database) MarshalJSON() ([]byte, error) { + type noMethod Database + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DatabaseFlags: MySQL flags for Cloud SQL instances. +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. + // For more information, see Configuring MySQL Flags in the Google Cloud + // SQL documentation, as well as the official MySQL documentation for + // server options and system variables. + Name string `json:"name,omitempty"` + + // Value: The value of the flag. Booleans should be set to on for true + // and off for false. This field must be omitted if the flag doesn't + // take a value. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DatabaseFlags) MarshalJSON() ([]byte, error) { + type noMethod DatabaseFlags + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DatabaseInstance: A Cloud SQL instance resource. +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. Can be + // MYSQL_5_5 or MYSQL_5_6. Defaults to MYSQL_5_5. The databaseVersion + // can not be changed after instance creation. + DatabaseVersion string `json:"databaseVersion,omitempty"` + + // Etag: HTTP 1.1 Entity tag for the resource. + Etag string `json:"etag,omitempty"` + + // InstanceType: The instance type. This can be one of the + // following. + // CLOUD_SQL_INSTANCE: A Cloud SQL instance that is not replicating from + // a master. + // ON_PREMISES_INSTANCE: An instance running on the customer's + // premises. + // READ_REPLICA_INSTANCE: A Cloud SQL instance configured as a + // read-replica. + InstanceType string `json:"instanceType,omitempty"` + + // IpAddresses: The assigned IP addresses for the instance. + IpAddresses []*IpMapping `json:"ipAddresses,omitempty"` + + // Ipv6Address: The IPv6 address assigned to the instance. + Ipv6Address string `json:"ipv6Address,omitempty"` + + // Kind: This is always sql#instance. + Kind string `json:"kind,omitempty"` + + // MasterInstanceName: The name of the instance which will act as master + // in the replication setup. + MasterInstanceName string `json:"masterInstanceName,omitempty"` + + // MaxDiskSize: The maximum disk size of the instance in bytes. + MaxDiskSize int64 `json:"maxDiskSize,omitempty,string"` + + // Name: Name of the Cloud SQL instance. This does not include the + // project ID. + Name string `json:"name,omitempty"` + + // OnPremisesConfiguration: Configuration specific to on-premises + // instances. + OnPremisesConfiguration *OnPremisesConfiguration `json:"onPremisesConfiguration,omitempty"` + + // 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-central, asia-east1 or + // europe-west1. Defaults to us-central. The region can not be changed + // after instance creation. + Region string `json:"region,omitempty"` + + // ReplicaConfiguration: Configuration specific to read-replicas + // replicating from on-premises masters. + ReplicaConfiguration *ReplicaConfiguration `json:"replicaConfiguration,omitempty"` + + // ReplicaNames: The replicas of the instance. + ReplicaNames []string `json:"replicaNames,omitempty"` + + // SelfLink: The URI of this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerCaCert: SSL configuration. + ServerCaCert *SslCert `json:"serverCaCert,omitempty"` + + // ServiceAccountEmailAddress: The service account email address + // assigned to the instance. + ServiceAccountEmailAddress string `json:"serviceAccountEmailAddress,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. + // FAILED: The instance creation failed. + // UNKNOWN_STATE: The state of the instance is unknown. + State string `json:"state,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CurrentDiskSize") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DatabaseInstance) MarshalJSON() ([]byte, error) { + type noMethod DatabaseInstance + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// DatabasesListResponse: Database list response. +type DatabasesListResponse struct { + // Items: List of database resources in the instance. + Items []*Database `json:"items,omitempty"` + + // Kind: This is always sql#databasesList. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DatabasesListResponse) MarshalJSON() ([]byte, error) { + type noMethod DatabasesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ExportContext: Database instance export context. +type ExportContext struct { + // CsvExportOptions: Options for exporting data as CSV. + CsvExportOptions *ExportContextCsvExportOptions `json:"csvExportOptions,omitempty"` + + // Databases: Databases (for example, guestbook) from which the export + // is made. If fileType is SQL and no database is specified, all + // databases are exported. If fileType is CSV, you can optionally + // specify at most one database to export. If + // csvExportOptions.selectQuery also specifies the database, this field + // will be ignored. + Databases []string `json:"databases,omitempty"` + + // FileType: The file type for the specified uri. + // SQL: The file contains SQL statements. + // CSV: The file contains CSV data. + FileType string `json:"fileType,omitempty"` + + // Kind: This is always sql#exportContext. + Kind string `json:"kind,omitempty"` + + // SqlExportOptions: Options for exporting data as SQL statements. + SqlExportOptions *ExportContextSqlExportOptions `json:"sqlExportOptions,omitempty"` + + // Uri: The path to the file in Google Cloud Storage where the export + // will be stored. The URI is in the form gs://bucketName/fileName. If + // the file already exists, the operation fails. If fileType is SQL and + // the filename ends with .gz, the contents are compressed. + Uri string `json:"uri,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CsvExportOptions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ExportContext) MarshalJSON() ([]byte, error) { + type noMethod ExportContext + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ExportContextCsvExportOptions: Options for exporting data as CSV. +type ExportContextCsvExportOptions struct { + // SelectQuery: The select query used to extract the data. + SelectQuery string `json:"selectQuery,omitempty"` + + // ForceSendFields is a list of field names (e.g. "SelectQuery") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ExportContextCsvExportOptions) MarshalJSON() ([]byte, error) { + type noMethod ExportContextCsvExportOptions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ExportContextSqlExportOptions: Options for exporting data as SQL +// statements. +type ExportContextSqlExportOptions struct { + // SchemaOnly: Export only schemas. + SchemaOnly bool `json:"schemaOnly,omitempty"` + + // Tables: Tables to export, or that were exported, from the specified + // database. If you specify tables, specify one and only one database. + Tables []string `json:"tables,omitempty"` + + // ForceSendFields is a list of field names (e.g. "SchemaOnly") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ExportContextSqlExportOptions) MarshalJSON() ([]byte, error) { + type noMethod ExportContextSqlExportOptions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FailoverContext: Database instance failover context. +type FailoverContext struct { + // Kind: This is always sql#failoverContext. + Kind string `json:"kind,omitempty"` + + // SettingsVersion: The current settings version of this instance. + // Request will be rejected if this version doesn't match the current + // settings version. + SettingsVersion int64 `json:"settingsVersion,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FailoverContext) MarshalJSON() ([]byte, error) { + type noMethod FailoverContext + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Flag: A Google Cloud SQL service flag resource. +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. Can be + // MYSQL_5_5, MYSQL_5_6, or both. + 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"` + + // ForceSendFields is a list of field names (e.g. "AllowedStringValues") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Flag) MarshalJSON() ([]byte, error) { + type noMethod Flag + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FlagsListResponse: Flags list response. +type FlagsListResponse struct { + // Items: List of flags. + Items []*Flag `json:"items,omitempty"` + + // Kind: This is always sql#flagsList. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FlagsListResponse) MarshalJSON() ([]byte, error) { + type noMethod FlagsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ImportContext: Database instance import context. +type ImportContext struct { + // CsvImportOptions: Options for importing data as CSV. + CsvImportOptions *ImportContextCsvImportOptions `json:"csvImportOptions,omitempty"` + + // Database: The database (for example, guestbook) to which the import + // is made. If fileType is SQL and no database is specified, it is + // assumed that the database is specified in the file to be imported. If + // fileType is CSV, it must be specified. + Database string `json:"database,omitempty"` + + // FileType: The file type for the specified uri. + // SQL: The file contains SQL statements. + // CSV: The file contains CSV data. + FileType string `json:"fileType,omitempty"` + + // Kind: This is always sql#importContext. + Kind string `json:"kind,omitempty"` + + // Uri: A path to the 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 supported when fileType is SQL. + Uri string `json:"uri,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CsvImportOptions") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ImportContext) MarshalJSON() ([]byte, error) { + type noMethod ImportContext + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ImportContextCsvImportOptions: Options for importing data as CSV. +type ImportContextCsvImportOptions struct { + // Columns: The columns to which CSV data is imported. If not specified, + // all columns of the database table are loaded with CSV data. + Columns []string `json:"columns,omitempty"` + + // Table: The table to which CSV data is imported. + Table string `json:"table,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Columns") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ImportContextCsvImportOptions) MarshalJSON() ([]byte, error) { + type noMethod ImportContextCsvImportOptions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstancesCloneRequest: Database instance clone request. +type InstancesCloneRequest struct { + // CloneContext: Contains details about the clone operation. + CloneContext *CloneContext `json:"cloneContext,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CloneContext") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesCloneRequest) MarshalJSON() ([]byte, error) { + type noMethod InstancesCloneRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstancesExportRequest: Database instance export request. +type InstancesExportRequest struct { + // ExportContext: Contains details about the export operation. + ExportContext *ExportContext `json:"exportContext,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ExportContext") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesExportRequest) MarshalJSON() ([]byte, error) { + type noMethod InstancesExportRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstancesFailoverRequest: Instance failover request. +type InstancesFailoverRequest struct { + // FailoverContext: Failover Context. + FailoverContext *FailoverContext `json:"failoverContext,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FailoverContext") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesFailoverRequest) MarshalJSON() ([]byte, error) { + type noMethod InstancesFailoverRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstancesImportRequest: Database instance import request. +type InstancesImportRequest struct { + // ImportContext: Contains details about the import operation. + ImportContext *ImportContext `json:"importContext,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ImportContext") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesImportRequest) MarshalJSON() ([]byte, error) { + type noMethod InstancesImportRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstancesListResponse: Database instances list response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesListResponse) MarshalJSON() ([]byte, error) { + type noMethod InstancesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InstancesRestoreBackupRequest: Database instance restore backup +// request. +type InstancesRestoreBackupRequest struct { + // RestoreBackupContext: Parameters required to perform the restore + // backup operation. + RestoreBackupContext *RestoreBackupContext `json:"restoreBackupContext,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "RestoreBackupContext") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesRestoreBackupRequest) MarshalJSON() ([]byte, error) { + type noMethod InstancesRestoreBackupRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// IpConfiguration: IP Management configuration. +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 []*AclEntry `json:"authorizedNetworks,omitempty"` + + // Ipv4Enabled: Whether the instance should be assigned an IP address or + // not. + Ipv4Enabled bool `json:"ipv4Enabled,omitempty"` + + // RequireSsl: Whether the mysqld should default to 'REQUIRE X509' for + // users connecting over IP. + RequireSsl bool `json:"requireSsl,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AuthorizedNetworks") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *IpConfiguration) MarshalJSON() ([]byte, error) { + type noMethod IpConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// IpMapping: Database instance IP Mapping. +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"` + + // ForceSendFields is a list of field names (e.g. "IpAddress") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *IpMapping) MarshalJSON() ([]byte, error) { + type noMethod IpMapping + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LocationPreference: 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. +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"` + + // ForceSendFields is a list of field names (e.g. + // "FollowGaeApplication") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LocationPreference) MarshalJSON() ([]byte, error) { + type noMethod LocationPreference + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MySqlReplicaConfiguration: Read-replica configuration specific to +// MySQL databases. +type MySqlReplicaConfiguration struct { + // CaCertificate: PEM representation of the trusted CA's x509 + // certificate. + CaCertificate string `json:"caCertificate,omitempty"` + + // ClientCertificate: PEM representation of the slave's x509 + // certificate. + ClientCertificate string `json:"clientCertificate,omitempty"` + + // ClientKey: PEM representation of the slave's private key. The + // corresponsing public key is encoded in the client's certificate. + ClientKey string `json:"clientKey,omitempty"` + + // ConnectRetryInterval: Seconds to wait between connect retries. + // MySQL's default is 60 seconds. + ConnectRetryInterval int64 `json:"connectRetryInterval,omitempty"` + + // DumpFilePath: Path to a SQL dump file in Google Cloud Storage from + // which the slave instance is to be created. The URI is in the form + // gs://bucketName/fileName. Compressed gzip files (.gz) are also + // supported. Dumps should have the binlog co-ordinates from which + // replication should begin. This can be accomplished by setting + // --master-data to 1 when using mysqldump. + DumpFilePath string `json:"dumpFilePath,omitempty"` + + // Kind: This is always sql#mysqlReplicaConfiguration. + Kind string `json:"kind,omitempty"` + + // MasterHeartbeatPeriod: Interval in milliseconds between replication + // heartbeats. + MasterHeartbeatPeriod int64 `json:"masterHeartbeatPeriod,omitempty,string"` + + // Password: The password for the replication connection. + Password string `json:"password,omitempty"` + + // SslCipher: A list of permissible ciphers to use for SSL encryption. + SslCipher string `json:"sslCipher,omitempty"` + + // Username: The username for the replication connection. + Username string `json:"username,omitempty"` + + // VerifyServerCertificate: Whether or not to check the master's Common + // Name value in the certificate that it sends during the SSL handshake. + VerifyServerCertificate bool `json:"verifyServerCertificate,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CaCertificate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MySqlReplicaConfiguration) MarshalJSON() ([]byte, error) { + type noMethod MySqlReplicaConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OnPremisesConfiguration: On-premises instance configuration. +type OnPremisesConfiguration struct { + // HostPort: The host and port of the on-premises instance in host:port + // format + HostPort string `json:"hostPort,omitempty"` + + // Kind: This is always sql#onPremisesConfiguration. + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "HostPort") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OnPremisesConfiguration) MarshalJSON() ([]byte, error) { + type noMethod OnPremisesConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Operation: 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. +type Operation 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"` + + // Error: If errors occurred during processing of this operation, this + // field will be populated. + Error *OperationErrors `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"` + + // InsertTime: The time this operation was enqueued in UTC timezone in + // RFC 3339 format, for example 2012-11-15T16:19:00.094Z. + InsertTime string `json:"insertTime,omitempty"` + + // Kind: This is always sql#operation. + Kind string `json:"kind,omitempty"` + + // Name: An identifier that uniquely identifies the operation. You can + // use this identifier to retrieve the Operations resource that has + // information about the operation. + Name string `json:"name,omitempty"` + + // OperationType: The type of the operation. Valid values are CREATE, + // DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, + // RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE, + // DELETE_DATABASE . + OperationType string `json:"operationType,omitempty"` + + // SelfLink: The URI of this resource. + SelfLink string `json:"selfLink,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"` + + // Status: The status of an operation. Valid values are PENDING, + // RUNNING, DONE, UNKNOWN. + Status string `json:"status,omitempty"` + + // TargetId: Name of the database instance related to this operation. + TargetId string `json:"targetId,omitempty"` + + // TargetLink: The URI of the instance related to the operation. + TargetLink string `json:"targetLink,omitempty"` + + // TargetProject: The project ID of the target instance related to this + // operation. + TargetProject string `json:"targetProject,omitempty"` + + // User: The email address of the user who initiated this operation. + User string `json:"user,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "EndTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Operation) MarshalJSON() ([]byte, error) { + type noMethod Operation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationError: Database instance operation error. +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"` + + // Message: Additional information about the error encountered. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationError) MarshalJSON() ([]byte, error) { + type noMethod OperationError + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationErrors: Database instance operation errors list wrapper. +type OperationErrors struct { + // Errors: The list of errors encountered while processing this + // operation. + Errors []*OperationError `json:"errors,omitempty"` + + // Kind: This is always sql#operationErrors. + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationErrors) MarshalJSON() ([]byte, error) { + type noMethod OperationErrors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// OperationsListResponse: Database instance list operations response. +type OperationsListResponse struct { + // Items: List of operation resources. + Items []*Operation `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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *OperationsListResponse) MarshalJSON() ([]byte, error) { + type noMethod OperationsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ReplicaConfiguration: Read-replica configuration for connecting to +// the master. +type ReplicaConfiguration struct { + // FailoverTarget: Specifies if the replica is the failover target. If + // the field is set to true the replica will be designated as a failover + // replica. In case the master instance fails, the replica instance will + // be promoted as the new master instance. + // Only one replica can be specified as failover target, and the replica + // has to be in different zone with the master instance. + FailoverTarget bool `json:"failoverTarget,omitempty"` + + // Kind: This is always sql#replicaConfiguration. + Kind string `json:"kind,omitempty"` + + // MysqlReplicaConfiguration: MySQL specific configuration when + // replicating from a MySQL on-premises master. Replication + // configuration information such as the username, password, + // certificates, and keys are not stored in the instance metadata. The + // configuration information is used only to set up the replication + // connection and is stored by MySQL in a file named master.info in the + // data directory. + MysqlReplicaConfiguration *MySqlReplicaConfiguration `json:"mysqlReplicaConfiguration,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FailoverTarget") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ReplicaConfiguration) MarshalJSON() ([]byte, error) { + type noMethod ReplicaConfiguration + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RestoreBackupContext: Database instance restore from backup context. +type RestoreBackupContext struct { + // BackupRunId: The ID of the backup run to restore from. + BackupRunId int64 `json:"backupRunId,omitempty,string"` + + // InstanceId: The ID of the instance that the backup was taken from. + InstanceId string `json:"instanceId,omitempty"` + + // Kind: This is always sql#restoreBackupContext. + Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BackupRunId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RestoreBackupContext) MarshalJSON() ([]byte, error) { + type noMethod RestoreBackupContext + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Settings: Database instance settings. +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 App Engine 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"` + + // CrashSafeReplicationEnabled: Configuration specific to read replica + // instances. Indicates whether database flags for crash-safe + // replication are enabled. + CrashSafeReplicationEnabled bool `json:"crashSafeReplicationEnabled,omitempty"` + + // DataDiskSizeGb: The size of data disk for the performance instance, + // specified in GB. Setting this value for non-performance instances + // will result in an error. + DataDiskSizeGb int64 `json:"dataDiskSizeGb,omitempty,string"` + + // DatabaseFlags: The database flags passed to the instance at startup. + DatabaseFlags []*DatabaseFlags `json:"databaseFlags,omitempty"` + + // DatabaseReplicationEnabled: Configuration specific to read replica + // instances. Indicates whether replication is enabled or not. + DatabaseReplicationEnabled bool `json:"databaseReplicationEnabled,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 App Engine + // app or GCE zone for better performance. + 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"` + + // ForceSendFields is a list of field names (e.g. "ActivationPolicy") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Settings) MarshalJSON() ([]byte, error) { + type noMethod Settings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SslCert: SslCerts Resource +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: The time when the certificate was created in RFC 3339 + // format, for example 2012-11-15T16:19:00.094Z + CreateTime string `json:"createTime,omitempty"` + + // ExpirationTime: The time when the certificate expires in RFC 3339 + // format, for example 2012-11-15T16:19:00.094Z. + 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"` + + // SelfLink: The URI of this resource. + SelfLink string `json:"selfLink,omitempty"` + + // Sha1Fingerprint: Sha1 Fingerprint. + Sha1Fingerprint string `json:"sha1Fingerprint,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Cert") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SslCert) MarshalJSON() ([]byte, error) { + type noMethod SslCert + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SslCertDetail: SslCertDetail. +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"` + + // ForceSendFields is a list of field names (e.g. "CertInfo") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SslCertDetail) MarshalJSON() ([]byte, error) { + type noMethod SslCertDetail + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SslCertsCreateEphemeralRequest: SslCerts create ephemeral certificate +// request. +type SslCertsCreateEphemeralRequest struct { + // PublicKey: PEM encoded public key to include in the signed + // certificate. + PublicKey string `json:"public_key,omitempty"` + + // ForceSendFields is a list of field names (e.g. "PublicKey") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SslCertsCreateEphemeralRequest) MarshalJSON() ([]byte, error) { + type noMethod SslCertsCreateEphemeralRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SslCertsInsertRequest: SslCerts insert request. +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"` + + // ForceSendFields is a list of field names (e.g. "CommonName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SslCertsInsertRequest) MarshalJSON() ([]byte, error) { + type noMethod SslCertsInsertRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SslCertsInsertResponse: SslCert insert response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ClientCert") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SslCertsInsertResponse) MarshalJSON() ([]byte, error) { + type noMethod SslCertsInsertResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SslCertsListResponse: SslCerts list response. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SslCertsListResponse) MarshalJSON() ([]byte, error) { + type noMethod SslCertsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Tier: A Google Cloud SQL service tier resource. +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"` + + // ForceSendFields is a list of field names (e.g. "DiskQuota") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Tier) MarshalJSON() ([]byte, error) { + type noMethod Tier + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TiersListResponse: Tiers list response. +type TiersListResponse struct { + // Items: List of tiers. + Items []*Tier `json:"items,omitempty"` + + // Kind: This is always sql#tiersList. + Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TiersListResponse) MarshalJSON() ([]byte, error) { + type noMethod TiersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// User: A Cloud SQL user resource. +type User struct { + // Etag: HTTP 1.1 Entity tag for the resource. + Etag string `json:"etag,omitempty"` + + // Host: The host name from which the user can connect. For insert + // operations, host defaults to an empty string. For update operations, + // host is specified as part of the request URL. The host name is not + // mutable with this API. + Host string `json:"host,omitempty"` + + // Instance: The name of the Cloud SQL instance. This does not include + // the project ID. Can be omitted for update since it is already + // specified on the URL. + Instance string `json:"instance,omitempty"` + + // Kind: This is always sql#user. + Kind string `json:"kind,omitempty"` + + // Name: The name of the user in the Cloud SQL instance. Can be omitted + // for update since it is already specified on the URL. + Name string `json:"name,omitempty"` + + // Password: The password for the user. + Password string `json:"password,omitempty"` + + // Project: The project ID of the project containing the Cloud SQL + // database. The Google apps domain is prefixed if applicable. Can be + // omitted for update since it is already specified on the URL. + Project string `json:"project,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *User) MarshalJSON() ([]byte, error) { + type noMethod User + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UsersListResponse: User list response. +type UsersListResponse struct { + // Items: List of user resources in the instance. + Items []*User `json:"items,omitempty"` + + // Kind: This is always sql#usersList. + Kind string `json:"kind,omitempty"` + + // NextPageToken: An identifier that uniquely identifies the operation. + // You can use this identifier to retrieve the Operations resource that + // has information about the operation. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UsersListResponse) MarshalJSON() ([]byte, error) { + type noMethod UsersListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "sql.backupRuns.delete": + +type BackupRunsDeleteCall struct { + s *Service + project string + instance string + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes the backup taken by a backup run. +func (r *BackupRunsService) Delete(project string, instance string, id int64) *BackupRunsDeleteCall { + c := &BackupRunsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BackupRunsDeleteCall) Fields(s ...googleapi.Field) *BackupRunsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BackupRunsDeleteCall) Context(ctx context.Context) *BackupRunsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *BackupRunsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/backupRuns/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.backupRuns.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *BackupRunsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the backup taken by a backup run.", + // "httpMethod": "DELETE", + // "id": "sql.backupRuns.delete", + // "parameterOrder": [ + // "project", + // "instance", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of the Backup Run to delete. To find a Backup Run ID, use the list method.", + // "format": "int64", + // "location": "path", + // "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/{id}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.backupRuns.get": + +type BackupRunsGetCall struct { + s *Service + project string + instance string + id int64 + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves a resource containing information about a backup run. +func (r *BackupRunsService) Get(project string, instance string, id int64) *BackupRunsGetCall { + c := &BackupRunsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.id = id + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BackupRunsGetCall) Fields(s ...googleapi.Field) *BackupRunsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BackupRunsGetCall) IfNoneMatch(entityTag string) *BackupRunsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BackupRunsGetCall) Context(ctx context.Context) *BackupRunsGetCall { + c.ctx_ = ctx + return c +} + +func (c *BackupRunsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/backupRuns/{id}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + "id": strconv.FormatInt(c.id, 10), + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.backupRuns.get" call. +// Exactly one of *BackupRun or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *BackupRun.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *BackupRunsGetCall) Do() (*BackupRun, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BackupRun{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a resource containing information about a backup run.", + // "httpMethod": "GET", + // "id": "sql.backupRuns.get", + // "parameterOrder": [ + // "project", + // "instance", + // "id" + // ], + // "parameters": { + // "id": { + // "description": "The ID of this Backup Run.", + // "format": "int64", + // "location": "path", + // "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/{id}", + // "response": { + // "$ref": "BackupRun" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.backupRuns.list": + +type BackupRunsListCall struct { + s *Service + project string + instance string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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) *BackupRunsListCall { + c := &BackupRunsListCall{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 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BackupRunsListCall) Fields(s ...googleapi.Field) *BackupRunsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BackupRunsListCall) IfNoneMatch(entityTag string) *BackupRunsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BackupRunsListCall) Context(ctx context.Context) *BackupRunsListCall { + c.ctx_ = ctx + return c +} + +func (c *BackupRunsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/backupRuns") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.backupRuns.list" call. +// Exactly one of *BackupRunsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BackupRunsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BackupRunsListCall) Do() (*BackupRunsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BackupRunsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all 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" + // ], + // "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 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/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.databases.delete": + +type DatabasesDeleteCall struct { + s *Service + project string + instance string + database string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a resource containing information about a database +// inside a Cloud SQL instance. +func (r *DatabasesService) Delete(project string, instance string, database string) *DatabasesDeleteCall { + c := &DatabasesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.database = database + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatabasesDeleteCall) Fields(s ...googleapi.Field) *DatabasesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatabasesDeleteCall) Context(ctx context.Context) *DatabasesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *DatabasesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/databases/{database}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + "database": c.database, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.databases.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DatabasesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a resource containing information about a database inside a Cloud SQL instance.", + // "httpMethod": "DELETE", + // "id": "sql.databases.delete", + // "parameterOrder": [ + // "project", + // "instance", + // "database" + // ], + // "parameters": { + // "database": { + // "description": "Name of the database to be deleted in the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "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}/databases/{database}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.databases.get": + +type DatabasesGetCall struct { + s *Service + project string + instance string + database string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves a resource containing information about a database +// inside a Cloud SQL instance. +func (r *DatabasesService) Get(project string, instance string, database string) *DatabasesGetCall { + c := &DatabasesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.database = database + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatabasesGetCall) Fields(s ...googleapi.Field) *DatabasesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DatabasesGetCall) IfNoneMatch(entityTag string) *DatabasesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatabasesGetCall) Context(ctx context.Context) *DatabasesGetCall { + c.ctx_ = ctx + return c +} + +func (c *DatabasesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/databases/{database}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + "database": c.database, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.databases.get" call. +// Exactly one of *Database or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Database.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DatabasesGetCall) Do() (*Database, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Database{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a resource containing information about a database inside a Cloud SQL instance.", + // "httpMethod": "GET", + // "id": "sql.databases.get", + // "parameterOrder": [ + // "project", + // "instance", + // "database" + // ], + // "parameters": { + // "database": { + // "description": "Name of the database in the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "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}/databases/{database}", + // "response": { + // "$ref": "Database" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.databases.insert": + +type DatabasesInsertCall struct { + s *Service + project string + instance string + database *Database + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Inserts a resource containing information about a database +// inside a Cloud SQL instance. +func (r *DatabasesService) Insert(project string, instance string, database *Database) *DatabasesInsertCall { + c := &DatabasesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.database = database + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatabasesInsertCall) Fields(s ...googleapi.Field) *DatabasesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatabasesInsertCall) Context(ctx context.Context) *DatabasesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *DatabasesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.database) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/databases") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.databases.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DatabasesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Inserts a resource containing information about a database inside a Cloud SQL instance.", + // "httpMethod": "POST", + // "id": "sql.databases.insert", + // "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}/databases", + // "request": { + // "$ref": "Database" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.databases.list": + +type DatabasesListCall struct { + s *Service + project string + instance string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists databases in the specified Cloud SQL instance. +func (r *DatabasesService) List(project string, instance string) *DatabasesListCall { + c := &DatabasesListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatabasesListCall) Fields(s ...googleapi.Field) *DatabasesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DatabasesListCall) IfNoneMatch(entityTag string) *DatabasesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatabasesListCall) Context(ctx context.Context) *DatabasesListCall { + c.ctx_ = ctx + return c +} + +func (c *DatabasesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/databases") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.databases.list" call. +// Exactly one of *DatabasesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DatabasesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DatabasesListCall) Do() (*DatabasesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DatabasesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists databases in the specified Cloud SQL instance.", + // "httpMethod": "GET", + // "id": "sql.databases.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}/databases", + // "response": { + // "$ref": "DatabasesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.databases.patch": + +type DatabasesPatchCall struct { + s *Service + project string + instance string + database string + database2 *Database + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates a resource containing information about a database +// inside a Cloud SQL instance. This method supports patch semantics. +func (r *DatabasesService) Patch(project string, instance string, database string, database2 *Database) *DatabasesPatchCall { + c := &DatabasesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.database = database + c.database2 = database2 + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatabasesPatchCall) Fields(s ...googleapi.Field) *DatabasesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatabasesPatchCall) Context(ctx context.Context) *DatabasesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *DatabasesPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.database2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/databases/{database}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + "database": c.database, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.databases.patch" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DatabasesPatchCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "sql.databases.patch", + // "parameterOrder": [ + // "project", + // "instance", + // "database" + // ], + // "parameters": { + // "database": { + // "description": "Name of the database to be updated in the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "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}/databases/{database}", + // "request": { + // "$ref": "Database" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.databases.update": + +type DatabasesUpdateCall struct { + s *Service + project string + instance string + database string + database2 *Database + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a resource containing information about a database +// inside a Cloud SQL instance. +func (r *DatabasesService) Update(project string, instance string, database string, database2 *Database) *DatabasesUpdateCall { + c := &DatabasesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.database = database + c.database2 = database2 + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DatabasesUpdateCall) Fields(s ...googleapi.Field) *DatabasesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DatabasesUpdateCall) Context(ctx context.Context) *DatabasesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *DatabasesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.database2) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/databases/{database}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + "database": c.database, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.databases.update" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DatabasesUpdateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a resource containing information about a database inside a Cloud SQL instance.", + // "httpMethod": "PUT", + // "id": "sql.databases.update", + // "parameterOrder": [ + // "project", + // "instance", + // "database" + // ], + // "parameters": { + // "database": { + // "description": "Name of the database to be updated in the instance.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "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}/databases/{database}", + // "request": { + // "$ref": "Database" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.flags.list": + +type FlagsListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *FlagsListCall) Fields(s ...googleapi.Field) *FlagsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FlagsListCall) IfNoneMatch(entityTag string) *FlagsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *FlagsListCall) Context(ctx context.Context) *FlagsListCall { + c.ctx_ = ctx + return c +} + +func (c *FlagsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "flags") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.flags.list" call. +// Exactly one of *FlagsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *FlagsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *FlagsListCall) Do() (*FlagsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FlagsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.clone": + +type InstancesCloneCall struct { + s *Service + project string + instance string + instancesclonerequest *InstancesCloneRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Clone: Creates a Cloud SQL instance as a clone of the source +// instance. +func (r *InstancesService) Clone(project string, instance string, instancesclonerequest *InstancesCloneRequest) *InstancesCloneCall { + c := &InstancesCloneCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.instancesclonerequest = instancesclonerequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesCloneCall) Fields(s ...googleapi.Field) *InstancesCloneCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesCloneCall) Context(ctx context.Context) *InstancesCloneCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesCloneCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/clone") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.clone" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesCloneCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a Cloud SQL instance as a clone of the source instance.", + // "httpMethod": "POST", + // "id": "sql.instances.clone", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "The ID of the Cloud SQL instance to be cloned (source). This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "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/{instance}/clone", + // "request": { + // "$ref": "InstancesCloneRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesExportCall) Fields(s ...googleapi.Field) *InstancesExportCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesExportCall) Context(ctx context.Context) *InstancesExportCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesExportCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/export") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.export" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesExportCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "sql.instances.failover": + +type InstancesFailoverCall struct { + s *Service + project string + instance string + instancesfailoverrequest *InstancesFailoverRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Failover: Failover the instance to its failover replica instance. +func (r *InstancesService) Failover(project string, instance string, instancesfailoverrequest *InstancesFailoverRequest) *InstancesFailoverCall { + c := &InstancesFailoverCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.instancesfailoverrequest = instancesfailoverrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesFailoverCall) Fields(s ...googleapi.Field) *InstancesFailoverCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesFailoverCall) Context(ctx context.Context) *InstancesFailoverCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesFailoverCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesfailoverrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/failover") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.failover" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesFailoverCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Failover the instance to its failover replica instance.", + // "httpMethod": "POST", + // "id": "sql.instances.failover", + // "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": "ID of the project that contains the read replica.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/failover", + // "request": { + // "$ref": "InstancesFailoverRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.get": + +type InstancesGetCall struct { + s *Service + project string + instance string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.get" call. +// Exactly one of *DatabaseInstance or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DatabaseInstance.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstancesGetCall) Do() (*DatabaseInstance, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DatabaseInstance{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesImportCall) Fields(s ...googleapi.Field) *InstancesImportCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesImportCall) Context(ctx context.Context) *InstancesImportCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesImportCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/import") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.import" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesImportCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Operation" + // }, + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.list": + +type InstancesListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.list" call. +// Exactly one of *InstancesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *InstancesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstancesListCall) Do() (*InstancesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &InstancesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesPatchCall) Fields(s ...googleapi.Field) *InstancesPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesPatchCall) Context(ctx context.Context) *InstancesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.patch" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesPatchCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.promoteReplica": + +type InstancesPromoteReplicaCall struct { + s *Service + project string + instance string + opt_ map[string]interface{} + ctx_ context.Context +} + +// PromoteReplica: Promotes the read replica instance to be a +// stand-alone Cloud SQL instance. +func (r *InstancesService) PromoteReplica(project string, instance string) *InstancesPromoteReplicaCall { + c := &InstancesPromoteReplicaCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesPromoteReplicaCall) Fields(s ...googleapi.Field) *InstancesPromoteReplicaCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesPromoteReplicaCall) Context(ctx context.Context) *InstancesPromoteReplicaCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesPromoteReplicaCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/promoteReplica") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.promoteReplica" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesPromoteReplicaCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Promotes the read replica instance to be a stand-alone Cloud SQL instance.", + // "httpMethod": "POST", + // "id": "sql.instances.promoteReplica", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL read replica instance name.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "ID of the project that contains the read replica.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/promoteReplica", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesResetSslConfigCall) Fields(s ...googleapi.Field) *InstancesResetSslConfigCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesResetSslConfigCall) Context(ctx context.Context) *InstancesResetSslConfigCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesResetSslConfigCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/resetSslConfig") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.resetSslConfig" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesResetSslConfigCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesRestartCall) Fields(s ...googleapi.Field) *InstancesRestartCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesRestartCall) Context(ctx context.Context) *InstancesRestartCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesRestartCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/restart") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.restart" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesRestartCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.restoreBackup": + +type InstancesRestoreBackupCall struct { + s *Service + project string + instance string + instancesrestorebackuprequest *InstancesRestoreBackupRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// RestoreBackup: Restores a backup of a Cloud SQL instance. +func (r *InstancesService) RestoreBackup(project string, instance string, instancesrestorebackuprequest *InstancesRestoreBackupRequest) *InstancesRestoreBackupCall { + c := &InstancesRestoreBackupCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.instancesrestorebackuprequest = instancesrestorebackuprequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesRestoreBackupCall) Fields(s ...googleapi.Field) *InstancesRestoreBackupCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesRestoreBackupCall) Context(ctx context.Context) *InstancesRestoreBackupCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesRestoreBackupCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesrestorebackuprequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/restoreBackup") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.restoreBackup" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesRestoreBackupCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Restores a backup of a Cloud SQL instance.", + // "httpMethod": "POST", + // "id": "sql.instances.restoreBackup", + // "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}/restoreBackup", + // "request": { + // "$ref": "InstancesRestoreBackupRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.startReplica": + +type InstancesStartReplicaCall struct { + s *Service + project string + instance string + opt_ map[string]interface{} + ctx_ context.Context +} + +// StartReplica: Starts the replication in the read replica instance. +func (r *InstancesService) StartReplica(project string, instance string) *InstancesStartReplicaCall { + c := &InstancesStartReplicaCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesStartReplicaCall) Fields(s ...googleapi.Field) *InstancesStartReplicaCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesStartReplicaCall) Context(ctx context.Context) *InstancesStartReplicaCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesStartReplicaCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/startReplica") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.startReplica" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesStartReplicaCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Starts the replication in the read replica instance.", + // "httpMethod": "POST", + // "id": "sql.instances.startReplica", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL read replica instance name.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "ID of the project that contains the read replica.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/startReplica", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.instances.stopReplica": + +type InstancesStopReplicaCall struct { + s *Service + project string + instance string + opt_ map[string]interface{} + ctx_ context.Context +} + +// StopReplica: Stops the replication in the read replica instance. +func (r *InstancesService) StopReplica(project string, instance string) *InstancesStopReplicaCall { + c := &InstancesStopReplicaCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesStopReplicaCall) Fields(s ...googleapi.Field) *InstancesStopReplicaCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesStopReplicaCall) Context(ctx context.Context) *InstancesStopReplicaCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesStopReplicaCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/stopReplica") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.stopReplica" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesStopReplicaCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Stops the replication in the read replica instance.", + // "httpMethod": "POST", + // "id": "sql.instances.stopReplica", + // "parameterOrder": [ + // "project", + // "instance" + // ], + // "parameters": { + // "instance": { + // "description": "Cloud SQL read replica instance name.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "ID of the project that contains the read replica.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/stopReplica", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstancesUpdateCall) Fields(s ...googleapi.Field) *InstancesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *InstancesUpdateCall) Context(ctx context.Context) *InstancesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.instances.update" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesUpdateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.operations.get": + +type OperationsGetCall struct { + s *Service + project string + operation string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves an instance operation that has been performed on an +// instance. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/operations/{operation}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "operation": c.operation, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.operations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *OperationsGetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves an instance operation that has been performed on an instance.", + // "httpMethod": "GET", + // "id": "sql.operations.get", + // "parameterOrder": [ + // "project", + // "operation" + // ], + // "parameters": { + // "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}/operations/{operation}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("instance", fmt.Sprintf("%v", c.instance)) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/operations") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.operations.list" call. +// Exactly one of *OperationsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *OperationsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *OperationsListCall) Do() (*OperationsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &OperationsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all 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": "query", + // "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}/operations", + // "response": { + // "$ref": "OperationsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.sslCerts.createEphemeral": + +type SslCertsCreateEphemeralCall struct { + s *Service + project string + instance string + sslcertscreateephemeralrequest *SslCertsCreateEphemeralRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// CreateEphemeral: Generates a short-lived X509 certificate containing +// the provided public key and signed by a private key specific to the +// target instance. Users may use the certificate to authenticate as +// themselves when connecting to the database. +func (r *SslCertsService) CreateEphemeral(project string, instance string, sslcertscreateephemeralrequest *SslCertsCreateEphemeralRequest) *SslCertsCreateEphemeralCall { + c := &SslCertsCreateEphemeralCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.sslcertscreateephemeralrequest = sslcertscreateephemeralrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SslCertsCreateEphemeralCall) Fields(s ...googleapi.Field) *SslCertsCreateEphemeralCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SslCertsCreateEphemeralCall) Context(ctx context.Context) *SslCertsCreateEphemeralCall { + c.ctx_ = ctx + return c +} + +func (c *SslCertsCreateEphemeralCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertscreateephemeralrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/createEphemeral") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.sslCerts.createEphemeral" call. +// Exactly one of *SslCert or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *SslCert.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *SslCertsCreateEphemeralCall) Do() (*SslCert, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SslCert{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Generates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certificate to authenticate as themselves when connecting to the database.", + // "httpMethod": "POST", + // "id": "sql.sslCerts.createEphemeral", + // "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 Cloud SQL project.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "projects/{project}/instances/{instance}/createEphemeral", + // "request": { + // "$ref": "SslCertsCreateEphemeralRequest" + // }, + // "response": { + // "$ref": "SslCert" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SslCertsDeleteCall) Fields(s ...googleapi.Field) *SslCertsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SslCertsDeleteCall) Context(ctx context.Context) *SslCertsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *SslCertsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + "sha1Fingerprint": c.sha1Fingerprint, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.sslCerts.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SslCertsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SslCertsGetCall) Fields(s ...googleapi.Field) *SslCertsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SslCertsGetCall) IfNoneMatch(entityTag string) *SslCertsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SslCertsGetCall) Context(ctx context.Context) *SslCertsGetCall { + c.ctx_ = ctx + return c +} + +func (c *SslCertsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + "sha1Fingerprint": c.sha1Fingerprint, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.sslCerts.get" call. +// Exactly one of *SslCert or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *SslCert.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *SslCertsGetCall) Do() (*SslCert, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SslCert{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SslCertsInsertCall) Fields(s ...googleapi.Field) *SslCertsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SslCertsInsertCall) Context(ctx context.Context) *SslCertsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *SslCertsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.sslCerts.insert" call. +// Exactly one of *SslCertsInsertResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SslCertsInsertResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SslCertsInsertCall) Do() (*SslCertsInsertResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SslCertsInsertResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SslCertsListCall) Fields(s ...googleapi.Field) *SslCertsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SslCertsListCall) IfNoneMatch(entityTag string) *SslCertsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SslCertsListCall) Context(ctx context.Context) *SslCertsListCall { + c.ctx_ = ctx + return c +} + +func (c *SslCertsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/sslCerts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.sslCerts.list" call. +// Exactly one of *SslCertsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SslCertsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SslCertsListCall) Do() (*SslCertsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SslCertsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all 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/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.tiers.list": + +type TiersListCall struct { + s *Service + project string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TiersListCall) Fields(s ...googleapi.Field) *TiersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TiersListCall) IfNoneMatch(entityTag string) *TiersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TiersListCall) Context(ctx context.Context) *TiersListCall { + c.ctx_ = ctx + return c +} + +func (c *TiersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/tiers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.tiers.list" call. +// Exactly one of *TiersListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TiersListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TiersListCall) Do() (*TiersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TiersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all 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/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.users.delete": + +type UsersDeleteCall struct { + s *Service + project string + instance string + host string + name string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a user from a Cloud SQL instance. +func (r *UsersService) Delete(project string, instance string, host string, name string) *UsersDeleteCall { + c := &UsersDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.host = host + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersDeleteCall) Fields(s ...googleapi.Field) *UsersDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersDeleteCall) Context(ctx context.Context) *UsersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("host", fmt.Sprintf("%v", c.host)) + params.Set("name", fmt.Sprintf("%v", c.name)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/users") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.users.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a user from a Cloud SQL instance.", + // "httpMethod": "DELETE", + // "id": "sql.users.delete", + // "parameterOrder": [ + // "project", + // "instance", + // "host", + // "name" + // ], + // "parameters": { + // "host": { + // "description": "Host of the user in the instance.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "instance": { + // "description": "Database instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "name": { + // "description": "Name of the user in the instance.", + // "location": "query", + // "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}/users", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.users.insert": + +type UsersInsertCall struct { + s *Service + project string + instance string + user *User + opt_ map[string]interface{} + ctx_ context.Context +} + +// Insert: Creates a new user in a Cloud SQL instance. +func (r *UsersService) Insert(project string, instance string, user *User) *UsersInsertCall { + c := &UsersInsertCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.user = user + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersInsertCall) Fields(s ...googleapi.Field) *UsersInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersInsertCall) Context(ctx context.Context) *UsersInsertCall { + c.ctx_ = ctx + return c +} + +func (c *UsersInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/users") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.users.insert" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new user in a Cloud SQL instance.", + // "httpMethod": "POST", + // "id": "sql.users.insert", + // "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}/users", + // "request": { + // "$ref": "User" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.users.list": + +type UsersListCall struct { + s *Service + project string + instance string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists users in the specified Cloud SQL instance. +func (r *UsersService) List(project string, instance string) *UsersListCall { + c := &UsersListCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersListCall) Context(ctx context.Context) *UsersListCall { + c.ctx_ = ctx + return c +} + +func (c *UsersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/users") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.users.list" call. +// Exactly one of *UsersListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *UsersListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UsersListCall) Do() (*UsersListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UsersListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists users in the specified Cloud SQL instance.", + // "httpMethod": "GET", + // "id": "sql.users.list", + // "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}/users", + // "response": { + // "$ref": "UsersListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} + +// method id "sql.users.update": + +type UsersUpdateCall struct { + s *Service + project string + instance string + host string + name string + user *User + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates an existing user in a Cloud SQL instance. +func (r *UsersService) Update(project string, instance string, host string, name string, user *User) *UsersUpdateCall { + c := &UsersUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.project = project + c.instance = instance + c.host = host + c.name = name + c.user = user + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UsersUpdateCall) Fields(s ...googleapi.Field) *UsersUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UsersUpdateCall) Context(ctx context.Context) *UsersUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *UsersUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + params.Set("host", fmt.Sprintf("%v", c.host)) + params.Set("name", fmt.Sprintf("%v", c.name)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/instances/{instance}/users") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instance": c.instance, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "sql.users.update" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UsersUpdateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an existing user in a Cloud SQL instance.", + // "httpMethod": "PUT", + // "id": "sql.users.update", + // "parameterOrder": [ + // "project", + // "instance", + // "host", + // "name" + // ], + // "parameters": { + // "host": { + // "description": "Host of the user in the instance.", + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "instance": { + // "description": "Database instance ID. This does not include the project ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "name": { + // "description": "Name of the user in the instance.", + // "location": "query", + // "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}/users", + // "request": { + // "$ref": "User" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/sqlservice.admin" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/storage/v1/storage-api.json b/Godeps/_workspace/src/google.golang.org/api/storage/v1/storage-api.json new file mode 100644 index 000000000..d97a4687c --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/storage/v1/storage-api.json @@ -0,0 +1,2834 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/N6tKJW3LYMQm0Iy7CDmwkEgtf6o\"", + "discoveryVersion": "v1", + "id": "storage:v1", + "name": "storage", + "version": "v1", + "revision": "20151007", + "title": "Cloud Storage JSON 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/v1/", + "basePath": "/storage/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "storage/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/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/cloud-platform.read-only": { + "description": "View 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": { + "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, (GET, OPTIONS, POST, etc) 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 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. Currently, only Delete is supported." + } + } + }, + "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 (for instance, \"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. 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 is always the project team's owner group.", + "properties": { + "entity": { + "type": "string", + "description": "The entity, in the form project-owner-projectId." + }, + "entityId": { + "type": "string", + "description": "The ID for the entity." + } + } + }, + "projectNumber": { + "type": "string", + "description": "The project number of the project the bucket belongs to.", + "format": "uint64" + }, + "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 are stored and determines the SLA and the cost of storage. Values include STANDARD, NEARLINE and DURABLE_REDUCED_AVAILABILITY. Defaults to STANDARD. For more information, see storage classes." + }, + "timeCreated": { + "type": "string", + "description": "The creation time of the bucket in RFC 3339 format.", + "format": "date-time" + }, + "updated": { + "type": "string", + "description": "The modification 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- project-team-projectId \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" + }, + "projectTeam": { + "type": "object", + "description": "The project team associated with the entity, if any.", + "properties": { + "projectNumber": { + "type": "string", + "description": "The project number." + }, + "team": { + "type": "string", + "description": "The team. Can be owners, editors, or viewers." + } + } + }, + "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 name of 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.", + "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.insert", + "storage.objects.update" + ] + } + }, + "crc32c": { + "type": "string", + "description": "CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see Hashes and ETags: Best Practices." + }, + "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. For more information about using the MD5 hash, see Hashes and ETags: Best Practices." + }, + "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 version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.", + "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." + }, + "timeCreated": { + "type": "string", + "description": "The creation time of the object in RFC 3339 format.", + "format": "date-time" + }, + "timeDeleted": { + "type": "string", + "description": "The 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": "The 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- project-team-projectId \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." + }, + "projectTeam": { + "type": "object", + "description": "The project team associated with the entity, if any.", + "properties": { + "projectNumber": { + "type": "string", + "description": "The project number." + }, + "team": { + "type": "string", + "description": "The team. Can be owners, editors, or viewers." + } + } + }, + "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" + } + } + } + }, + "RewriteResponse": { + "id": "RewriteResponse", + "type": "object", + "description": "A rewrite response.", + "properties": { + "done": { + "type": "boolean", + "description": "true if the copy is finished; otherwise, false if the copy is in progress. This property is always present in the response." + }, + "kind": { + "type": "string", + "description": "The kind of item this is.", + "default": "storage#rewriteResponse" + }, + "objectSize": { + "type": "string", + "description": "The total size of the object being copied in bytes. This property is always present in the response.", + "format": "uint64" + }, + "resource": { + "$ref": "Object", + "description": "A resource containing the metadata for the copied-to object. This property is present in the response only when copying completes." + }, + "rewriteToken": { + "type": "string", + "description": "A token to use in subsequent requests to continue copying data. This token is present in the response only when there is more data to copy." + }, + "totalBytesRewritten": { + "type": "string", + "description": "The total bytes written so far, which can be used to provide a waiting user with a progress indicator. This property is always present in the response.", + "format": "uint64" + } + } + } + }, + "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": "If set, only deletes the bucket if its metageneration matches this value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "If set, only deletes the bucket if its metageneration does not match this value.", + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "bucket" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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": "int64", + "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": "int64", + "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/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "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": { + "predefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to this bucket.", + "enum": [ + "authenticatedRead", + "private", + "projectPrivate", + "publicRead", + "publicReadWrite" + ], + "enumDescriptions": [ + "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", + "Project team owners get OWNER access.", + "Project team members get access according to their roles.", + "Project team owners get OWNER access, and allUsers get READER access.", + "Project team owners get OWNER access, and allUsers get WRITER access." + ], + "location": "query" + }, + "predefinedDefaultObjectAcl": { + "type": "string", + "description": "Apply a predefined set of default object access controls to this bucket.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "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, 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/cloud-platform", + "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" + }, + "prefix": { + "type": "string", + "description": "Filter results to buckets whose names begin with this prefix.", + "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/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "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": "int64", + "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": "int64", + "location": "query" + }, + "predefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to this bucket.", + "enum": [ + "authenticatedRead", + "private", + "projectPrivate", + "publicRead", + "publicReadWrite" + ], + "enumDescriptions": [ + "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", + "Project team owners get OWNER access.", + "Project team members get access according to their roles.", + "Project team owners get OWNER access, and allUsers get READER access.", + "Project team owners get OWNER access, and allUsers get WRITER access." + ], + "location": "query" + }, + "predefinedDefaultObjectAcl": { + "type": "string", + "description": "Apply a predefined set of default object access controls to this bucket.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "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/cloud-platform", + "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": "int64", + "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": "int64", + "location": "query" + }, + "predefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to this bucket.", + "enum": [ + "authenticatedRead", + "private", + "projectPrivate", + "publicRead", + "publicReadWrite" + ], + "enumDescriptions": [ + "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", + "Project team owners get OWNER access.", + "Project team members get access according to their roles.", + "Project team owners get OWNER access, and allUsers get READER access.", + "Project team owners get OWNER access, and allUsers get WRITER access." + ], + "location": "query" + }, + "predefinedDefaultObjectAcl": { + "type": "string", + "description": "Apply a predefined set of default object access controls to this bucket.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "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/cloud-platform", + "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/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "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": "If present, only return default ACL listing if the bucket's current metageneration matches this value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "If present, only return default ACL listing if the bucket's current metageneration does not match the given value.", + "format": "int64", + "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": "int64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + "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": "int64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + "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": "int64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + "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": "int64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + "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": "int64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + "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": "int64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + "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. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + "required": true, + "location": "path" + }, + "destinationPredefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to the destination object.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "location": "query" + }, + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation matches the given value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + "format": "int64", + "location": "query" + } + }, + "parameterOrder": [ + "destinationBucket", + "destinationObject" + ], + "request": { + "$ref": "ComposeRequest" + }, + "response": { + "$ref": "Object" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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 a source object to a destination object. 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.For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + "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" + }, + "destinationPredefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to the destination object.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "location": "query" + }, + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the destination object's current generation matches the given value.", + "format": "int64", + "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": "int64", + "location": "query" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.", + "format": "int64", + "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": "int64", + "location": "query" + }, + "ifSourceGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's generation matches the given value.", + "format": "int64", + "location": "query" + }, + "ifSourceGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's generation does not match the given value.", + "format": "int64", + "location": "query" + }, + "ifSourceMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.", + "format": "int64", + "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": "int64", + "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": "int64", + "location": "query" + }, + "sourceObject": { + "type": "string", + "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "sourceBucket", + "sourceObject", + "destinationBucket", + "destinationObject" + ], + "request": { + "$ref": "Object" + }, + "response": { + "$ref": "Object" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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 an object and its 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": "int64", + "location": "query" + }, + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation matches the given value.", + "format": "int64", + "location": "query" + }, + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + "format": "int64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket", + "object" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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 an object or its 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": "int64", + "location": "query" + }, + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's generation matches the given value.", + "format": "int64", + "location": "query" + }, + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's generation does not match the given value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + "format": "int64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + "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/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "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 a new object and 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" + }, + "contentEncoding": { + "type": "string", + "description": "If set, sets the contentEncoding property of the final object to this value. Setting this parameter is equivalent to setting the contentEncoding metadata property. This can be useful when uploading an object with uploadType=media to indicate the encoding of the content being uploaded.", + "location": "query" + }, + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation matches the given value.", + "format": "int64", + "location": "query" + }, + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + "format": "int64", + "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. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + "location": "query" + }, + "predefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to this object.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "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/cloud-platform", + "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/v1/b/{bucket}/o" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/storage/v1/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. The default value of this parameter is 1,000 items.", + "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 an object as distinct results. The default is false. For more information, see Object Versioning.", + "location": "query" + } + }, + "parameterOrder": [ + "bucket" + ], + "response": { + "$ref": "Objects" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "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 an object's 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": "int64", + "location": "query" + }, + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation matches the given value.", + "format": "int64", + "location": "query" + }, + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + "format": "int64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + "required": true, + "location": "path" + }, + "predefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to this object.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "location": "query" + }, + "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/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "rewrite": { + "id": "storage.objects.rewrite", + "path": "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}", + "httpMethod": "POST", + "description": "Rewrites a source object to a destination object. 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. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + "required": true, + "location": "path" + }, + "destinationPredefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to the destination object.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "location": "query" + }, + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the destination object's current generation matches the given value.", + "format": "int64", + "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": "int64", + "location": "query" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.", + "format": "int64", + "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": "int64", + "location": "query" + }, + "ifSourceGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's generation matches the given value.", + "format": "int64", + "location": "query" + }, + "ifSourceGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's generation does not match the given value.", + "format": "int64", + "location": "query" + }, + "ifSourceMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.", + "format": "int64", + "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": "int64", + "location": "query" + }, + "maxBytesRewrittenPerCall": { + "type": "string", + "description": "The maximum number of bytes that will be rewritten per rewrite request. Most callers shouldn't need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB (1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across rewrite calls else you'll get an error that the rewriteToken is invalid.", + "format": "int64", + "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" + }, + "rewriteToken": { + "type": "string", + "description": "Include this field (from the previous rewrite response) on each rewrite request after the first one, until the rewrite response 'done' flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request.", + "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": "int64", + "location": "query" + }, + "sourceObject": { + "type": "string", + "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "sourceBucket", + "sourceObject", + "destinationBucket", + "destinationObject" + ], + "request": { + "$ref": "Object" + }, + "response": { + "$ref": "RewriteResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "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 an object's 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": "int64", + "location": "query" + }, + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation matches the given value.", + "format": "int64", + "location": "query" + }, + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + "format": "int64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + "required": true, + "location": "path" + }, + "predefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to this object.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "location": "query" + }, + "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/cloud-platform", + "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. The default value of this parameter is 1,000 items.", + "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 an object as distinct results. The default is false. For more information, see Object Versioning.", + "location": "query" + } + }, + "parameterOrder": [ + "bucket" + ], + "request": { + "$ref": "Channel", + "parameterName": "resource" + }, + "response": { + "$ref": "Channel" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "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/Godeps/_workspace/src/google.golang.org/api/storage/v1/storage-gen.go b/Godeps/_workspace/src/google.golang.org/api/storage/v1/storage-gen.go new file mode 100644 index 000000000..f690ddfa8 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/storage/v1/storage-gen.go @@ -0,0 +1,7977 @@ +// Package storage provides access to the Cloud Storage JSON API. +// +// See https://developers.google.com/storage/docs/json_api/ +// +// Usage example: +// +// import "google.golang.org/api/storage/v1" +// ... +// storageService, err := storage.New(oauthHttpClient) +package storage // import "google.golang.org/api/storage/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "storage:v1" +const apiName = "storage" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/storage/v1/" + +// 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 data across Google Cloud Platform services + CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" + + // Manage your data and permissions in Google Cloud Storage + DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control" + + // View your data in Google Cloud Storage + DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only" + + // Manage your data in Google Cloud Storage + DevstorageReadWriteScope = "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 + UserAgent string // optional additional User-Agent fragment + + BucketAccessControls *BucketAccessControlsService + + Buckets *BucketsService + + Channels *ChannelsService + + DefaultObjectAccessControls *DefaultObjectAccessControlsService + + ObjectAccessControls *ObjectAccessControlsService + + Objects *ObjectsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 +} + +// Bucket: A bucket. +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 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. 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 is always the project team's + // owner group. + Owner *BucketOwner `json:"owner,omitempty"` + + // ProjectNumber: The project number of the project the bucket belongs + // to. + ProjectNumber uint64 `json:"projectNumber,omitempty,string"` + + // SelfLink: The URI of this bucket. + SelfLink string `json:"selfLink,omitempty"` + + // StorageClass: The bucket's storage class. This defines how objects in + // the bucket are stored and determines the SLA and the cost of storage. + // Values include STANDARD, NEARLINE and DURABLE_REDUCED_AVAILABILITY. + // Defaults to STANDARD. For more information, see storage classes. + StorageClass string `json:"storageClass,omitempty"` + + // TimeCreated: The creation time of the bucket in RFC 3339 format. + TimeCreated string `json:"timeCreated,omitempty"` + + // Updated: The modification time of the bucket in RFC 3339 format. + Updated string `json:"updated,omitempty"` + + // Versioning: The bucket's versioning configuration. + Versioning *BucketVersioning `json:"versioning,omitempty"` + + // Website: The bucket's website configuration. + Website *BucketWebsite `json:"website,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Acl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Bucket) MarshalJSON() ([]byte, error) { + type noMethod Bucket + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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, (GET, OPTIONS, POST, etc) 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"` + + // ForceSendFields is a list of field names (e.g. "MaxAgeSeconds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketCors) MarshalJSON() ([]byte, error) { + type noMethod BucketCors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BucketLifecycle: The bucket's lifecycle configuration. See lifecycle +// management for more information. +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"` + + // ForceSendFields is a list of field names (e.g. "Rule") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketLifecycle) MarshalJSON() ([]byte, error) { + type noMethod BucketLifecycle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Action") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketLifecycleRule) MarshalJSON() ([]byte, error) { + type noMethod BucketLifecycleRule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BucketLifecycleRuleAction: The action to take. +type BucketLifecycleRuleAction struct { + // Type: Type of the action. Currently, only Delete is supported. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Type") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketLifecycleRuleAction) MarshalJSON() ([]byte, error) { + type noMethod BucketLifecycleRuleAction + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BucketLifecycleRuleCondition: The condition(s) under which the action +// will be taken. +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 (for + // instance, "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"` + + // ForceSendFields is a list of field names (e.g. "Age") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketLifecycleRuleCondition) MarshalJSON() ([]byte, error) { + type noMethod BucketLifecycleRuleCondition + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BucketLogging: The bucket's logging configuration, which defines the +// destination bucket and optional name prefix for the current bucket's +// logs. +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"` + + // ForceSendFields is a list of field names (e.g. "LogBucket") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketLogging) MarshalJSON() ([]byte, error) { + type noMethod BucketLogging + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BucketOwner: The owner of the bucket. This is always the project +// team's owner group. +type BucketOwner struct { + // Entity: The entity, in the form project-owner-projectId. + Entity string `json:"entity,omitempty"` + + // EntityId: The ID for the entity. + EntityId string `json:"entityId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Entity") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketOwner) MarshalJSON() ([]byte, error) { + type noMethod BucketOwner + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BucketVersioning: The bucket's versioning configuration. +type BucketVersioning struct { + // Enabled: While set to true, versioning is fully enabled for this + // bucket. + Enabled bool `json:"enabled,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Enabled") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketVersioning) MarshalJSON() ([]byte, error) { + type noMethod BucketVersioning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BucketWebsite: The bucket's website configuration. +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"` + + // ForceSendFields is a list of field names (e.g. "MainPageSuffix") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketWebsite) MarshalJSON() ([]byte, error) { + type noMethod BucketWebsite + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BucketAccessControl: An access-control entry. +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 + // - project-team-projectId + // - 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"` + + // ProjectTeam: The project team associated with the entity, if any. + ProjectTeam *BucketAccessControlProjectTeam `json:"projectTeam,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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Bucket") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketAccessControl) MarshalJSON() ([]byte, error) { + type noMethod BucketAccessControl + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BucketAccessControlProjectTeam: The project team associated with the +// entity, if any. +type BucketAccessControlProjectTeam struct { + // ProjectNumber: The project number. + ProjectNumber string `json:"projectNumber,omitempty"` + + // Team: The team. Can be owners, editors, or viewers. + Team string `json:"team,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ProjectNumber") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketAccessControlProjectTeam) MarshalJSON() ([]byte, error) { + type noMethod BucketAccessControlProjectTeam + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BucketAccessControls: An access-control list. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketAccessControls) MarshalJSON() ([]byte, error) { + type noMethod BucketAccessControls + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Buckets: A list of buckets. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Buckets) MarshalJSON() ([]byte, error) { + type noMethod Buckets + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Channel: An notification channel used to watch for resource changes. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Address") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Channel) MarshalJSON() ([]byte, error) { + type noMethod Channel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ComposeRequest: A Compose request. +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"` + + // ForceSendFields is a list of field names (e.g. "Destination") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ComposeRequest) MarshalJSON() ([]byte, error) { + type noMethod ComposeRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Generation") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ComposeRequestSourceObjects) MarshalJSON() ([]byte, error) { + type noMethod ComposeRequestSourceObjects + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ComposeRequestSourceObjectsObjectPreconditions: Conditions that must +// be met for this operation to execute. +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"` + + // ForceSendFields is a list of field names (e.g. "IfGenerationMatch") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ComposeRequestSourceObjectsObjectPreconditions) MarshalJSON() ([]byte, error) { + type noMethod ComposeRequestSourceObjectsObjectPreconditions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Object: An object. +type Object struct { + // Acl: Access controls on the object. + Acl []*ObjectAccessControl `json:"acl,omitempty"` + + // Bucket: The name of 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. + 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 in big-endian byte order. For more information + // about using the CRC32c checksum, see Hashes and ETags: Best + // Practices. + 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. For more + // information about using the MD5 hash, see Hashes and ETags: Best + // Practices. + 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 version of the metadata for this object at this + // generation. Used for preconditions and for detecting changes in + // metadata. A metageneration number is only meaningful in the context + // of a particular generation of a particular object. + 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"` + + // TimeCreated: The creation time of the object in RFC 3339 format. + TimeCreated string `json:"timeCreated,omitempty"` + + // TimeDeleted: The 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: The modification time of the object metadata in RFC 3339 + // format. + Updated string `json:"updated,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Acl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Object) MarshalJSON() ([]byte, error) { + type noMethod Object + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ObjectOwner: The owner of the object. This will always be the +// uploader of the object. +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"` + + // ForceSendFields is a list of field names (e.g. "Entity") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ObjectOwner) MarshalJSON() ([]byte, error) { + type noMethod ObjectOwner + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ObjectAccessControl: An access-control entry. +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 + // - project-team-projectId + // - 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"` + + // ProjectTeam: The project team associated with the entity, if any. + ProjectTeam *ObjectAccessControlProjectTeam `json:"projectTeam,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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Bucket") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ObjectAccessControl) MarshalJSON() ([]byte, error) { + type noMethod ObjectAccessControl + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ObjectAccessControlProjectTeam: The project team associated with the +// entity, if any. +type ObjectAccessControlProjectTeam struct { + // ProjectNumber: The project number. + ProjectNumber string `json:"projectNumber,omitempty"` + + // Team: The team. Can be owners, editors, or viewers. + Team string `json:"team,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ProjectNumber") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ObjectAccessControlProjectTeam) MarshalJSON() ([]byte, error) { + type noMethod ObjectAccessControlProjectTeam + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ObjectAccessControls: An access-control list. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ObjectAccessControls) MarshalJSON() ([]byte, error) { + type noMethod ObjectAccessControls + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Objects: A list of objects. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Objects) MarshalJSON() ([]byte, error) { + type noMethod Objects + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// RewriteResponse: A rewrite response. +type RewriteResponse struct { + // Done: true if the copy is finished; otherwise, false if the copy is + // in progress. This property is always present in the response. + Done bool `json:"done,omitempty"` + + // Kind: The kind of item this is. + Kind string `json:"kind,omitempty"` + + // ObjectSize: The total size of the object being copied in bytes. This + // property is always present in the response. + ObjectSize uint64 `json:"objectSize,omitempty,string"` + + // Resource: A resource containing the metadata for the copied-to + // object. This property is present in the response only when copying + // completes. + Resource *Object `json:"resource,omitempty"` + + // RewriteToken: A token to use in subsequent requests to continue + // copying data. This token is present in the response only when there + // is more data to copy. + RewriteToken string `json:"rewriteToken,omitempty"` + + // TotalBytesRewritten: The total bytes written so far, which can be + // used to provide a waiting user with a progress indicator. This + // property is always present in the response. + TotalBytesRewritten uint64 `json:"totalBytesRewritten,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Done") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RewriteResponse) MarshalJSON() ([]byte, error) { + type noMethod RewriteResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "storage.bucketAccessControls.delete": + +type BucketAccessControlsDeleteCall struct { + s *Service + bucket string + entity string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketAccessControlsDeleteCall) Fields(s ...googleapi.Field) *BucketAccessControlsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketAccessControlsDeleteCall) Context(ctx context.Context) *BucketAccessControlsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *BucketAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "entity": c.entity, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.bucketAccessControls.delete" call. +func (c *BucketAccessControlsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketAccessControlsGetCall) Fields(s ...googleapi.Field) *BucketAccessControlsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BucketAccessControlsGetCall) IfNoneMatch(entityTag string) *BucketAccessControlsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketAccessControlsGetCall) Context(ctx context.Context) *BucketAccessControlsGetCall { + c.ctx_ = ctx + return c +} + +func (c *BucketAccessControlsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "entity": c.entity, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.bucketAccessControls.get" call. +// Exactly one of *BucketAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BucketAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BucketAccessControlsGetCall) Do() (*BucketAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BucketAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketAccessControlsInsertCall) Fields(s ...googleapi.Field) *BucketAccessControlsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketAccessControlsInsertCall) Context(ctx context.Context) *BucketAccessControlsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *BucketAccessControlsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.bucketAccessControls.insert" call. +// Exactly one of *BucketAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BucketAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BucketAccessControlsInsertCall) Do() (*BucketAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BucketAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketAccessControlsListCall) Fields(s ...googleapi.Field) *BucketAccessControlsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BucketAccessControlsListCall) IfNoneMatch(entityTag string) *BucketAccessControlsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketAccessControlsListCall) Context(ctx context.Context) *BucketAccessControlsListCall { + c.ctx_ = ctx + return c +} + +func (c *BucketAccessControlsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.bucketAccessControls.list" call. +// Exactly one of *BucketAccessControls or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BucketAccessControls.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BucketAccessControlsListCall) Do() (*BucketAccessControls, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BucketAccessControls{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketAccessControlsPatchCall) Fields(s ...googleapi.Field) *BucketAccessControlsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketAccessControlsPatchCall) Context(ctx context.Context) *BucketAccessControlsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *BucketAccessControlsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "entity": c.entity, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.bucketAccessControls.patch" call. +// Exactly one of *BucketAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BucketAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BucketAccessControlsPatchCall) Do() (*BucketAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BucketAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketAccessControlsUpdateCall) Fields(s ...googleapi.Field) *BucketAccessControlsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketAccessControlsUpdateCall) Context(ctx context.Context) *BucketAccessControlsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *BucketAccessControlsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "entity": c.entity, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.bucketAccessControls.update" call. +// Exactly one of *BucketAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BucketAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BucketAccessControlsUpdateCall) Do() (*BucketAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BucketAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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": If set, only deletes the bucket if its +// metageneration matches this value. +func (c *BucketsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsDeleteCall { + c.opt_["ifMetagenerationMatch"] = ifMetagenerationMatch + return c +} + +// IfMetagenerationNotMatch sets the optional parameter +// "ifMetagenerationNotMatch": If set, only deletes the bucket if its +// metageneration does not match this value. +func (c *BucketsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsDeleteCall { + c.opt_["ifMetagenerationNotMatch"] = ifMetagenerationNotMatch + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketsDeleteCall) Fields(s ...googleapi.Field) *BucketsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketsDeleteCall) Context(ctx context.Context) *BucketsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *BucketsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.buckets.delete" call. +func (c *BucketsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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": "If set, only deletes the bucket if its metageneration matches this value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationNotMatch": { + // "description": "If set, only deletes the bucket if its metageneration does not match this value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "b/{bucket}", + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 int64) *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 int64) *BucketsGetCall { + c.opt_["ifMetagenerationNotMatch"] = ifMetagenerationNotMatch + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to noAcl. +// +// Possible values: +// "full" - Include all properties. +// "noAcl" - Omit acl and defaultObjectAcl properties. +func (c *BucketsGetCall) Projection(projection string) *BucketsGetCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketsGetCall) Fields(s ...googleapi.Field) *BucketsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BucketsGetCall) IfNoneMatch(entityTag string) *BucketsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketsGetCall) Context(ctx context.Context) *BucketsGetCall { + c.ctx_ = ctx + return c +} + +func (c *BucketsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.buckets.get" call. +// Exactly one of *Bucket or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Bucket.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BucketsGetCall) Do() (*Bucket, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Bucket{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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": "int64", + // "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": "int64", + // "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/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a +// predefined set of access controls to this bucket. +// +// Possible values: +// "authenticatedRead" - Project team owners get OWNER access, and +// allAuthenticatedUsers get READER access. +// "private" - Project team owners get OWNER access. +// "projectPrivate" - Project team members get access according to +// their roles. +// "publicRead" - Project team owners get OWNER access, and allUsers +// get READER access. +// "publicReadWrite" - Project team owners get OWNER access, and +// allUsers get WRITER access. +func (c *BucketsInsertCall) PredefinedAcl(predefinedAcl string) *BucketsInsertCall { + c.opt_["predefinedAcl"] = predefinedAcl + return c +} + +// PredefinedDefaultObjectAcl sets the optional parameter +// "predefinedDefaultObjectAcl": Apply a predefined set of default +// object access controls to this bucket. +// +// Possible values: +// "authenticatedRead" - Object owner gets OWNER access, and +// allAuthenticatedUsers get READER access. +// "bucketOwnerFullControl" - Object owner gets OWNER access, and +// project team owners get OWNER access. +// "bucketOwnerRead" - Object owner gets OWNER access, and project +// team owners get READER access. +// "private" - Object owner gets OWNER access. +// "projectPrivate" - Object owner gets OWNER access, and project team +// members get access according to their roles. +// "publicRead" - Object owner gets OWNER access, and allUsers get +// READER access. +func (c *BucketsInsertCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsInsertCall { + c.opt_["predefinedDefaultObjectAcl"] = predefinedDefaultObjectAcl + 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. +// +// Possible values: +// "full" - Include all properties. +// "noAcl" - Omit acl and defaultObjectAcl properties. +func (c *BucketsInsertCall) Projection(projection string) *BucketsInsertCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketsInsertCall) Fields(s ...googleapi.Field) *BucketsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketsInsertCall) Context(ctx context.Context) *BucketsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *BucketsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + params.Set("project", fmt.Sprintf("%v", c.projectid)) + if v, ok := c.opt_["predefinedAcl"]; ok { + params.Set("predefinedAcl", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["predefinedDefaultObjectAcl"]; ok { + params.Set("predefinedDefaultObjectAcl", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.buckets.insert" call. +// Exactly one of *Bucket or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Bucket.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BucketsInsertCall) Do() (*Bucket, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Bucket{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a new bucket.", + // "httpMethod": "POST", + // "id": "storage.buckets.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "predefinedAcl": { + // "description": "Apply a predefined set of access controls to this bucket.", + // "enum": [ + // "authenticatedRead", + // "private", + // "projectPrivate", + // "publicRead", + // "publicReadWrite" + // ], + // "enumDescriptions": [ + // "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", + // "Project team owners get OWNER access.", + // "Project team members get access according to their roles.", + // "Project team owners get OWNER access, and allUsers get READER access.", + // "Project team owners get OWNER access, and allUsers get WRITER access." + // ], + // "location": "query", + // "type": "string" + // }, + // "predefinedDefaultObjectAcl": { + // "description": "Apply a predefined set of default object access controls to this bucket.", + // "enum": [ + // "authenticatedRead", + // "bucketOwnerFullControl", + // "bucketOwnerRead", + // "private", + // "projectPrivate", + // "publicRead" + // ], + // "enumDescriptions": [ + // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + // "Object owner gets OWNER access, and project team owners get OWNER access.", + // "Object owner gets OWNER access, and project team owners get READER access.", + // "Object owner gets OWNER access.", + // "Object owner gets OWNER access, and project team members get access according to their roles.", + // "Object owner gets OWNER access, and allUsers get READER access." + // ], + // "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, 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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Prefix sets the optional parameter "prefix": Filter results to +// buckets whose names begin with this prefix. +func (c *BucketsListCall) Prefix(prefix string) *BucketsListCall { + c.opt_["prefix"] = prefix + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to noAcl. +// +// Possible values: +// "full" - Include all properties. +// "noAcl" - Omit acl and defaultObjectAcl properties. +func (c *BucketsListCall) Projection(projection string) *BucketsListCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketsListCall) Fields(s ...googleapi.Field) *BucketsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BucketsListCall) IfNoneMatch(entityTag string) *BucketsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketsListCall) Context(ctx context.Context) *BucketsListCall { + c.ctx_ = ctx + return c +} + +func (c *BucketsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["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_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.buckets.list" call. +// Exactly one of *Buckets or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Buckets.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BucketsListCall) Do() (*Buckets, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Buckets{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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" + // }, + // "prefix": { + // "description": "Filter results to buckets whose names begin with this prefix.", + // "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/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "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{} + ctx_ context.Context +} + +// 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 int64) *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 int64) *BucketsPatchCall { + c.opt_["ifMetagenerationNotMatch"] = ifMetagenerationNotMatch + return c +} + +// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a +// predefined set of access controls to this bucket. +// +// Possible values: +// "authenticatedRead" - Project team owners get OWNER access, and +// allAuthenticatedUsers get READER access. +// "private" - Project team owners get OWNER access. +// "projectPrivate" - Project team members get access according to +// their roles. +// "publicRead" - Project team owners get OWNER access, and allUsers +// get READER access. +// "publicReadWrite" - Project team owners get OWNER access, and +// allUsers get WRITER access. +func (c *BucketsPatchCall) PredefinedAcl(predefinedAcl string) *BucketsPatchCall { + c.opt_["predefinedAcl"] = predefinedAcl + return c +} + +// PredefinedDefaultObjectAcl sets the optional parameter +// "predefinedDefaultObjectAcl": Apply a predefined set of default +// object access controls to this bucket. +// +// Possible values: +// "authenticatedRead" - Object owner gets OWNER access, and +// allAuthenticatedUsers get READER access. +// "bucketOwnerFullControl" - Object owner gets OWNER access, and +// project team owners get OWNER access. +// "bucketOwnerRead" - Object owner gets OWNER access, and project +// team owners get READER access. +// "private" - Object owner gets OWNER access. +// "projectPrivate" - Object owner gets OWNER access, and project team +// members get access according to their roles. +// "publicRead" - Object owner gets OWNER access, and allUsers get +// READER access. +func (c *BucketsPatchCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsPatchCall { + c.opt_["predefinedDefaultObjectAcl"] = predefinedDefaultObjectAcl + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to full. +// +// Possible values: +// "full" - Include all properties. +// "noAcl" - Omit acl and defaultObjectAcl properties. +func (c *BucketsPatchCall) Projection(projection string) *BucketsPatchCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketsPatchCall) Fields(s ...googleapi.Field) *BucketsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketsPatchCall) Context(ctx context.Context) *BucketsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *BucketsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + 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_["predefinedAcl"]; ok { + params.Set("predefinedAcl", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["predefinedDefaultObjectAcl"]; ok { + params.Set("predefinedDefaultObjectAcl", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.buckets.patch" call. +// Exactly one of *Bucket or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Bucket.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BucketsPatchCall) Do() (*Bucket, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Bucket{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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": "int64", + // "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": "int64", + // "location": "query", + // "type": "string" + // }, + // "predefinedAcl": { + // "description": "Apply a predefined set of access controls to this bucket.", + // "enum": [ + // "authenticatedRead", + // "private", + // "projectPrivate", + // "publicRead", + // "publicReadWrite" + // ], + // "enumDescriptions": [ + // "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", + // "Project team owners get OWNER access.", + // "Project team members get access according to their roles.", + // "Project team owners get OWNER access, and allUsers get READER access.", + // "Project team owners get OWNER access, and allUsers get WRITER access." + // ], + // "location": "query", + // "type": "string" + // }, + // "predefinedDefaultObjectAcl": { + // "description": "Apply a predefined set of default object access controls to this bucket.", + // "enum": [ + // "authenticatedRead", + // "bucketOwnerFullControl", + // "bucketOwnerRead", + // "private", + // "projectPrivate", + // "publicRead" + // ], + // "enumDescriptions": [ + // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + // "Object owner gets OWNER access, and project team owners get OWNER access.", + // "Object owner gets OWNER access, and project team owners get READER access.", + // "Object owner gets OWNER access.", + // "Object owner gets OWNER access, and project team members get access according to their roles.", + // "Object owner gets OWNER access, and allUsers get READER access." + // ], + // "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 int64) *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 int64) *BucketsUpdateCall { + c.opt_["ifMetagenerationNotMatch"] = ifMetagenerationNotMatch + return c +} + +// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a +// predefined set of access controls to this bucket. +// +// Possible values: +// "authenticatedRead" - Project team owners get OWNER access, and +// allAuthenticatedUsers get READER access. +// "private" - Project team owners get OWNER access. +// "projectPrivate" - Project team members get access according to +// their roles. +// "publicRead" - Project team owners get OWNER access, and allUsers +// get READER access. +// "publicReadWrite" - Project team owners get OWNER access, and +// allUsers get WRITER access. +func (c *BucketsUpdateCall) PredefinedAcl(predefinedAcl string) *BucketsUpdateCall { + c.opt_["predefinedAcl"] = predefinedAcl + return c +} + +// PredefinedDefaultObjectAcl sets the optional parameter +// "predefinedDefaultObjectAcl": Apply a predefined set of default +// object access controls to this bucket. +// +// Possible values: +// "authenticatedRead" - Object owner gets OWNER access, and +// allAuthenticatedUsers get READER access. +// "bucketOwnerFullControl" - Object owner gets OWNER access, and +// project team owners get OWNER access. +// "bucketOwnerRead" - Object owner gets OWNER access, and project +// team owners get READER access. +// "private" - Object owner gets OWNER access. +// "projectPrivate" - Object owner gets OWNER access, and project team +// members get access according to their roles. +// "publicRead" - Object owner gets OWNER access, and allUsers get +// READER access. +func (c *BucketsUpdateCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsUpdateCall { + c.opt_["predefinedDefaultObjectAcl"] = predefinedDefaultObjectAcl + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to full. +// +// Possible values: +// "full" - Include all properties. +// "noAcl" - Omit acl and defaultObjectAcl properties. +func (c *BucketsUpdateCall) Projection(projection string) *BucketsUpdateCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketsUpdateCall) Fields(s ...googleapi.Field) *BucketsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketsUpdateCall) Context(ctx context.Context) *BucketsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *BucketsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + 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_["predefinedAcl"]; ok { + params.Set("predefinedAcl", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["predefinedDefaultObjectAcl"]; ok { + params.Set("predefinedDefaultObjectAcl", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.buckets.update" call. +// Exactly one of *Bucket or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Bucket.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BucketsUpdateCall) Do() (*Bucket, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Bucket{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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": "int64", + // "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": "int64", + // "location": "query", + // "type": "string" + // }, + // "predefinedAcl": { + // "description": "Apply a predefined set of access controls to this bucket.", + // "enum": [ + // "authenticatedRead", + // "private", + // "projectPrivate", + // "publicRead", + // "publicReadWrite" + // ], + // "enumDescriptions": [ + // "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", + // "Project team owners get OWNER access.", + // "Project team members get access according to their roles.", + // "Project team owners get OWNER access, and allUsers get READER access.", + // "Project team owners get OWNER access, and allUsers get WRITER access." + // ], + // "location": "query", + // "type": "string" + // }, + // "predefinedDefaultObjectAcl": { + // "description": "Apply a predefined set of default object access controls to this bucket.", + // "enum": [ + // "authenticatedRead", + // "bucketOwnerFullControl", + // "bucketOwnerRead", + // "private", + // "projectPrivate", + // "publicRead" + // ], + // "enumDescriptions": [ + // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + // "Object owner gets OWNER access, and project team owners get OWNER access.", + // "Object owner gets OWNER access, and project team owners get READER access.", + // "Object owner gets OWNER access.", + // "Object owner gets OWNER access, and project team members get access according to their roles.", + // "Object owner gets OWNER access, and allUsers get READER access." + // ], + // "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall { + c.ctx_ = ctx + return c +} + +func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.channels.stop" call. +func (c *ChannelsStopCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DefaultObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DefaultObjectAccessControlsDeleteCall) Context(ctx context.Context) *DefaultObjectAccessControlsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *DefaultObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "entity": c.entity, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.defaultObjectAccessControls.delete" call. +func (c *DefaultObjectAccessControlsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DefaultObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DefaultObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DefaultObjectAccessControlsGetCall) Context(ctx context.Context) *DefaultObjectAccessControlsGetCall { + c.ctx_ = ctx + return c +} + +func (c *DefaultObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "entity": c.entity, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.defaultObjectAccessControls.get" call. +// Exactly one of *ObjectAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ObjectAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DefaultObjectAccessControlsGetCall) Do() (*ObjectAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ObjectAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DefaultObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DefaultObjectAccessControlsInsertCall) Context(ctx context.Context) *DefaultObjectAccessControlsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *DefaultObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.defaultObjectAccessControls.insert" call. +// Exactly one of *ObjectAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ObjectAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DefaultObjectAccessControlsInsertCall) Do() (*ObjectAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ObjectAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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": If present, only return default ACL listing +// if the bucket's current metageneration matches this value. +func (c *DefaultObjectAccessControlsListCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *DefaultObjectAccessControlsListCall { + c.opt_["ifMetagenerationMatch"] = ifMetagenerationMatch + return c +} + +// IfMetagenerationNotMatch sets the optional parameter +// "ifMetagenerationNotMatch": If present, only return default ACL +// listing if the bucket's current metageneration does not match the +// given value. +func (c *DefaultObjectAccessControlsListCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *DefaultObjectAccessControlsListCall { + c.opt_["ifMetagenerationNotMatch"] = ifMetagenerationNotMatch + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DefaultObjectAccessControlsListCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DefaultObjectAccessControlsListCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DefaultObjectAccessControlsListCall) Context(ctx context.Context) *DefaultObjectAccessControlsListCall { + c.ctx_ = ctx + return c +} + +func (c *DefaultObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.defaultObjectAccessControls.list" call. +// Exactly one of *ObjectAccessControls or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ObjectAccessControls.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DefaultObjectAccessControlsListCall) Do() (*ObjectAccessControls, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ObjectAccessControls{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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": "If present, only return default ACL listing if the bucket's current metageneration matches this value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationNotMatch": { + // "description": "If present, only return default ACL listing if the bucket's current metageneration does not match the given value.", + // "format": "int64", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DefaultObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DefaultObjectAccessControlsPatchCall) Context(ctx context.Context) *DefaultObjectAccessControlsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *DefaultObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "entity": c.entity, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.defaultObjectAccessControls.patch" call. +// Exactly one of *ObjectAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ObjectAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DefaultObjectAccessControlsPatchCall) Do() (*ObjectAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ObjectAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DefaultObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DefaultObjectAccessControlsUpdateCall) Context(ctx context.Context) *DefaultObjectAccessControlsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *DefaultObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "entity": c.entity, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.defaultObjectAccessControls.update" call. +// Exactly one of *ObjectAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ObjectAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DefaultObjectAccessControlsUpdateCall) Do() (*ObjectAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ObjectAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 int64) *ObjectAccessControlsDeleteCall { + c.opt_["generation"] = generation + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *ObjectAccessControlsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectAccessControlsDeleteCall) Context(ctx context.Context) *ObjectAccessControlsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["generation"]; ok { + params.Set("generation", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + "entity": c.entity, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objectAccessControls.delete" call. +func (c *ObjectAccessControlsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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": "int64", + // "location": "query", + // "type": "string" + // }, + // "object": { + // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + // "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{} + ctx_ context.Context +} + +// 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 int64) *ObjectAccessControlsGetCall { + c.opt_["generation"] = generation + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *ObjectAccessControlsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *ObjectAccessControlsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectAccessControlsGetCall) Context(ctx context.Context) *ObjectAccessControlsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["generation"]; ok { + params.Set("generation", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + "entity": c.entity, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objectAccessControls.get" call. +// Exactly one of *ObjectAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ObjectAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ObjectAccessControlsGetCall) Do() (*ObjectAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ObjectAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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": "int64", + // "location": "query", + // "type": "string" + // }, + // "object": { + // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + // "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{} + ctx_ context.Context +} + +// 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 int64) *ObjectAccessControlsInsertCall { + c.opt_["generation"] = generation + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *ObjectAccessControlsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectAccessControlsInsertCall) Context(ctx context.Context) *ObjectAccessControlsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["generation"]; ok { + params.Set("generation", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objectAccessControls.insert" call. +// Exactly one of *ObjectAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ObjectAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ObjectAccessControlsInsertCall) Do() (*ObjectAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ObjectAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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": "int64", + // "location": "query", + // "type": "string" + // }, + // "object": { + // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + // "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{} + ctx_ context.Context +} + +// 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 int64) *ObjectAccessControlsListCall { + c.opt_["generation"] = generation + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectAccessControlsListCall) Fields(s ...googleapi.Field) *ObjectAccessControlsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ObjectAccessControlsListCall) IfNoneMatch(entityTag string) *ObjectAccessControlsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectAccessControlsListCall) Context(ctx context.Context) *ObjectAccessControlsListCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["generation"]; ok { + params.Set("generation", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objectAccessControls.list" call. +// Exactly one of *ObjectAccessControls or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ObjectAccessControls.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ObjectAccessControlsListCall) Do() (*ObjectAccessControls, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ObjectAccessControls{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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": "int64", + // "location": "query", + // "type": "string" + // }, + // "object": { + // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + // "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{} + ctx_ context.Context +} + +// 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 int64) *ObjectAccessControlsPatchCall { + c.opt_["generation"] = generation + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *ObjectAccessControlsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectAccessControlsPatchCall) Context(ctx context.Context) *ObjectAccessControlsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["generation"]; ok { + params.Set("generation", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + "entity": c.entity, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objectAccessControls.patch" call. +// Exactly one of *ObjectAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ObjectAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ObjectAccessControlsPatchCall) Do() (*ObjectAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ObjectAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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": "int64", + // "location": "query", + // "type": "string" + // }, + // "object": { + // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + // "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{} + ctx_ context.Context +} + +// 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 int64) *ObjectAccessControlsUpdateCall { + c.opt_["generation"] = generation + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *ObjectAccessControlsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectAccessControlsUpdateCall) Context(ctx context.Context) *ObjectAccessControlsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["generation"]; ok { + params.Set("generation", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + "entity": c.entity, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objectAccessControls.update" call. +// Exactly one of *ObjectAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ObjectAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ObjectAccessControlsUpdateCall) Do() (*ObjectAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ObjectAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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": "int64", + // "location": "query", + // "type": "string" + // }, + // "object": { + // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// DestinationPredefinedAcl sets the optional parameter +// "destinationPredefinedAcl": Apply a predefined set of access controls +// to the destination object. +// +// Possible values: +// "authenticatedRead" - Object owner gets OWNER access, and +// allAuthenticatedUsers get READER access. +// "bucketOwnerFullControl" - Object owner gets OWNER access, and +// project team owners get OWNER access. +// "bucketOwnerRead" - Object owner gets OWNER access, and project +// team owners get READER access. +// "private" - Object owner gets OWNER access. +// "projectPrivate" - Object owner gets OWNER access, and project team +// members get access according to their roles. +// "publicRead" - Object owner gets OWNER access, and allUsers get +// READER access. +func (c *ObjectsComposeCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsComposeCall { + c.opt_["destinationPredefinedAcl"] = destinationPredefinedAcl + 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 int64) *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 int64) *ObjectsComposeCall { + c.opt_["ifMetagenerationMatch"] = ifMetagenerationMatch + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectsComposeCall) Fields(s ...googleapi.Field) *ObjectsComposeCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectsComposeCall) Context(ctx context.Context) *ObjectsComposeCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectsComposeCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["destinationPredefinedAcl"]; ok { + params.Set("destinationPredefinedAcl", fmt.Sprintf("%v", v)) + } + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{destinationBucket}/o/{destinationObject}/compose") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "destinationBucket": c.destinationBucket, + "destinationObject": c.destinationObject, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *ObjectsComposeCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "storage.objects.compose" call. +// Exactly one of *Object or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Object.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ObjectsComposeCall) Do() (*Object, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Object{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "destinationPredefinedAcl": { + // "description": "Apply a predefined set of access controls to the destination object.", + // "enum": [ + // "authenticatedRead", + // "bucketOwnerFullControl", + // "bucketOwnerRead", + // "private", + // "projectPrivate", + // "publicRead" + // ], + // "enumDescriptions": [ + // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + // "Object owner gets OWNER access, and project team owners get OWNER access.", + // "Object owner gets OWNER access, and project team owners get READER access.", + // "Object owner gets OWNER access.", + // "Object owner gets OWNER access, and project team members get access according to their roles.", + // "Object owner gets OWNER access, and allUsers get READER access." + // ], + // "location": "query", + // "type": "string" + // }, + // "ifGenerationMatch": { + // "description": "Makes the operation conditional on whether the object's current generation matches the given value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationMatch": { + // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "b/{destinationBucket}/o/{destinationObject}/compose", + // "request": { + // "$ref": "ComposeRequest" + // }, + // "response": { + // "$ref": "Object" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Copy: Copies a source object to a destination object. 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 +} + +// DestinationPredefinedAcl sets the optional parameter +// "destinationPredefinedAcl": Apply a predefined set of access controls +// to the destination object. +// +// Possible values: +// "authenticatedRead" - Object owner gets OWNER access, and +// allAuthenticatedUsers get READER access. +// "bucketOwnerFullControl" - Object owner gets OWNER access, and +// project team owners get OWNER access. +// "bucketOwnerRead" - Object owner gets OWNER access, and project +// team owners get READER access. +// "private" - Object owner gets OWNER access. +// "projectPrivate" - Object owner gets OWNER access, and project team +// members get access according to their roles. +// "publicRead" - Object owner gets OWNER access, and allUsers get +// READER access. +func (c *ObjectsCopyCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsCopyCall { + c.opt_["destinationPredefinedAcl"] = destinationPredefinedAcl + 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 int64) *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 int64) *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 int64) *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 int64) *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 int64) *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 int64) *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 int64) *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 int64) *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. +// +// Possible values: +// "full" - Include all properties. +// "noAcl" - Omit the acl property. +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 int64) *ObjectsCopyCall { + c.opt_["sourceGeneration"] = sourceGeneration + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectsCopyCall) Fields(s ...googleapi.Field) *ObjectsCopyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectsCopyCall) Context(ctx context.Context) *ObjectsCopyCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectsCopyCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["destinationPredefinedAcl"]; ok { + params.Set("destinationPredefinedAcl", 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_["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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "sourceBucket": c.sourceBucket, + "sourceObject": c.sourceObject, + "destinationBucket": c.destinationBucket, + "destinationObject": c.destinationObject, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *ObjectsCopyCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "storage.objects.copy" call. +// Exactly one of *Object or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Object.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ObjectsCopyCall) Do() (*Object, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Object{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Copies a source object to a destination object. 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.For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + // "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" + // }, + // "destinationPredefinedAcl": { + // "description": "Apply a predefined set of access controls to the destination object.", + // "enum": [ + // "authenticatedRead", + // "bucketOwnerFullControl", + // "bucketOwnerRead", + // "private", + // "projectPrivate", + // "publicRead" + // ], + // "enumDescriptions": [ + // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + // "Object owner gets OWNER access, and project team owners get OWNER access.", + // "Object owner gets OWNER access, and project team owners get READER access.", + // "Object owner gets OWNER access.", + // "Object owner gets OWNER access, and project team members get access according to their roles.", + // "Object owner gets OWNER access, and allUsers get READER access." + // ], + // "location": "query", + // "type": "string" + // }, + // "ifGenerationMatch": { + // "description": "Makes the operation conditional on whether the destination object's current generation matches the given value.", + // "format": "int64", + // "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": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationMatch": { + // "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.", + // "format": "int64", + // "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": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifSourceGenerationMatch": { + // "description": "Makes the operation conditional on whether the source object's generation matches the given value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifSourceGenerationNotMatch": { + // "description": "Makes the operation conditional on whether the source object's generation does not match the given value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifSourceMetagenerationMatch": { + // "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.", + // "format": "int64", + // "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": "int64", + // "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": "int64", + // "location": "query", + // "type": "string" + // }, + // "sourceObject": { + // "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + // "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Delete: Deletes an object and its 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 int64) *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 int64) *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 int64) *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 int64) *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 int64) *ObjectsDeleteCall { + c.opt_["ifMetagenerationNotMatch"] = ifMetagenerationNotMatch + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectsDeleteCall) Fields(s ...googleapi.Field) *ObjectsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectsDeleteCall) Context(ctx context.Context) *ObjectsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objects.delete" call. +func (c *ObjectsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes an object and its 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": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifGenerationMatch": { + // "description": "Makes the operation conditional on whether the object's current generation matches the given value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifGenerationNotMatch": { + // "description": "Makes the operation conditional on whether the object's current generation does not match the given value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationMatch": { + // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationNotMatch": { + // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "object": { + // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{bucket}/o/{object}", + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Get: Retrieves an object or its 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 int64) *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 int64) *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 int64) *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 int64) *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 int64) *ObjectsGetCall { + c.opt_["ifMetagenerationNotMatch"] = ifMetagenerationNotMatch + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to noAcl. +// +// Possible values: +// "full" - Include all properties. +// "noAcl" - Omit the acl property. +func (c *ObjectsGetCall) Projection(projection string) *ObjectsGetCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectsGetCall) Fields(s ...googleapi.Field) *ObjectsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ObjectsGetCall) IfNoneMatch(entityTag string) *ObjectsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectsGetCall) Context(ctx context.Context) *ObjectsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *ObjectsGetCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "storage.objects.get" call. +// Exactly one of *Object or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Object.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ObjectsGetCall) Do() (*Object, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Object{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves an object or its 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": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifGenerationMatch": { + // "description": "Makes the operation conditional on whether the object's generation matches the given value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifGenerationNotMatch": { + // "description": "Makes the operation conditional on whether the object's generation does not match the given value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationMatch": { + // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationNotMatch": { + // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "object": { + // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + // "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/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "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 + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// Insert: Stores a new object and 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 +} + +// ContentEncoding sets the optional parameter "contentEncoding": If +// set, sets the contentEncoding property of the final object to this +// value. Setting this parameter is equivalent to setting the +// contentEncoding metadata property. This can be useful when uploading +// an object with uploadType=media to indicate the encoding of the +// content being uploaded. +func (c *ObjectsInsertCall) ContentEncoding(contentEncoding string) *ObjectsInsertCall { + c.opt_["contentEncoding"] = contentEncoding + 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 int64) *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 int64) *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 int64) *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 int64) *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. For information about how to +// URL encode object names to be path safe, see Encoding URI Path Parts. +func (c *ObjectsInsertCall) Name(name string) *ObjectsInsertCall { + c.opt_["name"] = name + return c +} + +// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a +// predefined set of access controls to this object. +// +// Possible values: +// "authenticatedRead" - Object owner gets OWNER access, and +// allAuthenticatedUsers get READER access. +// "bucketOwnerFullControl" - Object owner gets OWNER access, and +// project team owners get OWNER access. +// "bucketOwnerRead" - Object owner gets OWNER access, and project +// team owners get READER access. +// "private" - Object owner gets OWNER access. +// "projectPrivate" - Object owner gets OWNER access, and project team +// members get access according to their roles. +// "publicRead" - Object owner gets OWNER access, and allUsers get +// READER access. +func (c *ObjectsInsertCall) PredefinedAcl(predefinedAcl string) *ObjectsInsertCall { + c.opt_["predefinedAcl"] = predefinedAcl + 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. +// +// Possible values: +// "full" - Include all properties. +// "noAcl" - Omit the acl property. +func (c *ObjectsInsertCall) Projection(projection string) *ObjectsInsertCall { + c.opt_["projection"] = projection + return c +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *ObjectsInsertCall) Media(r io.Reader) *ObjectsInsertCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *ObjectsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ObjectsInsertCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *ObjectsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ObjectsInsertCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectsInsertCall) Fields(s ...googleapi.Field) *ObjectsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *ObjectsInsertCall) Context(ctx context.Context) *ObjectsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["contentEncoding"]; ok { + params.Set("contentEncoding", 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_["name"]; ok { + params.Set("name", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["predefinedAcl"]; ok { + params.Set("predefinedAcl", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objects.insert" call. +// Exactly one of *Object or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Object.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ObjectsInsertCall) Do() (*Object, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &Object{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Stores a new object and metadata.", + // "httpMethod": "POST", + // "id": "storage.objects.insert", + // "mediaUpload": { + // "accept": [ + // "*/*" + // ], + // "protocols": { + // "resumable": { + // "multipart": true, + // "path": "/resumable/upload/storage/v1/b/{bucket}/o" + // }, + // "simple": { + // "multipart": true, + // "path": "/upload/storage/v1/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" + // }, + // "contentEncoding": { + // "description": "If set, sets the contentEncoding property of the final object to this value. Setting this parameter is equivalent to setting the contentEncoding metadata property. This can be useful when uploading an object with uploadType=media to indicate the encoding of the content being uploaded.", + // "location": "query", + // "type": "string" + // }, + // "ifGenerationMatch": { + // "description": "Makes the operation conditional on whether the object's current generation matches the given value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifGenerationNotMatch": { + // "description": "Makes the operation conditional on whether the object's current generation does not match the given value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationMatch": { + // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationNotMatch": { + // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + // "format": "int64", + // "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. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + // "location": "query", + // "type": "string" + // }, + // "predefinedAcl": { + // "description": "Apply a predefined set of access controls to this object.", + // "enum": [ + // "authenticatedRead", + // "bucketOwnerFullControl", + // "bucketOwnerRead", + // "private", + // "projectPrivate", + // "publicRead" + // ], + // "enumDescriptions": [ + // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + // "Object owner gets OWNER access, and project team owners get OWNER access.", + // "Object owner gets OWNER access, and project team owners get READER access.", + // "Object owner gets OWNER access.", + // "Object owner gets OWNER access, and project team members get access according to their roles.", + // "Object owner gets OWNER access, and allUsers get READER access." + // ], + // "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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. The default value +// of this parameter is 1,000 items. +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. +// +// Possible values: +// "full" - Include all properties. +// "noAcl" - Omit the acl property. +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 an object as distinct results. The default is false. For +// more information, see Object Versioning. +func (c *ObjectsListCall) Versions(versions bool) *ObjectsListCall { + c.opt_["versions"] = versions + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectsListCall) Fields(s ...googleapi.Field) *ObjectsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ObjectsListCall) IfNoneMatch(entityTag string) *ObjectsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectsListCall) Context(ctx context.Context) *ObjectsListCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objects.list" call. +// Exactly one of *Objects or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Objects.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ObjectsListCall) Do() (*Objects, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Objects{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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. The default value of this parameter is 1,000 items.", + // "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 an object as distinct results. The default is false. For more information, see Object Versioning.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "b/{bucket}/o", + // "response": { + // "$ref": "Objects" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "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{} + ctx_ context.Context +} + +// Patch: Updates an object's 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 int64) *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 int64) *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 int64) *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 int64) *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 int64) *ObjectsPatchCall { + c.opt_["ifMetagenerationNotMatch"] = ifMetagenerationNotMatch + return c +} + +// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a +// predefined set of access controls to this object. +// +// Possible values: +// "authenticatedRead" - Object owner gets OWNER access, and +// allAuthenticatedUsers get READER access. +// "bucketOwnerFullControl" - Object owner gets OWNER access, and +// project team owners get OWNER access. +// "bucketOwnerRead" - Object owner gets OWNER access, and project +// team owners get READER access. +// "private" - Object owner gets OWNER access. +// "projectPrivate" - Object owner gets OWNER access, and project team +// members get access according to their roles. +// "publicRead" - Object owner gets OWNER access, and allUsers get +// READER access. +func (c *ObjectsPatchCall) PredefinedAcl(predefinedAcl string) *ObjectsPatchCall { + c.opt_["predefinedAcl"] = predefinedAcl + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to full. +// +// Possible values: +// "full" - Include all properties. +// "noAcl" - Omit the acl property. +func (c *ObjectsPatchCall) Projection(projection string) *ObjectsPatchCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectsPatchCall) Fields(s ...googleapi.Field) *ObjectsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectsPatchCall) Context(ctx context.Context) *ObjectsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + 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_["predefinedAcl"]; ok { + params.Set("predefinedAcl", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objects.patch" call. +// Exactly one of *Object or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Object.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ObjectsPatchCall) Do() (*Object, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Object{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an object's 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": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifGenerationMatch": { + // "description": "Makes the operation conditional on whether the object's current generation matches the given value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifGenerationNotMatch": { + // "description": "Makes the operation conditional on whether the object's current generation does not match the given value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationMatch": { + // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationNotMatch": { + // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "object": { + // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "predefinedAcl": { + // "description": "Apply a predefined set of access controls to this object.", + // "enum": [ + // "authenticatedRead", + // "bucketOwnerFullControl", + // "bucketOwnerRead", + // "private", + // "projectPrivate", + // "publicRead" + // ], + // "enumDescriptions": [ + // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + // "Object owner gets OWNER access, and project team owners get OWNER access.", + // "Object owner gets OWNER access, and project team owners get READER access.", + // "Object owner gets OWNER access.", + // "Object owner gets OWNER access, and project team members get access according to their roles.", + // "Object owner gets OWNER access, and allUsers get READER access." + // ], + // "location": "query", + // "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/cloud-platform", + // "https://www.googleapis.com/auth/devstorage.full_control", + // "https://www.googleapis.com/auth/devstorage.read_write" + // ] + // } + +} + +// method id "storage.objects.rewrite": + +type ObjectsRewriteCall struct { + s *Service + sourceBucket string + sourceObject string + destinationBucket string + destinationObject string + object *Object + opt_ map[string]interface{} + ctx_ context.Context +} + +// Rewrite: Rewrites a source object to a destination object. Optionally +// overrides metadata. +func (r *ObjectsService) Rewrite(sourceBucket string, sourceObject string, destinationBucket string, destinationObject string, object *Object) *ObjectsRewriteCall { + c := &ObjectsRewriteCall{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 +} + +// DestinationPredefinedAcl sets the optional parameter +// "destinationPredefinedAcl": Apply a predefined set of access controls +// to the destination object. +// +// Possible values: +// "authenticatedRead" - Object owner gets OWNER access, and +// allAuthenticatedUsers get READER access. +// "bucketOwnerFullControl" - Object owner gets OWNER access, and +// project team owners get OWNER access. +// "bucketOwnerRead" - Object owner gets OWNER access, and project +// team owners get READER access. +// "private" - Object owner gets OWNER access. +// "projectPrivate" - Object owner gets OWNER access, and project team +// members get access according to their roles. +// "publicRead" - Object owner gets OWNER access, and allUsers get +// READER access. +func (c *ObjectsRewriteCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsRewriteCall { + c.opt_["destinationPredefinedAcl"] = destinationPredefinedAcl + 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 *ObjectsRewriteCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsRewriteCall { + 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 *ObjectsRewriteCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsRewriteCall { + 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 *ObjectsRewriteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsRewriteCall { + 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 *ObjectsRewriteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsRewriteCall { + 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 *ObjectsRewriteCall) IfSourceGenerationMatch(ifSourceGenerationMatch int64) *ObjectsRewriteCall { + 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 *ObjectsRewriteCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch int64) *ObjectsRewriteCall { + 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 *ObjectsRewriteCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch int64) *ObjectsRewriteCall { + 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 *ObjectsRewriteCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch int64) *ObjectsRewriteCall { + c.opt_["ifSourceMetagenerationNotMatch"] = ifSourceMetagenerationNotMatch + return c +} + +// MaxBytesRewrittenPerCall sets the optional parameter +// "maxBytesRewrittenPerCall": The maximum number of bytes that will be +// rewritten per rewrite request. Most callers shouldn't need to specify +// this parameter - it is primarily in place to support testing. If +// specified the value must be an integral multiple of 1 MiB (1048576). +// Also, this only applies to requests where the source and destination +// span locations and/or storage classes. Finally, this value must not +// change across rewrite calls else you'll get an error that the +// rewriteToken is invalid. +func (c *ObjectsRewriteCall) MaxBytesRewrittenPerCall(maxBytesRewrittenPerCall int64) *ObjectsRewriteCall { + c.opt_["maxBytesRewrittenPerCall"] = maxBytesRewrittenPerCall + 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. +// +// Possible values: +// "full" - Include all properties. +// "noAcl" - Omit the acl property. +func (c *ObjectsRewriteCall) Projection(projection string) *ObjectsRewriteCall { + c.opt_["projection"] = projection + return c +} + +// RewriteToken sets the optional parameter "rewriteToken": Include this +// field (from the previous rewrite response) on each rewrite request +// after the first one, until the rewrite response 'done' flag is true. +// Calls that provide a rewriteToken can omit all other request fields, +// but if included those fields must match the values provided in the +// first rewrite request. +func (c *ObjectsRewriteCall) RewriteToken(rewriteToken string) *ObjectsRewriteCall { + c.opt_["rewriteToken"] = rewriteToken + 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 *ObjectsRewriteCall) SourceGeneration(sourceGeneration int64) *ObjectsRewriteCall { + c.opt_["sourceGeneration"] = sourceGeneration + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectsRewriteCall) Fields(s ...googleapi.Field) *ObjectsRewriteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectsRewriteCall) Context(ctx context.Context) *ObjectsRewriteCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectsRewriteCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["destinationPredefinedAcl"]; ok { + params.Set("destinationPredefinedAcl", 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_["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_["maxBytesRewrittenPerCall"]; ok { + params.Set("maxBytesRewrittenPerCall", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["rewriteToken"]; ok { + params.Set("rewriteToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["sourceGeneration"]; ok { + params.Set("sourceGeneration", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "sourceBucket": c.sourceBucket, + "sourceObject": c.sourceObject, + "destinationBucket": c.destinationBucket, + "destinationObject": c.destinationObject, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objects.rewrite" call. +// Exactly one of *RewriteResponse or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *RewriteResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ObjectsRewriteCall) Do() (*RewriteResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &RewriteResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Rewrites a source object to a destination object. Optionally overrides metadata.", + // "httpMethod": "POST", + // "id": "storage.objects.rewrite", + // "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. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "destinationPredefinedAcl": { + // "description": "Apply a predefined set of access controls to the destination object.", + // "enum": [ + // "authenticatedRead", + // "bucketOwnerFullControl", + // "bucketOwnerRead", + // "private", + // "projectPrivate", + // "publicRead" + // ], + // "enumDescriptions": [ + // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + // "Object owner gets OWNER access, and project team owners get OWNER access.", + // "Object owner gets OWNER access, and project team owners get READER access.", + // "Object owner gets OWNER access.", + // "Object owner gets OWNER access, and project team members get access according to their roles.", + // "Object owner gets OWNER access, and allUsers get READER access." + // ], + // "location": "query", + // "type": "string" + // }, + // "ifGenerationMatch": { + // "description": "Makes the operation conditional on whether the destination object's current generation matches the given value.", + // "format": "int64", + // "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": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationMatch": { + // "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.", + // "format": "int64", + // "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": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifSourceGenerationMatch": { + // "description": "Makes the operation conditional on whether the source object's generation matches the given value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifSourceGenerationNotMatch": { + // "description": "Makes the operation conditional on whether the source object's generation does not match the given value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifSourceMetagenerationMatch": { + // "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.", + // "format": "int64", + // "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": "int64", + // "location": "query", + // "type": "string" + // }, + // "maxBytesRewrittenPerCall": { + // "description": "The maximum number of bytes that will be rewritten per rewrite request. Most callers shouldn't need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB (1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across rewrite calls else you'll get an error that the rewriteToken is invalid.", + // "format": "int64", + // "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" + // }, + // "rewriteToken": { + // "description": "Include this field (from the previous rewrite response) on each rewrite request after the first one, until the rewrite response 'done' flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request.", + // "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": "int64", + // "location": "query", + // "type": "string" + // }, + // "sourceObject": { + // "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}", + // "request": { + // "$ref": "Object" + // }, + // "response": { + // "$ref": "RewriteResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "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{} + ctx_ context.Context +} + +// Update: Updates an object's 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 int64) *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 int64) *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 int64) *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 int64) *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 int64) *ObjectsUpdateCall { + c.opt_["ifMetagenerationNotMatch"] = ifMetagenerationNotMatch + return c +} + +// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a +// predefined set of access controls to this object. +// +// Possible values: +// "authenticatedRead" - Object owner gets OWNER access, and +// allAuthenticatedUsers get READER access. +// "bucketOwnerFullControl" - Object owner gets OWNER access, and +// project team owners get OWNER access. +// "bucketOwnerRead" - Object owner gets OWNER access, and project +// team owners get READER access. +// "private" - Object owner gets OWNER access. +// "projectPrivate" - Object owner gets OWNER access, and project team +// members get access according to their roles. +// "publicRead" - Object owner gets OWNER access, and allUsers get +// READER access. +func (c *ObjectsUpdateCall) PredefinedAcl(predefinedAcl string) *ObjectsUpdateCall { + c.opt_["predefinedAcl"] = predefinedAcl + return c +} + +// Projection sets the optional parameter "projection": Set of +// properties to return. Defaults to full. +// +// Possible values: +// "full" - Include all properties. +// "noAcl" - Omit the acl property. +func (c *ObjectsUpdateCall) Projection(projection string) *ObjectsUpdateCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectsUpdateCall) Fields(s ...googleapi.Field) *ObjectsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectsUpdateCall) Context(ctx context.Context) *ObjectsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + 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_["predefinedAcl"]; ok { + params.Set("predefinedAcl", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *ObjectsUpdateCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "storage.objects.update" call. +// Exactly one of *Object or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Object.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ObjectsUpdateCall) Do() (*Object, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Object{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an object's 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": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifGenerationMatch": { + // "description": "Makes the operation conditional on whether the object's current generation matches the given value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifGenerationNotMatch": { + // "description": "Makes the operation conditional on whether the object's current generation does not match the given value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationMatch": { + // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationNotMatch": { + // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "object": { + // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "predefinedAcl": { + // "description": "Apply a predefined set of access controls to this object.", + // "enum": [ + // "authenticatedRead", + // "bucketOwnerFullControl", + // "bucketOwnerRead", + // "private", + // "projectPrivate", + // "publicRead" + // ], + // "enumDescriptions": [ + // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + // "Object owner gets OWNER access, and project team owners get OWNER access.", + // "Object owner gets OWNER access, and project team owners get READER access.", + // "Object owner gets OWNER access.", + // "Object owner gets OWNER access, and project team members get access according to their roles.", + // "Object owner gets OWNER access, and allUsers get READER access." + // ], + // "location": "query", + // "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/cloud-platform", + // "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{} + ctx_ context.Context +} + +// 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. The default value +// of this parameter is 1,000 items. +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. +// +// Possible values: +// "full" - Include all properties. +// "noAcl" - Omit the acl property. +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 an object as distinct results. The default is false. For +// more information, see Object Versioning. +func (c *ObjectsWatchAllCall) Versions(versions bool) *ObjectsWatchAllCall { + c.opt_["versions"] = versions + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectsWatchAllCall) Fields(s ...googleapi.Field) *ObjectsWatchAllCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectsWatchAllCall) Context(ctx context.Context) *ObjectsWatchAllCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectsWatchAllCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/watch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objects.watchAll" call. +// Exactly one of *Channel or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Channel.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ObjectsWatchAllCall) Do() (*Channel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Channel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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. The default value of this parameter is 1,000 items.", + // "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 an object as distinct results. The default is false. For more information, see Object Versioning.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "b/{bucket}/o/watch", + // "request": { + // "$ref": "Channel", + // "parameterName": "resource" + // }, + // "response": { + // "$ref": "Channel" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/cloud-platform.read-only", + // "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/Godeps/_workspace/src/google.golang.org/api/storage/v1beta1/storage-api.json b/Godeps/_workspace/src/google.golang.org/api/storage/v1beta1/storage-api.json new file mode 100644 index 000000000..c7deff586 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/storage/v1beta1/storage-api.json @@ -0,0 +1,1427 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/bTGfIvC19RkllzOnE1QWbh07cyk\"", + "discoveryVersion": "v1", + "id": "storage:v1beta1", + "name": "storage", + "version": "v1beta1", + "revision": "20151007", + "title": "Cloud Storage JSON 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/Godeps/_workspace/src/google.golang.org/api/storage/v1beta1/storage-gen.go b/Godeps/_workspace/src/google.golang.org/api/storage/v1beta1/storage-gen.go new file mode 100644 index 000000000..3c12c7ca5 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/storage/v1beta1/storage-gen.go @@ -0,0 +1,4166 @@ +// Package storage provides access to the Cloud Storage JSON API. +// +// See https://developers.google.com/storage/docs/json_api/ +// +// Usage example: +// +// import "google.golang.org/api/storage/v1beta1" +// ... +// storageService, err := storage.New(oauthHttpClient) +package storage // import "google.golang.org/api/storage/v1beta1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control" + + // View your data in Google Cloud Storage + DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only" + + // Manage your data in Google Cloud Storage + DevstorageReadWriteScope = "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 + UserAgent string // optional additional User-Agent fragment + + BucketAccessControls *BucketAccessControlsService + + Buckets *BucketsService + + ObjectAccessControls *ObjectAccessControlsService + + Objects *ObjectsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 +} + +// Bucket: A bucket. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Acl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Bucket) MarshalJSON() ([]byte, error) { + type noMethod Bucket + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BucketOwner: The owner of the bucket. This will always be the project +// team's owner group. +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"` + + // ForceSendFields is a list of field names (e.g. "Entity") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketOwner) MarshalJSON() ([]byte, error) { + type noMethod BucketOwner + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BucketWebsite: The bucket's website configuration. +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"` + + // ForceSendFields is a list of field names (e.g. "MainPageSuffix") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketWebsite) MarshalJSON() ([]byte, error) { + type noMethod BucketWebsite + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BucketAccessControl: An access-control entry. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Bucket") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketAccessControl) MarshalJSON() ([]byte, error) { + type noMethod BucketAccessControl + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BucketAccessControls: An access-control list. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketAccessControls) MarshalJSON() ([]byte, error) { + type noMethod BucketAccessControls + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Buckets: A list of buckets. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Buckets) MarshalJSON() ([]byte, error) { + type noMethod Buckets + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Object: An object. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Acl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Object) MarshalJSON() ([]byte, error) { + type noMethod Object + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ObjectMedia: Object media data. Provided on your behalf when +// uploading raw media or multipart/related with an auxiliary media +// part. +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"` + + // ForceSendFields is a list of field names (e.g. "Algorithm") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ObjectMedia) MarshalJSON() ([]byte, error) { + type noMethod ObjectMedia + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ObjectOwner: The owner of the object. This will always be the +// uploader of the object. +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"` + + // ForceSendFields is a list of field names (e.g. "Entity") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ObjectOwner) MarshalJSON() ([]byte, error) { + type noMethod ObjectOwner + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ObjectAccessControl: An access-control entry. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Bucket") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ObjectAccessControl) MarshalJSON() ([]byte, error) { + type noMethod ObjectAccessControl + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ObjectAccessControls: An access-control list. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ObjectAccessControls) MarshalJSON() ([]byte, error) { + type noMethod ObjectAccessControls + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Objects: A list of objects. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Objects) MarshalJSON() ([]byte, error) { + type noMethod Objects + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "storage.bucketAccessControls.delete": + +type BucketAccessControlsDeleteCall struct { + s *Service + bucket string + entity string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketAccessControlsDeleteCall) Fields(s ...googleapi.Field) *BucketAccessControlsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketAccessControlsDeleteCall) Context(ctx context.Context) *BucketAccessControlsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *BucketAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "entity": c.entity, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.bucketAccessControls.delete" call. +func (c *BucketAccessControlsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketAccessControlsGetCall) Fields(s ...googleapi.Field) *BucketAccessControlsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BucketAccessControlsGetCall) IfNoneMatch(entityTag string) *BucketAccessControlsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketAccessControlsGetCall) Context(ctx context.Context) *BucketAccessControlsGetCall { + c.ctx_ = ctx + return c +} + +func (c *BucketAccessControlsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "entity": c.entity, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.bucketAccessControls.get" call. +// Exactly one of *BucketAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BucketAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BucketAccessControlsGetCall) Do() (*BucketAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BucketAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketAccessControlsInsertCall) Fields(s ...googleapi.Field) *BucketAccessControlsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketAccessControlsInsertCall) Context(ctx context.Context) *BucketAccessControlsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *BucketAccessControlsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.bucketAccessControls.insert" call. +// Exactly one of *BucketAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BucketAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BucketAccessControlsInsertCall) Do() (*BucketAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BucketAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketAccessControlsListCall) Fields(s ...googleapi.Field) *BucketAccessControlsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BucketAccessControlsListCall) IfNoneMatch(entityTag string) *BucketAccessControlsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketAccessControlsListCall) Context(ctx context.Context) *BucketAccessControlsListCall { + c.ctx_ = ctx + return c +} + +func (c *BucketAccessControlsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.bucketAccessControls.list" call. +// Exactly one of *BucketAccessControls or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BucketAccessControls.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BucketAccessControlsListCall) Do() (*BucketAccessControls, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BucketAccessControls{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketAccessControlsPatchCall) Fields(s ...googleapi.Field) *BucketAccessControlsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketAccessControlsPatchCall) Context(ctx context.Context) *BucketAccessControlsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *BucketAccessControlsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "entity": c.entity, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.bucketAccessControls.patch" call. +// Exactly one of *BucketAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BucketAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BucketAccessControlsPatchCall) Do() (*BucketAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BucketAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketAccessControlsUpdateCall) Fields(s ...googleapi.Field) *BucketAccessControlsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketAccessControlsUpdateCall) Context(ctx context.Context) *BucketAccessControlsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *BucketAccessControlsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "entity": c.entity, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.bucketAccessControls.update" call. +// Exactly one of *BucketAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BucketAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BucketAccessControlsUpdateCall) Do() (*BucketAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BucketAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketsDeleteCall) Fields(s ...googleapi.Field) *BucketsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketsDeleteCall) Context(ctx context.Context) *BucketsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *BucketsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.buckets.delete" call. +func (c *BucketsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "full" - Include all properties. +// "no_acl" - Omit acl and defaultObjectAcl properties. +func (c *BucketsGetCall) Projection(projection string) *BucketsGetCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketsGetCall) Fields(s ...googleapi.Field) *BucketsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BucketsGetCall) IfNoneMatch(entityTag string) *BucketsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketsGetCall) Context(ctx context.Context) *BucketsGetCall { + c.ctx_ = ctx + return c +} + +func (c *BucketsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.buckets.get" call. +// Exactly one of *Bucket or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Bucket.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BucketsGetCall) Do() (*Bucket, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Bucket{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "full" - Include all properties. +// "no_acl" - Omit acl and defaultObjectAcl properties. +func (c *BucketsInsertCall) Projection(projection string) *BucketsInsertCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketsInsertCall) Fields(s ...googleapi.Field) *BucketsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketsInsertCall) Context(ctx context.Context) *BucketsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *BucketsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.buckets.insert" call. +// Exactly one of *Bucket or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Bucket.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BucketsInsertCall) Do() (*Bucket, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Bucket{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "full" - Include all properties. +// "no_acl" - Omit acl and defaultObjectAcl properties. +func (c *BucketsListCall) Projection(projection string) *BucketsListCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketsListCall) Fields(s ...googleapi.Field) *BucketsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BucketsListCall) IfNoneMatch(entityTag string) *BucketsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketsListCall) Context(ctx context.Context) *BucketsListCall { + c.ctx_ = ctx + return c +} + +func (c *BucketsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.buckets.list" call. +// Exactly one of *Buckets or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Buckets.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BucketsListCall) Do() (*Buckets, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Buckets{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "full" - Include all properties. +// "no_acl" - Omit acl and defaultObjectAcl properties. +func (c *BucketsPatchCall) Projection(projection string) *BucketsPatchCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketsPatchCall) Fields(s ...googleapi.Field) *BucketsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketsPatchCall) Context(ctx context.Context) *BucketsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *BucketsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.buckets.patch" call. +// Exactly one of *Bucket or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Bucket.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BucketsPatchCall) Do() (*Bucket, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Bucket{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "full" - Include all properties. +// "no_acl" - Omit acl and defaultObjectAcl properties. +func (c *BucketsUpdateCall) Projection(projection string) *BucketsUpdateCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketsUpdateCall) Fields(s ...googleapi.Field) *BucketsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketsUpdateCall) Context(ctx context.Context) *BucketsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *BucketsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.buckets.update" call. +// Exactly one of *Bucket or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Bucket.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BucketsUpdateCall) Do() (*Bucket, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Bucket{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *ObjectAccessControlsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectAccessControlsDeleteCall) Context(ctx context.Context) *ObjectAccessControlsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + "entity": c.entity, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objectAccessControls.delete" call. +func (c *ObjectAccessControlsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *ObjectAccessControlsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *ObjectAccessControlsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectAccessControlsGetCall) Context(ctx context.Context) *ObjectAccessControlsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + "entity": c.entity, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objectAccessControls.get" call. +// Exactly one of *ObjectAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ObjectAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ObjectAccessControlsGetCall) Do() (*ObjectAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ObjectAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *ObjectAccessControlsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectAccessControlsInsertCall) Context(ctx context.Context) *ObjectAccessControlsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objectAccessControls.insert" call. +// Exactly one of *ObjectAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ObjectAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ObjectAccessControlsInsertCall) Do() (*ObjectAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ObjectAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectAccessControlsListCall) Fields(s ...googleapi.Field) *ObjectAccessControlsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ObjectAccessControlsListCall) IfNoneMatch(entityTag string) *ObjectAccessControlsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectAccessControlsListCall) Context(ctx context.Context) *ObjectAccessControlsListCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objectAccessControls.list" call. +// Exactly one of *ObjectAccessControls or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ObjectAccessControls.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ObjectAccessControlsListCall) Do() (*ObjectAccessControls, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ObjectAccessControls{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *ObjectAccessControlsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectAccessControlsPatchCall) Context(ctx context.Context) *ObjectAccessControlsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + "entity": c.entity, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objectAccessControls.patch" call. +// Exactly one of *ObjectAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ObjectAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ObjectAccessControlsPatchCall) Do() (*ObjectAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ObjectAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *ObjectAccessControlsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectAccessControlsUpdateCall) Context(ctx context.Context) *ObjectAccessControlsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + "entity": c.entity, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objectAccessControls.update" call. +// Exactly one of *ObjectAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ObjectAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ObjectAccessControlsUpdateCall) Do() (*ObjectAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ObjectAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectsDeleteCall) Fields(s ...googleapi.Field) *ObjectsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectsDeleteCall) Context(ctx context.Context) *ObjectsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objects.delete" call. +func (c *ObjectsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "full" - Include all properties. +// "no_acl" - Omit the acl property. +func (c *ObjectsGetCall) Projection(projection string) *ObjectsGetCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectsGetCall) Fields(s ...googleapi.Field) *ObjectsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ObjectsGetCall) IfNoneMatch(entityTag string) *ObjectsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectsGetCall) Context(ctx context.Context) *ObjectsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *ObjectsGetCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "storage.objects.get" call. +// Exactly one of *Object or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Object.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ObjectsGetCall) Do() (*Object, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Object{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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 + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "full" - Include all properties. +// "no_acl" - Omit the acl property. +func (c *ObjectsInsertCall) Projection(projection string) *ObjectsInsertCall { + c.opt_["projection"] = projection + return c +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *ObjectsInsertCall) Media(r io.Reader) *ObjectsInsertCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *ObjectsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ObjectsInsertCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *ObjectsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ObjectsInsertCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectsInsertCall) Fields(s ...googleapi.Field) *ObjectsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *ObjectsInsertCall) Context(ctx context.Context) *ObjectsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objects.insert" call. +// Exactly one of *Object or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Object.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ObjectsInsertCall) Do() (*Object, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &Object{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "full" - Include all properties. +// "no_acl" - Omit the acl property. +func (c *ObjectsListCall) Projection(projection string) *ObjectsListCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectsListCall) Fields(s ...googleapi.Field) *ObjectsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ObjectsListCall) IfNoneMatch(entityTag string) *ObjectsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectsListCall) Context(ctx context.Context) *ObjectsListCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objects.list" call. +// Exactly one of *Objects or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Objects.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ObjectsListCall) Do() (*Objects, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Objects{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "full" - Include all properties. +// "no_acl" - Omit the acl property. +func (c *ObjectsPatchCall) Projection(projection string) *ObjectsPatchCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectsPatchCall) Fields(s ...googleapi.Field) *ObjectsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectsPatchCall) Context(ctx context.Context) *ObjectsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objects.patch" call. +// Exactly one of *Object or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Object.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ObjectsPatchCall) Do() (*Object, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Object{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "full" - Include all properties. +// "no_acl" - Omit the acl property. +func (c *ObjectsUpdateCall) Projection(projection string) *ObjectsUpdateCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectsUpdateCall) Fields(s ...googleapi.Field) *ObjectsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectsUpdateCall) Context(ctx context.Context) *ObjectsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *ObjectsUpdateCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "storage.objects.update" call. +// Exactly one of *Object or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Object.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ObjectsUpdateCall) Do() (*Object, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Object{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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/Godeps/_workspace/src/google.golang.org/api/storage/v1beta2/storage-api.json b/Godeps/_workspace/src/google.golang.org/api/storage/v1beta2/storage-api.json new file mode 100644 index 000000000..a7ac03e08 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/storage/v1beta2/storage-api.json @@ -0,0 +1,2345 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/58I9am2CtsQcuFUTzCVHg3vRyjQ\"", + "discoveryVersion": "v1", + "id": "storage:v1beta2", + "name": "storage", + "version": "v1beta2", + "revision": "20151007", + "title": "Cloud Storage JSON 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: GET, OPTIONS, POST, etc. 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. Currently only Delete is supported." + } + } + }, + "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 is always 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 are 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": "If present, only return default ACL listing if the bucket's current metageneration matches this value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "If present, only return default ACL listing if the bucket's current metageneration does not match the given value.", + "format": "int64", + "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/Godeps/_workspace/src/google.golang.org/api/storage/v1beta2/storage-gen.go b/Godeps/_workspace/src/google.golang.org/api/storage/v1beta2/storage-gen.go new file mode 100644 index 000000000..816881f90 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/storage/v1beta2/storage-gen.go @@ -0,0 +1,6887 @@ +// Package storage provides access to the Cloud Storage JSON API. +// +// See https://developers.google.com/storage/docs/json_api/ +// +// Usage example: +// +// import "google.golang.org/api/storage/v1beta2" +// ... +// storageService, err := storage.New(oauthHttpClient) +package storage // import "google.golang.org/api/storage/v1beta2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control" + + // View your data in Google Cloud Storage + DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only" + + // Manage your data in Google Cloud Storage + DevstorageReadWriteScope = "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 + UserAgent string // optional additional User-Agent fragment + + BucketAccessControls *BucketAccessControlsService + + Buckets *BucketsService + + Channels *ChannelsService + + DefaultObjectAccessControls *DefaultObjectAccessControlsService + + ObjectAccessControls *ObjectAccessControlsService + + Objects *ObjectsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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 +} + +// Bucket: A bucket. +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 is always 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 are 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Acl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Bucket) MarshalJSON() ([]byte, error) { + type noMethod Bucket + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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: GET, OPTIONS, POST, etc. 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"` + + // ForceSendFields is a list of field names (e.g. "MaxAgeSeconds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketCors) MarshalJSON() ([]byte, error) { + type noMethod BucketCors + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BucketLifecycle: The bucket's lifecycle configuration. See object +// lifecycle management for more information. +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"` + + // ForceSendFields is a list of field names (e.g. "Rule") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketLifecycle) MarshalJSON() ([]byte, error) { + type noMethod BucketLifecycle + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Action") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketLifecycleRule) MarshalJSON() ([]byte, error) { + type noMethod BucketLifecycleRule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BucketLifecycleRuleAction: The action to take. +type BucketLifecycleRuleAction struct { + // Type: Type of the action. Currently only Delete is supported. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Type") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketLifecycleRuleAction) MarshalJSON() ([]byte, error) { + type noMethod BucketLifecycleRuleAction + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BucketLifecycleRuleCondition: The condition(s) under which the action +// will be taken. +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"` + + // ForceSendFields is a list of field names (e.g. "Age") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketLifecycleRuleCondition) MarshalJSON() ([]byte, error) { + type noMethod BucketLifecycleRuleCondition + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BucketLogging: The bucket's logging configuration, which defines the +// destination bucket and optional name prefix for the current bucket's +// logs. +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"` + + // ForceSendFields is a list of field names (e.g. "LogBucket") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketLogging) MarshalJSON() ([]byte, error) { + type noMethod BucketLogging + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BucketOwner: The owner of the bucket. This is always the project +// team's owner group. +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"` + + // ForceSendFields is a list of field names (e.g. "Entity") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketOwner) MarshalJSON() ([]byte, error) { + type noMethod BucketOwner + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BucketVersioning: The bucket's versioning configuration. +type BucketVersioning struct { + // Enabled: While set to true, versioning is fully enabled for this + // bucket. + Enabled bool `json:"enabled,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Enabled") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketVersioning) MarshalJSON() ([]byte, error) { + type noMethod BucketVersioning + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BucketWebsite: The bucket's website configuration. +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"` + + // ForceSendFields is a list of field names (e.g. "MainPageSuffix") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketWebsite) MarshalJSON() ([]byte, error) { + type noMethod BucketWebsite + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BucketAccessControl: An access-control entry. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Bucket") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketAccessControl) MarshalJSON() ([]byte, error) { + type noMethod BucketAccessControl + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// BucketAccessControls: An access-control list. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketAccessControls) MarshalJSON() ([]byte, error) { + type noMethod BucketAccessControls + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Buckets: A list of buckets. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Buckets) MarshalJSON() ([]byte, error) { + type noMethod Buckets + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Channel: An notification channel used to watch for resource changes. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Address") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Channel) MarshalJSON() ([]byte, error) { + type noMethod Channel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ComposeRequest: A Compose request. +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"` + + // ForceSendFields is a list of field names (e.g. "Destination") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ComposeRequest) MarshalJSON() ([]byte, error) { + type noMethod ComposeRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Generation") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ComposeRequestSourceObjects) MarshalJSON() ([]byte, error) { + type noMethod ComposeRequestSourceObjects + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ComposeRequestSourceObjectsObjectPreconditions: Conditions that must +// be met for this operation to execute. +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"` + + // ForceSendFields is a list of field names (e.g. "IfGenerationMatch") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ComposeRequestSourceObjectsObjectPreconditions) MarshalJSON() ([]byte, error) { + type noMethod ComposeRequestSourceObjectsObjectPreconditions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Object: An object. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Acl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Object) MarshalJSON() ([]byte, error) { + type noMethod Object + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ObjectOwner: The owner of the object. This will always be the +// uploader of the object. +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"` + + // ForceSendFields is a list of field names (e.g. "Entity") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ObjectOwner) MarshalJSON() ([]byte, error) { + type noMethod ObjectOwner + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ObjectAccessControl: An access-control entry. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Bucket") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ObjectAccessControl) MarshalJSON() ([]byte, error) { + type noMethod ObjectAccessControl + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ObjectAccessControls: An access-control list. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ObjectAccessControls) MarshalJSON() ([]byte, error) { + type noMethod ObjectAccessControls + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Objects: A list of objects. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Objects) MarshalJSON() ([]byte, error) { + type noMethod Objects + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "storage.bucketAccessControls.delete": + +type BucketAccessControlsDeleteCall struct { + s *Service + bucket string + entity string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketAccessControlsDeleteCall) Fields(s ...googleapi.Field) *BucketAccessControlsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketAccessControlsDeleteCall) Context(ctx context.Context) *BucketAccessControlsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *BucketAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "entity": c.entity, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.bucketAccessControls.delete" call. +func (c *BucketAccessControlsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketAccessControlsGetCall) Fields(s ...googleapi.Field) *BucketAccessControlsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BucketAccessControlsGetCall) IfNoneMatch(entityTag string) *BucketAccessControlsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketAccessControlsGetCall) Context(ctx context.Context) *BucketAccessControlsGetCall { + c.ctx_ = ctx + return c +} + +func (c *BucketAccessControlsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "entity": c.entity, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.bucketAccessControls.get" call. +// Exactly one of *BucketAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BucketAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BucketAccessControlsGetCall) Do() (*BucketAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BucketAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketAccessControlsInsertCall) Fields(s ...googleapi.Field) *BucketAccessControlsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketAccessControlsInsertCall) Context(ctx context.Context) *BucketAccessControlsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *BucketAccessControlsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.bucketAccessControls.insert" call. +// Exactly one of *BucketAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BucketAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BucketAccessControlsInsertCall) Do() (*BucketAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BucketAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketAccessControlsListCall) Fields(s ...googleapi.Field) *BucketAccessControlsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BucketAccessControlsListCall) IfNoneMatch(entityTag string) *BucketAccessControlsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketAccessControlsListCall) Context(ctx context.Context) *BucketAccessControlsListCall { + c.ctx_ = ctx + return c +} + +func (c *BucketAccessControlsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.bucketAccessControls.list" call. +// Exactly one of *BucketAccessControls or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BucketAccessControls.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BucketAccessControlsListCall) Do() (*BucketAccessControls, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BucketAccessControls{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketAccessControlsPatchCall) Fields(s ...googleapi.Field) *BucketAccessControlsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketAccessControlsPatchCall) Context(ctx context.Context) *BucketAccessControlsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *BucketAccessControlsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "entity": c.entity, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.bucketAccessControls.patch" call. +// Exactly one of *BucketAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BucketAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BucketAccessControlsPatchCall) Do() (*BucketAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BucketAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketAccessControlsUpdateCall) Fields(s ...googleapi.Field) *BucketAccessControlsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketAccessControlsUpdateCall) Context(ctx context.Context) *BucketAccessControlsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *BucketAccessControlsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "entity": c.entity, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.bucketAccessControls.update" call. +// Exactly one of *BucketAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BucketAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *BucketAccessControlsUpdateCall) Do() (*BucketAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &BucketAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketsDeleteCall) Fields(s ...googleapi.Field) *BucketsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketsDeleteCall) Context(ctx context.Context) *BucketsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *BucketsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.buckets.delete" call. +func (c *BucketsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "full" - Include all properties. +// "noAcl" - Omit acl and defaultObjectAcl properties. +func (c *BucketsGetCall) Projection(projection string) *BucketsGetCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketsGetCall) Fields(s ...googleapi.Field) *BucketsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BucketsGetCall) IfNoneMatch(entityTag string) *BucketsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketsGetCall) Context(ctx context.Context) *BucketsGetCall { + c.ctx_ = ctx + return c +} + +func (c *BucketsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.buckets.get" call. +// Exactly one of *Bucket or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Bucket.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BucketsGetCall) Do() (*Bucket, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Bucket{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "full" - Include all properties. +// "noAcl" - Omit acl and defaultObjectAcl properties. +func (c *BucketsInsertCall) Projection(projection string) *BucketsInsertCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketsInsertCall) Fields(s ...googleapi.Field) *BucketsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketsInsertCall) Context(ctx context.Context) *BucketsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *BucketsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + params.Set("project", fmt.Sprintf("%v", c.projectid)) + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.buckets.insert" call. +// Exactly one of *Bucket or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Bucket.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BucketsInsertCall) Do() (*Bucket, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Bucket{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "full" - Include all properties. +// "noAcl" - Omit acl and defaultObjectAcl properties. +func (c *BucketsListCall) Projection(projection string) *BucketsListCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketsListCall) Fields(s ...googleapi.Field) *BucketsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BucketsListCall) IfNoneMatch(entityTag string) *BucketsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketsListCall) Context(ctx context.Context) *BucketsListCall { + c.ctx_ = ctx + return c +} + +func (c *BucketsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.buckets.list" call. +// Exactly one of *Buckets or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Buckets.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BucketsListCall) Do() (*Buckets, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Buckets{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "full" - Include all properties. +// "noAcl" - Omit acl and defaultObjectAcl properties. +func (c *BucketsPatchCall) Projection(projection string) *BucketsPatchCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketsPatchCall) Fields(s ...googleapi.Field) *BucketsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketsPatchCall) Context(ctx context.Context) *BucketsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *BucketsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.buckets.patch" call. +// Exactly one of *Bucket or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Bucket.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BucketsPatchCall) Do() (*Bucket, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Bucket{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "full" - Include all properties. +// "noAcl" - Omit acl and defaultObjectAcl properties. +func (c *BucketsUpdateCall) Projection(projection string) *BucketsUpdateCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BucketsUpdateCall) Fields(s ...googleapi.Field) *BucketsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *BucketsUpdateCall) Context(ctx context.Context) *BucketsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *BucketsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.buckets.update" call. +// Exactly one of *Bucket or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Bucket.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *BucketsUpdateCall) Do() (*Bucket, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Bucket{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall { + c.ctx_ = ctx + return c +} + +func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.channels.stop" call. +func (c *ChannelsStopCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DefaultObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DefaultObjectAccessControlsDeleteCall) Context(ctx context.Context) *DefaultObjectAccessControlsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *DefaultObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "entity": c.entity, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.defaultObjectAccessControls.delete" call. +func (c *DefaultObjectAccessControlsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DefaultObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DefaultObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DefaultObjectAccessControlsGetCall) Context(ctx context.Context) *DefaultObjectAccessControlsGetCall { + c.ctx_ = ctx + return c +} + +func (c *DefaultObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "entity": c.entity, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.defaultObjectAccessControls.get" call. +// Exactly one of *ObjectAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ObjectAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DefaultObjectAccessControlsGetCall) Do() (*ObjectAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ObjectAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DefaultObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DefaultObjectAccessControlsInsertCall) Context(ctx context.Context) *DefaultObjectAccessControlsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *DefaultObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.defaultObjectAccessControls.insert" call. +// Exactly one of *ObjectAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ObjectAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DefaultObjectAccessControlsInsertCall) Do() (*ObjectAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ObjectAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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": If present, only return default ACL listing +// if the bucket's current metageneration matches this value. +func (c *DefaultObjectAccessControlsListCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *DefaultObjectAccessControlsListCall { + c.opt_["ifMetagenerationMatch"] = ifMetagenerationMatch + return c +} + +// IfMetagenerationNotMatch sets the optional parameter +// "ifMetagenerationNotMatch": If present, only return default ACL +// listing if the bucket's current metageneration does not match the +// given value. +func (c *DefaultObjectAccessControlsListCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *DefaultObjectAccessControlsListCall { + c.opt_["ifMetagenerationNotMatch"] = ifMetagenerationNotMatch + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DefaultObjectAccessControlsListCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DefaultObjectAccessControlsListCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DefaultObjectAccessControlsListCall) Context(ctx context.Context) *DefaultObjectAccessControlsListCall { + c.ctx_ = ctx + return c +} + +func (c *DefaultObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.defaultObjectAccessControls.list" call. +// Exactly one of *ObjectAccessControls or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ObjectAccessControls.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DefaultObjectAccessControlsListCall) Do() (*ObjectAccessControls, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ObjectAccessControls{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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": "If present, only return default ACL listing if the bucket's current metageneration matches this value.", + // "format": "int64", + // "location": "query", + // "type": "string" + // }, + // "ifMetagenerationNotMatch": { + // "description": "If present, only return default ACL listing if the bucket's current metageneration does not match the given value.", + // "format": "int64", + // "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DefaultObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DefaultObjectAccessControlsPatchCall) Context(ctx context.Context) *DefaultObjectAccessControlsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *DefaultObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "entity": c.entity, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.defaultObjectAccessControls.patch" call. +// Exactly one of *ObjectAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ObjectAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DefaultObjectAccessControlsPatchCall) Do() (*ObjectAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ObjectAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DefaultObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DefaultObjectAccessControlsUpdateCall) Context(ctx context.Context) *DefaultObjectAccessControlsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *DefaultObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "entity": c.entity, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.defaultObjectAccessControls.update" call. +// Exactly one of *ObjectAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ObjectAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DefaultObjectAccessControlsUpdateCall) Do() (*ObjectAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ObjectAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *ObjectAccessControlsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectAccessControlsDeleteCall) Context(ctx context.Context) *ObjectAccessControlsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["generation"]; ok { + params.Set("generation", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + "entity": c.entity, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objectAccessControls.delete" call. +func (c *ObjectAccessControlsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *ObjectAccessControlsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *ObjectAccessControlsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectAccessControlsGetCall) Context(ctx context.Context) *ObjectAccessControlsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["generation"]; ok { + params.Set("generation", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + "entity": c.entity, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objectAccessControls.get" call. +// Exactly one of *ObjectAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ObjectAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ObjectAccessControlsGetCall) Do() (*ObjectAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ObjectAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *ObjectAccessControlsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectAccessControlsInsertCall) Context(ctx context.Context) *ObjectAccessControlsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["generation"]; ok { + params.Set("generation", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objectAccessControls.insert" call. +// Exactly one of *ObjectAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ObjectAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ObjectAccessControlsInsertCall) Do() (*ObjectAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ObjectAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectAccessControlsListCall) Fields(s ...googleapi.Field) *ObjectAccessControlsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ObjectAccessControlsListCall) IfNoneMatch(entityTag string) *ObjectAccessControlsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectAccessControlsListCall) Context(ctx context.Context) *ObjectAccessControlsListCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["generation"]; ok { + params.Set("generation", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objectAccessControls.list" call. +// Exactly one of *ObjectAccessControls or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ObjectAccessControls.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ObjectAccessControlsListCall) Do() (*ObjectAccessControls, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ObjectAccessControls{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *ObjectAccessControlsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectAccessControlsPatchCall) Context(ctx context.Context) *ObjectAccessControlsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["generation"]; ok { + params.Set("generation", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + "entity": c.entity, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objectAccessControls.patch" call. +// Exactly one of *ObjectAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ObjectAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ObjectAccessControlsPatchCall) Do() (*ObjectAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ObjectAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *ObjectAccessControlsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectAccessControlsUpdateCall) Context(ctx context.Context) *ObjectAccessControlsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["generation"]; ok { + params.Set("generation", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + "entity": c.entity, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objectAccessControls.update" call. +// Exactly one of *ObjectAccessControl or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ObjectAccessControl.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ObjectAccessControlsUpdateCall) Do() (*ObjectAccessControl, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ObjectAccessControl{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectsComposeCall) Fields(s ...googleapi.Field) *ObjectsComposeCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectsComposeCall) Context(ctx context.Context) *ObjectsComposeCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectsComposeCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{destinationBucket}/o/{destinationObject}/compose") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "destinationBucket": c.destinationBucket, + "destinationObject": c.destinationObject, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *ObjectsComposeCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "storage.objects.compose" call. +// Exactly one of *Object or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Object.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ObjectsComposeCall) Do() (*Object, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Object{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "full" - Include all properties. +// "noAcl" - Omit the acl property. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectsCopyCall) Fields(s ...googleapi.Field) *ObjectsCopyCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectsCopyCall) Context(ctx context.Context) *ObjectsCopyCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectsCopyCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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) + googleapi.Expand(req.URL, map[string]string{ + "sourceBucket": c.sourceBucket, + "sourceObject": c.sourceObject, + "destinationBucket": c.destinationBucket, + "destinationObject": c.destinationObject, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *ObjectsCopyCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "storage.objects.copy" call. +// Exactly one of *Object or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Object.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ObjectsCopyCall) Do() (*Object, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Object{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectsDeleteCall) Fields(s ...googleapi.Field) *ObjectsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectsDeleteCall) Context(ctx context.Context) *ObjectsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objects.delete" call. +func (c *ObjectsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "full" - Include all properties. +// "noAcl" - Omit the acl property. +func (c *ObjectsGetCall) Projection(projection string) *ObjectsGetCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectsGetCall) Fields(s ...googleapi.Field) *ObjectsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ObjectsGetCall) IfNoneMatch(entityTag string) *ObjectsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectsGetCall) Context(ctx context.Context) *ObjectsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *ObjectsGetCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "storage.objects.get" call. +// Exactly one of *Object or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Object.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ObjectsGetCall) Do() (*Object, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Object{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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 + resumable_ googleapi.SizeReaderAt + mediaType_ string + protocol_ string + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "full" - Include all properties. +// "noAcl" - Omit the acl property. +func (c *ObjectsInsertCall) Projection(projection string) *ObjectsInsertCall { + c.opt_["projection"] = projection + return c +} + +// Media specifies the media to upload in a single chunk. +// At most one of Media and ResumableMedia may be set. +func (c *ObjectsInsertCall) Media(r io.Reader) *ObjectsInsertCall { + c.media_ = r + c.protocol_ = "multipart" + return c +} + +// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx. +// At most one of Media and ResumableMedia may be set. +// mediaType identifies the MIME media type of the upload, such as "image/png". +// If mediaType is "", it will be auto-detected. +// The provided ctx will supersede any context previously provided to +// the Context method. +func (c *ObjectsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ObjectsInsertCall { + c.ctx_ = ctx + c.resumable_ = io.NewSectionReader(r, 0, size) + c.mediaType_ = mediaType + c.protocol_ = "resumable" + return c +} + +// ProgressUpdater provides a callback function that will be called after every chunk. +// It should be a low-latency function in order to not slow down the upload operation. +// This should only be called when using ResumableMedia (as opposed to Media). +func (c *ObjectsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ObjectsInsertCall { + c.opt_["progressUpdater"] = pu + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectsInsertCall) Fields(s ...googleapi.Field) *ObjectsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +// This context will supersede any context previously provided to +// the ResumableMedia method. +func (c *ObjectsInsertCall) Context(ctx context.Context) *ObjectsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o") + if c.media_ != nil || c.resumable_ != nil { + urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) + params.Set("uploadType", c.protocol_) + } + urls += "?" + params.Encode() + if c.protocol_ != "resumable" { + var cancel func() + cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) + if cancel != nil { + defer cancel() + } + } + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + if c.protocol_ == "resumable" { + if c.mediaType_ == "" { + c.mediaType_ = googleapi.DetectMediaType(c.resumable_) + } + req.Header.Set("X-Upload-Content-Type", c.mediaType_) + req.Header.Set("Content-Type", "application/json; charset=utf-8") + } else { + req.Header.Set("Content-Type", ctype) + } + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objects.insert" call. +// Exactly one of *Object or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Object.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ObjectsInsertCall) Do() (*Object, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + var progressUpdater_ googleapi.ProgressUpdater + if v, ok := c.opt_["progressUpdater"]; ok { + if pu, ok := v.(googleapi.ProgressUpdater); ok { + progressUpdater_ = pu + } + } + if c.protocol_ == "resumable" { + loc := res.Header.Get("Location") + rx := &googleapi.ResumableUpload{ + Client: c.s.client, + UserAgent: c.s.userAgent(), + URI: loc, + Media: c.resumable_, + MediaType: c.mediaType_, + ContentLength: c.resumable_.Size(), + Callback: progressUpdater_, + } + res, err = rx.Upload(c.ctx_) + if err != nil { + return nil, err + } + defer res.Body.Close() + } + ret := &Object{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "full" - Include all properties. +// "noAcl" - Omit the acl property. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectsListCall) Fields(s ...googleapi.Field) *ObjectsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ObjectsListCall) IfNoneMatch(entityTag string) *ObjectsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectsListCall) Context(ctx context.Context) *ObjectsListCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objects.list" call. +// Exactly one of *Objects or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Objects.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ObjectsListCall) Do() (*Objects, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Objects{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "full" - Include all properties. +// "noAcl" - Omit the acl property. +func (c *ObjectsPatchCall) Projection(projection string) *ObjectsPatchCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectsPatchCall) Fields(s ...googleapi.Field) *ObjectsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectsPatchCall) Context(ctx context.Context) *ObjectsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objects.patch" call. +// Exactly one of *Object or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Object.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ObjectsPatchCall) Do() (*Object, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Object{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "full" - Include all properties. +// "noAcl" - Omit the acl property. +func (c *ObjectsUpdateCall) Projection(projection string) *ObjectsUpdateCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectsUpdateCall) Fields(s ...googleapi.Field) *ObjectsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectsUpdateCall) Context(ctx context.Context) *ObjectsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *ObjectsUpdateCall) Download() (*http.Response, error) { + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckMediaResponse(res); err != nil { + res.Body.Close() + return nil, err + } + return res, nil +} + +// Do executes the "storage.objects.update" call. +// Exactly one of *Object or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Object.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ObjectsUpdateCall) Do() (*Object, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Object{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates 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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "full" - Include all properties. +// "noAcl" - Omit the acl property. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ObjectsWatchAllCall) Fields(s ...googleapi.Field) *ObjectsWatchAllCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *ObjectsWatchAllCall) Context(ctx context.Context) *ObjectsWatchAllCall { + c.ctx_ = ctx + return c +} + +func (c *ObjectsWatchAllCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/watch") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storage.objects.watchAll" call. +// Exactly one of *Channel or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Channel.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ObjectsWatchAllCall) Do() (*Channel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Channel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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/Godeps/_workspace/src/google.golang.org/api/storagetransfer/v1/storagetransfer-api.json b/Godeps/_workspace/src/google.golang.org/api/storagetransfer/v1/storagetransfer-api.json new file mode 100644 index 000000000..15a4b38cf --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/storagetransfer/v1/storagetransfer-api.json @@ -0,0 +1,1033 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/YnaUc-cj9ChhpJCT0y2OALoDn9Q\"", + "discoveryVersion": "v1", + "id": "storagetransfer:v1", + "name": "storagetransfer", + "version": "v1", + "revision": "20150811", + "title": "Google Storage Transfer API", + "description": "Transfers data from external data sources to a Google Cloud Storage bucket or between Google Cloud Storage buckets.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "http://www.google.com/images/icons/product/search-16.gif", + "x32": "http://www.google.com/images/icons/product/search-32.gif" + }, + "documentationLink": "https://cloud.google.com/storage/transfer", + "protocol": "rest", + "baseUrl": "https://storagetransfer.googleapis.com/", + "basePath": "/", + "rootUrl": "https://storagetransfer.googleapis.com/", + "servicePath": "", + "batchPath": "batch", + "parameters": { + "access_token": { + "type": "string", + "description": "OAuth access token.", + "location": "query" + }, + "alt": { + "type": "string", + "description": "Data format for response.", + "default": "json", + "enumDescriptions": [ + "Responses with Content-Type of application/json", + "Media download with context-dependent Content-Type", + "Responses with Content-Type of application/x-protobuf" + ], + "location": "query" + }, + "bearer_token": { + "type": "string", + "description": "OAuth bearer token.", + "location": "query" + }, + "callback": { + "type": "string", + "description": "JSONP", + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "pp": { + "type": "boolean", + "description": "Pretty-print response.", + "default": "true", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.", + "location": "query" + }, + "upload_protocol": { + "type": "string", + "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").", + "location": "query" + }, + "uploadType": { + "type": "string", + "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").", + "location": "query" + }, + "$.xgafv": { + "type": "string", + "description": "V1 error format.", + "enumDescriptions": [ + "v1 error format", + "v2 error format" + ], + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + } + } + } + }, + "schemas": { + "GoogleServiceAccount": { + "id": "GoogleServiceAccount", + "type": "object", + "description": "Google service account", + "properties": { + "accountEmail": { + "type": "string", + "description": "Required." + } + } + }, + "TransferJob": { + "id": "TransferJob", + "type": "object", + "description": "This resource represents the configuration of a transfer job that runs periodically.", + "properties": { + "name": { + "type": "string", + "description": "A globally unique name assigned by Storage Transfer Service when the job is created. This field should be left empty in requests to create a new transfer job; otherwise, the requests result in an `INVALID_ARGUMENT` error." + }, + "description": { + "type": "string", + "description": "A description provided by the user for the job. Its max length is 1024 bytes when Unicode-encoded." + }, + "projectId": { + "type": "string", + "description": "The ID of the Google Developers Console project that owns the job. Required." + }, + "transferSpec": { + "$ref": "TransferSpec", + "description": "Transfer specification. Required." + }, + "schedule": { + "$ref": "Schedule", + "description": "Schedule specification. Required." + }, + "status": { + "type": "string", + "description": "Status of the job. This value MUST be specified for `CreateTransferJobRequests`. NOTE: The effect of the new job status takes place during a subsequent job run. For example, if you change the job status from `ENABLED` to `DISABLED`, and an operation spawned by the transfer is running, the status change would not affect the current operation.", + "enum": [ + "STATUS_UNSPECIFIED", + "ENABLED", + "DISABLED", + "DELETED" + ] + }, + "creationTime": { + "type": "string", + "description": "This field cannot be changed by user requests." + }, + "lastModificationTime": { + "type": "string", + "description": "This field cannot be changed by user requests." + }, + "deletionTime": { + "type": "string", + "description": "This field cannot be changed by user requests." + } + } + }, + "TransferSpec": { + "id": "TransferSpec", + "type": "object", + "description": "Configuration for running a transfer.", + "properties": { + "gcsDataSource": { + "$ref": "GcsData", + "description": "A Google Cloud Storage data source." + }, + "awsS3DataSource": { + "$ref": "AwsS3Data", + "description": "An AWS S3 data source." + }, + "httpDataSource": { + "$ref": "HttpData", + "description": "An HTTP URL data source." + }, + "gcsDataSink": { + "$ref": "GcsData", + "description": "A Google Cloud Storage data sink." + }, + "objectConditions": { + "$ref": "ObjectConditions", + "description": "Only objects that satisfy these object conditions are included in the set of data source and data sink objects. Object conditions based on objects' `lastModificationTime` do not exclude objects in a data sink." + }, + "transferOptions": { + "$ref": "TransferOptions", + "description": "If the option `deleteObjectsUniqueInSink` is `true`, object conditions based on objects' `lastModificationTime` are ignored and do not exclude objects in a data source or a data sink." + } + } + }, + "GcsData": { + "id": "GcsData", + "type": "object", + "description": "In a GcsData, an object's name is the Google Cloud Storage object's name and its `lastModificationTime` refers to the object's updated time, which changes when the content or the metadata of the object is updated.", + "properties": { + "bucketName": { + "type": "string", + "description": "Google Cloud Storage bucket name (see [Bucket Name Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). Required." + } + } + }, + "AwsS3Data": { + "id": "AwsS3Data", + "type": "object", + "description": "An AwsS3Data can be a data source, but not a data sink. In an AwsS3Data, an object's name is the S3 object's key name.", + "properties": { + "bucketName": { + "type": "string", + "description": "S3 Bucket name (see [Creating a bucket](http://docs.aws.amazon.com/AmazonS3/latest/dev/create-bucket-get-location-example.html)). Required." + }, + "awsAccessKey": { + "$ref": "AwsAccessKey", + "description": "AWS access key used to sign the API requests to the AWS S3 bucket. Permissions on the bucket must be granted to the access ID of the AWS access key. Required." + } + } + }, + "AwsAccessKey": { + "id": "AwsAccessKey", + "type": "object", + "description": "AWS access key (see [AWS Security Credentials](http://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html)).", + "properties": { + "accessKeyId": { + "type": "string", + "description": "AWS access key ID. Required." + }, + "secretAccessKey": { + "type": "string", + "description": "AWS secret access key. This field is not returned in RPC responses. Required." + } + } + }, + "HttpData": { + "id": "HttpData", + "type": "object", + "description": "An HttpData specifies a list of objects on the web to be transferred over HTTP. The information of the objects to be transferred is contained in a file referenced by a URL. The first line in the file must be \"TsvHttpData-1.0\", which specifies the format of the file. Subsequent lines specify the information of the list of objects, one object per list entry. Each entry has the following tab-delimited fields: * HTTP URL * Length * MD5 - This field is a base64-encoded MD5 hash of the object An HTTP URL that points to the object to be transferred. It must be a valid URL with URL scheme HTTP or HTTPS. When an object with URL `http(s)://hostname:port/` is transferred to the data sink, the name of the object at the data sink is `/`. Length and MD5 provide the size and the base64-encoded MD5 hash of the object. If Length does not match the actual length of the object fetched, the object will not be transferred. If MD5 does not match the MD5 computed from the transferred bytes, the object transfer will fail. `lastModificationTime` is not available in HttpData objects. The objects that the URL list points to must allow public access. Storage Transfer Service obeys `robots.txt` rules and requires the HTTP server to support Range requests and to return a Content-Length header in each response.", + "properties": { + "listUrl": { + "type": "string", + "description": "The URL that points to the file that stores the object list entries. This file must allow public access. Currently, only URLs with HTTP and HTTPS schemes are supported. Required." + } + } + }, + "ObjectConditions": { + "id": "ObjectConditions", + "type": "object", + "description": "Conditions that determine which objects will be transferred.", + "properties": { + "minTimeElapsedSinceLastModification": { + "type": "string", + "description": "If unspecified, `minTimeElapsedSinceLastModification` takes a zero value and `maxTimeElapsedSinceLastModification` takes the maximum possible value of Duration. Objects that satisfy the object conditions must either have a `lastModificationTime` greater or equal to `NOW` - `maxTimeElapsedSinceLastModification` and less than `NOW` - `minTimeElapsedSinceLastModification`, or not have a `lastModificationTime`." + }, + "maxTimeElapsedSinceLastModification": { + "type": "string", + "description": "`maxTimeElapsedSinceLastModification` is the complement to `minTimeElapsedSinceLastModification`." + }, + "includePrefixes": { + "type": "array", + "description": "If `includePrefixes` is specified, objects that satisfy the object conditions must have names that start with one of the `includePrefixes` and that do not start with any of the `excludePrefixes`. If `includePrefixes` is not specified, all objects except those that have names starting with one of the `excludePrefixes` must satisfy the object conditions. Requirements: * Each include-prefix and exclude-prefix can contain any sequence of Unicode characters, of max length 1024 bytes when UTF8-encoded, and must not contain Carriage Return or Line Feed characters. Wildcard matching and regular expression matching are not supported. * None of the include-prefix or the exclude-prefix values can be empty, if specified. * Each include-prefix must include a distinct portion of the object namespace, i.e., no include-prefix may be a prefix of another include-prefix. * Each exclude-prefix must exclude a distinct portion of the object namespace, i.e., no exclude-prefix may be a prefix of another exclude-prefix. * If `includePrefixes` is specified, then each exclude-prefix must start with the value of a path explicitly included by `includePrefixes`. The max size of `includePrefixes` is 20.", + "items": { + "type": "string" + } + }, + "excludePrefixes": { + "type": "array", + "description": "`excludePrefixes` must follow the requirements described for `includePrefixes`. The max size of `excludePrefixes` is 20.", + "items": { + "type": "string" + } + } + } + }, + "TransferOptions": { + "id": "TransferOptions", + "type": "object", + "description": "TransferOptions uses three boolean parameters to define the actions to be performed on objects in a transfer.", + "properties": { + "overwriteObjectsAlreadyExistingInSink": { + "type": "boolean", + "description": "Whether overwriting objects that already exist in the sink is allowed." + }, + "deleteObjectsUniqueInSink": { + "type": "boolean", + "description": "Whether objects that exist only in the sink should be deleted." + }, + "deleteObjectsFromSourceAfterTransfer": { + "type": "boolean", + "description": "Whether objects should be deleted from the source after they are transferred to the sink." + } + } + }, + "Schedule": { + "id": "Schedule", + "type": "object", + "description": "Transfers can be scheduled to recur or to run just once.", + "properties": { + "scheduleStartDate": { + "$ref": "Date", + "description": "The first day the recurring transfer is scheduled to run. Required." + }, + "scheduleEndDate": { + "$ref": "Date", + "description": "The last day the recurring transfer will be run. If `scheduleEndDate` is the same as `scheduleStartDate`, the transfer will be executed only once." + }, + "startTimeOfDay": { + "$ref": "TimeOfDay", + "description": "The time in UTC at which the transfer will be scheduled to start in a day. Transfers may start later than this time. If not specified, transfers are scheduled to start at midnight UTC." + } + } + }, + "Date": { + "id": "Date", + "type": "object", + "description": "Represents a whole calendar date, e.g. date of birth. The time of day and time zone are either specified elsewhere or are not significant. The date is relative to the Proleptic Gregorian Calendar. The day may be 0 to represent a year and month where the day is not significant, e.g. credit card expiration date. The year may be 0 to represent a month and day independent of year, e.g. anniversary date. Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and `google.protobuf.Timestamp`.", + "properties": { + "year": { + "type": "integer", + "description": "Year of date. Must be from 1 to 9,999, or 0 if specifying a date without a year.", + "format": "int32" + }, + "month": { + "type": "integer", + "description": "Month of year of date. Must be from 1 to 12.", + "format": "int32" + }, + "day": { + "type": "integer", + "description": "Day of month. Must be from 1 to 31 and valid for the year and month, or 0 if specifying a year/month where the day is not sigificant.", + "format": "int32" + } + } + }, + "TimeOfDay": { + "id": "TimeOfDay", + "type": "object", + "description": "Represents a time of day. The date and time zone are either not significant or are specified elsewhere. An API may chose to allow leap seconds. Related types are [google.type.Date][google.type.Date] and `google.protobuf.Timestamp`.", + "properties": { + "hours": { + "type": "integer", + "description": "Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value \"24:00:00\" for scenarios like business closing time.", + "format": "int32" + }, + "minutes": { + "type": "integer", + "description": "Minutes of hour of day. Must be from 0 to 59.", + "format": "int32" + }, + "seconds": { + "type": "integer", + "description": "Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it allows leap-seconds.", + "format": "int32" + }, + "nanos": { + "type": "integer", + "description": "Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.", + "format": "int32" + } + } + }, + "UpdateTransferJobRequest": { + "id": "UpdateTransferJobRequest", + "type": "object", + "description": "Request passed to UpdateTransferJob.", + "properties": { + "projectId": { + "type": "string", + "description": "The ID of the Google Developers Console project that owns the job. Required." + }, + "transferJob": { + "$ref": "TransferJob", + "description": "The job to update. Required." + }, + "updateTransferJobFieldMask": { + "type": "string", + "description": "The field mask of the fields in `transferJob` that are to be updated in this request. Fields in `transferJob` that can be updated are: `description`, `transferSpec`, and `status`. To update the `transferSpec` of the job, a complete transfer specification has to be provided. An incomplete specification which misses any required fields will be rejected with the error `INVALID_ARGUMENT`." + } + } + }, + "ListTransferJobsResponse": { + "id": "ListTransferJobsResponse", + "type": "object", + "description": "Response from ListTransferJobs.", + "properties": { + "transferJobs": { + "type": "array", + "description": "A list of transfer jobs.", + "items": { + "$ref": "TransferJob" + } + }, + "nextPageToken": { + "type": "string", + "description": "The list next page token." + } + } + }, + "PauseTransferOperationRequest": { + "id": "PauseTransferOperationRequest", + "type": "object", + "description": "Request passed to PauseTransferOperation." + }, + "Empty": { + "id": "Empty", + "type": "object", + "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`." + }, + "ResumeTransferOperationRequest": { + "id": "ResumeTransferOperationRequest", + "type": "object", + "description": "Request passed to ResumeTransferOperation." + }, + "Operation": { + "id": "Operation", + "type": "object", + "description": "This resource represents a long-running operation that is the result of a network API call.", + "properties": { + "name": { + "type": "string", + "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping above, the `name` should have the format of `operations/some/unique/name`." + }, + "metadata": { + "type": "object", + "description": "Represents the transfer operation object.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @ype with type URL." + } + }, + "done": { + "type": "boolean", + "description": "If the value is `false`, it means the operation is still in progress. If true, the operation is completed and the `result` is available." + }, + "error": { + "$ref": "Status", + "description": "The error result of the operation in case of failure." + }, + "response": { + "type": "object", + "description": "The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @ype with type URL." + } + } + } + }, + "Status": { + "id": "Status", + "type": "object", + "description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). The error model is designed to be: - Simple to use and understand for most users - Flexible enough to meet unexpected needs # Overview The `Status` message contains three pieces of data: error code, error message, and error details. The error code should be an enum value of [google.rpc.Code][google.rpc.Code], but it may accept additional error codes if needed. The error message should be a developer-facing English message that helps developers *understand* and *resolve* the error. If a localized user-facing error message is needed, put the localized message in the error details or localize it in the client. The optional error details may contain arbitrary information about the error. There is a predefined set of error detail types in the package `google.rpc` which can be used for common error conditions. # Language mapping The `Status` message is the logical representation of the error model, but it is not necessarily the actual wire format. When the `Status` message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C. # Other uses The error model and the `Status` message can be used in a variety of environments, either with or without APIs, to provide a consistent developer experience across different environments. Example uses of this error model include: - Partial errors. If a service needs to return partial errors to the client, it may embed the `Status` in the normal response to indicate the partial errors. - Workflow errors. A typical workflow has multiple steps. Each step may have a `Status` message for error reporting purpose. - Batch operations. If a client uses batch request and batch response, the `Status` message should be used directly inside batch response, one for each error sub-response. - Asynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the `Status` message. - Logging. If some API errors are stored in logs, the message `Status` could be used directly after any stripping needed for security/privacy reasons.", + "properties": { + "code": { + "type": "integer", + "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", + "format": "int32" + }, + "message": { + "type": "string", + "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client." + }, + "details": { + "type": "array", + "description": "A list of messages that carry the error details. There will be a common set of message types for APIs to use.", + "items": { + "type": "object", + "additionalProperties": { + "type": "any", + "description": "Properties of the object. Contains field @ype with type URL." + } + } + } + } + }, + "ListOperationsResponse": { + "id": "ListOperationsResponse", + "type": "object", + "description": "The response message for [Operations.ListOperations][google.longrunning.Operations.ListOperations].", + "properties": { + "operations": { + "type": "array", + "description": "A list of operations that matches the specified filter in the request.", + "items": { + "$ref": "Operation" + } + }, + "nextPageToken": { + "type": "string", + "description": "The standard List next-page token." + } + } + }, + "TransferOperation": { + "id": "TransferOperation", + "type": "object", + "description": "A description of the execution of a transfer.", + "properties": { + "name": { + "type": "string", + "description": "A globally unique ID assigned by the system." + }, + "projectId": { + "type": "string", + "description": "The ID of the Google Developers Console project that owns the operation. Required." + }, + "transferSpec": { + "$ref": "TransferSpec", + "description": "Transfer specification. Required." + }, + "startTime": { + "type": "string", + "description": "Start time of this transfer execution." + }, + "endTime": { + "type": "string", + "description": "End time of this transfer execution." + }, + "status": { + "type": "string", + "description": "Status of the transfer operation.", + "enum": [ + "STATUS_UNSPECIFIED", + "IN_PROGRESS", + "PAUSED", + "SUCCESS", + "FAILED", + "ABORTED" + ] + }, + "counters": { + "$ref": "TransferCounters", + "description": "Information about the progress of the transfer operation." + }, + "errorBreakdowns": { + "type": "array", + "description": "Summarizes errors encountered with sample error log entries.", + "items": { + "$ref": "ErrorSummary" + } + }, + "transferJobName": { + "type": "string", + "description": "The name of the transfer job that triggers this transfer operation." + } + } + }, + "TransferCounters": { + "id": "TransferCounters", + "type": "object", + "description": "A collection of counters that report the progress of a transfer operation.", + "properties": { + "objectsFoundFromSource": { + "type": "string", + "description": "Objects found in the data source that are scheduled to be transferred, which will be copied, excluded based on conditions, or skipped due to failures.", + "format": "int64" + }, + "bytesFoundFromSource": { + "type": "string", + "description": "Bytes found in the data source that are scheduled to be transferred, which will be copied, excluded based on conditions, or skipped due to failures.", + "format": "int64" + }, + "objectsFoundOnlyFromSink": { + "type": "string", + "description": "Objects found only in the data sink that are scheduled to be deleted.", + "format": "int64" + }, + "bytesFoundOnlyFromSink": { + "type": "string", + "description": "Bytes found only in the data sink that are scheduled to be deleted.", + "format": "int64" + }, + "objectsFromSourceSkippedBySync": { + "type": "string", + "description": "Objects in the data source that are not transferred because they already exist in the data sink.", + "format": "int64" + }, + "bytesFromSourceSkippedBySync": { + "type": "string", + "description": "Bytes in the data source that are not transferred because they already exist in the data sink.", + "format": "int64" + }, + "objectsCopiedToSink": { + "type": "string", + "description": "Objects that are copied to the data sink.", + "format": "int64" + }, + "bytesCopiedToSink": { + "type": "string", + "description": "Bytes that are copied to the data sink.", + "format": "int64" + }, + "objectsDeletedFromSource": { + "type": "string", + "description": "Objects that are deleted from the data source.", + "format": "int64" + }, + "bytesDeletedFromSource": { + "type": "string", + "description": "Bytes that are deleted from the data source.", + "format": "int64" + }, + "objectsDeletedFromSink": { + "type": "string", + "description": "Objects that are deleted from the data sink.", + "format": "int64" + }, + "bytesDeletedFromSink": { + "type": "string", + "description": "Bytes that are deleted from the data sink.", + "format": "int64" + }, + "objectsFromSourceFailed": { + "type": "string", + "description": "Objects in the data source that failed during the transfer.", + "format": "int64" + }, + "bytesFromSourceFailed": { + "type": "string", + "description": "Bytes in the data source that failed during the transfer.", + "format": "int64" + }, + "objectsFailedToDeleteFromSink": { + "type": "string", + "description": "Objects that failed to be deleted from the data sink.", + "format": "int64" + }, + "bytesFailedToDeleteFromSink": { + "type": "string", + "description": "Bytes that failed to be deleted from the data sink.", + "format": "int64" + } + } + }, + "ErrorSummary": { + "id": "ErrorSummary", + "type": "object", + "description": "A summary of errors by error code, plus a count and sample error log entries.", + "properties": { + "errorCode": { + "type": "string", + "description": "Required.", + "enum": [ + "OK", + "CANCELLED", + "UNKNOWN", + "INVALID_ARGUMENT", + "DEADLINE_EXCEEDED", + "NOT_FOUND", + "ALREADY_EXISTS", + "PERMISSION_DENIED", + "UNAUTHENTICATED", + "RESOURCE_EXHAUSTED", + "FAILED_PRECONDITION", + "ABORTED", + "OUT_OF_RANGE", + "UNIMPLEMENTED", + "INTERNAL", + "UNAVAILABLE", + "DATA_LOSS" + ] + }, + "errorCount": { + "type": "string", + "description": "Count of this type of error. Required.", + "format": "int64" + }, + "errorLogEntries": { + "type": "array", + "description": "Error samples.", + "items": { + "$ref": "ErrorLogEntry" + } + } + } + }, + "ErrorLogEntry": { + "id": "ErrorLogEntry", + "type": "object", + "description": "An entry describing an error that has occurred.", + "properties": { + "url": { + "type": "string", + "description": "A URL that refers to the target (a data source, a data sink, or an object) with which the error is associated. Required." + }, + "errorDetails": { + "type": "array", + "description": "A list of messages that carry the error details.", + "items": { + "type": "string" + } + } + } + } + }, + "resources": { + "googleServiceAccounts": { + "methods": { + "get": { + "id": "storagetransfer.googleServiceAccounts.get", + "path": "v1/googleServiceAccounts/{projectId}", + "httpMethod": "GET", + "description": "Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Developers Console project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer Service.", + "parameters": { + "projectId": { + "type": "string", + "description": "The ID of the Google Developers Console project that the Google service account is associated with. Required.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "GoogleServiceAccount" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "v1": { + "methods": { + "getGoogleServiceAccount": { + "id": "storagetransfer.getGoogleServiceAccount", + "path": "v1:getGoogleServiceAccount", + "httpMethod": "GET", + "description": "Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Developers Console project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer Service.", + "parameters": { + "projectId": { + "type": "string", + "description": "The ID of the Google Developers Console project that the Google service account is associated with. Required.", + "location": "query" + } + }, + "response": { + "$ref": "GoogleServiceAccount" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "transferJobs": { + "methods": { + "create": { + "id": "storagetransfer.transferJobs.create", + "path": "v1/transferJobs", + "httpMethod": "POST", + "description": "Creates a transfer job that runs periodically.", + "request": { + "$ref": "TransferJob" + }, + "response": { + "$ref": "TransferJob" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "patch": { + "id": "storagetransfer.transferJobs.patch", + "path": "v1/{+jobName}", + "httpMethod": "PATCH", + "description": "Updates a transfer job. Updating a job's transfer spec does not affect transfer operations that are running already. Updating the scheduling of a job is not allowed.", + "parameters": { + "jobName": { + "type": "string", + "description": "The name of job to update. Required.", + "required": true, + "pattern": "^transferJobs/.*$", + "location": "path" + } + }, + "parameterOrder": [ + "jobName" + ], + "request": { + "$ref": "UpdateTransferJobRequest" + }, + "response": { + "$ref": "TransferJob" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "id": "storagetransfer.transferJobs.get", + "path": "v1/{+jobName}", + "httpMethod": "GET", + "description": "Gets a transfer job.", + "parameters": { + "jobName": { + "type": "string", + "description": "The job to get. Required.", + "required": true, + "pattern": "^transferJobs/.*$", + "location": "path" + }, + "projectId": { + "type": "string", + "description": "The ID of the Google Developers Console project that owns the job. Required.", + "location": "query" + } + }, + "parameterOrder": [ + "jobName" + ], + "response": { + "$ref": "TransferJob" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "id": "storagetransfer.transferJobs.list", + "path": "v1/transferJobs", + "httpMethod": "GET", + "description": "Lists transfer jobs.", + "parameters": { + "filter": { + "type": "string", + "description": "A list of query parameters specified as JSON text in the form of {\"`project_id`\":\"my_project_id\", \"`job_names`\":[\"jobid1\",\"jobid2\",...], \"`job_statuses`\":[\"status1\",\"status2\",...]}. Since `job_names` and `job_statuses` support multiple values, their values must be specified with array notation. `project_id` is required. `job_names` and `job_statuses` are optional. The valid values for `job_statuses` are case-insensitive: `ENABLED`, `DISABLED`, and `DELETED`.", + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "The list page size. The max allowed value is 256.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The list page token.", + "location": "query" + } + }, + "response": { + "$ref": "ListTransferJobsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "transferOperations": { + "methods": { + "pause": { + "id": "storagetransfer.transferOperations.pause", + "path": "v1/{+name}:pause", + "httpMethod": "POST", + "description": "Pauses a transfer operation.", + "parameters": { + "name": { + "type": "string", + "description": "The name of the transfer operation. Required.", + "required": true, + "pattern": "^transferOperations/.*$", + "location": "path" + } + }, + "parameterOrder": [ + "name" + ], + "request": { + "$ref": "PauseTransferOperationRequest" + }, + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "resume": { + "id": "storagetransfer.transferOperations.resume", + "path": "v1/{+name}:resume", + "httpMethod": "POST", + "description": "Resumes a transfer operation that is paused.", + "parameters": { + "name": { + "type": "string", + "description": "The name of the transfer operation. Required.", + "required": true, + "pattern": "^transferOperations/.*$", + "location": "path" + } + }, + "parameterOrder": [ + "name" + ], + "request": { + "$ref": "ResumeTransferOperationRequest" + }, + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "id": "storagetransfer.transferOperations.get", + "path": "v1/{+name}", + "httpMethod": "GET", + "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + "parameters": { + "name": { + "type": "string", + "description": "The name of the operation resource.", + "required": true, + "pattern": "^transferOperations/.*$", + "location": "path" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "id": "storagetransfer.transferOperations.list", + "path": "v1/{+name}", + "httpMethod": "GET", + "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding below allows API services to override the binding to use different resource name schemes, such as `users/*/operations`.", + "parameters": { + "name": { + "type": "string", + "description": "The value `transferOperations`.", + "required": true, + "pattern": "^transferOperations$", + "location": "path" + }, + "filter": { + "type": "string", + "description": "The standard list filter.", + "location": "query" + }, + "pageSize": { + "type": "integer", + "description": "The standard list page size.", + "format": "int32", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The standard list page token.", + "location": "query" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "ListOperationsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "cancel": { + "id": "storagetransfer.transferOperations.cancel", + "path": "v1/{+name}:cancel", + "httpMethod": "POST", + "description": "Cancels a transfer. Use the get method to check whether the cancellation succeeded or whether the operation completed despite cancellation.", + "parameters": { + "name": { + "type": "string", + "description": "The name of the operation resource to be cancelled.", + "required": true, + "pattern": "^transferOperations/.*$", + "location": "path" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "id": "storagetransfer.transferOperations.delete", + "path": "v1/{+name}", + "httpMethod": "DELETE", + "description": "This method is not supported and the server returns `UNIMPLEMENTED`.", + "parameters": { + "name": { + "type": "string", + "description": "The name of the operation resource to be deleted.", + "required": true, + "pattern": "^transferOperations/.*$", + "location": "path" + } + }, + "parameterOrder": [ + "name" + ], + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/storagetransfer/v1/storagetransfer-gen.go b/Godeps/_workspace/src/google.golang.org/api/storagetransfer/v1/storagetransfer-gen.go new file mode 100644 index 000000000..70ccfaa90 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/storagetransfer/v1/storagetransfer-gen.go @@ -0,0 +1,2604 @@ +// Package storagetransfer provides access to the Google Storage Transfer API. +// +// See https://cloud.google.com/storage/transfer +// +// Usage example: +// +// import "google.golang.org/api/storagetransfer/v1" +// ... +// storagetransferService, err := storagetransfer.New(oauthHttpClient) +package storagetransfer // import "google.golang.org/api/storagetransfer/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "storagetransfer:v1" +const apiName = "storagetransfer" +const apiVersion = "v1" +const basePath = "https://storagetransfer.googleapis.com/" + +// OAuth2 scopes used by this API. +const ( + // View and manage your data across Google Cloud Platform services + CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.GoogleServiceAccounts = NewGoogleServiceAccountsService(s) + s.TransferJobs = NewTransferJobsService(s) + s.TransferOperations = NewTransferOperationsService(s) + s.V1 = NewV1Service(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + GoogleServiceAccounts *GoogleServiceAccountsService + + TransferJobs *TransferJobsService + + TransferOperations *TransferOperationsService + + V1 *V1Service +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewGoogleServiceAccountsService(s *Service) *GoogleServiceAccountsService { + rs := &GoogleServiceAccountsService{s: s} + return rs +} + +type GoogleServiceAccountsService struct { + s *Service +} + +func NewTransferJobsService(s *Service) *TransferJobsService { + rs := &TransferJobsService{s: s} + return rs +} + +type TransferJobsService struct { + s *Service +} + +func NewTransferOperationsService(s *Service) *TransferOperationsService { + rs := &TransferOperationsService{s: s} + return rs +} + +type TransferOperationsService struct { + s *Service +} + +func NewV1Service(s *Service) *V1Service { + rs := &V1Service{s: s} + return rs +} + +type V1Service struct { + s *Service +} + +// AwsAccessKey: AWS access key (see [AWS Security +// Credentials](http://docs.aws.amazon.com/general/latest/gr/aws-security +// -credentials.html)). +type AwsAccessKey struct { + // AccessKeyId: AWS access key ID. Required. + AccessKeyId string `json:"accessKeyId,omitempty"` + + // SecretAccessKey: AWS secret access key. This field is not returned in + // RPC responses. Required. + SecretAccessKey string `json:"secretAccessKey,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AccessKeyId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AwsAccessKey) MarshalJSON() ([]byte, error) { + type noMethod AwsAccessKey + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AwsS3Data: An AwsS3Data can be a data source, but not a data sink. In +// an AwsS3Data, an object's name is the S3 object's key name. +type AwsS3Data struct { + // AwsAccessKey: AWS access key used to sign the API requests to the AWS + // S3 bucket. Permissions on the bucket must be granted to the access ID + // of the AWS access key. Required. + AwsAccessKey *AwsAccessKey `json:"awsAccessKey,omitempty"` + + // BucketName: S3 Bucket name (see [Creating a + // bucket](http://docs.aws.amazon.com/AmazonS3/latest/dev/create-bucket-g + // et-location-example.html)). Required. + BucketName string `json:"bucketName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AwsAccessKey") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AwsS3Data) MarshalJSON() ([]byte, error) { + type noMethod AwsS3Data + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Date: Represents a whole calendar date, e.g. date of birth. The time +// of day and time zone are either specified elsewhere or are not +// significant. The date is relative to the Proleptic Gregorian +// Calendar. The day may be 0 to represent a year and month where the +// day is not significant, e.g. credit card expiration date. The year +// may be 0 to represent a month and day independent of year, e.g. +// anniversary date. Related types are +// [google.type.TimeOfDay][google.type.TimeOfDay] and +// `google.protobuf.Timestamp`. +type Date struct { + // Day: Day of month. Must be from 1 to 31 and valid for the year and + // month, or 0 if specifying a year/month where the day is not + // sigificant. + Day int64 `json:"day,omitempty"` + + // Month: Month of year of date. Must be from 1 to 12. + Month int64 `json:"month,omitempty"` + + // Year: Year of date. Must be from 1 to 9,999, or 0 if specifying a + // date without a year. + Year int64 `json:"year,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Day") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Date) MarshalJSON() ([]byte, error) { + type noMethod Date + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Empty: A generic empty message that you can re-use to avoid defining +// duplicated empty messages in your APIs. A typical example is to use +// it as the request or the response type of an API method. For +// instance: service Foo { rpc Bar(google.protobuf.Empty) returns +// (google.protobuf.Empty); } The JSON representation for `Empty` is +// empty JSON object `{}`. +type Empty struct { + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` +} + +// ErrorLogEntry: An entry describing an error that has occurred. +type ErrorLogEntry struct { + // ErrorDetails: A list of messages that carry the error details. + ErrorDetails []string `json:"errorDetails,omitempty"` + + // Url: A URL that refers to the target (a data source, a data sink, or + // an object) with which the error is associated. Required. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ErrorDetails") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ErrorLogEntry) MarshalJSON() ([]byte, error) { + type noMethod ErrorLogEntry + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ErrorSummary: A summary of errors by error code, plus a count and +// sample error log entries. +type ErrorSummary struct { + // ErrorCode: Required. + // + // Possible values: + // "OK" + // "CANCELLED" + // "UNKNOWN" + // "INVALID_ARGUMENT" + // "DEADLINE_EXCEEDED" + // "NOT_FOUND" + // "ALREADY_EXISTS" + // "PERMISSION_DENIED" + // "UNAUTHENTICATED" + // "RESOURCE_EXHAUSTED" + // "FAILED_PRECONDITION" + // "ABORTED" + // "OUT_OF_RANGE" + // "UNIMPLEMENTED" + // "INTERNAL" + // "UNAVAILABLE" + // "DATA_LOSS" + ErrorCode string `json:"errorCode,omitempty"` + + // ErrorCount: Count of this type of error. Required. + ErrorCount int64 `json:"errorCount,omitempty,string"` + + // ErrorLogEntries: Error samples. + ErrorLogEntries []*ErrorLogEntry `json:"errorLogEntries,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ErrorCode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ErrorSummary) MarshalJSON() ([]byte, error) { + type noMethod ErrorSummary + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GcsData: In a GcsData, an object's name is the Google Cloud Storage +// object's name and its `lastModificationTime` refers to the object's +// updated time, which changes when the content or the metadata of the +// object is updated. +type GcsData struct { + // BucketName: Google Cloud Storage bucket name (see [Bucket Name + // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requ + // irements)). Required. + BucketName string `json:"bucketName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BucketName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GcsData) MarshalJSON() ([]byte, error) { + type noMethod GcsData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GoogleServiceAccount: Google service account +type GoogleServiceAccount struct { + // AccountEmail: Required. + AccountEmail string `json:"accountEmail,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountEmail") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GoogleServiceAccount) MarshalJSON() ([]byte, error) { + type noMethod GoogleServiceAccount + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// HttpData: An HttpData specifies a list of objects on the web to be +// transferred over HTTP. The information of the objects to be +// transferred is contained in a file referenced by a URL. The first +// line in the file must be "TsvHttpData-1.0", which specifies the +// format of the file. Subsequent lines specify the information of the +// list of objects, one object per list entry. Each entry has the +// following tab-delimited fields: * HTTP URL * Length * MD5 - This +// field is a base64-encoded MD5 hash of the object An HTTP URL that +// points to the object to be transferred. It must be a valid URL with +// URL scheme HTTP or HTTPS. When an object with URL +// `http(s)://hostname:port/` is transferred to the data sink, the name +// of the object at the data sink is `/`. Length and MD5 provide the +// size and the base64-encoded MD5 hash of the object. If Length does +// not match the actual length of the object fetched, the object will +// not be transferred. If MD5 does not match the MD5 computed from the +// transferred bytes, the object transfer will fail. +// `lastModificationTime` is not available in HttpData objects. The +// objects that the URL list points to must allow public access. Storage +// Transfer Service obeys `robots.txt` rules and requires the HTTP +// server to support Range requests and to return a Content-Length +// header in each response. +type HttpData struct { + // ListUrl: The URL that points to the file that stores the object list + // entries. This file must allow public access. Currently, only URLs + // with HTTP and HTTPS schemes are supported. Required. + ListUrl string `json:"listUrl,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ListUrl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HttpData) MarshalJSON() ([]byte, error) { + type noMethod HttpData + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListOperationsResponse: The response message for +// [Operations.ListOperations][google.longrunning.Operations.ListOperatio +// ns]. +type ListOperationsResponse struct { + // NextPageToken: The standard List next-page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Operations: A list of operations that matches the specified filter in + // the request. + Operations []*Operation `json:"operations,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListOperationsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListTransferJobsResponse: Response from ListTransferJobs. +type ListTransferJobsResponse struct { + // NextPageToken: The list next page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // TransferJobs: A list of transfer jobs. + TransferJobs []*TransferJob `json:"transferJobs,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListTransferJobsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListTransferJobsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ObjectConditions: Conditions that determine which objects will be +// transferred. +type ObjectConditions struct { + // ExcludePrefixes: `excludePrefixes` must follow the requirements + // described for `includePrefixes`. The max size of `excludePrefixes` is + // 20. + ExcludePrefixes []string `json:"excludePrefixes,omitempty"` + + // IncludePrefixes: If `includePrefixes` is specified, objects that + // satisfy the object conditions must have names that start with one of + // the `includePrefixes` and that do not start with any of the + // `excludePrefixes`. If `includePrefixes` is not specified, all objects + // except those that have names starting with one of the + // `excludePrefixes` must satisfy the object conditions. Requirements: * + // Each include-prefix and exclude-prefix can contain any sequence of + // Unicode characters, of max length 1024 bytes when UTF8-encoded, and + // must not contain Carriage Return or Line Feed characters. Wildcard + // matching and regular expression matching are not supported. * None of + // the include-prefix or the exclude-prefix values can be empty, if + // specified. * Each include-prefix must include a distinct portion of + // the object namespace, i.e., no include-prefix may be a prefix of + // another include-prefix. * Each exclude-prefix must exclude a distinct + // portion of the object namespace, i.e., no exclude-prefix may be a + // prefix of another exclude-prefix. * If `includePrefixes` is + // specified, then each exclude-prefix must start with the value of a + // path explicitly included by `includePrefixes`. The max size of + // `includePrefixes` is 20. + IncludePrefixes []string `json:"includePrefixes,omitempty"` + + // MaxTimeElapsedSinceLastModification: + // `maxTimeElapsedSinceLastModification` is the complement to + // `minTimeElapsedSinceLastModification`. + MaxTimeElapsedSinceLastModification string `json:"maxTimeElapsedSinceLastModification,omitempty"` + + // MinTimeElapsedSinceLastModification: If unspecified, + // `minTimeElapsedSinceLastModification` takes a zero value and + // `maxTimeElapsedSinceLastModification` takes the maximum possible + // value of Duration. Objects that satisfy the object conditions must + // either have a `lastModificationTime` greater or equal to `NOW` - + // `maxTimeElapsedSinceLastModification` and less than `NOW` - + // `minTimeElapsedSinceLastModification`, or not have a + // `lastModificationTime`. + MinTimeElapsedSinceLastModification string `json:"minTimeElapsedSinceLastModification,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ExcludePrefixes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ObjectConditions) MarshalJSON() ([]byte, error) { + type noMethod ObjectConditions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Operation: This resource represents a long-running operation that is +// the result of a network API call. +type Operation struct { + // Done: If the value is `false`, it means the operation is still in + // progress. If true, the operation is completed and the `result` is + // available. + Done bool `json:"done,omitempty"` + + // Error: The error result of the operation in case of failure. + Error *Status `json:"error,omitempty"` + + // Metadata: Represents the transfer operation object. + Metadata OperationMetadata `json:"metadata,omitempty"` + + // Name: The server-assigned name, which is only unique within the same + // service that originally returns it. If you use the default HTTP + // mapping above, the `name` should have the format of + // `operations/some/unique/name`. + Name string `json:"name,omitempty"` + + // Response: The normal response of the operation in case of success. If + // the original method returns no data on success, such as `Delete`, the + // response is `google.protobuf.Empty`. If the original method is + // standard `Get`/`Create`/`Update`, the response should be the + // resource. For other methods, the response should have the type + // `XxxResponse`, where `Xxx` is the original method name. For example, + // if the original method name is `TakeSnapshot()`, the inferred + // response type is `TakeSnapshotResponse`. + Response OperationResponse `json:"response,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Done") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Operation) MarshalJSON() ([]byte, error) { + type noMethod Operation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type OperationMetadata interface{} + +type OperationResponse interface{} + +// PauseTransferOperationRequest: Request passed to +// PauseTransferOperation. +type PauseTransferOperationRequest struct { +} + +// ResumeTransferOperationRequest: Request passed to +// ResumeTransferOperation. +type ResumeTransferOperationRequest struct { +} + +// Schedule: Transfers can be scheduled to recur or to run just once. +type Schedule struct { + // ScheduleEndDate: The last day the recurring transfer will be run. If + // `scheduleEndDate` is the same as `scheduleStartDate`, the transfer + // will be executed only once. + ScheduleEndDate *Date `json:"scheduleEndDate,omitempty"` + + // ScheduleStartDate: The first day the recurring transfer is scheduled + // to run. Required. + ScheduleStartDate *Date `json:"scheduleStartDate,omitempty"` + + // StartTimeOfDay: The time in UTC at which the transfer will be + // scheduled to start in a day. Transfers may start later than this + // time. If not specified, transfers are scheduled to start at midnight + // UTC. + StartTimeOfDay *TimeOfDay `json:"startTimeOfDay,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ScheduleEndDate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Schedule) MarshalJSON() ([]byte, error) { + type noMethod Schedule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Status: The `Status` type defines a logical error model that is +// suitable for different programming environments, including REST APIs +// and RPC APIs. It is used by [gRPC](https://github.com/grpc). The +// error model is designed to be: - Simple to use and understand for +// most users - Flexible enough to meet unexpected needs # Overview The +// `Status` message contains three pieces of data: error code, error +// message, and error details. The error code should be an enum value of +// [google.rpc.Code][google.rpc.Code], but it may accept additional +// error codes if needed. The error message should be a developer-facing +// English message that helps developers *understand* and *resolve* the +// error. If a localized user-facing error message is needed, put the +// localized message in the error details or localize it in the client. +// The optional error details may contain arbitrary information about +// the error. There is a predefined set of error detail types in the +// package `google.rpc` which can be used for common error conditions. # +// Language mapping The `Status` message is the logical representation +// of the error model, but it is not necessarily the actual wire format. +// When the `Status` message is exposed in different client libraries +// and different wire protocols, it can be mapped differently. For +// example, it will likely be mapped to some exceptions in Java, but +// more likely mapped to some error codes in C. # Other uses The error +// model and the `Status` message can be used in a variety of +// environments, either with or without APIs, to provide a consistent +// developer experience across different environments. Example uses of +// this error model include: - Partial errors. If a service needs to +// return partial errors to the client, it may embed the `Status` in the +// normal response to indicate the partial errors. - Workflow errors. A +// typical workflow has multiple steps. Each step may have a `Status` +// message for error reporting purpose. - Batch operations. If a client +// uses batch request and batch response, the `Status` message should be +// used directly inside batch response, one for each error sub-response. +// - Asynchronous operations. If an API call embeds asynchronous +// operation results in its response, the status of those operations +// should be represented directly using the `Status` message. - Logging. +// If some API errors are stored in logs, the message `Status` could be +// used directly after any stripping needed for security/privacy +// reasons. +type Status struct { + // Code: The status code, which should be an enum value of + // [google.rpc.Code][google.rpc.Code]. + Code int64 `json:"code,omitempty"` + + // Details: A list of messages that carry the error details. There will + // be a common set of message types for APIs to use. + Details []StatusDetails `json:"details,omitempty"` + + // Message: A developer-facing error message, which should be in + // English. Any user-facing error message should be localized and sent + // in the [google.rpc.Status.details][google.rpc.Status.details] field, + // or localized by the client. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Status) MarshalJSON() ([]byte, error) { + type noMethod Status + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type StatusDetails interface{} + +// TimeOfDay: Represents a time of day. The date and time zone are +// either not significant or are specified elsewhere. An API may chose +// to allow leap seconds. Related types are +// [google.type.Date][google.type.Date] and `google.protobuf.Timestamp`. +type TimeOfDay struct { + // Hours: Hours of day in 24 hour format. Should be from 0 to 23. An API + // may choose to allow the value "24:00:00" for scenarios like business + // closing time. + Hours int64 `json:"hours,omitempty"` + + // Minutes: Minutes of hour of day. Must be from 0 to 59. + Minutes int64 `json:"minutes,omitempty"` + + // Nanos: Fractions of seconds in nanoseconds. Must be from 0 to + // 999,999,999. + Nanos int64 `json:"nanos,omitempty"` + + // Seconds: Seconds of minutes of the time. Must normally be from 0 to + // 59. An API may allow the value 60 if it allows leap-seconds. + Seconds int64 `json:"seconds,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Hours") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TimeOfDay) MarshalJSON() ([]byte, error) { + type noMethod TimeOfDay + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TransferCounters: A collection of counters that report the progress +// of a transfer operation. +type TransferCounters struct { + // BytesCopiedToSink: Bytes that are copied to the data sink. + BytesCopiedToSink int64 `json:"bytesCopiedToSink,omitempty,string"` + + // BytesDeletedFromSink: Bytes that are deleted from the data sink. + BytesDeletedFromSink int64 `json:"bytesDeletedFromSink,omitempty,string"` + + // BytesDeletedFromSource: Bytes that are deleted from the data source. + BytesDeletedFromSource int64 `json:"bytesDeletedFromSource,omitempty,string"` + + // BytesFailedToDeleteFromSink: Bytes that failed to be deleted from the + // data sink. + BytesFailedToDeleteFromSink int64 `json:"bytesFailedToDeleteFromSink,omitempty,string"` + + // BytesFoundFromSource: Bytes found in the data source that are + // scheduled to be transferred, which will be copied, excluded based on + // conditions, or skipped due to failures. + BytesFoundFromSource int64 `json:"bytesFoundFromSource,omitempty,string"` + + // BytesFoundOnlyFromSink: Bytes found only in the data sink that are + // scheduled to be deleted. + BytesFoundOnlyFromSink int64 `json:"bytesFoundOnlyFromSink,omitempty,string"` + + // BytesFromSourceFailed: Bytes in the data source that failed during + // the transfer. + BytesFromSourceFailed int64 `json:"bytesFromSourceFailed,omitempty,string"` + + // BytesFromSourceSkippedBySync: Bytes in the data source that are not + // transferred because they already exist in the data sink. + BytesFromSourceSkippedBySync int64 `json:"bytesFromSourceSkippedBySync,omitempty,string"` + + // ObjectsCopiedToSink: Objects that are copied to the data sink. + ObjectsCopiedToSink int64 `json:"objectsCopiedToSink,omitempty,string"` + + // ObjectsDeletedFromSink: Objects that are deleted from the data sink. + ObjectsDeletedFromSink int64 `json:"objectsDeletedFromSink,omitempty,string"` + + // ObjectsDeletedFromSource: Objects that are deleted from the data + // source. + ObjectsDeletedFromSource int64 `json:"objectsDeletedFromSource,omitempty,string"` + + // ObjectsFailedToDeleteFromSink: Objects that failed to be deleted from + // the data sink. + ObjectsFailedToDeleteFromSink int64 `json:"objectsFailedToDeleteFromSink,omitempty,string"` + + // ObjectsFoundFromSource: Objects found in the data source that are + // scheduled to be transferred, which will be copied, excluded based on + // conditions, or skipped due to failures. + ObjectsFoundFromSource int64 `json:"objectsFoundFromSource,omitempty,string"` + + // ObjectsFoundOnlyFromSink: Objects found only in the data sink that + // are scheduled to be deleted. + ObjectsFoundOnlyFromSink int64 `json:"objectsFoundOnlyFromSink,omitempty,string"` + + // ObjectsFromSourceFailed: Objects in the data source that failed + // during the transfer. + ObjectsFromSourceFailed int64 `json:"objectsFromSourceFailed,omitempty,string"` + + // ObjectsFromSourceSkippedBySync: Objects in the data source that are + // not transferred because they already exist in the data sink. + ObjectsFromSourceSkippedBySync int64 `json:"objectsFromSourceSkippedBySync,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "BytesCopiedToSink") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TransferCounters) MarshalJSON() ([]byte, error) { + type noMethod TransferCounters + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TransferJob: This resource represents the configuration of a transfer +// job that runs periodically. +type TransferJob struct { + // CreationTime: This field cannot be changed by user requests. + CreationTime string `json:"creationTime,omitempty"` + + // DeletionTime: This field cannot be changed by user requests. + DeletionTime string `json:"deletionTime,omitempty"` + + // Description: A description provided by the user for the job. Its max + // length is 1024 bytes when Unicode-encoded. + Description string `json:"description,omitempty"` + + // LastModificationTime: This field cannot be changed by user requests. + LastModificationTime string `json:"lastModificationTime,omitempty"` + + // Name: A globally unique name assigned by Storage Transfer Service + // when the job is created. This field should be left empty in requests + // to create a new transfer job; otherwise, the requests result in an + // `INVALID_ARGUMENT` error. + Name string `json:"name,omitempty"` + + // ProjectId: The ID of the Google Developers Console project that owns + // the job. Required. + ProjectId string `json:"projectId,omitempty"` + + // Schedule: Schedule specification. Required. + Schedule *Schedule `json:"schedule,omitempty"` + + // Status: Status of the job. This value MUST be specified for + // `CreateTransferJobRequests`. NOTE: The effect of the new job status + // takes place during a subsequent job run. For example, if you change + // the job status from `ENABLED` to `DISABLED`, and an operation spawned + // by the transfer is running, the status change would not affect the + // current operation. + // + // Possible values: + // "STATUS_UNSPECIFIED" + // "ENABLED" + // "DISABLED" + // "DELETED" + Status string `json:"status,omitempty"` + + // TransferSpec: Transfer specification. Required. + TransferSpec *TransferSpec `json:"transferSpec,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CreationTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TransferJob) MarshalJSON() ([]byte, error) { + type noMethod TransferJob + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TransferOperation: A description of the execution of a transfer. +type TransferOperation struct { + // Counters: Information about the progress of the transfer operation. + Counters *TransferCounters `json:"counters,omitempty"` + + // EndTime: End time of this transfer execution. + EndTime string `json:"endTime,omitempty"` + + // ErrorBreakdowns: Summarizes errors encountered with sample error log + // entries. + ErrorBreakdowns []*ErrorSummary `json:"errorBreakdowns,omitempty"` + + // Name: A globally unique ID assigned by the system. + Name string `json:"name,omitempty"` + + // ProjectId: The ID of the Google Developers Console project that owns + // the operation. Required. + ProjectId string `json:"projectId,omitempty"` + + // StartTime: Start time of this transfer execution. + StartTime string `json:"startTime,omitempty"` + + // Status: Status of the transfer operation. + // + // Possible values: + // "STATUS_UNSPECIFIED" + // "IN_PROGRESS" + // "PAUSED" + // "SUCCESS" + // "FAILED" + // "ABORTED" + Status string `json:"status,omitempty"` + + // TransferJobName: The name of the transfer job that triggers this + // transfer operation. + TransferJobName string `json:"transferJobName,omitempty"` + + // TransferSpec: Transfer specification. Required. + TransferSpec *TransferSpec `json:"transferSpec,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Counters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TransferOperation) MarshalJSON() ([]byte, error) { + type noMethod TransferOperation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TransferOptions: TransferOptions uses three boolean parameters to +// define the actions to be performed on objects in a transfer. +type TransferOptions struct { + // DeleteObjectsFromSourceAfterTransfer: Whether objects should be + // deleted from the source after they are transferred to the sink. + DeleteObjectsFromSourceAfterTransfer bool `json:"deleteObjectsFromSourceAfterTransfer,omitempty"` + + // DeleteObjectsUniqueInSink: Whether objects that exist only in the + // sink should be deleted. + DeleteObjectsUniqueInSink bool `json:"deleteObjectsUniqueInSink,omitempty"` + + // OverwriteObjectsAlreadyExistingInSink: Whether overwriting objects + // that already exist in the sink is allowed. + OverwriteObjectsAlreadyExistingInSink bool `json:"overwriteObjectsAlreadyExistingInSink,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "DeleteObjectsFromSourceAfterTransfer") to unconditionally include in + // API requests. By default, fields with empty values are omitted from + // API requests. However, any non-pointer, non-interface field appearing + // in ForceSendFields will be sent to the server regardless of whether + // the field is empty or not. This may be used to include empty fields + // in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TransferOptions) MarshalJSON() ([]byte, error) { + type noMethod TransferOptions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TransferSpec: Configuration for running a transfer. +type TransferSpec struct { + // AwsS3DataSource: An AWS S3 data source. + AwsS3DataSource *AwsS3Data `json:"awsS3DataSource,omitempty"` + + // GcsDataSink: A Google Cloud Storage data sink. + GcsDataSink *GcsData `json:"gcsDataSink,omitempty"` + + // GcsDataSource: A Google Cloud Storage data source. + GcsDataSource *GcsData `json:"gcsDataSource,omitempty"` + + // HttpDataSource: An HTTP URL data source. + HttpDataSource *HttpData `json:"httpDataSource,omitempty"` + + // ObjectConditions: Only objects that satisfy these object conditions + // are included in the set of data source and data sink objects. Object + // conditions based on objects' `lastModificationTime` do not exclude + // objects in a data sink. + ObjectConditions *ObjectConditions `json:"objectConditions,omitempty"` + + // TransferOptions: If the option `deleteObjectsUniqueInSink` is `true`, + // object conditions based on objects' `lastModificationTime` are + // ignored and do not exclude objects in a data source or a data sink. + TransferOptions *TransferOptions `json:"transferOptions,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AwsS3DataSource") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TransferSpec) MarshalJSON() ([]byte, error) { + type noMethod TransferSpec + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UpdateTransferJobRequest: Request passed to UpdateTransferJob. +type UpdateTransferJobRequest struct { + // ProjectId: The ID of the Google Developers Console project that owns + // the job. Required. + ProjectId string `json:"projectId,omitempty"` + + // TransferJob: The job to update. Required. + TransferJob *TransferJob `json:"transferJob,omitempty"` + + // UpdateTransferJobFieldMask: The field mask of the fields in + // `transferJob` that are to be updated in this request. Fields in + // `transferJob` that can be updated are: `description`, `transferSpec`, + // and `status`. To update the `transferSpec` of the job, a complete + // transfer specification has to be provided. An incomplete + // specification which misses any required fields will be rejected with + // the error `INVALID_ARGUMENT`. + UpdateTransferJobFieldMask string `json:"updateTransferJobFieldMask,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ProjectId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UpdateTransferJobRequest) MarshalJSON() ([]byte, error) { + type noMethod UpdateTransferJobRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "storagetransfer.googleServiceAccounts.get": + +type GoogleServiceAccountsGetCall struct { + s *Service + projectId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Returns the Google service account that is used by Storage +// Transfer Service to access buckets in the project where transfers run +// or in other projects. Each Google service account is associated with +// one Google Developers Console project. Users should add this service +// account to the Google Cloud Storage bucket ACLs to grant access to +// Storage Transfer Service. This service account is created and owned +// by Storage Transfer Service and can only be used by Storage Transfer +// Service. +func (r *GoogleServiceAccountsService) Get(projectId string) *GoogleServiceAccountsGetCall { + c := &GoogleServiceAccountsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.projectId = projectId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *GoogleServiceAccountsGetCall) Fields(s ...googleapi.Field) *GoogleServiceAccountsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GoogleServiceAccountsGetCall) IfNoneMatch(entityTag string) *GoogleServiceAccountsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *GoogleServiceAccountsGetCall) Context(ctx context.Context) *GoogleServiceAccountsGetCall { + c.ctx_ = ctx + return c +} + +func (c *GoogleServiceAccountsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/googleServiceAccounts/{projectId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "projectId": c.projectId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storagetransfer.googleServiceAccounts.get" call. +// Exactly one of *GoogleServiceAccount or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GoogleServiceAccount.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *GoogleServiceAccountsGetCall) Do() (*GoogleServiceAccount, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &GoogleServiceAccount{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Developers Console project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer Service.", + // "httpMethod": "GET", + // "id": "storagetransfer.googleServiceAccounts.get", + // "parameterOrder": [ + // "projectId" + // ], + // "parameters": { + // "projectId": { + // "description": "The ID of the Google Developers Console project that the Google service account is associated with. Required.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/googleServiceAccounts/{projectId}", + // "response": { + // "$ref": "GoogleServiceAccount" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "storagetransfer.transferJobs.create": + +type TransferJobsCreateCall struct { + s *Service + transferjob *TransferJob + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a transfer job that runs periodically. +func (r *TransferJobsService) Create(transferjob *TransferJob) *TransferJobsCreateCall { + c := &TransferJobsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.transferjob = transferjob + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TransferJobsCreateCall) Fields(s ...googleapi.Field) *TransferJobsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TransferJobsCreateCall) Context(ctx context.Context) *TransferJobsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *TransferJobsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.transferjob) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/transferJobs") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storagetransfer.transferJobs.create" call. +// Exactly one of *TransferJob or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TransferJob.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TransferJobsCreateCall) Do() (*TransferJob, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TransferJob{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a transfer job that runs periodically.", + // "httpMethod": "POST", + // "id": "storagetransfer.transferJobs.create", + // "path": "v1/transferJobs", + // "request": { + // "$ref": "TransferJob" + // }, + // "response": { + // "$ref": "TransferJob" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "storagetransfer.transferJobs.get": + +type TransferJobsGetCall struct { + s *Service + jobName string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a transfer job. +func (r *TransferJobsService) Get(jobName string) *TransferJobsGetCall { + c := &TransferJobsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.jobName = jobName + return c +} + +// ProjectId sets the optional parameter "projectId": The ID of the +// Google Developers Console project that owns the job. Required. +func (c *TransferJobsGetCall) ProjectId(projectId string) *TransferJobsGetCall { + c.opt_["projectId"] = projectId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TransferJobsGetCall) Fields(s ...googleapi.Field) *TransferJobsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TransferJobsGetCall) IfNoneMatch(entityTag string) *TransferJobsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TransferJobsGetCall) Context(ctx context.Context) *TransferJobsGetCall { + c.ctx_ = ctx + return c +} + +func (c *TransferJobsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["projectId"]; ok { + params.Set("projectId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+jobName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "jobName": c.jobName, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storagetransfer.transferJobs.get" call. +// Exactly one of *TransferJob or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TransferJob.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TransferJobsGetCall) Do() (*TransferJob, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TransferJob{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a transfer job.", + // "httpMethod": "GET", + // "id": "storagetransfer.transferJobs.get", + // "parameterOrder": [ + // "jobName" + // ], + // "parameters": { + // "jobName": { + // "description": "The job to get. Required.", + // "location": "path", + // "pattern": "^transferJobs/.*$", + // "required": true, + // "type": "string" + // }, + // "projectId": { + // "description": "The ID of the Google Developers Console project that owns the job. Required.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/{+jobName}", + // "response": { + // "$ref": "TransferJob" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "storagetransfer.transferJobs.list": + +type TransferJobsListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists transfer jobs. +func (r *TransferJobsService) List() *TransferJobsListCall { + c := &TransferJobsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Filter sets the optional parameter "filter": A list of query +// parameters specified as JSON text in the form of +// {"project_id":"my_project_id", +// "job_names":["jobid1","jobid2",...], +// "job_statuses":["status1","status2",...]}. Since `job_names` and +// `job_statuses` support multiple values, their values must be +// specified with array notation. `project_id` is required. `job_names` +// and `job_statuses` are optional. The valid values for `job_statuses` +// are case-insensitive: `ENABLED`, `DISABLED`, and `DELETED`. +func (c *TransferJobsListCall) Filter(filter string) *TransferJobsListCall { + c.opt_["filter"] = filter + return c +} + +// PageSize sets the optional parameter "pageSize": The list page size. +// The max allowed value is 256. +func (c *TransferJobsListCall) PageSize(pageSize int64) *TransferJobsListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": The list page +// token. +func (c *TransferJobsListCall) PageToken(pageToken string) *TransferJobsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TransferJobsListCall) Fields(s ...googleapi.Field) *TransferJobsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TransferJobsListCall) IfNoneMatch(entityTag string) *TransferJobsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TransferJobsListCall) Context(ctx context.Context) *TransferJobsListCall { + c.ctx_ = ctx + return c +} + +func (c *TransferJobsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/transferJobs") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storagetransfer.transferJobs.list" call. +// Exactly one of *ListTransferJobsResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListTransferJobsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TransferJobsListCall) Do() (*ListTransferJobsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListTransferJobsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists transfer jobs.", + // "httpMethod": "GET", + // "id": "storagetransfer.transferJobs.list", + // "parameters": { + // "filter": { + // "description": "A list of query parameters specified as JSON text in the form of {\"`project_id`\":\"my_project_id\", \"`job_names`\":[\"jobid1\",\"jobid2\",...], \"`job_statuses`\":[\"status1\",\"status2\",...]}. Since `job_names` and `job_statuses` support multiple values, their values must be specified with array notation. `project_id` is required. `job_names` and `job_statuses` are optional. The valid values for `job_statuses` are case-insensitive: `ENABLED`, `DISABLED`, and `DELETED`.", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "The list page size. The max allowed value is 256.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The list page token.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/transferJobs", + // "response": { + // "$ref": "ListTransferJobsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "storagetransfer.transferJobs.patch": + +type TransferJobsPatchCall struct { + s *Service + jobName string + updatetransferjobrequest *UpdateTransferJobRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Patch: Updates a transfer job. Updating a job's transfer spec does +// not affect transfer operations that are running already. Updating the +// scheduling of a job is not allowed. +func (r *TransferJobsService) Patch(jobName string, updatetransferjobrequest *UpdateTransferJobRequest) *TransferJobsPatchCall { + c := &TransferJobsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c.jobName = jobName + c.updatetransferjobrequest = updatetransferjobrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TransferJobsPatchCall) Fields(s ...googleapi.Field) *TransferJobsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TransferJobsPatchCall) Context(ctx context.Context) *TransferJobsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *TransferJobsPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatetransferjobrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+jobName}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "jobName": c.jobName, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storagetransfer.transferJobs.patch" call. +// Exactly one of *TransferJob or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TransferJob.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TransferJobsPatchCall) Do() (*TransferJob, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TransferJob{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a transfer job. Updating a job's transfer spec does not affect transfer operations that are running already. Updating the scheduling of a job is not allowed.", + // "httpMethod": "PATCH", + // "id": "storagetransfer.transferJobs.patch", + // "parameterOrder": [ + // "jobName" + // ], + // "parameters": { + // "jobName": { + // "description": "The name of job to update. Required.", + // "location": "path", + // "pattern": "^transferJobs/.*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+jobName}", + // "request": { + // "$ref": "UpdateTransferJobRequest" + // }, + // "response": { + // "$ref": "TransferJob" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "storagetransfer.transferOperations.cancel": + +type TransferOperationsCancelCall struct { + s *Service + name string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Cancel: Cancels a transfer. Use the get method to check whether the +// cancellation succeeded or whether the operation completed despite +// cancellation. +func (r *TransferOperationsService) Cancel(name string) *TransferOperationsCancelCall { + c := &TransferOperationsCancelCall{s: r.s, opt_: make(map[string]interface{})} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TransferOperationsCancelCall) Fields(s ...googleapi.Field) *TransferOperationsCancelCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TransferOperationsCancelCall) Context(ctx context.Context) *TransferOperationsCancelCall { + c.ctx_ = ctx + return c +} + +func (c *TransferOperationsCancelCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storagetransfer.transferOperations.cancel" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TransferOperationsCancelCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Cancels a transfer. Use the get method to check whether the cancellation succeeded or whether the operation completed despite cancellation.", + // "httpMethod": "POST", + // "id": "storagetransfer.transferOperations.cancel", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The name of the operation resource to be cancelled.", + // "location": "path", + // "pattern": "^transferOperations/.*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}:cancel", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "storagetransfer.transferOperations.delete": + +type TransferOperationsDeleteCall struct { + s *Service + name string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: This method is not supported and the server returns +// `UNIMPLEMENTED`. +func (r *TransferOperationsService) Delete(name string) *TransferOperationsDeleteCall { + c := &TransferOperationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TransferOperationsDeleteCall) Fields(s ...googleapi.Field) *TransferOperationsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TransferOperationsDeleteCall) Context(ctx context.Context) *TransferOperationsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TransferOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storagetransfer.transferOperations.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TransferOperationsDeleteCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "This method is not supported and the server returns `UNIMPLEMENTED`.", + // "httpMethod": "DELETE", + // "id": "storagetransfer.transferOperations.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The name of the operation resource to be deleted.", + // "location": "path", + // "pattern": "^transferOperations/.*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "storagetransfer.transferOperations.get": + +type TransferOperationsGetCall struct { + s *Service + name string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets the latest state of a long-running operation. Clients can +// use this method to poll the operation result at intervals as +// recommended by the API service. +func (r *TransferOperationsService) Get(name string) *TransferOperationsGetCall { + c := &TransferOperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TransferOperationsGetCall) Fields(s ...googleapi.Field) *TransferOperationsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TransferOperationsGetCall) IfNoneMatch(entityTag string) *TransferOperationsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TransferOperationsGetCall) Context(ctx context.Context) *TransferOperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *TransferOperationsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storagetransfer.transferOperations.get" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TransferOperationsGetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", + // "httpMethod": "GET", + // "id": "storagetransfer.transferOperations.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The name of the operation resource.", + // "location": "path", + // "pattern": "^transferOperations/.*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "storagetransfer.transferOperations.list": + +type TransferOperationsListCall struct { + s *Service + name string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists operations that match the specified filter in the +// request. If the server doesn't support this method, it returns +// `UNIMPLEMENTED`. NOTE: the `name` binding below allows API services +// to override the binding to use different resource name schemes, such +// as `users/*/operations`. +func (r *TransferOperationsService) List(name string) *TransferOperationsListCall { + c := &TransferOperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c.name = name + return c +} + +// Filter sets the optional parameter "filter": The standard list +// filter. +func (c *TransferOperationsListCall) Filter(filter string) *TransferOperationsListCall { + c.opt_["filter"] = filter + return c +} + +// PageSize sets the optional parameter "pageSize": The standard list +// page size. +func (c *TransferOperationsListCall) PageSize(pageSize int64) *TransferOperationsListCall { + c.opt_["pageSize"] = pageSize + return c +} + +// PageToken sets the optional parameter "pageToken": The standard list +// page token. +func (c *TransferOperationsListCall) PageToken(pageToken string) *TransferOperationsListCall { + c.opt_["pageToken"] = pageToken + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TransferOperationsListCall) Fields(s ...googleapi.Field) *TransferOperationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TransferOperationsListCall) IfNoneMatch(entityTag string) *TransferOperationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TransferOperationsListCall) Context(ctx context.Context) *TransferOperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *TransferOperationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["filter"]; ok { + params.Set("filter", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageSize"]; ok { + params.Set("pageSize", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storagetransfer.transferOperations.list" call. +// Exactly one of *ListOperationsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListOperationsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TransferOperationsListCall) Do() (*ListOperationsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListOperationsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding below allows API services to override the binding to use different resource name schemes, such as `users/*/operations`.", + // "httpMethod": "GET", + // "id": "storagetransfer.transferOperations.list", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "filter": { + // "description": "The standard list filter.", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The value `transferOperations`.", + // "location": "path", + // "pattern": "^transferOperations$", + // "required": true, + // "type": "string" + // }, + // "pageSize": { + // "description": "The standard list page size.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The standard list page token.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "ListOperationsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "storagetransfer.transferOperations.pause": + +type TransferOperationsPauseCall struct { + s *Service + name string + pausetransferoperationrequest *PauseTransferOperationRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Pause: Pauses a transfer operation. +func (r *TransferOperationsService) Pause(name string, pausetransferoperationrequest *PauseTransferOperationRequest) *TransferOperationsPauseCall { + c := &TransferOperationsPauseCall{s: r.s, opt_: make(map[string]interface{})} + c.name = name + c.pausetransferoperationrequest = pausetransferoperationrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TransferOperationsPauseCall) Fields(s ...googleapi.Field) *TransferOperationsPauseCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TransferOperationsPauseCall) Context(ctx context.Context) *TransferOperationsPauseCall { + c.ctx_ = ctx + return c +} + +func (c *TransferOperationsPauseCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.pausetransferoperationrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:pause") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storagetransfer.transferOperations.pause" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TransferOperationsPauseCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Pauses a transfer operation.", + // "httpMethod": "POST", + // "id": "storagetransfer.transferOperations.pause", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The name of the transfer operation. Required.", + // "location": "path", + // "pattern": "^transferOperations/.*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}:pause", + // "request": { + // "$ref": "PauseTransferOperationRequest" + // }, + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "storagetransfer.transferOperations.resume": + +type TransferOperationsResumeCall struct { + s *Service + name string + resumetransferoperationrequest *ResumeTransferOperationRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Resume: Resumes a transfer operation that is paused. +func (r *TransferOperationsService) Resume(name string, resumetransferoperationrequest *ResumeTransferOperationRequest) *TransferOperationsResumeCall { + c := &TransferOperationsResumeCall{s: r.s, opt_: make(map[string]interface{})} + c.name = name + c.resumetransferoperationrequest = resumetransferoperationrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TransferOperationsResumeCall) Fields(s ...googleapi.Field) *TransferOperationsResumeCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TransferOperationsResumeCall) Context(ctx context.Context) *TransferOperationsResumeCall { + c.ctx_ = ctx + return c +} + +func (c *TransferOperationsResumeCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.resumetransferoperationrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:resume") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storagetransfer.transferOperations.resume" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TransferOperationsResumeCall) Do() (*Empty, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Resumes a transfer operation that is paused.", + // "httpMethod": "POST", + // "id": "storagetransfer.transferOperations.resume", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "The name of the transfer operation. Required.", + // "location": "path", + // "pattern": "^transferOperations/.*$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}:resume", + // "request": { + // "$ref": "ResumeTransferOperationRequest" + // }, + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "storagetransfer.getGoogleServiceAccount": + +type V1GetGoogleServiceAccountCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// GetGoogleServiceAccount: Returns the Google service account that is +// used by Storage Transfer Service to access buckets in the project +// where transfers run or in other projects. Each Google service account +// is associated with one Google Developers Console project. Users +// should add this service account to the Google Cloud Storage bucket +// ACLs to grant access to Storage Transfer Service. This service +// account is created and owned by Storage Transfer Service and can only +// be used by Storage Transfer Service. +func (r *V1Service) GetGoogleServiceAccount() *V1GetGoogleServiceAccountCall { + c := &V1GetGoogleServiceAccountCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// ProjectId sets the optional parameter "projectId": The ID of the +// Google Developers Console project that the Google service account is +// associated with. Required. +func (c *V1GetGoogleServiceAccountCall) ProjectId(projectId string) *V1GetGoogleServiceAccountCall { + c.opt_["projectId"] = projectId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *V1GetGoogleServiceAccountCall) Fields(s ...googleapi.Field) *V1GetGoogleServiceAccountCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *V1GetGoogleServiceAccountCall) IfNoneMatch(entityTag string) *V1GetGoogleServiceAccountCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *V1GetGoogleServiceAccountCall) Context(ctx context.Context) *V1GetGoogleServiceAccountCall { + c.ctx_ = ctx + return c +} + +func (c *V1GetGoogleServiceAccountCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["projectId"]; ok { + params.Set("projectId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "v1:getGoogleServiceAccount") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "storagetransfer.getGoogleServiceAccount" call. +// Exactly one of *GoogleServiceAccount or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *GoogleServiceAccount.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *V1GetGoogleServiceAccountCall) Do() (*GoogleServiceAccount, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &GoogleServiceAccount{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Developers Console project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer Service.", + // "httpMethod": "GET", + // "id": "storagetransfer.getGoogleServiceAccount", + // "parameters": { + // "projectId": { + // "description": "The ID of the Google Developers Console project that the Google service account is associated with. Required.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v1:getGoogleServiceAccount", + // "response": { + // "$ref": "GoogleServiceAccount" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/tagmanager/v1/tagmanager-api.json b/Godeps/_workspace/src/google.golang.org/api/tagmanager/v1/tagmanager-api.json new file mode 100644 index 000000000..eef47d78c --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/tagmanager/v1/tagmanager-api.json @@ -0,0 +1,2876 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/-5hQwJsgwNQCq1DK1Ud7--ggMIg\"", + "discoveryVersion": "v1", + "id": "tagmanager:v1", + "name": "tagmanager", + "canonicalName": "Tag Manager", + "version": "v1", + "revision": "20151008", + "title": "Tag Manager API", + "description": "API for accessing Tag Manager accounts and containers.", + "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/tag-manager/api/v1/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/tagmanager/v1/", + "basePath": "/tagmanager/v1/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "tagmanager/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/tagmanager.delete.containers": { + "description": "Delete your Google Tag Manager containers" + }, + "https://www.googleapis.com/auth/tagmanager.edit.containers": { + "description": "Manage your Google Tag Manager containers" + }, + "https://www.googleapis.com/auth/tagmanager.edit.containerversions": { + "description": "Manage your Google Tag Manager container versions" + }, + "https://www.googleapis.com/auth/tagmanager.manage.accounts": { + "description": "Manage your Google Tag Manager accounts" + }, + "https://www.googleapis.com/auth/tagmanager.manage.users": { + "description": "Manage user permissions of your Google Tag Manager data" + }, + "https://www.googleapis.com/auth/tagmanager.publish": { + "description": "Publish your Google Tag Manager containers" + }, + "https://www.googleapis.com/auth/tagmanager.readonly": { + "description": "View your Google Tag Manager containers" + } + } + } + }, + "schemas": { + "Account": { + "id": "Account", + "type": "object", + "description": "Represents a Google Tag Manager Account.", + "properties": { + "accountId": { + "type": "string", + "description": "The Account ID uniquely identifies the GTM Account." + }, + "fingerprint": { + "type": "string", + "description": "The fingerprint of the GTM Account as computed at storage time. This value is recomputed whenever the account is modified." + }, + "name": { + "type": "string", + "description": "Account display name." + }, + "shareData": { + "type": "boolean", + "description": "Whether the account shares data anonymously with Google and others." + } + } + }, + "AccountAccess": { + "id": "AccountAccess", + "type": "object", + "description": "Defines the Google Tag Manager Account access permissions.", + "properties": { + "permission": { + "type": "array", + "description": "List of Account permissions. Valid account permissions are read and manage.", + "items": { + "type": "string", + "enum": [ + "delete", + "edit", + "manage", + "publish", + "read" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "annotations": { + "required": [ + "tagmanager.accounts.permissions.create" + ] + } + } + } + }, + "Condition": { + "id": "Condition", + "type": "object", + "description": "Represents a predicate.", + "properties": { + "parameter": { + "type": "array", + "description": "A list of named parameters (key/value), depending on the condition's type. Notes: \n- For binary operators, include parameters named arg0 and arg1 for specifying the left and right operands, respectively. \n- At this time, the left operand (arg0) must be a reference to a variable. \n- For case-insensitive Regex matching, include a boolean parameter named ignore_case that is set to true. If not specified or set to any other value, the matching will be case sensitive. \n- To negate an operator, include a boolean parameter named negate boolean parameter that is set to true.", + "items": { + "$ref": "Parameter" + }, + "annotations": { + "required": [ + "tagmanager.accounts.containers.triggers.create", + "tagmanager.accounts.containers.triggers.update" + ] + } + }, + "type": { + "type": "string", + "description": "The type of operator for this condition.", + "enum": [ + "contains", + "cssSelector", + "endsWith", + "equals", + "greater", + "greaterOrEquals", + "less", + "lessOrEquals", + "matchRegex", + "startsWith", + "urlMatches" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "annotations": { + "required": [ + "tagmanager.accounts.containers.triggers.create", + "tagmanager.accounts.containers.triggers.update" + ] + } + } + } + }, + "Container": { + "id": "Container", + "type": "object", + "description": "Represents a Google Tag Manager Container.", + "properties": { + "accountId": { + "type": "string", + "description": "GTM Account ID." + }, + "containerId": { + "type": "string", + "description": "The Container ID uniquely identifies the GTM Container." + }, + "domainName": { + "type": "array", + "description": "Optional list of domain names associated with the Container.", + "items": { + "type": "string" + } + }, + "enabledBuiltInVariable": { + "type": "array", + "description": "List of enabled built-in variables. Valid values include: pageUrl, pageHostname, pagePath, referrer, event, clickElement, clickClasses, clickId, clickTarget, clickUrl, clickText, formElement, formClasses, formId, formTarget, formUrl, formText, errorMessage, errorUrl, errorLine, newHistoryFragment, oldHistoryFragment, newHistoryState, oldHistoryState, historySource, containerVersion, debugMode, randomNumber, containerId.", + "items": { + "type": "string", + "enum": [ + "advertiserId", + "advertisingTrackingEnabled", + "appId", + "appName", + "appVersionCode", + "appVersionName", + "clickClasses", + "clickElement", + "clickId", + "clickTarget", + "clickText", + "clickUrl", + "containerId", + "containerVersion", + "debugMode", + "deviceName", + "errorLine", + "errorMessage", + "errorUrl", + "event", + "formClasses", + "formElement", + "formId", + "formTarget", + "formText", + "formUrl", + "historySource", + "htmlId", + "language", + "newHistoryFragment", + "newHistoryState", + "oldHistoryFragment", + "oldHistoryState", + "osVersion", + "pageHostname", + "pagePath", + "pageUrl", + "platform", + "randomNumber", + "referrer", + "resolution", + "sdkVersion" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "fingerprint": { + "type": "string", + "description": "The fingerprint of the GTM Container as computed at storage time. This value is recomputed whenever the account is modified." + }, + "name": { + "type": "string", + "description": "Container display name.", + "annotations": { + "required": [ + "tagmanager.accounts.containers.create" + ] + } + }, + "notes": { + "type": "string", + "description": "Container Notes." + }, + "publicId": { + "type": "string", + "description": "Container Public ID." + }, + "timeZoneCountryId": { + "type": "string", + "description": "Container Country ID.", + "annotations": { + "required": [ + "tagmanager.accounts.containers.create" + ] + } + }, + "timeZoneId": { + "type": "string", + "description": "Container Time Zone ID.", + "annotations": { + "required": [ + "tagmanager.accounts.containers.create" + ] + } + }, + "usageContext": { + "type": "array", + "description": "List of Usage Contexts for the Container. Valid values include: web, android, ios.", + "items": { + "type": "string", + "enum": [ + "android", + "androidSdk5", + "ios", + "iosSdk5", + "web" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "annotations": { + "required": [ + "tagmanager.accounts.containers.create" + ] + } + } + } + }, + "ContainerAccess": { + "id": "ContainerAccess", + "type": "object", + "description": "Defines the Google Tag Manager Container access permissions.", + "properties": { + "containerId": { + "type": "string", + "description": "GTM Container ID." + }, + "permission": { + "type": "array", + "description": "List of Container permissions. Valid container permissions are: read, edit, delete, publish.", + "items": { + "type": "string", + "enum": [ + "delete", + "edit", + "manage", + "publish", + "read" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + } + } + } + }, + "ContainerVersion": { + "id": "ContainerVersion", + "type": "object", + "description": "Represents a Google Tag Manager Container Version.", + "properties": { + "accountId": { + "type": "string", + "description": "GTM Account ID." + }, + "container": { + "$ref": "Container", + "description": "The container that this version was taken from." + }, + "containerId": { + "type": "string", + "description": "GTM Container ID." + }, + "containerVersionId": { + "type": "string", + "description": "The Container Version ID uniquely identifies the GTM Container Version." + }, + "deleted": { + "type": "boolean", + "description": "A value of true indicates this container version has been deleted." + }, + "fingerprint": { + "type": "string", + "description": "The fingerprint of the GTM Container Version as computed at storage time. This value is recomputed whenever the container version is modified." + }, + "folder": { + "type": "array", + "description": "The folders in the container that this version was taken from.", + "items": { + "$ref": "Folder" + } + }, + "macro": { + "type": "array", + "description": "The macros in the container that this version was taken from.", + "items": { + "$ref": "Macro" + } + }, + "name": { + "type": "string", + "description": "Container version display name." + }, + "notes": { + "type": "string", + "description": "User notes on how to apply this container version in the container." + }, + "rule": { + "type": "array", + "description": "The rules in the container that this version was taken from.", + "items": { + "$ref": "Rule" + } + }, + "tag": { + "type": "array", + "description": "The tags in the container that this version was taken from.", + "items": { + "$ref": "Tag" + } + }, + "trigger": { + "type": "array", + "description": "The triggers in the container that this version was taken from.", + "items": { + "$ref": "Trigger" + } + }, + "variable": { + "type": "array", + "description": "The variables in the container that this version was taken from.", + "items": { + "$ref": "Variable" + } + } + } + }, + "ContainerVersionHeader": { + "id": "ContainerVersionHeader", + "type": "object", + "description": "Represents a Google Tag Manager Container Version Header.", + "properties": { + "accountId": { + "type": "string", + "description": "GTM Account ID." + }, + "containerId": { + "type": "string", + "description": "GTM Container ID." + }, + "containerVersionId": { + "type": "string", + "description": "The Container Version ID uniquely identifies the GTM Container Version." + }, + "deleted": { + "type": "boolean", + "description": "A value of true indicates this container version has been deleted." + }, + "name": { + "type": "string", + "description": "Container version display name." + }, + "numMacros": { + "type": "string", + "description": "Number of macros in the container version." + }, + "numRules": { + "type": "string", + "description": "Number of rules in the container version." + }, + "numTags": { + "type": "string", + "description": "Number of tags in the container version." + }, + "numTriggers": { + "type": "string", + "description": "Number of triggers in the container version." + }, + "numVariables": { + "type": "string", + "description": "Number of variables in the container version." + } + } + }, + "CreateContainerVersionRequestVersionOptions": { + "id": "CreateContainerVersionRequestVersionOptions", + "type": "object", + "description": "Options for new container versions.", + "properties": { + "name": { + "type": "string", + "description": "The name of the container version to be created." + }, + "notes": { + "type": "string", + "description": "The notes of the container version to be created." + }, + "quickPreview": { + "type": "boolean", + "description": "The creation of this version may be for quick preview and shouldn't be saved." + } + } + }, + "CreateContainerVersionResponse": { + "id": "CreateContainerVersionResponse", + "type": "object", + "description": "Create container versions response.", + "properties": { + "compilerError": { + "type": "boolean", + "description": "Compiler errors or not." + }, + "containerVersion": { + "$ref": "ContainerVersion", + "description": "The container version created." + } + } + }, + "Folder": { + "id": "Folder", + "type": "object", + "description": "Represents a Google Tag Manager Folder.", + "properties": { + "accountId": { + "type": "string", + "description": "GTM Account ID." + }, + "containerId": { + "type": "string", + "description": "GTM Container ID." + }, + "fingerprint": { + "type": "string", + "description": "The fingerprint of the GTM Folder as computed at storage time. This value is recomputed whenever the folder is modified." + }, + "folderId": { + "type": "string", + "description": "The Folder ID uniquely identifies the GTM Folder." + }, + "name": { + "type": "string", + "description": "Folder display name.", + "annotations": { + "required": [ + "tagmanager.accounts.containers.folders.create" + ] + } + } + } + }, + "FolderEntities": { + "id": "FolderEntities", + "type": "object", + "description": "Represents a Google Tag Manager Folder's contents.", + "properties": { + "tag": { + "type": "array", + "description": "The list of tags inside the folder.", + "items": { + "$ref": "Tag" + } + }, + "trigger": { + "type": "array", + "description": "The list of triggers inside the folder.", + "items": { + "$ref": "Trigger" + } + }, + "variable": { + "type": "array", + "description": "The list of variables inside the folder.", + "items": { + "$ref": "Variable" + } + } + } + }, + "ListAccountUsersResponse": { + "id": "ListAccountUsersResponse", + "type": "object", + "description": "List AccountUsers Response.", + "properties": { + "userAccess": { + "type": "array", + "description": "All GTM AccountUsers of a GTM Account.", + "items": { + "$ref": "UserAccess" + } + } + } + }, + "ListAccountsResponse": { + "id": "ListAccountsResponse", + "type": "object", + "description": "List Accounts Response.", + "properties": { + "accounts": { + "type": "array", + "description": "List of GTM Accounts that a user has access to.", + "items": { + "$ref": "Account" + } + } + } + }, + "ListContainerVersionsResponse": { + "id": "ListContainerVersionsResponse", + "type": "object", + "description": "List container versions response.", + "properties": { + "containerVersion": { + "type": "array", + "description": "All versions of a GTM Container.", + "items": { + "$ref": "ContainerVersion" + } + }, + "containerVersionHeader": { + "type": "array", + "description": "All container version headers of a GTM Container.", + "items": { + "$ref": "ContainerVersionHeader" + } + } + } + }, + "ListContainersResponse": { + "id": "ListContainersResponse", + "type": "object", + "description": "List Containers Response.", + "properties": { + "containers": { + "type": "array", + "description": "All Containers of a GTM Account.", + "items": { + "$ref": "Container" + } + } + } + }, + "ListFoldersResponse": { + "id": "ListFoldersResponse", + "type": "object", + "description": "List Folders Response.", + "properties": { + "folders": { + "type": "array", + "description": "All GTM Folders of a GTM Container.", + "items": { + "$ref": "Folder" + } + } + } + }, + "ListTagsResponse": { + "id": "ListTagsResponse", + "type": "object", + "description": "List Tags Response.", + "properties": { + "tags": { + "type": "array", + "description": "All GTM Tags of a GTM Container.", + "items": { + "$ref": "Tag" + } + } + } + }, + "ListTriggersResponse": { + "id": "ListTriggersResponse", + "type": "object", + "description": "List triggers response.", + "properties": { + "triggers": { + "type": "array", + "description": "All GTM Triggers of a GTM Container.", + "items": { + "$ref": "Trigger" + } + } + } + }, + "ListVariablesResponse": { + "id": "ListVariablesResponse", + "type": "object", + "description": "List Variables Response.", + "properties": { + "variables": { + "type": "array", + "description": "All GTM Variables of a GTM Container.", + "items": { + "$ref": "Variable" + } + } + } + }, + "Macro": { + "id": "Macro", + "type": "object", + "description": "Represents a Google Tag Manager Macro.", + "properties": { + "accountId": { + "type": "string", + "description": "GTM Account ID." + }, + "containerId": { + "type": "string", + "description": "GTM Container ID." + }, + "disablingRuleId": { + "type": "array", + "description": "For mobile containers only: A list of rule IDs for disabling conditional macros; the macro is enabled if one of the enabling rules is true while all the disabling rules are false. Treated as an unordered set.", + "items": { + "type": "string" + } + }, + "enablingRuleId": { + "type": "array", + "description": "For mobile containers only: A list of rule IDs for enabling conditional macros; the macro is enabled if one of the enabling rules is true while all the disabling rules are false. Treated as an unordered set.", + "items": { + "type": "string" + } + }, + "fingerprint": { + "type": "string", + "description": "The fingerprint of the GTM Macro as computed at storage time. This value is recomputed whenever the macro is modified." + }, + "macroId": { + "type": "string", + "description": "The Macro ID uniquely identifies the GTM Macro." + }, + "name": { + "type": "string", + "description": "Macro display name." + }, + "notes": { + "type": "string", + "description": "User notes on how to apply this macro in the container." + }, + "parameter": { + "type": "array", + "description": "The macro's parameters.", + "items": { + "$ref": "Parameter" + } + }, + "parentFolderId": { + "type": "string", + "description": "Parent folder id." + }, + "scheduleEndMs": { + "type": "string", + "description": "The end timestamp in milliseconds to schedule a macro.", + "format": "int64" + }, + "scheduleStartMs": { + "type": "string", + "description": "The start timestamp in milliseconds to schedule a macro.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "GTM Macro Type." + } + } + }, + "Parameter": { + "id": "Parameter", + "type": "object", + "description": "Represents a Google Tag Manager Parameter.", + "properties": { + "key": { + "type": "string", + "description": "The named key that uniquely identifies a parameter. Required for top-level parameters, as well as map values. Ignored for list values." + }, + "list": { + "type": "array", + "description": "This list parameter's parameters (keys will be ignored).", + "items": { + "$ref": "Parameter" + } + }, + "map": { + "type": "array", + "description": "This map parameter's parameters (must have keys; keys must be unique).", + "items": { + "$ref": "Parameter" + } + }, + "type": { + "type": "string", + "description": "The parameter type. Valid values are: \n- boolean: The value represents a boolean, represented as 'true' or 'false' \n- integer: The value represents a 64-bit signed integer value, in base 10 \n- list: A list of parameters should be specified \n- map: A map of parameters should be specified \n- template: The value represents any text; this can include variable references (even variable references that might return non-string types)", + "enum": [ + "boolean", + "integer", + "list", + "map", + "template" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ], + "annotations": { + "required": [ + "tagmanager.accounts.containers.tags.create", + "tagmanager.accounts.containers.tags.update", + "tagmanager.accounts.containers.triggers.create", + "tagmanager.accounts.containers.triggers.update", + "tagmanager.accounts.containers.variables.create", + "tagmanager.accounts.containers.variables.update" + ] + } + }, + "value": { + "type": "string", + "description": "A parameter's value (may contain variable references such as \"{{myVariable}}\") as appropriate to the specified type." + } + } + }, + "PublishContainerVersionResponse": { + "id": "PublishContainerVersionResponse", + "type": "object", + "description": "Publish container version response.", + "properties": { + "compilerError": { + "type": "boolean", + "description": "Compiler errors or not." + }, + "containerVersion": { + "$ref": "ContainerVersion", + "description": "The container version created." + } + } + }, + "Rule": { + "id": "Rule", + "type": "object", + "description": "Represents a Google Tag Manager Rule.", + "properties": { + "accountId": { + "type": "string", + "description": "GTM Account ID." + }, + "condition": { + "type": "array", + "description": "The list of conditions that make up this rule (implicit AND between them).", + "items": { + "$ref": "Condition" + } + }, + "containerId": { + "type": "string", + "description": "GTM Container ID." + }, + "fingerprint": { + "type": "string", + "description": "The fingerprint of the GTM Rule as computed at storage time. This value is recomputed whenever the rule is modified." + }, + "name": { + "type": "string", + "description": "Rule display name." + }, + "notes": { + "type": "string", + "description": "User notes on how to apply this rule in the container." + }, + "ruleId": { + "type": "string", + "description": "The Rule ID uniquely identifies the GTM Rule." + } + } + }, + "SetupTag": { + "id": "SetupTag", + "type": "object", + "properties": { + "stopOnSetupFailure": { + "type": "boolean", + "description": "If true, fire the main tag if and only if the setup tag fires successfully. If false, fire the main tag regardless of setup tag firing status." + }, + "tagName": { + "type": "string", + "description": "The name of the setup tag." + } + } + }, + "Tag": { + "id": "Tag", + "type": "object", + "description": "Represents a Google Tag Manager Tag.", + "properties": { + "accountId": { + "type": "string", + "description": "GTM Account ID." + }, + "blockingRuleId": { + "type": "array", + "description": "Blocking rule IDs. If any of the listed rules evaluate to true, the tag will not fire.", + "items": { + "type": "string" + } + }, + "blockingTriggerId": { + "type": "array", + "description": "Blocking trigger IDs. If any of the listed triggers evaluate to true, the tag will not fire.", + "items": { + "type": "string" + } + }, + "containerId": { + "type": "string", + "description": "GTM Container ID." + }, + "fingerprint": { + "type": "string", + "description": "The fingerprint of the GTM Tag as computed at storage time. This value is recomputed whenever the tag is modified." + }, + "firingRuleId": { + "type": "array", + "description": "Firing rule IDs. A tag will fire when any of the listed rules are true and all of its blockingRuleIds (if any specified) are false.", + "items": { + "type": "string" + } + }, + "firingTriggerId": { + "type": "array", + "description": "Firing trigger IDs. A tag will fire when any of the listed triggers are true and all of its blockingTriggerIds (if any specified) are false.", + "items": { + "type": "string" + } + }, + "liveOnly": { + "type": "boolean", + "description": "If set to true, this tag will only fire in the live environment (e.g. not in preview or debug mode)." + }, + "name": { + "type": "string", + "description": "Tag display name.", + "annotations": { + "required": [ + "tagmanager.accounts.containers.tags.create" + ] + } + }, + "notes": { + "type": "string", + "description": "User notes on how to apply this tag in the container." + }, + "parameter": { + "type": "array", + "description": "The tag's parameters.", + "items": { + "$ref": "Parameter" + } + }, + "parentFolderId": { + "type": "string", + "description": "Parent folder id." + }, + "priority": { + "$ref": "Parameter", + "description": "User defined numeric priority of the tag. Tags are fired asynchronously in order of priority. Tags with higher numeric value fire first. A tag's priority can be a positive or negative value. The default value is 0." + }, + "scheduleEndMs": { + "type": "string", + "description": "The end timestamp in milliseconds to schedule a tag.", + "format": "int64" + }, + "scheduleStartMs": { + "type": "string", + "description": "The start timestamp in milliseconds to schedule a tag.", + "format": "int64" + }, + "setupTag": { + "type": "array", + "description": "The list of setup tags. Currently we only allow one.", + "items": { + "$ref": "SetupTag" + } + }, + "tagFiringOption": { + "type": "string", + "description": "Option to fire this tag.", + "enum": [ + "oncePerEvent", + "oncePerLoad", + "unlimited" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "tagId": { + "type": "string", + "description": "The Tag ID uniquely identifies the GTM Tag." + }, + "teardownTag": { + "type": "array", + "description": "The list of teardown tags. Currently we only allow one.", + "items": { + "$ref": "TeardownTag" + } + }, + "type": { + "type": "string", + "description": "GTM Tag Type.", + "annotations": { + "required": [ + "tagmanager.accounts.containers.tags.create" + ] + } + } + } + }, + "TeardownTag": { + "id": "TeardownTag", + "type": "object", + "properties": { + "stopTeardownOnFailure": { + "type": "boolean", + "description": "If true, fire the teardown tag if and only if the main tag fires successfully. If false, fire the teardown tag regardless of main tag firing status." + }, + "tagName": { + "type": "string", + "description": "The name of the teardown tag." + } + } + }, + "Trigger": { + "id": "Trigger", + "type": "object", + "description": "Represents a Google Tag Manager Trigger", + "properties": { + "accountId": { + "type": "string", + "description": "GTM Account ID." + }, + "autoEventFilter": { + "type": "array", + "description": "Used in the case of auto event tracking.", + "items": { + "$ref": "Condition" + } + }, + "checkValidation": { + "$ref": "Parameter", + "description": "Whether or not we should only fire tags if the form submit or link click event is not cancelled by some other event handler (e.g. because of validation). Only valid for Form Submission and Link Click triggers." + }, + "containerId": { + "type": "string", + "description": "GTM Container ID." + }, + "customEventFilter": { + "type": "array", + "description": "Used in the case of custom event, which is fired iff all Conditions are true.", + "items": { + "$ref": "Condition" + } + }, + "enableAllVideos": { + "$ref": "Parameter", + "description": "Reloads the videos in the page that don't already have the YT API enabled. If false, only capture events from videos that already have the API enabled. Only valid for YouTube triggers." + }, + "eventName": { + "$ref": "Parameter", + "description": "Name of the GTM event that is fired. Only valid for Timer triggers." + }, + "filter": { + "type": "array", + "description": "The trigger will only fire iff all Conditions are true.", + "items": { + "$ref": "Condition" + } + }, + "fingerprint": { + "type": "string", + "description": "The fingerprint of the GTM Trigger as computed at storage time. This value is recomputed whenever the trigger is modified." + }, + "interval": { + "$ref": "Parameter", + "description": "Time between triggering recurring Timer Events (in milliseconds). Only valid for Timer triggers." + }, + "limit": { + "$ref": "Parameter", + "description": "Limit of the number of GTM events this Timer Trigger will fire. If no limit is set, we will continue to fire GTM events until the user leaves the page. Only valid for Timer triggers." + }, + "name": { + "type": "string", + "description": "Trigger display name.", + "annotations": { + "required": [ + "tagmanager.accounts.containers.triggers.create" + ] + } + }, + "parentFolderId": { + "type": "string", + "description": "Parent folder id." + }, + "triggerId": { + "type": "string", + "description": "The Trigger ID uniquely identifies the GTM Trigger." + }, + "type": { + "type": "string", + "description": "Defines the data layer event that causes this trigger.", + "enum": [ + "ajaxSubmission", + "always", + "click", + "customEvent", + "domReady", + "formSubmission", + "historyChange", + "jsError", + "linkClick", + "pageview", + "timer", + "windowLoaded", + "youTube" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "annotations": { + "required": [ + "tagmanager.accounts.containers.triggers.create" + ] + } + }, + "uniqueTriggerId": { + "$ref": "Parameter", + "description": "Globally unique id of the trigger that auto-generates this (a Form Submit, Link Click or Timer listener) if any. Used to make incompatible auto-events work together with trigger filtering based on trigger ids. This value is populated during output generation since the tags implied by triggers don't exist until then. Only valid for Form Submit, Link Click and Timer triggers." + }, + "videoPercentageList": { + "$ref": "Parameter", + "description": "List of integer percentage values. The trigger will fire as each percentage is reached in any instrumented videos. Only valid for YouTube triggers." + }, + "waitForTags": { + "$ref": "Parameter", + "description": "Whether or not we should delay the form submissions or link opening until all of the tags have fired (by preventing the default action and later simulating the default action). Only valid for Form Submission and Link Click triggers." + }, + "waitForTagsTimeout": { + "$ref": "Parameter", + "description": "How long to wait (in milliseconds) for tags to fire when 'waits_for_tags' above evaluates to true. Only valid for Form Submission and Link Click triggers." + } + } + }, + "UserAccess": { + "id": "UserAccess", + "type": "object", + "description": "Represents a user's permissions to an account and its container.", + "properties": { + "accountAccess": { + "$ref": "AccountAccess", + "description": "GTM Account access permissions.", + "annotations": { + "required": [ + "tagmanager.accounts.permissions.create" + ] + } + }, + "accountId": { + "type": "string", + "description": "GTM Account ID." + }, + "containerAccess": { + "type": "array", + "description": "GTM Container access permissions.", + "items": { + "$ref": "ContainerAccess" + } + }, + "emailAddress": { + "type": "string", + "description": "User's email address.", + "annotations": { + "required": [ + "tagmanager.accounts.permissions.create" + ] + } + }, + "permissionId": { + "type": "string", + "description": "Account Permission ID." + } + } + }, + "Variable": { + "id": "Variable", + "type": "object", + "description": "Represents a Google Tag Manager Variable.", + "properties": { + "accountId": { + "type": "string", + "description": "GTM Account ID." + }, + "containerId": { + "type": "string", + "description": "GTM Container ID." + }, + "disablingTriggerId": { + "type": "array", + "description": "For mobile containers only: A list of trigger IDs for disabling conditional variables; the variable is enabled if one of the enabling trigger is true while all the disabling trigger are false. Treated as an unordered set.", + "items": { + "type": "string" + } + }, + "enablingTriggerId": { + "type": "array", + "description": "For mobile containers only: A list of trigger IDs for enabling conditional variables; the variable is enabled if one of the enabling triggers is true while all the disabling triggers are false. Treated as an unordered set.", + "items": { + "type": "string" + } + }, + "fingerprint": { + "type": "string", + "description": "The fingerprint of the GTM Variable as computed at storage time. This value is recomputed whenever the variable is modified." + }, + "name": { + "type": "string", + "description": "Variable display name.", + "annotations": { + "required": [ + "tagmanager.accounts.containers.variables.create" + ] + } + }, + "notes": { + "type": "string", + "description": "User notes on how to apply this variable in the container." + }, + "parameter": { + "type": "array", + "description": "The variable's parameters.", + "items": { + "$ref": "Parameter" + } + }, + "parentFolderId": { + "type": "string", + "description": "Parent folder id." + }, + "scheduleEndMs": { + "type": "string", + "description": "The end timestamp in milliseconds to schedule a variable.", + "format": "int64" + }, + "scheduleStartMs": { + "type": "string", + "description": "The start timestamp in milliseconds to schedule a variable.", + "format": "int64" + }, + "type": { + "type": "string", + "description": "GTM Variable Type.", + "annotations": { + "required": [ + "tagmanager.accounts.containers.variables.create", + "tagmanager.accounts.containers.variables.update" + ] + } + }, + "variableId": { + "type": "string", + "description": "The Variable ID uniquely identifies the GTM Variable." + } + } + } + }, + "resources": { + "accounts": { + "methods": { + "get": { + "id": "tagmanager.accounts.get", + "path": "accounts/{accountId}", + "httpMethod": "GET", + "description": "Gets a GTM Account.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.manage.accounts", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "list": { + "id": "tagmanager.accounts.list", + "path": "accounts", + "httpMethod": "GET", + "description": "Lists all GTM Accounts that a user has access to.", + "response": { + "$ref": "ListAccountsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.manage.accounts", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "update": { + "id": "tagmanager.accounts.update", + "path": "accounts/{accountId}", + "httpMethod": "PUT", + "description": "Updates a GTM Account.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "fingerprint": { + "type": "string", + "description": "When provided, this fingerprint must match the fingerprint of the account in storage.", + "location": "query" + } + }, + "parameterOrder": [ + "accountId" + ], + "request": { + "$ref": "Account" + }, + "response": { + "$ref": "Account" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.manage.accounts" + ] + } + }, + "resources": { + "containers": { + "methods": { + "create": { + "id": "tagmanager.accounts.containers.create", + "path": "accounts/{accountId}/containers", + "httpMethod": "POST", + "description": "Creates a Container.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId" + ], + "request": { + "$ref": "Container" + }, + "response": { + "$ref": "Container" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "delete": { + "id": "tagmanager.accounts.containers.delete", + "path": "accounts/{accountId}/containers/{containerId}", + "httpMethod": "DELETE", + "description": "Deletes a Container.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId" + ], + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.delete.containers" + ] + }, + "get": { + "id": "tagmanager.accounts.containers.get", + "path": "accounts/{accountId}/containers/{containerId}", + "httpMethod": "GET", + "description": "Gets a Container.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId" + ], + "response": { + "$ref": "Container" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "list": { + "id": "tagmanager.accounts.containers.list", + "path": "accounts/{accountId}/containers", + "httpMethod": "GET", + "description": "Lists all Containers that belongs to a GTM Account.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "ListContainersResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "update": { + "id": "tagmanager.accounts.containers.update", + "path": "accounts/{accountId}/containers/{containerId}", + "httpMethod": "PUT", + "description": "Updates a Container.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + }, + "fingerprint": { + "type": "string", + "description": "When provided, this fingerprint must match the fingerprint of the container in storage.", + "location": "query" + } + }, + "parameterOrder": [ + "accountId", + "containerId" + ], + "request": { + "$ref": "Container" + }, + "response": { + "$ref": "Container" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + } + }, + "resources": { + "folders": { + "methods": { + "create": { + "id": "tagmanager.accounts.containers.folders.create", + "path": "accounts/{accountId}/containers/{containerId}/folders", + "httpMethod": "POST", + "description": "Creates a GTM Folder.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId" + ], + "request": { + "$ref": "Folder" + }, + "response": { + "$ref": "Folder" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "delete": { + "id": "tagmanager.accounts.containers.folders.delete", + "path": "accounts/{accountId}/containers/{containerId}/folders/{folderId}", + "httpMethod": "DELETE", + "description": "Deletes a GTM Folder.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + }, + "folderId": { + "type": "string", + "description": "The GTM Folder ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId", + "folderId" + ], + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "get": { + "id": "tagmanager.accounts.containers.folders.get", + "path": "accounts/{accountId}/containers/{containerId}/folders/{folderId}", + "httpMethod": "GET", + "description": "Gets a GTM Folder.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + }, + "folderId": { + "type": "string", + "description": "The GTM Folder ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId", + "folderId" + ], + "response": { + "$ref": "Folder" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "list": { + "id": "tagmanager.accounts.containers.folders.list", + "path": "accounts/{accountId}/containers/{containerId}/folders", + "httpMethod": "GET", + "description": "Lists all GTM Folders of a Container.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId" + ], + "response": { + "$ref": "ListFoldersResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "update": { + "id": "tagmanager.accounts.containers.folders.update", + "path": "accounts/{accountId}/containers/{containerId}/folders/{folderId}", + "httpMethod": "PUT", + "description": "Updates a GTM Folder.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + }, + "fingerprint": { + "type": "string", + "description": "When provided, this fingerprint must match the fingerprint of the folder in storage.", + "location": "query" + }, + "folderId": { + "type": "string", + "description": "The GTM Folder ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId", + "folderId" + ], + "request": { + "$ref": "Folder" + }, + "response": { + "$ref": "Folder" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + } + }, + "resources": { + "entities": { + "methods": { + "list": { + "id": "tagmanager.accounts.containers.folders.entities.list", + "path": "accounts/{accountId}/containers/{containerId}/folders/{folderId}/entities", + "httpMethod": "GET", + "description": "List all entities in a GTM Folder.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + }, + "folderId": { + "type": "string", + "description": "The GTM Folder ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId", + "folderId" + ], + "response": { + "$ref": "FolderEntities" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + } + } + } + } + }, + "move_folders": { + "methods": { + "update": { + "id": "tagmanager.accounts.containers.move_folders.update", + "path": "accounts/{accountId}/containers/{containerId}/move_folders/{folderId}", + "httpMethod": "PUT", + "description": "Moves entities to a GTM Folder.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + }, + "folderId": { + "type": "string", + "description": "The GTM Folder ID.", + "required": true, + "location": "path" + }, + "tagId": { + "type": "string", + "description": "The tags to be moved to the folder.", + "repeated": true, + "location": "query" + }, + "triggerId": { + "type": "string", + "description": "The triggers to be moved to the folder.", + "repeated": true, + "location": "query" + }, + "variableId": { + "type": "string", + "description": "The variables to be moved to the folder.", + "repeated": true, + "location": "query" + } + }, + "parameterOrder": [ + "accountId", + "containerId", + "folderId" + ] + } + } + }, + "tags": { + "methods": { + "create": { + "id": "tagmanager.accounts.containers.tags.create", + "path": "accounts/{accountId}/containers/{containerId}/tags", + "httpMethod": "POST", + "description": "Creates a GTM Tag.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId" + ], + "request": { + "$ref": "Tag" + }, + "response": { + "$ref": "Tag" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "delete": { + "id": "tagmanager.accounts.containers.tags.delete", + "path": "accounts/{accountId}/containers/{containerId}/tags/{tagId}", + "httpMethod": "DELETE", + "description": "Deletes a GTM Tag.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + }, + "tagId": { + "type": "string", + "description": "The GTM Tag ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId", + "tagId" + ], + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "get": { + "id": "tagmanager.accounts.containers.tags.get", + "path": "accounts/{accountId}/containers/{containerId}/tags/{tagId}", + "httpMethod": "GET", + "description": "Gets a GTM Tag.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + }, + "tagId": { + "type": "string", + "description": "The GTM Tag ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId", + "tagId" + ], + "response": { + "$ref": "Tag" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "list": { + "id": "tagmanager.accounts.containers.tags.list", + "path": "accounts/{accountId}/containers/{containerId}/tags", + "httpMethod": "GET", + "description": "Lists all GTM Tags of a Container.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId" + ], + "response": { + "$ref": "ListTagsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "update": { + "id": "tagmanager.accounts.containers.tags.update", + "path": "accounts/{accountId}/containers/{containerId}/tags/{tagId}", + "httpMethod": "PUT", + "description": "Updates a GTM Tag.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + }, + "fingerprint": { + "type": "string", + "description": "When provided, this fingerprint must match the fingerprint of the tag in storage.", + "location": "query" + }, + "tagId": { + "type": "string", + "description": "The GTM Tag ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId", + "tagId" + ], + "request": { + "$ref": "Tag" + }, + "response": { + "$ref": "Tag" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + } + } + }, + "triggers": { + "methods": { + "create": { + "id": "tagmanager.accounts.containers.triggers.create", + "path": "accounts/{accountId}/containers/{containerId}/triggers", + "httpMethod": "POST", + "description": "Creates a GTM Trigger.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId" + ], + "request": { + "$ref": "Trigger" + }, + "response": { + "$ref": "Trigger" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "delete": { + "id": "tagmanager.accounts.containers.triggers.delete", + "path": "accounts/{accountId}/containers/{containerId}/triggers/{triggerId}", + "httpMethod": "DELETE", + "description": "Deletes a GTM Trigger.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + }, + "triggerId": { + "type": "string", + "description": "The GTM Trigger ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId", + "triggerId" + ], + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "get": { + "id": "tagmanager.accounts.containers.triggers.get", + "path": "accounts/{accountId}/containers/{containerId}/triggers/{triggerId}", + "httpMethod": "GET", + "description": "Gets a GTM Trigger.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + }, + "triggerId": { + "type": "string", + "description": "The GTM Trigger ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId", + "triggerId" + ], + "response": { + "$ref": "Trigger" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "list": { + "id": "tagmanager.accounts.containers.triggers.list", + "path": "accounts/{accountId}/containers/{containerId}/triggers", + "httpMethod": "GET", + "description": "Lists all GTM Triggers of a Container.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId" + ], + "response": { + "$ref": "ListTriggersResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "update": { + "id": "tagmanager.accounts.containers.triggers.update", + "path": "accounts/{accountId}/containers/{containerId}/triggers/{triggerId}", + "httpMethod": "PUT", + "description": "Updates a GTM Trigger.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + }, + "fingerprint": { + "type": "string", + "description": "When provided, this fingerprint must match the fingerprint of the trigger in storage.", + "location": "query" + }, + "triggerId": { + "type": "string", + "description": "The GTM Trigger ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId", + "triggerId" + ], + "request": { + "$ref": "Trigger" + }, + "response": { + "$ref": "Trigger" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + } + } + }, + "variables": { + "methods": { + "create": { + "id": "tagmanager.accounts.containers.variables.create", + "path": "accounts/{accountId}/containers/{containerId}/variables", + "httpMethod": "POST", + "description": "Creates a GTM Variable.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId" + ], + "request": { + "$ref": "Variable" + }, + "response": { + "$ref": "Variable" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "delete": { + "id": "tagmanager.accounts.containers.variables.delete", + "path": "accounts/{accountId}/containers/{containerId}/variables/{variableId}", + "httpMethod": "DELETE", + "description": "Deletes a GTM Variable.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + }, + "variableId": { + "type": "string", + "description": "The GTM Variable ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId", + "variableId" + ], + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "get": { + "id": "tagmanager.accounts.containers.variables.get", + "path": "accounts/{accountId}/containers/{containerId}/variables/{variableId}", + "httpMethod": "GET", + "description": "Gets a GTM Variable.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + }, + "variableId": { + "type": "string", + "description": "The GTM Variable ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId", + "variableId" + ], + "response": { + "$ref": "Variable" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "list": { + "id": "tagmanager.accounts.containers.variables.list", + "path": "accounts/{accountId}/containers/{containerId}/variables", + "httpMethod": "GET", + "description": "Lists all GTM Variables of a Container.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId" + ], + "response": { + "$ref": "ListVariablesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "update": { + "id": "tagmanager.accounts.containers.variables.update", + "path": "accounts/{accountId}/containers/{containerId}/variables/{variableId}", + "httpMethod": "PUT", + "description": "Updates a GTM Variable.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + }, + "fingerprint": { + "type": "string", + "description": "When provided, this fingerprint must match the fingerprint of the variable in storage.", + "location": "query" + }, + "variableId": { + "type": "string", + "description": "The GTM Variable ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId", + "variableId" + ], + "request": { + "$ref": "Variable" + }, + "response": { + "$ref": "Variable" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + } + } + }, + "versions": { + "methods": { + "create": { + "id": "tagmanager.accounts.containers.versions.create", + "path": "accounts/{accountId}/containers/{containerId}/versions", + "httpMethod": "POST", + "description": "Creates a Container Version.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId" + ], + "request": { + "$ref": "CreateContainerVersionRequestVersionOptions" + }, + "response": { + "$ref": "CreateContainerVersionResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containerversions" + ] + }, + "delete": { + "id": "tagmanager.accounts.containers.versions.delete", + "path": "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}", + "httpMethod": "DELETE", + "description": "Deletes a Container Version.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + }, + "containerVersionId": { + "type": "string", + "description": "The GTM Container Version ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId", + "containerVersionId" + ], + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containerversions" + ] + }, + "get": { + "id": "tagmanager.accounts.containers.versions.get", + "path": "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}", + "httpMethod": "GET", + "description": "Gets a Container Version.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + }, + "containerVersionId": { + "type": "string", + "description": "The GTM Container Version ID. Specify published to retrieve the currently published version.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId", + "containerVersionId" + ], + "response": { + "$ref": "ContainerVersion" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.edit.containerversions", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "list": { + "id": "tagmanager.accounts.containers.versions.list", + "path": "accounts/{accountId}/containers/{containerId}/versions", + "httpMethod": "GET", + "description": "Lists all Container Versions of a GTM Container.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + }, + "headers": { + "type": "boolean", + "description": "Retrieve headers only when true.", + "default": "false", + "location": "query" + } + }, + "parameterOrder": [ + "accountId", + "containerId" + ], + "response": { + "$ref": "ListContainerVersionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers", + "https://www.googleapis.com/auth/tagmanager.edit.containerversions", + "https://www.googleapis.com/auth/tagmanager.readonly" + ] + }, + "publish": { + "id": "tagmanager.accounts.containers.versions.publish", + "path": "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/publish", + "httpMethod": "POST", + "description": "Publishes a Container Version.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + }, + "containerVersionId": { + "type": "string", + "description": "The GTM Container Version ID.", + "required": true, + "location": "path" + }, + "fingerprint": { + "type": "string", + "description": "When provided, this fingerprint must match the fingerprint of the container version in storage.", + "location": "query" + } + }, + "parameterOrder": [ + "accountId", + "containerId", + "containerVersionId" + ], + "response": { + "$ref": "PublishContainerVersionResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.publish" + ] + }, + "restore": { + "id": "tagmanager.accounts.containers.versions.restore", + "path": "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/restore", + "httpMethod": "POST", + "description": "Restores a Container Version. This will overwrite the container's current configuration (including its variables, triggers and tags). The operation will not have any effect on the version that is being served (i.e. the published version).", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + }, + "containerVersionId": { + "type": "string", + "description": "The GTM Container Version ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId", + "containerVersionId" + ], + "response": { + "$ref": "ContainerVersion" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containers" + ] + }, + "undelete": { + "id": "tagmanager.accounts.containers.versions.undelete", + "path": "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/undelete", + "httpMethod": "POST", + "description": "Undeletes a Container Version.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + }, + "containerVersionId": { + "type": "string", + "description": "The GTM Container Version ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "containerId", + "containerVersionId" + ], + "response": { + "$ref": "ContainerVersion" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containerversions" + ] + }, + "update": { + "id": "tagmanager.accounts.containers.versions.update", + "path": "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}", + "httpMethod": "PUT", + "description": "Updates a Container Version.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "containerId": { + "type": "string", + "description": "The GTM Container ID.", + "required": true, + "location": "path" + }, + "containerVersionId": { + "type": "string", + "description": "The GTM Container Version ID.", + "required": true, + "location": "path" + }, + "fingerprint": { + "type": "string", + "description": "When provided, this fingerprint must match the fingerprint of the container version in storage.", + "location": "query" + } + }, + "parameterOrder": [ + "accountId", + "containerId", + "containerVersionId" + ], + "request": { + "$ref": "ContainerVersion" + }, + "response": { + "$ref": "ContainerVersion" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.edit.containerversions" + ] + } + } + } + } + }, + "permissions": { + "methods": { + "create": { + "id": "tagmanager.accounts.permissions.create", + "path": "accounts/{accountId}/permissions", + "httpMethod": "POST", + "description": "Creates a user's Account & Container Permissions.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId" + ], + "request": { + "$ref": "UserAccess" + }, + "response": { + "$ref": "UserAccess" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.manage.users" + ] + }, + "delete": { + "id": "tagmanager.accounts.permissions.delete", + "path": "accounts/{accountId}/permissions/{permissionId}", + "httpMethod": "DELETE", + "description": "Removes a user from the account, revoking access to it and all of its containers.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "permissionId": { + "type": "string", + "description": "The GTM User ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "permissionId" + ], + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.manage.users" + ] + }, + "get": { + "id": "tagmanager.accounts.permissions.get", + "path": "accounts/{accountId}/permissions/{permissionId}", + "httpMethod": "GET", + "description": "Gets a user's Account & Container Permissions.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "permissionId": { + "type": "string", + "description": "The GTM User ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "permissionId" + ], + "response": { + "$ref": "UserAccess" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.manage.users" + ] + }, + "list": { + "id": "tagmanager.accounts.permissions.list", + "path": "accounts/{accountId}/permissions", + "httpMethod": "GET", + "description": "List all users that have access to the account along with Account and Container Permissions granted to each of them.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID. @required tagmanager.accounts.permissions.list", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId" + ], + "response": { + "$ref": "ListAccountUsersResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.manage.users" + ] + }, + "update": { + "id": "tagmanager.accounts.permissions.update", + "path": "accounts/{accountId}/permissions/{permissionId}", + "httpMethod": "PUT", + "description": "Updates a user's Account & Container Permissions.", + "parameters": { + "accountId": { + "type": "string", + "description": "The GTM Account ID.", + "required": true, + "location": "path" + }, + "permissionId": { + "type": "string", + "description": "The GTM User ID.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "accountId", + "permissionId" + ], + "request": { + "$ref": "UserAccess" + }, + "response": { + "$ref": "UserAccess" + }, + "scopes": [ + "https://www.googleapis.com/auth/tagmanager.manage.users" + ] + } + } + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/tagmanager/v1/tagmanager-gen.go b/Godeps/_workspace/src/google.golang.org/api/tagmanager/v1/tagmanager-gen.go new file mode 100644 index 000000000..c40ea81d6 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/tagmanager/v1/tagmanager-gen.go @@ -0,0 +1,7246 @@ +// Package tagmanager provides access to the Tag Manager API. +// +// See https://developers.google.com/tag-manager/api/v1/ +// +// Usage example: +// +// import "google.golang.org/api/tagmanager/v1" +// ... +// tagmanagerService, err := tagmanager.New(oauthHttpClient) +package tagmanager // import "google.golang.org/api/tagmanager/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "tagmanager:v1" +const apiName = "tagmanager" +const apiVersion = "v1" +const basePath = "https://www.googleapis.com/tagmanager/v1/" + +// OAuth2 scopes used by this API. +const ( + // Delete your Google Tag Manager containers + TagmanagerDeleteContainersScope = "https://www.googleapis.com/auth/tagmanager.delete.containers" + + // Manage your Google Tag Manager containers + TagmanagerEditContainersScope = "https://www.googleapis.com/auth/tagmanager.edit.containers" + + // Manage your Google Tag Manager container versions + TagmanagerEditContainerversionsScope = "https://www.googleapis.com/auth/tagmanager.edit.containerversions" + + // Manage your Google Tag Manager accounts + TagmanagerManageAccountsScope = "https://www.googleapis.com/auth/tagmanager.manage.accounts" + + // Manage user permissions of your Google Tag Manager data + TagmanagerManageUsersScope = "https://www.googleapis.com/auth/tagmanager.manage.users" + + // Publish your Google Tag Manager containers + TagmanagerPublishScope = "https://www.googleapis.com/auth/tagmanager.publish" + + // View your Google Tag Manager containers + TagmanagerReadonlyScope = "https://www.googleapis.com/auth/tagmanager.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) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Accounts *AccountsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewAccountsService(s *Service) *AccountsService { + rs := &AccountsService{s: s} + rs.Containers = NewAccountsContainersService(s) + rs.Permissions = NewAccountsPermissionsService(s) + return rs +} + +type AccountsService struct { + s *Service + + Containers *AccountsContainersService + + Permissions *AccountsPermissionsService +} + +func NewAccountsContainersService(s *Service) *AccountsContainersService { + rs := &AccountsContainersService{s: s} + rs.Folders = NewAccountsContainersFoldersService(s) + rs.MoveFolders = NewAccountsContainersMoveFoldersService(s) + rs.Tags = NewAccountsContainersTagsService(s) + rs.Triggers = NewAccountsContainersTriggersService(s) + rs.Variables = NewAccountsContainersVariablesService(s) + rs.Versions = NewAccountsContainersVersionsService(s) + return rs +} + +type AccountsContainersService struct { + s *Service + + Folders *AccountsContainersFoldersService + + MoveFolders *AccountsContainersMoveFoldersService + + Tags *AccountsContainersTagsService + + Triggers *AccountsContainersTriggersService + + Variables *AccountsContainersVariablesService + + Versions *AccountsContainersVersionsService +} + +func NewAccountsContainersFoldersService(s *Service) *AccountsContainersFoldersService { + rs := &AccountsContainersFoldersService{s: s} + rs.Entities = NewAccountsContainersFoldersEntitiesService(s) + return rs +} + +type AccountsContainersFoldersService struct { + s *Service + + Entities *AccountsContainersFoldersEntitiesService +} + +func NewAccountsContainersFoldersEntitiesService(s *Service) *AccountsContainersFoldersEntitiesService { + rs := &AccountsContainersFoldersEntitiesService{s: s} + return rs +} + +type AccountsContainersFoldersEntitiesService struct { + s *Service +} + +func NewAccountsContainersMoveFoldersService(s *Service) *AccountsContainersMoveFoldersService { + rs := &AccountsContainersMoveFoldersService{s: s} + return rs +} + +type AccountsContainersMoveFoldersService struct { + s *Service +} + +func NewAccountsContainersTagsService(s *Service) *AccountsContainersTagsService { + rs := &AccountsContainersTagsService{s: s} + return rs +} + +type AccountsContainersTagsService struct { + s *Service +} + +func NewAccountsContainersTriggersService(s *Service) *AccountsContainersTriggersService { + rs := &AccountsContainersTriggersService{s: s} + return rs +} + +type AccountsContainersTriggersService struct { + s *Service +} + +func NewAccountsContainersVariablesService(s *Service) *AccountsContainersVariablesService { + rs := &AccountsContainersVariablesService{s: s} + return rs +} + +type AccountsContainersVariablesService struct { + s *Service +} + +func NewAccountsContainersVersionsService(s *Service) *AccountsContainersVersionsService { + rs := &AccountsContainersVersionsService{s: s} + return rs +} + +type AccountsContainersVersionsService struct { + s *Service +} + +func NewAccountsPermissionsService(s *Service) *AccountsPermissionsService { + rs := &AccountsPermissionsService{s: s} + return rs +} + +type AccountsPermissionsService struct { + s *Service +} + +// Account: Represents a Google Tag Manager Account. +type Account struct { + // AccountId: The Account ID uniquely identifies the GTM Account. + AccountId string `json:"accountId,omitempty"` + + // Fingerprint: The fingerprint of the GTM Account as computed at + // storage time. This value is recomputed whenever the account is + // modified. + Fingerprint string `json:"fingerprint,omitempty"` + + // Name: Account display name. + Name string `json:"name,omitempty"` + + // ShareData: Whether the account shares data anonymously with Google + // and others. + ShareData bool `json:"shareData,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Account) MarshalJSON() ([]byte, error) { + type noMethod Account + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// AccountAccess: Defines the Google Tag Manager Account access +// permissions. +type AccountAccess struct { + // Permission: List of Account permissions. Valid account permissions + // are read and manage. + // + // Possible values: + // "delete" + // "edit" + // "manage" + // "publish" + // "read" + Permission []string `json:"permission,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Permission") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccountAccess) MarshalJSON() ([]byte, error) { + type noMethod AccountAccess + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Condition: Represents a predicate. +type Condition struct { + // Parameter: A list of named parameters (key/value), depending on the + // condition's type. Notes: + // - For binary operators, include parameters named arg0 and arg1 for + // specifying the left and right operands, respectively. + // - At this time, the left operand (arg0) must be a reference to a + // variable. + // - For case-insensitive Regex matching, include a boolean parameter + // named ignore_case that is set to true. If not specified or set to any + // other value, the matching will be case sensitive. + // - To negate an operator, include a boolean parameter named negate + // boolean parameter that is set to true. + Parameter []*Parameter `json:"parameter,omitempty"` + + // Type: The type of operator for this condition. + // + // Possible values: + // "contains" + // "cssSelector" + // "endsWith" + // "equals" + // "greater" + // "greaterOrEquals" + // "less" + // "lessOrEquals" + // "matchRegex" + // "startsWith" + // "urlMatches" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Parameter") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Condition) MarshalJSON() ([]byte, error) { + type noMethod Condition + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Container: Represents a Google Tag Manager Container. +type Container struct { + // AccountId: GTM Account ID. + AccountId string `json:"accountId,omitempty"` + + // ContainerId: The Container ID uniquely identifies the GTM Container. + ContainerId string `json:"containerId,omitempty"` + + // DomainName: Optional list of domain names associated with the + // Container. + DomainName []string `json:"domainName,omitempty"` + + // EnabledBuiltInVariable: List of enabled built-in variables. Valid + // values include: pageUrl, pageHostname, pagePath, referrer, event, + // clickElement, clickClasses, clickId, clickTarget, clickUrl, + // clickText, formElement, formClasses, formId, formTarget, formUrl, + // formText, errorMessage, errorUrl, errorLine, newHistoryFragment, + // oldHistoryFragment, newHistoryState, oldHistoryState, historySource, + // containerVersion, debugMode, randomNumber, containerId. + // + // Possible values: + // "advertiserId" + // "advertisingTrackingEnabled" + // "appId" + // "appName" + // "appVersionCode" + // "appVersionName" + // "clickClasses" + // "clickElement" + // "clickId" + // "clickTarget" + // "clickText" + // "clickUrl" + // "containerId" + // "containerVersion" + // "debugMode" + // "deviceName" + // "errorLine" + // "errorMessage" + // "errorUrl" + // "event" + // "formClasses" + // "formElement" + // "formId" + // "formTarget" + // "formText" + // "formUrl" + // "historySource" + // "htmlId" + // "language" + // "newHistoryFragment" + // "newHistoryState" + // "oldHistoryFragment" + // "oldHistoryState" + // "osVersion" + // "pageHostname" + // "pagePath" + // "pageUrl" + // "platform" + // "randomNumber" + // "referrer" + // "resolution" + // "sdkVersion" + EnabledBuiltInVariable []string `json:"enabledBuiltInVariable,omitempty"` + + // Fingerprint: The fingerprint of the GTM Container as computed at + // storage time. This value is recomputed whenever the account is + // modified. + Fingerprint string `json:"fingerprint,omitempty"` + + // Name: Container display name. + Name string `json:"name,omitempty"` + + // Notes: Container Notes. + Notes string `json:"notes,omitempty"` + + // PublicId: Container Public ID. + PublicId string `json:"publicId,omitempty"` + + // TimeZoneCountryId: Container Country ID. + TimeZoneCountryId string `json:"timeZoneCountryId,omitempty"` + + // TimeZoneId: Container Time Zone ID. + TimeZoneId string `json:"timeZoneId,omitempty"` + + // UsageContext: List of Usage Contexts for the Container. Valid values + // include: web, android, ios. + // + // Possible values: + // "android" + // "androidSdk5" + // "ios" + // "iosSdk5" + // "web" + UsageContext []string `json:"usageContext,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Container) MarshalJSON() ([]byte, error) { + type noMethod Container + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ContainerAccess: Defines the Google Tag Manager Container access +// permissions. +type ContainerAccess struct { + // ContainerId: GTM Container ID. + ContainerId string `json:"containerId,omitempty"` + + // Permission: List of Container permissions. Valid container + // permissions are: read, edit, delete, publish. + // + // Possible values: + // "delete" + // "edit" + // "manage" + // "publish" + // "read" + Permission []string `json:"permission,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ContainerId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ContainerAccess) MarshalJSON() ([]byte, error) { + type noMethod ContainerAccess + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ContainerVersion: Represents a Google Tag Manager Container Version. +type ContainerVersion struct { + // AccountId: GTM Account ID. + AccountId string `json:"accountId,omitempty"` + + // Container: The container that this version was taken from. + Container *Container `json:"container,omitempty"` + + // ContainerId: GTM Container ID. + ContainerId string `json:"containerId,omitempty"` + + // ContainerVersionId: The Container Version ID uniquely identifies the + // GTM Container Version. + ContainerVersionId string `json:"containerVersionId,omitempty"` + + // Deleted: A value of true indicates this container version has been + // deleted. + Deleted bool `json:"deleted,omitempty"` + + // Fingerprint: The fingerprint of the GTM Container Version as computed + // at storage time. This value is recomputed whenever the container + // version is modified. + Fingerprint string `json:"fingerprint,omitempty"` + + // Folder: The folders in the container that this version was taken + // from. + Folder []*Folder `json:"folder,omitempty"` + + // Macro: The macros in the container that this version was taken from. + Macro []*Macro `json:"macro,omitempty"` + + // Name: Container version display name. + Name string `json:"name,omitempty"` + + // Notes: User notes on how to apply this container version in the + // container. + Notes string `json:"notes,omitempty"` + + // Rule: The rules in the container that this version was taken from. + Rule []*Rule `json:"rule,omitempty"` + + // Tag: The tags in the container that this version was taken from. + Tag []*Tag `json:"tag,omitempty"` + + // Trigger: The triggers in the container that this version was taken + // from. + Trigger []*Trigger `json:"trigger,omitempty"` + + // Variable: The variables in the container that this version was taken + // from. + Variable []*Variable `json:"variable,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ContainerVersion) MarshalJSON() ([]byte, error) { + type noMethod ContainerVersion + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ContainerVersionHeader: Represents a Google Tag Manager Container +// Version Header. +type ContainerVersionHeader struct { + // AccountId: GTM Account ID. + AccountId string `json:"accountId,omitempty"` + + // ContainerId: GTM Container ID. + ContainerId string `json:"containerId,omitempty"` + + // ContainerVersionId: The Container Version ID uniquely identifies the + // GTM Container Version. + ContainerVersionId string `json:"containerVersionId,omitempty"` + + // Deleted: A value of true indicates this container version has been + // deleted. + Deleted bool `json:"deleted,omitempty"` + + // Name: Container version display name. + Name string `json:"name,omitempty"` + + // NumMacros: Number of macros in the container version. + NumMacros string `json:"numMacros,omitempty"` + + // NumRules: Number of rules in the container version. + NumRules string `json:"numRules,omitempty"` + + // NumTags: Number of tags in the container version. + NumTags string `json:"numTags,omitempty"` + + // NumTriggers: Number of triggers in the container version. + NumTriggers string `json:"numTriggers,omitempty"` + + // NumVariables: Number of variables in the container version. + NumVariables string `json:"numVariables,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ContainerVersionHeader) MarshalJSON() ([]byte, error) { + type noMethod ContainerVersionHeader + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreateContainerVersionRequestVersionOptions: Options for new +// container versions. +type CreateContainerVersionRequestVersionOptions struct { + // Name: The name of the container version to be created. + Name string `json:"name,omitempty"` + + // Notes: The notes of the container version to be created. + Notes string `json:"notes,omitempty"` + + // QuickPreview: The creation of this version may be for quick preview + // and shouldn't be saved. + QuickPreview bool `json:"quickPreview,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreateContainerVersionRequestVersionOptions) MarshalJSON() ([]byte, error) { + type noMethod CreateContainerVersionRequestVersionOptions + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CreateContainerVersionResponse: Create container versions response. +type CreateContainerVersionResponse struct { + // CompilerError: Compiler errors or not. + CompilerError bool `json:"compilerError,omitempty"` + + // ContainerVersion: The container version created. + ContainerVersion *ContainerVersion `json:"containerVersion,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CompilerError") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CreateContainerVersionResponse) MarshalJSON() ([]byte, error) { + type noMethod CreateContainerVersionResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Folder: Represents a Google Tag Manager Folder. +type Folder struct { + // AccountId: GTM Account ID. + AccountId string `json:"accountId,omitempty"` + + // ContainerId: GTM Container ID. + ContainerId string `json:"containerId,omitempty"` + + // Fingerprint: The fingerprint of the GTM Folder as computed at storage + // time. This value is recomputed whenever the folder is modified. + Fingerprint string `json:"fingerprint,omitempty"` + + // FolderId: The Folder ID uniquely identifies the GTM Folder. + FolderId string `json:"folderId,omitempty"` + + // Name: Folder display name. + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Folder) MarshalJSON() ([]byte, error) { + type noMethod Folder + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// FolderEntities: Represents a Google Tag Manager Folder's contents. +type FolderEntities struct { + // Tag: The list of tags inside the folder. + Tag []*Tag `json:"tag,omitempty"` + + // Trigger: The list of triggers inside the folder. + Trigger []*Trigger `json:"trigger,omitempty"` + + // Variable: The list of variables inside the folder. + Variable []*Variable `json:"variable,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Tag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *FolderEntities) MarshalJSON() ([]byte, error) { + type noMethod FolderEntities + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListAccountUsersResponse: List AccountUsers Response. +type ListAccountUsersResponse struct { + // UserAccess: All GTM AccountUsers of a GTM Account. + UserAccess []*UserAccess `json:"userAccess,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "UserAccess") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListAccountUsersResponse) MarshalJSON() ([]byte, error) { + type noMethod ListAccountUsersResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListAccountsResponse: List Accounts Response. +type ListAccountsResponse struct { + // Accounts: List of GTM Accounts that a user has access to. + Accounts []*Account `json:"accounts,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Accounts") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListAccountsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListAccountsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListContainerVersionsResponse: List container versions response. +type ListContainerVersionsResponse struct { + // ContainerVersion: All versions of a GTM Container. + ContainerVersion []*ContainerVersion `json:"containerVersion,omitempty"` + + // ContainerVersionHeader: All container version headers of a GTM + // Container. + ContainerVersionHeader []*ContainerVersionHeader `json:"containerVersionHeader,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ContainerVersion") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListContainerVersionsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListContainerVersionsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListContainersResponse: List Containers Response. +type ListContainersResponse struct { + // Containers: All Containers of a GTM Account. + Containers []*Container `json:"containers,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Containers") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListContainersResponse) MarshalJSON() ([]byte, error) { + type noMethod ListContainersResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListFoldersResponse: List Folders Response. +type ListFoldersResponse struct { + // Folders: All GTM Folders of a GTM Container. + Folders []*Folder `json:"folders,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Folders") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListFoldersResponse) MarshalJSON() ([]byte, error) { + type noMethod ListFoldersResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListTagsResponse: List Tags Response. +type ListTagsResponse struct { + // Tags: All GTM Tags of a GTM Container. + Tags []*Tag `json:"tags,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Tags") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListTagsResponse) MarshalJSON() ([]byte, error) { + type noMethod ListTagsResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListTriggersResponse: List triggers response. +type ListTriggersResponse struct { + // Triggers: All GTM Triggers of a GTM Container. + Triggers []*Trigger `json:"triggers,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Triggers") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListTriggersResponse) MarshalJSON() ([]byte, error) { + type noMethod ListTriggersResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ListVariablesResponse: List Variables Response. +type ListVariablesResponse struct { + // Variables: All GTM Variables of a GTM Container. + Variables []*Variable `json:"variables,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Variables") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ListVariablesResponse) MarshalJSON() ([]byte, error) { + type noMethod ListVariablesResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Macro: Represents a Google Tag Manager Macro. +type Macro struct { + // AccountId: GTM Account ID. + AccountId string `json:"accountId,omitempty"` + + // ContainerId: GTM Container ID. + ContainerId string `json:"containerId,omitempty"` + + // DisablingRuleId: For mobile containers only: A list of rule IDs for + // disabling conditional macros; the macro is enabled if one of the + // enabling rules is true while all the disabling rules are false. + // Treated as an unordered set. + DisablingRuleId []string `json:"disablingRuleId,omitempty"` + + // EnablingRuleId: For mobile containers only: A list of rule IDs for + // enabling conditional macros; the macro is enabled if one of the + // enabling rules is true while all the disabling rules are false. + // Treated as an unordered set. + EnablingRuleId []string `json:"enablingRuleId,omitempty"` + + // Fingerprint: The fingerprint of the GTM Macro as computed at storage + // time. This value is recomputed whenever the macro is modified. + Fingerprint string `json:"fingerprint,omitempty"` + + // MacroId: The Macro ID uniquely identifies the GTM Macro. + MacroId string `json:"macroId,omitempty"` + + // Name: Macro display name. + Name string `json:"name,omitempty"` + + // Notes: User notes on how to apply this macro in the container. + Notes string `json:"notes,omitempty"` + + // Parameter: The macro's parameters. + Parameter []*Parameter `json:"parameter,omitempty"` + + // ParentFolderId: Parent folder id. + ParentFolderId string `json:"parentFolderId,omitempty"` + + // ScheduleEndMs: The end timestamp in milliseconds to schedule a macro. + ScheduleEndMs int64 `json:"scheduleEndMs,omitempty,string"` + + // ScheduleStartMs: The start timestamp in milliseconds to schedule a + // macro. + ScheduleStartMs int64 `json:"scheduleStartMs,omitempty,string"` + + // Type: GTM Macro Type. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Macro) MarshalJSON() ([]byte, error) { + type noMethod Macro + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Parameter: Represents a Google Tag Manager Parameter. +type Parameter struct { + // Key: The named key that uniquely identifies a parameter. Required for + // top-level parameters, as well as map values. Ignored for list values. + Key string `json:"key,omitempty"` + + // List: This list parameter's parameters (keys will be ignored). + List []*Parameter `json:"list,omitempty"` + + // Map: This map parameter's parameters (must have keys; keys must be + // unique). + Map []*Parameter `json:"map,omitempty"` + + // Type: The parameter type. Valid values are: + // - boolean: The value represents a boolean, represented as 'true' or + // 'false' + // - integer: The value represents a 64-bit signed integer value, in + // base 10 + // - list: A list of parameters should be specified + // - map: A map of parameters should be specified + // - template: The value represents any text; this can include variable + // references (even variable references that might return non-string + // types) + // + // Possible values: + // "boolean" + // "integer" + // "list" + // "map" + // "template" + Type string `json:"type,omitempty"` + + // Value: A parameter's value (may contain variable references such as + // "{{myVariable}}") as appropriate to the specified type. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Parameter) MarshalJSON() ([]byte, error) { + type noMethod Parameter + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PublishContainerVersionResponse: Publish container version response. +type PublishContainerVersionResponse struct { + // CompilerError: Compiler errors or not. + CompilerError bool `json:"compilerError,omitempty"` + + // ContainerVersion: The container version created. + ContainerVersion *ContainerVersion `json:"containerVersion,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CompilerError") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PublishContainerVersionResponse) MarshalJSON() ([]byte, error) { + type noMethod PublishContainerVersionResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Rule: Represents a Google Tag Manager Rule. +type Rule struct { + // AccountId: GTM Account ID. + AccountId string `json:"accountId,omitempty"` + + // Condition: The list of conditions that make up this rule (implicit + // AND between them). + Condition []*Condition `json:"condition,omitempty"` + + // ContainerId: GTM Container ID. + ContainerId string `json:"containerId,omitempty"` + + // Fingerprint: The fingerprint of the GTM Rule as computed at storage + // time. This value is recomputed whenever the rule is modified. + Fingerprint string `json:"fingerprint,omitempty"` + + // Name: Rule display name. + Name string `json:"name,omitempty"` + + // Notes: User notes on how to apply this rule in the container. + Notes string `json:"notes,omitempty"` + + // RuleId: The Rule ID uniquely identifies the GTM Rule. + RuleId string `json:"ruleId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Rule) MarshalJSON() ([]byte, error) { + type noMethod Rule + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type SetupTag struct { + // StopOnSetupFailure: If true, fire the main tag if and only if the + // setup tag fires successfully. If false, fire the main tag regardless + // of setup tag firing status. + StopOnSetupFailure bool `json:"stopOnSetupFailure,omitempty"` + + // TagName: The name of the setup tag. + TagName string `json:"tagName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "StopOnSetupFailure") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SetupTag) MarshalJSON() ([]byte, error) { + type noMethod SetupTag + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Tag: Represents a Google Tag Manager Tag. +type Tag struct { + // AccountId: GTM Account ID. + AccountId string `json:"accountId,omitempty"` + + // BlockingRuleId: Blocking rule IDs. If any of the listed rules + // evaluate to true, the tag will not fire. + BlockingRuleId []string `json:"blockingRuleId,omitempty"` + + // BlockingTriggerId: Blocking trigger IDs. If any of the listed + // triggers evaluate to true, the tag will not fire. + BlockingTriggerId []string `json:"blockingTriggerId,omitempty"` + + // ContainerId: GTM Container ID. + ContainerId string `json:"containerId,omitempty"` + + // Fingerprint: The fingerprint of the GTM Tag as computed at storage + // time. This value is recomputed whenever the tag is modified. + Fingerprint string `json:"fingerprint,omitempty"` + + // FiringRuleId: Firing rule IDs. A tag will fire when any of the listed + // rules are true and all of its blockingRuleIds (if any specified) are + // false. + FiringRuleId []string `json:"firingRuleId,omitempty"` + + // FiringTriggerId: Firing trigger IDs. A tag will fire when any of the + // listed triggers are true and all of its blockingTriggerIds (if any + // specified) are false. + FiringTriggerId []string `json:"firingTriggerId,omitempty"` + + // LiveOnly: If set to true, this tag will only fire in the live + // environment (e.g. not in preview or debug mode). + LiveOnly bool `json:"liveOnly,omitempty"` + + // Name: Tag display name. + Name string `json:"name,omitempty"` + + // Notes: User notes on how to apply this tag in the container. + Notes string `json:"notes,omitempty"` + + // Parameter: The tag's parameters. + Parameter []*Parameter `json:"parameter,omitempty"` + + // ParentFolderId: Parent folder id. + ParentFolderId string `json:"parentFolderId,omitempty"` + + // Priority: User defined numeric priority of the tag. Tags are fired + // asynchronously in order of priority. Tags with higher numeric value + // fire first. A tag's priority can be a positive or negative value. The + // default value is 0. + Priority *Parameter `json:"priority,omitempty"` + + // ScheduleEndMs: The end timestamp in milliseconds to schedule a tag. + ScheduleEndMs int64 `json:"scheduleEndMs,omitempty,string"` + + // ScheduleStartMs: The start timestamp in milliseconds to schedule a + // tag. + ScheduleStartMs int64 `json:"scheduleStartMs,omitempty,string"` + + // SetupTag: The list of setup tags. Currently we only allow one. + SetupTag []*SetupTag `json:"setupTag,omitempty"` + + // TagFiringOption: Option to fire this tag. + // + // Possible values: + // "oncePerEvent" + // "oncePerLoad" + // "unlimited" + TagFiringOption string `json:"tagFiringOption,omitempty"` + + // TagId: The Tag ID uniquely identifies the GTM Tag. + TagId string `json:"tagId,omitempty"` + + // TeardownTag: The list of teardown tags. Currently we only allow one. + TeardownTag []*TeardownTag `json:"teardownTag,omitempty"` + + // Type: GTM Tag Type. + Type string `json:"type,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Tag) MarshalJSON() ([]byte, error) { + type noMethod Tag + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TeardownTag struct { + // StopTeardownOnFailure: If true, fire the teardown tag if and only if + // the main tag fires successfully. If false, fire the teardown tag + // regardless of main tag firing status. + StopTeardownOnFailure bool `json:"stopTeardownOnFailure,omitempty"` + + // TagName: The name of the teardown tag. + TagName string `json:"tagName,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "StopTeardownOnFailure") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TeardownTag) MarshalJSON() ([]byte, error) { + type noMethod TeardownTag + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Trigger: Represents a Google Tag Manager Trigger +type Trigger struct { + // AccountId: GTM Account ID. + AccountId string `json:"accountId,omitempty"` + + // AutoEventFilter: Used in the case of auto event tracking. + AutoEventFilter []*Condition `json:"autoEventFilter,omitempty"` + + // CheckValidation: Whether or not we should only fire tags if the form + // submit or link click event is not cancelled by some other event + // handler (e.g. because of validation). Only valid for Form Submission + // and Link Click triggers. + CheckValidation *Parameter `json:"checkValidation,omitempty"` + + // ContainerId: GTM Container ID. + ContainerId string `json:"containerId,omitempty"` + + // CustomEventFilter: Used in the case of custom event, which is fired + // iff all Conditions are true. + CustomEventFilter []*Condition `json:"customEventFilter,omitempty"` + + // EnableAllVideos: Reloads the videos in the page that don't already + // have the YT API enabled. If false, only capture events from videos + // that already have the API enabled. Only valid for YouTube triggers. + EnableAllVideos *Parameter `json:"enableAllVideos,omitempty"` + + // EventName: Name of the GTM event that is fired. Only valid for Timer + // triggers. + EventName *Parameter `json:"eventName,omitempty"` + + // Filter: The trigger will only fire iff all Conditions are true. + Filter []*Condition `json:"filter,omitempty"` + + // Fingerprint: The fingerprint of the GTM Trigger as computed at + // storage time. This value is recomputed whenever the trigger is + // modified. + Fingerprint string `json:"fingerprint,omitempty"` + + // Interval: Time between triggering recurring Timer Events (in + // milliseconds). Only valid for Timer triggers. + Interval *Parameter `json:"interval,omitempty"` + + // Limit: Limit of the number of GTM events this Timer Trigger will + // fire. If no limit is set, we will continue to fire GTM events until + // the user leaves the page. Only valid for Timer triggers. + Limit *Parameter `json:"limit,omitempty"` + + // Name: Trigger display name. + Name string `json:"name,omitempty"` + + // ParentFolderId: Parent folder id. + ParentFolderId string `json:"parentFolderId,omitempty"` + + // TriggerId: The Trigger ID uniquely identifies the GTM Trigger. + TriggerId string `json:"triggerId,omitempty"` + + // Type: Defines the data layer event that causes this trigger. + // + // Possible values: + // "ajaxSubmission" + // "always" + // "click" + // "customEvent" + // "domReady" + // "formSubmission" + // "historyChange" + // "jsError" + // "linkClick" + // "pageview" + // "timer" + // "windowLoaded" + // "youTube" + Type string `json:"type,omitempty"` + + // UniqueTriggerId: Globally unique id of the trigger that + // auto-generates this (a Form Submit, Link Click or Timer listener) if + // any. Used to make incompatible auto-events work together with trigger + // filtering based on trigger ids. This value is populated during output + // generation since the tags implied by triggers don't exist until then. + // Only valid for Form Submit, Link Click and Timer triggers. + UniqueTriggerId *Parameter `json:"uniqueTriggerId,omitempty"` + + // VideoPercentageList: List of integer percentage values. The trigger + // will fire as each percentage is reached in any instrumented videos. + // Only valid for YouTube triggers. + VideoPercentageList *Parameter `json:"videoPercentageList,omitempty"` + + // WaitForTags: Whether or not we should delay the form submissions or + // link opening until all of the tags have fired (by preventing the + // default action and later simulating the default action). Only valid + // for Form Submission and Link Click triggers. + WaitForTags *Parameter `json:"waitForTags,omitempty"` + + // WaitForTagsTimeout: How long to wait (in milliseconds) for tags to + // fire when 'waits_for_tags' above evaluates to true. Only valid for + // Form Submission and Link Click triggers. + WaitForTagsTimeout *Parameter `json:"waitForTagsTimeout,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Trigger) MarshalJSON() ([]byte, error) { + type noMethod Trigger + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UserAccess: Represents a user's permissions to an account and its +// container. +type UserAccess struct { + // AccountAccess: GTM Account access permissions. + AccountAccess *AccountAccess `json:"accountAccess,omitempty"` + + // AccountId: GTM Account ID. + AccountId string `json:"accountId,omitempty"` + + // ContainerAccess: GTM Container access permissions. + ContainerAccess []*ContainerAccess `json:"containerAccess,omitempty"` + + // EmailAddress: User's email address. + EmailAddress string `json:"emailAddress,omitempty"` + + // PermissionId: Account Permission ID. + PermissionId string `json:"permissionId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountAccess") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UserAccess) MarshalJSON() ([]byte, error) { + type noMethod UserAccess + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Variable: Represents a Google Tag Manager Variable. +type Variable struct { + // AccountId: GTM Account ID. + AccountId string `json:"accountId,omitempty"` + + // ContainerId: GTM Container ID. + ContainerId string `json:"containerId,omitempty"` + + // DisablingTriggerId: For mobile containers only: A list of trigger IDs + // for disabling conditional variables; the variable is enabled if one + // of the enabling trigger is true while all the disabling trigger are + // false. Treated as an unordered set. + DisablingTriggerId []string `json:"disablingTriggerId,omitempty"` + + // EnablingTriggerId: For mobile containers only: A list of trigger IDs + // for enabling conditional variables; the variable is enabled if one of + // the enabling triggers is true while all the disabling triggers are + // false. Treated as an unordered set. + EnablingTriggerId []string `json:"enablingTriggerId,omitempty"` + + // Fingerprint: The fingerprint of the GTM Variable as computed at + // storage time. This value is recomputed whenever the variable is + // modified. + Fingerprint string `json:"fingerprint,omitempty"` + + // Name: Variable display name. + Name string `json:"name,omitempty"` + + // Notes: User notes on how to apply this variable in the container. + Notes string `json:"notes,omitempty"` + + // Parameter: The variable's parameters. + Parameter []*Parameter `json:"parameter,omitempty"` + + // ParentFolderId: Parent folder id. + ParentFolderId string `json:"parentFolderId,omitempty"` + + // ScheduleEndMs: The end timestamp in milliseconds to schedule a + // variable. + ScheduleEndMs int64 `json:"scheduleEndMs,omitempty,string"` + + // ScheduleStartMs: The start timestamp in milliseconds to schedule a + // variable. + ScheduleStartMs int64 `json:"scheduleStartMs,omitempty,string"` + + // Type: GTM Variable Type. + Type string `json:"type,omitempty"` + + // VariableId: The Variable ID uniquely identifies the GTM Variable. + VariableId string `json:"variableId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AccountId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Variable) MarshalJSON() ([]byte, error) { + type noMethod Variable + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "tagmanager.accounts.get": + +type AccountsGetCall struct { + s *Service + accountId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a GTM Account. +func (r *AccountsService) Get(accountId string) *AccountsGetCall { + c := &AccountsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.get" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsGetCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a GTM Account.", + // "httpMethod": "GET", + // "id": "tagmanager.accounts.get", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}", + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers", + // "https://www.googleapis.com/auth/tagmanager.manage.accounts", + // "https://www.googleapis.com/auth/tagmanager.readonly" + // ] + // } + +} + +// method id "tagmanager.accounts.list": + +type AccountsListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all GTM Accounts that a user has access to. +func (r *AccountsService) List() *AccountsListCall { + c := &AccountsListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.list" call. +// Exactly one of *ListAccountsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListAccountsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsListCall) Do() (*ListAccountsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListAccountsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all GTM Accounts that a user has access to.", + // "httpMethod": "GET", + // "id": "tagmanager.accounts.list", + // "path": "accounts", + // "response": { + // "$ref": "ListAccountsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers", + // "https://www.googleapis.com/auth/tagmanager.manage.accounts", + // "https://www.googleapis.com/auth/tagmanager.readonly" + // ] + // } + +} + +// method id "tagmanager.accounts.update": + +type AccountsUpdateCall struct { + s *Service + accountId string + account *Account + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a GTM Account. +func (r *AccountsService) Update(accountId string, account *Account) *AccountsUpdateCall { + c := &AccountsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.account = account + return c +} + +// Fingerprint sets the optional parameter "fingerprint": When provided, +// this fingerprint must match the fingerprint of the account in +// storage. +func (c *AccountsUpdateCall) Fingerprint(fingerprint string) *AccountsUpdateCall { + c.opt_["fingerprint"] = fingerprint + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsUpdateCall) Fields(s ...googleapi.Field) *AccountsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsUpdateCall) Context(ctx context.Context) *AccountsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fingerprint"]; ok { + params.Set("fingerprint", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.update" call. +// Exactly one of *Account or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Account.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsUpdateCall) Do() (*Account, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Account{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a GTM Account.", + // "httpMethod": "PUT", + // "id": "tagmanager.accounts.update", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fingerprint": { + // "description": "When provided, this fingerprint must match the fingerprint of the account in storage.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}", + // "request": { + // "$ref": "Account" + // }, + // "response": { + // "$ref": "Account" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.manage.accounts" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.create": + +type AccountsContainersCreateCall struct { + s *Service + accountId string + container *Container + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a Container. +func (r *AccountsContainersService) Create(accountId string, container *Container) *AccountsContainersCreateCall { + c := &AccountsContainersCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.container = container + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersCreateCall) Fields(s ...googleapi.Field) *AccountsContainersCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersCreateCall) Context(ctx context.Context) *AccountsContainersCreateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.container) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.create" call. +// Exactly one of *Container or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Container.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsContainersCreateCall) Do() (*Container, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Container{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a Container.", + // "httpMethod": "POST", + // "id": "tagmanager.accounts.containers.create", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers", + // "request": { + // "$ref": "Container" + // }, + // "response": { + // "$ref": "Container" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.delete": + +type AccountsContainersDeleteCall struct { + s *Service + accountId string + containerId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a Container. +func (r *AccountsContainersService) Delete(accountId string, containerId string) *AccountsContainersDeleteCall { + c := &AccountsContainersDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersDeleteCall) Context(ctx context.Context) *AccountsContainersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.delete" call. +func (c *AccountsContainersDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a Container.", + // "httpMethod": "DELETE", + // "id": "tagmanager.accounts.containers.delete", + // "parameterOrder": [ + // "accountId", + // "containerId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}", + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.delete.containers" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.get": + +type AccountsContainersGetCall struct { + s *Service + accountId string + containerId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a Container. +func (r *AccountsContainersService) Get(accountId string, containerId string) *AccountsContainersGetCall { + c := &AccountsContainersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersGetCall) Fields(s ...googleapi.Field) *AccountsContainersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsContainersGetCall) IfNoneMatch(entityTag string) *AccountsContainersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersGetCall) Context(ctx context.Context) *AccountsContainersGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.get" call. +// Exactly one of *Container or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Container.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsContainersGetCall) Do() (*Container, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Container{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a Container.", + // "httpMethod": "GET", + // "id": "tagmanager.accounts.containers.get", + // "parameterOrder": [ + // "accountId", + // "containerId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}", + // "response": { + // "$ref": "Container" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers", + // "https://www.googleapis.com/auth/tagmanager.readonly" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.list": + +type AccountsContainersListCall struct { + s *Service + accountId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all Containers that belongs to a GTM Account. +func (r *AccountsContainersService) List(accountId string) *AccountsContainersListCall { + c := &AccountsContainersListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersListCall) Fields(s ...googleapi.Field) *AccountsContainersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsContainersListCall) IfNoneMatch(entityTag string) *AccountsContainersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersListCall) Context(ctx context.Context) *AccountsContainersListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.list" call. +// Exactly one of *ListContainersResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListContainersResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsContainersListCall) Do() (*ListContainersResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListContainersResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all Containers that belongs to a GTM Account.", + // "httpMethod": "GET", + // "id": "tagmanager.accounts.containers.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers", + // "response": { + // "$ref": "ListContainersResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers", + // "https://www.googleapis.com/auth/tagmanager.readonly" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.update": + +type AccountsContainersUpdateCall struct { + s *Service + accountId string + containerId string + container *Container + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a Container. +func (r *AccountsContainersService) Update(accountId string, containerId string, container *Container) *AccountsContainersUpdateCall { + c := &AccountsContainersUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + c.container = container + return c +} + +// Fingerprint sets the optional parameter "fingerprint": When provided, +// this fingerprint must match the fingerprint of the container in +// storage. +func (c *AccountsContainersUpdateCall) Fingerprint(fingerprint string) *AccountsContainersUpdateCall { + c.opt_["fingerprint"] = fingerprint + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersUpdateCall) Context(ctx context.Context) *AccountsContainersUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.container) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fingerprint"]; ok { + params.Set("fingerprint", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.update" call. +// Exactly one of *Container or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Container.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsContainersUpdateCall) Do() (*Container, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Container{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a Container.", + // "httpMethod": "PUT", + // "id": "tagmanager.accounts.containers.update", + // "parameterOrder": [ + // "accountId", + // "containerId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fingerprint": { + // "description": "When provided, this fingerprint must match the fingerprint of the container in storage.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}", + // "request": { + // "$ref": "Container" + // }, + // "response": { + // "$ref": "Container" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.folders.create": + +type AccountsContainersFoldersCreateCall struct { + s *Service + accountId string + containerId string + folder *Folder + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a GTM Folder. +func (r *AccountsContainersFoldersService) Create(accountId string, containerId string, folder *Folder) *AccountsContainersFoldersCreateCall { + c := &AccountsContainersFoldersCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + c.folder = folder + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersFoldersCreateCall) Fields(s ...googleapi.Field) *AccountsContainersFoldersCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersFoldersCreateCall) Context(ctx context.Context) *AccountsContainersFoldersCreateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersFoldersCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/folders") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.folders.create" call. +// Exactly one of *Folder or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Folder.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsContainersFoldersCreateCall) Do() (*Folder, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Folder{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a GTM Folder.", + // "httpMethod": "POST", + // "id": "tagmanager.accounts.containers.folders.create", + // "parameterOrder": [ + // "accountId", + // "containerId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/folders", + // "request": { + // "$ref": "Folder" + // }, + // "response": { + // "$ref": "Folder" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.folders.delete": + +type AccountsContainersFoldersDeleteCall struct { + s *Service + accountId string + containerId string + folderId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a GTM Folder. +func (r *AccountsContainersFoldersService) Delete(accountId string, containerId string, folderId string) *AccountsContainersFoldersDeleteCall { + c := &AccountsContainersFoldersDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + c.folderId = folderId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersFoldersDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersFoldersDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersFoldersDeleteCall) Context(ctx context.Context) *AccountsContainersFoldersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersFoldersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/folders/{folderId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + "folderId": c.folderId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.folders.delete" call. +func (c *AccountsContainersFoldersDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a GTM Folder.", + // "httpMethod": "DELETE", + // "id": "tagmanager.accounts.containers.folders.delete", + // "parameterOrder": [ + // "accountId", + // "containerId", + // "folderId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "folderId": { + // "description": "The GTM Folder ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/folders/{folderId}", + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.folders.get": + +type AccountsContainersFoldersGetCall struct { + s *Service + accountId string + containerId string + folderId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a GTM Folder. +func (r *AccountsContainersFoldersService) Get(accountId string, containerId string, folderId string) *AccountsContainersFoldersGetCall { + c := &AccountsContainersFoldersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + c.folderId = folderId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersFoldersGetCall) Fields(s ...googleapi.Field) *AccountsContainersFoldersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsContainersFoldersGetCall) IfNoneMatch(entityTag string) *AccountsContainersFoldersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersFoldersGetCall) Context(ctx context.Context) *AccountsContainersFoldersGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersFoldersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/folders/{folderId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + "folderId": c.folderId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.folders.get" call. +// Exactly one of *Folder or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Folder.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsContainersFoldersGetCall) Do() (*Folder, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Folder{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a GTM Folder.", + // "httpMethod": "GET", + // "id": "tagmanager.accounts.containers.folders.get", + // "parameterOrder": [ + // "accountId", + // "containerId", + // "folderId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "folderId": { + // "description": "The GTM Folder ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/folders/{folderId}", + // "response": { + // "$ref": "Folder" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers", + // "https://www.googleapis.com/auth/tagmanager.readonly" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.folders.list": + +type AccountsContainersFoldersListCall struct { + s *Service + accountId string + containerId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all GTM Folders of a Container. +func (r *AccountsContainersFoldersService) List(accountId string, containerId string) *AccountsContainersFoldersListCall { + c := &AccountsContainersFoldersListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersFoldersListCall) Fields(s ...googleapi.Field) *AccountsContainersFoldersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsContainersFoldersListCall) IfNoneMatch(entityTag string) *AccountsContainersFoldersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersFoldersListCall) Context(ctx context.Context) *AccountsContainersFoldersListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersFoldersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/folders") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.folders.list" call. +// Exactly one of *ListFoldersResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListFoldersResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsContainersFoldersListCall) Do() (*ListFoldersResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListFoldersResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all GTM Folders of a Container.", + // "httpMethod": "GET", + // "id": "tagmanager.accounts.containers.folders.list", + // "parameterOrder": [ + // "accountId", + // "containerId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/folders", + // "response": { + // "$ref": "ListFoldersResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers", + // "https://www.googleapis.com/auth/tagmanager.readonly" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.folders.update": + +type AccountsContainersFoldersUpdateCall struct { + s *Service + accountId string + containerId string + folderId string + folder *Folder + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a GTM Folder. +func (r *AccountsContainersFoldersService) Update(accountId string, containerId string, folderId string, folder *Folder) *AccountsContainersFoldersUpdateCall { + c := &AccountsContainersFoldersUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + c.folderId = folderId + c.folder = folder + return c +} + +// Fingerprint sets the optional parameter "fingerprint": When provided, +// this fingerprint must match the fingerprint of the folder in storage. +func (c *AccountsContainersFoldersUpdateCall) Fingerprint(fingerprint string) *AccountsContainersFoldersUpdateCall { + c.opt_["fingerprint"] = fingerprint + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersFoldersUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersFoldersUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersFoldersUpdateCall) Context(ctx context.Context) *AccountsContainersFoldersUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersFoldersUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fingerprint"]; ok { + params.Set("fingerprint", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/folders/{folderId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + "folderId": c.folderId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.folders.update" call. +// Exactly one of *Folder or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Folder.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsContainersFoldersUpdateCall) Do() (*Folder, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Folder{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a GTM Folder.", + // "httpMethod": "PUT", + // "id": "tagmanager.accounts.containers.folders.update", + // "parameterOrder": [ + // "accountId", + // "containerId", + // "folderId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fingerprint": { + // "description": "When provided, this fingerprint must match the fingerprint of the folder in storage.", + // "location": "query", + // "type": "string" + // }, + // "folderId": { + // "description": "The GTM Folder ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/folders/{folderId}", + // "request": { + // "$ref": "Folder" + // }, + // "response": { + // "$ref": "Folder" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.folders.entities.list": + +type AccountsContainersFoldersEntitiesListCall struct { + s *Service + accountId string + containerId string + folderId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List all entities in a GTM Folder. +func (r *AccountsContainersFoldersEntitiesService) List(accountId string, containerId string, folderId string) *AccountsContainersFoldersEntitiesListCall { + c := &AccountsContainersFoldersEntitiesListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + c.folderId = folderId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersFoldersEntitiesListCall) Fields(s ...googleapi.Field) *AccountsContainersFoldersEntitiesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsContainersFoldersEntitiesListCall) IfNoneMatch(entityTag string) *AccountsContainersFoldersEntitiesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersFoldersEntitiesListCall) Context(ctx context.Context) *AccountsContainersFoldersEntitiesListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersFoldersEntitiesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/folders/{folderId}/entities") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + "folderId": c.folderId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.folders.entities.list" call. +// Exactly one of *FolderEntities or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *FolderEntities.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsContainersFoldersEntitiesListCall) Do() (*FolderEntities, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &FolderEntities{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all entities in a GTM Folder.", + // "httpMethod": "GET", + // "id": "tagmanager.accounts.containers.folders.entities.list", + // "parameterOrder": [ + // "accountId", + // "containerId", + // "folderId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "folderId": { + // "description": "The GTM Folder ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/folders/{folderId}/entities", + // "response": { + // "$ref": "FolderEntities" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers", + // "https://www.googleapis.com/auth/tagmanager.readonly" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.move_folders.update": + +type AccountsContainersMoveFoldersUpdateCall struct { + s *Service + accountId string + containerId string + folderId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Moves entities to a GTM Folder. +func (r *AccountsContainersMoveFoldersService) Update(accountId string, containerId string, folderId string) *AccountsContainersMoveFoldersUpdateCall { + c := &AccountsContainersMoveFoldersUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + c.folderId = folderId + return c +} + +// TagId sets the optional parameter "tagId": The tags to be moved to +// the folder. +func (c *AccountsContainersMoveFoldersUpdateCall) TagId(tagId string) *AccountsContainersMoveFoldersUpdateCall { + c.opt_["tagId"] = tagId + return c +} + +// TriggerId sets the optional parameter "triggerId": The triggers to be +// moved to the folder. +func (c *AccountsContainersMoveFoldersUpdateCall) TriggerId(triggerId string) *AccountsContainersMoveFoldersUpdateCall { + c.opt_["triggerId"] = triggerId + return c +} + +// VariableId sets the optional parameter "variableId": The variables to +// be moved to the folder. +func (c *AccountsContainersMoveFoldersUpdateCall) VariableId(variableId string) *AccountsContainersMoveFoldersUpdateCall { + c.opt_["variableId"] = variableId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersMoveFoldersUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersMoveFoldersUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersMoveFoldersUpdateCall) Context(ctx context.Context) *AccountsContainersMoveFoldersUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersMoveFoldersUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["tagId"]; ok { + params.Set("tagId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["triggerId"]; ok { + params.Set("triggerId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["variableId"]; ok { + params.Set("variableId", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/move_folders/{folderId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + "folderId": c.folderId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.move_folders.update" call. +func (c *AccountsContainersMoveFoldersUpdateCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Moves entities to a GTM Folder.", + // "httpMethod": "PUT", + // "id": "tagmanager.accounts.containers.move_folders.update", + // "parameterOrder": [ + // "accountId", + // "containerId", + // "folderId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "folderId": { + // "description": "The GTM Folder ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tagId": { + // "description": "The tags to be moved to the folder.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "triggerId": { + // "description": "The triggers to be moved to the folder.", + // "location": "query", + // "repeated": true, + // "type": "string" + // }, + // "variableId": { + // "description": "The variables to be moved to the folder.", + // "location": "query", + // "repeated": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/move_folders/{folderId}" + // } + +} + +// method id "tagmanager.accounts.containers.tags.create": + +type AccountsContainersTagsCreateCall struct { + s *Service + accountId string + containerId string + tag *Tag + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a GTM Tag. +func (r *AccountsContainersTagsService) Create(accountId string, containerId string, tag *Tag) *AccountsContainersTagsCreateCall { + c := &AccountsContainersTagsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + c.tag = tag + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersTagsCreateCall) Fields(s ...googleapi.Field) *AccountsContainersTagsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersTagsCreateCall) Context(ctx context.Context) *AccountsContainersTagsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersTagsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.tag) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/tags") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.tags.create" call. +// Exactly one of *Tag or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Tag.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AccountsContainersTagsCreateCall) Do() (*Tag, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Tag{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a GTM Tag.", + // "httpMethod": "POST", + // "id": "tagmanager.accounts.containers.tags.create", + // "parameterOrder": [ + // "accountId", + // "containerId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/tags", + // "request": { + // "$ref": "Tag" + // }, + // "response": { + // "$ref": "Tag" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.tags.delete": + +type AccountsContainersTagsDeleteCall struct { + s *Service + accountId string + containerId string + tagId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a GTM Tag. +func (r *AccountsContainersTagsService) Delete(accountId string, containerId string, tagId string) *AccountsContainersTagsDeleteCall { + c := &AccountsContainersTagsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + c.tagId = tagId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersTagsDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersTagsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersTagsDeleteCall) Context(ctx context.Context) *AccountsContainersTagsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersTagsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/tags/{tagId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + "tagId": c.tagId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.tags.delete" call. +func (c *AccountsContainersTagsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a GTM Tag.", + // "httpMethod": "DELETE", + // "id": "tagmanager.accounts.containers.tags.delete", + // "parameterOrder": [ + // "accountId", + // "containerId", + // "tagId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tagId": { + // "description": "The GTM Tag ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/tags/{tagId}", + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.tags.get": + +type AccountsContainersTagsGetCall struct { + s *Service + accountId string + containerId string + tagId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a GTM Tag. +func (r *AccountsContainersTagsService) Get(accountId string, containerId string, tagId string) *AccountsContainersTagsGetCall { + c := &AccountsContainersTagsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + c.tagId = tagId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersTagsGetCall) Fields(s ...googleapi.Field) *AccountsContainersTagsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsContainersTagsGetCall) IfNoneMatch(entityTag string) *AccountsContainersTagsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersTagsGetCall) Context(ctx context.Context) *AccountsContainersTagsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersTagsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/tags/{tagId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + "tagId": c.tagId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.tags.get" call. +// Exactly one of *Tag or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Tag.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AccountsContainersTagsGetCall) Do() (*Tag, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Tag{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a GTM Tag.", + // "httpMethod": "GET", + // "id": "tagmanager.accounts.containers.tags.get", + // "parameterOrder": [ + // "accountId", + // "containerId", + // "tagId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "tagId": { + // "description": "The GTM Tag ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/tags/{tagId}", + // "response": { + // "$ref": "Tag" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers", + // "https://www.googleapis.com/auth/tagmanager.readonly" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.tags.list": + +type AccountsContainersTagsListCall struct { + s *Service + accountId string + containerId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all GTM Tags of a Container. +func (r *AccountsContainersTagsService) List(accountId string, containerId string) *AccountsContainersTagsListCall { + c := &AccountsContainersTagsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersTagsListCall) Fields(s ...googleapi.Field) *AccountsContainersTagsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsContainersTagsListCall) IfNoneMatch(entityTag string) *AccountsContainersTagsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersTagsListCall) Context(ctx context.Context) *AccountsContainersTagsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersTagsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/tags") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.tags.list" call. +// Exactly one of *ListTagsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListTagsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsContainersTagsListCall) Do() (*ListTagsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListTagsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all GTM Tags of a Container.", + // "httpMethod": "GET", + // "id": "tagmanager.accounts.containers.tags.list", + // "parameterOrder": [ + // "accountId", + // "containerId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/tags", + // "response": { + // "$ref": "ListTagsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers", + // "https://www.googleapis.com/auth/tagmanager.readonly" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.tags.update": + +type AccountsContainersTagsUpdateCall struct { + s *Service + accountId string + containerId string + tagId string + tag *Tag + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a GTM Tag. +func (r *AccountsContainersTagsService) Update(accountId string, containerId string, tagId string, tag *Tag) *AccountsContainersTagsUpdateCall { + c := &AccountsContainersTagsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + c.tagId = tagId + c.tag = tag + return c +} + +// Fingerprint sets the optional parameter "fingerprint": When provided, +// this fingerprint must match the fingerprint of the tag in storage. +func (c *AccountsContainersTagsUpdateCall) Fingerprint(fingerprint string) *AccountsContainersTagsUpdateCall { + c.opt_["fingerprint"] = fingerprint + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersTagsUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersTagsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersTagsUpdateCall) Context(ctx context.Context) *AccountsContainersTagsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersTagsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.tag) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fingerprint"]; ok { + params.Set("fingerprint", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/tags/{tagId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + "tagId": c.tagId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.tags.update" call. +// Exactly one of *Tag or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Tag.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *AccountsContainersTagsUpdateCall) Do() (*Tag, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Tag{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a GTM Tag.", + // "httpMethod": "PUT", + // "id": "tagmanager.accounts.containers.tags.update", + // "parameterOrder": [ + // "accountId", + // "containerId", + // "tagId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fingerprint": { + // "description": "When provided, this fingerprint must match the fingerprint of the tag in storage.", + // "location": "query", + // "type": "string" + // }, + // "tagId": { + // "description": "The GTM Tag ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/tags/{tagId}", + // "request": { + // "$ref": "Tag" + // }, + // "response": { + // "$ref": "Tag" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.triggers.create": + +type AccountsContainersTriggersCreateCall struct { + s *Service + accountId string + containerId string + trigger *Trigger + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a GTM Trigger. +func (r *AccountsContainersTriggersService) Create(accountId string, containerId string, trigger *Trigger) *AccountsContainersTriggersCreateCall { + c := &AccountsContainersTriggersCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + c.trigger = trigger + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersTriggersCreateCall) Fields(s ...googleapi.Field) *AccountsContainersTriggersCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersTriggersCreateCall) Context(ctx context.Context) *AccountsContainersTriggersCreateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersTriggersCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.trigger) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/triggers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.triggers.create" call. +// Exactly one of *Trigger or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Trigger.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsContainersTriggersCreateCall) Do() (*Trigger, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Trigger{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a GTM Trigger.", + // "httpMethod": "POST", + // "id": "tagmanager.accounts.containers.triggers.create", + // "parameterOrder": [ + // "accountId", + // "containerId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/triggers", + // "request": { + // "$ref": "Trigger" + // }, + // "response": { + // "$ref": "Trigger" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.triggers.delete": + +type AccountsContainersTriggersDeleteCall struct { + s *Service + accountId string + containerId string + triggerId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a GTM Trigger. +func (r *AccountsContainersTriggersService) Delete(accountId string, containerId string, triggerId string) *AccountsContainersTriggersDeleteCall { + c := &AccountsContainersTriggersDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + c.triggerId = triggerId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersTriggersDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersTriggersDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersTriggersDeleteCall) Context(ctx context.Context) *AccountsContainersTriggersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersTriggersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/triggers/{triggerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + "triggerId": c.triggerId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.triggers.delete" call. +func (c *AccountsContainersTriggersDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a GTM Trigger.", + // "httpMethod": "DELETE", + // "id": "tagmanager.accounts.containers.triggers.delete", + // "parameterOrder": [ + // "accountId", + // "containerId", + // "triggerId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "triggerId": { + // "description": "The GTM Trigger ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/triggers/{triggerId}", + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.triggers.get": + +type AccountsContainersTriggersGetCall struct { + s *Service + accountId string + containerId string + triggerId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a GTM Trigger. +func (r *AccountsContainersTriggersService) Get(accountId string, containerId string, triggerId string) *AccountsContainersTriggersGetCall { + c := &AccountsContainersTriggersGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + c.triggerId = triggerId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersTriggersGetCall) Fields(s ...googleapi.Field) *AccountsContainersTriggersGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsContainersTriggersGetCall) IfNoneMatch(entityTag string) *AccountsContainersTriggersGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersTriggersGetCall) Context(ctx context.Context) *AccountsContainersTriggersGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersTriggersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/triggers/{triggerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + "triggerId": c.triggerId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.triggers.get" call. +// Exactly one of *Trigger or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Trigger.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsContainersTriggersGetCall) Do() (*Trigger, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Trigger{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a GTM Trigger.", + // "httpMethod": "GET", + // "id": "tagmanager.accounts.containers.triggers.get", + // "parameterOrder": [ + // "accountId", + // "containerId", + // "triggerId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "triggerId": { + // "description": "The GTM Trigger ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/triggers/{triggerId}", + // "response": { + // "$ref": "Trigger" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers", + // "https://www.googleapis.com/auth/tagmanager.readonly" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.triggers.list": + +type AccountsContainersTriggersListCall struct { + s *Service + accountId string + containerId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all GTM Triggers of a Container. +func (r *AccountsContainersTriggersService) List(accountId string, containerId string) *AccountsContainersTriggersListCall { + c := &AccountsContainersTriggersListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersTriggersListCall) Fields(s ...googleapi.Field) *AccountsContainersTriggersListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsContainersTriggersListCall) IfNoneMatch(entityTag string) *AccountsContainersTriggersListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersTriggersListCall) Context(ctx context.Context) *AccountsContainersTriggersListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersTriggersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/triggers") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.triggers.list" call. +// Exactly one of *ListTriggersResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListTriggersResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsContainersTriggersListCall) Do() (*ListTriggersResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListTriggersResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all GTM Triggers of a Container.", + // "httpMethod": "GET", + // "id": "tagmanager.accounts.containers.triggers.list", + // "parameterOrder": [ + // "accountId", + // "containerId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/triggers", + // "response": { + // "$ref": "ListTriggersResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers", + // "https://www.googleapis.com/auth/tagmanager.readonly" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.triggers.update": + +type AccountsContainersTriggersUpdateCall struct { + s *Service + accountId string + containerId string + triggerId string + trigger *Trigger + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a GTM Trigger. +func (r *AccountsContainersTriggersService) Update(accountId string, containerId string, triggerId string, trigger *Trigger) *AccountsContainersTriggersUpdateCall { + c := &AccountsContainersTriggersUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + c.triggerId = triggerId + c.trigger = trigger + return c +} + +// Fingerprint sets the optional parameter "fingerprint": When provided, +// this fingerprint must match the fingerprint of the trigger in +// storage. +func (c *AccountsContainersTriggersUpdateCall) Fingerprint(fingerprint string) *AccountsContainersTriggersUpdateCall { + c.opt_["fingerprint"] = fingerprint + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersTriggersUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersTriggersUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersTriggersUpdateCall) Context(ctx context.Context) *AccountsContainersTriggersUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersTriggersUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.trigger) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fingerprint"]; ok { + params.Set("fingerprint", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/triggers/{triggerId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + "triggerId": c.triggerId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.triggers.update" call. +// Exactly one of *Trigger or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Trigger.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AccountsContainersTriggersUpdateCall) Do() (*Trigger, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Trigger{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a GTM Trigger.", + // "httpMethod": "PUT", + // "id": "tagmanager.accounts.containers.triggers.update", + // "parameterOrder": [ + // "accountId", + // "containerId", + // "triggerId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fingerprint": { + // "description": "When provided, this fingerprint must match the fingerprint of the trigger in storage.", + // "location": "query", + // "type": "string" + // }, + // "triggerId": { + // "description": "The GTM Trigger ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/triggers/{triggerId}", + // "request": { + // "$ref": "Trigger" + // }, + // "response": { + // "$ref": "Trigger" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.variables.create": + +type AccountsContainersVariablesCreateCall struct { + s *Service + accountId string + containerId string + variable *Variable + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a GTM Variable. +func (r *AccountsContainersVariablesService) Create(accountId string, containerId string, variable *Variable) *AccountsContainersVariablesCreateCall { + c := &AccountsContainersVariablesCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + c.variable = variable + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersVariablesCreateCall) Fields(s ...googleapi.Field) *AccountsContainersVariablesCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersVariablesCreateCall) Context(ctx context.Context) *AccountsContainersVariablesCreateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersVariablesCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.variable) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/variables") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.variables.create" call. +// Exactly one of *Variable or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Variable.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsContainersVariablesCreateCall) Do() (*Variable, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Variable{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a GTM Variable.", + // "httpMethod": "POST", + // "id": "tagmanager.accounts.containers.variables.create", + // "parameterOrder": [ + // "accountId", + // "containerId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/variables", + // "request": { + // "$ref": "Variable" + // }, + // "response": { + // "$ref": "Variable" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.variables.delete": + +type AccountsContainersVariablesDeleteCall struct { + s *Service + accountId string + containerId string + variableId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a GTM Variable. +func (r *AccountsContainersVariablesService) Delete(accountId string, containerId string, variableId string) *AccountsContainersVariablesDeleteCall { + c := &AccountsContainersVariablesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + c.variableId = variableId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersVariablesDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersVariablesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersVariablesDeleteCall) Context(ctx context.Context) *AccountsContainersVariablesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersVariablesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/variables/{variableId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + "variableId": c.variableId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.variables.delete" call. +func (c *AccountsContainersVariablesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a GTM Variable.", + // "httpMethod": "DELETE", + // "id": "tagmanager.accounts.containers.variables.delete", + // "parameterOrder": [ + // "accountId", + // "containerId", + // "variableId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "variableId": { + // "description": "The GTM Variable ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/variables/{variableId}", + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.variables.get": + +type AccountsContainersVariablesGetCall struct { + s *Service + accountId string + containerId string + variableId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a GTM Variable. +func (r *AccountsContainersVariablesService) Get(accountId string, containerId string, variableId string) *AccountsContainersVariablesGetCall { + c := &AccountsContainersVariablesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + c.variableId = variableId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersVariablesGetCall) Fields(s ...googleapi.Field) *AccountsContainersVariablesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsContainersVariablesGetCall) IfNoneMatch(entityTag string) *AccountsContainersVariablesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersVariablesGetCall) Context(ctx context.Context) *AccountsContainersVariablesGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersVariablesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/variables/{variableId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + "variableId": c.variableId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.variables.get" call. +// Exactly one of *Variable or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Variable.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsContainersVariablesGetCall) Do() (*Variable, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Variable{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a GTM Variable.", + // "httpMethod": "GET", + // "id": "tagmanager.accounts.containers.variables.get", + // "parameterOrder": [ + // "accountId", + // "containerId", + // "variableId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "variableId": { + // "description": "The GTM Variable ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/variables/{variableId}", + // "response": { + // "$ref": "Variable" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers", + // "https://www.googleapis.com/auth/tagmanager.readonly" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.variables.list": + +type AccountsContainersVariablesListCall struct { + s *Service + accountId string + containerId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all GTM Variables of a Container. +func (r *AccountsContainersVariablesService) List(accountId string, containerId string) *AccountsContainersVariablesListCall { + c := &AccountsContainersVariablesListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersVariablesListCall) Fields(s ...googleapi.Field) *AccountsContainersVariablesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsContainersVariablesListCall) IfNoneMatch(entityTag string) *AccountsContainersVariablesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersVariablesListCall) Context(ctx context.Context) *AccountsContainersVariablesListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersVariablesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/variables") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.variables.list" call. +// Exactly one of *ListVariablesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListVariablesResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsContainersVariablesListCall) Do() (*ListVariablesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListVariablesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all GTM Variables of a Container.", + // "httpMethod": "GET", + // "id": "tagmanager.accounts.containers.variables.list", + // "parameterOrder": [ + // "accountId", + // "containerId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/variables", + // "response": { + // "$ref": "ListVariablesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers", + // "https://www.googleapis.com/auth/tagmanager.readonly" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.variables.update": + +type AccountsContainersVariablesUpdateCall struct { + s *Service + accountId string + containerId string + variableId string + variable *Variable + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a GTM Variable. +func (r *AccountsContainersVariablesService) Update(accountId string, containerId string, variableId string, variable *Variable) *AccountsContainersVariablesUpdateCall { + c := &AccountsContainersVariablesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + c.variableId = variableId + c.variable = variable + return c +} + +// Fingerprint sets the optional parameter "fingerprint": When provided, +// this fingerprint must match the fingerprint of the variable in +// storage. +func (c *AccountsContainersVariablesUpdateCall) Fingerprint(fingerprint string) *AccountsContainersVariablesUpdateCall { + c.opt_["fingerprint"] = fingerprint + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersVariablesUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersVariablesUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersVariablesUpdateCall) Context(ctx context.Context) *AccountsContainersVariablesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersVariablesUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.variable) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fingerprint"]; ok { + params.Set("fingerprint", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/variables/{variableId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + "variableId": c.variableId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.variables.update" call. +// Exactly one of *Variable or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Variable.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsContainersVariablesUpdateCall) Do() (*Variable, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Variable{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a GTM Variable.", + // "httpMethod": "PUT", + // "id": "tagmanager.accounts.containers.variables.update", + // "parameterOrder": [ + // "accountId", + // "containerId", + // "variableId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fingerprint": { + // "description": "When provided, this fingerprint must match the fingerprint of the variable in storage.", + // "location": "query", + // "type": "string" + // }, + // "variableId": { + // "description": "The GTM Variable ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/variables/{variableId}", + // "request": { + // "$ref": "Variable" + // }, + // "response": { + // "$ref": "Variable" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.versions.create": + +type AccountsContainersVersionsCreateCall struct { + s *Service + accountId string + containerId string + createcontainerversionrequestversionoptions *CreateContainerVersionRequestVersionOptions + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a Container Version. +func (r *AccountsContainersVersionsService) Create(accountId string, containerId string, createcontainerversionrequestversionoptions *CreateContainerVersionRequestVersionOptions) *AccountsContainersVersionsCreateCall { + c := &AccountsContainersVersionsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + c.createcontainerversionrequestversionoptions = createcontainerversionrequestversionoptions + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersVersionsCreateCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersVersionsCreateCall) Context(ctx context.Context) *AccountsContainersVersionsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersVersionsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.createcontainerversionrequestversionoptions) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/versions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.versions.create" call. +// Exactly one of *CreateContainerVersionResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *CreateContainerVersionResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsContainersVersionsCreateCall) Do() (*CreateContainerVersionResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &CreateContainerVersionResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a Container Version.", + // "httpMethod": "POST", + // "id": "tagmanager.accounts.containers.versions.create", + // "parameterOrder": [ + // "accountId", + // "containerId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/versions", + // "request": { + // "$ref": "CreateContainerVersionRequestVersionOptions" + // }, + // "response": { + // "$ref": "CreateContainerVersionResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containerversions" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.versions.delete": + +type AccountsContainersVersionsDeleteCall struct { + s *Service + accountId string + containerId string + containerVersionId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a Container Version. +func (r *AccountsContainersVersionsService) Delete(accountId string, containerId string, containerVersionId string) *AccountsContainersVersionsDeleteCall { + c := &AccountsContainersVersionsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + c.containerVersionId = containerVersionId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersVersionsDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersVersionsDeleteCall) Context(ctx context.Context) *AccountsContainersVersionsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersVersionsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + "containerVersionId": c.containerVersionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.versions.delete" call. +func (c *AccountsContainersVersionsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a Container Version.", + // "httpMethod": "DELETE", + // "id": "tagmanager.accounts.containers.versions.delete", + // "parameterOrder": [ + // "accountId", + // "containerId", + // "containerVersionId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerVersionId": { + // "description": "The GTM Container Version ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}", + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containerversions" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.versions.get": + +type AccountsContainersVersionsGetCall struct { + s *Service + accountId string + containerId string + containerVersionId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a Container Version. +func (r *AccountsContainersVersionsService) Get(accountId string, containerId string, containerVersionId string) *AccountsContainersVersionsGetCall { + c := &AccountsContainersVersionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + c.containerVersionId = containerVersionId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersVersionsGetCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsContainersVersionsGetCall) IfNoneMatch(entityTag string) *AccountsContainersVersionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersVersionsGetCall) Context(ctx context.Context) *AccountsContainersVersionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersVersionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + "containerVersionId": c.containerVersionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.versions.get" call. +// Exactly one of *ContainerVersion or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ContainerVersion.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsContainersVersionsGetCall) Do() (*ContainerVersion, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ContainerVersion{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a Container Version.", + // "httpMethod": "GET", + // "id": "tagmanager.accounts.containers.versions.get", + // "parameterOrder": [ + // "accountId", + // "containerId", + // "containerVersionId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerVersionId": { + // "description": "The GTM Container Version ID. Specify published to retrieve the currently published version.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}", + // "response": { + // "$ref": "ContainerVersion" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers", + // "https://www.googleapis.com/auth/tagmanager.edit.containerversions", + // "https://www.googleapis.com/auth/tagmanager.readonly" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.versions.list": + +type AccountsContainersVersionsListCall struct { + s *Service + accountId string + containerId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists all Container Versions of a GTM Container. +func (r *AccountsContainersVersionsService) List(accountId string, containerId string) *AccountsContainersVersionsListCall { + c := &AccountsContainersVersionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + return c +} + +// Headers sets the optional parameter "headers": Retrieve headers only +// when true. +func (c *AccountsContainersVersionsListCall) Headers(headers bool) *AccountsContainersVersionsListCall { + c.opt_["headers"] = headers + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersVersionsListCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsContainersVersionsListCall) IfNoneMatch(entityTag string) *AccountsContainersVersionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersVersionsListCall) Context(ctx context.Context) *AccountsContainersVersionsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersVersionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["headers"]; ok { + params.Set("headers", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/versions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.versions.list" call. +// Exactly one of *ListContainerVersionsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListContainerVersionsResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsContainersVersionsListCall) Do() (*ListContainerVersionsResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListContainerVersionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all Container Versions of a GTM Container.", + // "httpMethod": "GET", + // "id": "tagmanager.accounts.containers.versions.list", + // "parameterOrder": [ + // "accountId", + // "containerId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "headers": { + // "default": "false", + // "description": "Retrieve headers only when true.", + // "location": "query", + // "type": "boolean" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/versions", + // "response": { + // "$ref": "ListContainerVersionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers", + // "https://www.googleapis.com/auth/tagmanager.edit.containerversions", + // "https://www.googleapis.com/auth/tagmanager.readonly" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.versions.publish": + +type AccountsContainersVersionsPublishCall struct { + s *Service + accountId string + containerId string + containerVersionId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Publish: Publishes a Container Version. +func (r *AccountsContainersVersionsService) Publish(accountId string, containerId string, containerVersionId string) *AccountsContainersVersionsPublishCall { + c := &AccountsContainersVersionsPublishCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + c.containerVersionId = containerVersionId + return c +} + +// Fingerprint sets the optional parameter "fingerprint": When provided, +// this fingerprint must match the fingerprint of the container version +// in storage. +func (c *AccountsContainersVersionsPublishCall) Fingerprint(fingerprint string) *AccountsContainersVersionsPublishCall { + c.opt_["fingerprint"] = fingerprint + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersVersionsPublishCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsPublishCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersVersionsPublishCall) Context(ctx context.Context) *AccountsContainersVersionsPublishCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersVersionsPublishCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fingerprint"]; ok { + params.Set("fingerprint", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/publish") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + "containerVersionId": c.containerVersionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.versions.publish" call. +// Exactly one of *PublishContainerVersionResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *PublishContainerVersionResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsContainersVersionsPublishCall) Do() (*PublishContainerVersionResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &PublishContainerVersionResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Publishes a Container Version.", + // "httpMethod": "POST", + // "id": "tagmanager.accounts.containers.versions.publish", + // "parameterOrder": [ + // "accountId", + // "containerId", + // "containerVersionId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerVersionId": { + // "description": "The GTM Container Version ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fingerprint": { + // "description": "When provided, this fingerprint must match the fingerprint of the container version in storage.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/publish", + // "response": { + // "$ref": "PublishContainerVersionResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.publish" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.versions.restore": + +type AccountsContainersVersionsRestoreCall struct { + s *Service + accountId string + containerId string + containerVersionId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Restore: Restores a Container Version. This will overwrite the +// container's current configuration (including its variables, triggers +// and tags). The operation will not have any effect on the version that +// is being served (i.e. the published version). +func (r *AccountsContainersVersionsService) Restore(accountId string, containerId string, containerVersionId string) *AccountsContainersVersionsRestoreCall { + c := &AccountsContainersVersionsRestoreCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + c.containerVersionId = containerVersionId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersVersionsRestoreCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsRestoreCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersVersionsRestoreCall) Context(ctx context.Context) *AccountsContainersVersionsRestoreCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersVersionsRestoreCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/restore") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + "containerVersionId": c.containerVersionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.versions.restore" call. +// Exactly one of *ContainerVersion or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ContainerVersion.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsContainersVersionsRestoreCall) Do() (*ContainerVersion, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ContainerVersion{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Restores a Container Version. This will overwrite the container's current configuration (including its variables, triggers and tags). The operation will not have any effect on the version that is being served (i.e. the published version).", + // "httpMethod": "POST", + // "id": "tagmanager.accounts.containers.versions.restore", + // "parameterOrder": [ + // "accountId", + // "containerId", + // "containerVersionId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerVersionId": { + // "description": "The GTM Container Version ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/restore", + // "response": { + // "$ref": "ContainerVersion" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containers" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.versions.undelete": + +type AccountsContainersVersionsUndeleteCall struct { + s *Service + accountId string + containerId string + containerVersionId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Undelete: Undeletes a Container Version. +func (r *AccountsContainersVersionsService) Undelete(accountId string, containerId string, containerVersionId string) *AccountsContainersVersionsUndeleteCall { + c := &AccountsContainersVersionsUndeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + c.containerVersionId = containerVersionId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersVersionsUndeleteCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsUndeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersVersionsUndeleteCall) Context(ctx context.Context) *AccountsContainersVersionsUndeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersVersionsUndeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/undelete") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + "containerVersionId": c.containerVersionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.versions.undelete" call. +// Exactly one of *ContainerVersion or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ContainerVersion.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsContainersVersionsUndeleteCall) Do() (*ContainerVersion, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ContainerVersion{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Undeletes a Container Version.", + // "httpMethod": "POST", + // "id": "tagmanager.accounts.containers.versions.undelete", + // "parameterOrder": [ + // "accountId", + // "containerId", + // "containerVersionId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerVersionId": { + // "description": "The GTM Container Version ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/undelete", + // "response": { + // "$ref": "ContainerVersion" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containerversions" + // ] + // } + +} + +// method id "tagmanager.accounts.containers.versions.update": + +type AccountsContainersVersionsUpdateCall struct { + s *Service + accountId string + containerId string + containerVersionId string + containerversion *ContainerVersion + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a Container Version. +func (r *AccountsContainersVersionsService) Update(accountId string, containerId string, containerVersionId string, containerversion *ContainerVersion) *AccountsContainersVersionsUpdateCall { + c := &AccountsContainersVersionsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.containerId = containerId + c.containerVersionId = containerVersionId + c.containerversion = containerversion + return c +} + +// Fingerprint sets the optional parameter "fingerprint": When provided, +// this fingerprint must match the fingerprint of the container version +// in storage. +func (c *AccountsContainersVersionsUpdateCall) Fingerprint(fingerprint string) *AccountsContainersVersionsUpdateCall { + c.opt_["fingerprint"] = fingerprint + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsContainersVersionsUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsContainersVersionsUpdateCall) Context(ctx context.Context) *AccountsContainersVersionsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsContainersVersionsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.containerversion) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fingerprint"]; ok { + params.Set("fingerprint", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "containerId": c.containerId, + "containerVersionId": c.containerVersionId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.containers.versions.update" call. +// Exactly one of *ContainerVersion or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ContainerVersion.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsContainersVersionsUpdateCall) Do() (*ContainerVersion, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ContainerVersion{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a Container Version.", + // "httpMethod": "PUT", + // "id": "tagmanager.accounts.containers.versions.update", + // "parameterOrder": [ + // "accountId", + // "containerId", + // "containerVersionId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerId": { + // "description": "The GTM Container ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "containerVersionId": { + // "description": "The GTM Container Version ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "fingerprint": { + // "description": "When provided, this fingerprint must match the fingerprint of the container version in storage.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}", + // "request": { + // "$ref": "ContainerVersion" + // }, + // "response": { + // "$ref": "ContainerVersion" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.edit.containerversions" + // ] + // } + +} + +// method id "tagmanager.accounts.permissions.create": + +type AccountsPermissionsCreateCall struct { + s *Service + accountId string + useraccess *UserAccess + opt_ map[string]interface{} + ctx_ context.Context +} + +// Create: Creates a user's Account & Container Permissions. +func (r *AccountsPermissionsService) Create(accountId string, useraccess *UserAccess) *AccountsPermissionsCreateCall { + c := &AccountsPermissionsCreateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.useraccess = useraccess + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsPermissionsCreateCall) Fields(s ...googleapi.Field) *AccountsPermissionsCreateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsPermissionsCreateCall) Context(ctx context.Context) *AccountsPermissionsCreateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsPermissionsCreateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.useraccess) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/permissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.permissions.create" call. +// Exactly one of *UserAccess or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UserAccess.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsPermissionsCreateCall) Do() (*UserAccess, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserAccess{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a user's Account \u0026 Container Permissions.", + // "httpMethod": "POST", + // "id": "tagmanager.accounts.permissions.create", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/permissions", + // "request": { + // "$ref": "UserAccess" + // }, + // "response": { + // "$ref": "UserAccess" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.manage.users" + // ] + // } + +} + +// method id "tagmanager.accounts.permissions.delete": + +type AccountsPermissionsDeleteCall struct { + s *Service + accountId string + permissionId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Removes a user from the account, revoking access to it and +// all of its containers. +func (r *AccountsPermissionsService) Delete(accountId string, permissionId string) *AccountsPermissionsDeleteCall { + c := &AccountsPermissionsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.permissionId = permissionId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsPermissionsDeleteCall) Fields(s ...googleapi.Field) *AccountsPermissionsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsPermissionsDeleteCall) Context(ctx context.Context) *AccountsPermissionsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsPermissionsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/permissions/{permissionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "permissionId": c.permissionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.permissions.delete" call. +func (c *AccountsPermissionsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Removes a user from the account, revoking access to it and all of its containers.", + // "httpMethod": "DELETE", + // "id": "tagmanager.accounts.permissions.delete", + // "parameterOrder": [ + // "accountId", + // "permissionId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "permissionId": { + // "description": "The GTM User ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/permissions/{permissionId}", + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.manage.users" + // ] + // } + +} + +// method id "tagmanager.accounts.permissions.get": + +type AccountsPermissionsGetCall struct { + s *Service + accountId string + permissionId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Gets a user's Account & Container Permissions. +func (r *AccountsPermissionsService) Get(accountId string, permissionId string) *AccountsPermissionsGetCall { + c := &AccountsPermissionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.permissionId = permissionId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsPermissionsGetCall) Fields(s ...googleapi.Field) *AccountsPermissionsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsPermissionsGetCall) IfNoneMatch(entityTag string) *AccountsPermissionsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsPermissionsGetCall) Context(ctx context.Context) *AccountsPermissionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsPermissionsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/permissions/{permissionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "permissionId": c.permissionId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.permissions.get" call. +// Exactly one of *UserAccess or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UserAccess.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsPermissionsGetCall) Do() (*UserAccess, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserAccess{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets a user's Account \u0026 Container Permissions.", + // "httpMethod": "GET", + // "id": "tagmanager.accounts.permissions.get", + // "parameterOrder": [ + // "accountId", + // "permissionId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "permissionId": { + // "description": "The GTM User ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/permissions/{permissionId}", + // "response": { + // "$ref": "UserAccess" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.manage.users" + // ] + // } + +} + +// method id "tagmanager.accounts.permissions.list": + +type AccountsPermissionsListCall struct { + s *Service + accountId string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: List all users that have access to the account along with +// Account and Container Permissions granted to each of them. +func (r *AccountsPermissionsService) List(accountId string) *AccountsPermissionsListCall { + c := &AccountsPermissionsListCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsPermissionsListCall) Fields(s ...googleapi.Field) *AccountsPermissionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AccountsPermissionsListCall) IfNoneMatch(entityTag string) *AccountsPermissionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsPermissionsListCall) Context(ctx context.Context) *AccountsPermissionsListCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsPermissionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/permissions") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.permissions.list" call. +// Exactly one of *ListAccountUsersResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *ListAccountUsersResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AccountsPermissionsListCall) Do() (*ListAccountUsersResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &ListAccountUsersResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List all users that have access to the account along with Account and Container Permissions granted to each of them.", + // "httpMethod": "GET", + // "id": "tagmanager.accounts.permissions.list", + // "parameterOrder": [ + // "accountId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID. @required tagmanager.accounts.permissions.list", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/permissions", + // "response": { + // "$ref": "ListAccountUsersResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.manage.users" + // ] + // } + +} + +// method id "tagmanager.accounts.permissions.update": + +type AccountsPermissionsUpdateCall struct { + s *Service + accountId string + permissionId string + useraccess *UserAccess + opt_ map[string]interface{} + ctx_ context.Context +} + +// Update: Updates a user's Account & Container Permissions. +func (r *AccountsPermissionsService) Update(accountId string, permissionId string, useraccess *UserAccess) *AccountsPermissionsUpdateCall { + c := &AccountsPermissionsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c.accountId = accountId + c.permissionId = permissionId + c.useraccess = useraccess + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AccountsPermissionsUpdateCall) Fields(s ...googleapi.Field) *AccountsPermissionsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *AccountsPermissionsUpdateCall) Context(ctx context.Context) *AccountsPermissionsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AccountsPermissionsUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.useraccess) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/permissions/{permissionId}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "accountId": c.accountId, + "permissionId": c.permissionId, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tagmanager.accounts.permissions.update" call. +// Exactly one of *UserAccess or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UserAccess.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AccountsPermissionsUpdateCall) Do() (*UserAccess, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UserAccess{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a user's Account \u0026 Container Permissions.", + // "httpMethod": "PUT", + // "id": "tagmanager.accounts.permissions.update", + // "parameterOrder": [ + // "accountId", + // "permissionId" + // ], + // "parameters": { + // "accountId": { + // "description": "The GTM Account ID.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "permissionId": { + // "description": "The GTM User ID.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "accounts/{accountId}/permissions/{permissionId}", + // "request": { + // "$ref": "UserAccess" + // }, + // "response": { + // "$ref": "UserAccess" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/tagmanager.manage.users" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/taskqueue/v1beta1/taskqueue-api.json b/Godeps/_workspace/src/google.golang.org/api/taskqueue/v1beta1/taskqueue-api.json new file mode 100644 index 000000000..f2b5406e0 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/taskqueue/v1beta1/taskqueue-api.json @@ -0,0 +1,422 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/xnLtIe0CIvW_kIgCrq0S6VocjyE\"", + "discoveryVersion": "v1", + "id": "taskqueue:v1beta1", + "name": "taskqueue", + "version": "v1beta1", + "revision": "20141111", + "title": "TaskQueue API", + "description": "Lets you access a Google App Engine Pull Task Queue over REST.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/app_engine-16.png", + "x32": "https://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/Godeps/_workspace/src/google.golang.org/api/taskqueue/v1beta1/taskqueue-gen.go b/Godeps/_workspace/src/google.golang.org/api/taskqueue/v1beta1/taskqueue-gen.go new file mode 100644 index 000000000..f619988c4 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/taskqueue/v1beta1/taskqueue-gen.go @@ -0,0 +1,982 @@ +// Package taskqueue provides access to the TaskQueue API. +// +// See https://developers.google.com/appengine/docs/python/taskqueue/rest +// +// Usage example: +// +// import "google.golang.org/api/taskqueue/v1beta1" +// ... +// taskqueueService, err := taskqueue.New(oauthHttpClient) +package taskqueue // import "google.golang.org/api/taskqueue/v1beta1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Taskqueues *TaskqueuesService + + Tasks *TasksService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "EnqueueTimestamp") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Task) MarshalJSON() ([]byte, error) { + type noMethod Task + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Acl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TaskQueue) MarshalJSON() ([]byte, error) { + type noMethod TaskQueue + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TaskQueueAcl: ACLs that are applicable to this TaskQueue object. +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"` + + // ForceSendFields is a list of field names (e.g. "AdminEmails") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TaskQueueAcl) MarshalJSON() ([]byte, error) { + type noMethod TaskQueueAcl + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TaskQueueStats: Statistics for the TaskQueue object in question. +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"` + + // ForceSendFields is a list of field names (e.g. "LeasedLastHour") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TaskQueueStats) MarshalJSON() ([]byte, error) { + type noMethod TaskQueueStats + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Tasks) MarshalJSON() ([]byte, error) { + type noMethod Tasks + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Tasks2) MarshalJSON() ([]byte, error) { + type noMethod Tasks2 + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "taskqueue.taskqueues.get": + +type TaskqueuesGetCall struct { + s *Service + project string + taskqueue string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TaskqueuesGetCall) Fields(s ...googleapi.Field) *TaskqueuesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TaskqueuesGetCall) IfNoneMatch(entityTag string) *TaskqueuesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TaskqueuesGetCall) Context(ctx context.Context) *TaskqueuesGetCall { + c.ctx_ = ctx + return c +} + +func (c *TaskqueuesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["getStats"]; ok { + params.Set("getStats", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "taskqueue": c.taskqueue, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "taskqueue.taskqueues.get" call. +// Exactly one of *TaskQueue or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TaskQueue.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TaskqueuesGetCall) Do() (*TaskQueue, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TaskQueue{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TasksDeleteCall) Fields(s ...googleapi.Field) *TasksDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TasksDeleteCall) Context(ctx context.Context) *TasksDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TasksDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks/{task}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "taskqueue": c.taskqueue, + "task": c.task, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "taskqueue.tasks.delete" call. +func (c *TasksDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TasksGetCall) Fields(s ...googleapi.Field) *TasksGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TasksGetCall) IfNoneMatch(entityTag string) *TasksGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TasksGetCall) Context(ctx context.Context) *TasksGetCall { + c.ctx_ = ctx + return c +} + +func (c *TasksGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks/{task}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "taskqueue": c.taskqueue, + "task": c.task, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "taskqueue.tasks.get" call. +// Exactly one of *Task or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Task.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *TasksGetCall) Do() (*Task, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Task{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TasksLeaseCall) Fields(s ...googleapi.Field) *TasksLeaseCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TasksLeaseCall) Context(ctx context.Context) *TasksLeaseCall { + c.ctx_ = ctx + return c +} + +func (c *TasksLeaseCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("leaseSecs", fmt.Sprintf("%v", c.leaseSecs)) + params.Set("numTasks", fmt.Sprintf("%v", c.numTasks)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks/lease") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "taskqueue": c.taskqueue, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "taskqueue.tasks.lease" call. +// Exactly one of *Tasks or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Tasks.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TasksLeaseCall) Do() (*Tasks, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Tasks{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TasksListCall) Fields(s ...googleapi.Field) *TasksListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TasksListCall) IfNoneMatch(entityTag string) *TasksListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TasksListCall) Context(ctx context.Context) *TasksListCall { + c.ctx_ = ctx + return c +} + +func (c *TasksListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "taskqueue": c.taskqueue, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "taskqueue.tasks.list" call. +// Exactly one of *Tasks2 or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Tasks2.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TasksListCall) Do() (*Tasks2, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Tasks2{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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/Godeps/_workspace/src/google.golang.org/api/taskqueue/v1beta2/taskqueue-api.json b/Godeps/_workspace/src/google.golang.org/api/taskqueue/v1beta2/taskqueue-api.json new file mode 100644 index 000000000..1752f903f --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/taskqueue/v1beta2/taskqueue-api.json @@ -0,0 +1,569 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/LPLXKKjaGUbCz_MfuhQ-STkNWfw\"", + "discoveryVersion": "v1", + "id": "taskqueue:v1beta2", + "name": "taskqueue", + "version": "v1beta2", + "revision": "20141111", + "title": "TaskQueue API", + "description": "Lets you access a Google App Engine Pull Task Queue over REST.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/app_engine-16.png", + "x32": "https://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/Godeps/_workspace/src/google.golang.org/api/taskqueue/v1beta2/taskqueue-gen.go b/Godeps/_workspace/src/google.golang.org/api/taskqueue/v1beta2/taskqueue-gen.go new file mode 100644 index 000000000..8837ec14f --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/taskqueue/v1beta2/taskqueue-gen.go @@ -0,0 +1,1465 @@ +// Package taskqueue provides access to the TaskQueue API. +// +// See https://developers.google.com/appengine/docs/python/taskqueue/rest +// +// Usage example: +// +// import "google.golang.org/api/taskqueue/v1beta2" +// ... +// taskqueueService, err := taskqueue.New(oauthHttpClient) +package taskqueue // import "google.golang.org/api/taskqueue/v1beta2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Taskqueues *TaskqueuesService + + Tasks *TasksService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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"` + + // RetryCount: The number of leases applied to this task. + RetryCount 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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "EnqueueTimestamp") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Task) MarshalJSON() ([]byte, error) { + type noMethod Task + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Acl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TaskQueue) MarshalJSON() ([]byte, error) { + type noMethod TaskQueue + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TaskQueueAcl: ACLs that are applicable to this TaskQueue object. +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"` + + // ForceSendFields is a list of field names (e.g. "AdminEmails") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TaskQueueAcl) MarshalJSON() ([]byte, error) { + type noMethod TaskQueueAcl + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// TaskQueueStats: Statistics for the TaskQueue object in question. +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"` + + // ForceSendFields is a list of field names (e.g. "LeasedLastHour") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TaskQueueStats) MarshalJSON() ([]byte, error) { + type noMethod TaskQueueStats + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Tasks) MarshalJSON() ([]byte, error) { + type noMethod Tasks + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Tasks2) MarshalJSON() ([]byte, error) { + type noMethod Tasks2 + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "taskqueue.taskqueues.get": + +type TaskqueuesGetCall struct { + s *Service + project string + taskqueue string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TaskqueuesGetCall) Fields(s ...googleapi.Field) *TaskqueuesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TaskqueuesGetCall) IfNoneMatch(entityTag string) *TaskqueuesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TaskqueuesGetCall) Context(ctx context.Context) *TaskqueuesGetCall { + c.ctx_ = ctx + return c +} + +func (c *TaskqueuesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["getStats"]; ok { + params.Set("getStats", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "taskqueue": c.taskqueue, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "taskqueue.taskqueues.get" call. +// Exactly one of *TaskQueue or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TaskQueue.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TaskqueuesGetCall) Do() (*TaskQueue, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TaskQueue{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TasksDeleteCall) Fields(s ...googleapi.Field) *TasksDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TasksDeleteCall) Context(ctx context.Context) *TasksDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TasksDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks/{task}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "taskqueue": c.taskqueue, + "task": c.task, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "taskqueue.tasks.delete" call. +func (c *TasksDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Delete a 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TasksGetCall) Fields(s ...googleapi.Field) *TasksGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TasksGetCall) IfNoneMatch(entityTag string) *TasksGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TasksGetCall) Context(ctx context.Context) *TasksGetCall { + c.ctx_ = ctx + return c +} + +func (c *TasksGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks/{task}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "taskqueue": c.taskqueue, + "task": c.task, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "taskqueue.tasks.get" call. +// Exactly one of *Task or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Task.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *TasksGetCall) Do() (*Task, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Task{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TasksInsertCall) Fields(s ...googleapi.Field) *TasksInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TasksInsertCall) Context(ctx context.Context) *TasksInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TasksInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "taskqueue": c.taskqueue, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "taskqueue.tasks.insert" call. +// Exactly one of *Task or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Task.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *TasksInsertCall) Do() (*Task, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Task{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TasksLeaseCall) Fields(s ...googleapi.Field) *TasksLeaseCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TasksLeaseCall) Context(ctx context.Context) *TasksLeaseCall { + c.ctx_ = ctx + return c +} + +func (c *TasksLeaseCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks/lease") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "taskqueue": c.taskqueue, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "taskqueue.tasks.lease" call. +// Exactly one of *Tasks or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Tasks.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TasksLeaseCall) Do() (*Tasks, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Tasks{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TasksListCall) Fields(s ...googleapi.Field) *TasksListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TasksListCall) IfNoneMatch(entityTag string) *TasksListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TasksListCall) Context(ctx context.Context) *TasksListCall { + c.ctx_ = ctx + return c +} + +func (c *TasksListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "taskqueue": c.taskqueue, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "taskqueue.tasks.list" call. +// Exactly one of *Tasks2 or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Tasks2.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TasksListCall) Do() (*Tasks2, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Tasks2{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TasksPatchCall) Fields(s ...googleapi.Field) *TasksPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TasksPatchCall) Context(ctx context.Context) *TasksPatchCall { + c.ctx_ = ctx + return c +} + +func (c *TasksPatchCall) doRequest(alt string) (*http.Response, 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", alt) + params.Set("newLeaseSeconds", fmt.Sprintf("%v", c.newLeaseSeconds)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks/{task}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "taskqueue": c.taskqueue, + "task": c.task, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "taskqueue.tasks.patch" call. +// Exactly one of *Task or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Task.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *TasksPatchCall) Do() (*Task, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Task{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TasksUpdateCall) Fields(s ...googleapi.Field) *TasksUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TasksUpdateCall) Context(ctx context.Context) *TasksUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *TasksUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + params.Set("newLeaseSeconds", fmt.Sprintf("%v", c.newLeaseSeconds)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/taskqueues/{taskqueue}/tasks/{task}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "taskqueue": c.taskqueue, + "task": c.task, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "taskqueue.tasks.update" call. +// Exactly one of *Task or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Task.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *TasksUpdateCall) Do() (*Task, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Task{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Update 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/Godeps/_workspace/src/google.golang.org/api/tasks/v1/tasks-api.json b/Godeps/_workspace/src/google.golang.org/api/tasks/v1/tasks-api.json new file mode 100644 index 000000000..668e38a5e --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/tasks/v1/tasks-api.json @@ -0,0 +1,696 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/0TjOHp0h7jdMsIEfc7wjsU7Gx9k\"", + "discoveryVersion": "v1", + "id": "tasks:v1", + "name": "tasks", + "version": "v1", + "revision": "20141121", + "title": "Tasks API", + "description": "Lets you manage your tasks and task lists.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/tasks-16.png", + "x32": "https://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/Godeps/_workspace/src/google.golang.org/api/tasks/v1/tasks-gen.go b/Godeps/_workspace/src/google.golang.org/api/tasks/v1/tasks-gen.go new file mode 100644 index 000000000..767a2152f --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/tasks/v1/tasks-gen.go @@ -0,0 +1,2216 @@ +// Package tasks provides access to the Tasks API. +// +// See https://developers.google.com/google-apps/tasks/firstapp +// +// Usage example: +// +// import "google.golang.org/api/tasks/v1" +// ... +// tasksService, err := tasks.New(oauthHttpClient) +package tasks // import "google.golang.org/api/tasks/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Tasklists *TasklistsService + + Tasks *TasksService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Completed") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Task) MarshalJSON() ([]byte, error) { + type noMethod Task + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TaskLinks) MarshalJSON() ([]byte, error) { + type noMethod TaskLinks + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TaskList) MarshalJSON() ([]byte, error) { + type noMethod TaskList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TaskLists) MarshalJSON() ([]byte, error) { + type noMethod TaskLists + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Tasks) MarshalJSON() ([]byte, error) { + type noMethod Tasks + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "tasks.tasklists.delete": + +type TasklistsDeleteCall struct { + s *Service + tasklistid string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TasklistsDeleteCall) Fields(s ...googleapi.Field) *TasklistsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TasklistsDeleteCall) Context(ctx context.Context) *TasklistsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TasklistsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/@me/lists/{tasklist}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tasklist": c.tasklistid, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tasks.tasklists.delete" call. +func (c *TasklistsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TasklistsGetCall) Fields(s ...googleapi.Field) *TasklistsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TasklistsGetCall) IfNoneMatch(entityTag string) *TasklistsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TasklistsGetCall) Context(ctx context.Context) *TasklistsGetCall { + c.ctx_ = ctx + return c +} + +func (c *TasklistsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/@me/lists/{tasklist}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tasklist": c.tasklistid, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tasks.tasklists.get" call. +// Exactly one of *TaskList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *TaskList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TasklistsGetCall) Do() (*TaskList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TaskList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TasklistsInsertCall) Fields(s ...googleapi.Field) *TasklistsInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TasklistsInsertCall) Context(ctx context.Context) *TasklistsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TasklistsInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/@me/lists") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tasks.tasklists.insert" call. +// Exactly one of *TaskList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *TaskList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TasklistsInsertCall) Do() (*TaskList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TaskList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TasklistsListCall) Fields(s ...googleapi.Field) *TasklistsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TasklistsListCall) IfNoneMatch(entityTag string) *TasklistsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TasklistsListCall) Context(ctx context.Context) *TasklistsListCall { + c.ctx_ = ctx + return c +} + +func (c *TasklistsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["maxResults"]; ok { + params.Set("maxResults", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["pageToken"]; ok { + params.Set("pageToken", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/@me/lists") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tasks.tasklists.list" call. +// Exactly one of *TaskLists or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TaskLists.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TasklistsListCall) Do() (*TaskLists, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TaskLists{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TasklistsPatchCall) Fields(s ...googleapi.Field) *TasklistsPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TasklistsPatchCall) Context(ctx context.Context) *TasklistsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *TasklistsPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/@me/lists/{tasklist}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tasklist": c.tasklistid, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tasks.tasklists.patch" call. +// Exactly one of *TaskList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *TaskList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TasklistsPatchCall) Do() (*TaskList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TaskList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TasklistsUpdateCall) Fields(s ...googleapi.Field) *TasklistsUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TasklistsUpdateCall) Context(ctx context.Context) *TasklistsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *TasklistsUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "users/@me/lists/{tasklist}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tasklist": c.tasklistid, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tasks.tasklists.update" call. +// Exactly one of *TaskList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *TaskList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TasklistsUpdateCall) Do() (*TaskList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TaskList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TasksClearCall) Fields(s ...googleapi.Field) *TasksClearCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TasksClearCall) Context(ctx context.Context) *TasksClearCall { + c.ctx_ = ctx + return c +} + +func (c *TasksClearCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "lists/{tasklist}/clear") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tasklist": c.tasklistid, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tasks.tasks.clear" call. +func (c *TasksClearCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TasksDeleteCall) Fields(s ...googleapi.Field) *TasksDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TasksDeleteCall) Context(ctx context.Context) *TasksDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TasksDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "lists/{tasklist}/tasks/{task}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tasklist": c.tasklistid, + "task": c.taskid, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tasks.tasks.delete" call. +func (c *TasksDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TasksGetCall) Fields(s ...googleapi.Field) *TasksGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TasksGetCall) IfNoneMatch(entityTag string) *TasksGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TasksGetCall) Context(ctx context.Context) *TasksGetCall { + c.ctx_ = ctx + return c +} + +func (c *TasksGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "lists/{tasklist}/tasks/{task}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tasklist": c.tasklistid, + "task": c.taskid, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tasks.tasks.get" call. +// Exactly one of *Task or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Task.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *TasksGetCall) Do() (*Task, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Task{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TasksInsertCall) Fields(s ...googleapi.Field) *TasksInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TasksInsertCall) Context(ctx context.Context) *TasksInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TasksInsertCall) doRequest(alt string) (*http.Response, 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", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "lists/{tasklist}/tasks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tasklist": c.tasklistid, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tasks.tasks.insert" call. +// Exactly one of *Task or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Task.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *TasksInsertCall) Do() (*Task, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Task{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TasksListCall) Fields(s ...googleapi.Field) *TasksListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TasksListCall) IfNoneMatch(entityTag string) *TasksListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TasksListCall) Context(ctx context.Context) *TasksListCall { + c.ctx_ = ctx + return c +} + +func (c *TasksListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "lists/{tasklist}/tasks") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tasklist": c.tasklistid, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tasks.tasks.list" call. +// Exactly one of *Tasks or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Tasks.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *TasksListCall) Do() (*Tasks, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Tasks{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TasksMoveCall) Fields(s ...googleapi.Field) *TasksMoveCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TasksMoveCall) Context(ctx context.Context) *TasksMoveCall { + c.ctx_ = ctx + return c +} + +func (c *TasksMoveCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "lists/{tasklist}/tasks/{task}/move") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tasklist": c.tasklistid, + "task": c.taskid, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tasks.tasks.move" call. +// Exactly one of *Task or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Task.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *TasksMoveCall) Do() (*Task, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Task{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TasksPatchCall) Fields(s ...googleapi.Field) *TasksPatchCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TasksPatchCall) Context(ctx context.Context) *TasksPatchCall { + c.ctx_ = ctx + return c +} + +func (c *TasksPatchCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "lists/{tasklist}/tasks/{task}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tasklist": c.tasklistid, + "task": c.taskid, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tasks.tasks.patch" call. +// Exactly one of *Task or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Task.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *TasksPatchCall) Do() (*Task, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Task{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the 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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TasksUpdateCall) Fields(s ...googleapi.Field) *TasksUpdateCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TasksUpdateCall) Context(ctx context.Context) *TasksUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *TasksUpdateCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "lists/{tasklist}/tasks/{task}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "tasklist": c.tasklistid, + "task": c.taskid, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "tasks.tasks.update" call. +// Exactly one of *Task or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Task.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *TasksUpdateCall) Do() (*Task, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Task{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates the 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/Godeps/_workspace/src/google.golang.org/api/translate/v2/translate-api.json b/Godeps/_workspace/src/google.golang.org/api/translate/v2/translate-api.json new file mode 100644 index 000000000..50af88ca3 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/translate/v2/translate-api.json @@ -0,0 +1,267 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/1Db23Cwr9s4MHtGjE0y-QSzRBMg\"", + "discoveryVersion": "v1", + "id": "translate:v2", + "name": "translate", + "version": "v2", + "revision": "20141123", + "title": "Translate API", + "description": "Lets you translate text from one language to another", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/translate-16.png", + "x32": "https://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/Godeps/_workspace/src/google.golang.org/api/translate/v2/translate-gen.go b/Godeps/_workspace/src/google.golang.org/api/translate/v2/translate-gen.go new file mode 100644 index 000000000..bec27c6c9 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/translate/v2/translate-gen.go @@ -0,0 +1,692 @@ +// Package translate provides access to the Translate API. +// +// See https://developers.google.com/translate/v2/using_rest +// +// Usage example: +// +// import "google.golang.org/api/translate/v2" +// ... +// translateService, err := translate.New(oauthHttpClient) +package translate // import "google.golang.org/api/translate/v2" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Detections *DetectionsService + + Languages *LanguagesService + + Translations *TranslationsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Detections") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DetectionsListResponse) MarshalJSON() ([]byte, error) { + type noMethod DetectionsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Confidence") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DetectionsResourceItem) MarshalJSON() ([]byte, error) { + type noMethod DetectionsResourceItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Languages") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LanguagesListResponse) MarshalJSON() ([]byte, error) { + type noMethod LanguagesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Language") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LanguagesResource) MarshalJSON() ([]byte, error) { + type noMethod LanguagesResource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type TranslationsListResponse struct { + // Translations: Translations contains list of translation results of + // given text + Translations []*TranslationsResource `json:"translations,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Translations") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TranslationsListResponse) MarshalJSON() ([]byte, error) { + type noMethod TranslationsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. + // "DetectedSourceLanguage") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TranslationsResource) MarshalJSON() ([]byte, error) { + type noMethod TranslationsResource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "language.detections.list": + +type DetectionsListCall struct { + s *Service + q []string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *DetectionsListCall) Fields(s ...googleapi.Field) *DetectionsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DetectionsListCall) IfNoneMatch(entityTag string) *DetectionsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *DetectionsListCall) Context(ctx context.Context) *DetectionsListCall { + c.ctx_ = ctx + return c +} + +func (c *DetectionsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + for _, v := range c.q { + params.Add("q", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "language.detections.list" call. +// Exactly one of *DetectionsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DetectionsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DetectionsListCall) Do() (*DetectionsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &DetectionsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *LanguagesListCall) Fields(s ...googleapi.Field) *LanguagesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *LanguagesListCall) IfNoneMatch(entityTag string) *LanguagesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *LanguagesListCall) Context(ctx context.Context) *LanguagesListCall { + c.ctx_ = ctx + return c +} + +func (c *LanguagesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["target"]; ok { + params.Set("target", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "language.languages.list" call. +// Exactly one of *LanguagesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *LanguagesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *LanguagesListCall) Do() (*LanguagesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &LanguagesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "List 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{} + ctx_ context.Context +} + +// 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 +// +// Possible values: +// "html" - Specifies the input is in HTML +// "text" - Specifies the input is in plain textual format +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TranslationsListCall) Fields(s ...googleapi.Field) *TranslationsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TranslationsListCall) IfNoneMatch(entityTag string) *TranslationsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *TranslationsListCall) Context(ctx context.Context) *TranslationsListCall { + c.ctx_ = ctx + return c +} + +func (c *TranslationsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "language.translations.list" call. +// Exactly one of *TranslationsListResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TranslationsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TranslationsListCall) Do() (*TranslationsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &TranslationsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns 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/Godeps/_workspace/src/google.golang.org/api/urlshortener/v1/urlshortener-api.json b/Godeps/_workspace/src/google.golang.org/api/urlshortener/v1/urlshortener-api.json new file mode 100644 index 000000000..943b2de4b --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/urlshortener/v1/urlshortener-api.json @@ -0,0 +1,319 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/hGOTAH4tOR9ybjNLhWvisea-41E\"", + "discoveryVersion": "v1", + "id": "urlshortener:v1", + "name": "urlshortener", + "version": "v1", + "revision": "20150319", + "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": "https://developers.google.com/url-shortener/v1/getting_started", + "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" + }, + "scopes": [ + "https://www.googleapis.com/auth/urlshortener" + ] + }, + "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/Godeps/_workspace/src/google.golang.org/api/urlshortener/v1/urlshortener-gen.go b/Godeps/_workspace/src/google.golang.org/api/urlshortener/v1/urlshortener-gen.go new file mode 100644 index 000000000..252454074 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/urlshortener/v1/urlshortener-gen.go @@ -0,0 +1,681 @@ +// Package urlshortener provides access to the URL Shortener API. +// +// See https://developers.google.com/url-shortener/v1/getting_started +// +// Usage example: +// +// import "google.golang.org/api/urlshortener/v1" +// ... +// urlshortenerService, err := urlshortener.New(oauthHttpClient) +package urlshortener // import "google.golang.org/api/urlshortener/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Url *UrlService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Browsers") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AnalyticsSnapshot) MarshalJSON() ([]byte, error) { + type noMethod AnalyticsSnapshot + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "AllTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AnalyticsSummary) MarshalJSON() ([]byte, error) { + type noMethod AnalyticsSummary + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Count") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *StringCount) MarshalJSON() ([]byte, error) { + type noMethod StringCount + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Analytics") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Url) MarshalJSON() ([]byte, error) { + type noMethod Url + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlHistory) MarshalJSON() ([]byte, error) { + type noMethod UrlHistory + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "urlshortener.url.get": + +type UrlGetCall struct { + s *Service + shortUrl string + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "ANALYTICS_CLICKS" - Returns only click counts. +// "ANALYTICS_TOP_STRINGS" - Returns only top string counts. +// "FULL" - Returns the creation timestamp and all available +// analytics. +func (c *UrlGetCall) Projection(projection string) *UrlGetCall { + c.opt_["projection"] = projection + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlGetCall) Fields(s ...googleapi.Field) *UrlGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UrlGetCall) IfNoneMatch(entityTag string) *UrlGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlGetCall) Context(ctx context.Context) *UrlGetCall { + c.ctx_ = ctx + return c +} + +func (c *UrlGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("shortUrl", fmt.Sprintf("%v", c.shortUrl)) + if v, ok := c.opt_["projection"]; ok { + params.Set("projection", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "urlshortener.url.get" call. +// Exactly one of *Url or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Url.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *UrlGetCall) Do() (*Url, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Url{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/urlshortener" + // ] + // } + +} + +// method id "urlshortener.url.insert": + +type UrlInsertCall struct { + s *Service + url *Url + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlInsertCall) Fields(s ...googleapi.Field) *UrlInsertCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlInsertCall) Context(ctx context.Context) *UrlInsertCall { + c.ctx_ = ctx + return c +} + +func (c *UrlInsertCall) doRequest(alt string) (*http.Response, 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", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + 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", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "urlshortener.url.insert" call. +// Exactly one of *Url or error will be non-nil. Any non-2xx status code +// is an error. Response headers are in either +// *Url.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *UrlInsertCall) Do() (*Url, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &Url{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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{} + ctx_ context.Context +} + +// 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. +// +// Possible values: +// "ANALYTICS_CLICKS" - Returns short URL click counts. +// "FULL" - Returns short URL click counts. +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 +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlListCall) Fields(s ...googleapi.Field) *UrlListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UrlListCall) IfNoneMatch(entityTag string) *UrlListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlListCall) Context(ctx context.Context) *UrlListCall { + c.ctx_ = ctx + return c +} + +func (c *UrlListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + 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)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", 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", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "urlshortener.url.list" call. +// Exactly one of *UrlHistory or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UrlHistory.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UrlListCall) Do() (*UrlHistory, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UrlHistory{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves 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/Godeps/_workspace/src/google.golang.org/api/webfonts/v1/webfonts-api.json b/Godeps/_workspace/src/google.golang.org/api/webfonts/v1/webfonts-api.json new file mode 100644 index 000000000..fc0fe8c3d --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/webfonts/v1/webfonts-api.json @@ -0,0 +1,175 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"FrPV2U6xXFUq8eRv_PO3IoAURkc/uRZcMEbTVS9rWZxqJQOe5kJsXfo\"", + "discoveryVersion": "v1", + "id": "webfonts:v1", + "name": "webfonts", + "version": "v1", + "revision": "20140210", + "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/Godeps/_workspace/src/google.golang.org/api/webfonts/v1/webfonts-gen.go b/Godeps/_workspace/src/google.golang.org/api/webfonts/v1/webfonts-gen.go new file mode 100644 index 000000000..1d86eb32b --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/webfonts/v1/webfonts-gen.go @@ -0,0 +1,294 @@ +// Package webfonts provides access to the Google Fonts Developer API. +// +// See https://developers.google.com/fonts/docs/developer_api +// +// Usage example: +// +// import "google.golang.org/api/webfonts/v1" +// ... +// webfontsService, err := webfonts.New(oauthHttpClient) +package webfonts // import "google.golang.org/api/webfonts/v1" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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 + UserAgent string // optional additional User-Agent fragment + + Webfonts *WebfontsService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Category") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Webfont) MarshalJSON() ([]byte, error) { + type noMethod Webfont + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *WebfontList) MarshalJSON() ([]byte, error) { + type noMethod WebfontList + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "webfonts.webfonts.list": + +type WebfontsListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// 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 +// +// Possible values: +// "alpha" - Sort alphabetically +// "date" - Sort by date added +// "popularity" - Sort by popularity +// "style" - Sort by number of styles +// "trending" - Sort by trending +func (c *WebfontsListCall) Sort(sort string) *WebfontsListCall { + c.opt_["sort"] = sort + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *WebfontsListCall) Fields(s ...googleapi.Field) *WebfontsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *WebfontsListCall) IfNoneMatch(entityTag string) *WebfontsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *WebfontsListCall) Context(ctx context.Context) *WebfontsListCall { + c.ctx_ = ctx + return c +} + +func (c *WebfontsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["sort"]; ok { + params.Set("sort", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "webfonts") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "webfonts.webfonts.list" call. +// Exactly one of *WebfontList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *WebfontList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *WebfontsListCall) Do() (*WebfontList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &WebfontList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the 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/Godeps/_workspace/src/google.golang.org/api/webmasters/v3/webmasters-api.json b/Godeps/_workspace/src/google.golang.org/api/webmasters/v3/webmasters-api.json new file mode 100644 index 000000000..2133906cd --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/webmasters/v3/webmasters-api.json @@ -0,0 +1,956 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/2KfwPsPFjdvTmw1MTymtM96q3zo\"", + "discoveryVersion": "v1", + "id": "webmasters:v3", + "name": "webmasters", + "version": "v3", + "revision": "20150804", + "title": "Webmaster Tools API", + "description": "Lets you view Google Webmaster Tools data for your verified sites.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/webmaster_tools-16.png", + "x32": "https://www.google.com/images/icons/product/webmaster_tools-32.png" + }, + "documentationLink": "https://developers.google.com/webmaster-tools/", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/webmasters/v3/", + "basePath": "/webmasters/v3/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "webmasters/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/webmasters": { + "description": "View and modify Webmaster Tools data for your verified sites" + }, + "https://www.googleapis.com/auth/webmasters.readonly": { + "description": "View Webmaster Tools data for your verified sites" + } + } + } + }, + "schemas": { + "ApiDataRow": { + "id": "ApiDataRow", + "type": "object", + "properties": { + "clicks": { + "type": "number", + "format": "double" + }, + "ctr": { + "type": "number", + "format": "double" + }, + "impressions": { + "type": "number", + "format": "double" + }, + "keys": { + "type": "array", + "items": { + "type": "string" + } + }, + "position": { + "type": "number", + "format": "double" + } + } + }, + "ApiDimensionFilter": { + "id": "ApiDimensionFilter", + "type": "object", + "properties": { + "dimension": { + "type": "string" + }, + "expression": { + "type": "string" + }, + "operator": { + "type": "string" + } + } + }, + "ApiDimensionFilterGroup": { + "id": "ApiDimensionFilterGroup", + "type": "object", + "properties": { + "filters": { + "type": "array", + "items": { + "$ref": "ApiDimensionFilter" + } + }, + "groupType": { + "type": "string" + } + } + }, + "SearchAnalyticsQueryRequest": { + "id": "SearchAnalyticsQueryRequest", + "type": "object", + "properties": { + "aggregationType": { + "type": "string", + "description": "[Optional; Default is \"auto\"] How data is aggregated. If aggregated by property, all data for the same property is aggregated; if aggregated by page, all data is aggregated by canonical URI. If you filter or group by page, choose AUTO; otherwise you can aggregate either by property or by page, depending on how you want your data calculated; see the help documentation to learn how data is calculated differently by site versus by page.\n\nNote: If you group or filter by page, you cannot aggregate by property.\n\nIf you specify any value other than AUTO, the aggregation type in the result will match the requested type, or if you request an invalid type, you will get an error. The API will never change your aggregation type if the requested type is invalid." + }, + "dimensionFilterGroups": { + "type": "array", + "description": "[Optional] Zero or more filters to apply to the dimension grouping values; for example, 'query contains \"buy\"' to see only data where the query string contains the substring \"buy\" (not case-sensitive). You can filter by a dimension without grouping by it.", + "items": { + "$ref": "ApiDimensionFilterGroup" + } + }, + "dimensions": { + "type": "array", + "description": "[Optional] Zero or more dimensions to group results by. Dimensions are the group-by values in the Search Analytics page. Dimensions are combined to create a unique row key for each row. Results are grouped in the order that you supply these dimensions.", + "items": { + "type": "string" + } + }, + "endDate": { + "type": "string", + "description": "[Required] End date of the requested date range, in YYYY-MM-DD format, in PST (UTC - 8:00). Must be greater than or equal to the start date. This value is included in the range." + }, + "rowLimit": { + "type": "integer", + "description": "[Optional; Default is 1000] The maximum number of rows to return. Must be a number from 1 to 5,000 (inclusive).", + "format": "int32" + }, + "searchType": { + "type": "string", + "description": "[Optional; Default is \"web\"] The search type to filter for." + }, + "startDate": { + "type": "string", + "description": "[Required] Start date of the requested date range, in YYYY-MM-DD format, in PST time (UTC - 8:00). Must be less than or equal to the end date. This value is included in the range." + } + } + }, + "SearchAnalyticsQueryResponse": { + "id": "SearchAnalyticsQueryResponse", + "type": "object", + "description": "A list of rows, one per result, grouped by key. Metrics in each row are aggregated for all data grouped by that key either by page or property, as specified by the aggregation type parameter.", + "properties": { + "responseAggregationType": { + "type": "string", + "description": "How the results were aggregated." + }, + "rows": { + "type": "array", + "description": "A list of rows grouped by the key values in the order given in the query.", + "items": { + "$ref": "ApiDataRow" + } + } + } + }, + "SitemapsListResponse": { + "id": "SitemapsListResponse", + "type": "object", + "description": "List of sitemaps.", + "properties": { + "sitemap": { + "type": "array", + "description": "Contains detailed information about a specific URL submitted as a sitemap.", + "items": { + "$ref": "WmxSitemap" + } + } + } + }, + "SitesListResponse": { + "id": "SitesListResponse", + "type": "object", + "description": "List of sites with access level information.", + "properties": { + "siteEntry": { + "type": "array", + "description": "Contains permission level information about a Webmaster Tools site. For more information, see Permissions in Webmaster Tools.", + "items": { + "$ref": "WmxSite" + } + } + } + }, + "UrlCrawlErrorCount": { + "id": "UrlCrawlErrorCount", + "type": "object", + "description": "An entry in a URL crawl errors time series.", + "properties": { + "count": { + "type": "string", + "description": "The error count at the given timestamp.", + "format": "int64" + }, + "timestamp": { + "type": "string", + "description": "The date and time when the crawl attempt took place, in RFC 3339 format.", + "format": "date-time" + } + } + }, + "UrlCrawlErrorCountsPerType": { + "id": "UrlCrawlErrorCountsPerType", + "type": "object", + "description": "Number of errors per day for a specific error type (defined by platform and category).", + "properties": { + "category": { + "type": "string", + "description": "The crawl error type." + }, + "entries": { + "type": "array", + "description": "The error count entries time series.", + "items": { + "$ref": "UrlCrawlErrorCount" + } + }, + "platform": { + "type": "string", + "description": "The general type of Googlebot that made the request (see list of Googlebot user-agents for the user-agents used)." + } + } + }, + "UrlCrawlErrorsCountsQueryResponse": { + "id": "UrlCrawlErrorsCountsQueryResponse", + "type": "object", + "description": "A time series of the number of URL crawl errors per error category and platform.", + "properties": { + "countPerTypes": { + "type": "array", + "description": "The time series of the number of URL crawl errors per error category and platform.", + "items": { + "$ref": "UrlCrawlErrorCountsPerType" + } + } + } + }, + "UrlCrawlErrorsSample": { + "id": "UrlCrawlErrorsSample", + "type": "object", + "description": "Contains information about specific crawl errors.", + "properties": { + "first_detected": { + "type": "string", + "description": "The time the error was first detected, in RFC 3339 format.", + "format": "date-time" + }, + "last_crawled": { + "type": "string", + "description": "The time when the URL was last crawled, in RFC 3339 format.", + "format": "date-time" + }, + "pageUrl": { + "type": "string", + "description": "The URL of an error, relative to the site." + }, + "responseCode": { + "type": "integer", + "description": "The HTTP response code, if any.", + "format": "int32" + }, + "urlDetails": { + "$ref": "UrlSampleDetails", + "description": "Additional details about the URL, set only when calling get()." + } + } + }, + "UrlCrawlErrorsSamplesListResponse": { + "id": "UrlCrawlErrorsSamplesListResponse", + "type": "object", + "description": "List of crawl error samples.", + "properties": { + "urlCrawlErrorSample": { + "type": "array", + "description": "Information about the sample URL and its crawl error.", + "items": { + "$ref": "UrlCrawlErrorsSample" + } + } + } + }, + "UrlSampleDetails": { + "id": "UrlSampleDetails", + "type": "object", + "description": "Additional details about the URL, set only when calling get().", + "properties": { + "containingSitemaps": { + "type": "array", + "description": "List of sitemaps pointing at this URL.", + "items": { + "type": "string" + } + }, + "linkedFromUrls": { + "type": "array", + "description": "A sample set of URLs linking to this URL.", + "items": { + "type": "string" + } + } + } + }, + "WmxSite": { + "id": "WmxSite", + "type": "object", + "description": "Contains permission level information about a Webmaster Tools site. For more information, see Permissions in Webmaster Tools.", + "properties": { + "permissionLevel": { + "type": "string", + "description": "The user's permission level for the site." + }, + "siteUrl": { + "type": "string", + "description": "The URL of the site." + } + } + }, + "WmxSitemap": { + "id": "WmxSitemap", + "type": "object", + "description": "Contains detailed information about a specific URL submitted as a sitemap.", + "properties": { + "contents": { + "type": "array", + "description": "The various content types in the sitemap.", + "items": { + "$ref": "WmxSitemapContent" + } + }, + "errors": { + "type": "string", + "description": "Number of errors in the sitemap. These are issues with the sitemap itself that need to be fixed before it can be processed correctly.", + "format": "int64" + }, + "isPending": { + "type": "boolean", + "description": "If true, the sitemap has not been processed." + }, + "isSitemapsIndex": { + "type": "boolean", + "description": "If true, the sitemap is a collection of sitemaps." + }, + "lastDownloaded": { + "type": "string", + "description": "Date & time in which this sitemap was last downloaded. Date format is in RFC 3339 format (yyyy-mm-dd).", + "format": "date-time" + }, + "lastSubmitted": { + "type": "string", + "description": "Date & time in which this sitemap was submitted. Date format is in RFC 3339 format (yyyy-mm-dd).", + "format": "date-time" + }, + "path": { + "type": "string", + "description": "The url of the sitemap." + }, + "type": { + "type": "string", + "description": "The type of the sitemap. For example: rssFeed." + }, + "warnings": { + "type": "string", + "description": "Number of warnings for the sitemap. These are generally non-critical issues with URLs in the sitemaps.", + "format": "int64" + } + } + }, + "WmxSitemapContent": { + "id": "WmxSitemapContent", + "type": "object", + "description": "Information about the various content types in the sitemap.", + "properties": { + "indexed": { + "type": "string", + "description": "The number of URLs from the sitemap that were indexed (of the content type).", + "format": "int64" + }, + "submitted": { + "type": "string", + "description": "The number of URLs in the sitemap (of the content type).", + "format": "int64" + }, + "type": { + "type": "string", + "description": "The specific type of content in this sitemap. For example: web." + } + } + } + }, + "resources": { + "searchanalytics": { + "methods": { + "query": { + "id": "webmasters.searchanalytics.query", + "path": "sites/{siteUrl}/searchAnalytics/query", + "httpMethod": "POST", + "description": "Query your data with filters and parameters that you define. Returns zero or more rows grouped by the row keys that you define. You must define a date range of one or more days.\n\nWhen date is one of the group by values, any days without data are omitted from the result list. If you need to know which days have data, issue a broad date range query grouped by date for any metric, and see which day rows are returned.", + "parameters": { + "siteUrl": { + "type": "string", + "description": "The site's URL, including protocol. For example: http://www.example.com/", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "siteUrl" + ], + "request": { + "$ref": "SearchAnalyticsQueryRequest" + }, + "response": { + "$ref": "SearchAnalyticsQueryResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/webmasters", + "https://www.googleapis.com/auth/webmasters.readonly" + ] + } + } + }, + "sitemaps": { + "methods": { + "delete": { + "id": "webmasters.sitemaps.delete", + "path": "sites/{siteUrl}/sitemaps/{feedpath}", + "httpMethod": "DELETE", + "description": "Deletes a sitemap from this site.", + "parameters": { + "feedpath": { + "type": "string", + "description": "The URL of the actual sitemap. For example: http://www.example.com/sitemap.xml", + "required": true, + "location": "path" + }, + "siteUrl": { + "type": "string", + "description": "The site's URL, including protocol. For example: http://www.example.com/", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "siteUrl", + "feedpath" + ], + "scopes": [ + "https://www.googleapis.com/auth/webmasters" + ] + }, + "get": { + "id": "webmasters.sitemaps.get", + "path": "sites/{siteUrl}/sitemaps/{feedpath}", + "httpMethod": "GET", + "description": "Retrieves information about a specific sitemap.", + "parameters": { + "feedpath": { + "type": "string", + "description": "The URL of the actual sitemap. For example: http://www.example.com/sitemap.xml", + "required": true, + "location": "path" + }, + "siteUrl": { + "type": "string", + "description": "The site's URL, including protocol. For example: http://www.example.com/", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "siteUrl", + "feedpath" + ], + "response": { + "$ref": "WmxSitemap" + }, + "scopes": [ + "https://www.googleapis.com/auth/webmasters", + "https://www.googleapis.com/auth/webmasters.readonly" + ] + }, + "list": { + "id": "webmasters.sitemaps.list", + "path": "sites/{siteUrl}/sitemaps", + "httpMethod": "GET", + "description": "Lists the sitemaps-entries submitted for this site, or included in the sitemap index file (if sitemapIndex is specified in the request).", + "parameters": { + "siteUrl": { + "type": "string", + "description": "The site's URL, including protocol. For example: http://www.example.com/", + "required": true, + "location": "path" + }, + "sitemapIndex": { + "type": "string", + "description": "A URL of a site's sitemap index. For example: http://www.example.com/sitemapindex.xml", + "location": "query" + } + }, + "parameterOrder": [ + "siteUrl" + ], + "response": { + "$ref": "SitemapsListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/webmasters", + "https://www.googleapis.com/auth/webmasters.readonly" + ] + }, + "submit": { + "id": "webmasters.sitemaps.submit", + "path": "sites/{siteUrl}/sitemaps/{feedpath}", + "httpMethod": "PUT", + "description": "Submits a sitemap for a site.", + "parameters": { + "feedpath": { + "type": "string", + "description": "The URL of the sitemap to add. For example: http://www.example.com/sitemap.xml", + "required": true, + "location": "path" + }, + "siteUrl": { + "type": "string", + "description": "The site's URL, including protocol. For example: http://www.example.com/", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "siteUrl", + "feedpath" + ], + "scopes": [ + "https://www.googleapis.com/auth/webmasters" + ] + } + } + }, + "sites": { + "methods": { + "add": { + "id": "webmasters.sites.add", + "path": "sites/{siteUrl}", + "httpMethod": "PUT", + "description": "Adds a site to the set of the user's sites in Webmaster Tools.", + "parameters": { + "siteUrl": { + "type": "string", + "description": "The URL of the site to add.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "siteUrl" + ], + "scopes": [ + "https://www.googleapis.com/auth/webmasters" + ] + }, + "delete": { + "id": "webmasters.sites.delete", + "path": "sites/{siteUrl}", + "httpMethod": "DELETE", + "description": "Removes a site from the set of the user's Webmaster Tools sites.", + "parameters": { + "siteUrl": { + "type": "string", + "description": "The URI of the property as defined in Search Console. Examples: http://www.example.com/ or android-app://com.example/", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "siteUrl" + ], + "scopes": [ + "https://www.googleapis.com/auth/webmasters" + ] + }, + "get": { + "id": "webmasters.sites.get", + "path": "sites/{siteUrl}", + "httpMethod": "GET", + "description": "Retrieves information about specific site.", + "parameters": { + "siteUrl": { + "type": "string", + "description": "The URI of the property as defined in Search Console. Examples: http://www.example.com/ or android-app://com.example/", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "siteUrl" + ], + "response": { + "$ref": "WmxSite" + }, + "scopes": [ + "https://www.googleapis.com/auth/webmasters", + "https://www.googleapis.com/auth/webmasters.readonly" + ] + }, + "list": { + "id": "webmasters.sites.list", + "path": "sites", + "httpMethod": "GET", + "description": "Lists the user's Webmaster Tools sites.", + "response": { + "$ref": "SitesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/webmasters", + "https://www.googleapis.com/auth/webmasters.readonly" + ] + } + } + }, + "urlcrawlerrorscounts": { + "methods": { + "query": { + "id": "webmasters.urlcrawlerrorscounts.query", + "path": "sites/{siteUrl}/urlCrawlErrorsCounts/query", + "httpMethod": "GET", + "description": "Retrieves a time series of the number of URL crawl errors per error category and platform.", + "parameters": { + "category": { + "type": "string", + "description": "The crawl error category. For example: serverError. If not specified, returns results for all categories.", + "enum": [ + "authPermissions", + "manyToOneRedirect", + "notFollowed", + "notFound", + "other", + "roboted", + "serverError", + "soft404" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ], + "location": "query" + }, + "latestCountsOnly": { + "type": "boolean", + "description": "If true, returns only the latest crawl error counts.", + "default": "true", + "location": "query" + }, + "platform": { + "type": "string", + "description": "The user agent type (platform) that made the request. For example: web. If not specified, returns results for all platforms.", + "enum": [ + "mobile", + "smartphoneOnly", + "web" + ], + "enumDescriptions": [ + "", + "", + "" + ], + "location": "query" + }, + "siteUrl": { + "type": "string", + "description": "The site's URL, including protocol. For example: http://www.example.com/", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "siteUrl" + ], + "response": { + "$ref": "UrlCrawlErrorsCountsQueryResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/webmasters", + "https://www.googleapis.com/auth/webmasters.readonly" + ] + } + } + }, + "urlcrawlerrorssamples": { + "methods": { + "get": { + "id": "webmasters.urlcrawlerrorssamples.get", + "path": "sites/{siteUrl}/urlCrawlErrorsSamples/{url}", + "httpMethod": "GET", + "description": "Retrieves details about crawl errors for a site's sample URL.", + "parameters": { + "category": { + "type": "string", + "description": "The crawl error category. For example: authPermissions", + "required": true, + "enum": [ + "authPermissions", + "manyToOneRedirect", + "notFollowed", + "notFound", + "other", + "roboted", + "serverError", + "soft404" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ], + "location": "query" + }, + "platform": { + "type": "string", + "description": "The user agent type (platform) that made the request. For example: web", + "required": true, + "enum": [ + "mobile", + "smartphoneOnly", + "web" + ], + "enumDescriptions": [ + "", + "", + "" + ], + "location": "query" + }, + "siteUrl": { + "type": "string", + "description": "The site's URL, including protocol. For example: http://www.example.com/", + "required": true, + "location": "path" + }, + "url": { + "type": "string", + "description": "The relative path (without the site) of the sample URL. It must be one of the URLs returned by list(). For example, for the URL https://www.example.com/pagename on the site https://www.example.com/, the url value is pagename", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "siteUrl", + "url", + "category", + "platform" + ], + "response": { + "$ref": "UrlCrawlErrorsSample" + }, + "scopes": [ + "https://www.googleapis.com/auth/webmasters", + "https://www.googleapis.com/auth/webmasters.readonly" + ] + }, + "list": { + "id": "webmasters.urlcrawlerrorssamples.list", + "path": "sites/{siteUrl}/urlCrawlErrorsSamples", + "httpMethod": "GET", + "description": "Lists a site's sample URLs for the specified crawl error category and platform.", + "parameters": { + "category": { + "type": "string", + "description": "The crawl error category. For example: authPermissions", + "required": true, + "enum": [ + "authPermissions", + "manyToOneRedirect", + "notFollowed", + "notFound", + "other", + "roboted", + "serverError", + "soft404" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ], + "location": "query" + }, + "platform": { + "type": "string", + "description": "The user agent type (platform) that made the request. For example: web", + "required": true, + "enum": [ + "mobile", + "smartphoneOnly", + "web" + ], + "enumDescriptions": [ + "", + "", + "" + ], + "location": "query" + }, + "siteUrl": { + "type": "string", + "description": "The site's URL, including protocol. For example: http://www.example.com/", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "siteUrl", + "category", + "platform" + ], + "response": { + "$ref": "UrlCrawlErrorsSamplesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/webmasters", + "https://www.googleapis.com/auth/webmasters.readonly" + ] + }, + "markAsFixed": { + "id": "webmasters.urlcrawlerrorssamples.markAsFixed", + "path": "sites/{siteUrl}/urlCrawlErrorsSamples/{url}", + "httpMethod": "DELETE", + "description": "Marks the provided site's sample URL as fixed, and removes it from the samples list.", + "parameters": { + "category": { + "type": "string", + "description": "The crawl error category. For example: authPermissions", + "required": true, + "enum": [ + "authPermissions", + "manyToOneRedirect", + "notFollowed", + "notFound", + "other", + "roboted", + "serverError", + "soft404" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ], + "location": "query" + }, + "platform": { + "type": "string", + "description": "The user agent type (platform) that made the request. For example: web", + "required": true, + "enum": [ + "mobile", + "smartphoneOnly", + "web" + ], + "enumDescriptions": [ + "", + "", + "" + ], + "location": "query" + }, + "siteUrl": { + "type": "string", + "description": "The site's URL, including protocol. For example: http://www.example.com/", + "required": true, + "location": "path" + }, + "url": { + "type": "string", + "description": "The relative path (without the site) of the sample URL. It must be one of the URLs returned by list(). For example, for the URL https://www.example.com/pagename on the site https://www.example.com/, the url value is pagename", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "siteUrl", + "url", + "category", + "platform" + ], + "scopes": [ + "https://www.googleapis.com/auth/webmasters" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/webmasters/v3/webmasters-gen.go b/Godeps/_workspace/src/google.golang.org/api/webmasters/v3/webmasters-gen.go new file mode 100644 index 000000000..e728807cb --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/webmasters/v3/webmasters-gen.go @@ -0,0 +1,2381 @@ +// Package webmasters provides access to the Webmaster Tools API. +// +// See https://developers.google.com/webmaster-tools/ +// +// Usage example: +// +// import "google.golang.org/api/webmasters/v3" +// ... +// webmastersService, err := webmasters.New(oauthHttpClient) +package webmasters // import "google.golang.org/api/webmasters/v3" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "webmasters:v3" +const apiName = "webmasters" +const apiVersion = "v3" +const basePath = "https://www.googleapis.com/webmasters/v3/" + +// OAuth2 scopes used by this API. +const ( + // View and modify Webmaster Tools data for your verified sites + WebmastersScope = "https://www.googleapis.com/auth/webmasters" + + // View Webmaster Tools data for your verified sites + WebmastersReadonlyScope = "https://www.googleapis.com/auth/webmasters.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.Searchanalytics = NewSearchanalyticsService(s) + s.Sitemaps = NewSitemapsService(s) + s.Sites = NewSitesService(s) + s.Urlcrawlerrorscounts = NewUrlcrawlerrorscountsService(s) + s.Urlcrawlerrorssamples = NewUrlcrawlerrorssamplesService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Searchanalytics *SearchanalyticsService + + Sitemaps *SitemapsService + + Sites *SitesService + + Urlcrawlerrorscounts *UrlcrawlerrorscountsService + + Urlcrawlerrorssamples *UrlcrawlerrorssamplesService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewSearchanalyticsService(s *Service) *SearchanalyticsService { + rs := &SearchanalyticsService{s: s} + return rs +} + +type SearchanalyticsService struct { + s *Service +} + +func NewSitemapsService(s *Service) *SitemapsService { + rs := &SitemapsService{s: s} + return rs +} + +type SitemapsService struct { + s *Service +} + +func NewSitesService(s *Service) *SitesService { + rs := &SitesService{s: s} + return rs +} + +type SitesService struct { + s *Service +} + +func NewUrlcrawlerrorscountsService(s *Service) *UrlcrawlerrorscountsService { + rs := &UrlcrawlerrorscountsService{s: s} + return rs +} + +type UrlcrawlerrorscountsService struct { + s *Service +} + +func NewUrlcrawlerrorssamplesService(s *Service) *UrlcrawlerrorssamplesService { + rs := &UrlcrawlerrorssamplesService{s: s} + return rs +} + +type UrlcrawlerrorssamplesService struct { + s *Service +} + +type ApiDataRow struct { + Clicks float64 `json:"clicks,omitempty"` + + Ctr float64 `json:"ctr,omitempty"` + + Impressions float64 `json:"impressions,omitempty"` + + Keys []string `json:"keys,omitempty"` + + Position float64 `json:"position,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Clicks") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ApiDataRow) MarshalJSON() ([]byte, error) { + type noMethod ApiDataRow + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ApiDimensionFilter struct { + Dimension string `json:"dimension,omitempty"` + + Expression string `json:"expression,omitempty"` + + Operator string `json:"operator,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Dimension") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ApiDimensionFilter) MarshalJSON() ([]byte, error) { + type noMethod ApiDimensionFilter + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ApiDimensionFilterGroup struct { + Filters []*ApiDimensionFilter `json:"filters,omitempty"` + + GroupType string `json:"groupType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Filters") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ApiDimensionFilterGroup) MarshalJSON() ([]byte, error) { + type noMethod ApiDimensionFilterGroup + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type SearchAnalyticsQueryRequest struct { + // AggregationType: [Optional; Default is "auto"] How data is + // aggregated. If aggregated by property, all data for the same property + // is aggregated; if aggregated by page, all data is aggregated by + // canonical URI. If you filter or group by page, choose AUTO; otherwise + // you can aggregate either by property or by page, depending on how you + // want your data calculated; see the help documentation to learn how + // data is calculated differently by site versus by page. + // + // Note: If you group or filter by page, you cannot aggregate by + // property. + // + // If you specify any value other than AUTO, the aggregation type in the + // result will match the requested type, or if you request an invalid + // type, you will get an error. The API will never change your + // aggregation type if the requested type is invalid. + AggregationType string `json:"aggregationType,omitempty"` + + // DimensionFilterGroups: [Optional] Zero or more filters to apply to + // the dimension grouping values; for example, 'query contains "buy"' to + // see only data where the query string contains the substring "buy" + // (not case-sensitive). You can filter by a dimension without grouping + // by it. + DimensionFilterGroups []*ApiDimensionFilterGroup `json:"dimensionFilterGroups,omitempty"` + + // Dimensions: [Optional] Zero or more dimensions to group results by. + // Dimensions are the group-by values in the Search Analytics page. + // Dimensions are combined to create a unique row key for each row. + // Results are grouped in the order that you supply these dimensions. + Dimensions []string `json:"dimensions,omitempty"` + + // EndDate: [Required] End date of the requested date range, in + // YYYY-MM-DD format, in PST (UTC - 8:00). Must be greater than or equal + // to the start date. This value is included in the range. + EndDate string `json:"endDate,omitempty"` + + // RowLimit: [Optional; Default is 1000] The maximum number of rows to + // return. Must be a number from 1 to 5,000 (inclusive). + RowLimit int64 `json:"rowLimit,omitempty"` + + // SearchType: [Optional; Default is "web"] The search type to filter + // for. + SearchType string `json:"searchType,omitempty"` + + // StartDate: [Required] Start date of the requested date range, in + // YYYY-MM-DD format, in PST time (UTC - 8:00). Must be less than or + // equal to the end date. This value is included in the range. + StartDate string `json:"startDate,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AggregationType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchAnalyticsQueryRequest) MarshalJSON() ([]byte, error) { + type noMethod SearchAnalyticsQueryRequest + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SearchAnalyticsQueryResponse: A list of rows, one per result, grouped +// by key. Metrics in each row are aggregated for all data grouped by +// that key either by page or property, as specified by the aggregation +// type parameter. +type SearchAnalyticsQueryResponse struct { + // ResponseAggregationType: How the results were aggregated. + ResponseAggregationType string `json:"responseAggregationType,omitempty"` + + // Rows: A list of rows grouped by the key values in the order given in + // the query. + Rows []*ApiDataRow `json:"rows,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. + // "ResponseAggregationType") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SearchAnalyticsQueryResponse) MarshalJSON() ([]byte, error) { + type noMethod SearchAnalyticsQueryResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SitemapsListResponse: List of sitemaps. +type SitemapsListResponse struct { + // Sitemap: Contains detailed information about a specific URL submitted + // as a sitemap. + Sitemap []*WmxSitemap `json:"sitemap,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Sitemap") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SitemapsListResponse) MarshalJSON() ([]byte, error) { + type noMethod SitemapsListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// SitesListResponse: List of sites with access level information. +type SitesListResponse struct { + // SiteEntry: Contains permission level information about a Webmaster + // Tools site. For more information, see Permissions in Webmaster Tools. + SiteEntry []*WmxSite `json:"siteEntry,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "SiteEntry") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SitesListResponse) MarshalJSON() ([]byte, error) { + type noMethod SitesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UrlCrawlErrorCount: An entry in a URL crawl errors time series. +type UrlCrawlErrorCount struct { + // Count: The error count at the given timestamp. + Count int64 `json:"count,omitempty,string"` + + // Timestamp: The date and time when the crawl attempt took place, in + // RFC 3339 format. + Timestamp string `json:"timestamp,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Count") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlCrawlErrorCount) MarshalJSON() ([]byte, error) { + type noMethod UrlCrawlErrorCount + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UrlCrawlErrorCountsPerType: Number of errors per day for a specific +// error type (defined by platform and category). +type UrlCrawlErrorCountsPerType struct { + // Category: The crawl error type. + Category string `json:"category,omitempty"` + + // Entries: The error count entries time series. + Entries []*UrlCrawlErrorCount `json:"entries,omitempty"` + + // Platform: The general type of Googlebot that made the request (see + // list of Googlebot user-agents for the user-agents used). + Platform string `json:"platform,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Category") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlCrawlErrorCountsPerType) MarshalJSON() ([]byte, error) { + type noMethod UrlCrawlErrorCountsPerType + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UrlCrawlErrorsCountsQueryResponse: A time series of the number of URL +// crawl errors per error category and platform. +type UrlCrawlErrorsCountsQueryResponse struct { + // CountPerTypes: The time series of the number of URL crawl errors per + // error category and platform. + CountPerTypes []*UrlCrawlErrorCountsPerType `json:"countPerTypes,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CountPerTypes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlCrawlErrorsCountsQueryResponse) MarshalJSON() ([]byte, error) { + type noMethod UrlCrawlErrorsCountsQueryResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UrlCrawlErrorsSample: Contains information about specific crawl +// errors. +type UrlCrawlErrorsSample struct { + // FirstDetected: The time the error was first detected, in RFC 3339 + // format. + FirstDetected string `json:"first_detected,omitempty"` + + // LastCrawled: The time when the URL was last crawled, in RFC 3339 + // format. + LastCrawled string `json:"last_crawled,omitempty"` + + // PageUrl: The URL of an error, relative to the site. + PageUrl string `json:"pageUrl,omitempty"` + + // ResponseCode: The HTTP response code, if any. + ResponseCode int64 `json:"responseCode,omitempty"` + + // UrlDetails: Additional details about the URL, set only when calling + // get(). + UrlDetails *UrlSampleDetails `json:"urlDetails,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "FirstDetected") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlCrawlErrorsSample) MarshalJSON() ([]byte, error) { + type noMethod UrlCrawlErrorsSample + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UrlCrawlErrorsSamplesListResponse: List of crawl error samples. +type UrlCrawlErrorsSamplesListResponse struct { + // UrlCrawlErrorSample: Information about the sample URL and its crawl + // error. + UrlCrawlErrorSample []*UrlCrawlErrorsSample `json:"urlCrawlErrorSample,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "UrlCrawlErrorSample") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlCrawlErrorsSamplesListResponse) MarshalJSON() ([]byte, error) { + type noMethod UrlCrawlErrorsSamplesListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// UrlSampleDetails: Additional details about the URL, set only when +// calling get(). +type UrlSampleDetails struct { + // ContainingSitemaps: List of sitemaps pointing at this URL. + ContainingSitemaps []string `json:"containingSitemaps,omitempty"` + + // LinkedFromUrls: A sample set of URLs linking to this URL. + LinkedFromUrls []string `json:"linkedFromUrls,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ContainingSitemaps") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlSampleDetails) MarshalJSON() ([]byte, error) { + type noMethod UrlSampleDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// WmxSite: Contains permission level information about a Webmaster +// Tools site. For more information, see Permissions in Webmaster +// Tools. +type WmxSite struct { + // PermissionLevel: The user's permission level for the site. + PermissionLevel string `json:"permissionLevel,omitempty"` + + // SiteUrl: The URL of the site. + SiteUrl string `json:"siteUrl,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "PermissionLevel") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *WmxSite) MarshalJSON() ([]byte, error) { + type noMethod WmxSite + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// WmxSitemap: Contains detailed information about a specific URL +// submitted as a sitemap. +type WmxSitemap struct { + // Contents: The various content types in the sitemap. + Contents []*WmxSitemapContent `json:"contents,omitempty"` + + // Errors: Number of errors in the sitemap. These are issues with the + // sitemap itself that need to be fixed before it can be processed + // correctly. + Errors int64 `json:"errors,omitempty,string"` + + // IsPending: If true, the sitemap has not been processed. + IsPending bool `json:"isPending,omitempty"` + + // IsSitemapsIndex: If true, the sitemap is a collection of sitemaps. + IsSitemapsIndex bool `json:"isSitemapsIndex,omitempty"` + + // LastDownloaded: Date & time in which this sitemap was last + // downloaded. Date format is in RFC 3339 format (yyyy-mm-dd). + LastDownloaded string `json:"lastDownloaded,omitempty"` + + // LastSubmitted: Date & time in which this sitemap was submitted. Date + // format is in RFC 3339 format (yyyy-mm-dd). + LastSubmitted string `json:"lastSubmitted,omitempty"` + + // Path: The url of the sitemap. + Path string `json:"path,omitempty"` + + // Type: The type of the sitemap. For example: rssFeed. + Type string `json:"type,omitempty"` + + // Warnings: Number of warnings for the sitemap. These are generally + // non-critical issues with URLs in the sitemaps. + Warnings int64 `json:"warnings,omitempty,string"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Contents") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *WmxSitemap) MarshalJSON() ([]byte, error) { + type noMethod WmxSitemap + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// WmxSitemapContent: Information about the various content types in the +// sitemap. +type WmxSitemapContent struct { + // Indexed: The number of URLs from the sitemap that were indexed (of + // the content type). + Indexed int64 `json:"indexed,omitempty,string"` + + // Submitted: The number of URLs in the sitemap (of the content type). + Submitted int64 `json:"submitted,omitempty,string"` + + // Type: The specific type of content in this sitemap. For example: web. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Indexed") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *WmxSitemapContent) MarshalJSON() ([]byte, error) { + type noMethod WmxSitemapContent + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// method id "webmasters.searchanalytics.query": + +type SearchanalyticsQueryCall struct { + s *Service + siteUrl string + searchanalyticsqueryrequest *SearchAnalyticsQueryRequest + opt_ map[string]interface{} + ctx_ context.Context +} + +// Query: Query your data with filters and parameters that you define. +// Returns zero or more rows grouped by the row keys that you define. +// You must define a date range of one or more days. +// +// When date is one of the group by values, any days without data are +// omitted from the result list. If you need to know which days have +// data, issue a broad date range query grouped by date for any metric, +// and see which day rows are returned. +func (r *SearchanalyticsService) Query(siteUrl string, searchanalyticsqueryrequest *SearchAnalyticsQueryRequest) *SearchanalyticsQueryCall { + c := &SearchanalyticsQueryCall{s: r.s, opt_: make(map[string]interface{})} + c.siteUrl = siteUrl + c.searchanalyticsqueryrequest = searchanalyticsqueryrequest + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SearchanalyticsQueryCall) Fields(s ...googleapi.Field) *SearchanalyticsQueryCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SearchanalyticsQueryCall) Context(ctx context.Context) *SearchanalyticsQueryCall { + c.ctx_ = ctx + return c +} + +func (c *SearchanalyticsQueryCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchanalyticsqueryrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "sites/{siteUrl}/searchAnalytics/query") + urls += "?" + params.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "siteUrl": c.siteUrl, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "webmasters.searchanalytics.query" call. +// Exactly one of *SearchAnalyticsQueryResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *SearchAnalyticsQueryResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SearchanalyticsQueryCall) Do() (*SearchAnalyticsQueryResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SearchAnalyticsQueryResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Query your data with filters and parameters that you define. Returns zero or more rows grouped by the row keys that you define. You must define a date range of one or more days.\n\nWhen date is one of the group by values, any days without data are omitted from the result list. If you need to know which days have data, issue a broad date range query grouped by date for any metric, and see which day rows are returned.", + // "httpMethod": "POST", + // "id": "webmasters.searchanalytics.query", + // "parameterOrder": [ + // "siteUrl" + // ], + // "parameters": { + // "siteUrl": { + // "description": "The site's URL, including protocol. For example: http://www.example.com/", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "sites/{siteUrl}/searchAnalytics/query", + // "request": { + // "$ref": "SearchAnalyticsQueryRequest" + // }, + // "response": { + // "$ref": "SearchAnalyticsQueryResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/webmasters", + // "https://www.googleapis.com/auth/webmasters.readonly" + // ] + // } + +} + +// method id "webmasters.sitemaps.delete": + +type SitemapsDeleteCall struct { + s *Service + siteUrl string + feedpath string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Deletes a sitemap from this site. +func (r *SitemapsService) Delete(siteUrl string, feedpath string) *SitemapsDeleteCall { + c := &SitemapsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.siteUrl = siteUrl + c.feedpath = feedpath + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SitemapsDeleteCall) Fields(s ...googleapi.Field) *SitemapsDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SitemapsDeleteCall) Context(ctx context.Context) *SitemapsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *SitemapsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "sites/{siteUrl}/sitemaps/{feedpath}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "siteUrl": c.siteUrl, + "feedpath": c.feedpath, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "webmasters.sitemaps.delete" call. +func (c *SitemapsDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Deletes a sitemap from this site.", + // "httpMethod": "DELETE", + // "id": "webmasters.sitemaps.delete", + // "parameterOrder": [ + // "siteUrl", + // "feedpath" + // ], + // "parameters": { + // "feedpath": { + // "description": "The URL of the actual sitemap. For example: http://www.example.com/sitemap.xml", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "siteUrl": { + // "description": "The site's URL, including protocol. For example: http://www.example.com/", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "sites/{siteUrl}/sitemaps/{feedpath}", + // "scopes": [ + // "https://www.googleapis.com/auth/webmasters" + // ] + // } + +} + +// method id "webmasters.sitemaps.get": + +type SitemapsGetCall struct { + s *Service + siteUrl string + feedpath string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves information about a specific sitemap. +func (r *SitemapsService) Get(siteUrl string, feedpath string) *SitemapsGetCall { + c := &SitemapsGetCall{s: r.s, opt_: make(map[string]interface{})} + c.siteUrl = siteUrl + c.feedpath = feedpath + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SitemapsGetCall) Fields(s ...googleapi.Field) *SitemapsGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SitemapsGetCall) IfNoneMatch(entityTag string) *SitemapsGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SitemapsGetCall) Context(ctx context.Context) *SitemapsGetCall { + c.ctx_ = ctx + return c +} + +func (c *SitemapsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "sites/{siteUrl}/sitemaps/{feedpath}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "siteUrl": c.siteUrl, + "feedpath": c.feedpath, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "webmasters.sitemaps.get" call. +// Exactly one of *WmxSitemap or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *WmxSitemap.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SitemapsGetCall) Do() (*WmxSitemap, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &WmxSitemap{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves information about a specific sitemap.", + // "httpMethod": "GET", + // "id": "webmasters.sitemaps.get", + // "parameterOrder": [ + // "siteUrl", + // "feedpath" + // ], + // "parameters": { + // "feedpath": { + // "description": "The URL of the actual sitemap. For example: http://www.example.com/sitemap.xml", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "siteUrl": { + // "description": "The site's URL, including protocol. For example: http://www.example.com/", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "sites/{siteUrl}/sitemaps/{feedpath}", + // "response": { + // "$ref": "WmxSitemap" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/webmasters", + // "https://www.googleapis.com/auth/webmasters.readonly" + // ] + // } + +} + +// method id "webmasters.sitemaps.list": + +type SitemapsListCall struct { + s *Service + siteUrl string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the sitemaps-entries submitted for this site, or included +// in the sitemap index file (if sitemapIndex is specified in the +// request). +func (r *SitemapsService) List(siteUrl string) *SitemapsListCall { + c := &SitemapsListCall{s: r.s, opt_: make(map[string]interface{})} + c.siteUrl = siteUrl + return c +} + +// SitemapIndex sets the optional parameter "sitemapIndex": A URL of a +// site's sitemap index. For example: +// http://www.example.com/sitemapindex.xml +func (c *SitemapsListCall) SitemapIndex(sitemapIndex string) *SitemapsListCall { + c.opt_["sitemapIndex"] = sitemapIndex + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SitemapsListCall) Fields(s ...googleapi.Field) *SitemapsListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SitemapsListCall) IfNoneMatch(entityTag string) *SitemapsListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SitemapsListCall) Context(ctx context.Context) *SitemapsListCall { + c.ctx_ = ctx + return c +} + +func (c *SitemapsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["sitemapIndex"]; ok { + params.Set("sitemapIndex", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "sites/{siteUrl}/sitemaps") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "siteUrl": c.siteUrl, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "webmasters.sitemaps.list" call. +// Exactly one of *SitemapsListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SitemapsListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SitemapsListCall) Do() (*SitemapsListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SitemapsListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the sitemaps-entries submitted for this site, or included in the sitemap index file (if sitemapIndex is specified in the request).", + // "httpMethod": "GET", + // "id": "webmasters.sitemaps.list", + // "parameterOrder": [ + // "siteUrl" + // ], + // "parameters": { + // "siteUrl": { + // "description": "The site's URL, including protocol. For example: http://www.example.com/", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "sitemapIndex": { + // "description": "A URL of a site's sitemap index. For example: http://www.example.com/sitemapindex.xml", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "sites/{siteUrl}/sitemaps", + // "response": { + // "$ref": "SitemapsListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/webmasters", + // "https://www.googleapis.com/auth/webmasters.readonly" + // ] + // } + +} + +// method id "webmasters.sitemaps.submit": + +type SitemapsSubmitCall struct { + s *Service + siteUrl string + feedpath string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Submit: Submits a sitemap for a site. +func (r *SitemapsService) Submit(siteUrl string, feedpath string) *SitemapsSubmitCall { + c := &SitemapsSubmitCall{s: r.s, opt_: make(map[string]interface{})} + c.siteUrl = siteUrl + c.feedpath = feedpath + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SitemapsSubmitCall) Fields(s ...googleapi.Field) *SitemapsSubmitCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SitemapsSubmitCall) Context(ctx context.Context) *SitemapsSubmitCall { + c.ctx_ = ctx + return c +} + +func (c *SitemapsSubmitCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "sites/{siteUrl}/sitemaps/{feedpath}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "siteUrl": c.siteUrl, + "feedpath": c.feedpath, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "webmasters.sitemaps.submit" call. +func (c *SitemapsSubmitCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Submits a sitemap for a site.", + // "httpMethod": "PUT", + // "id": "webmasters.sitemaps.submit", + // "parameterOrder": [ + // "siteUrl", + // "feedpath" + // ], + // "parameters": { + // "feedpath": { + // "description": "The URL of the sitemap to add. For example: http://www.example.com/sitemap.xml", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "siteUrl": { + // "description": "The site's URL, including protocol. For example: http://www.example.com/", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "sites/{siteUrl}/sitemaps/{feedpath}", + // "scopes": [ + // "https://www.googleapis.com/auth/webmasters" + // ] + // } + +} + +// method id "webmasters.sites.add": + +type SitesAddCall struct { + s *Service + siteUrl string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Add: Adds a site to the set of the user's sites in Webmaster Tools. +func (r *SitesService) Add(siteUrl string) *SitesAddCall { + c := &SitesAddCall{s: r.s, opt_: make(map[string]interface{})} + c.siteUrl = siteUrl + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SitesAddCall) Fields(s ...googleapi.Field) *SitesAddCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SitesAddCall) Context(ctx context.Context) *SitesAddCall { + c.ctx_ = ctx + return c +} + +func (c *SitesAddCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "sites/{siteUrl}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "siteUrl": c.siteUrl, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "webmasters.sites.add" call. +func (c *SitesAddCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Adds a site to the set of the user's sites in Webmaster Tools.", + // "httpMethod": "PUT", + // "id": "webmasters.sites.add", + // "parameterOrder": [ + // "siteUrl" + // ], + // "parameters": { + // "siteUrl": { + // "description": "The URL of the site to add.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "sites/{siteUrl}", + // "scopes": [ + // "https://www.googleapis.com/auth/webmasters" + // ] + // } + +} + +// method id "webmasters.sites.delete": + +type SitesDeleteCall struct { + s *Service + siteUrl string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Delete: Removes a site from the set of the user's Webmaster Tools +// sites. +func (r *SitesService) Delete(siteUrl string) *SitesDeleteCall { + c := &SitesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c.siteUrl = siteUrl + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SitesDeleteCall) Fields(s ...googleapi.Field) *SitesDeleteCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SitesDeleteCall) Context(ctx context.Context) *SitesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *SitesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "sites/{siteUrl}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "siteUrl": c.siteUrl, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "webmasters.sites.delete" call. +func (c *SitesDeleteCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Removes a site from the set of the user's Webmaster Tools sites.", + // "httpMethod": "DELETE", + // "id": "webmasters.sites.delete", + // "parameterOrder": [ + // "siteUrl" + // ], + // "parameters": { + // "siteUrl": { + // "description": "The URI of the property as defined in Search Console. Examples: http://www.example.com/ or android-app://com.example/", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "sites/{siteUrl}", + // "scopes": [ + // "https://www.googleapis.com/auth/webmasters" + // ] + // } + +} + +// method id "webmasters.sites.get": + +type SitesGetCall struct { + s *Service + siteUrl string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves information about specific site. +func (r *SitesService) Get(siteUrl string) *SitesGetCall { + c := &SitesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.siteUrl = siteUrl + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SitesGetCall) Fields(s ...googleapi.Field) *SitesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SitesGetCall) IfNoneMatch(entityTag string) *SitesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SitesGetCall) Context(ctx context.Context) *SitesGetCall { + c.ctx_ = ctx + return c +} + +func (c *SitesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "sites/{siteUrl}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "siteUrl": c.siteUrl, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "webmasters.sites.get" call. +// Exactly one of *WmxSite or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *WmxSite.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *SitesGetCall) Do() (*WmxSite, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &WmxSite{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves information about specific site.", + // "httpMethod": "GET", + // "id": "webmasters.sites.get", + // "parameterOrder": [ + // "siteUrl" + // ], + // "parameters": { + // "siteUrl": { + // "description": "The URI of the property as defined in Search Console. Examples: http://www.example.com/ or android-app://com.example/", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "sites/{siteUrl}", + // "response": { + // "$ref": "WmxSite" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/webmasters", + // "https://www.googleapis.com/auth/webmasters.readonly" + // ] + // } + +} + +// method id "webmasters.sites.list": + +type SitesListCall struct { + s *Service + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists the user's Webmaster Tools sites. +func (r *SitesService) List() *SitesListCall { + c := &SitesListCall{s: r.s, opt_: make(map[string]interface{})} + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SitesListCall) Fields(s ...googleapi.Field) *SitesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SitesListCall) IfNoneMatch(entityTag string) *SitesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *SitesListCall) Context(ctx context.Context) *SitesListCall { + c.ctx_ = ctx + return c +} + +func (c *SitesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "sites") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.SetOpaque(req.URL) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "webmasters.sites.list" call. +// Exactly one of *SitesListResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SitesListResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SitesListCall) Do() (*SitesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &SitesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the user's Webmaster Tools sites.", + // "httpMethod": "GET", + // "id": "webmasters.sites.list", + // "path": "sites", + // "response": { + // "$ref": "SitesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/webmasters", + // "https://www.googleapis.com/auth/webmasters.readonly" + // ] + // } + +} + +// method id "webmasters.urlcrawlerrorscounts.query": + +type UrlcrawlerrorscountsQueryCall struct { + s *Service + siteUrl string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Query: Retrieves a time series of the number of URL crawl errors per +// error category and platform. +func (r *UrlcrawlerrorscountsService) Query(siteUrl string) *UrlcrawlerrorscountsQueryCall { + c := &UrlcrawlerrorscountsQueryCall{s: r.s, opt_: make(map[string]interface{})} + c.siteUrl = siteUrl + return c +} + +// Category sets the optional parameter "category": The crawl error +// category. For example: serverError. If not specified, returns results +// for all categories. +// +// Possible values: +// "authPermissions" +// "manyToOneRedirect" +// "notFollowed" +// "notFound" +// "other" +// "roboted" +// "serverError" +// "soft404" +func (c *UrlcrawlerrorscountsQueryCall) Category(category string) *UrlcrawlerrorscountsQueryCall { + c.opt_["category"] = category + return c +} + +// LatestCountsOnly sets the optional parameter "latestCountsOnly": If +// true, returns only the latest crawl error counts. +func (c *UrlcrawlerrorscountsQueryCall) LatestCountsOnly(latestCountsOnly bool) *UrlcrawlerrorscountsQueryCall { + c.opt_["latestCountsOnly"] = latestCountsOnly + return c +} + +// Platform sets the optional parameter "platform": The user agent type +// (platform) that made the request. For example: web. If not specified, +// returns results for all platforms. +// +// Possible values: +// "mobile" +// "smartphoneOnly" +// "web" +func (c *UrlcrawlerrorscountsQueryCall) Platform(platform string) *UrlcrawlerrorscountsQueryCall { + c.opt_["platform"] = platform + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlcrawlerrorscountsQueryCall) Fields(s ...googleapi.Field) *UrlcrawlerrorscountsQueryCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UrlcrawlerrorscountsQueryCall) IfNoneMatch(entityTag string) *UrlcrawlerrorscountsQueryCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlcrawlerrorscountsQueryCall) Context(ctx context.Context) *UrlcrawlerrorscountsQueryCall { + c.ctx_ = ctx + return c +} + +func (c *UrlcrawlerrorscountsQueryCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + if v, ok := c.opt_["category"]; ok { + params.Set("category", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["latestCountsOnly"]; ok { + params.Set("latestCountsOnly", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["platform"]; ok { + params.Set("platform", fmt.Sprintf("%v", v)) + } + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "sites/{siteUrl}/urlCrawlErrorsCounts/query") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "siteUrl": c.siteUrl, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "webmasters.urlcrawlerrorscounts.query" call. +// Exactly one of *UrlCrawlErrorsCountsQueryResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *UrlCrawlErrorsCountsQueryResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *UrlcrawlerrorscountsQueryCall) Do() (*UrlCrawlErrorsCountsQueryResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UrlCrawlErrorsCountsQueryResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a time series of the number of URL crawl errors per error category and platform.", + // "httpMethod": "GET", + // "id": "webmasters.urlcrawlerrorscounts.query", + // "parameterOrder": [ + // "siteUrl" + // ], + // "parameters": { + // "category": { + // "description": "The crawl error category. For example: serverError. If not specified, returns results for all categories.", + // "enum": [ + // "authPermissions", + // "manyToOneRedirect", + // "notFollowed", + // "notFound", + // "other", + // "roboted", + // "serverError", + // "soft404" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "latestCountsOnly": { + // "default": "true", + // "description": "If true, returns only the latest crawl error counts.", + // "location": "query", + // "type": "boolean" + // }, + // "platform": { + // "description": "The user agent type (platform) that made the request. For example: web. If not specified, returns results for all platforms.", + // "enum": [ + // "mobile", + // "smartphoneOnly", + // "web" + // ], + // "enumDescriptions": [ + // "", + // "", + // "" + // ], + // "location": "query", + // "type": "string" + // }, + // "siteUrl": { + // "description": "The site's URL, including protocol. For example: http://www.example.com/", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "sites/{siteUrl}/urlCrawlErrorsCounts/query", + // "response": { + // "$ref": "UrlCrawlErrorsCountsQueryResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/webmasters", + // "https://www.googleapis.com/auth/webmasters.readonly" + // ] + // } + +} + +// method id "webmasters.urlcrawlerrorssamples.get": + +type UrlcrawlerrorssamplesGetCall struct { + s *Service + siteUrl string + url string + category string + platform string + opt_ map[string]interface{} + ctx_ context.Context +} + +// Get: Retrieves details about crawl errors for a site's sample URL. +func (r *UrlcrawlerrorssamplesService) Get(siteUrl string, url string, category string, platform string) *UrlcrawlerrorssamplesGetCall { + c := &UrlcrawlerrorssamplesGetCall{s: r.s, opt_: make(map[string]interface{})} + c.siteUrl = siteUrl + c.url = url + c.category = category + c.platform = platform + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlcrawlerrorssamplesGetCall) Fields(s ...googleapi.Field) *UrlcrawlerrorssamplesGetCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UrlcrawlerrorssamplesGetCall) IfNoneMatch(entityTag string) *UrlcrawlerrorssamplesGetCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlcrawlerrorssamplesGetCall) Context(ctx context.Context) *UrlcrawlerrorssamplesGetCall { + c.ctx_ = ctx + return c +} + +func (c *UrlcrawlerrorssamplesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("category", fmt.Sprintf("%v", c.category)) + params.Set("platform", fmt.Sprintf("%v", c.platform)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "sites/{siteUrl}/urlCrawlErrorsSamples/{url}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "siteUrl": c.siteUrl, + "url": c.url, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "webmasters.urlcrawlerrorssamples.get" call. +// Exactly one of *UrlCrawlErrorsSample or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *UrlCrawlErrorsSample.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UrlcrawlerrorssamplesGetCall) Do() (*UrlCrawlErrorsSample, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UrlCrawlErrorsSample{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves details about crawl errors for a site's sample URL.", + // "httpMethod": "GET", + // "id": "webmasters.urlcrawlerrorssamples.get", + // "parameterOrder": [ + // "siteUrl", + // "url", + // "category", + // "platform" + // ], + // "parameters": { + // "category": { + // "description": "The crawl error category. For example: authPermissions", + // "enum": [ + // "authPermissions", + // "manyToOneRedirect", + // "notFollowed", + // "notFound", + // "other", + // "roboted", + // "serverError", + // "soft404" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "platform": { + // "description": "The user agent type (platform) that made the request. For example: web", + // "enum": [ + // "mobile", + // "smartphoneOnly", + // "web" + // ], + // "enumDescriptions": [ + // "", + // "", + // "" + // ], + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "siteUrl": { + // "description": "The site's URL, including protocol. For example: http://www.example.com/", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "url": { + // "description": "The relative path (without the site) of the sample URL. It must be one of the URLs returned by list(). For example, for the URL https://www.example.com/pagename on the site https://www.example.com/, the url value is pagename", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "sites/{siteUrl}/urlCrawlErrorsSamples/{url}", + // "response": { + // "$ref": "UrlCrawlErrorsSample" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/webmasters", + // "https://www.googleapis.com/auth/webmasters.readonly" + // ] + // } + +} + +// method id "webmasters.urlcrawlerrorssamples.list": + +type UrlcrawlerrorssamplesListCall struct { + s *Service + siteUrl string + category string + platform string + opt_ map[string]interface{} + ctx_ context.Context +} + +// List: Lists a site's sample URLs for the specified crawl error +// category and platform. +func (r *UrlcrawlerrorssamplesService) List(siteUrl string, category string, platform string) *UrlcrawlerrorssamplesListCall { + c := &UrlcrawlerrorssamplesListCall{s: r.s, opt_: make(map[string]interface{})} + c.siteUrl = siteUrl + c.category = category + c.platform = platform + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlcrawlerrorssamplesListCall) Fields(s ...googleapi.Field) *UrlcrawlerrorssamplesListCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UrlcrawlerrorssamplesListCall) IfNoneMatch(entityTag string) *UrlcrawlerrorssamplesListCall { + c.opt_["ifNoneMatch"] = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlcrawlerrorssamplesListCall) Context(ctx context.Context) *UrlcrawlerrorssamplesListCall { + c.ctx_ = ctx + return c +} + +func (c *UrlcrawlerrorssamplesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("category", fmt.Sprintf("%v", c.category)) + params.Set("platform", fmt.Sprintf("%v", c.platform)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "sites/{siteUrl}/urlCrawlErrorsSamples") + urls += "?" + params.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "siteUrl": c.siteUrl, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if v, ok := c.opt_["ifNoneMatch"]; ok { + req.Header.Set("If-None-Match", fmt.Sprintf("%v", v)) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "webmasters.urlcrawlerrorssamples.list" call. +// Exactly one of *UrlCrawlErrorsSamplesListResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *UrlCrawlErrorsSamplesListResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *UrlcrawlerrorssamplesListCall) Do() (*UrlCrawlErrorsSamplesListResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, err + } + ret := &UrlCrawlErrorsSamplesListResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists a site's sample URLs for the specified crawl error category and platform.", + // "httpMethod": "GET", + // "id": "webmasters.urlcrawlerrorssamples.list", + // "parameterOrder": [ + // "siteUrl", + // "category", + // "platform" + // ], + // "parameters": { + // "category": { + // "description": "The crawl error category. For example: authPermissions", + // "enum": [ + // "authPermissions", + // "manyToOneRedirect", + // "notFollowed", + // "notFound", + // "other", + // "roboted", + // "serverError", + // "soft404" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "platform": { + // "description": "The user agent type (platform) that made the request. For example: web", + // "enum": [ + // "mobile", + // "smartphoneOnly", + // "web" + // ], + // "enumDescriptions": [ + // "", + // "", + // "" + // ], + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "siteUrl": { + // "description": "The site's URL, including protocol. For example: http://www.example.com/", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "sites/{siteUrl}/urlCrawlErrorsSamples", + // "response": { + // "$ref": "UrlCrawlErrorsSamplesListResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/webmasters", + // "https://www.googleapis.com/auth/webmasters.readonly" + // ] + // } + +} + +// method id "webmasters.urlcrawlerrorssamples.markAsFixed": + +type UrlcrawlerrorssamplesMarkAsFixedCall struct { + s *Service + siteUrl string + url string + category string + platform string + opt_ map[string]interface{} + ctx_ context.Context +} + +// MarkAsFixed: Marks the provided site's sample URL as fixed, and +// removes it from the samples list. +func (r *UrlcrawlerrorssamplesService) MarkAsFixed(siteUrl string, url string, category string, platform string) *UrlcrawlerrorssamplesMarkAsFixedCall { + c := &UrlcrawlerrorssamplesMarkAsFixedCall{s: r.s, opt_: make(map[string]interface{})} + c.siteUrl = siteUrl + c.url = url + c.category = category + c.platform = platform + return c +} + +// Fields allows partial responses to be retrieved. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *UrlcrawlerrorssamplesMarkAsFixedCall) Fields(s ...googleapi.Field) *UrlcrawlerrorssamplesMarkAsFixedCall { + c.opt_["fields"] = googleapi.CombineFields(s) + return c +} + +// Context sets the context to be used in this call's Do method. +// Any pending HTTP request will be aborted if the provided context +// is canceled. +func (c *UrlcrawlerrorssamplesMarkAsFixedCall) Context(ctx context.Context) *UrlcrawlerrorssamplesMarkAsFixedCall { + c.ctx_ = ctx + return c +} + +func (c *UrlcrawlerrorssamplesMarkAsFixedCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + params := make(url.Values) + params.Set("alt", alt) + params.Set("category", fmt.Sprintf("%v", c.category)) + params.Set("platform", fmt.Sprintf("%v", c.platform)) + if v, ok := c.opt_["fields"]; ok { + params.Set("fields", fmt.Sprintf("%v", v)) + } + urls := googleapi.ResolveRelative(c.s.BasePath, "sites/{siteUrl}/urlCrawlErrorsSamples/{url}") + urls += "?" + params.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "siteUrl": c.siteUrl, + "url": c.url, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "webmasters.urlcrawlerrorssamples.markAsFixed" call. +func (c *UrlcrawlerrorssamplesMarkAsFixedCall) Do() error { + res, err := c.doRequest("json") + if err != nil { + return err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return err + } + return nil + // { + // "description": "Marks the provided site's sample URL as fixed, and removes it from the samples list.", + // "httpMethod": "DELETE", + // "id": "webmasters.urlcrawlerrorssamples.markAsFixed", + // "parameterOrder": [ + // "siteUrl", + // "url", + // "category", + // "platform" + // ], + // "parameters": { + // "category": { + // "description": "The crawl error category. For example: authPermissions", + // "enum": [ + // "authPermissions", + // "manyToOneRedirect", + // "notFollowed", + // "notFound", + // "other", + // "roboted", + // "serverError", + // "soft404" + // ], + // "enumDescriptions": [ + // "", + // "", + // "", + // "", + // "", + // "", + // "", + // "" + // ], + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "platform": { + // "description": "The user agent type (platform) that made the request. For example: web", + // "enum": [ + // "mobile", + // "smartphoneOnly", + // "web" + // ], + // "enumDescriptions": [ + // "", + // "", + // "" + // ], + // "location": "query", + // "required": true, + // "type": "string" + // }, + // "siteUrl": { + // "description": "The site's URL, including protocol. For example: http://www.example.com/", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "url": { + // "description": "The relative path (without the site) of the sample URL. It must be one of the URLs returned by list(). For example, for the URL https://www.example.com/pagename on the site https://www.example.com/, the url value is pagename", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "sites/{siteUrl}/urlCrawlErrorsSamples/{url}", + // "scopes": [ + // "https://www.googleapis.com/auth/webmasters" + // ] + // } + +} diff --git a/Godeps/_workspace/src/google.golang.org/api/youtube/v3/youtube-api.json b/Godeps/_workspace/src/google.golang.org/api/youtube/v3/youtube-api.json new file mode 100644 index 000000000..34f380651 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/youtube/v3/youtube-api.json @@ -0,0 +1,9465 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/4-0NBGYpnIwmGOtwWyiB-28Ef00\"", + "discoveryVersion": "v1", + "id": "youtube:v3", + "name": "youtube", + "canonicalName": "YouTube", + "version": "v3", + "revision": "20151012", + "title": "YouTube Data API", + "description": "Programmatic access to YouTube features.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/youtube-16.png", + "x32": "https://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.force-ssl": { + "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": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "Caption": { + "id": "Caption", + "type": "object", + "description": "A caption resource represents a YouTube caption track. A caption track is associated with exactly one YouTube video.", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the caption track.", + "annotations": { + "required": [ + "youtube.captions.update" + ] + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#caption\".", + "default": "youtube#caption" + }, + "snippet": { + "$ref": "CaptionSnippet", + "description": "The snippet object contains basic details about the caption." + } + } + }, + "CaptionListResponse": { + "id": "CaptionListResponse", + "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 captions that match the request criteria.", + "items": { + "$ref": "Caption" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#captionListResponse\".", + "default": "youtube#captionListResponse" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "CaptionSnippet": { + "id": "CaptionSnippet", + "type": "object", + "description": "Basic details about a caption track, such as its language and name.", + "properties": { + "audioTrackType": { + "type": "string", + "description": "The type of audio track associated with the caption track.", + "enum": [ + "commentary", + "descriptive", + "primary", + "unknown" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "failureReason": { + "type": "string", + "description": "The reason that YouTube failed to process the caption track. This property is only present if the state property's value is failed.", + "enum": [ + "processingFailed", + "unknownFormat", + "unsupportedFormat" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "isAutoSynced": { + "type": "boolean", + "description": "Indicates whether YouTube synchronized the caption track to the audio track in the video. The value will be true if a sync was explicitly requested when the caption track was uploaded. For example, when calling the captions.insert or captions.update methods, you can set the sync parameter to true to instruct YouTube to sync the uploaded track to the video. If the value is false, YouTube uses the time codes in the uploaded caption track to determine when to display captions." + }, + "isCC": { + "type": "boolean", + "description": "Indicates whether the track contains closed captions for the deaf and hard of hearing. The default value is false." + }, + "isDraft": { + "type": "boolean", + "description": "Indicates whether the caption track is a draft. If the value is true, then the track is not publicly visible. The default value is false." + }, + "isEasyReader": { + "type": "boolean", + "description": "Indicates whether caption track is formatted for \"easy reader,\" meaning it is at a third-grade level for language learners. The default value is false." + }, + "isLarge": { + "type": "boolean", + "description": "Indicates whether the caption track uses large text for the vision-impaired. The default value is false." + }, + "language": { + "type": "string", + "description": "The language of the caption track. The property value is a BCP-47 language tag.", + "annotations": { + "required": [ + "youtube.captions.insert" + ] + } + }, + "lastUpdated": { + "type": "string", + "description": "The date and time when the caption track was last updated. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "name": { + "type": "string", + "description": "The name of the caption track. The name is intended to be visible to the user as an option during playback.", + "annotations": { + "required": [ + "youtube.captions.insert" + ] + } + }, + "status": { + "type": "string", + "description": "The caption track's status.", + "enum": [ + "failed", + "serving", + "syncing" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "trackKind": { + "type": "string", + "description": "The caption track's type.", + "enum": [ + "ASR", + "forced", + "standard" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "videoId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the video associated with the caption track.", + "annotations": { + "required": [ + "youtube.captions.insert" + ] + } + } + } + }, + "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": [ + "dash", + "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" + }, + "localizations": { + "type": "object", + "description": "Localizations for different languages", + "additionalProperties": { + "$ref": "ChannelLocalization", + "description": "The language tag, using string since map_key require simple types." + } + }, + "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" + } + } + } + }, + "ChannelId": { + "id": "ChannelId", + "type": "object", + "properties": { + "value": { + "type": "string" + } + } + }, + "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." + } + } + }, + "ChannelLocalization": { + "id": "ChannelLocalization", + "type": "object", + "description": "Channel localization setting", + "properties": { + "description": { + "type": "string", + "description": "The localized strings for channel's description." + }, + "title": { + "type": "string", + "description": "The localized strings for channel's title." + } + } + }, + "ChannelSection": { + "id": "ChannelSection", + "type": "object", + "properties": { + "contentDetails": { + "$ref": "ChannelSectionContentDetails", + "description": "The contentDetails object contains details about the channel section content, such as a list of playlists or channels featured in the section." + }, + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the channel section." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#channelSection\".", + "default": "youtube#channelSection" + }, + "localizations": { + "type": "object", + "description": "Localizations for different languages", + "additionalProperties": { + "$ref": "ChannelSectionLocalization", + "description": "The language tag, using string since map_key require simple types." + } + }, + "snippet": { + "$ref": "ChannelSectionSnippet", + "description": "The snippet object contains basic details about the channel section, such as its type, style and title." + }, + "targeting": { + "$ref": "ChannelSectionTargeting", + "description": "The targeting object contains basic targeting settings about the channel section." + } + } + }, + "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." + } + } + }, + "ChannelSectionLocalization": { + "id": "ChannelSectionLocalization", + "type": "object", + "description": "ChannelSection localization setting", + "properties": { + "title": { + "type": "string", + "description": "The localized strings for channel section's title." + } + } + }, + "ChannelSectionSnippet": { + "id": "ChannelSectionSnippet", + "type": "object", + "description": "Basic details about a channel section, including title, style and position.", + "properties": { + "channelId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the channel that published the channel section." + }, + "defaultLanguage": { + "type": "string", + "description": "The language of the channel section's default title and description." + }, + "localized": { + "$ref": "ChannelSectionLocalization", + "description": "Localized title, read-only." + }, + "position": { + "type": "integer", + "description": "The position of the channel section in the channel.", + "format": "uint32" + }, + "style": { + "type": "string", + "description": "The style of the channel section.", + "enum": [ + "channelsectionStyleUndefined", + "horizontalRow", + "verticalList" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "title": { + "type": "string", + "description": "The channel section's title for multiple_playlists and multiple_channels." + }, + "type": { + "type": "string", + "description": "The type of the channel section.", + "enum": [ + "allPlaylists", + "channelsectionTypeUndefined", + "completedEvents", + "likedPlaylists", + "likes", + "liveEvents", + "multipleChannels", + "multiplePlaylists", + "popularUploads", + "postedPlaylists", + "postedVideos", + "recentActivity", + "recentPosts", + "recentUploads", + "singlePlaylist", + "subscriptions", + "upcomingEvents" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "ChannelSectionTargeting": { + "id": "ChannelSectionTargeting", + "type": "object", + "description": "ChannelSection targeting setting.", + "properties": { + "countries": { + "type": "array", + "description": "The country the channel section is targeting.", + "items": { + "type": "string" + } + }, + "languages": { + "type": "array", + "description": "The language the channel section is targeting.", + "items": { + "type": "string" + } + }, + "regions": { + "type": "array", + "description": "The region the channel section is targeting.", + "items": { + "type": "string" + } + } + } + }, + "ChannelSettings": { + "id": "ChannelSettings", + "type": "object", + "description": "Branding properties for the channel view.", + "properties": { + "country": { + "type": "string", + "description": "The country of the channel." + }, + "defaultLanguage": { + "type": "string" + }, + "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": { + "country": { + "type": "string", + "description": "The country of the channel." + }, + "defaultLanguage": { + "type": "string", + "description": "The language of the channel's default title and description." + }, + "description": { + "type": "string", + "description": "The description of the channel." + }, + "localized": { + "$ref": "ChannelLocalization", + "description": "Localized title and description, read-only." + }, + "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." + }, + "longUploadsStatus": { + "type": "string", + "description": "The long uploads status of this channel. See", + "enum": [ + "allowed", + "disallowed", + "eligible", + "longUploadsUnspecified" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "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" + } + } + } + }, + "Comment": { + "id": "Comment", + "type": "object", + "description": "A comment represents a single YouTube comment.", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the comment." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#comment\".", + "default": "youtube#comment" + }, + "snippet": { + "$ref": "CommentSnippet", + "description": "The snippet object contains basic details about the comment." + } + } + }, + "CommentListResponse": { + "id": "CommentListResponse", + "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 comments that match the request criteria.", + "items": { + "$ref": "Comment" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#commentListResponse\".", + "default": "youtube#commentListResponse" + }, + "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" + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "CommentSnippet": { + "id": "CommentSnippet", + "type": "object", + "description": "Basic details about a comment, such as its author and text.", + "properties": { + "authorChannelId": { + "$ref": "ChannelId", + "description": "The id of the author's YouTube channel, if any." + }, + "authorChannelUrl": { + "type": "string", + "description": "Link to the author's YouTube channel, if any." + }, + "authorDisplayName": { + "type": "string", + "description": "The name of the user who posted the comment." + }, + "authorGoogleplusProfileUrl": { + "type": "string", + "description": "Link to the author's Google+ profile, if any." + }, + "authorProfileImageUrl": { + "type": "string", + "description": "The URL for the avatar of the user who posted the comment." + }, + "canRate": { + "type": "boolean", + "description": "Whether the current viewer can rate this comment." + }, + "channelId": { + "type": "string", + "description": "The id of the corresponding YouTube channel. In case of a channel comment this is the channel the comment refers to. In case of a video comment it's the video's channel." + }, + "likeCount": { + "type": "integer", + "description": "The total number of likes this comment has received.", + "format": "uint32" + }, + "moderationStatus": { + "type": "string", + "description": "The comment's moderation status. Will not be set if the comments were requested through the id filter.", + "enum": [ + "heldForReview", + "likelySpam", + "published", + "rejected" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "parentId": { + "type": "string", + "description": "The unique id of the parent comment, only set for replies." + }, + "publishedAt": { + "type": "string", + "description": "The date and time when the comment was orignally published. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "textDisplay": { + "type": "string", + "description": "The comment's text. The format is either plain text or HTML dependent on what has been requested. Even the plain text representation may differ from the text originally posted in that it may replace video links with video titles etc." + }, + "textOriginal": { + "type": "string", + "description": "The comment's original raw text as initially posted or last updated. The original text will only be returned if it is accessible to the viewer, which is only guaranteed if the viewer is the comment's author." + }, + "updatedAt": { + "type": "string", + "description": "The date and time when was last updated . The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "videoId": { + "type": "string", + "description": "The ID of the video the comment refers to, if any." + }, + "viewerRating": { + "type": "string", + "description": "The rating the viewer has given to this comment. For the time being this will never return RATE_TYPE_DISLIKE and instead return RATE_TYPE_NONE. This may change in the future.", + "enum": [ + "dislike", + "like", + "none", + "unspecified" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "CommentThread": { + "id": "CommentThread", + "type": "object", + "description": "A comment thread represents information that applies to a top level comment and all its replies. It can also include the top level comment itself and some of the replies.", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the comment thread." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#commentThread\".", + "default": "youtube#commentThread" + }, + "replies": { + "$ref": "CommentThreadReplies", + "description": "The replies object contains a limited number of replies (if any) to the top level comment found in the snippet." + }, + "snippet": { + "$ref": "CommentThreadSnippet", + "description": "The snippet object contains basic details about the comment thread and also the top level comment." + } + } + }, + "CommentThreadListResponse": { + "id": "CommentThreadListResponse", + "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 comment threads that match the request criteria.", + "items": { + "$ref": "CommentThread" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#commentThreadListResponse\".", + "default": "youtube#commentThreadListResponse" + }, + "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" + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "CommentThreadReplies": { + "id": "CommentThreadReplies", + "type": "object", + "description": "Comments written in (direct or indirect) reply to the top level comment.", + "properties": { + "comments": { + "type": "array", + "description": "A limited number of replies. Unless the number of replies returned equals total_reply_count in the snippet the returned replies are only a subset of the total number of replies.", + "items": { + "$ref": "Comment" + } + } + } + }, + "CommentThreadSnippet": { + "id": "CommentThreadSnippet", + "type": "object", + "description": "Basic details about a comment thread.", + "properties": { + "canReply": { + "type": "boolean", + "description": "Whether the current viewer of the thread can reply to it. This is viewer specific - other viewers may see a different value for this field." + }, + "channelId": { + "type": "string", + "description": "The YouTube channel the comments in the thread refer to or the channel with the video the comments refer to. If video_id isn't set the comments refer to the channel itself." + }, + "isPublic": { + "type": "boolean", + "description": "Whether the thread (and therefore all its comments) is visible to all YouTube users." + }, + "topLevelComment": { + "$ref": "Comment", + "description": "The top level comment of this thread." + }, + "totalReplyCount": { + "type": "integer", + "description": "The total number of replies (not including the top level comment).", + "format": "uint32" + }, + "videoId": { + "type": "string", + "description": "The ID of the video the comments refer to, if any. No video_id implies a channel discussion comment." + } + } + }, + "ContentRating": { + "id": "ContentRating", + "type": "object", + "description": "Ratings schemes. The country-specific ratings are mostly for movies and shows. NEXT_ID: 66", + "properties": { + "acbRating": { + "type": "string", + "description": "The video's Australian Classification Board (ACB) or Australian Communications and Media Authority (ACMA) rating. ACMA ratings are used to classify children's television programming.", + "enum": [ + "acbC", + "acbE", + "acbG", + "acbM", + "acbMa15plus", + "acbP", + "acbPg", + "acbR18plus", + "acbUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "agcomRating": { + "type": "string", + "description": "The video's rating from Italy's Autorità per le Garanzie nelle Comunicazioni (AGCOM).", + "enum": [ + "agcomT", + "agcomUnrated", + "agcomVm14", + "agcomVm18" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "anatelRating": { + "type": "string", + "description": "The video's Anatel (Asociación Nacional de Televisión) rating for Chilean television.", + "enum": [ + "anatelA", + "anatelF", + "anatelI", + "anatelI10", + "anatelI12", + "anatelI7", + "anatelR", + "anatelUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "bbfcRating": { + "type": "string", + "description": "The video's British Board of Film Classification (BBFC) rating.", + "enum": [ + "bbfc12", + "bbfc12a", + "bbfc15", + "bbfc18", + "bbfcPg", + "bbfcR18", + "bbfcU", + "bbfcUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "bfvcRating": { + "type": "string", + "description": "The video's rating from Thailand's Board of Film and Video Censors.", + "enum": [ + "bfvc13", + "bfvc15", + "bfvc18", + "bfvc20", + "bfvcB", + "bfvcE", + "bfvcG", + "bfvcUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "bmukkRating": { + "type": "string", + "description": "The video's rating from the Austrian Board of Media Classification (Bundesministerium für Unterricht, Kunst und Kultur).", + "enum": [ + "bmukk10", + "bmukk12", + "bmukk14", + "bmukk16", + "bmukk6", + "bmukk8", + "bmukkAa", + "bmukkUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "catvRating": { + "type": "string", + "description": "Rating system for Canadian TV - Canadian TV Classification System The video's rating from the Canadian Radio-Television and Telecommunications Commission (CRTC) for Canadian English-language broadcasts. For more information, see the Canadian Broadcast Standards Council website.", + "enum": [ + "catv14plus", + "catv18plus", + "catvC", + "catvC8", + "catvG", + "catvPg", + "catvUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "catvfrRating": { + "type": "string", + "description": "The video's rating from the Canadian Radio-Television and Telecommunications Commission (CRTC) for Canadian French-language broadcasts. For more information, see the Canadian Broadcast Standards Council website.", + "enum": [ + "catvfr13plus", + "catvfr16plus", + "catvfr18plus", + "catvfr8plus", + "catvfrG", + "catvfrUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "cbfcRating": { + "type": "string", + "description": "The video's Central Board of Film Certification (CBFC - India) rating.", + "enum": [ + "cbfcA", + "cbfcS", + "cbfcU", + "cbfcUA", + "cbfcUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "cccRating": { + "type": "string", + "description": "The video's Consejo de Calificación Cinematográfica (Chile) rating.", + "enum": [ + "ccc14", + "ccc18", + "ccc18s", + "ccc18v", + "ccc6", + "cccTe", + "cccUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "cceRating": { + "type": "string", + "description": "The video's rating from Portugal's Comissão de Classificação de Espect´culos.", + "enum": [ + "cceM12", + "cceM16", + "cceM18", + "cceM4", + "cceM6", + "cceUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "chfilmRating": { + "type": "string", + "description": "The video's rating in Switzerland.", + "enum": [ + "chfilm0", + "chfilm12", + "chfilm16", + "chfilm18", + "chfilm6", + "chfilmUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "chvrsRating": { + "type": "string", + "description": "The video's Canadian Home Video Rating System (CHVRS) rating.", + "enum": [ + "chvrs14a", + "chvrs18a", + "chvrsE", + "chvrsG", + "chvrsPg", + "chvrsR", + "chvrsUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "cicfRating": { + "type": "string", + "description": "The video's rating from the Commission de Contrôle des Films (Belgium).", + "enum": [ + "cicfE", + "cicfKntEna", + "cicfKtEa", + "cicfUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "cnaRating": { + "type": "string", + "description": "The video's rating from Romania's CONSILIUL NATIONAL AL AUDIOVIZUALULUI (CNA).", + "enum": [ + "cna12", + "cna15", + "cna18", + "cna18plus", + "cnaAp", + "cnaUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "cncRating": { + "type": "string", + "description": "Rating system in France - Commission de classification cinematographique", + "enum": [ + "cnc10", + "cnc12", + "cnc16", + "cnc18", + "cncE", + "cncT", + "cncUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "csaRating": { + "type": "string", + "description": "The video's rating from France's Conseil supérieur de l?audiovisuel, which rates broadcast content.", + "enum": [ + "csa10", + "csa12", + "csa16", + "csa18", + "csaInterdiction", + "csaT", + "csaUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "cscfRating": { + "type": "string", + "description": "The video's rating from Luxembourg's Commission de surveillance de la classification des films (CSCF).", + "enum": [ + "cscf12", + "cscf16", + "cscf18", + "cscf6", + "cscf9", + "cscfA", + "cscfAl", + "cscfUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "czfilmRating": { + "type": "string", + "description": "The video's rating in the Czech Republic.", + "enum": [ + "czfilm12", + "czfilm14", + "czfilm18", + "czfilmU", + "czfilmUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "djctqRating": { + "type": "string", + "description": "The video's Departamento de Justiça, Classificação, Qualificação e Títulos (DJCQT - Brazil) rating.", + "enum": [ + "djctq10", + "djctq12", + "djctq14", + "djctq16", + "djctq18", + "djctqL", + "djctqUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "djctqRatingReasons": { + "type": "array", + "description": "Reasons that explain why the video received its DJCQT (Brazil) rating.", + "items": { + "type": "string", + "enum": [ + "djctqCriminalActs", + "djctqDrugs", + "djctqExplicitSex", + "djctqExtremeViolence", + "djctqIllegalDrugs", + "djctqImpactingContent", + "djctqInappropriateLanguage", + "djctqLegalDrugs", + "djctqNudity", + "djctqSex", + "djctqSexualContent", + "djctqViolence" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "eefilmRating": { + "type": "string", + "description": "The video's rating in Estonia.", + "enum": [ + "eefilmK12", + "eefilmK14", + "eefilmK16", + "eefilmK6", + "eefilmL", + "eefilmMs12", + "eefilmMs6", + "eefilmPere", + "eefilmUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "egfilmRating": { + "type": "string", + "description": "The video's rating in Egypt.", + "enum": [ + "egfilm18", + "egfilmBn", + "egfilmGn", + "egfilmUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "eirinRating": { + "type": "string", + "description": "The video's Eirin (映倫) rating. Eirin is the Japanese rating system.", + "enum": [ + "eirinG", + "eirinPg12", + "eirinR15plus", + "eirinR18plus", + "eirinUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "fcbmRating": { + "type": "string", + "description": "The video's rating from Malaysia's Film Censorship Board.", + "enum": [ + "fcbm18", + "fcbm18pa", + "fcbm18pl", + "fcbm18sg", + "fcbm18sx", + "fcbmP13", + "fcbmPg13", + "fcbmU", + "fcbmUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "fcoRating": { + "type": "string", + "description": "The video's rating from Hong Kong's Office for Film, Newspaper and Article Administration.", + "enum": [ + "fcoI", + "fcoIi", + "fcoIia", + "fcoIib", + "fcoIii", + "fcoUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "fmocRating": { + "type": "string", + "description": "This property has been deprecated. Use the contentDetails.contentRating.cncRating instead.", + "enum": [ + "fmoc10", + "fmoc12", + "fmoc16", + "fmoc18", + "fmocE", + "fmocU", + "fmocUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "fpbRating": { + "type": "string", + "description": "The video's rating from South Africa's Film and Publication Board.", + "enum": [ + "fpb1012Pg", + "fpb13", + "fpb16", + "fpb18", + "fpb79Pg", + "fpbA", + "fpbPg", + "fpbUnrated", + "fpbX18", + "fpbXx" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "fskRating": { + "type": "string", + "description": "The video's Freiwillige Selbstkontrolle der Filmwirtschaft (FSK - Germany) rating.", + "enum": [ + "fsk0", + "fsk12", + "fsk16", + "fsk18", + "fsk6", + "fskUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "grfilmRating": { + "type": "string", + "description": "The video's rating in Greece.", + "enum": [ + "grfilmE", + "grfilmK", + "grfilmK13", + "grfilmK17", + "grfilmUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "icaaRating": { + "type": "string", + "description": "The video's Instituto de la Cinematografía y de las Artes Audiovisuales (ICAA - Spain) rating.", + "enum": [ + "icaa12", + "icaa13", + "icaa16", + "icaa18", + "icaa7", + "icaaApta", + "icaaUnrated", + "icaaX" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "ifcoRating": { + "type": "string", + "description": "The video's Irish Film Classification Office (IFCO - Ireland) rating. See the IFCO website for more information.", + "enum": [ + "ifco12", + "ifco12a", + "ifco15", + "ifco15a", + "ifco16", + "ifco18", + "ifcoG", + "ifcoPg", + "ifcoUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "ilfilmRating": { + "type": "string", + "description": "The video's rating in Israel.", + "enum": [ + "ilfilm12", + "ilfilm16", + "ilfilm18", + "ilfilmAa", + "ilfilmUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "incaaRating": { + "type": "string", + "description": "The video's INCAA (Instituto Nacional de Cine y Artes Audiovisuales - Argentina) rating.", + "enum": [ + "incaaAtp", + "incaaC", + "incaaSam13", + "incaaSam16", + "incaaSam18", + "incaaUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "kfcbRating": { + "type": "string", + "description": "The video's rating from the Kenya Film Classification Board.", + "enum": [ + "kfcb16plus", + "kfcbG", + "kfcbPg", + "kfcbR", + "kfcbUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "kijkwijzerRating": { + "type": "string", + "description": "voor de Classificatie van Audiovisuele Media (Netherlands).", + "enum": [ + "kijkwijzer12", + "kijkwijzer16", + "kijkwijzer18", + "kijkwijzer6", + "kijkwijzer9", + "kijkwijzerAl", + "kijkwijzerUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "kmrbRating": { + "type": "string", + "description": "The video's Korea Media Rating Board (영상물등급위원회) rating. The KMRB rates videos in South Korea.", + "enum": [ + "kmrb12plus", + "kmrb15plus", + "kmrbAll", + "kmrbR", + "kmrbTeenr", + "kmrbUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "lsfRating": { + "type": "string", + "description": "The video's rating from Indonesia's Lembaga Sensor Film.", + "enum": [ + "lsf13", + "lsf17", + "lsf21", + "lsfA", + "lsfBo", + "lsfD", + "lsfR", + "lsfSu", + "lsfUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "mccaaRating": { + "type": "string", + "description": "The video's rating from Malta's Film Age-Classification Board.", + "enum": [ + "mccaa12", + "mccaa12a", + "mccaa14", + "mccaa15", + "mccaa16", + "mccaa18", + "mccaaPg", + "mccaaU", + "mccaaUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "mccypRating": { + "type": "string", + "description": "The video's rating from the Danish Film Institute's (Det Danske Filminstitut) Media Council for Children and Young People.", + "enum": [ + "mccyp11", + "mccyp15", + "mccyp7", + "mccypA", + "mccypUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "mdaRating": { + "type": "string", + "description": "The video's rating from Singapore's Media Development Authority (MDA) and, specifically, it's Board of Film Censors (BFC).", + "enum": [ + "mdaG", + "mdaM18", + "mdaNc16", + "mdaPg", + "mdaPg13", + "mdaR21", + "mdaUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "medietilsynetRating": { + "type": "string", + "description": "The video's rating from Medietilsynet, the Norwegian Media Authority.", + "enum": [ + "medietilsynet11", + "medietilsynet12", + "medietilsynet15", + "medietilsynet18", + "medietilsynet6", + "medietilsynet7", + "medietilsynet9", + "medietilsynetA", + "medietilsynetUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "mekuRating": { + "type": "string", + "description": "The video's rating from Finland's Kansallinen Audiovisuaalinen Instituutti (National Audiovisual Institute).", + "enum": [ + "meku12", + "meku16", + "meku18", + "meku7", + "mekuS", + "mekuUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "mibacRating": { + "type": "string", + "description": "The video's rating from the Ministero dei Beni e delle Attività Culturali e del Turismo (Italy).", + "enum": [ + "mibacT", + "mibacUnrated", + "mibacVap", + "mibacVm12", + "mibacVm14", + "mibacVm18" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "mocRating": { + "type": "string", + "description": "The video's Ministerio de Cultura (Colombia) rating.", + "enum": [ + "moc12", + "moc15", + "moc18", + "moc7", + "mocBanned", + "mocE", + "mocT", + "mocUnrated", + "mocX" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "moctwRating": { + "type": "string", + "description": "The video's rating from Taiwan's Ministry of Culture (文化部).", + "enum": [ + "moctwG", + "moctwP", + "moctwPg", + "moctwR", + "moctwUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "mpaaRating": { + "type": "string", + "description": "The video's Motion Picture Association of America (MPAA) rating.", + "enum": [ + "mpaaG", + "mpaaNc17", + "mpaaPg", + "mpaaPg13", + "mpaaR", + "mpaaUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "mtrcbRating": { + "type": "string", + "description": "The video's rating from the Movie and Television Review and Classification Board (Philippines).", + "enum": [ + "mtrcbG", + "mtrcbPg", + "mtrcbR13", + "mtrcbR16", + "mtrcbR18", + "mtrcbUnrated", + "mtrcbX" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "nbcRating": { + "type": "string", + "description": "The video's rating from the Maldives National Bureau of Classification.", + "enum": [ + "nbc12plus", + "nbc15plus", + "nbc18plus", + "nbc18plusr", + "nbcG", + "nbcPg", + "nbcPu", + "nbcUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "nbcplRating": { + "type": "string", + "description": "The video's rating in Poland.", + "enum": [ + "nbcpl18plus", + "nbcplI", + "nbcplIi", + "nbcplIii", + "nbcplIv", + "nbcplUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "nfrcRating": { + "type": "string", + "description": "The video's rating from the Bulgarian National Film Center.", + "enum": [ + "nfrcA", + "nfrcB", + "nfrcC", + "nfrcD", + "nfrcUnrated", + "nfrcX" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "nfvcbRating": { + "type": "string", + "description": "The video's rating from Nigeria's National Film and Video Censors Board.", + "enum": [ + "nfvcb12", + "nfvcb12a", + "nfvcb15", + "nfvcb18", + "nfvcbG", + "nfvcbPg", + "nfvcbRe", + "nfvcbUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "nkclvRating": { + "type": "string", + "description": "The video's rating from the Nacionãlais Kino centrs (National Film Centre of Latvia).", + "enum": [ + "nkclv12plus", + "nkclv18plus", + "nkclv7plus", + "nkclvU", + "nkclvUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "oflcRating": { + "type": "string", + "description": "The video's Office of Film and Literature Classification (OFLC - New Zealand) rating.", + "enum": [ + "oflcG", + "oflcM", + "oflcPg", + "oflcR13", + "oflcR15", + "oflcR16", + "oflcR18", + "oflcRp13", + "oflcRp16", + "oflcUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "pefilmRating": { + "type": "string", + "description": "The video's rating in Peru.", + "enum": [ + "pefilm14", + "pefilm18", + "pefilmPg", + "pefilmPt", + "pefilmUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "rcnofRating": { + "type": "string", + "description": "The video's rating from the Hungarian Nemzeti Filmiroda, the Rating Committee of the National Office of Film.", + "enum": [ + "rcnofI", + "rcnofIi", + "rcnofIii", + "rcnofIv", + "rcnofUnrated", + "rcnofV", + "rcnofVi" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "resorteviolenciaRating": { + "type": "string", + "description": "The video's rating in Venezuela.", + "enum": [ + "resorteviolenciaA", + "resorteviolenciaB", + "resorteviolenciaC", + "resorteviolenciaD", + "resorteviolenciaE", + "resorteviolenciaUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "rtcRating": { + "type": "string", + "description": "The video's General Directorate of Radio, Television and Cinematography (Mexico) rating.", + "enum": [ + "rtcA", + "rtcAa", + "rtcB", + "rtcB15", + "rtcC", + "rtcD", + "rtcUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "rteRating": { + "type": "string", + "description": "The video's rating from Ireland's Raidió Teilifís Éireann.", + "enum": [ + "rteCh", + "rteGa", + "rteMa", + "rtePs", + "rteUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "russiaRating": { + "type": "string", + "description": "The video's National Film Registry of the Russian Federation (MKRF - Russia) rating.", + "enum": [ + "russia0", + "russia12", + "russia16", + "russia18", + "russia6", + "russiaUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "skfilmRating": { + "type": "string", + "description": "The video's rating in Slovakia.", + "enum": [ + "skfilmG", + "skfilmP2", + "skfilmP5", + "skfilmP8", + "skfilmUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "smaisRating": { + "type": "string", + "description": "The video's rating in Iceland.", + "enum": [ + "smais12", + "smais14", + "smais16", + "smais18", + "smais7", + "smaisL", + "smaisUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "smsaRating": { + "type": "string", + "description": "The video's rating from Statens medieråd (Sweden's National Media Council).", + "enum": [ + "smsa11", + "smsa15", + "smsa7", + "smsaA", + "smsaUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "tvpgRating": { + "type": "string", + "description": "The video's TV Parental Guidelines (TVPG) rating.", + "enum": [ + "pg14", + "tvpgG", + "tvpgMa", + "tvpgPg", + "tvpgUnrated", + "tvpgY", + "tvpgY7", + "tvpgY7Fv" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "ytRating": { + "type": "string", + "description": "A rating that YouTube uses to identify age-restricted content.", + "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." + }, + "useSmartTiming": { + "type": "boolean", + "description": "Indicates whether the channel's promotional campaign uses \"smart timing.\" This feature attempts to show promotions at a point in the video when they are more likely to be clicked and less likely to disrupt the viewing experience. This feature also picks up a single promotion to show on each video." + } + } + }, + "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": [ + "", + "" + ] + } + } + }, + "LanguageTag": { + "id": "LanguageTag", + "type": "object", + "properties": { + "value": { + "type": "string" + } + } + }, + "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." + }, + "statistics": { + "$ref": "LiveBroadcastStatistics", + "description": "The statistics object contains info about the event's current stats. These include concurrent viewers and total chat count. Statistics can change (in either direction) during the lifetime of an event. Statistics are only returned while the event is live." + }, + "status": { + "$ref": "LiveBroadcastStatus", + "description": "The status object contains information about the event's status." + }, + "topicDetails": { + "$ref": "LiveBroadcastTopicDetails" + } + } + }, + "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" + ] + } + }, + "enableLowLatency": { + "type": "boolean" + }, + "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." + }, + "isDefaultBroadcast": { + "type": "boolean" + }, + "liveChatId": { + "type": "string", + "description": "The id of the live chat for this broadcast." + }, + "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" + ] + } + } + } + }, + "LiveBroadcastStatistics": { + "id": "LiveBroadcastStatistics", + "type": "object", + "description": "Statistics about the live broadcast. These represent a snapshot of the values at the time of the request. Statistics are only returned for live broadcasts.", + "properties": { + "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" + }, + "totalChatCount": { + "type": "string", + "description": "The total number of live chat messages currently on the broadcast. The property and its value will be present if the broadcast is public, has the live chat feature enabled, and has at least one message. Note that this field will not be filled after the broadcast ends. So this property would not identify the number of chat messages for an archived video of a completed live broadcast.", + "format": "uint64" + } + } + }, + "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": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "liveBroadcastPriority": { + "type": "string", + "description": "Priority of the live broadcast event (internal state).", + "enum": [ + "high", + "low", + "normal" + ], + "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": [ + "", + "", + "" + ] + } + } + }, + "LiveBroadcastTopic": { + "id": "LiveBroadcastTopic", + "type": "object", + "properties": { + "snippet": { + "$ref": "LiveBroadcastTopicSnippet", + "description": "Information about the topic matched." + }, + "type": { + "type": "string", + "description": "The type of the topic.", + "enum": [ + "videoGame" + ], + "enumDescriptions": [ + "" + ] + }, + "unmatched": { + "type": "boolean", + "description": "If this flag is set it means that we have not been able to match the topic title and type provided to a known entity." + } + } + }, + "LiveBroadcastTopicDetails": { + "id": "LiveBroadcastTopicDetails", + "type": "object", + "properties": { + "topics": { + "type": "array", + "items": { + "$ref": "LiveBroadcastTopic" + } + } + } + }, + "LiveBroadcastTopicSnippet": { + "id": "LiveBroadcastTopicSnippet", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the topic." + }, + "releaseDate": { + "type": "string", + "description": "The date at which the topic was released. Filled for types: videoGame" + } + } + }, + "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." + } + } + }, + "LiveStreamConfigurationIssue": { + "id": "LiveStreamConfigurationIssue", + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "The long-form description of the issue and how to resolve it." + }, + "reason": { + "type": "string", + "description": "The short-form reason for this issue." + }, + "severity": { + "type": "string", + "description": "How severe this issue is to the stream.", + "enum": [ + "error", + "info", + "warning" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "type": { + "type": "string", + "description": "The kind of error happening.", + "enum": [ + "audioBitrateHigh", + "audioBitrateLow", + "audioBitrateMismatch", + "audioCodec", + "audioCodecMismatch", + "audioSampleRate", + "audioSampleRateMismatch", + "audioStereoMismatch", + "audioTooManyChannels", + "badContainer", + "bitrateHigh", + "bitrateLow", + "frameRateHigh", + "framerateMismatch", + "gopMismatch", + "gopSizeLong", + "gopSizeOver", + "gopSizeShort", + "interlacedVideo", + "multipleAudioStreams", + "multipleVideoStreams", + "noAudioStream", + "noVideoStream", + "openGop", + "resolutionMismatch", + "videoBitrateMismatch", + "videoCodec", + "videoCodecMismatch", + "videoIngestionStarved", + "videoInterlaceMismatch", + "videoProfileMismatch", + "videoResolutionSuboptimal", + "videoResolutionUnsupported" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "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." + }, + "isReusable": { + "type": "boolean", + "description": "Indicates whether the stream is reusable, which means that it can be bound to multiple broadcasts. It is common for broadcasters to reuse the same stream for many different broadcasts if those broadcasts occur at different times.\n\nIf you set this value to false, then the stream will not be reusable, which means that it can only be bound to one broadcast. Non-reusable streams differ from reusable streams in the following ways: \n- A non-reusable stream can only be bound to one broadcast. \n- A non-reusable stream might be deleted by an automated process after the broadcast ends. \n- The liveStreams.list method does not list non-reusable streams if you call the method and set the mine parameter to true. The only way to use that method to retrieve the resource for a non-reusable stream is to use the id parameter to identify the stream." + } + } + }, + "LiveStreamHealthStatus": { + "id": "LiveStreamHealthStatus", + "type": "object", + "properties": { + "configurationIssues": { + "type": "array", + "description": "The configurations issues on this stream", + "items": { + "$ref": "LiveStreamConfigurationIssue" + } + }, + "lastUpdateTimeSeconds": { + "type": "string", + "description": "The last time this status was updated (in seconds)", + "format": "uint64" + }, + "status": { + "type": "string", + "description": "The status code of this stream", + "enum": [ + "bad", + "good", + "noData", + "ok", + "revoked" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + } + } + }, + "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." + }, + "isDefaultStream": { + "type": "boolean" + }, + "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": { + "healthStatus": { + "$ref": "LiveStreamHealthStatus", + "description": "The health status of the stream." + }, + "streamStatus": { + "type": "string", + "enum": [ + "active", + "created", + "error", + "inactive", + "ready" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + } + } + }, + "LocalizedProperty": { + "id": "LocalizedProperty", + "type": "object", + "properties": { + "default": { + "type": "string" + }, + "defaultLanguage": { + "$ref": "LanguageTag", + "description": "The language of the default property." + }, + "localized": { + "type": "array", + "items": { + "$ref": "LocalizedString" + } + } + } + }, + "LocalizedString": { + "id": "LocalizedString", + "type": "object", + "properties": { + "language": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "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" + }, + "localizations": { + "type": "object", + "description": "Localizations for different languages", + "additionalProperties": { + "$ref": "PlaylistLocalization", + "description": "The language tag, using string since map_key require simple types." + } + }, + "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." + } + } + }, + "PlaylistLocalization": { + "id": "PlaylistLocalization", + "type": "object", + "description": "Playlist localization setting", + "properties": { + "description": { + "type": "string", + "description": "The localized strings for playlist's description." + }, + "title": { + "type": "string", + "description": "The localized strings for playlist's title." + } + } + }, + "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." + }, + "defaultLanguage": { + "type": "string", + "description": "The language of the playlist's default title and description." + }, + "description": { + "type": "string", + "description": "The playlist's description." + }, + "localized": { + "$ref": "PlaylistLocalization", + "description": "Localized title and description, read-only." + }, + "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. This data can only be retrieved by the video owner." + }, + "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." + }, + "localizations": { + "type": "object", + "description": "List with all localizations.", + "additionalProperties": { + "$ref": "VideoLocalization", + "description": "The language tag, using string since map_key require simple types." + } + }, + "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." + } + } + }, + "VideoAbuseReport": { + "id": "VideoAbuseReport", + "type": "object", + "properties": { + "comments": { + "type": "string", + "description": "Additional comments regarding the abuse report." + }, + "language": { + "type": "string", + "description": "The language that the content was viewed in." + }, + "reasonId": { + "type": "string", + "description": "The high-level, or primary, reason that the content is abusive. The value is an abuse report reason ID." + }, + "secondaryReasonId": { + "type": "string", + "description": "The specific, or secondary, reason that this content is abusive (if available). The value is an abuse report reason ID that is a valid secondary reason for the primary reason." + }, + "videoId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the video." + } + } + }, + "VideoAbuseReportReason": { + "id": "VideoAbuseReportReason", + "type": "object", + "description": "A videoAbuseReportReason resource identifies a reason that a video could be reported as abusive. Video abuse report reasons are used with video.ReportAbuse.", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID of this abuse report reason." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#videoAbuseReportReason\".", + "default": "youtube#videoAbuseReportReason" + }, + "snippet": { + "$ref": "VideoAbuseReportReasonSnippet", + "description": "The snippet object contains basic details about the abuse report reason." + } + } + }, + "VideoAbuseReportReasonListResponse": { + "id": "VideoAbuseReportReasonListResponse", + "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 valid abuse reasons that are used with video.ReportAbuse.", + "items": { + "$ref": "VideoAbuseReportReason" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#videoAbuseReportReasonListResponse\".", + "default": "youtube#videoAbuseReportReasonListResponse" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "VideoAbuseReportReasonSnippet": { + "id": "VideoAbuseReportReasonSnippet", + "type": "object", + "description": "Basic details about a video category, such as its localized title.", + "properties": { + "label": { + "type": "string", + "description": "The localized label belonging to this abuse report reason." + }, + "secondaryReasons": { + "type": "array", + "description": "The secondary reasons associated with this reason, if any are available. (There might be 0 or more.)", + "items": { + "$ref": "VideoAbuseReportSecondaryReason" + } + } + } + }, + "VideoAbuseReportSecondaryReason": { + "id": "VideoAbuseReportSecondaryReason", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of this abuse report secondary reason." + }, + "label": { + "type": "string", + "description": "The localized label for this abuse report secondary reason." + } + } + }, + "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." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "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" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "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" + } + } + }, + "VideoLocalization": { + "id": "VideoLocalization", + "type": "object", + "description": "Localized versions of certain video properties (e.g. title).", + "properties": { + "description": { + "type": "string", + "description": "Localized version of the video's description." + }, + "title": { + "type": "string", + "description": "Localized version of the video's title." + } + } + }, + "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.sssZ) 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." + }, + "defaultAudioLanguage": { + "type": "string", + "description": "The default_audio_language property specifies the language spoken in the video's default audio track." + }, + "defaultLanguage": { + "type": "string", + "description": "The language of the videos's default snippet." + }, + "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": [ + "", + "", + "" + ] + }, + "localized": { + "$ref": "VideoLocalization", + "description": "Localized snippet selected with the hl parameter. If no such localization exists, this field is populated with the default snippet. (Read-only)" + }, + "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.", + "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.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "Activity" + }, + "response": { + "$ref": "Activity" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "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.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in an 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.force-ssl", + "https://www.googleapis.com/auth/youtube.readonly" + ] + } + } + }, + "captions": { + "methods": { + "delete": { + "id": "youtube.captions.delete", + "path": "captions", + "httpMethod": "DELETE", + "description": "Deletes a specified caption track.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter identifies the caption track that is being deleted. The value is a caption track ID as identified by the id property in a caption resource.", + "required": true, + "location": "query" + }, + "onBehalfOf": { + "type": "string", + "description": "ID of the Google+ Page for the channel that the request is be on behalf of", + "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.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "download": { + "id": "youtube.captions.download", + "path": "captions/{id}", + "httpMethod": "GET", + "description": "Downloads a caption track. The caption track is returned in its original format unless the request specifies a value for the tfmt parameter and in its original language unless the request specifies a value for the tlang parameter.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter identifies the caption track that is being retrieved. The value is a caption track ID as identified by the id property in a caption resource.", + "required": true, + "location": "path" + }, + "onBehalfOf": { + "type": "string", + "description": "ID of the Google+ Page for the channel that the request is be on behalf of", + "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" + }, + "tfmt": { + "type": "string", + "description": "The tfmt parameter specifies that the caption track should be returned in a specific format. If the parameter is not included in the request, the track is returned in its original format.", + "enum": [ + "sbv", + "scc", + "srt", + "ttml", + "vtt" + ], + "enumDescriptions": [ + "SubViewer subtitle.", + "Scenarist Closed Caption format.", + "SubRip subtitle.", + "Timed Text Markup Language caption.", + "Web Video Text Tracks caption." + ], + "location": "query" + }, + "tlang": { + "type": "string", + "description": "The tlang parameter specifies that the API response should return a translation of the specified caption track. The parameter value is an ISO 639-1 two-letter language code that identifies the desired caption language. The translation is generated by using machine translation, such as Google Translate.", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ], + "supportsMediaDownload": true + }, + "insert": { + "id": "youtube.captions.insert", + "path": "captions", + "httpMethod": "POST", + "description": "Uploads a caption track.", + "parameters": { + "onBehalfOf": { + "type": "string", + "description": "ID of the Google+ Page for the channel that the request is be on behalf of", + "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" + }, + "part": { + "type": "string", + "description": "The part parameter specifies the caption resource parts that the API response will include. Set the parameter value to snippet.", + "required": true, + "location": "query" + }, + "sync": { + "type": "boolean", + "description": "The sync parameter indicates whether YouTube should automatically synchronize the caption file with the audio track of the video. If you set the value to true, YouTube will disregard any time codes that are in the uploaded caption file and generate new time codes for the captions.\n\nYou should set the sync parameter to true if you are uploading a transcript, which has no time codes, or if you suspect the time codes in your file are incorrect and want YouTube to try to fix them.", + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "Caption" + }, + "response": { + "$ref": "Caption" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "*/*", + "application/octet-stream", + "text/xml" + ], + "maxSize": "100MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/youtube/v3/captions" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/youtube/v3/captions" + } + } + } + }, + "list": { + "id": "youtube.captions.list", + "path": "captions", + "httpMethod": "GET", + "description": "Returns a list of caption tracks that are associated with a specified video. Note that the API response does not contain the actual captions and that the captions.download method provides the ability to retrieve a caption track.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of IDs that identify the caption resources that should be retrieved. Each ID must identify a caption track associated with the specified video.", + "location": "query" + }, + "onBehalfOf": { + "type": "string", + "description": "ID of the Google+ Page for the channel that the request is on behalf of.", + "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" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more caption resource parts 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" + }, + "videoId": { + "type": "string", + "description": "The videoId parameter specifies the YouTube video ID of the video for which the API should return caption tracks.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part", + "videoId" + ], + "response": { + "$ref": "CaptionListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "update": { + "id": "youtube.captions.update", + "path": "captions", + "httpMethod": "PUT", + "description": "Updates a caption track. When updating a caption track, you can change the track's draft status, upload a new caption file for the track, or both.", + "parameters": { + "onBehalfOf": { + "type": "string", + "description": "ID of the Google+ Page for the channel that the request is be on behalf of", + "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" + }, + "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. Set the property value to snippet if you are updating the track's draft status. Otherwise, set the property value to id.", + "required": true, + "location": "query" + }, + "sync": { + "type": "boolean", + "description": "Note: The API server only processes the parameter value if the request contains an updated caption file.\n\nThe sync parameter indicates whether YouTube should automatically synchronize the caption file with the audio track of the video. If you set the value to true, YouTube will automatically synchronize the caption track with the audio track.", + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "Caption" + }, + "response": { + "$ref": "Caption" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "*/*", + "application/octet-stream", + "text/xml" + ], + "maxSize": "100MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/youtube/v3/captions" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/youtube/v3/captions" + } + } + } + } + } + }, + "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.force-ssl", + "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" + }, + "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/youtube.force-ssl", + "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": { + "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 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/youtube.force-ssl", + "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" + }, + "hl": { + "type": "string", + "description": "The hl parameter indicates that the snippet.localized property values in the returned channelSection resources should be in the specified language if localized values for that language are available. For example, if the API request specifies hl=de, the snippet.localized properties in the API response will contain German titles if German titles are available. Channel owners can provide localized channel section titles using either the channelSections.insert or channelSections.update method.", + "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.force-ssl", + "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": { + "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 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/youtube.force-ssl", + "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" + }, + "hl": { + "type": "string", + "description": "The hl parameter should be used for filter out the properties that are not in the given language. Used for the brandingSettings part.", + "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": "Note: This parameter is intended exclusively for YouTube content partners.\n\nSet 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": "Use the subscriptions.list method and its mySubscribers parameter to retrieve a list of subscribers to the authenticated user's channel.", + "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 channel resource properties that the API response will include.\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.force-ssl", + "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. Note that this method currently only supports updates to the channel resource's brandingSettings and invideoPromotion objects and their child properties.", + "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 API currently only allows the parameter value to be set to either brandingSettings or invideoPromotion. (You cannot update both of those parts with a single request.)\n\nNote that this method overrides 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/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ] + } + } + }, + "commentThreads": { + "methods": { + "insert": { + "id": "youtube.commentThreads.insert", + "path": "commentThreads", + "httpMethod": "POST", + "description": "Creates a new top-level comment. To add a reply to an existing comment, use the comments.insert method instead.", + "parameters": { + "part": { + "type": "string", + "description": "The part parameter identifies the properties that the API response will include. Set the parameter value to snippet. The snippet part has a quota cost of 2 units.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "CommentThread" + }, + "response": { + "$ref": "CommentThread" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "list": { + "id": "youtube.commentThreads.list", + "path": "commentThreads", + "httpMethod": "GET", + "description": "Returns a list of comment threads that match the API request parameters.", + "parameters": { + "allThreadsRelatedToChannelId": { + "type": "string", + "description": "The allThreadsRelatedToChannelId parameter instructs the API to return all comment threads associated with the specified channel. The response can include comments about the channel or about the channel's videos.", + "location": "query" + }, + "channelId": { + "type": "string", + "description": "The channelId parameter instructs the API to return comment threads containing comments about the specified channel. (The response will not include comments left on videos that the channel uploaded.)", + "location": "query" + }, + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of comment thread IDs for the resources that should be retrieved.", + "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 not supported for use in conjunction with the id parameter.", + "default": "20", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "moderationStatus": { + "type": "string", + "description": "Set this parameter to limit the returned comment threads to a particular moderation state.\n\nNote: This parameter is not supported for use in conjunction with the id parameter.", + "default": "MODERATION_STATUS_PUBLISHED", + "enum": [ + "heldForReview", + "likelySpam", + "published" + ], + "enumDescriptions": [ + "Retrieve comment threads that are awaiting review by a moderator. A comment thread can be included in the response if the top-level comment or at least one of the replies to that comment are awaiting review.", + "Retrieve comment threads classified as likely to be spam. A comment thread can be included in the response if the top-level comment or at least one of the replies to that comment is considered likely to be spam.", + "Retrieve threads of published comments. This is the default value. A comment thread can be included in the response if its top-level comment has been published." + ], + "location": "query" + }, + "order": { + "type": "string", + "description": "The order parameter specifies the order in which the API response should list comment threads. Valid values are: \n- time - Comment threads are ordered by time. This is the default behavior.\n- relevance - Comment threads are ordered by relevance.Note: This parameter is not supported for use in conjunction with the id parameter.", + "default": "true", + "enum": [ + "relevance", + "time" + ], + "enumDescriptions": [ + "Order by relevance.", + "Order by time." + ], + "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 property identifies the next page of the result that can be retrieved.\n\nNote: This parameter 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 commentThread resource properties that the API response will include.", + "required": true, + "location": "query" + }, + "searchTerms": { + "type": "string", + "description": "The searchTerms parameter instructs the API to limit the API response to only contain comments that contain the specified search terms.\n\nNote: This parameter is not supported for use in conjunction with the id parameter.", + "location": "query" + }, + "textFormat": { + "type": "string", + "description": "Set this parameter's value to html or plainText to instruct the API to return the comments left by users in html formatted or in plain text.", + "default": "FORMAT_HTML", + "enum": [ + "html", + "plainText" + ], + "enumDescriptions": [ + "Returns the comments in HTML format. This is the default value.", + "Returns the comments in plain text format." + ], + "location": "query" + }, + "videoId": { + "type": "string", + "description": "The videoId parameter instructs the API to return comment threads associated with the specified video ID.", + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "CommentThreadListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "update": { + "id": "youtube.commentThreads.update", + "path": "commentThreads", + "httpMethod": "PUT", + "description": "Modifies the top-level comment in a comment thread.", + "parameters": { + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of commentThread resource properties that the API response will include. You must at least include the snippet part in the parameter value since that part contains all of the properties that the API request can update.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "CommentThread" + }, + "response": { + "$ref": "CommentThread" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + } + } + }, + "comments": { + "methods": { + "delete": { + "id": "youtube.comments.delete", + "path": "comments", + "httpMethod": "DELETE", + "description": "Deletes a comment.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies the comment ID for the resource that is being deleted.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "insert": { + "id": "youtube.comments.insert", + "path": "comments", + "httpMethod": "POST", + "description": "Creates a reply to an existing comment. Note: To create a top-level comment, use the commentThreads.insert method.", + "parameters": { + "part": { + "type": "string", + "description": "The part parameter identifies the properties that the API response will include. Set the parameter value to snippet. The snippet part has a quota cost of 2 units.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "Comment" + }, + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "list": { + "id": "youtube.comments.list", + "path": "comments", + "httpMethod": "GET", + "description": "Returns a list of comments that match the API request parameters.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of comment IDs for the resources that are being retrieved. In a comment resource, the id property specifies the comment'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.\n\nNote: This parameter is not supported for use in conjunction with the id parameter.", + "default": "20", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "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 property identifies the next page of the result that can be retrieved.\n\nNote: This parameter is not supported for use in conjunction with the id parameter.", + "location": "query" + }, + "parentId": { + "type": "string", + "description": "The parentId parameter specifies the ID of the comment for which replies should be retrieved.\n\nNote: YouTube currently supports replies only for top-level comments. However, replies to replies may be supported in the future.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more comment resource properties that the API response will include.", + "required": true, + "location": "query" + }, + "textFormat": { + "type": "string", + "description": "This parameter indicates whether the API should return comments formatted as HTML or as plain text.", + "default": "FORMAT_HTML", + "enum": [ + "html", + "plainText" + ], + "enumDescriptions": [ + "Returns the comments in HTML format. This is the default value.", + "Returns the comments in plain text format." + ], + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "CommentListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "markAsSpam": { + "id": "youtube.comments.markAsSpam", + "path": "comments/markAsSpam", + "httpMethod": "POST", + "description": "Expresses the caller's opinion that one or more comments should be flagged as spam.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of IDs of comments that the caller believes should be classified as spam.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "setModerationStatus": { + "id": "youtube.comments.setModerationStatus", + "path": "comments/setModerationStatus", + "httpMethod": "POST", + "description": "Sets the moderation status of one or more comments. The API request must be authorized by the owner of the channel or video associated with the comments.", + "parameters": { + "banAuthor": { + "type": "boolean", + "description": "The banAuthor parameter lets you indicate that you want to automatically reject any additional comments written by the comment's author. Set the parameter value to true to ban the author.\n\nNote: This parameter is only valid if the moderationStatus parameter is also set to rejected.", + "default": "false", + "location": "query" + }, + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of IDs that identify the comments for which you are updating the moderation status.", + "required": true, + "location": "query" + }, + "moderationStatus": { + "type": "string", + "description": "Identifies the new moderation status of the specified comments.", + "required": true, + "enum": [ + "heldForReview", + "published", + "rejected" + ], + "enumDescriptions": [ + "Marks a comment as awaiting review by a moderator.", + "Clears a comment for public display.", + "Rejects a comment as being unfit for display. This action also effectively hides all replies to the rejected comment.\n\nNote: The API does not currently provide a way to list or otherwise discover rejected comments. However, you can change the moderation status of a rejected comment if you still know its ID. If you were to change the moderation status of a rejected comment, the comment replies would subsequently be discoverable again as well." + ], + "location": "query" + } + }, + "parameterOrder": [ + "id", + "moderationStatus" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "update": { + "id": "youtube.comments.update", + "path": "comments", + "httpMethod": "PUT", + "description": "Modifies a comment.", + "parameters": { + "part": { + "type": "string", + "description": "The part parameter identifies the properties that the API response will include. You must at least include the snippet part in the parameter value since that part contains all of the properties that the API request can update.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "Comment" + }, + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + } + } + }, + "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 the guideCategory resource properties that the API response will include. Set the parameter value to snippet.", + "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.force-ssl", + "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 application languages that the YouTube website supports.", + "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 the i18nLanguage resource properties that the API response will include. Set the parameter value to snippet.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "I18nLanguageListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "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 content regions that the YouTube website supports.", + "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 the i18nRegion resource properties that the API response will include. Set the parameter value to snippet.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "I18nRegionListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "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, though a video stream may be bound to more than one broadcast.", + "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", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "bind_direct": { + "id": "youtube.liveBroadcasts.bind_direct", + "path": "liveBroadcasts/bind/direct", + "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, though a video stream may be bound to more than one broadcast.", + "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", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "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. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sssZ) format.", + "format": "date-time", + "location": "query" + } + }, + "parameterOrder": [ + "id", + "part" + ], + "response": { + "$ref": "LiveBroadcast" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "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", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "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", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "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.force-ssl", + "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", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "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", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + } + } + }, + "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", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "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", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "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.", + "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.force-ssl", + "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", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + } + } + }, + "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/youtube.force-ssl", + "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.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "PlaylistItem" + }, + "response": { + "$ref": "PlaylistItem" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "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.\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.force-ssl", + "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\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/youtube.force-ssl", + "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/youtube.force-ssl", + "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.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "Playlist" + }, + "response": { + "$ref": "Playlist" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "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" + }, + "hl": { + "type": "string", + "description": "The hl parameter should be used for filter out the properties that are not in the given language. Used for the snippet part.", + "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.\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.force-ssl", + "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\nNote that this method will override the existing values for mutable properties that are contained in any parts that the request body specifies. For example, a playlist's description is contained in the snippet part, which must be included in the request body. If the request does not specify a value for the snippet.description property, the playlist's existing description will be deleted.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "Playlist" + }, + "response": { + "$ref": "Playlist" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "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. If you specify a value for this parameter, you must also set the type parameter's value to video.", + "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" + }, + "forDeveloper": { + "type": "boolean", + "description": "The forDeveloper parameter restricts the search to only retrieve videos uploaded via the developer's application or website. The API server uses the request's authorization credentials to identify the developer. Therefore, a developer can restrict results to videos uploaded through the developer's own app or website but not to videos uploaded through other apps or sites.", + "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" + }, + "location": { + "type": "string", + "description": "The location parameter, in conjunction with the locationRadius parameter, defines a circular geographic area and also restricts a search to videos that specify, in their metadata, a geographic location that falls within that area. The parameter value is a string that specifies latitude/longitude coordinates e.g. (37.42307,-122.08427).\n\n\n- The location parameter value identifies the point at the center of the area.\n- The locationRadius parameter specifies the maximum distance that the location associated with a video can be from that point for the video to still be included in the search results.The API returns an error if your request specifies a value for the location parameter but does not also specify a value for the locationRadius parameter.", + "location": "query" + }, + "locationRadius": { + "type": "string", + "description": "The locationRadius parameter, in conjunction with the location parameter, defines a circular geographic area.\n\nThe parameter value must be a floating point number followed by a measurement unit. Valid measurement units are m, km, ft, and mi. For example, valid parameter values include 1500m, 5km, 10000ft, and 0.75mi. The API does not support locationRadius parameter values larger than 1000 kilometers.\n\nNote: See the definition of the location parameter for more information.", + "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. Set the parameter value to snippet.", + "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.\n\nYour request can also use the Boolean NOT (-) and OR (|) operators to exclude videos or to find videos that are associated with one of several search terms. For example, to search for videos matching either \"boating\" or \"sailing\", set the q parameter value to boating|sailing. Similarly, to search for videos matching either \"boating\" or \"sailing\" but not \"fishing\", set the q parameter value to boating|sailing -fishing. Note that the pipe character must be URL-escaped when it is sent in your API request. The URL-escaped value for the pipe character is %7C.", + "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" + }, + "relevanceLanguage": { + "type": "string", + "description": "The relevanceLanguage parameter instructs the API to return search results that are most relevant to the specified language. The parameter value is typically an ISO 639-1 two-letter language code. However, you should use the values zh-Hans for simplified Chinese and zh-Hant for traditional Chinese. Please note that results in other languages will still be returned if they are highly relevant to the search query term.", + "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. If you specify a value for this parameter, you must also set the type parameter's value to video.", + "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. If you specify a value for this parameter, you must also set the type parameter's value to video.", + "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. If you specify a value for this parameter, you must also set the type parameter's value to video.", + "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. If you specify a value for this parameter, you must also set the type parameter's value to video.", + "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. If you specify a value for this parameter, you must also set the type parameter's value to video.", + "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. If you specify a value for this parameter, you must also set the type parameter's value to video.", + "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. If you specify a value for this parameter, you must also set the type parameter's value to video.", + "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. If you specify a value for this parameter, you must also set the type parameter's value to video.", + "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. If you specify a value for this parameter, you must also set the type parameter's value to video.", + "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.force-ssl", + "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/youtube.force-ssl", + "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.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "Subscription" + }, + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "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.\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.force-ssl", + "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": "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" + }, + "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.force-ssl", + "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" + } + } + } + } + } + }, + "videoAbuseReportReasons": { + "methods": { + "list": { + "id": "youtube.videoAbuseReportReasons.list", + "path": "videoAbuseReportReasons", + "httpMethod": "GET", + "description": "Returns a list of abuse reasons that can be used for reporting abusive 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" + }, + "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" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "VideoAbuseReportReasonListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtube.readonly" + ] + } + } + }, + "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 properties that the API response will include. Set the parameter value to 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.force-ssl", + "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/youtube.force-ssl", + "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/youtube.force-ssl", + "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 a notification about the new video to users who subscribe to the video's channel. A parameter value of True indicates that subscribers will be notified of newly uploaded videos. However, a channel owner who is uploading many videos might prefer to set the value to False to avoid sending a notification about each new video to the channel's subscribers.", + "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\nNote that not all parts contain properties that can be set when inserting or updating a video. 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.force-ssl", + "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" + }, + "hl": { + "type": "string", + "description": "The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by the i18nLanguages.list method.\n\nIf localized resource details are available in that language, the resource's snippet.localized object will contain the localized values. However, if localized details are not available, the snippet.localized object will contain resource details in the resource's default language.", + "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.\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.force-ssl", + "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" + }, + "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/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "reportAbuse": { + "id": "youtube.videos.reportAbuse", + "path": "videos/reportAbuse", + "httpMethod": "POST", + "description": "Report abuse for a video.", + "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": "VideoAbuseReport" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "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\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 parts contain properties that can be set when inserting or updating a video. 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/youtube.force-ssl", + "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 the YouTube channel ID for which the watermark is being provided.", + "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": [ + "channelId" + ], + "request": { + "$ref": "InvideoBranding" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "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 channel's watermark image.", + "parameters": { + "channelId": { + "type": "string", + "description": "The channelId parameter specifies the YouTube channel ID for which the watermark is being unset.", + "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": [ + "channelId" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ] + } + } + } + } +} diff --git a/Godeps/_workspace/src/google.golang.org/api/youtube/v3/youtube-gen.go b/Godeps/_workspace/src/google.golang.org/api/youtube/v3/youtube-gen.go new file mode 100644 index 000000000..ead7e65e6 --- /dev/null +++ b/Godeps/_workspace/src/google.golang.org/api/youtube/v3/youtube-gen.go @@ -0,0 +1,19369 @@ +// Package youtube provides access to the YouTube Data API. +// +// See https://developers.google.com/youtube/v3 +// +// Usage example: +// +// import "google.golang.org/api/youtube/v3" +// ... +// youtubeService, err := youtube.New(oauthHttpClient) +package youtube // import "google.golang.org/api/youtube/v3" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + "google.golang.org/api/googleapi" + "google.golang.org/api/internal" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = internal.MarshalJSON +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "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" + + // Manage your YouTube account + YoutubeForceSslScope = "https://www.googleapis.com/auth/youtube.force-ssl" + + // 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.Captions = NewCaptionsService(s) + s.ChannelBanners = NewChannelBannersService(s) + s.ChannelSections = NewChannelSectionsService(s) + s.Channels = NewChannelsService(s) + s.CommentThreads = NewCommentThreadsService(s) + s.Comments = NewCommentsService(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.VideoAbuseReportReasons = NewVideoAbuseReportReasonsService(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 + UserAgent string // optional additional User-Agent fragment + + Activities *ActivitiesService + + Captions *CaptionsService + + ChannelBanners *ChannelBannersService + + ChannelSections *ChannelSectionsService + + Channels *ChannelsService + + CommentThreads *CommentThreadsService + + Comments *CommentsService + + GuideCategories *GuideCategoriesService + + I18nLanguages *I18nLanguagesService + + I18nRegions *I18nRegionsService + + LiveBroadcasts *LiveBroadcastsService + + LiveStreams *LiveStreamsService + + PlaylistItems *PlaylistItemsService + + Playlists *PlaylistsService + + Search *SearchService + + Subscriptions *SubscriptionsService + + Thumbnails *ThumbnailsService + + VideoAbuseReportReasons *VideoAbuseReportReasonsService + + VideoCategories *VideoCategoriesService + + Videos *VideosService + + Watermarks *WatermarksService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewActivitiesService(s *Service) *ActivitiesService { + rs := &ActivitiesService{s: s} + return rs +} + +type ActivitiesService struct { + s *Service +} + +func NewCaptionsService(s *Service) *CaptionsService { + rs := &CaptionsService{s: s} + return rs +} + +type CaptionsService 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 NewCommentThreadsService(s *Service) *CommentThreadsService { + rs := &CommentThreadsService{s: s} + return rs +} + +type CommentThreadsService struct { + s *Service +} + +func NewCommentsService(s *Service) *CommentsService { + rs := &CommentsService{s: s} + return rs +} + +type CommentsService 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 NewVideoAbuseReportReasonsService(s *Service) *VideoAbuseReportReasonsService { + rs := &VideoAbuseReportReasonsService{s: s} + return rs +} + +type VideoAbuseReportReasonsService 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 +} + +// AccessPolicy: Rights management policy for YouTube resources. +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"` + + // ForceSendFields is a list of field names (e.g. "Allowed") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AccessPolicy) MarshalJSON() ([]byte, error) { + type noMethod AccessPolicy + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Activity: 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. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ContentDetails") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Activity) MarshalJSON() ([]byte, error) { + type noMethod Activity + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityContentDetails: Details about the content of an activity: the +// video that was shared, the channel that was subscribed to, etc. +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"` + + // ForceSendFields is a list of field names (e.g. "Bulletin") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityContentDetails) MarshalJSON() ([]byte, error) { + type noMethod ActivityContentDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityContentDetailsBulletin: Details about a channel bulletin +// post. +type ActivityContentDetailsBulletin struct { + // ResourceId: The resourceId object contains information that + // identifies the resource associated with a bulletin post. + ResourceId *ResourceId `json:"resourceId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ResourceId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityContentDetailsBulletin) MarshalJSON() ([]byte, error) { + type noMethod ActivityContentDetailsBulletin + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityContentDetailsChannelItem: Details about a resource which was +// added to a channel. +type ActivityContentDetailsChannelItem struct { + // ResourceId: The resourceId object contains information that + // identifies the resource that was added to the channel. + ResourceId *ResourceId `json:"resourceId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ResourceId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityContentDetailsChannelItem) MarshalJSON() ([]byte, error) { + type noMethod ActivityContentDetailsChannelItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityContentDetailsComment: Information about a resource that +// received a comment. +type ActivityContentDetailsComment struct { + // ResourceId: The resourceId object contains information that + // identifies the resource associated with the comment. + ResourceId *ResourceId `json:"resourceId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ResourceId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityContentDetailsComment) MarshalJSON() ([]byte, error) { + type noMethod ActivityContentDetailsComment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityContentDetailsFavorite: Information about a video that was +// marked as a favorite video. +type ActivityContentDetailsFavorite struct { + // ResourceId: The resourceId object contains information that + // identifies the resource that was marked as a favorite. + ResourceId *ResourceId `json:"resourceId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ResourceId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityContentDetailsFavorite) MarshalJSON() ([]byte, error) { + type noMethod ActivityContentDetailsFavorite + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityContentDetailsLike: Information about a resource that +// received a positive (like) rating. +type ActivityContentDetailsLike struct { + // ResourceId: The resourceId object contains information that + // identifies the rated resource. + ResourceId *ResourceId `json:"resourceId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ResourceId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityContentDetailsLike) MarshalJSON() ([]byte, error) { + type noMethod ActivityContentDetailsLike + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityContentDetailsPlaylistItem: Information about a new playlist +// item. +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"` + + // ForceSendFields is a list of field names (e.g. "PlaylistId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityContentDetailsPlaylistItem) MarshalJSON() ([]byte, error) { + type noMethod ActivityContentDetailsPlaylistItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityContentDetailsPromotedItem: Details about a resource which is +// being promoted. +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. + // + // Possible values: + // "unspecified" + // "visitAdvertiserSite" + 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"` + + // ForceSendFields is a list of field names (e.g. "AdTag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityContentDetailsPromotedItem) MarshalJSON() ([]byte, error) { + type noMethod ActivityContentDetailsPromotedItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityContentDetailsRecommendation: Information that identifies the +// recommended resource. +type ActivityContentDetailsRecommendation struct { + // Reason: The reason that the resource is recommended to the user. + // + // Possible values: + // "unspecified" + // "videoFavorited" + // "videoLiked" + // "videoWatched" + 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"` + + // ForceSendFields is a list of field names (e.g. "Reason") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityContentDetailsRecommendation) MarshalJSON() ([]byte, error) { + type noMethod ActivityContentDetailsRecommendation + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityContentDetailsSocial: Details about a social network post. +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. + // + // Possible values: + // "facebook" + // "googlePlus" + // "twitter" + // "unspecified" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Author") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityContentDetailsSocial) MarshalJSON() ([]byte, error) { + type noMethod ActivityContentDetailsSocial + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityContentDetailsSubscription: Information about a channel that +// a user subscribed to. +type ActivityContentDetailsSubscription struct { + // ResourceId: The resourceId object contains information that + // identifies the resource that the user subscribed to. + ResourceId *ResourceId `json:"resourceId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ResourceId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityContentDetailsSubscription) MarshalJSON() ([]byte, error) { + type noMethod ActivityContentDetailsSubscription + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivityContentDetailsUpload: Information about the uploaded video. +type ActivityContentDetailsUpload struct { + // VideoId: The ID that YouTube uses to uniquely identify the uploaded + // video. + VideoId string `json:"videoId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "VideoId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityContentDetailsUpload) MarshalJSON() ([]byte, error) { + type noMethod ActivityContentDetailsUpload + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivityListResponse) MarshalJSON() ([]byte, error) { + type noMethod ActivityListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ActivitySnippet: Basic details about an activity, including title, +// description, thumbnails, activity type and group. +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. + // + // Possible values: + // "bulletin" + // "channelItem" + // "comment" + // "favorite" + // "like" + // "playlistItem" + // "promotedItem" + // "recommendation" + // "social" + // "subscription" + // "upload" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ChannelId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ActivitySnippet) MarshalJSON() ([]byte, error) { + type noMethod ActivitySnippet + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Caption: A caption resource represents a YouTube caption track. A +// caption track is associated with exactly one YouTube video. +type Caption struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube uses to uniquely identify the caption track. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#caption". + Kind string `json:"kind,omitempty"` + + // Snippet: The snippet object contains basic details about the caption. + Snippet *CaptionSnippet `json:"snippet,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Caption) MarshalJSON() ([]byte, error) { + type noMethod Caption + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type CaptionListResponse 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 captions that match the request criteria. + Items []*Caption `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#captionListResponse". + Kind string `json:"kind,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CaptionListResponse) MarshalJSON() ([]byte, error) { + type noMethod CaptionListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CaptionSnippet: Basic details about a caption track, such as its +// language and name. +type CaptionSnippet struct { + // AudioTrackType: The type of audio track associated with the caption + // track. + // + // Possible values: + // "commentary" + // "descriptive" + // "primary" + // "unknown" + AudioTrackType string `json:"audioTrackType,omitempty"` + + // FailureReason: The reason that YouTube failed to process the caption + // track. This property is only present if the state property's value is + // failed. + // + // Possible values: + // "processingFailed" + // "unknownFormat" + // "unsupportedFormat" + FailureReason string `json:"failureReason,omitempty"` + + // IsAutoSynced: Indicates whether YouTube synchronized the caption + // track to the audio track in the video. The value will be true if a + // sync was explicitly requested when the caption track was uploaded. + // For example, when calling the captions.insert or captions.update + // methods, you can set the sync parameter to true to instruct YouTube + // to sync the uploaded track to the video. If the value is false, + // YouTube uses the time codes in the uploaded caption track to + // determine when to display captions. + IsAutoSynced bool `json:"isAutoSynced,omitempty"` + + // IsCC: Indicates whether the track contains closed captions for the + // deaf and hard of hearing. The default value is false. + IsCC bool `json:"isCC,omitempty"` + + // IsDraft: Indicates whether the caption track is a draft. If the value + // is true, then the track is not publicly visible. The default value is + // false. + IsDraft bool `json:"isDraft,omitempty"` + + // IsEasyReader: Indicates whether caption track is formatted for "easy + // reader," meaning it is at a third-grade level for language learners. + // The default value is false. + IsEasyReader bool `json:"isEasyReader,omitempty"` + + // IsLarge: Indicates whether the caption track uses large text for the + // vision-impaired. The default value is false. + IsLarge bool `json:"isLarge,omitempty"` + + // Language: The language of the caption track. The property value is a + // BCP-47 language tag. + Language string `json:"language,omitempty"` + + // LastUpdated: The date and time when the caption track was last + // updated. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) + // format. + LastUpdated string `json:"lastUpdated,omitempty"` + + // Name: The name of the caption track. The name is intended to be + // visible to the user as an option during playback. + Name string `json:"name,omitempty"` + + // Status: The caption track's status. + // + // Possible values: + // "failed" + // "serving" + // "syncing" + Status string `json:"status,omitempty"` + + // TrackKind: The caption track's type. + // + // Possible values: + // "ASR" + // "forced" + // "standard" + TrackKind string `json:"trackKind,omitempty"` + + // VideoId: The ID that YouTube uses to uniquely identify the video + // associated with the caption track. + VideoId string `json:"videoId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AudioTrackType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CaptionSnippet) MarshalJSON() ([]byte, error) { + type noMethod CaptionSnippet + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CdnSettings: Brief description of the live stream cdn settings. +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. + // + // Possible values: + // "dash" + // "rtmp" + IngestionType string `json:"ingestionType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Format") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CdnSettings) MarshalJSON() ([]byte, error) { + type noMethod CdnSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Channel: A channel resource contains information about a YouTube +// channel. +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"` + + // Localizations: Localizations for different languages + Localizations map[string]ChannelLocalization `json:"localizations,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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AuditDetails") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Channel) MarshalJSON() ([]byte, error) { + type noMethod Channel + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChannelAuditDetails: The auditDetails object encapsulates channel +// data that is relevant for YouTube Partners during the audit process. +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"` + + // ForceSendFields is a list of field names (e.g. + // "CommunityGuidelinesGoodStanding") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChannelAuditDetails) MarshalJSON() ([]byte, error) { + type noMethod ChannelAuditDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChannelBannerResource: A channel banner returned as the response to a +// channel_banner.insert call. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChannelBannerResource) MarshalJSON() ([]byte, error) { + type noMethod ChannelBannerResource + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChannelBrandingSettings: Branding properties of a YouTube channel. +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"` + + // ForceSendFields is a list of field names (e.g. "Channel") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChannelBrandingSettings) MarshalJSON() ([]byte, error) { + type noMethod ChannelBrandingSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChannelContentDetails: Details about the content of a channel. +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"` + + // ForceSendFields is a list of field names (e.g. "GooglePlusUserId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChannelContentDetails) MarshalJSON() ([]byte, error) { + type noMethod ChannelContentDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "Favorites") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChannelContentDetailsRelatedPlaylists) MarshalJSON() ([]byte, error) { + type noMethod ChannelContentDetailsRelatedPlaylists + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChannelContentOwnerDetails: The contentOwnerDetails object +// encapsulates channel data that is relevant for YouTube Partners +// linked with the channel. +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"` + + // ForceSendFields is a list of field names (e.g. "ContentOwner") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChannelContentOwnerDetails) MarshalJSON() ([]byte, error) { + type noMethod ChannelContentOwnerDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChannelConversionPing: 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. +type ChannelConversionPing struct { + // Context: Defines the context of the ping. + // + // Possible values: + // "cview" + // "subscribe" + // "unsubscribe" + 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"` + + // ForceSendFields is a list of field names (e.g. "Context") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChannelConversionPing) MarshalJSON() ([]byte, error) { + type noMethod ChannelConversionPing + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChannelConversionPings: The conversionPings object encapsulates +// information about conversion pings that need to be respected by the +// channel. +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"` + + // ForceSendFields is a list of field names (e.g. "Pings") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChannelConversionPings) MarshalJSON() ([]byte, error) { + type noMethod ChannelConversionPings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ChannelId struct { + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Value") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChannelId) MarshalJSON() ([]byte, error) { + type noMethod ChannelId + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChannelListResponse) MarshalJSON() ([]byte, error) { + type noMethod ChannelListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChannelLocalization: Channel localization setting +type ChannelLocalization struct { + // Description: The localized strings for channel's description. + Description string `json:"description,omitempty"` + + // Title: The localized strings for channel's title. + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChannelLocalization) MarshalJSON() ([]byte, error) { + type noMethod ChannelLocalization + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type ChannelSection struct { + // ContentDetails: The contentDetails object contains details about the + // channel section content, such as a list of playlists or channels + // featured in the section. + 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 channel + // section. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#channelSection". + Kind string `json:"kind,omitempty"` + + // Localizations: Localizations for different languages + Localizations map[string]ChannelSectionLocalization `json:"localizations,omitempty"` + + // Snippet: The snippet object contains basic details about the channel + // section, such as its type, style and title. + Snippet *ChannelSectionSnippet `json:"snippet,omitempty"` + + // Targeting: The targeting object contains basic targeting settings + // about the channel section. + Targeting *ChannelSectionTargeting `json:"targeting,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ContentDetails") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChannelSection) MarshalJSON() ([]byte, error) { + type noMethod ChannelSection + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChannelSectionContentDetails: Details about a channelsection, +// including playlists and channels. +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"` + + // ForceSendFields is a list of field names (e.g. "Channels") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChannelSectionContentDetails) MarshalJSON() ([]byte, error) { + type noMethod ChannelSectionContentDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChannelSectionListResponse) MarshalJSON() ([]byte, error) { + type noMethod ChannelSectionListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChannelSectionLocalization: ChannelSection localization setting +type ChannelSectionLocalization struct { + // Title: The localized strings for channel section's title. + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Title") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChannelSectionLocalization) MarshalJSON() ([]byte, error) { + type noMethod ChannelSectionLocalization + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChannelSectionSnippet: Basic details about a channel section, +// including title, style and position. +type ChannelSectionSnippet struct { + // ChannelId: The ID that YouTube uses to uniquely identify the channel + // that published the channel section. + ChannelId string `json:"channelId,omitempty"` + + // DefaultLanguage: The language of the channel section's default title + // and description. + DefaultLanguage string `json:"defaultLanguage,omitempty"` + + // Localized: Localized title, read-only. + Localized *ChannelSectionLocalization `json:"localized,omitempty"` + + // Position: The position of the channel section in the channel. + Position *int64 `json:"position,omitempty"` + + // Style: The style of the channel section. + // + // Possible values: + // "channelsectionStyleUndefined" + // "horizontalRow" + // "verticalList" + Style string `json:"style,omitempty"` + + // Title: The channel section's title for multiple_playlists and + // multiple_channels. + Title string `json:"title,omitempty"` + + // Type: The type of the channel section. + // + // Possible values: + // "allPlaylists" + // "channelsectionTypeUndefined" + // "completedEvents" + // "likedPlaylists" + // "likes" + // "liveEvents" + // "multipleChannels" + // "multiplePlaylists" + // "popularUploads" + // "postedPlaylists" + // "postedVideos" + // "recentActivity" + // "recentPosts" + // "recentUploads" + // "singlePlaylist" + // "subscriptions" + // "upcomingEvents" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ChannelId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChannelSectionSnippet) MarshalJSON() ([]byte, error) { + type noMethod ChannelSectionSnippet + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChannelSectionTargeting: ChannelSection targeting setting. +type ChannelSectionTargeting struct { + // Countries: The country the channel section is targeting. + Countries []string `json:"countries,omitempty"` + + // Languages: The language the channel section is targeting. + Languages []string `json:"languages,omitempty"` + + // Regions: The region the channel section is targeting. + Regions []string `json:"regions,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Countries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChannelSectionTargeting) MarshalJSON() ([]byte, error) { + type noMethod ChannelSectionTargeting + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChannelSettings: Branding properties for the channel view. +type ChannelSettings struct { + // Country: The country of the channel. + Country string `json:"country,omitempty"` + + DefaultLanguage string `json:"defaultLanguage,omitempty"` + + // 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"` + + // ForceSendFields is a list of field names (e.g. "Country") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChannelSettings) MarshalJSON() ([]byte, error) { + type noMethod ChannelSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChannelSnippet: Basic details about a channel, including title, +// description and thumbnails. +type ChannelSnippet struct { + // Country: The country of the channel. + Country string `json:"country,omitempty"` + + // DefaultLanguage: The language of the channel's default title and + // description. + DefaultLanguage string `json:"defaultLanguage,omitempty"` + + // Description: The description of the channel. + Description string `json:"description,omitempty"` + + // Localized: Localized title and description, read-only. + Localized *ChannelLocalization `json:"localized,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"` + + // ForceSendFields is a list of field names (e.g. "Country") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChannelSnippet) MarshalJSON() ([]byte, error) { + type noMethod ChannelSnippet + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChannelStatistics: Statistics about a channel: number of subscribers, +// number of videos in the channel, etc. +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"` + + // ForceSendFields is a list of field names (e.g. "CommentCount") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChannelStatistics) MarshalJSON() ([]byte, error) { + type noMethod ChannelStatistics + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChannelStatus: JSON template for the status part of a channel. +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"` + + // LongUploadsStatus: The long uploads status of this channel. See + // + // Possible values: + // "allowed" + // "disallowed" + // "eligible" + // "longUploadsUnspecified" + LongUploadsStatus string `json:"longUploadsStatus,omitempty"` + + // PrivacyStatus: Privacy status of the channel. + // + // Possible values: + // "private" + // "public" + // "unlisted" + PrivacyStatus string `json:"privacyStatus,omitempty"` + + // ForceSendFields is a list of field names (e.g. "IsLinked") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChannelStatus) MarshalJSON() ([]byte, error) { + type noMethod ChannelStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ChannelTopicDetails: Freebase topic information related to the +// channel. +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"` + + // ForceSendFields is a list of field names (e.g. "TopicIds") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ChannelTopicDetails) MarshalJSON() ([]byte, error) { + type noMethod ChannelTopicDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Comment: A comment represents a single YouTube comment. +type Comment struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube uses to uniquely identify the comment. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#comment". + Kind string `json:"kind,omitempty"` + + // Snippet: The snippet object contains basic details about the comment. + Snippet *CommentSnippet `json:"snippet,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Comment) MarshalJSON() ([]byte, error) { + type noMethod Comment + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type CommentListResponse 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 comments that match the request criteria. + Items []*Comment `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#commentListResponse". + 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"` + + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentListResponse) MarshalJSON() ([]byte, error) { + type noMethod CommentListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentSnippet: Basic details about a comment, such as its author and +// text. +type CommentSnippet struct { + // AuthorChannelId: The id of the author's YouTube channel, if any. + AuthorChannelId *ChannelId `json:"authorChannelId,omitempty"` + + // AuthorChannelUrl: Link to the author's YouTube channel, if any. + AuthorChannelUrl string `json:"authorChannelUrl,omitempty"` + + // AuthorDisplayName: The name of the user who posted the comment. + AuthorDisplayName string `json:"authorDisplayName,omitempty"` + + // AuthorGoogleplusProfileUrl: Link to the author's Google+ profile, if + // any. + AuthorGoogleplusProfileUrl string `json:"authorGoogleplusProfileUrl,omitempty"` + + // AuthorProfileImageUrl: The URL for the avatar of the user who posted + // the comment. + AuthorProfileImageUrl string `json:"authorProfileImageUrl,omitempty"` + + // CanRate: Whether the current viewer can rate this comment. + CanRate bool `json:"canRate,omitempty"` + + // ChannelId: The id of the corresponding YouTube channel. In case of a + // channel comment this is the channel the comment refers to. In case of + // a video comment it's the video's channel. + ChannelId string `json:"channelId,omitempty"` + + // LikeCount: The total number of likes this comment has received. + LikeCount int64 `json:"likeCount,omitempty"` + + // ModerationStatus: The comment's moderation status. Will not be set if + // the comments were requested through the id filter. + // + // Possible values: + // "heldForReview" + // "likelySpam" + // "published" + // "rejected" + ModerationStatus string `json:"moderationStatus,omitempty"` + + // ParentId: The unique id of the parent comment, only set for replies. + ParentId string `json:"parentId,omitempty"` + + // PublishedAt: The date and time when the comment was orignally + // published. The value is specified in ISO 8601 + // (YYYY-MM-DDThh:mm:ss.sZ) format. + PublishedAt string `json:"publishedAt,omitempty"` + + // TextDisplay: The comment's text. The format is either plain text or + // HTML dependent on what has been requested. Even the plain text + // representation may differ from the text originally posted in that it + // may replace video links with video titles etc. + TextDisplay string `json:"textDisplay,omitempty"` + + // TextOriginal: The comment's original raw text as initially posted or + // last updated. The original text will only be returned if it is + // accessible to the viewer, which is only guaranteed if the viewer is + // the comment's author. + TextOriginal string `json:"textOriginal,omitempty"` + + // UpdatedAt: The date and time when was last updated . The value is + // specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + UpdatedAt string `json:"updatedAt,omitempty"` + + // VideoId: The ID of the video the comment refers to, if any. + VideoId string `json:"videoId,omitempty"` + + // ViewerRating: The rating the viewer has given to this comment. For + // the time being this will never return RATE_TYPE_DISLIKE and instead + // return RATE_TYPE_NONE. This may change in the future. + // + // Possible values: + // "dislike" + // "like" + // "none" + // "unspecified" + ViewerRating string `json:"viewerRating,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AuthorChannelId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentSnippet) MarshalJSON() ([]byte, error) { + type noMethod CommentSnippet + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentThread: A comment thread represents information that applies +// to a top level comment and all its replies. It can also include the +// top level comment itself and some of the replies. +type CommentThread struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube uses to uniquely identify the comment thread. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#commentThread". + Kind string `json:"kind,omitempty"` + + // Replies: The replies object contains a limited number of replies (if + // any) to the top level comment found in the snippet. + Replies *CommentThreadReplies `json:"replies,omitempty"` + + // Snippet: The snippet object contains basic details about the comment + // thread and also the top level comment. + Snippet *CommentThreadSnippet `json:"snippet,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentThread) MarshalJSON() ([]byte, error) { + type noMethod CommentThread + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type CommentThreadListResponse 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 comment threads that match the request criteria. + Items []*CommentThread `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#commentThreadListResponse". + 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"` + + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentThreadListResponse) MarshalJSON() ([]byte, error) { + type noMethod CommentThreadListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentThreadReplies: Comments written in (direct or indirect) reply +// to the top level comment. +type CommentThreadReplies struct { + // Comments: A limited number of replies. Unless the number of replies + // returned equals total_reply_count in the snippet the returned replies + // are only a subset of the total number of replies. + Comments []*Comment `json:"comments,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Comments") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentThreadReplies) MarshalJSON() ([]byte, error) { + type noMethod CommentThreadReplies + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// CommentThreadSnippet: Basic details about a comment thread. +type CommentThreadSnippet struct { + // CanReply: Whether the current viewer of the thread can reply to it. + // This is viewer specific - other viewers may see a different value for + // this field. + CanReply bool `json:"canReply,omitempty"` + + // ChannelId: The YouTube channel the comments in the thread refer to or + // the channel with the video the comments refer to. If video_id isn't + // set the comments refer to the channel itself. + ChannelId string `json:"channelId,omitempty"` + + // IsPublic: Whether the thread (and therefore all its comments) is + // visible to all YouTube users. + IsPublic bool `json:"isPublic,omitempty"` + + // TopLevelComment: The top level comment of this thread. + TopLevelComment *Comment `json:"topLevelComment,omitempty"` + + // TotalReplyCount: The total number of replies (not including the top + // level comment). + TotalReplyCount int64 `json:"totalReplyCount,omitempty"` + + // VideoId: The ID of the video the comments refer to, if any. No + // video_id implies a channel discussion comment. + VideoId string `json:"videoId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CanReply") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *CommentThreadSnippet) MarshalJSON() ([]byte, error) { + type noMethod CommentThreadSnippet + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ContentRating: Ratings schemes. The country-specific ratings are +// mostly for movies and shows. NEXT_ID: 66 +type ContentRating struct { + // AcbRating: The video's Australian Classification Board (ACB) or + // Australian Communications and Media Authority (ACMA) rating. ACMA + // ratings are used to classify children's television programming. + // + // Possible values: + // "acbC" + // "acbE" + // "acbG" + // "acbM" + // "acbMa15plus" + // "acbP" + // "acbPg" + // "acbR18plus" + // "acbUnrated" + AcbRating string `json:"acbRating,omitempty"` + + // AgcomRating: The video's rating from Italy's Autorità per le + // Garanzie nelle Comunicazioni (AGCOM). + // + // Possible values: + // "agcomT" + // "agcomUnrated" + // "agcomVm14" + // "agcomVm18" + AgcomRating string `json:"agcomRating,omitempty"` + + // AnatelRating: The video's Anatel (Asociación Nacional de + // Televisión) rating for Chilean television. + // + // Possible values: + // "anatelA" + // "anatelF" + // "anatelI" + // "anatelI10" + // "anatelI12" + // "anatelI7" + // "anatelR" + // "anatelUnrated" + AnatelRating string `json:"anatelRating,omitempty"` + + // BbfcRating: The video's British Board of Film Classification (BBFC) + // rating. + // + // Possible values: + // "bbfc12" + // "bbfc12a" + // "bbfc15" + // "bbfc18" + // "bbfcPg" + // "bbfcR18" + // "bbfcU" + // "bbfcUnrated" + BbfcRating string `json:"bbfcRating,omitempty"` + + // BfvcRating: The video's rating from Thailand's Board of Film and + // Video Censors. + // + // Possible values: + // "bfvc13" + // "bfvc15" + // "bfvc18" + // "bfvc20" + // "bfvcB" + // "bfvcE" + // "bfvcG" + // "bfvcUnrated" + BfvcRating string `json:"bfvcRating,omitempty"` + + // BmukkRating: The video's rating from the Austrian Board of Media + // Classification (Bundesministerium für Unterricht, Kunst und Kultur). + // + // Possible values: + // "bmukk10" + // "bmukk12" + // "bmukk14" + // "bmukk16" + // "bmukk6" + // "bmukk8" + // "bmukkAa" + // "bmukkUnrated" + BmukkRating string `json:"bmukkRating,omitempty"` + + // CatvRating: Rating system for Canadian TV - Canadian TV + // Classification System The video's rating from the Canadian + // Radio-Television and Telecommunications Commission (CRTC) for + // Canadian English-language broadcasts. For more information, see the + // Canadian Broadcast Standards Council website. + // + // Possible values: + // "catv14plus" + // "catv18plus" + // "catvC" + // "catvC8" + // "catvG" + // "catvPg" + // "catvUnrated" + CatvRating string `json:"catvRating,omitempty"` + + // CatvfrRating: The video's rating from the Canadian Radio-Television + // and Telecommunications Commission (CRTC) for Canadian French-language + // broadcasts. For more information, see the Canadian Broadcast + // Standards Council website. + // + // Possible values: + // "catvfr13plus" + // "catvfr16plus" + // "catvfr18plus" + // "catvfr8plus" + // "catvfrG" + // "catvfrUnrated" + CatvfrRating string `json:"catvfrRating,omitempty"` + + // CbfcRating: The video's Central Board of Film Certification (CBFC - + // India) rating. + // + // Possible values: + // "cbfcA" + // "cbfcS" + // "cbfcU" + // "cbfcUA" + // "cbfcUnrated" + CbfcRating string `json:"cbfcRating,omitempty"` + + // CccRating: The video's Consejo de Calificación Cinematográfica + // (Chile) rating. + // + // Possible values: + // "ccc14" + // "ccc18" + // "ccc18s" + // "ccc18v" + // "ccc6" + // "cccTe" + // "cccUnrated" + CccRating string `json:"cccRating,omitempty"` + + // CceRating: The video's rating from Portugal's Comissão de + // Classificação de Espect´culos. + // + // Possible values: + // "cceM12" + // "cceM16" + // "cceM18" + // "cceM4" + // "cceM6" + // "cceUnrated" + CceRating string `json:"cceRating,omitempty"` + + // ChfilmRating: The video's rating in Switzerland. + // + // Possible values: + // "chfilm0" + // "chfilm12" + // "chfilm16" + // "chfilm18" + // "chfilm6" + // "chfilmUnrated" + ChfilmRating string `json:"chfilmRating,omitempty"` + + // ChvrsRating: The video's Canadian Home Video Rating System (CHVRS) + // rating. + // + // Possible values: + // "chvrs14a" + // "chvrs18a" + // "chvrsE" + // "chvrsG" + // "chvrsPg" + // "chvrsR" + // "chvrsUnrated" + ChvrsRating string `json:"chvrsRating,omitempty"` + + // CicfRating: The video's rating from the Commission de Contrôle des + // Films (Belgium). + // + // Possible values: + // "cicfE" + // "cicfKntEna" + // "cicfKtEa" + // "cicfUnrated" + CicfRating string `json:"cicfRating,omitempty"` + + // CnaRating: The video's rating from Romania's CONSILIUL NATIONAL AL + // AUDIOVIZUALULUI (CNA). + // + // Possible values: + // "cna12" + // "cna15" + // "cna18" + // "cna18plus" + // "cnaAp" + // "cnaUnrated" + CnaRating string `json:"cnaRating,omitempty"` + + // CncRating: Rating system in France - Commission de classification + // cinematographique + // + // Possible values: + // "cnc10" + // "cnc12" + // "cnc16" + // "cnc18" + // "cncE" + // "cncT" + // "cncUnrated" + CncRating string `json:"cncRating,omitempty"` + + // CsaRating: The video's rating from France's Conseil supérieur de + // l?audiovisuel, which rates broadcast content. + // + // Possible values: + // "csa10" + // "csa12" + // "csa16" + // "csa18" + // "csaInterdiction" + // "csaT" + // "csaUnrated" + CsaRating string `json:"csaRating,omitempty"` + + // CscfRating: The video's rating from Luxembourg's Commission de + // surveillance de la classification des films (CSCF). + // + // Possible values: + // "cscf12" + // "cscf16" + // "cscf18" + // "cscf6" + // "cscf9" + // "cscfA" + // "cscfAl" + // "cscfUnrated" + CscfRating string `json:"cscfRating,omitempty"` + + // CzfilmRating: The video's rating in the Czech Republic. + // + // Possible values: + // "czfilm12" + // "czfilm14" + // "czfilm18" + // "czfilmU" + // "czfilmUnrated" + CzfilmRating string `json:"czfilmRating,omitempty"` + + // DjctqRating: The video's Departamento de Justiça, Classificação, + // Qualificação e Títulos (DJCQT - Brazil) rating. + // + // Possible values: + // "djctq10" + // "djctq12" + // "djctq14" + // "djctq16" + // "djctq18" + // "djctqL" + // "djctqUnrated" + DjctqRating string `json:"djctqRating,omitempty"` + + // DjctqRatingReasons: Reasons that explain why the video received its + // DJCQT (Brazil) rating. + // + // Possible values: + // "djctqCriminalActs" + // "djctqDrugs" + // "djctqExplicitSex" + // "djctqExtremeViolence" + // "djctqIllegalDrugs" + // "djctqImpactingContent" + // "djctqInappropriateLanguage" + // "djctqLegalDrugs" + // "djctqNudity" + // "djctqSex" + // "djctqSexualContent" + // "djctqViolence" + DjctqRatingReasons []string `json:"djctqRatingReasons,omitempty"` + + // EefilmRating: The video's rating in Estonia. + // + // Possible values: + // "eefilmK12" + // "eefilmK14" + // "eefilmK16" + // "eefilmK6" + // "eefilmL" + // "eefilmMs12" + // "eefilmMs6" + // "eefilmPere" + // "eefilmUnrated" + EefilmRating string `json:"eefilmRating,omitempty"` + + // EgfilmRating: The video's rating in Egypt. + // + // Possible values: + // "egfilm18" + // "egfilmBn" + // "egfilmGn" + // "egfilmUnrated" + EgfilmRating string `json:"egfilmRating,omitempty"` + + // EirinRating: The video's Eirin (映倫) rating. Eirin is the Japanese + // rating system. + // + // Possible values: + // "eirinG" + // "eirinPg12" + // "eirinR15plus" + // "eirinR18plus" + // "eirinUnrated" + EirinRating string `json:"eirinRating,omitempty"` + + // FcbmRating: The video's rating from Malaysia's Film Censorship Board. + // + // Possible values: + // "fcbm18" + // "fcbm18pa" + // "fcbm18pl" + // "fcbm18sg" + // "fcbm18sx" + // "fcbmP13" + // "fcbmPg13" + // "fcbmU" + // "fcbmUnrated" + FcbmRating string `json:"fcbmRating,omitempty"` + + // FcoRating: The video's rating from Hong Kong's Office for Film, + // Newspaper and Article Administration. + // + // Possible values: + // "fcoI" + // "fcoIi" + // "fcoIia" + // "fcoIib" + // "fcoIii" + // "fcoUnrated" + FcoRating string `json:"fcoRating,omitempty"` + + // FmocRating: This property has been deprecated. Use the + // contentDetails.contentRating.cncRating instead. + // + // Possible values: + // "fmoc10" + // "fmoc12" + // "fmoc16" + // "fmoc18" + // "fmocE" + // "fmocU" + // "fmocUnrated" + FmocRating string `json:"fmocRating,omitempty"` + + // FpbRating: The video's rating from South Africa's Film and + // Publication Board. + // + // Possible values: + // "fpb1012Pg" + // "fpb13" + // "fpb16" + // "fpb18" + // "fpb79Pg" + // "fpbA" + // "fpbPg" + // "fpbUnrated" + // "fpbX18" + // "fpbXx" + FpbRating string `json:"fpbRating,omitempty"` + + // FskRating: The video's Freiwillige Selbstkontrolle der Filmwirtschaft + // (FSK - Germany) rating. + // + // Possible values: + // "fsk0" + // "fsk12" + // "fsk16" + // "fsk18" + // "fsk6" + // "fskUnrated" + FskRating string `json:"fskRating,omitempty"` + + // GrfilmRating: The video's rating in Greece. + // + // Possible values: + // "grfilmE" + // "grfilmK" + // "grfilmK13" + // "grfilmK17" + // "grfilmUnrated" + GrfilmRating string `json:"grfilmRating,omitempty"` + + // IcaaRating: The video's Instituto de la Cinematografía y de las + // Artes Audiovisuales (ICAA - Spain) rating. + // + // Possible values: + // "icaa12" + // "icaa13" + // "icaa16" + // "icaa18" + // "icaa7" + // "icaaApta" + // "icaaUnrated" + // "icaaX" + IcaaRating string `json:"icaaRating,omitempty"` + + // IfcoRating: The video's Irish Film Classification Office (IFCO - + // Ireland) rating. See the IFCO website for more information. + // + // Possible values: + // "ifco12" + // "ifco12a" + // "ifco15" + // "ifco15a" + // "ifco16" + // "ifco18" + // "ifcoG" + // "ifcoPg" + // "ifcoUnrated" + IfcoRating string `json:"ifcoRating,omitempty"` + + // IlfilmRating: The video's rating in Israel. + // + // Possible values: + // "ilfilm12" + // "ilfilm16" + // "ilfilm18" + // "ilfilmAa" + // "ilfilmUnrated" + IlfilmRating string `json:"ilfilmRating,omitempty"` + + // IncaaRating: The video's INCAA (Instituto Nacional de Cine y Artes + // Audiovisuales - Argentina) rating. + // + // Possible values: + // "incaaAtp" + // "incaaC" + // "incaaSam13" + // "incaaSam16" + // "incaaSam18" + // "incaaUnrated" + IncaaRating string `json:"incaaRating,omitempty"` + + // KfcbRating: The video's rating from the Kenya Film Classification + // Board. + // + // Possible values: + // "kfcb16plus" + // "kfcbG" + // "kfcbPg" + // "kfcbR" + // "kfcbUnrated" + KfcbRating string `json:"kfcbRating,omitempty"` + + // KijkwijzerRating: voor de Classificatie van Audiovisuele Media + // (Netherlands). + // + // Possible values: + // "kijkwijzer12" + // "kijkwijzer16" + // "kijkwijzer18" + // "kijkwijzer6" + // "kijkwijzer9" + // "kijkwijzerAl" + // "kijkwijzerUnrated" + KijkwijzerRating string `json:"kijkwijzerRating,omitempty"` + + // KmrbRating: The video's Korea Media Rating Board + // (영상물등급위원회) rating. The KMRB rates videos in South + // Korea. + // + // Possible values: + // "kmrb12plus" + // "kmrb15plus" + // "kmrbAll" + // "kmrbR" + // "kmrbTeenr" + // "kmrbUnrated" + KmrbRating string `json:"kmrbRating,omitempty"` + + // LsfRating: The video's rating from Indonesia's Lembaga Sensor Film. + // + // Possible values: + // "lsf13" + // "lsf17" + // "lsf21" + // "lsfA" + // "lsfBo" + // "lsfD" + // "lsfR" + // "lsfSu" + // "lsfUnrated" + LsfRating string `json:"lsfRating,omitempty"` + + // MccaaRating: The video's rating from Malta's Film Age-Classification + // Board. + // + // Possible values: + // "mccaa12" + // "mccaa12a" + // "mccaa14" + // "mccaa15" + // "mccaa16" + // "mccaa18" + // "mccaaPg" + // "mccaaU" + // "mccaaUnrated" + MccaaRating string `json:"mccaaRating,omitempty"` + + // MccypRating: The video's rating from the Danish Film Institute's (Det + // Danske Filminstitut) Media Council for Children and Young People. + // + // Possible values: + // "mccyp11" + // "mccyp15" + // "mccyp7" + // "mccypA" + // "mccypUnrated" + MccypRating string `json:"mccypRating,omitempty"` + + // MdaRating: The video's rating from Singapore's Media Development + // Authority (MDA) and, specifically, it's Board of Film Censors (BFC). + // + // Possible values: + // "mdaG" + // "mdaM18" + // "mdaNc16" + // "mdaPg" + // "mdaPg13" + // "mdaR21" + // "mdaUnrated" + MdaRating string `json:"mdaRating,omitempty"` + + // MedietilsynetRating: The video's rating from Medietilsynet, the + // Norwegian Media Authority. + // + // Possible values: + // "medietilsynet11" + // "medietilsynet12" + // "medietilsynet15" + // "medietilsynet18" + // "medietilsynet6" + // "medietilsynet7" + // "medietilsynet9" + // "medietilsynetA" + // "medietilsynetUnrated" + MedietilsynetRating string `json:"medietilsynetRating,omitempty"` + + // MekuRating: The video's rating from Finland's Kansallinen + // Audiovisuaalinen Instituutti (National Audiovisual Institute). + // + // Possible values: + // "meku12" + // "meku16" + // "meku18" + // "meku7" + // "mekuS" + // "mekuUnrated" + MekuRating string `json:"mekuRating,omitempty"` + + // MibacRating: The video's rating from the Ministero dei Beni e delle + // Attività Culturali e del Turismo (Italy). + // + // Possible values: + // "mibacT" + // "mibacUnrated" + // "mibacVap" + // "mibacVm12" + // "mibacVm14" + // "mibacVm18" + MibacRating string `json:"mibacRating,omitempty"` + + // MocRating: The video's Ministerio de Cultura (Colombia) rating. + // + // Possible values: + // "moc12" + // "moc15" + // "moc18" + // "moc7" + // "mocBanned" + // "mocE" + // "mocT" + // "mocUnrated" + // "mocX" + MocRating string `json:"mocRating,omitempty"` + + // MoctwRating: The video's rating from Taiwan's Ministry of Culture + // (文化部). + // + // Possible values: + // "moctwG" + // "moctwP" + // "moctwPg" + // "moctwR" + // "moctwUnrated" + MoctwRating string `json:"moctwRating,omitempty"` + + // MpaaRating: The video's Motion Picture Association of America (MPAA) + // rating. + // + // Possible values: + // "mpaaG" + // "mpaaNc17" + // "mpaaPg" + // "mpaaPg13" + // "mpaaR" + // "mpaaUnrated" + MpaaRating string `json:"mpaaRating,omitempty"` + + // MtrcbRating: The video's rating from the Movie and Television Review + // and Classification Board (Philippines). + // + // Possible values: + // "mtrcbG" + // "mtrcbPg" + // "mtrcbR13" + // "mtrcbR16" + // "mtrcbR18" + // "mtrcbUnrated" + // "mtrcbX" + MtrcbRating string `json:"mtrcbRating,omitempty"` + + // NbcRating: The video's rating from the Maldives National Bureau of + // Classification. + // + // Possible values: + // "nbc12plus" + // "nbc15plus" + // "nbc18plus" + // "nbc18plusr" + // "nbcG" + // "nbcPg" + // "nbcPu" + // "nbcUnrated" + NbcRating string `json:"nbcRating,omitempty"` + + // NbcplRating: The video's rating in Poland. + // + // Possible values: + // "nbcpl18plus" + // "nbcplI" + // "nbcplIi" + // "nbcplIii" + // "nbcplIv" + // "nbcplUnrated" + NbcplRating string `json:"nbcplRating,omitempty"` + + // NfrcRating: The video's rating from the Bulgarian National Film + // Center. + // + // Possible values: + // "nfrcA" + // "nfrcB" + // "nfrcC" + // "nfrcD" + // "nfrcUnrated" + // "nfrcX" + NfrcRating string `json:"nfrcRating,omitempty"` + + // NfvcbRating: The video's rating from Nigeria's National Film and + // Video Censors Board. + // + // Possible values: + // "nfvcb12" + // "nfvcb12a" + // "nfvcb15" + // "nfvcb18" + // "nfvcbG" + // "nfvcbPg" + // "nfvcbRe" + // "nfvcbUnrated" + NfvcbRating string `json:"nfvcbRating,omitempty"` + + // NkclvRating: The video's rating from the Nacionãlais Kino centrs + // (National Film Centre of Latvia). + // + // Possible values: + // "nkclv12plus" + // "nkclv18plus" + // "nkclv7plus" + // "nkclvU" + // "nkclvUnrated" + NkclvRating string `json:"nkclvRating,omitempty"` + + // OflcRating: The video's Office of Film and Literature Classification + // (OFLC - New Zealand) rating. + // + // Possible values: + // "oflcG" + // "oflcM" + // "oflcPg" + // "oflcR13" + // "oflcR15" + // "oflcR16" + // "oflcR18" + // "oflcRp13" + // "oflcRp16" + // "oflcUnrated" + OflcRating string `json:"oflcRating,omitempty"` + + // PefilmRating: The video's rating in Peru. + // + // Possible values: + // "pefilm14" + // "pefilm18" + // "pefilmPg" + // "pefilmPt" + // "pefilmUnrated" + PefilmRating string `json:"pefilmRating,omitempty"` + + // RcnofRating: The video's rating from the Hungarian Nemzeti Filmiroda, + // the Rating Committee of the National Office of Film. + // + // Possible values: + // "rcnofI" + // "rcnofIi" + // "rcnofIii" + // "rcnofIv" + // "rcnofUnrated" + // "rcnofV" + // "rcnofVi" + RcnofRating string `json:"rcnofRating,omitempty"` + + // ResorteviolenciaRating: The video's rating in Venezuela. + // + // Possible values: + // "resorteviolenciaA" + // "resorteviolenciaB" + // "resorteviolenciaC" + // "resorteviolenciaD" + // "resorteviolenciaE" + // "resorteviolenciaUnrated" + ResorteviolenciaRating string `json:"resorteviolenciaRating,omitempty"` + + // RtcRating: The video's General Directorate of Radio, Television and + // Cinematography (Mexico) rating. + // + // Possible values: + // "rtcA" + // "rtcAa" + // "rtcB" + // "rtcB15" + // "rtcC" + // "rtcD" + // "rtcUnrated" + RtcRating string `json:"rtcRating,omitempty"` + + // RteRating: The video's rating from Ireland's Raidió Teilifís + // Éireann. + // + // Possible values: + // "rteCh" + // "rteGa" + // "rteMa" + // "rtePs" + // "rteUnrated" + RteRating string `json:"rteRating,omitempty"` + + // RussiaRating: The video's National Film Registry of the Russian + // Federation (MKRF - Russia) rating. + // + // Possible values: + // "russia0" + // "russia12" + // "russia16" + // "russia18" + // "russia6" + // "russiaUnrated" + RussiaRating string `json:"russiaRating,omitempty"` + + // SkfilmRating: The video's rating in Slovakia. + // + // Possible values: + // "skfilmG" + // "skfilmP2" + // "skfilmP5" + // "skfilmP8" + // "skfilmUnrated" + SkfilmRating string `json:"skfilmRating,omitempty"` + + // SmaisRating: The video's rating in Iceland. + // + // Possible values: + // "smais12" + // "smais14" + // "smais16" + // "smais18" + // "smais7" + // "smaisL" + // "smaisUnrated" + SmaisRating string `json:"smaisRating,omitempty"` + + // SmsaRating: The video's rating from Statens medieråd (Sweden's + // National Media Council). + // + // Possible values: + // "smsa11" + // "smsa15" + // "smsa7" + // "smsaA" + // "smsaUnrated" + SmsaRating string `json:"smsaRating,omitempty"` + + // TvpgRating: The video's TV Parental Guidelines (TVPG) rating. + // + // Possible values: + // "pg14" + // "tvpgG" + // "tvpgMa" + // "tvpgPg" + // "tvpgUnrated" + // "tvpgY" + // "tvpgY7" + // "tvpgY7Fv" + TvpgRating string `json:"tvpgRating,omitempty"` + + // YtRating: A rating that YouTube uses to identify age-restricted + // content. + // + // Possible values: + // "ytAgeRestricted" + YtRating string `json:"ytRating,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AcbRating") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ContentRating) MarshalJSON() ([]byte, error) { + type noMethod ContentRating + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GeoPoint: Geographical coordinates of a point, in WGS84. +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"` + + // ForceSendFields is a list of field names (e.g. "Altitude") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GeoPoint) MarshalJSON() ([]byte, error) { + type noMethod GeoPoint + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GuideCategory: 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. +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"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GuideCategory) MarshalJSON() ([]byte, error) { + type noMethod GuideCategory + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GuideCategoryListResponse) MarshalJSON() ([]byte, error) { + type noMethod GuideCategoryListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// GuideCategorySnippet: Basic details about a guide category. +type GuideCategorySnippet struct { + ChannelId string `json:"channelId,omitempty"` + + // Title: Description of the guide category. + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ChannelId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *GuideCategorySnippet) MarshalJSON() ([]byte, error) { + type noMethod GuideCategorySnippet + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// I18nLanguage: An i18nLanguage resource identifies a UI language +// currently supported by YouTube. +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"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *I18nLanguage) MarshalJSON() ([]byte, error) { + type noMethod I18nLanguage + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *I18nLanguageListResponse) MarshalJSON() ([]byte, error) { + type noMethod I18nLanguageListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// I18nLanguageSnippet: Basic details about an i18n language, such as +// language code and human-readable name. +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"` + + // ForceSendFields is a list of field names (e.g. "Hl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *I18nLanguageSnippet) MarshalJSON() ([]byte, error) { + type noMethod I18nLanguageSnippet + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// I18nRegion: A i18nRegion resource identifies a region where YouTube +// is available. +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"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *I18nRegion) MarshalJSON() ([]byte, error) { + type noMethod I18nRegion + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *I18nRegionListResponse) MarshalJSON() ([]byte, error) { + type noMethod I18nRegionListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// I18nRegionSnippet: Basic details about an i18n region, such as region +// code and human-readable name. +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"` + + // ForceSendFields is a list of field names (e.g. "Gl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *I18nRegionSnippet) MarshalJSON() ([]byte, error) { + type noMethod I18nRegionSnippet + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// ImageSettings: Branding properties for images associated with the +// channel. +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"` + + // ForceSendFields is a list of field names (e.g. "BackgroundImageUrl") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ImageSettings) MarshalJSON() ([]byte, error) { + type noMethod ImageSettings + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// IngestionInfo: Describes information necessary for ingesting an RTMP +// or an HTTP stream. +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"` + + // ForceSendFields is a list of field names (e.g. + // "BackupIngestionAddress") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *IngestionInfo) MarshalJSON() ([]byte, error) { + type noMethod IngestionInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "ImageBytes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InvideoBranding) MarshalJSON() ([]byte, error) { + type noMethod InvideoBranding + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InvideoPosition: 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. +type InvideoPosition struct { + // CornerPosition: Describes in which corner of the video the visual + // widget will appear. + // + // Possible values: + // "bottomLeft" + // "bottomRight" + // "topLeft" + // "topRight" + CornerPosition string `json:"cornerPosition,omitempty"` + + // Type: Defines the position type. + // + // Possible values: + // "corner" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CornerPosition") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InvideoPosition) MarshalJSON() ([]byte, error) { + type noMethod InvideoPosition + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InvideoPromotion: Describes an invideo promotion campaign consisting +// of multiple promoted items. A campaign belongs to a single +// channel_id. +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"` + + // UseSmartTiming: Indicates whether the channel's promotional campaign + // uses "smart timing." This feature attempts to show promotions at a + // point in the video when they are more likely to be clicked and less + // likely to disrupt the viewing experience. This feature also picks up + // a single promotion to show on each video. + UseSmartTiming bool `json:"useSmartTiming,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DefaultTiming") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InvideoPromotion) MarshalJSON() ([]byte, error) { + type noMethod InvideoPromotion + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// InvideoTiming: Describes a temporal position of a visual widget +// inside a video. +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. + // + // Possible values: + // "offsetFromEnd" + // "offsetFromStart" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DurationMs") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InvideoTiming) MarshalJSON() ([]byte, error) { + type noMethod InvideoTiming + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type LanguageTag struct { + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Value") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LanguageTag) MarshalJSON() ([]byte, error) { + type noMethod LanguageTag + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LiveBroadcast: A liveBroadcast resource represents an event that will +// be streamed, via live video, on YouTube. +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"` + + // Statistics: The statistics object contains info about the event's + // current stats. These include concurrent viewers and total chat count. + // Statistics can change (in either direction) during the lifetime of an + // event. Statistics are only returned while the event is live. + Statistics *LiveBroadcastStatistics `json:"statistics,omitempty"` + + // Status: The status object contains information about the event's + // status. + Status *LiveBroadcastStatus `json:"status,omitempty"` + + TopicDetails *LiveBroadcastTopicDetails `json:"topicDetails,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ContentDetails") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LiveBroadcast) MarshalJSON() ([]byte, error) { + type noMethod LiveBroadcast + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LiveBroadcastContentDetails: Detailed settings of a broadcast. +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"` + + EnableLowLatency bool `json:"enableLowLatency,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"` + + // ForceSendFields is a list of field names (e.g. "BoundStreamId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LiveBroadcastContentDetails) MarshalJSON() ([]byte, error) { + type noMethod LiveBroadcastContentDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LiveBroadcastListResponse) MarshalJSON() ([]byte, error) { + type noMethod LiveBroadcastListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + IsDefaultBroadcast bool `json:"isDefaultBroadcast,omitempty"` + + // LiveChatId: The id of the live chat for this broadcast. + LiveChatId string `json:"liveChatId,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"` + + // ForceSendFields is a list of field names (e.g. "ActualEndTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LiveBroadcastSnippet) MarshalJSON() ([]byte, error) { + type noMethod LiveBroadcastSnippet + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LiveBroadcastStatistics: Statistics about the live broadcast. These +// represent a snapshot of the values at the time of the request. +// Statistics are only returned for live broadcasts. +type LiveBroadcastStatistics struct { + // ConcurrentViewers: 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. + ConcurrentViewers uint64 `json:"concurrentViewers,omitempty,string"` + + // TotalChatCount: The total number of live chat messages currently on + // the broadcast. The property and its value will be present if the + // broadcast is public, has the live chat feature enabled, and has at + // least one message. Note that this field will not be filled after the + // broadcast ends. So this property would not identify the number of + // chat messages for an archived video of a completed live broadcast. + TotalChatCount uint64 `json:"totalChatCount,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "ConcurrentViewers") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LiveBroadcastStatistics) MarshalJSON() ([]byte, error) { + type noMethod LiveBroadcastStatistics + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type LiveBroadcastStatus struct { + // LifeCycleStatus: The broadcast's status. The status can be updated + // using the API's liveBroadcasts.transition method. + // + // Possible values: + // "abandoned" + // "complete" + // "completeStarting" + // "created" + // "live" + // "liveStarting" + // "ready" + // "reclaimed" + // "revoked" + // "testStarting" + // "testing" + LifeCycleStatus string `json:"lifeCycleStatus,omitempty"` + + // LiveBroadcastPriority: Priority of the live broadcast event (internal + // state). + // + // Possible values: + // "high" + // "low" + // "normal" + LiveBroadcastPriority string `json:"liveBroadcastPriority,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. + // + // Possible values: + // "private" + // "public" + // "unlisted" + PrivacyStatus string `json:"privacyStatus,omitempty"` + + // RecordingStatus: The broadcast's recording status. + // + // Possible values: + // "notRecording" + // "recorded" + // "recording" + RecordingStatus string `json:"recordingStatus,omitempty"` + + // ForceSendFields is a list of field names (e.g. "LifeCycleStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LiveBroadcastStatus) MarshalJSON() ([]byte, error) { + type noMethod LiveBroadcastStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type LiveBroadcastTopic struct { + // Snippet: Information about the topic matched. + Snippet *LiveBroadcastTopicSnippet `json:"snippet,omitempty"` + + // Type: The type of the topic. + // + // Possible values: + // "videoGame" + Type string `json:"type,omitempty"` + + // Unmatched: If this flag is set it means that we have not been able to + // match the topic title and type provided to a known entity. + Unmatched bool `json:"unmatched,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Snippet") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LiveBroadcastTopic) MarshalJSON() ([]byte, error) { + type noMethod LiveBroadcastTopic + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type LiveBroadcastTopicDetails struct { + Topics []*LiveBroadcastTopic `json:"topics,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Topics") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LiveBroadcastTopicDetails) MarshalJSON() ([]byte, error) { + type noMethod LiveBroadcastTopicDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type LiveBroadcastTopicSnippet struct { + // Name: The name of the topic. + Name string `json:"name,omitempty"` + + // ReleaseDate: The date at which the topic was released. Filled for + // types: videoGame + ReleaseDate string `json:"releaseDate,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LiveBroadcastTopicSnippet) MarshalJSON() ([]byte, error) { + type noMethod LiveBroadcastTopicSnippet + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LiveStream: A live stream describes a live ingestion point. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Cdn") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LiveStream) MarshalJSON() ([]byte, error) { + type noMethod LiveStream + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type LiveStreamConfigurationIssue struct { + // Description: The long-form description of the issue and how to + // resolve it. + Description string `json:"description,omitempty"` + + // Reason: The short-form reason for this issue. + Reason string `json:"reason,omitempty"` + + // Severity: How severe this issue is to the stream. + // + // Possible values: + // "error" + // "info" + // "warning" + Severity string `json:"severity,omitempty"` + + // Type: The kind of error happening. + // + // Possible values: + // "audioBitrateHigh" + // "audioBitrateLow" + // "audioBitrateMismatch" + // "audioCodec" + // "audioCodecMismatch" + // "audioSampleRate" + // "audioSampleRateMismatch" + // "audioStereoMismatch" + // "audioTooManyChannels" + // "badContainer" + // "bitrateHigh" + // "bitrateLow" + // "frameRateHigh" + // "framerateMismatch" + // "gopMismatch" + // "gopSizeLong" + // "gopSizeOver" + // "gopSizeShort" + // "interlacedVideo" + // "multipleAudioStreams" + // "multipleVideoStreams" + // "noAudioStream" + // "noVideoStream" + // "openGop" + // "resolutionMismatch" + // "videoBitrateMismatch" + // "videoCodec" + // "videoCodecMismatch" + // "videoIngestionStarved" + // "videoInterlaceMismatch" + // "videoProfileMismatch" + // "videoResolutionSuboptimal" + // "videoResolutionUnsupported" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LiveStreamConfigurationIssue) MarshalJSON() ([]byte, error) { + type noMethod LiveStreamConfigurationIssue + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LiveStreamContentDetails: Detailed settings of a stream. +type LiveStreamContentDetails struct { + // ClosedCaptionsIngestionUrl: The ingestion URL where the closed + // captions of this stream are sent. + ClosedCaptionsIngestionUrl string `json:"closedCaptionsIngestionUrl,omitempty"` + + // IsReusable: Indicates whether the stream is reusable, which means + // that it can be bound to multiple broadcasts. It is common for + // broadcasters to reuse the same stream for many different broadcasts + // if those broadcasts occur at different times. + // + // If you set this value to false, then the stream will not be reusable, + // which means that it can only be bound to one broadcast. Non-reusable + // streams differ from reusable streams in the following ways: + // - A non-reusable stream can only be bound to one broadcast. + // - A non-reusable stream might be deleted by an automated process + // after the broadcast ends. + // - The liveStreams.list method does not list non-reusable streams if + // you call the method and set the mine parameter to true. The only way + // to use that method to retrieve the resource for a non-reusable stream + // is to use the id parameter to identify the stream. + IsReusable bool `json:"isReusable,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "ClosedCaptionsIngestionUrl") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LiveStreamContentDetails) MarshalJSON() ([]byte, error) { + type noMethod LiveStreamContentDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type LiveStreamHealthStatus struct { + // ConfigurationIssues: The configurations issues on this stream + ConfigurationIssues []*LiveStreamConfigurationIssue `json:"configurationIssues,omitempty"` + + // LastUpdateTimeSeconds: The last time this status was updated (in + // seconds) + LastUpdateTimeSeconds uint64 `json:"lastUpdateTimeSeconds,omitempty,string"` + + // Status: The status code of this stream + // + // Possible values: + // "bad" + // "good" + // "noData" + // "ok" + // "revoked" + Status string `json:"status,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ConfigurationIssues") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LiveStreamHealthStatus) MarshalJSON() ([]byte, error) { + type noMethod LiveStreamHealthStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LiveStreamListResponse) MarshalJSON() ([]byte, error) { + type noMethod LiveStreamListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + IsDefaultStream bool `json:"isDefaultStream,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"` + + // ForceSendFields is a list of field names (e.g. "ChannelId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LiveStreamSnippet) MarshalJSON() ([]byte, error) { + type noMethod LiveStreamSnippet + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// LiveStreamStatus: Brief description of the live stream status. +type LiveStreamStatus struct { + // HealthStatus: The health status of the stream. + HealthStatus *LiveStreamHealthStatus `json:"healthStatus,omitempty"` + + // Possible values: + // "active" + // "created" + // "error" + // "inactive" + // "ready" + StreamStatus string `json:"streamStatus,omitempty"` + + // ForceSendFields is a list of field names (e.g. "HealthStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LiveStreamStatus) MarshalJSON() ([]byte, error) { + type noMethod LiveStreamStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type LocalizedProperty struct { + Default string `json:"default,omitempty"` + + // DefaultLanguage: The language of the default property. + DefaultLanguage *LanguageTag `json:"defaultLanguage,omitempty"` + + Localized []*LocalizedString `json:"localized,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Default") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LocalizedProperty) MarshalJSON() ([]byte, error) { + type noMethod LocalizedProperty + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type LocalizedString struct { + Language string `json:"language,omitempty"` + + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Language") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *LocalizedString) MarshalJSON() ([]byte, error) { + type noMethod LocalizedString + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// MonitorStreamInfo: Settings and Info of the monitor stream +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"` + + // ForceSendFields is a list of field names (e.g. + // "BroadcastStreamDelayMs") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MonitorStreamInfo) MarshalJSON() ([]byte, error) { + type noMethod MonitorStreamInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PageInfo: Paging details for lists of resources, including total +// number of items available and number of resources returned in a +// single page. +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"` + + // ForceSendFields is a list of field names (e.g. "ResultsPerPage") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PageInfo) MarshalJSON() ([]byte, error) { + type noMethod PageInfo + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// Playlist: 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. +// +// YouTube also uses playlists to identify special collections of videos +// for a channel, such as: +// - uploaded videos +// - favorite videos +// - positively rated (liked) videos +// - watch history +// - 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. +// +// 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. +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"` + + // Localizations: Localizations for different languages + Localizations map[string]PlaylistLocalization `json:"localizations,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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ContentDetails") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Playlist) MarshalJSON() ([]byte, error) { + type noMethod Playlist + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PlaylistContentDetails struct { + // ItemCount: The number of videos in the playlist. + ItemCount int64 `json:"itemCount,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ItemCount") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlaylistContentDetails) MarshalJSON() ([]byte, error) { + type noMethod PlaylistContentDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlaylistItem: 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. +// +// YouTube uses playlists to identify special collections of videos for +// a channel, such as: +// - uploaded videos +// - favorite videos +// - positively rated (liked) videos +// - watch history +// - 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. 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. +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ContentDetails") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlaylistItem) MarshalJSON() ([]byte, error) { + type noMethod PlaylistItem + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ForceSendFields is a list of field names (e.g. "EndAt") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlaylistItemContentDetails) MarshalJSON() ([]byte, error) { + type noMethod PlaylistItemContentDetails + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlaylistItemListResponse) MarshalJSON() ([]byte, error) { + type noMethod PlaylistItemListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlaylistItemSnippet: Basic details about a playlist, including title, +// description and thumbnails. +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"` + + // ForceSendFields is a list of field names (e.g. "ChannelId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlaylistItemSnippet) MarshalJSON() ([]byte, error) { + type noMethod PlaylistItemSnippet + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlaylistItemStatus: Information about the playlist item's privacy +// status. +type PlaylistItemStatus struct { + // PrivacyStatus: This resource's privacy status. + // + // Possible values: + // "private" + // "public" + // "unlisted" + PrivacyStatus string `json:"privacyStatus,omitempty"` + + // ForceSendFields is a list of field names (e.g. "PrivacyStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlaylistItemStatus) MarshalJSON() ([]byte, error) { + type noMethod PlaylistItemStatus + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +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"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlaylistListResponse) MarshalJSON() ([]byte, error) { + type noMethod PlaylistListResponse + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +// PlaylistLocalization: Playlist localization setting +type PlaylistLocalization struct { + // Description: The localized strings for playlist's description. + Description string `json:"description,omitempty"` + + // Title: The localized strings for playlist's title. + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *PlaylistLocalization) MarshalJSON() ([]byte, error) { + type noMethod PlaylistLocalization + raw := noMethod(*s) + return internal.MarshalJSON(raw, s.ForceSendFields) +} + +type PlaylistPlayer struct { + // EmbedHtml: An